summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [TMP] Port ldb to Python 3py3compat-34ad28dPetr Viktorin2015-03-116-291/+369
|
* [TMP] Port tdb to Python 3Petr Viktorin2015-03-113-97/+120
|
* pytalloc: Build for Python 3/extrapythonPetr Viktorin2015-03-113-16/+44
| | | | | | | This enables building, installing & testing two versions for pytalloc, for two versions of Python, at the same time. Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* pytalloc: Port to Python 3Petr Viktorin2015-03-114-29/+57
| | | | | | | | | | | | | | | | | | | | | | - Use native string for repr - Use rich comparison Removes the deprecated tp_compare in favor of tp_richcompare. Disparate types cannot be compared (except for == and !=), and True or False objects are returned explicitly. - Use Py_TYPE instead of ob_type This changed to conform to C aliasing rules, see http://legacy.python.org/dev/peps/pep-3123/ - Don't provide CObject creation function A PyCapsule based replacement would be possible, but might not be necessary considering the function is not used much. - Use new-style module initialization Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* pytalloc: Add a Python 3 compatibility headerPetr Viktorin2015-03-111-0/+126
| | | | Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* talloc build: Use SAMBA_CHECK_PYTHON for finding PythonPetr Viktorin2015-03-111-3/+1
| | | | | | Previously the code repeated most of SAMBA_CHECK_PYTHON explicitly. Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* buildtools: Add a helper for running Python testsPetr Viktorin2015-03-112-0/+22
| | | | | | | | | Add the function samba_utils.RUN_PYTHON_TESTS for running a Python test. When building for multiple Python versions, all are tested. Also, add the list of configured Python interpreters to build config. Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* buildtools: Enable adding ABI flags to Python utilitiesPetr Viktorin2015-03-111-2/+26
| | | | | | | | | This allows shared libraries to be named, for example, "libpytalloc-util.cpython-34m.so". The ABI flag enables libraries for several Python versions to co-exist on a single system. Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* buildtools: Don't require pkgconfig file or headers for extrapythonPetr Viktorin2015-03-111-2/+2
| | | | | | | | | For system configuration one should use the system version of Python, not extrapython. Public headers should be the same for all versions, so the ones for the main Python version should be used. Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* buildtools: Add features and type for extra-python supportPetr Viktorin2015-03-117-35/+95
| | | | | | | | | | This allows support for an additional version of Python to be built. Two additional features (extrapyext & extrapyembed), and a target type (EXTRAPYTHON) are added. They work the same way as the "non-extra" variants, but use configuration specific to the extra-python version. Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* buildtools: Store separate configuration for extra pythonPetr Viktorin2015-03-111-1/+87
| | | | | | | | For extrapython, we store config in a separate set of env variables. During the configure step we swap these with the normal *PYTHON* equivalents, use waf's regular Python tool, and then switch them all back. Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* buildtools: Add --extra-python configure optionPetr Viktorin2015-03-112-0/+12
| | | | | | | This will allow building Python support for two different Python versions at the same time. Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* buildtools: Use 'pyfeature' instead of pyembed and pyext argumentsPetr Viktorin2015-03-1113-35/+32
| | | | | | | This will allow defining other Python-related features, which will be passed through the stack the same way as the existing two. Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* buildtools: Use all of pyext_PATTERN in map_shlib_extensionPetr Viktorin2015-03-111-1/+1
| | | | | | | | | | | In Python 3, C extension module filenames have an ABI tag; the pyext_PATTERN is e.g. "%s.cpython-34m.so". The build system was only using the last dot-separated element of that extension (the ".so"). Use the whole extension when constructing the final filename. Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* buildtools: Honor LDVERSION when looking for Python libraryPetr Viktorin2015-03-111-5/+9
| | | | | | | | | | Since Python 3.2, Python .so files are tagged for ABI compatibility, so the library name is something like libpython3.4m.so (note the 'm'). This information is found in distutils.sysconfig.get_config_var('LDVERSION') This fixes waf issue 1405 (https://code.google.com/p/waf/issues/detail?id=1405) Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* pytalloc: Add testsPetr Viktorin2015-03-113-1/+247
| | | | | | | | | Add tests for pytalloc. Since talloc objects can't be created from Python, a C extension with helpers is added. Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* wafsamba: Add install argument to SAMBA_PYTHONPetr Viktorin2015-03-111-0/+2
| | | | | | This allows building Python modules that are only used for testing. Signed-off-by: Petr Viktorin <pviktori@redhat.com>
* pytalloc: Fix comparison of disparate typesPetr Viktorin2015-03-111-1/+1
| | | | | | | | When fed Python objects of different types, pytalloc_default_cmp compared pointers to PyType objects that weren't part of an array, resulting in undefined behavior. This makes things a bit better (though it still casts ptrdiff_t to int).
* ,disable-slow-testPetr Viktorin2015-03-111-2/+2
|
* tdb: Fix CID 1034842 Resource leakHEADmasterVolker Lendecke2015-03-111-0/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Mar 11 00:23:20 CET 2015 on sn-devel-104
* tdb: Fix CID 1034841 Resource leakVolker Lendecke2015-03-101-3/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* lib: Fix CID 1034840 Resource leakVolker Lendecke2015-03-101-0/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* lib: Fix CID 1034839 Resource leakVolker Lendecke2015-03-101-0/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* lib: Fix CID 1034838 Resource leakVolker Lendecke2015-03-101-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* smbcontrol: Simplify do_winbind_offlineVolker Lendecke2015-03-101-5/+1
| | | | | | | This saves 128 bytes of .text on x86-64 with -O3. No idea why... Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* libreplace: Fix CID 1034926 Destination buffer too smallVolker Lendecke2015-03-101-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* ctdb: Fix 1125553 Buffer not null terminatedVolker Lendecke2015-03-101-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* registry: Fix CID 240989 Buffer not null terminatedVolker Lendecke2015-03-101-1/+1
| | | | | | | This makes it clearer that we don't really have a string in .hdr Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* registry: Fix CID 241075 Unchecked return valueVolker Lendecke2015-03-101-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* torture4: Fix systems with a 32-bit "long"Volker Lendecke2015-03-101-5/+6
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Mar 10 18:05:13 CET 2015 on sn-devel-104
* ctdb-daemon: Use statically allocated arrays for helper pathsMartin Schwenke2015-03-102-33/+19
| | | | | | | | The use of talloc with a static variable is somewhat confusing. Statically allocate an array and use ctdb_set_helper() instead. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-common: New function ctdb_set_helper()Martin Schwenke2015-03-102-0/+62
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* Update libwbclient version to 0.12Matthew Newton2015-03-103-2/+133
| | | | | | | | | | | | | | Increment the minor version of the libwbclient library after new context functions added. (Major version increase not required as the only two functions with changed parameters are private to the library.) Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk> Reviewed-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 Mar 10 03:24:45 CET 2015 on sn-devel-104
* Move wbc global variables into global context insteadMatthew Newton2015-03-103-45/+73
| | | | | | | | | | There are some global variables in use in the libwbclient library. Now that we have a context, move these into it so that they are thread-safe when the wbcCtx* functions are used. Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Add context versions of wbclient functionsMatthew Newton2015-03-106-176/+1161
| | | | | | | | | | | To make the libwbclient library thread-safe, all functions that call through to wb_common winbindd_request_response need to have context that they can use. This commit adds all the necessary functions. Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Add wbcContext to wbcRequestResponseMatthew Newton2015-03-102-7/+21
| | | | | | | | | To enable libwbclient to pass winbindd context through to the winbind client library in wb_common. Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Add wbcContext struct, create and free functionsMatthew Newton2015-03-103-0/+78
| | | | | | | | | The basic context structure and functions for libwbclient so that libwbclient can be made thread-safe. Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Use global context for winbindd_request_responseMatthew Newton2015-03-107-47/+74
| | | | | | | | | Updating API call in libwbclient, wbinfo, ntlm_auth and winbind_nss_* as per previous commit to wb_common.c. Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Make winbind client library thread-safe by adding contextMatthew Newton2015-03-103-62/+144
| | | | | | | | | | Rather than keep state in global variables, store the current context such as the winbind file descriptor in a struct that is passed in. This makes the winbind client library thread-safe. Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture/ioctl: add range overflow QAR testDavid Disseldorp2015-03-101-0/+51
| | | | | | | | | | | | | Issue a QAR request with an offset and length that generate an integer (uint64_t) overflow when summed together. This should result in an NT_STATUS_INVALID_PARAMETER response, as confirmed against Windows Server 2012 & 2008. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Mar 10 00:02:18 CET 2015 on sn-devel-104
* torture/ioctl: add multi-range QAR testDavid Disseldorp2015-03-091-0/+79
| | | | | | | | Write 10 x 64K ranges, with 64K holes punched in between. Afterwards, check that all ranges are present in the QAR response. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture/ioctl: add QAR off-by-one bug paranoia testDavid Disseldorp2015-03-091-0/+156
| | | | | Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture/ioctl: test sparse file operation lockingDavid Disseldorp2015-03-091-0/+111
| | | | | | | | | An exclusively locked file can still be marked sparse. QAR requests covering the locked-range should also succed. ZERO_DATA requests are blocked. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/smbd: fix FSCTL_SET_SPARSE permission checksDavid Disseldorp2015-03-091-2/+7
| | | | | | | | | | | | On Windows servers (tested against Windows Server 2008 & 2012) the FSCTL_SET_SPARSE ioctl is processed if FILE_WRITE_DATA, FILE_WRITE_ATTRIBUTES _or_ SEC_FILE_APPEND_DATA permissions are granted on the open file-handle. Fix Samba such that it matches this behaviour, rather than only checking for FILE_WRITE_DATA or FILE_WRITE_ATTRIBUTES. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture/ioctl: add ioctl_sparse_perms testDavid Disseldorp2015-03-091-0/+241
| | | | | | | | This test confirms that correct FSCTL_SET_SPARSE permission checks are in place on the server. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture/ioctl: rework and reduce pattern helper IO sizesDavid Disseldorp2015-03-091-37/+46
| | | | | | | | | | | | | | | check_pattern() currently attempts to read all data in one go. Fix it to use a 64K maximum IO size so that it works against Windows Server 2008. Additionally, rework write_pattern() so that it only allocates a buffer for the largest IO size (now 64K), rather than for the full write length. Finally, assert that callers are correctly performing pattern IO in 8-byte increments - copy_chunk_tiny was not, so fix it. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture/ioctl: add sparse_punch_invalid testDavid Disseldorp2015-03-091-0/+109
| | | | | | | | | | | | | Attempt to extend a file using ZERO_DATA. The operation should succeed, but the file should not be extended, as specified in MS-FSCC <58> Section 2.3.65: This FSCTL sets the range of bytes to zero (0) without extending the file size. Also test zero length and invalid BFZ requests. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture/ioctl: remove FS specific sparse copy-chunk expectationsDavid Disseldorp2015-03-091-9/+30
| | | | | | | | | | | | NTFS deallocates an entire file when a sparse zero-data request spans the full length. Other filesystems (e.g. EXT4 and Btrfs) do not. vfs_btrfs is additionally capable of preserving sparse regions for copy-chunk, using the BTRFS_IOC_CLONE_RANGE ioctl. This should not be treated as a failure. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture/ioctl: remove FS specific sparse punch checkDavid Disseldorp2015-03-091-7/+21
| | | | | | | | | | | | | Samba uses PUNCH_HOLE to zero a range, and subsequently uses fallocate() to allocate the punched range if the file is marked non-sparse and "strict allocate" is enabled. In both cases, the zeroed range will not be detected by SEEK_DATA, so the range won't be present in QAR responses until the file is marked non-sparse again. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture/ioctl: remove 64K chunk size assumptionsDavid Disseldorp2015-03-091-7/+24
| | | | | | | | | These tests assumed that 4K chunks remain allocated following write at a subsequent offset. This is not the case for other filesystems (E.g. XFS, Btrfs, Etc.), which may deallocate the chunk. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>