switch (p[0]) {
case 'U':
id->type = WBC_ID_TYPE_UID;
- id->id.uid = strtoul_err(p+1, &q, 10, &error);
+ id->id.uid = smb_strtoul(p+1,
+ &q,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
break;
case 'G':
id->type = WBC_ID_TYPE_GID;
- id->id.gid = strtoul_err(p+1, &q, 10, &error);
+ id->id.gid = smb_strtoul(p+1,
+ &q,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
break;
case 'B':
id->type = WBC_ID_TYPE_BOTH;
- id->id.uid = strtoul_err(p+1, &q, 10, &error);
+ id->id.uid = smb_strtoul(p+1,
+ &q,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
break;
default:
id->type = WBC_ID_TYPE_NOT_SPECIFIED;
/* Get the SID revision number */
p = str+2;
- x = (uint64_t)strtoul_err(p, &q, 10, &error);
+ x = (uint64_t)smb_strtoul(p, &q, 10, &error, SMB_STR_STANDARD);
if (x == 0 || x > UINT8_MAX || !q || *q != '-' || error != 0) {
wbc_status = WBC_ERR_INVALID_SID;
BAIL_ON_WBC_ERROR(wbc_status);
* be expressed as a hex value, according to MS-DTYP.
*/
p = q+1;
- x = strtoull_err(p, &q, 0, &error);
+ x = smb_strtoull(p, &q, 0, &error, SMB_STR_STANDARD);
if (!q || *q != '-' || (x & AUTHORITY_MASK) || error != 0) {
wbc_status = WBC_ERR_INVALID_SID;
BAIL_ON_WBC_ERROR(wbc_status);
p = q +1;
sid->num_auths = 0;
while (sid->num_auths < WBC_MAXSUBAUTHS) {
- x = strtoull_err(p, &q, 10, &error);
+ x = smb_strtoull(p, &q, 10, &error, SMB_STR_ALLOW_NO_CONVERSION);
if (p == q)
break;
if (x > UINT32_MAX || error != 0) {
p = extra_data;
- num_domains = strtoul_err(p, &q, 10, &error);
+ num_domains = smb_strtoul(p, &q, 10, &error, SMB_STR_STANDARD);
if (*q != '\n' || error != 0) {
goto wbc_err_invalid;
}
p = q+1;
}
- num_names = strtoul_err(p, &q, 10, &error);
+ num_names = smb_strtoul(p, &q, 10, &error, SMB_STR_STANDARD);
if (*q != '\n' || error != 0) {
goto wbc_err_invalid;
}
for (i=0; i<num_names; i++) {
- names[i].domain_index = strtoul_err(p, &q, 10, &error);
+ names[i].domain_index = smb_strtoul(p,
+ &q,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (names[i].domain_index < 0 || error != 0) {
goto wbc_err_invalid;
}
}
p = q+1;
- names[i].type = strtoul_err(p, &q, 10, &error);
+ names[i].type = smb_strtoul(p, &q, 10, &error, SMB_STR_STANDARD);
if (*q != ' ' || error != 0) {
goto wbc_err_invalid;
}
goto done;
}
- types[i] = (enum wbcSidType)strtoul_err(p, &q, 10, &error);
+ types[i] = (enum wbcSidType)smb_strtoul(p,
+ &q,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (*q != ' ' || error != 0) {
wbc_status = WBC_ERR_INVALID_RESPONSE;
* Return true if input was valid, false otherwise. */
static bool parse_mapping_arg(char *arg, int *id, char **sid)
{
- char *tmp, *endptr;
+ char *tmp;
int error = 0;
if (!arg || !*arg)
/* Because atoi() can return 0 on invalid input, which would be a valid
* UID/GID we must use strtoul() and do error checking */
- *id = strtoul_err(tmp, &endptr, 10, &error);
-
- if (endptr[0] != '\0' || error != 0)
+ *id = smb_strtoul(tmp, NULL, 10, &error, SMB_STR_FULL_STR_CONV);
+ if (error != 0)
return false;
return true;
int error = 0;
uint32_t rid;
- rid = strtoul_err(ridstr, NULL, 10, &error);
+ rid = smb_strtoul(ridstr, NULL, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
d_printf("failed to convert rid\n");
goto done;