Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-23256

Ambari-agent setting permission of .hash files in /var/lib/ambari-agent/cache to 666

    XMLWordPrintableJSON

    Details

      Description

      Ambari-agent is setting permission of some files in /var/lib/ambari-agent/cache folder to 666

      
      [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
      

      root cause : https://github.com/apache/ambari/blob/trunk/ambari-agent/src/main/python/ambari_agent/FileCache.py

      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)
      

      Need to change the permission to os.chmod(hash_file, 0o644)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                asnaik Akhil Naik
                Reporter:
                asnaik Akhil Naik
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m