Even more patches

Martin Mares mj at ucw.cz
Mon Aug 25 13:12:07 CEST 2008


Hi!

> First patch fixes bug causing reconfigure completely
> not work on OSPF.

> Second patch fixes endianity problem in debug message.

Feela, are these OK?

> Next three patches are from Debian package of bird. Maybe
> you already know them. The last one is needed to be able
> to compile bird on recent system, it is rather large,
> so i do not attached it. it is here:
> 
> ftp://varda.crfreenet.org/users/santiago/misc/000_update_config_guess_sub.patch

Updating config.{guess,sub} should definitely not do any harm.

Applied.

> diff -urN bird-1.0.11.orig/client/client.c bird-1.0.11/client/client.c
> --- bird-1.0.11.orig/client/client.c	2004-06-05 05:26:48.000000000 -0400
> +++ bird-1.0.11/client/client.c	2006-07-13 09:34:04.000000000 -0400
> @@ -254,7 +254,7 @@
>      die("Cannot create socket: %m");
>    bzero(&sa, sizeof(sa));
>    sa.sun_family = AF_UNIX;
> -  strcpy(sa.sun_path, server_path);
> +  strncpy(sa.sun_path, server_path, sizeof(sa.sun_path));
>    if (connect(server_fd, (struct sockaddr *) &sa, SUN_LEN(&sa)) < 0)
>      die("Unable to connect to server control socket (%s): %m", server_path);
>    if (fcntl(server_fd, F_SETFL, O_NONBLOCK) < 0)
> diff -urN bird-1.0.11.orig/sysdep/unix/io.c bird-1.0.11/sysdep/unix/io.c
> --- bird-1.0.11.orig/sysdep/unix/io.c	2005-02-14 18:15:04.000000000 -0500
> +++ bird-1.0.11/sysdep/unix/io.c	2006-07-13 09:34:29.000000000 -0400
> @@ -866,7 +866,7 @@
>      goto bad;
>    unlink(name);
>    sa.sun_family = AF_UNIX;
> -  strcpy(sa.sun_path, name);
> +  strncpy(sa.sun_path, name, sizeof(sa.sun_path));
>    if (bind(fd, (struct sockaddr *) &sa, SUN_LEN(&sa)) < 0)
>      ERR("bind");
>    if (listen(fd, 8))

This is seriously wrong. If the name is too long, it gets trimmed and the
terminating zero gets lost. The proper solution would be to report an error
in such cases. Could you please update the patch?

> diff -urN bird-1.0.11.orig/conf/Makefile bird-1.0.11/conf/Makefile
> --- bird-1.0.11.orig/conf/Makefile	2000-03-12 18:04:04.000000000 -0500
> +++ bird-1.0.11/conf/Makefile	2006-07-13 10:30:06.000000000 -0400
> @@ -24,6 +24,6 @@
>  	$(M4) -P $(conf-src)/gen_commands.m4 $(srcdir)/client/cmds.m4 $(conf-fragments) | sort >commands.h
>  
>  cf-lex.c: cf-lex.l
> -	$(FLEX) $(FLEX_DEBUG) -sB8 -ocf-lex.c -Pcf_ cf-lex.l
> +	$(FLEX) $(FLEX_DEBUG) -s -B -8 -ocf-lex.c -Pcf_ cf-lex.l
>  
>  depend: keywords.h commands.h cf-parse.tab.c cf-lex.c

This is already present in our repository.

BTW, would anybody object to converting the CVS repository to GIT and making
it available for read-only access to everybody?

				Have a nice fortnight
-- 
Martin `MJ' Mares                          <mj at ucw.cz>   http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth



More information about the Bird-users mailing list