ovs-pki: Workaround lack of /dev/stdin in Windows.
authorGurucharan Shetty <gshetty@nicira.com>
Mon, 12 May 2014 20:08:35 +0000 (13:08 -0700)
committerGurucharan Shetty <gshetty@nicira.com>
Wed, 14 May 2014 23:29:04 +0000 (16:29 -0700)
This lets us generate certs for unit tests on Windows

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
utilities/ovs-pki.in

index 89af405..6081a5e 100755 (executable)
@@ -461,9 +461,18 @@ sign_request() {
     must_not_exist "$2"
     pkidir_must_exist
 
+    case "$1" in
+        "/"*)
+            request_file="$1"
+            ;;
+        *)
+            request_file="`pwd`/$1"
+            ;;
+    esac
+
     (cd "$pkidir/${type}ca" && 
-     openssl ca -config ca.cnf -batch -in /dev/stdin) \
-        < "$1" > "$2.tmp$$" 2>&3
+     openssl ca -config ca.cnf -batch -in "$request_file") \
+        > "$2.tmp$$" 2>&3
     mv "$2.tmp$$" "$2"
 }