mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-09 03:57:24 +00:00
Use fchmodat(), fchownat(), and utimensat() to implement the SET_ATTR request rather than using the non-'at' variants of these functions. These can operate on a file descriptor path using the /proc file handle and "self/fd/N" filename to modify the attributes of a file without actually opening it, which means we can avoid problems like not being able to open a read-only file with O_RDWR, which happened previously with chmod requests. This means we don't need to open the file at all, except in the case of a request that needs to set the size, since there is no equivalent truncateat() function. BUG=chromium:1369647 TEST=touch /mnt/chromeos/MyFiles/Downloads/hello.txt TEST=chmod -w /mnt/chromeos/MyFiles/Downloads/hello.txt TEST=chmod +w /mnt/chromeos/MyFiles/Downloads/hello.txt TEST=chmod a-r /mnt/chromeos/MyFiles/Downloads/hello.txt TEST=chmod a+r /mnt/chromeos/MyFiles/Downloads/hello.txt TEST=chown $USER /mnt/chromeos/MyFiles/Downloads/hello.txt TEST=truncate -s1 /mnt/chromeos/MyFiles/Downloads/hello.txt Change-Id: I0461ed231cc78b26bcc37ede1a364af984c87f8b Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3935537 Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org> |
||
---|---|---|
.. | ||
9p_device.policy | ||
balloon_device.policy | ||
battery.policy | ||
block.policy | ||
block_device.policy | ||
block_device_vhost_user.policy | ||
block_device_vvu.policy | ||
coiommu_device.policy | ||
common_device.frequency | ||
common_device.policy | ||
cras_audio_device.policy | ||
fs_device.policy | ||
gpu_common.policy | ||
gpu_device.policy | ||
gpu_render_server.policy | ||
input_device.policy | ||
iommu_device.policy | ||
net_device.policy | ||
null_audio_device.policy | ||
pmem_device.policy | ||
rng_device.policy | ||
serial.policy | ||
serial_device.policy | ||
serial_device_vhost_user.policy | ||
serial_device_vvu.policy | ||
snd_cras_device.policy | ||
snd_null_device.policy | ||
tpm_device.policy | ||
vfio_device.policy | ||
vhost_net_device.policy | ||
vhost_user.policy | ||
vhost_vsock_device.policy | ||
video_device.policy | ||
vios_audio_device.policy | ||
vtpm_proxy_device.policy | ||
vvu.policy | ||
vvu_proxy_device.policy | ||
wl_device.policy | ||
xhci_device.policy |