diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-01-21 06:26:19 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-01-21 06:26:19 +0000 |
commit | 8bd1f7da2af13426901e87104c09d9639b685ae0 (patch) | |
tree | b2baf9bb6272169734a43d1483aa073b604021c2 /lib | |
parent | 92cb638f73e6bda825865f1382e87e17013c5173 (diff) | |
download | mailutils-8bd1f7da2af13426901e87104c09d9639b685ae0.tar.gz mailutils-8bd1f7da2af13426901e87104c09d9639b685ae0.tar.bz2 |
(mu_fcheck_perm, mu_check_perm): Return OK if mode is 0.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mu_dbm.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/mu_dbm.c b/lib/mu_dbm.c index 3e957896b..57aa77380 100644 --- a/lib/mu_dbm.c +++ b/lib/mu_dbm.c @@ -45,7 +45,10 @@ mu_fcheck_perm (int fd, int mode) return 1; } if ((st.st_mode & 0777) != mode) + { + errno = EPERM; return 1; + } return 0; } @@ -54,6 +57,8 @@ mu_check_perm (char *name, int mode) { struct stat st; + if (mode == 0) + return 0; if (stat (name, &st) == -1) { if (errno == ENOENT) @@ -62,7 +67,10 @@ mu_check_perm (char *name, int mode) return 1; } if ((st.st_mode & 0777) != mode) + { + errno = EPERM; return 1; + } return 0; } |