Bug 202135 - nscd does not accept a value of zero for negative-time-to-live for passwd nor group
Summary: nscd does not accept a value of zero for negative-time-to-live for passwd nor...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.2-STABLE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on: 181586
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-06 16:05 UTC by Trond.Endrestol
Modified: 2016-10-14 17:48 UTC (History)
3 users (show)

See Also:


Attachments
patch for check nscd configuration value (3.17 KB, patch)
2016-03-09 07:08 UTC, Jov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Trond.Endrestol 2015-08-06 16:05:47 UTC
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)
Comment 1 Jov 2016-03-09 07:08:22 UTC
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.