Commit e8cbc7a0 authored by Leigh B Stoller's avatar Leigh B Stoller

Minor bug fix' check to see if target user is admin, not current user.

Also, when the target user is an admin, just add them to wheel and
mysql; they have a shell on boss anyway, so just go ahead and do the
whole thing.
parent afeebf33
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -349,13 +349,15 @@ foreach my $token (@userlist) {
}
#
# Add special admin group. Check to make sure that its not a dup
# since the above mechanism could cause a duplicate entry. No big
# deal to catch it.
# Add special admin group. Also add wheel and mysql cause once
# you become an admin and have a local shell, might as well just
# do this too. Watch for dups though, since the above mechanism
# could cause a duplicate entry. No big deal to catch it.
#
if (TBAdmin($uid)) {
if (! grep(/^${ADMINGRP}$/, @extragrouplist)) {
push(@extragrouplist, $ADMINGRP);
if ($user->admin()) {
foreach my $extragroup ($ADMINGRP, "wheel", "mysql") {
push(@extragrouplist, $extragroup)
if (! grep(/^${extragroup}$/, @extragrouplist));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment