Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 192737 - sys-apps/shadow-4.0.18.1 - useradd's -b/--base-dir switch misbehaves or is badly documented
Summary: sys-apps/shadow-4.0.18.1 - useradd's -b/--base-dir switch misbehaves or is ba...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High minor
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-16 21:30 UTC by Lars Wendler (Polynomial-C) (RETIRED)
Modified: 2009-02-11 05:39 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2007-09-16 21:30:43 UTC
Hi,

I already talked about this in the forums but I was asked to report it here. So I just quote my initial post from the forum here:

---------------------------------------------------------------------------------
Hi,

today I tried to use useradd the following way:

useradd -b /some/path -m -s /bin/false someusername

My intention is to get the homedir created at the top of /some/path but useradd alway prints out its --help screen and doesn't create the user. The exitcode is always 2 which useradd's manpage explains as "invalid command syntax". When I replace "-b /some/path" with "-d /some/path/someusername" the user gets created.
So what's going wrong here? Do I use the -b switch wrong? Or is this a bug in useradd?

Cheers
Poly-C
-----------------------------------------------------------------------------

Someone responded that this seems to be intended behavior and that -b only works in conjunction with -D. But if that is true, then the useradd(8) manpage is wrong as it lists the -b switch twice and one listing explains -b as being useable without -D switch...

Cheers
Poly-C

Reproducible: Always

Steps to Reproduce:
1. useradd -b /some/path -m -s /bin/false someusername ; echo $?
2. useradd shows --help message and existatus of 2 which means "invalid command syntax"

Actual Results:  
"useradd -b /some/path -m -s /bin/false someusername" doesn't create the account

Expected Results:  
Same as with "useradd -d /some/path/someusername -m -s /bin/false someusername"
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2007-09-16 21:31:27 UTC
fixed summary
Comment 2 SpanKY gentoo-dev 2009-02-11 05:39:06 UTC
this seems to be fixed with shadow 4.1.2.2