Bug 1391728 - %post enumerates groups many times, refers to undefined macros
Summary: %post enumerates groups many times, refers to undefined macros
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: 389-ds-base
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: mreynolds
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-03 20:46 UTC by Nalin Dahyabhai
Modified: 2020-09-13 21:58 UTC (History)
5 users (show)

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:
Clone Of:
Environment:
Last Closed: 2017-04-30 00:20:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 2254 0 None None None 2020-09-13 21:58:23 UTC

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.


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