소스 검색

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

clanker 1 주 전
부모
커밋
89567feab9
2개의 변경된 파일684개의 추가작업 그리고 472개의 파일을 삭제
  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

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 681 - 469
installer/install-usm.sh


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.