aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-11-26 12:26:33 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-11-26 12:26:33 -0200
commitef014f585c83958488f8349feba9c3eefbf2f419 (patch)
tree1b45c8f85b0b47e8d8b43ae209bbfe7cb2d15e8c
parent6f768ce30e5218ca983178a73cf1d0c90c922e75 (diff)
downloadkeyringer-ef014f585c83958488f8349feba9c3eefbf2f419.tar.gz
keyringer-ef014f585c83958488f8349feba9c3eefbf2f419.tar.bz2
Better mode check on keyringer_check_tmp (closes #30)
-rwxr-xr-xlib/keyringer/functions7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/keyringer/functions b/lib/keyringer/functions
index 8bad9ed..667b0cd 100755
--- a/lib/keyringer/functions
+++ b/lib/keyringer/functions
@@ -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