samba.git
7 years agopassdb: Remove pdb_wbc_sam
Volker Lendecke [Tue, 3 Jan 2017 07:04:59 +0000 (07:04 +0000)]
passdb: Remove pdb_wbc_sam

It seems that this was only used in OneFS. The filesystem parts were
removed in 2012 with 70be41c772d.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jan  9 18:15:20 CET 2017 on sn-devel-144

7 years agoauth: Remove auth_wbc
Volker Lendecke [Tue, 3 Jan 2017 07:04:59 +0000 (07:04 +0000)]
auth: Remove auth_wbc

It seems that this was only used in OneFS. The filesystem parts were
removed in 2012 with 70be41c772d.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoselftest: Don't test auth_wbc anymore
Volker Lendecke [Wed, 4 Jan 2017 10:36:04 +0000 (10:36 +0000)]
selftest: Don't test auth_wbc anymore

It will go in the next commit

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
7 years agoreplace: Include sysmacros.h
Andreas Schneider [Thu, 5 Jan 2017 08:34:36 +0000 (09:34 +0100)]
replace: Include sysmacros.h

In the GNU C Library, "makedev" is defined by <sys/sysmacros.h>. For
historical compatibility, it is currently defined by <sys/types.h> as
well, but it is planned to remove this soon.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Jan  8 22:30:03 CET 2017 on sn-devel-144

7 years agoWHATSNEW: fix typo
Björn Jacke [Fri, 6 Jan 2017 22:26:13 +0000 (23:26 +0100)]
WHATSNEW: fix typo

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Sat Jan  7 03:19:03 CET 2017 on sn-devel-144

7 years agolibgpo: allow empty values in gp inifile parsing code.
Günther Deschner [Wed, 14 Sep 2016 16:13:39 +0000 (18:13 +0200)]
libgpo: allow empty values in gp inifile parsing code.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jan  6 16:16:02 CET 2017 on sn-devel-144

7 years agolib/util: add pm_process_with_flags to allow parsing ini files with empty values
Günther Deschner [Wed, 14 Sep 2016 16:13:00 +0000 (18:13 +0200)]
lib/util: add pm_process_with_flags to allow parsing ini files with empty values

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibgpo: default to empty values if none are there
Günther Deschner [Mon, 19 Sep 2016 15:11:19 +0000 (17:11 +0200)]
libgpo: default to empty values if none are there

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibgpo: deal with non utf16-le ini files.
Günther Deschner [Thu, 10 Nov 2016 14:15:05 +0000 (15:15 +0100)]
libgpo: deal with non utf16-le ini files.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibgpo: apply some const.
Günther Deschner [Tue, 27 Sep 2016 16:18:51 +0000 (18:18 +0200)]
libgpo: apply some const.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibgpo: add gp_inifile_enum_section()
Günther Deschner [Tue, 13 Sep 2016 06:36:59 +0000 (08:36 +0200)]
libgpo: add gp_inifile_enum_section()

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibgpo: add gp_inifile_init_context_direct()
Günther Deschner [Sun, 11 Sep 2016 10:48:14 +0000 (12:48 +0200)]
libgpo: add gp_inifile_init_context_direct()

This varient ignores the group policy flags and does not try to find the right
unix path.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3-spoolss: Create a sperate header file for 'struct printer_handle'
Günther Deschner [Fri, 26 Aug 2016 16:33:19 +0000 (18:33 +0200)]
s3-spoolss: Create a sperate header file for 'struct printer_handle'

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3-spoolss: remove unused type field in printer handle
Günther Deschner [Fri, 2 Dec 2016 08:09:49 +0000 (09:09 +0100)]
s3-spoolss: remove unused type field in printer handle

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3-iremotewinspool: update api struct map so we only end up implementing 8 calls
Günther Deschner [Wed, 14 Sep 2016 09:46:20 +0000 (11:46 +0200)]
s3-iremotewinspool: update api struct map so we only end up implementing 8 calls

In the end, these calls are the only ones we need to implement:

3.1.4.2. Printer Driver Management Methods

* AsyncInstallPrinterDriverFromPackage
* AsyncUploadPrinterDriverPackage
* AsyncCorePrinterDriverInstalled
* AsyncDeletePrinterDriverPackage

3.1.4.9. Printing Related Notification Methods

* SyncRegisterForRemoteNotifications
* SyncUnRegisterForRemoteNotifications
* SyncRefreshRemoteNotifications
* AsyncGetRemoteNotifications

All other calls are 1:1 mapped to spoolss calls.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3-iremotewinspool: add generated server stubs and no longer compile autogenerated...
Günther Deschner [Tue, 20 Sep 2016 16:43:57 +0000 (18:43 +0200)]
s3-iremotewinspool: add generated server stubs and no longer compile autogenerated ones

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3-iremotewinspool: add generated srv_iremotewinspool_nt.c file
Günther Deschner [Tue, 20 Sep 2016 18:21:50 +0000 (20:21 +0200)]
s3-iremotewinspool: add generated srv_iremotewinspool_nt.c file

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3-rpc_server: setup secondary address for tcp transport in bind_ack packet.
Günther Deschner [Mon, 26 Sep 2016 18:22:04 +0000 (20:22 +0200)]
s3-rpc_server: setup secondary address for tcp transport in bind_ack packet.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3-rpc_server: enforce packet level authentication for iremotewinspool server
Günther Deschner [Mon, 26 Sep 2016 17:21:05 +0000 (19:21 +0200)]
s3-rpc_server: enforce packet level authentication for iremotewinspool server

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3-rpc_server: allow to set minimal auth level for a DCE/RPC service
Günther Deschner [Mon, 26 Sep 2016 17:20:24 +0000 (19:20 +0200)]
s3-rpc_server: allow to set minimal auth level for a DCE/RPC service

Guenther

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoctdb-tests: Do not attempt to unregister the join handler multiple times
Amitay Isaacs [Thu, 5 Jan 2017 04:05:56 +0000 (15:05 +1100)]
ctdb-tests: Do not attempt to unregister the join handler multiple times

MSG_ID_SYNC is broadcast to each node when a MSG_ID_JOIN has been
received from all nodes.  After MSG_ID_SYNC is successfully broadcast,
the join handler is unregistered.  However, if another MSG_ID_JOIN is
received before the join handler is unregistered then MSG_ID_SYNC is
re-broadcast.  This results in multiple attempts to unregister the
join handler.

Once all MSG_ID_JOIN messages are received, unregister the join handler
to ignore any extra MSG_ID_JOIN messages.  Also, make sure that while
join handler is being unregistered, MSG_ID_JOIN messages are ignored.

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

Identified-by: Martin Schwenke <martin@meltin.net>
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 Jan  6 12:27:23 CET 2017 on sn-devel-144

7 years agoctdb-tests: Add tests for generic socket I/O
Amitay Isaacs [Wed, 4 Jan 2017 13:48:32 +0000 (00:48 +1100)]
ctdb-tests: Add tests for generic socket I/O

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-common: Fix a bug in packet reading code for generic socket I/O
Amitay Isaacs [Wed, 4 Jan 2017 06:46:54 +0000 (17:46 +1100)]
ctdb-common: Fix a bug in packet reading code for generic socket I/O

queue->offset currently points to the end of available data.  However,
after processing one packet the beginning of the next packet is not
marked explicitly and caused the same packet to be processed again.

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-tests: Add another test for sock_daemon
Amitay Isaacs [Wed, 4 Jan 2017 13:47:11 +0000 (00:47 +1100)]
ctdb-tests: Add another test for sock_daemon

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-common: Simplify async computation for sock_socket_write_send/recv
Amitay Isaacs [Wed, 4 Jan 2017 05:20:17 +0000 (16:20 +1100)]
ctdb-common: Simplify async computation for sock_socket_write_send/recv

This is now just a wrapper around comm_write_send/recv.  This avoids the
extra tevent_req and fixes a bug in the termination of sock_socket_write
computation.

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoVERSION: Bump version up to 4.7.0pre1...
Karolin Seeger [Thu, 5 Jan 2017 07:45:25 +0000 (08:45 +0100)]
VERSION: Bump version up to 4.7.0pre1...

and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
7 years agoVERSION: Diable git snapshots for the 4.6.0rc1 release. samba-4.6.0rc1
Karolin Seeger [Thu, 5 Jan 2017 07:44:22 +0000 (08:44 +0100)]
VERSION: Diable git snapshots for the 4.6.0rc1 release.

7 years agoVERSION: Bump version up to 4.6.0rc1.
Karolin Seeger [Thu, 5 Jan 2017 07:43:57 +0000 (08:43 +0100)]
VERSION: Bump version up to 4.6.0rc1.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
7 years agowinbind: Fix a typo
Volker Lendecke [Tue, 3 Jan 2017 12:18:25 +0000 (12:18 +0000)]
winbind: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jan  4 16:10:32 CET 2017 on sn-devel-144

7 years agowinbind: Avoid a few explicit ZERO_STRUCT calls
Volker Lendecke [Tue, 3 Jan 2017 09:54:33 +0000 (09:54 +0000)]
winbind: Avoid a few explicit ZERO_STRUCT calls

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: remove nss_get_info backend functions
Volker Lendecke [Tue, 3 Jan 2017 12:35:15 +0000 (12:35 +0000)]
winbind: remove nss_get_info backend functions

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Remove nss_get_info()
Volker Lendecke [Tue, 3 Jan 2017 12:32:07 +0000 (12:32 +0000)]
winbind: Remove nss_get_info()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Remove unused nss_get_info_cached
Volker Lendecke [Tue, 3 Jan 2017 12:17:27 +0000 (12:17 +0000)]
winbind: Remove unused nss_get_info_cached

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Simplify query_user_list to only return rids
Volker Lendecke [Tue, 3 Jan 2017 12:11:30 +0000 (12:11 +0000)]
winbind: Simplify query_user_list to only return rids

Unfortunately this is a pretty large patch, because many functions
implement this API. The alternative would have been to create a new
backend function, add the new one piece by piece and then remove the
original function.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Remove wbint_QueryUserList
Volker Lendecke [Mon, 2 Jan 2017 15:45:50 +0000 (15:45 +0000)]
winbind: Remove wbint_QueryUserList

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Make list_users use wb_query_user_list
Volker Lendecke [Mon, 2 Jan 2017 15:44:04 +0000 (15:44 +0000)]
winbind: Make list_users use wb_query_user_list

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Make wb_query_user_list just return names
Volker Lendecke [Mon, 2 Jan 2017 15:19:14 +0000 (15:19 +0000)]
winbind: Make wb_query_user_list just return names

Yes, this compiles. Nobody call this right now. Hold on :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Remove rpc_lookup_usergroups
Volker Lendecke [Tue, 3 Jan 2017 15:23:21 +0000 (15:23 +0000)]
winbind: Remove rpc_lookup_usergroups

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Remove "lookup_usergroups" winbind method
Volker Lendecke [Tue, 3 Jan 2017 15:21:37 +0000 (15:21 +0000)]
winbind: Remove "lookup_usergroups" winbind method

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Remove validate_ug
Volker Lendecke [Tue, 3 Jan 2017 15:13:50 +0000 (15:13 +0000)]
winbind: Remove validate_ug

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Remove wcache_lookup_usergroups
Volker Lendecke [Tue, 3 Jan 2017 15:12:35 +0000 (15:12 +0000)]
winbind: Remove wcache_lookup_usergroups

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Remove wb_cache_lookup_usergroups
Volker Lendecke [Tue, 3 Jan 2017 15:07:03 +0000 (15:07 +0000)]
winbind: Remove wb_cache_lookup_usergroups

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Remove wbint_LookupUserGroups
Volker Lendecke [Tue, 3 Jan 2017 15:04:29 +0000 (15:04 +0000)]
winbind: Remove wbint_LookupUserGroups

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Remove wb_lookupusergroups
Volker Lendecke [Tue, 3 Jan 2017 15:02:48 +0000 (15:02 +0000)]
winbind: Remove wb_lookupusergroups

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Use wb_gettoken in getuserdomgroups
Volker Lendecke [Tue, 3 Jan 2017 15:00:46 +0000 (15:00 +0000)]
winbind: Use wb_gettoken in getuserdomgroups

This makes sure we return the same information regardless of which call into
winbind is used

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Add "expand_local_aliases" to wb_gettoken
Volker Lendecke [Tue, 3 Jan 2017 14:54:46 +0000 (14:54 +0000)]
winbind: Add "expand_local_aliases" to wb_gettoken

I hate passing down booleans, but we have the "domain_groups_only"
parameter in wbcLookupUserSids which we need to keep for API
compatibility. To make sure we use as few code paths as possible, this
basically passes down this flag.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Remove rpc_query_user
Volker Lendecke [Mon, 2 Jan 2017 15:58:39 +0000 (15:58 +0000)]
winbind: Remove rpc_query_user

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Remove "query_user" backend function
Volker Lendecke [Mon, 2 Jan 2017 15:56:48 +0000 (15:56 +0000)]
winbind: Remove "query_user" backend function

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Remove unused wb_cache_query_user
Volker Lendecke [Mon, 2 Jan 2017 10:35:02 +0000 (10:35 +0000)]
winbind: Remove unused wb_cache_query_user

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Remove wbint_QueryUser
Volker Lendecke [Mon, 2 Jan 2017 10:32:19 +0000 (10:32 +0000)]
winbind: Remove wbint_QueryUser

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3: torture: Add test for cli_ftruncate calling cli_smb2_ftruncate.
Jeremy Allison [Tue, 3 Jan 2017 23:37:03 +0000 (15:37 -0800)]
s3: torture: Add test for cli_ftruncate calling cli_smb2_ftruncate.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos3: libsmb: Add cli_smb2_ftruncate(), plumb into cli_ftruncate().
Jeremy Allison [Wed, 21 Dec 2016 21:55:50 +0000 (13:55 -0800)]
s3: libsmb: Add cli_smb2_ftruncate(), plumb into cli_ftruncate().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agotorture-netlogon: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
torture-netlogon: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Jan  3 19:56:17 CET 2017 on sn-devel-144

7 years agotorture-samlogon: Avoid static zeros
Volker Lendecke [Sun, 1 Jan 2017 16:28:36 +0000 (16:28 +0000)]
torture-samlogon: Avoid static zeros

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agotorture-samlogon: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
torture-samlogon: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agotorture-dfs: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
torture-dfs: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agoauth4: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
auth4: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agokdc: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
kdc: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agosamr3: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
samr3: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agolibads: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
libads: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agolib: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
lib: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agolibrpc: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
librpc: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agolibnet: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
libnet: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agoauth: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
auth: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agolibrpc: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
librpc: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agolibcli: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
libcli: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agopassdb: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
passdb: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agoauth3: Avoid some zeros footprint
Volker Lendecke [Sat, 31 Dec 2016 13:11:10 +0000 (13:11 +0000)]
auth3: Avoid some zeros footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agontlm_auth: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
ntlm_auth: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agolibcli: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
libcli: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agolibcli: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
libcli: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agoauth3: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
auth3: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agolibcli: Use "all_zero" where appropriate
Volker Lendecke [Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)]
libcli: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agolib: Remove a duplicate prototype
Volker Lendecke [Sat, 31 Dec 2016 12:38:45 +0000 (12:38 +0000)]
lib: Remove a duplicate prototype

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agolibsmb: Add name_status_lmhosts
Volker Lendecke [Mon, 19 Dec 2016 19:18:41 +0000 (20:18 +0100)]
libsmb: Add name_status_lmhosts

Don't ask... Oh, you did? :-)

Try to figure out a hosts' name from lmhosts. This is for a setup I've
come across where for several reasons kerberos and ldap were unusable
(very organically grown but unchangeable Solaris 10 installation with
tons of ancient libs that ./configure incorrectly finds and where tar xf
samba-4.5.3.tar takes 5 minutes...), so I had to fall back to compile
with --without-ads. Unfortunately in that environment NetBIOS was also
turned off, but the "winbind rpc only" code relies on name_status to
get a DC's name from its IP address for the netlogon calls. This walks
the local lmhosts file to scan for the same information.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agoWHATSNEW: Some small formal fixes.
Karolin Seeger [Tue, 3 Jan 2017 09:09:42 +0000 (10:09 +0100)]
WHATSNEW: Some small formal fixes.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Tue Jan  3 16:03:12 CET 2017 on sn-devel-144

7 years agowinbind: Remove find_builtin_domain helper function
Volker Lendecke [Fri, 30 Dec 2016 11:51:37 +0000 (11:51 +0000)]
winbind: Remove find_builtin_domain helper function

There was only one caller, and the function was pretty small anyway.

This makes a "git grep find_domain_from" more obvious :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jan  2 21:52:02 CET 2017 on sn-devel-144

7 years agowinbind: Remove wb_fill_pwent
Volker Lendecke [Fri, 30 Dec 2016 11:47:45 +0000 (11:47 +0000)]
winbind: Remove wb_fill_pwent

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Go throught wb_getpwsid for listing users
Volker Lendecke [Thu, 29 Dec 2016 19:05:40 +0000 (19:05 +0000)]
winbind: Go throught wb_getpwsid for listing users

This makes sure we get the same results for getpwnam and getpwent.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Add wbint_QueryUserRidList
Volker Lendecke [Thu, 29 Dec 2016 18:13:28 +0000 (18:13 +0000)]
winbind: Add wbint_QueryUserRidList

This is an equivalent of QueryUserList with simpler output. The next
commit will use it to go through wb_getpwsid for getent passwd, to
make sure we get the same results. Eventually, this might get a simpler
backend.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Fix a confusing indentation
Volker Lendecke [Thu, 29 Dec 2016 15:34:41 +0000 (15:34 +0000)]
winbind: Fix a confusing indentation

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Simplify wb_gettoken
Volker Lendecke [Sun, 25 Dec 2016 10:19:38 +0000 (10:19 +0000)]
winbind: Simplify wb_gettoken

All we need from the domain struct is it's sid. Directly use it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Don't do supplementary group lookup manually
Volker Lendecke [Sun, 25 Dec 2016 10:16:31 +0000 (10:16 +0000)]
winbind: Don't do supplementary group lookup manually

This can never be done successfully without a valid samlogon_cache entry.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoidmap_ad: Restore querying SFU nss info
Volker Lendecke [Thu, 29 Dec 2016 10:27:58 +0000 (10:27 +0000)]
idmap_ad: Restore querying SFU nss info

With the last commit the getpwsid call did not look at the winbind
nss info parameter anymore. This restores it for the idmap ad backend
with slightly different semantics and configuration: We now have the
unix_primary_group and unix_nss_info domain-specific parameters for
idmap config. This enables overriding the Windows primary group with
the unix one.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Restructure wb_getpwsid
Volker Lendecke [Thu, 29 Dec 2016 10:05:28 +0000 (10:05 +0000)]
winbind: Restructure wb_getpwsid

This patch moves the responsibility to create a winbind user from the
winbind backends into wb_queryuser.c. The name comes from lsa_lookupsids,
the uid from idmap. If we have a netsamlogon_cache, we get the primary
group sid from there. Without netsamlogon_cache, we default to -513, as
we do right now as default for non-reachable ADS domains anyway. Shell
and homedir default to template. This can all be done in the parent
without contacting any LDAP-related calls and is correct once we have
a netsamlogon_cache.

Once the parent has filled in the userinfo, the idmap child is queried
with the GetNssInfo call, taking the userinfo [in,out]. The child is
free to override the whole thing, something the AD backend will do in
the next patch.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Adapt cache to extended wbint_userinfo
Volker Lendecke [Fri, 30 Dec 2016 10:57:50 +0000 (10:57 +0000)]
winbind: Adapt cache to extended wbint_userinfo

Separate commit, UL/ was missing some fields already

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Add a GetNssInfo parent/child call
Volker Lendecke [Thu, 29 Dec 2016 09:56:29 +0000 (09:56 +0000)]
winbind: Add a GetNssInfo parent/child call

This call will be done in the idmap child. It is not 100% the right place,
but there is no better one available to me. It will become a replacement
for the "winbind nss info" parameter: This global parameter is good
for just one domain. It might be possible to have idmap backend AD for
different domains, and the NSS info like primary gid, homedir and shell
might be done with different policies per domain. As we already have a
domain-specific idmap configuration, doing the NSS info configuration
there also is the closest way to do it.

The alternative, if we did not want to put this call into the idmap child
would be to establish an equivalent engine like the whole "idmap config
*" just for the nss info. But as I believe this is closely related,
I'll just keep it in the idmap child.

This also extends the wbint_userinfo structure with pretty much all user
related fields. The idea is that the GetNssInfo call can do whatever it
wants with it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Make "idmap_find_domain" public
Volker Lendecke [Thu, 29 Dec 2016 09:54:56 +0000 (09:54 +0000)]
winbind: Make "idmap_find_domain" public

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: It's legitmate to have 0 groups in info3
Volker Lendecke [Sun, 25 Dec 2016 10:12:59 +0000 (10:12 +0000)]
winbind: It's legitmate to have 0 groups in info3

At least a Samba DC can send an info3 struct with base.groups.count==0. We
should not fail with that and just return 0 groups.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoidmap: Simplify idmap_ad_nss_init()
Volker Lendecke [Sat, 17 Dec 2016 14:03:59 +0000 (15:03 +0100)]
idmap: Simplify idmap_ad_nss_init()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Fix wb_lookupsids for AD DCs
Volker Lendecke [Sun, 25 Dec 2016 11:33:53 +0000 (11:33 +0000)]
winbind: Fix wb_lookupsids for AD DCs

Not yet a fix, but the IS_DC macro also contains the
ROLE_ACTIVE_DIRECTORY_DC, and once we start to fully do this we'll
need it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind4: Remove unused code
Volker Lendecke [Tue, 27 Dec 2016 14:01:13 +0000 (14:01 +0000)]
winbind4: Remove unused code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agowinbind: Initialize user list info to 0
Volker Lendecke [Fri, 30 Dec 2016 11:08:22 +0000 (11:08 +0000)]
winbind: Initialize user list info to 0

Further down wbint_userinfo will be extended. Make sure we don't
have uninitialized memory hanging around

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:librpc/gse: make use of gss_krb5_import_cred() instead of gss_acquire_cred()
Stefan Metzmacher [Thu, 22 Dec 2016 07:49:38 +0000 (08:49 +0100)]
s3:librpc/gse: make use of gss_krb5_import_cred() instead of gss_acquire_cred()

This avoids the usage of the ccselect_realm logic in MIT krb5,
which leads to unpredictable results.

The problem is the usage of gss_acquire_cred(), that just creates
a credential handle without ccache.

As result gss_init_sec_context() will trigger a code path
where it use "ccselect" plugins. And the ccselect_realm
module just chooses a random ccache from a global list
where the realm of the provides target principal matches
the realm of the ccache user principal.

In the winbindd case we're using MEMORY:cliconnect to setup
the smb connection to the DC. For ldap connections we use
MEMORY:winbind_ccache.

The typical case is that we do the smb connection first.
If we try to create a new ldap connection, while the
credentials in MEMORY:cliconnect are expired,
we'll do the required kinit into MEMORY:winbind_ccache,
but the ccselect_realm module will select MEMORY:cliconnect
and tries to get a service ticket for the ldap server
using the already expired TGT from MEMORY:cliconnect.

The solution will be to use gss_krb5_import_cred() and explicitly
pass the desired ccache, which avoids the ccselect logic.

We could also use gss_acquire_cred_from(), but that's only available
in modern MIT krb5 versions, while gss_krb5_import_cred() is available
in heimdal and all supported MIT versions (>=1.9).
As far as I can see both call the same internal function in MIT
(at least for the ccache case).

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:librpc/gse: remove unused #ifdef HAVE_GSS_KRB5_IMPORT_CRED
Stefan Metzmacher [Thu, 22 Dec 2016 07:47:32 +0000 (08:47 +0100)]
s3:librpc/gse: remove unused #ifdef HAVE_GSS_KRB5_IMPORT_CRED

We always have gss_krb5_import_cred(), it available in heimdal
and also the oldest version (1.9) of MIT krb5 that we support.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:librpc/gse: include ccache_name in DEBUG message if krb5_cc_resolve() fails
Stefan Metzmacher [Thu, 22 Dec 2016 07:46:21 +0000 (08:46 +0100)]
s3:librpc/gse: include ccache_name in DEBUG message if krb5_cc_resolve() fails

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:librpc/rpc: make sure we handle DCERPC_PACKET before DCERPC_CONNECT
Stefan Metzmacher [Thu, 29 Dec 2016 10:13:55 +0000 (11:13 +0100)]
s4:librpc/rpc: make sure we handle DCERPC_PACKET before DCERPC_CONNECT

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4:librpc/rpc: don't do an anonymous bind over ncacn_np:server[packet]
Stefan Metzmacher [Thu, 29 Dec 2016 10:11:50 +0000 (11:11 +0100)]
s4:librpc/rpc: don't do an anonymous bind over ncacn_np:server[packet]

DCERPC_AUTH_LEVEL_PACKET is basically the same as
DCERPC_AUTH_LEVEL_INTEGRITY.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoWAF: Fix detection of IPv6
Lukas Slebodnik [Tue, 6 Dec 2016 17:07:50 +0000 (18:07 +0100)]
WAF: Fix detection of IPv6

Detection of IPv6 failed with strict CFLAGS due to missing
header file.

  Checking for HAVE_IPV6       : not found

../test.c: In function ‘main’:
../test.c:226:34: error: implicit declaration of function
    ‘if_nametoindex’ [-Werror=implicit-function-declaration]
                        int idx = if_nametoindex("iface1");
                                  ^~~~~~~~~~~~~~

Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
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): Mon Jan  2 18:03:20 CET 2017 on sn-devel-144

7 years agoWAF: Fix detection os sysname ...
Lukas Slebodnik [Tue, 6 Dec 2016 17:07:43 +0000 (18:07 +0100)]
WAF: Fix detection os sysname ...

Detection of sysname failed with stricter CFLAGS
"-Werrorr=implicit-function-declaration -Werror=implicit-int"

  Checking uname sysname type              : not found
  Checking uname machine type              : not found
  Checking uname release type              : not found
  Checking uname version type              : not found

../test.c: In function ‘main’:
../test.c:8:32: error: implicit declaration of function ‘printf’
    [-Werror=implicit-function-declaration]
                                printf("%s", n.sysname);
                                ^~~~~~
../test.c:8:32: warning: incompatible implicit declaration
    of built-in function ‘printf’
../test.c:8:32: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’

Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>