Accept the origin host as indicated by the client, if the connection is from 127...
[citadel.git] / citadel / modules / ctdlproto / serv_session.c
index fa8186635381a62e51bccfd064165f57d6c4ee66..b1b6d42350f87d7590614a04f91f747c84caec81 100644 (file)
@@ -152,7 +152,7 @@ void cmd_iden(char *argbuf)
        CC->cs_clientname[31] = 0;
 
        /* For local sockets, allow the client to supply the user's origin address */
-       if (CC->is_local_socket) {
+       if ((CC->is_local_client) || (!IsEmptyStr(CC->cs_addr) && (!strcmp(CC->cs_addr, "127.0.0.1")) || (!strcmp(CC->cs_addr, "::1")))) {
                safestrncpy(CC->cs_host, from_host, sizeof CC->cs_host);
                CC->cs_host[sizeof CC->cs_host - 1] = 0;
                CC->cs_addr[0] = 0;