vishalmishra434 / rpms / openssh

Forked from rpms/openssh a month ago
Clone
Jan F. Chadima 69dd72
diff -up openssh-5.9p0/ssh-keygen.0.keygen openssh-5.9p0/ssh-keygen.0
Jan F. Chadima 69dd72
--- openssh-5.9p0/ssh-keygen.0.keygen	2011-08-29 16:30:02.000000000 +0200
Jan F. Chadima 69dd72
+++ openssh-5.9p0/ssh-keygen.0	2011-08-30 13:47:56.208087184 +0200
Jan F. Chadima 69dd72
@@ -4,7 +4,7 @@ NAME
Jan F. Chadima 69dd72
      ssh-keygen - authentication key generation, management and conversion
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
 SYNOPSIS
Jan F. Chadima 69dd72
-     ssh-keygen [-q] [-b bits] -t type [-N new_passphrase] [-C comment]
Jan F. Chadima 69dd72
+     ssh-keygen [-q] [-o] [-b bits] -t type [-N new_passphrase] [-C comment]
Jan F. Chadima 69dd72
                 [-f output_keyfile]
Jan F. Chadima 69dd72
      ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
Jan F. Chadima 69dd72
      ssh-keygen -i [-m key_format] [-f input_keyfile]
Jan F. Chadima 69dd72
@@ -181,6 +181,8 @@ DESCRIPTION
Jan F. Chadima 69dd72
              principals may be specified, separated by commas.  Please see the
Jan F. Chadima 69dd72
              CERTIFICATES section for details.
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
+     -o      Overwrite the key without prompting user.
Jan F. Chadima 69dd72
+
Jan F. Chadima 69dd72
      -O option
Jan F. Chadima 69dd72
              Specify a certificate option when signing a key.  This option may
Jan F. Chadima 69dd72
              be specified multiple times.  Please see the CERTIFICATES section
Jan F. Chadima 69dd72
diff -up openssh-5.9p0/ssh-keygen.1.keygen openssh-5.9p0/ssh-keygen.1
Jan F. Chadima 69dd72
--- openssh-5.9p0/ssh-keygen.1.keygen	2011-08-30 13:32:30.787149917 +0200
Jan F. Chadima 69dd72
+++ openssh-5.9p0/ssh-keygen.1	2011-08-30 13:46:42.638087171 +0200
Jan F. Chadima 69dd72
@@ -45,6 +45,7 @@
Jan F. Chadima 69dd72
 .Bk -words
Jan F. Chadima 69dd72
 .Nm ssh-keygen
Jan F. Chadima 69dd72
 .Op Fl q
Jan F. Chadima 69dd72
+.Op Fl o
Jan F. Chadima 69dd72
 .Op Fl b Ar bits
Jan F. Chadima 69dd72
 .Fl t Ar type
Jan F. Chadima 69dd72
 .Op Fl N Ar new_passphrase
Jan F. Chadima 69dd72
@@ -339,6 +340,8 @@ Multiple principals may be specified, se
Jan F. Chadima 69dd72
 Please see the
Jan F. Chadima 69dd72
 .Sx CERTIFICATES
Jan F. Chadima 69dd72
 section for details.
Jan F. Chadima 69dd72
+.It Fl o
Jan F. Chadima 69dd72
+Overwrite the key without prompting user.
Jan F. Chadima 69dd72
 .It Fl O Ar option
Jan F. Chadima 69dd72
 Specify a certificate option when signing a key.
Jan F. Chadima 69dd72
 This option may be specified multiple times.
Jan F. Chadima 69dd72
diff -up openssh-5.9p0/ssh-keygen.c.keygen openssh-5.9p0/ssh-keygen.c
Jan F. Chadima 69dd72
--- openssh-5.9p0/ssh-keygen.c.keygen	2011-08-30 13:32:20.268149992 +0200
Jan F. Chadima 69dd72
+++ openssh-5.9p0/ssh-keygen.c	2011-08-30 13:39:34.550214102 +0200
Jan F. Chadima 69dd72
@@ -73,6 +73,7 @@ int change_passphrase = 0;
Jan F. Chadima 69dd72
 int change_comment = 0;
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
 int quiet = 0;
Jan F. Chadima 69dd72
+int overwrite = 0;
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
 int log_level = SYSLOG_LEVEL_INFO;
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
@@ -1959,7 +1960,7 @@ main(int argc, char **argv)
Jan F. Chadima 69dd72
 		exit(1);
Jan F. Chadima 69dd72
 	}
Jan F. Chadima 69dd72
 
Jan F. Chadima 69dd72
-	while ((opt = getopt(argc, argv, "AegiqpclBHLhvxXyF:b:f:t:D:I:P:m:N:n:"
Jan F. Chadima 69dd72
+	while ((opt = getopt(argc, argv, "AegiqopclBHLhvxXyF:b:f:t:D:I:P:m:N:n:"
Jan F. Chadima 69dd72
 	    "O:C:r:g:R:T:G:M:S:s:a:V:W:z:")) != -1) {
Jan F. Chadima 69dd72
 		switch (opt) {
Jan F. Chadima 69dd72
 		case 'A':
Jan F. Chadima 69dd72
@@ -2042,6 +2043,9 @@ main(int argc, char **argv)
Jan F. Chadima 69dd72
 		case 'q':
Jan F. Chadima 69dd72
 			quiet = 1;
Jan F. Chadima 69dd72
 			break;
Jan F. Chadima 69dd72
+		case 'o':
Jan F. Chadima 69dd72
+			overwrite = 1;
Jan F. Chadima 69dd72
+			break;
Jan F. Chadima 69dd72
 		case 'e':
Jan F. Chadima 69dd72
 		case 'x':
Jan F. Chadima 69dd72
 			/* export key */
Jan F. Chadima 69dd72
@@ -2278,7 +2282,7 @@ main(int argc, char **argv)
Jan F. Chadima 69dd72
 		}
Jan F. Chadima 69dd72
 	}
Jan F. Chadima 69dd72
 	/* If the file already exists, ask the user to confirm. */
Jan F. Chadima 69dd72
-	if (stat(identity_file, &st) >= 0) {
Jan F. Chadima 69dd72
+	if (!overwrite && stat(identity_file, &st) >= 0) {
Jan F. Chadima 69dd72
 		char yesno[3];
Jan F. Chadima 69dd72
 		printf("%s already exists.\n", identity_file);
Jan F. Chadima 69dd72
 		printf("Overwrite (y/n)? ");