Re: [PATCH] applet-request: expand

2007-08-09 Thread Tito
On Monday 06 August 2007 23:00:56 Tito wrote:
 Hi,
 this is a first attempt to implement a stripped down version of expand.
 This version is only little tested so it may contain all sort of bugs.
 Hints, critics and help in testing and improving it is welcome. 
 
 bloat-o-meter (after make defconfig and enabling the expand applet) says:
 function old new   delta
 expand_main- 437+437
 .rodata   121357  121485+128
 packed_usage   22558   22660+102
 applets 31083120 +12
 --
 (add/remove: 1/0 grow/shrink: 3/0 up/down: 679/0) Total: 679 bytes
 
 Usage is: expand  [-i] [-t NUM] [FILE | -]
 
  *  Options:
  *  -t numConvert tabs to num spaces (default 8 spaces).
  *
  *  Caveat: this version doesn't accept tab lists and
  *  therefore isn't conform to The Open Group Base 
  *  Specifications Issue 6.
  *
  *  -iOnly convert initial tabs on each line to 
 spaces.
 
 Ciao,
 Tito
 

Hi Denis,
please don't apply this patch fro the moment,
I'm working on an improved one with less bugs,
tests for our test suite and also unexpand.
Need a few days for it.

Ciao,
Tito

___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: udhcp lease bug

2007-08-09 Thread Denis Vlasenko
On Tuesday 07 August 2007 02:26, David Updegraff wrote:
 Hi.
 
 udhcp keeps sending out same IPs to diff. macs w/o this patch when a
 bunch boot at the same time.  Annoying.

Thanks for finding it. Fixed in svn.
--
vda
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: Httpd serve multiple pages

2007-08-09 Thread Denis Vlasenko
On Tuesday 07 August 2007 05:51, Jako Lee wrote:
 Hi all,
 
 How do I serve multiple pages using httpd for a single user?
 Right now I have a main page with a link to another page on
 my Linux directory. After logging in I can see the main page
 but when I click on the link it tell me that it can't find
 the server (both the main page and the linked page are in
 the same directory). However, if the link is set to Google
 or Yahoo homepage it will work fine.

Let's say you have first_page.htm and second_page.htm in the same dir.

Second page is a href=second_page.htmhere/a should work.

Please post these two pages (or their simplified versions
if they are big), explain in which directory do you put
these files and how do you start httpd (exact command line).
Will try to reproduce here.
--
vda
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


[patch][BusyBox] Domain assignment support for SELinux/AppArmor/LIDS

2007-08-09 Thread himainu-ynakam
Hello.

We would like to suggest Secure OSes(such as SELinux/AppArmor/LIDS) domain
assignment support for BusyBox. This work is done by Hiroshi Shinji.

1. Background

Secure OSes such as SELinux, AppArmor and LIDS can assign domain to processes.
Domain means set of access rights.
Domain is assinged to processes at the time of exec system call.
# This is a little similar to suid feature of Linux.

For example, in the case of SELinux, /sbin/syslogd is assigned syslogd_t
domain at the execution time of /sbin/syslogd. syslogd_t are allowed to
read syslogd.conf, write log files, etc.

However, current BusyBox does not suitable for assigning domains.
Because BusyBox is a single file that is called through a lot of links.

Secure OS treats /sbin/syslogd and /sbin/httpd as /bin/busybox.
So, /sbin/syslogd and /sbin/httpd run as the same domain.

Known solutions to this problem is preparing wrapper program that calls
applet.
  For example, /sbin/syslogd is a small C program that calls
/bin/busybox syslogd. Then, at the execution of /sbin/syslogd,
syslogd_t domain is assigned and /bin/busybox syslogd is called
and inherits assinged domain(syslogd_t).
However, such wrapper consumes storage(more than 1k byte per wrapper).
For detailed description about this problem,
Yusuke Sato wrote documentation:
http://www.selinux.gr.jp/LIDS-JP/LIDS_en/document/general/web_lids_busybox/main.html

2. Our solution
Shinji came up with one idea. He thought script wrappper like below.

If you enabled INSTALL_APPLET_SCRIPT_WRAPPERS, wrappers like below are
installed.

The contents of /sbin/syslogd is following.

#!/bin/busybox

It is only 15 byte.

When /sbin/syslogd is executed, /bin/busybox /sbin/syslogd other arguments 
is called.

To achive above, we had to modify applets.c

-   applet_name = argv[0];
-   run_applet_and_exit(argv[0], argv);
+   applet_name = bb_get_last_path_component(argv[0]);
+   run_applet_and_exit(applet_name, argv);

We tried the patch for SELinux and AppArmor.
And domains were assigned sucessfully!

3. Limitation
Programs that are used as interpreter can not be installed as script wrapper.
It is due to limitation of exec(interpreter can not be called twice).
For example, /bin/sh can not be installed as script wrapper.
If /bin/sh is installed as script wrapper, shell scripts do not run.
In interpreting #!/bin/sh

- /bin/sh is #!/bin/busybox,
- #! is called twice
- exec system call fails(limitation of exec system call).

In our patch, sh is installed as symlink or hard link by default
(you can install it as script wrapper if you still need).

Assigning domain is critical to secure OSes.
We want way to assign to domains to busybox applets.
Please review this patch and consider merging.

Regards,
Yuichi Nakamura
JSELUG(Japan SELinux Users Group)


domain_assign.patch
Description: Binary data
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Re: Again, troubles with uploading files using busybox httpd

2007-08-09 Thread Denis Vlasenko
On Thursday 09 August 2007 09:00, Alexander Griesser wrote:
 Alexander Griesser wrote:
  Hi folks!
 
  This one seems to be a duplicate of a previous bug report for bb
  1.3.1/1.4.1, here's the link:
 
  http://www.busybox.net/lists/busybox/2007-February/026289.html
 
 Noone else experiencing this problem?

Sorry, had no time to look at it, yet. Will try today in the evening.
--
vda
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: Again, troubles with uploading files using busybox httpd

2007-08-09 Thread Alexander Kriegisch
Hi Alexander!

Your uploadconfig.cgi looks interesting, some months ago I also tried to
handle form-based uploads in shell script, but felt it was too tricky
and unstable. What if another browser sends more headers? Why read the
uploaded file several times for line counting, head and tail operations?
and so forth.

[OT]
I use httpd (currently BB 1.5.1) on a mipsel platform (embedded router
system) in combination with Haserl (http://haserl.sourceforge.net/) as a
CGI handler and am very satisfied. Maybe this is an option to be
considered for you, too. The latest Haserl release 0.9.18 comes with an
interesting new option which has been incorporated by the author upon my
request: The upload is not stored as a temp-file, but written into a
pipe (FIFO). A handler for reading the FIFO is called asynchronously, so
 a shell script can extract a tar archive on the fly, for example. This
is an advantage on platforms with limited memory if you want to avoid
double memory consumption (archive plus extracted content). And the best
thing is that the upload is read once and only once. Haserl is lean and
the very simple template mechanism integrates beautifully in shell
scripts (or Lua scripts, if you prefer).

BTW: No, I don't get money for promoting Haserl, I am just a satisfied
user. ;-)
[/OT]

Back to your shell script: I think it would be better to develop a
version which reads the content length header and then acts accordingly,
not reading linewise, but bytewise, even though in your case you always
seem to upload text files or maybe base64-encoded binaries. But don't
forget that binary uploads are also allowed. So if you want a more
general solution, you might have to improve your script considerably.

Best regards
--
Alexander Kriegisch
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Busybox utils to set u-boot environment?

2007-08-09 Thread Ram
Hi,
 Are there any busybox utility to get and set the u-boot
environments from linux.


Regards,
sriram
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Rewritten autoconf and build directory

2007-08-09 Thread Mats Erik Andersson
Hello all,

I stumbled on a possible issue with today's
svn edition of Busybox. There was no problem
whatsoever to build Busybox 1.6.1 fresh out of the
box into a separate build directory, but when I tried
the same with svn trunk of today, the changed autoconf
handling gives a warning and then an error is caused
by applets/usage.c and include/applets.h, thus breaking
an chance of progress early on. I am not sure whether the
fault is mine or not, but I thought it best to point
it out anyway. I will revert to 1.6.1 for the moment,
since I have no time to spare in the near future.

Regards   Mats E A
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


[PATCH] Fix syslogd circular log buffer: head pointer not moved forward

2007-08-09 Thread Jari Takkala
Hello,

The following patch fixes the circular log buffer in syslogd. Currently the 
head pointer is never moved forward. The 'logread' command will always read 
from the beginning of the buffer, even if the log buffer wraps.

The head pointer is not moved forward because it is 0 by default, so the 
comparison (old_tail  shbuf-head) never evaluates to true.

I have only been able to test this patch on Busybox 1.4.2. I've included a 
patch for 1.6.0 as well, if someone would please test and commit it. Thank you!

Regards,

Jari

--- busybox-1.4.2/sysklogd/syslogd.c2007-06-29 13:50:37.0 -0400
+++ busybox-1.4.2/sysklogd/syslogd.c2007-08-09 14:45:38.0 -0400
@@ -215,7 +215,7 @@
if (new_tail  shbuf-size) {
/* No need to move head if shbuf-head = old_tail,
 * else... */
-   if (old_tail  shbuf-head  shbuf-head = new_tail) {
+   if (old_tail = shbuf-head  shbuf-head = new_tail) {
/* ...need to move head forward */
c = memchr(shbuf-data + new_tail, '\0',
   shbuf-size - new_tail);

--- busybox-1.6.1/sysklogd/syslogd.c2007-06-30 11:06:35.0 -0400
+++ busybox-1.6.1/sysklogd/syslogd.c2007-08-09 15:16:33.0 -0400
@@ -253,7 +253,7 @@
if (new_tail  G.shbuf-size) {
/* No need to move head if shbuf-head = old_tail,
 * else... */
-   if (old_tail  G.shbuf-head  G.shbuf-head = new_tail) {
+   if (old_tail = G.shbuf-head  G.shbuf-head = new_tail) {
/* ...need to move head forward */
c = memchr(G.shbuf-data + new_tail, '\0',
   G.shbuf-size - new_tail);
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: hush in arm nommu environment

2007-08-09 Thread Mike Frysinger
On Tuesday 07 August 2007, Per Hallsmark wrote:
 well... the exact same style is made in other places
 for nommu portability.

that's because the other places dont have the same problems hush does ... they 
account for the nommu issue, hush isnt even close to doing so

 So, while not perfect, it's better than other current
 solutions at least for our usage.

no, because it implies hush has been tested and known to *work* on nommu when 
in reality it's clearly known to not and the code clearly doesnt account for 
it
-mike


signature.asc
Description: This is a digitally signed message part.
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Re: Busybox utils to set u-boot environment?

2007-08-09 Thread Mike Frysinger
On Thursday 09 August 2007, Ram wrote:
  Are there any busybox utility to get and set the u-boot
 environments from linux.

no, nor will there probably ever be due to the nature of u-boot ... every 
single board can store its environment in different types of flash in 
different sectors at different offsets in different magical ways ... there is 
no common infrastructure to query such information from kernel/user space

you should setup your mtd maps to create a separate partition for your u-boot 
env sector and then use the mtd-utils package to read/write it from userspace

please seek any further help/information on the u-boot-usesr mailing list
-mike


signature.asc
Description: This is a digitally signed message part.
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Re: 'df' output

2007-08-09 Thread Mike Frysinger
On Wednesday 08 August 2007, Christopher Reder wrote:
 I am trying to figure out more information on the 'df' output and how it
 may indicate how something is setup wrong with my kernel.  If this is the
 wrong list to ask the question, I'll be glad to repost elsewhere.

df merely runs stat() on the mount points and displays the resulting 
information

that means you should run `df` through a verbose strace and verify the 
structure matches reality ... after that, you can check your libc to make 
sure the internal stat function is correctly translating the structure it got 
back from the kernel into the structure the POSIX API requires
-mike


signature.asc
Description: This is a digitally signed message part.
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

use /proc for more of procps

2007-08-09 Thread Hamish Moffatt
Has anyone looked at using /proc entries for more of the functionality
in the procps tools? For example, original procps's free command reports
more stuff, such as the amount of memory used by cache.

(Given the name PROCps it's a bit odd that eg free does not use /proc.
Real procps's free certainly does.)


thanks,
Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox