Permalink
Browse files

Ensure the response is a proper http response.

Tested that cloud-set-guest-password.sh still works after this change.

Reviewed-by: Daan Hoogland <daan@onecht.net>
  • Loading branch information...
1 parent 6dd30ea commit a72f14ea9cb832faaac946b3cf9f56856b50142a @spark404 spark404 committed Dec 2, 2014
Showing with 2 additions and 4 deletions.
  1. +2 −4 systemvm/patches/debian/config/opt/cloud/bin/serve_password.sh
@@ -48,7 +48,7 @@ replace_in_file() {
get_value() {
local filename=$1
local keyname=$2
- grep -i $keyname= $filename | cut -d= -f2
+ grep -i "^$keyname=" $filename | cut -d= -f2
}
ip=$1
@@ -70,7 +70,7 @@ do
fi
done
-# echo -e \"\\\"HTTP/1.0 200 OK\\\nDocumentType: text/plain\\\n\\\n\\\"\";
+echo -ne "HTTP/1.0 200 OK\r\nDocumentType: text/plain\r\n\r\n"
if [ "$request" == "send_my_password" ]
then
@@ -98,6 +98,4 @@ else
fi
fi
-# echo -e \"\\\"\\\n\\\"\"
-
unlock_exit 0 $lock $locked

0 comments on commit a72f14e

Please sign in to comment.