Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 688520 - net-nds/openldap-2.4.45: Incorrect warning about ldap database file ownership in init.d script
Summary: net-nds/openldap-2.4.45: Incorrect warning about ldap database file ownership...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LDAP Herd
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-23 00:12 UTC by Fred Stober
Modified: 2019-06-25 09:28 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fred Stober 2019-06-23 00:12:13 UTC
The init.d script of the package gives the following incorrect warning about files not belonging to the ldap user:

 * You have files in ... not owned by the ldap user, you must ensure they are accessible to the slapd instance!

The issue is caused by this line of the /etc/init.d/slapd script:

https://gitweb.gentoo.org/repo/gentoo.git/tree/net-nds/openldap/files/slapd-initd-2.4.40-r1?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d#n58

The check in this line should read: "if [ $? -eq 0 ]; then"

This is because the previous line reads:

/usr/bin/find $d ! -name DB_CONFIG ! -user ldap -o ! -group ldap |grep -sq .

The find command will give a list of offending files, which do not belong to the ldap user.
The subsequent grep command gives an exit status of 0 if a line is selected and 1 if no lines were selected.

So, in case some offending files exist, $? will be 0 and the error message should be displayed.
However if everything is fine, $? will be 1 and everything is fine.

Right now the warning about files with incorrect permission is only displayed when everything is correct - and is NOT shown when there are issues.