Author: burn Date: Thu Aug 25 13:25:44 2016 New Revision: 1757682 URL: http://svn.apache.org/viewvc?rev=1757682&view=rev Log: UIMA-5075 Check that the current UID matches the UID that installed DUCC
Modified: uima/uima-ducc/trunk/src/main/admin/ducc_util.py Modified: uima/uima-ducc/trunk/src/main/admin/ducc_util.py URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/src/main/admin/ducc_util.py?rev=1757682&r1=1757681&r2=1757682&view=diff ============================================================================== --- uima/uima-ducc/trunk/src/main/admin/ducc_util.py (original) +++ uima/uima-ducc/trunk/src/main/admin/ducc_util.py Thu Aug 25 13:25:44 2016 @@ -493,6 +493,8 @@ class DuccUtil(DuccBase): return True # Exit if this is not the head node. Ignore the domain as uname sometimes drops it. + # Also check that ssh to this node works + # Also restrict operations to the userid that installed ducc def verify_head(self): head = self.ducc_properties.get("ducc.head").split('.')[0] local = self.localhost.split('.')[0] @@ -506,6 +508,12 @@ class DuccUtil(DuccBase): else: print ">>> ERROR - this script cannot ssh to head node" sys.exit(1); + # Ensure that root or another id doesn't start/stop ducc + dir_stat = os.stat(DUCC_HOME + '/resources/site.ducc.properties') + if dir_stat.st_uid != os.getuid(): + print ">>> ERROR - this script must be run by the userid that installed DUCC" + sys.exit(1); + # # Verify the viability of ducc_ling.