* krshd.c (doit): Call setluid().
* configure.in: Check for setluid() rather than main() in
libsecurity.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11111
dc483132-0cff-0310-8789-
dd5450dbe970
+Wed Jan 20 21:42:41 1999 Tom Yu <tlyu@mit.edu>
+
+ * login.c (main): Call setluid().
+
+ * krshd.c (doit): Call setluid().
+
+ * configure.in: Check for setluid() rather than main() in
+ libsecurity.
+
1998-11-28 Sam Hartman <hartmans@mesas.com>
* krshd.c krsh.c: Use RCMD_BUFSIZ not RSH_BUFSIZE [krb5-appl/678]
krb5_cv_has_streams=no
;;
alpha-dec-osf*)
- AC_CHECK_LIB(security,main,
+ AC_CHECK_LIB(security,setluid,
AC_DEFINE(HAVE_SETLUID)
LOGINLIBS="$LOGINLIBS -lsecurity"
)
initgroups(pwd->pw_name, pwd->pw_gid);
}
#endif
+#ifdef HAVE_SETLUID
+ /*
+ * If we're on a system which keeps track of login uids, then
+ * set the login uid.
+ */
+ setluid((uid_t) pwd->pw_uid);
+#endif /* HAVE_SETLUID */
(void) setuid((uid_t)pwd->pw_uid);
/* if TZ is set in the parent, drag it in */
{
#endif
#ifdef HAVE_SETLUID
- /*
- * If we're on a system which keeps track of login uids, then
- * attempt to set the login uid, but don't get too unhappy when/if
- * it doesn't succeed.
- */
- if ((uid_t) getluid() < (uid_t) 0) {
- setluid((uid_t) pwd->pw_uid);
- }
+ /*
+ * If we're on a system which keeps track of login uids, then
+ * set the login uid. If this fails this opens up a problem on DEC OSF
+ * with C2 enabled.
+ */
+ if (setluid((uid_t) pwd->pw_uid) < 0) {
+ perror("setuid");
+ sleepexit(1);
+ }
#endif /* HAVE_SETLUID */
#ifdef _IBMR2
setuidx(ID_LOGIN, pwd->pw_uid);