On Fri, 7 Jan 2000, Thayne Harbaugh wrote:

> "Eric J. Schwertfeger" wrote:
> > 
> > On 7 Jan 2000, Niels M�ller wrote:
> > 
> > > Copying keys from captured_keys to known_hosts should work.
> > 
> > It didn't, I'll look into that more this lunch, and maybe this weekend.
> > 
> 
> Make sure you don't have an extra line of garbage on the end of your
> captured key - similar to my problem.  No, I haven't spent the moment
> to further investigate my problem.

That was the problem.  I deleted the file, ran lsh, and had no garbage in
the file. Ran lsh again, and still no garbage. Replaced captured_keys with
100 lines of "testing\n", this time got garbage at the end of the line.

Looked at the truss output:

syscall open("/home/ejs/.lsh/captured_keys",521,0600)

        521 is O_APPEND|O_CREAT|O_WRONLY so that looks right.

syscall fcntl(0x6,0x4,0x4)

        0x4 is F_SETFL

syscall fcntl(0x6,0x2,0x1)

        0x2 is F_SETFD

syscall write(6,0x808540c,500)

syscall write(6,0x8085600,213)

And we never close the file?  the F_SETFD is setting close_on_exec though.

I've never played with fcntl, but somehow lsh is getting the OS to ignore
the O_APPEND flag.



Reply via email to