From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Jan 25 06:10:02 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C64CC106566B for ; Mon, 25 Jan 2010 06:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9F2968FC19 for ; Mon, 25 Jan 2010 06:10:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o0P6A2fT045651 for ; Mon, 25 Jan 2010 06:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o0P6A2PG045650; Mon, 25 Jan 2010 06:10:02 GMT (envelope-from gnats) Resent-Date: Mon, 25 Jan 2010 06:10:02 GMT Resent-Message-Id: <201001250610.o0P6A2PG045650@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Andrew Reilly Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AF161065692 for ; Mon, 25 Jan 2010 06:08:21 +0000 (UTC) (envelope-from areilly@bigpond.net.au) Received: from nschwqsrv02p.mx.bigpond.com (nschwqsrv02p.mx.bigpond.com [61.9.189.234]) by mx1.freebsd.org (Postfix) with ESMTP id B2C668FC1E for ; Mon, 25 Jan 2010 06:08:20 +0000 (UTC) Received: from nschwotgx01p.mx.bigpond.com ([124.188.161.100]) by nschwmtas03p.mx.bigpond.com with ESMTP id <20100125051452.JEYG1837.nschwmtas03p.mx.bigpond.com@nschwotgx01p.mx.bigpond.com> for ; Mon, 25 Jan 2010 05:14:52 +0000 Received: from duncan.reilly.home ([124.188.161.100]) by nschwotgx01p.mx.bigpond.com with ESMTP id <20100125051451.KSWL1743.nschwotgx01p.mx.bigpond.com@duncan.reilly.home> for ; Mon, 25 Jan 2010 05:14:51 +0000 Message-Id: <20100125161451.03bf2ea6@duncan.reilly.home> Date: Mon, 25 Jan 2010 16:14:51 +1100 From: Andrew Reilly To: FreeBSD-gnats-submit@FreeBSD.org Cc: Subject: ports/143201: port graphics/sane-backends (snapscan) doesn't like new libusb device syntax X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Andrew Reilly List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2010 06:10:02 -0000 >Number: 143201 >Category: ports >Synopsis: port graphics/sane-backends (snapscan) doesn't like new libusb device syntax >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 25 06:10:02 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Andrew Reilly >Release: FreeBSD 9.0-CURRENT amd64 >Organization: >Environment: System: FreeBSD duncan.reilly.home 9.0-CURRENT FreeBSD 9.0-CURRENT #13: Sat Jan 23 09:35:56 EST 2010 root@duncan.reilly.home:/usr/obj/usr/src/sys/DUNCAN amd64 besides that, I have a USB scanner, reported by sane-find-scanner as: found USB scanner (vendor=0x06bd [AGFA], product=0x2091 [ SNAPSCAN e20 ]) at libusb:/dev/usb:/dev/ugen0.3 >Description: This inexpensive scanner always used to work with the uscanner driver, but stopped working when I moved to -current (for other reasons), and the libusb/ugen scanner environment. The failure mode was always of the form: [sanei_debug] Setting debug level of snapscan to 255. [snapscan] sane_snapscan_init [snapscan] sane_snapscan_init: Snapscan backend version 1.4.53 [snapscan] add_usb_device(libusb:/dev/usb:/dev/ugen0.3) [snapscan] add_usb_device: Detected (kind of) an USB device [snapscan] snapscani_usb_open(libusb:/dev/usb:/dev/ugen0.3) [snapscan] snapscani_mutex_open: could not parse device string: Invalid argument [snapscan] snapscani_usb_open: Can't get semaphore [snapscan] add_usb_device: error opening device libusb:/dev/usb:/dev/ugen0.3: +Invalid argument [snapscan] sane_snapscan_get_devices (0x7fffffffcbe0, 0) [snapscan] sane_snapscan_exit Observation of the offending snapscani_mutex_open() function showd that it wanted a device name of the form libusb::, and it was parsing for that with a simple sscanf(). >How-To-Repeat: Plug in a snapscan USB scanner and try scanimage -L >Fix: I applied the following patch so that at least the scanf would be happy, and that appears to have made the rest of the scanner backend happy too, so now I'm happy: my scanner is useful again! duncan [253]$ pwd /usr/ports/graphics/sane-backends/work/sane-backends-1.0.20/backend duncan [254]$ ls *.orig Makefile.in.orig epson2.c.orig snapscan-mutex.c.orig duncan [255]$ diff -u snapscan-mutex.c.orig snapscan-mutex.c --- snapscan-mutex.c.orig 2008-03-29 07:39:02.000000000 +1100 +++ snapscan-mutex.c 2010-01-25 15:36:47.000000000 +1100 @@ -130,7 +130,7 @@ return 0; } - if (sscanf(dev, "libusb:%d:%d", &busnum, &devnum) != 2) + if (sscanf(dev, "libusb:/dev/usb:/dev/ugen%d.%d", &busnum, &devnum) != 2) { DBG (DL_MAJOR_ERROR, "%s: could not parse device string: %s\n", me, strerror(errno)); return 0; >Release-Note: >Audit-Trail: >Unformatted: