Re: Question about ssh-keygen -Y find-principals

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



Hi Damien,

I've verified that slightly modifying your patch makes the problem disappear:

diff --git a/sshsig.c b/sshsig.c
index d50d65fe2..145bca862 100644
--- a/sshsig.c
+++ b/sshsig.c
@@ -747,7 +747,7 @@ parse_principals_key_and_options(const char *path, u_long linenum, char *line,

 	cp = line;
 	cp = cp + strspn(cp, " \t"); /* skip leading whitespace */
-	if (*cp == '#' || *cp == '\0')
+	if (*cp == '#' || *cp == '\0' || strcmp(cp, "\n") == 0)
 		return SSH_ERR_KEY_NOT_FOUND; /* blank or all-comment line */

 	/* format: identity[,identity...] [option[,option...]] key */

(Note the \n instead of \r)

I've also experimented with the code a bit and found out that if the line that skips the whitespace:
 	cp = cp + strspn(cp, " \t"); /* skip leading whitespace */

is adjusted slightly to include newline characters:

 	cp = cp + strspn(cp, " \t\n\r"); /* skip leading whitespace */
	if (*cp == '#' || *cp == '\0')   /* <- no change in this line */

then the problem also disappears.

I'd be happy to send a patch if you think one of these look reasonable.

Thanks for help!

Kind regards,
Wiktor
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev



[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux