kai/samba.git
6 years agos4:lib/messaging: terminate the irpc_servers_byname() result with server_id_set_disco...
Stefan Metzmacher [Fri, 4 Jan 2013 12:27:26 +0000 (13:27 +0100)]
s4:lib/messaging: terminate the irpc_servers_byname() result with server_id_set_disconnected() (bug #9540)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agolibnet-vampire: reports Exops as they rather than sync on some partitions
Matthieu Patou [Mon, 31 Dec 2012 23:38:50 +0000 (15:38 -0800)]
libnet-vampire: reports Exops as they rather than sync on some partitions

Instead of showing:
Partition[CN=RODC,OU=Domain Controllers,DC=samba,DC=example,DC=com]
objects[1] linked_values[8]
Report a exop based on CN=RODC,OU=Domain Controllers,DC=samba,DC=example,DC=com
as
Exop on CN=RODC,OU=Domain Controllers,DC=samba,DC=example,DC=com, ...

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Matthieu Patou <mat@samba.org>
Autobuild-Date(master): Wed Jan  9 09:01:30 CET 2013 on sn-devel-104

6 years agoscript: Add a script to display testsuite runtime sorted
Matthieu Patou [Wed, 2 Jan 2013 04:56:16 +0000 (20:56 -0800)]
script: Add a script to display testsuite runtime sorted

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
6 years agolibnet: set the invocation_id earlier in order to avoid annoying messages
Matthieu Patou [Mon, 31 Dec 2012 10:12:23 +0000 (02:12 -0800)]
libnet: set the invocation_id earlier in order to avoid annoying messages

At that moment we have all the information to set the invocation id so
let's set it, it will avoid useless messages about missing invocation
id.

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
6 years agoreplace: Fix compilation of rep_mkstemp
Jesper Larsen [Fri, 4 Jan 2013 12:03:58 +0000 (13:03 +0100)]
replace: Fix compilation of rep_mkstemp

Commit 1fbc185 removed the variable 'p'.
Use the equivalent variable 'template' instead.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jan  9 07:18:33 CET 2013 on sn-devel-104

6 years agos3: Fix vfs_zfsacl to compile.
Ira Cooper [Thu, 27 Dec 2012 19:57:14 +0000 (19:57 +0000)]
s3: Fix vfs_zfsacl to compile.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoselftest: show that Samba honours "write list" and valid users
Andrew Bartlett [Thu, 20 Dec 2012 12:05:55 +0000 (23:05 +1100)]
selftest: show that Samba honours "write list" and valid users

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agoFixup the change_to_user_by_session() case as called from become_user_by_session()
Jeremy Allison [Tue, 8 Jan 2013 19:02:16 +0000 (11:02 -0800)]
Fixup the change_to_user_by_session() case as called from become_user_by_session()

Use inside source3/printing/nt_printing.c:get_correct_cversion().

Allow check_user_ok() to be called with vuid==UID_FIELD_INVALID.
All this should do is throw away one entry in the vuid cache.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agosmbd: Remove some ()
Volker Lendecke [Sun, 6 Jan 2013 13:50:33 +0000 (14:50 +0100)]
smbd: Remove some ()

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agosmbd: Simplify an if-expression
Volker Lendecke [Sun, 6 Jan 2013 13:41:24 +0000 (14:41 +0100)]
smbd: Simplify an if-expression

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agosmbd: Fix a typo
Volker Lendecke [Sun, 6 Jan 2013 13:39:07 +0000 (14:39 +0100)]
smbd: Fix a typo

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoMove create_share_access_mask() from smbd/service.c to smbd/uid.c.
Jeremy Allison [Fri, 4 Jan 2013 22:42:23 +0000 (14:42 -0800)]
Move create_share_access_mask() from smbd/service.c to smbd/uid.c.

Make it static. Only called from uid.c now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoFix bug #9518 - conn->share_access appears not be be reset between users.
Jeremy Allison [Fri, 4 Jan 2013 22:40:05 +0000 (14:40 -0800)]
Fix bug #9518 - conn->share_access appears not be be reset between users.

Ensure make_connection_snum() uses the same logic as
check_user_ok() to decide if a user can access a share.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoFactor code out of check_user_ok() into a call to check_user_share_access().
Jeremy Allison [Fri, 4 Jan 2013 22:35:46 +0000 (14:35 -0800)]
Factor code out of check_user_ok() into a call to check_user_share_access().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoInitialize stack variables. Prelude to factoring out calls to check_user_share_access().
Jeremy Allison [Fri, 4 Jan 2013 00:06:40 +0000 (16:06 -0800)]
Initialize stack variables. Prelude to factoring out calls to check_user_share_access().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoAdd check_user_share_access() which factors out the share security and read_only...
Jeremy Allison [Fri, 4 Jan 2013 22:27:18 +0000 (14:27 -0800)]
Add check_user_share_access() which factors out the share security and read_only flag setting code.

Allows this to be called from both make_connection_snum() as well as check_user_ok().
Gives a consistent share security check function.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoCorrectly setup the conn->share_access based on the current user token.
Jeremy Allison [Fri, 4 Jan 2013 22:25:55 +0000 (14:25 -0800)]
Correctly setup the conn->share_access based on the current user token.

Also use this to set conn->read_only. Cache the share_access in the
struct vuid_cache_entry struct so we only evaluate this once per new
user access on this share.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoChange API for create_share_access_mask() - remove conn struct.
Jeremy Allison [Fri, 4 Jan 2013 22:24:13 +0000 (14:24 -0800)]
Change API for create_share_access_mask() - remove conn struct.

Eventually this will be indepentent of conn, just pass in the
readonly flag.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoChange API for create_share_access_mask() to pass in the token.
Jeremy Allison [Fri, 4 Jan 2013 19:43:10 +0000 (11:43 -0800)]
Change API for create_share_access_mask() to pass in the token.

Don't automatically use the one from conn->session_info->security_token.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoFix API for create_share_access_mask().
Jeremy Allison [Fri, 21 Dec 2012 17:45:03 +0000 (09:45 -0800)]
Fix API for create_share_access_mask().

Return the uint32_t share_access rather than directly
changing the conn struct.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoRemove static from create_share_access_mask().
Jeremy Allison [Fri, 21 Dec 2012 17:35:31 +0000 (09:35 -0800)]
Remove static from create_share_access_mask().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoAdd uint32_t share_access to vuid_cache_entry.
Jeremy Allison [Fri, 21 Dec 2012 17:22:16 +0000 (09:22 -0800)]
Add uint32_t share_access to vuid_cache_entry.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoClean up struct connection_struct, make struct vuid_cache a pointer not inline.
Jeremy Allison [Thu, 20 Dec 2012 22:42:55 +0000 (14:42 -0800)]
Clean up struct connection_struct, make struct vuid_cache a pointer not inline.

Change VFS ABI to 31 for 4.1.0.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoRemove unneeded variable "const struct auth_session_info *session_info"
Jeremy Allison [Thu, 20 Dec 2012 19:55:09 +0000 (11:55 -0800)]
Remove unneeded variable "const struct auth_session_info *session_info"

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoRemove dead code now vuser can no longer be NULL.
Jeremy Allison [Thu, 20 Dec 2012 19:54:07 +0000 (11:54 -0800)]
Remove dead code now vuser can no longer be NULL.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoRemove the second set of {} braces, no longer needed.
Jeremy Allison [Thu, 20 Dec 2012 19:53:11 +0000 (11:53 -0800)]
Remove the second set of {} braces, no longer needed.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agoRemove one set of enclosing {} braces, no longer needed.
Jeremy Allison [Thu, 20 Dec 2012 19:52:27 +0000 (11:52 -0800)]
Remove one set of enclosing {} braces, no longer needed.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoMove the definition of struct vuid_cache_entry *ent outside blocks.
Jeremy Allison [Thu, 20 Dec 2012 19:51:55 +0000 (11:51 -0800)]
Move the definition of struct vuid_cache_entry *ent outside blocks.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoStart to tidy-up check_user_ok().
Jeremy Allison [Thu, 20 Dec 2012 19:50:25 +0000 (11:50 -0800)]
Start to tidy-up check_user_ok().

Now we have removed "security=share" we cannot be
called with vuid == UID_FIELD_INVALID.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agotorture/vfstest.c: Always use create_conn_struct(). Don't hand create connection...
Jeremy Allison [Tue, 8 Jan 2013 22:18:55 +0000 (14:18 -0800)]
torture/vfstest.c: Always use create_conn_struct(). Don't hand create connection structs.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agosource3/smbd/pysmbd.c: Always use create_conn_struct(). Don't hand create connection...
Jeremy Allison [Tue, 8 Jan 2013 22:18:27 +0000 (14:18 -0800)]
source3/smbd/pysmbd.c: Always use create_conn_struct(). Don't hand create connection structs.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agosmbd/posix_acls.c: Use create_conn_struct(). Don't hand-create connection structs.
Jeremy Allison [Tue, 8 Jan 2013 22:17:51 +0000 (14:17 -0800)]
smbd/posix_acls.c: Use create_conn_struct(). Don't hand-create connection structs.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoAllow create_conn_struct() to be called with snum == -1.
Jeremy Allison [Wed, 9 Jan 2013 00:26:50 +0000 (16:26 -0800)]
Allow create_conn_struct() to be called with snum == -1.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agosmbd: Rework create_conn_struct to use conn_new()
Andrew Bartlett [Tue, 8 Jan 2013 21:02:23 +0000 (08:02 +1100)]
smbd: Rework create_conn_struct to use conn_new()

This avoids issues with required structure elements not being initialised.

In particular, once conn->vuid_cache becomes a pointer, this ensures
that it is initalised in all cases.

Andrew Bartlett

Reviewed by: Jeremy Allison <jra@samba.org>

6 years agosmbd: Fix bug 9549 -- Memleak in the async echo handler
Volker Lendecke [Tue, 8 Jan 2013 14:34:19 +0000 (15:34 +0100)]
smbd: Fix bug 9549 -- Memleak in the async echo handler

Reviewed by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan  8 23:30:41 CET 2013 on sn-devel-104

6 years agosamba-tool Add --service argument to samba-tool ntacl get/set
Andrew Bartlett [Sat, 15 Dec 2012 10:24:26 +0000 (21:24 +1100)]
samba-tool Add --service argument to samba-tool ntacl get/set

This also ensures a VFS connect is done to the correct service.

Andrew Bartlett

Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan  8 03:39:21 CET 2013 on sn-devel-104

6 years agopysmbd: Change to keyword based arguments
Andrew Bartlett [Sat, 15 Dec 2012 10:17:30 +0000 (21:17 +1100)]
pysmbd: Change to keyword based arguments

Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoscripting-provision: Set sysvol ACLs on the sysvol share
Andrew Bartlett [Fri, 14 Dec 2012 11:17:23 +0000 (22:17 +1100)]
scripting-provision: Set sysvol ACLs on the sysvol share

This allows us to correctly load any modules that have been specified
by the smb.conf for [sysvol] and issue a VFS connect operation which
may be required by some VFS modules.

Andrew Bartlett

Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoscripting-ntacls: Optionally allow the service to be specified.
Andrew Bartlett [Fri, 14 Dec 2012 11:09:18 +0000 (22:09 +1100)]
scripting-ntacls: Optionally allow the service to be specified.

Providing a service allows a VFS connect to be issued on the correct
service, and so ensures that the correct modules are loaded rather
than just what is specified in [globals].

Andrew Bartlett

Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agopysmbd: Convert pysmbd to take an optional service to connect to
Andrew Bartlett [Wed, 10 Oct 2012 02:48:27 +0000 (13:48 +1100)]
pysmbd: Convert pysmbd to take an optional service to connect to

This uses create_conn_struct to correctly call VFS_CONNECT(), but only
if a service has been specified.

Andrew Bartlett

Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agosmbd: Fix calls to create_conn_struct_cwd to be correctly indented.
Andrew Bartlett [Mon, 7 Jan 2013 22:29:48 +0000 (09:29 +1100)]
smbd: Fix calls to create_conn_struct_cwd to be correctly indented.

These are whitespace changes only, left out of the previous commit to preserve clarity.

Andrew Bartlett.

Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agosmbd: Split create_conn_struct into a fn that does not change the working dir
Andrew Bartlett [Wed, 10 Oct 2012 02:47:49 +0000 (13:47 +1100)]
smbd: Split create_conn_struct into a fn that does not change the working dir

The python bindings do not want the current working directory changed
during operations, so we provide two functions, one providing the
original behaviour, and other providing the python bindings with just
the memory allocation and initilisation stuff.

Andrew Bartlett

Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agospoolss: add stubs for new JobNamedProperty dcerpc calls.
Günther Deschner [Mon, 7 Jan 2013 14:15:21 +0000 (15:15 +0100)]
spoolss: add stubs for new JobNamedProperty dcerpc calls.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jan  7 19:06:25 CET 2013 on sn-devel-104

6 years agospoolss: add SPOOLSS_DRIVER_VERSION_2012 (4) define to IDL.
Günther Deschner [Mon, 7 Jan 2013 14:14:30 +0000 (15:14 +0100)]
spoolss: add SPOOLSS_DRIVER_VERSION_2012 (4) define to IDL.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agospoolss: add Windows ARM architecture defines to IDL.
Günther Deschner [Mon, 7 Jan 2013 14:14:02 +0000 (15:14 +0100)]
spoolss: add Windows ARM architecture defines to IDL.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agotdb: Fix undefined prototype warnings
Volker Lendecke [Fri, 14 Dec 2012 21:49:05 +0000 (22:49 +0100)]
tdb: Fix undefined prototype warnings

These functions are deliberately left without prototypes according to
3fdeaa399, but without prototypes we get warnings.

Reviewed-by: Rusty Russell <rusty@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jan  7 11:20:19 CET 2013 on sn-devel-104

6 years agotdb: Fix \n in error messages
Volker Lendecke [Wed, 26 Dec 2012 20:42:14 +0000 (21:42 +0100)]
tdb: Fix \n in error messages

Reviewed-by: Rusty Russell <rusty@samba.org>
6 years agos3-net: Fix rpc_service_list_internal() null pointer passing.
Andreas Schneider [Fri, 21 Dec 2012 15:03:51 +0000 (16:03 +0100)]
s3-net: Fix rpc_service_list_internal() null pointer passing.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Found by Coverity.

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Jan  2 14:19:50 CET 2013 on sn-devel-104

6 years agos3-rpcclient: Fix cmd_eventlog_loginfo() null pointer passing.
Andreas Schneider [Fri, 21 Dec 2012 14:58:49 +0000 (15:58 +0100)]
s3-rpcclient: Fix cmd_eventlog_loginfo() null pointer passing.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Found by Coverity.

6 years agos3-rpcclient: Fix cmd_eventlog_readlog() null pointer passing.
Andreas Schneider [Fri, 21 Dec 2012 14:52:02 +0000 (15:52 +0100)]
s3-rpcclient: Fix cmd_eventlog_readlog() null pointer passing.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Found by Coverity.

6 years agos3-idmap: Check return value of string_to_sid().
Andreas Schneider [Fri, 14 Dec 2012 15:54:55 +0000 (16:54 +0100)]
s3-idmap: Check return value of string_to_sid().

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
6 years agodocs: Fix typo in vfs_tsmsm.8.xml.
Samba-JP oota [Wed, 2 Jan 2013 09:21:51 +0000 (10:21 +0100)]
docs: Fix typo in vfs_tsmsm.8.xml.

Reviewed-by: Karolin Seeger <kseeger@samba.org>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Wed Jan  2 12:12:12 CET 2013 on sn-devel-104

6 years agodocs: Remove superfluous bracket.
Samba-JP oota [Wed, 2 Jan 2013 08:12:14 +0000 (09:12 +0100)]
docs: Remove superfluous bracket.

Reviewed-by: Karolin Seeger <kseeger@samba.org>
6 years agos4:drsuapi: try to behave more like windows for usn order (bug #9508)
Stefan Metzmacher [Sat, 15 Dec 2012 09:18:08 +0000 (10:18 +0100)]
s4:drsuapi: try to behave more like windows for usn order (bug #9508)

We don't behave completely like a Windows server, but it's much more
identical than before.

The partition head is always the first object followed by the rest
sorted by uSNChanged.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan  1 21:09:42 CET 2013 on sn-devel-104

6 years agos4:drsuapi: make use of LDB_TYPESAFE_QSORT() and pass getnc_state
Stefan Metzmacher [Tue, 18 Dec 2012 14:16:28 +0000 (15:16 +0100)]
s4:drsuapi: make use of LDB_TYPESAFE_QSORT() and pass getnc_state

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:drsuapi: make sure we report the meta data from the cycle start (bug #9508)
Stefan Metzmacher [Tue, 18 Dec 2012 13:59:20 +0000 (14:59 +0100)]
s4:drsuapi: make sure we report the meta data from the cycle start (bug #9508)

We should build the final highwatermark and uptodatevector of
a replication cycle at the start of the cycle. Before we
search for the currently missing objects.

Otherwise we risk that some objects get lost.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:drsuapi: check the source_dsa_invocation_id (bug #9508)
Stefan Metzmacher [Tue, 18 Dec 2012 12:40:33 +0000 (13:40 +0100)]
s4:drsuapi: check the source_dsa_invocation_id (bug #9508)

The given highwatermark is only valid relative to the
specified source_dsa_invocation_id.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:drsuapi: make sure we never return the same highwatermark twice in a replication...
Stefan Metzmacher [Mon, 17 Dec 2012 10:30:26 +0000 (11:30 +0100)]
s4:drsuapi: make sure we never return the same highwatermark twice in a replication cycle (bug #9508)

If the highwatermark given by the client is not the one we expect,
we need to start a new replication cycle. Otherwise the destination dsa
skips objects and linked attribute values.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:drsuapi: add drsuapi_DsReplicaHighWaterMark_cmp()
Stefan Metzmacher [Mon, 17 Dec 2012 10:13:43 +0000 (11:13 +0100)]
s4:drsuapi: add drsuapi_DsReplicaHighWaterMark_cmp()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:drsuapi: always use the current uptodateness_vector
Stefan Metzmacher [Mon, 17 Dec 2012 15:34:25 +0000 (16:34 +0100)]
s4:drsuapi: always use the current uptodateness_vector

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:drsuapi: avoid a ldb_dn_copy() and use talloc_move() instead
Stefan Metzmacher [Tue, 18 Dec 2012 11:44:43 +0000 (12:44 +0100)]
s4:drsuapi: avoid a ldb_dn_copy() and use talloc_move() instead

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:drsuapi: remove unused 'highest_usn' from drsuapi_getncchanges_state
Stefan Metzmacher [Mon, 17 Dec 2012 12:48:01 +0000 (13:48 +0100)]
s4:drsuapi: remove unused 'highest_usn' from drsuapi_getncchanges_state

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:drsuapi: move struct drsuapi_getncchanges_state to the top of getncchanges.c
Stefan Metzmacher [Mon, 17 Dec 2012 13:08:56 +0000 (14:08 +0100)]
s4:drsuapi: move struct drsuapi_getncchanges_state to the top of getncchanges.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:dsdb/drepl: update the source_dsa_obj/invocation_id in repsFrom
Stefan Metzmacher [Wed, 19 Dec 2012 16:31:28 +0000 (17:31 +0100)]
s4:dsdb/drepl: update the source_dsa_obj/invocation_id in repsFrom

The highwatermark is relative to the source_dsa_invocation_id.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:dsdb/common: use 01.01.1970 as last_sync_success for our entry in the uptodatevector
Stefan Metzmacher [Wed, 19 Dec 2012 16:33:13 +0000 (17:33 +0100)]
s4:dsdb/common: use 01.01.1970 as last_sync_success for our entry in the uptodatevector

This matches a Windows 2008R2 and 2012 server.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:dsdb/common: use LDB_SEQ_HIGHEST_SEQ for our entry in the uptodatevector
Stefan Metzmacher [Wed, 19 Dec 2012 11:47:43 +0000 (12:47 +0100)]
s4:dsdb/common: use LDB_SEQ_HIGHEST_SEQ for our entry in the uptodatevector

We should use the global highestCommittedUSN, not the per partition value.

This matches a Windows 2008R2 and 2012 server.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:dsdb/repl_meta_data: don't merge highwatermark and uptodatevector (bug #9508)
Stefan Metzmacher [Tue, 18 Dec 2012 13:46:23 +0000 (14:46 +0100)]
s4:dsdb/repl_meta_data: don't merge highwatermark and uptodatevector (bug #9508)

We should not do any magic regarding the highwatermark we got from
the source dsa. We need to treat it as opaque and not try to be smart
and merge it into the uptodatevector.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:dsdb/repl_meta_data: also update the last_sync_success in replUpToDateVector
Stefan Metzmacher [Thu, 20 Dec 2012 14:46:05 +0000 (15:46 +0100)]
s4:dsdb/repl_meta_data: also update the last_sync_success in replUpToDateVector

This matches Windows 2008R2 and Windows 2012.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:dsdb/repl_meta_data: store the last results and timestamps in the repsFrom
Stefan Metzmacher [Wed, 19 Dec 2012 16:29:04 +0000 (17:29 +0100)]
s4:dsdb/repl_meta_data: store the last results and timestamps in the repsFrom

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:dsdb/repl_meta_data: always treat the highwatermark as opaque (bug #9508)
Stefan Metzmacher [Tue, 18 Dec 2012 13:46:23 +0000 (14:46 +0100)]
s4:dsdb/repl_meta_data: always treat the highwatermark as opaque (bug #9508)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:scripting/python: always treat the highwatermark as opaque (bug #9508)
Stefan Metzmacher [Tue, 18 Dec 2012 13:46:23 +0000 (14:46 +0100)]
s4:scripting/python: always treat the highwatermark as opaque (bug #9508)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoselftest/flapping: more samba4.rpc.samr.large-dc.two subtests are flakey
Stefan Metzmacher [Tue, 1 Jan 2013 14:43:57 +0000 (15:43 +0100)]
selftest/flapping: more samba4.rpc.samr.large-dc.two subtests are flakey

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan  1 18:47:42 CET 2013 on sn-devel-104

6 years agoHappy New Year 2013
Stefan Metzmacher [Tue, 1 Jan 2013 14:43:36 +0000 (15:43 +0100)]
Happy New Year 2013

Signed-off-by: Stefan Metzmacher <metze@samba.org>
6 years agosubunit: Update to latest upstream version.
Jelmer Vernooij [Wed, 26 Dec 2012 21:11:13 +0000 (22:11 +0100)]
subunit: Update to latest upstream version.

Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Thu Dec 27 21:08:32 CET 2012 on sn-devel-104

6 years agotesttools: Update to latest upstream version.
Jelmer Vernooij [Wed, 26 Dec 2012 21:11:04 +0000 (22:11 +0100)]
testtools: Update to latest upstream version.

6 years agolib/param: use the correct path names again
Stefan Metzmacher [Thu, 27 Dec 2012 15:09:39 +0000 (16:09 +0100)]
lib/param: use the correct path names again

This fixes a regression which was introduced by commit
5b1d95046c8ea624419d94dd7d9e2785ba86f556.

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): Thu Dec 27 19:19:55 CET 2012 on sn-devel-104

6 years agoselftest/flapping: mark samba4.rpc.samr.large-dc.two as knownfail
Stefan Metzmacher [Thu, 27 Dec 2012 14:35:58 +0000 (15:35 +0100)]
selftest/flapping: mark samba4.rpc.samr.large-dc.two as knownfail

This is really flakey lately:

https://git.samba.org/autobuild.flakey/2012-12-27-1533/samba.stdout
...
https://git.samba.org/autobuild.flakey/2012-12-10-2338/samba.stdout
...
https://git.samba.org/autobuild.flakey/2012-12-09-0135/samba.stdout
...
https://git.samba.org/autobuild.flakey/2012-12-06-0333/samba.stdout
...
https://git.samba.org/autobuild.flakey/2012-12-05-0731/samba.stdout
...
https://git.samba.org/autobuild.flakey/2012-12-03-0334/samba.stdout
...
https://git.samba.org/autobuild.flakey/2012-12-02-1532/samba.stdout

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Dec 27 17:36:07 CET 2012 on sn-devel-104

6 years agoselftest.pl: Fix typo 'snprintf' -> 'sprintf'.
Jelmer Vernooij [Sat, 15 Dec 2012 21:16:28 +0000 (22:16 +0100)]
selftest.pl: Fix typo 'snprintf' -> 'sprintf'.

Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Wed Dec 26 22:35:12 CET 2012 on sn-devel-104

6 years agowafsamba: python-config is not always a script.
Jelmer Vernooij [Sun, 16 Dec 2012 14:01:53 +0000 (15:01 +0100)]
wafsamba: python-config is not always a script.

6 years agoRecent coverity changes added directory_create_or_exist() checks to many directories.
Jeremy Allison [Fri, 21 Dec 2012 23:16:10 +0000 (15:16 -0800)]
Recent coverity changes added directory_create_or_exist() checks to many directories.

These may not be needed, but in the meantime - ensure "make test" works again
by chmod'ing the created test directories from 0777 to 0755.

Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Dec 22 02:08:33 CET 2012 on sn-devel-104

6 years agos3-prefork: Directly fail if tevent_req_is_unix_error() fails.
Andreas Schneider [Thu, 13 Dec 2012 13:18:02 +0000 (14:18 +0100)]
s3-prefork: Directly fail if tevent_req_is_unix_error() fails.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Dec 21 15:38:19 CET 2012 on sn-devel-104

6 years agos3-libsmb: Remove check if array is NULL.
Andreas Schneider [Wed, 19 Dec 2012 13:10:05 +0000 (14:10 +0100)]
s3-libsmb: Remove check if array is NULL.

rdata is an array with data. rdlength defines how big rdata is. So if
rdlength is not set we have a big problem.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agos3-rpc_server: Fix username and remote check.
Andreas Schneider [Wed, 19 Dec 2012 10:20:50 +0000 (11:20 +0100)]
s3-rpc_server: Fix username and remote check.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agos4-libcli: Use a do-while loop.
Andreas Schneider [Wed, 19 Dec 2012 09:37:08 +0000 (10:37 +0100)]
s4-libcli: Use a do-while loop.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agos3-lib: Cleanup transfer_file_internal() a bit.
Andreas Schneider [Tue, 18 Dec 2012 16:21:14 +0000 (17:21 +0100)]
s3-lib: Cleanup transfer_file_internal() a bit.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agolibgpo: Make it clear that we want to fall trough here.
Andreas Schneider [Tue, 18 Dec 2012 15:41:37 +0000 (16:41 +0100)]
libgpo: Make it clear that we want to fall trough here.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agos4-dsdb: Make it clear that we want to fall trough here.
Andreas Schneider [Tue, 18 Dec 2012 15:39:40 +0000 (16:39 +0100)]
s4-dsdb: Make it clear that we want to fall trough here.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agos3-rpc_server: Make it clear we want to fall trough here.
Andreas Schneider [Tue, 18 Dec 2012 15:36:07 +0000 (16:36 +0100)]
s3-rpc_server: Make it clear we want to fall trough here.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agos3-lib: Make it clear that we want to fall trough here.
Andreas Schneider [Tue, 18 Dec 2012 15:33:14 +0000 (16:33 +0100)]
s3-lib: Make it clear that we want to fall trough here.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agos3-netapi: Add missing break in NetUserSetInfo_r().
Andreas Schneider [Tue, 18 Dec 2012 15:31:36 +0000 (16:31 +0100)]
s3-netapi: Add missing break in NetUserSetInfo_r().

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agos3-libsmb: Fix a possible null pointer dereference.
Andreas Schneider [Tue, 18 Dec 2012 15:06:19 +0000 (16:06 +0100)]
s3-libsmb: Fix a possible null pointer dereference.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agos3-rpc_server: Fix null pointer derefs in rpc_pipe_open_interface().
Andreas Schneider [Mon, 17 Dec 2012 16:46:34 +0000 (17:46 +0100)]
s3-rpc_server: Fix null pointer derefs in rpc_pipe_open_interface().

Found by Coverity and asn ;)

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agos3-winbind: Fix null pointer dereference in store_memory_creds().
Andreas Schneider [Mon, 17 Dec 2012 16:18:14 +0000 (17:18 +0100)]
s3-winbind: Fix null pointer dereference in store_memory_creds().

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agos3-vfs: Fix a null pointer deferference in vfs_media_harmony.
Andreas Schneider [Mon, 17 Dec 2012 14:36:32 +0000 (15:36 +0100)]
s3-vfs: Fix a null pointer deferference in vfs_media_harmony.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agos3-rpc_server: Fix a possible null pointer dereference.
Andreas Schneider [Mon, 17 Dec 2012 14:31:21 +0000 (15:31 +0100)]
s3-rpc_server: Fix a possible null pointer dereference.

This variable can be set to NULL in an earlier function call.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agos3-vfs: Fix typo in readonly_connect().
Andreas Schneider [Mon, 17 Dec 2012 14:21:10 +0000 (15:21 +0100)]
s3-vfs: Fix typo in readonly_connect().

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agolibcli: Fix smb2cli_ioctl_send() if clause.
Andreas Schneider [Mon, 17 Dec 2012 14:17:45 +0000 (15:17 +0100)]
libcli: Fix smb2cli_ioctl_send() if clause.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agolibwbclient: Fix null check in process_domain_info_string().
Andreas Schneider [Mon, 17 Dec 2012 13:17:59 +0000 (14:17 +0100)]
libwbclient: Fix null check in process_domain_info_string().

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agos3-rpc_server: Fix useless check if we still have a valid string.
Andreas Schneider [Mon, 17 Dec 2012 13:40:17 +0000 (14:40 +0100)]
s3-rpc_server: Fix useless check if we still have a valid string.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agos3-libads: Fix copy&paste error in ads_keytab_add_entry().
Andreas Schneider [Mon, 17 Dec 2012 13:33:45 +0000 (14:33 +0100)]
s3-libads: Fix copy&paste error in ads_keytab_add_entry().

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>