Skip to content

Commit ae068e7

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

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

0 commit comments

Comments
 (0)