aboutsummaryrefslogtreecommitdiffstats
path: root/g10/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/misc.c')
-rw-r--r--g10/misc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/g10/misc.c b/g10/misc.c
index 8e541905d..54c1239b6 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -368,16 +368,16 @@ check_permissions(const char *path,int extension,int checkonly)
goto end;
}
+ isdir=S_ISDIR(statbuf.st_mode);
+
/* We may have to revisit this if we start piping keyrings to gpg
over a named pipe or keyserver character device :) */
- if(!S_ISREG(statbuf.st_mode))
+ if(!isdir && !S_ISREG(statbuf.st_mode))
{
ret=0;
goto end;
}
- isdir=S_ISDIR(statbuf.st_mode);
-
/* Per-user files must be owned by the user. Extensions must be
owned by the user or root. */
if((!extension && statbuf.st_uid != getuid()) ||