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 the