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

22 Commits

Author SHA1 Message Date
Andreas Schneider
f353ce5f96 s4:dfs_server: Use lpcfg_dns_hostname() in dfs_server_ad.c
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-05-22 20:33:36 +00:00
Andreas Schneider
0c6fb4bfb0 dfs_server: Fix debug statement if searched_site is NULL
In file included from source4/include/includes.h:61,
                 from dfs_server/dfs_server_ad.c:21:
dfs_server/dfs_server_ad.c: In function ‘get_dcs.constprop’:
lib/util/debug.h:200:12: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  200 |        && (dbgtext body) )
      |           ~^~~~~~~~~~~~~
dfs_server/dfs_server_ad.c:462:25: note: in expansion of macro ‘DEBUG’
  462 |                         DEBUG(2,(__location__ ": Site: %s %s\n",
      |                         ^~~~~

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-04-27 07:21:33 +00:00
Volker Lendecke
3aa9d05ee4 dfs_server: Fix typos
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00
Matthew DeVore
232054c09b lib/util: remove extra safe_string.h file
lib/util/safe_string.h is similar to source3/include/safe_string.h, but
the former has fewer checks. It is missing bcopy, strcasecmp, and
strncasecmp.

Add the missing elements to lib/util/safe_string.h remove the other
safe_string.h which is in the source3-specific path. To accomodate
existing uses of str(n?)casecmp, add #undef lines to source files where
they are used.

Signed-off-by: Matthew DeVore <matvore@google.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 28 02:18:40 UTC 2020 on sn-devel-184
2020-08-28 02:18:40 +00:00
Garming Sam
3fcb768057 dsdb: Allow the disable of the Windows server site fallback
A usage in GetDCNameEx2 could return the wrong result. This may need to
be fixed in other places.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13365

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-05-04 06:12:10 +02:00
Jelmer Vernooij
773cfba9af Avoid including libds/common/roles.h in public loadparm.h header.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Reviewed-By: Stefan Metzmacher <metze@samba.org>
2016-01-13 04:43:23 +01:00
Robin McCorkell
46ea8b5928 dfs_server: Use multi-byte string handling
Pre-empt a bug with multi-byte DFS pathname handling by using strchr_m()

Signed-off-by: Robin McCorkell <rmccorkell@karoshi.org.uk>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jul 10 20:35:47 CEST 2015 on sn-devel-104
2015-07-10 20:35:47 +02:00
Robin McCorkell
aeb4ba1801 Fix MSDFS with POSIX paths in vfs_dfs_samba4
Allow for POSIX path separators when parsing a DFS query string

Signed-off-by: Robin McCorkell <rmccorkell@karoshi.org.uk>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-10 17:33:22 +02:00
Robin McCorkell
b1ea9856e0 dfs_server: Fix whitespace
Signed-off-by: Robin McCorkell <rmccorkell@karoshi.org.uk>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-10 06:33:07 +02:00
Robin McCorkell
936a799d32 Replace random() and related calls with generate_random_buffer()
Result: better seeded random numbers that are cryptographically secure
(not that it matters in this case)

Please let it be right this time...

Signed-off-by: Robin McCorkell <rmccorkell@karoshi.org.uk>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-10 06:33:07 +02:00
Andreas Schneider
c0f3921234 dfs_server: Only build in case we build an AD DC too.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-11-26 09:51:05 +01:00
Arvid Requate
c3719a6fee dfs_server: get_dcs: fix pointer list termination
Should fix a potential SEGV e.g. in case searched_site == NULL and no
objects with objectClass=site are found.

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-03 00:26:27 +02:00
Arvid Requate
cfa6fe8d69 dfs_server: randomize the server redirect set
comply with [MS-DFSC] section 3.2.1.1

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-03-21 19:20:17 +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
859182da6d dfs_server: Use dsdb_search_one to catch 0 results as well as NO_SUCH_OBJECT errors
This ensures we do not de-reference an invalid rs->msgs pointer if the
pointed-to object was not objectclass=computer

Andrew Bartlett

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10052

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Aug  2 13:11:20 CEST 2013 on sn-devel-104
2013-08-02 13:11:20 +02:00
Björn Baumbach
424a990e34 s4-dfs_server: check for netbios aliases in ad_get_referrals
Without this patch ad_get_referrals checks for netbios, dns names
and ip, but not for netbios aliases set by netbios aliases option,
whether the requested name is our dns name.

Pair-programmed-with: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Björn Baumbach <bb@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Jun 11 01:12:08 CEST 2013 on sn-devel-104
2013-06-11 01:12:07 +02:00
Andreas Schneider
014512f564 dfs_server: Don't allocate a subcontext twice.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Dec 12 11:28:39 CET 2012 on sn-devel-104
2012-12-12 11:28:39 +01:00
Stefan Metzmacher
13095a9df6 dfs_server_ad: s/acct/aname as acct() is a function
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jul 30 03:17:49 CEST 2012 on sn-devel-104
2012-07-30 03:17:49 +02:00
Stefan Metzmacher
6c21ae7103 dfs_server_ad: return STATUS_NOT_FOUND if the client connects to an ip address
metze
2012-07-30 01:22:09 +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
a73b1ed580 dfs_server: fix the response to please XP and Windows 2008R2 doing so avoid continious DFS requests from W2K8R2 2012-04-26 19:51:08 +02:00
Stefan Metzmacher
f697956dcb dfs_server: add generic dfs_server_ad_get_referrals() call
This is a generic function to implement the domain, dc and sysvol
DFS referrals.

metze
2011-10-08 01:43:38 +02:00