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
<