Bug 5978 - OpenBox should not enumerate all groups at startup
Status: ASSIGNED
Alias: None
Product: Openbox
Classification: Unclassified
Component: general
Version: unspecified
Hardware: PC Linux
: P3 normal
Assignee: Dana Jansens
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2013-06-26 11:52 EDT by astrand
Modified: 2023-03-20 01:32:36 EDT
2 users (show)

See Also:


Attachments
Replace getgrent with getgroups. (1.65 KB, patch)
2015-12-15 10:00 EST, Simon

Description astrand 2013-06-26 11:52:01 EDT
In function find_uid_gid, OB enumerates all groups on the system. This is very bad from a performance perspective, especially if you have many groups. It should use getgroups() or similar instead.
Comment 1 Simon 2015-12-15 10:00:32 EST
Created attachment 3550 [details]
Replace getgrent with getgroups.

Our university moved to user private groups some time ago. Openbox startup took several minutes to iterate through all groups. The proposed patch reduces the startup time down to a few seconds again.
Comment 2 Simon 2016-08-08 08:54:06 EDT
Hey Dana

Is there any chance this patch gets included in the next Openbox release? In institutions with large number of LDAP groups Openbox is not really usable right now...

Cheers
Simon
Comment 3 Mikachu 2023-03-20 01:32:36 EDT
I've added this patch (changed maininc to gboolean) in my git. Googling around a bit suggests this is mostly a bug in ldap but the patch seems reasonable either way.