tito | 20 Sep 16:45 2014
Picon

[PATCH] addgroup could assign already in use group

Hi,
while looking at the long username stuff and malloced getpwxx functions
I've noticed a bug in addgroup resulting in assignement of a wrong
(already in use) gid. In the function xgroup_study:

static void xgroup_study(struct group *g)
{

snip

	/* Check if the desired gid is free
	 * or find the first free one */
	while (1) {
		if (!getgrgid(g->gr_gid)) {

			return; /* found free group: return */
		}
snip

		g->gr_gid++;
	}
}

The call to getgrgid can return NULL also in case of error:

       0 or ENOENT or ESRCH or EBADF or EPERM or ...
              The given name or gid was not found.

       EINTR  A signal was caught.

(Continue reading)

Aaro Koskinen | 20 Sep 13:30 2014
Picon
Picon

Busybox less sometimes ignores newlines in input?

Hi,

Sometimes when running "git log", busybox less won't display a newline
between commits. This happens when git is slow and less needs to wait
for new input to appear.

A simple reproducer:

(perl -e 'print "\nfoo\n";'; sleep 1; perl -e 'print "\nbar\n";') | less

A.
Gian Ntzik | 18 Sep 21:17 2014
Picon

Re: rm -r fails to delete entire hierarchy when path goes in and out of it

Denys Vlasenko <vda.linux <at> googlemail.com> writes:

> This would work:
>
>
>                 int curdir = xopen(".", O_RDONLY);
>
>                 do {
>                         /* This removes any trailing slashes from *argv.
>                          * It returns "/" _only_ for root directory.
>                          */
>                         char *base = bb_get_last_path_component_strip(*argv);
>
>                         if (DOT_OR_DOTDOT(base) || LONE_CHAR(base, '/')) {
>                                 bb_error_msg("can't remove '.', '..' or '/'");
>                                 status = 1;
>                                 goto next;
>                         }
>                         if (*argv != base) { /* if *args contains slash(es) */
>                                 base[-1] = '\0';
>                                 if (chdir(*argv) != 0) {
>                                         status = 1;
>                                         goto next;
>                                 }
>                         }
>                         if (remove_file(base, flags) < 0) {
>                                 status = 1;
>                         }
>                         if (fchdir(curdir) != 0) {
>                                 bb_error_msg_and_die("can't return to
(Continue reading)

Gian Ntzik | 18 Sep 18:20 2014
Picon

Re: rm -r fails to delete entire hierarchy when path goes in and out of it

Isaac Dunham <ibid.ag <at> gmail.com> writes:

> On Wed, Sep 17, 2014 at 06:08:45PM -0400, Joshua Judson Rosen wrote:
>> GNU rm opens the top-level directory and uses unlinkat(), fstatat(), etc. to remove
>> files and subdirectories without having to resolve the paths for every
>> file/directory processed; so it runs into the problem (that some ".." link no
>> longer exists) only when it finally reaches that top-level directory.
>> It still refuses to operate on paths that _end_ in "/.." (or "/.").
>
> This is explicitly required by POSIX.
> Which implies that determining a canonical name should not be done.
>

The POSIX specification of rm
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html#tag_20_111

explicitly requires that rm fails on arguments ending in dot or
dot-dot. Nothing in the specification says or implies that there cannot
be dot or dot-dot at some point other than the end of the pathname
identifying a file system object to remove.

Note that rm is required to ignore the entries dot and dot-dot
when considering a directory (2.c in the Description).

A canonical starting path for the recursive traversal can still be
generated after the required checks on the initial argument.

To follow up on my initial report of the issue, the problem is not
specifically due to the use of dot-dots in the pathname. It lies in the
fact that the pathname used to identify a directory traverses
(Continue reading)

Miroslav Lichvar | 18 Sep 16:19 2014
Picon

[PATCH 0/5] Fix ntpd to not poll frequently

Hi,

I was testing the busybox NTP implementation to see if it doesn't poll
the servers too frequently. This is a big problem for public NTP
servers, where a small percentage of bad clients can take most of the
resources.

Unless a shorter polling interval is needed to keep the clock well
synchronized, an NTP client should be normally always slowly
increasing the polling interval up to a maximum, usually 1024 seconds
or more.

In my testing, the busybox ntpd is working mostly very well, the
polling interval usually reaches the maximum of 4096 seconds, but it
seems there are some cases where it can get stuck at a much shorter
interval or decrease the interval unnecessarily.

This patch set is an attempt to handle these cases better. Testing was
done in a simulator which is available here:

https://mlichvar.fedorapeople.org/clknetsim/

There are other improvements that could be made, like controlling the
interval for each peer separately, but I thought this would be a step
in the right direction.

Miroslav Lichvar (5):
  ntpd: don't wait for good offset before disabling burst mode
  ntpd: don't reset polling interval unnecessarily
  ntpd: split out poll adjusting code
(Continue reading)

Ari Sundholm | 18 Sep 15:37 2014

[PATCH] dd: implement status=noxfer and status=none

From: Ari Sundholm <ari <at> tuxera.com>

Signed-off-by: Ari Sundholm <ari <at> tuxera.com>
---
 coreutils/dd.c | 35 +++++++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/coreutils/dd.c b/coreutils/dd.c
index 2838f63..f2c7b04 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
 <at>  <at>  -32,6 +32,10  <at>  <at> 
 //usage:     "\n	conv=fsync	Physically write data out before finishing"
 //usage:     "\n	conv=swab	Swap every pair of bytes"
 //usage:	)
+//usage:	IF_FEATURE_DD_THIRD_STATUS_LINE(
+//usage:	 "\n	status=noxfer	Suppress transfer stats"
+//usage:	)
+//usage:	 "\n	status=none	Suppress all output"
 //usage:     "\n"
 //usage:     "\nN may be suffixed by c (1), w (2), b (512), kD (1000), k (1024), MD, M, GD, G"
 //usage:
 <at>  <at>  -69,6 +73,7  <at>  <at>  struct globals {
 #if ENABLE_FEATURE_DD_THIRD_STATUS_LINE
 	unsigned long long total_bytes;
 	unsigned long long begin_time_us;
+	int noxfer;
 #endif
 } FIX_ALIASING;
 #define G (*(struct globals*)&bb_common_bufsiz1)
(Continue reading)

Imu Li | 18 Sep 11:18 2014
Picon

[PATCH] libbb: send_to_from with mixed ip/ipv6 addresses


When a server is recieves a datagram to an IPv4 address by an IPv6
socket, the destination address is supplied as an in_pktinfo, not an
in6_pktinfo. This allows that to be supplied as a source address in a
reply.

This fixes a bug in ntpd, where if the system has multiple addresses,
queries to secondary addresses have the wrong source address in their
response.
---
 libbb/udp_io.c | 4 ++++
 1 file changed, 4 insertions(+)

_______________________________________________
busybox mailing list
busybox <at> busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
Ari Sundholm | 18 Sep 14:41 2014

[PATCH] df: fix -T option when ENABLE_FEATURE_HUMAN_READABLE=0.

From: Ari Sundholm <ari <at> tuxera.com>

---
 coreutils/df.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/coreutils/df.c b/coreutils/df.c
index 7a82fee..d79c11a 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
 <at>  <at>  -85,12 +85,12  <at>  <at>  int df_main(int argc UNUSED_PARAM, char **argv)
 	enum {
 		OPT_KILO  = (1 << 0),
 		OPT_POSIX = (1 << 1),
-		OPT_ALL   = (1 << 2) * ENABLE_FEATURE_DF_FANCY,
-		OPT_INODE = (1 << 3) * ENABLE_FEATURE_DF_FANCY,
-		OPT_BSIZE = (1 << 4) * ENABLE_FEATURE_DF_FANCY,
-		OPT_HUMAN = (1 << (2 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE,
-		OPT_MEGA  = (1 << (3 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE,
-		OPT_FSTYPE  = (1 << (4 + 3*ENABLE_FEATURE_DF_FANCY)),
+		OPT_FSTYPE  = (1 << 2),
+		OPT_ALL   = (1 << 3) * ENABLE_FEATURE_DF_FANCY,
+		OPT_INODE = (1 << 4) * ENABLE_FEATURE_DF_FANCY,
+		OPT_BSIZE = (1 << 5) * ENABLE_FEATURE_DF_FANCY,
+		OPT_HUMAN = (1 << (3 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE,
+		OPT_MEGA  = (1 << (4 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE,
 	};
 	const char *disp_units_hdr = NULL;
 	char *chp;
 <at>  <at>  -102,10 +102,9  <at>  <at>  int df_main(int argc UNUSED_PARAM, char **argv)
(Continue reading)

Ari Sundholm | 17 Sep 15:47 2014

[PATCH v3] df: implement -T option

From: Ari Sundholm <ari <at> tuxera.com>

Changes since v2:
- Fix field width after linebreak when Unicode is enabled.
- Take OPT_POSIX into account.

Changes since v1:
- Fix usage when fancy features are off.

Signed-off-by: Ari Sundholm <ari <at> tuxera.com>
---
 coreutils/df.c | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/coreutils/df.c b/coreutils/df.c
index 5e9a867..6425c32 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
 <at>  <at>  -25,6 +25,7  <at>  <at> 
 //usage:#define df_trivial_usage
 //usage:	"[-Pk"
 //usage:	IF_FEATURE_HUMAN_READABLE("mh")
+//usage:	"T"
 //usage:	IF_FEATURE_DF_FANCY("ai] [-B SIZE")
 //usage:	"] [FILESYSTEM]..."
 //usage:#define df_full_usage "\n\n"
 <at>  <at>  -35,6 +36,7  <at>  <at> 
 //usage:     "\n	-m	1M-byte blocks"
 //usage:     "\n	-h	Human readable (e.g. 1K 243M 2G)"
 //usage:	)
(Continue reading)

Gian Ntzik | 17 Sep 06:46 2014
Picon

rm -r fails to delete entire hierarchy when path goes in and out of it


Hello,

It seems that using rm -r with a path that goes into the hierarchy
intended for removal (and back up e.g. using dot-dots) fails to remove
the entire hierarchy.

For example,

$ mkdir -p /tmp/a/b/c
$ mkdir -p /tmp/a/e
$ rm -r /tmp/a/b/../../a
rm: can't remove 'a/b/../../a/e': No such file or directory
rm: can't remove 'a/b/../../a': No such file or directory

Then,

$ ls /tmp/a
e

in this case /tmp/a/b/c and /tmp/a/b have been removed but not /tmp/a/e.
I have tested this with the latest busybox-i686 binary available for
download (09-Jul-2013 02:02).

I believe this is a bug and not the intended behaviour of rm -r.

Looking at the source code, I think this behavior is due to the function
remove_file (in /libbb/remove_file.c), which implements the recursive
remove, appends each entry name read by readdir() to the remove_file's
path argument to form the argument of the recursive call.
(Continue reading)

Ari Sundholm | 16 Sep 20:12 2014

[PATCH v2] df: implement -T option

From: Ari Sundholm <ari <at> tuxera.com>

Changes since v1:
- Fix usage when fancy features are off.

Signed-off-by: Ari Sundholm <ari <at> tuxera.com>
---
 coreutils/df.c | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/coreutils/df.c b/coreutils/df.c
index 5e9a867..5543951 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
 <at>  <at>  -25,6 +25,7  <at>  <at> 
 //usage:#define df_trivial_usage
 //usage:	"[-Pk"
 //usage:	IF_FEATURE_HUMAN_READABLE("mh")
+//usage:	"T"
 //usage:	IF_FEATURE_DF_FANCY("ai] [-B SIZE")
 //usage:	"] [FILESYSTEM]..."
 //usage:#define df_full_usage "\n\n"
 <at>  <at>  -35,6 +36,7  <at>  <at> 
 //usage:     "\n	-m	1M-byte blocks"
 //usage:     "\n	-h	Human readable (e.g. 1K 243M 2G)"
 //usage:	)
+//usage:     "\n	-T	print file system type"
 //usage:	IF_FEATURE_DF_FANCY(
 //usage:     "\n	-a	Show all filesystems"
 //usage:     "\n	-i	Inodes"
(Continue reading)


Gmane