s3: smb2 server - fix bug 10167 smb2 breaks "smb encryption = mandatory

Refuse an SMB2 tcon on a share wher eencryption is required.
SMB2 doesn't support this.

Signed-off-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit e00a2c90847b3c85f089b4f3c96ec6c66b949576)
Fix is_legal_name() to not emit character conversion error messages.

Using next_codepoint() does the same check, but without the conversion
message.

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

Fix bug #10139 - valid utf8 filenames cause "invalid conversion error" messages.
(cherry picked from commit ee0ef2a5b4b06fdb723a5232f90212fda5e853d1)
Fix bug #10187 - Missing talloc_free can leak stackframe in error path.

Fix error path.

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): Wed Oct  9 03:50:56 CEST 2013 on sn-devel-104
(cherry picked from commit 63f370bdbad94d6aba7a4783d4238fcfc524b055)
idl: Add a new message for winbind domain states.

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

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 1a884636542ba0e54c6d209662a5d1613d727a85)
(cherry picked from commit 272a22e2dba836f60a1f628206c14fe1a24f49c5)
s3-winbind: Add functions for domain online/offline handling.

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

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 447ec17a6bec814a2ac5cadb74dbef5789f07c52)
(cherry picked from commit 2d226b2717d0a30186636d17a8d890e1b7de8151)
s3-winbind: Register handlers for domain online/offline messages.

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

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

(cherry picked from commit fc5941622010843d823b5c245eccc68d1d3bce19)
(cherry picked from commit 920f8013ad5c57aaa941d5c7aea335726ed0bbae)
s3-winbind: Send online/offline message of the domain to the parent.

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

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Oct 11 13:37:56 CEST 2013 on sn-devel-104

(cherry picked from commit 275f6586c4d4547978c6ff2f04670b0d8f89fd4b)
(cherry picked from commit 80a5575849c903a3cb4a9bd74f029e5b7c293aa3)
nsswitch: Fix short writes in winbind_write_sock

We set the socket to nonblocking and don't handle EAGAIN right. We do
a poll anyway, so wait for writability, which should fix this.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10195
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit c6909887c26d4e827633acd50b11cf08c6aee0f7)
Signed-off-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 3dfbea723553b268008063b280c808bb30951fdc)
Fix bug #10118 - Samba is chatty about being unable to open a printer.
(cherry picked from commit 906db4fe8e6de2de67afa4655603e67d887c370b)
xattr: fix listing EAs on *BSD for non-root users

Thanks to Stefan Rompf for reporting.

This fixes bug #10247

Back-ported to 3.6.next from master commit 374b2cfde74e0c61f4b2da724b30d0e430596092

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit d984e764073df34729e5410026d6fa618699126f)
spoolss: accept XPS_PASS datatype used by Windows 8

The new v4 driver model used in Windows 8 declares print jobs
intended to bypass the XPS processing layer by setting datatype to
"XPS_PASS" instead of "RAW".

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

Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit b2815b4c8c3e436a79fb7f07be285a417fd6e8cb)
(cherry picked from commit 4cfd6597bceeb0ef10d14bb7a48badd2264e85a6)
WHATSNEW: Add release notes for Samba 3.6.21.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
(cherry picked from commit c458263e352328db49becec65157e9ec477bdacc)
VERSION: Bump version up to 3.6.22.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
(cherry picked from commit d57a4d130bcbf88b7f060439a33797be89353e29)
CVE-2013-4408:librpc: check for invalid frag_len within dcerpc_read_ncacn_packet_done()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
CVE-2013-4408:librpc: check for invalid frag_len within dcerpc_read_ncacn_packet_next_vector()

We should do this explicit instead of relying on
tstream_readv_pdu_ask_for_next_vector() to catch the overflow.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
CVE-2013-4408:s3:rpc_client: check for invalid frag_len in dcerpc_pull_ncacn_packet()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
CVE-2013-4408:s3:rpc_client: verify frag_len at least contains the header size

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
CVE-2013-4408:s4:dcerpc: check for invalid frag_len in ncacn_pull()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
CVE-2013-4408:s4:dcerpc_smb: check for invalid frag_len in send_read_request_continue()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
CVE-2013-4408:s4:dcerpc_smb2: check for invalid frag_len in send_read_request_continue()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>