From Jan-Evert.van.Grootheest at Vialis.nl Tue May 1 00:12:18 2007 From: Jan-Evert.van.Grootheest at Vialis.nl (Jan Evert van Grootheest) Date: Tue, 1 May 2007 09:12:18 +0200 Subject: /etc/busybox.conf confusion [secutiry?] Message-ID: > On Friday 27 April 2007 13:44:46 Jan Evert van Grootheest wrote: > > > > > > All, > > > > > > > > I think this got introduced in applets.c:check_suid with 17508 > > > > 'accumulated post-1.4.0 fixes'. > > > > > > > > This part of the diff seems responsible. > > > > - if ((sct->m_mode & (S_ISGID | S_IXGRP)) > > > > == (S_ISGID | S_IXGRP)) { /* *both* have to be set > for sgid */ > > > > - xsetgid(sct->m_gid); > > > > - } else xsetgid(rgid); /* > > > > no sgid -> drop */ > > > > - > > > > - if (sct->m_mode & S_ISUID) > xsetuid(sct->m_uid); > > > > - else xsetuid(ruid); /* > > > > no suid -> drop */ > > > > + if (sct->m_gid != 0) { > > > > + /* _both_ have to be > set for sgid */ > > > > + if ((sct->m_mode & (S_ISGID | > > > > S_IXGRP)) == (S_ISGID | S_IXGRP)) { > > > > + xsetgid(sct->m_gid); > > > > + } else xsetgid(rgid); /* no > > > > sgid -> drop */ > > > > + } > > > > + if (sct->m_uid != 0) { > > > > + if (sct->m_mode & S_ISUID) > > > > xsetuid(sct->m_uid); > > > > + else xsetuid(ruid); /* no suid > > > > -> drop */ > > > > + } > > > > > > > > Previously if there was no sgid/suid, privileges would > always be > > > > dropped. Now they're only dropped if the uid/gid in > bb.conf is not > > > > 0. > > > > > > > > I would propose to revert this part of the patch. > > > > Adding an else to call xsetuid/xsetgid would seem to do > the right > > > > thing but, I guess, would only increase the size of the > > > > executable. > > > > > > > > This seems, by the way, to be a security bug? It leaves > processes > > > > with effective root all over! > > > > > > > > -- Jan Evert > > > > > > > > > > > > > -----Oorspronkelijk bericht----- > > > > > Van: busybox-bounces at busybox.net > > > > > [mailto:busybox-bounces at busybox.net] Namens Jan Evert van > > > Grootheest > > > > > Verzonden: vrijdag 27 april 2007 9:07 > > > > > Aan: busybox at busybox.net > > > > > Onderwerp: /etc/busybox.conf confusion > > > > > > > > > > > > > > > Hi, > > > > > > > > > > The confusion is mine (not bb). > > > > > > > > > > If I have sh not in /etc/busybox.conf and I login as user > > > > mysql I get > > > > > this: > > > > > > > > > > viking-be# cat /proc/self/status | egrep "id:|Name" > > > > > Name: sh > > > > > Tgid: 1192 > > > > > Pid: 1192 > > > > > PPid: 1173 > > > > > TracerPid: 0 > > > > > Uid: 500 500 500 500 > > > > > Gid: 500 500 500 500 > > > > > viking-be# cat /proc/1173/status | egrep "id:|Name" > > > > > Name: sh > > > > > Tgid: 1173 > > > > > Pid: 1173 > > > > > PPid: 1064 > > > > > TracerPid: 0 > > > > > Uid: 500 500 500 500 > > > > > Gid: 500 500 500 500 > > > > > > > > > > > > > > > Now, when I put sh in the busybox.conf file as using > > > > > sh = xxx 0.0 > > > > > And login again and try the same this is the result > viking-be# > > > > > cat /proc/self/status | egrep "id:|Name" > > > > > Name: sh > > > > > Tgid: 1206 > > > > > Pid: 1206 > > > > > PPid: 1203 > > > > > TracerPid: 0 > > > > > Uid: 500 0 0 0 > > > > > Gid: 500 0 0 0 > > > > > viking-be# cat /proc/1203/status | egrep "id:|Name" > > > > > Name: sh > > > > > Tgid: 1203 > > > > > Pid: 1203 > > > > > PPid: 1064 > > > > > TracerPid: 0 > > > > > Uid: 500 0 0 0 > > > > > Gid: 500 0 0 0 > > > > > > > > > > > > > > > I am confused, because I was expecting the same output. I > > > > > thought > > > > > that xxx meant that the applet is a regular executable > > > that doesn't > > > > > change effective uid and gid. But apparently it does? > > > > > > > > > > So can anyone explain this? > > > > > Which part of the process do I not understand? > > > > > My guess would be that the problem, if at all, is with > > > the starting > > > > > shell, because busybox is suid root and bb.conf is read during > > > > > startup. > > > > > > > > > > This is a login via the bb telnetd (which is, of course, > > > running as > > > > > root) and using the bb login (which is xxx in > > > busybox.conf). And it > > > > > concerns bb 1.4.1 (with all patches, as far as I know) > > > using glibc > > > > > 2.3.6 on i386. > > > > > > > > > > Also note the 'Name' of cat. It is 'sh'. I would > guess this to > > > > > be > > > > > due to cat being a safe applet. > > > > > > > > > > Many thanks, > > > > > Jan Evert > > > > > > > > > > > > > > I think more changes are needed. Passwd and su are not really > > > behaving well: > > > > > > I'm now trying to change the password of a regular user > > > (mysql). If I have the passwd applet in bb.conf as xxx it, > > > obviously, is not able to read /etc/shadow. If I have the > > > passwd applet in bb.conf as sxx then it attempts to change > > > the password of root. If I have the passwd applet in bb.conf > > > as sxx and attempt 'passwd mysql' when logged in as mysql, > > > then the correct password is changed, but without asking for > > > the old password! > > > > > > Something comparable is happening to the su applet. When > > > executed as a regular user: With su as xxx, it asks for the > > > password and then fails to set groups. With su as sxx, it > > > doesn't ask for the password and drops straight into a shell > > > with the correct user (just as if root had executed it). > > > > > > Any ideas? > > > > > > Thanks, > > > Jan Evert > > > > I think I figured it out. > > > > A suid program has effective uid of the owner of the > program (usually > > that will be root). And the real uid is the uid of the > logged in user > > (for example, mysql). If a suid root program executes > setuid(x), the > > real and effective uids are changed to become x. Same goes for gid. > > > > And that is the bug. Busybox is suid root. If an applet is > supposed to > > be suid, a setuid is done changing the real uid to root. Thus, for > > example, su and passwd think they are executed by root and behave > > differently! However, bb doesn't need to setuid because the > effective > > uid is already root because the program is suid root. > > > > So I came up with this patch which I think does the right > thing. This > > is against 1.4.1. > > > > Thanks, > > Jan Evert > > > > Hi, > this seems to work for me: > busybox.conf is > > [SUID] > passwd = ssx 0.0 > # applet su can be run by anyone and runs with euid=0/egid=0 > su = ssx root.0 > # applet su can be run by anyone and runs with euid=0/egid=0 > > > root at localhost:~/Desktop/busybox# chown 0.0 /etc/busybox.conf > root at localhost:~/Desktop/busybox# chmod 600 /etc/busybox.conf > > root at localhost:~/Desktop/busybox# cp busybox /usr/bin/passwd > root at localhost:~/Desktop/busybox# chown 0.0 /usr/bin/passwd > root at localhost:~/Desktop/busybox# chmod 4755 /usr/bin/passwd > > Running as normal user: > > root at localhost:~/Desktop/busybox# cat /proc/18601/status > Name: passwd > State: S (sleeping) > SleepAVG: 88% > Tgid: 18601 > Pid: 18601 > PPid: 15912 > TracerPid: 0 > Uid: 1000 0 0 0 > Gid: 1000 1000 1000 1000 > FDSize: 256 > Groups: 7 20 24 25 29 46 111 113 1000 1002 1003 > > tito at localhost:~$ id > uid=1000(tito) gid=1000(tito) > groups=7(lp),20(dip),24(cdrom),25(floppy),29(audio),46(plugdev > ),111(admin),113(fuse),1000(tito),1002(vboxusers),1003(halt) > tito at localhost:~$ /usr/bin/passwd > ruid = 1000 /*debug */ > busybox.conf readable /*debug */ > found su /*debug */ > found passwd /*debug */ > requested uid 0 gid 0 /*debug */ > Changing password for tito > Old password: > New password: > Bad password: too weak > passwd: password for tito is unchanged > > then changing busybox.conf to > > [SUID] > passwd = ssx 0.0 > > tito at localhost:~$ /usr/bin/passwd > ruid = 1000 > busybox.conf readable > found su > found passwd > requested uid 0 gid 0 > Changing password for tito > Old password: > Incorrect password > passwd: password for tito is unchanged > tito at localhost:~$ > > > it is not possible to change password. > > Running as root: > > root at localhost:~/Desktop# cat /proc/18582/status > Name: passwd > State: S (sleeping) > SleepAVG: 58% > Tgid: 18582 > Pid: 18582 > PPid: 12012 > TracerPid: 0 > Uid: 0 0 0 0 > Gid: 0 0 0 0 > > root at localhost:~/Desktop# /usr/bin/passwd > ruid = 0 /* debug */ > Changing password for root > New password: > Bad password: too weak > Retype password: > Passwords don't match > passwd: password for root is unchanged > root at localhost:~/Desktop# Tito, others, Sorry about this, but those su and passwd comments were with my initial patch applied. With original code, it is easiest to demonstrate using 'cat /proc/self/status' with a suid root bbox and as a regular user. Try both with cat in bbox.conf as xxx and cat not present in bbox.conf. When cat is present as xxx, privileges are not dropped. I ran into this because my environment had ash and sh as ssx in bbox.conf. Which I changed to xxx. And then still had not proper uids/gids. -- Jan Evert The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this information is strictly prohibited and may be unlawful. Vialis is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. From farmatito at tiscali.it Tue May 1 00:14:45 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 1 May 2007 09:14:45 +0200 Subject: /etc/busybox.conf confusion [secutiry?] In-Reply-To: References: Message-ID: <200705010914.45568.farmatito@tiscali.it> On Tuesday 01 May 2007 07:27:26 Jan Evert van Grootheest wrote: > > Ops little typo: > > > > > > then changing busybox.conf to > > > > > > [SUID] > > > passwd = ssx 0.0 > > > > > > > > > > snip > > > > then changing busybox.conf to > > > > [SUID] > > passwd = xxx 0.0 > > > > etc. > > And which busybox version is that? > > -- Jan Evert BusyBox v1.6.0.svn (2007-04-27 14:48:26 CEST) multi-call binary Copyright (C) 1998-2006 ?Erik Andersen, Rob Landley, and others. Licensed under GPLv2. ?See source distribution for full notice. Ciao, Tito From farmatito at tiscali.it Tue May 1 00:58:26 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 1 May 2007 09:58:26 +0200 Subject: /etc/busybox.conf confusion [secutiry?] In-Reply-To: References: Message-ID: <200705010958.27164.farmatito@tiscali.it> On Tuesday 01 May 2007 09:12:18 Jan Evert van Grootheest wrote: > > On Friday 27 April 2007 13:44:46 Jan Evert van Grootheest wrote: > > > > > > > > All, > > > > > > > > > > I think this got introduced in applets.c:check_suid with 17508 > > > > > 'accumulated post-1.4.0 fixes'. > > > > > > > > > > This part of the diff seems responsible. > > > > > - if ((sct->m_mode & (S_ISGID | S_IXGRP)) > > > > > == (S_ISGID | S_IXGRP)) { /* *both* have to be set > > for sgid */ > > > > > - xsetgid(sct->m_gid); > > > > > - } else xsetgid(rgid); /* > > > > > no sgid -> drop */ > > > > > - > > > > > - if (sct->m_mode & S_ISUID) > > xsetuid(sct->m_uid); > > > > > - else xsetuid(ruid); /* > > > > > no suid -> drop */ > > > > > + if (sct->m_gid != 0) { > > > > > + /* _both_ have to be > > set for sgid */ > > > > > + if ((sct->m_mode & (S_ISGID | > > > > > S_IXGRP)) == (S_ISGID | S_IXGRP)) { > > > > > + xsetgid(sct->m_gid); > > > > > + } else xsetgid(rgid); /* no > > > > > sgid -> drop */ > > > > > + } > > > > > + if (sct->m_uid != 0) { > > > > > + if (sct->m_mode & S_ISUID) > > > > > xsetuid(sct->m_uid); > > > > > + else xsetuid(ruid); /* no suid > > > > > -> drop */ > > > > > + } > > > > > > > > > > Previously if there was no sgid/suid, privileges would > > always be > > > > > dropped. Now they're only dropped if the uid/gid in > > bb.conf is not > > > > > 0. > > > > > > > > > > I would propose to revert this part of the patch. > > > > > Adding an else to call xsetuid/xsetgid would seem to do > > the right > > > > > thing but, I guess, would only increase the size of the > > > > > executable. > > > > > > > > > > This seems, by the way, to be a security bug? It leaves > > processes > > > > > with effective root all over! > > > > > > > > > > -- Jan Evert > > > > > > > > > > > > > > > > -----Oorspronkelijk bericht----- > > > > > > Van: busybox-bounces at busybox.net > > > > > > [mailto:busybox-bounces at busybox.net] Namens Jan Evert van > > > > Grootheest > > > > > > Verzonden: vrijdag 27 april 2007 9:07 > > > > > > Aan: busybox at busybox.net > > > > > > Onderwerp: /etc/busybox.conf confusion > > > > > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > The confusion is mine (not bb). > > > > > > > > > > > > If I have sh not in /etc/busybox.conf and I login as user > > > > > mysql I get > > > > > > this: > > > > > > > > > > > > viking-be# cat /proc/self/status | egrep "id:|Name" > > > > > > Name: sh > > > > > > Tgid: 1192 > > > > > > Pid: 1192 > > > > > > PPid: 1173 > > > > > > TracerPid: 0 > > > > > > Uid: 500 500 500 500 > > > > > > Gid: 500 500 500 500 > > > > > > viking-be# cat /proc/1173/status | egrep "id:|Name" > > > > > > Name: sh > > > > > > Tgid: 1173 > > > > > > Pid: 1173 > > > > > > PPid: 1064 > > > > > > TracerPid: 0 > > > > > > Uid: 500 500 500 500 > > > > > > Gid: 500 500 500 500 > > > > > > > > > > > > > > > > > > Now, when I put sh in the busybox.conf file as using > > > > > > sh = xxx 0.0 > > > > > > And login again and try the same this is the result > > viking-be# > > > > > > cat /proc/self/status | egrep "id:|Name" > > > > > > Name: sh > > > > > > Tgid: 1206 > > > > > > Pid: 1206 > > > > > > PPid: 1203 > > > > > > TracerPid: 0 > > > > > > Uid: 500 0 0 0 > > > > > > Gid: 500 0 0 0 > > > > > > viking-be# cat /proc/1203/status | egrep "id:|Name" > > > > > > Name: sh > > > > > > Tgid: 1203 > > > > > > Pid: 1203 > > > > > > PPid: 1064 > > > > > > TracerPid: 0 > > > > > > Uid: 500 0 0 0 > > > > > > Gid: 500 0 0 0 > > > > > > > > > > > > > > > > > > I am confused, because I was expecting the same output. I > > > > > > thought > > > > > > that xxx meant that the applet is a regular executable > > > > that doesn't > > > > > > change effective uid and gid. But apparently it does? > > > > > > > > > > > > So can anyone explain this? > > > > > > Which part of the process do I not understand? > > > > > > My guess would be that the problem, if at all, is with > > > > the starting > > > > > > shell, because busybox is suid root and bb.conf is read during > > > > > > startup. > > > > > > > > > > > > This is a login via the bb telnetd (which is, of course, > > > > running as > > > > > > root) and using the bb login (which is xxx in > > > > busybox.conf). And it > > > > > > concerns bb 1.4.1 (with all patches, as far as I know) > > > > using glibc > > > > > > 2.3.6 on i386. > > > > > > > > > > > > Also note the 'Name' of cat. It is 'sh'. I would > > guess this to > > > > > > be > > > > > > due to cat being a safe applet. > > > > > > > > > > > > Many thanks, > > > > > > Jan Evert > > > > > > > > > > > > > > > > > > I think more changes are needed. Passwd and su are not really > > > > behaving well: > > > > > > > > I'm now trying to change the password of a regular user > > > > (mysql). If I have the passwd applet in bb.conf as xxx it, > > > > obviously, is not able to read /etc/shadow. If I have the > > > > passwd applet in bb.conf as sxx then it attempts to change > > > > the password of root. If I have the passwd applet in bb.conf > > > > as sxx and attempt 'passwd mysql' when logged in as mysql, > > > > then the correct password is changed, but without asking for > > > > the old password! > > > > > > > > Something comparable is happening to the su applet. When > > > > executed as a regular user: With su as xxx, it asks for the > > > > password and then fails to set groups. With su as sxx, it > > > > doesn't ask for the password and drops straight into a shell > > > > with the correct user (just as if root had executed it). > > > > > > > > Any ideas? > > > > > > > > Thanks, > > > > Jan Evert > > > > > > I think I figured it out. > > > > > > A suid program has effective uid of the owner of the > > program (usually > > > that will be root). And the real uid is the uid of the > > logged in user > > > (for example, mysql). If a suid root program executes > > setuid(x), the > > > real and effective uids are changed to become x. Same goes for gid. > > > > > > And that is the bug. Busybox is suid root. If an applet is > > supposed to > > > be suid, a setuid is done changing the real uid to root. Thus, for > > > example, su and passwd think they are executed by root and behave > > > differently! However, bb doesn't need to setuid because the > > effective > > > uid is already root because the program is suid root. > > > > > > So I came up with this patch which I think does the right > > thing. This > > > is against 1.4.1. > > > > > > Thanks, > > > Jan Evert > > > > > > > Hi, > > this seems to work for me: > > busybox.conf is > > > > [SUID] > > passwd = ssx 0.0 > > # applet su can be run by anyone and runs with euid=0/egid=0 > > su = ssx root.0 > > # applet su can be run by anyone and runs with euid=0/egid=0 > > > > > > root at localhost:~/Desktop/busybox# chown 0.0 /etc/busybox.conf > > root at localhost:~/Desktop/busybox# chmod 600 /etc/busybox.conf > > > > root at localhost:~/Desktop/busybox# cp busybox /usr/bin/passwd > > root at localhost:~/Desktop/busybox# chown 0.0 /usr/bin/passwd > > root at localhost:~/Desktop/busybox# chmod 4755 /usr/bin/passwd > > > > Running as normal user: > > > > root at localhost:~/Desktop/busybox# cat /proc/18601/status > > Name: passwd > > State: S (sleeping) > > SleepAVG: 88% > > Tgid: 18601 > > Pid: 18601 > > PPid: 15912 > > TracerPid: 0 > > Uid: 1000 0 0 0 > > Gid: 1000 1000 1000 1000 > > FDSize: 256 > > Groups: 7 20 24 25 29 46 111 113 1000 1002 1003 > > > > tito at localhost:~$ id > > uid=1000(tito) gid=1000(tito) > > groups=7(lp),20(dip),24(cdrom),25(floppy),29(audio),46(plugdev > > ),111(admin),113(fuse),1000(tito),1002(vboxusers),1003(halt) > > tito at localhost:~$ /usr/bin/passwd > > ruid = 1000 /*debug */ > > busybox.conf readable /*debug */ > > found su /*debug */ > > found passwd /*debug */ > > requested uid 0 gid 0 /*debug */ > > Changing password for tito > > Old password: > > New password: > > Bad password: too weak > > passwd: password for tito is unchanged > > > > then changing busybox.conf to > > > > [SUID] > > passwd = ssx 0.0 > > > > tito at localhost:~$ /usr/bin/passwd > > ruid = 1000 > > busybox.conf readable > > found su > > found passwd > > requested uid 0 gid 0 > > Changing password for tito > > Old password: > > Incorrect password > > passwd: password for tito is unchanged > > tito at localhost:~$ > > > > > > it is not possible to change password. > > > > Running as root: > > > > root at localhost:~/Desktop# cat /proc/18582/status > > Name: passwd > > State: S (sleeping) > > SleepAVG: 58% > > Tgid: 18582 > > Pid: 18582 > > PPid: 12012 > > TracerPid: 0 > > Uid: 0 0 0 0 > > Gid: 0 0 0 0 > > > > root at localhost:~/Desktop# /usr/bin/passwd > > ruid = 0 /* debug */ > > Changing password for root > > New password: > > Bad password: too weak > > Retype password: > > Passwords don't match > > passwd: password for root is unchanged > > root at localhost:~/Desktop# > > Tito, others, > > Sorry about this, but those su and passwd comments were with my initial > patch applied. > > With original code, it is easiest to demonstrate using 'cat > /proc/self/status' with a suid root bbox and as a regular user. Try both > with cat in bbox.conf as xxx and cat not present in bbox.conf. > When cat is present as xxx, privileges are not dropped. > > I ran into this because my environment had ash and sh as ssx in > bbox.conf. Which I changed to xxx. And then still had not proper > uids/gids. > > -- Jan Evert Hi, mv busybox /bin/busybox chown 0.0 /bin/busybox chmod 4755 /bin/busybox 1 ) not in busybox.conf: as normal user /bin/busybox cat /proc/self/status does not work 2) in busybox.conf 2a) as normal user and cat = ssx 0.0 in busybox.conf /bin/busybox cat /proc/self/status works Name: busybox State: R (running) SleepAVG: 88% Tgid: 6937 Pid: 6937 PPid: 6416 TracerPid: 0 Uid: 1000 0 0 0 Gid: 1000 1000 1000 1000 2b) as normal user and cat = xxx 0.0 in busybox.conf /bin/busybox cat /proc/self/status does not work if in [SUID] stanza alphabetical order is respected [SUID] cat = xxx 0.0 passwd = ssx 0.0 # applet su can be run by anyone and runs with euid=0/egid=0 su = ssx root.0 # applet su can be run by anyone and runs with euid=0/egid=0 2c) as normal user and cat = xxx 0.0 in busybox.conf it works /bin/busybox cat /proc/self/status works if in [SUID] stanza alphabetical order is not respected [SUID] passwd = ssx 0.0 # applet su can be run by anyone and runs with euid=0/egid=0 su = ssx root.0 # applet su can be run by anyone and runs with euid=0/egid=0 cat = xxx 0.0 Name: busybox State: R (running) SleepAVG: 58% Tgid: 6953 Pid: 6953 PPid: 6416 TracerPid: 0 Uid: 1000 0 0 0 Gid: 1000 1000 1000 1000 Seems that there is really something wrong here.... IMHO check_suid and parse_config_file should be totally rewritten, the first to make it more readable and the second to reduce the bloat as most of its features are unused at the moment. Ciao, Tito -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070501/bb53669b/attachment-0001.htm From Jan-Evert.van.Grootheest at Vialis.nl Tue May 1 01:16:44 2007 From: Jan-Evert.van.Grootheest at Vialis.nl (Jan Evert van Grootheest) Date: Tue, 1 May 2007 10:16:44 +0200 Subject: /etc/busybox.conf confusion [secutiry?] Message-ID: > Tito, others, > > Sorry about this, but those su and passwd comments were with my initial > patch applied. > > With original code, it is easiest to demonstrate using 'cat > /proc/self/status' with a suid root bbox and as a regular user. Try both > with cat in bbox.conf as xxx and cat not present in bbox.conf. > When cat is present as xxx, privileges are not dropped. > > I ran into this because my environment had ash and sh as ssx in > bbox.conf. Which I changed to xxx. And then still had not proper > uids/gids. > > -- Jan Evert Hi, mv busybox /bin/busybox chown 0.0 /bin/busybox chmod 4755 /bin/busybox 1 ) not in busybox.conf: as normal user /bin/busybox cat /proc/self/status does not work Eh? For me (1.4.1 and patches) it works just fine if cat is not in bbox.conf. Dumb question of the day... what are the permissions to your /etc/busybox.conf? 2) in busybox.conf 2a) as normal user and cat = ssx 0.0 in busybox.conf /bin/busybox cat /proc/self/status works Name: busybox State: R (running) SleepAVG: 88% Tgid: 6937 Pid: 6937 PPid: 6416 TracerPid: 0 Uid: 1000 0 0 0 Gid: 1000 1000 1000 1000 Given the ssx, this result is somewhat expected, except that I would expect gid to be '1000 0 0 0'? It seems that bbox actually did sxx. 2b) as normal user and cat = xxx 0.0 in busybox.conf /bin/busybox cat /proc/self/status does not work if in [SUID] stanza alphabetical order is respected [SUID] cat = xxx 0.0 passwd = ssx 0.0 # applet su can be run by anyone and runs with euid=0/egid=0 su = ssx root.0 # applet su can be run by anyone and runs with euid=0/egid=0 2c) as normal user and cat = xxx 0.0 in busybox.conf it works /bin/busybox cat /proc/self/status works if in [SUID] stanza alphabetical order is not respected [SUID] passwd = ssx 0.0 # applet su can be run by anyone and runs with euid=0/egid=0 su = ssx root.0 # applet su can be run by anyone and runs with euid=0/egid=0 cat = xxx 0.0 Name: busybox State: R (running) SleepAVG: 58% Tgid: 6953 Pid: 6953 PPid: 6416 TracerPid: 0 Uid: 1000 0 0 0 Gid: 1000 1000 1000 1000 Seems that there is really something wrong here.... IMHO check_suid and parse_config_file should be totally rewritten, the first to make it more readable and the second to reduce the bloat as most of its features are unused at the moment. As for the ordering... my bbox.conf appears to be in the same order as the applets are in 'make menuconfig'. But that's just an impression. At least the applets are grouped according to the submenus in make menuconfig. And withing the grouping they are alfabetically ordered. -- Jan Evert PS: sorry if Outlook makes a mess of this mail. I don't know how to make it behave. It seems impossible. The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this information is strictly prohibited and may be unlawful. Vialis is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070501/42d0ede5/attachment.htm From natanael.copa at gmail.com Tue May 1 08:51:11 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Tue, 01 May 2007 17:51:11 +0200 Subject: Bug in bb 1.5.0 ifupdown applet In-Reply-To: <4636896C.8040909@nothome.org> References: <4636896C.8040909@nothome.org> Message-ID: <1178034671.4860.36.camel@localhost> On Tue, 2007-05-01 at 00:27 +0000, Nathan Angelacos wrote: > Hello, > > The ifupdown applet in 1.5.0 appears to have a bug that was not present > in 1.4.1. The bug is that /var/run/ifstate is not updated with all > interfaces if an interface stanza calls ifup statement to bring up a > second interface. > > Given the following interfaces file: > > iface lo inet static > address 127.0.0.1 > netmask 255.0.0.0 > up ifup tunl > down ifdown tunl > > iface tunl inet manual > up modprobe ipip || true > up ip tun add tunl mode ipip local 127.0.0.1 remote 192.168.0.1 > up ip link set tunl up > down ip link set tunl down > down ip tunl del > > > "ifup lo" correctly brings up lo and the tunl interface. However, > /var/run/ifstate only lists "lo=lo". Which gives the effect that ifdown will fail to take down the tunl interface as expected when running "ifdown lo" I can confirm this. ifup/ifdown is not reentrant. > An strace for "ifup lo" shows: > > 1. the "parent" ifup reads /var/run/ifstate > 2. the "parent" forks to run the child ifup > 2. the "child" ifup reads /var/run/ifstate > 3. the "child" writes its interface to /var/run/ifstate > 4. the "child" exits > 5. the "parent" writes its interface to /var/run/ifstate, using the info > from step 1 > > That is, the parent does not re-read ifstate before writing. > > Its not a simple case of re-reading /var/run/ifstate, since the code > between the read (line 1122) and write (line 1262) could itself update > the linked list. I had a short look at the source. I don't think the fix is trivial but i might be missing something. It would be nice if this could be fixed in 1.5.1. Thanks! Natanael Copa From vda.linux at googlemail.com Tue May 1 11:52:41 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 1 May 2007 20:52:41 +0200 Subject: Two unnecessary warnings with svn In-Reply-To: <1177947039.3632.4.camel@localhost> References: <1177947039.3632.4.camel@localhost> Message-ID: <200705012052.41490.vda.linux@googlemail.com> On Monday 30 April 2007 17:30, Mats Erik Andersson wrote: > Hello there, > > I get two irritating warnings from the compiler on > todays svn, with a fairly small configuration. > > MEA > > PS I still dislike the new output from "kill -l". What exacly doesn't look nice? > --- coreutils/test.c.svn 2007-04-30 17:21:24.736054416 +0200 > +++ coreutils/test.c 2007-04-30 17:22:46.161675840 +0200 > @@ -376,3 +376,3 @@ > struct stat s; > - int i; > + int i = 0; My gcc says nothing... What's the version of yours? > --- procps/ps.c.svn 2007-04-30 17:19:07.055984968 +0200 > +++ procps/ps.c 2007-04-30 17:19:31.416281640 +0200 > @@ -385,3 +385,3 @@ > else > - len = printf("%5u %-8s %6ld %s ", > + len = printf("%5u %-8s %6d %s ", > p->pid, user, p->vsz, p->state); Fixing... thanks. -- vda From vda.linux at googlemail.com Tue May 1 13:09:37 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 1 May 2007 22:09:37 +0200 Subject: An initial revision of "kill -l [exitstatus]" In-Reply-To: <1177881441.3674.27.camel@localhost> References: <1177767729.3466.35.camel@localhost> <200704291635.30730.vda.linux@googlemail.com> <1177881441.3674.27.camel@localhost> Message-ID: <200705012209.38001.vda.linux@googlemail.com> On Sunday 29 April 2007 23:17, Mats Erik Andersson wrote: > s?n 2007-04-29 klockan 16:35 +0200 skrev Denis Vlasenko: > > I was thinking of making shared code for entire kill, > > not just kill -l. This way we can save much more on code size. > > > > I am attaching my proposal. Please test & report whereever I goof up > > (a lot of subtle error cases there - kill_main must be very careful now > > to not exit, but return to caller!) > > The trick of using a space character to parse job numbers is a > good one, I did not find a work around in order to do the full > program of integrating both modes of operation into one code. > > In a first test run I could not uncover any errors, but I cannot > agree an the output for the full listing case "kill -l". The SUSv3 > specification gives the implementor his freedom, but I dislike > a long listing that include explicit numbers like 7, 16, and 22--31, > which do not correspond to named signals. I attach a patch to > correct this. Unfortunately it adds, in its present form, 16 bytes. I am incorporating this into a patch. Actually, having all 32 signal names included makes code AND signals[] vector smaller, so we can simply have all of them defined. But on other libc we still may have gaps, so I will use your check nevertheless. Thanks -- vda From farmatito at tiscali.it Tue May 1 14:25:06 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 1 May 2007 23:25:06 +0200 Subject: /etc/busybox.conf confusion [secutiry?] In-Reply-To: References: Message-ID: <200705012325.06872.farmatito@tiscali.it> On Tuesday 01 May 2007 10:16:44 Jan Evert van Grootheest wrote: > > > Tito, others, > > > > > > Sorry about this, but those su and passwd comments were with > my initial > > > patch applied. > > > > > > With original code, it is easiest to demonstrate using 'cat > > > /proc/self/status' with a suid root bbox and as a regular > user. Try both > > > with cat in bbox.conf as xxx and cat not present in bbox.conf. > > > When cat is present as xxx, privileges are not dropped. > > > > > > I ran into this because my environment had ash and sh as ssx > in > > > bbox.conf. Which I changed to xxx. And then still had not > proper > > > uids/gids. > > > > > > -- Jan Evert > > Hi, > > mv busybox /bin/busybox > > chown 0.0 /bin/busybox > > chmod 4755 /bin/busybox > > > > 1 ) not in busybox.conf: > > as normal user /bin/busybox cat /proc/self/status does not work > > Eh? For me (1.4.1 and patches) it works just fine if cat is not in > bbox.conf. > > Dumb question of the day... what are the permissions to your > /etc/busybox.conf? > > > > 2) in busybox.conf > > 2a) as normal user and cat = ssx 0.0 in busybox.conf > > /bin/busybox cat /proc/self/status works > > Name: busybox > > State: R (running) > > SleepAVG: 88% > > Tgid: 6937 > > Pid: 6937 > > PPid: 6416 > > TracerPid: 0 > > Uid: 1000 0 0 0 > > Gid: 1000 1000 1000 1000 > > Given the ssx, this result is somewhat expected, except that I would > expect gid to be '1000 0 0 0'? It seems that bbox actually did sxx. > > > > 2b) as normal user and cat = xxx 0.0 in busybox.conf > > /bin/busybox cat /proc/self/status does not work > > > > if in [SUID] stanza alphabetical order is respected > > [SUID] > > cat = xxx 0.0 > > passwd = ssx 0.0 > > # applet su can be run by anyone and runs with euid=0/egid=0 > > su = ssx root.0 > > # applet su can be run by anyone and runs with euid=0/egid=0 > > > > 2c) as normal user and cat = xxx 0.0 in busybox.conf it works > > > > /bin/busybox cat /proc/self/status works > > > > if in [SUID] stanza alphabetical order is not respected > > [SUID] > > passwd = ssx 0.0 > > # applet su can be run by anyone and runs with euid=0/egid=0 > > su = ssx root.0 > > # applet su can be run by anyone and runs with euid=0/egid=0 > > cat = xxx 0.0 > > > > Name: busybox > > State: R (running) > > SleepAVG: 58% > > Tgid: 6953 > > Pid: 6953 > > PPid: 6416 > > TracerPid: 0 > > Uid: 1000 0 0 0 > > Gid: 1000 1000 1000 1000 > > > > Seems that there is really something wrong here.... > > > > IMHO check_suid and parse_config_file should be totally > rewritten, > > the first to make it more readable and the second to reduce the > bloat as most of its features > > are unused at the moment. > > As for the ordering... my bbox.conf appears to be in the same order as > the applets are in 'make menuconfig'. But that's just an impression. At > least the applets are grouped according to the submenus in make > menuconfig. And withing the grouping they are alfabetically ordered. > > -- Jan Evert > > PS: sorry if Outlook makes a mess of this mail. I don't know how to make > it behave. It seems impossible. Just for the fun while studying how check_suid() works i've rewritten it.... Can you test if this fixes your problem? Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: applets.c Type: text/x-csrc Size: 16925 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070501/55164139/attachment.c From praba_rajah at yahoo.com Tue May 1 16:48:28 2007 From: praba_rajah at yahoo.com (Praba Rajah) Date: Tue, 1 May 2007 16:48:28 -0700 (PDT) Subject: Busybox --> telnetd question Message-ID: <295441.6395.qm@web50401.mail.re2.yahoo.com> Thank you very much Franklin!. Please see my comments below. >> Hello, >> >> I am new to Linux and busybox world. >> >> I have a target-board with arm processer with Linux 2.6.17-rc4 and >> busybox-1.5.0. I want to transfer files to/from my pc to the target-board. >> >> I can able to transfer files between target-board and PC from >> target-board using busybox "tftp" but not the otherway ( from pc). >If you have ftp server running on your pc, you can use ftpget/ftpput to >transfer from target to your pc. I can able to transfer file from my target board. >If you want to transfer files from PC to your target board, you can either run >a ftp/tftp server on your target system, or put lrzsz package on your target >board and transfer files using x/y/zmodem. Is there any lrzsz package for arm7 or 9 processors? I can only see armv41. >> My telnetd is running in my target board. >> >> If I telnet from the target board to PC I am getting " telnet: cannot >> connect to remote host( 192.168.x. xxx): connection refused" >Maybe you don't have telnetd running on your PC. I have installed PCTelD202A and able to telnet from target board to PC >> If I telnet to the target-board from PC ( using PuTTY), I am getting " >> Connection closed by remote host" window. >Did you set correct connection port (port 23 instead of 22)? How do I check this? I am using Putty and when I select "telnet" It is automatically changed to port 23 but still I am getting "Connection closed by remote host" error message. >Regards, >Franklin Again thank you for your help. --------------------------------- Ahhh...imagining that irresistible "new car" smell? Check outnew cars at Yahoo! Autos. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070501/a697987a/attachment-0001.htm From vda.linux at googlemail.com Tue May 1 17:38:48 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 2 May 2007 02:38:48 +0200 Subject: Bug in bb 1.5.0 ifupdown applet In-Reply-To: <4636896C.8040909@nothome.org> References: <4636896C.8040909@nothome.org> Message-ID: <200705020238.48677.vda.linux@googlemail.com> On Tuesday 01 May 2007 02:27, Nathan Angelacos wrote: > Hello, > > The ifupdown applet in 1.5.0 appears to have a bug that was not present > in 1.4.1. The bug is that /var/run/ifstate is not updated with all > interfaces if an interface stanza calls ifup statement to bring up a > second interface. 1.4.1 never reads /var/run/ifstate. It only writes it. So I highly doubt that 1.4.1 was better than 1.5.0. Most likely it was broken in a different way. Anyway, I'm attaching full diff between 1.4.1 and current svn for easy reference. > Given the following interfaces file: > > iface lo inet static > address 127.0.0.1 > netmask 255.0.0.0 > up ifup tunl > down ifdown tunl > > iface tunl inet manual > up modprobe ipip || true > up ip tun add tunl mode ipip local 127.0.0.1 remote 192.168.0.1 > up ip link set tunl up > down ip link set tunl down > down ip tunl del So you configured "ifup lo" to spawn another: "ifup tunl". > "ifup lo" correctly brings up lo and the tunl interface. However, > /var/run/ifstate only lists "lo=lo". > > An strace for "ifup lo" shows: > > 1. the "parent" ifup reads /var/run/ifstate > 2. the "parent" forks to run the child ifup > 2. the "child" ifup reads /var/run/ifstate > 3. the "child" writes its interface to /var/run/ifstate > 4. the "child" exits > 5. the "parent" writes its interface to /var/run/ifstate, using the info > from step 1 > > That is, the parent does not re-read ifstate before writing. You can attempt to go after these solutions: (a) provide a patch for ifupdown to read/write /var/run/ifstate AFTER child if done. (b) stop using ifup for network configuration, as it is unable to cover more complex cases anyway (like firewalls, traffic shaping etc). -- vda -------------- next part -------------- A non-text attachment was scrubbed... Name: ifup_1.4.1-svn.diff Type: text/x-diff Size: 4297 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070502/d74ff92c/attachment.bin From vda.linux at googlemail.com Tue May 1 17:45:47 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 2 May 2007 02:45:47 +0200 Subject: Busybox --> telnetd question In-Reply-To: <295441.6395.qm@web50401.mail.re2.yahoo.com> References: <295441.6395.qm@web50401.mail.re2.yahoo.com> Message-ID: <200705020245.47466.vda.linux@googlemail.com> On Wednesday 02 May 2007 01:48, Praba Rajah wrote: > Is there any lrzsz package for arm7 or 9 processors? I can only see armv41. You can also use http for file transfer. busybox includes both wget (for retrieving files) and httpd (for providing files). > >> My telnetd is running in my target board. > >> > >> If I telnet from the target board to PC I am getting " telnet: cannot > >> connect to remote host( 192.168.x. xxx): connection refused" > > >Maybe you don't have telnetd running on your PC. > I have installed PCTelD202A and able to telnet from target board to PC Hm, you can simply use busybox's telnet and telnetd on both ends. Unless your PC is under Windows, that is. > >> If I telnet to the target-board from PC ( using PuTTY), I am getting " > >> Connection closed by remote host" window. > > >Did you set correct connection port (port 23 instead of 22)? > How do I check this? I am using Putty and when I select "telnet" > It is automatically changed to port 23 but still I am getting > "Connection closed by remote host" error message. Because remote host closed the connection. What do you see on the wire (tcpdump)? Or strace of server process (strace -f -p `pidof telnetd`)? Can you describe how exactly do you start telnetd on target board? (command line + .config of busybox used at build time). -- vda From ma.alvarez at ziv.es Wed May 2 04:07:57 2007 From: ma.alvarez at ziv.es (Miguel Angel Alvarez) Date: Wed, 02 May 2007 13:07:57 +0200 Subject: klogd and syslogd Message-ID: <4638710D.5080902@ziv.es> Hi. We are substituting the use of busybox syslogd for our own log system (not at all generalistic... that is why I won' t try to submit patches for it). However we would like to maintain klogd as is. Why is the klogd configuration integrated into syslogd configuration? The communication mechanism between could be used in other systems. Wouldn't it be useful to split them? Thanks Miguel ?ngel Signed-off-by: Miguel Angel Alvarez diff -urP busybox-1.5.0_notpatched/sysklogd/Config.in busybox-1.5.0_patched/sysklogd/Config.in --- busybox-1.5.0_notpatched/sysklogd/Config.in 2007-05-02 11:19:01.000000000 +0200 +++ busybox-1.5.0_patched/sysklogd/Config.in 2007-05-02 11:19:41.000000000 +0200 @@ -88,8 +88,6 @@ config KLOGD bool "klogd" default n - depends on SYSLOGD - select FEATURE_SYSLOG help klogd is a utility which intercepts and logs all messages from the Linux kernel and sends the messages ----------------------------------------- PLEASE NOTE ------------------------------------------- This message, along with any attachments, may be confidential or legally privileged. It is intended only for the named person(s), who is/are the only authorized recipients. If this message has reached you in error, kindly destroy it without review and notify the sender immediately. Thank you for your help. ZIV uses virus scanning software but excludes any liability for viruses contained in any attachment. ------------------------------------ ROGAMOS LEA ESTE TEXTO ------------------------------- Este mensaje y sus anexos pueden contener informaci?n confidencial y/o con derecho legal. Est? dirigido ?nicamente a la/s persona/s o entidad/es rese?adas como ?nico destinatario autorizado. Si este mensaje le hubiera llegado por error, por favor elim?nelo sin revisarlo ni reenviarlo y notif?quelo inmediatamente al remitente. Gracias por su colaboraci?n. ZIV utiliza software antivirus, pero no se hace responsable de los virus contenidos en los ficheros anexos. From natanael.copa at gmail.com Wed May 2 06:13:36 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Wed, 02 May 2007 15:13:36 +0200 Subject: Bug in bb 1.5.0 ifupdown applet In-Reply-To: <200705020238.48677.vda.linux@googlemail.com> References: <4636896C.8040909@nothome.org> <200705020238.48677.vda.linux@googlemail.com> Message-ID: <1178111616.6616.10.camel@localhost> On Wed, 2007-05-02 at 02:38 +0200, Denis Vlasenko wrote: > On Tuesday 01 May 2007 02:27, Nathan Angelacos wrote: > > Hello, > > > > The ifupdown applet in 1.5.0 appears to have a bug that was not present > > in 1.4.1. The bug is that /var/run/ifstate is not updated with all > > interfaces if an interface stanza calls ifup statement to bring up a > > second interface. ... > You can attempt to go after these solutions: > > (a) provide a patch for ifupdown to read/write > /var/run/ifstate AFTER child if done. Attatched. The patch also removes this dead code (and memory leak): - /* iface_down */ - const llist_t *list = state_list; - while (list) { - llist_add_to_end(&target_list, xstrdup(list->data)); - list = list->link; - } - target_list = defn->autointerfaces; (first copy state_list to target_list and next second just reassign target_list???) It would be nice if patch could go into 1.5.1. Thanks! Natanael Copa -------------- next part -------------- A non-text attachment was scrubbed... Name: reentrant-ifupdown.patch Type: text/x-patch Size: 3346 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070502/a91c9b54/attachment.bin From vda.linux at googlemail.com Wed May 2 13:51:48 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 2 May 2007 22:51:48 +0200 Subject: Busybox project : DHCP Client multi instance possible ? In-Reply-To: <20070502160707.15460.qmail@web27312.mail.ukl.yahoo.com> References: <20070502160707.15460.qmail@web27312.mail.ukl.yahoo.com> Message-ID: <200705022251.48138.vda.linux@googlemail.com> Hi Yvon, Can you convince your mail client to wrap lines? I am CCing the list because discussing this with community may be useful. On Wednesday 02 May 2007 18:07, yvon le goue wrote: > Hello Denis, > > In our product, we want to monitor all the dhcp events in the different interfaces. For this, we want to have one thread called links_thread that will manage several dhcp client thread. > For example : > if one dhcp client doesn't arrive to have its IP address (no response from the DHCP server...), we want to know this information at a upper layer (in the link thread) to decide the behaviour that the product will have (the product is not operationnal or the product is in a restricted mode...) I think you are trying to reinvent the wheel. udhcpc executes an external program (shell script typically) on each state change. This program can be common to all running udhcpc's on different interfaces. It can be written so that it maintains coherent view as to what is the state of every interface, and do something sensible according to this information. This functionaly already exists. Use it. > So it is not for memory reason but for usefull management reason. For me, it's more easy to communicate information between thread in a same process (using memory) than between differents process (using socket). > Furthermore, the links thread is the parent thread, it will create/destroy the child dhcpc client instance. Writing this in C (by modifying udhcpc) is going to be slower, more bug prone, harder to debug, and harder to customize for the needs of different situations. Of course, it also will run faster, which is not important in real life - you don't get hundreds of dhcp state changes per second. -- vda From vda.linux at googlemail.com Wed May 2 14:09:12 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 2 May 2007 23:09:12 +0200 Subject: ifup / udev problem In-Reply-To: <460B8978.2060607@terra.es> References: <460B8978.2060607@terra.es> Message-ID: <200705022309.12122.vda.linux@googlemail.com> Hi Ignacio, Yes, a very late reply... better late than never. :( On Thursday 29 March 2007 11:40, Ignacio Garc?a P?rez wrote: > This used to work in my system but no longer does: > > I set up several SLIP interfaces using "slattach". As soon as the slX > interfaces show up, the udevd daemon calls, via a rules file, /sbin/ifup > for each interface. > > Then ifup fails miserably to configure the interface. The problem seems > to be that ifup *does not use absolute paths* for the external programs > it calls (run-parts, ip, etc), thus it relies on the PATH being properly > set. > > And udevd does not pass a PATH environment variable. > > My question is: what is the *proper* way to fix this? > > a) Manage to get udevd to pass a valid path to ifup. > > b) Fix ifup so it uses absolute paths to the external programs it uses. > > c) Fix ifup so it uses a meaningful default PATH > (/sbin:/bin:/usr/sbin:/usr/bin) when none is available. Preferably (a). (c) as last resort. (b) is bad - it's not ifup's business to direct where user has to keep his binaries. -- vda From vda.linux at googlemail.com Wed May 2 14:22:35 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 2 May 2007 23:22:35 +0200 Subject: Bug in bb 1.5.0 ifupdown applet In-Reply-To: <1178111616.6616.10.camel@localhost> References: <4636896C.8040909@nothome.org> <200705020238.48677.vda.linux@googlemail.com> <1178111616.6616.10.camel@localhost> Message-ID: <200705022322.35816.vda.linux@googlemail.com> On Wednesday 02 May 2007 15:13, Natanael Copa wrote: > On Wed, 2007-05-02 at 02:38 +0200, Denis Vlasenko wrote: > > On Tuesday 01 May 2007 02:27, Nathan Angelacos wrote: > > > Hello, > > > > > > The ifupdown applet in 1.5.0 appears to have a bug that was not present > > > in 1.4.1. The bug is that /var/run/ifstate is not updated with all > > > interfaces if an interface stanza calls ifup statement to bring up a > > > second interface. > ... > > You can attempt to go after these solutions: > > > > (a) provide a patch for ifupdown to read/write > > /var/run/ifstate AFTER child if done. > > > Attatched. > > The patch also removes this dead code (and memory leak): > - /* iface_down */ > - const llist_t *list = state_list; > - while (list) { > - llist_add_to_end(&target_list, xstrdup(list->data)); > - list = list->link; > - } > - target_list = defn->autointerfaces; > > (first copy state_list to target_list and next second just reassign > target_list???) Probably last line was a leftover... But I think you code looks better anyway. Nathan, care to test Natanael's patch? > It would be nice if patch could go into 1.5.1. Small question: after else below, we build new list, write it out if !NO_ACT, and then delete. If NO_ACT is true, then list is build and then deleted without any useful effect. Should we replace "else {...}" with "else if (!NO_ACT) {...}" ? if (!okay && !FORCE) { bb_error_msg("ignoring unknown interface %s", liface); any_failures = 1; } else { /* update the state file */ llist_t *state_list = read_iface_state(); llist_t *iface_state = find_iface_state(state_list, iface); if (cmds == iface_up) { char * const newiface = xasprintf("%s=%s", iface, liface); if (iface_state == NULL) { llist_add_to_end(&state_list, newiface); } else { free(iface_state->data); iface_state->data = newiface; } } else { /* Remove an interface from state_list */ llist_unlink(&state_list, iface_state); free(llist_pop(&iface_state)); } /* Actually write the new state */ if (!NO_ACT) { FILE *state_fp = xfopen("/var/run/ifstate", "w"); llist_t *state = state_list; while (state) { if (state->data) { fprintf(state_fp, "%s\n", state->data); } state = state->link; } fclose(state_fp); } llist_free(state_list, free); } -- vda From vda.linux at googlemail.com Wed May 2 14:41:01 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 2 May 2007 23:41:01 +0200 Subject: klogd and syslogd In-Reply-To: <4638710D.5080902@ziv.es> References: <4638710D.5080902@ziv.es> Message-ID: <200705022341.01283.vda.linux@googlemail.com> On Wednesday 02 May 2007 13:07, Miguel Angel Alvarez wrote: > Hi. > > We are substituting the use of busybox syslogd for our own log system > (not at all generalistic... that is why I won' t try to submit patches > for it). However we would like to maintain klogd as is. > > Why is the klogd configuration integrated into syslogd configuration? > The communication mechanism between could be used in other systems. > > Wouldn't it be useful to split them? Absolutely. I applied your patch to svn. -- vda From vapier at gentoo.org Wed May 2 14:54:36 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Wed, 2 May 2007 17:54:36 -0400 Subject: [patch/rfc] add fourth field to mdev.conf for subdirs Message-ID: <200705021754.36449.vapier@gentoo.org> there are a few common/important set of device nodes that only work when in the proper subdirectory ... for example, all of ALSA userland requires the sound nodes to be in /dev/snd/ and all of the input device nodes need to be in /dev/input/ we're using the attached patch by Sonic Zhang in our Blackfin distribution ... it simply changes the syntax from: : [command] to: : [subdir] [<@|$|*> command] the patch isnt 100% correct right now ... i'd like to see what ideas other people have -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 827 bytes Desc: This is a digitally signed message part. Url : http://busybox.net/lists/busybox/attachments/20070502/35d63dbf/attachment.pgp -------------- next part -------------- A non-text attachment was scrubbed... Name: mdev-subdirs.patch Type: text/x-diff Size: 3082 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070502/35d63dbf/attachment.bin From natanael.copa at gmail.com Wed May 2 14:54:23 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Wed, 2 May 2007 23:54:23 +0200 Subject: Bug in bb 1.5.0 ifupdown applet In-Reply-To: <200705022322.35816.vda.linux@googlemail.com> References: <4636896C.8040909@nothome.org> <200705020238.48677.vda.linux@googlemail.com> <1178111616.6616.10.camel@localhost> <200705022322.35816.vda.linux@googlemail.com> Message-ID: <20070502235423.09cd0c1a.natanael.copa@gmail.com> On Wed, 2 May 2007 23:22:35 +0200 Denis Vlasenko wrote: > Small question: after else below, we build new list, > write it out if !NO_ACT, and then delete. > > If NO_ACT is true, then list is build and then deleted > without any useful effect. > > Should we replace "else {...}" with "else if (!NO_ACT) {...}" ? duh.. ofcourse... Yes I think we should. Updated patch attatched. -------------- next part -------------- A non-text attachment was scrubbed... Name: reentrant-ifupdown2.patch Type: application/octet-stream Size: 3363 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070502/cbab58e2/attachment.obj From vda.linux at googlemail.com Wed May 2 15:22:38 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 3 May 2007 00:22:38 +0200 Subject: Bug in bb 1.5.0 ifupdown applet In-Reply-To: <20070502235423.09cd0c1a.natanael.copa@gmail.com> References: <4636896C.8040909@nothome.org> <200705022322.35816.vda.linux@googlemail.com> <20070502235423.09cd0c1a.natanael.copa@gmail.com> Message-ID: <200705030022.38138.vda.linux@googlemail.com> On Wednesday 02 May 2007 23:54, Natanael Copa wrote: > On Wed, 2 May 2007 23:22:35 +0200 > Denis Vlasenko wrote: > > > Small question: after else below, we build new list, > > write it out if !NO_ACT, and then delete. > > > > If NO_ACT is true, then list is build and then deleted > > without any useful effect. > > > > Should we replace "else {...}" with "else if (!NO_ACT) {...}" ? > > duh.. ofcourse... Yes I think we should. > Updated patch attatched. Applied, thanks. -- vda From vda.linux at googlemail.com Wed May 2 15:39:07 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 3 May 2007 00:39:07 +0200 Subject: /etc/busybox.conf confusion [secutiry?] In-Reply-To: <200705012325.06872.farmatito@tiscali.it> References: <200705012325.06872.farmatito@tiscali.it> Message-ID: <200705030039.07327.vda.linux@googlemail.com> On Tuesday 01 May 2007 23:25, Tito wrote: > Just for the fun while studying how check_suid() works i've rewritten it.... > Can you test if this fixes your problem? > > Ciao, > Tito I like it. I really do. But: /* if we are root this is skipped as suid_cfg_readable is 0 */ if (suid_cfg_readable) { ... } else { if (!ENABLE_FEATURE_SUID_CONFIG_QUIET) { static bool onetime = 0; if (ruid && !onetime) { onetime = 1; fprintf(stderr, "Using fallback suid method\n"); } } } if ENABLE_FEATURE_SUID_CONFIG_QUIET=n, root will always see bogus complaint. xsetuid(ruid); xsetgid(rgid); You have to set effective and saved ids, without touching real ids. This is needed by su etc to find whether they were called by non-root (they use getuid() for that). Or do this: (a) do not clobber static uid_t ruid, (b) make it visible in all applets [make it global, not static], (c) chase getuid() calls in all applets and replace them with testing global ruid. This can squize some tens of bytes and save few getuid() calls, but it's sorta complicated, especially that ruid variable currently exists only if FEATURE_SUID=y... probably this is needed: /* libbb.h */ #if ENABLE_FEATURE_SUID extern uid_t bb_ruid; #define BB_RUID() bb_ruid #else #define BB_RUID() getuid() #endif Oh... -- vda From daniel_ng11 at lycos.com Wed May 2 23:15:22 2007 From: daniel_ng11 at lycos.com (Daniel Ng) Date: Thu, 03 May 2007 02:15:22 -0400 (EDT) Subject: awk seg faults Message-ID: <20070503021522.HM.00000000000001O@daniel_ng11.bos-mail-wwl24.lycos.com> An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070503/6e028bb0/attachment.htm From natanael.copa at gmail.com Wed May 2 23:29:51 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Thu, 03 May 2007 08:29:51 +0200 Subject: [patch/rfc] add fourth field to mdev.conf for subdirs In-Reply-To: <200705021754.36449.vapier@gentoo.org> References: <200705021754.36449.vapier@gentoo.org> Message-ID: <1178173791.18554.20.camel@localhost> On Wed, 2007-05-02 at 17:54 -0400, Mike Frysinger wrote: > there are a few common/important set of device nodes that only work when in > the proper subdirectory ... for example, all of ALSA userland requires the > sound nodes to be in /dev/snd/ and all of the input device nodes need to be > in /dev/input/ > > we're using the attached patch by Sonic Zhang in our Blackfin distribution ... > it simply changes the syntax from: > : [command] > to: > : [subdir] [<@|$|*> command] Sometimes it is good to be able to rename the device itself too. For example, zapctl should go to zap/ctl and not zap/zapctl What about this syntax: : [subdir [dest]] [<@|$|*> command] or: : [[subdir/][dest]] [<@|$|*> command] where this happens if dest is specified: if last char in param is '/' then mkdir -p $param else mkdir -p $(dirname $param) MDEV=$(basename $param) fi create $MDEV > the patch isnt 100% correct right now ... i'd like to see what ideas other > people have I use a script, /lib/mdev/subdir_dev: #!/bin/sh # scripts that moves devices to the $1/ subdir. if [ "$ACTION" = remove ] ; then mv $1/$MDEV $MDEV rmdir $1 2>/dev/null else mkdir -p $1 mv $MDEV $1/$2 fi and the mdev.conf looks like this: # alsa sound devices pcm.* root:audio 0660 */lib/mdev/subdir_dev snd ... # zaptel devices zapctl root:dialout 0660 */lib/mdev/subdir_dev zap ctl zaptimer root:dialout 0660 */lib/mdev/subdir_dev zap timer ... I copied all my mdev stuff here: http://dev.alpinelinux.org/~ncopa/mdev/ (I have a script that will differ usb disks from scsi disks and that will load modules for usb devices (like webcams) It would be very nice if mdev could handle subdirs and renaming devices without depending on external scripts. Natanael Copa From farmatito at tiscali.it Wed May 2 23:42:02 2007 From: farmatito at tiscali.it (Tito) Date: Thu, 3 May 2007 08:42:02 +0200 Subject: /etc/busybox.conf confusion [secutiry?] In-Reply-To: <200705030039.07327.vda.linux@googlemail.com> References: <200705012325.06872.farmatito@tiscali.it> <200705030039.07327.vda.linux@googlemail.com> Message-ID: <200705030842.02642.farmatito@tiscali.it> On Thursday 03 May 2007 00:39:07 Denis Vlasenko wrote: > On Tuesday 01 May 2007 23:25, Tito wrote: > > Just for the fun while studying how check_suid() works i've rewritten it.... > > Can you test if this fixes your problem? > > > > Ciao, > > Tito > > I like it. I really do. But: > > /* if we are root this is skipped as suid_cfg_readable is 0 */ > if (suid_cfg_readable) { > ... > } else { > if (!ENABLE_FEATURE_SUID_CONFIG_QUIET) { > static bool onetime = 0; > > if (ruid && !onetime) { > onetime = 1; > fprintf(stderr, "Using fallback suid method\n"); > } > } > } > > > if ENABLE_FEATURE_SUID_CONFIG_QUIET=n, root will always see bogus complaint. Hi, Don't think so as we test for: if (ruid && !onetime) { so root ruid=0 will never see any bogus error message. > > xsetuid(ruid); > xsetgid(rgid); > You have to set effective and saved ids, without touching real ids. > This is needed by su etc to find whether they were called by non-root > (they use getuid() for that). Maybe we could change the call to: #define _GNU_SOURCE #include int setresuid(uid_t ruid, uid_t euid, uid_t suid); int setresgid(gid_t rgid, gid_t egid, gid_t sgid); DESCRIPTION setresuid() sets the real user ID, the effective user ID, and the saved set-user-ID of the current process. Unprivileged user processes may change the real UID, effective UID, and saved set-user-ID, each to one of: the current real UID, the current effective UID or the current saved set-user-ID. Privileged processes (on Linux, those having the CAP_SETUID capability) may set the real UID, effective UID, and saved set-user-ID to arbitrary values. If one of the parameters equals -1, the corresponding value is not changed. Regardless of what changes are made to the real UID, effective UID, and saved set-user-ID, the file system UID is always set to the same value as the (possibly new) effective UID. Completely analogously, setresgid() sets the real GID, effective GID, and saved set-group-ID of the current process (and always modifies the file system GID to be the same as the effective GID), with the same restrictions for non-privileged processes. > Or do this: (a) do not clobber static uid_t ruid, (b) make it visible > in all applets [make it global, not static], (c) chase getuid() calls > in all applets and replace them with testing global ruid. > > This can squize some tens of bytes and save few getuid() calls, but > it's sorta complicated, especially that ruid variable currently exists only > if FEATURE_SUID=y... probably this is needed: > > /* libbb.h */ > #if ENABLE_FEATURE_SUID > extern uid_t bb_ruid; > #define BB_RUID() bb_ruid > #else > #define BB_RUID() getuid() > #endif > > Oh... > -- > vda > Ciao, Tito From vapier at gentoo.org Wed May 2 23:49:55 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Thu, 3 May 2007 02:49:55 -0400 Subject: [patch/rfc] add fourth field to mdev.conf for subdirs In-Reply-To: <1178173791.18554.20.camel@localhost> References: <200705021754.36449.vapier@gentoo.org> <1178173791.18554.20.camel@localhost> Message-ID: <200705030249.56400.vapier@gentoo.org> On Thursday 03 May 2007, Natanael Copa wrote: > On Wed, 2007-05-02 at 17:54 -0400, Mike Frysinger wrote: > > there are a few common/important set of device nodes that only work when > > in the proper subdirectory ... for example, all of ALSA userland requires > > the sound nodes to be in /dev/snd/ and all of the input device nodes need > > to be in /dev/input/ > > > > we're using the attached patch by Sonic Zhang in our Blackfin > > distribution ... it simply changes the syntax from: > > : [command] > > to: > > : [subdir] [<@|$|*> command] > > Sometimes it is good to be able to rename the device itself too. For > example, zapctl should go to zap/ctl and not zap/zapctl heh, we account for zapctl as well actually ... i just didnt think noting it would be worthwhile as no one else would recognize it ;) > What about this syntax: > : [subdir [dest]] [<@|$|*> command] > > or: > : [[subdir/][dest]] [<@|$|*> > command] hmm, if we offered subdir and symlink, that'd account for your needs as well right ? -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 827 bytes Desc: This is a digitally signed message part. Url : http://busybox.net/lists/busybox/attachments/20070503/8d9693e8/attachment.pgp From natanael.copa at gmail.com Thu May 3 00:15:43 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Thu, 03 May 2007 09:15:43 +0200 Subject: [patch/rfc] add fourth field to mdev.conf for subdirs In-Reply-To: <200705030249.56400.vapier@gentoo.org> References: <200705021754.36449.vapier@gentoo.org> <1178173791.18554.20.camel@localhost> <200705030249.56400.vapier@gentoo.org> Message-ID: <1178176543.18554.24.camel@localhost> On Thu, 2007-05-03 at 02:49 -0400, Mike Frysinger wrote: > On Thursday 03 May 2007, Natanael Copa wrote: ... > > What about this syntax: > > : [subdir [dest]] [<@|$|*> command] > > > > or: > > : [[subdir/][dest]] [<@|$|*> > > command] > > hmm, if we offered subdir and symlink, that'd account for your needs as well > right ? right. Natanael From mats.andersson64 at comhem.se Thu May 3 03:44:25 2007 From: mats.andersson64 at comhem.se (Mats Erik Andersson) Date: Thu, 03 May 2007 12:44:25 +0200 Subject: For ash shell: functional "type -p" Message-ID: <1178189065.3442.12.camel@localhost> I have been missing, inside ash, a short path response from the type builtin: $ type -p tail /usr/bin/tail The attached difference file ackomplishes this in a somewhat cheating manner, since it only detect whether the first argument of "type" begins with a dash, and then verbosity is switched off. I might be prejudiced, but the ASH_CMDCMD conditionals inside typecmd() and describe_command() seem utterly pointless, so they are removed in order to implement this "short type" functionality. Regards, Mats E A -------------- next part -------------- A non-text attachment was scrubbed... Name: type_with_only_path.diff Type: text/x-patch Size: 730 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070503/52c0167e/attachment.bin From natanael.copa at gmail.com Thu May 3 04:12:51 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Thu, 03 May 2007 13:12:51 +0200 Subject: Bug in bb 1.5.0 ifupdown applet In-Reply-To: <200705030022.38138.vda.linux@googlemail.com> References: <4636896C.8040909@nothome.org> <200705022322.35816.vda.linux@googlemail.com> <20070502235423.09cd0c1a.natanael.copa@gmail.com> <200705030022.38138.vda.linux@googlemail.com> Message-ID: <1178190771.18554.33.camel@localhost> On Thu, 2007-05-03 at 00:22 +0200, Denis Vlasenko wrote: > On Wednesday 02 May 2007 23:54, Natanael Copa wrote: > > On Wed, 2 May 2007 23:22:35 +0200 > > Denis Vlasenko wrote: > > > > > Small question: after else below, we build new list, > > > write it out if !NO_ACT, and then delete. > > > > > > If NO_ACT is true, then list is build and then deleted > > > without any useful effect. > > > > > > Should we replace "else {...}" with "else if (!NO_ACT) {...}" ? > > > > duh.. ofcourse... Yes I think we should. > > Updated patch attatched. > > Applied, thanks. Denis, Could you please add it to fixes-1.5.0? Thanks! Natanael Copa From nangel at nothome.org Thu May 3 05:13:45 2007 From: nangel at nothome.org (Nathan Angelacos) Date: Thu, 03 May 2007 12:13:45 +0000 Subject: Bug in bb 1.5.0 ifupdown applet In-Reply-To: <200705030022.38138.vda.linux@googlemail.com> References: <4636896C.8040909@nothome.org> <200705022322.35816.vda.linux@googlemail.com> <20070502235423.09cd0c1a.natanael.copa@gmail.com> <200705030022.38138.vda.linux@googlemail.com> Message-ID: <4639D1F9.1000501@nothome.org> Denis Vlasenko wrote: > On Wednesday 02 May 2007 23:54, Natanael Copa wrote: >> On Wed, 2 May 2007 23:22:35 +0200 >> Denis Vlasenko wrote: >> >>> Small question: after else below, we build new list, >>> write it out if !NO_ACT, and then delete. >>> >>> If NO_ACT is true, then list is build and then deleted >>> without any useful effect. >>> >>> Should we replace "else {...}" with "else if (!NO_ACT) {...}" ? >> duh.. ofcourse... Yes I think we should. >> Updated patch attatched. > > Applied, thanks. > -- > vda Denis, Sorry for the late reply... I just tried the last patch and it works perfectly. It would be helpful if this patch got added to fixes-1.5.0. Many thanks to you and Natanael. From lists at foxhill.co.uk Thu May 3 08:16:01 2007 From: lists at foxhill.co.uk (Ian Oliver) Date: Thu, 03 May 2007 16:16:01 +0100 Subject: Re-Exec init after pivot_root In-Reply-To: <9709bd390703210227id6b0cc5i65f135632201bfc3@mail.gmail.com> Message-ID: In article <9709bd390703210227id6b0cc5i65f135632201bfc3 at mail.gmail.com>, Alberto Donato wrote: > I agree with Denis. I'm using the same process to update a system > partition on an embedded system using another one as update system. > Basically these are the steps: > > mount $UPDATE_PARTITION $UPDATE_DIR > cd $UPDATE_DIR > pivot_root . old_root > chroot . /bin/kill -QUIT 1 & [reply to rather old email!] Wow, thanks, that's exactly what we needed to reflash our cramfs/squashfs based embedded system. This will save us a lot of messing around with initrd phases etc. We'll just copy what we need for the reflash phase to a ramfs, perform the steps above, and away we should go. Regards Ian From Alexander at Kriegisch.name Thu May 3 14:55:41 2007 From: Alexander at Kriegisch.name (Alexander Kriegisch) Date: Thu, 03 May 2007 23:55:41 +0200 Subject: awk seg faults In-Reply-To: <20070503021522.HM.00000000000001O@daniel_ng11.bos-mail-wwl24.lycos.com> References: <20070503021522.HM.00000000000001O@daniel_ng11.bos-mail-wwl24.lycos.com> Message-ID: <463A5A5D.3010406@Kriegisch.name> The same here with BB 1.4.1 on mipsel ohio, kernel 2.6.13.1 (Fritz!Box router series). An old bug. -- Alexander Kriegisch > This seems to be another case of awk seg faulting. > > On my system, I only need to type 'awk' on the command line to reproduce > this symptom: From souf_oued at yahoo.fr Thu May 3 15:36:03 2007 From: souf_oued at yahoo.fr (Souf) Date: Fri, 04 May 2007 00:36:03 +0200 Subject: [patch] for "util-linux/mdev.c": make it able to create symlinks and subdirectories Message-ID: <1178231763.3252.7.camel@localhost.localdomain> This patch adds to mdev.c the ability to create symlinks and subdirectories: examples: stderr -> /proc/self/fd/2 pcmC[0-9]D[0-9]c 0:0 0666 >> /dev/snd/ 0755 modified files: util-linux/mdev.c docs/mdev.txt this patch is for the test before integration Malek -------------- next part -------------- A non-text attachment was scrubbed... Name: mdev.patch Type: text/x-patch Size: 10522 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070504/6a71004f/attachment.bin From vda.linux at googlemail.com Thu May 3 15:59:08 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 4 May 2007 00:59:08 +0200 Subject: awk seg faults In-Reply-To: <20070503021522.HM.00000000000001O@daniel_ng11.bos-mail-wwl24.lycos.com> References: <20070503021522.HM.00000000000001O@daniel_ng11.bos-mail-wwl24.lycos.com> Message-ID: <200705040059.08135.vda.linux@googlemail.com> On Thursday 03 May 2007 08:15, Daniel Ng wrote: > This seems to be another case of awk seg faulting. > > On my system, I only need to type 'awk' on the command line to reproduce this symptom: > > Line 2660 of awk.c. The body of the for() loop never gets to execute because > envp is NULL and so *envp causes the seg fault: > > 2660: for (envp=environ; *envp; envp++) { > 2661: s = bb_xstrdup(*envp); > 2662: s1 = strchr(s, '='); > 2663: if (!s1) { > 2664: goto keep_going; > 2665: } > > If I change line 2660 to: > > for (envp=environ;( envp && (*envp) ); envp++) { > > -it doesn't seg fault anymore. Fixed. Thanks! > Can someone explain why envp is NULL in the first place? I am surprised too. -- vda From lists at zelow.no Sat May 5 23:45:29 2007 From: lists at zelow.no (Thomas Lundquist) Date: Sun, 6 May 2007 08:45:29 +0200 Subject: [patch] New-applet howto. Message-ID: <20070506064529.GA1286@zelow.no> I thought I'd piggyback an applet to this patch but since I'm not done yet I'd better just send this one since it was asked for. (Hmm, maybe I should be added as a maintainer.. ) Thomas. -------------- next part -------------- A non-text attachment was scrubbed... Name: new_applet.patch Type: text/x-diff Size: 3220 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070506/da1fb4be/attachment.bin From lists at zelow.no Sun May 6 01:17:42 2007 From: lists at zelow.no (Thomas Lundquist) Date: Sun, 6 May 2007 10:17:42 +0200 Subject: [patch] New-applet howto. (and new applet) In-Reply-To: <20070506064529.GA1286@zelow.no> References: <20070506064529.GA1286@zelow.no> Message-ID: <20070506081742.GA28680@zelow.no> On Sun, May 06, 2007 at 08:45:29AM +0200, Thomas Lundquist wrote: > > I thought I'd piggyback an applet to this patch but since I'm not done > yet I'd better just send this one since it was asked for. Well, did it anyway. cryptpw, tried it before, trying again :=) also a little change to the howto. Thomas. From lists at zelow.no Sun May 6 01:49:03 2007 From: lists at zelow.no (Thomas Lundquist) Date: Sun, 6 May 2007 10:49:03 +0200 Subject: [patch] New-applet howto. (and new applet) In-Reply-To: <20070506081742.GA28680@zelow.no> References: <20070506064529.GA1286@zelow.no> <20070506081742.GA28680@zelow.no> Message-ID: <20070506084903.GB28680@zelow.no> On Sun, May 06, 2007 at 10:17:42AM +0200, Thomas Lundquist wrote: > > Well, did it anyway. > > cryptpw, tried it before, trying again :=) > > also a little change to the howto. and this time, the patch. Thomas -------------- next part -------------- A non-text attachment was scrubbed... Name: cryptpw.patch Type: text/x-diff Size: 10094 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070506/1661574a/attachment.bin From vda.linux at googlemail.com Sun May 6 16:07:38 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 7 May 2007 01:07:38 +0200 Subject: [patch] New-applet howto. (and new applet) In-Reply-To: <20070506084903.GB28680@zelow.no> References: <20070506064529.GA1286@zelow.no> <20070506081742.GA28680@zelow.no> <20070506084903.GB28680@zelow.no> Message-ID: <200705070107.38880.vda.linux@googlemail.com> On Sunday 06 May 2007 10:49, Thomas Lundquist wrote: > On Sun, May 06, 2007 at 10:17:42AM +0200, Thomas Lundquist wrote: > > > > Well, did it anyway. > > > > cryptpw, tried it before, trying again :=) > > > > also a little change to the howto. > > and this time, the patch. +#define cryptpw_trivial_usage \ + "[-a des|md5] string" +#define cryptpw_full_usage \ + "Outputs a crypted version of the string.\n" \ + "Options:\n" \ + "\t-a\tDefine which algorithm shall be used for the password.\n" \ + "\t\t\t(Choices: des, md5" \ + ". Default is md5.)" \t's invariably get incorrectly lined up without any fast way to see it. Please read the comment on top of include/usage.h. +#include +#include +#include + +#include "busybox.h" busybox.h already includes most "usual" things. Drop #include etc. -static void crypt_make_salt(char *p, int cnt) You seem to delete crypt_make_salt() from passwd.c, but never add it anywhere. Where is crypt_make_salt.c? + if (argc) { + + clear = argv[0]; + + } else { + + clear = xmalloc_fgets(stdin); + clen = strlen(clear); + + if(clear[clen-1]=='\n') + clear[--clen] = '\0'; + + } + + + /* + + These two used to be in obscure.c but have now been removed. Well, why so many empty lines? -- vda From vda.linux at googlemail.com Sun May 6 16:11:21 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 7 May 2007 01:11:21 +0200 Subject: hush a bit improved, much work remains Message-ID: <200705070111.21752.vda.linux@googlemail.com> Hi people, Want to let you know that I was playing with hush lately, as it looks small and understandable. Trying to fix what seems to work incorrectly or is outright missing. Please keep in mind that this activity may make hush a bit unstable in current svn. -- vda From vda.linux at googlemail.com Sun May 6 16:23:30 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 7 May 2007 01:23:30 +0200 Subject: D-Link DSL-362T Message-ID: <200705070123.30918.vda.linux@googlemail.com> Hi people, This is going to be a mostly useless rant, feel free to ignore. I am intermittently using D-Link DSL-362T xDSL router for Internet connectivity. This box uses Linux and old version of busybox. Whoever hacked together the "firmware" for this crapbox did a great disservice to Linux and busybox. It works horribly sometimes, that is, when it works at all. Setting up default route appears to be hugely difficult task. If one does not connect USB cable, device doesn't set default route 99% of the time, for no apparent reason. Need to do it by hand. Packets with nonzero TOS seem to be blackholed. It means say goodbye to ssh and ntp. Telnet server obviously has difficulty exiting cleanly. More than half of the time after I type "exit" in shell connection is not broken. Inevitable slowdown and hang after a few hours of work nicely complements the picture. What people will think about Linux crowd if we will make such crappy products? Shame! -- vda From lists at zelow.no Mon May 7 04:14:53 2007 From: lists at zelow.no (Thomas Lundquist) Date: Mon, 7 May 2007 13:14:53 +0200 Subject: [patch] New-applet howto. (and new applet) In-Reply-To: <200705070107.38880.vda.linux@googlemail.com> References: <20070506064529.GA1286@zelow.no> <20070506081742.GA28680@zelow.no> <20070506084903.GB28680@zelow.no> <200705070107.38880.vda.linux@googlemail.com> Message-ID: <20070507111453.GA29302@zelow.no> On Mon, May 07, 2007 at 01:07:38AM +0200, Denis Vlasenko wrote: > > \t's invariably get incorrectly lined up without any fast way to see it. > Please read the comment on top of include/usage.h. changed since I made the applet the first time, should have checked. > busybox.h already includes most "usual" things. Drop #include etc. done, also added about it in the howto. > You seem to delete crypt_make_salt() from passwd.c, but never add it anywhere. > Where is crypt_make_salt.c? not added, done now. > Well, why so many empty lines? I find it easier to read but I've cut down a few. new patch attached. Thomas. -------------- next part -------------- A non-text attachment was scrubbed... Name: cryptpw.patch Type: text/x-diff Size: 11171 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070507/77c4eb12/attachment.bin From hamish at cloud.net.au Mon May 7 05:23:10 2007 From: hamish at cloud.net.au (Hamish Moffatt) Date: Mon, 7 May 2007 22:23:10 +1000 Subject: syslog messages truncated Message-ID: <20070507122310.GA15618@cloud.net.au> Hi, I've just installed busybox 1.4.2 on an embedded ARM system using uclibc 0.9.28.3. (I'll try 1.5.0 next but the web site warns it may not be stable yet.) syslog messages are being truncated. This happens regardless of their source (klogd, logger, other programs), with the exception of syslogd's own internal messages. For example: hostname# cat /var/log/messages Jan 1 00:00:04 hostname syslog.info syslogd started: BusyBox v1.4.2 Jan 1 00:00:04 hostname user.warn kernel: ixp Jan 1 00:00:04 hostname user.debug kernel: ixp Jan 1 00:00:04 hostname user.info kernel: ixp Jan 1 00:00:04 hostname user.info kernel: ixp Jan 1 00:00:05 hostname user.warn kernel: [er Jan 1 00:00:05 hostname user.warn kernel: [er Jan 1 00:00:06 hostname user.info kernel: ixp Jan 1 00:00:06 hostname user.warn kernel: Ini Jan 1 00:00:06 hostname user.warn kernel: ixp Jan 1 00:00:06 hostname user.warn kernel: ixp Jan 1 00:00:07 hostname daemon.info init: Start Jan 1 00:00:09 hostname user.warn kernel: ixp Jan 1 00:01:58 hostname auth.info login[678]: Jan 1 00:20:04 hostname syslog.info -- MARK -- Jan 1 00:40:04 hostname syslog.info -- MARK -- Jan 1 01:00:04 hostname syslog.info -- MARK -- Jan 1 01:20:04 hostname syslog.info -- MARK -- Jan 1 01:40:04 hostname syslog.info -- MARK -- Jan 1 02:00:04 hostname syslog.info -- MARK -- Jan 1 02:20:04 hostname syslog.info -- MARK -- Jan 1 02:28:21 hostname auth.info login[682]: hostname# logger "abcdefghij" hostname# tail -2 /var/log/messages Jan 1 02:28:21 hostname auth.info login[682]: Jan 1 02:28:43 hostname user.notice root: abcde I couldn't find any hits for this on Google. Is it a known problem? Thanks, Hamish -- Hamish Moffatt VK3SB From stephane.billiart at gmail.com Mon May 7 06:45:26 2007 From: stephane.billiart at gmail.com (Stephane Billiart) Date: Mon, 07 May 2007 09:45:26 -0400 Subject: syslog messages truncated In-Reply-To: <20070507122310.GA15618@cloud.net.au> References: <20070507122310.GA15618@cloud.net.au> Message-ID: <20070507134526.GC3696@salusa.home.net> On 07/05/07 ? ? 22:23, Hamish Moffatt wrote: > Hi, > > I've just installed busybox 1.4.2 on an embedded ARM system using uclibc > 0.9.28.3. (I'll try 1.5.0 next but the web site warns it may not be > stable yet.) > > syslog messages are being truncated. This happens regardless of their > source (klogd, logger, other programs), with the exception of syslogd's > own internal messages. For example: [...] This was discussed here http://busybox.net/lists/busybox/2007-March/026760.html It is fixed in 1.5.0 -- St?phane Billiart http://perso.orange.fr/billiart/ From cristian.ionescu-idbohrn at axis.com Mon May 7 08:27:52 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Mon, 7 May 2007 17:27:52 +0200 (CEST) Subject: svn trunk won't build on a debian sarge box Message-ID: <0705071657110.19336@somehost> Anyone else being hit by this? ,---- | ... | .debug_loc | *(.debug_loc) | | .debug_macinfo | *(.debug_macinfo) | | .debug_weaknames | *(.debug_weaknames) | | .debug_funcnames | *(.debug_funcnames) | | .debug_typenames | *(.debug_typenames) | | .debug_varnames | *(.debug_varnames) | | /DISCARD/ | *(.note.GNU-stack) | OUTPUT(busybox_unstripped elf32-i386) | collect2: ld returned 1 exit status | strip: 'busybox_unstripped': No such file `---- gcc: 4:3.3.5-3 binutils: 2.15-6 libc6: 2.3.2.ds1-22sarge5 make: 3.80-9 To reproduce: # make allnoconfig # make menuconfig enable debian utils start-stop-daemon, save .config and exit # make No such problems on a debian etch box with: gcc: 4:4.1.1-15 binutils: 2.17-3 libc6: 2.3.6.ds1-13 make: 3.81-2 The FAQ states bb should build with "gcc 3.2, make 3.79.1, and glibc 2.3". Cheers, Cristian From praba_rajah at yahoo.com Mon May 7 09:22:52 2007 From: praba_rajah at yahoo.com (Praba Rajah) Date: Mon, 7 May 2007 09:22:52 -0700 (PDT) Subject: Unable to bring a ttyAM console Message-ID: <485426.11409.qm@web50406.mail.re2.yahoo.com> Hello, I am trying to telnet from my PC ( Win XP os) to my target-board ( ARM + Linux + Busybox). I couldn't able to bring a getty console. If I set to spawn a getty in "inittab" file " ttyAM1::respawn:/sbin/getty 38400 ttyAM1" I am getting following error message continuously when target board is booting "Can't open /dev/ttyAM1: No such device or address process '/sbin/getty 38400 ttyAM1' (pid 1346) exited. Scheduling it for restart." I am using Busybox 1.5 and linux 2.6.17 and ARM. What am I doing wrong? Praba --------------------------------- It's here! Your new message! Get new email alerts with the free Yahoo! Toolbar. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070507/74ab1a14/attachment-0001.htm From vda.linux at googlemail.com Mon May 7 14:54:29 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 7 May 2007 23:54:29 +0200 Subject: svn trunk won't build on a debian sarge box In-Reply-To: <0705071657110.19336@somehost> References: <0705071657110.19336@somehost> Message-ID: <200705072354.29200.vda.linux@googlemail.com> On Monday 07 May 2007 17:27, Cristian Ionescu-Idbohrn wrote: > Anyone else being hit by this? > > ,---- > | ... > | .debug_loc > | *(.debug_loc) > | > | .debug_macinfo > | *(.debug_macinfo) > | > | .debug_weaknames > | *(.debug_weaknames) > | > | .debug_funcnames > | *(.debug_funcnames) > | > | .debug_typenames > | *(.debug_typenames) > | > | .debug_varnames > | *(.debug_varnames) > | > | /DISCARD/ > | *(.note.GNU-stack) > | OUTPUT(busybox_unstripped elf32-i386) > | collect2: ld returned 1 exit status > | strip: 'busybox_unstripped': No such file > `---- ?! You see the above as error message? > gcc: 4:3.3.5-3 > binutils: 2.15-6 > libc6: 2.3.2.ds1-22sarge5 > make: 3.80-9 > > To reproduce: > > # make allnoconfig > # make menuconfig > enable debian utils start-stop-daemon, save .config and exit > # make It's usually simpler to just attach your .config > No such problems on a debian etch box with: > > gcc: 4:4.1.1-15 > binutils: 2.17-3 > libc6: 2.3.6.ds1-13 > make: 3.81-2 > > The FAQ states bb should build with "gcc 3.2, make 3.79.1, and glibc > 2.3". I guess your binutils are too old for --gc-sections to work right. -- vda From vda.linux at googlemail.com Mon May 7 14:59:32 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 7 May 2007 23:59:32 +0200 Subject: Unable to bring a ttyAM console In-Reply-To: <485426.11409.qm@web50406.mail.re2.yahoo.com> References: <485426.11409.qm@web50406.mail.re2.yahoo.com> Message-ID: <200705072359.32836.vda.linux@googlemail.com> On Monday 07 May 2007 18:22, Praba Rajah wrote: > Hello, > > I am trying to telnet from my PC ( Win XP os) to my target-board ( ARM + Linux + Busybox). > > I couldn't able to bring a getty console. > > If I set to spawn a getty in "inittab" file > > " ttyAM1::respawn:/sbin/getty 38400 ttyAM1" > > I am getting following error message continuously when target board is booting > > "Can't open /dev/ttyAM1: No such device or address errno == ENXIO. Well it basically says it all. It cannot open /dev/ttyAM1. /dev/ttyAM1 exists ans is probably a char device node, but kernel has no corresponding device. Maybe your kernel doesn't detect your hardware, or /dev/ttyAM1 has wrong major/minor. Post ls -l of /dev and your kernel boot log, maybe other ARM people will spot something. -- vda From vda.linux at googlemail.com Mon May 7 15:03:48 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 8 May 2007 00:03:48 +0200 Subject: syslog messages truncated In-Reply-To: <20070507122310.GA15618@cloud.net.au> References: <20070507122310.GA15618@cloud.net.au> Message-ID: <200705080003.48826.vda.linux@googlemail.com> On Monday 07 May 2007 14:23, Hamish Moffatt wrote: > Hi, > > I've just installed busybox 1.4.2 on an embedded ARM system using uclibc > 0.9.28.3. (I'll try 1.5.0 next but the web site warns it may not be > stable yet.) > > syslog messages are being truncated. This happens regardless of their > source (klogd, logger, other programs), with the exception of syslogd's > own internal messages. For example: > > hostname# cat /var/log/messages > Jan 1 00:00:04 hostname syslog.info syslogd started: BusyBox v1.4.2 > Jan 1 00:00:04 hostname user.warn kernel: ixp > Jan 1 00:00:04 hostname user.debug kernel: ixp > Jan 1 00:00:04 hostname user.info kernel: ixp > Jan 1 00:00:04 hostname user.info kernel: ixp > Jan 1 00:00:05 hostname user.warn kernel: [er > Jan 1 00:00:05 hostname user.warn kernel: [er > Jan 1 00:00:06 hostname user.info kernel: ixp > Jan 1 00:00:06 hostname user.warn kernel: Ini > Jan 1 00:00:06 hostname user.warn kernel: ixp > Jan 1 00:00:06 hostname user.warn kernel: ixp > Jan 1 00:00:07 hostname daemon.info init: Start > Jan 1 00:00:09 hostname user.warn kernel: ixp > Jan 1 00:01:58 hostname auth.info login[678]: > Jan 1 00:20:04 hostname syslog.info -- MARK -- > Jan 1 00:40:04 hostname syslog.info -- MARK -- > Jan 1 01:00:04 hostname syslog.info -- MARK -- > Jan 1 01:20:04 hostname syslog.info -- MARK -- > Jan 1 01:40:04 hostname syslog.info -- MARK -- > Jan 1 02:00:04 hostname syslog.info -- MARK -- > Jan 1 02:20:04 hostname syslog.info -- MARK -- > Jan 1 02:28:21 hostname auth.info login[682]: > hostname# logger "abcdefghij" > hostname# tail -2 /var/log/messages > Jan 1 02:28:21 hostname auth.info login[682]: > Jan 1 02:28:43 hostname user.notice root: abcde > > I couldn't find any hits for this on Google. Is it a known problem? Yes, I mistakenly thought that BUFSIZ is big enough and used BUFSIZ-sized buffer for data in syslogd. But uclibc can be configured to have very small BUFSIZ. The bug is fixed in newer busybox. Alternatively, rebuild uclibc with a bit larger BUFSIZ (like 2k?) -- vda From vda.linux at googlemail.com Mon May 7 15:39:55 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 8 May 2007 00:39:55 +0200 Subject: [patch] New-applet howto. (and new applet) In-Reply-To: <20070507111453.GA29302@zelow.no> References: <20070506064529.GA1286@zelow.no> <200705070107.38880.vda.linux@googlemail.com> <20070507111453.GA29302@zelow.no> Message-ID: <200705080039.56025.vda.linux@googlemail.com> On Monday 07 May 2007 13:14, Thomas Lundquist wrote: > On Mon, May 07, 2007 at 01:07:38AM +0200, Denis Vlasenko wrote: > > > > \t's invariably get incorrectly lined up without any fast way to see it. > > Please read the comment on top of include/usage.h. > > changed since I made the applet the first time, should have checked. > > > busybox.h already includes most "usual" things. Drop #include etc. > > done, also added about it in the howto. > > > You seem to delete crypt_make_salt() from passwd.c, but never add it anywhere. > > Where is crypt_make_salt.c? > > not added, done now. > > > Well, why so many empty lines? > > I find it easier to read but I've cut down a few. > > new patch attached. +#define cryptpw_trivial_usage \ + "[-a des|md5] string" +#define cryptpw_full_usage \ + "Outputs a crypted version of the string.\n" \ + "This also takes stdin as password\n" \ + "\n\nOptions:\n" \ + " -a Set algorithm for the password.\n" \ + " (Choices: des, md5. Default is md5.) //vda" string is optional, thus should be [string]. "This also takes stdin as password\n" - what does this exactly mean? +int cryptpw_main(int argc, char **argv) +{ + char *clear; + char *crypted; crypted is used just once. do you really need this variable? + char salt[12]; /* "$N$XXXXXXXX" or "XX" */ + + unsigned opt; opt is unused (well, assigned and never used after) + const char *opt_a = ""; + + int md5 = 1; /* -a - password algorithm default: md5 */ + int clen; + + opt = getopt32(argc, argv, "a:", &opt_a); + + /* move past the commandline options */ + argc -= optind; argc usage here and below can be eliminated + argv += optind; + + if (!opt_a) + bb_show_usage(); Never going to happen. + + if (strcasecmp(opt_a, "des") == 0) /* -a */ + md5 = 0; Can't you just compare there below instead of 'md5 == 1' check? you don't need md5 variable then. + + if (argc) { + clear = argv[0]; + } else { + clear = xmalloc_fgets(stdin); + clen = strlen(clear); + + if(clear[clen-1]=='\n') //vda + clear[--clen] = '\0'; use xmalloc_getline and nuke clen. + } + + crypt_make_salt(salt, 1); /* des */ + if (md5 == 1) { + strcpy(salt, "$1$"); + crypt_make_salt(salt + 3, 4); + } + + crypted = pw_encrypt(clear, salt); + printf("%s\n", crypted); Use puts() instead? + + return (0); + +} My version is attached. Size: adding cryptpw yields: # size busybox_old busybox_unstripped text data bss dec hex filename 717644 2932 27472 748048 b6a10 busybox_old 717908 2932 27472 748312 b6b18 busybox_unstripped # make bloatcheck function old new delta cryptpw_main - 198 +198 .rodata 130867 130931 +64 packed_usage 22479 22509 +30 applets 3048 3060 +12 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/0 up/down: 304/0) Total: 304 bytes [heh, packed_usage counted twice (as itself and as rodata)] Please review/test patch, and we can merget it. I like this applet. -- vda -------------- next part -------------- A non-text attachment was scrubbed... Name: 7.patch Type: text/x-diff Size: 12271 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070508/4e7f86c4/attachment.bin From vda.linux at googlemail.com Mon May 7 15:56:11 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 8 May 2007 00:56:11 +0200 Subject: hush a bit improved, much work remains In-Reply-To: <000c01c790d3$6486e610$c814a8c0@IPAQ> References: <000c01c790d3$6486e610$c814a8c0@IPAQ> Message-ID: <200705080056.11336.vda.linux@googlemail.com> On Monday 07 May 2007 20:13, Martin Linux wrote: > i did notice you did a lot of changes on hush lately (its also smaller) > > im not sure if you would like some rookie linux user give you results on > hush ? > > im using hush (1.1.3) on a non MMU ARM system (kiss dvd player) Uhhhh... I saw the code, I can tell you for sure: hush cannot work correctly on NOMMU machine. Well, it will sort of work, but it's buggy (child internal state will leak into parent, which will manifest as weird bugs). > im only using linux for +- 1 year, and i never did learn how to program so > im not sure if you will like this kind of feedback > > But i can already tel you that the cvs dont "work" the same as the 1.1.3 and > that i still need the old version I am interested in any examples of what worked in hush in any older busybox version, but stopped to work recently. > if i try this hush script: > > #!/bin/hush > mount > /tmp/stage2.tmp > grep -q /hdd /tmp/stage2.tmp > c=$? > echo "c=$c" > while [ $c -eq 1 ] > do > sleep 1 > mount > /tmp/stage2.tmp > grep -q /hdd /tmp/stage2.tmp > c=$? > echo "c=$c" > done > > it will give me only 1 results and im not 100% sure if this is a hush bug > (same result on i386 btw) > > but this problem is already in the old and new version > > If you want i can give you better feedback One thing which does not require C skills is adapting existing ash testsuite to also test hush. ash testsuite lives in busybox/shell/ash_test and is not big at all. This will help keeping hush from breaking (or at least make breakage easier to notice faster). Volunteers welcome. -- vda From vda.linux at googlemail.com Mon May 7 16:02:24 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 8 May 2007 01:02:24 +0200 Subject: Mail delivery failed: returning message to sender In-Reply-To: <200705072256.l47MuV1W030005@mail.acampo.net> References: <200705072256.l47MuV1W030005@mail.acampo.net> Message-ID: <200705080102.24489.vda.linux@googlemail.com> To whom it may concern: On Tuesday 08 May 2007 00:56, Mail Delivery System wrote: > The original message was received at Tue, 8 May 2007 00:56:31 +0200 from vda.linux at googlemail.com by Acampo.net > > Error: No space left in the mailbox. I unsubscribed relevant email from busybox ml. -- vda From Alexander at Kriegisch.name Mon May 7 17:51:48 2007 From: Alexander at Kriegisch.name (Alexander Kriegisch) Date: Tue, 08 May 2007 02:51:48 +0200 Subject: tftp timeouts in 1.4.1 Message-ID: <463FC9A4.9030100@Kriegisch.name> mipsel ohio, kernel 2.6.13.1, busybox 1.4.1 $ tftp -p -l /tmp/myfile-xxxxxxxx -r myfile-xxxxxxxx 192.168.x.y tftp: timeout tftp: timeout tftp: timeout The tftpd (from WinXP Pro disk, running as a service) creates 'myfile-xxxxxxxx' in the specified transfer directory, but the file contents do not arrive on the target system. strace log is attached. -- Alexander Kriegisch -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: strace-bftp.log Url: http://busybox.net/lists/busybox/attachments/20070508/3c4541c8/attachment.diff From hamish at cloud.net.au Mon May 7 19:03:39 2007 From: hamish at cloud.net.au (Hamish Moffatt) Date: Tue, 8 May 2007 12:03:39 +1000 Subject: busybox 1.5.0 uClibc bufsiz and breakage (was Re: syslog messages truncated) In-Reply-To: <200705080003.48826.vda.linux@googlemail.com> References: <20070507122310.GA15618@cloud.net.au> <200705080003.48826.vda.linux@googlemail.com> Message-ID: <20070508020339.GA4887@cloud.net.au> On Tue, May 08, 2007 at 12:03:48AM +0200, Denis Vlasenko wrote: > On Monday 07 May 2007 14:23, Hamish Moffatt wrote: > > syslog messages are being truncated. This happens regardless of their [..] > Yes, I mistakenly thought that BUFSIZ is big enough and used > BUFSIZ-sized buffer for data in syslogd. > > But uclibc can be configured to have very small BUFSIZ. > > The bug is fixed in newer busybox. Alternatively, rebuild uclibc with > a bit larger BUFSIZ (like 2k?) Thanks Denis. I installed 1.5.0. However I found that the telnet app doesn't compile with uClibc BUFSIZE==256 in 1.5.0, calls BUG_telnet_globals_too_big(). So I had to increase my BUFSIZE anyway. And now it's fairly broken; incoming TCP connections get refused (I'm running inetd, netstat shows the sockets, but connections are not accepted), and busybox's ash reports "-sh: can't access tty; job control turned off". Hmm :( Hamish -- Hamish Moffatt VK3SB From hamish at cloud.net.au Mon May 7 20:34:06 2007 From: hamish at cloud.net.au (Hamish Moffatt) Date: Tue, 8 May 2007 13:34:06 +1000 Subject: busybox 1.5.0 uClibc bufsiz and breakage (was Re: syslog messages truncated) In-Reply-To: <20070508020339.GA4887@cloud.net.au> References: <20070507122310.GA15618@cloud.net.au> <200705080003.48826.vda.linux@googlemail.com> <20070508020339.GA4887@cloud.net.au> Message-ID: <20070508033406.GA6282@cloud.net.au> On Tue, May 08, 2007 at 12:03:39PM +1000, Hamish Moffatt wrote: > And now it's fairly broken; incoming TCP connections get refused (I'm > running inetd, netstat shows the sockets, but connections are not > accepted), and busybox's ash reports "-sh: can't access tty; job control > turned off". Hmm :( Argh, false alarm. IP address conflicts. Damn imposters. Hamish -- Hamish Moffatt VK3SB From javier.graciacastro at tut.fi Mon May 7 23:57:52 2007 From: javier.graciacastro at tut.fi (Javier Gracia Castro) Date: Tue, 8 May 2007 09:57:52 +0300 Subject: Web server and ftp application for AT91RM9200-EK Message-ID: <20070508095752.3f2uwn0m4gkksw4o@webmail.tut.fi> Hello everybody, I have been working with the board AT91RM9200-EK. I ported a 2.6.20 linux kernel and I added a Wi-Fi extension. I am also using BusyBox v1.1.2 with uClibc 0.9.28. Now I want to install a mini web server and a ftp application for testing the performance provided by the wireless interface. Which software packages do you recommend to me? All suggestions are welcomed! Regards, Javier From cristian.ionescu-idbohrn at axis.com Tue May 8 01:34:35 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Tue, 8 May 2007 10:34:35 +0200 (CEST) Subject: svn trunk won't build on a debian sarge box In-Reply-To: <200705072354.29200.vda.linux@googlemail.com> References: <0705071657110.19336@somehost> <200705072354.29200.vda.linux@googlemail.com> Message-ID: <0705080956150.19336@somehost> On Mon, 7 May 2007, Denis Vlasenko wrote: > On Monday 07 May 2007 17:27, Cristian Ionescu-Idbohrn wrote: > > Anyone else being hit by this? > > > > ,---- > > | ... > > | .debug_varnames > > | *(.debug_varnames) > > | > > | /DISCARD/ > > | *(.note.GNU-stack) > > | OUTPUT(busybox_unstripped elf32-i386) > > | collect2: ld returned 1 exit status > > | strip: 'busybox_unstripped': No such file > > `---- > > ?! You see the above as error message? Shouldn't I? busybox_unstripped is not built. > > gcc: 4:3.3.5-3 > > binutils: 2.15-6 > > libc6: 2.3.2.ds1-22sarge5 > > make: 3.80-9 > > > > To reproduce: > > > > # make allnoconfig > > # make menuconfig > > enable debian utils start-stop-daemon, save .config and exit > > # make > > It's usually simpler to just attach your .config All right, attached. > > No such problems on a debian etch box with: > > > > gcc: 4:4.1.1-15 > > binutils: 2.17-3 > > libc6: 2.3.6.ds1-13 > > make: 3.81-2 > > > > The FAQ states bb should build with "gcc 3.2, make 3.79.1, and glibc > > 2.3". > > I guess your binutils are too old for --gc-sections to work right. Could be. In that case, does anyone know what binutils version is required? I also suggest an update of the relevant FAQ section? http://www.busybox.net/FAQ.html The only notice about gc-sections I could find in the binutils docs is: ,----[ /usr/share/doc/binutils/ld/NEWS.gz ] | Changes in version 2.10: | | * Added garbage collection of unused sections, enabled by --gc-sections. | It does require a bit of backend support; currently implemented are | arm-elf, avr-elf, d10v-elf, fr30-elf, i386-elf, m32r-elf, m68k-elf, | mcore-elf, mips-elf, mn10300-elf, ppc-elf, sh-elf, sparc-elf, and v850-elf. | Others will ignore the option. `---- Please note, debian sarge has binutils 2.15-6. Cheers, Cristian -------------- next part -------------- A non-text attachment was scrubbed... Name: .config.gz Type: application/octet-stream Size: 3875 bytes Desc: Url : http://busybox.net/lists/busybox/attachments/20070508/0270a8ac/attachment-0001.obj From hamish at cloud.net.au Tue May 8 03:08:40 2007 From: hamish at cloud.net.au (Hamish Moffatt) Date: Tue, 8 May 2007 20:08:40 +1000 Subject: svn trunk won't build on a debian sarge box In-Reply-To: <0705080956150.19336@somehost> References: <0705071657110.19336@somehost> <200705072354.29200.vda.linux@googlemail.com> <0705080956150.19336@somehost> Message-ID: <20070508100840.GA11150@cloud.net.au> On Tue, May 08, 2007 at 10:34:35AM +0200, Cristian Ionescu-Idbohrn wrote: > On Mon, 7 May 2007, Denis Vlasenko wrote: > > On Monday 07 May 2007 17:27, Cristian Ionescu-Idbohrn wrote: > > > Anyone else being hit by this? > > > > > > ,---- > > > | ... > > > | .debug_varnames > > > | *(.debug_varnames) > > > | > > > | /DISCARD/ > > > | *(.note.GNU-stack) > > > | OUTPUT(busybox_unstripped elf32-i386) > > > | collect2: ld returned 1 exit status > > > | strip: 'busybox_unstripped': No such file > > > `---- > > > > ?! You see the above as error message? > Shouldn't I? busybox_unstripped is not built. > > I guess your binutils are too old for --gc-sections to work right. > > Could be. In that case, does anyone know what binutils version is > required? I also suggest an update of the relevant FAQ section? I saw the above today today. However the real error occurs BEFORE the section dump. In my case it a BUG_*() about telnet globals too big (an unresolved symbol). It seems that the addition of -Wl,-M in the Makefile in 1.5.0 causes the map to be printed if there is a link failure. So, Christian, check your error messages more carefully - perhaps there is another error before the start of the map dump. Hamish -- Hamish Moffatt VK3SB From cristian.ionescu-idbohrn at axis.com Tue May 8 04:34:21 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Tue, 8 May 2007 13:34:21 +0200 (CEST) Subject: svn trunk won't build on a debian sarge box In-Reply-To: <20070508100840.GA11150@cloud.net.au> References: <0705071657110.19336@somehost> <200705072354.29200.vda.linux@googlemail.com> <0705080956150.19336@somehost> <20070508100840.GA11150@cloud.net.au> Message-ID: <0705081257400.19336@somehost> On Tue, 8 May 2007, Hamish Moffatt wrote: > On Tue, May 08, 2007 at 10:34:35AM +0200, Cristian Ionescu-Idbohrn wrote: > > On Mon, 7 May 2007, Denis Vlasenko wrote: > > > On Monday 07 May 2007 17:27, Cristian Ionescu-Idbohrn wrote: > > > > Anyone else being hit by this? > > > > > > > > ,---- > > > > | ... > > > > | .debug_varnames > > > > | *(.debug_varnames) > > > > | > > > > | /DISCARD/ > > > > | *(.note.GNU-stack) > > > > | OUTPUT(busybox_unstripped elf32-i386) > > > > | collect2: ld returned 1 exit status > > > > | strip: 'busybox_unstripped': No such file > > > > `---- > > > > > > ?! You see the above as error message? > > Shouldn't I? busybox_unstripped is not built. > > > > I guess your binutils are too old for --gc-sections to work right. > > > > Could be. In that case, does anyone know what binutils version is > > required? I also suggest an update of the relevant FAQ section? > > I saw the above today today. However the real error occurs BEFORE the > section dump. In my case it a BUG_*() about telnet globals too big (an > unresolved symbol). > > It seems that the addition of -Wl,-M in the Makefile in 1.5.0 causes the > map to be printed if there is a link failure. > > So, Christian, check your error messages more carefully - perhaps there > is another error before the start of the map dump. Right. Looks like a file containing all that stuff (busybox_ld.err) is generated in topdir. I found this at the top of that file: ,---- | /usr/bin/ld: Warning: gc-sections option ignored | libbb/lib.a(vfork_daemon_rexec.o)(.text.run_nofork_applet_prime+0x4a): | In function `run_nofork_applet_prime': | : undefined reference to `die_jmp' `---- Cheers, Cristian From lists at zelow.no Tue May 8 06:15:19 2007 From: lists at zelow.no (Thomas Lundquist) Date: Tue, 8 May 2007 15:15:19 +0200 Subject: [patch] New-applet howto. (and new applet) In-Reply-To: <200705080039.56025.vda.linux@googlemail.com> References: <20070506064529.GA1286@zelow.no> <200705070107.38880.vda.linux@googlemail.com> <20070507111453.GA29302@zelow.no> <200705080039.56025.vda.linux@googlemail.com> Message-ID: <20070508131519.GA27301@zelow.no> On Tue, May 08, 2007 at 12:39:55AM +0200, Denis Vlasenko wrote: > > string is optional, thus should be [string]. > "This also takes stdin as password\n" - what does this exactly mean? Just wanted to describe that you can do BAR='echo "foo" | ./ cryptpw' somehow. but it's still a unix applet so it's supposed to do that anyway. Just remove the line I guess. tested your patch and it's working and a nice lession in cutting. Your patch, with a line less in usage.h attached. Thomas. -------------- next part -------------- A non-text attachment was scrubbed... Name: 7d.patch Type: text/x-diff Size: 12199 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070508/c807e6cb/attachment.bin From vda.linux at googlemail.com Tue May 8 10:52:31 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 8 May 2007 19:52:31 +0200 Subject: [patch] New-applet howto. (and new applet) In-Reply-To: <20070508131519.GA27301@zelow.no> References: <20070506064529.GA1286@zelow.no> <200705080039.56025.vda.linux@googlemail.com> <20070508131519.GA27301@zelow.no> Message-ID: <200705081952.31454.vda.linux@googlemail.com> On Tuesday 08 May 2007 15:15, Thomas Lundquist wrote: > On Tue, May 08, 2007 at 12:39:55AM +0200, Denis Vlasenko wrote: > > > > string is optional, thus should be [string]. > > "This also takes stdin as password\n" - what does this exactly mean? > > Just wanted to describe that you can do > > BAR='echo "foo" | ./ cryptpw' > > somehow. > > but it's still a unix applet so it's supposed to do that anyway. > > Just remove the line I guess. > > tested your patch and it's working and a nice lession in cutting. > > Your patch, with a line less in usage.h attached. Applied, thanks! -- vda From farmatito at tiscali.it Tue May 8 12:32:28 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 8 May 2007 21:32:28 +0200 Subject: [patch] New-applet howto. (and new applet) In-Reply-To: <200705081952.31454.vda.linux@googlemail.com> References: <20070506064529.GA1286@zelow.no> <20070508131519.GA27301@zelow.no> <200705081952.31454.vda.linux@googlemail.com> Message-ID: <200705082132.28741.farmatito@tiscali.it> On Tuesday 08 May 2007 19:52:31 Denis Vlasenko wrote: > On Tuesday 08 May 2007 15:15, Thomas Lundquist wrote: > > On Tue, May 08, 2007 at 12:39:55AM +0200, Denis Vlasenko wrote: > > > > > > string is optional, thus should be [string]. > > > "This also takes stdin as password\n" - what does this exactly mean? > > > > Just wanted to describe that you can do > > > > BAR='echo "foo" | ./ cryptpw' > > > > somehow. > > > > but it's still a unix applet so it's supposed to do that anyway. > > > > Just remove the line I guess. > > > > tested your patch and it's working and a nice lession in cutting. > > > > Your patch, with a line less in usage.h attached. > > Applied, thanks! > -- > vda Hi, Denis, maybe you forgot to svn add cryptpw.c ? Ciao, Tito From farmatito at tiscali.it Tue May 8 13:22:46 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 8 May 2007 22:22:46 +0200 Subject: [patch] New-applet howto. (and new applet) In-Reply-To: <200705082132.28741.farmatito@tiscali.it> References: <20070506064529.GA1286@zelow.no> <200705081952.31454.vda.linux@googlemail.com> <200705082132.28741.farmatito@tiscali.it> Message-ID: <200705082222.46846.farmatito@tiscali.it> On Tuesday 08 May 2007 21:32:28 Tito wrote: > On Tuesday 08 May 2007 19:52:31 Denis Vlasenko wrote: > > On Tuesday 08 May 2007 15:15, Thomas Lundquist wrote: > > > On Tue, May 08, 2007 at 12:39:55AM +0200, Denis Vlasenko wrote: > > > > > > > > string is optional, thus should be [string]. > > > > "This also takes stdin as password\n" - what does this exactly mean? > > > > > > Just wanted to describe that you can do > > > > > > BAR='echo "foo" | ./ cryptpw' > > > > > > somehow. > > > > > > but it's still a unix applet so it's supposed to do that anyway. > > > > > > Just remove the line I guess. > > > > > > tested your patch and it's working and a nice lession in cutting. > > > > > > Your patch, with a line less in usage.h attached. > > > > Applied, thanks! > > -- > > vda > Hi, > Denis, maybe you forgot to svn add cryptpw.c ? and libbb/crypt_make_salt.c !!! > Ciao, > Tito BTW: scripts/bloat-o-meter busybox_old busybox_unstripped function old new delta cryptpw_main 207 164 -43 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-43) Total: -43 bytes int cryptpw_main(int argc, char **argv) { char salt[11] = "$1$\0\0\0\0\0\0\0\0"; getopt32(argc, argv, "a:", NULL); crypt_make_salt(salt + 3, 4); /* md5 */ if (argc > 2 && argv[2][0] == 'd') /* des */ crypt_make_salt(salt, 1); puts(pw_encrypt(argv[argc - 1] ? argv[argc - 1] : xmalloc_getline(stdin), salt)); return 0; } Ciao, Tito From rep.dot.nop at gmail.com Tue May 8 14:01:38 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Tue, 8 May 2007 23:01:38 +0200 Subject: [patch] New-applet howto. (and new applet) In-Reply-To: <200705082222.46846.farmatito@tiscali.it> References: <20070506064529.GA1286@zelow.no> <200705081952.31454.vda.linux@googlemail.com> <200705082132.28741.farmatito@tiscali.it> <200705082222.46846.farmatito@tiscali.it> Message-ID: <20070508210138.GA15146@aon.at> On Tue, May 08, 2007 at 10:22:46PM +0200, Tito wrote: >On Tuesday 08 May 2007 21:32:28 Tito wrote: >> On Tuesday 08 May 2007 19:52:31 Denis Vlasenko wrote: >> > On Tuesday 08 May 2007 15:15, Thomas Lundquist wrote: >> > > On Tue, May 08, 2007 at 12:39:55AM +0200, Denis Vlasenko wrote: >> > > > >> > > > string is optional, thus should be [string]. >> > > > "This also takes stdin as password\n" - what does this exactly mean? >> > > >> > > Just wanted to describe that you can do >> > > >> > > BAR='echo "foo" | ./ cryptpw' >> > > >> > > somehow. >> > > >> > > but it's still a unix applet so it's supposed to do that anyway. >> > > >> > > Just remove the line I guess. >> > > >> > > tested your patch and it's working and a nice lession in cutting. >> > > >> > > Your patch, with a line less in usage.h attached. >> > >> > Applied, thanks! >> > -- >> > vda >> Hi, >> Denis, maybe you forgot to svn add cryptpw.c ? > >and libbb/crypt_make_salt.c !!! > >> Ciao, >> Tito > >BTW: > >scripts/bloat-o-meter busybox_old busybox_unstripped >function old new delta >cryptpw_main 207 164 -43 >------------------------------------------------------------------------------ >(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-43) Total: -43 bytes > > >int cryptpw_main(int argc, char **argv) >{ > char salt[11] = "$1$\0\0\0\0\0\0\0\0"; > > getopt32(argc, argv, "a:", NULL); > > crypt_make_salt(salt + 3, 4); /* md5 */ > if (argc > 2 && argv[2][0] == 'd') /* des */ > crypt_make_salt(salt, 1); > > puts(pw_encrypt(argv[argc - 1] ? argv[argc - 1] : xmalloc_getline(stdin), salt)); > > return 0; >} That sounds much better to me, yes. Any benefit if you argc > 3 and ++argv a few times rather then that double array deref? From vda.linux at googlemail.com Tue May 8 14:08:10 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 8 May 2007 23:08:10 +0200 Subject: tftp timeouts in 1.4.1 In-Reply-To: <463FC9A4.9030100@Kriegisch.name> References: <463FC9A4.9030100@Kriegisch.name> Message-ID: <200705082308.10581.vda.linux@googlemail.com> On Tuesday 08 May 2007 02:51, Alexander Kriegisch wrote: > mipsel ohio, kernel 2.6.13.1, busybox 1.4.1 > > $ tftp -p -l /tmp/myfile-xxxxxxxx -r myfile-xxxxxxxx 192.168.x.y > tftp: timeout > tftp: timeout > tftp: timeout > > The tftpd (from WinXP Pro disk, running as a service) creates > 'myfile-xxxxxxxx' in the specified transfer directory, but the file > contents do not arrive on the target system. > > strace log is attached. That's why there is a small set of post-1.4.1 fixes on busybox.net: http://busybox.net/downloads/fixes-1.4.1/ In particular, busybox-1.4.1-tftp.patch -- vda From vda.linux at googlemail.com Tue May 8 16:24:24 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 9 May 2007 01:24:24 +0200 Subject: svn commit: trunk/busybox: docs include libbb loginutils In-Reply-To: <200705081558.10226.vapier@gentoo.org> References: <20070508175219.3FAD948029@busybox.net> <200705081558.10226.vapier@gentoo.org> Message-ID: <200705090124.24924.vda.linux@googlemail.com> On Tuesday 08 May 2007 21:58, Mike Frysinger wrote: > > --- trunk/busybox/libbb/Kbuild 2007-05-08 17:27:17 UTC (rev 18585) > > +++ trunk/busybox/libbb/Kbuild 2007-05-08 17:52:17 UTC (rev 18586) > > @@ -21,6 +21,7 @@ > > lib-y += crc32.o > > lib-y += create_icmp6_socket.o > > lib-y += create_icmp_socket.o > > +lib-y += crypt_make_salt.o > > lib-y += default_error_retval.o > > lib-y += device_open.o > > lib-y += dump.o > > @@ -103,6 +104,9 @@ > > lib-$(CONFIG_LOSETUP) += loop.o > > lib-$(CONFIG_FEATURE_MTAB_SUPPORT) += mtab.o > > lib-$(CONFIG_PASSWD) += pw_encrypt.o > > +lib-$(CONFIG_PASSWD) += crypt_make_salt.o > > +lib-$(CONFIG_CRYPTPW) += pw_encrypt.o > > +lib-$(CONFIG_CRYPTPW) += crypt_make_salt.o > > lib-$(CONFIG_SULOGIN) += pw_encrypt.o > > lib-$(CONFIG_FEATURE_HTTPD_AUTH_MD5) += pw_encrypt.o > > lib-$(CONFIG_VLOCK) += correct_password.o > > looks like you forgot to `svn add libbb/crypt_make_salt.c` ? also, what's the > point of having the .o declared in lib-$(CONFIG_...) if it's forced in > lib-y ? Indeed. Fixed. Thanks! -- vda From vda.linux at googlemail.com Tue May 8 16:25:21 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 9 May 2007 01:25:21 +0200 Subject: [patch] New-applet howto. (and new applet) In-Reply-To: <200705082222.46846.farmatito@tiscali.it> References: <20070506064529.GA1286@zelow.no> <200705082132.28741.farmatito@tiscali.it> <200705082222.46846.farmatito@tiscali.it> Message-ID: <200705090125.21736.vda.linux@googlemail.com> On Tuesday 08 May 2007 22:22, Tito wrote: > On Tuesday 08 May 2007 21:32:28 Tito wrote: > > On Tuesday 08 May 2007 19:52:31 Denis Vlasenko wrote: > > > On Tuesday 08 May 2007 15:15, Thomas Lundquist wrote: > > > > On Tue, May 08, 2007 at 12:39:55AM +0200, Denis Vlasenko wrote: > > > > > > > > > > string is optional, thus should be [string]. > > > > > "This also takes stdin as password\n" - what does this exactly mean? > > > > > > > > Just wanted to describe that you can do > > > > > > > > BAR='echo "foo" | ./ cryptpw' > > > > > > > > somehow. > > > > > > > > but it's still a unix applet so it's supposed to do that anyway. > > > > > > > > Just remove the line I guess. > > > > > > > > tested your patch and it's working and a nice lession in cutting. > > > > > > > > Your patch, with a line less in usage.h attached. > > > > > > Applied, thanks! > > > -- > > > vda > > Hi, > > Denis, maybe you forgot to svn add cryptpw.c ? > > and libbb/crypt_make_salt.c !!! Oh my. > > Ciao, > > Tito > > BTW: > > scripts/bloat-o-meter busybox_old busybox_unstripped > function old new delta > cryptpw_main 207 164 -43 > ------------------------------------------------------------------------------ > (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-43) Total: -43 bytes > > > int cryptpw_main(int argc, char **argv) > { > char salt[11] = "$1$\0\0\0\0\0\0\0\0"; > > getopt32(argc, argv, "a:", NULL); > > crypt_make_salt(salt + 3, 4); /* md5 */ > if (argc > 2 && argv[2][0] == 'd') /* des */ > crypt_make_salt(salt, 1); > > puts(pw_encrypt(argv[argc - 1] ? argv[argc - 1] : xmalloc_getline(stdin), salt)); > > return 0; > } I will look at it later today. 01:25 on the clock 8] -- vda From Alexander at Kriegisch.name Tue May 8 16:59:43 2007 From: Alexander at Kriegisch.name (Alexander Kriegisch) Date: Wed, 09 May 2007 01:59:43 +0200 Subject: tftp timeouts in 1.4.1 In-Reply-To: <200705082308.10581.vda.linux@googlemail.com> References: <463FC9A4.9030100@Kriegisch.name> <200705082308.10581.vda.linux@googlemail.com> Message-ID: <46410EEF.2050306@Kriegisch.name> > That's why there is a small set of post-1.4.1 fixes on busybox.net: > http://busybox.net/downloads/fixes-1.4.1/ > In particular, busybox-1.4.1-tftp.patch Sorry for the inconvenience of having you point me to that patch. I applied it and tftp behaves differently now, but it is still broken. New symptoms: - File transfers up to 512 bytes are handled correctly. - Files bigger than 512 bytes result in the first 512 bytes transferred, but then there are timeouts again. After Ctrl-C or after the last timeout I have a 512 bytes file which is inaccessible on my Windows box. I cannot even delete it, until I changed ACLs so I have the rights to do so. - Using '-b 1024', for example, gets me a 571 bytes file showing the *end* of the file to be transferred, not the beginning. Very strange indeed. - Using '-b 4096' gets me a 0 bytes file which is inaccessible again. Does that make any sense? I am attaching new strace logs of sessions with different '-b' sizes (default, 1024, 4096). Tell me if you need anything else. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: strace-tftp-512.log Url: http://busybox.net/lists/busybox/attachments/20070509/edb4fc0e/attachment-0003.diff -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: strace-tftp-1024.log Url: http://busybox.net/lists/busybox/attachments/20070509/edb4fc0e/attachment-0004.diff -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: strace-tftp-4096.log Url: http://busybox.net/lists/busybox/attachments/20070509/edb4fc0e/attachment-0005.diff From franklin at goodhorse.idv.tw Tue May 8 17:12:16 2007 From: franklin at goodhorse.idv.tw (Franklin) Date: Wed, 9 May 2007 08:12:16 +0800 Subject: tftp timeouts in 1.4.1 In-Reply-To: <46410EEF.2050306@Kriegisch.name> References: <463FC9A4.9030100@Kriegisch.name> <200705082308.10581.vda.linux@googlemail.com> <46410EEF.2050306@Kriegisch.name> Message-ID: <200705090812.18334.franklin@goodhorse.idv.tw> Alexander Kriegisch's messages: > > That's why there is a small set of post-1.4.1 fixes on busybox.net: > > http://busybox.net/downloads/fixes-1.4.1/ > > In particular, busybox-1.4.1-tftp.patch > > Sorry for the inconvenience of having you point me to that patch. I > applied it and tftp behaves differently now, but it is still broken. > New symptoms: > - File transfers up to 512 bytes are handled correctly. > - Files bigger than 512 bytes result in the first 512 bytes > transferred, but then there are timeouts again. After Ctrl-C or > after the last timeout I have a 512 bytes file which is inaccessible > on my Windows box. I cannot even delete it, until I changed ACLs so > I have the rights to do so. > - Using '-b 1024', for example, gets me a 571 bytes file showing the > *end* of the file to be transferred, not the beginning. Very strange > indeed. > - Using '-b 4096' gets me a 0 bytes file which is inaccessible again. > > Does that make any sense? I am attaching new strace logs of sessions > with different '-b' sizes (default, 1024, 4096). Tell me if you need > anything else. Maybe you can try version 1.4.2. I met the same problem with 1.4.1, also not resolved by patching, but after upgrading to 1.4.2 everything about tftp is OK. Regards, Franklin -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070509/712e9e48/attachment.pgp From farmatito at tiscali.it Wed May 9 02:33:03 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 9 May 2007 11:33:03 +0200 Subject: [patch] New-applet howto. (and new applet) In-Reply-To: <200705090125.21736.vda.linux@googlemail.com> References: <20070506064529.GA1286@zelow.no> <200705082222.46846.farmatito@tiscali.it> <200705090125.21736.vda.linux@googlemail.com> Message-ID: <200705091133.03119.farmatito@tiscali.it> On Wednesday 09 May 2007 01:25:21 Denis Vlasenko wrote: > On Tuesday 08 May 2007 22:22, Tito wrote: > > On Tuesday 08 May 2007 21:32:28 Tito wrote: > > > On Tuesday 08 May 2007 19:52:31 Denis Vlasenko wrote: > > > > On Tuesday 08 May 2007 15:15, Thomas Lundquist wrote: > > > > > On Tue, May 08, 2007 at 12:39:55AM +0200, Denis Vlasenko wrote: > > > > > > > > > > > > string is optional, thus should be [string]. > > > > > > "This also takes stdin as password\n" - what does this exactly mean? > > > > > > > > > > Just wanted to describe that you can do > > > > > > > > > > BAR='echo "foo" | ./ cryptpw' > > > > > > > > > > somehow. > > > > > > > > > > but it's still a unix applet so it's supposed to do that anyway. > > > > > > > > > > Just remove the line I guess. > > > > > > > > > > tested your patch and it's working and a nice lession in cutting. > > > > > > > > > > Your patch, with a line less in usage.h attached. > > > > > > > > Applied, thanks! > > > > -- > > > > vda > > > Hi, > > > Denis, maybe you forgot to svn add cryptpw.c ? > > > > and libbb/crypt_make_salt.c !!! > > Oh my. > > > > Ciao, > > > Tito > > > > BTW: > > > > scripts/bloat-o-meter busybox_old busybox_unstripped > > function old new delta > > cryptpw_main 207 164 -43 > > ------------------------------------------------------------------------------ > > (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-43) Total: -43 bytes > > > > > > int cryptpw_main(int argc, char **argv) > > { > > char salt[11] = "$1$\0\0\0\0\0\0\0\0"; > > > > getopt32(argc, argv, "a:", NULL); > > > > crypt_make_salt(salt + 3, 4); /* md5 */ > > if (argc > 2 && argv[2][0] == 'd') /* des */ > > crypt_make_salt(salt, 1); > > > > puts(pw_encrypt(argv[argc - 1] ? argv[argc - 1] : xmalloc_getline(stdin), salt)); > > > > return 0; > > } > > I will look at it later today. 01:25 on the clock 8] > -- > vda > Hi, better look at this version as the previous is bugged ;-) scripts/bloat-o-meter busybox_old busybox_unstripped function old new delta cryptpw_main 207 145 -62 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-62) Total: -62 bytes BTW: there is a little memory leak when reading from stdin... Ciao, Tito ------------------------------------------------------------------------------------------------------- /* vi: set sw=4 ts=4: */ /* * cryptpw.c * * Cooked from passwd.c by Thomas Lundquist * */ #include "busybox.h" int cryptpw_main(int argc, char **argv)ATTRIBUTE_NORETURN; int cryptpw_main(int argc, char **argv) { char salt[11] = "$1$\0\0\0\0\0\0\0\0"; if (getopt32(argc, argv, "a:", NULL) && *argv[optind - 1] == 'd') crypt_make_salt(salt, 1); /* des */ else crypt_make_salt(salt + 3, 4); /* md5 */ puts(pw_encrypt(argv[optind] ? argv[optind] : xmalloc_getline(stdin), salt)); exit(EXIT_SUCCESS); } ----------------------------------------------------------------------------------------------------------- From brian.austin at cirrus.com Tue May 8 23:27:00 2007 From: brian.austin at cirrus.com (Brian Austin) Date: Wed, 09 May 2007 01:27:00 -0500 Subject: trouble with init in EABI toolchain Message-ID: <1178692020.17147.276.camel@localhost.localdomain> Hello, I have a gcc-4.1.2 EABi toolchain with uClibc-0.9.29. compile is fine, kernel boots, I can create my own init ( hello world ), I can even run init=/bin/busybox. but just using init itself, it hangs with... Freeing init memory: 132K I am using busybox-1.2.0, I have tried all of them up to 1.5 and still get the same