Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 688520

Summary: net-nds/openldap-2.4.45: Incorrect warning about ldap database file ownership in init.d script
Product: Gentoo Linux Reporter: Fred Stober <gentoo>
Component: Current packagesAssignee: Gentoo LDAP project <ldap-bugs>
Status: UNCONFIRMED ---    
Severity: normal CC: ldap-bugs
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

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.