[BusyBox] Strange things/Error with bb ash again ...

arne @ loopback . org arne at matrix.loopback.org
Thu Sep 6 08:55:14 UTC 2001


Well i seem to look for it ;-)
(Well, i do...).

o.k. here is another Problem i have, while trying to get my ipsec stuff
running with the bb ash i ran into two problems, here is one of it (the
other is much more difficult to reproduce without the ipsec
stuff/scripts/daemons, but i am working on it).

Ipsec/Freeswan uses a daemon called pluto to listen for connection attempts.
this pluto starts some scripts using popen to set router etc. With bb ash
this failes, i get a message that the command returned 127 as returnval.
So i tried to break down the code to have a small testcase that is showing
the trouble. I am using bb 0.60.1 for it.


Here is a description of my problem:


the script i used for my popen is just nothing but created by touch:
myrouter# ls -l /tmp/test.sh
-rwxr-xr-x    1 root     root            0 Sep  6 15:46 /tmp/test.sh

the c Program i used is:
--------------------------------------------------------------------
// test for popen / bb ash

#include <stdio.h>

int main ()
{
char cmd[1024];
int returnvar;
FILE *f;

snprintf(cmd, sizeof(cmd),"2>&1 PLUTO_VERSION='1.1' PLUTO_VERB='route-client' PLUTO_CONNECTION='gw-rw' PLUTO_NEXT_HOP='217.114.68.33' PLUTO_INTERFACE='ipsec0' PLUTO_ME='217.114.68.59' PLUTO_MY_CLIENT='192.168.2.0/24' PLUTO_MY_CLIENT_NET='192.168.2.0' PLUTO_MY_CLIENT_MASK='255.255.255.0' PLUTO_PEER='149.225.15.135' PLUTO_PEER_CLIENT='149.225.15.135/32' PLUTO_PEER_CLIENT_NET='149.225.15.135' PLUTO_PEER_CLIENT_MASK='255.255.255.255' /tmp/test.sh");
printf("command: %s\n",cmd);
f = popen(cmd, "r");
returnvar = pclose(f);
printf("the returnvar was: %d\n",returnvar);

}
---------------------------------------------------------------------

So now the real test:
with busybox ash:

myrouter# rm /bin/sh     
myrouter# ln -s /bin/busybox /bin/sh
myrouter# ./testcase                
command: 2>&1 PLUTO_VERSION='1.1' PLUTO_VERB='route-client' PLUTO_CONNECTION='gw-rw' PLUTO_NEXT_HOP='217.114.68.33' PLUTO_INTERFACE='ipsec0' PLUTO_ME='217.114.68.59' PLUTO_MY_CLIENT='192.168.2.0/24' PLUTO_MY_CLIENT_NET='192.168.2.0' PLUTO_MY_CLIENT_MASK='255.255.255.0' PLUTO_PEER='149.225.15.135' PLUTO_PEER_CLIENT='149.225.15.135/32' PLUTO_PEER_CLIENT_NET='149.225.15.135' PLUTO_PEER_CLIENT_MASK='255.255.255.255' /tmp/test.sh
PLUTO_VERSION=1.1: No such file or directory
the returnvar was: 32512

with real (0.3.5) ash:

myrouter# rm /bin/sh
myrouter# ln -s /bin/ash.orig /bin/sh
myrouter# ./testcase                
command: 2>&1 PLUTO_VERSION='1.1' PLUTO_VERB='route-client' PLUTO_CONNECTION='gw-rw' PLUTO_NEXT_HOP='217.114.68.33' PLUTO_INTERFACE='ipsec0' PLUTO_ME='217.114.68.59' PLUTO_MY_CLIENT='192.168.2.0/24' PLUTO_MY_CLIENT_NET='192.168.2.0' PLUTO_MY_CLIENT_MASK='255.255.255.0' PLUTO_PEER='149.225.15.135' PLUTO_PEER_CLIENT='149.225.15.135/32' PLUTO_PEER_CLIENT_NET='149.225.15.135' PLUTO_PEER_CLIENT_MASK='255.255.255.255' /tmp/test.sh
the returnvar was: 0

so what is going on here ???


--arne 
-------------------------------------------------------------------­---
Arne Bernin                            	Netropol Digitale Systeme
					Lagerstrasse 30a                        
Tel: +49 4043250000                     D-20357 Hamburg/Germany
Fax: +49 4028416740   	                ab at Netropol.de    

-----------------------------------------------------------------------
                                                             
Fppmpppff mpmmmmfmm mfpmffmpppff pmfmppfmmmppppp pmpmmmpppppp mfffmmfmp
fmmmmfmfppmfmmmfmf!

    





More information about the busybox mailing list