ClusterLabs/pacemaker — pull request #25 by davidvossel (2012-02-16 19:03:47+00:00)
Title: Low: mcp: Fixes logfile ownership and permissions bug

When pacemaker launches, it attempts to take ownership of a logfile. When this occurs, pacemaker tries to determine whether or not it has permissions to modify ownership of the logfile before opening it. In doing this, pacemaker is trying to compare ownership of the file's directory with the CRM_DAEMON_USER rather than the actual user that is initially executing the pacemaker service. This results in situations where pacemaker thinks it doesn't have permissions to modify ownership of the logfile when in fact it does.

Rather than having pacemaker attempt to determine the permissions before trying to open the file, this patch removes that logic and always attempts to open the file. Ownership problems are now detected by the operating system. If the file can not be opened, fopen will fail. If we can't set ownership and permissions, fchmod and fchown will fail.