Commit 53dab910 53dab91058bccd0bee7dcf7f520dbf49c8b30143 by Sergey Poznyakoff

(mu_fcheck_perm, mu_check_perm): Return

MU_ERR_UNSAFE_PERMS when appropriate.
1 parent 5e267581
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
29 # include <strings.h> 29 # include <strings.h>
30 #endif 30 #endif
31 #include <errno.h> 31 #include <errno.h>
32 #include <mailutils/errno.h>
32 #include <mu_dbm.h> 33 #include <mu_dbm.h>
33 #include <xalloc.h> 34 #include <xalloc.h>
34 35
...@@ -46,8 +47,8 @@ mu_fcheck_perm (int fd, int mode) ...@@ -46,8 +47,8 @@ mu_fcheck_perm (int fd, int mode)
46 } 47 }
47 if ((st.st_mode & 0777) != mode) 48 if ((st.st_mode & 0777) != mode)
48 { 49 {
49 errno = EPERM; 50 errno = MU_ERR_UNSAFE_PERMS;
50 return 1; 51 return 1;
51 } 52 }
52 return 0; 53 return 0;
53 } 54 }
...@@ -68,8 +69,8 @@ mu_check_perm (const char *name, int mode) ...@@ -68,8 +69,8 @@ mu_check_perm (const char *name, int mode)
68 } 69 }
69 if ((st.st_mode & 0777) != mode) 70 if ((st.st_mode & 0777) != mode)
70 { 71 {
71 errno = EPERM; 72 errno = MU_ERR_UNSAFE_PERMS;
72 return 1; 73 return 1;
73 } 74 }
74 return 0; 75 return 0;
75 } 76 }
......