svn commit: samba r21606 - in branches: SAMBA_3_0/source/lib SAMBA_3_0/source/libads SAMBA_3_0/source/nsswitch SAMBA_3_0/source/passdb SAMBA_3_0/source/printing SAMBA_3_0/source/utils SAMBA_3_0_25/source/lib SAMBA_3_0_25/source/libads SAMBA_3_0_25/source/nsswitch SAMBA_3_0_25/source/passdb SAMBA_3_0_25/source/printing SAMBA_3_0_25/source/utils

idra at samba.org idra at samba.org
Thu Mar 1 00:49:30 GMT 2007


Author: idra
Date: 2007-03-01 00:49:28 +0000 (Thu, 01 Mar 2007)
New Revision: 21606

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21606

Log:

Implement escaping function for ldap RDN values
Fix escaping of DN components and filters around the code
Add some notes to commandline help messages about how to pass DNs

revert jra's "concistency" commit to nsswitch/winbindd_ads.c, as it was
incorrect.
The 2 functions use DNs in different ways.

- lookup_usergroups_member() uses the DN in a search filter,
and must use the filter escaping function to escape it
Escaping filters that include escaped DNs ("\," becomes "\5c,") is the
correct way to do it (tested against W2k3).

- lookup_usergroups_memberof() instead uses the DN ultimately as a base dn.
Both functions do NOT need any DN escaping function as DNs can't be reliably
escaped when in a string form, intead each single RDN value must be escaped
separately.

DNs coming from other ldap calls (like ads_get_dn()), do not need escaping as
they come already escaped on the wire and passed as is by the ldap libraries

DN filtering has been tested.
For example now it is possible to do something like:
'net ads add user joe#5' as now the '#' character is correctly escaped when
building the DN, previously such a call failed with Invalid DN Syntax.

Simo.


Modified:
   branches/SAMBA_3_0/source/lib/ldap_escape.c
   branches/SAMBA_3_0/source/lib/smbldap_util.c
   branches/SAMBA_3_0/source/libads/ldap.c
   branches/SAMBA_3_0/source/libads/ldap_user.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c
   branches/SAMBA_3_0/source/passdb/pdb_ldap.c
   branches/SAMBA_3_0/source/printing/nt_printing.c
   branches/SAMBA_3_0/source/utils/net_ads.c
   branches/SAMBA_3_0/source/utils/net_ads_gpo.c
   branches/SAMBA_3_0_25/source/lib/ldap_escape.c
   branches/SAMBA_3_0_25/source/lib/smbldap_util.c
   branches/SAMBA_3_0_25/source/libads/ldap.c
   branches/SAMBA_3_0_25/source/libads/ldap_user.c
   branches/SAMBA_3_0_25/source/nsswitch/winbindd_ads.c
   branches/SAMBA_3_0_25/source/passdb/pdb_ldap.c
   branches/SAMBA_3_0_25/source/printing/nt_printing.c
   branches/SAMBA_3_0_25/source/utils/net_ads.c
   branches/SAMBA_3_0_25/source/utils/net_ads_gpo.c


Changeset:
Sorry, the patch is too large (1033 lines) to include; please use WebSVN to see it!
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21606


More information about the samba-cvs mailing list