summaryrefslogtreecommitdiff
path: root/platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'platform.c')
-rw-r--r--platform.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/platform.c b/platform.c
index a455472b..30fc6090 100644
--- a/platform.c
+++ b/platform.c
@@ -1,4 +1,4 @@
-/* $Id: platform.c,v 1.18 2011/01/11 06:02:25 djm Exp $ */
+/* $Id: platform.c,v 1.21 2014/01/21 01:59:29 tim Exp $ */
/*
* Copyright (c) 2006 Darren Tucker. All rights reserved.
@@ -55,6 +55,14 @@ platform_pre_fork(void)
}
void
+platform_pre_restart(void)
+{
+#ifdef LINUX_OOM_ADJUST
+ oom_adjust_restore();
+#endif
+}
+
+void
platform_post_fork_parent(pid_t child_pid)
{
#ifdef USE_SOLARIS_PROCESS_CONTRACTS
@@ -156,12 +164,6 @@ platform_setusercontext_post_groups(struct passwd *pw)
aix_usrinfo(pw);
#endif /* _AIX */
-#if !defined(HAVE_LOGIN_CAP) && defined(USE_LIBIAF)
- if (set_id(pw->pw_name) != 0) {
- exit(1);
- }
-# endif /* USE_LIBIAF */
-
#ifdef HAVE_SETPCRED
/*
* If we have a chroot directory, we set all creds except real
@@ -194,3 +196,19 @@ platform_krb5_get_principal_name(const char *pw_name)
return NULL;
#endif
}
+
+/*
+ * return 1 if the specified uid is a uid that may own a system directory
+ * otherwise 0.
+ */
+int
+platform_sys_dir_uid(uid_t uid)
+{
+ if (uid == 0)
+ return 1;
+#ifdef PLATFORM_SYS_DIR_UID
+ if (uid == PLATFORM_SYS_DIR_UID)
+ return 1;
+#endif
+ return 0;
+}