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 158482 Details for
Bug 246681
umask not honored in mkhomedir
[?]
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]
epipe_octals
oddjob-0.27-1-epipe_octals.patch (text/plain), 1.41 KB, created by
Jose Plans
on 2007-07-03 22:18:41 UTC
(
hide
)
Description:
epipe_octals
Filename:
MIME Type:
Creator:
Jose Plans
Created:
2007-07-03 22:18:41 UTC
Size:
1.41 KB
patch
obsolete
>--- oddjob-0.27-1/src/mkhomedir.c.epipe_octals 2006-04-05 23:44:37.000000000 +0100 >+++ oddjob-0.27-1/src/mkhomedir.c 2007-07-03 18:31:10.000000000 +0100 >@@ -47,6 +47,8 @@ > #include "util.h" > > #define _(_x) _x >+#define isoctal(c) \ >+ ((c) >= '0' && (c) <= '7') > > #ident "$Id: mkhomedir.c,v 1.10 2006/04/05 22:44:37 nalin Exp $" > >@@ -247,7 +249,8 @@ int > main(int argc, char **argv) > { > char **args; >- int i, flags = FLAG_POPULATE; >+ char buf[BUFSIZ]; >+ int i, j, octal = 1, flags = FLAG_POPULATE; > > openlog(PACKAGE "-mkhomedir", LOG_PID, LOG_DAEMON); > override_umask = umask(0777); >@@ -266,9 +269,29 @@ main(int argc, char **argv) > skel_dir = optarg; > break; > case 'u': >- override_umask = atoi(optarg); >+ /* Check if optarg contains valid octals. >+ We might just trust strtol() returning 0 >+ but then, if someone makes a typo we >+ allow world writeable files. - jmp */ >+ >+ for (j = 0; *(optarg+j); j++) >+ if (!isoctal (*(optarg+j))) { >+ octal = 0; >+ break; >+ } >+ >+ if (!octal) { >+ fgets(buf, sizeof(buf), stdin); /* Prevent EPIPE */ >+ syslog(LOG_ERR, "Invalid value for umask (%s)", optarg); >+ closelog(); >+ return EINVAL; >+ } >+ >+ override_umask = strtol(optarg, NULL, 8); > break; > default: >+ fgets(buf, sizeof(buf), stdin); /* Prevent EPIPE */ >+ > fprintf(stderr, "Valid options:\n" > "-n\tDo not populate home directories, " > "just create them.\n"
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 246681
:
158482
|
281471