From 9184a2fd62a0705d3c559e64bd99df69f8a1eeca Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Tue, 15 May 2018 13:00:14 -0700 Subject: [PATCH] user-setup: support abs/rel paths for cert options Support both absolute and relative paths for the cert options, instead of relative paths only, by using realpath(1) to resolve the arguments. (Note that the script cannot reference the path arguments verbatim because much of the script operates in the workspace's toplevel directory, which is a different location than where the script is invoked. In that situation, relative paths would not resolve.) Signed-off-by: Patrick McCarty --- user-setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user-setup.sh b/user-setup.sh index bcc651f..f2d78f8 100755 --- a/user-setup.sh +++ b/user-setup.sh @@ -36,15 +36,15 @@ while [ $# -gt 0 ]; do ;; "--client-cert"|"-k") shift - PEM="$PWD/$1" + PEM="$(realpath $1)" ;; "--server-ca"|"-s") shift - SERVERCA="$PWD/$1" + SERVERCA="$(realpath $1)" ;; "--client-ca"|"-c") shift - CLIENTCA="$PWD/$1" + CLIENTCA="$(realpath $1)" ;; "--jobs"|"-j") if echo "$2" | grep -qx "[1-9][0-9]*"; then