mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-12-24 11:58:41 +00:00
p9: Fix file and directory creation mode
Don't allow clients to create files and directories that are writable by anyone other than the user. This is equivalent to having a umask of 022. BUG=chromium:703939 TEST=change the umask in the container, mkdir, and see that it has 0755 Change-Id: I0622fcd89935512969bcd25a9b1fece1e72e1f38 Signed-off-by: Chirantan Ekbote <chirantan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1112869 Reviewed-by: Dylan Reid <dgreid@chromium.org>
This commit is contained in:
parent
f2fb37e669
commit
d678784ae1
1 changed files with 2 additions and 2 deletions
|
@ -541,7 +541,7 @@ impl Server {
|
|||
.append((lcreate.flags & P9_APPEND) != 0)
|
||||
.create_new((lcreate.flags & P9_EXCL) != 0)
|
||||
.custom_flags(custom_flags)
|
||||
.mode(lcreate.mode & 0o777)
|
||||
.mode(lcreate.mode & 0o755)
|
||||
.open(&path)?;
|
||||
|
||||
fid.metadata = file.metadata()?;
|
||||
|
@ -842,7 +842,7 @@ impl Server {
|
|||
|
||||
fs::DirBuilder::new()
|
||||
.recursive(false)
|
||||
.mode(mkdir.mode & 0o777)
|
||||
.mode(mkdir.mode & 0o755)
|
||||
.create(&newpath)?;
|
||||
|
||||
Ok(Rmessage::Mkdir(Rmkdir {
|
||||
|
|
Loading…
Reference in a new issue