[Date Prev][Date Next]
Re: slapadd shows wrong error message on non-readable ldif file (ITS#4044)
>>> This is still not an adequate message when the file is read-only and
>> slappadd cannot tell anything about its contents.
> I don't quite understand the "read-only" issue; what do you expect slapadd
> to do with both the configuration and the LDIF files, apart from reading
> them? And what would be the appropriate message if one passes garbage to
> the switch that's supposed to indicate a configuration file?
Just forget that I ever made the mistake of using the wrong flag to import
my ldif. Sorry if that shadows the other problem.
The issue is, it you have a slapd.conf which is not readable by the user
running slapadd, -f will still complain about an invalid file, where the
problem was that the file was read-only, whereas -l will correctly report
the permission problem, regardless of the file contents:
# cp /etc/openldap/slapd.conf /tmp/slapd.conf
# chmod 640 /tmp/slapd.conf
# sudo -u ldap slapadd -f /tmp/slapd.conf
slapadd: bad configuration file!
# sudo -u ldap slapadd -l /tmp/slapd.conf
/tmp/slapd.conf: Permission denied