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

99647 Commits

Author SHA1 Message Date
Amitay Isaacs
9aa90482f8 ctdb-daemon: Fix valgrind invalid read error in db_statistics control
==20761== Invalid read of size 8
  ==20761==    at 0x11BE30: ctdb_ctrl_dbstatistics (ctdb_client.c:1286)
  ==20761==    by 0x12BA89: control_dbstatistics (ctdb.c:713)
  ==20761==    by 0x1312E0: main (ctdb.c:6543)
  ==20761==  Address 0x713b0d0 is 0 bytes after a block of size 560 alloc'd
  ==20761==    at 0x4C27A2E: malloc (vg_replace_malloc.c:270)
  ==20761==    by 0x5CB0954: _talloc_memdup (talloc.c:615)
  ==20761==    by 0x11395C: ctdb_control_recv (ctdb_client.c:1146)
  ==20761==    by 0x11BDD7: ctdb_ctrl_dbstatistics (ctdb_client.c:1265)
  ==20761==    by 0x12BA89: control_dbstatistics (ctdb.c:713)
  ==20761==    by 0x1312E0: main (ctdb.c:6543)

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-07-10 20:36:24 +02: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
Stefan Metzmacher
a12c2d0762 script/librelease.sh: use download-master.samba.org:~ftp/pub/ for uploading
master.samba.org might be removed in future.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bj@sernet.de>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jul 10 16:38:20 CEST 2015 on sn-devel-104
2015-07-10 16:38:20 +02:00
Volker Lendecke
8a58a48f86 libsmb: Implement smbc_notify
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul 10 09:35:13 CEST 2015 on sn-devel-104
2015-07-10 09:35:13 +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
Christof Schmitt
57e2c0dfa6 smbcontrol: Set internal log level to 0
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-10 06:33:07 +02:00
Christof Schmitt
5f20813531 smbstatus: Set internal log level to 0
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-10 06:33:07 +02:00
Christof Schmitt
3d920b9525 rpcclient: Set internal log level to 0
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-10 06:33:07 +02:00
Volker Lendecke
fdea2febee rpc_server: Fix CID 1311342 Null pointer dereferences (REVERSE_INULL)
elem was dereferenced already a few lines above

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Jul 10 01:01:36 CEST 2015 on sn-devel-104
2015-07-10 01:01:36 +02:00
Volker Lendecke
fc372110c2 rpc_server: Fix CID 1311341 Integer handling issues (OVERFLOW_BEFORE_WIDEN)
Quoting the full message:

Potentially overflowing expression "total_octets * 8U" with type "unsigned int"
(32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a
context that expects an expression of type "uint64_t" (64 bits, unsigned).

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-09 21:59:20 +02:00
Volker Lendecke
3387969a1f rpc_server: Fix CID 1311340 Null pointer dereferences (NULL_RETURNS)
In practice this might not be relevant, but better be safe.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-09 21:59:20 +02:00
Volker Lendecke
a7c215548a rpc_server: Fix CID 1311339 Error handling issues (CHECKED_RETURN)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-09 21:59:20 +02:00
Volker Lendecke
94288f153d smbd: Fix CID 1311338 Error handling issues (CHECKED_RETURN)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-09 21:59:20 +02:00
Volker Lendecke
080e654ca5 smbd: Fix CID 1311337 Error handling issues (CHECKED_RETURN)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-09 21:59:20 +02:00
Volker Lendecke
ea55b1350b dalloc: Fix CID 1097369 API usage errors (VARARGS)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-09 21:59:20 +02:00
Volker Lendecke
784b6a79b8 dalloc: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-09 21:59:20 +02:00
Christof Schmitt
540899a2d9 dosmode: Change message of result to informational
Logging the returned mode bits should be only "informational" (level 5).

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jul  9 15:36:30 CEST 2015 on sn-devel-104
2015-07-09 15:36:30 +02:00
Christof Schmitt
a7fba97f98 vfs: Change final message in check_reduce_name to "info"
"Informational" is a better description for this message; change the log
level accordingly (level 5).

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09 12:33:25 +02:00
Christof Schmitt
df561a9b66 vfs: Make entry message for check_reduced_name a debug message
The interesting information is already logged later; having an
additional message when entering the function should be only done as
debug message (level 10).

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09 12:33:25 +02:00
Uri Simchoni
ed2ed1ad69 net: fix the order of DC lookup methods when joining a domain
The dsgetdcname() function is able to try just DNS lookup, just NetBIOS,
or start with DNS and fall back to NetBIOS. For "net ads join", we know
most of the time whether the name of the domain we're joining is a DNS
name or a NetBIOS name. In that case, it makes no sense to try both lookup
methods, especially that DNS may fail and we want to fall back from site-aware
DNS lookup to site-less DNS lookup, with no NetBIOS lookup in between.

This change lets "net ads join" tell libnet what is the type of the domain
name, if it is known.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09 12:33:25 +02:00
Uri Simchoni
f9cc2de612 util.c: fix order of inclusion to correctly consume config.h
replace.h has to be the first file included in order to correctly act
upon the definitions in config.h.

Specifically, this change fixes 32-bit i686 builds, which depend upon
_FILE_OFFSET_BITS=64 to be set before any standard library file is
included.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jul  9 12:32:03 CEST 2015 on sn-devel-104
2015-07-09 12:32:03 +02:00
Martin Schwenke
7a9eddd3b1 ctdb-tests: Remove statd-callout when running NFS tests
60.nfs backgrounds it so it persists in the background causing
problems.  In particular, it causes the "ctdb ip" command stub to be
run in parallel, which produces inconstent results.

Better not to run it at all in the NFS tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Jul  9 09:27:02 CEST 2015 on sn-devel-104
2015-07-09 09:27:02 +02:00
Martin Schwenke
0a65013b9d ctdb-scripts: Use an "if" statement instead of "&&"
If statd-callout is unwanted, so is removed, then this code fails.
Change to an "if" so that it succeeds as intended.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-07-09 06:23:21 +02:00
Amitay Isaacs
17b77a99ae ctdb-tests: Refactor code using simple test harness functions
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-07-09 06:23:21 +02:00
Amitay Isaacs
aa9ca809be ctdb-tests: Add test cleanup hooks
To do any cleanup before exiting the test, register hooks with
test_cleanup().  Multiple hooks can be registered.  All the hooks will
be called before exiting from the test.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-07-09 06:23:21 +02:00
Amitay Isaacs
2290e7a01e ctdb-tests: Remove unsed code
This code was copied from onnode unit tests, but not used.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-07-09 06:23:21 +02:00
Amitay Isaacs
13770f7410 ctdb-tests: Remove extra_header and extra_footer variables
This is now achieved by defining functions extra_header() and
extra_footer().

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-07-09 06:23:21 +02:00
Amitay Isaacs
93dc2f0839 ctdb-tests: Add simple test harnesses for running unit tests
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-07-09 06:23:21 +02:00
Uri Simchoni
6cff239a1e docs: Correct list of supported socket options
Bring the list of supported socket options in smb.conf in sync
with the code

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jul  9 03:48:13 CEST 2015 on sn-devel-104
2015-07-09 03:48:13 +02:00
Volker Lendecke
595fbbd85d tdb: Reproducer for Bug 11381
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11381
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09 00:42:16 +02:00
Volker Lendecke
1061a9cafd tdb: Fix bug 11381, deadlock
This fixes a deadlock in tdb that is a bad interaction between tdb_lockall
and tdb_traverse. This deadlock condition has been around even before
tdb mutexes, it's just that the kernel fcntl EDEADLK detection protected
us from this ABBA lock condition to become a real deadlock stalling
processes. With tdb mutexes, this deadlock protection is gone, so we do
lock dead.

This patch glosses over this particular ABBA condition, making tdb with
mutexes behave the same as tdb without mutexes. Admittedly this is no
real fix, but it works around a real user's problem.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11381
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09 00:42:15 +02:00
Volker Lendecke
be9c4f9033 librpc: Fix a "ignoring asprint return" warning
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09 00:42:15 +02:00
Douglas Bagnall
4e935c5951 Fix format size errors for i386 in source3/librpc/crypto/gse.c
Again, sizeof(size_t) != sizeof(uintmax_t).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09 00:42:15 +02:00
Douglas Bagnall
9658112e10 Fix ldap_bind compilation for i386
More size_t != uintmax_t issues:

../source4/libcli/ldap/ldap_bind.c: In function ‘ldap_bind_sasl’:
../source4/libcli/ldap/ldap_bind.c:237:3: error: format ‘%ju’ expects argument of type ‘uintmax_t’, but argument 2 has type ‘size_t’ [-Werror=format=]

   DEBUG(1, ("SASL bind triggered with non empty send_queue[%ju]: %s\n",
      ^
      cc1: all warnings being treated as errors

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09 00:42:15 +02:00
Douglas Bagnall
3e35e0d6f8 Fix gensec_gssapi compilation for i386
Fixes this:

../source4/auth/gensec/gensec_gssapi.c:1017:3: error: format ‘%ju’ expects argument of type ‘uintmax_t’, but argument 3 has type ‘size_t’ [-Werror=format=]

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09 00:42:15 +02:00
Stefan Metzmacher
7447abc44c s4:torture/rpc: extend and improve rpc.lsa.trusted.domains
This adds a lot more validation arround trust credentials and
krb5 interaction.

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

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jul  8 21:41:17 CEST 2015 on sn-devel-104
2015-07-08 21:41:17 +02:00
Stefan Metzmacher
d9d670713b s4:torture/rpc: add missing \n in comments
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
84b0d1f967 s4:torture/rpc: handle NT_STATUS_NO_SUCH_DOMAIN in test_query_each_TrustDom()
lsa_EnumTrusts() may also return non direct trusted domains in the forest.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
80be365e62 testprogs/blackbox: add test_trust_utils.sh
This tests 'samba-tool domain trust *' commands.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
03fc85e39b testprogs/blackbox: let test_kinit_trusts.sh verify that setpassword (via LDAP) is rejected
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
b2ad31ac0d testprogs/blackbox: let test_kinit_trusts.sh test a enterprise upn from the other foreset
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
7605c5d6e8 selftest/Samba4: setup forest UPN and SPN namespaces for ad_dc and fl2008r2dc
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
7ee4f23821 testprogs/blackbox: add test_kinit_trusts.sh
That verifies kinit and smbclient work across trusts.

It also tests a trust password change and a following
access.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
90956d6088 selftest/Samba4: setup trusts between forest:fl2008r2dc/ad_dc and externl:fl2003dc/ad_dc
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
cab82ebda7 samba-tool: add 'domain trust *' commands
Available subcommands:
  create      - Create a domain or forest trust.
  delete      - Delete a domain trust.
  list        - List domain trusts.
  namespaces  - Manage forest trust namespaces.
  show        - Show trusted domain details.
  validate    - Validate a domain trust.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
41f08b1964 python/samba: add on optional 'special_name' argument to CredentialsOptions()
This way we have have two sets or credentials on the command line,
while at least one uses some prefix (special_name) for the arguments.

The default options without special_name are:

  Credentials Options:
    --simple-bind-dn=DN
                        DN to use for a simple bind
    --password=PASSWORD
                        Password
    -U USERNAME, --username=USERNAME
                        Username
    -W WORKGROUP, --workgroup=WORKGROUP
                        Workgroup
    -N, --no-pass       Don't ask for a password
    -k KERBEROS, --kerberos=KERBEROS
                        Use Kerberos
    --ipaddress=IPADDRESS
                        IP address of server
    -P, --machine-pass  Use stored machine account password

With special_name='local-dc' it's:

  Credentials Options (local-dc):
    --local-dc-simple-bind-dn=DN
                        DN to use for a simple bind
    --local-dc-password=PASSWORD
                        Password
    --local-dc-username=USERNAME
                        Username
    --local-dc-workgroup=WORKGROUP
                        Workgroup
    --local-dc-no-pass  Don't ask for a password
    --local-dc-kerberos=KERBEROS
                        Use Kerberos
    --local-dc-ipaddress=IPADDRESS
                        IP address of server
    --local-dc-machine-pass
                        Use stored machine account password

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
3dd3338018 python/samba: add current_unix_time()
This is needed to get the time from modules in python/samba/netcmd/
where a time.py exist.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
fcc6b5c56a s4:rpc_server/netlogon: check domain state in netr_*GetForestTrustInformation()
This should only work on a forest root domain controller and a forest function
level >= 2003.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00