mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-30 15:38:06 +01:00
5fe4681564
dbopen() to open an NIS map. Testing with very large maps (e.g. a sample password database with 31,000+ entries) has shown that ypserv will leak memory (ps shows RSS and VSZ growing to 4000 pages or more) when performing repeated yp_next()s or a yp_all(). The problem with yp_all() is not immediately obvious since the ypproc_all service is handled in a child process which exits once the transfer is finished, but with repeated yp_next()s (like what you get when you use getpwent() to scroll through the password database), the parent ypserv grows to enormous size and never shrinks again. It seems this is related to the HASHINFO parameters I used in yp_dblookup.c, which I actually stole from pwd_mkdb. Calling dbopen() with the default parameters (specifying openinfo as NULL) fixes the problem. I still need to see how this impacts the other NIS tools. I'm also considering changing from hash to btree databases: the hash database method doesn't support R_CURSOR, which means yp_next_record() has to do a lot of ugly work in order to reach an arbitrary location in the database. |
||
---|---|---|
.. | ||
Makefile | ||
Makefile.yp | ||
mknetid | ||
yp_access.c | ||
yp_dblookup.c | ||
yp_dnslookup.c | ||
yp_error.c | ||
yp_extern.h | ||
yp_main.c | ||
yp_server.c | ||
ypserv.8 |