Description of problem: Using the Runas_Alias rule vis visudo seems to ne ignored. Version-Release number of selected component (if applicable): sudo-1.7.2p1-5.el5 How reproducible: Always 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" Actual results: # sudo -g b ls /etc Sorry, user a is not allowed to execute '/bin/ls /etc' as a:b on localhost. Expected results: $ sudo -g b ls /etc/ a2ps.cfg conman.conf firmware init.d ltrace.conf ntp rc0.d screenrc tftpd.rules Additional info: 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] proposed patch 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] proposed patch Stripped down patch. The case with %group syntax is not a bug (http://www.sudo.ws/pipermail/sudo-workers/2011-October/000699.html).
Upstream fix: http://www.sudo.ws/repos/sudo/rev/3ab0460a4dee
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. http://rhn.redhat.com/errata/RHSA-2012-0309.html