1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00
Commit Graph

346 Commits

Author SHA1 Message Date
Kamen Mazdrashki
0aeb08e2eb s4-attid: Uppercase ATTID type constants
Thanks Metze for noting this!

Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Mon Nov  8 23:06:41 UTC 2010 on sn-devel-104
2010-11-08 23:06:41 +00:00
Andrew Tridgell
18085b1236 s4-dsdb: give the DN on a shema attribute failure 2010-11-07 22:50:05 +00:00
Kamen Mazdrashki
a2d787d95d s4-dsdb_schema: Use DRSUAPI_ATTID_INVALID instead of 0xFFFFFFFF magic value
Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Mon Nov  1 00:36:20 UTC 2010 on sn-devel-104
2010-11-01 00:36:20 +00:00
Kamen Mazdrashki
717b1158a6 idl: Use DRSUAPI_ATTID_ prefix instead of DRSUAPI_ATTRIBUTE_ for ATTID values
Those values are actually ATTID values and such, they are used
for ATTIDs for Attributes, Classes and Syntaxes.
2010-10-31 23:54:04 +00:00
Kamen Mazdrashki
6b188fbad4 s4-schema_init: we should be able to resolve Syntax OIDs with prefixMap we have
If Syntax OID is not in the prefixMap then we are getting
an unknown Attribute Syntax (which we can't handle anyway)
2010-10-29 02:31:17 +03:00
Kamen Mazdrashki
e5ebc48697 s4-dsdb_syntax: *_OID_oid_ldb_to_drsuapi() functions should use
dsdb_schema_pfm_attid_from_oid() instead of
dsdb_schema_pfm_make_attid() as those functions are
supposed to return ATTIDs only for OIDs we already know about
(i.e. are in prefixMap)

Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Tue Oct 26 22:44:36 UTC 2010 on sn-devel-104
2010-10-26 22:44:36 +00:00
Kamen Mazdrashki
0fc2427224 s4-prefixMap: split dsdb_schema_make_attid() function into read-only and
read-write functions.
dsdb_schema_make_attid() may change prefixMap implicitly
and this is not always desired behavior.
The problem was that
(1) callers had no control on this behavior
(2) callers had no way to know wheter prefixMap has been
    changed which can lead to hard to find bugs like
    prefixMap is changed in read operation
2010-10-26 22:17:41 +03:00
Kamen Mazdrashki
5e108fc5f9 s4-prefixmap: Use WERR_NOT_FOUND when OID is not found in current prefixMap
rather than WERR_DS_NO_MSDS_INTID.
WERR_DS_NO_MSDS_INTID is intended to be used for msDsIntId
attribute values handling
2010-10-26 22:17:40 +03:00
Kamen Mazdrashki
d46ca0eb80 s4-dsdb_syntax: Setup "String(Case Sensitive)" syntax
Currently it is mapped to Octet String LDAP syntax
for comparison purposes.

According to LDAP rfc we should be using same comparison
as Directory String (LDB_SYNTAX_DIRECTORY_STRING), but case sensitive.
But according to ms docs binary compare should do the job:
http://msdn.microsoft.com/en-us/library/cc223200(v=PROT.10).aspx

Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Fri Oct 22 22:19:50 UTC 2010 on sn-devel-104
2010-10-22 22:19:50 +00:00
Kamen Mazdrashki
2a001381e8 s4-dsdb/schema_syntax: Separate validation for numericoid OID values
This implementation doesn't use prefixMap/Schema to validate
numericoid OIDs. We may not have this OID yet, so I see no point
checking schema for if we have it.

Side effect of using prefixMap/Schema for validating numericoids
is that we mistakenly add the OID to the prefixMap.
This led to a corrupted prefixMap in LDB.

Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Thu Oct 21 23:32:26 UTC 2010 on sn-devel-104
2010-10-21 23:32:26 +00:00
Andrew Tridgell
47591ea5ec s4-dsdb: moved a bunch of fuctions from schema/schema_info_attr.c to samdb/ldb_modules/schema_util.c
these functions operate on ldb_modules, so they should be in the
ldb_modules directory. They also should return ldb errors codes, not
WERROR codes, as otherwise the error can be hidden from the ldap
caller

This re-arrangement fixes a dependency loop in the schema/samdb code.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Kamen Mazdrashki <kamenim@samba.org>
2010-10-21 19:03:25 +11:00
Kamen Mazdrashki
71ac92b673 s4-schema_init: Print more info about syntax we fail to recognize
Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Wed Oct 20 13:54:01 UTC 2010 on sn-devel-104
2010-10-20 13:54:01 +00:00
Matthias Dieter Wallnöfer
a6d70ddf86 s4:dsdb/schema/schema_init.c - remove a duplicated "talloc_free" 2010-10-19 10:11:03 +00:00
Matthias Dieter Wallnöfer
a0e9814c0d s4:dsdb - remove "samdb_result_uint", "samdb_result_int64", "samdb_result_uint64" and "samdb_result_string"
We have ldb_msg_find_attr_as_* calls which do exactly the same. Therefore this
reduces only code redundancies.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-10-15 08:36:01 +11:00
Jelmer Vernooij
1229935aa9 torture/becomedc: Add test for global schema, use samdb_connect().
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Tue Oct 12 18:35:33 UTC 2010 on sn-devel-104
2010-10-12 18:35:33 +00:00
Jelmer Vernooij
3b19993561 dsdb/schema: Move some dsdb_dn functions that are schema-specific. 2010-10-11 01:06:35 +02:00
Kamen Mazdrashki
81e5e23683 s4-dsdb: Make dsdb_setup_sorted_accessors() public
We are going to need it while converting DRS schema.
2010-10-10 12:58:32 +03:00
Kamen Mazdrashki
f06d98764a s4-dsdb-schema_prefixmap: return WERR_DS_NO_ATTRIBUTE_OR_VALUE when ATTID is not found
rather than WERR_INTERNAL_ERROR - it is not internal error!
2010-09-21 00:15:24 +03:00
Kamen Mazdrashki
395b09c1b6 s4-dsdb-schema_prefixmap: Print debug message when internal failure occurs 2010-09-21 00:15:24 +03:00
Kamen Mazdrashki
9256b5f226 s4-schema: Helper func to compare schemaInfo signitures 2010-09-17 13:53:03 +03:00
Kamen Mazdrashki
1295da92f9 s4-schema: use dsdb_schema_info_blob_is_valid() to verify schemaInfo blob
instead of parsing it.
2010-09-17 13:53:03 +03:00
Kamen Mazdrashki
aedefd3e99 s4-prefixMap: use dsdb_schema_info_blob_is_valid() for schemaInfo blob validation
This fixes a leaking dsdb_schema_info object also.
2010-09-17 13:53:03 +03:00
Kamen Mazdrashki
e691b1fd27 s4-dsdb: Add dsdb_schema_info_blob_is_valid() to verify schemaInfo blobls 2010-09-17 13:53:03 +03:00
Matthias Dieter Wallnöfer
a4b7fac86d s4:cosmetic - the SID attribute is called objectSid - not objectSID 2010-09-13 22:39:50 +02:00
Kamen Mazdrashki
89899f55dc s4-drs: ATTIDs for deleted attributes should be based on msDs-IntId value if it exists 2010-08-19 03:34:05 +03:00
Kamen Mazdrashki
695072478d s4-dsdb: No need for dsdb_syntax_one_DN_drsuapi_to_ldb() to be public
It is intended to be used in schema_syntax.c module
2010-08-19 03:34:04 +03:00
Kamen Mazdrashki
35d886db17 s4-dsdb-syntax: ATTID should be msDs-IntId value for the attributeSchema object
in case object replicated is not in Schema NC and attributeSchema
object has msDs-IntId attribute value set
2010-08-19 03:34:03 +03:00
Kamen Mazdrashki
fffc98f33e s4: fix few comment typos 2010-08-19 03:34:02 +03:00
Kamen Mazdrashki
d01804dda9 s4-schema_syntax.c: Fix white spaces and alignment 2010-08-19 03:34:02 +03:00
Kamen Mazdrashki
c5ec1f3d92 s4-dsdb: Use dsdb_syntax_ctx in *_drsuapi_to_ldb functions 2010-08-19 03:34:02 +03:00
Kamen Mazdrashki
b5af7b9a1e s4-dsdb: Use dsdb_syntax_ctx in *_ldb_to_drsuapi functions 2010-08-19 03:34:01 +03:00
Kamen Mazdrashki
ca80918613 s4-dsdb: Use dsdb_syntax_ctx in *_validate_ldb functions 2010-08-19 03:34:01 +03:00
Kamen Mazdrashki
b7d1586ccd s4-dsdb: Add context structure for dsdb_syntax conversion functions
This structure is intended to hold context-dependent data.

Syntax-conversion and object-conversion functions need
that data to convert objects and attributes from drs-to-ldb
and ldb-to-drs correctly.

For instance: ATTID value depends on whether we are converting
object from partition different that Schema partition.
2010-08-19 03:34:01 +03:00
Kamen Mazdrashki
d595f070f6 s4-dsdb: fix attributes_by_msDS_IntId index sorting 2010-08-11 00:18:14 +03:00
Kamen Mazdrashki
f827904596 s4-schema: More verbose error log when subClassOf is not found in schema
Error message show failing classSchema object
but not the specific value for the failure,
which makes diagnostics by log files really hard.
2010-08-03 04:29:23 +03:00
Kamen Mazdrashki
a268e0846f s4: fix comment typos 2010-08-03 04:29:22 +03:00
Kamen Mazdrashki
86cc914717 s4-dsdb: use ldb_msg_normalize() in source4/dsdb/schema/schema_set.c
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:34 +10:00
Kamen Mazdrashki
fb1c0796c7 s4-dsdb/schema/schema_set.c: fix trailing spaces and comments spelling
Few comments split on several lines also...

(Sorry Metze, I know you hate reviewing "and this, and that"
type of patches, but those are just cosmetics)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:33 +10:00
Kamen Mazdrashki
a11d3b4dfb s4-dsdb: use ldb_msg_difference() in source4/dsdb/schema/schema_set.c
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:33 +10:00
Andrew Tridgell
87df785a68 s4-dsdb: use ldb_operr() in the dsdb code
this replaces "return LDB_ERR_OPERATIONS_ERROR" with "return ldb_operr(ldb)"
in places in the dsdb code where we don't already explicitly set an
error string. This should make is much easier to track down dsdb
module bugs that result in an operations error.
2010-07-07 20:14:55 +10:00
Matthias Dieter Wallnöfer
02eab66026 s4:schema_set.c - Fix a comment 2010-07-03 14:53:03 +02:00
Matthias Dieter Wallnöfer
d1ee7ab16e s4:dsdb_schema_set_attributes - remove unneeded filter criterias
We already choose the right entry by specifying the right basedn with scope
"LDB_SCOPE_BASE".
2010-07-03 14:53:02 +02:00
Matthias Dieter Wallnöfer
4df9757b48 s4:schema_set.c - fix typo 2010-07-03 12:36:34 +02:00
Anatoliy Atanasov
62341537d7 s4/schema: remove unnecessary deletion of dsdb_schema cached pointer
This is needed so we can find and free old schemas based using
the cached pointer
2010-07-02 11:55:33 +03:00
Andrew Bartlett
c48279896d s4:dsdb Ensure we free old schema copies
It was reported by aatanasov that we kept around one whole schema per
modification made.  This does not fix that, but I hope moves us closer
to a fix

The most important part of the fix is that:

-		if (schema_out != schema_in) {
-			talloc_unlink(schema_in, ldb);
-		}

was the wrong way around.  This is now handled in the schema_set calls.

Andrew Bartlett
2010-07-02 10:08:16 +10:00
Anatoliy Atanasov
6abfe8904a s4:schema/schema_set.c - free LDB message diffs
Especially the "free"s after "ldb_msg_diff" are very important since the diff
message is allocated on the long-living LDB context.

Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>
2010-06-30 09:17:44 +02:00
Andrew Bartlett
32b8b401d6 s4:dsdb Fix possible schema segfaults for DRS-replication based schema
The problem here is that if the schema has been modified on the source
domain, there may be attributes that appear over DRS with 0 values (to
indicate that any existing values on the target should be deleted).
This would confuse the previous version of this macro.

Andrew Bartlett
2010-06-30 10:22:59 +10:00
Kamen Mazdrashki
3aa8853f58 s4/dsdb: msg_idx->dn should be allocated in msg_idx mem context 2010-06-21 02:57:56 +03:00
Kamen Mazdrashki
cc7e2c10f2 s4/dsdb: Move schema accessors cleanup in separate function
This way dsdb_setup_sorted_accessors() will
free memory allocated for accessor arrays correctly
in case of failure,
2010-06-21 02:57:56 +03:00
Kamen Mazdrashki
267645ca55 s4/dsdb-schema: Index attributes on msDS-IntId value
O(n) search for dsdb_attribute by msDS-IntId value was
replaced by binary-search in ordered index.

I've choosen the approach of separate index on msDS-IntId values
as I think it is more clear what we are searching for.
And it should little bit faster as we can clearly determine
in which index to perform the search based on ATTID value -
ATTIDs based on prefixMap and ATTIDs based on msDS-IntId
are in separate ranges.

Other way to implement this index was to merge msDS-IntId values
in attributeID_id index.
This led me to a shorted but not so obvious implementation.
2010-06-21 02:57:55 +03:00