Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 101279 - erroneous parsing of /etc/conf.d/wireless breaks processing of ESSIDs with "." (possibly other chars?)
Summary: erroneous parsing of /etc/conf.d/wireless breaks processing of ESSIDs with "....
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-03 19:59 UTC by Paulo Lício de Geus
Modified: 2005-08-04 11:59 UTC (History)
1 user (show)

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 Paulo Lício de Geus 2005-08-03 19:59:07 UTC
/etc/conf.d/wireless
...
key_Fisl6="s:abcdef0123456 enc open"
key_home.las="s:1234560abcdef enc open"

Processing breaks as follows:

root@rodio ~ # /etc/init.d/net.wlan0 restart
 * Caching service dependencies ...                                            
     [ ok ]
 * Starting wlan0
+++ key_Fisl6='s:abcdef0123456 enc open'
+++ 'key_home.las=s:1234560abcdef enc open'
/etc/conf.d/wireless: line 147: key_home.las=s:1234560abcdef enc open: command
not found
+++ set +x
 *   Configuring wireless network for wlan0
 *     no access points found
 *   Couldn't find any access points on wlan0
 *   Failed to configure wireless for wlan0                                    
     [ !! ]
root@rodio ~ #                                               

Notice how "key_home.las" is being interpreted by following the "'". If the
ESSID does not contain a "." the parsing is normal and the config works OK. 

Reproducible: Always
Steps to Reproduce:
1. Use default /etc/init.d/net | wireless (baselayout-1.11.13) 
2. Define keys for the two ESSIDs as in the beginning of the "Details" above.
3. /etc/init.d/net.wlan0 start (substitute net.eth1 or similar for net.wlan0)

Actual Results:  
+++ 'key_home.las=s:1234560abcdef enc open'
/etc/conf.d/wireless: line 147: key_home.las=s:1234560abcdef enc open: command
not found

Expected Results:  
With a proper wireless card and with a ESSID without "."s, the interface is
correctly configured as expected.

Gentoo Base System version 1.6.13
Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r0,
2.6.11-gentoo-r11 i686)
=================================================================
System uname: 2.6.11-gentoo-r11 i686 Intel(R) Pentium(R) M processor 1.80GHz
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.10
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -march=pentium3 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-Os -march=pentium3 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://www.las.ic.unicamp.br/pub/gentoo
http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage-mine"
SYNC="rsync://localhost/gentoo-portage"
USE="x86 S3TC X X509 Xaw3d a52 aac aalib accessibility acl acpi alsa apache2 apm
arts artswrappersuid audiofile autofs avi bash-completion berkdb bindist
bitmap-fonts bonobo calendar caps cddb cdparanoia cdr codecs cpdflib crypt cups
curl devmap dga distcache distribution divx4linux dnd doc dts dumb-allegro dv
dvd dvdr dvdread dxr3 edl eds emacs emacs-w3 emboss encode escreen esd ethereal
etwin evms2 evo extensions faac faad fam fbdev ffmpeg flac foomaticdb
foreign-package foreign-sysvinit fortran gb gcj gd gdbm geoip gif gimp gimpprint
ginac gmtfull gmthigh gmtsuppl gmttria gnome gnuplot gphoto2 gpm gps gs
gstreamer gtk gtk2 gtkhtml icu idea ieee1394 imap imlib imlib2 inifile intl ipv6
ithreads jabber jack java javascript jboss jce jikes jit jp2 jpeg jpeg2k kde
kdeenablefinal kdepim kerberos krb4 lcms leim libcaca libg++ libwww live lua
lufsusermount lzo lzw lzw-tiff mad maildir mailwrapper make-busybox-symlinks
mbox md5sum mdb mikmod mjpeg mldonkeypango mmx mmx2 mmxext mng monkey motif
mozcalendar mozctl mozilla mozinterfaceinfo mp3 mpeg mpeg4 mpi mplayer msn
mysqli nas ncurses network neural nls nptl nptlonly nvidia nviz ocaml ogg
oggvorbis opengl oscar ospfapi pam parse-clocks pcap pcmcia pdflib perl php pic
plotutils png pnp portaudio posix povray ppds print procmail pthreads pvm python
qt quicktime radeon readline real rtc samba sasl scanner sdk sdl slp sockets
socks5 spell sse sse2 ssl svg svga sysvipc t1lib tcpd tcsim theora tiff
transcode transparent-proxy truetype truetype-fonts type1-fonts uml unicode usb
userlocales v4l v4l2 videos vorbis wifi wmf xanim xattr xim xml xml2 xmms xosd
xpm xprint xrandr xscreensaver xsl xslt xv xvid xvmc yahoo yv12 zlib zvbi
userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 1 SpanKY gentoo-dev 2005-08-03 20:06:30 UTC
you didnt convert the '.' to '_'
Comment 2 Paulo Lício de Geus 2005-08-04 10:25:22 UTC
Sorry, I don't follow you. I can't see why I should change an essid name to use
"_" instead of ".". Your comment suggests that this limitation (using "." not
allowed) is somehow documented in iwconfig's man page or in the
/etc/conf.d/wireless file, but it isn't.

I've been using essid names with dots for quite sometime, and I also collected a
few examples on the net. No luck finding the right standard document to see if
there is such a limitation, however.

So if you don't want to fix it, I suggest you to warn potential users what sort
of restrictions you impose on the essid names.
Comment 3 Hekaton Keires 2005-08-04 11:00:44 UTC
(In reply to comment #2)
> Sorry, I don't follow you. I can't see why I should change an essid name to use
> "_" instead of ".". Your comment suggests that this limitation (using "." not
> allowed)

I do agree with you Paulo. My /etc/conf.d/wireless contains lines such as

key_Rm3Wi-Fi="s:secret"

in fact bash shell does not accept neither hyphens (-) in variables. You can
test just writing it down in a shell. Unfortunately this wasn't documented and I
had to look at /lib/rcscripts/net.modules.d/iwconfig in order to find the source
of the problem... 

889 iwconfig_get_wep_key() {
890        local mac=${1} key
891        eval key=\"\${mac_key_${mac//:/}\}\"
892        [[ -z ${key} ]] && eval key=\"\${key_${ESSIDVAR}\}\" <- TA-DA!!! :D
893        key=${key:-"off"}
894        echo ${key}
895 }

isn't it possbile to use some kind of

essid="Rm3Wi-Fi"

variable instead?

PS: it is also clear that I cannot change essid of my university, neither work
location in order not to use hyphens or dots in a essids' :)
Comment 4 SpanKY gentoo-dev 2005-08-04 11:58:53 UTC
it should be pretty obvious why you need to use _ and not . or - ... it clearly
doesnt work otherwise :P

read the documentation at /etc/conf.d/wireless.example for more info