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

7309 Commits

Author SHA1 Message Date
Volker Lendecke
db84e7a277 ctdbd_conn: Pass "ev" through ctdbd_msg_call_back
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:18 +02:00
Volker Lendecke
267645545f ctdbd_conn: Pass "ev" through ctdb connection callbacks
This prepares the same logic we've implemented in messages_dgm for clustering
that is used in 6d3c064f1a: We need to reply for messages from ctdb in nested
event contexts properly.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:18 +02:00
Volker Lendecke
35b4750ee3 messaging: Broadcast messages to all event contexts
We must give all event contexts that might be interested the chance to pick up
the message. If we send a message to ourselves via messaging_send_iov_from,
nested event contexts need to get a chance to see the message. Before this
patch only the main event context in msg_ctx got it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:18 +02:00
Volker Lendecke
33df9c538a messaging: Keep an array of event contexts registered
This is done with an explicit reference-counting and without talloc
destructors. The code is isolated enough for now that explicit refcount
management seems simpler. This might change in the future, but for
now keep it simple.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:17 +02:00
Volker Lendecke
17a472bc99 messaging: Factor out messaging_dispatch_waiters
No real code change: This makes dispatching to non-classic receives available
for other callers.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:17 +02:00
Volker Lendecke
667307cd78 g_lock: remove unused functions g_lock_get() and g_lock_get_talloc()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:17 +02:00
Volker Lendecke
21df1401ab g_lock: Use parse_record in g_lock_dump
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:17 +02:00
Volker Lendecke
145b9cbbf2 g_lock: remove unused functions g_lock_put() and g_lock_record_store()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:17 +02:00
Volker Lendecke
241f31dbd4 g_lock: Use dbwrap_do_locked in g_lock_write_data
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:17 +02:00
Volker Lendecke
fc891872c2 g_lock: Use dbwrap_do_locked in g_lock_lock_retry
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:17 +02:00
Volker Lendecke
946e334b11 g_lock: Use dbwrap_do_locked for g_lock_lock
Don't talloc the record

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:17 +02:00
Volker Lendecke
8d1e950cef g_lock: Avoid talloc in g_lock_trylock
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:17 +02:00
Volker Lendecke
a626f822a2 g_lock: Initialize variables
gcc -O3 complains, but I think this is a false positive

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:17 +02:00
Volker Lendecke
e2aa568bc8 g_lock: Implement g_lock_unlock without talloc
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:17 +02:00
Volker Lendecke
8f2a5f1418 g_lock: add "struct g_lock" without talloc
Enable handing the g_lock.tdb content without having to talloc

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:17 +02:00
Volker Lendecke
2b6015f1e8 g_lock: simplify g_lock_trylock
The now mandatory talloc_realloc_array will go away soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:17 +02:00
Volker Lendecke
b03ca948d8 g_lock: Walk locks only once in g_lock_trylock
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:16 +02:00
Volker Lendecke
ecb4283f3d dbwrap_watch: Implement do_locked
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:16 +02:00
Volker Lendecke
faa53616ea dbwrap_watch: Introduce dbwrap_watch_rec
The idea is to leave the "watchers" array unparsed until it's needed. This
avoids a few talloc calls and unnecessary parsing.

Also, it deletes quite a few lines of code and .text bytes.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:16 +02:00
Volker Lendecke
09915bf8e5 dbwrap: Convert backend store to storev
Convert all implementors of dbwrap_store to a storev-style call
by using the dbwrap_merge_dbufs call

For dbwrap_tdb, this matches tdb_storev.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:16 +02:00
Amitay Isaacs
f7daa45304 dbwrap_ctdb: Fix calculation of persistent flag
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12891

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-19 12:00:15 +02:00
Ralph Boehme
de9d219577 dbwrap: Ask CTDB for local tdb open flags
Bug: https://bugzilla.samba.org/show_bug.cgi?id=12891

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Jul 12 13:25:11 CEST 2017 on sn-devel-144
2017-07-12 13:25:11 +02:00
Ralph Boehme
b2b7e3b971 ctdbd_conn: pass persistent bool instead of tdb_flags
ctdbd_db_attach() only needs to know the ctdb database model, not the
rest of the flags.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-07-12 09:01:19 +02:00
Ralph Boehme
0077296cee ctdbd_conn: move CTDB_CONTROL_ENABLE_SEQNUM control to db_open_ctdb
No change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-07-12 09:01:19 +02:00
Amitay Isaacs
6ae063a109 dbwrap: CTDB ignores tdb_flags passed to db attach controls
Bug: https://bugzilla.samba.org/show_bug.cgi?id=12891

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-12 09:01:18 +02:00
Ralph Boehme
a70be43246 dbwrap: enable mutexes by default for volatile TDBs
Bug: https://bugzilla.samba.org/show_bug.cgi?id=12891

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-07-12 09:01:18 +02:00
Volker Lendecke
5eccc2fd00 messaging: Remove messaging_handler_send
This did not really take off, notifyd was the only user

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 Jul  7 05:11:48 CEST 2017 on sn-devel-144
2017-07-07 05:11:48 +02:00
Volker Lendecke
0c1e08b590 messaging: make messaging_rec_create public
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-07-07 00:52:24 +02:00
Alexander Bokovoy
332b179143 smbldap: expose bind callback via API and increase smbldap ABI version
Until we fully migrate to use gensec in smbldap, we need to continue
exposing bind callback to allow FreeIPA to integrate with smbldap.

Since smbldap API is now lacking direct access to 'struct
smbldap_state' and new API functions were added to give access to
individual members of this structure, it makes sense to increase ABI
version too.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jul  4 11:14:49 CEST 2017 on sn-devel-144
2017-07-04 11:14:49 +02:00
Stefan Metzmacher
e0113918c5 s3:libsmb: remove unused 'bool show_hdr' from cli_cm_open()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-06-27 16:57:47 +02:00
Volker Lendecke
38581bc116 lib: Use ctdb_protocol instead of ctdb_private
ctdb_private is much broader. Right now we implement the protocol
ourselves. In the future, we might switch to the native ctdb
client implementation defined in ctdb_client.h, but that's a
different project :-)

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): Sat Jun 24 05:33:41 CEST 2017 on sn-devel-144
2017-06-24 05:33:41 +02:00
Volker Lendecke
a2436b67e5 messaging: Deliver messages only once
This survived an autobuild, so no subsystem strictly needs this anymore. In
particular the notify subsystem has been rewritten.

Why this patch? It removes some complexity from core code, and it reduces the
potential memory overconsumption: Right now I'm working on a g_lock_ping_pong
test. This test does a lot of messaging_filtered_read_send calls in a tight
loop on a nested event context. With the current code we let the
messaging_filtered_read code consume the message that arrives, but it also
posts it for consumption by the main event context attached to the messaging
context with its "classic" callback. This test never comes back to the main
event context, so it accumulates more and more self-posted messages. That's
just unnecessary, given that due to the successful autobuild nothing but the
read1 test makes use of the "multicasting" of messages.

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 21 07:30:39 CEST 2017 on sn-devel-144
2017-06-21 07:30:39 +02:00
Volker Lendecke
ac656f3ddd lib: Fix typos
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-21 03:15:08 +02:00
Volker Lendecke
ce9e92c114 lib: Give messages_ctdbd.c its own header
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-21 03:15:07 +02:00
Volker Lendecke
c8f05f9736 messaging: Use size_t for array sizes
We use talloc_realloc, that takes size_t.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-21 03:15:07 +02:00
Volker Lendecke
d7ccf0d977 messaging: Fix queueing on FreeBSD
FreeBSD does not do the nice blocking send that Linux does. Instead,
it returns ENOBUFS if the dst socket is full. According to the
manpage you have to do polling. Try with exponential backoff, at
the end try once a second forever.

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 Jun 20 23:03:11 CEST 2017 on sn-devel-144
2017-06-20 23:03:11 +02:00
Andreas Schneider
0caf40ec01 s3:popt_common: Reparse the username in popt_common_credentials_post()
When we parse the username in the options handling, the smb.conf file
has not been loaded yet. So we are not aware of a 'winbind separator'
set in the config file.

We need to read and set the username again in the post-processing of the
credentials.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-06-20 10:39:15 +02:00
Jeremy Allison
bd31d538a2 s3: libsmb: Correctly save and restore connection tcon in smbclient, smbcacls and smbtorture3.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12831

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2017-06-17 06:39:20 +02:00
Jeremy Allison
93fa0c8660 s3: libsmb: Widen cli_state_get_tid() / cli_state_set_tid() to 32-bits.
Copes with SMB2 connections.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2017-06-17 06:39:20 +02:00
Volker Lendecke
b9f32b2ea6 g_lock: open with LOCK_ORDER_3
xattr_tdb needs g_lock in a clustered environment. Nobody else
uses LOCK_ORDER_3 at this moment, so this looks safe.

The last one to use this was dbwrap_watch.tdb, and that's gone. The only
other one was notify_index.tdb, and that's gone too.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-15 13:19:15 +02:00
Volker Lendecke
d19e7709d9 g_lock: Heuristically check for server existence
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-15 13:19:14 +02:00
Volker Lendecke
4b2826646b g_lock: Allow lock upgrade/downgrade
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-15 13:19:14 +02:00
Volker Lendecke
90d7784d45 g_lock: Make g_lock_dump return a complete list of locks
To be honest, it did not really make sense to just pass in
lock holders individually. You could argue that it made sense
with in reality only G_LOCK_WRITE around, but soon we will have
G_LOCK_READ and thus multiple lock holders on a single lock.

Now that we also have userdata, change the g_lock_dump API

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-15 13:19:14 +02:00
Volker Lendecke
4478cd59ad g_lock: Add g_lock_write_data
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-15 13:19:14 +02:00
Volker Lendecke
c400e2b54e g_lock: Make g_lock_record_store also store userdata
Sequel to the previous commit changing the get/put routines for
the on-disk format

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-15 13:19:14 +02:00
Volker Lendecke
4d404f23c9 g_lock: Reformat to allow userdata
The next patches will make g_locks carry data. This
prepares the on-disk format.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-15 13:19:14 +02:00
Volker Lendecke
4422124e09 g_lock: Move parsing routines together
No code change, just shuffling around:

Before this patchset, g_lock_parse was somewhere in the middle. This carries no
real logic, put it on top.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-15 13:19:14 +02:00
Volker Lendecke
636137a30a g_lock: unparse->put
Make it more in line with server_id_get/put

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-15 13:19:14 +02:00
Volker Lendecke
fadc877c59 g_lock: parse->get
Make it more in line with server_id_get/put

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-15 13:19:14 +02:00
Volker Lendecke
4d1f9ff1b8 g_lock: Remove a pointless "else"
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-15 13:19:14 +02:00
Volker Lendecke
6358901f15 g_lock: Remove unused g_lock_get
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-15 13:19:13 +02:00
Volker Lendecke
49a80e5a0c g_lock: Make it endian-neutral
Add explicit parsing

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-15 13:19:13 +02:00
Volker Lendecke
9677101850 g_lock: More correct error msg
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-15 13:19:13 +02:00
Volker Lendecke
90e2bf50c7 g_lock: Fix two typos
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-15 13:19:13 +02:00
Volker Lendecke
21b27105e8 ctdbd_conn: Fix ctdbd_connection_destructor
clang had complained with

../source3/lib/ctdbd_conn.c:1784:34: warning: variable 'send_state' used in loop condition
      not modified in loop body [-Wfor-loop-analysis]
        for (send_state = c->send_list; send_state != NULL;) {
                                        ^~~~~~~~~~
../source3/lib/ctdbd_conn.c:1791:34: warning: variable 'recv_state' used in loop condition
      not modified in loop body [-Wfor-loop-analysis]
        for (recv_state = c->recv_list; recv_state != NULL;) {
                                        ^~~~~~~~~~

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Jun 10 03:33:13 CEST 2017 on sn-devel-144
2017-06-10 03:33:13 +02:00
Volker Lendecke
500df7a3ca ctdbd_conn: Fix a copy&paste error
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-06-09 23:25:16 +02:00
David Mulder via samba-technical
08a21f3539 messaging: fix net command failure due to unhandled return code
messaging_init_internal() blanket returned NT_STATUS_INTERNAL_ERROR
instead of correctly changing the return code to an NTSTATUS code. Also
return more appropriate mem error.

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

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Jun  8 08:04:05 CEST 2017 on sn-devel-144
2017-06-08 08:04:05 +02:00
Jeremy Allison
aada94885d s3: VFS: Change SMB_VFS_SYS_ACL_SET_FILE to use const struct smb_filename * instead of const char *.
We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-05-31 22:50:22 +02:00
Jeremy Allison
cea8e57eac s3: VFS: Change SMB_VFS_SYS_ACL_GET_FILE to use const struct smb_filename * instead of const char *.
We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Requires a few extra cleanups in calling code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-05-31 22:50:22 +02:00
Jeremy Allison
85c8780581 s3: VFS: Change SMB_VFS_SYS_ACL_DELETE_DEF_FILE to use const struct smb_filename * instead of const char *.
We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-05-31 22:50:22 +02:00
Jeremy Allison
63d2003ecd s3: lib: Add new utility function cp_smb_filename_nostream().
Will be needed when we migrate lower-level VFS functions to
take an struct smb_filename *, especially the SYS_ACL and
XATTR modification modules, as these must ignore a passed-in
stream name.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-05-31 22:50:21 +02:00
Volker Lendecke
ccd4f81488 lib: Remove use of MSG_NOSIGNAL
According to susv4 sendmsg, NOSIGAL is effective for stream-oriented sockets.
Datagram sockets won't send SIGPIPE anyway. Looking at Linux kernel sources,
this is only looked at in stream functions. I guess this is a left-over from my
tmsgd attempts, which was based on stream sockets. messaging_dgm still only
uses datagram sockets, so MSG_NOSIGNAL is not needed here.

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

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 May 30 16:39:12 CEST 2017 on sn-devel-144
2017-05-30 16:39:12 +02:00
Günther Deschner
8e52229fe8 s3-lib/idmap_cache: remove some dead prototypes
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-05-10 15:53:21 +02:00
Günther Deschner
af8946df25 s3-lib: remove some dead prototypes
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-05-10 15:53:20 +02:00
Volker Lendecke
4ed1bfb9f8 dbwrap_ctdb: Fix a typo
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 May 10 03:25:40 CEST 2017 on sn-devel-144
2017-05-10 03:25:40 +02:00
Jeremy Allison
547524d7f8 s3: popt: Change to NULL from talloc_autofree_context() now we correctly free on exit.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue May  9 14:00:40 CEST 2017 on sn-devel-144
2017-05-09 14:00:40 +02:00
Jeremy Allison
bec0cd2ee2 s3: client tools. Remove direct access to struct user_auth_info *cmdline_auth_info.
Only access through utility functions. Remove all the local pointer aliases
that were just being set to cmdline_auth_info in the client tools.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-05-09 09:56:09 +02:00
Jeremy Allison
1a8f410ece s3: popt: Add utility functions popt_get_cmdline_auth_info(), popt_free_cmdline_auth_info().
Leave the global cmdline_auth_info still exposed, we will make it static
once the users have been converted to the utility functions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-05-09 09:56:09 +02:00
Jeremy Allison
2dcef34795 s3: popt: When using a global variable, don't hide it by helper locals.
That makes it very unclear when you're using a global.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-05-09 09:56:09 +02:00
Ralph Boehme
220c617cc0 s3/dbwrap_ctdb: free resources in an error code path
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sun May  7 16:40:19 CEST 2017 on sn-devel-144
2017-05-07 16:40:19 +02:00
Ralph Boehme
556d26230f s3/dbwrap_ctdb: set async_ctx to initialized
After initializing the async connection to ctdb we must set initialized
to true.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-05-07 12:44:18 +02:00
Volker Lendecke
1e7bec40d1 lib: Fix a comment
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 May  3 20:00:25 CEST 2017 on sn-devel-144
2017-05-03 20:00:25 +02:00
Volker Lendecke
b23728ac73 lib: Fix whitespace
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-05-03 15:58:23 +02:00
Volker Lendecke
6f81f07303 dbwrap_watch: Protect against corrupt records
If locking.tdb contains invalid records, "get_file_infos" called from directory
enumeration crashes in Samba 4.4. The reason is that if "dbwrap_watched_parse"
returns -1 due to record corruption, dbwrap_watched_parse_record returns
NT_STATUS_OK without having called the parse function. Before 66cba9939b
this led to "lck->data" to be uninitialized data, so smbd 4.4 would crash in
this case.  After 66cba9939b we implicitly initialize "state.lck" to NULL,
so we don't have this particular problem anymore

Apply the fix in master too, returning NT_STATUS_OK from parse_record without
having called the parser could lead to bugs in other cases too.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-05-01 10:40:21 +02:00
Volker Lendecke
04b2a18a11 lib: Fix CID 1405493 Error handling issues (CHECKED_RETURN)
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 Apr 25 23:07:25 CEST 2017 on sn-devel-144
2017-04-25 23:07:25 +02:00
Hanno Böck
fd98a7b6a0 cleanupdb: Fix a memory read error
Bug: https://bugzilla.samba.org/show_bug.cgi?id=12748

Signed-off-by: Hanno Böck <hanno@hboeck.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-04-20 16:53:17 +02:00
Volker Lendecke
fef69a132b smbldap: Bump version number
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Apr 20 14:23:14 CEST 2017 on sn-devel-144
2017-04-20 14:23:14 +02:00
Volker Lendecke
e4d013caa2 smbldap: Privatize struct smbldap_state
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2017-04-20 10:13:25 +02:00
Volker Lendecke
848067abbc smbldap: Introduce "smbldap_get_paged_results"
This should be hidden inside smbldap.c, but this is a quick way to
get smbldap_state private to smbldap.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2017-04-20 10:13:25 +02:00
Volker Lendecke
84b7125b99 smbldap: Introduce "smbldap_get_paged_results"
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2017-04-20 10:13:25 +02:00
Volker Lendecke
46968fc60f smbldap: Introduce "smbldap_get_ldap"
This is a pretty big boiler-plate change. I've renamed the struct member
temporarily to find all accessors. Not sure where this leads in the end, but
the goal is to make struct smbldap_struct private to smbldap.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2017-04-20 10:13:25 +02:00
Ralph Boehme
cc56fcd0e5 dbwrap_watch: add parse_record_send/recv wrappers
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-04-18 22:54:16 +02:00
Ralph Boehme
2813b53e1a dbwrap_ctdb: implement parse_record_send()/recv()
This mainly works like the sync version, but calls ctdbd_parse_send/recv
instead.

We use one global ctdb connection that is used exclusively for async
requests.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-04-18 22:54:16 +02:00
Ralph Boehme
6a1734ebfd dbwrap_ctdb: factor out a db_ctdb_try_parse_local_record() function
Pair-programmed-with: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-04-18 22:54:16 +02:00
Ralph Boehme
0a0c50d361 ctdb_conn: add ctdbd_parse_send/recv
Implement the ctdb packet layer for async parse send/recv with tevent.

ctdbd_setup_fde() will is used to create an fde from the
connection fd and will be called from dbwrap_ctdb.

ctdbd_parse_send() and ctdbd_parse_recv() will be used by dbwrap_ctdb
for async packet sending and receiving.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-04-18 22:54:16 +02:00
Jeremy Allison
60af864f75 s3:lib: Fix incorrect logic in sys_broken_getgroups()
If setlen == 0 then the second argument must be ignored.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-04-18 11:47:17 +02:00
Jeremy Allison
b4e4042b37 s3:lib:charcnv: Remove use of global global_iconv_handle
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-04-18 11:47:17 +02:00
Volker Lendecke
7459289551 lib: Remove unused winbind_get_groups and _get_sid_aliases
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-03-28 17:45:18 +02:00
Volker Lendecke
649deb63c5 tldap: Allow dropping messages in tldap_search()
For probing whether a connection is a live a rootdse search might be
interesting where we don't really care for the result, only success or
failure of the operation.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-03-18 05:05:24 +01:00
Jeremy Allison
2780a56d0b Changes to make the Solaris C compiler happy.
Fix Bug 12693 dbwrap_watch.c syntax error before or at: }

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

Signed-off-by: Tom schulz <schulz@adi.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-03-16 20:30:19 +01:00
Volker Lendecke
ac71bb3eb4 lib: Make gencache hash size configurable, default to 10000
For large deployments with many users, we put a lot of idmapping
entries into gencache. Increase the hash size from our default 131.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2017-03-03 21:55:26 +01:00
Andreas Schneider
9297ac44f7 s3:lib: Do not segfault if username is NULL
Found by covscan.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-02-23 03:18:10 +01:00
Chris Lamb
39f2579a54 Correct "successfuly" typos.
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-02-22 08:26:22 +01:00
Chris Lamb
a4ab7c73bd Correct "occured" typos.
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-02-22 08:26:21 +01:00
Chris Lamb
c4feed0b8c Correct "doesnt" typos.
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-02-22 08:26:21 +01:00
Volker Lendecke
2ef3cb0093 lib: Avoid an "includes.h"
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-02-15 02:28:16 +01:00
Volker Lendecke
5f2c6360bb lib: Fix some whitespace
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-02-15 02:28:16 +01:00
Andrew Bartlett
34b0ee8328 messaging_dgm: avoid GCC snprintf warnings in messaging_dgm_out_create
We are trying to put something that (in theory) could be 109 bytes
long, into the sockaddr_un.sun_path field which has a fixed size of
108 bytes. The "in theory" part is that one of the components is a
pid, which although stored as 32 bits is in practice 16 bits, so the
maximum size is not actually hit.

This is all very annoying, because the length is checked anyway and
all this achieves is silencing a warning.

Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Feb 10 09:05:31 CET 2017 on sn-devel-144
2017-02-10 09:05:31 +01:00
Matthieu Patou
dd25d75b96 Move pthreadpool to top of the tree.
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-02-09 20:04:12 +01:00
Jeremy Allison
82979afc46 s3: lib: Fix two old, old bugs in set_conn_connectpath(), now in canonicalize_absolute_path().
Canonicalizing a path of /foo/bar/../baz would return /foo/barbaz
as moving forward 3 characters would delete the / character.

Canonicalizing /foo/.. would end up as '\0'.

Test to follow.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2017-01-30 18:39:18 +01:00