[syslinux] truncated files on write with tftpd-hpa

Alan Sundell asundell+syslinux at fas.harvard.edu
Wed Jul 9 15:06:31 PDT 2003


On Wed, Jul 09, 2003 at 01:15:27PM -0700, H. Peter Anvin wrote:
> Alan Sundell wrote:
> > Hey, remember this issue?
> 
> I remember.  I just haven't had any time :(

Nor have I, so I understand :)

However, I'm going to be leaving here soon, and I wanted to tie up this
loose end.

Unfortunately, I forgot to attach the patches in my first message, and
the followup I sent with them is tied up in Mailman moderation ATM.  If
it doesn't go through soon, I'll just put them up on the web somewhere
or send them to you directly.


When it arrives, take a look at the late-truncate patch.  It's pretty
simple.  All it does is delay truncating until the first time it
receives a data packet.

The only problem I know of is that the file won't be truncated if you
don't have ftruncate().  Maybe we should truncate on open, in that case,
and just live with the possible data loss, but that's not in the patch.

Incidentally, in the current mainline code, there seems to be a problem
if you don't have ftruncate() and don't give the -p flag.  It looks like
the file will not be truncated in that case, either.

I guess the real question is: who doesn't have ftruncate()?

--Alan



More information about the Syslinux mailing list