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:
@ -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;
|
||||
|
Reference in New Issue
Block a user