[Date Prev][Date Next] [Chronological] [Thread] [Top]

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,

OK, I think I get it now: you mean unreadable, not read-only, right?

> 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

I understand the message should be more focused on the most immediate
issue.  This may require some work in the internal API of these routines,
because the error is detected deep inside file opening, while the message
is reported by the tool wrapper.  But these are implementation issues.


Pierangelo Masarati

    SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497