summaryrefslogtreecommitdiff
path: root/source3/lib
Commit message (Collapse)AuthorAgeFilesLines
* g_lock: Make it endian-neutralVolker Lendecke2017-06-151-13/+85
| | | | | | | Add explicit parsing Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* g_lock: More correct error msgVolker Lendecke2017-06-151-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* g_lock: Fix two typosVolker Lendecke2017-06-151-3/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ctdbd_conn: Fix ctdbd_connection_destructorVolker Lendecke2017-06-101-5/+4
| | | | | | | | | | | | | | | | | | | 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
* ctdbd_conn: Fix a copy&paste errorVolker Lendecke2017-06-091-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* messaging: fix net command failure due to unhandled return codeDavid Mulder via samba-technical2017-06-081-3/+3
| | | | | | | | | | | | | | | 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
* s3: VFS: Change SMB_VFS_SYS_ACL_SET_FILE to use const struct smb_filename * ↵Jeremy Allison2017-05-311-11/+23
| | | | | | | | | | 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>
* s3: VFS: Change SMB_VFS_SYS_ACL_GET_FILE to use const struct smb_filename * ↵Jeremy Allison2017-05-311-16/+23
| | | | | | | | | | | | 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>
* s3: VFS: Change SMB_VFS_SYS_ACL_DELETE_DEF_FILE to use const struct ↵Jeremy Allison2017-05-311-11/+11
| | | | | | | | | | 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>
* s3: lib: Add new utility function cp_smb_filename_nostream().Jeremy Allison2017-05-311-0/+16
| | | | | | | | | | 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>
* lib: Remove use of MSG_NOSIGNALVolker Lendecke2017-05-301-1/+1
| | | | | | | | | | | | | | | | 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
* s3-lib/idmap_cache: remove some dead prototypesGünther Deschner2017-05-101-1/+0
| | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-lib: remove some dead prototypesGünther Deschner2017-05-101-6/+0
| | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* dbwrap_ctdb: Fix a typoVolker Lendecke2017-05-101-1/+1
| | | | | | | | 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
* s3: popt: Change to NULL from talloc_autofree_context() now we correctly ↵Jeremy Allison2017-05-091-1/+1
| | | | | | | | | | 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
* s3: client tools. Remove direct access to struct user_auth_info ↵Jeremy Allison2017-05-091-1/+1
| | | | | | | | | | *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>
* s3: popt: Add utility functions popt_get_cmdline_auth_info(), ↵Jeremy Allison2017-05-091-0/+10
| | | | | | | | | | 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>
* s3: popt: When using a global variable, don't hide it by helper locals.Jeremy Allison2017-05-091-18/+16
| | | | | | | 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>
* s3/dbwrap_ctdb: free resources in an error code pathRalph Boehme2017-05-071-0/+1
| | | | | | | | 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
* s3/dbwrap_ctdb: set async_ctx to initializedRalph Boehme2017-05-071-0/+1
| | | | | | | | 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>
* lib: Fix a commentVolker Lendecke2017-05-031-2/+2
| | | | | | | | 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
* lib: Fix whitespaceVolker Lendecke2017-05-031-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap_watch: Protect against corrupt recordsVolker Lendecke2017-05-011-1/+4
| | | | | | | | | | | | | | | | 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 66cba9939b76f this led to "lck->data" to be uninitialized data, so smbd 4.4 would crash in this case. After 66cba9939b76f 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>
* lib: Fix CID 1405493 Error handling issues (CHECKED_RETURN)Volker Lendecke2017-04-251-1/+6
| | | | | | | | 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
* cleanupdb: Fix a memory read errorHanno Böck2017-04-201-1/+1
| | | | | | | | | 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>
* smbldap: Bump version numberVolker Lendecke2017-04-201-0/+31
| | | | | | | | | 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
* smbldap: Privatize struct smbldap_stateVolker Lendecke2017-04-201-0/+26
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* smbldap: Introduce "smbldap_get_paged_results"Volker Lendecke2017-04-201-0/+6
| | | | | | | | | 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>
* smbldap: Introduce "smbldap_get_paged_results"Volker Lendecke2017-04-201-0/+4
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* smbldap: Introduce "smbldap_get_ldap"Volker Lendecke2017-04-201-25/+39
| | | | | | | | | | 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>
* dbwrap_watch: add parse_record_send/recv wrappersRalph Boehme2017-04-181-0/+84
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap_ctdb: implement parse_record_send()/recv()Ralph Boehme2017-04-184-0/+179
| | | | | | | | | | | 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>
* dbwrap_ctdb: factor out a db_ctdb_try_parse_local_record() functionRalph Boehme2017-04-181-22/+36
| | | | | | | | 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>
* ctdb_conn: add ctdbd_parse_send/recvRalph Boehme2017-04-181-4/+840
| | | | | | | | | | | | | 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>
* s3:lib: Fix incorrect logic in sys_broken_getgroups()Jeremy Allison2017-04-181-5/+7
| | | | | | | | | 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>
* s3:lib:charcnv: Remove use of global global_iconv_handleJeremy Allison2017-04-181-1/+1
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* lib: Remove unused winbind_get_groups and _get_sid_aliasesVolker Lendecke2017-03-282-93/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tldap: Allow dropping messages in tldap_search()Volker Lendecke2017-03-181-2/+4
| | | | | | | | | 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>
* Changes to make the Solaris C compiler happy.Jeremy Allison2017-03-161-1/+1
| | | | | | | | | | 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>
* lib: Make gencache hash size configurable, default to 10000Volker Lendecke2017-03-031-4/+7
| | | | | | | | 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>
* s3:lib: Do not segfault if username is NULLAndreas Schneider2017-02-231-1/+4
| | | | | | | | | 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>
* Correct "successfuly" typos.Chris Lamb2017-02-221-2/+2
| | | | | | 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>
* Correct "occured" typos.Chris Lamb2017-02-221-2/+2
| | | | | | 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>
* Correct "doesnt" typos.Chris Lamb2017-02-221-1/+1
| | | | | | 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>
* lib: Avoid an "includes.h"Volker Lendecke2017-02-151-1/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Fix some whitespaceVolker Lendecke2017-02-151-21/+21
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging_dgm: avoid GCC snprintf warnings in messaging_dgm_out_createAndrew Bartlett2017-02-101-1/+4
| | | | | | | | | | | | | | | | | 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
* Move pthreadpool to top of the tree.Matthieu Patou2017-02-0911-1565/+1
| | | | | Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: lib: Fix two old, old bugs in set_conn_connectpath(), now in ↵Jeremy Allison2017-01-301-6/+12
| | | | | | | | | | | | | | | | 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>
* s3: lib: Add canonicalize_absolute_path().Jeremy Allison2017-01-302-0/+134
| | | | | | | | | | | | Resolves any invalid path components (.) (..) in an absolute POSIX path. We will be re-using this in several places. 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>