* main.c (main): Add call to setluid() on systems that have it.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11186
dc483132-0cff-0310-8789-
dd5450dbe970
+Thu Feb 18 22:26:30 1999 Tom Yu <tlyu@mit.edu>
+
+ * Makefile.in (ksu): Add $(KSU_LIBS) in case we need -lsecurity.
+
+ * main.c (main): Add call to setluid() on systems that have it.
+
1998-11-13 Theodore Ts'o <tytso@rsts-11.mit.edu>
* Makefile.in: Set the myfulldir and mydir variables (which are
PROG_LIBPATH=-L$(TOPLIBD)
PROG_RPATH=$(KRB5_LIBDIR)
+KSU_LIBS=@KSU_LIBS@
+
SRCS = \
$(srcdir)/krb_auth_su.c \
$(srcdir)/ccache.c \
all:: ksu
ksu: $(OBJS) $(KRB5_BASE_DEPLIBS) $(UTIL_DEPLIB)
- $(CC_LINK) -o $@ $(OBJS) $(UTIL_LIB) $(KRB5_BASE_LIBS)
+ $(CC_LINK) -o $@ $(OBJS) $(UTIL_LIB) $(KRB5_BASE_LIBS) $(KSU_LIBS)
clean::
$(RM) ksu
target_user, target_pwd->pw_uid);
}
+#ifdef HAVE_SETLUID
+ /*
+ * 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 */
+
if (setuid(target_pwd->pw_uid) < 0) {
perror("ksu: setuid");
sweep_up(ksu_context, use_source_cache, cc_target);