svn commit: samba r5886 - in trunk/source/printing: .
gd at samba.org
gd at samba.org
Fri Mar 18 21:35:44 GMT 2005
Author: gd
Date: 2005-03-18 21:35:43 +0000 (Fri, 18 Mar 2005)
New Revision: 5886
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5886
Log:
Minor fixes for printerdb. Allows very basic use of the file-backend.
Guenther
Modified:
trunk/source/printing/printerdb.c
trunk/source/printing/printerdb_file.c
Changeset:
Modified: trunk/source/printing/printerdb.c
===================================================================
--- trunk/source/printing/printerdb.c 2005-03-18 16:05:05 UTC (rev 5885)
+++ trunk/source/printing/printerdb.c 2005-03-18 21:35:43 UTC (rev 5886)
@@ -154,15 +154,22 @@
static BOOL printerdb_valid(struct printerdb_methods *printerdb, int tdb)
{
- time_t t = time(NULL);
+ time_t t;
+ if (lp_printerdb_cache_time() <= 0) {
+ DEBUG(10,("printerdb_valid: tdb caching disabled\n"));
+ return False;
+ }
+
+ t = time(NULL);
+
if (t < printerdb->get_last_update(tdb) + lp_printerdb_cache_time()) {
DEBUG(10,("printerdb_valid: printerdb still valid (%d < %d)\n",
(int)t, (int)printerdb->get_last_update(tdb) + lp_printerdb_cache_time()));
return True;
}
- DEBUG(3,("printerdb_valid: cache expired, asking remote backend\n"));
+ DEBUG(10,("printerdb_valid: cache expired, asking remote backend\n"));
return False;
}
Modified: trunk/source/printing/printerdb_file.c
===================================================================
--- trunk/source/printing/printerdb_file.c 2005-03-18 16:05:05 UTC (rev 5885)
+++ trunk/source/printing/printerdb_file.c 2005-03-18 21:35:43 UTC (rev 5886)
@@ -84,7 +84,7 @@
if (*num_files == 0)
return False;
- DEBUG(0,("found: %d files\n", *num_files));
+ DEBUG(10,("found: %d files\n", *num_files));
return True;
}
@@ -330,7 +330,7 @@
if (ret != len)
goto done;
- DEBUG(0,("file_get_c_setprinter: will return %d\n", result));
+ DEBUG(10,("file_get_c_setprinter: will return %d\n", result));
done:
if (mem_ctx != NULL)
@@ -817,7 +817,7 @@
result = sec_io_desc_buf("file_get_secdesc", secdesc_ctr, &ps, 1) ?
WERR_OK : WERR_NOMEM;
- prs_mem_free(&ps);
+ /* prs_mem_free(&ps); */
return result;
}
@@ -959,12 +959,6 @@
len += unpack_values( &info.data, buf+len, buflen-len );
- if (len != buflen) {
- DEBUG(0,("len: %d != buflen %d\n", len, buflen));
- result = WERR_INVALID_PARAM;
- goto done;
- }
-
*info_ptr = (NT_PRINTER_INFO_LEVEL_2 *)memdup(&info, sizeof(info));
done:
More information about the samba-cvs
mailing list