X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fcitserver.c;h=5aafb8a518a399a3253e7bcef46e277d1d7735fe;hb=9dc7bcd39e5c317b6ca3f4f84f458c9cfccb878d;hp=5ebd5e44cf7a01d4ecebc51e3c1a8e87f0c5e9e1;hpb=734fdd6797cc597be60ff9e9ab93477100f7d286;p=citadel.git diff --git a/citadel/citserver.c b/citadel/citserver.c index 5ebd5e44c..5aafb8a51 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -401,7 +401,7 @@ void cmd_iden(char *argbuf) if (num_parms(argbuf)<4) { cprintf("%d usage error\n",ERROR); return; - } + } dev_code = extract_int(argbuf,0); cli_code = extract_int(argbuf,1); @@ -419,15 +419,15 @@ void cmd_iden(char *argbuf) CC->cs_clientname[31] = 0; lprintf(9, "Looking up hostname '%s'\n", from_host); - if ((strlen(from_host)>0) && - (is_public_client(CC->cs_host))) { + if ((strlen(from_host)>0) + && ( (CC->is_local_socket) || (is_public_client(CC->cs_host)))) { if ((addr.s_addr = inet_addr(from_host)) != INADDR_NONE) locate_host(CC->cs_host, &addr); else { safestrncpy(CC->cs_host, from_host, sizeof CC->cs_host); CC->cs_host[24] = 0; - } } + } syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n", dev_code, @@ -436,7 +436,7 @@ void cmd_iden(char *argbuf) (rev_level % 100), desc); cprintf("%d Ok\n",OK); - } +} /* @@ -721,8 +721,14 @@ void begin_session(struct CitContext *con) safestrncpy(con->cs_host, config.c_fqdn, sizeof con->cs_host); con->cs_host[sizeof con->cs_host - 1] = 0; len = sizeof sin; - if (!getpeername(con->client_socket, (struct sockaddr *) &sin, &len)) - locate_host(con->cs_host, &sin.sin_addr); + if (!CC->is_local_socket) { + if (!getpeername(con->client_socket, + (struct sockaddr *) &sin, &len)) + locate_host(con->cs_host, &sin.sin_addr); + } + else { + strcpy(con->cs_host, ""); + } con->cs_flags = 0; con->upload_type = UPL_FILE; con->dl_is_net = 0;