samba.git
10 years agoFix bug #10010 - Missing integer wrap protection in EA list reading can cause server...
Jeremy Allison [Thu, 11 Jul 2013 00:10:17 +0000 (17:10 -0700)]
Fix bug #10010 - Missing integer wrap protection in EA list reading can cause server to loop with DOS.

Ensure we never wrap whilst adding client provided input.

Signed-off-by: Jeremy Allison <jra@samba.org>
10 years agoVERSION: Bump version number up to 4.0.8.
Karolin Seeger [Thu, 1 Aug 2013 18:44:03 +0000 (20:44 +0200)]
VERSION: Bump version number up to 4.0.8.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoVERSION: Disable git snapshots for the 4.0.7 release. samba-4.0.7
Karolin Seeger [Fri, 28 Jun 2013 08:47:42 +0000 (10:47 +0200)]
VERSION: Disable git snapshots for the 4.0.7 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoWHATSNEW: Add release notes for Samba 4.0.7.
Karolin Seeger [Thu, 27 Jun 2013 08:18:24 +0000 (10:18 +0200)]
WHATSNEW: Add release notes for Samba 4.0.7.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Fri Jun 28 10:30:31 CEST 2013 on sn-devel-104

10 years agotorture: Add tests for LDAP substring search with no strings provided
Andrew Bartlett [Sat, 22 Jun 2013 06:55:08 +0000 (16:55 +1000)]
torture: Add tests for LDAP substring search with no strings provided

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jun 24 23:55:07 CEST 2013 on sn-devel-104
(cherry picked from commit 7bf8fc7ca2321c25b9194a0a13df6a8b4e783c9e)

The last 5 patches address bug #9967 - Fix crash bug from search of mail=.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue Jun 25 13:35:05 CEST 2013 on sn-devel-104

10 years agolibcli/ldap: Cope with substring match with no chunks in ldap_push_filter
Andrew Bartlett [Sat, 22 Jun 2013 07:01:42 +0000 (17:01 +1000)]
libcli/ldap: Cope with substring match with no chunks in ldap_push_filter

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 70cb7fd214041e8ffacc98de4dbde3ecd77bba85)

10 years agoldb: bump version to allow a depencency on the substring crash fix
Andrew Bartlett [Mon, 24 Jun 2013 05:28:39 +0000 (15:28 +1000)]
ldb: bump version to allow a depencency on the substring crash fix

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 4ca963926938917bf32af4eead61ded2a8275139)

10 years agoldb: Cope with substring match with no chunks in ldb_filter_from_tree
Andrew Bartlett [Sat, 22 Jun 2013 07:01:02 +0000 (17:01 +1000)]
ldb: Cope with substring match with no chunks in ldb_filter_from_tree

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 1a279f74b72018f0742fc407e0574c9dbd7b7883)

10 years agoldb: Ensure not to segfault on a filter such as (mail=)
Andrew Bartlett [Sat, 15 Jun 2013 06:00:42 +0000 (16:00 +1000)]
ldb: Ensure not to segfault on a filter such as (mail=)

As reported by Robin McCorkell <xenopathic@gmail.com> triggered by
Mozilla Thunderbird as an LDAP client.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Matthieu Patou <mat@matws.net>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Jun 22 09:33:14 CEST 2013 on sn-devel-104
(cherry picked from commit 0ee8650d778736a130e914df9e14734ef18e0fb5)

10 years agoheimdal_build: Add missing dep on samba4kgetcred
Andrew Bartlett [Sun, 16 Jun 2013 04:02:57 +0000 (14:02 +1000)]
heimdal_build: Add missing dep on samba4kgetcred

This started to fail on current Debian Sid with system Heimdal after a binutils update.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jun 25 02:30:59 CEST 2013 on sn-devel-104
(cherry picked from commit 48ae86f74c5ed2ae2612d61e232bfcf93d44c7f8)

Fix bug #9968 - fix build with system Heimdal of samba4kgetcred.

10 years agodocs: Avoid mentioning a possibly misleading option.
Michael Wood [Sat, 1 Jun 2013 08:35:56 +0000 (10:35 +0200)]
docs: Avoid mentioning a possibly misleading option.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 5528551ea39686194837a8083c85b71dedbe6f0e)

Fix bug #9964 - For v4-0-test: docs: Avoid mentioning a possibly misleading
option.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Fri Jun 21 11:41:46 CEST 2013 on sn-devel-104

10 years agotevent: Fix Coverity ID 989236 Operands don't affect result
Volker Lendecke [Thu, 13 Jun 2013 18:35:32 +0000 (20:35 +0200)]
tevent: Fix Coverity ID 989236 Operands don't affect result

"unsigned" could be less than uint64_t, so idx==UINT64_MAX is always false.

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

Fix bug #9953 - tevent_poll on 32-bit machines broken.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue Jun 18 13:00:57 CEST 2013 on sn-devel-104

10 years agoBug 8997: change libreplace GPL source to LGPL
David Disseldorp [Mon, 3 Jun 2013 11:00:31 +0000 (13:00 +0200)]
Bug 8997: change libreplace GPL source to LGPL

libreplace currently includes socket.c and getifaddrs.c both of which
are GPL licensed.
Although not required, talloc and tdb build alongside this source,
leading to some ambiguity regarding their LGPL licences.

The following copyright holders have agreed to the GPL->LGPL change:
lib/replace/getifaddrs.c
   Copyright (C) Andrew Tridgell 1998
   Copyright (C) Jeremy Allison 2007
   Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007

lib/replace/test/getifaddrs.c
lib/replace/socket.c
 * Copyright (C) Michael Adam <obnox@samba.org> 2008

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 8a6743e4edcdff1c7860d150720483f19f3b33bb)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Fri Jun 14 10:53:57 CEST 2013 on sn-devel-104

10 years agos4-dfs_server: check for netbios aliases in ad_get_referrals (bug #9947)
Björn Baumbach [Wed, 5 Jun 2013 13:01:14 +0000 (15:01 +0200)]
s4-dfs_server: check for netbios aliases in ad_get_referrals (bug #9947)

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
(cherry picked from commit 424a990e34278fae4888b00affb530ed1fbcb354)

10 years agodns: Support larger queries when asking forwarder
Kai Blin [Sat, 25 May 2013 11:21:33 +0000 (13:21 +0200)]
dns: Support larger queries when asking forwarder

This should fix bug #9632

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit df43027bd8c127a44304f7130bf61adfcdf73eed)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue Jun 11 12:05:09 CEST 2013 on sn-devel-104

10 years agoidl: Add support for parsing OPT records
Kai Blin [Sat, 25 May 2013 11:21:32 +0000 (13:21 +0200)]
idl: Add support for parsing OPT records

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 5bcebb54da8eed535e5f7034ed1f7a95456f19b1)

10 years agoWhen message-type is drvupgrade, MSG_DEBUG should be replaced with MSG_PRINTER_DRVUPG...
Peng Haitao [Wed, 22 May 2013 21:03:13 +0000 (14:03 -0700)]
When message-type is drvupgrade, MSG_DEBUG should be replaced with MSG_PRINTER_DRVUPGRADE.

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Fix bug #9941 - Fix a bug of drvupgrade of smbcontrol.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon Jun 10 23:09:33 CEST 2013 on sn-devel-104

10 years agoCheck for WRITE_ACCESS on the file before overriding an EACCESS.
Jeremy Allison [Thu, 25 Apr 2013 21:06:03 +0000 (14:06 -0700)]
Check for WRITE_ACCESS on the file before overriding an EACCESS.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Apr 27 15:57:17 CEST 2013 on sn-devel-104
(cherry picked from commit 5185460067229a342ddf3951ecc968017c2ed4df)

The last 4 patches address bug #9794 - opening/editing or copying MS files
causes a core dump with invalid lock order.

10 years agoEnsure we don't try the open_file_fchmod() if we can't write to the file.
Jeremy Allison [Thu, 25 Apr 2013 21:02:24 +0000 (14:02 -0700)]
Ensure we don't try the open_file_fchmod() if we can't write to the file.

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

10 years agoRemove indentation around code wrapped by unneeded CAN_WRITE.
Jeremy Allison [Thu, 25 Apr 2013 21:00:42 +0000 (14:00 -0700)]
Remove indentation around code wrapped by unneeded CAN_WRITE.

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

10 years agoAdd early return in file_set_dosmode() on a read only share.
Jeremy Allison [Thu, 25 Apr 2013 20:59:22 +0000 (13:59 -0700)]
Add early return in file_set_dosmode() on a read only share.

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

10 years agoBUG 9881: Check for system libtevent.
Andreas Schneider [Tue, 14 May 2013 07:59:44 +0000 (09:59 +0200)]
BUG 9881: Check for system libtevent.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu Jun  6 22:42:20 CEST 2013 on sn-devel-104

10 years agos4:winbind: don't leak libnet_context into the main event context (bug #9929)
Stefan Metzmacher [Fri, 31 May 2013 14:04:26 +0000 (16:04 +0200)]
s4:winbind: don't leak libnet_context into the main event context (bug #9929)

This needs to be a talloc child of struct wbsrv_domain
otherwise the cleanup of a broken connection doesn't work.

The following command can trigger the leak on a domain controller.

root@dc:~/samba# ls -l /var/lib/samba/sysvol/samba.private/
total 16
drwxrwx---+ 5 root 3000000 4096 May 14 14:46 Policies
drwxrwx---+ 2 root 3000000 4096 May 14 11:45 scripts

gid 3000000 belongs to Builtin\Administrators.

The code triggers a ncacn_np: connection to the local smbd
and complains that domain BUILTIN is not available:

[2013/05/29 17:28:03,  2] ../source4/winbind/wb_init_domain.c:376(init_domain_recv_queryinfo)
  Expected domain name BUILTIN, DC dc.samba.private said SAMBA

In that case the connection was not closed, which is fixed by this commit.

Using ncalrpc: for all local SIDs and serving the BUILTIN domain is
a project for another day...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jun  4 11:05:09 CEST 2013 on sn-devel-104
(cherry picked from commit 097a8c723925d3e35606215cb16be28a37b0112e)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Wed Jun  5 13:57:16 CEST 2013 on sn-devel-104

10 years agoFix bug 9900: is_printer_published GUID retrieval
David Disseldorp [Wed, 22 May 2013 15:58:38 +0000 (17:58 +0200)]
Fix bug 9900: is_printer_published GUID retrieval

Samba currently always responds to GetPrinter(level = 7) requests with
DSPRINT_UNPUBLISH, regardless of the AD publish status tracked via the
PRINTER_ATTRIBUTE_PUBLISHED flag. This is due to erroneous "objectGUID"
unmarshalling in is_printer_published().

This change splits "objectGUID" retrieval into a separate function, and
adds a pull_reg_sz() call to correctly unmarshall the GUID.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue Jun  4 11:49:46 CEST 2013 on sn-devel-104

10 years agoprinting: explicitly clear PUBLISHED attribute
David Disseldorp [Thu, 23 May 2013 17:32:08 +0000 (19:32 +0200)]
printing: explicitly clear PUBLISHED attribute

Currently nt_printer_publish(DSPRINT_UNPUBLISH) flips (via xor) the
info2->attributes PRINTER_ATTRIBUTE_PUBLISHED flag, rather than
explicitly clearing it.

10 years agodns: Delete dnsNode objects when they are empty
Kai Blin [Sat, 1 Jun 2013 08:24:11 +0000 (10:24 +0200)]
dns: Delete dnsNode objects when they are empty

If an update leaves the dnsNode without any entries, the dnsNode object
should be deleted. Thanks to Günter Kukkukk for his excellent debugging
work on this one.

This should fix bug #9559

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

The last 3 patches address bug #9559 - Only initial signed DNS update for a host
works.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon Jun  3 14:16:16 CEST 2013 on sn-devel-104

10 years agodns: Fix allocation of txt_record in txt record tests
Kai Blin [Thu, 16 May 2013 10:13:22 +0000 (12:13 +0200)]
dns: Fix allocation of txt_record in txt record tests

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-By: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu May 16 15:39:15 CEST 2013 on sn-devel-104
(cherry picked from commit 46e98cf20b04f3668e96fb597a414d0b39d5b1ed)

10 years agodns: more debug debug options in the tests
Kai Blin [Sun, 13 Jan 2013 23:56:48 +0000 (00:56 +0100)]
dns: more debug debug options in the tests

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-By: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 223cf7fb3026daa1d383a2e5796cbfe8beecaac2)

10 years agowinbind4: Fix bug 9832 -- talloc use after free
Volker Lendecke [Tue, 7 May 2013 08:17:26 +0000 (10:17 +0200)]
winbind4: Fix bug 9832 -- talloc use after free

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): Thu May 16 13:37:41 CEST 2013 on sn-devel-104
(cherry picked from commit 51533eedd7fa162bf8113f1f551064c01741e40e)

10 years agowaf: build PIEs if supported by the compiler
David Disseldorp [Tue, 28 May 2013 13:00:47 +0000 (15:00 +0200)]
waf: build PIEs if supported by the compiler

Currently waf performs a mandatory check for compiler PIE support,
unless --without-pie is specified.
This change makes Waf only perform the mandatory check if --with-pie is
specified. If neither --with-pie nor --without-pie are specified, then
PIEs are only built if compiler support is available.

Signed-off-by: David Disseldorp <ddiss@samba.org>
The last 3 patches address bug #9910 - PIE builds not supported.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu May 30 11:37:47 CEST 2013 on sn-devel-104

10 years agowaf: build position independent executables
David Disseldorp [Mon, 27 May 2013 15:57:01 +0000 (17:57 +0200)]
waf: build position independent executables

This patch re-instates support for building Position Independent
Executables using the '-fPIE' and '-pie' compiler and linker flags
respectively.

PIE builds are enabled by default, and can be explicitly disabled using
the '--without-pie' configure argument.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue May 28 02:56:36 CEST 2013 on sn-devel-104

10 years agowaf: add --with[out]-pie configure arguments
David Disseldorp [Mon, 27 May 2013 15:57:00 +0000 (17:57 +0200)]
waf: add --with[out]-pie configure arguments

The arguments do not currently have any effect.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agobuild: Add missing new line to replaced python shebang line. (Fix bug #9909)
Michael Adam [Tue, 28 May 2013 10:19:34 +0000 (12:19 +0200)]
build: Add missing new line to replaced python shebang line. (Fix bug #9909)

When configuring with a non-standard python specified in
the PYTHON environment variable, the shebang lines in various
python tools like samba-tool and samba_dnsupdate get replaced.

This replace line for the shebang was missing a newline
which joined the shebang line with the following line,
rendereing those scripts with a nonempty second line unusuable,
for example samba_dnsupdate.

This patch fixes this bug which is bug #9909 on bugzilla.

Pair-Programmed-With: Karolin Seeger <kseeger@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed May 29 13:21:51 CEST 2013 on sn-devel-104
(cherry picked from commit 3f24d694e7e2190d30a17bc13a79a36b49711531)

10 years agobuild: Install smbtar in waf build
Andrew Bartlett [Sun, 26 May 2013 11:05:12 +0000 (21:05 +1000)]
build: Install smbtar in waf build

Reviewed-by: Kai Blin <kai@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon May 27 12:55:05 CEST 2013 on sn-devel-104
(cherry picked from commit 1754b52204563a722920805b76e6c571d0268434)

The last 5 patches address bug #9907 - build fixes for 4.0 found during autoconf
or debian packaging work.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Wed May 29 13:38:55 CEST 2013 on sn-devel-104

10 years agobuild: Blacklist the release-4-0-0 provision as well
Andrew Bartlett [Fri, 26 Apr 2013 06:44:00 +0000 (16:44 +1000)]
build: Blacklist the release-4-0-0 provision as well

This reduces the size of the published tarball while ensuring we test with it
during autobuild.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 768c3bb16ae8aac2d96d4fa0d8a7593fc9be6ca8)

10 years agobuild: Do not set PATH in install_with_python now we set $PYTHON
Andrew Bartlett [Wed, 8 May 2013 00:59:05 +0000 (12:59 +1200)]
build: Do not set PATH in install_with_python now we set $PYTHON

This will ensure that the scripts get rewritten to use this specific python, as it
will not be found in the path by the waf scripts.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 20445415307ae3d6524995d0128862dcbc119684)

10 years agobuild: Rework BSD_STYLE_STATVFS check to match autoconf build
Andrew Bartlett [Tue, 21 May 2013 14:14:29 +0000 (00:14 +1000)]
build: Rework BSD_STYLE_STATVFS check to match autoconf build

Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
(cherry picked from commit 2a4eaa3241fc4ccb79359ea4e4d511754a84d46b)

10 years agolib/replace: Set BROKEN_STRNLEN and BROKEN_STRNDUP on all AIX
Andrew Bartlett [Wed, 22 May 2013 07:23:30 +0000 (17:23 +1000)]
lib/replace: Set BROKEN_STRNLEN and BROKEN_STRNDUP on all AIX

The background is in https://bugzilla.samba.org/show_bug.cgi?id=1097
and wider reports are at
http://stackoverflow.com/questions/2091460/strndup-call-is-currupting-stack-frames

Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May 23 03:52:10 CEST 2013 on sn-devel-104
(cherry picked from commit 9ddfd7d8784e6f546628f48990b69ee2850be52d)

10 years agodocs: Remove all references to testprns
Andrew Bartlett [Sun, 26 May 2013 10:29:19 +0000 (20:29 +1000)]
docs: Remove all references to testprns

Based on debian patch documentation2.patch by Christian Perrier <bubulle@debian.org>.

This tool no longer exists in Samba.

Andrew Bartlett

Reviewed-by: Kai Blin <kai@samba.org>
(cherry picked from commit 4ae3cdcd7151237a858f668357d08ab6916bdb3b)

The last 4 patches address bug #9906 - Doc fixes for 4.0.

10 years agodocs: Fix small errors in TOSHARG-Compiling
Andrew Bartlett [Tue, 21 May 2013 10:44:26 +0000 (20:44 +1000)]
docs: Fix small errors in TOSHARG-Compiling

Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit e896f3c5bf5dee3c771985cd9dd2eb376481c22b)

10 years agodocs: Remove TOSHARG-HighAvailability which is made obsolete by CTDB
Andrew Bartlett [Tue, 21 May 2013 10:50:30 +0000 (20:50 +1000)]
docs: Remove TOSHARG-HighAvailability which is made obsolete by CTDB

This is mostly a lament on why this is hard, and while CTDB is still
hard, this document tries to imply it is almost impossible, and makes
no mention of the solution.

Andrew Bartlett
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit f632150e1b5a8d8a32753f43f7433b392f3a2136)

10 years agodocs: Remove out of date and unmaintained Speed page from the HOWTO
Andrew Bartlett [Tue, 21 May 2013 07:49:55 +0000 (17:49 +1000)]
docs: Remove out of date and unmaintained Speed page from the HOWTO

Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit fa8e760882ea389f8c94d6dfdc7386b0295974d1)

10 years agodns: Add support for MX queries
Kai Blin [Sun, 9 Dec 2012 19:50:05 +0000 (05:50 +1000)]
dns: Add support for MX queries

Due to an oversight, the internal DNS server supports MX record updates,
but not MX record queries. Add support for MX queries and tests.

This should fix bug #9485

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-By: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon May 27 15:46:22 CEST 2013 on sn-devel-104

10 years agoMore generic check for OpenBSD platform
Vadim Zhukov [Fri, 17 May 2013 08:43:08 +0000 (12:43 +0400)]
More generic check for OpenBSD platform

OpenBSD versioning is different from many other
projects, and, say, 5.0 does not differ from 4.9 more than from 5.1. So the
right approach will be to check that platform name starts with "openbsd"
instead. This is also the thing OpenBSD developers do when patching other
software, so this patch is consistent with already existing practicies.

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

Reviewed-by: Lars Müller <lars@samba.org>
Reviewed-by: Björn Jacke <bj@sernet.de>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri May 17 17:58:16 CEST 2013 on sn-devel-104
(cherry picked from commit 2fda6c47f4aa46dbb42028732207a94821881c67)

10 years agodocs: mention AD prerequirements for using idmap_ad
Björn Jacke [Wed, 15 May 2013 13:52:25 +0000 (15:52 +0200)]
docs: mention AD prerequirements for using idmap_ad

Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit c3057f69a274f0d8e0e66183bd5e8be7703b6750)

The last 2 patches address bug #9880 - Use of wrong RFC2307 primary group
field.

10 years agowinbind/idmap_ad: be verbose about the user that we fail to map
Björn Jacke [Tue, 14 May 2013 14:51:28 +0000 (16:51 +0200)]
winbind/idmap_ad: be verbose about the user that we fail to map

Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit f08205be7003f6c0a15fd5fd99d01951164ad15c)

10 years agos3:lib/server_mutex: open mutex.tdb with CLEAR_IF_FIRST
Stefan Metzmacher [Thu, 28 Mar 2013 10:04:31 +0000 (11:04 +0100)]
s3:lib/server_mutex: open mutex.tdb with CLEAR_IF_FIRST

/var/lock/samba is typically on tpmfs.

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

Fix bug #9805 - s3:lib/server_mutex: open mutex.tdb with CLEAR_IF_FIRST.

10 years agos3-rpc_server: Ensure we are root when starting and usiing gensec
Andrew Bartlett [Thu, 2 May 2013 04:29:21 +0000 (16:29 +1200)]
s3-rpc_server: Ensure we are root when starting and usiing gensec

This fixes bug 9465.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 10f6926aaa6a8c49b29e183d12f6f767072ecff7)

10 years agoVERSION: Bump version number up to 4.0.7...
Karolin Seeger [Fri, 17 May 2013 07:29:07 +0000 (09:29 +0200)]
VERSION: Bump version number up to 4.0.7...

and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agoVERSION: Disable git snapshots for the 4.0.6 release. samba-4.0.6
Karolin Seeger [Fri, 17 May 2013 07:27:51 +0000 (09:27 +0200)]
VERSION: Disable git snapshots for the 4.0.6 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
10 years agodoc-xml/smbdotconf: fix server [min|max] protocol documentation (bug 9883)
Stefan Metzmacher [Tue, 30 Apr 2013 06:39:00 +0000 (08:39 +0200)]
doc-xml/smbdotconf: fix server [min|max] protocol documentation (bug 9883)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 0ffd074690529a1833e29829b552b3cf6ebcd914)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu May 16 16:29:11 CEST 2013 on sn-devel-104

10 years agodocs: smb.conf: fix max read/write/trans default values (bug #9871)
Björn Baumbach [Wed, 8 May 2013 08:27:26 +0000 (10:27 +0200)]
docs: smb.conf: fix max read/write/trans default values (bug #9871)

Commit 6d128aac119d948f0ecb0dcf6b400b4eb4027fe6 has increased the limit:
"s3:smb2_server increase defaults for read/write/trans sizes to 1MB"

Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May 10 23:14:50 CEST 2013 on sn-devel-104
(cherry picked from commit 3b3b5b02555572e48a751ea19ef9dd771a3862da)

10 years agoWHATSNEW: Add release notes for Samba 4.0.6.
Karolin Seeger [Wed, 15 May 2013 16:05:40 +0000 (18:05 +0200)]
WHATSNEW: Add release notes for Samba 4.0.6.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Wed May 15 19:53:19 CEST 2013 on sn-devel-104

10 years agoMakefile: Fix bug 9868 -- Don't know how to make LIBNDR_PREG_OBJ.
Volker Lendecke [Tue, 7 May 2013 13:07:34 +0000 (15:07 +0200)]
Makefile: Fix bug 9868 -- Don't know how to make LIBNDR_PREG_OBJ.

Thanks to Lucs for finding the issue

Signed-off-by: Volker Lendecke <vl@samba.org>
Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue May 14 12:05:01 CEST 2013 on sn-devel-104

10 years agoTests processing an oplock break within a compound SMB2 request.
Richard Sharpe [Thu, 2 May 2013 21:36:05 +0000 (14:36 -0700)]
Tests processing an oplock break within a compound SMB2 request.

Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Richard Sharpe <sharpe@samba.org>
Autobuild-Date(master): Tue May  7 19:45:36 CEST 2013 on sn-devel-104
(cherry picked from commit 76bffc27a3f9ad6ac6b8ff8e21f801012835b73d)

The last 6 patches address bug #9722 - Samba does not properly handle Oplock
breaks in compound requests.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Wed May  8 23:11:55 CEST 2013 on sn-devel-104

10 years agoRemove the compound_related_in_progress state from the smb2 global state.
Jeremy Allison [Thu, 2 May 2013 21:16:22 +0000 (14:16 -0700)]
Remove the compound_related_in_progress state from the smb2 global state.

And also remove the restriction that we can't read a new
request whilst we're in this state.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@samba.org>
(cherry picked from commit cbff4885508e050bcb91c0faccb26941de5c1e1d)

10 years agoThe core of the fix to allow opens to go async inside a compound request.
Jeremy Allison [Thu, 2 May 2013 20:55:53 +0000 (13:55 -0700)]
The core of the fix to allow opens to go async inside a compound request.

This is only allowed for opens that cause an oplock break, otherwise it
is not allowed. See [MS-SMB2].pdf note <194> on Section 3.3.5.2.7.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
(cherry picked from commit 10cbcfd167a4d7b1a22f9b42b684a66e424cbede)

10 years agoMove a variable into the area of code where it's used.
Jeremy Allison [Thu, 2 May 2013 20:08:16 +0000 (13:08 -0700)]
Move a variable into the area of code where it's used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
(cherry picked from commit 1102e73832f78ca5decc928d6c3649d4fe68eab7)

10 years agoEnsure we don't try and cancel anything that is in a compound-related request.
Jeremy Allison [Thu, 2 May 2013 19:34:54 +0000 (12:34 -0700)]
Ensure we don't try and cancel anything that is in a compound-related request.

Too hard to deal with splitting off the replies.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
(cherry picked from commit a026fc6b699719309a27d4646d06fe1a45b0d158)

10 years agoOnly do the 1 second delay for sharing violations for SMB1, not SMB2.
Jeremy Allison [Tue, 7 May 2013 19:07:16 +0000 (12:07 -0700)]
Only do the 1 second delay for sharing violations for SMB1, not SMB2.

Match Windows behavior.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
10 years agowinbind: Fix bug 9854 -- NULL pointer dereference
Volker Lendecke [Tue, 7 May 2013 10:39:16 +0000 (12:39 +0200)]
winbind: Fix bug 9854 -- NULL pointer dereference

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue May  7 14:49:07 CEST 2013 on sn-devel-104
(cherry picked from commit 8c1283a89f746a108e8014b6fbc9a58a371950cf)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Wed May  8 11:53:49 CEST 2013 on sn-devel-104

10 years agocheck_parent_exists() can change errno. Ensure we preserve it across calls.
Anand Avati [Mon, 29 Apr 2013 22:21:00 +0000 (15:21 -0700)]
check_parent_exists() can change errno. Ensure we preserve it across calls.

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): Tue Apr 30 11:00:11 CEST 2013 on sn-devel-104
(cherry picked from commit 7e807934e6550308efed814a20ce6d6dabbad557)

Fix bug #9833 - Function called in unix_convert() path can overwrite errno.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue May  7 10:32:43 CEST 2013 on sn-devel-104

10 years agoFix bug #9822 - Samba crashing during Win8 sync.
Jeremy Allison [Fri, 26 Apr 2013 17:47:41 +0000 (10:47 -0700)]
Fix bug #9822 - Samba crashing during Win8 sync.

When refactoring the dptr desctructor in the
fix for bug:

9778 (Samba directory code uses dirfd() without vectoring through a VFS call)

I removed the code to NULL out the struct smb_Dir *
pointer inside the fsp struct by mistake.

Re-add the NULLing out of that pointer when
closing a directory pointer associated with
an open file.

Reporter confirms it fixes the crash.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Sat Apr 27 20:44:55 CEST 2013 on sn-devel-104
(cherry picked from commit 251767cde9a146d8122d76e257ab232c05ad452a)

10 years agoRemove dependency on detection of HAVE_DIRFD for use of fdopendir().
Jeremy Allison [Wed, 10 Apr 2013 23:30:10 +0000 (16:30 -0700)]
Remove dependency on detection of HAVE_DIRFD for use of fdopendir().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Apr 12 16:21:10 CEST 2013 on sn-devel-104
(cherry picked from commit 7a4dd845958f1411daa8031ca242987001ab2f26)

10 years agoRemove the "Ugly hack" that was the second use of dirfd().
Jeremy Allison [Wed, 10 Apr 2013 23:29:03 +0000 (16:29 -0700)]
Remove the "Ugly hack" that was the second use of dirfd().

The destructor does all the resource deallocation needed.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 0fe894fb89f4867e266bb04670a58101311e0234)

10 years agoIn the struct smb_Dir destructor, use the fsp back pointer to release resources.
Jeremy Allison [Wed, 10 Apr 2013 23:24:15 +0000 (16:24 -0700)]
In the struct smb_Dir destructor, use the fsp back pointer to release resources.

Removes one use of dirfd().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit ea14c9443178da9ae6ccbe71e573156396f6f699)

10 years agoMaintain a back-pointer to the fsp in struct smb_Dir when opening with FDOPENDIR.
Jeremy Allison [Wed, 10 Apr 2013 23:21:39 +0000 (16:21 -0700)]
Maintain a back-pointer to the fsp in struct smb_Dir when opening with FDOPENDIR.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit e89ec641fc98ffd7f7193deb3728b0a284a093eb)

10 years agowinbind4: Fix bug 9832 -- talloc use after free
Volker Lendecke [Mon, 29 Apr 2013 16:40:08 +0000 (18:40 +0200)]
winbind4: Fix bug 9832 -- talloc use after free

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

10 years agoauth/ntlmssp: Avoid use-after-free of user_info after logon failure at log level 5
Andrew Bartlett [Fri, 15 Mar 2013 02:00:55 +0000 (13:00 +1100)]
auth/ntlmssp: Avoid use-after-free of user_info after logon failure at log level 5

Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 1dcd75df4941d7032a66d3fbb86ac76964444a3f)

Fix bug #9834 - segfault when loging in with wrong password from w2k8r2.

11 years agoBUG 9817: Fix 'map untrusted to domain' with NTLMv2.
Andreas Schneider [Wed, 24 Apr 2013 13:27:21 +0000 (15:27 +0200)]
BUG 9817: Fix 'map untrusted to domain' with NTLMv2.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Apr 24 17:14:48 CEST 2013 on sn-devel-104

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue Apr 30 11:16:19 CEST 2013 on sn-devel-104

11 years agobug 9830: fix panic in nt_printer_publish_ads
David Disseldorp [Thu, 25 Apr 2013 14:41:17 +0000 (16:41 +0200)]
bug 9830: fix panic in nt_printer_publish_ads

Check for ads_find_machine_acct() errors, to ensure a NULL LDAPMessage
pointer doesn't get passed to ldap_get_dn().

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-By: Günther Deschner <gd@samba.org>
11 years agos3:librpc: add support for PFC_FLAG_OBJECT_UUID when parsing packets (bug #9382)
Stefan Metzmacher [Mon, 12 Nov 2012 09:16:50 +0000 (10:16 +0100)]
s3:librpc: add support for PFC_FLAG_OBJECT_UUID when parsing packets (bug #9382)

Now the logic matches the one in dcerpc_read_ncacn_packet_done().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
11 years agoEnsure the RECVFILE path in vfs_pwrite_data() operates on a blocking socket.
Jeremy Allison [Mon, 8 Apr 2013 17:49:03 +0000 (10:49 -0700)]
Ensure the RECVFILE path in vfs_pwrite_data() operates on a blocking socket.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Apr 20 01:04:05 CEST 2013 on sn-devel-104
(cherry picked from commit 95f7fc83b251efefcc2a603b936b55e2f0308a72)

The last 13 patches address bug #9412 - SMB2 server doesn't support recvfile.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu Apr 25 14:39:27 CEST 2013 on sn-devel-104

11 years agoEnsure the RECVFILE path in vfs_write_data() operates on a blocking socket.
Jeremy Allison [Mon, 8 Apr 2013 17:32:10 +0000 (10:32 -0700)]
Ensure the RECVFILE path in vfs_write_data() operates on a blocking socket.

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

11 years agoEnsure drain_socket() operates on a blocking socket.
Jeremy Allison [Mon, 8 Apr 2013 17:16:48 +0000 (10:16 -0700)]
Ensure drain_socket() operates on a blocking socket.

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

11 years agoAdd the internals of is_smb2_recvfile_write.
Jeremy Allison [Mon, 1 Apr 2013 18:16:01 +0000 (11:16 -0700)]
Add the internals of is_smb2_recvfile_write.

This turns on the real receivefile detection, and completes
the receivefile code path changes.

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

11 years agoThe guts of the receivefile code changes.
Jeremy Allison [Mon, 1 Apr 2013 20:24:07 +0000 (13:24 -0700)]
The guts of the receivefile code changes.

If an incoming PDU might qualify, only read
SMBD_SMB2_SHORT_RECEIVEFILE_WRITE_LEN = (SMB2_HEADER + SMB2_WRITE_BODY_LEN)
bytes rather than the whole PDU.

Next time we're called, use is_smb2_recvfile_write() to decide if
this is an SMB2_WRITE that fit the receivefile criteria, otherwise
just read the rest of the PDU.

If we did do a short receivefile read, set up the smb2_req->smb1req->unread_bytes
value to show what bytes remain in the TCP buffers.

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

11 years agoAdd stub static function that will turn on/off receivefile code path.
Jeremy Allison [Mon, 1 Apr 2013 20:19:01 +0000 (13:19 -0700)]
Add stub static function that will turn on/off receivefile code path.

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

11 years agoAdd extra fields into struct smbd_smb2_request_read_state to support receivefile.
Jeremy Allison [Mon, 1 Apr 2013 20:17:09 +0000 (13:17 -0700)]
Add extra fields into struct smbd_smb2_request_read_state to support receivefile.

Initialize min_recv_size with the size that will trigger the
receivefile write path.

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

11 years agoAdd macro SMBD_SMB2_SHORT_RECEIVEFILE_WRITE_LEN.
Jeremy Allison [Mon, 1 Apr 2013 20:14:13 +0000 (13:14 -0700)]
Add macro SMBD_SMB2_SHORT_RECEIVEFILE_WRITE_LEN.

This is the 'short' length we'll read in the SMB2_WRITE receivefile
code path.

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

11 years agoAdd utility function get_min_receive_file_size().
Jeremy Allison [Mon, 1 Apr 2013 20:12:55 +0000 (13:12 -0700)]
Add utility function get_min_receive_file_size().

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

11 years agoAllow smbd_smb2_request_error_ex() to cope with unread bytes on error.
Jeremy Allison [Tue, 19 Mar 2013 19:36:52 +0000 (12:36 -0700)]
Allow smbd_smb2_request_error_ex() to cope with unread bytes on error.

Drain the socket if a RECVFILE write failed.

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

11 years agoAdd function smbd_smb2_unread_bytes().
Jeremy Allison [Tue, 19 Mar 2013 19:24:17 +0000 (12:24 -0700)]
Add function smbd_smb2_unread_bytes().

Returns number of bytes left to read for recvfile. Will be
used in SMB_2_WRITE_FILE code path.

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

11 years agoIf we already have an smb1req attached to the struct smbd_smb2_request, don't recreat...
Jeremy Allison [Tue, 19 Mar 2013 19:16:32 +0000 (12:16 -0700)]
If we already have an smb1req attached to the struct smbd_smb2_request, don't recreate it.

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

11 years agoEnsure we don't do an SMB2 aio write if RECVFILE is active.
Jeremy Allison [Mon, 18 Mar 2013 19:00:25 +0000 (12:00 -0700)]
Ensure we don't do an SMB2 aio write if RECVFILE is active.

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

11 years agosmbd: Fix signing when the async echo handler kicks in
Volker Lendecke [Fri, 19 Apr 2013 10:36:08 +0000 (12:36 +0200)]
smbd: Fix signing when the async echo handler kicks in

This was introduced as a copy&paste error in 5e0258fc932c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
(cherry picked from commit 5aa9e552ec70ffbd48495e0d7c28517e726487bf)

Fix bug #9824 - SMB signing and the async echo responder don't work together.

11 years agobuild: Replace #!/usr/bin/env python with passed in PYTHON=
Andrew Bartlett [Mon, 8 Apr 2013 05:57:45 +0000 (15:57 +1000)]
build: Replace #!/usr/bin/env python with passed in PYTHON=

This means that if we were forced to use a specific python for the build, we
will put that binary into the top of samba-tool, so it continues to work
after the install.

Andrew Bartlett

Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 58e3c5323e343dcab1c528c6b6a44925b76cb297)

The last 2 patches address bug #9785 - Fixes to use specified python for runtime
installation of Samba.

11 years agobuild: Remove extra space in shebang
Andrew Bartlett [Sun, 7 Apr 2013 22:33:55 +0000 (08:33 +1000)]
build: Remove extra space in shebang

Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 45a596fbe9ed2b198956d58784999df780f6dd65)

11 years agodocs: Fix bug 9809 -- missing entry in specfile
Volker Lendecke [Fri, 19 Apr 2013 14:17:13 +0000 (16:17 +0200)]
docs: Fix bug 9809 -- missing entry in specfile

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Mon Apr 22 11:35:52 CEST 2013 on sn-devel-104
(cherry picked from commit 5512a43a93833d3d6f1721d69c894db0e2c77ef8)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon Apr 22 13:39:14 CEST 2013 on sn-devel-104

11 years agoFix bug in old create temp SMB request. Only use VFS functions.
Jeremy Allison [Wed, 17 Apr 2013 21:42:20 +0000 (14:42 -0700)]
Fix bug in old create temp SMB request. Only use VFS functions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Fix bug #9811 - Old DOS SMB CTEMP request uses a non-VFS function to access the
filesystem.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon Apr 22 11:28:04 CEST 2013 on sn-devel-104

11 years agoBug 9807 - wbinfo: fix segfault in wbinfo_pam_logon
David Disseldorp [Wed, 17 Apr 2013 17:39:12 +0000 (10:39 -0700)]
Bug 9807 - wbinfo: fix segfault in wbinfo_pam_logon

wbinfo_pam_logon() incorrectly assumes that wbcLogonUser() always
returns an allocated wbcAuthErrorInfo struct on failure.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 17 21:29:29 CEST 2013 on sn-devel-104

11 years agowafsamba: display the default value in help for SAMBA3_ADD_OPTION
Stefan Metzmacher [Fri, 22 Mar 2013 08:37:09 +0000 (09:37 +0100)]
wafsamba: display the default value in help for SAMBA3_ADD_OPTION

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

Fix bug #9804 - wafsamba: display the default value in help for
SAMBA3_ADD_OPTION.

11 years agos3:wscript: change --with-dmapi to default=auto to match the autoconf build
Stefan Metzmacher [Fri, 22 Mar 2013 08:39:42 +0000 (09:39 +0100)]
s3:wscript: change --with-dmapi to default=auto to match the autoconf build

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Apr  3 11:45:12 CEST 2013 on sn-devel-104
(cherry picked from commit 79038397aa8786c92401312973185c7b14e8fa66)

Fix bug #9803 - change --with-dmapi to default=auto to match the autoconf build.

11 years agoEnsure we test the dirsort module in make test.
Jeremy Allison [Tue, 9 Apr 2013 23:56:24 +0000 (16:56 -0700)]
Ensure we test the dirsort module in make test.

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): Thu Apr 11 21:17:21 CEST 2013 on sn-devel-104

The last 10 patches address bug #9777 - vfs_dirsort uses non-stackable calls,
dirfd(), malloc instead of talloc and doesn't cope with directories being
modified whilst reading.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Wed Apr 17 10:43:37 CEST 2013 on sn-devel-104

11 years agoRemove unneeded initializations (we already talloc_zero).
Jeremy Allison [Tue, 9 Apr 2013 18:02:58 +0000 (11:02 -0700)]
Remove unneeded initializations (we already talloc_zero).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoRemove the use of dirfd inside the vfs_dirsort.c.
Jeremy Allison [Tue, 9 Apr 2013 17:50:55 +0000 (10:50 -0700)]
Remove the use of dirfd inside the vfs_dirsort.c.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoConvert mtime from a time_t to a struct timespec.
Jeremy Allison [Tue, 9 Apr 2013 17:43:53 +0000 (10:43 -0700)]
Convert mtime from a time_t to a struct timespec.

In preparation for removing the dirfd and using fsp_stat()
and VFS_STAT functions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoCheck SMB_VFS_NEXT_OPENDIR return in dirsort_opendir().
Jeremy Allison [Tue, 9 Apr 2013 17:38:24 +0000 (10:38 -0700)]
Check SMB_VFS_NEXT_OPENDIR return in dirsort_opendir().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoClean error paths in opendir and fd_opendir by only setting handle data on success.
Jeremy Allison [Tue, 9 Apr 2013 17:29:47 +0000 (10:29 -0700)]
Clean error paths in opendir and fd_opendir by only setting handle data on success.

Pass extra struct dirsort_privates * to open_and_sort_dir() function
to avoid it having to re-read the handle data.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
11 years agoProtect open_and_sort_dir() from the directory changing size.
Jeremy Allison [Mon, 8 Apr 2013 23:40:35 +0000 (16:40 -0700)]
Protect open_and_sort_dir() from the directory changing size.

Otherwise there could be an error between initial count, allocation
and re-read.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>