Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149516406
D46443.1790331892.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
585 B
Referenced Files
None
Subscribers
None
D46443.1790331892.diff
View Options
diff --git a/usr.sbin/pw/cpdir.c b/usr.sbin/pw/cpdir.c
--- a/usr.sbin/pw/cpdir.c
+++ b/usr.sbin/pw/cpdir.c
@@ -49,9 +49,19 @@
if (*dir == '/')
dir++;
- if (mkdirat(rootfd, dir, mode) != 0 && errno != EEXIST) {
- warn("mkdir(%s)", dir);
- return;
+ if (mkdirat(rootfd, dir, mode) != 0) {
+ mode_t pumask;
+
+ if (errno != EEXIST) {
+ warn("mkdir(%s)", dir);
+ return;
+ }
+
+ pumask = umask(0);
+ umask(pumask);
+
+ (void)fchmodat(rootfd, dir, mode & ~pumask,
+ AT_SYMLINK_NOFOLLOW);
}
fchownat(rootfd, dir, uid, gid, AT_SYMLINK_NOFOLLOW);
if (flags > 0)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Sep 25, 10:24 AM (1 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29917896
Default Alt Text
D46443.1790331892.diff (585 B)
Attached To
Mode
D46443: pw: set the user's home directory mode if it existed
Attached
Detach File
Event Timeline
Log In to Comment