-CHANGES.txt - 2.2b1 - 2015-10-08
+CHANGES.txt - 2.2b1 - 2015-10-19
--------------------------------
CHANGES IN CUPS V2.2b1
- The cupsd domain socket is no longer world-accessible on OS X
(<rdar://problem/7542560>)
+ - Interface scripts are no longer supported for security reasons
+ (<rdar://problem/23135640>)
\ No newline at end of file
CUPS Online Help (<a href="http://localhost:631/help)">http://localhost:631/help)</a>,
RFC 2569
<h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright © 2007-2014 by Apple Inc.
+Copyright © 2007-2015 by Apple Inc.
</body>
</html>
<a href="man-lpinfo.html?TOPIC=Man+Pages"><b>lpinfo</b>(8),</a>
CUPS Online Help (<a href="http://localhost:631/help">http://localhost:631/help</a>)
<h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright © 2007-2014 by Apple Inc.
+Copyright © 2007-2015 by Apple Inc.
</body>
</html>
<b>smb.conf</b>(5),
CUPS Online Help (<a href="http://localhost:631/help">http://localhost:631/help</a>)
<h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright © 2007-2014 by Apple Inc.
+Copyright © 2007-2015 by Apple Inc.
</body>
</html>
[
<b>-c</b>
<i>config-file</i>
-] [
+] [
<b>-f</b>
] [
<b>-F</b>
<b>systemd</b>(8),
CUPS Online Help (<a href="http://localhost:631/help">http://localhost:631/help</a>)
<h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright © 2007-2014 by Apple Inc.
+Copyright © 2007-2015 by Apple Inc.
</body>
</html>
<dd style="margin-left: 5.0em">The user executing the filter, typically "lp" or "root"; consult the <i>cups-files.conf</i> file for the current setting.
</dl>
<h2 class="title"><a name="CONFORMING_TO">Conforming To</a></h2>
-While the filter interface is compatible with System V interface
-scripts, it will only work with the System V interface script as the
-only filter. Typically the interface script will be provided via the
-<i>lpadmin(8)</i> command using the <i>-i</i> option.
+While the filter interface is compatible with System V interface scripts, CUPS does not support System V interface scripts.
<h2 class="title"><a name="NOTES">Notes</a></h2>
CUPS filters are not meant to be run directly by the user.
Aside from the legacy System V interface issues (<i>argv[0]</i> is the printer name), CUPS filters also expect specific environment variables and file descriptors, and typically run in a user session that (on OS X) has additional restrictions that affect how it runs.
<dt><b>-c </b><i>class</i>
<dd style="margin-left: 5.0em">Adds the named <i>printer</i> to <i>class</i>.
If <i>class</i> does not exist it is created automatically.
-<dt><b>-i </b><i>interface</i>
-<dd style="margin-left: 5.0em">Sets a System V style interface script for the printer.
-This option cannot be specified with the <i>-P</i> option (PPD file) and is intended for providing support for legacy printer drivers.
+<dt><b>-i </b><i>ppd-file</i>
+<dd style="margin-left: 5.0em"><dt><b>-P </b><i>ppd-file</i>
+<dd style="margin-left: 5.0em">Specifies a PostScript Printer Description (PPD) file to use with the printer.
<dt><b>-m </b><i>model</i>
-<dd style="margin-left: 5.0em">Sets a standard System V interface script or PPD file for the printer from the <i>model</i> directory or using one of the driver interfaces.
+<dd style="margin-left: 5.0em">Sets a standard PPD file for the printer from the <i>model</i> directory or using one of the driver interfaces.
Use the <i>-m</i> option with the
<a href="man-lpinfo.html?TOPIC=Man+Pages"><b>lpinfo</b>(8)</a>
command to get a list of supported models.
-The model "raw" clears any existing interface script or PPD file and the model "everywhere" queries the printer referred to by the specified IPP <i>device-uri</i>.
+The model "raw" clears any existing PPD file and the model "everywhere" queries the printer referred to by the specified IPP <i>device-uri</i>.
<dt><b>-o cupsIPPSupplies=true</b>
<dd style="margin-left: 5.0em"><dt><b>-o cupsIPPSupplies=false</b>
<dd style="margin-left: 5.0em">Specifies whether IPP supply level values should be reported.
programs on the destination.
<dt><b>-L "</b><i>location</i><b>"</b>
<dd style="margin-left: 5.0em">Provides a textual location of the destination.
-<dt><b>-P </b><i>ppd-file</i>
-<dd style="margin-left: 5.0em">Specifies a PostScript Printer Description file to use with the printer.
-If specified, this option overrides the <i>-i</i> option (interface script).
</dl>
<h2 class="title"><a name="CONFORMING_TO">Conforming To</a></h2>
Unlike the System V printing system, CUPS allows printer names to contain any printable character except SPACE, TAB, "/", or "#".
<a href="man-lprm.html?TOPIC=Man+Pages"><b>lprm</b>(1),</a>
CUPS Online Help (<a href="http://localhost:631/help">http://localhost:631/help</a>)
<h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright © 2007-2014 by Apple Inc.
+Copyright © 2007-2015 by Apple Inc.
</body>
</html>
<H4>Config Files</H4>
-<P>The scheduler uses several configuration files to store the server settings (<A HREF="man-cupsd.conf.html">cupsd.conf</A>), available classes (<A HREF="man-classes.conf.html">classes.conf</A>), available printers (<A HREF="man-printers.conf.html">printers.conf</A>), current notification subscriptions (<A HREF="man-subscriptions.conf.html">subscriptions.conf</A>), and supported file types and filters (<A HREF="man-mime.types.html">mime.types</A>, <A HREF="man-mime.convs.html">mime.convs</A>). In addition, PostScript Printer Description ("PPD") files or interface scripts are associated with each printer, and the scheduler has cache files for remote printers, PPD files, and current jobs to optimize the scheduler's startup speed and availability.</P>
+<P>The scheduler uses several configuration files to store the server settings (<A HREF="man-cupsd.conf.html">cupsd.conf</A>), available classes (<A HREF="man-classes.conf.html">classes.conf</A>), available printers (<A HREF="man-printers.conf.html">printers.conf</A>), current notification subscriptions (<A HREF="man-subscriptions.conf.html">subscriptions.conf</A>), and supported file types and filters (<A HREF="man-mime.types.html">mime.types</A>, <A HREF="man-mime.convs.html">mime.convs</A>). In addition, PostScript Printer Description ("PPD") files are associated with each printer, and the scheduler has cache files for remote printers, PPD files, and current jobs to optimize the scheduler's startup speed and availability.</P>
<H4>Job Files</H4>
</dl>
-<p>The CUPS-Add-Modify-Printer request can optionally be followed by a PPD
-file or System V interface script to be used for the printer. The
-"ppd-name" attribute overrides any file that is attached to the end of
-the request with a local CUPS PPD file.
+<p>The CUPS-Add-Modify-Printer request can optionally be followed by a PPD file to be used for the printer. The "ppd-name" attribute overrides any file that is attached to the end of the request with a local CUPS PPD file.
<h4>CUPS-Add-Modify-Printer Response</h4>
.\" 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 filter 7 "CUPS" "26 August 2015" "Apple Inc."
+.TH filter 7 "CUPS" "19 October 2015" "Apple Inc."
.SH NAME
filter \- cups file conversion filter interface
.SH SYNOPSIS
.B USER
The user executing the filter, typically "lp" or "root"; consult the \fIcups-files.conf\fR file for the current setting.
.SH CONFORMING TO
-While the filter interface is compatible with System V interface
-scripts, it will only work with the System V interface script as the
-only filter. Typically the interface script will be provided via the
-\fIlpadmin(8)\fR command using the \fI-i\fR option.
+While the filter interface is compatible with System V interface scripts, CUPS does not support System V interface scripts.
.SH NOTES
CUPS filters are not meant to be run directly by the user.
Aside from the legacy System V interface issues (\fIargv[0]\fR is the printer name), CUPS filters also expect specific environment variables and file descriptors, and typically run in a user session that (on OS X) has additional restrictions that affect how it runs.
.\" 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" "11 February 2015" "Apple Inc."
+.TH lpadmin 8 "CUPS" "19 October 2015" "Apple Inc."
.SH NAME
lpadmin \- configure cups printers and classes
.SH SYNOPSIS
Adds the named \fIprinter\fR to \fIclass\fR.
If \fIclass\fR does not exist it is created automatically.
.TP 5
-\fB\-i \fIinterface\fR
-Sets a System V style interface script for the printer.
-This option cannot be specified with the \fI-P\fR option (PPD file) and is intended for providing support for legacy printer drivers.
+\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
\fB\-m \fImodel\fR
-Sets a standard System V interface script or PPD file for the printer from the \fImodel\fR directory or using one of the driver interfaces.
+Sets a standard PPD file for the printer from the \fImodel\fR directory or using one of the driver interfaces.
Use the \fI-m\fR option with the
.BR lpinfo (8)
command to get a list of supported models.
-The model "raw" clears any existing interface script or PPD file and the model "everywhere" queries the printer referred to by the specified IPP \fIdevice-uri\fR.
+The model "raw" clears any existing PPD file and the model "everywhere" queries the printer referred to by the specified IPP \fIdevice-uri\fR.
.TP 5
\fB\-o cupsIPPSupplies=true\fR
.TP 5
.TP 5
\fB\-L "\fIlocation\fB"\fR
Provides a textual location of the destination.
-.TP 5
-\fB\-P \fIppd-file\fR
-Specifies a PostScript Printer Description file to use with the printer.
-If specified, this option overrides the \fI-i\fR option (interface script).
.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.
#
# ESP Package Manager (EPM) file list for CUPS.
#
-# Copyright 2007-2014 by Apple Inc.
+# Copyright 2007-2015 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# Config files
d 0755 root $CUPS_GROUP $SERVERROOT -
-d 0755 root $CUPS_GROUP $SERVERROOT/interfaces -
d 0755 root $CUPS_GROUP $SERVERROOT/ppd -
d 0700 root $CUPS_GROUP $SERVERROOT/ssl -
c $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cups-files.conf conf/cups-files.conf
/etc/cups/cups-files.conf.default
/etc/cups/cupsd.conf.default
/etc/cups/snmp.conf.default
-%dir /etc/cups/interfaces
%dir /etc/cups/ppd
%attr(0700,root,root) %dir /etc/cups/ssl
$(INSTALL_DIR) -m 755 $(SERVERBIN)/driver
echo Creating $(SERVERROOT)...
$(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)
- echo Creating $(SERVERROOT)/interfaces...
- $(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)/interfaces
echo Creating $(SERVERROOT)/ppd...
$(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)/ppd
if test "x`uname`" != xDarwin; then \
* Figure out if this is a static or dynamic PPD file...
*/
+ if (strstr(name, "../"))
+ {
+ fputs("ERROR: Invalid PPD name.\n", stderr);
+ return (1);
+ }
+
strlcpy(scheme, name, sizeof(scheme));
if ((sptr = strchr(scheme, ':')) != NULL)
{
char srcfile[1024], /* Source Script/PPD file */
dstfile[1024]; /* Destination Script/PPD file */
int modify; /* Non-zero if we are modifying */
- int changed_driver, /* Changed the PPD/interface script? */
+ int changed_driver, /* Changed the PPD? */
need_restart_job, /* Need to restart job? */
set_device_uri, /* Did we set the device URI? */
set_port_monitor; /* Did we set the port monitor? */
cupsdSetString(&printer->device_uri, "file:///dev/null");
/*
- * See if we have an interface script or PPD file attached to the request...
+ * See if we have a PPD file attached to the request...
*/
if (con->filename)
* Then see what kind of file it is...
*/
- snprintf(dstfile, sizeof(dstfile), "%s/interfaces/%s", ServerRoot,
- printer->name);
-
- if (!strncmp(line, "*PPD-Adobe", 10))
+ if (strncmp(line, "*PPD-Adobe", 10))
{
- /*
- * The new file is a PPD file, so remove any old interface script
- * that might be lying around...
- */
-
- unlink(dstfile);
- }
- else
- {
- /*
- * This must be an interface script, so move the file over to the
- * interfaces directory and make it executable...
- */
-
- if (copy_file(srcfile, dstfile, ConfigFilePerm | 0110))
- {
- send_ipp_status(con, IPP_INTERNAL_ERROR,
- _("Unable to copy interface script - %s"),
- strerror(errno));
- return;
- }
-
- cupsdLogMessage(CUPSD_LOG_DEBUG,
- "Copied interface script successfully");
+ send_ipp_status(con, IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED, _("Bad PPD file."));
+ return;
}
snprintf(dstfile, sizeof(dstfile), "%s/ppd/%s.ppd", ServerRoot,
printer->name);
- if (!strncmp(line, "*PPD-Adobe", 10))
- {
- /*
- * The new file is a PPD file, so move the file over to the
- * ppd directory and make it readable by all...
- */
-
- if (copy_file(srcfile, dstfile, ConfigFilePerm))
- {
- send_ipp_status(con, IPP_INTERNAL_ERROR,
- _("Unable to copy PPD file - %s"),
- strerror(errno));
- return;
- }
+ /*
+ * The new file is a PPD file, so move the file over to the ppd
+ * directory...
+ */
- cupsdLogMessage(CUPSD_LOG_DEBUG,
- "Copied PPD file successfully");
- }
- else
+ if (copy_file(srcfile, dstfile, ConfigFilePerm))
{
- /*
- * This must be an interface script, so remove any old PPD file that
- * may be lying around...
- */
-
- unlink(dstfile);
+ send_ipp_status(con, IPP_INTERNAL_ERROR, _("Unable to copy PPD file - %s"), strerror(errno));
+ return;
}
+
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "Copied PPD file successfully");
}
}
- else if ((attr = ippFindAttribute(con->request, "ppd-name",
- IPP_TAG_NAME)) != NULL)
+ else if ((attr = ippFindAttribute(con->request, "ppd-name", IPP_TAG_NAME)) != NULL)
{
+ const char *ppd_name = ippGetString(attr, 0, NULL);
+ /* ppd-name value */
+
need_restart_job = 1;
changed_driver = 1;
- if (!strcmp(attr->values[0].string.text, "raw"))
+ if (!strcmp(ppd_name, "raw"))
{
/*
- * Raw driver, remove any existing PPD or interface script files.
+ * Raw driver, remove any existing PPD file.
*/
- snprintf(dstfile, sizeof(dstfile), "%s/interfaces/%s", ServerRoot,
- printer->name);
- unlink(dstfile);
-
- snprintf(dstfile, sizeof(dstfile), "%s/ppd/%s.ppd", ServerRoot,
- printer->name);
+ snprintf(dstfile, sizeof(dstfile), "%s/ppd/%s.ppd", ServerRoot, printer->name);
unlink(dstfile);
}
+ else if (strstr(ppd_name, "../"))
+ {
+ send_ipp_status(con, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, _("Invalid ppd-name value."));
+ return;
+ }
else
{
/*
* PPD model file...
*/
- snprintf(dstfile, sizeof(dstfile), "%s/interfaces/%s", ServerRoot,
- printer->name);
- unlink(dstfile);
-
- snprintf(dstfile, sizeof(dstfile), "%s/ppd/%s.ppd", ServerRoot,
- printer->name);
+ snprintf(dstfile, sizeof(dstfile), "%s/ppd/%s.ppd", ServerRoot, printer->name);
- if (copy_model(con, attr->values[0].string.text, dstfile))
+ if (copy_model(con, ppd_name, dstfile))
{
send_ipp_status(con, IPP_INTERNAL_ERROR, _("Unable to copy PPD file."));
return;
}
- cupsdLogMessage(CUPSD_LOG_DEBUG,
- "Copied PPD file successfully");
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "Copied PPD file successfully");
}
}
if (changed_driver)
{
/*
- * If we changed the PPD/interface script, then remove the printer's cache
- * file and clear the printer-state-reasons...
+ * If we changed the PPD, then remove the printer's cache file and clear the
+ * printer-state-reasons...
*/
char cache_name[1024]; /* Cache filename for printer attrs */
/*
- * 'copy_file()' - Copy a PPD file or interface script...
+ * 'copy_file()' - Copy a PPD file...
*/
static int /* O - 0 = success, -1 = error */
/* cupsProtocol attribute */
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "copy_model(con=%p, from=\"%s\", to=\"%s\")",
- con, from, to);
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "copy_model(con=%p, from=\"%s\", to=\"%s\")", con, from, to);
/*
* Run cups-driverd to get the PPD file...
* Remove any old PPD or script files...
*/
- snprintf(filename, sizeof(filename), "%s/interfaces/%s", ServerRoot,
- printer->name);
- unlink(filename);
- snprintf(filename, sizeof(filename), "%s/interfaces/%s.O", ServerRoot,
- printer->name);
- unlink(filename);
-
snprintf(filename, sizeof(filename), "%s/ppd/%s.ppd", ServerRoot,
printer->name);
unlink(filename);
cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_ppd(%p[%d], %p[%s=%s])", con,
con->number, uri, uri->name, uri->values[0].string.text);
- if (!strcmp(uri->name, "ppd-name"))
+ if (!strcmp(ippGetName(uri), "ppd-name"))
{
/*
* Return a PPD file from cups-driverd...
*/
- char command[1024], /* cups-driverd command */
- options[1024], /* Options to pass to command */
- ppd_name[1024]; /* ppd-name */
-
+ const char *ppd_name = ippGetString(uri, 0, NULL);
+ /* ppd-name value */
+ char command[1024], /* cups-driverd command */
+ options[1024], /* Options to pass to command */
+ oppd_name[1024]; /* Escaped ppd-name */
/*
* Check policy...
return;
}
+ /*
+ * Check ppd-name value...
+ */
+
+ if (strstr(ppd_name, "../"))
+ {
+ send_ipp_status(con, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, _("Invalid ppd-name value."));
+ return;
+ }
+
/*
* Run cups-driverd command with the given options...
*/
snprintf(command, sizeof(command), "%s/daemon/cups-driverd", ServerBin);
- url_encode_string(uri->values[0].string.text, ppd_name, sizeof(ppd_name));
- snprintf(options, sizeof(options), "get+%d+%s",
- con->request->request.op.request_id, ppd_name);
+ url_encode_string(ppd_name, oppd_name, sizeof(oppd_name));
+ snprintf(options, sizeof(options), "get+%d+%s", ippGetRequestId(con->request), oppd_name);
if (cupsdSendCommand(con, command, options, 0))
{
* went wrong...
*/
- send_ipp_status(con, IPP_INTERNAL_ERROR,
- _("cups-driverd failed to execute."));
+ send_ipp_status(con, IPP_INTERNAL_ERROR, _("cups-driverd failed to execute."));
}
}
- else if (!strcmp(uri->name, "printer-uri") &&
- cupsdValidateDest(uri->values[0].string.text, &dtype, &dest))
+ else if (!strcmp(ippGetName(uri), "printer-uri") && cupsdValidateDest(ippGetString(uri, 0, NULL), &dtype, &dest))
{
int i; /* Looping var */
char filename[1024]; /* PPD filename */
-
/*
* Check policy...
*/
* See if we need the PPD for a class or remote printer...
*/
- snprintf(filename, sizeof(filename), "%s/ppd/%s.ppd", ServerRoot,
- dest->name);
+ snprintf(filename, sizeof(filename), "%s/ppd/%s.ppd", ServerRoot, dest->name);
if ((dtype & CUPS_PRINTER_REMOTE) && access(filename, 0))
{
- con->response->request.status.status_code = CUPS_SEE_OTHER;
- ippAddString(con->response, IPP_TAG_OPERATION, IPP_TAG_URI,
- "printer-uri", NULL, dest->uri);
+ send_ipp_status(con, IPP_STATUS_CUPS_SEE_OTHER, _("See remote printer."));
+ ippAddString(con->response, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, dest->uri);
return;
}
else if (dtype & CUPS_PRINTER_CLASS)
for (i = 0; i < dest->num_printers; i ++)
if (!(dest->printers[i]->type & CUPS_PRINTER_CLASS))
{
- snprintf(filename, sizeof(filename), "%s/ppd/%s.ppd", ServerRoot,
- dest->printers[i]->name);
+ snprintf(filename, sizeof(filename), "%s/ppd/%s.ppd", ServerRoot, dest->printers[i]->name);
if (!access(filename, 0))
break;
dest = dest->printers[i];
else
{
- con->response->request.status.status_code = CUPS_SEE_OTHER;
- ippAddString(con->response, IPP_TAG_OPERATION, IPP_TAG_URI,
- "printer-uri", NULL, dest->printers[0]->uri);
+ send_ipp_status(con, IPP_STATUS_CUPS_SEE_OTHER, _("See remote printer."));
+ ippAddString(con->response, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, dest->printers[0]->uri);
return;
}
}
if ((con->file = open(filename, O_RDONLY)) < 0)
{
- send_ipp_status(con, IPP_NOT_FOUND,
- _("The PPD file \"%s\" could not be opened: %s"),
- uri->values[0].string.text, strerror(errno));
+ send_ipp_status(con, IPP_STATUS_ERROR_NOT_FOUND, _("The PPD file \"%s\" could not be opened: %s"), ippGetString(uri, 0, NULL), strerror(errno));
return;
}
con->pipe_pid = 0;
- con->response->request.status.status_code = IPP_OK;
+ ippSetStatusCode(con->response, IPP_STATUS_OK);
}
else
- send_ipp_status(con, IPP_NOT_FOUND,
- _("The PPD file \"%s\" could not be found."),
- uri->values[0].string.text);
+ send_ipp_status(con, IPP_STATUS_ERROR_NOT_FOUND, _("The PPD file \"%s\" could not be found."), ippGetString(uri, 0, NULL));
}
}
else if (!(p->type & CUPS_PRINTER_REMOTE))
{
- char interface[1024]; /* Interface script */
-
-
- snprintf(interface, sizeof(interface), "%s/interfaces/%s", ServerRoot,
- p->name);
- if (!access(interface, X_OK))
- {
- /*
- * Yes, we have a System V style interface script; use it!
- */
-
- snprintf(interface, sizeof(interface), "*/* 0 %s/interfaces/%s",
- ServerRoot, p->name);
- add_printer_filter(p, p->filetype, interface);
- }
- else
- {
- /*
- * Add a filter from application/vnd.cups-raw to printer/name to
- * handle "raw" printing by users.
- */
+ /*
+ * Add a filter from application/vnd.cups-raw to printer/name to
+ * handle "raw" printing by users.
+ */
- add_printer_filter(p, p->filetype, "application/vnd.cups-raw 0 -");
+ add_printer_filter(p, p->filetype, "application/vnd.cups-raw 0 -");
- /*
- * Add a PostScript filter, since this is still possibly PS printer.
- */
+ /*
+ * Add a PostScript filter, since this is still possibly PS printer.
+ */
- add_printer_filter(p, p->filetype,
- "application/vnd.cups-postscript 0 -");
- }
+ add_printer_filter(p, p->filetype,
+ "application/vnd.cups-postscript 0 -");
}
if (p->pc && p->pc->prefilters)
}
else
{
- /*
- * If we have an interface script, add a filter entry for it...
- */
-
- char interface[1024]; /* Interface script */
-
-
- snprintf(interface, sizeof(interface), "%s/interfaces/%s", ServerRoot,
- p->name);
- if (!access(interface, X_OK))
- {
- /*
- * Yes, we have a System V style interface script; use it!
- */
-
- ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_TEXT,
- "printer-make-and-model", NULL,
- "Local System V Printer");
- }
- else if (((!strncmp(p->device_uri, "ipp://", 6) ||
- !strncmp(p->device_uri, "ipps://", 7)) &&
- (strstr(p->device_uri, "/printers/") != NULL ||
- strstr(p->device_uri, "/classes/") != NULL)) ||
- ((strstr(p->device_uri, "._ipp.") != NULL ||
- strstr(p->device_uri, "._ipps.") != NULL) &&
- !strcmp(p->device_uri + strlen(p->device_uri) - 5, "/cups")))
+ if (((!strncmp(p->device_uri, "ipp://", 6) ||
+ !strncmp(p->device_uri, "ipps://", 7)) &&
+ (strstr(p->device_uri, "/printers/") != NULL ||
+ strstr(p->device_uri, "/classes/") != NULL)) ||
+ ((strstr(p->device_uri, "._ipp.") != NULL ||
+ strstr(p->device_uri, "._ipps.") != NULL) &&
+ !strcmp(p->device_uri + strlen(p->device_uri) - 5, "/cups")))
{
/*
* Tell the client this is really a hard-wired remote printer.
*val; /* Pointer to allow/deny value */
int num_options; /* Number of options */
cups_option_t *options; /* Options */
- char *file, /* New PPD file/interface script */
+ char *file, /* New PPD file */
evefile[1024] = "";
/* IPP Everywhere PPD */
const char *ppd_name, /* ppd-name value */
}
break;
- case 'i' : /* Use the specified interface script */
+ case 'P' : /* Use the specified PPD file */
+ case 'i' : /* Use the specified PPD file */
if (argv[i][2])
file = argv[i] + 2;
else
if (i >= argc)
{
- _cupsLangPuts(stderr,
- _("lpadmin: Expected interface after \"-i\" "
- "option."));
+ _cupsLangPrintf(stderr, _("lpadmin: Expected PPD after \"-%c\" option."), argv[i - 1][1]);
return (1);
}
}
break;
- case 'P' : /* Use the specified PPD file */
- if (argv[i][2])
- file = argv[i] + 2;
- else
- {
- i ++;
-
- if (i >= argc)
- {
- _cupsLangPuts(stderr,
- _("lpadmin: Expected PPD after \"-P\" option."));
- return (1);
- }
-
- file = argv[i];
- }
- break;
-
default :
_cupsLangPrintf(stderr,
_("lpadmin: Unknown option \"%c\"."), argv[i][1]);
{
_cupsLangPuts(stdout, _("\tConnection: direct"));
- if (make_model && strstr(make_model, "System V Printer"))
- _cupsLangPrintf(stdout,
- _("\tInterface: %s/interfaces/%s"),
- cg->cups_serverroot, printer);
- else if (make_model && !strstr(make_model, "Raw Printer"))
+ if (make_model && !strstr(make_model, "Raw Printer"))
_cupsLangPrintf(stdout,
_("\tInterface: %s/ppd/%s.ppd"),
cg->cups_serverroot, printer);
{
_cupsLangPuts(stdout, _("\tConnection: direct"));
- if (make_model && strstr(make_model, "System V Printer"))
- _cupsLangPrintf(stdout,
- _("\tInterface: %s/interfaces/%s"),
- cg->cups_serverroot, printer);
- else if (make_model && !strstr(make_model, "Raw Printer"))
+ if (make_model && !strstr(make_model, "Raw Printer"))
_cupsLangPrintf(stdout,
_("\tInterface: %s/ppd/%s.ppd"),
cg->cups_serverroot, printer);