summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2010-06-15 13:37:44 +0200
committerSimo Sorce <idra@samba.org>2010-07-27 10:27:15 -0400
commitb95d5563ddff7aec15f4138be731578785dca7ec (patch)
tree9ea8eff8950269b12fbd22e712a00b2ef35454d7 /source3/smbd
parent924cc43d1b8f8358f7c7aaef16b06437e39cd05b (diff)
downloadsamba-b95d5563ddff7aec15f4138be731578785dca7ec.tar.gz
samba-b95d5563ddff7aec15f4138be731578785dca7ec.tar.bz2
samba-b95d5563ddff7aec15f4138be731578785dca7ec.zip
s3-printing: Added automatic migration of printing tdbs.
Signed-off-by: Jim McDonough <jmcd@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/process.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 13fec92ea5..d91c07e169 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -35,6 +35,7 @@
#include "../librpc/gen_ndr/srv_winreg.h"
#include "../librpc/gen_ndr/srv_wkssvc.h"
#include "librpc/gen_ndr/messaging.h"
+#include "printing/nt_printing_migrate.h"
extern bool global_machine_password_needs_changing;
@@ -2856,6 +2857,11 @@ fail:
return false;
}
+static bool spoolss_init_cb(void)
+{
+ return nt_printing_tdb_migrate();
+}
+
/****************************************************************************
Process commands from the client
****************************************************************************/
@@ -2870,6 +2876,7 @@ void smbd_process(void)
struct tsocket_address *remote_address = NULL;
const char *remaddr = NULL;
int ret;
+ struct rpc_srv_callbacks spoolss_cb;
if (lp_maxprotocol() == PROTOCOL_SMB2 &&
lp_security() != SEC_SHARE &&
@@ -2969,8 +2976,6 @@ void smbd_process(void)
tsocket_address_string(remote_address, talloc_tos()),
tsocket_address_string(local_address, talloc_tos())));
- static_init_rpc;
-
init_modules();
smb_perfcount_init();
@@ -3108,6 +3113,25 @@ void smbd_process(void)
exit_server("failed to create smbd_server_connection fde");
}
+ /*
+ * Initialize spoolss with an init function to convert printers first.
+ * static_init_rpc will try to initialize the spoolss server too but you
+ * can't register it twice.
+ */
+ spoolss_cb.init = spoolss_init_cb;
+ spoolss_cb.shutdown = NULL;
+
+
+ if (!NT_STATUS_IS_OK(rpc_winreg_init(NULL))) {
+ exit(1);
+ }
+
+ if (!NT_STATUS_IS_OK(rpc_spoolss_init(&spoolss_cb))) {
+ exit(1);
+ }
+
+ static_init_rpc;
+
TALLOC_FREE(frame);
while (True) {