samba.git
9 years agoVERSION: Disable git snapshots for the 4.0.20 release. samba-4.0.20
Karolin Seeger [Mon, 28 Jul 2014 19:08:21 +0000 (21:08 +0200)]
VERSION: Disable git snapshots for the 4.0.20 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoWHATSNEW: Add release notes for Samba 4.0.20.
Karolin Seeger [Mon, 28 Jul 2014 19:07:19 +0000 (21:07 +0200)]
WHATSNEW: Add release notes for Samba 4.0.20.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoldb-samba: fix a memory leak in ldif_canonicalise_objectCategory()
Stefan Metzmacher [Wed, 16 Jul 2014 14:17:56 +0000 (16:17 +0200)]
ldb-samba: fix a memory leak in ldif_canonicalise_objectCategory()

Searches for '(objectCategory=Person)' will leak a ldb_dn structure
on the ldb_context. These searches are typically used by Zarafa.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jul 17 00:51:57 CEST 2014 on sn-devel-104

(cherry picked from commit 8d33cddcb001a5a78aca036161d6223268274211)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu Jul 17 23:07:24 CEST 2014 on sn-devel-104

9 years agos3: SMB2 : Fix leak of blocking lock records in the database.
Jeremy Allison [Thu, 26 Jun 2014 19:08:46 +0000 (12:08 -0700)]
s3: SMB2 : Fix leak of blocking lock records in the database.

Based on a fix from Hemanth Thummala <hemanth.thummala@gmail.com>
Bug #10673 - Increasing response times for byte range unlock requests.

The previous refactoring makes it obvious we need to call
remove_pending_lock() in all places where we are returning
from the SMB2 blocking lock call.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jun 30 14:59:16 CEST 2014 on sn-devel-104

(cherry picked from commit cee1531e551e5ccd5ccd4a55de226ad686919486)

9 years agos3: smb2: Simplify logic in reprocess_blocked_smb2_lock().
Jeremy Allison [Thu, 26 Jun 2014 19:01:56 +0000 (12:01 -0700)]
s3: smb2: Simplify logic in reprocess_blocked_smb2_lock().

SMB2 blocking locks can only have one lock per request, so
there can never be any other locks to wait for.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 1a02a1e6aa15c028a848585d66cecbbdda8015b3)

9 years agos3: smb2: Remove unused code from remove_pending_lock().
Jeremy Allison [Thu, 26 Jun 2014 00:10:45 +0000 (17:10 -0700)]
s3: smb2: Remove unused code from remove_pending_lock().

SMB2 blocking locks can only have one lock per request, so
there can never be any previous locks to remove.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 508c09c6a019458bb0290fbf284e73c24feddb0e)

9 years agoselftest: teardown the environments also on getting SIGPIPE
Stefan Metzmacher [Thu, 10 Jul 2014 12:28:56 +0000 (14:28 +0200)]
selftest: teardown the environments also on getting SIGPIPE

make test uses

selftest.pl | subuntu-filter.py ...

FAIL_IMMEDIATELY=1 lets subuntu-filter.py exit,
which generates SIGPIPE in selftest.pl.

We should handle this just like any other signal
and teardown all environments.

This should make the teardown process more reliable/verbose.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit b2803950fc439017680069813fc49255a3f0cbbf)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10696
backport autobuild/selftest fixes from master

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue Jul 15 14:34:31 CEST 2014 on sn-devel-104

9 years agolibwbclient: allow only one initial_blob/challenge_blob in wbcCredentialCache()
Stefan Metzmacher [Thu, 10 Jul 2014 03:28:36 +0000 (05:28 +0200)]
libwbclient: allow only one initial_blob/challenge_blob in wbcCredentialCache()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3: libwbclient: Don't break out of loop too soon - find all parameters.
Jeremy Allison [Tue, 8 Jul 2014 23:36:30 +0000 (16:36 -0700)]
s3: libwbclient: Don't break out of loop too soon - find all parameters.

Fix bug #10692: wbcCredentialCache fails if challenge_blob is not first

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

Signed-off-by: Jeremy Allison <jra@samba.org>
9 years agos3:smb2_read: let smb2_sendfile_send_data() behave like send_file_readX()
Stefan Metzmacher [Thu, 10 Jul 2014 19:08:06 +0000 (21:08 +0200)]
s3:smb2_read: let smb2_sendfile_send_data() behave like send_file_readX()

We now pass the header to SMB_VFS_SENDFILE(), so we have to handle that also
in the fallback code.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul 11 22:57:17 CEST 2014 on sn-devel-104

(cherry picked from commit 7c5ea400ad1f280f5c338c31a0a893154340fdb3)

9 years agotorture4: Make raw.lock.multilock fail after 20 seconds
Volker Lendecke [Thu, 3 Jul 2014 10:05:55 +0000 (10:05 +0000)]
torture4: Make raw.lock.multilock fail after 20 seconds

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  4 00:04:10 CEST 2014 on sn-devel-104

(cherry picked from commit 0c97b7eb5359b95c0d51a3b5524e82e34243d2d1)

The last 7 patches address bug #10684 - SMB1 blocking locks can fail
notification on unlock, causing client timeout.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Sun Jul 13 23:35:54 CEST 2014 on sn-devel-104

9 years agotorture4: Adapt comment to code
Volker Lendecke [Thu, 3 Jul 2014 10:05:39 +0000 (10:05 +0000)]
torture4: Adapt comment to code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 4205463ef1815d6e86e1d1f1f57651ca30407469)

9 years agos4: smbtorture: Add multi-lock test. Regression test for bug #10684.
Jeremy Allison [Tue, 1 Jul 2014 19:05:07 +0000 (12:05 -0700)]
s4: smbtorture: Add multi-lock test. Regression test for bug #10684.

Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
(cherry picked from commit 64346a134dac2bd023f7473202ca38d35ffd3c89)

9 years agos3: smbd: Locking - re-add pending lock records if we fail to acquire a lock (and...
Jeremy Allison [Thu, 3 Jul 2014 03:51:24 +0000 (20:51 -0700)]
s3: smbd: Locking - re-add pending lock records if we fail to acquire a lock (and the lock hasn't timed out).

Keep the blocking lock record and the pending lock records consistent
if we are dealing with multiple blocking lock requests in one SMB1 LockingX
request.

Ensure we re-add the records under the record lock, to avoid race
conditions.

Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
(cherry picked from commit 954401f8b2b16b3e2ef9655e8ce94d657becce36)

9 years agos3: smbd: Locking - treat lock timeout the same as any other error.
Jeremy Allison [Thu, 3 Jul 2014 03:40:49 +0000 (20:40 -0700)]
s3: smbd: Locking - treat lock timeout the same as any other error.

Allows the special case in process_blocking_lock_queue()
that talks back to the client to be removed.

Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
(cherry picked from commit cc9de6eb091159a84228b988c49261c46c301233)

9 years agos3: smbd: Locking - add and use utility function lock_timed_out().
Jeremy Allison [Thu, 3 Jul 2014 03:18:42 +0000 (20:18 -0700)]
s3: smbd: Locking - add and use utility function lock_timed_out().

Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
(cherry picked from commit 12be57ef3b2d1b670be7a83f29cd580938030015)

9 years agos3: smbd: Locking - convert to using utility macro used elsewhere.
Jeremy Allison [Thu, 3 Jul 2014 00:25:22 +0000 (17:25 -0700)]
s3: smbd: Locking - convert to using utility macro used elsewhere.

Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
(cherry picked from commit 517fa80bd385c6adcfee03ea6b25599013ad88f5)

9 years agonet/doc: make clear that net vampire is for NT4 domains only
Björn Jacke [Fri, 13 Jun 2014 12:14:41 +0000 (14:14 +0200)]
net/doc: make clear that net vampire is for NT4 domains only

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

Signed-off-by: Bjoern Jacke <bj@sernet.de>
9 years agoselftest/subunithelper.py: correctly pass testsuite-uxsuccess to end_testsuite()
Stefan Metzmacher [Wed, 12 Mar 2014 14:12:42 +0000 (15:12 +0100)]
selftest/subunithelper.py: correctly pass testsuite-uxsuccess to end_testsuite()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 13 23:49:36 CET 2014 on sn-devel-104

(cherry picked from commit 3632c59e250396b3974bccf7ad74cbe5c84fdba3)

The last 4 patches address bug #10696 - backport autobuild/selftest fixes from
master.

9 years agoselftest/subunithelper.py: correctly handle fail_immediately in end_testsuite of...
Stefan Metzmacher [Wed, 12 Mar 2014 14:12:42 +0000 (15:12 +0100)]
selftest/subunithelper.py: correctly handle fail_immediately in end_testsuite of FilterOps

This way --fail-immediately also works if a command segfaults.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit fee156f5b9235b5f766cb773433ddb7d0ccd98a1)

9 years agoselftest/subunithelper.py: correctly handle unexpected success in FilterOps
Stefan Metzmacher [Wed, 12 Mar 2014 14:12:42 +0000 (15:12 +0100)]
selftest/subunithelper.py: correctly handle unexpected success in FilterOps

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 14246953b2e91578e5f51faedfdf31926a5b1950)

9 years agoscript/autobuild: use --force-rebase option
Stefan Metzmacher [Mon, 17 Feb 2014 08:15:30 +0000 (09:15 +0100)]
script/autobuild: use --force-rebase option

This makes sure the current user will be the committer.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit ab9f02193188af8e482052ee6b55c30aac2c8340)

9 years agotorture3: Fix bug 10687
Volker Lendecke [Wed, 2 Jul 2014 14:27:52 +0000 (14:27 +0000)]
torture3: Fix bug 10687

'RW2' smbtorture test fails when -N <numprocs> is set to 2 due to the invalid
status check in the second client.

Signed-off-by: Volker Lendecke <vl@samba.org>
Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Fri Jul 11 12:02:38 CEST 2014 on sn-devel-104

9 years agosmbd: Avoid double-free in get_print_db_byname
Volker Lendecke [Tue, 8 Jul 2014 12:30:54 +0000 (14:30 +0200)]
smbd: Avoid double-free in get_print_db_byname

Signed-off-by: Volker Lendecke <vl@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10699

9 years agos3: smbd: Locking, fix off-by one calculation in brl_pending_overlap().
Jeremy Allison [Tue, 1 Jul 2014 20:30:50 +0000 (13:30 -0700)]
s3: smbd: Locking, fix off-by one calculation in brl_pending_overlap().

Consider:

lock = start=110,size=10
pend_lock = 100, size=10

Should not overlap. However,

(lock->start <= pend_lock->start + pend_lock->size)
     110             100                10

is true, so it returns true (overlap).

lock->start <= pend_lock->start + pend_lock->size

should be:

lock->start < pend_lock->start + pend_lock->size

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

Signed-off-by: Jeremy Allison <jra@samba.org>
9 years agosmbstatus: Fix an uninitialized variable
Volker Lendecke [Sun, 29 Jun 2014 08:56:03 +0000 (08:56 +0000)]
smbstatus: Fix an uninitialized variable

We only print valid share mode entries, stale ones don't count. In
traverse, let the callback decide about staleness.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 9f2e90754bcb7bf5f7159d07f0bc5fe754e71bf5)

9 years agos3:winbindd - fix bad bugfix for bug #10280 - winbind panic if AD server is down.
Jeremy Allison [Wed, 2 Jul 2014 03:27:11 +0000 (20:27 -0700)]
s3:winbindd - fix bad bugfix for bug #10280 - winbind panic if AD server is down.

Previous bug fix reversed the sense of the test for out of memory.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon Jul  7 12:37:48 CEST 2014 on sn-devel-104

9 years agos3/s4: smbd, rpc, ldap, cldap, kdc services.
Jeremy Allison [Tue, 10 Jun 2014 17:48:30 +0000 (10:48 -0700)]
s3/s4: smbd, rpc, ldap, cldap, kdc services.

Allow us to start if we bind to *either* :: or 0.0.0.0.

Allows us to cope with systems configured as only IPv4
or only IPv6.

Back-port to 4.0.x.

Bug #10653 - Samba won't start on a machine configured with only IPv4.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue Jul  1 11:23:13 CEST 2014 on sn-devel-104

9 years agomsg_channel: Fix a 100% CPU loop
Volker Lendecke [Tue, 10 Jun 2014 14:21:07 +0000 (14:21 +0000)]
msg_channel: Fix a 100% CPU loop

In a ctdb setup, msg_read_got_ctdb did not set channel->pending_req to
NULL. In smbXsrv_session_close_loop in any error condition this leads to
a 100% loop. smbXsrv_session_close_loop continously retries, but because
close_channel->pending_req is != NULL, msg_read_send will always return
EBUSY, making smbXsrv_session_close_loop retry infinitely.

This patch makes sure that msg_read_got_ctdb correctly NULLs out pending_req.

msg_channel.c does not exist in master anymore, so this patch is 4.1 only.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10663
100% smbd cpu loop in ctdb setups

9 years agoautobuild: delete $NSS_MODULES in "make clean"
Björn Jacke [Tue, 10 Jun 2014 13:51:58 +0000 (15:51 +0200)]
autobuild: delete $NSS_MODULES in "make clean"

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

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoVERSION: Bump version up to 4.0.20.
Karolin Seeger [Mon, 23 Jun 2014 09:25:09 +0000 (11:25 +0200)]
VERSION: Bump version up to 4.0.20.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoMerge tag 'samba-4.0.19' into v4-0-test
Karolin Seeger [Mon, 23 Jun 2014 09:24:48 +0000 (11:24 +0200)]
Merge tag 'samba-4.0.19' into v4-0-test

samba: tag release samba-4.0.19

9 years agoVERSION: Disable git snapshot for the 4.0.19 release. samba-4.0.19
Karolin Seeger [Sun, 22 Jun 2014 15:03:05 +0000 (17:03 +0200)]
VERSION: Disable git snapshot for the 4.0.19 release.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10633
CVE-2014-0244: nmbd denial of service

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10654
CVE-2014-3493: Segmentation fault in smbd_marshall_dir_entry()'s
SMB_FIND_FILE_UNIX handler because push_ascii() has returned(uint32_t)-1
via srvstr_push(), incrementing p by 4GB

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoWHATSNEW: Add release notes for Samba 4.0.19.
Karolin Seeger [Sun, 22 Jun 2014 15:01:56 +0000 (17:01 +0200)]
WHATSNEW: Add release notes for Samba 4.0.19.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10633
CVE-2014-0244: nmbd denial of service

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10654
CVE-2014-3493: Segmentation fault in smbd_marshall_dir_entry()'s
SMB_FIND_FILE_UNIX handler because push_ascii() has returned(uint32_t)-1
via srvstr_push(), incrementing p by 4GB

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agos3: smbd - fix processing of packets with invalid DOS charset conversions.
Jeremy Allison [Sun, 8 Jun 2014 04:51:44 +0000 (21:51 -0700)]
s3: smbd - fix processing of packets with invalid DOS charset conversions.

Bug 10654 - Segmentation fault in smbd_marshall_dir_entry()'s SMB_FIND_FILE_UNIX handler

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

Signed-off-by: Jeremy Allison <jra@samba.org>
CVE-2014-3493

9 years agos3: nmbd: Fix bug 10633 - nmbd denial of service
Jeremy Allison [Wed, 28 May 2014 17:40:27 +0000 (10:40 -0700)]
s3: nmbd: Fix bug 10633 - nmbd denial of service

The Linux kernel has a bug in that it can give spurious
wakeups on a non-blocking UDP socket for a non-deliverable packet.

When nmbd was changed to use non-blocking sockets it
became vulnerable to a spurious wakeup from poll/epoll.

Fix sys_recvfile() to return on EWOULDBLOCK/EAGAIN.

CVE-2014-0244

Signed-off-by: Jeremy Allison <jra@samba.org>
9 years agoVERSION: Bump version up to 4.0.19...
Karolin Seeger [Sun, 22 Jun 2014 14:54:46 +0000 (16:54 +0200)]
VERSION: Bump version up to 4.0.19...

and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agowinbindd: Ensure we do not look at rid_array before checking if it was returned
Andrew Bartlett [Fri, 28 Mar 2014 03:30:28 +0000 (16:30 +1300)]
winbindd: Ensure we do not look at rid_array before checking if it was returned

We no longer return early if there are no members, we just return an empty array.

Fixes bug #10627 - rid_array used before status checked - segmentation fault due to null pointer dereference

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

Change-Id: I7b0949e0c0b9277426a8007514a8658615f6c709
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Wed Jun 11 11:40:38 CEST 2014 on sn-devel-104

9 years agoprinting: fix purge of all print jobs
David Disseldorp [Wed, 21 May 2014 19:55:58 +0000 (21:55 +0200)]
printing: fix purge of all print jobs

The incorrect (system) jobid is currently passed to the job deletion
function.

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

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit efb4684a3fc0b32a71eab013000f730e6b144a67)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue Jun  3 10:53:33 CEST 2014 on sn-devel-104

9 years agos3: smb2: Move from using SBVAL to put NTTIMEs on the wire to put_long_date_timespec.
Jeremy Allison [Wed, 21 May 2014 18:57:16 +0000 (11:57 -0700)]
s3: smb2: Move from using SBVAL to put NTTIMEs on the wire to put_long_date_timespec.

put_long_date_timespec() correctly calls round_timespec()
on the time parameters, and is the correct function to
use when writing *any* file-based NTTIME on the wire.

Move from using NTTIME variables internally
in the server to struct timespec variables, which is
what all the other server code uses. Only map to
NTTIME as the last step of marshalling the output
data.

The previous SMB2 create code missed the round_timespec()
call before marshalling.

Bug 3124 - xcopy /d with samba shares works not as aspected

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

which is a regression from a long-ago bug with
SMB1.

Signed-off-by: Jeremy Allison <jra@samba.org>
9 years agos3: smb2: Move from using SBVAL to put NTTIMEs on the wire to put_long_date_timespec.
Jeremy Allison [Wed, 21 May 2014 18:31:44 +0000 (11:31 -0700)]
s3: smb2: Move from using SBVAL to put NTTIMEs on the wire to put_long_date_timespec.

put_long_date_timespec() correctly calls round_timespec()
on the time parameters, and is the correct function to
use when writing *any* file-based NTTIME on the wire.

The smb2_close() code being modified already did this by
hand, and so this doesn't change any of the functionality, only
makes the SMB2 code match all of the other server
code in Samba. Move from using NTTIME variables internally
in the server to struct timespec variables, which is
what all the other server code uses. Only map to
NTTIME as the last step of marshalling the output
data.

Not following the put_long_date_timespec()
convention in the SMB2 create code caused the
round_timespec() step to have been missed in
that code - thus bug:

Bug 3124 - xcopy /d with samba shares works not as aspected

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

which is a regression from a long-ago bug with
SMB1.

Signed-off-by: Jeremy Allison <jra@samba.org>
9 years agoVERSION: Bump version number up to 4.0.19...
Karolin Seeger [Tue, 27 May 2014 17:18:37 +0000 (19:18 +0200)]
VERSION: Bump version number up to 4.0.19...

and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoVERSION: Disable git snapshots for the 4.0.18 release. samba-4.0.18
Karolin Seeger [Tue, 27 May 2014 12:03:28 +0000 (14:03 +0200)]
VERSION: Disable git snapshots for the 4.0.18 release.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10549
CVE-2014-0178: Malformed FSCTL_SRV_ENUMERATE_SNAPSHOTS response

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10609
CVE-2014-0239: DOS in DNS server packet handling

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoWHATSNEW: Add release notes for Samba 4.0.18.
Karolin Seeger [Tue, 27 May 2014 12:02:02 +0000 (14:02 +0200)]
WHATSNEW: Add release notes for Samba 4.0.18.

CVE-2014-0239 Don't reply to replies
CVE-2014-0178: Malformed FSCTL_SRV_ENUMERATE_SNAPSHOTS response

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agobug #10609: CVE-2014-0239 Don't reply to replies
Kai Blin [Tue, 13 May 2014 06:13:29 +0000 (08:13 +0200)]
bug #10609: CVE-2014-0239 Don't reply to replies

Due to insufficient input checking, the DNS server will reply to a packet that
has the "reply" bit set. Over UDP, this allows to send a packet with a spoofed
sender address and have two servers DOS each other with circular replies.

This patch fixes bug #10609 and adds a test to make sure we don't regress.
CVE-2014-2039 has been assigned to this issue.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10609

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Tue May 20 04:15:44 CEST 2014 on sn-devel-104

(cherry picked from commit 392ec4d241eb19c812cd49ff73bd32b2b09d8533)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon May 26 14:54:32 CEST 2014 on sn-devel-104

9 years agopidl/lib/wscript_build: make use of PERL_LIB_INSTALL_DIR
Stefan Metzmacher [Fri, 9 May 2014 09:49:10 +0000 (11:49 +0200)]
pidl/lib/wscript_build: make use of PERL_LIB_INSTALL_DIR

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat May 10 01:37:33 CEST 2014 on sn-devel-104
(cherry picked from commit cf75ef9f73f2cdbf2a039bbc9468f5da6a14834e)

9 years agoscript/autobuild: make use of --with-perl-{arch,lib}-install-dir
Stefan Metzmacher [Fri, 9 May 2014 09:48:26 +0000 (11:48 +0200)]
script/autobuild: make use of --with-perl-{arch,lib}-install-dir

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit d18ee9e4b6f4c9a24b555c111e08396012c1755a)

9 years agowafsamba: Fail with error message if perl doesn't provide valid dirs.
Stefan Metzmacher [Fri, 9 May 2014 07:42:23 +0000 (09:42 +0200)]
wafsamba: Fail with error message if perl doesn't provide valid dirs.

We try harder to get valid directories, we now fallback like this:

vendorarch => sitearch => archlib
and
vendorlib => sitelib => privlib

The new options are --with-perl-arch-install-dir and
--with-perl-lib-install-dir.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 2637890ef42a238093f0f3cbdda0d621d5f9b2e2)

9 years agowafsamba: If perl can't provide defaults, define them.
Andreas Schneider [Tue, 15 Apr 2014 08:24:24 +0000 (10:24 +0200)]
wafsamba: If perl can't provide defaults, define them.

This should fix the installation on FreeBSD.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu May  8 13:55:50 CEST 2014 on sn-devel-104
(cherry picked from commit 0ba276ebad57d75a769e22414f94acbe8c177d97)

9 years agoFSCTL_GET_SHADOW_COPY_DATA: Don't return 4 extra bytes at end
Christof Schmitt [Mon, 5 Aug 2013 18:21:59 +0000 (11:21 -0700)]
FSCTL_GET_SHADOW_COPY_DATA: Don't return 4 extra bytes at end

labels_data_count already accounts for the unicode null character at the
end of the array. There is no need in adding space for it again.

Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug  6 04:03:17 CEST 2013 on sn-devel-104

(cherry picked from commit eb50fb8f3bf670bd7d1cf8fd4368ef4a73083696)

The last 2 patches address bug #10549 - CVE-2014-0178: Malformed
FSCTL_SRV_ENUMERATE_SNAPSHOTS response.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon May 19 14:29:18 CEST 2014 on sn-devel-104

9 years agoFSCTL_GET_SHADOW_COPY_DATA: Initialize output array to zero
Christof Schmitt [Mon, 5 Aug 2013 18:16:22 +0000 (11:16 -0700)]
FSCTL_GET_SHADOW_COPY_DATA: Initialize output array to zero

Otherwise num_volumes and the end marker can return uninitialized data
to the client.

Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
(cherry picked from commit 30e724cbff1ecd90e5a676831902d1e41ec1b347)

9 years agos3: smbd : Fix wildcard unlink to fail if we get an error rather than trying to continue.
Jeremy Allison [Tue, 29 Apr 2014 23:59:55 +0000 (16:59 -0700)]
s3: smbd : Fix wildcard unlink to fail if we get an error rather than trying to continue.

This can break smbd if we end up leaving a SHARING_VIOLATION
retry record on the queue.

Signed-off-by: Jeremy Allison <jra@samba.org>
Fix bug #10577 - SMB1 wildcard unlink fail can leave a retry record on the open
retry queue.

9 years agos3: smbd: Remove open_file_fchmod().
Jeremy Allison [Thu, 1 May 2014 18:11:20 +0000 (11:11 -0700)]
s3: smbd: Remove open_file_fchmod().

No longer used (hurrah!).

Bug 10564 - Lock order violation and file lost

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May  2 23:47:38 CEST 2014 on sn-devel-104

9 years agos3: smbd: change file_set_dosmode() to use get_file_handle_for_metadata() instead...
Jeremy Allison [Thu, 1 May 2014 18:07:44 +0000 (11:07 -0700)]
s3: smbd: change file_set_dosmode() to use get_file_handle_for_metadata() instead of open_file_fchmod().

get_file_handle_for_metadata() is a new function that
finds an existing open handle (fsp->fh->fd != -1) for
a given dev/ino if there is one available, and uses
INTERNAL_OPEN_ONLY with WRITE_DATA access if not.

Allows open_file_fchmod() to be removed next.

Bug 10564 - Lock order violation and file lost

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
9 years agos3: smbd : Ensure file_new doesn't call into smbXsrv_open_create() for INTERNAL_OPEN_...
Jeremy Allison [Thu, 1 May 2014 18:01:03 +0000 (11:01 -0700)]
s3: smbd : Ensure file_new doesn't call into smbXsrv_open_create() for INTERNAL_OPEN_ONLY.

This causes deadlocks which cause smbd to crash if the locking
database has already been locked for a compound operation we
need to be atomic (as in the file rename case).

Ensure INTERNAL_OPEN_ONLY opens are synonymous with req==NULL.

INTERNAL_OPEN_ONLY opens leave a NO_OPLOCK record in
the share mode database, so they can be detected by other
processes for share mode violation purposes (because
they're doing an operation on the file that may include
reads or writes they need to have real state inside the
locking database) but have an fnum of FNUM_FIELD_INVALID
and a local share_file_id of zero, as they will never be
seen on the wire.

Ensure validate_my_share_entries() ignores
INTERNAL_OPEN_ONLY records (share_file_id == 0).

Bug 10564 - Lock order violation and file lost

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
9 years agos3 : smbd : Protect all possible code paths from fsp->op == NULL.
Jeremy Allison [Thu, 1 May 2014 17:58:51 +0000 (10:58 -0700)]
s3 : smbd : Protect all possible code paths from fsp->op == NULL.

In changes to come this will be possible for an INTERNAL_OPEN_ONLY.
The protection was already in place for some code paths, this
makes the coverage compete.

Bug 10564 - Lock order violation and file lost

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 years agobyteorder: do not assume PowerPC is big-endian
David Disseldorp [Mon, 5 May 2014 11:42:36 +0000 (13:42 +0200)]
byteorder: do not assume PowerPC is big-endian

byteorder.h currently uses reverse-indexing ASM instructions for little
endian multi-byte storage/retrieval on PowerPC. With Power8 this is an
incorrect assumption, as it can be big or little endian.

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
(cherry picked from commit 5bf6ed5ebd0dc5ecdc5bcfb1d4720e9251849adc)

9 years agoFix an empty if statement.
Jose A. Rivera [Mon, 5 May 2014 11:46:58 +0000 (06:46 -0500)]
Fix an empty if statement.

Primarily following the precedent set by other uses of composite_is_ok(), but
also making sure nothing tries to use c after this point if it is in fact not
ok.

Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Fix bug #10348 - Empty body in if-statement in continue_domain_open_lookup.

9 years agoMinor typo fix in source3/wscript.
Jose A. Rivera [Mon, 5 May 2014 12:29:57 +0000 (07:29 -0500)]
Minor typo fix in source3/wscript.

Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon May  5 22:41:19 CEST 2014 on sn-devel-104

Fix bug #10151 - Extra ':' in msg for Waf Cross Compile Build System with
Cross-answers command.

10 years agos3: smbd - smb1 - fix read of deleted memory in reply_writeclose().
Noel Power [Thu, 27 Feb 2014 20:07:11 +0000 (12:07 -0800)]
s3: smbd - smb1 - fix read of deleted memory in reply_writeclose().

While running smbtorture test raw.write under valgrind an "Invalid read"
was reported in methid reply_writeclose, it seems after closing a file
sometime later we try to access it again.

Signed-off-by: Noel Power <noel.power@suse.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Mar  3 20:42:40 CET 2014 on sn-devel-104
(cherry picked from commit 04e434661fa6b5f13776f925b0a7cbadb6b6d006)

Fix bug #10554 - request backport for 'smb1 - fix read of deleted memory in
reply_writeclose()'.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Fri May  2 15:39:19 CEST 2014 on sn-devel-104

10 years agolib-util: rename memdup to smb_memdup and fix all callers (bug #10556)
Björn Baumbach [Mon, 14 Apr 2014 12:37:29 +0000 (14:37 +0200)]
lib-util: rename memdup to smb_memdup and fix all callers (bug #10556)

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit fae7e5d771d1c69bded1189b23335647023fa0f7)

Conflicts:
ctdb/lib/util/util.h

Also renamed memdup() in source3/locking/brlock.c

10 years agobuild: fix ordering problems with lib-provided and internal RPATHs
Michael Adam [Wed, 16 Oct 2013 13:17:18 +0000 (15:17 +0200)]
build: fix ordering problems with lib-provided and internal RPATHs

When a library or system (like cups) provides an RPATH,
e.g. with -Wl,-R or -Wl,-rpath, this was added by waf
to the LINKFLAGS, wich was later prepended to our RPATH.
But if the path by chance contains an older version of
one of our internal libraries like talloc, this would lead
to linking the too old talloc into our binaries.

This has been observed on, e.g., FreeBSD, but it is a general
problem.

This patch fixes the problem by specially parsing the RPATH
linker options from the pkg-config(, cups-config, ....) output
and putting the paths into the RPATH_<lib> container, which
is then later correctly appended to our internal RPATH.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 64f5e24100a764ec198cab9a8d2c43fa86e7027c)

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

10 years agoRevert "tevent: fix crash bug in tevent_queue_immediate_trigger()"
Karolin Seeger [Tue, 29 Apr 2014 08:23:03 +0000 (10:23 +0200)]
Revert "tevent: fix crash bug in tevent_queue_immediate_trigger()"

This reverts commit fc185a5f4cb34f4a2488eb336844c32812f930e7.

See https://bugzilla.samba.org/show_bug.cgi?id=10344 for details.

Stefan (metze) Metzmacher 2014-04-11 07:28:18 UTC

Karolin, please revert fc185a5f4cb34f4a2488eb336844c32812f930e7 in v4-0-test,
this somehow went in twice. 87a02403ee4fcc404dc3b887a851c421660cb4d8 is the
first commit.

It's not a real problem to have the same check twice, but it's a bit confusing
and may generate problems with future backports.

10 years agos3-lib/util: fix logic inside set_namearray loops.
Jeremy Allison [Tue, 8 Apr 2014 17:38:33 +0000 (10:38 -0700)]
s3-lib/util: fix logic inside set_namearray loops.

Additional fix for bug #10544 - s3-lib/util: set_namearray reads across end of namelist string.

Not strictly needed as the initial fix addresses
the problem, but corrects the internal logic
inside the loops.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 4f59580331b934b183c3344da57f2002d88d4512)

10 years agos3-lib/util: fix read across end of namelist string
Björn Baumbach [Mon, 7 Apr 2014 11:46:42 +0000 (13:46 +0200)]
s3-lib/util: fix read across end of namelist string

If the namelist is not terminated with a '/', we try to read
the next character after the string termination '\0'.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Apr  8 21:44:16 CEST 2014 on sn-devel-104
(cherry picked from commit 8f46b130c5c796d66d26982f5cd99c52f7c8ece1)

Fix bug #10544 - s3-lib/util: set_namearray reads across end of namelist
string.

10 years agos3-nmbd: reset debug settings after reading config file (bug #10239)
Björn Baumbach [Wed, 19 Mar 2014 14:01:11 +0000 (15:01 +0100)]
s3-nmbd: reset debug settings after reading config file (bug #10239)

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 25 18:29:06 CET 2014 on sn-devel-104

(cherry picked from commit a7df00c82049547129f063a40a842b156c8aead4)

10 years agoVERSION: Bump version number up to 4.0.18...
Karolin Seeger [Thu, 10 Apr 2014 09:52:52 +0000 (11:52 +0200)]
VERSION: Bump version number up to 4.0.18...

and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoWHATSNEW: Add release notes for Samba 4.0.17. samba-4.0.17
Karolin Seeger [Thu, 10 Apr 2014 09:41:12 +0000 (11:41 +0200)]
WHATSNEW: Add release notes for Samba 4.0.17.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agos3: messages: Implement cleanup of dead records.
Jeremy Allison [Wed, 2 Apr 2014 23:45:25 +0000 (16:45 -0700)]
s3: messages: Implement cleanup of dead records.

When a smbd process dies, pending messages.tdb records for this process
might not get cleaned up. Implement a cleanup for dead records that is
triggered after a smbd dies uncleanly; the records for that PID are
deleted.

Based on a patchset from Christof Schmitt <cs@samba.org>.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
(cherry picked from commit 837671f47670b16726aa96ba7a0902974a1037eb)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10534
Cleanup messages.tdb record after unclean smbd shutdown

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon Apr  7 11:55:50 CEST 2014 on sn-devel-104

10 years agos3: smbd: Ensure we always go via getgroups_unix_user() when creating an NT token.
Jeremy Allison [Tue, 25 Mar 2014 15:47:39 +0000 (08:47 -0700)]
s3: smbd: Ensure we always go via getgroups_unix_user() when creating an NT token.

This has to be done in every code path that creates
an NT token, as remote users may have been added to
the local /etc/group database. Tokens created merely
from the info3 structs (via the DC or via the krb5 PAC)
won't have these local groups.

This code needs to special-case the guest user, as
this token can have the token_sid[0] set to the Guest
SID, not the mapping of UNIX uid -> SID.

Other users that may have a well-known SID
set in token_sid[0] (like SYSTEM) are usually
not mappable to UNIX users and can be ignored
when adding local groups from /etc/group.

Combined back-port of fixes
6034ab521c47fc5f4732398652c9c6847ff92035 and
a9fa09723bee3588db2168ac13f7ad0334452c11 from
master.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
10 years agotevent: fix crash bug in tevent_queue_immediate_trigger()
Stefan Metzmacher [Sat, 11 Jan 2014 07:58:05 +0000 (08:58 +0100)]
tevent: fix crash bug in tevent_queue_immediate_trigger()

Assume we we have a queue with 2 entries (A and B with triggerA() and triggerB()).
If triggerA() removes itself tevent_queue_entry_destructor() will be called
for A, this schedules the immediate event to call triggerB().
If triggerA() then also removes B by an explicit of implizit talloc_free(),
q->list is NULL, but the immediate event is still scheduled and can't be unscheduled.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 7fe5584e2a59584431cb2ddf8a4da22bfb924454)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue Apr  1 11:33:36 CEST 2014 on sn-devel-104

10 years agolsa.idl: define lsa.ForestTrustCollisionInfo and ForestTrustCollisionRecord as public...
Alexander Bokovoy [Tue, 18 Mar 2014 17:41:38 +0000 (19:41 +0200)]
lsa.idl: define lsa.ForestTrustCollisionInfo and ForestTrustCollisionRecord as public structs

For Python bindings PIDL wants the struct to be defined as public if we
want to use __ndr_print/pack/unpack.

Define the [public] attribute to ForestTrustCollisionInfo/Record to
allow easier debugging when there is collision in establishing a trust.

This change does not affect C code as NDR functions are always
generated, only not exposed in Python bindings.

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Mon Mar 24 12:44:50 CET 2014 on sn-devel-104

(cherry picked from commit 59767911bded48388c27d5f9cd2ff1346a1c01a6)

10 years agos3-rpc_server: Fix handling of fragmented rpc requests.
Andreas Schneider [Thu, 20 Mar 2014 13:45:01 +0000 (14:45 +0100)]
s3-rpc_server: Fix handling of fragmented rpc requests.

We need to call pipe_init_outgoing_data() as the first thing in
process_complete_pdu(). Otherwise the caller may use uninitialized
memory and tries to write a response into the socket.

The problem happens only if a real socket is used, which means
in all cases for master and only with external rpc daemons in v4-0
and v4-1.

The problem looks like this in the logs.

    [2014/03/20 14:49:35.531663, 10, pid=7309, effective(0, 0), real(0, 0), class=rpc_srv] ../source3/rpc_server/srv_pipe.c:1627(process_complete_pdu)
      Processing packet type 0
    [2014/03/20 14:49:35.531695, 10, pid=7309, effective(0, 0), real(0, 0), class=rpc_srv] ../source3/rpc_server/srv_pipe.c:1472(dcesrv_auth_request)
      Checking request auth.
    [2014/03/20 14:49:35.531738, 10, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:521(named_pipe_packet_process)
      Sending 1 fragments in a total of 0 bytes
    [2014/03/20 14:49:35.531769, 10, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:526(named_pipe_packet_process)
      Sending PDU number: 0, PDU Length: 4294967228
    [2014/03/20 14:49:35.531801,  2, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:565(named_pipe_packet_done)
      Writev failed!
    [2014/03/20 14:49:35.531845,  2, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:595(named_pipe_packet_done)
      Fatal error(Message too long). Terminating client(127.0.0.1) connection!

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Guenther Deschner <gd@samba.org
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Mar 20 18:30:17 CET 2014 on sn-devel-104

(cherry picked from commit 5277fc4d0393ffe2e415ad26610b36d2986c62d7)

10 years agos3:rpc_server: minor refactoring of process_request_pdu()
Gregor Beck [Thu, 9 Jan 2014 09:15:31 +0000 (10:15 +0100)]
s3:rpc_server: minor refactoring of process_request_pdu()

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit b5f30205931a4b9d0b3b257d5855869e606f8b63)

10 years agopidl-waf: Only install Yapp::Driver if it is not available.
Andreas Schneider [Fri, 28 Feb 2014 15:00:54 +0000 (16:00 +0100)]
pidl-waf: Only install Yapp::Driver if it is not available.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Mar  6 23:30:47 CET 2014 on sn-devel-104

The last 9 patches address bug #10472 - pidl: waf should have an option
for the dir to install perl files and do not glob.

10 years agopidl-waf: Check for system perl(Parse::Yapp::Driver).
Andreas Schneider [Fri, 28 Feb 2014 14:59:45 +0000 (15:59 +0100)]
pidl-waf: Check for system perl(Parse::Yapp::Driver).

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agopidl-waf: Add a function to check for a system perl module.
Andreas Schneider [Fri, 28 Feb 2014 14:59:41 +0000 (15:59 +0100)]
pidl-waf: Add a function to check for a system perl module.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agopidl-waf: Do not glob to install pidl modules.
Andreas Schneider [Fri, 28 Feb 2014 14:55:46 +0000 (15:55 +0100)]
pidl-waf: Do not glob to install pidl modules.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agopidl-waf: Install pidl modules to the perl vendorlib directory.
Andreas Schneider [Fri, 28 Feb 2014 14:53:10 +0000 (15:53 +0100)]
pidl-waf: Install pidl modules to the perl vendorlib directory.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agopidl-waf: Remove unused variable pidl_src.
Andreas Schneider [Fri, 28 Feb 2014 14:54:09 +0000 (15:54 +0100)]
pidl-waf: Remove unused variable pidl_src.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoautobuild: Set perl vendorlib direcotry.
Andreas Schneider [Wed, 5 Mar 2014 15:27:15 +0000 (16:27 +0100)]
autobuild: Set perl vendorlib direcotry.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agobuildtools: Add perl vendorlib configure option.
Andreas Schneider [Fri, 28 Feb 2014 14:50:02 +0000 (15:50 +0100)]
buildtools: Add perl vendorlib configure option.

After this patch has been pushed, we need to change autobuild to compile
with this option or we will not be able to install pidl.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agobuildtools: Rename perl vendorarch configure option.
Andreas Schneider [Fri, 28 Feb 2014 14:47:45 +0000 (15:47 +0100)]
buildtools: Rename perl vendorarch configure option.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agodns: Extend tests for records with another type
Kai Blin [Fri, 28 Feb 2014 09:35:07 +0000 (10:35 +0100)]
dns: Extend tests for records with another type

Add another check to the one added for bug #10471, for added paranoia

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Tue Mar  4 15:47:10 CET 2014 on sn-devel-104

(cherry picked from commit 5bd47bb563c3736b9de1a3a93bdf46a498928643)

10 years agobug #10471: Don't respond with NXDOMAIN to records that exist with another type
Kai Blin [Thu, 27 Feb 2014 22:49:24 +0000 (23:49 +0100)]
bug #10471: Don't respond with NXDOMAIN to records that exist with another type

DNS queries for records with the wrong type need to trigger an empty
response with RCODE_OK instead of returning NXDOMAIN.

This adds a test and fixes bug #10471

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit d9829df13317b38677d92a499134727ab31fbb0e)

10 years agos3: smbd: Fileserving share access checks.
Jeremy Allison [Mon, 17 Mar 2014 21:48:30 +0000 (14:48 -0700)]
s3: smbd: Fileserving share access checks.

Git commit 86d1e1db8e2747e30c89627cda123fde1e84f579
fixed share_access not being reset between users,
by changing make_connection_snum() to call a common
function check_user_share_access() in the same way
that change_to_user() (which can be called on any
incoming packet) does.

Unfortunately that bugfix was incorrect and
broke "force user" and "force group" as it
called check_user_share_access() inside
make_connection_snum() using the conn->session_info
pointer instead of the vuser->session_info pointer.

conn->session_info represents the token to use
when actually accessing the file system, and so
is modified by force user and force group.

vuser->session_info represents the "pristine"
token of the user logging in, and is never modified
by force user and force group.

Samba 3.6.x checked the share access based on
the "pristine" token of the user logging in,
not the token modified by force user and force group.
This change restores the expected behavior.

Fixes bug #9878 - force user does not work as expected

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

Signed-off-by: Jeremy Allison <jra@samba.org>
10 years agosmbreadline: switch to new-style readline typedef
Gustavo Zacarias [Thu, 6 Mar 2014 21:57:40 +0000 (18:57 -0300)]
smbreadline: switch to new-style readline typedef

Function, CPFunction, CPPFunction and VFunction typedefs are considered
old-style (deprecated) starting from readline 4.2 (circa 2001).
Compatibility typedefs have been in place up to readline 6.2 but were
removed with the 6.3 release thus causing builds to break.
Switch to the new-style specific prototyped typedef.

Return value is unused so the callback should still be void (see
readline/input.c around line 456 in version 6.3).

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 13 00:21:47 CET 2014 on sn-devel-104

(cherry picked from commit 29d779c7029f89e530994c45ae065707ffd62c43)

Fix bug #10506 - smbreadline doesn't build with readline 6.3.

10 years agos4:lib/socket: simplify iface_list_wildcard() and its callers
Stefan Metzmacher [Thu, 27 Feb 2014 09:28:23 +0000 (10:28 +0100)]
s4:lib/socket: simplify iface_list_wildcard() and its callers

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10464
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Change-Id: Ib317d71dea01fc8ef6b6a26455f15a8a175d59f6
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Mar  7 02:18:17 CET 2014 on sn-devel-104
(cherry picked from commit f7883ae02a4e8935a44396f776712cebfd411e52)

10 years agos4:lib/socket: use the same logic in iface_list_wildcard() as in smbd
Stefan Metzmacher [Thu, 27 Feb 2014 09:18:35 +0000 (10:18 +0100)]
s4:lib/socket: use the same logic in iface_list_wildcard() as in smbd

If we have ipv6 support we should listen on "::" too.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10464
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Change-Id: I8ce185d5070280149bee9fd33010443be9031089
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit a571fe520d09a00273a58b1fb0fa9aab8e0aefce)

10 years agos3:smbd: s/BUFFER_SIZE/LARGE_WRITEX_BUFFER_SIZE
Stefan Metzmacher [Fri, 6 Dec 2013 12:56:12 +0000 (13:56 +0100)]
s3:smbd: s/BUFFER_SIZE/LARGE_WRITEX_BUFFER_SIZE

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Mar  5 22:53:34 CET 2014 on sn-devel-104
(cherry picked from commit 032621d5bf842e60dc9cd1cd0d3acc90482462a6)

10 years agos3:smbd: fix the maxentries calculation depending on the max_send.
Stefan Metzmacher [Wed, 5 Mar 2014 13:03:42 +0000 (14:03 +0100)]
s3:smbd: fix the maxentries calculation depending on the max_send.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit c899d4fd9c5a337ab82acdf11866df50fb0629e0)

10 years agos3:smbd: simplify maxentries calculation in reply_search()
Stefan Metzmacher [Wed, 5 Mar 2014 13:00:40 +0000 (14:00 +0100)]
s3:smbd: simplify maxentries calculation in reply_search()

Using helper variables make it much easier to understand.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 734e1b65044a33eba01b41695502c2257c1a4d9e)

10 years agos3:smbd: fix the read numtoread calculation depending on the max_send.
Stefan Metzmacher [Tue, 4 Mar 2014 13:07:26 +0000 (14:07 +0100)]
s3:smbd: fix the read numtoread calculation depending on the max_send.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 8b746f5a2137b74e28bce5370f5aa9d4bcdac6c2)

10 years agos3:smbd: fix the lockread numtoread calculation depending on the max_send.
Stefan Metzmacher [Tue, 4 Mar 2014 13:07:26 +0000 (14:07 +0100)]
s3:smbd: fix the lockread numtoread calculation depending on the max_send.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit f69be2c28e097c66907df264794706006fe0ae7f)

10 years agos3:smbd: pass the final numtoread reply_outbuf() for the lockread reply.
Stefan Metzmacher [Tue, 4 Mar 2014 13:07:26 +0000 (14:07 +0100)]
s3:smbd: pass the final numtoread reply_outbuf() for the lockread reply.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit b86f90611820bcf7826bd1de3c7b05488a8f1b0e)

10 years agos3:smbd: fix lockread numtoread calculation to match reply_outbuf() arguments.
Stefan Metzmacher [Tue, 4 Mar 2014 13:07:26 +0000 (14:07 +0100)]
s3:smbd: fix lockread numtoread calculation to match reply_outbuf() arguments.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 3dac00b568613f5a1322883237e40b98ddd1d71d)

10 years agos3:smbd: take less than SMB_BUFFER_SIZE_MIN ('500') as header overhead in ipc.c
Stefan Metzmacher [Fri, 6 Dec 2013 12:53:45 +0000 (13:53 +0100)]
s3:smbd: take less than SMB_BUFFER_SIZE_MIN ('500') as header overhead in ipc.c

We're now sure that sconn->smb1.sessions.max_send is >= SMB_BUFFER_SIZE_MIN.
in order to garantee some progress we need to make sure our assumed
header overhead is less than SMB_BUFFER_SIZE_MIN.

Assuming 372 bytes for the SMBtrans headers should still be more than
enough.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 2ec49cf57c88735be962b0681b487df5efe7ed6b)

10 years agos3:smbd: reject a MaxBufferSize < SMB_BUFFER_SIZE_MIN (500) in a session setup request
Stefan Metzmacher [Fri, 6 Dec 2013 12:52:09 +0000 (13:52 +0100)]
s3:smbd: reject a MaxBufferSize < SMB_BUFFER_SIZE_MIN (500) in a session setup request

This makes sure sconn->smb1.sessions.max_send is always >= SMB_BUFFER_SIZE_MIN.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit cce1eaea91088efd742891befdaafade0c1fdce6)

10 years agos3:smbd: use sconn->smb1.sessions.max_send = SMB_BUFFER_SIZE_MAX
Stefan Metzmacher [Fri, 6 Dec 2013 12:50:49 +0000 (13:50 +0100)]
s3:smbd: use sconn->smb1.sessions.max_send = SMB_BUFFER_SIZE_MAX

SMB_BUFFER_SIZE_MAX is UINT16_MAX and the largest value a client
can possibly specify in the session setup request.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 5cd5c1613996ecebdcd632e932957947f4c27308)

10 years agos3:smbd: use SMB_BUFFER_SIZE_MIN/MAX to limit lp_max_xmit()
Stefan Metzmacher [Fri, 6 Dec 2013 12:45:35 +0000 (13:45 +0100)]
s3:smbd: use SMB_BUFFER_SIZE_MIN/MAX to limit lp_max_xmit()

The current limit of 128*1024 causes problems as the value has to be
<= UINT16_MAX otherwise some clients get confused, as they want to
use the MaxBufferSize value from the negprot response (uint32_t)
for the MaxBufferSize value in thet session setup request (uint16_t).
E.g. Windows 7 (as client) sends MaxBufferSize = 0 if the server value
is > UINT16_MAX.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit a349b0bef9085fd139640ec92399bc63d8029cb9)