summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Kinder <nkinder@redhat.com>2009-07-02 08:49:52 -0700
committerNathan Kinder <nkinder@redhat.com>2009-07-02 08:49:52 -0700
commitfe97a63dcd53bedf7b06435f32630f419da1be79 (patch)
tree6eaa8edea68d2aea64efca0d093343b5a49e3a6a
parent281f14adb012a54d8b10c9d51dbce6f5c6f3e549 (diff)
downloadds-fe97a63dcd53bedf7b06435f32630f419da1be79.tar.gz
ds-fe97a63dcd53bedf7b06435f32630f419da1be79.tar.xz
ds-fe97a63dcd53bedf7b06435f32630f419da1be79.zip
Bug: 509401 - dnaNextValue not updated when dnaMaxValue set to -1
When "dnaMaxValue" is set to "-1" or omitted from a range configuration entry (which defautls to "-1" internally), the "dnaNextValue" attribute is not updated in the range configuration entry when a value is allocated from that range. We were only updating the configuration entry if the new nextvalue was >= the maxval plus the interval (1). We need to check if the maxval is -1 specifically, and update the config entry if so.
-rw-r--r--ldap/servers/plugins/dna/dna.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c
index dfd0619e..0f509c05 100644
--- a/ldap/servers/plugins/dna/dna.c
+++ b/ldap/servers/plugins/dna/dna.c
@@ -1972,7 +1972,8 @@ static int dna_get_next_value(struct configEntry *config_entry,
nextval = setval + config_entry->interval;
/* update nextval if we have not reached the end
* of our current range */
- if (nextval <= (config_entry->maxval + config_entry->interval)) {
+ if ((config_entry->maxval == -1) ||
+ (nextval <= (config_entry->maxval + config_entry->interval))) {
/* try to set the new next value in the config entry */
PR_snprintf(next_value, sizeof(next_value),"%" NSPRIu64, nextval);