Bug 3305 - keygen-comment.sh failure
Summary: keygen-comment.sh failure
Status: CLOSED WORKSFORME
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Regression tests (show other bugs)
Version: 8.6p1
Hardware: Other Windows 10
: P5 minor
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-27 11:39 AEST by balu
Modified: 2022-02-25 13:58 AEDT (History)
3 users (show)

See Also:


Attachments
Screenshot (81.07 KB, image/png)
2021-04-27 11:58 AEST, balu
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description balu 2021-04-27 11:39:58 AEST
I'm using cygwin to test on my windows machine. keygen-comment.sh fails at https://github.com/openssh/openssh-portable/blob/77532609874a99a19e3e2eb2d1b7fa93aef963bb/regress/keygen-comment.sh#L14

$ egrep "^([0-9]+) SHA256:(.){43} ${comment} (.*)\$" ./ssh-ed25519-fgp
256 SHA256:LitlXmGRuL7VHjLgcZLMVa+OGnAZQZjypegmEFMZwZ0 foo bar (ED25519)

Administrator@balu-saw /cygdrive/c/Users/Administrator/Desktop/balu/openssh/code/master_branch/openssh-portable/regress/temp_test
$ egrep "^([0-9]+) SHA256:(.){43} ${comment} \(.*\)\$" ./ssh-ed25519-fgp

Administrator@balu-saw /cygdrive/c/Users/Administrator/Desktop/balu/openssh/code/master_branch/openssh-portable/regress/temp_test
$ egrep -V
grep (GNU grep) 3.0
Packaged by Cygwin (3.0-2)
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.

Administrator@balu-saw /cygdrive/c/Users/Administrator/Desktop/balu/openssh/code/master_branch/openssh-portable/regress/temp_test
$

Code change - 
   from - if ! egrep "^([0-9]+) SHA256:(.){43} ${comment} \(.*\)\$" \

   to - if ! egrep "^([0-9]+) SHA256:(.){43} ${comment} (.*)\$" \
Comment 1 balu 2021-04-27 11:54:13 AEST
Just to make it clear.

Without \, it works perfectly fine.

$ egrep "^([0-9]+) SHA256:(.){43} ${comment} (.*)\$" ./ssh-ed25519-fgp
256 SHA256:LitlXmGRuL7VHjLgcZLMVa+OGnAZQZjypegmEFMZwZ0 foo bar (ED25519)

Administrator@balu-saw /cygdrive/c/Users/Administrator/Desktop/balu/openssh/code/master_branch/openssh-portable/regress/temp_test

If I have \ (as in test cases) then it fails

$ egrep "^([0-9]+) SHA256:(.){43} ${comment} \(.*\)\$" ./ssh-ed25519-fgp

Administrator@balu-saw /cygdrive/c/Users/Administrator/Desktop/balu/openssh/code/master_branch/openssh-portable/regress/temp_test

I have "egrep -V" output on my cygwin window in the issue description.
Comment 2 balu 2021-04-27 11:58:33 AEST
Created attachment 3503 [details]
Screenshot

Attached is the screenshot that shows the cygwin output where test fails with egrep error.
Comment 3 Darren Tucker 2021-05-07 13:36:43 AEST
We regularly test the main tree on Cygwin (current version as of a couple of weeks ago) and it passes.

(In reply to balu from comment #1)
> If I have \ (as in test cases) then it fails
[...]
> I have "egrep -V" output on my cygwin window in the issue
> description.

Line continuation with a final backslash is a function of the shell, not of grep.

Does your keygen-comment.sh contain only Unix-style newlines and not Windows-style CR/NL ?  I could imagine that causing a problem.
Comment 4 Damien Miller 2022-01-14 15:19:25 AEDT
Closing for lack of followup
Comment 5 Damien Miller 2022-02-25 13:58:34 AEDT
closing bugs resolved before openssh-8.9