network-wizard fails: illegal string in gtkdialog3 script

Please post any bugs you have found
Post Reply
Message
Author
repos
Posts: 1
Joined: Fri 14 Oct 2011, 12:06

network-wizard fails: illegal string in gtkdialog3 script

#1 Post by repos »

Platform:
Dell Inspiron mini 1012
Puppy version: 511
/usr/sbin/net-setup.sh version: 25feb10

Symptom:
network-wizard fails silently!!!

Problem:
For some strange reason the kernel prepends "<A" to USB device''s smanufacturer string on this netbook

$ cat /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5/manufacturer
<ADell Wireless 5540
$ cat /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5/product
Dell Wireless 5540

(the "A<" prefix isn't a typo)


The function findInterfaceInfo() in net-setup.sh picks up the string, fails to sanitize it and blindly sets the MANU variable accordingly.

The (dynamic) gtkdialog3 script fails miserably (as '<' is used as its tag deliniter) and network-wizard exits, unable to tell the user what happened.

Solution:
The function findInterfaceInfo() in net-setup.sh should filter out '<', '>' and other gtkdialog3's special characters for the PROC/MANU/INFO strings.

Suggested fix:

Add the following before findInterfaceInfo() returns:

Code: Select all

# if PROD / MANU / INFO contain the < or > characters, the produced gtkdialog3
# script will fail; so remove these dangerous characters
PROD=$(echo "$PROD"|tr -d '<>')
MANU=$(echo "$MANU"|tr -d '<>')
INFO=$(echo "$INFO"|tr -d '<>')

Thanks to all who contribute to puppy linux.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#2 Post by BarryK »

Well, we could strip out all strange characters:

echo 'this is a (typical) <description>. |}[(*&%$#!' | sed -e 's%[^a-zA-Z0-9 .]%%g'

The net-setup package is in the 'common' repo. I will put this fix into it.
Thanks for the feedback.
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#3 Post by BarryK »

[url]https://bkhome.org/news/[/url]

Post Reply