qemu-patch-raspberry4/hw/9pfs
M. Mohan Kumar 2d40564aaa 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>
2012-01-30 10:54:16 +05:30
..
codir.c fix typo: delete redundant semicolon 2011-12-06 09:56:41 +00:00
cofile.c hw/9pfs: Add new security model mapped-file. 2012-01-19 12:21:11 +05:30
cofs.c hw/9pfs: Use export_flag for indicating whether fs driver use path names. 2011-10-15 15:30:27 +05:30
coxattr.c hw/9pfs: Implement TFLUSH operation 2011-09-22 21:38:52 +05:30
virtio-9p-coth.c Don't use g_thread_get_initialized. 2011-09-09 12:58:16 -05:00
virtio-9p-coth.h fix spelling in hw sub directory 2011-12-06 09:56:41 +00:00
virtio-9p-device.c hw/9pfs: Add new security model mapped-file. 2012-01-19 12:21:11 +05:30
virtio-9p-handle.c hw/9pfs: Preserve S_ISGID 2012-01-30 10:54:16 +05:30
virtio-9p-local.c hw/9pfs: Preserve S_ISGID 2012-01-30 10:54:16 +05:30
virtio-9p-posix-acl.c configure: fix detection for xattr.h on modern distributions 2011-11-09 12:06:20 -06:00
virtio-9p-proxy.c virtio-9p-proxy: Fix typo causing compile failure on 32 bit hosts 2012-01-06 12:50:44 -06:00
virtio-9p-proxy.h hw/9pfs: Proxy getversion 2012-01-04 20:20:55 +05:30
virtio-9p-synth.c hw/9pfs: Use the correct file descriptor in Fsdriver Callback 2011-12-04 22:35:28 +05:30
virtio-9p-synth.h hw/9pfs: Add synthetic file system support using 9p 2011-10-31 12:34:18 +05:30
virtio-9p-xattr-user.c [virtio-9p] Make rpath thread safe 2011-06-01 10:25:17 -07:00
virtio-9p-xattr.c Use glib memory allocation and free functions 2011-08-20 23:01:08 -05:00
virtio-9p-xattr.h configure: fix detection for xattr.h on modern distributions 2011-11-09 12:06:20 -06:00
virtio-9p.c hw/9pfs: Add validation to {un}marshal code 2012-01-04 19:53:22 +05:30
virtio-9p.h hw/9pfs: Move pdu_marshal/unmarshal code to a seperate file 2012-01-04 19:51:28 +05:30