summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/groupdb/mapping.c5
-rw-r--r--source3/groupdb/mapping_tdb.c21
-rw-r--r--source3/lib/interface.c17
-rw-r--r--source3/lib/messages_dgm.c4
-rw-r--r--source3/lib/namemap_cache.c10
-rw-r--r--source3/lib/sysquotas.c6
-rw-r--r--source3/lib/tldap_util.c2
-rw-r--r--source3/lib/util_str.c6
-rw-r--r--source3/modules/vfs_ceph_snapshots.c20
-rw-r--r--source3/modules/vfs_preopen.c2
-rw-r--r--source3/modules/vfs_snapper.c2
-rw-r--r--source3/modules/vfs_unityed_media.c7
-rw-r--r--source3/passdb/account_pol.c6
-rw-r--r--source3/passdb/pdb_ldap.c53
-rw-r--r--source3/passdb/pdb_tdb.c6
-rw-r--r--source3/rpcclient/cmd_samr.c2
-rw-r--r--source3/rpcclient/cmd_spoolss.c6
-rw-r--r--source3/utils/net_idmap.c5
-rw-r--r--source3/utils/net_registry.c8
-rw-r--r--source3/utils/net_rpc_registry.c2
-rw-r--r--source3/utils/net_sam.c9
-rw-r--r--source3/utils/pdbedit.c9
-rw-r--r--source3/utils/regedit_dialog.c5
-rw-r--r--source3/winbindd/idmap_ldap.c6
-rw-r--r--source3/winbindd/winbindd_lookuprids.c2
-rw-r--r--source3/winbindd/winbindd_util.c20
26 files changed, 159 insertions, 82 deletions
diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c
index 77eb0d6e5cd..1e25c5637dc 100644
--- a/source3/groupdb/mapping.c
+++ b/source3/groupdb/mapping.c
@@ -245,10 +245,11 @@ int smb_create_group(const char *unix_group, gid_t *new_gid)
nread = read(fd, output, sizeof(output)-1);
if (nread > 0) {
output[nread] = '\0';
- *new_gid = (gid_t)strtoul_err(output,
+ *new_gid = (gid_t)smb_strtoul(output,
NULL,
10,
- &error);
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
*new_gid = 0;
close(fd);
diff --git a/source3/groupdb/mapping_tdb.c b/source3/groupdb/mapping_tdb.c
index c80ff1f859a..b7ff724ba05 100644
--- a/source3/groupdb/mapping_tdb.c
+++ b/source3/groupdb/mapping_tdb.c
@@ -857,7 +857,6 @@ static int convert_ldb_record(TDB_CONTEXT *ltdb, TDB_DATA key,
size_t len;
char *name;
char *val;
- char *q;
uint32_t num_mem = 0;
struct dom_sid *members = NULL;
int error = 0;
@@ -975,8 +974,12 @@ static int convert_ldb_record(TDB_CONTEXT *ltdb, TDB_DATA key,
/* we ignore unknown or uninteresting attributes
* (objectclass, etc.) */
if (strcasecmp_m(name, "gidNumber") == 0) {
- map->gid = strtoul_err(val, &q, 10, &error);
- if (*q || (error != 0)) {
+ map->gid = smb_strtoul(val,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_FULL_STR_CONV);
+ if (error != 0) {
errno = EIO;
goto failed;
}
@@ -986,11 +989,13 @@ static int convert_ldb_record(TDB_CONTEXT *ltdb, TDB_DATA key,
goto failed;
}
} else if (strcasecmp_m(name, "sidNameUse") == 0) {
- map->sid_name_use = strtoul_err(val,
- &q,
- 10,
- &error);
- if (*q || (error != 0)) {
+ map->sid_name_use =
+ smb_strtoul(val,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_FULL_STR_CONV);
+ if (error != 0) {
errno = EIO;
goto failed;
}
diff --git a/source3/lib/interface.c b/source3/lib/interface.c
index 31066b8b5cc..af81695abab 100644
--- a/source3/lib/interface.c
+++ b/source3/lib/interface.c
@@ -370,7 +370,11 @@ static void parse_extra_info(char *key, uint64_t *speed, uint32_t *cap,
*val++ = 0;
if (strequal_m(key, "speed")) {
- *speed = (uint64_t)strtoull_err(val, NULL, 0, &error);
+ *speed = (uint64_t)smb_strtoull(val,
+ NULL,
+ 0,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
DBG_DEBUG("Invalid speed value (%s)\n", val);
}
@@ -384,7 +388,11 @@ static void parse_extra_info(char *key, uint64_t *speed, uint32_t *cap,
"'%s'\n", val);
}
} else if (strequal_m(key, "if_index")) {
- *if_index = (uint32_t)strtoul_err(val, NULL, 0, &error);
+ *if_index = (uint32_t)smb_strtoul(val,
+ NULL,
+ 0,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
DBG_DEBUG("Invalid key value (%s)\n", val);
}
@@ -523,11 +531,10 @@ static void interpret_interface(char *token)
}
} else {
int error = 0;
- char *endp = NULL;
unsigned long val;
- val = strtoul_err(p, &endp, 0, &error);
- if (error != 0 || *endp != '\0') {
+ val = smb_strtoul(p, NULL, 0, &error, SMB_STR_FULL_STR_CONV);
+ if (error != 0) {
DEBUG(2,("interpret_interface: "
"can't determine netmask value from %s\n",
p));
diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c
index 2d90f525f1d..60a12e2008f 100644
--- a/source3/lib/messages_dgm.c
+++ b/source3/lib/messages_dgm.c
@@ -1469,7 +1469,7 @@ static int messaging_dgm_read_unique(int fd, uint64_t *punique)
}
buf[rw_ret] = '\0';
- unique = strtoull_err(buf, &endptr, 10, &error);
+ unique = smb_strtoull(buf, &endptr, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
return error;
}
@@ -1640,7 +1640,7 @@ int messaging_dgm_forall(int (*fn)(pid_t pid, void *private_data),
unsigned long pid;
int ret;
- pid = strtoul_err(dp->d_name, NULL, 10, &error);
+ pid = smb_strtoul(dp->d_name, NULL, 10, &error, SMB_STR_STANDARD);
if ((pid == 0) || (error != 0)) {
/*
* . and .. and other malformed entries
diff --git a/source3/lib/namemap_cache.c b/source3/lib/namemap_cache.c
index 42656ede0b7..7075b7c5b1e 100644
--- a/source3/lib/namemap_cache.c
+++ b/source3/lib/namemap_cache.c
@@ -107,7 +107,6 @@ static void namemap_cache_find_sid_parser(
const char *name;
const char *typebuf;
int error = 0;
- char *endptr;
unsigned long type;
state->ok = false;
@@ -125,8 +124,8 @@ static void namemap_cache_find_sid_parser(
return;
}
- type = strtoul_err(typebuf, &endptr, 10, &error);
- if ((*endptr != '\0') || (error != 0)) {
+ type = smb_strtoul(typebuf, NULL, 10, &error, SMB_STR_FULL_STR_CONV);
+ if (error != 0) {
return;
}
@@ -251,7 +250,6 @@ static void namemap_cache_find_name_parser(
const char *sidbuf;
const char *sid_endptr;
const char *typebuf;
- char *endptr;
int error = 0;
struct dom_sid sid;
unsigned long type;
@@ -276,8 +274,8 @@ static void namemap_cache_find_name_parser(
return;
}
- type = strtoul_err(typebuf, &endptr, 10, &error);
- if ((*endptr != '\0') || (error != 0)) {
+ type = smb_strtoul(typebuf, NULL, 10, &error, SMB_STR_FULL_STR_CONV);
+ if (error != 0) {
return;
}
diff --git a/source3/lib/sysquotas.c b/source3/lib/sysquotas.c
index 864d9dd5c56..66436e86efd 100644
--- a/source3/lib/sysquotas.c
+++ b/source3/lib/sysquotas.c
@@ -311,7 +311,11 @@ static int command_get_quota(const char *path, enum SMB_QUOTA_TYPE qtype, unid_t
/* we need to deal with long long unsigned here, if supported */
- dp->qflags = strtoul_err(line, &p2, 10, &error);
+ dp->qflags = smb_strtoul(line,
+ &p2,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
goto invalid_param;
}
diff --git a/source3/lib/tldap_util.c b/source3/lib/tldap_util.c
index 78ed42be179..152942dab2c 100644
--- a/source3/lib/tldap_util.c
+++ b/source3/lib/tldap_util.c
@@ -399,7 +399,7 @@ bool tldap_pull_uint64(struct tldap_message *msg, const char *attr,
return false;
}
- result = strtoull_err(str, NULL, 10, &error);
+ result = smb_strtoull(str, NULL, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
DBG_DEBUG("Attribute conversion failed (%s)\n",
strerror(error));
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 1a27227fe41..e660e295c33 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -850,20 +850,20 @@ uint64_t STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr)
uint64_t conv_str_size(const char * str)
{
uint64_t lval;
- char * end;
+ char *end;
int error = 0;
if (str == NULL || *str == '\0') {
return 0;
}
- lval = strtoull_err(str, &end, 10, &error);
+ lval = smb_strtoull(str, &end, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
return 0;
}
- if (*end == '\0') {
+ if (*end == '\0') {
return lval;
}
diff --git a/source3/modules/vfs_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c
index 0012962ac97..4d935a55a1a 100644
--- a/source3/modules/vfs_ceph_snapshots.c
+++ b/source3/modules/vfs_ceph_snapshots.c
@@ -83,25 +83,25 @@ static int ceph_snap_get_btime(struct vfs_handle_struct *handle,
/* First component is seconds, extract it */
*s = '\0';
- snap_timespec.tv_sec = strtoull_err(snap_btime, &endptr, 10, &err);
+ snap_timespec.tv_sec = smb_strtoull(snap_btime,
+ &endptr,
+ 10,
+ &err,
+ SMB_STR_FULL_STR_CONV);
if (err != 0) {
return -err;
}
- if ((endptr == snap_btime) || (*endptr != '\0')) {
- DBG_ERR("couldn't process snap.tv_sec in %s\n", snap_btime);
- return -EINVAL;
- }
/* second component is nsecs */
s++;
- snap_timespec.tv_nsec = strtoul_err(s, &endptr, 10, &err);
+ snap_timespec.tv_nsec = smb_strtoul(s,
+ &endptr,
+ 10,
+ &err,
+ SMB_STR_FULL_STR_CONV);
if (err != 0) {
return -err;
}
- if ((endptr == s) || (*endptr != '\0')) {
- DBG_ERR("couldn't process snap.tv_nsec in %s\n", s);
- return -EINVAL;
- }
/*
* >> 30 is a rough divide by ~10**9. No need to be exact, as @GMT
diff --git a/source3/modules/vfs_preopen.c b/source3/modules/vfs_preopen.c
index a2afbf179f8..4a6816129ed 100644
--- a/source3/modules/vfs_preopen.c
+++ b/source3/modules/vfs_preopen.c
@@ -366,7 +366,7 @@ static bool preopen_parse_fname(const char *fname, unsigned long *pnum,
return false;
}
- num = strtoul_err(p, (char **)&q, 10, &error);
+ num = smb_strtoul(p, (char **)&q, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
return false;
}
diff --git a/source3/modules/vfs_snapper.c b/source3/modules/vfs_snapper.c
index 39b8ccb097a..d862eb3151d 100644
--- a/source3/modules/vfs_snapper.c
+++ b/source3/modules/vfs_snapper.c
@@ -1250,7 +1250,7 @@ static NTSTATUS snapper_snap_path_to_id(TALLOC_CTX *mem_ctx,
}
str_idx++;
- snap_id = strtoul_err(str_idx, NULL, 10, &error);
+ snap_id = smb_strtoul(str_idx, NULL, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
talloc_free(path_dup);
return NT_STATUS_INVALID_PARAMETER;
diff --git a/source3/modules/vfs_unityed_media.c b/source3/modules/vfs_unityed_media.c
index 06bbe99402c..43285191cd2 100644
--- a/source3/modules/vfs_unityed_media.c
+++ b/source3/modules/vfs_unityed_media.c
@@ -100,7 +100,6 @@ typedef struct um_dirinfo_struct {
static bool get_digit_group(const char *path, uintmax_t *digit)
{
const char *p = path;
- char *endp = NULL;
codepoint_t cp;
size_t size;
int error = 0;
@@ -121,7 +120,11 @@ static bool get_digit_group(const char *path, uintmax_t *digit)
return false;
}
if ((size == 1) && (isdigit(cp))) {
- *digit = (uintmax_t)strtoul_err(p, &endp, 10, &error);
+ *digit = (uintmax_t)smb_strtoul(p,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
return false;
}
diff --git a/source3/passdb/account_pol.c b/source3/passdb/account_pol.c
index 4a180cb19bd..ee667815bc1 100644
--- a/source3/passdb/account_pol.c
+++ b/source3/passdb/account_pol.c
@@ -459,7 +459,11 @@ bool cache_account_policy_get(enum pdb_policy_type type, uint32_t *value)
int error = 0;
uint32_t tmp;
- tmp = strtoul_err(cache_value, NULL, 10, &error);
+ tmp = smb_strtoul(cache_value,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
goto done;
}
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 85e9db8bb1f..3dbc8f9f07a 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -996,7 +996,11 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state,
ctx);
if (temp) {
/* We've got a uid, feed the cache */
- unix_pw.pw_uid = strtoul_err(temp, NULL, 10, &error);
+ unix_pw.pw_uid = smb_strtoul(temp,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
DBG_ERR("Failed to convert UID\n");
goto fn_exit;
@@ -1010,7 +1014,11 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state,
ctx);
if (temp) {
/* We've got a uid, feed the cache */
- unix_pw.pw_gid = strtoul_err(temp, NULL, 10, &error);
+ unix_pw.pw_gid = smb_strtoul(temp,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
DBG_ERR("Failed to convert GID\n");
goto fn_exit;
@@ -2938,7 +2946,11 @@ static NTSTATUS ldapsam_enum_group_memberships(struct pdb_methods *methods,
ret = NT_STATUS_INTERNAL_DB_CORRUPTION;
goto done;
}
- primary_gid = strtoul_err(gidstr, NULL, 10, &error);
+ primary_gid = smb_strtoul(gidstr,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
DBG_ERR("Failed to convert GID\n");
goto done;
@@ -2995,7 +3007,6 @@ static NTSTATUS ldapsam_enum_group_memberships(struct pdb_methods *methods,
fstring str;
struct dom_sid sid;
gid_t gid;
- char *end;
if (!smbldap_get_single_attribute(smbldap_get_ldap(conn),
entry, "sambaSID",
@@ -3010,9 +3021,9 @@ static NTSTATUS ldapsam_enum_group_memberships(struct pdb_methods *methods,
str, sizeof(str)-1))
continue;
- gid = strtoul_err(str, &end, 10, &error);
+ gid = smb_strtoul(str, NULL, 10, &error, SMB_STR_FULL_STR_CONV);
- if ((PTR_DIFF(end, str) != strlen(str)) || (error != 0)) {
+ if (error != 0) {
goto done;
}
@@ -4976,7 +4987,11 @@ static NTSTATUS ldapsam_get_new_rid(struct ldapsam_privates *priv,
value = smbldap_talloc_single_attribute(priv2ld(priv), entry,
"sambaNextRid", mem_ctx);
if (value != NULL) {
- tmp = (uint32_t)strtoul_err(value, NULL, 10, &error);
+ tmp = (uint32_t)smb_strtoul(value,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
goto done;
}
@@ -4987,7 +5002,11 @@ static NTSTATUS ldapsam_get_new_rid(struct ldapsam_privates *priv,
value = smbldap_talloc_single_attribute(priv2ld(priv), entry,
"sambaNextUserRid", mem_ctx);
if (value != NULL) {
- tmp = (uint32_t)strtoul_err(value, NULL, 10, &error);
+ tmp = (uint32_t)smb_strtoul(value,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
goto done;
}
@@ -4998,7 +5017,11 @@ static NTSTATUS ldapsam_get_new_rid(struct ldapsam_privates *priv,
value = smbldap_talloc_single_attribute(priv2ld(priv), entry,
"sambaNextGroupRid", mem_ctx);
if (value != NULL) {
- tmp = (uint32_t)strtoul_err(value, NULL, 10, &error);
+ tmp = (uint32_t)smb_strtoul(value,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
goto done;
}
@@ -5136,7 +5159,11 @@ static bool ldapsam_sid_to_id(struct pdb_methods *methods,
goto done;
}
- id->id = strtoul_err(gid_str, NULL, 10, &error);
+ id->id = smb_strtoul(gid_str,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
goto done;
}
@@ -5156,7 +5183,7 @@ static bool ldapsam_sid_to_id(struct pdb_methods *methods,
goto done;
}
- id->id = strtoul_err(value, NULL, 10, &error);
+ id->id = smb_strtoul(value, NULL, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
goto done;
}
@@ -5747,7 +5774,7 @@ static NTSTATUS ldapsam_create_dom_group(struct pdb_methods *my_methods,
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
- gid = strtoul_err(tmp, NULL, 10, &error);
+ gid = smb_strtoul(tmp, NULL, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
DBG_ERR("Failed to convert gidNumber\n");
return NT_STATUS_UNSUCCESSFUL;
@@ -6024,7 +6051,7 @@ static NTSTATUS ldapsam_change_groupmem(struct pdb_methods *my_methods,
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
- user_gid = strtoul_err(gidstr, NULL, 10, &error);
+ user_gid = smb_strtoul(gidstr, NULL, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
DBG_ERR("Failed to convert user gid\n");
return NT_STATUS_UNSUCCESSFUL;
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c
index 067150334a3..0c97e70bad4 100644
--- a/source3/passdb/pdb_tdb.c
+++ b/source3/passdb/pdb_tdb.c
@@ -1183,7 +1183,11 @@ static int tdbsam_collect_rids(struct db_record *rec, void *private_data)
return 0;
}
- rid = strtoul_err((char *)key.dptr+prefixlen, NULL, 16, &error);
+ rid = smb_strtoul((char *)key.dptr+prefixlen,
+ NULL,
+ 16,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
return 0;
}
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index 7a3855b1b4c..8cbf8ab24bd 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -1413,7 +1413,7 @@ static NTSTATUS cmd_samr_delete_alias(struct rpc_pipe_client *cli,
return NT_STATUS_OK;
}
- alias_rid = strtoul_err(argv[2], NULL, 10, &error);
+ alias_rid = smb_strtoul(argv[2], NULL, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
return NT_STATUS_INVALID_PARAMETER;
}
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index f6d631761b2..78c381b9a59 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -2708,7 +2708,11 @@ static WERROR cmd_spoolss_setprinterdata(struct rpc_pipe_client *cli,
W_ERROR_HAVE_NO_MEMORY(data.string);
break;
case REG_DWORD:
- data.value = strtoul_err(argv[4], NULL, 10, &error);
+ data.value = smb_strtoul(argv[4],
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
result = WERR_INVALID_PARAMETER;
goto done;
diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c
index d1a6db95921..0aa45f742cd 100644
--- a/source3/utils/net_idmap.c
+++ b/source3/utils/net_idmap.c
@@ -627,11 +627,10 @@ done:
static bool parse_uint32(const char *str, uint32_t *result)
{
unsigned long val;
- char *endptr;
int error = 0;
- val = strtoul_err(str, &endptr, 10, &error);
- if (error != 0 || *endptr != '\0') {
+ val = smb_strtoul(str, NULL, 10, &error, SMB_STR_FULL_STR_CONV);
+ if (error != 0) {
return false;
}
diff --git a/source3/utils/net_registry.c b/source3/utils/net_registry.c
index 74224ddbf15..c6a681de42b 100644
--- a/source3/utils/net_registry.c
+++ b/source3/utils/net_registry.c
@@ -512,7 +512,7 @@ static int net_registry_setvalue(struct net_context *c, int argc,
int error = 0;
uint32_t v;
- v = strtoul_err(argv[3], NULL, 10, &error);
+ v = smb_strtoul(argv[3], NULL, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
goto done;
}
@@ -650,7 +650,11 @@ static int net_registry_increment(struct net_context *c, int argc,
if (argc == 3) {
int error = 0;
- state.increment = strtoul_err(argv[2], NULL, 10, &error);
+ state.increment = smb_strtoul(argv[2],
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
goto done;
}
diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c
index 84936ee31ae..e47bad4e33f 100644
--- a/source3/utils/net_rpc_registry.c
+++ b/source3/utils/net_rpc_registry.c
@@ -606,7 +606,7 @@ static NTSTATUS rpc_registry_setvalue_internal(struct net_context *c,
int error = 0;
uint32_t v;
- v = strtoul_err(argv[3], NULL, 10, &error);
+ v = smb_strtoul(argv[3], NULL, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
goto error;
}
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c
index 164d9408c56..74e500f0f31 100644
--- a/source3/utils/net_sam.c
+++ b/source3/utils/net_sam.c
@@ -483,7 +483,6 @@ static int net_sam_policy_set(struct net_context *c, int argc, const char **argv
uint32_t value = 0;
uint32_t old_value = 0;
enum pdb_policy_type field;
- char *endptr;
int err = 0;
if (argc != 2 || c->display_usage) {
@@ -501,9 +500,13 @@ static int net_sam_policy_set(struct net_context *c, int argc, const char **argv
value = -1;
}
else {
- value = strtoul_err(argv[1], &endptr, 10, &err);
+ value = smb_strtoul(argv[1],
+ NULL,
+ 10,
+ &err,
+ SMB_STR_FULL_STR_CONV);
- if (err != 0 || *endptr != '\0') {
+ if (err != 0) {
d_printf(_("Unable to set policy \"%s\"! Invalid value "
"\"%s\".\n"),
account_policy, argv[1]);
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index 462c753217e..74f8c3b0b2f 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -594,15 +594,18 @@ static int set_user_info(const char *username, const char *fullname,
}
if (kickoff_time) {
- char *endptr;
time_t value = get_time_t_max();
if (strcmp(kickoff_time, "never") != 0) {
int error = 0;
uint32_t num;
- num = strtoul_err(kickoff_time, &endptr, 10, &error);
- if (error != 0 || *endptr != '\0') {
+ num = smb_strtoul(kickoff_time,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_FULL_STR_CONV);
+ if (error != 0) {
fprintf(stderr, "Failed to parse kickoff time\n");
return -1;
}
diff --git a/source3/utils/regedit_dialog.c b/source3/utils/regedit_dialog.c
index 7dd9f0fadea..c70dd44a743 100644
--- a/source3/utils/regedit_dialog.c
+++ b/source3/utils/regedit_dialog.c
@@ -1030,7 +1030,6 @@ bool dialog_section_text_field_get_uint(struct dialog_section *section,
unsigned long long *out)
{
const char *buf;
- char *endp;
int error = 0;
struct dialog_section_text_field *text_field =
talloc_get_type_abort(section, struct dialog_section_text_field);
@@ -1041,8 +1040,8 @@ bool dialog_section_text_field_get_uint(struct dialog_section *section,
if (buf == NULL) {
return false;
}
- *out = strtoull_err(buf, &endp, 0, &error);
- if (error != 0 || *endp != '\0') {
+ *out = smb_strtoull(buf, NULL, 0, &error, SMB_STR_FULL_STR_CONV);
+ if (error != 0) {
return false;
}
diff --git a/source3/winbindd/idmap_ldap.c b/source3/winbindd/idmap_ldap.c
index 822abb9f559..86cb6f1bc51 100644
--- a/source3/winbindd/idmap_ldap.c
+++ b/source3/winbindd/idmap_ldap.c
@@ -300,7 +300,7 @@ static NTSTATUS idmap_ldap_allocate_id_internal(struct idmap_domain *dom,
goto done;
}
- xid->id = strtoul_err(id_str, NULL, 10, &error);
+ xid->id = smb_strtoul(id_str, NULL, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
ret = NT_STATUS_UNSUCCESSFUL;
goto done;
@@ -775,7 +775,7 @@ again:
continue;
}
- id = strtoul_err(tmp, NULL, 10, &error);
+ id = smb_strtoul(tmp, NULL, 10, &error, SMB_STR_STANDARD);
TALLOC_FREE(tmp);
if (error != 0) {
DEBUG(5, ("Requested id (%u) out of range (%u - %u). "
@@ -1019,7 +1019,7 @@ again:
continue;
}
- id = strtoul_err(tmp, NULL, 10, &error);
+ id = smb_strtoul(tmp, NULL, 10, &error, SMB_STR_STANDARD);
TALLOC_FREE(tmp);
if (error != 0) {
DEBUG(5, ("Requested id (%u) out of range (%u - %u). "
diff --git a/source3/winbindd/winbindd_lookuprids.c b/source3/winbindd/winbindd_lookuprids.c
index 959a4a7db38..3b7b4176d18 100644
--- a/source3/winbindd/winbindd_lookuprids.c
+++ b/source3/winbindd/winbindd_lookuprids.c
@@ -184,7 +184,7 @@ static bool parse_ridlist(TALLOC_CTX *mem_ctx, char *ridstr,
char *q;
int error = 0;
- rids[i] = strtoul_err(p, &q, 10, &error);
+ rids[i] = smb_strtoul(p, &q, 10, &error, SMB_STR_STANDARD);
if (error != 0 || *q != '\n') {
DEBUG(0, ("Got invalid ridstr: %s\n", p));
return false;
diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c
index 91a2f6ef197..b79f90fb0ce 100644
--- a/source3/winbindd/winbindd_util.c
+++ b/source3/winbindd/winbindd_util.c
@@ -507,7 +507,11 @@ static void trustdom_list_done(struct tevent_req *req)
break;
}
- trust_flags = (uint32_t)strtoul_err(q, NULL, 10, &error);
+ trust_flags = (uint32_t)smb_strtoul(q,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
DBG_ERR("Failed to convert trust_flags\n");
break;
@@ -519,7 +523,11 @@ static void trustdom_list_done(struct tevent_req *req)
break;
}
- trust_type = (uint32_t)strtoul_err(q, NULL, 10, &error);
+ trust_type = (uint32_t)smb_strtoul(q,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
DBG_ERR("Failed to convert trust_type\n");
break;
@@ -531,7 +539,11 @@ static void trustdom_list_done(struct tevent_req *req)
break;
}
- trust_attribs = (uint32_t)strtoul_err(q, NULL, 10, &error);
+ trust_attribs = (uint32_t)smb_strtoul(q,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
DBG_ERR("Failed to convert trust_attribs\n");
break;
@@ -2170,7 +2182,7 @@ bool parse_xidlist(TALLOC_CTX *mem_ctx, const char *xidstr,
p += 1;
- id = strtoull_err(p, &endp, 10, &error);
+ id = smb_strtoull(p, &endp, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
goto fail;
}