diff options
Diffstat (limited to 'scripts/nativesdk-intercept/chown')
| -rwxr-xr-x | scripts/nativesdk-intercept/chown | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/scripts/nativesdk-intercept/chown b/scripts/nativesdk-intercept/chown deleted file mode 100755 index 0805ceb70a..0000000000 --- a/scripts/nativesdk-intercept/chown +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 1 | #!/usr/bin/env python3 | ||
| 2 | # | ||
| 3 | # Wrapper around 'chown' that redirects to root in all cases | ||
| 4 | |||
| 5 | import os | ||
| 6 | import shutil | ||
| 7 | import sys | ||
| 8 | |||
| 9 | # calculate path to the real 'chown' | ||
| 10 | path = os.environ['PATH'] | ||
| 11 | path = path.replace(os.path.dirname(sys.argv[0]), '') | ||
| 12 | real_chown = shutil.which('chown', path=path) | ||
| 13 | |||
| 14 | args = list() | ||
| 15 | |||
| 16 | found = False | ||
| 17 | |||
| 18 | args.append(real_chown) | ||
| 19 | |||
| 20 | for i in sys.argv[1:]: | ||
| 21 | if i.startswith("-"): | ||
| 22 | args.append(i) | ||
| 23 | continue | ||
| 24 | if not found: | ||
| 25 | args.append("root:root") | ||
| 26 | found = True | ||
| 27 | else: | ||
| 28 | args.append(i) | ||
| 29 | |||
| 30 | os.execv(real_chown, args) | ||
