Topic: GUI front end for SSH/SCP access - possible bug in sh?

As comfortable as I've become in using the terminal to manage files and scripts on the chumby via ssh and scp, the mac user in me has been craving a GUI to make this process drag and drop simple.

I tried a number of GUI SSH clients for MacOS and none of them were able to connect. I contacted the developer of a client called RBrowser (http://www.rbrowser.com/) who made some modifications to his code and produced a version that did connect but with problems. Based on his analysis of the transcripts of my session, he suspects there's a bug in the version of the bourne shell (/bin/sh) chumby is using. I told him I'd post here to see if the chumby folks had any further info. 

Chumbians, what are your thoughts on his analysis? What version of bourne shell is the chumby running? Is there an easy way for me to try his suggestion of making /bin/sh a link pointing to /bin/ash without reflashing? Any other ideas/suggestions?

Thanks in advance!

--dhl


On Jan 31, 2008, at 1:20 PM, Robert Vasvari wrote:

Well, I read the transcript really carefully and with open eyes now, and I can tell you that in order to have RB connect
to this box, you might have to do some hacking. The bottom line is that this version of the bourne shell (/bin/sh) is broken.
It probably works fine when you connect in a terminal, but RBrowser uses a background shell with no terminal, and this sh
gives garbled output in that case. What I would try to do is to make /bin/sh a link pointing to /bin/ash. You probably have an old version
of bash there acting as sh causing the problem. Give that a shot...
Be sure to delete any saved connection files in ~/Library/Application Support/RBrowser4 each time you test this. RB then will test the available shells on the system.
Robert


On Jan 31, 2008 11:53 AM, David Lawrence <dhl@well.com> wrote:
making progress with this version -- rbrowser connects this time. However it's only showing a partial directory listing (writable directories only perhaps?) and is not showing any subdirectories. Here's the transcript of login only:

Stored Version 4440
RBVersion 4.4.4.0 - rbtp 2.1.2.1 - OSVersion10_4
Connecting to ssh://root@192.168.1.202:(22) -->PID:1312[9](9)
/bin/sh: 
==>[9](4)


Bu/sh: 
<==[1312]|LANG=en_US;export LANG
|
==>[1312]|
|
<==[1312]|(cd .;pwd | cat)
|
==>[1312]|
/root
|
<==[1312]|(uname -v | cat)
|
==>[1312]|
#1 Tue Nov 6 18:16:05 PST 2007
|
<==[1312]|(test -d /root/.rbtp; echo $? | cat)
|
==>[1312]|
1
|
<==[1312]|(mkdir /root/.rbtp; echo $? | cat)
|
==>[1312]|
1
|
<==[1312]|(test -d /var/tmp/root; echo $? | cat)
|
==>[1312]|mkdir: cannot create directory '/root/.rbtp': Read-only file system

1
|
<==[1312]|(mkdir /var/tmp/root; echo $? | cat)
|
==>[1312]|
mkdir: cannot create directory '/var/tmp/root': No such file or directory
1
|
<==[1312]|(test -d /tmp/root; echo $? | cat)
|
==>[1312]|(test -d /tmp/root; echo $? | cat)
0
|
<==[1312]|(test -d /tmp/root/.rbtp; echo $? | cat)
|
==>[1312]|(test -d /tmp/root/.rbtp; echo $? | cat)
0
|
<==[1312]|(test -d /tmp/root/.rbtp/tmp; echo $? | cat)
|
==>[1312]|(test -d /tmp/root/.rbtp/tmp; echo $? | cat)
0
|
<==[1312]|df -k / | cat|
==>[1312]|df -k / | cat
Filesystem           1k-blocks      Used Available Use% Mounted on
|
<==[1312]|df -k|
==>[1312]|df -k
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock5           34900     34900         0 100% /
none                     30964        12     30952   0% /dev
none                     32768       488     32280   1% /tmp
none                     32768        40     32728   0% /var
none                     32768         0     32768   0% /mnt
/dev/mtdblock1            2048       112      1936   5% /psp
/dev/sda1              3963392      6336   3957056   0% /mnt/usb
|
<==[1312]|PATH=/usr/local/bin:/usr/bin:/usr/5bin:/usr/ucb:/sbin:/usr/sbin:/bin;export PATH|
==>[1312]|PATH=/usr/local/bin:/usr/bin:/usr/5bin:/usr/ucb:/sbin:/usr/sbin:/bin;export PATH
|
<==[1312]|(test -f /usr/bin/scp; echo $? | cat)
|
==>[1312]|(test -f /usr/bin/scp; echo $? | cat)
0
|
<==[1312]|(type type | cat)
|
==>[1312]|(type type | cat)
type is a shell builtin
|
<==[1312]|date -u "+%Y:%m:%d:%H:%M:%S"|
==>[1312]|
2008:01:31:10:39:16
|
<==[1312]|date "+%Y:%m:%d:%H:%M:%S"|
==>[1312]|
2008:01:31:02:39:16
|
<==[1312]|(test -f /bin/gzip; echo $? | cat)
|
==>[1312]|
0
|
<==[1312]|(test -f /bin/gunzip; echo $? | cat)
|
==>[1312]|
0
|
<==[1312]|(test -f zip; echo $? | cat)
|
==>[1312]|
1
|
<==[1312]|(type zip | cat)
|
==>[1312]|
zip: not found
|
path_for_command_by_type failed:|zip: not found|
<==[1312]|(type gnutar | cat)
|
==>[1312]|
gnutar: not found
|
path_for_command_by_type failed:|gnutar: not found|
<==[1312]|(type tar | cat)
|
==>[1312]|
tar is /bin/tar
|
<==[1312]|cat /etc/group | sed -e "s/:/ /" | awk '{ print $1 }'; echo $? | cat
|
==>[1312]|cat /etc/group | sed -e "s/:/ /" | awk '{ print $1 }'; echo $? | cat
root
daemon
bin
sys
adm
tty
disk
wheel
utmp
staff
nobody
nogroup
users
default
0
|
<==[1312]|(id | cat)
|
==>[1312]|(id | cat)
uid=0(root) gid=0(root)
|
<==[1312]|ls -laiT -d | cat|
==>[1312]|ls -laiT -d | cat
|
<==[1312]|ls -laiTg -d | cat|
==>[1312]|ls: invalid number '-d'
ls -laiTg -d | cat
ls: invalid number 'g'
|
<==[1312]|ls -lai --time-style="+%e %b %H:%M:%S %Y" -d | cat|
<==[1312]|ls -lai -d | cat|
==>[1312]|ls -lai -d | cat
  11404 drwxr-xr-x    1 root     root           36 Dec 31  1969 .
|
<==[1312]|ls -lagi -d | cat|
==>[1312]|ls -lagi -d | cat
  11404 drwxr-xr-x    1 root     root           36 Dec 31  1969 .
|
RB_UNIX_COMMAND_LS_TEST failed
<==[1312]|cd . 2>/dev/null; echo $? | cat
|
==>[1312]|cd . 2>/dev/null; echo $? | cat
0
|
<==[1312]|ls -laiT -d | cat|
==>[1312]|ls -laiT -d | cat
|
<==[1312]|ls -laiTg -d | cat|
==>[1312]|ls: invalid number '-d'
ls -laiTg -d | cat
ls: invalid number 'g'
|
<==[1312]|ls -lai --time-style="+%e %b %H:%M:%S %Y" -d | cat|
<==[1312]|ls -lai -d | cat|
==>[1312]|ls -lai -d | cat
  11404 drwxr-xr-x    1 root     root           36 Dec 31  1969 .
|
<==[1312]|ls -lagi -d | cat|
==>[1312]|ls -lagi -d | cat
  11404 drwxr-xr-x    1 root     root           36 Dec 31  1969 .
|
RB_UNIX_COMMAND_LS_TEST failed
<==[1312]|cd . 2>/dev/null; echo $? | cat
|
==>[1312]|cd . 2>/dev/null; echo $? | cat
0
|
<==[1312]|ls -laiT -d | cat|
==>[1312]|ls -laiT -d | cat
ls: invalid number '-d'
|
<==[1312]|ls -laiTg -d | cat|
==>[1312]|ls -laiTg -d | cat
|
<==[1312]|ls -lai --time-style="+%e %b %H:%M:%S %Y" -d | cat|
<==[1312]|ls -lai -d | cat|
==>[1312]|ls -lai -d | cat
  11404 drwxr-xr-x    1 root     root           36 Dec 31  1969 .
|
<==[1312]|ls -lagi -d | cat|
==>[1312]|ls -lagi -d | cat
  11404 drwxr-xr-x    1 root     root           36 Dec 31  1969 .
|
RB_UNIX_COMMAND_LS_TEST failed
<==[1312]|cd . 2>/dev/null; echo $? | cat
|
==>[1312]|cd . 2>/dev/null; echo $? | cat
0
|
<==[1312]|ls -laiT -d | cat|
==>[1312]|ls -laiT -d | cat
ls: invalid number '-d'
|
<==[1312]|ls -laiTg -d | cat|
==>[1312]|ls -laiTg -d | cat
ls: invalid number 'g'
|
<==[1312]|ls -lai --time-style="+%e %b %H:%M:%S %Y" -d | cat|
==>[1312]|ls -lai --time-style="+%e %b %H:%M:%S %Y" -d | cat
ls: unrecognized option `--time-style=+%e %b %H:%M:%S %Y'
|
<==[1312]|ls -lai -d | cat|
<==[1312]|ls -lagi -d | cat|
==>[1312]|ls -lagi -d | cat
  11404 drwxr-xr-x    1 root     root           36 Dec 31  1969 .
|
RB_UNIX_COMMAND_LS_TEST failed
<==[1312]|cd . 2>/dev/null; echo $? | cat
|
==>[1312]|cd . 2>/dev/null; echo $? | cat
0
|

Thanks,
David

Re: GUI front end for SSH/SCP access - possible bug in sh?

Ah - we're not running a full Bourne shell. We're running a limited shell which is part of BusyBox.  This is not a full-blown Linux - it's an embedded Linux, which means that compromises are made in the interest of size and speed. It's certainly not "broken" - it's just not complete. A full bash is simply too large to run in such a device, and generally unnecessary in any case.

Busybox is a single executable that implements a "90th percentile" functionality of the most common UNIX utilities.  If you do an "ls -l" in the common binary directories (/bin, /sbin), you'll see that most of them are just symbolic links to busybox - it uses argv[0] to figure out what you're trying to do, and basically has a big switch statement to the proper code.

If your RBrowser developer is interested in having his software work with embedded devices, he should consider adding Busybox to the list of systems he checks against, since it's *very* common in the embedded space.  His code also seems to assume it can write to our file system - also a very bad assumption for embedded devices.

Re: GUI front end for SSH/SCP access - possible bug in sh?

thanks for the explanation, Duane. I'll pass your comments along and see what he says.

Re: GUI front end for SSH/SCP access - possible bug in sh?

Well, heard back from the RBrowser developer. He said making the necessary changes to RBrowser was possible, but not in the near term due to time constraints. So for now I guess that's that.