Commit 8bd1f7da 8bd1f7da2af13426901e87104c09d9639b685ae0 by Sergey Poznyakoff

(mu_fcheck_perm, mu_check_perm): Return OK if mode is 0.

1 parent 92cb638f
......@@ -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;
}
......