You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2023/02/20 21:11:22 UTC

[GitHub] [airflow] potiuk commented on a diff in pull request #29495: Change permissions of config/password files created by airflow

potiuk commented on code in PR #29495:
URL: https://github.com/apache/airflow/pull/29495#discussion_r1112320830


##########
airflow/configuration.py:
##########
@@ -1545,6 +1548,12 @@ def initialize_config() -> AirflowConfigParser:
     return local_conf
 
 
+def make_group_other_inaccessible(file_path: str):
+    with suppress(Exception):
+        permissions = os.stat(file_path)
+        os.chmod(file_path, permissions.st_mode & (stat.S_IRUSR | stat.S_IWUSR))

Review Comment:
   I'd say log an error, not to raise it. There might be various reasons why changing permissions is not possible - for example when the filesystem config file gets generated on happens to be NFS.  Failing hard in this case is kinda strange at this point as the file has already been generated (so next time if we run airflow it will succeed because the whole branch is skiped in this case.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org