I have a unix script which creates a temporary log file, say tempfl.log.
When this file is created it has permission rw-r--r--.
There is a line
chmod 0440 /etc/sudoers tempfl.log 2>&1
But when the script is done the permission changes to r--r--r-- but it should be rw-r--r--. If I change the line to
chmod 0644 /etc/sudoers tempfl.log
the permissions are right for tempfl.log but it throws errors saying
sudo: /usr/local/etc/sudoers is mode 0644, should be 0440
I do not understand what sudoers is doing and what is wrong.