summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2001-12-14 20:38:04 +0000
committerGerald Carter <jerry@samba.org>2001-12-14 20:38:04 +0000
commitabcd1cad3af7ee111f711544407222951e33238e (patch)
treec62ea64e873957c924ed4fecdc2f087288bc76f7
parentee33b2d3e2197a701aa853c4239b68c292c44988 (diff)
downloadsamba-abcd1cad3af7ee111f711544407222951e33238e.tar.gz
samba-abcd1cad3af7ee111f711544407222951e33238e.tar.xz
samba-abcd1cad3af7ee111f711544407222951e33238e.zip
ChangeID fixe from APPLIANCE_HEAD
(This used to be commit 096d06a961e3a3e6f6952754875b83558448f449)
-rw-r--r--source3/printing/nt_printing.c46
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c5
2 files changed, 42 insertions, 9 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 481f61528d7..c2cd1d6eeb5 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -2643,7 +2643,39 @@ WERROR mod_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level)
{
case 2:
{
- printer.info_2->c_setprinter++;
+ /*
+ * Update the changestamp. Emperical tests show that the
+ * ChangeID is always updated,but c_setprinter is only
+ * incremented on a SetPrinter() call.
+ */
+
+ time_t time_unix = time(NULL);
+
+ /* ChangeID **must** be increasing over the lifetime
+ of client's spoolss service in order for the
+ client's cache to show updates */
+
+ printer.info_2->changeid = time_unix * 100;
+
+ /*
+ * Because one day someone will ask:
+ * NT->NT An admin connection to a remote
+ * printer show changes imeediately in
+ * the properities dialog
+ *
+ * A non-admin connection will only show the
+ * changes after viewing the properites page
+ * 2 times. Seems to be related to a
+ * race condition in the client between the spooler
+ * updating the local cache and the Explorer.exe GUI
+ * actually displaying the properties.
+ *
+ * This is fixed in Win2k. admin/non-admin
+ * connections both display changes immediately.
+ *
+ * 14/12/01 --jerry
+ */
+
result=update_a_printer_2(printer.info_2);
break;
}
@@ -2671,17 +2703,13 @@ WERROR add_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level)
case 2:
{
/*
- * Update the changestamp.
- * Note we must *not* do this in mod_a_printer().
+ * Update the changestamp. See comments in mod_a_printer()
+ * --jerry
*/
- NTTIME time_nt;
+
time_t time_unix = time(NULL);
- unix_to_nt_time(&time_nt, time_unix);
- if (printer.info_2->changeid==time_nt.low)
- printer.info_2->changeid++;
- else
- printer.info_2->changeid=time_nt.low;
+ printer.info_2->changeid = time_unix * 100;
printer.info_2->c_setprinter++;
result=update_a_printer_2(printer.info_2);
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 87d076ae8c9..5794f1de048 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -6288,6 +6288,11 @@ WERROR _spoolss_addform( pipes_struct *p, SPOOL_Q_ADDFORM *q_u, SPOOL_R_ADDFORM
return WERR_BADFID;
}
+ /*
+ * FIXME!! Feels like there should be an access check here, but haven't
+ * had time to verify. --jerry
+ */
+
/* can't add if builtin */
if (get_a_builtin_ntform(&form->name,&tmpForm)) {
return WERR_INVALID_PARAM;