Bugzilla – Attachment 2931 Details for
Bug 2655
AuthorizedKeysCommand with large output can deadlock
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
consume entire output of keys/principals on success
bz2655_2.diff (text/plain), 1.47 KB, created by
Damien Miller
on 2017-01-27 12:04:12 AEDT
(
hide
)
Description:
consume entire output of keys/principals on success
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2017-01-27 12:04:12 AEDT
Size:
1.47 KB
patch
obsolete
>Index: auth2-pubkey.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/auth2-pubkey.c,v >retrieving revision 1.61 >diff -u -p -r1.61 auth2-pubkey.c >--- auth2-pubkey.c 30 Dec 2016 22:08:02 -0000 1.61 >+++ auth2-pubkey.c 27 Jan 2017 01:02:08 -0000 >@@ -561,9 +561,12 @@ process_principals(FILE *f, char *file, > { > char line[SSH_MAX_PUBKEY_BYTES], *cp, *ep, *line_opts; > u_long linenum = 0; >- u_int i; >+ u_int i, found_principal = 0; > > while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) { >+ /* Always consume entire input */ >+ if (found_principal) >+ continue; > /* Skip leading whitespace. */ > for (cp = line; *cp == ' ' || *cp == '\t'; cp++) > ; >@@ -596,11 +599,12 @@ process_principals(FILE *f, char *file, > if (auth_parse_options(pw, line_opts, > file, linenum) != 1) > continue; >- return 1; >+ found_principal = 1; >+ continue; > } > } > } >- return 0; >+ return found_principal; > } > > static int >@@ -768,6 +772,9 @@ check_authkeys_file(FILE *f, char *file, > char *cp, *key_options = NULL, *fp = NULL; > const char *reason = NULL; > >+ /* Always consume entrire file */ >+ if (found_key) >+ continue; > if (found != NULL) > key_free(found); > found = key_new(key_is_cert(key) ? KEY_UNSPEC : key->type); >@@ -854,7 +861,7 @@ check_authkeys_file(FILE *f, char *file, > file, linenum, key_type(found), fp); > free(fp); > found_key = 1; >- break; >+ continue; > } > } > if (found != NULL)
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
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 2655
: 2931