Обеспечение членства в группе wheel достаточным для su в SLES 2015

Да, bashиспользует waitpid()с WNOHANGв цикле. Вы можете увидеть это в waitchld()вjobs.c:

static int
waitchld (wpid, block)
     pid_t wpid;
     int block;
{

...

  do
    {
      /* We don't want to be notified about jobs stopping if job control
         is not active.  XXX - was interactive_shell instead of job_control */
      waitpid_flags = (job_control && subshell_environment == 0)
                        ? (WUNTRACED|wcontinued)
                        : 0;
      if (sigchld || block == 0)
        waitpid_flags |= WNOHANG;

...

  if (block == 1 && queue_sigchld == 0 && (waitpid_flags & WNOHANG) == 0)
    {
      internal_warning (_("waitchld: turning on WNOHANG to avoid indefinite block"));
      waitpid_flags |= WNOHANG;
    }

  pid = WAITPID (-1, &status, waitpid_flags);

...

  /* We have successfully recorded the useful information about this process
     that has just changed state.  If we notify asynchronously, and the job
     that this process belongs to is no longer running, then notify the user
     of that fact now. */
  if (asynchronous_notification && interactive)
    notify_of_job_status ();

  return (children_exited);
}

Функция notify_of_job_status()просто записывает в стандартный поток ошибок процесса bash.

К сожалению, я не могу много сказать о том, должна ли настройка tostopсsttyвлиять на оболочку, в которой вы это делаете.

0
26.02.2020, 15:34
1 ответ

I entered it manually, after the other auth commands, but - it doesn't work.

Порядок элементов в стеке важен, так как PAM проходит через них последовательно.

Цитирование (изman pam.conf)соответствующего объяснения того, что делает достаточный управляющий флаг:

if such a module succeeds and no prior required module has failed the PAM framework returns success to the application or to the superior PAM stack immediately without calling any further modules in the stack. A failure of a sufficient module is ignored and processing of the PAM module stack continues unaffected.

Таким образом, порядок элементов аутентификации в /etc/pam.d/su, вероятно, должен быть:

auth        sufficient  pam_rootok.so
auth        sufficient  pam_wheel.so trust
auth        required    pam_unix.so

В противном случае вас попросят ввести пароль (через строку pam _unix или возможные другие записи ).

1
28.04.2021, 23:22

Теги

Похожие вопросы