s3:srv_epmapper: only replace ipv4 addresses in _epm_Lookup() and _epm_Map()
authorStefan Metzmacher <metze@samba.org>
Fri, 31 Jan 2014 20:10:41 +0000 (21:10 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 11 Feb 2014 15:20:30 +0000 (16:20 +0100)
The floor data for EPM_PROTOCOL_IP only handles a 4 byte ipv4 address.
"0.0.0.0" is used for ipv6 and hostnames.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/rpc_server/epmapper/srv_epmapper.c

index 758a48bee155322d66a17739d503b83898fc640e..55474c0da7ae6815c08ca117f7af479fd15eb4fe 100644 (file)
@@ -560,7 +560,9 @@ error_status_t _epm_Lookup(struct pipes_struct *p,
                        goto done;
                }
 
-               if (p->local_address != NULL) {
+               if (p->local_address != NULL &&
+                   tsocket_address_is_inet(p->local_address, "ipv4"))
+               {
                        srv_addr = tsocket_address_inet_addr_string(p->local_address,
                                                                    tmp_ctx);
                }
@@ -957,7 +959,9 @@ error_status_t _epm_Map(struct pipes_struct *p,
                        obj = r->in.object;
                }
 
-               if (p->local_address != NULL) {
+               if (p->local_address != NULL &&
+                   tsocket_address_is_inet(p->local_address, "ipv4"))
+               {
                        srv_addr = tsocket_address_inet_addr_string(p->local_address,
                                                                    tmp_ctx);
                }