浏览代码

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.
Nathan Kinder 16 年之前
父节点
当前提交
fe97a63dcd
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      ldap/servers/plugins/dna/dna.c

+ 2 - 1
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;
     nextval = setval + config_entry->interval;
     /* update nextval if we have not reached the end
     /* update nextval if we have not reached the end
      * of our current range */
      * 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 */
         /* try to set the new next value in the config entry */
         PR_snprintf(next_value, sizeof(next_value),"%" NSPRIu64, nextval);
         PR_snprintf(next_value, sizeof(next_value),"%" NSPRIu64, nextval);