Referencing Ldap-Group in unlang
Hi all, I would like to convert the following users file entry to unlang code in 2.0.4. DEFAULT Ldap-Group == "cn=not_student,ou=n,o=emu" Tunnel-Type = "VLAN", Tunnel-Medium-Type = "IEEE-802", Tunnel-Private-Group-Id = 6 But after reading the unlang man page and trying it several ways, I can't figure out how to duplicate this functionality. The above users file entry causes this in the debug output: rlm_ldap: Entering ldap_groupcmp() expand: o=emu -> o=emu expand: (|(&(objectClass=GroupOfNames)(member=%{control:Ldap-UserDn}))) -> (|(&(objectClass=GroupOfNames)(member=cn\3dalderfjh\2cou\3dis\2cou\3dn\2co\3demu))) rlm_ldap: ldap_get_conn: Checking Id: 0 rlm_ldap: ldap_get_conn: Got Id: 0 rlm_ldap: performing search in cn=not_student,ou=n,o=emu, with filter (|(&(objectClass=GroupOfNames)(member=cn\3dalderfjh\2cou\3dis\2cou\3dn\2co\3demu))) request done: ld 0x81a5118 msgid 29 rlm_ldap::ldap_groupcmp: User found in group cn=not_student,ou=n,o=emu But so far none of the syntax below has invoked ldap_groupcmp(). if ( Ldap-Group == "cn=not_student,ou=n,o=emu" ) { if ( control:Ldap-Group == "cn=not_student,ou=n,o=emu" ) { if ( "%{Ldap-Group}" == "cn=not_student,ou=n,o=emu" ) { if ( "%{ldap:Ldap-Group}" == "cn=not_student,ou=n,o=emu" ) { Jason
Jason Alderfer wrote:
I would like to convert the following users file entry to unlang code in 2.0.4.
DEFAULT Ldap-Group == "cn=not_student,ou=n,o=emu" Tunnel-Type = "VLAN", Tunnel-Medium-Type = "IEEE-802", Tunnel-Private-Group-Id = 6
But after reading the unlang man page and trying it several ways, I can't figure out how to duplicate this functionality.
Um... it doesn't really work well right now. I think that the patch shouldn't be hard, but I don't have time to do much right now. In the short term, stick with the "users" file. Sorry... Alan DeKok.
Jason Alderfer wrote:
I would like to convert the following users file entry to unlang code in 2.0.4.
DEFAULT Ldap-Group == "cn=not_student,ou=n,o=emu" Tunnel-Type = "VLAN", Tunnel-Medium-Type = "IEEE-802", Tunnel-Private-Group-Id = 6
But after reading the unlang man page and trying it several ways, I can't figure out how to duplicate this functionality.
Um... it doesn't really work well right now.
In the short term, stick with the "users" file. Sorry...
Alan DeKok.
Well, the example above is really just a test case. For the decision I actually need to make based on Ldap-Group unlang is so much better. So I made a hack which solves my problem but I don't think it will work for all compare functions. I attached it here in the event it may be of some use. It would be great if this ability could be worked in eventually. Jason
Jason Alderfer wrote:
Well, the example above is really just a test case. For the decision I actually need to make based on Ldap-Group unlang is so much better.
Well... yes.
So I made a hack which solves my problem but I don't think it will work for all compare functions. I attached it here in the event it may be of some use.
It would be great if this ability could be worked in eventually.
I've done it a different way, and committed it to CVS. Alan DeKok.
participants (2)
-
Alan DeKok -
Jason Alderfer