b823409
diff -up openssh-5.4p1/ssh-keygen.c.staterr openssh-5.4p1/ssh-keygen.c
b823409
--- openssh-5.4p1/ssh-keygen.c.staterr	2010-03-19 20:56:12.000000000 +0100
b823409
+++ openssh-5.4p1/ssh-keygen.c	2010-03-19 20:59:41.000000000 +0100
b823409
@@ -1829,7 +1829,9 @@ main(int argc, char **argv)
b823409
 	snprintf(dotsshdir, sizeof dotsshdir, "%s/%s", pw->pw_dir, _PATH_SSH_USER_DIR);
b823409
 	if (strstr(identity_file, dotsshdir) != NULL &&
b823409
 	    stat(dotsshdir, &st) < 0) {
b823409
-		if (mkdir(dotsshdir, 0700) < 0)
b823409
+		if (errno == EPERM)
b823409
+			error("Do not have permisions to stat directory '%s'.", dotsshdir);
b823409
+		else if (mkdir(dotsshdir, 0700) < 0)
b823409
 			error("Could not create directory '%s'.", dotsshdir);
b823409
 		else if (!quiet)
b823409
 			printf("Created directory '%s'.\n", dotsshdir);