summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-05-08 13:44:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:21:55 -0500
commit4aa44f7475e03dcc596f6a13fffffda7268074a1 (patch)
tree2b0529c892a64a3c2283df64d6ea14433056d04a /source3/rpc_server
parentdcc2fe7cb61937aa191bf8b5f353d0308a8011a3 (diff)
downloadsamba-4aa44f7475e03dcc596f6a13fffffda7268074a1.tar.gz
samba-4aa44f7475e03dcc596f6a13fffffda7268074a1.tar.bz2
samba-4aa44f7475e03dcc596f6a13fffffda7268074a1.zip
r22761: This introduces lib/conn_tdb.c with two main functions: connections_traverse
and connections_forall. This centralizes all the routines that did individual tdb_open("connections.tdb") and direct tdb_traverse. Volker (This used to be commit e43e94cda1ad8876b3cb5d1129080b57fa6ec214)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_netlog_nt.c16
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c4
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c21
3 files changed, 11 insertions, 30 deletions
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c
index 0c12cb3b7c..e110f39289 100644
--- a/source3/rpc_server/srv_netlog_nt.c
+++ b/source3/rpc_server/srv_netlog_nt.c
@@ -75,22 +75,8 @@ Send a message to smbd to do a sam synchronisation
static void send_sync_message(void)
{
- TDB_CONTEXT *tdb;
-
- tdb = tdb_open_log(lock_path("connections.tdb"), 0,
- TDB_DEFAULT, O_RDONLY, 0);
-
- if (!tdb) {
- DEBUG(3, ("send_sync_message(): failed to open connections "
- "database\n"));
- return;
- }
-
DEBUG(3, ("sending sam synchronisation message\n"));
-
- message_send_all(tdb, MSG_SMB_SAM_SYNC, NULL, 0, False, NULL);
-
- tdb_close(tdb);
+ message_send_all(MSG_SMB_SAM_SYNC, NULL, 0, False, NULL);
}
/*************************************************************************
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 7e46541b94..a4edeb2cfd 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -311,7 +311,7 @@ WERROR delete_printer_hook( NT_USER_TOKEN *token, const char *sharename )
if ( (ret = smbrun(command, NULL)) == 0 ) {
/* Tell everyone we updated smb.conf. */
- message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED, NULL, 0, False, NULL);
+ message_send_all(MSG_SMB_CONF_UPDATED, NULL, 0, False, NULL);
}
if ( is_print_op )
@@ -6253,7 +6253,7 @@ BOOL add_printer_hook(NT_USER_TOKEN *token, NT_PRINTER_INFO_LEVEL *printer)
if ( (ret = smbrun(command, &fd)) == 0 ) {
/* Tell everyone we updated smb.conf. */
- message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED, NULL, 0, False, NULL);
+ message_send_all(MSG_SMB_CONF_UPDATED, NULL, 0, False, NULL);
}
if ( is_print_op )
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index 2365f7ece3..59e86e4912 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -104,27 +104,22 @@ static WERROR net_enum_pipes( TALLOC_CTX *ctx, struct srvsvc_NetFileInfo3 **info
uint32 *count, uint32 *resume )
{
struct file_enum_count fenum;
- TDB_CONTEXT *conn_tdb = conn_tdb_ctx();
- if ( !conn_tdb ) {
- DEBUG(0,("net_enum_pipes: Failed to retrieve the connections tdb handle!\n"));
- return WERR_ACCESS_DENIED;
- }
-
fenum.ctx = ctx;
fenum.info = *info;
fenum.count = *count;
- if (tdb_traverse(conn_tdb, pipe_enum_fn, &fenum) == -1) {
- DEBUG(0,("net_enum_pipes: traverse of connections.tdb failed with error %s.\n",
- tdb_errorstr(conn_tdb) ));
+ if (connections_traverse(pipe_enum_fn, &fenum) == -1) {
+ DEBUG(0,("net_enum_pipes: traverse of connections.tdb "
+ "failed\n"));
return WERR_NOMEM;
}
*info = fenum.info;
*count = fenum.count;
- return WERR_OK;}
+ return WERR_OK;
+}
/*******************************************************************
********************************************************************/
@@ -1421,7 +1416,7 @@ static WERROR add_share(const char *share_name, const char *path,
if ( (ret = smbrun(command, NULL)) == 0 ) {
/* Tell everyone we updated smb.conf. */
- message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED,
+ message_send_all(MSG_SMB_CONF_UPDATED,
NULL, 0, False, NULL);
}
@@ -1517,7 +1512,7 @@ static WERROR delete_share(const char *sharename,
if ( (ret = smbrun(command, NULL)) == 0 ) {
/* Tell everyone we updated smb.conf. */
- message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED,
+ message_send_all(MSG_SMB_CONF_UPDATED,
NULL, 0, False, NULL);
}
@@ -1575,7 +1570,7 @@ static WERROR change_share(const char *share_name, const char *path,
if ( (ret = smbrun(command, NULL)) == 0 ) {
/* Tell everyone we updated smb.conf. */
- message_send_all(conn_tdb_ctx(), MSG_SMB_CONF_UPDATED,
+ message_send_all(MSG_SMB_CONF_UPDATED,
NULL, 0, False, NULL);
}