Bug 235641 - useradd dumps core when build without WITH_SELINUX
useradd dumps core when build without WITH_SELINUX
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: shadow-utils (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-08 19:52 EDT by Wolfgang Denk
Modified: 2007-11-30 17:12 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-04-10 06:25:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Wolfgang Denk 2007-04-08 19:52:03 EDT
Description of problem:

The "useradd" command will dump core if shadow-utils gets built without SELINUX
support.

Version-Release number of selected component (if applicable):

shadow-utils-4.0.18.1-12.fc7.src.rpm

How reproducible:

Steps to Reproduce:
1. Build shadow-utils without SELINUX support
2. Install it
3. Run "useradd ... -u user ..."
  
Actual results:

Core dump.

Expected results:

User added.

Additional info:

Patch "shadow-4.0.17-useradd.patch" contains this hunk:

        --- shadow-4.0.17/src/useradd.c.useradd 2007-01-16 18:24:34.000000000 +0100
        +++ shadow-4.0.17/src/useradd.c 2007-01-16 18:24:34.000000000 +0100
        ...
        @@ -1048,11 +1054,18 @@
        ...
        -                       getopt_long (argc, argv,
"b:c:d:De:f:g:G:k:K:mlMnrop:s:u:",
        +#ifdef WITH_SELINUX
        +                       getopt_long (argc, argv,
"b:c:d:De:f:g:G:k:K:mlMnrop:s:u:Z:",
        +#else
        +                       getopt_long (argc, argv,
"b:c:d:De:f:g:G:k:K:mlMnrop:s:u",
        +#endif

   The code in the #else part is wrong - it drops the colon  for  the
   -u  option,  which  causes  the  useradd command to dump core when
   built without the  WITH_SELINUX  setting.  The  code  should  read
   instead:

        ...
        +#else
        +                       getopt_long (argc, argv,
"b:c:d:De:f:g:G:k:K:mlMnrop:s:u:",
        +#endif
Comment 1 Peter Vrabec 2007-04-10 06:19:15 EDT
thnx. Wolfgang, 
it's fixed in shadow-utils-4.0.18.1-13.fc7

Note You need to log in before you can comment on or make changes to this bug.