* syscalls.cc (FILTERED_MODE): Define valid chmod mode mask.
(chmod): Call fh->fchmod with filtered mode. (fchmod): Ditto.
This commit is contained in:
parent
cb1f8161c1
commit
2762ac6c19
|
@ -1,3 +1,9 @@
|
||||||
|
2008-05-21 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* syscalls.cc (FILTERED_MODE): Define valid chmod mode mask.
|
||||||
|
(chmod): Call fh->fchmod with filtered mode.
|
||||||
|
(fchmod): Ditto.
|
||||||
|
|
||||||
2008-05-20 Corinna Vinschen <corinna@vinschen.de>
|
2008-05-20 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Fix test for
|
* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Fix test for
|
||||||
|
|
|
@ -1119,6 +1119,9 @@ chmod_device (path_conv& pc, mode_t mode)
|
||||||
return mknod_worker (pc.get_win32 (), pc.dev.mode & S_IFMT, mode, pc.dev.major, pc.dev.minor);
|
return mknod_worker (pc.get_win32 (), pc.dev.mode & S_IFMT, mode, pc.dev.major, pc.dev.minor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define FILTERED_MODE(m) ((m) & (S_ISUID | S_ISGID | S_ISVTX \
|
||||||
|
| S_IRWXU | S_IRWXG | S_IRWXO))
|
||||||
|
|
||||||
/* chmod: POSIX 5.6.4.1 */
|
/* chmod: POSIX 5.6.4.1 */
|
||||||
extern "C" int
|
extern "C" int
|
||||||
chmod (const char *path, mode_t mode)
|
chmod (const char *path, mode_t mode)
|
||||||
|
@ -1134,7 +1137,7 @@ chmod (const char *path, mode_t mode)
|
||||||
set_errno (fh->error ());
|
set_errno (fh->error ());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
res = fh->fchmod (mode);
|
res = fh->fchmod (FILTERED_MODE (mode));
|
||||||
|
|
||||||
delete fh;
|
delete fh;
|
||||||
error:
|
error:
|
||||||
|
@ -1154,7 +1157,7 @@ fchmod (int fd, mode_t mode)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return cfd->fchmod (mode);
|
return cfd->fchmod (FILTERED_MODE (mode));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue