Re: 1.22.1 is released
On Mon, Jan 20, 2014 at 8:58 AM, Bernhard Reutner-Fischer rep.dot@gmail.com wrote: On 20 January 2014 06:00:01 Denys Vlasenko vda.li...@googlemail.com wrote: 20 January 2014 -- BusyBox 1.22.1 (stable) Bug fix release. Please schedule the ash SHLVL for the next round. Done: http://busybox.net/downloads/fixes-1.22.1/busybox-1.22.1-ash.patch ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
mount command outputs its usage on correct arguments
This is what I'm trying to do: root@crespo:/ # mount /dev/block/platform/s3c-sdhci.0/by-name/media /storage/sdcard0 Usage: mount [-r] [-w] [-o options] [-t type] device directory 1|root@crespo:/ # mount /dev/block/mmcblk0p3 /storage/sdcard0 Usage: mount [-r] [-w] [-o options] [-t type] device directory 1|root@crespo:/ # mount /dev/block/mmcblk0 /storage/sdcard0 Usage: mount [-r] [-w] [-o options] [-t type] device directory -t should be optional, but if I add it actually parses the arguments correctly 1|root@crespo:/ # mount -t vfat /dev/block/mmcblk0 /storage/sdcard0 mount: Device or resource busy as you might have realized, this is on an android system... I'd report it to https://github.com/tpruvot/android_external_busybox (or https://github.com/dylex/android_external_busybox maybe?) but there's no authoritative repository apparently, and they don't have an issue tracker Thanks -- xmpp: berda...@gmail.com bitmessage: BM-2cTYXfGiSTsnx3righ6aHcJSWe4MV17jDP gpg fingerprint: 3F8D53518012716C4EEF7DF67B498306B3BF75A0 (used just for signing commits) ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: [PATCH] mdev - add SELinux support
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/19/2014 11:23 AM, Amadeusz Sławiński wrote: A better patch would be to use setfscreatecon(scontext) before the mknod. And setfscreatecon(NULL) after. Pseuod code #if ENABLE_SELINUX security_context_t scontext = NULL; char *node_path = xasprintf(/dev/%s, node_name); if (matchpathcon(node_path, rule-mode | type, scontext) == 0) { setfscreatecon(scontext); freecon(scontext); #endif if (mknod(node_name, rule-mode | type, makedev(major, minor)) errno != EEXIST) bb_perror_msg(can't create '%s', node_name); #if ENABLE_SELINUX setfscreatecon(NULL); #endif That way you eliminate a potential race condition where the node is temporarily mislabeled. -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlLdNgwACgkQrlYvE4MpobPnhwCgtYGSnzSfemSnTSZYEtIRaPi1 uRcAoIxEL5vwZJK+Qnic2BZeKsJpk2iu =6kck -END PGP SIGNATURE- ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: mount command outputs its usage on correct arguments
On Mon, Jan 20, 2014 at 3:30 PM, Dario Bertini berda...@gmail.com wrote: This is what I'm trying to do: root@crespo:/ # mount /dev/block/platform/s3c-sdhci.0/by-name/media /storage/sdcard0 Usage: mount [-r] [-w] [-o options] [-t type] device directory 1|root@crespo:/ # mount /dev/block/mmcblk0p3 /storage/sdcard0 Usage: mount [-r] [-w] [-o options] [-t type] device directory 1|root@crespo:/ # mount /dev/block/mmcblk0 /storage/sdcard0 Usage: mount [-r] [-w] [-o options] [-t type] device directory Which version of busybox is this? Can you post your .config? ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: [PATCH] mdev - add SELinux support
On Mon, 20 Jan 2014 09:43:24 -0500 Daniel J Walsh dwa...@redhat.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/19/2014 11:23 AM, Amadeusz Sławiński wrote: A better patch would be to use setfscreatecon(scontext) before the mknod. And setfscreatecon(NULL) after. Pseuod code #if ENABLE_SELINUX security_context_t scontext = NULL; char *node_path = xasprintf(/dev/%s, node_name); if (matchpathcon(node_path, rule-mode | type, scontext) == 0) { setfscreatecon(scontext); freecon(scontext); #endif if (mknod(node_name, rule-mode | type, makedev(major, minor)) errno != EEXIST) bb_perror_msg(can't create '%s', node_name); #if ENABLE_SELINUX setfscreatecon(NULL); #endif That way you eliminate a potential race condition where the node is temporarily mislabeled. -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlLdNgwACgkQrlYvE4MpobPnhwCgtYGSnzSfemSnTSZYEtIRaPi1 uRcAoIxEL5vwZJK+Qnic2BZeKsJpk2iu =6kck -END PGP SIGNATURE- I don't mind doing it like this, in fact first version of this patch looked almost exactly same. My reasoning for doing it the other way is that some nodes (at least on gentoo - console, tty, tty1, null, kmsg) are created before and labels on those need to be fixed (one can of course edit his scripts and run restorecon). Also it should work better this way with people using devtmpfs to mount/automount /dev, even though they later use mdev. Amadeusz ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: mount command outputs its usage on correct arguments
BusyBox v1.21.1-jb bionic (2013-07-25 21:23 +0100) multi-call binary. I think the .config should be this one: https://github.com/tpruvot/android_external_busybox/blob/cm-10.1/.config-full Thanks -- xmpp: berda...@gmail.com bitmessage: BM-2cTYXfGiSTsnx3righ6aHcJSWe4MV17jDP gpg fingerprint: 3F8D53518012716C4EEF7DF67B498306B3BF75A0 (used just for signing commits) ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: [PATCH 1/1] correct `find' invocation in gen_build_files.sh
Is there any occult justification to resist this simple (and POSIX) change? Some of us, mere mortals, crave to know. Denys Vlasenko wrote: bbox's find does support -not - you need to enable DESKTOP in .config. Why? 2014/1/18 Ivailoxakep...@gmail.com: ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox -dborca ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
set_loop tries to create 1048575 loop devices
Hi I just had mount create a large number of loop devices before I interrupted it. The reason is that the loop module is not loaded in the kernel, but it would be better to have an error message instead. Here ist the strace output: stat64(/dev/loop0, 0x7ffd8840)= -1 ENOENT (No such file or directory) mknod(/dev/loop0, S_IFBLK|0644, makedev(7, 0)) = 0 open(/dev/loop0, O_RDONLY|O_LARGEFILE) = -1 ENXIO (No such device or address) stat64(/dev/loop1, 0x7ffd8840)= -1 ENOENT (No such file or directory) mknod(/dev/loop1, S_IFBLK|0644, makedev(7, 1)) = 0 open(/dev/loop1, O_RDONLY|O_LARGEFILE) = -1 ENXIO (No such device or address) ... stat64(/dev/loop255, 0x7ffd8840) = -1 ENOENT (No such file or directory) mknod(/dev/loop255, S_IFBLK|0644, makedev(7, 255)) = 0 open(/dev/loop255, O_RDONLY|O_LARGEFILE) = -1 ENXIO (No such device or address) stat64(/dev/loop256, 0x7ffd8840) = -1 ENOENT (No such file or directory) mknod(/dev/loop256, S_IFBLK|0644, makedev(7, 0)) = 0 open(/dev/loop256, O_RDONLY|O_LARGEFILE) = -1 ENXIO (No such device or address) ... I don't know whether there are other reasons why open /dev/loop might return ENXIO, but if not, then set_loop should abort when it receives that error. Regards Ralf ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: [PATCH 1/1] correct `find' invocation in gen_build_files.sh
Hi ! bbox's find does support -not - you need to enable DESKTOP in .config. Why? The idea behind this was space saving on none desktop version (e.g. initramfs versions of Busybox). The base syntax of find was the explation mark for the NOT operation. So any extra syntax needs extra space, which shall only be included on full desktop version of BB. Through the time more people tend to use the alternate syntax, the -not notation. So it tends more to be the standard to have this notation. IMO we should disable the desktop feature dependency on the -not in find and include it in all versions of BB. -- Harald ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: [PATCH] mdev - add SELinux support
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/20/2014 10:56 AM, Amadeusz Sławiński wrote: On Mon, 20 Jan 2014 09:43:24 -0500 Daniel J Walsh dwa...@redhat.com wrote: On 01/19/2014 11:23 AM, Amadeusz Sławiński wrote: A better patch would be to use setfscreatecon(scontext) before the mknod. And setfscreatecon(NULL) after. Pseuod code #if ENABLE_SELINUX security_context_t scontext = NULL; char *node_path = xasprintf(/dev/%s, node_name); if (matchpathcon(node_path, rule-mode | type, scontext) == 0) { setfscreatecon(scontext); freecon(scontext); #endif if (mknod(node_name, rule-mode | type, makedev(major, minor)) errno != EEXIST) bb_perror_msg(can't create '%s', node_name); #if ENABLE_SELINUX setfscreatecon(NULL); #endif That way you eliminate a potential race condition where the node is temporarily mislabeled. I don't mind doing it like this, in fact first version of this patch looked almost exactly same. My reasoning for doing it the other way is that some nodes (at least on gentoo - console, tty, tty1, null, kmsg) are created before and labels on those need to be fixed (one can of course edit his scripts and run restorecon). Also it should work better this way with people using devtmpfs to mount/automount /dev, even though they later use mdev. No problem, as long as you have considered both ways that is fine. If mdev runs before other apps, the race condition might not be important. Amadeusz ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlLdW4UACgkQrlYvE4MpobPEUACfeIWGhVYGykQTljLvZVGQj7Xm O/UAoOPn/fIbygnDbN1LPEqPi1h4L1N6 =AE2N -END PGP SIGNATURE- ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: [PATCH 1/1] correct `find' invocation in gen_build_files.sh
On Mon, Jan 20, 2014 at 6:19 PM, Harald Becker ra...@gmx.de wrote: Hi ! bbox's find does support -not - you need to enable DESKTOP in .config. Why? The idea behind this was space saving on none desktop version (e.g. initramfs versions of Busybox). The base syntax of find was the explation mark for the NOT operation. So any extra syntax needs extra space, which shall only be included on full desktop version of BB. Through the time more people tend to use the alternate syntax, the -not notation. So it tends more to be the standard to have this notation. IMO we should disable the desktop feature dependency on the -not in find and include it in all versions of BB. You have some numbers how bb-binary grows when enabling DESKTOP in dot-config? How many bytes more has bb-binary when find -not feature is builtin? I guess not that much :-). IOW, I agree with you. - Sedat - ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Philips TV
Hi Denys, a few weeks ago you asked how to contact developers of a Philips TV. The TV part of Philips has bean sold to TPV Technology Ltd., which is just a holding and does not do there own development. All Philips development centers for consumer electronics have closed (or are going to do so) and there is no more contact address in Europe. All further development for Philips TVs will be anywhere in Asia, support for older Philips devices has bean declined (after warranty period). Sorry, if this sounds like bad news, but those are the official infos which arrived at me. The name of TPV Technology Ltd. is now official and may be published (this was not true at the time you asked for support contact). -- Harald ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
[PATCH] date: fix incorrect year in dates of the form [[[MM]DD]hh]mm
Since commit 688a7e3f dates of the form [[[MM]DD]hh]mm have the wrong year: $ ./busybox date -d 10101010 Fri Oct 10 10:10:00 GMT 10102910 Signed-off-by: Ron Yorston r...@tigress.co.uk --- libbb/time.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libbb/time.c b/libbb/time.c index ea2f72e..5aa5aeb 100644 --- a/libbb/time.c +++ b/libbb/time.c @@ -12,6 +12,7 @@ void FAST_FUNC parse_datestr(const char *date_str, struct tm *ptm) { char end = '\0'; const char *last_colon = strrchr(date_str, ':'); + unsigned year; if (last_colon != NULL) { /* Parse input and assign appropriately to ptm */ @@ -69,16 +70,16 @@ void FAST_FUNC parse_datestr(const char *date_str, struct tm *ptm) } } else /* -mm-dd HH */ - if (sscanf(date_str, %u-%u-%u %u%c, ptm-tm_year, + if (sscanf(date_str, %u-%u-%u %u%c, year, ptm-tm_mon, ptm-tm_mday, ptm-tm_hour, end) = 4 /* -mm-dd */ -|| sscanf(date_str, %u-%u-%u%c, ptm-tm_year, +|| sscanf(date_str, %u-%u-%u%c, year, ptm-tm_mon, ptm-tm_mday, end) = 3 ) { - ptm-tm_year -= 1900; /* Adjust years */ + ptm-tm_year = year - 1900; /* Adjust years */ ptm-tm_mon -= 1; /* Adjust month from 1-12 to 0-11 */ } else if (date_str[0] == '@') { -- 1.8.4.2 ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: set_loop tries to create 1048575 loop devices
On Mon, Jan 20, 2014, at 18:52, Ralf Friedl wrote: Hi I just had mount create a large number of loop devices before I interrupted it. The reason is that the loop module is not loaded in the kernel, but it would be better to have an error message instead. ... I don't know whether there are other reasons why open /dev/loop might return ENXIO, but if not, then set_loop should abort when it receives that error. According to libbb/loop.c, it also returns ENXIO to mean this loop is free. So can't exactly abort for that. I recommend you disable ENABLE_FEATURE_MOUNT_LOOP_CREATE if you don't want the devices created. - Lauri -- http://www.fastmail.fm - Same, same, but different... ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: set_loop tries to create 1048575 loop devices
I just had mount create a large number of loop devices before I interrupted it. The reason is that the loop module is not loaded in the kernel, but it would be better to have an error message instead. ... I don't know whether there are other reasons why open /dev/loop might return ENXIO, but if not, then set_loop should abort when it receives that error. According to libbb/loop.c, it also returns ENXIO to mean this loop is free. So can't exactly abort for that. I recommend you disable ENABLE_FEATURE_MOUNT_LOOP_CREATE if you don't want the devices created. My mistake, the ENXIO was from ioctl not open. Checking for it in open should be ok. - Lauri -- http://www.fastmail.fm - IMAP accessible web-mail ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
[PATCH] mdev - add SELinux support
Add support for relabeling files. Files created or modified by mdev should now have correct SELinux labels. It sets file creation context, however if it detects that file exists it just restores context. Signed-off-by: Amadeusz Sławiński am...@asmblr.net --- util-linux/mdev.c | 37 +++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/util-linux/mdev.c b/util-linux/mdev.c index e80b58f..8ecc122 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c @@ -552,6 +552,9 @@ static void make_device(char *device_name, char *path, int operation) { int major, minor, type, len; char *path_end = path + strlen(path); +#if ENABLE_SELINUX + int selinux_enabled = is_selinux_enabled(); +#endif /* Try to read major/minor string. Note that the kernel puts \n after * the data, so we don't need to worry about null terminating the string @@ -741,6 +744,11 @@ static void make_device(char *device_name, char *path, int operation) if (operation == OP_add major = 0) { char *slash = strrchr(node_name, '/'); +#if ENABLE_SELINUX + security_context_t scontext = NULL; + char *node_path; + int have_context = 0; +#endif if (slash) { *slash = '\0'; mkdir_recursive(node_name); @@ -757,8 +765,33 @@ static void make_device(char *device_name, char *path, int operation) node_name, major, minor, rule-mode | type ); } - if (mknod(node_name, rule-mode | type, makedev(major, minor)) errno != EEXIST) - bb_perror_msg(can't create '%s', node_name); +#if ENABLE_SELINUX + if (selinux_enabled) { + node_path = xasprintf(/dev/%s, node_name); + have_context = (matchpathcon(node_path, rule-mode | type, scontext) == 0); + if (have_context) + setfscreatecon(scontext); + } +#endif + if (mknod(node_name, rule-mode | type, makedev(major, minor))) { + if (errno == EEXIST) { +#if ENABLE_SELINUX + if (selinux_enabled have_context) + setfilecon(node_path, scontext); +#endif + } else + bb_perror_msg(can't create '%s', node_name); + } + +#if ENABLE_SELINUX + if (selinux_enabled) { + if (have_context) + freecon(scontext); + setfscreatecon(NULL); + free(node_path); + } +#endif + if (ENABLE_FEATURE_MDEV_CONF) { chmod(node_name, rule-mode); chown(node_name, rule-ugid.uid, rule-ugid.gid); -- 1.8.5.3 ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
[PATCH v2] add selinux support to mdev
I'm booting in enforcing mode and init initializes SELinux, later when mdev is started it needs to create files with correct permissions for system to work correctly. Following patch allows for easy booting of SELinux system with mdev as /dev manager. added in v2 - first try to create node with proper file context, if this doesn't work because node exists, then set context on existing node as it may be incorect due to devtmpfs mount or manual creation of nodes. Amadeusz ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: Philips TV
Hi Harald, On Mon, Jan 20, 2014 at 6:59 PM, Harald Becker ra...@gmx.de wrote: a few weeks ago you asked how to contact developers of a Philips TV. The TV part of Philips has bean sold to TPV Technology Ltd., which is just a holding and does not do there own development. All Philips development centers for consumer electronics have closed (or are going to do so) and there is no more contact address in Europe. All further development for Philips TVs will be anywhere in Asia, support for older Philips devices has bean declined (after warranty period). Thanks for the information. ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: [PATCH] date: fix incorrect year in dates of the form [[[MM]DD]hh]mm
Thanks for the report! I applied with a slightly different fix. The fix will go into 1.22.2 too. On Mon, Jan 20, 2014 at 9:53 PM, Ron Yorston r...@tigress.co.uk wrote: Since commit 688a7e3f dates of the form [[[MM]DD]hh]mm have the wrong year: $ ./busybox date -d 10101010 Fri Oct 10 10:10:00 GMT 10102910 Signed-off-by: Ron Yorston r...@tigress.co.uk --- libbb/time.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libbb/time.c b/libbb/time.c index ea2f72e..5aa5aeb 100644 --- a/libbb/time.c +++ b/libbb/time.c @@ -12,6 +12,7 @@ void FAST_FUNC parse_datestr(const char *date_str, struct tm *ptm) { char end = '\0'; const char *last_colon = strrchr(date_str, ':'); + unsigned year; if (last_colon != NULL) { /* Parse input and assign appropriately to ptm */ @@ -69,16 +70,16 @@ void FAST_FUNC parse_datestr(const char *date_str, struct tm *ptm) } } else /* -mm-dd HH */ - if (sscanf(date_str, %u-%u-%u %u%c, ptm-tm_year, + if (sscanf(date_str, %u-%u-%u %u%c, year, ptm-tm_mon, ptm-tm_mday, ptm-tm_hour, end) = 4 /* -mm-dd */ -|| sscanf(date_str, %u-%u-%u%c, ptm-tm_year, +|| sscanf(date_str, %u-%u-%u%c, year, ptm-tm_mon, ptm-tm_mday, end) = 3 ) { - ptm-tm_year -= 1900; /* Adjust years */ + ptm-tm_year = year - 1900; /* Adjust years */ ptm-tm_mon -= 1; /* Adjust month from 1-12 to 0-11 */ } else if (date_str[0] == '@') { -- 1.8.4.2 ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox