mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
check for --privhelper_path
when deciding whether to use sudo
Summary:
When running the Eden tests using buck2, this flag is used because the
privhelper is not immediately next to the EdenFS binary.
This diff updates the approximation of the privhelper path introduced in
D31870880 (710f03501d
) accordingly so that it also works in this case.
Reviewed By: xavierd
Differential Revision: D32070038
fbshipit-source-id: c111cc533bb9e9d111bfe9bad71e817655b3d613
This commit is contained in:
parent
a7e55e597a
commit
f3839fc2f8
@ -210,6 +210,16 @@ def prepare_edenfs_privileges(
|
||||
return (cmd, env)
|
||||
|
||||
privhelper = os.path.join(os.path.dirname(daemon_binary), "edenfs_privhelper")
|
||||
|
||||
# EdenFS accepts a privhelper_path argument to locate the privhelper, so if
|
||||
# we are about to pass that we should extract it.
|
||||
next_arg_is_privhelper = False
|
||||
for arg in cmd:
|
||||
if next_arg_is_privhelper:
|
||||
privhelper = arg
|
||||
break
|
||||
next_arg_is_privhelper = arg == "--privhelper_path"
|
||||
|
||||
# If the EdenFS privhelper is installed as setuid root we don't need to use
|
||||
# sudo.
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user