|
25 | 25 |
|
26 | 26 | /*
|
27 | 27 | * ===========================================================================
|
28 |
| - * (c) Copyright IBM Corp. 2022, 2024 All Rights Reserved |
| 28 | + * (c) Copyright IBM Corp. 2022, 2025 All Rights Reserved |
29 | 29 | * ===========================================================================
|
30 | 30 | */
|
31 | 31 |
|
@@ -347,14 +347,26 @@ public static String getAlgorithmProperty(String algName,
|
347 | 347 | */
|
348 | 348 | public static synchronized int insertProviderAt(Provider provider,
|
349 | 349 | int position) {
|
| 350 | + String providerName = provider.getName(); |
| 351 | + checkInsertProvider(providerName); |
| 352 | + ProviderList list = Providers.getFullProviderList(); |
350 | 353 |
|
351 | 354 | /*[IF CRIU_SUPPORT]*/
|
| 355 | + if (InternalCRIUSupport.enableCRIUSecProvider()) { |
| 356 | + for (Provider existingProvider : list.providers()) { |
| 357 | + if ("CRIUSEC".equals(existingProvider.getName())) { |
| 358 | + if (criuDebug) { |
| 359 | + System.out.println("Trying to insert + " + providerName |
| 360 | + + " during the pre-checkpoint which is not allowed."); |
| 361 | + } |
| 362 | + throw new RuntimeException("Inserting " + providerName |
| 363 | + + " during the pre-checkpoint is not allowed"); |
| 364 | + } |
| 365 | + } |
| 366 | + } |
352 | 367 | CRIUConfigurator.invalidateAlgorithmCache();
|
353 | 368 | /*[ENDIF] CRIU_SUPPORT */
|
354 | 369 |
|
355 |
| - String providerName = provider.getName(); |
356 |
| - checkInsertProvider(providerName); |
357 |
| - ProviderList list = Providers.getFullProviderList(); |
358 | 370 | ProviderList newList = ProviderList.insertAt(list, provider, position - 1);
|
359 | 371 | if (list == newList) {
|
360 | 372 | return -1;
|
|
0 commit comments