Skip to content

Commit f1948b5

Browse files
committed
Fix nextRange for request
nextRange has to be stored in the new ranges_v2 entries when legacy2 is configured. Additionally, the serialDN and requestDN are not used to identify the entry for next range with legacy2.
1 parent 1749078 commit f1948b5

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

base/server/cmscore/src/com/netscape/cmscore/dbs/DBSubsystem.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ public class DBSubsystem implements IDBSubsystem {
106106
private static final String PROP_REQUEST_INCREMENT = "requestIncrement";
107107
private static final String PROP_REQUEST_BASEDN = "requestDN";
108108
private static final String PROP_REQUEST_RANGE_DN = "requestRangeDN";
109+
private static final String PROP_REQUEST_ID_GENERATOR = "request.id.generator";
109110

110111
private static final String PROP_MIN_REPLICA_NUMBER = "beginReplicaNumber";
111112
private static final String PROP_MAX_REPLICA_NUMBER = "endReplicaNumber";
@@ -497,8 +498,8 @@ public BigInteger getNextRange2(int repo, int radix) {
497498
try {
498499
Hashtable<String, String> h = mRepos[repo];
499500
conn = mLdapConnFactory.getConn();
500-
String dn = h.get(PROP_BASEDN) + "," + mBaseDN;
501501
String rangeDN = h.get(PROP_RANGE_DN) + "," + mBaseDN;
502+
String dn = rangeDN;
502503

503504
CMS.debug("DBSubsystem: retrieving " + dn);
504505
LDAPEntry entry = conn.read(dn);
@@ -711,6 +712,9 @@ public void init(ISubsystem owner, IConfigStore config)
711712
requests.put(PROP_INCREMENT, mDBConfig.getString(
712713
PROP_REQUEST_INCREMENT, PROP_INFINITE_REQUEST_NUMBER));
713714

715+
requests.put(PROP_GENERATOR, mDBConfig.getString(
716+
PROP_REQUEST_ID_GENERATOR, "legacy"));
717+
714718
mRepos[REQUESTS] = requests;
715719

716720
// populate replica ID hash entry

base/server/cmscore/src/com/netscape/cmscore/dbs/Repository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ public void checkRanges() throws EBaseException {
576576

577577
if ((numsAvail.compareTo(mLowWaterMarkNo) < 0) && (!CMS.isPreOpMode())) {
578578
CMS.debug("Repository: Requesting next range");
579-
if (idGenerator == IDGenerator.LEGACY_2 && mRadix == 16) {
579+
if (idGenerator == IDGenerator.LEGACY_2) {
580580
mNextMinSerialNo = mDB.getNextRange2(mRepo, mRadix);
581581
CMS.debug("Repository: next range: " + mNextMinSerialNo.toString(mRadix));
582582
} else {

base/server/python/pki/server/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,6 @@ def update_serial_number_range_generator(self, generator):
12091209
)
12101210

12111211
self.config.update({'dbs.serialRangeDN': 'ou=%s,ou=%s'%('certificateRepository', 'ranges_v2')})
1212-
self.config.update({'dbs.serialDN': 'ou=%s,ou=%s'%('certificateRepository', 'ranges_v2')})
12131212
con.close()
12141213

12151214
def update_request_number_range_generator(self, generator):
@@ -1259,7 +1258,6 @@ def update_request_number_range_generator(self, generator):
12591258
]
12601259
)
12611260
self.config.update({'dbs.requestRangeDN': 'ou=%s,ou=%s'%('requests', 'ranges_v2')})
1262-
self.config.update({'dbs.requestDN': 'ou=%s,ou=%s'%('requests', 'ranges_v2')})
12631261
con.close()
12641262

12651263
def create_ranges_entry(self, con, base_dn, new_ranges, range_object):

base/server/python/pki/server/deployment/scriptlets/configuration.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,6 @@ def spawn(self, deployer):
10621062
if subsystem.name == 'ca':
10631063
if deployer.mdict['pki_cert_id_generator'] == 'legacy2':
10641064
subsystem.config['dbs.cert.id.generator'] = 'legacy2'
1065-
subsystem.config['dbs.serialDN'] = 'ou=certificateRepository,ou=ranges_v2'
10661065
subsystem.config['dbs.serialRangeDN'] = 'ou=certificateRepository,ou=ranges_v2'
10671066
subsystem.config['dbs.cert.id.generator'] = 'legacy2'
10681067
subsystem.config['dbs.serialIncrement'] = '0x10000000'
@@ -1077,7 +1076,6 @@ def spawn(self, deployer):
10771076
subsystem.save()
10781077
if deployer.mdict['pki_request_id_generator'] == 'legacy2':
10791078
subsystem.config['dbs.request.id.generator'] = 'legacy2'
1080-
subsystem.config['dbs.requestDN'] = 'ou=requests,ou=ranges_v2'
10811079
subsystem.config['dbs.requestRangeDN'] = 'ou=requests,ou=ranges_v2'
10821080
subsystem.save()
10831081

0 commit comments

Comments
 (0)