浏览代码

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

Danja Vasiliev 10 年之前
父节点
当前提交
f0cebd17f1
共有 2 个文件被更改,包括 6 次插入10 次删除
  1. 4 8
      debian/www/lib/admin/admin.sh
  2. 2 2
      debian/www/lib/admin/suid.sh

+ 4 - 8
debian/www/lib/admin/admin.sh

@@ -182,12 +182,8 @@ showMesg() {
 <img src='/resources/default/img/placeholder.png' class='logo'>
 <hr>
 <h2 style='display:inline'>$_TYPE $_MSG</h2>
-<span style='display:inline; margin-left: 50px;'>$_SUBMSG</span>"
-  if [[ $_ERR -eq 0 ]]; then
-    echo "<form action=${HTTP_REFERER} method='get'><input type='submit' value='Back'></form>"
-  fi
-
-echo "<hr>
+<span style='display:inline; margin-left: 50px;'>$_SUBMSG</span>
+<hr>
 </body></html>"
   exit 0
 }
@@ -202,14 +198,14 @@ updateFw() {
   _OUT="$(runSuid /sbin/mtd -q write $_FWFILE firmware)"
   _ERR=$?
   [[ $_ERR -gt 0 ]] && showMesg "mtd failed, $_OUT"
-  showMesg 'Firmware update is completed, rebooting..' 'this might take up to 60 seconds'
   runSuid reboot
+  showMesg 'Firmware update is completed, rebooting..' 'this might take up to 60 seconds'
 }
 
 rebootNow() {
   logThis "reboot: now!"
-  showMesg 'Rebooting..' 'this might take up to 60 seconds'
   runSuid reboot
+  showMesg 'Rebooting..' 'this might take up to 60 seconds'
 }
 
 getUci() {

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

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-#SHELL=/bin/bash
+SHELL=/bin/bash
 
 if [[ $EUID -ne 0 ]]; then echo 'root only'; exit 1; fi
 
@@ -20,7 +20,7 @@ if [[ $EUID -ne 0 ]]; then echo 'root only'; exit 1; fi
 #_LSID=$(ps -C lighttpd -o sid=)
 
 ## parent session id
-#_PSID=${@: -1}
+_PSID=${@: -1}
 
 ## our session id
 #_SID=$(ps -p$$ -o sid=)