sapling/eden/scm/exec
Mark Mendoza 31282ad8e7 Have scratch set_file_owner on all created parents of created directory
Summary:
When running `sudo mkscratch path /home/markamendoza`, the folder `/data/users/markamendoza/scratch/homeZmarkamendoza` will be created, including all parents that did not already exist.  All these new directories will be created with owner = root.

Anticipating this kind of call, `mkscratch` already goes in and manually modifies the owner of the leaf directory (e.g. `/data/users/markamendoza/scratch/homeZmarkamendoza`), **but will not do so for any of the parent folders it created**.

This is normally not a problem, as long as `/data/users/markamendoza/scratch/` already exists.  If it doesn't then these directories are created with the wrong ownership, which causes problems if we (for example) call `mkscratch` again, without sudo.

This diff remedies this by calling the same `set_file_owner` function (that's already called on the leaf directory) on all parents that were created by `mkscratch`

Reviewed By: chadaustin

Differential Revision: D27378153

fbshipit-source-id: 26c40f4ca478cacf9117093c7b70cbedd679cea6
2021-03-31 11:50:03 -07:00
..
eden_apfs_mount_helper create subvolumes on disk backing repo 2021-01-29 20:43:23 -08:00
hgmain clidispatch: add an API to obtain "writable" stdout stream 2021-02-23 15:09:14 -08:00
scm_daemon Switch from failure::Fail trait to std::error::Error for errors 2019-11-22 08:53:31 -08:00
scratch Have scratch set_file_owner on all created parents of created directory 2021-03-31 11:50:03 -07:00
utils revisionstore: disallow reading LFS pointers from packfiles 2020-09-09 18:27:42 -07:00