]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Invalidate PPD cache if cupsd.conf is newer (Issue #371)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 2 May 2022 16:12:47 +0000 (12:12 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 2 May 2022 16:12:47 +0000 (12:12 -0400)
CHANGES.md
scheduler/printers.c

index c96e393f53c04d92d7d2cbcaf4c0be7db96d658c..6b88adb82bc0a466fdcd51f624204ff696d83bb2 100644 (file)
@@ -14,6 +14,8 @@ Changes in CUPS v2.4.2 (TBA)
   IPP Everywhere queue (Issues #340, #343)
 - Re-added LibreSSL/OpenSSL support (Issue #362)
 - Updated the Solaris smf service file (Issue #368)
+- The scheduler now regenerates the PPD cache information after changing the
+  "cupsd.conf" file (Issue #371)
 - Updated the scheduler to set "auth-info-required" to "username,password" if a
   backend reports it needs authentication info but doesn't set a method for
   authentication (Issue #373)
index 7a5791ba1e732b5b2b74c0433046c96ff81afe55..4efa613f3f79c69c06063fef97c97769c4a68b8d 100644 (file)
@@ -3874,6 +3874,7 @@ load_ppd(cupsd_printer_t *p)              /* I - Printer */
   int          i, j;                   /* Looping vars */
   char         cache_name[1024];       /* Cache filename */
   struct stat  cache_info;             /* Cache file info */
+  struct stat  conf_info;              /* cupsd.conf file info */
   ppd_file_t   *ppd;                   /* PPD file */
   char         ppd_name[1024];         /* PPD filename */
   struct stat  ppd_info;               /* PPD file info */
@@ -3935,6 +3936,9 @@ load_ppd(cupsd_printer_t *p)              /* I - Printer */
   * Check to see if the cache is up-to-date...
   */
 
+  if (stat(ConfigurationFile, &conf_info))
+    conf_info.st_mtime = 0;
+
   snprintf(cache_name, sizeof(cache_name), "%s/%s.data", CacheDir, p->name);
   if (stat(cache_name, &cache_info))
     cache_info.st_mtime = 0;
@@ -3951,7 +3955,7 @@ load_ppd(cupsd_printer_t *p)              /* I - Printer */
   _ppdCacheDestroy(p->pc);
   p->pc = NULL;
 
-  if (cache_info.st_mtime >= ppd_info.st_mtime)
+  if (cache_info.st_mtime >= ppd_info.st_mtime && cache_info.st_mtime >= conf_info.st_mtime)
   {
     cupsdLogMessage(CUPSD_LOG_DEBUG, "load_ppd: Loading %s...", cache_name);