diff options
Diffstat (limited to 'platform.c')
-rw-r--r-- | platform.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/platform.c b/platform.c index f57c2eab3..60b87a6ae 100644 --- a/platform.c +++ b/platform.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: platform.c,v 1.16 2010/11/07 07:05:54 dtucker Exp $ */ | 1 | /* $Id: platform.c,v 1.17 2010/11/23 23:09:13 dtucker Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2006 Darren Tucker. All rights reserved. | 4 | * Copyright (c) 2006 Darren Tucker. All rights reserved. |
@@ -115,6 +115,14 @@ platform_setusercontext(struct passwd *pw) | |||
115 | } | 115 | } |
116 | } | 116 | } |
117 | # endif /* USE_PAM */ | 117 | # endif /* USE_PAM */ |
118 | |||
119 | #if !defined(HAVE_LOGIN_CAP) && defined(HAVE_GETLUID) && defined(HAVE_SETLUID) | ||
120 | if (getuid() == 0 || geteuid() == 0) { | ||
121 | /* Sets login uid for accounting */ | ||
122 | if (getluid() == -1 && setluid(pw->pw_uid) == -1) | ||
123 | error("setluid: %s", strerror(errno)); | ||
124 | } | ||
125 | #endif | ||
118 | } | 126 | } |
119 | 127 | ||
120 | /* | 128 | /* |