summaryrefslogtreecommitdiff
path: root/source3
Commit message (Collapse)AuthorAgeFilesLines
* s3: Remove unsused MMAP_BLACKLIST ifdef checksAndreas Schneider2018-11-282-11/+0
| | | | | | | This doesn't get defined by anything. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* lib: Align integer typesVolker Lendecke2018-11-281-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* krb5_wrap: Add a talloc_ctx to smb_krb5_principal_get_realm()Volker Lendecke2018-11-281-3/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* notifyd: Improve a debug messageVolker Lendecke2018-11-271-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): Tue Nov 27 21:42:24 CET 2018 on sn-devel-144
* winbind: Use dom_sid_str_bufVolker Lendecke2018-11-271-10/+6
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Nov 27 10:38:11 CET 2018 on sn-devel-144
* idmap_cache: Use dom_sid_str_bufVolker Lendecke2018-11-271-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind: Fix "wbint_Principals" definitionVolker Lendecke2018-11-272-2/+2
| | | | | | | A signed integer does not make any sense for an IDL array length Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind: Use dom_sid_str_bufVolker Lendecke2018-11-271-3/+7
| | | | | | | Also fix a DBG format string specifier Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind: Use dom_sid_str_bufVolker Lendecke2018-11-271-1/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind: Use dom_sid_str_bufVolker Lendecke2018-11-271-7/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libads: Give krb5_errs.c its own headerVolker Lendecke2018-11-2711-0/+41
| | | | | | | | The protos were declared in lib/krb5_wrap but the functions are not available there. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_shadow_copy2: in fstat also convert fsp->fsp_name and ↵Ralph Boehme2018-11-271-8/+50
| | | | | | | | | | | | fsp->base_fsp->fsp_name Stacked VFS modules might use the file name, not the file handle. Looking at you, vfs_fruit... Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: pass down twrp from SMB2_CREATE to filename_convert()Ralph Boehme2018-11-271-24/+5
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: add twrp args to filename_convert()Ralph Boehme2018-11-279-2/+36
| | | | | | | | | All existing callers pass NULL, no change in behaviour. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: add twrp processing to filename_convert_internal()Ralph Boehme2018-11-271-0/+26
| | | | | | | | | Not used for now, existing callers pass NULL. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: prepare filename_convert_internal() for twrpRalph Boehme2018-11-271-1/+4
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:selftest: add a VSS test reading a streamRalph Boehme2018-11-271-0/+38
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_shadow_copy2: nicely deal with attempts to open previous version for writingRalph Boehme2018-11-271-2/+122
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_shadow_copy2: add shadow_copy2_strip_snapshot_convertedRalph Boehme2018-11-271-0/+16
| | | | | | | | | | Can be used by callers to determine if a path is in fact pointing at a file in a snapshot. Will be used in the next commit. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_shadow_copy2: add _already_converted arg to ↵Ralph Boehme2018-11-271-8/+24
| | | | | | | | | | | shadow_copy2_strip_snapshot_internal() Not used for now, all existing callers pass NULL. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:script/tests: add a test for VSS write behaviourRalph Boehme2018-11-272-1/+78
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_error_inject: add EBADF errorRalph Boehme2018-11-271-0/+1
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_error_inject: add pwriteRalph Boehme2018-11-271-0/+18
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libads: Align integer typesVolker Lendecke2018-11-231-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Nov 23 20:23:57 CET 2018 on sn-devel-144
* libads: Use dom_sid_string_bufVolker Lendecke2018-11-231-2/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* source4 smbd prefork: Add backoff to process restartGary Lockyer2018-11-231-0/+2
| | | | | | | | | Add new smbd.conf variables 'prefork backoff increment' and 'prefork maximum backoff' to control the rate at which failed pre-forked processes are restarted. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:lib: Fix undefined behavior in messages_dgmAndreas Schneider2018-11-221-3/+7
| | | | | | | | source3/lib/messages_dgm.c:1290:7: runtime error: variable length array bound evaluates to non-positive value 0 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* s3:lib: Do not redefine bool and use stdbool.hAndreas Schneider2018-11-221-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* s3:tests: Initialize pointers with NULL in netdisplay testAndreas Schneider2018-11-222-5/+5
| | | | | | | Found by Undefined Sanitizer Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* utils: Free host realm after processingSwen Schillig2018-11-221-4/+5
| | | | | | | | | | | | In case of error and at the end of processing the list of realms have to be free'd again. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Thu Nov 22 11:18:41 CET 2018 on sn-devel-144
* utils: Free krb5 context for net_lookup_kdcSwen Schillig2018-11-221-0/+3
| | | | | | | | | In case of an error while processing and at the end of processing the krb5 conext must be free'd. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* librpc: Free krb5 context on errorSwen Schillig2018-11-221-0/+4
| | | | | | | | | If the call to krb5_cc_resolve() fails and processing is aborted, the krb5 conext must be free'd before return. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: Free principal if smb_krb5_principal_get_realm() failsSwen Schillig2018-11-221-0/+1
| | | | | | | | | | If smb_krb5_principal_get_realm() fails, procesing is aborted and resources have to be free'd. In this context free'ing the principal was missing. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbspool: Free kerberos context on errorSwen Schillig2018-11-221-0/+1
| | | | | | | | | If processing cannot continue and the function returns the kerberos context must be free'd. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* libads: set proper ads_keytab_flush() return code on errorSwen Schillig2018-11-221-0/+2
| | | | | | | | | | The return code was left on success when the calls to ads_get_machine_kvno() or ads_clear_service_principal_names() failed and the processing had to be aborted. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* libsmb: Make cli_notify_send cancellableVolker Lendecke2018-11-211-8/+32
| | | | | | | | 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 Nov 21 20:50:13 CET 2018 on sn-devel-144
* libsmb: Make cli_notify_send/recv smb2-awareVolker Lendecke2018-11-211-6/+37
| | | | | | | smb2-awareness only existed in the sync wrapper Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Introduce cli_smb2_notify_send/recvVolker Lendecke2018-11-212-52/+167
| | | | | | | | This only existed as a sync wrapper where the underlying function could do send/recv already. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Make cli_trans_send cancellableVolker Lendecke2018-11-211-15/+28
| | | | | | | Required to cancel SMB1 notify Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Make cli_trans a normal subreq functionVolker Lendecke2018-11-211-95/+113
| | | | | | | | | A lot of "state" variables, but still I don't think the additional complexity is justified by saving a few lines. Make this a completely regular tevent_req "req/subreq" function. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Fix CID 1441264 Error handling issues (CHECKED_RETURN)Volker Lendecke2018-11-161-4/+10
| | | | | | | This is not worth keeping a CID around :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: VFS: fake_acls: Fix Coverity CID 1435850 Uninitialized pointer read.Jeremy Allison2018-11-151-5/+20
| | | | | | | map_acl_perms_to_permset() can return an error, check it. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: VFS: Remove logically dead code. Coverity CID: 1419117Jeremy Allison2018-11-141-5/+1
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Nov 14 21:35:45 CET 2018 on sn-devel-144
* s3:passdb: Use discard_const_p() in py_passdbAndreas Schneider2018-11-141-2/+2
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Nov 14 11:46:06 CET 2018 on sn-devel-144
* s3/torture: PY3 port samba.ntlm_authNoel Power2018-11-141-30/+29
| | | | | | | Use bytes in test rather than str Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpcclient: Initialize domain_nameAndreas Schneider2018-11-141-1/+1
| | | | | | | | | | | This could be passed uninitialized to dcerpc_netr_DsRGetDCName() Found by cppcheck. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13680 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3: lib: nmbname: Ensure we limit the NetBIOS name correctly. CID: 1433607Jeremy Allison2018-11-131-13/+21
| | | | | | | | | | | | | | | | Firstly, make the exit condition from the loop explicit (we must never write into byte n, where n >= sizeof(name->name). Secondly ensure exiting from the loop that n==MAX_NETBIOSNAME_LEN, as this is the sign of a correct NetBIOS name encoding (RFC1002) in order to properly read the NetBIOS name type (which is always encoded in byte 16 == name->name[15]). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Tue Nov 13 20:54:56 CET 2018 on sn-devel-144
* s3:smb2_sesssetup: check session_info security level before it gets ↵Ralph Boehme2018-11-131-4/+4
| | | | | | | | | | | | | | | | | | | talloc_move'd We talloc_move() session_info to session->global->auth_session_info which sets session_info to NULL. This means security_session_user_level(NULL, NULL) will always return SECURITY_ANONYMOUS so we never sign the session setup response. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13661 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Nov 13 14:22:46 CET 2018 on sn-devel-144
* s3:selftest: also run smb2.session torture testsuite against ad_memberRalph Boehme2018-11-131-0/+1
| | | | | | | | | | | | | | The next commit adds a subtest to the smb2.session testsuite that requires Kerberos (ad_dc would work), but where neither SMB2 server or client must require signing (ad_dc, being an AD DC, requires signing). The ad_member environment supports Kerberos with the SMB2 server not mandating signing, that'll do. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13661 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:selftest: split "raw.session" and "smb2.session"Ralph Boehme2018-11-131-1/+6
| | | | | | | | | The next commit is going to add a testsuite to "smb2.session". Bug: https://bugzilla.samba.org/show_bug.cgi?id=13661 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>