Re: permissions on /var/log/messages

2009-03-02 Thread Hamish Moffatt
On Mon, Mar 02, 2009 at 03:25:19PM +0100, Denys Vlasenko wrote:
 On Monday 02 March 2009 07:03:53 am Hamish Moffatt wrote:
  I'd like /var/log/messages to be readable by non-root users. syslogd.c
  uses device_open to open the file though and it has the permissions
  hardcoded to 0600.
  
  I can't really see why it uses device_open... nor a good solution.
 
 I propose this patch.

   reopen:
 - G.logFD = device_open(G.logFilePath, O_WRONLY | O_CREAT
 - | O_NOCTTY | O_APPEND | O_NONBLOCK);
 + G.logFD = open(G.logFilePath, O_WRONLY | O_CREAT
 + | O_NOCTTY | O_APPEND | O_NONBLOCK,
 + 0666);

0666 is too generous I think - but it works ok. 0644 or 0664 would be
better.

thanks
Hamish
-- 
Hamish Moffatt VK3SB ham...@debian.org ham...@cloud.net.au
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


permissions on /var/log/messages

2009-03-01 Thread Hamish Moffatt
I'd like /var/log/messages to be readable by non-root users. syslogd.c
uses device_open to open the file though and it has the permissions
hardcoded to 0600.

I can't really see why it uses device_open... nor a good solution.


Hamish
-- 
Hamish Moffatt VK3SB ham...@debian.org ham...@cloud.net.au
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: klogd broken in 1.13.0?

2008-11-19 Thread Hamish Moffatt
On Wed, Nov 19, 2008 at 08:45:53AM +0100, Denys Vlasenko wrote:
 On Wednesday 19 November 2008 05:17, Hamish Moffatt wrote:
  I just switched from busybox 1.11.2 to 1.13.0 for a project and now kernel 
  message logging seems a bit busted. It starts ok but then goes wrong.
  Application logging seems to work ok still (see the last 5 lines of this
  example).
  
  I backed out rev 23583 and now it works again.
 
 Does it help if you just add this one line?
 
 /* 2 -- Read from the log. */
 n = klogctl(2, log_buffer + used, KLOGD_LOGBUF_SIZE-1 - used);
 if (n  0) {
 if (errno == EINTR)
 continue;
 syslog(LOG_ERR, klogd: error %d in klogctl(2): %m,
 errno);
 break;
 }
 +   log_buffer[used + n] = '\0';

Yes that works.

  http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_13_stable/sysklogd/klogd.c?rev=23583view=markup
 Look at trunk, not branches/busybox_1_13_stable:
 http://busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/sysklogd/klogd.c?rev=23583view=markup

Looking at branches should work though?


thanks
Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: klogd broken in 1.13.0?

2008-11-19 Thread Hamish Moffatt
On Thu, Nov 20, 2008 at 12:48:50AM +0100, Denys Vlasenko wrote:
 On Thursday 20 November 2008 00:41, Hamish Moffatt wrote:
  On Wed, Nov 19, 2008 at 08:45:53AM +0100, Denys Vlasenko wrote:
   Does it help if you just add this one line?
   
   /* 2 -- Read from the log. */
   n = klogctl(2, log_buffer + used, KLOGD_LOGBUF_SIZE-1 - 
   used);
   if (n  0) {
   if (errno == EINTR)
   continue;
   syslog(LOG_ERR, klogd: error %d in klogctl(2): 
   %m,
   errno);
   break;
   }
   +   log_buffer[used + n] = '\0';
  
  Yes that works.
 
 Minimal fix is here:
 
 http://busybox.net/downloads/fixes-1.13.0/busybox-1.13.0-klogd.patch

It's working.

 and svn has a bit bigger fix (or shall I say smaller -
 code has shrank) is in svn.
 
 Can you test svn version?

That works too.

thanks,
Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


klogd broken in 1.13.0?

2008-11-18 Thread Hamish Moffatt
  
   
Jan  1 00:00:10 elara user.notice rc: Using IP address 192.168.3.2  
 
Jan  1 00:00:11 elara daemon.info dnsmasq[864]: started, version 2.45 cachesize 
150  
Jan  1 00:00:11 elara daemon.info dnsmasq[864]: compile time options: no-IPv6 
GNU-getopt no-ISC-leasefile no-DBus no-I18N TFTP   
Jan  1 00:00:11 elara daemon.info dnsmasq[864]: cleared cache   

Jan  1 00:00:11 elara auth.warn portmap[867]: user rpc not found, reverting to 
user bin 
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: 1.13.0 coreutils/id.c calls libc getgrouplist()

2008-11-16 Thread Hamish Moffatt
On Sun, Nov 16, 2008 at 04:04:06PM +0100, Denys Vlasenko wrote:
 On Sunday 16 November 2008 09:18, Tito wrote:
  On Sunday 16 November 2008 04:21:10 Denys Vlasenko wrote:
  Maybe we can add some warning like:
  
  #if defined (__UCLIBC__) \
   (__UCLIBC_MAJOR__ == 0  __UCLIBC_MINOR__  9) \
  || (__UCLIBC_MINOR__ == 9   __UCLIBC_SUBLEVEL__  30)
  #warning Sorry, you need at least uClibc version 0.9.30 for getgrouplist 
  :(
  #endif
  
  Attached you will find a patch with the above check,
  please apply if you like it.
  The patch is only roughly tested as i don't use uClibc 
  (but seems to work as expected).
 
 Applied and tested it to work as intended with 0.9.29 and 0.9.30.
 Thanks!

Shouldn't it check that !defined(CONFIG_USE_BB_PWD_GRP) though? id works
if that is enabled.


Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: 1.13.0 coreutils/id.c calls libc getgrouplist()

2008-11-16 Thread Hamish Moffatt
On Mon, Nov 17, 2008 at 01:12:35AM +0100, Denys Vlasenko wrote:
 On Monday 17 November 2008 00:51, Hamish Moffatt wrote:
  On Sun, Nov 16, 2008 at 04:04:06PM +0100, Denys Vlasenko wrote:
   On Sunday 16 November 2008 09:18, Tito wrote:
On Sunday 16 November 2008 04:21:10 Denys Vlasenko wrote:
Maybe we can add some warning like:

#if defined (__UCLIBC__) \
 (__UCLIBC_MAJOR__ == 0  __UCLIBC_MINOR__  9) \
|| (__UCLIBC_MINOR__ == 9   __UCLIBC_SUBLEVEL__  30)
#warning Sorry, you need at least uClibc version 0.9.30 for 
getgrouplist :(
#endif

Attached you will find a patch with the above check,
please apply if you like it.
The patch is only roughly tested as i don't use uClibc 
(but seems to work as expected).
   
   Applied and tested it to work as intended with 0.9.29 and 0.9.30.
   Thanks!
  
  Shouldn't it check that !defined(CONFIG_USE_BB_PWD_GRP) though? id works
  if that is enabled.
 
 Fixed, thanks for noticing.

Thanks, will you update the patch for 1.13.0?

Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


1.13.0 coreutils/id.c calls libc getgrouplist()

2008-11-11 Thread Hamish Moffatt
In busybox 1.13.0, id.c calls getgrouplist() which doesn't exist in
uClibc 0.9.29.. enabling internal password/group functions solves it but
is there a better solution? 


Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: [Buildroot] Login exited

2008-09-04 Thread Hamish Moffatt
On Thu, Sep 04, 2008 at 01:34:14PM +0800, Steven Woody wrote:
 On Thu, Sep 4, 2008 at 10:00 AM, Hamish Moffatt [EMAIL PROTECTED] wrote:
  Did you try booting with init=/bin/sh as I suggested two days ago? Or
  modify your inittab to present you with a shell without needing to
  login? This will help to break down the problem dramatically.
 
 I did init=/bin/sh as you suggested and reported the result to the
 list.  Again, the result is:  there is nothing I can do after rootfs
 was loaded by kernel.  I can type in characters can see the echo of
 what I typed on the screen, but no any other outputs.  Does this has
 something to do with my read-only file system type (cramfs)?

I didn't see your posting. Do you get a prompt? Do you get any messages
at all after the kernel loads, loads the RAM disk, etc? Please post the
whole log.

No I don't see how the root file system being read-only would be
significant. cramfs is always read-only. I build cramfs here with
buildroot and it works just fine.

Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: [Buildroot] Login exited

2008-09-03 Thread Hamish Moffatt
On Thu, Sep 04, 2008 at 09:50:01AM +0800, Steven Woody wrote:
 Okay, we leave this 'decompressing' error for a moment.  I rebuilt

Actually on second reading I think that is a result of trying to mount
configfs on /config, and nothing to do with the root filesystem itself.

 (mostly using default options from buildroot) a very small rootfs
 image, 780k cramfs.  This time, it boots without the 'decompressing'
 error message, I still can not login in.  It's same: whatever user
 name I inputed, the getty restarted and I get nothing but another
 prompt.
 
 If you experts can not guess what's is going on here, I hope you can
 tell me how to debug this kind of problem.  Tks.

Did you try booting with init=/bin/sh as I suggested two days ago? Or
modify your inittab to present you with a shell without needing to
login? This will help to break down the problem dramatically.

Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: [rfc] macros and macro usage

2008-06-22 Thread Hamish Moffatt
On Sun, Jun 15, 2008 at 08:23:20PM +0200, Denys Vlasenko wrote:
   USE_IF_ARPING(int x = y;)
   USE_IF_NOT_ARPING(const int x = 5;)

Sorry I'm way behind on this list. Wouldn't

USE_IF_ARPING(int x = y);

be less ugly? Null statements seem to be ok in C.

Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: can't get init to work

2007-10-24 Thread Hamish Moffatt
On Wed, Oct 24, 2007 at 09:15:47PM -0700, Craig wrote:
 I am using busybox 1.7.2 on a CentOS 4.4 kernel (2.6.9). Everything 
 seemed to compile fine. I am able to run the shell 
 (/usr/local/src/busybox-1.7.2/busybox ash) and able to run some simple 
 commands.
 
 But, when I try to build an initrd from it, things don't seem to work. I 
 have tried PXE booting:
 
  kernel os/test/vmlinuz
  append root=/dev/ram0 initrd=os/test/initrd.img.gz init=/linuxrc

Does it load the image and mount the root file system ok in this
configuration?

With an unpacked version of your initrd image (or mount it via loop
device), try to chroot into the directory and run /linuxrc. Does it run?

You might be missing libraries or something like that.


Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


start-stop-daemon does not recognise --start

2007-10-17 Thread Hamish Moffatt
start-stop-daemon claims to offer --start, but then doesn't accept it:

start-stop-daemon: unrecognized option `--start'
BusyBox v1.7.2 (2007-10-17 15:06:10 EST) multi-call binary

Usage: start-stop-daemon [OPTIONS] [--start|--stop] ... [-- arguments...]

Start and stop services

Options:
-S|--start  Start
-K|--stop   Stop
-a|--startas pathname   Starts process specified by path
Force process into background
-u|--user username|uid  Stop this user's processes
-x|--exec executableProgram to either start or check
-m|--make-pidfile   Create the -p file and enter pid in it
-n|--name process-name  Stop processes with this name
-p|--pidfile pid-file   Save or load pid using a pid-file
-q|--quiet  Quiet
-o|--oknodo Exit status 0 if nothing done
-v|--verboseVerbose
-N|--nicelevel NAdd N to process's nice level
-s|--signal signal  Signal to send (default TERM)
-c|--chuid user[:[group]]   Change to specified user/group


Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: start-stop-daemon does not recognise --start

2007-10-17 Thread Hamish Moffatt
On Thu, Oct 18, 2007 at 09:58:41AM +1000, Hamish Moffatt wrote:
 start-stop-daemon claims to offer --start, but then doesn't accept it:

Actually all the long options seems to be broken.


Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: moving /bin/ip to /sbin/ip?

2007-09-10 Thread Hamish Moffatt
On Mon, Sep 10, 2007 at 10:40:11PM +0200, Natanael Copa wrote:
 It would be a lot easier for me to have the ip application in the same
 place as the original iproute2. In fact it makes things alot more easy
 to have the busybox applications in the same place as the original apps.
 (not first time i meet this kind of problems)

$PATH?

-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


use /proc for more of procps

2007-08-09 Thread Hamish Moffatt
Has anyone looked at using /proc entries for more of the functionality
in the procps tools? For example, original procps's free command reports
more stuff, such as the amount of memory used by cache.

(Given the name PROCps it's a bit odd that eg free does not use /proc.
Real procps's free certainly does.)


thanks,
Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: Help using 'dpkg' command to install debian packages

2007-07-12 Thread Hamish Moffatt
On Thu, Jul 12, 2007 at 08:49:26AM -0500, Dallas Clement wrote:
 Here is my scenario:
 
 I built a binary libc6-i386.deb package on my Debian host and installed
 it on another host which has nothing but a bare Linux 2.6.21.1 kernel
 and a static busybox 1.6.0 installed. I used the busybox 'dpkg' command
 to install the package. Everything went fine and the output of the 'dpkg
 -l' command is:

[...]

 When I try to install this package, it fails during the installation.
 This is the error I get:
 
 dpkg: package busybox depends on libc6-i386, which is not installed or
 flagged to be installed
 
 
 I cannot understand why I am getting this error, when clearly the
 libc6-i386 package is installed as you can see from the previous 'dpkg
 -l' output.
[...]

 Clearly, the libc6-i386 package is installed.
 
 Is there anything else that 'dpkg' checks other than this 'status' file
 to do the dependency check? Is it just a simple package name check, or
 is there more involved?
 
 Any insight you could provide will be greatly appreciated!  I'm at my
 wit's end trying to get this to work.

It looks like you are doing the right thing to me, ie if you were using
the real dpkg I believe it would work. Perhaps busybox's emulation is
buggy.

Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: dev/console catch 22

2007-06-20 Thread Hamish Moffatt
On Tue, Jun 19, 2007 at 09:52:27AM -0400, Mike Frysinger wrote:
 On Tuesday 19 June 2007, Michael Cashwell wrote:
  So the file hierarchy served by the NFS server must be written by the a
  host process and I still have the issue of needing elevated privileges
  to do that for the special console node.
 
 i dont really buy this ... only the root user can set up NFS exports and in 
 order for it to be usable by the embedded machine, it has to have root 
 access ... so basically, your system is already insecure so giving away sudo 
 to everyone is exactly the same

Maybe you could run the user-space NFS server inside fakeroot? ;)

I have not tried this.

Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: task/process managment does not work

2007-06-20 Thread Hamish Moffatt
On Wed, Jun 20, 2007 at 11:00:33AM +0200, Miroslaw Dach wrote:
   I have recompiled several times the busybox and each time when I 
 boot my embedded linux ppc405 board with busy box I have difficulties to 
 manage tasks. 
 
 My observation is as following:
 
 top: can't find process info in /proc
 The /proc directory is simply empty
 Is it somehow possible to enable process managing?

Mount /proc?

mount -t proc none /proc

 My second question is how to execute at startup the dropbear (sshd 
 equivalent) as a daemon?
 
 I have tried  to create the file:
 
 /etc/init.d/rcS
 
 #!../../../bin/ash

?? Write /bin/ash. You don't know what directory the script will run
from so don't use relative directories.

 /tmp/ssh/dropbear -F -E 2 /dev/null 
 echo Init ends here

Why use -F and then background it? Just leave off -F.


Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: wget downloads file with wrong size

2007-05-23 Thread Hamish Moffatt
On Wed, May 23, 2007 at 11:38:17AM +0200, Alexander Kriegisch wrote:
  BB 1.4.2, mipsel
  
  Can you try to reproduce this with 1.5.1 or trunk, please?
 
 $ ./busybox
 BusyBox v1.5.1 (2007-05-23 11:30:58 CEST) multi-call binary
 
 $ ./busybox wget http://www.tecchannel.de/download/432967/etherwake
 Connecting to www.tecchannel.de (217.111.81.70:80)
 etherwake100%
 |*|
   248 KB 00:00:00 ETA

I missed the earlier part of this thread, but fwiw it works with your
URL for me on arm(eb). Same file size and md5sum when I fetched it on my
desktop PC and on the target. 

1f12f3b9d05dbde11d8a9f0118bbf32b  etherwake

Are you sure it is not a proxy problem or similar?

Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: ash: Can't access tty problems (initramfs)

2007-05-17 Thread Hamish Moffatt
On Fri, May 18, 2007 at 01:28:00AM +0200, Denis Vlasenko wrote:
 On Thursday 17 May 2007 18:28, Dallas Clement wrote:
  I'm getting the infamous Can't access tty; job control turned off
  message when I try to invoke the ash shell during my initial bootup.
  
  I'm using busybox 1.5.0.  I also understand that ash requires a
  controlling tty rather than the console.  Though, I don't understand all
  the reasons.
  
  If I don't define a console however, I get a kernel panic from
  initramfs.
 
 Boot with init=/bin/ash, and you will get Can't access tty message.
 That's because fd# 0,1,2 are opened to /dev/console.
 Now execute this in ash:
 
 # exec /bin/ash /dev/tty1 /dev/tty1 21
 
 This one will work ok, because fds are opened to /dev/tty0,
 which can be a controlling tty.
 
 Basically that's it. If you want ctty, open some device different from
 /dev/console

I got the controlling tty errors as a result of the following in
inittab:

::askfirst:-/bin/sh

Do you mean that this is wrong? (According to the documentation, it is an
implicit rule if inittab is missing.)


Hamish
-- 
Hamish Moffatt VK3SB [EMAIL PROTECTED] [EMAIL PROTECTED]
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox