1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-30 19:42:05 +03:00

dont try getpeername() when Client isn't initialised

(This used to be commit a32ca542ad)
This commit is contained in:
Andrew Tridgell
1997-12-02 23:24:26 +00:00
parent 0e6a7ca2ec
commit 7b10574429

View File

@ -3541,6 +3541,10 @@ char *client_name(void)
strcpy(name_buf,"UNKNOWN");
if (Client == -1) {
return name_buf;
}
if (getpeername(Client, &sa, &length) < 0) {
DEBUG(0,("getpeername failed\n"));
return name_buf;
@ -3579,6 +3583,10 @@ char *client_addr(void)
strcpy(addr_buf,"0.0.0.0");
if (Client == -1) {
return addr_buf;
}
if (getpeername(Client, &sa, &length) < 0) {
DEBUG(0,("getpeername failed\n"));
return addr_buf;