Bug 984970 - Overflow in nsslapd-disk-monitoring-threshold
Overflow in nsslapd-disk-monitoring-threshold
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: 389-ds-base (Show other bugs)
6.4
Unspecified Unspecified
urgent Severity high
: rc
: ---
Assigned To: mreynolds
Sankar Ramalingam
: ZStream
Depends On: 982325
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-16 09:49 EDT by Jan Kurik
Modified: 2013-08-05 06:24 EDT (History)
7 users (show)

See Also:
Fixed In Version: 389-ds-base-1.2.11.15-20.el6_4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-30 13:01:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Kurik 2013-07-16 09:49:57 EDT
This bug has been copied from bug #982325 and has been proposed
to be backported to 6.4 z-stream (EUS).
Comment 4 Ján Rusnačko 2013-07-22 04:43:21 EDT
Tested on newest version:

[jrusnack@dstet ~]$ rpm -qa | grep 389-
389-ds-base-libs-1.2.11.15-17.el6_4.x86_64
389-ds-base-debuginfo-1.2.11.15-17.el6_4.x86_64
389-ds-base-1.2.11.15-17.el6_4.x86_64
[jrusnack@dstet ~]$ ldapmodify -D "cn=directory manager" -w Secret123 <<EOF
dn: cn=config
changetype: modify
replace: nsslapd-disk-monitoring-threshold
nsslapd-disk-monitoring-threshold: 3000000000
EOF
modifying entry "cn=config"

[jrusnack@dstet ~]$ ldapsearch -D "cn=directory manager" -w Secret123 -b "cn=config" | grep nsslapd-disk-monitoring-threshold
nsslapd-disk-monitoring-threshold: -1294967296

[jrusnack@dstet ~]$ vim /var/log/dirsrv/slapd-dstet/errors
...
[22/Jul/2013:10:27:38 +0200] - Disk space is too low on disk (/), remaining space: 1174676 Kb
[22/Jul/2013:10:27:38 +0200] - Disk space on (/) is too far below the threshold(3000000000 bytes).  Waiting 1 minutes for disk space to be cleaned up before shutting slapd down...

So the threshold was set correctly and disk monitoring works, but ldapsearch shows negative value.

[jrusnack@dstet ~]$ ldapmodify -D "cn=directory manager" -w Secret123 <<EOF
dn: cn=config
changetype: modify
replace: nsslapd-disk-monitoring-threshold
nsslapd-disk-monitoring-threshold: 3000
EOF

modifying entry "cn=config"
ldap_modify: Operations error (1)
	additional info: nsslapd-disk-monitoring-threshold: "3000" is invalid, threshold must be greater than 4096 and less then 4294967295

So the maximum value seems to be 4294967295.

[jrusnack@dstet ~]$ ldapmodify -D "cn=directory manager" -w Secret123 <<EOF
dn: cn=config
changetype: modify
replace: nsslapd-disk-monitoring-threshold
nsslapd-disk-monitoring-threshold: 4294967295
EOF

modifying entry "cn=config"

[jrusnack@dstet ~]$ ldapsearch -D "cn=directory manager" -w Secret123 -b "cn=config" | grep nsslapd-disk-monitoring-threshold
nsslapd-disk-monitoring-threshold: -1
[jrusnack@dstet ~]$ cat /etc/dirsrv/slapd-dstet/dse.ldif | grep nsslapd-disk-monitoring-threshold
nsslapd-disk-monitoring-threshold: 4294967295
Comment 5 mreynolds 2013-07-22 10:35:58 EDT
The value is stored, and used correctly internally.  Using ldapsearch tries to cast the value to an integer(which of course overflows), that's why you see the negative number when using ldapsearch.  It's a simple fix, working on the respin...
Comment 7 Ján Rusnačko 2013-07-25 05:54:43 EDT
[jrusnack@dstet 6.0]$ ldapmodify -h localhost -p 19741 -D "cn=directory manager" -w Secret123 <<EOF
dn: cn=config
changetype: modify
replace: nsslapd-disk-monitoring-threshold
nsslapd-disk-monitoring-threshold: -2
EOF
modifying entry "cn=config"

[jrusnack@dstet 6.0]$ ldapsearch -h localhost -p 19741 -D "cn=directory manager" -w Secret123 -b "cn=config" -s base -LLL nsslapd-disk-monitoring-threshold
dn: cn=config
nsslapd-disk-monitoring-threshold: -2

[jrusnack@dstet 6.0]$ rpm -qa | grep 389
389-ds-base-debuginfo-1.2.11.15-18.el6_4.x86_64
389-ds-base-libs-1.2.11.15-18.el6_4.x86_64
389-ds-base-1.2.11.15-18.el6_4.x86_64

Negative values should be refused - see comment #3.

Another unrelated minor issue:

"Available disk space is now acceptable (0 bytes).  Aborting shutdown, and restoring the log settings."

The error message from log, that notifies about abort of shutdown, should probably contain information about free space, instead of '0 bytes'.
Comment 8 mreynolds 2013-07-25 10:20:15 EDT
(In reply to Ján Rusnačko from comment #7)
> [jrusnack@dstet 6.0]$ ldapmodify -h localhost -p 19741 -D "cn=directory
> manager" -w Secret123 <<EOF
> dn: cn=config
> changetype: modify
> replace: nsslapd-disk-monitoring-threshold
> nsslapd-disk-monitoring-threshold: -2
> EOF
> modifying entry "cn=config"
> 
> [jrusnack@dstet 6.0]$ ldapsearch -h localhost -p 19741 -D "cn=directory
> manager" -w Secret123 -b "cn=config" -s base -LLL
> nsslapd-disk-monitoring-threshold
> dn: cn=config
> nsslapd-disk-monitoring-threshold: -2
> 
> [jrusnack@dstet 6.0]$ rpm -qa | grep 389
> 389-ds-base-debuginfo-1.2.11.15-18.el6_4.x86_64
> 389-ds-base-libs-1.2.11.15-18.el6_4.x86_64
> 389-ds-base-1.2.11.15-18.el6_4.x86_64
> 
> Negative values should be refused - see comment #3.
> 
> Another unrelated minor issue:
> 
> "Available disk space is now acceptable (0 bytes).  Aborting shutdown, and
> restoring the log settings."
> 
> The error message from log, that notifies about abort of shutdown, should
> probably contain information about free space, instead of '0 bytes'.


Did you restart the server after making the config change?
Comment 9 Ján Rusnačko 2013-07-25 14:01:28 EDT
(In reply to mreynolds from comment #8)
> (In reply to Ján Rusnačko from comment #7)
> > [jrusnack@dstet 6.0]$ ldapmodify -h localhost -p 19741 -D "cn=directory
> > manager" -w Secret123 <<EOF
> > dn: cn=config
> > changetype: modify
> > replace: nsslapd-disk-monitoring-threshold
> > nsslapd-disk-monitoring-threshold: -2
> > EOF
> > modifying entry "cn=config"
> > 
> > [jrusnack@dstet 6.0]$ ldapsearch -h localhost -p 19741 -D "cn=directory
> > manager" -w Secret123 -b "cn=config" -s base -LLL
> > nsslapd-disk-monitoring-threshold
> > dn: cn=config
> > nsslapd-disk-monitoring-threshold: -2
> > 
> > [jrusnack@dstet 6.0]$ rpm -qa | grep 389
> > 389-ds-base-debuginfo-1.2.11.15-18.el6_4.x86_64
> > 389-ds-base-libs-1.2.11.15-18.el6_4.x86_64
> > 389-ds-base-1.2.11.15-18.el6_4.x86_64
> > 
> > Negative values should be refused - see comment #3.
> > 
> > Another unrelated minor issue:
> > 
> > "Available disk space is now acceptable (0 bytes).  Aborting shutdown, and
> > restoring the log settings."
> > 
> > The error message from log, that notifies about abort of shutdown, should
> > probably contain information about free space, instead of '0 bytes'.
> 
> 
> Did you restart the server after making the config change?
No. The three commands above were executed in sequence.
Comment 10 Ján Rusnačko 2013-07-29 10:20:08 EDT
Verified on 389-ds-base-1.2.11.15-20.el6_4.x86_64
Comment 12 errata-xmlrpc 2013-07-30 13:01:57 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-1119.html

Note You need to log in before you can comment on or make changes to this bug.