[PATCH/cygwin] Fix cygwin specific Makefile and a bug in the ssh-host-config script

Daniel Kahn Gillmor dkg at fifthhorseman.net
Sat Nov 8 01:23:47 EST 2008


On Fri 2008-11-07 05:54:58 -0500, Corinna Vinschen wrote:

> diff -u -p -r1.22 ssh-host-config
> --- contrib/cygwin/ssh-host-config	14 Jul 2008 02:12:54 -0000	1.22
> +++ contrib/cygwin/ssh-host-config	7 Nov 2008 10:49:30 -0000
> @@ -456,7 +456,7 @@ done
>  
>  # Check for running ssh/sshd processes first. Refuse to do anything while
>  # some ssh processes are still running
> -if ps -ef | grep -v grep | grep -q ssh
> +if ps -ef | grep -v grep | grep -q 'sshd*$'
>  then
>    echo
>    csih_error "There are still ssh processes running. Please shut them down first."

This regular expression seems to match any line that ends in
sshddddd...  That is, sshd* matches sshd followed by any number of d
characters.  Is that really what is intended?

I don't run any cygwin systems any more, so i can't be certain that
this incorrect, but it seems unlikely to me.

Also, it seems that this check (with the grep -v grep) will also
*miss* any processes owned by usernames that contain the string
"grep".

On my debian box, some sshd processes look like this due to privsep
(e.g. for the sales representative for bags and backpacks):

bagrep    26479 26476  0 01:02 ?        00:00:00 sshd: bagrep at pts/5

If you're trying to match this kind of process, it would get missed by
the above invocation.

Are you trying to match running sshd processes that have *not* dropped
privileges yet?  or all sshd processes?

Sorry for not knowing more about cygwin and not being more helpful.

     --dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 826 bytes
Desc: not available
Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20081107/8e6c03e9/attachment.bin 


More information about the openssh-unix-dev mailing list