git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-cvsserver doesn't respect core.sharedrepository
@ 2007-02-13 14:38 Andy Parkins
  2007-02-13 15:11 ` Johannes Schindelin
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Parkins @ 2007-02-13 14:38 UTC (permalink / raw)
  To: git

Hello,

I'm using git-cvsserver with a repository that has core.sharedrepository set 
to "group".  After a commit has been pushed using git-cvsserver I have to 
correct the permissions again.

I suspect then that git-cvsserver is somehow bypassing git's normal fixing of 
the permissions bits.  I'm not entirely sure though, as I can't entirely see 
how the calling of path.c:adjust_shared_perm() can be avoided.


Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com

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

* Re: git-cvsserver doesn't respect core.sharedrepository
  2007-02-13 14:38 git-cvsserver doesn't respect core.sharedrepository Andy Parkins
@ 2007-02-13 15:11 ` Johannes Schindelin
  2007-02-13 16:05   ` Andy Parkins
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Schindelin @ 2007-02-13 15:11 UTC (permalink / raw)
  To: Andy Parkins; +Cc: git

Hi,

On Tue, 13 Feb 2007, Andy Parkins wrote:

> I'm using git-cvsserver with a repository that has core.sharedrepository set 
> to "group".  After a commit has been pushed using git-cvsserver I have to 
> correct the permissions again.

Are you sure?

Since ref updates are not write-into-existing-file, but rather 
write-into-new-file-and-replace-old, it should work, no?

Ciao,
Dscho

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

* Re: git-cvsserver doesn't respect core.sharedrepository
  2007-02-13 15:11 ` Johannes Schindelin
@ 2007-02-13 16:05   ` Andy Parkins
  2007-02-13 16:48     ` Nicolas Pitre
  2007-02-13 18:10     ` Johannes Schindelin
  0 siblings, 2 replies; 7+ messages in thread
From: Andy Parkins @ 2007-02-13 16:05 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin

On Tuesday 2007 February 13 15:11, Johannes Schindelin wrote:

> Since ref updates are not write-into-existing-file, but rather
> write-into-new-file-and-replace-old, it should work, no?

That perhaps might be the explanation for the bad behaviour.  The ref is being 
updated in git-cvsserver by writing the new head hash into the lockfile then 
doing

    unlink($reffile);
    rename($lockfile, $reffile);

The lockfile is made with whatever umask is in place, so the 
sharedrepository=group is being ignored.  The solution then is to use the 
permissions of the existing reffile when creating the lockfile.

Thanks Johannes.  One little sentence and it all becomes clear :-)


Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com

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

* Re: git-cvsserver doesn't respect core.sharedrepository
  2007-02-13 16:05   ` Andy Parkins
@ 2007-02-13 16:48     ` Nicolas Pitre
  2007-02-13 18:10     ` Johannes Schindelin
  1 sibling, 0 replies; 7+ messages in thread
From: Nicolas Pitre @ 2007-02-13 16:48 UTC (permalink / raw)
  To: Andy Parkins; +Cc: git, Johannes Schindelin

On Tue, 13 Feb 2007, Andy Parkins wrote:

> That perhaps might be the explanation for the bad behaviour.  The ref is being 
> updated in git-cvsserver by writing the new head hash into the lockfile then 
> doing
> 
>     unlink($reffile);
>     rename($lockfile, $reffile);

Wouldn't it be much better if it used git-update-ref instead?  This 
manual ref updating looks like it has a potential for races to me.

Also git-update-ref should probably be used with -m to create reflog 
entries.


Nicolas

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

* Re: git-cvsserver doesn't respect core.sharedrepository
  2007-02-13 16:05   ` Andy Parkins
  2007-02-13 16:48     ` Nicolas Pitre
@ 2007-02-13 18:10     ` Johannes Schindelin
  2007-02-13 18:21       ` Andy Parkins
  1 sibling, 1 reply; 7+ messages in thread
From: Johannes Schindelin @ 2007-02-13 18:10 UTC (permalink / raw)
  To: Andy Parkins; +Cc: git

Hi,

On Tue, 13 Feb 2007, Andy Parkins wrote:

> On Tuesday 2007 February 13 15:11, Johannes Schindelin wrote:
> 
> > Since ref updates are not write-into-existing-file, but rather
> > write-into-new-file-and-replace-old, it should work, no?
> 
> That perhaps might be the explanation for the bad behaviour.

Ummm. What I tried to say is that this is intended behaviour, not bad 
behaviour. The file does not have to have write permissions for the group. 
The _directory_ has to have them.

Ciao,
Dscho

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

* Re: git-cvsserver doesn't respect core.sharedrepository
  2007-02-13 18:10     ` Johannes Schindelin
@ 2007-02-13 18:21       ` Andy Parkins
  2007-03-05  5:15         ` Martin Langhoff
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Parkins @ 2007-02-13 18:21 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin

On Tuesday 2007, February 13, Johannes Schindelin wrote:

> Ummm. What I tried to say is that this is intended behaviour, not bad
> behaviour. The file does not have to have write permissions for the
> group. The _directory_ has to have them.

It's not just write permissions.  The default umask could also prevent 
read access by the group - the new ref needs to be readable by the 
group.


Andy
-- 
Dr Andrew Parkins, M Eng (Hons), AMIEE
andyparkins@gmail.com

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

* Re: git-cvsserver doesn't respect core.sharedrepository
  2007-02-13 18:21       ` Andy Parkins
@ 2007-03-05  5:15         ` Martin Langhoff
  0 siblings, 0 replies; 7+ messages in thread
From: Martin Langhoff @ 2007-03-05  5:15 UTC (permalink / raw)
  To: Andy Parkins; +Cc: git, Johannes Schindelin

On 2/14/07, Andy Parkins <andyparkins@gmail.com> wrote:
> On Tuesday 2007, February 13, Johannes Schindelin wrote:
>
> > Ummm. What I tried to say is that this is intended behaviour, not bad
> > behaviour. The file does not have to have write permissions for the
> > group. The _directory_ has to have them.
>
> It's not just write permissions.  The default umask could also prevent
> read access by the group - the new ref needs to be readable by the
> group.

I agree. cvsserver depends on the user's umask just like an oldstyle
cvs server. This is probably wrong, and you are right - we should
respect core.sharedrepository.

The recent change to use git-update-ref should have fixed part of the
problem. The other part of the problem is the handling of the sqlite
files. All the other operations that leave permanent files in the repo
are using git plumbing so we are safe.

To fix the sqlite files handling, the fix is to change the umask early
on if core.sharedrepository is true.

cheers,


martin

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

end of thread, other threads:[~2007-03-05  5:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-13 14:38 git-cvsserver doesn't respect core.sharedrepository Andy Parkins
2007-02-13 15:11 ` Johannes Schindelin
2007-02-13 16:05   ` Andy Parkins
2007-02-13 16:48     ` Nicolas Pitre
2007-02-13 18:10     ` Johannes Schindelin
2007-02-13 18:21       ` Andy Parkins
2007-03-05  5:15         ` Martin Langhoff

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