[PATCH] s3-smbd: move print_backend_init() behind init_system_info()
Ralph Wuerthner
ralphw at linux.vnet.ibm.com
Wed Apr 4 10:33:30 MDT 2012
We noticed in Samba 3.6.3 the following error messages during smbd startup:
[2012/04/04 16:29:50.511526, 0] printing/nt_printing_ads.c:360(check_published_printers)
check_published_printers: Could not create system session_info
[2012/04/04 16:29:50.512101, 0] printing/nt_printing.c:102(nt_printing_init)
nt_printing_init: error checking published printers: WERR_ACCESS_DENIED
It turned out that commit 62a2a9 "s3-smbd: Regroup some init functions." by
Andreas Schneider <asn at samba.org> caused theses error messages.
I wrote the patch below to reorder print_backend_init() behind
init_system_info(). Is this working as expected or does it cause a
catastrophic malfunction in Samba?
Regards
Ralph
---
On smbd startup check_published_printers() fails with the following error
messages:
[2012/04/04 16:29:50.511526, 0] printing/nt_printing_ads.c:360(check_published_printers)
check_published_printers: Could not create system session_info
[2012/04/04 16:29:50.512101, 0] printing/nt_printing.c:102(nt_printing_init)
nt_printing_init: error checking published printers: WERR_ACCESS_DENIED
check_published_printers() requires session_info to be set, but
initialization of session_info in main() is done after calling
print_backend_init(). Move print_backend_init() behind init_system_info().
Signed-off-by: Ralph Wuerthner <ralphw at de.ibm.com>
---
source3/smbd/server.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index db68ace..1d8283e 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -1211,9 +1211,6 @@ extern void build_options(bool screen);
if (!W_ERROR_IS_OK(registry_init_full()))
exit(1);
- if (!print_backend_init(smbd_messaging_context()))
- exit(1);
-
/* Open the share_info.tdb here, so we don't have to open
after the fork on every single connection. This is a small
performance improvment and reduces the total number of system
@@ -1230,6 +1227,9 @@ extern void build_options(bool screen);
return -1;
}
+ if (!print_backend_init(smbd_messaging_context()))
+ exit(1);
+
if (!init_guest_info()) {
DEBUG(0,("ERROR: failed to setup guest info.\n"));
return -1;
--
More information about the samba-technical
mailing list