git.samba.org
/
samba.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: Make sid_parse return the parsed length
[samba.git]
/
source4
/
dsdb
/
common
/
util.c
diff --git
a/source4/dsdb/common/util.c
b/source4/dsdb/common/util.c
index 7cc9729bc3fef4f479afda47b95248b407959e84..411d1dd22b05d2d55fe674b5f9837b7d7b69cf45 100644
(file)
--- a/
source4/dsdb/common/util.c
+++ b/
source4/dsdb/common/util.c
@@
-342,7
+342,7
@@
uint32_t samdb_result_rid_from_sid(TALLOC_CTX *mem_ctx, const struct ldb_message
struct dom_sid *samdb_result_dom_sid(TALLOC_CTX *mem_ctx, const struct ldb_message *msg,
const char *attr)
{
struct dom_sid *samdb_result_dom_sid(TALLOC_CTX *mem_ctx, const struct ldb_message *msg,
const char *attr)
{
-
bool ok
;
+
struct sid_parse_ret ret
;
const struct ldb_val *v;
struct dom_sid *sid;
v = ldb_msg_find_ldb_val(msg, attr);
const struct ldb_val *v;
struct dom_sid *sid;
v = ldb_msg_find_ldb_val(msg, attr);
@@
-353,8
+353,8
@@
struct dom_sid *samdb_result_dom_sid(TALLOC_CTX *mem_ctx, const struct ldb_messa
if (sid == NULL) {
return NULL;
}
if (sid == NULL) {
return NULL;
}
-
ok
= sid_parse(v->data, v->length, sid);
- if (
!ok
) {
+
ret
= sid_parse(v->data, v->length, sid);
+ if (
ret.len == -1
) {
talloc_free(sid);
return NULL;
}
talloc_free(sid);
return NULL;
}
@@
-5809,7
+5809,8
@@
static int dsdb_count_domain_callback(
case LDB_REPLY_ENTRY:
{
struct dsdb_count_domain_context *context = NULL;
case LDB_REPLY_ENTRY:
{
struct dsdb_count_domain_context *context = NULL;
- bool ok, in_domain;
+ struct sid_parse_ret ret;
+ bool in_domain;
struct dom_sid sid;
const struct ldb_val *v;
struct dom_sid sid;
const struct ldb_val *v;
@@
-5824,8
+5825,8
@@
static int dsdb_count_domain_callback(
break;
}
break;
}
-
ok
= sid_parse(v->data, v->length, &sid);
- if (
!ok
) {
+
ret
= sid_parse(v->data, v->length, &sid);
+ if (
ret.len == -1
) {
break;
}
break;
}