]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Update lpadmin documentation and show a meaningful error message for interface script...
authorMichael R Sweet <michaelrsweet@gmail.com>
Wed, 1 Nov 2017 16:15:35 +0000 (12:15 -0400)
committerMichael R Sweet <michaelrsweet@gmail.com>
Wed, 1 Nov 2017 16:15:35 +0000 (12:15 -0400)
CHANGES.md
man/lpadmin.man
systemv/lpadmin.c

index a987bc67f1d4fed32cacd37fd810ae5a53a35ff6..865d4976c7e8a820801a3cec55c517bc2f7b6a32 100644 (file)
@@ -6,6 +6,8 @@ Changes in CUPS v2.3b1
 ----------------------
 
 - Dropped RSS subscription management from the web interface (Issue #5012)
+- The lpadmin command now provides a better error message when an unsupported
+  System V interface script is used (Issue #5111)
 - Dropped hard-coded CGI scripting language support (Issue #5124)
 - Fixed the ippserver sample code when threading is disabled or unavailable
   (Issue #5154)
index 17607287cf925eca712b7c30bd6055ede4b30eae..6d776555ce5cd3fd767f66025ff99222c79b44b5 100644 (file)
@@ -1,7 +1,7 @@
 .\"
 .\" lpadmin man page for CUPS.
 .\"
-.\" Copyright 2007-2016 by Apple Inc.
+.\" Copyright 2007-2017 by Apple Inc.
 .\" Copyright 1997-2006 by Easy Software Products.
 .\"
 .\" These coded instructions, statements, and computer programs are the
@@ -10,7 +10,7 @@
 .\" which should have been included with this file.  If this file is
 .\" file is missing or damaged, see the license at "http://www.cups.org/".
 .\"
-.TH lpadmin 8 "CUPS" "29 March 2016" "Apple Inc."
+.TH lpadmin 8 "CUPS" "1 November 2017" "Apple Inc."
 .SH NAME
 lpadmin \- configure cups printers and classes
 .SH SYNOPSIS
@@ -80,8 +80,6 @@ The following options are recognized when configuring a printer queue:
 Adds the named \fIprinter\fR to \fIclass\fR.
 If \fIclass\fR does not exist it is created automatically.
 .TP 5
-\fB\-i \fIppd-file\fR
-.TP 5
 \fB\-P \fIppd-file\fR
 Specifies a PostScript Printer Description (PPD) file to use with the printer.
 .TP 5
@@ -189,6 +187,12 @@ programs on the destination.
 .TP 5
 \fB\-L "\fIlocation\fB"\fR
 Provides a textual location of the destination.
+.SH DEPRECATED OPTIONS
+The following \fBlpadmin\fR options are deprecated:
+.TP 5
+\fB\-i \fIfilename\fR
+This option historically has been used to provide either a System V interface script or (as an implementation side-effect) a PPD file.
+Since interface scripts are no longer supported, the \fI-P\fR option is preferred for providing a PPD file for a printer.
 .SH CONFORMING TO
 Unlike the System V printing system, CUPS allows printer names to contain any printable character except SPACE, TAB, "/", or "#".
 Also, printer and class names are \fInot\fR case-sensitive.
@@ -196,6 +200,7 @@ Finally, the CUPS version of \fBlpadmin\fR may ask the user for an access passwo
 This differs from the System V version which requires the root user to execute this command.
 .SH NOTES
 The CUPS version of \fBlpadmin\fR does not support all of the System V or Solaris printing system configuration options.
+Interface scripts are not supported for security reasons.
 .SH EXAMPLE
 Create an IPP Everywhere print queue:
 .nf
index c608c2d30f01451e995eb8c732040be154f16441..b36ea48c4368769c030cba151dfedceb85632aed 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * "lpadmin" command for CUPS.
  *
- * Copyright 2007-2016 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
  * Copyright 1997-2006 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
@@ -218,6 +218,25 @@ main(int  argc,                    /* I - Number of command-line arguments */
 
                file = argv[i];
              }
+
+             if (*opt == 'i')
+             {
+              /*
+               * Check to see that the specified file is, in fact, a PPD...
+               */
+
+                cups_file_t *fp = cupsFileOpen(file, "r");
+                char line[256];
+
+                if (!cupsFileGets(fp, line, sizeof(line)) || strncmp(line, "*PPD-Adobe", 10))
+                {
+                  _cupsLangPuts(stderr, _("lpadmin: System V interface scripts are no longer supported for security reasons."));
+                  cupsFileClose(fp);
+                  return (1);
+                }
+
+                cupsFileClose(fp);
+             }
              break;
 
          case 'E' : /* Enable the printer/enable encryption */