From fde045cd778e6b1f6ecb6189ed869e2a34195593 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Fri, 24 Sep 2004 16:39:41 +0000 Subject: [PATCH] Turned the various FERROR messages into (the more proper) FLOG. --- clientname.c | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/clientname.c b/clientname.c index 60e8af0a..7b36f78b 100644 --- a/clientname.c +++ b/clientname.c @@ -122,7 +122,7 @@ char *client_name(int fd) hint.ai_socktype = SOCK_STREAM; if ((err = getaddrinfo(addr, NULL, &hint, &answer)) != 0) { - rprintf(FERROR, RSYNC_NAME ": malformed address %s: %s\n", + rprintf(FLOG, "malformed address %s: %s\n", addr, gai_strerror(err)); return name_buf; } @@ -145,8 +145,8 @@ char *client_name(int fd) client_sockaddr(fd, &ss, &ss_len); } - if (!lookup_name(fd, &ss, ss_len, name_buf, sizeof name_buf, - port_buf, sizeof port_buf)) + if (lookup_name(fd, &ss, ss_len, name_buf, sizeof name_buf, + port_buf, sizeof port_buf) == 0) check_name(fd, &ss, name_buf); return name_buf; @@ -168,7 +168,7 @@ void client_sockaddr(int fd, if (getpeername(fd, (struct sockaddr *) ss, ss_len)) { /* FIXME: Can we really not continue? */ - rsyserr(FERROR, errno, "getpeername on fd%d failed", fd); + rsyserr(FLOG, errno, "getpeername on fd%d failed", fd); exit_cleanup(RERR_SOCKETIO); } @@ -223,9 +223,8 @@ int lookup_name(int fd, const struct sockaddr_storage *ss, NI_NAMEREQD | NI_NUMERICSERV); if (name_err != 0) { strcpy(name_buf, default_name); - rprintf(FERROR, RSYNC_NAME ": name lookup failed for %s: %s\n", - client_addr(fd), - gai_strerror(name_err)); + rprintf(FLOG, "name lookup failed for %s: %s\n", + client_addr(fd), gai_strerror(name_err)); return name_err; } @@ -246,8 +245,7 @@ int compare_addrinfo_sockaddr(const struct addrinfo *ai, const char fn[] = "compare_addrinfo_sockaddr"; if (ai->ai_family != ss_family) { - rprintf(FERROR, - "%s: response family %d != %d\n", + rprintf(FLOG, "%s: response family %d != %d\n", fn, ai->ai_family, ss_family); return 1; } @@ -271,8 +269,7 @@ int compare_addrinfo_sockaddr(const struct addrinfo *ai, sin2 = (const struct sockaddr_in6 *) ai->ai_addr; if (ai->ai_addrlen < sizeof (struct sockaddr_in6)) { - rprintf(FERROR, - "%s: too short sockaddr_in6; length=%d\n", + rprintf(FLOG, "%s: too short sockaddr_in6; length=%d\n", fn, ai->ai_addrlen); return 1; } @@ -318,8 +315,7 @@ int check_name(int fd, hints.ai_socktype = SOCK_STREAM; error = getaddrinfo(name_buf, NULL, &hints, &res0); if (error) { - rprintf(FERROR, - RSYNC_NAME ": forward name lookup for %s failed: %s\n", + rprintf(FLOG, "forward name lookup for %s failed: %s\n", name_buf, gai_strerror(error)); strcpy(name_buf, default_name); return error; @@ -336,23 +332,17 @@ int check_name(int fd, if (!res0) { /* We hit the end of the list without finding an * address that was the same as ss. */ - rprintf(FERROR, RSYNC_NAME - ": no known address for \"%s\": " - "spoofed address?\n", - name_buf); + rprintf(FLOG, "no known address for \"%s\": " + "spoofed address?\n", name_buf); strcpy(name_buf, default_name); } else if (res == NULL) { /* We hit the end of the list without finding an * address that was the same as ss. */ - rprintf(FERROR, RSYNC_NAME - ": %s is not a known address for \"%s\": " - "spoofed address?\n", - client_addr(fd), - name_buf); + rprintf(FLOG, "%s is not a known address for \"%s\": " + "spoofed address?\n", client_addr(fd), name_buf); strcpy(name_buf, default_name); } freeaddrinfo(res0); return 0; } - -- 2.34.1