summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2013-05-07 13:15:13 +0100
committerColin Watson <cjwatson@debian.org>2013-05-07 13:15:13 +0100
commit99bd7d0d3fca960b65d84c0f9b928c442db48b0a (patch)
treeb75ca5585f8147309d53aeee285ad26bd425a097 /misc.c
parent2ea3f720daeb1ca9f765365fce3a9546961fe624 (diff)
Move platform_sys_dir_uid to misc.c to fix linking following user-group-modes.patch.
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{