1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

104 Commits

Author SHA1 Message Date
Garming Sam
d2beff59ec Remove the remaining uses of the macro NT_STATUS_HAVE_NO_MEMORY_AND_FREE in the codebase.
Following the current coding guidelines, it is considered bad practice to return from
within a macro and change control flow as they look like normal function calls.

Change-Id: Id1b540cde127395a7b27385a7c0fe79f3a145c73
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-03-05 16:33:21 +01:00
Garming Sam
952bc3cad0 Remove a number of NT_STATUS_HAVE_NO_MEMORY_AND_FREE macros from the codebase.
Following the current coding guidelines, it is considered bad practice to return from
within a macro and change control flow as they look like normal function calls.

Change-Id: I133eb5a699757ae57b87d3bd3ebbcf5b556b0268
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-03-05 16:33:21 +01:00
Andrew Bartlett
e461ff5300 dsdb: Allow dsdb_find_dn_by_guid to show deleted DNs
This helps us in the KCC as we need to return the deleted DN for the GUID
in DsReplicaGetInfo calls (tested for deleted servers against Windows 2008R2).

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-06-12 10:02:07 +02:00
Matthieu Patou
972417131d Fix warnings about set but unused variables
Signed-off-by: Matthieu Patou <mat@matws.net>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-05-20 21:54:06 +10:00
Matthieu Patou
97f0b8d9c9 drs-replica-info: level_not_supported is wrong when we do support (partialy the level) 2012-10-07 21:51:02 -07:00
Andrew Bartlett
2e1ab13f6e s4-dsdb: Use tmp_ctx in kccsrv_check_deleted to avoid leaking memory onto part->dn
The confusing use of do_dn as a memory context while legitimate
created a bug when it was copied and modified to search on a DN from
long-term state.

By always using a temporary memory context it is clear what paramter
is the memory context.

This was found based on a log provided by Ricky Nance
<ricky.nance@weaubleau.k12.mo.us>.  Thanks Ricky!

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 17 18:24:10 CEST 2012 on sn-devel-104
2012-08-17 18:24:09 +02:00
Andrew Bartlett
26bfe70def s4-kcc: Avoid use-after-free of dn and add tmp_ctx
By using a tmp_ctx we are clearer about allocating temporary memory.

Andrew Bartlett
2012-08-17 16:41:26 +02:00
Andrew Bartlett
9566786853 s4-dsdb: Add mem_ctx argument to samdb_ntds_settings_dn
As this value is calculated new each time, we need to give it a context to live on.

If the value is the forced value during provision, a reference is taken.

This was responsible for the memory leak in the replication process.  In the
example I was given, this DN appeared in memory 13596 times!

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 14 10:05:14 CEST 2012 on sn-devel-104
2012-08-14 10:05:14 +02:00
Andrew Bartlett
1f7477349f s4-dsdb: Improve memory handling in kccsrv_add_connection() 2012-08-14 08:27:19 +02:00
Andrew Bartlett
77990c1831 s4-dsdb: Improve memory handling in kccsrv_find_connections() by adding a tmp_ctx 2012-08-14 08:27:19 +02:00
Andrew Bartlett
b8815dc23d lib/param: Create a seperate server role for "active directory domain controller"
This will allow us to detect from the smb.conf if this is a Samba4 AD
DC which will allow smarter handling of (for example) accidentially
starting smbd rather than samba.

To cope with upgrades from existing Samba4 installs, 'domain
controller' is a synonym of 'active directory domain controller' and
new parameters 'classic primary domain controller' and 'classic backup
domain controller' are added.

Andrew Bartlett
2012-06-15 09:18:33 +02:00
Matthieu Patou
cf39ef3637 s4-kcc: avoid a false alarm with rodc
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Thu Apr 19 12:32:58 CEST 2012 on sn-devel-104
2012-04-19 12:32:58 +02:00
Amitay Isaacs
ab375526e8 s4-dsdb: Fix the case for attribute name msDS-hasMasterNCs
Autobuild-User: Amitay Isaacs <amitay@samba.org>
Autobuild-Date: Wed Mar 14 11:59:02 CET 2012 on sn-devel-104
2012-03-14 11:59:02 +01:00
Matthieu Patou
34d549de34 s4-kcc: Remove also deleted objects that are not in the Deleted Object container
For the configuration container we do a full scan at every run of the
kcc-delete service. For the base DN we introduce a new parameter that
avoid the full scan to kick just when samba starts.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-12-23 07:57:21 +01:00
Dave Craft
0a4746a200 Invocation of samba_kcc from KCC task
Modification to periodic and explicit invocation
paths of the KCC topology generation code.  Managed
via samba_runcmd_send() API.  The samba_kcc script
is invoked if (kccsrv:samba_kcc = true) appears in smb.conf

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-12-08 11:48:17 +11:00
Dave Craft
0a181217bd Add subreq and status to kcc_service struct
The subreq and status fields in the kcc_service struct
are added for execution management of the external samba_kcc
python script.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-12-08 11:48:17 +11:00
Andrew Tridgell
6356f4c255 s4-kcc: if we are a GC, auto-add partial replicas
when we are a global catalog server, the KCC needs to add partial
replicas for all domain partitions that we don't have copies of
2011-10-04 15:08:57 +11:00
Andrew Tridgell
783ff68628 s4-kcc: return partial replica NCs in drs showrepl
the showrepl operation should return all our replicated NCs, including
partial replicas
2011-09-22 10:00:48 +10:00
Amitay Isaacs
2fc233b78f s4-kcc: Fix the list of NCs for DRS replica information
AD DNS partitions (DomainDnsZones and ForestDnsZones) are listed
under msDs-hasMasterNCs attribute for post-2003 windows servers.
2011-09-07 12:16:40 +02:00
Andrew Tridgell
484fb303ff s4-kcc: fixed _msdcs DNS name
we need to base this DNS name on the forest DNS name for multi-domain
support

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-25 07:39:38 +10:00
Simo Sorce
f364daed22 s4:dsdb: use tevent_ fn names instaed of legacy event_ ones 2011-08-13 09:54:15 -04:00
Matthieu Patou
ff1907012a s4-kcc: correctly populate the neighbor object when taking information from repsTo
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Sun Jul 31 00:17:17 CEST 2011 on sn-devel-104
2011-07-31 00:17:17 +02:00
Andrew Tridgell
a2c425858b s4-kcc: use dsdb_delete() instead of ldb_delete()
this adds the DSDB_SEARCH_SHOW_DELETED flag, which fixes deletion of
deleted objects

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-21 11:44:36 +10:00
Dave Craft
1838e16f34 Add intrasite code test switch
kcc_service struct gets a intrasite_code
boolean that is filled in via parametric parameter
kccsrv:intrasite = [true/false] in smb.conf.   This
will allow us to continue to utilize old simple
KCC topology as continuing default while newer
intra-site topology matures further.

Signed-off-by: Andrew Tridgell <tridge@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Jul 14 00:19:12 CEST 2011 on sn-devel-104
2011-07-14 00:19:12 +02:00
Dave Craft
c8413b3420 Add kccsrv_add_repsFrom() possibility of NULL res argument
We need the ability to utilize this function in a different
manner.  KCC intra-site topology has already vetted the
replica as being appropriate to produce a repsFrom from.
We do not want kccsrv_add_repsFrom() to produce further
checking as was the case for simple topology.   Thus if
we pass a NULL (res) parameter this extra check will
be skipped.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-14 07:05:10 +10:00
Dave Craft
4b19415f5b Remove static to allow availability to other KCC files
kccsrv_replica_flags() and
kccsrv_add_repsFrom() need to be available to functions
outside kcc_periodic.c

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-14 07:05:10 +10:00
Dave Craft
f6c90dfeba kcc_connection invocation_id added to struct
Utilized by KCC to carry the invocation id of the NTDSDSA
that we are replicating the name context from.  Utilized
when NTDSConnection is created (much like dsa_guid tracks
the NTDSDSA objectGUID that we are replicating the name
context from).

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-14 07:05:10 +10:00
Dave Craft
4dea78d508 KCC NTDSConnection should utilize NTDSCONN_OPT_IS_GENERATED
Previously this set an explicit (0x1) value whereas it
can now utilize NTDSCONN_OPT_IS_GENERATED from flags.h

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-14 07:05:09 +10:00
Dave Craft
b52246bf2f NTDSConnection and NTDSA Site setting flags
Flags that were missing from flags.h or were incorrectly
defined inline to the kcc_topology.c code (and thus unusable
elsewhere).   These are the NTDSConnection and NTDSDSA Site
settings flags.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-14 07:05:09 +10:00
Matthias Dieter Wallnöfer
0e68867b26 s4:dsdb - always handle the attribute "options" as 32bit unsigned integer
It is defined as LDAP syntax 2.5.5.9 so no need at all to treat it as
64-bit integer.

Reviewed by: Kamenim and Metze

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Tue Mar  1 12:46:15 CET 2011 on sn-devel-104
2011-03-01 12:46:15 +01:00
Andrew Tridgell
8dc92c8f71 ldb: use #include <ldb.h> for ldb
thi ensures we are using the header corresponding to the version of
ldb we're linking against. Otherwise we could use the system ldb for
link and the in-tree one for include

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-10 06:51:07 +01:00
Andrew Tridgell
bf52cffd25 s4-kcc: fixed valgrind errors in drs replicaInfo server side
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Nov 26 03:52:30 CET 2010 on sn-devel-104
2010-11-26 03:52:30 +01:00
Andrew Tridgell
5d014cad08 s4-kcc: disable the NDR printing of DRS getinfo requests 2010-11-24 00:19:15 +01:00
Andrew Tridgell
5b3981acb1 s4-rodc: enable the DRS_GET_ALL_GROUP_MEMBERSHIP flag for RODC replication
see the description of this flag in [MS-DRSR]
2010-11-18 23:12:26 +01:00
Andrew Tridgell
e17ea9f3f5 s4-kcc: fixed result_last_attempt in showrepl 2010-11-17 23:55:39 +11:00
Andrew Tridgell
ac0a92b5b3 s4-debug: lowered the debug level of some unimportant messages 2010-11-08 06:16:04 +00:00
Stefan Metzmacher
e3276b3ab3 s4:dsdb/kcc: fix memory leak in kcctpl_copy_output_edges()
metze
2010-11-04 17:13:01 +01:00
Kai Blin
e7358e7582 s4 dsdb kcc: Prefer msDS-hasMasterNCs over hasMasterNCs when replicating 2010-10-23 10:17:05 +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
93126b3315 samdb: Add flags argument to samdb_connect(). 2010-10-10 23:08:49 +02:00
Matthias Dieter Wallnöfer
e3081b92c1 s4:dsdb - substitute the "show_deleted" with the "show_recycled" control
We intend to see always all objects with the "show_deleted" control specified.
To see also recycled objects (beginning with 2008_R2 function level) we need to
use the new "show_recycled" control.

As far as I see this is only internal code and therefore we don't run into
problems if we do substitute it.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-10-03 15:23:18 +00:00
Andrew Tridgell
32ec1b36e0 s4-kcc: silence "Testing kcctpl_create_intersite_connections" message
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Sun Oct  3 04:51:44 UTC 2010 on sn-devel-104
2010-10-03 04:51:44 +00:00
Andrew Tridgell
6e846ca1f3 s4-kcc: remove stale repsTo entries in the KCC
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-02 01:04:17 +00:00
Andrew Tridgell
4d551753d6 s4-kcc: fixed the replica_flags in repsFrom in the kcc
if our calculated replica_flags doesn't match the ones in our repsFrom
then update it

Pair-Programmed-With: Anatoliy Atanasov <anatoliy.atanasov@postpath.com>
2010-09-29 22:12:57 -07:00
Andrew Tridgell
17aa2b3294 s4-kcc: fixed a incorrect context to kcctpl_get_all_bridgehead_dcs 2010-09-27 22:55:04 -07:00
Andrew Tridgell
396cdd6343 s4-kcc: don't print "Testing kcctpl_create_intersite_connections"
log level 0 is excessive for this!
2010-09-27 23:18:23 +00:00
Anatoliy Atanasov
67b6252eed s4/dsdb:kcc: cleanup and improve readability 2010-09-23 08:41:05 -07:00
Stefan Metzmacher
519180c341 s4:dsdb/kcc: we don't need to manually allocate [out,ref] pointers anymore
metze

Signed-off-by: Anatoliy Atanasov <anatoliy.atanasov@postpath.com>
2010-09-23 08:41:05 -07:00
Andrew Tridgell
d2008fbbb9 s4-kcc: the kcc should not be setting the repsTo attribute
repsTo is set by other DCs, when they ask to be notified about changes
in a partition
2010-09-23 07:17:57 +00:00
Andrew Tridgell
d1cbd68bb1 s4-kcc: added service->am_rodc
use a rodc flag on the service instead of calling samdb_rodc each time
2010-09-23 07:17:57 +00:00