git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Destructive side-effect of "cg-status"
@ 2005-09-30 16:03 Wolfgang Denk
  2005-10-01 10:24 ` Martin Langhoff
  2005-10-01 16:41 ` Linus Torvalds
  0 siblings, 2 replies; 18+ messages in thread
From: Wolfgang Denk @ 2005-09-30 16:03 UTC (permalink / raw)
  To: git

So far I  thought  "cg-status"  is  a  harmless  command  which  just
displays  some  status information. It ain't so. One of our engineers
reported a  corrupted  repository  after  I  ran  "cg-status"  in  his
directory:

$ cg-status
Heads:
   >master      805f93e4ca96d0c0cb2d2f9532d9666b22961e88
  R origin      805f93e4ca96d0c0cb2d2f9532d9666b22961e88

error: open failed
fatal: cache corrupted
error: open failed
? COPYING
? CREDITS
? Documentation/00-INDEX
? Documentation/BUG-HUNTING
...
error: open failed
read_cache: Permission denied
...
error: open failed
read_cache: Permission denied
...


As mentioned before,  all  I  did  was  running  "cg-status"  in  his
directory. Here is what happens:

Before:

	-> rpm -q cogito
	cogito-0.15.1-1
	-> id
	uid=500(wd) gid=500(wd) groups=200(gitmaster),400(denx),500(wd)
	-> umask
	0002
	-> ls -ld .git
	drwxrwxrwx  6 sr sr 80 Sep 30 17:49 .git
	-> ls -l .git/index
	-rw-r--r--  1 sr sr 1728032 Sep 30 17:17 .git/index

Then:

	-> cg-status
	Heads:
	   >master      805f93e4ca96d0c0cb2d2f9532d9666b22961e88
	  R origin      805f93e4ca96d0c0cb2d2f9532d9666b22961e88

	M arch/ppc/configs/bubinga_defconfig
	M arch/ppc/configs/walnut_defconfig
	-> ls -l .git/index
	-rw-------  1 wd wd 1728032 Sep 30 17:49 .git/index
	^^^^^^^^^^    ^^^^^

That means, that "cg-status" actually *rewrote* .git/index,  with  me
(wd)  as  new  owner, and - ignoring my umask - with permissions that
prevent the original owner (sr) to access the file!

Arghhhh!!!

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Generally speaking, there are other ways to accomplish whatever it is
that you think you need ...                               - Doug Gwyn

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

end of thread, other threads:[~2005-10-03 18:32 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-30 16:03 Destructive side-effect of "cg-status" Wolfgang Denk
2005-10-01 10:24 ` Martin Langhoff
2005-10-01 16:41 ` Linus Torvalds
2005-10-01 18:14   ` Junio C Hamano
2005-10-01 19:07     ` Honor extractor's umask in git-tar-tree Junio C Hamano
2005-10-02  3:24       ` H. Peter Anvin
2005-10-02  9:55         ` Matthias Urlichs
2005-10-03  4:44           ` H. Peter Anvin
2005-10-03  5:10             ` Junio C Hamano
2005-10-03 16:30               ` H. Peter Anvin
2005-10-03 17:18                 ` Junio C Hamano
2005-10-03 17:28                   ` H. Peter Anvin
2005-10-03 17:45                 ` Linus Torvalds
2005-10-03 18:05                   ` H. Peter Anvin
2005-10-03 18:18                     ` Linus Torvalds
2005-10-03 18:32                       ` H. Peter Anvin
2005-10-01 19:42   ` Destructive side-effect of "cg-status" Wolfgang Denk
2005-10-01 20:24     ` Linus Torvalds

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).