Don't make ofp-pki --log option relative to log directory.
authorBen Pfaff <blp@nicira.com>
Fri, 31 Oct 2008 20:51:24 +0000 (13:51 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 31 Oct 2008 21:09:53 +0000 (14:09 -0700)
That behavior may have made sense, but it was too surprising.

utilities/ofp-pki.8.in
utilities/ofp-pki.in

index f8bd4b1..58bee97 100644 (file)
@@ -309,9 +309,8 @@ directories.  This option overrides this behavior.
 
 .TP
 \fB\-l\fR \fIfile\fR | \fB\-\^\-log=\fIfile\fR
-Sets the log file to \fIfile\fR.  If \fIfile\fR starts with \fB/\fR,
-it is taken as an absolute path; otherwise it is relative to @LOGDIR@.
-Default: \fBofp\-pki.log\fR.
+Sets the log file to \fIfile\fR.  Default:
+\fB@LOGDIR@/ofp\-pki.log\fR.
 
 .TP
 \fB\-h\fR | \fB\-\^\-help\fR
index 3d3a00d..a6d4521 100755 (executable)
@@ -155,6 +155,10 @@ fi
 if test -z "$dsaparam"; then
     dsaparam=$pkidir/dsaparam.pem
 fi
+case $log in
+    /*) ;;
+    *) $log="$PWD/$log" ;;
+esac
 
 if test "$command" = "init"; then
     if test -e "$pkidir" && test "$force" != "yes"; then
@@ -456,15 +460,7 @@ glob() {
     fi
 }
 
-case $log in
-    /*)
-        exec 3>>$log || true
-        ;;
-    *)
-        exec 3>>$pkidir/$log || true
-        ;;
-esac
-
+exec 3>>$log || true
 if test "$command" = req; then
     one_arg