lib: Remove unused serverid.tdb
authorVolker Lendecke <vl@samba.org>
Sun, 5 Nov 2017 11:58:09 +0000 (12:58 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 5 Dec 2017 03:58:26 +0000 (04:58 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Dec  5 04:58:26 CET 2017 on sn-devel-144

18 files changed:
source3/include/serverid.h
source3/lib/serverid.c
source3/nmbd/nmbd.c
source3/printing/nt_printing.c
source3/printing/queue_process.c
source3/printing/spoolssd.c
source3/rpc_server/epmd.c
source3/rpc_server/fssd.c
source3/rpc_server/lsasd.c
source3/rpc_server/mdssd.c
source3/smbd/negprot.c
source3/smbd/process.c
source3/smbd/scavenger.c
source3/smbd/server.c
source3/smbd/server_exit.c
source3/smbd/smbd_cleanupd.c
source3/torture/vfstest.c
source3/winbindd/winbindd.c

index a73a6f6986c6e958149b692c7a003adc92290d3f..89487cfa62d0b00d281b66a5792aeb0ba911395b 100644 (file)
 #define __SERVERID_H__
 
 #include "replace.h"
 #define __SERVERID_H__
 
 #include "replace.h"
-#include "lib/dbwrap/dbwrap.h"
 #include "librpc/gen_ndr/server_id.h"
 
 #include "librpc/gen_ndr/server_id.h"
 
-/* Flags to classify messages - used in message_send_all() */
-/* Sender will filter by flag. */
-
-#define FLAG_MSG_GENERAL               0x0001
-#define FLAG_MSG_SMBD                  0x0002
-#define FLAG_MSG_NMBD                  0x0004
-#define FLAG_MSG_WINBIND               0x0008
-#define FLAG_MSG_PRINT_GENERAL         0x0010
-/* dbwrap messages 4001-4999 */
-#define FLAG_MSG_DBWRAP                        0x0020
-
-/*
- * Register a server with its unique id
- */
-bool serverid_register(const struct server_id id, uint32_t msg_flags);
-
-/*
- * De-register a server with its unique id
- */
-bool serverid_deregister(const struct server_id id);
-
 /*
  * Check existence of a server id
  */
 bool serverid_exists(const struct server_id *id);
 
 /*
  * Check existence of a server id
  */
 bool serverid_exists(const struct server_id *id);
 
-/*
- * Walk the list of server_ids registered
- */
-bool serverid_traverse(int (*fn)(struct db_record *rec,
-                                const struct server_id *id,
-                                uint32_t msg_flags,
-                                void *private_data),
-                      void *private_data);
-
-/*
- * Walk the list of server_ids registered read-only
- */
-bool serverid_traverse_read(int (*fn)(const struct server_id *id,
-                                     uint32_t msg_flags,
-                                     void *private_data),
-                           void *private_data);
-/*
- * Ensure CLEAR_IF_FIRST works fine, to be called from the parent smbd
- */
-bool serverid_parent_init(TALLOC_CTX *mem_ctx);
-
-struct messaging_context;
-
-bool message_send_all(struct messaging_context *msg_ctx,
-                     int msg_type,
-                     const void *buf, size_t len);
-
 #endif
 #endif
index 9fd506df5fdd8d75c8ed9f0d7edef907bb260672..b4125cb914262d203aefcdb84af3620c685198cd 100644 (file)
 */
 
 #include "includes.h"
 */
 
 #include "includes.h"
-#include "system/filesys.h"
 #include "lib/util/server_id.h"
 #include "serverid.h"
 #include "lib/util/server_id.h"
 #include "serverid.h"
-#include "util_tdb.h"
-#include "dbwrap/dbwrap.h"
-#include "dbwrap/dbwrap_open.h"
-#include "lib/tdb_wrap/tdb_wrap.h"
 #include "lib/param/param.h"
 #include "ctdbd_conn.h"
 #include "lib/param/param.h"
 #include "ctdbd_conn.h"
-#include "messages.h"
 #include "lib/messages_ctdb.h"
 #include "lib/messages_dgm.h"
 
 #include "lib/messages_ctdb.h"
 #include "lib/messages_dgm.h"
 
-struct serverid_key {
-       pid_t pid;
-       uint32_t task_id;
-       uint32_t vnn;
-};
-
-struct serverid_data {
-       uint64_t unique_id;
-       uint32_t msg_flags;
-};
-
-static struct db_context *serverid_db(void)
-{
-       static struct db_context *db;
-       char *db_path;
-
-       if (db != NULL) {
-               return db;
-       }
-
-       db_path = lock_path("serverid.tdb");
-       if (db_path == NULL) {
-               return NULL;
-       }
-
-       db = db_open(NULL, db_path, 0,
-                    TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
-                    O_RDWR|O_CREAT, 0644, DBWRAP_LOCK_ORDER_2,
-                    DBWRAP_FLAG_NONE);
-       TALLOC_FREE(db_path);
-       return db;
-}
-
-bool serverid_parent_init(TALLOC_CTX *mem_ctx)
-{
-       struct db_context *db;
-
-       db = serverid_db();
-       if (db == NULL) {
-               DEBUG(1, ("could not open serverid.tdb: %s\n",
-                         strerror(errno)));
-               return false;
-       }
-
-       return true;
-}
-
-static void serverid_fill_key(const struct server_id *id,
-                             struct serverid_key *key)
-{
-       ZERO_STRUCTP(key);
-       key->pid = id->pid;
-       key->task_id = id->task_id;
-       key->vnn = id->vnn;
-}
-
-bool serverid_register(const struct server_id id, uint32_t msg_flags)
-{
-       struct db_context *db;
-       struct serverid_key key;
-       struct serverid_data data;
-       struct db_record *rec;
-       TDB_DATA tdbkey, tdbdata;
-       NTSTATUS status;
-       bool ret = false;
-
-       db = serverid_db();
-       if (db == NULL) {
-               return false;
-       }
-
-       serverid_fill_key(&id, &key);
-       tdbkey = make_tdb_data((uint8_t *)&key, sizeof(key));
-
-       rec = dbwrap_fetch_locked(db, talloc_tos(), tdbkey);
-       if (rec == NULL) {
-               DEBUG(1, ("Could not fetch_lock serverid.tdb record\n"));
-               return false;
-       }
-
-       ZERO_STRUCT(data);
-       data.unique_id = id.unique_id;
-       data.msg_flags = msg_flags;
-
-       tdbdata = make_tdb_data((uint8_t *)&data, sizeof(data));
-       status = dbwrap_record_store(rec, tdbdata, 0);
-       if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(1, ("Storing serverid.tdb record failed: %s\n",
-                         nt_errstr(status)));
-               goto done;
-       }
-
-       if (lp_clustering()) {
-               register_with_ctdbd(messaging_ctdb_connection(), id.unique_id,
-                                   NULL, NULL);
-       }
-
-       ret = true;
-done:
-       TALLOC_FREE(rec);
-       return ret;
-}
-
-bool serverid_deregister(struct server_id id)
-{
-       struct db_context *db;
-       struct serverid_key key;
-       struct db_record *rec;
-       TDB_DATA tdbkey;
-       NTSTATUS status;
-       bool ret = false;
-
-       db = serverid_db();
-       if (db == NULL) {
-               return false;
-       }
-
-       serverid_fill_key(&id, &key);
-       tdbkey = make_tdb_data((uint8_t *)&key, sizeof(key));
-
-       rec = dbwrap_fetch_locked(db, talloc_tos(), tdbkey);
-       if (rec == NULL) {
-               DEBUG(1, ("Could not fetch_lock serverid.tdb record\n"));
-               return false;
-       }
-
-       status = dbwrap_record_delete(rec);
-       if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(1, ("Deleting serverid.tdb record failed: %s\n",
-                         nt_errstr(status)));
-               goto done;
-       }
-       ret = true;
-done:
-       TALLOC_FREE(rec);
-       return ret;
-}
-
 static bool serverid_exists_local(const struct server_id *id)
 {
        bool exists = process_exists_by_pid(id->pid);
 static bool serverid_exists_local(const struct server_id *id)
 {
        bool exists = process_exists_by_pid(id->pid);
@@ -204,203 +60,3 @@ bool serverid_exists(const struct server_id *id)
 
        return false;
 }
 
        return false;
 }
-
-static bool serverid_rec_parse(const struct db_record *rec,
-                              struct server_id *id, uint32_t *msg_flags)
-{
-       struct serverid_key key;
-       struct serverid_data data;
-       TDB_DATA tdbkey;
-       TDB_DATA tdbdata;
-
-       tdbkey = dbwrap_record_get_key(rec);
-       tdbdata = dbwrap_record_get_value(rec);
-
-       if (tdbkey.dsize != sizeof(key)) {
-               DEBUG(1, ("Found invalid key length %d in serverid.tdb\n",
-                         (int)tdbkey.dsize));
-               return false;
-       }
-       if (tdbdata.dsize != sizeof(data)) {
-               DEBUG(1, ("Found invalid value length %d in serverid.tdb\n",
-                         (int)tdbdata.dsize));
-               return false;
-       }
-
-       memcpy(&key, tdbkey.dptr, sizeof(key));
-       memcpy(&data, tdbdata.dptr, sizeof(data));
-
-       id->pid = key.pid;
-       id->task_id = key.task_id;
-       id->vnn = key.vnn;
-       id->unique_id = data.unique_id;
-       *msg_flags = data.msg_flags;
-       return true;
-}
-
-struct serverid_traverse_read_state {
-       int (*fn)(const struct server_id *id, uint32_t msg_flags,
-                 void *private_data);
-       void *private_data;
-};
-
-static int serverid_traverse_read_fn(struct db_record *rec, void *private_data)
-{
-       struct serverid_traverse_read_state *state =
-               (struct serverid_traverse_read_state *)private_data;
-       struct server_id id;
-       uint32_t msg_flags;
-
-       if (!serverid_rec_parse(rec, &id, &msg_flags)) {
-               return 0;
-       }
-       return state->fn(&id, msg_flags,state->private_data);
-}
-
-bool serverid_traverse_read(int (*fn)(const struct server_id *id,
-                                     uint32_t msg_flags, void *private_data),
-                           void *private_data)
-{
-       struct db_context *db;
-       struct serverid_traverse_read_state state;
-       NTSTATUS status;
-
-       db = serverid_db();
-       if (db == NULL) {
-               return false;
-       }
-       state.fn = fn;
-       state.private_data = private_data;
-
-       status = dbwrap_traverse_read(db, serverid_traverse_read_fn, &state,
-                                     NULL);
-       return NT_STATUS_IS_OK(status);
-}
-
-struct serverid_traverse_state {
-       int (*fn)(struct db_record *rec, const struct server_id *id,
-                 uint32_t msg_flags, void *private_data);
-       void *private_data;
-};
-
-static int serverid_traverse_fn(struct db_record *rec, void *private_data)
-{
-       struct serverid_traverse_state *state =
-               (struct serverid_traverse_state *)private_data;
-       struct server_id id;
-       uint32_t msg_flags;
-
-       if (!serverid_rec_parse(rec, &id, &msg_flags)) {
-               return 0;
-       }
-       return state->fn(rec, &id, msg_flags, state->private_data);
-}
-
-bool serverid_traverse(int (*fn)(struct db_record *rec,
-                                const struct server_id *id,
-                                uint32_t msg_flags, void *private_data),
-                           void *private_data)
-{
-       struct db_context *db;
-       struct serverid_traverse_state state;
-       NTSTATUS status;
-
-       db = serverid_db();
-       if (db == NULL) {
-               return false;
-       }
-       state.fn = fn;
-       state.private_data = private_data;
-
-       status = dbwrap_traverse(db, serverid_traverse_fn, &state, NULL);
-       return NT_STATUS_IS_OK(status);
-}
-
-struct msg_all {
-       struct messaging_context *msg_ctx;
-       int msg_type;
-       uint32_t msg_flag;
-       const void *buf;
-       size_t len;
-       int n_sent;
-};
-
-/****************************************************************************
- Send one of the messages for the broadcast.
-****************************************************************************/
-
-static int traverse_fn(struct db_record *rec, const struct server_id *id,
-                      uint32_t msg_flags, void *state)
-{
-       struct msg_all *msg_all = (struct msg_all *)state;
-       NTSTATUS status;
-
-       /* Don't send if the receiver hasn't registered an interest. */
-
-       if((msg_flags & msg_all->msg_flag) == 0) {
-               return 0;
-       }
-
-       /* If the msg send fails because the pid was not found (i.e. smbd died),
-        * the msg has already been deleted from the messages.tdb.*/
-
-       status = messaging_send_buf(msg_all->msg_ctx, *id, msg_all->msg_type,
-                                   (const uint8_t *)msg_all->buf, msg_all->len);
-
-       if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
-               struct server_id_buf idbuf;
-
-               /*
-                * If the pid was not found delete the entry from
-                * serverid.tdb
-                */
-
-               DEBUG(2, ("pid %s doesn't exist\n",
-                         server_id_str_buf(*id, &idbuf)));
-
-               dbwrap_record_delete(rec);
-       }
-       msg_all->n_sent++;
-       return 0;
-}
-
-/**
- * Send a message to all smbd processes.
- *
- * It isn't very efficient, but should be OK for the sorts of
- * applications that use it. When we need efficient broadcast we can add
- * it.
- *
- * @retval True for success.
- **/
-bool message_send_all(struct messaging_context *msg_ctx,
-                     int msg_type,
-                     const void *buf, size_t len)
-{
-       struct msg_all msg_all;
-
-       msg_all.msg_type = msg_type;
-       if (msg_type < 0x100) {
-               msg_all.msg_flag = FLAG_MSG_GENERAL;
-       } else if (msg_type > 0x100 && msg_type < 0x200) {
-               msg_all.msg_flag = FLAG_MSG_NMBD;
-       } else if (msg_type > 0x200 && msg_type < 0x300) {
-               msg_all.msg_flag = FLAG_MSG_PRINT_GENERAL;
-       } else if (msg_type > 0x300 && msg_type < 0x400) {
-               msg_all.msg_flag = FLAG_MSG_SMBD;
-       } else if (msg_type > 0x400 && msg_type < 0x600) {
-               msg_all.msg_flag = FLAG_MSG_WINBIND;
-       } else if (msg_type > 4000 && msg_type < 5000) {
-               msg_all.msg_flag = FLAG_MSG_DBWRAP;
-       } else {
-               return false;
-       }
-
-       msg_all.buf = buf;
-       msg_all.len = len;
-       msg_all.n_sent = 0;
-       msg_all.msg_ctx = msg_ctx;
-
-       serverid_traverse(traverse_fn, &msg_all);
-       return true;
-}
index 14eaef647d0c4c46e9eff46f93805bbf506315c6..9be708a9c0293203f75e0f4199635ef0cee0ceeb 100644 (file)
@@ -70,7 +70,6 @@ static void terminate(struct messaging_context *msg)
        kill_async_dns_child();
 
        gencache_stabilize();
        kill_async_dns_child();
 
        gencache_stabilize();
-       serverid_deregister(messaging_server_id(msg));
 
        pidfile_unlink(lp_pid_directory(), "nmbd");
 
 
        pidfile_unlink(lp_pid_directory(), "nmbd");
 
@@ -1015,15 +1014,6 @@ static bool open_sockets(bool isdaemon, int port)
                exit(1);
        }
 
                exit(1);
        }
 
-       /* get broadcast messages */
-
-       if (!serverid_register(messaging_server_id(msg),
-                               FLAG_MSG_GENERAL |
-                               FLAG_MSG_NMBD |
-                               FLAG_MSG_DBWRAP)) {
-               exit_daemon("Could not register NMBD process in serverid.tdb", EACCES);
-       }
-
        messaging_register(msg, NULL, MSG_FORCE_ELECTION,
                           nmbd_message_election);
 #if 0
        messaging_register(msg, NULL, MSG_FORCE_ELECTION,
                           nmbd_message_election);
 #if 0
index 932d4d76df00e2be8bd6b73f4772a2226d09a85b..2e500f18c7d249fce970ab1fa3c1ade549e9974f 100644 (file)
@@ -243,10 +243,6 @@ bool nt_printing_init(struct messaging_context *msg_ctx)
        messaging_register(msg_ctx, NULL, MSG_PRINTER_DRVUPGRADE,
                        forward_drv_upgrade_printer_msg);
 
        messaging_register(msg_ctx, NULL, MSG_PRINTER_DRVUPGRADE,
                        forward_drv_upgrade_printer_msg);
 
-       /* of course, none of the message callbacks matter if you don't
-          tell messages.c that you interested in receiving PRINT_GENERAL
-          msgs.  This is done in serverid_register() */
-
        if ( lp_security() == SEC_ADS ) {
                win_rc = check_published_printers(msg_ctx);
                if (!W_ERROR_IS_OK(win_rc))
        if ( lp_security() == SEC_ADS ) {
                win_rc = check_published_printers(msg_ctx);
                if (!W_ERROR_IS_OK(win_rc))
index 7a3b80aae0c4530997a9ee91fa1fe6e5111ee65a..24708c1953773e5d849ae0007dce0f35e0676ea2 100644 (file)
@@ -27,7 +27,6 @@
 #include "printing.h"
 #include "printing/pcap.h"
 #include "printing/queue_process.h"
 #include "printing.h"
 #include "printing/pcap.h"
 #include "printing/queue_process.h"
-#include "serverid.h"
 #include "locking/proto.h"
 #include "smbd/smbd.h"
 #include "rpc_server/rpc_config.h"
 #include "locking/proto.h"
 #include "smbd/smbd.h"
 #include "rpc_server/rpc_config.h"
@@ -392,12 +391,6 @@ pid_t start_background_queue(struct tevent_context *ev,
                        exit(1);
                }
 
                        exit(1);
                }
 
-               if (!serverid_register(messaging_server_id(msg_ctx),
-                                      FLAG_MSG_GENERAL |
-                                      FLAG_MSG_PRINT_GENERAL)) {
-                       exit(1);
-               }
-
                if (!locking_init()) {
                        exit(1);
                }
                if (!locking_init()) {
                        exit(1);
                }
index 48a914ef6de40280f2ff3b0c1953acbc4d0a8a7b..2b08d580f356c1755ef1e5649d4083192c21e4df 100644 (file)
@@ -17,7 +17,6 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 #include "includes.h"
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 #include "includes.h"
-#include "serverid.h"
 #include "smbd/smbd.h"
 
 #include "messages.h"
 #include "smbd/smbd.h"
 
 #include "messages.h"
@@ -280,12 +279,6 @@ static bool spoolss_child_init(struct tevent_context *ev_ctx,
                return false;
        }
 
                return false;
        }
 
-       if (!serverid_register(messaging_server_id(msg_ctx),
-                               FLAG_MSG_GENERAL |
-                               FLAG_MSG_PRINT_GENERAL)) {
-               return false;
-       }
-
        if (!locking_init()) {
                return false;
        }
        if (!locking_init()) {
                return false;
        }
@@ -694,12 +687,6 @@ pid_t start_spoolssd(struct tevent_context *ev_ctx,
                exit(1);
        }
 
                exit(1);
        }
 
-       if (!serverid_register(messaging_server_id(msg_ctx),
-                               FLAG_MSG_GENERAL |
-                               FLAG_MSG_PRINT_GENERAL)) {
-               exit(1);
-       }
-
        if (!locking_init()) {
                exit(1);
        }
        if (!locking_init()) {
                exit(1);
        }
index faf60f5c95b2b94c5c424201e24a874490561e42..0b94a1cf4efb95c4c1b7c0eb947f161f71f34960 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "includes.h"
 
 
 #include "includes.h"
 
-#include "serverid.h"
 #include "ntdomain.h"
 #include "messages.h"
 
 #include "ntdomain.h"
 #include "messages.h"
 
@@ -171,14 +170,6 @@ void start_epmd(struct tevent_context *ev_ctx,
        epmd_setup_sig_term_handler(ev_ctx);
        epmd_setup_sig_hup_handler(ev_ctx, msg_ctx);
 
        epmd_setup_sig_term_handler(ev_ctx);
        epmd_setup_sig_hup_handler(ev_ctx, msg_ctx);
 
-       ok = serverid_register(messaging_server_id(msg_ctx),
-                              FLAG_MSG_GENERAL |
-                              FLAG_MSG_PRINT_GENERAL);
-       if (!ok) {
-               DEBUG(0, ("Failed to register serverid in epmd!\n"));
-               exit(1);
-       }
-
        messaging_register(msg_ctx,
                           ev_ctx,
                           MSG_SMB_CONF_UPDATED,
        messaging_register(msg_ctx,
                           ev_ctx,
                           MSG_SMB_CONF_UPDATED,
index 8f55aff6f85e5ed3089c04ddeb07557597822687..3116679179ada83dd0eea50e08c1878fdfa8bba9 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "includes.h"
 
 
 #include "includes.h"
 
-#include "serverid.h"
 #include "ntdomain.h"
 #include "messages.h"
 
 #include "ntdomain.h"
 #include "messages.h"
 
@@ -182,14 +181,6 @@ void start_fssd(struct tevent_context *ev_ctx,
        fssd_setup_sig_term_handler(ev_ctx);
        fssd_setup_sig_hup_handler(ev_ctx, msg_ctx);
 
        fssd_setup_sig_term_handler(ev_ctx);
        fssd_setup_sig_hup_handler(ev_ctx, msg_ctx);
 
-       ok = serverid_register(messaging_server_id(msg_ctx),
-                              FLAG_MSG_GENERAL |
-                              FLAG_MSG_PRINT_GENERAL);
-       if (!ok) {
-               DEBUG(0, ("Failed to register serverid in fssd!\n"));
-               exit(1);
-       }
-
        messaging_register(msg_ctx,
                           ev_ctx,
                           MSG_SMB_CONF_UPDATED,
        messaging_register(msg_ctx,
                           ev_ctx,
                           MSG_SMB_CONF_UPDATED,
index 8cd89a9fd389c685da08045f315cf6c41644fcdf..08e9fe26a74b502add56c27910978292ef7bdb80 100644 (file)
@@ -20,7 +20,6 @@
  */
 
 #include "includes.h"
  */
 
 #include "includes.h"
-#include "serverid.h"
 #include "messages.h"
 #include "ntdomain.h"
 
 #include "messages.h"
 #include "ntdomain.h"
 
@@ -261,11 +260,6 @@ static bool lsasd_child_init(struct tevent_context *ev_ctx,
                return false;
        }
 
                return false;
        }
 
-       if (!serverid_register(messaging_server_id(msg_ctx),
-                              FLAG_MSG_GENERAL)) {
-               return false;
-       }
-
        messaging_register(msg_ctx, ev_ctx,
                           MSG_SMB_CONF_UPDATED, lsasd_smb_conf_updated);
        messaging_register(msg_ctx, ev_ctx,
        messaging_register(msg_ctx, ev_ctx,
                           MSG_SMB_CONF_UPDATED, lsasd_smb_conf_updated);
        messaging_register(msg_ctx, ev_ctx,
@@ -897,11 +891,6 @@ void start_lsasd(struct tevent_context *ev_ctx,
                exit(1);
        }
 
                exit(1);
        }
 
-       if (!serverid_register(messaging_server_id(msg_ctx),
-                              FLAG_MSG_GENERAL)) {
-               exit(1);
-       }
-
        messaging_register(msg_ctx,
                           ev_ctx,
                           MSG_SMB_CONF_UPDATED,
        messaging_register(msg_ctx,
                           ev_ctx,
                           MSG_SMB_CONF_UPDATED,
index daff5f02e67186be6cdb11535f2c5582b910bd54..d5c05c7e8e91bef85229d8ea655ed19fbafeb1e4 100644 (file)
@@ -20,7 +20,6 @@
  */
 
 #include "includes.h"
  */
 
 #include "includes.h"
-#include "serverid.h"
 #include "messages.h"
 #include "ntdomain.h"
 
 #include "messages.h"
 #include "ntdomain.h"
 
@@ -219,11 +218,6 @@ static bool mdssd_child_init(struct tevent_context *ev_ctx,
                return false;
        }
 
                return false;
        }
 
-       if (!serverid_register(messaging_server_id(msg_ctx),
-                              FLAG_MSG_GENERAL)) {
-               return false;
-       }
-
        messaging_register(msg_ctx, ev_ctx,
                           MSG_SMB_CONF_UPDATED, mdssd_smb_conf_updated);
        messaging_register(msg_ctx, ev_ctx,
        messaging_register(msg_ctx, ev_ctx,
                           MSG_SMB_CONF_UPDATED, mdssd_smb_conf_updated);
        messaging_register(msg_ctx, ev_ctx,
@@ -686,11 +680,6 @@ void start_mdssd(struct tevent_context *ev_ctx,
                exit(1);
        }
 
                exit(1);
        }
 
-       if (!serverid_register(messaging_server_id(msg_ctx),
-                              FLAG_MSG_GENERAL)) {
-               exit(1);
-       }
-
        messaging_register(msg_ctx,
                           ev_ctx,
                           MSG_SMB_CONF_UPDATED,
        messaging_register(msg_ctx,
                           ev_ctx,
                           MSG_SMB_CONF_UPDATED,
index d3f4776076fd43308fc79ca9d1e1283757d36850..cdbc2c4089eabdd01de9f8b5b3e0984dee4ff77b 100644 (file)
@@ -691,14 +691,6 @@ void reply_negprot(struct smb_request *req)
        /* possibly reload - change of architecture */
        reload_services(sconn, conn_snum_used, true);
 
        /* possibly reload - change of architecture */
        reload_services(sconn, conn_snum_used, true);
 
-       /* moved from the netbios session setup code since we don't have that 
-          when the client connects to port 445.  Of course there is a small
-          window where we are listening to messages   -- jerry */
-
-       serverid_register(messaging_server_id(sconn->msg_ctx),
-                         FLAG_MSG_GENERAL|FLAG_MSG_SMBD
-                         |FLAG_MSG_PRINT_GENERAL);
-
        /*
         * Anything higher than PROTOCOL_SMB2_10 still
         * needs to go via "SMB 2.???", which is marked
        /*
         * Anything higher than PROTOCOL_SMB2_10 still
         * needs to go via "SMB 2.???", which is marked
index b5f528fc78ad8292dbd820b612cd693bfb3aa585..4376f2eff999259b79fcc861aa9c3c2110742906 100644 (file)
@@ -41,7 +41,6 @@
 #include "../libcli/security/security_token.h"
 #include "lib/id_cache.h"
 #include "lib/util/sys_rw_data.h"
 #include "../libcli/security/security_token.h"
 #include "lib/id_cache.h"
 #include "lib/util/sys_rw_data.h"
-#include "serverid.h"
 #include "system/threads.h"
 
 /* Internal message queue for deferred opens. */
 #include "system/threads.h"
 
 /* Internal message queue for deferred opens. */
@@ -3947,14 +3946,6 @@ void smbd_process(struct tevent_context *ev_ctx,
        if (!interactive) {
                smbd_setup_sig_term_handler(sconn);
                smbd_setup_sig_hup_handler(sconn);
        if (!interactive) {
                smbd_setup_sig_term_handler(sconn);
                smbd_setup_sig_hup_handler(sconn);
-
-               if (!serverid_register(messaging_server_id(msg_ctx),
-                                      FLAG_MSG_GENERAL|FLAG_MSG_SMBD
-                                      |FLAG_MSG_DBWRAP
-                                      |FLAG_MSG_PRINT_GENERAL)) {
-                       exit_server_cleanly("Could not register myself in "
-                                           "serverid.tdb");
-               }
        }
 
        status = smbd_add_connection(client, sock_fd, &xconn);
        }
 
        status = smbd_add_connection(client, sock_fd, &xconn);
index 9b479a621e3b146cfed307751b98e95812e5abf0..a9fda7f06415c9db72553f87cdbee5190d85672e 100644 (file)
@@ -138,7 +138,6 @@ static bool smbd_scavenger_running(struct smbd_scavenger_state *state)
 
 static int smbd_scavenger_server_id_destructor(struct server_id *id)
 {
 
 static int smbd_scavenger_server_id_destructor(struct server_id *id)
 {
-       serverid_deregister(*id);
        return 0;
 }
 
        return 0;
 }
 
@@ -256,13 +255,6 @@ static bool smbd_scavenger_start(struct smbd_scavenger_state *state)
 
                scavenger_setup_sig_term_handler(state->ev);
 
 
                scavenger_setup_sig_term_handler(state->ev);
 
-               if (!serverid_register(*state->scavenger_id,
-                                      FLAG_MSG_GENERAL)) {
-                       DBG_WARNING("serverid_register failed");
-                       exit_server("serverid_register failed");
-                       return false;
-               }
-
                ok = scavenger_say_hello(fds[1], *state->scavenger_id);
                if (!ok) {
                        DEBUG(2, ("scavenger_say_hello failed\n"));
                ok = scavenger_say_hello(fds[1], *state->scavenger_id);
                if (!ok) {
                        DEBUG(2, ("scavenger_say_hello failed\n"));
index 5b421ff4bb341bf60eee2dcdb4e5005ba6d26875..f8c1aa65744f4c7294439e36ef5b377a2b8cefc9 100644 (file)
@@ -36,7 +36,6 @@
 #include "printing/queue_process.h"
 #include "rpc_server/rpc_service_setup.h"
 #include "rpc_server/rpc_config.h"
 #include "printing/queue_process.h"
 #include "rpc_server/rpc_service_setup.h"
 #include "rpc_server/rpc_config.h"
-#include "serverid.h"
 #include "passdb.h"
 #include "auth.h"
 #include "messages.h"
 #include "passdb.h"
 #include "auth.h"
 #include "messages.h"
@@ -1263,21 +1262,6 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent,
                return false;
        }
 
                return false;
        }
 
-       /* Setup the main smbd so that we can get messages. Note that
-          do this after starting listening. This is needed as when in
-          clustered mode, ctdb won't allow us to start doing database
-          operations until it has gone thru a full startup, which
-          includes checking to see that smbd is listening. */
-
-       if (!serverid_register(messaging_server_id(msg_ctx),
-                              FLAG_MSG_GENERAL|FLAG_MSG_SMBD
-                              |FLAG_MSG_PRINT_GENERAL
-                              |FLAG_MSG_DBWRAP)) {
-               DEBUG(0, ("open_sockets_smbd: Failed to register "
-                         "myself in serverid.tdb\n"));
-               return false;
-       }
-
         /* Listen to messages */
 
        messaging_register(msg_ctx, NULL, MSG_SHUTDOWN, msg_exit_server);
         /* Listen to messages */
 
        messaging_register(msg_ctx, NULL, MSG_SHUTDOWN, msg_exit_server);
@@ -1986,10 +1970,6 @@ extern void build_options(bool screen);
                exit_daemon("Samba cannot init scavenging", EACCES);
        }
 
                exit_daemon("Samba cannot init scavenging", EACCES);
        }
 
-       if (!serverid_parent_init(ev_ctx)) {
-               exit_daemon("Samba cannot init server id", EACCES);
-       }
-
        if (!W_ERROR_IS_OK(registry_init_full()))
                exit_daemon("Samba cannot init registry", EACCES);
 
        if (!W_ERROR_IS_OK(registry_init_full()))
                exit_daemon("Samba cannot init registry", EACCES);
 
index 74ddd70bd3a1b3701bac887fff08ec2f03ed69a5..a9ef37f49e2b4ea3ec3727d0636a6ab5f309dad3 100644 (file)
@@ -171,14 +171,6 @@ static void exit_server_common(enum server_exit_reason how,
        /* 3 second timeout. */
        print_notify_send_messages(msg_ctx, 3);
 
        /* 3 second timeout. */
        print_notify_send_messages(msg_ctx, 3);
 
-       /* delete our entry in the serverid database. */
-       if (am_parent) {
-               /*
-                * For children the parent takes care of cleaning up
-                */
-               serverid_deregister(messaging_server_id(msg_ctx));
-       }
-
 #ifdef USE_DMAPI
        /* Destroy Samba DMAPI session only if we are master smbd process */
        if (am_parent) {
 #ifdef USE_DMAPI
        /* Destroy Samba DMAPI session only if we are master smbd process */
        if (am_parent) {
index cfb75c971be3a29774f54cf7324e115eb6a8ff35..5bd18c1411c80b480a872d98433617be6f8c484c 100644 (file)
@@ -177,7 +177,6 @@ static void smbd_cleanupd_process_exited(struct messaging_context *msg,
             child != NULL;
             child = child->next)
        {
             child != NULL;
             child = child->next)
        {
-               struct server_id child_id;
                bool ok;
 
                ok = cleanupdb_delete_child(child->pid);
                bool ok;
 
                ok = cleanupdb_delete_child(child->pid);
@@ -185,14 +184,6 @@ static void smbd_cleanupd_process_exited(struct messaging_context *msg,
                        DBG_ERR("failed to delete pid %d\n", (int)child->pid);
                }
 
                        DBG_ERR("failed to delete pid %d\n", (int)child->pid);
                }
 
-               /*
-                * Get child_id before messaging_cleanup which wipes
-                * the unique_id. Not that it really matters here for
-                * functionality (the child should have properly
-                * cleaned up :-)) though, but it looks nicer.
-                */
-               child_id = pid_to_procid(child->pid);
-
                smbprofile_cleanup(child->pid, state->parent_pid);
 
                ret = messaging_cleanup(msg, child->pid);
                smbprofile_cleanup(child->pid, state->parent_pid);
 
                ret = messaging_cleanup(msg, child->pid);
@@ -202,11 +193,6 @@ static void smbd_cleanupd_process_exited(struct messaging_context *msg,
                                  strerror(ret));
                }
 
                                  strerror(ret));
                }
 
-               if (!serverid_deregister(child_id)) {
-                       DBG_ERR("Could not remove pid %d from serverid.tdb\n",
-                               (int)child->pid);
-               }
-
                DBG_DEBUG("cleaned up pid %d\n", (int)child->pid);
        }
 
                DBG_DEBUG("cleaned up pid %d\n", (int)child->pid);
        }
 
index b6ef2f2e438d216fd115c5919690e3a8c6737814..f156def46471dfd2760056d61a7af480e1f71640 100644 (file)
@@ -527,7 +527,6 @@ int main(int argc, const char *argv[])
        sec_init();
        init_guest_info();
        locking_init();
        sec_init();
        init_guest_info();
        locking_init();
-       serverid_parent_init(NULL);
        vfs = talloc_zero(NULL, struct vfs_state);
        if (vfs == NULL) {
                return 1;
        vfs = talloc_zero(NULL, struct vfs_state);
        if (vfs == NULL) {
                return 1;
@@ -553,7 +552,6 @@ int main(int argc, const char *argv[])
        vfs->conn->share_access = FILE_GENERIC_ALL;
        vfs->conn->read_only = false;
 
        vfs->conn->share_access = FILE_GENERIC_ALL;
        vfs->conn->read_only = false;
 
-       serverid_register(messaging_server_id(vfs->conn->sconn->msg_ctx), 0);
        file_init(vfs->conn->sconn);
        for (i=0; i < 1024; i++)
                vfs->files[i] = NULL;
        file_init(vfs->conn->sconn);
        for (i=0; i < 1024; i++)
                vfs->files[i] = NULL;
index ceb131e9b329e0defeb2d258604121932a47db7c..23e8a5ede5e218c78773d722abe129eedb75e945 100644 (file)
@@ -34,7 +34,6 @@
 #include "rpc_client/cli_netlogon.h"
 #include "idmap.h"
 #include "lib/addrchange.h"
 #include "rpc_client/cli_netlogon.h"
 #include "idmap.h"
 #include "lib/addrchange.h"
-#include "serverid.h"
 #include "auth.h"
 #include "messages.h"
 #include "../lib/util/pidfile.h"
 #include "auth.h"
 #include "messages.h"
 #include "../lib/util/pidfile.h"
@@ -221,9 +220,6 @@ static void terminate(bool is_parent)
 #endif
 
        if (is_parent) {
 #endif
 
        if (is_parent) {
-               struct messaging_context *msg = server_messaging_context();
-               struct server_id self = messaging_server_id(msg);
-               serverid_deregister(self);
                pidfile_unlink(lp_pid_directory(), "winbindd");
        }
 
                pidfile_unlink(lp_pid_directory(), "winbindd");
        }
 
@@ -1305,16 +1301,6 @@ static void winbindd_register_handlers(struct messaging_context *msg_ctx,
                exit(1);
        }
 
                exit(1);
        }
 
-       /* get broadcast messages */
-
-       if (!serverid_register(messaging_server_id(msg_ctx),
-                              FLAG_MSG_GENERAL |
-                              FLAG_MSG_WINBIND |
-                              FLAG_MSG_DBWRAP)) {
-               DEBUG(1, ("Could not register myself in serverid.tdb\n"));
-               exit(1);
-       }
-
        /* React on 'smbcontrol winbindd reload-config' in the same way
           as to SIGHUP signal */
        messaging_register(msg_ctx, NULL,
        /* React on 'smbcontrol winbindd reload-config' in the same way
           as to SIGHUP signal */
        messaging_register(msg_ctx, NULL,