smbd: Remove source3/smbd/statcache.c
[samba.git] / source3 / smbd / server.c
index 811cdbc3ccd9dc1aa9129b05b03cbc7144ee5619..6bdaca7a0a410286be5ac3cc9aa335c1eee9b77c 100644 (file)
@@ -35,6 +35,7 @@
 #include "secrets.h"
 #include "../lib/util/memcache.h"
 #include "ctdbd_conn.h"
+#include "lib/util/util_process.h"
 #include "util_cluster.h"
 #include "printing/queue_process.h"
 #include "rpc_server/rpc_config.h"
@@ -123,21 +124,6 @@ static void smbd_parent_conf_updated(struct messaging_context *msg,
        messaging_send_to_children(msg, MSG_SMB_CONF_UPDATED, NULL);
 }
 
-/*******************************************************************
- Delete a statcache entry.
- ********************************************************************/
-
-static void smb_stat_cache_delete(struct messaging_context *msg,
-                                 void *private_data,
-                                 uint32_t msg_tnype,
-                                 struct server_id server_id,
-                                 DATA_BLOB *data)
-{
-       const char *name = (const char *)data->data;
-       DEBUG(10,("smb_stat_cache_delete: delete name %s\n", name));
-       stat_cache_delete(name);
-}
-
 /****************************************************************************
   Send a SIGTERM to our process group.
 *****************************************************************************/
@@ -428,7 +414,7 @@ static bool smbd_notifyd_init(struct messaging_context *msg, bool interactive,
                return true;
        }
 
-       status = smbd_reinit_after_fork(msg, ev, true, "smbd-notifyd");
+       status = smbd_reinit_after_fork(msg, ev, true);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(1, ("%s: reinit_after_fork failed: %s\n",
                          __func__, nt_errstr(status)));
@@ -644,7 +630,7 @@ static bool cleanupd_init(struct messaging_context *msg, bool interactive,
 
        close(up_pipe[0]);
 
-       status = smbd_reinit_after_fork(msg, ev, true, "cleanupd");
+       status = smbd_reinit_after_fork(msg, ev, true);
        if (!NT_STATUS_IS_OK(status)) {
                DBG_WARNING("reinit_after_fork failed: %s\n",
                            nt_errstr(status));
@@ -988,7 +974,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
        smb_set_close_on_exec(fd);
 
        if (s->parent->interactive) {
-               reinit_after_fork(msg_ctx, ev, true, NULL);
+               reinit_after_fork(msg_ctx, ev, true);
                smbd_process(ev, msg_ctx, fd, true);
                exit_server_cleanly("end of interactive mode");
                return;
@@ -1001,6 +987,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
 
        pid = fork();
        if (pid == 0) {
+               char addrstr[INET6_ADDRSTRLEN];
                NTSTATUS status = NT_STATUS_OK;
 
                /*
@@ -1014,7 +1001,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
                 * them, counting worker smbds. */
                CatchChild();
 
-               status = smbd_reinit_after_fork(msg_ctx, ev, true, NULL);
+               status = smbd_reinit_after_fork(msg_ctx, ev, true);
                if (!NT_STATUS_IS_OK(status)) {
                        if (NT_STATUS_EQUAL(status,
                                            NT_STATUS_TOO_MANY_OPENED_FILES)) {
@@ -1038,6 +1025,9 @@ static void smbd_accept_connection(struct tevent_context *ev,
                        smb_panic("reinit_after_fork() failed");
                }
 
+               print_sockaddr(addrstr, sizeof(addrstr), &addr);
+               process_set_title("smbd[%s]", "client [%s]", addrstr);
+
                smbd_process(ev, msg_ctx, fd, false);
         exit:
                exit_server_cleanly("end of child");
@@ -1275,8 +1265,6 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent,
        messaging_register(msg_ctx, NULL, MSG_SHUTDOWN, msg_exit_server);
        messaging_register(msg_ctx, ev_ctx, MSG_SMB_CONF_UPDATED,
                           smbd_parent_conf_updated);
-       messaging_register(msg_ctx, NULL, MSG_SMB_STAT_CACHE_DELETE,
-                          smb_stat_cache_delete);
        messaging_register(msg_ctx, NULL, MSG_DEBUG, smbd_msg_debug);
        messaging_register(msg_ctx, NULL, MSG_SMB_FORCE_TDIS,
                           smb_parent_send_to_children);
@@ -1615,7 +1603,6 @@ extern void build_options(bool screen);
                loadparm_s3_global_substitution();
        static const struct smbd_shim smbd_shim_fns =
        {
-               .send_stat_cache_delete_message = smbd_send_stat_cache_delete_message,
                .change_to_root_user = smbd_change_to_root_user,
                .become_authenticated_pipe_user = smbd_become_authenticated_pipe_user,
                .unbecome_authenticated_pipe_user = smbd_unbecome_authenticated_pipe_user,
@@ -1884,7 +1871,7 @@ extern void build_options(bool screen);
        if (cmdline_daemon_cfg->daemon)
                pidfile_create(lp_pid_directory(), "smbd");
 
-       status = reinit_after_fork(msg_ctx, ev_ctx, false, NULL);
+       status = reinit_after_fork(msg_ctx, ev_ctx, false);
        if (!NT_STATUS_IS_OK(status)) {
                exit_daemon("reinit_after_fork() failed", map_errno_from_nt_status(status));
        }