diff options
author | root <root@rshg054.dnsready.net> | 2013-10-29 01:05:02 -0700 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2013-10-29 01:05:02 -0700 |
commit | 38b1ce25596ae456fefb3214a73c3d1005da568f (patch) | |
tree | 5cb69842c94bdd2b34b01be22f97b5949237550f /extra/sane | |
parent | 1a32448c2c53b0e66ce0fe14c5dd2057afd432bc (diff) |
Tue Oct 29 01:04:23 PDT 2013
Diffstat (limited to 'extra/sane')
-rw-r--r-- | extra/sane/PKGBUILD | 14 | ||||
-rw-r--r-- | extra/sane/segfault-avahi-fix-kodakio.patch | 98 |
2 files changed, 108 insertions, 4 deletions
diff --git a/extra/sane/PKGBUILD b/extra/sane/PKGBUILD index b872b91ac..24db28655 100644 --- a/extra/sane/PKGBUILD +++ b/extra/sane/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 195946 2013-10-06 06:58:15Z tpowa $ +# $Id: PKGBUILD 197703 2013-10-28 17:39:46Z tpowa $ # Maintainer: Tobias Powalowski <tpowa@archlinux.org> # Contributor: Sarah Hay <sarahhay@mb.sympatico.ca> # Contributor: Simo L. <neotuli@yahoo.com> @@ -6,7 +6,7 @@ pkgname=sane pkgver=1.0.24 -pkgrel=2 +pkgrel=3 pkgdesc="Scanner Access Now Easy" url="http://www.sane-project.org/" arch=('i686' 'x86_64') @@ -18,13 +18,18 @@ source=(ftp://ftp.archlinux.org/other/sane/$pkgname-backends-$pkgver.tar.gz 'sane.xinetd' 'saned.socket' 'saned.service' - 'network.patch') + 'network.patch' + 'segfault-avahi-fix-kodakio.patch') options=(!libtool) prepare() { cd "${srcdir}/${pkgname}-backends-${pkgver}" # fix http://vasks.debian.org/tracker/?func=detail&atid=410366&aid=313760&group_id=30186 patch -Np1 -i ${srcdir}/network.patch + # fix http://anonscm.debian.org/gitweb/?p=sane/sane-backends.git;a=commit;h=37523b867d411c2f82d08128246be7e38bc9812c + # #37525 + # https://alioth.debian.org/tracker/?group_id=30186&atid=410366&func=detail&aid=314301 + patch -Np1 -i ${srcdir}/segfault-avahi-fix-kodakio.patch } build() { @@ -69,4 +74,5 @@ md5sums=('1ca68e536cd7c1852322822f5f6ac3a4' 'bc2c8b4f7b3012c8936c7da21f60e2ac' 'e57e9e15528f47f5f1b3f1411135ed5d' '3f9fe36b0c4ff0b01b53b1cffa5d9700' - '44e77692c52db15b0f530a1d9a8e1296') + '44e77692c52db15b0f530a1d9a8e1296' + '039524a38af8721f2e97d45e889295ca') diff --git a/extra/sane/segfault-avahi-fix-kodakio.patch b/extra/sane/segfault-avahi-fix-kodakio.patch new file mode 100644 index 000000000..23f9d1ca9 --- /dev/null +++ b/extra/sane/segfault-avahi-fix-kodakio.patch @@ -0,0 +1,98 @@ +From 37523b867d411c2f82d08128246be7e38bc9812c Mon Sep 17 00:00:00 2001 +From: Paul Newall <quandry@ntlworld.com> +Date: Mon, 14 Oct 2013 22:22:53 +0100 +Subject: [PATCH] Bugfix in kodakaio.c to fix segfault when non kodak scanners + return unexpected data via avahi auto discovery + +--- + backend/kodakaio.c | 43 ++++++++++++++++++++++++++++++---------- + doc/descriptions/kodakaio.desc | 2 +- + 3 files changed, 37 insertions(+), 12 deletions(-) + +diff --git a/backend/kodakaio.c b/backend/kodakaio.c +index 8c4583a..b442e50 100644 +--- a/backend/kodakaio.c ++++ b/backend/kodakaio.c +@@ -127,7 +127,7 @@ for ubuntu 12.10 + + #define KODAKAIO_VERSION 02 + #define KODAKAIO_REVISION 4 +-#define KODAKAIO_BUILD 6 ++#define KODAKAIO_BUILD 7 + + /* for usb (but also used for net though it's not required). */ + #define MAX_BLOCK_SIZE 32768 +@@ -2184,6 +2184,7 @@ static void resolve_callback( + AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED void* userdata) { + ++ AvahiStringList *vid_pair_list = NULL, *pid_pair_list = NULL; + char *pidkey, *pidvalue; + char *vidkey, *vidvalue; + size_t valuesize; +@@ -2204,20 +2205,40 @@ static void resolve_callback( + avahi_address_snprint(a, sizeof(a), address); + + /* Output short for Kodak ESP */ +- DBG(min(10,DBG_AUTO), "%s:%u %s ", a,port,host_name); +- avahi_string_list_get_pair(avahi_string_list_find(txt, "vid"), +- &vidkey, &vidvalue, &valuesize); +- DBG(min(10,DBG_AUTO), "%s=%s ", vidkey, vidvalue); +- avahi_string_list_get_pair(avahi_string_list_find(txt, "pid"), +- &pidkey, &pidvalue, &valuesize); +- DBG(min(10,DBG_AUTO), "%s=%s\n", pidkey, pidvalue); ++ DBG(min(10,DBG_AUTO), "%s:%u %s\n", a,port,host_name); + ++ vid_pair_list = avahi_string_list_find(txt, "vid"); ++ if(vid_pair_list != NULL) { ++ avahi_string_list_get_pair(vid_pair_list, &vidkey, &vidvalue, &valuesize); ++ DBG(min(10,DBG_AUTO), "%s=%s ", vidkey, vidvalue); ++ } ++ else DBG(min(10,DBG_AUTO), "failed to find key vid\n"); ++ ++ pid_pair_list = avahi_string_list_find(txt, "pid"); ++ if(pid_pair_list != NULL) { ++ avahi_string_list_get_pair(pid_pair_list, &pidkey, &pidvalue, &valuesize); ++ DBG(min(10,DBG_AUTO), "%s=%s\n", pidkey, pidvalue); ++ } ++ else DBG(min(10,DBG_AUTO), "failed to find key pid\n"); ++ ++ if(pid_pair_list != NULL && vid_pair_list != NULL) { + ProcessAvahiDevice(name, vidvalue, pidvalue, a); +- avahi_free(vidkey); avahi_free(vidvalue); +- avahi_free(pidkey); avahi_free(pidvalue); ++ } ++ else DBG(min(10,DBG_AUTO), "didn't call ProcessAvahiDevice\n"); ++ ++ if(vid_pair_list != NULL) { ++ avahi_free(vidkey); ++ avahi_free(vidvalue); ++ DBG(min(15,DBG_AUTO), "vidkey and vidvalue freed\n"); ++ } ++ if(pid_pair_list != NULL) { ++ avahi_free(pidkey); ++ avahi_free(pidvalue); ++ DBG(min(15,DBG_AUTO), "pidkey and pidvalue freed\n"); ++ } + } + } +- ++ DBG(min(10,DBG_AUTO), "ending resolve_callback\n"); + avahi_service_resolver_free(r); + } + +diff --git a/doc/descriptions/kodakaio.desc b/doc/descriptions/kodakaio.desc +index 7882513..5fb18ed 100644 +--- a/doc/descriptions/kodakaio.desc ++++ b/doc/descriptions/kodakaio.desc +@@ -1,6 +1,6 @@ + :backend "kodakaio" + :url "http://sourceforge.net/projects/cupsdriverkodak/" +-:version "2.4.6" ++:version "2.4.7" + :manpage "sane-kodakaio" + :comment "Backend for Kodak AiO ESP and Hero printers. Also possibly Advent AWL10" + :devicetype :scanner +-- +1.7.10.4 + |