s3-vfs: Replace client_id in exand msdfs.
authorAndreas Schneider <asn@samba.org>
Thu, 16 Jun 2011 12:23:54 +0000 (14:23 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 4 Jul 2011 08:28:34 +0000 (18:28 +1000)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
source3/modules/vfs_expand_msdfs.c

index eb7c6fed6b5e17e6b58417d4a20de0fcc3fb7d42..76a918f754c18be7c6722cdce396a8d3c0f511f8 100644 (file)
@@ -23,6 +23,7 @@
 #include "../librpc/gen_ndr/ndr_netlogon.h"
 #include "smbd/globals.h"
 #include "auth.h"
+#include "../lib/tsocket/tsocket.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_VFS
@@ -117,6 +118,7 @@ static char *expand_msdfs_target(TALLOC_CTX *ctx,
        int filename_len = 0;
        char *targethost = NULL;
        char *new_target = NULL;
+       char *raddr;
 
        if (filename_start == NULL) {
                DEBUG(10, ("No filename start in %s\n", target));
@@ -139,8 +141,14 @@ static char *expand_msdfs_target(TALLOC_CTX *ctx,
 
        DEBUG(10, ("Expanding from table [%s]\n", mapfilename));
 
+       raddr = tsocket_address_inet_addr_string(conn->sconn->remote_address,
+                                                ctx);
+       if (raddr == NULL) {
+               return NULL;
+       }
+
        targethost = read_target_host(
-               ctx, conn->sconn->client_id.addr, mapfilename);
+               ctx, raddr, mapfilename);
        if (targethost == NULL) {
                DEBUG(1, ("Could not expand target host from file %s\n",
                          mapfilename));