]> www.vanbest.org Git - motioneye-debian/commitdiff
fixed various event relaying issues when using square brackets in admin password.
authorCalin Crisan <ccrisan@gmail.com>
Wed, 26 Oct 2016 17:48:36 +0000 (20:48 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Wed, 26 Oct 2016 17:48:36 +0000 (20:48 +0300)
motioneye/scripts/relayevent.sh
motioneye/server.py

index 5d4113a7082b903e44c9048ff514acf750f4ae0f..962bbf81916404970b81da38e18057c681c8a9ad 100755 (executable)
@@ -13,7 +13,7 @@ if [ -f "$motioneye_conf" ]; then
         motion_conf="$conf_path/motion.conf"
         if [ -r "$motion_conf" ]; then
             username=$(cat $motion_conf | grep 'admin_username' | cut -d ' ' -f 3)
-            password=$(cat $motion_conf | grep 'admin_password' | cut -d ' ' -f 3 | sed -r 's/[^a-zA-Z0-9\/?_.=&{}":, _]/-/g')
+            password=$(cat $motion_conf | grep 'admin_password' | cut -d ' ' -f 3 | sed -r 's/[^][a-zA-Z0-9\/?_.=&{}":, _]/-/g')
         fi
     fi
 fi
@@ -29,5 +29,5 @@ uri="/_relay_event/?_username=$username&event=$event&thread_id=$thread_id"
 data="{\"filename\": \"$filename\"}"
 signature=$(echo -n "POST:$uri:$data:$password" | sha1sum | cut -d ' ' -f 1)
 
-curl -H "Content-Type: application/json" -X POST "http://127.0.0.1:$port$uri&_signature=$signature" -d "$data" &>/dev/null
+curl -s -S -H "Content-Type: application/json" -X POST "http://127.0.0.1:$port$uri&_signature=$signature" -d "$data" >/dev/null
 
index 8f1aef17c07ab0b36ab34b86ee2f7ff185f90bf0..1e1215f1560cfee2087bea9a7efd1450abf07e17 100644 (file)
@@ -227,10 +227,6 @@ def test_requirements():
             logging.fatal('smb shares require root privileges')
             sys.exit(-1)
 
-        if settings.ENABLE_REBOOT:
-            logging.fatal('reboot requires root privileges')
-            sys.exit(-1)
-
     try:
         import tornado  # @UnusedImport