System is FreeBSD/i386, stable/10, r286362. This config is acceptable by nscd: threads 8 enable-cache passwd yes positive-time-to-live passwd 600 negative-time-to-live passwd 1 check-files passwd no enable-cache group yes positive-time-to-live group 3600 negative-time-to-live group 1 check-files group no This config is NOT acceptable by nscd: threads 8 enable-cache passwd yes positive-time-to-live passwd 600 negative-time-to-live passwd 0 check-files passwd no enable-cache group yes positive-time-to-live group 3600 negative-time-to-live group 0 check-files group no nscd simply dies with the latter configuration, although this gets logged: Aug 6 15:45:35 <kern.info> hostname kernel: pid 730 (nscd), uid 0: exited on signal 6 (core dumped)
Created attachment 167900 [details] patch for check nscd configuration value I make a patch for checking the value for nscd config. the patch check if the config value valid as follows when parse the /etc/nscd.conf,the condition value come from assert statement in various place from nscd code. positive-time-to-live > 0 negative-time-to-live > 0 negative-confidence-threshold > 0 suggested-size > 0 keep-hot-count >= 0 the patch against HEAD.
I've updated the patch and posted it for review: https://reviews.freebsd.org/D25627
A commit references this bug: Author: allanjude Date: Sat Jul 11 19:44:12 UTC 2020 New revision: 363109 URL: https://svnweb.freebsd.org/changeset/base/363109 Log: nscd: does not warn about invalid values what parsing config file PR: 202135 Submitted by: amutu@amutu.com Reported By: Trond.Endrestol@ximalas.info Reviewed by: markj, freqlabs MFC after: 4 weeks Sponsored by: Klara Inc. Event: July 2020 Bugathon Differential Revision: https://reviews.freebsd.org/D25627 Changes: head/usr.sbin/nscd/parser.c