]> git.sesse.net Git - betaftpd/commitdiff
Now does setegid() before seteuid(), since you can't setegid() if you aren't root.
authorsgunderson <sgunderson>
Fri, 20 Apr 2001 12:58:48 +0000 (12:58 +0000)
committersgunderson <sgunderson>
Fri, 20 Apr 2001 12:58:48 +0000 (12:58 +0000)
cmds.c

diff --git a/cmds.c b/cmds.c
index 5bc5bc2e2d6e1475f605ecee6445e4ae84b2d027..cfb02689446f7d41302228460591d5a82f1f6fa9 100644 (file)
--- a/cmds.c
+++ b/cmds.c
@@ -416,8 +416,8 @@ int cmd_port(struct conn * const c)
 #endif
                bind(sock, (struct sockaddr *)&sin, sizeof(sin));
 #if !WANT_NONROOT
-               seteuid(c->uid);
                setegid(c->gid);
+               seteuid(c->uid);
 #endif
 
                f->sin.sin_family = AF_INET;
@@ -1612,8 +1612,8 @@ void parse_command(struct conn *c)
                                        seteuid(c->uid);
                                        setegid(c->gid);
                                } else {
-                                       seteuid(getuid());
                                        setegid(getgid());
+                                       seteuid(getuid());
                                }
 #endif