summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--INSTALL2
-rw-r--r--Makefile.in19
-rw-r--r--NEWS19
-rw-r--r--README2
-rw-r--r--aclocal.m4154
-rw-r--r--config.h.in3
-rwxr-xr-xconfigure269
-rw-r--r--configure.ac2
-rw-r--r--filter/foomatic-rip/foomaticrip.c3
-rw-r--r--ltmain.sh4
-rw-r--r--m4/libtool.m412
-rwxr-xr-xmissing4
-rwxr-xr-xtest-driver20
-rw-r--r--utils/cups-browsed.c129
14 files changed, 398 insertions, 244 deletions
diff --git a/INSTALL b/INSTALL
index 8bb20ba05..e28c8f3f3 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,4 +1,4 @@
-INSTALL - OpenPrinting CUPS Filters v1.0.52 - 2014-04-07
+INSTALL - OpenPrinting CUPS Filters v1.0.53 - 2014-04-25
--------------------------------------------------------
This file describes how to compile and install OpenPrinting CUPS
diff --git a/Makefile.in b/Makefile.in
index 3a019c251..c3d9496d5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -1646,8 +1646,8 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps):
config.h: stamp-h1
- @if test ! -f $@; then rm -f stamp-h1; else :; fi
- @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
+ @test -f $@ || rm -f stamp-h1
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
@@ -2270,14 +2270,14 @@ distclean-compile:
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -4345,10 +4345,16 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
@@ -4390,9 +4396,10 @@ distcheck: dist
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
- && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ && ../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
+ --srcdir=.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
diff --git a/NEWS b/NEWS
index 1846e3e4a..4744549ad 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,23 @@
-NEWS - OpenPrinting CUPS Filters v1.0.52 - 2014-04-07
+NEWS - OpenPrinting CUPS Filters v1.0.53 - 2014-04-25
-----------------------------------------------------
+CHANGES IN V1.0.53
+
+ - foomatic-rip: Fixed segfault when creating log file (Bug
+ #1206).
+ - cups-browsed: SECURITY FIX: Fix on usage of the
+ "BrowseAllow" directive in cups-browsed.conf. Before, if the
+ argument of a "BrowseAllow" directive is not understood it
+ is treated as the directive not having been there, allowing
+ any host if this was the only "BrowseAllow" directive. Now
+ we treat this as a directive which no host can fulfill, not
+ allowing any host if it was the only one. No "BrowseAllow"
+ directive means access for all, as before (Bug #1204).
+ - cups-browsed: SECURITY FIX: Further improvement on the fix
+ in 1.0.51 as it was insufficient. In addition, some fixes
+ against OOB access are done. Thanks to Sebastian Krahmer for
+ the patch (SUSE/Novell bug #871327).
+
CHANGES IN V1.0.52
- texttopdf: Make sure that margin changes for prettyprint
diff --git a/README b/README
index dcd410655..4dedee3d6 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-README - OpenPrinting CUPS Filters v1.0.52 - 2014-04-07
+README - OpenPrinting CUPS Filters v1.0.53 - 2014-04-25
-------------------------------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
diff --git a/aclocal.m4 b/aclocal.m4
index a7c6c0f1e..b43c427ee 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.13.3 -*- Autoconf -*-
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
@@ -192,10 +192,10 @@ fi[]dnl
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.13'
+[am__api_version='1.14'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.13.3], [],
+m4_if([$1], [1.14.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -211,7 +211,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.13.3])dnl
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -578,6 +578,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
@@ -686,7 +692,48 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+ fi
+fi])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@@ -694,7 +741,6 @@ dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
@@ -806,38 +852,6 @@ AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_CC_C_O
-# --------------
-# Like AC_PROG_CC_C_O, but changed for automake.
-AC_DEFUN([AM_PROG_CC_C_O],
-[AC_REQUIRE([AC_PROG_CC_C_O])dnl
-AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([compile])dnl
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-dnl Make sure AC_PROG_CC is never called again, or it will override our
-dnl setting of CC.
-m4_define([AC_PROG_CC],
- [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
-])
-
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
@@ -908,6 +922,70 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+ [whether $CC understands -c and -o together],
+ [am_cv_prog_cc_c_o],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
diff --git a/config.h.in b/config.h.in
index 08a9772ee..b19996af5 100644
--- a/config.h.in
+++ b/config.h.in
@@ -160,9 +160,6 @@
*/
#undef LT_OBJDIR
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-#undef NO_MINUS_C_MINUS_O
-
/* Name of package */
#undef PACKAGE
diff --git a/configure b/configure
index 0769bb28a..55ca9fe69 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for cups-filters 1.0.52.
+# Generated by GNU Autoconf 2.69 for cups-filters 1.0.53.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='cups-filters'
PACKAGE_TARNAME='cups-filters'
-PACKAGE_VERSION='1.0.52'
-PACKAGE_STRING='cups-filters 1.0.52'
+PACKAGE_VERSION='1.0.53'
+PACKAGE_STRING='cups-filters 1.0.53'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1438,7 +1438,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-filters 1.0.52 to adapt to many kinds of systems.
+\`configure' configures cups-filters 1.0.53 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1508,7 +1508,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of cups-filters 1.0.52:";;
+ short | recursive ) echo "Configuration of cups-filters 1.0.53:";;
esac
cat <<\_ACEOF
@@ -1698,7 +1698,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-cups-filters configure 1.0.52
+cups-filters configure 1.0.53
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2305,7 +2305,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-filters $as_me 1.0.52, which was
+It was created by cups-filters $as_me 1.0.53, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2741,7 +2741,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#serial 11
-am__api_version='1.13'
+am__api_version='1.14'
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -3256,7 +3256,7 @@ fi
# Define the identity of the package.
PACKAGE='cups-filters'
- VERSION='1.0.52'
+ VERSION='1.0.53'
cat >>confdefs.h <<_ACEOF
@@ -3307,6 +3307,47 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+ fi
+fi
# Check whether --enable-silent-rules was given.
if test "${enable_silent_rules+set}" = set; then :
enableval=$enable_silent_rules;
@@ -4148,6 +4189,65 @@ ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
@@ -4725,131 +4825,6 @@ else
fi
-if test "x$CC" != xcc; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
-$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
-$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
-fi
-set dummy $CC; ac_cc=`$as_echo "$2" |
- sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-# Make sure it works both with $CC and with simple cc.
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-rm -f conftest2.*
-if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
-then
- eval ac_cv_prog_cc_${ac_cc}_c_o=yes
- if test "x$CC" != xcc; then
- # Test first that cc exists at all.
- if { ac_try='cc -c conftest.$ac_ext >&5'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
- rm -f conftest2.*
- if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
- then
- # cc works too.
- :
- else
- # cc exists but doesn't like -o.
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
- fi
- fi
- fi
-else
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
-fi
-rm -f core conftest*
-
-fi
-if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
-
-fi
-
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -7428,7 +7403,7 @@ ia64-*-hpux*)
rm -rf conftest*
;;
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
@@ -7453,7 +7428,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
;;
esac
;;
- ppc64-*linux*|powerpc64-*linux*)
+ powerpc64le-*)
+ LD="${LD-ld} -m elf32lppclinux"
+ ;;
+ powerpc64-*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -7472,7 +7450,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
- ppc*-*linux*|powerpc*-*linux*)
+ powerpcle-*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*|s390*-*tpf*)
@@ -17921,7 +17902,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -17967,7 +17948,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -17991,7 +17972,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -18036,7 +18017,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -18060,7 +18041,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -19331,7 +19312,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-filters $as_me 1.0.52, which was
+This file was extended by cups-filters $as_me 1.0.53, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -19397,7 +19378,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-filters config.status 1.0.52
+cups-filters config.status 1.0.53
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 2eb2efd21..b82421618 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,7 +7,7 @@ AC_PREREQ([2.65])
# ====================
m4_define([cups_filters_version_major],[1])
m4_define([cups_filters_version_minor],[0])
-m4_define([cups_filters_version_micro],[52])
+m4_define([cups_filters_version_micro],[53])
m4_define([cups_filters_version],[cups_filters_version_major.cups_filters_version_minor.cups_filters_version_micro])
# =============
diff --git a/filter/foomatic-rip/foomaticrip.c b/filter/foomatic-rip/foomaticrip.c
index 547ab95c8..028de298d 100644
--- a/filter/foomatic-rip/foomaticrip.c
+++ b/filter/foomatic-rip/foomaticrip.c
@@ -736,7 +736,8 @@ int main(int argc, char** argv)
debug = 1;
if (debug) {
- int fd = mkstemp (LOG_FILE "-XXXXXX.log");
+ sprintf(tmp, "%s-XXXXXX.log", LOG_FILE);
+ int fd = mkstemps (tmp, 4);
if (fd != -1)
logh = fdopen(fd, "w");
else
diff --git a/ltmain.sh b/ltmain.sh
index 3825a2aa4..a356acafa 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -70,7 +70,7 @@
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.3ubuntu1
+# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1
# automake: $automake_version
# autoconf: $autoconf_version
#
@@ -80,7 +80,7 @@
PROGRAM=libtool
PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1.3ubuntu1"
+VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1"
TIMESTAMP=""
package_revision=1.3337
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 02b4bbec5..d7c043f4f 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1312,7 +1312,7 @@ ia64-*-hpux*)
rm -rf conftest*
;;
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
@@ -1333,7 +1333,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
;;
esac
;;
- ppc64-*linux*|powerpc64-*linux*)
+ powerpc64le-*)
+ LD="${LD-ld} -m elf32lppclinux"
+ ;;
+ powerpc64-*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -1352,7 +1355,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
- ppc*-*linux*|powerpc*-*linux*)
+ powerpcle-*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*|s390*-*tpf*)
diff --git a/missing b/missing
index cdea51493..db98974ff 100755
--- a/missing
+++ b/missing
@@ -1,7 +1,7 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2012-06-26.16; # UTC
+scriptversion=2013-10-28.13; # UTC
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
@@ -160,7 +160,7 @@ give_advice ()
;;
autom4te*)
echo "You might have modified some maintainer files that require"
- echo "the 'automa4te' program to be rebuilt."
+ echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
diff --git a/test-driver b/test-driver
index 32bf39e83..d30605660 100755
--- a/test-driver
+++ b/test-driver
@@ -1,7 +1,7 @@
#! /bin/sh
# test-driver - basic testsuite driver script.
-scriptversion=2012-06-27.10; # UTC
+scriptversion=2013-07-13.22; # UTC
# Copyright (C) 2011-2013 Free Software Foundation, Inc.
#
@@ -44,13 +44,12 @@ print_usage ()
Usage:
test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
[--expect-failure={yes|no}] [--color-tests={yes|no}]
- [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT
+ [--enable-hard-errors={yes|no}] [--]
+ TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
END
}
-# TODO: better error handling in option parsing (in particular, ensure
-# TODO: $log_file, $trs_file and $test_name are defined).
test_name= # Used for reporting.
log_file= # Where to save the output of the test script.
trs_file= # Where to save the metadata of the test run.
@@ -69,10 +68,23 @@ while test $# -gt 0; do
--enable-hard-errors) enable_hard_errors=$2; shift;;
--) shift; break;;
-*) usage_error "invalid option: '$1'";;
+ *) break;;
esac
shift
done
+missing_opts=
+test x"$test_name" = x && missing_opts="$missing_opts --test-name"
+test x"$log_file" = x && missing_opts="$missing_opts --log-file"
+test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
+if test x"$missing_opts" != x; then
+ usage_error "the following mandatory options are missing:$missing_opts"
+fi
+
+if test $# -eq 0; then
+ usage_error "missing argument"
+fi
+
if test $color_tests = yes; then
# Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
red='' # Red.
diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c
index c29ff029c..2c5ba3bdc 100644
--- a/utils/cups-browsed.c
+++ b/utils/cups-browsed.c
@@ -95,7 +95,8 @@ typedef struct netif_s {
/* Data structure for browse allow/deny rules */
typedef enum allow_type_e {
ALLOW_IP,
- ALLOW_NET
+ ALLOW_NET,
+ ALLOW_INVALID
} allow_type_t;
typedef struct allow_s {
allow_type_t type;
@@ -420,7 +421,7 @@ create_local_queue (const char *name,
p->name, p->uri);
goto fail;
}
-
+
#if 0
uri_status = httpSeparateURI(HTTP_URI_CODING_ALL, uri,
scheme, sizeof(scheme),
@@ -584,7 +585,7 @@ create_local_queue (const char *name,
/*
* Remove all illegal characters and replace each group of such characters
- * by a single dash
+ * by a single dash, return a free()-able string.
*
* mode = 0: Only allow letters, numbers, and dashes, for turning make/model
* info into a valid print queue name or inro a string which can
@@ -613,6 +614,11 @@ remove_bad_chars(const char *str_orig, /* I - Original string */
return NULL;
str = strdup(str_orig);
+
+ /* for later str[strlen(str)-1] access */
+ if (strlen(str) < 1)
+ return str;
+
for (i = 0, j = 0; i < strlen(str); i++, j++) {
if (((str[i] >= 'A') && (str[i] <= 'Z')) ||
((str[i] >= 'a') && (str[i] <= 'z')) ||
@@ -636,11 +642,14 @@ remove_bad_chars(const char *str_orig, /* I - Original string */
/* Cut off trailing dashes */
while (str[strlen(str)-1] == '-')
str[strlen(str)-1] = '\0';
+
/* Cut off leading dashes */
- while (str[0] == '-')
- str ++;
+ i = 0;
+ while (str[i] == '-')
+ ++i;
- return str;
+ /* keep a free()-able string. +1 for trailing \0 */
+ return memmove(str, str + i, strlen(str) - i + 1);
}
gboolean handle_cups_queues(gpointer unused) {
@@ -737,7 +746,7 @@ gboolean handle_cups_queues(gpointer unused) {
}
if (default_printer_name)
break;
- }
+ }
}
if (default_printer_name &&
!strcasecmp(default_printer_name, p->name)) {
@@ -955,43 +964,52 @@ void generate_local_queue(const char *host,
void *txt) {
char uri[HTTP_MAX_URI];
- char *remote_queue, *remote_host, *pdl = NULL;
+ char *remote_queue = NULL, *remote_host = NULL, *pdl = NULL;
#ifdef HAVE_AVAHI
char *fields[] = { "product", "usb_MDL", "ty", NULL }, **f;
- AvahiStringList *entry;
- char *key, *value;
+ AvahiStringList *entry = NULL;
+ char *key = NULL, *value = NULL;
#endif /* HAVE_AVAHI */
remote_printer_t *p;
- char *backup_queue_name, *local_queue_name = NULL;
- cups_dest_t *dests, *dest;
+ char *backup_queue_name = NULL, *local_queue_name = NULL;
+ cups_dest_t *dests = NULL, *dest = NULL;
int i, num_dests, is_cups_queue;
- const char *val;
+ size_t hl = 0;
+ const char *val = NULL;
is_cups_queue = 0;
+ memset(uri, 0, sizeof(uri));
+
/* Determine the device URI of the remote printer */
- httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri),
+ httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri) - 1,
(strcasestr(type, "_ipps") ? "ipps" : "ipp"), NULL,
host, port, "/%s", resource);
- /* Find the remote host name */
- remote_host = strdup(host);
- if (!strcmp(remote_host + strlen(remote_host) - 6, ".local"))
- remote_host[strlen(remote_host) - 6] = '\0';
- if (!strcmp(remote_host + strlen(remote_host) - 7, ".local."))
- remote_host[strlen(remote_host) - 7] = '\0';
+ /* Find the remote host name.
+ * Used in constructing backup_queue_name, so need to sanitize.
+ * strdup() is called inside remove_bad_chars() and result is free()-able.
+ */
+ remote_host = remove_bad_chars(host, 1);
+ hl = strlen(remote_host);
+ if (hl > 6 && !strcmp(remote_host + hl - 6, ".local"))
+ remote_host[hl - 6] = '\0';
+ if (hl > 7 && !strcmp(remote_host + hl - 7, ".local."))
+ remote_host[hl - 7] = '\0';
/* Check by the resource whether the discovered printer is a CUPS queue */
if (!strncmp(resource, "printers/", 9)) {
/* This is a remote CUPS queue, use the remote queue name for the
local queue */
is_cups_queue = 1;
- remote_queue = resource + 9;
+ /* Not directly used in script generation input later, but taken from packet,
+ * so better safe than sorry. (consider second loop with backup_queue_name) */
+ remote_queue = remove_bad_chars(resource + 9, 0);
debug_printf("cups-browsed: Found CUPS queue: %s on host %s.\n",
remote_queue, remote_host);
} else {
/* This is an IPP-based network printer */
is_cups_queue = 0;
/* Determine the queue name by the model */
- remote_queue = "printer";
+ remote_queue = strdup("printer");
#ifdef HAVE_AVAHI
if (txt) {
for (f = fields; *f; f ++) {
@@ -1018,7 +1036,7 @@ void generate_local_queue(const char *host,
/* Check if there exists already a CUPS queue with the
requested name Try name@host in such a case and if
this is also taken, ignore the printer */
- if ((backup_queue_name = malloc((strlen(remote_queue) +
+ if ((backup_queue_name = malloc((strlen(remote_queue) +
strlen(remote_host) + 2) *
sizeof(char))) == NULL) {
debug_printf("cups-browsed: ERROR: Unable to allocate memory.\n");
@@ -1045,6 +1063,8 @@ void generate_local_queue(const char *host,
uri);
free (remote_host);
free (backup_queue_name);
+ free (pdl);
+ free (remote_queue);
cupsFreeDests(num_dests, dests);
return;
}
@@ -1082,6 +1102,8 @@ void generate_local_queue(const char *host,
local_queue_name);
free (backup_queue_name);
free (remote_host);
+ free (pdl);
+ free (remote_queue);
cupsFreeDests(num_dests, dests);
return;
}
@@ -1157,6 +1179,8 @@ void generate_local_queue(const char *host,
free (backup_queue_name);
free (remote_host);
+ free (pdl);
+ free (remote_queue);
if (p)
debug_printf("cups-browsed: Bonjour IDs: Service name: \"%s\", "
@@ -1228,7 +1252,7 @@ static void resolve_callback(
}
/* Clean up */
-
+
avahi_free(rp_key);
avahi_free(rp_value);
avahi_free(adminurl_key);
@@ -1422,7 +1446,7 @@ void avahi_shutdown() {
avahi_client_free(client);
client = NULL;
}
- if (glib_poll) {
+ if (glib_poll) {
avahi_glib_poll_free(glib_poll);
glib_poll = NULL;
}
@@ -1551,12 +1575,18 @@ found_cups_printer (const char *remote_host, const char *uri,
char local_resource[HTTP_MAX_URI];
char *c;
+ memset(scheme, 0, sizeof(scheme));
+ memset(username, 0, sizeof(username));
+ memset(host, 0, sizeof(host));
+ memset(resource, 0, sizeof(resource));
+ memset(local_resource, 0, sizeof(local_resource));
+
httpSeparateURI (HTTP_URI_CODING_ALL, uri,
- scheme, sizeof(scheme),
- username, sizeof(username),
- host, sizeof(host),
+ scheme, sizeof(scheme) - 1,
+ username, sizeof(username) - 1,
+ host, sizeof(host) - 1,
&port,
- resource, sizeof(resource));
+ resource, sizeof(resource)- 1);
/* Check this isn't one of our own broadcasts */
for (iface = cupsArrayFirst (netifs);
@@ -1600,6 +1630,9 @@ allowed (struct sockaddr *srcaddr)
allow;
allow = cupsArrayNext (browseallow)) {
switch (allow->type) {
+ case ALLOW_INVALID:
+ break;
+
case ALLOW_IP:
switch (srcaddr->sa_family) {
case AF_INET:
@@ -1665,7 +1698,12 @@ process_browse_data (GIOChannel *source,
char remote_host[256];
char uri[1024];
char info[1024];
- char *c;
+ char *c = NULL, *end = NULL;
+
+ memset(packet, 0, sizeof(packet));
+ memset(remote_host, 0, sizeof(remote_host));
+ memset(uri, 0, sizeof(uri));
+ memset(info, 0, sizeof(info));
srclen = sizeof (srcaddr);
got = recvfrom (browsesocket, packet, sizeof (packet) - 1, 0,
@@ -1678,7 +1716,7 @@ process_browse_data (GIOChannel *source,
}
packet[got] = '\0';
- httpAddrString (&srcaddr, remote_host, sizeof (remote_host));
+ httpAddrString (&srcaddr, remote_host, sizeof (remote_host) - 1);
/* Check this packet is allowed */
if (!allowed ((struct sockaddr *) &srcaddr)) {
@@ -1696,28 +1734,42 @@ process_browse_data (GIOChannel *source,
}
info[0] = '\0';
+
+ /* do not read OOB */
+ end = packet + sizeof(packet);
c = strchr (packet, '\"');
+ if (c >= end)
+ return TRUE;
+
if (c) {
/* Skip location field */
- for (c++; *c != '\"'; c++)
+ for (c++; c < end && *c != '\"'; c++)
;
+ if (c >= end)
+ return TRUE;
+
if (*c == '\"') {
- for (c++; isspace(*c); c++)
+ for (c++; c < end && isspace(*c); c++)
;
}
+ if (c >= end)
+ return TRUE;
+
/* Is there an info field? */
if (*c == '\"') {
int i;
c++;
for (i = 0;
- i < sizeof (info) - 1 && *c != '\"';
+ i < sizeof (info) - 1 && *c != '\"' && c < end;
i++, c++)
info[i] = *c;
info[i] = '\0';
}
}
+ if (c >= end)
+ return TRUE;
found_cups_printer (remote_host, uri, info);
recheck_timer ();
@@ -1926,7 +1978,7 @@ send_browse_data (gpointer data)
while (attr && ippGetGroupTag(attr) == IPP_TAG_PRINTER) {
const char *attrname = ippGetName(attr);
int value_tag = ippGetValueTag(attr);
-
+
if (!strcmp(attrname, "printer-type") &&
value_tag == IPP_TAG_ENUM) {
type = ippGetInteger(attr, 0);
@@ -2424,6 +2476,8 @@ read_browseallow_value (const char *value)
char *p;
struct in_addr addr;
allow_t *allow = calloc (1, sizeof (allow_t));
+ if (value == NULL)
+ goto fail;
p = strchr (value, '/');
if (p) {
char *s = strdup (value);
@@ -2466,7 +2520,8 @@ read_browseallow_value (const char *value)
return 0;
fail:
- free (allow);
+ allow->type = ALLOW_INVALID;
+ cupsArrayAdd (browseallow, allow);
return 1;
}
@@ -2570,7 +2625,7 @@ read_configuration (const char *filename)
BrowsePoll[NumBrowsePoll++] = b;
}
}
- } else if (!strcasecmp(line, "BrowseAllow") && value) {
+ } else if (!strcasecmp(line, "BrowseAllow")) {
if (read_browseallow_value (value))
debug_printf ("cups-browsed: BrowseAllow value \"%s\" not understood\n",
value);