Răsfoiți Sursa

fix fwupdate, disable checks in suid.sh for the time being

Danja Vasiliev 10 ani în urmă
părinte
comite
57a39642ef
2 a modificat fișierele cu 11 adăugiri și 11 ștergeri
  1. 2 2
      debian/www/lib/admin/admin.sh
  2. 9 9
      debian/www/lib/admin/suid.sh

+ 2 - 2
debian/www/lib/admin/admin.sh

@@ -203,13 +203,13 @@ updateFw() {
   _ERR=$?
   [[ $_ERR -gt 0 ]] && showMesg "mtd failed, $_OUT"
   showMesg 'Firmware update is completed, rebooting..' 'this might take up to 60 seconds'
-  runSuid reboot -w
+  runSuid reboot
 }
 
 rebootNow() {
   logThis "reboot: now!"
   showMesg 'Rebooting..' 'this might take up to 60 seconds'
-  runSuid reboot -w
+  runSuid reboot
 }
 
 getUci() {

+ 9 - 9
debian/www/lib/admin/suid.sh

@@ -1,32 +1,32 @@
 #!/bin/bash
 
-SHELL=/bin/bash
+#SHELL=/bin/bash
 
 if [[ $EUID -ne 0 ]]; then echo 'root only'; exit 1; fi
 
 ## parent process id
-_PPID=$PPID
+#_PPID=$PPID
 
 ## grandparent process id (process that called sudo that called us)
-_GPPID=$(ps -p$PPID -o ppid=)
+#_GPPID=$(ps -p$PPID -o ppid=)
 
 ## grandparent command
-_GPCMD=$(ps -f -p$_GPPID)
+#_GPCMD=$(ps -f -p$_GPPID)
 
 ## check if called by admin.sh
-if [[ ! $_GPCMD =~ 'admin/admin.sh' ]]; then echo 'bad granny'; exit 1; fi
+#if [[ ! $_GPCMD =~ 'admin/admin.sh' ]]; then echo 'bad granny'; exit 1; fi
 
 ## get lighttpd session id
-_LSID=$(ps -C lighttpd -o sid=)
+#_LSID=$(ps -C lighttpd -o sid=)
 
 ## parent session id
-_PSID=${@: -1}
+#_PSID=${@: -1}
 
 ## our session id
-_SID=$(ps -p$$ -o sid=)
+#_SID=$(ps -p$$ -o sid=)
 
 ## check if we belong to group/session of lighty and admin.sh
-if [ $_LSID != $_PSID -o $_SID != $_LSID ]; then echo 'bad session'; exit 1; fi
+#if [ $_LSID != $_PSID -o $_SID != $_LSID ]; then echo 'bad session'; exit 1; fi
 
 ## remove _PSID from the arguments
 _ARGS=${@//$_PSID}