gated 3.6A1 for 1.3.99 (diffs)

Stephen Davies (scldad@sdc.com.au)
Sat, 11 May 1996 13:01:23 +0930 (CST)


Return Receipt To: scldad@sdc.com.au
X-Mailer: ELM [version 2.4 PL24]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 8446

Attached are an autoconfig file for Linux 1.3.9? and a diff file against
the official gated 3.6Alpha1 sources.

These diffs remove the last dependencies on BSD headers, add support for
long shadow passwords to GII and fix a couple of minor interface problems.

Both files have been submitted to Merit and should become part of the
next official release.

With these changes in place, there should no longer be any reason why
anyone should have trouble building their own gated binaries.
(Merit has changed the build process so that sed is no longer a problem)

There are still two "grey" areas to be finalised on the Linux side:
. Alan Cox is looking at the way in which gated tries to use SCM_RIGHTS
. there seems to be an ambiguity regarding defining _BSD_SOURCE and/or
__BSD_SOURCE.

At this stage, I have chosen to #undefine SCM_RIGHTS and to "manually"
#define __BSD_SOURCE in include.h to bypass the problems.

Cheers,
Stephen.

diff -cr gated-R3_6Alpha_1/src/gii.c gated-R3_6Alpha_1_lnx/src/gii.c
*** gated-R3_6Alpha_1/src/gii.c Fri Jan 12 01:28:50 1996
--- gated-R3_6Alpha_1_lnx/src/gii.c Thu May 9 23:50:49 1996
***************
*** 46,51 ****
--- 46,54 ----
#include "dvmrp.h"
#include "dvmrp_targets.h"
#endif
+ #ifdef SHADOW_PASSWD
+ #include <shadow.h>
+ #endif

giimenu_cmd_t giicmd_route[] = {
{ "route", NULL, gii_showrtipall,gii_showrtip,
***************
*** 388,393 ****
--- 391,399 ----
gii_process __PF2(gii_ctl, gii_ctl_t *, ln, char *)
{
struct passwd *pw;
+ #ifdef SHADOW_PASSWD
+ struct spwd *spw;
+ #endif

switch(gii_ctl->g_state) {
case GIIS_OPEN:
***************
*** 400,406 ****
--- 406,417 ----
* password. But first get the crypted password.
*/
pw = getpwnam(GII_USER);
+ #ifdef SHADOW_PASSWD
+ spw = getspnam (pw->pw_name);
+ if (!pw || !pw->pw_passwd || !spw) {
+ #else
if (!pw || !pw->pw_passwd) {
+ #endif
trace_tp(gii_ctl->g_task, 0, LOG_ERR,
("gii_process: no password or user %s",
GII_USER));
***************
*** 413,419 ****
--- 424,434 ----

/* Check the password we got
*/
+ #ifdef SHADOW_PASSWD
+ if(strcmp(spw->sp_pwdp,(char *) pw_encrypt(ln, spw->sp_pwdp)))
+ #else
if (strcmp(pw->pw_passwd, (char *)crypt(ln, pw->pw_passwd)))
+ #endif
return(gii_iden(gii_ctl));

/* Autentifocation succeeded. Go to state GIIS_SESSION.
***************
*** 616,626 ****
if (!gii_ctl) {
/* This is the listen task
*/
! (void) fprintf(fd, "\tGII LISTEN on port %s\n",
ntohs(gii_port));
return;
}
-
/* This is a session task
*/
(void) fprintf(fd, "\tPeer %#A\tState %s\n",
--- 631,640 ----
if (!gii_ctl) {
/* This is the listen task
*/
! (void) fprintf(fd, "\tGII LISTEN on port %-4d\n",
ntohs(gii_port));
return;
}
/* This is a session task
*/
(void) fprintf(fd, "\tPeer %#A\tState %s\n",
diff -cr gated-R3_6Alpha_1/src/include.h gated-R3_6Alpha_1_lnx/src/include.h
*** gated-R3_6Alpha_1/src/include.h Fri Jan 12 01:29:10 1996
--- gated-R3_6Alpha_1_lnx/src/include.h Mon May 6 17:27:47 1996
***************
*** 55,60 ****
--- 55,63 ----
#include <sys/uio.h>

#include <sys/socket.h>
+ #ifdef linux
+ #undef SCM_RIGHTS
+ #endif
#ifdef UNDEF_RCVBUF
#undef SO_RCVBUF
#endif
***************
*** 106,119 ****
#include <netinet/in.h>
#ifdef linux
#include <bsd/bsd.h>
#include <linux/in_systm.h>
- #include <bsd/netinet/ip_var.h>
- #include <bsd/netinet/ip.h>
#else /* linux */
#include <netinet/in_systm.h>
- #include <netinet/ip.h>
#include <netinet/ip_var.h>
#endif /* linux */
#if !defined(HPUX7_X) && !defined(linux)
#include <arpa/inet.h>
#endif /* !defined(HPUX7_X) && !defined(linux) */
--- 109,121 ----
#include <netinet/in.h>
#ifdef linux
#include <bsd/bsd.h>
+ #define __BSD_SOURCE
#include <linux/in_systm.h>
#else /* linux */
#include <netinet/in_systm.h>
#include <netinet/ip_var.h>
#endif /* linux */
+ #include <netinet/ip.h>
#if !defined(HPUX7_X) && !defined(linux)
#include <arpa/inet.h>
#endif /* !defined(HPUX7_X) && !defined(linux) */
***************
*** 201,206 ****
--- 203,211 ----
#endif /* defined(AIX) */

#ifdef INCLUDE_SIGNAL
+ #ifdef linux
+ #undef sigmask
+ #endif
#include <signal.h>
#endif

diff -cr gated-R3_6Alpha_1/src/krt_rtread_proc.c gated-R3_6Alpha_1_lnx/src/krt_rtread_proc.c
*** gated-R3_6Alpha_1/src/krt_rtread_proc.c Fri Jan 12 01:31:03 1996
--- gated-R3_6Alpha_1_lnx/src/krt_rtread_proc.c Mon May 6 21:45:09 1996
***************
*** 75,84 ****
/* read route data from /proc */

/* skip over header line */
! i=fscanf(DFile,"%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%*s\n");

while(!feof(DFile)){
! i=fscanf(DFile,"%s\t%lx\t%lx\t%02x\t%*d\t%*d\t%*d\t%lx\t%*d\t%*d\n",
if_name,
&addr_dest,
&addr_gw,
--- 75,84 ----
/* read route data from /proc */

/* skip over header line */
! i=fscanf(DFile,"%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%*s\n");

while(!feof(DFile)){
! i=fscanf(DFile,"%s\t%lx\t%lx\t%02x\t%*d\t%*d\t%*d\t%lx\t%*d\t%*d\t%*d\n",
if_name,
&addr_dest,
&addr_gw,
diff -cr gated-R3_6Alpha_1/src/util/configure.pl gated-R3_6Alpha_1_lnx/src/util/configure.pl
*** gated-R3_6Alpha_1/src/util/configure.pl Sat Jan 13 05:47:23 1996
--- gated-R3_6Alpha_1_lnx/src/util/configure.pl Tue May 7 21:53:44 1996
***************
*** 332,341 ****
"FLETCHER_CHECKSUM", 0,
"IP_MULTICAST_ROUTING", 0,
"SOCK_BUF_PAGES", 1,
);

#
! # Group of file for diferent program. For each program we have
# C source files (_src), header files (_hdr), man page (_man), link
# (_link) and object (_obj). This is used when generating Makefile.
#
--- 332,342 ----
"FLETCHER_CHECKSUM", 0,
"IP_MULTICAST_ROUTING", 0,
"SOCK_BUF_PAGES", 1,
+ "SHADOW_PASSWD", 0,
);

#
! # Group of files for different program. For each program we have
# C source files (_src), header files (_hdr), man page (_man), link
# (_link) and object (_obj). This is used when generating Makefile.
#
***************
*** 519,525 ****
}

#
! # Create the file <obj>/define.h with the list of define got from
# the options list in the config file + the protocol list
#
&myprint("\nCreating \"$obj/$define_file\"\n");
--- 520,526 ----
}

#
! # Create the file <obj>/define.h with the list of defines got from
# the options list in the config file + the protocol list
#
&myprint("\nCreating \"$obj/$define_file\"\n");
***************
*** 2308,2313 ****
--- 2309,2315 ----
($name eq "ROUTER_ID") && do { last case; };
($name eq "FLETCHER_CHECKSUM") && do { last case; };
($name eq "IP_MULTICAST_ROUTING") && do { last case; };
+ ($name eq "SHADOW_PASSWD") && do { last case; };

($name eq "SOCK_BUF_PAGES") && do {
# Just ask the guy if he gonna install a lot of
===========================================================================
#
# mustang,v 2.0 1996/05/04 12:38:03 Scld
#
# Config file for Mustang a 486 running Linux 1.3.99
#

# the following calls mkdep in the util directory with the (default) -M flag
mkdep ../util/mkdep

# set path_unix to the location of vmlinux on your system

path_unix /usr/src/linux/vmlinux

# set your favourite protocol set. NOTE: gii is required if you want
# to be able to use the Interactive Interface

protocols bgp hello icmp ospf rip gii

# List libraries required for your environment

ldflags -lshadow -ldb

options NO_MBUF_H
options INCLUDE_UNISTD
options INCLUDE_TYPES
options INCLUDE_SOCKIO
options INCLUDE_PATHS
options USE_SETPGRP
options HAVE_DIRENT
options GID_T=int
options POSIX_SIGNALS
options NEED_SIGNAME
options HAVE_WAITPID
options KRT_RTREAD_PROC
options KRT_LLADDR_LINUX
options ROUTES_WO_MBUFS
options KRT_IFREAD_IOCTL
options KRT_RT_IOCTL
options PROTO_ICMP
options KRT_SYMBOLS_PROC
options KRT_SOCKET_TYPE=PF_INET,SOCK_DGRAM,AF_UNSPEC
options KVM_TYPE_NONE
options VARIABLE_MASKS
options KRT_IPMULTI_TTL0
options SHADOW_PASSWD
options tzsetwall()={unsetenv("TZ");tzset();}
========================================================================================
Stephen Davies Consulting scldad@sdc.com.au
Adelaide, South Australia. Voice: 61-8-2728863
Computing & Network solutions. Fax : 61-8-2741015