mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-09 03:57:24 +00:00
53cd18e062
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> |
||
---|---|---|
.. | ||
fuzz | ||
src | ||
wire_format_derive | ||
Cargo.lock | ||
Cargo.toml | ||
OWNERS | ||
README.md |
p9 - Server implementation of the 9p file system protocol
This directory contains the protocol definition and a server implementation of the 9p file system protocol.
- wire_format_derive - A procedural macro that derives the serialization and de-serialization implementation for a struct into the 9p wire format.
- src/protocol - Defines all the messages used in the 9p protocol. Also implements serialization
and de-serialization for some base types (integers, strings, vectors) that form the foundation of
all 9p messages. Wire format implementations for all other messages are derived using the
wire_format_derive
macro. - src/server.rs - Implements a full 9p server, carrying out file system requests on behalf of clients.