[BusyBox] [PATCH] devfsd

farmatito at tiscali.it farmatito at tiscali.it
Tue Nov 16 18:53:00 UTC 2004


>-- Messaggio Originale --
>From: Allen Chan <allen at developers.alyz.com>
>To: busybox at mail.busybox.net
>Date: Mon, 15 Nov 2004 14:44:20 -0500
>Subject: [BusyBox] [PATCH] devfsd
>
>
>In BusyBox 1.00, with CONFIG_DEVFSD_VERBOSE=y, devfsd sometimes 
>generate incorrect error messages.  For example, after adding 
>'/sbin/devfsd /dev" to a startup script in /etc/init.d, I get the 
>following output in dmesg even though /etc/devfsd.conf exists and 
>devfsd creates all the symlinks as defined in the config file:
>
> devfsd v1.3.25  started for /dev
> devfsd: read config file: /etc/devfsd.conf: No such file or directory
>
>The problem is due to the possible corruption of the global errno 
>variable while inside the msg_logger function, possibly causing 
>arbitrary messages to be displayed.  The value of errno needs to be 
>saved and restored as described on the errno man page.
>
>diff -Npur orig/miscutils/devfsd.c new/miscutils/devfsd.c
>--- orig/miscutils/devfsd.c 2004-10-13 02:25:52.000000000 -0400
>+++ new/miscutils/devfsd.c 2004-11-15 14:08:12.000000000 -0500
>@@ -306,19 +306,24 @@ const char * const bb_msg_variable_not_f
> #if defined(CONFIG_DEVFSD_VERBOSE) || defined(CONFIG_DEBUG)
> static void msg_logger(int die, int pri, const char * fmt, ... )
> {
>+ int errno_save = errno;
>  va_list ap;
> 
>  va_start(ap, fmt);
>  if (access ("/dev/log", F_OK) == 0)
>  {
>   openlog(bb_applet_name, 0, LOG_DAEMON);
>+  errno = errno_save;
>   vsyslog( pri , fmt , ap);
>   closelog();
>   }
> #ifndef CONFIG_DEBUG
>  else
> #endif
>+ {
>+  errno = errno_save;
>   bb_verror_msg(fmt, ap);
>+ }
>  va_end(ap);
>  if(die==DIE)
>   exit(EXIT_FAILURE);
>----- end of patch -----
Hi,
looks good to me,
please apply.
Ciao,
Tito
>-- 
>Allen Chan
>allen at developers.alyz.com
>http://www.alyz.com
>_______________________________________________
>busybox mailing list
>busybox at mail.busybox.net
>http://busybox.net/mailman/listinfo/busybox


__________________________________________________________________
Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno!
Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free.
Sei libero da costi fissi e, se ti abboni entro il 25 novembre,
navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesione.
http://abbonati.tiscali.it/adsl/






More information about the busybox mailing list