diff --git a/appl/popper/pop_dropcopy.c b/appl/popper/pop_dropcopy.c index 6cdcc5529..7e3502719 100644 --- a/appl/popper/pop_dropcopy.c +++ b/appl/popper/pop_dropcopy.c @@ -14,14 +14,6 @@ RCSID("$Id$"); int changeuser(POP *p, struct passwd *pwd) { - if(setuid(pwd->pw_uid) < 0) { - pop_log (p, POP_PRIORITY, - "Unable to change to uid %u: %s", - (unsigned)pwd->pw_uid, - strerror(errno)); - return pop_msg (p, POP_FAILURE, - "Unable to change uid"); - } if(setgid(pwd->pw_gid) < 0) { pop_log (p, POP_PRIORITY, "Unable to change to gid %u: %s", @@ -30,6 +22,14 @@ changeuser(POP *p, struct passwd *pwd) return pop_msg (p, POP_FAILURE, "Unable to change gid"); } + if(setuid(pwd->pw_uid) < 0) { + pop_log (p, POP_PRIORITY, + "Unable to change to uid %u: %s", + (unsigned)pwd->pw_uid, + strerror(errno)); + return pop_msg (p, POP_FAILURE, + "Unable to change uid"); + } #ifdef DEBUG if(p->debug) pop_log(p, POP_DEBUG,"uid = %u, gid = %u",