2 Nov 2005 03:10
(unknown)
Cornel Izbasa <cizbasa <at> info.uvt.ro>
2005-11-02 02:10:57 GMT
2005-11-02 02:10:57 GMT
Hello,
I've noticed that ssh always opens /etc/passwd
on my Linux box before parsing command line options, and so the file is
opened even if the user is afterward presented with the usage and the
program ends.
So, this snippet in OpenSSH-4.2p1,
ssh.c: 219
/* Get user data. */
pw = getpwuid(original_real_uid);
if (!pw) {
logit("You don't exist, go away!");
exit(1);
}
/* Take a copy of the returned structure. */
pw = pwcopy(pw);
should probably be moved after options scanning, for example at
ssh: 515, after:
/* Check that we got a host name. */
if (!host)
usage();
I tested this and nothing seems to be broken by it. I can submit a patch
if it is wanted.
Cornel
In the dump file, I found three simple messages that did the job:
First: A SYN request to the ssh port
0000 00 01 80 57 16 3d 00 90 d0 af 86 eb 08 00 45 00 ...W.=.. ......E.
0010 00 30 3c 2d 00 00 74 06 1b fd d2 f0 11 2c 0a 00 .0<-..t. .....,..
0020 00 82 d6 d3 00 16 7e c1 e4 5f 75 72 0c 80 70 02 ......~. ._ur..p.
0030 ff ff d8 83 00 00 02 04 05 b4 01 01 04 02 ........ ......
Next the reply from my box (SYN ACK):
RSS Feed