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 @@
# include <strings.h>
#endif
#include <errno.h>
#include <mailutils/errno.h>
#include <mu_dbm.h>
#include <xalloc.h>
......@@ -46,7 +47,7 @@ mu_fcheck_perm (int fd, int mode)
}
if ((st.st_mode & 0777) != mode)
{
errno = EPERM;
errno = MU_ERR_UNSAFE_PERMS;
return 1;
}
return 0;
......@@ -68,7 +69,7 @@ mu_check_perm (const char *name, int mode)
}
if ((st.st_mode & 0777) != mode)
{
errno = EPERM;
errno = MU_ERR_UNSAFE_PERMS;
return 1;
}
return 0;
......