summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* smbd: Restructure brl_conflict_otherVolker Lendecke2014-07-221-14/+39
| | | | | | | | It took me really long to grasp what's going on in this routine. I hope its logic is easier to understand now Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Fix indentation, {} and line length in brl_conflict_otherVolker Lendecke2014-07-221-6/+14
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Rename lck2->rw_probe in brl_conflict_otherVolker Lendecke2014-07-221-8/+8
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Rename lck1->lock in brl_conflict_otherVolker Lendecke2014-07-221-8/+8
| | | | | | | | lck1 and lck2 are treated differently. They should carry more descriptive names. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Use a struct initializer brl_lockVolker Lendecke2014-07-221-13/+10
| | | | | | | Avoids a #ifdef DEVELOPER and saves a few bytes .text Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Simplify strict_lock_default with early returnsVolker Lendecke2014-07-221-34/+24
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Use %ju/uintmax_t in source3/lockingVolker Lendecke2014-07-223-79/+120
| | | | | | | Avoid going through (double) and %.0f Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: "err" is no longer set in get_lock_offsetVolker Lendecke2014-07-223-29/+6
| | | | | | | This was only referenced in the !HAVE_LONGLONG section Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Add commentsVolker Lendecke2014-07-221-0/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd/nmbd: Remove HAVE_LONGLONGVolker Lendecke2014-07-225-109/+0
| | | | | | | We always have 64-bit variables available by now Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Simplify unpack_nt_ownersVolker Lendecke2014-07-221-11/+3
| | | | | | | The separate variables are not really required Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib: Fix a valgrind errorVolker Lendecke2014-07-221-1/+12
| | | | | | | See the comment inside Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* messaging4: Fix a just-introduced error memleakVolker Lendecke2014-07-221-0/+5
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Jul 22 15:31:38 CEST 2014 on sn-devel-104
* ctdb: Fix verbose_memory_namesVolker Lendecke2014-07-221-1/+1
| | | | | | | | | | | | If we have already partly written a packet, "data" and thus "pkt->data" does not point to the start of the packet anymore. Assign "hdr" while it still points at the start of the header. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Tue Jul 22 06:09:50 CEST 2014 on sn-devel-104
* ctdb: Avoid a talloc in ctdb_queue_sendVolker Lendecke2014-07-221-3/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* sys_poll_intr: fix timeout arithmeticDaniel Kobras2014-07-221-2/+12
| | | | | | | | | | | | | | Callers of sys_poll_intr() assume timeout to be in milliseconds like poll(2) expects, but implementation used nanosecond units. Also make sure timeout doesn't become infinite by mistake during time arithmetic. Signed-off-by: Daniel Kobras <d.kobras@science-computing.de> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jul 22 00:12:24 CEST 2014 on sn-devel-104
* messaging4: Change irpc_servers_by_name to NTSTATUSVolker Lendecke2014-07-214-35/+43
| | | | | | | | | | | | For me, counted arrays are easier to deal with than NULL-terminated ones. Here we also had a "server_id_is_disconnection" convention, which was not really obvious. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Jul 21 20:28:53 CEST 2014 on sn-devel-104
* messaging4: Fix a memleak in an error pathVolker Lendecke2014-07-211-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* messaging4: Remove unnecessary lockingVolker Lendecke2014-07-211-6/+0
| | | | | | | | We don't do any modifying operations on the database, so locking is not needed here Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* messaging4: Remove an unused NTSTATUS varVolker Lendecke2014-07-211-2/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* messaging4: Move str_list_addVolker Lendecke2014-07-211-6/+7
| | | | | | | | If this fails, we'd have to revert the tdb_append. str_list_remove is simpler :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* messaging4: Add NULL check to irpc_add_nameVolker Lendecke2014-07-211-0/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* messaging4: Use tdb_append in irpc_add_nameVolker Lendecke2014-07-211-19/+11
| | | | | | | This makes the custom locking code unnecessary here Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ctdb-recoverd: Gently abort recovery when election is underwayMartin Schwenke2014-07-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes the recovery daemon fails to get the recovery lock on one node so that node is banned. This seems to always happen during an election. The recovery is triggered because other nodes are found to have recovery mode enabled. They have recovery mode enabled because an election has been forced. The recovery daemon's main_loop() only does an initial check for an election. After that, a node can force an election and, in the process, set itself to be the current winner. In this situation, verify_recmode() will always return MONITOR_RECOVERY_NEEDED so do_recovery() is called. If the previous recovery master hasn't admitted defeat and released the recovery lock, then do_recovery() will rightly fail. However, it would be better if it failed a little more gracefully, since this case is not that unusual. Instead of trying to take the recovery lock, return early with an error if there is an election in progress. Note that the race is still there but it is now much narrower. There are probably more subtle ways of avoiding this issue, including something like this in main_loop(): - if (pnn != rec->recmaster) { + if (pnn != rec->recmaster || rec->election_timeout) { return; } However, this check is done earlier so it leaves the race window open a little wider. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Mon Jul 21 06:57:07 CEST 2014 on sn-devel-104
* s4:torture/rpc: add rpc.netlogon.ServerReqChallengeGlobalStefan Metzmacher2014-07-191-0/+73
| | | | | | | | | | | | This demonstrates that the challenge table should be global. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10723 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sat Jul 19 12:51:39 CEST 2014 on sn-devel-104
* s4:rpc_server/netlogon: keep a global challenge tableStefan Metzmacher2014-07-191-4/+87
| | | | | | | | | | | | | | | | | Some clients call netr_ServerReqChallenge() and netr_ServerAuthenticate3() on different connections. This works against Windows DCs as they have a global challenge table. A VMware provisioning task for Windows VMs seemy to rely on this behavior. As a fallback we're storing the challenge in a global memcache with a fixed size. This should allow these strange clients to work against a Samba AD DC. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10723 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/util: move memcache.[ch] to the toplevel 'samba-util' libraryStefan Metzmacher2014-07-1819-17/+17
| | | | | | | | | | 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
* s3:lib/memcache: only include the required header filesStefan Metzmacher2014-07-182-3/+6
| | | | | | | We don't need the full "includes.h". Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:lib/memcache: make use of talloc for memcache_elementsStefan Metzmacher2014-07-181-6/+5
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:lib/memcache: use uint8_t instead of uint8Stefan Metzmacher2014-07-181-2/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* ldb-samba: fix a memory leak in ldif_canonicalise_objectCategory()Stefan Metzmacher2014-07-171-1/+6
| | | | | | | | | | | | | Searches for '(objectCategory=Person)' will leak a ldb_dn structure on the ldb_context. These searches are typically used by Zarafa. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10469 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): Thu Jul 17 00:51:57 CEST 2014 on sn-devel-104
* lib/zlib: Remove undeeded files that trigger GPL issues.Ira Cooper2014-07-164-0/+0
| | | | | | | | | | | These files have been removed in upstream versions of zlib due to the fact that binaries tend to become GPL violations. Signed-off-by: Ira Cooper <ira@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Ira Cooper <ira@samba.org> Autobuild-Date(master): Wed Jul 16 19:14:56 CEST 2014 on sn-devel-104
* samlogon_cache: avoid overwriting info3->base.full_name.string.Andreas Schneider2014-07-151-0/+14
| | | | | | | | | | | | | | This field servers as a source for the gecos field. We should not overwrite it when a info3 struct from a samlogon network level gets saved in which case this field is always NULL. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10440 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Tue Jul 15 18:25:28 CEST 2014 on sn-devel-104
* samlogon_cache: use a talloc_stackframe inside netsamlogon_cache_store.Günther Deschner2014-07-151-9/+4
| | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-winbindd: prefer "displayName" over "name" in ads user queries for the ↵Günther Deschner2014-07-151-5/+11
| | | | | | | | | | | | | fullname. This makes use more consistent with security=domain as well where the gecos field is also filled using the displayName field. Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Pair-Programmed-With: Andreas Schneider <asn@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-winbind: Don't set the gecos field to NULL.Andreas Schneider2014-07-151-1/+0
| | | | | | | | | | The value is loaded from the cache anyway. So it will be set to NULL if it is not available. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10440 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3-winbindd: use wcache_query_user_fullname after inspecting samlogon cache.Günther Deschner2014-07-153-0/+57
| | | | | | | | | | | | | | | | | | | | The reason for this followup query is that very often the samlogon cache only contains a info3 netlogon user structure that has been retrieved during a netlogon samlogon authentication using "network" logon level. With that logon level only a few info3 fields are filled in; the user's fullname is never filled in that case. This is problematic when the cache is used to fill in the user's gecos field (for NSS queries). When we have retrieved the user's fullname during other queries, reuse it from the other caches. Thanks to Matt Rogers <mrogers@redhat.com>. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10440 Guenther Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-winbindd: add wcache_query_user_fullname().Günther Deschner2014-07-152-0/+38
| | | | | | | | | | | | | | | This helper function is used to query the full name of a cached user object (for further gecos processing). Thanks to Matt Rogers <mrogers@redhat.com>. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10440 Guenther Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-winbindd: call interactive samlogon via rpccli_netlogon_password_logon.Günther Deschner2014-07-151-13/+32
| | | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Pair-Programmed-With: Andreas Schneider <asn@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-rpc_client: return info3 in rpccli_netlogon_password_logon().Günther Deschner2014-07-153-48/+64
| | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Pair-Programmed-With: Andreas Schneider <asn@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* ntlm_auth: added require-membership testsGarming Sam2014-07-152-0/+76
| | | | | | | | | | | | (updated by abartlet to fix knownfail changes due to AD DC winbindd use in master) Change-Id: Iec41fbfc0f501888fd16323bf78da61aa549b4de Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Autobuild-User(master): Kamen Mazdrashki <kamenim@samba.org> Autobuild-Date(master): Tue Jul 15 15:59:49 CEST 2014 on sn-devel-104
* torture: test_ntlm_auth.py now has a require-membership-of argumentGarming Sam2014-07-151-0/+7
| | | | | | | Change-Id: I90c2172af792a082fbf49ee0ab7d6eedf5471440 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
* As David Woodhouse points out, this breaks backwards compatibility.Jeremy Allison2014-07-141-2/+0
| | | | | | | | | | | https://bugzilla.samba.org/show_bug.cgi?id=10692 Revert "libwbclient: reject unknown named blobs in wbcCredentialCache()" This reverts commit 740d12d1e77d356ff22c3725dce8d5019c86a7a5. Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Jul 14 21:54:08 CEST 2014 on sn-devel-104
* ctdb-ltdb: Use tdb_null instead of zeroing TDB_DATA variableAmitay Isaacs2014-07-141-4/+2
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Jul 14 16:01:31 CEST 2014 on sn-devel-104
* s3:smbd: initialize stat_ex buffer in smbd_dirptr_get_entry()Michael Adam2014-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This prevents random garbage in the vfs_private member. Usually it should not be a problem to leave initialization of the vfs_private to the vfs module who wants to use it, but further down in the directory listing code, in vfswrap_readdir, there is in optimization introduced with 2a65e8befef004fd18d17853a1b72155752346c8, to call fstatat if possible to already fill stat info in the readdir call. The problem is that this calls fstatat directly, not going through VFS, but still making the stat buffer valid, leaving vfs_private with random garbage. Hence a vfs module using vfs_private, like vfs_gpfs does for offline info (and winAttrs in general) does not have a chance to tell whether the vfs_private is valid if the stat buffer is marked valid. This is a reason for the "flapping offline flag" problem of the vfs_gpfs module. Initializing the vfs_private to 0 here will for the vfs_gpfs module result in files being marked online always in a directory listing. So this is not a real fix but it does at least make the problem less random. A real general fix might be to implement SMB_VFS_FSTATAT() and use it here. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Sun Jul 13 11:26:58 CEST 2014 on sn-devel-104
* s3:vfs:gpfs: log when winAttr-garbage is detected (by heuristics) in is_offlineMichael Adam2014-07-131-0/+5
| | | | | | | | | | In is_offline(), check whether the winAttrs are filled with bits outside 0xFFFF and log it prominently: Since GPFS only fills 0xFFFF, this could be due to an uninitialized buffer (or another vfs module filling vfs_private? ...). Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3:vfs:gpfs: fix flapping offline: always get winAttrs from gpfs for is_offlineMichael Adam2014-07-131-3/+1
| | | | | | | | | | | | | | | | | | There is a problem of flapping offline due to uninitialized stat buffers. Due to a optimization in vfswrap_readdir which directly calling fastatat (i.e. not through vfs), marking the stat buffer valid, there is nothing this module can do about it and hence can not currently not rely on the vaildity of the stat buffer. By always calling out to GPFS even when the stat buffer is flagged valid, we can always return correct offline information, thereby sacrificing the readdir optimization. Pair-Programmed-With: Volker Lendecke <vl@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3:vfs:gpfs: store the winAttrs in the struct_ex when we got them in ↵Michael Adam2014-07-131-0/+1
| | | | | | | | | vfs_gpfs_fstat() This may (e.g.) have lead to some occurrences of flapping offline bits. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3:smb2_read: let smb2_sendfile_send_data() behave like send_file_readX()Stefan Metzmacher2014-07-111-16/+53
| | | | | | | | | | | | | We now pass the header to SMB_VFS_SENDFILE(), so we have to handle that also in the fallback code. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10706 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): Fri Jul 11 22:57:17 CEST 2014 on sn-devel-104
* s3:winbindd: remove unused get[pw|gr]ent_initialized from winbindd_cli_stateStefan Metzmacher2014-07-111-4/+0
| | | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Jul 11 18:46:09 CEST 2014 on sn-devel-104