[Rpm-maint] [rpm-software-management/rpm] Make user/group lookup caching thread-safe (PR #2843)

Michal Domonkos notifications at github.com
Thu Jan 18 17:22:55 UTC 2024


@dmnks commented on this pull request.



>  
     return 0;
 }
 
 const char * rpmugUname(uid_t uid)
 {
-    static uid_t lastUid = (uid_t) -1;
-    static char * lastUname = NULL;
-
-    if (uid == (uid_t) -1) {
-	lastUid = (uid_t) -1;

I wonder if this line shouldn't be kept? `rpmugFree()` won't reset `lastUid` to `-1` and it can be used before assignment.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2843#pullrequestreview-1830213798
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2843/review/1830213798 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240118/1617357d/attachment-0001.html>


More information about the Rpm-maint mailing list