lib/courier-authlib/success.c
changeset 2 b3afb9f1e801
parent 0 6f7a81934006
--- a/lib/courier-authlib/success.c	Sun Jan 20 00:12:17 2008 +0100
+++ b/lib/courier-authlib/success.c	Sun Jan 20 00:22:09 2008 +0100
@@ -14,7 +14,7 @@
 #include	<unistd.h>
 #endif
 
-static const char rcsid[]="$Id: success.c,v 1.1 2000/04/13 17:55:05 bruce Exp $";
+static const char rcsid[]="$Id: success.c,v 1.2 2000/12/18 20:20:10 bruce Exp $";
 
 void authsuccess(const char *homedir,
 	const char *username,
@@ -27,12 +27,6 @@
 static char	*authfullname_buf=0;
 char	*p;
 
-	if (chdir(homedir))
-	{
-		perror("chdir");
-		authexit(1);
-	}
-
 	if (username)
 	{
 		if (gid)
@@ -49,6 +43,12 @@
 		authchangeuidgid(*uid, *gid);
 	}
 
+	if (chdir(homedir))
+	{
+		perror("chdir");
+		authexit(1);
+	}
+
 	if (!authaddr)	authaddr="";
 	if (authaddr_buf)	free(authaddr_buf);
 	authaddr_buf=malloc(sizeof("AUTHADDR=")+strlen(authaddr));