Saturday, July 7, 2012

getent with LDAP on Solaris / openindiana

For the life of me, I don't know what the difference is here, but it seems as if having a profile makes a big difference to how LDAP works in Solaris /OpenIndiana

I was mucking about with things,  I had getent showing all of the LDAP users just fine - I'm not sure what I did exactly, but it stopped working.

My Config file looked something like this:

/var/ldap/ldap_client_file

NS_LDAP_FILE_VERSION= 2.0
NS_LDAP_SERVERS= 192.168.0.14:389
NS_LDAP_SEARCH_BASEDN= dc=***,dc=com
NS_LDAP_AUTH= simple
NS_LDAP_SERVICE_SEARCH_DESC= passwd: ou=people,dc=***,dc=com
NS_LDAP_SERVICE_SEARCH_DESC= group: ou=group,dc=***,dc=com
NS_LDAP_BIND_TIME= 10

and then I added two lines (one of which wasn't correct!)
NS_LDAP_FILE_VERSION= 2.0
NS_LDAP_SERVERS= 192.168.0.14:389
NS_LDAP_SEARCH_BASEDN= dc=***,dc=com
NS_LDAP_AUTH= simple
NS_LDAP_PROFILE= default
NSLDAP_SEARCH_REF= true
NS_LDAP_SERVICE_SEARCH_DESC= passwd: ou=people,dc=***,dc=com
NS_LDAP_SERVICE_SEARCH_DESC= group: ou=group,dc=***,dc=com
NS_LDAP_BIND_TIME= 10

Magically, ldapclient went to the ldap server and loaded a default profile from some testing I was doing a while ago, then the file looked like this:
#
# Do not edit this file manually; your changes will be lost.Please use ldapclient (1M) instead.
#
NS_LDAP_FILE_VERSION= 2.0
NS_LDAP_SERVERS= 192.168.0.14
NS_LDAP_SEARCH_BASEDN= dc=***,dc=com
NS_LDAP_AUTH= simple
NS_LDAP_PROFILE= default
NS_LDAP_SERVICE_SEARCH_DESC= passwd:ou=People,dc=kms,dc=com

and then getent was showing LDAP users again.
There isn't *that* much difference between the files. Could it be that merely having a profile in the ldap server makes a difference on Solaris?

Friday, June 29, 2012

problem with smbldap-grouplist & friends

I was trying to set up smbldap-tools on a solaris system and I was having some problems, I'm posting this fix in the hopes that it will help someone. I was getting an error about references strict in perl. In the smbldap-grouplist, they were passing a string that kinda looked like an array, but it was still a string. I changed the type to an array, and everything worked.

Hope this helps!

error
ARRAY ref while "strict refs" in use
and then the patch:



129,130c125
< my @attrs=['gidNumber','cn'];
<
---
> my $attrs="['gid','cn'";
132d126
<
136,137c130
<     push(@attrs, 'displayName');
<
---
>     $attrs  .=  ",'displayName'";
139d131
<
143c135
<     push(@attrs, 'sambaGroupType');
---
>     $attrs  .=  ",'sambaGroupType'";
145d136
<
149c140
<     push(@attrs, 'sambaSID');
---
>     $attrs  .=  ",'sambaSID'";
151c142
<
---
> $attrs.="]";
154d144
<
163a154
>
167c158
<                                  attrs => @attrs
---
>                                  attrs => "$attrs"
169d159
<