diff options
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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 */ |
64 | char * | 65 | char * |
@@ -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 | */ | ||
650 | int | ||
651 | platform_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 | |||
645 | int | 662 | int |
646 | secure_permissions(struct stat *st, uid_t uid) | 663 | secure_permissions(struct stat *st, uid_t uid) |
647 | { | 664 | { |