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