1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
Commit Graph

2890 Commits

Author SHA1 Message Date
Andrew Tridgell
3dae32397a s4-dsdb: fixed the defaultObjectCategory to have a full GUID
this fixes the DN to have a full GUID for new objects

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Jul 13 14:03:30 CEST 2011 on sn-devel-104
2011-07-13 14:03:30 +02:00
Andrew Tridgell
80c8f42f05 s4-dsdb: another special case for the "member" attribute
thanks to Matthias for his great test suite work!

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-13 12:51:05 +02:00
Andrew Bartlett
43c0a92d23 s4-dsdb Don't process deletion of member attributes here.
We don't need to compare the delete against the primaryGroupID check
here - that test is for adds.

Andrew Bartlett
2011-07-13 12:51:05 +02:00
Andrew Tridgell
014fca1069 dsdb: fixed special case of zero NTTIME
we can't convert 0 NTTIME via a unix time_t

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-13 12:51:05 +02:00
Andrew Tridgell
afe4b77d35 s4-dsdb: fixed modify of ACLs on deleted objects
this is needed for the dbcheck code

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-13 12:51:05 +02:00
Andrew Tridgell
b66c57751a s4-dsdb: raise debug level for backlink errors
when dbcheck is fixing missing backlinks we don't want a DEBUG 0
message

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-07-13 12:51:05 +02:00
Andrew Tridgell
94b820af56 pydsdb: added get_backlink_from_lDAPDisplayName()
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-07-13 12:51:05 +02:00
Andrew Tridgell
0214b7f20c s4-dsdb: moved checking of duplicate member entries to repl_meta_data.c
the samldb checks failed to account for the possibility of a member
being removed and added in the same modify operation. This happens
(for example) when dbcheck is fixing a SID in a DN.

The repl_meta_data.c code already has this check, it just wasn't
giving the right specialised error code for the 'member' attribute

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-07-13 12:51:04 +02:00
Andrew Tridgell
02562a0ca9 dsdb: added get_lDAPDisplayName_by_attid
this allows conversion from a DRS attribute ID to a LDAP display name

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-11 14:32:45 +10:00
Matthieu Patou
4a4c748d2b s4-dirsync: do not return linked attribute if the target object is no more
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-11 14:32:45 +10:00
Matthieu Patou
74530d6453 s4-dsdb: allow objectsid to be specified in a modification operation
if we have the provision control, it's used by dbcheck

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-11 14:32:45 +10:00
Matthieu Patou
bbd4e27745 s4-python: Add functions to get linkid and systemflags of an attribute
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-11 14:32:44 +10:00
Matthieu Patou
ab77df800e s4-dsdb: if the provision control is specified, update replication metadata even if the data hasn't change
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-11 14:32:44 +10:00
Matthieu Patou
6ec46309c3 s4-dsdb: when replacing linked attribute take always the new dn as the old dn might be broken
The usual use case is that you have a not complete linked attribute (ie.
without the SID) if we keep using the old dn, then the SID will never be
added.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-11 14:32:44 +10:00
Matthieu Patou
3764b93b7c s4-dsdb: check for single valued attribute in repl_meta_data module
This is needed because we can have more than 1 value in a single valued
attribute as we store also deleted values. So we do the check in repl_meta_data
and then indicate LDB to do the check.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-11 14:32:44 +10:00
Andrew Tridgell
6f6cda72fc s4-dsdb: deleted objects are expected to be missing mandatory attributes
the objectclass_attrs validation that an object contains all mandatory
attributes is incorrect for deleted objects, as they get stripped of
some mandatory attributes when deleted (for example, objectCategory
gets stripped)

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-07-11 14:32:44 +10:00
Andrew Tridgell
da75e031c3 s4-dsdb: fixed crash bug in extended_dn_in
when extended_dn_in fails to resolve a GUID extended DN component, the
debug code assumed that it was a search operation, and accessed
ac->req->op.search.base, which is not valid for non-search DN
expansions.

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-07-11 14:32:44 +10:00
Andrew Tridgell
28dbd8bbc1 s4-dsdb: allow removal of unknown attributes if RELAX set
this allows attributes not known in the schema to be removed if the
caller has set the RELAX control. This will be used by dbcheck to
allow cleaning of bad attributes from the database
2011-07-05 07:10:03 +02:00
Andrew Bartlett
f3c3768d30 s4-dsdb guard principalName parse for invalid inputs
We need to ensure that if this parses name.name_string as just one
val, then we don't read uninitialised and possibly unallocated memory.
Found by Adam Thorn <alt36@cam.ac.uk>

While we are checking that, we need to fix the strncasecmp() check to
first check if the string is the expected length, then check for a
match against sAMAccountName-without-doller, as otherwise we will
permit a string such as machinefoo to match a sAMAccountName of
machine.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Jul  1 03:55:00 CEST 2011 on sn-devel-104
2011-07-01 03:55:00 +02:00
Andrew Bartlett
f1b1a66615 s4-dsdb Allow a servicePrincipalName of machine$
This is pointless, but MacOS X (version 10.6.8 was tested) apparently
sets machine$ into this field.

Andrew Bartlett
2011-07-01 10:43:29 +10:00
Matthieu Patou
4d51ddbb5c s4-schema: avoid segfaulting if id3.guid is NULL 2011-06-22 20:13:08 +02:00
Andrew Tridgell
a353b49047 s4-dsdb: bypass validation when relax set
this allows dbcheck to fix bad attributes

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Jun 22 12:27:06 CEST 2011 on sn-devel-104
2011-06-22 12:27:06 +02:00
Andrew Tridgell
c42aeb7872 s4-dsdb: prioritise GUID in extended_dn_in
if we search with a base DN that has both a GUID and a SID, then use
the GUID first. This matters for the S-1-5-17 SID.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-06-22 11:16:26 +02:00
Andrew Tridgell
d9ee7aebcb s4-dsdb: catch duplicate matches in extended_dn_in
When searching using extended DNs, if there are multiple matches then
return an object not found error. This is needed for the case of a
duplicate objectSid, which happens for S-1-5-17

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-06-22 11:16:26 +02:00
Andrew Tridgell
202f0a4b57 pydsdb: added get_syntax_oid_from_lDAPDisplayName()
this gives you access to the syntax oid of an attribute

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-06-22 14:47:08 +10:00
Andrew Tridgell
c46f80824b s4-dsdb: don't add zero GUID to BINARY_DN
When converting from DRS to ldb format for a BINARY_DN, don't add the
GUID extended DN element if the GUID is all zeros.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-06-22 14:47:07 +10:00
Andrew Bartlett
a1f04e8abc libcli/util Rename common map_nt_error_from_unix to avoid duplicate symbol
The two error tables need to be combined, but for now seperate the names.

(As the common parts of the tree now use the _common function,
errmap_unix.c must be included in the s3 autoconf build).

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Jun 20 08:12:03 CEST 2011 on sn-devel-104
2011-06-20 08:12:03 +02:00
Andrew Bartlett
018f4a5889 libcli/util Bring samba4 unix -> nt_status code in common.
Due to library link orders, this is already the function that is being
used.  However we still need to sort out the duplicate symbol issues,
probably by renaming things.

Andrew Bartlett
2011-06-20 14:36:06 +10:00
Andrew Tridgell
4905725599 s4-dsdb: if we don't have a remote schema, then use the local one
this allows the use of drsuapi_to_ldb() on all attributes for the
local database
2011-06-17 12:32:55 +10:00
Andrew Tridgell
665ef94d3c s4-pydsdb: added dsdb_normalise_attributes() call
this call converts a set of attributes to DRSUAPI format and back to
ldb format. This has the effect of normalising the attributes using
the schema syntax rules
2011-06-17 12:32:55 +10:00
Andrew Tridgell
56d09d5904 s4-drs: ensure we add a RMD_ADDTIME when upgrading a linked attribute
if the link was a w2k style, and we are upgrading it, then set the
RMD_ADDTIME to the current time
2011-06-10 10:14:56 +10:00
Andrew Tridgell
3e4c08096d s4-drs: cope with missing RMD_ADDTIME in linked attributes
upgraded links can be missing the RMD_ADDTIME field
2011-06-10 10:14:56 +10:00
Matthias Dieter Wallnöfer
26c7223e72 s4:schema_convert_to_ol.c - fix memory contexts
- Add more "mem_ctx" free functions on error cases
- Steal the "out" string directly onto the LDB context to be able to free
  the local "mem_ctx"

Reviewed-by: Tridge
2011-06-09 10:53:36 +02:00
Matthias Dieter Wallnöfer
87a38d77ac s4:dsdb/schema_convert_to_ol.c - quiet enum warning
Introduce a error message when choosing wrong targets.

Reviewed-by: Tridge
2011-06-09 09:35:35 +02:00
Andrew Tridgell
5d7ba30549 s4-dsdb: cope with missing backlinks in rpmd handling
if backlinks have not propogated correctly in a previous replication
this allows us to recover
2011-06-07 12:55:37 +10:00
Andrew Bartlett
a18efb1490 s4-param Remove 'sid generator'
This was only used by the Fedora DS backend for Samba4.  We agreed to
no longer support external LDAP backends.

Andrew Bartlett
2011-06-06 17:37:50 +10:00
Andrew Bartlett
c091a92be5 s4-param Remove 'sam database' parameter
This now just relies on the private dir parameter, which remains.

Andrew Bartlett
2011-06-06 15:02:38 +10:00
Matthias Dieter Wallnöfer
ff47927fb9 s4:samldb LDB module - check if the RODC group exists if creating an RODC
Older AD deployments simply don't have it and hence there is no RODC
support.

Reviewed-by: abartlet

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Wed May 25 10:26:37 CEST 2011 on sn-devel-104
2011-05-25 10:26:37 +02:00
Matthias Dieter Wallnöfer
08f5ed8b4f s4:samldb LDB module - better to call "samldb_prim_group_trigger"
"samldb_prim_group_trigger" which as a wrapper calls "samldb_prim_group_change"
for a LDB modify operation.

Reviewed-by: abartlet
2011-05-25 08:57:51 +02:00
Matthias Dieter Wallnöfer
779d882aca s4:samldb LDB module - convert a "dsdb_module_search" into "dsdb_module_search_dn"
It saves us from checking the number of returned entries.

Reviewed-by: abartlet
2011-05-25 08:57:46 +02:00
Matthias Dieter Wallnöfer
11937ce5e1 s4:sam.py - uncomment/enhance some account type tests
Reviewed-by: abartlet
2011-05-25 08:57:42 +02:00
Matthias Dieter Wallnöfer
2ad0100d5b s4:samldb LDB modules - only objectClass "computer" is allowed to embed all types of account
Reviewed-by: abartlet
2011-05-25 08:57:35 +02:00
Matthias Dieter Wallnöfer
4740473591 s4:sam.py - tests for "isCriticalSystemObject" attribute
Reviewed-by: abartlet
2011-05-25 08:57:29 +02:00
Matthias Dieter Wallnöfer
0c753e503c s4:samldb LDB module - fix "isCriticalSystemObject" behaviour
Tests against Windows Server show that it gets set to "FALSE" (not
deleted) if we change the account type to a domain member.

Reviewed-by: abartlet
2011-05-25 08:57:24 +02:00
Matthias Dieter Wallnöfer
c72d32da6d s4:sam.py - unchanged "primaryGroupID" when account type remains the same
Enhance the testcase with a workstation example.

Reviewed-by: abartlet
2011-05-25 08:57:19 +02:00
Matthias Dieter Wallnöfer
b712c7273d s4:samldb LDB module - fix the behaviour when changing the "userAccountControl"
Ekacnet was not quite right yet but his patch made me think further.
This primary group changing is only needed if the account type changes.
With this patch we do one more search if the "userAccountControl"
changes but we save us from doing these unneeded and wrong modify replace
operations most of the time.

Reviewed-by: abartlet
2011-05-25 08:57:09 +02:00
Matthieu Patou
1b5c2d8e92 s4:sam.py - add tests to check that setting "userAccountValue" on usersdon't impact the "primaryGroupID" attribute
Notice: The domain administrators groups isn't referenced as "Domain Admins"
since this name could differ.

Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sat May 21 19:19:57 CEST 2011 on sn-devel-104
2011-05-21 19:19:57 +02:00
Matthieu Patou
e3aa200a14 s4:samldb LDB module - don't change the "primaryGroupId" on LDB modifications unless we are a computer/dc/rodc
Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>
2011-05-21 16:25:12 +02:00
Matthias Dieter Wallnöfer
d34205add3 s4:ldb-samba/ldb_wrap.*-dsdb/samdb/samdb.c - handle LDB connection flags as unsigned
The LDB API ("ldb_connect") prescribes that they should be "unsigned".

Signed-off-by: Metze
2011-05-21 16:21:14 +02:00
Matthieu Patou
c2fa348831 s4-dsdb: add unit tests for dirsync control
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-05-21 16:25:19 +04:00