summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* pam_winbind: Avoid a use of sprintfVolker Lendecke2016-03-311-3/+3
| | | | | | | | pam_winbind depends on talloc, which depends on libreplace, so we have asprintf available. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbcquotas: print "NO LIMIT" only if returned quota value is 0.Uri Simchoni2016-03-311-1/+1
| | | | | | | | | | | If the user being queried has no quota, the server returns 0 as its quota. This is the observed smbd and Windows behavior, which is also documented in [MS-FSA] 2.5.1.20. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11815 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: do not cover up VFS failures to get quotaUri Simchoni2016-03-311-6/+1
| | | | | | | | | | | Now that the VFS follows the convention that get-quota returns error only on error condition, and success with zero quota if there is no quota assigned, reply with an error if failing to obtain a user's quota. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* nfs-quota: do not fail on ECONNREFUSEDUri Simchoni2016-03-311-2/+14
| | | | | | | | | | | Trying to differentiate between "no quota" and real error conditions - if the connection to rpc.quotad is refused it could simply mean that the remote host has no quota and therefore report this as success with no quota. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* xfs-quota: do not fail if user has no quotaUri Simchoni2016-03-311-2/+14
| | | | | | | | | XFS fails quotactl(Q_XGETQUOTA) with ENOENT if the user or group has no quota assigned to it. This is not an error condition - simply report 0 quota in this case. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* sys-quotas: do not fail if user has no quotaUri Simchoni2016-03-312-22/+3
| | | | | | | | If the user/group has no quota, do not treat that as error condition. Instead, return zero quota. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ntquotas - skip entry if the quota is zeroUri Simchoni2016-03-311-0/+5
| | | | | | | | | | When listing user quotas, do not list the user if the driver returned success with zero quota - this signals that no quota is assigned for that user. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* nt-quotas: return 0 as indication of no quotaUri Simchoni2016-03-311-8/+0
| | | | | | | | | | | | | | | | | | | | When getting user quota, the correct value to indicate "no quota" is 0, not -1. In [MS-FSCC] section 2.4.33 it is written that -1 designates no-quota. However, careful read of that section shows that this designation is only true when setting the quota, and this section says nothing about getting the quota. In [MS-FSA] section 2.1.5.20, it is written that "If SidList includes a SID that does not map to an existing SID in the Open.File.Volume.QuotaInformation list, the object store MUST return a FILE_QUOTA_INFORMATION structure (as specified in [MS-FSCC] section 2.4.33) that is filled with zeros. This is also verified experimentally and cleared with dochelp. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* nt-quotas: vfs_get_ntquota() return NTSTATUSUri Simchoni2016-03-314-11/+21
| | | | | Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind: Fix a typo in a wrong comment...Volker Lendecke2016-03-301-1/+1
| | | | | | | | | | | | While trying to disentangle this knot I could not stand to fix the obvious typo. The whole comment is not really the whole story anymore, but that's a commit for another day. 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 Mar 30 21:54:40 CEST 2016 on sn-devel-144
* examples/perfcounter/perf_writer.c: fix memsetAurelien Aptel2016-03-301-1/+1
| | | | | | Signed-off-by: Aurelien Aptel <aaptel@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* winbind: Remove unused idmap_backends_unixid_to_sidVolker Lendecke2016-03-303-52/+0
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Mar 30 17:58:48 CEST 2016 on sn-devel-144
* winbind: Remove unused idmap_[ug]id_to_sidVolker Lendecke2016-03-302-128/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind: Use plural xids2sids in _wbint_UnixIDs2SidsVolker Lendecke2016-03-301-18/+20
| | | | | | | | We've had plural xid2sid idmap backends for a while. Start using them. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind: Pass down the domain name to xids2sidsVolker Lendecke2016-03-302-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind: Add idmap_backend_unixids_to_sidsVolker Lendecke2016-03-302-0/+33
| | | | | | | | | This is the plural version of idmap_backends_unixid_to_sid that expects all ids to come from the same idmap domain. The singular version walks the domain list itself, this one expects the domain name to be passed to it. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind: Do per-domain xids2sids callsVolker Lendecke2016-03-301-10/+270
| | | | | | | | | | | | | | | | | | | | | | This prepares the equivalent of 2b1dd01934b657a for xids2sids. Collecting sids2xids per domain is a bit easier: SIDs carry their own domain prefix. For the reverse, we need to scan the configuration for all the idmap range definitions. It has a separate effect: It enables overlapping idmap ranges. The per-domain calls are done whenever a range matches. If the idmap child finds a successful xid2sid mapping, this will be collected as one result. This means that every range definition can contribute mappings. If there are two rfc2307 sfu domains with overlapping ranges, the domains will be queried one after the other for a specific mapping. If the defined ranges overlap, the admin has to make sure that there are no conflicts, because in the current code "the first writer wins", and the code does not specify an order (yet). Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind: Introduce id_map_ptrs_initVolker Lendecke2016-03-303-25/+41
| | | | | | | This simplifies _wbint_Sids2UnixIDs a bit and will be re-used in _wbint_UnixIDs2Sids Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* idmap: Factor out lp_scan_idmap_domains()Volker Lendecke2016-03-302-41/+87
| | | | | | | | | This simplifies idmap_found_domain_backend() by moving the regex magic somewhere else. Also, this routine will be useful soon somewhere else, thus make it non-static to idmap.c. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* VLV: avoid name conflict with string.h's index()Douglas Bagnall2016-03-301-11/+11
| | | | | | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Wed Mar 30 14:26:51 CEST 2016 on sn-devel-144
* tdb: avoid a race condition when checking for robust mutexesRalph Boehme2016-03-291-28/+32
| | | | | | | | | | | | | | | | | | | This fixes a race between calling waitpid() in two places (SIGCHLD the signal handler and the rendezvous code when waiting for the child to terminate), by - blocking SIGCHLD before installing our signal handler - in the rendezvous code call sigssuspend() which unblocks SIGCHLD and suspends the thread and waits for signal delivery BUG: https://bugzilla.samba.org/show_bug.cgi?id=11808 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Mar 29 16:04:19 CEST 2016 on sn-devel-144
* vfs_glusterfs: call clock_gettime_mono() only on profile-enabled buildUri Simchoni2016-03-291-4/+5
| | | | | | | | Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Mar 29 00:12:14 CEST 2016 on sn-devel-144
* vfs_aio_fork: call clock_gettime_mono() only on profile-enabled buildUri Simchoni2016-03-281-2/+3
| | | | | Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_aio_linux: call clock_gettime_mono() only on profile-enabled buildUri Simchoni2016-03-281-4/+5
| | | | | Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* asys: call clock_gettime_mono() only on profile-enabled buildUri Simchoni2016-03-281-6/+7
| | | | | Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-profile: add PROFILE_TIMESTAMP macroUri Simchoni2016-03-281-0/+4
| | | | | | | | | | | This is a get-timestamp macro which works only when profiling is enabled in the build. The underlying clock_gettime_mono() function can be costly on some architectures and we want to avoid it if it's not necessary. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-profile: reduce dependencies of smbprofile.hUri Simchoni2016-03-284-9/+12
| | | | | Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/util: fix function commentUri Simchoni2016-03-281-1/+1
| | | | | Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: vfs: Use the new VFS functions for setting and getting DOS attributes.Jeremy Allison2016-03-271-46/+65
| | | | | | | | | | | This will make it easier to support those systems and file systems that can store DOS attributes. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <rsharpe@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sun Mar 27 09:23:42 CEST 2016 on sn-devel-144
* s3: vfs: Add VFS functions for setting and getting DOS attributes.Richard Sharpe2016-03-278-0/+288
| | | | | | | | | This will make it easier to support those systems and file systems that can store DOS attributes. It should retain the original functionality if VFS functions providing these things are not provided. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: smbd: DFS: Pass uint32_t ucf_flags through into unix_convert().Jeremy Allison2016-03-261-3/+6
| | | | | | | | | | | | This allows vendors to ensure that flags such as UCF_PREP_CREATEFILE are always passed to their VFS modules whilst smbd is doing pathname lookup - even before the create VFS call is done. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Mar 26 00:08:40 CET 2016 on sn-devel-144
* s3: smbd: DFS: Pass uint32_t ucf_flags through into dfs_redirect().Jeremy Allison2016-03-251-4/+4
| | | | | | | | Eventually move this down to the call to unix_convert() inside the DFS code. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s3: smbd: DFS: Pass uint32_t ucf_flags through into resolve_dfspath_wcard().Jeremy Allison2016-03-254-5/+6
| | | | | | | | Eventually move this down to the call to unix_convert() inside the DFS code. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* pam_winbind: Create and use a wbclient contextAndreas Schneider2016-03-252-8/+29
| | | | | | | | | | | | | | | | PAM sessions are long running. If we create a pam session a connection to winbind is established and only closed by the destructor of the libwbclient library. If we create a wbcContext, we will free it in the end of the PAM function being called and the socket will be closed. This decreases the amount of allocated 'winbindd_cli_state' structures in winbind for every logged in user. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Mar 25 17:45:24 CET 2016 on sn-devel-144
* pam_winbind: Use the correct type to check the pam_parse() return codeAndreas Schneider2016-03-251-2/+4
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3: smbd: DFS - Remove the last lp_posix_pathnames() from the SMB2/3 code paths.Jeremy Allison2016-03-251-2/+14
| | | | | | | | | | | | | | | | lp_posix_pathnames() is only used in one place in SMB1 DFS processing - in dealing with buggy clients, and not at all in SMB2/3. Note that the removal of lp_posix_pathnames() in the initial detection of path separator is a change in behavior - but the case where an incoming DFS name *doesn't* begin with the correct separator is a client bug, so I'm comfortable with making this change. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Autobuild-User(master): Uri Simchoni <uri@samba.org> Autobuild-Date(master): Fri Mar 25 13:23:48 CET 2016 on sn-devel-144
* ctdb-recovery-helper: Add banning to parallel recoveryAmitay Isaacs2016-03-251-8/+87
| | | | | | | | | | | | | | If one or more nodes are misbehaving during recovery, keep track of failures as ban_credits. If the node with the highest ban_credits exceeds 5 ban credits, then tell recovery daemon to assign banning credits. This will ban only a single node at a time in case of recovery failure. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Mar 25 06:57:32 CET 2016 on sn-devel-144
* ctdb-recoverd: Add message handler to assigning banning creditsAmitay Isaacs2016-03-251-0/+28
| | | | | | | | This will be called from recovery helper to assign banning credits to misbehaving node. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Add srvid for assigning banning creditsAmitay Isaacs2016-03-253-1/+18
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-recovery-helper: Introduce new #define variableAmitay Isaacs2016-03-251-1/+3
| | | | | | | ... instead of hardcoding number of retries. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-recovery-helper: Improve log messageAmitay Isaacs2016-03-251-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Add a test for recovery of large databasesAmitay Isaacs2016-03-251-0/+107
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-recovery-helper: Introduce push database abstractionAmitay Isaacs2016-03-251-32/+524
| | | | | | | | | This abstraction uses capabilities of the remote nodes to either send older PUSH_DB controls or newer DB_PUSH_START and DB_PUSH_CONFIRM controls. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-recovery-helper: Introduce pull database abstractionAmitay Isaacs2016-03-251-67/+282
| | | | | | | | This abstraction depending on the capability of the remote node either uses older PULL_DB control or newer DB_PULL control. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Add new capabilityAmitay Isaacs2016-03-251-1/+3
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Add srvid for messages during recoveryAmitay Isaacs2016-03-252-0/+6
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Introduce variable for checking srvid prefixAmitay Isaacs2016-03-251-6/+8
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-recovery-helper: Write recovery records to a recovery fileAmitay Isaacs2016-03-251-0/+89
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-recovery-helper: Re-factor function to retain records from recdbAmitay Isaacs2016-03-251-20/+36
| | | | | | | | Also, rename traverse function and traverse state for recdb_records consistently. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-protocol: Add file IO functions for ctdb_rec_bufferAmitay Isaacs2016-03-253-0/+115
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>