git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Still unsafe: write_sha1_from_fd()
@ 2005-10-06 22:26 Linus Torvalds
  2005-10-06 22:37 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Torvalds @ 2005-10-06 22:26 UTC (permalink / raw)
  To: Git Mailing List


I was looking over the object writing functions, and noticed that 
"write_sha1_from_fd()" writes its object directly into the final object 
name, which means that if it is interrupted with ^C at an inopportune 
time, it will leave a corrupt object behind.

The only user is apparently ssh-fetch, but especially since the input-fd 
is a network connection, it looks like it is not at all unlikely that this 
case will trigger - all it takes is somebody impatient waiting for a large 
object.

Ugh,

		Linus

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Still unsafe: write_sha1_from_fd()
  2005-10-06 22:26 Still unsafe: write_sha1_from_fd() Linus Torvalds
@ 2005-10-06 22:37 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2005-10-06 22:37 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

Linus Torvalds <torvalds@osdl.org> writes:

> The only user is apparently ssh-fetch, but especially since the input-fd 
> is a network connection, it looks like it is not at all unlikely that this 
> case will trigger - all it takes is somebody impatient waiting for a large 
> object.
>
> Ugh,

Ugh indeed.

I'd vote for renaming it to a less generic name, moving it out
of sha1_file.c -- make it static in ssh-fetch.c -- and slowly
deprecate the use of ssh-fetch/ssh-upload pair.

I do not see much point prefering it over the pack transfer
protocol anyway, if you already have ssh access to the box.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-10-06 22:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-06 22:26 Still unsafe: write_sha1_from_fd() Linus Torvalds
2005-10-06 22:37 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).