s3: smb2 - Negprot should return INVALID_PARAMETER if flags2 signed bit is set.

MS-SMB2: 3.3.5.2.4 Verifying the Signature.
If the SMB2 header of the SMB2 NEGOTIATE
request has the SMB2_FLAGS_SIGNED bit set in the
Flags field, the server MUST fail the request
with STATUS_INVALID_PARAMETER.

Found and fix confirmed by Microsoft test tool.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
s3: smb2 - Check supplied impersonation level on SMB2_CREATE.

MS-SMB2: 2.2.13 SMB2 CREATE Request
ImpersonationLevel ... MUST contain one of the following values.
The server MUST validate this field, but otherwise ignore it.

NB. source4/torture/smb2/durable_open.c shows that
this check is only done on real opens, not on durable
handle reopens.

Found and fix confirmed by Microsoft test tool.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
s3: smb2 - strictly obey file name restrictions w.r.t. the SMB2 protocol spec.

MS-SMB2: 3.3.5.9 - Receiving an SMB2 CREATE Request
If the file name length is greater than zero and the
first character is a path separator character, the
server MUST fail the request with
STATUS_INVALID_PARAMETER.

Found and fix confirmed by Microsoft test tool.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
s3: torture test. We now pass "samba3.smb2.create.leading-slash" so remove from knownfail.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
s4: torture : Add test case to show that a bad impersonation level causes an error on a regular file open.

An invalid impersonation level is only allowed for durable handle reopen.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 18 09:42:43 CEST 2014 on sn-devel-104
provision/sambadns: remove redundant site parameter

The sitename is already included in "names" parameter.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
samba-tool: add --site parameter to provision command

This new parameter offers the option to specify a default initial site name.
Otherwise it will be "Default-First-Site-Name".

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
samba-tool domain: remove duplicate check if site is set

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
lib: Apply const to nt_time_to_unix_timespec

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): Wed Jun 18 16:35:26 CEST 2014 on sn-devel-104
unix_msg: Lift sockaddr_un handling from unix_dgram_init

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
unix_msg: Lift sockaddr_un handling from unix_dgram_send_queue_init

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
unix_msg: Lift sockaddr_un handling from unix_dgram_send

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
unix_msg: Lift sockaddr_un handling from unix_msg_init

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
unix_msg: Lift sockaddr_un handling from unix_msg_send

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
messaging3: Remove use of full_path_tos()

This is not performance critical, and this removes source3 specific
code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
messaging3: Remove two uses of talloc_tos()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
messaging3: Make the _send function return 0/errno

This is to eventually make messaging_dgm usable in ctdb

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
messaging3: Make messaging_dgm_cleanup return 0/errno

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
messaging3: Make messaging_dgm_wipe return 0/errno

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
messaging3: simplify messaging_dgm_lockfile_remove

full_path_tos() isn't really required here, this is not a hot code path

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>