Red Hat Bugzilla – Bug 627543
The Runas_Spec are ignored in sudoers file
Last modified: 2012-04-05 05:35:08 EDT
Description of problem:
Using the Runas_Alias rule vis visudo seems to ne ignored.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1) Create three user/group "a", "b", "c"
2) Run visudo command to add following lines:
User_Alias OK_GROUP = %a
Runas_Alias OK_RUNAS_GROUP = %b, %c
OK_GROUP ALL = (OK_RUNAS_GROUP) ALL
3) Run as user "a"
# sudo -g b ls /etc
Sorry, user a is not allowed to execute '/bin/ls /etc' as a:b on localhost.
$ sudo -g b ls /etc/
a2ps.cfg conman.conf firmware init.d ltrace.conf ntp rc0.d screenrc tftpd.rules
A workaround is to use the following rule in visudo:
%a ALL = (:b, c) ALL
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Created attachment 530072 [details]
The attached patch adds interpretation of USERGROUP entries in the _runaslist_matches(user_list, group_list) function. To fix the second issue, it changes the handling of a resolved alias in the group check loop (passes it as a group list, not as an user list).
Created attachment 530259 [details]
Stripped down patch. The case with %group syntax is not a bug (http://www.sudo.ws/pipermail/sudo-workers/2011-October/000699.html).
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.