Bug 1288471

Summary: /etc/httpd/alias/libnssckbi.so is a dangling relative symlink when /etc/httpd/alias is itself symlinked to some other directory
Product: Red Hat Enterprise Linux 7 Reporter: Jan Pazdziora (Red Hat) <jpazdziora>
Component: mod_nssAssignee: Matthew Harmsen <mharmsen>
Status: CLOSED ERRATA QA Contact: Kaleem <ksiddiqu>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: arubin, jpazdziora, nkinder, rcritten, spoore
Target Milestone: rc   
Target Release: 7.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mod_nss-1.0.14-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-03 21:19:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1283777    

Description Jan Pazdziora (Red Hat) 2015-12-04 10:55:25 UTC
Description of problem:

When /etc/httpd/alias is a symlink to /data/etc/httpd/alias, the relative symlink libnssckbi.so -> ../../..//usr/lib64/libnssckbi.so does not resolve to correct location.

If possible, please use absolute symlink target.

Version-Release number of selected component (if applicable):

mod_nss-1.0.11-6.el7.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. Install FreeIPA in a container where /etc/httpd/alias is a symlink to a directory on a data volume, /data/etc/httpd/alias.
2. ls -la /etc/httpd/alias/libnssckbi.so

Actual results:

Red dangling symlink.

Expected results:

Green non-dangling symlink.

Additional info:

Is that symlink needed at all? The FreeIPA installations in containers seem to be working fine in spite of the dangling symlink so maybe it could be removed altogether?

Comment 1 Rob Crittenden 2015-12-04 21:45:24 UTC
These are the root certs and I had problems in the past with NSS finding the shared library on its own which is why I made a symlink.

How/when is the /etc/httpd/alias symlink being created? What does this do to rpm -V?

Comment 2 Jan Pazdziora (Red Hat) 2015-12-05 09:05:33 UTC
(In reply to Rob Crittenden from comment #1)
> These are the root certs and I had problems in the past with NSS finding the
> shared library on its own which is why I made a symlink.

It was just an idea, that it might not be needed. So the question is -- could it be an absolute one?

> How/when is the /etc/httpd/alias symlink being created? What does this do to
> rpm -V?

It is created when we move the configuration/data of the IPA instance to data volume for containerization:

  https://github.com/adelton/docker-freeipa/blob/master/Dockerfile#L27

Comment 3 Rob Crittenden 2015-12-06 03:21:47 UTC
Can't a new link be generated at the same time a link is made for /etc/httpd/alias?

Comment 4 Jan Pazdziora (Red Hat) 2015-12-06 10:16:49 UTC
(In reply to Rob Crittenden from comment #1)
> These are the root certs and I had problems in the past with NSS finding the
> shared library on its own which is why I made a symlink.

By the way, is there a ticket/bugzilla for those issues? I'd be happy to test the latest versions to see if the problems are still present.

Comment 5 Jan Pazdziora (Red Hat) 2015-12-06 10:20:21 UTC
(In reply to Rob Crittenden from comment #3)
> Can't a new link be generated at the same time a link is made for
> /etc/httpd/alias?

You mean overwriting the link during the container build time? That certainly could be done but I've specifically tried to minimize changes that go to the containerized installation. My hope was to keep it as close to the "bare metal" setup as possible. Hence bugzillas like this one when I try to make the default installation easier for the containerized setup, while hopefully causing no regressions for the host installs.

Comment 6 Rob Crittenden 2015-12-07 13:43:01 UTC
The link is from /etc/httpd/alias to the library. If you're moving /etc/httpd/alias I'm not sure why the link isn't moving as well. But simply re-creating it doesn't seem like it would be a problem and in fact not creating it is a regression.

There is no ticket/bug as I've solved it by symlinking the shared library.

Comment 7 Jan Pazdziora (Red Hat) 2015-12-07 14:29:17 UTC
(In reply to Rob Crittenden from comment #6)
> The link is from /etc/httpd/alias to the library. If you're moving
> /etc/httpd/alias I'm not sure why the link isn't moving as well.

It is moving.

But if it is moving from /etc/httpd/alias/libnssckbi.so to /data/etc/httpd/alias/libnssckbi.so, then ../../.. not longer point to root (/) but to /data, and there's no /data/usr/lib64 there.

Comment 9 Scott Poore 2016-09-21 14:47:47 UTC
Verified.

Version ::

mod_nss-1.0.14-5.el7.x86_64

Results ::

First confirmed link on rhel7.2

[root@rhel7-0 alias]# ls -l /etc/httpd/alias/libnssckbi.so
lrwxrwxrwx. 1 root root 33 Sep 13 08:09 /etc/httpd/alias/libnssckbi.so -> ../../..//usr/lib64/libnssckbi.so

[root@rhel7-0 alias]# rpm -q mod_nss
mod_nss-1.0.11-6.el7.x86_64


Now verified state in rhel7.3:

[root@vm4 alias]# ls -l /etc/httpd/alias/libnssckbi.so 
lrwxrwxrwx. 1 root root 24 Sep 21 09:36 /etc/httpd/alias/libnssckbi.so -> /usr/lib64/libnssckbi.so

[root@vm4 alias]# rpm -q mod_nss
mod_nss-1.0.14-5.el7.x86_64

Comment 11 errata-xmlrpc 2016-11-03 21:19:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2602.html