Gregory Fong | 3 Aug 23:25 2015
Picon

[PATCH] mdev: don't follow deprecated sysfs /sys/block symlinks

/sys/block will only be scanned with CONFIG_SYSFS_DEPRECATED=y and
deprecated sysfs enabled (using CONFIG_SYSFS_DEPRECATED_V2=y or the
related kernel boot param).  In that case, all of /sys/block/* will be
a real directory, so we don't need to follow symlinks.  Additionally,
following symlinks causes a bug for mtd in this case, e.g. several
people have been seeing that /dev/mtd0 was getting created by this
traversal as a block device.  Subsequent investigation revealed that
was caused by this pass following the /sys/block/mtdblock0/device
symlink and resulting in both
- /sys/block/mtdblock0/dev
- /sys/block/mtdblock0/device/dev
being used here, and the second results in that incorrect /dev/mtd0.
Change to not follow symlinks while traversing /sys/block to fix this.

Fixes BZ #6806.

Signed-off-by: Gregory Fong <gregory.0xf0 <at> gmail.com>
Cc: Denys Vlasenko <vda.linux <at> googlemail.com>
Cc: Simon Edlund <simon <at> edlund.nl>
---
 util-linux/mdev.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index ca4b915..af986a2 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
 <at>  <at>  -1063,22 +1063,27  <at>  <at>  int mdev_main(int argc UNUSED_PARAM, char **argv)

 		putenv((char*)"ACTION=add");
(Continue reading)

Ron Yorston | 3 Aug 14:47 2015
Picon

[PATCH 5/5] ash: fix error during recursive processing of here document

Save the value of the checkkwd flag to prevent it being clobbered
during recursion.

Based on commit ec2c84d from git://git.kernel.org/pub/scm/utils/dash/dash.git
by Herbert Xu.

function                                             old     new   delta
readtoken                                            190     203     +13
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 13/0)               Total: 13 bytes

Signed-off-by: Ron Yorston <rmy <at> pobox.com>
---
 shell/ash.c                               | 5 +++--
 shell/ash_test/ash-heredoc/heredoc2.right | 1 +
 shell/ash_test/ash-heredoc/heredoc2.tests | 9 +++++++++
 3 files changed, 13 insertions(+), 2 deletions(-)
 create mode 100644 shell/ash_test/ash-heredoc/heredoc2.right
 create mode 100755 shell/ash_test/ash-heredoc/heredoc2.tests

diff --git a/shell/ash.c b/shell/ash.c
index 7ba9a7f..db6fb8f 100644
--- a/shell/ash.c
+++ b/shell/ash.c
 <at>  <at>  -11896,6 +11896,7  <at>  <at>  static int
 readtoken(void)
 {
 	int t;
+	int kwd = checkkwd;
 #if DEBUG
(Continue reading)

Ron Yorston | 3 Aug 14:47 2015
Picon

[PATCH 4/5] ash: respect -p flag when command builtin is run with -v/-V

The command builtin should only check the default path, not $PATH,
when the -p flag is used along with -v/-V.

Based on commits 65ae84b (by Harald van Dijk) and 29ee27d (by Herbert
Xu) from git://git.kernel.org/pub/scm/utils/dash/dash.git).

function                                             old     new   delta
commandcmd                                            72      87     +15
describe_command                                     437     450     +13
typecmd                                               84      86      +2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 30/0)               Total: 30 bytes

Signed-off-by: Ron Yorston <rmy <at> pobox.com>
---
 shell/ash.c                           | 12 ++++++++----
 shell/ash_test/ash-misc/command.right |  1 +
 shell/ash_test/ash-misc/command.tests |  1 +
 3 files changed, 10 insertions(+), 4 deletions(-)
 create mode 100644 shell/ash_test/ash-misc/command.right
 create mode 100755 shell/ash_test/ash-misc/command.tests

diff --git a/shell/ash.c b/shell/ash.c
index ddcd28b..7ba9a7f 100644
--- a/shell/ash.c
+++ b/shell/ash.c
 <at>  <at>  -7812,14 +7812,15  <at>  <at>  findkwd(const char *s)
  * Locate and print what a word is...
  */
 static int
(Continue reading)

Ron Yorston | 3 Aug 14:46 2015
Picon

[PATCH 3/5] ash: fix command -- crash

busybox sh -c 'command --' segfaults because parse_command_args
returns a pointer to a null pointer.

Based on commit 18071c7 from git://git.kernel.org/pub/scm/utils/dash/dash.git
by Gerrit Pape.

function                                             old     new   delta
evalcommand                                         1368    1350     -18
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-18)             Total: -18 bytes

Signed-off-by: Ron Yorston <rmy <at> pobox.com>
---
 shell/ash.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/shell/ash.c b/shell/ash.c
index 7f3808b..ddcd28b 100644
--- a/shell/ash.c
+++ b/shell/ash.c
 <at>  <at>  -8885,8 +8885,8  <at>  <at>  parse_command_args(char **argv, const char **path)
 		if (!c)
 			break;
 		if (c == '-' && !*cp) {
-			argv++;
-			break;
+			if (!*++argv)
+				return 0;
 		}
 		do {
(Continue reading)

Ron Yorston | 3 Aug 14:46 2015
Picon

[PATCH 2/5] ash: save a few bytes in code to parse case statements

Based on commit 49b82fc from git://git.kernel.org/pub/scm/utils/dash/dash.git
by Herbert Xu.

function                                             old     new   delta
parse_command                                       1563    1555      -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-8)               Total: -8 bytes

Signed-off-by: Ron Yorston <rmy <at> pobox.com>
---
 shell/ash.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/shell/ash.c b/shell/ash.c
index 450a42f..7f3808b 100644
--- a/shell/ash.c
+++ b/shell/ash.c
 <at>  <at>  -10960,10 +10960,8  <at>  <at>  parse_command(void)
 		/*n2->narg.next = NULL; - stzalloc did it */
 		n2->narg.text = wordtext;
 		n2->narg.backquote = backquotelist;
-		do {
-			checkkwd = CHKKWD | CHKALIAS;
-		} while (readtoken() == TNL);
-		if (lasttoken != TIN)
+		checkkwd = CHKNL | CHKKWD | CHKALIAS;
+		if (readtoken() != TIN)
 			raise_error_unexpected_syntax(TIN);
 		cpp = &n1->ncase.cases;
  next_case:
(Continue reading)

Ron Yorston | 3 Aug 14:46 2015
Picon

[PATCH 1/5] ash: allow newline after variable name in for loop

Newline is a valid delimiter between the variable name and `in`
keyword in for loops.

Based on commit 22e8fb4 from git://git.kernel.org/pub/scm/utils/dash/dash.git
by Herbert Xu.

function                                             old     new   delta
parse_command                                       1568    1563      -5
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-5)               Total: -5 bytes

Signed-off-by: Ron Yorston <rmy <at> pobox.com>
---
 shell/ash.c                       | 4 ++--
 shell/ash_test/ash-misc/for.right | 1 +
 shell/ash_test/ash-misc/for.tests | 5 +++++
 3 files changed, 8 insertions(+), 2 deletions(-)
 create mode 100644 shell/ash_test/ash-misc/for.right
 create mode 100755 shell/ash_test/ash-misc/for.tests

diff --git a/shell/ash.c b/shell/ash.c
index f6190c3..450a42f 100644
--- a/shell/ash.c
+++ b/shell/ash.c
 <at>  <at>  -10914,7 +10914,7  <at>  <at>  parse_command(void)
 		n1 = stzalloc(sizeof(struct nfor));
 		n1->type = NFOR;
 		n1->nfor.var = wordtext;
-		checkkwd = CHKKWD | CHKALIAS;
+		checkkwd = CHKNL | CHKKWD | CHKALIAS;
(Continue reading)

Ron Yorston | 3 Aug 14:45 2015
Picon

[PATCH 0/5] Some more fixes to ash

This patch series harvests some more fixes from dash.  These are all
quite small:  the overall effect is an additional 12 bytes of bloat.

I've included tests where appropriate.

Ron
Ron Yorston | 31 Jul 18:33 2015
Picon

[PATCH] less: further tweaks to regular file detection

Test explicitly for REOPEN flags:  update_num_lines is called
unconditionally so (num_lines != NOT_REGULAR_FILE) is also true when
num_lines contains a valid number of lines.

The call to fstat doesn't need to be in #if ENABLE_FEATURE_LESS_FLAGS:
the whole function is already in such a test.

Signed-off-by: Ron Yorston <rmy <at> pobox.com>
---
 miscutils/less.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/miscutils/less.c b/miscutils/less.c
index be8d20e..7a441bf 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
 <at>  <at>  -615,11 +615,12  <at>  <at>  static int safe_lineno(int fline)
 static void update_num_lines(void)
 {
 	int count, fd;
+	struct stat stbuf;
 	ssize_t len, i;
 	char buf[4096];

 	/* only do this for regular files */
-	if (num_lines != NOT_REGULAR_FILE) {
+	if (num_lines == REOPEN_AND_COUNT || num_lines == REOPEN_STDIN) {
 		count = 0;
 		fd = open("/proc/self/fd/0", O_RDONLY);
 		if (fd < 0 && num_lines == REOPEN_AND_COUNT) {
(Continue reading)

Micha Nelissen | 30 Jul 13:05 2015

flash_islock applet

Hi all,

I have added a 'flash_islock' applet to query the lock status of a given 
mtd. It is integrated into flash_lock_unlock so that much of the code 
there is reused for this functionality.

See attached patch. Might be useful for someone else too.

Regards,

Micha Nelissen
_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Mike Frysinger | 30 Jul 05:33 2015
Picon

[PATCH] echo: make escape sequences depend on fancy mode

Currently when you disable fancy echo, escape sequences are hardcoded
enabled (e.g. as if you used `echo -e` all the time).  The opposite
behavior is more desirable (always disable -e support) because:
* This seems to contradict the spirit of the kconfig help text (where
  it says enable support for -n/-e flags), although you could say that
  we aren't supporting the -e flag directly as `echo -e` will show the
  -e flag.
* POSIX makes escape sequences optional, and even says they are there
  only on XSI-conformant systems.
* It saves space (~100 bytes on x86_64).
* It makes things faster!
* It makes it behave more like bash where you need an explicit -e flag
  in order for escape sequences to be interpreted.

Signed-off-by: Mike Frysinger <vapier <at> gentoo.org>
---
 coreutils/echo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/coreutils/echo.c b/coreutils/echo.c
index 9663894..1c41745 100644
--- a/coreutils/echo.c
+++ b/coreutils/echo.c
 <at>  <at>  -72,7 +72,7  <at>  <at>  int echo_main(int argc UNUSED_PARAM, char **argv)
 	unsigned buflen;
 #if !ENABLE_FEATURE_FANCY_ECHO
 	enum {
-		eflag = '\\',
+		eflag = 0,  /* 0 -- disable escape sequences */
 		nflag = 1,  /* 1 -- print '\n' */
(Continue reading)

Nguyen Xuan Hai | 28 Jul 09:33 2015

How to install new package to busybox without rebuilding

Hi,
I have a Linux OS with busybox. It is not support some basic commands, 
such as: make, apt-get, dpkg, ...
And I want to install some new packages without rebuilding OS.
What should I do?

Thanks and Best regards,
Hai Nguyen

--

-- 
This mail was scanned by BitDefender
For more information please visit http://www.bitdefender.com

Gmane