{
const char *domain = NULL;
int domain_len = 0;
- struct server_id myid;
- uint8_t *buf = NULL;
- int buf_len = 0;
-
- myid = messaging_server_id(msg_ctx);
if (argc < 1 || argc > 2) {
fprintf(stderr, "Usage: smbcontrol <dest> dump-domain-list "
messaging_register(msg_ctx, NULL, MSG_WINBIND_DUMP_DOMAIN_LIST,
print_pid_string_cb);
- buf_len = sizeof(myid)+domain_len;
- buf = SMB_MALLOC_ARRAY(uint8_t, buf_len);
- if (!buf) {
- return false;
- }
-
- memcpy(buf, &myid, sizeof(myid));
- memcpy(&buf[sizeof(myid)], domain, domain_len);
-
if (!send_message(msg_ctx, pid, MSG_WINBIND_DUMP_DOMAIN_LIST,
- buf, buf_len))
+ domain, domain_len))
{
- SAFE_FREE(buf);
return false;
}
/* No replies were received within the timeout period */
- SAFE_FREE(buf);
if (num_replies == 0) {
printf("No replies received\n");
}
{
TALLOC_CTX *mem_ctx;
const char *message = NULL;
- struct server_id *sender = NULL;
const char *domain = NULL;
char *s = NULL;
NTSTATUS status;
DEBUG(5,("winbind_msg_dump_domain_list received.\n"));
- if (!data || !data->data) {
- return;
- }
-
- if (data->length < sizeof(struct server_id)) {
- return;
- }
-
mem_ctx = talloc_init("winbind_msg_dump_domain_list");
if (!mem_ctx) {
return;
}
- sender = (struct server_id *)data->data;
- if (data->length > sizeof(struct server_id)) {
- domain = (const char *)data->data+sizeof(struct server_id);
+ if (data->length > 0) {
+ domain = (const char *)data->data;
}
if (domain) {
return;
}
- messaging_send_buf(msg_ctx, *sender,
+ messaging_send_buf(msg_ctx, server_id,
MSG_WINBIND_DUMP_DOMAIN_LIST,
(const uint8_t *)message, strlen(message) + 1);
}
}
- status = messaging_send_buf(msg_ctx, *sender,
+ status = messaging_send_buf(msg_ctx, server_id,
MSG_WINBIND_DUMP_DOMAIN_LIST,
(uint8_t *)s, strlen(s) + 1);
if (!NT_STATUS_IS_OK(status)) {