]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add ReadyPaperSizes directive for cupsd.conf.
authorMichael R Sweet <msweet@msweet.org>
Sun, 7 Mar 2021 22:44:06 +0000 (17:44 -0500)
committerMichael R Sweet <msweet@msweet.org>
Sun, 7 Mar 2021 22:44:06 +0000 (17:44 -0500)
CHANGES.md
man/cupsd.conf.5
scheduler/conf.c
scheduler/conf.h
xcode/CUPS.xcodeproj/project.pbxproj

index 33fffc30a5ea64122d642859ca89bf09683569f2..a26671c06f353dfa0e3fcc9f1abe3758bde3173c 100644 (file)
@@ -4,8 +4,8 @@ Changes in OpenPrinting CUPS
 CUPS v2.4rc1 (Pending)
 ----------------------
 
-- Added support for CUPS running in a snapcraft snap.
-- Added extra check for administrative inquiries from snapped clients.
+- Added support for CUPS running in a Snapcraft snap.
+- Added support for AirPrint and Mopria clients (Issue #105)
 - Fixed Kerberos authentication for the web interface (Issue #19)
 - The ZPL sample driver now supports more "standard" label sizes (Issue #70)
 - The IPP backend did not return the correct status code when a job was canceled
index 897917405a98a8765fe5d9367983de17623a97d9..f32f7485912b9826f7e75a9e1c6c73b484297831 100644 (file)
@@ -8,7 +8,7 @@
 .\" Licensed under Apache License v2.0.  See the file "LICENSE" for more
 .\" information.
 .\"
-.TH cupsd.conf 5 "CUPS" "2021-03-06" "OpenPrinting"
+.TH cupsd.conf 5 "CUPS" "2021-03-07" "OpenPrinting"
 .SH NAME
 cupsd.conf \- server configuration file for cups
 .SH DESCRIPTION
@@ -370,6 +370,12 @@ Specifies whether the job history is preserved after a job is printed.
 If a numeric value is specified, the job history is preserved for the indicated number of seconds after printing.
 If "Yes", the job history is preserved until the MaxJobs limit is reached.
 The default is "Yes".
+.\"#ReadyPaperSizes
+.TP 5
+\fBReadyPaperSizes \fIsizename[,...]\fR
+Specifies a list of potential paper sizes that are reported as "ready" (loaded).
+The actual list will only contain sizes that each printer supports.
+The default is "Letter,Legal,Tabloid,4x6,Env10" for North America and "A3,A4,A5,A6,EnvDL" elsewhere.
 .\"#ReloadTimeout
 .TP 5
 \fBReloadTimeout \fIseconds\fR
index 1008e2abf13bef6fd7eac14f2e9d78fc3df1aa3b..0fdbd8d721d920645e0a1c6afeca27c59640125a 100644 (file)
@@ -624,6 +624,8 @@ cupsdReadConfiguration(void)
     cupsdSetString(&DefaultLanguage, language->language);
 
   cupsdClearString(&DefaultPaperSize);
+  cupsArrayDelete(ReadyPaperSizes);
+  ReadyPaperSizes = NULL;
 
   cupsdSetString(&TempDir, NULL);
 
@@ -1274,6 +1276,17 @@ cupsdReadConfiguration(void)
       cupsdSetString(&DefaultPaperSize, "A4");
   }
 
+  if (!ReadyPaperSizes)
+  {
+    // Build default list of common sizes for North America and worldwide...
+    if (!strcasecmp(DefaultPaperSize, "Letter"))
+      ReadyPaperSizes = _cupsArrayNewStrings("Letter,Legal,Tabloid,4x6,Env10", ',');
+    else if (!strcasecmp(DefaultPaperSize, "A4"))
+      ReadyPaperSizes = _cupsArrayNewStrings("A4,A3,A5,A6,EnvDL", ',');
+    else
+      ReadyPaperSizes = _cupsArrayNewStrings(DefaultPaperSize, ',');
+  }
+
  /*
   * Update classification setting as needed...
   */
@@ -3318,6 +3331,17 @@ read_cupsd_conf(cups_file_t *fp) /* I - File to read from */
         cupsdLogMessage(CUPSD_LOG_WARN, "Unknown LogTimeFormat %s on line %d of %s.",
                        value, linenum, ConfigurationFile);
     }
+    else if (!_cups_strcasecmp(line, "ReadyPaperSizes") && value)
+    {
+     /*
+      * ReadyPaperSizes sizename[,sizename,...]
+      */
+
+      if (ReadyPaperSizes)
+        _cupsArrayAddStrings(ReadyPaperSizes, value, ',');
+      else
+        ReadyPaperSizes = _cupsArrayNewStrings(value, ',');
+    }
     else if (!_cups_strcasecmp(line, "ServerTokens") && value)
     {
      /*
index 5a2f8bdb9af9d99ac7d6ebd2f3fe84668a22792a..adc205a9a7b34945c6b3c6aa9691f4e55f5d5daa 100644 (file)
@@ -148,6 +148,8 @@ VAR char            *AccessLog              VALUE(NULL),
                                        /* Remote root user */
                        *Classification         VALUE(NULL);
                                        /* Classification of system */
+VAR cups_array_t       *ReadyPaperSizes        VALUE(NULL);
+                                       /* List of paper sizes to list as ready */
 VAR uid_t              User                    VALUE(1),
                                        /* User ID for server */
                        RunUser                 VALUE(0);
index 4208d10a214cca83f829f1254446283d03b0805f..51bbfc5562eee98e5f9e0a1f2eb2e7736950ce6f 100644 (file)
                724379C41333FFC7009631B9 /* usb-darwin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "usb-darwin.c"; path = "../backend/usb-darwin.c"; sourceTree = "<group>"; };
                724379C51333FFC7009631B9 /* usb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = usb.c; path = ../backend/usb.c; sourceTree = "<group>"; };
                724379CA1334000E009631B9 /* ieee1284.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ieee1284.c; path = ../backend/ieee1284.c; sourceTree = "<group>"; };
-               72496E161A13A03B0051899C /* org.cups.cups-lpd.socket */ = {isa = PBXFileReference; lastKnownFileType = text; name = "org.cups.cups-lpd.socket"; path = "../scheduler/org.cups.cups-lpd.socket"; sourceTree = SOURCE_ROOT; };
-               72496E171A13A03B0051899C /* org.cups.cups-lpdAT.service.in */ = {isa = PBXFileReference; lastKnownFileType = text; name = "org.cups.cups-lpdAT.service.in"; path = "../scheduler/org.cups.cups-lpdAT.service.in"; sourceTree = SOURCE_ROOT; };
                724FA5351CC0370C0092477B /* testadmin */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testadmin; sourceTree = BUILT_PRODUCTS_DIR; };
                724FA5481CC037370092477B /* testarray */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testarray; sourceTree = BUILT_PRODUCTS_DIR; };
                724FA55B1CC037500092477B /* testcache */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testcache; sourceTree = BUILT_PRODUCTS_DIR; };
                72E65BD318DC7A9800097E89 /* spec-ppd.header */ = {isa = PBXFileReference; lastKnownFileType = text; name = "spec-ppd.header"; path = "../filter/spec-ppd.header"; sourceTree = "<group>"; };
                72E65BD418DC7A9800097E89 /* spec-ppd.shtml */ = {isa = PBXFileReference; lastKnownFileType = text.html.other; name = "spec-ppd.shtml"; path = "../filter/spec-ppd.shtml"; sourceTree = "<group>"; };
                72E65BD518DC818400097E89 /* org.cups.cups-lpd.plist.in */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = "org.cups.cups-lpd.plist.in"; path = "../scheduler/org.cups.cups-lpd.plist.in"; sourceTree = SOURCE_ROOT; };
-               72E65BD618DC818400097E89 /* org.cups.cupsd.path.in */ = {isa = PBXFileReference; lastKnownFileType = text; name = org.cups.cupsd.path.in; path = ../scheduler/org.cups.cupsd.path.in; sourceTree = SOURCE_ROOT; };
-               72E65BD718DC818400097E89 /* org.cups.cupsd.service.in */ = {isa = PBXFileReference; lastKnownFileType = text; name = org.cups.cupsd.service.in; path = ../scheduler/org.cups.cupsd.service.in; sourceTree = SOURCE_ROOT; };
-               72E65BD818DC818400097E89 /* org.cups.cupsd.socket.in */ = {isa = PBXFileReference; lastKnownFileType = text; name = org.cups.cupsd.socket.in; path = ../scheduler/org.cups.cupsd.socket.in; sourceTree = SOURCE_ROOT; };
                72E65BD918DC850A00097E89 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = Makefile; path = ../Makefile; sourceTree = "<group>"; };
                72E65BDC18DC852700097E89 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = Makefile; path = ../scheduler/Makefile; sourceTree = SOURCE_ROOT; };
                72E65BDE18DCA35700097E89 /* CHANGES.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = CHANGES.md; path = ../CHANGES.md; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = "<none>"; };
                                72E65BDC18DC852700097E89 /* Makefile */,
                                7226369B18AE6D19004ED309 /* org.cups.cups-lpd.plist */,
                                72E65BD518DC818400097E89 /* org.cups.cups-lpd.plist.in */,
-                               72496E171A13A03B0051899C /* org.cups.cups-lpdAT.service.in */,
-                               72496E161A13A03B0051899C /* org.cups.cups-lpd.socket */,
-                               72E65BD618DC818400097E89 /* org.cups.cupsd.path.in */,
                                7226369C18AE6D19004ED309 /* org.cups.cupsd.plist */,
-                               72E65BD718DC818400097E89 /* org.cups.cupsd.service.in */,
-                               72E65BD818DC818400097E89 /* org.cups.cupsd.socket.in */,
                                72220F6913330B0C00FCA411 /* auth.c */,
                                72220F6A13330B0C00FCA411 /* auth.h */,
                                72220F6B13330B0C00FCA411 /* banners.c */,