[Samba4] ldb_map: mapped vs. fallback db
martin.kuehl at gmail.com
Thu Jun 15 13:15:21 GMT 2006
As promised, I've got a few questions about the ldb_map module, mainly
about it's two different databases...
When mapping an `add' request, the module tries to be smart about
objectClass handling of the mapped database: When an attribute should
be mapped, it is only added to the mapped message if this is valid
with that messages objectClasses. Otherwise the attribute is added to
the fallback message.
There is, however, no such handling of objectClass constraints for any
other requests, which, I think, could lead to a situation where
`modify' requests fail because the attribute they modify is supposed
to be mapped but was added to the fallback db instead.
For a solution, wouldn't it make sense to skip the smart objectClass
handling and just try to add all mapped attributes to the mapped db?
If there were problems with the defined mappings this request should
fail, giving an earlier indication of and possibly better error
message about the problem.
For most requests, the functions `map_find_attr_*' are used to find
*one* mapping for a given attribute, but for `add' and `modify'
requests, the available attribute maps are looped over and every
matching mapping is considered and applied.
My question here is whether this is necessary. Alternatively, users
could be expected to use MAP_GENERATE mappings to generate multiple
remote attributes from a single local one (the only case I could think
of this would be needed to handle).
In `modify' requests, when the fallback request fails it is turned
into an `add' request (around line 1270), but nothing like this is
done for the mapped request. As far as I understood Jelmer, records
aren't required to be present in the mapped database but in the
fallback database, so shouldn't this be the other way round?
More information about the samba-technical