Applied permissions to self._error_file (#15947)
Applied permissions to self._error_file (#15947)

* Applied permissions to self._error_file

Used os.chmod with 0o0777 umask to avoid Permission Denied errors when accessing the temporary error file.

* Changed os.chmod to os.chown

Instead of using os.chmod and applying permissions to the error file, we are setting the file owner according to the variable self.run_as_user. This would avoid setting hardcoded permissions for the log file while maintaining the correct permissions to the user responsible for the DAG to manipulate the log file.

Co-authored-by: Ash Berlin-Taylor <c98219fa5869fa00c16554b67c9fb7547acd11f2@firemirror.com>
mistercrunch/airflow,nathanielvarona/airflow,lyft/incubator-airflow,mistercrunch/airflow,apache/airflow,cfei18/incubator-airflow,bolkedebruin/airflow,apache/incubator-airflow,lyft/incubator-airflow,apache/airflow,bolkedebruin/airflow,apache/incubator-airflow,bolkedebruin/airflow,apache/airflow,Acehaidrey/incubator-airflow,nathanielvarona/airflow,Acehaidrey/incubator-airflow,nathanielvarona/airflow,danielvdende/incubator-airflow,bolkedebruin/airflow,cfei18/incubator-airflow,cfei18/incubator-airflow,Acehaidrey/incubator-airflow,Acehaidrey/incubator-airflow,apache/airflow,bolkedebruin/airflow,cfei18/incubator-airflow,danielvdende/incubator-airflow,danielvdende/incubator-airflow,cfei18/incubator-airflow,apache/airflow,lyft/incubator-airflow,danielvdende/incubator-airflow,Acehaidrey/incubator-airflow,nathanielvarona/airflow,lyft/incubator-airflow,nathanielvarona/airflow,apache/incubator-airflow,danielvdende/incubator-airflow,mistercrunch/airflow,apache/airflow,mistercrunch/airflow,nathanielvarona/airflow,Acehaidrey/incubator-airflow,apache/incubator-airflow,danielvdende/incubator-airflow,cfei18/incubator-airflow