RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1488724 - [WALA] WALA cannot set user sudoer permission during provisioning
Summary: [WALA] WALA cannot set user sudoer permission during provisioning
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: WALinuxAgent
Version: 7.5
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Vitaly Kuznetsov
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1491873 1491874 1562222 1571523
TreeView+ depends on / blocked
 
Reported: 2017-09-06 06:14 UTC by Yuxin Sun
Modified: 2019-02-26 20:57 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1503086 (view as bug list)
Environment:
Last Closed: 2018-01-09 10:22:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github Azure WALinuxAgent issues 868 0 None None None 2017-09-06 06:14:44 UTC

Description Yuxin Sun 2017-09-06 06:14:45 UTC
Description of problem: 

WALA cannot write sudoer string to /etc/sudoers.d/waagent during provisioning.
Version-Release number of selected component (if applicable): 
WALinuxAgent-2.2.15-upstream 

RHEL Version: 
RHEL-7.4

How reproducible: 
100%

Steps to Reproduce: 
1. Prepare a RHEL7.4 VM in Azure. Install WALA and enable it while booting
2. cat /etc/sudoers.d/waagent

Actual results: 
The /etc/sudoers.d/waagent file is empty

Expected results:
There should be azureuser ALL=(ALL) ALL in /etc/sudoers.d/waagent(if authenticate with password)

Additional info:
/usr/lib/python2.7/site-packages/azurelinuxagent/common/osutil/default.py Line#284:
fileutil.findstr_in_file(sudoers_wagent, sudoer) is None:
should be:
fileutil.findstr_in_file(sudoers_wagent, sudoer) is False:
Because the return value of fileutil.findstr_in_file() function is True of False, never be None.

Comment 3 Yuxin Sun 2017-09-15 05:39:43 UTC
This is a regression bug that seems caused by this fix:
https://github.com/Azure/WALinuxAgent/issues/791

Comment 6 Mohammed Gamal 2017-09-27 13:40:36 UTC
Fixed in WALA 2.2.18
https://github.com/Azure/WALinuxAgent/pull/894

Comment 7 Yuxin Sun 2017-09-28 03:15:15 UTC
Verified in WALA 2.2.18 upstream pre-release package. Will verify again in our WALA-2.2.18-1 rpm package.

Comment 8 Yuxin Sun 2017-10-17 10:38:12 UTC
Verified in WALinuxAgent-2.2.18-1.el7 in RHEL-7.4 ondemand image. 
Result: PASS


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