summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/misc.c b/misc.c
index 3938d4053..2adb8c6a8 100644
--- a/misc.c
+++ b/misc.c
@@ -59,6 +59,7 @@
59#include "misc.h" 59#include "misc.h"
60#include "log.h" 60#include "log.h"
61#include "ssh.h" 61#include "ssh.h"
62#include "platform.h"
62 63
63/* remove newline at end of string */ 64/* remove newline at end of string */
64char * 65char *
@@ -642,6 +643,22 @@ read_keyfile_line(FILE *f, const char *filename, char *buf, size_t bufsz,
642 return -1; 643 return -1;
643} 644}
644 645
646/*
647 * return 1 if the specified uid is a uid that may own a system directory
648 * otherwise 0.
649 */
650int
651platform_sys_dir_uid(uid_t uid)
652{
653 if (uid == 0)
654 return 1;
655#ifdef PLATFORM_SYS_DIR_UID
656 if (uid == PLATFORM_SYS_DIR_UID)
657 return 1;
658#endif
659 return 0;
660}
661
645int 662int
646secure_permissions(struct stat *st, uid_t uid) 663secure_permissions(struct stat *st, uid_t uid)
647{ 664{