The branch, v3-2-test has been updated
       via  a52237e3a10aa4ac15cd9e7b859a54c46bfa9cdf (commit)
      from  841f4ccbfb5f79ac4f447342e9dd6ef73cacbc65 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit a52237e3a10aa4ac15cd9e7b859a54c46bfa9cdf
Author: Stefan Metzmacher <[EMAIL PROTECTED]>
Date:   Tue Dec 11 15:08:18 2007 +0100

    winbindd: pass const char *logfile to winbindd_dump_maps_async()
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 source/winbindd/winbindd_idmap.c |    6 +++---
 source/winbindd/winbindd_sid.c   |   16 ++++++++++++----
 2 files changed, 15 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/winbindd/winbindd_idmap.c b/source/winbindd/winbindd_idmap.c
index 379e7b5..be090af 100644
--- a/source/winbindd/winbindd_idmap.c
+++ b/source/winbindd/winbindd_idmap.c
@@ -772,15 +772,15 @@ static void winbindd_dump_id_maps_recv(TALLOC_CTX 
*mem_ctx, bool success,
        cont(private_data, True);
 }
 
-void winbindd_dump_maps_async(TALLOC_CTX *mem_ctx, void *data, int size,
+void winbindd_dump_maps_async(TALLOC_CTX *mem_ctx, const char *logfile,
                         void (*cont)(void *private_data, bool success),
                         void *private_data)
 {
        struct winbindd_request request;
        ZERO_STRUCT(request);
        request.cmd = WINBINDD_DUAL_DUMP_MAPS;
-       request.extra_data.data = (char *)data;
-       request.extra_len = size;
+       request.extra_data.data = discard_const(logfile);
+       request.extra_len = strlen(logfile)+1;
        do_async(mem_ctx, idmap_child(), &request, winbindd_dump_id_maps_recv,
                 (void *)cont, private_data);
 }
diff --git a/source/winbindd/winbindd_sid.c b/source/winbindd/winbindd_sid.c
index 601971e..c01c6f0 100644
--- a/source/winbindd/winbindd_sid.c
+++ b/source/winbindd/winbindd_sid.c
@@ -532,6 +532,8 @@ static void dump_maps_recv(void *private_data, bool success)
 
 void winbindd_dump_maps(struct winbindd_cli_state *state)
 {
+       const char *logfile;
+
        if ( ! state->privileged) {
                DEBUG(0, ("Only root is allowed to ask for an idmap dump!\n"));
                request_error(state);
@@ -540,9 +542,15 @@ void winbindd_dump_maps(struct winbindd_cli_state *state)
 
        DEBUG(3, ("[%5lu]: dump maps\n", (unsigned long)state->pid));
 
-       winbindd_dump_maps_async(state->mem_ctx,
-                       state->request.extra_data.data,
-                       state->request.extra_len,
-                       dump_maps_recv, state);
+       logfile = talloc_strndup(state->mem_ctx,
+                                (const char *)state->request.extra_data.data,
+                                state->request.extra_len);
+       if (!logfile) {
+               request_error(state);
+               return;
+       }
+
+       winbindd_dump_maps_async(state->mem_ctx, logfile,
+                                dump_maps_recv, state);
 }
 


-- 
Samba Shared Repository

Reply via email to