Bug 627543 - The Runas_Spec are ignored in sudoers file
Summary: The Runas_Spec are ignored in sudoers file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: sudo
Version: 5.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Daniel Kopeček
QA Contact: Aleš Mareček
URL:
Whiteboard:
Depends On:
Blocks: 810147
TreeView+ depends on / blocked
 
Reported: 2010-08-26 11:07 UTC by Vishal Gaikwad
Modified: 2018-11-14 18:50 UTC (History)
3 users (show)

Fixed In Version: sudo-1.7.2p1-11.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 810147 (view as bug list)
Environment:
Last Closed: 2012-02-21 03:21:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed patch (2.03 KB, patch)
2011-10-25 12:13 UTC, Daniel Kopeček
no flags Details | Diff
proposed patch (542 bytes, patch)
2011-10-26 09:00 UTC, Daniel Kopeček
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0309 0 normal SHIPPED_LIVE Low: sudo security and bug fix update 2012-02-21 07:25:01 UTC

Description Vishal Gaikwad 2010-08-26 11:07:20 UTC
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

Comment 2 RHEL Program Management 2011-05-31 15:31:25 UTC
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.

Comment 3 Daniel Kopeček 2011-10-25 12:13:31 UTC
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).

Comment 4 Daniel Kopeček 2011-10-26 09:00:30 UTC
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).

Comment 5 Daniel Kopeček 2011-10-26 11:28:35 UTC
Upstream fix:
http://www.sudo.ws/repos/sudo/rev/3ab0460a4dee

Comment 8 errata-xmlrpc 2012-02-21 03:21:31 UTC
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


Note You need to log in before you can comment on or make changes to this bug.