summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2016-10-12 11:06:51 +0200
committerKarolin Seeger <kseeger@samba.org>2016-10-20 10:43:28 +0200
commit8e2589e07414f63e75833da1418300c10ba9f77a (patch)
tree1adf36a8d35d2a84a84c2f540666bcf20bceb171
parentaf851c2e3c3d5362b69ed8063419bc109bc9438f (diff)
downloadsamba-8e2589e07414f63e75833da1418300c10ba9f77a.tar.gz
spoolss: Fix caching of printername->sharename
time_mono() gives seconds since boot, gencache expects seconds since epoch. With time_mono(), the values are always expired immediately. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12374 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Thu Oct 13 13:48:52 CEST 2016 on sn-devel-144
-rw-r--r--source3/rpc_server/spoolss/srv_spoolss_nt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index 0639b87a559..5172db0df22 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -704,13 +704,13 @@ static WERROR set_printer_hnd_name(TALLOC_CTX *mem_ctx,
if (!found) {
gencache_set(cache_key, printer_not_found,
- time_mono(NULL) + 300);
+ time(NULL) + 300);
TALLOC_FREE(cache_key);
DEBUGADD(4,("Printer not found\n"));
return WERR_INVALID_PRINTER_NAME;
}
- gencache_set(cache_key, sname, time_mono(NULL) + 300);
+ gencache_set(cache_key, sname, time(NULL) + 300);
TALLOC_FREE(cache_key);
DEBUGADD(4,("set_printer_hnd_name: Printer found: %s -> %s\n", aprinter, sname));