summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>1999-03-26 04:15:57 +0000
committerTom Yu <tlyu@mit.edu>1999-03-26 04:15:57 +0000
commitf1eee1d37f0cb7ed53497063f37b1c3fc3eef5a3 (patch)
tree9645f25bd718816712a5d5085d02eb9bd250dff5
parent50adda2de32499bdff6aa6ec0705e82888ee39ba (diff)
downloadkrb5-f1eee1d37f0cb7ed53497063f37b1c3fc3eef5a3.tar.gz
krb5-f1eee1d37f0cb7ed53497063f37b1c3fc3eef5a3.tar.xz
krb5-f1eee1d37f0cb7ed53497063f37b1c3fc3eef5a3.zip
* ftpd.c (login): Check that the luid is not the uid we want to
change to prior to calling setluid() so that we can run as non-root. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11316 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/appl/gssftp/ftpd/ChangeLog6
-rw-r--r--src/appl/gssftp/ftpd/ftpd.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/src/appl/gssftp/ftpd/ChangeLog b/src/appl/gssftp/ftpd/ChangeLog
index 3c7727883..c84e77028 100644
--- a/src/appl/gssftp/ftpd/ChangeLog
+++ b/src/appl/gssftp/ftpd/ChangeLog
@@ -1,3 +1,9 @@
+Thu Mar 25 23:13:56 1999 Tom Yu <tlyu@mit.edu>
+
+ * ftpd.c (login): Check that the luid is not the uid we want to
+ change to prior to calling setluid() so that we can run as
+ non-root.
+
Wed Mar 24 17:11:32 1999 Tom Yu <tlyu@mit.edu>
* ftpcmd.y (urgsafe_getc): New function; like getc() except it
diff --git a/src/appl/gssftp/ftpd/ftpd.c b/src/appl/gssftp/ftpd/ftpd.c
index f880734a5..d4987affc 100644
--- a/src/appl/gssftp/ftpd/ftpd.c
+++ b/src/appl/gssftp/ftpd/ftpd.c
@@ -1093,7 +1093,8 @@ login(passwd)
* set the login uid. If this fails this opens up a problem on DEC OSF
* with C2 enabled.
*/
- if (setluid((uid_t)pw->pw_uid) < 0) {
+ if (((uid_t)getluid() != pw->pw_uid)
+ && setluid((uid_t)pw->pw_uid) < 0) {
reply(550, "Can't set luid.");
goto bad;
}