Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 349503 - app-crypt/ekeyd-1.1.3-r1: udev rules can't handle a / character in the serial number of the key
Summary: app-crypt/ekeyd-1.1.3-r1: udev rules can't handle a / character in the serial...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Diego Elio Pettenò (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-23 16:22 UTC by Daniel Weigert
Modified: 2012-05-12 19:31 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Weigert 2010-12-23 16:22:14 UTC
After successfully building and installing ekeyd, the device nodes wouldn't be created (Unix Socket under /dev/entropykey).  The  ekey-rekey utility fails with the following message: *Serial number and master key altered*

ekey-rekey M/XXXXXXXXXXXXXD XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Unable to find any device node or socket for M/XXXXXXXXXXXXXD
Looked in: /dev/entropykey/M.XXXXXXXXXXXXXD /dev/entropykey/M_XXXXXXXXXXXXXD /var/run/entropykeys/M.XXXXXXXXXXXXXD /var/run/entropykeys/M_XXXXXXXXXXXXXD


Reproducible: Always

Steps to Reproduce:
1.Emerge package successfully
2.insert key with offending serial number
3.fail to enter master key because the /dev/entropykey/serialnumber socket can't be created

Actual Results:  
ekey-rekey M/XXXXXXXXXXXXXD XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Unable to find any device node or socket for M/XXXXXXXXXXXXXD
Looked in: /dev/entropykey/M.XXXXXXXXXXXXXD /dev/entropykey/M_XXXXXXXXXXXXXD /var/run/entropykeys/M.XXXXXXXXXXXXXD /var/run/entropykeys/M_XXXXXXXXXXXXXD


Expected Results:  
The udev entry should have replaced the / character with a . or an _ character.

/etc/udev/rules.d/70-ekey-ulusbd.rules
======================================
# Simtec Electronics UDEKEY01 Rules for udev
# Alternative UDEV rules for the unix-domain-socket mode instead of relying on cdc-acm

# Detect an Entropy Key being inserted
# ACTION=="add", SUBSYSTEM=="usb", DEVTYPE=="usb_device", ATTRS{idVendor}=="20df", ATTRS{idProduct}=="0001", IMPORT{program}="usb_id --export %p"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="20df", ATTRS{idProduct}=="0001", IMPORT{program}="/bin/echo ENTROPY_KEY_SERIAL=$attr{serial}"   <----------<< This line needs to account for the / in the serial number

# And tell the ekeyd about the new device.
ACTION=="add|change", ENV{ENTROPY_KEY_SERIAL}!="", RUN+="/lib/udev/ekeyd-udev"

# And remove the entropy key from the daemon on device removal
ACTION=="remove", ENV{ENTROPY_KEY_SERIAL}!="", RUN+="/lib/udev/ekeyd-udev"

# emerge --info
Portage 2.1.9.25 (default/linux/amd64/10.0/desktop, gcc-4.4.5, glibc-2.12.1-r3, 2.6.36-gentoo-r5 x86_64)
=================================================================
System uname: Linux-2.6.36-gentoo-r5-x86_64-Dual_Core_AMD_Opteron-tm-_Processor_875_HE-with-gentoo-2.0.1
Timestamp of tree: Mon, 20 Dec 2010 17:00:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 1.3.7-r1, 2.1.11-r3
dev-lang/python:     2.4.6, 2.5.4-r4, 2.6.6-r1, 2.7.1, 3.1.3
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.6.8
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.4_p6, 1.5, 1.6.3::<unknown repository>, 1.7.9-r1, 1.8.5-r3, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.1.2, 4.2.4, 4.3.3-r2, 4.4.5, 4.5.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4-r1
sys-devel/make:      3.82
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 RTCW-ETEULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=opteron -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/red5/conf /usr/share/config /var/lib/red5-webapps"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=opteron -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo ftp://gentoo.mirrors.pair.com/ http://mirror.datapipe.net/gentoo http://mirror.clarkson.edu/pub/distributions/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X a52 aac acl acpi alsa amd64 apache2 asf avahi berkdb bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus device-mapper dlloader dri dts dvd dvdr dvdread emboss encode esd exif extras f77 fam ffmpeg firefox flac fontconfig fortran freetype g77 gdbm gdu gif gnome gnutls gphoto2 gpm gsm gtk gtk2 h264 h323 hal iconv ieee1394 ipv6 jack jingle jpeg jpeg2k juju lcms libnotify lzo mad mikmod mjpej mmx mng modplug modules mp3 mp4 mpeg msn mudflap multilib mysql ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pango pcre pdf perl pic pipechan png policykit ppds pppd pulseaudio python qt qt3 qt3support qt4 quicktime readline sdk sdl secure-delete session sip sndfile spell sqlite sse sse2 ssl startup-notification svg sysfs tcltk tcpd theora threads tiff truetype unicode usb v4l v4l2 vdpau vorbis wav webkit x264 xcb xcomposite xfs xine xinerama xml xorg xulrunner xv xvid xvmc yahoo zlib" ALSA_CARDS="emu10k1 intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" 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 ubx" INPUT_DEVICES="keyboard mouse wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-2" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" 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" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-12-26 18:12:31 UTC
Sorry, but which udev file have you been using? While I can't say there isn't a problem with / in serial numbers right now, that looks like the original ekey udev file, which is not what we ship for ulusb anyway.

I'll see what I can do exactly though.
Comment 2 Daniel Weigert 2010-12-26 21:54:53 UTC
It probably is the original, I'll re-emerge ulusb and see what is put in place.

Comment 3 Daniel Weigert 2010-12-26 23:46:06 UTC
Ok, I emerged everything that was a dependency for ekeyd, and no changes.  Which package am I missing?
Comment 4 Daniel Weigert 2011-01-20 03:34:38 UTC
I've re-arranged things to use the userland USB method.  The ekey-rekey command hangs when attempting to put the master key in.

ekey-rekey --device=/dev/bus/usb/002/004 M/XXXXXXXXXXXXXD XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I left it running for many hours, it never came back, and used 100% of one core.

Any ideas?
Comment 5 Daniel Weigert 2011-01-20 03:36:46 UTC
Actually, ekey-setkey is using 100% of the core.

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
18202 root      20   0  3944  616  520 R  100  0.0   2:38.84 ekey-setkey 

Dan
Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-09-05 20:12:40 UTC
Can you check the current 1.1.4? I'm afraid that if it still doesn't work it's something only upstream can fix :(
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-05-12 19:31:06 UTC
Daniel if I remember this is working correctly now, so closing.