Bug 19660

Summary: Please give git commit rights to Martin Whitaker
Product: Infrastructure Reporter: Marja Van Waes <marja11>
Component: Account requestAssignee: Sysadmin Team <sysadmin-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: High CC: arnaud.patard, ennael1, mageia, mageia, mageia, sysadmin-bugs, thierry.vignaud, tmb
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: CVE:
Status comment:

Description Marja Van Waes 2016-10-26 12:40:56 CEST
Martin Whitaker has proven to be a very good contributor by providing us great patches for our tools.

Also, he joined the iso builders group.

Please give him git commit rights and, if possible with current state of Rabbit and if nothing else blocks that, the needed rights on rabbit/bcd, too

@ Martin

please give your Mageia identity nick
Comment 1 Martin Whitaker 2016-10-27 01:02:38 CEST
Thanks Marja! My Mageia user name is martinw.
Comment 2 Rémi Verschelde 2016-10-31 15:10:32 CET
Ping.

Priority: Normal => High

Comment 3 Nicolas Lécureuil 2016-11-01 11:40:05 CET
i do it today.
Comment 4 Nicolas Lécureuil 2016-11-01 11:45:09 CET
should be OK
Comment 5 Marja Van Waes 2016-11-01 12:21:46 CET
(In reply to Nicolas Lécureuil from comment #3)
> i do it today.
(In reply to Nicolas Lécureuil from comment #4)
> should be OK

Thanks, Nicolas :-D

http://people.mageia.org/u/martinw.html :

> Groups: mga-iso_makers 

@ Martin

Please close this report if everything works as expected.
Comment 6 Martin Whitaker 2016-11-02 10:00:14 CET
I'm not having any success, either with git or with ssh to rabbit.

For git, 'git config -l' shows

user.name=Martin Whitaker
credential.helper=cache
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=git://git.mageia.org/software/build-system/draklive
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.pushurl=ssh://git@git.mageia.org/software/build-system/draklive
branch.master.remote=origin
branch.master.merge=refs/heads/master
user.email=mageia@martin-whitaker.me.uk

A git push prompts me for a password, but doesn't accept my password I give.

Similarly, 'ssh martinw@rabbit.mageia.org' prompts for, but doesn't accept my password.

In both cases I'm using my Mageia identity password, which works for buzilla, etc.

According to the Wiki, I should be able to add my ssh public key to my Mageia account, but I don't see any way to do this at https://identity.mageia.org/user. The only additional attributes on offer are 'mobile', 'roomNumber', and 'secretary'.
Comment 7 Thomas Backlund 2016-11-02 10:21:58 CET
(In reply to Marja van Waes from comment #0)
> Martin Whitaker has proven to be a very good contributor by providing us
> great patches for our tools.
> 
> Also, he joined the iso builders group.
> 
> Please give him git commit rights and, if possible with current state of
> Rabbit and if nothing else blocks that, the needed rights on rabbit/bcd, too
> 
> @ Martin
> 
> please give your Mageia identity nick


Well, technically before opening accounts for anyone, they need a mentor assigned that reviews the work in the beginning.

Who's the mentor in this case ?

As for it still not working, I guess neoclust forgot about posix account promotion

CC: (none) => tmb

Comment 8 Marja Van Waes 2016-11-02 14:08:27 CET
(In reply to Thomas Backlund from comment #7)
> (In reply to Marja van Waes from comment #0)
> > Martin Whitaker has proven to be a very good contributor by providing us
> > great patches for our tools.
> > 
> > Also, he joined the iso builders group.
> > 
> > Please give him git commit rights and, if possible with current state of
> > Rabbit and if nothing else blocks that, the needed rights on rabbit/bcd, too

> 
> 
> Well, technically before opening accounts for anyone, they need a mentor
> assigned that reviews the work in the beginning.

A mentor for:
* the iso building itself and for 
* committing to git/software/build-system/ 

but not for git/software/drakx*, correct?

(He's already proven himself for drakx*, Thierry would like him to have commit rights and Thierry sees everything anybody commits there, anyway ;-) )

> 
> Who's the mentor in this case ?

CC'ing all mga-iso_makers that weren't in the CC, yet.



> 
> As for it still not working, I guess neoclust forgot about posix account
> promotion

CC: (none) => arnaud.patard, ennael1, mageia, thierry.vignaud

Comment 9 Thierry Vignaud 2016-11-02 14:44:32 CET
Indeed Martin already provided valuable fixes for several bugs.
Comment 10 Nicolas Lécureuil 2016-11-02 15:17:46 CET
(In reply to Martin Whitaker from comment #6)
> I'm not having any success, either with git or with ssh to rabbit.
> 
> For git, 'git config -l' shows
> 
> user.name=Martin Whitaker
> credential.helper=cache
> core.repositoryformatversion=0
> core.filemode=true
> core.bare=false
> core.logallrefupdates=true
> remote.origin.url=git://git.mageia.org/software/build-system/draklive
> remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
> remote.origin.pushurl=ssh://git@git.mageia.org/software/build-system/draklive
> branch.master.remote=origin
> branch.master.merge=refs/heads/master
> user.email=mageia@martin-whitaker.me.uk
> 
> A git push prompts me for a password, but doesn't accept my password I give.
> 
> Similarly, 'ssh martinw@rabbit.mageia.org' prompts for, but doesn't accept
> my password.
> 
> In both cases I'm using my Mageia identity password, which works for
> buzilla, etc.
> 
> According to the Wiki, I should be able to add my ssh public key to my
> Mageia account, but I don't see any way to do this at
> https://identity.mageia.org/user. The only additional attributes on offer
> are 'mobile', 'roomNumber', and 'secretary'.


is it better now ?
Comment 11 Martin Whitaker 2016-11-03 00:51:46 CET
(In reply to Nicolas Lécureuil from comment #10)
> is it better now ?

No, still the same response.
Comment 12 Nicolas Lécureuil 2016-11-03 16:01:17 CET
you should be able to add you sshkey
Comment 13 Martin Whitaker 2016-11-04 01:55:57 CET
Getting there :-)

I can now add my sshkey, and this enables me to ssh to rabbit. Pushing to git is still failing, but in a different way:

% git push origin master
X11 forwarding request failed on channel 0
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 367 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: FATAL: W refs/heads/master software/build-system/draklive martinw DENIED by fallthru
remote: error: hook declined to update refs/heads/master
To ssh://git@git.mageia.org/software/build-system/draklive
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'ssh://git@git.mageia.org/software/build-system/draklive'
Comment 14 Martin Whitaker 2016-11-04 09:57:07 CET
P.S. I found bug 16119 and tried the fix there (check out a new clone), but it didn't help.
Comment 15 Martin Whitaker 2016-11-04 21:21:04 CET
I've just realised there is a major obstacle to me using rabbit to build Live ISOs. draklive runs an install in a chroot, so needs root privileges. I don't see a way round this.
Comment 16 Thomas Backlund 2016-11-04 21:28:18 CET
draklive user on rabbit has root privilegies for the needed parts, so calling draklive with sudo should work
Comment 17 Martin Whitaker 2016-11-04 21:52:26 CET
I'd need to be able to su to the draklive user to do that, wouldn't I?
Comment 18 Olivier Blin 2016-11-05 19:41:21 CET
(In reply to Martin Whitaker from comment #13)

> remote: FATAL: W refs/heads/master software/build-system/draklive martinw
> DENIED by fallthru
> remote: error: hook declined to update refs/heads/master
> To ssh://git@git.mageia.org/software/build-system/draklive
>  ! [remote rejected] master -> master (hook declined)
> error: failed to push some refs to
> 'ssh://git@git.mageia.org/software/build-system/draklive'

Hi Martin,

I have added you to the mga-packagers-committers group (and thus mga-shell_access as well, so you should now be able to push.

The gitolite configs reads:
repo software/build-system/draklive
   RW+ master$    = tmb
   RW+ distro/    = tmb
   RW+ topic/     = tmb
   RW+ refs/tags/ = tmb
   RW  master$    = @mga-packagers-committers
   RW  distro/    = @mga-packagers-committers
   RW+ topic/     = @mga-packagers-committers
   RW  refs/tags/ = @mga-packagers-committers
   RW  master$    = @mga-i18n-committers
   RW  distro/    = @mga-i18n-committers
   RW  topic/     = @mga-i18n-committers
   RW+ master$    = @mga-sysadmin
   RW+ distro/    = @mga-sysadmin
   RW+ topic/     = @mga-sysadmin
   RW+ refs/tags/ = @mga-sysadmin
   RW+ user/USER/ = @all
   R              = @all

It seems mga-packagers-committers is the default group owner for all "software" repositories, and we can not easily change it for a specific repository.
The mga-iso_makers group would have been the ideal owner for this repository, but well, no need to make things overly complicated.
Comment 19 Olivier Blin 2016-11-05 19:43:27 CET
(In reply to Martin Whitaker from comment #17)
> I'd need to be able to su to the draklive user to do that, wouldn't I?

This should be ok already:

[root@rabbit ~]# sudo -l -U martinw 
...
User martinw may run the following commands on rabbit:
    (bcd) SETENV: NOPASSWD: ALL
    (draklive) SETENV: NOPASSWD: ALL
Comment 20 Martin Whitaker 2016-11-06 09:24:54 CET
Thanks Olivier. But...

(In reply to Olivier Blin from comment #18)
> I have added you to the mga-packagers-committers group (and thus
> mga-shell_access as well, so you should now be able to push.

That's done. On rabbit I get:

$ groups
mga-users mga-packagers-committers mga-iso_makers

but I'm still getting the same error message when I attempt to push. If you want to test this, I've got a checkout of draklive in ~martinw on rabbit with my patches applied.


(In reply to Olivier Blin from comment #19)
> (In reply to Martin Whitaker from comment #17)
> > I'd need to be able to su to the draklive user to do that, wouldn't I?
> 
> This should be ok already:
> 
> [root@rabbit ~]# sudo -l -U martinw 
> ...
> User martinw may run the following commands on rabbit:
>     (bcd) SETENV: NOPASSWD: ALL
>     (draklive) SETENV: NOPASSWD: ALL

Turns out the problem is that draklive doesn't have the permission to do what I was trying to do:

$ sudo -l -U draklive
User draklive may run the following commands on rabbit:
    (root) NOPASSWD: /usr/sbin/draklive

So I can run the existing version of draklive, but not my patched version. I can work round this for now, particularly as /sbin/draklive has been hacked to fix one of the bugs.
Comment 21 Thierry Vignaud 2016-11-06 11:35:06 CET
For your push issue: You did git clone with ssh, not https, didn't you?

Keywords: (none) => NEEDINFO

Comment 22 Martin Whitaker 2016-11-06 11:53:03 CET
No, I cloned with git, but push with ssh (as per config in comment 6). This should work (it's equivalent to the instructions in https://wiki.mageia.org/en/How_to_use_Git), but just to be sure, I've just done a clean checkout using ssh, and get the same error on push.

Keywords: NEEDINFO => (none)

Comment 23 Olivier Blin 2016-11-06 12:01:28 CET
(In reply to Martin Whitaker from comment #20)

> but I'm still getting the same error message when I attempt to push. If you
> want to test this, I've got a checkout of draklive in ~martinw on rabbit
> with my patches applied.

I had to run this manually on the git server to update gitolite.conf:
su -c '/usr/bin/mgagit glrun' - git

Should be better now

> Turns out the problem is that draklive doesn't have the permission to do
> what I was trying to do:
> 
> $ sudo -l -U draklive
> User draklive may run the following commands on rabbit:
>     (root) NOPASSWD: /usr/sbin/draklive
> 
> So I can run the existing version of draklive, but not my patched version. I
> can work round this for now, particularly as /sbin/draklive has been hacked
> to fix one of the bugs.

I guess we can enlarge the permissions, even if that's basically giving root access.

Ideally, we should rewrite some draklive parts to use a wrapper for root commands like iurt, so that draklive can run as users and only specific parts require root.
This would help a bit.
Comment 24 Olivier Blin 2016-11-06 12:02:51 CET
(In reply to Olivier Blin from comment #23)

> I had to run this manually on the git server to update gitolite.conf:
> su -c '/usr/bin/mgagit glrun' - git

To give more details: groups are inlined in gitolite.conf
Comment 25 Martin Whitaker 2016-11-06 13:02:42 CET
(In reply to Olivier Blin from comment #23)
> I had to run this manually on the git server to update gitolite.conf:
> su -c '/usr/bin/mgagit glrun' - git
> 
> Should be better now

Thanks Olivier, that worked :-)


> I guess we can enlarge the permissions, even if that's basically giving root
> access.

Well, what we have now has a hole. I've held off my patch that mounted /dev in the chroot (to provide /dev/null) until we discuss this further.


> Ideally, we should rewrite some draklive parts to use a wrapper for root
> commands like iurt, so that draklive can run as users and only specific
> parts require root.
> This would help a bit.

Would be nicer, just to prevent accidents. I'll give this some thought once I've got the 5.1 ISOs built.
Comment 26 Martin Whitaker 2016-11-06 13:06:35 CET
Can close this one now. Thanks everyone.

Status: NEW => RESOLVED
Resolution: (none) => FIXED