Comparar commits

..

32 Commits

Autor SHA1 Mensagem Data
Michael R Sweet c8cb6400e3 Update for CUPS 2.2.12 release. 2019-08-15 18:35:30 -04:00
Michael R Sweet f24e6cf6a3 Fix multiple security/disclosure issues:
- CVE-2019-8696 and CVE-2019-8675: Fixed SNMP buffer overflows (rdar://51685251)
- Fixed IPP buffer overflow (rdar://50035411)
- Fixed memory disclosure issue in the scheduler (rdar://51373853)
- Fixed DoS issues in the scheduler (rdar://51373929)
2019-08-15 14:08:31 -04:00
Michael R Sweet ad312a0c66 Stop accepting attributes in collections (Issue #5630) 2019-08-07 13:02:32 -04:00
Michael R Sweet e1eb4a8495 Fix man page typo... 2019-08-05 20:11:33 -04:00
Michael R Sweet 04fef0e213 USB quirk (Issue #5617) 2019-08-01 14:30:55 -04:00
Michael R Sweet 86cf8118f7 Changelog 2019-08-01 14:26:19 -04:00
Michael R Sweet 2f26c6b713 GNU TLS FIPS140 support (Issue #5601, Issue #5622) 2019-08-01 14:25:35 -04:00
Michael R Sweet d11af547d1 Fix some PPD parser issues discovered via fuzzing (Issue #5623, Issue #5624) 2019-08-01 14:00:03 -04:00
Michael R Sweet b4909ef014 Fix memory leak in ppdOpen. 2019-08-01 13:02:35 -04:00
Michael R Sweet 2062d366ea Don't default printer-info, printer-location, printer-geo-location (Issue #5603) 2019-07-16 10:43:58 -04:00
Michael R Sweet c507739347 Fix lpadmin with cupsIPPSupplies and cupsSNMPSupplies (Issue #5610) 2019-07-16 09:27:32 -04:00
Michael R Sweet 666d07699b Always check the group membership list (Issue #5613) 2019-07-16 09:17:04 -04:00
Michael R Sweet c1a310ffdc The scheduler would restart continuously when idle and printers were not
shared (rdar://52561199)
2019-07-16 09:07:56 -04:00
Michael R Sweet 3676fc318a Use GZIPPROG instead of GZIP to avoid install issues (Issue #5595) 2019-06-12 08:37:06 -04:00
Michael R Sweet 669659ca88 Mirror bug fix from master (Issue #5588) 2019-05-30 10:22:51 -04:00
Michael R Sweet 9b48d16c1d Back-port more compatibility fixes from CUPS 2.3.x - IPP/1.1 compatibility with
old versions of CUPS... (Issue #5587)
2019-05-28 14:54:01 -04:00
Michael R Sweet c5b991fdaa Put IDR command in its own XA/XZ section. 2019-05-24 09:25:35 -04:00
Michael R Sweet fd8245cd01 Mirror ZPL fix from master. 2019-05-24 08:15:14 -04:00
Michael R Sweet 35e927f835 Enforce USB read limits (Issue #5583) 2019-05-17 07:53:42 -04:00
Michael R Sweet a0096a2f73 Block cups-files.conf directives (Issue #5530) 2019-05-15 10:31:24 -04:00
Michael R Sweet 6235f36a95 Update copyrights. 2019-05-08 11:36:01 -04:00
Michael R Sweet 971bdfe043 Fix CSS on short browsers (Issue #5574) 2019-05-08 11:32:27 -04:00
Michael R Sweet 9d6f1bb6c6 Bump the default Timeout to 15 minutes as well (Issue #5570) 2019-05-02 09:03:47 -04:00
Michael R Sweet d76e57f8c6 Mirror changes from master. 2019-05-01 16:02:34 -04:00
Michael R Sweet a2eba04317 Update the hold expiration logging - one case is an error, the other is normal (Issue #5570) 2019-05-01 14:58:28 -04:00
Michael R Sweet c1b133728b Increase the MultipleOperationTimeOut default to 15 minutes, log an error if
the job submission times out (Issue #5570)
2019-05-01 14:39:52 -04:00
Michael R Sweet 8829edfef0 Add a workaround for old Samsung drivers (Issue #5562) 2019-04-15 16:50:24 -04:00
Michael R Sweet 0ad7895cff For octetString values, compare the length against the -supported value
(Issue #5557)
2019-04-15 16:28:06 -04:00
Michael R Sweet aaebca5660 Update systemd service file for cupsd (Issue #5551) 2019-04-15 16:16:04 -04:00
Michael R Sweet ee5419f6df Bump version. 2019-04-15 16:06:35 -04:00
Michael R Sweet 803b6de89a Correctly encode octetString values for print filters (Issue #5558)
scheduler/job.c:
- get_options(): Correctly encode IPP_TAG_STRING as a quoted string or a hex
  string depending on the value.
- ipp_length(): Handle IPP_TAG_STRING separately.
2019-04-15 16:04:28 -04:00
Michael R Sweet 35064a2596 Fix changelog (Issue #5561) 2019-04-15 09:24:53 -04:00
70 arquivos alterados com 1759 adições e 1309 exclusões
+44 -2
Ver Arquivo
@@ -1,7 +1,49 @@
CHANGES - 2.2.11 - 2019-03-22
CHANGES - 2.2.12 - 2019-08-15
=============================
Changes in CUPS v2.2.12
-----------------------
- CVE-2019-8696 and CVE-2019-8675: Fixed SNMP buffer overflows (rdar://51685251)
- The `cupsctl` command now prevents setting "cups-files.conf" directives
(Issue #5530)
- Updated the systemd service file for cupsd (Issue #5551)
- The `cupsCheckDestSupported` function did not check octetString values
correctly (Issue #5557)
- The scheduler did not encode octetString values like "job-password" correctly
for the print filters (Issue #5558)
- Restored minimal support for the `Emulators` keyword in PPD files to allow
old Samsung printer drivers to continue to work (Issue #5562)
- Timed out job submission now yields an error (Issue #5570)
- The footer in the web interface covered some content on small displays
(Issue #5574)
- The libusb-based USB backend now enforces read limits, improving print speed
in many cases (Issue #5583)
- Fixed some compatibility issues with old releases of CUPS (Issue #5587)
- Fixed a bug in the scheduler job cleanup code (Issue #5588)
- "make" failed with GZIP options (Issue #5595)
- Added FIPS-140 workarounds for GNU TLS (Issue #5601, Issue #5622)
- The scheduler no longer provides a default value for the description
(Issue #5603)
- The `lpadmin` command did not always update the PPD file for changes to the
`cupsIPPSupplies` and `cupsSNMPSupplies` keywords (Issue #5610)
- The scheduler now uses both the group's membership list as well as the
various OS-specific membership functions to determine whether a user belongs
to a named group (Issue #5613)
- Added USB quirks rule for HP LaserJet 1015 (Issue #5617)
- Fixed some PPD parser issues (Issue #5623, Issue #5624)
- The IPP parser no longer allows invalid member attributes in collections
(Issue #5630)
- Fixed IPP buffer overflow (rdar://50035411)
- Fixed memory disclosure issue in the scheduler (rdar://51373853)
- Fixed DoS issues in the scheduler (rdar://51373929)
- The scheduler would restart continuously when idle and printers were not
shared (rdar://52561199)
- Fixed a command ordering issue in the Zebra ZPL driver.
- Fixed a memory leak in `ppdOpen`.
Changes in CUPS v2.2.11
-----------------------
@@ -41,7 +83,7 @@ Changes in CUPS v2.2.11
Changes in CUPS v2.2.10
-----------------------
- CVE-2018-4700: Linux session cookies used a predictable random number seed.
- CVE-2018-4300: Linux session cookies used a predictable random number seed.
- The `lpoptions` command now works with IPP Everywhere printers that have not
yet been added as local queues (Issue #5045)
- Added USB quirk rules (Issue #5395, Issue #5443)
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
INSTALL - CUPS v2.2.11 - 2019-03-22
INSTALL - CUPS v2.2.12 - 2019-08-15
===================================
This file describes how to compile and install CUPS from source code. For more
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
#
# Common makefile definitions for CUPS.
#
# Copyright 2007-2018 by Apple Inc.
# Copyright 2007-2019 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
@@ -29,7 +29,7 @@ CHMOD = @CHMOD@
CXX = @LIBTOOL_CXX@ @CXX@
DSO = @DSO@
DSOXX = @DSOXX@
GZIP = @GZIP@
GZIPPROG = @GZIPPROG@
INSTALL = @INSTALL@
LD = @LD@
LD_CC = @LD_CC@
+4 -3
Ver Arquivo
@@ -1,4 +1,4 @@
README - CUPS v2.2.11 - 2019-03-22
README - CUPS v2.2.12 - 2019-08-15
==================================
Looking for compile instructions? Read the file `INSTALL.md` instead...
@@ -22,8 +22,9 @@ included with CUPS to support many Dymo, EPSON, HP, Intellitech, OKIDATA, and
Zebra printers. Many more drivers are available online and (in some cases) on
the driver CD-ROM that came with your printer.
CUPS is licensed under the GNU General Public License and GNU Library General
Public License versions 2. See the file "LICENSE.txt" for more information.
CUPS 2.2.x is licensed under the GNU General Public License and GNU Library
General Public License versions 2. See the file "LICENSE.txt" for more
information.
READING THE DOCUMENTATION
+3
Ver Arquivo
@@ -242,6 +242,9 @@
# All Intermec devices (Issue #4553)
0x067e no-reattach
# HP LaserJet 1015 (Issue #5617)
0x03f0 0x0e17 delay-close
# HP LaserJet 1150 (Issue #4549)
0x03f0 0x0f17 delay-close
+2 -3
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* LIBUSB interface code for CUPS.
*
* Copyright 2007-2015 by Apple Inc.
* Copyright 2007-2019 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -1746,8 +1746,7 @@ static void *read_thread(void *reference)
* Make sure this loop executes no more than once every 250 miliseconds...
*/
if ((readstatus != LIBUSB_SUCCESS || rbytes == 0) &&
(g.wait_eof || !g.read_thread_stop))
if ((g.wait_eof || !g.read_thread_stop))
{
gettimeofday(&now, NULL);
if (timercmp(&now, &end, <))
+9
Ver Arquivo
@@ -3410,6 +3410,9 @@ do_set_options(http_t *http, /* I - HTTP connection */
switch (cparam->type)
{
case PPD_CUSTOM_UNKNOWN :
break;
case PPD_CUSTOM_POINTS :
if (!_cups_strncasecmp(option->defchoice, "Custom.", 7))
{
@@ -4009,6 +4012,9 @@ get_option_value(
switch (cparam->type)
{
case PPD_CUSTOM_UNKNOWN :
break;
case PPD_CUSTOM_CURVE :
case PPD_CUSTOM_INVCURVE :
case PPD_CUSTOM_REAL :
@@ -4087,6 +4093,9 @@ get_option_value(
switch (cparam->type)
{
case PPD_CUSTOM_UNKNOWN :
break;
case PPD_CUSTOM_CURVE :
case PPD_CUSTOM_INVCURVE :
case PPD_CUSTOM_REAL :
+10 -10
Ver Arquivo
@@ -1,7 +1,7 @@
dnl
dnl Common configuration stuff for CUPS.
dnl
dnl Copyright 2007-2017 by Apple Inc.
dnl Copyright 2007-2019 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
@@ -42,7 +42,11 @@ AC_PROG_CXX(clang++ c++ g++)
AC_PROG_RANLIB
AC_PATH_PROG(AR,ar)
AC_PATH_PROG(CHMOD,chmod)
AC_PATH_PROG(GZIP,gzip)
AC_PATH_PROG(GZIPPROG,gzip)
AC_MSG_CHECKING(for install-sh script)
INSTALL="`pwd`/install-sh"
AC_SUBST(INSTALL)
AC_MSG_RESULT(using $INSTALL)
AC_PATH_PROG(LD,ld)
AC_PATH_PROG(LN,ln)
AC_PATH_PROG(MKDIR,mkdir)
@@ -51,6 +55,7 @@ AC_PATH_PROG(RM,rm)
AC_PATH_PROG(RMDIR,rmdir)
AC_PATH_PROG(SED,sed)
AC_PATH_PROG(XDGOPEN,xdg-open)
if test "x$XDGOPEN" = x; then
CUPS_HTMLVIEW="htmlview"
else
@@ -58,11 +63,6 @@ else
fi
AC_SUBST(CUPS_HTMLVIEW)
AC_MSG_CHECKING(for install-sh script)
INSTALL="`pwd`/install-sh"
AC_SUBST(INSTALL)
AC_MSG_RESULT(using $INSTALL)
if test "x$AR" = x; then
AC_MSG_ERROR([Unable to find required library archive command.])
fi
@@ -266,14 +266,14 @@ dnl ZLIB
INSTALL_GZIP=""
LIBZ=""
AC_CHECK_HEADER(zlib.h,
AC_CHECK_LIB(z, gzgets,
AC_CHECK_LIB(z, gzgets,[
AC_DEFINE(HAVE_LIBZ)
LIBZ="-lz"
LIBS="$LIBS -lz"
AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_INFLATECOPY))
if test "x$GZIP" != z; then
if test "x$GZIPPROG" != x; then
INSTALL_GZIP="-z"
fi))
fi]))
AC_SUBST(INSTALL_GZIP)
AC_SUBST(LIBZ)
+1
Ver Arquivo
@@ -80,6 +80,7 @@ if test x$enable_ssl != xno; then
SAVELIBS="$LIBS"
LIBS="$LIBS $SSLLIBS"
AC_CHECK_FUNC(gnutls_fips140_set_mode, AC_DEFINE(HAVE_GNUTLS_FIPS140_SET_MODE))
AC_CHECK_FUNC(gnutls_transport_set_pull_timeout_function, AC_DEFINE(HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION))
AC_CHECK_FUNC(gnutls_priority_set_direct, AC_DEFINE(HAVE_GNUTLS_PRIORITY_SET_DIRECT))
LIBS="$SAVELIBS"
+7
Ver Arquivo
@@ -303,6 +303,13 @@
#undef HAVE_SSL
/*
* Do we have the gnutls_fips140_set_mode function?
*/
#undef HAVE_GNUTLS_FIPS140_SET_MODE
/*
* Do we have the gnutls_transport_set_pull_timeout_function function?
*/
externo
+36 -29
Ver Arquivo
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for CUPS 2.2.11.
# Generated by GNU Autoconf 2.69 for CUPS 2.2.12.
#
# Report bugs to <https://github.com/apple/cups/issues>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='CUPS'
PACKAGE_TARNAME='cups'
PACKAGE_VERSION='2.2.11'
PACKAGE_STRING='CUPS 2.2.11'
PACKAGE_VERSION='2.2.12'
PACKAGE_STRING='CUPS 2.2.12'
PACKAGE_BUGREPORT='https://github.com/apple/cups/issues'
PACKAGE_URL='https://www.cups.org/'
@@ -762,7 +762,6 @@ LIBPAPER
LIBMALLOC
PKGCONFIG
INSTALLSTATIC
INSTALL
CUPS_HTMLVIEW
XDGOPEN
SED
@@ -772,7 +771,8 @@ MV
MKDIR
LN
LD
GZIP
INSTALL
GZIPPROG
CHMOD
AR
RANLIB
@@ -1480,7 +1480,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures CUPS 2.2.11 to adapt to many kinds of systems.
\`configure' configures CUPS 2.2.12 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1545,7 +1545,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of CUPS 2.2.11:";;
short | recursive ) echo "Configuration of CUPS 2.2.12:";;
esac
cat <<\_ACEOF
@@ -1726,7 +1726,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
CUPS configure 2.2.11
CUPS configure 2.2.12
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2190,7 +2190,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by CUPS $as_me 2.2.11, which was
It was created by CUPS $as_me 2.2.12, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2711,7 +2711,7 @@ done
ac_config_headers="$ac_config_headers config.h"
CUPS_VERSION="2.2.11"
CUPS_VERSION="2.2.12"
CUPS_REVISION=""
CUPS_BUILD="cups-$CUPS_VERSION"
@@ -3948,12 +3948,12 @@ fi
set dummy gzip; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_GZIP+:} false; then :
if ${ac_cv_path_GZIPPROG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $GZIP in
case $GZIPPROG in
[\\/]* | ?:[\\/]*)
ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path.
ac_cv_path_GZIPPROG="$GZIPPROG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3963,7 +3963,7 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext"
ac_cv_path_GZIPPROG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -3974,16 +3974,22 @@ IFS=$as_save_IFS
;;
esac
fi
GZIP=$ac_cv_path_GZIP
if test -n "$GZIP"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5
$as_echo "$GZIP" >&6; }
GZIPPROG=$ac_cv_path_GZIPPROG
if test -n "$GZIPPROG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIPPROG" >&5
$as_echo "$GZIPPROG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for install-sh script" >&5
$as_echo_n "checking for install-sh script... " >&6; }
INSTALL="`pwd`/install-sh"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using $INSTALL" >&5
$as_echo "using $INSTALL" >&6; }
# Extract the first word of "ld", so it can be a program name with args.
set dummy ld; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -4304,6 +4310,7 @@ $as_echo "no" >&6; }
fi
if test "x$XDGOPEN" = x; then
CUPS_HTMLVIEW="htmlview"
else
@@ -4311,13 +4318,6 @@ else
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for install-sh script" >&5
$as_echo_n "checking for install-sh script... " >&6; }
INSTALL="`pwd`/install-sh"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using $INSTALL" >&5
$as_echo "using $INSTALL" >&6; }
if test "x$AR" = x; then
as_fn_error $? "Unable to find required library archive command." "$LINENO" 5
fi
@@ -5718,7 +5718,8 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzgets" >&5
$as_echo "$ac_cv_lib_z_gzgets" >&6; }
if test "x$ac_cv_lib_z_gzgets" = xyes; then :
$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
LIBZ="-lz"
LIBS="$LIBS -lz"
@@ -5763,7 +5764,7 @@ if test "x$ac_cv_lib_z_inflateCopy" = xyes; then :
fi
if test "x$GZIP" != z; then
if test "x$GZIPPROG" != x; then
INSTALL_GZIP="-z"
fi
fi
@@ -8479,6 +8480,12 @@ fi
SAVELIBS="$LIBS"
LIBS="$LIBS $SSLLIBS"
ac_fn_c_check_func "$LINENO" "gnutls_fips140_set_mode" "ac_cv_func_gnutls_fips140_set_mode"
if test "x$ac_cv_func_gnutls_fips140_set_mode" = xyes; then :
$as_echo "#define HAVE_GNUTLS_FIPS140_SET_MODE 1" >>confdefs.h
fi
ac_fn_c_check_func "$LINENO" "gnutls_transport_set_pull_timeout_function" "ac_cv_func_gnutls_transport_set_pull_timeout_function"
if test "x$ac_cv_func_gnutls_transport_set_pull_timeout_function" = xyes; then :
$as_echo "#define HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION 1" >>confdefs.h
@@ -10832,7 +10839,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by CUPS $as_me 2.2.11, which was
This file was extended by CUPS $as_me 2.2.12, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -10895,7 +10902,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
CUPS config.status 2.2.11
CUPS config.status 2.2.12
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
dnl
dnl Configuration script for CUPS.
dnl
dnl Copyright 2007-2018 by Apple Inc.
dnl Copyright 2007-2019 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
@@ -15,7 +15,7 @@ dnl We need at least autoconf 2.60...
AC_PREREQ(2.60)
dnl Package name and version...
AC_INIT([CUPS], [2.2.11], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
AC_INIT([CUPS], [2.2.12], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
sinclude(config-scripts/cups-opsys.m4)
sinclude(config-scripts/cups-common.m4)
+1 -2
Ver Arquivo
@@ -239,8 +239,7 @@ extern http_t *_cupsConnect(void);
extern char *_cupsCreateDest(const char *name, const char *info, const char *device_id, const char *device_uri, char *uri, size_t urisize);
extern int _cupsGet1284Values(const char *device_id,
cups_option_t **values);
extern const char *_cupsGetDestResource(cups_dest_t *dest, char *resource,
size_t resourcesize);
extern const char *_cupsGetDestResource(cups_dest_t *dest, unsigned flags, char *resource, size_t resourcesize);
extern int _cupsGetDests(http_t *http, ipp_op_t op,
const char *name, cups_dest_t **dests,
cups_ptype_t type, cups_ptype_t mask);
+2 -2
Ver Arquivo
@@ -47,10 +47,10 @@ extern "C" {
* Constants...
*/
# define CUPS_VERSION 2.0211
# define CUPS_VERSION 2.0212
# define CUPS_VERSION_MAJOR 2
# define CUPS_VERSION_MINOR 2
# define CUPS_VERSION_PATCH 11
# define CUPS_VERSION_PATCH 12
# define CUPS_BC_FD 3
/* Back-channel file descriptor for
+138 -73
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* Destination option/media support for CUPS.
*
* Copyright 2012-2017 by Apple Inc.
* Copyright 2012-2019 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -83,6 +83,7 @@ cupsCheckDestSupported(
ipp_res_t units_value; /* Resolution units */
ipp_attribute_t *attr; /* Attribute */
_ipp_value_t *attrval; /* Current attribute value */
_ipp_option_t *map; /* Option mapping information */
/*
@@ -128,10 +129,10 @@ cupsCheckDestSupported(
*/
pwg_media_t *pwg; /* Current PWG media size info */
int min_width, /* Minimum width */
min_length, /* Minimum length */
max_width, /* Maximum width */
max_length; /* Maximum length */
int min_width, /* Minimum width */
min_length, /* Minimum length */
max_width, /* Maximum width */
max_length; /* Maximum length */
/*
* Get the minimum and maximum size...
@@ -174,9 +175,14 @@ cupsCheckDestSupported(
* Check literal values...
*/
map = _ippFindOption(option);
switch (attr->value_tag)
{
case IPP_TAG_INTEGER :
if (map && map->value_tag == IPP_TAG_STRING)
return (strlen(value) <= (size_t)attr->values[0].integer);
case IPP_TAG_ENUM :
int_value = atoi(value);
@@ -189,7 +195,10 @@ cupsCheckDestSupported(
return (attr->values[0].boolean);
case IPP_TAG_RANGE :
int_value = atoi(value);
if (map && map->value_tag == IPP_TAG_STRING)
int_value = (int)strlen(value);
else
int_value = atoi(value);
for (i = 0; i < attr->num_values; i ++)
if (int_value >= attr->values[i].range.lower &&
@@ -572,6 +581,7 @@ cupsCopyDestInfo(
cups_dest_t *dest) /* I - Destination */
{
cups_dinfo_t *dinfo; /* Destination information */
unsigned dflags; /* Destination flags */
ipp_t *request, /* Get-Printer-Attributes request */
*response; /* Supported attributes */
int tries, /* Number of tries so far */
@@ -581,6 +591,7 @@ cupsCopyDestInfo(
char resource[1024]; /* Resource path */
int version; /* IPP version */
ipp_status_t status; /* Status of request */
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
static const char * const requested_attrs[] =
{ /* Requested attributes */
"job-template",
@@ -589,14 +600,35 @@ cupsCopyDestInfo(
};
DEBUG_printf(("cupsCopyDestSupported(http=%p, dest=%p(%s))", (void *)http, (void *)dest, dest ? dest->name : ""));
DEBUG_printf(("cupsCopyDestInfo(http=%p, dest=%p(%s))", (void *)http, (void *)dest, dest ? dest->name : ""));
/*
* Get the default connection as needed...
*/
if (!http)
http = _cupsConnect();
{
DEBUG_puts("1cupsCopyDestInfo: Default server connection.");
http = _cupsConnect();
dflags = CUPS_DEST_FLAGS_NONE;
}
#ifdef AF_LOCAL
else if (httpAddrFamily(http->hostaddr) == AF_LOCAL)
{
DEBUG_puts("1cupsCopyDestInfo: Connection to server (domain socket).");
dflags = CUPS_DEST_FLAGS_NONE;
}
#endif /* AF_LOCAL */
else if ((strcmp(http->hostname, cg->server) && cg->server[0] != '/') || cg->ipp_port != httpAddrPort(http->hostaddr))
{
DEBUG_printf(("1cupsCopyDestInfo: Connection to device (%s).", http->hostname));
dflags = CUPS_DEST_FLAGS_DEVICE;
}
else
{
DEBUG_printf(("1cupsCopyDestInfo: Connection to server (%s).", http->hostname));
dflags = CUPS_DEST_FLAGS_NONE;
}
/*
* Range check input...
@@ -609,8 +641,11 @@ cupsCopyDestInfo(
* Get the printer URI and resource path...
*/
if ((uri = _cupsGetDestResource(dest, resource, sizeof(resource))) == NULL)
if ((uri = _cupsGetDestResource(dest, dflags, resource, sizeof(resource))) == NULL)
{
DEBUG_puts("1cupsCopyDestInfo: Unable to get resource.");
return (NULL);
}
/*
* Get the supported attributes...
@@ -628,28 +663,25 @@ cupsCopyDestInfo(
*/
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL,
uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, cupsUser());
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes",
(int)(sizeof(requested_attrs) / sizeof(requested_attrs[0])),
NULL, requested_attrs);
ippSetVersion(request, version / 10, version % 10);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser());
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", (int)(sizeof(requested_attrs) / sizeof(requested_attrs[0])), NULL, requested_attrs);
response = cupsDoRequest(http, request, resource);
status = cupsLastError();
if (status > IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED)
{
DEBUG_printf(("cupsCopyDestSupported: Get-Printer-Attributes for '%s' "
"returned %s (%s)", dest->name, ippErrorString(status),
cupsLastErrorString()));
DEBUG_printf(("1cupsCopyDestInfo: Get-Printer-Attributes for '%s' returned %s (%s)", dest->name, ippErrorString(status), cupsLastErrorString()));
ippDelete(response);
response = NULL;
if (status == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED && version > 11)
if ((status == IPP_STATUS_ERROR_BAD_REQUEST || status == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED) && version > 11)
{
version = 11;
}
else if (status == IPP_STATUS_ERROR_BUSY)
{
sleep((unsigned)delay);
@@ -665,7 +697,10 @@ cupsCopyDestInfo(
while (!response && tries < 10);
if (!response)
{
DEBUG_puts("1cupsCopyDestInfo: Unable to get printer attributes.");
return (NULL);
}
/*
* Allocate a cups_dinfo_t structure and return it...
@@ -678,6 +713,8 @@ cupsCopyDestInfo(
return (NULL);
}
DEBUG_printf(("1cupsCopyDestInfo: version=%d, uri=\"%s\", resource=\"%s\".", version, uri, resource));
dinfo->version = version;
dinfo->uri = uri;
dinfo->resource = _cupsStrAlloc(resource);
@@ -938,10 +975,10 @@ cupsGetDestMediaByIndex(
return (0);
}
if (nsize->size_name)
strlcpy(size->media, nsize->size_name, sizeof(size->media));
else if (nsize->key)
if (nsize->key)
strlcpy(size->media, nsize->key, sizeof(size->media));
else if (nsize->size_name)
strlcpy(size->media, nsize->size_name, sizeof(size->media));
else if ((pwg = pwgMediaForSize(nsize->width, nsize->length)) != NULL)
strlcpy(size->media, pwg->pwg, sizeof(size->media));
else
@@ -1202,25 +1239,19 @@ cupsGetDestMediaDefault(
* Get the default media size, if any...
*/
if ((media = cupsGetOption("media", dest->num_options,
dest->options)) == NULL)
if ((media = cupsGetOption("media", dest->num_options, dest->options)) == NULL)
media = "na_letter_8.5x11in";
if (cupsGetDestMediaByName(http, dest, dinfo, media, flags, size))
return (1);
if (strcmp(media, "na_letter_8.5x11in") &&
cupsGetDestMediaByName(http, dest, dinfo, "iso_a4_210x297mm", flags,
size))
if (strcmp(media, "na_letter_8.5x11in") && cupsGetDestMediaByName(http, dest, dinfo, "iso_a4_210x297mm", flags, size))
return (1);
if (strcmp(media, "iso_a4_210x297mm") &&
cupsGetDestMediaByName(http, dest, dinfo, "na_letter_8.5x11in", flags,
size))
if (strcmp(media, "iso_a4_210x297mm") && cupsGetDestMediaByName(http, dest, dinfo, "na_letter_8.5x11in", flags, size))
return (1);
if ((flags & CUPS_MEDIA_FLAGS_BORDERLESS) &&
cupsGetDestMediaByName(http, dest, dinfo, "na_index_4x6in", flags, size))
if ((flags & CUPS_MEDIA_FLAGS_BORDERLESS) && cupsGetDestMediaByName(http, dest, dinfo, "na_index_4x6in", flags, size))
return (1);
/*
@@ -1513,6 +1544,7 @@ cups_create_media_db(
pwg_media_t *pwg; /* PWG media info */
cups_array_t *db; /* New media database array */
_cups_media_db_t mdb; /* Media entry */
char media_key[256]; /* Synthesized media-key value */
db = cupsArrayNew3((cups_array_func_t)cups_compare_media_db,
@@ -1613,61 +1645,92 @@ cups_create_media_db(
}
}
if ((media_attr = ippFindAttribute(val->collection, "media-color",
IPP_TAG_ZERO)) != NULL &&
(media_attr->value_tag == IPP_TAG_NAME ||
media_attr->value_tag == IPP_TAG_NAMELANG ||
media_attr->value_tag == IPP_TAG_KEYWORD))
if ((media_attr = ippFindAttribute(val->collection, "media-color", IPP_TAG_ZERO)) != NULL && (media_attr->value_tag == IPP_TAG_NAME || media_attr->value_tag == IPP_TAG_NAMELANG || media_attr->value_tag == IPP_TAG_KEYWORD))
mdb.color = media_attr->values[0].string.text;
if ((media_attr = ippFindAttribute(val->collection, "media-info",
IPP_TAG_TEXT)) != NULL)
if ((media_attr = ippFindAttribute(val->collection, "media-info", IPP_TAG_TEXT)) != NULL)
mdb.info = media_attr->values[0].string.text;
if ((media_attr = ippFindAttribute(val->collection, "media-key",
IPP_TAG_ZERO)) != NULL &&
(media_attr->value_tag == IPP_TAG_NAME ||
media_attr->value_tag == IPP_TAG_NAMELANG ||
media_attr->value_tag == IPP_TAG_KEYWORD))
if ((media_attr = ippFindAttribute(val->collection, "media-key", IPP_TAG_ZERO)) != NULL && (media_attr->value_tag == IPP_TAG_NAME || media_attr->value_tag == IPP_TAG_NAMELANG || media_attr->value_tag == IPP_TAG_KEYWORD))
mdb.key = media_attr->values[0].string.text;
if ((media_attr = ippFindAttribute(val->collection, "media-size-name",
IPP_TAG_ZERO)) != NULL &&
(media_attr->value_tag == IPP_TAG_NAME ||
media_attr->value_tag == IPP_TAG_NAMELANG ||
media_attr->value_tag == IPP_TAG_KEYWORD))
if ((media_attr = ippFindAttribute(val->collection, "media-size-name", IPP_TAG_ZERO)) != NULL && (media_attr->value_tag == IPP_TAG_NAME || media_attr->value_tag == IPP_TAG_NAMELANG || media_attr->value_tag == IPP_TAG_KEYWORD))
mdb.size_name = media_attr->values[0].string.text;
if ((media_attr = ippFindAttribute(val->collection, "media-source",
IPP_TAG_ZERO)) != NULL &&
(media_attr->value_tag == IPP_TAG_NAME ||
media_attr->value_tag == IPP_TAG_NAMELANG ||
media_attr->value_tag == IPP_TAG_KEYWORD))
if ((media_attr = ippFindAttribute(val->collection, "media-source", IPP_TAG_ZERO)) != NULL && (media_attr->value_tag == IPP_TAG_NAME || media_attr->value_tag == IPP_TAG_NAMELANG || media_attr->value_tag == IPP_TAG_KEYWORD))
mdb.source = media_attr->values[0].string.text;
if ((media_attr = ippFindAttribute(val->collection, "media-type",
IPP_TAG_ZERO)) != NULL &&
(media_attr->value_tag == IPP_TAG_NAME ||
media_attr->value_tag == IPP_TAG_NAMELANG ||
media_attr->value_tag == IPP_TAG_KEYWORD))
if ((media_attr = ippFindAttribute(val->collection, "media-type", IPP_TAG_ZERO)) != NULL && (media_attr->value_tag == IPP_TAG_NAME || media_attr->value_tag == IPP_TAG_NAMELANG || media_attr->value_tag == IPP_TAG_KEYWORD))
mdb.type = media_attr->values[0].string.text;
if ((media_attr = ippFindAttribute(val->collection, "media-bottom-margin",
IPP_TAG_INTEGER)) != NULL)
if ((media_attr = ippFindAttribute(val->collection, "media-bottom-margin", IPP_TAG_INTEGER)) != NULL)
mdb.bottom = media_attr->values[0].integer;
if ((media_attr = ippFindAttribute(val->collection, "media-left-margin",
IPP_TAG_INTEGER)) != NULL)
if ((media_attr = ippFindAttribute(val->collection, "media-left-margin", IPP_TAG_INTEGER)) != NULL)
mdb.left = media_attr->values[0].integer;
if ((media_attr = ippFindAttribute(val->collection, "media-right-margin",
IPP_TAG_INTEGER)) != NULL)
if ((media_attr = ippFindAttribute(val->collection, "media-right-margin", IPP_TAG_INTEGER)) != NULL)
mdb.right = media_attr->values[0].integer;
if ((media_attr = ippFindAttribute(val->collection, "media-top-margin",
IPP_TAG_INTEGER)) != NULL)
if ((media_attr = ippFindAttribute(val->collection, "media-top-margin", IPP_TAG_INTEGER)) != NULL)
mdb.top = media_attr->values[0].integer;
if (!mdb.key)
{
if (!mdb.size_name && (pwg = pwgMediaForSize(mdb.width, mdb.length)) != NULL)
mdb.size_name = (char *)pwg->pwg;
if (!mdb.size_name)
{
/*
* Use a CUPS-specific identifier if we don't have a size name...
*/
if (flags & CUPS_MEDIA_FLAGS_READY)
snprintf(media_key, sizeof(media_key), "cups-media-ready-%d", i + 1);
else
snprintf(media_key, sizeof(media_key), "cups-media-%d", i + 1);
}
else if (mdb.source)
{
/*
* Generate key using size name, source, and type (if set)...
*/
if (mdb.type)
snprintf(media_key, sizeof(media_key), "%s_%s_%s", mdb.size_name, mdb.source, mdb.type);
else
snprintf(media_key, sizeof(media_key), "%s_%s", mdb.size_name, mdb.source);
}
else if (mdb.type)
{
/*
* Generate key using size name and type...
*/
snprintf(media_key, sizeof(media_key), "%s_%s", mdb.size_name, mdb.type);
}
else
{
/*
* Key is just the size name...
*/
strlcpy(media_key, mdb.size_name, sizeof(media_key));
}
/*
* Append "_borderless" for borderless media...
*/
if (!mdb.bottom && !mdb.left && !mdb.right && !mdb.top)
strlcat(media_key, "_borderless", sizeof(media_key));
mdb.key = media_key;
}
DEBUG_printf(("1cups_create_media_db: Adding media: key=\"%s\", width=%d, length=%d, source=\"%s\", type=\"%s\".", mdb.key, mdb.width, mdb.length, mdb.source, mdb.type));
cupsArrayAdd(db, &mdb);
}
@@ -2027,12 +2090,14 @@ cups_get_media_db(http_t *http, /* I - Connection to destination */
* Return the matching size...
*/
if (best->size_name)
strlcpy(size->media, best->size_name, sizeof(size->media));
else if (best->key)
if (best->key)
strlcpy(size->media, best->key, sizeof(size->media));
else
else if (best->size_name)
strlcpy(size->media, best->size_name, sizeof(size->media));
else if (pwg && pwg->pwg)
strlcpy(size->media, pwg->pwg, sizeof(size->media));
else
strlcpy(size->media, "unknown", sizeof(size->media));
size->width = best->width;
size->length = best->length;
+236 -331
Ver Arquivo
@@ -79,7 +79,6 @@ typedef enum _cups_dnssd_state_e /* Enumerated device state */
_CUPS_DNSSD_QUERY,
_CUPS_DNSSD_PENDING,
_CUPS_DNSSD_ACTIVE,
_CUPS_DNSSD_LOCAL,
_CUPS_DNSSD_INCOMPATIBLE,
_CUPS_DNSSD_ERROR
} _cups_dnssd_state_t;
@@ -99,6 +98,10 @@ typedef struct _cups_dnssd_data_s /* Enumeration data */
cups_ptype_t type, /* Printer type filter */
mask; /* Printer type mask */
cups_array_t *devices; /* Devices found so far */
int num_dests; /* Number of lpoptions destinations */
cups_dest_t *dests; /* lpoptions destinations */
char def_name[1024], /* Default printer name, if any */
*def_instance; /* Default printer instance, if any */
} _cups_dnssd_data_t;
typedef struct _cups_dnssd_device_s /* Enumerated device */
@@ -125,8 +128,10 @@ typedef struct _cups_dnssd_resolve_s /* Data for resolving URI */
typedef struct _cups_getdata_s
{
int num_dests; /* Number of destinations */
cups_dest_t *dests; /* Destinations */
int num_dests; /* Number of destinations */
cups_dest_t *dests; /* Destinations */
char def_name[1024], /* Default printer name, if any */
*def_instance; /* Default printer instance, if any */
} _cups_getdata_t;
typedef struct _cups_namedata_s
@@ -192,14 +197,6 @@ static _cups_dnssd_device_t *
const char *regtype,
const char *replyDomain);
# ifdef HAVE_DNSSD
static void cups_dnssd_local_cb(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
DNSServiceErrorType errorCode,
const char *serviceName,
const char *regtype,
const char *replyDomain,
void *context);
static void cups_dnssd_query_cb(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
@@ -237,9 +234,7 @@ static int cups_find_dest(const char *name, const char *instance,
static int cups_get_cb(_cups_getdata_t *data, unsigned flags, cups_dest_t *dest);
static char *cups_get_default(const char *filename, char *namebuf,
size_t namesize, const char **instance);
static int cups_get_dests(const char *filename, const char *match_name,
const char *match_inst, int user_default_set,
int num_dests, cups_dest_t **dests);
static int cups_get_dests(const char *filename, const char *match_name, const char *match_inst, int load_all, int user_default_set, int num_dests, cups_dest_t **dests);
static char *cups_make_string(ipp_attribute_t *attr, char *buffer,
size_t bufsize);
static int cups_name_cb(_cups_namedata_t *data, unsigned flags, cups_dest_t *dest);
@@ -574,7 +569,7 @@ _cupsAppleSetUseLastPrinter(
/*
* 'cupsConnectDest()' - Open a conection to the destination.
* 'cupsConnectDest()' - Open a connection to the destination.
*
* Connect to the destination, returning a new @code http_t@ connection object
* and optionally the resource path to use for the destination. These calls
@@ -583,7 +578,7 @@ _cupsAppleSetUseLastPrinter(
* returns 0. The caller is responsible for calling @link httpClose@ on the
* returned connection.
*
* Starting with CUPS 2.2.4, the caller can pass @code CUPS_DEST_FLAGS_DEVICE@
* Starting with CUPS 2.2.4, the caller can pass @code CUPS_DEST_FLAGS_DEVICE@
* for the "flags" argument to connect directly to the device associated with
* the destination. Otherwise, the connection is made to the CUPS scheduler
* associated with the destination.
@@ -851,6 +846,8 @@ cupsCopyDest(cups_dest_t *dest, /* I - Destination to copy */
if (new_dest)
{
new_dest->is_default = dest->is_default;
if ((new_dest->options = calloc(sizeof(cups_option_t), (size_t)dest->num_options)) == NULL)
return (cupsRemoveDest(dest->name, dest->instance, num_dests, dests));
@@ -1103,20 +1100,23 @@ cupsGetDest(const char *name, /* I - Destination name or @code NULL@ for the d
* '_cupsGetDestResource()' - Get the resource path and URI for a destination.
*/
const char * /* O - Printer URI */
const char * /* O - URI */
_cupsGetDestResource(
cups_dest_t *dest, /* I - Destination */
unsigned flags, /* I - Destination flags */
char *resource, /* I - Resource buffer */
size_t resourcesize) /* I - Size of resource buffer */
{
const char *uri; /* Printer URI */
const char *uri, /* URI */
*device_uri, /* Device URI */
*printer_uri; /* Printer URI */
char scheme[32], /* URI scheme */
userpass[256], /* Username and password (unused) */
hostname[256]; /* Hostname */
int port; /* Port number */
DEBUG_printf(("_cupsGetDestResource(dest=%p(%s), resource=%p, resourcesize=%d)", (void *)dest, dest->name, (void *)resource, (int)resourcesize));
DEBUG_printf(("_cupsGetDestResource(dest=%p(%s), flags=%u, resource=%p, resourcesize=%d)", (void *)dest, dest->name, flags, (void *)resource, (int)resourcesize));
/*
* Range check input...
@@ -1132,25 +1132,46 @@ _cupsGetDestResource(
}
/*
* Grab the printer URI...
* Grab the printer and device URIs...
*/
if ((uri = cupsGetOption("printer-uri-supported", dest->num_options, dest->options)) == NULL)
{
if ((uri = cupsGetOption("device-uri", dest->num_options, dest->options)) != NULL)
{
device_uri = cupsGetOption("device-uri", dest->num_options, dest->options);
printer_uri = cupsGetOption("printer-uri-supported", dest->num_options, dest->options);
DEBUG_printf(("1_cupsGetDestResource: device-uri=\"%s\", printer-uri-supported=\"%s\".", device_uri, printer_uri));
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
if (strstr(uri, "._tcp"))
uri = cups_dnssd_resolve(dest, uri, 5000, NULL, NULL, NULL);
#endif /* HAVE_DNSSD || HAVE_AVAHI */
}
if (uri)
if (((flags & CUPS_DEST_FLAGS_DEVICE) || !printer_uri) && strstr(device_uri, "._tcp"))
{
if ((device_uri = cups_dnssd_resolve(dest, device_uri, 5000, NULL, NULL, NULL)) != NULL)
{
DEBUG_printf(("1_cupsGetDestResource: Resolved printer-uri-supported=\"%s\"", uri));
uri = _cupsCreateDest(dest->name, cupsGetOption("printer-info", dest->num_options, dest->options), NULL, uri, resource, resourcesize);
DEBUG_printf(("1_cupsGetDestResource: Resolved device-uri=\"%s\".", device_uri));
}
else
{
DEBUG_puts("1_cupsGetDestResource: Unable to resolve device.");
if (resource)
*resource = '\0';
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOENT), 0);
return (NULL);
}
}
#endif /* HAVE_DNSSD || HAVE_AVAHI */
if (flags & CUPS_DEST_FLAGS_DEVICE)
{
uri = device_uri;
}
else if (printer_uri)
{
uri = printer_uri;
}
else
{
uri = _cupsCreateDest(dest->name, cupsGetOption("printer-info", dest->num_options, dest->options), NULL, device_uri, resource, resourcesize);
if (uri)
{
@@ -1160,30 +1181,24 @@ _cupsGetDestResource(
uri = cupsGetOption("printer-uri-supported", dest->num_options, dest->options);
}
else
{
DEBUG_puts("1_cupsGetDestResource: No printer-uri-supported found.");
if (resource)
*resource = '\0';
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOENT), 0);
return (NULL);
}
}
else
if (!uri)
{
DEBUG_printf(("1_cupsGetDestResource: printer-uri-supported=\"%s\"", uri));
DEBUG_puts("1_cupsGetDestResource: No printer-uri-supported or device-uri found.");
if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme),
userpass, sizeof(userpass), hostname, sizeof(hostname),
&port, resource, (int)resourcesize) < HTTP_URI_STATUS_OK)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad printer-uri."), 1);
if (resource)
*resource = '\0';
return (NULL);
}
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOENT), 0);
return (NULL);
}
else if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme), userpass, sizeof(userpass), hostname, sizeof(hostname), &port, resource, (int)resourcesize) < HTTP_URI_STATUS_OK)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad URI."), 1);
return (NULL);
}
DEBUG_printf(("1_cupsGetDestResource: resource=\"%s\"", resource));
@@ -1271,6 +1286,12 @@ cupsGetDestWithURI(const char *name, /* I - Desired printer name or @code NULL@
name = resource + 10;
info = temp;
}
else if (!strncmp(resource, "/ipp/print/", 11))
{
snprintf(temp, sizeof(temp), "%s @ %s", resource + 11, hostname);
name = resource + 11;
info = temp;
}
else
{
name = hostname;
@@ -1631,16 +1652,6 @@ cupsGetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
cups_dest_t **dests) /* O - Destinations */
{
_cups_getdata_t data; /* Enumeration data */
cups_dest_t *dest; /* Current destination */
const char *home; /* HOME environment variable */
char filename[1024]; /* Local ~/.cups/lpoptions file */
const char *defprinter; /* Default printer */
char name[1024], /* Copy of printer name */
*instance, /* Pointer to instance name */
*user_default; /* User default printer */
int num_reals; /* Number of real queues */
cups_dest_t *reals; /* Real queues */
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
DEBUG_printf(("cupsGetDests2(http=%p, dests=%p)", (void *)http, (void *)dests));
@@ -1696,107 +1707,6 @@ cupsGetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
cups_enum_dests(http, 0, _CUPS_DNSSD_GET_DESTS, NULL, 0, 0, (cups_dest_cb_t)cups_get_cb, &data);
}
/*
* Make a copy of the "real" queues for a later sanity check...
*/
if (data.num_dests > 0)
{
num_reals = data.num_dests;
reals = calloc((size_t)num_reals, sizeof(cups_dest_t));
if (reals)
memcpy(reals, data.dests, (size_t)num_reals * sizeof(cups_dest_t));
else
num_reals = 0;
}
else
{
num_reals = 0;
reals = NULL;
}
/*
* Grab the default destination...
*/
if ((user_default = _cupsUserDefault(name, sizeof(name))) != NULL)
defprinter = name;
else if ((defprinter = cupsGetDefault2(http)) != NULL)
{
strlcpy(name, defprinter, sizeof(name));
defprinter = name;
}
if (defprinter)
{
/*
* Separate printer and instance name...
*/
if ((instance = strchr(name, '/')) != NULL)
*instance++ = '\0';
/*
* Lookup the printer and instance and make it the default...
*/
if ((dest = cupsGetDest(name, instance, data.num_dests, data.dests)) != NULL)
dest->is_default = 1;
}
else
instance = NULL;
/*
* Load the /etc/cups/lpoptions and ~/.cups/lpoptions files...
*/
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
data.num_dests = cups_get_dests(filename, NULL, NULL, user_default != NULL, data.num_dests, &data.dests);
if ((home = getenv("HOME")) != NULL)
{
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
data.num_dests = cups_get_dests(filename, NULL, NULL, user_default != NULL, data.num_dests, &data.dests);
}
/*
* Validate the current default destination - this prevents old
* Default lines in /etc/cups/lpoptions and ~/.cups/lpoptions from
* pointing to a non-existent printer or class...
*/
if (num_reals)
{
/*
* See if we have a default printer...
*/
if ((dest = cupsGetDest(NULL, NULL, data.num_dests, data.dests)) != NULL)
{
/*
* Have a default; see if it is real...
*/
if (!cupsGetDest(dest->name, NULL, num_reals, reals))
{
/*
* Remove the non-real printer from the list, since we don't want jobs
* going to an unexpected printer... (<rdar://problem/14216472>)
*/
data.num_dests = cupsRemoveDest(dest->name, dest->instance, data.num_dests, &data.dests);
}
}
/*
* Free memory...
*/
free(reals);
}
/*
* Return the number of destinations...
*/
@@ -1883,6 +1793,9 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
dest_name = cups_get_default(filename, defname, sizeof(defname), &instance);
if (dest_name)
set_as_default = 2;
}
if (!dest_name)
@@ -1893,6 +1806,9 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
dest_name = cups_get_default(filename, defname, sizeof(defname), &instance);
if (dest_name)
set_as_default = 3;
}
if (!dest_name)
@@ -1901,7 +1817,8 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
* No locally-set default destination, ask the server...
*/
op = IPP_OP_CUPS_GET_DEFAULT;
op = IPP_OP_CUPS_GET_DEFAULT;
set_as_default = 4;
DEBUG_puts("1cupsGetNamedDest: Asking server for default printer...");
}
@@ -1932,7 +1849,36 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
dest = data.dest;
}
else
{
switch (set_as_default)
{
default :
break;
case 1 : /* Set from env vars */
if (getenv("LPDEST"))
_cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, _("LPDEST environment variable names default destination that does not exist."), 1);
else if (getenv("PRINTER"))
_cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, _("PRINTER environment variable names default destination that does not exist."), 1);
else
_cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, _("No default destination."), 1);
break;
case 2 : /* Set from ~/.cups/lpoptions */
_cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, _("~/.cups/lpoptions file names default destination that does not exist."), 1);
break;
case 3 : /* Set from /etc/cups/lpoptions */
_cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, _("/etc/cups/lpoptions file names default destination that does not exist."), 1);
break;
case 4 : /* Set from server */
_cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, _("No default destination."), 1);
break;
}
return (NULL);
}
}
DEBUG_printf(("1cupsGetNamedDest: Got dest=%p", (void *)dest));
@@ -1948,13 +1894,13 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
*/
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
cups_get_dests(filename, dest_name, instance, 1, 1, &dest);
cups_get_dests(filename, dest_name, instance, 0, 1, 1, &dest);
if (home)
{
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
cups_get_dests(filename, dest_name, instance, 1, 1, &dest);
cups_get_dests(filename, dest_name, instance, 0, 1, 1, &dest);
}
/*
@@ -2129,12 +2075,6 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
#ifndef _WIN32
if (getuid())
{
/*
* Merge in server defaults...
*/
num_temps = cups_get_dests(filename, NULL, NULL, 0, num_temps, &temps);
/*
* Point to user defaults...
*/
@@ -2195,8 +2135,7 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
else
wrote = 0;
if ((temp = cupsGetDest(dest->name, dest->instance, num_temps, temps)) == NULL)
temp = cupsGetDest(dest->name, NULL, num_temps, temps);
temp = cupsGetDest(dest->name, NULL, num_temps, temps);
for (j = dest->num_options, option = dest->options; j > 0; j --, option ++)
{
@@ -2204,19 +2143,14 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
* See if this option is a printer attribute; if so, skip it...
*/
if ((match = _ippFindOption(option->name)) != NULL &&
match->group_tag == IPP_TAG_PRINTER)
if ((match = _ippFindOption(option->name)) != NULL && match->group_tag == IPP_TAG_PRINTER)
continue;
/*
* See if the server/global options match these; if so, don't
* write 'em.
* See if the server options match these; if so, don't write 'em.
*/
if (temp &&
(val = cupsGetOption(option->name, temp->num_options,
temp->options)) != NULL &&
!_cups_strcasecmp(val, option->value))
if (temp && (val = cupsGetOption(option->name, temp->num_options, temp->options)) != NULL && !_cups_strcasecmp(val, option->value))
continue;
/*
@@ -2233,10 +2167,7 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
if (option->value[0])
{
if (strchr(option->value, ' ') ||
strchr(option->value, '\\') ||
strchr(option->value, '\"') ||
strchr(option->value, '\''))
if (strchr(option->value, ' ') || strchr(option->value, '\\') || strchr(option->value, '\"') || strchr(option->value, '\''))
{
/*
* Quote the value...
@@ -2287,9 +2218,7 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
if ((dest = cupsGetDest(NULL, NULL, num_dests, dests)) != NULL)
{
CFStringRef name = CFStringCreateWithCString(kCFAllocatorDefault,
dest->name,
kCFStringEncodingUTF8);
CFStringRef name = CFStringCreateWithCString(kCFAllocatorDefault, dest->name, kCFStringEncodingUTF8);
/* Default printer name */
if (name)
@@ -2720,22 +2649,7 @@ cups_dnssd_browse_cb(
* This object is new on the network.
*/
if (flags & AVAHI_LOOKUP_RESULT_LOCAL)
{
/*
* This comes from the local machine so ignore it.
*/
DEBUG_printf(("cups_dnssd_browse_cb: Ignoring local service \"%s\".", name));
}
else
{
/*
* Create a device entry for it if it doesn't yet exist.
*/
cups_dnssd_get_device(data, name, type, domain);
}
cups_dnssd_get_device(data, name, type, domain);
break;
case AVAHI_BROWSER_REMOVE :
@@ -2956,66 +2870,6 @@ cups_dnssd_get_device(
}
# ifdef HAVE_DNSSD
/*
* 'cups_dnssd_local_cb()' - Browse for local printers.
*/
static void
cups_dnssd_local_cb(
DNSServiceRef sdRef, /* I - Service reference */
DNSServiceFlags flags, /* I - Option flags */
uint32_t interfaceIndex, /* I - Interface number */
DNSServiceErrorType errorCode, /* I - Error, if any */
const char *serviceName, /* I - Name of service/device */
const char *regtype, /* I - Type of service */
const char *replyDomain, /* I - Service domain */
void *context) /* I - Devices array */
{
_cups_dnssd_data_t *data = (_cups_dnssd_data_t *)context;
/* Enumeration data */
_cups_dnssd_device_t *device; /* Device */
DEBUG_printf(("5cups_dnssd_local_cb(sdRef=%p, flags=%x, interfaceIndex=%d, errorCode=%d, serviceName=\"%s\", regtype=\"%s\", replyDomain=\"%s\", context=%p)", (void *)sdRef, flags, interfaceIndex, errorCode, serviceName, regtype, replyDomain, context));
/*
* Only process "add" data...
*/
if (errorCode != kDNSServiceErr_NoError || !(flags & kDNSServiceFlagsAdd))
return;
/*
* Get the device...
*/
device = cups_dnssd_get_device(data, serviceName, regtype, replyDomain);
/*
* Hide locally-registered devices...
*/
DEBUG_printf(("6cups_dnssd_local_cb: Hiding local printer '%s'.",
serviceName));
if (device->ref)
{
DNSServiceRefDeallocate(device->ref);
device->ref = 0;
}
if (device->state == _CUPS_DNSSD_ACTIVE)
{
DEBUG_printf(("6cups_dnssd_local_cb: Remove callback for \"%s\".", device->dest.name));
(*data->cb)(data->user_data, CUPS_DEST_FLAGS_REMOVED, &device->dest);
}
device->state = _CUPS_DNSSD_LOCAL;
}
# endif /* HAVE_DNSSD */
# ifdef HAVE_AVAHI
/*
* 'cups_dnssd_poll_cb()' - Wait for input on the specified file descriptors.
@@ -3065,9 +2919,9 @@ cups_dnssd_poll_cb(
* 'cups_dnssd_query_cb()' - Process query data.
*/
# ifdef HAVE_DNSSD
static void
cups_dnssd_query_cb(
# ifdef HAVE_DNSSD
DNSServiceRef sdRef, /* I - Service reference */
DNSServiceFlags flags, /* I - Data flags */
uint32_t interfaceIndex, /* I - Interface */
@@ -3078,11 +2932,7 @@ cups_dnssd_query_cb(
uint16_t rdlen, /* I - Length of record data */
const void *rdata, /* I - Record data */
uint32_t ttl, /* I - Time-to-live */
void *context) /* I - Enumeration data */
{
# else /* HAVE_AVAHI */
static void
cups_dnssd_query_cb(
AvahiRecordBrowser *browser, /* I - Record browser */
AvahiIfIndex interfaceIndex,
/* I - Interface index (unused) */
@@ -3094,13 +2944,13 @@ cups_dnssd_query_cb(
const void *rdata, /* I - TXT record */
size_t rdlen, /* I - Length of TXT record */
AvahiLookupResultFlags flags, /* I - Flags */
void *context) /* I - Enumeration data */
# endif /* HAVE_DNSSD */
void *context) /* I - Enumeration data */
{
# ifdef DEBUG
# if defined(DEBUG) && defined(HAVE_AVAHI)
AvahiClient *client = avahi_record_browser_get_client(browser);
/* Client information */
# endif /* DEBUG */
# endif /* HAVE_DNSSD */
# endif /* DEBUG && HAVE_AVAHI */
_cups_dnssd_data_t *data = (_cups_dnssd_data_t *)context;
/* Enumeration data */
char serviceName[256],/* Service name */
@@ -3543,29 +3393,26 @@ cups_enum_dests(
cups_dest_cb_t cb, /* I - Callback function */
void *user_data) /* I - User data */
{
int i, /* Looping var */
int i, j, /* Looping vars */
num_dests; /* Number of destinations */
cups_dest_t *dests = NULL, /* Destinations */
*dest; /* Current destination */
const char *defprinter; /* Default printer */
char name[1024], /* Copy of printer name */
*instance, /* Pointer to instance name */
*user_default; /* User default printer */
*dest, /* Current destination */
*user_dest; /* User destination */
cups_option_t *option; /* Current option */
char *user_default; /* User default printer */
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
int count, /* Number of queries started */
completed, /* Number of completed queries */
remaining; /* Remainder of timeout */
struct timeval curtime; /* Current time */
_cups_dnssd_data_t data; /* Data for callback */
_cups_dnssd_data_t data; /* Data for callback */
_cups_dnssd_device_t *device; /* Current device */
# ifdef HAVE_DNSSD
int nfds, /* Number of files responded */
main_fd; /* File descriptor for lookups */
DNSServiceRef ipp_ref = NULL, /* IPP browser */
local_ipp_ref = NULL; /* Local IPP browser */
DNSServiceRef ipp_ref = NULL; /* IPP browser */
# ifdef HAVE_SSL
DNSServiceRef ipps_ref = NULL, /* IPPS browser */
local_ipps_ref = NULL; /* Local IPPS browser */
DNSServiceRef ipps_ref = NULL; /* IPPS browser */
# endif /* HAVE_SSL */
# ifdef HAVE_POLL
struct pollfd pfd; /* Polling data */
@@ -3580,7 +3427,12 @@ cups_enum_dests(
AvahiServiceBrowser *ipps_ref = NULL; /* IPPS browser */
# endif /* HAVE_SSL */
# endif /* HAVE_DNSSD */
#else
_cups_getdata_t data; /* Data for callback */
#endif /* HAVE_DNSSD || HAVE_AVAHI */
const char *home; /* HOME environment variable */
char filename[1024]; /* Local lpoptions file */
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
DEBUG_printf(("cups_enum_dests(flags=%x, msec=%d, cancel=%p, type=%x, mask=%x, cb=%p, user_data=%p)", flags, msec, (void *)cancel, type, mask, (void *)cb, (void *)user_data));
@@ -3597,13 +3449,48 @@ cups_enum_dests(
return (0);
}
/*
* Load the /etc/cups/lpoptions and ~/.cups/lpoptions files...
*/
memset(&data, 0, sizeof(data));
if ((user_default = _cupsUserDefault(data.def_name, sizeof(data.def_name))) == NULL)
{
const char *defprinter = cupsGetDefault2(http);
/* Server default, if any */
if (defprinter)
strlcpy(data.def_name, defprinter, sizeof(data.def_name));
}
if (data.def_name[0])
{
/*
* Separate printer and instance name...
*/
if ((data.def_instance = strchr(data.def_name, '/')) != NULL)
*data.def_instance++ = '\0';
}
DEBUG_printf(("1cups_enum_dests: def_name=\"%s\", def_instance=\"%s\"", data.def_name, data.def_instance));
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
if ((home = getenv("HOME")) != NULL)
{
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
}
/*
* Get ready to enumerate...
*/
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
memset(&data, 0, sizeof(data));
data.type = type;
data.mask = mask;
data.cb = cb;
@@ -3619,29 +3506,17 @@ cups_enum_dests(
num_dests = _cupsGetDests(http, IPP_OP_CUPS_GET_PRINTERS, NULL, &dests, type, mask);
if ((user_default = _cupsUserDefault(name, sizeof(name))) != NULL)
defprinter = name;
else if ((defprinter = cupsGetDefault2(http)) != NULL)
{
strlcpy(name, defprinter, sizeof(name));
defprinter = name;
}
if (defprinter)
if (data.def_name[0])
{
/*
* Separate printer and instance name...
* Lookup the named default printer and instance and make it the default...
*/
if ((instance = strchr(name, '/')) != NULL)
*instance++ = '\0';
/*
* Lookup the printer and instance and make it the default...
*/
if ((dest = cupsGetDest(name, instance, num_dests, dests)) != NULL)
if ((dest = cupsGetDest(data.def_name, data.def_instance, num_dests, dests)) != NULL)
{
DEBUG_printf(("1cups_enum_dests: Setting is_default on \"%s/%s\".", dest->name, dest->instance));
dest->is_default = 1;
}
}
for (i = num_dests, dest = dests;
@@ -3652,6 +3527,16 @@ cups_enum_dests(
const char *device_uri; /* Device URI */
#endif /* HAVE_DNSSD || HAVE_AVAHI */
if ((user_dest = cupsGetDest(dest->name, dest->instance, data.num_dests, data.dests)) != NULL)
{
/*
* Apply user defaults to this destination...
*/
for (j = user_dest->num_options, option = user_dest->options; j > 0; j --, option ++)
dest->num_options = cupsAddOption(option->name, option->value, dest->num_options, &dest->options);
}
if (!(*cb)(user_data, i > 1 ? CUPS_DEST_FLAGS_MORE : CUPS_DEST_FLAGS_NONE, dest))
break;
@@ -3714,6 +3599,9 @@ cups_enum_dests(
if (DNSServiceCreateConnection(&data.main_ref) != kDNSServiceErr_NoError)
{
DEBUG_puts("1cups_enum_dests: Unable to create service browser, returning 0.");
cupsFreeDests(data.num_dests, data.dests);
return (0);
}
@@ -3724,14 +3612,9 @@ cups_enum_dests(
{
DEBUG_puts("1cups_enum_dests: Unable to create IPP browser, returning 0.");
DNSServiceRefDeallocate(data.main_ref);
return (0);
}
local_ipp_ref = data.main_ref;
if (DNSServiceBrowse(&local_ipp_ref, kDNSServiceFlagsShareConnection, kDNSServiceInterfaceIndexLocalOnly, "_ipp._tcp", NULL, (DNSServiceBrowseReply)cups_dnssd_local_cb, &data) != kDNSServiceErr_NoError)
{
DEBUG_puts("1cups_enum_dests: Unable to create local IPP browser, returning 0.");
DNSServiceRefDeallocate(data.main_ref);
cupsFreeDests(data.num_dests, data.dests);
return (0);
}
@@ -3741,14 +3624,9 @@ cups_enum_dests(
{
DEBUG_puts("1cups_enum_dests: Unable to create IPPS browser, returning 0.");
DNSServiceRefDeallocate(data.main_ref);
return (0);
}
local_ipps_ref = data.main_ref;
if (DNSServiceBrowse(&local_ipps_ref, kDNSServiceFlagsShareConnection, kDNSServiceInterfaceIndexLocalOnly, "_ipps._tcp", NULL, (DNSServiceBrowseReply)cups_dnssd_local_cb, &data) != kDNSServiceErr_NoError)
{
DEBUG_puts("1cups_enum_dests: Unable to create local IPPS browser, returning 0.");
DNSServiceRefDeallocate(data.main_ref);
cupsFreeDests(data.num_dests, data.dests);
return (0);
}
# endif /* HAVE_SSL */
@@ -3757,6 +3635,9 @@ cups_enum_dests(
if ((data.simple_poll = avahi_simple_poll_new()) == NULL)
{
DEBUG_puts("1cups_enum_dests: Unable to create Avahi poll, returning 0.");
cupsFreeDests(data.num_dests, data.dests);
return (0);
}
@@ -3769,6 +3650,9 @@ cups_enum_dests(
{
DEBUG_puts("1cups_enum_dests: Unable to create Avahi client, returning 0.");
avahi_simple_poll_free(data.simple_poll);
cupsFreeDests(data.num_dests, data.dests);
return (0);
}
@@ -3779,6 +3663,9 @@ cups_enum_dests(
avahi_client_free(data.client);
avahi_simple_poll_free(data.simple_poll);
cupsFreeDests(data.num_dests, data.dests);
return (0);
}
@@ -3791,6 +3678,9 @@ cups_enum_dests(
avahi_service_browser_free(ipp_ref);
avahi_client_free(data.client);
avahi_simple_poll_free(data.simple_poll);
cupsFreeDests(data.num_dests, data.dests);
return (0);
}
# endif /* HAVE_SSL */
@@ -3903,8 +3793,26 @@ cups_enum_dests(
if ((device->type & mask) == type)
{
dest = &device->dest;
if ((user_dest = cupsGetDest(dest->name, dest->instance, data.num_dests, data.dests)) != NULL)
{
/*
* Apply user defaults to this destination...
*/
for (j = user_dest->num_options, option = user_dest->options; j > 0; j --, option ++)
dest->num_options = cupsAddOption(option->name, option->value, dest->num_options, &dest->options);
}
if (!strcasecmp(dest->name, data.def_name) && !data.def_instance)
{
DEBUG_printf(("1cups_enum_dests: Setting is_default on discovered \"%s\".", dest->name));
dest->is_default = 1;
}
DEBUG_printf(("1cups_enum_dests: Add callback for \"%s\".", device->dest.name));
if (!(*cb)(user_data, CUPS_DEST_FLAGS_NONE, &device->dest))
if (!(*cb)(user_data, CUPS_DEST_FLAGS_NONE, dest))
{
remaining = -1;
break;
@@ -3935,20 +3843,18 @@ cups_enum_dests(
enum_finished:
cupsFreeDests(data.num_dests, data.dests);
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
cupsArrayDelete(data.devices);
# ifdef HAVE_DNSSD
if (ipp_ref)
DNSServiceRefDeallocate(ipp_ref);
if (local_ipp_ref)
DNSServiceRefDeallocate(local_ipp_ref);
# ifdef HAVE_SSL
if (ipps_ref)
DNSServiceRefDeallocate(ipps_ref);
if (local_ipps_ref)
DNSServiceRefDeallocate(local_ipps_ref);
# endif /* HAVE_SSL */
if (data.main_ref)
@@ -4166,6 +4072,7 @@ cups_get_dests(
const char *filename, /* I - File to read from */
const char *match_name, /* I - Destination name we want */
const char *match_inst, /* I - Instance name we want */
int load_all, /* I - Load all saved destinations? */
int user_default_set, /* I - User default printer set? */
int num_dests, /* I - Number of destinations */
cups_dest_t **dests) /* IO - Destinations */
@@ -4180,7 +4087,7 @@ cups_get_dests(
int linenum; /* Current line number */
DEBUG_printf(("7cups_get_dests(filename=\"%s\", match_name=\"%s\", match_inst=\"%s\", user_default_set=%d, num_dests=%d, dests=%p)", filename, match_name, match_inst, user_default_set, num_dests, (void *)dests));
DEBUG_printf(("7cups_get_dests(filename=\"%s\", match_name=\"%s\", match_inst=\"%s\", load_all=%d, user_default_set=%d, num_dests=%d, dests=%p)", filename, match_name, match_inst, load_all, user_default_set, num_dests, (void *)dests));
/*
* Try to open the file...
@@ -4248,8 +4155,7 @@ cups_get_dests(
instance));
/*
* See if the primary instance of the destination exists; if not,
* ignore this entry and move on...
* Match and/or ignore missing destinations...
*/
if (match_name)
@@ -4262,7 +4168,7 @@ cups_get_dests(
dest = *dests;
}
else if (cupsGetDest(name, NULL, num_dests, *dests) == NULL)
else if (!load_all && cupsGetDest(name, NULL, num_dests, *dests) == NULL)
{
DEBUG_puts("9cups_get_dests: Not found!");
continue;
@@ -4290,8 +4196,7 @@ cups_get_dests(
* Add options until we hit the end of the line...
*/
dest->num_options = cupsParseOptions(lineptr, dest->num_options,
&(dest->options));
dest->num_options = cupsParseOptions(lineptr, dest->num_options, &(dest->options));
/*
* If we found what we were looking for, stop now...
+23
Ver Arquivo
@@ -190,6 +190,13 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
unsigned char temp[64]; /* Temporary hash buffer */
size_t tempsize = 0; /* Truncate to this size? */
# ifdef HAVE_GNUTLS_FIPS140_SET_MODE
unsigned oldmode = gnutls_fips140_mode_enabled();
gnutls_fips140_set_mode(GNUTLS_FIPS140_LAX, GNUTLS_FIPS140_SET_MODE_THREAD);
# endif /* HAVE_GNUTLS_FIPS140_SET_MODE */
if (!strcmp(algorithm, "md5"))
alg = GNUTLS_DIG_MD5;
else if (!strcmp(algorithm, "sha"))
@@ -227,6 +234,10 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
gnutls_hash_fast(alg, data, datalen, temp);
memcpy(hash, temp, tempsize);
# ifdef HAVE_GNUTLS_FIPS140_SET_MODE
gnutls_fips140_set_mode(oldmode, GNUTLS_FIPS140_SET_MODE_THREAD);
# endif /* HAVE_GNUTLS_FIPS140_SET_MODE */
return ((ssize_t)tempsize);
}
@@ -235,9 +246,17 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
gnutls_hash_fast(alg, data, datalen, hash);
# ifdef HAVE_GNUTLS_FIPS140_SET_MODE
gnutls_fips140_set_mode(oldmode, GNUTLS_FIPS140_SET_MODE_THREAD);
# endif /* HAVE_GNUTLS_FIPS140_SET_MODE */
return ((ssize_t)gnutls_hash_get_len(alg));
}
# ifdef HAVE_GNUTLS_FIPS140_SET_MODE
gnutls_fips140_set_mode(oldmode, GNUTLS_FIPS140_SET_MODE_THREAD);
# endif /* HAVE_GNUTLS_FIPS140_SET_MODE */
#else
/*
* No hash support beyond MD5 without CommonCrypto or GNU TLS...
@@ -271,6 +290,10 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
too_small:
#ifdef HAVE_GNUTLS_FIPS140_SET_MODE
gnutls_fips140_set_mode(oldmode, GNUTLS_FIPS140_SET_MODE_THREAD);
#endif /* HAVE_GNUTLS_FIPS140_SET_MODE */
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Hash buffer too small."), 1);
return (-1);
}
+7 -2
Ver Arquivo
@@ -1905,7 +1905,7 @@ httpPrintf(http_t *http, /* I - HTTP connection */
...) /* I - Additional args as needed */
{
ssize_t bytes; /* Number of bytes to write */
char buf[16384]; /* Buffer for formatted string */
char buf[65536]; /* Buffer for formatted string */
va_list ap; /* Variable argument pointer */
@@ -1917,7 +1917,12 @@ httpPrintf(http_t *http, /* I - HTTP connection */
DEBUG_printf(("3httpPrintf: (" CUPS_LLFMT " bytes) %s", CUPS_LLCAST bytes, buf));
if (http->data_encoding == HTTP_ENCODING_FIELDS)
if (bytes > (ssize_t)(sizeof(buf) - 1))
{
http->error = ENOMEM;
return (-1);
}
else if (http->data_encoding == HTTP_ENCODING_FIELDS)
return ((int)httpWrite2(http, buf, (size_t)bytes));
else
{
+9 -9
Ver Arquivo
@@ -3044,8 +3044,13 @@ ippReadIO(void *src, /* I - Data source */
DEBUG_printf(("2ippReadIO: name length=%d", n));
if (n == 0 && tag != IPP_TAG_MEMBERNAME &&
tag != IPP_TAG_END_COLLECTION)
if (n && parent)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Invalid named IPP attribute in collection."), 1);
DEBUG_puts("1ippReadIO: bad attribute name in collection.");
return (IPP_STATE_ERROR);
}
else if (n == 0 && tag != IPP_TAG_MEMBERNAME && tag != IPP_TAG_END_COLLECTION)
{
/*
* More values for current attribute...
@@ -4548,9 +4553,7 @@ ippSetValueTag(
break;
case IPP_TAG_NAME :
if (temp_tag != IPP_TAG_KEYWORD && temp_tag != IPP_TAG_URI &&
temp_tag != IPP_TAG_URISCHEME && temp_tag != IPP_TAG_LANGUAGE &&
temp_tag != IPP_TAG_MIMETYPE)
if (temp_tag != IPP_TAG_KEYWORD)
return (0);
(*attr)->value_tag = (ipp_tag_t)(IPP_TAG_NAME | ((*attr)->value_tag & IPP_TAG_CUPS_CONST));
@@ -4558,10 +4561,7 @@ ippSetValueTag(
case IPP_TAG_NAMELANG :
case IPP_TAG_TEXTLANG :
if (value_tag == IPP_TAG_NAMELANG &&
(temp_tag != IPP_TAG_NAME && temp_tag != IPP_TAG_KEYWORD &&
temp_tag != IPP_TAG_URI && temp_tag != IPP_TAG_URISCHEME &&
temp_tag != IPP_TAG_LANGUAGE && temp_tag != IPP_TAG_MIMETYPE))
if (value_tag == IPP_TAG_NAMELANG && (temp_tag != IPP_TAG_NAME && temp_tag != IPP_TAG_KEYWORD))
return (0);
if (value_tag == IPP_TAG_TEXTLANG && temp_tag != IPP_TAG_TEXT)
+12
Ver Arquivo
@@ -662,6 +662,9 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
{
switch (cparam->type)
{
case PPD_CUSTOM_UNKNOWN :
break;
case PPD_CUSTOM_CURVE :
case PPD_CUSTOM_INVCURVE :
case PPD_CUSTOM_POINTS :
@@ -708,6 +711,9 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
{
switch (cparam->type)
{
case PPD_CUSTOM_UNKNOWN :
break;
case PPD_CUSTOM_CURVE :
case PPD_CUSTOM_INVCURVE :
case PPD_CUSTOM_POINTS :
@@ -803,6 +809,9 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
{
switch (cparam->type)
{
case PPD_CUSTOM_UNKNOWN :
break;
case PPD_CUSTOM_CURVE :
case PPD_CUSTOM_INVCURVE :
case PPD_CUSTOM_POINTS :
@@ -1005,6 +1014,9 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
{
switch (cparam->type)
{
case PPD_CUSTOM_UNKNOWN :
break;
case PPD_CUSTOM_CURVE :
case PPD_CUSTOM_INVCURVE :
case PPD_CUSTOM_POINTS :
+6
Ver Arquivo
@@ -855,6 +855,9 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
switch (cparam->type)
{
case PPD_CUSTOM_UNKNOWN :
break;
case PPD_CUSTOM_CURVE :
case PPD_CUSTOM_INVCURVE :
case PPD_CUSTOM_REAL :
@@ -932,6 +935,9 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
switch (cparam->type)
{
case PPD_CUSTOM_UNKNOWN :
break;
case PPD_CUSTOM_CURVE :
case PPD_CUSTOM_INVCURVE :
case PPD_CUSTOM_REAL :
+51
Ver Arquivo
@@ -716,6 +716,8 @@ _ppdOpen(
strncmp(ll, keyword, ll_len)))
{
DEBUG_printf(("2_ppdOpen: Ignoring localization: \"%s\"\n", keyword));
free(string);
string = NULL;
continue;
}
else if (localization == _PPD_LOCALIZATION_ICC_PROFILES)
@@ -735,6 +737,8 @@ _ppdOpen(
if (i >= (int)(sizeof(color_keywords) / sizeof(color_keywords[0])))
{
DEBUG_printf(("2_ppdOpen: Ignoring localization: \"%s\"\n", keyword));
free(string);
string = NULL;
continue;
}
}
@@ -999,6 +1003,13 @@ _ppdOpen(
goto error;
}
if (cparam->type != PPD_CUSTOM_UNKNOWN)
{
pg->ppd_status = PPD_BAD_CUSTOM_PARAM;
goto error;
}
/*
* Get the parameter data...
*/
@@ -1182,6 +1193,24 @@ _ppdOpen(
else if (!strcmp(string, "Plus90"))
ppd->landscape = 90;
}
else if (!strcmp(keyword, "Emulators") && string && ppd->num_emulations == 0)
{
/*
* Issue #5562: Samsung printer drivers incorrectly use Emulators keyword
* to configure themselves
*
* The Emulators keyword was loaded but never used by anything in CUPS,
* and has no valid purpose in CUPS. The old code was removed due to a
* memory leak (Issue #5475), so the following (new) code supports a single
* name for the Emulators keyword, allowing these drivers to work until we
* remove PPD and driver support entirely in a future version of CUPS.
*/
ppd->num_emulations = 1;
ppd->emulations = calloc(1, sizeof(ppd_emul_t));
strlcpy(ppd->emulations[0].name, string, sizeof(ppd->emulations[0].name));
}
else if (!strcmp(keyword, "JobPatchFile"))
{
/*
@@ -1854,6 +1883,13 @@ _ppdOpen(
}
else if (!strcmp(keyword, "PaperDimension"))
{
if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
{
pg->ppd_status = PPD_ILLEGAL_OPTION_KEYWORD;
goto error;
}
if ((size = ppdPageSize(ppd, name)) == NULL)
size = ppd_add_size(ppd, name);
@@ -1876,6 +1912,13 @@ _ppdOpen(
}
else if (!strcmp(keyword, "ImageableArea"))
{
if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
{
pg->ppd_status = PPD_ILLEGAL_OPTION_KEYWORD;
goto error;
}
if ((size = ppdPageSize(ppd, name)) == NULL)
size = ppd_add_size(ppd, name);
@@ -1905,6 +1948,13 @@ _ppdOpen(
{
DEBUG_printf(("2_ppdOpen: group=%p, subgroup=%p", group, subgroup));
if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
{
pg->ppd_status = PPD_ILLEGAL_OPTION_KEYWORD;
goto error;
}
if (!strcmp(keyword, "PageSize"))
{
/*
@@ -2629,6 +2679,7 @@ ppd_get_cparam(ppd_coption_t *opt, /* I - PPD file */
if ((cparam = calloc(1, sizeof(ppd_cparam_t))) == NULL)
return (NULL);
cparam->type = PPD_CUSTOM_UNKNOWN;
strlcpy(cparam->name, param, sizeof(cparam->name));
strlcpy(cparam->text, text[0] ? text : param, sizeof(cparam->text));
+1
Ver Arquivo
@@ -235,6 +235,7 @@ typedef struct ppd_profile_s /**** sRGB Color Profiles ****/
/**** New in CUPS 1.2/macOS 10.5 ****/
typedef enum ppd_cptype_e /**** Custom Parameter Type @since CUPS 1.2/macOS 10.5@ ****/
{
PPD_CUSTOM_UNKNOWN = -1, /* Unknown type (error) */
PPD_CUSTOM_CURVE, /* Curve value for f(x) = x^value */
PPD_CUSTOM_INT, /* Integer number value */
PPD_CUSTOM_INVCURVE, /* Curve value for f(x) = x^(1/value) */
+19 -1
Ver Arquivo
@@ -1233,6 +1233,9 @@ asn1_get_integer(
int value; /* Integer value */
if (*buffer >= bufend)
return (0);
if (length > sizeof(int))
{
(*buffer) += length;
@@ -1259,6 +1262,9 @@ asn1_get_length(unsigned char **buffer, /* IO - Pointer in buffer */
unsigned length; /* Length */
if (*buffer >= bufend)
return (0);
length = **buffer;
(*buffer) ++;
@@ -1301,6 +1307,9 @@ asn1_get_oid(
int number; /* OID number */
if (*buffer >= bufend)
return (0);
valend = *buffer + length;
oidptr = oid;
oidend = oid + oidsize - 1;
@@ -1349,9 +1358,12 @@ asn1_get_packed(
int value; /* Value */
if (*buffer >= bufend)
return (0);
value = 0;
while ((**buffer & 128) && *buffer < bufend)
while (*buffer < bufend && (**buffer & 128))
{
value = (value << 7) | (**buffer & 127);
(*buffer) ++;
@@ -1379,6 +1391,9 @@ asn1_get_string(
char *string, /* I - String buffer */
size_t strsize) /* I - String buffer size */
{
if (*buffer >= bufend)
return (NULL);
if (length > (unsigned)(bufend - *buffer))
length = (unsigned)(bufend - *buffer);
@@ -1421,6 +1436,9 @@ asn1_get_type(unsigned char **buffer, /* IO - Pointer in buffer */
int type; /* Type */
if (*buffer >= bufend)
return (0);
type = **buffer;
(*buffer) ++;
+5 -5
Ver Arquivo
@@ -1,8 +1,8 @@
/*
* snprintf functions for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright © 2007-2019 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -177,7 +177,7 @@ _cups_vsnprintf(char *buffer, /* O - Output buffer */
break;
sprintf(temp, tformat, va_arg(ap, double));
templen = strlen(temp):
templen = strlen(temp);
bytes += (int)templen;
@@ -208,7 +208,7 @@ _cups_vsnprintf(char *buffer, /* O - Output buffer */
break;
sprintf(temp, tformat, va_arg(ap, int));
templen = strlen(temp):
templen = strlen(temp);
bytes += (int)templen;
@@ -232,7 +232,7 @@ _cups_vsnprintf(char *buffer, /* O - Output buffer */
break;
sprintf(temp, tformat, va_arg(ap, void *));
templen = strlen(temp):
templen = strlen(temp);
bytes += (int)templen;
+72 -48
Ver Arquivo
@@ -1,15 +1,9 @@
/*
* CUPS destination API test program for CUPS.
*
* Copyright 2012-2018 by Apple Inc.
* Copyright © 2012-2018 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
*/
/*
@@ -43,17 +37,31 @@ int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
{
int i; /* Looping var */
http_t *http; /* Connection to destination */
cups_dest_t *dest = NULL; /* Destination */
cups_dinfo_t *dinfo; /* Destination info */
unsigned dflags = CUPS_DEST_FLAGS_NONE;
/* Destination flags */
if (argc < 2)
usage(NULL);
return (0);
if (!strcmp(argv[1], "--enum"))
if (!strcmp(argv[1], "--get"))
{
cups_dest_t *dests; /* Destinations */
int num_dests = cupsGetDests2(CUPS_HTTP_DEFAULT, &dests);
/* Number of destinations */
for (i = 0; i < num_dests; i ++)
enum_cb(NULL, 0, dests + i);
cupsFreeDests(num_dests, dests);
return (0);
}
else if (!strcmp(argv[1], "--enum"))
{
int i; /* Looping var */
cups_ptype_t type = 0, /* Printer type filter */
mask = 0; /* Printer type mask */
@@ -103,78 +111,91 @@ main(int argc, /* I - Number of command-line arguments */
return (0);
}
else if (!strncmp(argv[1], "ipp://", 6) || !strncmp(argv[1], "ipps://", 7))
dest = cupsGetDestWithURI(NULL, argv[1]);
else if (!strcmp(argv[1], "default"))
i = 1;
if (!strcmp(argv[i], "--device"))
{
dflags = CUPS_DEST_FLAGS_DEVICE;
i ++;
}
if (!strncmp(argv[i], "ipp://", 6) || !strncmp(argv[i], "ipps://", 7))
dest = cupsGetDestWithURI(NULL, argv[i]);
else if (!strcmp(argv[i], "default"))
{
dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, NULL, NULL);
if (dest && dest->instance)
printf("default is \"%s/%s\".\n", dest->name, dest->instance);
else
else if (dest)
printf("default is \"%s\".\n", dest->name);
else
puts("no default destination.");
}
else
dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, argv[1], NULL);
dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, argv[i], NULL);
if (!dest)
{
printf("testdest: Unable to get destination \"%s\": %s\n", argv[1], cupsLastErrorString());
printf("testdest: Unable to get destination \"%s\": %s\n", argv[i], cupsLastErrorString());
return (1);
}
if ((http = cupsConnectDest(dest, CUPS_DEST_FLAGS_NONE, 30000, NULL, NULL, 0, NULL, NULL)) == NULL)
i ++;
if ((http = cupsConnectDest(dest, dflags, 30000, NULL, NULL, 0, NULL, NULL)) == NULL)
{
printf("testdest: Unable to connect to destination \"%s\": %s\n", argv[1], cupsLastErrorString());
printf("testdest: Unable to connect to destination \"%s\": %s\n", dest->name, cupsLastErrorString());
return (1);
}
if ((dinfo = cupsCopyDestInfo(http, dest)) == NULL)
{
printf("testdest: Unable to get information for destination \"%s\": %s\n", argv[1], cupsLastErrorString());
printf("testdest: Unable to get information for destination \"%s\": %s\n", dest->name, cupsLastErrorString());
return (1);
}
if (argc == 2 || (!strcmp(argv[2], "supported") && argc < 6))
if (i == argc || !strcmp(argv[i], "supported"))
{
if (argc > 3)
show_supported(http, dest, dinfo, argv[3], argv[4]);
i ++;
if ((i + 1) < argc)
show_supported(http, dest, dinfo, argv[i], argv[i + 1]);
else if (argc > 2)
show_supported(http, dest, dinfo, argv[3], NULL);
show_supported(http, dest, dinfo, argv[i], NULL);
else
show_supported(http, dest, dinfo, NULL, NULL);
}
else if (!strcmp(argv[2], "conflicts") && argc > 3)
else if (!strcmp(argv[i], "conflicts") && (i + 1) < argc)
{
int i, /* Looping var */
num_options = 0;/* Number of options */
int num_options = 0;/* Number of options */
cups_option_t *options = NULL;/* Options */
for (i = 3; i < argc; i ++)
for (i ++; i < argc; i ++)
num_options = cupsParseOptions(argv[i], num_options, &options);
show_conflicts(http, dest, dinfo, num_options, options);
}
else if (!strcmp(argv[2], "default") && argc == 4)
else if (!strcmp(argv[i], "default") && (i + 1) < argc)
{
show_default(http, dest, dinfo, argv[3]);
show_default(http, dest, dinfo, argv[i + 1]);
}
else if (!strcmp(argv[2], "localize") && argc < 6)
else if (!strcmp(argv[i], "localize"))
{
if (argc > 3)
localize(http, dest, dinfo, argv[3], argv[4]);
i ++;
if ((i + 1) < argc)
localize(http, dest, dinfo, argv[i], argv[i + 1]);
else if (argc > 2)
localize(http, dest, dinfo, argv[3], NULL);
localize(http, dest, dinfo, argv[i], NULL);
else
localize(http, dest, dinfo, NULL, NULL);
}
else if (!strcmp(argv[2], "media"))
else if (!strcmp(argv[i], "media"))
{
int i; /* Looping var */
const char *name = NULL; /* Media name, if any */
unsigned flags = CUPS_MEDIA_FLAGS_DEFAULT;
/* Media selection flags */
for (i = 3; i < argc; i ++)
for (i ++; i < argc; i ++)
{
if (!strcmp(argv[i], "borderless"))
flags = CUPS_MEDIA_FLAGS_BORDERLESS;
@@ -192,19 +213,19 @@ main(int argc, /* I - Number of command-line arguments */
show_media(http, dest, dinfo, flags, name);
}
else if (!strcmp(argv[2], "print") && argc > 3)
else if (!strcmp(argv[i], "print") && (i + 1) < argc)
{
int i, /* Looping var */
num_options = 0;/* Number of options */
int num_options = 0;/* Number of options */
cups_option_t *options = NULL;/* Options */
const char *filename = argv[i + 1];
for (i = 4; i < argc; i ++)
for (i += 2; i < argc; i ++)
num_options = cupsParseOptions(argv[i], num_options, &options);
print_file(http, dest, dinfo, argv[3], num_options, options);
print_file(http, dest, dinfo, filename, num_options, options);
}
else
usage(argv[2]);
usage(argv[i]);
return (0);
}
@@ -226,13 +247,15 @@ enum_cb(void *user_data, /* I - User data (unused) */
(void)flags;
if (dest->instance)
printf("%s%s/%s:\n", (flags & CUPS_DEST_FLAGS_REMOVED) ? "REMOVE " : "", dest->name, dest->instance);
printf("%s%s/%s%s:\n", (flags & CUPS_DEST_FLAGS_REMOVED) ? "REMOVE " : "", dest->name, dest->instance, dest->is_default ? " (Default)" : "");
else
printf("%s%s:\n", (flags & CUPS_DEST_FLAGS_REMOVED) ? "REMOVE " : "", dest->name);
printf("%s%s%s:\n", (flags & CUPS_DEST_FLAGS_REMOVED) ? "REMOVE " : "", dest->name, dest->is_default ? " (Default)" : "");
for (i = 0; i < dest->num_options; i ++)
printf(" %s=\"%s\"\n", dest->options[i].name, dest->options[i].value);
puts("");
return (1);
}
@@ -740,9 +763,10 @@ usage(const char *arg) /* I - Argument for usage message */
printf("testdest: Unknown option \"%s\".\n", arg);
puts("Usage:");
puts(" ./testdest name [operation ...]");
puts(" ./testdest ipp://... [operation ...]");
puts(" ./testdest ipps://... [operation ...]");
puts(" ./testdest [--device] name [operation ...]");
puts(" ./testdest [--device] ipp://... [operation ...]");
puts(" ./testdest [--device] ipps://... [operation ...]");
puts(" ./testdest --get");
puts(" ./testdest --enum [grayscale] [color] [duplex] [staple] [small]\n"
" [medium] [large]");
puts("");
+102 -16
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* IPP test program for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 2007-2019 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -50,7 +50,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
0x01, 0x01, /* IPP version */
0x00, 0x02, /* Print-Job operation */
0x00, 0x00, 0x00, 0x01,
/* Request ID */
/* Request ID */
IPP_TAG_OPERATION,
@@ -80,7 +80,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
IPP_TAG_JOB, /* job group tag */
IPP_TAG_BEGIN_COLLECTION,
/* begCollection tag */
/* begCollection tag */
0x00, 0x09, /* Name length + name */
'm', 'e', 'd', 'i', 'a', '-', 'c', 'o', 'l',
0x00, 0x00, /* No value */
@@ -89,11 +89,11 @@ static ipp_uchar_t collection[] = /* Collection buffer */
0x00, 0x0a, /* Value length + value */
'm', 'e', 'd', 'i', 'a', '-', 's', 'i', 'z', 'e',
IPP_TAG_BEGIN_COLLECTION,
/* begCollection tag */
/* begCollection tag */
0x00, 0x00, /* Name length + name */
0x00, 0x00, /* No value */
IPP_TAG_MEMBERNAME,
/* memberAttrName tag */
/* memberAttrName tag */
0x00, 0x00, /* No name */
0x00, 0x0b, /* Value length + value */
'x', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
@@ -102,7 +102,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
0x00, 0x04, /* Value length + value */
0x00, 0x00, 0x54, 0x56,
IPP_TAG_MEMBERNAME,
/* memberAttrName tag */
/* memberAttrName tag */
0x00, 0x00, /* No name */
0x00, 0x0b, /* Value length + value */
'y', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
@@ -111,7 +111,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
0x00, 0x04, /* Value length + value */
0x00, 0x00, 0x6d, 0x24,
IPP_TAG_END_COLLECTION,
/* endCollection tag */
/* endCollection tag */
0x00, 0x00, /* No name */
0x00, 0x00, /* No value */
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
@@ -132,12 +132,12 @@ static ipp_uchar_t collection[] = /* Collection buffer */
0x00, 0x05, /* Value length + value */
'p', 'l', 'a', 'i', 'n',
IPP_TAG_END_COLLECTION,
/* endCollection tag */
/* endCollection tag */
0x00, 0x00, /* No name */
0x00, 0x00, /* No value */
IPP_TAG_BEGIN_COLLECTION,
/* begCollection tag */
/* begCollection tag */
0x00, 0x00, /* No name */
0x00, 0x00, /* No value */
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
@@ -145,11 +145,11 @@ static ipp_uchar_t collection[] = /* Collection buffer */
0x00, 0x0a, /* Value length + value */
'm', 'e', 'd', 'i', 'a', '-', 's', 'i', 'z', 'e',
IPP_TAG_BEGIN_COLLECTION,
/* begCollection tag */
/* begCollection tag */
0x00, 0x00, /* Name length + name */
0x00, 0x00, /* No value */
IPP_TAG_MEMBERNAME,
/* memberAttrName tag */
/* memberAttrName tag */
0x00, 0x00, /* No name */
0x00, 0x0b, /* Value length + value */
'x', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
@@ -158,7 +158,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
0x00, 0x04, /* Value length + value */
0x00, 0x00, 0x52, 0x08,
IPP_TAG_MEMBERNAME,
/* memberAttrName tag */
/* memberAttrName tag */
0x00, 0x00, /* No name */
0x00, 0x0b, /* Value length + value */
'y', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
@@ -167,7 +167,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
0x00, 0x04, /* Value length + value */
0x00, 0x00, 0x74, 0x04,
IPP_TAG_END_COLLECTION,
/* endCollection tag */
/* endCollection tag */
0x00, 0x00, /* No name */
0x00, 0x00, /* No value */
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
@@ -188,7 +188,72 @@ static ipp_uchar_t collection[] = /* Collection buffer */
0x00, 0x06, /* Value length + value */
'g', 'l', 'o', 's', 's', 'y',
IPP_TAG_END_COLLECTION,
/* endCollection tag */
/* endCollection tag */
0x00, 0x00, /* No name */
0x00, 0x00, /* No value */
IPP_TAG_END /* end tag */
};
static ipp_uchar_t bad_collection[] = /* Collection buffer (bad encoding) */
{
0x01, 0x01, /* IPP version */
0x00, 0x02, /* Print-Job operation */
0x00, 0x00, 0x00, 0x01,
/* Request ID */
IPP_TAG_OPERATION,
IPP_TAG_CHARSET,
0x00, 0x12, /* Name length + name */
'a','t','t','r','i','b','u','t','e','s','-',
'c','h','a','r','s','e','t',
0x00, 0x05, /* Value length + value */
'u','t','f','-','8',
IPP_TAG_LANGUAGE,
0x00, 0x1b, /* Name length + name */
'a','t','t','r','i','b','u','t','e','s','-',
'n','a','t','u','r','a','l','-','l','a','n',
'g','u','a','g','e',
0x00, 0x02, /* Value length + value */
'e','n',
IPP_TAG_URI,
0x00, 0x0b, /* Name length + name */
'p','r','i','n','t','e','r','-','u','r','i',
0x00, 0x1c, /* Value length + value */
'i','p','p',':','/','/','l','o','c','a','l',
'h','o','s','t','/','p','r','i','n','t','e',
'r','s','/','f','o','o',
IPP_TAG_JOB, /* job group tag */
IPP_TAG_BEGIN_COLLECTION,
/* begCollection tag */
0x00, 0x09, /* Name length + name */
'm', 'e', 'd', 'i', 'a', '-', 'c', 'o', 'l',
0x00, 0x00, /* No value */
IPP_TAG_BEGIN_COLLECTION,
/* begCollection tag */
0x00, 0x0a, /* Name length + name */
'm', 'e', 'd', 'i', 'a', '-', 's', 'i', 'z', 'e',
0x00, 0x00, /* No value */
IPP_TAG_INTEGER, /* integer tag */
0x00, 0x0b, /* Name length + name */
'x', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
0x00, 0x04, /* Value length + value */
0x00, 0x00, 0x54, 0x56,
IPP_TAG_INTEGER, /* integer tag */
0x00, 0x0b, /* Name length + name */
'y', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
0x00, 0x04, /* Value length + value */
0x00, 0x00, 0x6d, 0x24,
IPP_TAG_END_COLLECTION,
/* endCollection tag */
0x00, 0x00, /* No name */
0x00, 0x00, /* No value */
IPP_TAG_END_COLLECTION,
/* endCollection tag */
0x00, 0x00, /* No name */
0x00, 0x00, /* No value */
@@ -200,7 +265,7 @@ static ipp_uchar_t mixed[] = /* Mixed value buffer */
0x01, 0x01, /* IPP version */
0x00, 0x02, /* Print-Job operation */
0x00, 0x00, 0x00, 0x01,
/* Request ID */
/* Request ID */
IPP_TAG_OPERATION,
@@ -589,12 +654,33 @@ main(int argc, /* I - Number of command-line arguments */
ippDelete(request);
/*
* Read the bad collection data and confirm we get an error...
*/
fputs("Read Bad Collection from Memory: ", stdout);
request = ippNew();
data.rpos = 0;
data.wused = sizeof(bad_collection);
data.wsize = sizeof(bad_collection);
data.wbuffer = bad_collection;
while ((state = ippReadIO(&data, (ipp_iocb_t)read_cb, 1, NULL, request)) != IPP_STATE_DATA)
if (state == IPP_STATE_ERROR)
break;
if (state != IPP_STATE_ERROR)
puts("FAIL (read successful)");
else
puts("PASS");
/*
* Read the mixed data and confirm we converted everything to rangeOfInteger
* values...
*/
printf("Read Mixed integer/rangeOfInteger from Memory: ");
fputs("Read Mixed integer/rangeOfInteger from Memory: ", stdout);
request = ippNew();
data.rpos = 0;
+4
Ver Arquivo
@@ -1054,6 +1054,10 @@ main(int argc, /* I - Number of command-line arguments */
{
switch (cparam->type)
{
case PPD_CUSTOM_UNKNOWN :
printf(" %s(%s): PPD_CUSTOM_UNKNOWN (error)\n", cparam->name, cparam->text);
break;
case PPD_CUSTOM_CURVE :
printf(" %s(%s): PPD_CUSTOM_CURVE (%g to %g)\n",
cparam->name, cparam->text,
+2
Ver Arquivo
@@ -76,6 +76,7 @@
float: left;
margin-left: 0.5%;
margin-right: 0;
padding-bottom: 40px;
width: 33%;
}
.row .thirds:first-child {
@@ -86,6 +87,7 @@
float: left;
margin-left: 0.5%;
margin-right: 0;
padding-bottom: 40px;
width: 49.75%;
}
.row .halves:first-child {
+1 -1
Ver Arquivo
@@ -50,6 +50,6 @@
</div>
</div>
</div>
<div class="footer">CUPS und das CUPS Logo sind Warenzeichen der <a href="http://www.apple.com">Apple Inc.</a> Copyright &copy; 2007-2018 Apple Inc. Alle Rechte vorbehalten.</div>
<div class="footer">CUPS und das CUPS Logo sind Warenzeichen der <a href="http://www.apple.com">Apple Inc.</a> Copyright &copy; 2007-2019 Apple Inc. Alle Rechte vorbehalten.</div>
</body>
</html>
+1 -1
Ver Arquivo
@@ -50,6 +50,6 @@
</div>
</div>
</div>
<div class="footer">CUPS y el logo de CUPS son marcas registradas de <a href="http://www.apple.com">Apple Inc.</a> Derechos de autor &copy; 2007-2018 Apple Inc. Todos los derechos reservados.</div>
<div class="footer">CUPS y el logo de CUPS son marcas registradas de <a href="http://www.apple.com">Apple Inc.</a> Derechos de autor &copy; 2007-2019 Apple Inc. Todos los derechos reservados.</div>
</body>
</html>
+3 -3
Ver Arquivo
@@ -219,7 +219,7 @@ The value "0" disables log rotation.
The default is "1048576" (1MB).
<dt><a name="MultipleOperationTimeout"></a><b>MultipleOperationTimeout </b><i>seconds</i>
<dd style="margin-left: 5.0em">Specifies the maximum amount of time to allow between files in a multiple file print job.
The default is "300" (5 minutes).
The default is "900" (15 minutes).
<dt><a name="Policy"></a><b>&lt;Policy </b><i>name</i><b>> </b>... <b>&lt;/Policy></b>
<dd style="margin-left: 5.0em">Specifies access control for the named policy.
<dt><a name="Port"></a><b>Port </b><i>number</i>
@@ -294,7 +294,7 @@ The <i>DenyTLS1.0</i> option disables TLS v1.0 support - this sets the minimum p
The default is "No".
<dt><a name="Timeout"></a><b>Timeout </b><i>seconds</i>
<dd style="margin-left: 5.0em">Specifies the HTTP request timeout.
The default is "300" (5 minutes).
The default is "900" (15 minutes).
<dt><a name="WebInterface"></a><b>WebInterface yes</b>
<dd style="margin-left: 5.0em"><dt><b>WebInterface no</b>
<dd style="margin-left: 5.0em">Specifies whether the web interface is enabled.
@@ -601,7 +601,7 @@ Require authentication for accesses from outside the 10. network:
<a href="man-subscriptions.conf.html?TOPIC=Man+Pages"><b>subscriptions.conf</b>(5),</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 &copy; 2007-2018 by Apple Inc.
Copyright &copy; 2007-2019 by Apple Inc.
</body>
</html>
+2 -2
Ver Arquivo
@@ -230,7 +230,7 @@ The following predicates are understood following the <b>EXPECT</b> test directi
<dd style="margin-left: 5.0em">Makes the <b>EXPECT</b> conditions apply only if the specified variable is not defined.
<dt><b>IN-GROUP </b><i>tag</i>
<dd style="margin-left: 5.0em">Requires the <b>EXPECT</b> attribute to be in the specified group tag.
<dt><b>OF-TYPE </b><i>tag[,tag,...]</i>
<dt><b>OF-TYPE </b><i>tag[|tag,...]</i>
<dd style="margin-left: 5.0em">Requires the <b>EXPECT</b> attribute to use one of the specified value tag(s).
<dt><b>REPEAT-LIMIT </b><i>number</i>
<dd style="margin-left: 5.0em"><br>
@@ -532,7 +532,7 @@ IANA IPP Registry (<a href="http://www.iana.org/assignments/ipp-registrations)">
PWG Internet Printing Protocol Workgroup (<a href="http://www.pwg.org/ipp)">http://www.pwg.org/ipp)</a>,
RFC 8011 (<a href="http://tools.ietf.org/html/rfc8011">http://tools.ietf.org/html/rfc8011</a>)
<h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
Copyright &copy; 2007-2017 by Apple Inc.
Copyright &copy; 2007-2019 by Apple Inc.
</body>
</html>
+1 -1
Ver Arquivo
@@ -50,6 +50,6 @@
</div>
</div>
</div>
<div class="footer">CUPS and the CUPS logo are trademarks of <a href="http://www.apple.com">Apple Inc.</a> Copyright &copy; 2007-2018 Apple Inc. All rights reserved.</div>
<div class="footer">CUPS and the CUPS logo are trademarks of <a href="http://www.apple.com">Apple Inc.</a> Copyright &copy; 2007-2019 Apple Inc. All rights reserved.</div>
</body>
</html>
+1 -1
Ver Arquivo
@@ -50,6 +50,6 @@
</div>
</div>
</div>
<div class="footer">CUPS and the CUPS logo are trademarks of <a href="http://www.apple.com">Apple Inc.</a> Copyright &copy; 2007-2018 Apple Inc. All rights reserved.</div>
<div class="footer">CUPS and the CUPS logo are trademarks of <a href="http://www.apple.com">Apple Inc.</a> Copyright &copy; 2007-2019 Apple Inc. All rights reserved.</div>
</body>
</html>
+1 -1
Ver Arquivo
@@ -51,6 +51,6 @@
</div>
</div>
</div>
<div class="footer">CUPS e o logo do CUPS s&atilde;o marcas registradas da <a href="http://www.apple.com">Apple Inc.</a> Copyright &copy; 2007-2018 Apple Inc. Todos os direitos reservados.</div>
<div class="footer">CUPS e o logo do CUPS s&atilde;o marcas registradas da <a href="http://www.apple.com">Apple Inc.</a> Copyright &copy; 2007-2019 Apple Inc. Todos os direitos reservados.</div>
</body>
</html>
+1 -1
Ver Arquivo
@@ -51,6 +51,6 @@
</div>
</div>
</div>
<div class="footer">CUPS а также логотип CUPS являются зарегистрированными торговыми марками <A HREF="http://www.apple.com">Apple Inc.</A> Авторские права на CUPS принадлежат (2007-2018) компании Apple Inc. Все права защищены.</div>
<div class="footer">CUPS а также логотип CUPS являются зарегистрированными торговыми марками <A HREF="http://www.apple.com">Apple Inc.</A> Авторские права на CUPS принадлежат (2007-2019) компании Apple Inc. Все права защищены.</div>
</body>
</html>
+8 -1
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* Label printer filter for CUPS.
*
* Copyright 2007-2016 by Apple Inc.
* Copyright 2007-2019 by Apple Inc.
* Copyright 2001-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -619,7 +619,14 @@ EndPage(ppd_file_t *ppd, /* I - PPD file */
*/
puts("^XZ");
/*
* Delete the label image...
*/
puts("^XA");
puts("^IDR:CUPS.GRF^FS");
puts("^XZ");
/*
* Cut the label as needed...
+660 -659
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+1 -1
Ver Arquivo
@@ -1722,7 +1722,7 @@
"cups-deviced failed to execute." = "cups-deviced failed to execute.";
"cups-driverd failed to execute." = "cups-driverd failed to execute.";
"cupsaddsmb: No PPD file for printer \"%s\" - %s" = "cupsaddsmb: No PPD file for printer “%s” - %s";
"cupsctl: Cannot set Listen or Port directly." = "cupsctl: Cannot set Listen or Port directly.";
"cupsctl: Cannot set %s directly." = "cupsctl: Cannot set %s directly.";
"cupsctl: Unable to connect to server: %s" = "cupsctl: Unable to connect to server: %s";
"cupsctl: Unknown option \"%s\"" = "cupsctl: Unknown option “%s”";
"cupsctl: Unknown option \"-%c\"" = "cupsctl: Unknown option “-%c”";
+7 -3
Ver Arquivo
@@ -32,7 +32,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CUPS 1.4.6\n"
"Report-Msgid-Bugs-To: https://github.com/apple/cups/issues\n"
"POT-Creation-Date: 2018-09-28 11:22-0400\n"
"POT-Creation-Date: 2019-05-15 10:31-0400\n"
"PO-Revision-Date: 2012-09-29 11:21+0200\n"
"Last-Translator: Àngel Mompó <mecatxis@gmail.com>\n"
"Language-Team: Catalan <ca@dodds.net>\n"
@@ -6271,8 +6271,9 @@ msgstr "no s'ha pogut executar correctament la cups-driverd"
msgid "cupsaddsmb: No PPD file for printer \"%s\" - %s"
msgstr "cupsaddsmb: falta el fitxer PPD per la impressora «%s» - %s"
msgid "cupsctl: Cannot set Listen or Port directly."
msgstr "cupsctl: no es pot establir Listen o Port directament."
#, c-format
msgid "cupsctl: Cannot set %s directly."
msgstr ""
#, c-format
msgid "cupsctl: Unable to connect to server: %s"
@@ -13776,6 +13777,9 @@ msgstr "Z Offset"
#~ "convert: feu servir l'opció -f per especificar el fitxer que voleu "
#~ "convertir."
#~ msgid "cupsctl: Cannot set Listen or Port directly."
#~ msgstr "cupsctl: no es pot establir Listen o Port directament."
#~ msgid "cupsd: launchd(8) support not compiled in, running in normal mode."
#~ msgstr ""
#~ "cupsd: no s'ha compilat amb compatibilitat per launchd(8). S'executa en "
+3 -2
Ver Arquivo
@@ -29,7 +29,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CUPS 1.6\n"
"Report-Msgid-Bugs-To: https://github.com/apple/cups/issues\n"
"POT-Creation-Date: 2018-09-28 11:22-0400\n"
"POT-Creation-Date: 2019-05-15 10:31-0400\n"
"PO-Revision-Date: 2012-09-14 10:26+0100\n"
"Last-Translator: Jan Bartos <jan.bartos@madeta.cz>\n"
"Language-Team: Czech\n"
@@ -6002,7 +6002,8 @@ msgstr "Nepodařilo se spustit \"cups-driverd\"."
msgid "cupsaddsmb: No PPD file for printer \"%s\" - %s"
msgstr ""
msgid "cupsctl: Cannot set Listen or Port directly."
#, c-format
msgid "cupsctl: Cannot set %s directly."
msgstr ""
#, c-format
+7 -3
Ver Arquivo
@@ -29,7 +29,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CUPS 2.0\n"
"Report-Msgid-Bugs-To: https://github.com/apple/cups/issues\n"
"POT-Creation-Date: 2018-09-28 11:22-0400\n"
"POT-Creation-Date: 2019-05-15 10:31-0400\n"
"PO-Revision-Date: 2017-10-25 14:57+0200\n"
"Last-Translator: Michael Weghorn <m.weghorn@posteo.de>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -6132,8 +6132,9 @@ msgstr "„cups-driverd“ konnte nicht ausgeführt werden."
msgid "cupsaddsmb: No PPD file for printer \"%s\" - %s"
msgstr "cupsaddsmb: Keine PPD Datei für Drucker »%s« - %s"
msgid "cupsctl: Cannot set Listen or Port directly."
msgstr "cupsctl: Kann nicht direkt auf dem Port hören."
#, c-format
msgid "cupsctl: Cannot set %s directly."
msgstr ""
#, c-format
msgid "cupsctl: Unable to connect to server: %s"
@@ -13326,6 +13327,9 @@ msgstr "Z Offset"
#~ msgid "compression.none"
#~ msgstr "None"
#~ msgid "cupsctl: Cannot set Listen or Port directly."
#~ msgstr "cupsctl: Kann nicht direkt auf dem Port hören."
#~ msgid "destination-accesses"
#~ msgstr "Destination Accesses"
+9 -5
Ver Arquivo
@@ -16,7 +16,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CUPS 2.2\n"
"Report-Msgid-Bugs-To: https://github.com/apple/cups/issues\n"
"POT-Creation-Date: 2018-09-28 11:22-0400\n"
"POT-Creation-Date: 2019-05-15 10:31-0400\n"
"PO-Revision-Date: 2016-06-26 21:17+0100\n"
"Last-Translator: Juan Pablo González Riopedre <jpgriopedre@yahoo.es>\n"
"Language-Team: Spanish\n"
@@ -5978,8 +5978,8 @@ msgstr "Uso: cupstestdsc [opciones] nombre_archivo.ps [... nombre_archivo.ps]"
msgid ""
"Usage: cupstestppd [options] filename1.ppd[.gz] [... filenameN.ppd[.gz]]"
msgstr ""
"Uso: cupstestppd [opciones] nombre_archivo1.ppd[.gz] [... nombre_archivoN."
"ppd[.gz]]"
"Uso: cupstestppd [opciones] nombre_archivo1.ppd[.gz] [... nombre_archivoN.ppd"
"[.gz]]"
msgid ""
"Usage: ippfind [options] regtype[,subtype][.domain.] ... [expression]\n"
@@ -6315,8 +6315,9 @@ msgstr "Ha fallado al ejecutarse cups-driverd."
msgid "cupsaddsmb: No PPD file for printer \"%s\" - %s"
msgstr "cupsaddsmb: No hay archivo PPD para la impresora \"%s\" - %s"
msgid "cupsctl: Cannot set Listen or Port directly."
msgstr "cupsctl: No se puede establecer Listen o Port directamente."
#, c-format
msgid "cupsctl: Cannot set %s directly."
msgstr ""
#, c-format
msgid "cupsctl: Unable to connect to server: %s"
@@ -13715,6 +13716,9 @@ msgstr "Z Offset"
#~ msgid "compression.none"
#~ msgstr "None"
#~ msgid "cupsctl: Cannot set Listen or Port directly."
#~ msgstr "cupsctl: No se puede establecer Listen o Port directamente."
#~ msgid "destination-accesses"
#~ msgstr "Destination Accesses"
+3 -2
Ver Arquivo
@@ -29,7 +29,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CUPS 1.6\n"
"Report-Msgid-Bugs-To: https://github.com/apple/cups/issues\n"
"POT-Creation-Date: 2018-09-28 11:22-0400\n"
"POT-Creation-Date: 2019-05-15 10:31-0400\n"
"PO-Revision-Date: 2012-12-12 11:12+0100\n"
"Last-Translator: Stéphane Blondon <stephane.blondon@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -6069,7 +6069,8 @@ msgstr "Lexécution de « cups-driverd » a échoué."
msgid "cupsaddsmb: No PPD file for printer \"%s\" - %s"
msgstr ""
msgid "cupsctl: Cannot set Listen or Port directly."
#, c-format
msgid "cupsctl: Cannot set %s directly."
msgstr ""
#, c-format
+7 -3
Ver Arquivo
@@ -29,7 +29,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CUPS 1.6\n"
"Report-Msgid-Bugs-To: https://github.com/apple/cups/issues\n"
"POT-Creation-Date: 2018-09-28 11:22-0400\n"
"POT-Creation-Date: 2019-05-15 10:31-0400\n"
"PO-Revision-Date: 2013-07-14 12:00+0200\n"
"Last-Translator: Giovanni Scafora <giovanni@archlinux.org>\n"
"Language-Team: Arch Linux Italian Team <giovanni@archlinux.org>\n"
@@ -6294,8 +6294,9 @@ msgstr "cups-driverd ha smesso di funzionare."
msgid "cupsaddsmb: No PPD file for printer \"%s\" - %s"
msgstr "cupsaddsmb: nessun file PPD per la stampante \"%s\" - %s"
msgid "cupsctl: Cannot set Listen or Port directly."
msgstr "cupsctl: non è possibile impostare direttamente Listen o Port."
#, c-format
msgid "cupsctl: Cannot set %s directly."
msgstr ""
#, c-format
msgid "cupsctl: Unable to connect to server: %s"
@@ -13823,6 +13824,9 @@ msgstr "Z Offset"
#~ msgid "compression.none"
#~ msgstr "None"
#~ msgid "cupsctl: Cannot set Listen or Port directly."
#~ msgstr "cupsctl: non è possibile impostare direttamente Listen o Port."
#~ msgid "cupsd: launchd(8) support not compiled in, running in normal mode."
#~ msgstr ""
#~ "cupsd: launchd(8) non supporta i compilati, quando è in modalità normale."
+7 -3
Ver Arquivo
@@ -28,7 +28,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CUPS 2.0\n"
"Report-Msgid-Bugs-To: https://github.com/apple/cups/issues\n"
"POT-Creation-Date: 2018-09-28 11:22-0400\n"
"POT-Creation-Date: 2019-05-15 10:31-0400\n"
"PO-Revision-Date: 2014-11-15 19:27+0900\n"
"Last-Translator: OPFC TRANSCUPS <opfc-transcups@sourceforge.jp>\n"
"Language-Team: OPFC TRANSCUPS <opfc-transcups@sourceforge.jp>\n"
@@ -6251,8 +6251,9 @@ msgstr "cups-driverd の実行に失敗しました。"
msgid "cupsaddsmb: No PPD file for printer \"%s\" - %s"
msgstr "cupsaddsmb: プリンター \"%s\" の PPD ファイルがありません - %s"
msgid "cupsctl: Cannot set Listen or Port directly."
msgstr "cupsctl: Listen あるいは Port を直接設定できません。"
#, c-format
msgid "cupsctl: Cannot set %s directly."
msgstr ""
#, c-format
msgid "cupsctl: Unable to connect to server: %s"
@@ -13843,6 +13844,9 @@ msgstr "Z Offset"
#~ msgid "compression.none"
#~ msgstr "None"
#~ msgid "cupsctl: Cannot set Listen or Port directly."
#~ msgstr "cupsctl: Listen あるいは Port を直接設定できません。"
#~ msgid "cupsd: launchd(8) support not compiled in, running in normal mode."
#~ msgstr ""
#~ "cupsd: launchd(8) サポートがコンパイルされていないので、通常モードで動作し"
+7 -3
Ver Arquivo
@@ -40,7 +40,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CUPS 2.1.2\n"
"Report-Msgid-Bugs-To: https://github.com/apple/cups/issues\n"
"POT-Creation-Date: 2018-09-28 11:22-0400\n"
"POT-Creation-Date: 2019-05-15 10:31-0400\n"
"PO-Revision-Date: 2016-01-31 16:45-0200\n"
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>\n"
"Language-Team: Brazilian Portuguese <traducao-cups-pt-br@googlegroups.com>\n"
@@ -6295,8 +6295,9 @@ msgstr "cups-driverd falhou na execução."
msgid "cupsaddsmb: No PPD file for printer \"%s\" - %s"
msgstr "cupsaddsmb: Nenhum arquivo PPD para a impressora \"%s\" - %s"
msgid "cupsctl: Cannot set Listen or Port directly."
msgstr "cupsctl: Não foi possível definir diretamente Porta ou Listen."
#, c-format
msgid "cupsctl: Cannot set %s directly."
msgstr ""
#, c-format
msgid "cupsctl: Unable to connect to server: %s"
@@ -13814,6 +13815,9 @@ msgstr "Z Offset"
#~ msgid "compression.none"
#~ msgstr "None"
#~ msgid "cupsctl: Cannot set Listen or Port directly."
#~ msgstr "cupsctl: Não foi possível definir diretamente Porta ou Listen."
#~ msgid "cupsd: launchd(8) support not compiled in, running in normal mode."
#~ msgstr ""
#~ "cupsd: Compilado sem suporte a launchd(8) e, portanto, executando no modo "
+7 -3
Ver Arquivo
@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CUPS 2.0\n"
"Report-Msgid-Bugs-To: https://github.com/apple/cups/issues\n"
"POT-Creation-Date: 2018-09-28 11:22-0400\n"
"POT-Creation-Date: 2019-05-15 10:31-0400\n"
"PO-Revision-Date: 2015-01-28 12:00-0800\n"
"Last-Translator: Aleksandr Proklov\n"
"Language-Team: PuppyRus Linux Team\n"
@@ -6208,8 +6208,9 @@ msgstr "Не удалось выполнить cups-driverd."
msgid "cupsaddsmb: No PPD file for printer \"%s\" - %s"
msgstr "cupsaddsmb: Нет PPD-файла для принтера \"%s\" - %s"
msgid "cupsctl: Cannot set Listen or Port directly."
msgstr "cupsctl: Не удается задать Listen или Port."
#, c-format
msgid "cupsctl: Cannot set %s directly."
msgstr ""
#, c-format
msgid "cupsctl: Unable to connect to server: %s"
@@ -13605,6 +13606,9 @@ msgstr "Z Offset"
#~ msgid "compression.none"
#~ msgstr "None"
#~ msgid "cupsctl: Cannot set Listen or Port directly."
#~ msgstr "cupsctl: Не удается задать Listen или Port."
#~ msgid "destination-accesses"
#~ msgstr "Destination Accesses"
+7 -3
Ver Arquivo
@@ -29,7 +29,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CUPS 1.6\n"
"Report-Msgid-Bugs-To: https://github.com/apple/cups/issues\n"
"POT-Creation-Date: 2018-09-28 11:22-0400\n"
"POT-Creation-Date: 2019-05-15 10:31-0400\n"
"PO-Revision-Date: 2017-06-11 12:38+0800\n"
"Last-Translator: Mingcong Bai <jeffbai@aosc.xyz>\n"
"Language-Team: \n"
@@ -6165,8 +6165,9 @@ msgstr "无法执行 cups-driverd。"
msgid "cupsaddsmb: No PPD file for printer \"%s\" - %s"
msgstr "cupsaddsmb:打印机“%s”无 PPD 文件 — %s"
msgid "cupsctl: Cannot set Listen or Port directly."
msgstr "cupsctl:无法直接设置 Listen 或 Port 值。"
#, c-format
msgid "cupsctl: Cannot set %s directly."
msgstr ""
#, c-format
msgid "cupsctl: Unable to connect to server: %s"
@@ -13505,6 +13506,9 @@ msgstr "Z Offset"
#~ msgid "compression.none"
#~ msgstr "None"
#~ msgid "cupsctl: Cannot set Listen or Port directly."
#~ msgstr "cupsctl:无法直接设置 Listen 或 Port 值。"
#~ msgid "destination-accesses"
#~ msgstr "Destination Accesses"
+5 -5
Ver Arquivo
@@ -1,7 +1,7 @@
.\"
.\" cupsd.conf man page for CUPS.
.\"
.\" Copyright © 2007-2018 by Apple Inc.
.\" Copyright © 2007-2019 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 cupsd.conf 5 "CUPS" "24 April 2018" "Apple Inc."
.TH cupsd.conf 5 "CUPS" "2 May 2019" "Apple Inc."
.SH NAME
cupsd.conf \- server configuration file for cups
.SH DESCRIPTION
@@ -341,7 +341,7 @@ The default is "1048576" (1MB).
.TP 5
\fBMultipleOperationTimeout \fIseconds\fR
Specifies the maximum amount of time to allow between files in a multiple file print job.
The default is "300" (5 minutes).
The default is "900" (15 minutes).
.\"#Policy
.TP 5
\fB<Policy \fIname\fB> \fR... \fB</Policy>\fR
@@ -459,7 +459,7 @@ The default is "No".
.TP 5
\fBTimeout \fIseconds\fR
Specifies the HTTP request timeout.
The default is "300" (5 minutes).
The default is "900" (15 minutes).
.\"#WebInterface
.TP 5
\fBWebInterface yes\fR
@@ -876,4 +876,4 @@ Require authentication for accesses from outside the 10. network:
.BR subscriptions.conf (5),
CUPS Online Help (http://localhost:631/help)
.SH COPYRIGHT
Copyright \[co] 2007-2018 by Apple Inc.
Copyright \[co] 2007-2019 by Apple Inc.
+4 -4
Ver Arquivo
@@ -1,7 +1,7 @@
.\"
.\" ipptoolfile man page.
.\"
.\" Copyright 2010-2017 by Apple Inc.
.\" Copyright 2010-2019 by Apple Inc.
.\"
.\" These coded instructions, statements, and computer programs are the
.\" property of Apple Inc. and are protected by Federal copyright
@@ -9,7 +9,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 ipptoolfile 5 "CUPS" "15 June 2017" "Apple Inc."
.TH ipptoolfile 5 "CUPS" "5 August 2019" "Apple Inc."
.SH NAME
ipptoolfile \- ipptool file format
.SH DESCRIPTION
@@ -297,7 +297,7 @@ Makes the \fBEXPECT\fR conditions apply only if the specified variable is not de
\fBIN\-GROUP \fItag\fR
Requires the \fBEXPECT\fR attribute to be in the specified group tag.
.TP 5
\fBOF\-TYPE \fItag[,tag,...]\fR
\fBOF\-TYPE \fItag[|tag,...]\fR
Requires the \fBEXPECT\fR attribute to use one of the specified value tag(s).
.TP 5
\fBREPEAT\-LIMIT \fInumber\fR
@@ -649,4 +649,4 @@ IANA IPP Registry (http://www.iana.org/assignments/ipp-registrations),
PWG Internet Printing Protocol Workgroup (http://www.pwg.org/ipp),
RFC 8011 (http://tools.ietf.org/html/rfc8011)
.SH COPYRIGHT
Copyright \[co] 2007-2017 by Apple Inc.
Copyright \[co] 2007-2019 by Apple Inc.
+16 -7
Ver Arquivo
@@ -1176,7 +1176,23 @@ cupsdCheckGroup(
groupid = group->gr_gid;
for (i = 0; group->gr_mem[i]; i ++)
{
/*
* User appears in the group membership...
*/
if (!_cups_strcasecmp(username, group->gr_mem[i]))
return (1);
}
#ifdef HAVE_GETGROUPLIST
/*
* If the user isn't in the group membership list, try the results from
* getgrouplist() which is supposed to return the full list of groups a user
* belongs to...
*/
if (user)
{
int ngroups; /* Number of groups */
@@ -1197,13 +1213,6 @@ cupsdCheckGroup(
if ((int)groupid == (int)groups[i])
return (1);
}
#else
for (i = 0; group->gr_mem[i]; i ++)
{
if (!_cups_strcasecmp(username, group->gr_mem[i]))
return (1);
}
#endif /* HAVE_GETGROUPLIST */
}
else
+12 -11
Ver Arquivo
@@ -568,6 +568,17 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
cupsdLogClient(con, CUPSD_LOG_DEBUG2, "cupsdReadClient: error=%d, used=%d, state=%s, data_encoding=HTTP_ENCODING_%s, data_remaining=" CUPS_LLFMT ", request=%p(%s), file=%d", httpError(con->http), (int)httpGetReady(con->http), httpStateString(httpGetState(con->http)), httpIsChunked(con->http) ? "CHUNKED" : "LENGTH", CUPS_LLCAST httpGetRemaining(con->http), con->request, con->request ? ippStateString(ippGetState(con->request)) : "", con->file);
if (httpError(con->http) == EPIPE && !httpGetReady(con->http) && recv(httpGetFd(con->http), buf, 1, MSG_PEEK) < 1)
{
/*
* Connection closed...
*/
cupsdLogClient(con, CUPSD_LOG_DEBUG, "Closing on EOF.");
cupsdCloseClient(con);
return;
}
if (httpGetState(con->http) == HTTP_STATE_GET_SEND ||
httpGetState(con->http) == HTTP_STATE_POST_SEND ||
httpGetState(con->http) == HTTP_STATE_STATUS)
@@ -577,17 +588,6 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
* connection and we need to shut it down...
*/
if (!httpGetReady(con->http) && recv(httpGetFd(con->http), buf, 1, MSG_PEEK) < 1)
{
/*
* Connection closed...
*/
cupsdLogClient(con, CUPSD_LOG_DEBUG, "Closing on EOF.");
cupsdCloseClient(con);
return;
}
cupsdLogClient(con, CUPSD_LOG_DEBUG, "Closing on unexpected HTTP read state %s.", httpStateString(httpGetState(con->http)));
cupsdCloseClient(con);
return;
@@ -2209,6 +2209,7 @@ cupsdSendError(cupsd_client_t *con, /* I - Connection */
strlcpy(location, httpGetField(con->http, HTTP_FIELD_LOCATION), sizeof(location));
httpClearFields(con->http);
httpClearCookie(con->http);
httpSetField(con->http, HTTP_FIELD_LOCATION, location);
+3 -3
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* Configuration routines for the CUPS scheduler.
*
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 2007-2019 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -729,14 +729,14 @@ cupsdReadConfiguration(void)
MaxClientsPerHost = 0;
MaxLogSize = 1024 * 1024;
MaxRequestSize = 0;
MultipleOperationTimeout = DEFAULT_TIMEOUT;
MultipleOperationTimeout = 900;
NumSystemGroups = 0;
ReloadTimeout = DEFAULT_KEEPALIVE;
RootCertDuration = 300;
Sandboxing = CUPSD_SANDBOXING_STRICT;
StrictConformance = FALSE;
SyncOnClose = FALSE;
Timeout = DEFAULT_TIMEOUT;
Timeout = 900;
WebInterface = CUPS_DEFAULT_WEBIF;
BrowseLocalProtocols = parse_protocols(CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS);
+55 -4
Ver Arquivo
@@ -307,10 +307,12 @@ cupsdCheckJobs(void)
if (cupsdTimeoutJob(job))
continue;
}
cupsdSetJobState(job, IPP_JOB_PENDING, CUPSD_JOB_DEFAULT,
"Job submission timed out.");
cupsdSetJobState(job, IPP_JOB_PENDING, CUPSD_JOB_DEFAULT, "Job submission timed out.");
cupsdLogJob(job, CUPSD_LOG_ERROR, "Job submission timed out.");
}
else
cupsdSetJobState(job, IPP_JOB_PENDING, CUPSD_JOB_DEFAULT, "Job hold expired.");
}
/*
@@ -445,7 +447,7 @@ cupsdCleanJobs(void)
{
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdCleanJobs: Job %d, state=%d, printer=%p, history_time=%d, file_time=%d", job->id, (int)job->state_value, (void *)job->printer, (int)job->history_time, (int)job->file_time);
if ((job->history_time && job->history_time) < JobHistoryUpdate || !JobHistoryUpdate)
if ((job->history_time && job->history_time < JobHistoryUpdate) || !JobHistoryUpdate)
JobHistoryUpdate = job->history_time;
if ((job->file_time && job->file_time < JobHistoryUpdate) || !JobHistoryUpdate)
@@ -4021,6 +4023,45 @@ get_options(cupsd_job_t *job, /* I - Job */
break;
case IPP_TAG_STRING :
{
int length = attr->values[i].unknown.length;
for (valptr = attr->values[i].unknown.data; length > 0; length --)
{
if ((*valptr & 255) < 0x20 || *valptr == 0x7f)
break;
}
if (length > 0)
{
/*
* Encode this string as hex characters...
*/
*optptr++ = '<';
for (valptr = attr->values[i].unknown.data, length = attr->values[i].unknown.length; length > 0; length --)
{
snprintf(optptr, optlength - (size_t)(optptr - options) - 1, "%02X", *valptr & 255);
optptr += 2;
}
*optptr++ = '>';
}
else
{
for (valptr = attr->values[i].unknown.data, length = attr->values[i].unknown.length; length > 0; length --)
{
if (strchr(" \t\n\\\'\"", *valptr))
*optptr++ = '\\';
*optptr++ = *valptr++;
}
}
}
*optptr = '\0';
break;
case IPP_TAG_TEXT :
case IPP_TAG_NAME :
case IPP_TAG_KEYWORD :
@@ -4166,6 +4207,16 @@ ipp_length(ipp_t *ipp) /* I - IPP request */
break;
case IPP_TAG_STRING :
/*
* Octet strings can contain characters that need quoting. We need
* at least 2 * len + 2 characters to cover the quotes and any
* backslashes in the string.
*/
for (i = 0; i < attr->num_values; i ++)
bytes += 2 * (size_t)attr->values[i].unknown.length + 2;
break;
case IPP_TAG_TEXT :
case IPP_TAG_NAME :
case IPP_TAG_KEYWORD :
+23 -2
Ver Arquivo
@@ -749,7 +749,10 @@ main(int argc, /* I - Number of command-line args */
#ifdef HAVE_ONDEMAND
if (OnDemand)
{
stop_scheduler = 1;
break;
}
#endif /* HAVE_ONDEMAND */
DoingShutdown = 1;
@@ -2033,13 +2036,31 @@ service_checkout(int shutdown) /* I - Shutting down? */
#ifdef HAVE_ONDEMAND
if (OnDemand)
{
int shared_printers = 0; /* Do we have shared printers? */
strlcpy(pidfile, CUPS_KEEPALIVE, sizeof(pidfile));
/*
* If printer sharing is on see if there are any actual shared printers...
*/
if (Browsing && BrowseLocalProtocols)
{
cupsd_printer_t *p = NULL; /* Current printer */
for (p = (cupsd_printer_t *)cupsArrayFirst(Printers); p; p = (cupsd_printer_t *)cupsArrayNext(Printers))
{
if (p->shared)
break;
}
shared_printers = (p != NULL);
}
if (cupsArrayCount(ActiveJobs) || /* Active jobs */
WebInterface || /* Web interface enabled */
NeedReload || /* Doing a reload */
(Browsing && BrowseLocalProtocols && cupsArrayCount(Printers)))
/* Printers being shared */
shared_printers) /* Printers being shared */
{
/*
* Create or remove the "keep-alive" file based on whether there are active
+1
Ver Arquivo
@@ -1,6 +1,7 @@
[Unit]
Description=CUPS Scheduler
Documentation=man:cupsd(8)
After=sssd.service
[Service]
ExecStart=@sbindir@/cupsd -l
+5 -10
Ver Arquivo
@@ -1021,8 +1021,7 @@ cupsdLoadAllPrinters(void)
}
else if (!_cups_strcasecmp(line, "Info"))
{
if (value)
cupsdSetString(&p->info, value);
cupsdSetString(&p->info, value ? value : "");
}
else if (!_cups_strcasecmp(line, "MakeModel"))
{
@@ -1031,23 +1030,19 @@ cupsdLoadAllPrinters(void)
}
else if (!_cups_strcasecmp(line, "Location"))
{
if (value)
cupsdSetString(&p->location, value);
cupsdSetString(&p->location, value ? value : "");
}
else if (!_cups_strcasecmp(line, "GeoLocation"))
{
if (value)
cupsdSetString(&p->geo_location, value);
cupsdSetString(&p->geo_location, value ? value : "");
}
else if (!_cups_strcasecmp(line, "Organization"))
{
if (value)
cupsdSetString(&p->organization, value);
cupsdSetString(&p->organization, value ? value : "");
}
else if (!_cups_strcasecmp(line, "OrganizationalUnit"))
{
if (value)
cupsdSetString(&p->organizational_unit, value);
cupsdSetString(&p->organizational_unit, value ? value : "");
}
else if (!_cups_strcasecmp(line, "DeviceURI"))
{
+48 -7
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* Scheduler control program for CUPS.
*
* Copyright 2007-2018 by Apple Inc.
* Copyright 2007-2019 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -36,11 +36,47 @@ int /* O - Exit status */
main(int argc, /* I - Number of command-line args */
char *argv[]) /* I - Command-line arguments */
{
int i, /* Looping var */
int i, j, /* Looping vars */
num_settings; /* Number of settings */
cups_option_t *settings; /* Settings */
cups_option_t *settings, /* Settings */
*setting; /* Current setting */
const char *opt; /* Current option character */
http_t *http; /* Connection to server */
static const char * const disallowed[] =
{ /* List of disallowed directives for cupsd.conf */
"AccessLog",
"CacheDir",
"ConfigFilePerm",
"DataDir",
"DocumentRoot",
"ErrorLog",
"FatalErrors",
"FileDevice",
"FontPath",
"Group",
"Listen",
"LogFilePerm",
"LPDConfigFile",
"PageLog",
"PassEnv",
"Port",
"Printcap",
"PrintcapFormat",
"RemoteRoot",
"RequestRoot",
"ServerBin",
"ServerCertificate",
"ServerKey",
"ServerKeychain",
"ServerRoot",
"SetEnv",
"SMBConfigFile",
"StateDir",
"SystemGroup",
"SystemGroupAuthKey",
"TempDir",
"User"
};
/*
@@ -128,11 +164,16 @@ main(int argc, /* I - Number of command-line args */
usage(argv[i]);
}
if (cupsGetOption("Listen", num_settings, settings) ||
cupsGetOption("Port", num_settings, settings))
for (i = num_settings, setting = settings; i > 0; i --, setting ++)
{
_cupsLangPuts(stderr, _("cupsctl: Cannot set Listen or Port directly."));
return (1);
for (j = 0; j < (int)(sizeof(disallowed) / sizeof(disallowed[0])); j ++)
{
if (!_cups_strcasecmp(setting->name, disallowed[j]))
{
_cupsLangPrintf(stderr, _("cupsctl: Cannot set %s directly."), disallowed[j]);
return (1);
}
}
}
/*
+7 -2
Ver Arquivo
@@ -1488,6 +1488,7 @@ set_printer_options(
(boolval = cupsGetOption("cupsIPPSupplies", num_options,
options)) != NULL)
{
ppdchanged = 1;
wrote_ipp_supplies = 1;
cupsFilePrintf(out, "*cupsIPPSupplies: %s\n",
(!_cups_strcasecmp(boolval, "true") ||
@@ -1498,6 +1499,7 @@ set_printer_options(
(boolval = cupsGetOption("cupsSNMPSupplies", num_options,
options)) != NULL)
{
ppdchanged = 1;
wrote_snmp_supplies = 1;
cupsFilePrintf(out, "*cupsSNMPSupplies: %s\n",
(!_cups_strcasecmp(boolval, "true") ||
@@ -1558,6 +1560,8 @@ set_printer_options(
(boolval = cupsGetOption("cupsIPPSupplies", num_options,
options)) != NULL)
{
ppdchanged = 1;
cupsFilePrintf(out, "*cupsIPPSupplies: %s\n",
(!_cups_strcasecmp(boolval, "true") ||
!_cups_strcasecmp(boolval, "yes") ||
@@ -1568,6 +1572,8 @@ set_printer_options(
(boolval = cupsGetOption("cupsSNMPSupplies", num_options,
options)) != NULL)
{
ppdchanged = 1;
cupsFilePrintf(out, "*cupsSNMPSupplies: %s\n",
(!_cups_strcasecmp(boolval, "true") ||
!_cups_strcasecmp(boolval, "yes") ||
@@ -1582,8 +1588,7 @@ set_printer_options(
* Do the request...
*/
ippDelete(cupsDoFileRequest(http, request, "/admin/",
ppdchanged ? tempfile : file));
ippDelete(cupsDoFileRequest(http, request, "/admin/", ppdchanged ? tempfile : file));
/*
* Clean up temp files... (TODO: catch signals in case we CTRL-C during
+1 -1
Ver Arquivo
@@ -1,5 +1,5 @@
</div>
</div>
<div class="footer">CUPS und das CUPS-Logo sind Warenzeichen der <a href="https://www.apple.com/">Apple Inc.</a> Copyright &copy; 2007-2018 Apple Inc. Alle Rechte vorbehalten.</div>
<div class="footer">CUPS und das CUPS-Logo sind Warenzeichen der <a href="https://www.apple.com/">Apple Inc.</a> Copyright &copy; 2007-2019 Apple Inc. Alle Rechte vorbehalten.</div>
</body>
</html>
+1 -1
Ver Arquivo
@@ -1,5 +1,5 @@
</div>
</div>
<div class="footer">CUPS y el logo de CUPS son marcas registradas de <a href="http://www.apple.com">Apple Inc.</a> Derechos de autor &copy; 2007-2018 Apple Inc. Todos los derechos reservados.</div>
<div class="footer">CUPS y el logo de CUPS son marcas registradas de <a href="http://www.apple.com">Apple Inc.</a> Derechos de autor &copy; 2007-2019 Apple Inc. Todos los derechos reservados.</div>
</body>
</html>
+1 -1
Ver Arquivo
@@ -1,5 +1,5 @@
</div>
</div>
<div class="footer">CUPS et le logo CUPS sont des marques d&eacute;pos&eacute;es de <a href="http://www.apple.com">Apple Inc.</a> CUPS est sous copyright 2007-2018 Apple Inc. Tous droits r&eacute;serv&eacute;s.</div>
<div class="footer">CUPS et le logo CUPS sont des marques d&eacute;pos&eacute;es de <a href="http://www.apple.com">Apple Inc.</a> CUPS est sous copyright 2007-2019 Apple Inc. Tous droits r&eacute;serv&eacute;s.</div>
</body>
</html>
+1 -1
Ver Arquivo
@@ -1,5 +1,5 @@
</div>
</div>
<div class="footer">CUPS and the CUPS logo are trademarks of <a href="http://www.apple.com">Apple Inc.</a> Copyright &copy; 2007-2018 Apple Inc. All rights reserved.</div>
<div class="footer">CUPS and the CUPS logo are trademarks of <a href="http://www.apple.com">Apple Inc.</a> Copyright &copy; 2007-2019 Apple Inc. All rights reserved.</div>
</body>
</html>
+1 -1
Ver Arquivo
@@ -1,5 +1,5 @@
</div>
</div>
<div class="footer">CUPS e sua logo s&atilde;o marcas registradas da <a href="http://www.apple.com">Apple Inc.</a> Copyright &copy; 2007-2018 Apple Inc. Todos os direitos reservados.</div>
<div class="footer">CUPS e sua logo s&atilde;o marcas registradas da <a href="http://www.apple.com">Apple Inc.</a> Copyright &copy; 2007-2019 Apple Inc. Todos os direitos reservados.</div>
</body>
</html>
+1 -1
Ver Arquivo
@@ -1,6 +1,6 @@
</div>
</div>
<div class="footer">CUPS, а так же логотип CUPS являются зарегистрированными торговыми марками
<A HREF="http://www.apple.com">Apple Inc.</A> Авторские права на CUPS принадлежат (2007-2018) компании Apple Inc. Все права защищены.</div>
<A HREF="http://www.apple.com">Apple Inc.</A> Авторские права на CUPS принадлежат (2007-2019) компании Apple Inc. Все права защищены.</div>
</body>
</html>
+1 -1
Ver Arquivo
@@ -1,5 +1,5 @@
</div>
</div>
<div class="footer">CUPS and the CUPS logo are trademarks of <a href="http://www.apple.com">Apple Inc.</a> Copyright &copy; 2007-2018 Apple Inc. All rights reserved.</div>
<div class="footer">CUPS and the CUPS logo are trademarks of <a href="http://www.apple.com">Apple Inc.</a> Copyright &copy; 2007-2019 Apple Inc. All rights reserved.</div>
</body>
</html>
+9 -2
Ver Arquivo
@@ -94,8 +94,8 @@ typedef unsigned long useconds_t;
* Version of software...
*/
#define CUPS_SVERSION "CUPS v2.2.11"
#define CUPS_MINIMAL "CUPS/2.2.11"
#define CUPS_SVERSION "CUPS v2.2.12"
#define CUPS_MINIMAL "CUPS/2.2.12"
/*
@@ -379,6 +379,13 @@ typedef unsigned long useconds_t;
#define HAVE_SSL 1
/*
* Do we have the gnutls_fips140_set_mode function?
*/
/* #undef HAVE_GNUTLS_FIPS140_SET_MODE */
/*
* Do we have the gnutls_transport_set_pull_timeout_function function?
*/
+9 -2
Ver Arquivo
@@ -22,8 +22,8 @@
* Version of software...
*/
#define CUPS_SVERSION "CUPS v2.2.11"
#define CUPS_MINIMAL "CUPS/2.2.11"
#define CUPS_SVERSION "CUPS v2.2.12"
#define CUPS_MINIMAL "CUPS/2.2.12"
/*
@@ -309,6 +309,13 @@
#define HAVE_SSL 1
/*
* Do we have the gnutls_fips140_set_mode function?
*/
/* #undef HAVE_GNUTLS_FIPS140_SET_MODE */
/*
* Do we have the gnutls_transport_set_pull_timeout_function function?
*/