summaryrefslogtreecommitdiff
path: root/platform.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2010-11-05 13:00:05 +1100
committerDarren Tucker <dtucker@zip.com.au>2010-11-05 13:00:05 +1100
commit728d8371a1dc1b615284ece94b0085897b4c0b51 (patch)
tree949dc94374774d643bb2799e4de1795fc92e559c /platform.c
parentfd4d8aa2cbe0acad520ab168656759cb46054c03 (diff)
- (dtucker) [platform.c session.c] Move the PAM credential establishment for
the LOGIN_CAP case into platform.c.
Diffstat (limited to 'platform.c')
-rw-r--r--platform.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/platform.c b/platform.c
index 570f130ae..0335eaae6 100644
--- a/platform.c
+++ b/platform.c
@@ -1,4 +1,4 @@
1/* $Id: platform.c,v 1.8 2010/11/05 01:50:41 dtucker Exp $ */ 1/* $Id: platform.c,v 1.9 2010/11/05 02:00:05 dtucker Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2006 Darren Tucker. All rights reserved. 4 * Copyright (c) 2006 Darren Tucker. All rights reserved.
@@ -21,6 +21,8 @@
21 21
22#include "openbsd-compat/openbsd-compat.h" 22#include "openbsd-compat/openbsd-compat.h"
23 23
24extern int use_privsep;
25
24void 26void
25platform_pre_listen(void) 27platform_pre_listen(void)
26{ 28{
@@ -79,6 +81,18 @@ platform_setusercontext(struct passwd *pw)
79 if (getuid() == 0 || geteuid() == 0) 81 if (getuid() == 0 || geteuid() == 0)
80 setpgid(0, 0); 82 setpgid(0, 0);
81# endif 83# endif
84
85#if defined(HAVE_LOGIN_CAP) && defined(USE_PAM)
86 /*
87 * If we have both LOGIN_CAP and PAM, we want to establish creds
88 * before calling setusercontext (in session.c:do_setusercontext).
89 */
90 if (getuid() == 0 || geteuid() == 0) {
91 if (options.use_pam) {
92 do_pam_setcred(use_privsep);
93 }
94 }
95# endif /* USE_PAM */
82} 96}
83 97
84/* 98/*