bool sid_peek_check_rid(const struct dom_sid *exp_dom_sid, const struct dom_sid *sid, uint32_t *rid);
void sid_copy(struct dom_sid *dst, const struct dom_sid *src);
bool sid_blob_parse(DATA_BLOB in, struct dom_sid *sid);
-bool sid_parse(const char *inbuf, size_t len, struct dom_sid *sid);
+bool sid_parse(const uint8_t *inbuf, size_t len, struct dom_sid *sid);
int sid_compare_domain(const struct dom_sid *sid1, const struct dom_sid *sid2);
NTSTATUS add_sid_to_array(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
struct dom_sid **sids, uint32_t *num);
Parse a on-the-wire SID to a struct dom_sid.
*****************************************************************/
-bool sid_parse(const char *inbuf, size_t len, struct dom_sid *sid)
+bool sid_parse(const uint8_t *inbuf, size_t len, struct dom_sid *sid)
{
DATA_BLOB in = data_blob_const(inbuf, len);
return sid_blob_parse(in, sid);
&blob)) {
return false;
}
- ret = sid_parse((char *)blob.data, blob.length, sid);
+ ret = sid_parse(blob.data, blob.length, sid);
TALLOC_FREE(blob.data);
return ret;
}
if (!tldap_get_single_valueblob(msg, attribute, &val)) {
return false;
}
- return sid_parse((char *)val.data, val.length, sid);
+ return sid_parse(val.data, val.length, sid);
}
bool tldap_pull_guid(struct tldap_message *msg, const char *attribute,
for (i=0; values[i]; i++) {
struct dom_sid sid;
fstring tmp;
- if (!sid_parse(values[i]->bv_val, values[i]->bv_len, &sid)) {
+ if (!sid_parse((const uint8_t *)values[i]->bv_val,
+ values[i]->bv_len, &sid)) {
return;
}
printf("%s: %s\n", field, sid_to_fstring(tmp, &sid));
count = 0;
for (i=0; values[i]; i++) {
- ret = sid_parse(values[i]->bv_val, values[i]->bv_len, &(*sids)[count]);
+ ret = sid_parse((const uint8_t *)values[i]->bv_val,
+ values[i]->bv_len, &(*sids)[count]);
if (ret) {
DEBUG(10, ("pulling SID: %s\n",
sid_string_dbg(&(*sids)[count])));
return ADS_ERROR_NT(NT_STATUS_INVALID_PARAMETER);
}
- if (!sid_parse(buf, buf_len, sid)) {
+ if (!sid_parse((const uint8_t *)buf, buf_len, sid)) {
DEBUG(10,("failed to parse sid\n"));
return ADS_ERROR_NT(NT_STATUS_INVALID_PARAMETER);
}
/* the hard quotas 8 bytes (uint64_t)*/
qt.hardlim = BVAL(rdata,32);
- if (!sid_parse((const char *)rdata+40,sid_len,&qt.sid)) {
+ if (!sid_parse(rdata+40,sid_len,&qt.sid)) {
return false;
}
/* unknown 4 bytes: this is not the length of the sid :-( */
/*unknown = IVAL(pdata,0);*/
- if (!sid_parse(in_data + 4, sid_len, &sid)) {
+ if (!sid_parse(_in_data + 4, sid_len, &sid)) {
return NT_STATUS_INVALID_PARAMETER;
}
DEBUGADD(10, ("for SID: %s\n", sid_string_dbg(&sid)));
break;
}
- if (!sid_parse(pdata+8,sid_len,&sid)) {
+ if (!sid_parse((const uint8_t *)(pdata+8), sid_len,
+ &sid)) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
return;
}
/* the hard quotas 8 bytes (uint64_t)*/
qt.hardlim = BVAL(pdata,32);
- if (!sid_parse(pdata+40,sid_len,&sid)) {
+ if (!sid_parse((const uint8_t *)(pdata+40), sid_len, &sid)) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
return;
}
static bool run_local_binary_to_sid(int dummy) {
struct dom_sid *sid = talloc(NULL, struct dom_sid);
- static const char good_binary_sid[] = {
+ static const uint8_t good_binary_sid[] = {
0x1, /* revision number */
15, /* num auths */
0x1, 0x1, 0x1, 0x1, 0x1, 0x1, /* id_auth */
0x1, 0x1, 0x1, 0x1, /* auth[14] */
};
- static const char long_binary_sid[] = {
+ static const uint8_t long_binary_sid[] = {
0x1, /* revision number */
15, /* num auths */
0x1, 0x1, 0x1, 0x1, 0x1, 0x1, /* id_auth */
0x1, 0x1, 0x1, 0x1, /* auth[17] */
};
- static const char long_binary_sid2[] = {
+ static const uint8_t long_binary_sid2[] = {
0x1, /* revision number */
32, /* num auths */
0x1, 0x1, 0x1, 0x1, 0x1, 0x1, /* id_auth */