Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 191236 - sys-apps/shadow-4.0.18.1-r1 - useradd option --defaults doesn'twork
Summary: sys-apps/shadow-4.0.18.1-r1 - useradd option --defaults doesn'twork
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-04 13:04 UTC by Roumano
Modified: 2009-02-11 05:37 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to fix "--defaults" option to match "-D" option (make it have optional args). (useradd.patch,547 bytes, patch)
2007-09-04 15:17 UTC, Roderick B. Greening
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roumano 2007-09-04 13:04:59 UTC
The option " --defaults " isn't not working;

useradd --defaults
useradd: option `--defaults' requires an argument

But the -D is working.

 useradd -D        
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=no



Usage: useradd [options] LOGIN
Options:
  -D, --defaults                print or save modified default useradd
                                configuration
I'm using the sys-apps/shadow-4.0.18.1-r1 (/usr/sbin/useradd) ( lastest )
Comment 1 Roderick B. Greening 2007-09-04 15:17:54 UTC
Created attachment 129997 [details, diff]
Patch to fix "--defaults" option to match "-D" option (make it have optional args).

I have tested this.

The struct incorrectly requires --defaults to have an argument, when clearly the app was designed to take -D or --defaults with optional args (if no arg, then display the defaults).

This patch fixes that case to work correctly.
Comment 2 SpanKY gentoo-dev 2009-02-11 05:37:02 UTC
this has been fixed in latest code:
            {"defaults", no_argument, NULL, 'D'},