New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integer config attributes accept invalid values at server startup #1121
Comments
Comment from nhosoi (@nhosoi) at 2014-04-29 23:14:34 The input string "value" is converted to long integer by atol, which does not check the error, but returns 0 when the input is invalid. The set function then adjusts the size to the default size, and it returns SUCCESS. I think this is the right behaviour. Probably, we could log it in the error log, but I don't think we need to return an error there.
|
Comment from mreynolds (@mreynolds389) at 2014-07-15 22:23:17 There was schema mistake that set nsslapd-ndn-cache-max-size as a Directory String, and not an Integer. However, manually editing the dse.ldif file allows invalid values to be set. The following patch addresses this scenario. |
Comment from nhosoi (@nhosoi) at 2014-07-15 23:21:25 Not sure if we need this helper function: config_value_is_number(char *value)... Is this not enough for checking the validity?
And I haven't checked it, but there's no param which could take a negative value? |
Comment from mreynolds (@mreynolds389) at 2014-07-15 23:35:13 Replying to [comment:6 nhosoi]:
Some parameters take "-1" as a value for unlimited. So strtol() complains about negative values, as does my current fix. So I have some more work to do... |
Comment from mreynolds (@mreynolds389) at 2014-07-15 23:39:55 Replying to [comment:7 mreynolds389]:
Actually strtol() does accept negative numbers, reworking patch... |
Comment from mreynolds (@mreynolds389) at 2014-07-16 00:32:13 revision |
Comment from mreynolds (@mreynolds389) at 2014-07-16 00:33:21 New patch attached... |
Comment from nhosoi (@nhosoi) at 2014-07-16 00:39:47 Thanks, Mark!! |
Comment from mreynolds (@mreynolds389) at 2014-07-16 01:57:33 git merge config_test git push origin master commit d58a568 |
Comment from nhosoi (@nhosoi) at 2017-02-11 23:12:09 Metadata Update from @nhosoi:
|
Cloned from Pagure issue: https://pagure.io/389-ds-base/issue/47790
Description of problem:
nsslapd-ndn-cache-max-size accepts any invalid value.
Version-Release number of selected component (if applicable):
389-ds-base-1.3.1.6-25.el7.x86_64
How reproducible:
Always
Steps to Reproduce:
ldapmodify -h localhost -p 389 -D "cn=directory manager" -w ***** <<EOF
dn: cn=config
changetype: modify
replace: nsslapd-ndn-cache-max-size
nsslapd-ndn-cache-max-size: ~
EOF
systemctl restart dirsrv@dhcp201-149
Actual results:
DS does not give any error and operation is successful.
Expected results:
Error is expected.
The text was updated successfully, but these errors were encountered: