]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Better mode check on keyringer_check_tmp (closes #30)
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 26 Nov 2013 14:26:33 +0000 (12:26 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 26 Nov 2013 14:26:33 +0000 (12:26 -0200)
lib/keyringer/functions

index 8bad9edf8f43a74ecf1aac7c4690510356017d44..667b0cd098213831fc34593d05bf07db16195194 100755 (executable)
@@ -115,14 +115,9 @@ function keyringer_is_git {
 function keyringer_check_tmp {
   local path="$1"
   local major
-  local mode
-
-  if [ -z "$path" ]; then
-    return
-  fi
 
   # Mode check
-  if [ "`stat -c "%A" $path`" != "drwxrwxrwt" ]; then
+  if [ -z "$path" ] || [ ! -d "$path" ] || [ ! -w "$path" ] || [ ! -x "$path" ]; then
     return 1
   fi