diff options
author | Volker Lendecke <vl@samba.org> | 2011-03-08 14:23:15 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-04-13 14:13:24 -0700 |
commit | ef9d2b15e01d18dc2bf0379cc9a6df367812e287 (patch) | |
tree | 963b0522e3a2725ee93b9a7d811d4cae1917cde0 /source3 | |
parent | 58e26c2589620f04684aed620054fde4cda98969 (diff) | |
download | samba-ef9d2b15e01d18dc2bf0379cc9a6df367812e287.tar.gz samba-ef9d2b15e01d18dc2bf0379cc9a6df367812e287.tar.bz2 samba-ef9d2b15e01d18dc2bf0379cc9a6df367812e287.zip |
s3: Make parse_sidlist public
Signed-off-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/winbindd/winbindd_getsidaliases.c | 34 | ||||
-rw-r--r-- | source3/winbindd/winbindd_proto.h | 2 | ||||
-rw-r--r-- | source3/winbindd/winbindd_util.c | 31 |
3 files changed, 33 insertions, 34 deletions
diff --git a/source3/winbindd/winbindd_getsidaliases.c b/source3/winbindd/winbindd_getsidaliases.c index a90bfb31d4..f01dac9c4c 100644 --- a/source3/winbindd/winbindd_getsidaliases.c +++ b/source3/winbindd/winbindd_getsidaliases.c @@ -27,9 +27,6 @@ struct winbindd_getsidaliases_state { uint32_t *aliases; }; -static bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr, - struct dom_sid **sids, uint32_t *num_sids); - static void winbindd_getsidaliases_done(struct tevent_req *subreq); struct tevent_req *winbindd_getsidaliases_send(TALLOC_CTX *mem_ctx, @@ -155,34 +152,3 @@ NTSTATUS winbindd_getsidaliases_recv(struct tevent_req *req, response->data.num_entries = state->num_aliases; return NT_STATUS_OK; } - -static bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr, - struct dom_sid **sids, uint32_t *num_sids) -{ - const char *p; - - p = sidstr; - if (p == NULL) - return False; - - while (p[0] != '\0') { - struct dom_sid sid; - const char *q = NULL; - - if (!dom_sid_parse_endp(p, &sid, &q)) { - DEBUG(1, ("Could not parse sid %s\n", p)); - return false; - } - if ((q == NULL) || (q[0] != '\n')) { - DEBUG(1, ("Got invalid sidstr: %s\n", p)); - return false; - } - if (!NT_STATUS_IS_OK(add_sid_to_array(mem_ctx, &sid, sids, - num_sids))) - { - return False; - } - p = q+1; - } - return True; -} diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h index a9d5659f98..a5b4a64643 100644 --- a/source3/winbindd/winbindd_proto.h +++ b/source3/winbindd/winbindd_proto.h @@ -424,6 +424,8 @@ void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain); void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain); void set_auth_errors(struct winbindd_response *resp, NTSTATUS result); bool is_domain_offline(const struct winbindd_domain *domain); +bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr, + struct dom_sid **sids, uint32_t *num_sids); /* The following definitions come from winbindd/winbindd_wins.c */ diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index 1a6cf8722e..b43d7b826f 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -1370,3 +1370,34 @@ bool is_domain_offline(const struct winbindd_domain *domain) } return !domain->online; } + +bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr, + struct dom_sid **sids, uint32_t *num_sids) +{ + const char *p; + + p = sidstr; + if (p == NULL) + return False; + + while (p[0] != '\0') { + struct dom_sid sid; + const char *q = NULL; + + if (!dom_sid_parse_endp(p, &sid, &q)) { + DEBUG(1, ("Could not parse sid %s\n", p)); + return false; + } + if ((q == NULL) || (q[0] != '\n')) { + DEBUG(1, ("Got invalid sidstr: %s\n", p)); + return false; + } + if (!NT_STATUS_IS_OK(add_sid_to_array(mem_ctx, &sid, sids, + num_sids))) + { + return False; + } + p = q+1; + } + return True; +} |