s4:s3compat make smbd_server_fd() return -1 when not yet connected
authorAndrew Bartlett <abartlet@samba.org>
Thu, 13 May 2010 01:30:03 +0000 (11:30 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 3 Jun 2010 01:14:06 +0000 (11:14 +1000)
This matches the expectation of some callers in source3/smbd

Andrew Bartlett

source4/s3compat/s3compat_globals.c

index be26378cf137527fa7e7624ca395bd57be071494..3082d82b9594924ad2b33a6e48bf2ba9d5367725 100644 (file)
@@ -45,6 +45,9 @@ int smbd_server_fd(void)
 {
        struct stream_connection *samba3_conn;
        samba3_conn = s3compat_get_conn();
+       if (samba3_conn == NULL) {
+               return -1;
+       }
        return socket_get_fd(samba3_conn->socket);
 }