Bug 1391728

Summary: %post enumerates groups many times, refers to undefined macros
Product: [Fedora] Fedora Reporter: Nalin Dahyabhai <nalin>
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: edewata, mreynolds, nhosoi, nkinder, rmeggins
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.5.17-2.f25 389-ds-base-1.3.5.17-3.fc25 389-ds-base-1.3.6.5-1.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-30 00:20:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Nalin Dahyabhai 2016-11-03 20:46:25 UTC
Description of problem:
The %post script checks if a UID is unused by running 'getent passwd', extracting the UID fields, and checking if a candidate UID is in the output list.  It does this for every candidate UID.  Then it does this for groups, but without isolating the GID field, so any entry which contains the candidate GID as a substring will cause that GID to appear to be used.  Our densely populated group list here is causing this loop for many more iterations than it should.

Version-Release number of selected component (if applicable):
389-ds-base-1.3.5.14-1.fc25

How reproducible:
Always

Steps to Reproduce:
1. Upgrade the package on a system with many groups, where 'getent group' is takes a non-trivial amount of time to run.

Actual results:
This %post has been running for three hours on my workstation.

Expected results:
Shorter execution time, by using awk to extract just the GID field, as is done for passwd entries, and possibly by only asking getent for one passwd or group entry at a time, or by caching the enumeration output and then examining that.

Additional info:
Suppressed output attempts to refer to "%dirsrv_uid" and "%dirsrv_gid", which are not defined macros, which will interact badly with the shell that's executing the script.

Comment 1 wibrown@redhat.com 2017-03-28 04:30:28 UTC
Upstream ticket:
https://pagure.io/389-ds-base/issue/49195

Comment 2 mreynolds 2017-04-24 13:33:29 UTC
Fixed upstream

Comment 3 Fedora Update System 2017-04-24 13:54:03 UTC
389-ds-base-1.3.5.17-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-8bb5a83e04

Comment 4 Fedora Update System 2017-04-25 03:54:07 UTC
389-ds-base-1.3.5.17-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-8bb5a83e04

Comment 5 Fedora Update System 2017-04-27 06:49:20 UTC
389-ds-base-1.3.5.17-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-a77e1b55ea

Comment 6 Fedora Update System 2017-04-27 15:26:33 UTC
389-ds-base-1.3.6.5-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-15e2a038b2

Comment 7 Fedora Update System 2017-04-27 19:54:09 UTC
389-ds-base-1.3.5.17-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2017-04-28 17:50:55 UTC
389-ds-base-1.3.6.5-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-15e2a038b2

Comment 9 Fedora Update System 2017-04-30 00:20:07 UTC
389-ds-base-1.3.6.5-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.