diff options
| author | M. Mohan Kumar | 2012-01-19 07:51:12 +0100 |
|---|---|---|
| committer | Aneesh Kumar K.V | 2012-01-30 06:24:16 +0100 |
| commit | 2d40564aaab3a99fe6ce00fc0fc893c02e9443ec (patch) | |
| tree | 8b297266eff6d33d444051ded22b18f5b2669994 /fsdev | |
| parent | hw/9pfs: Add new security model mapped-file. (diff) | |
| download | qemu-2d40564aaab3a99fe6ce00fc0fc893c02e9443ec.tar.gz qemu-2d40564aaab3a99fe6ce00fc0fc893c02e9443ec.tar.xz qemu-2d40564aaab3a99fe6ce00fc0fc893c02e9443ec.zip | |
hw/9pfs: Preserve S_ISGID
In passthrough security model in local fs driver, after a file creation
chown and chmod are done to set the file credentials and mode as requested
by 9p client. But if there was a request to create a file with S_ISGID
bit, doing chown on that file resets the S_ISGID bit. So first call
chown and then invoking chmod with proper mode bit retains the S_ISGID
(if present/requested)
This resulted in LTP mknod02, mknod03, mknod05, open10 test case
failures. This patch fixes this issue.
man 2 chown
When the owner or group of an executable file are changed by an unprivileged
user the S_ISUID and S_ISGID mode bits are cleared. POSIX does not specify
whether this also should happen when root does the chown(); the Linux behavior
depends on the kernel version.
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'fsdev')
0 files changed, 0 insertions, 0 deletions
