Ron Yorston | 18 Aug 15:00 2014
Picon

[PATCH 2/2] vi: fix reading of file after last line

If the :r command is used to read a file after the last line of the
buffer the last line of the buffer and the first line of the file
are joined.  An extra blank line appears at the end of the buffer.

   file 1
   file 1
   file 1file 2
   file 2
   file 2

	~
	~

The insertion point is normally at the start of the line following the
specified line.  When the specified line is the last one the next_line
function baulks at moving to the non-existent following line.

Signed-off-by: Ron Yorston <rmy <at> tigress.co.uk>
---
 editors/vi.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/editors/vi.c b/editors/vi.c
index 9f55af1..375135a 100644
--- a/editors/vi.c
+++ b/editors/vi.c
 <at>  <at>  -1323,8 +1323,12  <at>  <at>  static void colon(char *buf)
 			q = begin_line(dot);	// assume "dot"
 		}
 		// read after current line- unless user said ":0r foo"
(Continue reading)

Ron Yorston | 18 Aug 14:59 2014
Picon

[PATCH 1/2] vi: avoid spurious error if no filename is provided

Since commit 32afd3a (vi: some simplifications) starting vi without a
filename on the command line has resulted in an error message in the
status line:  '(null)' Bad address.

The commit removed a call to the file_size function which checked for a
null filename.  This prevented file_insert (and hence open) from being
called with a null filename.

Signed-off-by: Ron Yorston <rmy <at> tigress.co.uk>
---
 editors/vi.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/editors/vi.c b/editors/vi.c
index 24a9f60..9f55af1 100644
--- a/editors/vi.c
+++ b/editors/vi.c
 <at>  <at>  -722,7 +722,7  <at>  <at>  int vi_main(int argc, char **argv)
 /* will also update current_filename */
 static int init_text_buffer(char *fn)
 {
-	int rc;
+	int rc = -1;

 	flush_undo_data();
 	modified_count = 0;
 <at>  <at>  -741,7 +741,8  <at>  <at>  static int init_text_buffer(char *fn)
 		free(current_filename);
 		current_filename = xstrdup(fn);
 	}
(Continue reading)

Guilherme Maciel Ferreira | 18 Aug 05:19 2014
Picon

[PATCH] syslogd: add missing initializer

In file included from sysklogd/syslogd_and_logger.c:46:
  sysklogd/syslogd.c:203: warning: missing initializer
  sysklogd/syslogd.c:203: warning: (near initialization for ‘init_data.SMwdn[0].sem_flg’)
  sysklogd/syslogd.c:203: warning: missing initializer
  sysklogd/syslogd.c:203: warning: (near initialization for ‘init_data.SMwdn[1].sem_flg’)
  sysklogd/syslogd.c:203: warning: missing initializer
  sysklogd/syslogd.c:203: warning: (near initialization for ‘init_data.SMwdn[2].sem_flg’)

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira <at> gmail.com>
---
 sysklogd/syslogd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 266657f..433ede3 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
 <at>  <at>  -198,7 +198,7  <at>  <at>  static const struct init_globals init_data = {
 	.s_semid = -1,
 	.shm_size = ((CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE)*1024), /* default shm size */
 	.SMwup = { {1, -1, IPC_NOWAIT} },
-	.SMwdn = { {0, 0}, {1, 0}, {1, +1} },
+	.SMwdn = { {0, 0, 0}, {1, 0, 0}, {1, +1, 0} },
 #endif
 };

--

-- 
1.7.0.4

_______________________________________________
(Continue reading)

Guilherme Maciel Ferreira | 18 Aug 05:14 2014
Picon

[PATCH 3/3] testsuite: add logger test cases

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira <at> gmail.com>
---
 testsuite/logger/logger-prio   |    9 +++++++++
 testsuite/logger/logger-stderr |    5 +++++
 testsuite/logger/logger-tag    |    6 ++++++
 3 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100644 testsuite/logger/logger-prio
 create mode 100644 testsuite/logger/logger-stderr
 create mode 100644 testsuite/logger/logger-tag

diff --git a/testsuite/logger/logger-prio b/testsuite/logger/logger-prio
new file mode 100644
index 0000000..3a7bd4c
--- /dev/null
+++ b/testsuite/logger/logger-prio
 <at>  <at>  -0,0 +1,9  <at>  <at> 
+PRIO=$(cat /etc/syslog.conf | sed 's/[ \t]*\/.*//g')
+FILE=$(cat /etc/syslog.conf | sed 's/[a-zA-Z0-9]*\.[a-zA-Z0-9]*[ \t]*\//\//g')
+MSG="log message to $PRIO at $(date +%H:%M:%S)"
+
+LC_ALL=C logger -p $PRIO $MSG
+LC_ALL=C tail -n 1 $FILE > logfile.gnu
+LC_ALL=C busybox logger -p $PRIO $MSG
+LC_ALL=C tail -n 1 $FILE > logfile.bb
+diff -ubw logfile.gnu logfile.bb
diff --git a/testsuite/logger/logger-stderr b/testsuite/logger/logger-stderr
new file mode 100644
index 0000000..bcd8fb6
--- /dev/null
+++ b/testsuite/logger/logger-stderr
(Continue reading)

Guilherme Maciel Ferreira | 18 Aug 05:11 2014
Picon

[PATCH 1/3] testsuite: warning when bash is not in use.

The test suite scripts fail with "Bad substitution" error when using a shell
other than Bash. This patch adds an alert to the user, to remind him to change
its /bin/sh symlink.

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira <at> gmail.com>
---
 Makefile.custom |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Makefile.custom b/Makefile.custom
index f8a1283..706e795 100644
--- a/Makefile.custom
+++ b/Makefile.custom
 <at>  <at>  -51,6 +51,9  <at>  <at>  ifneq ($(strip $(DO_INSTALL_LIBS)),n)
 	done
 endif

+# Get the real shell to check if bash is used, otherwise some test may fail
+SHELL_IN_USE := $(shell readlink $(SHELL))
+
 # Not very elegant: copies testsuite to objdir...
 # (cp -pPR is POSIX-compliant (cp -dpR or cp -a would not be))
 .PHONY: check
 <at>  <at>  -59,6 +62,10  <at>  <at>  ifeq ($(CONFIG_UNIT_TEST),y)
 UNIT_CMD = ./busybox unit
 endif
 check test: busybox busybox.links
+	 <at> if [ x"$(SHELL_IN_USE)" != x"/bin/bash" ]; then \
+		echo "WARNING: The $(SHELL) is a symlink to $(SHELL_IN_USE), but test" \
+		     "suite requires /bin/bash to run properly."; \
(Continue reading)

Denys Vlasenko | 17 Aug 11:22 2014

Re: Fix the addgroup help output

On Fri, Aug 15, 2014 at 3:11 PM, <lpapp <at> archlinux.us> wrote:
Applets are defining the help display text on their own, and it is different for different applets.

I don't see any obvious way to make it easier without significant bloat.

Pass a list of options, parameters and their explanations to a function
which builds help text? This will likely be bigger than the help text
(many pointers to small strings results in pointers taking
almost the same amount of space than strings!)

Even if you manage to avoid _that_ bloat somehow,
you can't bzip2-compress tiny bits of text.
We currently bzip2-compress our help text as one big blob,
with BIG savings in size - more than 50%

And then you discover that some applets really want a bit
of customization to the way how options are explained.


_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Denys Vlasenko | 15 Aug 18:12 2014

Re: Fix the addgroup help output

On Fri, Aug 15, 2014 at 3:11 PM, <lpapp <at> archlinux.us> wrote:
Applets are defining the help display text on their own, and it is different for different applets.
Also, it will be difficult to change at many places if you happen to need to..
centralization would rock here imho...

Centralization used to "rock", when all help texts
were in include/usage.src.h (then named include/usage.h).

It was easy to see all help texts in one place, but it was
a complete nightmare to keep applet and its help text in sync:
you needed to jump between two different files
in order to check what every option does in code,
and what help text says.

People were routinely forgetting to update help text,
because it was in separate file.

Adding new applet needed editing many files.

You can see all help texts in one place after a build:
it's in generated file, include/usage.h;
or you can just run auxiliary executable: applets/usage
to have it on stdout.
_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Neale Pickett | 14 Aug 23:11 2014

Package to use busybox runit as PID 1 on Arch Linux

I've been using this for over a year now and I feel like I ought to let people know about it since everyone seems to be interested in PID 1 a lot these days.



I created the Arch package because I liked runit so much on a Buildroot-based system I made for running security contests at Defcon. Busybox runit is now PID 1 on every machine I administer.


_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
waldeck | 14 Aug 14:36 2014
Picon
Picon

missing format string in applets/usage_pod.c

Hi,

depending on the compilation options a build could fail here:

--- applets/usage_pod.c.orig    2014-08-14 08:27:47.021201252 -0400
+++ applets/usage_pod.c 2014-08-14 08:16:20.685224466 -0400
 <at>  <at>  -71,7 +71,7  <at>  <at> 
                } else {
                        printf(", ");
                }
-               printf(usage_array[i].aname);
+               printf("%s", usage_array[i].aname);
                col += len2;
        }
        printf("\n\n");

Thanks

Markus
Daniil Gentili | 13 Aug 18:26 2014
Picon

Old_e2fsprogs patch

Hello everyone,
I'd like to include e2fsck and mke2fs to my busybox. Since I'm kind of a noob in busybox building, could somebody please provide me a fully working patch for busybox 1.22.1 that enables e2fsck and mke2fs in busybox? 
Thank you.
_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Laszlo Papp | 13 Aug 10:52 2014
Picon

Fix the addgroup help output

commit 55d6582d88470078cef09f52d1bc3c9c3f7fca6a
Author: Laszlo Papp <lpapp <at> kde.org>
Date:   Wed Aug 13 09:48:08 2014 +0100

    Fix the addgroup help output
    
    Since the applet has two options, it is quite misleading to only mention one in
    the usage example. It should either use OPTIONS there or enumerate the possible
    options. The latter seems to be more common in applet, so I picked that one.

diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c
index 22cd0e6..ce57459 100644
--- a/loginutils/addgroup.c
+++ b/loginutils/addgroup.c
<at> <at> -11,7 +11,7 <at> <at>
  */
 
 //usage:#define addgroup_trivial_usage
-//usage:       "[-g GID] " IF_FEATURE_ADDUSER_TO_GROUP("[USER] ") "GROUP"
+//usage:       "[-gS] " IF_FEATURE_ADDUSER_TO_GROUP("[USER] ") "GROUP"
 //usage:#define addgroup_full_usage "\n\n"
 //usage:       "Add a group " IF_FEATURE_ADDUSER_TO_GROUP("or add a user to a group") "\n"
 //usage:     "\n       -g GID  Group id"
_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Gmane