Summary: | userdel exits with a bad status always | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Scott Beck <sbeck> |
Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gentoo |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Patch to fix exit status when using PAM |
Description
Scott Beck
2004-10-07 13:37:22 UTC
This comes down to what appears to be a bug in userdel.c when PAM is enabled. In some places where a PAM error occurs, the code looks roughly like: if (retval != PAM_SUCCESS) { fprintf (stderr, _("%s: some error message\n"), Prog); exit (1); } However, the PAM-specific code at line 813 appears to have a rather obvious bug: if (retval != PAM_SUCCESS) fprintf (stderr, _("%s: PAM chauthtok failed\n"), Prog); exit (1); if (retval == PAM_SUCCESS) pam_end (pamh, PAM_SUCCESS); It would certainly appear that the bug lies in the lack of { } around the first if statement - the exit (1) should only happen if retval != PAM_SUCCESS, but as is currently present, exit (1) *always* happens. Created attachment 41322 [details, diff] Patch to fix exit status when using PAM This patch fixes the problem; the following should be added to the shadow ebuild: # userdel has a bug when PAM is enabled that causes it to always exit with # exit status 1 when successful. This should close bug #66687. use pam && epatch ${FILESDIR}/${P}-userdel-pam-exit-status.patch sys-apps/shadow-4.0.4.1-r4 now in portage, thanks for the patch :) also tried mailing it to the current maintainer and the shadow list since the cvs version still contains this bug |