resolve symlinks when checking path permissions
[monkeysphere.git] / src / share / common
index 11e7969952f2b8dfb2cca4f1f87cd4959ca38f89..bd887d39b410d333badc6048b08d5e777322ce4b 100644 (file)
@@ -425,6 +425,12 @@ check_key_file_permissions() {
 
     log debug "checking path permission '$path'..."
 
+    # rewrite path if it points to a symlink
+    if [ -h "$path" ] ; then
+       path=$(readlink -f "$path")
+       log debug "checking path symlink '$path'..."
+    fi
+
     # return 255 if cannot stat file
     if ! stat=$(ls -ld "$path" 2>/dev/null) ; then
         log error "could not stat path '$path'."