Bug 1624514
Summary: | pgrep/pkill fail with large uids | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | todd_lewis | ||||||
Component: | procps-ng | Assignee: | Jan Rybar <jrybar> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Karel Volný <kvolny> | ||||||
Severity: | unspecified | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | 7.7-Alt | CC: | kvolny, todd_lewis | ||||||
Target Milestone: | rc | ||||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | procps-ng-3.3.10-28.el7 | Doc Type: | If docs needed, set a value | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | |||||||||
: | 1827731 (view as bug list) | Environment: | |||||||
Last Closed: | 2020-09-29 20:36:50 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: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 1827731, 2119083 | ||||||||
Attachments: |
|
Description
todd_lewis
2018-08-31 21:18:01 UTC
Hello, thank you for your report and your interest in functionality of pgrep/pkill. Can I ask for information about any specific use-case of creating a user with UID > 2^31, in which pgrep/pkill is required? Thank you and have nice and prosperous new week. (In reply to Jan Rybar from comment #2) > Hello, > thank you for your report and your interest in functionality of pgrep/pkill. > Can I ask for information about any specific use-case of creating a user > with UID > 2^31, in which pgrep/pkill is required? > Thank you and have nice and prosperous new week. You can. We are in the process of automating with Ansible the installation and configuration of a large suite of SAS products for consistency across new dev, test, support, and production environments, on the order of ~70 bare metal hosts. These will replace existing older environments on aging hardware. This involves the creation of around a half dozen userids on the systems, instances of which already exist on the older systems. We elected to retain the existing username to numeric id mapping. At least one of these userids (the one that cost us over a day of work because of this problem) has had the numeric uid of 3333333333 since long before my group became involved with the project. Note that except for pgrep/pkill, that admittedly crazy id number has not caused a problem in either the older RHEL6 or new RHEL7 systems. I'm not advocating for huge uid numbers, but since they clearly do work otherwise, it seems pgrep and pkill -- which do the Right Thing when given the numbers directly -- ought to work when given the name. Instead they fail silently when converting the name to the number. Created attachment 1480773 [details]
Fixes uname to long uid conversion
The attached patch preserves the high bit of the unsigned numeric uid as returned from getpwnam(). From my limited testing, this fixed the reported problem.
Created attachment 1480807 [details]
Fix same problem with gids as well as uids
Turns out the same problem exists with long (>2^31) gids. This patch fixes both.
Hello Todd, Thank you for your patch proposals. I tried to investigate why el.num is 'long', which causes many implicit casts, anyways and it seems I'll have to ask authors themselves about its reason. Meanwhile I'll test these integer casts, but I guess it will be included in rhel-7.7 at earliest. Thank you very much. Have a nice day. Any movement on this? It's been over three months, and we've got * clear data lost due to bad cast (works with numeric id, fails w/ symbolic) * paying customers having to do silly work-arounds * the most dead simple fix a C program can have, and * working patch in hand What can I do from this end to facilitate pushing this forward? Thanks. Hello Todd, I can assure you that I keep monitoring this bug. I noticed that you filed a merge request at the upstream on Gitlab. As you can see, the activities at upstream side have cooled down lately. It is advised to implement the fix within RHEL after it's featured on upstream side. The closest release of RHEL containing the patch is RHEL-7.7. Thank you for your patience. I wish you happy New Year. 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 (procps-ng bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:4017 |