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 317339 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 add error message and change man pages
shadow-461455-newusers_parentdir.patch (text/plain), 3.79 KB, created by
Michael Kearey
on 2008-09-22 06:29:59 UTC
(
hide
)
Description:
Patch to add error message and change man pages
Filename:
MIME Type:
Creator:
Michael Kearey
Created:
2008-09-22 06:29:59 UTC
Size:
3.79 KB
patch
obsolete
>Only in shadow-4.0.17/libmisc: system.c.useradd >diff -rup shadow-4.0.17.newusers_parentdir/man/newusers.8 shadow-4.0.17/man/newusers.8 >--- shadow-4.0.17.newusers_parentdir/man/newusers.8 2006-06-24 16:11:55.000000000 +1000 >+++ shadow-4.0.17/man/newusers.8 2008-09-22 16:00:54.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 to create the home directory if the parent directories do not exist, and will send a message to stderr informing the user of the failure. The newusers command will not halt or return a failure to the calling shell if it fails to create the home directory, it will continue to process the batch of new users specified. > .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.newusers_parentdir/man/newusers.8.xml shadow-4.0.17/man/newusers.8.xml >--- shadow-4.0.17.newusers_parentdir/man/newusers.8.xml 2006-06-17 02:11:03.000000000 +1000 >+++ shadow-4.0.17/man/newusers.8.xml 2008-09-22 16:00:59.000000000 +1000 >@@ -76,7 +76,14 @@ > 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 newusers command will fail to create the home >+ directory if the parent directories do not exist, and will send >+ a message to stderr informing the user of the failure. The >+ newusers command will not halt or return a failure to the >+ calling shell if it fails to create the home directory, it will >+ continue to process the batch of new users specified. > </para> > </listitem> > </varlistentry> >Only in shadow-4.0.17.newusers_parentdir: shadow-4.0.17 >diff -rup shadow-4.0.17.newusers_parentdir/src/newusers.c shadow-4.0.17/src/newusers.c >--- shadow-4.0.17.newusers_parentdir/src/newusers.c 2008-09-22 15:58:50.000000000 +1000 >+++ shadow-4.0.17/src/newusers.c 2008-09-22 16:00:36.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