[Samba4] [Patch] Fixes and Improvements to samba3sam

Martin Kühl kuehl at univention.de
Thu Nov 16 12:01:43 GMT 2006


I've made a few improvements (I think) and modifications to the 
module while trying to link samba4 to an existing filled LDAP server 
with the
samba3 and samba4 schemas loaded.

Find attached the series of patches to samba3sam.c I generated from this 
the purpose of each summarized below:

- samba3sam-01-val_copy.patch:
  The `convert_uid_samaccount' function has the same purpose as 
  from entryUUID, so I reused the code.  This is an example of a 
function that
  might be added to a hypothetical `ldb_map_convenience' file so it can 
  reused in mapping modules.

- samba3sam-02-sid-dont-talloc.patch:
  Removes unnecessary allocing (which wasn't error checked either) from
  the encode_sid and decode_sid functions.

- samba3sam-03-passwd-convert.patch:
  Changes the mappings for the NT and LM password hash.  Experiments 
  that samba4 stored these as a sequence of 16 bytes while openldap 
  them as a string of 32 hex digits.  These functions might not be 
  efficient but should be straightforward to read.

- samba3sam-04-unixName-generate.patch:
  The current ldb_map doesn't support multiple mappings from a local 
name to
  different remote names; this patch changes the "unixName -> uid, 
  etc." mappings to a single generator that should work as intended.

- samba3sam-05-whitespace-cleanup.patch:
  The effect of M-x whitespace-cleanup RET: removes trailing whitespace 
  fixes mixed spaces and tabs in indentations.

- samba3sam-06-reorder-functions.patch:
  Reorders the mapping functions so we have parse-tree converters first, 
  converters next and generators last.  I found this order easier to 

- samba3sam-07-reorder-attributes.patch:
  Reorders the attributes so we have ignored ones first, then kept ones,
  and the rest roughly ordered by "topic" (passwords, posix info, 
  Further suggestions very welcome. :-)

- samba3sam-08-copyright.patch:
  Adds a copyright line for me.

The last four patches are concerned with the changes required to 
eliminate the
need for a fallback partition and might be less interesting for now.

- samba3sam-09-unixName-generate-keep.patch:
- samba3sam-10-groupType-generate.patch:
- samba3sam-11-objectSid-generate.patch:
  The unixName, groupType and objectSid attributes are required due to
  objectclass constraints for samba4 objects; these patches modify their
  mappings so they will be kept in the remote partition as-is.  The 
  conversion function in fact relies on this behaviour and just leaves 
  checking for the local attributes as-is as well.
  The parse-tree converter and `copy_element' function are again 
  convenience functions.

- samba3sam-12-dont-fallback.patch:
  Removes all ignored attributes from the attribute list and adds a 
  mapping instead.  Also changes the call to ldb_map_init so we don't 
  a fallback partition.  *Also* removes the objectClass mappings from 
the same
  call, as they lead to a number of additional problems I haven't found 
a nice
  (or, in fact, any) solution to yet.

Please review the ones you're interested in.


Martin Kühl		Entwicklung		 <kuehl at univention.de>
Univention GmbH		Linux for Your Business	 fon: +49 421 22 232-0
Mary-Somerville-Str. 1	28359 Bremen		 fax: +49 421 22 232-99
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba3sam-01-val_copy.patch
Type: text/x-diff
Size: 627 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061116/5760a96a/samba3sam-01-val_copy.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba3sam-04-unixName-generate.patch
Type: text/x-diff
Size: 6119 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061116/5760a96a/samba3sam-04-unixName-generate.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba3sam-03-passwd-convert.patch
Type: text/x-diff
Size: 2343 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061116/5760a96a/samba3sam-03-passwd-convert.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba3sam-05-whitespace-cleanup.patch
Type: text/x-diff
Size: 5072 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061116/5760a96a/samba3sam-05-whitespace-cleanup.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba3sam-02-sid-dont-talloc.patch
Type: text/x-diff
Size: 2020 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061116/5760a96a/samba3sam-02-sid-dont-talloc.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba3sam-06-reorder-functions.patch
Type: text/x-diff
Size: 10025 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061116/5760a96a/samba3sam-06-reorder-functions.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba3sam-07-reorder-attributes.patch
Type: text/x-diff
Size: 7373 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061116/5760a96a/samba3sam-07-reorder-attributes.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba3sam-08-copyright.patch
Type: text/x-diff
Size: 368 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061116/5760a96a/samba3sam-08-copyright.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba3sam-09-unixName-generate-keep.patch
Type: text/x-diff
Size: 1721 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061116/5760a96a/samba3sam-09-unixName-generate-keep.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba3sam-10-groupType-generate.patch
Type: text/x-diff
Size: 2059 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061116/5760a96a/samba3sam-10-groupType-generate.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba3sam-11-objectSid-generate.patch
Type: text/x-diff
Size: 2509 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061116/5760a96a/samba3sam-11-objectSid-generate.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba3sam-12-dont-fallback.patch
Type: text/x-diff
Size: 6803 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061116/5760a96a/samba3sam-12-dont-fallback.bin

More information about the samba-technical mailing list