samba.git
5 years agos3:rpc_server/fss: use talloc_stackframe() for temporary memory
Stefan Metzmacher [Thu, 24 May 2018 14:41:32 +0000 (16:41 +0200)]
s3:rpc_server/fss: use talloc_stackframe() for temporary memory

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: make use of create_conn_struct_tos() in get_nt_acl_no_snum()
Stefan Metzmacher [Thu, 24 May 2018 14:34:04 +0000 (16:34 +0200)]
smbd: make use of create_conn_struct_tos() in get_nt_acl_no_snum()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agopysmbd: make use of create_conn_struct_tos()
Stefan Metzmacher [Thu, 24 May 2018 14:16:19 +0000 (16:16 +0200)]
pysmbd: make use of create_conn_struct_tos()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agopysmbd: remove explicit talloc_stackframe() from get_conn() and name it get_conn_tos()
Stefan Metzmacher [Thu, 24 May 2018 14:16:19 +0000 (16:16 +0200)]
pysmbd: remove explicit talloc_stackframe() from get_conn() and name it get_conn_tos()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agopysmbd: fix some talloc_stackframe() memory leaks and clean up the frame hierarchy...
Stefan Metzmacher [Thu, 24 May 2018 14:16:19 +0000 (16:16 +0200)]
pysmbd: fix some talloc_stackframe() memory leaks and clean up the frame hierarchy in make_simple_acl().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agopysmbd: consitently use talloc_stackframe() for temporary memory
Stefan Metzmacher [Thu, 24 May 2018 14:16:19 +0000 (16:16 +0200)]
pysmbd: consitently use talloc_stackframe() for temporary memory

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agopysmbd: remove useless explicit conn_free() from set_nt_acl_conn()
Stefan Metzmacher [Fri, 25 May 2018 05:38:24 +0000 (07:38 +0200)]
pysmbd: remove useless explicit conn_free() from set_nt_acl_conn()

The following TALLOC_FREE(frame); will do the same via
conn_free_wrapper().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: add create_conn_struct_tos[_cwd]() helper functions
Stefan Metzmacher [Thu, 24 May 2018 13:59:43 +0000 (15:59 +0200)]
smbd: add create_conn_struct_tos[_cwd]() helper functions

This makes it more obvious that the returned connection_struct
is only temporary (and allocated on talloc_tos()!)
It will never allow async requests on a long term
tevent context! So we create a short term event context.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoprinting: remove unused arguments from delete_and_reload_printers()
Stefan Metzmacher [Wed, 23 May 2018 14:35:20 +0000 (16:35 +0200)]
printing: remove unused arguments from delete_and_reload_printers()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoprinting: remove unused arguments from load_printers()
Stefan Metzmacher [Wed, 23 May 2018 14:35:20 +0000 (16:35 +0200)]
printing: remove unused arguments from load_printers()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoCID 1416475: possibly dereferencing NULL in fruit_pread_meta
Swen Schillig [Fri, 25 May 2018 10:45:35 +0000 (12:45 +0200)]
CID 1416475: possibly dereferencing NULL in fruit_pread_meta

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Jun 13 16:29:48 CEST 2018 on sn-devel-144

5 years agoCID 1416476: possibly dereferencing NULL in fruit_ftruncate_rsrc
Swen Schillig [Fri, 25 May 2018 10:43:42 +0000 (12:43 +0200)]
CID 1416476: possibly dereferencing NULL in fruit_ftruncate_rsrc

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agoCID 1416477: possibly dereferencing NULL in fruit_pwrite_meta
Swen Schillig [Fri, 25 May 2018 09:39:50 +0000 (11:39 +0200)]
CID 1416477: possibly dereferencing NULL in fruit_pwrite_meta

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agoCID 1416478: de-ref NULL value in fruit_pwrite_rsrc
Swen Schillig [Fri, 25 May 2018 09:32:38 +0000 (11:32 +0200)]
CID 1416478: de-ref NULL value in fruit_pwrite_rsrc

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agodsdb: Fix CID 1435968 Dereference before null check
Volker Lendecke [Tue, 12 Jun 2018 19:31:15 +0000 (21:31 +0200)]
dsdb: Fix CID 1435968 Dereference before null check

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jun 13 13:40:56 CEST 2018 on sn-devel-144

5 years agodsdb: Fix CID 1435966 Unchecked return value
Volker Lendecke [Tue, 12 Jun 2018 19:22:10 +0000 (21:22 +0200)]
dsdb: Fix CID 1435966 Unchecked return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodsdb: Fix typos
Volker Lendecke [Tue, 12 Jun 2018 19:18:18 +0000 (21:18 +0200)]
dsdb: Fix typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodsdb: Fix CID 1436918 Unchecked return value
Volker Lendecke [Tue, 12 Jun 2018 19:15:55 +0000 (21:15 +0200)]
dsdb: Fix CID 1436918 Unchecked return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodsdb: Fix CID 1436919 Unchecked return value
Volker Lendecke [Tue, 12 Jun 2018 19:12:47 +0000 (21:12 +0200)]
dsdb: Fix CID 1436919 Unchecked return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodsdb: Fix CID 1436920 Unchecked return value
Volker Lendecke [Tue, 12 Jun 2018 19:09:40 +0000 (21:09 +0200)]
dsdb: Fix CID 1436920 Unchecked return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoFix UDP DNS queries in addns
Timur I. Bakeyev [Mon, 11 Jun 2018 20:38:00 +0000 (04:38 +0800)]
Fix UDP DNS queries in addns

The addns code tries to use common approach for TCP and UDP queries,
calling connect() for both types of sockets. In case of UDP that
requires to use send() instead of sendto().

Signed-off-by: Timur I. Bakeyev <timur@iXsystems.com>
Reviewed-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 Jun 13 03:51:04 CEST 2018 on sn-devel-144

5 years agopython: call fault_setup() if samba.getopt is used
Stefan Metzmacher [Fri, 25 May 2018 05:52:40 +0000 (07:52 +0200)]
python: call fault_setup() if samba.getopt is used

This means we have a samba command line tool written in python,
e.g. samba-tool

We should get the samba typicall backtraces instead of
just "Segmentation fault (core dumped)".

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

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): Tue Jun 12 11:04:55 CEST 2018 on sn-devel-144

5 years agopython: export fault_setup() to python bindings
Stefan Metzmacher [Fri, 25 May 2018 05:52:02 +0000 (07:52 +0200)]
python: export fault_setup() to python bindings

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agopython/drs_utils: fix repeated typo
Douglas Bagnall [Fri, 8 Jun 2018 03:36:39 +0000 (15:36 +1200)]
python/drs_utils: fix repeated typo

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Jun 10 21:41:33 CEST 2018 on sn-devel-144

5 years agopython/join: fix a typo
Douglas Bagnall [Thu, 7 Jun 2018 08:11:26 +0000 (20:11 +1200)]
python/join: fix a typo

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosambatool visualize: add up-to-dateness visualization
Douglas Bagnall [Fri, 1 Jun 2018 05:20:56 +0000 (17:20 +1200)]
sambatool visualize: add up-to-dateness visualization

Or more accurately, out-of-dateness visualization, which shows how far
each DCs is from every other using the difference in the up-to-dateness
vectors.

An example usage is

samba-tool visualize uptodateness -r -S -H ldap://somewhere \
      -UAdministrator --color=auto --partition=DOMAIN

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosamba-tool visualize ntdsconn: properly sort/group vertices
Douglas Bagnall [Fri, 1 Jun 2018 05:14:32 +0000 (17:14 +1200)]
samba-tool visualize ntdsconn: properly sort/group vertices

The vertex is now a tuple, with the RODC state added.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosamba-tool visualize: fix wrong variable name in get_partition()
Douglas Bagnall [Tue, 6 Mar 2018 22:40:00 +0000 (11:40 +1300)]
samba-tool visualize: fix wrong variable name in get_partition()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agopython/graph: don't crash colourer on bad link
Douglas Bagnall [Fri, 1 Jun 2018 04:55:37 +0000 (16:55 +1200)]
python/graph: don't crash colourer on bad link

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agopython/graph: use '>' for excessive numbers, not '+'
Douglas Bagnall [Fri, 1 Jun 2018 04:51:19 +0000 (16:51 +1200)]
python/graph: use '>' for excessive numbers, not '+'

'+' already has another meaning in these graphs.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agopython/graph: add full_matrix graph function
Douglas Bagnall [Fri, 1 Jun 2018 04:48:34 +0000 (16:48 +1200)]
python/graph: add full_matrix graph function

This makes an ASCII/ANSI art picture like distance_matrix(), but from
a full matrix, not a list of adjacencies as in the distance_matrix case.

This will be used to visualise up-to-dateness vectors.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agopython/graph: rework shorten_vertex_names to not need edges
Douglas Bagnall [Fri, 1 Jun 2018 04:39:19 +0000 (16:39 +1200)]
python/graph: rework shorten_vertex_names to not need edges

This will be necessary for the forthcoming full_matrix function.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agopython/samba/graph: use look up table for ascii-art charsets
Douglas Bagnall [Tue, 15 May 2018 10:26:43 +0000 (22:26 +1200)]
python/samba/graph: use look up table for ascii-art charsets

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosamba-tool visualize: separate dot options from common options
Douglas Bagnall [Thu, 24 May 2018 03:22:47 +0000 (15:22 +1200)]
samba-tool visualize: separate dot options from common options

because not all sub-commands make dot format

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosamba-tool visualise: helper for getting the partition
Douglas Bagnall [Thu, 29 Mar 2018 02:52:25 +0000 (15:52 +1300)]
samba-tool visualise: helper for getting the partition

Repeated code becomes a function.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agopython/graph: tweak colour schemes for distance charts
Douglas Bagnall [Thu, 24 May 2018 02:42:37 +0000 (14:42 +1200)]
python/graph: tweak colour schemes for distance charts

This works a bit better in terminals with white text.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosamba-tool drs showrepl: add a --verbose flag
Douglas Bagnall [Thu, 7 Jun 2018 02:35:38 +0000 (14:35 +1200)]
samba-tool drs showrepl: add a --verbose flag

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosamba-tool drs showrepl: generalise the way output mode is chosen
Douglas Bagnall [Fri, 9 Mar 2018 03:16:23 +0000 (16:16 +1300)]
samba-tool drs showrepl: generalise the way output mode is chosen

We have a couple more output modes coming along, so it makes senses to
untangle .run() into a number of independent sub-methods.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosamba-tool drs showrepl tests: don't assert existence of DNS partitions
Douglas Bagnall [Sat, 9 Jun 2018 08:35:30 +0000 (20:35 +1200)]
samba-tool drs showrepl tests: don't assert existence of DNS partitions

Because their existence is uncertain immediately after provision,
when these tests will run under some circumstances.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agopython/kcc/graph_utils: short-cut edge failure test without edges
Douglas Bagnall [Sat, 9 Jun 2018 08:07:37 +0000 (20:07 +1200)]
python/kcc/graph_utils: short-cut edge failure test without edges

Otherwise we get an exception because itertools.combinations is asked
to find combinations with negative size.

Instead we assert the graph is connected as-is, which in this case is
the same as asserting there are no vertices.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolib/audit_logging fix flapping test
Gary Lockyer [Sat, 9 Jun 2018 12:58:51 +0000 (14:58 +0200)]
lib/audit_logging fix flapping test

Add an adjustment to the before and after values to cater for the
occasional differences between the calculated times.

The exact value of the time stamp is not important what is important is
that is correctly formatted and that the value is reasonable i.e. it's
close enough to the current time.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodsdb: Use ldb_init() to make the ldb_context in dsdb audit tests
Andrew Bartlett [Thu, 7 Jun 2018 07:50:15 +0000 (09:50 +0200)]
dsdb: Use ldb_init() to make the ldb_context in dsdb audit tests

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Jun  9 17:42:38 CEST 2018 on sn-devel-144

5 years agodsdb: add defines for sessionInfo and networkSessionInfo
Gary Lockyer [Thu, 31 May 2018 03:12:46 +0000 (15:12 +1200)]
dsdb: add defines for sessionInfo and networkSessionInfo

Replace uses of the string "sessionInfo" with the constant
DSDB_SESSION_INFO, and "networkSessionInfo" with the constant
DSDB_NETWORK_SESSION_INFO.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodsdb: Audit group membership changes
Gary Lockyer [Mon, 16 Apr 2018 02:03:14 +0000 (14:03 +1200)]
dsdb: Audit group membership changes

Log details of Group membership changes and User Primary Group changes.
Changes are logged in human readable and if samba has been built with
JANSSON support in JSON format.

Replicated updates are not logged.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodsdb: audit samdb and password changes
Gary Lockyer [Tue, 3 Apr 2018 23:59:41 +0000 (11:59 +1200)]
dsdb: audit samdb and password changes

Add audit logging of DSDB operations and password changes, log messages
are logged in human readable format and if samba is commpile with
JANSSON support in JSON format.

Log:
  * Details all DSDB add, modify and delete operations. Logs
    attributes, values, session details, transaction id.
  * Transaction roll backs.
  * Prepare commit and commit failures.
  * Summary details of replicated updates.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4-heimdal: Fix the format-truncation errors.
Günther Deschner [Wed, 30 May 2018 07:27:49 +0000 (09:27 +0200)]
s4-heimdal: Fix the format-truncation errors.

../source4/heimdal/lib/com_err/compile_et.c: In function ‘generate_h’:
../source4/heimdal/lib/com_err/compile_et.c:138:33: error: ‘%s’ directive output may be truncated writing up to 127 bytes into a region of size 126 [-Werror=format-truncation=]
     snprintf(fn, sizeof(fn), "__%s__", hfn);
                                 ^~     ~~~
../source4/heimdal/lib/com_err/compile_et.c:138:5: note: ‘snprintf’ output between 5 and 132 bytes into a destination of size 128
     snprintf(fn, sizeof(fn), "__%s__", hfn);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../source4/heimdal/lib/com_err/compile_et.c: In function ‘main’:
../source4/heimdal/lib/com_err/compile_et.c:234:35: error: ‘.h’ directive output may be truncated writing 2 bytes into a region of size between 1 and 128 [-Werror=format-truncation=]
     snprintf(hfn, sizeof(hfn), "%s.h", Basename);
                                   ^~
../source4/heimdal/lib/com_err/compile_et.c:234:5: note: ‘snprintf’ output between 3 and 130 bytes into a destination of size 128
     snprintf(hfn, sizeof(hfn), "%s.h", Basename);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../source4/heimdal/lib/com_err/compile_et.c:235:35: error: ‘.c’ directive output may be truncated writing 2 bytes into a region of size between 1 and 128 [-Werror=format-truncation=]
     snprintf(cfn, sizeof(cfn), "%s.c", Basename);
                                   ^~
../source4/heimdal/lib/com_err/compile_et.c:235:5: note: ‘snprintf’ output between 3 and 130 bytes into a destination of size 128
     snprintf(cfn, sizeof(cfn), "%s.c", Basename);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

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

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jun  8 13:23:51 CEST 2018 on sn-devel-144

5 years agoWHATSNEW.txt: Updated with VFS ABI changes for 4.9.0.
Jeremy Allison [Thu, 7 Jun 2018 07:47:30 +0000 (00:47 -0700)]
WHATSNEW.txt: Updated with VFS ABI changes for 4.9.0.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Thu Jun  7 13:48:25 CEST 2018 on sn-devel-144

5 years agotests/demote: replace demote test bash script to python
Joe Guo [Wed, 6 Jun 2018 03:01:28 +0000 (15:01 +1200)]
tests/demote: replace demote test bash script to python

Convert bash script to python and add demote and dns remove test on top.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Thu Jun  7 04:21:17 CEST 2018 on sn-devel-144

5 years agonetcmd/domain: remove dns records after DC demote
Joe Guo [Tue, 5 Jun 2018 22:38:11 +0000 (10:38 +1200)]
netcmd/domain: remove dns records after DC demote

Call `remove_dc.remove_dns_references()` at the end of demote cmd.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
5 years agonetcmd/domain: fix a typo in message
Joe Guo [Tue, 5 Jun 2018 22:37:20 +0000 (10:37 +1200)]
netcmd/domain: fix a typo in message

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
5 years agoctdb-daemon: CID 1435732: Argument cannot be negative
Swen Schillig [Fri, 25 May 2018 06:23:17 +0000 (08:23 +0200)]
ctdb-daemon: CID 1435732: Argument cannot be negative

Negative parameter passed to function which cannot take negative values.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Jun  6 01:13:18 CEST 2018 on sn-devel-144

5 years agoctdb-common: Add support to run events through failure
Amitay Isaacs [Thu, 17 May 2018 03:32:37 +0000 (13:32 +1000)]
ctdb-common: Add support to run events through failure

Usually run_event will stop executing event scripts on first failure.
Optionally it can continue to run events even on failure(s).

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb-common: Reset running state on failure
Amitay Isaacs [Thu, 10 May 2018 08:49:06 +0000 (18:49 +1000)]
ctdb-common: Reset running state on failure

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb-common: Improve error handling in run_event
Amitay Isaacs [Thu, 10 May 2018 06:50:35 +0000 (16:50 +1000)]
ctdb-common: Improve error handling in run_event

If event script directory does not exist, then return ENOTDIR.  If a
directory gets removed at runtime, report error from scandir in
get_script_list().

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb-common: Return script_list for zero scripts
Amitay Isaacs [Thu, 10 May 2018 02:43:24 +0000 (12:43 +1000)]
ctdb-common: Return script_list for zero scripts

When an event script directory is empty, do not return script_list as
NULL.  Instead return empty script_list with zero scripts.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb-common: Rename run_event_script_list to run_event_list
Amitay Isaacs [Thu, 10 May 2018 03:50:01 +0000 (13:50 +1000)]
ctdb-common: Rename run_event_script_list to run_event_list

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb-common: Do not initialize run_proc inside run_event
Amitay Isaacs [Wed, 9 May 2018 06:42:40 +0000 (16:42 +1000)]
ctdb-common: Do not initialize run_proc inside run_event

Allowing run_event_init() to take run_proc_context as an argument allows
to create multiple run_event instances with a single run_proc_context.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb-common: Simplify process registration using linked list
Amitay Isaacs [Wed, 9 May 2018 04:07:35 +0000 (14:07 +1000)]
ctdb-common: Simplify process registration using linked list

The way run_proc abstraction is used in run_event, there can be maximum
of 2 processes active at any given time.  So the memory requirements
can be reduced by using a linked list.

New eventd will have multiple run_event instances but will be limited to
3 or 4.  Even then the total number of processes will be less than 10.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb-tests: Continue running if a testcase is not executable
Martin Schwenke [Fri, 18 May 2018 01:44:11 +0000 (11:44 +1000)]
ctdb-tests: Continue running if a testcase is not executable

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): Tue Jun  5 20:37:15 CEST 2018 on sn-devel-144

5 years agoRevert "ctdb-tests: Continue running if a testcase is not executable"
Martin Schwenke [Fri, 18 May 2018 01:39:49 +0000 (11:39 +1000)]
Revert "ctdb-tests: Continue running if a testcase is not executable"

This reverts commit 36e7043fb16ac996793545022147f696caedee9c.

An recent change broke this and I forgot to test before posting. :-(

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-scripts: Change directory for notifications to events/notification
Martin Schwenke [Wed, 16 May 2018 02:18:46 +0000 (12:18 +1000)]
ctdb-scripts: Change directory for notifications to events/notification

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-scripts: Event scripts must end with ".script" suffix
Martin Schwenke [Tue, 15 May 2018 08:36:29 +0000 (18:36 +1000)]
ctdb-scripts: Event scripts must end with ".script" suffix

Preparation for recommending configuration for each script next to the
actual script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-scripts: Move event scripts to events/legacy/ directory
Martin Schwenke [Tue, 15 May 2018 03:39:15 +0000 (13:39 +1000)]
ctdb-scripts: Move event scripts to events/legacy/ directory

This is the initial location that will be used by the new
multi-component aware event daemon.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodsdb: Honour LDB_FLG_NOSYNC for metadata.tdb
Andrew Bartlett [Sun, 3 Jun 2018 06:36:47 +0000 (18:36 +1200)]
dsdb: Honour LDB_FLG_NOSYNC for metadata.tdb

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jun  4 20:58:01 CEST 2018 on sn-devel-144

5 years agopyldb-samba: Use the same smb.conf variable name as the C wrapper users for LDB_FLG_N...
Andrew Bartlett [Sun, 3 Jun 2018 06:35:15 +0000 (18:35 +1200)]
pyldb-samba: Use the same smb.conf variable name as the C wrapper users for LDB_FLG_NOSYNC

This was never noticed as most wrappers on make test run with TDB_NO_FSYNC

However ldb_mdb has not been told to use this (naturally) and so we rely
on the smb.conf setting to not force an fsync().

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoctdb-docs: Update reference to lmaster/recmaster capability options
Martin Schwenke [Mon, 4 Jun 2018 05:13:59 +0000 (15:13 +1000)]
ctdb-docs: Update reference to lmaster/recmaster capability options

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 Jun  4 12:37:39 CEST 2018 on sn-devel-144

5 years agos3: VFS: Remove unused enum value.
Jeremy Allison [Fri, 1 Jun 2018 22:08:36 +0000 (15:08 -0700)]
s3: VFS: Remove unused enum value.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Jun  2 03:03:42 CEST 2018 on sn-devel-144

5 years agos3: smbd: printing: Re-implement delete-on-close semantics for print files missing...
Jeremy Allison [Thu, 31 May 2018 17:35:48 +0000 (10:35 -0700)]
s3: smbd: printing: Re-implement delete-on-close semantics for print files missing since 3.5.x.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun  1 20:32:03 CEST 2018 on sn-devel-144

5 years agos3: torture: Add DELETE-PRINT test.
Jeremy Allison [Thu, 31 May 2018 17:18:21 +0000 (10:18 -0700)]
s3: torture: Add DELETE-PRINT test.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agodns: Check for talloc_memdup failure
Volker Lendecke [Thu, 31 May 2018 19:16:21 +0000 (21:16 +0200)]
dns: Check for talloc_memdup failure

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jun  1 14:05:56 CEST 2018 on sn-devel-144

5 years agodns: TALLOC_FREE already checks for !=NULL
Volker Lendecke [Thu, 31 May 2018 19:11:16 +0000 (21:11 +0200)]
dns: TALLOC_FREE already checks for !=NULL

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agodns: Simplify logic a bit
Volker Lendecke [Thu, 31 May 2018 18:57:36 +0000 (20:57 +0200)]
dns: Simplify logic a bit

We don't need a separate boolean variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agodns: Simplify logic a bit
Volker Lendecke [Thu, 31 May 2018 18:56:31 +0000 (20:56 +0200)]
dns: Simplify logic a bit

We've done an early return if (!found_tsig) a few lines before.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agodnsupdate: Fix a typo
Volker Lendecke [Wed, 30 May 2018 15:24:35 +0000 (17:24 +0200)]
dnsupdate: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoldb: Fix memory leak on module context
Lukas Slebodnik [Sat, 21 Oct 2017 13:09:01 +0000 (15:09 +0200)]
ldb: Fix memory leak on module context

Introduced in e8cdacc509016d9273d63faf334d9f827585c3eb

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

Signed-off-by: Lukas Slebodnik <lslebodn@fedoraproject.org>
Reviewed-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): Fri Jun  1 11:10:24 CEST 2018 on sn-devel-144

5 years agolib/audit_logging: Remove #ifdef HAVE_JANSSON from audit_logging_test binary
Andrew Bartlett [Thu, 31 May 2018 18:42:24 +0000 (06:42 +1200)]
lib/audit_logging: Remove #ifdef HAVE_JANSSON from audit_logging_test binary

Instead, we either build or do not build the entire binary.

This is much more likely to raise an error in make test if the build system
changes.  The concern is that HAVE_JANSSON can go away and the tests just vanish.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agolib/audit_logging: Make function prototypes look like the rest of Samba
Andrew Bartlett [Thu, 31 May 2018 20:56:53 +0000 (08:56 +1200)]
lib/audit_logging: Make function prototypes look like the rest of Samba

The previous style is needed sometimes to avoid an 80-col limit, but
is not how most of Samba looks.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agolib audit_logging: re-factor and add functions.
Gary Lockyer [Wed, 16 May 2018 20:03:00 +0000 (08:03 +1200)]
lib audit_logging: re-factor and add functions.

Re-factor the common calls to json_dumps DEBUGC and audit_message_send
into a separate function.
Add functions to retrieve json object and json array elements

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4-torture: add test for lease break after file unlink
Sachin Prabhu [Fri, 20 Apr 2018 12:51:10 +0000 (13:51 +0100)]
s4-torture: add test for lease break after file unlink

When deleting a file, all leases granting handle caching lease to the
file should be recalled.

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

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun  1 02:57:46 CEST 2018 on sn-devel-144

5 years agorpc_server backupkey: pass remote connection data
Gary Lockyer [Wed, 30 May 2018 02:45:03 +0000 (14:45 +1200)]
rpc_server backupkey: pass remote connection data

Ensure that the requesting session data is passed to the audit logging
module for BackupKey requests.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu May 31 12:35:15 CEST 2018 on sn-devel-144

5 years agorpc_server lsa: pass remote connection data
Gary Lockyer [Wed, 30 May 2018 02:44:19 +0000 (14:44 +1200)]
rpc_server lsa: pass remote connection data

Ensure that the session details of the requesting user are available to
the audit logging module for the CreateSecret and OpenSecret operations.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agorpc_server: common routine to open ldb in system session
Gary Lockyer [Wed, 30 May 2018 02:43:25 +0000 (14:43 +1200)]
rpc_server: common routine to open ldb in system session

Add a function to open an ldb connection under the system session and
save the remote users session details in a ldb_opaque.  This will allow
the audit logging to log the original session for operations performed
in the system session.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodsdb acl: Copy dsdb_control_password_acl_validation into reply
Gary Lockyer [Thu, 24 May 2018 21:53:29 +0000 (09:53 +1200)]
dsdb acl: Copy dsdb_control_password_acl_validation into reply

Copy the dsdb_control_password_acl_validation into the reply so that it
is available to the audit_logging module.  The audit logging module
uses it to differentiate between password change and reset operations.

We include it in the result for failed request to allow the logging of
failed attempts.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agocldap: clear remote address after cldap_dse_fill
Gary Lockyer [Wed, 4 Apr 2018 00:38:25 +0000 (12:38 +1200)]
cldap: clear remote address after cldap_dse_fill

Need to clear the remote address as the ldb handle is shared, and
changes made by internal processes would be logged as coming from the
last cldap requester

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoauth tests: irpc remove "auth_event" name on completion
Gary Lockyer [Fri, 25 May 2018 03:21:33 +0000 (15:21 +1200)]
auth tests: irpc remove "auth_event" name on completion

Remove the "auth_event" name on completion of tests to prevent issues
with tests using messaging.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosambatool: heuristics to decided whether colour is wanted
Douglas Bagnall [Thu, 19 Apr 2018 02:15:25 +0000 (14:15 +1200)]
sambatool: heuristics to decided whether colour is wanted

The easy cases are --color=yes and --color=no.

With --color=auto, we use color if it seems we're writing to a TTY.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu May 31 04:34:52 CEST 2018 on sn-devel-144

5 years agopython/colour: add colourizing and switch functions
Douglas Bagnall [Thu, 19 Apr 2018 02:12:57 +0000 (14:12 +1200)]
python/colour: add colourizing and switch functions

When samba.colour is first imported, the function

colour.c_BLUE("samba")

will give you the string "\033[1;34msamba\033[0m", which will show up
as blue on an ANSI terminal. If you then go:

colour.switch_colour_off()
colour.c_BLUE("samba")

the c_BLUE call will return the uncoloured string "samba".

This is so things like samba-tool can do this sort of thing:

    if not os.isatty(self.outf):
        switch_colour_off()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosamba-tool drs: remove 'server' arg from commands without --server
Douglas Bagnall [Sun, 11 Mar 2018 23:45:25 +0000 (12:45 +1300)]
samba-tool drs: remove 'server' arg from commands without --server

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosamba-tool drs showrepl: remove unused search
Douglas Bagnall [Sun, 11 Mar 2018 22:50:41 +0000 (11:50 +1300)]
samba-tool drs showrepl: remove unused search

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosamba-tool: be consistent in accepting -q for --quiet
Douglas Bagnall [Thu, 19 Apr 2018 05:17:28 +0000 (17:17 +1200)]
samba-tool: be consistent in accepting -q for --quiet

Not all commands accept --quiet, and not all of those that do use it.
Some already accept -q, and it is not used anywhere for anything else.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosamba-tool: add -v to drs --verbose
Douglas Bagnall [Thu, 24 May 2018 05:03:22 +0000 (17:03 +1200)]
samba-tool: add -v to drs --verbose

Sometimes we accept -v for --verbose, sometimes we don't. Let's be a
bit more consistent.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosamba-tool: add -v to domain --verbose
Douglas Bagnall [Thu, 19 Apr 2018 04:56:28 +0000 (16:56 +1200)]
samba-tool: add -v to domain --verbose

Sometimes we accept -v for --verbose, sometimes we don't. Let's be a
bit more consistent.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosamba-tool dns cleanup_record: add missing verbose/quiet options
Douglas Bagnall [Thu, 19 Apr 2018 04:43:50 +0000 (16:43 +1200)]
samba-tool dns cleanup_record: add missing verbose/quiet options

The code for using them is already there

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agopython kcc/graph_utils: don't debug in colour
Douglas Bagnall [Thu, 19 Apr 2018 04:39:06 +0000 (16:39 +1200)]
python kcc/graph_utils: don't debug in colour

this was somewhat useful during the initial development, but is wrong for a library

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agokcc graph verifiers: improve messages
Douglas Bagnall [Wed, 16 May 2018 03:53:35 +0000 (15:53 +1200)]
kcc graph verifiers: improve messages

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agokcc graph verifier: use __doc__ description for error explanation
Douglas Bagnall [Tue, 15 May 2018 02:40:36 +0000 (14:40 +1200)]
kcc graph verifier: use __doc__ description for error explanation

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agokcc graphs: site edges in colour, labeled with DNs
Douglas Bagnall [Sun, 7 Jan 2018 09:17:43 +0000 (22:17 +1300)]
kcc graphs: site edges in colour, labeled with DNs

This makes it easy to see where the site edges objects are, and
what sites they refer too.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agondr_misc: read syntax_id using strict util_str_hex functions
Douglas Bagnall [Thu, 22 Mar 2018 04:12:49 +0000 (17:12 +1300)]
ndr_misc: read syntax_id using strict util_str_hex functions

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoutil_str_hex: use array syntax in guid functions to document usage
Douglas Bagnall [Thu, 22 Mar 2018 04:57:05 +0000 (17:57 +1300)]
util_str_hex: use array syntax in guid functions to document usage

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoutil/charset/iconv: use read_hex_bytes rather than sscanf
Douglas Bagnall [Thu, 22 Mar 2018 04:54:55 +0000 (17:54 +1300)]
util/charset/iconv: use read_hex_bytes rather than sscanf

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>