Bug 747297

Summary: useradd -d fails to create user with non-existent directory
Product: [Fedora] Fedora Reporter: Marcela Mašláňová <mmaslano>
Component: shadow-utilsAssignee: Peter Vrabec <pvrabec>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: pvrabec, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-10 13:42:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marcela Mašláňová 2011-10-19 12:32:15 UTC
Description of problem:
If directory used with -d option doesn't exist or can't be created, the user is not created. According to the documentation it should work.

Version-Release number of selected component (if applicable):
shadow-utils-4.1.4.3-7.fc16.x86_64

How reproducible:
useradd -d /nonexisting_dir/nonexisting_dir2 user

Steps to Reproduce:
1. useradd -d /nonexisting_dir/nonexisting_dir2 user
2. Output will be:
useradd: cannot create directory /nonexisting_dir/nonexisting_dir2
3. user is not created
  
Actual results:


Expected results:
User will be created:
-d, --home HOME_DIR
The new user will be created using HOME_DIR as the value for the user's login directory. The default is to append the LOGIN name to BASE_DIR and use that as the login directory name. The directory HOME_DIR does not have to exist but will not be created if it is missing.

Additional info:
This was working in RHEL-5.

Comment 1 Marcela Mašláňová 2011-11-10 13:42:10 UTC
I can't reproduce it any more.