summaryrefslogtreecommitdiff
path: root/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth.c')
-rw-r--r--auth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/auth.c b/auth.c
index 054c7282f..6128fa460 100644
--- a/auth.c
+++ b/auth.c
@@ -448,7 +448,7 @@ auth_secure_path(const char *name, struct stat *stp, const char *pw_dir,
448 snprintf(err, errlen, "%s is not a regular file", buf); 448 snprintf(err, errlen, "%s is not a regular file", buf);
449 return -1; 449 return -1;
450 } 450 }
451 if ((stp->st_uid != 0 && stp->st_uid != uid) || 451 if ((!platform_sys_dir_uid(stp->st_uid) && stp->st_uid != uid) ||
452 (stp->st_mode & 022) != 0) { 452 (stp->st_mode & 022) != 0) {
453 snprintf(err, errlen, "bad ownership or modes for file %s", 453 snprintf(err, errlen, "bad ownership or modes for file %s",
454 buf); 454 buf);
@@ -464,7 +464,7 @@ auth_secure_path(const char *name, struct stat *stp, const char *pw_dir,
464 strlcpy(buf, cp, sizeof(buf)); 464 strlcpy(buf, cp, sizeof(buf));
465 465
466 if (stat(buf, &st) < 0 || 466 if (stat(buf, &st) < 0 ||
467 (st.st_uid != 0 && st.st_uid != uid) || 467 (!platform_sys_dir_uid(st.st_uid) && st.st_uid != uid) ||
468 (st.st_mode & 022) != 0) { 468 (st.st_mode & 022) != 0) {
469 snprintf(err, errlen, 469 snprintf(err, errlen,
470 "bad ownership or modes for directory %s", buf); 470 "bad ownership or modes for directory %s", buf);