1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

5734 Commits

Author SHA1 Message Date
Stefan Metzmacher
a2daa664cc ldb/tools: only use LDB_FLG_SHOW_BINARY for 'ldbsearch'
--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
2017-02-24 03:59:01 +01:00
Chris Lamb
1e0bca1e6c Correct "seperate" typos.
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>
2017-02-22 08:26:22 +01:00
Chris Lamb
9f03cf9123 Correct "formated" typos.
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>
2017-02-22 08:26:22 +01:00
Chris Lamb
a4ab7c73bd Correct "occured" typos.
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>
2017-02-22 08:26:21 +01:00
Garming Sam
bed19f3744 ldbedit: Prevent the use of the reveal internals control
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
2017-02-22 04:23:05 +01:00
Stefan Metzmacher
16ea6e1308 talloc: fix TALLOC_VERSION_* mismatch detection
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Feb 22 00:14:34 CET 2017 on sn-devel-144
2017-02-22 00:14:34 +01:00
Stefan Metzmacher
10e1b92c28 krb5_wrap: use our own code to calculate the ENCTYPE_ARCFOUR_HMAC key
Our own convert_string_talloc() function handles a wider range
of unicode code points than the MIT krb5 or heimdal code.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12262

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Feb 21 20:08:16 CET 2017 on sn-devel-144
2017-02-21 20:08:16 +01:00
Stefan Metzmacher
ad12cfae42 lib/util: add generate_random_machine_password() function
It generates more random password for the use as machine password,
restricted to codepoints <= 0xFFFF in order to be compatible
with MIT krb5 and Heimdal.

Note: the fallback to ascii if 'unix charset' is not 'utf8'.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12262

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-02-21 16:09:21 +01:00
Cody Harrington
4940661658 ndrdump: Add the option --hex-input for hexdump parsing
This allows the user to input a hexdump that has been generated by the dump option.

Signed-off-by: Cody Harrington <cody@harringtonca.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-02-14 09:46:23 +01:00
Andrew Bartlett
77b37e9372 lib/util: Remove ntstatus.h and string_wrappers.h include from samba_util.h
These are not low-level headers that we need everywhere.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Pair-programmed-with: Bob Campbell <bobcampbell@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Feb 11 11:40:45 CET 2017 on sn-devel-144
2017-02-11 11:40:45 +01:00
Andrew Bartlett
83a3805461 debug: Do not depend on the whole of samba_util.h
By depending only on util_strlist.h and blocking.h we avoid pulling in the
generated NTSTATUS list for this low-level subsystem

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Pair-programmed-with: Bob Campbell <bobcampbell@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-02-11 07:49:16 +01:00
Ralph Boehme
738797d8ad lib/replace: validate xattr namespace prefix on FreeBSD
We should validate the xattr name string ensuring it either begins with
"sytem." or "user.". If it doesn't, we should fail the request with
EINVAL.

The FreeBSD xattr API uses namespaces but doesn't put the namespace name
as a string prefix at the beginning of the xattr name. It gets passed as
an additional int arg instead.

On the other hand, our libreplace xattr API expects the caller to put a
namespace prefix into the xattr name.

Unfortunately the conversion and stripping of the namespace string prefix
from the xattr name gives the following unexpected result on FreeBSD:

rep_setxattr("foo.bar", ...) => xattr with name "bar"

The code checks if the name begins with "system.", if it doesn't find
it, it defaults to the user namespace and then does a strchr(name, '.')
which skips *any* leading string before the first dot.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12490

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-02-10 18:33:17 +01:00
Douglas Bagnall
b02d636e0b lib/replace tests: prevent GCC fretting over snprintf sizes
These tests deliberately use snprintf for truncating strings, which is
fine for tests. This has the effect of leaving the warning in place
but preventing it from becoming a fatal error.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-02-10 05:09:08 +01:00
Matthieu Patou
dd25d75b96 Move pthreadpool to top of the tree.
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-02-09 20:04:12 +01:00
Douglas Bagnall
83c4ad778e binsearch: make BINARY_ARRAY_SEARCH_GTE compare against a pointer
This is in preparation for improvements in our handling of linked
attributes where we make changes to the pointer in the process of
comparing it (for caching purposes).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-02-09 03:17:15 +01:00
Douglas Bagnall
8bdec7034e binsearch: clarify variable name in greater-than-or-equal search
The exact match variable was called "result" following the other
macros, which confused me for a moment.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-02-09 03:17:15 +01:00
Stefan Metzmacher
3fe1f06278 talloc/wscript: avoid passing pointless enabled=True to SAMBA_PYTHON()
This is the default and should not be passed explicitly.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Feb  1 18:16:58 CET 2017 on sn-devel-144
2017-02-01 18:16:58 +01:00
Andreas Schneider
7fd3eb6c04 util:charset: Return EILSEQ in smb_iconv() if newer libc is detected
This is the behaviour of glibc 2.24 and newer.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Feb  1 05:16:46 CET 2017 on sn-devel-144
2017-02-01 05:16:46 +01:00
Andreas Schneider
9d60ad53b8 rpc_server: Allow to configure the port range for RPC services
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12521

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2017-01-27 08:09:15 +01:00
Zentaro Kavanagh
8ec6d8a6f2 Add explicit dependency on samba-debug from libinterfaces and libserverrole.
Currently these dependencies are indirect via a SAMBA_SUBSYSTEM
which does not propagate private library information. This results
in these 2 libraries getting generated with no RPATH information
in the ELF header.

Additional discussion [1].

[1] -
https://lists.samba.org/archive/samba-technical/2017-January/118078.html

Signed-off-by: Zentaro Kavanagh <zentaro@google.com>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jan 23 08:26:43 CET 2017 on sn-devel-144
2017-01-23 08:26:43 +01:00
Andrew Bartlett
bd8d9559bf param: Remove winbindd privileged socket directory option
This option is unused and has not been used since before Samba 4.3
when the source4/ winbindd code went away.

The associated dynconfig parameters used for the default are also removed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10066

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-01-22 18:30:12 +01:00
Volker Lendecke
a551d3826d lib/util: Avoid a talloc in ms_fnmatch_protocol
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-01-22 18:30:12 +01:00
Volker Lendecke
f969be5441 lib: Add "is_case_sensitive" to ms_fnmatch_protocol
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-01-22 18:30:12 +01:00
Volker Lendecke
07d9a909ba lib/util/charset: Optimize next_codepoint for the ascii case
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-01-22 18:30:11 +01:00
Volker Lendecke
9bed3e3043 lib: Avoid an includes.h
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-01-22 18:30:11 +01:00
Volker Lendecke
9af73f62ce lib: Add lib/util/server_id.h
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-01-22 18:30:11 +01:00
Björn Jacke
a5c2396173 replace: fix some trailing whitespaces
Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2017-01-21 13:15:19 +01:00
Ralph Boehme
7b3f2302b2 s3/debug: listen for MSG_REQ_RINGBUF_LOG
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2017-01-20 18:48:26 +01:00
Ralph Boehme
1f6d5f2c09 debug: add "ringbuf" backend logging to a ringbuffer
This is useful for debugging bugs that involve timing effects and are
not reproducible when logging at higher debug levels with the file
backend.

The log can be dumped to a file with gdb:

(gdb) dump binary memory samba.log debug_ringbuf debug_ringbuf+SIZE

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2017-01-20 18:48:25 +01:00
Ralph Boehme
bf59d97f80 debug: parse, store and pass backend option
Will be used in the next commit by new "ringbuf" backend.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2017-01-20 18:48:25 +01:00
Jeremy Allison
d35ff9e9bd lib: talloc: Make it clear that talloc_get_size(NULL) returns 0.
This *isn't* a behavior change, as the previous code could potentially
return the size of null_context, which (currently) is defined as
a named talloc region of ZERO size, but this makes it very clear
what the ABI behavior should be.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jan 12 19:23:25 CET 2017 on sn-devel-144
2017-01-12 19:23:25 +01:00
Stefan Metzmacher
4b295b106c wscript: remove executable bits for all wscript* files
These files should not be executable.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jan 11 20:21:01 CET 2017 on sn-devel-144
2017-01-11 20:21:01 +01:00
Stefan Metzmacher
c7366892b0 lib/tevent: remove unused release-script.sh
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2017-01-11 16:39:21 +01:00
Stefan Metzmacher
3be1203987 krb5_wrap: let smb_krb5_kinit_s4u2_ccache() work if store_creds.client and server have different realms
As the principal in the resulting ccache may not match the realm of the
target principal, we need to store the credentials twice.

The caller uses the ccache principal's realm to construct the
search key for the target principal.

If we get administrator@SAMBADOMAIN via the NTLMSSP authentication
and want to do s4u2selfproxy, we'll get ticket for

client realm: SAMBADOMAIN
client name: administrator
server realm: SAMBA.EXAMPLE.COM
server name: cifs/localdc

This is stored in credential cache, but
the caller will use cifs/localdc@SAMBADOMAIN as
target_principal name when it tries to use the
cache.

So also store the ticket as:

client realm: SAMBADOMAIN
client name: administrator
server realm: SAMBADOMAIN
server name: cifs/localdc

Note that it can always happen that the target is not in the clients
realm, so we always deal with changing realm names, so this is not
a s4u2self/proxy specific thing.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-01-10 13:54:17 +01:00
Ralph Boehme
18591edafa s3/smbd: new "mangled names" setting "illegal"
This does mangling for names with illegal NTFS characters, but not for
names longer then 8.3:

Name mangling with mangled named = yes
======================================

Mangled | Short | Name
----------------------------
        |       | foo
        | yes   | 123456789
yes     |       | foo:bar

Name mangling with mangled named = illegal
==========================================

Mangled | Short | Name
----------------------------
        |       | foo
        |       | 123456789
yes     |       | foo:bar

Setting "mangled names = illegal" is the most sensible setting for
modern clients that don't use the shortname anymore.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-01-09 19:31:20 +01:00
Ralph Boehme
19eae53773 s3/smbd: convert "mangled names" option to an enum
This is in preparation of adding an additional setting for this
option. No change in behaviour by this commit, that comes in the next
one.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-01-09 19:31:20 +01:00
Andreas Schneider
0127bdd33b replace: Include sysmacros.h
In the GNU C Library, "makedev" is defined by <sys/sysmacros.h>. For
historical compatibility, it is currently defined by <sys/types.h> as
well, but it is planned to remove this soon.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Jan  8 22:30:03 CET 2017 on sn-devel-144
2017-01-08 22:30:02 +01:00
Günther Deschner
7eeb2edc50 lib/util: add pm_process_with_flags to allow parsing ini files with empty values
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-01-06 12:28:19 +01:00
Volker Lendecke
214abc98e6 lib: Use "all_zero" where appropriate
... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-01-03 16:04:28 +01:00
Lukas Slebodnik
59abfcb794 WAF: Fix detection of IPv6
Detection of IPv6 failed with strict CFLAGS due to missing
header file.

  Checking for HAVE_IPV6       : not found

../test.c: In function ‘main’:
../test.c:226:34: error: implicit declaration of function
    ‘if_nametoindex’ [-Werror=implicit-function-declaration]
                        int idx = if_nametoindex("iface1");
                                  ^~~~~~~~~~~~~~

Signed-off-by: Lukas Slebodnik <lslebodn@redhat.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): Mon Jan  2 18:03:20 CET 2017 on sn-devel-144
2017-01-02 18:03:20 +01:00
Lukas Slebodnik
b7ae41e6ca lib replace: Fix detection of features
If configure script is executed with stricter cflags
"-Werrorr=implicit-function-declaration -Werror=implicit-int"
then detection of few features will fail.

 Checking for C99 vsnprintf : not found
 Checking for HAVE_SHARED_MMAP : not found
 Checking for HAVE_MREMAP : not found

lib/replace/test/shared_mmap.c:18:1:
    error: return type defaults to ‘int’ [-Werror=implicit-int]
 main()
 ^~~~
lib/replace/test/shared_mmap.c: In function ‘main’:
lib/replace/test/shared_mmap.c:25:16:
    error: implicit declaration of function ‘exit’
    [-Werror=implicit-function-declaration]
  if (fd == -1) exit(1);
                ^~~~
lib/replace/test/shared_mmap.c:25:16:
    warning: incompatible implicit declaration of built-in function ‘exit’
lib/replace/test/shared_mmap.c:25:16:
    note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’

Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-01-02 14:12:27 +01:00
Stefan Metzmacher
1e52bb9c34 krb5_wrap: fix smb_krb5_cc_copy_creds() for MIT krb5
krb5_cc_copy_creds() expects an already initialized output cache.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Dec 24 21:04:23 CET 2016 on sn-devel-144
2016-12-24 21:04:23 +01:00
Garming Sam
77b51ba2f2 ldb_tdb: avoid erroneous error messages
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Fri Dec 23 02:28:54 CET 2016 on sn-devel-144
2016-12-23 02:28:54 +01:00
Garming Sam
a18e115ffe ldbdump: Parse the -i option
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2016-12-22 22:42:22 +01:00
Andreas Schneider
9157826573 krb5_wrap: Remove incorrect absolute path checks in smb_krb5_kt_open_relative()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-12-16 01:55:13 +01:00
Andreas Schneider
e0990ccf4e krb5_wrap: More checks for absolute path in smb_krb5_kt_open()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-12-16 01:55:13 +01:00
Andrew Bartlett
dcd4fed82d talloc: Add tests for talloc destructor behaviour after talloc_realloc()
That this behaved correctly was not clear, so I added tests to prove
it to myself.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Dec 13 06:47:58 CET 2016 on sn-devel-144
2016-12-13 06:47:58 +01:00
Volker Lendecke
8be0a0dc76 lib: Remove xfile
The days of operating systems with a 255 file
descriptor limit on FILE (I'm looking at you
Solaris - Solaris 10 finally fixed this) are
long gone.

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): Sun Dec 11 15:01:12 CET 2016 on sn-devel-144
2016-12-11 15:01:12 +01:00
Volker Lendecke
9a6243eb9d lib: Add fgets_slash
Copy x_fgets_slash with conversion to stdio and talloc.

Probably I'd do this functionality a bit differently, but for simplicity I
chose to make it the same as what is there.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-12-11 11:17:23 +01:00
Björn Jacke
44a01a2d3d util: use SCOPE_DELIMITER for the IPv6 scope delimiter
Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Dec  9 20:45:15 CET 2016 on sn-devel-144
2016-12-09 20:45:15 +01:00
Björn Jacke
bfc6adfb20 replace: make sure we have a SCOPE_DELIMITER define
Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-12-09 16:58:11 +01:00
Björn Jacke
c44e1916eb man pages: change http://samba.org to https://www.samba.org
Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
2016-12-09 13:10:26 +01:00
Anoop C S
ee0475d89d lib/util: Fix indentation within routine description for dbghdrclass
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Dec  9 02:02:36 CET 2016 on sn-devel-144
2016-12-09 02:02:36 +01:00
Anoop C S
c832188b78 lib/util: Fix input arguments description for dbghdrclass() routine
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-08 22:12:12 +01:00
Lukas Slebodnik
701c6ad53c tevent: remove shebang from tevent.py
The tevent.py is not a executable python script.
And rpmlint consider it as an error if module file
contians shebang

    python2-tevent.x86_64: E: non-executable-script
        /usr/lib64/python2.7/site-packages/tevent.py 644 /usr/bin/python
    python3-tevent.x86_64: E: non-executable-script
        /usr/lib64/python3.5/site-packages/tevent.py 644 /usr/bin/python

Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-12-08 22:12:12 +01:00
Martin Schwenke
3de13cbc64 debug: Add minimalist D_* macros
These don't include the function name or any other header.

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 Dec  5 05:58:48 CET 2016 on sn-devel-144
2016-12-05 05:58:48 +01:00
Andreas Schneider
383530c164 libsocket: Make sure ifr.ifr_name is null-terminated
Found by Coverity

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Dec  3 03:40:53 CET 2016 on sn-devel-144
2016-12-03 03:40:53 +01:00
Andreas Schneider
682300ce0a util: Initialize pointer
Coverity warns about so this will silence it.
Reviewed-by: Jeremy Allison <jra@samba.org>

Signed-off-by: Andreas Schneider <asn@samba.org>
2016-12-02 23:46:15 +01:00
Volker Lendecke
42f65b6d06 lib: Avoid includes.h in bitmap.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-12-02 09:36:08 +01:00
Amitay Isaacs
88586570e8 replace: Include libgen.h if available
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Dec  1 18:08:54 CET 2016 on sn-devel-144
2016-12-01 18:08:54 +01:00
Andrew Bartlett
aa63600afb ldb: new ldb version 1.1.29
- new OID LDB_CONTROL_RECALCULATE_RDN_OID
 - honour LDB_CONTROL_RECALCULATE_RDN_OID in rdn_modify
 - fix handling of @ATTRIBUTES containing * in rdn_modify
 - improve startup performance on AD DC databases
  - These have lots of index attributes and attributes specified

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:24 +01:00
Andrew Bartlett
6ca5e9ee1c ldb: Add test for behaviour of rdn_name
Cover a wildcard in @ATTRIBUTES and the normal case.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:23 +01:00
Andrew Bartlett
4dfe84a984 ldb: Cope with a->name being *
The default schema when loaded from the DB will have a name of *, not NULL.

This feature is rarely used, and was incompatible with the rdn_name module
until now.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:23 +01:00
Stefan Metzmacher
ea3c96647f ldb:rdn_name: add support for LDB_CONTROL_RECALCULATE_RDN_OID on ldb_modify()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12399

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:23 +01:00
Stefan Metzmacher
25aa26178f ldb:rdn_name: normalize rdn_name in rdn_rename_callback()
We already do that on 'add'.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12399

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:23 +01:00
Andrew Bartlett
f599a2d244 ldb: load @ATTRIBUTES faster by sorting once, not at each insertion
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:23 +01:00
Andrew Bartlett
393b8f3c1d ldb: Add helper function ldb_schema_attribute_fill_with_syntax()
This will allow us to avoid calling ldb_schema_attribute_add_with_syntax()
in a tight loop.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:23 +01:00
Andrew Bartlett
d8ee92734b ldb: Reduce per-attribute memory allocation during @ATTRIBUTES load
This means we do just a few allocations, not multiple per configured attribute (there can be 1000s)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:23 +01:00
Andrew Bartlett
df2cc307e7 ldb: Reduce scope of allocation and de-allocation of @ATTRIBUTES
This memory does not need to be around long-term

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:23 +01:00
Andrew Bartlett
604a4fd438 ldb: Add helper function ldb_schema_attribute_remove_flagged()
This helps us avoid keeping a list of attributes to later remove on @ATTRIBUTES reload

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:23 +01:00
Stefan Metzmacher
4e1b965005 ldb:controls: add LDB_CONTROL_RECALCULATE_RDN_OID
This will be used by 'samba-tool dbcheck' to fix the rdn attribute name.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12399

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

(Patch reduced by Andrew Bartlett to only allocate the OID)
2016-12-01 05:54:22 +01:00
Andrew Bartlett
2628aa5f7e ldb: Avoid individual memory allocations when searching for indexlist
This reduces the talloc_free() cost when the ldb is terminated.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:22 +01:00
Andrew Bartlett
5cb1882dc6 talloc: Add tests for talloc_parent() after realloc() of the parent
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:22 +01:00
Andrew Bartlett
48c897f126 talloc: clarify that talloc_magic never includes the bits in TALLOC_FLAG_MASK
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:22 +01:00
Andrew Bartlett
032e25fdc6 talloc: add ASCII art to describe parent/child arrangement
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:22 +01:00
Volker Lendecke
f5154a86fa ldb: Fix an unused variable warning
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-11-30 20:36:24 +01:00
Volker Lendecke
b38c8da937 ldb: Fix typos
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-11-30 20:36:24 +01:00
Stefan Metzmacher
78a77d468f tdb: version 1.3.12
* Bug 12455 - tdb mutexes don't work on FreeBSD

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): Wed Nov 30 20:02:28 CET 2016 on sn-devel-144
2016-11-30 20:02:28 +01:00
Volker Lendecke
275d9fc7d9 tdb: Fix mutexes on FreeBSD
susv4 on mmap has the following snippet:

> The state of synchronization objects such as mutexes, semaphores,
> barriers, and conditional variables placed in shared memory mapped
> with MAP_SHARED becomes undefined when the last region in any process
> containing the synchronization object is unmapped.

This means we can't keep the mutex mmap area unmapped at any point
in time.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12455

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 29 23:59:52 CET 2016 on sn-devel-144
2016-11-29 23:59:52 +01:00
Volker Lendecke
5ce95abf37 tdb: Only mmap the mutex area if not already mmap'ed
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12455

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-11-29 20:03:25 +01:00
Volker Lendecke
a2843cfd4d tdb: NULL out tdb->mutexes in tdb_mutex_munmap
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12455

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-11-29 20:03:25 +01:00
Martin Schwenke
de22783f73 lib/util: Make sys_rw available to CTDB
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-11-29 07:25:19 +01:00
Volker Lendecke
530c2c8f97 ldb: version 1.1.28
* Fix the build with installed ldb-devel 1.1.27
  We depend on LDB_UNPACK_DATA_FLAG_NO_VALUES_ALLOC.

* Some build fixes.

* More performance improvements.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Nov 23 20:48:31 CET 2016 on sn-devel-144
2016-11-23 20:48:31 +01:00
Stefan Metzmacher
e369d800ba pyldb: protect PyErr_LDB_ERROR_IS_ERR_RAISE() with do {} while(0)
This should avoid the following warning:

 CID 1394274:  Control flow issues  (DEADCODE)
 Execution cannot reach this statement: ";".

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-11-23 16:53:28 +01:00
Andreas Schneider
9c0f2576d8 lib:torture: Make variables const
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12415

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-11-20 17:29:08 +01:00
Volker Lendecke
df9e7c7ae5 lib: Remove global xfile.h includes
This makes it more obvious where this legacy code is used

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): Sun Nov 20 06:23:19 CET 2016 on sn-devel-144
2016-11-20 06:23:19 +01:00
Volker Lendecke
c06b78d0be lib: Move x_fgets_slash to xfile.c
This makes it easier to remove the global #include xfile.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-11-20 02:28:11 +01:00
Volker Lendecke
8742d239b2 lib: Apply an overflow check
Very unlikely here, as the realloc will have failed long before, but
still I would like to check overflow.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-11-20 02:28:11 +01:00
Volker Lendecke
3a8bf0222a lib: Reformat x_fgets_slash
This is so old code that I'd like to move somewhere else next, but before
that I'd like to clean it up a bit.

No code change, just indentation changed and some {} added.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-11-20 02:28:11 +01:00
Volker Lendecke
1314db09dd lib: Rename fgets_slash to x_fgets_slash
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-11-20 02:28:11 +01:00
Volker Lendecke
6c26c5e60c lib: Avoid includes.h in access.c
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): Wed Nov 16 22:26:14 CET 2016 on sn-devel-144
2016-11-16 22:26:13 +01:00
Volker Lendecke
277383e5a9 lib: memcache.h needs some includes
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-11-16 18:32:28 +01:00
Jeremy Allison
584daf5513 lib: util: Add allow_access_nolog().
Make allow_access() call allow_access_nolog(), then log.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12419

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-11-16 12:41:09 +01:00
Jeremy Allison
f1285082f9 Move source3/lib/access.c to toplevel lib/util/access.c
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12419

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-11-16 12:41:09 +01:00
Jeremy Allison
828b60f30d lib/util: Move unix_wild_match() from source3/lib/util to lib/util/
Use top-level functions instead of source3 specific ones.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12419

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-11-16 12:41:09 +01:00
Andreas Schneider
69329cf22c lib:util: Don't print lstat warning on ERROR debug level
If we are a client and can't access the lock directory don't confuse a
user.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-11-16 00:20:06 +01:00
Stefan Metzmacher
4c08920b83 lib/async_req: add writev_cancel()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-10-26 11:20:12 +02:00
Volker Lendecke
3460ad8fae ldb: Fix a signed/unsigned mixup
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-10-19 01:26:14 +02:00
Volker Lendecke
1f0dd8f698 talloc: Fix CID 1373619 Unchecked return value
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): Sat Oct 15 01:28:02 CEST 2016 on sn-devel-144
2016-10-15 01:28:01 +02:00
Volker Lendecke
6de421b299 talloc: Fix CID 1373621 Unchecked return value
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-10-14 21:45:08 +02:00