X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Fsecurity-util.c;h=3a2e0564bb0aa6c037d429bc470bae9b4a3d1501;hb=7a410be9a313db41cc40d3f4cc8a4e988cef6046;hp=bc108cdd0fbfcd4747579ce02ce4f933bdd728c9;hpb=b116e9366c7b2ea2c2eb53b0a13df4090e176235;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"; }