From vda.linux at googlemail.com Sun Jul 1 07:54:45 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 16:54:45 +0200 Subject: [PATCH] on lease/pid-file for udhcpd/c In-Reply-To: <1183144975.14905.41.camel@Blue2net-mats.bellman.mea> References: <1183144975.14905.41.camel@Blue2net-mats.bellman.mea> Message-ID: <200707011654.45098.vda.linux@googlemail.com> On Friday 29 June 2007 21:22, Mats Erik Andersson wrote: > Hello all, > > I was getting annoyed at the reluctance of udhcpd to > volontarily update its lease file when a new lease has > been granted. The attached patch introduces a configuration > entry for Busybox 1.6.0 to write a new copy of the lease > file immediately when it has sent DHCPACK. I will apply this part. Thanks! > It took me some time to figure it out, but starting with > Busybox 1.6.0 there is a new entry FEATURE_PIDFILE, which when > forgotten causes udhcpc to complain about missing pidfile as > soon as one tries to release the device. To avoid that serious > malfunction I strongly suggest an addition to > networking/udhcp/Config.in: > > config APP_UDHCPC > ... > select FEATURE_PIDFILE I'd rather make it stop checking for pidfile if FEATURE_PIDFILE!=y. Can you describe in more detail (on source code level) where it complains? > The attached diff-file is bold enough to take care of > both matters. +#ifdef ENABLE_FEATURE_UDHCPD_WRITE_LEASES_EARLY + // Rewrite the file with leases at every new acceptance + write_leases(); +#endif ENABLE_FEATURE_UDHCPD_WRITE_LEASES_EARLY is always defined (to 1 or 0). You have to use #if, not #ifdef. -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 08:23:22 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 17:23:22 +0200 (CEST) Subject: [bug] undefined reference to `plus_minus_num' Message-ID: <0707011714180.21467@somehost> Trunk bb-build fails with: findutils/lib.a(find.o): In function `parse_params': find.c:(.text.parse_params+0x1b0): undefined reference to `xregcomp' find.c:(.text.parse_params+0x201): undefined reference to `plus_minus_num' if: # CONFIG_FEATURE_FIND_MTIME is not set # CONFIG_FEATURE_FIND_MMIN is not set # CONFIG_FEATURE_FIND_PERM is not set Minimal .config attached. Cheers, -- Cristian -------------- next part -------------- A non-text attachment was scrubbed... Name: bb-config.gz Type: application/octet-stream Size: 4160 bytes Desc: Url : http://busybox.net/lists/busybox/attachments/20070701/52fa1ff3/attachment.obj From cristian.ionescu-idbohrn at axis.com Sun Jul 1 09:08:03 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 18:08:03 +0200 (CEST) Subject: [patch] procps/ps.c:343: warning: unused variable `i' Message-ID: <0707011805270.21467@somehost> Fix warning: procps/ps.c: In function `ps_main': procps/ps.c:343: warning: unused variable `i' Cheers, -- Cristian -------------- next part -------------- A non-text attachment was scrubbed... Name: ps.c.patch Type: text/x-diff Size: 371 bytes Desc: Url : http://busybox.net/lists/busybox/attachments/20070701/fe506acd/attachment.bin From cristian.ionescu-idbohrn at axis.com Sun Jul 1 09:40:04 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 18:40:04 +0200 (CEST) Subject: [patch] findutils/find.c: whitespace-cleanup Message-ID: <0707011838350.21467@somehost> Cheers, -- Cristian -------------- next part -------------- A non-text attachment was scrubbed... Name: find.c.patch Type: text/x-diff Size: 3196 bytes Desc: Url : http://busybox.net/lists/busybox/attachments/20070701/8d499e70/attachment.bin From vda.linux at googlemail.com Sun Jul 1 09:41:21 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 18:41:21 +0200 Subject: [PATCH] on lease/pid-file for udhcpd/c In-Reply-To: <200707011654.45098.vda.linux@googlemail.com> References: <1183144975.14905.41.camel@Blue2net-mats.bellman.mea> <200707011654.45098.vda.linux@googlemail.com> Message-ID: <200707011841.21054.vda.linux@googlemail.com> On Sunday 01 July 2007 16:54, Denis Vlasenko wrote: > On Friday 29 June 2007 21:22, Mats Erik Andersson wrote: > > Hello all, > > > > I was getting annoyed at the reluctance of udhcpd to > > volontarily update its lease file when a new lease has > > been granted. The attached patch introduces a configuration > > entry for Busybox 1.6.0 to write a new copy of the lease > > file immediately when it has sent DHCPACK. > > I will apply this part. Thanks! BTW, udhcp code needs more love, that's for sure. Semi-random example: static int read_ip(const char *line, void *arg) { len_and_sockaddr *lsa; int retval = 0; lsa = host_and_af2sockaddr(line, 0, AF_INET); if (lsa) { *(struct in_addr*)arg = lsa->sin.sin_addr; free(lsa); retval = 1; } return retval; } struct in_addr is: struct in_addr { unsigned long int s_addr; } thus read_ip uses arg as a ptr to long. But here: uint32_t *ip; ip = xmalloc(sizeof(uint32_t)); read_ip(ip_string, ip); WTF?? What about e.g. AMD64 where longs take 64 bits?? Yet another sad story: "is server_config.start in network or host byte order?". Different parts of applet have different ideas about it... More? Unsafe htons macro use and no overflow check: case OPTION_U16: *result_u16 = htons(strtoul(val, &endptr, 0)); retval = (endptr[0] == '\0'); break; More? time() use for timeouts -> unsafe versus time being reset by admin. -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 10:13:40 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 19:13:40 +0200 (CEST) Subject: [patch] coreutils/expr.c is this acceptable Message-ID: <0707011912070.21467@somehost> Cheers, -- Cristian -------------- next part -------------- A non-text attachment was scrubbed... Name: expr.c.patch Type: text/x-diff Size: 530 bytes Desc: Url : http://busybox.net/lists/busybox/attachments/20070701/16e3b58f/attachment.bin From vda.linux at googlemail.com Sun Jul 1 10:17:59 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 19:17:59 +0200 Subject: tar applet In-Reply-To: References: Message-ID: <200707011917.59564.vda.linux@googlemail.com> On Saturday 30 June 2007 13:54, Erick Tyndall wrote: > I built busybox-1.6.0 and selected all the options for tar. When I use tar > to extract File-4.17.tar.gz or Perl-5.8.8.tar.bz2 I get the following error: > > tar -xzf file-4.17.tar.gz > tar: corrupted octal value in tar header > > It doesn't extract anything. Likely fixed in svn. With CONFIG_TAR=y CONFIG_FEATURE_TAR_CREATE=y CONFIG_FEATURE_TAR_BZIP2=y CONFIG_FEATURE_TAR_LZMA=y CONFIG_FEATURE_TAR_FROM=y CONFIG_FEATURE_TAR_GZIP=y CONFIG_FEATURE_TAR_COMPRESS=y CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY=y CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y CONFIG_FEATURE_TAR_LONG_OPTIONS=y I see this: # wget http://bent.latency.net/bent/darcs/file-4.17/src/file-4.17.tar.gz Connecting to bent.latency.net (64.21.79.2:80) file-4.17.tar.gz 100% |**********************************| 543k 00:00:00 ETA # ./busybox zcat file-4.17.tar.gz | ./busybox tar xvf - file-4.17/README file-4.17/acinclude.m4 ..... file-4.17/python/py_magic.h file-4.17/python/setup.py and I see file-4.17/ subdir extracted. In case I failed to find the same File-4.17.tar.gz that you are trying to untar: # md5sum file-4.17.tar.gz 50919c65e0181423d66bb25d7fe7b0fd file-4.17.tar.gz Please provide the URL next time. > When I use tar to extract linux-2.6.21.3.tar.bz2 it gives an error but > successfully extracts everything... "warning" != "error". > tar -xjf linux-2.6.21.3.tar.bz2 > tar: warning: skipping header 'g' It encountered pax header block and we currently do not support these, we just skip over them. Most of the time it works. -- vda From vda.linux at googlemail.com Sun Jul 1 10:24:33 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 19:24:33 +0200 Subject: [patch] procps/ps.c:343: warning: unused variable `i' In-Reply-To: <0707011805270.21467@somehost> References: <0707011805270.21467@somehost> Message-ID: <200707011924.33915.vda.linux@googlemail.com> On Sunday 01 July 2007 18:08, Cristian Ionescu-Idbohrn wrote: > Fix warning: > > procps/ps.c: In function `ps_main': > procps/ps.c:343: warning: unused variable `i' I just made some changes to ps in svn, should work now. Yell if it does not. -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 10:25:45 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 19:25:45 +0200 (CEST) Subject: Is there a way to /* silence gcc */? Message-ID: <0707011916350.21467@somehost> findutils/find.c: In function `parse_params': findutils/find.c:512: warning: no previous prototype for `alloc_action' Cheers, -- Cristian From vda.linux at googlemail.com Sun Jul 1 10:27:31 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 19:27:31 +0200 Subject: [patch] findutils/find.c: whitespace-cleanup In-Reply-To: <0707011838350.21467@somehost> References: <0707011838350.21467@somehost> Message-ID: <200707011927.31366.vda.linux@googlemail.com> Hi, It is indented with spaces there on purpose. With tabs it looks scary for 8-char tab people: @@ -438,15 +438,15 @@ static action*** parse_params(char **argv) { enum { - PARM_a , - PARM_o , + PARM_a , + PARM_o , USE_FEATURE_FIND_NOT( PARM_char_not ,) Applying this hunk: @@ -758,12 +758,12 @@ #define XATOU_SFX xatoul_sfx #endif static const struct suffix_mult find_suffixes[] = { - { "c", 1 }, - { "w", 2 }, - { "b"+1, 512 }, - { "b", 512 }, - { "k", 1024 }, - { NULL, 0 } + { "c", 1 }, + { "w", 2 }, + { "b"+1, 512 }, + { "b", 512 }, + { "k", 1024 }, + { NULL, 0 } }; action_size *ap; ap = ALLOC_ACTION(size); Thanks! -- vda From vda.linux at googlemail.com Sun Jul 1 10:32:13 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 19:32:13 +0200 Subject: [bug] undefined reference to `plus_minus_num' In-Reply-To: <0707011714180.21467@somehost> References: <0707011714180.21467@somehost> Message-ID: <200707011932.14008.vda.linux@googlemail.com> On Sunday 01 July 2007 17:23, Cristian Ionescu-Idbohrn wrote: > Trunk bb-build fails with: > > findutils/lib.a(find.o): In function `parse_params': > find.c:(.text.parse_params+0x1b0): undefined reference to `xregcomp' --- libbb/Kbuild (revision 18982) +++ libbb/Kbuild (working copy) @@ -126,3 +126,4 @@ lib-$(CONFIG_MDEV) += xregcomp.o lib-$(CONFIG_LESS) += xregcomp.o lib-$(CONFIG_DEVFSD) += xregcomp.o +lib-$(CONFIG_FEATURE_FIND_REGEX) += xregcomp.o > find.c:(.text.parse_params+0x201): undefined reference to `plus_minus_num' > > if: > > # CONFIG_FEATURE_FIND_MTIME is not set > # CONFIG_FEATURE_FIND_MMIN is not set > # CONFIG_FEATURE_FIND_PERM is not set --- findutils/find.c (revision 18985) +++ findutils/find.c (working copy) @@ -425,8 +425,9 @@ } #endif -#if ENABLE_FEATURE_FIND_PERM || ENABLE_FEATURE_FIND_MTIME \ - || ENABLE_FEATURE_FIND_MMIN +#if ENABLE_FEATURE_FIND_PERM \ + || ENABLE_FEATURE_FIND_MTIME || ENABLE_FEATURE_FIND_MMIN \ + || ENABLE_FEATURE_FIND_SIZE static const char* plus_minus_num(const char* str) Fixing in svn, thanks. -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 10:37:49 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 19:37:49 +0200 (CEST) Subject: [patch] procps/ps.c:343: warning: unused variable i In-Reply-To: <200707011924.33915.vda.linux@googlemail.com> References: <0707011805270.21467@somehost> <200707011924.33915.vda.linux@googlemail.com> Message-ID: <0707011936330.21467@somehost> On Sun, 1 Jul 2007, Denis Vlasenko wrote: > On Sunday 01 July 2007 18:08, Cristian Ionescu-Idbohrn wrote: > > Fix warning: > > > > procps/ps.c: In function `ps_main': > > procps/ps.c:343: warning: unused variable `i' > > I just made some changes to ps in svn, should work now. > Yell if it does not. Looks better now :) Cheers, -- Cristian From vda.linux at googlemail.com Sun Jul 1 10:43:27 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 19:43:27 +0200 Subject: [patch] coreutils/expr.c is this acceptable In-Reply-To: <0707011912070.21467@somehost> References: <0707011912070.21467@somehost> Message-ID: <200707011943.27411.vda.linux@googlemail.com> On Sunday 01 July 2007 19:13, Cristian Ionescu-Idbohrn wrote: > > Cheers, > Do you mean that your gcc emits bogus warning for l too? static VALUE *eval6(void) { - VALUE *l, *r, *v = NULL /* silence gcc */, *i1, *i2; + VALUE *r, *i1, *i2; + VALUE *l = NULL, *v = NULL /* silence gcc */; static const char * const keywords[] = { "quote", "length", "match", "index", "substr", NULL }; @@ -503,5 +504,3 @@ fflush_stdout_and_exit(null(v)); } This is better (no actual code generated: VALUE *l = l; /* silence gcc */ VALUE *v = v; /* silence gcc */ -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 10:51:37 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 19:51:37 +0200 (CEST) Subject: [patch] findutils/find.c: whitespace-cleanup In-Reply-To: <200707011927.31366.vda.linux@googlemail.com> References: <0707011838350.21467@somehost> <200707011927.31366.vda.linux@googlemail.com> Message-ID: <0707011947370.21467@somehost> On Sun, 1 Jul 2007, Denis Vlasenko wrote: > It is indented with spaces there on purpose. Still, the header says: /* vi: set sw=4 ts=4: */ emacs can also be ammended to respect that. > With tabs it looks scary for 8-char tab people: :) > Applying this hunk: Thanks, -- Cristian From vda.linux at googlemail.com Sun Jul 1 11:07:51 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 20:07:51 +0200 Subject: [PATCH] more devfsd clean up and size reduction In-Reply-To: <200706301416.33468.farmatito@tiscali.it> References: <200706301416.33468.farmatito@tiscali.it> Message-ID: <200707012007.51853.vda.linux@googlemail.com> On Saturday 30 June 2007 14:16, Tito wrote: > Hi, > as nobody complained about my previous devfsd patch > (....i presume because nobody is using it ;-) ) > here is one more round > of size reduction and code clean style clean up. > This patch removes the functions > msg_logger, msg_logger_and_die, fork_and_execute > and uses libbb stuff instead. > > Bloat-o-meter says: > > root at localhost:~/Desktop/busybox# scripts/bloat-o-meter busybox_old busybox_unstripped > function old new delta > expand_variable 756 759 +3 > get_variable 259 257 -2 > get_uid_gid 122 120 -2 > do_ioctl_and_die 27 25 -2 > st_expr_expand 488 485 -3 > signal_handler 94 91 -3 > devfsd_main 842 833 -9 > service_name 2444 2433 -11 > read_config_file 1119 1098 -21 > msg_logger_and_die 31 - -31 > .rodata 125143 125111 -32 > msg_logger 88 - -88 > fork_and_execute 95 - -95 > ------------------------------------------------------------------------------ > (add/remove: 0/3 grow/shrink: 1/9 up/down: 3/-299) Total: -296 bytes > > BE WARNED THAT THIS IS ONLY COMPILE TESTED!!! > > If there are some volunteers for testing it ..... > > Denis could you please take a look at my use > of spawn, xspawn, wait4pid and bb_daemonize_or_rexec > as I never used them before and i'm not quite sure > if i've done things right............. > and apply the patch if you like it. Looks like you should indeed use fopen, not xfopen here. You test it for NULL, and do not seem to exit if it fails: - if ((fp = fopen(path, "r")) != NULL) { + if ((fp = xfopen(path, "r")) != NULL) { while (fgets(buf, STRING_LENGTH, fp) != NULL) { /* Skip whitespace */ - for (line = buf; isspace(*line); ++line) - /*VOID*/; + line = buf; + line = skip_whitespace(line); if (line[0] == '\0' || line[0] == '#') continue; process_config_line(line, event_mask); } fclose(fp); - } else { - goto read_config_file_err; } } else { -read_config_file_err: - if (optional == 0 && errno == ENOENT) - msg_logger_and_die(LOG_ERR, "read config file: %s: %m", path); + if (optional == 0 && errno == ENOENT) + error_logger_and_die(LOG_ERR, "read config file: %s", path); } } /* End Function read_config_file */ Here you should pass argv, not NULL, to 2nd parameter of bb_daemonize_or_rexec: - fork_and_execute(DIE, NULL, NULL); - setsid(); /* Prevent hangups and become pgrp leader */ + bb_daemonize_or_rexec(0, NULL); It basically will pass argv back to devfsd_main() in re-executed child (If you run on NOMMU CPU. On MMU, it simply daemonize and ignore argv). Looks right: - fork_and_execute(NO_DIE, argv[0], argv); + wait4pid(spawn(argv)); I like devfsd.c :) Look at this beauty: /* strip last / from mount point, so we don't need to check for it later */ while (argv[1][1] != '\0' && argv[1][strlen(argv[1]) - 1] == '/') argv[1][strlen(argv[1]) - 1] = '\0'; -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 11:10:23 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 20:10:23 +0200 (CEST) Subject: [patch] coreutils/expr.c is this acceptable In-Reply-To: <200707011943.27411.vda.linux@googlemail.com> References: <0707011912070.21467@somehost> <200707011943.27411.vda.linux@googlemail.com> Message-ID: <0707012007300.21467@somehost> On Sun, 1 Jul 2007, Denis Vlasenko wrote: > Do you mean that your gcc emits bogus warning for l too? Yes. > This is better (no actual code generated: > > VALUE *l = l; /* silence gcc */ > VALUE *v = v; /* silence gcc */ It's fine with me, as long as it makes gcc shut up (which it does). Cheers, -- Cristian From cristian.ionescu-idbohrn at axis.com Sun Jul 1 11:18:17 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 20:18:17 +0200 (CEST) Subject: provide reasonable config values... Message-ID: <0707012016250.21467@somehost> ...to skip warnings: .config:75:warning: symbol value '' invalid for FEATURE_EDITING_MAX_LEN .config:78:warning: symbol value '' invalid for FEATURE_EDITING_HISTORY .config:300:warning: symbol value '' invalid for FEATURE_VI_MAX_LEN .config:498:warning: symbol value '' invalid for FEATURE_LESS_MAXLINES Cheers, -- Cristian From vda.linux at googlemail.com Sun Jul 1 11:22:05 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 20:22:05 +0200 Subject: Is there a way to /* silence gcc */? In-Reply-To: <0707011916350.21467@somehost> References: <0707011916350.21467@somehost> Message-ID: <200707012022.05877.vda.linux@googlemail.com> On Sunday 01 July 2007 19:25, Cristian Ionescu-Idbohrn wrote: > findutils/find.c: In function `parse_params': > findutils/find.c:512: warning: no previous prototype for `alloc_action' I think it's possible only thru gcc bugzilla. Or maybe gcc 4.2 will have it fixed? -- vda From vda.linux at googlemail.com Sun Jul 1 11:31:59 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 20:31:59 +0200 Subject: provide reasonable config values... In-Reply-To: <0707012016250.21467@somehost> References: <0707012016250.21467@somehost> Message-ID: <200707012031.59033.vda.linux@googlemail.com> On Sunday 01 July 2007 20:18, Cristian Ionescu-Idbohrn wrote: > ...to skip warnings: > > .config:75:warning: symbol value '' invalid for FEATURE_EDITING_MAX_LEN > .config:78:warning: symbol value '' invalid for FEATURE_EDITING_HISTORY > .config:300:warning: symbol value '' invalid for FEATURE_VI_MAX_LEN > .config:498:warning: symbol value '' invalid for FEATURE_LESS_MAXLINES I don't know how to do it. -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 11:36:41 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 20:36:41 +0200 (CEST) Subject: Is there a way to /* silence gcc */? In-Reply-To: <200707012022.05877.vda.linux@googlemail.com> References: <0707011916350.21467@somehost> <200707012022.05877.vda.linux@googlemail.com> Message-ID: <0707012033000.21467@somehost> On Sun, 1 Jul 2007, Denis Vlasenko wrote: > On Sunday 01 July 2007 19:25, Cristian Ionescu-Idbohrn wrote: > > findutils/find.c: In function `parse_params': > > findutils/find.c:512: warning: no previous prototype for `alloc_action' > > I think it's possible only thru gcc bugzilla. Let's hope so. > Or maybe gcc 4.2 will have it fixed? Unfortunately not yet, AFAICS: # /usr/bin/gcc-4.2 --version gcc-4.2 (GCC) 4.2.1 20070627 (prerelease) (Debian 4.2-20070627-1) Cheers, -- Cristian From cristian.ionescu-idbohrn at axis.com Sun Jul 1 11:57:33 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 20:57:33 +0200 (CEST) Subject: provide reasonable config values... In-Reply-To: <200707012031.59033.vda.linux@googlemail.com> References: <0707012016250.21467@somehost> <200707012031.59033.vda.linux@googlemail.com> Message-ID: <0707012056320.21467@somehost> On Sun, 1 Jul 2007, Denis Vlasenko wrote: > On Sunday 01 July 2007 20:18, Cristian Ionescu-Idbohrn wrote: > > ...to skip warnings: > > > > .config:75:warning: symbol value '' invalid for FEATURE_EDITING_MAX_LEN > > .config:78:warning: symbol value '' invalid for FEATURE_EDITING_HISTORY > > .config:300:warning: symbol value '' invalid for FEATURE_VI_MAX_LEN > > .config:498:warning: symbol value '' invalid for FEATURE_LESS_MAXLINES > > I don't know how to do it. Neither do I :( Cheers, -- Cristian From cristian.ionescu-idbohrn at axis.com Sun Jul 1 12:12:34 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 21:12:34 +0200 (CEST) Subject: CLOCK_MONOTONIC Message-ID: <0707012057510.21467@somehost> config MONOTONIC_SYSCALL bool "Use clock_gettime(CLOCK_MONOTONIC) syscall" default y help Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring time intervals (time, ping, traceroute etc need this). Probably requires Linux 2.6+. If not selected, gettimeofday will be used instead (which gives wrong results if date/time is reset). Looks like both linux and libc are involved. On my debian unstable box: # find /usr/include -type f | sort | xargs egrep CLOCK_MONOTONIC | sort /usr/include/bits/time.h:# define CLOCK_MONOTONIC 1 /usr/include/diet/time.h:#define CLOCK_MONOTONIC 1 /usr/include/diet/time.h:#define CLOCK_MONOTONIC_HR 5 /usr/include/linux/time.h:#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC) /usr/include/linux/time.h:#define CLOCKS_MONO CLOCK_MONOTONIC /usr/include/linux/time.h:#define CLOCK_MONOTONIC 1 # find /usr/include -type f | sort | xargs egrep -l CLOCK_MONOTONIC | sort /usr/include/bits/time.h /usr/include/diet/time.h /usr/include/linux/time.h # dpkg -S usr/include/bits/time.h libc6-dev: /usr/include/bits/time.h # dpkg -S usr/include/diet/time.h dietlibc-dev: /usr/include/diet/time.h # dpkg -S usr/include/linux/time.h linux-kernel-headers: /usr/include/linux/time.h uclibc-0.9.28 supports it but uclibc-0.9.27 doesn't. Cheers, -- Cristian From harald-tuxbox at arcor.de Sun Jul 1 12:07:32 2007 From: harald-tuxbox at arcor.de (=?iso-8859-1?Q?Harald_K=FCthe?=) Date: Sun, 1 Jul 2007 21:07:32 +0200 Subject: [Bug] test applet does not work as before Message-ID: <001001c7bc15$a64f52e0$0ac810ac@houdinineu> Hello list, we discovered that the busybox 1.6.0 test applet does not behave as before (and as e.g. a debian system) Debian 3.1: if [ ! "a" = "a" ]; then echo "unequal"; else echo "equal"; fi equal busybox-1.5.1 / # if /bin/busybox-1.5.1 [ ! "a" = "a" ]; then echo "unequal"; else echo "equal"; fi equal BusyBox v1.6.0 (2007-06-24 23:06:12 CEST) Built-in shell (ash): / # if [ ! "a" = "a" ]; then echo "unequal"; else echo "equal"; fi unequal Regards Harald From harald-tuxbox at arcor.de Sun Jul 1 12:25:45 2007 From: harald-tuxbox at arcor.de (=?iso-8859-1?Q?Harald_K=FCthe?=) Date: Sun, 1 Jul 2007 21:25:45 +0200 Subject: [Bug?] init.c: problems if kernel gets console=null via cmdline Message-ID: <001101c7bc15$a6f3d040$0ac810ac@houdinineu> Hello list, we have problems with the recent versions of busybox (1.5 and 1.6) when we start our kernel (2.4.34) without console. Some programs do not start e.g. samba server. When we link init to an older version of busybox thing get working. Debugging is difficult because the problem does not exist in a strace/gdb environement. It seems to be ok if I hack console_init() that it uses /dev/null as the console. Any help / direction is appreciated. Regards Harald From vda.linux at googlemail.com Sun Jul 1 12:32:31 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 21:32:31 +0200 Subject: [Bug?] init.c: problems if kernel gets console=null via cmdline In-Reply-To: <001101c7bc15$a6f3d040$0ac810ac@houdinineu> References: <001101c7bc15$a6f3d040$0ac810ac@houdinineu> Message-ID: <200707012132.32011.vda.linux@googlemail.com> On Sunday 01 July 2007 21:25, Harald K?the wrote: > Hello list, > > we have problems with the recent versions of busybox (1.5 and 1.6) when we start our kernel (2.4.34) without console. > Some programs do not start e.g. samba server. > When we link init to an older version of busybox thing get working. > Debugging is difficult because the problem does not exist in a strace/gdb environement. > It seems to be ok if I hack console_init() that it uses /dev/null as the console. > > Any help / direction is appreciated. Try this: in init.c, add "else" clause as shown below: static void console_init(void) { struct serial_struct sr; char *s; s = getenv("CONSOLE"); if (!s) s = getenv("console"); if (s) { int fd = open(s, O_RDWR | O_NONBLOCK | O_NOCTTY); if (fd >= 0) { dup2(fd, 0); dup2(fd, 1); dup2(fd, 2); while (fd > 2) close(fd--); } messageD(L_LOG, "console='%s'", s); + } else { + /* Make sure fd 0,1,2 are not closed */ + bb_sanitize_stdio(); } If it helps, I will add it in 1.6.2. -- vda From vda.linux at googlemail.com Sun Jul 1 12:36:57 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 21:36:57 +0200 Subject: CLOCK_MONOTONIC In-Reply-To: <0707012057510.21467@somehost> References: <0707012057510.21467@somehost> Message-ID: <200707012136.57827.vda.linux@googlemail.com> Hi Cristian, On Sunday 01 July 2007 21:12, Cristian Ionescu-Idbohrn wrote: > config MONOTONIC_SYSCALL > bool "Use clock_gettime(CLOCK_MONOTONIC) syscall" > default y > help > Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring > time intervals (time, ping, traceroute etc need this). > Probably requires Linux 2.6+. If not selected, gettimeofday > will be used instead (which gives wrong results if date/time > is reset). > > Looks like both linux and libc are involved. On my debian unstable box: > > # find /usr/include -type f | sort | xargs egrep CLOCK_MONOTONIC | sort > /usr/include/bits/time.h:# define CLOCK_MONOTONIC 1 > /usr/include/diet/time.h:#define CLOCK_MONOTONIC 1 > /usr/include/diet/time.h:#define CLOCK_MONOTONIC_HR 5 > /usr/include/linux/time.h:#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC) > /usr/include/linux/time.h:#define CLOCKS_MONO CLOCK_MONOTONIC > /usr/include/linux/time.h:#define CLOCK_MONOTONIC 1 > > # find /usr/include -type f | sort | xargs egrep -l CLOCK_MONOTONIC | sort > /usr/include/bits/time.h > /usr/include/diet/time.h > /usr/include/linux/time.h > > # dpkg -S usr/include/bits/time.h > libc6-dev: /usr/include/bits/time.h > > # dpkg -S usr/include/diet/time.h > dietlibc-dev: /usr/include/diet/time.h > > # dpkg -S usr/include/linux/time.h > linux-kernel-headers: /usr/include/linux/time.h > > uclibc-0.9.28 supports it but uclibc-0.9.27 doesn't. Looks like a set of purely informative statements to me. Can you explain what do you proposing / complaining about / whatever? -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 12:44:00 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 21:44:00 +0200 (CEST) Subject: CLOCK_MONOTONIC In-Reply-To: <200707012136.57827.vda.linux@googlemail.com> References: <0707012057510.21467@somehost> <200707012136.57827.vda.linux@googlemail.com> Message-ID: <0707012139150.21467@somehost> On Sun, 1 Jul 2007, Denis Vlasenko wrote: > Hi Cristian, Denis, > On Sunday 01 July 2007 21:12, Cristian Ionescu-Idbohrn wrote: > > config MONOTONIC_SYSCALL > > bool "Use clock_gettime(CLOCK_MONOTONIC) syscall" > > default y > > help > > Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring > > time intervals (time, ping, traceroute etc need this). > > Probably requires Linux 2.6+. If not selected, gettimeofday > > will be used instead (which gives wrong results if date/time > > is reset). > > > > Looks like both linux and libc are involved. On my debian unstable box: > > > > # find /usr/include -type f | sort | xargs egrep CLOCK_MONOTONIC | sort > > /usr/include/bits/time.h:# define CLOCK_MONOTONIC 1 > > /usr/include/diet/time.h:#define CLOCK_MONOTONIC 1 > > /usr/include/diet/time.h:#define CLOCK_MONOTONIC_HR 5 > > /usr/include/linux/time.h:#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC) > > /usr/include/linux/time.h:#define CLOCKS_MONO CLOCK_MONOTONIC > > /usr/include/linux/time.h:#define CLOCK_MONOTONIC 1 > > > > # find /usr/include -type f | sort | xargs egrep -l CLOCK_MONOTONIC | sort > > /usr/include/bits/time.h > > /usr/include/diet/time.h > > /usr/include/linux/time.h > > > > # dpkg -S usr/include/bits/time.h > > libc6-dev: /usr/include/bits/time.h > > > > # dpkg -S usr/include/diet/time.h > > dietlibc-dev: /usr/include/diet/time.h > > > > # dpkg -S usr/include/linux/time.h > > linux-kernel-headers: /usr/include/linux/time.h > > > > uclibc-0.9.28 supports it but uclibc-0.9.27 doesn't. > > Looks like a set of purely informative statements to me. Yes. Make the question: why does this bite me? obsolete. > Can you explain what do you proposing / complaining about / whatever? See above. Cheers, -- Cristian From vda.linux at googlemail.com Sun Jul 1 12:50:57 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 21:50:57 +0200 Subject: [Bug] test applet does not work as before In-Reply-To: <001001c7bc15$a64f52e0$0ac810ac@houdinineu> References: <001001c7bc15$a64f52e0$0ac810ac@houdinineu> Message-ID: <200707012150.57493.vda.linux@googlemail.com> On Sunday 01 July 2007 21:07, Harald K?the wrote: > Hello list, > > we discovered that the busybox 1.6.0 test applet does not behave as before (and as e.g. a debian system) > > Debian 3.1: > if [ ! "a" = "a" ]; then echo "unequal"; else echo "equal"; fi > equal > > busybox-1.5.1 > / # if /bin/busybox-1.5.1 [ ! "a" = "a" ]; then echo "unequal"; else echo "equal"; fi > equal > > BusyBox v1.6.0 (2007-06-24 23:06:12 CEST) Built-in shell (ash): > / # if [ ! "a" = "a" ]; then echo "unequal"; else echo "equal"; fi > unequal Fixed in 1.6.1: # /usr/srcdevel/bbox/fix161/t/busybox-1.6.1/busybox ash /.1/usr/srcdevel/bbox/fix161/t/busybox-1.6.1 # if [ ! "a" = "a" ]; then echo "unequal"; else echo "equal"; fi equal -- vda From mats at blue2net.com Sun Jul 1 12:56:04 2007 From: mats at blue2net.com (Mats Erik Andersson) Date: Sun, 01 Jul 2007 21:56:04 +0200 Subject: Was: On lease/pid-file for udhcpd/c In-Reply-To: <200707011841.21054.vda.linux@googlemail.com> References: <1183144975.14905.41.camel@Blue2net-mats.bellman.mea> <200707011654.45098.vda.linux@googlemail.com> <200707011841.21054.vda.linux@googlemail.com> Message-ID: <1183319764.3981.6.camel@Blue2net-mats.bellman.mea> s?n 2007-07-01 klockan 18:41 +0200 skrev Denis Vlasenko: > BTW, udhcp code needs more love, that's for sure. > Gauntlet and challange taken! All the more since I will depend on udhcpd and udhcpc professionally, but I grant no fixed time span for my future patches, nor will I feel offended, should someone else beat me in the race. Best regards, Mats E A From farmatito at tiscali.it Sun Jul 1 13:13:57 2007 From: farmatito at tiscali.it (Tito) Date: Sun, 1 Jul 2007 22:13:57 +0200 Subject: [PATCH] more devfsd clean up and size reduction In-Reply-To: <200707012007.51853.vda.linux@googlemail.com> References: <200706301416.33468.farmatito@tiscali.it> <200707012007.51853.vda.linux@googlemail.com> Message-ID: <200707012213.57805.farmatito@tiscali.it> On Sunday 01 July 2007 20:07:51 Denis Vlasenko wrote: > On Saturday 30 June 2007 14:16, Tito wrote: > > Hi, > > as nobody complained about my previous devfsd patch > > (....i presume because nobody is using it ;-) ) > > here is one more round > > of size reduction and code clean style clean up. > > This patch removes the functions > > msg_logger, msg_logger_and_die, fork_and_execute > > and uses libbb stuff instead. > > > > Bloat-o-meter says: > > > > root at localhost:~/Desktop/busybox# scripts/bloat-o-meter busybox_old busybox_unstripped > > function old new delta > > expand_variable 756 759 +3 > > get_variable 259 257 -2 > > get_uid_gid 122 120 -2 > > do_ioctl_and_die 27 25 -2 > > st_expr_expand 488 485 -3 > > signal_handler 94 91 -3 > > devfsd_main 842 833 -9 > > service_name 2444 2433 -11 > > read_config_file 1119 1098 -21 > > msg_logger_and_die 31 - -31 > > .rodata 125143 125111 -32 > > msg_logger 88 - -88 > > fork_and_execute 95 - -95 > > ------------------------------------------------------------------------------ > > (add/remove: 0/3 grow/shrink: 1/9 up/down: 3/-299) Total: -296 bytes > > > > BE WARNED THAT THIS IS ONLY COMPILE TESTED!!! > > > > If there are some volunteers for testing it ..... > > > > Denis could you please take a look at my use > > of spawn, xspawn, wait4pid and bb_daemonize_or_rexec > > as I never used them before and i'm not quite sure > > if i've done things right............. > > and apply the patch if you like it. > > Looks like you should indeed use fopen, not xfopen here. > You test it for NULL, and do not seem to exit if it fails: Hi, i see, will fix it. > - if ((fp = fopen(path, "r")) != NULL) { > + if ((fp = xfopen(path, "r")) != NULL) { > while (fgets(buf, STRING_LENGTH, fp) != NULL) { > /* Skip whitespace */ > - for (line = buf; isspace(*line); ++line) > - /*VOID*/; > + line = buf; > + line = skip_whitespace(line); > if (line[0] == '\0' || line[0] == '#') > continue; > process_config_line(line, event_mask); > } > fclose(fp); > - } else { > - goto read_config_file_err; > } > } else { > -read_config_file_err: > - if (optional == 0 && errno == ENOENT) > - msg_logger_and_die(LOG_ERR, "read config file: %s: %m", path); > + if (optional == 0 && errno == ENOENT) > + error_logger_and_die(LOG_ERR, "read config file: %s", path); > } > } /* End Function read_config_file */ > > > Here you should pass argv, not NULL, to 2nd parameter of bb_daemonize_or_rexec: I suspected that but was lost in the define forest of this code... > - fork_and_execute(DIE, NULL, NULL); > - setsid(); /* Prevent hangups and become pgrp leader */ > + bb_daemonize_or_rexec(0, NULL); > > It basically will pass argv back to devfsd_main() in re-executed child > (If you run on NOMMU CPU. On MMU, it simply daemonize and ignore argv). > > > Looks right: > > - fork_and_execute(NO_DIE, argv[0], argv); > + wait4pid(spawn(argv)); > > > > > I like devfsd.c :) Look at this beauty: :-) this is my personal creation........did it when i was young... i planned to substitute it with bb_simplify_path, will add it to the improved patch (this saves about 40b), don't ask me why i put it there....I'm sure there was some reason... but I can't remember it.... > /* strip last / from mount point, so we don't need to check for it later */ > while (argv[1][1] != '\0' && argv[1][strlen(argv[1]) - 1] == '/') > argv[1][strlen(argv[1]) - 1] = '\0'; > > -- > vda > Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: devfsd04.patch Type: text/x-diff Size: 13066 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070701/d204c480/attachment-0001.bin From farmatito at tiscali.it Sun Jul 1 13:40:10 2007 From: farmatito at tiscali.it (Tito) Date: Sun, 1 Jul 2007 22:40:10 +0200 Subject: [PATCH] more devfsd clean up and size reduction In-Reply-To: <200707012007.51853.vda.linux@googlemail.com> References: <200706301416.33468.farmatito@tiscali.it> <200707012007.51853.vda.linux@googlemail.com> Message-ID: <200707012240.10911.farmatito@tiscali.it> On Sunday 01 July 2007 20:07:51 you wrote: > On Saturday 30 June 2007 14:16, Tito wrote: Hi, please use this patch 05 as the previous has a duplicated comment line. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: devfsd05.patch Type: text/x-diff Size: 13037 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070701/c73fd388/attachment.bin From vda.linux at googlemail.com Sun Jul 1 15:11:31 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 2 Jul 2007 00:11:31 +0200 Subject: Was: On lease/pid-file for udhcpd/c In-Reply-To: <1183319764.3981.6.camel@Blue2net-mats.bellman.mea> References: <1183144975.14905.41.camel@Blue2net-mats.bellman.mea> <200707011841.21054.vda.linux@googlemail.com> <1183319764.3981.6.camel@Blue2net-mats.bellman.mea> Message-ID: <200707020011.31781.vda.linux@googlemail.com> On Sunday 01 July 2007 21:56, Mats Erik Andersson wrote: > s?n 2007-07-01 klockan 18:41 +0200 skrev Denis Vlasenko: > > > BTW, udhcp code needs more love, that's for sure. > > > > Gauntlet and challange taken! All the more since I will > depend on udhcpd and udhcpc professionally, but I grant > no fixed time span for my future patches, nor will I > feel offended, should someone else beat me in the race. I tried to address some of those in recent commits. Returning to pidfile problem... where it happens? -- vda From vda.linux at googlemail.com Sun Jul 1 15:15:31 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 2 Jul 2007 00:15:31 +0200 Subject: Busybox & memory In-Reply-To: References: <001701c7b42d$6a28b850$c814a8c0@IPAQ> <200706212308.56599.vda.linux@googlemail.com> Message-ID: <200707020015.31773.vda.linux@googlemail.com> On Friday 29 June 2007 14:45, Alex Kums wrote: > Thu, 21 Jun 2007 23:08:56 +0200, Denis Vlasenko > ?????(?): > > Hi. > > >>Of course, if your particular NOMMU arch cannot share text/rodata section > of several instances of running executables, then you have to split > busybox to avoid having duplicate code loaded. > > With 'ps' (VSZ section) I found that each instance of busybox - syslogd, > crond, inetd eat ~2Mb of memory. Does it mean that my arch (btw, ARM CPU VSZ shows total virtual memory use, without shared/private memory stats. I use pmap (or cat /proc/PID/maps) in order to see more detailed picture. Can you show "cat /proc/PID/maps" from your ARM box? BTW, which bbox version is that? > at91rm9200) doesn't support things you said, and I should split busybox > into small parts? Honestly, I don't know about at91rm9200. > > BTW, what about the feature 'Split busybox into standalone programs' in > config? I'm not sure whether it exists/works :-/ -- vda From vda.linux at googlemail.com Sun Jul 1 15:23:22 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 2 Jul 2007 00:23:22 +0200 Subject: [PATCH] more devfsd clean up and size reduction In-Reply-To: <200707012240.10911.farmatito@tiscali.it> References: <200706301416.33468.farmatito@tiscali.it> <200707012007.51853.vda.linux@googlemail.com> <200707012240.10911.farmatito@tiscali.it> Message-ID: <200707020023.22219.vda.linux@googlemail.com> On Sunday 01 July 2007 22:40, Tito wrote: > On Sunday 01 July 2007 20:07:51 you wrote: > > On Saturday 30 June 2007 14:16, Tito wrote: > Hi, > please use this patch 05 as the previous has a duplicated comment line. Applied, thanks. also did s/do_ioctl_and_die/do_ioctl_or_die/g, as it doesnt ALWAYS die, it dies only on error. -- vda From ynakam at hitachisoft.jp Sun Jul 1 22:29:59 2007 From: ynakam at hitachisoft.jp (Yuichi Nakamura) Date: Mon, 02 Jul 2007 14:29:59 +0900 Subject: [patch]setfiles/restorecon applet Message-ID: <20070702142205.3CC1.YNAKAM@hitachisoft.jp> Hi. I would like to submit setfiles/restorecon applet. setfiles and restorecon are SELinux commands that label files according to configuration file (in configuration file, relationship between file and label is described). These applets are very important for SELinux enabled system. Please review and consider merging this patch. -- Yuichi Nakamura Hitachi Software Engineering Co., Ltd. Japan SELinux Users Group(JSELUG): http://www.selinux.gr.jp/ SELinux Policy Editor: http://seedit.sourceforge.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: setfiles_20070627.patch Type: application/octet-stream Size: 22789 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070702/8455806f/attachment-0001.obj From rep.dot.nop at gmail.com Mon Jul 2 01:19:03 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Mon, 2 Jul 2007 10:19:03 +0200 Subject: Is there a way to /* silence gcc */? In-Reply-To: <0707012033000.21467@somehost> References: <0707011916350.21467@somehost> <200707012022.05877.vda.linux@googlemail.com> <0707012033000.21467@somehost> Message-ID: <20070702081903.GA4937@aon.at> On Sun, Jul 01, 2007 at 08:36:41PM +0200, Cristian Ionescu-Idbohrn wrote: >On Sun, 1 Jul 2007, Denis Vlasenko wrote: > >> On Sunday 01 July 2007 19:25, Cristian Ionescu-Idbohrn wrote: >> > findutils/find.c: In function `parse_params': >> > findutils/find.c:512: warning: no previous prototype for `alloc_action' >> >> I think it's possible only thru gcc bugzilla. > >Let's hope so. > >> Or maybe gcc 4.2 will have it fixed? > >Unfortunately not yet, AFAICS: > ># /usr/bin/gcc-4.2 --version >gcc-4.2 (GCC) 4.2.1 20070627 (prerelease) (Debian 4.2-20070627-1) Either improve gcc or fix find to be C99 compliant (nested functions are prohibited in C99, this is more or less a "bug" in find.c). From mats at blue2net.com Mon Jul 2 02:49:43 2007 From: mats at blue2net.com (Mats Erik Andersson) Date: Mon, 02 Jul 2007 11:49:43 +0200 Subject: Closing: On lease/pid-file for udhcpd/c In-Reply-To: <200707020011.31781.vda.linux@googlemail.com> References: <1183144975.14905.41.camel@Blue2net-mats.bellman.mea> <200707011841.21054.vda.linux@googlemail.com> <1183319764.3981.6.camel@Blue2net-mats.bellman.mea> <200707020011.31781.vda.linux@googlemail.com> Message-ID: <1183369784.4000.15.camel@Blue2net-mats.bellman.mea> m?n 2007-07-02 klockan 00:11 +0200 skrev Denis Vlasenko: > On Sunday 01 July 2007 21:56, Mats Erik Andersson wrote: > > s?n 2007-07-01 klockan 18:41 +0200 skrev Denis Vlasenko: > > > > > BTW, udhcp code needs more love, that's for sure. > > > > > > > Gauntlet and challange taken! All the more since I will > > > I tried to address some of those in recent commits. > > Returning to pidfile problem... where it happens? > -- > vda I will work on a pidfile patch this afternoon, since I for various reasons had to build a new buildroot instance on which to try the code alterations. On the other hand, a quick check concerning the type in_addr demonstrates that the headers of glibc 2.3.6 as well as uClibc 0.28.3 uses uint32_t for in_addr, it is only the manpages that are seriously outdated. Another quick glance in the udhcp-directory of Busybox-svn indicates that it is only dhcpc.h and dhcpc.c that are suffering from the use of 'long' for 'uint32_t' in ip-addresses. I will begin to review and alter those parts of the code and produce a patch to correct them. Let me declare this mail thread for closed. New subject next time. Best regards, Mats E A From dieter at able.be Mon Jul 2 03:32:10 2007 From: dieter at able.be (dieter) Date: Mon, 02 Jul 2007 12:32:10 +0200 Subject: ping command line parse bug Message-ID: <1183372330.4890.49.camel@inflamm.able.be> Hi, There seems to be a bug in ping_main when the ipv6 code is enabled. No matter what erguments, it prints 'bad address 'qing'. :) Patch below. Kind regards, dieter --- ./busybox-1.6.0/networking/ping.c.orig 2007-07-02 10:17:21.000000000 +0000 +++ ./busybox-1.6.0/networking/ping.c 2007-07-02 10:17:57.000000000 +0000 @@ -179,7 +179,7 @@ len_and_sockaddr *lsa; #if ENABLE_PING6 sa_family_t af = AF_UNSPEC; - while (++argv[0][0] == '-') { + while ((++argv)[0] && argv[0][0] == '-') { if (argv[0][1] == '4') { af = AF_INET; continue; -- NEW on aXs GUARD: SSL VPN !! (contact your reseller for more info) --------------------------------------------------- aXs GUARD has completed security and anti-virus checks on this e-mail (http://www.axsguard.com) --------------------------------------------------- Able NV: ond.nr 0457.938.087 RPR Mechelen From natanael.copa at gmail.com Mon Jul 2 07:53:08 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Mon, 02 Jul 2007 14:53:08 +0000 Subject: Aw: Re: mdev woes In-Reply-To: <200706281540.35506.vapier@gentoo.org> References: <13080109.1183047315105.JavaMail.ngmail@webmail15> <200706281304.07005.vapier@gentoo.org> <46840974.40208@arcor.de> <200706281540.35506.vapier@gentoo.org> Message-ID: <1183387988.30435.12.camel@localhost> On Thu, 2007-06-28 at 15:40 -0400, Mike Frysinger wrote: > On Thursday 28 June 2007, Jason Curl wrote: > > mdev > > already knows about the device, so a symlink option like udev has would > > save flash space overall (less scripts, faster and as an option in the > > menuconfig would mean only those who want it would use it). > > there is a patch on the mailing list to add this ... i'm debating adding it as > the purpose of mdev is to provide the bare min required features; if you need > more, go use udev I vote for this feature. I use a script to create links where I want them but its hackish and ugly. Natanael Copa From mats at blue2net.com Mon Jul 2 07:54:11 2007 From: mats at blue2net.com (Mats Erik Andersson) Date: Mon, 02 Jul 2007 16:54:11 +0200 Subject: [PATCH-suggestion] The pidfile problem of udhcpc Message-ID: <1183388051.4000.45.camel@Blue2net-mats.bellman.mea> Hi again, I have analyzed and located the problem with udhcpc for todays snapshot of Busybox when one uses # CONFIG_FEATURE_PIDFILE is not set Attached are three files: utsaga_ifdown.txt is a manual recovery and error listing ifupdown_without_pidfile.diff is a functional patch, see below bb_udhcpc_script_error_handling.diff mends a related problem My original issue was that when ENABLE_FEATURE_PIDFILE=0 causes an error ifdown eth0 when eth0 is dhcp-controled --> udhcpc --> ifupdown --> execute --> --> cat /var/run/udhcpc.eth0.pid has an empty argument ----> kill udhcpc fails and 'ifdown eth0' fails midway The suggested patch makes one bad choice out of three: identify process udhcpc using either of pidof/killall/killall5 where I went for pidof. All three function calls have a configuration option of their own. Least bad solution? Is it worth the risk to scrap 'execute()' and go for exec() directly? You decide! I have found the culprit and provided a starting point. Lastly, that manual recovery displays an error message for 'route', which happens to originate in a script 'default.script' for udhcpc, but which is not supplied by Busybox. Instead, it comes from Buildroot. The corresponding patch is my third attached file. It would presumably look more trustworthy if such a patch would originate from a Busybox maintainer, so feel free to forward it to Buildroot, since it indeed does remove said error message. I have tested it on x86-images. The error was present for a long time on my small systems, long long before FEATURE_PIDFILE entered the picture. Best regards, Mats E A -------------- next part -------------- # ifconfig eth0 down # ifdown eth0 cat: can't open '/var/run/udhcpc.eth0.pid': No such file or directory You need to specify whom to kill # ifup eth0 udhcpc (v1.7.0.svn) started eth0: Setting 3c5x9/3c5x9B half-duplex mode if_port: 0, sw_info: 1331 eth0: Setting Rx mode to 0 addresses. eth0: Setting Rx mode to 1 addresses. Sending discover... Sending discover... Sending select for 192.168.7.15... Lease of 192.168.7.15 obtained, lease time 21600 deleting routers route: SIOC[ADD|DEL]RT: No such process adding dns 192.168.7.253 # ls /tmp/ dropbear.pid lastlog messages sdp ifstate log resolv.conf # ifdown eth0 cat: can't open '/var/run/udhcpc.eth0.pid': No such file or directory You need to specify whom to kill # ps 258 root 688 S /sbin/getty -L ttyS1 115200 vt100 288 root 700 S udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0 298 root 688 R ps # ls /var/run/ dropbear.pid lastlog messages sdp ifstate log resolv.conf # echo 288 > /var/run/udhcpc.eth0.pid # ifdown eth0 ifdown: interface eth0 not configured # -------------- next part -------------- A non-text attachment was scrubbed... Name: ifupdown_without_pidfile.diff Type: text/x-patch Size: 669 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070702/4c46a018/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_udhcpc_script_error_handling.diff Type: text/x-patch Size: 1944 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070702/4c46a018/attachment-0001.bin From miroslaw.dach at psi.ch Mon Jul 2 08:44:00 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Mon, 2 Jul 2007 17:44:00 +0200 (CEST) Subject: screen manager terminal emulation In-Reply-To: Message-ID: Hi Hinko, I went little-bit further with screen and curses: I have recompiled the ncurses library version 5.4 with options which I have figured out from ELDK4.1: ./configure --host=i386-linux --with-normal --with-shared --without-debug --without-profile --with-cxx --without-ada --enable-sigwinch --enable-hard-tabs '--with-ospeed=unsigned int' '--with-build-cc=/usr/bin/gcc -B/usr/bin/' --enable-termcap --enable-termcap --with-shared CC=powerpc-405-linux-gnu-gcc CXX=powerpc-405-linux-gnu-g++ Right now when I select TERM=vt100 I am able to start my server: ./screen -t MYSERVER -d -m ./myServer I am also able to attache to the server with: screen -r Unfortunately I am able to reattach to the server only twice. The third time when I attache to the server the screen prints the text as it was a wrong definition of characters per line. When I detach from screen and attache again with screen -r I get a message: You can't run screen on a hardcopy terminal. When I try screen -r few time more I get a message: Cannot find termcap entry for 'vt100'. To sum up all above the situation is like that: ./screen -t MYSERVER -d -m ./myServer [OK] screen -r [OK] CTRL-A D screen -r [OK] CTRL-A D screen -r [wrong nr of char per line] CTRL-A D screen -r You can't run screen on a hardcopy terminal. screen -r You can't run screen on a hardcopy terminal. screen -r Cannot find termcap entry for 'vt100' screen -r Cannot find termcap entry for 'vt100' screen -r Cannot find termcap entry for 'vt100' screen -r Cannot find termcap entry for 'vt100' screen -r Cannot find termcap entry for 'vt100' Do you have any idea what could be wrong? Best Regards Mierk From vda.linux at googlemail.com Mon Jul 2 09:15:10 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 2 Jul 2007 18:15:10 +0200 Subject: ping command line parse bug In-Reply-To: <1183372330.4890.49.camel@inflamm.able.be> References: <1183372330.4890.49.camel@inflamm.able.be> Message-ID: <1158166a0707020915t73e26c7dieefea7d2b083f4f4@mail.gmail.com> On 7/2/07, dieter wrote: > > Hi, > > There seems to be a bug in ping_main when the ipv6 code is enabled. No > matter what erguments, it prints 'bad address 'qing'. :) > Patch below. Applied to svn, thanks! -- vda From Jlau at extremenetworks.com Mon Jul 2 11:09:53 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Mon, 2 Jul 2007 11:09:53 -0700 Subject: make distclean Message-ID: <888459D4AEE6464381B30398101F42F8043FC2ED@sc-msexch-06.extremenetworks.com> When I was building Busybox 1.0, I always did a "make distclean" followed by "make". Do I need to do "make distclean" on the Busybox 1.6? I found out that on Busybox 1.6, the "make distclean" step remove the busbyox/scripts/kconfig/zconfig.tab.c (and other files too). And this caused the next "make" step to complain about zconf.tab.c: No such file or directory. Thanks for any help here. -Joe From farmatito at tiscali.it Mon Jul 2 15:08:25 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 3 Jul 2007 00:08:25 +0200 Subject: [PATCH & RFC] avoid libbb/correct_password.c to disclose info about system Message-ID: <200707030008.26106.farmatito@tiscali.it> Hi, I noticed that our password checking routine in correct_password.c behaves differently than real login app. In case that support for shadow passwords is enabled and /etc/shadow is missing it complains with an error message: "no valid shadow password, checking ordinary one" thus disclosing information about the state of the system. I think it should instead fake an incorrect login. A patch is attached, comments and critics are welcome. This is only compile tested. Ciao, Tito BTW.: scripts/bloat-o-meter busybox_old busybox_unstripped function old new delta correct_password 231 225 -6 .rodata 125111 125063 -48 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-54) Total: -54 bytes -------------- next part -------------- A non-text attachment was scrubbed... Name: correct_password.patch Type: text/x-diff Size: 688 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070703/e71eee7e/attachment.bin From Jlau at extremenetworks.com Mon Jul 2 15:32:50 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Mon, 2 Jul 2007 15:32:50 -0700 Subject: make distclean Message-ID: <888459D4AEE6464381B30398101F42F8043FC2F4@sc-msexch-06.extremenetworks.com> The BB 1.6 mount command fail to a NFS mount: mount -t nfs -o nolock,rsize=4096,wsize=4096,udp $boot_exos_nfs /exos if [ $? -ne 0 ] then echo "***** ERROR: could not mount /exos nfs partition from $boot_exos_nfs" fi Is this a known problem on BB 1.6? Do we have a fix for it? Thanks. -Joe > -----Original Message----- > From: Joe Lau > Sent: Monday, July 02, 2007 11:10 AM > To: 'busybox at busybox.net' > Cc: Joe Lau > Subject: make distclean > > > When I was building Busybox 1.0, I always did a "make > distclean" followed by "make". > Do I need to do "make distclean" on the Busybox 1.6? > I found out that on Busybox 1.6, the "make distclean" step > remove the busbyox/scripts/kconfig/zconfig.tab.c (and other files too). > And this caused the next "make" step to complain about > zconf.tab.c: No such file or directory. > > Thanks for any help here. > > -Joe From vda.linux at googlemail.com Mon Jul 2 22:19:30 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 3 Jul 2007 07:19:30 +0200 Subject: make distclean In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC2F4@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC2F4@sc-msexch-06.extremenetworks.com> Message-ID: <200707030719.30249.vda.linux@googlemail.com> On Tuesday 03 July 2007 00:32, Joe Lau wrote: > The BB 1.6 mount command fail to a NFS mount: > > mount -t nfs -o nolock,rsize=4096,wsize=4096,udp $boot_exos_nfs /exos > if [ $? -ne 0 ] > then > echo "***** ERROR: could not mount /exos nfs partition from $boot_exos_nfs" > fi What does it say? Also do strace -o mount.log mount -t nfs.... and send mount.log to the mailing list. > Is this a known problem on BB 1.6? Well, mount was completely rewritten, so it can have regressions. I need a bit more detailed bug report... > > When I was building Busybox 1.0, I always did a "make > > distclean" followed by "make". I think "make clean" should be enough. "make mrproper" will also delete .config, if you need this kind of total cleanup. -- vda From vda.linux at googlemail.com Mon Jul 2 23:11:42 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 3 Jul 2007 08:11:42 +0200 Subject: [PATCH & RFC] avoid libbb/correct_password.c to disclose info about system In-Reply-To: <200707030008.26106.farmatito@tiscali.it> References: <200707030008.26106.farmatito@tiscali.it> Message-ID: <200707030811.42870.vda.linux@googlemail.com> On Tuesday 03 July 2007 00:08, Tito wrote: > Hi, > I noticed that our password checking routine in correct_password.c > behaves differently than real login app. > In case that support for shadow passwords is enabled and > /etc/shadow is missing it complains with an error message: > > "no valid shadow password, checking ordinary one" > > thus disclosing information about the state of the system. > I think it should instead fake an incorrect login. > A patch is attached, comments and critics are welcome. With this patch, you *require* admin to keep passwords in /etc/shadow. I prefer when admin *has an option* to have /etc/shadow, but [s]he can still have them in /etc/passwd instead. I will do this: #if ENABLE_FEATURE_SHADOWPASSWDS if ((correct[0] == 'x' || correct[0] == '*') && !correct[1]) { if (getspnam_r(pw->pw_name, &spw, buffer, sizeof(buffer), &result) == 0) correct = spw.sp_pwdp; /* else: no valid shadow password, checking ordinary one */ } #endif Is it ok with you? -- vda From farmatito at tiscali.it Mon Jul 2 23:41:35 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 3 Jul 2007 08:41:35 +0200 Subject: [PATCH & RFC] avoid libbb/correct_password.c to disclose info about system In-Reply-To: <200707030811.42870.vda.linux@googlemail.com> References: <200707030008.26106.farmatito@tiscali.it> <200707030811.42870.vda.linux@googlemail.com> Message-ID: <200707030841.35771.farmatito@tiscali.it> On Tuesday 03 July 2007 08:11:42 Denis Vlasenko wrote: > On Tuesday 03 July 2007 00:08, Tito wrote: > > Hi, > > I noticed that our password checking routine in correct_password.c > > behaves differently than real login app. > > In case that support for shadow passwords is enabled and > > /etc/shadow is missing it complains with an error message: > > > > "no valid shadow password, checking ordinary one" > > > > thus disclosing information about the state of the system. > > I think it should instead fake an incorrect login. > > A patch is attached, comments and critics are welcome. > > With this patch, you *require* admin to keep passwords in /etc/shadow. Why? +???????if (LONE_CHAR(pw->pw_passwd, 'x') || LONE_CHAR(pw->pw_passwd, '*')) +???????????????correct = (getspnam_r(pw->pw_name, &spw, buffer, sizeof(buffer), &result)) ? "aa" : spw.sp_pwdp; It's the admin himself that is saying through 'x' or '*' that he wants to use shadow passwords. If you put a real password in pw->pw_passwd this code is not executed. > I prefer when admin *has an option* to have /etc/shadow, > but [s]he can still have them in /etc/passwd instead. > > I will do this: > > #if ENABLE_FEATURE_SHADOWPASSWDS > if ((correct[0] == 'x' || correct[0] == '*') && !correct[1]) { Adding &&!correct[1] to the check is a good idea, we should do it indipendently of this issue. > if (getspnam_r(pw->pw_name, &spw, buffer, sizeof(buffer), &result) == 0) > correct = spw.sp_pwdp; > /* else: no valid shadow password, checking ordinary one */ > } > #endif > > Is it ok with you? > -- > vda > In this way if getspnam_r fails correct will be "x" or "*" and man page says: salt is a two-character string chosen from the set [a?zA?Z0?9./]. This string is used to perturb the algorithm in one of 4096 different ways. Think this was the reason we used correct = "aa"? Ciao, Tito From vda.linux at googlemail.com Tue Jul 3 01:51:44 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 3 Jul 2007 10:51:44 +0200 Subject: [PATCH-suggestion] The pidfile problem of udhcpc In-Reply-To: <1183388051.4000.45.camel@Blue2net-mats.bellman.mea> References: <1183388051.4000.45.camel@Blue2net-mats.bellman.mea> Message-ID: <200707031051.44811.vda.linux@googlemail.com> On Monday 02 July 2007 16:54, Mats Erik Andersson wrote: > Hi again, > > I have analyzed and located the problem with udhcpc > for todays snapshot of Busybox when one uses > > # CONFIG_FEATURE_PIDFILE is not set > > Attached are three files: > > utsaga_ifdown.txt is a manual recovery and error listing > > ifupdown_without_pidfile.diff is a functional patch, see below > > bb_udhcpc_script_error_handling.diff mends a related problem > > > My original issue was that when ENABLE_FEATURE_PIDFILE=0 causes > an error > > ifdown eth0 when eth0 is dhcp-controled > --> udhcpc --> ifupdown --> execute --> > --> cat /var/run/udhcpc.eth0.pid has an empty argument > ----> kill udhcpc fails and 'ifdown eth0' fails midway So it's not a problem with udhcpd. It works perfectly fine, it just does not create pidfile. The problem is with ifupdown. The general problem with ifupdown is that it is "copulated in vertical fashion" by design. It tries to do the job of shell script in C, and this is invariably doomed to fail. You need ifup/ifdown to be adaptable by local admins, and C is an extremely poor choice for that. We are doomed to have problems with ifup/ifdown. Just look as this code: static const struct dhcp_client_t ext_dhcp_clients[] = { { "dhcpcd", "", "" }, { "dhclient", ........ }, { "pump", ........ }, { "udhcpc", ........ }, }; static int dhcp_down(struct interface_defn_t *ifd, execfn *exec) { #if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP int i ; for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) { if (exists_execable(ext_dhcp_clients[i].name)) return execute(ext_dhcp_clients[i].stopcmd, ifd, exec); } bb_error_msg("no dhcp clients found, using static interface shutdown"); return static_down(ifd, exec); #elif ENABLE_APP_UDHCPC return execute("kill " "`cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec); #else return 0; /* no dhcp support */ #endif } How the hell it is supposed to work reliably this way?? Just imagine that admin is using pump and ifup/ifdown. It works. Then, for whatever reason, admin installs dhclient, but does NOT use it. ifdown will STOP WORKING, just because it will see installed dhclient binary in e.g. /usr/bin/dhclient! Ain't it idiotic? I am sure we will fix problem with udhcpc pidfiles, one way or another. But I seriously urge people to not use ifup/ifdown. Use something less brain damaged. -- vda From wharms at bfs.de Tue Jul 3 02:26:38 2007 From: wharms at bfs.de (walter harms) Date: Tue, 03 Jul 2007 11:26:38 +0200 Subject: screen manager terminal emulation In-Reply-To: References: Message-ID: <468A164E.7010302@bfs.de> hi, from the reaction is seems clear that the init is broken somehow. Either it is not called at all or the stored structures are overwritten. ntl check where the terminfo stuff gets loaded (perhaps with strace) and print some important variables and see when/if they change. perhaps the people on the screen ml can help you better. re, wh Miroslaw Dach wrote: > Hi Hinko, > > I went little-bit further with screen and curses: > > > Unfortunately I am able to reattach to the server only twice. > The third time when I attache to the server the screen prints the text as > it was a wrong definition of characters per line. > > When I detach from screen and attache again with screen -r > I get a message: > > You can't run screen on a hardcopy terminal. > > When I try screen -r few time more I get a message: > > Cannot find termcap entry for 'vt100'. > > > To sum up all above the situation is like that: > > ./screen -t MYSERVER -d -m ./myServer [OK] > > screen -r [OK] > CTRL-A D > screen -r [OK] > CTRL-A D > screen -r [wrong nr of char per line] > CTRL-A D > screen -r > You can't run screen on a hardcopy terminal. > screen -r > You can't run screen on a hardcopy terminal. > screen -r > Cannot find termcap entry for 'vt100' > screen -r > Cannot find termcap entry for 'vt100' > screen -r > Cannot find termcap entry for 'vt100' > screen -r > Cannot find termcap entry for 'vt100' > screen -r > Cannot find termcap entry for 'vt100' > > > Do you have any idea what could be wrong? > > Best Regards > > Mierk > > > > > > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From vda.linux at googlemail.com Tue Jul 3 03:14:35 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 3 Jul 2007 12:14:35 +0200 Subject: [PATCH & RFC] avoid libbb/correct_password.c to disclose info about system In-Reply-To: <200707030841.35771.farmatito@tiscali.it> References: <200707030008.26106.farmatito@tiscali.it> <200707030811.42870.vda.linux@googlemail.com> <200707030841.35771.farmatito@tiscali.it> Message-ID: <200707031214.35583.vda.linux@googlemail.com> On Tuesday 03 July 2007 08:41, Tito wrote: > On Tuesday 03 July 2007 08:11:42 Denis Vlasenko wrote: > > On Tuesday 03 July 2007 00:08, Tito wrote: > > > Hi, > > > I noticed that our password checking routine in correct_password.c > > > behaves differently than real login app. > > > In case that support for shadow passwords is enabled and > > > /etc/shadow is missing it complains with an error message: > > > > > > "no valid shadow password, checking ordinary one" > > > > > > thus disclosing information about the state of the system. > > > I think it should instead fake an incorrect login. > > > A patch is attached, comments and critics are welcome. > > > > With this patch, you *require* admin to keep passwords in /etc/shadow. > Why? > > +???????if (LONE_CHAR(pw->pw_passwd, 'x') || LONE_CHAR(pw->pw_passwd, '*')) > +???????????????correct = (getspnam_r(pw->pw_name, &spw, buffer, sizeof(buffer), &result)) ? "aa" : spw.sp_pwdp; > > It's the admin himself that is saying through 'x' or '*' that he wants to use shadow passwords. > If you put a real password in pw->pw_passwd this code is not executed. Oops... my brainfart, you're right. Will fix in svn in a few minutes. -- vda From miroslaw.dach at psi.ch Tue Jul 3 04:19:27 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Tue, 3 Jul 2007 13:19:27 +0200 (CEST) Subject: .bashrc and ash Message-ID: Hi All, I am using ash as a shall in my busybox rootfile system. I wanted to set some environmental variables in .bashrc but it is not taken into account when logging with telnet. Best Regards Mirek ============================================================================= Miroslaw Dach (Miroslaw.Dach at psi.ch) - SLS/Controls Group PSI - Paul Scherrer Institut CH-5232 Villigen ============================================================================= From Alexander at Kriegisch.name Tue Jul 3 04:27:44 2007 From: Alexander at Kriegisch.name (Alexander Kriegisch) Date: Tue, 03 Jul 2007 13:27:44 +0200 Subject: .bashrc and ash In-Reply-To: References: Message-ID: <468A32B0.1000503@Kriegisch.name> > I am using ash as a shall in my busybox rootfile system. > I wanted to set some environmental variables in .bashrc but it is not > taken into account when logging with telnet. As the name suggests, .bashrc belongs to bash, not ash. You want to try .profile in your home directory. -- Alexander Kriegisch From miroslaw.dach at psi.ch Tue Jul 3 04:31:37 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Tue, 3 Jul 2007 13:31:37 +0200 (CEST) Subject: .bashrc and ash In-Reply-To: <468A32B0.1000503@Kriegisch.name> Message-ID: Thanks it does work fine now. Best Regards Mirek On Tue, 3 Jul 2007, Alexander Kriegisch wrote: > > I am using ash as a shall in my busybox rootfile system. > > I wanted to set some environmental variables in .bashrc but it is not > > taken into account when logging with telnet. > > As the name suggests, .bashrc belongs to bash, not ash. You want to try > .profile in your home directory. > -- > Alexander Kriegisch > -- ============================================================================= Miroslaw Dach (Miroslaw.Dach at psi.ch) - SLS/Controls Group PSI - Paul Scherrer Institut CH-5232 Villigen ============================================================================= From jfree at sovereign.org Tue Jul 3 05:59:46 2007 From: jfree at sovereign.org (Jim Freeman) Date: Tue, 3 Jul 2007 06:59:46 -0600 Subject: invoked as /bin/md5sum, yields sha1sum Message-ID: <20070703125946.GB23671@sovereign.org> Busybox 1.6.0, on powerpc: When md5sum is invoked as /bin/md5sum, it yields the 40-character sha1sum instead of the 32-character md5sum: # md5sum /etc/passwd fe611ba27d0d7d92bbef243109fed95d /etc/passwd # /bin/md5sum /etc/passwd 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd # sha1sum /etc/passwd 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd Does this happen with any other platforms? From jfree at sovereign.org Tue Jul 3 06:23:06 2007 From: jfree at sovereign.org (Jim Freeman) Date: Tue, 3 Jul 2007 07:23:06 -0600 Subject: whither 1.00's "passwd -p ..." ? Message-ID: <20070703132306.GC23671@sovereign.org> busybox 1.00 (and other versions?) had a "-p" option to allow setting a user's password bypassing the interactive mode # passwd fu Changing password for fu New password: Retype password: Password for fu changed by root vs. # passwd -p **** blip Setting password for blip Password changed. My CGI backends to do remote management on an embedded machine have been using this, but it now fails with current busybox, and no shell trickery I can conjure (echo/pipe, HERE doc ...) works, and nothing expect-ish is available to work with on the box. For now I kludge around the lack by emulating the example at http://www.unixguide.net/unix/faq/3.9.shtml (substituting "ptyget" for "pty"). Aside from the /proc/.../cmdline (and other?) security concerns (largely moot for many embedded scenarios), is there a reason this functionality has been removed? Anyone clued in to the reasoning/history of this change (didn't see anything on the lists)? Any hope for it's restoration? Thanks, ...jfree From hkhateb at hotmail.com Tue Jul 3 08:05:51 2007 From: hkhateb at hotmail.com (hamid khateb) Date: Tue, 03 Jul 2007 18:05:51 +0300 Subject: problem to build busybox in cygwin Message-ID: Hi All the version of BusyBox up to 1.3.0 accpet error when I perform ?make menuconfig? on Cygwin , and the error that I accept is : $ make menuconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/basic/split-include HOSTCC scripts/basic/docproc HOSTLD scripts/kconfig/mconf scripts/kconfig/mconf.o:mconf.c:(.text+0xf63): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x1011): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x116c): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x11a1): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x11c1): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x11f5): more undefined references to `_libintl_gettext' follow scripts/kconfig/mconf.o:mconf.c:(.text+0x19df): undefined reference to `_libintl_bindtextdomain' scripts/kconfig/mconf.o:mconf.c:(.text+0x19eb): undefined reference to `_libintl_textdomain' scripts/kconfig/mconf.o:mconf.c:(.text+0x1a37): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x1ac9): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x1b10): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x1b4b): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x1b74): undefined reference to `_libintl_gettext' scripts/kconfig/zconf.tab.o:zconf.tab.c:(.text+0x52d7): more undefined references to `_libintl_gettext' follow collect2: ld returned 1 exit status make[1]: *** [scripts/kconfig/mconf] Error 1 make: *** [menuconfig] Error 2 so how I can solve this problem please Best Regards Hamid Khateb _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Jlau at extremenetworks.com Tue Jul 3 09:16:20 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Tue, 3 Jul 2007 09:16:20 -0700 Subject: make distclean Message-ID: <888459D4AEE6464381B30398101F42F8043FC2F7@sc-msexch-06.extremenetworks.com> OK, the NFS mount problem turned out to be a configuration issue. I did not set CONFIG_FEATURE_MOUNT_NFS. Sorry about that. So, my understanding is that I do not need to do "make distclean" in order to have a clean build of BB. Correct? Thanks! -Joe -----Original Message----- From: Denis Vlasenko [mailto:vda.linux at googlemail.com] Sent: Monday, July 02, 2007 10:20 PM To: busybox at busybox.net Cc: Joe Lau Subject: Re: make distclean On Tuesday 03 July 2007 00:32, Joe Lau wrote: > The BB 1.6 mount command fail to a NFS mount: > > mount -t nfs -o nolock,rsize=4096,wsize=4096,udp $boot_exos_nfs /exos > if [ $? -ne 0 ] > then > echo "***** ERROR: could not mount /exos nfs partition from $boot_exos_nfs" > fi What does it say? Also do strace -o mount.log mount -t nfs.... and send mount.log to the mailing list. > Is this a known problem on BB 1.6? Well, mount was completely rewritten, so it can have regressions. I need a bit more detailed bug report... > > When I was building Busybox 1.0, I always did a "make > > distclean" followed by "make". I think "make clean" should be enough. "make mrproper" will also delete .config, if you need this kind of total cleanup. -- vda From farmatito at tiscali.it Tue Jul 3 12:59:10 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 3 Jul 2007 21:59:10 +0200 Subject: problem to build busybox in cygwin In-Reply-To: References: Message-ID: <200707032159.10328.farmatito@tiscali.it> On Tuesday 03 July 2007 17:05:51 hamid khateb wrote: > > Hi > > > > All the version of BusyBox up to 1.3.0 accpet error when I perform ?make > menuconfig? on Cygwin , and the error that I accept is : > > > > $ make menuconfig > > HOSTCC scripts/basic/fixdep > > HOSTCC scripts/basic/split-include > > HOSTCC scripts/basic/docproc > > HOSTLD scripts/kconfig/mconf > > scripts/kconfig/mconf.o:mconf.c:(.text+0xf63): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x1011): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x116c): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x11a1): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x11c1): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x11f5): more undefined references to > `_libintl_gettext' follow > > scripts/kconfig/mconf.o:mconf.c:(.text+0x19df): undefined reference to > `_libintl_bindtextdomain' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x19eb): undefined reference to > `_libintl_textdomain' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x1a37): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x1ac9): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x1b10): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x1b4b): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x1b74): undefined reference to > `_libintl_gettext' > > scripts/kconfig/zconf.tab.o:zconf.tab.c:(.text+0x52d7): more undefined > references to `_libintl_gettext' follow > > collect2: ld returned 1 exit status > > make[1]: *** [scripts/kconfig/mconf] Error 1 > > make: *** [menuconfig] Error 2 > > > > so how I can solve this problem please > Maybe by installing the gettext library (runtime and dev files)? Ciao, Tito > > Best Regards > > Hamid Khateb > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > From farmatito at tiscali.it Tue Jul 3 13:09:24 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 3 Jul 2007 22:09:24 +0200 Subject: invoked as /bin/md5sum, yields sha1sum In-Reply-To: <20070703125946.GB23671@sovereign.org> References: <20070703125946.GB23671@sovereign.org> Message-ID: <200707032209.24963.farmatito@tiscali.it> On Tuesday 03 July 2007 14:59:46 Jim Freeman wrote: > > Busybox 1.6.0, on powerpc: > > When md5sum is invoked as /bin/md5sum, it yields the 40-character sha1sum > instead of the 32-character md5sum: > > # md5sum /etc/passwd > fe611ba27d0d7d92bbef243109fed95d /etc/passwd > > # /bin/md5sum /etc/passwd > 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd > > # sha1sum /etc/passwd > 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd > > Does this happen with any other platforms? > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > Please, try attached patch. --- coreutils/md5_sha1_sum.c.orig 2007-05-26 23:23:50.000000000 +0200 +++ coreutils/md5_sha1_sum.c 2007-07-03 22:06:56.000000000 +0200 @@ -84,7 +84,7 @@ uint8_t *hash_value; unsigned flags; hash_algo_t hash_algo = ENABLE_MD5SUM - ? (ENABLE_SHA1SUM ? (**argv=='m' ? HASH_MD5 : HASH_SHA1) : HASH_MD5) + ? (ENABLE_SHA1SUM ? (applet_name[0]=='m' ? HASH_MD5 : HASH_SHA1) : HASH_MD5) : HASH_SHA1; if (ENABLE_FEATURE_MD5_SHA1_SUM_CHECK) ----------------------------------------------------------------------------------------------------------------------------------- Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: md5sum.patch Type: text/x-diff Size: 445 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070703/a41401f4/attachment.bin From farmatito at tiscali.it Tue Jul 3 13:17:10 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 3 Jul 2007 22:17:10 +0200 Subject: whither 1.00's "passwd -p ..." ? In-Reply-To: <20070703132306.GC23671@sovereign.org> References: <20070703132306.GC23671@sovereign.org> Message-ID: <200707032217.10838.farmatito@tiscali.it> On Tuesday 03 July 2007 15:23:06 Jim Freeman wrote: > busybox 1.00 (and other versions?) had a "-p" option to allow setting > a user's password bypassing the interactive mode > > # passwd fu > Changing password for fu > New password: > Retype password: > Password for fu changed by root > > vs. > # passwd -p **** blip > Setting password for blip > Password changed. > > > My CGI backends to do remote management on an embedded machine have > been using this, but it now fails with current busybox, and no > shell trickery I can conjure (echo/pipe, HERE doc ...) works, > and nothing expect-ish is available to work with on the box. > > For now I kludge around the lack by emulating the example at > http://www.unixguide.net/unix/faq/3.9.shtml (substituting > "ptyget" for "pty"). > > Aside from the /proc/.../cmdline (and other?) security concerns > (largely moot for many embedded scenarios), is there a reason > this functionality has been removed? > > Anyone clued in to the reasoning/history of this change (didn't see > anything on the lists)? Any hope for it's restoration? > > Thanks, > ...jfree > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > Maybe it was ripped out as it is non standard? OPTIONS The options which apply to the passwd command are: -a, --all This option can be used only with -S and causes show status for all users. -d, --delete Delete a user?s password (make it empty). This is a quick way to disable a password for an account. It will set the named account passwordless. -e, --expire Immediately expire an account?s password. This in effect can force a user to change his/her password at the user?s next login. -h, --help Display help message and exit. -i, --inactive INACTIVE This option is used to disable an account after the password has been expired for a number of days. After a user account has had an expired password for INACTIVE days, the user may no longer sign on to the account. -k, --keep-tokens Indicate password change should be performed only for expired authentication tokens (passwords). The user wishes to keep their non-expired tokens as before. -l, --lock Lock the named account. This option disables an account by changing the password to a value which matches no possible encrypted value. -m, --mindays MIN_DAYS Set the minimum number of days between password changes to MIN_DAYS. A value of zero for this field indicates that the user may change his/her password at any time. -q, --quiet Quiet mode. -r, --repository REPOSITORY change password in REPOSITORY repository -S, --status Display account status information. The status information consists of 7 fields. The first field is the user?s login name. The second field indicates if the user account is locked (L), has no password (NP), or has a usable password (P). The third field gives the date of the last password change. The next four fields are the minimum age, maximum age, warning period, and inactivity period for the password. These ages are expressed in days. -u, --unlock Unlock the named account. This option re-enables an account by changing the password back to its previous value (to value before using -l option). -w, --warndays WARN_DAYS Set the number of days of warning before a password change is required. The WARN_DAYS option is the number of days prior to the password expiring that a user will be warned that his/her password is about to expire. -x, --maxdays MAX_DAYS Set the maximum number of days a password remains valid. After MAX_DAYS, the password is required to be changed. Ciao, Tito From jfree at sovereign.org Tue Jul 3 14:46:37 2007 From: jfree at sovereign.org (Jim Freeman) Date: Tue, 3 Jul 2007 15:46:37 -0600 Subject: invoked as /bin/md5sum, yields sha1sum - fix works In-Reply-To: <200707032209.24963.farmatito@tiscali.it> References: <20070703125946.GB23671@sovereign.org> <200707032209.24963.farmatito@tiscali.it> Message-ID: <20070703214637.GH1686@sovereign.org> On Tue, Jul 03, 2007 at 10:09:24PM +0200, Tito wrote: > On Tuesday 03 July 2007 14:59:46 Jim Freeman wrote: ... > > When md5sum is invoked as /bin/md5sum, it yields the 40-character sha1sum > > instead of the 32-character md5sum: ... > > # /bin/md5sum /etc/passwd > > 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd ... > Please, try attached patch. > > Ciao, > Tito > --- coreutils/md5_sha1_sum.c.orig 2007-05-26 23:23:50.000000000 +0200 > +++ coreutils/md5_sha1_sum.c 2007-07-03 22:06:56.000000000 +0200 > @@ -84,7 +84,7 @@ > uint8_t *hash_value; > unsigned flags; > hash_algo_t hash_algo = ENABLE_MD5SUM > - ? (ENABLE_SHA1SUM ? (**argv=='m' ? HASH_MD5 : HASH_SHA1) : HASH_MD5) > + ? (ENABLE_SHA1SUM ? (applet_name[0]=='m' ? HASH_MD5 : HASH_SHA1) : HASH_MD5) > : HASH_SHA1; > > if (ENABLE_FEATURE_MD5_SHA1_SUM_CHECK) That did the trick - THANKS! It now works as it should: # md5sum /etc/passwd fe611ba27d0d7d92bbef243109fed95d /etc/passwd # /bin/md5sum /etc/passwd fe611ba27d0d7d92bbef243109fed95d /etc/passwd # sha1sum /etc/passwd 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd # /bin/sha1sum /etc/passwd 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd Grazie, ...jfree From farmatito at tiscali.it Wed Jul 4 01:43:33 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 4 Jul 2007 10:43:33 +0200 Subject: problem to build busybox in cygwin In-Reply-To: References: Message-ID: <200707041043.33301.farmatito@tiscali.it> On Wednesday 04 July 2007 10:30:57 hamid khateb wrote: > libintl_gettext Maybe google for libintl_gettext ;-) ? The search yields 10 pages of results.... This one of the first. Your linker can't find the symbols in gettext's library - make sure you're linking to it with the proper -l options. Read the info pages for info :) $ info gettext $ gcc -o main main.c -lintl So maybe adding -lintl could help.... Ciao, Tito From kevin.morfitt at fearnsidesystems.co.uk Wed Jul 4 02:17:16 2007 From: kevin.morfitt at fearnsidesystems.co.uk (Fearnside Systems) Date: Wed, 4 Jul 2007 10:17:16 +0100 Subject: problem to build busybox in cygwin References: <200707041043.33301.farmatito@tiscali.it> Message-ID: <005b01c7be1c$c2acba50$3902a8c0@FRN2> I use this patch to build 2.6.14 in cygwin. I'm not sure what kernel you're building but you could probably adapt the patch to suit. diff -rup linux-2.6.14-orig/scripts/kconfig/Makefile linux-2.6.14/scripts/kconfig/Makefile --- linux-2.6.14-orig/scripts/kconfig/Makefile 2005-10-28 01:02:08.000000000 +0100 +++ linux-2.6.14/scripts/kconfig/Makefile 2007-06-21 15:25:05.281250000 +0100 @@ -127,6 +127,12 @@ HOSTLOADLIBES_gconf = `pkg-config gtk+-2 HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \ -D LKC_DIRECT_LINK +HOST_OS := $(shell uname -o) +ifeq ($(HOST_OS),Cygwin) +HOSTLOADLIBES_mconf = -lintl +HOSTLOADLIBES_conf = -lintl +endif + $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o $(obj)/kxgettext: $(obj)/zconf.tab.h $(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped > On Wednesday 04 July 2007 10:30:57 hamid khateb wrote: >> libintl_gettext > > Maybe google for libintl_gettext ;-) ? > The search yields 10 pages of results.... > This one of the first. > > Your linker can't find the symbols in gettext's library - make sure you're > linking to it with the proper -l options. Read the info pages for info :) > > $ info gettext > > $ gcc -o main main.c -lintl > > So maybe adding -lintl could help.... > > Ciao, > Tito > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > From kevin.morfitt at fearnsidesystems.co.uk Wed Jul 4 03:51:44 2007 From: kevin.morfitt at fearnsidesystems.co.uk (Fearnside Systems) Date: Wed, 4 Jul 2007 11:51:44 +0100 Subject: problem to build busybox in cygwin References: <200707041043.33301.farmatito@tiscali.it> <005b01c7be1c$c2acba50$3902a8c0@FRN2> Message-ID: <007b01c7be29$6cd4f220$3902a8c0@FRN2> Sorry, wrong patch! This is the one I use to build busybox in cygwin. diff -rup busybox-orig/scripts/kconfig/Makefile busybox/scripts/kconfig/Makefile --- busybox-orig/scripts/kconfig/Makefile 2007-06-16 02:42:59.562500000 +0100 +++ busybox/scripts/kconfig/Makefile 2007-06-16 02:43:41.562500000 +0100 @@ -136,6 +136,11 @@ HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) - HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ -D LKC_DIRECT_LINK +HOST_OS := $(shell uname -o) +ifeq ($(HOST_OS),Cygwin) +HOSTLOADLIBES_mconf = -lintl +HOSTLOADLIBES_conf = -lintl +endif $(obj)/qconf.o: $(obj)/.tmp_qtcheck >I use this patch to build 2.6.14 in cygwin. I'm not sure what kernel you're > building but you could probably adapt the patch to suit. > > diff -rup linux-2.6.14-orig/scripts/kconfig/Makefile > linux-2.6.14/scripts/kconfig/Makefile > --- linux-2.6.14-orig/scripts/kconfig/Makefile 2005-10-28 > 01:02:08.000000000 > +0100 > +++ linux-2.6.14/scripts/kconfig/Makefile 2007-06-21 15:25:05.281250000 > +0100 > @@ -127,6 +127,12 @@ HOSTLOADLIBES_gconf = `pkg-config gtk+-2 > HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 > libglade-2.0 --cflags` \ > -D LKC_DIRECT_LINK > > +HOST_OS := $(shell uname -o) > +ifeq ($(HOST_OS),Cygwin) > +HOSTLOADLIBES_mconf = -lintl > +HOSTLOADLIBES_conf = -lintl > +endif > + > $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o > $(obj)/kxgettext: $(obj)/zconf.tab.h > > $(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped > > > >> On Wednesday 04 July 2007 10:30:57 hamid khateb wrote: >>> libintl_gettext >> >> Maybe google for libintl_gettext ;-) ? >> The search yields 10 pages of results.... >> This one of the first. >> >> Your linker can't find the symbols in gettext's library - make sure >> you're >> linking to it with the proper -l options. Read the info pages for info :) >> >> $ info gettext >> >> $ gcc -o main main.c -lintl >> >> So maybe adding -lintl could help.... >> >> Ciao, >> Tito >> _______________________________________________ >> busybox mailing list >> busybox at busybox.net >> http://busybox.net/cgi-bin/mailman/listinfo/busybox >> > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > From vda.linux at googlemail.com Wed Jul 4 06:13:38 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 4 Jul 2007 15:13:38 +0200 Subject: whither 1.00's "passwd -p ..." ? In-Reply-To: <20070703132306.GC23671@sovereign.org> References: <20070703132306.GC23671@sovereign.org> Message-ID: <1158166a0707040613h47d2c09drbb0c95f420430c3@mail.gmail.com> On 7/3/07, Jim Freeman wrote: > busybox 1.00 (and other versions?) had a "-p" option to allow setting > a user's password bypassing the interactive mode > > # passwd fu > Changing password for fu > New password: > Retype password: > Password for fu changed by root > > vs. > # passwd -p **** blip > Setting password for blip > Password changed. I just downloaded and built busybox 1.00. passwd does not have -p option there. I would rather add separate applet for non-interactive password change. I even have one somewhere on home machine... From dishui at gmail.com Wed Jul 4 06:53:21 2007 From: dishui at gmail.com (kaimi) Date: Wed, 4 Jul 2007 21:53:21 +0800 Subject: nfs server not work"getfh failed: Operation not permitted" Message-ID: hello,all the kernel is 2.6.20, busybox-1.5.0 and nfs-utils-1.0.10. The configuration on NFS listed below: CONFIG_NFS_FS=y CONFIG_NFS_V3=y # CONFIG_NFS_V3_ACL is not set # CONFIG_NFS_V4 is not set # CONFIG_NFS_DIRECTIO is not set CONFIG_NFSD=y CONFIG_NFSD_V3=y # CONFIG_NFSD_V3_ACL is not set # CONFIG_NFSD_V4 is not set CONFIG_NFSD_TCP=y CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=y CONFIG_NFS_COMMON=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set # CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # CONFIG_9P_FS is not set the following comes from "ps -e" 705 bin portmap 735 root rpc.statd 739 root rpc.statd 741 root [lockd] 742 root [rpciod/0] 743 root [nfsd] 744 root [nfsd] 746 root rpc.mountd 751 root /sbin/syslogd -n -m 0 752 root /sbin/klogd -n 753 root -bash 762 root rpc.rquotad $cat /etc/hosts.allow ALL:ALL $cat /etc/exports /tmp *(rw,async,no_root_squash,subtree_check) $cat /var/log/nfs/etab /tmp *(rw,async,wdelay,hide,nocrossmnt,secure,no_root_squash,no_all_squash,subtree_check,secure_locks,acl,mapping=identity,anonuid=65534,an) to my strange, there's no messages in /proc/fs/nfs/exportfs, I don't know if this is the cause. $cat /proc/fs/nfs/exports # Version 1.1 # Path Client(Flags) # IPs when I try to mount the nfs directory in "mount server:/tmp /mnt", the client get "mount: 192.168.0.254:/tmp failed, reason given by server: Permission denied" and the server's log says "getfh failed: Operation not permitted" I have searched for solutions on google, but failed. Thanks in advance. Best regards Kaimi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070704/a780a0b3/attachment-0001.htm From cristian.ionescu-idbohrn at axis.com Wed Jul 4 08:39:25 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Wed, 4 Jul 2007 17:39:25 +0200 (CEST) Subject: whither 1.00's "passwd -p ..." ? In-Reply-To: <20070703132306.GC23671@sovereign.org> References: <20070703132306.GC23671@sovereign.org> Message-ID: <0707041722560.1707@somehost> On Tue, 3 Jul 2007, Jim Freeman wrote: > # passwd -p **** blip Isn't this the well known insecure method that shouldn't be used because (with the right timing) anyone can snap the password with ps or 'cat /proc//cmdline'? -- Cristian From jfree at sovereign.org Wed Jul 4 11:14:32 2007 From: jfree at sovereign.org (Jim Freeman) Date: Wed, 4 Jul 2007 12:14:32 -0600 Subject: whither 1.00's "passwd -p ..." ? In-Reply-To: <1158166a0707040613h47d2c09drbb0c95f420430c3@mail.gmail.com> References: <20070703132306.GC23671@sovereign.org> <1158166a0707040613h47d2c09drbb0c95f420430c3@mail.gmail.com> Message-ID: <20070704181432.GE2424@sovereign.org> On Wed, Jul 04, 2007 at 03:13:38PM +0200, Denis Vlasenko wrote: > On 7/3/07, Jim Freeman wrote: > >busybox 1.00 (and other versions?) had a "-p" option to allow setting > >a user's password bypassing the interactive mode ... > > # passwd -p **** blip > > Setting password for blip > > Password changed. > > I just downloaded and built busybox 1.00. passwd does not have -p option > there. Yeesh - my (very) bad. Looks like this was an in-house change (derivative of "useradd -p"), then re-tar'd with the same name so namewise it was indistinguishable from the upstream. Apologies! (slinks away in search of brown paper bag ...) > I would rather add separate applet for non-interactive password > change. I even have one somewhere on home machine... http://dns.solucorp.qc.ca/linuxconf/changes/changes-1.9r22.html has "-P" for from a pipe: The passwd command supplied with Linuxconf has been enhanced ... passwd -P user_account Change the password from a pipe echo new_passwd | passwd -P user_account or BSD's "pw" looks like it will take it from a pipe: http://lists.freebsd.org/pipermail/freebsd-questions/2007-April/146507.html or, as in my original mail, "ptyget" can be wrestled into doing something useful ... From jfree at sovereign.org Wed Jul 4 11:19:11 2007 From: jfree at sovereign.org (Jim Freeman) Date: Wed, 4 Jul 2007 12:19:11 -0600 Subject: whither 1.00's "passwd -p ..." ? In-Reply-To: <200707032217.10838.farmatito@tiscali.it> References: <20070703132306.GC23671@sovereign.org> <200707032217.10838.farmatito@tiscali.it> Message-ID: <20070704181911.GF2424@sovereign.org> On Tue, Jul 03, 2007 at 10:17:10PM +0200, Tito wrote: > On Tuesday 03 July 2007 15:23:06 Jim Freeman MISTAKENLY wrote: > > busybox 1.00 (and other versions?) had a "-p" option to allow setting > > a user's password bypassing the interactive mode ... > > # passwd -p **** blip > > Setting password for blip > > Password changed. ... > Maybe it was ripped out as it is non standard? > > OPTIONS > The options which apply to the passwd command are: > > -a, --all > This option can be used only with -S and causes show status for all > users. ... You're no doubt correct - I think I'd seen mention of it in ancient SunOS docs. BTW - were you excerpting from SuS? or where? Thanks, ...jfree From vda.linux at googlemail.com Tue Jul 3 10:45:33 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 3 Jul 2007 19:45:33 +0200 Subject: invoked as /bin/md5sum, yields sha1sum In-Reply-To: <20070703125946.GB23671@sovereign.org> References: <20070703125946.GB23671@sovereign.org> Message-ID: <200707031945.33200.vda.linux@googlemail.com> On Tuesday 03 July 2007 14:59, Jim Freeman wrote: > > Busybox 1.6.0, on powerpc: > > When md5sum is invoked as /bin/md5sum, it yields the 40-character sha1sum > instead of the 32-character md5sum: > > # md5sum /etc/passwd > fe611ba27d0d7d92bbef243109fed95d /etc/passwd > > # /bin/md5sum /etc/passwd > 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd > > # sha1sum /etc/passwd > 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd > > Does this happen with any other platforms? I think yes. hash_algo_t hash_algo = ENABLE_MD5SUM ? (ENABLE_SHA1SUM ? (**argv=='m' ? HASH_MD5 : HASH_SHA1) : HASH_MD5) : HASH_SHA1; It should check applet_name[0] instead. Fixing in svn, thanks for the report. -- vda From jfree at sovereign.org Wed Jul 4 11:29:10 2007 From: jfree at sovereign.org (Jim Freeman) Date: Wed, 4 Jul 2007 12:29:10 -0600 Subject: whither "passwd -p ..." ? In-Reply-To: <0707041722560.1707@somehost> References: <20070703132306.GC23671@sovereign.org> <0707041722560.1707@somehost> Message-ID: <20070704182910.GG2424@sovereign.org> On Wed, Jul 04, 2007 at 05:39:25PM +0200, Cristian Ionescu-Idbohrn wrote: > On Tue, 3 Jul 2007, Jim Freeman wrote: > > > # passwd -p **** blip > > Isn't this the well known insecure method that shouldn't be used > because (with the right timing) anyone can snap the password with ps > or 'cat /proc//cmdline'? ... As I acknowledged in parts you trimmed, yes (if "anyone" is taken to mean "someone with shell access"). But in many embedded cases, there is no shell access (ergo, the cgi remote admin mentioned in the original mail). In such cases "anyone" == "noone", and "shouldn't be used" becomes "might be used", and this particular point is then mooted. ...jfree From harald-tuxbox at arcor.de Wed Jul 4 11:58:11 2007 From: harald-tuxbox at arcor.de (=?iso-8859-1?Q?Harald_K=FCthe?=) Date: Wed, 4 Jul 2007 20:58:11 +0200 Subject: [Bug?] init.c: problems if kernel gets console=null via cmdline References: <001101c7bc15$a6f3d040$0ac810ac@houdinineu> <200707012132.32011.vda.linux@googlemail.com> Message-ID: <001301c7be6d$4ea1ae80$0ac810ac@houdinineu> > ----- Original Message ----- > From: "Denis Vlasenko" > To: > Cc: "Harald K?the" > Sent: Sunday, July 01, 2007 9:32 PM > Subject: Re: [Bug?] init.c: problems if kernel gets console=null via cmdline > > On Sunday 01 July 2007 21:25, Harald K?the wrote: > > Hello list, > > > > we have problems with the recent versions of busybox (1.5 and 1.6) when we start our kernel (2.4.34) without console. > > Some programs do not start e.g. samba server. > > When we link init to an older version of busybox thing get working. > > Debugging is difficult because the problem does not exist in a strace/gdb environement. > > It seems to be ok if I hack console_init() that it uses /dev/null as the console. > > > > Any help / direction is appreciated. > > Try this: in init.c, add "else" clause as shown below: > > static void console_init(void) > { > struct serial_struct sr; > char *s; > > s = getenv("CONSOLE"); > if (!s) s = getenv("console"); > if (s) { > int fd = open(s, O_RDWR | O_NONBLOCK | O_NOCTTY); > if (fd >= 0) { > dup2(fd, 0); > dup2(fd, 1); > dup2(fd, 2); > while (fd > 2) close(fd--); > } > messageD(L_LOG, "console='%s'", s); > + } else { > + /* Make sure fd 0,1,2 are not closed */ > + bb_sanitize_stdio(); > } > > If it helps, I will add it in 1.6.2. > -- > vda This works, thank you for your help. I found out that in kernel 2.4.34 the kernel commandline argument "console=" is processed by the kernel itsself and therefore not transferred into the environment. So getenv("CONSOLE"); and getenv("console"); always return null. Linux-2.6.15 look similar Best regards Harald From cristian.ionescu-idbohrn at axis.com Wed Jul 4 12:57:42 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Wed, 4 Jul 2007 21:57:42 +0200 (CEST) Subject: whither "passwd -p ..." ? In-Reply-To: <20070704182910.GG2424@sovereign.org> References: <20070703132306.GC23671@sovereign.org> <0707041722560.1707@somehost> <20070704182910.GG2424@sovereign.org> Message-ID: <0707042153050.8241@somehost> On Wed, 4 Jul 2007, Jim Freeman wrote: > On Wed, Jul 04, 2007 at 05:39:25PM +0200, Cristian Ionescu-Idbohrn wrote: > > On Tue, 3 Jul 2007, Jim Freeman wrote: > > > > > # passwd -p **** blip > > > > Isn't this the well known insecure method that shouldn't be used > > because (with the right timing) anyone can snap the password with ps > > or 'cat /proc//cmdline'? > ... > > As I acknowledged in parts you trimmed, yes (if "anyone" is taken > to mean "someone with shell access"). Yes. Should I appologise for trimming? > But in many embedded cases, there is no shell access (ergo, the > cgi remote admin mentioned in the original mail). Of course. > In such cases "anyone" == "noone", and "shouldn't be used" becomes > "might be used", and this particular point is then mooted. Yes. Still. Any such -p "option" should be marked as "risky" and appear just as an option (i.e. default disabled). -- Cristian From uberlord at gentoo.org Wed Jul 4 13:02:26 2007 From: uberlord at gentoo.org (Roy Marples) Date: Wed, 4 Jul 2007 21:02:26 +0100 Subject: [Bug?] init.c: problems if kernel gets console=null via cmdline In-Reply-To: <001301c7be6d$4ea1ae80$0ac810ac@houdinineu> References: <001101c7bc15$a6f3d040$0ac810ac@houdinineu> <200707012132.32011.vda.linux@googlemail.com> <001301c7be6d$4ea1ae80$0ac810ac@houdinineu> Message-ID: <20070704210226.1edbf7d7@uberlaptop.marples.name> On Wed, 4 Jul 2007 20:58:11 +0200 Harald K?the wrote: > > Try this: in init.c, add "else" clause as shown below: > > > > static void console_init(void) > > { > > struct serial_struct sr; > > char *s; > > > > s = getenv("CONSOLE"); > > if (!s) s = getenv("console"); > > if (s) { > > int fd = open(s, O_RDWR | O_NONBLOCK | O_NOCTTY); > > if (fd >= 0) { > > dup2(fd, 0); > > dup2(fd, 1); > > dup2(fd, 2); > > while (fd > 2) close(fd--); > > } > > messageD(L_LOG, "console='%s'", s); > > + } else { > > + /* Make sure fd 0,1,2 are not closed */ > > + bb_sanitize_stdio(); > > } > > > > If it helps, I will add it in 1.6.2. > > -- > > vda > > This works, thank you for your help. > I found out that in kernel 2.4.34 the kernel commandline argument > "console=" is processed by the kernel itsself and therefore not > transferred into the environment. So getenv("CONSOLE"); and > getenv("console"); always return null. Linux-2.6.15 look similar Why don't you use the ttyname function? That always points to the correct tty used. On Gentoo in sysinit and boot it returns /dev/console and in runlevel 3 (default) it returns /dev/tty1 char *tty = ttyname (fileno (stdout)); if (tty) { ... /* same as above */ } else { /* Make sure fd 0,1,2 are not closed */ bb_sanitize_stdio(); } Thanks Roy From vda.linux at googlemail.com Wed Jul 4 17:17:42 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Jul 2007 02:17:42 +0200 Subject: [Bug?] init.c: problems if kernel gets console=null via cmdline In-Reply-To: <001301c7be6d$4ea1ae80$0ac810ac@houdinineu> References: <001101c7bc15$a6f3d040$0ac810ac@houdinineu> <200707012132.32011.vda.linux@googlemail.com> <001301c7be6d$4ea1ae80$0ac810ac@houdinineu> Message-ID: <200707050217.42527.vda.linux@googlemail.com> On Wednesday 04 July 2007 20:58, Harald K?the wrote: > > Try this: in init.c, add "else" clause as shown below: > > > > static void console_init(void) > > { > > struct serial_struct sr; > > char *s; > > > > s = getenv("CONSOLE"); > > if (!s) s = getenv("console"); > > if (s) { > > int fd = open(s, O_RDWR | O_NONBLOCK | O_NOCTTY); > > if (fd >= 0) { > > dup2(fd, 0); > > dup2(fd, 1); > > dup2(fd, 2); > > while (fd > 2) close(fd--); > > } > > messageD(L_LOG, "console='%s'", s); > > + } else { > > + /* Make sure fd 0,1,2 are not closed */ > > + bb_sanitize_stdio(); > > } > > > > If it helps, I will add it in 1.6.2. > > -- > > vda > > This works, thank you for your help. > I found out that in kernel 2.4.34 the kernel commandline argument > "console=" is processed by the kernel itsself and therefore not > transferred into the environment. > So getenv("CONSOLE"); and getenv("console"); always return null. CONSOLE (uppercase) should still be passed by kernel. Adding this to 1.6.1 fixes. Hmmm... and 1.6.1 announcement is still not on webpage - ?! -- vda From miroslaw.dach at psi.ch Thu Jul 5 00:48:26 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Thu, 5 Jul 2007 09:48:26 +0200 (CEST) Subject: ash ignors somtimes commands In-Reply-To: Message-ID: Dear All, I use busybox based root-file system on my PPC405 processor embedded system. My root file system is mounted via NFS. I have chosen ash as a shell. ash works fine but from time to time it ignores commands which I type. For example in most cases when I type 'ps' I get a complete list of processes. Sometimes 'ps' does not print any thing. It is the same with all other commands. I have written 'all' because I have also my own programs which seem to be not execute (sometimes) when I type their names and press ENTER. Does anybody have an idea why it is so? Best Regards Mirek From alex_x1980 at tut.by Thu Jul 5 05:08:01 2007 From: alex_x1980 at tut.by (Alex Kums) Date: Thu, 05 Jul 2007 15:08:01 +0300 Subject: mdev once more Message-ID: Hi guys. I cann't force mdev to work. My rootfs has a static /dev filesystem, and I want to test how does mdev work. I did as docs/mdev.txt suggests, after logging in with the following script: # cat /mnt/mkdev #!/bin/sh echo "Mounting sysfs" mount -t sysfs sysfs /sys echo "Echoing hotplug" echo /bin/mdev > /proc/sys/kernel/hotplug echo "mdev -s" mdev -s echo "Mounting /dev" mount -t tmpfs mdev /dev echo "Creating /dev/pts" mkdir /dev/pts echo "Mounting pts" mount -t devpts devpts /dev/pts # /mnt/mkdev Mounting sysfs Echoing hotplug mdev -s # this takes few seconds Mounting /dev Creating /dev/pts Mounting pts # ls /sys block class firmware kernel power bus devices fs module # ls /dev/ pts # ls /dev/pts # ----------------------------------------- There are no files in /dev and /dev/pts! Why ? My kernel is 2.6.20, and it of course includes CONFIG_SYSFS, CONFIG_SYSFS_DEPRECATED and CONFIG_HOTPLUG. Maybe I'm missing something ? :) Thanks. ----------------------------------------- Spam from tut.by goes here ==> ------- ????????? ? ??????? ????? ????? - ???: http://tourism.tut.by From vda.linux at googlemail.com Thu Jul 5 05:19:35 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Jul 2007 14:19:35 +0200 Subject: whither 1.00's "passwd -p ..." ? In-Reply-To: <20070704181432.GE2424@sovereign.org> References: <20070703132306.GC23671@sovereign.org> <1158166a0707040613h47d2c09drbb0c95f420430c3@mail.gmail.com> <20070704181432.GE2424@sovereign.org> Message-ID: <200707051419.35270.vda.linux@googlemail.com> On Wednesday 04 July 2007 20:14, Jim Freeman wrote: > On Wed, Jul 04, 2007 at 03:13:38PM +0200, Denis Vlasenko wrote: > > On 7/3/07, Jim Freeman wrote: > > >busybox 1.00 (and other versions?) had a "-p" option to allow setting > > >a user's password bypassing the interactive mode > ... > > > # passwd -p **** blip > > > Setting password for blip > > > Password changed. > > > > I just downloaded and built busybox 1.00. passwd does not have -p option > > there. > > Yeesh - my (very) bad. Looks like this was an in-house change > (derivative of "useradd -p"), then re-tar'd with the same name > so namewise it was indistinguishable from the upstream. > Apologies! (slinks away in search of brown paper bag ...) No problem. If you need it, maybe make a diff of said changes and send to list. You may be not alone with this password change requirement. > http://dns.solucorp.qc.ca/linuxconf/changes/changes-1.9r22.html > has "-P" for from a pipe: > > The passwd command supplied with Linuxconf has been enhanced > ... > passwd -P user_account > Change the password from a pipe > echo new_passwd | passwd -P user_account > > or BSD's "pw" looks like it will take it from a pipe: > http://lists.freebsd.org/pipermail/freebsd-questions/2007-April/146507.html piping password is indeed safe(r) since it is not visible in ps (echo is sheel internal builtin and won't show up in ps either). -- vda From natanael.copa at gmail.com Thu Jul 5 06:43:40 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Thu, 05 Jul 2007 15:43:40 +0200 Subject: mdev once more In-Reply-To: References: Message-ID: <1183643020.5818.18.camel@localhost> On Thu, 2007-07-05 at 15:08 +0300, Alex Kums wrote: > Hi guys. > > I cann't force mdev to work. My rootfs has a static /dev filesystem, and I > want to test how does mdev work. > > I did as docs/mdev.txt suggests, after logging in with the following > script: > > # cat /mnt/mkdev > > #!/bin/sh > > echo "Mounting sysfs" > mount -t sysfs sysfs /sys > echo "Echoing hotplug" > echo /bin/mdev > /proc/sys/kernel/hotplug > echo "mdev -s" > mdev -s > > echo "Mounting /dev" > mount -t tmpfs mdev /dev > echo "Creating /dev/pts" > mkdir /dev/pts > echo "Mounting pts" > mount -t devpts devpts /dev/pts > > # /mnt/mkdev > Mounting sysfs > Echoing hotplug > mdev -s # this takes few seconds > Mounting /dev > Creating /dev/pts > Mounting pts > > # ls /sys > block class firmware kernel power > bus devices fs module > # ls /dev/ > pts > # ls /dev/pts > # > ----------------------------------------- > > There are no files in /dev and /dev/pts! Why ? Because you mount the tmpfs on /dev *after* mdev has created the devices. If you unmount /dev you will find them. Try this: # cat /mnt/mkdev #!/bin/sh echo "Mounting sysfs" mount -t sysfs sysfs /sys echo "Mounting /dev" mount -t tmpfs mdev /dev echo "Creating /dev/pts" mkdir /dev/pts echo "Mounting pts" mount -t devpts devpts /dev/pts echo "Echoing hotplug" echo /bin/mdev > /proc/sys/kernel/hotplug echo "mdev -s" mdev -s > My kernel is 2.6.20, and it > of course includes CONFIG_SYSFS, CONFIG_SYSFS_DEPRECATED and > CONFIG_HOTPLUG. Maybe I'm missing something ? :) > > Thanks. From vda.linux at googlemail.com Thu Jul 5 06:38:49 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Jul 2007 15:38:49 +0200 Subject: ash ignors somtimes commands In-Reply-To: References: Message-ID: <200707051538.49559.vda.linux@googlemail.com> On Thursday 05 July 2007 09:48, Miroslaw Dach wrote: > I use busybox based root-file system on my PPC405 processor > embedded system. My root file system is mounted via NFS. I have chosen ash > as a shell. > > ash works fine but from time to time it ignores commands which I type. > > For example in most cases when I type 'ps' I get a complete list of > processes. Sometimes 'ps' does not print any thing. It is the same with > all other commands. I have written 'all' because I have also my own > programs which seem to be not execute (sometimes) when I type their names > and press ENTER. > > Does anybody have an idea why it is so? Absolutely no idea. It's rather weird. Can you give more details - how often commands do not execute? Every 2nd? Every tenth? Every 1000th? Can you add debugging outputs in ash.c in cmdloop function, like bb_error_msg("I am before parsecmd()"); bb_error_msg("I am after parsecmd()"); bb_error_msg("I am before evaltree()"); etc, and get more info about this weird behavior? static int cmdloop(int top) { union node *n; struct stackmark smark; int inter; int numeof = 0; TRACE(("cmdloop(%d) called\n", top)); for (;;) { int skip; setstackmark(&smark); #if JOBS if (jobctl) showjobs(stderr, SHOW_CHANGED); #endif inter = 0; if (iflag && top) { inter++; #if ENABLE_ASH_MAIL chkmail(); #endif } n = parsecmd(inter); /* showtree(n); DEBUG */ if (n == NEOF) { if (!top || numeof >= 50) break; if (!stoppedjobs()) { if (!Iflag) break; out2str("\nUse \"exit\" to leave shell.\n"); } numeof++; } else if (nflag == 0) { job_warning = (job_warning == 2) ? 1 : 0; numeof = 0; evaltree(n, 0); } popstackmark(&smark); skip = evalskip; if (skip) { evalskip = 0; return skip & SKIPEVAL; } } return 0; } -- vda From pgf at brightstareng.com Thu Jul 5 06:58:05 2007 From: pgf at brightstareng.com (Paul Fox) Date: Thu, 05 Jul 2007 09:58:05 -0400 Subject: whither 1.00's "passwd -p ..." ? In-Reply-To: vda.linux's message of Thu, 05 Jul 2007 14:19:35 +0200. <200707051419.35270.vda.linux@googlemail.com> Message-ID: <29189.1183643885@brightstareng.com> vda wrote: > > piping password is indeed safe(r) since it is not visible in ps > (echo is sheel internal builtin and won't show up in ps either). a while ago we thought we had need of the password-from-stdin feature, and i did manage to get busybox passwd to do it, though i don't recommend it. i include it here for your amusement, or horror, as you wish. this is mail i sent to a colleage at the time: i wrote: > the reason the busybox passwd command doesn't work when the passwords > are on stdin like this: > echo -e 'thistest\nthistest' | passwd root > > is that because stdin isn't line-buffered, the whole string, including > the newline, is consumed in answer to the first "Enter new password:" > prompt, so there's nothing left for the "Re-enter new password:" prompt. > > however, busybox does truncate the response at the newline. so > to get it to work (WARNING! this is REALLY REALLY UGLY), you "simply" > cause the first read() to be exactly satisfied with the first response, > and provide the second response after that. the read() size in > this version of busybox is 255, so this command: > (echo -e > 'xyzzy\njjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj > jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj > jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj > jjjjjjjjjjjjjjjj'; echo xyzzy) | passwd root > > does reset the password. (that's enough 'j's to make the > first echo produce exactly 255 characters.) > > the latest busybox has unchanged behavior, except the the buffer > is shorter -- only 63 characters total. so (unsurprisingly) a > script based on this technique would not survive a busybox > upgrade. in the end, we decided we didn't need the feature, so i'm afraid i have no patch to offer, in compensation for making you read the above atrocious solution. :-) paul =--------------------- paul fox, pgf at brightstareng.com From pgf at brightstareng.com Thu Jul 5 06:59:59 2007 From: pgf at brightstareng.com (Paul Fox) Date: Thu, 05 Jul 2007 09:59:59 -0400 Subject: ash ignors somtimes commands In-Reply-To: vda.linux's message of Thu, 05 Jul 2007 15:38:49 +0200. <200707051538.49559.vda.linux@googlemail.com> Message-ID: <29271.1183643999@brightstareng.com> > On Thursday 05 July 2007 09:48, Miroslaw Dach wrote: > > I use busybox based root-file system on my PPC405 processor > > embedded system. My root file system is mounted via NFS. I have chosen ash > > as a shell. > > > > ash works fine but from time to time it ignores commands which I type. > > > > For example in most cases when I type 'ps' I get a complete list of > > processes. Sometimes 'ps' does not print any thing. It is the same with > > all other commands. I have written 'all' because I have also my own > > programs which seem to be not execute (sometimes) when I type their names > > and press ENTER. > > > > Does anybody have an idea why it is so? > > Absolutely no idea. It's rather weird. > > Can you give more details - how often commands do not execute? > Every 2nd? Every tenth? Every 1000th? it sounds to me as if there's another command running in the background which is consuming input typed at the console. whether ash or the background command gets the line of text is a race condition. paul =--------------------- paul fox, pgf at brightstareng.com From sbb at tuxfamily.org Thu Jul 5 08:24:41 2007 From: sbb at tuxfamily.org (Seb) Date: Thu, 5 Jul 2007 17:24:41 +0200 Subject: .bashrc and ash In-Reply-To: References: <468A32B0.1000503@Kriegisch.name> Message-ID: <20070705172441.dbf9d41d.sbb@tuxfamily.org> Le Tue, 3 Jul 2007 13:31:37 +0200 (CEST) Miroslaw Dach a ?crit: > Thanks it does work fine now. > > Best Regards > > Mirek > > On Tue, 3 Jul 2007, Alexander Kriegisch wrote: > > > > I am using ash as a shall in my busybox rootfile system. > > > I wanted to set some environmental variables in .bashrc but it is not > > > taken into account when logging with telnet. > > > > As the name suggests, .bashrc belongs to bash, not ash. You want to try > > .profile in your home directory. > > -- > > Alexander Kriegisch > > Hello, If your .bashrc is Ash-shell compliant, you can also run ash with 'ENV=$HOME/.bashrc' as environment variable. ++ Seb. From sbb at tuxfamily.org Thu Jul 5 08:33:22 2007 From: sbb at tuxfamily.org (Seb) Date: Thu, 5 Jul 2007 17:33:22 +0200 Subject: Probably a bug in ash In-Reply-To: <20070628163439.50345aac.sbb@tuxfamily.org> References: <20070628163439.50345aac.sbb@tuxfamily.org> Message-ID: <20070705173322.dffa33b1.sbb@tuxfamily.org> Hello, Sorry to insist, but as I don't see any reaction to my precedent mail, I'd just want to know if it wasn't well delivered on the list or if it's just an (uninteresting|desperated) case so that there is nothing to say. :) Le Thu, 28 Jun 2007 16:34:39 +0200 Seb a ?crit: > Hello, > > It seems that there is a bug in the 'jobs' built-in command of ash. As > a matter of fact, its output cannot be captured nor piped. > > I made a little script (in attachment) which shows the case. If you > execute it with ash, you should see that 'test3' doesn't return > anything but a new line, while 'test4' indicates that the output is well > directed to stdout (so, according to the rules of shell, the pipe > should work). > > [...] ++ Seb. From jfree at sovereign.org Thu Jul 5 09:38:19 2007 From: jfree at sovereign.org (Jim Freeman) Date: Thu, 5 Jul 2007 10:38:19 -0600 Subject: bash vs. ash, [ ! a = b ] vs. [ a != b ] Message-ID: <20070705163818.GI2424@sovereign.org> powerpc, busybox 1.6.0 There is a discrepency (== error?) in ash's handling of the following: ash === # [ ! a = b ] # echo $? 1 # [ a != b ] # echo $? 0 bash ==== $ [ ! a = b ] $ echo $? 0 $ [ a != b ] $ echo $? 0 This is breaking scripts that have worked previously. If I'm doing something stupid, let me know - I can take it (I'm used to it ...) thanks, ...jfree From psmith at netezza.com Thu Jul 5 09:51:24 2007 From: psmith at netezza.com (Paul Smith) Date: Thu, 05 Jul 2007 12:51:24 -0400 Subject: bash vs. ash, [ ! a = b ] vs. [ a != b ] In-Reply-To: <20070705163818.GI2424@sovereign.org> References: <20070705163818.GI2424@sovereign.org> Message-ID: <1183654284.3119.94.camel@psmithub> On Thu, 2007-07-05 at 10:38 -0600, Jim Freeman wrote: > There is a discrepency (== error?) in ash's handling of the following: > # [ ! a = b ] > # echo $? > 1 According to the POSIX standard, this form is valid and ash's answer is wrong. > If I'm doing something stupid, let me know - I can take it (I'm > used to it ...) This should be fixed in ash, because it's a bug... but I wonder why you just don't use the much more common (and hence more likely to work properly) "[ a != b ]"? -- ----------------------------------------------------------------------------- Paul D. Smith http://netezza.com "Please remain calm--I may be mad, but I am a professional."--Mad Scientist ----------------------------------------------------------------------------- These are my opinions--Netezza takes no responsibility for them. From jfree at sovereign.org Thu Jul 5 09:55:27 2007 From: jfree at sovereign.org (Jim Freeman) Date: Thu, 5 Jul 2007 10:55:27 -0600 Subject: bash vs. ash, [ ! a = b ] vs. [ a != b ] In-Reply-To: <20070705163818.GI2424@sovereign.org> References: <20070705163818.GI2424@sovereign.org> Message-ID: <20070705165527.GJ2424@sovereign.org> On Thu, Jul 05, 2007 at 10:38:19AM -0600, Jim Freeman wrote: > powerpc, busybox 1.6.0 > > There is a discrepency (== error?) in ash's handling of the following: > > ash > === > # [ ! a = b ] > # echo $? > 1 More info: Regressing against i386 BusyBox v1.1.3 (Debian 1:1.1.3-4) : $ busybox [ ! a = b ] $ echo $? 0 ...jfree From wharms at bfs.de Thu Jul 5 09:55:32 2007 From: wharms at bfs.de (walter harms) Date: Thu, 05 Jul 2007 18:55:32 +0200 Subject: Probably a bug in ash In-Reply-To: <20070705173322.dffa33b1.sbb@tuxfamily.org> References: <20070628163439.50345aac.sbb@tuxfamily.org> <20070705173322.dffa33b1.sbb@tuxfamily.org> Message-ID: <468D2284.9070707@bfs.de> Hi seb, yes the mail was received but noone had time sofar to investigate the problem re, wh Seb wrote: > Hello, > > Sorry to insist, but as I don't see any reaction to my precedent mail, > I'd just want to know if it wasn't well delivered on the list or > if it's just an (uninteresting|desperated) case so that there is nothing > to say. :) > > Le Thu, 28 Jun 2007 16:34:39 +0200 > Seb a ?crit: > >> Hello, >> >> It seems that there is a bug in the 'jobs' built-in command of ash. As >> a matter of fact, its output cannot be captured nor piped. >> >> I made a little script (in attachment) which shows the case. If you >> execute it with ash, you should see that 'test3' doesn't return >> anything but a new line, while 'test4' indicates that the output is well >> directed to stdout (so, according to the rules of shell, the pipe >> should work). >> >> [...] > > ++ > Seb. > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From jfree at sovereign.org Thu Jul 5 10:18:12 2007 From: jfree at sovereign.org (Jim Freeman) Date: Thu, 5 Jul 2007 11:18:12 -0600 Subject: bash vs. ash, [ ! a = b ] vs. [ a != b ] In-Reply-To: <1183654284.3119.94.camel@psmithub> References: <20070705163818.GI2424@sovereign.org> <1183654284.3119.94.camel@psmithub> Message-ID: <20070705171812.GK2424@sovereign.org> On Thu, Jul 05, 2007 at 12:51:24PM -0400, Paul Smith wrote: > On Thu, 2007-07-05 at 10:38 -0600, Jim Freeman wrote: > > > There is a discrepency (== error?) in ash's handling of the following: > > > # [ ! a = b ] > > # echo $? > > 1 > > According to the POSIX standard, this form is valid and ash's answer is > wrong. > > > If I'm doing something stupid, let me know - I can take it (I'm > > used to it ...) > > This should be fixed in ash, because it's a bug... but I wonder why you > just don't use the much more common (and hence more likely to work > properly) "[ a != b ]"? Lots of legacy + 3d party code that should just work, and aren't mine to change ... From pgf at brightstareng.com Thu Jul 5 10:18:32 2007 From: pgf at brightstareng.com (Paul Fox) Date: Thu, 05 Jul 2007 13:18:32 -0400 Subject: Probably a bug in ash In-Reply-To: wharms's message of Thu, 05 Jul 2007 18:55:32 +0200. <468D2284.9070707@bfs.de> Message-ID: <7931.1183655912@brightstareng.com> wh wrote: > Hi seb, > yes the mail was received but noone had time sofar to > investigate the problem further info: whoever takes a look at this; the problem is even worse than originally described. piping the output of "jobs" loses the output entirely, while piping the output of "jobs %1" causes an erroneous error message. BusyBox v1.7.0.svn (2007-07-05 13:13:46 EDT) built-in shell (ash) Enter 'help' for a list of built-in commands. $ sleep 3600 & $ sleep 700 (typed ^Z here) [2] + Stopped sleep 700 $ jobs [2] + Stopped sleep 700 [1] - Running sleep 3600 (two jobs) $ jobs | cat $ jobs | tr a-z A-Z (note missing output) $ jobs [2] + Stopped sleep 700 [1] - Running sleep 3600 (still two jobs) $ jobs %1 [1] - Running sleep 3600 (good) $ jobs %2 [2] + Stopped sleep 700 (also good) $ jobs %1 | cat ash: jobs: No such job: %1 (bad error message) $ jobs %2 | cat ash: jobs: No such job: %2 (bad error message) $ jobs [2] + Stopped sleep 700 [1] - Running sleep 3600 (still two jobs) paul > > > Seb wrote: > > Hello, > > = > > > Sorry to insist, but as I don't see any reaction to my precedent mail, > > I'd just want to know if it wasn't well delivered on the list or > > if it's just an (uninteresting|desperated) case so that there is nothing > > to say. :) > > = > > > Le Thu, 28 Jun 2007 16:34:39 +0200 > > Seb a =E9crit: > > = > > >> Hello, > >> > >> It seems that there is a bug in the 'jobs' built-in command of ash. As > >> a matter of fact, its output cannot be captured nor piped. > >> > >> I made a little script (in attachment) which shows the case. If you > >> execute it with ash, you should see that 'test3' doesn't return > >> anything but a new line, while 'test4' indicates that the output is well > >> directed to stdout (so, according to the rules of shell, the pipe > >> should work). > >> > >> [...] > > = > > > ++ > > Seb. > > _______________________________________________ > > busybox mailing list > > busybox at busybox.net > > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > = > > > = > > > = > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox =--------------------- paul fox, pgf at brightstareng.com From vapier at gentoo.org Thu Jul 5 10:54:50 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Thu, 5 Jul 2007 13:54:50 -0400 Subject: Aw: Re: mdev woes In-Reply-To: <1183387988.30435.12.camel@localhost> References: <13080109.1183047315105.JavaMail.ngmail@webmail15> <200706281540.35506.vapier@gentoo.org> <1183387988.30435.12.camel@localhost> Message-ID: <200707051354.51832.vapier@gentoo.org> On Monday 02 July 2007, Natanael Copa wrote: > On Thu, 2007-06-28 at 15:40 -0400, Mike Frysinger wrote: > > On Thursday 28 June 2007, Jason Curl wrote: > > > mdev > > > already knows about the device, so a symlink option like udev has would > > > save flash space overall (less scripts, faster and as an option in the > > > menuconfig would mean only those who want it would use it). > > > > there is a patch on the mailing list to add this ... i'm debating adding > > it as the purpose of mdev is to provide the bare min required features; > > if you need more, go use udev > > I vote for this feature. I use a script to create links where I want > them but its hackish and ugly. which symlinks are you looking at though ? can you post all the examples you need ? -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/20070705/109be9ea/attachment.pgp From vapier at gentoo.org Thu Jul 5 10:56:29 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Thu, 5 Jul 2007 13:56:29 -0400 Subject: provide reasonable config values... In-Reply-To: <200707012031.59033.vda.linux@googlemail.com> References: <0707012016250.21467@somehost> <200707012031.59033.vda.linux@googlemail.com> Message-ID: <200707051356.30578.vapier@gentoo.org> On Sunday 01 July 2007, Denis Vlasenko wrote: > On Sunday 01 July 2007 20:18, Cristian Ionescu-Idbohrn wrote: > > ...to skip warnings: > > > > .config:75:warning: symbol value '' invalid for FEATURE_EDITING_MAX_LEN > > .config:78:warning: symbol value '' invalid for FEATURE_EDITING_HISTORY > > .config:300:warning: symbol value '' invalid for FEATURE_VI_MAX_LEN > > .config:498:warning: symbol value '' invalid for FEATURE_LESS_MAXLINES > > I don't know how to do it. have we tried asking for tips on the kconfig mailing list ? -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/20070705/45cbb38c/attachment.pgp From Jlau at extremenetworks.com Thu Jul 5 17:33:21 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Thu, 5 Jul 2007 17:33:21 -0700 Subject: mount -o rw,remount /dev/hda2 /boot crashed on BB 1.6.0 Message-ID: <888459D4AEE6464381B30398101F42F8043FC300@sc-msexch-06.extremenetworks.com> On BB 1.6.0, the mount command crashed when the device provided on remount. / # mount -o rw,remount /dev/hda2 /boot ***** Process mount pid: 817 died with signal:11 Segmentation fault (core dumped) It works fine if the device parameter (/dev/hda2) is not given. But "mount -o rw,remount /dev/hda2 /boot" works with BB 1.0 mount command. Any clue? Thanks. -Joe From ddaney at avtrex.com Thu Jul 5 17:42:02 2007 From: ddaney at avtrex.com (David Daney) Date: Thu, 05 Jul 2007 17:42:02 -0700 Subject: mount -o rw,remount /dev/hda2 /boot crashed on BB 1.6.0 In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC300@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC300@sc-msexch-06.extremenetworks.com> Message-ID: <468D8FDA.1060900@avtrex.com> Joe Lau wrote: > On BB 1.6.0, the mount command crashed when the device provided on remount. > > / # mount -o rw,remount /dev/hda2 /boot > ***** Process mount pid: 817 died with signal:11 > Segmentation fault (core dumped) > > It works fine if the device parameter (/dev/hda2) is not given. > > But "mount -o rw,remount /dev/hda2 /boot" works with BB 1.0 mount command. > > Any clue? > How about using gdb to examine the core file? David Daney From Jlau at extremenetworks.com Thu Jul 5 17:46:16 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Thu, 5 Jul 2007 17:46:16 -0700 Subject: mount -o rw,remount /dev/hda2 /boot crashed on BB 1.6.0 Message-ID: <888459D4AEE6464381B30398101F42F8043FC301@sc-msexch-06.extremenetworks.com> I couldn't get the core file on my switch. I am currently having problem on core dump on my switch. Can you try duplicate the problem on your machine? Thanks. -Joe -----Original Message----- From: David Daney [mailto:ddaney at avtrex.com] Sent: Thursday, July 05, 2007 5:42 PM To: Joe Lau Cc: 'busybox at busybox.net' Subject: Re: mount -o rw,remount /dev/hda2 /boot crashed on BB 1.6.0 Joe Lau wrote: > On BB 1.6.0, the mount command crashed when the device provided on remount. > > / # mount -o rw,remount /dev/hda2 /boot > ***** Process mount pid: 817 died with signal:11 > Segmentation fault (core dumped) > > It works fine if the device parameter (/dev/hda2) is not given. > > But "mount -o rw,remount /dev/hda2 /boot" works with BB 1.0 mount command. > > Any clue? > How about using gdb to examine the core file? David Daney From ddaney at avtrex.com Thu Jul 5 17:50:06 2007 From: ddaney at avtrex.com (David Daney) Date: Thu, 05 Jul 2007 17:50:06 -0700 Subject: mount -o rw,remount /dev/hda2 /boot crashed on BB 1.6.0 In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC301@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC301@sc-msexch-06.extremenetworks.com> Message-ID: <468D91BE.50202@avtrex.com> Joe Lau wrote: > Can you try duplicate the problem on your machine? > Thanks. No. I already have enough do to. You are probably going to have to figure out how to debug code on your target device if you want to make much progress. David Daney From Jlau at extremenetworks.com Thu Jul 5 18:58:32 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Thu, 5 Jul 2007 18:58:32 -0700 Subject: tftp -p -b caused tftp to timeout. Message-ID: <888459D4AEE6464381B30398101F42F8043FC302@sc-msexch-06.extremenetworks.com> On BB 1.6.0, tftp PUT hangs when a non-512 blocksize option is given: # tftp 10.203.133.6 -v0 -b1024 -p -rjunk -l/scratch/intern/core.gzip.669.s-1.gz tftp: timeout tftp: timeout tftp: timeout tftp: timeout tftp: timeout tftp: timeout tftp: timeout <--- Control-C out it. It works only with -b512 or no -b option is given. -Joe From simon_laoc at yahoo.com Thu Jul 5 20:26:12 2007 From: simon_laoc at yahoo.com (simon lao) Date: Thu, 5 Jul 2007 20:26:12 -0700 (PDT) Subject: warning: unnamed struct/union that defines no instances Message-ID: <763058.82790.qm@web30201.mail.mud.yahoo.com> Hi, I'm using mips_lexra_fp_be-gcc version 2.95.3 for cross compiling but it has following warning: 1. unrecongnized option '-static-libcc' 2. unnamed struct/union that defines no instances would anyone can help me to resolve the second issue ? For the first issue, I think I can remove the option for my case. Simon ____________________________________________________________________________________ Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games. http://videogames.yahoo.com/platform?platform=120121 From ynakam at hitachisoft.jp Thu Jul 5 21:09:09 2007 From: ynakam at hitachisoft.jp (Yuichi Nakamura) Date: Fri, 06 Jul 2007 13:09:09 +0900 Subject: [patch][Bug] sed can not be used because of wrong applet.h Message-ID: <20070706120954.DED5.YNAKAM@hitachisoft.jp> Hi. I found sed can not be used when built with SELinux support. I saw applet.h and found wrong point. Here is a fix. Index: include/applets.h =================================================================== --- include/applets.h (revision 19006) +++ include/applets.h (working copy) @@ -281,8 +281,8 @@ USE_RUNSV(APPLET(runsv, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) USE_RUNSVDIR(APPLET(runsvdir, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) USE_RX(APPLET(rx, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_SED(APPLET(sed, _BB_DIR_BIN, _BB_SUID_NEVER)) USE_SELINUXENABLED(APPLET(selinuxenabled, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) -USE_SED(APPLET(sed, _BB_DIR_BIN, _BB_SUID_NEVER)) USE_SEQ(APPLET_NOFORK(seq, seq, _BB_DIR_USR_BIN, _BB_SUID_NEVER, seq)) USE_SETARCH(APPLET(setarch, _BB_DIR_BIN, _BB_SUID_NEVER)) USE_SETCONSOLE(APPLET(setconsole, _BB_DIR_SBIN, _BB_SUID_NEVER)) Regards, Yuichi Nakamura From vapier at gentoo.org Thu Jul 5 21:14:56 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Fri, 6 Jul 2007 00:14:56 -0400 Subject: warning: unnamed struct/union that defines no instances In-Reply-To: <763058.82790.qm@web30201.mail.mud.yahoo.com> References: <763058.82790.qm@web30201.mail.mud.yahoo.com> Message-ID: <200707060014.57607.vapier@gentoo.org> On Thursday 05 July 2007, simon lao wrote: > I'm using mips_lexra_fp_be-gcc version 2.95.3 for > cross compiling but it has following warning: upgrade your toolchain -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/20070706/de644c11/attachment.pgp From simon_laoc at yahoo.com Thu Jul 5 22:42:02 2007 From: simon_laoc at yahoo.com (simon lao) Date: Thu, 5 Jul 2007 22:42:02 -0700 (PDT) Subject: macro used without args Message-ID: <387452.44065.qm@web30214.mail.mud.yahoo.com> Hi, when I compile the busybox and had error message: macro 'xstrtou' used without args. I used cross compiler GCC 2.95. Do I need to update the toolchain ? thanks, Simon ____________________________________________________________________________________ It's here! Your new message! Get new email alerts with the free Yahoo! Toolbar. http://tools.search.yahoo.com/toolbar/features/mail/ From miroslaw.dach at psi.ch Fri Jul 6 03:45:35 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Fri, 6 Jul 2007 12:45:35 +0200 (CEST) Subject: ash ignors somtimes commands In-Reply-To: <200707051538.49559.vda.linux@googlemail.com> Message-ID: Hi All, My observation is that the symptom I described before happens let say once per 200 times. Maybe it is somehow related to the terminal under windows which I currently use. Best Regards Mirek On Thu, 5 Jul 2007, Denis Vlasenko wrote: > On Thursday 05 July 2007 09:48, Miroslaw Dach wrote: > > I use busybox based root-file system on my PPC405 processor > > embedded system. My root file system is mounted via NFS. I have chosen ash > > as a shell. > > > > ash works fine but from time to time it ignores commands which I type. > > > > For example in most cases when I type 'ps' I get a complete list of > > processes. Sometimes 'ps' does not print any thing. It is the same with > > all other commands. I have written 'all' because I have also my own > > programs which seem to be not execute (sometimes) when I type their names > > and press ENTER. > > > > Does anybody have an idea why it is so? > > Absolutely no idea. It's rather weird. > > Can you give more details - how often commands do not execute? > Every 2nd? Every tenth? Every 1000th? > > Can you add debugging outputs in ash.c in cmdloop function, like > bb_error_msg("I am before parsecmd()"); bb_error_msg("I am after parsecmd()"); > bb_error_msg("I am before evaltree()"); etc, and get more info about > this weird behavior? > > static int > cmdloop(int top) > { > union node *n; > struct stackmark smark; > int inter; > int numeof = 0; > > TRACE(("cmdloop(%d) called\n", top)); > for (;;) { > int skip; > > setstackmark(&smark); > #if JOBS > if (jobctl) > showjobs(stderr, SHOW_CHANGED); > #endif > inter = 0; > if (iflag && top) { > inter++; > #if ENABLE_ASH_MAIL > chkmail(); > #endif > } > n = parsecmd(inter); > /* showtree(n); DEBUG */ > if (n == NEOF) { > if (!top || numeof >= 50) > break; > if (!stoppedjobs()) { > if (!Iflag) > break; > out2str("\nUse \"exit\" to leave shell.\n"); > } > numeof++; > } else if (nflag == 0) { > job_warning = (job_warning == 2) ? 1 : 0; > numeof = 0; > evaltree(n, 0); > } > popstackmark(&smark); > skip = evalskip; > > if (skip) { > evalskip = 0; > return skip & SKIPEVAL; > } > } > return 0; > } > > -- > vda > -- ============================================================================= Miroslaw Dach (Miroslaw.Dach at psi.ch) - SLS/Controls Group PSI - Paul Scherrer Institut CH-5232 Villigen ============================================================================= From miroslaw.dach at psi.ch Fri Jul 6 05:14:09 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Fri, 6 Jul 2007 14:14:09 +0200 (CEST) Subject: How to change the Timezone In-Reply-To: Message-ID: Dear All, I sue successfully busybox RootFile system. Since busybox does not have ntpd daemon I have compiled one: openntpd-3.9p1. The daemon works fine but I have no clue how to change the time zone. I have set the variable TZ=CEST . The only change what I see is that now when I type date I see CEST instead of UTC but the time remained as it was before. Does somebody have some idea? Best Regards Mirek From alberto.donato at gmail.com Fri Jul 6 05:20:13 2007 From: alberto.donato at gmail.com (Alberto Donato) Date: Fri, 6 Jul 2007 14:20:13 +0200 Subject: How to change the Timezone In-Reply-To: References: Message-ID: <9709bd390707060520h31c9be6epcee5c13b4b7526dc@mail.gmail.com> Hi, to have system-wide timezone configuration you need zoneinfo files from libc. They are usually installed under /usr/share/zoneinfo. You can create a link in /etc/timezone to the correct file under this tree. Alberto On 7/6/07, Miroslaw Dach wrote: > Dear All, > > I sue successfully busybox RootFile system. Since busybox does not > have ntpd daemon I have compiled one: openntpd-3.9p1. > > The daemon works fine but I have no clue how to change the time zone. > I have set the variable TZ=CEST . > > The only change what I see is that now when I type date I see CEST instead > of UTC but the time remained as it was before. > > Does somebody have some idea? > > Best Regards > > Mirek > > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > From miroslaw.dach at psi.ch Fri Jul 6 07:00:22 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Fri, 6 Jul 2007 16:00:22 +0200 (CEST) Subject: busybox and shared library Message-ID: Dear All, I am using for same time busybox. In the lib directory I have big number of libraries and I wanted to narrow them to the necessary set. I have launched the command below to determine the shared libraries the busy box depend on: powerpc-405-linux-gnu-readelf -a bin/busybox | grep -i "shared" 0x00000001 (NEEDED) Shared library: [libcrypt.so.1] 0x00000001 (NEEDED) Shared library: [libm.so.6] 0x00000001 (NEEDED) Shared library: [libc.so.6] I have placed in /lib all of that libraries but it seems to be that something is still missing. My lib directory looks like that: -rwxr-xr-x 1 root root 1576651 Jul 6 15:27 libc-2.3.2.so -rwxr-xr-x 1 root root 29422 Jul 6 15:32 libcrypt-2.3.2.so lrwxrwxrwx 1 root root 13 Jul 6 15:32 libcrypt.so -> libcrypt.so.1 lrwxrwxrwx 1 root root 17 Jul 6 15:32 libcrypt.so.1 -> libcrypt-2.3.2.so -rw-r--r-- 1 root root 193 Jul 6 15:28 libc.so lrwxrwxrwx 1 root root 13 Jul 6 15:28 libc.so.6 -> libc-2.3.2.so lrwxrwxrwx 1 root root 13 Jul 6 15:49 libgcc_s.so -> libgcc_s.so.1 -rw-r--r-- 1 root root 338539 Jul 6 15:48 libgcc_s.so.1 -rwxr-xr-x 1 root root 925590 Jul 6 15:30 libm-2.3.2.so lrwxrwxrwx 1 root root 9 Jul 6 15:31 libm.so -> libm.so.6 lrwxrwxrwx 1 root root 13 Jul 6 15:30 libm.so.6 -> libm-2.3.2.so Does somebody have an idea what is missing. Best Regards Mirek From Alexander at Kriegisch.name Fri Jul 6 07:14:14 2007 From: Alexander at Kriegisch.name (Alexander Kriegisch) Date: Fri, 06 Jul 2007 16:14:14 +0200 Subject: Telnetd autologin feature Message-ID: <468E4E36.40500@Kriegisch.name> Telnetd does not seem to support autologin. I know the client does, but not the server. Was this done intentionally to save space or is there another reason why it is not supported? Maybe the developers could consider if implementing this as an optional feature might make sense. Regards -- Alexander Kriegisch From bernd at firmix.at Fri Jul 6 07:07:40 2007 From: bernd at firmix.at (Bernd Petrovitsch) Date: Fri, 06 Jul 2007 16:07:40 +0200 Subject: busybox and shared library In-Reply-To: References: Message-ID: <1183730860.22634.66.camel@tara.firmix.at> An embedded and charset-unspecified text was scrubbed... Name: not available Url: http://busybox.net/lists/busybox/attachments/20070706/c2e1d1bb/attachment.diff From miroslaw.dach at psi.ch Fri Jul 6 07:16:52 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Fri, 6 Jul 2007 16:16:52 +0200 (CEST) Subject: busybox and shared library In-Reply-To: <1183730860.22634.66.camel@tara.firmix.at> Message-ID: I have determined that ld-2.3.2.so and the link ld.so.1 was missing. Now is all back to normal. Best Regards Mirek On Fri, 6 Jul 2007, Bernd Petrovitsch wrote: > On Fri, 2007-07-06 at 16:00 +0200, Miroslaw Dach wrote: > [...] > > I am using for same time busybox. In the lib directory I have big > > number of libraries and I wanted to narrow them to the necessary set. > > > > I have launched the command below to determine the shared libraries the > > busy box depend on: > > powerpc-405-linux-gnu-readelf -a bin/busybox | grep -i "shared" > > > > 0x00000001 (NEEDED) Shared library: [libcrypt.so.1] > > 0x00000001 (NEEDED) Shared library: [libm.so.6] > > 0x00000001 (NEEDED) Shared library: [libc.so.6] > > > > I have placed in /lib all of that libraries but it seems to be that > > something is still missing. > > Use "powerpc-405-linux-gnu-ldd", not the above command. > If you don't have one, copy the "ldd" script and patch it. > > Bernd > -- ============================================================================= Miroslaw Dach (Miroslaw.Dach at psi.ch) - SLS/Controls Group PSI - Paul Scherrer Institut CH-5232 Villigen ============================================================================= From peter.korsgaard at barco.com Fri Jul 6 07:21:54 2007 From: peter.korsgaard at barco.com (Peter Korsgaard) Date: Fri, 06 Jul 2007 16:21:54 +0200 Subject: Telnetd autologin feature In-Reply-To: <468E4E36.40500@Kriegisch.name> (Alexander Kriegisch's message of "Fri, 06 Jul 2007 16:14:14 +0200") References: <468E4E36.40500@Kriegisch.name> Message-ID: <877ipdtxx9.fsf@sleipner.barco.com> >>>>> "AK" == Alexander Kriegisch writes: Hi, AK> Telnetd does not seem to support autologin. I know the client does, but AK> not the server. Was this done intentionally to save space or is there AK> another reason why it is not supported? Maybe the developers could AK> consider if implementing this as an optional feature might make sense. Autologin? Why don't you just let telnetd execute sh directly instead of login? -- Bye, Peter Korsgaard From Alexander at Kriegisch.name Fri Jul 6 07:49:19 2007 From: Alexander at Kriegisch.name (Alexander Kriegisch) Date: Fri, 06 Jul 2007 16:49:19 +0200 Subject: Telnetd autologin feature In-Reply-To: <877ipdtxx9.fsf@sleipner.barco.com> References: <468E4E36.40500@Kriegisch.name> <877ipdtxx9.fsf@sleipner.barco.com> Message-ID: <468E566F.8010507@Kriegisch.name> (sorry, I sent this to Peter only instead of to the list.) Because I want a minimum of security, even in telnet. Let us not get philosophic about whether it makes sense to use unencrypted passwords, but they are still better than nothing. -- Alexander Kriegisch Peter Korsgaard wrote: >>>>>> "AK" == Alexander Kriegisch writes: > AK> Telnetd does not seem to support autologin. I know the client does, but > AK> not the server. Was this done intentionally to save space or is there > AK> another reason why it is not supported? Maybe the developers could > AK> consider if implementing this as an optional feature might make sense. > > Autologin? Why don't you just let telnetd execute sh directly instead > of login? From sbb at tuxfamily.org Fri Jul 6 08:10:28 2007 From: sbb at tuxfamily.org (Seb) Date: Fri, 6 Jul 2007 17:10:28 +0200 Subject: Probably a bug in ash In-Reply-To: <7931.1183655912@brightstareng.com> References: <468D2284.9070707@bfs.de> <7931.1183655912@brightstareng.com> Message-ID: <20070706171028.22f53b94.sbb@tuxfamily.org> Le Thu, 05 Jul 2007 13:18:32 -0400 Paul Fox a ?crit: > wh wrote: > > Hi seb, > > yes the mail was received but noone had time sofar to > > investigate the problem > > further info: > whoever takes a look at this; the problem is even worse than > originally described. piping the output of "jobs" loses the > output entirely, while piping the output of "jobs %1" causes an > erroneous error message. > > BusyBox v1.7.0.svn (2007-07-05 13:13:46 EDT) built-in shell (ash) > Enter 'help' for a list of built-in commands. > > $ sleep 3600 & > $ sleep 700 > (typed ^Z here) > [2] + Stopped sleep 700 > $ jobs > [2] + Stopped sleep 700 > [1] - Running sleep 3600 > (two jobs) > $ jobs | cat > $ jobs | tr a-z A-Z > (note missing output) > $ jobs > [2] + Stopped sleep 700 > [1] - Running sleep 3600 > (still two jobs) > $ jobs %1 > [1] - Running sleep 3600 > (good) > $ jobs %2 > [2] + Stopped sleep 700 > (also good) > $ jobs %1 | cat > ash: jobs: No such job: %1 > (bad error message) > $ jobs %2 | cat > ash: jobs: No such job: %2 > (bad error message) > $ jobs > [2] + Stopped sleep 700 > [1] - Running sleep 3600 > (still two jobs) > > > paul > Ok, I just wanted to be sure. Thanks for the confirmation and the additionnal informations. :) Do you think I should also make a parallel bug report to dash ? (it's not to put you under pressure -- I well see you have many other things to fix here and this bug can wait -- but just to try to be more "useful" without bothering you nor being unpolite). ++ Seb. From genepi at sympatico.ca Fri Jul 6 08:15:04 2007 From: genepi at sympatico.ca (Pierre =?iso-8859-1?q?M=E9tras?=) Date: Fri, 06 Jul 2007 11:15:04 -0400 Subject: [PATCH] - Adds support for custom error pages in httpd Message-ID: <200707061115.04819.genepi@sympatico.ca> Package: busybox Version: svn revision 18994 Severity: wishlist Hello list, Here is a patch to add support for user defined error pages in httpd server. The syntax of httpd.conf file has been extended to let the user defined custom error pages. Lines of the format: ????????Ennn:path/error_nnn.html mean that for HTTP status nnn, the server will respond with the page path/error_nnn.html. Absolute and relative to `home_httpd` paths are supported, but error pages can't be CGI or scripts (too big a change to httpd.c to add this feature). Also, error pages definitions are only supported in the root config file. For instance, adding the following line ????????E404:e404.html to /etc/httpd.conf file displays the custom page /e404.html whenever a page is not found, instead of the terse message "404 Not Found". I have a linux router running X-wrt (www.x-wrt.org), so using httpd busybox. I have configured it to block ad servers with a procedure similar to the ones described here: http://www.debian-administration.org/articles/535. With this patch of httpd, I could replace all the ads in a web page by a custom page or a small image, instead of getting a "404 Not Found" text. $ make bloatcheck ... function ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? old ? ? new ? delta parse_conf ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?1201 ? ?1436 ? ?+235 sendHeaders ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?461 ? ? 571 ? ?+110 sendFile ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 252 ? ? 317 ? ? +65 httpResponseNames ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?108 ? ? 144 ? ? +36 handleIncoming ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?2032 ? ?2038 ? ? ?+6 .rodata ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 138727 ?138663 ? ? -64 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/1 up/down: 452/-64) ? ? ? ? ? Total: 388 bytes ? ?text ? ?data ? ? bss ? ? dec ? ? hex filename ?636180 ? ?3124 ? 12800 ?652104 ? 9f348 busybox_old ?636589 ? ?3288 ? 12800 ?652677 ? 9f585 busybox_unstripped I have tested it in limited situations, so if others can test it and tell me if it works as they expected, it would be appreciated. By default, this configuration option is not enabled when compiling busybox. Last: this patch corrects also the last TODO in the httpd.c file, replacing a few lines of code by a call to sendfile. -- Pierre M?tras -------------- next part -------------- A non-text attachment was scrubbed... Name: httpd_with_error_pages.patch Type: text/x-diff Size: 10828 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070706/75e93f94/attachment-0001.bin From Ron.Jobmann at Asentria.com Fri Jul 6 08:57:21 2007 From: Ron.Jobmann at Asentria.com (Ron Jobmann) Date: Fri, 6 Jul 2007 08:57:21 -0700 Subject: How to compile in Snapgear distribution? Message-ID: Hi I'm using Snapgear 3.4.0, and it comes with an older version of Busybox (1.00 rc3?). What I'm trying to do is replace this with the latest download version (1.6.1). After making some config choices, I run a toplevel make. Busybox compiles, but has a problem. The system I'm cross-compiling for is an IXP420, xscale, big-endian. Busybox compiles as little endian. The original Busybox compiles and links correctly. I'm lost as to what to change. All the other user apps compile correctly so my toolset is setup right. If I start tweaking settings in the Busybox makefile I can get it to compile big endian but it still wants to link little-endian so it errors out. Is there some 'standard' process on how to plugin new Busybox versions where old ones previously build? ______________________________________ Ron Jobmann Porting/Integration/Build Engineer Asentria Corporation 1200 N. 96TH ST Seattle, WA 98103-3310 http://www.asentria.com (206) 344-8800 ex: 120 / Fax: (206) 344-2116 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070706/0d6c4a0c/attachment.htm From strange at nsk.no-ip.org Fri Jul 6 07:16:41 2007 From: strange at nsk.no-ip.org (Luciano Rocha) Date: Fri, 6 Jul 2007 15:16:41 +0100 Subject: busybox and shared library In-Reply-To: References: Message-ID: <20070706141641.GA29815@bit.office.eurotux.com> On Fri, Jul 06, 2007 at 04:00:22PM +0200, Miroslaw Dach wrote: > Dear All, > > I am using for same time busybox. In the lib directory I have big > number of libraries and I wanted to narrow them to the necessary set. > > I have launched the command below to determine the shared libraries the > busy box depend on: > powerpc-405-linux-gnu-readelf -a bin/busybox | grep -i "shared" You can use any readelf command, not necessarily the one for the target system. And you're missing the interpreters. I use: 1. libraries: readelf -d $file | sed -ne '/library/s,.*\[\(.*\)\].*,\1,p' 2. interpreter: readelf -l $file | sed -ne '/interpreter/{s,^[^/]*/,/,;s,].*,,;p}' > My lib directory looks like that: > -rwxr-xr-x 1 root root 1576651 Jul 6 15:27 libc-2.3.2.so > -rwxr-xr-x 1 root root 29422 Jul 6 15:32 libcrypt-2.3.2.so > lrwxrwxrwx 1 root root 13 Jul 6 15:32 libcrypt.so -> libcrypt.so.1 > lrwxrwxrwx 1 root root 17 Jul 6 15:32 libcrypt.so.1 -> libcrypt-2.3.2.so > -rw-r--r-- 1 root root 193 Jul 6 15:28 libc.so > lrwxrwxrwx 1 root root 13 Jul 6 15:28 libc.so.6 -> libc-2.3.2.so > lrwxrwxrwx 1 root root 13 Jul 6 15:49 libgcc_s.so -> libgcc_s.so.1 > -rw-r--r-- 1 root root 338539 Jul 6 15:48 libgcc_s.so.1 > -rwxr-xr-x 1 root root 925590 Jul 6 15:30 libm-2.3.2.so > lrwxrwxrwx 1 root root 9 Jul 6 15:31 libm.so -> libm.so.6 > lrwxrwxrwx 1 root root 13 Jul 6 15:30 libm.so.6 -> libm-2.3.2.so Yep, no ld-linux.so.2 -- lfr 0/0 -------------- 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/20070706/01cb1fc8/attachment.pgp From vda.linux at googlemail.com Fri Jul 6 09:22:25 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 6 Jul 2007 18:22:25 +0200 Subject: ash ignors somtimes commands In-Reply-To: References: Message-ID: <200707061822.25440.vda.linux@googlemail.com> On Friday 06 July 2007 12:45, Miroslaw Dach wrote: > Hi All, > > My observation is that the symptom I described before happens let > say once per 200 times. > > Maybe it is somehow related to the terminal under windows which I > currently use. I tend to agree with Paul Fox , who pointed out that you may have several processes reading your input, and somtimes that "other process" eats the line, not ash. > > Can you add debugging outputs in ash.c in cmdloop function, like > > bb_error_msg("I am before parsecmd()"); bb_error_msg("I am after parsecmd()"); > > bb_error_msg("I am before evaltree()"); etc, and get more info about > > this weird behavior? Idf you will do what I described above, you can prove (or disprove) Paul's idea (if you type a commnd and dont see "I am after parsecmd()" appearing, your input definitely did not reach ash.) > > static int > > cmdloop(int top) > > { > > union node *n; > > struct stackmark smark; > > int inter; > > int numeof = 0; > > > > TRACE(("cmdloop(%d) called\n", top)); > > for (;;) { > > int skip; > > > > setstackmark(&smark); > > #if JOBS > > if (jobctl) > > showjobs(stderr, SHOW_CHANGED); > > #endif > > inter = 0; > > if (iflag && top) { > > inter++; > > #if ENABLE_ASH_MAIL > > chkmail(); > > #endif > > } > > n = parsecmd(inter); > > /* showtree(n); DEBUG */ > > if (n == NEOF) { > > if (!top || numeof >= 50) > > break; > > if (!stoppedjobs()) { > > if (!Iflag) > > break; > > out2str("\nUse \"exit\" to leave shell.\n"); > > } > > numeof++; > > } else if (nflag == 0) { > > job_warning = (job_warning == 2) ? 1 : 0; > > numeof = 0; > > evaltree(n, 0); > > } > > popstackmark(&smark); > > skip = evalskip; > > > > if (skip) { > > evalskip = 0; > > return skip & SKIPEVAL; > > } > > } > > return 0; > > } > > -- vda From vda.linux at googlemail.com Fri Jul 6 09:51:26 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 6 Jul 2007 18:51:26 +0200 Subject: macro used without args In-Reply-To: <387452.44065.qm@web30214.mail.mud.yahoo.com> References: <387452.44065.qm@web30214.mail.mud.yahoo.com> Message-ID: <200707061851.26681.vda.linux@googlemail.com> On Friday 06 July 2007 07:42, simon lao wrote: > Hi, > when I compile the busybox and had error message: > macro 'xstrtou' used without args. I used cross > compiler GCC 2.95. Do I need to update the toolchain ? Yes. There was similar posting from another user. I'm afraid bbox + gcc 2.x is not going to work. -- vda From vda.linux at googlemail.com Fri Jul 6 09:53:44 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 6 Jul 2007 18:53:44 +0200 Subject: [patch][Bug] sed can not be used because of wrong applet.h In-Reply-To: <20070706120954.DED5.YNAKAM@hitachisoft.jp> References: <20070706120954.DED5.YNAKAM@hitachisoft.jp> Message-ID: <200707061853.45025.vda.linux@googlemail.com> On Friday 06 July 2007 06:09, Yuichi Nakamura wrote: > Hi. > > I found sed can not be used when built with SELinux support. > I saw applet.h and found wrong point. > Here is a fix. Thanks, applied to svn. -- vda From vapier at gentoo.org Fri Jul 6 09:58:21 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Fri, 6 Jul 2007 12:58:21 -0400 Subject: How to compile in Snapgear distribution? In-Reply-To: References: Message-ID: <200707061258.22625.vapier@gentoo.org> On Friday 06 July 2007, Ron Jobmann wrote: > I'm using Snapgear 3.4.0, and it comes with an older version of Busybox > (1.00 rc3?). What I'm trying to do is replace this with the latest > download version (1.6.1). please refer to the uClinux-dist mailing list ... they have already done this -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/20070706/87d10010/attachment.pgp From vapier at gentoo.org Fri Jul 6 10:00:48 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Fri, 6 Jul 2007 13:00:48 -0400 Subject: macro used without args In-Reply-To: <200707061851.26681.vda.linux@googlemail.com> References: <387452.44065.qm@web30214.mail.mud.yahoo.com> <200707061851.26681.vda.linux@googlemail.com> Message-ID: <200707061300.49647.vapier@gentoo.org> On Friday 06 July 2007, Denis Vlasenko wrote: > On Friday 06 July 2007 07:42, simon lao wrote: > > when I compile the busybox and had error message: > > macro 'xstrtou' used without args. I used cross > > compiler GCC 2.95. Do I need to update the toolchain ? > > Yes. There was similar posting from another user. > I'm afraid bbox + gcc 2.x is not going to work. should we go as far as checking __GNUC__ defines in the headers and emitting #warning/#error for < 3 ? -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/20070706/4685d5c6/attachment.pgp From pgf at brightstareng.com Fri Jul 6 10:04:15 2007 From: pgf at brightstareng.com (Paul Fox) Date: Fri, 06 Jul 2007 13:04:15 -0400 Subject: macro used without args In-Reply-To: vapier's message of Fri, 06 Jul 2007 13:00:48 -0400. <200707061300.49647.vapier@gentoo.org> Message-ID: <30219.1183741455@brightstareng.com> vapier wrote: > On Friday 06 July 2007, Denis Vlasenko wrote: > > On Friday 06 July 2007 07:42, simon lao wrote: > > > when I compile the busybox and had error message: > > > macro 'xstrtou' used without args. I used cross > > > compiler GCC 2.95. Do I need to update the toolchain ? > > > > Yes. There was similar posting from another user. > > I'm afraid bbox + gcc 2.x is not going to work. > > should we go as far as checking __GNUC__ defines in the > headers and emitting #warning/#error for < 3 ? in my opinion, yes. there are still a lot of old toolchains floating around in tarballs out there. much better to fail early. (and if we know it will fail, it should be #error.) paul =--------------------- paul fox, pgf at brightstareng.com From vda.linux at googlemail.com Fri Jul 6 10:09:37 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 6 Jul 2007 19:09:37 +0200 Subject: How to change the Timezone In-Reply-To: <9709bd390707060520h31c9be6epcee5c13b4b7526dc@mail.gmail.com> References: <9709bd390707060520h31c9be6epcee5c13b4b7526dc@mail.gmail.com> Message-ID: <200707061909.37818.vda.linux@googlemail.com> On Friday 06 July 2007 14:20, Alberto Donato wrote: > Hi, > to have system-wide timezone configuration you need zoneinfo files > from libc. They are usually installed under /usr/share/zoneinfo. > > You can create a link in /etc/timezone to the correct file under this tree. This is true only for glibc. For uclibc, you need to edit /etc/TZ (or set TZ env var). On my system /etc/TZ contains one line: "CET-1CEST-2" -- vda From Jlau at extremenetworks.com Fri Jul 6 10:45:54 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Fri, 6 Jul 2007 10:45:54 -0700 Subject: upper case filename Message-ID: <888459D4AEE6464381B30398101F42F8043FC303@sc-msexch-06.extremenetworks.com> On BB 1.6.0, when I did "mkdir TMP", it created "tmp" instead of "TMP". Similary problem with tar cvf TAR ./*, it created tar instead of TAR. Can someone tell me who to configure BB 1.6.0 to obey the upper case input from the user? Thanks! -Joe From strange at nsk.no-ip.org Fri Jul 6 11:52:02 2007 From: strange at nsk.no-ip.org (Luciano Rocha) Date: Fri, 6 Jul 2007 19:52:02 +0100 Subject: upper case filename In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC303@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC303@sc-msexch-06.extremenetworks.com> Message-ID: <20070706185202.GA4048@bit.office.eurotux.com> On Fri, Jul 06, 2007 at 10:45:54AM -0700, Joe Lau wrote: > > On BB 1.6.0, when I did "mkdir TMP", it created "tmp" instead of "TMP". > Similary problem with tar cvf TAR ./*, it created tar instead of TAR. > Can someone tell me who to configure BB 1.6.0 to obey the upper case input > from the user? Under which filesystem? FAT and family automagically convert all short uppercase names to lowercase. Related option for mounting vfat filesystem: shortname=[lower|win95|winnt|mixed] Try mixed. -- lfr 0/0 -------------- 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/20070706/94bef866/attachment.pgp From simon_laoc at yahoo.com Fri Jul 6 11:55:13 2007 From: simon_laoc at yahoo.com (simon lao) Date: Fri, 6 Jul 2007 11:55:13 -0700 (PDT) Subject: adding symbolic link command Message-ID: <399143.1207.qm@web30213.mail.mud.yahoo.com> Hi, I have configured the ash shell in my busybox but somehow when I do "busybox chroot" command it will looks for "sh" command. I did ln -s ash sh and still did not work. The busybox report "sh:applet not found". How can I add the "sh" command as defined function in the busybox ? simon ____________________________________________________________________________________ We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list. http://tv.yahoo.com/collections/265 From vda.linux at googlemail.com Fri Jul 6 13:33:58 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 6 Jul 2007 22:33:58 +0200 Subject: I will be unavailable for approximately a week Message-ID: <200707062233.58862.vda.linux@googlemail.com> Hi, Please be informed that I am about to move and I won't be able to regularly read mailing list and apply patches to svn for some time. I estimate it will tak a week or so. Apologies for any recent patches which were not applied/reviewed. Please resend them later. -- vda From rossbeazley at lycos.co.uk Fri Jul 6 13:32:56 2007 From: rossbeazley at lycos.co.uk (ross beazley) Date: Fri, 6 Jul 2007 20:32:56 +0000 Subject: df, mount and tmpfs - no disk usage stats Message-ID: <18353636447532@lycos-europe.com> Hi, im not sure this is the correct place to post as it could be some other system issue. I am trying to build an embedded system using busybox as the core of the server. I am not building against uclibc but the normal glibc (version 2.3.6). The problem I am having is with a tmpfs not showing how much free space there is, or infact how much space is used. I have a printer spool directory mounted there (its a samba print server), but its not working because the df check is failing :-/ Iam using a 2.6.16.27 kernel and version 1.5.0 of busybox. Ive been googling to death for the last few days but cant find any hint as to what may be the problem. Ive mounted the tmpfs with a size option. The root fs is a squashfs and is monted in an initramfs and switch_rooted into. I need to use tmpfs as the writable parts of the system No tmpfs is mounted during the initramfs stage. I am able to write stuff into the tmpfs mounts. I dont really know where to start, from what i have seen in other busybox posts tmpfs is showing disk usage stats.... I must be doing something mega stoopid that ive totally overlooked it HELP! :) Ross Lycos email has 300 Megabytes of free storage... Get it now at mail.lycos.co.uk From natanael.copa at gmail.com Sat Jul 7 00:20:14 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Sat, 07 Jul 2007 09:20:14 +0200 Subject: Probably a bug in ash In-Reply-To: <20070706171028.22f53b94.sbb@tuxfamily.org> References: <468D2284.9070707@bfs.de> <7931.1183655912@brightstareng.com> <20070706171028.22f53b94.sbb@tuxfamily.org> Message-ID: <1183792814.5818.100.camel@localhost> On Fri, 2007-07-06 at 17:10 +0200, Seb wrote: > Le Thu, 05 Jul 2007 13:18:32 -0400 > Paul Fox a ?crit: > > > wh wrote: > > > Hi seb, > > > yes the mail was received but noone had time sofar to > > > investigate the problem > > > > further info: > > whoever takes a look at this; the problem is even worse than > > originally described. piping the output of "jobs" loses the > > output entirely, while piping the output of "jobs %1" causes an > > erroneous error message. > > > > BusyBox v1.7.0.svn (2007-07-05 13:13:46 EDT) built-in shell (ash) > > Enter 'help' for a list of built-in commands. > > > > $ sleep 3600 & > > $ sleep 700 > > (typed ^Z here) > > [2] + Stopped sleep 700 > > $ jobs > > [2] + Stopped sleep 700 > > [1] - Running sleep 3600 > > (two jobs) > > $ jobs | cat > > $ jobs | tr a-z A-Z > > (note missing output) [..] > Ok, I just wanted to be sure. Thanks for the confirmation and the > additionnal informations. :) > > Do you think I should also make a parallel bug report to dash ? (it's > not to put you under pressure -- I well see you have many other things > to fix here and this bug can wait -- but just to try to be more "useful" > without bothering you nor being unpolite). I tested on dash and yes, the bug is there too. Reporting it to dash sounds like a good idea. Natanael Copa From natanael.copa at gmail.com Sat Jul 7 00:24:12 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Sat, 07 Jul 2007 09:24:12 +0200 Subject: df, mount and tmpfs - no disk usage stats In-Reply-To: <18353636447532@lycos-europe.com> References: <18353636447532@lycos-europe.com> Message-ID: <1183793052.5818.103.camel@localhost> On Fri, 2007-07-06 at 20:32 +0000, ross beazley wrote: > Hi, > > im not sure this is the correct place to post as it could be some > other system issue. I am trying to build an embedded system using > busybox as the core of the server. I am not building against uclibc > but the normal glibc (version 2.3.6). The problem I am having is with > a tmpfs not showing how much free space there is, or infact how much > space is used. I have a printer spool directory mounted there (its a > samba print server), but its not working because the df check is > failing :-/ > > Iam using a 2.6.16.27 kernel and version 1.5.0 of busybox. > > Ive been googling to death for the last few days but cant find any > hint as to what may be the problem. > > Ive mounted the tmpfs with a size option. > > The root fs is a squashfs and is monted in an initramfs and > switch_rooted into. > > I need to use tmpfs as the writable parts of the system > > No tmpfs is mounted during the initramfs stage. > > I am able to write stuff into the tmpfs mounts. > > I dont really know where to start, from what i have seen in other > busybox posts tmpfs is showing disk usage stats.... I run root as tmpfs on my uclibc/busybox distro. > I must be doing something mega stoopid that ive totally overlooked it > Is /etc/mtab support enabled in busybox? Is /proc is mounted? Try to create a symblink: ln -s /proc/mounts /etc/mtab Natanael From sbb at tuxfamily.org Sat Jul 7 09:55:23 2007 From: sbb at tuxfamily.org (Seb) Date: Sat, 7 Jul 2007 18:55:23 +0200 Subject: Probably a bug in ash In-Reply-To: <1183792814.5818.100.camel@localhost> References: <468D2284.9070707@bfs.de> <7931.1183655912@brightstareng.com> <20070706171028.22f53b94.sbb@tuxfamily.org> <1183792814.5818.100.camel@localhost> Message-ID: <20070707185523.6a677e37.sbb@tuxfamily.org> Le Sat, 07 Jul 2007 09:20:14 +0200 Natanael Copa a ?crit: > On Fri, 2007-07-06 at 17:10 +0200, Seb wrote: > > Le Thu, 05 Jul 2007 13:18:32 -0400 > > Paul Fox a ?crit: > > > > > wh wrote: > > > > Hi seb, > > > > yes the mail was received but noone had time sofar to > > > > investigate the problem > > > > > > further info: > > > whoever takes a look at this; the problem is even worse than > > > originally described. piping the output of "jobs" loses the > > > output entirely, while piping the output of "jobs %1" causes an > > > erroneous error message. > > [..] > > > Ok, I just wanted to be sure. Thanks for the confirmation and the > > additionnal informations. :) > > > > Do you think I should also make a parallel bug report to dash ? (it's > > not to put you under pressure -- I well see you have many other things > > to fix here and this bug can wait -- but just to try to be more "useful" > > without bothering you nor being unpolite). > > I tested on dash and yes, the bug is there too. Reporting it to dash > sounds like a good idea. > > Natanael Copa > If comparison between shells can help you, the additionnal misfunction raised doesn't appear with the ash shell of the Slackware, the output is just lost "as usual". If someone looks for this ash shell, it can be found here : http://ftp.belnet.be/packages/slackware/slackware-12.0/source/ap/ash/ Otherwise, I confirm "jobs %1" raises an error with dash. In attachment the testing script augmented with the new case. I will try to contact the dash maintainer(s), does somebody know if it's now a part of the Debian project (there is a debian maintainer for the package), the home of the project seems to have recorded no changes since 2005 : http://gondor.apana.org.au/~herbert/dash/ ++ Seb. -------------- next part -------------- A non-text attachment was scrubbed... Name: ashjbtest2.sh Type: application/octet-stream Size: 408 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070707/95498361/attachment.obj From dallas.a.clement at gmail.com Sat Jul 7 14:34:35 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Sat, 07 Jul 2007 16:34:35 -0500 Subject: Problem with ash -n non-zero length string test Message-ID: <1183844075.3382.22.camel@localhost> Hello All, I'm experiencing some weird things when trying to use -n to test for a non-empty string as in the following example. boot_drive_name="" if [ -n $boot_drive_name ]; then retval=0 else echo "Could not determine boot drive name." fi To my surprise, this condition evaluates true and I do not see my echo message. However, if I use the -z test, with the following logic, I do see my echo message. boot_drive_name="" if [ -z $boot_drive_name ]; then echo "Could not determine boot drive name." else retval=0 fi I'm not sure if -n does not work 100 percent of the time in all cases or if it is an erratic problem that only happens under certain conditions. I have seen it fail in several different logic scenarios. Has anyone else observed this? Am I doing something wrong? I'm seeing this on busybox 1.6.0 From vapier at gentoo.org Sat Jul 7 14:58:20 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Sat, 7 Jul 2007 17:58:20 -0400 Subject: Problem with ash -n non-zero length string test In-Reply-To: <1183844075.3382.22.camel@localhost> References: <1183844075.3382.22.camel@localhost> Message-ID: <200707071758.20792.vapier@gentoo.org> On Saturday 07 July 2007, Dallas Clement wrote: > I'm experiencing some weird things when trying to use -n to test for a > non-empty string as in the following example. > > boot_drive_name="" > > if [ -n $boot_drive_name ]; then you need to make sure you quote things as this will be fragile regardless of the shell [ -n "$some_var" ] [ -z "$some_var" ] -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/20070707/4d294252/attachment.pgp From dallas.a.clement at gmail.com Sat Jul 7 15:09:21 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Sat, 07 Jul 2007 17:09:21 -0500 Subject: Problem with ash -n non-zero length string test In-Reply-To: <200707072344.30692.yann.morin.1998@anciens.enib.fr> References: <1183844075.3382.22.camel@localhost> <200707072344.30692.yann.morin.1998@anciens.enib.fr> Message-ID: <1183846161.3382.25.camel@localhost> On Sat, 2007-07-07 at 23:44 +0200, Yann E. MORIN wrote: > Hello Dallas, > Hello all, > > On Saturday 07 July 2007 23:34, Dallas Clement wrote: > > if [ -n $boot_drive_name ]; then > > retval=0 > > else > > echo "Could not determine boot drive name." > > fi > > I'd suggest either one of: > - enclose the variable between double quotes: "$boot_drive_name" > - use this: [ x$boot_drive_name = x ] > > I would also enclose the variable b=name between curly brackets: > "${boot_drive_name}" > > I would personnally use: > > if [ -z "${boot_drive_name}" ]; then > do_error_out > exit 1 > fi > do_something_usefull > > Regards, > Yann E. MORIN. > Thank you Yann & Mike: The -n check works when the variable is enclosed in double quotes! :0 Regards, Dallas From Jlau at extremenetworks.com Sat Jul 7 16:20:10 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Sat, 7 Jul 2007 16:20:10 -0700 Subject: string comparison in BB 1.6.0 sh Message-ID: <888459D4AEE6464381B30398101F42F8043FC30A@sc-msexch-06.extremenetworks.com> On BB 1.6.0, /scratch # if [ "abc" != "def" ]; then > echo "string comparison works" > fi string comparison works /scratch # if [ ! "abc" = "def" ]; then > echo "string comparison works" > fi Note: I didn't see my echo here. On BB 1.0, /scratch # if [ "abc" != "def" ]; then > echo "string comparision works" > fi string comparision works /scratch # if [ ! "abc" = "def" ]; then > echo "string comparision works" > fi string comparision works Any clue why BB 1.6.0 sh behave this way? Thanks! -Joe From yann.morin.1998 at anciens.enib.fr Sat Jul 7 14:44:30 2007 From: yann.morin.1998 at anciens.enib.fr (Yann E. MORIN) Date: Sat, 7 Jul 2007 23:44:30 +0200 Subject: Problem with ash -n non-zero length string test In-Reply-To: <1183844075.3382.22.camel@localhost> References: <1183844075.3382.22.camel@localhost> Message-ID: <200707072344.30692.yann.morin.1998@anciens.enib.fr> Hello Dallas, Hello all, On Saturday 07 July 2007 23:34, Dallas Clement wrote: > if [ -n $boot_drive_name ]; then > retval=0 > else > echo "Could not determine boot drive name." > fi I'd suggest either one of: - enclose the variable between double quotes: "$boot_drive_name" - use this: [ x$boot_drive_name = x ] I would also enclose the variable b=name between curly brackets: "${boot_drive_name}" I would personnally use: if [ -z "${boot_drive_name}" ]; then do_error_out exit 1 fi do_something_usefull Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +0/33 662376056 | Software Designer | \ / CAMPAIGN | ^ | | --==< ?_? >==-- ?------------.-------: X AGAINST | /e\ There is no | | http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL | """ conspiracy. | ?------------------------------?-------?------------------?--------------------? From vapier at gentoo.org Sat Jul 7 17:08:17 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Sat, 7 Jul 2007 20:08:17 -0400 Subject: Problem with ash -n non-zero length string test In-Reply-To: <200707072344.30692.yann.morin.1998@anciens.enib.fr> References: <1183844075.3382.22.camel@localhost> <200707072344.30692.yann.morin.1998@anciens.enib.fr> Message-ID: <200707072008.18456.vapier@gentoo.org> On Saturday 07 July 2007, Yann E. MORIN wrote: > - use this: [ x$boot_drive_name = x ] you would still need to quote $boot_drive_name to account for whitespace as you'll get an error otherwise also, this form: [ "x$foo" = x ] as a replacement for: [ -z "$foo" ] is common place only because of old broken shells which autotools supports ... personally i dont think it has any place when writing POSIX compliant code -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/20070707/875f91eb/attachment.pgp From yann.morin.1998 at anciens.enib.fr Sun Jul 8 01:59:32 2007 From: yann.morin.1998 at anciens.enib.fr (Yann E. MORIN) Date: Sun, 8 Jul 2007 10:59:32 +0200 Subject: Problem with ash -n non-zero length string test In-Reply-To: <200707072008.18456.vapier@gentoo.org> References: <1183844075.3382.22.camel@localhost> <200707072344.30692.yann.morin.1998@anciens.enib.fr> <200707072008.18456.vapier@gentoo.org> Message-ID: <200707081059.32821.yann.morin.1998@anciens.enib.fr> On Sunday 08 July 2007 02:08, Mike Frysinger wrote: > On Saturday 07 July 2007, Yann E. MORIN wrote: > > - use this: [ x$boot_drive_name = x ] > you would still need to quote $boot_drive_name to account for whitespace as > you'll get an error otherwise Absolutely right. Was quite late here in France, and I promptly went to bed after this reply. I shouldn't reply so late in the night... :-) > also, this form: > [ "x$foo" = x ] That's what I was thinking of, of course... > as a replacement for: > [ -z "$foo" ] > is common place only because of old broken shells which autotools supports ... ... or this exactly same reason. > personally i dont think it has any place when writing POSIX compliant code I was thinking of "Education": "Know there are different syntax to achieve the same goal. Use the most fitted depending on your constraints." May be one time someone gets on a "broken" shell, and (s)he will remember he saw such reference when (s)he sees his/her scripts are failing there when they used to work previously. Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +0/33 662376056 | Software Designer | \ / CAMPAIGN | ^ | | --==< ?_? >==-- ?------------.-------: X AGAINST | /e\ There is no | | http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL | """ conspiracy. | ?------------------------------?-------?------------------?--------------------? From rep.dot.nop at gmail.com Sun Jul 8 03:38:49 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Sun, 8 Jul 2007 12:38:49 +0200 Subject: r18727 broke fdisk Message-ID: <20070708103849.GF4096@aon.at> vda, util-linux/fdisk.c: In function 'seek_sector': util-linux/fdisk.c:641: warning: implicit declaration of function 'lseek64' util-linux/fdisk.c:641: error: 'off64_t' undeclared (first use in this function) util-linux/fdisk.c:641: error: (Each undeclared identifier is reported only once util-linux/fdisk.c:641: error: for each function it appears in.) util-linux/fdisk.c:641: error: expected ')' before 'secno' make[2]: *** [util-linux/fdisk.o] Error 1 make[1]: *** [util-linux] Error 2 If LFS is off, then there really is no lseek64. Please revert. From vapier at gentoo.org Sun Jul 8 17:24:30 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Sun, 8 Jul 2007 20:24:30 -0400 Subject: Problem with ash -n non-zero length string test In-Reply-To: <200707081059.32821.yann.morin.1998@anciens.enib.fr> References: <1183844075.3382.22.camel@localhost> <200707072008.18456.vapier@gentoo.org> <200707081059.32821.yann.morin.1998@anciens.enib.fr> Message-ID: <200707082024.30719.vapier@gentoo.org> On Sunday 08 July 2007, Yann E. MORIN wrote: > On Sunday 08 July 2007 02:08, Mike Frysinger wrote: > > personally i dont think it has any place when writing POSIX compliant > > code > > I was thinking of "Education": "Know there are different syntax to achieve > the same goal. Use the most fitted depending on your constraints." > May be one time someone gets on a "broken" shell, and (s)he will remember > he saw such reference when (s)he sees his/her scripts are failing there > when they used to work previously. fair enough ... different people have different goals. i'd take the position of just fixing the system/shell, but not everyone has that luxury. -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/20070708/1ac860a5/attachment.pgp From natanael.copa at gmail.com Mon Jul 9 05:46:52 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Mon, 09 Jul 2007 14:46:52 +0200 Subject: [PATCH] adduser is broken in 1.6.x Message-ID: <1183985212.29553.10.camel@localhost> Hi, adduser fails to create the user when ENABLE_FEATURE_CLEAN_UP is disabled. The reason is that adduser will exec passwd without first flushing the previously written /etc/passwd (and /etc/shadow). passwd will fail because the user does not exist until files are flushed. But the flush never comes because the buffered file handles are lost in the exec operation. Attatched patch fixes this. Natanael Copa -------------- next part -------------- A non-text attachment was scrubbed... Name: busybox-1.6.1-adduser.patch Type: text/x-patch Size: 502 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070709/4ab00b9d/attachment.bin From miroslaw.dach at psi.ch Mon Jul 9 08:18:32 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Mon, 9 Jul 2007 17:18:32 +0200 (CEST) Subject: How to change the Timezone Message-ID: Hi Alberto, Thank you for the suggestion. I use glibc. I have copied across the zoneinfo directory contents ie. (iso3166.tab and zone.tab) under /etc/timezone. I have setup the time zone according to the file zone.tab TZ=Europe/Zurich Next I have started the ntpd but I still see the time difference of 2 hours (ie, UTC time instead of the new time zone). Any Idea? Best Regards Mirek -- ============================================================================= Miroslaw Dach (Miroslaw.Dach at psi.ch) - SLS/Controls Group PSI - Paul Scherrer Institut CH-5232 Villigen ============================================================================= From vapier at gentoo.org Mon Jul 9 13:35:04 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Mon, 9 Jul 2007 16:35:04 -0400 Subject: How to change the Timezone In-Reply-To: References: Message-ID: <200707091635.04632.vapier@gentoo.org> On Monday 09 July 2007, Miroslaw Dach wrote: > Thank you for the suggestion. I use glibc. I have copied across > the zoneinfo directory contents ie. (iso3166.tab and zone.tab) under > /etc/timezone. I have setup the time zone according to the file zone.tab > TZ=Europe/Zurich > > Next I have started the ntpd but I still see the time difference of 2 hours > (ie, UTC time instead of the new time zone). considering this isnt a busybox issue, perhaps you should go ask on a glibc list or read the glibc manual -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/20070709/f27e5bb1/attachment.pgp From Ron.Jobmann at Asentria.com Mon Jul 9 15:55:01 2007 From: Ron.Jobmann at Asentria.com (Ron Jobmann) Date: Mon, 9 Jul 2007 15:55:01 -0700 Subject: Busybox build configuration Message-ID: I was earlier having problems building Busybox 1.6.1 for my embedded system, but got the endian problem figured out. However, now that the executables have been built they won't run. Using readelf, I discovered that busybox is using the host/build system glibc and not the target Snapgear distribution's uClibc that everything else uses. Is there some place to set this? A flag or switch or something? ______________________________________ Ron Jobmann Porting/Integration/Build Engineer Asentria Corporation 1200 N. 96TH ST Seattle, WA 98103-3310 http://www.asentria.com (206) 344-8800 ex: 120 / Fax: (206) 344-2116 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070709/713ad6b3/attachment.htm From Nikolay.Yevik at Halliburton.com Mon Jul 9 16:18:27 2007 From: Nikolay.Yevik at Halliburton.com (Nikolay Yevik) Date: Mon, 9 Jul 2007 18:18:27 -0500 Subject: Busybox build configuration In-Reply-To: References: Message-ID: <3FA34846740FF448A01F5B48A52C014F03F4F765@HOUEXCH078.corp.halliburton.com> I have compiled BusyBox 1.7.0 dynamically linking it against uClibc using SnapGear 2.0 toolchain and incorporated into the same SnapGear distro. If I remember correctly I had to set CROSS_COMPILE = "arm-linux-" UCLIBC_DIR=../../uClibc UCFRONT="../../tools/ucfront-gcc" CC = $(UCFRONT) $(CROSS_COMPILE)gcc CPP = $(UCFRONT) $(CC) -E all this is the BusyBox main directory Makefile. Also, you might want to try to hardcode it in ucfront.c - by setting default type for libtype structure as LIBTYPE_UCLIBC. This should not be necessary, just setting above variables in SnapGear Makefile worked for me. ________________________________ From: busybox-bounces at busybox.net [mailto:busybox-bounces at busybox.net] On Behalf Of Ron Jobmann Sent: Monday, July 09, 2007 5:55 PM To: busybox at busybox.net Subject: Busybox build configuration I was earlier having problems building Busybox 1.6.1 for my embedded system, but got the endian problem figured out. However, now that the executables have been built they won't run. Using readelf, I discovered that busybox is using the host/build system glibc and not the target Snapgear distribution's uClibc that everything else uses. Is there some place to set this? A flag or switch or something? ______________________________________ Ron Jobmann Porting/Integration/Build Engineer Asentria Corporation 1200 N. 96TH ST Seattle, WA 98103-3310 http://www.asentria.com (206) 344-8800 ex: 120 / Fax: (206) 344-2116 ---------------------------------------------------------------------- This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070709/114ef0b5/attachment.htm From dallas.a.clement at gmail.com Mon Jul 9 12:22:31 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Mon, 09 Jul 2007 14:22:31 -0500 Subject: dpkg-deb vs. dpkg Message-ID: <1184008951.3459.13.camel@localhost> Hi All, Can somebody tell me what the difference is between these two commands? I'm assuming both should work with a .deb package... Thanks, Dallas Clement From psmith at netezza.com Mon Jul 9 17:36:10 2007 From: psmith at netezza.com (Paul Smith) Date: Mon, 09 Jul 2007 20:36:10 -0400 Subject: dpkg-deb vs. dpkg In-Reply-To: <1184008951.3459.13.camel@localhost> References: <1184008951.3459.13.camel@localhost> Message-ID: <1184027770.29268.3.camel@homebase.localnet> On Mon, 2007-07-09 at 14:22 -0500, Dallas Clement wrote: > Can somebody tell me what the difference is between these two commands? > > I'm assuming both should work with a .deb package... The man page sez: dpkg-deb packs, unpacks and provides information about Debian archives. Use dpkg to install and remove packages from your system. You can also invoke dpkg-deb by calling dpkg with whatever options you want to pass to dpkg-deb. dpkg will spot that you wanted dpkg-deb and run it for you. In general dpkg deals with the database of packages that are already installed on the system, including installing/uninstalling, and dpkg-deb manipulates .deb packages (builds them, lists their contents, etc.) HTH! From miroslaw.dach at psi.ch Tue Jul 10 00:34:35 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Tue, 10 Jul 2007 09:34:35 +0200 (CEST) Subject: How to change the Timezone In-Reply-To: <200707091635.04632.vapier@gentoo.org> Message-ID: Thank you for all the hints. Below I enclose steps I did and what works for me: All is described here in great details: http://www.linux-watch.com/news/NS6300294422.html The steps I did are described below: 1. Download the tar file which contains the configurations data of every time zone (the name can change with time tzdata2007f.tar.gz so maybe it is better first to see what the server contains ) wget ftp://elsie.nci.nih.gov/pub/tzdata2007f.tar.gz 2. Untar the package tar zxvf tzdata2007f.tar.gz 3. Compile the config data for certain area. The compiled files will be stored in the directory after -d option (in my case zoneinfo1). Launch zic compiler on the host computer. /usr/sbin/zic -d zoneinfo1 europe 4. Install the time zone data on the remote computer cp zoneinfo1/CET /etc/. ln -s /etc/CET /etc/localtime Best Regards Mirek On Mon, 9 Jul 2007, Mike Frysinger wrote: > On Monday 09 July 2007, Miroslaw Dach wrote: > > Thank you for the suggestion. I use glibc. I have copied across > > the zoneinfo directory contents ie. (iso3166.tab and zone.tab) under > > /etc/timezone. I have setup the time zone according to the file zone.tab > > TZ=Europe/Zurich > > > > Next I have started the ntpd but I still see the time difference of 2 hours > > (ie, UTC time instead of the new time zone). > > considering this isnt a busybox issue, perhaps you should go ask on a glibc > list or read the glibc manual > -mike > -- ============================================================================= Miroslaw Dach (Miroslaw.Dach at psi.ch) - SLS/Controls Group PSI - Paul Scherrer Institut CH-5232 Villigen ============================================================================= From rep.dot.nop at gmail.com Tue Jul 10 04:33:48 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Tue, 10 Jul 2007 13:33:48 +0200 Subject: Busybox build configuration In-Reply-To: References: Message-ID: <20070710113348.GA32138@aon.at> On Mon, Jul 09, 2007 at 03:55:01PM -0700, Ron Jobmann wrote: >I was earlier having problems building Busybox 1.6.1 for my embedded >system, but got the endian problem figured out. However, now that the >executables have been built they won't run. Using readelf, I discovered >that busybox is using the host/build system glibc and not the target >Snapgear distribution's uClibc that everything else uses. > >Is there some place to set this? A flag or switch or something? Sure. See $(BUSYBOX_DIR)/busybox: in http://buildroot.uclibc.org/cgi-bin/viewcvs.cgi/*checkout*/trunk/buildroot/package/busybox/busybox.mk?rev=19032 or http://busybox.net/FAQ.html#build for that matter From farmatito at tiscali.it Tue Jul 10 14:57:14 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 10 Jul 2007 23:57:14 +0200 Subject: [PATCH 1/7] bb_ioctl implementation Message-ID: <200707102357.14583.farmatito@tiscali.it> Hi, this series of 7 patches is a first attempt to add an ioctl api to libbb and to use it in all applets where: if ( ioctl() < 0 [!= 0]) bb_perror_msg{and_die}(); or similar code is used. The new libbb functions are: int ioctl_or_vperror(int fd, int request, void *argp, const char *fmt,...); void ioctl_or_vperror_and_die(int fd, int request, void *argp, const char *fmt,...); These two functions can be called directly. #if ENABLE_IOCTL_HEX2STR_ERROR int bb_ioctl_or_warn(int fd, int request, void *argp, const char *ioctl_name); void bb_ioctl_or_die(int fd, int request, void *argp, const char *ioctl_name); #define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp,#request) #define ioctl_or_die(fd,request,argp) bb_ioctl_or_die(fd,request,argp,#request) #else int bb_ioctl_or_warn(int fd, int request, void *argp); void bb_ioctl_or_die(int fd, int request, void *argp); #define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp) #define ioctl_or_die(fd,request,argp) bb_ioctl_or_die(fd,request,argp) #endif These functions should not be called directly, instead: ioctl_or_warn(fd,request,argp); ioctl_or_die(fd,request,argp); should be used, thus allowing to change the number of args passed to them by enabling/disabling the CONFIG_IOCTL_HEX2STR_ERROR option. This option is located in: Busybox Settings ---> Busybox Library Tuning ---> [*] Use ioctl names rather than hex values in error messages This option by default is enabled so that busybox's behaviour is unchaged and the same as the current, For example error messages like this are displayed: deallocvt: VT_DISALLOCATE: Device or resource busy By disabling it the error message format will change to: deallocvt: ioctl 0x5608 failed: Device or resource busy After applying all the patches even with this config option enabled there will be a size reduction: scripts/bloat-o-meter busybox_old busybox_unstripped function old new delta process_dev 5283 5498 +215 ioctl_or_vperror - 54 +54 ioctl_or_vperror_and_die - 51 +51 bb_ioctl_or_warn - 47 +47 bb_ioctl_or_die - 39 +39 print_value_on_off - 33 +33 arp_main 2184 2198 +14 fdformat_main 575 585 +10 collect_int 114 123 +9 xsocket_type 124 129 +5 readcmd 1283 1288 +5 xselect 1501 1505 +4 mkfs_minix_main 3035 3038 +3 varunset 58 60 +2 process0_stdin 220 222 +2 changepath 178 180 +2 arping_main 2019 2020 +1 zcip_main 1714 1713 -1 flush_buffer_cache 78 77 -1 make_human_readable_str 220 218 -2 fsck_main 1911 1909 -2 xstrtoul_range_sfx 229 226 -3 xstrtoull_range_sfx 295 291 -4 telnet_main 1699 1695 -4 evalcommand 1132 1127 -5 setconsole_main 120 114 -6 ipaddr_list_or_flush 2665 2659 -6 if_readconf 179 173 -6 eject_main 146 140 -6 hwclock_main 504 497 -7 freeramdisk_main 86 79 -7 collect_fork 119 112 -7 collect_blk 474 467 -7 print_tunnel 749 741 -8 mt_main 295 287 -8 deallocvt_main 82 74 -8 vlock_main 634 625 -9 vconfig_main 351 342 -9 raidautorun_main 59 50 -9 nameif_main 670 661 -9 chvt_main 90 81 -9 setlogcons_main 92 82 -10 read_rtc 186 176 -10 dumpkmap_main 284 274 -10 do_get_ioctl 115 105 -10 do_del_ioctl 125 115 -10 do_add_ioctl 134 124 -10 setkeycodes_main 165 154 -11 ifconfig_main 1303 1292 -11 write_table 244 232 -12 getty_main 2514 2502 -12 catv_main 342 330 -12 ifaddrlist 394 381 -13 do_show 793 778 -15 do_iplink 1171 1156 -15 loadfont_main 495 479 -16 do_loadfont 191 174 -17 route_main 2220 2202 -18 ether_wake_main 747 728 -19 set_address 75 53 -22 fbset_main 2066 2043 -23 do_time 593 570 -23 xioctl 25 - -25 parse_args 1508 1482 -26 udhcp_read_interface 316 282 -34 bb_ioctl 45 - -45 bb_ioctl_alt 70 - -70 bb_ioctl_on_off 80 - -80 .rodata 123143 122791 -352 ------------------------------------------------------------------------------ (add/remove: 5/4 grow/shrink: 12/48 up/down: 496/-1074) Total: -578 bytes By disabling this option the size reduction is far bigger: root at localhost:~/Desktop/busybox.orig# scripts/bloat-o-meter busybox_old busybox_unstripped function old new delta ioctl_or_vperror - 54 +54 ioctl_or_vperror_and_die - 51 +51 bb_ioctl_or_warn - 47 +47 bb_ioctl_or_die - 39 +39 print_value_on_off - 33 +33 collect_int 114 123 +9 arp_main 2184 2193 +9 readcmd 1283 1288 +5 xselect 1501 1505 +4 mkfs_minix_main 3035 3038 +3 process0_stdin 220 222 +2 fsck_main 1911 1909 -2 xstrtoul_range_sfx 229 226 -3 xstrtoull_range_sfx 295 291 -4 telnet_main 1699 1695 -4 arping_main 2019 2015 -4 evalcommand 1132 1127 -5 zcip_main 1714 1708 -6 eject_main 146 140 -6 process_dev 5283 5276 -7 freeramdisk_main 86 79 -7 mt_main 295 287 -8 vconfig_main 351 342 -9 nameif_main 670 661 -9 dumpkmap_main 284 274 -10 setkeycodes_main 165 154 -11 setconsole_main 120 109 -11 ipaddr_list_or_flush 2665 2654 -11 if_readconf 179 168 -11 write_table 244 232 -12 hwclock_main 504 492 -12 getty_main 2514 2502 -12 print_tunnel 749 736 -13 ifaddrlist 394 381 -13 deallocvt_main 82 69 -13 vlock_main 634 620 -14 raidautorun_main 59 45 -14 setlogcons_main 92 77 -15 read_rtc 186 171 -15 fdformat_main 575 560 -15 do_get_ioctl 115 100 -15 do_del_ioctl 125 110 -15 do_add_ioctl 134 119 -15 chvt_main 90 71 -19 do_show 793 773 -20 ether_wake_main 747 723 -24 xioctl 25 - -25 loadfont_main 495 469 -26 set_address 75 48 -27 do_loadfont 191 164 -27 do_time 593 565 -28 parse_args 1508 1477 -31 route_main 2220 2187 -33 fbset_main 2066 2033 -33 ifconfig_main 1303 1267 -36 do_iplink 1171 1131 -40 udhcp_read_interface 316 272 -44 bb_ioctl 45 - -45 bb_ioctl_alt 70 - -70 bb_ioctl_on_off 80 - -80 .rodata 123143 121863 -1280 ------------------------------------------------------------------------------ (add/remove: 5/4 grow/shrink: 6/46 up/down: 256/-2209) Total: -1953 bytes So the difference between enabling/disabling it is about: 1375 bytes. After applying patch n.1 the remaining patches could be applied in whatever order. The hdparm applet has a separate patch as it was the one with the greatest number of changes so that it needs more love and testing than the others. This patches are mostly only compiled tested. Critics, hints and help from the list is as always welcome. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_core.patch Type: text/x-diff Size: 3525 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070710/8df73d77/attachment.bin From farmatito at tiscali.it Tue Jul 10 14:59:10 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 10 Jul 2007 23:59:10 +0200 Subject: [PATCH 2/7] bb_ioctl implementation Message-ID: <200707102359.10673.farmatito@tiscali.it> This is the bb_ioctl patch for console-tools. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_console-tools.patch Type: text/x-diff Size: 3950 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070710/e587cf05/attachment.bin From farmatito at tiscali.it Tue Jul 10 15:00:02 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 11 Jul 2007 00:00:02 +0200 Subject: [PATCH 3/7] bb_ioctl implementation Message-ID: <200707110000.02372.farmatito@tiscali.it> This is the bb_ioctl patch for loginutils. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_loginutils.patch Type: text/x-diff Size: 1066 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070711/eac2a4d9/attachment.bin From farmatito at tiscali.it Tue Jul 10 15:00:32 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 11 Jul 2007 00:00:32 +0200 Subject: [PATCH 4/7] bb_ioctl implementation Message-ID: <200707110000.32545.farmatito@tiscali.it> This is the bb_ioctl patch for miscutils. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_miscutils.patch Type: text/x-diff Size: 3687 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070711/f384d685/attachment-0001.bin From farmatito at tiscali.it Tue Jul 10 15:01:08 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 11 Jul 2007 00:01:08 +0200 Subject: [PATCH 5/7] bb_ioctl implementation Message-ID: <200707110001.08690.farmatito@tiscali.it> This is the bb_ioctl patch for miscutils/hdparm. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_hdparm.patch Type: text/x-diff Size: 14824 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070711/8e3be56c/attachment.bin From farmatito at tiscali.it Tue Jul 10 15:01:44 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 11 Jul 2007 00:01:44 +0200 Subject: [PATCH 6/7] bb_ioctl implementation Message-ID: <200707110001.45054.farmatito@tiscali.it> This is the bb_ioctl patch for networking. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_networking.patch Type: text/x-diff Size: 14443 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070711/1cbf618f/attachment-0001.bin From farmatito at tiscali.it Tue Jul 10 15:02:23 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 11 Jul 2007 00:02:23 +0200 Subject: [PATCH 7/7] bb_ioctl implementation Message-ID: <200707110002.23998.farmatito@tiscali.it> This is the bb_ioctl patch for util-linux. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_util_linux.patch Type: text/x-diff Size: 4526 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070711/0a36b00f/attachment.bin From natanael.copa at gmail.com Wed Jul 11 00:02:05 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Wed, 11 Jul 2007 09:02:05 +0200 Subject: ash -l option? Message-ID: <1184137325.29553.52.camel@localhost> Hi, While trying to get my busybox/uClibc based distro run as a vserver i got the problem that there is no -l option to /bin/sh. I solved it by patching vserver scripts: --- data.orig/usr/lib/util-vserver/vserver.functions 2007-07-05 15:41:45 +0000 +++ data/usr/lib/util-vserver/vserver.functions 2007-07-10 22:54:08 +0000 @@ -207,7 +207,7 @@ test -n "$ENTER_SHELL" || { local i - for i in "/bin/bash -login" "/bin/sh -l" /bin/csh; do + for i in "/bin/bash -login" "/bin/ash --login" "/bin/sh -l" /bin/csh; do set -- $i test -x "$vdir/vdir/$1" || continue ENTER_SHELL=( "$@" ) I was wondering if there is intereste for a --login short option -l in busybox so patching util-vserver is not needed for busybox vservers? Natanael Copa From landau_alex at yahoo.com Wed Jul 11 04:48:52 2007 From: landau_alex at yahoo.com (Alex Landau) Date: Wed, 11 Jul 2007 04:48:52 -0700 (PDT) Subject: [PATCH 1/7] bb_ioctl implementation In-Reply-To: <200707102357.14583.farmatito@tiscali.it> Message-ID: <276626.20187.qm@web62508.mail.re1.yahoo.com> Tito wrote: Hi, this series of 7 patches is a first attempt to add an ioctl api to libbb and to use it in all applets where: if ( ioctl() < 0 [!= 0]) bb_perror_msg{and_die}(); or similar code is used. [snip] Critics, hints and help from the list is as always welcome. Ciao, Tito Hi, It looks really nice, only eye-tested though. One small comment: ioctl(...) != 0 doesn't mean it's an error. the ioctl() may return a positive value, so I'd better have an ioctl(...) < 0 test. Especially when you return ret afterwards. Regards, Alex --------------------------------- Don't get soaked. Take a quick peak at the forecast with theYahoo! Search weather shortcut. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070711/0ce454be/attachment.htm From marc.leeman at gmail.com Wed Jul 11 06:11:26 2007 From: marc.leeman at gmail.com (Marc Leeman) Date: Wed, 11 Jul 2007 15:11:26 +0200 Subject: devmem2 Message-ID: <20070711131126.GZ2660@chiana.homelinux.org> A patch to include a small program that reads from/to physical memory. Useful for e.g. tuning the processor register map after bootup. I put in util-linux. -- greetz, marc Is everybody aboard this ship kinkoid? Chiana - A Bug's Life chiana 2.6.18-4-ixp4xx #1 Tue Mar 27 18:01:56 BST 2007 GNU/Linux -------------- next part -------------- A non-text attachment was scrubbed... Name: devmem2.diff Type: text/x-diff Size: 5971 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070711/64129ef5/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://busybox.net/lists/busybox/attachments/20070711/64129ef5/attachment.pgp From dallas.a.clement at gmail.com Wed Jul 11 02:46:41 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Wed, 11 Jul 2007 04:46:41 -0500 Subject: Difficulty with dpkg dependencies Message-ID: <1184147201.3305.18.camel@localhost> Hello All, I'm having some trouble installing a busybox debian package which I built on my Debian system. I previously built and installed a glibc binary debian package successfully. The busybox package installation is failing complaining that the libc6-i386 package which it depends on is not installed. It gives the following error: dpkg: package busybox depends on libc6-i386, which is not installed or flagged to be installed However, I know that libc6-i386 is installed. If I examine the contents of the dpkg 'status' file as follows I get the following: cat /var/lib/dpkg/status Package: libc6-i386 Version: 2.3.6 Section: libs Priority: optional Architecture: i386 Maintainer: Dallas Clement Description: The GNU C library The GNU C library is the standard C/C++ library \ needed to support most Linux applications. Status: install ok installed ---------------------- The following is the info for the glibc package which I built: dallas at debian:~/packages/glibc$ dpkg --info libc6-i386.deb new debian package, version 2.0. size 7129020 bytes: control archive= 328 bytes. 280 bytes, 11 lines control Package: libc6-i386 Version: 2.3.6 Section: libs Priority: optional Architecture: i386 Depends: Maintainer: Dallas Clement Description: The GNU C library The GNU C library is the standard C/C++ library \ needed to support most Linux applications. The following is the info for the busybox package which I built: dallas at debian:~/packages$ dpkg --info busybox_1.6.0-1_i386.deb new debian package, version 2.0. size 233752 bytes: control archive= 619 bytes. 444 bytes, 12 lines control 258 bytes, 4 lines md5sums Package: busybox Version: 1.6.0-1 Section: unknown Priority: extra Architecture: i386 Depends: libc6-i386 (>= 2.3.5-1) Installed-Size: 436 Maintainer: Dallas Clement Description: Busybox UNIX command utilities. BusyBox combines tiny versions of many common UNIX utilities into \ a single small executable. It provides replacements for most of the \ utilities you usually find in GNU fileutils, shellutils, etc. ---------------------- I could very likely be doing something wrong, but just not sure what it is. I don't see a reason for the dependency to fail. I'd sure appreciate any help. Regards, Dallas Clement From wharms at bfs.de Wed Jul 11 08:24:30 2007 From: wharms at bfs.de (walter harms) Date: Wed, 11 Jul 2007 17:24:30 +0200 Subject: How to change the Timezone In-Reply-To: <200707061909.37818.vda.linux@googlemail.com> References: <9709bd390707060520h31c9be6epcee5c13b4b7526dc@mail.gmail.com> <200707061909.37818.vda.linux@googlemail.com> Message-ID: <4694F62E.40006@bfs.de> perhaps this Question & Answer should go the the FAQ ? re, wh Denis Vlasenko wrote: > On Friday 06 July 2007 14:20, Alberto Donato wrote: >> Hi, >> to have system-wide timezone configuration you need zoneinfo files >> from libc. They are usually installed under /usr/share/zoneinfo. >> >> You can create a link in /etc/timezone to the correct file under this tree. > > This is true only for glibc. > > For uclibc, you need to edit /etc/TZ (or set TZ env var). > > On my system /etc/TZ contains one line: "CET-1CEST-2" > -- > vda > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From farmatito at tiscali.it Wed Jul 11 09:38:15 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 11 Jul 2007 18:38:15 +0200 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <276626.20187.qm@web62508.mail.re1.yahoo.com> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> Message-ID: <200707111838.15527.farmatito@tiscali.it> On Wednesday 11 July 2007 13:48:52 Alex Landau wrote: > > Tito wrote: Hi, > this series of 7 patches is a first attempt to add an ioctl api to libbb > and to use it in all applets where: > > if ( ioctl() < 0 [!= 0]) > bb_perror_msg{and_die}(); > > or similar code is used. > [snip] > > Critics, hints and help from the list is as always welcome. > > Ciao, > Tito > > Hi, > It looks really nice, only eye-tested though. > One small comment: ioctl(...) != 0 doesn't mean it's an error. the ioctl() may return a positive value, > so I'd better have an ioctl(...) < 0 test. Especially when you return ret afterwards. > Regards, > Alex > Hi, I know but i'm pretty sure that in all places in busybox where this test was used [ !=0 ] it errored out, i double checked it, but nonetheless maybe its a good idea to change it to [ < 0 ] to be more coherent with the original ioctl call. So attached is a fixed patch. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_core_02.patch Type: text/x-diff Size: 3519 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070711/7bea75b7/attachment-0001.bin From vapier at gentoo.org Wed Jul 11 12:15:59 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Wed, 11 Jul 2007 15:15:59 -0400 Subject: How to change the Timezone In-Reply-To: <4694F62E.40006@bfs.de> References: <200707061909.37818.vda.linux@googlemail.com> <4694F62E.40006@bfs.de> Message-ID: <200707111516.00391.vapier@gentoo.org> On Wednesday 11 July 2007, walter harms wrote: > perhaps this Question & Answer should go the the FAQ ? it isnt a busybox thing -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/20070711/415cf25a/attachment.pgp From pclouds at gmail.com Wed Jul 11 12:54:58 2007 From: pclouds at gmail.com (Nguyen Thai Ngoc Duy) Date: Wed, 11 Jul 2007 15:54:58 -0400 Subject: [ash-bug] in shcmd function, space should be output to fp, not to stdout. Message-ID: Well, the subject says it all. -- Duy -------------- next part -------------- A non-text attachment was scrubbed... Name: busybox-1.6.1.patch Type: application/octet-stream Size: 613 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070711/7c68efa0/attachment.obj From rep.dot.nop at gmail.com Wed Jul 11 15:06:24 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Thu, 12 Jul 2007 00:06:24 +0200 Subject: devmem2 In-Reply-To: <20070711131126.GZ2660@chiana.homelinux.org> References: <20070711131126.GZ2660@chiana.homelinux.org> Message-ID: <20070711220624.GZ4096@aon.at> On Wed, Jul 11, 2007 at 03:11:26PM +0200, Marc Leeman wrote: >A patch to include a small program that reads from/to physical memory. >Useful for e.g. tuning the processor register map after bootup. > >I put in util-linux. It isn't in the util-linux package, is it? Perhaps miscutils would be a better place. Generally it looks really whitespace damaged, run (from toplevel) indent */devmem2.c, please. >Index: busybox-1.6.1/util-linux/Config.in >=================================================================== >--- busybox-1.6.1.orig/util-linux/Config.in >+++ busybox-1.6.1/util-linux/Config.in >@@ -5,6 +5,13 @@ > > menu "Linux System Utilities" > >+config DEVMEM2 >+ bool "devmem2" >+ default n >+ help >+ devmem2 is a small program that reads and writes from physcial physical >+ memory using /dev/mem. >+ > config DMESG > bool "dmesg" > default n >Index: busybox-1.6.1/util-linux/Kbuild >=================================================================== >--- busybox-1.6.1.orig/util-linux/Kbuild >+++ busybox-1.6.1/util-linux/Kbuild >@@ -30,3 +30,4 @@ > lib-$(CONFIG_SWAPONOFF) +=swaponoff.o > lib-$(CONFIG_SWITCH_ROOT) +=switch_root.o > lib-$(CONFIG_UMOUNT) +=umount.o >+lib-$(CONFIG_DEVMEM2) +=devmem2.o >Index: busybox-1.6.1/util-linux/devmem2.c >=================================================================== >--- /dev/null >+++ busybox-1.6.1/util-linux/devmem2.c >@@ -0,0 +1,106 @@ >+/* >+ * devmem2.c: Simple program to read/write from/to any location in memory. >+ * >+ * Copyright (C) 2000, Jan-Derk Bakker (jdb at lartmaker.nl) >+ * Include in busybox by Marc Leeman (marc.leeman at barco.com) >+ * >+ * This software has been developed for the LART computing board >+ * (http://www.lart.tudelft.nl/). The development has been sponsored by >+ * the Mobile MultiMedia Communications (http://www.mmc.tudelft.nl/) >+ * and Ubiquitous Communications (http://www.ubicom.tudelft.nl/) >+ * projects. >+ * >+ * >+ * This program is free software; you can redistribute it and/or modify >+ * it under the terms of the GNU General Public License as published by >+ * the Free Software Foundation; either version 2 of the License, or >+ * (at your option) any later version. >+ * >+ * This program is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+ * GNU General Public License for more details. >+ * >+ * You should have received a copy of the GNU General Public License >+ * along with this program; if not, write to the Free Software >+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Please use the common short boilerplate. >+ * >+ */ >+ >+#include "libbb.h" >+ >+#define FATAL do { bb_perror_msg_and_die("Error at line %d, file %s (%d) [%s]\n", \ >+ __LINE__, __FILE__, errno, strerror(errno)); exit(1); } while(0) Is this really needed? This is really gcc centric (FILE and LINE) Also i believe that perror already does strerror(errno). Please check this.. >+ >+#define MAP_SIZE 4096UL >+#define MAP_MASK (MAP_SIZE - 1) possible name clash? >+ >+int devmem2_main(int argc, char **argv); >+int devmem2_main(int argc, char **argv) { >+ int fd; >+ void *map_base, *virt_addr; >+ unsigned long read_result, writeval; >+ off_t target; >+ int access_type = 'w'; >+ >+ if(argc < 2) { >+ bb_show_usage(); >+ } >+ target = strtoul(argv[1], 0, 0); >+ >+ if(argc > 2) >+ access_type = tolower(argv[2][0]); If we should die on strtoul errors, there is already a wrapper for this, please reuse. >+ >+ >+ if((fd = xopen("/dev/mem", O_RDWR | O_SYNC)) == -1) FATAL; xopen will die, the FATAL is thusly redundant. >+ printf("/dev/mem opened.\n"); Smaller if you use const char bb_path_dev_mem[] = "/dev/mem"; ? >+ fflush(stdout); What's that good for? drop. >+ >+ /* Map one page */ >+ map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, target & ~MAP_MASK); >+ if(map_base == (void *) -1) FATAL; use MAP_FAILED not an arbitrary const. >+ printf("Memory mapped at address %p.\n", map_base); >+ fflush(stdout); really need to flush here? drop. >+ >+ virt_addr = map_base + (target & MAP_MASK); smaller to just use map base and adjust the munmap offset later on? >+ switch(access_type) { Please flatten that manually or provide cycles to regtest http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html >+ case 'b': >+ read_result = *((unsigned char *) virt_addr); >+ break; >+ case 'h': >+ read_result = *((unsigned short *) virt_addr); >+ break; >+ case 'w': >+ read_result = *((unsigned long *) virt_addr); >+ break; >+ default: >+ bb_perror_msg_and_die("Illegal data type '%c'.\n", access_type); >+ } >+ printf("Value at address 0x%lx (%p): 0x%lx\n", target, virt_addr, read_result); Sounds a bit verbose, but ok. >+ fflush(stdout); ditch fflush? >+ >+ if(argc > 3) { >+ writeval = strtoul(argv[3], 0, 0); xatonum or the like? i.e. die on error >+ switch(access_type) { can't you interleave that switch statement with the above? >+ case 'b': >+ *((unsigned char *) virt_addr) = writeval; >+ read_result = *((unsigned char *) virt_addr); >+ break; >+ case 'h': >+ *((unsigned short *) virt_addr) = writeval; >+ read_result = *((unsigned short *) virt_addr); >+ break; >+ case 'w': >+ *((unsigned long *) virt_addr) = writeval; >+ read_result = *((unsigned long *) virt_addr); >+ break; >+ } >+ printf("Written 0x%lx; readback 0x%lx\n", writeval, read_result); >+ fflush(stdout); yet another flush. brrr >+ } >+ >+ if(munmap(map_base, MAP_SIZE) == -1) FATAL; >+ close(fd); >+ return 0; Please use EXIT_SUCCESS >+} From rep.dot.nop at gmail.com Wed Jul 11 15:13:48 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Thu, 12 Jul 2007 00:13:48 +0200 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <200707111838.15527.farmatito@tiscali.it> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> <200707111838.15527.farmatito@tiscali.it> Message-ID: <20070711221348.GA4096@aon.at> On Wed, Jul 11, 2007 at 06:38:15PM +0200, Tito wrote: >On Wednesday 11 July 2007 13:48:52 Alex Landau wrote: >> >> Tito wrote: Hi, >> this series of 7 patches is a first attempt to add an ioctl api to libbb >> and to use it in all applets where: >> >> if ( ioctl() < 0 [!= 0]) >> bb_perror_msg{and_die}(); >> >> or similar code is used. >> [snip] >> >> Critics, hints and help from the list is as always welcome. >> >> Ciao, >> Tito >> >> Hi, >> It looks really nice, only eye-tested though. >> One small comment: ioctl(...) != 0 doesn't mean it's an error. the ioctl() may return a positive value, >> so I'd better have an ioctl(...) < 0 test. Especially when you return ret afterwards. >> Regards, >> Alex >> >Hi, >I know but i'm pretty sure that in all places in busybox where this test was used >[ !=0 ] it errored out, i double checked it, but nonetheless maybe its a good idea >to change it to [ < 0 ] to be more coherent with the original ioctl call. >So attached is a fixed patch. checking for != 0 is imho not a good idea as opposed to <0. The idea is sound in my POV, i didn't have a chance to review it, though (vda should be back RSN, so i hope he can take care of it). Thanks for looking into these! cheers, From vda.linux at googlemail.com Wed Jul 11 16:08:01 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 12 Jul 2007 01:08:01 +0200 Subject: bash vs. ash, [ ! a = b ] vs. [ a != b ] In-Reply-To: <20070705163818.GI2424@sovereign.org> References: <20070705163818.GI2424@sovereign.org> Message-ID: <200707112308.01956.vda.linux@googlemail.com> On Thursday 05 July 2007 16:38, Jim Freeman wrote: > powerpc, busybox 1.6.0 > > There is a discrepency (== error?) in ash's handling of the following: > > ash > === > # [ ! a = b ] > # echo $? > 1 > > # [ a != b ] > # echo $? > 0 Does it work in 1.6.1? For me it works (on i386). -- vda From vda.linux at googlemail.com Wed Jul 11 17:04:38 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 12 Jul 2007 02:04:38 +0200 Subject: r18727 broke fdisk In-Reply-To: <20070708103849.GF4096@aon.at> References: <20070708103849.GF4096@aon.at> Message-ID: <200707120004.38689.vda.linux@googlemail.com> On Sunday 08 July 2007 10:38, Bernhard Fischer wrote: > vda, > > util-linux/fdisk.c: In function 'seek_sector': > util-linux/fdisk.c:641: warning: implicit declaration of function 'lseek64' > util-linux/fdisk.c:641: error: 'off64_t' undeclared (first use in this function) > util-linux/fdisk.c:641: error: (Each undeclared identifier is reported only once > util-linux/fdisk.c:641: error: for each function it appears in.) > util-linux/fdisk.c:641: error: expected ')' before 'secno' > make[2]: *** [util-linux/fdisk.o] Error 1 > make[1]: *** [util-linux] Error 2 > > If LFS is off, then there really is no lseek64. Please revert. I tested both. On my glibc it works. I suppose it (maybe incorrectly) provides lseek64 even without "#define _LARGEFILE64_SOURCE". Can you test whether fdisk.c compiles with LFS unset but with #define _LARGEFILE64_SOURCE added to the top of fdisk.c? -- vda From genepi at sympatico.ca Wed Jul 11 17:39:38 2007 From: genepi at sympatico.ca (Pierre =?iso-8859-1?q?M=E9tras?=) Date: Wed, 11 Jul 2007 20:39:38 -0400 Subject: [PATCH] - Take 2: Adds support for custom error pages in httpd Message-ID: <200707112039.38790.genepi@sympatico.ca> Hi, As recommended by Walter Harms, this version of the patch uses xasprintf() instead of malloc()/strcpy()/strcat(). The final size of the binary is even smaller: 324 bytes instead of 388 bytes with the previous patch. make bloatcheck function old new delta parse_conf 1201 1372 +171 sendHeaders 461 571 +110 sendFile 252 317 +65 httpResponseNames 108 144 +36 handleIncoming 2032 2038 +6 .rodata 138727 138663 -64 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/1 up/down: 388/-64) Total: 324 bytes text data bss dec hex filename 636180 3124 12800 652104 9f348 busybox_old 636525 3288 12800 652613 9f545 busybox_unstripped -- Pierre M?tras -------------- next part -------------- A non-text attachment was scrubbed... Name: httpd_with_error_pages.patch Type: text/x-diff Size: 10754 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070711/ceae4975/attachment-0001.bin From Jlau at extremenetworks.com Wed Jul 11 18:02:54 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Wed, 11 Jul 2007 18:02:54 -0700 Subject: bash vs. ash, [ ! a = b ] vs. [ a != b ] Message-ID: <888459D4AEE6464381B30398101F42F8043FC318@sc-msexch-06.extremenetworks.com> BB 1.6.1 coreutils/test.c fixed this problem which occurred on BB 1.6.0 -Joe -----Original Message----- From: busybox-bounces at busybox.net [mailto:busybox-bounces at busybox.net]On Behalf Of Denis Vlasenko Sent: Wednesday, July 11, 2007 4:08 PM To: busybox at busybox.net Subject: Re: bash vs. ash, [ ! a = b ] vs. [ a != b ] On Thursday 05 July 2007 16:38, Jim Freeman wrote: > powerpc, busybox 1.6.0 > > There is a discrepency (== error?) in ash's handling of the following: > > ash > === > # [ ! a = b ] > # echo $? > 1 > > # [ a != b ] > # echo $? > 0 Does it work in 1.6.1? For me it works (on i386). -- vda _______________________________________________ busybox mailing list busybox at busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox From jfree at sovereign.org Wed Jul 11 21:44:14 2007 From: jfree at sovereign.org (Jim Freeman) Date: Wed, 11 Jul 2007 22:44:14 -0600 Subject: bash vs. ash, [ ! a = b ] vs. [ a != b ] In-Reply-To: <200707112308.01956.vda.linux@googlemail.com> References: <20070705163818.GI2424@sovereign.org> <200707112308.01956.vda.linux@googlemail.com> Message-ID: <20070712044414.GA14901@sovereign.org> On Thu, Jul 12, 2007 at 01:08:01AM +0200, Denis Vlasenko wrote: > On Thursday 05 July 2007 16:38, Jim Freeman wrote: > > powerpc, busybox 1.6.0 > > > > There is a discrepency (== error?) in ash's handling of the following: > > > > ash > > === > > # [ ! a = b ] > > # echo $? > > 1 > > > > # [ a != b ] > > # echo $? > > 0 > > Does it work in 1.6.1? For me it works (on i386). > -- > vda And 1.6.1 works on powerpc - thanks! From marc.leeman at gmail.com Thu Jul 12 00:48:31 2007 From: marc.leeman at gmail.com (Marc Leeman) Date: Thu, 12 Jul 2007 09:48:31 +0200 Subject: devmem2 In-Reply-To: <20070711220624.GZ4096@aon.at> References: <20070711131126.GZ2660@chiana.homelinux.org> <20070711220624.GZ4096@aon.at> Message-ID: <20070712074831.GE2660@chiana.homelinux.org> > It isn't in the util-linux package, is it? Perhaps miscutils would be a > better place. > > Generally it looks really whitespace damaged, run (from toplevel) > indent */devmem2.c, please. I more or less left the *.c file as it was upstream, but I'll use your comments in the next patch version. -- greetz, marc Human. It's kinda like Sebacean, but we haven't conquered other worlds yet, so we just kick the crap out of each other. Crichton - PK Tech Girl chiana 2.6.18-4-ixp4xx #1 Tue Mar 27 18:01:56 BST 2007 GNU/Linux -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://busybox.net/lists/busybox/attachments/20070712/d7d88045/attachment.pgp From wharms at bfs.de Thu Jul 12 00:59:00 2007 From: wharms at bfs.de (walter harms) Date: Thu, 12 Jul 2007 09:59:00 +0200 Subject: How to change the Timezone In-Reply-To: <200707111516.00391.vapier@gentoo.org> References: <200707061909.37818.vda.linux@googlemail.com> <4694F62E.40006@bfs.de> <200707111516.00391.vapier@gentoo.org> Message-ID: <4695DF44.8030202@bfs.de> Mike Frysinger wrote: > On Wednesday 11 July 2007, walter harms wrote: >> perhaps this Question & Answer should go the the FAQ ? > > it isnt a busybox thing > -mike this is true, ntl the problem will show up every time when someone is using 'date' in BB, so he will ask the bb ML. And it becomes a problem when you consider the difference between glibc and ulibc. So it would be helpful at least. re, wh From david.holm at zetadisplay.com Thu Jul 12 01:51:46 2007 From: david.holm at zetadisplay.com (david.holm at zetadisplay.com) Date: Thu, 12 Jul 2007 08:51:46 +0000 (GMT) Subject: [Copfilter] Copy of quarantined email - *** SPAM *** [6.5/6.0] [PATCH 5/7] bb_ioctl implementation Message-ID: <704235.002954619-sendEmail@ipcop> This is the bb_ioctl patch for miscutils/hdparm. Ciao, Tito _______________________________________________ busybox mailing list busybox at busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox From natanael.copa at gmail.com Thu Jul 12 07:35:01 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Thu, 12 Jul 2007 16:35:01 +0200 Subject: [PATCH] vi read-only mode bugfix and enhancement Message-ID: <1184250901.2150.49.camel@localhost> Hi, Attatched is a patch that will fix a bug in vi, enhance functionality a bit, reduce size and make the code a bit more readable. Testcase follows. echo "this file is readonly" > file1 chmod 400 file1 sudo chown root file Before patch: ./busybox_old vi file1 File is empty (user has no read permissions) and statusline says: - file1 1/1 100% Note that there is no indication of error or [Read-only] After patch: ./busybox vi file1 File is still empty (user has no read permissions) but status line says: - file1 [Read-only] 1/1 100% Original vim shows "permission denied" but "Read-only" is better than nothing. Try edit file and save as root. Old behaviour let user do this even if file is write protected. After patch file will be marked as [Read-only]. root will need to save file with :wq! Make bloatcheck: function old new delta update_ro_status - 86 +86 edit_file 921 919 -2 colon 3798 3778 -20 file_insert 336 260 -76 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/3 up/down: 86/-98) Total: -12 bytes text data bss dec hex filename 706447 4728 14528 725703 b12c7 busybox_old 706439 4728 14528 725695 b12bf busybox_unstripped Natanael Copa -------------- next part -------------- A non-text attachment was scrubbed... Name: vi-readonly-fix.patch Type: text/x-patch Size: 4736 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070712/805f0afa/attachment.bin From Nikolay.Yevik at Halliburton.com Thu Jul 12 08:33:34 2007 From: Nikolay.Yevik at Halliburton.com (Nikolay Yevik) Date: Thu, 12 Jul 2007 10:33:34 -0500 Subject: Major improvements to RPM In-Reply-To: <466F0783.9040601@inode.at> References: <20070609105754.128516586@warmcat.com> <20070609110048.499373233@warmcat.com> <200706100220.16200.vda.linux@googlemail.com> <466C2F2B.9040708@warmcat.com><466E9FE5.8030307@warmcat.com> <466F0783.9040601@inode.at> Message-ID: <3FA34846740FF448A01F5B48A52C014F03F4FFD8@HOUEXCH078.corp.halliburton.com> Greetings, I have compiled Andy Green's RPM improvements for BusyBox 1.7.0 using both SnapGear as well BuildRoot toolchains. Functionally, it performs most of the tasks I need. I think an "improvement" is not a correct word for Andy's changes. Without them rpm as it comes with BusyBox is pretty much useless. With his changes rpm provides at least basic functionality needed to effectively use RPMs. I hope Andy's changes will be incorporated in the current release. -----Original Message----- From: busybox-bounces at busybox.net [mailto:busybox-bounces at busybox.net] On Behalf Of Steve M. Sent: Tuesday, June 12, 2007 3:52 PM To: Andy Green Cc: busybox at busybox.net Subject: Re: [PATCH Try#2 3/3] Major improvements to RPM Hi folks, I built a version from current svn with that patch (the #3) and it worked ok in a short test. During compilation I got these warnings: archival/rpm.c:79: warning: initialization discards qualifiers from pointer target type archival/rpm.c:268: warning: no previous prototype for 'rpm_construct_scan_state' archival/rpm.c:272: warning: no previous prototype for 'rpm_destruct_scan_state' archival/rpm.c: In function 'DoInstallEraseUpdateSeqences': archival/rpm.c:679: warning: declaration of 'sz' shadows a previous local archival/rpm.c:552: warning: shadowed declaration is here archival/rpm.c: In function 'DoQueryListFiles': archival/rpm.c:1080: warning: declaration of 'pszRoot' shadows a global declaration archival/rpm.c:79: warning: shadowed declaration is here archival/rpm.c: At top level: archival/rpm.c:1179: warning: no previous prototype for 'rpm_main' archival/rpm.c: In function 'rpm_main': archival/rpm.c:1192: warning: ISO C90 forbids mixed declarations and code archival/rpm.c: In function 'extract_cpio_gz': archival/rpm.c:1747: warning: passing argument 2 of 'rpm_open_transformer' from incompatible pointer type archival/rpm.c: At top level: archival/rpm.c:300: warning: 'exec_script' declared 'static' but never defined archival/rpm.c:1999: warning: 'fileaction_list' defined but not used archival/rpm.c:520: warning: 'PrintDependency' defined but not used I also have a general question about that. At line 79 the following is declared: static char *pszRoot, *szEmpty = ""; szEmpty is only used once for if(defaultPath) pszRoot = szEmpty; else pszRoot = specifiedPath; Is there a benefit from using szEmpty instead of simply doing pszRoot = ""; ? Greetings, Steve M. _______________________________________________ busybox mailing list busybox at busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox ---------------------------------------------------------------------- This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message. From dallas.a.clement at gmail.com Thu Jul 12 06:49:26 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Thu, 12 Jul 2007 08:49:26 -0500 Subject: Help using 'dpkg' command to install debian packages Message-ID: <1184248166.3662.4.camel@localhost> Hello All, I need some help understanding how the busybox 'dpkg -i' command works. Specifically, I would like to know how the mechanism for checking debian package dependencies works. I'd like to know what essential files are needed to do the checking. I've built a few packages and tried to install them. Those with dependencies are failing to install for some reason. Here is my scenario: I built a binary libc6-i386.deb package on my Debian host and installed it on another host which has nothing but a bare Linux 2.6.21.1 kernel and a static busybox 1.6.0 installed. I used the busybox 'dpkg' command to install the package. Everything went fine and the output of the 'dpkg -l' command is: Name Version +++-=============-============== ii libc6-i386 2.3.6 After this, I built a busybox package to re-install the full busybox implementation on to my target host. This package is dependent on libc6-i386 as can be seen from the 'dpkg --info' command: dallas at debian:~/packages$ dpkg --info busybox_1.6.0-1_i386.deb new debian package, version 2.0. size 233752 bytes: control archive= 619 bytes. 444 bytes, 12 lines control 258 bytes, 4 lines md5sums Package: busybox Version: 1.6.0-1 Section: unknown Priority: extra Architecture: i386 Depends: libc6-i386 (>= 2.3.5-1) Installed-Size: 436 Maintainer: Dallas Clement Description: Busybox UNIX command utilities. BusyBox combines tiny versions of many common UNIX utilities into \ a single small executable. It provides replacements for most of the \ utilities you usually find in GNU fileutils, shellutils, etc. When I try to install this package, it fails during the installation. This is the error I get: dpkg: package busybox depends on libc6-i386, which is not installed or flagged to be installed I cannot understand why I am getting this error, when clearly the libc6-i386 package is installed as you can see from the previous 'dpkg -l' output. In fact, the contents of the /var/lib/dpkg/status file are as follows: cat /var/lib/dpkg/status Package: libc6-i386 Version: 2.3.6 Section: libs Priority: required Architecture: i386 Maintainer: Dallas Clement Description: The GNU C library The GNU C library is the standard C/C++ library \ needed to support most Linux applications. Status: install ok installed ---- Clearly, the libc6-i386 package is installed. Is there anything else that 'dpkg' checks other than this 'status' file to do the dependency check? Is it just a simple package name check, or is there more involved? Any insight you could provide will be greatly appreciated! I'm at my wit's end trying to get this to work. From hamish at cloud.net.au Thu Jul 12 15:23:55 2007 From: hamish at cloud.net.au (Hamish Moffatt) Date: Fri, 13 Jul 2007 08:23:55 +1000 Subject: Help using 'dpkg' command to install debian packages In-Reply-To: <1184248166.3662.4.camel@localhost> References: <1184248166.3662.4.camel@localhost> Message-ID: <20070712222355.GC20354@cloud.net.au> On Thu, Jul 12, 2007 at 08:49:26AM -0500, Dallas Clement wrote: > Here is my scenario: > > I built a binary libc6-i386.deb package on my Debian host and installed > it on another host which has nothing but a bare Linux 2.6.21.1 kernel > and a static busybox 1.6.0 installed. I used the busybox 'dpkg' command > to install the package. Everything went fine and the output of the 'dpkg > -l' command is: [...] > When I try to install this package, it fails during the installation. > This is the error I get: > > dpkg: package busybox depends on libc6-i386, which is not installed or > flagged to be installed > > > I cannot understand why I am getting this error, when clearly the > libc6-i386 package is installed as you can see from the previous 'dpkg > -l' output. [...] > Clearly, the libc6-i386 package is installed. > > Is there anything else that 'dpkg' checks other than this 'status' file > to do the dependency check? Is it just a simple package name check, or > is there more involved? > > Any insight you could provide will be greatly appreciated! I'm at my > wit's end trying to get this to work. It looks like you are doing the right thing to me, ie if you were using the real dpkg I believe it would work. Perhaps busybox's emulation is buggy. Hamish -- Hamish Moffatt VK3SB From dallas.a.clement at gmail.com Thu Jul 12 10:45:43 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Thu, 12 Jul 2007 12:45:43 -0500 Subject: Help using 'dpkg' command to install debian packages In-Reply-To: <20070712222355.GC20354@cloud.net.au> References: <1184248166.3662.4.camel@localhost> <20070712222355.GC20354@cloud.net.au> Message-ID: <1184262343.3662.26.camel@localhost> On Fri, 2007-07-13 at 08:23 +1000, Hamish Moffatt wrote: > On Thu, Jul 12, 2007 at 08:49:26AM -0500, Dallas Clement wrote: > > Here is my scenario: > > > > I built a binary libc6-i386.deb package on my Debian host and installed > > it on another host which has nothing but a bare Linux 2.6.21.1 kernel > > and a static busybox 1.6.0 installed. I used the busybox 'dpkg' command > > to install the package. Everything went fine and the output of the 'dpkg > > -l' command is: > > [...] > > > When I try to install this package, it fails during the installation. > > This is the error I get: > > > > dpkg: package busybox depends on libc6-i386, which is not installed or > > flagged to be installed > > > > > > I cannot understand why I am getting this error, when clearly the > > libc6-i386 package is installed as you can see from the previous 'dpkg > > -l' output. > [...] > > > Clearly, the libc6-i386 package is installed. > > > > Is there anything else that 'dpkg' checks other than this 'status' file > > to do the dependency check? Is it just a simple package name check, or > > is there more involved? > > > > Any insight you could provide will be greatly appreciated! I'm at my > > wit's end trying to get this to work. > > It looks like you are doing the right thing to me, ie if you were using > the real dpkg I believe it would work. Perhaps busybox's emulation is > buggy. > > Hamish I think you're right - must be buggy. Though, what I am doing seems so simple!! I'm looking at the file dpkg.c now and putting in some debug messages to see why it is behaving this way. Cheers, Dallas From vapier at gentoo.org Thu Jul 12 16:54:13 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Thu, 12 Jul 2007 19:54:13 -0400 Subject: How to change the Timezone In-Reply-To: <4695DF44.8030202@bfs.de> References: <200707111516.00391.vapier@gentoo.org> <4695DF44.8030202@bfs.de> Message-ID: <200707121954.14012.vapier@gentoo.org> On Thursday 12 July 2007, walter harms wrote: > Mike Frysinger wrote: > > On Wednesday 11 July 2007, walter harms wrote: > >> perhaps this Question & Answer should go the the FAQ ? > > > > it isnt a busybox thing > > this is true, ntl the problem will show up every time when someone is using > 'date' in BB, it will show up every time `date` is used whether it is from busybox or coreutils or ... the question really is, how much non-busybox but low level Linux things do we document considering many people dont understand where busybox ends and other things begin. especially considering this information can differ based on distribution or the user's custom build. -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/20070712/1abfda6a/attachment.pgp From natanael.copa at gmail.com Thu Jul 12 23:11:45 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Fri, 13 Jul 2007 08:11:45 +0200 Subject: How to change the Timezone In-Reply-To: <200707121954.14012.vapier@gentoo.org> References: <200707111516.00391.vapier@gentoo.org> <4695DF44.8030202@bfs.de> <200707121954.14012.vapier@gentoo.org> Message-ID: <1184307105.27327.8.camel@localhost> On Thu, 2007-07-12 at 19:54 -0400, Mike Frysinger wrote: > On Thursday 12 July 2007, walter harms wrote: > > Mike Frysinger wrote: > > > On Wednesday 11 July 2007, walter harms wrote: > > >> perhaps this Question & Answer should go the the FAQ ? > > > > > > it isnt a busybox thing > > > > this is true, ntl the problem will show up every time when someone is using > > 'date' in BB, > > it will show up every time `date` is used whether it is from busybox or > coreutils or ... the question really is, how much non-busybox but low level > Linux things do we document considering many people dont understand where > busybox ends and other things begin. especially considering this information > can differ based on distribution or the user's custom build. Since its is a frequently asked question, I think it could go there. But instead of telling ppl how to solve it, point them to the libc docs. Q: How do I change the time zone in busybox? A: Busybox has nothing to do with the timezone. Please consult your libc documentation. (http://google.com/search?q=uclibc+glibc+timezone) Natanael From wharms at bfs.de Fri Jul 13 00:48:47 2007 From: wharms at bfs.de (walter harms) Date: Fri, 13 Jul 2007 09:48:47 +0200 Subject: How to change the Timezone In-Reply-To: <1184307105.27327.8.camel@localhost> References: <200707111516.00391.vapier@gentoo.org> <4695DF44.8030202@bfs.de> <200707121954.14012.vapier@gentoo.org> <1184307105.27327.8.camel@localhost> Message-ID: <46972E5F.5060303@bfs.de> Natanael Copa wrote: > On Thu, 2007-07-12 at 19:54 -0400, Mike Frysinger wrote: >> On Thursday 12 July 2007, walter harms wrote: >>> Mike Frysinger wrote: >>>> On Wednesday 11 July 2007, walter harms wrote: >>>>> perhaps this Question & Answer should go the the FAQ ? >>>> it isnt a busybox thing >>> this is true, ntl the problem will show up every time when someone is using >>> 'date' in BB, >> it will show up every time `date` is used whether it is from busybox or >> coreutils or ... the question really is, how much non-busybox but low level >> Linux things do we document considering many people dont understand where >> busybox ends and other things begin. especially considering this information >> can differ based on distribution or the user's custom build. > > Since its is a frequently asked question, I think it could go there. But > instead of telling ppl how to solve it, point them to the libc docs. > > Q: How do I change the time zone in busybox? > A: Busybox has nothing to do with the timezone. Please consult your libc > documentation. (http://google.com/search?q=uclibc+glibc+timezone) > > This has the advantage, that changes will come automatic. Ntl we had a full blown solution and it is easy to add. That leaves one important question WHO will add the sentence ? re, wh > From Stefan.Farnik at swarovski.com Fri Jul 13 00:52:33 2007 From: Stefan.Farnik at swarovski.com (Farnik Stefan) Date: Fri, 13 Jul 2007 09:52:33 +0200 Subject: Link Applet against ncurses Message-ID: <4E82E78083C07947A4F80214C130499E0AC7A4@dsw171.wattens.swarovski.com> Hi there, maybe you can help me. How can I link an applet (using busybox-1.4.2) statically against ncurses? Where do I configure this? There aren't hints for this in Kbuild or something else. Or should I linky complete busybox instead against ncurses? (How to do this?) Thank you! Stefan From ross.cameron at linuxpro.co.za Fri Jul 13 02:08:08 2007 From: ross.cameron at linuxpro.co.za (Ross Cameron) Date: Fri, 13 Jul 2007 11:08:08 +0200 Subject: Link Applet against ncurses In-Reply-To: <4E82E78083C07947A4F80214C130499E0AC7A4@dsw171.wattens.swarovski.com> References: <4E82E78083C07947A4F80214C130499E0AC7A4@dsw171.wattens.swarovski.com> Message-ID: <35f70db10707130208o3737f72dj9167fa3fc14ee7a1@mail.gmail.com> The busybox applets all combine and are delivered as a single binary that is called via symlinks,... using argv[0] to figure out which applet to call. Therefor,... by that logic I would think that linking busybox as a whole against ncurses will do what you need. Not 100% sure,... just a guess On 13/07/07, Farnik Stefan wrote: > Hi there, > > maybe you can help me. > > How can I link an applet (using busybox-1.4.2) statically against ncurses? > Where do I configure this? There aren't hints for this in Kbuild or something else. > > Or should I linky complete busybox instead against ncurses? (How to do this?) > > Thank you! > > Stefan > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > From ralphs at netwinder.org Fri Jul 13 06:42:47 2007 From: ralphs at netwinder.org (Ralph Siemsen) Date: Fri, 13 Jul 2007 09:42:47 -0400 Subject: gcc 4.x and soft-float, -mfloat-api Message-ID: <20070713134247.GA27719@marvin.netwinder.org> Short: The gcc -mfloat-abi option should only be passed for ARM builds unless I am mis-reading the gcc documentation... Long: When I build a toolchain for powerpc with buildroot (current SVN) this results in a compiler that doesn't accept -mfloat-abi option: # $(STAGING_DIR)/usr/bin/powerpc-linux-uclibc-gcc --version powerpc-linux-uclibc-gcc (GCC) 4.2.0 Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # $(STAGING_DIR)/usr/bin/powerpc-linux-uclibc-gcc -mfloat-abi test.c cc1: error: unrecognized command line option "-mfloat-abi" The failure is observed while compiling openssl. Its makefile does: $(SED) 's,/CFLAG=,/CFLAG= $(TARGET_SOFT_FLOAT) ,g' \ $(OPENSSL_DIR)/Configure where TARGET_SOFT_FLOAT comes from toolchain/gcc/Makefile.in: ifeq ($(findstring x4.,x$(GCC_VERSION)),x4.) SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft ifeq ($(BR2_SOFT_FLOAT_FP),y) TARGET_SOFT_FLOAT:=-mfloat-abi=softfp else # no fp at all TARGET_SOFT_FLOAT:=-mfloat-abi=soft #endif else # not gcc-4.x TARGET_SOFT_FLOAT:=-msoft-float endif So if using gcc4x then -mfloat-abi is passed unconditionally. (And, because BR2_SOFT_FLOAT_FP is commented out in Config.in, the value "soft" is always chosen, never "softfp", but that's not my issue at the moment). I believe the gcc4 check in toolchain/gcc/Makefile.in should only set the -mfloat-abi for ARM architecture. I can try cobbling together a patch for this, but as I am not entirely sure it is the right answer, I thought I'd get some feedback first. Thanks, -R From ralphs at netwinder.org Fri Jul 13 06:51:22 2007 From: ralphs at netwinder.org (Ralph Siemsen) Date: Fri, 13 Jul 2007 09:51:22 -0400 Subject: gcc 4.x and soft-float, -mfloat-api In-Reply-To: <20070713134247.GA27719@marvin.netwinder.org> References: <20070713134247.GA27719@marvin.netwinder.org> Message-ID: <20070713135122.GA27875@marvin.netwinder.org> Oops, I meant to post this to buildroot list, sorry! Please ignore it here! -R On Fri, Jul 13, 2007 at 09:42:47AM -0400, Ralph Siemsen wrote: > > Short: > > The gcc -mfloat-abi option should only be passed for ARM builds > unless I am mis-reading the gcc documentation... > > Long: > > When I build a toolchain for powerpc with buildroot (current SVN) > this results in a compiler that doesn't accept -mfloat-abi option: > > # $(STAGING_DIR)/usr/bin/powerpc-linux-uclibc-gcc --version > powerpc-linux-uclibc-gcc (GCC) 4.2.0 > Copyright (C) 2007 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > # $(STAGING_DIR)/usr/bin/powerpc-linux-uclibc-gcc -mfloat-abi test.c > cc1: error: unrecognized command line option "-mfloat-abi" > > The failure is observed while compiling openssl. Its makefile does: > $(SED) 's,/CFLAG=,/CFLAG= $(TARGET_SOFT_FLOAT) ,g' \ > $(OPENSSL_DIR)/Configure > where TARGET_SOFT_FLOAT comes from toolchain/gcc/Makefile.in: > ifeq ($(findstring x4.,x$(GCC_VERSION)),x4.) > SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft > ifeq ($(BR2_SOFT_FLOAT_FP),y) > TARGET_SOFT_FLOAT:=-mfloat-abi=softfp > else # no fp at all > TARGET_SOFT_FLOAT:=-mfloat-abi=soft > #endif > else # not gcc-4.x > TARGET_SOFT_FLOAT:=-msoft-float > endif > > So if using gcc4x then -mfloat-abi is passed unconditionally. > (And, because BR2_SOFT_FLOAT_FP is commented out in Config.in, > the value "soft" is always chosen, never "softfp", but that's > not my issue at the moment). > > I believe the gcc4 check in toolchain/gcc/Makefile.in should > only set the -mfloat-abi for ARM architecture. I can try cobbling > together a patch for this, but as I am not entirely sure it is > the right answer, I thought I'd get some feedback first. > > Thanks, > -R From simon at alcove.fr Fri Jul 13 07:07:59 2007 From: simon at alcove.fr (simon at alcove.fr) Date: Fri, 13 Jul 2007 16:07:59 +0200 (CEST) Subject: libbusybox.so Message-ID: <29287.62.39.9.251.1184335679.squirrel@webmail.alcove.fr> Hello, I've download the last stable busybox release (1.6.1) and i'm trying to build the shared library libbusybox.so. But it seems the shared library support has been removed from recents versions... the option is still present in the configuration interface but not used by the Makefile scripts... Is the busybox shared library always supported ? Thanks by advance for help. Simon From vda.linux at googlemail.com Fri Jul 13 08:21:29 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Fri, 13 Jul 2007 16:21:29 +0100 Subject: How to change the Timezone In-Reply-To: <46972E5F.5060303@bfs.de> References: <1184307105.27327.8.camel@localhost> <46972E5F.5060303@bfs.de> Message-ID: <200707131621.29218.vda.linux@googlemail.com> On Friday 13 July 2007 08:48, walter harms wrote: > Natanael Copa wrote: > > On Thu, 2007-07-12 at 19:54 -0400, Mike Frysinger wrote: > >> On Thursday 12 July 2007, walter harms wrote: > >>> Mike Frysinger wrote: > >>>> On Wednesday 11 July 2007, walter harms wrote: > >>>>> perhaps this Question & Answer should go the the FAQ ? > >>>> > >>>> it isnt a busybox thing > >>> > >>> this is true, ntl the problem will show up every time when someone is > >>> using 'date' in BB, > >> > >> it will show up every time `date` is used whether it is from busybox or > >> coreutils or ... the question really is, how much non-busybox but low > >> level Linux things do we document considering many people dont > >> understand where busybox ends and other things begin. especially > >> considering this information can differ based on distribution or the > >> user's custom build. > > > > Since its is a frequently asked question, I think it could go there. But > > instead of telling ppl how to solve it, point them to the libc docs. > > > > Q: How do I change the time zone in busybox? > > A: Busybox has nothing to do with the timezone. Please consult your libc > > documentation. (http://google.com/search?q=uclibc+glibc+timezone) > > This has the advantage, that changes will come automatic. Ntl we had a full > blown solution and it is easy to add. > > That leaves one important question WHO will add the sentence ? Committed to svn. Thanks. -- vda From vda.linux at googlemail.com Fri Jul 13 08:57:25 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Fri, 13 Jul 2007 16:57:25 +0100 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: <1184250901.2150.49.camel@localhost> References: <1184250901.2150.49.camel@localhost> Message-ID: <200707131657.26004.vda.linux@googlemail.com> Hi, On Thursday 12 July 2007 15:35, Natanael Copa wrote: > Attatched is a patch that will fix a bug in vi, enhance functionality a > bit, reduce size and make the code a bit more readable. Testcase > follows. > > echo "this file is readonly" > file1 > chmod 400 file1 > sudo chown root file > > Before patch: > > ./busybox_old vi file1 > > File is empty (user has no read permissions) and statusline says: > > - file1 1/1 100% > > Note that there is no indication of error or [Read-only] > > After patch: > > ./busybox vi file1 > > File is still empty (user has no read permissions) but status line says: > > - file1 [Read-only] 1/1 100% > > Original vim shows "permission denied" but "Read-only" is better than > nothing. Nice. Any chance getting "[Read failed]" (or whatever non-puzzling msg) so we don't need to return to this once more? > Try edit file and save as root. Old behaviour let user do this even if > file is write protected. > > After patch file will be marked as [Read-only]. root will need to save > file with :wq! Is this feature important? I ask because it costs a few bytes in code size here if I understand it right: +static void update_ro_status(const char *fn) { + struct stat sb; + if (stat(fn, &sb) == 0) { + readonly = vi_readonly || (access(fn, W_OK) < 0) || + /* root will always have access() + * so we check fileperms too */ + !(sb.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)); + } +} Small simplification here: +USE_FEATURE_VI_READONLY(static void update_ro_status(const char *)); static int file_write(char *, char *, char *); static void place_cursor(int, int, int); static void screen_erase(void); @@ -419,8 +420,9 @@ new_text(size); // get a text[] buffer screenbegin = dot = end = text; if (fn != 0) { - ch = file_insert(fn, text, cnt); - } + ch = file_insert(fn, text); + USE_FEATURE_VI_READONLY(update_ro_status(fn)); + } Use: #if FEATURE_VI_READONLY static void update_ro_status(const char *); #else static ALWAYS_INLINE void update_ro_status(const char *name) {} #endif and call sites don't need USE_FEATURE_VI_READONLY(...) anymore. Looks better. Care to do version 2? -- vda From wadehamptoniv at gmail.com Fri Jul 13 09:52:34 2007 From: wadehamptoniv at gmail.com (Wade Hampton) Date: Fri, 13 Jul 2007 12:52:34 -0400 Subject: Failure to mount NFS using Busybox Message-ID: <7a57ad2a0707130952m2f80ffbej62bceb55a469eb4f@mail.gmail.com> G'day, I am trying to use busybox in an initrd for system install/reinstall. The O/S is CentOS 5. My initrd is trying to mount a backup server using NFS, but fails with "No such device". O/S: CentOS 5.0 with updates, 2.6.18-8.1.1.el5 kernel Busybox: 1.2.0-3.el5 Same O/S for server and client. This works on a booted system: mkdir /mnt/tmp /sbin/busybox mount 10.1.2.3:/data -t nfs -o ro,hard,intr /mnt/tmp In the initrd this fails: mkdir -p /mnt/tmp mount 10.1.2.3:/data -t nfs -o ro,hard,intr /mnt/tmp Both have the exact same kernel and exact same busybox. I verified that the IP addresses are not an issue. I have tried adding rsize=1024,wsize=1024 and other mount options but still get the same error. Note, I tried making busybox 1.6.1 static but it fails with "static linking against glibc...". Should I make a static busybox 1.6.1 using uLibc and test that? If so, is there a simple way of doing this (the last time I did this was busybox 0.6 and lots have changed). Such instructions would be nice for the FAQ. Thanks, -- Wade Hampton From Jlau at extremenetworks.com Fri Jul 13 13:45:43 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Fri, 13 Jul 2007 13:45:43 -0700 Subject: no echo on shell Message-ID: <888459D4AEE6464381B30398101F42F8043FC327@sc-msexch-06.extremenetworks.com> On Busybox 1.6.1 (more often) and 1.6.0, the shell (sh) can get into a mode where it does not echo back the command that the user has entered. The output from the command looks fine. Has anyone run into this problem? Thanks! -Joe From dallas.a.clement at gmail.com Fri Jul 13 09:23:36 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Fri, 13 Jul 2007 11:23:36 -0500 Subject: Help using 'dpkg' command to install debian packages In-Reply-To: <20070712222355.GC20354@cloud.net.au> References: <1184248166.3662.4.camel@localhost> <20070712222355.GC20354@cloud.net.au> Message-ID: <1184343816.3483.4.camel@localhost> On Fri, 2007-07-13 at 08:23 +1000, Hamish Moffatt wrote: > On Thu, Jul 12, 2007 at 08:49:26AM -0500, Dallas Clement wrote: > > Here is my scenario: > > > > I built a binary libc6-i386.deb package on my Debian host and installed > > it on another host which has nothing but a bare Linux 2.6.21.1 kernel > > and a static busybox 1.6.0 installed. I used the busybox 'dpkg' command > > to install the package. Everything went fine and the output of the 'dpkg > > -l' command is: > > [...] > > > When I try to install this package, it fails during the installation. > > This is the error I get: > > > > dpkg: package busybox depends on libc6-i386, which is not installed or > > flagged to be installed > > > > > > I cannot understand why I am getting this error, when clearly the > > libc6-i386 package is installed as you can see from the previous 'dpkg > > -l' output. > [...] > > > Clearly, the libc6-i386 package is installed. > > > > Is there anything else that 'dpkg' checks other than this 'status' file > > to do the dependency check? Is it just a simple package name check, or > > is there more involved? > > > > Any insight you could provide will be greatly appreciated! I'm at my > > wit's end trying to get this to work. > > It looks like you are doing the right thing to me, ie if you were using > the real dpkg I believe it would work. Perhaps busybox's emulation is > buggy. > > Hamish I have confirmed that the busybox 'dpkg' command is indeed buggy. It is not checking dependencies correctly. I wasn't able to pinpoint the exact location in the source code for the problem I reported earlier. The code is not exactly easy reading. I download the real dpkg source, built it and am using it instead. It works perfectly. From vapier at gentoo.org Fri Jul 13 13:03:12 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Fri, 13 Jul 2007 16:03:12 -0400 Subject: libbusybox.so In-Reply-To: <29287.62.39.9.251.1184335679.squirrel@webmail.alcove.fr> References: <29287.62.39.9.251.1184335679.squirrel@webmail.alcove.fr> Message-ID: <200707131603.12859.vapier@gentoo.org> On Friday 13 July 2007, simon at alcove.fr wrote: > I've download the last stable busybox release (1.6.1) and i'm trying to > build the shared library libbusybox.so. > But it seems the shared library support has been removed from recents > versions... the option is still present in the configuration interface but > not used by the Makefile scripts... > > Is the busybox shared library always supported ? it's still a dev-only thing not meant general use ... if you dont plan on hacking, dont plan on trying to use it ... -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/20070713/0a345382/attachment.pgp From vda.linux at googlemail.com Fri Jul 13 15:39:04 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 13 Jul 2007 22:39:04 +0000 Subject: Link Applet against ncurses In-Reply-To: <35f70db10707130208o3737f72dj9167fa3fc14ee7a1@mail.gmail.com> References: <4E82E78083C07947A4F80214C130499E0AC7A4@dsw171.wattens.swarovski.com> <35f70db10707130208o3737f72dj9167fa3fc14ee7a1@mail.gmail.com> Message-ID: <200707132239.04968.vda.linux@googlemail.com> On Friday 13 July 2007 09:08, Ross Cameron wrote: > The busybox applets all combine and are delivered as a single binary > that is called via symlinks,... using argv[0] to figure out which > applet to call. > > Therefor,... by that logic I would think that linking busybox as a > whole against ncurses will do what you need. > > Not 100% sure,... just a guess > > On 13/07/07, Farnik Stefan wrote: > > Hi there, > > > > maybe you can help me. > > > > How can I link an applet (using busybox-1.4.2) statically against ncurses? > > Where do I configure this? There aren't hints for this in Kbuild or something else. > > > > Or should I linky complete busybox instead against ncurses? (How to do this?) You need to link a program againt the library only if you are actually using something from the library. Unmodified bbox doesn't use ncurses, thus I don't understand why you want to link it against ncurses. Anyway, if you are modifying bbox so that it indeed needs ncurses now, then you can follow SELinux example in Makefile.flags: ifeq ($(CONFIG_SELINUX),y) LDLIBS += -lselinux -lsepol endif or you can modify scripts/trylink. -- vda From vda.linux at googlemail.com Fri Jul 13 15:42:29 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 13 Jul 2007 22:42:29 +0000 Subject: Failure to mount NFS using Busybox In-Reply-To: <7a57ad2a0707130952m2f80ffbej62bceb55a469eb4f@mail.gmail.com> References: <7a57ad2a0707130952m2f80ffbej62bceb55a469eb4f@mail.gmail.com> Message-ID: <200707132242.29868.vda.linux@googlemail.com> On Friday 13 July 2007 16:52, Wade Hampton wrote: > G'day, > > I am trying to use busybox in an initrd for system install/reinstall. > The O/S is CentOS 5. My initrd is trying to mount a backup server > using NFS, but fails with "No such device". Can you run it under strace? > O/S: CentOS 5.0 with updates, 2.6.18-8.1.1.el5 kernel > Busybox: 1.2.0-3.el5 > Same O/S for server and client. > > This works on a booted system: > mkdir /mnt/tmp > /sbin/busybox mount 10.1.2.3:/data -t nfs -o ro,hard,intr /mnt/tmp > > In the initrd this fails: > mkdir -p /mnt/tmp > mount 10.1.2.3:/data -t nfs -o ro,hard,intr /mnt/tmp > > Both have the exact same kernel and exact same busybox. I verified > that the IP addresses are not an issue. I have tried adding > rsize=1024,wsize=1024 and other mount options but still get the same > error. > > Note, I tried making busybox 1.6.1 static but it fails with "static > linking against glibc...". > > Should I make a static busybox 1.6.1 using uLibc and test that? If so, is > there a simple way of doing this (the last time I did this was busybox 0.6 > and lots have changed). Such instructions would be nice for the FAQ. I have uclibc cross compiler on my system: # ls /usr/bin/i486-linux-uclibc-* /usr/bin/i486-linux-uclibc-addr2line /usr/bin/i486-linux-uclibc-gcc /usr/bin/i486-linux-uclibc-objdump /usr/bin/i486-linux-uclibc-ar /usr/bin/i486-linux-uclibc-gcc-4.1.1 /usr/bin/i486-linux-uclibc-ranlib /usr/bin/i486-linux-uclibc-as /usr/bin/i486-linux-uclibc-gccbug /usr/bin/i486-linux-uclibc-readelf /usr/bin/i486-linux-uclibc-c++ /usr/bin/i486-linux-uclibc-gcov /usr/bin/i486-linux-uclibc-size /usr/bin/i486-linux-uclibc-c++filt /usr/bin/i486-linux-uclibc-ld /usr/bin/i486-linux-uclibc-strings /usr/bin/i486-linux-uclibc-cpp /usr/bin/i486-linux-uclibc-nm /usr/bin/i486-linux-uclibc-strip /usr/bin/i486-linux-uclibc-g++ /usr/bin/i486-linux-uclibc-objcopy And building against uclibc is done simply like this: export ARCH=i386 make CROSS_COMPILE=i486-linux-uclibc- -- vda From wadehamptoniv at gmail.com Fri Jul 13 16:33:07 2007 From: wadehamptoniv at gmail.com (Wade Hampton) Date: Fri, 13 Jul 2007 19:33:07 -0400 Subject: Failure to mount NFS using Busybox In-Reply-To: <200707132242.29868.vda.linux@googlemail.com> References: <7a57ad2a0707130952m2f80ffbej62bceb55a469eb4f@mail.gmail.com> <200707132242.29868.vda.linux@googlemail.com> Message-ID: <7a57ad2a0707131633s39d1cfe0gdb4c56f9b3bb6ff5@mail.gmail.com> I'll try strace Monday. I also built a static gcc-based busybox 1.6.1 and it failed with a different message. The busybox 1.6.1 also worked on a fully-booted box which makes me think that either something is missing (like a file in /dev), or a binary is missing. The last time I used busybox, I could use gcc and link a program with it using the wrappers -- I guess a full environment is require now (I'll test on Monday). Thanks, -- Wade Hampton On 7/13/07, Denis Vlasenko wrote: > On Friday 13 July 2007 16:52, Wade Hampton wrote: > > G'day, > > > > I am trying to use busybox in an initrd for system install/reinstall. > > The O/S is CentOS 5. My initrd is trying to mount a backup server > > using NFS, but fails with "No such device". > > Can you run it under strace? > > > O/S: CentOS 5.0 with updates, 2.6.18-8.1.1.el5 kernel > > Busybox: 1.2.0-3.el5 > > Same O/S for server and client. > > > > This works on a booted system: > > mkdir /mnt/tmp > > /sbin/busybox mount 10.1.2.3:/data -t nfs -o ro,hard,intr /mnt/tmp > > > > In the initrd this fails: > > mkdir -p /mnt/tmp > > mount 10.1.2.3:/data -t nfs -o ro,hard,intr /mnt/tmp > > > > Both have the exact same kernel and exact same busybox. I verified > > that the IP addresses are not an issue. I have tried adding > > rsize=1024,wsize=1024 and other mount options but still get the same > > error. > > > > Note, I tried making busybox 1.6.1 static but it fails with "static > > linking against glibc...". > > > > Should I make a static busybox 1.6.1 using uLibc and test that? If so, is > > there a simple way of doing this (the last time I did this was busybox 0.6 > > and lots have changed). Such instructions would be nice for the FAQ. > > I have uclibc cross compiler on my system: > > # ls /usr/bin/i486-linux-uclibc-* > /usr/bin/i486-linux-uclibc-addr2line /usr/bin/i486-linux-uclibc-gcc /usr/bin/i486-linux-uclibc-objdump > /usr/bin/i486-linux-uclibc-ar /usr/bin/i486-linux-uclibc-gcc-4.1.1 /usr/bin/i486-linux-uclibc-ranlib > /usr/bin/i486-linux-uclibc-as /usr/bin/i486-linux-uclibc-gccbug /usr/bin/i486-linux-uclibc-readelf > /usr/bin/i486-linux-uclibc-c++ /usr/bin/i486-linux-uclibc-gcov /usr/bin/i486-linux-uclibc-size > /usr/bin/i486-linux-uclibc-c++filt /usr/bin/i486-linux-uclibc-ld /usr/bin/i486-linux-uclibc-strings > /usr/bin/i486-linux-uclibc-cpp /usr/bin/i486-linux-uclibc-nm /usr/bin/i486-linux-uclibc-strip > /usr/bin/i486-linux-uclibc-g++ /usr/bin/i486-linux-uclibc-objcopy > > And building against uclibc is done simply like this: > > export ARCH=i386 > make CROSS_COMPILE=i486-linux-uclibc- > -- > vda > From vda.linux at googlemail.com Fri Jul 13 17:43:21 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 00:43:21 +0000 Subject: [ash-bug] in shcmd function, space should be output to fp, not to stdout. In-Reply-To: References: Message-ID: <200707140043.21927.vda.linux@googlemail.com> On Wednesday 11 July 2007 19:54, Nguyen Thai Ngoc Duy wrote: > Well, the subject says it all. Good catch! Applied to svn. Thanks. -- vda From wharms at bfs.de Sat Jul 14 01:33:47 2007 From: wharms at bfs.de (walter harms) Date: Sat, 14 Jul 2007 10:33:47 +0200 Subject: no echo on shell In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC327@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC327@sc-msexch-06.extremenetworks.com> Message-ID: <46988A6B.2010003@bfs.de> what das stty say ? re, wh Joe Lau wrote: > On Busybox 1.6.1 (more often) and 1.6.0, the shell (sh) can get into a mode > where it does not echo back the command that the user has entered. > The output from the command looks fine. > > Has anyone run into this problem? > > Thanks! > > -Joe > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From vda.linux at googlemail.com Sat Jul 14 04:28:36 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 11:28:36 +0000 Subject: ash -l option? In-Reply-To: <1184137325.29553.52.camel@localhost> References: <1184137325.29553.52.camel@localhost> Message-ID: <200707141128.36898.vda.linux@googlemail.com> On Wednesday 11 July 2007 07:02, Natanael Copa wrote: > Hi, > > While trying to get my busybox/uClibc based distro run as a vserver i > got the problem that there is no -l option to /bin/sh. I solved it by > patching vserver scripts: > > --- data.orig/usr/lib/util-vserver/vserver.functions 2007-07-05 15:41:45 +0000 > +++ data/usr/lib/util-vserver/vserver.functions 2007-07-10 22:54:08 +0000 > @@ -207,7 +207,7 @@ > > test -n "$ENTER_SHELL" || { > local i > - for i in "/bin/bash -login" "/bin/sh -l" /bin/csh; do > + for i in "/bin/bash -login" "/bin/ash --login" "/bin/sh -l" /bin/csh; do > set -- $i > test -x "$vdir/vdir/$1" || continue > ENTER_SHELL=( "$@" ) > > > I was wondering if there is intereste for a --login short option -l in > busybox so patching util-vserver is not needed for busybox vservers? Fixed in svn, thanks for the report. There was also a buglet which made +-login equivalent to --login, which bash doesn't do. -- vda From Alexander at Kriegisch.name Sat Jul 14 04:55:21 2007 From: Alexander at Kriegisch.name (Alexander Kriegisch) Date: Sat, 14 Jul 2007 13:55:21 +0200 Subject: ash init script with implicit "set -e"? Message-ID: <4698B9A9.9070602@Kriegisch.name> I hope not to be off-topic or ask a question the anwer of which should be obvious. I noticed that my embedded system (WLAN/DSL router) stops booting if any uncaught error occurs in my 'ash' init scripts. Is this the expected behaviour for scripts running in a process not connected to a console (no serial cable here, I can connect only later via telnet on pts)? It seems to be as if I run "sh -e" or "set -e" within an interactive shell. I am no expert on "init standards" if there is such a thing. In ash's manual page I only found this paragraph: > -e errexit > If not interactive, exit immediately if any untested command fails. > The exit status of a command is considered to be explicitly tested > if the command is used to control an if, elif, while, or until; > or if the command is the left hand operand of an ``&&'' or > ``||'' operator. This says what "-e" does in a non-interactive shell, but nothing about if it is the default for a non-interactive shell. In my /etc/inittab I just see rc.S being called, but there is no explicit "-e" there, nor is there any in rc.S itself. Now that I know that "-e" seems to be implicitly set, I can either do something like || true or set +x; ; set -x but nonetheless I am curious and would like to know if this behaviour is to be expected. Would it be a problem to set +x globally in an init script or is it kind of mandatory for it to fail (sounds crazy, but I am asking anyway)? Enlighten me, please. -- Alexander Kriegisch From vda.linux at googlemail.com Sat Jul 14 08:21:04 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Sat, 14 Jul 2007 16:21:04 +0100 Subject: ash init script with implicit "set -e"? In-Reply-To: <4698B9A9.9070602@Kriegisch.name> References: <4698B9A9.9070602@Kriegisch.name> Message-ID: <200707141621.04576.vda.linux@googlemail.com> On Saturday 14 July 2007 12:55, Alexander Kriegisch wrote: > I hope not to be off-topic or ask a question the anwer of which should > be obvious. > > I noticed that my embedded system (WLAN/DSL router) stops booting if any > uncaught error occurs in my 'ash' init scripts. Is this the expected > behaviour for scripts running in a process not connected to a console > (no serial cable here, I can connect only later via telnet on pts)? It > seems to be as if I run "sh -e" or "set -e" within an interactive shell. When reporting stuff like this, try to present a testcase. If it doesn't work on some non-i386 arch, try to reproduce on i386 as many people are sitting on this arch. I tried to construct a testcase. z.sh: echo first false echo second Works when run "normally": $ ./busybox ash z.sh first second Works when run daemonized: $ daemon ./busybox ash z.sh Closing file descriptors 8192-3... done. $ cat /tmp/daemon.3427.log Date: Sat Jul 14 16:12:58 IST 2007 Directory: /home/vda/srcdev/bbox/fix/busybox.t2 Command: ./busybox ash z.sh ======== first second FYI: "daemon" is a script shown below: $ cat ~/bin/daemon #!/bin/sh i=`ulimit -n` echo -n "Closing file descriptors $i-3... " while test "$i" -ge 3; do eval "exec $i>&-" i=$(($i-1)) done echo "done." >/tmp/daemon.$$.log >>/tmp/daemon.$$.log echo "Date: `date`" >>/tmp/daemon.$$.log echo "Directory: `pwd`" >>/tmp/daemon.$$.log echo "Command: $@" >>/tmp/daemon.$$.log echo "========" >>/tmp/daemon.$$.log 2>&1 but nonetheless I am curious and would like to know if this behaviour is > to be expected. Would it be a problem to set +x globally in an init > script or is it kind of mandatory for it to fail (sounds crazy, but I am > asking anyway)? I think generally we try to make ash behave similar to bash. -- vda From vda.linux at googlemail.com Sat Jul 14 09:38:16 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 17:38:16 +0100 Subject: Probably a bug in ash In-Reply-To: <20070705173322.dffa33b1.sbb@tuxfamily.org> References: <20070628163439.50345aac.sbb@tuxfamily.org> <20070705173322.dffa33b1.sbb@tuxfamily.org> Message-ID: <200707141738.16655.vda.linux@googlemail.com> On Thursday 05 July 2007 16:33, Seb wrote: > Hello, > > Sorry to insist, but as I don't see any reaction to my precedent mail, > I'd just want to know if it wasn't well delivered on the list or > if it's just an (uninteresting|desperated) case so that there is nothing > to say. :) I was relocating to another country. Sorry for the delay. -- vda From vda.linux at googlemail.com Sat Jul 14 09:48:42 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 17:48:42 +0100 Subject: Probably a bug in ash In-Reply-To: <20070706171028.22f53b94.sbb@tuxfamily.org> References: <468D2284.9070707@bfs.de> <7931.1183655912@brightstareng.com> <20070706171028.22f53b94.sbb@tuxfamily.org> Message-ID: <200707141748.42116.vda.linux@googlemail.com> On Friday 06 July 2007 16:10, Seb wrote: > Do you think I should also make a parallel bug report to dash ? (it's > not to put you under pressure -- I well see you have many other things > to fix here and this bug can wait -- but just to try to be more "useful" > without bothering you nor being unpolite). Unpolite is okay. In the worst case we all know how to use delete key. Trying to be nice is good, but trying to get bugs fixed is also important, maybe more important than politeness. For busybox ash, I prioritize bugs as follows, least to most: * missing feature implemented in bash (but not in POSIX) * missing feature required by POSIX * difference in behavior re bash, but still allowed by POSIX * difference in behavior re POSIX (I'd classify this as bug) * bug which is present in other flavors of ash/dash * bug which does not exist in other flavors of ash/dash How to get it fixed (you have to go to next level if current didnt work): * yell on bbox ml/bugzilla * yell on other ash/dash ml/bugzilla too * yell again * investigate yourself in the source, cook patch and send to ml * send patch again * bitch a lot about lazy maintainers which dont review working patches -- vda From vda.linux at googlemail.com Sat Jul 14 11:20:06 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 19:20:06 +0100 Subject: Probably a bug in ash In-Reply-To: <20070628163439.50345aac.sbb@tuxfamily.org> References: <20070628163439.50345aac.sbb@tuxfamily.org> Message-ID: <200707141920.06062.vda.linux@googlemail.com> On Thursday 28 June 2007 15:34, Seb wrote: > Hello, > > It seems that there is a bug in the 'jobs' built-in command of ash. As > a matter of fact, its output cannot be captured nor piped. > > I made a little script (in attachment) which shows the case. If you > execute it with ash, you should see that 'test3' doesn't return > anything but a new line, while 'test4' indicates that the output is well > directed to stdout (so, according to the rules of shell, the pipe > should work). > > I first observed this bug with the ash shell embedded in Slackware > (then I tested the one of Busybox because Patrick Volkerding said > to me that it was probably the best maintained ash shell :-) and I saw > that dash has the same curious behaviour. So, I think this bug comes > from the "historical" ash shell. The 'TOUR' doc which is in the ash > shell Slackware package says that ash cooks its own outputs, hence here > could be the cause of the bug (complete file in attachment): The bug is simple: ash clears job list for children. "jobs | cat" is run in child, because it's a pipe. I think the following will fix it: at the end of forkchild() function replace for() loop with this #if block: #if JOBS /* For "jobs | cat" to work like in bash, we must retain list of jobs, * but need to remove ourself */ freejob(jp); #else for (jp = curjob; jp; jp = jp->prev_job) freejob(jp); #endif jobless = 0; } I'm curious, tho, whether this will break other job-related stuff. Can you test this change? -- vda From vda.linux at googlemail.com Sat Jul 14 11:44:23 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 19:44:23 +0100 Subject: mount -o rw,remount /dev/hda2 /boot crashed on BB 1.6.0 In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC300@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC300@sc-msexch-06.extremenetworks.com> Message-ID: <200707141944.23353.vda.linux@googlemail.com> On Friday 06 July 2007 01:33, Joe Lau wrote: > > On BB 1.6.0, the mount command crashed when the device provided on remount. > > / # mount -o rw,remount /dev/hda2 /boot > ***** Process mount pid: 817 died with signal:11 > Segmentation fault (core dumped) > > It works fine if the device parameter (/dev/hda2) is not given. > > But "mount -o rw,remount /dev/hda2 /boot" works with BB 1.0 mount command. Not much I'm afraid: * try 1.6.1 and svn, just in case * if you cannot get coredump, add bb_error_msg("I am here") marker prints and rerun mount until you find where it crashes. Can take an hour or so. Then inform list. -- vda From vda.linux at googlemail.com Sat Jul 14 12:26:24 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 20:26:24 +0100 Subject: [PATCH] - Take 2: Adds support for custom error pages in httpd In-Reply-To: <200707112039.38790.genepi@sympatico.ca> References: <200707112039.38790.genepi@sympatico.ca> Message-ID: <200707142026.24679.vda.linux@googlemail.com> On Thursday 12 July 2007 01:39, Pierre M?tras wrote: > Hi, > > As recommended by Walter Harms, this version of the patch uses xasprintf() > instead of malloc()/strcpy()/strcat(). The final size of the binary is even > smaller: 324 bytes instead of 388 bytes with the previous patch. > > make bloatcheck > function old new delta > parse_conf 1201 1372 +171 > sendHeaders 461 571 +110 > sendFile 252 317 +65 > httpResponseNames 108 144 +36 > handleIncoming 2032 2038 +6 > .rodata 138727 138663 -64 > ------------------------------------------------------------------------------ > (add/remove: 0/0 grow/shrink: 5/1 up/down: 388/-64) Total: 324 bytes > text data bss dec hex filename > 636180 3124 12800 652104 9f348 busybox_old > 636525 3288 12800 652613 9f545 busybox_unstripped +#if ENABLE_FEATURE_HTTPD_ERROR_PAGES + if (flag == FIRST_PARSE && *p0 == 'E') { + /* error status code */ + c = strchr(++p0, ':'); + *c = 0; + int status = xatoi(p0); + p0 = ++c; Will crash if there is no ':'. However, there are more of such things in the code around, so probably don't care about that now... Some people dislike "int status" in the middle of the block. I think bb_strtou will give smaller code here: status = bb_strtou(p0 + 1, &p0, 10); /* ignoring possible conv error here */ p0++; + /* then error page */ + if (status >= HTTP_CONTINUE) { + if (*p0 == '/') { + c = xasprintf("%s", p0); Use c = xstrdup(p0). + } else { + c = xasprintf("%s/%s", home_httpd, p0); Use "c = concat_path_file(home_httpd, p0)" instead (a bit smaller). + } + + /* find matching status */ + for (int i = 0; i < ARRAY_SIZE(httpResponseNames); i++) { + if (httpResponseNames[i].type == status) { BTW, you may do alloc here, not above (and thus you won't leak c if user specified non-existent error code). + httpResponseNames[i].error_page = c; + break; + } + } + continue; + } + } +#endif - "%d %s\n" - "

%d %s

\n%s\n\n", + "\n" + "%d %s\n" + "

%d %s

\n%s\n\n", Well, adding is _maybe_ ok, but ? Isn't that just bloat? [to please really size-paranoid people on the list, consider just dropping it] libbb.h +#if ENABLE_HTTPD +#include +#endif I think this should just be in httpd.c - int count; - char *buf = iobuf; - - sendHeaders(HTTP_OK); - /* TODO: sendfile() */ - while ((count = full_read(f, buf, MAX_MEMORY_BUFF)) > 0) { - int fd = accepted_socket; - if (fd == 0) fd++; /* write to fd# 1 in inetd mode */ - if (full_write(fd, buf, count) != count) - break; + if (headers) { + sendHeaders(HTTP_OK); } + + int fd = accepted_socket; + if (fd == 0) fd++; /* write to fd #1 in inetd mode */ + + struct stat f_stat; + if (fstat(f, &f_stat)) { + bb_perror_msg("cannot stat file '%s'", url); + } + off_t offset = 0; + sendfile(fd, f, &offset, f_stat.st_size); Thanks for the effort of adding support for sendfile, but some people may want to exclude that from kernel & bbox. Can you make it configurable? Or just drop for now, to not interfere with inclusion of "error pages" patch. Waiting for patch v3. -- vda From vda.linux at googlemail.com Sat Jul 14 12:42:34 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 20:42:34 +0100 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <20070711221348.GA4096@aon.at> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> <200707111838.15527.farmatito@tiscali.it> <20070711221348.GA4096@aon.at> Message-ID: <200707142042.34597.vda.linux@googlemail.com> On Wednesday 11 July 2007 23:13, Bernhard Fischer wrote: > >I know but i'm pretty sure that in all places in busybox where this test was used > >[ !=0 ] it errored out, i double checked it, but nonetheless maybe its a good idea > >to change it to [ < 0 ] to be more coherent with the original ioctl call. > >So attached is a fixed patch. > > checking for != 0 is imho not a good idea as opposed to <0. The idea is > sound in my POV, i didn't have a chance to review it, though This was quite puzzling for me. Try to guess which is smallest (on i386)? * if (f() != 0) * if (f() < 0) * if (f() == -1) Third one is smallest! gcc just does "inc eax; j[n]z label"; which is just 3 bytes: # cat t.c int f(); void g(); void t1() { if (f()) g(); } void t2() { if (f() < 0) g(); } void t3() { if (f() == -1) g(); } # gcc -Os -fomit-frame-pointer -S t.c # cat t.s [ ABRIDGED] t3: subl $12, %esp call f incl %eax jne .L4 addl $12, %esp jmp g .L4: addl $12, %esp ret t2: subl $12, %esp call f testl %eax, %eax jns .L8 addl $12, %esp jmp g .L8: addl $12, %esp ret t1: subl $12, %esp call f testl %eax, %eax je .L12 addl $12, %esp jmp g .L12: addl $12, %esp ret [Wow, apparently my gcc (4.1.2) has a "I like to masturbate with %esp" habit :(( How to beat it into sanity?] Overall, bb_ioctl patch idea looks great, will review it in a few seconds! Big thanks Tito! -- vda From natanael.copa at gmail.com Sat Jul 14 13:21:55 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Sat, 14 Jul 2007 22:21:55 +0200 Subject: [PATCH] reminder: adduser is broken in 1.6.x Message-ID: <1184444515.19065.6.camel@localhost> Denis, Maybe you missed this while you were away so I send again. Adduser fails to create the user when ENABLE_FEATURE_CLEAN_UP is disabled. The reason is that adduser will exec passwd without first flushing the previously written /etc/passwd (and /etc/shadow). passwd will fail because the user does not exist until files are flushed. But the flush never comes because the buffered file handles are lost in the exec operation. Attatched patch fixes this by flushing all file handles before exiting. Alternative fix would be to close the files regardless FEATURE_CLEAN_UP but we save a few bytes with one fflush(NULL) over 2 fclose() (in case shadow passwords are enabled) Please add this to 1.6.1 fixes. Natanael Copa -------------- next part -------------- A non-text attachment was scrubbed... Name: busybox-1.6.1-adduser.patch Type: text/x-patch Size: 502 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070714/1a1d6470/attachment.bin From natanael.copa at gmail.com Sat Jul 14 13:45:03 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Sat, 14 Jul 2007 22:45:03 +0200 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: <200707131657.26004.vda.linux@googlemail.com> References: <1184250901.2150.49.camel@localhost> <200707131657.26004.vda.linux@googlemail.com> Message-ID: <1184445903.19065.26.camel@localhost> On Fri, 2007-07-13 at 16:57 +0100, Denys Vlasenko wrote: > Hi, > > On Thursday 12 July 2007 15:35, Natanael Copa wrote: > > Attatched is a patch that will fix a bug in vi, enhance functionality a > > bit, reduce size and make the code a bit more readable. Testcase > > follows. [...] > > Original vim shows "permission denied" but "Read-only" is better than > > nothing. > > Nice. Any chance getting "[Read failed]" (or whatever non-puzzling msg) > so we don't need to return to this once more? Code is messy and unreadable and even small changes tend to require redesign. (there are 3 different way how files are read and all 3 are handled different) I think maybe I should start with renaming the global vars. What does "cfn" mean? Rename it to g_current_filename or something like that and code is easier to work with. I will try allocate some time next week. > > Try edit file and save as root. Old behaviour let user do this even if > > file is write protected. > > > > After patch file will be marked as [Read-only]. root will need to save > > file with :wq! > > Is this feature important? Yes. I want this so bad so I spent some time to be able to add the feature and reduce size at the same time to increase my chances to get that specific feature in. I can make it a config option if you want, but for -12 bytes i thought I could get it for free ;-) [...] > Use: > > #if FEATURE_VI_READONLY > static void update_ro_status(const char *); > #else > static ALWAYS_INLINE void update_ro_status(const char *name) {} > #endif > > and call sites don't need USE_FEATURE_VI_READONLY(...) anymore. > Looks better. Ah! I wanted that but didn't know how. Thanks! > Care to do version 2? Will try allocate some time next week, but honestly, if im gonna touch that code again I think I would need to start with making it more readable. > -- > vda From natanael.copa at gmail.com Sat Jul 14 14:03:28 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Sat, 14 Jul 2007 23:03:28 +0200 Subject: libbusybox.so In-Reply-To: <200707131603.12859.vapier@gentoo.org> References: <29287.62.39.9.251.1184335679.squirrel@webmail.alcove.fr> <200707131603.12859.vapier@gentoo.org> Message-ID: <1184447008.19065.40.camel@localhost> On Fri, 2007-07-13 at 16:03 -0400, Mike Frysinger wrote: > On Friday 13 July 2007, simon at alcove.fr wrote: > > I've download the last stable busybox release (1.6.1) and i'm trying to > > build the shared library libbusybox.so. > > But it seems the shared library support has been removed from recents > > versions... the option is still present in the configuration interface but > > not used by the Makefile scripts... > > > > Is the busybox shared library always supported ? > > it's still a dev-only thing not meant general use ... if you dont plan on > hacking, dont plan on trying to use it ... I was thinking the other day that there are some general functions that I see come up in different projects over and over again, things like xmalloc and friends. Those are not likely to change their API. So I was thinking of maybe make an external shared lib and link all my own small projects to it. I don't know if it would be easier if parts of of libbb would be an external project? Candidates are xmalloc, xzalloc, xfopen..., fgetln (replaces bb_get_chunk_from_file), isdirectory, strlcpy, strlcat, strtonum. Basicly, things thats not likely to change API, are not in POSIX or in uclibc. Thoughts? > -mike > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox From sbb at tuxfamily.org Sat Jul 14 14:57:15 2007 From: sbb at tuxfamily.org (Seb) Date: Sat, 14 Jul 2007 23:57:15 +0200 Subject: Probably a bug in ash In-Reply-To: <200707141748.42116.vda.linux@googlemail.com> References: <468D2284.9070707@bfs.de> <7931.1183655912@brightstareng.com> <20070706171028.22f53b94.sbb@tuxfamily.org> <200707141748.42116.vda.linux@googlemail.com> Message-ID: <20070714235715.e5e82a56.sbb@tuxfamily.org> Le Sat, 14 Jul 2007 17:48:42 +0100 Denis Vlasenko a ?crit: > On Friday 06 July 2007 16:10, Seb wrote: > > Do you think I should also make a parallel bug report to dash ? (it's > > not to put you under pressure -- I well see you have many other things > > to fix here and this bug can wait -- but just to try to be more "useful" > > without bothering you nor being unpolite). > > Unpolite is okay. In the worst case we all know how to use delete key. > Trying to be nice is good, but trying to get bugs fixed is also important, > maybe more important than politeness. I agree, but sometimes the "human factor" can be decisive, so I prefer make this kind of things as smoothly as I can because effectively I think the most important here is the code. :) > * yell on other ash/dash ml/bugzilla too Done. Herbert Xu from dash is aware of the bug (there is no maintainer for the ash shell of Slackware). > * investigate yourself in the source, cook patch and send to ml > * send patch again I'd really like it but I can't because C is like Aramaic for me. ++ Seb. From sbb at tuxfamily.org Sat Jul 14 14:57:18 2007 From: sbb at tuxfamily.org (Seb) Date: Sat, 14 Jul 2007 23:57:18 +0200 Subject: Probably a bug in ash In-Reply-To: <200707141738.16655.vda.linux@googlemail.com> References: <20070628163439.50345aac.sbb@tuxfamily.org> <20070705173322.dffa33b1.sbb@tuxfamily.org> <200707141738.16655.vda.linux@googlemail.com> Message-ID: <20070714235718.9667cf15.sbb@tuxfamily.org> Le Sat, 14 Jul 2007 17:38:16 +0100 Denis Vlasenko a ?crit: > On Thursday 05 July 2007 16:33, Seb wrote: > > Hello, > > > > Sorry to insist, but as I don't see any reaction to my precedent mail, > > I'd just want to know if it wasn't well delivered on the list or > > if it's just an (uninteresting|desperated) case so that there is nothing > > to say. :) > > I was relocating to another country. Sorry for the delay. No problem, this bug can wait. :) ++ Seb. From sbb at tuxfamily.org Sat Jul 14 14:58:12 2007 From: sbb at tuxfamily.org (Seb) Date: Sat, 14 Jul 2007 23:58:12 +0200 Subject: Probably a bug in ash In-Reply-To: <200707141920.06062.vda.linux@googlemail.com> References: <20070628163439.50345aac.sbb@tuxfamily.org> <200707141920.06062.vda.linux@googlemail.com> Message-ID: <20070714235812.b7740c25.sbb@tuxfamily.org> Le Sat, 14 Jul 2007 19:20:06 +0100 Denis Vlasenko a ?crit: Hello, > The bug is simple: ash clears job list for children. "jobs | cat" is run > in child, because it's a pipe. > > I think the following will fix it: at the end of forkchild() function > replace for() loop with this #if block: > > #if JOBS > /* For "jobs | cat" to work like in bash, we must retain list of jobs, > * but need to remove ourself */ > freejob(jp); > #else > for (jp = curjob; jp; jp = jp->prev_job) > freejob(jp); > #endif > jobless = 0; > } Great ! I tested it, it works with busybox and with dash. :) But not with the ash shell of the Slackware, because the forkchild function just doesn't exist. There is just a huge forkshell function. I think the ancestor of the code you fixed is between line 739-745 in jobs.c but it's quite different from the one of dash/ash of busybox. Should/Could I post a patch to the dash maintainer (specifying that the author is you, of course) ? ++ Seb. From vda.linux at googlemail.com Sat Jul 14 15:06:44 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 23:06:44 +0100 Subject: [PATCH 1/7] bb_ioctl implementation In-Reply-To: <200707102357.14583.farmatito@tiscali.it> References: <200707102357.14583.farmatito@tiscali.it> Message-ID: <200707142306.44095.vda.linux@googlemail.com> On Tuesday 10 July 2007 22:57, Tito wrote: > Hi, > this series of 7 patches is a first attempt to add an ioctl api to libbb > and to use it in all applets where: > > if ( ioctl() < 0 [!= 0]) > bb_perror_msg{and_die}(); > > or similar code is used. Reviewed and applied to svn with insignificant changes. ioctl_or_die -> xioctl ioctl_or_vperrorXXX -> ioctl_or_perrorXXX Patch is attached, anyone for additional quick eye scan through for stupid errors? Thanks Tito! -- vda -------------- next part -------------- A non-text attachment was scrubbed... Name: 8.patch.bz2 Type: application/x-bzip2 Size: 12588 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070714/388e36df/attachment-0001.bin From vda.linux at googlemail.com Sat Jul 14 15:37:50 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 23:37:50 +0100 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: <1184445903.19065.26.camel@localhost> References: <1184250901.2150.49.camel@localhost> <200707131657.26004.vda.linux@googlemail.com> <1184445903.19065.26.camel@localhost> Message-ID: <200707142337.50860.vda.linux@googlemail.com> On Saturday 14 July 2007 21:45, Natanael Copa wrote: > On Fri, 2007-07-13 at 16:57 +0100, Denys Vlasenko wrote: > > > Original vim shows "permission denied" but "Read-only" is better than > > > nothing. > > > > Nice. Any chance getting "[Read failed]" (or whatever non-puzzling msg) > > so we don't need to return to this once more? > > Code is messy and unreadable and even small changes tend to require > redesign. (there are 3 different way how files are read and all 3 are > handled different) > > I think maybe I should start with renaming the global vars. What does > "cfn" mean? On the positive side, it's not that bad. It could have been named "_". > Yes. I want this so bad so I spent some time to be able to add the > feature and reduce size at the same time to increase my chances to get > that specific feature in. > > I can make it a config option if you want, but for -12 bytes i thought I > could get it for free ;-) No, 12 bytes is ok. Applied to svn as-is. Thanks. -- vda From vda.linux at googlemail.com Sat Jul 14 15:47:06 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 23:47:06 +0100 Subject: [PATCH] reminder: adduser is broken in 1.6.x In-Reply-To: <1184444515.19065.6.camel@localhost> References: <1184444515.19065.6.camel@localhost> Message-ID: <200707142347.06212.vda.linux@googlemail.com> On Saturday 14 July 2007 21:21, Natanael Copa wrote: > Denis, > > Maybe you missed this while you were away so I send again. > > Adduser fails to create the user when ENABLE_FEATURE_CLEAN_UP is > disabled. > > The reason is that adduser will exec passwd without first flushing the > previously written /etc/passwd (and /etc/shadow). passwd will fail > because the user does not exist until files are flushed. But the flush > never comes because the buffered file handles are lost in the exec > operation. > > Attatched patch fixes this by flushing all file handles before exiting. > > Alternative fix would be to close the files regardless FEATURE_CLEAN_UP > but we save a few bytes with one fflush(NULL) over 2 fclose() (in case > shadow passwords are enabled) > > Please add this to 1.6.1 fixes. Applied to svn and added to 1.6.1 hot fixes directory. Thanks. -- vda From vda.linux at googlemail.com Sat Jul 14 18:01:43 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 15 Jul 2007 02:01:43 +0100 Subject: Problem with ash -n non-zero length string test In-Reply-To: <1183844075.3382.22.camel@localhost> References: <1183844075.3382.22.camel@localhost> Message-ID: <200707150201.43381.vda.linux@googlemail.com> On Saturday 07 July 2007 22:34, Dallas Clement wrote: > Hello All, > > I'm experiencing some weird things when trying to use -n to test for a > non-empty string as in the following example. > > boot_drive_name="" > > if [ -n $boot_drive_name ]; then > retval=0 > else > echo "Could not determine boot drive name." > fi > > To my surprise, this condition evaluates true and I do not see my echo > message. No bug here: # cat zz.sh boot_drive_name="" if [ -n $boot_drive_name ]; then retval=0 else echo "Could not determine boot drive name." fi # ash zz.sh # bash zz.sh It's error in script. You need to use if [ -n "$boot_drive_name" ]; then... -- vda From vda.linux at googlemail.com Sat Jul 14 18:02:59 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 15 Jul 2007 02:02:59 +0100 Subject: string comparison in BB 1.6.0 sh In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC30A@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC30A@sc-msexch-06.extremenetworks.com> Message-ID: <200707150202.59211.vda.linux@googlemail.com> On Sunday 08 July 2007 00:20, Joe Lau wrote: > On BB 1.6.0, > > /scratch # if [ "abc" != "def" ]; then > > echo "string comparison works" > > fi > string comparison works > > /scratch # if [ ! "abc" = "def" ]; then > > echo "string comparison works" > > fi > Note: I didn't see my echo here. > > > On BB 1.0, > > /scratch # if [ "abc" != "def" ]; then > > echo "string comparision works" > > fi > string comparision works > > /scratch # if [ ! "abc" = "def" ]; then > > echo "string comparision works" > > fi > string comparision works > > Any clue why BB 1.6.0 sh behave this way? test applet is buggy in 1.6.0, get 1.6.1. Sorry. -- vda From vda.linux at googlemail.com Sat Jul 14 18:05:04 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 15 Jul 2007 02:05:04 +0100 Subject: Probably a bug in ash In-Reply-To: <20070714235812.b7740c25.sbb@tuxfamily.org> References: <20070628163439.50345aac.sbb@tuxfamily.org> <200707141920.06062.vda.linux@googlemail.com> <20070714235812.b7740c25.sbb@tuxfamily.org> Message-ID: <200707150205.04982.vda.linux@googlemail.com> On Saturday 14 July 2007 22:58, Seb wrote: > > The bug is simple: ash clears job list for children. "jobs | cat" is run > > in child, because it's a pipe. > > > > I think the following will fix it: at the end of forkchild() function > > replace for() loop with this #if block: > > > > #if JOBS > > /* For "jobs | cat" to work like in bash, we must retain list of jobs, > > * but need to remove ourself */ > > freejob(jp); > > #else > > for (jp = curjob; jp; jp = jp->prev_job) > > freejob(jp); > > #endif > > jobless = 0; > > } > > Great ! I tested it, it works with busybox and with dash. :) > > But not with the ash shell of the Slackware, because the forkchild > function just doesn't exist. There is just a huge forkshell function. I > think the ancestor of the code you fixed is between line 739-745 in > jobs.c but it's quite different from the one of dash/ash of busybox. > > Should/Could I post a patch to the dash maintainer (specifying that the > author is you, of course) ? Yes. -- vda From farmatito at tiscali.it Sun Jul 15 01:47:34 2007 From: farmatito at tiscali.it (Tito) Date: Sun, 15 Jul 2007 10:47:34 +0200 Subject: [PATCH 1/7] bb_ioctl implementation In-Reply-To: <200707142306.44095.vda.linux@googlemail.com> References: <200707102357.14583.farmatito@tiscali.it> <200707142306.44095.vda.linux@googlemail.com> Message-ID: <200707151047.34840.farmatito@tiscali.it> On Sunday 15 July 2007 00:06:44 Denis Vlasenko wrote: > On Tuesday 10 July 2007 22:57, Tito wrote: > > Hi, > > this series of 7 patches is a first attempt to add an ioctl api to libbb > > and to use it in all applets where: > > > > if ( ioctl() < 0 [!= 0]) > > bb_perror_msg{and_die}(); > > > > or similar code is used. > > Reviewed and applied to svn with insignificant changes. > > ioctl_or_die -> xioctl > ioctl_or_vperrorXXX -> ioctl_or_perrorXXX > > Patch is attached, anyone for additional quick eye scan through > for stupid errors? > > Thanks Tito! > -- > vda > Hi, Looks even better than before! Ciao, Tito From sbb at tuxfamily.org Sun Jul 15 03:17:55 2007 From: sbb at tuxfamily.org (Seb) Date: Sun, 15 Jul 2007 12:17:55 +0200 Subject: Probably a bug in ash In-Reply-To: <200707150205.04982.vda.linux@googlemail.com> References: <20070628163439.50345aac.sbb@tuxfamily.org> <200707141920.06062.vda.linux@googlemail.com> <20070714235812.b7740c25.sbb@tuxfamily.org> <200707150205.04982.vda.linux@googlemail.com> Message-ID: <20070715121755.ebf09ae0.sbb@tuxfamily.org> Le Sun, 15 Jul 2007 02:05:04 +0100 Denis Vlasenko a ?crit: > > But not with the ash shell of the Slackware, because the forkchild > > function just doesn't exist. There is just a huge forkshell function. I > > think the ancestor of the code you fixed is between line 739-745 in > > jobs.c but it's quite different from the one of dash/ash of busybox. > > > > Should/Could I post a patch to the dash maintainer (specifying that the > > author is you, of course) ? > > Yes. Done. Just to be sure, I suppose that there is nothing to expect for the ash shell of the Slackware (no problem, I'd understand: it's not your project and it would require a maybe difficult analysis of the structure of its code) ? ++ Seb. From rep.dot.nop at gmail.com Sun Jul 15 03:49:55 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Sun, 15 Jul 2007 12:49:55 +0200 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <200707142042.34597.vda.linux@googlemail.com> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> <200707111838.15527.farmatito@tiscali.it> <20070711221348.GA4096@aon.at> <200707142042.34597.vda.linux@googlemail.com> Message-ID: <20070715104955.GC4096@aon.at> On Sat, Jul 14, 2007 at 08:42:34PM +0100, Denis Vlasenko wrote: >On Wednesday 11 July 2007 23:13, Bernhard Fischer wrote: >> >I know but i'm pretty sure that in all places in busybox where this test was used >> >[ !=0 ] it errored out, i double checked it, but nonetheless maybe its a good idea >> >to change it to [ < 0 ] to be more coherent with the original ioctl call. >> >So attached is a fixed patch. >> >> checking for != 0 is imho not a good idea as opposed to <0. The idea is >> sound in my POV, i didn't have a chance to review it, though > >This was quite puzzling for me. Try to guess which is smallest (on i386)? >* if (f() != 0) >* if (f() < 0) >* if (f() == -1) > >Third one is smallest! gcc just does "inc eax; j[n]z label"; which is just 3 bytes: The third one is relying on implementation (un-)defined behaviour. #2 is a safe bet, albeit a little bit bigger, but it's the correct thing to do, imo. From vda.linux at googlemail.com Sun Jul 15 05:45:48 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 15 Jul 2007 13:45:48 +0100 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <20070715104955.GC4096@aon.at> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> <200707142042.34597.vda.linux@googlemail.com> <20070715104955.GC4096@aon.at> Message-ID: <200707151345.48525.vda.linux@googlemail.com> On Sunday 15 July 2007 11:49, Bernhard Fischer wrote: > On Sat, Jul 14, 2007 at 08:42:34PM +0100, Denis Vlasenko wrote: > >On Wednesday 11 July 2007 23:13, Bernhard Fischer wrote: > >> >I know but i'm pretty sure that in all places in busybox where this test was used > >> >[ !=0 ] it errored out, i double checked it, but nonetheless maybe its a good idea > >> >to change it to [ < 0 ] to be more coherent with the original ioctl call. > >> >So attached is a fixed patch. > >> > >> checking for != 0 is imho not a good idea as opposed to <0. The idea is > >> sound in my POV, i didn't have a chance to review it, though > > > >This was quite puzzling for me. Try to guess which is smallest (on i386)? > >* if (f() != 0) > >* if (f() < 0) > >* if (f() == -1) > > > >Third one is smallest! gcc just does "inc eax; j[n]z label"; which is just 3 bytes: > > The third one is relying on implementation (un-)defined behaviour. Well, manpages of most library functions say that on return -1 is returned (when function returns an int/long/off_t). And in many places we explicitly check for -1. It can be a silly project for someone to provide FAILED_NEGATIVE(x) macro which uses the most efficient error check for this case for given arch. For i386 it will be (x) == -1, for many arches probably (x) < 0. Then there are functions which return 0 on success and can be checked with just (x)!=0 - like stat, close, dup. FAILED_NONZERO(x)? It is on that fuzzy bounbary "do we want to go that far for saving 1 byte of code?". -- vda From dallas.a.clement at gmail.com Sun Jul 15 14:46:28 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Sun, 15 Jul 2007 16:46:28 -0500 Subject: Problem with ash -n non-zero length string test In-Reply-To: <200707150201.43381.vda.linux@googlemail.com> References: <1183844075.3382.22.camel@localhost> <200707150201.43381.vda.linux@googlemail.com> Message-ID: <469a95b8.4fe9220a.2cdb.54af@mx.google.com> > -----Original Message----- > From: Denis Vlasenko [mailto:vda.linux at googlemail.com] > Sent: Saturday, July 14, 2007 8:02 PM > To: busybox at busybox.net; dallas.a.clement at gmail.com > Subject: Re: Problem with ash -n non-zero length string test > > On Saturday 07 July 2007 22:34, Dallas Clement wrote: > > Hello All, > > > > I'm experiencing some weird things when trying to use -n to test for > a > > non-empty string as in the following example. > > > > boot_drive_name="" > > > > if [ -n $boot_drive_name ]; then > > retval=0 > > else > > echo "Could not determine boot drive name." > > fi > > > > To my surprise, this condition evaluates true and I do not see my > echo > > message. > > No bug here: > > # cat zz.sh > boot_drive_name="" > if [ -n $boot_drive_name ]; then > retval=0 > else > echo "Could not determine boot drive name." > fi > # ash zz.sh > # bash zz.sh > > It's error in script. You need to use > > if [ -n "$boot_drive_name" ]; then... > -- > vda Thank you for your reply. I didn't know that variables must be double-quoted. I'm learning something everyday! :>) From jmartin at pariver.com Mon Jul 16 00:59:13 2007 From: jmartin at pariver.com (Juan Martin) Date: Mon, 16 Jul 2007 09:59:13 +0200 Subject: weird bash script error Message-ID: <469B2551.6040200@pariver.com> Hi, I've the following script, that reads a set of parameters from a .conf file and load it into vars... it works OK on my Debian Box but... It just produces no answer on BusyBox with the exception of a blank line for each "echo" in the script... So I'm thinking about it doesn't put values on the vars (that's why it produces blank echo lines...) Anybody knows what can be going wrong? Something could be different on BB? I looks alright to me! Thanks a lot!! ------ #!/bin/bash # Function: get_config_list config_file # Purpose : Print the list of configs from config file get_config_list() { typeset config_file=$1 awk -F '[][]' ' NF==3 && $0 ~ /^\[.*\]/ { print $2 } ' ${config_file} } # Function : set_config_vars config_file config [var_prefix] # Purpose : Set variables (optionaly prefixed by var_prefix) from config in config file set_config_vars() { typeset config_file=$1 typeset config=$2 typeset var_prefix=$3 typeset config_vars config_vars=$( awk -F= -v Config="${config}" -v Prefix="${var_prefix}" ' BEGIN { Config = toupper(Config); patternConfig = "\\[" Config "]"; } toupper($0) ~ patternConfig,(/\[/ && toupper($0) !~ patternConfig) { if (/\[/ || NF <2) next; sub(/^[[:space:]]*/, ""); sub(/[[:space:]]*=[[:space:]]/, "="); print Prefix $0; } ' ${config_file} ) eval "${config_vars}" } # # Set variables for all config from config file # file=BlackBox.conf for cfg in $(get_config_list ${file}) do echo "--- Configuration [${cfg}] ---" unset $(set | awk -F= '/^cfg_/ { print $1 }') cfg_ set_config_vars ${file} ${cfg} cfg_ set | grep ^cfg_ done echo $cfg_WIFI #Testing boolean wifi value echo $cfg_NTP_Server # Testing value for NTP Server IP From robin.farine at terminus.org Mon Jul 16 00:59:31 2007 From: robin.farine at terminus.org (Robin Farine) Date: Mon, 16 Jul 2007 09:59:31 +0200 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <200707151345.48525.vda.linux@googlemail.com> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> <20070715104955.GC4096@aon.at> <200707151345.48525.vda.linux@googlemail.com> Message-ID: <200707160959.31617.robin.farine@terminus.org> On Sun July 15 2007 14:45, Denis Vlasenko wrote: > On Sunday 15 July 2007 11:49, Bernhard Fischer wrote: > > On Sat, Jul 14, 2007 at 08:42:34PM +0100, Denis Vlasenko wrote: > > >On Wednesday 11 July 2007 23:13, Bernhard Fischer wrote: > > >> >I know but i'm pretty sure that in all places in busybox > > >> > where this test was used [ !=0 ] it errored out, i double > > >> > checked it, but nonetheless maybe its a good idea to > > >> > change it to [ < 0 ] to be more coherent with the original > > >> > ioctl call. So attached is a fixed patch. > > >> > > >> checking for != 0 is imho not a good idea as opposed to <0. > > >> The idea is sound in my POV, i didn't have a chance to > > >> review it, though > > > > > >This was quite puzzling for me. Try to guess which is smallest > > > (on i386)? * if (f() != 0) > > >* if (f() < 0) > > >* if (f() == -1) > > > > > >Third one is smallest! gcc just does "inc eax; j[n]z label"; > > > which is just 3 bytes: > > > > The third one is relying on implementation (un-)defined > > behaviour. > It is on that fuzzy bounbary "do we want to go that far > for saving 1 byte of code?". Especially when on ARM for instance, the == -1 variant is 8 bytes bigger than the < 0 for a given compiler and flags. The outcome of this kind of nano-optimization is compiler specific, it may change from version to version, and it depends on the target architecture and compilation flags. In my opinion, it makes much more sense to go for the safe variant rather than the one that spares 1 byte on architecture foo. Robin From Stefan.Farnik at swarovski.com Mon Jul 16 01:27:48 2007 From: Stefan.Farnik at swarovski.com (Farnik Stefan) Date: Mon, 16 Jul 2007 10:27:48 +0200 Subject: Link Applet against ncurses In-Reply-To: <200707132239.04968.vda.linux@googlemail.com> Message-ID: <4E82E78083C07947A4F80214C130499E0AC7A9@dsw171.wattens.swarovski.com> On Saturday 14. Juli 2007: 00:39, Denis Vlasenko wrote: > You need to link a program againt the library only if you are actually using > something from the library. Unmodified bbox doesn't use ncurses, thus > I don't understand why you want to link it against ncurses. > Anyway, if you are modifying bbox so that it indeed needs ncurses now, > then you can follow SELinux example in Makefile.flags: > ifeq ($(CONFIG_SELINUX),y) > LDLIBS += -lselinux -lsepol > endif > or you can modify scripts/trylink. > -- > vda Hello, thank you for your answer. I have indeed modified busybox; added an applet which needs ncurses. Makefile.flags was one file where I didn't look into. But unfortunately If I added fitting lines to it, it doesn't help either. I still get the message `undefined reference to ..' -> printw mvwprintw wborder waddch wrefresh and others LDLIBS += -ncurses or: LDLIBS += /usr/lib/libncurses.a Thank you in advance! Stefan From wharms at bfs.de Mon Jul 16 02:14:29 2007 From: wharms at bfs.de (walter harms) Date: Mon, 16 Jul 2007 11:14:29 +0200 Subject: Link Applet against ncurses In-Reply-To: <4E82E78083C07947A4F80214C130499E0AC7A9@dsw171.wattens.swarovski.com> References: <4E82E78083C07947A4F80214C130499E0AC7A9@dsw171.wattens.swarovski.com> Message-ID: <469B36F5.2080505@bfs.de> try: LDLIBS += -lncurses Farnik Stefan wrote: > On Saturday 14. Juli 2007: 00:39, Denis Vlasenko wrote: >> You need to link a program againt the library only if you are actually using >> something from the library. Unmodified bbox doesn't use ncurses, thus >> I don't understand why you want to link it against ncurses. > >> Anyway, if you are modifying bbox so that it indeed needs ncurses now, >> then you can follow SELinux example in Makefile.flags: > >> ifeq ($(CONFIG_SELINUX),y) >> LDLIBS += -lselinux -lsepol >> endif > >> or you can modify scripts/trylink. >> -- >> vda > > Hello, > > thank you for your answer. > > I have indeed modified busybox; added an applet which needs ncurses. > Makefile.flags was one file where I didn't look into. But unfortunately > If I added fitting lines to it, it doesn't help either. > > I still get the message `undefined reference to ..' > -> printw mvwprintw wborder waddch wrefresh and others > > LDLIBS += -ncurses > or: > LDLIBS += /usr/lib/libncurses.a > > Thank you in advance! > > Stefan > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From wharms at bfs.de Mon Jul 16 02:19:25 2007 From: wharms at bfs.de (walter harms) Date: Mon, 16 Jul 2007 11:19:25 +0200 Subject: Problem with ash -n non-zero length string test In-Reply-To: <200707150201.43381.vda.linux@googlemail.com> References: <1183844075.3382.22.camel@localhost> <200707150201.43381.vda.linux@googlemail.com> Message-ID: <469B381D.4050106@bfs.de> Denis Vlasenko wrote: > On Saturday 07 July 2007 22:34, Dallas Clement wrote: >> Hello All, >> >> I'm experiencing some weird things when trying to use -n to test for a >> non-empty string as in the following example. >> >> boot_drive_name="" >> >> if [ -n $boot_drive_name ]; then >> retval=0 >> else >> echo "Could not determine boot drive name." >> fi >> >> To my surprise, this condition evaluates true and I do not see my echo >> message. > > No bug here: > > # cat zz.sh > boot_drive_name="" > if [ -n $boot_drive_name ]; then > retval=0 > else > echo "Could not determine boot drive name." > fi > # ash zz.sh > # bash zz.sh > > It's error in script. You need to use > > if [ -n "$boot_drive_name" ]; then... > -- -n is a test for string if "the length of STRING is nonzero" what you what is -z "the length of STRING is zero" re, wh From Stefan.Farnik at swarovski.com Mon Jul 16 02:20:07 2007 From: Stefan.Farnik at swarovski.com (Farnik Stefan) Date: Mon, 16 Jul 2007 11:20:07 +0200 Subject: FW: Link Applet against ncurses Message-ID: <4E82E78083C07947A4F80214C130499E0AC7AB@dsw171.wattens.swarovski.com> walter harms wrote: > try: > LDLIBS += -lncurses sorry, this was a typo in my mail it was `-lncurses' Stefan From wharms at bfs.de Mon Jul 16 03:02:04 2007 From: wharms at bfs.de (walter harms) Date: Mon, 16 Jul 2007 12:02:04 +0200 Subject: FW: Link Applet against ncurses In-Reply-To: <4E82E78083C07947A4F80214C130499E0AC7AB@dsw171.wattens.swarovski.com> References: <4E82E78083C07947A4F80214C130499E0AC7AB@dsw171.wattens.swarovski.com> Message-ID: <469B421C.9040606@bfs.de> with make V=1 you can get the verbose mode for make. please check for linking bb. does the lib appear at all ? re, wh Farnik Stefan wrote: > walter harms wrote: >> try: > >> LDLIBS += -lncurses > > sorry, this was a typo in my mail > it was `-lncurses' > > Stefan > > > From Stefan.Farnik at swarovski.com Mon Jul 16 03:48:26 2007 From: Stefan.Farnik at swarovski.com (Farnik Stefan) Date: Mon, 16 Jul 2007 12:48:26 +0200 Subject: FW: Link Applet against ncurses Message-ID: <4E82E78083C07947A4F80214C130499E0AC7AD@dsw171.wattens.swarovski.com> > with make V=1 you can get the verbose mode for make. please check > for linking bb. does the lib appear at all ? > re, > wh yes, it does appear. same if i type there's no error message at all complaining on not-finding ncurses. only the errors regarding the undefined functions. Stefan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070716/b8c564a7/attachment.htm From pgf at brightstareng.com Mon Jul 16 05:29:06 2007 From: pgf at brightstareng.com (Paul Fox) Date: Mon, 16 Jul 2007 08:29:06 -0400 Subject: weird bash script error In-Reply-To: jmartin's message of Mon, 16 Jul 2007 09:59:13 +0200. <469B2551.6040200@pariver.com> Message-ID: <27929.1184588946@brightstareng.com> > Hi, > > I've the following script, that reads a set of parameters from a .conf > file and load it into vars... it works OK on my Debian Box but... It > just produces no answer on BusyBox with the exception of a blank line > for each "echo" in the script... your script starts with "#!/bin/bash". do you really have bash running under busybox? or did you make the mistake of linking "ash" to "bash"? they're not the same thing. where is awk coming from? is it the busybox awk? if so, i wouldn't be surprised at all if it doesn't function exactly like "real" awk (for almost any value of "real") for some of what you're doing. you might want to start your debugging there. paul > > So I'm thinking about it doesn't put values on the vars (that's why it > produces blank echo lines...) > > Anybody knows what can be going wrong? Something could be different on > BB? I looks alright to me! > > Thanks a lot!! > ------ > #!/bin/bash > # Function: get_config_list config_file > # Purpose : Print the list of configs from config file > get_config_list() > { > typeset config_file=$1 > > awk -F '[][]' ' > NF==3 && $0 ~ /^\[.*\]/ { print $2 } > ' ${config_file} > } > > # Function : set_config_vars config_file config [var_prefix] > # Purpose : Set variables (optionaly prefixed by var_prefix) from > config in config file > set_config_vars() > { > typeset config_file=$1 > typeset config=$2 > typeset var_prefix=$3 > typeset config_vars > > config_vars=$( > awk -F= -v Config="${config}" -v Prefix="${var_prefix}" ' > BEGIN { > Config = toupper(Config); > patternConfig = "\\[" Config "]"; > } > toupper($0) ~ patternConfig,(/\[/ && toupper($0) !~ patternConfig) { > if (/\[/ || NF <2) next; > sub(/^[[:space:]]*/, ""); > sub(/[[:space:]]*=[[:space:]]/, "="); > print Prefix $0; > } ' ${config_file} ) > > eval "${config_vars}" > } > > # > # Set variables for all config from config file > # > file=BlackBox.conf > for cfg in $(get_config_list ${file}) > do > echo "--- Configuration [${cfg}] ---" > unset $(set | awk -F= '/^cfg_/ { print $1 }') cfg_ > set_config_vars ${file} ${cfg} cfg_ > set | grep ^cfg_ > done > echo $cfg_WIFI #Testing boolean wifi value > echo $cfg_NTP_Server # Testing value for NTP Server IP > > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox =--------------------- paul fox, pgf at brightstareng.com From Jlau at extremenetworks.com Mon Jul 16 10:36:25 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Mon, 16 Jul 2007 10:36:25 -0700 Subject: no echo on shell Message-ID: <888459D4AEE6464381B30398101F42F8043FC32F@sc-msexch-06.extremenetworks.com> /scratch # <----- I typed the stty command here (but not echoed back by the shell) speed 9600 baud; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; -brkint ixoff -imaxbel -icanon -echo /scratch # -Joe -----Original Message----- From: walter harms [mailto:wharms at bfs.de] Sent: Saturday, July 14, 2007 1:34 AM To: Joe Lau Cc: 'busybox at busybox.net' Subject: Re: no echo on shell what das stty say ? re, wh Joe Lau wrote: > On Busybox 1.6.1 (more often) and 1.6.0, the shell (sh) can get into a mode > where it does not echo back the command that the user has entered. > The output from the command looks fine. > > Has anyone run into this problem? > > Thanks! > > -Joe > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From pgf at brightstareng.com Mon Jul 16 10:41:50 2007 From: pgf at brightstareng.com (Paul Fox) Date: Mon, 16 Jul 2007 13:41:50 -0400 Subject: no echo on shell In-Reply-To: Jlau's message of Mon, 16 Jul 2007 10:36:25 -0700. <888459D4AEE6464381B30398101F42F8043FC32F@sc-msexch-06.extremenetworks.com> Message-ID: <17225.1184607710@brightstareng.com> > /scratch # <----- I typed the stty command here (but not echoed back by the > shell) > speed 9600 baud; > intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; > eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; > werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; > -brkint ixoff -imaxbel > -icanon -echo ^^^^^ this is the problem. someone is turning off echo, and it's not getting turned back on. are you perhaps killing off a program (e.g., using ^C), that might have disabled character echo? such a program _should_ catch the interrupt signal, in order to restore the tty the way it found it, but many do not. in the meantime, "stty echo" will reenable echo. a good command to use is "stty sane", which restores most (all?) of the default tty settings. paul =--------------------- paul fox, pgf at brightstareng.com From Jlau at extremenetworks.com Mon Jul 16 10:43:26 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Mon, 16 Jul 2007 10:43:26 -0700 Subject: no echo on shell Message-ID: <888459D4AEE6464381B30398101F42F8043FC330@sc-msexch-06.extremenetworks.com> I noticed that echo was turned off (-echo). But I did not turned echo off myself. Do you know who might have done it? Thanks. -Joe -----Original Message----- From: Joe Lau Sent: Monday, July 16, 2007 10:36 AM To: 'wharms at bfs.de' Cc: 'busybox at busybox.net'; Joe Lau Subject: RE: no echo on shell /scratch # <----- I typed the stty command here (but not echoed back by the shell) speed 9600 baud; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; -brkint ixoff -imaxbel -icanon -echo /scratch # -Joe -----Original Message----- From: walter harms [mailto:wharms at bfs.de] Sent: Saturday, July 14, 2007 1:34 AM To: Joe Lau Cc: 'busybox at busybox.net' Subject: Re: no echo on shell what das stty say ? re, wh Joe Lau wrote: > On Busybox 1.6.1 (more often) and 1.6.0, the shell (sh) can get into a mode > where it does not echo back the command that the user has entered. > The output from the command looks fine. > > Has anyone run into this problem? > > Thanks! > > -Joe > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From Jlau at extremenetworks.com Mon Jul 16 11:11:22 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Mon, 16 Jul 2007 11:11:22 -0700 Subject: no echo on shell Message-ID: <888459D4AEE6464381B30398101F42F8043FC332@sc-msexch-06.extremenetworks.com> No, I did not kill any program or noticed any program died when this problem happened. -Joe -----Original Message----- From: busybox-bounces at busybox.net [mailto:busybox-bounces at busybox.net]On Behalf Of Paul Fox Sent: Monday, July 16, 2007 10:42 AM To: busybox at busybox.net Subject: Re: no echo on shell > /scratch # <----- I typed the stty command here (but not echoed back by the > shell) > speed 9600 baud; > intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; > eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; > werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; > -brkint ixoff -imaxbel > -icanon -echo ^^^^^ this is the problem. someone is turning off echo, and it's not getting turned back on. are you perhaps killing off a program (e.g., using ^C), that might have disabled character echo? such a program _should_ catch the interrupt signal, in order to restore the tty the way it found it, but many do not. in the meantime, "stty echo" will reenable echo. a good command to use is "stty sane", which restores most (all?) of the default tty settings. paul =--------------------- paul fox, pgf at brightstareng.com _______________________________________________ busybox mailing list busybox at busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox From sbb at tuxfamily.org Mon Jul 16 11:28:02 2007 From: sbb at tuxfamily.org (Seb) Date: Mon, 16 Jul 2007 20:28:02 +0200 Subject: Probably a bug in ash In-Reply-To: <200707141920.06062.vda.linux@googlemail.com> References: <20070628163439.50345aac.sbb@tuxfamily.org> <200707141920.06062.vda.linux@googlemail.com> Message-ID: <20070716202802.c38449f6.sbb@tuxfamily.org> Le Sat, 14 Jul 2007 19:20:06 +0100 Denis Vlasenko a ?crit: > I'm curious, tho, whether this will break other job-related stuff. I don't know if it's a consequense of your patch or just a bug masked by the previous, but I notice another curious behaviour. When I test the number of running jobs by sending the output of jobs to another command, I get an infinite loop but no problem when jobs isn't piped : #!/bin/sh echo "test with 'jobs', not piped" sleep 2s & sleep 3s & while [ "$(jobs | sed 2p -n)" ]; do jobs done echo "test with piped 'jobs'..." wait sleep 2s & sleep 3s & while [ "$(jobs | sed 2p -n)" ]; do jobs | sed 2p -n # here we enter in an infinite loop done wait # EOF It looks like if a piped 'jobs' was unable to totally remove the achieved jobs from the list. ++ Seb P-S. My bash-3.1.17(2) has the same behaviour but only when there is exactly one job. From magrawal at CROSSBEAMSYS.COM Mon Jul 16 13:58:28 2007 From: magrawal at CROSSBEAMSYS.COM (Agrawal, Monalisa) Date: Mon, 16 Jul 2007 16:58:28 -0400 Subject: Restricting telnet access Message-ID: <8F523CF3EA46B344BEFD62C61103B9B207D3F9B6@CBSMAIL.crossbeamsys.com> Hello All I'm a newbie to busybox and though, I've spent some time browsing the faqs and mailist list archives, apologize in advance if this question has already been answered elsewhere. I was wondering if it is possible to configure telnetd service in busybox to allow logins from certain hosts and disallow from some others. One alternative may be to enable telnetd via inetd and then use the tcp wrapper services to do so, ie, by using /etc/hosts.allow and hosts.deny files...? However, it looks like tcp wrapper is not available by default in busybox and I'm not even sure if that's possible in busybox. Does anyone of an easy way to do this? Thanks so much for your help. Appreciate it. Mona -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070716/0d17f7bd/attachment.htm From vda.linux at googlemail.com Mon Jul 16 14:34:43 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 16 Jul 2007 22:34:43 +0100 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <200707160959.31617.robin.farine@terminus.org> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> <200707151345.48525.vda.linux@googlemail.com> <200707160959.31617.robin.farine@terminus.org> Message-ID: <200707162234.43463.vda.linux@googlemail.com> On Monday 16 July 2007 08:59, Robin Farine wrote: > > > >This was quite puzzling for me. Try to guess which is smallest > > > > (on i386)? * if (f() != 0) > > > >* if (f() < 0) > > > >* if (f() == -1) > > > > > > > >Third one is smallest! gcc just does "inc eax; j[n]z label"; > > > > which is just 3 bytes: > > > > > > The third one is relying on implementation (un-)defined > > > behaviour. > > > It is on that fuzzy bounbary "do we want to go that far > > for saving 1 byte of code?". > > Especially when on ARM for instance, the == -1 variant is 8 bytes > bigger than the < 0 for a given compiler and flags. The outcome of We have lots of if (f() == -1) comparisons too: # grep -r 'if (.*[a-z0-9](.* -1' . | wc -l 137 # echo $((137*8)) 1096 You just said that clever (== per-arch) choice of FAILED_NEGATIVE(x) and FAILED_NONZERO(x) will save ~1k of code on ARM. > this kind of nano-optimization is compiler specific, it may change > from version to version, and it depends on the target architecture > and compilation flags. In my opinion, it makes much more sense to Target arch can be dealt with #ifdefs > go for the safe variant rather than the one that spares 1 byte on > architecture foo. 1 byte maybe, but 8 bytes? -- vda From vda.linux at googlemail.com Mon Jul 16 14:45:58 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 16 Jul 2007 22:45:58 +0100 Subject: FW: Link Applet against ncurses In-Reply-To: <4E82E78083C07947A4F80214C130499E0AC7AB@dsw171.wattens.swarovski.com> References: <4E82E78083C07947A4F80214C130499E0AC7AB@dsw171.wattens.swarovski.com> Message-ID: <200707162245.58738.vda.linux@googlemail.com> On Monday 16 July 2007 10:20, Farnik Stefan wrote: > walter harms wrote: > > try: > > > LDLIBS += -lncurses > > sorry, this was a typo in my mail > it was `-lncurses' show the output of make V=1. Also try adding -v to the scripts/trylink: "$@" -v $added >busybox.map 2>busybox_ld.err ^^ If it doesn't complain about -v, sent output of this modified link stage instead. -- vda From vda.linux at googlemail.com Mon Jul 16 14:53:13 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 16 Jul 2007 22:53:13 +0100 Subject: no echo on shell In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC332@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC332@sc-msexch-06.extremenetworks.com> Message-ID: <200707162253.13310.vda.linux@googlemail.com> On Monday 16 July 2007 19:11, Joe Lau wrote: > No, I did not kill any program or noticed any program died when this problem > happened. So how exactly this problem happens? Do you login thru getty+login+ash on virtual console? or serial line? or over telnet? or ssh? Do you have any login scripts? Does it happen if you remove them, like: mv /home/user /home/user- mkdir /home/user chown user: /home/user [login on other console/telnet/ssh and see whether echo appears now] -- vda From vda.linux at googlemail.com Mon Jul 16 15:03:51 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 16 Jul 2007 23:03:51 +0100 Subject: weird bash script error In-Reply-To: <469B2551.6040200@pariver.com> References: <469B2551.6040200@pariver.com> Message-ID: <200707162303.51623.vda.linux@googlemail.com> On Monday 16 July 2007 08:59, Juan Martin wrote: > Hi, > > I've the following script, that reads a set of parameters from a .conf > file and load it into vars... it works OK on my Debian Box but... It > just produces no answer on BusyBox with the exception of a blank line > for each "echo" in the script... > > So I'm thinking about it doesn't put values on the vars (that's why it > produces blank echo lines...) > > Anybody knows what can be going wrong? Something could be different on > BB? I looks alright to me! > Please provide non-linewrapped version of the script (I think attaching it is safer in this regard than inline paste), example .conf file you feed into it and "correct" output from Debian -- vda From Jlau at extremenetworks.com Mon Jul 16 15:10:48 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Mon, 16 Jul 2007 15:10:48 -0700 Subject: no echo on shell Message-ID: <888459D4AEE6464381B30398101F42F8043FC337@sc-msexch-06.extremenetworks.com> This happens on our switch which uses a proprietary shell. By typing "!sh", we can switch to the Linux shell. Sometimes, echo got turned off when switching to the Linux shell (Busybox 1.6.0 or Busybox 1.6.1 sh). We have never encountered this problem when using Busybox 1.0. -Joe -----Original Message----- From: Denis Vlasenko [mailto:vda.linux at googlemail.com] Sent: Monday, July 16, 2007 2:53 PM To: busybox at busybox.net Cc: Joe Lau; 'Paul Fox' Subject: Re: no echo on shell On Monday 16 July 2007 19:11, Joe Lau wrote: > No, I did not kill any program or noticed any program died when this problem > happened. So how exactly this problem happens? Do you login thru getty+login+ash on virtual console? or serial line? or over telnet? or ssh? Do you have any login scripts? Does it happen if you remove them, like: mv /home/user /home/user- mkdir /home/user chown user: /home/user [login on other console/telnet/ssh and see whether echo appears now] -- vda From jmartin at pariver.com Mon Jul 16 23:16:13 2007 From: jmartin at pariver.com (Juan Martin) Date: Tue, 17 Jul 2007 08:16:13 +0200 Subject: weird bash script error In-Reply-To: <200707162303.51623.vda.linux@googlemail.com> References: <469B2551.6040200@pariver.com> <200707162303.51623.vda.linux@googlemail.com> Message-ID: <469C5EAD.8020207@pariver.com> Hi, Denis! OK sorry, here it goes. Setup.sh reads BlackBox.conf varsets, and build a set of vars with cfg_ prefix then it prints it to console (just for cheap debugging as well as echo lines) output contain these lines. I guess Paul Fox is right and "awk" has to be blamed so... Thanks a lot! Denis Vlasenko wrote: > On Monday 16 July 2007 08:59, Juan Martin wrote: > >> Hi, >> >> I've the following script, that reads a set of parameters from a .conf >> file and load it into vars... it works OK on my Debian Box but... It >> just produces no answer on BusyBox with the exception of a blank line >> for each "echo" in the script... >> >> So I'm thinking about it doesn't put values on the vars (that's why it >> produces blank echo lines...) >> >> Anybody knows what can be going wrong? Something could be different on >> BB? I looks alright to me! >> >> > > Please provide non-linewrapped version of the script (I think attaching > it is safer in this regard than inline paste), > example .conf file you feed into it and "correct" output from Debian > -- > vda > > - -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BlackBox.conf Url: http://busybox.net/lists/busybox/attachments/20070717/4b4dddb6/attachment.diff -------------- next part -------------- A non-text attachment was scrubbed... Name: Setup.sh Type: application/x-shellscript Size: 1417 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070717/4b4dddb6/attachment.bin -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: output Url: http://busybox.net/lists/busybox/attachments/20070717/4b4dddb6/attachment-0001.diff From Stefan.Farnik at swarovski.com Tue Jul 17 00:26:40 2007 From: Stefan.Farnik at swarovski.com (Farnik Stefan) Date: Tue, 17 Jul 2007 09:26:40 +0200 Subject: Link Applet against ncurses Message-ID: <4E82E78083C07947A4F80214C130499E0AC7B2@dsw171.wattens.swarovski.com> On Monday, 16. July 2007 23:46, Denis Vlasenko wrote: > show the output of make V=1. > Also try adding -v to the scripts/trylink: > "$@" -v $added >busybox.map 2>busybox_ld.err > ^^ > If it doesn't complain about -v, sent output > of this modified link stage instead. output of busybox_ls.err: ---- ---- ---- ---- Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-awt=gtk-default --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --with-tune=pentium4 --enable-checking=release i486-linux-gnu Thread model: posix gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5) /usr/lib/gcc/i486-linux-gnu/4.0.3/collect2 -m elf_i386 -static -o busybox_unstripped /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/crt1.o /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.0.3/crtbeginT.o -L/usr/lib/gcc/i486-linux-gnu/4.0.3 -L/usr/lib/gcc/i486-linux-gnu/4.0.3 -L/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib -L/usr/lib/gcc/i486-linux-gnu/4.0.3/../../.. -L/lib/../lib -L/usr/lib/../lib -lncurses --warn-common --sort-common --start-group applets/built-in.o archival/lib.a archival/libunarchive/lib.a console-tools/lib.a coreutils/lib.a coreutils/libcoreutils/lib.a debianutils/lib.a e2fsprogs/lib.a editors/lib.a findutils/lib.a init/lib.a libbb/lib.a libpwdgrp/lib.a loginutils/lib.a miscutils/lib.a modutils/lib.a networking/lib.a networking/libiproute/lib.a networking/udhcp/lib.a procps/lib.a runit/lib.a shell/lib.a sysklogd/lib.a util-linux/lib.a archival/built-in.o archival/libunarchive/built-in.o console-tools/built-in.o coreutils/built-in.o coreutils/libcoreutils/built-in.o debianutils/built-in.o e2fsprogs/built-in.o editors/built-in.o findutils/built-in.o init/built-in.o libbb/built-in.o libpwdgrp/built-in.o loginutils/built-in.o miscutils/built-in.o modutils/built-in.o networking/built-in.o networking/libiproute/built-in.o networking/udhcp/built-in.o procps/built-in.o runit/built-in.o shell/built-in.o sysklogd/built-in.o util-linux/built-in.o --end-group --start-group -lcrypt -lm --end-group --start-group -lgcc -lgcc_eh -lc --end-group /usr/lib/gcc/i486-linux-gnu/4.0.3/crtend.o /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/crtn.o networking/lib.a(nslookup.o): In function `print_host':nslookup.c:(.text.print_host+0x46): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking libbb/lib.a(inet_common.o): In function `INET_rresolve':inet_common.c:(.text.INET_rresolve+0xcb): warning: Using 'gethostbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking util-linux/lib.a(mount.o): In function `singlemount':mount.c:(.text.singlemount+0xab): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking libbb/lib.a(inet_common.o): In function `INET_rresolve':inet_common.c:(.text.INET_rresolve+0xd8): warning: Using 'getnetbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking libbb/lib.a(inet_common.o): In function `INET_resolve':inet_common.c:(.text.INET_resolve+0x66): warning: Using 'getnetbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking libbb/lib.a(create_icmp_socket.o): In function `create_icmp_socket':create_icmp_socket.c:(.text.create_icmp_socket+0x7): warning: Using 'getprotobyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking libbb/lib.a(xconnect.o): In function `bb_lookup_port':xconnect.c:(.text.bb_lookup_port+0x3c): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libc.a(dl-open.o): warning: definition of `_dl_tls_static_size' overriding common /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libc.a(libc-tls.o): warning: common is here coreutils/lib.a(dwipe.o): In function `dwipe_gui_title':dwipe.c:(.text.dwipe_gui_title+0x31): undefined reference to `mvwprintw' coreutils/lib.a(dwipe.o): In function `dwipe_gui_init':dwipe.c:(.text.dwipe_gui_init+0x1): undefined reference to `initscr' :dwipe.c:(.text.dwipe_gui_init+0x6): undefined reference to `cbreak' [...] :dwipe.c:(.text.dwipe_gui_load+0xc0): undefined reference to `mvwprintw' coreutils/lib.a(dwipe.o): In function `dwipe_gui_status':dwipe.c:(.text.dwipe_gui_status+0x85): undefined reference to `werase' :dwipe.c:(.text.dwipe_gui_status+0x90): undefined reference to `werase' :dwipe.c:(.text.dwipe_gui_status+0x96): undefined reference to `stdscr' :dwipe.c:(.text.dwipe_gui_status+0x9b): undefined reference to `wgetch' :dwipe.c:(.text.dwipe_gui_status+0x2da): undefined reference to `mvwprintw' :dwipe.c:(.text.dwipe_gui_status+0x328): undefined reference to `mvwprintw' [...] collect2: ld returned 1 exit status ---- ---- ---- ---- [...] - nobody need full 222 lines of errors, all in dwipe.c which is the one applet using ncurses busybox.map is empty (0 bytes) output of make isn't interesting beside the errors above thank you for your help! Stefan From robin.farine at terminus.org Tue Jul 17 01:18:59 2007 From: robin.farine at terminus.org (Robin Farine) Date: Tue, 17 Jul 2007 10:18:59 +0200 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <200707162234.43463.vda.linux@googlemail.com> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> <200707160959.31617.robin.farine@terminus.org> <200707162234.43463.vda.linux@googlemail.com> Message-ID: <200707171018.59918.robin.farine@terminus.org> On Mon July 16 2007 23:34, Denis Vlasenko wrote: > On Monday 16 July 2007 08:59, Robin Farine wrote: > > Especially when on ARM for instance, the == -1 variant is 8 > > bytes bigger than the < 0 for a given compiler and flags. The > > outcome of > > We have lots of if (f() == -1) comparisons too: > You just said that clever (== per-arch) choice of > FAILED_NEGATIVE(x) and FAILED_NONZERO(x) will save ~1k of code on > ARM. > Target arch can be dealt with #ifdefs > > > go for the safe variant rather than the one that spares 1 byte > > on architecture foo. > > 1 byte maybe, but 8 bytes? To be fair, I cheated. I used a simple test where the compiler could optimize the code in the two branches of the < 0 test benefiting from the fact that bit 31 is cleared in one branch and set in the other. In general the code size tends to be the same for both variants of the test. My point was more that the outcome of such an optimization depends on the target architecture and probably also on the version of gcc and the flags used. But if macros can help saving size on an arch without penalizing the others while keeping the code correct and readable, then why not. Robin From alberto.donato at gmail.com Tue Jul 17 03:47:37 2007 From: alberto.donato at gmail.com (Alberto Donato) Date: Tue, 17 Jul 2007 12:47:37 +0200 Subject: ash shell PATH Message-ID: <9709bd390707170347p5fd689cdg4ebc8ed2a73d07a9@mail.gmail.com> Hello, I've noticed a strange behavior in ash (bb 1.5.1 and 1.6.1). If the interactive shell finds the PATH env var set, it exports it and using getenv("PATH") from a program run from the shell returns the same path as "echo $PATH". Instead, if no PATH var is defined at shell startup and ash sets its own default paths, these are not exported and getenv("PATH") return NULL. Doing "export PATH" from the shell make things work. Is this a desired behavior or a bug? IMHO the PATH var should be exported also if set to ash defaults. Alberto From vda.linux at googlemail.com Tue Jul 17 05:27:06 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 17 Jul 2007 13:27:06 +0100 Subject: ash shell PATH In-Reply-To: <9709bd390707170347p5fd689cdg4ebc8ed2a73d07a9@mail.gmail.com> References: <9709bd390707170347p5fd689cdg4ebc8ed2a73d07a9@mail.gmail.com> Message-ID: <1158166a0707170527t4394ecf8u6173ffe8643a5ad@mail.gmail.com> Hi, On 7/17/07, Alberto Donato wrote: > I've noticed a strange behavior in ash (bb 1.5.1 and 1.6.1). > > If the interactive shell finds the PATH env var set, it exports it and > using getenv("PATH") from a program run from the shell returns the > same path as "echo $PATH". > Instead, if no PATH var is defined at shell startup and ash sets its > own default paths, these are not exported and getenv("PATH") return > NULL. > Doing "export PATH" from the shell make things work. > > Is this a desired behavior or a bug? It matches bash behavior: $ unset PATH; /bin/bash --norc bash-3.1$ /usr/bin/env | /bin/grep PATH bash-3.1$ exit exit $ unset PATH; ./busybox ash /home/vda/srcdev/bbox/fix/busybox.t6 $ /usr/bin/env | /bin/grep PATH /home/vda/srcdev/bbox/fix/busybox.t6 $ -- vda From natanael.copa at gmail.com Tue Jul 17 08:42:12 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Tue, 17 Jul 2007 17:42:12 +0200 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: <200707131657.26004.vda.linux@googlemail.com> References: <1184250901.2150.49.camel@localhost> <200707131657.26004.vda.linux@googlemail.com> Message-ID: <1184686932.15119.57.camel@localhost> On Fri, 2007-07-13 at 16:57 +0100, Denys Vlasenko wrote: > Hi, > > On Thursday 12 July 2007 15:35, Natanael Copa wrote: > > Attatched is a patch that will fix a bug in vi, enhance functionality a > > bit, reduce size and make the code a bit more readable. Testcase > > follows. [...] > Nice. Any chance getting "[Read failed]" (or whatever non-puzzling msg) > so we don't need to return to this once more? [...] > Care to do version 2? More improvements attatched. Fixes also a critical bug (segfault) * the puzzling message mentioned above is replaced with strerror(errno) so it should be even more detailed and smaller at the same time. * merged code in edit_file() and code for ':edit ' in colon() into new func init_text_buffer(). Was horribly duplicate. Moved most of error/sanity checking to file_insert(). Result is that you get a proper validation (prevent reading /dev/*) and error messages for ':r ' * renamed 'cfn' to 'current_filename' for improved readability * merged smallint vi_readonly and readonly into bitfields into readonly_mode to save space. * added text_size variable to keep track how big the text buffer is. This is used to fix a buffer overflow. To reproduce bug in current svn: ./busybox vi TODO :r Makefile vi segfaults due to no buffer checking is done at all. som redesign is needed here but i added a check in text_hole_make() to aviod the segfault at least. * removed isblnk() and use isblank(3) instead. * fixed compiler warning by displaying the return code for :! This makes things bigger than needed but since the patch reduces the overall size... (see below) * new func next_tabstop(int) merges some duplicate code. There are more cuplicode here but i couldnt find a good way to merge them. * Fix *ANNOYING* placement of cursor on '\t' characters. To reproduce in current svn: echo -e "\thello" > file1 ./busybox vi file1 Try to insert some text at the beginning of line. Text will be inserted but cursor is blinking somewhere else. The patch should make busybox vi behave more like original vi(m). Costs a few bytes but its worth it imho. * new_text() is moved into init_text_buffer() * the previously added update_ro_status() was moved info file_insert due to duplication removal mentioned above. I'm sure there are some more bugs in there. What happens if you have a 10239 bytes big file and inserts some chars/lines? I think nasty things might happen. vi also allocates the filesize * 2 which is not very efficient, but it require big changes so it can be fixed later. The attatched patch should not make things worse. If somebody find out that it introduces new bugs or have suggestions to improvements of the patch, let me know and I'll try to fix. It needs some testing. Too many changes in one shot. Now to the bloatcheck: function old new delta init_text_buffer - 245 +245 file_insert 312 420 +108 next_tabstop - 82 +82 text_hole_make 154 171 +17 do_cmd 5093 5100 +7 static.cmd_mode_indicator - 5 +5 refresh 1248 1253 +5 current_filename - 4 +4 yank_delete 161 164 +3 what_reg 96 99 +3 end_cmd_q 78 81 +3 char_insert 440 442 +2 readonly_mode - 1 +1 vi_readonly 1 - -1 setops 154 153 -1 readonly 1 - -1 vi_setops 4 1 -3 string_insert 161 158 -3 cfn 4 - -4 show_status_line 532 514 -18 readit 519 500 -19 move_to_col 161 138 -23 vi_main 495 433 -62 isblnk 75 - -75 .rodata 4751 4655 -96 edit_file 892 787 -105 new_text 125 - -125 update_ro_status 131 - -131 colon 3848 3667 -181 ------------------------------------------------------------------------------ (add/remove: 5/6 grow/shrink: 8/10 up/down: 485/-848) Total: -363 bytes text data bss dec hex filename 34751 873 4260 39884 9bcc busybox_old 34439 877 4260 39576 9a98 busybox_unstripped -------------- next part -------------- A non-text attachment was scrubbed... Name: bb-vi-fixes.patch Type: text/x-patch Size: 22805 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070717/832e3d4c/attachment-0001.bin From magrawal at CROSSBEAMSYS.COM Tue Jul 17 10:33:22 2007 From: magrawal at CROSSBEAMSYS.COM (Agrawal, Monalisa) Date: Tue, 17 Jul 2007 13:33:22 -0400 Subject: using tcp wrappers with busybox Message-ID: <8F523CF3EA46B344BEFD62C61103B9B207D3FF81@CBSMAIL.crossbeamsys.com> Hello Has anyone been successfully able to use tcp wrapper services with busybox? Any pointers on how I would go about doing it would be helpful and appreciated. Thanks Mona -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070717/9aec6c8c/attachment.htm From vda.linux at googlemail.com Tue Jul 17 14:48:20 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 17 Jul 2007 22:48:20 +0100 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070702142205.3CC1.YNAKAM@hitachisoft.jp> References: <20070702142205.3CC1.YNAKAM@hitachisoft.jp> Message-ID: <200707172248.20432.vda.linux@googlemail.com> Hi SELinux people, Sorry, late reply :(( On Monday 02 July 2007 06:29, Yuichi Nakamura wrote: > I would like to submit setfiles/restorecon applet. > setfiles and restorecon are SELinux commands that > label files according to configuration file > (in configuration file, relationship between file and label is > described). > > These applets are very important for SELinux enabled system. > Please review and consider merging this patch. Took a look: * Trimmed help text a bit * Removed \n at the end of bb_[p]error * Removed progname (using applet_name) * Removed restorecon.c - USE_RESTORECON(APPLET_ODDNAME...) handles that * int -> smallint for many flag variables This needs improvement - many of those flags are already accessible as (option_mask32 & BIT_MASK), you don't need separate variables Please take a look at: * Do you really have to have fork()? * Maybe use xstrdup instead of strdupa * nftw() is not used in bbox. We have recursive_action(). It will be better if we won't pull in nftw() into busybox just for this applet. * Do not do "if (applet_is_restorecon && option_x) bb_show_usage()" Just remove 'x' flag from optarg32 instead. If some of the above is not feasible, explain that. Please see attached updated patch. -- vda -------------- next part -------------- A non-text attachment was scrubbed... Name: 4.patch Type: text/x-diff Size: 22528 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070717/36e1aa72/attachment.bin From vda.linux at googlemail.com Tue Jul 17 16:25:50 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 18 Jul 2007 00:25:50 +0100 Subject: weird bash script error In-Reply-To: <469C5EAD.8020207@pariver.com> References: <469B2551.6040200@pariver.com> <200707162303.51623.vda.linux@googlemail.com> <469C5EAD.8020207@pariver.com> Message-ID: <200707180025.50767.vda.linux@googlemail.com> On Tuesday 17 July 2007 07:16, Juan Martin wrote: > Hi, Denis! > > OK sorry, here it goes. > > Setup.sh reads BlackBox.conf varsets, and build a set of vars with cfg_ > prefix then it prints it to console (just for cheap debugging as well as > echo lines) output contain these lines. > > I guess Paul Fox is right and "awk" has to be blamed so... Well, it's rather easy to reduce it to trivial testcase: echo "GNU awk:" echo "[set_1]" | /usr/bin/awk -F '[][]' 'NF==3 && $0 ~ /^\[.*\]/ { print $2 }' echo "Bbox awk:" echo "[set_1]" | /bin/awk -F '[][]' 'NF==3 && $0 ~ /^\[.*\]/ { print $2 }' echo "End" # sh Setup1.sh GNU awk: set_1 Bbox awk: End Yes, awk is guilty. -- vda From vda.linux at googlemail.com Tue Jul 17 16:10:40 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 18 Jul 2007 00:10:40 +0100 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: <1184686932.15119.57.camel@localhost> References: <1184250901.2150.49.camel@localhost> <200707131657.26004.vda.linux@googlemail.com> <1184686932.15119.57.camel@localhost> Message-ID: <200707180010.40408.vda.linux@googlemail.com> On Tuesday 17 July 2007 16:42, Natanael Copa wrote: > > Care to do version 2? > > More improvements attatched. Fixes also a critical bug (segfault) > > * the puzzling message mentioned above is replaced with strerror(errno) > so it should be even more detailed and smaller at the same time. > > * merged code in edit_file() and code for ':edit ' in colon() into > new func init_text_buffer(). Was horribly duplicate. Moved most of > error/sanity checking to file_insert(). Result is that you get a proper > validation (prevent reading /dev/*) and error messages for ':r ' > > * renamed 'cfn' to 'current_filename' for improved readability > > * merged smallint vi_readonly and readonly into bitfields into > readonly_mode to save space. > > * added text_size variable to keep track how big the text buffer is. > This is used to fix a buffer overflow. To reproduce bug in current svn: > > ./busybox vi TODO > :r Makefile > > vi segfaults due to no buffer checking is done at all. som redesign is > needed here but i added a check in text_hole_make() to aviod the > segfault at least. > > * removed isblnk() and use isblank(3) instead. > > * fixed compiler warning by displaying the return code for :! > This makes things bigger than needed but since the patch reduces the > overall size... (see below) > > * new func next_tabstop(int) merges some duplicate code. There are more > cuplicode here but i couldnt find a good way to merge them. > > * Fix *ANNOYING* placement of cursor on '\t' characters. To reproduce in > current svn: > echo -e "\thello" > file1 > ./busybox vi file1 > > Try to insert some text at the beginning of line. Text will be inserted > but cursor is blinking somewhere else. The patch should make busybox vi > behave more like original vi(m). Costs a few bytes but its worth it > imho. > > * new_text() is moved into init_text_buffer() > > * the previously added update_ro_status() was moved info file_insert due > to duplication removal mentioned above. > > I'm sure there are some more bugs in there. What happens if you have a > 10239 bytes big file and inserts some chars/lines? I think nasty things > might happen. vi also allocates the filesize * 2 which is not very > efficient, but it require big changes so it can be fixed later. > > The attatched patch should not make things worse. If somebody find out > that it introduces new bugs or have suggestions to improvements of the > patch, let me know and I'll try to fix. Wow. thanks! Applied to svn with minor changes. For example, we were comparing argv[0] with "view", but argv[0] can be "/bin/view"! Right thing is strncmp(appliet_name, "view", 4) BTW, any idea why strNcmp? Can it really be "viewsomething"? I'm no expert on vi... -- vda From pgf at brightstareng.com Tue Jul 17 20:19:38 2007 From: pgf at brightstareng.com (Paul Fox) Date: Tue, 17 Jul 2007 23:19:38 -0400 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: vda.linux's message of Wed, 18 Jul 2007 00:10:40 +0100. <200707180010.40408.vda.linux@googlemail.com> Message-ID: <440.1184728778@brightstareng.com> > > The attatched patch should not make things worse. If somebody find out > > that it introduces new bugs or have suggestions to improvements of the > > patch, let me know and I'll try to fix. > > Wow. thanks! i agree. busybox vi has needed some work. > Applied to svn with minor changes. For example, we were comparing argv[0] > with "view", but argv[0] can be "/bin/view"! Right thing is > > strncmp(appliet_name, "view", 4) > > BTW, any idea why strNcmp? Can it really be "viewsomething"? I'm no expert > on vi... no. it should be "vi", "ex", or "view". (and busybox's vi will almost certainly never be called "ex". :-) paul =--------------------- paul fox, pgf at brightstareng.com From enigma at strudel-hound.com Tue Jul 17 22:10:35 2007 From: enigma at strudel-hound.com (William Pettersson) Date: Wed, 18 Jul 2007 15:10:35 +1000 Subject: ARCH not being set by make menuconfig - kernel compile fails to start Message-ID: <469DA0CB.101@strudel-hound.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 So, I'm trying to set up a buildroot image for a soekris net4801. I ran make menuconfig, Target Architecture is set to "i386", Target Architecture Variant is set to "geode". However, when I run "make", I get the following (cd /home/wpettersson/src/buildroot/build_/linux-2.6.21.5 ; \ /usr/bin/make -j1 ARCH= CC="/usr/bin/gcc" \ INSTALL_HDR_PATH=/home/wpettersson/src/buildroot/toolchain_build_/linux headers_install ; \ ) make[1]: Entering directory `/home/wpettersson/src/buildroot/build_/linux-2.6.21.5' Makefile:491: /home/wpettersson/src/buildroot/build_/linux-2.6.21.5/arch//Makefile: No such file or directory make[1]: *** No rule to make target `/home/wpettersson/src/buildroot/build_/linux-2.6.21.5/arch//Makefile'. Stop. make[1]: Leaving directory `/home/wpettersson/src/buildroot/build_/linux-2.6.21.5' make: *** [/home/wpettersson/src/buildroot/toolchain_build_/linux/.configured] Error 2 - From the looks of it, "ARCH" isn't being set, which stuffs things up. I've tested by running the make command manually, with ARCH=i386, and that seemed to work. I wasn't sure which configuration files would be required, so to save space I didn't include any. If any are wanted, I'll gladly post them. Anyone know where ARCH is meant to be set? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGnaDLNSpXjKoV00kRAnCuAJ4lRqWNWjey1wSJPGI3axWMrMc/sQCeNBNT /5pybfbBYIsbNsxV3qERZmM= =uZoD -----END PGP SIGNATURE----- From Stefan.Farnik at swarovski.com Wed Jul 18 00:15:26 2007 From: Stefan.Farnik at swarovski.com (Farnik Stefan) Date: Wed, 18 Jul 2007 09:15:26 +0200 Subject: Link Applet against ncurses In-Reply-To: <200707172052.22312.vda.linux@googlemail.com> Message-ID: <4E82E78083C07947A4F80214C130499E0AC7BC@dsw171.wattens.swarovski.com> On Tuesday 17 July 2007 21:53, Denis Vlasenko wrote: > It's strange that -lncurses is in that spot. > If you add it to LDLIBS like SELinux does in Makefile.flags: > ifeq ($(CONFIG_SELINUX),y) > LDLIBS += -lselinux -lsepol > endif > then it has to appear AFTER $(busybox-all) block, > because $(LDLIBS) is after it: > # Rule to link busybox - also used during CONFIG_KALLSYMS > # May be overridden by arch/$(ARCH)/Makefile > quiet_cmd_busybox__ ?= LINK $@ > cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) $(LDFLAGS) \ > -o $@ -Wl,-M \ > -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \ > -Wl,--start-group $(busybox-all) -Wl,--end-group \ > $(LDLIBS) > You are doing something strange with -lncurses placement. > You don't use LDLIBS, you do something else, right? I havn't got this few lines about SELINUX in Makefile.flags so I copied from the ones in it, where it reads LDFLAGS - I saw this by now. When I looked for the quiet_cmd_busybox part in Makefile, I noticed there isn't a $(LDLIBS) either, at least in version 1.4.2 Changed files accordingly it doesn't work. The good thing is that I saw where to `hardcode' it and it ran smoothly. (At least `make install') > > networking/lib.a(nslookup.o): In function `print_host':nslookup.c:(.text.print_host+0x46): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking > Hmm. These errors were gone, too. Thank you for your help, Denis !! Stefan From natanael.copa at gmail.com Wed Jul 18 00:38:51 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Wed, 18 Jul 2007 09:38:51 +0200 Subject: Restricting telnet access In-Reply-To: <8F523CF3EA46B344BEFD62C61103B9B207D3F9B6@CBSMAIL.crossbeamsys.com> References: <8F523CF3EA46B344BEFD62C61103B9B207D3F9B6@CBSMAIL.crossbeamsys.com> Message-ID: <1184744331.22306.0.camel@localhost> On Mon, 2007-07-16 at 16:58 -0400, Agrawal, Monalisa wrote: > Hello All hi > I was wondering if it is possible to configure telnetd service in > busybox to allow logins from certain hosts and disallow from some > others. iptables? Natanael Copa From farmatito at tiscali.it Wed Jul 18 00:41:34 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 18 Jul 2007 09:41:34 +0200 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: <200707180010.40408.vda.linux@googlemail.com> References: <1184250901.2150.49.camel@localhost> <1184686932.15119.57.camel@localhost> <200707180010.40408.vda.linux@googlemail.com> Message-ID: <200707180941.34199.farmatito@tiscali.it> On Wednesday 18 July 2007 01:10:40 Denis Vlasenko wrote: > Applied to svn with minor changes. For example, we were comparing argv[0] > with "view", but argv[0] can be "/bin/view"! Right thing is > > strncmp(appliet_name, "view", 4) Why not: if (*applet_name[3]) Just an idea.... Ciao, Tito > BTW, any idea why strNcmp? Can it really be "viewsomething"? I'm no expert > on vi... > -- > vda From vda.linux at googlemail.com Wed Jul 18 01:30:38 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 18 Jul 2007 09:30:38 +0100 Subject: ARCH not being set by make menuconfig - kernel compile fails to start In-Reply-To: <469DA0CB.101@strudel-hound.com> References: <469DA0CB.101@strudel-hound.com> Message-ID: <200707180930.38910.vda.linux@googlemail.com> On Wednesday 18 July 2007 06:10, William Pettersson wrote: > So, I'm trying to set up a buildroot image for a soekris net4801. I ran > make menuconfig, Target Architecture is set to "i386", Target > Architecture Variant is set to "geode". > > However, when I run "make", I get the following > (cd /home/wpettersson/src/buildroot/build_/linux-2.6.21.5 ; \ > /usr/bin/make -j1 ARCH= CC="/usr/bin/gcc" \ > > INSTALL_HDR_PATH=/home/wpettersson/src/buildroot/toolchain_build_/linux > headers_install ; \ > ) > make[1]: Entering directory > `/home/wpettersson/src/buildroot/build_/linux-2.6.21.5' > Makefile:491: > /home/wpettersson/src/buildroot/build_/linux-2.6.21.5/arch//Makefile: No > such file or directory Seems like bbox and buildroot build machinery disagrees on how to handle ARCH. buildroot seems to set it to empty string. bbox sees it being set and doesn't change. Either buildroot shouldn't set ARCH to "" or busybox should change it if it is "". Someone needs to look deeper into it... -- vda From natanael.copa at gmail.com Wed Jul 18 01:44:39 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Wed, 18 Jul 2007 10:44:39 +0200 Subject: weird bash script error In-Reply-To: <200707180025.50767.vda.linux@googlemail.com> References: <469B2551.6040200@pariver.com> <200707162303.51623.vda.linux@googlemail.com> <469C5EAD.8020207@pariver.com> <200707180025.50767.vda.linux@googlemail.com> Message-ID: <1184748279.22306.20.camel@localhost> On Wed, 2007-07-18 at 00:25 +0100, Denis Vlasenko wrote: > On Tuesday 17 July 2007 07:16, Juan Martin wrote: > > Hi, Denis! > > > > OK sorry, here it goes. > > > > Setup.sh reads BlackBox.conf varsets, and build a set of vars with cfg_ > > prefix then it prints it to console (just for cheap debugging as well as > > echo lines) output contain these lines. > > > > I guess Paul Fox is right and "awk" has to be blamed so... > > Well, it's rather easy to reduce it to trivial testcase: > > echo "GNU awk:" > echo "[set_1]" | /usr/bin/awk -F '[][]' 'NF==3 && $0 ~ /^\[.*\]/ { print $2 }' > echo "Bbox awk:" > echo "[set_1]" | /bin/awk -F '[][]' 'NF==3 && $0 ~ /^\[.*\]/ { print $2 }' > echo "End" > > # sh Setup1.sh > GNU awk: > set_1 > Bbox awk: > End > > Yes, awk is guilty. Its the splitting of the fields that differs. echo "[set_1]" | /usr/bin/awk -F '[][]' 'NF==3 { print($2) }' set_1 echo "[set_1]" | ./busybox awk -F '[][]' 'NF==3 { print($2) }' echo "[set_1]" | ./busybox awk -F '[][]' 'NF==2 { print($2) }' set_1 echo "[set_1]" | /usr/bin/awk -F'[][]' '{print NF}' 3 echo "[set_1]" | ./busybox awk -F'[][]' '{print NF}' 2 What is the regex '[][]' supposed to match? Workaround for this specific case: echo "[set_1]" | ./busybox awk -F '[][]' '$0 ~ /^\[.*\]$/ { print($2) }' Natanael Copa From natanael.copa at gmail.com Wed Jul 18 02:24:36 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Wed, 18 Jul 2007 11:24:36 +0200 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: <200707180941.34199.farmatito@tiscali.it> References: <1184250901.2150.49.camel@localhost> <1184686932.15119.57.camel@localhost> <200707180010.40408.vda.linux@googlemail.com> <200707180941.34199.farmatito@tiscali.it> Message-ID: <1184750676.22306.36.camel@localhost> On Wed, 2007-07-18 at 09:41 +0200, Tito wrote: > On Wednesday 18 July 2007 01:10:40 Denis Vlasenko wrote: > > > Applied to svn with minor changes. For example, we were comparing argv[0] > > with "view", but argv[0] can be "/bin/view"! Right thing is > > > > strncmp(appliet_name, "view", 4) > > Why not: > if (*applet_name[3]) > > Just an idea.... Good idea! Actually, none of those works atm. include/applets needs to be updated. ln -s busybox vi ./vi [vi starts as expected] ln -s busybox view ./view view: applet not found ln -sf vi view ./view view: applet not found Attatched patch fixes this. However... I believe most people uses 'less' nowdays so we migh just want to drop /bin/view completely. People who absolutely want 'view' can create an alias: alias view='vi -R' btw... help message needs -c option. > Ciao, > Tito > > > BTW, any idea why strNcmp? Can it really be "viewsomething"? I'm no expert > > on vi... > > -- > > vda -------------- next part -------------- A non-text attachment was scrubbed... Name: vi-view.patch Type: text/x-patch Size: 1630 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070718/fbc2e440/attachment.bin From amckay at iders.ca Wed Jul 18 08:59:20 2007 From: amckay at iders.ca (Andrew McKay) Date: Wed, 18 Jul 2007 10:59:20 -0500 Subject: Socket: Function not implemented errors in Busybox 1.6.1 Message-ID: <469E38D8.4060308@iders.ca> Hi, I am compiling Busybox 1.6.1 for use on an ARM Linux system. My Kernel version is Linux 2.6.8.1. I have compiled busy box with both a GCC 3.4.4 and a GCC 4.2.0 compiler with the latest version of uClibc. However it appears that no socket related functions are not working in my Busybox executable. Applications that use a socket die with an error saying that the Function is not implemented. starting pid 494, tty '': '/sbin/syslogd' syslogd: socket: Function not implemented process '/sbin/syslogd -n' (pid 494) exited. Scheduling it for restart. ping 200.123.101.231 PING 200.123.101.231 (200.123.101.231): 56 data bytes ping: can't create raw socket: Function not implemented This happens with a Busybox executable that I build my self, and the one that is built using the Buildroot script. Does Busybox not work with Linux Kernel versions as old as 2.6.8.1? If it doesn't, what will I have to do to get it to work? At the moment Linux 2.6.8.1 is our stable kernel, and we won't be moving to a newer version for a little while still. Thanks in advance for any help Andrew From amckay at iders.ca Wed Jul 18 11:06:20 2007 From: amckay at iders.ca (Andrew McKay) Date: Wed, 18 Jul 2007 13:06:20 -0500 Subject: Socket: Function not implemented errors in Busybox 1.6.1 In-Reply-To: <469E38D8.4060308@iders.ca> References: <469E38D8.4060308@iders.ca> Message-ID: <469E569C.6020009@iders.ca> Andrew McKay wrote: > I am compiling Busybox 1.6.1 for use on an ARM Linux system. My Kernel version > is Linux 2.6.8.1. I have compiled busy box with both a GCC 3.4.4 and a GCC > 4.2.0 compiler with the latest version of uClibc. However it appears that no > socket related functions are not working in my Busybox executable. Applications > that use a socket die with an error saying that the Function is not implemented. > > starting pid 494, tty '': '/sbin/syslogd' > syslogd: socket: Function not implemented > process '/sbin/syslogd -n' (pid 494) exited. Scheduling it for restart. > > ping 200.123.101.231 > PING 200.123.101.231 (200.123.101.231): 56 data bytes > ping: can't create raw socket: Function not implemented > > This happens with a Busybox executable that I build my self, and the one that is > built using the Buildroot script. I have tested the busybox executable after being built with the following command line, note that have the config file set up to build it statically at this point: make CROSS_COMPILE=arm-linux- V=1 all The resulting stripped Busybox executable is around 1.5MB. It executes fine, and all socket operations work exactly as expected. However, when I install the executable to my root filesystem with the following command: make CROSS_COMPILE=arm-linux- V=1 CONFIG_PREFIX=/rootfs/ install The build decides to relink Busybox, and it appears to ignore the fact I want to build it statically. The resulting executable is around 800K, and gives errors when any application tries to use a socket. What's going on here? Any help would be appreciated. Andrew McKay Iders Inc. From pclouds at gmail.com Wed Jul 18 11:14:55 2007 From: pclouds at gmail.com (Nguyen Thai Ngoc Duy) Date: Wed, 18 Jul 2007 14:14:55 -0400 Subject: [ash] on exec without arguments Message-ID: Hi, There is a constraint in execcmd which only does exec if there is at least one argument. But I have a use-case where exec is called without any arguments [1]: exec 5>&1 if test "$verbose" = "t" then exec 4>&2 3>&1 else exec 4>/dev/null 3>/dev/null fi Can we just remove the condition? [1] http://repo.or.cz/w/git.git?a=blob;f=t/test-lib.sh;h=78d7e87e86178b90a350714c0b287353a0de20b4;hb=HEAD -- Duy From pclouds at gmail.com Wed Jul 18 11:42:53 2007 From: pclouds at gmail.com (Nguyen Thai Ngoc Duy) Date: Wed, 18 Jul 2007 14:42:53 -0400 Subject: [ash] on exec without arguments In-Reply-To: References: Message-ID: Silly me. We have to do some more to reload the shell itself. Sorry for the noise. On 7/18/07, Nguyen Thai Ngoc Duy wrote: > Hi, > > There is a constraint in execcmd which only does exec if there is at > least one argument. But I have a use-case where exec is called without > any arguments [1]: > > exec 5>&1 > if test "$verbose" = "t" > then > exec 4>&2 3>&1 > else > exec 4>/dev/null 3>/dev/null > fi > > Can we just remove the condition? > > [1] http://repo.or.cz/w/git.git?a=blob;f=t/test-lib.sh;h=78d7e87e86178b90a350714c0b287353a0de20b4;hb=HEAD > -- > Duy > -- Duy From sbb at tuxfamily.org Wed Jul 18 11:52:55 2007 From: sbb at tuxfamily.org (Seb) Date: Wed, 18 Jul 2007 20:52:55 +0200 Subject: Probably a bug in ash In-Reply-To: <200707141920.06062.vda.linux@googlemail.com> References: <20070628163439.50345aac.sbb@tuxfamily.org> <200707141920.06062.vda.linux@googlemail.com> Message-ID: <20070718205255.edb40556.sbb@tuxfamily.org> Le Sat, 14 Jul 2007 19:20:06 +0100 Denis Vlasenko a ?crit: > I'm curious, tho, whether this will break other job-related stuff. Well, it seems to break more than that. Once the patch applied, some outputs disapear. For example, this script doesn't return anything on a patched busybox (doinst.out is empty): #!/bin/sh cat >/tmp/doinst.out < References: <469B2551.6040200@pariver.com> <469C5EAD.8020207@pariver.com> <200707180025.50767.vda.linux@googlemail.com> Message-ID: <200707182122.58307.vda.linux@googlemail.com> On Wednesday 18 July 2007 00:25, Denis Vlasenko wrote: > > Setup.sh reads BlackBox.conf varsets, and build a set of vars with cfg_ > > prefix then it prints it to console (just for cheap debugging as well as > > echo lines) output contain these lines. > > > > I guess Paul Fox is right and "awk" has to be blamed so... > > Well, it's rather easy to reduce it to trivial testcase: > > echo "GNU awk:" > echo "[set_1]" | /usr/bin/awk -F '[][]' 'NF==3 && $0 ~ /^\[.*\]/ { print $2 }' > echo "Bbox awk:" > echo "[set_1]" | /bin/awk -F '[][]' 'NF==3 && $0 ~ /^\[.*\]/ { print $2 }' > echo "End" > > # sh Setup1.sh > GNU awk: > set_1 > Bbox awk: > End > > Yes, awk is guilty. Hopefully fixed in svn. Please try latest svn or just replace awk.c in your tree with attached file. -- vda -------------- next part -------------- A non-text attachment was scrubbed... Name: awk.c.bz2 Type: application/x-bzip2 Size: 18505 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070718/e2187c04/attachment.bin From vda.linux at googlemail.com Wed Jul 18 14:09:15 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 18 Jul 2007 22:09:15 +0100 Subject: Socket: Function not implemented errors in Busybox 1.6.1 In-Reply-To: <469E569C.6020009@iders.ca> References: <469E38D8.4060308@iders.ca> <469E569C.6020009@iders.ca> Message-ID: <1158166a0707181409w18e0636at9761e98ed055855@mail.gmail.com> > I have tested the busybox executable after being built with the following > command line, note that have the config file set up to build it statically at > this point: > make CROSS_COMPILE=arm-linux- V=1 all > > The resulting stripped Busybox executable is around 1.5MB. It executes fine, > and all socket operations work exactly as expected. > > However, when I install the executable to my root filesystem with the following > command: > make CROSS_COMPILE=arm-linux- V=1 CONFIG_PREFIX=/rootfs/ install Tried to reproduce, but it does not happen to me. You need to look deeper I'm afraid. Maybe use make -d to see why it rebuilds busybox? (Although output is plain scary...) -- vda From vda.linux at googlemail.com Wed Jul 18 14:27:06 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 18 Jul 2007 22:27:06 +0100 Subject: Probably a bug in ash In-Reply-To: <20070718205255.edb40556.sbb@tuxfamily.org> References: <20070628163439.50345aac.sbb@tuxfamily.org> <200707141920.06062.vda.linux@googlemail.com> <20070718205255.edb40556.sbb@tuxfamily.org> Message-ID: <1158166a0707181427i39823e49y3afd011614e4d9c0@mail.gmail.com> Yup. jp can be NULL. Should check for that, like this: #if JOBS /* For "jobs | cat" to work like in bash, we must retain list of jobs * in child, but we do need to remove ourself */ if (jp) freejob(jp); #else for (jp = curjob; jp; jp = jp->prev_job) freejob(jp); #endif Will fix in svn. Please notify dash maintainer too. Thanks for testing! -- vda From amckay at iders.ca Wed Jul 18 14:33:45 2007 From: amckay at iders.ca (Andrew McKay) Date: Wed, 18 Jul 2007 16:33:45 -0500 Subject: Socket: Function not implemented errors in Busybox 1.6.1 In-Reply-To: <1158166a0707181409w18e0636at9761e98ed055855@mail.gmail.com> References: <469E38D8.4060308@iders.ca> <469E569C.6020009@iders.ca> <1158166a0707181409w18e0636at9761e98ed055855@mail.gmail.com> Message-ID: <469E8739.6000701@iders.ca> Denis Vlasenko wrote: >> I have tested the busybox executable after being built with the following >> command line, note that have the config file set up to build it >> statically at >> this point: >> make CROSS_COMPILE=arm-linux- V=1 all >> >> The resulting stripped Busybox executable is around 1.5MB. It >> executes fine, >> and all socket operations work exactly as expected. >> >> However, when I install the executable to my root filesystem with the >> following >> command: >> make CROSS_COMPILE=arm-linux- V=1 CONFIG_PREFIX=/rootfs/ install > > Tried to reproduce, but it does not happen to me. You need to look > deeper I'm afraid. Maybe use make -d to see why it rebuilds busybox? > (Although output is plain scary...) > -- Thanks for the reply, I got side tracked today with some other tasks, but I've just gotten things working. It was a mistake on my end. I have one script that builds all the sources for my ramdisk, and another script that installs the sources for my ramdisk. I had their PATH variables set differently and pointing to two different cross compilers. Busybox was being compiled by the right compiler, but when 'make install' was called, the other compiler thought it hadn't linked busybox, and relinked it. The other compiler also had different Kernel Headers, so I think that's why it was broken. I fixed up my scripts and everything is working fine now. Thanks for your time, and sorry for the noise. Andrew McKay Iders Inc. From ynakam at hitachisoft.jp Wed Jul 18 18:17:59 2007 From: ynakam at hitachisoft.jp (Yuichi Nakamura) Date: Thu, 19 Jul 2007 10:17:59 +0900 Subject: [patch]setfiles/restorecon applet In-Reply-To: <200707172248.20432.vda.linux@googlemail.com> References: <20070702142205.3CC1.YNAKAM@hitachisoft.jp> <200707172248.20432.vda.linux@googlemail.com> Message-ID: <20070719101521.92B7.YNAKAM@hitachisoft.jp> Hi. Thanks for review and fixes. On Tue, 17 Jul 2007 22:48:20 +0100 Denis Vlasenko wrote: > Hi SELinux people, > > Sorry, late reply :(( > > On Monday 02 July 2007 06:29, Yuichi Nakamura wrote: > > I would like to submit setfiles/restorecon applet. > > setfiles and restorecon are SELinux commands that > > label files according to configuration file > > (in configuration file, relationship between file and label is > > described). > > > > These applets are very important for SELinux enabled system. > > Please review and consider merging this patch. > > Took a look: > > * Trimmed help text a bit > * Removed \n at the end of bb_[p]error > * Removed progname (using applet_name) > * Removed restorecon.c - USE_RESTORECON(APPLET_ODDNAME...) handles that > * int -> smallint for many flag variables > This needs improvement - many of those flags are already accessible > as (option_mask32 & BIT_MASK), you don't need separate variables > > Please take a look at: > * Do you really have to have fork()? I looked code again and found it unnecessary so removed. > * Maybe use xstrdup instead of strdupa Fixed. > * nftw() is not used in bbox. We have recursive_action(). > It will be better if we won't pull in nftw() into busybox > just for this applet. Fixed to use recursive_action instead of nftw. > * Do not do "if (applet_is_restorecon && option_x) bb_show_usage()" > Just remove 'x' flag from optarg32 instead. Fixed. > > If some of the above is not feasible, explain that. > > Please see attached updated patch. > -- > vda In addition, I am using struct globals for static data. Attached is revised patch, please look at. Regards, -- Yuichi Nakamura Hitachi Software Engineering Co., Ltd. Japan SELinux Users Group(JSELUG): http://www.selinux.gr.jp/ SELinux Policy Editor: http://seedit.sourceforge.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: setfiles.2.patch Type: application/octet-stream Size: 21155 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070719/0ec9d1b4/attachment-0001.obj From virtuoso at slind.org Thu Jul 19 00:24:56 2007 From: virtuoso at slind.org (Alexander Shishkin) Date: Thu, 19 Jul 2007 11:24:56 +0400 Subject: [PATCH] add a config option for ifstate location Message-ID: <11848298961166-git-send-email-virtuoso@slind.org> ifupdown keeps information on which interfaces are up in a file called ifstate. Typically it is located in /var/run/ifstate, however some distributions tend to put it in different places (like debian, for example, uses /etc/network/run/ifstate). This patch adds a config option that defines the location of ifstate. Signed-off-by: Alexander Shishkin --- networking/Config.in | 10 ++++++++++ networking/ifupdown.c | 8 +++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/networking/Config.in b/networking/Config.in index 77b5d25..b80d5ab 100644 --- a/networking/Config.in +++ b/networking/Config.in @@ -209,6 +209,16 @@ config FEATURE_IFCONFIG_BROADCAST_PLUS Setting this will make ifconfig attempt to find the broadcast automatically if the value '+' is used. +config IFSTATE_PATH + string "Absolute path to ifstate file" + default "/var/run/ifstate" + help + ifupdown keeps information on which interfaces are up in a file + called ifstate. Typically it is located in /var/run/ifstate, + however some distributions tend to put it in different places + (like debian, for example, uses /etc/network/run/ifstate). This + config option defines the location of ifstate. + config IFUPDOWN bool "ifupdown" default n diff --git a/networking/ifupdown.c b/networking/ifupdown.c index e9f0a64..5c7771a 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c @@ -10,7 +10,9 @@ * Changes to upstream version * Remove checks for kernel version, assume kernel version 2.2.0 or better. * Lines in the interfaces file cannot wrap. - * To adhere to the FHS, the default state file is /var/run/ifstate. + * To adhere to the FHS, the default state file is /var/run/ifstate + * (defined via CONFIG_IFSTATE_PATH) and can be overridden by build + * configuration. * * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. */ @@ -1105,7 +1107,7 @@ static llist_t *find_iface_state(llist_t *state_list, const char *iface) static llist_t *read_iface_state(void) { llist_t *state_list = NULL; - FILE *state_fp = fopen("/var/run/ifstate", "r"); + FILE *state_fp = fopen(CONFIG_IFSTATE_PATH, "r"); if (state_fp) { char *start, *end_ptr; @@ -1275,7 +1277,7 @@ int ifupdown_main(int argc, char **argv) } /* Actually write the new state */ - state_fp = xfopen("/var/run/ifstate", "w"); + state_fp = xfopen(CONFIG_IFSTATE_PATH, "w"); state = state_list; while (state) { if (state->data) { -- 1.5.1.2 From m.forster at advanced-business-solutions.de Thu Jul 19 01:21:06 2007 From: m.forster at advanced-business-solutions.de (Markus Forster) Date: Thu, 19 Jul 2007 10:21:06 +0200 Subject: WG: Problem with Busybox telnetd Message-ID: <200707191020781.SM01468@forstertosh> Hi there, i've activated telnetd in the menuconfig. All went good, i call the telnetd via inittab and its available. Port 23 is opened so i can connect. But the server closes the connection directly after connecting with the following message: Trying 192.168.20.30... Connected to 192.168.20.30. Escape character is '^]'. Connection closed by foreign host. Whats wrong with it? There are no PTY's in /dev, maybe thats the problem? How can i create these PTY's?` I'm using a small PXElinux, booting from PXE (udpcast initrd)... Regards, Markus From cristian.ionescu-idbohrn at axis.com Thu Jul 19 05:10:56 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Thu, 19 Jul 2007 14:10:56 +0200 (CEST) Subject: bb-ash and parameter expansion Message-ID: <0707191401100.1707@somehost> Had some troubles finding the expressions that work the same way in both bash, dash and ash (various versions) and put together a small script to help with the exercise. Couldn't find anything similar in the testsuite dir, so I thought it might be useful. Cheers, -- Cristian -------------- next part -------------- A non-text attachment was scrubbed... Name: bb-1word-extract-test.sh Type: application/x-sh Size: 722 bytes Desc: Url : http://busybox.net/lists/busybox/attachments/20070719/9cc22315/attachment.sh From virtuoso at slind.org Thu Jul 19 06:01:37 2007 From: virtuoso at slind.org (Alexander Shishkin) Date: Thu, 19 Jul 2007 17:01:37 +0400 Subject: [PATCH] add chpasswd applet Message-ID: <1184850097962-git-send-email-virtuoso@slind.org> This patch has been brewing in my busybox package for SLIND for quite a while (initially written against bb 1.01). chpasswd is useful for setting passwords in a non-interactive way. Description: chpasswd reads a file of user name and password pairs from standard input and uses this information to update a group of existing users. Signed-off-by: Alexander Shishkin --- include/applets.h | 1 + include/libbb.h | 3 + include/usage.h | 12 +++++ libbb/Kbuild | 3 +- libbb/update_passwd.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++++ loginutils/Config.in | 8 +++ loginutils/Kbuild | 1 + loginutils/chpasswd.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++++ loginutils/passwd.c | 109 -------------------------------------------- 9 files changed, 267 insertions(+), 110 deletions(-) create mode 100644 libbb/update_passwd.c create mode 100644 loginutils/chpasswd.c diff --git a/include/applets.h b/include/applets.h index 90af4f4..a05f74a 100644 --- a/include/applets.h +++ b/include/applets.h @@ -89,6 +89,7 @@ USE_CHCON(APPLET(chcon, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) USE_CHGRP(APPLET_NOEXEC(chgrp, chgrp, _BB_DIR_BIN, _BB_SUID_NEVER, chgrp)) USE_CHMOD(APPLET_NOEXEC(chmod, chmod, _BB_DIR_BIN, _BB_SUID_NEVER, chmod)) USE_CHOWN(APPLET_NOEXEC(chown, chown, _BB_DIR_BIN, _BB_SUID_NEVER, chown)) +USE_CHPASSWD(APPLET(chpasswd, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) USE_CHPST(APPLET(chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) USE_CHROOT(APPLET(chroot, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) USE_CHRT(APPLET(chrt, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) diff --git a/include/libbb.h b/include/libbb.h index 46860c6..bef3ca4 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -778,6 +778,9 @@ extern void print_login_prompt(void); extern void crypt_make_salt(char *p, int cnt); +extern int update_passwd(const char *filename, const char *username, + const char *new_pw); + int get_terminal_width_height(const int fd, int *width, int *height); int ioctl_or_perror(int fd, int request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))); diff --git a/include/usage.h b/include/usage.h index 29a4991..d2a51d2 100644 --- a/include/usage.h +++ b/include/usage.h @@ -2520,6 +2520,18 @@ " -l Locks (disables) the specified user account\n" \ " -u Unlocks (re-enables) the specified user account" +#define chpasswd_trivial_usage \ + "[--md5|--encrypt]" +#define chpasswd_full_usage \ + "Read user:password information from stdin\n" \ + "and update /etc/passwd accordingly." \ + "\n\nOptions:\n" \ + " -e, --encrypt\n" \ + " Supplied passwords are in encrypted form.\n" \ + " -m, --md5\n" \ + " Use MD5 encryption instead DES when the supplied\n" \ + " passwords are not encrypted.\n" + #define patch_trivial_usage \ "[-p] [-i ]" #define patch_full_usage \ diff --git a/libbb/Kbuild b/libbb/Kbuild index 6595867..c0cbe1a 100644 --- a/libbb/Kbuild +++ b/libbb/Kbuild @@ -104,7 +104,8 @@ lib-y += xreadlink.o lib-$(CONFIG_FEATURE_MOUNT_LOOP) += loop.o lib-$(CONFIG_LOSETUP) += loop.o lib-$(CONFIG_FEATURE_MTAB_SUPPORT) += mtab.o -lib-$(CONFIG_PASSWD) += pw_encrypt.o crypt_make_salt.o +lib-$(CONFIG_PASSWD) += pw_encrypt.o crypt_make_salt.o update_passwd.o +lib-$(CONFIG_CHPASSWD) += pw_encrypt.o crypt_make_salt.o update_passwd.o lib-$(CONFIG_CRYPTPW) += pw_encrypt.o crypt_make_salt.o lib-$(CONFIG_SULOGIN) += pw_encrypt.o lib-$(CONFIG_FEATURE_HTTPD_AUTH_MD5) += pw_encrypt.o diff --git a/libbb/update_passwd.c b/libbb/update_passwd.c new file mode 100644 index 0000000..292bfa5 --- /dev/null +++ b/libbb/update_passwd.c @@ -0,0 +1,120 @@ +/* vi: set sw=4 ts=4: */ +/* + * update_passwd + * + * update_passwd is a common function for passwd and chpasswd applets; + * it is responsible for updating password file (i.e. /etc/passwd or + * /etc/shadow) for a given user and password. + * + * Moved from loginutils/passwd.c by Alexander Shishkin + */ + +#include "libbb.h" + +int update_passwd(const char *filename, const char *username, + const char *new_pw) +{ + struct stat sb; + struct flock lock; + FILE *old_fp; + FILE *new_fp; + char *new_name; + char *last_char; + unsigned user_len; + int old_fd; + int new_fd; + int i; + int ret = 1; /* failure */ + + logmode = LOGMODE_STDIO; + /* New passwd file, "/etc/passwd+" for now */ + new_name = xasprintf("%s+", filename); + last_char = &new_name[strlen(new_name)-1]; + username = xasprintf("%s:", username); + user_len = strlen(username); + + old_fp = fopen(filename, "r+"); + if (!old_fp) + goto free_mem; + old_fd = fileno(old_fp); + + /* Try to create "/etc/passwd+". Wait if it exists. */ + i = 30; + do { + // FIXME: on last iteration try w/o O_EXCL but with O_TRUNC? + new_fd = open(new_name, O_WRONLY|O_CREAT|O_EXCL,0600); + if (new_fd >= 0) goto created; + if (errno != EEXIST) break; + usleep(100000); /* 0.1 sec */ + } while (--i); + bb_perror_msg("cannot create '%s'", new_name); + goto close_old_fp; + created: + if (!fstat(old_fd, &sb)) { + fchmod(new_fd, sb.st_mode & 0777); /* ignore errors */ + fchown(new_fd, sb.st_uid, sb.st_gid); + } + new_fp = fdopen(new_fd, "w"); + if (!new_fp) { + close(new_fd); + goto unlink_new; + } + + /* Backup file is "/etc/passwd-" */ + last_char[0] = '-'; + /* Delete old one, create new as a hardlink to current */ + i = (unlink(new_name) && errno != ENOENT); + if (i || link(filename, new_name)) + bb_perror_msg("warning: cannot create backup copy '%s'", new_name); + last_char[0] = '+'; + + /* Lock the password file before updating */ + lock.l_type = F_WRLCK; + lock.l_whence = SEEK_SET; + lock.l_start = 0; + lock.l_len = 0; + if (fcntl(old_fd, F_SETLK, &lock) < 0) + bb_perror_msg("warning: cannot lock '%s'", filename); + lock.l_type = F_UNLCK; + + /* Read current password file, write updated one */ + while (1) { + char *line = xmalloc_fgets(old_fp); + if (!line) break; /* EOF/error */ + if (strncmp(username, line, user_len) == 0) { + /* we have a match with "username:"... */ + const char *cp = line + user_len; + /* now cp -> old passwd, skip it: */ + cp = strchr(cp, ':'); + if (!cp) cp = ""; + /* now cp -> ':' after old passwd or -> "" */ + fprintf(new_fp, "%s%s%s", username, new_pw, cp); + /* Erase password in memory */ + } else + fputs(line, new_fp); + free(line); + } + fcntl(old_fd, F_SETLK, &lock); + + /* We do want all of them to execute, thus | instead of || */ + if ((ferror(old_fp) | fflush(new_fp) | fsync(new_fd) | fclose(new_fp)) + || rename(new_name, filename) + ) { + /* At least one of those failed */ + goto unlink_new; + } + ret = 0; /* whee, success! */ + + unlink_new: + if (ret) unlink(new_name); + + close_old_fp: + fclose(old_fp); + + free_mem: + if (ENABLE_FEATURE_CLEAN_UP) free(new_name); + if (ENABLE_FEATURE_CLEAN_UP) free((char*)username); + logmode = LOGMODE_BOTH; + return ret; +} + diff --git a/loginutils/Config.in b/loginutils/Config.in index f9ae122..63ae9b4 100644 --- a/loginutils/Config.in +++ b/loginutils/Config.in @@ -180,6 +180,14 @@ config CRYPTPW help Applet for crypting a string. +config CHPASSWD + bool "chpasswd" + default n + help + chpasswd reads a file of user name and password pairs from + standard input and uses this information to update a group of + existing users. + config SU bool "su" default n diff --git a/loginutils/Kbuild b/loginutils/Kbuild index 1b1165a..3d0d777 100644 --- a/loginutils/Kbuild +++ b/loginutils/Kbuild @@ -8,6 +8,7 @@ lib-y:= lib-$(CONFIG_ADDGROUP) += addgroup.o lib-$(CONFIG_ADDUSER) += adduser.o lib-$(CONFIG_CRYPTPW) += cryptpw.o +lib-$(CONFIG_CHPASSWD) += chpasswd.o lib-$(CONFIG_GETTY) += getty.o lib-$(CONFIG_LOGIN) += login.o lib-$(CONFIG_PASSWD) += passwd.o diff --git a/loginutils/chpasswd.c b/loginutils/chpasswd.c new file mode 100644 index 0000000..76db672 --- /dev/null +++ b/loginutils/chpasswd.c @@ -0,0 +1,120 @@ +/* vi: set sw=4 ts=4: */ +/* + * chpasswd.c + * + * Written for SLIND (from passwd.c) by Alexander Shishkin + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + */ + +#include /* for struct option */ +#include +#include "libbb.h" + +static struct option const chpasswd_opts[] = { + { "encrypted", no_argument, 0, 'e' }, + { "md5", no_argument, 0, 'm' } +}; + +int chpasswd_main(int argc, char **argv); +int chpasswd_main(int argc, char **argv) +{ + char *name, *cp, *myname, *ret; + char buf[80]; + char salt[sizeof("$N$XXXXXXXX")]; + int enc = 0; + int md5 = 0; + int flag, amroot; + const struct passwd *pw; + struct rlimit rlimit_fsize; + char *pwfile = +#ifndef ENABLE_FEATURE_SHADOWPASSWDS + bb_path_passwd_file; +#else + bb_path_shadow_file; +#endif + + amroot = (getuid() == 0); + myname = (char *) xstrdup(bb_getpwuid(NULL, getuid(), -1)); + while ((flag = getopt_long(argc, argv, "me", chpasswd_opts, NULL)) != EOF) { + switch (flag) { + case 'e': + enc = 1; + break; + case 'm': + md5 = 1; + break; + default: + bb_show_usage(); + } + } + + if (enc && md5) + bb_show_usage(); + + rlimit_fsize.rlim_cur = rlimit_fsize.rlim_max = 512L * 30000; + setrlimit(RLIMIT_FSIZE, &rlimit_fsize); + signal(SIGHUP, SIG_IGN); + signal(SIGINT, SIG_IGN); + signal(SIGQUIT, SIG_IGN); + umask(077); + + while (fgets(buf, sizeof buf, stdin) != NULL) { + cp = strchr(buf, '\n'); + if (cp) + *cp = '\0'; + else { + puts("Line too long.\n"); + continue; + } + + name = buf; + cp = strchr(name, ':'); + if (cp) + *cp++ = '\0'; + else { + puts("Missing new password.\n"); + continue; + } + + pw = getpwnam(name); + if (!pw) + bb_error_msg_and_die("Unknown user %s\n", name); + + if (!amroot && cp[0] == '!') { + syslog(LOG_WARNING, "password locked for `%s'", name); + bb_error_msg_and_die( + "The password for `%s' cannot be changed.\n", name + ); + } + + if (!enc) { + crypt_make_salt(salt, 1); + + if (md5) { + strcpy(salt, "$1$"); + crypt_make_salt(salt + 3, 4); + } + + ret = xstrdup(pw_encrypt(cp, salt)); + } else + ret = xstrdup(cp); + + if (!update_passwd(pwfile, pw->pw_name, ret)) { + syslog(LOG_INFO, "password for `%s' changed by user `%s'", name, + myname); + puts("Password changed.\n"); + } else { + syslog(LOG_WARNING, "an error occurred updating the password file"); + bb_error_msg_and_die( + "An error occurred updating the password file.\n" + ); + } + + free(ret); + } + + if (ENABLE_FEATURE_CLEAN_UP) free(myname); + + return 0; +} + diff --git a/loginutils/passwd.c b/loginutils/passwd.c index 8f65c3d..ac31682 100644 --- a/loginutils/passwd.c +++ b/loginutils/passwd.c @@ -70,115 +70,6 @@ static char* new_password(const struct passwd *pw, uid_t myuid, int algo) return ret; } - -static int update_passwd(const char *filename, const char *username, - const char *new_pw) -{ - struct stat sb; - struct flock lock; - FILE *old_fp; - FILE *new_fp; - char *new_name; - char *last_char; - unsigned user_len; - int old_fd; - int new_fd; - int i; - int ret = 1; /* failure */ - - logmode = LOGMODE_STDIO; - /* New passwd file, "/etc/passwd+" for now */ - new_name = xasprintf("%s+", filename); - last_char = &new_name[strlen(new_name)-1]; - username = xasprintf("%s:", username); - user_len = strlen(username); - - old_fp = fopen(filename, "r+"); - if (!old_fp) - goto free_mem; - old_fd = fileno(old_fp); - - /* Try to create "/etc/passwd+". Wait if it exists. */ - i = 30; - do { - // FIXME: on last iteration try w/o O_EXCL but with O_TRUNC? - new_fd = open(new_name, O_WRONLY|O_CREAT|O_EXCL,0600); - if (new_fd >= 0) goto created; - if (errno != EEXIST) break; - usleep(100000); /* 0.1 sec */ - } while (--i); - bb_perror_msg("cannot create '%s'", new_name); - goto close_old_fp; - created: - if (!fstat(old_fd, &sb)) { - fchmod(new_fd, sb.st_mode & 0777); /* ignore errors */ - fchown(new_fd, sb.st_uid, sb.st_gid); - } - new_fp = fdopen(new_fd, "w"); - if (!new_fp) { - close(new_fd); - goto unlink_new; - } - - /* Backup file is "/etc/passwd-" */ - last_char[0] = '-'; - /* Delete old one, create new as a hardlink to current */ - i = (unlink(new_name) && errno != ENOENT); - if (i || link(filename, new_name)) - bb_perror_msg("warning: cannot create backup copy '%s'", new_name); - last_char[0] = '+'; - - /* Lock the password file before updating */ - lock.l_type = F_WRLCK; - lock.l_whence = SEEK_SET; - lock.l_start = 0; - lock.l_len = 0; - if (fcntl(old_fd, F_SETLK, &lock) < 0) - bb_perror_msg("warning: cannot lock '%s'", filename); - lock.l_type = F_UNLCK; - - /* Read current password file, write updated one */ - while (1) { - char *line = xmalloc_fgets(old_fp); - if (!line) break; /* EOF/error */ - if (strncmp(username, line, user_len) == 0) { - /* we have a match with "username:"... */ - const char *cp = line + user_len; - /* now cp -> old passwd, skip it: */ - cp = strchr(cp, ':'); - if (!cp) cp = ""; - /* now cp -> ':' after old passwd or -> "" */ - fprintf(new_fp, "%s%s%s", username, new_pw, cp); - /* Erase password in memory */ - } else - fputs(line, new_fp); - free(line); - } - fcntl(old_fd, F_SETLK, &lock); - - /* We do want all of them to execute, thus | instead of || */ - if ((ferror(old_fp) | fflush(new_fp) | fsync(new_fd) | fclose(new_fp)) - || rename(new_name, filename) - ) { - /* At least one of those failed */ - goto unlink_new; - } - ret = 0; /* whee, success! */ - - unlink_new: - if (ret) unlink(new_name); - - close_old_fp: - fclose(old_fp); - - free_mem: - if (ENABLE_FEATURE_CLEAN_UP) free(new_name); - if (ENABLE_FEATURE_CLEAN_UP) free((char*)username); - logmode = LOGMODE_BOTH; - return ret; -} - - int passwd_main(int argc, char **argv); int passwd_main(int argc, char **argv) { -- 1.5.1.2 From farmatito at tiscali.it Thu Jul 19 06:40:37 2007 From: farmatito at tiscali.it (Tito) Date: Thu, 19 Jul 2007 15:40:37 +0200 Subject: [PATCH] add chpasswd applet In-Reply-To: <1184850097962-git-send-email-virtuoso@slind.org> References: <1184850097962-git-send-email-virtuoso@slind.org> Message-ID: <200707191540.37286.farmatito@tiscali.it> On Thursday 19 July 2007 15:01:37 Alexander Shishkin wrote: > diff --git a/include/applets.h b/include/applets.h > index 90af4f4..a05f74a 100644 Hi, would you mind to send the patch as attachment and in diff -uN format. I'm experiencing some difficulties to apply and test it. patch -p1 -E --dry-run < chpasswd.patch patching file include/applets.h patch: **** malformed patch at line 20: ?USE_CHGRP(APPLET_NOEXEC(chgrp, chgrp, _BB_DIR_BIN, _BB_SUID_NEVER, chgrp)) Ciao, Tito From virtuoso at slind.org Thu Jul 19 06:49:44 2007 From: virtuoso at slind.org (Alexander Shishkin) Date: Thu, 19 Jul 2007 17:49:44 +0400 Subject: [PATCH] add chpasswd applet In-Reply-To: <200707191540.37286.farmatito@tiscali.it> References: <1184850097962-git-send-email-virtuoso@slind.org> <200707191540.37286.farmatito@tiscali.it> Message-ID: <71a0d6ff0707190649x6381898dx8d5cd73a03def82b@mail.gmail.com> On 7/19/07, Tito wrote: > Hi, would you mind to send the patch as attachment and > in diff -uN format. > I'm experiencing some difficulties to apply and test it. Oh, sorry about this. I always get a bit too carried away with git these days. :) Please find the patch attached. Regards, -- Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: add-chpasswd.patch Type: text/x-patch Size: 13808 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070719/2885436d/attachment-0001.bin From farmatito at tiscali.it Thu Jul 19 07:50:35 2007 From: farmatito at tiscali.it (Tito) Date: Thu, 19 Jul 2007 16:50:35 +0200 Subject: [PATCH] add chpasswd applet In-Reply-To: <71a0d6ff0707190649x6381898dx8d5cd73a03def82b@mail.gmail.com> References: <1184850097962-git-send-email-virtuoso@slind.org> <200707191540.37286.farmatito@tiscali.it> <71a0d6ff0707190649x6381898dx8d5cd73a03def82b@mail.gmail.com> Message-ID: <200707191650.35491.farmatito@tiscali.it> On Thursday 19 July 2007 15:49:44 Alexander Shishkin wrote: > On 7/19/07, Tito wrote: > > Hi, would you mind to send the patch as attachment and > > in diff -uN format. > > I'm experiencing some difficulties to apply and test it. > Oh, sorry about this. I always get a bit too carried away with git > these days. :) > Please find the patch attached. > > Regards, Hi, attached you will find a drop in replacement for chpasswd.c with some more busyboxification (use of getopt32 and syslogging capabilities of bb_*_msg_* functions) and some things it seems to me that need to be fixed (this could be done to me being in hurry and not understanding you code... in this case ignore it). This code is only compile tested and needs more care and love. ;-) Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: chpasswd.c Type: text/x-csrc Size: 2638 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070719/e9b978be/attachment.c From sbb at tuxfamily.org Thu Jul 19 09:34:46 2007 From: sbb at tuxfamily.org (Seb) Date: Thu, 19 Jul 2007 18:34:46 +0200 Subject: Probably a bug in ash In-Reply-To: <1158166a0707181427i39823e49y3afd011614e4d9c0@mail.gmail.com> References: <20070628163439.50345aac.sbb@tuxfamily.org> <200707141920.06062.vda.linux@googlemail.com> <20070718205255.edb40556.sbb@tuxfamily.org> <1158166a0707181427i39823e49y3afd011614e4d9c0@mail.gmail.com> Message-ID: <20070719183446.557937e4.sbb@tuxfamily.org> Le Wed, 18 Jul 2007 22:27:06 +0100 "Denis Vlasenko" a ?crit: > Yup. jp can be NULL. Should check for that, like this: > > #if JOBS > /* For "jobs | cat" to work like in bash, we must retain list of jobs > * in child, but we do need to remove ourself */ > if (jp) > freejob(jp); > #else > for (jp = curjob; jp; jp = jp->prev_job) > freejob(jp); > #endif > > Will fix in svn. Please notify dash maintainer too. Ok, it works for both bbox ash and dash. I will post the new patch to Herbert Xu. Although, the problem of infinite loop previously described persists with dash as with bboxash. Do you think it's another side effect of the patch that should be fixed first, or can I send this one "as is" right now ? ++ Seb. From pgf at brightstareng.com Thu Jul 19 11:28:48 2007 From: pgf at brightstareng.com (Paul Fox) Date: Thu, 19 Jul 2007 14:28:48 -0400 Subject: [PATCH] add chpasswd applet In-Reply-To: farmatito's message of Thu, 19 Jul 2007 16:50:35 +0200. <200707191650.35491.farmatito@tiscali.it> Message-ID: <8778.1184869728@brightstareng.com> > attached you will find a drop in replacement > for chpasswd.c with some more busyboxification does this mean that passwd no longer needs the ability to take a password on stdin? there was a thread on that topic a week or two ago. paul =--------------------- paul fox, pgf at brightstareng.com From vda.linux at googlemail.com Thu Jul 19 13:12:57 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 19 Jul 2007 21:12:57 +0100 Subject: WG: Problem with Busybox telnetd In-Reply-To: <200707191020781.SM01468@forstertosh> References: <200707191020781.SM01468@forstertosh> Message-ID: <200707192112.57936.vda.linux@googlemail.com> On Thursday 19 July 2007 09:21, Markus Forster wrote: > Hi there, > > i've activated telnetd in the menuconfig. All went good, i call the telnetd > via inittab and its available. Port 23 is opened so i can connect. > But the server closes the connection directly after connecting with the > following message: > > Trying 192.168.20.30... > Connected to 192.168.20.30. > Escape character is '^]'. > Connection closed by foreign host. > > Whats wrong with it? Strace it. If you can't do that, run it like this: telnetd -F | nc -nu 12345 It will make telnetd send error messages to stdout instead of syslog, and then nc will pipe them into network. Use nc (or tcpdump) to see the telnetd's output from the box as UDP packets arriving to your port 12345. -- vda From virtuoso at slind.org Thu Jul 19 13:38:45 2007 From: virtuoso at slind.org (Alexander Shishkin) Date: Fri, 20 Jul 2007 00:38:45 +0400 Subject: Fwd: [PATCH] add chpasswd applet In-Reply-To: <71a0d6ff0707191333q43af07e8u1ea68da509106ce7@mail.gmail.com> References: <200707191650.35491.farmatito@tiscali.it> <8778.1184869728@brightstareng.com> <71a0d6ff0707191333q43af07e8u1ea68da509106ce7@mail.gmail.com> Message-ID: <71a0d6ff0707191338t70c14c5fo838db1a5cd6377c4@mail.gmail.com> On 7/19/07, Paul Fox wrote: > > attached you will find a drop in replacement > > for chpasswd.c with some more busyboxification > > does this mean that passwd no longer needs the ability to > take a password on stdin? there was a thread on that topic > a week or two ago. Well, given that normally passwd isn't supposed to do that kind of thing and chpasswd exists exactly for that purpose, I hope it does. Regards, -- Alex From virtuoso at slind.org Thu Jul 19 13:37:43 2007 From: virtuoso at slind.org (Alexander Shishkin) Date: Fri, 20 Jul 2007 00:37:43 +0400 Subject: Fwd: [PATCH] add chpasswd applet In-Reply-To: <71a0d6ff0707191328k1c2eeeb3scc303b87434bdaf@mail.gmail.com> References: <1184850097962-git-send-email-virtuoso@slind.org> <200707191540.37286.farmatito@tiscali.it> <71a0d6ff0707190649x6381898dx8d5cd73a03def82b@mail.gmail.com> <200707191650.35491.farmatito@tiscali.it> <71a0d6ff0707191328k1c2eeeb3scc303b87434bdaf@mail.gmail.com> Message-ID: <71a0d6ff0707191337i6acb045ch595afb7c70896f60@mail.gmail.com> On 7/19/07, Tito wrote: > Hi, Hi, > attached you will find a drop in replacement > for chpasswd.c with some more busyboxification > (use of getopt32 and syslogging capabilities of > bb_*_msg_* functions) and some things it seems to me that > need to be fixed (this could be done to me being in hurry > and not understanding you code... in this case ignore it). > This code is only compile tested and needs more care and love. ;-) Thanks for pointing these things out! I've done some more tweaking on the applet. Attached please find an updated patch. Regards, -- Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: add-chpasswd_take2.patch Type: text/x-patch Size: 13397 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070720/44ad3fc2/attachment.bin From farmatito at tiscali.it Thu Jul 19 13:55:42 2007 From: farmatito at tiscali.it (Tito) Date: Thu, 19 Jul 2007 22:55:42 +0200 Subject: Fwd: [PATCH] add chpasswd applet -- use passwd instead In-Reply-To: <71a0d6ff0707191337i6acb045ch595afb7c70896f60@mail.gmail.com> References: <1184850097962-git-send-email-virtuoso@slind.org> <71a0d6ff0707191328k1c2eeeb3scc303b87434bdaf@mail.gmail.com> <71a0d6ff0707191337i6acb045ch595afb7c70896f60@mail.gmail.com> Message-ID: <200707192255.42734.farmatito@tiscali.it> On Thursday 19 July 2007 22:37:43 Alexander Shishkin wrote: > On 7/19/07, Tito wrote: > > Hi, > Hi, > > > attached you will find a drop in replacement > > for chpasswd.c with some more busyboxification > > (use of getopt32 and syslogging capabilities of > > bb_*_msg_* functions) and some things it seems to me that > > need to be fixed (this could be done to me being in hurry > > and not understanding you code... in this case ignore it). > > This code is only compile tested and needs more care and love. ;-) > Thanks for pointing these things out! I've done some more tweaking on > the applet. Attached please find an updated patch. > > Regards, > -- > Alex > Hi, would something like passwd USER PASSWORD work for you? If yes, can you please test this modified version of passwd. So we can avoid code duplication. The non interactive mode is switched on with a config option. Add this to loginutils/Config.in after config FEATURE_PASSWD_WEAK_CHECK. --------------------------------- config FEATURE_NON_INTERACTIVE_PASSWD bool "Allow passwords to be set non interactively (UNSAFE)" default n depends on PASSWD help With this option passwd will accept USER and PASSWD from the command line and set them non interactively. THIS IS UNSAFE!!! ------------------------------------ and use passwd.c as drop-in replacement. (TODO the help text in usage.h needs to be fixed.) This is only a little tested, hints, critics and improvements are welcome. If this solution is not ok for you i'll give one more look at your patch. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: passwd.c Type: text/x-csrc Size: 8124 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070719/6e4fad99/attachment-0001.c From virtuoso at slind.org Thu Jul 19 14:32:09 2007 From: virtuoso at slind.org (Alexander Shishkin) Date: Fri, 20 Jul 2007 01:32:09 +0400 Subject: Fwd: [PATCH] add chpasswd applet -- use passwd instead In-Reply-To: <200707192255.42734.farmatito@tiscali.it> References: <1184850097962-git-send-email-virtuoso@slind.org> <71a0d6ff0707191328k1c2eeeb3scc303b87434bdaf@mail.gmail.com> <71a0d6ff0707191337i6acb045ch595afb7c70896f60@mail.gmail.com> <200707192255.42734.farmatito@tiscali.it> Message-ID: <71a0d6ff0707191432r1e24937m2e09a70bc7f469d@mail.gmail.com> On 7/20/07, Tito wrote: > Hi, Hi, > would something like passwd USER PASSWORD work for you? Unfortunately it won't, the reason being that the distro has two variants of core system (one busybox based and another -- coreutils based), and at least bootstrapping procedure relies on both variants having chpasswd. (and of course, both variants have to provide roughly same functionality). Not to mention a perfectly valid statement made here http://busybox.net/lists/busybox/2007-July/028093.html > If yes, can you please test this modified version of passwd. > So we can avoid code duplication. Is it really better than having another little function? > The non interactive mode is switched on with a config option. > Add this to loginutils/Config.in after config FEATURE_PASSWD_WEAK_CHECK. > --------------------------------- > config FEATURE_NON_INTERACTIVE_PASSWD > bool "Allow passwords to be set non interactively (UNSAFE)" > default n > depends on PASSWD > help > With this option passwd will accept USER and PASSWD from > the command line and set them non interactively. > THIS IS UNSAFE!!! > ------------------------------------ > > and use passwd.c as drop-in replacement. > (TODO the help text in usage.h needs to be fixed.) > > This is only a little tested, hints, critics and improvements are welcome. > If this solution is not ok for you i'll give one more look at your patch. Well, I'd be grateful. If you still find code duplication matter serious here, I'd volunteer to invest some time into reworking {ch,}passwd.c to minimize/eliminate this duplication. Regards, -- Alex From vda.linux at googlemail.com Thu Jul 19 14:42:50 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 19 Jul 2007 22:42:50 +0100 Subject: [PATCH] add a config option for ifstate location In-Reply-To: <11848298961166-git-send-email-virtuoso@slind.org> References: <11848298961166-git-send-email-virtuoso@slind.org> Message-ID: <200707192242.50909.vda.linux@googlemail.com> On Thursday 19 July 2007 08:24, Alexander Shishkin wrote: > ifupdown keeps information on which interfaces are up in a file > called ifstate. Typically it is located in /var/run/ifstate, > however some distributions tend to put it in different places > (like debian, for example, uses /etc/network/run/ifstate). This > patch adds a config option that defines the location of ifstate. Applied to svn, thanks. -- vda From vda.linux at googlemail.com Thu Jul 19 15:45:26 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 19 Jul 2007 23:45:26 +0100 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070719101521.92B7.YNAKAM@hitachisoft.jp> References: <20070702142205.3CC1.YNAKAM@hitachisoft.jp> <200707172248.20432.vda.linux@googlemail.com> <20070719101521.92B7.YNAKAM@hitachisoft.jp> Message-ID: <200707192345.26805.vda.linux@googlemail.com> Hi, Unlike me, you aren't late with replies. Cool. On Thursday 19 July 2007 02:17, Yuichi Nakamura wrote: > > Sorry, late reply :(( > > > > On Monday 02 July 2007 06:29, Yuichi Nakamura wrote: > > > I would like to submit setfiles/restorecon applet. > > > setfiles and restorecon are SELinux commands that > > > label files according to configuration file > > > (in configuration file, relationship between file and label is > > > described). > > > > > > These applets are very important for SELinux enabled system. > > > Please review and consider merging this patch. > > > > Took a look: > > > > * Trimmed help text a bit > > * Removed \n at the end of bb_[p]error > > * Removed progname (using applet_name) > > * Removed restorecon.c - USE_RESTORECON(APPLET_ODDNAME...) handles that > > * int -> smallint for many flag variables > > This needs improvement - many of those flags are already accessible > > as (option_mask32 & BIT_MASK), you don't need separate variables > > > > Please take a look at: > > * Do you really have to have fork()? > I looked code again and found it unnecessary so removed. > > > > * Maybe use xstrdup instead of strdupa > Fixed. > > > * nftw() is not used in bbox. We have recursive_action(). > > It will be better if we won't pull in nftw() into busybox > > just for this applet. > Fixed to use recursive_action instead of nftw. > > > * Do not do "if (applet_is_restorecon && option_x) bb_show_usage()" > > Just remove 'x' flag from optarg32 instead. > Fixed. > > > > > If some of the above is not feasible, explain that. > > > > Please see attached updated patch. > > -- > > vda > > In addition, I am using struct globals for static data. > Attached is revised patch, please look at. See attached patch. bb_common_bufsiz1 trick must have compile-time check (unless it's trivially obvious that it is ok, like "I have 10 static ints only") unsigned long long count; Provided that you rarely see more than 4000000000 files and even then count overflow only upset star display (cosmetics), please use just "unsigned". static int restore(const char *file) { char *my_file = strdupa(file); Convert to xstrdup please. if (count % 1000 == 0) { if (count % 80000 == 0) Maybe ((count & 0x3ff) == 0) /* every 1024 files */ - code may be smaller & faster... bb_error_msg("%s not reset customized by admin to %s", "FILE not reset customized by admin to XXXX" - I think colon and/or commas need to added. Maybe "FILE: not reset, customized by admin to XXXX" but I still don't 100% understand the message. Maybe "File's context not reset"? And what does "customized by root" mean - file's context is set in some /etc/xxx file? Try to provide a clear message. (Sometimes it takes quite a time to come up with clear _and_ not very long message. Take that time). if (context) freecon(context); if() is redundant. ret = lsetfilecon(my_file, newcon); if (ret) { bb_perror_msg("lsetfileconon(%s,%s)", my_file, newcon); goto out; } out: freecon(newcon); return 0; err: freecon(newcon); return -1; Maybe it makes sense to group all three free() here, ensure that variables are allocated or NULL: retval = 0; ... ... err: retval--; /* == -1 */ out: free(my_file); freecon(context); freecon(newcon); return retval; } and you will have single exit point (and probably smaller code - 3 free[con] instead of 5 you have now). #define OPT_c (1<<0) ... if (applet_name[0] == 'r') { /* restorecon */ flags = getopt32(argc, argv, "de:f:ilnpqrsvo:FRW", &exclude_dir, &input_filename, &out_filename, &verbose); } else { /* setfiles */ flags = getopt32(argc, argv, "c:de:f:ilnpqr:svo:FW", &policyfile, &exclude_dir, &input_filename, &rootpath, &out_filename, } For restorecon OPT_c will mean "-d"! In such cases you just need to move all common flags to the beginning of string, the rest should be after. IOW: - "de:f:ilnpqrsvo:FRW" - "c:de:f:ilnpqr:svo:FW" + "de:f:ilnpqrsvo:FWR" + "de:f:ilnpqr:svo:FWc:" with OPT_xxx renumbered accordingly. #if ENABLE_FEATURE_SETFILES_CHECK_OPTION ... #else bb_error_msg_and_die("-c is not supported"); #endif Just add "c:" to getopt32 string conditionally instead: "xxxxxxxxxxxxxxxx" USE_FEATURE_SETFILES_CHECK_OPTION("c:") -- vda -------------- next part -------------- A non-text attachment was scrubbed... Name: 2.patch Type: text/x-diff Size: 22178 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070719/1824cf07/attachment-0001.bin From ynakam at hitachisoft.jp Thu Jul 19 21:29:07 2007 From: ynakam at hitachisoft.jp (Yuichi Nakamura) Date: Fri, 20 Jul 2007 13:29:07 +0900 Subject: [patch]setfiles/restorecon applet In-Reply-To: <200707192345.26805.vda.linux@googlemail.com> References: <20070719101521.92B7.YNAKAM@hitachisoft.jp> <200707192345.26805.vda.linux@googlemail.com> Message-ID: <20070720132230.60CB.YNAKAM@hitachisoft.jp> On Thu, 19 Jul 2007 23:45:26 +0100 Denis Vlasenko wrote: > Hi, > > Unlike me, you aren't late with replies. Cool. Thank you. And thanks your quick reply too ! > > Attached is revised patch, please look at. > > See attached patch. bb_common_bufsiz1 trick must have compile-time check > (unless it's trivially obvious that it is ok, like "I have 10 static ints only") > > unsigned long long count; > > Provided that you rarely see more than 4000000000 files and even then > count overflow only upset star display (cosmetics), please use just "unsigned". Fixed. Using unsigned. > > static int restore(const char *file) > { > char *my_file = strdupa(file); > > Convert to xstrdup please. > > if (count % 1000 == 0) { > if (count % 80000 == 0) > > Maybe ((count & 0x3ff) == 0) /* every 1024 files */ > - code may be smaller & faster... Fixed. > > bb_error_msg("%s not reset customized by admin to %s", > > "FILE not reset customized by admin to XXXX" - I think colon and/or > commas need to added. Maybe > > "FILE: not reset, customized by admin to XXXX" > > but I still don't 100% understand the message. Maybe "File's context not reset"? > And what does "customized by root" mean - file's context is set in some /etc/xxx file? > Try to provide a clear message. (Sometimes it takes quite a time > to come up with clear _and_ not very long message. Take that time). Fixed. Made it shorter. > > if (context) > freecon(context); > > if() is redundant. > > ret = lsetfilecon(my_file, newcon); > if (ret) { > bb_perror_msg("lsetfileconon(%s,%s)", my_file, newcon); > goto out; > } > out: > freecon(newcon); > return 0; > err: > freecon(newcon); > return -1; > > Maybe it makes sense to group all three free() here, ensure that variables > are allocated or NULL: > > retval = 0; > ... > ... > err: > retval--; /* == -1 */ > out: > free(my_file); > freecon(context); > freecon(newcon); > return retval; > } > > and you will have single exit point (and probably smaller code - 3 free[con] > instead of 5 you have now). OOps, I have forgotten to free my_file. Fixed. > > > > #define OPT_c (1<<0) > ... > if (applet_name[0] == 'r') { /* restorecon */ > flags = getopt32(argc, argv, "de:f:ilnpqrsvo:FRW", &exclude_dir, &input_filename, &out_filename, &verbose); > } else { /* setfiles */ > flags = getopt32(argc, argv, "c:de:f:ilnpqr:svo:FW", &policyfile, &exclude_dir, &input_filename, &rootpath, &out_filename, > } > > For restorecon OPT_c will mean "-d"! > In such cases you just need to move all common flags to the beginning > of string, the rest should be after. IOW: > > - "de:f:ilnpqrsvo:FRW" > - "c:de:f:ilnpqr:svo:FW" > + "de:f:ilnpqrsvo:FWR" > + "de:f:ilnpqr:svo:FWc:" > > with OPT_xxx renumbered accordingly. It was a big mistake. Fixed. > > > > #if ENABLE_FEATURE_SETFILES_CHECK_OPTION > ... > #else > bb_error_msg_and_die("-c is not supported"); > #endif > > Just add "c:" to getopt32 string conditionally instead: > "xxxxxxxxxxxxxxxx" USE_FEATURE_SETFILES_CHECK_OPTION("c:") Fixed. > -- > vda Attached is updated patch. Regards, -- Yuichi Nakamura Hitachi Software Engineering Co., Ltd. Japan SELinux Users Group(JSELUG): http://www.selinux.gr.jp/ SELinux Policy Editor: http://seedit.sourceforge.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: 3.patch Type: application/octet-stream Size: 22010 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070720/260e5873/attachment-0001.obj From vda.linux at googlemail.com Fri Jul 20 12:44:17 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 20 Jul 2007 20:44:17 +0100 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070720132230.60CB.YNAKAM@hitachisoft.jp> References: <20070719101521.92B7.YNAKAM@hitachisoft.jp> <200707192345.26805.vda.linux@googlemail.com> <20070720132230.60CB.YNAKAM@hitachisoft.jp> Message-ID: <200707202044.17800.vda.linux@googlemail.com> On Friday 20 July 2007 05:29, Yuichi Nakamura wrote: > Attached is updated patch. I changed it a bit, see attached. Can you clarify this part? ret = lsetfilecon(my_file, newcon); if (ret) { bb_perror_msg("lsetfileconon(%s,%s)", my_file, newcon); goto out; } err: retval--; out: freecon(context); freecon(newcon); free(my_file_orig); return retval; } Looks like if lsetfilecon fails, we return success - ?! Is it really right? -- vda -------------- next part -------------- A non-text attachment was scrubbed... Name: 2.patch Type: text/x-diff Size: 22381 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070720/0e7b743d/attachment.bin From vda.linux at googlemail.com Fri Jul 20 14:22:56 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 20 Jul 2007 22:22:56 +0100 Subject: Fwd: [PATCH] add chpasswd applet In-Reply-To: <71a0d6ff0707191337i6acb045ch595afb7c70896f60@mail.gmail.com> References: <1184850097962-git-send-email-virtuoso@slind.org> <71a0d6ff0707191328k1c2eeeb3scc303b87434bdaf@mail.gmail.com> <71a0d6ff0707191337i6acb045ch595afb7c70896f60@mail.gmail.com> Message-ID: <200707202222.56596.vda.linux@googlemail.com> On Thursday 19 July 2007 21:37, Alexander Shishkin wrote: > On 7/19/07, Tito wrote: > > Hi, > Hi, > > > attached you will find a drop in replacement > > for chpasswd.c with some more busyboxification > > (use of getopt32 and syslogging capabilities of > > bb_*_msg_* functions) and some things it seems to me that > > need to be fixed (this could be done to me being in hurry > > and not understanding you code... in this case ignore it). > > This code is only compile tested and needs more care and love. ;-) > Thanks for pointing these things out! I've done some more tweaking on > the applet. Attached please find an updated patch. Question: why malformed line without password results in warning, but invalid username aborts? bb_error_msg("missing new password"); continue; } *pass++ = '\0'; if (!getpwnam(name)) bb_error_msg_and_die("unknown user %s", name); Seems inconsistent to me. Btw, do we need to check that user exists? Without such check, nonexistent users are just ignored and code is smaller. Testing it. Nice: echo -e "guest:qqqq\ntest:qqqq" | ./busybox chpasswd and crypt_make_salt() generates same salt for both! :)) Bunch of other bugs too: shadow passwords check is backwards,... Applied to svn. Enjoy/test. -- vda From vda.linux at googlemail.com Fri Jul 20 14:25:55 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 20 Jul 2007 22:25:55 +0100 Subject: busybox post from creder@digitalcpt.com requires approval In-Reply-To: References: Message-ID: <200707202225.55244.vda.linux@googlemail.com> On Friday 20 July 2007 16:25, busybox-owner at busybox.net wrote: > As list administrator, your authorization is requested for the > following mailing list posting: > > List: busybox at busybox.net > From: creder at digitalcpt.com > Subject: tftp, kernel crash, attempt to kill init > Reason: Message body is too big: 134265 bytes with a limit of 40 KB > > At your convenience, visit: > > http://busybox.net/cgi-bin/mailman/admindb/busybox > > to approve or deny the request. Hello all, I am using busybox v 1.5.1 with tftp. ?I have been trying to use tftp to get files and update u-boot and the kernel in our AT91RM9200 system. I used to have the file system with busybox on a nor flash and it would crash out after transferring about 300k worth of a file (kernel is about 1.3 mb). ?Because we had to move the file system to our nand flash, I didn't debug it. ?Now that it is on the nand flash, I get the following crash dump. Is there anything that I need to setup in order for busybox to properly write to the flash? Any help or guidance would be appreciated. Start by sending smaller mails to mailing lists. Is it NOMMU architechture? -- vda From creder at digitalcpt.com Fri Jul 20 14:47:03 2007 From: creder at digitalcpt.com (Christopher Reder) Date: Fri, 20 Jul 2007 21:47:03 -0000 Subject: busybox post from creder@digitalcpt.com requires approval Message-ID: <200707201635.SM00588@mail.digitalcpt.com> Denis, yes, I only realized after sending it that it was too long and in fact, canceled the message on the website. This does have a MMU and is a ARM0, AT91RM9200. When using the Nor Flash, after transferring about 320k, the kernel crashes and the transfer aborts. Has anyone been able to use tftp for larger files (>1MB) without issues on v1.5.1 ? TIA and sorry about the longer output. ---------- Original Message ---------------------------------- From: Denis Vlasenko Date: Fri, 20 Jul 2007 22:25:55 +0100 >On Friday 20 July 2007 16:25, busybox-owner at busybox.net wrote: >> As list administrator, your authorization is requested for the >> following mailing list posting: >>=20 >> List: busybox at busybox.net >> From: creder at digitalcpt.com >> Subject: tftp, kernel crash, attempt to kill init >> Reason: Message body is too big: 134265 bytes with a limit of 40 KB >>=20 >> At your convenience, visit: >>=20 >> http://busybox.net/cgi-bin/mailman/admindb/busybox >> =20 >> to approve or deny the request. > > >Hello all, I am using busybox v 1.5.1 with tftp. =9AI have been trying to u= >se >tftp to get files and update u-boot and the kernel in our AT91RM9200 system. >I used to have the file system with busybox on a nor flash and it would >crash out after transferring about 300k worth of a file (kernel is about 1.3 >mb). =9ABecause we had to move the file system to our nand flash, I didn't >debug it. =9ANow that it is on the nand flash, I get the following crash du= >mp. >Is there anything that I need to setup in order for busybox to properly >write to the flash? > >Any help or guidance would be appreciated. > > >Start by sending smaller mails to mailing lists. > >Is it NOMMU architechture? >=2D- >vda From farmatito at tiscali.it Fri Jul 20 15:12:47 2007 From: farmatito at tiscali.it (Tito) Date: Sat, 21 Jul 2007 00:12:47 +0200 Subject: Fwd: [PATCH] add chpasswd applet In-Reply-To: <200707202222.56596.vda.linux@googlemail.com> References: <1184850097962-git-send-email-virtuoso@slind.org> <71a0d6ff0707191337i6acb045ch595afb7c70896f60@mail.gmail.com> <200707202222.56596.vda.linux@googlemail.com> Message-ID: <200707210012.47455.farmatito@tiscali.it> On Friday 20 July 2007 23:22:56 Denis Vlasenko wrote: > On Thursday 19 July 2007 21:37, Alexander Shishkin wrote: > > On 7/19/07, Tito wrote: > > > Hi, > > Hi, > > > > > attached you will find a drop in replacement > > > for chpasswd.c with some more busyboxification > > > (use of getopt32 and syslogging capabilities of > > > bb_*_msg_* functions) and some things it seems to me that > > > need to be fixed (this could be done to me being in hurry > > > and not understanding you code... in this case ignore it). > > > This code is only compile tested and needs more care and love. ;-) > > Thanks for pointing these things out! I've done some more tweaking on > > the applet. Attached please find an updated patch. > > Question: why malformed line without password results in warning, > but invalid username aborts? > > bb_error_msg("missing new password"); > continue; > } > *pass++ = '\0'; > > if (!getpwnam(name)) > bb_error_msg_and_die("unknown user %s", name); > > Seems inconsistent to me. > > Btw, do we need to check that user exists? Without such check, > nonexistent users are just ignored and code is smaller. > > Testing it. Nice: > > echo -e "guest:qqqq\ntest:qqqq" | ./busybox chpasswd > > and crypt_make_salt() generates same salt for both! :)) > Bunch of other bugs too: shadow passwords check is backwards,... > > Applied to svn. Enjoy/test. > -- > vda > Hi, you were so fast this time, i was just reworking it.... So here is a new version of chpasswd.c that saves some space. bloat-o-meter says: root at localhost:~/Desktop/busybox# scripts/bloat-o-meter busybox_old busybox_unstripped function old new delta .rodata 122925 122893 -32 chpasswd_main 483 406 -77 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-109) Total: -109 bytes Little tested. Comments are welcome. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: chpasswd.c Type: text/x-csrc Size: 2345 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070721/7900f9b9/attachment.c From vapier at gentoo.org Fri Jul 20 15:33:36 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Fri, 20 Jul 2007 18:33:36 -0400 Subject: busybox post from creder@digitalcpt.com requires approval In-Reply-To: <200707202225.55244.vda.linux@googlemail.com> References: <200707202225.55244.vda.linux@googlemail.com> Message-ID: <200707201833.37091.vapier@gentoo.org> On Friday 20 July 2007, Denis Vlasenko wrote: > > Hello all, I am using busybox v 1.5.1 with tftp. ?I have been trying to use > tftp to get files and update u-boot and the kernel in our AT91RM9200 > system. I used to have the file system with busybox on a nor flash and it > would crash out after transferring about 300k worth of a file (kernel is > about 1.3 mb). ?Because we had to move the file system to our nand flash, I > didn't debug it. ?Now that it is on the nand flash, I get the following > crash dump. Is there anything that I need to setup in order for busybox to > properly write to the flash? > > Any help or guidance would be appreciated. > > > Start by sending smaller mails to mailing lists. > > Is it NOMMU architechture? what do you mean by "crash out" ? if it was the kernel, then it isnt a busybox bug and you need to seek guidance from wherever you got your kernel ... -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/20070720/d2cc9d59/attachment.pgp From vapier at gentoo.org Fri Jul 20 15:36:28 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Fri, 20 Jul 2007 18:36:28 -0400 Subject: busybox post from creder@digitalcpt.com requires approval In-Reply-To: <200707201833.37091.vapier@gentoo.org> References: <200707202225.55244.vda.linux@googlemail.com> <200707201833.37091.vapier@gentoo.org> Message-ID: <200707201836.29252.vapier@gentoo.org> On Friday 20 July 2007, Mike Frysinger wrote: > On Friday 20 July 2007, Denis Vlasenko wrote: > > > > Hello all, I am using busybox v 1.5.1 with tftp. ?I have been trying to > > use tftp to get files and update u-boot and the kernel in our AT91RM9200 > > system. I used to have the file system with busybox on a nor flash and it > > would crash out after transferring about 300k worth of a file (kernel is > > about 1.3 mb). ?Because we had to move the file system to our nand flash, > > I didn't debug it. ?Now that it is on the nand flash, I get the following > > crash dump. Is there anything that I need to setup in order for busybox > > to properly write to the flash? > > > > Any help or guidance would be appreciated. > > > > > > Start by sending smaller mails to mailing lists. > > > > Is it NOMMU architechture? > > what do you mean by "crash out" ? if it was the kernel, then it isnt a > busybox bug and you need to seek guidance from wherever you got your > kernel ... sorry, just read the message that was sent to the owners list ... that is a kernel crash, not busybox ... and it's MMU because you can see the error is about paging a virtual address please seek help from your kernel source, not busybox -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/20070720/7095d749/attachment.pgp From farmatito at tiscali.it Fri Jul 20 15:49:37 2007 From: farmatito at tiscali.it (Tito) Date: Sat, 21 Jul 2007 00:49:37 +0200 Subject: Fwd: [PATCH] chpasswd applet size reduction and bugfix In-Reply-To: <200707210012.47455.farmatito@tiscali.it> References: <1184850097962-git-send-email-virtuoso@slind.org> <200707202222.56596.vda.linux@googlemail.com> <200707210012.47455.farmatito@tiscali.it> Message-ID: <200707210049.37239.farmatito@tiscali.it> On Saturday 21 July 2007 00:12:47 Tito wrote: > On Friday 20 July 2007 23:22:56 Denis Vlasenko wrote: > > On Thursday 19 July 2007 21:37, Alexander Shishkin wrote: > > > On 7/19/07, Tito wrote: > > > > Hi, > > > Hi, > > > > > > > attached you will find a drop in replacement > > > > for chpasswd.c with some more busyboxification > > > > (use of getopt32 and syslogging capabilities of > > > > bb_*_msg_* functions) and some things it seems to me that > > > > need to be fixed (this could be done to me being in hurry > > > > and not understanding you code... in this case ignore it). > > > > This code is only compile tested and needs more care and love. ;-) > > > Thanks for pointing these things out! I've done some more tweaking on > > > the applet. Attached please find an updated patch. > > > > Question: why malformed line without password results in warning, > > but invalid username aborts? > > > > bb_error_msg("missing new password"); > > continue; > > } > > *pass++ = '\0'; > > > > if (!getpwnam(name)) > > bb_error_msg_and_die("unknown user %s", name); > > > > Seems inconsistent to me. > > > > Btw, do we need to check that user exists? Without such check, > > nonexistent users are just ignored and code is smaller. > > > > Testing it. Nice: > > > > echo -e "guest:qqqq\ntest:qqqq" | ./busybox chpasswd > > > > and crypt_make_salt() generates same salt for both! :)) > > Bunch of other bugs too: shadow passwords check is backwards,... > > > > Applied to svn. Enjoy/test. > > -- > > vda > > > > Hi, > you were so fast this time, i was just reworking it.... > So here is a new version of chpasswd.c that saves some space. > bloat-o-meter says: > > root at localhost:~/Desktop/busybox# scripts/bloat-o-meter busybox_old busybox_unstripped > function old new delta > .rodata 122925 122893 -32 > chpasswd_main 483 406 -77 > ------------------------------------------------------------------------------ > (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-109) Total: -109 bytes > > Little tested. > Comments are welcome. > > Ciao, > Tito Hi, here is a diff of my rework against svn, size reduction now is: scripts/bloat-o-meter busybox_old busybox_unstripped function old new delta chpasswd_main 349 323 -26 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-26) Total: -26 bytes it fixes also a bug in commandline parsing: chpasswd must error out if -m and -e are set at the same time. Little tested. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: chpasswd03.patch Type: text/x-diff Size: 1653 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070721/9edfee29/attachment.bin From vda.linux at googlemail.com Fri Jul 20 17:37:49 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 21 Jul 2007 01:37:49 +0100 Subject: busybox post from creder@digitalcpt.com requires approval In-Reply-To: <200707201635.SM00588@mail.digitalcpt.com> References: <200707201635.SM00588@mail.digitalcpt.com> Message-ID: <200707210137.49632.vda.linux@googlemail.com> On Thursday 01 January 1970 01:00, Christopher Reder wrote: > Denis, yes, I only realized after sending it that it was too long and in fact, canceled the message on the website. This does have a MMU and is a ARM0, AT91RM9200. When using the Nor Flash, after transferring about 320k, the kernel crashes and the transfer aborts. Kernel should not crash. Ever. No matter now buggy application is, kernel should never crash. You see kernel crashing - it means youu see kernel bug and it should be diagnosed and fixed first, regardless of whether busybox's tftp is buggy or not. > Has anyone been able to use tftp for larger files (>1MB) without issues on v1.5.1? Because of the above this question is sort of off-target here. I suspect that you just don't try hard enough to actually look closely and understand the problem, throwing haphazardly composed posts on semi-relevant mailing lists instead. Look a at your post again. Oops output is double-spaced and linewrapped. Did you spend even a second thinking how people on the list are supposed to read and understand that? It should be formatted approx. like this: # tftp -g -r u-boot.bin 192.168.0.38 Unable to handle kernel paging request at virtual address 1a000003 pgd = c1fe4000 [1a000003] *pgd=00000000 Internal error: Oops: 3 [#1] Modules linked in: CPU: 0 PC is at __wake_up_common+0x28/0x7c LR is at 0x1a000003 pc : [] ? ?lr : [<1a000003>] ? ?Not tainted sp : c1fd9c98 ?ip : c1fd9cc4 ?fp : c1fd9cc0 r10: 00000003 ?r9 : c1fd9cdc ?r8 : 00000000 r7 : 00000001 ?r6 : c0000070 ?r5 : c031d000 ?r4 : 00000013 r3 : 00000000 ?r2 : 00000001 ?r1 : 00000003 ?r0 : c0000070 Flags: nzcv ?IRQs off ?FIQs on ?Mode SVC_32 ?Segment user Control: C000717F Table: 21FE4000 ?DAC: 00000015 Process tftp (pid: 773, stack limit = 0xc1fd8250) Stack: (0xc1fd9c98 to 0xc1fda000) 9c80: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 00000013 c031d000 9ca0: 00000200 c03b0258 00000000 00008200 00000000 c1fd9cd8 c1fd9cc4 c003c028 9cc0: c003bf90 c1fd9cdc c031d000 c1fd9cf0 c1fd9cdc c0054a1c c003c00c c031d000 9ce0: 00000000 c1fd9d04 c1fd9cf4 c00622a4 c00549fc 00000200 c1fd9db0 c1fd9d08 9d00: c0064234 c0062270 00000200 c1fd9d18 c01a7e08 c0370840 c0370840 00000200 9d20: 000b3464 c03b01c4 c020bce4 c1edd8a0 00000001 c1fd9ea0 00000000 00000200 9d40: c1fd9e98 c1370840 00000001 00000000 c031d000 c01a7d38 c01a7c1c 000004ce 9d60: 27f95cfb c1fd9d94 c1fd9d90 c1fd9d78 c00445d0 c0044538 c03b01c4 00000000 9d80: c1fd9d94 c1fd9db4 00008000 00000000 00000000 c1fd8000 c03b01c4 c1edd8a0 9da0: 00000200 c1fd9e4c c1fd9db8 c0064b38 c0063f3c 00008000 00000000 c1fd9ee8 9dc0: 00000000 00000200 00000010 c0368320 c1fd9f64 00000204 00000000 c03b0258 9de0: c1fd9ee8 c1fd9e98 c1fd9ea0 00000001 00000200 00008000 00000000 c1fede40 9e00: 00000000 00000000 c1fd9f64 c1fd8000 00000004 00000004 00000001 c1fd8000 9e20: be9a7c30 c1fd9ea0 00008000 00000000 c1fd9ee8 c03b01c4 c1fd9e98 c03b022c 9e40: c1fd9e8c c1fd9e50 c0064ea4 c0064848 00000000 c0368320 c03b0258 c1edd8a0 9e60: 00000001 00008000 00000000 c1fd9ea0 c1fd9e98 c1fd9ee8 c1fd9f78 c1edd8a0 9e80: c1fd9f4c c1fd9e94 c007f154 c0064e40 00008000 00000000 000b3264 00000200 9ea0: be9a7bdc 00000010 00000000 00000001 ffffffff c1edd8a0 00000000 00000000 9ec0: 00000000 00000000 c0368320 00000000 00000000 000b3464 c0368320 c00548cc 9ee0: c1fd9ee0 c1fd9ee0 00008000 00000000 00000000 00000000 00000000 d60c0002 9f00: 2600a8c0 00000200 00000000 c1edd8a0 000b3264 00000200 c1fd9f78 00000000 9f20: 00000000 c1edd8a0 000b3264 c1fd9f78 00000200 c1fd8000 c1fd8000 00000204 9f40: c1fd9f74 c1fd9f50 c007f254 c007f09c 00000000 c1edd8c0 c1edd8a0 c1fd9f78 9f60: 00008000 00000000 c1fd9fa4 c1fd9f78 c007f3ec c007f1b0 00008000 00000000 9f80: 00000000 00000200 00000200 000b3264 00000004 c002af04 00000000 c1fd9fa8 9fa0: c002ad60 c007f3b0 00000200 00000200 00000004 000b3264 00000200 00000001 9fc0: 00000200 00000200 000b3264 00000004 00000003 000b3260 00000204 be9a7ce0 9fe0: 000ae328 be9a7ba0 0003b558 4005ce0c 20000010 00000004 00000000 00000000 Backtrace: [] (__wake_up_common+0x0/0x7c) from [] (__wake_up+0x2c/0x34) [] (__wake_up+0x0/0x34) from [] (__wake_up_bit+0x30/0x38) ?r4 = C031D000 [] (__wake_up_bit+0x0/0x38) from [] (unlock_page+0x44/0x5c) [] (unlock_page+0x0/0x5c) from [] (generic_file_buffered_write+0x30c/0x674) ?r4 = 00000200 [] (generic_file_buffered_write+0x4/0x674) from [] (__generic_file_aio_write_nolock+0x300/0x5f4) [] (__generic_file_aio_write_nolock+0x0/0x5f4) from [] (generic_file_aio_write+0x78/0x104) [] (generic_file_aio_write+0x4/0x104) from [] (do_sync_write+0xc8/0x114) [] (do_sync_write+0x0/0x114) from [] (vfs_write+0xb4/0x184) [] (vfs_write+0x0/0x184) from [] (sys_write+0x4c/0x7c) ?r8 = 00000000 ?r7 = 00008000 ?r6 = C1FD9F78 ?r5 = C1EDD8A0 ?r4 = C1EDD8C0 [] (sys_write+0x0/0x7c) from [] (ret_fast_syscall+0x0/0x2c) ?r8 = C002AF04 ?r7 = 00000004 ?r6 = 000B3264 ?r5 = 00000200 ?r4 = 00000200 Code: e1a0a001 e1a07002 e1a08003 e59b9004 (e59e5000) ?<1>Unable to handle kernel paging request at virtual address e5902008 pgd = c1fe4000 [e5902008] *pgd=00000000 And yes, I did a few tftp transfers here for testing purposes, some of them much bigger than 1MB. (If doesn't mean that tftp can't have bugs. It surely can). In attachment you may find hints how to hunt down an oops. -- vda -------------- next part -------------- Okay, so you've got an oops and want to find out what happened? In this HOWTO, I presume you did not delete and did not tamper with your kernel build tree. Also, I recommend you to enable these options in the .config: CONFIG_DEBUG_SLAB=y CONFIG_FRAME_POINTER=y CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y First one makes use-after-free bug hunt easy, second gives you much more reliable stacktraces. Next two give you decoded oops (2.6 only). If you are running 2.4 kernel, please make sure you run your klogd with -x switch. 1. An OOPS decoding walkthrough Ok, let's take a look at example OOPS. ^^^^ marks are mine. Unable to handle kernel NULL pointer dereference at virtual address 00000e14 printing eip: c0162887 *pde = 00000000 Oops: 0000 [#1] PREEMPT Modules linked in: eeprom snd_seq_oss snd_seq_midi_event.......... CPU: 0 EIP: 0060:[] Not tainted EFLAGS: 00010206 (2.6.7-nf2) EIP is at prune_dcache+0x147/0x1c0 ^^^^^^^^^^^^^^^^^^^^^^^^ eax: 00000e00 ebx: d1bde050 ecx: f1b3c050 edx: f1b3ac50 esi: f1b3ac40 edi: c1973000 ebp: 00000036 esp: c1973ef8 ds: 007b es: 007b ss: 0068 Process kswapd0 (pid: 65, threadinfo=c1973000 task=c1986050) Stack: d7721178 c1973ef8 0000007a 00000000 c1973000 f7ffea48 c0162d1f 0000007a c0139a2b 0000007a 000000d0 00025528 049dbb00 00000000 000001fa 00000000 c0364564 00000001 0000000a c0364440 c013add1 00000080 000000d0 00000000 Call Trace: [] shrink_dcache_memory+0x1f/0x30 [] shrink_slab+0x14b/0x190 [] balance_pgdat+0x1b1/0x200 [] kswapd+0xc7/0xe0 [] autoremove_wake_function+0x0/0x60 [] ret_from_fork+0x6/0x14 [] autoremove_wake_function+0x0/0x60 [] kswapd+0x0/0xe0 [] kernel_thread_helper+0x5/0x14 Code: 8b 50 14 85 d2 75 27 89 34 24 e8 4a 2b 00 00 8b 73 0c 89 1c Let's try to find out where did that exactly happen. Grep in your kernel tree for prune_dcache. Aha, it is defined in fs/dcache.c! (BTW, if you have _only_ EIP: 0060:[] line (probably because you're using 2.4), just look into System.map. You will discover that EIP is in prune_dcache() because you see "c0162740 t prune_dcache" in System.map and EIP falls between this and next entry.) Ok, execute these two commands: # objdump -d fs/dcache.o > fs/dcache.disasm # make fs/dcache.s Now in fs/ you should have: dcache.c - source code dcache.o - compiled object file dcache.s - assembler output of C compiler ('half-compiled' code) dcache.disasm - disassembled object file Open dcache.disasm and find "prune_dcache": 00000540 : 540: 55 push %ebp We need to find prune_dcache+0x147. Using shell, # printf "0x%x\n" $((0x540+0x147)) 0x687 and in dcache.disasm: 683: 85 c0 test %eax,%eax 685: 74 07 je 68e ===> 687: 8b 50 14 mov 0x14(%eax),%edx <======== OOPS 68a: 85 d2 test %edx,%edx 68c: 75 27 jne 6b5 68e: 89 34 24 mov %esi,(%esp) 691: e8 fc ff ff ff call 692 696: 8b 73 0c mov 0xc(%ebx),%esi 699: 89 1c 24 mov %ebx,(%esp) 69c: e8 9f f9 ff ff call 40 Comparing with "Code: 8b 50 14 85 d2 75 27" - match! We need to find matching line in dcache.s and, eventually, in dcache.c. It's easy to find prune_dcache in dcache.s: prune_dcache: pushl %ebp but even though it is not too hard to find matching instruction (you just have to look for the same instruction sequence): movl 8(%edi), %eax decl 20(%edi) testb $8, %al jne .L593 .L517: movl 68(%ebx), %eax testl %eax, %eax je .L532 movl 20(%eax), %edx <========= OOPS testl %edx, %edx jne .L594 .L532: movl %esi, (%esp) call iput .L565: movl 12(%ebx), %esi movl %ebx, (%esp) call d_free it is unclear to which part of .c code it belongs: static void prune_dcache(int count) { spin_lock(&dcache_lock); for (; count ; count--) { struct dentry *dentry; struct list_head *tmp; tmp = dentry_unused.prev; if (tmp == &dentry_unused) break; list_del_init(tmp); prefetch(dentry_unused.prev); dentry_stat.nr_unused--; dentry = list_entry(tmp, struct dentry, d_lru); spin_lock(&dentry->d_lock); /* * We found an inuse dentry which was not removed from * dentry_unused because of laziness during lookup. Do not free * it - just keep it off the dentry_unused list. */ if (atomic_read(&dentry->d_count)) { spin_unlock(&dentry->d_lock); continue; } /* If the dentry was recently referenced, don't free it. */ if (dentry->d_flags & DCACHE_REFERENCED) { dentry->d_flags &= ~DCACHE_REFERENCED; list_add(&dentry->d_lru, &dentry_unused); dentry_stat.nr_unused++; spin_unlock(&dentry->d_lock); continue; } prune_one_dentry(dentry); } spin_unlock(&dcache_lock); } What now?! Well, I have a silly method which helps to find C code line corresponding to that asm one. Edit your prune_dcache in dcache.c like this: static void prune_dcache(int count) { spin_lock(&dcache_lock); for (; count ; count--) { struct dentry *dentry; struct list_head *tmp; asm("#1"); tmp = dentry_unused.prev; asm("#2"); if (tmp == &dentry_unused) break; asm("#3"); list_del_init(tmp); asm("#4"); prefetch(dentry_unused.prev); asm("#5"); dentry_stat.nr_unused--; asm("#6"); ... ... asm("#e"); prune_one_dentry(dentry); } asm("#f"); spin_unlock(&dcache_lock); } and do "make fs/dcache.s" again. Look into new dcache.s. Nasty surprize: APP #e #NO_APP testb $16, %al jne .L495 orl $16, %eax leal 72(%ecx), %esi movl %eax, 4(%ebx) movl 4(%esi), %edx movl 72(%ecx), %eax testl %eax, %eax movl %eax, (%edx) je .L493 movl %edx, 4(%eax) .L493: movl $2097664, 4(%esi) .L495: leal 40(%ebx), %ecx movl 40(%ebx), %eax movl 4(%ecx), %edx movl %edx, 4(%eax) movl %eax, (%edx) movl $2097664, 4(%ecx) movl $1048832, 40(%ebx) decl dentry_stat movl 8(%ebx), %esi testl %esi, %esi je .L536 leal 56(%ebx), %eax movl $0, 8(%ebx) movl 56(%ebx), %edx movl 4(%eax), %ecx movl %ecx, 4(%edx) movl %edx, (%ecx) movl %eax, 4(%eax) movl %eax, 56(%ebx) movl 8(%edi), %eax decl 20(%edi) testb $8, %al jne .L592 .L518: movl 8(%edi), %eax decl 20(%edi) testb $8, %al jne .L593 .L517: movl 68(%ebx), %eax testl %eax, %eax je .L532 movl 20(%eax), %edx <======== OOPS testl %edx, %edx jne .L594 .L532: movl %esi, (%esp) call iput How come one line of C code expanded in so much asm?! Hmm... asm("#e") was directly before prune_one_dentry(dentry), what's that? static inline void prune_one_dentry(struct dentry * dentry) { struct dentry * parent; __d_drop(dentry); list_del(&dentry->d_child); dentry_stat.nr_dentry--; /* For d_free, below */ dentry_iput(dentry); parent = dentry->d_parent; d_free(dentry); if (parent != dentry) dput(parent); spin_lock(&dcache_lock); } Argh! An inline function. Do asm trick to it too: static inline void prune_one_dentry(struct dentry * dentry) { struct dentry * parent; asm("#A"); __d_drop(dentry); asm("#B"); list_del(&dentry->d_child); asm("#C"); dentry_stat.nr_dentry--; /* For d_free, below */ asm("#D"); dentry_iput(dentry); asm("#E"); ... ... } "make fs/dcache.s", rinse, repeat. You will discover that OOPS happened after #D mark, inside dentry_iput which is an inline too. Will this ever end? Luckily, yes. After yet another round of asm insertion, we arrive at: static inline void dentry_iput(struct dentry * dentry) { struct inode *inode = dentry->d_inode; if (inode) { asm("#K"); dentry->d_inode = NULL; asm("#L"); list_del_init(&dentry->d_alias); asm("#M"); spin_unlock(&dentry->d_lock); asm("#N"); spin_unlock(&dcache_lock); asm("#O"); if (dentry->d_op && dentry->d_op->d_iput) { asm("#P"); dentry->d_op->d_iput(dentry, inode); } else ... Which corresponds to this part of new dcache.s: .L517: #APP #O #NO_APP movl 68(%ebx), %eax testl %eax, %eax je .L532 movl 20(%eax), %edx <=== OOPS testl %edx, %edx jne .L594 .L532: #APP #Q #NO_APP This is "if (dentry->d_op && dentry->d_op->d_iput)" condition check, and it is oopsing trying to do second check. dentry->d_op contains bogus pointer value 0x00000e00 (see %eax value in OOPS message we started with). 1.1. Accesses of structure members via NULL pointer If kernel says "Unable to handle kernel _NULL_ pointer dereference", it does not really 100% guaranteed that NULL pointer was to blame. You can check that by examining the code and register values. In our example, dentry->d_op pointer wasn't NULL. Real NULL pointer would have caused "Unable to handle kernel NULL pointer dereference at virtual address 00000014" message and EAX register would be 00000000. 1.2. Bit flips If you see that only one bit in the referenced address is set (example: "Unable to handle kernel paging request at virtual address 00040000"), you probably have faulty memory which sometimes can flip bit from 0 to 1. It converted legitimate NULL pointer into non-NULL one. Code which expected to stop on NULL pointer saw a non-NULL value and happily used it. Test your box with memtest86, cpuburn and/or memburn. 1.3. OOPSes scrolling off the screen If your OOPS is so long that it scrolls off the screen, and box freeze after the OOPS with nothing in logs, you can try the following: 1. Boot with video=N such that you get large console size. Most x86 machines have 50- and 60-line mode. 2. Connect your box with null modem cable to another one, start terminal emulator there and boot with console=ttyS0 kernel parameter. 3. Use netconsole (I never used that yet). 2. Other decoding tricks Marcelo Tosatti and Johannes Stezenbach suggest using make EXTRA_CFLAGS="-g -Wa,-a,-ad" fs/dcache.o >dcache.asm instead of asm trick. This works at least on 2.6. Note that GCC may produce slightly different assembler code with these options. This is normal. Herbert Poetzl suggested simply using addr2line -e vmlinux c012609d (this might require CONFIG_DEBUG_KERNEL and recompile). Zwane Mwaikambo has another tips for you: ============================================== Date: Sat, 14 Aug 2004 09:41:10 -0400 (EDT) From: Zwane Mwaikambo Subject: Re: [RFC] HOWTO find oops location ============================================== There are a few very simple methods i use all the time: compile with CONFIG_DEBUG_INFO (it's safe to select the option and recompile after the oops even) and then; Unable to handle kernel NULL pointer dereference at virtual address 0000000c printing eip: c046a188 *pde = 00000000 Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC Modules linked in: CPU: 0 EIP: 0060:[] Not tainted VLI EFLAGS: 00010246 (2.6.6-mm3) EIP is at serial_open+0x38/0x170 [...] # gdb vmlinux GNU gdb 5.2 Copyright 2002 Free Software Foundation, Inc. ... (gdb) list *serial_open+0x38 0xc046a188 is in serial_open (drivers/usb/serial/usb-serial.c:465). 460 461 /* get the serial object associated with this tty pointer */ 462 serial = usb_serial_get_by_index(tty->index); 463 464 /* set up our port structure making the tty driver remember our port object, and us it */ 465 portNumber = tty->index - serial->minor; 466 port = serial->port[portNumber]; 467 tty->driver_data = port; 468 469 port->tty = tty; And then for cases where you deadlock and the NMI watchdog triggers with %eip in a lock section: NMI Watchdog detected LOCKUP on CPU0, eip c0119e5e, registers: Modules linked in: CPU: 0 EIP: 0060:[] Tainted: EFLAGS: 00000086 (2.6.7) EIP is at .text.lock.sched+0x89/0x12b [...] (gdb) disassemble 0xc0119e5e Dump of assembler code for function Letext: [...] 0xc0119e59 : repz nop 0xc0119e5b : cmpb $0x0,(%edi) 0xc0119e5e : jle 0xc0119e59 0xc0119e60 : jmp 0xc0118183 (gdb) list *scheduler_tick+487 0xc0118183 is in scheduler_tick (include/asm/spinlock.h:124). 119 if (unlikely(lock->magic != SPINLOCK_MAGIC)) { 120 printk("eip: %p\n", &&here); 121 BUG(); 122 } 123 #endif 124 __asm__ __volatile__( 125 spin_lock_string 126 :"=m" (lock->lock) : : "memory"); 127 } But that's not much help since it's pointing to an inline function and not the real lock location, so just subtract a few bytes: (gdb) list *scheduler_tick+450 0xc011815e is in scheduler_tick (kernel/sched.c:2021). 2016 cpustat->system += sys_ticks; 2017 2018 /* Task might have expired already, but not scheduled off yet */ 2019 if (p->array != rq->active) { 2020 set_tsk_need_resched(p); 2021 goto out; 2022 } 2023 spin_lock(&rq->lock); So we have our lock location. Then there are cases where there is a "Bad EIP" most common ones are when a bad function pointer is followed or if some of the kernel text or a module got unloaded/unmapped (e.g. via __init). You can normally determine which is which by noting that bad eip for unloaded text normally looks like a valid virtual address. Unable to handle kernel NULL pointer dereference at virtual address 00000000 00000000 *pde = 00000000 Oops: 0000 [#1] CPU: 0 EIP: 0060:[<00000000>] Not tainted Using defaults from ksymoops -t elf32-i386 -a i386 EFLAGS: 00210246 [...] Call Trace: [] smb_readdir+0x4fb/0x6e0 [] filldir64+0x0/0x130 [] vfs_readdir+0x8a/0x90 [] filldir64+0x0/0x130 [] sys_getdents64+0x6d/0xa6 [] filldir64+0x0/0x130 [] syscall_call+0x7/0xb Code: Bad EIP value. From there you're best off examining the call trace to find the culprit. ====================================================== 3. Looking around in C code Not written. I think live example of chasing bug further by following call chain, placing printks etc will be most interesting to have here. 4. More obscure oopses Not written. -- vda From vda.linux at googlemail.com Sat Jul 21 06:37:54 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 21 Jul 2007 14:37:54 +0100 Subject: Fwd: [PATCH] chpasswd applet size reduction and bugfix In-Reply-To: <200707210049.37239.farmatito@tiscali.it> References: <1184850097962-git-send-email-virtuoso@slind.org> <200707210012.47455.farmatito@tiscali.it> <200707210049.37239.farmatito@tiscali.it> Message-ID: <200707211437.54616.vda.linux@googlemail.com> On Friday 20 July 2007 23:49, Tito wrote: > here is a diff of my rework against svn, size reduction now is: > > scripts/bloat-o-meter busybox_old busybox_unstripped > function old new delta > chpasswd_main 349 323 -26 > ------------------------------------------------------------------------------ > (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-26) Total: -26 bytes > > it fixes also a bug in commandline parsing: > chpasswd must error out if -m and -e are set at the same time. Applied to svn (along with even more bugs fixed. It's scary how many of them were there). Alex, care to eyescan/test what in svn now? -- vda From virtuoso at slind.org Sat Jul 21 12:55:43 2007 From: virtuoso at slind.org (Alexander Shishkin) Date: Sat, 21 Jul 2007 23:55:43 +0400 Subject: Fwd: [PATCH] chpasswd applet size reduction and bugfix In-Reply-To: <200707211437.54616.vda.linux@googlemail.com> References: <1184850097962-git-send-email-virtuoso@slind.org> <200707210012.47455.farmatito@tiscali.it> <200707210049.37239.farmatito@tiscali.it> <200707211437.54616.vda.linux@googlemail.com> Message-ID: <71a0d6ff0707211255n50984a6en6126969d623043f8@mail.gmail.com> On 7/21/07, Denis Vlasenko wrote: > > it fixes also a bug in commandline parsing: > > chpasswd must error out if -m and -e are set at the same time. > > Applied to svn (along with even more bugs fixed. It's scary how many > of them were there). > > Alex, care to eyescan/test what in svn now? Looks a whole lot better now (thanks a lot for your numerous fixes to this!). Except: - chpasswd.c:59 seems to have excessive indentation tab, - may be it's time to move sizeof("$N$XXXXXXXX") to some header file, since it's used in both passwd.c and chpasswd.c (I'm not quite sure which header is better for such things if at all). Regards, -- Alex From vda.linux at googlemail.com Sat Jul 21 15:23:16 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 21 Jul 2007 23:23:16 +0100 Subject: Fwd: [PATCH] chpasswd applet size reduction and bugfix In-Reply-To: <71a0d6ff0707211255n50984a6en6126969d623043f8@mail.gmail.com> References: <1184850097962-git-send-email-virtuoso@slind.org> <200707211437.54616.vda.linux@googlemail.com> <71a0d6ff0707211255n50984a6en6126969d623043f8@mail.gmail.com> Message-ID: <200707212323.16806.vda.linux@googlemail.com> On Saturday 21 July 2007 20:55, Alexander Shishkin wrote: > On 7/21/07, Denis Vlasenko wrote: > > > it fixes also a bug in commandline parsing: > > > chpasswd must error out if -m and -e are set at the same time. > > > > Applied to svn (along with even more bugs fixed. It's scary how many > > of them were there). > > > > Alex, care to eyescan/test what in svn now? > Looks a whole lot better now (thanks a lot for your numerous fixes to this!). > Except: > - chpasswd.c:59 seems to have excessive indentation tab, Fixed > - may be it's time to move sizeof("$N$XXXXXXXX") to some header file, > since it's used in both passwd.c and chpasswd.c (I'm not quite sure > which header is better for such things if at all). No gain in code size. Correctness is easer to check when you don't need to grep .h files in order to find out what the size is. -- vda From vda.linux at googlemail.com Sun Jul 22 17:21:40 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 23 Jul 2007 01:21:40 +0100 Subject: Installed gcc 4.2.1. Discovered that we have 16-byte stack tax^Walignment enforced on us now. :( Message-ID: <200707230121.40954.vda.linux@googlemail.com> Hi busybox, uclibc Just read this. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32849 OMG. WE DO NOT DO ANY SSE!!! *ANY*! But we are going to have code in our binaries which tries to ensure that our non-existent SSE code will run ok. Shit. -- vda From ynakam at hitachisoft.jp Sun Jul 22 18:16:38 2007 From: ynakam at hitachisoft.jp (Yuichi Nakamura) Date: Mon, 23 Jul 2007 10:16:38 +0900 Subject: [patch]setfiles/restorecon applet In-Reply-To: <200707202044.17800.vda.linux@googlemail.com> References: <20070720132230.60CB.YNAKAM@hitachisoft.jp> <200707202044.17800.vda.linux@googlemail.com> Message-ID: <20070723100244.17B2.YNAKAM@hitachisoft.jp> Hi. Thanks for update. On Fri, 20 Jul 2007 20:44:17 +0100 Denis Vlasenko wrote: > On Friday 20 July 2007 05:29, Yuichi Nakamura wrote: > > Attached is updated patch. > > I changed it a bit, see attached. Can you clarify this part? > > ret = lsetfilecon(my_file, newcon); > if (ret) { > bb_perror_msg("lsetfileconon(%s,%s)", my_file, newcon); > goto out; > } > > err: > retval--; > out: > freecon(context); > freecon(newcon); > free(my_file_orig); > return retval; > } > > Looks like if lsetfilecon fails, we return success - ?! > Is it really right? Sorry, "goto err" is correct. Fixed. And I have fixed trivial compile errors. I add following in Config.in for setfiles. > Notice: If you built libselinux with -D_FILE_OFFSET_BITS=64, > (It is default in libselinux's Makefile), you _must_ enable > CONFIG_LFS. In matchpathcon_filespec_add in setfiles.c, "ino_t" is passed as first argument. However, the size of ino_t depends on value of FILE_OFFSET_BITS. It is set as "64" in libselinux's Makefile. So, CONFIG_LFS(FILE_OFFSET_BITS=64 is set by this) should be enabled for such case. Regards, -- Yuichi Nakamura Hitachi Software Engineering Co., Ltd. Japan SELinux Users Group(JSELUG): http://www.selinux.gr.jp/ SELinux Policy Editor: http://seedit.sourceforge.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: setfiles.4.patch Type: application/octet-stream Size: 22137 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070723/691d86c5/attachment-0001.obj From rep.dot.nop at gmail.com Mon Jul 23 05:52:52 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Mon, 23 Jul 2007 14:52:52 +0200 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070723100244.17B2.YNAKAM@hitachisoft.jp> References: <20070720132230.60CB.YNAKAM@hitachisoft.jp> <200707202044.17800.vda.linux@googlemail.com> <20070723100244.17B2.YNAKAM@hitachisoft.jp> Message-ID: <20070723125252.GA7902@aon.at> On Mon, Jul 23, 2007 at 10:16:38AM +0900, Yuichi Nakamura wrote: >Hi. in setfiles_full_usage: "\n -q Suppress no-error output" \ do you mean "Suppress warnings" or "be quiet" or the like? selinux/setfiles.c: Port to BusyBox by 2007 s/by 2007/(c) 2007 by/ in struct globals, i, personally prefer bools (smaller for me on x86), just as a sidenote. in add_exclude can use use const char*const directory? (didn't look closely). Also, you seem to reimplement something like basename or last_path_component there. Furthermore should return type bool. Initializing len to 0 looks like it is superfluous. likewise a couple of others should return a bool: -+static int exclude(const char *file) ++static bool exclude(const char *file) match(): + if (excludeCtr > 0) { + if (exclude(name)) { + goto err; + } + } Please change to if (excludeCtr > 0 && exclude(name)) goto err; (perhaps in a couple of other places too. (run, from the toplevel sourcedir 'indent selinux/*' for other misc style-cleanups.) near "if (expand_realpath) {", move the + if (excludeCtr > 0 && exclude(name)) + goto err; out of both branches if if-else. restore(): user_only_changed can be bool. Isn't there a sanitize_path() that you could reuse for stripping multiple slashes off? [snipping the rest of you patch for now] HTH, From vda.linux at googlemail.com Mon Jul 23 06:56:57 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 23 Jul 2007 14:56:57 +0100 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070723125252.GA7902@aon.at> References: <20070720132230.60CB.YNAKAM@hitachisoft.jp> <200707202044.17800.vda.linux@googlemail.com> <20070723100244.17B2.YNAKAM@hitachisoft.jp> <20070723125252.GA7902@aon.at> Message-ID: <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> On 7/23/07, Bernhard Fischer wrote: > On Mon, Jul 23, 2007 at 10:16:38AM +0900, Yuichi Nakamura wrote: > >Hi. > > in setfiles_full_usage: > "\n -q Suppress no-error output" \ > do you mean "Suppress warnings" or "be quiet" or the like? > > selinux/setfiles.c: > Port to BusyBox by 2007 > s/by 2007/(c) 2007 by/ I already applied patch to svn... > in struct globals, i, personally prefer bools (smaller for me on x86), > just as a sidenote. bools are smaller than smallints (which are chars on i386)? I don't understand how. I introduced smallints specifically because *I* want to be able to control what they are, not gcc. gcc people hate us. (No, not really, but they aren't thinking too much about saving on size - see my rant on idiotic recent i386 stack alignment disaster.) > in add_exclude can use use const char*const directory? (didn't look > closely). Also, you seem to reimplement something like basename or > last_path_component there. Furthermore should return type bool. > Initializing len to 0 looks like it is superfluous. Yuichi, please look into it and send all follow-on patches relative to svn. > likewise a couple of others should return a bool: > -+static int exclude(const char *file) > ++static bool exclude(const char *file) > > match(): > + if (excludeCtr > 0) { > + if (exclude(name)) { > + goto err; > + } > + } > Please change to > if (excludeCtr > 0 && exclude(name)) > goto err; > (perhaps in a couple of other places too. (run, from the toplevel > sourcedir 'indent selinux/*' for other misc style-cleanups.) > near "if (expand_realpath) {", move the > + if (excludeCtr > 0 && exclude(name)) > + goto err; > out of both branches if if-else. > > > restore(): user_only_changed can be bool. Isn't there a sanitize_path() > that you could reuse for stripping multiple slashes off? > > [snipping the rest of you patch for now] > HTH, -- vda From rep.dot.nop at gmail.com Mon Jul 23 07:25:19 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Mon, 23 Jul 2007 16:25:19 +0200 Subject: [patch]setfiles/restorecon applet In-Reply-To: <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> References: <20070720132230.60CB.YNAKAM@hitachisoft.jp> <200707202044.17800.vda.linux@googlemail.com> <20070723100244.17B2.YNAKAM@hitachisoft.jp> <20070723125252.GA7902@aon.at> <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> Message-ID: <20070723142519.GB9324@aon.at> On Mon, Jul 23, 2007 at 02:56:57PM +0100, Denis Vlasenko wrote: >On 7/23/07, Bernhard Fischer wrote: >>On Mon, Jul 23, 2007 at 10:16:38AM +0900, Yuichi Nakamura wrote: >>>Hi. >> >>in setfiles_full_usage: >>"\n -q Suppress no-error output" \ >>do you mean "Suppress warnings" or "be quiet" or the like? >> >>selinux/setfiles.c: >>Port to BusyBox by 2007 >>s/by 2007/(c) 2007 by/ > >I already applied patch to svn... > >>in struct globals, i, personally prefer bools (smaller for me on x86), >>just as a sidenote. > >bools are smaller than smallints (which are chars on i386)? smaller than ints. >I don't understand how. > >I introduced smallints specifically because *I* want to be able >to control what they are, not gcc. gcc people hate us. let's assume they don't :) >(No, not really, but they aren't thinking too much about >saving on size - see my rant on idiotic recent i386 >stack alignment disaster.) Saw it. Does -mno-sse -mno-sse2 etc help? (didn't try). My CC is usually configured with --with-march=i386 --with-tune=i386, fwiw. > >>in add_exclude can use use const char*const directory? (didn't look >>closely). Also, you seem to reimplement something like basename or >>last_path_component there. Furthermore should return type bool. >>Initializing len to 0 looks like it is superfluous. > >Yuichi, please look into it and send all follow-on patches relative to svn. > >>likewise a couple of others should return a bool: >>-+static int exclude(const char *file) >>++static bool exclude(const char *file) >> >>match(): >>+ if (excludeCtr > 0) { >>+ if (exclude(name)) { >>+ goto err; >>+ } >>+ } >>Please change to >> if (excludeCtr > 0 && exclude(name)) >> goto err; >>(perhaps in a couple of other places too. (run, from the toplevel >>sourcedir 'indent selinux/*' for other misc style-cleanups.) >>near "if (expand_realpath) {", move the >>+ if (excludeCtr > 0 && exclude(name)) >>+ goto err; >>out of both branches if if-else. >> >> >>restore(): user_only_changed can be bool. Isn't there a sanitize_path() >>that you could reuse for stripping multiple slashes off? >> >>[snipping the rest of you patch for now] >>HTH, >-- >vda > From vda.linux at googlemail.com Mon Jul 23 09:43:48 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 23 Jul 2007 17:43:48 +0100 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070723142519.GB9324@aon.at> References: <20070720132230.60CB.YNAKAM@hitachisoft.jp> <200707202044.17800.vda.linux@googlemail.com> <20070723100244.17B2.YNAKAM@hitachisoft.jp> <20070723125252.GA7902@aon.at> <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> <20070723142519.GB9324@aon.at> Message-ID: <1158166a0707230943j492499d3r966281ff394e118d@mail.gmail.com> > >I introduced smallints specifically because *I* want to be able > >to control what they are, not gcc. gcc people hate us. > > let's assume they don't :) > > >(No, not really, but they aren't thinking too much about > >saving on size - see my rant on idiotic recent i386 > >stack alignment disaster.) > > Saw it. Does -mno-sse -mno-sse2 etc help? (didn't try). No, that will cause SEGVs. Code built with -mno-sse should be able to call SSE code. > My CC is usually configured with --with-march=i386 --with-tune=i386, > fwiw. Me too. It wouldn't help I guess. (I need to try, but I bet it would not). -- vda From vda.linux at googlemail.com Mon Jul 23 14:25:45 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 23 Jul 2007 22:25:45 +0100 Subject: [patch]setfiles/restorecon applet In-Reply-To: <1158166a0707230943j492499d3r966281ff394e118d@mail.gmail.com> References: <20070720132230.60CB.YNAKAM@hitachisoft.jp> <20070723142519.GB9324@aon.at> <1158166a0707230943j492499d3r966281ff394e118d@mail.gmail.com> Message-ID: <200707232225.45063.vda.linux@googlemail.com> On Monday 23 July 2007 17:43, Denis Vlasenko wrote: > > >(No, not really, but they aren't thinking too much about > > >saving on size - see my rant on idiotic recent i386 > > >stack alignment disaster.) > > > > Saw it. Does -mno-sse -mno-sse2 etc help? (didn't try). > > No, that will cause SEGVs. Code built with -mno-sse > should be able to call SSE code. > > > My CC is usually configured with --with-march=i386 --with-tune=i386, > > fwiw. > > Me too. It wouldn't help I guess. (I need to try, but I bet it would not). I was wrong. Plain old -mpreferred-stack-boundary=2 overrides it. -- vda From rep.dot.nop at gmail.com Mon Jul 23 14:35:49 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Mon, 23 Jul 2007 23:35:49 +0200 Subject: [patch]setfiles/restorecon applet In-Reply-To: <200707232225.45063.vda.linux@googlemail.com> References: <20070720132230.60CB.YNAKAM@hitachisoft.jp> <20070723142519.GB9324@aon.at> <1158166a0707230943j492499d3r966281ff394e118d@mail.gmail.com> <200707232225.45063.vda.linux@googlemail.com> Message-ID: <20070723213549.GG4096@aon.at> On Mon, Jul 23, 2007 at 10:25:45PM +0100, Denis Vlasenko wrote: >On Monday 23 July 2007 17:43, Denis Vlasenko wrote: >> > My CC is usually configured with --with-march=i386 --with-tune=i386, >> > fwiw. >> >> Me too. It wouldn't help I guess. (I need to try, but I bet it would not). > >I was wrong. Plain old -mpreferred-stack-boundary=2 overrides it. I'm pretty sure that we already had -mpreferred-stack-boundary=2 for ia32. Was this removed when going to Kbuild? IIRC it should be 4 for x86_64.. but you know that From vda.linux at googlemail.com Mon Jul 23 23:01:36 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 24 Jul 2007 07:01:36 +0100 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070724085858.41D8.YNAKAM@hitachisoft.jp> References: <20070723125252.GA7902@aon.at> <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> <20070724085858.41D8.YNAKAM@hitachisoft.jp> Message-ID: <200707240701.36169.vda.linux@googlemail.com> On Tuesday 24 July 2007 01:08, Yuichi Nakamura wrote: > Attached is update. Applied to svn. Further reductions are possible: if (flags & OPT_e) { if (exclude_dir == NULL) { bb_show_usage(); } I think it is already handled inside getopt32. IOW: if() above is not needed at all, ok to remove? while (exclude_dir) { if (add_exclude(llist_pop(&exclude_dir))) exit(1); } add_exclude is used only once here. Obviously you can make it a void function which exits on errors. } Can you test it? Can you point me to FAQ/whetever how to install SELinux libs so that I can at least compile this stuff myself? I suppose this doesn't require SELinux-enabled kernel? -- vda From sync.jma at gmail.com Tue Jul 24 01:11:47 2007 From: sync.jma at gmail.com (Sync ma) Date: Tue, 24 Jul 2007 16:11:47 +0800 Subject: Problems about init. Message-ID: First , I would apologize because it may not be the problems about busybox, however, I can not found another place for help. Please take a look at my kernel bootling log, from the tail, you can find that there were no output(but serial seems OK, you can see that I have typed some chars and there have echo), it's so strange. the kernel was boot from the nfsroot(same problem when boot from the flash), and the boot cmd line is: root=/dev/nfs rw nfsroot=192.168.35.105:/xxxx/fs ip=192.168.35.107:192.168.35.105:192.168.35.1:255.255.255.0::eth0:off rootfstype=jffs2 init=/etc/preinit noinitrd console=ttyS0,115200n8 Any ideas? ====== script etc/preinit [root at sync fs]# cat etc/preinit #!/bin/sh echo "preinit start" export PATH=/bin:/sbin:/usr/bin:/usr/sbin exec /sbin/init =================== kernel boot log: Launching kernel decompressor. Starting LZMA Uncompression Algorithm. Compressed file is LZMA format. Kernel decompressor was successful ... launching kernel. LINUX started... Config serial console: console=ttyS0,115200n8r Enumerating for the host SOC yamuna-8400's VLYNQ module @ 0xa8611800. Identifying the neighbour connected to yamuna-8400 <0xa8611800>. Detected the VLYNQ SoC with id 0x0029 and named wlan1350. Enumerated yamuna-8400 <---> wlan1350, now configuring ..... ..... Configuration Done. Identifying the neighbour connected to wlan1350 <0xac088800>. Did not detect any SoC next to wlan1350 in the chain. VLYNQ Enumeration ended on the chain for root@ 0xac088800 for yamuna-8400. Linux version 2.6.10_dev-malta-mips2_fp_len (root at sync) (gcc version 4.1.2) #40 Tue Jul 24 11:09:40 CST 2007 CPU revision is: 00019068 Determined physical RAM map: memory: 14001000 @ 00000000 (reserved) memory: 0001f000 @ 14001000 (ROM data) memory: 002e4000 @ 14020000 (reserved) memory: 01afc000 @ 14304000 (usable) memory: 00200000 @ 15e00000 (reserved) Built 1 zonelists Kernel command line: root=/dev/nfs rw nfsroot=192.168.35.105:/xxxxx/fs ip=192.168.35.107:192.168.35.105:192.168.35.1:255.255.255.0::eth0:off console=ttyS0,115200n8r Primary instruction cache 16kB, physically tagged, 4-way, linesize 16 bytes. Primary data cache 16kB, 4-way, linesize 16 bytes. Synthesized TLB refill handler (20 instructions). Synthesized TLB load handler fastpath (32 instructions). Synthesized TLB store handler fastpath (32 instructions). Synthesized TLB modify handler fastpath (31 instructions). PID hash table entries: 128 (order: 7, 2048 bytes) CPU frequency 360.00 MHz Using 180.000 MHz high precision timer. Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) Memory: 27332k/30720k available (2067k kernel code, 3368k reserved, 444k data, 336k init) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) Checking for 'wait' instruction... available. spawn_desched_task(00000000) desched cpu_callback 3/00000000 ksoftirqd started up. softirq RT prio: 24. desched cpu_callback 2/00000000 desched thread 0 started up. TI Optimizations: Allocating TI-Cached Memory Pool. Warning: Number of buffers is not configured. Setting default to 512 Using 512 Buffers for TI-Cached Memory Pool. NSP Optimizations: Succesfully allocated TI-Cached Memory Pool. NET: Registered protocol family 16 Can't analyze prologue code at 94222ed4 musb_hdrc: version 2.2a/db-0.4.8 [cppi-dma] [peripheral] [debug=0] musb_hdrc: USB Peripheral mode controller at a3400000 using DMA, IRQ 39 PCI: device 0000:00:06.0 has unknown header type 7e, ignoring. PCI: device 0000:00:07.0 has unknown header type 7e, ignoring. PCI: device 0000:00:08.0 has unknown header type 7e, ignoring. Vlynq irq descriptors registered successfully. Environment variable BOARD_REV not defined taking default value as c0 JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc. JFFS2: default compression mode: priority Initializing Cryptographic API Installed misc driver vlynq0: it handles vlynq bridge0 with 1 hop(s). Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled ttyS0 at MMIO 0xa8610f00 (irq = 16) is a 16550A ttyS1 at MMIO 0xa8610e00 (irq = 15) is a 16550A io scheduler noop registered Loading cpgmac driver for yamuna CPMAC1 support not available Error getting CPMAC Configuration params for instance:0 Environment Variable:MACCFG_A not set in bootloader Setting Default configuration params for CPMAC instance:0 TI CPGMAC_F Linux DDA version 0.1 - CPGMAC_F DDC version 0.2 Cpmac: Installed 1 instances. Cpmac driver is allocating buffer memory at init time. elevator: using noop as default io scheduler Primary flash device: Found 1 x16 devices at 0x0 in 16-bit bank Amd/Fujitsu Extended Query Table at 0x0040 number of CFI chips: 1 cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. avalanche flash device: 0x800000 at 0x10000000. Found a active/root image (0x200000), with size (0x360000). Creating 1 MTD partitions on "Primary flash device": 0x00200000-0x00560000 : "active/root" avalanche_mtd_notify_add(): mtd->name = active/root, mtd->index= 0. Found a active/kernel image (0x110000), with size (0xf0000). Creating 1 MTD partitions on "Primary flash device": 0x00110000-0x00200000 : "active/kernel" avalanche_mtd_notify_add(): mtd->name = active/kernel, mtd->index= 1. Found a active/image image (0x100000), with size (0x700000). Creating 1 MTD partitions on "Primary flash device": 0x00100000-0x00800000 : "active/image" avalanche_mtd_notify_add(): mtd->name = active/image, mtd->index= 2. Avalanche: BOOTCFG_A variable not found. Avalanche: BOOTCFG_B variable not found. Found a active/config image (0x40000), with size (0xc0000). Creating 1 MTD partitions on "Primary flash device": 0x00040000-0x00100000 : "active/config" avalanche_mtd_notify_add(): mtd->name = active/config, mtd->index= 3. Found a bootloader image (0x0), with size (0x40000). Creating 1 MTD partitions on "Primary flash device": 0x00000000-0x00040000 : "bootloader" avalanche_mtd_notify_add(): mtd->name = bootloader, mtd->index= 4. ti_spi0: AVALANCHE SPI Controller driver at 0xa8611000 (irq = 0) Spansion s25fl eeprom driver registered successfully [major_num=253] usb0: Ethernet Gadget, version: Equinox 2004 usb0: using musb_hdrc, OUT ep2out IN ep1in STATUS ep3 usb0: MAC e2:84:28:74:d2:a1 usb0: HOST MAC 5e:13:9c:00:4d:9b usb0: RNDIS ready NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 2048 bind 4096) NET: Registered protocol family 1 NET: Registered protocol family 17 NET: Registered protocol family 8 NET: Registered protocol family 20 IP-Config: Complete: device=eth0, addr=192.168.35.107, mask=255.255.255.0, gw=192.168.35.1, host=192.168.35.107, domain=, nis-domain=(none), bootserver=192.168.35.105, rootserver=192.168.35.105, rootpath= ------------------------> ready to mount nfsroot Looking up port of RPC 100003/2 on 192.168.35.105 Looking up port of RPC 100005/1 on 192.168.35.105 VFS: Mounted root (nfs filesystem). Freeing unused kernel memory: 336k freed init(): force to run /etc/preinit for debugging. ggffafsasf fsa asf as f asf df^H^H k ================== From landau_alex at yahoo.com Tue Jul 24 02:54:12 2007 From: landau_alex at yahoo.com (Alex Landau) Date: Tue, 24 Jul 2007 02:54:12 -0700 (PDT) Subject: [PATCH] Fix start-stop-daemon on no-MMU Message-ID: <866511.5093.qm@web62501.mail.re1.yahoo.com> Hi, The attached patch fixes a compilation error: undefined reference to `_BUG_bb_daemonize_is_unavailable_on_nommu and makes start-stop-daemon usable on no-MMU by using bb_daemonize only if BB_MMU and emulating it if !BB_MMU. This is a bit hackish, since after vfork(), the child does all the work and exec()s the daemon, rather than execing right away, as the vfork paradigma says. Still I think this is better than re-execing start-stop-daemon and only then execing the daemon itself since this approach requires removing the -b (or --background) arguments from the command line, which is not fun (what if there are several -b options? etc.), and does not give any visible benefits. You may also find some code duplications with the fork_and_reexec functions (i.e. call to setsid, dupping /dev/null to 0,1 and 2), but I think this is unavoidable since all of these functions either do something slightly different or do not work on no-MMU. Regards, Alex ____________________________________________________________________________________ Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games. http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow -------------- next part -------------- A non-text attachment was scrubbed... Name: start-stop-daemon.patch Type: text/x-patch Size: 706 bytes Desc: 1590918349-start-stop-daemon.patch Url : http://busybox.net/lists/busybox/attachments/20070724/44d82925/attachment.bin From michele.sanges at otomelara.it Tue Jul 24 06:10:13 2007 From: michele.sanges at otomelara.it (Michele Sanges) Date: Tue, 24 Jul 2007 15:10:13 +0200 Subject: PIPESTATUS shell variable. Message-ID: <1185282613.2656.2.camel@pigreco> How do I set the PIPESTATUS shell variable, in the ash shell? Thanks. Michele From psmith at netezza.com Tue Jul 24 08:01:31 2007 From: psmith at netezza.com (Paul Smith) Date: Tue, 24 Jul 2007 11:01:31 -0400 Subject: PIPESTATUS shell variable. References: <1185282613.2656.2.camel@pigreco> Message-ID: > How do I set the PIPESTATUS shell variable, in the ash shell? You can't. First, PIPESTATUS is a bash extension, and is not available in POSIX shells (which ash is trying to be). Second, you can't have PIPESTATUS unless you also have shell array variables, which are ALSO bash extensions and not available in POSIX shells. And finally, pedantically, you don't set the PIPESTATUS variable even in bash: rather the shell sets it for you after a command that involves a pipe. PIPESTATUS _is_ unquestionably an extraordinarily useful tool, but unless you're writing scripts specifically for bash (which is not a great idea, portability-wise) you can't use it. Cheers! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070724/553ef3e1/attachment.htm From sbb at tuxfamily.org Tue Jul 24 08:20:56 2007 From: sbb at tuxfamily.org (Seb) Date: Tue, 24 Jul 2007 17:20:56 +0200 Subject: PIPESTATUS shell variable. In-Reply-To: <1185282613.2656.2.camel@pigreco> References: <1185282613.2656.2.camel@pigreco> Message-ID: <20070724172056.ef0737d9.sbb@tuxfamily.org> Le Tue, 24 Jul 2007 15:10:13 +0200 Michele Sanges a ?crit: Hello, > How do I set the PIPESTATUS shell variable, in the ash shell? > Thanks. I don't think it's possible, the man-page of bash specifies this variable is an array, while -- as far as I know -- ash shells don't support this structure of datas. ++ Seb. From dannf at dannf.org Tue Jul 24 14:12:22 2007 From: dannf at dannf.org (dann frazier) Date: Tue, 24 Jul 2007 15:12:22 -0600 Subject: [PATCH] resbumit: wget support for no_proxy env var Message-ID: <20070724211222.GD23172@colo.lackof.org> hey, The following patch adds support for the no_proxy envvar to the wget applet. Most of the code is lifted directly from GNU's wget source (with a few simplifications). Originally submitted here: http://article.gmane.org/gmane.linux.busybox/20296 The only outstanding feedback I have is the request to use argz if available. I certainly don't mind adding this if someone can tell me how to properly check for its availability. fyi, my goal with this patch is to enhance the debian installer to allow users who specify a proxy to disable proxy access for certain servers. For example, to use an internal mirror while still using the proxy to install security updates. --- busybox-1.6.0/networking/wget.c.orig 2007-06-18 20:09:36.000000000 +0100 +++ busybox-1.6.0/networking/wget.c 2007-06-21 00:36:21.000000000 +0100 @@ -84,6 +84,51 @@ } #endif +#if ENABLE_FEATURE_WGET_NOPROXY +char *strdupdelim (const char *beg, const char *end); +char *strdupdelim (const char *beg, const char *end) +{ + char *res = xmalloc (end - beg + 1); + memcpy (res, beg, end - beg); + res[end - beg] = '\0'; + return res; +} + +/* Parse a string containing comma-separated elements, and return a + vector of char pointers with the elements. Spaces following the + commas are ignored. */ +char **sepstring (const char *s); +char **sepstring (const char *s) +{ + char **res; + const char *p; + int i = 0; + + if (!s || !*s) + return NULL; + res = NULL; + p = s; + while (*s) { + if (*s == ',') { + res = xrealloc (res, (i + 2) * sizeof (char *)); + res[i] = strdupdelim (p, s); + res[++i] = NULL; + ++s; + /* Skip the blanks following the ','. */ + while (*s == ' ') + ++s; + p = s; + } else { + ++s; + } + } + res = xrealloc (res, (i + 2) * sizeof (char *)); + res[i] = strdupdelim (p, s); + res[i + 1] = NULL; + return res; +} +#endif + int wget_main(int argc, char **argv); int wget_main(int argc, char **argv) { @@ -108,6 +153,11 @@ bool got_clen = 0; /* got content-length: from server */ int output_fd = -1; bool use_proxy = 1; /* Use proxies if env vars are set */ +#if ENABLE_FEATURE_WGET_NOPROXY + int i, j; + char *tmp; + char **no_proxy = NULL; +#endif const char *proxy_flag = "on"; /* Use proxies if env vars are set */ const char *user_agent = "Wget";/* "User-Agent" header field */ static const char * const keywords[] = { @@ -175,6 +225,22 @@ server.host = target.host; server.port = target.port; +#if ENABLE_FEATURE_WGET_NOPROXY + tmp = getenv ("no_proxy"); + if (tmp) + no_proxy = sepstring((const char *)str_tolower(tmp)); + + for (i = 0; no_proxy && no_proxy[i]; i++){ + j = strlen(server.host) - strlen(no_proxy[i]); + if (j < 0) + continue; + if (!strcmp(str_tolower(server.host + j), + no_proxy[i])) { + use_proxy = 0; + break; + } + } +#endif /* Use the proxy if necessary */ if (use_proxy) { proxy = getenv(target.is_ftp ? "ftp_proxy" : "http_proxy"); --- busybox-1.6.0/networking/Config.in.orig 2007-06-21 00:38:52.000000000 +0100 +++ busybox-1.6.0/networking/Config.in 2007-06-21 00:59:51.000000000 +0100 @@ -722,6 +722,15 @@ help Support long options for the wget applet. +config FEATURE_WGET_NOPROXY + bool "Support the no_proxy environment variable" + default n + depends on WGET && GETOPT_LONG + help + Support the no_proxy environment variable. This variable can be used + to specify a comma-separated list of host suffixes for which a proxy + should not be used. + config ZCIP bool "zcip" default n -- dann frazier ----- End forwarded message ----- -- dann frazier From rep.dot.nop at gmail.com Tue Jul 24 14:23:34 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Tue, 24 Jul 2007 23:23:34 +0200 Subject: [PATCH] resbumit: wget support for no_proxy env var In-Reply-To: <20070724211222.GD23172@colo.lackof.org> References: <20070724211222.GD23172@colo.lackof.org> Message-ID: <20070724212334.GA24001@aon.at> On Tue, Jul 24, 2007 at 03:12:22PM -0600, dann frazier wrote: >hey, > The following patch adds support for the no_proxy envvar to the wget >applet. Most of the code is lifted directly from GNU's wget source >(with a few simplifications). > >Originally submitted here: > http://article.gmane.org/gmane.linux.busybox/20296 > >The only outstanding feedback I have is the request to use argz if >available. I certainly don't mind adding this if someone can tell me >how to properly check for its availability. > >fyi, my goal with this patch is to enhance the debian installer to >allow users who specify a proxy to disable proxy access for certain >servers. For example, to use an internal mirror while still using the >proxy to install security updates. That's what apt-proxy is for, but ok. See below. > >--- busybox-1.6.0/networking/wget.c.orig 2007-06-18 20:09:36.000000000 +0100 >+++ busybox-1.6.0/networking/wget.c 2007-06-21 00:36:21.000000000 +0100 Please diff that against svn trunk, just in case. >@@ -84,6 +84,51 @@ > } > #endif > >+#if ENABLE_FEATURE_WGET_NOPROXY >+char *strdupdelim (const char *beg, const char *end); >+char *strdupdelim (const char *beg, const char *end) which other applet uses this? >+{ >+ char *res = xmalloc (end - beg + 1); >+ memcpy (res, beg, end - beg); >+ res[end - beg] = '\0'; >+ return res; >+} >+ >+/* Parse a string containing comma-separated elements, and return a >+ vector of char pointers with the elements. Spaces following the >+ commas are ignored. */ >+char **sepstring (const char *s); >+char **sepstring (const char *s) which other applet uses this? >+{ >+ char **res; >+ const char *p; >+ int i = 0; >+ >+ if (!s || !*s) >+ return NULL; >+ res = NULL; >+ p = s; >+ while (*s) { >+ if (*s == ',') { >+ res = xrealloc (res, (i + 2) * sizeof (char *)); >+ res[i] = strdupdelim (p, s); >+ res[++i] = NULL; >+ ++s; >+ /* Skip the blanks following the ','. */ >+ while (*s == ' ') >+ ++s; skip_whitespace() ? >+ p = s; >+ } else { >+ ++s; >+ } >+ } >+ res = xrealloc (res, (i + 2) * sizeof (char *)); >+ res[i] = strdupdelim (p, s); >+ res[i + 1] = NULL; >+ return res; >+} >+#endif This _sounds_ a bit bloated but i didn't check if we already have infrastructure that could and should be reused. >+ > int wget_main(int argc, char **argv); > int wget_main(int argc, char **argv) > { >@@ -108,6 +153,11 @@ > bool got_clen = 0; /* got content-length: from server */ > int output_fd = -1; > bool use_proxy = 1; /* Use proxies if env vars are set */ >+#if ENABLE_FEATURE_WGET_NOPROXY >+ int i, j; >+ char *tmp; >+ char **no_proxy = NULL; >+#endif > const char *proxy_flag = "on"; /* Use proxies if env vars are set */ > const char *user_agent = "Wget";/* "User-Agent" header field */ > static const char * const keywords[] = { >@@ -175,6 +225,22 @@ > server.host = target.host; > server.port = target.port; > >+#if ENABLE_FEATURE_WGET_NOPROXY >+ tmp = getenv ("no_proxy"); >+ if (tmp) >+ no_proxy = sepstring((const char *)str_tolower(tmp)); >+ >+ for (i = 0; no_proxy && no_proxy[i]; i++){ >+ j = strlen(server.host) - strlen(no_proxy[i]); >+ if (j < 0) >+ continue; >+ if (!strcmp(str_tolower(server.host + j), >+ no_proxy[i])) { >+ use_proxy = 0; can you use the recently added ..._strings stuff? You'd e.g. memchr for ',' set them to nil. Perhaps this makes the above to public functions superfluous. Also, what's the size(1) increase for this new option? cheers, From vapier at gentoo.org Tue Jul 24 15:35:23 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Tue, 24 Jul 2007 18:35:23 -0400 Subject: [PATCH] Fix start-stop-daemon on no-MMU In-Reply-To: <866511.5093.qm@web62501.mail.re1.yahoo.com> References: <866511.5093.qm@web62501.mail.re1.yahoo.com> Message-ID: <200707241835.24382.vapier@gentoo.org> On Tuesday 24 July 2007, Alex Landau wrote: > You may also find some code duplications with the fork_and_reexec functions > (i.e. call to setsid, dupping /dev/null to 0,1 and 2), there is a bb sanitize io function which could alleviate some of this isnt there ? -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/20070724/739090b4/attachment.pgp From roberto.foglietta at gmail.com Wed Jul 25 00:46:21 2007 From: roberto.foglietta at gmail.com (Roberto A. Foglietta) Date: Wed, 25 Jul 2007 09:46:21 +0200 Subject: OT: many script or many fork? Message-ID: Hi to all folks, sorry for the OT but I am wondering if it would be better have three indipendent script which runs concurrently or it is better having only a script like this: while true; do [ ... code 1 ... ] done & while true; do [ ... code 2 ... ] done & while true; do [ ... code 3 ... ] done Thanks in advance, -- /roberto From landau_alex at yahoo.com Wed Jul 25 01:41:19 2007 From: landau_alex at yahoo.com (Alex Landau) Date: Wed, 25 Jul 2007 01:41:19 -0700 (PDT) Subject: [PATCH] Fix start-stop-daemon on no-MMU In-Reply-To: <200707241835.24382.vapier@gentoo.org> Message-ID: <870780.98387.qm@web62513.mail.re1.yahoo.com> --- Mike Frysinger wrote: > On Tuesday 24 July 2007, Alex Landau wrote: > > You may also find some code duplications with the fork_and_reexec functions > > (i.e. call to setsid, dupping /dev/null to 0,1 and 2), > > there is a bb sanitize io function which could alleviate some of this isnt > there ? > -mike > No that won't work. bb_sanitize_stdio() goes over descriptors 0,1,2 and if any is closed, connects it to /dev/null. I want to force them to be /dev/null. Second, the dups and setsid are combined with the re-execing, while in the start-stop-daemon case the child should continue and do some stuff before execing. And last, either I don't understand something, or the bb_daemonize_or_rexec() function that bb_sanitize_stdio() uses is broken: DAEMON_DEVNULL_STDIO is defined as 0, so we never close 0,1,2 (unless we're also re-execing) and that "if" is dead code. Alex ____________________________________________________________________________________ Choose the right car based on your needs. Check out Yahoo! Autos new Car Finder tool. http://autos.yahoo.com/carfinder/ From sbb at tuxfamily.org Wed Jul 25 02:08:07 2007 From: sbb at tuxfamily.org (Seb) Date: Wed, 25 Jul 2007 11:08:07 +0200 Subject: OT: many script or many fork? In-Reply-To: References: Message-ID: <20070725110807.ba1071f5.sbb@tuxfamily.org> Le Wed, 25 Jul 2007 09:46:21 +0200 "Roberto A. Foglietta" a ?crit: > Hi to all folks, Hello, > sorry for the OT but I am wondering if it would be better have three > indipendent script which runs concurrently or it is better having only > a script like this: Theorically 3 scripts = 3 shells = 3 system calls. So, IMHO the most efficient must be to launch one script. After, it depends on the code you execute : if there are many system calls and few needs in memory, you probably won't see the difference. > while true; do > [ ... code 1 ... ] > done & > > while true; do > [ ... code 2 ... ] > done & > > while true; do > [ ... code 3 ... ] > done Maybe it would be good to end it with a 'wait' in order to be sure you don't let an infinite loop in background. ++ Seb. From vapier at gentoo.org Wed Jul 25 06:23:33 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Wed, 25 Jul 2007 09:23:33 -0400 Subject: OT: many script or many fork? In-Reply-To: <20070725110807.ba1071f5.sbb@tuxfamily.org> References: <20070725110807.ba1071f5.sbb@tuxfamily.org> Message-ID: <200707250923.33921.vapier@gentoo.org> On Wednesday 25 July 2007, Seb wrote: > "Roberto A. Foglietta" a ?crit: > > sorry for the OT but I am wondering if it would be better have three > > indipendent script which runs concurrently or it is better having only > > a script like this: > > Theorically 3 scripts = 3 shells = 3 system calls. you cant equate 3 shells to 3 system calls ... simply executing `bash` will execute many more system calls than just one. > So, IMHO the most > efficient must be to launch one script. After, it depends on the code > you execute : if there are many system calls and few needs in memory, > you probably won't see the difference. since each script is really just /bin/bash (or whatever), the appropriate sections are shared in memory automatically. an independent script is pretty much the same as backgrounding something as the shell will fork a new process for each one. so you still have 3 processes. about the only thing you could say is how long running is the script. if it is long running, then the difference will probably be negligible. if it's something that gets executed over and over, spawning subshells may be slightly cheaper than forking whole new shells for each script. but really, this is all just conjecture ... the only real test is one you run yourself and gather quantitative data about resource utilization. -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/20070725/58c54f90/attachment.pgp From ynakam at hitachisoft.jp Mon Jul 23 17:08:24 2007 From: ynakam at hitachisoft.jp (Yuichi Nakamura) Date: Tue, 24 Jul 2007 09:08:24 +0900 Subject: [patch]setfiles/restorecon applet In-Reply-To: <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> References: <20070723125252.GA7902@aon.at> <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> Message-ID: <20070724085858.41D8.YNAKAM@hitachisoft.jp> Hi. I checked out svn and found many changes. Thanks for a lot of work. On Mon, 23 Jul 2007 14:56:57 +0100 "Denis Vlasenko" wrote: > On 7/23/07, Bernhard Fischer wrote: > > On Mon, Jul 23, 2007 at 10:16:38AM +0900, Yuichi Nakamura wrote: > > >Hi. > > > > in setfiles_full_usage: > > "\n -q Suppress no-error output" \ > > do you mean "Suppress warnings" or "be quiet" or the like? > > > > selinux/setfiles.c: > > Port to BusyBox by 2007 > > s/by 2007/(c) 2007 by/ > > I already applied patch to svn... > > > in struct globals, i, personally prefer bools (smaller for me on x86), > > just as a sidenote. > > bools are smaller than smallints (which are chars on i386)? > I don't understand how. > > I introduced smallints specifically because *I* want to be able > to control what they are, not gcc. gcc people hate us. > (No, not really, but they aren't thinking too much about > saving on size - see my rant on idiotic recent i386 > stack alignment disaster.) > > > in add_exclude can use use const char*const directory? (didn't look > > closely). Also, you seem to reimplement something like basename or > > last_path_component there. Furthermore should return type bool. > > Initializing len to 0 looks like it is superfluous. > > Yuichi, please look into it and send all follow-on patches relative to svn. Updated. - Return bools where it can. - Updated usage for q option. - Make -q and -v exclusive. - Make add_exclude argument const char *const > > likewise a couple of others should return a bool: > > -+static int exclude(const char *file) > > ++static bool exclude(const char *file) > > > > match(): > > + if (excludeCtr > 0) { > > + if (exclude(name)) { > > + goto err; > > + } > > + } > > Please change to > > if (excludeCtr > 0 && exclude(name)) > > goto err; > > (perhaps in a couple of other places too. (run, from the toplevel > > sourcedir 'indent selinux/*' for other misc style-cleanups.) > > near "if (expand_realpath) {", move the > > + if (excludeCtr > 0 && exclude(name)) > > + goto err; > > out of both branches if if-else. It seems that they are already done by Denis, thanks. > > > > restore(): user_only_changed can be bool. Isn't there a sanitize_path() > > that you could reuse for stripping multiple slashes off? user_only_changed is now bool. About sanitize_path, it is pending. Removing extra slashes is done only there in setfiles.c . Is removing extra slashes done in other applets? If so, should it be in libbb? I've found bb_simplify_path, but it is expanding "." . > > > > [snipping the rest of you patch for now] > > HTH, > -- > vda Attached is update. -- Yuichi Nakamura Hitachi Software Engineering Co., Ltd. Japan SELinux Users Group(JSELUG): http://www.selinux.gr.jp/ SELinux Policy Editor: http://seedit.sourceforge.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: setfiles.5.patch Type: application/octet-stream Size: 2056 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070724/6b64ed6b/attachment-0001.obj From ynakam at hitachisoft.jp Tue Jul 24 17:25:21 2007 From: ynakam at hitachisoft.jp (Yuichi Nakamura) Date: Wed, 25 Jul 2007 09:25:21 +0900 Subject: [patch]setfiles/restorecon applet In-Reply-To: <200707240701.36169.vda.linux@googlemail.com> References: <20070724085858.41D8.YNAKAM@hitachisoft.jp> <200707240701.36169.vda.linux@googlemail.com> Message-ID: <20070725090503.60F9.YNAKAM@hitachisoft.jp> On Tue, 24 Jul 2007 07:01:36 +0100 Denis Vlasenko wrote: > On Tuesday 24 July 2007 01:08, Yuichi Nakamura wrote: > > Attached is update. > > Applied to svn. Further reductions are possible: > > if (flags & OPT_e) { > if (exclude_dir == NULL) { > bb_show_usage(); > } > > I think it is already handled inside getopt32. IOW: > if() above is not needed at all, ok to remove? > > while (exclude_dir) { > if (add_exclude(llist_pop(&exclude_dir))) > exit(1); > } > > add_exclude is used only once here. Obviously you can make > it a void function which exits on errors. > > } > > Can you test it? I've tested, and it worked. Attached is a patch. > Can you point me to FAQ/whetever how to install SELinux libs > so that I can at least compile this stuff myself? I suppose > this doesn't require SELinux-enabled kernel? > -- > vda Yes, it does not require SELinux enabled kernel. You have to obtain libselinux, libsepol. If you install from source, obtain source from below. http://www.nsa.gov/selinux/archives/libsepol-1.16.1.tgz http://www.nsa.gov/selinux/archives/libselinux-1.34.7.tgz And run make ARCH= CC= If your cross compiler does not support thread local storage, you have to define __thread as NULL, like below make ARCH= CC= CFLAGS=-D__thread= Then, libselinux, libsepol is made under src. Header files exists under include dir. -- Yuichi Nakamura Hitachi Software Engineering Co., Ltd. Japan SELinux Users Group(JSELUG): http://www.selinux.gr.jp/ SELinux Policy Editor: http://seedit.sourceforge.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: setfiles.patch Type: application/octet-stream Size: 1611 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070725/1c74da02/attachment.obj From farmatito at tiscali.it Wed Jul 25 09:13:40 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 25 Jul 2007 18:13:40 +0200 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070724085858.41D8.YNAKAM@hitachisoft.jp> References: <20070723125252.GA7902@aon.at> <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> <20070724085858.41D8.YNAKAM@hitachisoft.jp> Message-ID: <200707251813.41031.farmatito@tiscali.it> On Tuesday 24 July 2007 02:08:24 Yuichi Nakamura wrote: > Hi. > snip > > About sanitize_path, it is pending. > Removing extra slashes is done only there in setfiles.c . > Is removing extra slashes done in other applets? Yes in devfsd, removing extra slashes at the end of filename: in one earlier revision there was: /* strip last / from mount point, so we don't need to check for it later */ while (argv[1][1] != '\0' && argv[1][strlen(argv[1]) - 1] == '/') argv[1][strlen(argv[1]) - 1] = '\0'; later it changed to mount_point = bb_simplify_path(argv[1]); so far nobody complained..... > If so, should it be in libbb? Could be useful...... just my 0,02 ? Ciao, Tito > I've found bb_simplify_path, but it is expanding "." . > > > > > > > [snipping the rest of you patch for now] > > > HTH, > > -- > > vda > > Attached is update. From sbb at tuxfamily.org Wed Jul 25 10:17:25 2007 From: sbb at tuxfamily.org (Seb) Date: Wed, 25 Jul 2007 19:17:25 +0200 Subject: OT: many script or many fork? In-Reply-To: <200707250923.33921.vapier@gentoo.org> References: <20070725110807.ba1071f5.sbb@tuxfamily.org> <200707250923.33921.vapier@gentoo.org> Message-ID: <20070725191725.9cc0948e.sbb@tuxfamily.org> Le Wed, 25 Jul 2007 09:23:33 -0400 Mike Frysinger a ?crit: > > Theorically 3 scripts = 3 shells = 3 system calls. > > you cant equate 3 shells to 3 system calls ... simply executing `bash` will > execute many more system calls than just one. Oh, yes the term "system call" is maybe improper, here. I thought to the "system" function in Perl... I should have said "you will ask to the system to launch the command three times instead of one", so there are three initializations instead of one, whatever a single initialization does. > > So, IMHO the most > > efficient must be to launch one script. After, it depends on the code > > you execute : if there are many system calls and few needs in memory, > > you probably won't see the difference. > > since each script is really just /bin/bash (or whatever), the appropriate > sections are shared in memory automatically. an independent script is pretty > much the same as backgrounding something as the shell will fork a new process > for each one. so you still have 3 processes. Is there no difference at all between a job and a parallel shell ? it's a true question... Seen from "outside" I had the feeling a job was more "integrated" to its parent shell in order to allow jobs control. Is it just a story of "naming space" (sorry, I haven't the appropriate terms) without any physical reality, which for example would say to a shell: "you can know when this process will end because it's your son but for this one you'll have to deal with 'ps' because it's not" ? However with 3 scripts executing each one command, you should have 6 processes unless you specify 'exec' in them (the processes of the shells + ones of the commands), while with 3 commands backgrounded in one script, you should have 4 processes. But what you mean is that *physically* one or thousand 'bash' processes is the same thing, have I well understood ? :) > about the only thing you could say is how long running is the script. if it > is long running, then the difference will probably be negligible. if it's > something that gets executed over and over, spawning subshells may be > slightly cheaper than forking whole new shells for each script. but really, > this is all just conjecture ... the only real test is one you run yourself > and gather quantitative data about resource utilization. In fact the difference I was conceiving was a difference between a script which would have combine many commands, and a script which would have use primarily the internal functions of the shell (few forks). With the second ones, the cost of the extra initializations should be *relatively* sensible but not in the first ones where it should be drowned in all system calls, shouldn't it ? ++ Seb. From kbc_hyper at hotmail.com Wed Jul 25 15:30:37 2007 From: kbc_hyper at hotmail.com (Choi Jason) Date: Wed, 25 Jul 2007 17:30:37 -0500 Subject: need some help to setup nslookup Message-ID: Hello All, I think I need your help at this time. :) Now, I tried to use nslookup on my target system. When I compiled busybox, I just turned on Networking Utilities -> nslookup. And I install this busybox to my target. And I create /etc/resolv.conf. Contents of /etc/resolv.conf is as followings ---------------- search abc.net nameserver 4.2.2.1 ---------------- And I create /etc/hosts as followings ---------------- 127.0.0.1 localhost 192.168.6.77 abc.site abc 209.131.36.158 www.yahoo.com ---------------- When I tried "nslookup www.google.com", following message is displayed. ---------------- # nslookup www.google.com Server : 4.2.2.1 Address 1: 4.2.2.1 nslookup: can't resolve 'www.google.com' ---------------- And when I tried "nslookup www.yahoo.com", following message is displayed. ---------------- #nslookup www.yshoo.com Server: 4.2.2.1 Address 1: 4.2.2.1 Name: www.yahoo.com Address 1: 209.131.36.158 www.yahoo.com ----------------- So,,I don't know why I could not get address resolve result. Do I need more steps to setup nslookup on my target? I think when I tried address resolve of www.yahoo.com, it could find it's result thanks to /etc/hosts. I hope to get some help from you guys. Thanks in advance :) Jason, From vapier at gentoo.org Wed Jul 25 16:55:02 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Wed, 25 Jul 2007 19:55:02 -0400 Subject: need some help to setup nslookup In-Reply-To: References: Message-ID: <200707251955.03030.vapier@gentoo.org> On Wednesday 25 July 2007, Choi Jason wrote: > Now, I tried to use nslookup on my target system. > When I compiled busybox, I just turned on Networking Utilities -> nslookup. > And I install this busybox to my target. busybox contains no dns logic. all querying is done via the system libc functions, so please consult the manual for whichever libc you're using to find out how to properly configure /etc/resolv.conf, /etc/hosts, your routing table, and network interfaces. in fact, i'd check the above list in the reverse order i specified to make sure your system is setup properly. tldp.org has some pretty complete howto's you could read. -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/20070725/58a9f8a2/attachment.pgp From vapier at gentoo.org Wed Jul 25 17:04:13 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Wed, 25 Jul 2007 20:04:13 -0400 Subject: OT: many script or many fork? In-Reply-To: <20070725191725.9cc0948e.sbb@tuxfamily.org> References: <200707250923.33921.vapier@gentoo.org> <20070725191725.9cc0948e.sbb@tuxfamily.org> Message-ID: <200707252004.14409.vapier@gentoo.org> On Wednesday 25 July 2007, Seb wrote: > Mike Frysinger a ?crit: > > > So, IMHO the most > > > efficient must be to launch one script. After, it depends on the code > > > you execute : if there are many system calls and few needs in memory, > > > you probably won't see the difference. > > > > since each script is really just /bin/bash (or whatever), the appropriate > > sections are shared in memory automatically. an independent script is > > pretty much the same as backgrounding something as the shell will fork a > > new process for each one. so you still have 3 processes. > > Is there no difference at all between a job and a parallel shell ? it's > a true question... Seen from "outside" I had the feeling a job > was more "integrated" to its parent shell in order to allow jobs > control. Is it just a story of "naming space" (sorry, I haven't > the appropriate terms) without any physical reality, which for example > would say to a shell: "you can know when this process will end because > it's your son but for this one you'll have to deal with 'ps' because > it's not" ? whether you do `./somescript.sh` or `while ... done &`, `ps` would show a separate process because they are both forked off. > However with 3 scripts executing each one command, you should have 6 > processes unless you specify 'exec' in them (the processes of the shells > + ones of the commands), while with 3 commands backgrounded in one > script, you should have 4 processes. But what you mean is that > *physically* one or thousand 'bash' processes is the same thing, > have I well understood ? :) they'd be equivalent number of processes if you did: ./script1.sh ./script2.sh ./script3.sh versus while ... done & while ... done & while ... done the only savings you could really count is the cost of starting up the shell ... when you use &, you're still doing a fork(). > > about the only thing you could say is how long running is the script. if > > it is long running, then the difference will probably be negligible. if > > it's something that gets executed over and over, spawning subshells may > > be slightly cheaper than forking whole new shells for each script. but > > really, this is all just conjecture ... the only real test is one you run > > yourself and gather quantitative data about resource utilization. > > In fact the difference I was conceiving was a difference between a > script which would have combine many commands, and a script which would > have use primarily the internal functions of the shell (few forks). With > the second ones, the cost of the extra initializations should be > *relatively* sensible but not in the first ones where it should be > drowned in all system calls, shouldn't it ? doing `./foo.sh` will start up a new shell and run through its init routines while doing `while ... done &` will fork the currently running shell and thus bypass the routines. but in the end, you arent looking at a different number of forks, just the startup cost. so a long running script should generally platoue at the same resource utilization regardless of how it was started. shell functions do not cause forks, things like '&', '`...`', '$(...)', '... | ...' do. -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/20070725/6eb08037/attachment.pgp From pedro.salgueiro at gmail.com Thu Jul 26 10:57:58 2007 From: pedro.salgueiro at gmail.com (Pedro Salgueiro) Date: Thu, 26 Jul 2007 18:57:58 +0100 Subject: Monitor black after 10 Minutes Message-ID: <993f1d7c0707261057j661683e7w4a55073c915be5b9@mail.gmail.com> Hi! I am using Busybox 1.6.0 to make an automated net-instalation of Linux. Everything is working ok, but when the install process is working, after 10 minutes of no keyboard or mouse activity the monitor goes blank(black) and only gets ok when I hit the keyboard. Does anyone knows how to solve this problem? Thank you all and sorry for the bad english. Pedro Salgueiro From aurel at gnuage.org Thu Jul 26 11:15:01 2007 From: aurel at gnuage.org (Aurelien Jacobs) Date: Thu, 26 Jul 2007 20:15:01 +0200 Subject: Monitor black after 10 Minutes In-Reply-To: <993f1d7c0707261057j661683e7w4a55073c915be5b9@mail.gmail.com> References: <993f1d7c0707261057j661683e7w4a55073c915be5b9@mail.gmail.com> Message-ID: <20070726201501.b5f4caa2.aurel@gnuage.org> On Thu, 26 Jul 2007 18:57:58 +0100 "Pedro Salgueiro" wrote: > Hi! > > I am using Busybox 1.6.0 to make an automated net-instalation of > Linux. Everything is working ok, but when the install process is > working, after 10 minutes of no keyboard or mouse activity the monitor > goes blank(black) and only gets ok when I hit the keyboard. > > Does anyone knows how to solve this problem? This has nothing to do with busybox, but the following escape sequence should do the trick: echo -e "\033[9;0]" Aurel From pedro.salgueiro at gmail.com Thu Jul 26 13:11:31 2007 From: pedro.salgueiro at gmail.com (Pedro Salgueiro) Date: Thu, 26 Jul 2007 21:11:31 +0100 Subject: Monitor black after 10 Minutes In-Reply-To: <06ec01c7cfaf$f9b3e010$2600a8c0@engineering5> References: <993f1d7c0707261057j661683e7w4a55073c915be5b9@mail.gmail.com> <06ec01c7cfaf$f9b3e010$2600a8c0@engineering5> Message-ID: <993f1d7c0707261311l1a42aa6do59cff65d98b85983@mail.gmail.com> Hi! I was trying not to change te driver. Is there any other way to resolve this? Anyway, I will try to find out what driver I'm using... Thank you. Pedro Salgueiro On 7/26/07, Christopher Reder wrote: > Try looking for whatever video driver you are using (on my board, it was an > Epson s1d), and look for something like the following: > > > static struct fb_ops s1d13xxxfb_fbops = { > .owner = THIS_MODULE, > .fb_set_par = s1d13xxxfb_set_par, > .fb_setcolreg = s1d13xxxfb_setcolreg, > .fb_blank = s1d13xxxfb_blank, > > .fb_pan_display = s1d13xxxfb_pan_display, > > /* to be replaced by any acceleration we can */ > .fb_fillrect = cfb_fillrect, > .fb_copyarea = cfb_copyarea, > .fb_imageblit = cfb_imageblit, > }; > > See where it has .fb_blank ? well, that is the function that will blank it. > If you just return out of that without doing anything, it won't go black. > > Hope that helps... > > -----Original Message----- > From: busybox-bounces at busybox.net [mailto:busybox-bounces at busybox.net] On > Behalf Of Pedro Salgueiro > Sent: Thursday, July 26, 2007 12:58 PM > To: busybox at busybox.net > Subject: Monitor black after 10 Minutes > > Hi! > > I am using Busybox 1.6.0 to make an automated net-instalation of > Linux. Everything is working ok, but when the install process is > working, after 10 minutes of no keyboard or mouse activity the monitor > goes blank(black) and only gets ok when I hit the keyboard. > > Does anyone knows how to solve this problem? > > Thank you all and sorry for the bad english. > > Pedro Salgueiro > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > From jcurlnews at arcor.de Thu Jul 26 13:11:14 2007 From: jcurlnews at arcor.de (Jason Curl) Date: Thu, 26 Jul 2007 22:11:14 +0200 Subject: Monitor black after 10 Minutes In-Reply-To: <993f1d7c0707261057j661683e7w4a55073c915be5b9@mail.gmail.com> References: <993f1d7c0707261057j661683e7w4a55073c915be5b9@mail.gmail.com> Message-ID: <46A8FFE2.6030305@arcor.de> Pedro Salgueiro wrote: > Hi! > > I am using Busybox 1.6.0 to make an automated net-instalation of > Linux. Everything is working ok, but when the install process is > working, after 10 minutes of no keyboard or mouse activity the monitor > goes blank(black) and only gets ok when I hit the keyboard. > As another post said - nothing to do with BusyBox. But it's the kernel that's doing this. I compiled ncurses, then setterm from util-linux and used the command 'setterm -blank 0'. This is the heavy handed way of doing things. > Does anyone knows how to solve this problem? > > Thank you all and sorry for the bad english. > > From pedro.salgueiro at gmail.com Thu Jul 26 16:39:44 2007 From: pedro.salgueiro at gmail.com (Pedro Salgueiro) Date: Fri, 27 Jul 2007 00:39:44 +0100 Subject: Monitor black after 10 Minutes In-Reply-To: <46A8FFE2.6030305@arcor.de> References: <993f1d7c0707261057j661683e7w4a55073c915be5b9@mail.gmail.com> <46A8FFE2.6030305@arcor.de> Message-ID: <993f1d7c0707261639u1fdc21aeh75bf62837a8a8114@mail.gmail.com> Hi! Thank you all for helping me. The escape sequence posted by Aurel solved the problem. Once more, thank you all. Pedro Salgueiro On 7/26/07, Jason Curl wrote: > Pedro Salgueiro wrote: > > Hi! > > > > I am using Busybox 1.6.0 to make an automated net-instalation of > > Linux. Everything is working ok, but when the install process is > > working, after 10 minutes of no keyboard or mouse activity the monitor > > goes blank(black) and only gets ok when I hit the keyboard. > > > As another post said - nothing to do with BusyBox. But it's the kernel > that's doing this. I compiled ncurses, then setterm from util-linux and > used the command 'setterm -blank 0'. This is the heavy handed way of > doing things. > > Does anyone knows how to solve this problem? > > > > Thank you all and sorry for the bad english. > > > > > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > From vda.linux at googlemail.com Fri Jul 27 05:24:48 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 27 Jul 2007 13:24:48 +0100 Subject: need some help to setup nslookup In-Reply-To: References: Message-ID: <1158166a0707270524k4e460192md98b53a049d6bb9a@mail.gmail.com> On 7/25/07, Choi Jason wrote: > Hello All, > > I think I need your help at this time. :) > Now, I tried to use nslookup on my target system. > When I compiled busybox, I just turned on Networking Utilities -> nslookup. > And I install this busybox to my target. > And I create /etc/resolv.conf. > Contents of /etc/resolv.conf is as followings > ---------------- > search abc.net > nameserver 4.2.2.1 > ---------------- > And I create /etc/hosts as followings > ---------------- > 127.0.0.1 localhost > 192.168.6.77 abc.site abc > 209.131.36.158 www.yahoo.com > ---------------- > > When I tried "nslookup www.google.com", following message is displayed. > ---------------- > # nslookup www.google.com > Server : 4.2.2.1 > Address 1: 4.2.2.1 > > nslookup: can't resolve 'www.google.com' > ---------------- > And when I tried "nslookup www.yahoo.com", following message is displayed. > ---------------- > #nslookup www.yshoo.com > Server: 4.2.2.1 > Address 1: 4.2.2.1 > > Name: www.yahoo.com > Address 1: 209.131.36.158 www.yahoo.com Enable CONFIG_VERBOSE_RESOLUTION_ERRORS=y, it will give a bit more info: $ ./busybox nslookup www.sdjhgfklsdjgf.com Server: 172.26.128.68 Address 1: 172.26.128.68 XXXXXXXXXXXXXXX nslookup: can't resolve 'www.sdjhgfklsdjgf.com': Name or service not known ^^^^^^^^^^^^^^^^^^^^^^^^^ here -- vda From pgf at brightstareng.com Fri Jul 27 06:05:58 2007 From: pgf at brightstareng.com (Paul Fox) Date: Fri, 27 Jul 2007 09:05:58 -0400 Subject: Monitor black after 10 Minutes In-Reply-To: jcurlnews's message of Thu, 26 Jul 2007 22:11:14 +0200. <46A8FFE2.6030305@arcor.de> Message-ID: <23914.1185541558@brightstareng.com> > As another post said - nothing to do with BusyBox. But it's the kernel > that's doing this. I compiled ncurses, then setterm from util-linux and > used the command 'setterm -blank 0'. This is the heavy handed way of > doing things. yes, that's a lot of work :-), since in the end all setterm does is emit the previously mentioned escape sequence. ( "ESC [ 9 ; 0 ]" ) TERM=linux setterm -blank 0 | hexdump -C paul =--------------------- paul fox, pgf at brightstareng.com From wharms at bfs.de Fri Jul 27 06:30:10 2007 From: wharms at bfs.de (walter harms) Date: Fri, 27 Jul 2007 15:30:10 +0200 Subject: Monitor black after 10 Minutes In-Reply-To: <23914.1185541558@brightstareng.com> References: <23914.1185541558@brightstareng.com> Message-ID: <46A9F362.7090702@bfs.de> Paul Fox wrote: > > As another post said - nothing to do with BusyBox. But it's the kernel > > that's doing this. I compiled ncurses, then setterm from util-linux and > > used the command 'setterm -blank 0'. This is the heavy handed way of > > doing things. > > yes, that's a lot of work :-), since in the end all setterm does is > emit the previously mentioned escape sequence. ( "ESC [ 9 ; 0 ]" ) > > TERM=linux setterm -blank 0 | hexdump -C > > paul To discover what more can be done use 'man console_code'. re, wh From Alexander at Kriegisch.name Fri Jul 27 07:22:41 2007 From: Alexander at Kriegisch.name (Alexander Kriegisch) Date: Fri, 27 Jul 2007 16:22:41 +0200 Subject: Monitor black after 10 Minutes In-Reply-To: <46A9F362.7090702@bfs.de> References: <23914.1185541558@brightstareng.com> <46A9F362.7090702@bfs.de> Message-ID: <46A9FFB1.8060604@Kriegisch.name> > To discover what more can be done use 'man console_code'. Maybe you mean 'man console_codes' (trailing 's')? -- Alexander Kriegisch From steven.scholz at imc-berlin.de Fri Jul 27 07:13:31 2007 From: steven.scholz at imc-berlin.de (Steven Scholz) Date: Fri, 27 Jul 2007 16:13:31 +0200 Subject: Monitor black after 10 Minutes In-Reply-To: <23914.1185541558@brightstareng.com> References: <23914.1185541558@brightstareng.com> Message-ID: <46A9FD8B.6090701@imc-berlin.de> Paul Fox wrote: > > As another post said - nothing to do with BusyBox. But it's the kernel > > that's doing this. I compiled ncurses, then setterm from util-linux and > > used the command 'setterm -blank 0'. This is the heavy handed way of > > doing things. > > yes, that's a lot of work :-), since in the end all setterm does is > emit the previously mentioned escape sequence. ( "ESC [ 9 ; 0 ]" ) > > TERM=linux setterm -blank 0 | hexdump -C But this all only works if I am actually working on this terminal!? I do have a frame buffer console (VT) with no keyboard, but use the serial console. So I guess "setterm -blank 0" then works on my serial console but nit on the framebuffer. How am I supposed to switch off console blanking then? In a bootscript? Thanks! Steven From pgf at brightstareng.com Fri Jul 27 09:05:25 2007 From: pgf at brightstareng.com (Paul Fox) Date: Fri, 27 Jul 2007 12:05:25 -0400 Subject: Monitor black after 10 Minutes In-Reply-To: steven.scholz's message of Fri, 27 Jul 2007 16:13:31 +0200. <46A9FD8B.6090701@imc-berlin.de> Message-ID: <23259.1185552325@brightstareng.com> > > How am I supposed to switch off console blanking then? > In a bootscript? send the escape sequence to the correct tty, e.g.: echo esc-sequence >/dev/tty0 =--------------------- paul fox, pgf at brightstareng.com From rep.dot.nop at gmail.com Fri Jul 27 09:27:07 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Fri, 27 Jul 2007 18:27:07 +0200 Subject: "multiple target patterns" error while building under cygwin In-Reply-To: References: <000501c7cd42$2a1b0d20$dcc4af0a@atmel.com> Message-ID: <20070727162707.GH25147@aon.at> On Mon, Jul 23, 2007 at 12:33:58PM -0400, Crane, Matthew wrote: >Hi, > > >I'm trying to build on cygwin, busybox is failing with the error: > > >applets/.applets.o.cmd:410: *** multiple target patterns. Stop. > >Has anybody come across this? I'm wondering if it's related to the case >insensitivity of cygwin. Any help much apreciated, > >Matt > > >More complete error log, starts just as the build process has run >through building busybox once, and starts again, which I think is >normal?? > > > AR util-linux/lib.a > LINK busybox_unstripped >cp busybox_unstripped busybox >make[1]: Leaving directory >`/usr/local/src/hd2/buildroot-20070718/project_build_arm_nofpu/uclibc/bu >sybox-1.6.1' >/usr/bin/make -j1 CC=/usr/local/arm2007-uc/bin/arm-uclinuxeabi-gcc >CROSS_COMPILE="/usr/local/arm2007-uc/bin/arm-uclinuxeabi- >" \ > CROSS="/usr/local/arm2007-uc/bin/arm-uclinuxeabi-" >PREFIX="/usr/local/src/hd2/buildroot-20070718/project_bui >ld_arm_nofpu/uclibc/root" \ > ARCH=arm \ > EXTRA_CFLAGS="-Os -pipe >-I/usr/local/src/hd2/buildroot-20070718/build_arm_nofpu/staging_dir/incl >ude -I/usr/ >local/src/hd2/buildroot-20070718/build_arm_nofpu/staging_dir/usr/include >-I/usr/local/arm2007-uc/arm-uclinuxeabi/include" -C > >/usr/local/src/hd2/buildroot-20070718/project_build_arm_nofpu/uclibc/bus >ybox-1.6.1 install >make[1]: Entering directory >`/usr/local/src/hd2/buildroot-20070718/project_build_arm_nofpu/uclibc/bu >sybox-1.6.1' > HOSTCC scripts/basic/split-include >scripts/basic/.split-include.d: done. > HOSTCC scripts/basic/docproc >scripts/basic/.docproc.d: done. > SPLIT include/autoconf.h -> include/config/* > GEN include/bbconfigopts.h >applets/.applets.o.cmd:410: *** multiple target patterns. Stop. Please paste lines 409-411 (take care not to word-wrap it). Just to be sure, untar the busybox into a separate dir, then 'make defconfig && make'. I expect this to happen there too.. thanks, From rep.dot.nop at gmail.com Fri Jul 27 11:05:40 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Fri, 27 Jul 2007 20:05:40 +0200 Subject: "multiple target patterns" error while building under cygwin In-Reply-To: References: <000501c7cd42$2a1b0d20$dcc4af0a@atmel.com> <20070727162707.GH25147@aon.at> Message-ID: <20070727180540.GD11697@aon.at> On Fri, Jul 27, 2007 at 01:04:00PM -0400, Crane, Matthew wrote: >Hi, > >Thanks for your response. I think my build error is the result of the >dos2unix + unix2dos patch. My cygwin system was installed with Unix >text mode, and I've tried to explicitly set the locale, but fixdep >always seems to output the Dos text. > >I instead used the dos2unix/unix2dos patch to fix the fixdep output, >which I think ending up causing the error below. Not sure how though, >or how to fix it. Thanks, > >Matt > > >.applets.o.cmd looks like this: > >cmd_applets/applets.o := > >deps_applets/applets.o := \ > applets/applets.c \ > $(wildcard include/config/static.h) \ > $(wildcard include/config/show/usage.h) \ > > >line 410: applets/applets.o: $(deps_applets/applets.o) > >$(deps_applets/applets.o): > > >I had already patched the make process so that it runs fixdep through >unix2dos, dos2unix similar to this patch I found online: > >define rule_cc_o_c > $(call echo-cmd,checksrc) $(cmd_checksrc) \ > $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \ >+ dos2unix $(depfile); \ > $(cmd_modversions) \ >- scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \ > >+ scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' | >unix2dos > \ > $(dot-target).tmp; \ > rm -f $(depfile); \ > mv -f $(dot-target).tmp $(dot-target).cmd > >It proceeded to build, but failed with the above error. Maybe related, >not sure. I'm looking forward to the day when cygwin support is >completely transparent in buildroot, soon I'm sure. This doesn't really sounds like a buildroot issue to me but rather a busybox issue, fwiw. Perhaps somebody else is aware of what's going on with busybox on cygwin. From kbc_hyper at hotmail.com Fri Jul 27 15:14:11 2007 From: kbc_hyper at hotmail.com (Choi Jason) Date: Fri, 27 Jul 2007 17:14:11 -0500 Subject: need some help to setup nslookup In-Reply-To: <1158166a0707270524k4e460192md98b53a049d6bb9a@mail.gmail.com> Message-ID: You're right. And I checked return value of getaddrinfo(), it was EAI_NONAME. But I still don't know clue. :( Thanks Jason, >From: "Denis Vlasenko" >To: "Choi Jason" >CC: busybox at busybox.net >Subject: Re: need some help to setup nslookup >Date: Fri, 27 Jul 2007 13:24:48 +0100 > >On 7/25/07, Choi Jason wrote: > > Hello All, > > > > I think I need your help at this time. :) > > Now, I tried to use nslookup on my target system. > > When I compiled busybox, I just turned on Networking Utilities -> nslookup. > > And I install this busybox to my target. > > And I create /etc/resolv.conf. > > Contents of /etc/resolv.conf is as followings > > ---------------- > > search abc.net > > nameserver 4.2.2.1 > > ---------------- > > And I create /etc/hosts as followings > > ---------------- > > 127.0.0.1 localhost > > 192.168.6.77 abc.site abc > > 209.131.36.158 www.yahoo.com > > ---------------- > > > > When I tried "nslookup www.google.com", following message is displayed. > > ---------------- > > # nslookup www.google.com > > Server : 4.2.2.1 > > Address 1: 4.2.2.1 > > > > nslookup: can't resolve 'www.google.com' > > ---------------- > > And when I tried "nslookup www.yahoo.com", following message is displayed. > > ---------------- > > #nslookup www.yshoo.com > > Server: 4.2.2.1 > > Address 1: 4.2.2.1 > > > > Name: www.yahoo.com > > Address 1: 209.131.36.158 www.yahoo.com > >Enable CONFIG_VERBOSE_RESOLUTION_ERRORS=y, it will give a bit more info: > >$ ./busybox nslookup www.sdjhgfklsdjgf.com >Server: 172.26.128.68 >Address 1: 172.26.128.68 XXXXXXXXXXXXXXX > >nslookup: can't resolve 'www.sdjhgfklsdjgf.com': Name or service not known > ^^^^^^^^^^^^^^^^^^^^^^^^^ here > >-- >vda From kbc_hyper at hotmail.com Fri Jul 27 15:20:23 2007 From: kbc_hyper at hotmail.com (Choi Jason) Date: Fri, 27 Jul 2007 17:20:23 -0500 Subject: need some help to setup nslookup In-Reply-To: <200707251955.03030.vapier@gentoo.org> Message-ID: Thank you Routing Table on my target is, # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.5.0 * 255.255.255.0 U 0 0 0 eth0 127.0.0.0 * 255.0.0.0 U 0 0 0 lo default 192.168.5.1 0.0.0.0 UG 0 0 0 eth0 and my /etc/hosts is as followings, # cat hosts 127.0.0.1 localhost 192.168.5.60 hyper3.site hyper3 209.131.36.158 www.yahoo.com and my /etc/resolv.conf is as followings search abc.net nameserver 4.2.2.1 But I don't understand libc relate things, could you tell me more about this? Thanks in advance. :) Jason, >From: Mike Frysinger >To: busybox at busybox.net >CC: "Choi Jason" >Subject: Re: need some help to setup nslookup >Date: Wed, 25 Jul 2007 19:55:02 -0400 > >On Wednesday 25 July 2007, Choi Jason wrote: > > Now, I tried to use nslookup on my target system. > > When I compiled busybox, I just turned on Networking Utilities -> nslookup. > > And I install this busybox to my target. > >busybox contains no dns logic. all querying is done via the system libc >functions, so please consult the manual for whichever libc you're using to >find out how to properly configure /etc/resolv.conf, /etc/hosts, your routing >table, and network interfaces. > >in fact, i'd check the above list in the reverse order i specified to make >sure your system is setup properly. tldp.org has some pretty complete >howto's you could read. >-mike ><< signature.asc >> From dallas.a.clement at gmail.com Fri Jul 27 11:20:29 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Fri, 27 Jul 2007 13:20:29 -0500 Subject: reboot/poweroff/halt commands not working Message-ID: <1185560429.3596.3.camel@localhost> I'm using 1.6.1 and none of these commands seem to work all by themselves. If I provide the -f option, they all work just fine. I'm not sure if this is a regression problem or it has always been this way. I thought things were working properly in previous versions. I'm pretty sure I did not have to supply the -f option. From hamish at cloud.net.au Fri Jul 27 17:50:54 2007 From: hamish at cloud.net.au (Hamish Moffatt) Date: Sat, 28 Jul 2007 10:50:54 +1000 Subject: Monitor black after 10 Minutes In-Reply-To: <46A9FD8B.6090701@imc-berlin.de> References: <23914.1185541558@brightstareng.com> <46A9FD8B.6090701@imc-berlin.de> Message-ID: <20070728005054.GA14731@cloud.net.au> On Fri, Jul 27, 2007 at 04:13:31PM +0200, Steven Scholz wrote: > Paul Fox wrote: > > > As another post said - nothing to do with BusyBox. But it's the kernel > > > that's doing this. I compiled ncurses, then setterm from util-linux and > > > used the command 'setterm -blank 0'. This is the heavy handed way of > > > doing things. > > > > yes, that's a lot of work :-), since in the end all setterm does is > > emit the previously mentioned escape sequence. ( "ESC [ 9 ; 0 ]" ) > > > > TERM=linux setterm -blank 0 | hexdump -C > > But this all only works if I am actually working on this terminal!? > > I do have a frame buffer console (VT) with no keyboard, but use the serial > console. If "setterm -blank 0 | hexdump -C" works, then "setterm -blank 0 > /dev/tty0" should also work. Hamish -- Hamish Moffatt VK3SB From vapier at gentoo.org Fri Jul 27 22:12:55 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Sat, 28 Jul 2007 01:12:55 -0400 Subject: "multiple target patterns" error while building under cygwin In-Reply-To: <20070727180540.GD11697@aon.at> References: <000501c7cd42$2a1b0d20$dcc4af0a@atmel.com> <20070727180540.GD11697@aon.at> Message-ID: <200707280112.56857.vapier@gentoo.org> On Friday 27 July 2007, Bernhard Fischer wrote: > On Fri, Jul 27, 2007 at 01:04:00PM -0400, Crane, Matthew wrote: > >Hi, > > > >Thanks for your response. I think my build error is the result of the > >dos2unix + unix2dos patch. My cygwin system was installed with Unix > >text mode, and I've tried to explicitly set the locale, but fixdep > >always seems to output the Dos text. > > > >I instead used the dos2unix/unix2dos patch to fix the fixdep output, > >which I think ending up causing the error below. Not sure how though, > >or how to fix it. Thanks, > > > >Matt > > > > > >.applets.o.cmd looks like this: > > > >cmd_applets/applets.o := > > > >deps_applets/applets.o := \ > > applets/applets.c \ > > $(wildcard include/config/static.h) \ > > $(wildcard include/config/show/usage.h) \ > > > > > >line 410: applets/applets.o: $(deps_applets/applets.o) > > > >$(deps_applets/applets.o): > > > > > >I had already patched the make process so that it runs fixdep through > >unix2dos, dos2unix similar to this patch I found online: > > > >define rule_cc_o_c > > $(call echo-cmd,checksrc) $(cmd_checksrc) \ > > $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \ > >+ dos2unix $(depfile); \ > > $(cmd_modversions) \ > >- scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \ > > > >+ scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' | > >unix2dos > \ > > $(dot-target).tmp; \ > > rm -f $(depfile); \ > > mv -f $(dot-target).tmp $(dot-target).cmd > > > >It proceeded to build, but failed with the above error. Maybe related, > >not sure. I'm looking forward to the day when cygwin support is > >completely transparent in buildroot, soon I'm sure. > > This doesn't really sounds like a buildroot issue to me but rather a > busybox issue, fwiw. > > Perhaps somebody else is aware of what's going on with busybox on > cygwin. my guess is their make is too old to support | properly, we've hit this many times before -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/20070728/9d18421d/attachment.pgp From wharms at bfs.de Sat Jul 28 02:14:31 2007 From: wharms at bfs.de (walter harms) Date: Sat, 28 Jul 2007 11:14:31 +0200 Subject: Monitor black after 10 Minutes In-Reply-To: <46A9FFB1.8060604@Kriegisch.name> References: <23914.1185541558@brightstareng.com> <46A9F362.7090702@bfs.de> <46A9FFB1.8060604@Kriegisch.name> Message-ID: <46AB08F7.9090809@bfs.de> Alexander Kriegisch wrote: >> To discover what more can be done use 'man console_code'. > > Maybe you mean 'man console_codes' (trailing 's')? > - mea culpa, i skip the trailing s by accident sorry if someone got confused, wh From dallas.a.clement at gmail.com Sat Jul 28 05:26:37 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Sat, 28 Jul 2007 07:26:37 -0500 Subject: How do I add a user to multiple groups? Message-ID: <1185625597.3367.4.camel@localhost> Hello All, I'd like to use the busybox 'adduser' command to add a user to multiple groups. Can anyone show me how to do this? This is an example of what I would like the group file to look like afterward: dallas at debian:~/fs-images/common/etc$ cat group root::0:root bin:x:1:root,bin,daemon daemon:x:2:root,bin,daemon sys:x:3:root,bin tty:*:4:root,tty sshd:x:33:sshd As you can see, the 'root' user is a member of multiple groups. It would be nice if I could do something like this, but it does not work: adduser -h /root -g "root user" -s /bin/ash -G 0 -G 1 -G 2 -G 3 -G 4 root Thanks, Dallas From farmatito at tiscali.it Sat Jul 28 14:27:33 2007 From: farmatito at tiscali.it (Tito) Date: Sat, 28 Jul 2007 23:27:33 +0200 Subject: How do I add a user to multiple groups? In-Reply-To: <1185625597.3367.4.camel@localhost> References: <1185625597.3367.4.camel@localhost> Message-ID: <200707282327.33710.farmatito@tiscali.it> On Saturday 28 July 2007 14:26:37 Dallas Clement wrote: > Hello All, > > I'd like to use the busybox 'adduser' command to add a user to multiple > groups. Can anyone show me how to do this? > > This is an example of what I would like the group file to look like > afterward: > > dallas at debian:~/fs-images/common/etc$ cat group > root::0:root > bin:x:1:root,bin,daemon > daemon:x:2:root,bin,daemon > sys:x:3:root,bin > tty:*:4:root,tty > sshd:x:33:sshd > > As you can see, the 'root' user is a member of multiple groups. > > It would be nice if I could do something like this, but it does not > work: > >adduser -h /root -g "root user" -s /bin/ash -G 0 -G 1 -G 2 -G 3 -G 4 root Hi, something like this should do the trick: adduser -h /root -g "root user" -s /bin/ash root addgroup root root <- this is probably not needed as it is the user's default group addgroup root bin addgroup root daemon addgroup root sys addgroup root tty Ciao, Tito > > Thanks, > Dallas From pclouds at gmail.com Sat Jul 28 14:55:40 2007 From: pclouds at gmail.com (Nguyen Thai Ngoc Duy) Date: Sat, 28 Jul 2007 17:55:40 -0400 Subject: potential bug in ash Message-ID: Hi Here is an excerpt from ash.c: if (pathopt) { /* this is a %func directory */ stalloc(strlen(fullname) + 1); readcmdfile(fullname); cmdp = cmdlookup(name, 0); if (cmdp == NULL || cmdp->cmdtype != CMDFUNCTION) ash_msg_and_raise_error("%s not defined in %s", name, fullname); stunalloc(fullname); goto success; } gmail may corrupt the code but you can find the code in function find_command(). fullname is not updated after stalloc(). It is perfectly fine now because there isn't any stalloc inside the while loop. But if in future you decide to allocate some blocks before that excerpt, the return value from stalloc(strlen(fullname) + 1) may no longer be fullname and then stunalloc(fullname) will blindly screw up the stack. I encountered this problem when trying to (don't blame me) port ash to Windows. So the suggestion is replace stalloc() line with: fullname = stalloc(strlen(fullname) + 1); The safer the better. -- Duy From landau_alex at yahoo.com Sun Jul 29 00:41:04 2007 From: landau_alex at yahoo.com (Alex Landau) Date: Sun, 29 Jul 2007 00:41:04 -0700 (PDT) Subject: [PATCH] Fix start-stop-daemon on no-MMU In-Reply-To: <870780.98387.qm@web62513.mail.re1.yahoo.com> Message-ID: <813295.16381.qm@web62502.mail.re1.yahoo.com> --- Alex Landau wrote: > > --- Mike Frysinger wrote: > > > On Tuesday 24 July 2007, Alex Landau wrote: > > > You may also find some code duplications with the fork_and_reexec functions > > > (i.e. call to setsid, dupping /dev/null to 0,1 and 2), > > > > there is a bb sanitize io function which could alleviate some of this isnt > > there ? > > -mike > > > > No that won't work. bb_sanitize_stdio() goes over descriptors 0,1,2 and if any is > closed, > connects it to /dev/null. I want to force them to be /dev/null. > Second, the dups and setsid are combined with the re-execing, while in the > start-stop-daemon case the child should continue and do some stuff before execing. > And last, either I don't understand something, or the bb_daemonize_or_rexec() function > that bb_sanitize_stdio() uses is broken: DAEMON_DEVNULL_STDIO is defined as 0, so we > never close 0,1,2 (unless we're also re-execing) and that "if" is dead code. > > Alex > Are there any other problems with this patch? Alex ____________________________________________________________________________________ Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out. http://answers.yahoo.com/dir/?link=list&sid=396545469 From sync.jma at gmail.com Sun Jul 29 05:03:07 2007 From: sync.jma at gmail.com (Sync ma) Date: Sun, 29 Jul 2007 20:03:07 +0800 Subject: busybox-1.6.1 Clear screen Message-ID: Hi, all: I have problems on clearing the screen, when I type CTRL+L, there were actually no effect. I have serached the site:www.busybox.net, and there seems nothing useful. I missed anything? My .config file has turned on all the console-utils options: 250 # Console Utilities 251 # 252 CONFIG_CHVT=y 253 CONFIG_CLEAR=y 254 CONFIG_DEALLOCVT=y 255 CONFIG_DUMPKMAP=y 256 CONFIG_LOADFONT=y 257 CONFIG_LOADKMAP=y 258 CONFIG_OPENVT=y 259 CONFIG_RESET=y 260 CONFIG_RESIZE=y 261 CONFIG_FEATURE_RESIZE_PRINT=y 262 CONFIG_SETCONSOLE=y 263 CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS=y 264 CONFIG_SETKEYCODES=y 265 CONFIG_SETLOGCONS=y I have add a test 'printf' in clear.c and it still has no output. 16 int clear_main(int argc, char **argv) 17 { 18 printf("---------------------\n"); 19 >___return printf("\033[H\033[J") != 6; 20 } My console tools is SecureCRT-5.22. toolchain verison: binutils-2.16.1 gcc-4.1.2 uClibc-0.9.28.2 Thanks. Jun From vda.linux at googlemail.com Sun Jul 29 06:42:37 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 29 Jul 2007 14:42:37 +0100 Subject: need some help to setup nslookup In-Reply-To: References: <200707251955.03030.vapier@gentoo.org> Message-ID: <1158166a0707290642t219aa205n433b14f2d0d608f2@mail.gmail.com> On 7/27/07, Choi Jason wrote: > Thank you > > Routing Table on my target is, > > # route > Kernel IP routing table > Destination Gateway Genmask Flags Metric Ref Use > Iface > 192.168.5.0 * 255.255.255.0 U 0 0 0 > eth0 > 127.0.0.0 * 255.0.0.0 U 0 0 0 lo > default 192.168.5.1 0.0.0.0 UG 0 0 0 > eth0 > > and my /etc/hosts is as followings, > # cat hosts > > 127.0.0.1 localhost > 192.168.5.60 hyper3.site hyper3 > 209.131.36.158 www.yahoo.com > > and my /etc/resolv.conf is as followings > search abc.net > nameserver 4.2.2.1 > > But I don't understand libc relate things, could you tell > me more about this? > Thanks in advance. :) You can see how your target talks with DNS server, Example from my box: # tcpdump -nlieth0 -s0 -vvv port 53 and host 172.26.128.68 tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes My box asks DNS: 14:35:33.185908 IP (tos 0x0, ttl 64, id 56103, offset 0, flags [DF], proto: UDP (17), length: 66) 172.28.3.151.33502 > 172.26.128.68.53: [bad udp cksum 72c5!] 15029+ A? www.sdjhgfklsdjg.com. (38) DNS answers: 14:35:33.186167 IP (tos 0x0, ttl 63, id 31911, offset 0, flags [DF], proto: UDP (17), length: 139) 172.26.128.68.53 > 172.28.3.151.33502: [udp sum ok] 15029 NXDomain q: A? www.sdjhgfklsdjg.com. 0/1/0 ns: com. SOA a.gtld-servers.net. nstld.verisign-grs.com. 1185716104 1800 900 604800 900 (111) If you see similar things, then the problem is not in your box's config. DNS server just can't resolve names. If you don't see answers at all, you talk to wrong/nonexistent DNS server. If you don't see _questions_, you have routing/firewall problem on your box. -- vda From vda.linux at googlemail.com Sun Jul 29 06:56:09 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 29 Jul 2007 14:56:09 +0100 Subject: potential bug in ash In-Reply-To: References: Message-ID: <1158166a0707290656y1e73c001t81d4a1c9e709da59@mail.gmail.com> On 7/28/07, Nguyen Thai Ngoc Duy wrote: > Hi > > Here is an excerpt from ash.c: > if (pathopt) { /* this is a %func directory */ > stalloc(strlen(fullname) + 1); > readcmdfile(fullname); > cmdp = cmdlookup(name, 0); > if (cmdp == NULL || cmdp->cmdtype != CMDFUNCTION) > ash_msg_and_raise_error("%s not defined in %s", name, fullname); > stunalloc(fullname); > goto success; > } > > gmail may corrupt the code but you can find the code in function find_command(). > > fullname is not updated after stalloc(). It is perfectly fine now > because there isn't any stalloc inside the while loop. But if in > future you decide to allocate some blocks before that excerpt, the > return value from stalloc(strlen(fullname) + 1) may no longer be > fullname and then stunalloc(fullname) will blindly screw up the stack. Whee, somebody who can read ash.c! :) That stalloc you talk about is highly non-obvious, but it's not the only grey code there. Code seems to have more uses of fullname after stunalloc(fullname): stunalloc(fullname); ... if (fullname[0] == '/' && idx <= prev) { ... while (stat(fullname, &statb) < 0) { Which is technically valid (I think) as long as you don't stalloc something. I will add big comment for now. -- vda From vda.linux at googlemail.com Sun Jul 29 06:59:34 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 29 Jul 2007 14:59:34 +0100 Subject: busybox-1.6.1 Clear screen In-Reply-To: References: Message-ID: <1158166a0707290659l6f8e1b72rff70872d638bfd72@mail.gmail.com> On 7/29/07, Sync ma wrote: > Hi, all: > I have problems on clearing the screen, when I type CTRL+L, there > were actually no effect. > I have serached the site:www.busybox.net, and there seems nothing > useful. I missed anything? Try to run this: $ strace -o zz ./busybox clear On my box in zz I see this: execve("./busybox", ["./busybox", "clear"], [/* 53 vars */]) = 0 ... fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 3), ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0xffffce7c) = 0xf7ffa000 write(1, "\33[H\33[J", 6) = 6 munmap(0xf7ffa000, 4096) = 0 exit_group(0) = ? What do you see? -- vda From vda.linux at googlemail.com Sun Jul 29 07:02:41 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 29 Jul 2007 15:02:41 +0100 Subject: [PATCH] Fix start-stop-daemon on no-MMU In-Reply-To: <813295.16381.qm@web62502.mail.re1.yahoo.com> References: <870780.98387.qm@web62513.mail.re1.yahoo.com> <813295.16381.qm@web62502.mail.re1.yahoo.com> Message-ID: <1158166a0707290702v5b31fb91q49a1b3b5405a7e6b@mail.gmail.com> On 7/29/07, Alex Landau wrote: > Are there any other problems with this patch? Sorry, the biggest problem currently is that I have limited access to email. Expect a bit of lag... -- vda From vda.linux at googlemail.com Sun Jul 29 07:07:04 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 29 Jul 2007 15:07:04 +0100 Subject: reboot/poweroff/halt commands not working In-Reply-To: <1185560429.3596.3.camel@localhost> References: <1185560429.3596.3.camel@localhost> Message-ID: <1158166a0707290707l2deee8d1ra5c73eef7938ef9b@mail.gmail.com> On 7/27/07, Dallas Clement wrote: > I'm using 1.6.1 and none of these commands seem to work all by > themselves. If I provide the -f option, they all work just fine. I'm > not sure if this is a regression problem or it has always been this way. > > I thought things were working properly in previous versions. I'm pretty > sure I did not have to supply the -f option. Did 1.6.0 work? If not, did 1.5.1 work? -- vda From farmatito at tiscali.it Sun Jul 29 07:27:23 2007 From: farmatito at tiscali.it (Tito) Date: Sun, 29 Jul 2007 16:27:23 +0200 Subject: [PATCH] fix addgroup command line parsing Message-ID: <200707291627.23821.farmatito@tiscali.it> Hi, addgroup actually does: addgroup group addgroup -g num group addgroup user group so: addgroup -g num user group should not be permitted. This patch fixes the problem for me. diff -uN loginutils/addgroup.c.orig loginutils/addgroup.c --- loginutils/addgroup.c.orig 2007-05-30 14:41:30.000000000 +0200 +++ loginutils/addgroup.c 2007-07-29 16:22:50.000000000 +0200 @@ -148,6 +148,10 @@ if (argc == 2) { struct group *gr; + /* There was -g on the commandline: error out */ + if (gid) + bb_show_usage(); + /* check if group and user exist */ xuname2uid(argv[0]); /* unknown user: exit */ xgroup2gid(argv[1]); /* unknown group: exit */ Only little tested. Please apply if you like it. Ciao, Tito From wharms at bfs.de Sun Jul 29 08:13:52 2007 From: wharms at bfs.de (walter harms) Date: Sun, 29 Jul 2007 17:13:52 +0200 Subject: busybox-1.6.1 Clear screen In-Reply-To: References: Message-ID: <46ACAEB0.50603@bfs.de> clear screen is a command send to your terminal (see man console_codes for more codes that the Linux console knows about) It is possible that your terminal does not understand the sequence you send. please check your console type. re, wh Sync ma wrote: > Hi, all: > I have problems on clearing the screen, when I type CTRL+L, there > were actually no effect. > I have serached the site:www.busybox.net, and there seems nothing > useful. I missed anything? > > My .config file has turned on all the console-utils options: > > 250 # Console Utilities > 251 # > 252 CONFIG_CHVT=y > 253 CONFIG_CLEAR=y > 254 CONFIG_DEALLOCVT=y > 255 CONFIG_DUMPKMAP=y > 256 CONFIG_LOADFONT=y > 257 CONFIG_LOADKMAP=y > 258 CONFIG_OPENVT=y > 259 CONFIG_RESET=y > 260 CONFIG_RESIZE=y > 261 CONFIG_FEATURE_RESIZE_PRINT=y > 262 CONFIG_SETCONSOLE=y > 263 CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS=y > 264 CONFIG_SETKEYCODES=y > 265 CONFIG_SETLOGCONS=y > > I have add a test 'printf' in clear.c and it still has no output. > > 16 int clear_main(int argc, char **argv) > 17 { > 18 printf("---------------------\n"); > 19 >___return printf("\033[H\033[J") != 6; > 20 } > > My console tools is SecureCRT-5.22. > > toolchain verison: > binutils-2.16.1 > gcc-4.1.2 > uClibc-0.9.28.2 > > > > Thanks. > > > Jun > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From farmatito at tiscali.it Sun Jul 29 15:11:18 2007 From: farmatito at tiscali.it (Tito) Date: Mon, 30 Jul 2007 00:11:18 +0200 Subject: [PATCH] fix addgroup command line parsing -- now RFC In-Reply-To: <200707291627.23821.farmatito@tiscali.it> References: <200707291627.23821.farmatito@tiscali.it> Message-ID: <200707300011.18932.farmatito@tiscali.it> On Sunday 29 July 2007 16:27:23 Tito wrote: > Hi, > > addgroup actually does: > > addgroup group > addgroup -g num group > addgroup user group > > so: > > addgroup -g num user group > > should not be permitted. > This patch fixes the problem for me. > > diff -uN loginutils/addgroup.c.orig loginutils/addgroup.c > --- loginutils/addgroup.c.orig 2007-05-30 14:41:30.000000000 +0200 > +++ loginutils/addgroup.c 2007-07-29 16:22:50.000000000 +0200 > @@ -148,6 +148,10 @@ > if (argc == 2) { > struct group *gr; > > + /* There was -g on the commandline: error out */ > + if (gid) > + bb_show_usage(); > + > /* check if group and user exist */ > xuname2uid(argv[0]); /* unknown user: exit */ > xgroup2gid(argv[1]); /* unknown group: exit */ > > > Only little tested. > Please apply if you like it. > > Ciao, > Tito > > BTW: as gid_t gid = 0 has a special meaning as flag in addgroup.c (in the xgroup_study function) maybe we should change: gid = xatoul_range(group, 0, (gid_t)ULONG_MAX); to gid = xatoul_range(group, 1, (gid_t)ULONG_MAX); so that -g 0 is forbidden. OTOH setting the default value gid_t gid = -1 could also do the trick, but needs some minor changes in the code. In this case -g 0 would be a legal option. Hints? Ciao, Tito From sync.jma at gmail.com Sun Jul 29 17:15:01 2007 From: sync.jma at gmail.com (Jun) Date: Mon, 30 Jul 2007 08:15:01 +0800 Subject: busybox-1.6.1 Clear screen In-Reply-To: <1158166a0707290659l6f8e1b72rff70872d638bfd72@mail.gmail.com> References: <1158166a0707290659l6f8e1b72rff70872d638bfd72@mail.gmail.com> Message-ID: ./busybox clear works, it clears the screen indeed. seems CTRL+L have not been sent to busybox. here is my strace output: 1 execve("./busybox", ["./busybox", "clear"], [/* 8 vars */]) = 0 2 svr4_syscall() = -1 ERRNO_4090 (Unknown error 4090) 3 stat("/etc/ld.so.cache", 0x7fff7b18) = -1 ENOENT (No such file or directory) 4 open("/lib/libgcc_s.so.1", O_RDONLY) = 3 5 fstat(3, {st_mode=S_IFREG|0644, st_size=69796, ...}) = 0 6 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaae000 7 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\260\31"..., 4096) = 4096 8 old_mmap(NULL, 323584, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaed000 9 old_mmap(0x2aaed000, 58700, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2aaed000 10 old_mmap(0x2ab3b000, 3464, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xe000) = 0x2ab3b000 11 close(3) = 0 12 munmap(0x2aaae000, 4096) = 0 13 open("/lib/libc.so.0", O_RDONLY) = 3 14 fstat(3, {st_mode=S_IFREG|0644, st_size=430060, ...}) = 0 15 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaae000 16 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\260\272"..., 4096) = 4096 17 old_mmap(NULL, 667648, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab3c000 18 old_mmap(0x2ab3c000, 381332, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2ab3c000 19 old_mmap(0x2abd9000, 5000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x5d000) = 0x2abd9000 20 old_mmap(0x2abdb000, 16168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2abdb000 21 close(3) = 0 22 munmap(0x2aaae000, 4096) = 0 23 open("/lib/libc.so.0", O_RDONLY) = 3 24 fstat(3, {st_mode=S_IFREG|0644, st_size=430060, ...}) = 0 25 close(3) = 0 26 ioctl(0, TIOCNXCL, {B115200 opost isig icanon echo ...}) = 0 27 ioctl(1, TIOCNXCL, {B115200 opost isig icanon echo ...}) = 0 28 write(1, "---------------------\n", 22) = 22 29 write(1, "\33[H\33[J", 6) = 6 30 exit(0) = ? 2007/7/29, Denis Vlasenko : > On 7/29/07, Sync ma wrote: > > Hi, all: > > I have problems on clearing the screen, when I type CTRL+L, there > > were actually no effect. > > I have serached the site:www.busybox.net, and there seems nothing > > useful. I missed anything? > > Try to run this: > > $ strace -o zz ./busybox clear > > On my box in zz I see this: > > execve("./busybox", ["./busybox", "clear"], [/* 53 vars */]) = 0 > ... > fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 3), ...}) = 0 > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, > 0xffffce7c) = 0xf7ffa000 > write(1, "\33[H\33[J", 6) = 6 > munmap(0xf7ffa000, 4096) = 0 > exit_group(0) = ? > > What do you see? > -- > vda > -- I want to be an expert. I want to be a professional. From sync.jma at gmail.com Sun Jul 29 17:29:14 2007 From: sync.jma at gmail.com (Jun) Date: Mon, 30 Jul 2007 08:29:14 +0800 Subject: busybox-1.6.1 Clear screen In-Reply-To: <46ACAEB0.50603@bfs.de> References: <46ACAEB0.50603@bfs.de> Message-ID: My terminal(SecureCRT 5.2.2) type has been set to Xterm(with ANSI color on), it works on RHEL5 and CentOS 4.x. I have read the man page and maybe I have not enough time to research in details. I'll do this when free. there also no useful hints on google for this situation, If anybody meets the same problem and solve that, please share your work. Thanks a lot. 2007/7/29, walter harms : > clear screen is a command send to your terminal > (see man console_codes for more codes that the Linux console knows about) > It is possible that your terminal does not understand the sequence you send. > please check your console type. > > re, > wh > > > > > Sync ma wrote: > > Hi, all: > > I have problems on clearing the screen, when I type CTRL+L, there > > were actually no effect. > > I have serached the site:www.busybox.net, and there seems nothing > > useful. I missed anything? > > > > My .config file has turned on all the console-utils options: > > > > 250 # Console Utilities > > 251 # > > 252 CONFIG_CHVT=y > > 253 CONFIG_CLEAR=y > > 254 CONFIG_DEALLOCVT=y > > 255 CONFIG_DUMPKMAP=y > > 256 CONFIG_LOADFONT=y > > 257 CONFIG_LOADKMAP=y > > 258 CONFIG_OPENVT=y > > 259 CONFIG_RESET=y > > 260 CONFIG_RESIZE=y > > 261 CONFIG_FEATURE_RESIZE_PRINT=y > > 262 CONFIG_SETCONSOLE=y > > 263 CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS=y > > 264 CONFIG_SETKEYCODES=y > > 265 CONFIG_SETLOGCONS=y > > > > I have add a test 'printf' in clear.c and it still has no output. > > > > 16 int clear_main(int argc, char **argv) > > 17 { > > 18 printf("---------------------\n"); > > 19 >___return printf("\033[H\033[J") != 6; > > 20 } > > > > My console tools is SecureCRT-5.22. > > > > toolchain verison: > > binutils-2.16.1 > > gcc-4.1.2 > > uClibc-0.9.28.2 > > > > > > > > Thanks. > > > > > > Jun > > _______________________________________________ > > busybox mailing list > > busybox at busybox.net > > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > > > > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > -- I want to be an expert. I want to be a professional. From gregorigolo2002 at yahoo.fr Mon Jul 30 01:28:34 2007 From: gregorigolo2002 at yahoo.fr (grego rigolo) Date: Mon, 30 Jul 2007 08:28:34 +0000 (GMT) Subject: ifconfig, mount : need to press ENTER to get the prompt Message-ID: <617109.27479.qm@web23415.mail.ird.yahoo.com> Hello, I'd like to understand why i need to press ENTER to get the prompt when for example i issue the following command: ifconfig eth0 192.168.1.10 # ifconfig eth0 192.168.1.100 eth0: link down # eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1 Here is my inittab configuration: ##################################################### # /etc/inittab # # Copyright (C) 2001 Erik Andersen # # Note: BusyBox init doesn't support runlevels. The runlevels field is # completely ignored by BusyBox init. If you want runlevels, use # sysvinit. # # Format for each entry: ::: # # id == tty to run on, or empty for /dev/console # runlevels == ignored # action == one of sysinit, respawn, askfirst, wait, and once # process == program to run # Startup the system null::sysinit:/bin/mount -o remount,rw / null::sysinit:/bin/mount -t proc proc /proc null::sysinit:/bin/mount -a null::sysinit:/bin/hostname -F /etc/hostname null::sysinit:/sbin/ifconfig lo 127.0.0.1 up null::sysinit:/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo # now run any rc scripts ::sysinit:/etc/init.d/rcS # Set up a couple of getty's #tty1::respawn:/sbin/getty 38400 tty1 #tty2::respawn:/sbin/getty 38400 tty2 # Put a getty on the serial port ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 # Logging junk null::sysinit:/bin/touch /var/log/messages null::respawn:/sbin/syslogd -n -m 0 null::respawn:/sbin/klogd -n tty3::respawn:/usr/bin/tail -f /var/log/messages # Stuff to do for the 3-finger salute ::ctrlaltdel:/sbin/reboot # Stuff to do before rebooting null::shutdown:/usr/bin/killall klogd null::shutdown:/usr/bin/killall syslogd null::shutdown:/bin/umount -a -r null::shutdown:/sbin/swapoff -a ##################################################### thanks in advance greg _____________________________________________________________________________ Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070730/4735323b/attachment.htm From vapier at gentoo.org Mon Jul 30 03:21:11 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Mon, 30 Jul 2007 06:21:11 -0400 Subject: ifconfig, mount : need to press ENTER to get the prompt In-Reply-To: <617109.27479.qm@web23415.mail.ird.yahoo.com> References: <617109.27479.qm@web23415.mail.ird.yahoo.com> Message-ID: <200707300621.12354.vapier@gentoo.org> On Monday 30 July 2007, grego rigolo wrote: > I'd like to understand why i need to press ENTER to get the prompt when for > example i issue the following command: ifconfig eth0 192.168.1.10 > > > # ifconfig eth0 192.168.1.100 > eth0: link down > # eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1 not a busybox issue, nor do you need to press enter ... those messages are coming from the kernel. if you dont want to see them, then change the console log level via `dmesg -n` or read about the loglevel= kernel parameter in the kernel Documentation/. -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/20070730/53dd5d4b/attachment.pgp From vda.linux at googlemail.com Mon Jul 30 05:24:02 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 30 Jul 2007 13:24:02 +0100 Subject: [PATCH] fix addgroup command line parsing -- now RFC In-Reply-To: <200707300011.18932.farmatito@tiscali.it> References: <200707291627.23821.farmatito@tiscali.it> <200707300011.18932.farmatito@tiscali.it> Message-ID: <1158166a0707300524i173980d7o78a7c2eec7e7eb@mail.gmail.com> On 7/29/07, Tito wrote: > On Sunday 29 July 2007 16:27:23 Tito wrote: > > Hi, > > > > addgroup actually does: > > > > addgroup group > > addgroup -g num group > > addgroup user group > > > > so: > > > > addgroup -g num user group > > > > should not be permitted. > > This patch fixes the problem for me. > > > > diff -uN loginutils/addgroup.c.orig loginutils/addgroup.c > > --- loginutils/addgroup.c.orig 2007-05-30 14:41:30.000000000 +0200 > > +++ loginutils/addgroup.c 2007-07-29 16:22:50.000000000 +0200 > > @@ -148,6 +148,10 @@ > > if (argc == 2) { > > struct group *gr; > > > > + /* There was -g on the commandline: error out */ > > + if (gid) > > + bb_show_usage(); > > + > > /* check if group and user exist */ > > xuname2uid(argv[0]); /* unknown user: exit */ > > xgroup2gid(argv[1]); /* unknown group: exit */ > > > > > > Only little tested. > > Please apply if you like it. > > > > Ciao, > > Tito > > > > > > BTW: > > as gid_t gid = 0 has a special meaning as flag in addgroup.c > (in the xgroup_study function) maybe we should change: > > gid = xatoul_range(group, 0, (gid_t)ULONG_MAX); > to > gid = xatoul_range(group, 1, (gid_t)ULONG_MAX); > > so that -g 0 is forbidden. Which is wrong. gid 0 is technically valid gid. (gid_t)ULONG_MAX is also wrong, as it results in gid -1. > OTOH setting the default value gid_t gid = -1 > could also do the trick, but needs some minor > changes in the code. In this case -g 0 would be > a legal option. Hints? Checking for gid being !0 is silly. You can check whether -g option actually was there, or not. I committed some fixes to svn, including your fix and fix which (hopefully) makes -g 0 work correctly. -- vda From emiliano.lopez at gmail.com Mon Jul 30 08:54:56 2007 From: emiliano.lopez at gmail.com (Emiliano Lopez) Date: Mon, 30 Jul 2007 12:54:56 -0300 Subject: readhead.c error Message-ID: <50f131690707300854g2736d3a4n5daee650a0f2165d@mail.gmail.com> Hi, I am trying to compile busybox 1.4.1 using buildroot as a toolchain. I did make defconfig and then make. After a few minutes of busybox compilation the following error occur: CC miscutils/readahead.o cc1: warnings being treated as errors miscutils/readahead.c: In function 'readahead_main': miscutils/readahead.c:26: warning: implicit declaration of function 'readahead' make[1]: *** [miscutils/readahead.o] Error 1 make: *** [miscutils] Error 2 I don't know how to solve it, Could anyone help me, please? Thanks Emiliano (Santa Fe - Argentina) From wharms at bfs.de Mon Jul 30 12:06:34 2007 From: wharms at bfs.de (walter harms) Date: Mon, 30 Jul 2007 21:06:34 +0200 Subject: readhead.c error In-Reply-To: <50f131690707300854g2736d3a4n5daee650a0f2165d@mail.gmail.com> References: <50f131690707300854g2736d3a4n5daee650a0f2165d@mail.gmail.com> Message-ID: <46AE36BA.30301@bfs.de> hi Emiliano, this is known bug. see man 2 readahead it depends on LFS. please try a newer version of BB or disable readahead. re, wh Emiliano Lopez wrote: > Hi, I am trying to compile busybox 1.4.1 using buildroot as a toolchain. > I did make defconfig and then make. > After a few minutes of busybox compilation the following error occur: > > CC miscutils/readahead.o > cc1: warnings being treated as errors > miscutils/readahead.c: In function 'readahead_main': > miscutils/readahead.c:26: warning: implicit declaration of function 'readahead' > make[1]: *** [miscutils/readahead.o] Error 1 > make: *** [miscutils] Error 2 > > I don't know how to solve it, Could anyone help me, please? > Thanks > > Emiliano (Santa Fe - Argentina) > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From emiliano.lopez at gmail.com Mon Jul 30 12:41:32 2007 From: emiliano.lopez at gmail.com (Emiliano Lopez) Date: Mon, 30 Jul 2007 16:41:32 -0300 Subject: readhead.c error In-Reply-To: <46AE36BA.30301@bfs.de> References: <50f131690707300854g2736d3a4n5daee650a0f2165d@mail.gmail.com> <46AE36BA.30301@bfs.de> Message-ID: <50f131690707301241t23ac7cd9u8fecf76c8d0a2232@mail.gmail.com> Hi Walter, I tried disable readhead and LFS (large file storage) but then a lot of errors occurs: miscutils/taskset.c:46 errir: cpu_set_t undeclared (...) CPU_SETSIZE indeclares mask undeclared ... I will try a newer version. Thank you very much. Emiliano.- (Santa Fe-Argentina) On 30/07/07, walter harms wrote: > hi Emiliano, > this is known bug. see man 2 readahead it depends on LFS. > please try a newer version of BB or disable readahead. > > re, > wh > > > > Emiliano Lopez wrote: > > Hi, I am trying to compile busybox 1.4.1 using buildroot as a toolchain. > > I did make defconfig and then make. > > After a few minutes of busybox compilation the following error occur: > > > > CC miscutils/readahead.o > > cc1: warnings being treated as errors > > miscutils/readahead.c: In function 'readahead_main': > > miscutils/readahead.c:26: warning: implicit declaration of function 'readahead' > > make[1]: *** [miscutils/readahead.o] Error 1 > > make: *** [miscutils] Error 2 > > > > I don't know how to solve it, Could anyone help me, please? > > Thanks > > > > Emiliano (Santa Fe - Argentina) > > _______________________________________________ > > busybox mailing list > > busybox at busybox.net > > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > > > > > From rep.dot.nop at gmail.com Mon Jul 30 12:51:56 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Mon, 30 Jul 2007 21:51:56 +0200 Subject: readhead.c error In-Reply-To: <50f131690707301241t23ac7cd9u8fecf76c8d0a2232@mail.gmail.com> References: <50f131690707300854g2736d3a4n5daee650a0f2165d@mail.gmail.com> <46AE36BA.30301@bfs.de> <50f131690707301241t23ac7cd9u8fecf76c8d0a2232@mail.gmail.com> Message-ID: <20070730195155.GB29064@aon.at> On Mon, Jul 30, 2007 at 04:41:32PM -0300, Emiliano Lopez wrote: >Hi Walter, >I tried disable readhead and LFS (large file storage) but then a lot >of errors occurs: >miscutils/taskset.c:46 errir: cpu_set_t undeclared >(...) >CPU_SETSIZE indeclares >mask undeclared >... > >I will try a newer version. This sounds like you're attempting to use an old version of your libc. The current uClibc version is 0.9.29. As Walter already explained, you have to *enable* LFS (not disable it if i read you correctly). Updating to a current version of busybox may be a good idea too.. HTH, From steven.scholz at imc-berlin.de Tue Jul 31 01:05:26 2007 From: steven.scholz at imc-berlin.de (Steven Scholz) Date: Tue, 31 Jul 2007 10:05:26 +0200 Subject: Monitor black after 10 Minutes In-Reply-To: <20070728005054.GA14731@cloud.net.au> References: <23914.1185541558@brightstareng.com> <46A9FD8B.6090701@imc-berlin.de> <20070728005054.GA14731@cloud.net.au> Message-ID: <46AEED46.2090709@imc-berlin.de> >>> TERM=linux setterm -blank 0 | hexdump -C >> But this all only works if I am actually working on this terminal!? >> >> I do have a frame buffer console (VT) with no keyboard, but use the serial >> console. > > If "setterm -blank 0 | hexdump -C" works, then "setterm -blank 0 > > /dev/tty0" should also work. Of course! THANKS! Steven From vda.linux at googlemail.com Tue Jul 31 10:00:28 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 31 Jul 2007 18:00:28 +0100 Subject: [PATCH] Fix start-stop-daemon on no-MMU In-Reply-To: <1158166a0707290702v5b31fb91q49a1b3b5405a7e6b@mail.gmail.com> References: <870780.98387.qm@web62513.mail.re1.yahoo.com> <813295.16381.qm@web62502.mail.re1.yahoo.com> <1158166a0707290702v5b31fb91q49a1b3b5405a7e6b@mail.gmail.com> Message-ID: <1158166a0707311000w6a977564ncfd8c2f23e666594@mail.gmail.com> On 7/29/07, Denis Vlasenko wrote: > On 7/29/07, Alex Landau wrote: > > Are there any other problems with this patch? > > Sorry, the biggest problem currently is that I have > limited access to email. Expect a bit of lag... Applied with some other minor changes added, please check svn and yell if you see something bad. Thanks. -- vda From pclouds at gmail.com Tue Jul 31 12:30:45 2007 From: pclouds at gmail.com (Nguyen Thai Ngoc Duy) Date: Tue, 31 Jul 2007 15:30:45 -0400 Subject: editors/patch.c is broken Message-ID: src/dest file names are read by xmalloc_fgets which include trailing \n characters. Therefore patch either reads from wrong source file or write to wrong destination file. The attached patch should fix it. I'm not sure about the rest of xmalloc_fgets used in patch, though. -- Duy -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-patch-cannot-open-files-because-of-trailing-n.patch Type: text/x-patch Size: 1319 bytes Desc: not available Url : http://busybox.net/lists/busybox/attachments/20070731/6fcc9adb/attachment.bin From qexing at gmail.com Tue Jul 31 20:08:28 2007 From: qexing at gmail.com (Zhiming Zhou) Date: Wed, 1 Aug 2007 11:08:28 +0800 Subject: BusyBox poweroff problem with SMP kernel Message-ID: I compiled a smp linux kernel to support multiple processors, and use busybox 1.6.1 as root filesystem. The compiled linux system can be successfully started, and busybox ash is started, while I typed "poweroff" in ash, If the system run in computer with single processor; system stopped while "Sending SIGTERM to all processes" was printed, and I found in busybox source directory/init/init.c, function shutdown_system(void): message(L_CONSOLE | L_LOG, "Sending SIG%s to all processes", "TERM"); kill(-1, SIGTERM); but kill function can not be proceeded, and system stopped. But while the system run in computer with multiple processors; system stopped while "Power down system" was printed, it seems out of busybox, and acpi_power_off is not called. And if I compiled my linux kernel without CONFIG_SMP configed, and use the same busybox root file system, there was none poweroff problems in my system. ------------------------------------------------------------------------------ So, I want to know is there someone successfully use busybox to poweroff computer with SMP kernel? And what is the possible reason of my problem? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/busybox/attachments/20070801/f10849ae/attachment.htm From vda.linux at googlemail.com Sun Jul 1 14:54:45 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 16:54:45 +0200 Subject: [PATCH] on lease/pid-file for udhcpd/c In-Reply-To: <1183144975.14905.41.camel@Blue2net-mats.bellman.mea> References: <1183144975.14905.41.camel@Blue2net-mats.bellman.mea> Message-ID: <200707011654.45098.vda.linux@googlemail.com> On Friday 29 June 2007 21:22, Mats Erik Andersson wrote: > Hello all, > > I was getting annoyed at the reluctance of udhcpd to > volontarily update its lease file when a new lease has > been granted. The attached patch introduces a configuration > entry for Busybox 1.6.0 to write a new copy of the lease > file immediately when it has sent DHCPACK. I will apply this part. Thanks! > It took me some time to figure it out, but starting with > Busybox 1.6.0 there is a new entry FEATURE_PIDFILE, which when > forgotten causes udhcpc to complain about missing pidfile as > soon as one tries to release the device. To avoid that serious > malfunction I strongly suggest an addition to > networking/udhcp/Config.in: > > config APP_UDHCPC > ... > select FEATURE_PIDFILE I'd rather make it stop checking for pidfile if FEATURE_PIDFILE!=y. Can you describe in more detail (on source code level) where it complains? > The attached diff-file is bold enough to take care of > both matters. +#ifdef ENABLE_FEATURE_UDHCPD_WRITE_LEASES_EARLY + // Rewrite the file with leases at every new acceptance + write_leases(); +#endif ENABLE_FEATURE_UDHCPD_WRITE_LEASES_EARLY is always defined (to 1 or 0). You have to use #if, not #ifdef. -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 15:23:22 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 17:23:22 +0200 (CEST) Subject: [bug] undefined reference to `plus_minus_num' Message-ID: <0707011714180.21467@somehost> Trunk bb-build fails with: findutils/lib.a(find.o): In function `parse_params': find.c:(.text.parse_params+0x1b0): undefined reference to `xregcomp' find.c:(.text.parse_params+0x201): undefined reference to `plus_minus_num' if: # CONFIG_FEATURE_FIND_MTIME is not set # CONFIG_FEATURE_FIND_MMIN is not set # CONFIG_FEATURE_FIND_PERM is not set Minimal .config attached. Cheers, -- Cristian -------------- next part -------------- A non-text attachment was scrubbed... Name: bb-config.gz Type: application/octet-stream Size: 4160 bytes Desc: Url : http://lists.busybox.net/pipermail/busybox/attachments/20070701/52fa1ff3/attachment-0002.obj From cristian.ionescu-idbohrn at axis.com Sun Jul 1 16:08:03 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 18:08:03 +0200 (CEST) Subject: [patch] procps/ps.c:343: warning: unused variable `i' Message-ID: <0707011805270.21467@somehost> Fix warning: procps/ps.c: In function `ps_main': procps/ps.c:343: warning: unused variable `i' Cheers, -- Cristian -------------- next part -------------- A non-text attachment was scrubbed... Name: ps.c.patch Type: text/x-diff Size: 371 bytes Desc: Url : http://lists.busybox.net/pipermail/busybox/attachments/20070701/fe506acd/attachment-0002.bin From cristian.ionescu-idbohrn at axis.com Sun Jul 1 16:40:04 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 18:40:04 +0200 (CEST) Subject: [patch] findutils/find.c: whitespace-cleanup Message-ID: <0707011838350.21467@somehost> Cheers, -- Cristian -------------- next part -------------- A non-text attachment was scrubbed... Name: find.c.patch Type: text/x-diff Size: 3196 bytes Desc: Url : http://lists.busybox.net/pipermail/busybox/attachments/20070701/8d499e70/attachment-0002.bin From vda.linux at googlemail.com Sun Jul 1 16:41:21 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 18:41:21 +0200 Subject: [PATCH] on lease/pid-file for udhcpd/c In-Reply-To: <200707011654.45098.vda.linux@googlemail.com> References: <1183144975.14905.41.camel@Blue2net-mats.bellman.mea> <200707011654.45098.vda.linux@googlemail.com> Message-ID: <200707011841.21054.vda.linux@googlemail.com> On Sunday 01 July 2007 16:54, Denis Vlasenko wrote: > On Friday 29 June 2007 21:22, Mats Erik Andersson wrote: > > Hello all, > > > > I was getting annoyed at the reluctance of udhcpd to > > volontarily update its lease file when a new lease has > > been granted. The attached patch introduces a configuration > > entry for Busybox 1.6.0 to write a new copy of the lease > > file immediately when it has sent DHCPACK. > > I will apply this part. Thanks! BTW, udhcp code needs more love, that's for sure. Semi-random example: static int read_ip(const char *line, void *arg) { len_and_sockaddr *lsa; int retval = 0; lsa = host_and_af2sockaddr(line, 0, AF_INET); if (lsa) { *(struct in_addr*)arg = lsa->sin.sin_addr; free(lsa); retval = 1; } return retval; } struct in_addr is: struct in_addr { unsigned long int s_addr; } thus read_ip uses arg as a ptr to long. But here: uint32_t *ip; ip = xmalloc(sizeof(uint32_t)); read_ip(ip_string, ip); WTF?? What about e.g. AMD64 where longs take 64 bits?? Yet another sad story: "is server_config.start in network or host byte order?". Different parts of applet have different ideas about it... More? Unsafe htons macro use and no overflow check: case OPTION_U16: *result_u16 = htons(strtoul(val, &endptr, 0)); retval = (endptr[0] == '\0'); break; More? time() use for timeouts -> unsafe versus time being reset by admin. -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 17:13:40 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 19:13:40 +0200 (CEST) Subject: [patch] coreutils/expr.c is this acceptable Message-ID: <0707011912070.21467@somehost> Cheers, -- Cristian -------------- next part -------------- A non-text attachment was scrubbed... Name: expr.c.patch Type: text/x-diff Size: 530 bytes Desc: Url : http://lists.busybox.net/pipermail/busybox/attachments/20070701/16e3b58f/attachment-0002.bin From vda.linux at googlemail.com Sun Jul 1 17:17:59 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 19:17:59 +0200 Subject: tar applet In-Reply-To: References: Message-ID: <200707011917.59564.vda.linux@googlemail.com> On Saturday 30 June 2007 13:54, Erick Tyndall wrote: > I built busybox-1.6.0 and selected all the options for tar. When I use tar > to extract File-4.17.tar.gz or Perl-5.8.8.tar.bz2 I get the following error: > > tar -xzf file-4.17.tar.gz > tar: corrupted octal value in tar header > > It doesn't extract anything. Likely fixed in svn. With CONFIG_TAR=y CONFIG_FEATURE_TAR_CREATE=y CONFIG_FEATURE_TAR_BZIP2=y CONFIG_FEATURE_TAR_LZMA=y CONFIG_FEATURE_TAR_FROM=y CONFIG_FEATURE_TAR_GZIP=y CONFIG_FEATURE_TAR_COMPRESS=y CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY=y CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y CONFIG_FEATURE_TAR_LONG_OPTIONS=y I see this: # wget http://bent.latency.net/bent/darcs/file-4.17/src/file-4.17.tar.gz Connecting to bent.latency.net (64.21.79.2:80) file-4.17.tar.gz 100% |**********************************| 543k 00:00:00 ETA # ./busybox zcat file-4.17.tar.gz | ./busybox tar xvf - file-4.17/README file-4.17/acinclude.m4 ..... file-4.17/python/py_magic.h file-4.17/python/setup.py and I see file-4.17/ subdir extracted. In case I failed to find the same File-4.17.tar.gz that you are trying to untar: # md5sum file-4.17.tar.gz 50919c65e0181423d66bb25d7fe7b0fd file-4.17.tar.gz Please provide the URL next time. > When I use tar to extract linux-2.6.21.3.tar.bz2 it gives an error but > successfully extracts everything... "warning" != "error". > tar -xjf linux-2.6.21.3.tar.bz2 > tar: warning: skipping header 'g' It encountered pax header block and we currently do not support these, we just skip over them. Most of the time it works. -- vda From vda.linux at googlemail.com Sun Jul 1 17:24:33 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 19:24:33 +0200 Subject: [patch] procps/ps.c:343: warning: unused variable `i' In-Reply-To: <0707011805270.21467@somehost> References: <0707011805270.21467@somehost> Message-ID: <200707011924.33915.vda.linux@googlemail.com> On Sunday 01 July 2007 18:08, Cristian Ionescu-Idbohrn wrote: > Fix warning: > > procps/ps.c: In function `ps_main': > procps/ps.c:343: warning: unused variable `i' I just made some changes to ps in svn, should work now. Yell if it does not. -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 17:25:45 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 19:25:45 +0200 (CEST) Subject: Is there a way to /* silence gcc */? Message-ID: <0707011916350.21467@somehost> findutils/find.c: In function `parse_params': findutils/find.c:512: warning: no previous prototype for `alloc_action' Cheers, -- Cristian From vda.linux at googlemail.com Sun Jul 1 17:27:31 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 19:27:31 +0200 Subject: [patch] findutils/find.c: whitespace-cleanup In-Reply-To: <0707011838350.21467@somehost> References: <0707011838350.21467@somehost> Message-ID: <200707011927.31366.vda.linux@googlemail.com> Hi, It is indented with spaces there on purpose. With tabs it looks scary for 8-char tab people: @@ -438,15 +438,15 @@ static action*** parse_params(char **argv) { enum { - PARM_a , - PARM_o , + PARM_a , + PARM_o , USE_FEATURE_FIND_NOT( PARM_char_not ,) Applying this hunk: @@ -758,12 +758,12 @@ #define XATOU_SFX xatoul_sfx #endif static const struct suffix_mult find_suffixes[] = { - { "c", 1 }, - { "w", 2 }, - { "b"+1, 512 }, - { "b", 512 }, - { "k", 1024 }, - { NULL, 0 } + { "c", 1 }, + { "w", 2 }, + { "b"+1, 512 }, + { "b", 512 }, + { "k", 1024 }, + { NULL, 0 } }; action_size *ap; ap = ALLOC_ACTION(size); Thanks! -- vda From vda.linux at googlemail.com Sun Jul 1 17:32:13 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 19:32:13 +0200 Subject: [bug] undefined reference to `plus_minus_num' In-Reply-To: <0707011714180.21467@somehost> References: <0707011714180.21467@somehost> Message-ID: <200707011932.14008.vda.linux@googlemail.com> On Sunday 01 July 2007 17:23, Cristian Ionescu-Idbohrn wrote: > Trunk bb-build fails with: > > findutils/lib.a(find.o): In function `parse_params': > find.c:(.text.parse_params+0x1b0): undefined reference to `xregcomp' --- libbb/Kbuild (revision 18982) +++ libbb/Kbuild (working copy) @@ -126,3 +126,4 @@ lib-$(CONFIG_MDEV) += xregcomp.o lib-$(CONFIG_LESS) += xregcomp.o lib-$(CONFIG_DEVFSD) += xregcomp.o +lib-$(CONFIG_FEATURE_FIND_REGEX) += xregcomp.o > find.c:(.text.parse_params+0x201): undefined reference to `plus_minus_num' > > if: > > # CONFIG_FEATURE_FIND_MTIME is not set > # CONFIG_FEATURE_FIND_MMIN is not set > # CONFIG_FEATURE_FIND_PERM is not set --- findutils/find.c (revision 18985) +++ findutils/find.c (working copy) @@ -425,8 +425,9 @@ } #endif -#if ENABLE_FEATURE_FIND_PERM || ENABLE_FEATURE_FIND_MTIME \ - || ENABLE_FEATURE_FIND_MMIN +#if ENABLE_FEATURE_FIND_PERM \ + || ENABLE_FEATURE_FIND_MTIME || ENABLE_FEATURE_FIND_MMIN \ + || ENABLE_FEATURE_FIND_SIZE static const char* plus_minus_num(const char* str) Fixing in svn, thanks. -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 17:37:49 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 19:37:49 +0200 (CEST) Subject: [patch] procps/ps.c:343: warning: unused variable i In-Reply-To: <200707011924.33915.vda.linux@googlemail.com> References: <0707011805270.21467@somehost> <200707011924.33915.vda.linux@googlemail.com> Message-ID: <0707011936330.21467@somehost> On Sun, 1 Jul 2007, Denis Vlasenko wrote: > On Sunday 01 July 2007 18:08, Cristian Ionescu-Idbohrn wrote: > > Fix warning: > > > > procps/ps.c: In function `ps_main': > > procps/ps.c:343: warning: unused variable `i' > > I just made some changes to ps in svn, should work now. > Yell if it does not. Looks better now :) Cheers, -- Cristian From vda.linux at googlemail.com Sun Jul 1 17:43:27 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 19:43:27 +0200 Subject: [patch] coreutils/expr.c is this acceptable In-Reply-To: <0707011912070.21467@somehost> References: <0707011912070.21467@somehost> Message-ID: <200707011943.27411.vda.linux@googlemail.com> On Sunday 01 July 2007 19:13, Cristian Ionescu-Idbohrn wrote: > > Cheers, > Do you mean that your gcc emits bogus warning for l too? static VALUE *eval6(void) { - VALUE *l, *r, *v = NULL /* silence gcc */, *i1, *i2; + VALUE *r, *i1, *i2; + VALUE *l = NULL, *v = NULL /* silence gcc */; static const char * const keywords[] = { "quote", "length", "match", "index", "substr", NULL }; @@ -503,5 +504,3 @@ fflush_stdout_and_exit(null(v)); } This is better (no actual code generated: VALUE *l = l; /* silence gcc */ VALUE *v = v; /* silence gcc */ -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 17:51:37 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 19:51:37 +0200 (CEST) Subject: [patch] findutils/find.c: whitespace-cleanup In-Reply-To: <200707011927.31366.vda.linux@googlemail.com> References: <0707011838350.21467@somehost> <200707011927.31366.vda.linux@googlemail.com> Message-ID: <0707011947370.21467@somehost> On Sun, 1 Jul 2007, Denis Vlasenko wrote: > It is indented with spaces there on purpose. Still, the header says: /* vi: set sw=4 ts=4: */ emacs can also be ammended to respect that. > With tabs it looks scary for 8-char tab people: :) > Applying this hunk: Thanks, -- Cristian From vda.linux at googlemail.com Sun Jul 1 18:07:51 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 20:07:51 +0200 Subject: [PATCH] more devfsd clean up and size reduction In-Reply-To: <200706301416.33468.farmatito@tiscali.it> References: <200706301416.33468.farmatito@tiscali.it> Message-ID: <200707012007.51853.vda.linux@googlemail.com> On Saturday 30 June 2007 14:16, Tito wrote: > Hi, > as nobody complained about my previous devfsd patch > (....i presume because nobody is using it ;-) ) > here is one more round > of size reduction and code clean style clean up. > This patch removes the functions > msg_logger, msg_logger_and_die, fork_and_execute > and uses libbb stuff instead. > > Bloat-o-meter says: > > root at localhost:~/Desktop/busybox# scripts/bloat-o-meter busybox_old busybox_unstripped > function old new delta > expand_variable 756 759 +3 > get_variable 259 257 -2 > get_uid_gid 122 120 -2 > do_ioctl_and_die 27 25 -2 > st_expr_expand 488 485 -3 > signal_handler 94 91 -3 > devfsd_main 842 833 -9 > service_name 2444 2433 -11 > read_config_file 1119 1098 -21 > msg_logger_and_die 31 - -31 > .rodata 125143 125111 -32 > msg_logger 88 - -88 > fork_and_execute 95 - -95 > ------------------------------------------------------------------------------ > (add/remove: 0/3 grow/shrink: 1/9 up/down: 3/-299) Total: -296 bytes > > BE WARNED THAT THIS IS ONLY COMPILE TESTED!!! > > If there are some volunteers for testing it ..... > > Denis could you please take a look at my use > of spawn, xspawn, wait4pid and bb_daemonize_or_rexec > as I never used them before and i'm not quite sure > if i've done things right............. > and apply the patch if you like it. Looks like you should indeed use fopen, not xfopen here. You test it for NULL, and do not seem to exit if it fails: - if ((fp = fopen(path, "r")) != NULL) { + if ((fp = xfopen(path, "r")) != NULL) { while (fgets(buf, STRING_LENGTH, fp) != NULL) { /* Skip whitespace */ - for (line = buf; isspace(*line); ++line) - /*VOID*/; + line = buf; + line = skip_whitespace(line); if (line[0] == '\0' || line[0] == '#') continue; process_config_line(line, event_mask); } fclose(fp); - } else { - goto read_config_file_err; } } else { -read_config_file_err: - if (optional == 0 && errno == ENOENT) - msg_logger_and_die(LOG_ERR, "read config file: %s: %m", path); + if (optional == 0 && errno == ENOENT) + error_logger_and_die(LOG_ERR, "read config file: %s", path); } } /* End Function read_config_file */ Here you should pass argv, not NULL, to 2nd parameter of bb_daemonize_or_rexec: - fork_and_execute(DIE, NULL, NULL); - setsid(); /* Prevent hangups and become pgrp leader */ + bb_daemonize_or_rexec(0, NULL); It basically will pass argv back to devfsd_main() in re-executed child (If you run on NOMMU CPU. On MMU, it simply daemonize and ignore argv). Looks right: - fork_and_execute(NO_DIE, argv[0], argv); + wait4pid(spawn(argv)); I like devfsd.c :) Look at this beauty: /* strip last / from mount point, so we don't need to check for it later */ while (argv[1][1] != '\0' && argv[1][strlen(argv[1]) - 1] == '/') argv[1][strlen(argv[1]) - 1] = '\0'; -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 18:10:23 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 20:10:23 +0200 (CEST) Subject: [patch] coreutils/expr.c is this acceptable In-Reply-To: <200707011943.27411.vda.linux@googlemail.com> References: <0707011912070.21467@somehost> <200707011943.27411.vda.linux@googlemail.com> Message-ID: <0707012007300.21467@somehost> On Sun, 1 Jul 2007, Denis Vlasenko wrote: > Do you mean that your gcc emits bogus warning for l too? Yes. > This is better (no actual code generated: > > VALUE *l = l; /* silence gcc */ > VALUE *v = v; /* silence gcc */ It's fine with me, as long as it makes gcc shut up (which it does). Cheers, -- Cristian From cristian.ionescu-idbohrn at axis.com Sun Jul 1 18:18:17 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 20:18:17 +0200 (CEST) Subject: provide reasonable config values... Message-ID: <0707012016250.21467@somehost> ...to skip warnings: .config:75:warning: symbol value '' invalid for FEATURE_EDITING_MAX_LEN .config:78:warning: symbol value '' invalid for FEATURE_EDITING_HISTORY .config:300:warning: symbol value '' invalid for FEATURE_VI_MAX_LEN .config:498:warning: symbol value '' invalid for FEATURE_LESS_MAXLINES Cheers, -- Cristian From vda.linux at googlemail.com Sun Jul 1 18:22:05 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 20:22:05 +0200 Subject: Is there a way to /* silence gcc */? In-Reply-To: <0707011916350.21467@somehost> References: <0707011916350.21467@somehost> Message-ID: <200707012022.05877.vda.linux@googlemail.com> On Sunday 01 July 2007 19:25, Cristian Ionescu-Idbohrn wrote: > findutils/find.c: In function `parse_params': > findutils/find.c:512: warning: no previous prototype for `alloc_action' I think it's possible only thru gcc bugzilla. Or maybe gcc 4.2 will have it fixed? -- vda From vda.linux at googlemail.com Sun Jul 1 18:31:59 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 20:31:59 +0200 Subject: provide reasonable config values... In-Reply-To: <0707012016250.21467@somehost> References: <0707012016250.21467@somehost> Message-ID: <200707012031.59033.vda.linux@googlemail.com> On Sunday 01 July 2007 20:18, Cristian Ionescu-Idbohrn wrote: > ...to skip warnings: > > .config:75:warning: symbol value '' invalid for FEATURE_EDITING_MAX_LEN > .config:78:warning: symbol value '' invalid for FEATURE_EDITING_HISTORY > .config:300:warning: symbol value '' invalid for FEATURE_VI_MAX_LEN > .config:498:warning: symbol value '' invalid for FEATURE_LESS_MAXLINES I don't know how to do it. -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 18:36:41 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 20:36:41 +0200 (CEST) Subject: Is there a way to /* silence gcc */? In-Reply-To: <200707012022.05877.vda.linux@googlemail.com> References: <0707011916350.21467@somehost> <200707012022.05877.vda.linux@googlemail.com> Message-ID: <0707012033000.21467@somehost> On Sun, 1 Jul 2007, Denis Vlasenko wrote: > On Sunday 01 July 2007 19:25, Cristian Ionescu-Idbohrn wrote: > > findutils/find.c: In function `parse_params': > > findutils/find.c:512: warning: no previous prototype for `alloc_action' > > I think it's possible only thru gcc bugzilla. Let's hope so. > Or maybe gcc 4.2 will have it fixed? Unfortunately not yet, AFAICS: # /usr/bin/gcc-4.2 --version gcc-4.2 (GCC) 4.2.1 20070627 (prerelease) (Debian 4.2-20070627-1) Cheers, -- Cristian From cristian.ionescu-idbohrn at axis.com Sun Jul 1 18:57:33 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 20:57:33 +0200 (CEST) Subject: provide reasonable config values... In-Reply-To: <200707012031.59033.vda.linux@googlemail.com> References: <0707012016250.21467@somehost> <200707012031.59033.vda.linux@googlemail.com> Message-ID: <0707012056320.21467@somehost> On Sun, 1 Jul 2007, Denis Vlasenko wrote: > On Sunday 01 July 2007 20:18, Cristian Ionescu-Idbohrn wrote: > > ...to skip warnings: > > > > .config:75:warning: symbol value '' invalid for FEATURE_EDITING_MAX_LEN > > .config:78:warning: symbol value '' invalid for FEATURE_EDITING_HISTORY > > .config:300:warning: symbol value '' invalid for FEATURE_VI_MAX_LEN > > .config:498:warning: symbol value '' invalid for FEATURE_LESS_MAXLINES > > I don't know how to do it. Neither do I :( Cheers, -- Cristian From cristian.ionescu-idbohrn at axis.com Sun Jul 1 19:12:34 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 21:12:34 +0200 (CEST) Subject: CLOCK_MONOTONIC Message-ID: <0707012057510.21467@somehost> config MONOTONIC_SYSCALL bool "Use clock_gettime(CLOCK_MONOTONIC) syscall" default y help Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring time intervals (time, ping, traceroute etc need this). Probably requires Linux 2.6+. If not selected, gettimeofday will be used instead (which gives wrong results if date/time is reset). Looks like both linux and libc are involved. On my debian unstable box: # find /usr/include -type f | sort | xargs egrep CLOCK_MONOTONIC | sort /usr/include/bits/time.h:# define CLOCK_MONOTONIC 1 /usr/include/diet/time.h:#define CLOCK_MONOTONIC 1 /usr/include/diet/time.h:#define CLOCK_MONOTONIC_HR 5 /usr/include/linux/time.h:#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC) /usr/include/linux/time.h:#define CLOCKS_MONO CLOCK_MONOTONIC /usr/include/linux/time.h:#define CLOCK_MONOTONIC 1 # find /usr/include -type f | sort | xargs egrep -l CLOCK_MONOTONIC | sort /usr/include/bits/time.h /usr/include/diet/time.h /usr/include/linux/time.h # dpkg -S usr/include/bits/time.h libc6-dev: /usr/include/bits/time.h # dpkg -S usr/include/diet/time.h dietlibc-dev: /usr/include/diet/time.h # dpkg -S usr/include/linux/time.h linux-kernel-headers: /usr/include/linux/time.h uclibc-0.9.28 supports it but uclibc-0.9.27 doesn't. Cheers, -- Cristian From harald-tuxbox at arcor.de Sun Jul 1 19:07:32 2007 From: harald-tuxbox at arcor.de (=?iso-8859-1?Q?Harald_K=FCthe?=) Date: Sun, 1 Jul 2007 21:07:32 +0200 Subject: [Bug] test applet does not work as before Message-ID: <001001c7bc15$a64f52e0$0ac810ac@houdinineu> Hello list, we discovered that the busybox 1.6.0 test applet does not behave as before (and as e.g. a debian system) Debian 3.1: if [ ! "a" = "a" ]; then echo "unequal"; else echo "equal"; fi equal busybox-1.5.1 / # if /bin/busybox-1.5.1 [ ! "a" = "a" ]; then echo "unequal"; else echo "equal"; fi equal BusyBox v1.6.0 (2007-06-24 23:06:12 CEST) Built-in shell (ash): / # if [ ! "a" = "a" ]; then echo "unequal"; else echo "equal"; fi unequal Regards Harald From harald-tuxbox at arcor.de Sun Jul 1 19:25:45 2007 From: harald-tuxbox at arcor.de (=?iso-8859-1?Q?Harald_K=FCthe?=) Date: Sun, 1 Jul 2007 21:25:45 +0200 Subject: [Bug?] init.c: problems if kernel gets console=null via cmdline Message-ID: <001101c7bc15$a6f3d040$0ac810ac@houdinineu> Hello list, we have problems with the recent versions of busybox (1.5 and 1.6) when we start our kernel (2.4.34) without console. Some programs do not start e.g. samba server. When we link init to an older version of busybox thing get working. Debugging is difficult because the problem does not exist in a strace/gdb environement. It seems to be ok if I hack console_init() that it uses /dev/null as the console. Any help / direction is appreciated. Regards Harald From vda.linux at googlemail.com Sun Jul 1 19:32:31 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 21:32:31 +0200 Subject: [Bug?] init.c: problems if kernel gets console=null via cmdline In-Reply-To: <001101c7bc15$a6f3d040$0ac810ac@houdinineu> References: <001101c7bc15$a6f3d040$0ac810ac@houdinineu> Message-ID: <200707012132.32011.vda.linux@googlemail.com> On Sunday 01 July 2007 21:25, Harald K?the wrote: > Hello list, > > we have problems with the recent versions of busybox (1.5 and 1.6) when we start our kernel (2.4.34) without console. > Some programs do not start e.g. samba server. > When we link init to an older version of busybox thing get working. > Debugging is difficult because the problem does not exist in a strace/gdb environement. > It seems to be ok if I hack console_init() that it uses /dev/null as the console. > > Any help / direction is appreciated. Try this: in init.c, add "else" clause as shown below: static void console_init(void) { struct serial_struct sr; char *s; s = getenv("CONSOLE"); if (!s) s = getenv("console"); if (s) { int fd = open(s, O_RDWR | O_NONBLOCK | O_NOCTTY); if (fd >= 0) { dup2(fd, 0); dup2(fd, 1); dup2(fd, 2); while (fd > 2) close(fd--); } messageD(L_LOG, "console='%s'", s); + } else { + /* Make sure fd 0,1,2 are not closed */ + bb_sanitize_stdio(); } If it helps, I will add it in 1.6.2. -- vda From vda.linux at googlemail.com Sun Jul 1 19:36:57 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 21:36:57 +0200 Subject: CLOCK_MONOTONIC In-Reply-To: <0707012057510.21467@somehost> References: <0707012057510.21467@somehost> Message-ID: <200707012136.57827.vda.linux@googlemail.com> Hi Cristian, On Sunday 01 July 2007 21:12, Cristian Ionescu-Idbohrn wrote: > config MONOTONIC_SYSCALL > bool "Use clock_gettime(CLOCK_MONOTONIC) syscall" > default y > help > Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring > time intervals (time, ping, traceroute etc need this). > Probably requires Linux 2.6+. If not selected, gettimeofday > will be used instead (which gives wrong results if date/time > is reset). > > Looks like both linux and libc are involved. On my debian unstable box: > > # find /usr/include -type f | sort | xargs egrep CLOCK_MONOTONIC | sort > /usr/include/bits/time.h:# define CLOCK_MONOTONIC 1 > /usr/include/diet/time.h:#define CLOCK_MONOTONIC 1 > /usr/include/diet/time.h:#define CLOCK_MONOTONIC_HR 5 > /usr/include/linux/time.h:#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC) > /usr/include/linux/time.h:#define CLOCKS_MONO CLOCK_MONOTONIC > /usr/include/linux/time.h:#define CLOCK_MONOTONIC 1 > > # find /usr/include -type f | sort | xargs egrep -l CLOCK_MONOTONIC | sort > /usr/include/bits/time.h > /usr/include/diet/time.h > /usr/include/linux/time.h > > # dpkg -S usr/include/bits/time.h > libc6-dev: /usr/include/bits/time.h > > # dpkg -S usr/include/diet/time.h > dietlibc-dev: /usr/include/diet/time.h > > # dpkg -S usr/include/linux/time.h > linux-kernel-headers: /usr/include/linux/time.h > > uclibc-0.9.28 supports it but uclibc-0.9.27 doesn't. Looks like a set of purely informative statements to me. Can you explain what do you proposing / complaining about / whatever? -- vda From cristian.ionescu-idbohrn at axis.com Sun Jul 1 19:44:00 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Sun, 1 Jul 2007 21:44:00 +0200 (CEST) Subject: CLOCK_MONOTONIC In-Reply-To: <200707012136.57827.vda.linux@googlemail.com> References: <0707012057510.21467@somehost> <200707012136.57827.vda.linux@googlemail.com> Message-ID: <0707012139150.21467@somehost> On Sun, 1 Jul 2007, Denis Vlasenko wrote: > Hi Cristian, Denis, > On Sunday 01 July 2007 21:12, Cristian Ionescu-Idbohrn wrote: > > config MONOTONIC_SYSCALL > > bool "Use clock_gettime(CLOCK_MONOTONIC) syscall" > > default y > > help > > Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring > > time intervals (time, ping, traceroute etc need this). > > Probably requires Linux 2.6+. If not selected, gettimeofday > > will be used instead (which gives wrong results if date/time > > is reset). > > > > Looks like both linux and libc are involved. On my debian unstable box: > > > > # find /usr/include -type f | sort | xargs egrep CLOCK_MONOTONIC | sort > > /usr/include/bits/time.h:# define CLOCK_MONOTONIC 1 > > /usr/include/diet/time.h:#define CLOCK_MONOTONIC 1 > > /usr/include/diet/time.h:#define CLOCK_MONOTONIC_HR 5 > > /usr/include/linux/time.h:#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC) > > /usr/include/linux/time.h:#define CLOCKS_MONO CLOCK_MONOTONIC > > /usr/include/linux/time.h:#define CLOCK_MONOTONIC 1 > > > > # find /usr/include -type f | sort | xargs egrep -l CLOCK_MONOTONIC | sort > > /usr/include/bits/time.h > > /usr/include/diet/time.h > > /usr/include/linux/time.h > > > > # dpkg -S usr/include/bits/time.h > > libc6-dev: /usr/include/bits/time.h > > > > # dpkg -S usr/include/diet/time.h > > dietlibc-dev: /usr/include/diet/time.h > > > > # dpkg -S usr/include/linux/time.h > > linux-kernel-headers: /usr/include/linux/time.h > > > > uclibc-0.9.28 supports it but uclibc-0.9.27 doesn't. > > Looks like a set of purely informative statements to me. Yes. Make the question: why does this bite me? obsolete. > Can you explain what do you proposing / complaining about / whatever? See above. Cheers, -- Cristian From vda.linux at googlemail.com Sun Jul 1 19:50:57 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 1 Jul 2007 21:50:57 +0200 Subject: [Bug] test applet does not work as before In-Reply-To: <001001c7bc15$a64f52e0$0ac810ac@houdinineu> References: <001001c7bc15$a64f52e0$0ac810ac@houdinineu> Message-ID: <200707012150.57493.vda.linux@googlemail.com> On Sunday 01 July 2007 21:07, Harald K?the wrote: > Hello list, > > we discovered that the busybox 1.6.0 test applet does not behave as before (and as e.g. a debian system) > > Debian 3.1: > if [ ! "a" = "a" ]; then echo "unequal"; else echo "equal"; fi > equal > > busybox-1.5.1 > / # if /bin/busybox-1.5.1 [ ! "a" = "a" ]; then echo "unequal"; else echo "equal"; fi > equal > > BusyBox v1.6.0 (2007-06-24 23:06:12 CEST) Built-in shell (ash): > / # if [ ! "a" = "a" ]; then echo "unequal"; else echo "equal"; fi > unequal Fixed in 1.6.1: # /usr/srcdevel/bbox/fix161/t/busybox-1.6.1/busybox ash /.1/usr/srcdevel/bbox/fix161/t/busybox-1.6.1 # if [ ! "a" = "a" ]; then echo "unequal"; else echo "equal"; fi equal -- vda From mats at blue2net.com Sun Jul 1 19:56:04 2007 From: mats at blue2net.com (Mats Erik Andersson) Date: Sun, 01 Jul 2007 21:56:04 +0200 Subject: Was: On lease/pid-file for udhcpd/c In-Reply-To: <200707011841.21054.vda.linux@googlemail.com> References: <1183144975.14905.41.camel@Blue2net-mats.bellman.mea> <200707011654.45098.vda.linux@googlemail.com> <200707011841.21054.vda.linux@googlemail.com> Message-ID: <1183319764.3981.6.camel@Blue2net-mats.bellman.mea> s?n 2007-07-01 klockan 18:41 +0200 skrev Denis Vlasenko: > BTW, udhcp code needs more love, that's for sure. > Gauntlet and challange taken! All the more since I will depend on udhcpd and udhcpc professionally, but I grant no fixed time span for my future patches, nor will I feel offended, should someone else beat me in the race. Best regards, Mats E A From farmatito at tiscali.it Sun Jul 1 20:13:57 2007 From: farmatito at tiscali.it (Tito) Date: Sun, 1 Jul 2007 22:13:57 +0200 Subject: [PATCH] more devfsd clean up and size reduction In-Reply-To: <200707012007.51853.vda.linux@googlemail.com> References: <200706301416.33468.farmatito@tiscali.it> <200707012007.51853.vda.linux@googlemail.com> Message-ID: <200707012213.57805.farmatito@tiscali.it> On Sunday 01 July 2007 20:07:51 Denis Vlasenko wrote: > On Saturday 30 June 2007 14:16, Tito wrote: > > Hi, > > as nobody complained about my previous devfsd patch > > (....i presume because nobody is using it ;-) ) > > here is one more round > > of size reduction and code clean style clean up. > > This patch removes the functions > > msg_logger, msg_logger_and_die, fork_and_execute > > and uses libbb stuff instead. > > > > Bloat-o-meter says: > > > > root at localhost:~/Desktop/busybox# scripts/bloat-o-meter busybox_old busybox_unstripped > > function old new delta > > expand_variable 756 759 +3 > > get_variable 259 257 -2 > > get_uid_gid 122 120 -2 > > do_ioctl_and_die 27 25 -2 > > st_expr_expand 488 485 -3 > > signal_handler 94 91 -3 > > devfsd_main 842 833 -9 > > service_name 2444 2433 -11 > > read_config_file 1119 1098 -21 > > msg_logger_and_die 31 - -31 > > .rodata 125143 125111 -32 > > msg_logger 88 - -88 > > fork_and_execute 95 - -95 > > ------------------------------------------------------------------------------ > > (add/remove: 0/3 grow/shrink: 1/9 up/down: 3/-299) Total: -296 bytes > > > > BE WARNED THAT THIS IS ONLY COMPILE TESTED!!! > > > > If there are some volunteers for testing it ..... > > > > Denis could you please take a look at my use > > of spawn, xspawn, wait4pid and bb_daemonize_or_rexec > > as I never used them before and i'm not quite sure > > if i've done things right............. > > and apply the patch if you like it. > > Looks like you should indeed use fopen, not xfopen here. > You test it for NULL, and do not seem to exit if it fails: Hi, i see, will fix it. > - if ((fp = fopen(path, "r")) != NULL) { > + if ((fp = xfopen(path, "r")) != NULL) { > while (fgets(buf, STRING_LENGTH, fp) != NULL) { > /* Skip whitespace */ > - for (line = buf; isspace(*line); ++line) > - /*VOID*/; > + line = buf; > + line = skip_whitespace(line); > if (line[0] == '\0' || line[0] == '#') > continue; > process_config_line(line, event_mask); > } > fclose(fp); > - } else { > - goto read_config_file_err; > } > } else { > -read_config_file_err: > - if (optional == 0 && errno == ENOENT) > - msg_logger_and_die(LOG_ERR, "read config file: %s: %m", path); > + if (optional == 0 && errno == ENOENT) > + error_logger_and_die(LOG_ERR, "read config file: %s", path); > } > } /* End Function read_config_file */ > > > Here you should pass argv, not NULL, to 2nd parameter of bb_daemonize_or_rexec: I suspected that but was lost in the define forest of this code... > - fork_and_execute(DIE, NULL, NULL); > - setsid(); /* Prevent hangups and become pgrp leader */ > + bb_daemonize_or_rexec(0, NULL); > > It basically will pass argv back to devfsd_main() in re-executed child > (If you run on NOMMU CPU. On MMU, it simply daemonize and ignore argv). > > > Looks right: > > - fork_and_execute(NO_DIE, argv[0], argv); > + wait4pid(spawn(argv)); > > > > > I like devfsd.c :) Look at this beauty: :-) this is my personal creation........did it when i was young... i planned to substitute it with bb_simplify_path, will add it to the improved patch (this saves about 40b), don't ask me why i put it there....I'm sure there was some reason... but I can't remember it.... > /* strip last / from mount point, so we don't need to check for it later */ > while (argv[1][1] != '\0' && argv[1][strlen(argv[1]) - 1] == '/') > argv[1][strlen(argv[1]) - 1] = '\0'; > > -- > vda > Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: devfsd04.patch Type: text/x-diff Size: 13066 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070701/d204c480/attachment-0002.bin From farmatito at tiscali.it Sun Jul 1 20:40:10 2007 From: farmatito at tiscali.it (Tito) Date: Sun, 1 Jul 2007 22:40:10 +0200 Subject: [PATCH] more devfsd clean up and size reduction In-Reply-To: <200707012007.51853.vda.linux@googlemail.com> References: <200706301416.33468.farmatito@tiscali.it> <200707012007.51853.vda.linux@googlemail.com> Message-ID: <200707012240.10911.farmatito@tiscali.it> On Sunday 01 July 2007 20:07:51 you wrote: > On Saturday 30 June 2007 14:16, Tito wrote: Hi, please use this patch 05 as the previous has a duplicated comment line. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: devfsd05.patch Type: text/x-diff Size: 13037 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070701/c73fd388/attachment-0002.bin From vda.linux at googlemail.com Sun Jul 1 22:11:31 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 2 Jul 2007 00:11:31 +0200 Subject: Was: On lease/pid-file for udhcpd/c In-Reply-To: <1183319764.3981.6.camel@Blue2net-mats.bellman.mea> References: <1183144975.14905.41.camel@Blue2net-mats.bellman.mea> <200707011841.21054.vda.linux@googlemail.com> <1183319764.3981.6.camel@Blue2net-mats.bellman.mea> Message-ID: <200707020011.31781.vda.linux@googlemail.com> On Sunday 01 July 2007 21:56, Mats Erik Andersson wrote: > s?n 2007-07-01 klockan 18:41 +0200 skrev Denis Vlasenko: > > > BTW, udhcp code needs more love, that's for sure. > > > > Gauntlet and challange taken! All the more since I will > depend on udhcpd and udhcpc professionally, but I grant > no fixed time span for my future patches, nor will I > feel offended, should someone else beat me in the race. I tried to address some of those in recent commits. Returning to pidfile problem... where it happens? -- vda From vda.linux at googlemail.com Sun Jul 1 22:15:31 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 2 Jul 2007 00:15:31 +0200 Subject: Busybox & memory In-Reply-To: References: <001701c7b42d$6a28b850$c814a8c0@IPAQ> <200706212308.56599.vda.linux@googlemail.com> Message-ID: <200707020015.31773.vda.linux@googlemail.com> On Friday 29 June 2007 14:45, Alex Kums wrote: > Thu, 21 Jun 2007 23:08:56 +0200, Denis Vlasenko > ?????(?): > > Hi. > > >>Of course, if your particular NOMMU arch cannot share text/rodata section > of several instances of running executables, then you have to split > busybox to avoid having duplicate code loaded. > > With 'ps' (VSZ section) I found that each instance of busybox - syslogd, > crond, inetd eat ~2Mb of memory. Does it mean that my arch (btw, ARM CPU VSZ shows total virtual memory use, without shared/private memory stats. I use pmap (or cat /proc/PID/maps) in order to see more detailed picture. Can you show "cat /proc/PID/maps" from your ARM box? BTW, which bbox version is that? > at91rm9200) doesn't support things you said, and I should split busybox > into small parts? Honestly, I don't know about at91rm9200. > > BTW, what about the feature 'Split busybox into standalone programs' in > config? I'm not sure whether it exists/works :-/ -- vda From vda.linux at googlemail.com Sun Jul 1 22:23:22 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 2 Jul 2007 00:23:22 +0200 Subject: [PATCH] more devfsd clean up and size reduction In-Reply-To: <200707012240.10911.farmatito@tiscali.it> References: <200706301416.33468.farmatito@tiscali.it> <200707012007.51853.vda.linux@googlemail.com> <200707012240.10911.farmatito@tiscali.it> Message-ID: <200707020023.22219.vda.linux@googlemail.com> On Sunday 01 July 2007 22:40, Tito wrote: > On Sunday 01 July 2007 20:07:51 you wrote: > > On Saturday 30 June 2007 14:16, Tito wrote: > Hi, > please use this patch 05 as the previous has a duplicated comment line. Applied, thanks. also did s/do_ioctl_and_die/do_ioctl_or_die/g, as it doesnt ALWAYS die, it dies only on error. -- vda From ynakam at hitachisoft.jp Mon Jul 2 05:29:59 2007 From: ynakam at hitachisoft.jp (Yuichi Nakamura) Date: Mon, 02 Jul 2007 14:29:59 +0900 Subject: [patch]setfiles/restorecon applet Message-ID: <20070702142205.3CC1.YNAKAM@hitachisoft.jp> Hi. I would like to submit setfiles/restorecon applet. setfiles and restorecon are SELinux commands that label files according to configuration file (in configuration file, relationship between file and label is described). These applets are very important for SELinux enabled system. Please review and consider merging this patch. -- Yuichi Nakamura Hitachi Software Engineering Co., Ltd. Japan SELinux Users Group(JSELUG): http://www.selinux.gr.jp/ SELinux Policy Editor: http://seedit.sourceforge.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: setfiles_20070627.patch Type: application/octet-stream Size: 22789 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070702/8455806f/attachment-0002.obj From rep.dot.nop at gmail.com Mon Jul 2 08:19:03 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Mon, 2 Jul 2007 10:19:03 +0200 Subject: Is there a way to /* silence gcc */? In-Reply-To: <0707012033000.21467@somehost> References: <0707011916350.21467@somehost> <200707012022.05877.vda.linux@googlemail.com> <0707012033000.21467@somehost> Message-ID: <20070702081903.GA4937@aon.at> On Sun, Jul 01, 2007 at 08:36:41PM +0200, Cristian Ionescu-Idbohrn wrote: >On Sun, 1 Jul 2007, Denis Vlasenko wrote: > >> On Sunday 01 July 2007 19:25, Cristian Ionescu-Idbohrn wrote: >> > findutils/find.c: In function `parse_params': >> > findutils/find.c:512: warning: no previous prototype for `alloc_action' >> >> I think it's possible only thru gcc bugzilla. > >Let's hope so. > >> Or maybe gcc 4.2 will have it fixed? > >Unfortunately not yet, AFAICS: > ># /usr/bin/gcc-4.2 --version >gcc-4.2 (GCC) 4.2.1 20070627 (prerelease) (Debian 4.2-20070627-1) Either improve gcc or fix find to be C99 compliant (nested functions are prohibited in C99, this is more or less a "bug" in find.c). From mats at blue2net.com Mon Jul 2 09:49:43 2007 From: mats at blue2net.com (Mats Erik Andersson) Date: Mon, 02 Jul 2007 11:49:43 +0200 Subject: Closing: On lease/pid-file for udhcpd/c In-Reply-To: <200707020011.31781.vda.linux@googlemail.com> References: <1183144975.14905.41.camel@Blue2net-mats.bellman.mea> <200707011841.21054.vda.linux@googlemail.com> <1183319764.3981.6.camel@Blue2net-mats.bellman.mea> <200707020011.31781.vda.linux@googlemail.com> Message-ID: <1183369784.4000.15.camel@Blue2net-mats.bellman.mea> m?n 2007-07-02 klockan 00:11 +0200 skrev Denis Vlasenko: > On Sunday 01 July 2007 21:56, Mats Erik Andersson wrote: > > s?n 2007-07-01 klockan 18:41 +0200 skrev Denis Vlasenko: > > > > > BTW, udhcp code needs more love, that's for sure. > > > > > > > Gauntlet and challange taken! All the more since I will > > > I tried to address some of those in recent commits. > > Returning to pidfile problem... where it happens? > -- > vda I will work on a pidfile patch this afternoon, since I for various reasons had to build a new buildroot instance on which to try the code alterations. On the other hand, a quick check concerning the type in_addr demonstrates that the headers of glibc 2.3.6 as well as uClibc 0.28.3 uses uint32_t for in_addr, it is only the manpages that are seriously outdated. Another quick glance in the udhcp-directory of Busybox-svn indicates that it is only dhcpc.h and dhcpc.c that are suffering from the use of 'long' for 'uint32_t' in ip-addresses. I will begin to review and alter those parts of the code and produce a patch to correct them. Let me declare this mail thread for closed. New subject next time. Best regards, Mats E A From dieter at able.be Mon Jul 2 10:32:10 2007 From: dieter at able.be (dieter) Date: Mon, 02 Jul 2007 12:32:10 +0200 Subject: ping command line parse bug Message-ID: <1183372330.4890.49.camel@inflamm.able.be> Hi, There seems to be a bug in ping_main when the ipv6 code is enabled. No matter what erguments, it prints 'bad address 'qing'. :) Patch below. Kind regards, dieter --- ./busybox-1.6.0/networking/ping.c.orig 2007-07-02 10:17:21.000000000 +0000 +++ ./busybox-1.6.0/networking/ping.c 2007-07-02 10:17:57.000000000 +0000 @@ -179,7 +179,7 @@ len_and_sockaddr *lsa; #if ENABLE_PING6 sa_family_t af = AF_UNSPEC; - while (++argv[0][0] == '-') { + while ((++argv)[0] && argv[0][0] == '-') { if (argv[0][1] == '4') { af = AF_INET; continue; -- NEW on aXs GUARD: SSL VPN !! (contact your reseller for more info) --------------------------------------------------- aXs GUARD has completed security and anti-virus checks on this e-mail (http://www.axsguard.com) --------------------------------------------------- Able NV: ond.nr 0457.938.087 RPR Mechelen From natanael.copa at gmail.com Mon Jul 2 14:53:08 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Mon, 02 Jul 2007 14:53:08 +0000 Subject: Aw: Re: mdev woes In-Reply-To: <200706281540.35506.vapier@gentoo.org> References: <13080109.1183047315105.JavaMail.ngmail@webmail15> <200706281304.07005.vapier@gentoo.org> <46840974.40208@arcor.de> <200706281540.35506.vapier@gentoo.org> Message-ID: <1183387988.30435.12.camel@localhost> On Thu, 2007-06-28 at 15:40 -0400, Mike Frysinger wrote: > On Thursday 28 June 2007, Jason Curl wrote: > > mdev > > already knows about the device, so a symlink option like udev has would > > save flash space overall (less scripts, faster and as an option in the > > menuconfig would mean only those who want it would use it). > > there is a patch on the mailing list to add this ... i'm debating adding it as > the purpose of mdev is to provide the bare min required features; if you need > more, go use udev I vote for this feature. I use a script to create links where I want them but its hackish and ugly. Natanael Copa From mats at blue2net.com Mon Jul 2 14:54:11 2007 From: mats at blue2net.com (Mats Erik Andersson) Date: Mon, 02 Jul 2007 16:54:11 +0200 Subject: [PATCH-suggestion] The pidfile problem of udhcpc Message-ID: <1183388051.4000.45.camel@Blue2net-mats.bellman.mea> Hi again, I have analyzed and located the problem with udhcpc for todays snapshot of Busybox when one uses # CONFIG_FEATURE_PIDFILE is not set Attached are three files: utsaga_ifdown.txt is a manual recovery and error listing ifupdown_without_pidfile.diff is a functional patch, see below bb_udhcpc_script_error_handling.diff mends a related problem My original issue was that when ENABLE_FEATURE_PIDFILE=0 causes an error ifdown eth0 when eth0 is dhcp-controled --> udhcpc --> ifupdown --> execute --> --> cat /var/run/udhcpc.eth0.pid has an empty argument ----> kill udhcpc fails and 'ifdown eth0' fails midway The suggested patch makes one bad choice out of three: identify process udhcpc using either of pidof/killall/killall5 where I went for pidof. All three function calls have a configuration option of their own. Least bad solution? Is it worth the risk to scrap 'execute()' and go for exec() directly? You decide! I have found the culprit and provided a starting point. Lastly, that manual recovery displays an error message for 'route', which happens to originate in a script 'default.script' for udhcpc, but which is not supplied by Busybox. Instead, it comes from Buildroot. The corresponding patch is my third attached file. It would presumably look more trustworthy if such a patch would originate from a Busybox maintainer, so feel free to forward it to Buildroot, since it indeed does remove said error message. I have tested it on x86-images. The error was present for a long time on my small systems, long long before FEATURE_PIDFILE entered the picture. Best regards, Mats E A -------------- next part -------------- # ifconfig eth0 down # ifdown eth0 cat: can't open '/var/run/udhcpc.eth0.pid': No such file or directory You need to specify whom to kill # ifup eth0 udhcpc (v1.7.0.svn) started eth0: Setting 3c5x9/3c5x9B half-duplex mode if_port: 0, sw_info: 1331 eth0: Setting Rx mode to 0 addresses. eth0: Setting Rx mode to 1 addresses. Sending discover... Sending discover... Sending select for 192.168.7.15... Lease of 192.168.7.15 obtained, lease time 21600 deleting routers route: SIOC[ADD|DEL]RT: No such process adding dns 192.168.7.253 # ls /tmp/ dropbear.pid lastlog messages sdp ifstate log resolv.conf # ifdown eth0 cat: can't open '/var/run/udhcpc.eth0.pid': No such file or directory You need to specify whom to kill # ps 258 root 688 S /sbin/getty -L ttyS1 115200 vt100 288 root 700 S udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0 298 root 688 R ps # ls /var/run/ dropbear.pid lastlog messages sdp ifstate log resolv.conf # echo 288 > /var/run/udhcpc.eth0.pid # ifdown eth0 ifdown: interface eth0 not configured # -------------- next part -------------- A non-text attachment was scrubbed... Name: ifupdown_without_pidfile.diff Type: text/x-patch Size: 669 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070702/4c46a018/attachment-0004.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_udhcpc_script_error_handling.diff Type: text/x-patch Size: 1944 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070702/4c46a018/attachment-0005.bin From miroslaw.dach at psi.ch Mon Jul 2 15:44:00 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Mon, 2 Jul 2007 17:44:00 +0200 (CEST) Subject: screen manager terminal emulation In-Reply-To: Message-ID: Hi Hinko, I went little-bit further with screen and curses: I have recompiled the ncurses library version 5.4 with options which I have figured out from ELDK4.1: ./configure --host=i386-linux --with-normal --with-shared --without-debug --without-profile --with-cxx --without-ada --enable-sigwinch --enable-hard-tabs '--with-ospeed=unsigned int' '--with-build-cc=/usr/bin/gcc -B/usr/bin/' --enable-termcap --enable-termcap --with-shared CC=powerpc-405-linux-gnu-gcc CXX=powerpc-405-linux-gnu-g++ Right now when I select TERM=vt100 I am able to start my server: ./screen -t MYSERVER -d -m ./myServer I am also able to attache to the server with: screen -r Unfortunately I am able to reattach to the server only twice. The third time when I attache to the server the screen prints the text as it was a wrong definition of characters per line. When I detach from screen and attache again with screen -r I get a message: You can't run screen on a hardcopy terminal. When I try screen -r few time more I get a message: Cannot find termcap entry for 'vt100'. To sum up all above the situation is like that: ./screen -t MYSERVER -d -m ./myServer [OK] screen -r [OK] CTRL-A D screen -r [OK] CTRL-A D screen -r [wrong nr of char per line] CTRL-A D screen -r You can't run screen on a hardcopy terminal. screen -r You can't run screen on a hardcopy terminal. screen -r Cannot find termcap entry for 'vt100' screen -r Cannot find termcap entry for 'vt100' screen -r Cannot find termcap entry for 'vt100' screen -r Cannot find termcap entry for 'vt100' screen -r Cannot find termcap entry for 'vt100' Do you have any idea what could be wrong? Best Regards Mierk From vda.linux at googlemail.com Mon Jul 2 16:15:10 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 2 Jul 2007 18:15:10 +0200 Subject: ping command line parse bug In-Reply-To: <1183372330.4890.49.camel@inflamm.able.be> References: <1183372330.4890.49.camel@inflamm.able.be> Message-ID: <1158166a0707020915t73e26c7dieefea7d2b083f4f4@mail.gmail.com> On 7/2/07, dieter wrote: > > Hi, > > There seems to be a bug in ping_main when the ipv6 code is enabled. No > matter what erguments, it prints 'bad address 'qing'. :) > Patch below. Applied to svn, thanks! -- vda From Jlau at extremenetworks.com Mon Jul 2 18:09:53 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Mon, 2 Jul 2007 11:09:53 -0700 Subject: make distclean Message-ID: <888459D4AEE6464381B30398101F42F8043FC2ED@sc-msexch-06.extremenetworks.com> When I was building Busybox 1.0, I always did a "make distclean" followed by "make". Do I need to do "make distclean" on the Busybox 1.6? I found out that on Busybox 1.6, the "make distclean" step remove the busbyox/scripts/kconfig/zconfig.tab.c (and other files too). And this caused the next "make" step to complain about zconf.tab.c: No such file or directory. Thanks for any help here. -Joe From farmatito at tiscali.it Mon Jul 2 22:08:25 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 3 Jul 2007 00:08:25 +0200 Subject: [PATCH & RFC] avoid libbb/correct_password.c to disclose info about system Message-ID: <200707030008.26106.farmatito@tiscali.it> Hi, I noticed that our password checking routine in correct_password.c behaves differently than real login app. In case that support for shadow passwords is enabled and /etc/shadow is missing it complains with an error message: "no valid shadow password, checking ordinary one" thus disclosing information about the state of the system. I think it should instead fake an incorrect login. A patch is attached, comments and critics are welcome. This is only compile tested. Ciao, Tito BTW.: scripts/bloat-o-meter busybox_old busybox_unstripped function old new delta correct_password 231 225 -6 .rodata 125111 125063 -48 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-54) Total: -54 bytes -------------- next part -------------- A non-text attachment was scrubbed... Name: correct_password.patch Type: text/x-diff Size: 688 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070703/e71eee7e/attachment-0002.bin From Jlau at extremenetworks.com Mon Jul 2 22:32:50 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Mon, 2 Jul 2007 15:32:50 -0700 Subject: make distclean Message-ID: <888459D4AEE6464381B30398101F42F8043FC2F4@sc-msexch-06.extremenetworks.com> The BB 1.6 mount command fail to a NFS mount: mount -t nfs -o nolock,rsize=4096,wsize=4096,udp $boot_exos_nfs /exos if [ $? -ne 0 ] then echo "***** ERROR: could not mount /exos nfs partition from $boot_exos_nfs" fi Is this a known problem on BB 1.6? Do we have a fix for it? Thanks. -Joe > -----Original Message----- > From: Joe Lau > Sent: Monday, July 02, 2007 11:10 AM > To: 'busybox at busybox.net' > Cc: Joe Lau > Subject: make distclean > > > When I was building Busybox 1.0, I always did a "make > distclean" followed by "make". > Do I need to do "make distclean" on the Busybox 1.6? > I found out that on Busybox 1.6, the "make distclean" step > remove the busbyox/scripts/kconfig/zconfig.tab.c (and other files too). > And this caused the next "make" step to complain about > zconf.tab.c: No such file or directory. > > Thanks for any help here. > > -Joe From vda.linux at googlemail.com Tue Jul 3 05:19:30 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 3 Jul 2007 07:19:30 +0200 Subject: make distclean In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC2F4@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC2F4@sc-msexch-06.extremenetworks.com> Message-ID: <200707030719.30249.vda.linux@googlemail.com> On Tuesday 03 July 2007 00:32, Joe Lau wrote: > The BB 1.6 mount command fail to a NFS mount: > > mount -t nfs -o nolock,rsize=4096,wsize=4096,udp $boot_exos_nfs /exos > if [ $? -ne 0 ] > then > echo "***** ERROR: could not mount /exos nfs partition from $boot_exos_nfs" > fi What does it say? Also do strace -o mount.log mount -t nfs.... and send mount.log to the mailing list. > Is this a known problem on BB 1.6? Well, mount was completely rewritten, so it can have regressions. I need a bit more detailed bug report... > > When I was building Busybox 1.0, I always did a "make > > distclean" followed by "make". I think "make clean" should be enough. "make mrproper" will also delete .config, if you need this kind of total cleanup. -- vda From vda.linux at googlemail.com Tue Jul 3 06:11:42 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 3 Jul 2007 08:11:42 +0200 Subject: [PATCH & RFC] avoid libbb/correct_password.c to disclose info about system In-Reply-To: <200707030008.26106.farmatito@tiscali.it> References: <200707030008.26106.farmatito@tiscali.it> Message-ID: <200707030811.42870.vda.linux@googlemail.com> On Tuesday 03 July 2007 00:08, Tito wrote: > Hi, > I noticed that our password checking routine in correct_password.c > behaves differently than real login app. > In case that support for shadow passwords is enabled and > /etc/shadow is missing it complains with an error message: > > "no valid shadow password, checking ordinary one" > > thus disclosing information about the state of the system. > I think it should instead fake an incorrect login. > A patch is attached, comments and critics are welcome. With this patch, you *require* admin to keep passwords in /etc/shadow. I prefer when admin *has an option* to have /etc/shadow, but [s]he can still have them in /etc/passwd instead. I will do this: #if ENABLE_FEATURE_SHADOWPASSWDS if ((correct[0] == 'x' || correct[0] == '*') && !correct[1]) { if (getspnam_r(pw->pw_name, &spw, buffer, sizeof(buffer), &result) == 0) correct = spw.sp_pwdp; /* else: no valid shadow password, checking ordinary one */ } #endif Is it ok with you? -- vda From farmatito at tiscali.it Tue Jul 3 06:41:35 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 3 Jul 2007 08:41:35 +0200 Subject: [PATCH & RFC] avoid libbb/correct_password.c to disclose info about system In-Reply-To: <200707030811.42870.vda.linux@googlemail.com> References: <200707030008.26106.farmatito@tiscali.it> <200707030811.42870.vda.linux@googlemail.com> Message-ID: <200707030841.35771.farmatito@tiscali.it> On Tuesday 03 July 2007 08:11:42 Denis Vlasenko wrote: > On Tuesday 03 July 2007 00:08, Tito wrote: > > Hi, > > I noticed that our password checking routine in correct_password.c > > behaves differently than real login app. > > In case that support for shadow passwords is enabled and > > /etc/shadow is missing it complains with an error message: > > > > "no valid shadow password, checking ordinary one" > > > > thus disclosing information about the state of the system. > > I think it should instead fake an incorrect login. > > A patch is attached, comments and critics are welcome. > > With this patch, you *require* admin to keep passwords in /etc/shadow. Why? +???????if (LONE_CHAR(pw->pw_passwd, 'x') || LONE_CHAR(pw->pw_passwd, '*')) +???????????????correct = (getspnam_r(pw->pw_name, &spw, buffer, sizeof(buffer), &result)) ? "aa" : spw.sp_pwdp; It's the admin himself that is saying through 'x' or '*' that he wants to use shadow passwords. If you put a real password in pw->pw_passwd this code is not executed. > I prefer when admin *has an option* to have /etc/shadow, > but [s]he can still have them in /etc/passwd instead. > > I will do this: > > #if ENABLE_FEATURE_SHADOWPASSWDS > if ((correct[0] == 'x' || correct[0] == '*') && !correct[1]) { Adding &&!correct[1] to the check is a good idea, we should do it indipendently of this issue. > if (getspnam_r(pw->pw_name, &spw, buffer, sizeof(buffer), &result) == 0) > correct = spw.sp_pwdp; > /* else: no valid shadow password, checking ordinary one */ > } > #endif > > Is it ok with you? > -- > vda > In this way if getspnam_r fails correct will be "x" or "*" and man page says: salt is a two-character string chosen from the set [a?zA?Z0?9./]. This string is used to perturb the algorithm in one of 4096 different ways. Think this was the reason we used correct = "aa"? Ciao, Tito From vda.linux at googlemail.com Tue Jul 3 08:51:44 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 3 Jul 2007 10:51:44 +0200 Subject: [PATCH-suggestion] The pidfile problem of udhcpc In-Reply-To: <1183388051.4000.45.camel@Blue2net-mats.bellman.mea> References: <1183388051.4000.45.camel@Blue2net-mats.bellman.mea> Message-ID: <200707031051.44811.vda.linux@googlemail.com> On Monday 02 July 2007 16:54, Mats Erik Andersson wrote: > Hi again, > > I have analyzed and located the problem with udhcpc > for todays snapshot of Busybox when one uses > > # CONFIG_FEATURE_PIDFILE is not set > > Attached are three files: > > utsaga_ifdown.txt is a manual recovery and error listing > > ifupdown_without_pidfile.diff is a functional patch, see below > > bb_udhcpc_script_error_handling.diff mends a related problem > > > My original issue was that when ENABLE_FEATURE_PIDFILE=0 causes > an error > > ifdown eth0 when eth0 is dhcp-controled > --> udhcpc --> ifupdown --> execute --> > --> cat /var/run/udhcpc.eth0.pid has an empty argument > ----> kill udhcpc fails and 'ifdown eth0' fails midway So it's not a problem with udhcpd. It works perfectly fine, it just does not create pidfile. The problem is with ifupdown. The general problem with ifupdown is that it is "copulated in vertical fashion" by design. It tries to do the job of shell script in C, and this is invariably doomed to fail. You need ifup/ifdown to be adaptable by local admins, and C is an extremely poor choice for that. We are doomed to have problems with ifup/ifdown. Just look as this code: static const struct dhcp_client_t ext_dhcp_clients[] = { { "dhcpcd", "", "" }, { "dhclient", ........ }, { "pump", ........ }, { "udhcpc", ........ }, }; static int dhcp_down(struct interface_defn_t *ifd, execfn *exec) { #if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP int i ; for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) { if (exists_execable(ext_dhcp_clients[i].name)) return execute(ext_dhcp_clients[i].stopcmd, ifd, exec); } bb_error_msg("no dhcp clients found, using static interface shutdown"); return static_down(ifd, exec); #elif ENABLE_APP_UDHCPC return execute("kill " "`cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec); #else return 0; /* no dhcp support */ #endif } How the hell it is supposed to work reliably this way?? Just imagine that admin is using pump and ifup/ifdown. It works. Then, for whatever reason, admin installs dhclient, but does NOT use it. ifdown will STOP WORKING, just because it will see installed dhclient binary in e.g. /usr/bin/dhclient! Ain't it idiotic? I am sure we will fix problem with udhcpc pidfiles, one way or another. But I seriously urge people to not use ifup/ifdown. Use something less brain damaged. -- vda From wharms at bfs.de Tue Jul 3 09:26:38 2007 From: wharms at bfs.de (walter harms) Date: Tue, 03 Jul 2007 11:26:38 +0200 Subject: screen manager terminal emulation In-Reply-To: References: Message-ID: <468A164E.7010302@bfs.de> hi, from the reaction is seems clear that the init is broken somehow. Either it is not called at all or the stored structures are overwritten. ntl check where the terminfo stuff gets loaded (perhaps with strace) and print some important variables and see when/if they change. perhaps the people on the screen ml can help you better. re, wh Miroslaw Dach wrote: > Hi Hinko, > > I went little-bit further with screen and curses: > > > Unfortunately I am able to reattach to the server only twice. > The third time when I attache to the server the screen prints the text as > it was a wrong definition of characters per line. > > When I detach from screen and attache again with screen -r > I get a message: > > You can't run screen on a hardcopy terminal. > > When I try screen -r few time more I get a message: > > Cannot find termcap entry for 'vt100'. > > > To sum up all above the situation is like that: > > ./screen -t MYSERVER -d -m ./myServer [OK] > > screen -r [OK] > CTRL-A D > screen -r [OK] > CTRL-A D > screen -r [wrong nr of char per line] > CTRL-A D > screen -r > You can't run screen on a hardcopy terminal. > screen -r > You can't run screen on a hardcopy terminal. > screen -r > Cannot find termcap entry for 'vt100' > screen -r > Cannot find termcap entry for 'vt100' > screen -r > Cannot find termcap entry for 'vt100' > screen -r > Cannot find termcap entry for 'vt100' > screen -r > Cannot find termcap entry for 'vt100' > > > Do you have any idea what could be wrong? > > Best Regards > > Mierk > > > > > > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From vda.linux at googlemail.com Tue Jul 3 10:14:35 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 3 Jul 2007 12:14:35 +0200 Subject: [PATCH & RFC] avoid libbb/correct_password.c to disclose info about system In-Reply-To: <200707030841.35771.farmatito@tiscali.it> References: <200707030008.26106.farmatito@tiscali.it> <200707030811.42870.vda.linux@googlemail.com> <200707030841.35771.farmatito@tiscali.it> Message-ID: <200707031214.35583.vda.linux@googlemail.com> On Tuesday 03 July 2007 08:41, Tito wrote: > On Tuesday 03 July 2007 08:11:42 Denis Vlasenko wrote: > > On Tuesday 03 July 2007 00:08, Tito wrote: > > > Hi, > > > I noticed that our password checking routine in correct_password.c > > > behaves differently than real login app. > > > In case that support for shadow passwords is enabled and > > > /etc/shadow is missing it complains with an error message: > > > > > > "no valid shadow password, checking ordinary one" > > > > > > thus disclosing information about the state of the system. > > > I think it should instead fake an incorrect login. > > > A patch is attached, comments and critics are welcome. > > > > With this patch, you *require* admin to keep passwords in /etc/shadow. > Why? > > +???????if (LONE_CHAR(pw->pw_passwd, 'x') || LONE_CHAR(pw->pw_passwd, '*')) > +???????????????correct = (getspnam_r(pw->pw_name, &spw, buffer, sizeof(buffer), &result)) ? "aa" : spw.sp_pwdp; > > It's the admin himself that is saying through 'x' or '*' that he wants to use shadow passwords. > If you put a real password in pw->pw_passwd this code is not executed. Oops... my brainfart, you're right. Will fix in svn in a few minutes. -- vda From miroslaw.dach at psi.ch Tue Jul 3 11:19:27 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Tue, 3 Jul 2007 13:19:27 +0200 (CEST) Subject: .bashrc and ash Message-ID: Hi All, I am using ash as a shall in my busybox rootfile system. I wanted to set some environmental variables in .bashrc but it is not taken into account when logging with telnet. Best Regards Mirek ============================================================================= Miroslaw Dach (Miroslaw.Dach at psi.ch) - SLS/Controls Group PSI - Paul Scherrer Institut CH-5232 Villigen ============================================================================= From Alexander at Kriegisch.name Tue Jul 3 11:27:44 2007 From: Alexander at Kriegisch.name (Alexander Kriegisch) Date: Tue, 03 Jul 2007 13:27:44 +0200 Subject: .bashrc and ash In-Reply-To: References: Message-ID: <468A32B0.1000503@Kriegisch.name> > I am using ash as a shall in my busybox rootfile system. > I wanted to set some environmental variables in .bashrc but it is not > taken into account when logging with telnet. As the name suggests, .bashrc belongs to bash, not ash. You want to try .profile in your home directory. -- Alexander Kriegisch From miroslaw.dach at psi.ch Tue Jul 3 11:31:37 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Tue, 3 Jul 2007 13:31:37 +0200 (CEST) Subject: .bashrc and ash In-Reply-To: <468A32B0.1000503@Kriegisch.name> Message-ID: Thanks it does work fine now. Best Regards Mirek On Tue, 3 Jul 2007, Alexander Kriegisch wrote: > > I am using ash as a shall in my busybox rootfile system. > > I wanted to set some environmental variables in .bashrc but it is not > > taken into account when logging with telnet. > > As the name suggests, .bashrc belongs to bash, not ash. You want to try > .profile in your home directory. > -- > Alexander Kriegisch > -- ============================================================================= Miroslaw Dach (Miroslaw.Dach at psi.ch) - SLS/Controls Group PSI - Paul Scherrer Institut CH-5232 Villigen ============================================================================= From jfree at sovereign.org Tue Jul 3 12:59:46 2007 From: jfree at sovereign.org (Jim Freeman) Date: Tue, 3 Jul 2007 06:59:46 -0600 Subject: invoked as /bin/md5sum, yields sha1sum Message-ID: <20070703125946.GB23671@sovereign.org> Busybox 1.6.0, on powerpc: When md5sum is invoked as /bin/md5sum, it yields the 40-character sha1sum instead of the 32-character md5sum: # md5sum /etc/passwd fe611ba27d0d7d92bbef243109fed95d /etc/passwd # /bin/md5sum /etc/passwd 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd # sha1sum /etc/passwd 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd Does this happen with any other platforms? From jfree at sovereign.org Tue Jul 3 13:23:06 2007 From: jfree at sovereign.org (Jim Freeman) Date: Tue, 3 Jul 2007 07:23:06 -0600 Subject: whither 1.00's "passwd -p ..." ? Message-ID: <20070703132306.GC23671@sovereign.org> busybox 1.00 (and other versions?) had a "-p" option to allow setting a user's password bypassing the interactive mode # passwd fu Changing password for fu New password: Retype password: Password for fu changed by root vs. # passwd -p **** blip Setting password for blip Password changed. My CGI backends to do remote management on an embedded machine have been using this, but it now fails with current busybox, and no shell trickery I can conjure (echo/pipe, HERE doc ...) works, and nothing expect-ish is available to work with on the box. For now I kludge around the lack by emulating the example at http://www.unixguide.net/unix/faq/3.9.shtml (substituting "ptyget" for "pty"). Aside from the /proc/.../cmdline (and other?) security concerns (largely moot for many embedded scenarios), is there a reason this functionality has been removed? Anyone clued in to the reasoning/history of this change (didn't see anything on the lists)? Any hope for it's restoration? Thanks, ...jfree From hkhateb at hotmail.com Tue Jul 3 15:05:51 2007 From: hkhateb at hotmail.com (hamid khateb) Date: Tue, 03 Jul 2007 18:05:51 +0300 Subject: problem to build busybox in cygwin Message-ID: Hi All the version of BusyBox up to 1.3.0 accpet error when I perform ?make menuconfig? on Cygwin , and the error that I accept is : $ make menuconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/basic/split-include HOSTCC scripts/basic/docproc HOSTLD scripts/kconfig/mconf scripts/kconfig/mconf.o:mconf.c:(.text+0xf63): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x1011): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x116c): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x11a1): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x11c1): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x11f5): more undefined references to `_libintl_gettext' follow scripts/kconfig/mconf.o:mconf.c:(.text+0x19df): undefined reference to `_libintl_bindtextdomain' scripts/kconfig/mconf.o:mconf.c:(.text+0x19eb): undefined reference to `_libintl_textdomain' scripts/kconfig/mconf.o:mconf.c:(.text+0x1a37): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x1ac9): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x1b10): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x1b4b): undefined reference to `_libintl_gettext' scripts/kconfig/mconf.o:mconf.c:(.text+0x1b74): undefined reference to `_libintl_gettext' scripts/kconfig/zconf.tab.o:zconf.tab.c:(.text+0x52d7): more undefined references to `_libintl_gettext' follow collect2: ld returned 1 exit status make[1]: *** [scripts/kconfig/mconf] Error 1 make: *** [menuconfig] Error 2 so how I can solve this problem please Best Regards Hamid Khateb _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Jlau at extremenetworks.com Tue Jul 3 16:16:20 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Tue, 3 Jul 2007 09:16:20 -0700 Subject: make distclean Message-ID: <888459D4AEE6464381B30398101F42F8043FC2F7@sc-msexch-06.extremenetworks.com> OK, the NFS mount problem turned out to be a configuration issue. I did not set CONFIG_FEATURE_MOUNT_NFS. Sorry about that. So, my understanding is that I do not need to do "make distclean" in order to have a clean build of BB. Correct? Thanks! -Joe -----Original Message----- From: Denis Vlasenko [mailto:vda.linux at googlemail.com] Sent: Monday, July 02, 2007 10:20 PM To: busybox at busybox.net Cc: Joe Lau Subject: Re: make distclean On Tuesday 03 July 2007 00:32, Joe Lau wrote: > The BB 1.6 mount command fail to a NFS mount: > > mount -t nfs -o nolock,rsize=4096,wsize=4096,udp $boot_exos_nfs /exos > if [ $? -ne 0 ] > then > echo "***** ERROR: could not mount /exos nfs partition from $boot_exos_nfs" > fi What does it say? Also do strace -o mount.log mount -t nfs.... and send mount.log to the mailing list. > Is this a known problem on BB 1.6? Well, mount was completely rewritten, so it can have regressions. I need a bit more detailed bug report... > > When I was building Busybox 1.0, I always did a "make > > distclean" followed by "make". I think "make clean" should be enough. "make mrproper" will also delete .config, if you need this kind of total cleanup. -- vda From farmatito at tiscali.it Tue Jul 3 19:59:10 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 3 Jul 2007 21:59:10 +0200 Subject: problem to build busybox in cygwin In-Reply-To: References: Message-ID: <200707032159.10328.farmatito@tiscali.it> On Tuesday 03 July 2007 17:05:51 hamid khateb wrote: > > Hi > > > > All the version of BusyBox up to 1.3.0 accpet error when I perform ?make > menuconfig? on Cygwin , and the error that I accept is : > > > > $ make menuconfig > > HOSTCC scripts/basic/fixdep > > HOSTCC scripts/basic/split-include > > HOSTCC scripts/basic/docproc > > HOSTLD scripts/kconfig/mconf > > scripts/kconfig/mconf.o:mconf.c:(.text+0xf63): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x1011): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x116c): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x11a1): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x11c1): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x11f5): more undefined references to > `_libintl_gettext' follow > > scripts/kconfig/mconf.o:mconf.c:(.text+0x19df): undefined reference to > `_libintl_bindtextdomain' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x19eb): undefined reference to > `_libintl_textdomain' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x1a37): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x1ac9): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x1b10): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x1b4b): undefined reference to > `_libintl_gettext' > > scripts/kconfig/mconf.o:mconf.c:(.text+0x1b74): undefined reference to > `_libintl_gettext' > > scripts/kconfig/zconf.tab.o:zconf.tab.c:(.text+0x52d7): more undefined > references to `_libintl_gettext' follow > > collect2: ld returned 1 exit status > > make[1]: *** [scripts/kconfig/mconf] Error 1 > > make: *** [menuconfig] Error 2 > > > > so how I can solve this problem please > Maybe by installing the gettext library (runtime and dev files)? Ciao, Tito > > Best Regards > > Hamid Khateb > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > From farmatito at tiscali.it Tue Jul 3 20:09:24 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 3 Jul 2007 22:09:24 +0200 Subject: invoked as /bin/md5sum, yields sha1sum In-Reply-To: <20070703125946.GB23671@sovereign.org> References: <20070703125946.GB23671@sovereign.org> Message-ID: <200707032209.24963.farmatito@tiscali.it> On Tuesday 03 July 2007 14:59:46 Jim Freeman wrote: > > Busybox 1.6.0, on powerpc: > > When md5sum is invoked as /bin/md5sum, it yields the 40-character sha1sum > instead of the 32-character md5sum: > > # md5sum /etc/passwd > fe611ba27d0d7d92bbef243109fed95d /etc/passwd > > # /bin/md5sum /etc/passwd > 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd > > # sha1sum /etc/passwd > 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd > > Does this happen with any other platforms? > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > Please, try attached patch. --- coreutils/md5_sha1_sum.c.orig 2007-05-26 23:23:50.000000000 +0200 +++ coreutils/md5_sha1_sum.c 2007-07-03 22:06:56.000000000 +0200 @@ -84,7 +84,7 @@ uint8_t *hash_value; unsigned flags; hash_algo_t hash_algo = ENABLE_MD5SUM - ? (ENABLE_SHA1SUM ? (**argv=='m' ? HASH_MD5 : HASH_SHA1) : HASH_MD5) + ? (ENABLE_SHA1SUM ? (applet_name[0]=='m' ? HASH_MD5 : HASH_SHA1) : HASH_MD5) : HASH_SHA1; if (ENABLE_FEATURE_MD5_SHA1_SUM_CHECK) ----------------------------------------------------------------------------------------------------------------------------------- Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: md5sum.patch Type: text/x-diff Size: 445 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070703/a41401f4/attachment-0002.bin From farmatito at tiscali.it Tue Jul 3 20:17:10 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 3 Jul 2007 22:17:10 +0200 Subject: whither 1.00's "passwd -p ..." ? In-Reply-To: <20070703132306.GC23671@sovereign.org> References: <20070703132306.GC23671@sovereign.org> Message-ID: <200707032217.10838.farmatito@tiscali.it> On Tuesday 03 July 2007 15:23:06 Jim Freeman wrote: > busybox 1.00 (and other versions?) had a "-p" option to allow setting > a user's password bypassing the interactive mode > > # passwd fu > Changing password for fu > New password: > Retype password: > Password for fu changed by root > > vs. > # passwd -p **** blip > Setting password for blip > Password changed. > > > My CGI backends to do remote management on an embedded machine have > been using this, but it now fails with current busybox, and no > shell trickery I can conjure (echo/pipe, HERE doc ...) works, > and nothing expect-ish is available to work with on the box. > > For now I kludge around the lack by emulating the example at > http://www.unixguide.net/unix/faq/3.9.shtml (substituting > "ptyget" for "pty"). > > Aside from the /proc/.../cmdline (and other?) security concerns > (largely moot for many embedded scenarios), is there a reason > this functionality has been removed? > > Anyone clued in to the reasoning/history of this change (didn't see > anything on the lists)? Any hope for it's restoration? > > Thanks, > ...jfree > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > Maybe it was ripped out as it is non standard? OPTIONS The options which apply to the passwd command are: -a, --all This option can be used only with -S and causes show status for all users. -d, --delete Delete a user?s password (make it empty). This is a quick way to disable a password for an account. It will set the named account passwordless. -e, --expire Immediately expire an account?s password. This in effect can force a user to change his/her password at the user?s next login. -h, --help Display help message and exit. -i, --inactive INACTIVE This option is used to disable an account after the password has been expired for a number of days. After a user account has had an expired password for INACTIVE days, the user may no longer sign on to the account. -k, --keep-tokens Indicate password change should be performed only for expired authentication tokens (passwords). The user wishes to keep their non-expired tokens as before. -l, --lock Lock the named account. This option disables an account by changing the password to a value which matches no possible encrypted value. -m, --mindays MIN_DAYS Set the minimum number of days between password changes to MIN_DAYS. A value of zero for this field indicates that the user may change his/her password at any time. -q, --quiet Quiet mode. -r, --repository REPOSITORY change password in REPOSITORY repository -S, --status Display account status information. The status information consists of 7 fields. The first field is the user?s login name. The second field indicates if the user account is locked (L), has no password (NP), or has a usable password (P). The third field gives the date of the last password change. The next four fields are the minimum age, maximum age, warning period, and inactivity period for the password. These ages are expressed in days. -u, --unlock Unlock the named account. This option re-enables an account by changing the password back to its previous value (to value before using -l option). -w, --warndays WARN_DAYS Set the number of days of warning before a password change is required. The WARN_DAYS option is the number of days prior to the password expiring that a user will be warned that his/her password is about to expire. -x, --maxdays MAX_DAYS Set the maximum number of days a password remains valid. After MAX_DAYS, the password is required to be changed. Ciao, Tito From jfree at sovereign.org Tue Jul 3 21:46:37 2007 From: jfree at sovereign.org (Jim Freeman) Date: Tue, 3 Jul 2007 15:46:37 -0600 Subject: invoked as /bin/md5sum, yields sha1sum - fix works In-Reply-To: <200707032209.24963.farmatito@tiscali.it> References: <20070703125946.GB23671@sovereign.org> <200707032209.24963.farmatito@tiscali.it> Message-ID: <20070703214637.GH1686@sovereign.org> On Tue, Jul 03, 2007 at 10:09:24PM +0200, Tito wrote: > On Tuesday 03 July 2007 14:59:46 Jim Freeman wrote: ... > > When md5sum is invoked as /bin/md5sum, it yields the 40-character sha1sum > > instead of the 32-character md5sum: ... > > # /bin/md5sum /etc/passwd > > 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd ... > Please, try attached patch. > > Ciao, > Tito > --- coreutils/md5_sha1_sum.c.orig 2007-05-26 23:23:50.000000000 +0200 > +++ coreutils/md5_sha1_sum.c 2007-07-03 22:06:56.000000000 +0200 > @@ -84,7 +84,7 @@ > uint8_t *hash_value; > unsigned flags; > hash_algo_t hash_algo = ENABLE_MD5SUM > - ? (ENABLE_SHA1SUM ? (**argv=='m' ? HASH_MD5 : HASH_SHA1) : HASH_MD5) > + ? (ENABLE_SHA1SUM ? (applet_name[0]=='m' ? HASH_MD5 : HASH_SHA1) : HASH_MD5) > : HASH_SHA1; > > if (ENABLE_FEATURE_MD5_SHA1_SUM_CHECK) That did the trick - THANKS! It now works as it should: # md5sum /etc/passwd fe611ba27d0d7d92bbef243109fed95d /etc/passwd # /bin/md5sum /etc/passwd fe611ba27d0d7d92bbef243109fed95d /etc/passwd # sha1sum /etc/passwd 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd # /bin/sha1sum /etc/passwd 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd Grazie, ...jfree From farmatito at tiscali.it Wed Jul 4 08:43:33 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 4 Jul 2007 10:43:33 +0200 Subject: problem to build busybox in cygwin In-Reply-To: References: Message-ID: <200707041043.33301.farmatito@tiscali.it> On Wednesday 04 July 2007 10:30:57 hamid khateb wrote: > libintl_gettext Maybe google for libintl_gettext ;-) ? The search yields 10 pages of results.... This one of the first. Your linker can't find the symbols in gettext's library - make sure you're linking to it with the proper -l options. Read the info pages for info :) $ info gettext $ gcc -o main main.c -lintl So maybe adding -lintl could help.... Ciao, Tito From kevin.morfitt at fearnsidesystems.co.uk Wed Jul 4 09:17:16 2007 From: kevin.morfitt at fearnsidesystems.co.uk (Fearnside Systems) Date: Wed, 4 Jul 2007 10:17:16 +0100 Subject: problem to build busybox in cygwin References: <200707041043.33301.farmatito@tiscali.it> Message-ID: <005b01c7be1c$c2acba50$3902a8c0@FRN2> I use this patch to build 2.6.14 in cygwin. I'm not sure what kernel you're building but you could probably adapt the patch to suit. diff -rup linux-2.6.14-orig/scripts/kconfig/Makefile linux-2.6.14/scripts/kconfig/Makefile --- linux-2.6.14-orig/scripts/kconfig/Makefile 2005-10-28 01:02:08.000000000 +0100 +++ linux-2.6.14/scripts/kconfig/Makefile 2007-06-21 15:25:05.281250000 +0100 @@ -127,6 +127,12 @@ HOSTLOADLIBES_gconf = `pkg-config gtk+-2 HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \ -D LKC_DIRECT_LINK +HOST_OS := $(shell uname -o) +ifeq ($(HOST_OS),Cygwin) +HOSTLOADLIBES_mconf = -lintl +HOSTLOADLIBES_conf = -lintl +endif + $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o $(obj)/kxgettext: $(obj)/zconf.tab.h $(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped > On Wednesday 04 July 2007 10:30:57 hamid khateb wrote: >> libintl_gettext > > Maybe google for libintl_gettext ;-) ? > The search yields 10 pages of results.... > This one of the first. > > Your linker can't find the symbols in gettext's library - make sure you're > linking to it with the proper -l options. Read the info pages for info :) > > $ info gettext > > $ gcc -o main main.c -lintl > > So maybe adding -lintl could help.... > > Ciao, > Tito > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > From kevin.morfitt at fearnsidesystems.co.uk Wed Jul 4 10:51:44 2007 From: kevin.morfitt at fearnsidesystems.co.uk (Fearnside Systems) Date: Wed, 4 Jul 2007 11:51:44 +0100 Subject: problem to build busybox in cygwin References: <200707041043.33301.farmatito@tiscali.it> <005b01c7be1c$c2acba50$3902a8c0@FRN2> Message-ID: <007b01c7be29$6cd4f220$3902a8c0@FRN2> Sorry, wrong patch! This is the one I use to build busybox in cygwin. diff -rup busybox-orig/scripts/kconfig/Makefile busybox/scripts/kconfig/Makefile --- busybox-orig/scripts/kconfig/Makefile 2007-06-16 02:42:59.562500000 +0100 +++ busybox/scripts/kconfig/Makefile 2007-06-16 02:43:41.562500000 +0100 @@ -136,6 +136,11 @@ HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) - HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ -D LKC_DIRECT_LINK +HOST_OS := $(shell uname -o) +ifeq ($(HOST_OS),Cygwin) +HOSTLOADLIBES_mconf = -lintl +HOSTLOADLIBES_conf = -lintl +endif $(obj)/qconf.o: $(obj)/.tmp_qtcheck >I use this patch to build 2.6.14 in cygwin. I'm not sure what kernel you're > building but you could probably adapt the patch to suit. > > diff -rup linux-2.6.14-orig/scripts/kconfig/Makefile > linux-2.6.14/scripts/kconfig/Makefile > --- linux-2.6.14-orig/scripts/kconfig/Makefile 2005-10-28 > 01:02:08.000000000 > +0100 > +++ linux-2.6.14/scripts/kconfig/Makefile 2007-06-21 15:25:05.281250000 > +0100 > @@ -127,6 +127,12 @@ HOSTLOADLIBES_gconf = `pkg-config gtk+-2 > HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 > libglade-2.0 --cflags` \ > -D LKC_DIRECT_LINK > > +HOST_OS := $(shell uname -o) > +ifeq ($(HOST_OS),Cygwin) > +HOSTLOADLIBES_mconf = -lintl > +HOSTLOADLIBES_conf = -lintl > +endif > + > $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o > $(obj)/kxgettext: $(obj)/zconf.tab.h > > $(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped > > > >> On Wednesday 04 July 2007 10:30:57 hamid khateb wrote: >>> libintl_gettext >> >> Maybe google for libintl_gettext ;-) ? >> The search yields 10 pages of results.... >> This one of the first. >> >> Your linker can't find the symbols in gettext's library - make sure >> you're >> linking to it with the proper -l options. Read the info pages for info :) >> >> $ info gettext >> >> $ gcc -o main main.c -lintl >> >> So maybe adding -lintl could help.... >> >> Ciao, >> Tito >> _______________________________________________ >> busybox mailing list >> busybox at busybox.net >> http://busybox.net/cgi-bin/mailman/listinfo/busybox >> > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > From vda.linux at googlemail.com Wed Jul 4 13:13:38 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 4 Jul 2007 15:13:38 +0200 Subject: whither 1.00's "passwd -p ..." ? In-Reply-To: <20070703132306.GC23671@sovereign.org> References: <20070703132306.GC23671@sovereign.org> Message-ID: <1158166a0707040613h47d2c09drbb0c95f420430c3@mail.gmail.com> On 7/3/07, Jim Freeman wrote: > busybox 1.00 (and other versions?) had a "-p" option to allow setting > a user's password bypassing the interactive mode > > # passwd fu > Changing password for fu > New password: > Retype password: > Password for fu changed by root > > vs. > # passwd -p **** blip > Setting password for blip > Password changed. I just downloaded and built busybox 1.00. passwd does not have -p option there. I would rather add separate applet for non-interactive password change. I even have one somewhere on home machine... From dishui at gmail.com Wed Jul 4 13:53:21 2007 From: dishui at gmail.com (kaimi) Date: Wed, 4 Jul 2007 21:53:21 +0800 Subject: nfs server not work"getfh failed: Operation not permitted" Message-ID: hello,all the kernel is 2.6.20, busybox-1.5.0 and nfs-utils-1.0.10. The configuration on NFS listed below: CONFIG_NFS_FS=y CONFIG_NFS_V3=y # CONFIG_NFS_V3_ACL is not set # CONFIG_NFS_V4 is not set # CONFIG_NFS_DIRECTIO is not set CONFIG_NFSD=y CONFIG_NFSD_V3=y # CONFIG_NFSD_V3_ACL is not set # CONFIG_NFSD_V4 is not set CONFIG_NFSD_TCP=y CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=y CONFIG_NFS_COMMON=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set # CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # CONFIG_9P_FS is not set the following comes from "ps -e" 705 bin portmap 735 root rpc.statd 739 root rpc.statd 741 root [lockd] 742 root [rpciod/0] 743 root [nfsd] 744 root [nfsd] 746 root rpc.mountd 751 root /sbin/syslogd -n -m 0 752 root /sbin/klogd -n 753 root -bash 762 root rpc.rquotad $cat /etc/hosts.allow ALL:ALL $cat /etc/exports /tmp *(rw,async,no_root_squash,subtree_check) $cat /var/log/nfs/etab /tmp *(rw,async,wdelay,hide,nocrossmnt,secure,no_root_squash,no_all_squash,subtree_check,secure_locks,acl,mapping=identity,anonuid=65534,an) to my strange, there's no messages in /proc/fs/nfs/exportfs, I don't know if this is the cause. $cat /proc/fs/nfs/exports # Version 1.1 # Path Client(Flags) # IPs when I try to mount the nfs directory in "mount server:/tmp /mnt", the client get "mount: 192.168.0.254:/tmp failed, reason given by server: Permission denied" and the server's log says "getfh failed: Operation not permitted" I have searched for solutions on google, but failed. Thanks in advance. Best regards Kaimi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.busybox.net/pipermail/busybox/attachments/20070704/a780a0b3/attachment-0002.htm From cristian.ionescu-idbohrn at axis.com Wed Jul 4 15:39:25 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Wed, 4 Jul 2007 17:39:25 +0200 (CEST) Subject: whither 1.00's "passwd -p ..." ? In-Reply-To: <20070703132306.GC23671@sovereign.org> References: <20070703132306.GC23671@sovereign.org> Message-ID: <0707041722560.1707@somehost> On Tue, 3 Jul 2007, Jim Freeman wrote: > # passwd -p **** blip Isn't this the well known insecure method that shouldn't be used because (with the right timing) anyone can snap the password with ps or 'cat /proc//cmdline'? -- Cristian From jfree at sovereign.org Wed Jul 4 18:14:32 2007 From: jfree at sovereign.org (Jim Freeman) Date: Wed, 4 Jul 2007 12:14:32 -0600 Subject: whither 1.00's "passwd -p ..." ? In-Reply-To: <1158166a0707040613h47d2c09drbb0c95f420430c3@mail.gmail.com> References: <20070703132306.GC23671@sovereign.org> <1158166a0707040613h47d2c09drbb0c95f420430c3@mail.gmail.com> Message-ID: <20070704181432.GE2424@sovereign.org> On Wed, Jul 04, 2007 at 03:13:38PM +0200, Denis Vlasenko wrote: > On 7/3/07, Jim Freeman wrote: > >busybox 1.00 (and other versions?) had a "-p" option to allow setting > >a user's password bypassing the interactive mode ... > > # passwd -p **** blip > > Setting password for blip > > Password changed. > > I just downloaded and built busybox 1.00. passwd does not have -p option > there. Yeesh - my (very) bad. Looks like this was an in-house change (derivative of "useradd -p"), then re-tar'd with the same name so namewise it was indistinguishable from the upstream. Apologies! (slinks away in search of brown paper bag ...) > I would rather add separate applet for non-interactive password > change. I even have one somewhere on home machine... http://dns.solucorp.qc.ca/linuxconf/changes/changes-1.9r22.html has "-P" for from a pipe: The passwd command supplied with Linuxconf has been enhanced ... passwd -P user_account Change the password from a pipe echo new_passwd | passwd -P user_account or BSD's "pw" looks like it will take it from a pipe: http://lists.freebsd.org/pipermail/freebsd-questions/2007-April/146507.html or, as in my original mail, "ptyget" can be wrestled into doing something useful ... From jfree at sovereign.org Wed Jul 4 18:19:11 2007 From: jfree at sovereign.org (Jim Freeman) Date: Wed, 4 Jul 2007 12:19:11 -0600 Subject: whither 1.00's "passwd -p ..." ? In-Reply-To: <200707032217.10838.farmatito@tiscali.it> References: <20070703132306.GC23671@sovereign.org> <200707032217.10838.farmatito@tiscali.it> Message-ID: <20070704181911.GF2424@sovereign.org> On Tue, Jul 03, 2007 at 10:17:10PM +0200, Tito wrote: > On Tuesday 03 July 2007 15:23:06 Jim Freeman MISTAKENLY wrote: > > busybox 1.00 (and other versions?) had a "-p" option to allow setting > > a user's password bypassing the interactive mode ... > > # passwd -p **** blip > > Setting password for blip > > Password changed. ... > Maybe it was ripped out as it is non standard? > > OPTIONS > The options which apply to the passwd command are: > > -a, --all > This option can be used only with -S and causes show status for all > users. ... You're no doubt correct - I think I'd seen mention of it in ancient SunOS docs. BTW - were you excerpting from SuS? or where? Thanks, ...jfree From vda.linux at googlemail.com Tue Jul 3 17:45:33 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 3 Jul 2007 19:45:33 +0200 Subject: invoked as /bin/md5sum, yields sha1sum In-Reply-To: <20070703125946.GB23671@sovereign.org> References: <20070703125946.GB23671@sovereign.org> Message-ID: <200707031945.33200.vda.linux@googlemail.com> On Tuesday 03 July 2007 14:59, Jim Freeman wrote: > > Busybox 1.6.0, on powerpc: > > When md5sum is invoked as /bin/md5sum, it yields the 40-character sha1sum > instead of the 32-character md5sum: > > # md5sum /etc/passwd > fe611ba27d0d7d92bbef243109fed95d /etc/passwd > > # /bin/md5sum /etc/passwd > 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd > > # sha1sum /etc/passwd > 8a20e2821a34d10a48d278d1095be4856c1bcdf0 /etc/passwd > > Does this happen with any other platforms? I think yes. hash_algo_t hash_algo = ENABLE_MD5SUM ? (ENABLE_SHA1SUM ? (**argv=='m' ? HASH_MD5 : HASH_SHA1) : HASH_MD5) : HASH_SHA1; It should check applet_name[0] instead. Fixing in svn, thanks for the report. -- vda From jfree at sovereign.org Wed Jul 4 18:29:10 2007 From: jfree at sovereign.org (Jim Freeman) Date: Wed, 4 Jul 2007 12:29:10 -0600 Subject: whither "passwd -p ..." ? In-Reply-To: <0707041722560.1707@somehost> References: <20070703132306.GC23671@sovereign.org> <0707041722560.1707@somehost> Message-ID: <20070704182910.GG2424@sovereign.org> On Wed, Jul 04, 2007 at 05:39:25PM +0200, Cristian Ionescu-Idbohrn wrote: > On Tue, 3 Jul 2007, Jim Freeman wrote: > > > # passwd -p **** blip > > Isn't this the well known insecure method that shouldn't be used > because (with the right timing) anyone can snap the password with ps > or 'cat /proc//cmdline'? ... As I acknowledged in parts you trimmed, yes (if "anyone" is taken to mean "someone with shell access"). But in many embedded cases, there is no shell access (ergo, the cgi remote admin mentioned in the original mail). In such cases "anyone" == "noone", and "shouldn't be used" becomes "might be used", and this particular point is then mooted. ...jfree From harald-tuxbox at arcor.de Wed Jul 4 18:58:11 2007 From: harald-tuxbox at arcor.de (=?iso-8859-1?Q?Harald_K=FCthe?=) Date: Wed, 4 Jul 2007 20:58:11 +0200 Subject: [Bug?] init.c: problems if kernel gets console=null via cmdline References: <001101c7bc15$a6f3d040$0ac810ac@houdinineu> <200707012132.32011.vda.linux@googlemail.com> Message-ID: <001301c7be6d$4ea1ae80$0ac810ac@houdinineu> > ----- Original Message ----- > From: "Denis Vlasenko" > To: > Cc: "Harald K?the" > Sent: Sunday, July 01, 2007 9:32 PM > Subject: Re: [Bug?] init.c: problems if kernel gets console=null via cmdline > > On Sunday 01 July 2007 21:25, Harald K?the wrote: > > Hello list, > > > > we have problems with the recent versions of busybox (1.5 and 1.6) when we start our kernel (2.4.34) without console. > > Some programs do not start e.g. samba server. > > When we link init to an older version of busybox thing get working. > > Debugging is difficult because the problem does not exist in a strace/gdb environement. > > It seems to be ok if I hack console_init() that it uses /dev/null as the console. > > > > Any help / direction is appreciated. > > Try this: in init.c, add "else" clause as shown below: > > static void console_init(void) > { > struct serial_struct sr; > char *s; > > s = getenv("CONSOLE"); > if (!s) s = getenv("console"); > if (s) { > int fd = open(s, O_RDWR | O_NONBLOCK | O_NOCTTY); > if (fd >= 0) { > dup2(fd, 0); > dup2(fd, 1); > dup2(fd, 2); > while (fd > 2) close(fd--); > } > messageD(L_LOG, "console='%s'", s); > + } else { > + /* Make sure fd 0,1,2 are not closed */ > + bb_sanitize_stdio(); > } > > If it helps, I will add it in 1.6.2. > -- > vda This works, thank you for your help. I found out that in kernel 2.4.34 the kernel commandline argument "console=" is processed by the kernel itsself and therefore not transferred into the environment. So getenv("CONSOLE"); and getenv("console"); always return null. Linux-2.6.15 look similar Best regards Harald From cristian.ionescu-idbohrn at axis.com Wed Jul 4 19:57:42 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Wed, 4 Jul 2007 21:57:42 +0200 (CEST) Subject: whither "passwd -p ..." ? In-Reply-To: <20070704182910.GG2424@sovereign.org> References: <20070703132306.GC23671@sovereign.org> <0707041722560.1707@somehost> <20070704182910.GG2424@sovereign.org> Message-ID: <0707042153050.8241@somehost> On Wed, 4 Jul 2007, Jim Freeman wrote: > On Wed, Jul 04, 2007 at 05:39:25PM +0200, Cristian Ionescu-Idbohrn wrote: > > On Tue, 3 Jul 2007, Jim Freeman wrote: > > > > > # passwd -p **** blip > > > > Isn't this the well known insecure method that shouldn't be used > > because (with the right timing) anyone can snap the password with ps > > or 'cat /proc//cmdline'? > ... > > As I acknowledged in parts you trimmed, yes (if "anyone" is taken > to mean "someone with shell access"). Yes. Should I appologise for trimming? > But in many embedded cases, there is no shell access (ergo, the > cgi remote admin mentioned in the original mail). Of course. > In such cases "anyone" == "noone", and "shouldn't be used" becomes > "might be used", and this particular point is then mooted. Yes. Still. Any such -p "option" should be marked as "risky" and appear just as an option (i.e. default disabled). -- Cristian From uberlord at gentoo.org Wed Jul 4 20:02:26 2007 From: uberlord at gentoo.org (Roy Marples) Date: Wed, 4 Jul 2007 21:02:26 +0100 Subject: [Bug?] init.c: problems if kernel gets console=null via cmdline In-Reply-To: <001301c7be6d$4ea1ae80$0ac810ac@houdinineu> References: <001101c7bc15$a6f3d040$0ac810ac@houdinineu> <200707012132.32011.vda.linux@googlemail.com> <001301c7be6d$4ea1ae80$0ac810ac@houdinineu> Message-ID: <20070704210226.1edbf7d7@uberlaptop.marples.name> On Wed, 4 Jul 2007 20:58:11 +0200 Harald K?the wrote: > > Try this: in init.c, add "else" clause as shown below: > > > > static void console_init(void) > > { > > struct serial_struct sr; > > char *s; > > > > s = getenv("CONSOLE"); > > if (!s) s = getenv("console"); > > if (s) { > > int fd = open(s, O_RDWR | O_NONBLOCK | O_NOCTTY); > > if (fd >= 0) { > > dup2(fd, 0); > > dup2(fd, 1); > > dup2(fd, 2); > > while (fd > 2) close(fd--); > > } > > messageD(L_LOG, "console='%s'", s); > > + } else { > > + /* Make sure fd 0,1,2 are not closed */ > > + bb_sanitize_stdio(); > > } > > > > If it helps, I will add it in 1.6.2. > > -- > > vda > > This works, thank you for your help. > I found out that in kernel 2.4.34 the kernel commandline argument > "console=" is processed by the kernel itsself and therefore not > transferred into the environment. So getenv("CONSOLE"); and > getenv("console"); always return null. Linux-2.6.15 look similar Why don't you use the ttyname function? That always points to the correct tty used. On Gentoo in sysinit and boot it returns /dev/console and in runlevel 3 (default) it returns /dev/tty1 char *tty = ttyname (fileno (stdout)); if (tty) { ... /* same as above */ } else { /* Make sure fd 0,1,2 are not closed */ bb_sanitize_stdio(); } Thanks Roy From vda.linux at googlemail.com Thu Jul 5 00:17:42 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Jul 2007 02:17:42 +0200 Subject: [Bug?] init.c: problems if kernel gets console=null via cmdline In-Reply-To: <001301c7be6d$4ea1ae80$0ac810ac@houdinineu> References: <001101c7bc15$a6f3d040$0ac810ac@houdinineu> <200707012132.32011.vda.linux@googlemail.com> <001301c7be6d$4ea1ae80$0ac810ac@houdinineu> Message-ID: <200707050217.42527.vda.linux@googlemail.com> On Wednesday 04 July 2007 20:58, Harald K?the wrote: > > Try this: in init.c, add "else" clause as shown below: > > > > static void console_init(void) > > { > > struct serial_struct sr; > > char *s; > > > > s = getenv("CONSOLE"); > > if (!s) s = getenv("console"); > > if (s) { > > int fd = open(s, O_RDWR | O_NONBLOCK | O_NOCTTY); > > if (fd >= 0) { > > dup2(fd, 0); > > dup2(fd, 1); > > dup2(fd, 2); > > while (fd > 2) close(fd--); > > } > > messageD(L_LOG, "console='%s'", s); > > + } else { > > + /* Make sure fd 0,1,2 are not closed */ > > + bb_sanitize_stdio(); > > } > > > > If it helps, I will add it in 1.6.2. > > -- > > vda > > This works, thank you for your help. > I found out that in kernel 2.4.34 the kernel commandline argument > "console=" is processed by the kernel itsself and therefore not > transferred into the environment. > So getenv("CONSOLE"); and getenv("console"); always return null. CONSOLE (uppercase) should still be passed by kernel. Adding this to 1.6.1 fixes. Hmmm... and 1.6.1 announcement is still not on webpage - ?! -- vda From miroslaw.dach at psi.ch Thu Jul 5 07:48:26 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Thu, 5 Jul 2007 09:48:26 +0200 (CEST) Subject: ash ignors somtimes commands In-Reply-To: Message-ID: Dear All, I use busybox based root-file system on my PPC405 processor embedded system. My root file system is mounted via NFS. I have chosen ash as a shell. ash works fine but from time to time it ignores commands which I type. For example in most cases when I type 'ps' I get a complete list of processes. Sometimes 'ps' does not print any thing. It is the same with all other commands. I have written 'all' because I have also my own programs which seem to be not execute (sometimes) when I type their names and press ENTER. Does anybody have an idea why it is so? Best Regards Mirek From alex_x1980 at tut.by Thu Jul 5 12:08:01 2007 From: alex_x1980 at tut.by (Alex Kums) Date: Thu, 05 Jul 2007 15:08:01 +0300 Subject: mdev once more Message-ID: Hi guys. I cann't force mdev to work. My rootfs has a static /dev filesystem, and I want to test how does mdev work. I did as docs/mdev.txt suggests, after logging in with the following script: # cat /mnt/mkdev #!/bin/sh echo "Mounting sysfs" mount -t sysfs sysfs /sys echo "Echoing hotplug" echo /bin/mdev > /proc/sys/kernel/hotplug echo "mdev -s" mdev -s echo "Mounting /dev" mount -t tmpfs mdev /dev echo "Creating /dev/pts" mkdir /dev/pts echo "Mounting pts" mount -t devpts devpts /dev/pts # /mnt/mkdev Mounting sysfs Echoing hotplug mdev -s # this takes few seconds Mounting /dev Creating /dev/pts Mounting pts # ls /sys block class firmware kernel power bus devices fs module # ls /dev/ pts # ls /dev/pts # ----------------------------------------- There are no files in /dev and /dev/pts! Why ? My kernel is 2.6.20, and it of course includes CONFIG_SYSFS, CONFIG_SYSFS_DEPRECATED and CONFIG_HOTPLUG. Maybe I'm missing something ? :) Thanks. ----------------------------------------- Spam from tut.by goes here ==> ------- ????????? ? ??????? ????? ????? - ???: http://tourism.tut.by From vda.linux at googlemail.com Thu Jul 5 12:19:35 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Jul 2007 14:19:35 +0200 Subject: whither 1.00's "passwd -p ..." ? In-Reply-To: <20070704181432.GE2424@sovereign.org> References: <20070703132306.GC23671@sovereign.org> <1158166a0707040613h47d2c09drbb0c95f420430c3@mail.gmail.com> <20070704181432.GE2424@sovereign.org> Message-ID: <200707051419.35270.vda.linux@googlemail.com> On Wednesday 04 July 2007 20:14, Jim Freeman wrote: > On Wed, Jul 04, 2007 at 03:13:38PM +0200, Denis Vlasenko wrote: > > On 7/3/07, Jim Freeman wrote: > > >busybox 1.00 (and other versions?) had a "-p" option to allow setting > > >a user's password bypassing the interactive mode > ... > > > # passwd -p **** blip > > > Setting password for blip > > > Password changed. > > > > I just downloaded and built busybox 1.00. passwd does not have -p option > > there. > > Yeesh - my (very) bad. Looks like this was an in-house change > (derivative of "useradd -p"), then re-tar'd with the same name > so namewise it was indistinguishable from the upstream. > Apologies! (slinks away in search of brown paper bag ...) No problem. If you need it, maybe make a diff of said changes and send to list. You may be not alone with this password change requirement. > http://dns.solucorp.qc.ca/linuxconf/changes/changes-1.9r22.html > has "-P" for from a pipe: > > The passwd command supplied with Linuxconf has been enhanced > ... > passwd -P user_account > Change the password from a pipe > echo new_passwd | passwd -P user_account > > or BSD's "pw" looks like it will take it from a pipe: > http://lists.freebsd.org/pipermail/freebsd-questions/2007-April/146507.html piping password is indeed safe(r) since it is not visible in ps (echo is sheel internal builtin and won't show up in ps either). -- vda From natanael.copa at gmail.com Thu Jul 5 13:43:40 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Thu, 05 Jul 2007 15:43:40 +0200 Subject: mdev once more In-Reply-To: References: Message-ID: <1183643020.5818.18.camel@localhost> On Thu, 2007-07-05 at 15:08 +0300, Alex Kums wrote: > Hi guys. > > I cann't force mdev to work. My rootfs has a static /dev filesystem, and I > want to test how does mdev work. > > I did as docs/mdev.txt suggests, after logging in with the following > script: > > # cat /mnt/mkdev > > #!/bin/sh > > echo "Mounting sysfs" > mount -t sysfs sysfs /sys > echo "Echoing hotplug" > echo /bin/mdev > /proc/sys/kernel/hotplug > echo "mdev -s" > mdev -s > > echo "Mounting /dev" > mount -t tmpfs mdev /dev > echo "Creating /dev/pts" > mkdir /dev/pts > echo "Mounting pts" > mount -t devpts devpts /dev/pts > > # /mnt/mkdev > Mounting sysfs > Echoing hotplug > mdev -s # this takes few seconds > Mounting /dev > Creating /dev/pts > Mounting pts > > # ls /sys > block class firmware kernel power > bus devices fs module > # ls /dev/ > pts > # ls /dev/pts > # > ----------------------------------------- > > There are no files in /dev and /dev/pts! Why ? Because you mount the tmpfs on /dev *after* mdev has created the devices. If you unmount /dev you will find them. Try this: # cat /mnt/mkdev #!/bin/sh echo "Mounting sysfs" mount -t sysfs sysfs /sys echo "Mounting /dev" mount -t tmpfs mdev /dev echo "Creating /dev/pts" mkdir /dev/pts echo "Mounting pts" mount -t devpts devpts /dev/pts echo "Echoing hotplug" echo /bin/mdev > /proc/sys/kernel/hotplug echo "mdev -s" mdev -s > My kernel is 2.6.20, and it > of course includes CONFIG_SYSFS, CONFIG_SYSFS_DEPRECATED and > CONFIG_HOTPLUG. Maybe I'm missing something ? :) > > Thanks. From vda.linux at googlemail.com Thu Jul 5 13:38:49 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 5 Jul 2007 15:38:49 +0200 Subject: ash ignors somtimes commands In-Reply-To: References: Message-ID: <200707051538.49559.vda.linux@googlemail.com> On Thursday 05 July 2007 09:48, Miroslaw Dach wrote: > I use busybox based root-file system on my PPC405 processor > embedded system. My root file system is mounted via NFS. I have chosen ash > as a shell. > > ash works fine but from time to time it ignores commands which I type. > > For example in most cases when I type 'ps' I get a complete list of > processes. Sometimes 'ps' does not print any thing. It is the same with > all other commands. I have written 'all' because I have also my own > programs which seem to be not execute (sometimes) when I type their names > and press ENTER. > > Does anybody have an idea why it is so? Absolutely no idea. It's rather weird. Can you give more details - how often commands do not execute? Every 2nd? Every tenth? Every 1000th? Can you add debugging outputs in ash.c in cmdloop function, like bb_error_msg("I am before parsecmd()"); bb_error_msg("I am after parsecmd()"); bb_error_msg("I am before evaltree()"); etc, and get more info about this weird behavior? static int cmdloop(int top) { union node *n; struct stackmark smark; int inter; int numeof = 0; TRACE(("cmdloop(%d) called\n", top)); for (;;) { int skip; setstackmark(&smark); #if JOBS if (jobctl) showjobs(stderr, SHOW_CHANGED); #endif inter = 0; if (iflag && top) { inter++; #if ENABLE_ASH_MAIL chkmail(); #endif } n = parsecmd(inter); /* showtree(n); DEBUG */ if (n == NEOF) { if (!top || numeof >= 50) break; if (!stoppedjobs()) { if (!Iflag) break; out2str("\nUse \"exit\" to leave shell.\n"); } numeof++; } else if (nflag == 0) { job_warning = (job_warning == 2) ? 1 : 0; numeof = 0; evaltree(n, 0); } popstackmark(&smark); skip = evalskip; if (skip) { evalskip = 0; return skip & SKIPEVAL; } } return 0; } -- vda From pgf at brightstareng.com Thu Jul 5 13:58:05 2007 From: pgf at brightstareng.com (Paul Fox) Date: Thu, 05 Jul 2007 09:58:05 -0400 Subject: whither 1.00's "passwd -p ..." ? In-Reply-To: vda.linux's message of Thu, 05 Jul 2007 14:19:35 +0200. <200707051419.35270.vda.linux@googlemail.com> Message-ID: <29189.1183643885@brightstareng.com> vda wrote: > > piping password is indeed safe(r) since it is not visible in ps > (echo is sheel internal builtin and won't show up in ps either). a while ago we thought we had need of the password-from-stdin feature, and i did manage to get busybox passwd to do it, though i don't recommend it. i include it here for your amusement, or horror, as you wish. this is mail i sent to a colleage at the time: i wrote: > the reason the busybox passwd command doesn't work when the passwords > are on stdin like this: > echo -e 'thistest\nthistest' | passwd root > > is that because stdin isn't line-buffered, the whole string, including > the newline, is consumed in answer to the first "Enter new password:" > prompt, so there's nothing left for the "Re-enter new password:" prompt. > > however, busybox does truncate the response at the newline. so > to get it to work (WARNING! this is REALLY REALLY UGLY), you "simply" > cause the first read() to be exactly satisfied with the first response, > and provide the second response after that. the read() size in > this version of busybox is 255, so this command: > (echo -e > 'xyzzy\njjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj > jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj > jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj > jjjjjjjjjjjjjjjj'; echo xyzzy) | passwd root > > does reset the password. (that's enough 'j's to make the > first echo produce exactly 255 characters.) > > the latest busybox has unchanged behavior, except the the buffer > is shorter -- only 63 characters total. so (unsurprisingly) a > script based on this technique would not survive a busybox > upgrade. in the end, we decided we didn't need the feature, so i'm afraid i have no patch to offer, in compensation for making you read the above atrocious solution. :-) paul =--------------------- paul fox, pgf at brightstareng.com From pgf at brightstareng.com Thu Jul 5 13:59:59 2007 From: pgf at brightstareng.com (Paul Fox) Date: Thu, 05 Jul 2007 09:59:59 -0400 Subject: ash ignors somtimes commands In-Reply-To: vda.linux's message of Thu, 05 Jul 2007 15:38:49 +0200. <200707051538.49559.vda.linux@googlemail.com> Message-ID: <29271.1183643999@brightstareng.com> > On Thursday 05 July 2007 09:48, Miroslaw Dach wrote: > > I use busybox based root-file system on my PPC405 processor > > embedded system. My root file system is mounted via NFS. I have chosen ash > > as a shell. > > > > ash works fine but from time to time it ignores commands which I type. > > > > For example in most cases when I type 'ps' I get a complete list of > > processes. Sometimes 'ps' does not print any thing. It is the same with > > all other commands. I have written 'all' because I have also my own > > programs which seem to be not execute (sometimes) when I type their names > > and press ENTER. > > > > Does anybody have an idea why it is so? > > Absolutely no idea. It's rather weird. > > Can you give more details - how often commands do not execute? > Every 2nd? Every tenth? Every 1000th? it sounds to me as if there's another command running in the background which is consuming input typed at the console. whether ash or the background command gets the line of text is a race condition. paul =--------------------- paul fox, pgf at brightstareng.com From sbb at tuxfamily.org Thu Jul 5 15:24:41 2007 From: sbb at tuxfamily.org (Seb) Date: Thu, 5 Jul 2007 17:24:41 +0200 Subject: .bashrc and ash In-Reply-To: References: <468A32B0.1000503@Kriegisch.name> Message-ID: <20070705172441.dbf9d41d.sbb@tuxfamily.org> Le Tue, 3 Jul 2007 13:31:37 +0200 (CEST) Miroslaw Dach a ?crit: > Thanks it does work fine now. > > Best Regards > > Mirek > > On Tue, 3 Jul 2007, Alexander Kriegisch wrote: > > > > I am using ash as a shall in my busybox rootfile system. > > > I wanted to set some environmental variables in .bashrc but it is not > > > taken into account when logging with telnet. > > > > As the name suggests, .bashrc belongs to bash, not ash. You want to try > > .profile in your home directory. > > -- > > Alexander Kriegisch > > Hello, If your .bashrc is Ash-shell compliant, you can also run ash with 'ENV=$HOME/.bashrc' as environment variable. ++ Seb. From sbb at tuxfamily.org Thu Jul 5 15:33:22 2007 From: sbb at tuxfamily.org (Seb) Date: Thu, 5 Jul 2007 17:33:22 +0200 Subject: Probably a bug in ash In-Reply-To: <20070628163439.50345aac.sbb@tuxfamily.org> References: <20070628163439.50345aac.sbb@tuxfamily.org> Message-ID: <20070705173322.dffa33b1.sbb@tuxfamily.org> Hello, Sorry to insist, but as I don't see any reaction to my precedent mail, I'd just want to know if it wasn't well delivered on the list or if it's just an (uninteresting|desperated) case so that there is nothing to say. :) Le Thu, 28 Jun 2007 16:34:39 +0200 Seb a ?crit: > Hello, > > It seems that there is a bug in the 'jobs' built-in command of ash. As > a matter of fact, its output cannot be captured nor piped. > > I made a little script (in attachment) which shows the case. If you > execute it with ash, you should see that 'test3' doesn't return > anything but a new line, while 'test4' indicates that the output is well > directed to stdout (so, according to the rules of shell, the pipe > should work). > > [...] ++ Seb. From jfree at sovereign.org Thu Jul 5 16:38:19 2007 From: jfree at sovereign.org (Jim Freeman) Date: Thu, 5 Jul 2007 10:38:19 -0600 Subject: bash vs. ash, [ ! a = b ] vs. [ a != b ] Message-ID: <20070705163818.GI2424@sovereign.org> powerpc, busybox 1.6.0 There is a discrepency (== error?) in ash's handling of the following: ash === # [ ! a = b ] # echo $? 1 # [ a != b ] # echo $? 0 bash ==== $ [ ! a = b ] $ echo $? 0 $ [ a != b ] $ echo $? 0 This is breaking scripts that have worked previously. If I'm doing something stupid, let me know - I can take it (I'm used to it ...) thanks, ...jfree From psmith at netezza.com Thu Jul 5 16:51:24 2007 From: psmith at netezza.com (Paul Smith) Date: Thu, 05 Jul 2007 12:51:24 -0400 Subject: bash vs. ash, [ ! a = b ] vs. [ a != b ] In-Reply-To: <20070705163818.GI2424@sovereign.org> References: <20070705163818.GI2424@sovereign.org> Message-ID: <1183654284.3119.94.camel@psmithub> On Thu, 2007-07-05 at 10:38 -0600, Jim Freeman wrote: > There is a discrepency (== error?) in ash's handling of the following: > # [ ! a = b ] > # echo $? > 1 According to the POSIX standard, this form is valid and ash's answer is wrong. > If I'm doing something stupid, let me know - I can take it (I'm > used to it ...) This should be fixed in ash, because it's a bug... but I wonder why you just don't use the much more common (and hence more likely to work properly) "[ a != b ]"? -- ----------------------------------------------------------------------------- Paul D. Smith http://netezza.com "Please remain calm--I may be mad, but I am a professional."--Mad Scientist ----------------------------------------------------------------------------- These are my opinions--Netezza takes no responsibility for them. From jfree at sovereign.org Thu Jul 5 16:55:27 2007 From: jfree at sovereign.org (Jim Freeman) Date: Thu, 5 Jul 2007 10:55:27 -0600 Subject: bash vs. ash, [ ! a = b ] vs. [ a != b ] In-Reply-To: <20070705163818.GI2424@sovereign.org> References: <20070705163818.GI2424@sovereign.org> Message-ID: <20070705165527.GJ2424@sovereign.org> On Thu, Jul 05, 2007 at 10:38:19AM -0600, Jim Freeman wrote: > powerpc, busybox 1.6.0 > > There is a discrepency (== error?) in ash's handling of the following: > > ash > === > # [ ! a = b ] > # echo $? > 1 More info: Regressing against i386 BusyBox v1.1.3 (Debian 1:1.1.3-4) : $ busybox [ ! a = b ] $ echo $? 0 ...jfree From wharms at bfs.de Thu Jul 5 16:55:32 2007 From: wharms at bfs.de (walter harms) Date: Thu, 05 Jul 2007 18:55:32 +0200 Subject: Probably a bug in ash In-Reply-To: <20070705173322.dffa33b1.sbb@tuxfamily.org> References: <20070628163439.50345aac.sbb@tuxfamily.org> <20070705173322.dffa33b1.sbb@tuxfamily.org> Message-ID: <468D2284.9070707@bfs.de> Hi seb, yes the mail was received but noone had time sofar to investigate the problem re, wh Seb wrote: > Hello, > > Sorry to insist, but as I don't see any reaction to my precedent mail, > I'd just want to know if it wasn't well delivered on the list or > if it's just an (uninteresting|desperated) case so that there is nothing > to say. :) > > Le Thu, 28 Jun 2007 16:34:39 +0200 > Seb a ?crit: > >> Hello, >> >> It seems that there is a bug in the 'jobs' built-in command of ash. As >> a matter of fact, its output cannot be captured nor piped. >> >> I made a little script (in attachment) which shows the case. If you >> execute it with ash, you should see that 'test3' doesn't return >> anything but a new line, while 'test4' indicates that the output is well >> directed to stdout (so, according to the rules of shell, the pipe >> should work). >> >> [...] > > ++ > Seb. > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From jfree at sovereign.org Thu Jul 5 17:18:12 2007 From: jfree at sovereign.org (Jim Freeman) Date: Thu, 5 Jul 2007 11:18:12 -0600 Subject: bash vs. ash, [ ! a = b ] vs. [ a != b ] In-Reply-To: <1183654284.3119.94.camel@psmithub> References: <20070705163818.GI2424@sovereign.org> <1183654284.3119.94.camel@psmithub> Message-ID: <20070705171812.GK2424@sovereign.org> On Thu, Jul 05, 2007 at 12:51:24PM -0400, Paul Smith wrote: > On Thu, 2007-07-05 at 10:38 -0600, Jim Freeman wrote: > > > There is a discrepency (== error?) in ash's handling of the following: > > > # [ ! a = b ] > > # echo $? > > 1 > > According to the POSIX standard, this form is valid and ash's answer is > wrong. > > > If I'm doing something stupid, let me know - I can take it (I'm > > used to it ...) > > This should be fixed in ash, because it's a bug... but I wonder why you > just don't use the much more common (and hence more likely to work > properly) "[ a != b ]"? Lots of legacy + 3d party code that should just work, and aren't mine to change ... From pgf at brightstareng.com Thu Jul 5 17:18:32 2007 From: pgf at brightstareng.com (Paul Fox) Date: Thu, 05 Jul 2007 13:18:32 -0400 Subject: Probably a bug in ash In-Reply-To: wharms's message of Thu, 05 Jul 2007 18:55:32 +0200. <468D2284.9070707@bfs.de> Message-ID: <7931.1183655912@brightstareng.com> wh wrote: > Hi seb, > yes the mail was received but noone had time sofar to > investigate the problem further info: whoever takes a look at this; the problem is even worse than originally described. piping the output of "jobs" loses the output entirely, while piping the output of "jobs %1" causes an erroneous error message. BusyBox v1.7.0.svn (2007-07-05 13:13:46 EDT) built-in shell (ash) Enter 'help' for a list of built-in commands. $ sleep 3600 & $ sleep 700 (typed ^Z here) [2] + Stopped sleep 700 $ jobs [2] + Stopped sleep 700 [1] - Running sleep 3600 (two jobs) $ jobs | cat $ jobs | tr a-z A-Z (note missing output) $ jobs [2] + Stopped sleep 700 [1] - Running sleep 3600 (still two jobs) $ jobs %1 [1] - Running sleep 3600 (good) $ jobs %2 [2] + Stopped sleep 700 (also good) $ jobs %1 | cat ash: jobs: No such job: %1 (bad error message) $ jobs %2 | cat ash: jobs: No such job: %2 (bad error message) $ jobs [2] + Stopped sleep 700 [1] - Running sleep 3600 (still two jobs) paul > > > Seb wrote: > > Hello, > > = > > > Sorry to insist, but as I don't see any reaction to my precedent mail, > > I'd just want to know if it wasn't well delivered on the list or > > if it's just an (uninteresting|desperated) case so that there is nothing > > to say. :) > > = > > > Le Thu, 28 Jun 2007 16:34:39 +0200 > > Seb a =E9crit: > > = > > >> Hello, > >> > >> It seems that there is a bug in the 'jobs' built-in command of ash. As > >> a matter of fact, its output cannot be captured nor piped. > >> > >> I made a little script (in attachment) which shows the case. If you > >> execute it with ash, you should see that 'test3' doesn't return > >> anything but a new line, while 'test4' indicates that the output is well > >> directed to stdout (so, according to the rules of shell, the pipe > >> should work). > >> > >> [...] > > = > > > ++ > > Seb. > > _______________________________________________ > > busybox mailing list > > busybox at busybox.net > > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > = > > > = > > > = > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox =--------------------- paul fox, pgf at brightstareng.com From vapier at gentoo.org Thu Jul 5 17:54:50 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Thu, 5 Jul 2007 13:54:50 -0400 Subject: Aw: Re: mdev woes In-Reply-To: <1183387988.30435.12.camel@localhost> References: <13080109.1183047315105.JavaMail.ngmail@webmail15> <200706281540.35506.vapier@gentoo.org> <1183387988.30435.12.camel@localhost> Message-ID: <200707051354.51832.vapier@gentoo.org> On Monday 02 July 2007, Natanael Copa wrote: > On Thu, 2007-06-28 at 15:40 -0400, Mike Frysinger wrote: > > On Thursday 28 June 2007, Jason Curl wrote: > > > mdev > > > already knows about the device, so a symlink option like udev has would > > > save flash space overall (less scripts, faster and as an option in the > > > menuconfig would mean only those who want it would use it). > > > > there is a patch on the mailing list to add this ... i'm debating adding > > it as the purpose of mdev is to provide the bare min required features; > > if you need more, go use udev > > I vote for this feature. I use a script to create links where I want > them but its hackish and ugly. which symlinks are you looking at though ? can you post all the examples you need ? -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://lists.busybox.net/pipermail/busybox/attachments/20070705/109be9ea/attachment-0002.pgp From vapier at gentoo.org Thu Jul 5 17:56:29 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Thu, 5 Jul 2007 13:56:29 -0400 Subject: provide reasonable config values... In-Reply-To: <200707012031.59033.vda.linux@googlemail.com> References: <0707012016250.21467@somehost> <200707012031.59033.vda.linux@googlemail.com> Message-ID: <200707051356.30578.vapier@gentoo.org> On Sunday 01 July 2007, Denis Vlasenko wrote: > On Sunday 01 July 2007 20:18, Cristian Ionescu-Idbohrn wrote: > > ...to skip warnings: > > > > .config:75:warning: symbol value '' invalid for FEATURE_EDITING_MAX_LEN > > .config:78:warning: symbol value '' invalid for FEATURE_EDITING_HISTORY > > .config:300:warning: symbol value '' invalid for FEATURE_VI_MAX_LEN > > .config:498:warning: symbol value '' invalid for FEATURE_LESS_MAXLINES > > I don't know how to do it. have we tried asking for tips on the kconfig mailing list ? -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://lists.busybox.net/pipermail/busybox/attachments/20070705/45cbb38c/attachment-0002.pgp From Jlau at extremenetworks.com Fri Jul 6 00:33:21 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Thu, 5 Jul 2007 17:33:21 -0700 Subject: mount -o rw,remount /dev/hda2 /boot crashed on BB 1.6.0 Message-ID: <888459D4AEE6464381B30398101F42F8043FC300@sc-msexch-06.extremenetworks.com> On BB 1.6.0, the mount command crashed when the device provided on remount. / # mount -o rw,remount /dev/hda2 /boot ***** Process mount pid: 817 died with signal:11 Segmentation fault (core dumped) It works fine if the device parameter (/dev/hda2) is not given. But "mount -o rw,remount /dev/hda2 /boot" works with BB 1.0 mount command. Any clue? Thanks. -Joe From ddaney at avtrex.com Fri Jul 6 00:42:02 2007 From: ddaney at avtrex.com (David Daney) Date: Thu, 05 Jul 2007 17:42:02 -0700 Subject: mount -o rw,remount /dev/hda2 /boot crashed on BB 1.6.0 In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC300@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC300@sc-msexch-06.extremenetworks.com> Message-ID: <468D8FDA.1060900@avtrex.com> Joe Lau wrote: > On BB 1.6.0, the mount command crashed when the device provided on remount. > > / # mount -o rw,remount /dev/hda2 /boot > ***** Process mount pid: 817 died with signal:11 > Segmentation fault (core dumped) > > It works fine if the device parameter (/dev/hda2) is not given. > > But "mount -o rw,remount /dev/hda2 /boot" works with BB 1.0 mount command. > > Any clue? > How about using gdb to examine the core file? David Daney From Jlau at extremenetworks.com Fri Jul 6 00:46:16 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Thu, 5 Jul 2007 17:46:16 -0700 Subject: mount -o rw,remount /dev/hda2 /boot crashed on BB 1.6.0 Message-ID: <888459D4AEE6464381B30398101F42F8043FC301@sc-msexch-06.extremenetworks.com> I couldn't get the core file on my switch. I am currently having problem on core dump on my switch. Can you try duplicate the problem on your machine? Thanks. -Joe -----Original Message----- From: David Daney [mailto:ddaney at avtrex.com] Sent: Thursday, July 05, 2007 5:42 PM To: Joe Lau Cc: 'busybox at busybox.net' Subject: Re: mount -o rw,remount /dev/hda2 /boot crashed on BB 1.6.0 Joe Lau wrote: > On BB 1.6.0, the mount command crashed when the device provided on remount. > > / # mount -o rw,remount /dev/hda2 /boot > ***** Process mount pid: 817 died with signal:11 > Segmentation fault (core dumped) > > It works fine if the device parameter (/dev/hda2) is not given. > > But "mount -o rw,remount /dev/hda2 /boot" works with BB 1.0 mount command. > > Any clue? > How about using gdb to examine the core file? David Daney From ddaney at avtrex.com Fri Jul 6 00:50:06 2007 From: ddaney at avtrex.com (David Daney) Date: Thu, 05 Jul 2007 17:50:06 -0700 Subject: mount -o rw,remount /dev/hda2 /boot crashed on BB 1.6.0 In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC301@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC301@sc-msexch-06.extremenetworks.com> Message-ID: <468D91BE.50202@avtrex.com> Joe Lau wrote: > Can you try duplicate the problem on your machine? > Thanks. No. I already have enough do to. You are probably going to have to figure out how to debug code on your target device if you want to make much progress. David Daney From Jlau at extremenetworks.com Fri Jul 6 01:58:32 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Thu, 5 Jul 2007 18:58:32 -0700 Subject: tftp -p -b caused tftp to timeout. Message-ID: <888459D4AEE6464381B30398101F42F8043FC302@sc-msexch-06.extremenetworks.com> On BB 1.6.0, tftp PUT hangs when a non-512 blocksize option is given: # tftp 10.203.133.6 -v0 -b1024 -p -rjunk -l/scratch/intern/core.gzip.669.s-1.gz tftp: timeout tftp: timeout tftp: timeout tftp: timeout tftp: timeout tftp: timeout tftp: timeout <--- Control-C out it. It works only with -b512 or no -b option is given. -Joe From simon_laoc at yahoo.com Fri Jul 6 03:26:12 2007 From: simon_laoc at yahoo.com (simon lao) Date: Thu, 5 Jul 2007 20:26:12 -0700 (PDT) Subject: warning: unnamed struct/union that defines no instances Message-ID: <763058.82790.qm@web30201.mail.mud.yahoo.com> Hi, I'm using mips_lexra_fp_be-gcc version 2.95.3 for cross compiling but it has following warning: 1. unrecongnized option '-static-libcc' 2. unnamed struct/union that defines no instances would anyone can help me to resolve the second issue ? For the first issue, I think I can remove the option for my case. Simon ____________________________________________________________________________________ Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games. http://videogames.yahoo.com/platform?platform=120121 From ynakam at hitachisoft.jp Fri Jul 6 04:09:09 2007 From: ynakam at hitachisoft.jp (Yuichi Nakamura) Date: Fri, 06 Jul 2007 13:09:09 +0900 Subject: [patch][Bug] sed can not be used because of wrong applet.h Message-ID: <20070706120954.DED5.YNAKAM@hitachisoft.jp> Hi. I found sed can not be used when built with SELinux support. I saw applet.h and found wrong point. Here is a fix. Index: include/applets.h =================================================================== --- include/applets.h (revision 19006) +++ include/applets.h (working copy) @@ -281,8 +281,8 @@ USE_RUNSV(APPLET(runsv, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) USE_RUNSVDIR(APPLET(runsvdir, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) USE_RX(APPLET(rx, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) +USE_SED(APPLET(sed, _BB_DIR_BIN, _BB_SUID_NEVER)) USE_SELINUXENABLED(APPLET(selinuxenabled, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) -USE_SED(APPLET(sed, _BB_DIR_BIN, _BB_SUID_NEVER)) USE_SEQ(APPLET_NOFORK(seq, seq, _BB_DIR_USR_BIN, _BB_SUID_NEVER, seq)) USE_SETARCH(APPLET(setarch, _BB_DIR_BIN, _BB_SUID_NEVER)) USE_SETCONSOLE(APPLET(setconsole, _BB_DIR_SBIN, _BB_SUID_NEVER)) Regards, Yuichi Nakamura From vapier at gentoo.org Fri Jul 6 04:14:56 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Fri, 6 Jul 2007 00:14:56 -0400 Subject: warning: unnamed struct/union that defines no instances In-Reply-To: <763058.82790.qm@web30201.mail.mud.yahoo.com> References: <763058.82790.qm@web30201.mail.mud.yahoo.com> Message-ID: <200707060014.57607.vapier@gentoo.org> On Thursday 05 July 2007, simon lao wrote: > I'm using mips_lexra_fp_be-gcc version 2.95.3 for > cross compiling but it has following warning: upgrade your toolchain -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://lists.busybox.net/pipermail/busybox/attachments/20070706/de644c11/attachment-0002.pgp From simon_laoc at yahoo.com Fri Jul 6 05:42:02 2007 From: simon_laoc at yahoo.com (simon lao) Date: Thu, 5 Jul 2007 22:42:02 -0700 (PDT) Subject: macro used without args Message-ID: <387452.44065.qm@web30214.mail.mud.yahoo.com> Hi, when I compile the busybox and had error message: macro 'xstrtou' used without args. I used cross compiler GCC 2.95. Do I need to update the toolchain ? thanks, Simon ____________________________________________________________________________________ It's here! Your new message! Get new email alerts with the free Yahoo! Toolbar. http://tools.search.yahoo.com/toolbar/features/mail/ From miroslaw.dach at psi.ch Fri Jul 6 10:45:35 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Fri, 6 Jul 2007 12:45:35 +0200 (CEST) Subject: ash ignors somtimes commands In-Reply-To: <200707051538.49559.vda.linux@googlemail.com> Message-ID: Hi All, My observation is that the symptom I described before happens let say once per 200 times. Maybe it is somehow related to the terminal under windows which I currently use. Best Regards Mirek On Thu, 5 Jul 2007, Denis Vlasenko wrote: > On Thursday 05 July 2007 09:48, Miroslaw Dach wrote: > > I use busybox based root-file system on my PPC405 processor > > embedded system. My root file system is mounted via NFS. I have chosen ash > > as a shell. > > > > ash works fine but from time to time it ignores commands which I type. > > > > For example in most cases when I type 'ps' I get a complete list of > > processes. Sometimes 'ps' does not print any thing. It is the same with > > all other commands. I have written 'all' because I have also my own > > programs which seem to be not execute (sometimes) when I type their names > > and press ENTER. > > > > Does anybody have an idea why it is so? > > Absolutely no idea. It's rather weird. > > Can you give more details - how often commands do not execute? > Every 2nd? Every tenth? Every 1000th? > > Can you add debugging outputs in ash.c in cmdloop function, like > bb_error_msg("I am before parsecmd()"); bb_error_msg("I am after parsecmd()"); > bb_error_msg("I am before evaltree()"); etc, and get more info about > this weird behavior? > > static int > cmdloop(int top) > { > union node *n; > struct stackmark smark; > int inter; > int numeof = 0; > > TRACE(("cmdloop(%d) called\n", top)); > for (;;) { > int skip; > > setstackmark(&smark); > #if JOBS > if (jobctl) > showjobs(stderr, SHOW_CHANGED); > #endif > inter = 0; > if (iflag && top) { > inter++; > #if ENABLE_ASH_MAIL > chkmail(); > #endif > } > n = parsecmd(inter); > /* showtree(n); DEBUG */ > if (n == NEOF) { > if (!top || numeof >= 50) > break; > if (!stoppedjobs()) { > if (!Iflag) > break; > out2str("\nUse \"exit\" to leave shell.\n"); > } > numeof++; > } else if (nflag == 0) { > job_warning = (job_warning == 2) ? 1 : 0; > numeof = 0; > evaltree(n, 0); > } > popstackmark(&smark); > skip = evalskip; > > if (skip) { > evalskip = 0; > return skip & SKIPEVAL; > } > } > return 0; > } > > -- > vda > -- ============================================================================= Miroslaw Dach (Miroslaw.Dach at psi.ch) - SLS/Controls Group PSI - Paul Scherrer Institut CH-5232 Villigen ============================================================================= From miroslaw.dach at psi.ch Fri Jul 6 12:14:09 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Fri, 6 Jul 2007 14:14:09 +0200 (CEST) Subject: How to change the Timezone In-Reply-To: Message-ID: Dear All, I sue successfully busybox RootFile system. Since busybox does not have ntpd daemon I have compiled one: openntpd-3.9p1. The daemon works fine but I have no clue how to change the time zone. I have set the variable TZ=CEST . The only change what I see is that now when I type date I see CEST instead of UTC but the time remained as it was before. Does somebody have some idea? Best Regards Mirek From alberto.donato at gmail.com Fri Jul 6 12:20:13 2007 From: alberto.donato at gmail.com (Alberto Donato) Date: Fri, 6 Jul 2007 14:20:13 +0200 Subject: How to change the Timezone In-Reply-To: References: Message-ID: <9709bd390707060520h31c9be6epcee5c13b4b7526dc@mail.gmail.com> Hi, to have system-wide timezone configuration you need zoneinfo files from libc. They are usually installed under /usr/share/zoneinfo. You can create a link in /etc/timezone to the correct file under this tree. Alberto On 7/6/07, Miroslaw Dach wrote: > Dear All, > > I sue successfully busybox RootFile system. Since busybox does not > have ntpd daemon I have compiled one: openntpd-3.9p1. > > The daemon works fine but I have no clue how to change the time zone. > I have set the variable TZ=CEST . > > The only change what I see is that now when I type date I see CEST instead > of UTC but the time remained as it was before. > > Does somebody have some idea? > > Best Regards > > Mirek > > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > From miroslaw.dach at psi.ch Fri Jul 6 14:00:22 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Fri, 6 Jul 2007 16:00:22 +0200 (CEST) Subject: busybox and shared library Message-ID: Dear All, I am using for same time busybox. In the lib directory I have big number of libraries and I wanted to narrow them to the necessary set. I have launched the command below to determine the shared libraries the busy box depend on: powerpc-405-linux-gnu-readelf -a bin/busybox | grep -i "shared" 0x00000001 (NEEDED) Shared library: [libcrypt.so.1] 0x00000001 (NEEDED) Shared library: [libm.so.6] 0x00000001 (NEEDED) Shared library: [libc.so.6] I have placed in /lib all of that libraries but it seems to be that something is still missing. My lib directory looks like that: -rwxr-xr-x 1 root root 1576651 Jul 6 15:27 libc-2.3.2.so -rwxr-xr-x 1 root root 29422 Jul 6 15:32 libcrypt-2.3.2.so lrwxrwxrwx 1 root root 13 Jul 6 15:32 libcrypt.so -> libcrypt.so.1 lrwxrwxrwx 1 root root 17 Jul 6 15:32 libcrypt.so.1 -> libcrypt-2.3.2.so -rw-r--r-- 1 root root 193 Jul 6 15:28 libc.so lrwxrwxrwx 1 root root 13 Jul 6 15:28 libc.so.6 -> libc-2.3.2.so lrwxrwxrwx 1 root root 13 Jul 6 15:49 libgcc_s.so -> libgcc_s.so.1 -rw-r--r-- 1 root root 338539 Jul 6 15:48 libgcc_s.so.1 -rwxr-xr-x 1 root root 925590 Jul 6 15:30 libm-2.3.2.so lrwxrwxrwx 1 root root 9 Jul 6 15:31 libm.so -> libm.so.6 lrwxrwxrwx 1 root root 13 Jul 6 15:30 libm.so.6 -> libm-2.3.2.so Does somebody have an idea what is missing. Best Regards Mirek From Alexander at Kriegisch.name Fri Jul 6 14:14:14 2007 From: Alexander at Kriegisch.name (Alexander Kriegisch) Date: Fri, 06 Jul 2007 16:14:14 +0200 Subject: Telnetd autologin feature Message-ID: <468E4E36.40500@Kriegisch.name> Telnetd does not seem to support autologin. I know the client does, but not the server. Was this done intentionally to save space or is there another reason why it is not supported? Maybe the developers could consider if implementing this as an optional feature might make sense. Regards -- Alexander Kriegisch From bernd at firmix.at Fri Jul 6 14:07:40 2007 From: bernd at firmix.at (Bernd Petrovitsch) Date: Fri, 06 Jul 2007 16:07:40 +0200 Subject: busybox and shared library In-Reply-To: References: Message-ID: <1183730860.22634.66.camel@tara.firmix.at> An embedded and charset-unspecified text was scrubbed... Name: not available Url: http://lists.busybox.net/pipermail/busybox/attachments/20070706/c2e1d1bb/attachment-0001.diff From miroslaw.dach at psi.ch Fri Jul 6 14:16:52 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Fri, 6 Jul 2007 16:16:52 +0200 (CEST) Subject: busybox and shared library In-Reply-To: <1183730860.22634.66.camel@tara.firmix.at> Message-ID: I have determined that ld-2.3.2.so and the link ld.so.1 was missing. Now is all back to normal. Best Regards Mirek On Fri, 6 Jul 2007, Bernd Petrovitsch wrote: > On Fri, 2007-07-06 at 16:00 +0200, Miroslaw Dach wrote: > [...] > > I am using for same time busybox. In the lib directory I have big > > number of libraries and I wanted to narrow them to the necessary set. > > > > I have launched the command below to determine the shared libraries the > > busy box depend on: > > powerpc-405-linux-gnu-readelf -a bin/busybox | grep -i "shared" > > > > 0x00000001 (NEEDED) Shared library: [libcrypt.so.1] > > 0x00000001 (NEEDED) Shared library: [libm.so.6] > > 0x00000001 (NEEDED) Shared library: [libc.so.6] > > > > I have placed in /lib all of that libraries but it seems to be that > > something is still missing. > > Use "powerpc-405-linux-gnu-ldd", not the above command. > If you don't have one, copy the "ldd" script and patch it. > > Bernd > -- ============================================================================= Miroslaw Dach (Miroslaw.Dach at psi.ch) - SLS/Controls Group PSI - Paul Scherrer Institut CH-5232 Villigen ============================================================================= From peter.korsgaard at barco.com Fri Jul 6 14:21:54 2007 From: peter.korsgaard at barco.com (Peter Korsgaard) Date: Fri, 06 Jul 2007 16:21:54 +0200 Subject: Telnetd autologin feature In-Reply-To: <468E4E36.40500@Kriegisch.name> (Alexander Kriegisch's message of "Fri, 06 Jul 2007 16:14:14 +0200") References: <468E4E36.40500@Kriegisch.name> Message-ID: <877ipdtxx9.fsf@sleipner.barco.com> >>>>> "AK" == Alexander Kriegisch writes: Hi, AK> Telnetd does not seem to support autologin. I know the client does, but AK> not the server. Was this done intentionally to save space or is there AK> another reason why it is not supported? Maybe the developers could AK> consider if implementing this as an optional feature might make sense. Autologin? Why don't you just let telnetd execute sh directly instead of login? -- Bye, Peter Korsgaard From Alexander at Kriegisch.name Fri Jul 6 14:49:19 2007 From: Alexander at Kriegisch.name (Alexander Kriegisch) Date: Fri, 06 Jul 2007 16:49:19 +0200 Subject: Telnetd autologin feature In-Reply-To: <877ipdtxx9.fsf@sleipner.barco.com> References: <468E4E36.40500@Kriegisch.name> <877ipdtxx9.fsf@sleipner.barco.com> Message-ID: <468E566F.8010507@Kriegisch.name> (sorry, I sent this to Peter only instead of to the list.) Because I want a minimum of security, even in telnet. Let us not get philosophic about whether it makes sense to use unencrypted passwords, but they are still better than nothing. -- Alexander Kriegisch Peter Korsgaard wrote: >>>>>> "AK" == Alexander Kriegisch writes: > AK> Telnetd does not seem to support autologin. I know the client does, but > AK> not the server. Was this done intentionally to save space or is there > AK> another reason why it is not supported? Maybe the developers could > AK> consider if implementing this as an optional feature might make sense. > > Autologin? Why don't you just let telnetd execute sh directly instead > of login? From sbb at tuxfamily.org Fri Jul 6 15:10:28 2007 From: sbb at tuxfamily.org (Seb) Date: Fri, 6 Jul 2007 17:10:28 +0200 Subject: Probably a bug in ash In-Reply-To: <7931.1183655912@brightstareng.com> References: <468D2284.9070707@bfs.de> <7931.1183655912@brightstareng.com> Message-ID: <20070706171028.22f53b94.sbb@tuxfamily.org> Le Thu, 05 Jul 2007 13:18:32 -0400 Paul Fox a ?crit: > wh wrote: > > Hi seb, > > yes the mail was received but noone had time sofar to > > investigate the problem > > further info: > whoever takes a look at this; the problem is even worse than > originally described. piping the output of "jobs" loses the > output entirely, while piping the output of "jobs %1" causes an > erroneous error message. > > BusyBox v1.7.0.svn (2007-07-05 13:13:46 EDT) built-in shell (ash) > Enter 'help' for a list of built-in commands. > > $ sleep 3600 & > $ sleep 700 > (typed ^Z here) > [2] + Stopped sleep 700 > $ jobs > [2] + Stopped sleep 700 > [1] - Running sleep 3600 > (two jobs) > $ jobs | cat > $ jobs | tr a-z A-Z > (note missing output) > $ jobs > [2] + Stopped sleep 700 > [1] - Running sleep 3600 > (still two jobs) > $ jobs %1 > [1] - Running sleep 3600 > (good) > $ jobs %2 > [2] + Stopped sleep 700 > (also good) > $ jobs %1 | cat > ash: jobs: No such job: %1 > (bad error message) > $ jobs %2 | cat > ash: jobs: No such job: %2 > (bad error message) > $ jobs > [2] + Stopped sleep 700 > [1] - Running sleep 3600 > (still two jobs) > > > paul > Ok, I just wanted to be sure. Thanks for the confirmation and the additionnal informations. :) Do you think I should also make a parallel bug report to dash ? (it's not to put you under pressure -- I well see you have many other things to fix here and this bug can wait -- but just to try to be more "useful" without bothering you nor being unpolite). ++ Seb. From genepi at sympatico.ca Fri Jul 6 15:15:04 2007 From: genepi at sympatico.ca (Pierre =?iso-8859-1?q?M=E9tras?=) Date: Fri, 06 Jul 2007 11:15:04 -0400 Subject: [PATCH] - Adds support for custom error pages in httpd Message-ID: <200707061115.04819.genepi@sympatico.ca> Package: busybox Version: svn revision 18994 Severity: wishlist Hello list, Here is a patch to add support for user defined error pages in httpd server. The syntax of httpd.conf file has been extended to let the user defined custom error pages. Lines of the format: ????????Ennn:path/error_nnn.html mean that for HTTP status nnn, the server will respond with the page path/error_nnn.html. Absolute and relative to `home_httpd` paths are supported, but error pages can't be CGI or scripts (too big a change to httpd.c to add this feature). Also, error pages definitions are only supported in the root config file. For instance, adding the following line ????????E404:e404.html to /etc/httpd.conf file displays the custom page /e404.html whenever a page is not found, instead of the terse message "404 Not Found". I have a linux router running X-wrt (www.x-wrt.org), so using httpd busybox. I have configured it to block ad servers with a procedure similar to the ones described here: http://www.debian-administration.org/articles/535. With this patch of httpd, I could replace all the ads in a web page by a custom page or a small image, instead of getting a "404 Not Found" text. $ make bloatcheck ... function ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? old ? ? new ? delta parse_conf ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?1201 ? ?1436 ? ?+235 sendHeaders ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?461 ? ? 571 ? ?+110 sendFile ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 252 ? ? 317 ? ? +65 httpResponseNames ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?108 ? ? 144 ? ? +36 handleIncoming ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?2032 ? ?2038 ? ? ?+6 .rodata ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 138727 ?138663 ? ? -64 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/1 up/down: 452/-64) ? ? ? ? ? Total: 388 bytes ? ?text ? ?data ? ? bss ? ? dec ? ? hex filename ?636180 ? ?3124 ? 12800 ?652104 ? 9f348 busybox_old ?636589 ? ?3288 ? 12800 ?652677 ? 9f585 busybox_unstripped I have tested it in limited situations, so if others can test it and tell me if it works as they expected, it would be appreciated. By default, this configuration option is not enabled when compiling busybox. Last: this patch corrects also the last TODO in the httpd.c file, replacing a few lines of code by a call to sendfile. -- Pierre M?tras -------------- next part -------------- A non-text attachment was scrubbed... Name: httpd_with_error_pages.patch Type: text/x-diff Size: 10828 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070706/75e93f94/attachment-0002.bin From Ron.Jobmann at Asentria.com Fri Jul 6 15:57:21 2007 From: Ron.Jobmann at Asentria.com (Ron Jobmann) Date: Fri, 6 Jul 2007 08:57:21 -0700 Subject: How to compile in Snapgear distribution? Message-ID: Hi I'm using Snapgear 3.4.0, and it comes with an older version of Busybox (1.00 rc3?). What I'm trying to do is replace this with the latest download version (1.6.1). After making some config choices, I run a toplevel make. Busybox compiles, but has a problem. The system I'm cross-compiling for is an IXP420, xscale, big-endian. Busybox compiles as little endian. The original Busybox compiles and links correctly. I'm lost as to what to change. All the other user apps compile correctly so my toolset is setup right. If I start tweaking settings in the Busybox makefile I can get it to compile big endian but it still wants to link little-endian so it errors out. Is there some 'standard' process on how to plugin new Busybox versions where old ones previously build? ______________________________________ Ron Jobmann Porting/Integration/Build Engineer Asentria Corporation 1200 N. 96TH ST Seattle, WA 98103-3310 http://www.asentria.com (206) 344-8800 ex: 120 / Fax: (206) 344-2116 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.busybox.net/pipermail/busybox/attachments/20070706/0d6c4a0c/attachment-0002.htm From strange at nsk.no-ip.org Fri Jul 6 14:16:41 2007 From: strange at nsk.no-ip.org (Luciano Rocha) Date: Fri, 6 Jul 2007 15:16:41 +0100 Subject: busybox and shared library In-Reply-To: References: Message-ID: <20070706141641.GA29815@bit.office.eurotux.com> On Fri, Jul 06, 2007 at 04:00:22PM +0200, Miroslaw Dach wrote: > Dear All, > > I am using for same time busybox. In the lib directory I have big > number of libraries and I wanted to narrow them to the necessary set. > > I have launched the command below to determine the shared libraries the > busy box depend on: > powerpc-405-linux-gnu-readelf -a bin/busybox | grep -i "shared" You can use any readelf command, not necessarily the one for the target system. And you're missing the interpreters. I use: 1. libraries: readelf -d $file | sed -ne '/library/s,.*\[\(.*\)\].*,\1,p' 2. interpreter: readelf -l $file | sed -ne '/interpreter/{s,^[^/]*/,/,;s,].*,,;p}' > My lib directory looks like that: > -rwxr-xr-x 1 root root 1576651 Jul 6 15:27 libc-2.3.2.so > -rwxr-xr-x 1 root root 29422 Jul 6 15:32 libcrypt-2.3.2.so > lrwxrwxrwx 1 root root 13 Jul 6 15:32 libcrypt.so -> libcrypt.so.1 > lrwxrwxrwx 1 root root 17 Jul 6 15:32 libcrypt.so.1 -> libcrypt-2.3.2.so > -rw-r--r-- 1 root root 193 Jul 6 15:28 libc.so > lrwxrwxrwx 1 root root 13 Jul 6 15:28 libc.so.6 -> libc-2.3.2.so > lrwxrwxrwx 1 root root 13 Jul 6 15:49 libgcc_s.so -> libgcc_s.so.1 > -rw-r--r-- 1 root root 338539 Jul 6 15:48 libgcc_s.so.1 > -rwxr-xr-x 1 root root 925590 Jul 6 15:30 libm-2.3.2.so > lrwxrwxrwx 1 root root 9 Jul 6 15:31 libm.so -> libm.so.6 > lrwxrwxrwx 1 root root 13 Jul 6 15:30 libm.so.6 -> libm-2.3.2.so Yep, no ld-linux.so.2 -- lfr 0/0 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070706/01cb1fc8/attachment-0002.pgp From vda.linux at googlemail.com Fri Jul 6 16:22:25 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 6 Jul 2007 18:22:25 +0200 Subject: ash ignors somtimes commands In-Reply-To: References: Message-ID: <200707061822.25440.vda.linux@googlemail.com> On Friday 06 July 2007 12:45, Miroslaw Dach wrote: > Hi All, > > My observation is that the symptom I described before happens let > say once per 200 times. > > Maybe it is somehow related to the terminal under windows which I > currently use. I tend to agree with Paul Fox , who pointed out that you may have several processes reading your input, and somtimes that "other process" eats the line, not ash. > > Can you add debugging outputs in ash.c in cmdloop function, like > > bb_error_msg("I am before parsecmd()"); bb_error_msg("I am after parsecmd()"); > > bb_error_msg("I am before evaltree()"); etc, and get more info about > > this weird behavior? Idf you will do what I described above, you can prove (or disprove) Paul's idea (if you type a commnd and dont see "I am after parsecmd()" appearing, your input definitely did not reach ash.) > > static int > > cmdloop(int top) > > { > > union node *n; > > struct stackmark smark; > > int inter; > > int numeof = 0; > > > > TRACE(("cmdloop(%d) called\n", top)); > > for (;;) { > > int skip; > > > > setstackmark(&smark); > > #if JOBS > > if (jobctl) > > showjobs(stderr, SHOW_CHANGED); > > #endif > > inter = 0; > > if (iflag && top) { > > inter++; > > #if ENABLE_ASH_MAIL > > chkmail(); > > #endif > > } > > n = parsecmd(inter); > > /* showtree(n); DEBUG */ > > if (n == NEOF) { > > if (!top || numeof >= 50) > > break; > > if (!stoppedjobs()) { > > if (!Iflag) > > break; > > out2str("\nUse \"exit\" to leave shell.\n"); > > } > > numeof++; > > } else if (nflag == 0) { > > job_warning = (job_warning == 2) ? 1 : 0; > > numeof = 0; > > evaltree(n, 0); > > } > > popstackmark(&smark); > > skip = evalskip; > > > > if (skip) { > > evalskip = 0; > > return skip & SKIPEVAL; > > } > > } > > return 0; > > } > > -- vda From vda.linux at googlemail.com Fri Jul 6 16:51:26 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 6 Jul 2007 18:51:26 +0200 Subject: macro used without args In-Reply-To: <387452.44065.qm@web30214.mail.mud.yahoo.com> References: <387452.44065.qm@web30214.mail.mud.yahoo.com> Message-ID: <200707061851.26681.vda.linux@googlemail.com> On Friday 06 July 2007 07:42, simon lao wrote: > Hi, > when I compile the busybox and had error message: > macro 'xstrtou' used without args. I used cross > compiler GCC 2.95. Do I need to update the toolchain ? Yes. There was similar posting from another user. I'm afraid bbox + gcc 2.x is not going to work. -- vda From vda.linux at googlemail.com Fri Jul 6 16:53:44 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 6 Jul 2007 18:53:44 +0200 Subject: [patch][Bug] sed can not be used because of wrong applet.h In-Reply-To: <20070706120954.DED5.YNAKAM@hitachisoft.jp> References: <20070706120954.DED5.YNAKAM@hitachisoft.jp> Message-ID: <200707061853.45025.vda.linux@googlemail.com> On Friday 06 July 2007 06:09, Yuichi Nakamura wrote: > Hi. > > I found sed can not be used when built with SELinux support. > I saw applet.h and found wrong point. > Here is a fix. Thanks, applied to svn. -- vda From vapier at gentoo.org Fri Jul 6 16:58:21 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Fri, 6 Jul 2007 12:58:21 -0400 Subject: How to compile in Snapgear distribution? In-Reply-To: References: Message-ID: <200707061258.22625.vapier@gentoo.org> On Friday 06 July 2007, Ron Jobmann wrote: > I'm using Snapgear 3.4.0, and it comes with an older version of Busybox > (1.00 rc3?). What I'm trying to do is replace this with the latest > download version (1.6.1). please refer to the uClinux-dist mailing list ... they have already done this -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://lists.busybox.net/pipermail/busybox/attachments/20070706/87d10010/attachment-0002.pgp From vapier at gentoo.org Fri Jul 6 17:00:48 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Fri, 6 Jul 2007 13:00:48 -0400 Subject: macro used without args In-Reply-To: <200707061851.26681.vda.linux@googlemail.com> References: <387452.44065.qm@web30214.mail.mud.yahoo.com> <200707061851.26681.vda.linux@googlemail.com> Message-ID: <200707061300.49647.vapier@gentoo.org> On Friday 06 July 2007, Denis Vlasenko wrote: > On Friday 06 July 2007 07:42, simon lao wrote: > > when I compile the busybox and had error message: > > macro 'xstrtou' used without args. I used cross > > compiler GCC 2.95. Do I need to update the toolchain ? > > Yes. There was similar posting from another user. > I'm afraid bbox + gcc 2.x is not going to work. should we go as far as checking __GNUC__ defines in the headers and emitting #warning/#error for < 3 ? -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://lists.busybox.net/pipermail/busybox/attachments/20070706/4685d5c6/attachment-0002.pgp From pgf at brightstareng.com Fri Jul 6 17:04:15 2007 From: pgf at brightstareng.com (Paul Fox) Date: Fri, 06 Jul 2007 13:04:15 -0400 Subject: macro used without args In-Reply-To: vapier's message of Fri, 06 Jul 2007 13:00:48 -0400. <200707061300.49647.vapier@gentoo.org> Message-ID: <30219.1183741455@brightstareng.com> vapier wrote: > On Friday 06 July 2007, Denis Vlasenko wrote: > > On Friday 06 July 2007 07:42, simon lao wrote: > > > when I compile the busybox and had error message: > > > macro 'xstrtou' used without args. I used cross > > > compiler GCC 2.95. Do I need to update the toolchain ? > > > > Yes. There was similar posting from another user. > > I'm afraid bbox + gcc 2.x is not going to work. > > should we go as far as checking __GNUC__ defines in the > headers and emitting #warning/#error for < 3 ? in my opinion, yes. there are still a lot of old toolchains floating around in tarballs out there. much better to fail early. (and if we know it will fail, it should be #error.) paul =--------------------- paul fox, pgf at brightstareng.com From vda.linux at googlemail.com Fri Jul 6 17:09:37 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 6 Jul 2007 19:09:37 +0200 Subject: How to change the Timezone In-Reply-To: <9709bd390707060520h31c9be6epcee5c13b4b7526dc@mail.gmail.com> References: <9709bd390707060520h31c9be6epcee5c13b4b7526dc@mail.gmail.com> Message-ID: <200707061909.37818.vda.linux@googlemail.com> On Friday 06 July 2007 14:20, Alberto Donato wrote: > Hi, > to have system-wide timezone configuration you need zoneinfo files > from libc. They are usually installed under /usr/share/zoneinfo. > > You can create a link in /etc/timezone to the correct file under this tree. This is true only for glibc. For uclibc, you need to edit /etc/TZ (or set TZ env var). On my system /etc/TZ contains one line: "CET-1CEST-2" -- vda From Jlau at extremenetworks.com Fri Jul 6 17:45:54 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Fri, 6 Jul 2007 10:45:54 -0700 Subject: upper case filename Message-ID: <888459D4AEE6464381B30398101F42F8043FC303@sc-msexch-06.extremenetworks.com> On BB 1.6.0, when I did "mkdir TMP", it created "tmp" instead of "TMP". Similary problem with tar cvf TAR ./*, it created tar instead of TAR. Can someone tell me who to configure BB 1.6.0 to obey the upper case input from the user? Thanks! -Joe From strange at nsk.no-ip.org Fri Jul 6 18:52:02 2007 From: strange at nsk.no-ip.org (Luciano Rocha) Date: Fri, 6 Jul 2007 19:52:02 +0100 Subject: upper case filename In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC303@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC303@sc-msexch-06.extremenetworks.com> Message-ID: <20070706185202.GA4048@bit.office.eurotux.com> On Fri, Jul 06, 2007 at 10:45:54AM -0700, Joe Lau wrote: > > On BB 1.6.0, when I did "mkdir TMP", it created "tmp" instead of "TMP". > Similary problem with tar cvf TAR ./*, it created tar instead of TAR. > Can someone tell me who to configure BB 1.6.0 to obey the upper case input > from the user? Under which filesystem? FAT and family automagically convert all short uppercase names to lowercase. Related option for mounting vfat filesystem: shortname=[lower|win95|winnt|mixed] Try mixed. -- lfr 0/0 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070706/94bef866/attachment-0002.pgp From simon_laoc at yahoo.com Fri Jul 6 18:55:13 2007 From: simon_laoc at yahoo.com (simon lao) Date: Fri, 6 Jul 2007 11:55:13 -0700 (PDT) Subject: adding symbolic link command Message-ID: <399143.1207.qm@web30213.mail.mud.yahoo.com> Hi, I have configured the ash shell in my busybox but somehow when I do "busybox chroot" command it will looks for "sh" command. I did ln -s ash sh and still did not work. The busybox report "sh:applet not found". How can I add the "sh" command as defined function in the busybox ? simon ____________________________________________________________________________________ We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list. http://tv.yahoo.com/collections/265 From vda.linux at googlemail.com Fri Jul 6 20:33:58 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 6 Jul 2007 22:33:58 +0200 Subject: I will be unavailable for approximately a week Message-ID: <200707062233.58862.vda.linux@googlemail.com> Hi, Please be informed that I am about to move and I won't be able to regularly read mailing list and apply patches to svn for some time. I estimate it will tak a week or so. Apologies for any recent patches which were not applied/reviewed. Please resend them later. -- vda From rossbeazley at lycos.co.uk Fri Jul 6 20:32:56 2007 From: rossbeazley at lycos.co.uk (ross beazley) Date: Fri, 6 Jul 2007 20:32:56 +0000 Subject: df, mount and tmpfs - no disk usage stats Message-ID: <18353636447532@lycos-europe.com> Hi, im not sure this is the correct place to post as it could be some other system issue. I am trying to build an embedded system using busybox as the core of the server. I am not building against uclibc but the normal glibc (version 2.3.6). The problem I am having is with a tmpfs not showing how much free space there is, or infact how much space is used. I have a printer spool directory mounted there (its a samba print server), but its not working because the df check is failing :-/ Iam using a 2.6.16.27 kernel and version 1.5.0 of busybox. Ive been googling to death for the last few days but cant find any hint as to what may be the problem. Ive mounted the tmpfs with a size option. The root fs is a squashfs and is monted in an initramfs and switch_rooted into. I need to use tmpfs as the writable parts of the system No tmpfs is mounted during the initramfs stage. I am able to write stuff into the tmpfs mounts. I dont really know where to start, from what i have seen in other busybox posts tmpfs is showing disk usage stats.... I must be doing something mega stoopid that ive totally overlooked it HELP! :) Ross Lycos email has 300 Megabytes of free storage... Get it now at mail.lycos.co.uk From natanael.copa at gmail.com Sat Jul 7 07:20:14 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Sat, 07 Jul 2007 09:20:14 +0200 Subject: Probably a bug in ash In-Reply-To: <20070706171028.22f53b94.sbb@tuxfamily.org> References: <468D2284.9070707@bfs.de> <7931.1183655912@brightstareng.com> <20070706171028.22f53b94.sbb@tuxfamily.org> Message-ID: <1183792814.5818.100.camel@localhost> On Fri, 2007-07-06 at 17:10 +0200, Seb wrote: > Le Thu, 05 Jul 2007 13:18:32 -0400 > Paul Fox a ?crit: > > > wh wrote: > > > Hi seb, > > > yes the mail was received but noone had time sofar to > > > investigate the problem > > > > further info: > > whoever takes a look at this; the problem is even worse than > > originally described. piping the output of "jobs" loses the > > output entirely, while piping the output of "jobs %1" causes an > > erroneous error message. > > > > BusyBox v1.7.0.svn (2007-07-05 13:13:46 EDT) built-in shell (ash) > > Enter 'help' for a list of built-in commands. > > > > $ sleep 3600 & > > $ sleep 700 > > (typed ^Z here) > > [2] + Stopped sleep 700 > > $ jobs > > [2] + Stopped sleep 700 > > [1] - Running sleep 3600 > > (two jobs) > > $ jobs | cat > > $ jobs | tr a-z A-Z > > (note missing output) [..] > Ok, I just wanted to be sure. Thanks for the confirmation and the > additionnal informations. :) > > Do you think I should also make a parallel bug report to dash ? (it's > not to put you under pressure -- I well see you have many other things > to fix here and this bug can wait -- but just to try to be more "useful" > without bothering you nor being unpolite). I tested on dash and yes, the bug is there too. Reporting it to dash sounds like a good idea. Natanael Copa From natanael.copa at gmail.com Sat Jul 7 07:24:12 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Sat, 07 Jul 2007 09:24:12 +0200 Subject: df, mount and tmpfs - no disk usage stats In-Reply-To: <18353636447532@lycos-europe.com> References: <18353636447532@lycos-europe.com> Message-ID: <1183793052.5818.103.camel@localhost> On Fri, 2007-07-06 at 20:32 +0000, ross beazley wrote: > Hi, > > im not sure this is the correct place to post as it could be some > other system issue. I am trying to build an embedded system using > busybox as the core of the server. I am not building against uclibc > but the normal glibc (version 2.3.6). The problem I am having is with > a tmpfs not showing how much free space there is, or infact how much > space is used. I have a printer spool directory mounted there (its a > samba print server), but its not working because the df check is > failing :-/ > > Iam using a 2.6.16.27 kernel and version 1.5.0 of busybox. > > Ive been googling to death for the last few days but cant find any > hint as to what may be the problem. > > Ive mounted the tmpfs with a size option. > > The root fs is a squashfs and is monted in an initramfs and > switch_rooted into. > > I need to use tmpfs as the writable parts of the system > > No tmpfs is mounted during the initramfs stage. > > I am able to write stuff into the tmpfs mounts. > > I dont really know where to start, from what i have seen in other > busybox posts tmpfs is showing disk usage stats.... I run root as tmpfs on my uclibc/busybox distro. > I must be doing something mega stoopid that ive totally overlooked it > Is /etc/mtab support enabled in busybox? Is /proc is mounted? Try to create a symblink: ln -s /proc/mounts /etc/mtab Natanael From sbb at tuxfamily.org Sat Jul 7 16:55:23 2007 From: sbb at tuxfamily.org (Seb) Date: Sat, 7 Jul 2007 18:55:23 +0200 Subject: Probably a bug in ash In-Reply-To: <1183792814.5818.100.camel@localhost> References: <468D2284.9070707@bfs.de> <7931.1183655912@brightstareng.com> <20070706171028.22f53b94.sbb@tuxfamily.org> <1183792814.5818.100.camel@localhost> Message-ID: <20070707185523.6a677e37.sbb@tuxfamily.org> Le Sat, 07 Jul 2007 09:20:14 +0200 Natanael Copa a ?crit: > On Fri, 2007-07-06 at 17:10 +0200, Seb wrote: > > Le Thu, 05 Jul 2007 13:18:32 -0400 > > Paul Fox a ?crit: > > > > > wh wrote: > > > > Hi seb, > > > > yes the mail was received but noone had time sofar to > > > > investigate the problem > > > > > > further info: > > > whoever takes a look at this; the problem is even worse than > > > originally described. piping the output of "jobs" loses the > > > output entirely, while piping the output of "jobs %1" causes an > > > erroneous error message. > > [..] > > > Ok, I just wanted to be sure. Thanks for the confirmation and the > > additionnal informations. :) > > > > Do you think I should also make a parallel bug report to dash ? (it's > > not to put you under pressure -- I well see you have many other things > > to fix here and this bug can wait -- but just to try to be more "useful" > > without bothering you nor being unpolite). > > I tested on dash and yes, the bug is there too. Reporting it to dash > sounds like a good idea. > > Natanael Copa > If comparison between shells can help you, the additionnal misfunction raised doesn't appear with the ash shell of the Slackware, the output is just lost "as usual". If someone looks for this ash shell, it can be found here : http://ftp.belnet.be/packages/slackware/slackware-12.0/source/ap/ash/ Otherwise, I confirm "jobs %1" raises an error with dash. In attachment the testing script augmented with the new case. I will try to contact the dash maintainer(s), does somebody know if it's now a part of the Debian project (there is a debian maintainer for the package), the home of the project seems to have recorded no changes since 2005 : http://gondor.apana.org.au/~herbert/dash/ ++ Seb. -------------- next part -------------- A non-text attachment was scrubbed... Name: ashjbtest2.sh Type: application/octet-stream Size: 408 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070707/95498361/attachment-0002.obj From dallas.a.clement at gmail.com Sat Jul 7 21:34:35 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Sat, 07 Jul 2007 16:34:35 -0500 Subject: Problem with ash -n non-zero length string test Message-ID: <1183844075.3382.22.camel@localhost> Hello All, I'm experiencing some weird things when trying to use -n to test for a non-empty string as in the following example. boot_drive_name="" if [ -n $boot_drive_name ]; then retval=0 else echo "Could not determine boot drive name." fi To my surprise, this condition evaluates true and I do not see my echo message. However, if I use the -z test, with the following logic, I do see my echo message. boot_drive_name="" if [ -z $boot_drive_name ]; then echo "Could not determine boot drive name." else retval=0 fi I'm not sure if -n does not work 100 percent of the time in all cases or if it is an erratic problem that only happens under certain conditions. I have seen it fail in several different logic scenarios. Has anyone else observed this? Am I doing something wrong? I'm seeing this on busybox 1.6.0 From vapier at gentoo.org Sat Jul 7 21:58:20 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Sat, 7 Jul 2007 17:58:20 -0400 Subject: Problem with ash -n non-zero length string test In-Reply-To: <1183844075.3382.22.camel@localhost> References: <1183844075.3382.22.camel@localhost> Message-ID: <200707071758.20792.vapier@gentoo.org> On Saturday 07 July 2007, Dallas Clement wrote: > I'm experiencing some weird things when trying to use -n to test for a > non-empty string as in the following example. > > boot_drive_name="" > > if [ -n $boot_drive_name ]; then you need to make sure you quote things as this will be fragile regardless of the shell [ -n "$some_var" ] [ -z "$some_var" ] -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://lists.busybox.net/pipermail/busybox/attachments/20070707/4d294252/attachment-0002.pgp From dallas.a.clement at gmail.com Sat Jul 7 22:09:21 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Sat, 07 Jul 2007 17:09:21 -0500 Subject: Problem with ash -n non-zero length string test In-Reply-To: <200707072344.30692.yann.morin.1998@anciens.enib.fr> References: <1183844075.3382.22.camel@localhost> <200707072344.30692.yann.morin.1998@anciens.enib.fr> Message-ID: <1183846161.3382.25.camel@localhost> On Sat, 2007-07-07 at 23:44 +0200, Yann E. MORIN wrote: > Hello Dallas, > Hello all, > > On Saturday 07 July 2007 23:34, Dallas Clement wrote: > > if [ -n $boot_drive_name ]; then > > retval=0 > > else > > echo "Could not determine boot drive name." > > fi > > I'd suggest either one of: > - enclose the variable between double quotes: "$boot_drive_name" > - use this: [ x$boot_drive_name = x ] > > I would also enclose the variable b=name between curly brackets: > "${boot_drive_name}" > > I would personnally use: > > if [ -z "${boot_drive_name}" ]; then > do_error_out > exit 1 > fi > do_something_usefull > > Regards, > Yann E. MORIN. > Thank you Yann & Mike: The -n check works when the variable is enclosed in double quotes! :0 Regards, Dallas From Jlau at extremenetworks.com Sat Jul 7 23:20:10 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Sat, 7 Jul 2007 16:20:10 -0700 Subject: string comparison in BB 1.6.0 sh Message-ID: <888459D4AEE6464381B30398101F42F8043FC30A@sc-msexch-06.extremenetworks.com> On BB 1.6.0, /scratch # if [ "abc" != "def" ]; then > echo "string comparison works" > fi string comparison works /scratch # if [ ! "abc" = "def" ]; then > echo "string comparison works" > fi Note: I didn't see my echo here. On BB 1.0, /scratch # if [ "abc" != "def" ]; then > echo "string comparision works" > fi string comparision works /scratch # if [ ! "abc" = "def" ]; then > echo "string comparision works" > fi string comparision works Any clue why BB 1.6.0 sh behave this way? Thanks! -Joe From yann.morin.1998 at anciens.enib.fr Sat Jul 7 21:44:30 2007 From: yann.morin.1998 at anciens.enib.fr (Yann E. MORIN) Date: Sat, 7 Jul 2007 23:44:30 +0200 Subject: Problem with ash -n non-zero length string test In-Reply-To: <1183844075.3382.22.camel@localhost> References: <1183844075.3382.22.camel@localhost> Message-ID: <200707072344.30692.yann.morin.1998@anciens.enib.fr> Hello Dallas, Hello all, On Saturday 07 July 2007 23:34, Dallas Clement wrote: > if [ -n $boot_drive_name ]; then > retval=0 > else > echo "Could not determine boot drive name." > fi I'd suggest either one of: - enclose the variable between double quotes: "$boot_drive_name" - use this: [ x$boot_drive_name = x ] I would also enclose the variable b=name between curly brackets: "${boot_drive_name}" I would personnally use: if [ -z "${boot_drive_name}" ]; then do_error_out exit 1 fi do_something_usefull Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +0/33 662376056 | Software Designer | \ / CAMPAIGN | ^ | | --==< ?_? >==-- ?------------.-------: X AGAINST | /e\ There is no | | http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL | """ conspiracy. | ?------------------------------?-------?------------------?--------------------? From vapier at gentoo.org Sun Jul 8 00:08:17 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Sat, 7 Jul 2007 20:08:17 -0400 Subject: Problem with ash -n non-zero length string test In-Reply-To: <200707072344.30692.yann.morin.1998@anciens.enib.fr> References: <1183844075.3382.22.camel@localhost> <200707072344.30692.yann.morin.1998@anciens.enib.fr> Message-ID: <200707072008.18456.vapier@gentoo.org> On Saturday 07 July 2007, Yann E. MORIN wrote: > - use this: [ x$boot_drive_name = x ] you would still need to quote $boot_drive_name to account for whitespace as you'll get an error otherwise also, this form: [ "x$foo" = x ] as a replacement for: [ -z "$foo" ] is common place only because of old broken shells which autotools supports ... personally i dont think it has any place when writing POSIX compliant code -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://lists.busybox.net/pipermail/busybox/attachments/20070707/875f91eb/attachment-0002.pgp From yann.morin.1998 at anciens.enib.fr Sun Jul 8 08:59:32 2007 From: yann.morin.1998 at anciens.enib.fr (Yann E. MORIN) Date: Sun, 8 Jul 2007 10:59:32 +0200 Subject: Problem with ash -n non-zero length string test In-Reply-To: <200707072008.18456.vapier@gentoo.org> References: <1183844075.3382.22.camel@localhost> <200707072344.30692.yann.morin.1998@anciens.enib.fr> <200707072008.18456.vapier@gentoo.org> Message-ID: <200707081059.32821.yann.morin.1998@anciens.enib.fr> On Sunday 08 July 2007 02:08, Mike Frysinger wrote: > On Saturday 07 July 2007, Yann E. MORIN wrote: > > - use this: [ x$boot_drive_name = x ] > you would still need to quote $boot_drive_name to account for whitespace as > you'll get an error otherwise Absolutely right. Was quite late here in France, and I promptly went to bed after this reply. I shouldn't reply so late in the night... :-) > also, this form: > [ "x$foo" = x ] That's what I was thinking of, of course... > as a replacement for: > [ -z "$foo" ] > is common place only because of old broken shells which autotools supports ... ... or this exactly same reason. > personally i dont think it has any place when writing POSIX compliant code I was thinking of "Education": "Know there are different syntax to achieve the same goal. Use the most fitted depending on your constraints." May be one time someone gets on a "broken" shell, and (s)he will remember he saw such reference when (s)he sees his/her scripts are failing there when they used to work previously. Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +0/33 662376056 | Software Designer | \ / CAMPAIGN | ^ | | --==< ?_? >==-- ?------------.-------: X AGAINST | /e\ There is no | | http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL | """ conspiracy. | ?------------------------------?-------?------------------?--------------------? From rep.dot.nop at gmail.com Sun Jul 8 10:38:49 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Sun, 8 Jul 2007 12:38:49 +0200 Subject: r18727 broke fdisk Message-ID: <20070708103849.GF4096@aon.at> vda, util-linux/fdisk.c: In function 'seek_sector': util-linux/fdisk.c:641: warning: implicit declaration of function 'lseek64' util-linux/fdisk.c:641: error: 'off64_t' undeclared (first use in this function) util-linux/fdisk.c:641: error: (Each undeclared identifier is reported only once util-linux/fdisk.c:641: error: for each function it appears in.) util-linux/fdisk.c:641: error: expected ')' before 'secno' make[2]: *** [util-linux/fdisk.o] Error 1 make[1]: *** [util-linux] Error 2 If LFS is off, then there really is no lseek64. Please revert. From vapier at gentoo.org Mon Jul 9 00:24:30 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Sun, 8 Jul 2007 20:24:30 -0400 Subject: Problem with ash -n non-zero length string test In-Reply-To: <200707081059.32821.yann.morin.1998@anciens.enib.fr> References: <1183844075.3382.22.camel@localhost> <200707072008.18456.vapier@gentoo.org> <200707081059.32821.yann.morin.1998@anciens.enib.fr> Message-ID: <200707082024.30719.vapier@gentoo.org> On Sunday 08 July 2007, Yann E. MORIN wrote: > On Sunday 08 July 2007 02:08, Mike Frysinger wrote: > > personally i dont think it has any place when writing POSIX compliant > > code > > I was thinking of "Education": "Know there are different syntax to achieve > the same goal. Use the most fitted depending on your constraints." > May be one time someone gets on a "broken" shell, and (s)he will remember > he saw such reference when (s)he sees his/her scripts are failing there > when they used to work previously. fair enough ... different people have different goals. i'd take the position of just fixing the system/shell, but not everyone has that luxury. -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://lists.busybox.net/pipermail/busybox/attachments/20070708/1ac860a5/attachment-0002.pgp From natanael.copa at gmail.com Mon Jul 9 12:46:52 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Mon, 09 Jul 2007 14:46:52 +0200 Subject: [PATCH] adduser is broken in 1.6.x Message-ID: <1183985212.29553.10.camel@localhost> Hi, adduser fails to create the user when ENABLE_FEATURE_CLEAN_UP is disabled. The reason is that adduser will exec passwd without first flushing the previously written /etc/passwd (and /etc/shadow). passwd will fail because the user does not exist until files are flushed. But the flush never comes because the buffered file handles are lost in the exec operation. Attatched patch fixes this. Natanael Copa -------------- next part -------------- A non-text attachment was scrubbed... Name: busybox-1.6.1-adduser.patch Type: text/x-patch Size: 502 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070709/4ab00b9d/attachment-0002.bin From miroslaw.dach at psi.ch Mon Jul 9 15:18:32 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Mon, 9 Jul 2007 17:18:32 +0200 (CEST) Subject: How to change the Timezone Message-ID: Hi Alberto, Thank you for the suggestion. I use glibc. I have copied across the zoneinfo directory contents ie. (iso3166.tab and zone.tab) under /etc/timezone. I have setup the time zone according to the file zone.tab TZ=Europe/Zurich Next I have started the ntpd but I still see the time difference of 2 hours (ie, UTC time instead of the new time zone). Any Idea? Best Regards Mirek -- ============================================================================= Miroslaw Dach (Miroslaw.Dach at psi.ch) - SLS/Controls Group PSI - Paul Scherrer Institut CH-5232 Villigen ============================================================================= From vapier at gentoo.org Mon Jul 9 20:35:04 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Mon, 9 Jul 2007 16:35:04 -0400 Subject: How to change the Timezone In-Reply-To: References: Message-ID: <200707091635.04632.vapier@gentoo.org> On Monday 09 July 2007, Miroslaw Dach wrote: > Thank you for the suggestion. I use glibc. I have copied across > the zoneinfo directory contents ie. (iso3166.tab and zone.tab) under > /etc/timezone. I have setup the time zone according to the file zone.tab > TZ=Europe/Zurich > > Next I have started the ntpd but I still see the time difference of 2 hours > (ie, UTC time instead of the new time zone). considering this isnt a busybox issue, perhaps you should go ask on a glibc list or read the glibc manual -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://lists.busybox.net/pipermail/busybox/attachments/20070709/f27e5bb1/attachment-0002.pgp From Ron.Jobmann at Asentria.com Mon Jul 9 22:55:01 2007 From: Ron.Jobmann at Asentria.com (Ron Jobmann) Date: Mon, 9 Jul 2007 15:55:01 -0700 Subject: Busybox build configuration Message-ID: I was earlier having problems building Busybox 1.6.1 for my embedded system, but got the endian problem figured out. However, now that the executables have been built they won't run. Using readelf, I discovered that busybox is using the host/build system glibc and not the target Snapgear distribution's uClibc that everything else uses. Is there some place to set this? A flag or switch or something? ______________________________________ Ron Jobmann Porting/Integration/Build Engineer Asentria Corporation 1200 N. 96TH ST Seattle, WA 98103-3310 http://www.asentria.com (206) 344-8800 ex: 120 / Fax: (206) 344-2116 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.busybox.net/pipermail/busybox/attachments/20070709/713ad6b3/attachment-0002.htm From Nikolay.Yevik at Halliburton.com Mon Jul 9 23:18:27 2007 From: Nikolay.Yevik at Halliburton.com (Nikolay Yevik) Date: Mon, 9 Jul 2007 18:18:27 -0500 Subject: Busybox build configuration In-Reply-To: References: Message-ID: <3FA34846740FF448A01F5B48A52C014F03F4F765@HOUEXCH078.corp.halliburton.com> I have compiled BusyBox 1.7.0 dynamically linking it against uClibc using SnapGear 2.0 toolchain and incorporated into the same SnapGear distro. If I remember correctly I had to set CROSS_COMPILE = "arm-linux-" UCLIBC_DIR=../../uClibc UCFRONT="../../tools/ucfront-gcc" CC = $(UCFRONT) $(CROSS_COMPILE)gcc CPP = $(UCFRONT) $(CC) -E all this is the BusyBox main directory Makefile. Also, you might want to try to hardcode it in ucfront.c - by setting default type for libtype structure as LIBTYPE_UCLIBC. This should not be necessary, just setting above variables in SnapGear Makefile worked for me. ________________________________ From: busybox-bounces at busybox.net [mailto:busybox-bounces at busybox.net] On Behalf Of Ron Jobmann Sent: Monday, July 09, 2007 5:55 PM To: busybox at busybox.net Subject: Busybox build configuration I was earlier having problems building Busybox 1.6.1 for my embedded system, but got the endian problem figured out. However, now that the executables have been built they won't run. Using readelf, I discovered that busybox is using the host/build system glibc and not the target Snapgear distribution's uClibc that everything else uses. Is there some place to set this? A flag or switch or something? ______________________________________ Ron Jobmann Porting/Integration/Build Engineer Asentria Corporation 1200 N. 96TH ST Seattle, WA 98103-3310 http://www.asentria.com (206) 344-8800 ex: 120 / Fax: (206) 344-2116 ---------------------------------------------------------------------- This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.busybox.net/pipermail/busybox/attachments/20070709/114ef0b5/attachment-0002.htm From dallas.a.clement at gmail.com Mon Jul 9 19:22:31 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Mon, 09 Jul 2007 14:22:31 -0500 Subject: dpkg-deb vs. dpkg Message-ID: <1184008951.3459.13.camel@localhost> Hi All, Can somebody tell me what the difference is between these two commands? I'm assuming both should work with a .deb package... Thanks, Dallas Clement From psmith at netezza.com Tue Jul 10 00:36:10 2007 From: psmith at netezza.com (Paul Smith) Date: Mon, 09 Jul 2007 20:36:10 -0400 Subject: dpkg-deb vs. dpkg In-Reply-To: <1184008951.3459.13.camel@localhost> References: <1184008951.3459.13.camel@localhost> Message-ID: <1184027770.29268.3.camel@homebase.localnet> On Mon, 2007-07-09 at 14:22 -0500, Dallas Clement wrote: > Can somebody tell me what the difference is between these two commands? > > I'm assuming both should work with a .deb package... The man page sez: dpkg-deb packs, unpacks and provides information about Debian archives. Use dpkg to install and remove packages from your system. You can also invoke dpkg-deb by calling dpkg with whatever options you want to pass to dpkg-deb. dpkg will spot that you wanted dpkg-deb and run it for you. In general dpkg deals with the database of packages that are already installed on the system, including installing/uninstalling, and dpkg-deb manipulates .deb packages (builds them, lists their contents, etc.) HTH! From miroslaw.dach at psi.ch Tue Jul 10 07:34:35 2007 From: miroslaw.dach at psi.ch (Miroslaw Dach) Date: Tue, 10 Jul 2007 09:34:35 +0200 (CEST) Subject: How to change the Timezone In-Reply-To: <200707091635.04632.vapier@gentoo.org> Message-ID: Thank you for all the hints. Below I enclose steps I did and what works for me: All is described here in great details: http://www.linux-watch.com/news/NS6300294422.html The steps I did are described below: 1. Download the tar file which contains the configurations data of every time zone (the name can change with time tzdata2007f.tar.gz so maybe it is better first to see what the server contains ) wget ftp://elsie.nci.nih.gov/pub/tzdata2007f.tar.gz 2. Untar the package tar zxvf tzdata2007f.tar.gz 3. Compile the config data for certain area. The compiled files will be stored in the directory after -d option (in my case zoneinfo1). Launch zic compiler on the host computer. /usr/sbin/zic -d zoneinfo1 europe 4. Install the time zone data on the remote computer cp zoneinfo1/CET /etc/. ln -s /etc/CET /etc/localtime Best Regards Mirek On Mon, 9 Jul 2007, Mike Frysinger wrote: > On Monday 09 July 2007, Miroslaw Dach wrote: > > Thank you for the suggestion. I use glibc. I have copied across > > the zoneinfo directory contents ie. (iso3166.tab and zone.tab) under > > /etc/timezone. I have setup the time zone according to the file zone.tab > > TZ=Europe/Zurich > > > > Next I have started the ntpd but I still see the time difference of 2 hours > > (ie, UTC time instead of the new time zone). > > considering this isnt a busybox issue, perhaps you should go ask on a glibc > list or read the glibc manual > -mike > -- ============================================================================= Miroslaw Dach (Miroslaw.Dach at psi.ch) - SLS/Controls Group PSI - Paul Scherrer Institut CH-5232 Villigen ============================================================================= From rep.dot.nop at gmail.com Tue Jul 10 11:33:48 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Tue, 10 Jul 2007 13:33:48 +0200 Subject: Busybox build configuration In-Reply-To: References: Message-ID: <20070710113348.GA32138@aon.at> On Mon, Jul 09, 2007 at 03:55:01PM -0700, Ron Jobmann wrote: >I was earlier having problems building Busybox 1.6.1 for my embedded >system, but got the endian problem figured out. However, now that the >executables have been built they won't run. Using readelf, I discovered >that busybox is using the host/build system glibc and not the target >Snapgear distribution's uClibc that everything else uses. > >Is there some place to set this? A flag or switch or something? Sure. See $(BUSYBOX_DIR)/busybox: in http://buildroot.uclibc.org/cgi-bin/viewcvs.cgi/*checkout*/trunk/buildroot/package/busybox/busybox.mk?rev=19032 or http://busybox.net/FAQ.html#build for that matter From farmatito at tiscali.it Tue Jul 10 21:57:14 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 10 Jul 2007 23:57:14 +0200 Subject: [PATCH 1/7] bb_ioctl implementation Message-ID: <200707102357.14583.farmatito@tiscali.it> Hi, this series of 7 patches is a first attempt to add an ioctl api to libbb and to use it in all applets where: if ( ioctl() < 0 [!= 0]) bb_perror_msg{and_die}(); or similar code is used. The new libbb functions are: int ioctl_or_vperror(int fd, int request, void *argp, const char *fmt,...); void ioctl_or_vperror_and_die(int fd, int request, void *argp, const char *fmt,...); These two functions can be called directly. #if ENABLE_IOCTL_HEX2STR_ERROR int bb_ioctl_or_warn(int fd, int request, void *argp, const char *ioctl_name); void bb_ioctl_or_die(int fd, int request, void *argp, const char *ioctl_name); #define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp,#request) #define ioctl_or_die(fd,request,argp) bb_ioctl_or_die(fd,request,argp,#request) #else int bb_ioctl_or_warn(int fd, int request, void *argp); void bb_ioctl_or_die(int fd, int request, void *argp); #define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp) #define ioctl_or_die(fd,request,argp) bb_ioctl_or_die(fd,request,argp) #endif These functions should not be called directly, instead: ioctl_or_warn(fd,request,argp); ioctl_or_die(fd,request,argp); should be used, thus allowing to change the number of args passed to them by enabling/disabling the CONFIG_IOCTL_HEX2STR_ERROR option. This option is located in: Busybox Settings ---> Busybox Library Tuning ---> [*] Use ioctl names rather than hex values in error messages This option by default is enabled so that busybox's behaviour is unchaged and the same as the current, For example error messages like this are displayed: deallocvt: VT_DISALLOCATE: Device or resource busy By disabling it the error message format will change to: deallocvt: ioctl 0x5608 failed: Device or resource busy After applying all the patches even with this config option enabled there will be a size reduction: scripts/bloat-o-meter busybox_old busybox_unstripped function old new delta process_dev 5283 5498 +215 ioctl_or_vperror - 54 +54 ioctl_or_vperror_and_die - 51 +51 bb_ioctl_or_warn - 47 +47 bb_ioctl_or_die - 39 +39 print_value_on_off - 33 +33 arp_main 2184 2198 +14 fdformat_main 575 585 +10 collect_int 114 123 +9 xsocket_type 124 129 +5 readcmd 1283 1288 +5 xselect 1501 1505 +4 mkfs_minix_main 3035 3038 +3 varunset 58 60 +2 process0_stdin 220 222 +2 changepath 178 180 +2 arping_main 2019 2020 +1 zcip_main 1714 1713 -1 flush_buffer_cache 78 77 -1 make_human_readable_str 220 218 -2 fsck_main 1911 1909 -2 xstrtoul_range_sfx 229 226 -3 xstrtoull_range_sfx 295 291 -4 telnet_main 1699 1695 -4 evalcommand 1132 1127 -5 setconsole_main 120 114 -6 ipaddr_list_or_flush 2665 2659 -6 if_readconf 179 173 -6 eject_main 146 140 -6 hwclock_main 504 497 -7 freeramdisk_main 86 79 -7 collect_fork 119 112 -7 collect_blk 474 467 -7 print_tunnel 749 741 -8 mt_main 295 287 -8 deallocvt_main 82 74 -8 vlock_main 634 625 -9 vconfig_main 351 342 -9 raidautorun_main 59 50 -9 nameif_main 670 661 -9 chvt_main 90 81 -9 setlogcons_main 92 82 -10 read_rtc 186 176 -10 dumpkmap_main 284 274 -10 do_get_ioctl 115 105 -10 do_del_ioctl 125 115 -10 do_add_ioctl 134 124 -10 setkeycodes_main 165 154 -11 ifconfig_main 1303 1292 -11 write_table 244 232 -12 getty_main 2514 2502 -12 catv_main 342 330 -12 ifaddrlist 394 381 -13 do_show 793 778 -15 do_iplink 1171 1156 -15 loadfont_main 495 479 -16 do_loadfont 191 174 -17 route_main 2220 2202 -18 ether_wake_main 747 728 -19 set_address 75 53 -22 fbset_main 2066 2043 -23 do_time 593 570 -23 xioctl 25 - -25 parse_args 1508 1482 -26 udhcp_read_interface 316 282 -34 bb_ioctl 45 - -45 bb_ioctl_alt 70 - -70 bb_ioctl_on_off 80 - -80 .rodata 123143 122791 -352 ------------------------------------------------------------------------------ (add/remove: 5/4 grow/shrink: 12/48 up/down: 496/-1074) Total: -578 bytes By disabling this option the size reduction is far bigger: root at localhost:~/Desktop/busybox.orig# scripts/bloat-o-meter busybox_old busybox_unstripped function old new delta ioctl_or_vperror - 54 +54 ioctl_or_vperror_and_die - 51 +51 bb_ioctl_or_warn - 47 +47 bb_ioctl_or_die - 39 +39 print_value_on_off - 33 +33 collect_int 114 123 +9 arp_main 2184 2193 +9 readcmd 1283 1288 +5 xselect 1501 1505 +4 mkfs_minix_main 3035 3038 +3 process0_stdin 220 222 +2 fsck_main 1911 1909 -2 xstrtoul_range_sfx 229 226 -3 xstrtoull_range_sfx 295 291 -4 telnet_main 1699 1695 -4 arping_main 2019 2015 -4 evalcommand 1132 1127 -5 zcip_main 1714 1708 -6 eject_main 146 140 -6 process_dev 5283 5276 -7 freeramdisk_main 86 79 -7 mt_main 295 287 -8 vconfig_main 351 342 -9 nameif_main 670 661 -9 dumpkmap_main 284 274 -10 setkeycodes_main 165 154 -11 setconsole_main 120 109 -11 ipaddr_list_or_flush 2665 2654 -11 if_readconf 179 168 -11 write_table 244 232 -12 hwclock_main 504 492 -12 getty_main 2514 2502 -12 print_tunnel 749 736 -13 ifaddrlist 394 381 -13 deallocvt_main 82 69 -13 vlock_main 634 620 -14 raidautorun_main 59 45 -14 setlogcons_main 92 77 -15 read_rtc 186 171 -15 fdformat_main 575 560 -15 do_get_ioctl 115 100 -15 do_del_ioctl 125 110 -15 do_add_ioctl 134 119 -15 chvt_main 90 71 -19 do_show 793 773 -20 ether_wake_main 747 723 -24 xioctl 25 - -25 loadfont_main 495 469 -26 set_address 75 48 -27 do_loadfont 191 164 -27 do_time 593 565 -28 parse_args 1508 1477 -31 route_main 2220 2187 -33 fbset_main 2066 2033 -33 ifconfig_main 1303 1267 -36 do_iplink 1171 1131 -40 udhcp_read_interface 316 272 -44 bb_ioctl 45 - -45 bb_ioctl_alt 70 - -70 bb_ioctl_on_off 80 - -80 .rodata 123143 121863 -1280 ------------------------------------------------------------------------------ (add/remove: 5/4 grow/shrink: 6/46 up/down: 256/-2209) Total: -1953 bytes So the difference between enabling/disabling it is about: 1375 bytes. After applying patch n.1 the remaining patches could be applied in whatever order. The hdparm applet has a separate patch as it was the one with the greatest number of changes so that it needs more love and testing than the others. This patches are mostly only compiled tested. Critics, hints and help from the list is as always welcome. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_core.patch Type: text/x-diff Size: 3525 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070710/8df73d77/attachment-0002.bin From farmatito at tiscali.it Tue Jul 10 21:59:10 2007 From: farmatito at tiscali.it (Tito) Date: Tue, 10 Jul 2007 23:59:10 +0200 Subject: [PATCH 2/7] bb_ioctl implementation Message-ID: <200707102359.10673.farmatito@tiscali.it> This is the bb_ioctl patch for console-tools. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_console-tools.patch Type: text/x-diff Size: 3950 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070710/e587cf05/attachment-0002.bin From farmatito at tiscali.it Tue Jul 10 22:00:02 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 11 Jul 2007 00:00:02 +0200 Subject: [PATCH 3/7] bb_ioctl implementation Message-ID: <200707110000.02372.farmatito@tiscali.it> This is the bb_ioctl patch for loginutils. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_loginutils.patch Type: text/x-diff Size: 1066 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070711/eac2a4d9/attachment-0002.bin From farmatito at tiscali.it Tue Jul 10 22:00:32 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 11 Jul 2007 00:00:32 +0200 Subject: [PATCH 4/7] bb_ioctl implementation Message-ID: <200707110000.32545.farmatito@tiscali.it> This is the bb_ioctl patch for miscutils. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_miscutils.patch Type: text/x-diff Size: 3687 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070711/f384d685/attachment-0002.bin From farmatito at tiscali.it Tue Jul 10 22:01:08 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 11 Jul 2007 00:01:08 +0200 Subject: [PATCH 5/7] bb_ioctl implementation Message-ID: <200707110001.08690.farmatito@tiscali.it> This is the bb_ioctl patch for miscutils/hdparm. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_hdparm.patch Type: text/x-diff Size: 14824 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070711/8e3be56c/attachment-0002.bin From farmatito at tiscali.it Tue Jul 10 22:01:44 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 11 Jul 2007 00:01:44 +0200 Subject: [PATCH 6/7] bb_ioctl implementation Message-ID: <200707110001.45054.farmatito@tiscali.it> This is the bb_ioctl patch for networking. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_networking.patch Type: text/x-diff Size: 14443 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070711/1cbf618f/attachment-0002.bin From farmatito at tiscali.it Tue Jul 10 22:02:23 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 11 Jul 2007 00:02:23 +0200 Subject: [PATCH 7/7] bb_ioctl implementation Message-ID: <200707110002.23998.farmatito@tiscali.it> This is the bb_ioctl patch for util-linux. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_util_linux.patch Type: text/x-diff Size: 4526 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070711/0a36b00f/attachment-0002.bin From natanael.copa at gmail.com Wed Jul 11 07:02:05 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Wed, 11 Jul 2007 09:02:05 +0200 Subject: ash -l option? Message-ID: <1184137325.29553.52.camel@localhost> Hi, While trying to get my busybox/uClibc based distro run as a vserver i got the problem that there is no -l option to /bin/sh. I solved it by patching vserver scripts: --- data.orig/usr/lib/util-vserver/vserver.functions 2007-07-05 15:41:45 +0000 +++ data/usr/lib/util-vserver/vserver.functions 2007-07-10 22:54:08 +0000 @@ -207,7 +207,7 @@ test -n "$ENTER_SHELL" || { local i - for i in "/bin/bash -login" "/bin/sh -l" /bin/csh; do + for i in "/bin/bash -login" "/bin/ash --login" "/bin/sh -l" /bin/csh; do set -- $i test -x "$vdir/vdir/$1" || continue ENTER_SHELL=( "$@" ) I was wondering if there is intereste for a --login short option -l in busybox so patching util-vserver is not needed for busybox vservers? Natanael Copa From landau_alex at yahoo.com Wed Jul 11 11:48:52 2007 From: landau_alex at yahoo.com (Alex Landau) Date: Wed, 11 Jul 2007 04:48:52 -0700 (PDT) Subject: [PATCH 1/7] bb_ioctl implementation In-Reply-To: <200707102357.14583.farmatito@tiscali.it> Message-ID: <276626.20187.qm@web62508.mail.re1.yahoo.com> Tito wrote: Hi, this series of 7 patches is a first attempt to add an ioctl api to libbb and to use it in all applets where: if ( ioctl() < 0 [!= 0]) bb_perror_msg{and_die}(); or similar code is used. [snip] Critics, hints and help from the list is as always welcome. Ciao, Tito Hi, It looks really nice, only eye-tested though. One small comment: ioctl(...) != 0 doesn't mean it's an error. the ioctl() may return a positive value, so I'd better have an ioctl(...) < 0 test. Especially when you return ret afterwards. Regards, Alex --------------------------------- Don't get soaked. Take a quick peak at the forecast with theYahoo! Search weather shortcut. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.busybox.net/pipermail/busybox/attachments/20070711/0ce454be/attachment-0002.htm From marc.leeman at gmail.com Wed Jul 11 13:11:26 2007 From: marc.leeman at gmail.com (Marc Leeman) Date: Wed, 11 Jul 2007 15:11:26 +0200 Subject: devmem2 Message-ID: <20070711131126.GZ2660@chiana.homelinux.org> A patch to include a small program that reads from/to physical memory. Useful for e.g. tuning the processor register map after bootup. I put in util-linux. -- greetz, marc Is everybody aboard this ship kinkoid? Chiana - A Bug's Life chiana 2.6.18-4-ixp4xx #1 Tue Mar 27 18:01:56 BST 2007 GNU/Linux -------------- next part -------------- A non-text attachment was scrubbed... Name: devmem2.diff Type: text/x-diff Size: 5971 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070711/64129ef5/attachment-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.busybox.net/pipermail/busybox/attachments/20070711/64129ef5/attachment-0002.pgp From dallas.a.clement at gmail.com Wed Jul 11 09:46:41 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Wed, 11 Jul 2007 04:46:41 -0500 Subject: Difficulty with dpkg dependencies Message-ID: <1184147201.3305.18.camel@localhost> Hello All, I'm having some trouble installing a busybox debian package which I built on my Debian system. I previously built and installed a glibc binary debian package successfully. The busybox package installation is failing complaining that the libc6-i386 package which it depends on is not installed. It gives the following error: dpkg: package busybox depends on libc6-i386, which is not installed or flagged to be installed However, I know that libc6-i386 is installed. If I examine the contents of the dpkg 'status' file as follows I get the following: cat /var/lib/dpkg/status Package: libc6-i386 Version: 2.3.6 Section: libs Priority: optional Architecture: i386 Maintainer: Dallas Clement Description: The GNU C library The GNU C library is the standard C/C++ library \ needed to support most Linux applications. Status: install ok installed ---------------------- The following is the info for the glibc package which I built: dallas at debian:~/packages/glibc$ dpkg --info libc6-i386.deb new debian package, version 2.0. size 7129020 bytes: control archive= 328 bytes. 280 bytes, 11 lines control Package: libc6-i386 Version: 2.3.6 Section: libs Priority: optional Architecture: i386 Depends: Maintainer: Dallas Clement Description: The GNU C library The GNU C library is the standard C/C++ library \ needed to support most Linux applications. The following is the info for the busybox package which I built: dallas at debian:~/packages$ dpkg --info busybox_1.6.0-1_i386.deb new debian package, version 2.0. size 233752 bytes: control archive= 619 bytes. 444 bytes, 12 lines control 258 bytes, 4 lines md5sums Package: busybox Version: 1.6.0-1 Section: unknown Priority: extra Architecture: i386 Depends: libc6-i386 (>= 2.3.5-1) Installed-Size: 436 Maintainer: Dallas Clement Description: Busybox UNIX command utilities. BusyBox combines tiny versions of many common UNIX utilities into \ a single small executable. It provides replacements for most of the \ utilities you usually find in GNU fileutils, shellutils, etc. ---------------------- I could very likely be doing something wrong, but just not sure what it is. I don't see a reason for the dependency to fail. I'd sure appreciate any help. Regards, Dallas Clement From wharms at bfs.de Wed Jul 11 15:24:30 2007 From: wharms at bfs.de (walter harms) Date: Wed, 11 Jul 2007 17:24:30 +0200 Subject: How to change the Timezone In-Reply-To: <200707061909.37818.vda.linux@googlemail.com> References: <9709bd390707060520h31c9be6epcee5c13b4b7526dc@mail.gmail.com> <200707061909.37818.vda.linux@googlemail.com> Message-ID: <4694F62E.40006@bfs.de> perhaps this Question & Answer should go the the FAQ ? re, wh Denis Vlasenko wrote: > On Friday 06 July 2007 14:20, Alberto Donato wrote: >> Hi, >> to have system-wide timezone configuration you need zoneinfo files >> from libc. They are usually installed under /usr/share/zoneinfo. >> >> You can create a link in /etc/timezone to the correct file under this tree. > > This is true only for glibc. > > For uclibc, you need to edit /etc/TZ (or set TZ env var). > > On my system /etc/TZ contains one line: "CET-1CEST-2" > -- > vda > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From farmatito at tiscali.it Wed Jul 11 16:38:15 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 11 Jul 2007 18:38:15 +0200 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <276626.20187.qm@web62508.mail.re1.yahoo.com> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> Message-ID: <200707111838.15527.farmatito@tiscali.it> On Wednesday 11 July 2007 13:48:52 Alex Landau wrote: > > Tito wrote: Hi, > this series of 7 patches is a first attempt to add an ioctl api to libbb > and to use it in all applets where: > > if ( ioctl() < 0 [!= 0]) > bb_perror_msg{and_die}(); > > or similar code is used. > [snip] > > Critics, hints and help from the list is as always welcome. > > Ciao, > Tito > > Hi, > It looks really nice, only eye-tested though. > One small comment: ioctl(...) != 0 doesn't mean it's an error. the ioctl() may return a positive value, > so I'd better have an ioctl(...) < 0 test. Especially when you return ret afterwards. > Regards, > Alex > Hi, I know but i'm pretty sure that in all places in busybox where this test was used [ !=0 ] it errored out, i double checked it, but nonetheless maybe its a good idea to change it to [ < 0 ] to be more coherent with the original ioctl call. So attached is a fixed patch. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: bb_ioctl_core_02.patch Type: text/x-diff Size: 3519 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070711/7bea75b7/attachment-0002.bin From vapier at gentoo.org Wed Jul 11 19:15:59 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Wed, 11 Jul 2007 15:15:59 -0400 Subject: How to change the Timezone In-Reply-To: <4694F62E.40006@bfs.de> References: <200707061909.37818.vda.linux@googlemail.com> <4694F62E.40006@bfs.de> Message-ID: <200707111516.00391.vapier@gentoo.org> On Wednesday 11 July 2007, walter harms wrote: > perhaps this Question & Answer should go the the FAQ ? it isnt a busybox thing -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://lists.busybox.net/pipermail/busybox/attachments/20070711/415cf25a/attachment-0002.pgp From pclouds at gmail.com Wed Jul 11 19:54:58 2007 From: pclouds at gmail.com (Nguyen Thai Ngoc Duy) Date: Wed, 11 Jul 2007 15:54:58 -0400 Subject: [ash-bug] in shcmd function, space should be output to fp, not to stdout. Message-ID: Well, the subject says it all. -- Duy -------------- next part -------------- A non-text attachment was scrubbed... Name: busybox-1.6.1.patch Type: application/octet-stream Size: 613 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070711/7c68efa0/attachment-0002.obj From rep.dot.nop at gmail.com Wed Jul 11 22:06:24 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Thu, 12 Jul 2007 00:06:24 +0200 Subject: devmem2 In-Reply-To: <20070711131126.GZ2660@chiana.homelinux.org> References: <20070711131126.GZ2660@chiana.homelinux.org> Message-ID: <20070711220624.GZ4096@aon.at> On Wed, Jul 11, 2007 at 03:11:26PM +0200, Marc Leeman wrote: >A patch to include a small program that reads from/to physical memory. >Useful for e.g. tuning the processor register map after bootup. > >I put in util-linux. It isn't in the util-linux package, is it? Perhaps miscutils would be a better place. Generally it looks really whitespace damaged, run (from toplevel) indent */devmem2.c, please. >Index: busybox-1.6.1/util-linux/Config.in >=================================================================== >--- busybox-1.6.1.orig/util-linux/Config.in >+++ busybox-1.6.1/util-linux/Config.in >@@ -5,6 +5,13 @@ > > menu "Linux System Utilities" > >+config DEVMEM2 >+ bool "devmem2" >+ default n >+ help >+ devmem2 is a small program that reads and writes from physcial physical >+ memory using /dev/mem. >+ > config DMESG > bool "dmesg" > default n >Index: busybox-1.6.1/util-linux/Kbuild >=================================================================== >--- busybox-1.6.1.orig/util-linux/Kbuild >+++ busybox-1.6.1/util-linux/Kbuild >@@ -30,3 +30,4 @@ > lib-$(CONFIG_SWAPONOFF) +=swaponoff.o > lib-$(CONFIG_SWITCH_ROOT) +=switch_root.o > lib-$(CONFIG_UMOUNT) +=umount.o >+lib-$(CONFIG_DEVMEM2) +=devmem2.o >Index: busybox-1.6.1/util-linux/devmem2.c >=================================================================== >--- /dev/null >+++ busybox-1.6.1/util-linux/devmem2.c >@@ -0,0 +1,106 @@ >+/* >+ * devmem2.c: Simple program to read/write from/to any location in memory. >+ * >+ * Copyright (C) 2000, Jan-Derk Bakker (jdb at lartmaker.nl) >+ * Include in busybox by Marc Leeman (marc.leeman at barco.com) >+ * >+ * This software has been developed for the LART computing board >+ * (http://www.lart.tudelft.nl/). The development has been sponsored by >+ * the Mobile MultiMedia Communications (http://www.mmc.tudelft.nl/) >+ * and Ubiquitous Communications (http://www.ubicom.tudelft.nl/) >+ * projects. >+ * >+ * >+ * This program is free software; you can redistribute it and/or modify >+ * it under the terms of the GNU General Public License as published by >+ * the Free Software Foundation; either version 2 of the License, or >+ * (at your option) any later version. >+ * >+ * This program is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+ * GNU General Public License for more details. >+ * >+ * You should have received a copy of the GNU General Public License >+ * along with this program; if not, write to the Free Software >+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Please use the common short boilerplate. >+ * >+ */ >+ >+#include "libbb.h" >+ >+#define FATAL do { bb_perror_msg_and_die("Error at line %d, file %s (%d) [%s]\n", \ >+ __LINE__, __FILE__, errno, strerror(errno)); exit(1); } while(0) Is this really needed? This is really gcc centric (FILE and LINE) Also i believe that perror already does strerror(errno). Please check this.. >+ >+#define MAP_SIZE 4096UL >+#define MAP_MASK (MAP_SIZE - 1) possible name clash? >+ >+int devmem2_main(int argc, char **argv); >+int devmem2_main(int argc, char **argv) { >+ int fd; >+ void *map_base, *virt_addr; >+ unsigned long read_result, writeval; >+ off_t target; >+ int access_type = 'w'; >+ >+ if(argc < 2) { >+ bb_show_usage(); >+ } >+ target = strtoul(argv[1], 0, 0); >+ >+ if(argc > 2) >+ access_type = tolower(argv[2][0]); If we should die on strtoul errors, there is already a wrapper for this, please reuse. >+ >+ >+ if((fd = xopen("/dev/mem", O_RDWR | O_SYNC)) == -1) FATAL; xopen will die, the FATAL is thusly redundant. >+ printf("/dev/mem opened.\n"); Smaller if you use const char bb_path_dev_mem[] = "/dev/mem"; ? >+ fflush(stdout); What's that good for? drop. >+ >+ /* Map one page */ >+ map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, target & ~MAP_MASK); >+ if(map_base == (void *) -1) FATAL; use MAP_FAILED not an arbitrary const. >+ printf("Memory mapped at address %p.\n", map_base); >+ fflush(stdout); really need to flush here? drop. >+ >+ virt_addr = map_base + (target & MAP_MASK); smaller to just use map base and adjust the munmap offset later on? >+ switch(access_type) { Please flatten that manually or provide cycles to regtest http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html >+ case 'b': >+ read_result = *((unsigned char *) virt_addr); >+ break; >+ case 'h': >+ read_result = *((unsigned short *) virt_addr); >+ break; >+ case 'w': >+ read_result = *((unsigned long *) virt_addr); >+ break; >+ default: >+ bb_perror_msg_and_die("Illegal data type '%c'.\n", access_type); >+ } >+ printf("Value at address 0x%lx (%p): 0x%lx\n", target, virt_addr, read_result); Sounds a bit verbose, but ok. >+ fflush(stdout); ditch fflush? >+ >+ if(argc > 3) { >+ writeval = strtoul(argv[3], 0, 0); xatonum or the like? i.e. die on error >+ switch(access_type) { can't you interleave that switch statement with the above? >+ case 'b': >+ *((unsigned char *) virt_addr) = writeval; >+ read_result = *((unsigned char *) virt_addr); >+ break; >+ case 'h': >+ *((unsigned short *) virt_addr) = writeval; >+ read_result = *((unsigned short *) virt_addr); >+ break; >+ case 'w': >+ *((unsigned long *) virt_addr) = writeval; >+ read_result = *((unsigned long *) virt_addr); >+ break; >+ } >+ printf("Written 0x%lx; readback 0x%lx\n", writeval, read_result); >+ fflush(stdout); yet another flush. brrr >+ } >+ >+ if(munmap(map_base, MAP_SIZE) == -1) FATAL; >+ close(fd); >+ return 0; Please use EXIT_SUCCESS >+} From rep.dot.nop at gmail.com Wed Jul 11 22:13:48 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Thu, 12 Jul 2007 00:13:48 +0200 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <200707111838.15527.farmatito@tiscali.it> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> <200707111838.15527.farmatito@tiscali.it> Message-ID: <20070711221348.GA4096@aon.at> On Wed, Jul 11, 2007 at 06:38:15PM +0200, Tito wrote: >On Wednesday 11 July 2007 13:48:52 Alex Landau wrote: >> >> Tito wrote: Hi, >> this series of 7 patches is a first attempt to add an ioctl api to libbb >> and to use it in all applets where: >> >> if ( ioctl() < 0 [!= 0]) >> bb_perror_msg{and_die}(); >> >> or similar code is used. >> [snip] >> >> Critics, hints and help from the list is as always welcome. >> >> Ciao, >> Tito >> >> Hi, >> It looks really nice, only eye-tested though. >> One small comment: ioctl(...) != 0 doesn't mean it's an error. the ioctl() may return a positive value, >> so I'd better have an ioctl(...) < 0 test. Especially when you return ret afterwards. >> Regards, >> Alex >> >Hi, >I know but i'm pretty sure that in all places in busybox where this test was used >[ !=0 ] it errored out, i double checked it, but nonetheless maybe its a good idea >to change it to [ < 0 ] to be more coherent with the original ioctl call. >So attached is a fixed patch. checking for != 0 is imho not a good idea as opposed to <0. The idea is sound in my POV, i didn't have a chance to review it, though (vda should be back RSN, so i hope he can take care of it). Thanks for looking into these! cheers, From vda.linux at googlemail.com Wed Jul 11 23:08:01 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 12 Jul 2007 01:08:01 +0200 Subject: bash vs. ash, [ ! a = b ] vs. [ a != b ] In-Reply-To: <20070705163818.GI2424@sovereign.org> References: <20070705163818.GI2424@sovereign.org> Message-ID: <200707112308.01956.vda.linux@googlemail.com> On Thursday 05 July 2007 16:38, Jim Freeman wrote: > powerpc, busybox 1.6.0 > > There is a discrepency (== error?) in ash's handling of the following: > > ash > === > # [ ! a = b ] > # echo $? > 1 > > # [ a != b ] > # echo $? > 0 Does it work in 1.6.1? For me it works (on i386). -- vda From vda.linux at googlemail.com Thu Jul 12 00:04:38 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 12 Jul 2007 02:04:38 +0200 Subject: r18727 broke fdisk In-Reply-To: <20070708103849.GF4096@aon.at> References: <20070708103849.GF4096@aon.at> Message-ID: <200707120004.38689.vda.linux@googlemail.com> On Sunday 08 July 2007 10:38, Bernhard Fischer wrote: > vda, > > util-linux/fdisk.c: In function 'seek_sector': > util-linux/fdisk.c:641: warning: implicit declaration of function 'lseek64' > util-linux/fdisk.c:641: error: 'off64_t' undeclared (first use in this function) > util-linux/fdisk.c:641: error: (Each undeclared identifier is reported only once > util-linux/fdisk.c:641: error: for each function it appears in.) > util-linux/fdisk.c:641: error: expected ')' before 'secno' > make[2]: *** [util-linux/fdisk.o] Error 1 > make[1]: *** [util-linux] Error 2 > > If LFS is off, then there really is no lseek64. Please revert. I tested both. On my glibc it works. I suppose it (maybe incorrectly) provides lseek64 even without "#define _LARGEFILE64_SOURCE". Can you test whether fdisk.c compiles with LFS unset but with #define _LARGEFILE64_SOURCE added to the top of fdisk.c? -- vda From genepi at sympatico.ca Thu Jul 12 00:39:38 2007 From: genepi at sympatico.ca (Pierre =?iso-8859-1?q?M=E9tras?=) Date: Wed, 11 Jul 2007 20:39:38 -0400 Subject: [PATCH] - Take 2: Adds support for custom error pages in httpd Message-ID: <200707112039.38790.genepi@sympatico.ca> Hi, As recommended by Walter Harms, this version of the patch uses xasprintf() instead of malloc()/strcpy()/strcat(). The final size of the binary is even smaller: 324 bytes instead of 388 bytes with the previous patch. make bloatcheck function old new delta parse_conf 1201 1372 +171 sendHeaders 461 571 +110 sendFile 252 317 +65 httpResponseNames 108 144 +36 handleIncoming 2032 2038 +6 .rodata 138727 138663 -64 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/1 up/down: 388/-64) Total: 324 bytes text data bss dec hex filename 636180 3124 12800 652104 9f348 busybox_old 636525 3288 12800 652613 9f545 busybox_unstripped -- Pierre M?tras -------------- next part -------------- A non-text attachment was scrubbed... Name: httpd_with_error_pages.patch Type: text/x-diff Size: 10754 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070711/ceae4975/attachment-0002.bin From Jlau at extremenetworks.com Thu Jul 12 01:02:54 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Wed, 11 Jul 2007 18:02:54 -0700 Subject: bash vs. ash, [ ! a = b ] vs. [ a != b ] Message-ID: <888459D4AEE6464381B30398101F42F8043FC318@sc-msexch-06.extremenetworks.com> BB 1.6.1 coreutils/test.c fixed this problem which occurred on BB 1.6.0 -Joe -----Original Message----- From: busybox-bounces at busybox.net [mailto:busybox-bounces at busybox.net]On Behalf Of Denis Vlasenko Sent: Wednesday, July 11, 2007 4:08 PM To: busybox at busybox.net Subject: Re: bash vs. ash, [ ! a = b ] vs. [ a != b ] On Thursday 05 July 2007 16:38, Jim Freeman wrote: > powerpc, busybox 1.6.0 > > There is a discrepency (== error?) in ash's handling of the following: > > ash > === > # [ ! a = b ] > # echo $? > 1 > > # [ a != b ] > # echo $? > 0 Does it work in 1.6.1? For me it works (on i386). -- vda _______________________________________________ busybox mailing list busybox at busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox From jfree at sovereign.org Thu Jul 12 04:44:14 2007 From: jfree at sovereign.org (Jim Freeman) Date: Wed, 11 Jul 2007 22:44:14 -0600 Subject: bash vs. ash, [ ! a = b ] vs. [ a != b ] In-Reply-To: <200707112308.01956.vda.linux@googlemail.com> References: <20070705163818.GI2424@sovereign.org> <200707112308.01956.vda.linux@googlemail.com> Message-ID: <20070712044414.GA14901@sovereign.org> On Thu, Jul 12, 2007 at 01:08:01AM +0200, Denis Vlasenko wrote: > On Thursday 05 July 2007 16:38, Jim Freeman wrote: > > powerpc, busybox 1.6.0 > > > > There is a discrepency (== error?) in ash's handling of the following: > > > > ash > > === > > # [ ! a = b ] > > # echo $? > > 1 > > > > # [ a != b ] > > # echo $? > > 0 > > Does it work in 1.6.1? For me it works (on i386). > -- > vda And 1.6.1 works on powerpc - thanks! From marc.leeman at gmail.com Thu Jul 12 07:48:31 2007 From: marc.leeman at gmail.com (Marc Leeman) Date: Thu, 12 Jul 2007 09:48:31 +0200 Subject: devmem2 In-Reply-To: <20070711220624.GZ4096@aon.at> References: <20070711131126.GZ2660@chiana.homelinux.org> <20070711220624.GZ4096@aon.at> Message-ID: <20070712074831.GE2660@chiana.homelinux.org> > It isn't in the util-linux package, is it? Perhaps miscutils would be a > better place. > > Generally it looks really whitespace damaged, run (from toplevel) > indent */devmem2.c, please. I more or less left the *.c file as it was upstream, but I'll use your comments in the next patch version. -- greetz, marc Human. It's kinda like Sebacean, but we haven't conquered other worlds yet, so we just kick the crap out of each other. Crichton - PK Tech Girl chiana 2.6.18-4-ixp4xx #1 Tue Mar 27 18:01:56 BST 2007 GNU/Linux -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.busybox.net/pipermail/busybox/attachments/20070712/d7d88045/attachment-0002.pgp From wharms at bfs.de Thu Jul 12 07:59:00 2007 From: wharms at bfs.de (walter harms) Date: Thu, 12 Jul 2007 09:59:00 +0200 Subject: How to change the Timezone In-Reply-To: <200707111516.00391.vapier@gentoo.org> References: <200707061909.37818.vda.linux@googlemail.com> <4694F62E.40006@bfs.de> <200707111516.00391.vapier@gentoo.org> Message-ID: <4695DF44.8030202@bfs.de> Mike Frysinger wrote: > On Wednesday 11 July 2007, walter harms wrote: >> perhaps this Question & Answer should go the the FAQ ? > > it isnt a busybox thing > -mike this is true, ntl the problem will show up every time when someone is using 'date' in BB, so he will ask the bb ML. And it becomes a problem when you consider the difference between glibc and ulibc. So it would be helpful at least. re, wh From david.holm at zetadisplay.com Thu Jul 12 08:51:46 2007 From: david.holm at zetadisplay.com (david.holm at zetadisplay.com) Date: Thu, 12 Jul 2007 08:51:46 +0000 (GMT) Subject: [Copfilter] Copy of quarantined email - *** SPAM *** [6.5/6.0] [PATCH 5/7] bb_ioctl implementation Message-ID: <704235.002954619-sendEmail@ipcop> This is the bb_ioctl patch for miscutils/hdparm. Ciao, Tito _______________________________________________ busybox mailing list busybox at busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox From natanael.copa at gmail.com Thu Jul 12 14:35:01 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Thu, 12 Jul 2007 16:35:01 +0200 Subject: [PATCH] vi read-only mode bugfix and enhancement Message-ID: <1184250901.2150.49.camel@localhost> Hi, Attatched is a patch that will fix a bug in vi, enhance functionality a bit, reduce size and make the code a bit more readable. Testcase follows. echo "this file is readonly" > file1 chmod 400 file1 sudo chown root file Before patch: ./busybox_old vi file1 File is empty (user has no read permissions) and statusline says: - file1 1/1 100% Note that there is no indication of error or [Read-only] After patch: ./busybox vi file1 File is still empty (user has no read permissions) but status line says: - file1 [Read-only] 1/1 100% Original vim shows "permission denied" but "Read-only" is better than nothing. Try edit file and save as root. Old behaviour let user do this even if file is write protected. After patch file will be marked as [Read-only]. root will need to save file with :wq! Make bloatcheck: function old new delta update_ro_status - 86 +86 edit_file 921 919 -2 colon 3798 3778 -20 file_insert 336 260 -76 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/3 up/down: 86/-98) Total: -12 bytes text data bss dec hex filename 706447 4728 14528 725703 b12c7 busybox_old 706439 4728 14528 725695 b12bf busybox_unstripped Natanael Copa -------------- next part -------------- A non-text attachment was scrubbed... Name: vi-readonly-fix.patch Type: text/x-patch Size: 4736 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070712/805f0afa/attachment-0002.bin From Nikolay.Yevik at Halliburton.com Thu Jul 12 15:33:34 2007 From: Nikolay.Yevik at Halliburton.com (Nikolay Yevik) Date: Thu, 12 Jul 2007 10:33:34 -0500 Subject: Major improvements to RPM In-Reply-To: <466F0783.9040601@inode.at> References: <20070609105754.128516586@warmcat.com> <20070609110048.499373233@warmcat.com> <200706100220.16200.vda.linux@googlemail.com> <466C2F2B.9040708@warmcat.com><466E9FE5.8030307@warmcat.com> <466F0783.9040601@inode.at> Message-ID: <3FA34846740FF448A01F5B48A52C014F03F4FFD8@HOUEXCH078.corp.halliburton.com> Greetings, I have compiled Andy Green's RPM improvements for BusyBox 1.7.0 using both SnapGear as well BuildRoot toolchains. Functionally, it performs most of the tasks I need. I think an "improvement" is not a correct word for Andy's changes. Without them rpm as it comes with BusyBox is pretty much useless. With his changes rpm provides at least basic functionality needed to effectively use RPMs. I hope Andy's changes will be incorporated in the current release. -----Original Message----- From: busybox-bounces at busybox.net [mailto:busybox-bounces at busybox.net] On Behalf Of Steve M. Sent: Tuesday, June 12, 2007 3:52 PM To: Andy Green Cc: busybox at busybox.net Subject: Re: [PATCH Try#2 3/3] Major improvements to RPM Hi folks, I built a version from current svn with that patch (the #3) and it worked ok in a short test. During compilation I got these warnings: archival/rpm.c:79: warning: initialization discards qualifiers from pointer target type archival/rpm.c:268: warning: no previous prototype for 'rpm_construct_scan_state' archival/rpm.c:272: warning: no previous prototype for 'rpm_destruct_scan_state' archival/rpm.c: In function 'DoInstallEraseUpdateSeqences': archival/rpm.c:679: warning: declaration of 'sz' shadows a previous local archival/rpm.c:552: warning: shadowed declaration is here archival/rpm.c: In function 'DoQueryListFiles': archival/rpm.c:1080: warning: declaration of 'pszRoot' shadows a global declaration archival/rpm.c:79: warning: shadowed declaration is here archival/rpm.c: At top level: archival/rpm.c:1179: warning: no previous prototype for 'rpm_main' archival/rpm.c: In function 'rpm_main': archival/rpm.c:1192: warning: ISO C90 forbids mixed declarations and code archival/rpm.c: In function 'extract_cpio_gz': archival/rpm.c:1747: warning: passing argument 2 of 'rpm_open_transformer' from incompatible pointer type archival/rpm.c: At top level: archival/rpm.c:300: warning: 'exec_script' declared 'static' but never defined archival/rpm.c:1999: warning: 'fileaction_list' defined but not used archival/rpm.c:520: warning: 'PrintDependency' defined but not used I also have a general question about that. At line 79 the following is declared: static char *pszRoot, *szEmpty = ""; szEmpty is only used once for if(defaultPath) pszRoot = szEmpty; else pszRoot = specifiedPath; Is there a benefit from using szEmpty instead of simply doing pszRoot = ""; ? Greetings, Steve M. _______________________________________________ busybox mailing list busybox at busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox ---------------------------------------------------------------------- This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message. From dallas.a.clement at gmail.com Thu Jul 12 13:49:26 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Thu, 12 Jul 2007 08:49:26 -0500 Subject: Help using 'dpkg' command to install debian packages Message-ID: <1184248166.3662.4.camel@localhost> Hello All, I need some help understanding how the busybox 'dpkg -i' command works. Specifically, I would like to know how the mechanism for checking debian package dependencies works. I'd like to know what essential files are needed to do the checking. I've built a few packages and tried to install them. Those with dependencies are failing to install for some reason. Here is my scenario: I built a binary libc6-i386.deb package on my Debian host and installed it on another host which has nothing but a bare Linux 2.6.21.1 kernel and a static busybox 1.6.0 installed. I used the busybox 'dpkg' command to install the package. Everything went fine and the output of the 'dpkg -l' command is: Name Version +++-=============-============== ii libc6-i386 2.3.6 After this, I built a busybox package to re-install the full busybox implementation on to my target host. This package is dependent on libc6-i386 as can be seen from the 'dpkg --info' command: dallas at debian:~/packages$ dpkg --info busybox_1.6.0-1_i386.deb new debian package, version 2.0. size 233752 bytes: control archive= 619 bytes. 444 bytes, 12 lines control 258 bytes, 4 lines md5sums Package: busybox Version: 1.6.0-1 Section: unknown Priority: extra Architecture: i386 Depends: libc6-i386 (>= 2.3.5-1) Installed-Size: 436 Maintainer: Dallas Clement Description: Busybox UNIX command utilities. BusyBox combines tiny versions of many common UNIX utilities into \ a single small executable. It provides replacements for most of the \ utilities you usually find in GNU fileutils, shellutils, etc. When I try to install this package, it fails during the installation. This is the error I get: dpkg: package busybox depends on libc6-i386, which is not installed or flagged to be installed I cannot understand why I am getting this error, when clearly the libc6-i386 package is installed as you can see from the previous 'dpkg -l' output. In fact, the contents of the /var/lib/dpkg/status file are as follows: cat /var/lib/dpkg/status Package: libc6-i386 Version: 2.3.6 Section: libs Priority: required Architecture: i386 Maintainer: Dallas Clement Description: The GNU C library The GNU C library is the standard C/C++ library \ needed to support most Linux applications. Status: install ok installed ---- Clearly, the libc6-i386 package is installed. Is there anything else that 'dpkg' checks other than this 'status' file to do the dependency check? Is it just a simple package name check, or is there more involved? Any insight you could provide will be greatly appreciated! I'm at my wit's end trying to get this to work. From hamish at cloud.net.au Thu Jul 12 22:23:55 2007 From: hamish at cloud.net.au (Hamish Moffatt) Date: Fri, 13 Jul 2007 08:23:55 +1000 Subject: Help using 'dpkg' command to install debian packages In-Reply-To: <1184248166.3662.4.camel@localhost> References: <1184248166.3662.4.camel@localhost> Message-ID: <20070712222355.GC20354@cloud.net.au> On Thu, Jul 12, 2007 at 08:49:26AM -0500, Dallas Clement wrote: > Here is my scenario: > > I built a binary libc6-i386.deb package on my Debian host and installed > it on another host which has nothing but a bare Linux 2.6.21.1 kernel > and a static busybox 1.6.0 installed. I used the busybox 'dpkg' command > to install the package. Everything went fine and the output of the 'dpkg > -l' command is: [...] > When I try to install this package, it fails during the installation. > This is the error I get: > > dpkg: package busybox depends on libc6-i386, which is not installed or > flagged to be installed > > > I cannot understand why I am getting this error, when clearly the > libc6-i386 package is installed as you can see from the previous 'dpkg > -l' output. [...] > Clearly, the libc6-i386 package is installed. > > Is there anything else that 'dpkg' checks other than this 'status' file > to do the dependency check? Is it just a simple package name check, or > is there more involved? > > Any insight you could provide will be greatly appreciated! I'm at my > wit's end trying to get this to work. It looks like you are doing the right thing to me, ie if you were using the real dpkg I believe it would work. Perhaps busybox's emulation is buggy. Hamish -- Hamish Moffatt VK3SB From dallas.a.clement at gmail.com Thu Jul 12 17:45:43 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Thu, 12 Jul 2007 12:45:43 -0500 Subject: Help using 'dpkg' command to install debian packages In-Reply-To: <20070712222355.GC20354@cloud.net.au> References: <1184248166.3662.4.camel@localhost> <20070712222355.GC20354@cloud.net.au> Message-ID: <1184262343.3662.26.camel@localhost> On Fri, 2007-07-13 at 08:23 +1000, Hamish Moffatt wrote: > On Thu, Jul 12, 2007 at 08:49:26AM -0500, Dallas Clement wrote: > > Here is my scenario: > > > > I built a binary libc6-i386.deb package on my Debian host and installed > > it on another host which has nothing but a bare Linux 2.6.21.1 kernel > > and a static busybox 1.6.0 installed. I used the busybox 'dpkg' command > > to install the package. Everything went fine and the output of the 'dpkg > > -l' command is: > > [...] > > > When I try to install this package, it fails during the installation. > > This is the error I get: > > > > dpkg: package busybox depends on libc6-i386, which is not installed or > > flagged to be installed > > > > > > I cannot understand why I am getting this error, when clearly the > > libc6-i386 package is installed as you can see from the previous 'dpkg > > -l' output. > [...] > > > Clearly, the libc6-i386 package is installed. > > > > Is there anything else that 'dpkg' checks other than this 'status' file > > to do the dependency check? Is it just a simple package name check, or > > is there more involved? > > > > Any insight you could provide will be greatly appreciated! I'm at my > > wit's end trying to get this to work. > > It looks like you are doing the right thing to me, ie if you were using > the real dpkg I believe it would work. Perhaps busybox's emulation is > buggy. > > Hamish I think you're right - must be buggy. Though, what I am doing seems so simple!! I'm looking at the file dpkg.c now and putting in some debug messages to see why it is behaving this way. Cheers, Dallas From vapier at gentoo.org Thu Jul 12 23:54:13 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Thu, 12 Jul 2007 19:54:13 -0400 Subject: How to change the Timezone In-Reply-To: <4695DF44.8030202@bfs.de> References: <200707111516.00391.vapier@gentoo.org> <4695DF44.8030202@bfs.de> Message-ID: <200707121954.14012.vapier@gentoo.org> On Thursday 12 July 2007, walter harms wrote: > Mike Frysinger wrote: > > On Wednesday 11 July 2007, walter harms wrote: > >> perhaps this Question & Answer should go the the FAQ ? > > > > it isnt a busybox thing > > this is true, ntl the problem will show up every time when someone is using > 'date' in BB, it will show up every time `date` is used whether it is from busybox or coreutils or ... the question really is, how much non-busybox but low level Linux things do we document considering many people dont understand where busybox ends and other things begin. especially considering this information can differ based on distribution or the user's custom build. -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://lists.busybox.net/pipermail/busybox/attachments/20070712/1abfda6a/attachment-0002.pgp From natanael.copa at gmail.com Fri Jul 13 06:11:45 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Fri, 13 Jul 2007 08:11:45 +0200 Subject: How to change the Timezone In-Reply-To: <200707121954.14012.vapier@gentoo.org> References: <200707111516.00391.vapier@gentoo.org> <4695DF44.8030202@bfs.de> <200707121954.14012.vapier@gentoo.org> Message-ID: <1184307105.27327.8.camel@localhost> On Thu, 2007-07-12 at 19:54 -0400, Mike Frysinger wrote: > On Thursday 12 July 2007, walter harms wrote: > > Mike Frysinger wrote: > > > On Wednesday 11 July 2007, walter harms wrote: > > >> perhaps this Question & Answer should go the the FAQ ? > > > > > > it isnt a busybox thing > > > > this is true, ntl the problem will show up every time when someone is using > > 'date' in BB, > > it will show up every time `date` is used whether it is from busybox or > coreutils or ... the question really is, how much non-busybox but low level > Linux things do we document considering many people dont understand where > busybox ends and other things begin. especially considering this information > can differ based on distribution or the user's custom build. Since its is a frequently asked question, I think it could go there. But instead of telling ppl how to solve it, point them to the libc docs. Q: How do I change the time zone in busybox? A: Busybox has nothing to do with the timezone. Please consult your libc documentation. (http://google.com/search?q=uclibc+glibc+timezone) Natanael From wharms at bfs.de Fri Jul 13 07:48:47 2007 From: wharms at bfs.de (walter harms) Date: Fri, 13 Jul 2007 09:48:47 +0200 Subject: How to change the Timezone In-Reply-To: <1184307105.27327.8.camel@localhost> References: <200707111516.00391.vapier@gentoo.org> <4695DF44.8030202@bfs.de> <200707121954.14012.vapier@gentoo.org> <1184307105.27327.8.camel@localhost> Message-ID: <46972E5F.5060303@bfs.de> Natanael Copa wrote: > On Thu, 2007-07-12 at 19:54 -0400, Mike Frysinger wrote: >> On Thursday 12 July 2007, walter harms wrote: >>> Mike Frysinger wrote: >>>> On Wednesday 11 July 2007, walter harms wrote: >>>>> perhaps this Question & Answer should go the the FAQ ? >>>> it isnt a busybox thing >>> this is true, ntl the problem will show up every time when someone is using >>> 'date' in BB, >> it will show up every time `date` is used whether it is from busybox or >> coreutils or ... the question really is, how much non-busybox but low level >> Linux things do we document considering many people dont understand where >> busybox ends and other things begin. especially considering this information >> can differ based on distribution or the user's custom build. > > Since its is a frequently asked question, I think it could go there. But > instead of telling ppl how to solve it, point them to the libc docs. > > Q: How do I change the time zone in busybox? > A: Busybox has nothing to do with the timezone. Please consult your libc > documentation. (http://google.com/search?q=uclibc+glibc+timezone) > > This has the advantage, that changes will come automatic. Ntl we had a full blown solution and it is easy to add. That leaves one important question WHO will add the sentence ? re, wh > From Stefan.Farnik at swarovski.com Fri Jul 13 07:52:33 2007 From: Stefan.Farnik at swarovski.com (Farnik Stefan) Date: Fri, 13 Jul 2007 09:52:33 +0200 Subject: Link Applet against ncurses Message-ID: <4E82E78083C07947A4F80214C130499E0AC7A4@dsw171.wattens.swarovski.com> Hi there, maybe you can help me. How can I link an applet (using busybox-1.4.2) statically against ncurses? Where do I configure this? There aren't hints for this in Kbuild or something else. Or should I linky complete busybox instead against ncurses? (How to do this?) Thank you! Stefan From ross.cameron at linuxpro.co.za Fri Jul 13 09:08:08 2007 From: ross.cameron at linuxpro.co.za (Ross Cameron) Date: Fri, 13 Jul 2007 11:08:08 +0200 Subject: Link Applet against ncurses In-Reply-To: <4E82E78083C07947A4F80214C130499E0AC7A4@dsw171.wattens.swarovski.com> References: <4E82E78083C07947A4F80214C130499E0AC7A4@dsw171.wattens.swarovski.com> Message-ID: <35f70db10707130208o3737f72dj9167fa3fc14ee7a1@mail.gmail.com> The busybox applets all combine and are delivered as a single binary that is called via symlinks,... using argv[0] to figure out which applet to call. Therefor,... by that logic I would think that linking busybox as a whole against ncurses will do what you need. Not 100% sure,... just a guess On 13/07/07, Farnik Stefan wrote: > Hi there, > > maybe you can help me. > > How can I link an applet (using busybox-1.4.2) statically against ncurses? > Where do I configure this? There aren't hints for this in Kbuild or something else. > > Or should I linky complete busybox instead against ncurses? (How to do this?) > > Thank you! > > Stefan > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > From ralphs at netwinder.org Fri Jul 13 13:42:47 2007 From: ralphs at netwinder.org (Ralph Siemsen) Date: Fri, 13 Jul 2007 09:42:47 -0400 Subject: gcc 4.x and soft-float, -mfloat-api Message-ID: <20070713134247.GA27719@marvin.netwinder.org> Short: The gcc -mfloat-abi option should only be passed for ARM builds unless I am mis-reading the gcc documentation... Long: When I build a toolchain for powerpc with buildroot (current SVN) this results in a compiler that doesn't accept -mfloat-abi option: # $(STAGING_DIR)/usr/bin/powerpc-linux-uclibc-gcc --version powerpc-linux-uclibc-gcc (GCC) 4.2.0 Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # $(STAGING_DIR)/usr/bin/powerpc-linux-uclibc-gcc -mfloat-abi test.c cc1: error: unrecognized command line option "-mfloat-abi" The failure is observed while compiling openssl. Its makefile does: $(SED) 's,/CFLAG=,/CFLAG= $(TARGET_SOFT_FLOAT) ,g' \ $(OPENSSL_DIR)/Configure where TARGET_SOFT_FLOAT comes from toolchain/gcc/Makefile.in: ifeq ($(findstring x4.,x$(GCC_VERSION)),x4.) SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft ifeq ($(BR2_SOFT_FLOAT_FP),y) TARGET_SOFT_FLOAT:=-mfloat-abi=softfp else # no fp at all TARGET_SOFT_FLOAT:=-mfloat-abi=soft #endif else # not gcc-4.x TARGET_SOFT_FLOAT:=-msoft-float endif So if using gcc4x then -mfloat-abi is passed unconditionally. (And, because BR2_SOFT_FLOAT_FP is commented out in Config.in, the value "soft" is always chosen, never "softfp", but that's not my issue at the moment). I believe the gcc4 check in toolchain/gcc/Makefile.in should only set the -mfloat-abi for ARM architecture. I can try cobbling together a patch for this, but as I am not entirely sure it is the right answer, I thought I'd get some feedback first. Thanks, -R From ralphs at netwinder.org Fri Jul 13 13:51:22 2007 From: ralphs at netwinder.org (Ralph Siemsen) Date: Fri, 13 Jul 2007 09:51:22 -0400 Subject: gcc 4.x and soft-float, -mfloat-api In-Reply-To: <20070713134247.GA27719@marvin.netwinder.org> References: <20070713134247.GA27719@marvin.netwinder.org> Message-ID: <20070713135122.GA27875@marvin.netwinder.org> Oops, I meant to post this to buildroot list, sorry! Please ignore it here! -R On Fri, Jul 13, 2007 at 09:42:47AM -0400, Ralph Siemsen wrote: > > Short: > > The gcc -mfloat-abi option should only be passed for ARM builds > unless I am mis-reading the gcc documentation... > > Long: > > When I build a toolchain for powerpc with buildroot (current SVN) > this results in a compiler that doesn't accept -mfloat-abi option: > > # $(STAGING_DIR)/usr/bin/powerpc-linux-uclibc-gcc --version > powerpc-linux-uclibc-gcc (GCC) 4.2.0 > Copyright (C) 2007 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > # $(STAGING_DIR)/usr/bin/powerpc-linux-uclibc-gcc -mfloat-abi test.c > cc1: error: unrecognized command line option "-mfloat-abi" > > The failure is observed while compiling openssl. Its makefile does: > $(SED) 's,/CFLAG=,/CFLAG= $(TARGET_SOFT_FLOAT) ,g' \ > $(OPENSSL_DIR)/Configure > where TARGET_SOFT_FLOAT comes from toolchain/gcc/Makefile.in: > ifeq ($(findstring x4.,x$(GCC_VERSION)),x4.) > SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft > ifeq ($(BR2_SOFT_FLOAT_FP),y) > TARGET_SOFT_FLOAT:=-mfloat-abi=softfp > else # no fp at all > TARGET_SOFT_FLOAT:=-mfloat-abi=soft > #endif > else # not gcc-4.x > TARGET_SOFT_FLOAT:=-msoft-float > endif > > So if using gcc4x then -mfloat-abi is passed unconditionally. > (And, because BR2_SOFT_FLOAT_FP is commented out in Config.in, > the value "soft" is always chosen, never "softfp", but that's > not my issue at the moment). > > I believe the gcc4 check in toolchain/gcc/Makefile.in should > only set the -mfloat-abi for ARM architecture. I can try cobbling > together a patch for this, but as I am not entirely sure it is > the right answer, I thought I'd get some feedback first. > > Thanks, > -R From simon at alcove.fr Fri Jul 13 14:07:59 2007 From: simon at alcove.fr (simon at alcove.fr) Date: Fri, 13 Jul 2007 16:07:59 +0200 (CEST) Subject: libbusybox.so Message-ID: <29287.62.39.9.251.1184335679.squirrel@webmail.alcove.fr> Hello, I've download the last stable busybox release (1.6.1) and i'm trying to build the shared library libbusybox.so. But it seems the shared library support has been removed from recents versions... the option is still present in the configuration interface but not used by the Makefile scripts... Is the busybox shared library always supported ? Thanks by advance for help. Simon From vda.linux at googlemail.com Fri Jul 13 15:21:29 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Fri, 13 Jul 2007 16:21:29 +0100 Subject: How to change the Timezone In-Reply-To: <46972E5F.5060303@bfs.de> References: <1184307105.27327.8.camel@localhost> <46972E5F.5060303@bfs.de> Message-ID: <200707131621.29218.vda.linux@googlemail.com> On Friday 13 July 2007 08:48, walter harms wrote: > Natanael Copa wrote: > > On Thu, 2007-07-12 at 19:54 -0400, Mike Frysinger wrote: > >> On Thursday 12 July 2007, walter harms wrote: > >>> Mike Frysinger wrote: > >>>> On Wednesday 11 July 2007, walter harms wrote: > >>>>> perhaps this Question & Answer should go the the FAQ ? > >>>> > >>>> it isnt a busybox thing > >>> > >>> this is true, ntl the problem will show up every time when someone is > >>> using 'date' in BB, > >> > >> it will show up every time `date` is used whether it is from busybox or > >> coreutils or ... the question really is, how much non-busybox but low > >> level Linux things do we document considering many people dont > >> understand where busybox ends and other things begin. especially > >> considering this information can differ based on distribution or the > >> user's custom build. > > > > Since its is a frequently asked question, I think it could go there. But > > instead of telling ppl how to solve it, point them to the libc docs. > > > > Q: How do I change the time zone in busybox? > > A: Busybox has nothing to do with the timezone. Please consult your libc > > documentation. (http://google.com/search?q=uclibc+glibc+timezone) > > This has the advantage, that changes will come automatic. Ntl we had a full > blown solution and it is easy to add. > > That leaves one important question WHO will add the sentence ? Committed to svn. Thanks. -- vda From vda.linux at googlemail.com Fri Jul 13 15:57:25 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Fri, 13 Jul 2007 16:57:25 +0100 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: <1184250901.2150.49.camel@localhost> References: <1184250901.2150.49.camel@localhost> Message-ID: <200707131657.26004.vda.linux@googlemail.com> Hi, On Thursday 12 July 2007 15:35, Natanael Copa wrote: > Attatched is a patch that will fix a bug in vi, enhance functionality a > bit, reduce size and make the code a bit more readable. Testcase > follows. > > echo "this file is readonly" > file1 > chmod 400 file1 > sudo chown root file > > Before patch: > > ./busybox_old vi file1 > > File is empty (user has no read permissions) and statusline says: > > - file1 1/1 100% > > Note that there is no indication of error or [Read-only] > > After patch: > > ./busybox vi file1 > > File is still empty (user has no read permissions) but status line says: > > - file1 [Read-only] 1/1 100% > > Original vim shows "permission denied" but "Read-only" is better than > nothing. Nice. Any chance getting "[Read failed]" (or whatever non-puzzling msg) so we don't need to return to this once more? > Try edit file and save as root. Old behaviour let user do this even if > file is write protected. > > After patch file will be marked as [Read-only]. root will need to save > file with :wq! Is this feature important? I ask because it costs a few bytes in code size here if I understand it right: +static void update_ro_status(const char *fn) { + struct stat sb; + if (stat(fn, &sb) == 0) { + readonly = vi_readonly || (access(fn, W_OK) < 0) || + /* root will always have access() + * so we check fileperms too */ + !(sb.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)); + } +} Small simplification here: +USE_FEATURE_VI_READONLY(static void update_ro_status(const char *)); static int file_write(char *, char *, char *); static void place_cursor(int, int, int); static void screen_erase(void); @@ -419,8 +420,9 @@ new_text(size); // get a text[] buffer screenbegin = dot = end = text; if (fn != 0) { - ch = file_insert(fn, text, cnt); - } + ch = file_insert(fn, text); + USE_FEATURE_VI_READONLY(update_ro_status(fn)); + } Use: #if FEATURE_VI_READONLY static void update_ro_status(const char *); #else static ALWAYS_INLINE void update_ro_status(const char *name) {} #endif and call sites don't need USE_FEATURE_VI_READONLY(...) anymore. Looks better. Care to do version 2? -- vda From wadehamptoniv at gmail.com Fri Jul 13 16:52:34 2007 From: wadehamptoniv at gmail.com (Wade Hampton) Date: Fri, 13 Jul 2007 12:52:34 -0400 Subject: Failure to mount NFS using Busybox Message-ID: <7a57ad2a0707130952m2f80ffbej62bceb55a469eb4f@mail.gmail.com> G'day, I am trying to use busybox in an initrd for system install/reinstall. The O/S is CentOS 5. My initrd is trying to mount a backup server using NFS, but fails with "No such device". O/S: CentOS 5.0 with updates, 2.6.18-8.1.1.el5 kernel Busybox: 1.2.0-3.el5 Same O/S for server and client. This works on a booted system: mkdir /mnt/tmp /sbin/busybox mount 10.1.2.3:/data -t nfs -o ro,hard,intr /mnt/tmp In the initrd this fails: mkdir -p /mnt/tmp mount 10.1.2.3:/data -t nfs -o ro,hard,intr /mnt/tmp Both have the exact same kernel and exact same busybox. I verified that the IP addresses are not an issue. I have tried adding rsize=1024,wsize=1024 and other mount options but still get the same error. Note, I tried making busybox 1.6.1 static but it fails with "static linking against glibc...". Should I make a static busybox 1.6.1 using uLibc and test that? If so, is there a simple way of doing this (the last time I did this was busybox 0.6 and lots have changed). Such instructions would be nice for the FAQ. Thanks, -- Wade Hampton From Jlau at extremenetworks.com Fri Jul 13 20:45:43 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Fri, 13 Jul 2007 13:45:43 -0700 Subject: no echo on shell Message-ID: <888459D4AEE6464381B30398101F42F8043FC327@sc-msexch-06.extremenetworks.com> On Busybox 1.6.1 (more often) and 1.6.0, the shell (sh) can get into a mode where it does not echo back the command that the user has entered. The output from the command looks fine. Has anyone run into this problem? Thanks! -Joe From dallas.a.clement at gmail.com Fri Jul 13 16:23:36 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Fri, 13 Jul 2007 11:23:36 -0500 Subject: Help using 'dpkg' command to install debian packages In-Reply-To: <20070712222355.GC20354@cloud.net.au> References: <1184248166.3662.4.camel@localhost> <20070712222355.GC20354@cloud.net.au> Message-ID: <1184343816.3483.4.camel@localhost> On Fri, 2007-07-13 at 08:23 +1000, Hamish Moffatt wrote: > On Thu, Jul 12, 2007 at 08:49:26AM -0500, Dallas Clement wrote: > > Here is my scenario: > > > > I built a binary libc6-i386.deb package on my Debian host and installed > > it on another host which has nothing but a bare Linux 2.6.21.1 kernel > > and a static busybox 1.6.0 installed. I used the busybox 'dpkg' command > > to install the package. Everything went fine and the output of the 'dpkg > > -l' command is: > > [...] > > > When I try to install this package, it fails during the installation. > > This is the error I get: > > > > dpkg: package busybox depends on libc6-i386, which is not installed or > > flagged to be installed > > > > > > I cannot understand why I am getting this error, when clearly the > > libc6-i386 package is installed as you can see from the previous 'dpkg > > -l' output. > [...] > > > Clearly, the libc6-i386 package is installed. > > > > Is there anything else that 'dpkg' checks other than this 'status' file > > to do the dependency check? Is it just a simple package name check, or > > is there more involved? > > > > Any insight you could provide will be greatly appreciated! I'm at my > > wit's end trying to get this to work. > > It looks like you are doing the right thing to me, ie if you were using > the real dpkg I believe it would work. Perhaps busybox's emulation is > buggy. > > Hamish I have confirmed that the busybox 'dpkg' command is indeed buggy. It is not checking dependencies correctly. I wasn't able to pinpoint the exact location in the source code for the problem I reported earlier. The code is not exactly easy reading. I download the real dpkg source, built it and am using it instead. It works perfectly. From vapier at gentoo.org Fri Jul 13 20:03:12 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Fri, 13 Jul 2007 16:03:12 -0400 Subject: libbusybox.so In-Reply-To: <29287.62.39.9.251.1184335679.squirrel@webmail.alcove.fr> References: <29287.62.39.9.251.1184335679.squirrel@webmail.alcove.fr> Message-ID: <200707131603.12859.vapier@gentoo.org> On Friday 13 July 2007, simon at alcove.fr wrote: > I've download the last stable busybox release (1.6.1) and i'm trying to > build the shared library libbusybox.so. > But it seems the shared library support has been removed from recents > versions... the option is still present in the configuration interface but > not used by the Makefile scripts... > > Is the busybox shared library always supported ? it's still a dev-only thing not meant general use ... if you dont plan on hacking, dont plan on trying to use it ... -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://lists.busybox.net/pipermail/busybox/attachments/20070713/0a345382/attachment-0002.pgp From vda.linux at googlemail.com Fri Jul 13 22:39:04 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 13 Jul 2007 22:39:04 +0000 Subject: Link Applet against ncurses In-Reply-To: <35f70db10707130208o3737f72dj9167fa3fc14ee7a1@mail.gmail.com> References: <4E82E78083C07947A4F80214C130499E0AC7A4@dsw171.wattens.swarovski.com> <35f70db10707130208o3737f72dj9167fa3fc14ee7a1@mail.gmail.com> Message-ID: <200707132239.04968.vda.linux@googlemail.com> On Friday 13 July 2007 09:08, Ross Cameron wrote: > The busybox applets all combine and are delivered as a single binary > that is called via symlinks,... using argv[0] to figure out which > applet to call. > > Therefor,... by that logic I would think that linking busybox as a > whole against ncurses will do what you need. > > Not 100% sure,... just a guess > > On 13/07/07, Farnik Stefan wrote: > > Hi there, > > > > maybe you can help me. > > > > How can I link an applet (using busybox-1.4.2) statically against ncurses? > > Where do I configure this? There aren't hints for this in Kbuild or something else. > > > > Or should I linky complete busybox instead against ncurses? (How to do this?) You need to link a program againt the library only if you are actually using something from the library. Unmodified bbox doesn't use ncurses, thus I don't understand why you want to link it against ncurses. Anyway, if you are modifying bbox so that it indeed needs ncurses now, then you can follow SELinux example in Makefile.flags: ifeq ($(CONFIG_SELINUX),y) LDLIBS += -lselinux -lsepol endif or you can modify scripts/trylink. -- vda From vda.linux at googlemail.com Fri Jul 13 22:42:29 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 13 Jul 2007 22:42:29 +0000 Subject: Failure to mount NFS using Busybox In-Reply-To: <7a57ad2a0707130952m2f80ffbej62bceb55a469eb4f@mail.gmail.com> References: <7a57ad2a0707130952m2f80ffbej62bceb55a469eb4f@mail.gmail.com> Message-ID: <200707132242.29868.vda.linux@googlemail.com> On Friday 13 July 2007 16:52, Wade Hampton wrote: > G'day, > > I am trying to use busybox in an initrd for system install/reinstall. > The O/S is CentOS 5. My initrd is trying to mount a backup server > using NFS, but fails with "No such device". Can you run it under strace? > O/S: CentOS 5.0 with updates, 2.6.18-8.1.1.el5 kernel > Busybox: 1.2.0-3.el5 > Same O/S for server and client. > > This works on a booted system: > mkdir /mnt/tmp > /sbin/busybox mount 10.1.2.3:/data -t nfs -o ro,hard,intr /mnt/tmp > > In the initrd this fails: > mkdir -p /mnt/tmp > mount 10.1.2.3:/data -t nfs -o ro,hard,intr /mnt/tmp > > Both have the exact same kernel and exact same busybox. I verified > that the IP addresses are not an issue. I have tried adding > rsize=1024,wsize=1024 and other mount options but still get the same > error. > > Note, I tried making busybox 1.6.1 static but it fails with "static > linking against glibc...". > > Should I make a static busybox 1.6.1 using uLibc and test that? If so, is > there a simple way of doing this (the last time I did this was busybox 0.6 > and lots have changed). Such instructions would be nice for the FAQ. I have uclibc cross compiler on my system: # ls /usr/bin/i486-linux-uclibc-* /usr/bin/i486-linux-uclibc-addr2line /usr/bin/i486-linux-uclibc-gcc /usr/bin/i486-linux-uclibc-objdump /usr/bin/i486-linux-uclibc-ar /usr/bin/i486-linux-uclibc-gcc-4.1.1 /usr/bin/i486-linux-uclibc-ranlib /usr/bin/i486-linux-uclibc-as /usr/bin/i486-linux-uclibc-gccbug /usr/bin/i486-linux-uclibc-readelf /usr/bin/i486-linux-uclibc-c++ /usr/bin/i486-linux-uclibc-gcov /usr/bin/i486-linux-uclibc-size /usr/bin/i486-linux-uclibc-c++filt /usr/bin/i486-linux-uclibc-ld /usr/bin/i486-linux-uclibc-strings /usr/bin/i486-linux-uclibc-cpp /usr/bin/i486-linux-uclibc-nm /usr/bin/i486-linux-uclibc-strip /usr/bin/i486-linux-uclibc-g++ /usr/bin/i486-linux-uclibc-objcopy And building against uclibc is done simply like this: export ARCH=i386 make CROSS_COMPILE=i486-linux-uclibc- -- vda From wadehamptoniv at gmail.com Fri Jul 13 23:33:07 2007 From: wadehamptoniv at gmail.com (Wade Hampton) Date: Fri, 13 Jul 2007 19:33:07 -0400 Subject: Failure to mount NFS using Busybox In-Reply-To: <200707132242.29868.vda.linux@googlemail.com> References: <7a57ad2a0707130952m2f80ffbej62bceb55a469eb4f@mail.gmail.com> <200707132242.29868.vda.linux@googlemail.com> Message-ID: <7a57ad2a0707131633s39d1cfe0gdb4c56f9b3bb6ff5@mail.gmail.com> I'll try strace Monday. I also built a static gcc-based busybox 1.6.1 and it failed with a different message. The busybox 1.6.1 also worked on a fully-booted box which makes me think that either something is missing (like a file in /dev), or a binary is missing. The last time I used busybox, I could use gcc and link a program with it using the wrappers -- I guess a full environment is require now (I'll test on Monday). Thanks, -- Wade Hampton On 7/13/07, Denis Vlasenko wrote: > On Friday 13 July 2007 16:52, Wade Hampton wrote: > > G'day, > > > > I am trying to use busybox in an initrd for system install/reinstall. > > The O/S is CentOS 5. My initrd is trying to mount a backup server > > using NFS, but fails with "No such device". > > Can you run it under strace? > > > O/S: CentOS 5.0 with updates, 2.6.18-8.1.1.el5 kernel > > Busybox: 1.2.0-3.el5 > > Same O/S for server and client. > > > > This works on a booted system: > > mkdir /mnt/tmp > > /sbin/busybox mount 10.1.2.3:/data -t nfs -o ro,hard,intr /mnt/tmp > > > > In the initrd this fails: > > mkdir -p /mnt/tmp > > mount 10.1.2.3:/data -t nfs -o ro,hard,intr /mnt/tmp > > > > Both have the exact same kernel and exact same busybox. I verified > > that the IP addresses are not an issue. I have tried adding > > rsize=1024,wsize=1024 and other mount options but still get the same > > error. > > > > Note, I tried making busybox 1.6.1 static but it fails with "static > > linking against glibc...". > > > > Should I make a static busybox 1.6.1 using uLibc and test that? If so, is > > there a simple way of doing this (the last time I did this was busybox 0.6 > > and lots have changed). Such instructions would be nice for the FAQ. > > I have uclibc cross compiler on my system: > > # ls /usr/bin/i486-linux-uclibc-* > /usr/bin/i486-linux-uclibc-addr2line /usr/bin/i486-linux-uclibc-gcc /usr/bin/i486-linux-uclibc-objdump > /usr/bin/i486-linux-uclibc-ar /usr/bin/i486-linux-uclibc-gcc-4.1.1 /usr/bin/i486-linux-uclibc-ranlib > /usr/bin/i486-linux-uclibc-as /usr/bin/i486-linux-uclibc-gccbug /usr/bin/i486-linux-uclibc-readelf > /usr/bin/i486-linux-uclibc-c++ /usr/bin/i486-linux-uclibc-gcov /usr/bin/i486-linux-uclibc-size > /usr/bin/i486-linux-uclibc-c++filt /usr/bin/i486-linux-uclibc-ld /usr/bin/i486-linux-uclibc-strings > /usr/bin/i486-linux-uclibc-cpp /usr/bin/i486-linux-uclibc-nm /usr/bin/i486-linux-uclibc-strip > /usr/bin/i486-linux-uclibc-g++ /usr/bin/i486-linux-uclibc-objcopy > > And building against uclibc is done simply like this: > > export ARCH=i386 > make CROSS_COMPILE=i486-linux-uclibc- > -- > vda > From vda.linux at googlemail.com Sat Jul 14 00:43:21 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 00:43:21 +0000 Subject: [ash-bug] in shcmd function, space should be output to fp, not to stdout. In-Reply-To: References: Message-ID: <200707140043.21927.vda.linux@googlemail.com> On Wednesday 11 July 2007 19:54, Nguyen Thai Ngoc Duy wrote: > Well, the subject says it all. Good catch! Applied to svn. Thanks. -- vda From wharms at bfs.de Sat Jul 14 08:33:47 2007 From: wharms at bfs.de (walter harms) Date: Sat, 14 Jul 2007 10:33:47 +0200 Subject: no echo on shell In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC327@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC327@sc-msexch-06.extremenetworks.com> Message-ID: <46988A6B.2010003@bfs.de> what das stty say ? re, wh Joe Lau wrote: > On Busybox 1.6.1 (more often) and 1.6.0, the shell (sh) can get into a mode > where it does not echo back the command that the user has entered. > The output from the command looks fine. > > Has anyone run into this problem? > > Thanks! > > -Joe > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From vda.linux at googlemail.com Sat Jul 14 11:28:36 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 11:28:36 +0000 Subject: ash -l option? In-Reply-To: <1184137325.29553.52.camel@localhost> References: <1184137325.29553.52.camel@localhost> Message-ID: <200707141128.36898.vda.linux@googlemail.com> On Wednesday 11 July 2007 07:02, Natanael Copa wrote: > Hi, > > While trying to get my busybox/uClibc based distro run as a vserver i > got the problem that there is no -l option to /bin/sh. I solved it by > patching vserver scripts: > > --- data.orig/usr/lib/util-vserver/vserver.functions 2007-07-05 15:41:45 +0000 > +++ data/usr/lib/util-vserver/vserver.functions 2007-07-10 22:54:08 +0000 > @@ -207,7 +207,7 @@ > > test -n "$ENTER_SHELL" || { > local i > - for i in "/bin/bash -login" "/bin/sh -l" /bin/csh; do > + for i in "/bin/bash -login" "/bin/ash --login" "/bin/sh -l" /bin/csh; do > set -- $i > test -x "$vdir/vdir/$1" || continue > ENTER_SHELL=( "$@" ) > > > I was wondering if there is intereste for a --login short option -l in > busybox so patching util-vserver is not needed for busybox vservers? Fixed in svn, thanks for the report. There was also a buglet which made +-login equivalent to --login, which bash doesn't do. -- vda From Alexander at Kriegisch.name Sat Jul 14 11:55:21 2007 From: Alexander at Kriegisch.name (Alexander Kriegisch) Date: Sat, 14 Jul 2007 13:55:21 +0200 Subject: ash init script with implicit "set -e"? Message-ID: <4698B9A9.9070602@Kriegisch.name> I hope not to be off-topic or ask a question the anwer of which should be obvious. I noticed that my embedded system (WLAN/DSL router) stops booting if any uncaught error occurs in my 'ash' init scripts. Is this the expected behaviour for scripts running in a process not connected to a console (no serial cable here, I can connect only later via telnet on pts)? It seems to be as if I run "sh -e" or "set -e" within an interactive shell. I am no expert on "init standards" if there is such a thing. In ash's manual page I only found this paragraph: > -e errexit > If not interactive, exit immediately if any untested command fails. > The exit status of a command is considered to be explicitly tested > if the command is used to control an if, elif, while, or until; > or if the command is the left hand operand of an ``&&'' or > ``||'' operator. This says what "-e" does in a non-interactive shell, but nothing about if it is the default for a non-interactive shell. In my /etc/inittab I just see rc.S being called, but there is no explicit "-e" there, nor is there any in rc.S itself. Now that I know that "-e" seems to be implicitly set, I can either do something like || true or set +x; ; set -x but nonetheless I am curious and would like to know if this behaviour is to be expected. Would it be a problem to set +x globally in an init script or is it kind of mandatory for it to fail (sounds crazy, but I am asking anyway)? Enlighten me, please. -- Alexander Kriegisch From vda.linux at googlemail.com Sat Jul 14 15:21:04 2007 From: vda.linux at googlemail.com (Denys Vlasenko) Date: Sat, 14 Jul 2007 16:21:04 +0100 Subject: ash init script with implicit "set -e"? In-Reply-To: <4698B9A9.9070602@Kriegisch.name> References: <4698B9A9.9070602@Kriegisch.name> Message-ID: <200707141621.04576.vda.linux@googlemail.com> On Saturday 14 July 2007 12:55, Alexander Kriegisch wrote: > I hope not to be off-topic or ask a question the anwer of which should > be obvious. > > I noticed that my embedded system (WLAN/DSL router) stops booting if any > uncaught error occurs in my 'ash' init scripts. Is this the expected > behaviour for scripts running in a process not connected to a console > (no serial cable here, I can connect only later via telnet on pts)? It > seems to be as if I run "sh -e" or "set -e" within an interactive shell. When reporting stuff like this, try to present a testcase. If it doesn't work on some non-i386 arch, try to reproduce on i386 as many people are sitting on this arch. I tried to construct a testcase. z.sh: echo first false echo second Works when run "normally": $ ./busybox ash z.sh first second Works when run daemonized: $ daemon ./busybox ash z.sh Closing file descriptors 8192-3... done. $ cat /tmp/daemon.3427.log Date: Sat Jul 14 16:12:58 IST 2007 Directory: /home/vda/srcdev/bbox/fix/busybox.t2 Command: ./busybox ash z.sh ======== first second FYI: "daemon" is a script shown below: $ cat ~/bin/daemon #!/bin/sh i=`ulimit -n` echo -n "Closing file descriptors $i-3... " while test "$i" -ge 3; do eval "exec $i>&-" i=$(($i-1)) done echo "done." >/tmp/daemon.$$.log >>/tmp/daemon.$$.log echo "Date: `date`" >>/tmp/daemon.$$.log echo "Directory: `pwd`" >>/tmp/daemon.$$.log echo "Command: $@" >>/tmp/daemon.$$.log echo "========" >>/tmp/daemon.$$.log 2>&1 but nonetheless I am curious and would like to know if this behaviour is > to be expected. Would it be a problem to set +x globally in an init > script or is it kind of mandatory for it to fail (sounds crazy, but I am > asking anyway)? I think generally we try to make ash behave similar to bash. -- vda From vda.linux at googlemail.com Sat Jul 14 16:38:16 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 17:38:16 +0100 Subject: Probably a bug in ash In-Reply-To: <20070705173322.dffa33b1.sbb@tuxfamily.org> References: <20070628163439.50345aac.sbb@tuxfamily.org> <20070705173322.dffa33b1.sbb@tuxfamily.org> Message-ID: <200707141738.16655.vda.linux@googlemail.com> On Thursday 05 July 2007 16:33, Seb wrote: > Hello, > > Sorry to insist, but as I don't see any reaction to my precedent mail, > I'd just want to know if it wasn't well delivered on the list or > if it's just an (uninteresting|desperated) case so that there is nothing > to say. :) I was relocating to another country. Sorry for the delay. -- vda From vda.linux at googlemail.com Sat Jul 14 16:48:42 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 17:48:42 +0100 Subject: Probably a bug in ash In-Reply-To: <20070706171028.22f53b94.sbb@tuxfamily.org> References: <468D2284.9070707@bfs.de> <7931.1183655912@brightstareng.com> <20070706171028.22f53b94.sbb@tuxfamily.org> Message-ID: <200707141748.42116.vda.linux@googlemail.com> On Friday 06 July 2007 16:10, Seb wrote: > Do you think I should also make a parallel bug report to dash ? (it's > not to put you under pressure -- I well see you have many other things > to fix here and this bug can wait -- but just to try to be more "useful" > without bothering you nor being unpolite). Unpolite is okay. In the worst case we all know how to use delete key. Trying to be nice is good, but trying to get bugs fixed is also important, maybe more important than politeness. For busybox ash, I prioritize bugs as follows, least to most: * missing feature implemented in bash (but not in POSIX) * missing feature required by POSIX * difference in behavior re bash, but still allowed by POSIX * difference in behavior re POSIX (I'd classify this as bug) * bug which is present in other flavors of ash/dash * bug which does not exist in other flavors of ash/dash How to get it fixed (you have to go to next level if current didnt work): * yell on bbox ml/bugzilla * yell on other ash/dash ml/bugzilla too * yell again * investigate yourself in the source, cook patch and send to ml * send patch again * bitch a lot about lazy maintainers which dont review working patches -- vda From vda.linux at googlemail.com Sat Jul 14 18:20:06 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 19:20:06 +0100 Subject: Probably a bug in ash In-Reply-To: <20070628163439.50345aac.sbb@tuxfamily.org> References: <20070628163439.50345aac.sbb@tuxfamily.org> Message-ID: <200707141920.06062.vda.linux@googlemail.com> On Thursday 28 June 2007 15:34, Seb wrote: > Hello, > > It seems that there is a bug in the 'jobs' built-in command of ash. As > a matter of fact, its output cannot be captured nor piped. > > I made a little script (in attachment) which shows the case. If you > execute it with ash, you should see that 'test3' doesn't return > anything but a new line, while 'test4' indicates that the output is well > directed to stdout (so, according to the rules of shell, the pipe > should work). > > I first observed this bug with the ash shell embedded in Slackware > (then I tested the one of Busybox because Patrick Volkerding said > to me that it was probably the best maintained ash shell :-) and I saw > that dash has the same curious behaviour. So, I think this bug comes > from the "historical" ash shell. The 'TOUR' doc which is in the ash > shell Slackware package says that ash cooks its own outputs, hence here > could be the cause of the bug (complete file in attachment): The bug is simple: ash clears job list for children. "jobs | cat" is run in child, because it's a pipe. I think the following will fix it: at the end of forkchild() function replace for() loop with this #if block: #if JOBS /* For "jobs | cat" to work like in bash, we must retain list of jobs, * but need to remove ourself */ freejob(jp); #else for (jp = curjob; jp; jp = jp->prev_job) freejob(jp); #endif jobless = 0; } I'm curious, tho, whether this will break other job-related stuff. Can you test this change? -- vda From vda.linux at googlemail.com Sat Jul 14 18:44:23 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 19:44:23 +0100 Subject: mount -o rw,remount /dev/hda2 /boot crashed on BB 1.6.0 In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC300@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC300@sc-msexch-06.extremenetworks.com> Message-ID: <200707141944.23353.vda.linux@googlemail.com> On Friday 06 July 2007 01:33, Joe Lau wrote: > > On BB 1.6.0, the mount command crashed when the device provided on remount. > > / # mount -o rw,remount /dev/hda2 /boot > ***** Process mount pid: 817 died with signal:11 > Segmentation fault (core dumped) > > It works fine if the device parameter (/dev/hda2) is not given. > > But "mount -o rw,remount /dev/hda2 /boot" works with BB 1.0 mount command. Not much I'm afraid: * try 1.6.1 and svn, just in case * if you cannot get coredump, add bb_error_msg("I am here") marker prints and rerun mount until you find where it crashes. Can take an hour or so. Then inform list. -- vda From vda.linux at googlemail.com Sat Jul 14 19:26:24 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 20:26:24 +0100 Subject: [PATCH] - Take 2: Adds support for custom error pages in httpd In-Reply-To: <200707112039.38790.genepi@sympatico.ca> References: <200707112039.38790.genepi@sympatico.ca> Message-ID: <200707142026.24679.vda.linux@googlemail.com> On Thursday 12 July 2007 01:39, Pierre M?tras wrote: > Hi, > > As recommended by Walter Harms, this version of the patch uses xasprintf() > instead of malloc()/strcpy()/strcat(). The final size of the binary is even > smaller: 324 bytes instead of 388 bytes with the previous patch. > > make bloatcheck > function old new delta > parse_conf 1201 1372 +171 > sendHeaders 461 571 +110 > sendFile 252 317 +65 > httpResponseNames 108 144 +36 > handleIncoming 2032 2038 +6 > .rodata 138727 138663 -64 > ------------------------------------------------------------------------------ > (add/remove: 0/0 grow/shrink: 5/1 up/down: 388/-64) Total: 324 bytes > text data bss dec hex filename > 636180 3124 12800 652104 9f348 busybox_old > 636525 3288 12800 652613 9f545 busybox_unstripped +#if ENABLE_FEATURE_HTTPD_ERROR_PAGES + if (flag == FIRST_PARSE && *p0 == 'E') { + /* error status code */ + c = strchr(++p0, ':'); + *c = 0; + int status = xatoi(p0); + p0 = ++c; Will crash if there is no ':'. However, there are more of such things in the code around, so probably don't care about that now... Some people dislike "int status" in the middle of the block. I think bb_strtou will give smaller code here: status = bb_strtou(p0 + 1, &p0, 10); /* ignoring possible conv error here */ p0++; + /* then error page */ + if (status >= HTTP_CONTINUE) { + if (*p0 == '/') { + c = xasprintf("%s", p0); Use c = xstrdup(p0). + } else { + c = xasprintf("%s/%s", home_httpd, p0); Use "c = concat_path_file(home_httpd, p0)" instead (a bit smaller). + } + + /* find matching status */ + for (int i = 0; i < ARRAY_SIZE(httpResponseNames); i++) { + if (httpResponseNames[i].type == status) { BTW, you may do alloc here, not above (and thus you won't leak c if user specified non-existent error code). + httpResponseNames[i].error_page = c; + break; + } + } + continue; + } + } +#endif - "%d %s\n" - "

%d %s

\n%s\n\n", + "\n" + "%d %s\n" + "

%d %s

\n%s\n\n", Well, adding is _maybe_ ok, but ? Isn't that just bloat? [to please really size-paranoid people on the list, consider just dropping it] libbb.h +#if ENABLE_HTTPD +#include +#endif I think this should just be in httpd.c - int count; - char *buf = iobuf; - - sendHeaders(HTTP_OK); - /* TODO: sendfile() */ - while ((count = full_read(f, buf, MAX_MEMORY_BUFF)) > 0) { - int fd = accepted_socket; - if (fd == 0) fd++; /* write to fd# 1 in inetd mode */ - if (full_write(fd, buf, count) != count) - break; + if (headers) { + sendHeaders(HTTP_OK); } + + int fd = accepted_socket; + if (fd == 0) fd++; /* write to fd #1 in inetd mode */ + + struct stat f_stat; + if (fstat(f, &f_stat)) { + bb_perror_msg("cannot stat file '%s'", url); + } + off_t offset = 0; + sendfile(fd, f, &offset, f_stat.st_size); Thanks for the effort of adding support for sendfile, but some people may want to exclude that from kernel & bbox. Can you make it configurable? Or just drop for now, to not interfere with inclusion of "error pages" patch. Waiting for patch v3. -- vda From vda.linux at googlemail.com Sat Jul 14 19:42:34 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 20:42:34 +0100 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <20070711221348.GA4096@aon.at> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> <200707111838.15527.farmatito@tiscali.it> <20070711221348.GA4096@aon.at> Message-ID: <200707142042.34597.vda.linux@googlemail.com> On Wednesday 11 July 2007 23:13, Bernhard Fischer wrote: > >I know but i'm pretty sure that in all places in busybox where this test was used > >[ !=0 ] it errored out, i double checked it, but nonetheless maybe its a good idea > >to change it to [ < 0 ] to be more coherent with the original ioctl call. > >So attached is a fixed patch. > > checking for != 0 is imho not a good idea as opposed to <0. The idea is > sound in my POV, i didn't have a chance to review it, though This was quite puzzling for me. Try to guess which is smallest (on i386)? * if (f() != 0) * if (f() < 0) * if (f() == -1) Third one is smallest! gcc just does "inc eax; j[n]z label"; which is just 3 bytes: # cat t.c int f(); void g(); void t1() { if (f()) g(); } void t2() { if (f() < 0) g(); } void t3() { if (f() == -1) g(); } # gcc -Os -fomit-frame-pointer -S t.c # cat t.s [ ABRIDGED] t3: subl $12, %esp call f incl %eax jne .L4 addl $12, %esp jmp g .L4: addl $12, %esp ret t2: subl $12, %esp call f testl %eax, %eax jns .L8 addl $12, %esp jmp g .L8: addl $12, %esp ret t1: subl $12, %esp call f testl %eax, %eax je .L12 addl $12, %esp jmp g .L12: addl $12, %esp ret [Wow, apparently my gcc (4.1.2) has a "I like to masturbate with %esp" habit :(( How to beat it into sanity?] Overall, bb_ioctl patch idea looks great, will review it in a few seconds! Big thanks Tito! -- vda From natanael.copa at gmail.com Sat Jul 14 20:21:55 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Sat, 14 Jul 2007 22:21:55 +0200 Subject: [PATCH] reminder: adduser is broken in 1.6.x Message-ID: <1184444515.19065.6.camel@localhost> Denis, Maybe you missed this while you were away so I send again. Adduser fails to create the user when ENABLE_FEATURE_CLEAN_UP is disabled. The reason is that adduser will exec passwd without first flushing the previously written /etc/passwd (and /etc/shadow). passwd will fail because the user does not exist until files are flushed. But the flush never comes because the buffered file handles are lost in the exec operation. Attatched patch fixes this by flushing all file handles before exiting. Alternative fix would be to close the files regardless FEATURE_CLEAN_UP but we save a few bytes with one fflush(NULL) over 2 fclose() (in case shadow passwords are enabled) Please add this to 1.6.1 fixes. Natanael Copa -------------- next part -------------- A non-text attachment was scrubbed... Name: busybox-1.6.1-adduser.patch Type: text/x-patch Size: 502 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070714/1a1d6470/attachment-0002.bin From natanael.copa at gmail.com Sat Jul 14 20:45:03 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Sat, 14 Jul 2007 22:45:03 +0200 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: <200707131657.26004.vda.linux@googlemail.com> References: <1184250901.2150.49.camel@localhost> <200707131657.26004.vda.linux@googlemail.com> Message-ID: <1184445903.19065.26.camel@localhost> On Fri, 2007-07-13 at 16:57 +0100, Denys Vlasenko wrote: > Hi, > > On Thursday 12 July 2007 15:35, Natanael Copa wrote: > > Attatched is a patch that will fix a bug in vi, enhance functionality a > > bit, reduce size and make the code a bit more readable. Testcase > > follows. [...] > > Original vim shows "permission denied" but "Read-only" is better than > > nothing. > > Nice. Any chance getting "[Read failed]" (or whatever non-puzzling msg) > so we don't need to return to this once more? Code is messy and unreadable and even small changes tend to require redesign. (there are 3 different way how files are read and all 3 are handled different) I think maybe I should start with renaming the global vars. What does "cfn" mean? Rename it to g_current_filename or something like that and code is easier to work with. I will try allocate some time next week. > > Try edit file and save as root. Old behaviour let user do this even if > > file is write protected. > > > > After patch file will be marked as [Read-only]. root will need to save > > file with :wq! > > Is this feature important? Yes. I want this so bad so I spent some time to be able to add the feature and reduce size at the same time to increase my chances to get that specific feature in. I can make it a config option if you want, but for -12 bytes i thought I could get it for free ;-) [...] > Use: > > #if FEATURE_VI_READONLY > static void update_ro_status(const char *); > #else > static ALWAYS_INLINE void update_ro_status(const char *name) {} > #endif > > and call sites don't need USE_FEATURE_VI_READONLY(...) anymore. > Looks better. Ah! I wanted that but didn't know how. Thanks! > Care to do version 2? Will try allocate some time next week, but honestly, if im gonna touch that code again I think I would need to start with making it more readable. > -- > vda From natanael.copa at gmail.com Sat Jul 14 21:03:28 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Sat, 14 Jul 2007 23:03:28 +0200 Subject: libbusybox.so In-Reply-To: <200707131603.12859.vapier@gentoo.org> References: <29287.62.39.9.251.1184335679.squirrel@webmail.alcove.fr> <200707131603.12859.vapier@gentoo.org> Message-ID: <1184447008.19065.40.camel@localhost> On Fri, 2007-07-13 at 16:03 -0400, Mike Frysinger wrote: > On Friday 13 July 2007, simon at alcove.fr wrote: > > I've download the last stable busybox release (1.6.1) and i'm trying to > > build the shared library libbusybox.so. > > But it seems the shared library support has been removed from recents > > versions... the option is still present in the configuration interface but > > not used by the Makefile scripts... > > > > Is the busybox shared library always supported ? > > it's still a dev-only thing not meant general use ... if you dont plan on > hacking, dont plan on trying to use it ... I was thinking the other day that there are some general functions that I see come up in different projects over and over again, things like xmalloc and friends. Those are not likely to change their API. So I was thinking of maybe make an external shared lib and link all my own small projects to it. I don't know if it would be easier if parts of of libbb would be an external project? Candidates are xmalloc, xzalloc, xfopen..., fgetln (replaces bb_get_chunk_from_file), isdirectory, strlcpy, strlcat, strtonum. Basicly, things thats not likely to change API, are not in POSIX or in uclibc. Thoughts? > -mike > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox From sbb at tuxfamily.org Sat Jul 14 21:57:15 2007 From: sbb at tuxfamily.org (Seb) Date: Sat, 14 Jul 2007 23:57:15 +0200 Subject: Probably a bug in ash In-Reply-To: <200707141748.42116.vda.linux@googlemail.com> References: <468D2284.9070707@bfs.de> <7931.1183655912@brightstareng.com> <20070706171028.22f53b94.sbb@tuxfamily.org> <200707141748.42116.vda.linux@googlemail.com> Message-ID: <20070714235715.e5e82a56.sbb@tuxfamily.org> Le Sat, 14 Jul 2007 17:48:42 +0100 Denis Vlasenko a ?crit: > On Friday 06 July 2007 16:10, Seb wrote: > > Do you think I should also make a parallel bug report to dash ? (it's > > not to put you under pressure -- I well see you have many other things > > to fix here and this bug can wait -- but just to try to be more "useful" > > without bothering you nor being unpolite). > > Unpolite is okay. In the worst case we all know how to use delete key. > Trying to be nice is good, but trying to get bugs fixed is also important, > maybe more important than politeness. I agree, but sometimes the "human factor" can be decisive, so I prefer make this kind of things as smoothly as I can because effectively I think the most important here is the code. :) > * yell on other ash/dash ml/bugzilla too Done. Herbert Xu from dash is aware of the bug (there is no maintainer for the ash shell of Slackware). > * investigate yourself in the source, cook patch and send to ml > * send patch again I'd really like it but I can't because C is like Aramaic for me. ++ Seb. From sbb at tuxfamily.org Sat Jul 14 21:57:18 2007 From: sbb at tuxfamily.org (Seb) Date: Sat, 14 Jul 2007 23:57:18 +0200 Subject: Probably a bug in ash In-Reply-To: <200707141738.16655.vda.linux@googlemail.com> References: <20070628163439.50345aac.sbb@tuxfamily.org> <20070705173322.dffa33b1.sbb@tuxfamily.org> <200707141738.16655.vda.linux@googlemail.com> Message-ID: <20070714235718.9667cf15.sbb@tuxfamily.org> Le Sat, 14 Jul 2007 17:38:16 +0100 Denis Vlasenko a ?crit: > On Thursday 05 July 2007 16:33, Seb wrote: > > Hello, > > > > Sorry to insist, but as I don't see any reaction to my precedent mail, > > I'd just want to know if it wasn't well delivered on the list or > > if it's just an (uninteresting|desperated) case so that there is nothing > > to say. :) > > I was relocating to another country. Sorry for the delay. No problem, this bug can wait. :) ++ Seb. From sbb at tuxfamily.org Sat Jul 14 21:58:12 2007 From: sbb at tuxfamily.org (Seb) Date: Sat, 14 Jul 2007 23:58:12 +0200 Subject: Probably a bug in ash In-Reply-To: <200707141920.06062.vda.linux@googlemail.com> References: <20070628163439.50345aac.sbb@tuxfamily.org> <200707141920.06062.vda.linux@googlemail.com> Message-ID: <20070714235812.b7740c25.sbb@tuxfamily.org> Le Sat, 14 Jul 2007 19:20:06 +0100 Denis Vlasenko a ?crit: Hello, > The bug is simple: ash clears job list for children. "jobs | cat" is run > in child, because it's a pipe. > > I think the following will fix it: at the end of forkchild() function > replace for() loop with this #if block: > > #if JOBS > /* For "jobs | cat" to work like in bash, we must retain list of jobs, > * but need to remove ourself */ > freejob(jp); > #else > for (jp = curjob; jp; jp = jp->prev_job) > freejob(jp); > #endif > jobless = 0; > } Great ! I tested it, it works with busybox and with dash. :) But not with the ash shell of the Slackware, because the forkchild function just doesn't exist. There is just a huge forkshell function. I think the ancestor of the code you fixed is between line 739-745 in jobs.c but it's quite different from the one of dash/ash of busybox. Should/Could I post a patch to the dash maintainer (specifying that the author is you, of course) ? ++ Seb. From vda.linux at googlemail.com Sat Jul 14 22:06:44 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 23:06:44 +0100 Subject: [PATCH 1/7] bb_ioctl implementation In-Reply-To: <200707102357.14583.farmatito@tiscali.it> References: <200707102357.14583.farmatito@tiscali.it> Message-ID: <200707142306.44095.vda.linux@googlemail.com> On Tuesday 10 July 2007 22:57, Tito wrote: > Hi, > this series of 7 patches is a first attempt to add an ioctl api to libbb > and to use it in all applets where: > > if ( ioctl() < 0 [!= 0]) > bb_perror_msg{and_die}(); > > or similar code is used. Reviewed and applied to svn with insignificant changes. ioctl_or_die -> xioctl ioctl_or_vperrorXXX -> ioctl_or_perrorXXX Patch is attached, anyone for additional quick eye scan through for stupid errors? Thanks Tito! -- vda -------------- next part -------------- A non-text attachment was scrubbed... Name: 8.patch.bz2 Type: application/x-bzip2 Size: 12588 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070714/388e36df/attachment-0002.bin From vda.linux at googlemail.com Sat Jul 14 22:37:50 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 23:37:50 +0100 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: <1184445903.19065.26.camel@localhost> References: <1184250901.2150.49.camel@localhost> <200707131657.26004.vda.linux@googlemail.com> <1184445903.19065.26.camel@localhost> Message-ID: <200707142337.50860.vda.linux@googlemail.com> On Saturday 14 July 2007 21:45, Natanael Copa wrote: > On Fri, 2007-07-13 at 16:57 +0100, Denys Vlasenko wrote: > > > Original vim shows "permission denied" but "Read-only" is better than > > > nothing. > > > > Nice. Any chance getting "[Read failed]" (or whatever non-puzzling msg) > > so we don't need to return to this once more? > > Code is messy and unreadable and even small changes tend to require > redesign. (there are 3 different way how files are read and all 3 are > handled different) > > I think maybe I should start with renaming the global vars. What does > "cfn" mean? On the positive side, it's not that bad. It could have been named "_". > Yes. I want this so bad so I spent some time to be able to add the > feature and reduce size at the same time to increase my chances to get > that specific feature in. > > I can make it a config option if you want, but for -12 bytes i thought I > could get it for free ;-) No, 12 bytes is ok. Applied to svn as-is. Thanks. -- vda From vda.linux at googlemail.com Sat Jul 14 22:47:06 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 14 Jul 2007 23:47:06 +0100 Subject: [PATCH] reminder: adduser is broken in 1.6.x In-Reply-To: <1184444515.19065.6.camel@localhost> References: <1184444515.19065.6.camel@localhost> Message-ID: <200707142347.06212.vda.linux@googlemail.com> On Saturday 14 July 2007 21:21, Natanael Copa wrote: > Denis, > > Maybe you missed this while you were away so I send again. > > Adduser fails to create the user when ENABLE_FEATURE_CLEAN_UP is > disabled. > > The reason is that adduser will exec passwd without first flushing the > previously written /etc/passwd (and /etc/shadow). passwd will fail > because the user does not exist until files are flushed. But the flush > never comes because the buffered file handles are lost in the exec > operation. > > Attatched patch fixes this by flushing all file handles before exiting. > > Alternative fix would be to close the files regardless FEATURE_CLEAN_UP > but we save a few bytes with one fflush(NULL) over 2 fclose() (in case > shadow passwords are enabled) > > Please add this to 1.6.1 fixes. Applied to svn and added to 1.6.1 hot fixes directory. Thanks. -- vda From vda.linux at googlemail.com Sun Jul 15 01:01:43 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 15 Jul 2007 02:01:43 +0100 Subject: Problem with ash -n non-zero length string test In-Reply-To: <1183844075.3382.22.camel@localhost> References: <1183844075.3382.22.camel@localhost> Message-ID: <200707150201.43381.vda.linux@googlemail.com> On Saturday 07 July 2007 22:34, Dallas Clement wrote: > Hello All, > > I'm experiencing some weird things when trying to use -n to test for a > non-empty string as in the following example. > > boot_drive_name="" > > if [ -n $boot_drive_name ]; then > retval=0 > else > echo "Could not determine boot drive name." > fi > > To my surprise, this condition evaluates true and I do not see my echo > message. No bug here: # cat zz.sh boot_drive_name="" if [ -n $boot_drive_name ]; then retval=0 else echo "Could not determine boot drive name." fi # ash zz.sh # bash zz.sh It's error in script. You need to use if [ -n "$boot_drive_name" ]; then... -- vda From vda.linux at googlemail.com Sun Jul 15 01:02:59 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 15 Jul 2007 02:02:59 +0100 Subject: string comparison in BB 1.6.0 sh In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC30A@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC30A@sc-msexch-06.extremenetworks.com> Message-ID: <200707150202.59211.vda.linux@googlemail.com> On Sunday 08 July 2007 00:20, Joe Lau wrote: > On BB 1.6.0, > > /scratch # if [ "abc" != "def" ]; then > > echo "string comparison works" > > fi > string comparison works > > /scratch # if [ ! "abc" = "def" ]; then > > echo "string comparison works" > > fi > Note: I didn't see my echo here. > > > On BB 1.0, > > /scratch # if [ "abc" != "def" ]; then > > echo "string comparision works" > > fi > string comparision works > > /scratch # if [ ! "abc" = "def" ]; then > > echo "string comparision works" > > fi > string comparision works > > Any clue why BB 1.6.0 sh behave this way? test applet is buggy in 1.6.0, get 1.6.1. Sorry. -- vda From vda.linux at googlemail.com Sun Jul 15 01:05:04 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 15 Jul 2007 02:05:04 +0100 Subject: Probably a bug in ash In-Reply-To: <20070714235812.b7740c25.sbb@tuxfamily.org> References: <20070628163439.50345aac.sbb@tuxfamily.org> <200707141920.06062.vda.linux@googlemail.com> <20070714235812.b7740c25.sbb@tuxfamily.org> Message-ID: <200707150205.04982.vda.linux@googlemail.com> On Saturday 14 July 2007 22:58, Seb wrote: > > The bug is simple: ash clears job list for children. "jobs | cat" is run > > in child, because it's a pipe. > > > > I think the following will fix it: at the end of forkchild() function > > replace for() loop with this #if block: > > > > #if JOBS > > /* For "jobs | cat" to work like in bash, we must retain list of jobs, > > * but need to remove ourself */ > > freejob(jp); > > #else > > for (jp = curjob; jp; jp = jp->prev_job) > > freejob(jp); > > #endif > > jobless = 0; > > } > > Great ! I tested it, it works with busybox and with dash. :) > > But not with the ash shell of the Slackware, because the forkchild > function just doesn't exist. There is just a huge forkshell function. I > think the ancestor of the code you fixed is between line 739-745 in > jobs.c but it's quite different from the one of dash/ash of busybox. > > Should/Could I post a patch to the dash maintainer (specifying that the > author is you, of course) ? Yes. -- vda From farmatito at tiscali.it Sun Jul 15 08:47:34 2007 From: farmatito at tiscali.it (Tito) Date: Sun, 15 Jul 2007 10:47:34 +0200 Subject: [PATCH 1/7] bb_ioctl implementation In-Reply-To: <200707142306.44095.vda.linux@googlemail.com> References: <200707102357.14583.farmatito@tiscali.it> <200707142306.44095.vda.linux@googlemail.com> Message-ID: <200707151047.34840.farmatito@tiscali.it> On Sunday 15 July 2007 00:06:44 Denis Vlasenko wrote: > On Tuesday 10 July 2007 22:57, Tito wrote: > > Hi, > > this series of 7 patches is a first attempt to add an ioctl api to libbb > > and to use it in all applets where: > > > > if ( ioctl() < 0 [!= 0]) > > bb_perror_msg{and_die}(); > > > > or similar code is used. > > Reviewed and applied to svn with insignificant changes. > > ioctl_or_die -> xioctl > ioctl_or_vperrorXXX -> ioctl_or_perrorXXX > > Patch is attached, anyone for additional quick eye scan through > for stupid errors? > > Thanks Tito! > -- > vda > Hi, Looks even better than before! Ciao, Tito From sbb at tuxfamily.org Sun Jul 15 10:17:55 2007 From: sbb at tuxfamily.org (Seb) Date: Sun, 15 Jul 2007 12:17:55 +0200 Subject: Probably a bug in ash In-Reply-To: <200707150205.04982.vda.linux@googlemail.com> References: <20070628163439.50345aac.sbb@tuxfamily.org> <200707141920.06062.vda.linux@googlemail.com> <20070714235812.b7740c25.sbb@tuxfamily.org> <200707150205.04982.vda.linux@googlemail.com> Message-ID: <20070715121755.ebf09ae0.sbb@tuxfamily.org> Le Sun, 15 Jul 2007 02:05:04 +0100 Denis Vlasenko a ?crit: > > But not with the ash shell of the Slackware, because the forkchild > > function just doesn't exist. There is just a huge forkshell function. I > > think the ancestor of the code you fixed is between line 739-745 in > > jobs.c but it's quite different from the one of dash/ash of busybox. > > > > Should/Could I post a patch to the dash maintainer (specifying that the > > author is you, of course) ? > > Yes. Done. Just to be sure, I suppose that there is nothing to expect for the ash shell of the Slackware (no problem, I'd understand: it's not your project and it would require a maybe difficult analysis of the structure of its code) ? ++ Seb. From rep.dot.nop at gmail.com Sun Jul 15 10:49:55 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Sun, 15 Jul 2007 12:49:55 +0200 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <200707142042.34597.vda.linux@googlemail.com> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> <200707111838.15527.farmatito@tiscali.it> <20070711221348.GA4096@aon.at> <200707142042.34597.vda.linux@googlemail.com> Message-ID: <20070715104955.GC4096@aon.at> On Sat, Jul 14, 2007 at 08:42:34PM +0100, Denis Vlasenko wrote: >On Wednesday 11 July 2007 23:13, Bernhard Fischer wrote: >> >I know but i'm pretty sure that in all places in busybox where this test was used >> >[ !=0 ] it errored out, i double checked it, but nonetheless maybe its a good idea >> >to change it to [ < 0 ] to be more coherent with the original ioctl call. >> >So attached is a fixed patch. >> >> checking for != 0 is imho not a good idea as opposed to <0. The idea is >> sound in my POV, i didn't have a chance to review it, though > >This was quite puzzling for me. Try to guess which is smallest (on i386)? >* if (f() != 0) >* if (f() < 0) >* if (f() == -1) > >Third one is smallest! gcc just does "inc eax; j[n]z label"; which is just 3 bytes: The third one is relying on implementation (un-)defined behaviour. #2 is a safe bet, albeit a little bit bigger, but it's the correct thing to do, imo. From vda.linux at googlemail.com Sun Jul 15 12:45:48 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 15 Jul 2007 13:45:48 +0100 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <20070715104955.GC4096@aon.at> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> <200707142042.34597.vda.linux@googlemail.com> <20070715104955.GC4096@aon.at> Message-ID: <200707151345.48525.vda.linux@googlemail.com> On Sunday 15 July 2007 11:49, Bernhard Fischer wrote: > On Sat, Jul 14, 2007 at 08:42:34PM +0100, Denis Vlasenko wrote: > >On Wednesday 11 July 2007 23:13, Bernhard Fischer wrote: > >> >I know but i'm pretty sure that in all places in busybox where this test was used > >> >[ !=0 ] it errored out, i double checked it, but nonetheless maybe its a good idea > >> >to change it to [ < 0 ] to be more coherent with the original ioctl call. > >> >So attached is a fixed patch. > >> > >> checking for != 0 is imho not a good idea as opposed to <0. The idea is > >> sound in my POV, i didn't have a chance to review it, though > > > >This was quite puzzling for me. Try to guess which is smallest (on i386)? > >* if (f() != 0) > >* if (f() < 0) > >* if (f() == -1) > > > >Third one is smallest! gcc just does "inc eax; j[n]z label"; which is just 3 bytes: > > The third one is relying on implementation (un-)defined behaviour. Well, manpages of most library functions say that on return -1 is returned (when function returns an int/long/off_t). And in many places we explicitly check for -1. It can be a silly project for someone to provide FAILED_NEGATIVE(x) macro which uses the most efficient error check for this case for given arch. For i386 it will be (x) == -1, for many arches probably (x) < 0. Then there are functions which return 0 on success and can be checked with just (x)!=0 - like stat, close, dup. FAILED_NONZERO(x)? It is on that fuzzy bounbary "do we want to go that far for saving 1 byte of code?". -- vda From dallas.a.clement at gmail.com Sun Jul 15 21:46:28 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Sun, 15 Jul 2007 16:46:28 -0500 Subject: Problem with ash -n non-zero length string test In-Reply-To: <200707150201.43381.vda.linux@googlemail.com> References: <1183844075.3382.22.camel@localhost> <200707150201.43381.vda.linux@googlemail.com> Message-ID: <469a95b8.4fe9220a.2cdb.54af@mx.google.com> > -----Original Message----- > From: Denis Vlasenko [mailto:vda.linux at googlemail.com] > Sent: Saturday, July 14, 2007 8:02 PM > To: busybox at busybox.net; dallas.a.clement at gmail.com > Subject: Re: Problem with ash -n non-zero length string test > > On Saturday 07 July 2007 22:34, Dallas Clement wrote: > > Hello All, > > > > I'm experiencing some weird things when trying to use -n to test for > a > > non-empty string as in the following example. > > > > boot_drive_name="" > > > > if [ -n $boot_drive_name ]; then > > retval=0 > > else > > echo "Could not determine boot drive name." > > fi > > > > To my surprise, this condition evaluates true and I do not see my > echo > > message. > > No bug here: > > # cat zz.sh > boot_drive_name="" > if [ -n $boot_drive_name ]; then > retval=0 > else > echo "Could not determine boot drive name." > fi > # ash zz.sh > # bash zz.sh > > It's error in script. You need to use > > if [ -n "$boot_drive_name" ]; then... > -- > vda Thank you for your reply. I didn't know that variables must be double-quoted. I'm learning something everyday! :>) From jmartin at pariver.com Mon Jul 16 07:59:13 2007 From: jmartin at pariver.com (Juan Martin) Date: Mon, 16 Jul 2007 09:59:13 +0200 Subject: weird bash script error Message-ID: <469B2551.6040200@pariver.com> Hi, I've the following script, that reads a set of parameters from a .conf file and load it into vars... it works OK on my Debian Box but... It just produces no answer on BusyBox with the exception of a blank line for each "echo" in the script... So I'm thinking about it doesn't put values on the vars (that's why it produces blank echo lines...) Anybody knows what can be going wrong? Something could be different on BB? I looks alright to me! Thanks a lot!! ------ #!/bin/bash # Function: get_config_list config_file # Purpose : Print the list of configs from config file get_config_list() { typeset config_file=$1 awk -F '[][]' ' NF==3 && $0 ~ /^\[.*\]/ { print $2 } ' ${config_file} } # Function : set_config_vars config_file config [var_prefix] # Purpose : Set variables (optionaly prefixed by var_prefix) from config in config file set_config_vars() { typeset config_file=$1 typeset config=$2 typeset var_prefix=$3 typeset config_vars config_vars=$( awk -F= -v Config="${config}" -v Prefix="${var_prefix}" ' BEGIN { Config = toupper(Config); patternConfig = "\\[" Config "]"; } toupper($0) ~ patternConfig,(/\[/ && toupper($0) !~ patternConfig) { if (/\[/ || NF <2) next; sub(/^[[:space:]]*/, ""); sub(/[[:space:]]*=[[:space:]]/, "="); print Prefix $0; } ' ${config_file} ) eval "${config_vars}" } # # Set variables for all config from config file # file=BlackBox.conf for cfg in $(get_config_list ${file}) do echo "--- Configuration [${cfg}] ---" unset $(set | awk -F= '/^cfg_/ { print $1 }') cfg_ set_config_vars ${file} ${cfg} cfg_ set | grep ^cfg_ done echo $cfg_WIFI #Testing boolean wifi value echo $cfg_NTP_Server # Testing value for NTP Server IP From robin.farine at terminus.org Mon Jul 16 07:59:31 2007 From: robin.farine at terminus.org (Robin Farine) Date: Mon, 16 Jul 2007 09:59:31 +0200 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <200707151345.48525.vda.linux@googlemail.com> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> <20070715104955.GC4096@aon.at> <200707151345.48525.vda.linux@googlemail.com> Message-ID: <200707160959.31617.robin.farine@terminus.org> On Sun July 15 2007 14:45, Denis Vlasenko wrote: > On Sunday 15 July 2007 11:49, Bernhard Fischer wrote: > > On Sat, Jul 14, 2007 at 08:42:34PM +0100, Denis Vlasenko wrote: > > >On Wednesday 11 July 2007 23:13, Bernhard Fischer wrote: > > >> >I know but i'm pretty sure that in all places in busybox > > >> > where this test was used [ !=0 ] it errored out, i double > > >> > checked it, but nonetheless maybe its a good idea to > > >> > change it to [ < 0 ] to be more coherent with the original > > >> > ioctl call. So attached is a fixed patch. > > >> > > >> checking for != 0 is imho not a good idea as opposed to <0. > > >> The idea is sound in my POV, i didn't have a chance to > > >> review it, though > > > > > >This was quite puzzling for me. Try to guess which is smallest > > > (on i386)? * if (f() != 0) > > >* if (f() < 0) > > >* if (f() == -1) > > > > > >Third one is smallest! gcc just does "inc eax; j[n]z label"; > > > which is just 3 bytes: > > > > The third one is relying on implementation (un-)defined > > behaviour. > It is on that fuzzy bounbary "do we want to go that far > for saving 1 byte of code?". Especially when on ARM for instance, the == -1 variant is 8 bytes bigger than the < 0 for a given compiler and flags. The outcome of this kind of nano-optimization is compiler specific, it may change from version to version, and it depends on the target architecture and compilation flags. In my opinion, it makes much more sense to go for the safe variant rather than the one that spares 1 byte on architecture foo. Robin From Stefan.Farnik at swarovski.com Mon Jul 16 08:27:48 2007 From: Stefan.Farnik at swarovski.com (Farnik Stefan) Date: Mon, 16 Jul 2007 10:27:48 +0200 Subject: Link Applet against ncurses In-Reply-To: <200707132239.04968.vda.linux@googlemail.com> Message-ID: <4E82E78083C07947A4F80214C130499E0AC7A9@dsw171.wattens.swarovski.com> On Saturday 14. Juli 2007: 00:39, Denis Vlasenko wrote: > You need to link a program againt the library only if you are actually using > something from the library. Unmodified bbox doesn't use ncurses, thus > I don't understand why you want to link it against ncurses. > Anyway, if you are modifying bbox so that it indeed needs ncurses now, > then you can follow SELinux example in Makefile.flags: > ifeq ($(CONFIG_SELINUX),y) > LDLIBS += -lselinux -lsepol > endif > or you can modify scripts/trylink. > -- > vda Hello, thank you for your answer. I have indeed modified busybox; added an applet which needs ncurses. Makefile.flags was one file where I didn't look into. But unfortunately If I added fitting lines to it, it doesn't help either. I still get the message `undefined reference to ..' -> printw mvwprintw wborder waddch wrefresh and others LDLIBS += -ncurses or: LDLIBS += /usr/lib/libncurses.a Thank you in advance! Stefan From wharms at bfs.de Mon Jul 16 09:14:29 2007 From: wharms at bfs.de (walter harms) Date: Mon, 16 Jul 2007 11:14:29 +0200 Subject: Link Applet against ncurses In-Reply-To: <4E82E78083C07947A4F80214C130499E0AC7A9@dsw171.wattens.swarovski.com> References: <4E82E78083C07947A4F80214C130499E0AC7A9@dsw171.wattens.swarovski.com> Message-ID: <469B36F5.2080505@bfs.de> try: LDLIBS += -lncurses Farnik Stefan wrote: > On Saturday 14. Juli 2007: 00:39, Denis Vlasenko wrote: >> You need to link a program againt the library only if you are actually using >> something from the library. Unmodified bbox doesn't use ncurses, thus >> I don't understand why you want to link it against ncurses. > >> Anyway, if you are modifying bbox so that it indeed needs ncurses now, >> then you can follow SELinux example in Makefile.flags: > >> ifeq ($(CONFIG_SELINUX),y) >> LDLIBS += -lselinux -lsepol >> endif > >> or you can modify scripts/trylink. >> -- >> vda > > Hello, > > thank you for your answer. > > I have indeed modified busybox; added an applet which needs ncurses. > Makefile.flags was one file where I didn't look into. But unfortunately > If I added fitting lines to it, it doesn't help either. > > I still get the message `undefined reference to ..' > -> printw mvwprintw wborder waddch wrefresh and others > > LDLIBS += -ncurses > or: > LDLIBS += /usr/lib/libncurses.a > > Thank you in advance! > > Stefan > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From wharms at bfs.de Mon Jul 16 09:19:25 2007 From: wharms at bfs.de (walter harms) Date: Mon, 16 Jul 2007 11:19:25 +0200 Subject: Problem with ash -n non-zero length string test In-Reply-To: <200707150201.43381.vda.linux@googlemail.com> References: <1183844075.3382.22.camel@localhost> <200707150201.43381.vda.linux@googlemail.com> Message-ID: <469B381D.4050106@bfs.de> Denis Vlasenko wrote: > On Saturday 07 July 2007 22:34, Dallas Clement wrote: >> Hello All, >> >> I'm experiencing some weird things when trying to use -n to test for a >> non-empty string as in the following example. >> >> boot_drive_name="" >> >> if [ -n $boot_drive_name ]; then >> retval=0 >> else >> echo "Could not determine boot drive name." >> fi >> >> To my surprise, this condition evaluates true and I do not see my echo >> message. > > No bug here: > > # cat zz.sh > boot_drive_name="" > if [ -n $boot_drive_name ]; then > retval=0 > else > echo "Could not determine boot drive name." > fi > # ash zz.sh > # bash zz.sh > > It's error in script. You need to use > > if [ -n "$boot_drive_name" ]; then... > -- -n is a test for string if "the length of STRING is nonzero" what you what is -z "the length of STRING is zero" re, wh From Stefan.Farnik at swarovski.com Mon Jul 16 09:20:07 2007 From: Stefan.Farnik at swarovski.com (Farnik Stefan) Date: Mon, 16 Jul 2007 11:20:07 +0200 Subject: FW: Link Applet against ncurses Message-ID: <4E82E78083C07947A4F80214C130499E0AC7AB@dsw171.wattens.swarovski.com> walter harms wrote: > try: > LDLIBS += -lncurses sorry, this was a typo in my mail it was `-lncurses' Stefan From wharms at bfs.de Mon Jul 16 10:02:04 2007 From: wharms at bfs.de (walter harms) Date: Mon, 16 Jul 2007 12:02:04 +0200 Subject: FW: Link Applet against ncurses In-Reply-To: <4E82E78083C07947A4F80214C130499E0AC7AB@dsw171.wattens.swarovski.com> References: <4E82E78083C07947A4F80214C130499E0AC7AB@dsw171.wattens.swarovski.com> Message-ID: <469B421C.9040606@bfs.de> with make V=1 you can get the verbose mode for make. please check for linking bb. does the lib appear at all ? re, wh Farnik Stefan wrote: > walter harms wrote: >> try: > >> LDLIBS += -lncurses > > sorry, this was a typo in my mail > it was `-lncurses' > > Stefan > > > From Stefan.Farnik at swarovski.com Mon Jul 16 10:48:26 2007 From: Stefan.Farnik at swarovski.com (Farnik Stefan) Date: Mon, 16 Jul 2007 12:48:26 +0200 Subject: FW: Link Applet against ncurses Message-ID: <4E82E78083C07947A4F80214C130499E0AC7AD@dsw171.wattens.swarovski.com> > with make V=1 you can get the verbose mode for make. please check > for linking bb. does the lib appear at all ? > re, > wh yes, it does appear. same if i type there's no error message at all complaining on not-finding ncurses. only the errors regarding the undefined functions. Stefan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.busybox.net/pipermail/busybox/attachments/20070716/b8c564a7/attachment-0002.htm From pgf at brightstareng.com Mon Jul 16 12:29:06 2007 From: pgf at brightstareng.com (Paul Fox) Date: Mon, 16 Jul 2007 08:29:06 -0400 Subject: weird bash script error In-Reply-To: jmartin's message of Mon, 16 Jul 2007 09:59:13 +0200. <469B2551.6040200@pariver.com> Message-ID: <27929.1184588946@brightstareng.com> > Hi, > > I've the following script, that reads a set of parameters from a .conf > file and load it into vars... it works OK on my Debian Box but... It > just produces no answer on BusyBox with the exception of a blank line > for each "echo" in the script... your script starts with "#!/bin/bash". do you really have bash running under busybox? or did you make the mistake of linking "ash" to "bash"? they're not the same thing. where is awk coming from? is it the busybox awk? if so, i wouldn't be surprised at all if it doesn't function exactly like "real" awk (for almost any value of "real") for some of what you're doing. you might want to start your debugging there. paul > > So I'm thinking about it doesn't put values on the vars (that's why it > produces blank echo lines...) > > Anybody knows what can be going wrong? Something could be different on > BB? I looks alright to me! > > Thanks a lot!! > ------ > #!/bin/bash > # Function: get_config_list config_file > # Purpose : Print the list of configs from config file > get_config_list() > { > typeset config_file=$1 > > awk -F '[][]' ' > NF==3 && $0 ~ /^\[.*\]/ { print $2 } > ' ${config_file} > } > > # Function : set_config_vars config_file config [var_prefix] > # Purpose : Set variables (optionaly prefixed by var_prefix) from > config in config file > set_config_vars() > { > typeset config_file=$1 > typeset config=$2 > typeset var_prefix=$3 > typeset config_vars > > config_vars=$( > awk -F= -v Config="${config}" -v Prefix="${var_prefix}" ' > BEGIN { > Config = toupper(Config); > patternConfig = "\\[" Config "]"; > } > toupper($0) ~ patternConfig,(/\[/ && toupper($0) !~ patternConfig) { > if (/\[/ || NF <2) next; > sub(/^[[:space:]]*/, ""); > sub(/[[:space:]]*=[[:space:]]/, "="); > print Prefix $0; > } ' ${config_file} ) > > eval "${config_vars}" > } > > # > # Set variables for all config from config file > # > file=BlackBox.conf > for cfg in $(get_config_list ${file}) > do > echo "--- Configuration [${cfg}] ---" > unset $(set | awk -F= '/^cfg_/ { print $1 }') cfg_ > set_config_vars ${file} ${cfg} cfg_ > set | grep ^cfg_ > done > echo $cfg_WIFI #Testing boolean wifi value > echo $cfg_NTP_Server # Testing value for NTP Server IP > > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox =--------------------- paul fox, pgf at brightstareng.com From Jlau at extremenetworks.com Mon Jul 16 17:36:25 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Mon, 16 Jul 2007 10:36:25 -0700 Subject: no echo on shell Message-ID: <888459D4AEE6464381B30398101F42F8043FC32F@sc-msexch-06.extremenetworks.com> /scratch # <----- I typed the stty command here (but not echoed back by the shell) speed 9600 baud; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; -brkint ixoff -imaxbel -icanon -echo /scratch # -Joe -----Original Message----- From: walter harms [mailto:wharms at bfs.de] Sent: Saturday, July 14, 2007 1:34 AM To: Joe Lau Cc: 'busybox at busybox.net' Subject: Re: no echo on shell what das stty say ? re, wh Joe Lau wrote: > On Busybox 1.6.1 (more often) and 1.6.0, the shell (sh) can get into a mode > where it does not echo back the command that the user has entered. > The output from the command looks fine. > > Has anyone run into this problem? > > Thanks! > > -Joe > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From pgf at brightstareng.com Mon Jul 16 17:41:50 2007 From: pgf at brightstareng.com (Paul Fox) Date: Mon, 16 Jul 2007 13:41:50 -0400 Subject: no echo on shell In-Reply-To: Jlau's message of Mon, 16 Jul 2007 10:36:25 -0700. <888459D4AEE6464381B30398101F42F8043FC32F@sc-msexch-06.extremenetworks.com> Message-ID: <17225.1184607710@brightstareng.com> > /scratch # <----- I typed the stty command here (but not echoed back by the > shell) > speed 9600 baud; > intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; > eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; > werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; > -brkint ixoff -imaxbel > -icanon -echo ^^^^^ this is the problem. someone is turning off echo, and it's not getting turned back on. are you perhaps killing off a program (e.g., using ^C), that might have disabled character echo? such a program _should_ catch the interrupt signal, in order to restore the tty the way it found it, but many do not. in the meantime, "stty echo" will reenable echo. a good command to use is "stty sane", which restores most (all?) of the default tty settings. paul =--------------------- paul fox, pgf at brightstareng.com From Jlau at extremenetworks.com Mon Jul 16 17:43:26 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Mon, 16 Jul 2007 10:43:26 -0700 Subject: no echo on shell Message-ID: <888459D4AEE6464381B30398101F42F8043FC330@sc-msexch-06.extremenetworks.com> I noticed that echo was turned off (-echo). But I did not turned echo off myself. Do you know who might have done it? Thanks. -Joe -----Original Message----- From: Joe Lau Sent: Monday, July 16, 2007 10:36 AM To: 'wharms at bfs.de' Cc: 'busybox at busybox.net'; Joe Lau Subject: RE: no echo on shell /scratch # <----- I typed the stty command here (but not echoed back by the shell) speed 9600 baud; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; -brkint ixoff -imaxbel -icanon -echo /scratch # -Joe -----Original Message----- From: walter harms [mailto:wharms at bfs.de] Sent: Saturday, July 14, 2007 1:34 AM To: Joe Lau Cc: 'busybox at busybox.net' Subject: Re: no echo on shell what das stty say ? re, wh Joe Lau wrote: > On Busybox 1.6.1 (more often) and 1.6.0, the shell (sh) can get into a mode > where it does not echo back the command that the user has entered. > The output from the command looks fine. > > Has anyone run into this problem? > > Thanks! > > -Joe > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From Jlau at extremenetworks.com Mon Jul 16 18:11:22 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Mon, 16 Jul 2007 11:11:22 -0700 Subject: no echo on shell Message-ID: <888459D4AEE6464381B30398101F42F8043FC332@sc-msexch-06.extremenetworks.com> No, I did not kill any program or noticed any program died when this problem happened. -Joe -----Original Message----- From: busybox-bounces at busybox.net [mailto:busybox-bounces at busybox.net]On Behalf Of Paul Fox Sent: Monday, July 16, 2007 10:42 AM To: busybox at busybox.net Subject: Re: no echo on shell > /scratch # <----- I typed the stty command here (but not echoed back by the > shell) > speed 9600 baud; > intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; > eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; > werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; > -brkint ixoff -imaxbel > -icanon -echo ^^^^^ this is the problem. someone is turning off echo, and it's not getting turned back on. are you perhaps killing off a program (e.g., using ^C), that might have disabled character echo? such a program _should_ catch the interrupt signal, in order to restore the tty the way it found it, but many do not. in the meantime, "stty echo" will reenable echo. a good command to use is "stty sane", which restores most (all?) of the default tty settings. paul =--------------------- paul fox, pgf at brightstareng.com _______________________________________________ busybox mailing list busybox at busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox From sbb at tuxfamily.org Mon Jul 16 18:28:02 2007 From: sbb at tuxfamily.org (Seb) Date: Mon, 16 Jul 2007 20:28:02 +0200 Subject: Probably a bug in ash In-Reply-To: <200707141920.06062.vda.linux@googlemail.com> References: <20070628163439.50345aac.sbb@tuxfamily.org> <200707141920.06062.vda.linux@googlemail.com> Message-ID: <20070716202802.c38449f6.sbb@tuxfamily.org> Le Sat, 14 Jul 2007 19:20:06 +0100 Denis Vlasenko a ?crit: > I'm curious, tho, whether this will break other job-related stuff. I don't know if it's a consequense of your patch or just a bug masked by the previous, but I notice another curious behaviour. When I test the number of running jobs by sending the output of jobs to another command, I get an infinite loop but no problem when jobs isn't piped : #!/bin/sh echo "test with 'jobs', not piped" sleep 2s & sleep 3s & while [ "$(jobs | sed 2p -n)" ]; do jobs done echo "test with piped 'jobs'..." wait sleep 2s & sleep 3s & while [ "$(jobs | sed 2p -n)" ]; do jobs | sed 2p -n # here we enter in an infinite loop done wait # EOF It looks like if a piped 'jobs' was unable to totally remove the achieved jobs from the list. ++ Seb P-S. My bash-3.1.17(2) has the same behaviour but only when there is exactly one job. From magrawal at CROSSBEAMSYS.COM Mon Jul 16 20:58:28 2007 From: magrawal at CROSSBEAMSYS.COM (Agrawal, Monalisa) Date: Mon, 16 Jul 2007 16:58:28 -0400 Subject: Restricting telnet access Message-ID: <8F523CF3EA46B344BEFD62C61103B9B207D3F9B6@CBSMAIL.crossbeamsys.com> Hello All I'm a newbie to busybox and though, I've spent some time browsing the faqs and mailist list archives, apologize in advance if this question has already been answered elsewhere. I was wondering if it is possible to configure telnetd service in busybox to allow logins from certain hosts and disallow from some others. One alternative may be to enable telnetd via inetd and then use the tcp wrapper services to do so, ie, by using /etc/hosts.allow and hosts.deny files...? However, it looks like tcp wrapper is not available by default in busybox and I'm not even sure if that's possible in busybox. Does anyone of an easy way to do this? Thanks so much for your help. Appreciate it. Mona -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.busybox.net/pipermail/busybox/attachments/20070716/0d17f7bd/attachment-0002.htm From vda.linux at googlemail.com Mon Jul 16 21:34:43 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 16 Jul 2007 22:34:43 +0100 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <200707160959.31617.robin.farine@terminus.org> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> <200707151345.48525.vda.linux@googlemail.com> <200707160959.31617.robin.farine@terminus.org> Message-ID: <200707162234.43463.vda.linux@googlemail.com> On Monday 16 July 2007 08:59, Robin Farine wrote: > > > >This was quite puzzling for me. Try to guess which is smallest > > > > (on i386)? * if (f() != 0) > > > >* if (f() < 0) > > > >* if (f() == -1) > > > > > > > >Third one is smallest! gcc just does "inc eax; j[n]z label"; > > > > which is just 3 bytes: > > > > > > The third one is relying on implementation (un-)defined > > > behaviour. > > > It is on that fuzzy bounbary "do we want to go that far > > for saving 1 byte of code?". > > Especially when on ARM for instance, the == -1 variant is 8 bytes > bigger than the < 0 for a given compiler and flags. The outcome of We have lots of if (f() == -1) comparisons too: # grep -r 'if (.*[a-z0-9](.* -1' . | wc -l 137 # echo $((137*8)) 1096 You just said that clever (== per-arch) choice of FAILED_NEGATIVE(x) and FAILED_NONZERO(x) will save ~1k of code on ARM. > this kind of nano-optimization is compiler specific, it may change > from version to version, and it depends on the target architecture > and compilation flags. In my opinion, it makes much more sense to Target arch can be dealt with #ifdefs > go for the safe variant rather than the one that spares 1 byte on > architecture foo. 1 byte maybe, but 8 bytes? -- vda From vda.linux at googlemail.com Mon Jul 16 21:45:58 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 16 Jul 2007 22:45:58 +0100 Subject: FW: Link Applet against ncurses In-Reply-To: <4E82E78083C07947A4F80214C130499E0AC7AB@dsw171.wattens.swarovski.com> References: <4E82E78083C07947A4F80214C130499E0AC7AB@dsw171.wattens.swarovski.com> Message-ID: <200707162245.58738.vda.linux@googlemail.com> On Monday 16 July 2007 10:20, Farnik Stefan wrote: > walter harms wrote: > > try: > > > LDLIBS += -lncurses > > sorry, this was a typo in my mail > it was `-lncurses' show the output of make V=1. Also try adding -v to the scripts/trylink: "$@" -v $added >busybox.map 2>busybox_ld.err ^^ If it doesn't complain about -v, sent output of this modified link stage instead. -- vda From vda.linux at googlemail.com Mon Jul 16 21:53:13 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 16 Jul 2007 22:53:13 +0100 Subject: no echo on shell In-Reply-To: <888459D4AEE6464381B30398101F42F8043FC332@sc-msexch-06.extremenetworks.com> References: <888459D4AEE6464381B30398101F42F8043FC332@sc-msexch-06.extremenetworks.com> Message-ID: <200707162253.13310.vda.linux@googlemail.com> On Monday 16 July 2007 19:11, Joe Lau wrote: > No, I did not kill any program or noticed any program died when this problem > happened. So how exactly this problem happens? Do you login thru getty+login+ash on virtual console? or serial line? or over telnet? or ssh? Do you have any login scripts? Does it happen if you remove them, like: mv /home/user /home/user- mkdir /home/user chown user: /home/user [login on other console/telnet/ssh and see whether echo appears now] -- vda From vda.linux at googlemail.com Mon Jul 16 22:03:51 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 16 Jul 2007 23:03:51 +0100 Subject: weird bash script error In-Reply-To: <469B2551.6040200@pariver.com> References: <469B2551.6040200@pariver.com> Message-ID: <200707162303.51623.vda.linux@googlemail.com> On Monday 16 July 2007 08:59, Juan Martin wrote: > Hi, > > I've the following script, that reads a set of parameters from a .conf > file and load it into vars... it works OK on my Debian Box but... It > just produces no answer on BusyBox with the exception of a blank line > for each "echo" in the script... > > So I'm thinking about it doesn't put values on the vars (that's why it > produces blank echo lines...) > > Anybody knows what can be going wrong? Something could be different on > BB? I looks alright to me! > Please provide non-linewrapped version of the script (I think attaching it is safer in this regard than inline paste), example .conf file you feed into it and "correct" output from Debian -- vda From Jlau at extremenetworks.com Mon Jul 16 22:10:48 2007 From: Jlau at extremenetworks.com (Joe Lau) Date: Mon, 16 Jul 2007 15:10:48 -0700 Subject: no echo on shell Message-ID: <888459D4AEE6464381B30398101F42F8043FC337@sc-msexch-06.extremenetworks.com> This happens on our switch which uses a proprietary shell. By typing "!sh", we can switch to the Linux shell. Sometimes, echo got turned off when switching to the Linux shell (Busybox 1.6.0 or Busybox 1.6.1 sh). We have never encountered this problem when using Busybox 1.0. -Joe -----Original Message----- From: Denis Vlasenko [mailto:vda.linux at googlemail.com] Sent: Monday, July 16, 2007 2:53 PM To: busybox at busybox.net Cc: Joe Lau; 'Paul Fox' Subject: Re: no echo on shell On Monday 16 July 2007 19:11, Joe Lau wrote: > No, I did not kill any program or noticed any program died when this problem > happened. So how exactly this problem happens? Do you login thru getty+login+ash on virtual console? or serial line? or over telnet? or ssh? Do you have any login scripts? Does it happen if you remove them, like: mv /home/user /home/user- mkdir /home/user chown user: /home/user [login on other console/telnet/ssh and see whether echo appears now] -- vda From jmartin at pariver.com Tue Jul 17 06:16:13 2007 From: jmartin at pariver.com (Juan Martin) Date: Tue, 17 Jul 2007 08:16:13 +0200 Subject: weird bash script error In-Reply-To: <200707162303.51623.vda.linux@googlemail.com> References: <469B2551.6040200@pariver.com> <200707162303.51623.vda.linux@googlemail.com> Message-ID: <469C5EAD.8020207@pariver.com> Hi, Denis! OK sorry, here it goes. Setup.sh reads BlackBox.conf varsets, and build a set of vars with cfg_ prefix then it prints it to console (just for cheap debugging as well as echo lines) output contain these lines. I guess Paul Fox is right and "awk" has to be blamed so... Thanks a lot! Denis Vlasenko wrote: > On Monday 16 July 2007 08:59, Juan Martin wrote: > >> Hi, >> >> I've the following script, that reads a set of parameters from a .conf >> file and load it into vars... it works OK on my Debian Box but... It >> just produces no answer on BusyBox with the exception of a blank line >> for each "echo" in the script... >> >> So I'm thinking about it doesn't put values on the vars (that's why it >> produces blank echo lines...) >> >> Anybody knows what can be going wrong? Something could be different on >> BB? I looks alright to me! >> >> > > Please provide non-linewrapped version of the script (I think attaching > it is safer in this regard than inline paste), > example .conf file you feed into it and "correct" output from Debian > -- > vda > > - -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: BlackBox.conf Url: http://lists.busybox.net/pipermail/busybox/attachments/20070717/4b4dddb6/attachment-0004.diff -------------- next part -------------- A non-text attachment was scrubbed... Name: Setup.sh Type: application/x-shellscript Size: 1417 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070717/4b4dddb6/attachment-0002.bin -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: output Url: http://lists.busybox.net/pipermail/busybox/attachments/20070717/4b4dddb6/attachment-0005.diff From Stefan.Farnik at swarovski.com Tue Jul 17 07:26:40 2007 From: Stefan.Farnik at swarovski.com (Farnik Stefan) Date: Tue, 17 Jul 2007 09:26:40 +0200 Subject: Link Applet against ncurses Message-ID: <4E82E78083C07947A4F80214C130499E0AC7B2@dsw171.wattens.swarovski.com> On Monday, 16. July 2007 23:46, Denis Vlasenko wrote: > show the output of make V=1. > Also try adding -v to the scripts/trylink: > "$@" -v $added >busybox.map 2>busybox_ld.err > ^^ > If it doesn't complain about -v, sent output > of this modified link stage instead. output of busybox_ls.err: ---- ---- ---- ---- Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-awt=gtk-default --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --with-tune=pentium4 --enable-checking=release i486-linux-gnu Thread model: posix gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5) /usr/lib/gcc/i486-linux-gnu/4.0.3/collect2 -m elf_i386 -static -o busybox_unstripped /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/crt1.o /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.0.3/crtbeginT.o -L/usr/lib/gcc/i486-linux-gnu/4.0.3 -L/usr/lib/gcc/i486-linux-gnu/4.0.3 -L/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib -L/usr/lib/gcc/i486-linux-gnu/4.0.3/../../.. -L/lib/../lib -L/usr/lib/../lib -lncurses --warn-common --sort-common --start-group applets/built-in.o archival/lib.a archival/libunarchive/lib.a console-tools/lib.a coreutils/lib.a coreutils/libcoreutils/lib.a debianutils/lib.a e2fsprogs/lib.a editors/lib.a findutils/lib.a init/lib.a libbb/lib.a libpwdgrp/lib.a loginutils/lib.a miscutils/lib.a modutils/lib.a networking/lib.a networking/libiproute/lib.a networking/udhcp/lib.a procps/lib.a runit/lib.a shell/lib.a sysklogd/lib.a util-linux/lib.a archival/built-in.o archival/libunarchive/built-in.o console-tools/built-in.o coreutils/built-in.o coreutils/libcoreutils/built-in.o debianutils/built-in.o e2fsprogs/built-in.o editors/built-in.o findutils/built-in.o init/built-in.o libbb/built-in.o libpwdgrp/built-in.o loginutils/built-in.o miscutils/built-in.o modutils/built-in.o networking/built-in.o networking/libiproute/built-in.o networking/udhcp/built-in.o procps/built-in.o runit/built-in.o shell/built-in.o sysklogd/built-in.o util-linux/built-in.o --end-group --start-group -lcrypt -lm --end-group --start-group -lgcc -lgcc_eh -lc --end-group /usr/lib/gcc/i486-linux-gnu/4.0.3/crtend.o /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/crtn.o networking/lib.a(nslookup.o): In function `print_host':nslookup.c:(.text.print_host+0x46): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking libbb/lib.a(inet_common.o): In function `INET_rresolve':inet_common.c:(.text.INET_rresolve+0xcb): warning: Using 'gethostbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking util-linux/lib.a(mount.o): In function `singlemount':mount.c:(.text.singlemount+0xab): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking libbb/lib.a(inet_common.o): In function `INET_rresolve':inet_common.c:(.text.INET_rresolve+0xd8): warning: Using 'getnetbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking libbb/lib.a(inet_common.o): In function `INET_resolve':inet_common.c:(.text.INET_resolve+0x66): warning: Using 'getnetbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking libbb/lib.a(create_icmp_socket.o): In function `create_icmp_socket':create_icmp_socket.c:(.text.create_icmp_socket+0x7): warning: Using 'getprotobyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking libbb/lib.a(xconnect.o): In function `bb_lookup_port':xconnect.c:(.text.bb_lookup_port+0x3c): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libc.a(dl-open.o): warning: definition of `_dl_tls_static_size' overriding common /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/libc.a(libc-tls.o): warning: common is here coreutils/lib.a(dwipe.o): In function `dwipe_gui_title':dwipe.c:(.text.dwipe_gui_title+0x31): undefined reference to `mvwprintw' coreutils/lib.a(dwipe.o): In function `dwipe_gui_init':dwipe.c:(.text.dwipe_gui_init+0x1): undefined reference to `initscr' :dwipe.c:(.text.dwipe_gui_init+0x6): undefined reference to `cbreak' [...] :dwipe.c:(.text.dwipe_gui_load+0xc0): undefined reference to `mvwprintw' coreutils/lib.a(dwipe.o): In function `dwipe_gui_status':dwipe.c:(.text.dwipe_gui_status+0x85): undefined reference to `werase' :dwipe.c:(.text.dwipe_gui_status+0x90): undefined reference to `werase' :dwipe.c:(.text.dwipe_gui_status+0x96): undefined reference to `stdscr' :dwipe.c:(.text.dwipe_gui_status+0x9b): undefined reference to `wgetch' :dwipe.c:(.text.dwipe_gui_status+0x2da): undefined reference to `mvwprintw' :dwipe.c:(.text.dwipe_gui_status+0x328): undefined reference to `mvwprintw' [...] collect2: ld returned 1 exit status ---- ---- ---- ---- [...] - nobody need full 222 lines of errors, all in dwipe.c which is the one applet using ncurses busybox.map is empty (0 bytes) output of make isn't interesting beside the errors above thank you for your help! Stefan From robin.farine at terminus.org Tue Jul 17 08:18:59 2007 From: robin.farine at terminus.org (Robin Farine) Date: Tue, 17 Jul 2007 10:18:59 +0200 Subject: [PATCH 1/7] bb_ioctl implementation - improved In-Reply-To: <200707162234.43463.vda.linux@googlemail.com> References: <276626.20187.qm@web62508.mail.re1.yahoo.com> <200707160959.31617.robin.farine@terminus.org> <200707162234.43463.vda.linux@googlemail.com> Message-ID: <200707171018.59918.robin.farine@terminus.org> On Mon July 16 2007 23:34, Denis Vlasenko wrote: > On Monday 16 July 2007 08:59, Robin Farine wrote: > > Especially when on ARM for instance, the == -1 variant is 8 > > bytes bigger than the < 0 for a given compiler and flags. The > > outcome of > > We have lots of if (f() == -1) comparisons too: > You just said that clever (== per-arch) choice of > FAILED_NEGATIVE(x) and FAILED_NONZERO(x) will save ~1k of code on > ARM. > Target arch can be dealt with #ifdefs > > > go for the safe variant rather than the one that spares 1 byte > > on architecture foo. > > 1 byte maybe, but 8 bytes? To be fair, I cheated. I used a simple test where the compiler could optimize the code in the two branches of the < 0 test benefiting from the fact that bit 31 is cleared in one branch and set in the other. In general the code size tends to be the same for both variants of the test. My point was more that the outcome of such an optimization depends on the target architecture and probably also on the version of gcc and the flags used. But if macros can help saving size on an arch without penalizing the others while keeping the code correct and readable, then why not. Robin From alberto.donato at gmail.com Tue Jul 17 10:47:37 2007 From: alberto.donato at gmail.com (Alberto Donato) Date: Tue, 17 Jul 2007 12:47:37 +0200 Subject: ash shell PATH Message-ID: <9709bd390707170347p5fd689cdg4ebc8ed2a73d07a9@mail.gmail.com> Hello, I've noticed a strange behavior in ash (bb 1.5.1 and 1.6.1). If the interactive shell finds the PATH env var set, it exports it and using getenv("PATH") from a program run from the shell returns the same path as "echo $PATH". Instead, if no PATH var is defined at shell startup and ash sets its own default paths, these are not exported and getenv("PATH") return NULL. Doing "export PATH" from the shell make things work. Is this a desired behavior or a bug? IMHO the PATH var should be exported also if set to ash defaults. Alberto From vda.linux at googlemail.com Tue Jul 17 12:27:06 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 17 Jul 2007 13:27:06 +0100 Subject: ash shell PATH In-Reply-To: <9709bd390707170347p5fd689cdg4ebc8ed2a73d07a9@mail.gmail.com> References: <9709bd390707170347p5fd689cdg4ebc8ed2a73d07a9@mail.gmail.com> Message-ID: <1158166a0707170527t4394ecf8u6173ffe8643a5ad@mail.gmail.com> Hi, On 7/17/07, Alberto Donato wrote: > I've noticed a strange behavior in ash (bb 1.5.1 and 1.6.1). > > If the interactive shell finds the PATH env var set, it exports it and > using getenv("PATH") from a program run from the shell returns the > same path as "echo $PATH". > Instead, if no PATH var is defined at shell startup and ash sets its > own default paths, these are not exported and getenv("PATH") return > NULL. > Doing "export PATH" from the shell make things work. > > Is this a desired behavior or a bug? It matches bash behavior: $ unset PATH; /bin/bash --norc bash-3.1$ /usr/bin/env | /bin/grep PATH bash-3.1$ exit exit $ unset PATH; ./busybox ash /home/vda/srcdev/bbox/fix/busybox.t6 $ /usr/bin/env | /bin/grep PATH /home/vda/srcdev/bbox/fix/busybox.t6 $ -- vda From natanael.copa at gmail.com Tue Jul 17 15:42:12 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Tue, 17 Jul 2007 17:42:12 +0200 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: <200707131657.26004.vda.linux@googlemail.com> References: <1184250901.2150.49.camel@localhost> <200707131657.26004.vda.linux@googlemail.com> Message-ID: <1184686932.15119.57.camel@localhost> On Fri, 2007-07-13 at 16:57 +0100, Denys Vlasenko wrote: > Hi, > > On Thursday 12 July 2007 15:35, Natanael Copa wrote: > > Attatched is a patch that will fix a bug in vi, enhance functionality a > > bit, reduce size and make the code a bit more readable. Testcase > > follows. [...] > Nice. Any chance getting "[Read failed]" (or whatever non-puzzling msg) > so we don't need to return to this once more? [...] > Care to do version 2? More improvements attatched. Fixes also a critical bug (segfault) * the puzzling message mentioned above is replaced with strerror(errno) so it should be even more detailed and smaller at the same time. * merged code in edit_file() and code for ':edit ' in colon() into new func init_text_buffer(). Was horribly duplicate. Moved most of error/sanity checking to file_insert(). Result is that you get a proper validation (prevent reading /dev/*) and error messages for ':r ' * renamed 'cfn' to 'current_filename' for improved readability * merged smallint vi_readonly and readonly into bitfields into readonly_mode to save space. * added text_size variable to keep track how big the text buffer is. This is used to fix a buffer overflow. To reproduce bug in current svn: ./busybox vi TODO :r Makefile vi segfaults due to no buffer checking is done at all. som redesign is needed here but i added a check in text_hole_make() to aviod the segfault at least. * removed isblnk() and use isblank(3) instead. * fixed compiler warning by displaying the return code for :! This makes things bigger than needed but since the patch reduces the overall size... (see below) * new func next_tabstop(int) merges some duplicate code. There are more cuplicode here but i couldnt find a good way to merge them. * Fix *ANNOYING* placement of cursor on '\t' characters. To reproduce in current svn: echo -e "\thello" > file1 ./busybox vi file1 Try to insert some text at the beginning of line. Text will be inserted but cursor is blinking somewhere else. The patch should make busybox vi behave more like original vi(m). Costs a few bytes but its worth it imho. * new_text() is moved into init_text_buffer() * the previously added update_ro_status() was moved info file_insert due to duplication removal mentioned above. I'm sure there are some more bugs in there. What happens if you have a 10239 bytes big file and inserts some chars/lines? I think nasty things might happen. vi also allocates the filesize * 2 which is not very efficient, but it require big changes so it can be fixed later. The attatched patch should not make things worse. If somebody find out that it introduces new bugs or have suggestions to improvements of the patch, let me know and I'll try to fix. It needs some testing. Too many changes in one shot. Now to the bloatcheck: function old new delta init_text_buffer - 245 +245 file_insert 312 420 +108 next_tabstop - 82 +82 text_hole_make 154 171 +17 do_cmd 5093 5100 +7 static.cmd_mode_indicator - 5 +5 refresh 1248 1253 +5 current_filename - 4 +4 yank_delete 161 164 +3 what_reg 96 99 +3 end_cmd_q 78 81 +3 char_insert 440 442 +2 readonly_mode - 1 +1 vi_readonly 1 - -1 setops 154 153 -1 readonly 1 - -1 vi_setops 4 1 -3 string_insert 161 158 -3 cfn 4 - -4 show_status_line 532 514 -18 readit 519 500 -19 move_to_col 161 138 -23 vi_main 495 433 -62 isblnk 75 - -75 .rodata 4751 4655 -96 edit_file 892 787 -105 new_text 125 - -125 update_ro_status 131 - -131 colon 3848 3667 -181 ------------------------------------------------------------------------------ (add/remove: 5/6 grow/shrink: 8/10 up/down: 485/-848) Total: -363 bytes text data bss dec hex filename 34751 873 4260 39884 9bcc busybox_old 34439 877 4260 39576 9a98 busybox_unstripped -------------- next part -------------- A non-text attachment was scrubbed... Name: bb-vi-fixes.patch Type: text/x-patch Size: 22805 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070717/832e3d4c/attachment-0002.bin From magrawal at CROSSBEAMSYS.COM Tue Jul 17 17:33:22 2007 From: magrawal at CROSSBEAMSYS.COM (Agrawal, Monalisa) Date: Tue, 17 Jul 2007 13:33:22 -0400 Subject: using tcp wrappers with busybox Message-ID: <8F523CF3EA46B344BEFD62C61103B9B207D3FF81@CBSMAIL.crossbeamsys.com> Hello Has anyone been successfully able to use tcp wrapper services with busybox? Any pointers on how I would go about doing it would be helpful and appreciated. Thanks Mona -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.busybox.net/pipermail/busybox/attachments/20070717/9aec6c8c/attachment-0002.htm From vda.linux at googlemail.com Tue Jul 17 21:48:20 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 17 Jul 2007 22:48:20 +0100 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070702142205.3CC1.YNAKAM@hitachisoft.jp> References: <20070702142205.3CC1.YNAKAM@hitachisoft.jp> Message-ID: <200707172248.20432.vda.linux@googlemail.com> Hi SELinux people, Sorry, late reply :(( On Monday 02 July 2007 06:29, Yuichi Nakamura wrote: > I would like to submit setfiles/restorecon applet. > setfiles and restorecon are SELinux commands that > label files according to configuration file > (in configuration file, relationship between file and label is > described). > > These applets are very important for SELinux enabled system. > Please review and consider merging this patch. Took a look: * Trimmed help text a bit * Removed \n at the end of bb_[p]error * Removed progname (using applet_name) * Removed restorecon.c - USE_RESTORECON(APPLET_ODDNAME...) handles that * int -> smallint for many flag variables This needs improvement - many of those flags are already accessible as (option_mask32 & BIT_MASK), you don't need separate variables Please take a look at: * Do you really have to have fork()? * Maybe use xstrdup instead of strdupa * nftw() is not used in bbox. We have recursive_action(). It will be better if we won't pull in nftw() into busybox just for this applet. * Do not do "if (applet_is_restorecon && option_x) bb_show_usage()" Just remove 'x' flag from optarg32 instead. If some of the above is not feasible, explain that. Please see attached updated patch. -- vda -------------- next part -------------- A non-text attachment was scrubbed... Name: 4.patch Type: text/x-diff Size: 22528 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070717/36e1aa72/attachment-0002.bin From vda.linux at googlemail.com Tue Jul 17 23:25:50 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 18 Jul 2007 00:25:50 +0100 Subject: weird bash script error In-Reply-To: <469C5EAD.8020207@pariver.com> References: <469B2551.6040200@pariver.com> <200707162303.51623.vda.linux@googlemail.com> <469C5EAD.8020207@pariver.com> Message-ID: <200707180025.50767.vda.linux@googlemail.com> On Tuesday 17 July 2007 07:16, Juan Martin wrote: > Hi, Denis! > > OK sorry, here it goes. > > Setup.sh reads BlackBox.conf varsets, and build a set of vars with cfg_ > prefix then it prints it to console (just for cheap debugging as well as > echo lines) output contain these lines. > > I guess Paul Fox is right and "awk" has to be blamed so... Well, it's rather easy to reduce it to trivial testcase: echo "GNU awk:" echo "[set_1]" | /usr/bin/awk -F '[][]' 'NF==3 && $0 ~ /^\[.*\]/ { print $2 }' echo "Bbox awk:" echo "[set_1]" | /bin/awk -F '[][]' 'NF==3 && $0 ~ /^\[.*\]/ { print $2 }' echo "End" # sh Setup1.sh GNU awk: set_1 Bbox awk: End Yes, awk is guilty. -- vda From vda.linux at googlemail.com Tue Jul 17 23:10:40 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 18 Jul 2007 00:10:40 +0100 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: <1184686932.15119.57.camel@localhost> References: <1184250901.2150.49.camel@localhost> <200707131657.26004.vda.linux@googlemail.com> <1184686932.15119.57.camel@localhost> Message-ID: <200707180010.40408.vda.linux@googlemail.com> On Tuesday 17 July 2007 16:42, Natanael Copa wrote: > > Care to do version 2? > > More improvements attatched. Fixes also a critical bug (segfault) > > * the puzzling message mentioned above is replaced with strerror(errno) > so it should be even more detailed and smaller at the same time. > > * merged code in edit_file() and code for ':edit ' in colon() into > new func init_text_buffer(). Was horribly duplicate. Moved most of > error/sanity checking to file_insert(). Result is that you get a proper > validation (prevent reading /dev/*) and error messages for ':r ' > > * renamed 'cfn' to 'current_filename' for improved readability > > * merged smallint vi_readonly and readonly into bitfields into > readonly_mode to save space. > > * added text_size variable to keep track how big the text buffer is. > This is used to fix a buffer overflow. To reproduce bug in current svn: > > ./busybox vi TODO > :r Makefile > > vi segfaults due to no buffer checking is done at all. som redesign is > needed here but i added a check in text_hole_make() to aviod the > segfault at least. > > * removed isblnk() and use isblank(3) instead. > > * fixed compiler warning by displaying the return code for :! > This makes things bigger than needed but since the patch reduces the > overall size... (see below) > > * new func next_tabstop(int) merges some duplicate code. There are more > cuplicode here but i couldnt find a good way to merge them. > > * Fix *ANNOYING* placement of cursor on '\t' characters. To reproduce in > current svn: > echo -e "\thello" > file1 > ./busybox vi file1 > > Try to insert some text at the beginning of line. Text will be inserted > but cursor is blinking somewhere else. The patch should make busybox vi > behave more like original vi(m). Costs a few bytes but its worth it > imho. > > * new_text() is moved into init_text_buffer() > > * the previously added update_ro_status() was moved info file_insert due > to duplication removal mentioned above. > > I'm sure there are some more bugs in there. What happens if you have a > 10239 bytes big file and inserts some chars/lines? I think nasty things > might happen. vi also allocates the filesize * 2 which is not very > efficient, but it require big changes so it can be fixed later. > > The attatched patch should not make things worse. If somebody find out > that it introduces new bugs or have suggestions to improvements of the > patch, let me know and I'll try to fix. Wow. thanks! Applied to svn with minor changes. For example, we were comparing argv[0] with "view", but argv[0] can be "/bin/view"! Right thing is strncmp(appliet_name, "view", 4) BTW, any idea why strNcmp? Can it really be "viewsomething"? I'm no expert on vi... -- vda From pgf at brightstareng.com Wed Jul 18 03:19:38 2007 From: pgf at brightstareng.com (Paul Fox) Date: Tue, 17 Jul 2007 23:19:38 -0400 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: vda.linux's message of Wed, 18 Jul 2007 00:10:40 +0100. <200707180010.40408.vda.linux@googlemail.com> Message-ID: <440.1184728778@brightstareng.com> > > The attatched patch should not make things worse. If somebody find out > > that it introduces new bugs or have suggestions to improvements of the > > patch, let me know and I'll try to fix. > > Wow. thanks! i agree. busybox vi has needed some work. > Applied to svn with minor changes. For example, we were comparing argv[0] > with "view", but argv[0] can be "/bin/view"! Right thing is > > strncmp(appliet_name, "view", 4) > > BTW, any idea why strNcmp? Can it really be "viewsomething"? I'm no expert > on vi... no. it should be "vi", "ex", or "view". (and busybox's vi will almost certainly never be called "ex". :-) paul =--------------------- paul fox, pgf at brightstareng.com From enigma at strudel-hound.com Wed Jul 18 05:10:35 2007 From: enigma at strudel-hound.com (William Pettersson) Date: Wed, 18 Jul 2007 15:10:35 +1000 Subject: ARCH not being set by make menuconfig - kernel compile fails to start Message-ID: <469DA0CB.101@strudel-hound.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 So, I'm trying to set up a buildroot image for a soekris net4801. I ran make menuconfig, Target Architecture is set to "i386", Target Architecture Variant is set to "geode". However, when I run "make", I get the following (cd /home/wpettersson/src/buildroot/build_/linux-2.6.21.5 ; \ /usr/bin/make -j1 ARCH= CC="/usr/bin/gcc" \ INSTALL_HDR_PATH=/home/wpettersson/src/buildroot/toolchain_build_/linux headers_install ; \ ) make[1]: Entering directory `/home/wpettersson/src/buildroot/build_/linux-2.6.21.5' Makefile:491: /home/wpettersson/src/buildroot/build_/linux-2.6.21.5/arch//Makefile: No such file or directory make[1]: *** No rule to make target `/home/wpettersson/src/buildroot/build_/linux-2.6.21.5/arch//Makefile'. Stop. make[1]: Leaving directory `/home/wpettersson/src/buildroot/build_/linux-2.6.21.5' make: *** [/home/wpettersson/src/buildroot/toolchain_build_/linux/.configured] Error 2 - From the looks of it, "ARCH" isn't being set, which stuffs things up. I've tested by running the make command manually, with ARCH=i386, and that seemed to work. I wasn't sure which configuration files would be required, so to save space I didn't include any. If any are wanted, I'll gladly post them. Anyone know where ARCH is meant to be set? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGnaDLNSpXjKoV00kRAnCuAJ4lRqWNWjey1wSJPGI3axWMrMc/sQCeNBNT /5pybfbBYIsbNsxV3qERZmM= =uZoD -----END PGP SIGNATURE----- From Stefan.Farnik at swarovski.com Wed Jul 18 07:15:26 2007 From: Stefan.Farnik at swarovski.com (Farnik Stefan) Date: Wed, 18 Jul 2007 09:15:26 +0200 Subject: Link Applet against ncurses In-Reply-To: <200707172052.22312.vda.linux@googlemail.com> Message-ID: <4E82E78083C07947A4F80214C130499E0AC7BC@dsw171.wattens.swarovski.com> On Tuesday 17 July 2007 21:53, Denis Vlasenko wrote: > It's strange that -lncurses is in that spot. > If you add it to LDLIBS like SELinux does in Makefile.flags: > ifeq ($(CONFIG_SELINUX),y) > LDLIBS += -lselinux -lsepol > endif > then it has to appear AFTER $(busybox-all) block, > because $(LDLIBS) is after it: > # Rule to link busybox - also used during CONFIG_KALLSYMS > # May be overridden by arch/$(ARCH)/Makefile > quiet_cmd_busybox__ ?= LINK $@ > cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) $(LDFLAGS) \ > -o $@ -Wl,-M \ > -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \ > -Wl,--start-group $(busybox-all) -Wl,--end-group \ > $(LDLIBS) > You are doing something strange with -lncurses placement. > You don't use LDLIBS, you do something else, right? I havn't got this few lines about SELINUX in Makefile.flags so I copied from the ones in it, where it reads LDFLAGS - I saw this by now. When I looked for the quiet_cmd_busybox part in Makefile, I noticed there isn't a $(LDLIBS) either, at least in version 1.4.2 Changed files accordingly it doesn't work. The good thing is that I saw where to `hardcode' it and it ran smoothly. (At least `make install') > > networking/lib.a(nslookup.o): In function `print_host':nslookup.c:(.text.print_host+0x46): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking > Hmm. These errors were gone, too. Thank you for your help, Denis !! Stefan From natanael.copa at gmail.com Wed Jul 18 07:38:51 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Wed, 18 Jul 2007 09:38:51 +0200 Subject: Restricting telnet access In-Reply-To: <8F523CF3EA46B344BEFD62C61103B9B207D3F9B6@CBSMAIL.crossbeamsys.com> References: <8F523CF3EA46B344BEFD62C61103B9B207D3F9B6@CBSMAIL.crossbeamsys.com> Message-ID: <1184744331.22306.0.camel@localhost> On Mon, 2007-07-16 at 16:58 -0400, Agrawal, Monalisa wrote: > Hello All hi > I was wondering if it is possible to configure telnetd service in > busybox to allow logins from certain hosts and disallow from some > others. iptables? Natanael Copa From farmatito at tiscali.it Wed Jul 18 07:41:34 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 18 Jul 2007 09:41:34 +0200 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: <200707180010.40408.vda.linux@googlemail.com> References: <1184250901.2150.49.camel@localhost> <1184686932.15119.57.camel@localhost> <200707180010.40408.vda.linux@googlemail.com> Message-ID: <200707180941.34199.farmatito@tiscali.it> On Wednesday 18 July 2007 01:10:40 Denis Vlasenko wrote: > Applied to svn with minor changes. For example, we were comparing argv[0] > with "view", but argv[0] can be "/bin/view"! Right thing is > > strncmp(appliet_name, "view", 4) Why not: if (*applet_name[3]) Just an idea.... Ciao, Tito > BTW, any idea why strNcmp? Can it really be "viewsomething"? I'm no expert > on vi... > -- > vda From vda.linux at googlemail.com Wed Jul 18 08:30:38 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 18 Jul 2007 09:30:38 +0100 Subject: ARCH not being set by make menuconfig - kernel compile fails to start In-Reply-To: <469DA0CB.101@strudel-hound.com> References: <469DA0CB.101@strudel-hound.com> Message-ID: <200707180930.38910.vda.linux@googlemail.com> On Wednesday 18 July 2007 06:10, William Pettersson wrote: > So, I'm trying to set up a buildroot image for a soekris net4801. I ran > make menuconfig, Target Architecture is set to "i386", Target > Architecture Variant is set to "geode". > > However, when I run "make", I get the following > (cd /home/wpettersson/src/buildroot/build_/linux-2.6.21.5 ; \ > /usr/bin/make -j1 ARCH= CC="/usr/bin/gcc" \ > > INSTALL_HDR_PATH=/home/wpettersson/src/buildroot/toolchain_build_/linux > headers_install ; \ > ) > make[1]: Entering directory > `/home/wpettersson/src/buildroot/build_/linux-2.6.21.5' > Makefile:491: > /home/wpettersson/src/buildroot/build_/linux-2.6.21.5/arch//Makefile: No > such file or directory Seems like bbox and buildroot build machinery disagrees on how to handle ARCH. buildroot seems to set it to empty string. bbox sees it being set and doesn't change. Either buildroot shouldn't set ARCH to "" or busybox should change it if it is "". Someone needs to look deeper into it... -- vda From natanael.copa at gmail.com Wed Jul 18 08:44:39 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Wed, 18 Jul 2007 10:44:39 +0200 Subject: weird bash script error In-Reply-To: <200707180025.50767.vda.linux@googlemail.com> References: <469B2551.6040200@pariver.com> <200707162303.51623.vda.linux@googlemail.com> <469C5EAD.8020207@pariver.com> <200707180025.50767.vda.linux@googlemail.com> Message-ID: <1184748279.22306.20.camel@localhost> On Wed, 2007-07-18 at 00:25 +0100, Denis Vlasenko wrote: > On Tuesday 17 July 2007 07:16, Juan Martin wrote: > > Hi, Denis! > > > > OK sorry, here it goes. > > > > Setup.sh reads BlackBox.conf varsets, and build a set of vars with cfg_ > > prefix then it prints it to console (just for cheap debugging as well as > > echo lines) output contain these lines. > > > > I guess Paul Fox is right and "awk" has to be blamed so... > > Well, it's rather easy to reduce it to trivial testcase: > > echo "GNU awk:" > echo "[set_1]" | /usr/bin/awk -F '[][]' 'NF==3 && $0 ~ /^\[.*\]/ { print $2 }' > echo "Bbox awk:" > echo "[set_1]" | /bin/awk -F '[][]' 'NF==3 && $0 ~ /^\[.*\]/ { print $2 }' > echo "End" > > # sh Setup1.sh > GNU awk: > set_1 > Bbox awk: > End > > Yes, awk is guilty. Its the splitting of the fields that differs. echo "[set_1]" | /usr/bin/awk -F '[][]' 'NF==3 { print($2) }' set_1 echo "[set_1]" | ./busybox awk -F '[][]' 'NF==3 { print($2) }' echo "[set_1]" | ./busybox awk -F '[][]' 'NF==2 { print($2) }' set_1 echo "[set_1]" | /usr/bin/awk -F'[][]' '{print NF}' 3 echo "[set_1]" | ./busybox awk -F'[][]' '{print NF}' 2 What is the regex '[][]' supposed to match? Workaround for this specific case: echo "[set_1]" | ./busybox awk -F '[][]' '$0 ~ /^\[.*\]$/ { print($2) }' Natanael Copa From natanael.copa at gmail.com Wed Jul 18 09:24:36 2007 From: natanael.copa at gmail.com (Natanael Copa) Date: Wed, 18 Jul 2007 11:24:36 +0200 Subject: [PATCH] vi read-only mode bugfix and enhancement In-Reply-To: <200707180941.34199.farmatito@tiscali.it> References: <1184250901.2150.49.camel@localhost> <1184686932.15119.57.camel@localhost> <200707180010.40408.vda.linux@googlemail.com> <200707180941.34199.farmatito@tiscali.it> Message-ID: <1184750676.22306.36.camel@localhost> On Wed, 2007-07-18 at 09:41 +0200, Tito wrote: > On Wednesday 18 July 2007 01:10:40 Denis Vlasenko wrote: > > > Applied to svn with minor changes. For example, we were comparing argv[0] > > with "view", but argv[0] can be "/bin/view"! Right thing is > > > > strncmp(appliet_name, "view", 4) > > Why not: > if (*applet_name[3]) > > Just an idea.... Good idea! Actually, none of those works atm. include/applets needs to be updated. ln -s busybox vi ./vi [vi starts as expected] ln -s busybox view ./view view: applet not found ln -sf vi view ./view view: applet not found Attatched patch fixes this. However... I believe most people uses 'less' nowdays so we migh just want to drop /bin/view completely. People who absolutely want 'view' can create an alias: alias view='vi -R' btw... help message needs -c option. > Ciao, > Tito > > > BTW, any idea why strNcmp? Can it really be "viewsomething"? I'm no expert > > on vi... > > -- > > vda -------------- next part -------------- A non-text attachment was scrubbed... Name: vi-view.patch Type: text/x-patch Size: 1630 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070718/fbc2e440/attachment-0002.bin From amckay at iders.ca Wed Jul 18 15:59:20 2007 From: amckay at iders.ca (Andrew McKay) Date: Wed, 18 Jul 2007 10:59:20 -0500 Subject: Socket: Function not implemented errors in Busybox 1.6.1 Message-ID: <469E38D8.4060308@iders.ca> Hi, I am compiling Busybox 1.6.1 for use on an ARM Linux system. My Kernel version is Linux 2.6.8.1. I have compiled busy box with both a GCC 3.4.4 and a GCC 4.2.0 compiler with the latest version of uClibc. However it appears that no socket related functions are not working in my Busybox executable. Applications that use a socket die with an error saying that the Function is not implemented. starting pid 494, tty '': '/sbin/syslogd' syslogd: socket: Function not implemented process '/sbin/syslogd -n' (pid 494) exited. Scheduling it for restart. ping 200.123.101.231 PING 200.123.101.231 (200.123.101.231): 56 data bytes ping: can't create raw socket: Function not implemented This happens with a Busybox executable that I build my self, and the one that is built using the Buildroot script. Does Busybox not work with Linux Kernel versions as old as 2.6.8.1? If it doesn't, what will I have to do to get it to work? At the moment Linux 2.6.8.1 is our stable kernel, and we won't be moving to a newer version for a little while still. Thanks in advance for any help Andrew From amckay at iders.ca Wed Jul 18 18:06:20 2007 From: amckay at iders.ca (Andrew McKay) Date: Wed, 18 Jul 2007 13:06:20 -0500 Subject: Socket: Function not implemented errors in Busybox 1.6.1 In-Reply-To: <469E38D8.4060308@iders.ca> References: <469E38D8.4060308@iders.ca> Message-ID: <469E569C.6020009@iders.ca> Andrew McKay wrote: > I am compiling Busybox 1.6.1 for use on an ARM Linux system. My Kernel version > is Linux 2.6.8.1. I have compiled busy box with both a GCC 3.4.4 and a GCC > 4.2.0 compiler with the latest version of uClibc. However it appears that no > socket related functions are not working in my Busybox executable. Applications > that use a socket die with an error saying that the Function is not implemented. > > starting pid 494, tty '': '/sbin/syslogd' > syslogd: socket: Function not implemented > process '/sbin/syslogd -n' (pid 494) exited. Scheduling it for restart. > > ping 200.123.101.231 > PING 200.123.101.231 (200.123.101.231): 56 data bytes > ping: can't create raw socket: Function not implemented > > This happens with a Busybox executable that I build my self, and the one that is > built using the Buildroot script. I have tested the busybox executable after being built with the following command line, note that have the config file set up to build it statically at this point: make CROSS_COMPILE=arm-linux- V=1 all The resulting stripped Busybox executable is around 1.5MB. It executes fine, and all socket operations work exactly as expected. However, when I install the executable to my root filesystem with the following command: make CROSS_COMPILE=arm-linux- V=1 CONFIG_PREFIX=/rootfs/ install The build decides to relink Busybox, and it appears to ignore the fact I want to build it statically. The resulting executable is around 800K, and gives errors when any application tries to use a socket. What's going on here? Any help would be appreciated. Andrew McKay Iders Inc. From pclouds at gmail.com Wed Jul 18 18:14:55 2007 From: pclouds at gmail.com (Nguyen Thai Ngoc Duy) Date: Wed, 18 Jul 2007 14:14:55 -0400 Subject: [ash] on exec without arguments Message-ID: Hi, There is a constraint in execcmd which only does exec if there is at least one argument. But I have a use-case where exec is called without any arguments [1]: exec 5>&1 if test "$verbose" = "t" then exec 4>&2 3>&1 else exec 4>/dev/null 3>/dev/null fi Can we just remove the condition? [1] http://repo.or.cz/w/git.git?a=blob;f=t/test-lib.sh;h=78d7e87e86178b90a350714c0b287353a0de20b4;hb=HEAD -- Duy From pclouds at gmail.com Wed Jul 18 18:42:53 2007 From: pclouds at gmail.com (Nguyen Thai Ngoc Duy) Date: Wed, 18 Jul 2007 14:42:53 -0400 Subject: [ash] on exec without arguments In-Reply-To: References: Message-ID: Silly me. We have to do some more to reload the shell itself. Sorry for the noise. On 7/18/07, Nguyen Thai Ngoc Duy wrote: > Hi, > > There is a constraint in execcmd which only does exec if there is at > least one argument. But I have a use-case where exec is called without > any arguments [1]: > > exec 5>&1 > if test "$verbose" = "t" > then > exec 4>&2 3>&1 > else > exec 4>/dev/null 3>/dev/null > fi > > Can we just remove the condition? > > [1] http://repo.or.cz/w/git.git?a=blob;f=t/test-lib.sh;h=78d7e87e86178b90a350714c0b287353a0de20b4;hb=HEAD > -- > Duy > -- Duy From sbb at tuxfamily.org Wed Jul 18 18:52:55 2007 From: sbb at tuxfamily.org (Seb) Date: Wed, 18 Jul 2007 20:52:55 +0200 Subject: Probably a bug in ash In-Reply-To: <200707141920.06062.vda.linux@googlemail.com> References: <20070628163439.50345aac.sbb@tuxfamily.org> <200707141920.06062.vda.linux@googlemail.com> Message-ID: <20070718205255.edb40556.sbb@tuxfamily.org> Le Sat, 14 Jul 2007 19:20:06 +0100 Denis Vlasenko a ?crit: > I'm curious, tho, whether this will break other job-related stuff. Well, it seems to break more than that. Once the patch applied, some outputs disapear. For example, this script doesn't return anything on a patched busybox (doinst.out is empty): #!/bin/sh cat >/tmp/doinst.out < References: <469B2551.6040200@pariver.com> <469C5EAD.8020207@pariver.com> <200707180025.50767.vda.linux@googlemail.com> Message-ID: <200707182122.58307.vda.linux@googlemail.com> On Wednesday 18 July 2007 00:25, Denis Vlasenko wrote: > > Setup.sh reads BlackBox.conf varsets, and build a set of vars with cfg_ > > prefix then it prints it to console (just for cheap debugging as well as > > echo lines) output contain these lines. > > > > I guess Paul Fox is right and "awk" has to be blamed so... > > Well, it's rather easy to reduce it to trivial testcase: > > echo "GNU awk:" > echo "[set_1]" | /usr/bin/awk -F '[][]' 'NF==3 && $0 ~ /^\[.*\]/ { print $2 }' > echo "Bbox awk:" > echo "[set_1]" | /bin/awk -F '[][]' 'NF==3 && $0 ~ /^\[.*\]/ { print $2 }' > echo "End" > > # sh Setup1.sh > GNU awk: > set_1 > Bbox awk: > End > > Yes, awk is guilty. Hopefully fixed in svn. Please try latest svn or just replace awk.c in your tree with attached file. -- vda -------------- next part -------------- A non-text attachment was scrubbed... Name: awk.c.bz2 Type: application/x-bzip2 Size: 18505 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070718/e2187c04/attachment-0002.bin From vda.linux at googlemail.com Wed Jul 18 21:09:15 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 18 Jul 2007 22:09:15 +0100 Subject: Socket: Function not implemented errors in Busybox 1.6.1 In-Reply-To: <469E569C.6020009@iders.ca> References: <469E38D8.4060308@iders.ca> <469E569C.6020009@iders.ca> Message-ID: <1158166a0707181409w18e0636at9761e98ed055855@mail.gmail.com> > I have tested the busybox executable after being built with the following > command line, note that have the config file set up to build it statically at > this point: > make CROSS_COMPILE=arm-linux- V=1 all > > The resulting stripped Busybox executable is around 1.5MB. It executes fine, > and all socket operations work exactly as expected. > > However, when I install the executable to my root filesystem with the following > command: > make CROSS_COMPILE=arm-linux- V=1 CONFIG_PREFIX=/rootfs/ install Tried to reproduce, but it does not happen to me. You need to look deeper I'm afraid. Maybe use make -d to see why it rebuilds busybox? (Although output is plain scary...) -- vda From vda.linux at googlemail.com Wed Jul 18 21:27:06 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Wed, 18 Jul 2007 22:27:06 +0100 Subject: Probably a bug in ash In-Reply-To: <20070718205255.edb40556.sbb@tuxfamily.org> References: <20070628163439.50345aac.sbb@tuxfamily.org> <200707141920.06062.vda.linux@googlemail.com> <20070718205255.edb40556.sbb@tuxfamily.org> Message-ID: <1158166a0707181427i39823e49y3afd011614e4d9c0@mail.gmail.com> Yup. jp can be NULL. Should check for that, like this: #if JOBS /* For "jobs | cat" to work like in bash, we must retain list of jobs * in child, but we do need to remove ourself */ if (jp) freejob(jp); #else for (jp = curjob; jp; jp = jp->prev_job) freejob(jp); #endif Will fix in svn. Please notify dash maintainer too. Thanks for testing! -- vda From amckay at iders.ca Wed Jul 18 21:33:45 2007 From: amckay at iders.ca (Andrew McKay) Date: Wed, 18 Jul 2007 16:33:45 -0500 Subject: Socket: Function not implemented errors in Busybox 1.6.1 In-Reply-To: <1158166a0707181409w18e0636at9761e98ed055855@mail.gmail.com> References: <469E38D8.4060308@iders.ca> <469E569C.6020009@iders.ca> <1158166a0707181409w18e0636at9761e98ed055855@mail.gmail.com> Message-ID: <469E8739.6000701@iders.ca> Denis Vlasenko wrote: >> I have tested the busybox executable after being built with the following >> command line, note that have the config file set up to build it >> statically at >> this point: >> make CROSS_COMPILE=arm-linux- V=1 all >> >> The resulting stripped Busybox executable is around 1.5MB. It >> executes fine, >> and all socket operations work exactly as expected. >> >> However, when I install the executable to my root filesystem with the >> following >> command: >> make CROSS_COMPILE=arm-linux- V=1 CONFIG_PREFIX=/rootfs/ install > > Tried to reproduce, but it does not happen to me. You need to look > deeper I'm afraid. Maybe use make -d to see why it rebuilds busybox? > (Although output is plain scary...) > -- Thanks for the reply, I got side tracked today with some other tasks, but I've just gotten things working. It was a mistake on my end. I have one script that builds all the sources for my ramdisk, and another script that installs the sources for my ramdisk. I had their PATH variables set differently and pointing to two different cross compilers. Busybox was being compiled by the right compiler, but when 'make install' was called, the other compiler thought it hadn't linked busybox, and relinked it. The other compiler also had different Kernel Headers, so I think that's why it was broken. I fixed up my scripts and everything is working fine now. Thanks for your time, and sorry for the noise. Andrew McKay Iders Inc. From ynakam at hitachisoft.jp Thu Jul 19 01:17:59 2007 From: ynakam at hitachisoft.jp (Yuichi Nakamura) Date: Thu, 19 Jul 2007 10:17:59 +0900 Subject: [patch]setfiles/restorecon applet In-Reply-To: <200707172248.20432.vda.linux@googlemail.com> References: <20070702142205.3CC1.YNAKAM@hitachisoft.jp> <200707172248.20432.vda.linux@googlemail.com> Message-ID: <20070719101521.92B7.YNAKAM@hitachisoft.jp> Hi. Thanks for review and fixes. On Tue, 17 Jul 2007 22:48:20 +0100 Denis Vlasenko wrote: > Hi SELinux people, > > Sorry, late reply :(( > > On Monday 02 July 2007 06:29, Yuichi Nakamura wrote: > > I would like to submit setfiles/restorecon applet. > > setfiles and restorecon are SELinux commands that > > label files according to configuration file > > (in configuration file, relationship between file and label is > > described). > > > > These applets are very important for SELinux enabled system. > > Please review and consider merging this patch. > > Took a look: > > * Trimmed help text a bit > * Removed \n at the end of bb_[p]error > * Removed progname (using applet_name) > * Removed restorecon.c - USE_RESTORECON(APPLET_ODDNAME...) handles that > * int -> smallint for many flag variables > This needs improvement - many of those flags are already accessible > as (option_mask32 & BIT_MASK), you don't need separate variables > > Please take a look at: > * Do you really have to have fork()? I looked code again and found it unnecessary so removed. > * Maybe use xstrdup instead of strdupa Fixed. > * nftw() is not used in bbox. We have recursive_action(). > It will be better if we won't pull in nftw() into busybox > just for this applet. Fixed to use recursive_action instead of nftw. > * Do not do "if (applet_is_restorecon && option_x) bb_show_usage()" > Just remove 'x' flag from optarg32 instead. Fixed. > > If some of the above is not feasible, explain that. > > Please see attached updated patch. > -- > vda In addition, I am using struct globals for static data. Attached is revised patch, please look at. Regards, -- Yuichi Nakamura Hitachi Software Engineering Co., Ltd. Japan SELinux Users Group(JSELUG): http://www.selinux.gr.jp/ SELinux Policy Editor: http://seedit.sourceforge.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: setfiles.2.patch Type: application/octet-stream Size: 21155 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070719/0ec9d1b4/attachment-0002.obj From virtuoso at slind.org Thu Jul 19 07:24:56 2007 From: virtuoso at slind.org (Alexander Shishkin) Date: Thu, 19 Jul 2007 11:24:56 +0400 Subject: [PATCH] add a config option for ifstate location Message-ID: <11848298961166-git-send-email-virtuoso@slind.org> ifupdown keeps information on which interfaces are up in a file called ifstate. Typically it is located in /var/run/ifstate, however some distributions tend to put it in different places (like debian, for example, uses /etc/network/run/ifstate). This patch adds a config option that defines the location of ifstate. Signed-off-by: Alexander Shishkin --- networking/Config.in | 10 ++++++++++ networking/ifupdown.c | 8 +++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/networking/Config.in b/networking/Config.in index 77b5d25..b80d5ab 100644 --- a/networking/Config.in +++ b/networking/Config.in @@ -209,6 +209,16 @@ config FEATURE_IFCONFIG_BROADCAST_PLUS Setting this will make ifconfig attempt to find the broadcast automatically if the value '+' is used. +config IFSTATE_PATH + string "Absolute path to ifstate file" + default "/var/run/ifstate" + help + ifupdown keeps information on which interfaces are up in a file + called ifstate. Typically it is located in /var/run/ifstate, + however some distributions tend to put it in different places + (like debian, for example, uses /etc/network/run/ifstate). This + config option defines the location of ifstate. + config IFUPDOWN bool "ifupdown" default n diff --git a/networking/ifupdown.c b/networking/ifupdown.c index e9f0a64..5c7771a 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c @@ -10,7 +10,9 @@ * Changes to upstream version * Remove checks for kernel version, assume kernel version 2.2.0 or better. * Lines in the interfaces file cannot wrap. - * To adhere to the FHS, the default state file is /var/run/ifstate. + * To adhere to the FHS, the default state file is /var/run/ifstate + * (defined via CONFIG_IFSTATE_PATH) and can be overridden by build + * configuration. * * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. */ @@ -1105,7 +1107,7 @@ static llist_t *find_iface_state(llist_t *state_list, const char *iface) static llist_t *read_iface_state(void) { llist_t *state_list = NULL; - FILE *state_fp = fopen("/var/run/ifstate", "r"); + FILE *state_fp = fopen(CONFIG_IFSTATE_PATH, "r"); if (state_fp) { char *start, *end_ptr; @@ -1275,7 +1277,7 @@ int ifupdown_main(int argc, char **argv) } /* Actually write the new state */ - state_fp = xfopen("/var/run/ifstate", "w"); + state_fp = xfopen(CONFIG_IFSTATE_PATH, "w"); state = state_list; while (state) { if (state->data) { -- 1.5.1.2 From m.forster at advanced-business-solutions.de Thu Jul 19 08:21:06 2007 From: m.forster at advanced-business-solutions.de (Markus Forster) Date: Thu, 19 Jul 2007 10:21:06 +0200 Subject: WG: Problem with Busybox telnetd Message-ID: <200707191020781.SM01468@forstertosh> Hi there, i've activated telnetd in the menuconfig. All went good, i call the telnetd via inittab and its available. Port 23 is opened so i can connect. But the server closes the connection directly after connecting with the following message: Trying 192.168.20.30... Connected to 192.168.20.30. Escape character is '^]'. Connection closed by foreign host. Whats wrong with it? There are no PTY's in /dev, maybe thats the problem? How can i create these PTY's?` I'm using a small PXElinux, booting from PXE (udpcast initrd)... Regards, Markus From cristian.ionescu-idbohrn at axis.com Thu Jul 19 12:10:56 2007 From: cristian.ionescu-idbohrn at axis.com (Cristian Ionescu-Idbohrn) Date: Thu, 19 Jul 2007 14:10:56 +0200 (CEST) Subject: bb-ash and parameter expansion Message-ID: <0707191401100.1707@somehost> Had some troubles finding the expressions that work the same way in both bash, dash and ash (various versions) and put together a small script to help with the exercise. Couldn't find anything similar in the testsuite dir, so I thought it might be useful. Cheers, -- Cristian -------------- next part -------------- A non-text attachment was scrubbed... Name: bb-1word-extract-test.sh Type: application/x-sh Size: 722 bytes Desc: Url : http://lists.busybox.net/pipermail/busybox/attachments/20070719/9cc22315/attachment-0002.sh From virtuoso at slind.org Thu Jul 19 13:01:37 2007 From: virtuoso at slind.org (Alexander Shishkin) Date: Thu, 19 Jul 2007 17:01:37 +0400 Subject: [PATCH] add chpasswd applet Message-ID: <1184850097962-git-send-email-virtuoso@slind.org> This patch has been brewing in my busybox package for SLIND for quite a while (initially written against bb 1.01). chpasswd is useful for setting passwords in a non-interactive way. Description: chpasswd reads a file of user name and password pairs from standard input and uses this information to update a group of existing users. Signed-off-by: Alexander Shishkin --- include/applets.h | 1 + include/libbb.h | 3 + include/usage.h | 12 +++++ libbb/Kbuild | 3 +- libbb/update_passwd.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++++ loginutils/Config.in | 8 +++ loginutils/Kbuild | 1 + loginutils/chpasswd.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++++ loginutils/passwd.c | 109 -------------------------------------------- 9 files changed, 267 insertions(+), 110 deletions(-) create mode 100644 libbb/update_passwd.c create mode 100644 loginutils/chpasswd.c diff --git a/include/applets.h b/include/applets.h index 90af4f4..a05f74a 100644 --- a/include/applets.h +++ b/include/applets.h @@ -89,6 +89,7 @@ USE_CHCON(APPLET(chcon, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) USE_CHGRP(APPLET_NOEXEC(chgrp, chgrp, _BB_DIR_BIN, _BB_SUID_NEVER, chgrp)) USE_CHMOD(APPLET_NOEXEC(chmod, chmod, _BB_DIR_BIN, _BB_SUID_NEVER, chmod)) USE_CHOWN(APPLET_NOEXEC(chown, chown, _BB_DIR_BIN, _BB_SUID_NEVER, chown)) +USE_CHPASSWD(APPLET(chpasswd, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) USE_CHPST(APPLET(chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) USE_CHROOT(APPLET(chroot, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) USE_CHRT(APPLET(chrt, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) diff --git a/include/libbb.h b/include/libbb.h index 46860c6..bef3ca4 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -778,6 +778,9 @@ extern void print_login_prompt(void); extern void crypt_make_salt(char *p, int cnt); +extern int update_passwd(const char *filename, const char *username, + const char *new_pw); + int get_terminal_width_height(const int fd, int *width, int *height); int ioctl_or_perror(int fd, int request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))); diff --git a/include/usage.h b/include/usage.h index 29a4991..d2a51d2 100644 --- a/include/usage.h +++ b/include/usage.h @@ -2520,6 +2520,18 @@ " -l Locks (disables) the specified user account\n" \ " -u Unlocks (re-enables) the specified user account" +#define chpasswd_trivial_usage \ + "[--md5|--encrypt]" +#define chpasswd_full_usage \ + "Read user:password information from stdin\n" \ + "and update /etc/passwd accordingly." \ + "\n\nOptions:\n" \ + " -e, --encrypt\n" \ + " Supplied passwords are in encrypted form.\n" \ + " -m, --md5\n" \ + " Use MD5 encryption instead DES when the supplied\n" \ + " passwords are not encrypted.\n" + #define patch_trivial_usage \ "[-p] [-i ]" #define patch_full_usage \ diff --git a/libbb/Kbuild b/libbb/Kbuild index 6595867..c0cbe1a 100644 --- a/libbb/Kbuild +++ b/libbb/Kbuild @@ -104,7 +104,8 @@ lib-y += xreadlink.o lib-$(CONFIG_FEATURE_MOUNT_LOOP) += loop.o lib-$(CONFIG_LOSETUP) += loop.o lib-$(CONFIG_FEATURE_MTAB_SUPPORT) += mtab.o -lib-$(CONFIG_PASSWD) += pw_encrypt.o crypt_make_salt.o +lib-$(CONFIG_PASSWD) += pw_encrypt.o crypt_make_salt.o update_passwd.o +lib-$(CONFIG_CHPASSWD) += pw_encrypt.o crypt_make_salt.o update_passwd.o lib-$(CONFIG_CRYPTPW) += pw_encrypt.o crypt_make_salt.o lib-$(CONFIG_SULOGIN) += pw_encrypt.o lib-$(CONFIG_FEATURE_HTTPD_AUTH_MD5) += pw_encrypt.o diff --git a/libbb/update_passwd.c b/libbb/update_passwd.c new file mode 100644 index 0000000..292bfa5 --- /dev/null +++ b/libbb/update_passwd.c @@ -0,0 +1,120 @@ +/* vi: set sw=4 ts=4: */ +/* + * update_passwd + * + * update_passwd is a common function for passwd and chpasswd applets; + * it is responsible for updating password file (i.e. /etc/passwd or + * /etc/shadow) for a given user and password. + * + * Moved from loginutils/passwd.c by Alexander Shishkin + */ + +#include "libbb.h" + +int update_passwd(const char *filename, const char *username, + const char *new_pw) +{ + struct stat sb; + struct flock lock; + FILE *old_fp; + FILE *new_fp; + char *new_name; + char *last_char; + unsigned user_len; + int old_fd; + int new_fd; + int i; + int ret = 1; /* failure */ + + logmode = LOGMODE_STDIO; + /* New passwd file, "/etc/passwd+" for now */ + new_name = xasprintf("%s+", filename); + last_char = &new_name[strlen(new_name)-1]; + username = xasprintf("%s:", username); + user_len = strlen(username); + + old_fp = fopen(filename, "r+"); + if (!old_fp) + goto free_mem; + old_fd = fileno(old_fp); + + /* Try to create "/etc/passwd+". Wait if it exists. */ + i = 30; + do { + // FIXME: on last iteration try w/o O_EXCL but with O_TRUNC? + new_fd = open(new_name, O_WRONLY|O_CREAT|O_EXCL,0600); + if (new_fd >= 0) goto created; + if (errno != EEXIST) break; + usleep(100000); /* 0.1 sec */ + } while (--i); + bb_perror_msg("cannot create '%s'", new_name); + goto close_old_fp; + created: + if (!fstat(old_fd, &sb)) { + fchmod(new_fd, sb.st_mode & 0777); /* ignore errors */ + fchown(new_fd, sb.st_uid, sb.st_gid); + } + new_fp = fdopen(new_fd, "w"); + if (!new_fp) { + close(new_fd); + goto unlink_new; + } + + /* Backup file is "/etc/passwd-" */ + last_char[0] = '-'; + /* Delete old one, create new as a hardlink to current */ + i = (unlink(new_name) && errno != ENOENT); + if (i || link(filename, new_name)) + bb_perror_msg("warning: cannot create backup copy '%s'", new_name); + last_char[0] = '+'; + + /* Lock the password file before updating */ + lock.l_type = F_WRLCK; + lock.l_whence = SEEK_SET; + lock.l_start = 0; + lock.l_len = 0; + if (fcntl(old_fd, F_SETLK, &lock) < 0) + bb_perror_msg("warning: cannot lock '%s'", filename); + lock.l_type = F_UNLCK; + + /* Read current password file, write updated one */ + while (1) { + char *line = xmalloc_fgets(old_fp); + if (!line) break; /* EOF/error */ + if (strncmp(username, line, user_len) == 0) { + /* we have a match with "username:"... */ + const char *cp = line + user_len; + /* now cp -> old passwd, skip it: */ + cp = strchr(cp, ':'); + if (!cp) cp = ""; + /* now cp -> ':' after old passwd or -> "" */ + fprintf(new_fp, "%s%s%s", username, new_pw, cp); + /* Erase password in memory */ + } else + fputs(line, new_fp); + free(line); + } + fcntl(old_fd, F_SETLK, &lock); + + /* We do want all of them to execute, thus | instead of || */ + if ((ferror(old_fp) | fflush(new_fp) | fsync(new_fd) | fclose(new_fp)) + || rename(new_name, filename) + ) { + /* At least one of those failed */ + goto unlink_new; + } + ret = 0; /* whee, success! */ + + unlink_new: + if (ret) unlink(new_name); + + close_old_fp: + fclose(old_fp); + + free_mem: + if (ENABLE_FEATURE_CLEAN_UP) free(new_name); + if (ENABLE_FEATURE_CLEAN_UP) free((char*)username); + logmode = LOGMODE_BOTH; + return ret; +} + diff --git a/loginutils/Config.in b/loginutils/Config.in index f9ae122..63ae9b4 100644 --- a/loginutils/Config.in +++ b/loginutils/Config.in @@ -180,6 +180,14 @@ config CRYPTPW help Applet for crypting a string. +config CHPASSWD + bool "chpasswd" + default n + help + chpasswd reads a file of user name and password pairs from + standard input and uses this information to update a group of + existing users. + config SU bool "su" default n diff --git a/loginutils/Kbuild b/loginutils/Kbuild index 1b1165a..3d0d777 100644 --- a/loginutils/Kbuild +++ b/loginutils/Kbuild @@ -8,6 +8,7 @@ lib-y:= lib-$(CONFIG_ADDGROUP) += addgroup.o lib-$(CONFIG_ADDUSER) += adduser.o lib-$(CONFIG_CRYPTPW) += cryptpw.o +lib-$(CONFIG_CHPASSWD) += chpasswd.o lib-$(CONFIG_GETTY) += getty.o lib-$(CONFIG_LOGIN) += login.o lib-$(CONFIG_PASSWD) += passwd.o diff --git a/loginutils/chpasswd.c b/loginutils/chpasswd.c new file mode 100644 index 0000000..76db672 --- /dev/null +++ b/loginutils/chpasswd.c @@ -0,0 +1,120 @@ +/* vi: set sw=4 ts=4: */ +/* + * chpasswd.c + * + * Written for SLIND (from passwd.c) by Alexander Shishkin + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + */ + +#include /* for struct option */ +#include +#include "libbb.h" + +static struct option const chpasswd_opts[] = { + { "encrypted", no_argument, 0, 'e' }, + { "md5", no_argument, 0, 'm' } +}; + +int chpasswd_main(int argc, char **argv); +int chpasswd_main(int argc, char **argv) +{ + char *name, *cp, *myname, *ret; + char buf[80]; + char salt[sizeof("$N$XXXXXXXX")]; + int enc = 0; + int md5 = 0; + int flag, amroot; + const struct passwd *pw; + struct rlimit rlimit_fsize; + char *pwfile = +#ifndef ENABLE_FEATURE_SHADOWPASSWDS + bb_path_passwd_file; +#else + bb_path_shadow_file; +#endif + + amroot = (getuid() == 0); + myname = (char *) xstrdup(bb_getpwuid(NULL, getuid(), -1)); + while ((flag = getopt_long(argc, argv, "me", chpasswd_opts, NULL)) != EOF) { + switch (flag) { + case 'e': + enc = 1; + break; + case 'm': + md5 = 1; + break; + default: + bb_show_usage(); + } + } + + if (enc && md5) + bb_show_usage(); + + rlimit_fsize.rlim_cur = rlimit_fsize.rlim_max = 512L * 30000; + setrlimit(RLIMIT_FSIZE, &rlimit_fsize); + signal(SIGHUP, SIG_IGN); + signal(SIGINT, SIG_IGN); + signal(SIGQUIT, SIG_IGN); + umask(077); + + while (fgets(buf, sizeof buf, stdin) != NULL) { + cp = strchr(buf, '\n'); + if (cp) + *cp = '\0'; + else { + puts("Line too long.\n"); + continue; + } + + name = buf; + cp = strchr(name, ':'); + if (cp) + *cp++ = '\0'; + else { + puts("Missing new password.\n"); + continue; + } + + pw = getpwnam(name); + if (!pw) + bb_error_msg_and_die("Unknown user %s\n", name); + + if (!amroot && cp[0] == '!') { + syslog(LOG_WARNING, "password locked for `%s'", name); + bb_error_msg_and_die( + "The password for `%s' cannot be changed.\n", name + ); + } + + if (!enc) { + crypt_make_salt(salt, 1); + + if (md5) { + strcpy(salt, "$1$"); + crypt_make_salt(salt + 3, 4); + } + + ret = xstrdup(pw_encrypt(cp, salt)); + } else + ret = xstrdup(cp); + + if (!update_passwd(pwfile, pw->pw_name, ret)) { + syslog(LOG_INFO, "password for `%s' changed by user `%s'", name, + myname); + puts("Password changed.\n"); + } else { + syslog(LOG_WARNING, "an error occurred updating the password file"); + bb_error_msg_and_die( + "An error occurred updating the password file.\n" + ); + } + + free(ret); + } + + if (ENABLE_FEATURE_CLEAN_UP) free(myname); + + return 0; +} + diff --git a/loginutils/passwd.c b/loginutils/passwd.c index 8f65c3d..ac31682 100644 --- a/loginutils/passwd.c +++ b/loginutils/passwd.c @@ -70,115 +70,6 @@ static char* new_password(const struct passwd *pw, uid_t myuid, int algo) return ret; } - -static int update_passwd(const char *filename, const char *username, - const char *new_pw) -{ - struct stat sb; - struct flock lock; - FILE *old_fp; - FILE *new_fp; - char *new_name; - char *last_char; - unsigned user_len; - int old_fd; - int new_fd; - int i; - int ret = 1; /* failure */ - - logmode = LOGMODE_STDIO; - /* New passwd file, "/etc/passwd+" for now */ - new_name = xasprintf("%s+", filename); - last_char = &new_name[strlen(new_name)-1]; - username = xasprintf("%s:", username); - user_len = strlen(username); - - old_fp = fopen(filename, "r+"); - if (!old_fp) - goto free_mem; - old_fd = fileno(old_fp); - - /* Try to create "/etc/passwd+". Wait if it exists. */ - i = 30; - do { - // FIXME: on last iteration try w/o O_EXCL but with O_TRUNC? - new_fd = open(new_name, O_WRONLY|O_CREAT|O_EXCL,0600); - if (new_fd >= 0) goto created; - if (errno != EEXIST) break; - usleep(100000); /* 0.1 sec */ - } while (--i); - bb_perror_msg("cannot create '%s'", new_name); - goto close_old_fp; - created: - if (!fstat(old_fd, &sb)) { - fchmod(new_fd, sb.st_mode & 0777); /* ignore errors */ - fchown(new_fd, sb.st_uid, sb.st_gid); - } - new_fp = fdopen(new_fd, "w"); - if (!new_fp) { - close(new_fd); - goto unlink_new; - } - - /* Backup file is "/etc/passwd-" */ - last_char[0] = '-'; - /* Delete old one, create new as a hardlink to current */ - i = (unlink(new_name) && errno != ENOENT); - if (i || link(filename, new_name)) - bb_perror_msg("warning: cannot create backup copy '%s'", new_name); - last_char[0] = '+'; - - /* Lock the password file before updating */ - lock.l_type = F_WRLCK; - lock.l_whence = SEEK_SET; - lock.l_start = 0; - lock.l_len = 0; - if (fcntl(old_fd, F_SETLK, &lock) < 0) - bb_perror_msg("warning: cannot lock '%s'", filename); - lock.l_type = F_UNLCK; - - /* Read current password file, write updated one */ - while (1) { - char *line = xmalloc_fgets(old_fp); - if (!line) break; /* EOF/error */ - if (strncmp(username, line, user_len) == 0) { - /* we have a match with "username:"... */ - const char *cp = line + user_len; - /* now cp -> old passwd, skip it: */ - cp = strchr(cp, ':'); - if (!cp) cp = ""; - /* now cp -> ':' after old passwd or -> "" */ - fprintf(new_fp, "%s%s%s", username, new_pw, cp); - /* Erase password in memory */ - } else - fputs(line, new_fp); - free(line); - } - fcntl(old_fd, F_SETLK, &lock); - - /* We do want all of them to execute, thus | instead of || */ - if ((ferror(old_fp) | fflush(new_fp) | fsync(new_fd) | fclose(new_fp)) - || rename(new_name, filename) - ) { - /* At least one of those failed */ - goto unlink_new; - } - ret = 0; /* whee, success! */ - - unlink_new: - if (ret) unlink(new_name); - - close_old_fp: - fclose(old_fp); - - free_mem: - if (ENABLE_FEATURE_CLEAN_UP) free(new_name); - if (ENABLE_FEATURE_CLEAN_UP) free((char*)username); - logmode = LOGMODE_BOTH; - return ret; -} - - int passwd_main(int argc, char **argv); int passwd_main(int argc, char **argv) { -- 1.5.1.2 From farmatito at tiscali.it Thu Jul 19 13:40:37 2007 From: farmatito at tiscali.it (Tito) Date: Thu, 19 Jul 2007 15:40:37 +0200 Subject: [PATCH] add chpasswd applet In-Reply-To: <1184850097962-git-send-email-virtuoso@slind.org> References: <1184850097962-git-send-email-virtuoso@slind.org> Message-ID: <200707191540.37286.farmatito@tiscali.it> On Thursday 19 July 2007 15:01:37 Alexander Shishkin wrote: > diff --git a/include/applets.h b/include/applets.h > index 90af4f4..a05f74a 100644 Hi, would you mind to send the patch as attachment and in diff -uN format. I'm experiencing some difficulties to apply and test it. patch -p1 -E --dry-run < chpasswd.patch patching file include/applets.h patch: **** malformed patch at line 20: ?USE_CHGRP(APPLET_NOEXEC(chgrp, chgrp, _BB_DIR_BIN, _BB_SUID_NEVER, chgrp)) Ciao, Tito From virtuoso at slind.org Thu Jul 19 13:49:44 2007 From: virtuoso at slind.org (Alexander Shishkin) Date: Thu, 19 Jul 2007 17:49:44 +0400 Subject: [PATCH] add chpasswd applet In-Reply-To: <200707191540.37286.farmatito@tiscali.it> References: <1184850097962-git-send-email-virtuoso@slind.org> <200707191540.37286.farmatito@tiscali.it> Message-ID: <71a0d6ff0707190649x6381898dx8d5cd73a03def82b@mail.gmail.com> On 7/19/07, Tito wrote: > Hi, would you mind to send the patch as attachment and > in diff -uN format. > I'm experiencing some difficulties to apply and test it. Oh, sorry about this. I always get a bit too carried away with git these days. :) Please find the patch attached. Regards, -- Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: add-chpasswd.patch Type: text/x-patch Size: 13808 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070719/2885436d/attachment-0002.bin From farmatito at tiscali.it Thu Jul 19 14:50:35 2007 From: farmatito at tiscali.it (Tito) Date: Thu, 19 Jul 2007 16:50:35 +0200 Subject: [PATCH] add chpasswd applet In-Reply-To: <71a0d6ff0707190649x6381898dx8d5cd73a03def82b@mail.gmail.com> References: <1184850097962-git-send-email-virtuoso@slind.org> <200707191540.37286.farmatito@tiscali.it> <71a0d6ff0707190649x6381898dx8d5cd73a03def82b@mail.gmail.com> Message-ID: <200707191650.35491.farmatito@tiscali.it> On Thursday 19 July 2007 15:49:44 Alexander Shishkin wrote: > On 7/19/07, Tito wrote: > > Hi, would you mind to send the patch as attachment and > > in diff -uN format. > > I'm experiencing some difficulties to apply and test it. > Oh, sorry about this. I always get a bit too carried away with git > these days. :) > Please find the patch attached. > > Regards, Hi, attached you will find a drop in replacement for chpasswd.c with some more busyboxification (use of getopt32 and syslogging capabilities of bb_*_msg_* functions) and some things it seems to me that need to be fixed (this could be done to me being in hurry and not understanding you code... in this case ignore it). This code is only compile tested and needs more care and love. ;-) Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: chpasswd.c Type: text/x-csrc Size: 2638 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070719/e9b978be/attachment-0002.c From sbb at tuxfamily.org Thu Jul 19 16:34:46 2007 From: sbb at tuxfamily.org (Seb) Date: Thu, 19 Jul 2007 18:34:46 +0200 Subject: Probably a bug in ash In-Reply-To: <1158166a0707181427i39823e49y3afd011614e4d9c0@mail.gmail.com> References: <20070628163439.50345aac.sbb@tuxfamily.org> <200707141920.06062.vda.linux@googlemail.com> <20070718205255.edb40556.sbb@tuxfamily.org> <1158166a0707181427i39823e49y3afd011614e4d9c0@mail.gmail.com> Message-ID: <20070719183446.557937e4.sbb@tuxfamily.org> Le Wed, 18 Jul 2007 22:27:06 +0100 "Denis Vlasenko" a ?crit: > Yup. jp can be NULL. Should check for that, like this: > > #if JOBS > /* For "jobs | cat" to work like in bash, we must retain list of jobs > * in child, but we do need to remove ourself */ > if (jp) > freejob(jp); > #else > for (jp = curjob; jp; jp = jp->prev_job) > freejob(jp); > #endif > > Will fix in svn. Please notify dash maintainer too. Ok, it works for both bbox ash and dash. I will post the new patch to Herbert Xu. Although, the problem of infinite loop previously described persists with dash as with bboxash. Do you think it's another side effect of the patch that should be fixed first, or can I send this one "as is" right now ? ++ Seb. From pgf at brightstareng.com Thu Jul 19 18:28:48 2007 From: pgf at brightstareng.com (Paul Fox) Date: Thu, 19 Jul 2007 14:28:48 -0400 Subject: [PATCH] add chpasswd applet In-Reply-To: farmatito's message of Thu, 19 Jul 2007 16:50:35 +0200. <200707191650.35491.farmatito@tiscali.it> Message-ID: <8778.1184869728@brightstareng.com> > attached you will find a drop in replacement > for chpasswd.c with some more busyboxification does this mean that passwd no longer needs the ability to take a password on stdin? there was a thread on that topic a week or two ago. paul =--------------------- paul fox, pgf at brightstareng.com From vda.linux at googlemail.com Thu Jul 19 20:12:57 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 19 Jul 2007 21:12:57 +0100 Subject: WG: Problem with Busybox telnetd In-Reply-To: <200707191020781.SM01468@forstertosh> References: <200707191020781.SM01468@forstertosh> Message-ID: <200707192112.57936.vda.linux@googlemail.com> On Thursday 19 July 2007 09:21, Markus Forster wrote: > Hi there, > > i've activated telnetd in the menuconfig. All went good, i call the telnetd > via inittab and its available. Port 23 is opened so i can connect. > But the server closes the connection directly after connecting with the > following message: > > Trying 192.168.20.30... > Connected to 192.168.20.30. > Escape character is '^]'. > Connection closed by foreign host. > > Whats wrong with it? Strace it. If you can't do that, run it like this: telnetd -F | nc -nu 12345 It will make telnetd send error messages to stdout instead of syslog, and then nc will pipe them into network. Use nc (or tcpdump) to see the telnetd's output from the box as UDP packets arriving to your port 12345. -- vda From virtuoso at slind.org Thu Jul 19 20:38:45 2007 From: virtuoso at slind.org (Alexander Shishkin) Date: Fri, 20 Jul 2007 00:38:45 +0400 Subject: Fwd: [PATCH] add chpasswd applet In-Reply-To: <71a0d6ff0707191333q43af07e8u1ea68da509106ce7@mail.gmail.com> References: <200707191650.35491.farmatito@tiscali.it> <8778.1184869728@brightstareng.com> <71a0d6ff0707191333q43af07e8u1ea68da509106ce7@mail.gmail.com> Message-ID: <71a0d6ff0707191338t70c14c5fo838db1a5cd6377c4@mail.gmail.com> On 7/19/07, Paul Fox wrote: > > attached you will find a drop in replacement > > for chpasswd.c with some more busyboxification > > does this mean that passwd no longer needs the ability to > take a password on stdin? there was a thread on that topic > a week or two ago. Well, given that normally passwd isn't supposed to do that kind of thing and chpasswd exists exactly for that purpose, I hope it does. Regards, -- Alex From virtuoso at slind.org Thu Jul 19 20:37:43 2007 From: virtuoso at slind.org (Alexander Shishkin) Date: Fri, 20 Jul 2007 00:37:43 +0400 Subject: Fwd: [PATCH] add chpasswd applet In-Reply-To: <71a0d6ff0707191328k1c2eeeb3scc303b87434bdaf@mail.gmail.com> References: <1184850097962-git-send-email-virtuoso@slind.org> <200707191540.37286.farmatito@tiscali.it> <71a0d6ff0707190649x6381898dx8d5cd73a03def82b@mail.gmail.com> <200707191650.35491.farmatito@tiscali.it> <71a0d6ff0707191328k1c2eeeb3scc303b87434bdaf@mail.gmail.com> Message-ID: <71a0d6ff0707191337i6acb045ch595afb7c70896f60@mail.gmail.com> On 7/19/07, Tito wrote: > Hi, Hi, > attached you will find a drop in replacement > for chpasswd.c with some more busyboxification > (use of getopt32 and syslogging capabilities of > bb_*_msg_* functions) and some things it seems to me that > need to be fixed (this could be done to me being in hurry > and not understanding you code... in this case ignore it). > This code is only compile tested and needs more care and love. ;-) Thanks for pointing these things out! I've done some more tweaking on the applet. Attached please find an updated patch. Regards, -- Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: add-chpasswd_take2.patch Type: text/x-patch Size: 13397 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070720/44ad3fc2/attachment-0002.bin From farmatito at tiscali.it Thu Jul 19 20:55:42 2007 From: farmatito at tiscali.it (Tito) Date: Thu, 19 Jul 2007 22:55:42 +0200 Subject: Fwd: [PATCH] add chpasswd applet -- use passwd instead In-Reply-To: <71a0d6ff0707191337i6acb045ch595afb7c70896f60@mail.gmail.com> References: <1184850097962-git-send-email-virtuoso@slind.org> <71a0d6ff0707191328k1c2eeeb3scc303b87434bdaf@mail.gmail.com> <71a0d6ff0707191337i6acb045ch595afb7c70896f60@mail.gmail.com> Message-ID: <200707192255.42734.farmatito@tiscali.it> On Thursday 19 July 2007 22:37:43 Alexander Shishkin wrote: > On 7/19/07, Tito wrote: > > Hi, > Hi, > > > attached you will find a drop in replacement > > for chpasswd.c with some more busyboxification > > (use of getopt32 and syslogging capabilities of > > bb_*_msg_* functions) and some things it seems to me that > > need to be fixed (this could be done to me being in hurry > > and not understanding you code... in this case ignore it). > > This code is only compile tested and needs more care and love. ;-) > Thanks for pointing these things out! I've done some more tweaking on > the applet. Attached please find an updated patch. > > Regards, > -- > Alex > Hi, would something like passwd USER PASSWORD work for you? If yes, can you please test this modified version of passwd. So we can avoid code duplication. The non interactive mode is switched on with a config option. Add this to loginutils/Config.in after config FEATURE_PASSWD_WEAK_CHECK. --------------------------------- config FEATURE_NON_INTERACTIVE_PASSWD bool "Allow passwords to be set non interactively (UNSAFE)" default n depends on PASSWD help With this option passwd will accept USER and PASSWD from the command line and set them non interactively. THIS IS UNSAFE!!! ------------------------------------ and use passwd.c as drop-in replacement. (TODO the help text in usage.h needs to be fixed.) This is only a little tested, hints, critics and improvements are welcome. If this solution is not ok for you i'll give one more look at your patch. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: passwd.c Type: text/x-csrc Size: 8124 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070719/6e4fad99/attachment-0002.c From virtuoso at slind.org Thu Jul 19 21:32:09 2007 From: virtuoso at slind.org (Alexander Shishkin) Date: Fri, 20 Jul 2007 01:32:09 +0400 Subject: Fwd: [PATCH] add chpasswd applet -- use passwd instead In-Reply-To: <200707192255.42734.farmatito@tiscali.it> References: <1184850097962-git-send-email-virtuoso@slind.org> <71a0d6ff0707191328k1c2eeeb3scc303b87434bdaf@mail.gmail.com> <71a0d6ff0707191337i6acb045ch595afb7c70896f60@mail.gmail.com> <200707192255.42734.farmatito@tiscali.it> Message-ID: <71a0d6ff0707191432r1e24937m2e09a70bc7f469d@mail.gmail.com> On 7/20/07, Tito wrote: > Hi, Hi, > would something like passwd USER PASSWORD work for you? Unfortunately it won't, the reason being that the distro has two variants of core system (one busybox based and another -- coreutils based), and at least bootstrapping procedure relies on both variants having chpasswd. (and of course, both variants have to provide roughly same functionality). Not to mention a perfectly valid statement made here http://busybox.net/lists/busybox/2007-July/028093.html > If yes, can you please test this modified version of passwd. > So we can avoid code duplication. Is it really better than having another little function? > The non interactive mode is switched on with a config option. > Add this to loginutils/Config.in after config FEATURE_PASSWD_WEAK_CHECK. > --------------------------------- > config FEATURE_NON_INTERACTIVE_PASSWD > bool "Allow passwords to be set non interactively (UNSAFE)" > default n > depends on PASSWD > help > With this option passwd will accept USER and PASSWD from > the command line and set them non interactively. > THIS IS UNSAFE!!! > ------------------------------------ > > and use passwd.c as drop-in replacement. > (TODO the help text in usage.h needs to be fixed.) > > This is only a little tested, hints, critics and improvements are welcome. > If this solution is not ok for you i'll give one more look at your patch. Well, I'd be grateful. If you still find code duplication matter serious here, I'd volunteer to invest some time into reworking {ch,}passwd.c to minimize/eliminate this duplication. Regards, -- Alex From vda.linux at googlemail.com Thu Jul 19 21:42:50 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 19 Jul 2007 22:42:50 +0100 Subject: [PATCH] add a config option for ifstate location In-Reply-To: <11848298961166-git-send-email-virtuoso@slind.org> References: <11848298961166-git-send-email-virtuoso@slind.org> Message-ID: <200707192242.50909.vda.linux@googlemail.com> On Thursday 19 July 2007 08:24, Alexander Shishkin wrote: > ifupdown keeps information on which interfaces are up in a file > called ifstate. Typically it is located in /var/run/ifstate, > however some distributions tend to put it in different places > (like debian, for example, uses /etc/network/run/ifstate). This > patch adds a config option that defines the location of ifstate. Applied to svn, thanks. -- vda From vda.linux at googlemail.com Thu Jul 19 22:45:26 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Thu, 19 Jul 2007 23:45:26 +0100 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070719101521.92B7.YNAKAM@hitachisoft.jp> References: <20070702142205.3CC1.YNAKAM@hitachisoft.jp> <200707172248.20432.vda.linux@googlemail.com> <20070719101521.92B7.YNAKAM@hitachisoft.jp> Message-ID: <200707192345.26805.vda.linux@googlemail.com> Hi, Unlike me, you aren't late with replies. Cool. On Thursday 19 July 2007 02:17, Yuichi Nakamura wrote: > > Sorry, late reply :(( > > > > On Monday 02 July 2007 06:29, Yuichi Nakamura wrote: > > > I would like to submit setfiles/restorecon applet. > > > setfiles and restorecon are SELinux commands that > > > label files according to configuration file > > > (in configuration file, relationship between file and label is > > > described). > > > > > > These applets are very important for SELinux enabled system. > > > Please review and consider merging this patch. > > > > Took a look: > > > > * Trimmed help text a bit > > * Removed \n at the end of bb_[p]error > > * Removed progname (using applet_name) > > * Removed restorecon.c - USE_RESTORECON(APPLET_ODDNAME...) handles that > > * int -> smallint for many flag variables > > This needs improvement - many of those flags are already accessible > > as (option_mask32 & BIT_MASK), you don't need separate variables > > > > Please take a look at: > > * Do you really have to have fork()? > I looked code again and found it unnecessary so removed. > > > > * Maybe use xstrdup instead of strdupa > Fixed. > > > * nftw() is not used in bbox. We have recursive_action(). > > It will be better if we won't pull in nftw() into busybox > > just for this applet. > Fixed to use recursive_action instead of nftw. > > > * Do not do "if (applet_is_restorecon && option_x) bb_show_usage()" > > Just remove 'x' flag from optarg32 instead. > Fixed. > > > > > If some of the above is not feasible, explain that. > > > > Please see attached updated patch. > > -- > > vda > > In addition, I am using struct globals for static data. > Attached is revised patch, please look at. See attached patch. bb_common_bufsiz1 trick must have compile-time check (unless it's trivially obvious that it is ok, like "I have 10 static ints only") unsigned long long count; Provided that you rarely see more than 4000000000 files and even then count overflow only upset star display (cosmetics), please use just "unsigned". static int restore(const char *file) { char *my_file = strdupa(file); Convert to xstrdup please. if (count % 1000 == 0) { if (count % 80000 == 0) Maybe ((count & 0x3ff) == 0) /* every 1024 files */ - code may be smaller & faster... bb_error_msg("%s not reset customized by admin to %s", "FILE not reset customized by admin to XXXX" - I think colon and/or commas need to added. Maybe "FILE: not reset, customized by admin to XXXX" but I still don't 100% understand the message. Maybe "File's context not reset"? And what does "customized by root" mean - file's context is set in some /etc/xxx file? Try to provide a clear message. (Sometimes it takes quite a time to come up with clear _and_ not very long message. Take that time). if (context) freecon(context); if() is redundant. ret = lsetfilecon(my_file, newcon); if (ret) { bb_perror_msg("lsetfileconon(%s,%s)", my_file, newcon); goto out; } out: freecon(newcon); return 0; err: freecon(newcon); return -1; Maybe it makes sense to group all three free() here, ensure that variables are allocated or NULL: retval = 0; ... ... err: retval--; /* == -1 */ out: free(my_file); freecon(context); freecon(newcon); return retval; } and you will have single exit point (and probably smaller code - 3 free[con] instead of 5 you have now). #define OPT_c (1<<0) ... if (applet_name[0] == 'r') { /* restorecon */ flags = getopt32(argc, argv, "de:f:ilnpqrsvo:FRW", &exclude_dir, &input_filename, &out_filename, &verbose); } else { /* setfiles */ flags = getopt32(argc, argv, "c:de:f:ilnpqr:svo:FW", &policyfile, &exclude_dir, &input_filename, &rootpath, &out_filename, } For restorecon OPT_c will mean "-d"! In such cases you just need to move all common flags to the beginning of string, the rest should be after. IOW: - "de:f:ilnpqrsvo:FRW" - "c:de:f:ilnpqr:svo:FW" + "de:f:ilnpqrsvo:FWR" + "de:f:ilnpqr:svo:FWc:" with OPT_xxx renumbered accordingly. #if ENABLE_FEATURE_SETFILES_CHECK_OPTION ... #else bb_error_msg_and_die("-c is not supported"); #endif Just add "c:" to getopt32 string conditionally instead: "xxxxxxxxxxxxxxxx" USE_FEATURE_SETFILES_CHECK_OPTION("c:") -- vda -------------- next part -------------- A non-text attachment was scrubbed... Name: 2.patch Type: text/x-diff Size: 22178 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070719/1824cf07/attachment-0002.bin From ynakam at hitachisoft.jp Fri Jul 20 04:29:07 2007 From: ynakam at hitachisoft.jp (Yuichi Nakamura) Date: Fri, 20 Jul 2007 13:29:07 +0900 Subject: [patch]setfiles/restorecon applet In-Reply-To: <200707192345.26805.vda.linux@googlemail.com> References: <20070719101521.92B7.YNAKAM@hitachisoft.jp> <200707192345.26805.vda.linux@googlemail.com> Message-ID: <20070720132230.60CB.YNAKAM@hitachisoft.jp> On Thu, 19 Jul 2007 23:45:26 +0100 Denis Vlasenko wrote: > Hi, > > Unlike me, you aren't late with replies. Cool. Thank you. And thanks your quick reply too ! > > Attached is revised patch, please look at. > > See attached patch. bb_common_bufsiz1 trick must have compile-time check > (unless it's trivially obvious that it is ok, like "I have 10 static ints only") > > unsigned long long count; > > Provided that you rarely see more than 4000000000 files and even then > count overflow only upset star display (cosmetics), please use just "unsigned". Fixed. Using unsigned. > > static int restore(const char *file) > { > char *my_file = strdupa(file); > > Convert to xstrdup please. > > if (count % 1000 == 0) { > if (count % 80000 == 0) > > Maybe ((count & 0x3ff) == 0) /* every 1024 files */ > - code may be smaller & faster... Fixed. > > bb_error_msg("%s not reset customized by admin to %s", > > "FILE not reset customized by admin to XXXX" - I think colon and/or > commas need to added. Maybe > > "FILE: not reset, customized by admin to XXXX" > > but I still don't 100% understand the message. Maybe "File's context not reset"? > And what does "customized by root" mean - file's context is set in some /etc/xxx file? > Try to provide a clear message. (Sometimes it takes quite a time > to come up with clear _and_ not very long message. Take that time). Fixed. Made it shorter. > > if (context) > freecon(context); > > if() is redundant. > > ret = lsetfilecon(my_file, newcon); > if (ret) { > bb_perror_msg("lsetfileconon(%s,%s)", my_file, newcon); > goto out; > } > out: > freecon(newcon); > return 0; > err: > freecon(newcon); > return -1; > > Maybe it makes sense to group all three free() here, ensure that variables > are allocated or NULL: > > retval = 0; > ... > ... > err: > retval--; /* == -1 */ > out: > free(my_file); > freecon(context); > freecon(newcon); > return retval; > } > > and you will have single exit point (and probably smaller code - 3 free[con] > instead of 5 you have now). OOps, I have forgotten to free my_file. Fixed. > > > > #define OPT_c (1<<0) > ... > if (applet_name[0] == 'r') { /* restorecon */ > flags = getopt32(argc, argv, "de:f:ilnpqrsvo:FRW", &exclude_dir, &input_filename, &out_filename, &verbose); > } else { /* setfiles */ > flags = getopt32(argc, argv, "c:de:f:ilnpqr:svo:FW", &policyfile, &exclude_dir, &input_filename, &rootpath, &out_filename, > } > > For restorecon OPT_c will mean "-d"! > In such cases you just need to move all common flags to the beginning > of string, the rest should be after. IOW: > > - "de:f:ilnpqrsvo:FRW" > - "c:de:f:ilnpqr:svo:FW" > + "de:f:ilnpqrsvo:FWR" > + "de:f:ilnpqr:svo:FWc:" > > with OPT_xxx renumbered accordingly. It was a big mistake. Fixed. > > > > #if ENABLE_FEATURE_SETFILES_CHECK_OPTION > ... > #else > bb_error_msg_and_die("-c is not supported"); > #endif > > Just add "c:" to getopt32 string conditionally instead: > "xxxxxxxxxxxxxxxx" USE_FEATURE_SETFILES_CHECK_OPTION("c:") Fixed. > -- > vda Attached is updated patch. Regards, -- Yuichi Nakamura Hitachi Software Engineering Co., Ltd. Japan SELinux Users Group(JSELUG): http://www.selinux.gr.jp/ SELinux Policy Editor: http://seedit.sourceforge.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: 3.patch Type: application/octet-stream Size: 22010 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070720/260e5873/attachment-0002.obj From vda.linux at googlemail.com Fri Jul 20 19:44:17 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 20 Jul 2007 20:44:17 +0100 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070720132230.60CB.YNAKAM@hitachisoft.jp> References: <20070719101521.92B7.YNAKAM@hitachisoft.jp> <200707192345.26805.vda.linux@googlemail.com> <20070720132230.60CB.YNAKAM@hitachisoft.jp> Message-ID: <200707202044.17800.vda.linux@googlemail.com> On Friday 20 July 2007 05:29, Yuichi Nakamura wrote: > Attached is updated patch. I changed it a bit, see attached. Can you clarify this part? ret = lsetfilecon(my_file, newcon); if (ret) { bb_perror_msg("lsetfileconon(%s,%s)", my_file, newcon); goto out; } err: retval--; out: freecon(context); freecon(newcon); free(my_file_orig); return retval; } Looks like if lsetfilecon fails, we return success - ?! Is it really right? -- vda -------------- next part -------------- A non-text attachment was scrubbed... Name: 2.patch Type: text/x-diff Size: 22381 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070720/0e7b743d/attachment-0002.bin From vda.linux at googlemail.com Fri Jul 20 21:22:56 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 20 Jul 2007 22:22:56 +0100 Subject: Fwd: [PATCH] add chpasswd applet In-Reply-To: <71a0d6ff0707191337i6acb045ch595afb7c70896f60@mail.gmail.com> References: <1184850097962-git-send-email-virtuoso@slind.org> <71a0d6ff0707191328k1c2eeeb3scc303b87434bdaf@mail.gmail.com> <71a0d6ff0707191337i6acb045ch595afb7c70896f60@mail.gmail.com> Message-ID: <200707202222.56596.vda.linux@googlemail.com> On Thursday 19 July 2007 21:37, Alexander Shishkin wrote: > On 7/19/07, Tito wrote: > > Hi, > Hi, > > > attached you will find a drop in replacement > > for chpasswd.c with some more busyboxification > > (use of getopt32 and syslogging capabilities of > > bb_*_msg_* functions) and some things it seems to me that > > need to be fixed (this could be done to me being in hurry > > and not understanding you code... in this case ignore it). > > This code is only compile tested and needs more care and love. ;-) > Thanks for pointing these things out! I've done some more tweaking on > the applet. Attached please find an updated patch. Question: why malformed line without password results in warning, but invalid username aborts? bb_error_msg("missing new password"); continue; } *pass++ = '\0'; if (!getpwnam(name)) bb_error_msg_and_die("unknown user %s", name); Seems inconsistent to me. Btw, do we need to check that user exists? Without such check, nonexistent users are just ignored and code is smaller. Testing it. Nice: echo -e "guest:qqqq\ntest:qqqq" | ./busybox chpasswd and crypt_make_salt() generates same salt for both! :)) Bunch of other bugs too: shadow passwords check is backwards,... Applied to svn. Enjoy/test. -- vda From vda.linux at googlemail.com Fri Jul 20 21:25:55 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 20 Jul 2007 22:25:55 +0100 Subject: busybox post from creder@digitalcpt.com requires approval In-Reply-To: References: Message-ID: <200707202225.55244.vda.linux@googlemail.com> On Friday 20 July 2007 16:25, busybox-owner at busybox.net wrote: > As list administrator, your authorization is requested for the > following mailing list posting: > > List: busybox at busybox.net > From: creder at digitalcpt.com > Subject: tftp, kernel crash, attempt to kill init > Reason: Message body is too big: 134265 bytes with a limit of 40 KB > > At your convenience, visit: > > http://busybox.net/cgi-bin/mailman/admindb/busybox > > to approve or deny the request. Hello all, I am using busybox v 1.5.1 with tftp. ?I have been trying to use tftp to get files and update u-boot and the kernel in our AT91RM9200 system. I used to have the file system with busybox on a nor flash and it would crash out after transferring about 300k worth of a file (kernel is about 1.3 mb). ?Because we had to move the file system to our nand flash, I didn't debug it. ?Now that it is on the nand flash, I get the following crash dump. Is there anything that I need to setup in order for busybox to properly write to the flash? Any help or guidance would be appreciated. Start by sending smaller mails to mailing lists. Is it NOMMU architechture? -- vda From creder at digitalcpt.com Fri Jul 20 21:47:03 2007 From: creder at digitalcpt.com (Christopher Reder) Date: Fri, 20 Jul 2007 21:47:03 -0000 Subject: busybox post from creder@digitalcpt.com requires approval Message-ID: <200707201635.SM00588@mail.digitalcpt.com> Denis, yes, I only realized after sending it that it was too long and in fact, canceled the message on the website. This does have a MMU and is a ARM0, AT91RM9200. When using the Nor Flash, after transferring about 320k, the kernel crashes and the transfer aborts. Has anyone been able to use tftp for larger files (>1MB) without issues on v1.5.1 ? TIA and sorry about the longer output. ---------- Original Message ---------------------------------- From: Denis Vlasenko Date: Fri, 20 Jul 2007 22:25:55 +0100 >On Friday 20 July 2007 16:25, busybox-owner at busybox.net wrote: >> As list administrator, your authorization is requested for the >> following mailing list posting: >>=20 >> List: busybox at busybox.net >> From: creder at digitalcpt.com >> Subject: tftp, kernel crash, attempt to kill init >> Reason: Message body is too big: 134265 bytes with a limit of 40 KB >>=20 >> At your convenience, visit: >>=20 >> http://busybox.net/cgi-bin/mailman/admindb/busybox >> =20 >> to approve or deny the request. > > >Hello all, I am using busybox v 1.5.1 with tftp. =9AI have been trying to u= >se >tftp to get files and update u-boot and the kernel in our AT91RM9200 system. >I used to have the file system with busybox on a nor flash and it would >crash out after transferring about 300k worth of a file (kernel is about 1.3 >mb). =9ABecause we had to move the file system to our nand flash, I didn't >debug it. =9ANow that it is on the nand flash, I get the following crash du= >mp. >Is there anything that I need to setup in order for busybox to properly >write to the flash? > >Any help or guidance would be appreciated. > > >Start by sending smaller mails to mailing lists. > >Is it NOMMU architechture? >=2D- >vda From farmatito at tiscali.it Fri Jul 20 22:12:47 2007 From: farmatito at tiscali.it (Tito) Date: Sat, 21 Jul 2007 00:12:47 +0200 Subject: Fwd: [PATCH] add chpasswd applet In-Reply-To: <200707202222.56596.vda.linux@googlemail.com> References: <1184850097962-git-send-email-virtuoso@slind.org> <71a0d6ff0707191337i6acb045ch595afb7c70896f60@mail.gmail.com> <200707202222.56596.vda.linux@googlemail.com> Message-ID: <200707210012.47455.farmatito@tiscali.it> On Friday 20 July 2007 23:22:56 Denis Vlasenko wrote: > On Thursday 19 July 2007 21:37, Alexander Shishkin wrote: > > On 7/19/07, Tito wrote: > > > Hi, > > Hi, > > > > > attached you will find a drop in replacement > > > for chpasswd.c with some more busyboxification > > > (use of getopt32 and syslogging capabilities of > > > bb_*_msg_* functions) and some things it seems to me that > > > need to be fixed (this could be done to me being in hurry > > > and not understanding you code... in this case ignore it). > > > This code is only compile tested and needs more care and love. ;-) > > Thanks for pointing these things out! I've done some more tweaking on > > the applet. Attached please find an updated patch. > > Question: why malformed line without password results in warning, > but invalid username aborts? > > bb_error_msg("missing new password"); > continue; > } > *pass++ = '\0'; > > if (!getpwnam(name)) > bb_error_msg_and_die("unknown user %s", name); > > Seems inconsistent to me. > > Btw, do we need to check that user exists? Without such check, > nonexistent users are just ignored and code is smaller. > > Testing it. Nice: > > echo -e "guest:qqqq\ntest:qqqq" | ./busybox chpasswd > > and crypt_make_salt() generates same salt for both! :)) > Bunch of other bugs too: shadow passwords check is backwards,... > > Applied to svn. Enjoy/test. > -- > vda > Hi, you were so fast this time, i was just reworking it.... So here is a new version of chpasswd.c that saves some space. bloat-o-meter says: root at localhost:~/Desktop/busybox# scripts/bloat-o-meter busybox_old busybox_unstripped function old new delta .rodata 122925 122893 -32 chpasswd_main 483 406 -77 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-109) Total: -109 bytes Little tested. Comments are welcome. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: chpasswd.c Type: text/x-csrc Size: 2345 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070721/7900f9b9/attachment-0002.c From vapier at gentoo.org Fri Jul 20 22:33:36 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Fri, 20 Jul 2007 18:33:36 -0400 Subject: busybox post from creder@digitalcpt.com requires approval In-Reply-To: <200707202225.55244.vda.linux@googlemail.com> References: <200707202225.55244.vda.linux@googlemail.com> Message-ID: <200707201833.37091.vapier@gentoo.org> On Friday 20 July 2007, Denis Vlasenko wrote: > > Hello all, I am using busybox v 1.5.1 with tftp. ?I have been trying to use > tftp to get files and update u-boot and the kernel in our AT91RM9200 > system. I used to have the file system with busybox on a nor flash and it > would crash out after transferring about 300k worth of a file (kernel is > about 1.3 mb). ?Because we had to move the file system to our nand flash, I > didn't debug it. ?Now that it is on the nand flash, I get the following > crash dump. Is there anything that I need to setup in order for busybox to > properly write to the flash? > > Any help or guidance would be appreciated. > > > Start by sending smaller mails to mailing lists. > > Is it NOMMU architechture? what do you mean by "crash out" ? if it was the kernel, then it isnt a busybox bug and you need to seek guidance from wherever you got your kernel ... -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://lists.busybox.net/pipermail/busybox/attachments/20070720/d2cc9d59/attachment-0002.pgp From vapier at gentoo.org Fri Jul 20 22:36:28 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Fri, 20 Jul 2007 18:36:28 -0400 Subject: busybox post from creder@digitalcpt.com requires approval In-Reply-To: <200707201833.37091.vapier@gentoo.org> References: <200707202225.55244.vda.linux@googlemail.com> <200707201833.37091.vapier@gentoo.org> Message-ID: <200707201836.29252.vapier@gentoo.org> On Friday 20 July 2007, Mike Frysinger wrote: > On Friday 20 July 2007, Denis Vlasenko wrote: > > > > Hello all, I am using busybox v 1.5.1 with tftp. ?I have been trying to > > use tftp to get files and update u-boot and the kernel in our AT91RM9200 > > system. I used to have the file system with busybox on a nor flash and it > > would crash out after transferring about 300k worth of a file (kernel is > > about 1.3 mb). ?Because we had to move the file system to our nand flash, > > I didn't debug it. ?Now that it is on the nand flash, I get the following > > crash dump. Is there anything that I need to setup in order for busybox > > to properly write to the flash? > > > > Any help or guidance would be appreciated. > > > > > > Start by sending smaller mails to mailing lists. > > > > Is it NOMMU architechture? > > what do you mean by "crash out" ? if it was the kernel, then it isnt a > busybox bug and you need to seek guidance from wherever you got your > kernel ... sorry, just read the message that was sent to the owners list ... that is a kernel crash, not busybox ... and it's MMU because you can see the error is about paging a virtual address please seek help from your kernel source, not busybox -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://lists.busybox.net/pipermail/busybox/attachments/20070720/7095d749/attachment-0002.pgp From farmatito at tiscali.it Fri Jul 20 22:49:37 2007 From: farmatito at tiscali.it (Tito) Date: Sat, 21 Jul 2007 00:49:37 +0200 Subject: Fwd: [PATCH] chpasswd applet size reduction and bugfix In-Reply-To: <200707210012.47455.farmatito@tiscali.it> References: <1184850097962-git-send-email-virtuoso@slind.org> <200707202222.56596.vda.linux@googlemail.com> <200707210012.47455.farmatito@tiscali.it> Message-ID: <200707210049.37239.farmatito@tiscali.it> On Saturday 21 July 2007 00:12:47 Tito wrote: > On Friday 20 July 2007 23:22:56 Denis Vlasenko wrote: > > On Thursday 19 July 2007 21:37, Alexander Shishkin wrote: > > > On 7/19/07, Tito wrote: > > > > Hi, > > > Hi, > > > > > > > attached you will find a drop in replacement > > > > for chpasswd.c with some more busyboxification > > > > (use of getopt32 and syslogging capabilities of > > > > bb_*_msg_* functions) and some things it seems to me that > > > > need to be fixed (this could be done to me being in hurry > > > > and not understanding you code... in this case ignore it). > > > > This code is only compile tested and needs more care and love. ;-) > > > Thanks for pointing these things out! I've done some more tweaking on > > > the applet. Attached please find an updated patch. > > > > Question: why malformed line without password results in warning, > > but invalid username aborts? > > > > bb_error_msg("missing new password"); > > continue; > > } > > *pass++ = '\0'; > > > > if (!getpwnam(name)) > > bb_error_msg_and_die("unknown user %s", name); > > > > Seems inconsistent to me. > > > > Btw, do we need to check that user exists? Without such check, > > nonexistent users are just ignored and code is smaller. > > > > Testing it. Nice: > > > > echo -e "guest:qqqq\ntest:qqqq" | ./busybox chpasswd > > > > and crypt_make_salt() generates same salt for both! :)) > > Bunch of other bugs too: shadow passwords check is backwards,... > > > > Applied to svn. Enjoy/test. > > -- > > vda > > > > Hi, > you were so fast this time, i was just reworking it.... > So here is a new version of chpasswd.c that saves some space. > bloat-o-meter says: > > root at localhost:~/Desktop/busybox# scripts/bloat-o-meter busybox_old busybox_unstripped > function old new delta > .rodata 122925 122893 -32 > chpasswd_main 483 406 -77 > ------------------------------------------------------------------------------ > (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-109) Total: -109 bytes > > Little tested. > Comments are welcome. > > Ciao, > Tito Hi, here is a diff of my rework against svn, size reduction now is: scripts/bloat-o-meter busybox_old busybox_unstripped function old new delta chpasswd_main 349 323 -26 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-26) Total: -26 bytes it fixes also a bug in commandline parsing: chpasswd must error out if -m and -e are set at the same time. Little tested. Ciao, Tito -------------- next part -------------- A non-text attachment was scrubbed... Name: chpasswd03.patch Type: text/x-diff Size: 1653 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070721/9edfee29/attachment-0002.bin From vda.linux at googlemail.com Sat Jul 21 00:37:49 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 21 Jul 2007 01:37:49 +0100 Subject: busybox post from creder@digitalcpt.com requires approval In-Reply-To: <200707201635.SM00588@mail.digitalcpt.com> References: <200707201635.SM00588@mail.digitalcpt.com> Message-ID: <200707210137.49632.vda.linux@googlemail.com> On Thursday 01 January 1970 01:00, Christopher Reder wrote: > Denis, yes, I only realized after sending it that it was too long and in fact, canceled the message on the website. This does have a MMU and is a ARM0, AT91RM9200. When using the Nor Flash, after transferring about 320k, the kernel crashes and the transfer aborts. Kernel should not crash. Ever. No matter now buggy application is, kernel should never crash. You see kernel crashing - it means youu see kernel bug and it should be diagnosed and fixed first, regardless of whether busybox's tftp is buggy or not. > Has anyone been able to use tftp for larger files (>1MB) without issues on v1.5.1? Because of the above this question is sort of off-target here. I suspect that you just don't try hard enough to actually look closely and understand the problem, throwing haphazardly composed posts on semi-relevant mailing lists instead. Look a at your post again. Oops output is double-spaced and linewrapped. Did you spend even a second thinking how people on the list are supposed to read and understand that? It should be formatted approx. like this: # tftp -g -r u-boot.bin 192.168.0.38 Unable to handle kernel paging request at virtual address 1a000003 pgd = c1fe4000 [1a000003] *pgd=00000000 Internal error: Oops: 3 [#1] Modules linked in: CPU: 0 PC is at __wake_up_common+0x28/0x7c LR is at 0x1a000003 pc : [] ? ?lr : [<1a000003>] ? ?Not tainted sp : c1fd9c98 ?ip : c1fd9cc4 ?fp : c1fd9cc0 r10: 00000003 ?r9 : c1fd9cdc ?r8 : 00000000 r7 : 00000001 ?r6 : c0000070 ?r5 : c031d000 ?r4 : 00000013 r3 : 00000000 ?r2 : 00000001 ?r1 : 00000003 ?r0 : c0000070 Flags: nzcv ?IRQs off ?FIQs on ?Mode SVC_32 ?Segment user Control: C000717F Table: 21FE4000 ?DAC: 00000015 Process tftp (pid: 773, stack limit = 0xc1fd8250) Stack: (0xc1fd9c98 to 0xc1fda000) 9c80: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 00000013 c031d000 9ca0: 00000200 c03b0258 00000000 00008200 00000000 c1fd9cd8 c1fd9cc4 c003c028 9cc0: c003bf90 c1fd9cdc c031d000 c1fd9cf0 c1fd9cdc c0054a1c c003c00c c031d000 9ce0: 00000000 c1fd9d04 c1fd9cf4 c00622a4 c00549fc 00000200 c1fd9db0 c1fd9d08 9d00: c0064234 c0062270 00000200 c1fd9d18 c01a7e08 c0370840 c0370840 00000200 9d20: 000b3464 c03b01c4 c020bce4 c1edd8a0 00000001 c1fd9ea0 00000000 00000200 9d40: c1fd9e98 c1370840 00000001 00000000 c031d000 c01a7d38 c01a7c1c 000004ce 9d60: 27f95cfb c1fd9d94 c1fd9d90 c1fd9d78 c00445d0 c0044538 c03b01c4 00000000 9d80: c1fd9d94 c1fd9db4 00008000 00000000 00000000 c1fd8000 c03b01c4 c1edd8a0 9da0: 00000200 c1fd9e4c c1fd9db8 c0064b38 c0063f3c 00008000 00000000 c1fd9ee8 9dc0: 00000000 00000200 00000010 c0368320 c1fd9f64 00000204 00000000 c03b0258 9de0: c1fd9ee8 c1fd9e98 c1fd9ea0 00000001 00000200 00008000 00000000 c1fede40 9e00: 00000000 00000000 c1fd9f64 c1fd8000 00000004 00000004 00000001 c1fd8000 9e20: be9a7c30 c1fd9ea0 00008000 00000000 c1fd9ee8 c03b01c4 c1fd9e98 c03b022c 9e40: c1fd9e8c c1fd9e50 c0064ea4 c0064848 00000000 c0368320 c03b0258 c1edd8a0 9e60: 00000001 00008000 00000000 c1fd9ea0 c1fd9e98 c1fd9ee8 c1fd9f78 c1edd8a0 9e80: c1fd9f4c c1fd9e94 c007f154 c0064e40 00008000 00000000 000b3264 00000200 9ea0: be9a7bdc 00000010 00000000 00000001 ffffffff c1edd8a0 00000000 00000000 9ec0: 00000000 00000000 c0368320 00000000 00000000 000b3464 c0368320 c00548cc 9ee0: c1fd9ee0 c1fd9ee0 00008000 00000000 00000000 00000000 00000000 d60c0002 9f00: 2600a8c0 00000200 00000000 c1edd8a0 000b3264 00000200 c1fd9f78 00000000 9f20: 00000000 c1edd8a0 000b3264 c1fd9f78 00000200 c1fd8000 c1fd8000 00000204 9f40: c1fd9f74 c1fd9f50 c007f254 c007f09c 00000000 c1edd8c0 c1edd8a0 c1fd9f78 9f60: 00008000 00000000 c1fd9fa4 c1fd9f78 c007f3ec c007f1b0 00008000 00000000 9f80: 00000000 00000200 00000200 000b3264 00000004 c002af04 00000000 c1fd9fa8 9fa0: c002ad60 c007f3b0 00000200 00000200 00000004 000b3264 00000200 00000001 9fc0: 00000200 00000200 000b3264 00000004 00000003 000b3260 00000204 be9a7ce0 9fe0: 000ae328 be9a7ba0 0003b558 4005ce0c 20000010 00000004 00000000 00000000 Backtrace: [] (__wake_up_common+0x0/0x7c) from [] (__wake_up+0x2c/0x34) [] (__wake_up+0x0/0x34) from [] (__wake_up_bit+0x30/0x38) ?r4 = C031D000 [] (__wake_up_bit+0x0/0x38) from [] (unlock_page+0x44/0x5c) [] (unlock_page+0x0/0x5c) from [] (generic_file_buffered_write+0x30c/0x674) ?r4 = 00000200 [] (generic_file_buffered_write+0x4/0x674) from [] (__generic_file_aio_write_nolock+0x300/0x5f4) [] (__generic_file_aio_write_nolock+0x0/0x5f4) from [] (generic_file_aio_write+0x78/0x104) [] (generic_file_aio_write+0x4/0x104) from [] (do_sync_write+0xc8/0x114) [] (do_sync_write+0x0/0x114) from [] (vfs_write+0xb4/0x184) [] (vfs_write+0x0/0x184) from [] (sys_write+0x4c/0x7c) ?r8 = 00000000 ?r7 = 00008000 ?r6 = C1FD9F78 ?r5 = C1EDD8A0 ?r4 = C1EDD8C0 [] (sys_write+0x0/0x7c) from [] (ret_fast_syscall+0x0/0x2c) ?r8 = C002AF04 ?r7 = 00000004 ?r6 = 000B3264 ?r5 = 00000200 ?r4 = 00000200 Code: e1a0a001 e1a07002 e1a08003 e59b9004 (e59e5000) ?<1>Unable to handle kernel paging request at virtual address e5902008 pgd = c1fe4000 [e5902008] *pgd=00000000 And yes, I did a few tftp transfers here for testing purposes, some of them much bigger than 1MB. (If doesn't mean that tftp can't have bugs. It surely can). In attachment you may find hints how to hunt down an oops. -- vda -------------- next part -------------- Okay, so you've got an oops and want to find out what happened? In this HOWTO, I presume you did not delete and did not tamper with your kernel build tree. Also, I recommend you to enable these options in the .config: CONFIG_DEBUG_SLAB=y CONFIG_FRAME_POINTER=y CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y First one makes use-after-free bug hunt easy, second gives you much more reliable stacktraces. Next two give you decoded oops (2.6 only). If you are running 2.4 kernel, please make sure you run your klogd with -x switch. 1. An OOPS decoding walkthrough Ok, let's take a look at example OOPS. ^^^^ marks are mine. Unable to handle kernel NULL pointer dereference at virtual address 00000e14 printing eip: c0162887 *pde = 00000000 Oops: 0000 [#1] PREEMPT Modules linked in: eeprom snd_seq_oss snd_seq_midi_event.......... CPU: 0 EIP: 0060:[] Not tainted EFLAGS: 00010206 (2.6.7-nf2) EIP is at prune_dcache+0x147/0x1c0 ^^^^^^^^^^^^^^^^^^^^^^^^ eax: 00000e00 ebx: d1bde050 ecx: f1b3c050 edx: f1b3ac50 esi: f1b3ac40 edi: c1973000 ebp: 00000036 esp: c1973ef8 ds: 007b es: 007b ss: 0068 Process kswapd0 (pid: 65, threadinfo=c1973000 task=c1986050) Stack: d7721178 c1973ef8 0000007a 00000000 c1973000 f7ffea48 c0162d1f 0000007a c0139a2b 0000007a 000000d0 00025528 049dbb00 00000000 000001fa 00000000 c0364564 00000001 0000000a c0364440 c013add1 00000080 000000d0 00000000 Call Trace: [] shrink_dcache_memory+0x1f/0x30 [] shrink_slab+0x14b/0x190 [] balance_pgdat+0x1b1/0x200 [] kswapd+0xc7/0xe0 [] autoremove_wake_function+0x0/0x60 [] ret_from_fork+0x6/0x14 [] autoremove_wake_function+0x0/0x60 [] kswapd+0x0/0xe0 [] kernel_thread_helper+0x5/0x14 Code: 8b 50 14 85 d2 75 27 89 34 24 e8 4a 2b 00 00 8b 73 0c 89 1c Let's try to find out where did that exactly happen. Grep in your kernel tree for prune_dcache. Aha, it is defined in fs/dcache.c! (BTW, if you have _only_ EIP: 0060:[] line (probably because you're using 2.4), just look into System.map. You will discover that EIP is in prune_dcache() because you see "c0162740 t prune_dcache" in System.map and EIP falls between this and next entry.) Ok, execute these two commands: # objdump -d fs/dcache.o > fs/dcache.disasm # make fs/dcache.s Now in fs/ you should have: dcache.c - source code dcache.o - compiled object file dcache.s - assembler output of C compiler ('half-compiled' code) dcache.disasm - disassembled object file Open dcache.disasm and find "prune_dcache": 00000540 : 540: 55 push %ebp We need to find prune_dcache+0x147. Using shell, # printf "0x%x\n" $((0x540+0x147)) 0x687 and in dcache.disasm: 683: 85 c0 test %eax,%eax 685: 74 07 je 68e ===> 687: 8b 50 14 mov 0x14(%eax),%edx <======== OOPS 68a: 85 d2 test %edx,%edx 68c: 75 27 jne 6b5 68e: 89 34 24 mov %esi,(%esp) 691: e8 fc ff ff ff call 692 696: 8b 73 0c mov 0xc(%ebx),%esi 699: 89 1c 24 mov %ebx,(%esp) 69c: e8 9f f9 ff ff call 40 Comparing with "Code: 8b 50 14 85 d2 75 27" - match! We need to find matching line in dcache.s and, eventually, in dcache.c. It's easy to find prune_dcache in dcache.s: prune_dcache: pushl %ebp but even though it is not too hard to find matching instruction (you just have to look for the same instruction sequence): movl 8(%edi), %eax decl 20(%edi) testb $8, %al jne .L593 .L517: movl 68(%ebx), %eax testl %eax, %eax je .L532 movl 20(%eax), %edx <========= OOPS testl %edx, %edx jne .L594 .L532: movl %esi, (%esp) call iput .L565: movl 12(%ebx), %esi movl %ebx, (%esp) call d_free it is unclear to which part of .c code it belongs: static void prune_dcache(int count) { spin_lock(&dcache_lock); for (; count ; count--) { struct dentry *dentry; struct list_head *tmp; tmp = dentry_unused.prev; if (tmp == &dentry_unused) break; list_del_init(tmp); prefetch(dentry_unused.prev); dentry_stat.nr_unused--; dentry = list_entry(tmp, struct dentry, d_lru); spin_lock(&dentry->d_lock); /* * We found an inuse dentry which was not removed from * dentry_unused because of laziness during lookup. Do not free * it - just keep it off the dentry_unused list. */ if (atomic_read(&dentry->d_count)) { spin_unlock(&dentry->d_lock); continue; } /* If the dentry was recently referenced, don't free it. */ if (dentry->d_flags & DCACHE_REFERENCED) { dentry->d_flags &= ~DCACHE_REFERENCED; list_add(&dentry->d_lru, &dentry_unused); dentry_stat.nr_unused++; spin_unlock(&dentry->d_lock); continue; } prune_one_dentry(dentry); } spin_unlock(&dcache_lock); } What now?! Well, I have a silly method which helps to find C code line corresponding to that asm one. Edit your prune_dcache in dcache.c like this: static void prune_dcache(int count) { spin_lock(&dcache_lock); for (; count ; count--) { struct dentry *dentry; struct list_head *tmp; asm("#1"); tmp = dentry_unused.prev; asm("#2"); if (tmp == &dentry_unused) break; asm("#3"); list_del_init(tmp); asm("#4"); prefetch(dentry_unused.prev); asm("#5"); dentry_stat.nr_unused--; asm("#6"); ... ... asm("#e"); prune_one_dentry(dentry); } asm("#f"); spin_unlock(&dcache_lock); } and do "make fs/dcache.s" again. Look into new dcache.s. Nasty surprize: APP #e #NO_APP testb $16, %al jne .L495 orl $16, %eax leal 72(%ecx), %esi movl %eax, 4(%ebx) movl 4(%esi), %edx movl 72(%ecx), %eax testl %eax, %eax movl %eax, (%edx) je .L493 movl %edx, 4(%eax) .L493: movl $2097664, 4(%esi) .L495: leal 40(%ebx), %ecx movl 40(%ebx), %eax movl 4(%ecx), %edx movl %edx, 4(%eax) movl %eax, (%edx) movl $2097664, 4(%ecx) movl $1048832, 40(%ebx) decl dentry_stat movl 8(%ebx), %esi testl %esi, %esi je .L536 leal 56(%ebx), %eax movl $0, 8(%ebx) movl 56(%ebx), %edx movl 4(%eax), %ecx movl %ecx, 4(%edx) movl %edx, (%ecx) movl %eax, 4(%eax) movl %eax, 56(%ebx) movl 8(%edi), %eax decl 20(%edi) testb $8, %al jne .L592 .L518: movl 8(%edi), %eax decl 20(%edi) testb $8, %al jne .L593 .L517: movl 68(%ebx), %eax testl %eax, %eax je .L532 movl 20(%eax), %edx <======== OOPS testl %edx, %edx jne .L594 .L532: movl %esi, (%esp) call iput How come one line of C code expanded in so much asm?! Hmm... asm("#e") was directly before prune_one_dentry(dentry), what's that? static inline void prune_one_dentry(struct dentry * dentry) { struct dentry * parent; __d_drop(dentry); list_del(&dentry->d_child); dentry_stat.nr_dentry--; /* For d_free, below */ dentry_iput(dentry); parent = dentry->d_parent; d_free(dentry); if (parent != dentry) dput(parent); spin_lock(&dcache_lock); } Argh! An inline function. Do asm trick to it too: static inline void prune_one_dentry(struct dentry * dentry) { struct dentry * parent; asm("#A"); __d_drop(dentry); asm("#B"); list_del(&dentry->d_child); asm("#C"); dentry_stat.nr_dentry--; /* For d_free, below */ asm("#D"); dentry_iput(dentry); asm("#E"); ... ... } "make fs/dcache.s", rinse, repeat. You will discover that OOPS happened after #D mark, inside dentry_iput which is an inline too. Will this ever end? Luckily, yes. After yet another round of asm insertion, we arrive at: static inline void dentry_iput(struct dentry * dentry) { struct inode *inode = dentry->d_inode; if (inode) { asm("#K"); dentry->d_inode = NULL; asm("#L"); list_del_init(&dentry->d_alias); asm("#M"); spin_unlock(&dentry->d_lock); asm("#N"); spin_unlock(&dcache_lock); asm("#O"); if (dentry->d_op && dentry->d_op->d_iput) { asm("#P"); dentry->d_op->d_iput(dentry, inode); } else ... Which corresponds to this part of new dcache.s: .L517: #APP #O #NO_APP movl 68(%ebx), %eax testl %eax, %eax je .L532 movl 20(%eax), %edx <=== OOPS testl %edx, %edx jne .L594 .L532: #APP #Q #NO_APP This is "if (dentry->d_op && dentry->d_op->d_iput)" condition check, and it is oopsing trying to do second check. dentry->d_op contains bogus pointer value 0x00000e00 (see %eax value in OOPS message we started with). 1.1. Accesses of structure members via NULL pointer If kernel says "Unable to handle kernel _NULL_ pointer dereference", it does not really 100% guaranteed that NULL pointer was to blame. You can check that by examining the code and register values. In our example, dentry->d_op pointer wasn't NULL. Real NULL pointer would have caused "Unable to handle kernel NULL pointer dereference at virtual address 00000014" message and EAX register would be 00000000. 1.2. Bit flips If you see that only one bit in the referenced address is set (example: "Unable to handle kernel paging request at virtual address 00040000"), you probably have faulty memory which sometimes can flip bit from 0 to 1. It converted legitimate NULL pointer into non-NULL one. Code which expected to stop on NULL pointer saw a non-NULL value and happily used it. Test your box with memtest86, cpuburn and/or memburn. 1.3. OOPSes scrolling off the screen If your OOPS is so long that it scrolls off the screen, and box freeze after the OOPS with nothing in logs, you can try the following: 1. Boot with video=N such that you get large console size. Most x86 machines have 50- and 60-line mode. 2. Connect your box with null modem cable to another one, start terminal emulator there and boot with console=ttyS0 kernel parameter. 3. Use netconsole (I never used that yet). 2. Other decoding tricks Marcelo Tosatti and Johannes Stezenbach suggest using make EXTRA_CFLAGS="-g -Wa,-a,-ad" fs/dcache.o >dcache.asm instead of asm trick. This works at least on 2.6. Note that GCC may produce slightly different assembler code with these options. This is normal. Herbert Poetzl suggested simply using addr2line -e vmlinux c012609d (this might require CONFIG_DEBUG_KERNEL and recompile). Zwane Mwaikambo has another tips for you: ============================================== Date: Sat, 14 Aug 2004 09:41:10 -0400 (EDT) From: Zwane Mwaikambo Subject: Re: [RFC] HOWTO find oops location ============================================== There are a few very simple methods i use all the time: compile with CONFIG_DEBUG_INFO (it's safe to select the option and recompile after the oops even) and then; Unable to handle kernel NULL pointer dereference at virtual address 0000000c printing eip: c046a188 *pde = 00000000 Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC Modules linked in: CPU: 0 EIP: 0060:[] Not tainted VLI EFLAGS: 00010246 (2.6.6-mm3) EIP is at serial_open+0x38/0x170 [...] # gdb vmlinux GNU gdb 5.2 Copyright 2002 Free Software Foundation, Inc. ... (gdb) list *serial_open+0x38 0xc046a188 is in serial_open (drivers/usb/serial/usb-serial.c:465). 460 461 /* get the serial object associated with this tty pointer */ 462 serial = usb_serial_get_by_index(tty->index); 463 464 /* set up our port structure making the tty driver remember our port object, and us it */ 465 portNumber = tty->index - serial->minor; 466 port = serial->port[portNumber]; 467 tty->driver_data = port; 468 469 port->tty = tty; And then for cases where you deadlock and the NMI watchdog triggers with %eip in a lock section: NMI Watchdog detected LOCKUP on CPU0, eip c0119e5e, registers: Modules linked in: CPU: 0 EIP: 0060:[] Tainted: EFLAGS: 00000086 (2.6.7) EIP is at .text.lock.sched+0x89/0x12b [...] (gdb) disassemble 0xc0119e5e Dump of assembler code for function Letext: [...] 0xc0119e59 : repz nop 0xc0119e5b : cmpb $0x0,(%edi) 0xc0119e5e : jle 0xc0119e59 0xc0119e60 : jmp 0xc0118183 (gdb) list *scheduler_tick+487 0xc0118183 is in scheduler_tick (include/asm/spinlock.h:124). 119 if (unlikely(lock->magic != SPINLOCK_MAGIC)) { 120 printk("eip: %p\n", &&here); 121 BUG(); 122 } 123 #endif 124 __asm__ __volatile__( 125 spin_lock_string 126 :"=m" (lock->lock) : : "memory"); 127 } But that's not much help since it's pointing to an inline function and not the real lock location, so just subtract a few bytes: (gdb) list *scheduler_tick+450 0xc011815e is in scheduler_tick (kernel/sched.c:2021). 2016 cpustat->system += sys_ticks; 2017 2018 /* Task might have expired already, but not scheduled off yet */ 2019 if (p->array != rq->active) { 2020 set_tsk_need_resched(p); 2021 goto out; 2022 } 2023 spin_lock(&rq->lock); So we have our lock location. Then there are cases where there is a "Bad EIP" most common ones are when a bad function pointer is followed or if some of the kernel text or a module got unloaded/unmapped (e.g. via __init). You can normally determine which is which by noting that bad eip for unloaded text normally looks like a valid virtual address. Unable to handle kernel NULL pointer dereference at virtual address 00000000 00000000 *pde = 00000000 Oops: 0000 [#1] CPU: 0 EIP: 0060:[<00000000>] Not tainted Using defaults from ksymoops -t elf32-i386 -a i386 EFLAGS: 00210246 [...] Call Trace: [] smb_readdir+0x4fb/0x6e0 [] filldir64+0x0/0x130 [] vfs_readdir+0x8a/0x90 [] filldir64+0x0/0x130 [] sys_getdents64+0x6d/0xa6 [] filldir64+0x0/0x130 [] syscall_call+0x7/0xb Code: Bad EIP value. From there you're best off examining the call trace to find the culprit. ====================================================== 3. Looking around in C code Not written. I think live example of chasing bug further by following call chain, placing printks etc will be most interesting to have here. 4. More obscure oopses Not written. -- vda From vda.linux at googlemail.com Sat Jul 21 13:37:54 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 21 Jul 2007 14:37:54 +0100 Subject: Fwd: [PATCH] chpasswd applet size reduction and bugfix In-Reply-To: <200707210049.37239.farmatito@tiscali.it> References: <1184850097962-git-send-email-virtuoso@slind.org> <200707210012.47455.farmatito@tiscali.it> <200707210049.37239.farmatito@tiscali.it> Message-ID: <200707211437.54616.vda.linux@googlemail.com> On Friday 20 July 2007 23:49, Tito wrote: > here is a diff of my rework against svn, size reduction now is: > > scripts/bloat-o-meter busybox_old busybox_unstripped > function old new delta > chpasswd_main 349 323 -26 > ------------------------------------------------------------------------------ > (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-26) Total: -26 bytes > > it fixes also a bug in commandline parsing: > chpasswd must error out if -m and -e are set at the same time. Applied to svn (along with even more bugs fixed. It's scary how many of them were there). Alex, care to eyescan/test what in svn now? -- vda From virtuoso at slind.org Sat Jul 21 19:55:43 2007 From: virtuoso at slind.org (Alexander Shishkin) Date: Sat, 21 Jul 2007 23:55:43 +0400 Subject: Fwd: [PATCH] chpasswd applet size reduction and bugfix In-Reply-To: <200707211437.54616.vda.linux@googlemail.com> References: <1184850097962-git-send-email-virtuoso@slind.org> <200707210012.47455.farmatito@tiscali.it> <200707210049.37239.farmatito@tiscali.it> <200707211437.54616.vda.linux@googlemail.com> Message-ID: <71a0d6ff0707211255n50984a6en6126969d623043f8@mail.gmail.com> On 7/21/07, Denis Vlasenko wrote: > > it fixes also a bug in commandline parsing: > > chpasswd must error out if -m and -e are set at the same time. > > Applied to svn (along with even more bugs fixed. It's scary how many > of them were there). > > Alex, care to eyescan/test what in svn now? Looks a whole lot better now (thanks a lot for your numerous fixes to this!). Except: - chpasswd.c:59 seems to have excessive indentation tab, - may be it's time to move sizeof("$N$XXXXXXXX") to some header file, since it's used in both passwd.c and chpasswd.c (I'm not quite sure which header is better for such things if at all). Regards, -- Alex From vda.linux at googlemail.com Sat Jul 21 22:23:16 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sat, 21 Jul 2007 23:23:16 +0100 Subject: Fwd: [PATCH] chpasswd applet size reduction and bugfix In-Reply-To: <71a0d6ff0707211255n50984a6en6126969d623043f8@mail.gmail.com> References: <1184850097962-git-send-email-virtuoso@slind.org> <200707211437.54616.vda.linux@googlemail.com> <71a0d6ff0707211255n50984a6en6126969d623043f8@mail.gmail.com> Message-ID: <200707212323.16806.vda.linux@googlemail.com> On Saturday 21 July 2007 20:55, Alexander Shishkin wrote: > On 7/21/07, Denis Vlasenko wrote: > > > it fixes also a bug in commandline parsing: > > > chpasswd must error out if -m and -e are set at the same time. > > > > Applied to svn (along with even more bugs fixed. It's scary how many > > of them were there). > > > > Alex, care to eyescan/test what in svn now? > Looks a whole lot better now (thanks a lot for your numerous fixes to this!). > Except: > - chpasswd.c:59 seems to have excessive indentation tab, Fixed > - may be it's time to move sizeof("$N$XXXXXXXX") to some header file, > since it's used in both passwd.c and chpasswd.c (I'm not quite sure > which header is better for such things if at all). No gain in code size. Correctness is easer to check when you don't need to grep .h files in order to find out what the size is. -- vda From vda.linux at googlemail.com Mon Jul 23 00:21:40 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 23 Jul 2007 01:21:40 +0100 Subject: Installed gcc 4.2.1. Discovered that we have 16-byte stack tax^Walignment enforced on us now. :( Message-ID: <200707230121.40954.vda.linux@googlemail.com> Hi busybox, uclibc Just read this. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32849 OMG. WE DO NOT DO ANY SSE!!! *ANY*! But we are going to have code in our binaries which tries to ensure that our non-existent SSE code will run ok. Shit. -- vda From ynakam at hitachisoft.jp Mon Jul 23 01:16:38 2007 From: ynakam at hitachisoft.jp (Yuichi Nakamura) Date: Mon, 23 Jul 2007 10:16:38 +0900 Subject: [patch]setfiles/restorecon applet In-Reply-To: <200707202044.17800.vda.linux@googlemail.com> References: <20070720132230.60CB.YNAKAM@hitachisoft.jp> <200707202044.17800.vda.linux@googlemail.com> Message-ID: <20070723100244.17B2.YNAKAM@hitachisoft.jp> Hi. Thanks for update. On Fri, 20 Jul 2007 20:44:17 +0100 Denis Vlasenko wrote: > On Friday 20 July 2007 05:29, Yuichi Nakamura wrote: > > Attached is updated patch. > > I changed it a bit, see attached. Can you clarify this part? > > ret = lsetfilecon(my_file, newcon); > if (ret) { > bb_perror_msg("lsetfileconon(%s,%s)", my_file, newcon); > goto out; > } > > err: > retval--; > out: > freecon(context); > freecon(newcon); > free(my_file_orig); > return retval; > } > > Looks like if lsetfilecon fails, we return success - ?! > Is it really right? Sorry, "goto err" is correct. Fixed. And I have fixed trivial compile errors. I add following in Config.in for setfiles. > Notice: If you built libselinux with -D_FILE_OFFSET_BITS=64, > (It is default in libselinux's Makefile), you _must_ enable > CONFIG_LFS. In matchpathcon_filespec_add in setfiles.c, "ino_t" is passed as first argument. However, the size of ino_t depends on value of FILE_OFFSET_BITS. It is set as "64" in libselinux's Makefile. So, CONFIG_LFS(FILE_OFFSET_BITS=64 is set by this) should be enabled for such case. Regards, -- Yuichi Nakamura Hitachi Software Engineering Co., Ltd. Japan SELinux Users Group(JSELUG): http://www.selinux.gr.jp/ SELinux Policy Editor: http://seedit.sourceforge.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: setfiles.4.patch Type: application/octet-stream Size: 22137 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070723/691d86c5/attachment-0002.obj From rep.dot.nop at gmail.com Mon Jul 23 12:52:52 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Mon, 23 Jul 2007 14:52:52 +0200 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070723100244.17B2.YNAKAM@hitachisoft.jp> References: <20070720132230.60CB.YNAKAM@hitachisoft.jp> <200707202044.17800.vda.linux@googlemail.com> <20070723100244.17B2.YNAKAM@hitachisoft.jp> Message-ID: <20070723125252.GA7902@aon.at> On Mon, Jul 23, 2007 at 10:16:38AM +0900, Yuichi Nakamura wrote: >Hi. in setfiles_full_usage: "\n -q Suppress no-error output" \ do you mean "Suppress warnings" or "be quiet" or the like? selinux/setfiles.c: Port to BusyBox by 2007 s/by 2007/(c) 2007 by/ in struct globals, i, personally prefer bools (smaller for me on x86), just as a sidenote. in add_exclude can use use const char*const directory? (didn't look closely). Also, you seem to reimplement something like basename or last_path_component there. Furthermore should return type bool. Initializing len to 0 looks like it is superfluous. likewise a couple of others should return a bool: -+static int exclude(const char *file) ++static bool exclude(const char *file) match(): + if (excludeCtr > 0) { + if (exclude(name)) { + goto err; + } + } Please change to if (excludeCtr > 0 && exclude(name)) goto err; (perhaps in a couple of other places too. (run, from the toplevel sourcedir 'indent selinux/*' for other misc style-cleanups.) near "if (expand_realpath) {", move the + if (excludeCtr > 0 && exclude(name)) + goto err; out of both branches if if-else. restore(): user_only_changed can be bool. Isn't there a sanitize_path() that you could reuse for stripping multiple slashes off? [snipping the rest of you patch for now] HTH, From vda.linux at googlemail.com Mon Jul 23 13:56:57 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 23 Jul 2007 14:56:57 +0100 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070723125252.GA7902@aon.at> References: <20070720132230.60CB.YNAKAM@hitachisoft.jp> <200707202044.17800.vda.linux@googlemail.com> <20070723100244.17B2.YNAKAM@hitachisoft.jp> <20070723125252.GA7902@aon.at> Message-ID: <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> On 7/23/07, Bernhard Fischer wrote: > On Mon, Jul 23, 2007 at 10:16:38AM +0900, Yuichi Nakamura wrote: > >Hi. > > in setfiles_full_usage: > "\n -q Suppress no-error output" \ > do you mean "Suppress warnings" or "be quiet" or the like? > > selinux/setfiles.c: > Port to BusyBox by 2007 > s/by 2007/(c) 2007 by/ I already applied patch to svn... > in struct globals, i, personally prefer bools (smaller for me on x86), > just as a sidenote. bools are smaller than smallints (which are chars on i386)? I don't understand how. I introduced smallints specifically because *I* want to be able to control what they are, not gcc. gcc people hate us. (No, not really, but they aren't thinking too much about saving on size - see my rant on idiotic recent i386 stack alignment disaster.) > in add_exclude can use use const char*const directory? (didn't look > closely). Also, you seem to reimplement something like basename or > last_path_component there. Furthermore should return type bool. > Initializing len to 0 looks like it is superfluous. Yuichi, please look into it and send all follow-on patches relative to svn. > likewise a couple of others should return a bool: > -+static int exclude(const char *file) > ++static bool exclude(const char *file) > > match(): > + if (excludeCtr > 0) { > + if (exclude(name)) { > + goto err; > + } > + } > Please change to > if (excludeCtr > 0 && exclude(name)) > goto err; > (perhaps in a couple of other places too. (run, from the toplevel > sourcedir 'indent selinux/*' for other misc style-cleanups.) > near "if (expand_realpath) {", move the > + if (excludeCtr > 0 && exclude(name)) > + goto err; > out of both branches if if-else. > > > restore(): user_only_changed can be bool. Isn't there a sanitize_path() > that you could reuse for stripping multiple slashes off? > > [snipping the rest of you patch for now] > HTH, -- vda From rep.dot.nop at gmail.com Mon Jul 23 14:25:19 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Mon, 23 Jul 2007 16:25:19 +0200 Subject: [patch]setfiles/restorecon applet In-Reply-To: <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> References: <20070720132230.60CB.YNAKAM@hitachisoft.jp> <200707202044.17800.vda.linux@googlemail.com> <20070723100244.17B2.YNAKAM@hitachisoft.jp> <20070723125252.GA7902@aon.at> <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> Message-ID: <20070723142519.GB9324@aon.at> On Mon, Jul 23, 2007 at 02:56:57PM +0100, Denis Vlasenko wrote: >On 7/23/07, Bernhard Fischer wrote: >>On Mon, Jul 23, 2007 at 10:16:38AM +0900, Yuichi Nakamura wrote: >>>Hi. >> >>in setfiles_full_usage: >>"\n -q Suppress no-error output" \ >>do you mean "Suppress warnings" or "be quiet" or the like? >> >>selinux/setfiles.c: >>Port to BusyBox by 2007 >>s/by 2007/(c) 2007 by/ > >I already applied patch to svn... > >>in struct globals, i, personally prefer bools (smaller for me on x86), >>just as a sidenote. > >bools are smaller than smallints (which are chars on i386)? smaller than ints. >I don't understand how. > >I introduced smallints specifically because *I* want to be able >to control what they are, not gcc. gcc people hate us. let's assume they don't :) >(No, not really, but they aren't thinking too much about >saving on size - see my rant on idiotic recent i386 >stack alignment disaster.) Saw it. Does -mno-sse -mno-sse2 etc help? (didn't try). My CC is usually configured with --with-march=i386 --with-tune=i386, fwiw. > >>in add_exclude can use use const char*const directory? (didn't look >>closely). Also, you seem to reimplement something like basename or >>last_path_component there. Furthermore should return type bool. >>Initializing len to 0 looks like it is superfluous. > >Yuichi, please look into it and send all follow-on patches relative to svn. > >>likewise a couple of others should return a bool: >>-+static int exclude(const char *file) >>++static bool exclude(const char *file) >> >>match(): >>+ if (excludeCtr > 0) { >>+ if (exclude(name)) { >>+ goto err; >>+ } >>+ } >>Please change to >> if (excludeCtr > 0 && exclude(name)) >> goto err; >>(perhaps in a couple of other places too. (run, from the toplevel >>sourcedir 'indent selinux/*' for other misc style-cleanups.) >>near "if (expand_realpath) {", move the >>+ if (excludeCtr > 0 && exclude(name)) >>+ goto err; >>out of both branches if if-else. >> >> >>restore(): user_only_changed can be bool. Isn't there a sanitize_path() >>that you could reuse for stripping multiple slashes off? >> >>[snipping the rest of you patch for now] >>HTH, >-- >vda > From vda.linux at googlemail.com Mon Jul 23 16:43:48 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 23 Jul 2007 17:43:48 +0100 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070723142519.GB9324@aon.at> References: <20070720132230.60CB.YNAKAM@hitachisoft.jp> <200707202044.17800.vda.linux@googlemail.com> <20070723100244.17B2.YNAKAM@hitachisoft.jp> <20070723125252.GA7902@aon.at> <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> <20070723142519.GB9324@aon.at> Message-ID: <1158166a0707230943j492499d3r966281ff394e118d@mail.gmail.com> > >I introduced smallints specifically because *I* want to be able > >to control what they are, not gcc. gcc people hate us. > > let's assume they don't :) > > >(No, not really, but they aren't thinking too much about > >saving on size - see my rant on idiotic recent i386 > >stack alignment disaster.) > > Saw it. Does -mno-sse -mno-sse2 etc help? (didn't try). No, that will cause SEGVs. Code built with -mno-sse should be able to call SSE code. > My CC is usually configured with --with-march=i386 --with-tune=i386, > fwiw. Me too. It wouldn't help I guess. (I need to try, but I bet it would not). -- vda From vda.linux at googlemail.com Mon Jul 23 21:25:45 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 23 Jul 2007 22:25:45 +0100 Subject: [patch]setfiles/restorecon applet In-Reply-To: <1158166a0707230943j492499d3r966281ff394e118d@mail.gmail.com> References: <20070720132230.60CB.YNAKAM@hitachisoft.jp> <20070723142519.GB9324@aon.at> <1158166a0707230943j492499d3r966281ff394e118d@mail.gmail.com> Message-ID: <200707232225.45063.vda.linux@googlemail.com> On Monday 23 July 2007 17:43, Denis Vlasenko wrote: > > >(No, not really, but they aren't thinking too much about > > >saving on size - see my rant on idiotic recent i386 > > >stack alignment disaster.) > > > > Saw it. Does -mno-sse -mno-sse2 etc help? (didn't try). > > No, that will cause SEGVs. Code built with -mno-sse > should be able to call SSE code. > > > My CC is usually configured with --with-march=i386 --with-tune=i386, > > fwiw. > > Me too. It wouldn't help I guess. (I need to try, but I bet it would not). I was wrong. Plain old -mpreferred-stack-boundary=2 overrides it. -- vda From rep.dot.nop at gmail.com Mon Jul 23 21:35:49 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Mon, 23 Jul 2007 23:35:49 +0200 Subject: [patch]setfiles/restorecon applet In-Reply-To: <200707232225.45063.vda.linux@googlemail.com> References: <20070720132230.60CB.YNAKAM@hitachisoft.jp> <20070723142519.GB9324@aon.at> <1158166a0707230943j492499d3r966281ff394e118d@mail.gmail.com> <200707232225.45063.vda.linux@googlemail.com> Message-ID: <20070723213549.GG4096@aon.at> On Mon, Jul 23, 2007 at 10:25:45PM +0100, Denis Vlasenko wrote: >On Monday 23 July 2007 17:43, Denis Vlasenko wrote: >> > My CC is usually configured with --with-march=i386 --with-tune=i386, >> > fwiw. >> >> Me too. It wouldn't help I guess. (I need to try, but I bet it would not). > >I was wrong. Plain old -mpreferred-stack-boundary=2 overrides it. I'm pretty sure that we already had -mpreferred-stack-boundary=2 for ia32. Was this removed when going to Kbuild? IIRC it should be 4 for x86_64.. but you know that From vda.linux at googlemail.com Tue Jul 24 06:01:36 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 24 Jul 2007 07:01:36 +0100 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070724085858.41D8.YNAKAM@hitachisoft.jp> References: <20070723125252.GA7902@aon.at> <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> <20070724085858.41D8.YNAKAM@hitachisoft.jp> Message-ID: <200707240701.36169.vda.linux@googlemail.com> On Tuesday 24 July 2007 01:08, Yuichi Nakamura wrote: > Attached is update. Applied to svn. Further reductions are possible: if (flags & OPT_e) { if (exclude_dir == NULL) { bb_show_usage(); } I think it is already handled inside getopt32. IOW: if() above is not needed at all, ok to remove? while (exclude_dir) { if (add_exclude(llist_pop(&exclude_dir))) exit(1); } add_exclude is used only once here. Obviously you can make it a void function which exits on errors. } Can you test it? Can you point me to FAQ/whetever how to install SELinux libs so that I can at least compile this stuff myself? I suppose this doesn't require SELinux-enabled kernel? -- vda From sync.jma at gmail.com Tue Jul 24 08:11:47 2007 From: sync.jma at gmail.com (Sync ma) Date: Tue, 24 Jul 2007 16:11:47 +0800 Subject: Problems about init. Message-ID: First , I would apologize because it may not be the problems about busybox, however, I can not found another place for help. Please take a look at my kernel bootling log, from the tail, you can find that there were no output(but serial seems OK, you can see that I have typed some chars and there have echo), it's so strange. the kernel was boot from the nfsroot(same problem when boot from the flash), and the boot cmd line is: root=/dev/nfs rw nfsroot=192.168.35.105:/xxxx/fs ip=192.168.35.107:192.168.35.105:192.168.35.1:255.255.255.0::eth0:off rootfstype=jffs2 init=/etc/preinit noinitrd console=ttyS0,115200n8 Any ideas? ====== script etc/preinit [root at sync fs]# cat etc/preinit #!/bin/sh echo "preinit start" export PATH=/bin:/sbin:/usr/bin:/usr/sbin exec /sbin/init =================== kernel boot log: Launching kernel decompressor. Starting LZMA Uncompression Algorithm. Compressed file is LZMA format. Kernel decompressor was successful ... launching kernel. LINUX started... Config serial console: console=ttyS0,115200n8r Enumerating for the host SOC yamuna-8400's VLYNQ module @ 0xa8611800. Identifying the neighbour connected to yamuna-8400 <0xa8611800>. Detected the VLYNQ SoC with id 0x0029 and named wlan1350. Enumerated yamuna-8400 <---> wlan1350, now configuring ..... ..... Configuration Done. Identifying the neighbour connected to wlan1350 <0xac088800>. Did not detect any SoC next to wlan1350 in the chain. VLYNQ Enumeration ended on the chain for root@ 0xac088800 for yamuna-8400. Linux version 2.6.10_dev-malta-mips2_fp_len (root at sync) (gcc version 4.1.2) #40 Tue Jul 24 11:09:40 CST 2007 CPU revision is: 00019068 Determined physical RAM map: memory: 14001000 @ 00000000 (reserved) memory: 0001f000 @ 14001000 (ROM data) memory: 002e4000 @ 14020000 (reserved) memory: 01afc000 @ 14304000 (usable) memory: 00200000 @ 15e00000 (reserved) Built 1 zonelists Kernel command line: root=/dev/nfs rw nfsroot=192.168.35.105:/xxxxx/fs ip=192.168.35.107:192.168.35.105:192.168.35.1:255.255.255.0::eth0:off console=ttyS0,115200n8r Primary instruction cache 16kB, physically tagged, 4-way, linesize 16 bytes. Primary data cache 16kB, 4-way, linesize 16 bytes. Synthesized TLB refill handler (20 instructions). Synthesized TLB load handler fastpath (32 instructions). Synthesized TLB store handler fastpath (32 instructions). Synthesized TLB modify handler fastpath (31 instructions). PID hash table entries: 128 (order: 7, 2048 bytes) CPU frequency 360.00 MHz Using 180.000 MHz high precision timer. Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) Memory: 27332k/30720k available (2067k kernel code, 3368k reserved, 444k data, 336k init) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) Checking for 'wait' instruction... available. spawn_desched_task(00000000) desched cpu_callback 3/00000000 ksoftirqd started up. softirq RT prio: 24. desched cpu_callback 2/00000000 desched thread 0 started up. TI Optimizations: Allocating TI-Cached Memory Pool. Warning: Number of buffers is not configured. Setting default to 512 Using 512 Buffers for TI-Cached Memory Pool. NSP Optimizations: Succesfully allocated TI-Cached Memory Pool. NET: Registered protocol family 16 Can't analyze prologue code at 94222ed4 musb_hdrc: version 2.2a/db-0.4.8 [cppi-dma] [peripheral] [debug=0] musb_hdrc: USB Peripheral mode controller at a3400000 using DMA, IRQ 39 PCI: device 0000:00:06.0 has unknown header type 7e, ignoring. PCI: device 0000:00:07.0 has unknown header type 7e, ignoring. PCI: device 0000:00:08.0 has unknown header type 7e, ignoring. Vlynq irq descriptors registered successfully. Environment variable BOARD_REV not defined taking default value as c0 JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc. JFFS2: default compression mode: priority Initializing Cryptographic API Installed misc driver vlynq0: it handles vlynq bridge0 with 1 hop(s). Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled ttyS0 at MMIO 0xa8610f00 (irq = 16) is a 16550A ttyS1 at MMIO 0xa8610e00 (irq = 15) is a 16550A io scheduler noop registered Loading cpgmac driver for yamuna CPMAC1 support not available Error getting CPMAC Configuration params for instance:0 Environment Variable:MACCFG_A not set in bootloader Setting Default configuration params for CPMAC instance:0 TI CPGMAC_F Linux DDA version 0.1 - CPGMAC_F DDC version 0.2 Cpmac: Installed 1 instances. Cpmac driver is allocating buffer memory at init time. elevator: using noop as default io scheduler Primary flash device: Found 1 x16 devices at 0x0 in 16-bit bank Amd/Fujitsu Extended Query Table at 0x0040 number of CFI chips: 1 cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. avalanche flash device: 0x800000 at 0x10000000. Found a active/root image (0x200000), with size (0x360000). Creating 1 MTD partitions on "Primary flash device": 0x00200000-0x00560000 : "active/root" avalanche_mtd_notify_add(): mtd->name = active/root, mtd->index= 0. Found a active/kernel image (0x110000), with size (0xf0000). Creating 1 MTD partitions on "Primary flash device": 0x00110000-0x00200000 : "active/kernel" avalanche_mtd_notify_add(): mtd->name = active/kernel, mtd->index= 1. Found a active/image image (0x100000), with size (0x700000). Creating 1 MTD partitions on "Primary flash device": 0x00100000-0x00800000 : "active/image" avalanche_mtd_notify_add(): mtd->name = active/image, mtd->index= 2. Avalanche: BOOTCFG_A variable not found. Avalanche: BOOTCFG_B variable not found. Found a active/config image (0x40000), with size (0xc0000). Creating 1 MTD partitions on "Primary flash device": 0x00040000-0x00100000 : "active/config" avalanche_mtd_notify_add(): mtd->name = active/config, mtd->index= 3. Found a bootloader image (0x0), with size (0x40000). Creating 1 MTD partitions on "Primary flash device": 0x00000000-0x00040000 : "bootloader" avalanche_mtd_notify_add(): mtd->name = bootloader, mtd->index= 4. ti_spi0: AVALANCHE SPI Controller driver at 0xa8611000 (irq = 0) Spansion s25fl eeprom driver registered successfully [major_num=253] usb0: Ethernet Gadget, version: Equinox 2004 usb0: using musb_hdrc, OUT ep2out IN ep1in STATUS ep3 usb0: MAC e2:84:28:74:d2:a1 usb0: HOST MAC 5e:13:9c:00:4d:9b usb0: RNDIS ready NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 2048 bind 4096) NET: Registered protocol family 1 NET: Registered protocol family 17 NET: Registered protocol family 8 NET: Registered protocol family 20 IP-Config: Complete: device=eth0, addr=192.168.35.107, mask=255.255.255.0, gw=192.168.35.1, host=192.168.35.107, domain=, nis-domain=(none), bootserver=192.168.35.105, rootserver=192.168.35.105, rootpath= ------------------------> ready to mount nfsroot Looking up port of RPC 100003/2 on 192.168.35.105 Looking up port of RPC 100005/1 on 192.168.35.105 VFS: Mounted root (nfs filesystem). Freeing unused kernel memory: 336k freed init(): force to run /etc/preinit for debugging. ggffafsasf fsa asf as f asf df^H^H k ================== From landau_alex at yahoo.com Tue Jul 24 09:54:12 2007 From: landau_alex at yahoo.com (Alex Landau) Date: Tue, 24 Jul 2007 02:54:12 -0700 (PDT) Subject: [PATCH] Fix start-stop-daemon on no-MMU Message-ID: <866511.5093.qm@web62501.mail.re1.yahoo.com> Hi, The attached patch fixes a compilation error: undefined reference to `_BUG_bb_daemonize_is_unavailable_on_nommu and makes start-stop-daemon usable on no-MMU by using bb_daemonize only if BB_MMU and emulating it if !BB_MMU. This is a bit hackish, since after vfork(), the child does all the work and exec()s the daemon, rather than execing right away, as the vfork paradigma says. Still I think this is better than re-execing start-stop-daemon and only then execing the daemon itself since this approach requires removing the -b (or --background) arguments from the command line, which is not fun (what if there are several -b options? etc.), and does not give any visible benefits. You may also find some code duplications with the fork_and_reexec functions (i.e. call to setsid, dupping /dev/null to 0,1 and 2), but I think this is unavoidable since all of these functions either do something slightly different or do not work on no-MMU. Regards, Alex ____________________________________________________________________________________ Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games. http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow -------------- next part -------------- A non-text attachment was scrubbed... Name: start-stop-daemon.patch Type: text/x-patch Size: 706 bytes Desc: 1590918349-start-stop-daemon.patch Url : http://lists.busybox.net/pipermail/busybox/attachments/20070724/44d82925/attachment-0002.bin From michele.sanges at otomelara.it Tue Jul 24 13:10:13 2007 From: michele.sanges at otomelara.it (Michele Sanges) Date: Tue, 24 Jul 2007 15:10:13 +0200 Subject: PIPESTATUS shell variable. Message-ID: <1185282613.2656.2.camel@pigreco> How do I set the PIPESTATUS shell variable, in the ash shell? Thanks. Michele From psmith at netezza.com Tue Jul 24 15:01:31 2007 From: psmith at netezza.com (Paul Smith) Date: Tue, 24 Jul 2007 11:01:31 -0400 Subject: PIPESTATUS shell variable. References: <1185282613.2656.2.camel@pigreco> Message-ID: > How do I set the PIPESTATUS shell variable, in the ash shell? You can't. First, PIPESTATUS is a bash extension, and is not available in POSIX shells (which ash is trying to be). Second, you can't have PIPESTATUS unless you also have shell array variables, which are ALSO bash extensions and not available in POSIX shells. And finally, pedantically, you don't set the PIPESTATUS variable even in bash: rather the shell sets it for you after a command that involves a pipe. PIPESTATUS _is_ unquestionably an extraordinarily useful tool, but unless you're writing scripts specifically for bash (which is not a great idea, portability-wise) you can't use it. Cheers! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.busybox.net/pipermail/busybox/attachments/20070724/553ef3e1/attachment-0002.htm From sbb at tuxfamily.org Tue Jul 24 15:20:56 2007 From: sbb at tuxfamily.org (Seb) Date: Tue, 24 Jul 2007 17:20:56 +0200 Subject: PIPESTATUS shell variable. In-Reply-To: <1185282613.2656.2.camel@pigreco> References: <1185282613.2656.2.camel@pigreco> Message-ID: <20070724172056.ef0737d9.sbb@tuxfamily.org> Le Tue, 24 Jul 2007 15:10:13 +0200 Michele Sanges a ?crit: Hello, > How do I set the PIPESTATUS shell variable, in the ash shell? > Thanks. I don't think it's possible, the man-page of bash specifies this variable is an array, while -- as far as I know -- ash shells don't support this structure of datas. ++ Seb. From dannf at dannf.org Tue Jul 24 21:12:22 2007 From: dannf at dannf.org (dann frazier) Date: Tue, 24 Jul 2007 15:12:22 -0600 Subject: [PATCH] resbumit: wget support for no_proxy env var Message-ID: <20070724211222.GD23172@colo.lackof.org> hey, The following patch adds support for the no_proxy envvar to the wget applet. Most of the code is lifted directly from GNU's wget source (with a few simplifications). Originally submitted here: http://article.gmane.org/gmane.linux.busybox/20296 The only outstanding feedback I have is the request to use argz if available. I certainly don't mind adding this if someone can tell me how to properly check for its availability. fyi, my goal with this patch is to enhance the debian installer to allow users who specify a proxy to disable proxy access for certain servers. For example, to use an internal mirror while still using the proxy to install security updates. --- busybox-1.6.0/networking/wget.c.orig 2007-06-18 20:09:36.000000000 +0100 +++ busybox-1.6.0/networking/wget.c 2007-06-21 00:36:21.000000000 +0100 @@ -84,6 +84,51 @@ } #endif +#if ENABLE_FEATURE_WGET_NOPROXY +char *strdupdelim (const char *beg, const char *end); +char *strdupdelim (const char *beg, const char *end) +{ + char *res = xmalloc (end - beg + 1); + memcpy (res, beg, end - beg); + res[end - beg] = '\0'; + return res; +} + +/* Parse a string containing comma-separated elements, and return a + vector of char pointers with the elements. Spaces following the + commas are ignored. */ +char **sepstring (const char *s); +char **sepstring (const char *s) +{ + char **res; + const char *p; + int i = 0; + + if (!s || !*s) + return NULL; + res = NULL; + p = s; + while (*s) { + if (*s == ',') { + res = xrealloc (res, (i + 2) * sizeof (char *)); + res[i] = strdupdelim (p, s); + res[++i] = NULL; + ++s; + /* Skip the blanks following the ','. */ + while (*s == ' ') + ++s; + p = s; + } else { + ++s; + } + } + res = xrealloc (res, (i + 2) * sizeof (char *)); + res[i] = strdupdelim (p, s); + res[i + 1] = NULL; + return res; +} +#endif + int wget_main(int argc, char **argv); int wget_main(int argc, char **argv) { @@ -108,6 +153,11 @@ bool got_clen = 0; /* got content-length: from server */ int output_fd = -1; bool use_proxy = 1; /* Use proxies if env vars are set */ +#if ENABLE_FEATURE_WGET_NOPROXY + int i, j; + char *tmp; + char **no_proxy = NULL; +#endif const char *proxy_flag = "on"; /* Use proxies if env vars are set */ const char *user_agent = "Wget";/* "User-Agent" header field */ static const char * const keywords[] = { @@ -175,6 +225,22 @@ server.host = target.host; server.port = target.port; +#if ENABLE_FEATURE_WGET_NOPROXY + tmp = getenv ("no_proxy"); + if (tmp) + no_proxy = sepstring((const char *)str_tolower(tmp)); + + for (i = 0; no_proxy && no_proxy[i]; i++){ + j = strlen(server.host) - strlen(no_proxy[i]); + if (j < 0) + continue; + if (!strcmp(str_tolower(server.host + j), + no_proxy[i])) { + use_proxy = 0; + break; + } + } +#endif /* Use the proxy if necessary */ if (use_proxy) { proxy = getenv(target.is_ftp ? "ftp_proxy" : "http_proxy"); --- busybox-1.6.0/networking/Config.in.orig 2007-06-21 00:38:52.000000000 +0100 +++ busybox-1.6.0/networking/Config.in 2007-06-21 00:59:51.000000000 +0100 @@ -722,6 +722,15 @@ help Support long options for the wget applet. +config FEATURE_WGET_NOPROXY + bool "Support the no_proxy environment variable" + default n + depends on WGET && GETOPT_LONG + help + Support the no_proxy environment variable. This variable can be used + to specify a comma-separated list of host suffixes for which a proxy + should not be used. + config ZCIP bool "zcip" default n -- dann frazier ----- End forwarded message ----- -- dann frazier From rep.dot.nop at gmail.com Tue Jul 24 21:23:34 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Tue, 24 Jul 2007 23:23:34 +0200 Subject: [PATCH] resbumit: wget support for no_proxy env var In-Reply-To: <20070724211222.GD23172@colo.lackof.org> References: <20070724211222.GD23172@colo.lackof.org> Message-ID: <20070724212334.GA24001@aon.at> On Tue, Jul 24, 2007 at 03:12:22PM -0600, dann frazier wrote: >hey, > The following patch adds support for the no_proxy envvar to the wget >applet. Most of the code is lifted directly from GNU's wget source >(with a few simplifications). > >Originally submitted here: > http://article.gmane.org/gmane.linux.busybox/20296 > >The only outstanding feedback I have is the request to use argz if >available. I certainly don't mind adding this if someone can tell me >how to properly check for its availability. > >fyi, my goal with this patch is to enhance the debian installer to >allow users who specify a proxy to disable proxy access for certain >servers. For example, to use an internal mirror while still using the >proxy to install security updates. That's what apt-proxy is for, but ok. See below. > >--- busybox-1.6.0/networking/wget.c.orig 2007-06-18 20:09:36.000000000 +0100 >+++ busybox-1.6.0/networking/wget.c 2007-06-21 00:36:21.000000000 +0100 Please diff that against svn trunk, just in case. >@@ -84,6 +84,51 @@ > } > #endif > >+#if ENABLE_FEATURE_WGET_NOPROXY >+char *strdupdelim (const char *beg, const char *end); >+char *strdupdelim (const char *beg, const char *end) which other applet uses this? >+{ >+ char *res = xmalloc (end - beg + 1); >+ memcpy (res, beg, end - beg); >+ res[end - beg] = '\0'; >+ return res; >+} >+ >+/* Parse a string containing comma-separated elements, and return a >+ vector of char pointers with the elements. Spaces following the >+ commas are ignored. */ >+char **sepstring (const char *s); >+char **sepstring (const char *s) which other applet uses this? >+{ >+ char **res; >+ const char *p; >+ int i = 0; >+ >+ if (!s || !*s) >+ return NULL; >+ res = NULL; >+ p = s; >+ while (*s) { >+ if (*s == ',') { >+ res = xrealloc (res, (i + 2) * sizeof (char *)); >+ res[i] = strdupdelim (p, s); >+ res[++i] = NULL; >+ ++s; >+ /* Skip the blanks following the ','. */ >+ while (*s == ' ') >+ ++s; skip_whitespace() ? >+ p = s; >+ } else { >+ ++s; >+ } >+ } >+ res = xrealloc (res, (i + 2) * sizeof (char *)); >+ res[i] = strdupdelim (p, s); >+ res[i + 1] = NULL; >+ return res; >+} >+#endif This _sounds_ a bit bloated but i didn't check if we already have infrastructure that could and should be reused. >+ > int wget_main(int argc, char **argv); > int wget_main(int argc, char **argv) > { >@@ -108,6 +153,11 @@ > bool got_clen = 0; /* got content-length: from server */ > int output_fd = -1; > bool use_proxy = 1; /* Use proxies if env vars are set */ >+#if ENABLE_FEATURE_WGET_NOPROXY >+ int i, j; >+ char *tmp; >+ char **no_proxy = NULL; >+#endif > const char *proxy_flag = "on"; /* Use proxies if env vars are set */ > const char *user_agent = "Wget";/* "User-Agent" header field */ > static const char * const keywords[] = { >@@ -175,6 +225,22 @@ > server.host = target.host; > server.port = target.port; > >+#if ENABLE_FEATURE_WGET_NOPROXY >+ tmp = getenv ("no_proxy"); >+ if (tmp) >+ no_proxy = sepstring((const char *)str_tolower(tmp)); >+ >+ for (i = 0; no_proxy && no_proxy[i]; i++){ >+ j = strlen(server.host) - strlen(no_proxy[i]); >+ if (j < 0) >+ continue; >+ if (!strcmp(str_tolower(server.host + j), >+ no_proxy[i])) { >+ use_proxy = 0; can you use the recently added ..._strings stuff? You'd e.g. memchr for ',' set them to nil. Perhaps this makes the above to public functions superfluous. Also, what's the size(1) increase for this new option? cheers, From vapier at gentoo.org Tue Jul 24 22:35:23 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Tue, 24 Jul 2007 18:35:23 -0400 Subject: [PATCH] Fix start-stop-daemon on no-MMU In-Reply-To: <866511.5093.qm@web62501.mail.re1.yahoo.com> References: <866511.5093.qm@web62501.mail.re1.yahoo.com> Message-ID: <200707241835.24382.vapier@gentoo.org> On Tuesday 24 July 2007, Alex Landau wrote: > You may also find some code duplications with the fork_and_reexec functions > (i.e. call to setsid, dupping /dev/null to 0,1 and 2), there is a bb sanitize io function which could alleviate some of this isnt there ? -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://lists.busybox.net/pipermail/busybox/attachments/20070724/739090b4/attachment-0002.pgp From roberto.foglietta at gmail.com Wed Jul 25 07:46:21 2007 From: roberto.foglietta at gmail.com (Roberto A. Foglietta) Date: Wed, 25 Jul 2007 09:46:21 +0200 Subject: OT: many script or many fork? Message-ID: Hi to all folks, sorry for the OT but I am wondering if it would be better have three indipendent script which runs concurrently or it is better having only a script like this: while true; do [ ... code 1 ... ] done & while true; do [ ... code 2 ... ] done & while true; do [ ... code 3 ... ] done Thanks in advance, -- /roberto From landau_alex at yahoo.com Wed Jul 25 08:41:19 2007 From: landau_alex at yahoo.com (Alex Landau) Date: Wed, 25 Jul 2007 01:41:19 -0700 (PDT) Subject: [PATCH] Fix start-stop-daemon on no-MMU In-Reply-To: <200707241835.24382.vapier@gentoo.org> Message-ID: <870780.98387.qm@web62513.mail.re1.yahoo.com> --- Mike Frysinger wrote: > On Tuesday 24 July 2007, Alex Landau wrote: > > You may also find some code duplications with the fork_and_reexec functions > > (i.e. call to setsid, dupping /dev/null to 0,1 and 2), > > there is a bb sanitize io function which could alleviate some of this isnt > there ? > -mike > No that won't work. bb_sanitize_stdio() goes over descriptors 0,1,2 and if any is closed, connects it to /dev/null. I want to force them to be /dev/null. Second, the dups and setsid are combined with the re-execing, while in the start-stop-daemon case the child should continue and do some stuff before execing. And last, either I don't understand something, or the bb_daemonize_or_rexec() function that bb_sanitize_stdio() uses is broken: DAEMON_DEVNULL_STDIO is defined as 0, so we never close 0,1,2 (unless we're also re-execing) and that "if" is dead code. Alex ____________________________________________________________________________________ Choose the right car based on your needs. Check out Yahoo! Autos new Car Finder tool. http://autos.yahoo.com/carfinder/ From sbb at tuxfamily.org Wed Jul 25 09:08:07 2007 From: sbb at tuxfamily.org (Seb) Date: Wed, 25 Jul 2007 11:08:07 +0200 Subject: OT: many script or many fork? In-Reply-To: References: Message-ID: <20070725110807.ba1071f5.sbb@tuxfamily.org> Le Wed, 25 Jul 2007 09:46:21 +0200 "Roberto A. Foglietta" a ?crit: > Hi to all folks, Hello, > sorry for the OT but I am wondering if it would be better have three > indipendent script which runs concurrently or it is better having only > a script like this: Theorically 3 scripts = 3 shells = 3 system calls. So, IMHO the most efficient must be to launch one script. After, it depends on the code you execute : if there are many system calls and few needs in memory, you probably won't see the difference. > while true; do > [ ... code 1 ... ] > done & > > while true; do > [ ... code 2 ... ] > done & > > while true; do > [ ... code 3 ... ] > done Maybe it would be good to end it with a 'wait' in order to be sure you don't let an infinite loop in background. ++ Seb. From vapier at gentoo.org Wed Jul 25 13:23:33 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Wed, 25 Jul 2007 09:23:33 -0400 Subject: OT: many script or many fork? In-Reply-To: <20070725110807.ba1071f5.sbb@tuxfamily.org> References: <20070725110807.ba1071f5.sbb@tuxfamily.org> Message-ID: <200707250923.33921.vapier@gentoo.org> On Wednesday 25 July 2007, Seb wrote: > "Roberto A. Foglietta" a ?crit: > > sorry for the OT but I am wondering if it would be better have three > > indipendent script which runs concurrently or it is better having only > > a script like this: > > Theorically 3 scripts = 3 shells = 3 system calls. you cant equate 3 shells to 3 system calls ... simply executing `bash` will execute many more system calls than just one. > So, IMHO the most > efficient must be to launch one script. After, it depends on the code > you execute : if there are many system calls and few needs in memory, > you probably won't see the difference. since each script is really just /bin/bash (or whatever), the appropriate sections are shared in memory automatically. an independent script is pretty much the same as backgrounding something as the shell will fork a new process for each one. so you still have 3 processes. about the only thing you could say is how long running is the script. if it is long running, then the difference will probably be negligible. if it's something that gets executed over and over, spawning subshells may be slightly cheaper than forking whole new shells for each script. but really, this is all just conjecture ... the only real test is one you run yourself and gather quantitative data about resource utilization. -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://lists.busybox.net/pipermail/busybox/attachments/20070725/58c54f90/attachment-0002.pgp From ynakam at hitachisoft.jp Tue Jul 24 00:08:24 2007 From: ynakam at hitachisoft.jp (Yuichi Nakamura) Date: Tue, 24 Jul 2007 09:08:24 +0900 Subject: [patch]setfiles/restorecon applet In-Reply-To: <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> References: <20070723125252.GA7902@aon.at> <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> Message-ID: <20070724085858.41D8.YNAKAM@hitachisoft.jp> Hi. I checked out svn and found many changes. Thanks for a lot of work. On Mon, 23 Jul 2007 14:56:57 +0100 "Denis Vlasenko" wrote: > On 7/23/07, Bernhard Fischer wrote: > > On Mon, Jul 23, 2007 at 10:16:38AM +0900, Yuichi Nakamura wrote: > > >Hi. > > > > in setfiles_full_usage: > > "\n -q Suppress no-error output" \ > > do you mean "Suppress warnings" or "be quiet" or the like? > > > > selinux/setfiles.c: > > Port to BusyBox by 2007 > > s/by 2007/(c) 2007 by/ > > I already applied patch to svn... > > > in struct globals, i, personally prefer bools (smaller for me on x86), > > just as a sidenote. > > bools are smaller than smallints (which are chars on i386)? > I don't understand how. > > I introduced smallints specifically because *I* want to be able > to control what they are, not gcc. gcc people hate us. > (No, not really, but they aren't thinking too much about > saving on size - see my rant on idiotic recent i386 > stack alignment disaster.) > > > in add_exclude can use use const char*const directory? (didn't look > > closely). Also, you seem to reimplement something like basename or > > last_path_component there. Furthermore should return type bool. > > Initializing len to 0 looks like it is superfluous. > > Yuichi, please look into it and send all follow-on patches relative to svn. Updated. - Return bools where it can. - Updated usage for q option. - Make -q and -v exclusive. - Make add_exclude argument const char *const > > likewise a couple of others should return a bool: > > -+static int exclude(const char *file) > > ++static bool exclude(const char *file) > > > > match(): > > + if (excludeCtr > 0) { > > + if (exclude(name)) { > > + goto err; > > + } > > + } > > Please change to > > if (excludeCtr > 0 && exclude(name)) > > goto err; > > (perhaps in a couple of other places too. (run, from the toplevel > > sourcedir 'indent selinux/*' for other misc style-cleanups.) > > near "if (expand_realpath) {", move the > > + if (excludeCtr > 0 && exclude(name)) > > + goto err; > > out of both branches if if-else. It seems that they are already done by Denis, thanks. > > > > restore(): user_only_changed can be bool. Isn't there a sanitize_path() > > that you could reuse for stripping multiple slashes off? user_only_changed is now bool. About sanitize_path, it is pending. Removing extra slashes is done only there in setfiles.c . Is removing extra slashes done in other applets? If so, should it be in libbb? I've found bb_simplify_path, but it is expanding "." . > > > > [snipping the rest of you patch for now] > > HTH, > -- > vda Attached is update. -- Yuichi Nakamura Hitachi Software Engineering Co., Ltd. Japan SELinux Users Group(JSELUG): http://www.selinux.gr.jp/ SELinux Policy Editor: http://seedit.sourceforge.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: setfiles.5.patch Type: application/octet-stream Size: 2056 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070724/6b64ed6b/attachment-0002.obj From ynakam at hitachisoft.jp Wed Jul 25 00:25:21 2007 From: ynakam at hitachisoft.jp (Yuichi Nakamura) Date: Wed, 25 Jul 2007 09:25:21 +0900 Subject: [patch]setfiles/restorecon applet In-Reply-To: <200707240701.36169.vda.linux@googlemail.com> References: <20070724085858.41D8.YNAKAM@hitachisoft.jp> <200707240701.36169.vda.linux@googlemail.com> Message-ID: <20070725090503.60F9.YNAKAM@hitachisoft.jp> On Tue, 24 Jul 2007 07:01:36 +0100 Denis Vlasenko wrote: > On Tuesday 24 July 2007 01:08, Yuichi Nakamura wrote: > > Attached is update. > > Applied to svn. Further reductions are possible: > > if (flags & OPT_e) { > if (exclude_dir == NULL) { > bb_show_usage(); > } > > I think it is already handled inside getopt32. IOW: > if() above is not needed at all, ok to remove? > > while (exclude_dir) { > if (add_exclude(llist_pop(&exclude_dir))) > exit(1); > } > > add_exclude is used only once here. Obviously you can make > it a void function which exits on errors. > > } > > Can you test it? I've tested, and it worked. Attached is a patch. > Can you point me to FAQ/whetever how to install SELinux libs > so that I can at least compile this stuff myself? I suppose > this doesn't require SELinux-enabled kernel? > -- > vda Yes, it does not require SELinux enabled kernel. You have to obtain libselinux, libsepol. If you install from source, obtain source from below. http://www.nsa.gov/selinux/archives/libsepol-1.16.1.tgz http://www.nsa.gov/selinux/archives/libselinux-1.34.7.tgz And run make ARCH= CC= If your cross compiler does not support thread local storage, you have to define __thread as NULL, like below make ARCH= CC= CFLAGS=-D__thread= Then, libselinux, libsepol is made under src. Header files exists under include dir. -- Yuichi Nakamura Hitachi Software Engineering Co., Ltd. Japan SELinux Users Group(JSELUG): http://www.selinux.gr.jp/ SELinux Policy Editor: http://seedit.sourceforge.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: setfiles.patch Type: application/octet-stream Size: 1611 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070725/1c74da02/attachment-0002.obj From farmatito at tiscali.it Wed Jul 25 16:13:40 2007 From: farmatito at tiscali.it (Tito) Date: Wed, 25 Jul 2007 18:13:40 +0200 Subject: [patch]setfiles/restorecon applet In-Reply-To: <20070724085858.41D8.YNAKAM@hitachisoft.jp> References: <20070723125252.GA7902@aon.at> <1158166a0707230656p5b5798f7l78848fa41991ca4@mail.gmail.com> <20070724085858.41D8.YNAKAM@hitachisoft.jp> Message-ID: <200707251813.41031.farmatito@tiscali.it> On Tuesday 24 July 2007 02:08:24 Yuichi Nakamura wrote: > Hi. > snip > > About sanitize_path, it is pending. > Removing extra slashes is done only there in setfiles.c . > Is removing extra slashes done in other applets? Yes in devfsd, removing extra slashes at the end of filename: in one earlier revision there was: /* strip last / from mount point, so we don't need to check for it later */ while (argv[1][1] != '\0' && argv[1][strlen(argv[1]) - 1] == '/') argv[1][strlen(argv[1]) - 1] = '\0'; later it changed to mount_point = bb_simplify_path(argv[1]); so far nobody complained..... > If so, should it be in libbb? Could be useful...... just my 0,02 ? Ciao, Tito > I've found bb_simplify_path, but it is expanding "." . > > > > > > > [snipping the rest of you patch for now] > > > HTH, > > -- > > vda > > Attached is update. From sbb at tuxfamily.org Wed Jul 25 17:17:25 2007 From: sbb at tuxfamily.org (Seb) Date: Wed, 25 Jul 2007 19:17:25 +0200 Subject: OT: many script or many fork? In-Reply-To: <200707250923.33921.vapier@gentoo.org> References: <20070725110807.ba1071f5.sbb@tuxfamily.org> <200707250923.33921.vapier@gentoo.org> Message-ID: <20070725191725.9cc0948e.sbb@tuxfamily.org> Le Wed, 25 Jul 2007 09:23:33 -0400 Mike Frysinger a ?crit: > > Theorically 3 scripts = 3 shells = 3 system calls. > > you cant equate 3 shells to 3 system calls ... simply executing `bash` will > execute many more system calls than just one. Oh, yes the term "system call" is maybe improper, here. I thought to the "system" function in Perl... I should have said "you will ask to the system to launch the command three times instead of one", so there are three initializations instead of one, whatever a single initialization does. > > So, IMHO the most > > efficient must be to launch one script. After, it depends on the code > > you execute : if there are many system calls and few needs in memory, > > you probably won't see the difference. > > since each script is really just /bin/bash (or whatever), the appropriate > sections are shared in memory automatically. an independent script is pretty > much the same as backgrounding something as the shell will fork a new process > for each one. so you still have 3 processes. Is there no difference at all between a job and a parallel shell ? it's a true question... Seen from "outside" I had the feeling a job was more "integrated" to its parent shell in order to allow jobs control. Is it just a story of "naming space" (sorry, I haven't the appropriate terms) without any physical reality, which for example would say to a shell: "you can know when this process will end because it's your son but for this one you'll have to deal with 'ps' because it's not" ? However with 3 scripts executing each one command, you should have 6 processes unless you specify 'exec' in them (the processes of the shells + ones of the commands), while with 3 commands backgrounded in one script, you should have 4 processes. But what you mean is that *physically* one or thousand 'bash' processes is the same thing, have I well understood ? :) > about the only thing you could say is how long running is the script. if it > is long running, then the difference will probably be negligible. if it's > something that gets executed over and over, spawning subshells may be > slightly cheaper than forking whole new shells for each script. but really, > this is all just conjecture ... the only real test is one you run yourself > and gather quantitative data about resource utilization. In fact the difference I was conceiving was a difference between a script which would have combine many commands, and a script which would have use primarily the internal functions of the shell (few forks). With the second ones, the cost of the extra initializations should be *relatively* sensible but not in the first ones where it should be drowned in all system calls, shouldn't it ? ++ Seb. From kbc_hyper at hotmail.com Wed Jul 25 22:30:37 2007 From: kbc_hyper at hotmail.com (Choi Jason) Date: Wed, 25 Jul 2007 17:30:37 -0500 Subject: need some help to setup nslookup Message-ID: Hello All, I think I need your help at this time. :) Now, I tried to use nslookup on my target system. When I compiled busybox, I just turned on Networking Utilities -> nslookup. And I install this busybox to my target. And I create /etc/resolv.conf. Contents of /etc/resolv.conf is as followings ---------------- search abc.net nameserver 4.2.2.1 ---------------- And I create /etc/hosts as followings ---------------- 127.0.0.1 localhost 192.168.6.77 abc.site abc 209.131.36.158 www.yahoo.com ---------------- When I tried "nslookup www.google.com", following message is displayed. ---------------- # nslookup www.google.com Server : 4.2.2.1 Address 1: 4.2.2.1 nslookup: can't resolve 'www.google.com' ---------------- And when I tried "nslookup www.yahoo.com", following message is displayed. ---------------- #nslookup www.yshoo.com Server: 4.2.2.1 Address 1: 4.2.2.1 Name: www.yahoo.com Address 1: 209.131.36.158 www.yahoo.com ----------------- So,,I don't know why I could not get address resolve result. Do I need more steps to setup nslookup on my target? I think when I tried address resolve of www.yahoo.com, it could find it's result thanks to /etc/hosts. I hope to get some help from you guys. Thanks in advance :) Jason, From vapier at gentoo.org Wed Jul 25 23:55:02 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Wed, 25 Jul 2007 19:55:02 -0400 Subject: need some help to setup nslookup In-Reply-To: References: Message-ID: <200707251955.03030.vapier@gentoo.org> On Wednesday 25 July 2007, Choi Jason wrote: > Now, I tried to use nslookup on my target system. > When I compiled busybox, I just turned on Networking Utilities -> nslookup. > And I install this busybox to my target. busybox contains no dns logic. all querying is done via the system libc functions, so please consult the manual for whichever libc you're using to find out how to properly configure /etc/resolv.conf, /etc/hosts, your routing table, and network interfaces. in fact, i'd check the above list in the reverse order i specified to make sure your system is setup properly. tldp.org has some pretty complete howto's you could read. -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://lists.busybox.net/pipermail/busybox/attachments/20070725/58a9f8a2/attachment-0002.pgp From vapier at gentoo.org Thu Jul 26 00:04:13 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Wed, 25 Jul 2007 20:04:13 -0400 Subject: OT: many script or many fork? In-Reply-To: <20070725191725.9cc0948e.sbb@tuxfamily.org> References: <200707250923.33921.vapier@gentoo.org> <20070725191725.9cc0948e.sbb@tuxfamily.org> Message-ID: <200707252004.14409.vapier@gentoo.org> On Wednesday 25 July 2007, Seb wrote: > Mike Frysinger a ?crit: > > > So, IMHO the most > > > efficient must be to launch one script. After, it depends on the code > > > you execute : if there are many system calls and few needs in memory, > > > you probably won't see the difference. > > > > since each script is really just /bin/bash (or whatever), the appropriate > > sections are shared in memory automatically. an independent script is > > pretty much the same as backgrounding something as the shell will fork a > > new process for each one. so you still have 3 processes. > > Is there no difference at all between a job and a parallel shell ? it's > a true question... Seen from "outside" I had the feeling a job > was more "integrated" to its parent shell in order to allow jobs > control. Is it just a story of "naming space" (sorry, I haven't > the appropriate terms) without any physical reality, which for example > would say to a shell: "you can know when this process will end because > it's your son but for this one you'll have to deal with 'ps' because > it's not" ? whether you do `./somescript.sh` or `while ... done &`, `ps` would show a separate process because they are both forked off. > However with 3 scripts executing each one command, you should have 6 > processes unless you specify 'exec' in them (the processes of the shells > + ones of the commands), while with 3 commands backgrounded in one > script, you should have 4 processes. But what you mean is that > *physically* one or thousand 'bash' processes is the same thing, > have I well understood ? :) they'd be equivalent number of processes if you did: ./script1.sh ./script2.sh ./script3.sh versus while ... done & while ... done & while ... done the only savings you could really count is the cost of starting up the shell ... when you use &, you're still doing a fork(). > > about the only thing you could say is how long running is the script. if > > it is long running, then the difference will probably be negligible. if > > it's something that gets executed over and over, spawning subshells may > > be slightly cheaper than forking whole new shells for each script. but > > really, this is all just conjecture ... the only real test is one you run > > yourself and gather quantitative data about resource utilization. > > In fact the difference I was conceiving was a difference between a > script which would have combine many commands, and a script which would > have use primarily the internal functions of the shell (few forks). With > the second ones, the cost of the extra initializations should be > *relatively* sensible but not in the first ones where it should be > drowned in all system calls, shouldn't it ? doing `./foo.sh` will start up a new shell and run through its init routines while doing `while ... done &` will fork the currently running shell and thus bypass the routines. but in the end, you arent looking at a different number of forks, just the startup cost. so a long running script should generally platoue at the same resource utilization regardless of how it was started. shell functions do not cause forks, things like '&', '`...`', '$(...)', '... | ...' do. -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://lists.busybox.net/pipermail/busybox/attachments/20070725/6eb08037/attachment-0002.pgp From pedro.salgueiro at gmail.com Thu Jul 26 17:57:58 2007 From: pedro.salgueiro at gmail.com (Pedro Salgueiro) Date: Thu, 26 Jul 2007 18:57:58 +0100 Subject: Monitor black after 10 Minutes Message-ID: <993f1d7c0707261057j661683e7w4a55073c915be5b9@mail.gmail.com> Hi! I am using Busybox 1.6.0 to make an automated net-instalation of Linux. Everything is working ok, but when the install process is working, after 10 minutes of no keyboard or mouse activity the monitor goes blank(black) and only gets ok when I hit the keyboard. Does anyone knows how to solve this problem? Thank you all and sorry for the bad english. Pedro Salgueiro From aurel at gnuage.org Thu Jul 26 18:15:01 2007 From: aurel at gnuage.org (Aurelien Jacobs) Date: Thu, 26 Jul 2007 20:15:01 +0200 Subject: Monitor black after 10 Minutes In-Reply-To: <993f1d7c0707261057j661683e7w4a55073c915be5b9@mail.gmail.com> References: <993f1d7c0707261057j661683e7w4a55073c915be5b9@mail.gmail.com> Message-ID: <20070726201501.b5f4caa2.aurel@gnuage.org> On Thu, 26 Jul 2007 18:57:58 +0100 "Pedro Salgueiro" wrote: > Hi! > > I am using Busybox 1.6.0 to make an automated net-instalation of > Linux. Everything is working ok, but when the install process is > working, after 10 minutes of no keyboard or mouse activity the monitor > goes blank(black) and only gets ok when I hit the keyboard. > > Does anyone knows how to solve this problem? This has nothing to do with busybox, but the following escape sequence should do the trick: echo -e "\033[9;0]" Aurel From pedro.salgueiro at gmail.com Thu Jul 26 20:11:31 2007 From: pedro.salgueiro at gmail.com (Pedro Salgueiro) Date: Thu, 26 Jul 2007 21:11:31 +0100 Subject: Monitor black after 10 Minutes In-Reply-To: <06ec01c7cfaf$f9b3e010$2600a8c0@engineering5> References: <993f1d7c0707261057j661683e7w4a55073c915be5b9@mail.gmail.com> <06ec01c7cfaf$f9b3e010$2600a8c0@engineering5> Message-ID: <993f1d7c0707261311l1a42aa6do59cff65d98b85983@mail.gmail.com> Hi! I was trying not to change te driver. Is there any other way to resolve this? Anyway, I will try to find out what driver I'm using... Thank you. Pedro Salgueiro On 7/26/07, Christopher Reder wrote: > Try looking for whatever video driver you are using (on my board, it was an > Epson s1d), and look for something like the following: > > > static struct fb_ops s1d13xxxfb_fbops = { > .owner = THIS_MODULE, > .fb_set_par = s1d13xxxfb_set_par, > .fb_setcolreg = s1d13xxxfb_setcolreg, > .fb_blank = s1d13xxxfb_blank, > > .fb_pan_display = s1d13xxxfb_pan_display, > > /* to be replaced by any acceleration we can */ > .fb_fillrect = cfb_fillrect, > .fb_copyarea = cfb_copyarea, > .fb_imageblit = cfb_imageblit, > }; > > See where it has .fb_blank ? well, that is the function that will blank it. > If you just return out of that without doing anything, it won't go black. > > Hope that helps... > > -----Original Message----- > From: busybox-bounces at busybox.net [mailto:busybox-bounces at busybox.net] On > Behalf Of Pedro Salgueiro > Sent: Thursday, July 26, 2007 12:58 PM > To: busybox at busybox.net > Subject: Monitor black after 10 Minutes > > Hi! > > I am using Busybox 1.6.0 to make an automated net-instalation of > Linux. Everything is working ok, but when the install process is > working, after 10 minutes of no keyboard or mouse activity the monitor > goes blank(black) and only gets ok when I hit the keyboard. > > Does anyone knows how to solve this problem? > > Thank you all and sorry for the bad english. > > Pedro Salgueiro > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > From jcurlnews at arcor.de Thu Jul 26 20:11:14 2007 From: jcurlnews at arcor.de (Jason Curl) Date: Thu, 26 Jul 2007 22:11:14 +0200 Subject: Monitor black after 10 Minutes In-Reply-To: <993f1d7c0707261057j661683e7w4a55073c915be5b9@mail.gmail.com> References: <993f1d7c0707261057j661683e7w4a55073c915be5b9@mail.gmail.com> Message-ID: <46A8FFE2.6030305@arcor.de> Pedro Salgueiro wrote: > Hi! > > I am using Busybox 1.6.0 to make an automated net-instalation of > Linux. Everything is working ok, but when the install process is > working, after 10 minutes of no keyboard or mouse activity the monitor > goes blank(black) and only gets ok when I hit the keyboard. > As another post said - nothing to do with BusyBox. But it's the kernel that's doing this. I compiled ncurses, then setterm from util-linux and used the command 'setterm -blank 0'. This is the heavy handed way of doing things. > Does anyone knows how to solve this problem? > > Thank you all and sorry for the bad english. > > From pedro.salgueiro at gmail.com Thu Jul 26 23:39:44 2007 From: pedro.salgueiro at gmail.com (Pedro Salgueiro) Date: Fri, 27 Jul 2007 00:39:44 +0100 Subject: Monitor black after 10 Minutes In-Reply-To: <46A8FFE2.6030305@arcor.de> References: <993f1d7c0707261057j661683e7w4a55073c915be5b9@mail.gmail.com> <46A8FFE2.6030305@arcor.de> Message-ID: <993f1d7c0707261639u1fdc21aeh75bf62837a8a8114@mail.gmail.com> Hi! Thank you all for helping me. The escape sequence posted by Aurel solved the problem. Once more, thank you all. Pedro Salgueiro On 7/26/07, Jason Curl wrote: > Pedro Salgueiro wrote: > > Hi! > > > > I am using Busybox 1.6.0 to make an automated net-instalation of > > Linux. Everything is working ok, but when the install process is > > working, after 10 minutes of no keyboard or mouse activity the monitor > > goes blank(black) and only gets ok when I hit the keyboard. > > > As another post said - nothing to do with BusyBox. But it's the kernel > that's doing this. I compiled ncurses, then setterm from util-linux and > used the command 'setterm -blank 0'. This is the heavy handed way of > doing things. > > Does anyone knows how to solve this problem? > > > > Thank you all and sorry for the bad english. > > > > > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > From vda.linux at googlemail.com Fri Jul 27 12:24:48 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Fri, 27 Jul 2007 13:24:48 +0100 Subject: need some help to setup nslookup In-Reply-To: References: Message-ID: <1158166a0707270524k4e460192md98b53a049d6bb9a@mail.gmail.com> On 7/25/07, Choi Jason wrote: > Hello All, > > I think I need your help at this time. :) > Now, I tried to use nslookup on my target system. > When I compiled busybox, I just turned on Networking Utilities -> nslookup. > And I install this busybox to my target. > And I create /etc/resolv.conf. > Contents of /etc/resolv.conf is as followings > ---------------- > search abc.net > nameserver 4.2.2.1 > ---------------- > And I create /etc/hosts as followings > ---------------- > 127.0.0.1 localhost > 192.168.6.77 abc.site abc > 209.131.36.158 www.yahoo.com > ---------------- > > When I tried "nslookup www.google.com", following message is displayed. > ---------------- > # nslookup www.google.com > Server : 4.2.2.1 > Address 1: 4.2.2.1 > > nslookup: can't resolve 'www.google.com' > ---------------- > And when I tried "nslookup www.yahoo.com", following message is displayed. > ---------------- > #nslookup www.yshoo.com > Server: 4.2.2.1 > Address 1: 4.2.2.1 > > Name: www.yahoo.com > Address 1: 209.131.36.158 www.yahoo.com Enable CONFIG_VERBOSE_RESOLUTION_ERRORS=y, it will give a bit more info: $ ./busybox nslookup www.sdjhgfklsdjgf.com Server: 172.26.128.68 Address 1: 172.26.128.68 XXXXXXXXXXXXXXX nslookup: can't resolve 'www.sdjhgfklsdjgf.com': Name or service not known ^^^^^^^^^^^^^^^^^^^^^^^^^ here -- vda From pgf at brightstareng.com Fri Jul 27 13:05:58 2007 From: pgf at brightstareng.com (Paul Fox) Date: Fri, 27 Jul 2007 09:05:58 -0400 Subject: Monitor black after 10 Minutes In-Reply-To: jcurlnews's message of Thu, 26 Jul 2007 22:11:14 +0200. <46A8FFE2.6030305@arcor.de> Message-ID: <23914.1185541558@brightstareng.com> > As another post said - nothing to do with BusyBox. But it's the kernel > that's doing this. I compiled ncurses, then setterm from util-linux and > used the command 'setterm -blank 0'. This is the heavy handed way of > doing things. yes, that's a lot of work :-), since in the end all setterm does is emit the previously mentioned escape sequence. ( "ESC [ 9 ; 0 ]" ) TERM=linux setterm -blank 0 | hexdump -C paul =--------------------- paul fox, pgf at brightstareng.com From wharms at bfs.de Fri Jul 27 13:30:10 2007 From: wharms at bfs.de (walter harms) Date: Fri, 27 Jul 2007 15:30:10 +0200 Subject: Monitor black after 10 Minutes In-Reply-To: <23914.1185541558@brightstareng.com> References: <23914.1185541558@brightstareng.com> Message-ID: <46A9F362.7090702@bfs.de> Paul Fox wrote: > > As another post said - nothing to do with BusyBox. But it's the kernel > > that's doing this. I compiled ncurses, then setterm from util-linux and > > used the command 'setterm -blank 0'. This is the heavy handed way of > > doing things. > > yes, that's a lot of work :-), since in the end all setterm does is > emit the previously mentioned escape sequence. ( "ESC [ 9 ; 0 ]" ) > > TERM=linux setterm -blank 0 | hexdump -C > > paul To discover what more can be done use 'man console_code'. re, wh From Alexander at Kriegisch.name Fri Jul 27 14:22:41 2007 From: Alexander at Kriegisch.name (Alexander Kriegisch) Date: Fri, 27 Jul 2007 16:22:41 +0200 Subject: Monitor black after 10 Minutes In-Reply-To: <46A9F362.7090702@bfs.de> References: <23914.1185541558@brightstareng.com> <46A9F362.7090702@bfs.de> Message-ID: <46A9FFB1.8060604@Kriegisch.name> > To discover what more can be done use 'man console_code'. Maybe you mean 'man console_codes' (trailing 's')? -- Alexander Kriegisch From steven.scholz at imc-berlin.de Fri Jul 27 14:13:31 2007 From: steven.scholz at imc-berlin.de (Steven Scholz) Date: Fri, 27 Jul 2007 16:13:31 +0200 Subject: Monitor black after 10 Minutes In-Reply-To: <23914.1185541558@brightstareng.com> References: <23914.1185541558@brightstareng.com> Message-ID: <46A9FD8B.6090701@imc-berlin.de> Paul Fox wrote: > > As another post said - nothing to do with BusyBox. But it's the kernel > > that's doing this. I compiled ncurses, then setterm from util-linux and > > used the command 'setterm -blank 0'. This is the heavy handed way of > > doing things. > > yes, that's a lot of work :-), since in the end all setterm does is > emit the previously mentioned escape sequence. ( "ESC [ 9 ; 0 ]" ) > > TERM=linux setterm -blank 0 | hexdump -C But this all only works if I am actually working on this terminal!? I do have a frame buffer console (VT) with no keyboard, but use the serial console. So I guess "setterm -blank 0" then works on my serial console but nit on the framebuffer. How am I supposed to switch off console blanking then? In a bootscript? Thanks! Steven From pgf at brightstareng.com Fri Jul 27 16:05:25 2007 From: pgf at brightstareng.com (Paul Fox) Date: Fri, 27 Jul 2007 12:05:25 -0400 Subject: Monitor black after 10 Minutes In-Reply-To: steven.scholz's message of Fri, 27 Jul 2007 16:13:31 +0200. <46A9FD8B.6090701@imc-berlin.de> Message-ID: <23259.1185552325@brightstareng.com> > > How am I supposed to switch off console blanking then? > In a bootscript? send the escape sequence to the correct tty, e.g.: echo esc-sequence >/dev/tty0 =--------------------- paul fox, pgf at brightstareng.com From rep.dot.nop at gmail.com Fri Jul 27 16:27:07 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Fri, 27 Jul 2007 18:27:07 +0200 Subject: "multiple target patterns" error while building under cygwin In-Reply-To: References: <000501c7cd42$2a1b0d20$dcc4af0a@atmel.com> Message-ID: <20070727162707.GH25147@aon.at> On Mon, Jul 23, 2007 at 12:33:58PM -0400, Crane, Matthew wrote: >Hi, > > >I'm trying to build on cygwin, busybox is failing with the error: > > >applets/.applets.o.cmd:410: *** multiple target patterns. Stop. > >Has anybody come across this? I'm wondering if it's related to the case >insensitivity of cygwin. Any help much apreciated, > >Matt > > >More complete error log, starts just as the build process has run >through building busybox once, and starts again, which I think is >normal?? > > > AR util-linux/lib.a > LINK busybox_unstripped >cp busybox_unstripped busybox >make[1]: Leaving directory >`/usr/local/src/hd2/buildroot-20070718/project_build_arm_nofpu/uclibc/bu >sybox-1.6.1' >/usr/bin/make -j1 CC=/usr/local/arm2007-uc/bin/arm-uclinuxeabi-gcc >CROSS_COMPILE="/usr/local/arm2007-uc/bin/arm-uclinuxeabi- >" \ > CROSS="/usr/local/arm2007-uc/bin/arm-uclinuxeabi-" >PREFIX="/usr/local/src/hd2/buildroot-20070718/project_bui >ld_arm_nofpu/uclibc/root" \ > ARCH=arm \ > EXTRA_CFLAGS="-Os -pipe >-I/usr/local/src/hd2/buildroot-20070718/build_arm_nofpu/staging_dir/incl >ude -I/usr/ >local/src/hd2/buildroot-20070718/build_arm_nofpu/staging_dir/usr/include >-I/usr/local/arm2007-uc/arm-uclinuxeabi/include" -C > >/usr/local/src/hd2/buildroot-20070718/project_build_arm_nofpu/uclibc/bus >ybox-1.6.1 install >make[1]: Entering directory >`/usr/local/src/hd2/buildroot-20070718/project_build_arm_nofpu/uclibc/bu >sybox-1.6.1' > HOSTCC scripts/basic/split-include >scripts/basic/.split-include.d: done. > HOSTCC scripts/basic/docproc >scripts/basic/.docproc.d: done. > SPLIT include/autoconf.h -> include/config/* > GEN include/bbconfigopts.h >applets/.applets.o.cmd:410: *** multiple target patterns. Stop. Please paste lines 409-411 (take care not to word-wrap it). Just to be sure, untar the busybox into a separate dir, then 'make defconfig && make'. I expect this to happen there too.. thanks, From rep.dot.nop at gmail.com Fri Jul 27 18:05:40 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Fri, 27 Jul 2007 20:05:40 +0200 Subject: "multiple target patterns" error while building under cygwin In-Reply-To: References: <000501c7cd42$2a1b0d20$dcc4af0a@atmel.com> <20070727162707.GH25147@aon.at> Message-ID: <20070727180540.GD11697@aon.at> On Fri, Jul 27, 2007 at 01:04:00PM -0400, Crane, Matthew wrote: >Hi, > >Thanks for your response. I think my build error is the result of the >dos2unix + unix2dos patch. My cygwin system was installed with Unix >text mode, and I've tried to explicitly set the locale, but fixdep >always seems to output the Dos text. > >I instead used the dos2unix/unix2dos patch to fix the fixdep output, >which I think ending up causing the error below. Not sure how though, >or how to fix it. Thanks, > >Matt > > >.applets.o.cmd looks like this: > >cmd_applets/applets.o := > >deps_applets/applets.o := \ > applets/applets.c \ > $(wildcard include/config/static.h) \ > $(wildcard include/config/show/usage.h) \ > > >line 410: applets/applets.o: $(deps_applets/applets.o) > >$(deps_applets/applets.o): > > >I had already patched the make process so that it runs fixdep through >unix2dos, dos2unix similar to this patch I found online: > >define rule_cc_o_c > $(call echo-cmd,checksrc) $(cmd_checksrc) \ > $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \ >+ dos2unix $(depfile); \ > $(cmd_modversions) \ >- scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \ > >+ scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' | >unix2dos > \ > $(dot-target).tmp; \ > rm -f $(depfile); \ > mv -f $(dot-target).tmp $(dot-target).cmd > >It proceeded to build, but failed with the above error. Maybe related, >not sure. I'm looking forward to the day when cygwin support is >completely transparent in buildroot, soon I'm sure. This doesn't really sounds like a buildroot issue to me but rather a busybox issue, fwiw. Perhaps somebody else is aware of what's going on with busybox on cygwin. From kbc_hyper at hotmail.com Fri Jul 27 22:14:11 2007 From: kbc_hyper at hotmail.com (Choi Jason) Date: Fri, 27 Jul 2007 17:14:11 -0500 Subject: need some help to setup nslookup In-Reply-To: <1158166a0707270524k4e460192md98b53a049d6bb9a@mail.gmail.com> Message-ID: You're right. And I checked return value of getaddrinfo(), it was EAI_NONAME. But I still don't know clue. :( Thanks Jason, >From: "Denis Vlasenko" >To: "Choi Jason" >CC: busybox at busybox.net >Subject: Re: need some help to setup nslookup >Date: Fri, 27 Jul 2007 13:24:48 +0100 > >On 7/25/07, Choi Jason wrote: > > Hello All, > > > > I think I need your help at this time. :) > > Now, I tried to use nslookup on my target system. > > When I compiled busybox, I just turned on Networking Utilities -> nslookup. > > And I install this busybox to my target. > > And I create /etc/resolv.conf. > > Contents of /etc/resolv.conf is as followings > > ---------------- > > search abc.net > > nameserver 4.2.2.1 > > ---------------- > > And I create /etc/hosts as followings > > ---------------- > > 127.0.0.1 localhost > > 192.168.6.77 abc.site abc > > 209.131.36.158 www.yahoo.com > > ---------------- > > > > When I tried "nslookup www.google.com", following message is displayed. > > ---------------- > > # nslookup www.google.com > > Server : 4.2.2.1 > > Address 1: 4.2.2.1 > > > > nslookup: can't resolve 'www.google.com' > > ---------------- > > And when I tried "nslookup www.yahoo.com", following message is displayed. > > ---------------- > > #nslookup www.yshoo.com > > Server: 4.2.2.1 > > Address 1: 4.2.2.1 > > > > Name: www.yahoo.com > > Address 1: 209.131.36.158 www.yahoo.com > >Enable CONFIG_VERBOSE_RESOLUTION_ERRORS=y, it will give a bit more info: > >$ ./busybox nslookup www.sdjhgfklsdjgf.com >Server: 172.26.128.68 >Address 1: 172.26.128.68 XXXXXXXXXXXXXXX > >nslookup: can't resolve 'www.sdjhgfklsdjgf.com': Name or service not known > ^^^^^^^^^^^^^^^^^^^^^^^^^ here > >-- >vda From kbc_hyper at hotmail.com Fri Jul 27 22:20:23 2007 From: kbc_hyper at hotmail.com (Choi Jason) Date: Fri, 27 Jul 2007 17:20:23 -0500 Subject: need some help to setup nslookup In-Reply-To: <200707251955.03030.vapier@gentoo.org> Message-ID: Thank you Routing Table on my target is, # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.5.0 * 255.255.255.0 U 0 0 0 eth0 127.0.0.0 * 255.0.0.0 U 0 0 0 lo default 192.168.5.1 0.0.0.0 UG 0 0 0 eth0 and my /etc/hosts is as followings, # cat hosts 127.0.0.1 localhost 192.168.5.60 hyper3.site hyper3 209.131.36.158 www.yahoo.com and my /etc/resolv.conf is as followings search abc.net nameserver 4.2.2.1 But I don't understand libc relate things, could you tell me more about this? Thanks in advance. :) Jason, >From: Mike Frysinger >To: busybox at busybox.net >CC: "Choi Jason" >Subject: Re: need some help to setup nslookup >Date: Wed, 25 Jul 2007 19:55:02 -0400 > >On Wednesday 25 July 2007, Choi Jason wrote: > > Now, I tried to use nslookup on my target system. > > When I compiled busybox, I just turned on Networking Utilities -> nslookup. > > And I install this busybox to my target. > >busybox contains no dns logic. all querying is done via the system libc >functions, so please consult the manual for whichever libc you're using to >find out how to properly configure /etc/resolv.conf, /etc/hosts, your routing >table, and network interfaces. > >in fact, i'd check the above list in the reverse order i specified to make >sure your system is setup properly. tldp.org has some pretty complete >howto's you could read. >-mike ><< signature.asc >> From dallas.a.clement at gmail.com Fri Jul 27 18:20:29 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Fri, 27 Jul 2007 13:20:29 -0500 Subject: reboot/poweroff/halt commands not working Message-ID: <1185560429.3596.3.camel@localhost> I'm using 1.6.1 and none of these commands seem to work all by themselves. If I provide the -f option, they all work just fine. I'm not sure if this is a regression problem or it has always been this way. I thought things were working properly in previous versions. I'm pretty sure I did not have to supply the -f option. From hamish at cloud.net.au Sat Jul 28 00:50:54 2007 From: hamish at cloud.net.au (Hamish Moffatt) Date: Sat, 28 Jul 2007 10:50:54 +1000 Subject: Monitor black after 10 Minutes In-Reply-To: <46A9FD8B.6090701@imc-berlin.de> References: <23914.1185541558@brightstareng.com> <46A9FD8B.6090701@imc-berlin.de> Message-ID: <20070728005054.GA14731@cloud.net.au> On Fri, Jul 27, 2007 at 04:13:31PM +0200, Steven Scholz wrote: > Paul Fox wrote: > > > As another post said - nothing to do with BusyBox. But it's the kernel > > > that's doing this. I compiled ncurses, then setterm from util-linux and > > > used the command 'setterm -blank 0'. This is the heavy handed way of > > > doing things. > > > > yes, that's a lot of work :-), since in the end all setterm does is > > emit the previously mentioned escape sequence. ( "ESC [ 9 ; 0 ]" ) > > > > TERM=linux setterm -blank 0 | hexdump -C > > But this all only works if I am actually working on this terminal!? > > I do have a frame buffer console (VT) with no keyboard, but use the serial > console. If "setterm -blank 0 | hexdump -C" works, then "setterm -blank 0 > /dev/tty0" should also work. Hamish -- Hamish Moffatt VK3SB From vapier at gentoo.org Sat Jul 28 05:12:55 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Sat, 28 Jul 2007 01:12:55 -0400 Subject: "multiple target patterns" error while building under cygwin In-Reply-To: <20070727180540.GD11697@aon.at> References: <000501c7cd42$2a1b0d20$dcc4af0a@atmel.com> <20070727180540.GD11697@aon.at> Message-ID: <200707280112.56857.vapier@gentoo.org> On Friday 27 July 2007, Bernhard Fischer wrote: > On Fri, Jul 27, 2007 at 01:04:00PM -0400, Crane, Matthew wrote: > >Hi, > > > >Thanks for your response. I think my build error is the result of the > >dos2unix + unix2dos patch. My cygwin system was installed with Unix > >text mode, and I've tried to explicitly set the locale, but fixdep > >always seems to output the Dos text. > > > >I instead used the dos2unix/unix2dos patch to fix the fixdep output, > >which I think ending up causing the error below. Not sure how though, > >or how to fix it. Thanks, > > > >Matt > > > > > >.applets.o.cmd looks like this: > > > >cmd_applets/applets.o := > > > >deps_applets/applets.o := \ > > applets/applets.c \ > > $(wildcard include/config/static.h) \ > > $(wildcard include/config/show/usage.h) \ > > > > > >line 410: applets/applets.o: $(deps_applets/applets.o) > > > >$(deps_applets/applets.o): > > > > > >I had already patched the make process so that it runs fixdep through > >unix2dos, dos2unix similar to this patch I found online: > > > >define rule_cc_o_c > > $(call echo-cmd,checksrc) $(cmd_checksrc) \ > > $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \ > >+ dos2unix $(depfile); \ > > $(cmd_modversions) \ > >- scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \ > > > >+ scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' | > >unix2dos > \ > > $(dot-target).tmp; \ > > rm -f $(depfile); \ > > mv -f $(dot-target).tmp $(dot-target).cmd > > > >It proceeded to build, but failed with the above error. Maybe related, > >not sure. I'm looking forward to the day when cygwin support is > >completely transparent in buildroot, soon I'm sure. > > This doesn't really sounds like a buildroot issue to me but rather a > busybox issue, fwiw. > > Perhaps somebody else is aware of what's going on with busybox on > cygwin. my guess is their make is too old to support | properly, we've hit this many times before -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://lists.busybox.net/pipermail/busybox/attachments/20070728/9d18421d/attachment-0002.pgp From wharms at bfs.de Sat Jul 28 09:14:31 2007 From: wharms at bfs.de (walter harms) Date: Sat, 28 Jul 2007 11:14:31 +0200 Subject: Monitor black after 10 Minutes In-Reply-To: <46A9FFB1.8060604@Kriegisch.name> References: <23914.1185541558@brightstareng.com> <46A9F362.7090702@bfs.de> <46A9FFB1.8060604@Kriegisch.name> Message-ID: <46AB08F7.9090809@bfs.de> Alexander Kriegisch wrote: >> To discover what more can be done use 'man console_code'. > > Maybe you mean 'man console_codes' (trailing 's')? > - mea culpa, i skip the trailing s by accident sorry if someone got confused, wh From dallas.a.clement at gmail.com Sat Jul 28 12:26:37 2007 From: dallas.a.clement at gmail.com (Dallas Clement) Date: Sat, 28 Jul 2007 07:26:37 -0500 Subject: How do I add a user to multiple groups? Message-ID: <1185625597.3367.4.camel@localhost> Hello All, I'd like to use the busybox 'adduser' command to add a user to multiple groups. Can anyone show me how to do this? This is an example of what I would like the group file to look like afterward: dallas at debian:~/fs-images/common/etc$ cat group root::0:root bin:x:1:root,bin,daemon daemon:x:2:root,bin,daemon sys:x:3:root,bin tty:*:4:root,tty sshd:x:33:sshd As you can see, the 'root' user is a member of multiple groups. It would be nice if I could do something like this, but it does not work: adduser -h /root -g "root user" -s /bin/ash -G 0 -G 1 -G 2 -G 3 -G 4 root Thanks, Dallas From farmatito at tiscali.it Sat Jul 28 21:27:33 2007 From: farmatito at tiscali.it (Tito) Date: Sat, 28 Jul 2007 23:27:33 +0200 Subject: How do I add a user to multiple groups? In-Reply-To: <1185625597.3367.4.camel@localhost> References: <1185625597.3367.4.camel@localhost> Message-ID: <200707282327.33710.farmatito@tiscali.it> On Saturday 28 July 2007 14:26:37 Dallas Clement wrote: > Hello All, > > I'd like to use the busybox 'adduser' command to add a user to multiple > groups. Can anyone show me how to do this? > > This is an example of what I would like the group file to look like > afterward: > > dallas at debian:~/fs-images/common/etc$ cat group > root::0:root > bin:x:1:root,bin,daemon > daemon:x:2:root,bin,daemon > sys:x:3:root,bin > tty:*:4:root,tty > sshd:x:33:sshd > > As you can see, the 'root' user is a member of multiple groups. > > It would be nice if I could do something like this, but it does not > work: > >adduser -h /root -g "root user" -s /bin/ash -G 0 -G 1 -G 2 -G 3 -G 4 root Hi, something like this should do the trick: adduser -h /root -g "root user" -s /bin/ash root addgroup root root <- this is probably not needed as it is the user's default group addgroup root bin addgroup root daemon addgroup root sys addgroup root tty Ciao, Tito > > Thanks, > Dallas From pclouds at gmail.com Sat Jul 28 21:55:40 2007 From: pclouds at gmail.com (Nguyen Thai Ngoc Duy) Date: Sat, 28 Jul 2007 17:55:40 -0400 Subject: potential bug in ash Message-ID: Hi Here is an excerpt from ash.c: if (pathopt) { /* this is a %func directory */ stalloc(strlen(fullname) + 1); readcmdfile(fullname); cmdp = cmdlookup(name, 0); if (cmdp == NULL || cmdp->cmdtype != CMDFUNCTION) ash_msg_and_raise_error("%s not defined in %s", name, fullname); stunalloc(fullname); goto success; } gmail may corrupt the code but you can find the code in function find_command(). fullname is not updated after stalloc(). It is perfectly fine now because there isn't any stalloc inside the while loop. But if in future you decide to allocate some blocks before that excerpt, the return value from stalloc(strlen(fullname) + 1) may no longer be fullname and then stunalloc(fullname) will blindly screw up the stack. I encountered this problem when trying to (don't blame me) port ash to Windows. So the suggestion is replace stalloc() line with: fullname = stalloc(strlen(fullname) + 1); The safer the better. -- Duy From landau_alex at yahoo.com Sun Jul 29 07:41:04 2007 From: landau_alex at yahoo.com (Alex Landau) Date: Sun, 29 Jul 2007 00:41:04 -0700 (PDT) Subject: [PATCH] Fix start-stop-daemon on no-MMU In-Reply-To: <870780.98387.qm@web62513.mail.re1.yahoo.com> Message-ID: <813295.16381.qm@web62502.mail.re1.yahoo.com> --- Alex Landau wrote: > > --- Mike Frysinger wrote: > > > On Tuesday 24 July 2007, Alex Landau wrote: > > > You may also find some code duplications with the fork_and_reexec functions > > > (i.e. call to setsid, dupping /dev/null to 0,1 and 2), > > > > there is a bb sanitize io function which could alleviate some of this isnt > > there ? > > -mike > > > > No that won't work. bb_sanitize_stdio() goes over descriptors 0,1,2 and if any is > closed, > connects it to /dev/null. I want to force them to be /dev/null. > Second, the dups and setsid are combined with the re-execing, while in the > start-stop-daemon case the child should continue and do some stuff before execing. > And last, either I don't understand something, or the bb_daemonize_or_rexec() function > that bb_sanitize_stdio() uses is broken: DAEMON_DEVNULL_STDIO is defined as 0, so we > never close 0,1,2 (unless we're also re-execing) and that "if" is dead code. > > Alex > Are there any other problems with this patch? Alex ____________________________________________________________________________________ Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out. http://answers.yahoo.com/dir/?link=list&sid=396545469 From sync.jma at gmail.com Sun Jul 29 12:03:07 2007 From: sync.jma at gmail.com (Sync ma) Date: Sun, 29 Jul 2007 20:03:07 +0800 Subject: busybox-1.6.1 Clear screen Message-ID: Hi, all: I have problems on clearing the screen, when I type CTRL+L, there were actually no effect. I have serached the site:www.busybox.net, and there seems nothing useful. I missed anything? My .config file has turned on all the console-utils options: 250 # Console Utilities 251 # 252 CONFIG_CHVT=y 253 CONFIG_CLEAR=y 254 CONFIG_DEALLOCVT=y 255 CONFIG_DUMPKMAP=y 256 CONFIG_LOADFONT=y 257 CONFIG_LOADKMAP=y 258 CONFIG_OPENVT=y 259 CONFIG_RESET=y 260 CONFIG_RESIZE=y 261 CONFIG_FEATURE_RESIZE_PRINT=y 262 CONFIG_SETCONSOLE=y 263 CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS=y 264 CONFIG_SETKEYCODES=y 265 CONFIG_SETLOGCONS=y I have add a test 'printf' in clear.c and it still has no output. 16 int clear_main(int argc, char **argv) 17 { 18 printf("---------------------\n"); 19 >___return printf("\033[H\033[J") != 6; 20 } My console tools is SecureCRT-5.22. toolchain verison: binutils-2.16.1 gcc-4.1.2 uClibc-0.9.28.2 Thanks. Jun From vda.linux at googlemail.com Sun Jul 29 13:42:37 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 29 Jul 2007 14:42:37 +0100 Subject: need some help to setup nslookup In-Reply-To: References: <200707251955.03030.vapier@gentoo.org> Message-ID: <1158166a0707290642t219aa205n433b14f2d0d608f2@mail.gmail.com> On 7/27/07, Choi Jason wrote: > Thank you > > Routing Table on my target is, > > # route > Kernel IP routing table > Destination Gateway Genmask Flags Metric Ref Use > Iface > 192.168.5.0 * 255.255.255.0 U 0 0 0 > eth0 > 127.0.0.0 * 255.0.0.0 U 0 0 0 lo > default 192.168.5.1 0.0.0.0 UG 0 0 0 > eth0 > > and my /etc/hosts is as followings, > # cat hosts > > 127.0.0.1 localhost > 192.168.5.60 hyper3.site hyper3 > 209.131.36.158 www.yahoo.com > > and my /etc/resolv.conf is as followings > search abc.net > nameserver 4.2.2.1 > > But I don't understand libc relate things, could you tell > me more about this? > Thanks in advance. :) You can see how your target talks with DNS server, Example from my box: # tcpdump -nlieth0 -s0 -vvv port 53 and host 172.26.128.68 tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes My box asks DNS: 14:35:33.185908 IP (tos 0x0, ttl 64, id 56103, offset 0, flags [DF], proto: UDP (17), length: 66) 172.28.3.151.33502 > 172.26.128.68.53: [bad udp cksum 72c5!] 15029+ A? www.sdjhgfklsdjg.com. (38) DNS answers: 14:35:33.186167 IP (tos 0x0, ttl 63, id 31911, offset 0, flags [DF], proto: UDP (17), length: 139) 172.26.128.68.53 > 172.28.3.151.33502: [udp sum ok] 15029 NXDomain q: A? www.sdjhgfklsdjg.com. 0/1/0 ns: com. SOA a.gtld-servers.net. nstld.verisign-grs.com. 1185716104 1800 900 604800 900 (111) If you see similar things, then the problem is not in your box's config. DNS server just can't resolve names. If you don't see answers at all, you talk to wrong/nonexistent DNS server. If you don't see _questions_, you have routing/firewall problem on your box. -- vda From vda.linux at googlemail.com Sun Jul 29 13:56:09 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 29 Jul 2007 14:56:09 +0100 Subject: potential bug in ash In-Reply-To: References: Message-ID: <1158166a0707290656y1e73c001t81d4a1c9e709da59@mail.gmail.com> On 7/28/07, Nguyen Thai Ngoc Duy wrote: > Hi > > Here is an excerpt from ash.c: > if (pathopt) { /* this is a %func directory */ > stalloc(strlen(fullname) + 1); > readcmdfile(fullname); > cmdp = cmdlookup(name, 0); > if (cmdp == NULL || cmdp->cmdtype != CMDFUNCTION) > ash_msg_and_raise_error("%s not defined in %s", name, fullname); > stunalloc(fullname); > goto success; > } > > gmail may corrupt the code but you can find the code in function find_command(). > > fullname is not updated after stalloc(). It is perfectly fine now > because there isn't any stalloc inside the while loop. But if in > future you decide to allocate some blocks before that excerpt, the > return value from stalloc(strlen(fullname) + 1) may no longer be > fullname and then stunalloc(fullname) will blindly screw up the stack. Whee, somebody who can read ash.c! :) That stalloc you talk about is highly non-obvious, but it's not the only grey code there. Code seems to have more uses of fullname after stunalloc(fullname): stunalloc(fullname); ... if (fullname[0] == '/' && idx <= prev) { ... while (stat(fullname, &statb) < 0) { Which is technically valid (I think) as long as you don't stalloc something. I will add big comment for now. -- vda From vda.linux at googlemail.com Sun Jul 29 13:59:34 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 29 Jul 2007 14:59:34 +0100 Subject: busybox-1.6.1 Clear screen In-Reply-To: References: Message-ID: <1158166a0707290659l6f8e1b72rff70872d638bfd72@mail.gmail.com> On 7/29/07, Sync ma wrote: > Hi, all: > I have problems on clearing the screen, when I type CTRL+L, there > were actually no effect. > I have serached the site:www.busybox.net, and there seems nothing > useful. I missed anything? Try to run this: $ strace -o zz ./busybox clear On my box in zz I see this: execve("./busybox", ["./busybox", "clear"], [/* 53 vars */]) = 0 ... fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 3), ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0xffffce7c) = 0xf7ffa000 write(1, "\33[H\33[J", 6) = 6 munmap(0xf7ffa000, 4096) = 0 exit_group(0) = ? What do you see? -- vda From vda.linux at googlemail.com Sun Jul 29 14:02:41 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 29 Jul 2007 15:02:41 +0100 Subject: [PATCH] Fix start-stop-daemon on no-MMU In-Reply-To: <813295.16381.qm@web62502.mail.re1.yahoo.com> References: <870780.98387.qm@web62513.mail.re1.yahoo.com> <813295.16381.qm@web62502.mail.re1.yahoo.com> Message-ID: <1158166a0707290702v5b31fb91q49a1b3b5405a7e6b@mail.gmail.com> On 7/29/07, Alex Landau wrote: > Are there any other problems with this patch? Sorry, the biggest problem currently is that I have limited access to email. Expect a bit of lag... -- vda From vda.linux at googlemail.com Sun Jul 29 14:07:04 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Sun, 29 Jul 2007 15:07:04 +0100 Subject: reboot/poweroff/halt commands not working In-Reply-To: <1185560429.3596.3.camel@localhost> References: <1185560429.3596.3.camel@localhost> Message-ID: <1158166a0707290707l2deee8d1ra5c73eef7938ef9b@mail.gmail.com> On 7/27/07, Dallas Clement wrote: > I'm using 1.6.1 and none of these commands seem to work all by > themselves. If I provide the -f option, they all work just fine. I'm > not sure if this is a regression problem or it has always been this way. > > I thought things were working properly in previous versions. I'm pretty > sure I did not have to supply the -f option. Did 1.6.0 work? If not, did 1.5.1 work? -- vda From farmatito at tiscali.it Sun Jul 29 14:27:23 2007 From: farmatito at tiscali.it (Tito) Date: Sun, 29 Jul 2007 16:27:23 +0200 Subject: [PATCH] fix addgroup command line parsing Message-ID: <200707291627.23821.farmatito@tiscali.it> Hi, addgroup actually does: addgroup group addgroup -g num group addgroup user group so: addgroup -g num user group should not be permitted. This patch fixes the problem for me. diff -uN loginutils/addgroup.c.orig loginutils/addgroup.c --- loginutils/addgroup.c.orig 2007-05-30 14:41:30.000000000 +0200 +++ loginutils/addgroup.c 2007-07-29 16:22:50.000000000 +0200 @@ -148,6 +148,10 @@ if (argc == 2) { struct group *gr; + /* There was -g on the commandline: error out */ + if (gid) + bb_show_usage(); + /* check if group and user exist */ xuname2uid(argv[0]); /* unknown user: exit */ xgroup2gid(argv[1]); /* unknown group: exit */ Only little tested. Please apply if you like it. Ciao, Tito From wharms at bfs.de Sun Jul 29 15:13:52 2007 From: wharms at bfs.de (walter harms) Date: Sun, 29 Jul 2007 17:13:52 +0200 Subject: busybox-1.6.1 Clear screen In-Reply-To: References: Message-ID: <46ACAEB0.50603@bfs.de> clear screen is a command send to your terminal (see man console_codes for more codes that the Linux console knows about) It is possible that your terminal does not understand the sequence you send. please check your console type. re, wh Sync ma wrote: > Hi, all: > I have problems on clearing the screen, when I type CTRL+L, there > were actually no effect. > I have serached the site:www.busybox.net, and there seems nothing > useful. I missed anything? > > My .config file has turned on all the console-utils options: > > 250 # Console Utilities > 251 # > 252 CONFIG_CHVT=y > 253 CONFIG_CLEAR=y > 254 CONFIG_DEALLOCVT=y > 255 CONFIG_DUMPKMAP=y > 256 CONFIG_LOADFONT=y > 257 CONFIG_LOADKMAP=y > 258 CONFIG_OPENVT=y > 259 CONFIG_RESET=y > 260 CONFIG_RESIZE=y > 261 CONFIG_FEATURE_RESIZE_PRINT=y > 262 CONFIG_SETCONSOLE=y > 263 CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS=y > 264 CONFIG_SETKEYCODES=y > 265 CONFIG_SETLOGCONS=y > > I have add a test 'printf' in clear.c and it still has no output. > > 16 int clear_main(int argc, char **argv) > 17 { > 18 printf("---------------------\n"); > 19 >___return printf("\033[H\033[J") != 6; > 20 } > > My console tools is SecureCRT-5.22. > > toolchain verison: > binutils-2.16.1 > gcc-4.1.2 > uClibc-0.9.28.2 > > > > Thanks. > > > Jun > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From farmatito at tiscali.it Sun Jul 29 22:11:18 2007 From: farmatito at tiscali.it (Tito) Date: Mon, 30 Jul 2007 00:11:18 +0200 Subject: [PATCH] fix addgroup command line parsing -- now RFC In-Reply-To: <200707291627.23821.farmatito@tiscali.it> References: <200707291627.23821.farmatito@tiscali.it> Message-ID: <200707300011.18932.farmatito@tiscali.it> On Sunday 29 July 2007 16:27:23 Tito wrote: > Hi, > > addgroup actually does: > > addgroup group > addgroup -g num group > addgroup user group > > so: > > addgroup -g num user group > > should not be permitted. > This patch fixes the problem for me. > > diff -uN loginutils/addgroup.c.orig loginutils/addgroup.c > --- loginutils/addgroup.c.orig 2007-05-30 14:41:30.000000000 +0200 > +++ loginutils/addgroup.c 2007-07-29 16:22:50.000000000 +0200 > @@ -148,6 +148,10 @@ > if (argc == 2) { > struct group *gr; > > + /* There was -g on the commandline: error out */ > + if (gid) > + bb_show_usage(); > + > /* check if group and user exist */ > xuname2uid(argv[0]); /* unknown user: exit */ > xgroup2gid(argv[1]); /* unknown group: exit */ > > > Only little tested. > Please apply if you like it. > > Ciao, > Tito > > BTW: as gid_t gid = 0 has a special meaning as flag in addgroup.c (in the xgroup_study function) maybe we should change: gid = xatoul_range(group, 0, (gid_t)ULONG_MAX); to gid = xatoul_range(group, 1, (gid_t)ULONG_MAX); so that -g 0 is forbidden. OTOH setting the default value gid_t gid = -1 could also do the trick, but needs some minor changes in the code. In this case -g 0 would be a legal option. Hints? Ciao, Tito From sync.jma at gmail.com Mon Jul 30 00:15:01 2007 From: sync.jma at gmail.com (Jun) Date: Mon, 30 Jul 2007 08:15:01 +0800 Subject: busybox-1.6.1 Clear screen In-Reply-To: <1158166a0707290659l6f8e1b72rff70872d638bfd72@mail.gmail.com> References: <1158166a0707290659l6f8e1b72rff70872d638bfd72@mail.gmail.com> Message-ID: ./busybox clear works, it clears the screen indeed. seems CTRL+L have not been sent to busybox. here is my strace output: 1 execve("./busybox", ["./busybox", "clear"], [/* 8 vars */]) = 0 2 svr4_syscall() = -1 ERRNO_4090 (Unknown error 4090) 3 stat("/etc/ld.so.cache", 0x7fff7b18) = -1 ENOENT (No such file or directory) 4 open("/lib/libgcc_s.so.1", O_RDONLY) = 3 5 fstat(3, {st_mode=S_IFREG|0644, st_size=69796, ...}) = 0 6 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaae000 7 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\260\31"..., 4096) = 4096 8 old_mmap(NULL, 323584, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaed000 9 old_mmap(0x2aaed000, 58700, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2aaed000 10 old_mmap(0x2ab3b000, 3464, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xe000) = 0x2ab3b000 11 close(3) = 0 12 munmap(0x2aaae000, 4096) = 0 13 open("/lib/libc.so.0", O_RDONLY) = 3 14 fstat(3, {st_mode=S_IFREG|0644, st_size=430060, ...}) = 0 15 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaae000 16 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\260\272"..., 4096) = 4096 17 old_mmap(NULL, 667648, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab3c000 18 old_mmap(0x2ab3c000, 381332, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2ab3c000 19 old_mmap(0x2abd9000, 5000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x5d000) = 0x2abd9000 20 old_mmap(0x2abdb000, 16168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2abdb000 21 close(3) = 0 22 munmap(0x2aaae000, 4096) = 0 23 open("/lib/libc.so.0", O_RDONLY) = 3 24 fstat(3, {st_mode=S_IFREG|0644, st_size=430060, ...}) = 0 25 close(3) = 0 26 ioctl(0, TIOCNXCL, {B115200 opost isig icanon echo ...}) = 0 27 ioctl(1, TIOCNXCL, {B115200 opost isig icanon echo ...}) = 0 28 write(1, "---------------------\n", 22) = 22 29 write(1, "\33[H\33[J", 6) = 6 30 exit(0) = ? 2007/7/29, Denis Vlasenko : > On 7/29/07, Sync ma wrote: > > Hi, all: > > I have problems on clearing the screen, when I type CTRL+L, there > > were actually no effect. > > I have serached the site:www.busybox.net, and there seems nothing > > useful. I missed anything? > > Try to run this: > > $ strace -o zz ./busybox clear > > On my box in zz I see this: > > execve("./busybox", ["./busybox", "clear"], [/* 53 vars */]) = 0 > ... > fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 3), ...}) = 0 > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, > 0xffffce7c) = 0xf7ffa000 > write(1, "\33[H\33[J", 6) = 6 > munmap(0xf7ffa000, 4096) = 0 > exit_group(0) = ? > > What do you see? > -- > vda > -- I want to be an expert. I want to be a professional. From sync.jma at gmail.com Mon Jul 30 00:29:14 2007 From: sync.jma at gmail.com (Jun) Date: Mon, 30 Jul 2007 08:29:14 +0800 Subject: busybox-1.6.1 Clear screen In-Reply-To: <46ACAEB0.50603@bfs.de> References: <46ACAEB0.50603@bfs.de> Message-ID: My terminal(SecureCRT 5.2.2) type has been set to Xterm(with ANSI color on), it works on RHEL5 and CentOS 4.x. I have read the man page and maybe I have not enough time to research in details. I'll do this when free. there also no useful hints on google for this situation, If anybody meets the same problem and solve that, please share your work. Thanks a lot. 2007/7/29, walter harms : > clear screen is a command send to your terminal > (see man console_codes for more codes that the Linux console knows about) > It is possible that your terminal does not understand the sequence you send. > please check your console type. > > re, > wh > > > > > Sync ma wrote: > > Hi, all: > > I have problems on clearing the screen, when I type CTRL+L, there > > were actually no effect. > > I have serached the site:www.busybox.net, and there seems nothing > > useful. I missed anything? > > > > My .config file has turned on all the console-utils options: > > > > 250 # Console Utilities > > 251 # > > 252 CONFIG_CHVT=y > > 253 CONFIG_CLEAR=y > > 254 CONFIG_DEALLOCVT=y > > 255 CONFIG_DUMPKMAP=y > > 256 CONFIG_LOADFONT=y > > 257 CONFIG_LOADKMAP=y > > 258 CONFIG_OPENVT=y > > 259 CONFIG_RESET=y > > 260 CONFIG_RESIZE=y > > 261 CONFIG_FEATURE_RESIZE_PRINT=y > > 262 CONFIG_SETCONSOLE=y > > 263 CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS=y > > 264 CONFIG_SETKEYCODES=y > > 265 CONFIG_SETLOGCONS=y > > > > I have add a test 'printf' in clear.c and it still has no output. > > > > 16 int clear_main(int argc, char **argv) > > 17 { > > 18 printf("---------------------\n"); > > 19 >___return printf("\033[H\033[J") != 6; > > 20 } > > > > My console tools is SecureCRT-5.22. > > > > toolchain verison: > > binutils-2.16.1 > > gcc-4.1.2 > > uClibc-0.9.28.2 > > > > > > > > Thanks. > > > > > > Jun > > _______________________________________________ > > busybox mailing list > > busybox at busybox.net > > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > > > > > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > -- I want to be an expert. I want to be a professional. From gregorigolo2002 at yahoo.fr Mon Jul 30 08:28:34 2007 From: gregorigolo2002 at yahoo.fr (grego rigolo) Date: Mon, 30 Jul 2007 08:28:34 +0000 (GMT) Subject: ifconfig, mount : need to press ENTER to get the prompt Message-ID: <617109.27479.qm@web23415.mail.ird.yahoo.com> Hello, I'd like to understand why i need to press ENTER to get the prompt when for example i issue the following command: ifconfig eth0 192.168.1.10 # ifconfig eth0 192.168.1.100 eth0: link down # eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1 Here is my inittab configuration: ##################################################### # /etc/inittab # # Copyright (C) 2001 Erik Andersen # # Note: BusyBox init doesn't support runlevels. The runlevels field is # completely ignored by BusyBox init. If you want runlevels, use # sysvinit. # # Format for each entry: ::: # # id == tty to run on, or empty for /dev/console # runlevels == ignored # action == one of sysinit, respawn, askfirst, wait, and once # process == program to run # Startup the system null::sysinit:/bin/mount -o remount,rw / null::sysinit:/bin/mount -t proc proc /proc null::sysinit:/bin/mount -a null::sysinit:/bin/hostname -F /etc/hostname null::sysinit:/sbin/ifconfig lo 127.0.0.1 up null::sysinit:/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo # now run any rc scripts ::sysinit:/etc/init.d/rcS # Set up a couple of getty's #tty1::respawn:/sbin/getty 38400 tty1 #tty2::respawn:/sbin/getty 38400 tty2 # Put a getty on the serial port ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 # Logging junk null::sysinit:/bin/touch /var/log/messages null::respawn:/sbin/syslogd -n -m 0 null::respawn:/sbin/klogd -n tty3::respawn:/usr/bin/tail -f /var/log/messages # Stuff to do for the 3-finger salute ::ctrlaltdel:/sbin/reboot # Stuff to do before rebooting null::shutdown:/usr/bin/killall klogd null::shutdown:/usr/bin/killall syslogd null::shutdown:/bin/umount -a -r null::shutdown:/sbin/swapoff -a ##################################################### thanks in advance greg _____________________________________________________________________________ Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.busybox.net/pipermail/busybox/attachments/20070730/4735323b/attachment-0001.htm From vapier at gentoo.org Mon Jul 30 10:21:11 2007 From: vapier at gentoo.org (Mike Frysinger) Date: Mon, 30 Jul 2007 06:21:11 -0400 Subject: ifconfig, mount : need to press ENTER to get the prompt In-Reply-To: <617109.27479.qm@web23415.mail.ird.yahoo.com> References: <617109.27479.qm@web23415.mail.ird.yahoo.com> Message-ID: <200707300621.12354.vapier@gentoo.org> On Monday 30 July 2007, grego rigolo wrote: > I'd like to understand why i need to press ENTER to get the prompt when for > example i issue the following command: ifconfig eth0 192.168.1.10 > > > # ifconfig eth0 192.168.1.100 > eth0: link down > # eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1 not a busybox issue, nor do you need to press enter ... those messages are coming from the kernel. if you dont want to see them, then change the console log level via `dmesg -n` or read about the loglevel= kernel parameter in the kernel Documentation/. -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://lists.busybox.net/pipermail/busybox/attachments/20070730/53dd5d4b/attachment-0002.pgp From vda.linux at googlemail.com Mon Jul 30 12:24:02 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Mon, 30 Jul 2007 13:24:02 +0100 Subject: [PATCH] fix addgroup command line parsing -- now RFC In-Reply-To: <200707300011.18932.farmatito@tiscali.it> References: <200707291627.23821.farmatito@tiscali.it> <200707300011.18932.farmatito@tiscali.it> Message-ID: <1158166a0707300524i173980d7o78a7c2eec7e7eb@mail.gmail.com> On 7/29/07, Tito wrote: > On Sunday 29 July 2007 16:27:23 Tito wrote: > > Hi, > > > > addgroup actually does: > > > > addgroup group > > addgroup -g num group > > addgroup user group > > > > so: > > > > addgroup -g num user group > > > > should not be permitted. > > This patch fixes the problem for me. > > > > diff -uN loginutils/addgroup.c.orig loginutils/addgroup.c > > --- loginutils/addgroup.c.orig 2007-05-30 14:41:30.000000000 +0200 > > +++ loginutils/addgroup.c 2007-07-29 16:22:50.000000000 +0200 > > @@ -148,6 +148,10 @@ > > if (argc == 2) { > > struct group *gr; > > > > + /* There was -g on the commandline: error out */ > > + if (gid) > > + bb_show_usage(); > > + > > /* check if group and user exist */ > > xuname2uid(argv[0]); /* unknown user: exit */ > > xgroup2gid(argv[1]); /* unknown group: exit */ > > > > > > Only little tested. > > Please apply if you like it. > > > > Ciao, > > Tito > > > > > > BTW: > > as gid_t gid = 0 has a special meaning as flag in addgroup.c > (in the xgroup_study function) maybe we should change: > > gid = xatoul_range(group, 0, (gid_t)ULONG_MAX); > to > gid = xatoul_range(group, 1, (gid_t)ULONG_MAX); > > so that -g 0 is forbidden. Which is wrong. gid 0 is technically valid gid. (gid_t)ULONG_MAX is also wrong, as it results in gid -1. > OTOH setting the default value gid_t gid = -1 > could also do the trick, but needs some minor > changes in the code. In this case -g 0 would be > a legal option. Hints? Checking for gid being !0 is silly. You can check whether -g option actually was there, or not. I committed some fixes to svn, including your fix and fix which (hopefully) makes -g 0 work correctly. -- vda From emiliano.lopez at gmail.com Mon Jul 30 15:54:56 2007 From: emiliano.lopez at gmail.com (Emiliano Lopez) Date: Mon, 30 Jul 2007 12:54:56 -0300 Subject: readhead.c error Message-ID: <50f131690707300854g2736d3a4n5daee650a0f2165d@mail.gmail.com> Hi, I am trying to compile busybox 1.4.1 using buildroot as a toolchain. I did make defconfig and then make. After a few minutes of busybox compilation the following error occur: CC miscutils/readahead.o cc1: warnings being treated as errors miscutils/readahead.c: In function 'readahead_main': miscutils/readahead.c:26: warning: implicit declaration of function 'readahead' make[1]: *** [miscutils/readahead.o] Error 1 make: *** [miscutils] Error 2 I don't know how to solve it, Could anyone help me, please? Thanks Emiliano (Santa Fe - Argentina) From wharms at bfs.de Mon Jul 30 19:06:34 2007 From: wharms at bfs.de (walter harms) Date: Mon, 30 Jul 2007 21:06:34 +0200 Subject: readhead.c error In-Reply-To: <50f131690707300854g2736d3a4n5daee650a0f2165d@mail.gmail.com> References: <50f131690707300854g2736d3a4n5daee650a0f2165d@mail.gmail.com> Message-ID: <46AE36BA.30301@bfs.de> hi Emiliano, this is known bug. see man 2 readahead it depends on LFS. please try a newer version of BB or disable readahead. re, wh Emiliano Lopez wrote: > Hi, I am trying to compile busybox 1.4.1 using buildroot as a toolchain. > I did make defconfig and then make. > After a few minutes of busybox compilation the following error occur: > > CC miscutils/readahead.o > cc1: warnings being treated as errors > miscutils/readahead.c: In function 'readahead_main': > miscutils/readahead.c:26: warning: implicit declaration of function 'readahead' > make[1]: *** [miscutils/readahead.o] Error 1 > make: *** [miscutils] Error 2 > > I don't know how to solve it, Could anyone help me, please? > Thanks > > Emiliano (Santa Fe - Argentina) > _______________________________________________ > busybox mailing list > busybox at busybox.net > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > From emiliano.lopez at gmail.com Mon Jul 30 19:41:32 2007 From: emiliano.lopez at gmail.com (Emiliano Lopez) Date: Mon, 30 Jul 2007 16:41:32 -0300 Subject: readhead.c error In-Reply-To: <46AE36BA.30301@bfs.de> References: <50f131690707300854g2736d3a4n5daee650a0f2165d@mail.gmail.com> <46AE36BA.30301@bfs.de> Message-ID: <50f131690707301241t23ac7cd9u8fecf76c8d0a2232@mail.gmail.com> Hi Walter, I tried disable readhead and LFS (large file storage) but then a lot of errors occurs: miscutils/taskset.c:46 errir: cpu_set_t undeclared (...) CPU_SETSIZE indeclares mask undeclared ... I will try a newer version. Thank you very much. Emiliano.- (Santa Fe-Argentina) On 30/07/07, walter harms wrote: > hi Emiliano, > this is known bug. see man 2 readahead it depends on LFS. > please try a newer version of BB or disable readahead. > > re, > wh > > > > Emiliano Lopez wrote: > > Hi, I am trying to compile busybox 1.4.1 using buildroot as a toolchain. > > I did make defconfig and then make. > > After a few minutes of busybox compilation the following error occur: > > > > CC miscutils/readahead.o > > cc1: warnings being treated as errors > > miscutils/readahead.c: In function 'readahead_main': > > miscutils/readahead.c:26: warning: implicit declaration of function 'readahead' > > make[1]: *** [miscutils/readahead.o] Error 1 > > make: *** [miscutils] Error 2 > > > > I don't know how to solve it, Could anyone help me, please? > > Thanks > > > > Emiliano (Santa Fe - Argentina) > > _______________________________________________ > > busybox mailing list > > busybox at busybox.net > > http://busybox.net/cgi-bin/mailman/listinfo/busybox > > > > > > > From rep.dot.nop at gmail.com Mon Jul 30 19:51:56 2007 From: rep.dot.nop at gmail.com (Bernhard Fischer) Date: Mon, 30 Jul 2007 21:51:56 +0200 Subject: readhead.c error In-Reply-To: <50f131690707301241t23ac7cd9u8fecf76c8d0a2232@mail.gmail.com> References: <50f131690707300854g2736d3a4n5daee650a0f2165d@mail.gmail.com> <46AE36BA.30301@bfs.de> <50f131690707301241t23ac7cd9u8fecf76c8d0a2232@mail.gmail.com> Message-ID: <20070730195155.GB29064@aon.at> On Mon, Jul 30, 2007 at 04:41:32PM -0300, Emiliano Lopez wrote: >Hi Walter, >I tried disable readhead and LFS (large file storage) but then a lot >of errors occurs: >miscutils/taskset.c:46 errir: cpu_set_t undeclared >(...) >CPU_SETSIZE indeclares >mask undeclared >... > >I will try a newer version. This sounds like you're attempting to use an old version of your libc. The current uClibc version is 0.9.29. As Walter already explained, you have to *enable* LFS (not disable it if i read you correctly). Updating to a current version of busybox may be a good idea too.. HTH, From steven.scholz at imc-berlin.de Tue Jul 31 08:05:26 2007 From: steven.scholz at imc-berlin.de (Steven Scholz) Date: Tue, 31 Jul 2007 10:05:26 +0200 Subject: Monitor black after 10 Minutes In-Reply-To: <20070728005054.GA14731@cloud.net.au> References: <23914.1185541558@brightstareng.com> <46A9FD8B.6090701@imc-berlin.de> <20070728005054.GA14731@cloud.net.au> Message-ID: <46AEED46.2090709@imc-berlin.de> >>> TERM=linux setterm -blank 0 | hexdump -C >> But this all only works if I am actually working on this terminal!? >> >> I do have a frame buffer console (VT) with no keyboard, but use the serial >> console. > > If "setterm -blank 0 | hexdump -C" works, then "setterm -blank 0 > > /dev/tty0" should also work. Of course! THANKS! Steven From vda.linux at googlemail.com Tue Jul 31 17:00:28 2007 From: vda.linux at googlemail.com (Denis Vlasenko) Date: Tue, 31 Jul 2007 18:00:28 +0100 Subject: [PATCH] Fix start-stop-daemon on no-MMU In-Reply-To: <1158166a0707290702v5b31fb91q49a1b3b5405a7e6b@mail.gmail.com> References: <870780.98387.qm@web62513.mail.re1.yahoo.com> <813295.16381.qm@web62502.mail.re1.yahoo.com> <1158166a0707290702v5b31fb91q49a1b3b5405a7e6b@mail.gmail.com> Message-ID: <1158166a0707311000w6a977564ncfd8c2f23e666594@mail.gmail.com> On 7/29/07, Denis Vlasenko wrote: > On 7/29/07, Alex Landau wrote: > > Are there any other problems with this patch? > > Sorry, the biggest problem currently is that I have > limited access to email. Expect a bit of lag... Applied with some other minor changes added, please check svn and yell if you see something bad. Thanks. -- vda From pclouds at gmail.com Tue Jul 31 19:30:45 2007 From: pclouds at gmail.com (Nguyen Thai Ngoc Duy) Date: Tue, 31 Jul 2007 15:30:45 -0400 Subject: editors/patch.c is broken Message-ID: src/dest file names are read by xmalloc_fgets which include trailing \n characters. Therefore patch either reads from wrong source file or write to wrong destination file. The attached patch should fix it. I'm not sure about the rest of xmalloc_fgets used in patch, though. -- Duy -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-patch-cannot-open-files-because-of-trailing-n.patch Type: text/x-patch Size: 1319 bytes Desc: not available Url : http://lists.busybox.net/pipermail/busybox/attachments/20070731/6fcc9adb/attachment-0002.bin