Forráskód Böngészése

fix: curl|sh sudo re-exec with stdin from /dev/tty (interactive prompts preserved); Invercargill-Json clone from fabrica

clanker 1 hete
szülő
commit
89567feab9
2 módosított fájl, 684 hozzáadás és 472 törlés
  1. 3 3
      installer/compile.sh
  2. 681 469
      installer/install-usm.sh

+ 3 - 3
installer/compile.sh

@@ -113,13 +113,13 @@ cat > "$HEADER_FILE" << SCRIPT_HEADER
 
 # Handle curl | sh with sudo re-exec: when piped, \$0 isn't a re-readable
 # file, so capture the remaining script from stdin into a temp file and
-# re-exec that with sudo (this guard must run before any other code so
-# the pipe hasn't been fully consumed yet)
+# re-exec that with sudo; stdin must be reattached to the terminal so
+# interactive prompts work (the pipe is exhausted after cat)
 if [[ \$EUID -ne 0 && ! -f "\$0" ]]; then
     _usm_tmp=\$(mktemp /tmp/usm-install.XXXXXX.sh)
     cat > "\$_usm_tmp"
     chmod +x "\$_usm_tmp"
-    exec sudo bash "\$_usm_tmp" "\$@"
+    exec sudo bash "\$_usm_tmp" "\$@" < /dev/tty
 fi
 
 set -e

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 681 - 469
installer/install-usm.sh


Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott