#49195 %post enumerates groups many times, refers to undefined macros
Closed: wontfix Opened by firstyear.

Ticket was cloned from Red Hat Bugzilla (product Fedora): Bug 1391728

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.

Metadata Update from @firstyear:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1391728

Metadata Update from @firstyear:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1391728

Metadata Update from @firstyear:
- Issue assigned to firstyear

Fixed upstream/downstream

Metadata Update from @mreynolds:
- Custom field type adjusted to defect
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata Update from @vashirov:
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to None
- Issue set to the milestone: None (was: 0.0 NEEDS_TRIAGE)

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/2254

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: fixed)

Metadata