From: Calin Crisan Date: Wed, 26 Oct 2016 17:48:36 +0000 (+0300) Subject: fixed various event relaying issues when using square brackets in admin password. X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=0d4e7dc01221747769f762667e91448a25f6e0da;p=motioneye-debian fixed various event relaying issues when using square brackets in admin password. --- diff --git a/motioneye/scripts/relayevent.sh b/motioneye/scripts/relayevent.sh index 5d4113a..962bbf8 100755 --- a/motioneye/scripts/relayevent.sh +++ b/motioneye/scripts/relayevent.sh @@ -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 diff --git a/motioneye/server.py b/motioneye/server.py index 8f1aef1..1e1215f 100644 --- a/motioneye/server.py +++ b/motioneye/server.py @@ -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