1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

librpc/rpc: allow "assoc_group_id" in dcerpc_binding_[g|s]et_string()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
Stefan Metzmacher 2014-02-11 19:33:09 +01:00 committed by Günther Deschner
parent 5ba5430538
commit 43800553bb
2 changed files with 30 additions and 0 deletions

View File

@ -567,6 +567,19 @@ _PUBLIC_ const char *dcerpc_binding_get_string_option(const struct dcerpc_bindin
return derpc_transport_string_by_transport(b->transport);
}
ret = strcmp(name, "assoc_group_id");
if (ret == 0) {
char *tmp = discard_const_p(char, b->assoc_group_string);
if (b->assoc_group_id == 0) {
return NULL;
}
snprintf(tmp, sizeof(b->assoc_group_string),
"0x%08x", b->assoc_group_id);
return (const char *)b->assoc_group_string;
}
for (i=0; i < ARRAY_SIZE(specials); i++) {
ret = strcmp(specials[i].name, name);
if (ret != 0) {
@ -690,6 +703,22 @@ _PUBLIC_ NTSTATUS dcerpc_binding_set_string_option(struct dcerpc_binding *b,
return dcerpc_binding_set_object(b, uuid);
}
ret = strcmp(name, "assoc_group_id");
if (ret == 0) {
uint32_t assoc_group_id = 0;
if (value != NULL) {
char c;
ret = sscanf(value, "0x%08x%c", &assoc_group_id, &c);
if (ret != 1) {
return NT_STATUS_INVALID_PARAMETER_MIX;
}
}
return dcerpc_binding_set_assoc_group_id(b, assoc_group_id);
}
for (i=0; i < ARRAY_SIZE(specials); i++) {
ret = strcmp(specials[i].name, name);
if (ret != 0) {

View File

@ -51,6 +51,7 @@ struct dcerpc_binding {
const char **options;
uint32_t flags;
uint32_t assoc_group_id;
char assoc_group_string[11]; /* 0x3456789a + '\0' */
};
/* dcerpc pipe flags */