From: Tom Yu Date: Fri, 19 Feb 1999 03:31:52 +0000 (+0000) Subject: * Makefile.in (ksu): Add $(KSU_LIBS) in case we need -lsecurity X-Git-Tag: krb5-1.1-beta1~352 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=19d4a47ee5ebbb56fe41297d21d857a9aa7999f7;p=krb5.git * Makefile.in (ksu): Add $(KSU_LIBS) in case we need -lsecurity * 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 --- diff --git a/src/clients/ksu/ChangeLog b/src/clients/ksu/ChangeLog index e9a845487..a18067bb6 100644 --- a/src/clients/ksu/ChangeLog +++ b/src/clients/ksu/ChangeLog @@ -1,3 +1,9 @@ +Thu Feb 18 22:26:30 1999 Tom Yu + + * 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 * Makefile.in: Set the myfulldir and mydir variables (which are diff --git a/src/clients/ksu/Makefile.in b/src/clients/ksu/Makefile.in index e8ab6d33e..b31a3f641 100644 --- a/src/clients/ksu/Makefile.in +++ b/src/clients/ksu/Makefile.in @@ -8,6 +8,8 @@ CFLAGS = $(CCOPTS) $(DEFINES) $(DEFS) $(LOCALINCLUDE) PROG_LIBPATH=-L$(TOPLIBD) PROG_RPATH=$(KRB5_LIBDIR) +KSU_LIBS=@KSU_LIBS@ + SRCS = \ $(srcdir)/krb_auth_su.c \ $(srcdir)/ccache.c \ @@ -24,7 +26,7 @@ OBJS = \ 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 diff --git a/src/clients/ksu/main.c b/src/clients/ksu/main.c index 31a255cf3..44c270350 100644 --- a/src/clients/ksu/main.c +++ b/src/clients/ksu/main.c @@ -799,6 +799,18 @@ krb5_seteuid(0); /*So we have some chance of sweeping up*/ 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);