From: Volker Lendecke Date: Wed, 12 Oct 2016 09:06:51 +0000 (+0200) Subject: spoolss: Fix caching of printername->sharename X-Git-Tag: samba-4.4.7~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17e61a14efdae6fd780b4d0ae95e47c8a7797af1;p=thirdparty%2Fsamba.git 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 Reviewed-by: Guenther Deschner Autobuild-User(master): Günther Deschner Autobuild-Date(master): Thu Oct 13 13:48:52 CEST 2016 on sn-devel-144 --- diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c index 2778ba8ca87..a6cbda5fb7e 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));