Bugzilla – Attachment 2048 Details for
Bug 1870
Do not show VisualHostKey unless attached to a terminal
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
/home/djm/bz1870.diff
bz1870.diff (text/plain), 2.59 KB, created by
Damien Miller
on 2011-05-20 12:11:14 AEST
(
hide
)
Description:
/home/djm/bz1870.diff
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2011-05-20 12:11:14 AEST
Size:
2.59 KB
patch
obsolete
>Index: readconf.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/readconf.c,v >retrieving revision 1.192 >diff -u -p -r1.192 readconf.c >--- readconf.c 6 May 2011 21:34:32 -0000 1.192 >+++ readconf.c 20 May 2011 02:10:26 -0000 >@@ -987,7 +987,23 @@ parse_int: > > case oVisualHostKey: > intptr = &options->visual_host_key; >- goto parse_flag; >+ arg = strdelim(&s); >+ if (!arg || *arg == '\0') >+ fatal("%s line %d: Missing yes/no/always argument.", >+ filename, linenum); >+ value = 0; /* silence compiler */ >+ if (strcasecmp(arg, "always") == 0) >+ value = VISUAL_HOST_ALWAYS; >+ else if (strcasecmp(arg, "yes") == 0) >+ value = VISUAL_HOST_YES; >+ else if (strcasecmp(arg, "no") == 0) >+ value = VISUAL_HOST_NO; >+ else >+ fatal("%s line %d: Missing yes/no/always argument: %s", >+ filename, linenum, arg); >+ if (*activep) >+ *intptr = value; >+ break; > > case oIPQoS: > arg = strdelim(&s); >Index: readconf.h >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/readconf.h,v >retrieving revision 1.89 >diff -u -p -r1.89 readconf.h >--- readconf.h 6 May 2011 21:34:32 -0000 1.89 >+++ readconf.h 20 May 2011 02:10:26 -0000 >@@ -146,6 +146,10 @@ typedef struct { > #define REQUEST_TTY_YES 2 > #define REQUEST_TTY_FORCE 3 > >+#define VISUAL_HOST_NO 0 >+#define VISUAL_HOST_YES 1 >+#define VISUAL_HOST_ALWAYS 2 >+ > void initialize_options(Options *); > void fill_default_options(Options *); > int read_config_file(const char *, const char *, Options *, int); >Index: sshconnect.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/sshconnect.c,v >retrieving revision 1.232 >diff -u -p -r1.232 sshconnect.c >--- sshconnect.c 16 Jan 2011 11:50:36 -0000 1.232 >+++ sshconnect.c 20 May 2011 02:10:26 -0000 >@@ -64,6 +64,7 @@ extern Options options; > extern char *__progname; > extern uid_t original_real_uid; > extern uid_t original_effective_uid; >+extern int tty_flag; > > static int show_other_keys(struct hostkeys *, Key *); > static void warn_changed_key(Key *); >@@ -771,7 +772,9 @@ check_host_key(char *hostname, struct so > logit("Warning: Permanently added the %s host " > "key for IP address '%.128s' to the list " > "of known hosts.", type, ip); >- } else if (options.visual_host_key) { >+ } else if (options.visual_host_key == VISUAL_HOST_ALWAYS || >+ ((tty_flag || isatty(STDERR_FILENO)) && >+ options.visual_host_key == VISUAL_HOST_YES)) { > fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX); > ra = key_fingerprint(host_key, SSH_FP_MD5, > SSH_FP_RANDOMART);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1870
: 2048