obnox/samba/samba-obnox.git
8 years agonwrap: fix return code of getaddrinfo for AI_NUMERICSERV in error case
Michael Adam [Fri, 6 Nov 2015 09:45:15 +0000 (10:45 +0100)]
nwrap: fix return code of getaddrinfo for AI_NUMERICSERV in error case

If the AI_NUMERICSERV flag is specified, the the port number
has to specified as a string representing a decimal number
or left NULL.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agonwrap: fix numeric port detection in nwrap_getaddrinfo
Michael Adam [Fri, 6 Nov 2015 09:22:10 +0000 (10:22 +0100)]
nwrap: fix numeric port detection in nwrap_getaddrinfo

Only a string that can be converted to a number, is
allowed as a numeric port specification. Trailing
characters are not allowed.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agonwrap: Better check service string sanity.
Robin Hack [Tue, 13 Oct 2015 12:41:14 +0000 (14:41 +0200)]
nwrap: Better check service string sanity.

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

Patch use strtol() instead of atoi() to convert strings to numbers.
This helps better check sanity of service input string.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Fix memory leak in nwrap_gethostbyname_r()
Robin Hack [Mon, 12 Oct 2015 08:36:04 +0000 (10:36 +0200)]
nwrap: Fix memory leak in nwrap_gethostbyname_r()

Fix reimplements how memory is used.
Results from vector are copied to user provided buf.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agonwrap: Fix memory leak in nwrap_files_gethostbyname()
Robin Hack [Thu, 8 Oct 2015 13:27:47 +0000 (15:27 +0200)]
nwrap: Fix memory leak in nwrap_files_gethostbyname()

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Fix memory leak in nwrap_he_unload()
Robin Hack [Thu, 8 Oct 2015 13:00:33 +0000 (15:00 +0200)]
nwrap: Fix memory leak in nwrap_he_unload()

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Rename cont to vector in nwrap_vector_add_item()
Robin Hack [Thu, 8 Oct 2015 12:09:11 +0000 (14:09 +0200)]
nwrap: Rename cont to vector in nwrap_vector_add_item()

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Fix memory leak inside nwrap_getaddrinfo()
Robin Hack [Thu, 8 Oct 2015 12:02:56 +0000 (14:02 +0200)]
nwrap: Fix memory leak inside nwrap_getaddrinfo()

Memory leak was introduced by deep copy code.
Item ai_tmp->ai_addr should not have deep copy.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Use nwrap_vector_foreach instead of for loop
Robin Hack [Thu, 8 Oct 2015 12:00:38 +0000 (14:00 +0200)]
nwrap: Use nwrap_vector_foreach instead of for loop

Replace for loop by nwrap_vector_foreach in nwrap_lines_unload().

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Fix memory leak when getline() is used.
Robin Hack [Thu, 8 Oct 2015 09:36:33 +0000 (11:36 +0200)]
nwrap: Fix memory leak when getline() is used.

getline() allocates memory even if return code is < 0.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Add basic locking for support multithreaded applications
Robin Hack [Tue, 24 Mar 2015 16:54:34 +0000 (17:54 +0100)]
nwrap: Add basic locking for support multithreaded applications

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Add BSD libc support for gethost*_r functios.
Robin Hack [Fri, 27 Mar 2015 14:51:11 +0000 (15:51 +0100)]
nwrap: Add BSD libc support for gethost*_r functios.

BSD libc stores data in thread local storage.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Use nwrap vectors as memory backend for getaddrinfo() and gethostbyname()
Robin Hack [Thu, 16 Jul 2015 14:10:20 +0000 (16:10 +0200)]
nwrap: Use nwrap vectors as memory backend for getaddrinfo() and gethostbyname()

Previous patches introduced nwrap vectors and hash functions.
This patch will join all together.

Main purpose of this patch is:
- support more records per hostname.
  For example: hostname now can have associated IPv4 and IPv6 address.
- better handling of big number of hostname records

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Add string manipulation functions.
Robin Hack [Tue, 24 Mar 2015 14:14:35 +0000 (15:14 +0100)]
nwrap: Add string manipulation functions.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Add nwrap_add_hname() and nwrap_add_hname_alias().
Robin Hack [Wed, 15 Jul 2015 13:05:28 +0000 (15:05 +0200)]
nwrap: Add nwrap_add_hname() and nwrap_add_hname_alias().

Functions adds a hostname or an alias to the hash table.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Add function nwrap_add_ai
Robin Hack [Wed, 15 Jul 2015 13:04:32 +0000 (15:04 +0200)]
nwrap: Add function nwrap_add_ai

This adds an ip to the hash table.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Add a hash table to the nwrap structure
Robin Hack [Wed, 15 Jul 2015 13:01:48 +0000 (15:01 +0200)]
nwrap: Add a hash table to the nwrap structure

The hash table will hold hostnames and ips internally. The new
environment variable which is introduced is NSS_WRAPPER_MAX_HOSTENTS. It
sets the maximum count of hostent (hostnames and ips) structs which the
hash table can hold.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Simplify file loading.
Robin Hack [Mon, 23 Mar 2015 13:39:28 +0000 (14:39 +0100)]
nwrap: Simplify file loading.

Lines are stored into vectors now.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Add nwrap vector memory management functions
Robin Hack [Mon, 23 Mar 2015 13:10:18 +0000 (14:10 +0100)]
nwrap: Add nwrap vector memory management functions

Nwrap vectors  are just more inteligent arrays.
They can look like very simple version of
vectors from C++.

TESTS: Add nwrap_vector tests.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Check for setspent and getspnam functions
Andreas Schneider [Tue, 6 Oct 2015 08:34:20 +0000 (10:34 +0200)]
nwrap: Check for setspent and getspnam functions

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agosrc: Add configure check for shadow.h
Andreas Schneider [Tue, 6 Oct 2015 08:19:48 +0000 (10:19 +0200)]
src: Add configure check for shadow.h

This is the first part to fix FreeBSD.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Add support for getspnam()
Andreas Schneider [Thu, 17 Sep 2015 08:39:15 +0000 (10:39 +0200)]
nwrap: Add support for getspnam()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Add (set|get|end)spent functions
Andreas Schneider [Thu, 17 Sep 2015 08:38:49 +0000 (10:38 +0200)]
nwrap: Add (set|get|end)spent functions

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Add nss_wrapper_shadow_enabled() function
Andreas Schneider [Thu, 17 Sep 2015 08:37:50 +0000 (10:37 +0200)]
nwrap: Add nss_wrapper_shadow_enabled() function

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Add shadow file parser
Andreas Schneider [Thu, 17 Sep 2015 08:33:58 +0000 (10:33 +0200)]
nwrap: Add shadow file parser

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Remove unused struct member in nwrap_main
Andreas Schneider [Thu, 17 Sep 2015 08:32:46 +0000 (10:32 +0200)]
nwrap: Remove unused struct member in nwrap_main

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Implement nwrap_files_initgroups()
Andreas Schneider [Fri, 11 Sep 2015 11:37:57 +0000 (13:37 +0200)]
nwrap: Implement nwrap_files_initgroups()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Remove unneeded memcpy in getgrouplist()
Andreas Schneider [Mon, 14 Sep 2015 12:57:40 +0000 (14:57 +0200)]
nwrap: Remove unneeded memcpy in getgrouplist()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Avoid a string comparsion in getgrouplist()
Andreas Schneider [Mon, 14 Sep 2015 12:52:51 +0000 (14:52 +0200)]
nwrap: Avoid a string comparsion in getgrouplist()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Use ssize_t for aliases_count
Robin Hack [Wed, 15 Jul 2015 13:00:02 +0000 (15:00 +0200)]
nwrap: Use ssize_t for aliases_count

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Prevent compilation failure on machine without IPv4
Robin Hack [Wed, 25 Mar 2015 08:36:10 +0000 (09:36 +0100)]
nwrap: Prevent compilation failure on machine without IPv4

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Replace free() calls by SAFE_FREE macro where possible.
Robin Hack [Sat, 29 Nov 2014 12:22:46 +0000 (13:22 +0100)]
nwrap: Replace free() calls by SAFE_FREE macro where possible.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonwrap: Fix the handle loops for older gcc versions.
Andreas Schneider [Wed, 1 Oct 2014 15:15:35 +0000 (17:15 +0200)]
nwrap: Fix the handle loops for older gcc versions.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agotorture: add torture comment output of name/ip to WinsBy{Ip,Name} tests
Michael Adam [Fri, 8 Jan 2016 23:19:03 +0000 (00:19 +0100)]
torture: add torture comment output of name/ip to WinsBy{Ip,Name} tests

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agotorture: Fix winbind.wbclient.ResolveWinsByIp test
Michael Adam [Fri, 18 Dec 2015 18:11:43 +0000 (19:11 +0100)]
torture: Fix winbind.wbclient.ResolveWinsByIp test

The test gets handed a name, so we first need
to resolve the name to an IP before we can
pass that on to ResolveWinsByIp.

Bug uncovered by the new nss_wrapper code (1.1.2).

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agotorture: fix check_pw_with_krb5 in the rpc:lsa test
Michael Adam [Thu, 17 Dec 2015 12:59:58 +0000 (13:59 +0100)]
torture: fix check_pw_with_krb5 in the rpc:lsa test

Don't use AI_NUMERICHOST for getaddrinfo.
This is so that a host*NAME* handed in will get properly resolved.
Bug uncovered by the new nss_wrapper code (1.1.2)  which fixed
the handling of the AI_NUMERICHOST flag in getaddrinfo.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agotorture: fix check_dom_trust_pw in the rpc:lsa test
Michael Adam [Thu, 17 Dec 2015 12:59:40 +0000 (13:59 +0100)]
torture: fix check_dom_trust_pw in the rpc:lsa test

This makes sure a host*NAME* handed in will get properly resolved.
Bug uncovered by the new nss_wrapper code (1.1.2) which fixed
the handling of the AI_NUMERICHOST flag in getaddrinfo.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agotorture: fix the ldap.netlogon-udp test
Michael Adam [Thu, 17 Dec 2015 12:58:12 +0000 (13:58 +0100)]
torture: fix the ldap.netlogon-udp test

This makes sure a host*NAME* handed in will get properly resolved.
Bug uncovered by the new nss_wrapper code (1.1.2) which fixed
the handling of the AI_NUMERICHOST flag in getaddrinfo.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agotorture: fix the ldap.cldap test
Michael Adam [Thu, 17 Dec 2015 12:56:16 +0000 (13:56 +0100)]
torture: fix the ldap.cldap test

This makes sure a host*NAME* handed in will get properly resolved.
Bug uncovered by the new nss_wrapper code (1.1.2) which fixed
the handling of the AI_NUMERICHOST flag in getaddrinfo.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agos3:wscript: fix spaces
Michael Adam [Sun, 10 Jan 2016 23:02:49 +0000 (00:02 +0100)]
s3:wscript: fix spaces

- replace tabs (of different length) by spaces
- remove trailing spaces

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Jan 11 05:04:28 CET 2016 on sn-devel-144

8 years agotldap: Use struct initializer in tldap_search
Volker Lendecke [Mon, 21 Dec 2015 20:29:13 +0000 (21:29 +0100)]
tldap: Use struct initializer in tldap_search

Avoids a call to ZERO_STRUCT

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Jan 11 01:31:59 CET 2016 on sn-devel-144

8 years agotldap: Avoid includes.h
Volker Lendecke [Mon, 21 Dec 2015 10:17:28 +0000 (11:17 +0100)]
tldap: Avoid includes.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agotldap.h: References DATA_BLOB
Volker Lendecke [Sun, 10 Jan 2016 11:00:52 +0000 (12:00 +0100)]
tldap.h: References DATA_BLOB

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agolib: Introduce util_tsock.h
Volker Lendecke [Mon, 21 Dec 2015 09:50:59 +0000 (10:50 +0100)]
lib: Introduce util_tsock.h

This avoids includes.h in source3/lib/util_tsock.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agotldap: tevent_req_create NULLs out "state"
Volker Lendecke [Tue, 22 Dec 2015 12:44:02 +0000 (13:44 +0100)]
tldap: tevent_req_create NULLs out "state"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agotldap: Use "size_t" for talloc_array_length result
Volker Lendecke [Sun, 10 Jan 2016 10:29:40 +0000 (11:29 +0100)]
tldap: Use "size_t" for talloc_array_length result

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agotldap: Remove an unneeded "return;"
Volker Lendecke [Sun, 10 Jan 2016 10:33:01 +0000 (11:33 +0100)]
tldap: Remove an unneeded "return;"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agotldap: Remove unneeded vars
Volker Lendecke [Sun, 27 Dec 2015 14:31:58 +0000 (15:31 +0100)]
tldap: Remove unneeded vars

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agosmbd: Fix 240393 Uninitialized pointer read
Volker Lendecke [Thu, 7 Jan 2016 20:33:18 +0000 (21:33 +0100)]
smbd: Fix 240393 Uninitialized pointer read

If we run into the "This is a stream on the root of the share" case,
in old line 409 (new line 417) we "goto done;". If then in old line 1027
(new line 1035) "build_stream_path" fails, "start" is uninitialized.

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): Fri Jan  8 05:44:15 CET 2016 on sn-devel-144

8 years agobind_dlz: Fix CID 1347318 Unchecked return value
Volker Lendecke [Thu, 7 Jan 2016 20:17:43 +0000 (21:17 +0100)]
bind_dlz: Fix CID 1347318 Unchecked return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoctdb: Fix CID 1347319 Unchecked return value
Volker Lendecke [Thu, 7 Jan 2016 20:14:05 +0000 (21:14 +0100)]
ctdb: Fix CID 1347319 Unchecked return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agosamdb: Fix CID 1347320 Dereference null return value
Volker Lendecke [Thu, 7 Jan 2016 20:10:24 +0000 (21:10 +0100)]
samdb: Fix CID 1347320 Dereference null return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agobuild: Add space before -D option
Andrew Bartlett [Tue, 5 Jan 2016 23:28:44 +0000 (12:28 +1300)]
build: Add space before -D option

This ensures that it is not concatonated with the previous option

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jan  8 02:36:47 CET 2016 on sn-devel-144

8 years agopython: Remove Python 2.4 support macros
Andrew Bartlett [Mon, 4 Jan 2016 00:23:50 +0000 (13:23 +1300)]
python: Remove Python 2.4 support macros

We require Python 2.6

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
8 years agontvfs/python: Adjust to use of PY_SSIZE_T_CLEAN
Andrew Bartlett [Mon, 4 Jan 2016 00:07:49 +0000 (13:07 +1300)]
ntvfs/python: Adjust to use of PY_SSIZE_T_CLEAN

This changes the type used for # arguments to PyArg_ParseTuple

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
8 years agopyrpc: Adjust to use of PY_SSIZE_T_CLEAN
Andrew Bartlett [Mon, 4 Jan 2016 00:07:08 +0000 (13:07 +1300)]
pyrpc: Adjust to use of PY_SSIZE_T_CLEAN

This changes the type used for # arguments to PyArg_ParseTupleAndKeywords

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
8 years agopyregistry: Adjust to use of PY_SSIZE_T_CLEAN
Andrew Bartlett [Mon, 4 Jan 2016 00:06:31 +0000 (13:06 +1300)]
pyregistry: Adjust to use of PY_SSIZE_T_CLEAN

This changes the type used for # arguments to PyArg_ParseTuple

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
8 years agopymessaging: Adjust to use of PY_SSIZE_T_CLEAN
Andrew Bartlett [Mon, 4 Jan 2016 00:05:44 +0000 (13:05 +1300)]
pymessaging: Adjust to use of PY_SSIZE_T_CLEAN

This changes the type used for # arguments to PyArg_ParseTupleAndKeywords

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
8 years agopylibsmb: Adjust to use of PY_SSIZE_T_CLEAN
Andrew Bartlett [Mon, 4 Jan 2016 00:04:46 +0000 (13:04 +1300)]
pylibsmb: Adjust to use of PY_SSIZE_T_CLEAN

This changes the type used for # arguments to PyArg_ParseTupleAndKeywords

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
8 years agopidl: Use PY_SSIZE_T_CLEAN
Andrew Bartlett [Mon, 4 Jan 2016 00:03:39 +0000 (13:03 +1300)]
pidl: Use PY_SSIZE_T_CLEAN

This changes the type used for # arguments to PyArg_ParseTupleAndKeywords

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
8 years agoldb: Adjust to PY_SSIZE_T_CLEAN and use Py_ssize_t consistently with PyArg_ParseTuple*()
Andrew Bartlett [Sun, 3 Jan 2016 23:42:06 +0000 (12:42 +1300)]
ldb: Adjust to PY_SSIZE_T_CLEAN and  use Py_ssize_t consistently with PyArg_ParseTuple*()

This was inconsistent after dd7baa2ae2f98d5c1e82fa97f223925025da5ca0,
and may be the cause of test errors on s390x.  (The change to
py_ldb_dn_set_component() kept the Py_ssize_t type for 'size' without
setting the PY_SSIZE_T_CLEAN macro to have PyArg_ParseTuple() expect
a Py_ssize_t.  Instead, PyArg_ParseTuple() expected an int.

See in particular debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808769

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
8 years agopython: Assert that we use Py_ssize_t consistently for PyParseArgs*()
Andrew Bartlett [Tue, 5 Jan 2016 22:57:39 +0000 (11:57 +1300)]
python: Assert that we use Py_ssize_t consistently for PyParseArgs*()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
8 years agoasn1: Clean up includes
Volker Lendecke [Tue, 5 Jan 2016 21:00:58 +0000 (22:00 +0100)]
asn1: Clean up includes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Jan  7 19:12:22 CET 2016 on sn-devel-144

8 years agosmbcontrol: Use procid_is_local
Volker Lendecke [Wed, 14 Oct 2015 09:49:57 +0000 (11:49 +0200)]
smbcontrol: Use procid_is_local

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agonet: Use procid_is_local
Volker Lendecke [Wed, 14 Oct 2015 09:49:57 +0000 (11:49 +0200)]
net: Use procid_is_local

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agos3: smbclient: asn1_extract_blob() stops further asn1 processing by setting has_error.
Jeremy Allison [Wed, 6 Jan 2016 23:03:47 +0000 (15:03 -0800)]
s3: smbclient: asn1_extract_blob() stops further asn1 processing by setting has_error.

Don't call asn1_has_error() after asn1_extract_blob() has been successful
otherwise we get an "Failed to build negTokenInit at offset" message
on success.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jan  7 16:00:02 CET 2016 on sn-devel-144

8 years agodocs:smbdotconf: fix the description of 'machine password timeout'
Michael Adam [Wed, 6 Jan 2016 22:38:23 +0000 (23:38 +0100)]
docs:smbdotconf: fix the description of 'machine password timeout'

This parameter also covers 'security = ads'.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agoselftest: Add tests for ntlm-server-1 and --password mode in ntlm_auth
Andrew Bartlett [Thu, 7 Jan 2016 03:06:20 +0000 (16:06 +1300)]
selftest: Add tests for ntlm-server-1 and --password mode in ntlm_auth

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): Thu Jan  7 07:41:22 CET 2016 on sn-devel-144

8 years agontlm_auth: Allow --password force a local password check for ntlm-server-1 mode
Andrew Bartlett [Wed, 6 Jan 2016 23:33:11 +0000 (12:33 +1300)]
ntlm_auth: Allow --password force a local password check for ntlm-server-1 mode

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
8 years agos3:smbd/oplock obey kernel oplock setting when releasing oplocks
Christian Ambach [Mon, 4 Jan 2016 22:12:25 +0000 (23:12 +0100)]
s3:smbd/oplock obey kernel oplock setting when releasing oplocks

otherwise smbd asks the kernel to release an oplock that was never requested

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan  6 08:58:56 CET 2016 on sn-devel-144

8 years agoselftest: more dfree command and smbclient disk usage tests
Uri Simchoni [Tue, 5 Jan 2016 22:12:36 +0000 (00:12 +0200)]
selftest: more dfree command and smbclient disk usage tests

Add tests that cover disk usage printing by smbclient, as well
as passing directory info to the "dfree command" script.

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

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): Wed Jan  6 03:58:59 CET 2016 on sn-devel-144

8 years agosmbclient: query disk usage relative to current directory
Uri Simchoni [Tue, 5 Jan 2016 22:08:25 +0000 (00:08 +0200)]
smbclient: query disk usage relative to current directory

When querying disk usage in the "dir" and "du" commands,
use the current directory. This behavior is compatible
with Windows command shell "dir" command.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoasn1: Make 'struct asn1_data' private
Volker Lendecke [Sun, 3 Jan 2016 20:26:50 +0000 (21:26 +0100)]
asn1: Make 'struct asn1_data' private

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoasn1: Remove a reference to asn1_data internals
Volker Lendecke [Mon, 4 Jan 2016 09:42:11 +0000 (10:42 +0100)]
asn1: Remove a reference to asn1_data internals

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolibcli: Remove a reference to asn1->ofs
Volker Lendecke [Mon, 4 Jan 2016 09:30:35 +0000 (10:30 +0100)]
libcli: Remove a reference to asn1->ofs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Use asn1_current_ofs()
Volker Lendecke [Tue, 5 Jan 2016 09:55:44 +0000 (10:55 +0100)]
lib: Use asn1_current_ofs()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoasn1: Add asn1_current_ofs()
Volker Lendecke [Mon, 4 Jan 2016 09:25:41 +0000 (10:25 +0100)]
asn1: Add asn1_current_ofs()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Use asn1_has_nesting
Volker Lendecke [Mon, 4 Jan 2016 09:24:01 +0000 (10:24 +0100)]
lib: Use asn1_has_nesting

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoasn1: Add asn1_has_nesting
Volker Lendecke [Mon, 4 Jan 2016 09:23:20 +0000 (10:23 +0100)]
asn1: Add asn1_has_nesting

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Use asn1_extract_blob()
Volker Lendecke [Sat, 2 Jan 2016 19:10:53 +0000 (20:10 +0100)]
lib: Use asn1_extract_blob()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoasn1: Add asn1_extract_blob()
Volker Lendecke [Mon, 4 Jan 2016 20:53:23 +0000 (21:53 +0100)]
asn1: Add asn1_extract_blob()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Use asn1_set_error()
Volker Lendecke [Mon, 4 Jan 2016 20:51:07 +0000 (21:51 +0100)]
lib: Use asn1_set_error()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoasn1: Add asn1_set_error()
Volker Lendecke [Mon, 4 Jan 2016 20:50:49 +0000 (21:50 +0100)]
asn1: Add asn1_set_error()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agolib: Use asn1_has_error()
Volker Lendecke [Sat, 2 Jan 2016 17:11:00 +0000 (18:11 +0100)]
lib: Use asn1_has_error()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoasn1: Add asn1_has_error()
Volker Lendecke [Sat, 2 Jan 2016 16:58:21 +0000 (17:58 +0100)]
asn1: Add asn1_has_error()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoasn1: Make "struct nesting" private
Volker Lendecke [Sun, 27 Dec 2015 10:18:47 +0000 (11:18 +0100)]
asn1: Make "struct nesting" private

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoasn1: Add some early returns
Volker Lendecke [Sun, 27 Dec 2015 09:57:07 +0000 (10:57 +0100)]
asn1: Add some early returns

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoasn1: Add overflow check to asn1_write
Volker Lendecke [Tue, 22 Dec 2015 12:50:54 +0000 (13:50 +0100)]
asn1: Add overflow check to asn1_write

Found by pure code reading :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoasn1: Make asn1_peek_full_tag return 0/errno
Volker Lendecke [Mon, 21 Dec 2015 09:41:39 +0000 (10:41 +0100)]
asn1: Make asn1_peek_full_tag return 0/errno

We don't need the full power of NTSTATUS here. This was the only
NTSTATUS in asn1.h, so I think it's worth removing it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoasn1: Remove an unused asn1 function
Volker Lendecke [Sun, 20 Dec 2015 20:49:26 +0000 (21:49 +0100)]
asn1: Remove an unused asn1 function

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoldb: validate ldb_dn_set_component input parameters even more strictly
Andrew Bartlett [Sun, 3 Jan 2016 23:13:40 +0000 (12:13 +1300)]
ldb: validate ldb_dn_set_component input parameters even more strictly

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jan  6 00:33:21 CET 2016 on sn-devel-144

8 years agoldb: Explain why this use of talloc_memdup() is safe
Andrew Bartlett [Sun, 3 Jan 2016 23:13:04 +0000 (12:13 +1300)]
ldb: Explain why this use of talloc_memdup() is safe

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
8 years agoldb: Be strict about talloc_memdup() and passed in buffers in ldb_dn_set_component()
Andrew Bartlett [Sun, 3 Jan 2016 23:12:37 +0000 (12:12 +1300)]
ldb: Be strict about talloc_memdup() and passed in buffers in ldb_dn_set_component()

This ensures we do not over-read the source buffer, but still NUL terminate.

This may be related to debuain bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808769

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
8 years agotravis: Add metadata file for the Travis CI Open Source cloud build/test service
Andrew Bartlett [Mon, 4 May 2015 01:44:45 +0000 (13:44 +1200)]
travis: Add metadata file for the Travis CI Open Source cloud build/test service

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan  5 12:21:40 CET 2016 on sn-devel-144

8 years agoautobuild: Use make -j on samba-libs/samba-static build as well
Andrew Bartlett [Thu, 22 Oct 2015 01:57:10 +0000 (14:57 +1300)]
autobuild: Use make -j on samba-libs/samba-static build as well

We need this build to be fast when split out as a seperate VM

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoautobuild: Put the static build in another stanza
Andrew Bartlett [Wed, 21 Oct 2015 21:35:47 +0000 (10:35 +1300)]
autobuild: Put the static build in another stanza

This will allow it to run on a different VM in travis-ci and so keep
us below the 50min limit.

Because we do not rebuild the libs (and real world static builds are
likely to have internal libs), this changes us to build them
internally.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoautobuild: Use cp --recursive --link --archive
Andrew Bartlett [Mon, 4 Jan 2016 01:20:54 +0000 (14:20 +1300)]
autobuild: Use cp --recursive --link --archive

This works on waf based builds as source files are not modified during the build

TODO: In order to make sure build doesn't influence each other,
we need to add something like:

         try:
             if options.rebase is not None:
                 rebase_tree(options.rebase, rebase_branch=options.branch)
+            run_cmd("find -type f | xargs chmod -w", show=True, dir=test_master)
         except Exception:

But that means we need to change the way 'make distcheck' works for the
standalone libraries.

For now this will help to reduce the (mem)disk usage of an autobuild a lot.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoautobuild: Give a clearer failure message
Andrew Bartlett [Wed, 21 Oct 2015 01:35:33 +0000 (14:35 +1300)]
autobuild: Give a clearer failure message

This helps when autobuild.py is used in --tail mode and
where there is neither e-mail nor access to the logs.tar.gz

Working back to find where the error happened is typically
quite difficult, as many failures are actually due to the
cleanup.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agobuild:wafsamba: Use the upstream version of gccdeps
Thomas Nagy [Sat, 5 Dec 2015 11:09:33 +0000 (12:09 +0100)]
build:wafsamba: Use the upstream version of gccdeps

This removes the duplicate gccdeps file provided in the Samba tree.
The two files buildtools/wafsamba/gccdeps.py and thirdparty/wafadmin/3rdparty/gccdeps.py
are identical except for the whitespaces (compare them with `diff -burN`)

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Sat Jan  2 22:31:56 CET 2016 on sn-devel-144

8 years agothirdparty:waf: Update gccdeps from upstream
Thomas Nagy [Sat, 5 Dec 2015 11:04:29 +0000 (12:04 +0100)]
thirdparty:waf: Update gccdeps from upstream

The version from upstream was updated. It is not used at this moment
in Samba because there is a copy kept in builtools/wafsamba/gccdeps.py
which will be removed soon.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>