summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>1999-02-19 03:31:52 +0000
committerTom Yu <tlyu@mit.edu>1999-02-19 03:31:52 +0000
commit19d4a47ee5ebbb56fe41297d21d857a9aa7999f7 (patch)
tree66ecd3f218b41fb058397144c6b972ae636f5e31 /src
parent8dfc5b5f4d5f99a01e366c951d7d1ca9f0d7149f (diff)
downloadkrb5-19d4a47ee5ebbb56fe41297d21d857a9aa7999f7.tar.gz
krb5-19d4a47ee5ebbb56fe41297d21d857a9aa7999f7.tar.xz
krb5-19d4a47ee5ebbb56fe41297d21d857a9aa7999f7.zip
* 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
Diffstat (limited to 'src')
-rw-r--r--src/clients/ksu/ChangeLog6
-rw-r--r--src/clients/ksu/Makefile.in4
-rw-r--r--src/clients/ksu/main.c12
3 files changed, 21 insertions, 1 deletions
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 <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
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);