Skip to content

Commit 386ca6a

Browse files
author
gimbles
committed
Allow usage of sudo while not accessing root
1 parent 949b98c commit 386ca6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bootstrap/bootstrap.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1161,9 +1161,9 @@ def check_vendored_status(self):
11611161
"""Check that vendoring is configured properly"""
11621162
vendor_dir = os.path.join(self.rust_root, 'vendor')
11631163
if 'SUDO_USER' in os.environ and not self.use_vendored_sources:
1164-
if os.environ.get('USER') != os.environ['SUDO_USER']:
1164+
if os.getuid() == 0:
11651165
self.use_vendored_sources = True
1166-
print('info: looks like you are running this command under `sudo`')
1166+
print('info: looks like you\'re trying to run this command as root')
11671167
print(' and so in order to preserve your $HOME this will now')
11681168
print(' use vendored sources by default.')
11691169
if not os.path.exists(vendor_dir):

0 commit comments

Comments
 (0)