sapling/eden/fs/fuse
Adam Simpkins 73509a87f8 restore the $USER environment variable when dropping privileges
Summary:
If edenfs was started using `sudo`, the `$USER` environment variable will be
set to `root` rather than the actual user.  When we drop privileges make sure
we restore the value of `$USER` as well.

The `$USER` variable isn't checked anywhere else in edenfs itself, but it
matters for subprocesses we spawn, like `hg debugedenimporthelper`.

I also changed the code to clear the `SUDO_*` variables as well, mostly
just for good measure.

Reviewed By: kulshrax

Differential Revision: D15929539

fbshipit-source-id: e022c7ae762e2a5e86d0227058bb476aff17cf55
2019-06-20 21:01:36 -07:00
..
fuse_tester update license headers in C++ files 2019-06-19 17:02:45 -07:00
privhelper restore the $USER environment variable when dropping privileges 2019-06-20 21:01:36 -07:00
test update license headers in C++ files 2019-06-19 17:02:45 -07:00
BufVec.cpp update license headers in C++ files 2019-06-19 17:02:45 -07:00
BufVec.h update license headers in C++ files 2019-06-19 17:02:45 -07:00
CMakeLists.txt update license headers in CMake files 2019-06-19 17:02:46 -07:00
DirList.cpp update license headers in C++ files 2019-06-19 17:02:45 -07:00
DirList.h update license headers in C++ files 2019-06-19 17:02:45 -07:00
Dispatcher.cpp update license headers in C++ files 2019-06-19 17:02:45 -07:00
Dispatcher.h update license headers in C++ files 2019-06-19 17:02:45 -07:00
FileHandle.h update license headers in C++ files 2019-06-19 17:02:45 -07:00
FileHandleBase.cpp update license headers in C++ files 2019-06-19 17:02:45 -07:00
FileHandleBase.h update license headers in C++ files 2019-06-19 17:02:45 -07:00
FuseChannel.cpp update license headers in C++ files 2019-06-19 17:02:45 -07:00
FuseChannel.h update license headers in C++ files 2019-06-19 17:02:45 -07:00
FuseTypes.h update license headers in C++ files 2019-06-19 17:02:45 -07:00
InodeNumber.cpp update license headers in C++ files 2019-06-19 17:02:45 -07:00
InodeNumber.h update license headers in C++ files 2019-06-19 17:02:45 -07:00
PollHandle.cpp update license headers in C++ files 2019-06-19 17:02:45 -07:00
PollHandle.h update license headers in C++ files 2019-06-19 17:02:45 -07:00
RequestData.cpp update license headers in C++ files 2019-06-19 17:02:45 -07:00
RequestData.h update license headers in C++ files 2019-06-19 17:02:45 -07:00