1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

2722 Commits

Author SHA1 Message Date
Matthias Dieter Wallnöfer
932911e1e1 s4:ldap.py - check the write protection on LSA objects
Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Jan 25 13:09:41 CET 2011 on sn-devel-104
2011-01-25 13:09:41 +01:00
Matthias Dieter Wallnöfer
3468f8de1e s4:dsdb/samdb/ldb_modules/objectclass.c - move LSA specific object checks into "objectclass_attrs" LDB module
LSA object classes are protected on both LDAP add and LDAP modify
operations, so I've refactored the previous check in the objectclass LDB
module only for LDAP adds in a new one in the objectclass_attrs LDB
module for both adds and modifies.
This is the result of the investigations done by Hongwei Sun and I in
the last months.
Interestingly these protection mechansim doesn't apply on LDAP deletes!

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-01-25 12:27:20 +01:00
Kamen Mazdrashki
585e9a0ab0 s4-repl_meta_data: replmd_update_is_newer() should not return true if metadata stamps are equal
Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Sat Jan 22 12:22:30 CET 2011 on sn-devel-104
2011-01-22 12:22:30 +01:00
Kamen Mazdrashki
0ce93ad2bc s4-repl_meta_data: Print out what is wrong when we fail to modify object 2011-01-22 12:35:22 +02:00
Kamen Mazdrashki
0aa118f22b s4-repl_meta_data: We should not use USNs in metadata comparisons
If object is changed by same DC, then version should be incremented
2011-01-22 12:35:22 +02:00
Andrew Bartlett
fbe6d155bf s4-auth Remove special case for account_sid from auth_serversupplied_info
This makes everything reference a server_info->sids list, which is now
a struct dom_sid *, not a struct dom_sid **.  This is in keeping with
the other sid lists in the security_token etc.

In the process, I also tidy up the talloc tree (move more structures
under their logical parents) and check for some possible overflows in
situations with a pathological number of sids.

Andrew Bartlett
2011-01-20 23:44:05 +01:00
Andrew Bartlett
244c191f9e s4-dsdb Don't use None as the input to the GENSEC loop in tokengroups test
The input to gensec.update() should always be a string.

Andrew Bartlett
2011-01-19 23:11:31 +01:00
Andrew Bartlett
916cc7be85 s4-dsdb Add PAC validation test to tokengroups test.
This confirms that the groups obtained from a Kerberos PAC match those
that a manual search of a target LDAP server would reveal.

This should allow mixing of a KDC specified by krb5.conf to test Samba
or Windows alternatly.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Jan 19 13:13:48 CET 2011 on sn-devel-104
2011-01-19 13:13:48 +01:00
Andrew Bartlett
75835d3f2f s4-dsdb Add a test of the tokenGroups behaviour on the user's DN.
Andrew Bartlett
2011-01-19 12:29:05 +01:00
Nadezhda Ivanova
f6077f23b7 s4-tests: Added a test for correct inheritance of IO flagged ACEs.
Autobuild-User: Nadezhda Ivanova <nivanova@samba.org>
Autobuild-Date: Tue Jan 18 15:53:46 CET 2011 on sn-devel-104
2011-01-18 15:53:46 +01:00
Andrew Tridgell
8794e6dad9 s4-dsdb: replaced the calls to ldb_search() in dsdb modules with dsdb_module_search()
this ensures we follow the module stack, and set the parent on child
requests
2011-01-17 05:23:04 +01:00
Andrew Tridgell
87f3151047 s4-dsdb: pass parent request to dsdb_module_*() functions
this preserves the request hierarchy for dsdb_module_*() calls inside
dsdb ldb modules

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-17 05:23:04 +01:00
Matthias Dieter Wallnöfer
93d96414be s4:dsdb_find_nc_root - fix it up to let the provisioning work correctly
Use the temporary list unless we have at least the three main
"namingContexts" from the rootDSE available (Default, Configuration, Schema -
these are mandatory on all AD deployments!).

This bug has been discovered by Nadya in relation with her SD work.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sat Jan 15 19:01:11 CET 2011 on sn-devel-104
2011-01-15 19:01:11 +01:00
Matthias Dieter Wallnöfer
a87b2f9ec0 s4:urgent_replication.py - remove a now superflous RELAX control
The LSA object creation protection changed to the trusted/untrusted
connection model.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Fri Jan 14 19:30:52 CET 2011 on sn-devel-104
2011-01-14 19:30:52 +01:00
Matthias Dieter Wallnöfer
39eea5ca43 s4:samldb LDB module - fix "userAccountControl" handling
"UF_ACCOUNTDISABLE" is only added automatically if no "userAccountControl" flags
are set on LDAP add operations.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Fri Jan 14 18:29:07 CET 2011 on sn-devel-104
2011-01-14 18:29:07 +01:00
Andrew Tridgell
ad8965c364 s4-dsdb: only enforce the extended dn rules over ldap
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Jan 14 07:23:31 CET 2011 on sn-devel-104
2011-01-14 07:23:31 +01:00
Andrew Tridgell
74674e782e s4-dsdb: removed the last use of samdb_search_*() from the dsdb ldb modules
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-14 16:39:33 +11:00
Andrew Tridgell
90110a0bbc s4-dsdb: removed some more samdb_search_*() calls from samldb.c
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-14 16:39:33 +11:00
Andrew Tridgell
3b7c498437 s4-dsdb: replaced another use of samdb_search in a ldb module
we should be using the dsdb_module_search*() calls

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-14 16:39:33 +11:00
Andrew Tridgell
15c8107868 s4-dsdb: fixed primaryGroupID to use dsdb_module_search_dn()
this avoids using a multi-part extended DN in a search that hits the
check in extended_dn_in

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-14 16:39:33 +11:00
Andrew Tridgell
31d644c7f9 s4-dsdb: fixed filtering of tokengroups
builtin groups are shown in user tokenGroups searches

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-14 16:39:33 +11:00
Andrew Tridgell
197f4b098b s4-test: added a tokengroups test
this tests that the remote tokenGroups match the internally calculated
ones

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-14 16:39:33 +11:00
Andrew Tridgell
0450ab9536 s4-samdb: give a more useful debug when we can't open the privileges db
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-14 16:39:33 +11:00
Andrew Tridgell
a38854f74b s4-dsdb: minimise the DN in group expansion
this DN we have came from an extended DN search, which means it may
have multiple extended components. We need to minimise the DN before
AD will accept it

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-14 16:39:33 +11:00
Andrew Tridgell
27d7f6a312 s4-dsdb: validate number of extended components
this checks that the number of extended components in a DN is valid,
to match MS AD behaviour. We need to do this to ensure that our tools
don't try to do operations that will be invalid when used against MS
servers

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-14 16:39:32 +11:00
Andrew Bartlett
cbffc51313 s4-dsdb Implement tokenGroups expansion directly in ldb operational module
This removes a silly cross-dependency between the ldb moudle stack and auth/

Andrew Bartlett
2011-01-14 16:39:32 +11:00
Matthias Dieter Wallnöfer
d35d2bf392 s4:extended_dn_out LDB module - initialise "have_reveal_control" 2011-01-12 19:52:20 +01:00
Nadezhda Ivanova
db7e38d59a s4-tests: Tests for expansion of ACEs containing generic information.
Autobuild-User: Nadezhda Ivanova <nivanova@samba.org>
Autobuild-Date: Tue Jan 11 12:10:25 CET 2011 on sn-devel-104
2011-01-11 12:10:25 +01:00
Jelmer Vernooij
4e0d0af9e8 acl tests: Fix import.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Thu Jan  6 16:07:49 CET 2011 on sn-devel-104
2011-01-06 16:07:49 +01:00
Jelmer Vernooij
4236ec9d6d Remove unused imports. 2011-01-06 15:21:21 +01:00
Jelmer Vernooij
8bf5356958 s4-python: Add missing prototypes. 2011-01-03 01:48:04 +01:00
Matthias Dieter Wallnöfer
37c4ced9bd s4:acl LDB module - "acl_rename" - memory contexts fixup
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Thu Dec 23 22:49:41 CET 2010 on sn-devel-104
2010-12-23 22:49:41 +01:00
Matthias Dieter Wallnöfer
e30299eabd s4:acl LDB module - add a missing "talloc_free(tmp_ctx)" in an error path
Just for consistency.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Thu Dec 23 21:46:38 CET 2010 on sn-devel-104
2010-12-23 21:46:37 +01:00
Matthias Dieter Wallnöfer
6857bbc899 dsdb:ldap.py - transform a test call into the new "msg.add" syntax
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Wed Dec 22 13:05:53 CET 2010 on sn-devel-104
2010-12-22 13:05:53 +01:00
Nadezhda Ivanova
935b985d23 s4-tests: Tests for Validated-SPN implementation.
Test setting spn on RWDC, RODC and regular computer object.

Autobuild-User: Nadezhda Ivanova <nivanova@samba.org>
Autobuild-Date: Wed Dec 22 12:20:24 CET 2010 on sn-devel-104
2010-12-22 12:20:24 +01:00
Nadezhda Ivanova
3ba42be7c1 s4-acl: Implementation of Validated-SPN validated write
If this right is granted to a user, they may modify the SPN of an object with some value restrictions
serviceName can be set only if the object is a DC, and then only to the default domain and netbios name, or ntds_guid._msdsc_.forest_domain. If the serviceType is GC, only to the forest root domain. If the serviceType is ldap, then to forest_domain or netbiosname.
InstanceType can be samAccountName or dnsHostName.
2010-12-22 12:29:14 +02:00
Nadezhda Ivanova
9aaacee6cd s4-dsdb: Added a helper function to get the default dns domain as string. 2010-12-22 12:29:14 +02:00
Andrew Bartlett
6f7423c7f1 s4-auth Remove duplicate copies of session_info creation code
We now just do or do not call into LDB based on some flags.

This means there may be some more link time dependencies, but we seem
to deal with those better now.

Andrew Bartlett
2010-12-21 15:10:38 +11:00
Andrew Bartlett
1961d7a411 s4-auth rework session_info handling not to require an auth context
This reverts a previous move to have this based around the auth
subsystem, which just spread auth deps all over unrelated code.

Andrew Bartlett
2010-12-21 15:10:38 +11:00
Andrew Bartlett
94a59b781c s4-auth Remove event context from privilage database handling
These local TDB operations can quite safely be handled in a new/nested
event context, rather than using the main event context.

Andrew Bartlett
2010-12-21 15:10:38 +11:00
Matthias Dieter Wallnöfer
912faf1b08 s4:dsdb/schema/schema_* - adaptions needed for removed "const" on OIDs 2010-12-21 15:10:37 +11:00
Matthias Dieter Wallnöfer
32bae10512 s4:dsdb/common/util.c - remove unused variable "ndr_err" 2010-12-21 15:10:37 +11:00
Kamen Mazdrashki
33a57db3a5 s4-pydsdb: Use local memory context in py_dsdb_get_oid_from_attid()
This version reverts changes from commit b974966cc2b4d0b5b0d83206070b5f7c5c6495d1
and is what Matthieu Patou had commited in d784ecec555a3d9737e6f4b3894f27904d2b833c
with added reference to the schema cache.

I think referencing schema here is the right thing to be done
as thus we garantee that schema cache will stay in memory
for the time our function is executed

Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Mon Dec 20 12:01:53 CET 2010 on sn-devel-104
2010-12-20 12:01:53 +01:00
Kamen Mazdrashki
7157221da5 s4-drepl: During Schema replication, we need to save updated prefixMap if everything is OK
Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Sat Dec 18 05:53:48 CET 2010 on sn-devel-104
2010-12-18 05:53:48 +01:00
Kamen Mazdrashki
5bc0848fc7 s4-dsdb_schema: Copy info needed for Schema refresh in dsdb_schema_copy_shallow
Just 'refresh_fn' and 'loaded_from_module' are copied.
I left 'reload_seq_number' set to 0 intentionally, so that
this Schema cache will looks like a very old one to ,refresh_fn'.
This way, if this shallow copy is attached to LDB, it will be
refreshed as soon as possible by 'refresh_fn'.
2010-12-18 05:32:15 +02:00
Kamen Mazdrashki
bd6f9efc1e s4-drepl: Make refreshed schema a global one
We need to do this as dsdb_reference_schema() function
clears "use_global_schema" ldb flag.

Basically what is going to happen is that after dsdb_reference_schema()
global_schema pointer will continue to point at old schema cache,
while "dsdb_schema" for LDB will point at the working_schema.

After replication is done, we reset "dsdb_schema" for the ldb
with an updated Schema cache, but this leaves global_schema pointer
with its old value, which is not up to date.
So we need to call dsdb_make_schema_global() again so that global_schema
points to a valid Schema cache.
2010-12-18 05:32:14 +02:00
Andrew Bartlett
455ef46785 Revert "s4-dsdb Don't talloc_free() ares on failure, as LDB might free it later"
This reverts commit 25163380239abbad28f1656c42e6fab1b92473d9 because
further analyis showed the real problem was introduced in 0941099a
(which changed the caller behaviour, but only for indexed searches).

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sat Dec 18 02:19:59 CET 2010 on sn-devel-104
2010-12-18 02:19:59 +01:00
Jelmer Vernooij
6967cf27eb ldb: Rename controls_except_specified -> ldb_controls_except_specified.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Dec 18 01:33:24 CET 2010 on sn-devel-104
2010-12-18 01:33:24 +01:00
Jelmer Vernooij
24faeab4c5 ldb: Rename last instance of save_controls -> ldb_save_controls. 2010-12-18 00:47:06 +01:00
Kamen Mazdrashki
839fe07359 s4-drepl: Reference current Schema cache into working_schema context
working_schema is a shallow copy of current schema and thus
depends on part of it. So we want it to be around as long as
working_schema is used.

Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Fri Dec 17 23:34:29 CET 2010 on sn-devel-104
2010-12-17 23:34:29 +01:00