diff options
Diffstat (limited to 'ports/linux')
-rw-r--r-- | ports/linux/guts/__xmknodat.c | 5 | ||||
-rw-r--r-- | ports/linux/guts/openat.c | 10 |
2 files changed, 9 insertions, 6 deletions
diff --git a/ports/linux/guts/__xmknodat.c b/ports/linux/guts/__xmknodat.c index 49b2f8f..59b4f2f 100644 --- a/ports/linux/guts/__xmknodat.c +++ b/ports/linux/guts/__xmknodat.c @@ -31,10 +31,11 @@ return -1; } #ifdef PSEUDO_NO_REAL_AT_FUNCTIONS - rc = real_open(path, O_CREAT | O_WRONLY | O_EXCL, PSEUDO_FS_MODE(mode)); + rc = real_open(path, O_CREAT | O_WRONLY | O_EXCL, + PSEUDO_FS_MODE(mode, 0)); #else rc = real_openat(dirfd, path, O_CREAT | O_WRONLY | O_EXCL, - PSEUDO_FS_MODE(mode)); + PSEUDO_FS_MODE(mode, 0)); #endif if (rc == -1) { return -1; diff --git a/ports/linux/guts/openat.c b/ports/linux/guts/openat.c index c245796..14d6c2a 100644 --- a/ports/linux/guts/openat.c +++ b/ports/linux/guts/openat.c @@ -30,13 +30,15 @@ errno = save_errno; } - /* because we are not actually root, secretly mask in 0700 to the - * underlying mode + /* because we are not actually root, secretly mask in 0600 to the + * underlying mode. The ", 0" is because the only time mode matters + * is if a file is going to be created, in which case it's + * not a directory. */ #ifdef PSEUDO_NO_REAL_AT_FUNCTIONS - rc = real_open(path, flags, PSEUDO_FS_MODE(mode)); + rc = real_open(path, flags, PSEUDO_FS_MODE(mode, 0)); #else - rc = real_openat(dirfd, path, flags, PSEUDO_FS_MODE(mode)); + rc = real_openat(dirfd, path, flags, PSEUDO_FS_MODE(mode, 0)); #endif save_errno = errno; |