ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject [8/9] git commit: Argus-64
Date Fri, 19 Sep 2014 21:32:59 GMT
Argus-64

Project: http://git-wip-us.apache.org/repos/asf/incubator-argus/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-argus/commit/6d3618fc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/6d3618fc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/6d3618fc

Branch: refs/heads/master
Commit: 6d3618fcbc5fa1ff6f67388ce0bb1c2b9fda47e3
Parents: 3b7c712
Author: rmani <rmani@hortonworks.com>
Authored: Wed Sep 17 14:47:49 2014 -0700
Committer: rmani <rmani@hortonworks.com>
Committed: Fri Sep 19 14:29:53 2014 -0700

----------------------------------------------------------------------
 .../xasecure/pdp/config/PolicyRefresher.java    | 31 +++++++++++++++-----
 1 file changed, 24 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/6d3618fc/agents-impl/src/main/java/com/xasecure/pdp/config/PolicyRefresher.java
----------------------------------------------------------------------
diff --git a/agents-impl/src/main/java/com/xasecure/pdp/config/PolicyRefresher.java b/agents-impl/src/main/java/com/xasecure/pdp/config/PolicyRefresher.java
index c1db8ac..60b0074 100644
--- a/agents-impl/src/main/java/com/xasecure/pdp/config/PolicyRefresher.java
+++ b/agents-impl/src/main/java/com/xasecure/pdp/config/PolicyRefresher.java
@@ -1,14 +1,29 @@
-/**************************************************************************
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+ /**************************************************************************
  *                                                                        *
  * The information in this document is proprietary to XASecure Inc.,      *
  * It may not be used, reproduced or disclosed without the written        *
  * approval from the XASecure Inc.,                                       *
  *                                                                        *
  * PRIVILEGED AND CONFIDENTIAL XASECURE PROPRIETARY INFORMATION           *
- *                                                                        *
- * Copyright (c) 2013 XASecure, Inc.  All rights reserved.                *
- *                                                                        *
- *************************************************************************/
 
  /**
   *
@@ -155,7 +170,7 @@ public class PolicyRefresher  {
 	
 	
 	private void savePolicyToFile() {
-		if (!watcherDaemon.iscacheModfied()) {
+		if (watcherDaemon != null && !watcherDaemon.iscacheModfied()) {
 			// Do not Save the file if the policy is not modified.
 			return;
 		}
@@ -186,7 +201,7 @@ public class PolicyRefresher  {
 	
 	 private void savePolicyToCacheFile() {
 		 
-		 if (!watcherDaemon.iscacheModfied()) {
+		 if (watcherDaemon != null && !watcherDaemon.iscacheModfied()) {
 			    // Don't Save the file if the policy is not modified.
 				return;
 		  }
@@ -211,7 +226,9 @@ public class PolicyRefresher  {
 		    finally {
 		    	 //make the policy file cache to be 600 permission when it gets created and updated
 		    	 lastSaveFile.setReadable(false,false);
+		    	 lastSaveFile.setWritable(false,false);
 		    	 lastSaveFile.setReadable(true,true);
+		    	 lastSaveFile.setWritable(true,true);
 		    	 if (writer != null) {
 				 writer.close();
 		    	}


Mime
View raw message