sapling/eden/fs/service
Wez Furlong 2941822299 eden: use SpawnedProcess to start privhelper
Summary:
On macOS we cannot safely use `fork` to spawn processes while other threads may initialize objc classes.

This commit replaces the use of `fork` in the privhelper startup with
`SpawnedProcess` instead.  We need to take care with this as we are generally
installed setuid root and we'd like to avoid being tricked into running an
arbitrary child process as root.

This commit defines a separate executable called `edenfs_privhelper` that
contains just the privhelper server code.

We need to be careful about locating this executable; to avoid invoking an
arbitrary process while we have root privileges we require that the privhelper
be a sibling to the edenfs executable and carry out some additional ownership
verification so that we can tell that the owner of edenfs also controls
edenfs_privhelper.

To facilitate this, I've added an `executablePath` function to PathFuncs; it
returns the path to the current executable image.

To make the integration test scenario simpler, I've added the edenfs_executable
binary definition alongside that of the edenfs binary in the buck and cmake
build systems.  This causes the binaries to be siblings in-situ in the build
tree and avoids the need to move things into place in the test harness.

Reviewed By: chadaustin

Differential Revision: D23653343

fbshipit-source-id: 3c2539a5e0e11cee88960db49c885ce0366d314e
2020-09-18 17:22:39 -07:00
..
oss split runEdenMain out from EdenMain 2020-03-26 16:19:25 -07:00
test eden: introduce SpawnedProcess 2020-09-01 13:31:32 -07:00
.gitignore watchman: pull in thrift in the oss build for eden support 2019-02-04 21:37:47 -08:00
CMakeLists.txt eden: use SpawnedProcess to start privhelper 2020-09-18 17:22:39 -07:00
eden.thrift utils: rename ProcessAccessLog::AccessType enum 2020-09-03 17:00:07 -07:00
EdenCPUThreadPool.cpp Tidy up license headers 2019-10-11 05:28:23 -07:00
EdenCPUThreadPool.h Tidy up license headers 2019-10-11 05:28:23 -07:00
EdenError.cpp edenfs: move WinError to eden/fs/utils 2020-09-17 09:08:58 -07:00
EdenError.h Remove thrift setters 2020-07-13 14:30:00 -07:00
EdenInit.cpp move UserInfo to eden/fs/utils/ 2020-04-29 17:21:12 -07:00
EdenInit.h add a new process to monitor EdenFS 2020-01-31 13:22:26 -08:00
EdenMain.cpp introduce metadata importer 2020-07-10 16:03:32 -07:00
EdenMain.h introduce metadata importer 2020-07-10 16:03:32 -07:00
EdenServer.cpp utils: move win/utils/Stub.h to utils/NotImplemented.h 2020-09-16 12:31:46 -07:00
EdenServer.h utils: move win/utils/Stub.h to utils/NotImplemented.h 2020-09-16 12:31:46 -07:00
EdenServiceHandler.cpp utils: move win/utils/Stub.h to utils/NotImplemented.h 2020-09-16 12:31:46 -07:00
EdenServiceHandler.h eden prefetch record-profile and eden prefetch finish-profile 2020-08-04 06:50:45 -07:00
EdenStateDir.cpp fix issues when checking EdenFS status on windows 2020-04-15 15:46:24 -07:00
EdenStateDir.h exit if the EdenFS lock file ever becomes invalid 2020-03-26 20:17:12 -07:00
fb-edenfs@.service set OOMScoreAdjust to -20 in systemd unit 2019-10-02 12:53:28 -07:00
PeriodicTask.cpp Tidy up license headers 2019-10-11 05:28:23 -07:00
PeriodicTask.h Tidy up license headers 2019-10-11 05:28:23 -07:00
PrettyPrinters.cpp Migrate to field_ref Thrift API 2020-07-21 11:23:35 -07:00
PrettyPrinters.h Tidy up license headers 2019-10-11 05:28:23 -07:00
PrivHelperMain.cpp eden: use SpawnedProcess to start privhelper 2020-09-18 17:22:39 -07:00
StartupLogger.cpp edenfs: move WinError to eden/fs/utils 2020-09-17 09:08:58 -07:00
StartupLogger.h use logVerbose for fsck bars 2020-07-30 08:47:54 -07:00
streamingeden.thrift enable py3 thrift language 2020-06-10 19:29:17 -07:00
Systemd.cpp Tidy up license headers 2019-10-11 05:28:23 -07:00
Systemd.h Tidy up license headers 2019-10-11 05:28:23 -07:00
ThriftPermissionChecker.cpp Tidy up license headers 2019-10-11 05:28:23 -07:00
ThriftPermissionChecker.h Tidy up license headers 2019-10-11 05:28:23 -07:00
ThriftUtil.h add EdenErrorType to EdenError 2019-10-29 09:23:03 -07:00