Repository: incubator-ranger
Updated Branches:
  refs/heads/master dbc489a7f -> b09694dea


RANGER-447: fix to write the keystore information in config if the file already 
exists


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

Branch: refs/heads/master
Commit: adbee0ebe75638a3c8a4b43626b63b55936b1b86
Parents: dd547b8
Author: sneethiraj <[email protected]>
Authored: Fri May 1 20:00:30 2015 -0400
Committer: sneethiraj <[email protected]>
Committed: Fri May 1 20:00:30 2015 -0400

----------------------------------------------------------------------
 unixauthservice/scripts/setup.py                | 29 ++++++++++++++++++--
 .../templates/ranger-ugsync-template.xml        | 12 ++++++++
 2 files changed, 38 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/adbee0eb/unixauthservice/scripts/setup.py
----------------------------------------------------------------------
diff --git a/unixauthservice/scripts/setup.py b/unixauthservice/scripts/setup.py
index f83d906..4a4e276 100755
--- a/unixauthservice/scripts/setup.py
+++ b/unixauthservice/scripts/setup.py
@@ -311,12 +311,12 @@ def main():
                mergeProps['ranger.usersync.keystore.password'] = 
defaultKSPassword
                createJavaKeystoreForSSL(ksFileName, defaultKSPassword)
 
-
+       if ('ranger.usersync.keystore.password' not in mergeProps):
+               mergeProps['ranger.usersync.keystore.password'] = 
defaultKSPassword
 
 
        fn = join(installTemplateDirName,templateFileName)
        outfn = join(confFolderName, outputFileName)
-       writeXMLUsingProperties(fn, mergeProps, outfn)
 
        if ( os.path.isdir(logFolderName) ):
                logStat = os.stat(logFolderName)
@@ -377,6 +377,29 @@ def main():
        
        os.chown(cryptPath,ownerId,groupId)
 
+       if ('ranger.usersync.policymgr.keystore' not in mergeProps):
+               mergeProps['ranger.usersync.policymgr.keystore'] = cryptPath
+
+       ugsyncCryptPath = mergeProps['ranger.usersync.policymgr.keystore']
+
+       if ('ranger.usersync.policymgr.username' not in mergeProps):
+               mergeProps['ranger.usersync.policymgr.username'] = 
'rangerusersync'
+       
+       if ('ranger.usersync.policymgr.alias' not in mergeProps):
+               mergeProps['ranger.usersync.policymgr.alias'] = 
'ranger.usersync.policymgr.password'
+       
+       if ('ranger.usersync.policymgr.password' not in mergeProps):
+               mergeProps['ranger.usersync.policymgr.password'] = 
'rangerusersync'
+
+       usersyncKSPath = mergeProps['ranger.usersync.policymgr.keystore']
+       pmgrAlias = mergeProps['ranger.usersync.policymgr.alias']
+       pmgrPasswd = mergeProps['ranger.usersync.policymgr.password']
+
+       updateProppertyInJCKSFile(usersyncKSPath,pmgrAlias,pmgrPasswd)
+       os.chown(ugsyncCryptPath,ownerId,groupId)
+
+       writeXMLUsingProperties(fn, mergeProps, outfn)
+
        fixPermList = [ ".", usersyncBaseDirName, confFolderName, 
certFolderName ]
 
        for dir in fixPermList:
@@ -394,7 +417,7 @@ def main():
 
        if isfile(nativeAuthProgramName):
                os.chown(nativeAuthProgramName, rootOwnerId, groupId)
-               os.chmod(nativeAuthProgramName, 04550)
+               os.chmod(nativeAuthProgramName, 04555)
        else:
                print "WARNING: Unix Authentication Program (%s) is not 
available for setting chmod(4550), chown(%s:%s) " % (nativeAuthProgramName, 
"root", groupName)
 

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/adbee0eb/unixauthservice/scripts/templates/ranger-ugsync-template.xml
----------------------------------------------------------------------
diff --git a/unixauthservice/scripts/templates/ranger-ugsync-template.xml 
b/unixauthservice/scripts/templates/ranger-ugsync-template.xml
index 15a04dc..fd19bca 100644
--- a/unixauthservice/scripts/templates/ranger-ugsync-template.xml
+++ b/unixauthservice/scripts/templates/ranger-ugsync-template.xml
@@ -165,4 +165,16 @@
                <name>ranger.usersync.truststore.file</name>
                <value></value>
        </property>
+       <property>
+               <name>ranger.usersync.policymgr.username</name>
+               <value></value>
+       </property>
+       <property>
+               <name>ranger.usersync.policymgr.alias</name>
+               <value></value>
+       </property>
+       <property>
+               <name>ranger.usersync.policymgr.keystore</name>
+               <value></value>
+       </property>
 </configuration>

Reply via email to