Steven Dake wrote: > Without calling endpwent & friends, the calls that retrieve the password > entry will leak memory permanently on some platforms. >
That sounds like a bug in libc. And having seen a few libcs in my time I am unsurprised... > On Fri, 2009-01-23 at 14:05 +0000, Chrissie Caulfield wrote: >> Fabio M. Di Nitto wrote: >>> Hi, >>> >>> <warning>this looks like an heavy patch</warning> >>> >>> The only reason why main.c carries all this code and knowledge about >>> user/group id is to be able to drop privileges (that in the actual code >>> is still disabled anyway), and pass the group id to the IPC init system. >>> >>> So let's tidy up this a bit: >>> >>> - kill ais_uid and gid_valid globals. >>> - move the whole name->id for user and group in mainconfig.c. Those are >>> "helpers" that have 0 use outside global config operation. >>> - change struct main_config to carry the values we really need (int >>> instead of chars). >>> - modify aisexec_priv_drop to get the data from main_config instead of >>> globals and similar for cs_ipc_init call. >>> - drop unrequired includes from main.c >>> - add group/user name->id helpers here. >>> - clean the helper code a bit. >>> - change read_main_config to use helpers directly instead of munging >>> around stuff N times. >>> >>> Please apply or ACK. >>> >>> Fabio >>> >>> PS: this patch is on top of trunk. If 001_complete_logsys_conf.diff is >>> applied, there will probably be a rejected hunk in main.c (absolutely >>> trivial to rediff/fix) >> This isn't a NACK but there are a couple of comments I have. >> >> Firstly, the endpwent and endgrent calls are redundant (according to my >> interpretation of the man pages) as they are only needed with the >> getpwend and getgrent calls. Yes, I know they are in the original code >> and they *might* be there for a very good reason, but I thought I'd >> mention it. >> >> Secondly, I think the entries in mainconfig should be renamed uid & gid >> rather than left as user & group, to avoid confusion. >> >> >> Chrissie >> _______________________________________________ >> Openais mailing list >> Openais@lists.linux-foundation.org >> https://lists.linux-foundation.org/mailman/listinfo/openais > -- Chrissie _______________________________________________ Openais mailing list Openais@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/openais