vishalmishra434 / rpms / openssh

Forked from rpms/openssh a month ago
Clone
Jan F. Chadima 1b8a26
diff -up openssh-5.6p1/ssh-keygen.0.keygen openssh-5.6p1/ssh-keygen.0
Jan F. Chadima 1b8a26
--- openssh-5.6p1/ssh-keygen.0.keygen	2010-08-22 16:30:03.000000000 +0200
Jan F. Chadima 1b8a26
+++ openssh-5.6p1/ssh-keygen.0	2010-08-23 12:37:19.000000000 +0200
Jan F. Chadima bd929b
@@ -4,7 +4,7 @@ NAME
Jan F. Chadima bd929b
      ssh-keygen - authentication key generation, management and conversion
Jan F. Chadima bd929b
 
Jan F. Chadima bd929b
 SYNOPSIS
Jan F. Chadima bd929b
-     ssh-keygen [-q] [-b bits] -t type [-N new_passphrase] [-C comment]
Jan F. Chadima bd929b
+     ssh-keygen [-q] [-o] [-b bits] -t type [-N new_passphrase] [-C comment]
Jan F. Chadima bd929b
                 [-f output_keyfile]
Jan F. Chadima bd929b
      ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
Jan F. Chadima 1b8a26
      ssh-keygen -i [-m key_format] [-f input_keyfile]
Jan F. Chadima 1b8a26
@@ -232,6 +232,8 @@ DESCRIPTION
Jan F. Chadima bd929b
 
Jan F. Chadima bd929b
      -q      Silence ssh-keygen.  Used by /etc/rc when creating a new key.
Jan F. Chadima bd929b
 
Jan F. Chadima bd929b
+     -o      Overwrite the key without prompting user.
Jan F. Chadima bd929b
+
Jan F. Chadima bd929b
      -R hostname
Jan F. Chadima bd929b
              Removes all keys belonging to hostname from a known_hosts file.
Jan F. Chadima bd929b
              This option is useful to delete hashed hosts (see the -H option
Jan F. Chadima 1b8a26
diff -up openssh-5.6p1/ssh-keygen.1.keygen openssh-5.6p1/ssh-keygen.1
Jan F. Chadima 1b8a26
--- openssh-5.6p1/ssh-keygen.1.keygen	2010-08-05 05:05:32.000000000 +0200
Jan F. Chadima 1b8a26
+++ openssh-5.6p1/ssh-keygen.1	2010-08-23 12:36:25.000000000 +0200
Jan F. Chadima bd929b
@@ -47,6 +47,7 @@
Jan F. Chadima bd929b
 .Bk -words
Jan F. Chadima 1b8a26
 .Nm ssh-keygen
Jan F. Chadima bd929b
 .Op Fl q
Jan F. Chadima bd929b
+.Op Fl o
Jan F. Chadima bd929b
 .Op Fl b Ar bits
Jan F. Chadima bd929b
 .Fl t Ar type
Jan F. Chadima bd929b
 .Op Fl N Ar new_passphrase
Jan F. Chadima 1b8a26
@@ -397,6 +398,8 @@ Silence
Jan F. Chadima bd929b
 Used by
Jan F. Chadima bd929b
 .Pa /etc/rc
Jan F. Chadima bd929b
 when creating a new key.
Jan F. Chadima bd929b
+.It Fl o
Jan F. Chadima bd929b
+Overwrite the key without prompting user.
Jan F. Chadima bd929b
 .It Fl R Ar hostname
Jan F. Chadima bd929b
 Removes all keys belonging to
Jan F. Chadima bd929b
 .Ar hostname
Jan F. Chadima 1b8a26
diff -up openssh-5.6p1/ssh-keygen.c.keygen openssh-5.6p1/ssh-keygen.c
Jan F. Chadima 1b8a26
--- openssh-5.6p1/ssh-keygen.c.keygen	2010-08-05 05:05:32.000000000 +0200
Jan F. Chadima 1b8a26
+++ openssh-5.6p1/ssh-keygen.c	2010-08-23 12:34:40.000000000 +0200
Jan F. Chadima bd929b
@@ -72,6 +72,7 @@ int change_passphrase = 0;
Jan F. Chadima bd929b
 int change_comment = 0;
Jan F. Chadima bd929b
 
Jan F. Chadima bd929b
 int quiet = 0;
Jan F. Chadima bd929b
+int overwrite = 0;
Jan F. Chadima bd929b
 
Jan F. Chadima bd929b
 int log_level = SYSLOG_LEVEL_INFO;
Jan F. Chadima bd929b
 
Jan F. Chadima 1b8a26
@@ -1798,7 +1799,7 @@ main(int argc, char **argv)
Jan F. Chadima bd929b
 		exit(1);
Jan F. Chadima bd929b
 	}
Jan F. Chadima bd929b
 
Jan F. Chadima 1b8a26
-	while ((opt = getopt(argc, argv, "degiqpclBHLhvxXyF:b:f:t:D:I:P:m:N:n:"
Jan F. Chadima 1b8a26
+	while ((opt = getopt(argc, argv, "degiqopclBHLhvxXyF:b:f:t:D:I:P:m:N:n:"
Jan F. Chadima 1b8a26
 	    "O:C:r:g:R:T:G:M:S:s:a:V:W:z:")) != -1) {
Jan F. Chadima bd929b
 		switch (opt) {
Jan F. Chadima bd929b
 		case 'b':
Jan F. Chadima 1b8a26
@@ -1878,6 +1879,9 @@ main(int argc, char **argv)
Jan F. Chadima bd929b
 		case 'q':
Jan F. Chadima bd929b
 			quiet = 1;
Jan F. Chadima bd929b
 			break;
Jan F. Chadima bd929b
+		case 'o':
Jan F. Chadima bd929b
+			overwrite = 1;
Jan F. Chadima bd929b
+			break;
Jan F. Chadima bd929b
 		case 'e':
Jan F. Chadima bd929b
 		case 'x':
Jan F. Chadima bd929b
 			/* export key */
Jan F. Chadima 1b8a26
@@ -2124,7 +2128,7 @@ main(int argc, char **argv)
Jan F. Chadima 1b8a26
 		}
Jan F. Chadima bd929b
 	}
Jan F. Chadima bd929b
 	/* If the file already exists, ask the user to confirm. */
Jan F. Chadima bd929b
-	if (stat(identity_file, &st) >= 0) {
Jan F. Chadima bd929b
+	if (!overwrite && stat(identity_file, &st) >= 0) {
Jan F. Chadima bd929b
 		char yesno[3];
Jan F. Chadima bd929b
 		printf("%s already exists.\n", identity_file);
Jan F. Chadima bd929b
 		printf("Overwrite (y/n)? ");