Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 316050 Details for
Bug 461455
newusers will fail with an uninformative message if the new user's parent directory does not exist
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch to resolve newusers error message
shadow-461455-newusers_parentdir.patch (text/plain), 3.12 KB, created by
Michael Kearey
on 2008-09-08 07:46:00 UTC
(
hide
)
Description:
patch to resolve newusers error message
Filename:
MIME Type:
Creator:
Michael Kearey
Created:
2008-09-08 07:46:00 UTC
Size:
3.12 KB
patch
obsolete
>diff -rup shadow-4.0.17/man/newusers.8 shadow-4.0.17.newusers_parentdir/man/newusers.8 >--- shadow-4.0.17/man/newusers.8 2006-06-24 16:11:55.000000000 +1000 >+++ shadow-4.0.17.newusers_parentdir/man/newusers.8 2008-09-08 17:22:16.000000000 +1000 >@@ -32,7 +32,7 @@ This field will be ignored for shadow pa > This field may be the name of an existing group, in which case the named user will be added as a member. If a non\-existent numerical group is given, a new group will be created having this number. > .TP 3n > \fIpw_dir\fR >-This field will be checked for existence as a directory and a new directory with the same name will be created if it does not already exist. The ownership of the directory will be set to be that of the user being created or updated. >+This field will be checked for existence as a directory and a new directory with the same name will be created if it does not already exist. The ownership of the directory will be set to be that of the user being created or updated. Note that newusers does not create parent directories of the new user's home directory. The newusers command will fail if the parent directories do not exist. > .PP > This command is intended to be used in a large system environment where many accounts are updated at a single time. > .SH "CAVEATS" >diff -rup shadow-4.0.17/man/newusers.8.xml shadow-4.0.17.newusers_parentdir/man/newusers.8.xml >--- shadow-4.0.17/man/newusers.8.xml 2006-06-17 02:11:03.000000000 +1000 >+++ shadow-4.0.17.newusers_parentdir/man/newusers.8.xml 2008-09-08 17:23:27.000000000 +1000 >@@ -76,7 +76,10 @@ > This field will be checked for existence as a directory and a > new directory with the same name will be created if it does not > already exist. The ownership of the directory will be set to be >- that of the user being created or updated. >+ that of the user being created or updated. Note that newusers >+ does not create parent directories of the new user's home >+ directory. The ewusers command will fail if the parent >+ directories do not exist. > </para> > </listitem> > </varlistentry> >diff -rup shadow-4.0.17/src/newusers.c shadow-4.0.17.newusers_parentdir/src/newusers.c >--- shadow-4.0.17/src/newusers.c 2008-09-08 16:56:42.000000000 +1000 >+++ shadow-4.0.17.newusers_parentdir/src/newusers.c 2008-09-08 17:19:51.000000000 +1000 >@@ -43,6 +43,7 @@ > #include <pwd.h> > #include <grp.h> > #include <fcntl.h> >+#include <errno.h> > #ifdef USE_PAM > #include "pam_defs.h" > #endif /* USE_PAM */ >@@ -53,6 +54,7 @@ > #include "nscd.h" > #include "pwio.h" > #include "shadowio.h" >+#include "error.h" > /* > * Global variables > */ >@@ -477,9 +479,14 @@ int main (int argc, char **argv) > if (mkdir (newpw.pw_dir, > 0777 & ~getdef_num ("UMASK", > GETDEF_DEFAULT_UMASK))) >- fprintf (stderr, >- _("%s: line %d: mkdir failed\n"), Prog, >- line); >+ if ( errno == ENOENT ) >+ fprintf (stderr, >+ _("%s: line %d: mkdir failed - no parent directory\n"), Prog, >+ line); >+ else >+ fprintf (stderr, >+ _("%s: line %d: mkdir failed\n"), Prog, >+ line); > else if (chown > (newpw.pw_dir, newpw.pw_uid, newpw.pw_gid)) > fprintf (stderr,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 461455
:
316050
|
317339