summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-01-08 05:39:27 +0000
committerJeremy Allison <jra@samba.org>2002-01-08 05:39:27 +0000
commitbbc42672a2518626dd7842b6d175119b626bff65 (patch)
tree3c12160df7dae1de64082e4d9a1beec7b62a10aa
parent1803e9cc0f1123b6dc8004a39b4635ac7ed2a983 (diff)
downloadsamba-bbc42672a2518626dd7842b6d175119b626bff65.tar.gz
samba-bbc42672a2518626dd7842b6d175119b626bff65.tar.bz2
samba-bbc42672a2518626dd7842b6d175119b626bff65.zip
Another attempt at getting changeid correct. Jerry / JF please check !
This fixes a driver init bug. Jeremy. (This used to be commit 8e8d71816002c634669c0cb0234f7a35281d9cad)
-rw-r--r--source3/printing/nt_printing.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 5070cf1ac4..81866ca9e1 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -2626,6 +2626,17 @@ void get_printer_subst_params(int snum, fstring *printername, fstring *sharename
free_a_printer(&printer, 2);
}
+/****************************************************************************
+ Update the changeid time.
+****************************************************************************/
+
+static uint32 rev_changeid(uint32 changeid)
+{
+ if (changeid == 0)
+ changeid = time(NULL);
+ return changeid++;
+}
+
/*
* The function below are the high level ones.
* only those ones must be called from the spoolss code.
@@ -2652,13 +2663,11 @@ WERROR mod_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level)
* 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
+ of client's spoolss service in order for the
client's cache to show updates */
- printer.info_2->changeid = time_unix * 100;
+ printer.info_2->changeid = rev_changeid(printer.info_2->changeid);
/*
* Because one day someone will ask:
@@ -2710,9 +2719,7 @@ WERROR add_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level)
* --jerry
*/
- time_t time_unix = time(NULL);
-
- printer.info_2->changeid = time_unix * 100;
+ printer.info_2->changeid = rev_changeid(printer.info_2->changeid);
printer.info_2->c_setprinter++;
result=update_a_printer_2(printer.info_2);