summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2020-07-03 08:11:20 +0200
committerJeremy Allison <jra@samba.org>2020-08-03 22:21:02 +0000
commit23274717563b19684c52f8a909f528f608dafd7c (patch)
treea4bce4303349b9598aeaeb62a8f67c462976f06d
parent611e643d14659be8a63e9ca51d5d05659c4b8b6c (diff)
downloadsamba-23274717563b19684c52f8a909f528f608dafd7c.tar.gz
lib: relicense smb_strtoul(l) under LGPLv3
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Aug 3 22:21:04 UTC 2020 on sn-devel-184
-rw-r--r--ctdb/protocol/protocol_util.c1
-rw-r--r--ctdb/server/ctdb_mutex_fcntl_helper.c1
-rw-r--r--ctdb/server/ctdb_recovery_helper.c1
-rw-r--r--ctdb/tests/src/cluster_mutex_test.c1
-rw-r--r--ctdb/tests/src/db_test_tool.c1
-rw-r--r--ctdb/tools/ctdb.c1
-rw-r--r--lib/ldb-samba/ldb_matching_rules.c1
-rw-r--r--lib/ldb-samba/ldif_handlers.c1
-rw-r--r--lib/messaging/messages_dgm.c1
-rw-r--r--lib/param/loadparm.c1
-rw-r--r--lib/util/access.c1
-rw-r--r--lib/util/asn1.c1
-rw-r--r--lib/util/smb_strtox.c177
-rw-r--r--lib/util/smb_strtox.h40
-rw-r--r--lib/util/tests/util.c1
-rw-r--r--lib/util/util.c152
-rw-r--r--lib/util/util.h13
-rw-r--r--lib/util/util_str.c1
-rw-r--r--lib/util/wscript_build7
-rw-r--r--libcli/security/dom_sid.c1
-rw-r--r--nsswitch/libwbclient/wbc_idmap.c2
-rw-r--r--nsswitch/libwbclient/wbc_sid.c2
-rw-r--r--nsswitch/libwbclient/wscript2
-rw-r--r--nsswitch/wbinfo.c1
-rw-r--r--source3/groupdb/mapping.c1
-rw-r--r--source3/groupdb/mapping_tdb.c1
-rw-r--r--source3/lib/interface.c1
-rw-r--r--source3/lib/namemap_cache.c1
-rw-r--r--source3/lib/sysquotas.c1
-rw-r--r--source3/lib/tldap_util.c1
-rw-r--r--source3/lib/util_str.c1
-rw-r--r--source3/modules/vfs_ceph_snapshots.c1
-rw-r--r--source3/modules/vfs_preopen.c1
-rw-r--r--source3/modules/vfs_snapper.c1
-rw-r--r--source3/modules/vfs_unityed_media.c1
-rw-r--r--source3/passdb/account_pol.c1
-rw-r--r--source3/passdb/pdb_ldap.c1
-rw-r--r--source3/passdb/pdb_tdb.c1
-rw-r--r--source3/rpc_server/mdssvc/es_parser.y1
-rw-r--r--source3/rpcclient/cmd_samr.c1
-rw-r--r--source3/rpcclient/cmd_spoolss.c1
-rw-r--r--source3/torture/test_readdir_timestamp.c1
-rw-r--r--source3/utils/net_idmap.c1
-rw-r--r--source3/utils/net_registry.c1
-rw-r--r--source3/utils/net_rpc_registry.c1
-rw-r--r--source3/utils/net_sam.c1
-rw-r--r--source3/utils/pdbedit.c1
-rw-r--r--source3/utils/regedit_dialog.c1
-rw-r--r--source3/winbindd/idmap_ldap.c1
-rw-r--r--source3/winbindd/winbindd_lookuprids.c1
-rw-r--r--source3/winbindd/winbindd_util.c1
-rw-r--r--source4/auth/gensec/gensec_gssapi.c1
-rw-r--r--source4/dns_server/dlz_bind9.c1
-rw-r--r--source4/dsdb/common/dsdb_dn.c1
-rw-r--r--source4/dsdb/common/util.c1
-rw-r--r--source4/dsdb/samdb/ldb_modules/dirsync.c1
-rw-r--r--source4/dsdb/samdb/ldb_modules/partition_metadata.c1
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c1
-rw-r--r--source4/dsdb/samdb/ldb_modules/schema_load.c1
-rw-r--r--source4/dsdb/schema/schema_prefixmap.c1
-rw-r--r--source4/lib/registry/ldb.c1
-rw-r--r--source4/lib/socket/interface.c1
-rw-r--r--source4/libcli/resolve/dns_ex.c1
-rw-r--r--source4/nbt_server/wins/winsdb.c1
-rw-r--r--source4/rpc_server/lsa/dcesrv_lsa.c1
-rw-r--r--source4/torture/nbench/nbench.c1
-rw-r--r--source4/torture/smb2/sharemode.c1
67 files changed, 285 insertions, 169 deletions
diff --git a/ctdb/protocol/protocol_util.c b/ctdb/protocol/protocol_util.c
index c67aa2e056f..2d0a6f33038 100644
--- a/ctdb/protocol/protocol_util.c
+++ b/ctdb/protocol/protocol_util.c
@@ -27,6 +27,7 @@
#include "protocol.h"
#include "protocol_util.h"
#include "lib/util/util.h"
+#include "lib/util/smb_strtox.h"
static struct {
enum ctdb_runstate runstate;
diff --git a/ctdb/server/ctdb_mutex_fcntl_helper.c b/ctdb/server/ctdb_mutex_fcntl_helper.c
index 51c46ce733f..87f5dc22c41 100644
--- a/ctdb/server/ctdb_mutex_fcntl_helper.c
+++ b/ctdb/server/ctdb_mutex_fcntl_helper.c
@@ -30,6 +30,7 @@
#include "lib/util/sys_rw.h"
#include "lib/util/tevent_unix.h"
#include "lib/util/util.h"
+#include "lib/util/smb_strtox.h"
/* protocol.h is just needed for ctdb_sock_addr, which is used in system.h */
#include "protocol/protocol.h"
diff --git a/ctdb/server/ctdb_recovery_helper.c b/ctdb/server/ctdb_recovery_helper.c
index f10e60104ae..4ce10b528bf 100644
--- a/ctdb/server/ctdb_recovery_helper.c
+++ b/ctdb/server/ctdb_recovery_helper.c
@@ -32,6 +32,7 @@
#include "lib/util/time.h"
#include "lib/util/tevent_unix.h"
#include "lib/util/util.h"
+#include "lib/util/smb_strtox.h"
#include "protocol/protocol.h"
#include "protocol/protocol_api.h"
diff --git a/ctdb/tests/src/cluster_mutex_test.c b/ctdb/tests/src/cluster_mutex_test.c
index 34398a98ea9..3c045f3e807 100644
--- a/ctdb/tests/src/cluster_mutex_test.c
+++ b/ctdb/tests/src/cluster_mutex_test.c
@@ -27,6 +27,7 @@
#include <tevent.h>
#include "lib/util/util.h"
+#include "lib/util/smb_strtox.h"
/*
* ctdb_cluster_mutex.c is included below. This requires a few hacks...
diff --git a/ctdb/tests/src/db_test_tool.c b/ctdb/tests/src/db_test_tool.c
index fe0ab6c6e2a..7ac6b030740 100644
--- a/ctdb/tests/src/db_test_tool.c
+++ b/ctdb/tests/src/db_test_tool.c
@@ -34,6 +34,7 @@
#include "lib/util/debug.h"
#include "lib/util/sys_rw.h"
#include "lib/util/util.h"
+#include "lib/util/smb_strtox.h"
#include "lib/tdb_wrap/tdb_wrap.h"
#include "common/cmdline.h"
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 171069d7ebf..5209081f322 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -34,6 +34,7 @@
#include "lib/util/debug.h"
#include "lib/util/samba_util.h"
#include "lib/util/sys_rw.h"
+#include "lib/util/smb_strtox.h"
#include "common/db_hash.h"
#include "common/logging.h"
diff --git a/lib/ldb-samba/ldb_matching_rules.c b/lib/ldb-samba/ldb_matching_rules.c
index 4b357bb706a..13edb51daaa 100644
--- a/lib/ldb-samba/ldb_matching_rules.c
+++ b/lib/ldb-samba/ldb_matching_rules.c
@@ -27,6 +27,7 @@
#include "libcli/security/security.h"
#include "dsdb/common/util.h"
#include "librpc/gen_ndr/ndr_dnsp.h"
+#include "lib/util/smb_strtox.h"
static int ldb_eval_transitive_filter_helper(TALLOC_CTX *mem_ctx,
struct ldb_context *ldb,
diff --git a/lib/ldb-samba/ldif_handlers.c b/lib/ldb-samba/ldif_handlers.c
index e74a7182ecf..78a433748bb 100644
--- a/lib/ldb-samba/ldif_handlers.c
+++ b/lib/ldb-samba/ldif_handlers.c
@@ -36,6 +36,7 @@
#include "libcli/security/security.h"
#include "param/param.h"
#include "../lib/util/asn1.h"
+#include "lib/util/smb_strtox.h"
/*
use ndr_print_* to convert a NDR formatted blob to a ldif formatted blob
diff --git a/lib/messaging/messages_dgm.c b/lib/messaging/messages_dgm.c
index b7126b9c8ca..7c9dd8eb42f 100644
--- a/lib/messaging/messages_dgm.c
+++ b/lib/messaging/messages_dgm.c
@@ -32,6 +32,7 @@
#include "lib/util/iov_buf.h"
#include "lib/util/blocking.h"
#include "lib/util/tevent_unix.h"
+#include "lib/util/smb_strtox.h"
#define MESSAGING_DGM_FRAGMENT_LENGTH 1024
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index da639a8b0ff..dc22f646b3e 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -73,6 +73,7 @@
#include "lib/util/samba_util.h"
#include "libcli/auth/ntlm_check.h"
#include "lib/crypto/gnutls_helpers.h"
+#include "lib/util/smb_strtox.h"
#ifdef HAVE_HTTPCONNECTENCRYPT
#include <cups/http.h>
diff --git a/lib/util/access.c b/lib/util/access.c
index 10a14771899..e02117fa23e 100644
--- a/lib/util/access.c
+++ b/lib/util/access.c
@@ -21,6 +21,7 @@
#include "lib/util/memory.h"
#include "lib/util/access.h"
#include "lib/util/unix_match.h"
+#include "lib/util/smb_strtox.h"
#if defined(HAVE_NETGROUP)
#include "system/nis.h"
diff --git a/lib/util/asn1.c b/lib/util/asn1.c
index 88d96d4544b..0dfddc009c0 100644
--- a/lib/util/asn1.c
+++ b/lib/util/asn1.c
@@ -22,6 +22,7 @@
#include "lib/util/asn1.h"
#include "lib/util/debug.h"
#include "lib/util/samba_util.h"
+#include "lib/util/smb_strtox.h"
struct nesting {
off_t start;
diff --git a/lib/util/smb_strtox.c b/lib/util/smb_strtox.c
new file mode 100644
index 00000000000..2cace8b9aaf
--- /dev/null
+++ b/lib/util/smb_strtox.c
@@ -0,0 +1,177 @@
+/*
+ * Unix SMB/CIFS implementation.
+ *
+ * Copyright (C) Swen Schillig 2019
+ *
+ * ** NOTE! The following LGPL license applies to the tevent
+ * ** library. This does NOT imply that all of Samba is released
+ * ** under the LGPL
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "replace.h"
+#include "smb_strtox.h"
+
+/**
+ * Convert a string to an unsigned long integer
+ *
+ * @param nptr pointer to string which is to be converted
+ * @param endptr [optional] reference to remainder of the string
+ * @param base base of the numbering scheme
+ * @param err error occured during conversion
+ * @flags controlling conversion feature
+ * @result result of the conversion as provided by strtoul
+ *
+ * The following flags are supported
+ * SMB_STR_STANDARD # raise error if negative or non-numeric
+ * SMB_STR_ALLOW_NEGATIVE # allow strings with a leading "-"
+ * SMB_STR_FULL_STR_CONV # entire string must be converted
+ * SMB_STR_ALLOW_NO_CONVERSION # allow empty strings or non-numeric
+ * SMB_STR_GLIBC_STANDARD # act exactly as the standard glibc strtoul
+ *
+ * The following errors are detected
+ * - wrong base
+ * - value overflow
+ * - string with a leading "-" indicating a negative number
+ * - no conversion due to empty string or not representing a number
+ */
+unsigned long int
+smb_strtoul(const char *nptr, char **endptr, int base, int *err, int flags)
+{
+ unsigned long int val;
+ int saved_errno = errno;
+ char *needle = NULL;
+ char *tmp_endptr = NULL;
+
+ errno = 0;
+ *err = 0;
+
+ val = strtoul(nptr, &tmp_endptr, base);
+
+ if (endptr != NULL) {
+ *endptr = tmp_endptr;
+ }
+
+ if (errno != 0) {
+ *err = errno;
+ errno = saved_errno;
+ return val;
+ }
+
+ if ((flags & SMB_STR_ALLOW_NO_CONVERSION) == 0) {
+ /* got an invalid number-string resulting in no conversion */
+ if (nptr == tmp_endptr) {
+ *err = EINVAL;
+ goto out;
+ }
+ }
+
+ if ((flags & SMB_STR_ALLOW_NEGATIVE ) == 0) {
+ /* did we convert a negative "number" ? */
+ needle = strchr(nptr, '-');
+ if (needle != NULL && needle < tmp_endptr) {
+ *err = EINVAL;
+ goto out;
+ }
+ }
+
+ if ((flags & SMB_STR_FULL_STR_CONV) != 0) {
+ /* did we convert the entire string ? */
+ if (tmp_endptr[0] != '\0') {
+ *err = EINVAL;
+ goto out;
+ }
+ }
+
+out:
+ errno = saved_errno;
+ return val;
+}
+
+/**
+ * Convert a string to an unsigned long long integer
+ *
+ * @param nptr pointer to string which is to be converted
+ * @param endptr [optional] reference to remainder of the string
+ * @param base base of the numbering scheme
+ * @param err error occured during conversion
+ * @flags controlling conversion feature
+ * @result result of the conversion as provided by strtoull
+ *
+ * The following flags are supported
+ * SMB_STR_STANDARD # raise error if negative or non-numeric
+ * SMB_STR_ALLOW_NEGATIVE # allow strings with a leading "-"
+ * SMB_STR_FULL_STR_CONV # entire string must be converted
+ * SMB_STR_ALLOW_NO_CONVERSION # allow empty strings or non-numeric
+ * SMB_STR_GLIBC_STANDARD # act exactly as the standard glibc strtoul
+ *
+ * The following errors are detected
+ * - wrong base
+ * - value overflow
+ * - string with a leading "-" indicating a negative number
+ * - no conversion due to empty string or not representing a number
+ */
+unsigned long long int
+smb_strtoull(const char *nptr, char **endptr, int base, int *err, int flags)
+{
+ unsigned long long int val;
+ int saved_errno = errno;
+ char *needle = NULL;
+ char *tmp_endptr = NULL;
+
+ errno = 0;
+ *err = 0;
+
+ val = strtoull(nptr, &tmp_endptr, base);
+
+ if (endptr != NULL) {
+ *endptr = tmp_endptr;
+ }
+
+ if (errno != 0) {
+ *err = errno;
+ errno = saved_errno;
+ return val;
+ }
+
+ if ((flags & SMB_STR_ALLOW_NO_CONVERSION) == 0) {
+ /* got an invalid number-string resulting in no conversion */
+ if (nptr == tmp_endptr) {
+ *err = EINVAL;
+ goto out;
+ }
+ }
+
+ if ((flags & SMB_STR_ALLOW_NEGATIVE ) == 0) {
+ /* did we convert a negative "number" ? */
+ needle = strchr(nptr, '-');
+ if (needle != NULL && needle < tmp_endptr) {
+ *err = EINVAL;
+ goto out;
+ }
+ }
+
+ if ((flags & SMB_STR_FULL_STR_CONV) != 0) {
+ /* did we convert the entire string ? */
+ if (tmp_endptr[0] != '\0') {
+ *err = EINVAL;
+ goto out;
+ }
+ }
+
+out:
+ errno = saved_errno;
+ return val;
+}
diff --git a/lib/util/smb_strtox.h b/lib/util/smb_strtox.h
new file mode 100644
index 00000000000..f72bf123823
--- /dev/null
+++ b/lib/util/smb_strtox.h
@@ -0,0 +1,40 @@
+/*
+ * Unix SMB/CIFS implementation.
+ *
+ * Copyright (C) Swen Schillig 2019
+ *
+ * ** NOTE! The following LGPL license applies to the tevent
+ * ** library. This does NOT imply that all of Samba is released
+ * ** under the LGPL
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef SMB_STRTOX_H
+#define SMB_STRTOX_H
+
+#define SMB_STR_STANDARD 0x00
+#define SMB_STR_ALLOW_NEGATIVE 0x01
+#define SMB_STR_FULL_STR_CONV 0x02
+#define SMB_STR_ALLOW_NO_CONVERSION 0x04
+#define SMB_STR_GLIBC_STANDARD (SMB_STR_ALLOW_NO_CONVERSION | \
+ SMB_STR_ALLOW_NEGATIVE)
+
+unsigned long int
+smb_strtoul(const char *nptr, char **endptr, int base, int *err, int flags);
+
+unsigned long long int
+smb_strtoull(const char *nptr, char **endptr, int base, int *err, int flags);
+
+#endif
diff --git a/lib/util/tests/util.c b/lib/util/tests/util.c
index 4876144bcdc..03f62974c3f 100644
--- a/lib/util/tests/util.c
+++ b/lib/util/tests/util.c
@@ -30,6 +30,7 @@
#include "torture/local/proto.h"
#include "lib/util/samba_util.h"
+#include "lib/util/smb_strtox.h"
#include "limits.h"
#include "string.h"
diff --git a/lib/util/util.c b/lib/util/util.c
index a90d48f6f1b..1f37688cbad 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -53,158 +53,6 @@
*/
/**
- * Convert a string to an unsigned long integer
- *
- * @param nptr pointer to string which is to be converted
- * @param endptr [optional] reference to remainder of the string
- * @param base base of the numbering scheme
- * @param err error occured during conversion
- * @flags controlling conversion feature
- * @result result of the conversion as provided by strtoul
- *
- * The following flags are supported
- * SMB_STR_STANDARD # raise error if negative or non-numeric
- * SMB_STR_ALLOW_NEGATIVE # allow strings with a leading "-"
- * SMB_STR_FULL_STR_CONV # entire string must be converted
- * SMB_STR_ALLOW_NO_CONVERSION # allow empty strings or non-numeric
- * SMB_STR_GLIBC_STANDARD # act exactly as the standard glibc strtoul
- *
- * The following errors are detected
- * - wrong base
- * - value overflow
- * - string with a leading "-" indicating a negative number
- * - no conversion due to empty string or not representing a number
- */
-unsigned long int
-smb_strtoul(const char *nptr, char **endptr, int base, int *err, int flags)
-{
- unsigned long int val;
- int saved_errno = errno;
- char *needle = NULL;
- char *tmp_endptr = NULL;
-
- errno = 0;
- *err = 0;
-
- val = strtoul(nptr, &tmp_endptr, base);
-
- if (endptr != NULL) {
- *endptr = tmp_endptr;
- }
-
- if (errno != 0) {
- *err = errno;
- errno = saved_errno;
- return val;
- }
-
- if ((flags & SMB_STR_ALLOW_NO_CONVERSION) == 0) {
- /* got an invalid number-string resulting in no conversion */
- if (nptr == tmp_endptr) {
- *err = EINVAL;
- goto out;
- }
- }
-
- if ((flags & SMB_STR_ALLOW_NEGATIVE ) == 0) {
- /* did we convert a negative "number" ? */
- needle = strchr(nptr, '-');
- if (needle != NULL && needle < tmp_endptr) {
- *err = EINVAL;
- goto out;
- }
- }
-
- if ((flags & SMB_STR_FULL_STR_CONV) != 0) {
- /* did we convert the entire string ? */
- if (tmp_endptr[0] != '\0') {
- *err = EINVAL;
- goto out;
- }
- }
-
-out:
- errno = saved_errno;
- return val;
-}
-
-/**
- * Convert a string to an unsigned long long integer
- *
- * @param nptr pointer to string which is to be converted
- * @param endptr [optional] reference to remainder of the string
- * @param base base of the numbering scheme
- * @param err error occured during conversion
- * @flags controlling conversion feature
- * @result result of the conversion as provided by strtoull
- *
- * The following flags are supported
- * SMB_STR_STANDARD # raise error if negative or non-numeric
- * SMB_STR_ALLOW_NEGATIVE # allow strings with a leading "-"
- * SMB_STR_FULL_STR_CONV # entire string must be converted
- * SMB_STR_ALLOW_NO_CONVERSION # allow empty strings or non-numeric
- * SMB_STR_GLIBC_STANDARD # act exactly as the standard glibc strtoul
- *
- * The following errors are detected
- * - wrong base
- * - value overflow
- * - string with a leading "-" indicating a negative number
- * - no conversion due to empty string or not representing a number
- */
-unsigned long long int
-smb_strtoull(const char *nptr, char **endptr, int base, int *err, int flags)
-{
- unsigned long long int val;
- int saved_errno = errno;
- char *needle = NULL;
- char *tmp_endptr = NULL;
-
- errno = 0;
- *err = 0;
-
- val = strtoull(nptr, &tmp_endptr, base);
-
- if (endptr != NULL) {
- *endptr = tmp_endptr;
- }
-
- if (errno != 0) {
- *err = errno;
- errno = saved_errno;
- return val;
- }
-
- if ((flags & SMB_STR_ALLOW_NO_CONVERSION) == 0) {
- /* got an invalid number-string resulting in no conversion */
- if (nptr == tmp_endptr) {
- *err = EINVAL;
- goto out;
- }
- }
-
- if ((flags & SMB_STR_ALLOW_NEGATIVE ) == 0) {
- /* did we convert a negative "number" ? */
- needle = strchr(nptr, '-');
- if (needle != NULL && needle < tmp_endptr) {
- *err = EINVAL;
- goto out;
- }
- }
-
- if ((flags & SMB_STR_FULL_STR_CONV) != 0) {
- /* did we convert the entire string ? */
- if (tmp_endptr[0] != '\0') {
- *err = EINVAL;
- goto out;
- }
- }
-
-out:
- errno = saved_errno;
- return val;
-}
-
-/**
Find a suitable temporary directory. The result should be copied immediately
as it may be overwritten by a subsequent call.
**/
diff --git a/lib/util/util.h b/lib/util/util.h
index c89f4807d5b..a7acad56880 100644
--- a/lib/util/util.h
+++ b/lib/util/util.h
@@ -22,19 +22,6 @@
#ifndef __UTIL_SAMBA_UTIL_H__
#define __UTIL_SAMBA_UTIL_H__
-#define SMB_STR_STANDARD 0x00
-#define SMB_STR_ALLOW_NEGATIVE 0x01
-#define SMB_STR_FULL_STR_CONV 0x02
-#define SMB_STR_ALLOW_NO_CONVERSION 0x04
-#define SMB_STR_GLIBC_STANDARD (SMB_STR_ALLOW_NO_CONVERSION | \
- SMB_STR_ALLOW_NEGATIVE)
-
-unsigned long int
-smb_strtoul(const char *nptr, char **endptr, int base, int *err, int flags);
-
-unsigned long long int
-smb_strtoull(const char *nptr, char **endptr, int base, int *err, int flags);
-
/**
* Write dump of binary data to a callback
*/
diff --git a/lib/util/util_str.c b/lib/util/util_str.c
index 3356df34f04..c7773e0c927 100644
--- a/lib/util/util_str.c
+++ b/lib/util/util_str.c
@@ -23,6 +23,7 @@
#include "includes.h"
#include "system/locale.h"
+#include "smb_strtox.h"
#undef strncasecmp
#undef strcasemp
diff --git a/lib/util/wscript_build b/lib/util/wscript_build
index 807c62636fd..afda713cb06 100644
--- a/lib/util/wscript_build
+++ b/lib/util/wscript_build
@@ -81,10 +81,15 @@ bld.SAMBA_SUBSYSTEM('samba-util-core',
strv_util.c bitmap.c select.c pidfile.c
become_daemon.c mkdir_p.c''',
deps='''time-basic samba-debug socket-blocking talloc
- tevent execinfo pthread strv tini''',
+ tevent execinfo pthread strv tini smb_strtox''',
public_deps='systemd systemd-daemon sys_rw LIBUNWIND',
local_include=False)
+bld.SAMBA_SUBSYSTEM('smb_strtox',
+ source='smb_strtox.c',
+ local_include=False)
+
+
bld.SAMBA_LIBRARY('iov_buf',
source='iov_buf.c',
deps='talloc',
diff --git a/libcli/security/dom_sid.c b/libcli/security/dom_sid.c
index ecf8926c12c..32bc3e187a7 100644
--- a/libcli/security/dom_sid.c
+++ b/libcli/security/dom_sid.c
@@ -27,6 +27,7 @@
#include "lib/util/util.h"
#include "librpc/gen_ndr/security.h"
#include "dom_sid.h"
+#include "lib/util/smb_strtox.h"
/*****************************************************************
Compare the auth portion of two sids.
diff --git a/nsswitch/libwbclient/wbc_idmap.c b/nsswitch/libwbclient/wbc_idmap.c
index 270a3c3c3ec..05ac60853a5 100644
--- a/nsswitch/libwbclient/wbc_idmap.c
+++ b/nsswitch/libwbclient/wbc_idmap.c
@@ -24,7 +24,7 @@
#include "replace.h"
#include "libwbclient.h"
#include "../winbind_client.h"
-#include "lib/util/util.h"
+#include "lib/util/smb_strtox.h"
/* Convert a Windows SID to a Unix uid, allocating an uid if needed */
wbcErr wbcCtxSidToUid(struct wbcContext *ctx, const struct wbcDomainSid *sid,
diff --git a/nsswitch/libwbclient/wbc_sid.c b/nsswitch/libwbclient/wbc_sid.c
index aab96cf9188..e0b92bd4d34 100644
--- a/nsswitch/libwbclient/wbc_sid.c
+++ b/nsswitch/libwbclient/wbc_sid.c
@@ -26,7 +26,7 @@
#include "replace.h"
#include "libwbclient.h"
#include "../winbind_client.h"
-#include "lib/util/util.h"
+#include "lib/util/smb_strtox.h"
/* Convert a sid to a string into a buffer. Return the string
* length. If buflen is too small, return the string length that would
diff --git a/nsswitch/libwbclient/wscript b/nsswitch/libwbclient/wscript
index d926067df91..17150a2036b 100644
--- a/nsswitch/libwbclient/wscript
+++ b/nsswitch/libwbclient/wscript
@@ -37,7 +37,7 @@ def build(bld):
wbc_pwd.c
wbc_sid.c
wbc_util.c''',
- deps='winbind-client samba-util',
+ deps='winbind-client smb_strtox',
pc_files='wbclient.pc',
public_headers='wbclient.h',
abi_directory='ABI',
diff --git a/nsswitch/wbinfo.c b/nsswitch/wbinfo.c
index cd89bb0bddc..39e3878b396 100644
--- a/nsswitch/wbinfo.c
+++ b/nsswitch/wbinfo.c
@@ -27,6 +27,7 @@
#include "../libcli/auth/libcli_auth.h"
#include "lib/cmdline/popt_common.h"
#include "lib/afs/afs_settoken.h"
+#include "lib/util/smb_strtox.h"
#ifdef DBGC_CLASS
#undef DBGC_CLASS
diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c
index 4a2e17d8bee..d646e979e8d 100644
--- a/source3/groupdb/mapping.c
+++ b/source3/groupdb/mapping.c
@@ -28,6 +28,7 @@
#include "lib/winbind_util.h"
#include <tdb.h>
#include "groupdb/mapping_tdb.h"
+#include "lib/util/smb_strtox.h"
static const struct mapping_backend *backend;
diff --git a/source3/groupdb/mapping_tdb.c b/source3/groupdb/mapping_tdb.c
index 7f6ae4e65e4..a39b03d9945 100644
--- a/source3/groupdb/mapping_tdb.c
+++ b/source3/groupdb/mapping_tdb.c
@@ -29,6 +29,7 @@
#include "util_tdb.h"
#include "../libcli/security/security.h"
#include "groupdb/mapping_tdb.h"
+#include "lib/util/smb_strtox.h"
static struct db_context *db; /* used for driver files */
diff --git a/source3/lib/interface.c b/source3/lib/interface.c
index 35cfc5eee62..5a86524e696 100644
--- a/source3/lib/interface.c
+++ b/source3/lib/interface.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "lib/socket/interfaces.h"
#include "librpc/gen_ndr/ioctl.h"
+#include "lib/util/smb_strtox.h"
static struct iface_struct *probed_ifaces;
static int total_probed;
diff --git a/source3/lib/namemap_cache.c b/source3/lib/namemap_cache.c
index 7075b7c5b1e..2e8d298a51d 100644
--- a/source3/lib/namemap_cache.c
+++ b/source3/lib/namemap_cache.c
@@ -26,6 +26,7 @@
#include "lib/util/talloc_stack.h"
#include "lib/util/charset/charset.h"
#include "libcli/security/dom_sid.h"
+#include "lib/util/smb_strtox.h"
bool namemap_cache_set_sid2name(const struct dom_sid *sid,
const char *domain, const char *name,
diff --git a/source3/lib/sysquotas.c b/source3/lib/sysquotas.c
index 64e41f740a3..6553cac40da 100644
--- a/source3/lib/sysquotas.c
+++ b/source3/lib/sysquotas.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "lib/util_file.h"
+#include "lib/util/smb_strtox.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_QUOTA
diff --git a/source3/lib/tldap_util.c b/source3/lib/tldap_util.c
index 168932a8a96..89aea4c6a69 100644
--- a/source3/lib/tldap_util.c
+++ b/source3/lib/tldap_util.c
@@ -22,6 +22,7 @@
#include "tldap_util.h"
#include "../libcli/security/security.h"
#include "../lib/util/asn1.h"
+#include "lib/util/smb_strtox.h"
bool tldap_entry_values(struct tldap_message *msg, const char *attribute,
DATA_BLOB **values, int *num_values)
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index c31667c8821..13d30785c75 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -24,6 +24,7 @@
#include "includes.h"
#include "lib/param/loadparm.h"
+#include "lib/util/smb_strtox.h"
static const char toupper_ascii_fast_table[128] = {
0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf,
diff --git a/source3/modules/vfs_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c
index 00cb72d6974..9ff5b9de074 100644
--- a/source3/modules/vfs_ceph_snapshots.c
+++ b/source3/modules/vfs_ceph_snapshots.c
@@ -27,6 +27,7 @@
#include "system/filesys.h"
#include "smbd/smbd.h"
#include "lib/util/tevent_ntstatus.h"
+#include "lib/util/smb_strtox.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_VFS
diff --git a/source3/modules/vfs_preopen.c b/source3/modules/vfs_preopen.c
index dc68d138bad..d27c4a82000 100644
--- a/source3/modules/vfs_preopen.c
+++ b/source3/modules/vfs_preopen.c
@@ -23,6 +23,7 @@
#include "smbd/smbd.h"
#include "lib/util/sys_rw.h"
#include "lib/util/sys_rw_data.h"
+#include "lib/util/smb_strtox.h"
struct preopen_state;
diff --git a/source3/modules/vfs_snapper.c b/source3/modules/vfs_snapper.c
index 8e78cb605c8..8f239c6cb3f 100644
--- a/source3/modules/vfs_snapper.c
+++ b/source3/modules/vfs_snapper.c
@@ -37,6 +37,7 @@
#include "system/filesys.h"
#include "smbd/smbd.h"
#include "lib/util/tevent_ntstatus.h"
+#include "lib/util/smb_strtox.h"
#define SNAPPER_SIG_LIST_SNAPS_RSP "a(uquxussa{ss})"
#define SNAPPER_SIG_LIST_CONFS_RSP "a(ssa{ss})"
diff --git a/source3/modules/vfs_unityed_media.c b/source3/modules/vfs_unityed_media.c
index b755621208b..c42acaef3fe 100644
--- a/source3/modules/vfs_unityed_media.c
+++ b/source3/modules/vfs_unityed_media.c
@@ -60,6 +60,7 @@
#include "../smbd/globals.h"
#include "auth.h"
#include "../lib/tsocket/tsocket.h"
+#include "lib/util/smb_strtox.h"
#include <libgen.h>
#define UM_PARAM_TYPE_NAME "unityed_media"
diff --git a/source3/passdb/account_pol.c b/source3/passdb/account_pol.c
index ee667815bc1..34c0d726652 100644
--- a/source3/passdb/account_pol.c
+++ b/source3/passdb/account_pol.c
@@ -27,6 +27,7 @@
#include "../libcli/security/security.h"
#include "lib/privileges.h"
#include "lib/gencache.h"
+#include "lib/util/smb_strtox.h"
static struct db_context *db;
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 36b4aa61fd4..ba82c9833c6 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -54,6 +54,7 @@
#include "librpc/gen_ndr/idmap.h"
#include "lib/param/loadparm.h"
#include "lib/util_sid_passdb.h"
+#include "lib/util/smb_strtox.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c
index 8b4d84b3704..0f7e2a919f4 100644
--- a/source3/passdb/pdb_tdb.c
+++ b/source3/passdb/pdb_tdb.c
@@ -30,6 +30,7 @@
#include "../libcli/security/security.h"
#include "util_tdb.h"
#include "passdb/pdb_tdb.h"
+#include "lib/util/smb_strtox.h"
#if 0 /* when made a module use this */
diff --git a/source3/rpc_server/mdssvc/es_parser.y b/source3/rpc_server/mdssvc/es_parser.y
index 0514183b35d..764f4bc5c20 100644
--- a/source3/rpc_server/mdssvc/es_parser.y
+++ b/source3/rpc_server/mdssvc/es_parser.y
@@ -24,6 +24,7 @@
#include "rpc_server/mdssvc/mdssvc_es.h"
#include "rpc_server/mdssvc/es_parser.tab.h"
#include "rpc_server/mdssvc/es_mapping.h"
+ #include "lib/util/smb_strtox.h"
#include <jansson.h>
/*
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index 068f5dc4a63..d30f4184cc6 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -31,6 +31,7 @@
#include "rpc_client/init_samr.h"
#include "rpc_client/init_lsa.h"
#include "../libcli/security/security.h"
+#include "lib/util/smb_strtox.h"
static struct dom_sid domain_sid;
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index a7e0c673a65..88122eb296d 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -34,6 +34,7 @@
#include "../libcli/registry/util_reg.h"
#include "libsmb/libsmb.h"
#include "popt_common_cmdline.h"
+#include "lib/util/smb_strtox.h"
#define RPCCLIENT_PRINTERNAME(_printername, _cli, _arg) \
{ \
diff --git a/source3/torture/test_readdir_timestamp.c b/source3/torture/test_readdir_timestamp.c
index 0ae75bb4f7b..e53883cc21f 100644
--- a/source3/torture/test_readdir_timestamp.c
+++ b/source3/torture/test_readdir_timestamp.c
@@ -21,6 +21,7 @@
#include "libsmb/libsmb.h"
#include "libsmb/clirap.h"
#include "lib/util/tevent_ntstatus.h"
+#include "lib/util/smb_strtox.h"
extern int torture_nprocs;
extern int torture_numops;
diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c
index 24417a8620f..027b74131dd 100644
--- a/source3/utils/net_idmap.c
+++ b/source3/utils/net_idmap.c
@@ -28,6 +28,7 @@
#include "net_idmap_check.h"
#include "util_tdb.h"
#include "idmap_autorid_tdb.h"
+#include "lib/util/smb_strtox.h"
#define ALLOC_CHECK(mem) do { \
if (!mem) { \
diff --git a/source3/utils/net_registry.c b/source3/utils/net_registry.c
index 4bffe1c0f6a..389e3f6a552 100644
--- a/source3/utils/net_registry.c
+++ b/source3/utils/net_registry.c
@@ -38,6 +38,7 @@
#include "passdb/machine_sid.h"
#include "net_registry_check.h"
#include "lib/util/util_tdb.h"
+#include "lib/util/smb_strtox.h"
/*
*
diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c
index e47bad4e33f..cec545902c7 100644
--- a/source3/utils/net_rpc_registry.c
+++ b/source3/utils/net_rpc_registry.c
@@ -32,6 +32,7 @@
#include "../libcli/security/display_sec.h"
#include "../libcli/registry/util_reg.h"
#include "client.h"
+#include "lib/util/smb_strtox.h"
/*******************************************************************
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c
index 74e500f0f31..10d7e342253 100644
--- a/source3/utils/net_sam.c
+++ b/source3/utils/net_sam.c
@@ -31,6 +31,7 @@
#include "lib/privileges.h"
#include "secrets.h"
#include "idmap.h"
+#include "lib/util/smb_strtox.h"
/*
* Set a user's data
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index e0645a67423..ac71167ad07 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -27,6 +27,7 @@
#include "passdb.h"
#include "cmdline_contexts.h"
#include "passwd_proto.h"
+#include "lib/util/smb_strtox.h"
#define BIT_BACKEND 0x00000004
#define BIT_VERBOSE 0x00000008
diff --git a/source3/utils/regedit_dialog.c b/source3/utils/regedit_dialog.c
index c70dd44a743..d1cb45fd8f2 100644
--- a/source3/utils/regedit_dialog.c
+++ b/source3/utils/regedit_dialog.c
@@ -24,6 +24,7 @@
#include "regedit_hexedit.h"
#include "util_reg.h"
#include "lib/registry/registry.h"
+#include "lib/util/smb_strtox.h"
#include <stdarg.h>
#include <form.h>
diff --git a/source3/winbindd/idmap_ldap.c b/source3/winbindd/idmap_ldap.c
index 86cb6f1bc51..b29e990f97a 100644
--- a/source3/winbindd/idmap_ldap.c
+++ b/source3/winbindd/idmap_ldap.c
@@ -29,6 +29,7 @@
#include "idmap.h"
#include "idmap_rw.h"
#include "../libcli/security/security.h"
+#include "lib/util/smb_strtox.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_IDMAP
diff --git a/source3/winbindd/winbindd_lookuprids.c b/source3/winbindd/winbindd_lookuprids.c
index 3b7b4176d18..b01e0e5877d 100644
--- a/source3/winbindd/winbindd_lookuprids.c
+++ b/source3/winbindd/winbindd_lookuprids.c
@@ -21,6 +21,7 @@
#include "winbindd.h"
#include "librpc/gen_ndr/ndr_winbind_c.h"
#include "../libcli/security/security.h"
+#include "lib/util/smb_strtox.h"
struct winbindd_lookuprids_state {
struct tevent_context *ev;
diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c
index c2f02b74211..6cebc5b12c5 100644
--- a/source3/winbindd/winbindd_util.c
+++ b/source3/winbindd/winbindd_util.c
@@ -33,6 +33,7 @@
#include "librpc/gen_ndr/ndr_drsblobs.h"
#include "auth/credentials/credentials.h"
#include "libsmb/samlogon_cache.h"
+#include "lib/util/smb_strtox.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
diff --git a/source4/auth/gensec/gensec_gssapi.c b/source4/auth/gensec/gensec_gssapi.c
index d66abf32a7f..1b0852795fd 100644
--- a/source4/auth/gensec/gensec_gssapi.c
+++ b/source4/auth/gensec/gensec_gssapi.c
@@ -45,6 +45,7 @@
#include "lib/util/util_net.h"
#include "auth/kerberos/pac_utils.h"
#include "auth/kerberos/gssapi_helper.h"
+#include "lib/util/smb_strtox.h"
#ifndef gss_mech_spnego
gss_OID_desc spnego_mech_oid_desc =
diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c
index 4fafea17751..990f4dc2eda 100644
--- a/source4/dns_server/dlz_bind9.c
+++ b/source4/dns_server/dlz_bind9.c
@@ -39,6 +39,7 @@
#include "lib/util/dlinklist.h"
#include "dlz_minimal.h"
#include "dnsserver_common.h"
+#include "lib/util/smb_strtox.h"
struct b9_options {
const char *url;
diff --git a/source4/dsdb/common/dsdb_dn.c b/source4/dsdb/common/dsdb_dn.c
index fd009a7af98..856b3048771 100644
--- a/source4/dsdb/common/dsdb_dn.c
+++ b/source4/dsdb/common/dsdb_dn.c
@@ -24,6 +24,7 @@
#include <ldb_module.h>
#include "librpc/ndr/libndr.h"
#include "libcli/security/dom_sid.h"
+#include "lib/util/smb_strtox.h"
enum dsdb_dn_format dsdb_dn_oid_to_format(const char *oid)
{
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index ef03782f588..a4d90135b41 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -49,6 +49,7 @@
#include "lib/util/util_str_hex.h"
#include "lib/util/sys_rw_data.h"
#include "libcli/util/ntstatus.h"
+#include "lib/util/smb_strtox.h"
/*
* This included to allow us to handle DSDB_FLAG_REPLICATED_UPDATE in
diff --git a/source4/dsdb/samdb/ldb_modules/dirsync.c b/source4/dsdb/samdb/ldb_modules/dirsync.c
index 21555491159..bafa7dd1b87 100644
--- a/source4/dsdb/samdb/ldb_modules/dirsync.c
+++ b/source4/dsdb/samdb/ldb_modules/dirsync.c
@@ -28,6 +28,7 @@
#include "librpc/ndr/libndr.h"
#include "dsdb/samdb/samdb.h"
#include "dsdb/samdb/ldb_modules/util.h"
+#include "lib/util/smb_strtox.h"
#define LDAP_DIRSYNC_OBJECT_SECURITY 0x01
#define LDAP_DIRSYNC_ANCESTORS_FIRST_ORDER 0x800
diff --git a/source4/dsdb/samdb/ldb_modules/partition_metadata.c b/source4/dsdb/samdb/ldb_modules/partition_metadata.c
index 44ce2c66639..c220e67124e 100644
--- a/source4/dsdb/samdb/ldb_modules/partition_metadata.c
+++ b/source4/dsdb/samdb/ldb_modules/partition_metadata.c
@@ -20,6 +20,7 @@
#include "dsdb/samdb/ldb_modules/partition.h"
#include "lib/ldb-samba/ldb_wrap.h"
#include "system/filesys.h"
+#include "lib/util/smb_strtox.h"
#define LDB_METADATA_SEQ_NUM "SEQ_NUM"
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index 4da8564c77a..2a43807272c 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -45,6 +45,7 @@
#include "libds/common/flag_mapping.h"
#include "system/network.h"
#include "librpc/gen_ndr/irpc.h"
+#include "lib/util/smb_strtox.h"
struct samldb_ctx;
enum samldb_add_type {
diff --git a/source4/dsdb/samdb/ldb_modules/schema_load.c b/source4/dsdb/samdb/ldb_modules/schema_load.c
index 40ea42b55e4..4bbb7b0eff1 100644
--- a/source4/dsdb/samdb/ldb_modules/schema_load.c
+++ b/source4/dsdb/samdb/ldb_modules/schema_load.c
@@ -33,6 +33,7 @@
#include "lib/tdb_wrap/tdb_wrap.h"
#include "dsdb/samdb/ldb_modules/util.h"
#include "lib/ldb-samba/ldb_wrap.h"
+#include "lib/util/smb_strtox.h"
#include "system/filesys.h"
struct schema_load_private_data {
diff --git a/source4/dsdb/schema/schema_prefixmap.c b/source4/dsdb/schema/schema_prefixmap.c
index 706e48a034e..3a6a13059fd 100644
--- a/source4/dsdb/schema/schema_prefixmap.c
+++ b/source4/dsdb/schema/schema_prefixmap.c
@@ -24,6 +24,7 @@
#include "librpc/gen_ndr/ndr_drsuapi.h"
#include "librpc/gen_ndr/ndr_drsblobs.h"
#include "../lib/util/asn1.h"
+#include "lib/util/smb_strtox.h"
/**
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c
index c0b13e0d4ce..15419a65f64 100644
--- a/source4/lib/registry/ldb.c
+++ b/source4/lib/registry/ldb.c
@@ -25,6 +25,7 @@
#include "ldb_wrap.h"
#include "librpc/gen_ndr/winreg.h"
#include "param/param.h"
+#include "lib/util/smb_strtox.h"
static struct hive_operations reg_backend_ldb;
diff --git a/source4/lib/socket/interface.c b/source4/lib/socket/interface.c
index 93b60f7d32f..181893a9e7f 100644
--- a/source4/lib/socket/interface.c
+++ b/source4/lib/socket/interface.c
@@ -25,6 +25,7 @@
#include "lib/socket/netif.h"
#include "../lib/util/util_net.h"
#include "../lib/util/dlinklist.h"
+#include "lib/util/smb_strtox.h"
/* used for network interfaces */
struct interface {
diff --git a/source4/libcli/resolve/dns_ex.c b/source4/libcli/resolve/dns_ex.c
index 9ee19ffb4fd..a2e5551ea26 100644
--- a/source4/libcli/resolve/dns_ex.c
+++ b/source4/libcli/resolve/dns_ex.c
@@ -41,6 +41,7 @@
#include "lib/addns/dnsquery.h"
#include "lib/addns/dns.h"
#include "lib/util/sys_rw.h"
+#include "lib/util/smb_strtox.h"
#include <arpa/nameser.h>
#include <resolv.h>
diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c
index be1d8ba8050..414a31f4931 100644
--- a/source4/nbt_server/wins/winsdb.c
+++ b/source4/nbt_server/wins/winsdb.c
@@ -31,6 +31,7 @@
#include "system/network.h"
#include "lib/socket/netif.h"
#include "param/param.h"
+#include "lib/util/smb_strtox.h"
uint64_t winsdb_get_maxVersion(struct winsdb_handle *h)
{
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c
index 8333cb149b6..acd37131d79 100644
--- a/source4/rpc_server/lsa/dcesrv_lsa.c
+++ b/source4/rpc_server/lsa/dcesrv_lsa.c
@@ -33,6 +33,7 @@
#include "libcli/lsarpc/util_lsarpc.h"
#include "lib/messaging/irpc.h"
#include "libds/common/roles.h"
+#include "lib/util/smb_strtox.h"
#include "lib/crypto/gnutls_helpers.h"
#include <gnutls/gnutls.h>
diff --git a/source4/torture/nbench/nbench.c b/source4/torture/nbench/nbench.c
index 6e2dbe0b907..f67784e31d6 100644
--- a/source4/torture/nbench/nbench.c
+++ b/source4/torture/nbench/nbench.c
@@ -23,6 +23,7 @@
#include "torture/smbtorture.h"
#include "system/filesys.h"
#include "system/locale.h"
+#include "lib/util/smb_strtox.h"
#include "torture/nbench/proto.h"
diff --git a/source4/torture/smb2/sharemode.c b/source4/torture/smb2/sharemode.c
index 87f2f852c1c..ced4047d77d 100644
--- a/source4/torture/smb2/sharemode.c
+++ b/source4/torture/smb2/sharemode.c
@@ -25,6 +25,7 @@
#include "libcli/security/security.h"
#include "torture/torture.h"
#include "torture/smb2/proto.h"
+#include "lib/util/smb_strtox.h"
#include <tevent.h>
#define BASEDIRHOLD "sharemode_hold_test"