s3-smbd: Remove obsolete smbd_set_server_fd().
authorAndreas Schneider <asn@samba.org>
Thu, 16 Jun 2011 14:08:09 +0000 (16:08 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 4 Jul 2011 08:28:36 +0000 (18:28 +1000)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
source3/include/proto.h
source3/smbd/globals.c
source3/smbd/server.c

index 9e6cfc1c08df33f03bfbbb33699dff3a4a65fb6c..91905d3cbcb49b4aaddff9e5f05ce1224e10c772 100644 (file)
@@ -1819,7 +1819,6 @@ void send_stat_cache_delete_message(struct messaging_context *msg_ctx,
 NTSTATUS can_delete_directory(struct connection_struct *conn,
                                const char *dirname);
 bool change_to_root_user(void);
-void smbd_set_server_fd(int fd);
 void contend_level2_oplocks_begin(files_struct *fsp,
                                  enum level2_contention_type type);
 void contend_level2_oplocks_end(files_struct *fsp,
index 2736fa69d0be7adeb4a35a3ba6cc0239df5956a8..fe743a6965771f897daf497060f171f115898cc2 100644 (file)
@@ -176,32 +176,3 @@ void smbd_init_globals(void)
        smbd_server_conn->smb1.echo_handler.trusted_fd = -1;
        smbd_server_conn->smb1.echo_handler.socket_lock_fd = -1;
 }
-
-void smbd_set_server_fd(int fd)
-{
-       struct smbd_server_connection *sconn = smbd_server_conn;
-       char addr[INET6_ADDRSTRLEN];
-       const char *name;
-
-       sconn->sock = fd;
-
-       /*
-        * Initialize sconn->client_id: If we can't find the client's
-        * name, default to its address.
-        */
-
-       client_addr(fd, sconn->client_id.addr, sizeof(sconn->client_id.addr));
-
-       name = client_name(sconn->sock);
-       if (strcmp(name, "UNKNOWN") != 0) {
-               name = talloc_strdup(sconn, name);
-       } else {
-               name = NULL;
-       }
-       sconn->client_id.name =
-               (name != NULL) ? name : sconn->client_id.addr;
-
-       sub_set_socket_ids(sconn->client_id.addr, sconn->client_id.name,
-                          client_socket_addr(sconn->sock, addr,
-                                             sizeof(addr)));
-}
index 03d971b9b40b0c11ed76ac7604d73d8f300a542b..3f656ac541382a8d562d70d73251bf38d4dc9d4e 100644 (file)
@@ -371,6 +371,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
                                   uint16_t flags,
                                   void *private_data)
 {
+       struct smbd_server_connection *sconn = smbd_server_conn;
        struct smbd_open_socket *s = talloc_get_type_abort(private_data,
                                     struct smbd_open_socket);
        struct sockaddr_storage addr;
@@ -380,8 +381,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
        uint64_t unique_id;
 
        fd = accept(s->fd, (struct sockaddr *)(void *)&addr,&in_addrlen);
-       smbd_set_server_fd(fd);
-
+       sconn->sock = fd;
        if (fd == -1 && errno == EINTR)
                return;
 
@@ -392,14 +392,14 @@ static void smbd_accept_connection(struct tevent_context *ev,
        }
 
        if (s->parent->interactive) {
-               smbd_process(smbd_server_conn);
+               smbd_process(sconn);
                exit_server_cleanly("end of interactive mode");
                return;
        }
 
        if (!allowable_number_of_smbd_processes()) {
                close(fd);
-               smbd_set_server_fd(-1);
+               sconn->sock = -1;
                return;
        }
 
@@ -489,8 +489,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
                getpeername failure if we reopen the logs
                and use %I in the filename.
        */
-
-       smbd_set_server_fd(-1);
+       sconn->sock = -1;
 
        if (pid != 0) {
                add_child_pid(pid);
@@ -1252,7 +1251,7 @@ extern void build_options(bool screen);
                /* Started from inetd. fd 0 is the socket. */
                /* We will abort gracefully when the client or remote system
                   goes away */
-               smbd_set_server_fd(dup(0));
+               smbd_server_conn->sock = dup(0);
 
                /* close our standard file descriptors */
                close_low_fds(False); /* Don't close stderr */