diff options
Diffstat (limited to 'base/common/src/com/netscape/cmscore')
5 files changed, 16 insertions, 12 deletions
diff --git a/base/common/src/com/netscape/cmscore/apps/CMSEngine.java b/base/common/src/com/netscape/cmscore/apps/CMSEngine.java index 13a8bb6bf..84afb8474 100644 --- a/base/common/src/com/netscape/cmscore/apps/CMSEngine.java +++ b/base/common/src/com/netscape/cmscore/apps/CMSEngine.java @@ -657,12 +657,11 @@ public class CMSEngine implements ICMSEngine { try { /* if the file is not there, create one */ File f = new File(path); - if (!f.exists()) { - f.createNewFile(); - } - } catch (Exception e) { + f.createNewFile(); + } catch (IOException e) { + CMS.debug("Cannot create file: " + path + " ." + e.toString()); + throw new EBaseException("Cannot create file: " + path + " ." + e.toString()); } - return new FileConfigStore(path); } diff --git a/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java b/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java index 45807d6e9..1ec3c009a 100644 --- a/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java +++ b/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java @@ -173,7 +173,9 @@ public class ProfileSubsystem implements IProfileSubsystem { mConfig.removeSubStore(id); File file1 = new File(configPath); - file1.delete(); + if (!file1.delete()) { + CMS.debug("ProfileSubsystem: deleteProfile: Cannot delete the configuration file : " + configPath); + } mProfileIds.removeElement(id); mProfiles.remove(id); mProfileClassIds.remove(id); diff --git a/base/common/src/com/netscape/cmscore/realm/PKIJNDIRealm.java b/base/common/src/com/netscape/cmscore/realm/PKIJNDIRealm.java index 0576bcf58..86debf3da 100644 --- a/base/common/src/com/netscape/cmscore/realm/PKIJNDIRealm.java +++ b/base/common/src/com/netscape/cmscore/realm/PKIJNDIRealm.java @@ -423,13 +423,12 @@ public class PKIJNDIRealm extends JNDIRealm { String right = expBlock[1]; if (left != null) { - left.trim(); + left = left.trim(); } else { return allowed; } //Massage the right hand side of this expression to be a legal string value. if (right != null) { - right.trim(); right = right.replace("\"", ""); right = right.trim(); } else { diff --git a/base/common/src/com/netscape/cmscore/request/RequestRepository.java b/base/common/src/com/netscape/cmscore/request/RequestRepository.java index ed18c7048..31edc31b0 100644 --- a/base/common/src/com/netscape/cmscore/request/RequestRepository.java +++ b/base/common/src/com/netscape/cmscore/request/RequestRepository.java @@ -174,7 +174,7 @@ class RequestRepository } } - if (obj != null || (obj instanceof RepositoryRecord)) { + if (obj != null && (obj instanceof RepositoryRecord)) { record = (RepositoryRecord) obj; status = record.getPublishingStatus(); } else { diff --git a/base/common/src/com/netscape/cmscore/security/PWsdrCache.java b/base/common/src/com/netscape/cmscore/security/PWsdrCache.java index 810605d41..e9c7af8e5 100644 --- a/base/common/src/com/netscape/cmscore/security/PWsdrCache.java +++ b/base/common/src/com/netscape/cmscore/security/PWsdrCache.java @@ -382,7 +382,9 @@ public class PWsdrCache { if (tmpPWcache.exists()) { // it wasn't removed? - tmpPWcache.delete(); + if (!tmpPWcache.delete()) { + debug("Could not delete the existing " + mPWcachedb + ".tmp file."); + } tmpPWcache = new File(mPWcachedb + ".tmp"); } outstream = new FileOutputStream(mPWcachedb + ".tmp"); @@ -417,10 +419,12 @@ public class PWsdrCache { origFile.getCanonicalPath()); } catch (IOException e) { CMS.debug("Unable to change file permissions on " - + origFile.toString()); + + origFile.toString()); } } - tmpPWcache.delete(); + if (!tmpPWcache.delete()) { + debug("Could not delete the existing " + mPWcachedb + ".tmp file."); + } debug("operation completed for " + mPWcachedb); } } catch (Exception exx) { |