[Maintain-dev] PEAR_Auth: parse_ini_file and auth_ldap

Frederic Wenzel fred at osuosl.org
Fri May 19 15:00:57 PDT 2006


Hello PEAR_Auth developers and greetings from Corvallis, Oregon,

I am one of the developers on the Maintain project, an Open Source
DHCP/DNS management software. We use PEAR_Auth to authenticate the users
to our system, with different auth containers.

One of them is Auth_LDAP.

When upgrading Auth from 1.2.3 to 1.3 stable, I recently noticed a
behavior change in handling config options:

We used to be able to use a standard php .ini file to have people
configure their LDAP options. It was parsed with PHP's parse_ini_file()
and the result, an array, was put into the LDAP container directly.

This worked with 1.2.3 but not with 1.3 anymore.

Digging a little bit, I figured out that the Auth_LDAP container uses
triple = signs as well as is_int() checks to handle configuration
options. I.e. it does not only check the options by value but also by
data type.

Unfortunately, PHP's config file parsing takes place in strings only,
i.e. no matter if you write "1", 1, "true", true or similar,
parse_ini_file will always translate it into a string representation,
that would pass the == check, while failing the === one.


Was this an unintentional change to the auth code? If so, I could
provide a small patch to modify the respective parts of the ldap
container I found to cause the different behavior. That way, people
could keep using plain text ini config files in a simple manner.

If it was intentional instead, would you please let us know what
considerations led to the decision to write it that way? That would help
us adapt these considerations to our instance of the Pear_Auth
authentication framework.


Thank you very much
Frederic Wenzel

Maintain Developer
http://osuosl.org/projects/maintain/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3430 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.osuosl.org/pipermail/maintain-dev/attachments/20060519/5dc16ba4/smime.bin


More information about the Maintain-dev mailing list