samba.git
8 years agoVERSION: Disable git snapshot for the 4.2.2 release. samba-4.2.2
Karolin Seeger [Wed, 27 May 2015 19:45:21 +0000 (21:45 +0200)]
VERSION: Disable git snapshot for the 4.2.2 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
8 years agoWHATSNEW: Add release notes for Samba 4.2.2.
Karolin Seeger [Wed, 27 May 2015 19:43:36 +0000 (21:43 +0200)]
WHATSNEW: Add release notes for Samba 4.2.2.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
8 years agos4: libcli/finddcs_cldap: continue processing CLDAP until all addresses are used
Alexander Bokovoy [Wed, 20 May 2015 08:17:38 +0000 (11:17 +0300)]
s4: libcli/finddcs_cldap: continue processing CLDAP until all addresses are used

This is a subtle bug that causes CLDAP pings to fail if SRV records
discovered cannot be resolved or connection to them cannot be
established. The code that fires up CLDAP ping will silently cancel
the whole tevent request without going to the next server in the queue.

This may happen, for example, when connection to IPv6 addresses couldn't
be established, or when IPv4 address is not online or blocked by
firewall.

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit eb029b32e95c9e7382488f3a1b033cdbe3237c1c)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Thu May 21 20:06:21 CEST 2015 on sn-devel-104

8 years agotorture: Add smb2.notify.rmdir
Volker Lendecke [Mon, 20 Apr 2015 10:44:07 +0000 (10:44 +0000)]
torture: Add smb2.notify.rmdir

We need to cancel a pending FileChangeNotify with DELETE_PENDING if the
directory watched is about to be deleted.

I know I just deleted a bool parameter, but to me torture is different :-)

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

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 Apr 23 01:36:48 CEST 2015 on sn-devel-104

(cherry picked from commit 79dc084dcb6e28211addfc5d75b817cc735d67c1)

8 years agosmbd: Cancel pending notifies if the directory goes away
Volker Lendecke [Tue, 21 Apr 2015 08:16:16 +0000 (10:16 +0200)]
smbd: Cancel pending notifies if the directory goes away

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

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

8 years agosmbd: Remove bool arg from set_delete_on_close_lck
Volker Lendecke [Tue, 21 Apr 2015 09:41:45 +0000 (11:41 +0200)]
smbd: Remove bool arg from set_delete_on_close_lck

We now have reset_delete_on_close_lck, this was called with "true"
everywhere now.

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

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

8 years agosmbd: Use reset_delete_on_close_lck directly
Volker Lendecke [Tue, 21 Apr 2015 09:38:32 +0000 (11:38 +0200)]
smbd: Use reset_delete_on_close_lck directly

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

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

8 years agosmbd: Introduce reset_delete_on_close_lck
Volker Lendecke [Tue, 21 Apr 2015 09:36:30 +0000 (11:36 +0200)]
smbd: Introduce reset_delete_on_close_lck

Boolean flags passed down make things more complex than necessary...

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

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

8 years agos3:winbindd: make sure we remove pending io requests before closing client sockets
Stefan Metzmacher [Mon, 18 May 2015 11:17:40 +0000 (13:17 +0200)]
s3:winbindd: make sure we remove pending io requests before closing client sockets

This avoids a crash inside the tevent epoll backend.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed May 20 22:16:54 CEST 2015 on sn-devel-104

(cherry picked from commit 435ddd8223eaa6fafb62cead0399bdd042d998e8)

8 years agolibads: record service ticket endtime for sealed ldap connections
Uri Simchoni [Sat, 9 May 2015 19:59:17 +0000 (22:59 +0300)]
libads: record service ticket endtime for sealed ldap connections

When a ticket is obtained for binding a signed/sealed ldap connection,
its liftime should be recorded in the ads struct, in order to enable
reuse of the connection.

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

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <rb@sernet.de>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed May 13 04:32:16 CEST 2015 on sn-devel-104

(cherry picked from commit 40eac8e4d8bc85f2329b8ed6c5ba96a141dc20a3)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Wed May 20 16:33:17 CEST 2015 on sn-devel-104

8 years agogencache: don't fail gencache_stabilize if there were records to delete.
Michael Adam [Wed, 4 Feb 2015 13:47:20 +0000 (14:47 +0100)]
gencache: don't fail gencache_stabilize if there were records to delete.

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

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

8 years agos3: torture: Add regression test for bug #11249.
Jeremy Allison [Sat, 2 May 2015 04:08:21 +0000 (21:08 -0700)]
s3: torture: Add regression test for bug #11249.

Bug 11249 - Mangled names do not work with acl_xattr

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue May  5 16:37:18 CEST 2015 on sn-devel-104

(cherry picked from commit 9928d9832cccb11c4a605c5ce31be3af961c141f)

8 years agos3: smbd: VFS: fake_acl module called get_full_smb_filename() with a stream path...
Jeremy Allison [Tue, 5 May 2015 02:56:39 +0000 (19:56 -0700)]
s3: smbd: VFS: fake_acl module called get_full_smb_filename() with a stream path, then used the result to call XATTR functions directly.

Ensure when pulling XATTR values, we don't allow a stream filename.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 0f23bf228ceb38b024a77fcf2916971ad4f6aa4d)

8 years agos3: smbd: VFS: For all EA and ACL calls use synthetic_smb_fname(), not synthetic_smb_...
Jeremy Allison [Sat, 2 May 2015 04:06:20 +0000 (21:06 -0700)]
s3: smbd: VFS: For all EA and ACL calls use synthetic_smb_fname(), not synthetic_smb_fname_split().

EA's and ACL paths are all post-stream name checks (and shouldn't
get stream names). This one took a *long* time to find.

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

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

8 years agos3: smbd: VFS: All the places that are currently calling vfs_stat_smb_fname() and...
Jeremy Allison [Fri, 1 May 2015 20:09:36 +0000 (13:09 -0700)]
s3: smbd: VFS: All the places that are currently calling vfs_stat_smb_fname() and vfs_lstat_smb_fname() should be calling vfs_stat_smb_basename().

They are all post-stream name processing.

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

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

8 years agos3: smbd: VFS: Add vfs_stat_smb_basename() - to be called when we *know* stream name...
Jeremy Allison [Fri, 1 May 2015 19:50:51 +0000 (12:50 -0700)]
s3: smbd: VFS: Add vfs_stat_smb_basename() - to be called when we *know* stream name parsing has already been done.

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

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

8 years agovfs_gpfs: move failure label before END_PROFILE
Ralph Boehme [Thu, 30 Apr 2015 10:29:57 +0000 (12:29 +0200)]
vfs_gpfs: move failure label before END_PROFILE

The label was added in 5e65ae14ddb74c648f31b4dfbacd4af9c02ca058 as part
of fix for bug 11244, but was wrongly placed behind END_PROFILE.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu May  7 19:22:00 CEST 2015 on sn-devel-104

(cherry picked from commit 3876e59826ad17466975ae9e9a65879c76737b2b)

8 years agovfp_gpfs: ensure END_PROFILE is always called
Ralph Boehme [Wed, 29 Apr 2015 18:48:08 +0000 (20:48 +0200)]
vfp_gpfs: ensure END_PROFILE is always called

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Apr 30 19:34:41 CEST 2015 on sn-devel-104

(cherry picked from commit 5e65ae14ddb74c648f31b4dfbacd4af9c02ca058)

8 years agovfs_fruit: comment fix: the options are documented
Ralph Boehme [Wed, 25 Mar 2015 11:56:07 +0000 (12:56 +0100)]
vfs_fruit: comment fix: the options are documented

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May  8 21:27:45 CEST 2015 on sn-devel-104

(cherry picked from commit fe93f7d677995c41e15d4af68b4ec064796a4d5b)

8 years agovfs_fruit: add option "nfs_aces" that controls the NFS ACEs stuff
Ralph Boehme [Wed, 25 Mar 2015 14:09:02 +0000 (15:09 +0100)]
vfs_fruit: add option "nfs_aces" that controls the NFS ACEs stuff

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 1b8a0e6a26bc212905a160c32b936ef0ea24c0b2)

8 years agos3:smbXsrv: refactor duplicate code into smbXsrv_session_clear_and_logoff()
Michael Adam [Wed, 6 May 2015 15:20:55 +0000 (17:20 +0200)]
s3:smbXsrv: refactor duplicate code into smbXsrv_session_clear_and_logoff()

This replaces code in smbXsrv_session_logoff_all_callback()
and smbXsrv_session_clear_and_logoff().

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11182

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu May  7 10:43:29 CEST 2015 on sn-devel-104

(cherry picked from commit c7fcab7999c763acbc0f9dadb7fe05b47a257c7a)

8 years agos3:selftest: run smb2.notify with --signing=required
Stefan Metzmacher [Fri, 1 May 2015 18:26:41 +0000 (20:26 +0200)]
s3:selftest: run smb2.notify with --signing=required

This reproduces a bug withe implicit canceled requests.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
8 years agos3:smb2_tcon: cancel pending requests on all connections on tdis
Stefan Metzmacher [Fri, 1 May 2015 14:50:55 +0000 (16:50 +0200)]
s3:smb2_tcon: cancel pending requests on all connections on tdis

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

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

8 years agos3:smb2_sesssetup: remove unused smbd_smb2_session_setup_* destructors
Stefan Metzmacher [Sat, 2 May 2015 14:29:03 +0000 (16:29 +0200)]
s3:smb2_sesssetup: remove unused smbd_smb2_session_setup_* destructors

The cleanup of a failing session setup is now handled in
smbd_smb2_session_setup_wrap_*().

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

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

8 years agos3:smb2_sesssetup: add smbd_smb2_session_setup_wrap_send/recv()
Stefan Metzmacher [Sat, 2 May 2015 14:21:25 +0000 (16:21 +0200)]
s3:smb2_sesssetup: add smbd_smb2_session_setup_wrap_send/recv()

The wrapper calls smbXsrv_session_shutdown_send/recv() in case of an error,
this makes sure a failing reauth shuts down the session like an explicit logoff.

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

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

8 years agos3:smb2_sesssetup: always assign smb2req->session when a session was created.
Stefan Metzmacher [Sat, 2 May 2015 14:27:26 +0000 (16:27 +0200)]
s3:smb2_sesssetup: always assign smb2req->session when a session was created.

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

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

8 years agos3:smb2_sesssetup: let smbd_smb2_logoff_* use smbXsrv_session_shutdown_*
Stefan Metzmacher [Sat, 2 May 2015 14:20:06 +0000 (16:20 +0200)]
s3:smb2_sesssetup: let smbd_smb2_logoff_* use smbXsrv_session_shutdown_*

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

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

8 years agos3:smbXsrv_session: cancel pending requests when we logoff a previous session
Stefan Metzmacher [Sat, 2 May 2015 14:13:27 +0000 (16:13 +0200)]
s3:smbXsrv_session: cancel pending requests when we logoff a previous session

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

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

8 years agos3:smbXsrv_session: add smb2srv_session_shutdown_send/recv helper functions
Stefan Metzmacher [Sat, 2 May 2015 07:57:03 +0000 (09:57 +0200)]
s3:smbXsrv_session: add smb2srv_session_shutdown_send/recv helper functions

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

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

8 years agos3:smbXsrv_session: clear smb2req->session of pending requests in smbXsrv_session_log...
Stefan Metzmacher [Sat, 2 May 2015 14:17:34 +0000 (16:17 +0200)]
s3:smbXsrv_session: clear smb2req->session of pending requests in smbXsrv_session_logoff_all_callback()

smbXsrv_session_logoff_all_callback() is called when the last transport
connection is gone, which means we won't need to sign any response...

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

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

8 years agos3:smbXsrv_session: clear smb2req->session of pending requests in smbXsrv_session_des...
Stefan Metzmacher [Sat, 2 May 2015 14:09:40 +0000 (16:09 +0200)]
s3:smbXsrv_session: clear smb2req->session of pending requests in smbXsrv_session_destructor()

This won't be needed typically needed as the caller is supposted to cancel
the requests already, but this makes sure we don't keep dangling pointers.

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

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

8 years agos4:torture/smb2: add smb2.notify.session-reconnect test
Stefan Metzmacher [Sat, 2 May 2015 07:57:03 +0000 (09:57 +0200)]
s4:torture/smb2: add smb2.notify.session-reconnect test

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

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

8 years agos4:torture/smb2: add smb2.notify.invalid-reauth test
Stefan Metzmacher [Fri, 1 May 2015 18:20:50 +0000 (20:20 +0200)]
s4:torture/smb2: add smb2.notify.invalid-reauth test

An invalid reauth closes the session.

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

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

8 years agos4:torture/smb2: add smb2.notify.close test
Stefan Metzmacher [Fri, 1 May 2015 18:20:50 +0000 (20:20 +0200)]
s4:torture/smb2: add smb2.notify.close test

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

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

8 years agos4:torture/smb2: verify STATUS_NOTIFY_CLEANUP return value
Stefan Metzmacher [Fri, 1 May 2015 18:19:42 +0000 (20:19 +0200)]
s4:torture/smb2: verify STATUS_NOTIFY_CLEANUP return value

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

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

8 years agos3:smbd: use STATUS_NOTIFY_CLEANUP on smb2 logoff (explicit and implicit) and tdis
Stefan Metzmacher [Fri, 1 May 2015 18:02:38 +0000 (20:02 +0200)]
s3:smbd: use STATUS_NOTIFY_CLEANUP on smb2 logoff (explicit and implicit) and tdis

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

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

8 years agos3:smbd: use STATUS_NOTIFY_CLEANUP when closing a smb2 directory handle
Stefan Metzmacher [Fri, 1 May 2015 18:02:38 +0000 (20:02 +0200)]
s3:smbd: use STATUS_NOTIFY_CLEANUP when closing a smb2 directory handle

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

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

8 years agos3:smbd: add a smbd_notify_cancel_by_map() helper function
Stefan Metzmacher [Fri, 1 May 2015 18:04:55 +0000 (20:04 +0200)]
s3:smbd: add a smbd_notify_cancel_by_map() helper function

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

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

9 years agos3: nmbd: Don't set work_changed = True inside update_server_ttl().
Jeremy Allison [Fri, 1 May 2015 16:56:59 +0000 (09:56 -0700)]
s3: nmbd: Don't set work_changed = True inside update_server_ttl().

This is taken care of inside expire_servers() when it calls
remove_server_from_workgroup().

Ensure the only functions in nmbd_serverlistdb.c that
set subnet->work_changed are:

remove_all_servers()
add_server_to_workgroup()
remove_server_from_workgroup()

Fix inspired by a change from Volker.

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

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

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Tue May  5 23:16:30 CEST 2015 on sn-devel-104

9 years agos3: nmbd: Ensure we only set work_changed = true if we modify the record.
Jeremy Allison [Thu, 30 Apr 2015 19:05:17 +0000 (12:05 -0700)]
s3: nmbd: Ensure we only set work_changed = true if we modify the record.

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

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

9 years agovfs: kernel_flock and named streams
Ralph Boehme [Wed, 29 Apr 2015 14:53:04 +0000 (16:53 +0200)]
vfs: kernel_flock and named streams

Streams implementing VFS modules may implement streams in a way that the
fsp will have the basefile open in the fsp fd, so lacking a distinct fd
for the stream, kernel_flock will apply on the basefile which is
wrong. The actual check is deffered to the VFS module implementing the
kernel_flock call.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit d748652e5b1c1c0238a2b86cdf14d7f6de7ce9b2)

9 years agos4: torture: Test for incorrect file size returned in the response of "FILE_SUPERSEDE...
Jeremy Allison [Tue, 28 Apr 2015 23:33:30 +0000 (16:33 -0700)]
s4: torture: Test for incorrect file size returned in the response of "FILE_SUPERSEDE Create".

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

Signed-off-by: Kenny Dinh <kdinh@peaxy.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <rb@sernet.de>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr 30 22:12:22 CEST 2015 on sn-devel-104

(cherry picked from commit 9d7ecb9fc3a1dcce0d71bc0c4f02f9c7dd9408ab)

9 years agos3: smbd: Incorrect file size returned in the response of "FILE_SUPERSEDE Create"
Jeremy Allison [Tue, 28 Apr 2015 21:22:42 +0000 (14:22 -0700)]
s3: smbd: Incorrect file size returned in the response of "FILE_SUPERSEDE Create"

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

Signed-off-by: Kenny Dinh <kdinh@peaxy.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <rb@sernet.de>
(cherry picked from commit d68383e9638254d1b6805b3d3ea3e5e897908374)

9 years agos4: rpc: Refactor dcesrv_alter() function into setup and send steps.
Jeremy Allison [Fri, 24 Apr 2015 20:19:30 +0000 (13:19 -0700)]
s4: rpc: Refactor dcesrv_alter() function into setup and send steps.

Fixes bug:

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

Based on code from Julien Kerihuel <j.kerihuel@openchange.org>

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): Sat Apr 25 02:43:22 CEST 2015 on sn-devel-104

(cherry picked from commit 49030649db3dfec5a9bc03e5dde4255a14499f16)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Tue May  5 14:00:47 CEST 2015 on sn-devel-104

9 years agosharesec: Use common parse_ace function
Christof Schmitt [Fri, 24 Apr 2015 17:00:19 +0000 (10:00 -0700)]
sharesec: Use common parse_ace function

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

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

9 years agosharesec: Print ACEs in similar format as expected in input
Christof Schmitt [Fri, 24 Apr 2015 16:51:28 +0000 (09:51 -0700)]
sharesec: Print ACEs in similar format as expected in input

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

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

9 years agoutil_sd: Make server conncection optional
Christof Schmitt [Fri, 24 Apr 2015 16:49:23 +0000 (09:49 -0700)]
util_sd: Make server conncection optional

If cli is not set, only attempt numeric conversions.

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

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

9 years agosmbcacls: Move sec_desc_print to common file
Christof Schmitt [Fri, 24 Apr 2015 16:28:02 +0000 (09:28 -0700)]
smbcacls: Move sec_desc_print to common file

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

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

9 years agosmbcacls: Move print_ace and parse_ace to common file
Christof Schmitt [Fri, 24 Apr 2015 16:22:14 +0000 (09:22 -0700)]
smbcacls: Move print_ace and parse_ace to common file

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

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

9 years agosmbcacls: Move StringToSid to common file
Christof Schmitt [Fri, 24 Apr 2015 16:15:13 +0000 (09:15 -0700)]
smbcacls: Move StringToSid to common file

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

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

9 years agosmbcacls: Move SidToString to common file
Christof Schmitt [Fri, 24 Apr 2015 15:37:13 +0000 (08:37 -0700)]
smbcacls: Move SidToString to common file

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

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

9 years agosmbcacls: Use defines for security flags
Christof Schmitt [Fri, 24 Apr 2015 15:51:32 +0000 (08:51 -0700)]
smbcacls: Use defines for security flags

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

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

9 years agosmbcacls: Make 'numeric' a local variable
Christof Schmitt [Fri, 24 Apr 2015 15:31:41 +0000 (08:31 -0700)]
smbcacls: Make 'numeric' a local variable

This will allow moving code to a shared file without relying on a global
variable.

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

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

9 years agoAdd DCERPC flag to call unbind hooks without destroying the connection itself upon...
Julien Kerihuel [Mon, 6 Apr 2015 09:26:58 +0000 (11:26 +0200)]
Add DCERPC flag to call unbind hooks without destroying the connection itself upon termination of a connection with outstanding pending calls.

Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Apr 14 20:39:34 CEST 2015 on sn-devel-104

(cherry picked from commit fd90d270c7e97a639f42a96b674a674d1b51aa0d)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11226
Fix terminate connection behavior for asynchronous endpoint with PUSH
notification flavors

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Tue Apr 28 02:20:32 CEST 2015 on sn-devel-104

9 years agoAdd multiplex state to dcerpc flags and control over multiplex PFC flag in bind_ack...
Julien Kerihuel [Wed, 25 Mar 2015 04:06:03 +0000 (21:06 -0700)]
Add multiplex state to dcerpc flags and control over multiplex PFC flag in bind_ack and and dcesrv_alter replies

Signed-off-by: Julien Kerihuel <j.kerihuel@openchange.org>
Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
(cherry picked from commit caaf89e899c2a3926fb9e54d1c86f1a9cd5d7618)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11225
multiplexed RPC connections are not handled by DCERPC server

9 years agoMake sure we initialize conn to NULL, because a routine we call may give an error...
Richard Sharpe [Thu, 23 Apr 2015 19:36:28 +0000 (12:36 -0700)]
Make sure we initialize conn to NULL, because a routine we call may give an error and not touch conn, and then we get an error when trying to TALLOC_FREE it.

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

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

9 years agos3:smbd: update comment to correctly reflect MS-SMB2
Ralph Boehme [Fri, 17 Apr 2015 07:12:59 +0000 (09:12 +0200)]
s3:smbd: update comment to correctly reflect MS-SMB2

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 22 01:04:02 CEST 2015 on sn-devel-104

(cherry picked from commit 64b038da31c7674410ef770f9c40a5402159fb57)

9 years agos3:smbd: missing tevent_req_nterror
Ralph Boehme [Thu, 16 Apr 2015 20:28:25 +0000 (22:28 +0200)]
s3:smbd: missing tevent_req_nterror

The error code path in case fsp == NULL misses a call
tevent_req_nterror().

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit ad52dcdf5de6f5f2c2ee156d93ebbb343f39e526)

9 years agoctdb-build: Specify absolute path to libsocket-wrapper.so
Amitay Isaacs [Wed, 4 Mar 2015 04:55:15 +0000 (15:55 +1100)]
ctdb-build: Specify absolute path to libsocket-wrapper.so

Specifying a relative path to LD_PRELOAD can fail if any of the test
scripts uses cd to change directory and execute commands.

Adding statd-callout tests breaks autotest since statd-callout does "cd".

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Mar  4 13:11:53 CET 2015 on sn-devel-104
(cherry picked from commit 7a10e077706efd3b5d2ce024084b7ed97d4cd36c)

9 years agovfs_fruit: also map characters below 0x20
Björn Jacke [Wed, 15 Apr 2015 19:48:27 +0000 (21:48 +0200)]
vfs_fruit: also map characters below 0x20

we need to map 0x01-0x1F to 0xF001-0xF01F as 0x01-0x1F are win32 illegal
characters.

see https://support.microsoft.com/en-us/kb/kbview/117258

Even if the MS KB article writes "invalid ntfs characters" they are actually
not illegal in ntfs, just in the win32 API.

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

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Ralf Böhme <slow@samba.org>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Apr 17 20:00:48 CEST 2015 on sn-devel-104

(cherry picked from commit 60fbfc5563ada64ea145e93ceaee791165d78e64)

9 years agoctdb-scripts: Add a 'rm' stub so statd-callout tests work correctly
Amitay Isaacs [Thu, 5 Mar 2015 02:10:32 +0000 (13:10 +1100)]
ctdb-scripts: Add a 'rm' stub so statd-callout tests work correctly

statd-callout tries to remove global files from /var/lib/nfs/statd and
this causes errors in tests.  Add an rm stub that ignores attempts to
remove these files but invokes /bin/rm for anything else.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 956e51707d7ddcff060352f54d11ff42bdcc51ef)

The last 10 patches address

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

CTDB statd-callout does not scale.

9 years agoctdb-scripts: Remove unused function nfs_statd_update()
Martin Schwenke [Fri, 13 Feb 2015 04:42:20 +0000 (15:42 +1100)]
ctdb-scripts: Remove unused function nfs_statd_update()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 50ddc2c35643389c2f249c6ad4496ab73a1bfc99)

9 years agoctdb-scripts: Change statd-callout to be more scalable
Martin Schwenke [Fri, 13 Feb 2015 09:55:43 +0000 (20:55 +1100)]
ctdb-scripts: Change statd-callout to be more scalable

Updating ctdb.tdb on each add-client, del-client and each delete
during notify was too ambitious.  Persistent transactions do not
perform well enough to do this.

Revert to having add-client and del-client create touch files.  Each
monitor event calls "statd-callout update" to convert touch files into
ctdb.tdb records.

Update testcases to do the "update" and add an extra test.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 500c6e194babe06b6aead7a053a9442c94db6e38)

9 years agoctdb-scripts: Fix a regression in statd-callout
Martin Schwenke [Thu, 26 Feb 2015 04:34:51 +0000 (15:34 +1100)]
ctdb-scripts: Fix a regression in statd-callout

Commit 4638010abb116aed0c180207aaa11475277aecb7 changed from using
gensub() to gsub() in awk.  However, it didn't halve the number of
backslashes in the target strings.  This is necessary because
backslash is used in gensub() target strings to allow substitution of
text matching parenthesised subexpressions.  This is not the case with
gsub().

So, halve the number of backslashes in the target string where gsub()
is used in statd-callout.  This is the only target string broken by
changes made by the above commit

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 032441d9a2974584cde455e4dbd5cc33fe6a23c2)

9 years agoctdb-tests: Unit tests for statd-callout
Martin Schwenke [Wed, 4 Mar 2015 00:51:20 +0000 (11:51 +1100)]
ctdb-tests: Unit tests for statd-callout

With improvements to unit test infrastructure to support.  This
includes linking the real statd-callout into etc-ctdb/ in place of the
placeholder script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 22602f76bc1ec91e807a8f1cd45ba6fb4c05e622)

9 years agoctdb-tests: Make setup of public addresses more obvious
Martin Schwenke [Fri, 27 Feb 2015 04:20:56 +0000 (15:20 +1100)]
ctdb-tests: Make setup of public addresses more obvious

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit d98c7ba382189161c5b8cbbebbdfbe36f1456572)

9 years agoctdb-tests: Extend eventscript unit test infrastructure for other scripts
Martin Schwenke [Fri, 27 Feb 2015 04:19:04 +0000 (15:19 +1100)]
ctdb-tests: Extend eventscript unit test infrastructure for other scripts

There's so much infrastructure here that it would be a shame not to
use it for testing things like statd-callout.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 7e7c24ca7a422f2258962216b0184eda8d49827f)

9 years agoctdb-tests: Support testing scripts that change directory
Martin Schwenke [Fri, 27 Feb 2015 04:17:30 +0000 (15:17 +1100)]
ctdb-tests: Support testing scripts that change directory

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 9317d82c19a0eb51ff6293d00328a5c36b063a2c)

9 years agoctdb-tests: Extend ctdb stub to support "ip" with and without -X
Martin Schwenke [Fri, 27 Feb 2015 04:15:18 +0000 (15:15 +1100)]
ctdb-tests: Extend ctdb stub to support "ip" with and without -X

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 2aeb518637af29da03984470d874b94dfb18e34e)

9 years agoctdb-tests: Extend ctdb stub to support "ptrans", "pdelete", "catdb"
Martin Schwenke [Fri, 27 Feb 2015 04:13:23 +0000 (15:13 +1100)]
ctdb-tests: Extend ctdb stub to support "ptrans", "pdelete", "catdb"

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit d057ca04a9eec0f2aa3d792da0a4648e3716685a)

Conflicts:
ctdb/tests/eventscripts/stubs/ctdb

9 years agolib/util: Include DEBUG macro in internal header files before samba_util.h
Lukas Slebodnik [Thu, 5 Mar 2015 10:26:46 +0000 (11:26 +0100)]
lib/util: Include DEBUG macro in internal header files before samba_util.h

It's best practice to include external header files before internal
header files. In this case internal DEBUG macro cannot be defined and
therefore samba version of debug macro will be included
in header file "util/fault.h".

In file included from example.c:27:0:
src/util/util.h:127:0: error: "DEBUG" redefined [-Werror]
 #define DEBUG(level, format, ...) do { \
 ^
In file included from /usr/include/samba-4.0/util/fault.h:29:0,
                 from /usr/include/samba-4.0/samba_util.h:62,
                 from /usr/include/samba-4.0/ndr.h:30,
                 from example.c:24:
/usr/include/samba-4.0/util/debug.h:182:0: note: this is the location of the previous definition
 #define DEBUG( level, body ) \
 ^
  CC       src/providers/ad/libsss_ad_common_la-ad_domain_info.lo
cc1: all warnings being treated as errors

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

Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Mar 11 18:47:22 CET 2015 on sn-devel-104

(cherry picked from commit 9643a4b1ef2ada764f454ecc82aa6936217967fc)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Tue Apr 21 00:05:08 CEST 2015 on sn-devel-104

9 years agowaf: Fix systemd detection
Andreas Schneider [Tue, 7 Apr 2015 14:30:30 +0000 (16:30 +0200)]
waf: Fix systemd detection

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 5ee27b4ead57c15db7168d80f6fdf821663c44fc)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Sun Apr 19 23:44:30 CEST 2015 on sn-devel-104

9 years agobuild: Move systemd checks to lib/util
Christof Schmitt [Fri, 20 Mar 2015 19:13:14 +0000 (12:13 -0700)]
build: Move systemd checks to lib/util

Only lib/util uses the systemd library, so it makes sense to have the
checks there. This also removes the need for the ctdb build script to
specify an empty tag for the systemd library.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 0509790ec3696e09f6d5e6db969e46e8fd975efb)

9 years agospoolss: purge the printer name cache on name change
David Disseldorp [Tue, 31 Mar 2015 23:03:13 +0000 (01:03 +0200)]
spoolss: purge the printer name cache on name change

Currently the name cache is only cleared on printer deletion. This means
that if a printer undergoes a name change, the old name remains in the
cache and can be subsequently used incorrecly if another printer takes
the same name as the old.

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

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
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): Tue Apr 14 05:37:50 CEST 2015 on sn-devel-104

(cherry picked from commit a97507a9a7ba01beead6a621e1210618e93a9f9c)

9 years agos3: libsmbclient: After getting attribute server, ensure main srv pointer is still...
Jeremy Allison [Tue, 31 Mar 2015 21:40:23 +0000 (14:40 -0700)]
s3: libsmbclient: After getting attribute server, ensure main srv pointer is still valid.

Bug #11186: Crash seen in libsmbclient due to free of server structure during SMBC_getxattr() call

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

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): Tue Apr 14 02:58:43 CEST 2015 on sn-devel-104

(cherry picked from commit 2d4db4a65e1e8924470741378fe249f22196eceb)

9 years agoctdb-scripts: Fix bashism in ctdbd_wrapper script
Led [Sun, 14 Dec 2014 19:06:44 +0000 (21:06 +0200)]
ctdb-scripts: Fix bashism in ctdbd_wrapper script

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

Signed-off-by: Oleksandr Chumachenko <ledest@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 2c3672f4249a7d3453b7e82ca96b4cd666aae709)

9 years agoctdb-scripts: Call iptables/ip6tables directly from iptables_wrapper
Martin Schwenke [Tue, 30 Dec 2014 05:04:00 +0000 (16:04 +1100)]
ctdb-scripts: Call iptables/ip6tables directly from iptables_wrapper

Drops the iptables() and ip6tables() functions and, hence, the
hardcoding of paths /sbin/iptables and /sbin/ip6tables.  The latter
avoids problems on openSUSE where (for example) /usr/sbin/iptables is
used instead.

This means that locking around ip*tables commands is only done when
iptables_wrapper is called directly.  This is fine because the only
conflict is when "releaseip" or "takeip"/"updateip" events are run in
parallel.  The other uses in 11.natgw and 70.iscsi are in events where
there will be no collisions.

Making 11.natgw support IPv6 is unnecessary.  Just put a static IPv6
address on each interface - they're plentiful.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Jan 28 08:29:55 CET 2015 on sn-devel-104

(cherry picked from commit ab51f283e7a7f4fc82a94d39e7bb3a68e8aac554)

The last 2 patches address

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

CTDB has some remaining IPv6-related issues.

9 years agoctdb-tests: Fix tickle sniffing for IPv4
Martin Schwenke [Sat, 20 Dec 2014 08:54:13 +0000 (19:54 +1100)]
ctdb-tests: Fix tickle sniffing for IPv4

tcptickle_sniff_start() assumes that if $dst contains a ': then it
should use the IPv6 sniffing code.  However, $dst is a socket, so has
a trailing ":<port>".

Strip the trailing ":<port>" before checking for ':' as a marker for
an IPv6 address.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 82aa6bd2f27775f3fd82931d613379d5d618ef70)

9 years agoctdb-scripts: Fix tunable setup code by making it shell-agnostic
Martin Schwenke [Mon, 16 Feb 2015 03:04:09 +0000 (14:04 +1100)]
ctdb-scripts: Fix tunable setup code by making it shell-agnostic

All tunables set in configuration are currently set to 0 on system
where /bin/sh is dash (and perhaps other non-bash shells).  dash puts
single quotes around all values in the output of the "set" builtin
command, whereas bash only puts them around values when something
needs to be quoted.  Tunables always have a simple integer value so
dash will quote them and bash won't.  The setup code currently passes
the raw value, including any quotes to "ctdb setvar ...".  This
command does no error checking on the input, so "'1'" is converted to
0.

Change the code so that the value is determined from the shell
variable and is independent of the "set" output.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 39686f45056d942de5ebe3263a533a99ca17c79e)

The last 3 patches address

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

CTDB has portability issues

9 years agoctdb-scripts: Don't use the GNU awk gensub() function
Martin Schwenke [Fri, 19 Dec 2014 03:19:32 +0000 (14:19 +1100)]
ctdb-scripts: Don't use the GNU awk gensub() function

This is a gawk extension and can't be used reliably if just running
"awk".  It is simple enough to switch to using the standard sub() and
gsub() functions.

The alternative is to switch to explicitly running "gawk".  However,
although the eventscripts aren't exactly portable, it is probably
better to move closer to portability than further away.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 4638010abb116aed0c180207aaa11475277aecb7)

9 years agoctdb-scripts: Try to deal with Ubuntu having /usr/sbin/service
Martin Schwenke [Mon, 1 Dec 2014 01:21:16 +0000 (12:21 +1100)]
ctdb-scripts: Try to deal with Ubuntu having /usr/sbin/service

Falling back to running the initscript doesn't work because it detects
that upstart is being used and fails.  This was observed when trying
to start winbind on Ubuntu 11.04.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit a5c5eee7d186d938c5b458cb6dbf0c78cb548b63)

9 years agoctdb: check for talloc_asprintf() failure
David Disseldorp [Tue, 31 Mar 2015 16:06:43 +0000 (18:06 +0200)]
ctdb: check for talloc_asprintf() failure

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Apr  1 15:36:03 CEST 2015 on sn-devel-104

(cherry picked from commit 12309f8bfb70878bec5fcec4681eb4e463e07357)

Conflicts:
ctdb/tcp/tcp_connect.c

The last 11 patches address

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

CTDB contains potential buffer overflows, unchecked memory allocation failures,
resource leaks.

9 years agoctdb: Coverity fix for CID 1291643
Rajesh Joseph [Tue, 31 Mar 2015 13:13:36 +0000 (18:43 +0530)]
ctdb: Coverity fix for CID 1291643

CID 1291643: Resource leak: leaked_handle: Handle
variable lock_fd going out of scope leaks the handle.

Fix: on failure case release handle variable lock_fd

Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
(cherry picked from commit 801bdcde6a7a92acfdb26d87a17a33802e166a2d)

Conflicts:
ctdb/tcp/tcp_connect.c

9 years agoctdb: Fix CID 1125615 Copy into fixed size buffer
Volker Lendecke [Thu, 26 Mar 2015 12:11:14 +0000 (13:11 +0100)]
ctdb: Fix CID 1125615 Copy into fixed size buffer

Might be a "can't happen", but strcpy always looks fishy

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 508b45fca93ca2dfb048fdf7465602bc34df42db)

9 years agoctdb: Fix CID 1125634 Out-of-bounds write
Volker Lendecke [Thu, 26 Mar 2015 12:06:26 +0000 (13:06 +0100)]
ctdb: Fix CID 1125634 Out-of-bounds write

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 93d4e801298d8ebb7261adbfc2bdb1a5fbe7115c)

9 years agoctdb: Fix CID 1125613 Destination buffer too small
Volker Lendecke [Fri, 13 Mar 2015 14:20:05 +0000 (14:20 +0000)]
ctdb: Fix CID 1125613 Destination buffer too small

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): Fri Mar 13 19:14:20 CET 2015 on sn-devel-104

(cherry picked from commit d171d2010a256a46446de5328a0897df3838855a)

9 years agoctdb: Introduce a helper var in ctdb_get_script_list
Volker Lendecke [Fri, 13 Mar 2015 14:16:17 +0000 (14:16 +0000)]
ctdb: Introduce a helper var in ctdb_get_script_list

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 8d9bb5c54aae0099e0dde2d9a904676fcb9340c0)

9 years agoctdb: Fix memleak in ctdb_get_script_list
Volker Lendecke [Fri, 13 Mar 2015 14:12:41 +0000 (14:12 +0000)]
ctdb: Fix memleak in ctdb_get_script_list

scandir allocates every name individually, see example code in susv4 or man
scandir

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit c1e8bfb186c5cbeafbce9f2767db82edb579d5e1)

9 years agoctdb: Make for-loop in ctdb_get_script_list more idiomatic
Volker Lendecke [Fri, 13 Mar 2015 14:11:20 +0000 (14:11 +0000)]
ctdb: Make for-loop in ctdb_get_script_list more idiomatic

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit a8cc495b967935852c5357c3a4ef3d37579fb51b)

9 years agoctdb: Fix CID 1288201 Array compared against 0
Volker Lendecke [Wed, 11 Mar 2015 10:58:11 +0000 (10:58 +0000)]
ctdb: Fix CID 1288201 Array compared against 0

"helper_prog" is now declared as a static array

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

9 years agoctdb: Fix 1125553 Buffer not null terminated
Volker Lendecke [Sat, 7 Mar 2015 10:29:21 +0000 (10:29 +0000)]
ctdb: Fix 1125553 Buffer not null terminated

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
(cherry picked from commit 621bd0784290f24e229caf0590206805f6f2e75c)

9 years agoctdb-tools: Fix heap-use-after-free problem
Amitay Isaacs [Tue, 14 Oct 2014 06:52:55 +0000 (17:52 +1100)]
ctdb-tools: Fix heap-use-after-free problem

Found by address sanitizer.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Oct 17 12:56:02 CEST 2014 on sn-devel-104

(cherry picked from commit 470af881479d1a1588dc23ef40622b4d8f006b61)

9 years agoVERSION: Bump version up to 4.2.2...
Karolin Seeger [Wed, 15 Apr 2015 17:59:04 +0000 (19:59 +0200)]
VERSION: Bump version up to 4.2.2...

and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoVERSION: Disable git snapshot for the 4.2.1 release. samba-4.2.1
Karolin Seeger [Wed, 15 Apr 2015 17:58:11 +0000 (19:58 +0200)]
VERSION: Disable git snapshot for the 4.2.1 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoWHATSNEW: Add release notes for Samba 4.2.1.
Karolin Seeger [Tue, 14 Apr 2015 20:08:05 +0000 (22:08 +0200)]
WHATSNEW: Add release notes for Samba 4.2.1.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agos3-passdb: Fix 'force user' with winbind default domain
Andreas Schneider [Tue, 31 Mar 2015 16:15:51 +0000 (18:15 +0200)]
s3-passdb: Fix 'force user' with winbind default domain

If we set 'winbind use default domain' and specify 'force user = user'
without a domain name we fail to log in. In this case we need to try a
lookup with the domain name.

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

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

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Thu Apr  9 02:06:13 CEST 2015 on sn-devel-104

9 years agos4-process_model: Do not close random fds while forking.
Andreas Schneider [Thu, 26 Mar 2015 09:48:31 +0000 (10:48 +0100)]
s4-process_model: Do not close random fds while forking.

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

The issue has been found with nss_wrapper debug output running:
    samba4.ntvfs.cifs.krb5.base.lock

In the case here, we fork a child and close the fd without resetting
the pipe fd variable. Then the fd was used to open the nss_wrapper
hosts file which got the same fd. We forked again in the process model
called close() on the re-used fd (of the pipe variable) again without
nss_wrapper noticing.  Now Samba opened the secrets tdb and got
the same fd as nss_wrapper was using for the hosts file and next
nss_wrapper tried to parse a TDB ...

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

9 years agos3: libsmbclient: Add missing talloc stackframe.
Jeremy Allison [Thu, 26 Mar 2015 17:09:46 +0000 (10:09 -0700)]
s3: libsmbclient: Add missing talloc stackframe.

Bug 11177 - no talloc stackframe at ../source3/libsmb/clifsinfo.c:444, leaking memory

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Mar 26 22:21:30 CET 2015 on sn-devel-104

(cherry picked from commit 32cbbed979b931eeb5127629248a94d7e6f3fcfb)

9 years agolib: tdb: Use sigaction when testing for robust mutexes.
Jeremy Allison [Fri, 20 Mar 2015 17:59:08 +0000 (10:59 -0700)]
lib: tdb: Use sigaction when testing for robust mutexes.

Working fix that copes with oldact.sa_handler == NULL
if no handler initially set.

Fixes bug #11175 - Lots of winbindd zombie processes on Solaris platform.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Mar 26 04:29:42 CET 2015 on sn-devel-104

9 years agos4:auth/gensec_gssapi: let gensec_gssapi_update() return NT_STATUS_LOGON_FAILURE...
Stefan Metzmacher [Fri, 13 Mar 2015 13:39:10 +0000 (14:39 +0100)]
s4:auth/gensec_gssapi: let gensec_gssapi_update() return NT_STATUS_LOGON_FAILURE for unknown errors

The 'nt_status' variable is set to NT_STATUS_OK before.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 09b3e42e70b35bfa1985e70780a67085644b9914)