Skip to content

Commit c18613f

Browse files
authored
Rollup merge of rust-lang#95671 - gimbles:master, r=Mark-Simulacrum
feat: Allow usage of sudo [while not accessing root] in x.py # Fixes This PR should fix rust-lang#93344 # Info Allows usage of sudo (while not accessing root) in x.py
2 parents 2abbdec + 386ca6a commit c18613f

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
@@ -1172,9 +1172,9 @@ def check_vendored_status(self):
11721172
"""Check that vendoring is configured properly"""
11731173
vendor_dir = os.path.join(self.rust_root, 'vendor')
11741174
if 'SUDO_USER' in os.environ and not self.use_vendored_sources:
1175-
if os.environ.get('USER') != os.environ['SUDO_USER']:
1175+
if os.getuid() == 0:
11761176
self.use_vendored_sources = True
1177-
print('info: looks like you are running this command under `sudo`')
1177+
print('info: looks like you\'re trying to run this command as root')
11781178
print(' and so in order to preserve your $HOME this will now')
11791179
print(' use vendored sources by default.')
11801180
if not os.path.exists(vendor_dir):

0 commit comments

Comments
 (0)