Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 376166 - Update script doesn't account for ACLs
Summary: Update script doesn't account for ACLs
Status: VERIFIED WONTFIX
Alias: None
Product: Community
Classification: Eclipse Foundation
Component: Git (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Eclipse Webmaster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 376318 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-04-05 06:49 EDT by Markus Keller CLA
Modified: 2014-03-07 08:25 EST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2012-04-05 06:49:26 EDT
Moving this discussion from mails to Bugzilla:

I can't push to eclipse.platform.common any more:

--------------------------------------------------------------------------
Repository
ssh://mkeller@dev.eclipse.org/gitroot/platform/eclipse.platform.common.git

hook declined
error: git.eclipse.org does not know this committer,
 or this this
committer cannot commit to this project (gid=8777
repo:eclipse.platform.common): mkeller.

denied: You (mkeller) cannot
push changes that were not committed by you or members of your project.
Please fix your repository, and see http://wiki.eclipse.org/Git for
information on configuring your Git environment.

error: hook declined
to update refs/heads/master
--------------------------------------------------------------------------

Pushing to other repos (e.g. eclipse.jdt.ui) still works fine.
I didn't change any settings recently and the configurations of the two repos look the same.


Matt confirmed that
> the issue is the script doesn't check for 'extended' access permissions.
and added possible solutions:
> we can either remove the hook script(allowing you and others to commit, with
> the potential for IP oddness), or you can be elected to eclipse.platform.


While I personally would not have problem with being elected to eclipse.platform, I don't think this should be the solution for all committers that should have access to the eclipse.platform.common repo.


Can't you change the update hook to use "test -w <repoDir>" instead of asking LDAP?
Comment 1 Dani Megert CLA 2012-04-05 06:51:58 EDT
> ), or you can be elected to eclipse.platform.

This is not an option.
Comment 2 Denis Roy CLA 2012-04-05 09:11:30 EDT
The purpose of the update hook is to ensure that all the commit entries are done by a committer on the project that owns the repo.

I know the answer you're looking for is "fix the script" but I don't believe that investing hours of time and adding layers of complexity for this one corner case is efficient.

My suggestion is to simply remove the hook from /gitroot/platform/eclipse.platform.common.git given its nature.
Comment 3 Denis Roy CLA 2012-04-05 09:12:47 EDT
> Can't you change the update hook to use "test -w <repoDir>" instead of asking
> LDAP?

If the only purpose of the hook was testing if the person performing the push could write to the file system, we wouldn't need the hook, eh?
Comment 4 Dani Megert CLA 2012-04-05 09:46:13 EDT
Denis, this used to work. I suspect this got broken by the changes made for bug 374248.
Comment 5 Markus Keller CLA 2012-04-05 10:26:19 EDT
(In reply to comment #3)
OK, so a setuid program would have to do something like
"sudo -u <user> test -w <repoDir>" (but making sure that the variables cannot be abused to run code as root).
Comment 6 David Williams CLA 2012-04-05 22:42:05 EDT
(In reply to comment #4)
> Denis, this used to work. I suspect this got broken by the changes made for bug
> 374248.

I commented in bug 374248 that it probably wasn't the changes, per se, to the update hook that caused this, but instead that the update/commit hook happened to be added/replaced in all repos, even ones that previously did not have one (such as our "maps repo"). I don't know if any of you "old timers" :) would recall, but my guess is this "documentation repo" had also previously removed the commit (update) hook. 

So, before I forgot, wanted to mention if you want to do that for the documentation repo, any member of eclipse.platform group can remove the file

/gitroot/platform/eclipse.platform.common.git/hooks/update

(its owned by root ... don't ask me how it it works :) ... but, I think that it is directory owner or group that has ultimate control of the files in the directory ... so I heard laughingly when I foolishly asked Denis to type his root password on my computer at EclispeCon :) 

Just trying to help ... and wanted to write it down before I shutdown my computer and loose my notes :)
Comment 7 Eclipse Webmaster CLA 2012-04-09 09:38:26 EDT
*** Bug 376318 has been marked as a duplicate of this bug. ***
Comment 8 Dani Megert CLA 2012-04-10 03:45:57 EDT
(In reply to comment #6)
> I don't know if any of you "old timers" :) would
> recall, but my guess is this "documentation repo" had also previously removed
> the commit (update) hook. 

What do you mean by "previously"? CVS?
Comment 9 Denis Roy CLA 2012-04-10 09:23:47 EDT
(In reply to comment #8)
> What do you mean by "previously"? CVS?

No, the update hook was not applied to all the Git repos.  There were 100 (or so) repos that did not have the hook.  When I updated it for bug 374248 I proceeded to copy it to all the repos.  In the case of this repo, the hook was likely never there.

As per comment 2, I recommend we simply remove it from the repo as it was before.
Comment 10 David Williams CLA 2012-04-10 09:30:58 EDT
(In reply to comment #8)
> (In reply to comment #6)
> > I don't know if any of you "old timers" :) would
> > recall, but my guess is this "documentation repo" had also previously removed
> > the commit (update) hook. 
> 
> What do you mean by "previously"? CVS?

I mean"previously" like a few weeks or months ago, when the Eclipse Project started using Git.
Comment 11 Dani Megert CLA 2012-04-10 09:33:52 EDT
(In reply to comment #10)
> (In reply to comment #8)
> > (In reply to comment #6)
> > > I don't know if any of you "old timers" :) would
> > > recall, but my guess is this "documentation repo" had also previously removed
> > > the commit (update) hook. 
> > 
> > What do you mean by "previously"? CVS?
> 
> I mean"previously" like a few weeks or months ago, when the Eclipse Project
> started using Git.

OK. The "old timers" comment distracted me here ;-).


> As per comment 2, I recommend we simply remove it from the repo as it was
> before.
I think that's the best we can do for now. +1.
Comment 12 John Arthorne CLA 2012-04-10 09:35:35 EDT
(In reply to comment #9)
> As per comment 2, I recommend we simply remove it from the repo as it was
> before.

Done.
Comment 13 Ayushman Jain CLA 2012-05-02 02:58:44 EDT
I'm facing the same problem today with eclipse.platform.news repo. I think the fix was done only for eclipse.platform.common.

Please fix this for platform.news since N&N are due today. Thanks!
Comment 14 Dani Megert CLA 2012-05-02 03:33:36 EDT
(In reply to comment #13)
> I'm facing the same problem today with eclipse.platform.news repo. I think the
> fix was done only for eclipse.platform.common.
> 
> Please fix this for platform.news since N&N are due today. Thanks!

Please try again now.
Comment 15 Ayushman Jain CLA 2012-05-02 04:05:59 EDT
(In reply to comment #14)
> Please try again now.

It works now. Thanks Dani!
Comment 16 Dani Megert CLA 2012-12-12 12:26:43 EST
Just for the records: even without the update script, only committers that are part of one of the ACLs can actually push a change. The script only checks whether the committer field of a change holds a registered committer for that project. Since that check is done against the file's group instead of the ACLs, this fails for projects with > 1 ACL (this bug). The check is needed so that also commits which are e.g. taken (i.e. pushed) from Git Hub are correctly validated.
Comment 17 Markus Keller CLA 2012-12-12 13:47:25 EST
Outcome of this bug / reminder for everyone touching hook scripts on eclipse.org:

Repos that use extended ACLs cannot use the current *.git/hooks/update script (eclipse.platform.common, eclipse.platform.news, eclipse.platform.releng.maps).
Comment 18 Markus Keller CLA 2014-03-07 08:25:36 EST
(In reply to Markus Keller from comment #17)
> Outcome of this bug / reminder for everyone touching hook scripts on
> eclipse.org:
> 
> Repos that use extended ACLs cannot use the current *.git/hooks/update
> script (eclipse.platform.common, eclipse.platform.news,
> eclipse.platform.releng.maps).

OTOH, *all* projects can use the hooks/pre-receive that prevents non-FF updates and branch deletions, etc. (bug 362363).

I've added the missing /platform/eclipse.platform.news.git/hooks/pre-receive .