Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 513552 - net-print/cups-1.7.1* - configure ignores --disable-usb / automagic dependency on dev-libs/libusb
Summary: net-print/cups-1.7.1* - configure ignores --disable-usb / automagic dependenc...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Printing (show other bugs)
Hardware: AMD64 Linux
: Normal normal with 1 vote (vote)
Assignee: Printing Team
Depends on:
Blocks: CVE-2014-5030
  Show dependency tree
Reported: 2014-06-17 09:37 UTC by Raimonds Cicans
Modified: 2014-09-07 20:49 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---

Build log (cups.log,125.41 KB, text/plain)
2014-06-17 09:40 UTC, Raimonds Cicans
Patch for CUPS to fix libusb detection (cups-1.7.1-fix-libusb-detection.patch,557 bytes, patch)
2014-06-18 16:30 UTC, Raimonds Cicans
Details | Diff
Patch to cups-1.7.1-r1.ebuild (cups-1.7.1-r1.ebuild.patch,355 bytes, patch)
2014-06-18 16:31 UTC, Raimonds Cicans
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raimonds Cicans 2014-06-17 09:37:13 UTC
At build time at configure phase presence of libusb is auto-detected and --disable-usb flag is ignored

Reproducible: Always

Steps to Reproduce:
1.Build net-print/cups with useflag -usb
2. grep build logs for "checking for libusb"

Actual Results:  
"checking for libusb-1.0... yes"

Expected Results:  
"checking for libusb-1.0... no"
or no messages about libusb

Why this bug is important:
this bug broke printing on multi-functional usb devices because by default usb device in /dev/bus/usb/... is assigned to scanner group, so cups do not have access to printer.

In this situation cups should access printer only trough /dev/usblp device

Possible workarounds
1) assign world writable permissions to /dev/bus/usb/... device
2) assign lp user to scanner group

emerge --info:
Portage 2.2.8-r1 (hardened/linux/amd64, gcc-4.7.3, glibc-2.17, 3.13.10-hardened-myrc08 x86_64)
System uname: Linux-3.13.10-hardened-myrc08-x86_64-AMD_Athlon-tm-_II_X2_240e_Processor-with-gentoo-2.2
KiB Mem:     8075992 total,   4289848 free
KiB Swap:   20479996 total,  20479996 free
Timestamp of tree: Tue, 17 Jun 2014 07:15:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
distcc 3.1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.6, 3.3.3
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo sunrise vdr-devel vdr-testing gen2ovl-googoo2 myport
ACCEPT_LICENSE="* -@EULA skype- AdobeFlash-10.3 AdobeFlash-11.x googleearth GIMPS"
CFLAGS="-pipe -march=native -O2 -fforce-addr"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-pipe -march=native -O2 -fforce-addr"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch usersync xattr"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTDIR_OVERLAY="/var/lib/layman/sunrise /var/lib/layman/vdr-devel /var/lib/layman/vdr-testing /var/lib/layman/gen2ovl-googoo2 /usr/local/portage/myport"
USE="3dnow 3dnowext X a52 aac aacplus aacs acl alsa amd64 amr apng ares artworkextra audit binfilter bittorrent bluetooth bluray bzip2 cairo caps cdda cddb cdio chardet chm cli consolekit corefonts cracklib crypt css cups cxx dbus desktopglobe device-mapper djvu dri dts dvb dvd ebook encode exif faac fam ffmpeg flac fpm ftp gif gsm gtk gudev hardened hwdb iconv idn imagemagick inotify ipv6 ithreads javascript jit joystick jpeg jpeg2k justify kde kdepim keymap kipi lcms libass libnotify libv4l liemikuutio lirc lm_sensors logrotate logwatch loop-aes lzma lzo mad marble mem-scramble mikmod minizip mjpeg mktemp mms mmx mmxext mng mod modules mp3 mpeg multilib ncurses network nls nptl nsplugin offlinehelp ogg opengl openmp openvg opus orc pam pax_kernel pcre pcsc pdf pic plasma png policykit postscript qalculate qt3support qt4 quicktime readline rtmp scanner schroedinger sdl secure-delete semantic-desktop session slp smp sndfile speex spell sse sse2 sse3 ssl startup-notification svg system-sqlite tcpd theora threads thumbnail tiff truetype ttxtsubs udev unicode unlock-notify urandom usb v4l vcd vdr vorbis vpx webif x264 xanim xattr xml xscreensaver xtpax xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="ru lv pl en" LIRC_DEVICES="devinput" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="nouveau radeon r300 r600 v4l via" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Comment 1 Raimonds Cicans 2014-06-17 09:40:17 UTC
Created attachment 379116 [details]
Build log
Comment 2 Raimonds Cicans 2014-06-18 16:30:01 UTC
Created attachment 379218 [details, diff]
Patch for CUPS to fix libusb detection
Comment 3 Raimonds Cicans 2014-06-18 16:31:37 UTC
Created attachment 379220 [details, diff]
Patch to cups-1.7.1-r1.ebuild
Comment 4 Raimonds Cicans 2014-06-18 16:34:53 UTC
I attached 2 patches that fix problem for me.
IMHO patches should be applied to all CUPS versions

I also reported problem upstream:
Comment 5 Bernd Feige 2014-07-20 14:29:33 UTC
net-print/cups-1.7.4 is out and includes the upstream "Fix" to issue STR #4439. I must say, having a multifunction printer and -usb, previous versions (including 1.7.3) worked fine for me but 1.7.4 broke USB access. I think it's because upstream decided to use "x$enable_libusb != xno -a $uname != Darwin" instead of "x$enable_libusb == xyes -a $uname != Darwin" as you suggested.
Since the ebuild does not explicitly set enable_libusb=no in the -usb case, this now leads to the wrong behavior for us.
Probable solution: Explicitly specify "no" in the ebuild for -usb.
Comment 6 Andreas K. Hüttel archtester gentoo-dev 2014-09-06 19:05:44 UTC
(In reply to Bernd Feige from comment #5)
> Hello,
> net-print/cups-1.7.4 is out and includes the upstream "Fix" to issue STR
> #4439. I must say, having a multifunction printer and -usb, previous
> versions (including 1.7.3) worked fine for me but 1.7.4 broke USB access. I
> think it's because upstream decided to use "x$enable_libusb != xno -a $uname
> != Darwin" instead of "x$enable_libusb == xyes -a $uname != Darwin" as you
> suggested.
> Since the ebuild does not explicitly set enable_libusb=no in the -usb case,
> this now leads to the wrong behavior for us.
> Probable solution: Explicitly specify "no" in the ebuild for -usb.

Could you please check 1.7.5?
Comment 7 Andreas K. Hüttel archtester gentoo-dev 2014-09-06 19:33:34 UTC
This should be fixed in 1.7.5. If not please reopen.
Comment 9 Andreas K. Hüttel archtester gentoo-dev 2014-09-07 20:49:36 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #8)
> 1.7.5.ebuild?r1=1.1&r2=1.2&diff_format=u
> 1.7.9999.ebuild?r1=1.1&r2=1.2&diff_format=u
> 9999.ebuild?r1=1.61&r2=1.62&diff_format=u
> Above changes make no sense.
> html_node/Package-Options.html :
> "If no argument is given, it defaults to ‘yes’. --disable-feature is
> equivalent to --enable-feature=no."

Indeed, true. I've checked that also 1.7.4 (with the old ebuild) does *not* automagically enable libusb.

Pointless changes in 1.7.5 reverted, marking this bug as invalid instead.