summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-05-19 12:06:45 +0000
committerTim Potter <tpot@samba.org>2002-05-19 12:06:45 +0000
commitb8618865df8adbd9d22c6a2a61be8ed373a75aa4 (patch)
tree205d9c45deed1e37666758f216bc3967c6a7700b
parentc523cce510fb346c670c09243b5c0fb2edeaa46b (diff)
downloadsamba-b8618865df8adbd9d22c6a2a61be8ed373a75aa4.tar.gz
samba-b8618865df8adbd9d22c6a2a61be8ed373a75aa4.tar.bz2
samba-b8618865df8adbd9d22c6a2a61be8ed373a75aa4.zip
Patch to only set SV_TYPE_PRINTQ_SERVER in default_server_announce if a
print share is exported. Needs some more testing. (This used to be commit 92b36482fd6aa5103c30dad40fe799c07dd2d8d7)
-rw-r--r--source3/param/loadparm.c10
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c3
2 files changed, 12 insertions, 1 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index ff32bdca64..0df45392e6 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1984,6 +1984,8 @@ BOOL lp_add_printer(char *pszPrintername, int iDefaultService)
DEBUG(3, ("adding printer service %s\n", pszPrintername));
+ update_server_announce_as_printserver();
+
return (True);
}
@@ -3355,6 +3357,13 @@ void lp_add_one_printer(char *name, char *comment)
}
}
+/* Announce ourselves as a print server */
+
+void update_server_announce_as_printserver(void)
+{
+ default_server_announce |= SV_TYPE_PRINTQ_SERVER;
+}
+
/***************************************************************************
Have we loaded a services file yet?
***************************************************************************/
@@ -3666,7 +3675,6 @@ static void set_default_server_announce_type(void)
default_server_announce |= SV_TYPE_WORKSTATION;
default_server_announce |= SV_TYPE_SERVER;
default_server_announce |= SV_TYPE_SERVER_UNIX;
- default_server_announce |= SV_TYPE_PRINTQ_SERVER;
switch (lp_announce_as())
{
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 8419152cf2..c4a8d3917c 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -4848,6 +4848,9 @@ static BOOL add_printer_hook(NT_PRINTER_INFO_LEVEL *printer)
}
file_lines_free(qlines);
+
+ update_server_announce_as_printserver();
+
return True;
}