Hello, three straighforward patches to
man/Makefile.am: Use $(MAKE) telnetd/telnetd.c: Use PATH_LOGIN ifconfig/if_index.c: Encapsulate using HAVE_STRUCT_IF_NAMEINDEX On the latter, the header file "ifconfig/if_index_h" is correctly building a conditional inclusion, but the full source failed to perform the corresponding step. Hint: After these, there are only my next patches to "libinetutils/utmp_*.c" that prevent compilation in OpenBSD. Best regards, Mats E A
From 91750e1eb94eea1c71cce1495af72ef1334c7230 Mon Sep 17 00:00:00 2001 From: Mats Erik Andersson <g...@gisladisker.se> Date: Wed, 15 Sep 2010 21:13:19 +0200 Subject: [PATCH 1/3] man/Makefile.am: Use $(MAKE) instead of "make". --- ChangeLog | 4 ++++ man/Makefile.am | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f3efb3..1d7f9ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-09-15 Mats Erik Andersson <g...@gisladisker.se> + + * man/Makefile.am: Use expansion "$(MAKE)". + 2010-09-09 Mats Erik Andersson <g...@gisladisker.se> * src/tftp.c (peeraddr, f, trace, verbose, rexmtval) diff --git a/man/Makefile.am b/man/Makefile.am index 2b0e189..1afd843 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -178,10 +178,10 @@ uucpd.8: uucpd.h2m $(top_srcdir)/src/uucpd.c $(top_srcdir)/configure.ac whois.1: whois.h2m $(top_srcdir)/whois/whois.c $(top_srcdir)/configure.ac .h2m.1: - make man TOOL=$* SECTION=1 + $(MAKE) man TOOL=$* SECTION=1 .h2m.8: - make man TOOL=$* SECTION=8 + $(MAKE) man TOOL=$* SECTION=8 mapped_name = `echo ../$(TOOL)/$(TOOL) \ | sed s,../ping6/ping6,../ping/ping6,\ -- 1.6.3.3
From d16bdac695cf13096806aa12d748c8984df8dc1e Mon Sep 17 00:00:00 2001 From: Mats Erik Andersson <g...@gisladisker.se> Date: Wed, 15 Sep 2010 21:18:09 +0200 Subject: [PATCH 2/3] telnetd/telnetd.c: Use the autodetected PATH_LOGIN. --- ChangeLog | 5 +++++ telnetd/telnetd.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1d7f9ae..7d198af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-09-15 Mats Erik Andersson <g...@gisladisker.se> + * telnetd/telnetd.c (login_invocation, argp_options): + Access login(1) by detected PATH_LOGIN. + +2010-09-15 Mats Erik Andersson <g...@gisladisker.se> + * man/Makefile.am: Use expansion "$(MAKE)". 2010-09-09 Mats Erik Andersson <g...@gisladisker.se> diff --git a/telnetd/telnetd.c b/telnetd/telnetd.c index 48d4536..b72cd73 100644 --- a/telnetd/telnetd.c +++ b/telnetd/telnetd.c @@ -39,9 +39,9 @@ static void print_hostinfo (void); char *login_invocation = #ifdef SOLARIS - "/bin/login -h %h %?T{TERM=%T}{-} %?u{%?a{-f }-- %u}" + PATH_LOGIN " -h %h %?T{TERM=%T}{-} %?u{%?a{-f }-- %u}" #else - "/bin/login -p -h %h %?u{-f %u}" + PATH_LOGIN " -p -h %h %?u{-f %u}" #endif ; @@ -96,7 +96,7 @@ static struct argp_option argp_options[] = { { "debug", 'D', "LEVEL", OPTION_ARG_OPTIONAL, "set debugging level" }, { "exec-login", 'E', "STRING", 0, - "set program to be executed instead of /bin/login" }, + "set program to be executed instead of " PATH_LOGIN }, { "no-hostinfo", 'h', NULL, 0, "do not print host information before login has been completed" }, { "linemode", 'l', "MODE", OPTION_ARG_OPTIONAL, -- 1.6.3.3
From a3710fdce432af61e64eaf181f65a423f25d8ca0 Mon Sep 17 00:00:00 2001 From: Mats Erik Andersson <g...@gisladisker.se> Date: Wed, 15 Sep 2010 21:22:38 +0200 Subject: [PATCH 3/3] ifconfig/if_index.c: Condition on !HAVE_STRUCT_IF_NAMEINDEX. --- ChangeLog | 4 ++++ ifconfig/if_index.c | 16 +++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7d198af..5cb717b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-09-15 Mats Erik Andersson <g...@gisladisker.se> + * ifconfig/if_nameindex.c: Protect using HAVE_STRUCT_IF_NAMEINDEX. + +2010-09-15 Mats Erik Andersson <g...@gisladisker.se> + * telnetd/telnetd.c (login_invocation, argp_options): Access login(1) by detected PATH_LOGIN. diff --git a/ifconfig/if_index.c b/ifconfig/if_index.c index 3518b60..2d2b215 100644 --- a/ifconfig/if_index.c +++ b/ifconfig/if_index.c @@ -38,11 +38,12 @@ #include <ifconfig.h> +#ifndef HAVE_STRUCT_IF_NAMEINDEX unsigned int if_nametoindex (const char *ifname) { int result = 0; -#ifdef SIOCGIFINDEX +# ifdef SIOCGIFINDEX { int fd = socket (AF_INET, SOCK_DGRAM, 0); if (fd >= 0) @@ -57,7 +58,7 @@ if_nametoindex (const char *ifname) return ifr.ifr_index; } } -#endif +# endif /* SIOCGIFINDEX */ { struct if_nameindex *idx; idx = if_nameindex (); @@ -95,7 +96,7 @@ if_freenameindex (struct if_nameindex *ifn) struct if_nameindex * if_nameindex (void) { -#if defined SIOCGIFCONF +# if defined SIOCGIFCONF int fd = socket (AF_INET, SOCK_DGRAM, 0); struct ifconf ifc; unsigned int i = 0; @@ -163,11 +164,11 @@ if_nameindex (void) return NULL; } -# if defined SIOCGIFINDEX +# if defined SIOCGIFINDEX if (ioctl (fd, SIOCGIFINDEX, cur) >= 0) idx[i].if_index = cur->ifr_index; else -# endif +# endif idx[i].if_index = i + 1; i++; } @@ -191,8 +192,9 @@ if_nameindex (void) close (fd); return idx; -#else +# else /* !SIOCGIFCONF */ errno = ENOSYS; return NULL; -#endif +# endif } +#endif /* HAVE_STRUCT_IF_NAMEINDEX */ -- 1.6.3.3
signature.asc
Description: Digital signature