summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* tdb/tools: add documentation for the tdbbackup -n optionBjörn Baumbach2017-03-281-0/+8
| | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Jeremy Allison <jra@samba.org
* lib: Avoid an includes.hVolker Lendecke2017-03-281-1/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Avoid an includes.hVolker Lendecke2017-03-281-3/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Avoid an includes.hVolker Lendecke2017-03-281-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Avoid an includes.hVolker Lendecke2017-03-281-1/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Avoid an includes.hVolker Lendecke2017-03-281-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Avoid an includes.hVolker Lendecke2017-03-281-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* server_id_db: Protect against non-0-terminated data recordsVolker Lendecke2017-03-281-1/+21
| | | | | | | | | | Remove the failing test from knownfail. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12705
* torture: add torture_assert_mem_not_equal_goto()Uri Simchoni2017-03-261-0/+10
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12715 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Change "strict sync" paramter from "no" to "yes" for 4.7.0.Jeremy Allison2017-03-251-0/+2
| | | | | | | | Document change and modify in loadparm.c. Safer default for new installs and vendors. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* lib: Simplify smb_nanosleepVolker Lendecke2017-03-201-42/+2
| | | | | | | | | | We have the recalculation logic also in sys_poll_intr, don't duplicate it. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Mar 20 16:11:16 CET 2017 on sn-devel-144
* lib: Make sys_poll_intr available to ctdbVolker Lendecke2017-03-201-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* lib: Avoid an includes.hVolker Lendecke2017-03-201-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* lib/util: Fix initializerAmitay Isaacs2017-03-161-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* replace: Fix compiler warning flagAmitay Isaacs2017-03-161-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/crypto: implement samba.crypto Python module for RC4Alexander Bokovoy2017-03-152-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | Implement a small Python module that exposes arcfour_crypt_blob() function widely used in Samba C code. When Samba Python bindings are used to call LSA CreateTrustedDomainEx2, there is a need to encrypt trusted credentials with RC4 cipher. Current Samba Python code relies on Python runtime to provide RC4 cipher. However, in FIPS 140-2 mode system crypto libraries do not provide access RC4 cipher at all. According to Microsoft dochelp team, Windows is treating AuthenticationInformation blob encryption as 'plain text' in terms of FIPS 140-2, thus doing application-level encryption. Replace samba.arcfour_encrypt() implementation with a call to samba.crypto.arcfour_crypt_blob(). Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Wed Mar 15 01:30:24 CET 2017 on sn-devel-144
* krb5_wrap: Fix smb_gss_krb5_import_cred() picky-developer buildAndreas Schneider2017-03-141-1/+3
| | | | | | | This does not build on Fedora 25 with picky-developer turned on. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* param: Allow to specify kerberos method on the commandlineAndreas Schneider2017-03-141-0/+4
| | | | | | | | We support --option for our tools but you cannot set an option where the value of the option includes a space. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* krb5_wrap: Print a warning for an invalid keytab nameAndreas Schneider2017-03-141-0/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* ldb_tdb: Add better comments for duplicate attr valuesGarming Sam2017-03-131-3/+3
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>
* ldb_tdb: Do not check for duplicate values during a renameGarming Sam2017-03-131-7/+11
| | | | | | | | | | | | This is not the time to be pretending to be dbcheck, and there are exceptions to the single-value rules in Samba. This is needed for the same reasons as the modify case. (Note: this error was triggered with the demote of an RODC with links) Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>
* ldb_tdb: Do not care about duplicates if single value check disabledGarming Sam2017-03-131-22/+24
| | | | | | | | | | | | | | This behaviour of ignoring duplicates with the flag LDB_FLAG_INTERNAL_DISABLE_SINGLE_VALUE_CHECK is also used in the replace case here. When we add a forward DN+Binary link with a duplicate DN, this prevents us from not being able to add the backlink because it appears to be a duplicate here. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Pair-programmed-with: Bob Campbell <bobcampbell@catalyst.net.nz>
* lib/pthreadpool: fix a memory leakRalph Boehme2017-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When copying large files from the server to the client with aio enabled we noticed that smbd kept growing RSS and VSZ. valgrind was reporting: ==2503== 4,093,440 bytes in 6,560 blocks are possibly lost in loss record 460 of 460 ==2503== at 0x4C299CE: calloc (vg_replace_malloc.c:711) ==2503== by 0x4011C24: _dl_allocate_tls (in /usr/lib64/ld-2.17.so) ==2503== by 0x4E3C960: pthread_create@@GLIBC_2.2.5 (in /usr/lib64/libpthread-2.17.so) ==2503== by 0x9B298AE: pthreadpool_add_job (in /usr/lib64/samba/libmessages-dgm-samba4.so) ==2503== by 0x9B29FDC: pthreadpool_tevent_job_send (in /usr/lib64/samba/libmessages-dgm-samba4.so) ==2503== by 0x56A78EF: ??? (in /usr/lib64/samba/libsmbd-base-samba4.so) ==2503== by 0x55D86B7: smb_vfs_call_pread_send (in /usr/lib64/samba/libsmbd-base-samba4.so) ==2503== by 0x55F7543: schedule_smb2_aio_read (in /usr/lib64/samba/libsmbd-base-samba4.so) ==2503== by 0x5608F57: smbd_smb2_request_process_read (in /usr/lib64/samba/libsmbd-base-samba4.so) ==2503== by 0x55FCB6C: smbd_smb2_request_dispatch (in /usr/lib64/samba/libsmbd-base-samba4.so) ==2503== by 0x55FD7DC: ??? (in /usr/lib64/samba/libsmbd-base-samba4.so) ==2503== by 0x641B977: ??? (in /usr/lib64/samba/libtevent.so.0.9.31) The problem seems to be caused by worked threads that are not properly started in detached state and thus their tls is not reclaimed upon thread termination. In pthreadpool.c we prepare a pthread attribute with PTHREAD_CREATE_DETACHED, but we don't pass it to pthread_create(). Bug: https://bugzilla.samba.org/show_bug.cgi?id=12624 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Fri Mar 10 22:06:02 CET 2017 on sn-devel-144
* krb5_wrap: Remove obsolete smb_krb5_get_principal_from_service_hostname()Andreas Schneider2017-03-102-116/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12554 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* krb5_wrap: Make smb_krb5_get_realm_from_hostname() publicAndreas Schneider2017-03-102-7/+25
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12554 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* krb5_wrap: pass client_realm to smb_krb5_get_realm_from_hostname()Andreas Schneider2017-03-101-2/+14
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12554 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* krb5_wrap: Try to guess the correct realm from the service hostnameAndreas Schneider2017-03-101-0/+13
| | | | | | | | | | | | | | | If we do not get a realm mapping from the krb5.conf or from the Kerberos library try to guess it from the service hostname. The guessing of the realm from the service hostname is already implemented in Heimdal. This makes the behavior of smb_krb5_get_realm_from_hostname() consistent with both MIT and Heimdal. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12554 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* krb5_wrap: Do not return an empty realm from smb_krb5_get_realm_from_hostname()Andreas Schneider2017-03-101-1/+3
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12554 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* waf: disable-python - align tdb's wscriptIan Stakenvicius2017-03-101-7/+2
| | | | | | | | | | | | | | Drop the configure option for --disable-python as it is now global in wafsamba. If samba is set to use a system copy of tdb, and tdb wasn't built with python support, then the system pytevent will not be found. If samba is being built without python support then pytdb is not needed, so do not bother to try and find it. Signed-off-by: Ian Stakenvicius <axs@gentoo.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* waf: disable-python - align tevent wscriptIan Stakenvicius2017-03-101-7/+2
| | | | | | | | | | | | | | Drop the configure option for --disable-python as it is now global in wafsamba. If samba is set to use a system copy of tevent, and tevent wasn't built with python support, then the system pytevent will not be found. If samba is being built without python support then pytevent is not needed, so do not bother to try and find it. Signed-off-by: Ian Stakenvicius <axs@gentoo.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* waf: disable-python - align ldb's wscriptIan Stakenvicius2017-03-101-16/+24
| | | | | | | | | | | | | | | | | | | | | If samba is set to use a system copy of ldb, and ldb wasn't built with python support, then no system pyldb-util will be found. If samba is being built without python support then pyldb-util isn not needed, so do not bother to try and find it. The system ldb check had to be duplicated due to the earlier commits which changed order of ldb and pyldb-util checks, and by association also added a dependency of pyldb-util onto ldb. This seemed cleaner than messing with variables. The build configuration for pyldb-util needs to exist even if it's not being built, so that dependency resolution can occur throughout the rest of the samba build system -- this required dropping the higher level conditional and using the enabled= parameter instead. Signed-off-by: Ian Stakenvicius <axs@gentoo.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* waf: disable-python - align talloc's wscriptIan Stakenvicius2017-03-101-7/+5
| | | | | | | | | | | | | | | | | | | Drop the configure option for --disable-python as it is now global in wafsamba If samba is set to use a system copy of talloc, and talloc wasn't built with python support, then the system pytalloc-util will not be found. If samba is being built without python support then pytalloc-util is not needed, so do not bother to try and find it. The build configuration for pytalloc-util needs to exist even if it's not being built, so that dependency resolution can occur throughout the rest of the samba build system -- this required dropping the higher level conditional and using the enabled= parameter instead. Signed-off-by: Ian Stakenvicius <axs@gentoo.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* python: samba._ldb: Port of samba._ldb to Python 3 compatible formLumir Balhar2017-03-102-11/+23
| | | | | | | | Port of samba._ldb Python module to Python 3 compatible form. Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* lib/ldb: Enable use of a python3 pyldb-util system libraryAndrew Bartlett2017-03-102-13/+26
| | | | | | | | | | | To do this, we have to install a .pc file for the python3 pyldb-util Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Incorportaing fixes by Petr Viktorin <pviktori@redhat.com> Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* talloc: use the system pytalloc-util for python3 as wellAndrew Bartlett2017-03-102-16/+32
| | | | | | | | | | | | | | | | This involves installing a .pc file for the python3 library as well To get the .pc file generated and installed is quite a mission, we have to rework the talloc build system to ensure that the second 'env' created for EXTRA_PYTHON has everything set up on it, the TALLOC_VERSION in particular. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Incorportaing fixes by Petr Viktorin <pviktori@redhat.com> Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* pyldb: p3k readiness: allow single unicode string in msg elementDouglas Bagnall2017-03-101-3/+8
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* talloc: fix doxygen of talloc_moveUri Simchoni2017-03-101-3/+4
| | | | | | | | | | talloc_move cannot fail. 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): Fri Mar 10 07:30:40 CET 2017 on sn-devel-144
* ldb: add LDB_FLG_DONT_CREATE_DBStefan Metzmacher2017-03-093-4/+12
| | | | | | | | | | | This avoids creating an new tdb files on ldbsearch or other callers which use LDB_FLG_DONT_CREATE_DB. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Mar 9 16:02:21 CET 2017 on sn-devel-144
* s3-gse: move krb5 fallback to smb_gss_krb5_import_cred wrapperAlexander Bokovoy2017-03-081-3/+43
| | | | | | | | | | | | | | | | | | | | MIT krb5 1.9 version of gss_krb5_import_cred() may fail when importing credentials from a keytab without specifying actual principal. This was fixed in MIT krb5 1.9.2 (see commit 71c3be093db577aa52f6b9a9a3a9f442ca0d8f20 in MIT krb5-1.9 branch, git master's version is bd18687a705a8a6cdcb7c140764d1a7c6a3381b5). Move fallback code to the smb_gss_krb5_import_cred wrapper. We only expect this fallback to happen with krb5 GSSAPI mechanism, thus hard code use of krb5 mech when calling to gss_acquire_cred. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12611 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Alexander Bokovoy <ab@samba.org> Autobuild-Date(master): Wed Mar 8 22:00:24 CET 2017 on sn-devel-144
* lib/krb5_wrap: add smb_gss_krb5_import_cred wrapperAlexander Bokovoy2017-03-082-0/+134
| | | | | | | | | | | | | | | | Wrap gss_krb5_import_cred() to allow re-implementing it with gss_acquire_cred_from() for newer MIT versions. gss_acquire_cred_from() works fine with GSSAPI interposer (GSS-proxy) while gss_krb5_import_cred() is not interposed yet. The wrapper has additional parameter, krb5_context handle, to facilitate with credentials cache name discovery. All our callers to gss_krb5_import_cred() already have krb5 context handy. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12611 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ldb-samba: remember the error string of a failing bind in ildb_connect()Stefan Metzmacher2017-03-031-0/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=9048 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/torture: add torture_assert_mem_equal_gotoRalph Boehme2017-03-021-0/+10
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
* talloc: version 2.1.9talloc-2.1.9Stefan Metzmacher2017-02-256-7/+97
| | | | | | | | | | | * fix some coverity defects * fix TALLOC_VERSION_MINOR and talloc_version_minor() * add new tests * add pytalloc_get_type() * add pytalloc_GenericObject_{steal,reference}[_ex]() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pytalloc: add pytalloc_GenericObject_{steal,reference}[_ex]()Stefan Metzmacher2017-02-256-12/+203
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/util: Put bitmap.c into samba-util-core so it is available to CTDBMartin Schwenke2017-02-241-2/+2
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ldb/tools: only use LDB_FLG_SHOW_BINARY for 'ldbsearch'Stefan Metzmacher2017-02-243-5/+30
| | | | | | | | | | | --show-binary is only useful for ldbseach in all other cases it will destroy data. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Feb 24 03:59:01 CET 2017 on sn-devel-144
* Correct "seperate" 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>
* Correct "formated" 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>
* Correct "occured" typos.Chris Lamb2017-02-223-28/+28
| | | | | | 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>
* ldbedit: Prevent the use of the reveal internals controlGarming Sam2017-02-221-0/+10
| | | | | | | | | | | | | | | This is almost certainly not what you want to do. Providing the output of reveal as the input of modify will necessarily revivify all dead linked attributes (regardless of --extended-dn or not). This is extremely unexpected behaviour, so we prevent this from happening. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12596 Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Wed Feb 22 04:23:05 CET 2017 on sn-devel-144