* syscalls.cc (FILTERED_MODE): Define valid chmod mode mask.

(chmod): Call fh->fchmod with filtered mode.
	(fchmod): Ditto.
This commit is contained in:
Corinna Vinschen 2008-05-21 08:05:53 +00:00
parent cb1f8161c1
commit 2762ac6c19
2 changed files with 11 additions and 2 deletions

View File

@ -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>
* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Fix test for

View File

@ -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);
}
#define FILTERED_MODE(m) ((m) & (S_ISUID | S_ISGID | S_ISVTX \
| S_IRWXU | S_IRWXG | S_IRWXO))
/* chmod: POSIX 5.6.4.1 */
extern "C" int
chmod (const char *path, mode_t mode)
@ -1134,7 +1137,7 @@ chmod (const char *path, mode_t mode)
set_errno (fh->error ());
}
else
res = fh->fchmod (mode);
res = fh->fchmod (FILTERED_MODE (mode));
delete fh;
error:
@ -1154,7 +1157,7 @@ fchmod (int fd, mode_t mode)
return -1;
}
return cfd->fchmod (mode);
return cfd->fchmod (FILTERED_MODE (mode));
}
static void