#338 Dogtag 10: pkihelper.py directory.set_mode() does not resolve symlinks correctly
Closed: Fixed Opened by mharmsen.

During testing, it was discovered that occasionally, it is not possible to build certain PKI packages using the "compose" scripts.

Investigation found that once an instance has been created on the system used for building, several low-level jar files under "/usr/share/java/pki" had been improperly given "pkiuser:pkiuser" ownership and "00660" permissions. These "00660" permissions caused a user the inability to completely resolve required jar files which showed up as failures such as "PKI_NSUTIL-NOTFOUND" as returned by cmake's 'find_file' routine.

Deeper investigation found that the likely culprit appears to be the call to util.directory.set_mode(master[pki_tomcat_webapps_subsystem_path]) in the webapp_deployment.py scriptlet.

A simple test showed that top-level symlinks are identified as symbolic links, but symlinks which exist under a subdirectory are incorrectly identified as files, and thus the 'chown' and 'chmod' commands are applied to the symlink which in turn actually get applied to the target file instead.


Resolved on 'master':

commit d45052552e228dd46151b322ffc565b14f1fc6c3
Author: Matthew Harmsen <mharmsen@redhat.com>
Date:   Thu Sep 20 20:10:13 2012 -0700
    Correctly resolve symlinks in subdirectories
    * TRAC Ticket #338 - Dogtag 10: pkihelper.py directory.set_mode()
      does not resolve symlinks correctly
      This patch fixes the problem that although top-level symlinks
      are correctly identified as symbolic links, symlinks which
      exist under a subdirectory are incorrectly identified as files,
      and thus the 'chown' and 'chmod' commands are applied to the
      symlink which in turn actually get applied to the target file
      instead.

Metadata Update from @mharmsen:
- Issue assigned to mharmsen
- Issue set to the milestone: 10.0.0-0.X.a2

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/909

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Metadata