vishalmishra434 / rpms / openssh

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