I'm not clear on whether I'm allowed to ask "C" API questions here. If not, I apologize in advance and please disregard in that case. However, the question is more about configuration than coding.
I'm seeing that the ldap_init() function allows the hostname parameter to be null or a list of hosts. If it is null, the function attempts to determine the default ldap host.
How does it determine the default LDAP host when the hostname parameter is null? Does it load the list of hosts from the ldap.conf URI parameter? And/or does it use the LDAPURI environment variable?
Thanks,
On 03/30/16 10:19 -0400, Frank Crow wrote:
I'm not clear on whether I'm allowed to ask "C" API questions here. If not, I apologize in advance and please disregard in that case. However, the question is more about configuration than coding.
I'm seeing that the ldap_init() function allows the hostname parameter to be null or a list of hosts. If it is null, the function attempts to determine the default ldap host.
How does it determine the default LDAP host when the hostname parameter is null? Does it load the list of hosts from the ldap.conf URI parameter? And/or does it use the LDAPURI environment variable?
The order is detailed in the ldap.conf manpage, within the DESCRIPTION section.
I understand the order, which I have read in the man page that you have mentioned. What I'm not clear on, and what is not detailed in the respective man page, is whether or not ldap_init()/ldap_initailize() will use ldap.conf or the respective environment variables.
Thanks, Frank
On Wed, Mar 30, 2016 at 10:37 AM, Dan White dwhite@cafedemocracy.org wrote:
On 03/30/16 10:19 -0400, Frank Crow wrote:
I'm not clear on whether I'm allowed to ask "C" API questions here. If not, I apologize in advance and please disregard in that case. However, the question is more about configuration than coding.
I'm seeing that the ldap_init() function allows the hostname parameter to be null or a list of hosts. If it is null, the function attempts to determine the default ldap host.
How does it determine the default LDAP host when the hostname parameter is null? Does it load the list of hosts from the ldap.conf URI parameter? And/or does it use the LDAPURI environment variable?
The order is detailed in the ldap.conf manpage, within the DESCRIPTION section.
-- Dan White
Well, I'll have to retract the "apology in advance". LOL According the owner of the OpenLDAP-devel list, this question belongs here.
So, any help on the matter is appreciated. I'm currently digging through the OpenLDAP source code. If I figure it out, I'll post it.
Thanks, Frank
On Wed, Mar 30, 2016 at 10:41 AM, Frank Crow fjcrow2008@gmail.com wrote:
I understand the order, which I have read in the man page that you have mentioned. What I'm not clear on, and what is not detailed in the respective man page, is whether or not ldap_init()/ldap_initailize() will use ldap.conf or the respective environment variables.
Thanks, Frank
On Wed, Mar 30, 2016 at 10:37 AM, Dan White dwhite@cafedemocracy.org wrote:
On 03/30/16 10:19 -0400, Frank Crow wrote:
I'm not clear on whether I'm allowed to ask "C" API questions here. If not, I apologize in advance and please disregard in that case. However, the question is more about configuration than coding.
I'm seeing that the ldap_init() function allows the hostname parameter to be null or a list of hosts. If it is null, the function attempts to determine the default ldap host.
How does it determine the default LDAP host when the hostname parameter is null? Does it load the list of hosts from the ldap.conf URI parameter? And/or does it use the LDAPURI environment variable?
The order is detailed in the ldap.conf manpage, within the DESCRIPTION section.
-- Dan White
-- Frank
Well, I have answered some of the questions with a look at the OpenLDAP source code. Under the hood, the ldap_init() does:
ldap_set_option(ld, LDAP_OPT_HOST_NAME, defhost);
And the ldap_initailize() does:
ldap_set_option(ld, LDAP_OPT_URI, url);
The man page for ldap_set_option() clearly states that both of those settings take multiple host names. The former (albeit deprecated) takes a list separated by whitespace whereas the latter takes a "comma- or space-separated list of URIs".
However either case call determines the default host, I'm not yet sure. It may be that the ldap.conf file (or the environment variables) are only used by the ldap command line tools and not the underlying API itself.
Still looking... feel free to save me some time if you know! ;-)
-Frank
On Wed, Mar 30, 2016 at 2:09 PM, Frank Crow fjcrow2008@gmail.com wrote:
Well, I'll have to retract the "apology in advance". LOL According the owner of the OpenLDAP-devel list, this question belongs here.
So, any help on the matter is appreciated. I'm currently digging through the OpenLDAP source code. If I figure it out, I'll post it.
Thanks, Frank
On Wed, Mar 30, 2016 at 10:41 AM, Frank Crow fjcrow2008@gmail.com wrote:
I understand the order, which I have read in the man page that you have mentioned. What I'm not clear on, and what is not detailed in the respective man page, is whether or not ldap_init()/ldap_initailize() will use ldap.conf or the respective environment variables.
Thanks, Frank
On Wed, Mar 30, 2016 at 10:37 AM, Dan White dwhite@cafedemocracy.org wrote:
On 03/30/16 10:19 -0400, Frank Crow wrote:
I'm not clear on whether I'm allowed to ask "C" API questions here. If not, I apologize in advance and please disregard in that case. However, the question is more about configuration than coding.
I'm seeing that the ldap_init() function allows the hostname parameter to be null or a list of hosts. If it is null, the function attempts to determine the default ldap host.
How does it determine the default LDAP host when the hostname parameter is null? Does it load the list of hosts from the ldap.conf URI parameter? And/or does it use the LDAPURI environment variable?
The order is detailed in the ldap.conf manpage, within the DESCRIPTION section.
-- Dan White
-- Frank
-- Frank
Frank Crow wrote:
Well, I have answered some of the questions with a look at the OpenLDAP source code. Under the hood, the ldap_init() does:
ldap_set_option(ld, LDAP_OPT_HOST_NAME, defhost);
And the ldap_initailize() does:
ldap_set_option(ld, LDAP_OPT_URI, url);
The man page for ldap_set_option() clearly states that both of those settings take multiple host names. The former (albeit deprecated) takes a list separated by whitespace whereas the latter takes a "comma- or space-separated list of URIs".
However either case call determines the default host, I'm not yet sure. It may be that the ldap.conf file (or the environment variables) are only used by the ldap command line tools and not the underlying API itself.
The ldap.conf(5) man page is quite explicit already. "Environmental variables may also be used to augment the file based defaults."
Read more carefully.
Still looking... feel free to save me some time if you know! ;-)
-Frank
On Wed, Mar 30, 2016 at 2:09 PM, Frank Crow <fjcrow2008@gmail.com mailto:fjcrow2008@gmail.com> wrote:
Well, I'll have to retract the "apology in advance". LOL According the owner of the OpenLDAP-devel list, this question belongs here. So, any help on the matter is appreciated. I'm currently digging through the OpenLDAP source code. If I figure it out, I'll post it. Thanks, Frank On Wed, Mar 30, 2016 at 10:41 AM, Frank Crow <fjcrow2008@gmail.com <mailto:fjcrow2008@gmail.com>> wrote: I understand the order, which I have read in the man page that you have mentioned. What I'm not clear on, and what is not detailed in the respective man page, is whether or not ldap_init()/ldap_initailize() will use ldap.conf or the respective environment variables. Thanks, Frank On Wed, Mar 30, 2016 at 10:37 AM, Dan White <dwhite@cafedemocracy.org <mailto:dwhite@cafedemocracy.org>> wrote: On 03/30/16 10:19 -0400, Frank Crow wrote: I'm not clear on whether I'm allowed to ask "C" API questions here. If not, I apologize in advance and please disregard in that case. However, the question is more about configuration than coding. I'm seeing that the ldap_init() function allows the hostname parameter to be null or a list of hosts. If it is null, the function attempts to determine the default ldap host. How does it determine the default LDAP host when the hostname parameter is null? Does it load the list of hosts from the ldap.conf URI parameter? And/or does it use the LDAPURI environment variable? The order is detailed in the ldap.conf manpage, within the DESCRIPTION section. -- Dan White -- Frank -- Frank
-- Frank
On Thu, 31 Mar 2016, Howard Chu wrote:
Frank Crow wrote:
...
However either case call determines the default host, I'm not yet sure. It may be that the ldap.conf file (or the environment variables) are only used by the ldap command line tools and not the underlying API itself.
The ldap.conf(5) man page is quite explicit already. "Environmental variables may also be used to augment the file based defaults."
I believe his concern is the lack of reference in the ldap_init(3) documentation to ldap.conf(5) or any statement that the settings described there affect the ldap_init() behavior. ldap(3) has a SEE ALSO for ldap.conf(5), but no prose mention that would explain why you would look there or when it would be applicable. <shurg>
Frank, source-wise: ldap_init()->ldap_create()->ldap_int_initialize() where the bits described in ldap.conf(5) are implemented.
Philip Guenther
Thank you Phillip because, I have pored over the man pages in depth and have seen the words which Howard has pointed out. What I have not seen... not one word anywhere... that says "and these default apply to the 'C' library calls". I fully well understand that the environment variables are used to augment the file-based values. I have scripts that take advantage of that actual capability. Have had them for a while. That is not what I've been asking here.
It's not a big deal and I have followed the source code through those sections that you've mentioned. I did finally get that. It's actually a very nice feature and should be made clear in the man pages for the 'C' library calls whenever it is practical for someone to do so.
Actually, looking at the source code is a great learning experience. I encourage it. I understand the library much better now than I did just a couple weeks ago. Still much to learn though. My next learning (by looking at examples) will be how to actually use SASL EXTERNAL in "C". There is a good bit of info in the man pages but not comprehensive. I'm looking at ldapwhoami and the common.c (etc) code. Lots of good stuff there.
Thanks, Frank
On Thu, Mar 31, 2016 at 1:08 PM, Philip Guenther pguenther@proofpoint.com wrote:
On Thu, 31 Mar 2016, Howard Chu wrote:
Frank Crow wrote:
...
However either case call determines the default host, I'm not yet sure. It may be that the ldap.conf file (or the environment variables) are only used by the ldap command line tools and not the underlying API itself.
The ldap.conf(5) man page is quite explicit already. "Environmental variables may also be used to augment the file based defaults."
I believe his concern is the lack of reference in the ldap_init(3) documentation to ldap.conf(5) or any statement that the settings described there affect the ldap_init() behavior. ldap(3) has a SEE ALSO for ldap.conf(5), but no prose mention that would explain why you would look there or when it would be applicable. <shurg>
Frank, source-wise: ldap_init()->ldap_create()->ldap_int_initialize() where the bits described in ldap.conf(5) are implemented.
Philip Guenther
openldap-technical@openldap.org