1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

7375 Commits

Author SHA1 Message Date
Richard Sharpe
9077fc79d4 Remove an unused function call.
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Feb 13 23:29:54 CET 2015 on sn-devel-104
2015-02-13 23:29:53 +01:00
Stefan Metzmacher
eda9742e3f Happy New Year 2015!
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jan  1 02:47:59 CET 2015 on sn-devel-104
2015-01-01 02:47:59 +01:00
Stefan Metzmacher
8e90b93ddc s3:passdb: add optional get_trusteddom_creds() hooks
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11016

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-12-18 04:22:05 +01:00
Volker Lendecke
cf2c12baa8 messaging3: Add messaging_handler_send/recv
This repeatedly listens on msg_type. It's similar to messaging_register
with talloc based autocleanup. The handler is free to talloc_move a way
the record for later use.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-16 18:56:03 +01:00
Volker Lendecke
28f750643b messaging3: Add messaging_send_iov_from
In the notifyd code it will be very helpful to fake source server_ids

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-16 18:56:03 +01:00
Volker Lendecke
d9a8453bbf messaging3: Add messaging_names_db
This will enable messaging3 users to more easily register themselves
under a name

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-16 18:56:03 +01:00
Volker Lendecke
0013001e70 lib: Split out write_data[_iov]
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-07 00:12:07 +01:00
Volker Lendecke
214fc09a34 lib: Split out iov_buf[len]
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-07 00:12:07 +01:00
Volker Lendecke
a8491cb95a lib: read_data->read_data_ntstatus
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-07 00:12:07 +01:00
Volker Lendecke
97b2570a5e lib: Split out sys_[read|write] & friends
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-07 00:12:07 +01:00
Ralph Boehme
142db4048f s3:vfs: add create tags to SMB_VFS_CREATEFILE
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-04 22:11:07 +01:00
Ralph Boehme
b65e37dc01 s3:vfs: add SMB_VFS_READDIR_ATTR()
SMB_VFS_READDIR_ATTR is a last minute hook to fetch additional metadata
for a directory entry when we're already marshalling the SMB reply
buffer.

This would be used, when there's a need to repurpose some fields in the
the reply, like it's done with Apple's SMB2 extension "AAPL".

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-04 22:11:07 +01:00
Stefan Metzmacher
7ca8785cae s3:vfs.h: add more elements to struct fsp_lease
We'll need a reference to the smbd_server_connection as well
as a timeout handler.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-04 05:45:09 +01:00
Stefan Metzmacher
6b2f19a5e6 s3:open_files.idl: add data structures for SMB2.1 and SMB3.0 leases.
Pair-Programmed-With: Volker Lendecke <vl@samba.org>

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-12-04 05:45:09 +01:00
Garming Sam
7979c6cc50 idmap: unify passdb *id_to_sid methods
Instead of passing down gid or uid, a pointer to a unixid is now sent
down. This acts as an in-out variable so that the idmap functions can
correctly receive ID_TYPE_BOTH, filling in cache details correctly
rather than forcing the cache to store ID_TYPE_UID or ID_TYPE_GID.

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

Change-Id: I11409a0f498e61a3c0a6ae606dd7af1135e6b066
Pair-programmed-with: Andrew Bartlett <abarlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-12-03 04:21:09 +01:00
David Disseldorp
f833052899 param: remove unused get_share_params()
Given a share name, get_share_params() returns corresponding snum inside
a struct share_params. find_service() provides duplicate functionality.

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): Wed Nov 26 21:27:21 CET 2014 on sn-devel-104
2014-11-26 21:27:21 +01:00
Stefan Metzmacher
553b83c4d5 s3:smbprofile: profile async pread/pwrite/fsync syscalls
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 19 23:13:10 CET 2014 on sn-devel-104
2014-11-19 23:13:10 +01:00
Stefan Metzmacher
185c6feab7 s3:smbprofile: track connect_count and disconnect_count
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19 20:51:37 +01:00
Stefan Metzmacher
970b00e6ac s3:smbprofile: remove unused {START,END}_PROFILE_STAMP()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19 20:51:37 +01:00
Stefan Metzmacher
487556e68e s3:smbprofile: report idle state of 'idle_count' and 'idle_time'
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19 20:51:37 +01:00
Stefan Metzmacher
49f84f0719 s3:smbprofile: improve profiling for the security context switching.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19 20:51:37 +01:00
Stefan Metzmacher
e007c60a4f s3:smbprofile: count all SMB1 and SMB2 requests as 'request_count'
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19 20:51:37 +01:00
Stefan Metzmacher
0b0ac41aea s3:smb2_server: use async smbprofile macros
This improves profiling and corrently counts the total and idle time for async
requests.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19 20:51:37 +01:00
Stefan Metzmacher
cee1b4b053 s3:smbprofile: rewrite the internal macros
We now autogenerate a lot of code using
SMBPROFILE_STATS_ALL_SECTIONS macro which expands to
different SMBPROFILE_STATS_{COUNT,BASIC,BYTES,IOBYTES} macros.

This also allows async profiling using:

   struct mystate {
       ...

       SMBPROFILE_BASIC_ASYNC_STATE(profile_state);
       ...
   };

   ...

   SMBPROFILE_BASIC_ASYNC_START(SMB2_negotiate, profile_p, mystate->profile_state);

   ...

   SMBPROFILE_BYTES_ASYNC_SET_IDLE(mystate->profile_state);

   ...

   SMBPROFILE_BYTES_ASYNC_SET_BUSY(mystate->profile_state);

   ...

   SMBPROFILE_BASIC_ASYNC_END(mystate->profile_state);

The current START_PROFILE*()/END_PROFILE*() are implemented as legacy wrappers.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-11-19 20:51:37 +01:00
Volker Lendecke
f82bb9fffd s3:smbprofile: Make smbprofile.h includable on its own
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19 20:51:37 +01:00
Stefan Metzmacher
86a951b4ff s3:smbd: improve writecache profiling
In order to have useful profiling counters should never be decremented.
We need a separate counter for deallocation events.

The current value can be calculated by allocations - deallocations.

We also use better names and avoid having an array for the flush reasons.
This will simplify further profiling improvements a lot.

The value writecache_num_write_caches (this was similar to writecache_allocations)
is replaced by writecache_cached_writes, which counts the amount of writes which
were completely handled by the cache.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19 20:51:37 +01:00
Stefan Metzmacher
255ff0a972 s3:smbprofile: remove unused nmbd related counters
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19 20:51:36 +01:00
Stefan Metzmacher
8622168a4a s3:smbprofile: add END_PROFILE_BYTES() marco
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-19 20:51:36 +01:00
Günther Deschner
d9eb1359d8 s3-proto: remove duplicate proto for add_string_to_array().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-11-17 17:34:05 +01:00
Volker Lendecke
04a9a1ac6d lib: Slightly simplify strupper_m
toupper_ascii_fast_table is only referenced here, make it static.

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): Fri Nov 14 00:31:16 CET 2014 on sn-devel-104
2014-11-14 00:31:16 +01:00
David Disseldorp
77b5be1742 printing: add jobid_to_sysjob helper function
Samba needs to deal with two types of print job identifiers, those
allocated by the printing backend (sysjob ids), and those allocated
by Samba's spoolss server (jobids).

This change adds a helper function to map spoolss jobids to sysjob ids,
to go alongside the corresponding sysjob to jobid mapping function.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-30 06:52:04 +01:00
Stefan Metzmacher
bbad2fed7c s3:libsmb: remove unused cli_set_username() function
Change-Id: Ib432b4ff66f966de9e733e01de6de2f486c0c728
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-17 12:57:07 +02:00
Stefan Metzmacher
71432b9eda s3:libsmb: Remove unused domain copy stored in cli_state
Change-Id: I7333140906bb3a487205b5760396dcc00a9f49b0
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-17 12:57:07 +02:00
Andrew Bartlett
2b9d6d3d9b s3:libsmb: Remove unused password copy stored in cli_state
Change-Id: Ia6b33a25628ae08be8a8c6baeb71ce390315cb45
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-17 12:57:07 +02:00
Andrew Bartlett
295b323b1c s3-librpc: Add cli_rpc_pipe_open_with_creds()
This provides a credentials-based interface.  In the long term, we
will want to change this not to reference the credentials, but for now
this suits the caller in winbindd_cm.c

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-17 12:57:07 +02:00
Jeremy Allison
aa2a6c7b18 s3: smbd: Preparation for leases code merge. Ensure VFS is ready for 4.2.0.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct 10 02:55:53 CEST 2014 on sn-devel-104
2014-10-10 02:55:52 +02:00
Andrew Bartlett
14f6256c51 s3-winbindd: Allow winbindd to connect over SMB2 to servers
This allows SMB signing to work against many more DCs, and so improves network security.

The default for "client max protocol" remains NT1 in the rest of the code.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-08 01:09:51 +02:00
Volker Lendecke
5496270d0f profiling: Make WITH_PROFILE span more in smbprofile.h
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): Fri Oct  3 22:17:46 CEST 2014 on sn-devel-104
2014-10-03 22:17:46 +02:00
Volker Lendecke
a33b445a7d profiling: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-03 19:55:09 +02:00
Volker Lendecke
0e1b60e8c3 profiling: Move some #defines to profile.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-03 19:55:09 +02:00
Volker Lendecke
d523e0b7ed profiling: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-03 19:55:09 +02:00
Volker Lendecke
7c1f6c7f61 profiling: Make "struct profile_header" static
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-03 19:55:09 +02:00
Michael Adam
797ada104e s3:messaging: explain why the messaging_send*() functions need a tevent-loop.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-30 16:36:10 +02:00
Christof Schmitt
16594e7fc0 s3: Move init_lsa_ref_domain_list to lib
This will be used in the next patch in winbind.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-29 10:52:47 +02:00
Stefan Metzmacher
270f7b3441 s3:passdb: add pdb_get_trust_credentials()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>
2014-09-27 19:42:37 +02:00
Michael Adam
01026363dd s3:messaging: add fds-array to messaging_send_iov()
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2014-09-24 08:44:12 +02:00
Michael Adam
1667839192 s3:messaging: add fds-array to message-backend send function
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2014-09-24 08:44:12 +02:00
Volker Lendecke
5454f71fc0 lib: Move tdb lock timeout fns to source3
This is not the nicest code and needs to be replaced. Remove it from
common.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-09-18 20:36:11 +02:00
Jeremy Allison
0519088c53 s3: smbd: Change the function signature of srvstr_push() from returning a length to returning an NTSTATUS with a length param.
srvstr_push_fn() now returns an NTSTATUS reporting any
string conversion failure.

We need to get serious about returning character set conversion errors
inside smbd.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:54 +02:00
Volker Lendecke
1057240733 brlock: Do auto-cleanup at conflict time
This avoids the need to do sweeping validate_lock_entries calls

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-23 00:24:18 +02:00
Ralph Boehme
b3d17aa5ba Fix AFP_BackupTime byte order and use ISO C99 integer types
AFP_BackupTime value must be 0x80000000 and all existing defines use
native byte order, not byte swapped.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-08-18 17:42:50 +02:00
Volker Lendecke
c2f66e71aa messaging3: Include messages_dgm.h only in messages.c
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): Tue Aug 12 02:21:32 CEST 2014 on sn-devel-104
2014-08-12 02:21:32 +02:00
Volker Lendecke
a1529c3302 messaging3: Add messages_dgm.h
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-11 23:57:13 +02:00
Volker Lendecke
bab01d1a89 messaging3: Pass dir_owner to messaging_dgm_init() 2014-08-11 23:57:13 +02:00
Volker Lendecke
f408a42896 messaging3: Pass cache_dir to messaging_dgm_init()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-11 23:57:12 +02:00
Volker Lendecke
3aa3c6ed01 messaging3: Directly refer to messaging_dgm in messages.c
This removes the messaging_backend abstraction layer from messages_dgm.c. That
layer was introduced for ctdb and is still used there. But as the messaging_dgm
interface is very slim anyway, I don't think directly calling it is too bad.

Why this commit? It is another step towards making messages_dgm
independent of messages.[ch], thus it might become usable in other
contexts like ctdb and source4

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-11 23:57:12 +02:00
Volker Lendecke
32d45cf2f3 messaging3: Add messaging_cleanup
Rename smbcontrol's dgm-cleanup to msg-cleanup. We haven't published
this UI yet :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-11 23:57:12 +02:00
Volker Lendecke
dcd3e2f2dc messaging_dgm: Remove unused "messaging_context"
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-11 23:57:12 +02:00
Volker Lendecke
7cb94e6860 messaging3: Explicitly pass server_id to messaging_dgm_init
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-11 23:57:12 +02:00
Volker Lendecke
706ba593d6 messaging3: Explicitly pass tevent_context to messaging_dgm_init
One dependency less on messaging_context()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-11 23:57:12 +02:00
Volker Lendecke
371e99959c messaging_dgm: Receive through a cb function
This avoids calling messaging_dispatch_rec directly from messaging_dgm.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-11 23:57:12 +02:00
Volker Lendecke
446de4f680 vfs3: Pass "lease" through SMB_VFS_CREATE_FILE
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-11 21:11:16 +02:00
Volker Lendecke
c71b0c413c ctdbd_conn: Remove ctdb_packet
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 15:40:10 +02:00
Stefan Metzmacher
6669a84ad0 s3:smbd: remember smbXsrv_connection for each smb_request
This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:12 +02:00
Volker Lendecke
d997d93af1 lib: Remove unused serverid_register_msg_flags()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-07-31 18:49:46 +02:00
Garming Sam
47f10ac65c param: remove lp_get_parameter
Ensure lpcfg_parm_struct, its counterpart is equivalent

Change-Id: I127ce5d3cf7fe02ebf161aa011ec3b41bc32a656
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-07-31 08:17:11 +02:00
Garming Sam
a1d2e52110 param: remove unused service_ok function
Change-Id: I0736a3b9b73aa80f529327ec70e856dd7fc008c6
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-07-31 08:17:11 +02:00
Michael Adam
cd95937369 s3: remove stat_ex.vfs_private completely
It is not used any more.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Jul 24 14:23:11 CEST 2014 on sn-devel-104
2014-07-24 14:23:11 +02:00
Stefan Metzmacher
45807028d4 lib/util: move memcache.[ch] to the toplevel 'samba-util' library
This is generic enough that it could be used in all code.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jul 18 15:43:33 CEST 2014 on sn-devel-104
2014-07-18 15:43:33 +02:00
Stefan Metzmacher
b560fac7f7 s3:lib/memcache: only include the required header files
We don't need the full "includes.h".

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-07-18 13:16:04 +02:00
Volker Lendecke
6f8fd3d5ab smbd: Remove unused blocking_lock_record* from VFS_BRL_CANCEL_WINDOWS
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
Volker Lendecke
b08fe2d98d smbd: Remove unused blocking_lock_record* from VFS_BRL_LOCK_WINDOWS
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
Andrew Bartlett
a0105b84b8 secrets: Ensure we store the secureChannelType when written to secrets.ldb
This will allow winbindd to know when we are an RODC
without needing to dig into sam.ldb.

Change-Id: Ibdfa37fe6269305ccc5db42479f4a8db5eea53f3
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-07-04 02:52:35 +02:00
Volker Lendecke
364bdadde3 messaging3: Make messaging_dgm_init return 0/errno
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): Wed Jun 18 21:17:57 CEST 2014 on sn-devel-104
2014-06-18 21:17:57 +02:00
Volker Lendecke
9fd8d5154f messaging3: Make messaging_dgm_wipe return 0/errno
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-18 18:51:13 +02:00
Volker Lendecke
2f3435085e messaging3: Make messaging_dgm_cleanup return 0/errno
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-18 18:51:13 +02:00
Volker Lendecke
e6b33ce611 messaging3: Make the _send function return 0/errno
This is to eventually make messaging_dgm usable in ctdb

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-18 18:51:13 +02:00
Andrew Bartlett
b359b0c160 passdb: Allow a passdb module to do idmap for everything
This patch seems odd, but the pdb_samba_dsdb module has exactly this
semantics.  That is, the pdb_samba_dsdb is responsible for all IDMAP
values, due to backing on to the idmap.ldb allocator.  This option is
added so we can continue to support the mappings written into that
database even when switching winbindd implementations - the source4/
winbind code would only ask the idmap_ldb code, no matter what the
SID.

Almost all of the behaviour for this is already in winbindd, but we
need this extra flag function so as to avoid (currently intentional)
errors at startup due to not having a per-domain allocation
configured in the smb.conf.

Andrew Bartlett

Change-Id: I6b0d7a1463fe28dfd36715af0285911ecc07585c
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
2014-06-16 00:26:26 +02:00
Michael Adam
9f6c4c4da2 vfs: update a bit-rotten comment
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-06-13 17:29:10 +02:00
Andrew Bartlett
597d2a7a29 auth: Provide a way to use the auth stack for winbindd authentication
This adds in flags that allow winbindd to request authentication
without directly calling into the auth_sam module.

That in turn will allow winbindd to call auth_samba4 and so permit
winbindd operation in the AD DC.

Andrew Bartlett

Change-Id: I27d11075eb8e1a54f034ee2fdcb05360b4203567
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-11 10:18:26 +02:00
Christian Ambach
558850c495 s3:lib/afs move afs_settoken.c to common lib dir
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-06-04 20:09:38 +02:00
Christian Ambach
89961ca297 s3:lib/afs move afs.c to common lib dir
some of the code in afs.c is needed by wbinfo that lives in the toplevel
nsswitch directory, so move the afs.c file to a new top-level lib/afs
directory. Use the name afs_funcs to avoid collisions with the afs.h
header from OpenAFS

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-06-04 20:09:38 +02:00
Andrew Bartlett
191d754091 s3-param: Add lp_dnsdomain() for use by winbindd
Change-Id: I987aa533ebe11c93b9e836fafc7b19c81bf600a5
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-04 03:22:26 +02:00
Volker Lendecke
c487937b01 messaging3: Make messaging_context private
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-31 01:59:18 +02:00
Volker Lendecke
8ddbf18115 messaging3: Add and use messaging_tevent_context()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-31 01:59:17 +02:00
Volker Lendecke
56a7ddd777 messaging3: Introduce messaging_local_backend()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-31 01:59:17 +02:00
Volker Lendecke
331296df94 messaging3: The backend send_fn doesn't need a messaging_context
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-31 01:59:17 +02:00
Michael Adam
e4453bdc37 s3:messaging: change messaging_backend to use iovec instead of data blob in send_fn
This also changes the layering

messaging_send_iov -> messaging_send_buf -> messaging_send

to

messaging_send_buf -> messaging_send -> messaging_send_iov

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-30 00:03:20 +02:00
Mathias Dietz
8935242489 Add protocol version to smbstatus output
Signed-off-by: Mathias Dietz <mdietz@de.ibm.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu May 22 18:37:27 CEST 2014 on sn-devel-104
2014-05-22 18:37:27 +02:00
Andrew Bartlett
6c37cd6544 auth: Allow auth_samba4 to be forced to run a specific auth module
This will allow new tests to be written to validate winbindd authentication results

Andrew Bartlett

Change-Id: I008eba1de349b17ee4eb9f11be08338557dffecc
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-05-16 10:23:26 +02:00
Volker Lendecke
a6e49f9cda messaging3: Add messaging_dgm_register_tevent_context
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-08 09:10:12 +02:00
Volker Lendecke
7a266c575a messaging3: Add messaging_filtered_read
This delegates the decision whether to read a message to a callback

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-08 09:10:12 +02:00
Garming Sam
98dbc38efa move str_list_make_v3 out of s3 code
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:16 +02:00
Garming Sam
509cc45c95 param: add extra default parameter to get_parametrics_by_service
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:16 +02:00
Garming Sam
3845138731 param: remove unused lp_set_option
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:16 +02:00
Garming Sam
4a86b693fd param: remove lp_string_is_valid_boolean
This call is never made in the code and should in fact crash if it was ever called with a valid boolean

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/106
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:14 +02:00
Volker Lendecke
d0590eec7e messaging3: Fix messaging_read_send/recv
messaging_read_send/recv was okay for just one handler in the queue. For
multiple handlers it was pretty broken.

A handler that deletes itself as part of the callback (pretty typical use
case...) drops the message for a subsequent handler that responds to the same
message type. In messaging_dispatch_rec we walk the array, however
messaging_read_cleanup has already changed the array. tevent_req_defer_callback
does not help here: It only defers the callback, it does not defer the cleanup
function.

This also happens when a callback deletes a different handler

A handler that re-installs itself in the callback might get a message twice.

This patch changes the code such that only messaging_dispatch_rec adds records
to msg_ctx->waiters, new waiters are put into a staging area first
(msg_ctx->new_waiters). Also messaging_read_cleanup does not move anything
around in msg_ctx->waiters, it only nulls out itself. messaging_dispatch_rec is
changed to cope with this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-30 14:52:08 +02:00
Michael Adam
0df8988c08 autorid: add high_id to range config and fill it where we also fill range->low_id.
This corresponds to low_id for convenience and allows
for computations without going back to the global config.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-25 15:35:09 +02:00
Volker Lendecke
843f094628 s3: messaging: Add infrastructure to clean up orphaned sockets every 15 minutes as a background task.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-23 22:33:09 +02:00
Volker Lendecke
6874e4a0f2 messaging_dgm: Add messaging_dgm_wipe
This walks all sockets and wipes the left-overs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-23 22:33:09 +02:00