X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Fsecurity-util.c;fp=common-src%2Fsecurity-util.c;h=3a2e0564bb0aa6c037d429bc470bae9b4a3d1501;hb=cd0b924f27312d57bd42f6c4fae2b795139e2d0b;hp=bc108cdd0fbfcd4747579ce02ce4f933bdd728c9;hpb=011a59f5a54864108a16af570a6b287410597cc2;p=debian%2Famanda diff --git a/common-src/security-util.c b/common-src/security-util.c index bc108cd..3a2e056 100644 --- a/common-src/security-util.c +++ b/common-src/security-util.c @@ -2661,9 +2661,16 @@ find_port_for_service( } char * -sec_get_authenticated_peer_name_localhost( +sec_get_authenticated_peer_name_gethostname( security_handle_t *hdl G_GNUC_UNUSED) { + char *server_hostname; + server_hostname = malloc(1024); + if (gethostname(server_hostname, 1024) == 0) { + server_hostname[1023] = '\0'; + return server_hostname; + } + amfree(server_hostname); return "localhost"; }