Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 148989 - app-crypt/bestcrypt-1.6p5 - module names contain quotes
Summary: app-crypt/bestcrypt-1.6p5 - module names contain quotes
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Crypto team [DISABLED]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-24 13:51 UTC by Stefan Behte (RETIRED)
Modified: 2006-10-15 12:06 UTC (History)
0 users

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


Attachments
bestcrypt-rmmod patch (bcrypt.diff,423 bytes, text/plain)
2006-09-24 13:59 UTC, Stefan Behte (RETIRED)
Details
bestcrypt-1.6_p5-kernel-quotes.patch (bestcrypt-1.6_p5-kernel-quotes.patch,518 bytes, patch)
2006-10-09 00:14 UTC, Alon Bar-Lev (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Behte (RETIRED) gentoo-dev Security 2006-09-24 13:51:13 UTC
[root@lato ~]# /etc/init.d/bcrypt stop
 * Unmounting encrypted filesystems ...                                                                           [ ok ]
 * Shutting down BestCrypt modules ...
ERROR: Module bc is in use by "bc_serpent","bc_rc6","bc_cast","bc_rijn","bc_idea","bc_3des","bc_bf128","bc_bf448","bc_twofish","bc_gost","bc_des","bc_blowfish"                                                                           [ !! ]

I looked at the init script (/etc/init.d/bcrypt) and found this line:

        ebegin "Shutting down BestCrypt modules"
        for i in `lsmod |egrep "^bc_.*" |awk '{print $1}' `; do 
                rmmod $i
        done

Then I looked at the output of lsmod and found what's wrong:
orinoco_cs             13444  1 
orinoco                33780  1 orinoco_cs
hermes                  5792  2 orinoco_cs,orinoco
pcmcia                 27428  5 orinoco_cs
firmware_class          7040  1 pcmcia
crc32                   3744  1 pcmcia
yenta_socket           20812  6 
rsrc_nonstatic          9568  1 yenta_socket
pcmcia_core            31344  4 orinoco_cs,pcmcia,yenta_socket,rsrc_nonstatic
"bc_serpent"           12580  0 
"bc_rc6"               12420  0 
"bc_cast"              18372  0 
"bc_rijn"              32004  0 
"bc_idea"               5828  0 
"bc_3des"              15204  0 
"bc_bf128"             10404  0 
"bc_bf448"             10404  0 
"bc_twofish"           17824  0 
"bc_gost"               5572  0 
"bc_des"               14852  0 
"bc_blowfish"          10404  0 
bc                     12388  12 "bc_serpent","bc_rc6","bc_cast","bc_rijn","bc_idea","bc_3des","bc_bf128","bc_bf448","bc_twofish","bc_gost","bc_des","bc_blowfish"

The lines begin with "bc_* and you cannot do this:
rmmod bc_serpent
or:
rmmod "bc_serpent"
Both fail, because the shell interprets the quotes and thus ARGV[1] in rmmod will just be bc_serpent which is wrong because the name (see: cat /proc/modules) is "bc_serpent".
So you have to do:
rmmod \"bc_serpent\"
Other modules I've loaded which depend on others don't have quotes at all. I don't know why the bc_modules have them, and I'm very sure they didn't always have them. Maybe that's because of a change in sys-apps/module-init-tools? I have no clue...

The original init script from jetico also contains the same line as the gentoo init script so it also won't shutdown the modules correctly.

Here is the fix which I also attached as "diff -u":

       for module in `echo $(grep ^\"bc_.*\" /proc/modules | awk -F\" '{print $2}')`
       do
               rmmod \"${module}\"
       done

Someone please update it in portage.
Comment 1 Stefan Behte (RETIRED) gentoo-dev Security 2006-09-24 13:59:04 UTC
Created attachment 97978 [details]
bestcrypt-rmmod patch
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2006-10-08 22:44:48 UTC
Hello,
I don't understand where did the quotes come from.
Can you please try to remove all module and load one your-self:
modprobe bc_des
lsmod
And see if quotes appear?
Comment 3 Stefan Behte (RETIRED) gentoo-dev Security 2006-10-08 23:24:44 UTC
[root@nuw ~]# lsmod
Module                  Size  Used by
parport_pc             23620  0 
parport                23552  1 parport_pc
8250_pnp                8704  0 
8250                   19860  1 8250_pnp
serial_core            19776  1 8250
nvidia               4543892  12 
[root@nuw ~]# modprobe bc_des
[root@nuw ~]# lsmod
Module                  Size  Used by
"bc_des"               14820  0 
bc                     12740  1 "bc_des"
parport_pc             23620  0 
parport                23552  1 parport_pc
8250_pnp                8704  0 
8250                   19860  1 8250_pnp
serial_core            19776  1 8250
nvidia               4543892  12 

I really don't have a clue why it has quotes.
Comment 4 Alon Bar-Lev (RETIRED) gentoo-dev 2006-10-09 00:14:13 UTC
Created attachment 99176 [details, diff]
bestcrypt-1.6_p5-kernel-quotes.patch

Can you please try the attached patch?
Comment 5 Stefan Behte (RETIRED) gentoo-dev Security 2006-10-09 08:40:25 UTC
Sure, if you tell me how to apply it.
I'm a hobby-coder but don't know much about diff'ing and so on and I guess it takes only a minute or so to answer this but for me it would take (maybe) an hour to find out how to do it properly.
Comment 6 Alon Bar-Lev (RETIRED) gentoo-dev 2006-10-09 09:00:16 UTC
Here:
1. Modify /etc/make.conf, Add:
PORTDIR_OVERLAY="/usr/local/portage"
2. Copy ebuild from main tree to your local overlay:
mkdir -p /usr/local/portage/app-crypt
cd /usr/local/portage/app-crypt
cp -a /usr/portage/app-crypt/bestcrypt .
cd bestcrypt
3. Put attachment#99176 [details, diff] in files (of ebuild) directory.
4. Modify ebuild:
Find
src_unpack()
     unpack ${A}
Add right after:
     epatch "${FILESDIR}"/${P}-kernel-quotes.patch
5. Digest ebuild
ebuild bestcrypt-1.6_p5.ebuild digest
6. Re-emerge
emerge --oneshot bestcrypt
7. Test
Comment 7 Stefan Behte (RETIRED) gentoo-dev Security 2006-10-10 11:10:31 UTC
emerge --oneshot bestcrypt
Calculating dependencies... done!

>>> Emerging (1 of 1) app-crypt/bestcrypt-1.6_p5 to /
 * bcrypt-rc6-serpent.diff.gz MD5 ;-) ...                                                                                                               [ ok ]
 * bcrypt-rc6-serpent.diff.gz RMD160 ;-) ...                                                                                                            [ ok ]
 * bcrypt-rc6-serpent.diff.gz SHA1 ;-) ...                                                                                                              [ ok ]
 * bcrypt-rc6-serpent.diff.gz SHA256 ;-) ...                                                                                                            [ ok ]
 * bcrypt-rc6-serpent.diff.gz size ;-) ...                                                                                                              [ ok ]
 * BestCrypt-1.6-5.tar.gz MD5 ;-) ...                                                                                                                   [ ok ]
 * BestCrypt-1.6-5.tar.gz RMD160 ;-) ...                                                                                                                [ ok ]
 * BestCrypt-1.6-5.tar.gz SHA1 ;-) ...                                                                                                                  [ ok ]
 * BestCrypt-1.6-5.tar.gz SHA256 ;-) ...                                                                                                                [ ok ]
 * BestCrypt-1.6-5.tar.gz size ;-) ...                                                                                                                  [ ok ]
 * checking ebuild checksums ;-) ...                                                                                                                    [ ok ]
 * checking auxfile checksums ;-) ...                                                                                                                   [ ok ]
 * checking miscfile checksums ;-) ...                                                                                                                  [ ok ]
 * checking BestCrypt-1.6-5.tar.gz ;-) ...                                                                                                              [ ok ]
 * checking bcrypt-rc6-serpent.diff.gz ;-) ...                                                                                                          [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     2.6.17-gentoo-r4
>>> Unpacking source...
>>> Unpacking BestCrypt-1.6-5.tar.gz to /var/tmp/portage/bestcrypt-1.6_p5/work
>>> Unpacking bcrypt-rc6-serpent.diff.gz to /var/tmp/portage/bestcrypt-1.6_p5/work
 * Applying bestcrypt-1.6_p5-kernel-quotes.patch ...

 * Failed Patch: bestcrypt-1.6_p5-kernel-quotes.patch !
 *  ( /usr/local/portage/app-crypt/bestcrypt/files/bestcrypt-1.6_p5-kernel-quotes.patch )
 * 
 * Include in your bugreport the contents of:
 * 
 *   /var/tmp/portage/bestcrypt-1.6_p5/temp/bestcrypt-1.6_p5-kernel-quotes.patch-7829.out


!!! ERROR: app-crypt/bestcrypt-1.6_p5 failed.
Call stack:
  ebuild.sh, line 1546:   Called dyn_unpack
  ebuild.sh, line 708:   Called src_unpack
  bestcrypt-1.6_p5.ebuild, line 40:   Called epatch '/usr/local/portage/app-crypt/bestcrypt/files/bestcrypt-1.6_p5-kernel-quotes.patch'
  eutils.eclass, line 341:   Called die

!!! Failed Patch: bestcrypt-1.6_p5-kernel-quotes.patch!
!!! If you need support, post the topmost build error, and the call stack if relevant.

!!! This ebuild is from an overlay: '/usr/local/portage'





/var/tmp/portage/bestcrypt-1.6_p5/temp/bestcrypt-1.6_p5-kernel-quotes.patch-7829.out:

!!! ERROR: app-crypt/bestcrypt-1.6_p5 failed.
Call stack:
  ebuild.sh, line 1546:   Called dyn_unpack
  ebuild.sh, line 708:   Called src_unpack
  bestcrypt-1.6_p5.ebuild, line 40:   Called epatch '/usr/local/portage/app-crypt/bestcrypt/files/bestcrypt-1.6_p5-kernel-quotes.patch'
  eutils.eclass, line 341:   Called die

!!! Failed Patch: bestcrypt-1.6_p5-kernel-quotes.patch!
!!! If you need support, post the topmost build error, and the call stack if relevant.

!!! This ebuild is from an overlay: '/usr/local/portage'
[root@nuw /usr/local/portage/app-crypt/bestcrypt]# cat /var/tmp/portage/bestcrypt-1.6_p5/temp/bestcrypt-1.6_p5-kernel-quotes.patch-7829.out
***** bestcrypt-1.6_p5-kernel-quotes.patch *****

================================================

PATCH COMMAND:  patch -p0 -g0 -E --no-backup-if-mismatch < /usr/local/portage/app-crypt/bestcrypt/files/bestcrypt-1.6_p5-kernel-quotes.patch

================================================
patching file bcrypt/mod/Makefile.alg
patch: **** malformed patch at line 13:  endif

================================================

PATCH COMMAND:  patch -p1 -g0 -E --no-backup-if-mismatch < /usr/local/portage/app-crypt/bestcrypt/files/bestcrypt-1.6_p5-kernel-quotes.patch

================================================
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urNp bcrypt.org/mod/Makefile.alg bcrypt/mod/Makefile.alg
|--- bcrypt.org/mod/Makefile.alg        2006-04-12 08:32:39.000000000 +0300
|+++ bcrypt/mod/Makefile.alg    2006-10-09 09:12:34.000000000 +0200
--------------------------
No file to patch.  Skipping patch.
patch: **** malformed patch at line 13:  endif

================================================

PATCH COMMAND:  patch -p2 -g0 -E --no-backup-if-mismatch < /usr/local/portage/app-crypt/bestcrypt/files/bestcrypt-1.6_p5-kernel-quotes.patch

================================================
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urNp bcrypt.org/mod/Makefile.alg bcrypt/mod/Makefile.alg
|--- bcrypt.org/mod/Makefile.alg        2006-04-12 08:32:39.000000000 +0300
|+++ bcrypt/mod/Makefile.alg    2006-10-09 09:12:34.000000000 +0200
--------------------------
No file to patch.  Skipping patch.
patch: **** malformed patch at line 13:  endif

================================================

PATCH COMMAND:  patch -p3 -g0 -E --no-backup-if-mismatch < /usr/local/portage/app-crypt/bestcrypt/files/bestcrypt-1.6_p5-kernel-quotes.patch

================================================
missing header for unified diff at line 4 of patch
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urNp bcrypt.org/mod/Makefile.alg bcrypt/mod/Makefile.alg
|--- bcrypt.org/mod/Makefile.alg        2006-04-12 08:32:39.000000000 +0300
|+++ bcrypt/mod/Makefile.alg    2006-10-09 09:12:34.000000000 +0200
--------------------------
No file to patch.  Skipping patch.
patch: **** malformed patch at line 13:  endif

================================================

PATCH COMMAND:  patch -p4 -g0 -E --no-backup-if-mismatch < /usr/local/portage/app-crypt/bestcrypt/files/bestcrypt-1.6_p5-kernel-quotes.patch

================================================
missing header for unified diff at line 4 of patch
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urNp bcrypt.org/mod/Makefile.alg bcrypt/mod/Makefile.alg
|--- bcrypt.org/mod/Makefile.alg        2006-04-12 08:32:39.000000000 +0300
|+++ bcrypt/mod/Makefile.alg    2006-10-09 09:12:34.000000000 +0200
--------------------------
No file to patch.  Skipping patch.
patch: **** malformed patch at line 13:  endif
Comment 8 Alon Bar-Lev (RETIRED) gentoo-dev 2006-10-11 00:42:09 UTC
Thank for the info!
But I think the only way it can happen is if you touched the patch file before you added it to portage... There should be a single space before the endif... And it was removed/modified.

Please try again... Click the attachment, save it directly into:
/usr/local/portage/app-crypt/bestcrypt/files
Don't edit.

And:
cd /usr/local/portage/app-crypt/bestcrypt
ebuild bestcrypt-1.6_p5.ebuild digest
emerge --oneshot bestcrypt
Comment 9 Stefan Behte (RETIRED) gentoo-dev Security 2006-10-11 11:28:02 UTC
Wow, strange. Now:

[...]
 * 
 * Updating module dependencies for 2.6.17-gentoo-r4 ...
WARNING: //lib/modules/2.6.17-gentoo-r4/block/bc.ko needs unknown symbol strcpy                                                                         [ ok ]
 * Adding module to moduledb.
>>> Regenerating /etc/ld.so.cache...
>>> app-crypt/bestcrypt-1.6_p5 merged.

>>> No packages selected for removal by clean.


[root@nuw /usr/local/portage/app-crypt/bestcrypt]# modprobe bc
FATAL: Error inserting bc (/lib/modules/2.6.17-gentoo-r4/block/bc.ko): Invalid module format
[root@nuw /usr/local/portage/app-crypt/bestcrypt]# emerge info
*** Deprecated use of action 'info', use '--info' instead
Portage 2.1.1 (default-linux/x86/2006.0, gcc-4.1.1, glibc-2.4-r3, 2.6.17-gentoo-r4 i686)
=================================================================
System uname: 2.6.17-gentoo-r4 i686 AMD Athlon(tm) XP 2400+
Gentoo Base System version 1.12.5
Last Sync: Sun, 08 Oct 2006 11:30:07 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.2.11-r1
dev-lang/python:     2.3.5-r2, 2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -march=athlon-xp -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-Os -march=athlon-xp -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo/ ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo/ ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo"
LANG="de_DE@euro"
LC_ALL="de_DE@euro"
LINGUAS="de"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow 3dnowext X a52 aac acpi alsa amr apache2 apm arts asf berkdb bitmap-fonts bzip2 bzlib cdb cdparanoia cdr cli crypt cups curl dga directfb divx4linux dlloader dri dvd dvdr dvdread eds elibc_glibc emboss encode ethereal fbcon ffmpeg flac foomaticdb fortran ftp gcj gdbm gif gpm gstreamer gtk gtk2 icq imagemagick imlib input_devices_keyboard input_devices_mouse isdnlog java jikes jpeg kernel_linux libg++ libwww linguas_de mad mikmod mime mjpeg mmx mmxext motif mp3 mpeg mtrr musepack ncurses network nls nptl nptlonly nsplugin nvidia ogg oggvorbis opengl oss pam pcre perl png pppd print python qt3 qt4 quicktime readline real reflection samba sdl session snmp sockets spell spl sse ssl svga tcpd theora tiff truetype truetype-fonts type1-fonts udev usb userland_GNU userlocales vcd video_cards_nv video_cards_nvidia vorbis win32codecs x264 xine xinerama xml xmms xorg xprint xv xvid zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

Well after that I re-emerge bestcrypt without the portage overlay. Unfortunately, bestcrypt don't seem to work with kernel 2.6.17 to which I updated recently. I deleted the old version and I don't want to downgrade again. *Very* bad luck for me...

see http://bugs.gentoo.org/show_bug.cgi?id=149483



Comment 10 Alon Bar-Lev (RETIRED) gentoo-dev 2006-10-15 12:06:59 UTC
The patch works.
Closing.