[
https://issues.apache.org/jira/browse/AMBARI-23256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Akhil Naik resolved AMBARI-23256.
---------------------------------
Fix Version/s: 2.70
trunk
Resolution: Fixed
> Ambari-agent setting permission of .hash files in /var/lib/ambari-agent/cache
> to 666
> ------------------------------------------------------------------------------------
>
> Key: AMBARI-23256
> URL: https://issues.apache.org/jira/browse/AMBARI-23256
> Project: Ambari
> Issue Type: Bug
> Components: ambari-agent
> Affects Versions: 2.6.1
> Environment: ambari-agent-2.6.1
> also applicable in lower versions
> Reporter: Akhil Naik
> Assignee: Akhil Naik
> Priority: Major
> Labels: ambari-agent, pull-request-available, python
> Fix For: trunk, 2.70
>
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> Ambari-agent is setting permission of some files in
> /var/lib/ambari-agent/cache folder to 666
> {code:java}
> [root@asnaik3 ambari-agent]# find cache -printf '%m %p\n' |grep 666
> 666 cache/custom_actions/.hash
> 666 cache/common-services/AMBARI_INFRA/0.1.0/package/.hash
> 666 cache/common-services/AMBARI_METRICS/0.1.0/package/.hash
> 666 cache/common-services/HDFS/2.1.0.2.0/package/.hash
> 666 cache/common-services/HIVE/0.12.0.2.0/package/.hash
> 666 cache/common-services/LOGSEARCH/0.5.0/package/.hash
> 666 cache/common-services/OOZIE/4.0.0.2.0/package/.hash
> 666 cache/common-services/PIG/0.12.0.2.0/package/.hash
> 666 cache/common-services/SLIDER/0.60.0.2.2/package/.hash
> 666 cache/common-services/SPARK/1.2.1/package/.hash
> 666 cache/common-services/SPARK2/2.0.0/package/.hash
> 666 cache/common-services/TEZ/0.4.0.2.1/package/.hash
> 666 cache/common-services/YARN/2.1.0.2.0/package/.hash
> 666 cache/common-services/ZOOKEEPER/3.4.5/package/.hash
> 666 cache/stacks/HDP/2.0.6/hooks/.hash
> 666 cache/host_scripts/.hash
> {code}
> root cause :
> https://github.com/apache/ambari/blob/trunk/ambari-agent/src/main/python/ambari_agent/FileCache.py
> {code:java}
> hash_file = os.path.join(directory, self.HASH_SUM_FILE)
> try:
> with open(hash_file, "w") as fh:
> fh.write(new_hash)
> os.chmod(hash_file, 0o666)
> {code}
> Need to change the permission to os.chmod(hash_file, 0o644)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)