summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1997-12-02 23:24:26 +0000
committerAndrew Tridgell <tridge@samba.org>1997-12-02 23:24:26 +0000
commit7b10574429a098cedea689a4b1a0a12854f20758 (patch)
treee74ad4a2aa7283023effbd8e7f9d27768d58c1ab
parent0e6a7ca2ec8925806cfc3a4f01b50ebdf5c51e1a (diff)
downloadsamba-7b10574429a098cedea689a4b1a0a12854f20758.tar.gz
samba-7b10574429a098cedea689a4b1a0a12854f20758.tar.bz2
samba-7b10574429a098cedea689a4b1a0a12854f20758.zip
dont try getpeername() when Client isn't initialised
(This used to be commit a32ca542ad294ecc3848ca511337a8cc994d67be)
-rw-r--r--source3/lib/util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 2457dec14d..f5cae86430 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -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;