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
+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
* 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;
}