]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/printers.c
Update ipp documentation to reflect the behavior of configuring WiFi on IPP USB printers.
[thirdparty/cups.git] / scheduler / printers.c
index 80690397da3ef0e6a13af92f373c2daacca7c0fc..991a17eb1989706dd9b1c43b34f1bf13e6e1f3a0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Printer routines for the CUPS scheduler.
  *
- * Copyright © 2007-2019 by Apple Inc.
+ * Copyright © 2007-2020 by Apple Inc.
  * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
  *
  * Licensed under Apache License v2.0.  See the file "LICENSE" for more
@@ -446,7 +446,7 @@ cupsdCreateCommonData(void)
 
   /* cups-version */
   ippAddString(CommonData, IPP_TAG_PRINTER, IPP_TAG_TEXT | IPP_TAG_COPY,
-               "cups-version", NULL, CUPS_SVERSION + 6);
+               "cups-version", NULL, &CUPS_SVERSION[6]);
 
   /* generated-natural-language-supported (no IPP_TAG_COPY) */
   ippAddString(CommonData, IPP_TAG_PRINTER, IPP_TAG_LANGUAGE,
@@ -822,12 +822,15 @@ cupsdDeletePrinter(
   ippDelete(p->attrs);
   ippDelete(p->ppd_attrs);
 
+  _ppdCacheDestroy(p->pc);
+
   mimeDeleteType(MimeDatabase, p->filetype);
   mimeDeleteType(MimeDatabase, p->prefiltertype);
 
   cupsdFreeStrings(&(p->users));
   cupsdFreeQuotas(p);
 
+  cupsdClearString(&p->uuid);
   cupsdClearString(&p->uri);
   cupsdClearString(&p->hostname);
   cupsdClearString(&p->name);
@@ -1472,13 +1475,10 @@ cupsdSaveAllPrinters(void)
   int                  i;              /* Looping var */
   cups_file_t          *fp;            /* printers.conf file */
   char                 filename[1024], /* printers.conf filename */
-                       temp[1024],     /* Temporary string */
                        value[2048],    /* Value string */
                        *ptr,           /* Pointer into value */
                        *name;          /* Current user/group name */
   cupsd_printer_t      *printer;       /* Current printer class */
-  time_t               curtime;        /* Current time */
-  struct tm            curdate;        /* Current date */
   cups_option_t                *option;        /* Current option */
   ipp_attribute_t      *marker;        /* Current marker attribute */
 
@@ -1498,12 +1498,8 @@ cupsdSaveAllPrinters(void)
   * Write a small header to the file...
   */
 
-  time(&curtime);
-  localtime_r(&curtime, &curdate);
-  strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", &curdate);
-
   cupsFilePuts(fp, "# Printer configuration file for " CUPS_SVERSION "\n");
-  cupsFilePrintf(fp, "# Written by cupsd on %s\n", temp);
+  cupsFilePrintf(fp, "# Written by cupsd\n");
   cupsFilePuts(fp, "# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING\n");
 
   cupsFilePrintf(fp, "NextPrinterId %d\n", NextPrinterId);
@@ -2316,8 +2312,6 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */
 
   ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
                "uri-authentication-supported", NULL, auth_supported);
-  ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
-               "uri-security-supported", NULL, "none");
   if (p->printer_id)
     ippAddInteger(p->attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "printer-id", p->printer_id);
   ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_NAME, "printer-name", NULL,
@@ -4016,7 +4010,8 @@ load_ppd(cupsd_printer_t *p)              /* I - Printer */
 
     num_qualities = 0;
 
-    if ((output_mode = ppdFindOption(ppd, "OutputMode")) != NULL)
+    if ((output_mode = ppdFindOption(ppd, "OutputMode")) ||
+        (output_mode = ppdFindOption(ppd, "cupsPrintQuality")))
     {
       if (ppdFindChoice(output_mode, "draft") ||
           ppdFindChoice(output_mode, "fast"))