SunOS 4.1 in.comsat kit (was Re: 4.1.1, biff, & in.comsat)
John Palkovic
palkovic at tomato.fnal.gov
Thu Apr 18 15:48:09 AEST 1991
I sent email but cs.umn.edu is refusing smtp connections.
>>>>> On 17 Apr 91 15:46:08 GMT, woehrle at cs.umn.edu (Tom Woehrle) said:
Tom> Word has it that the reason for biff not working under 4.1.1 for
Tom> users with user names of length 8 is due to a bug in in.comsat.
Tom> Does anyone know where I can get a working in.comsat?
This is a shar file that will allow you to build a working in.comsat
on SunOS 4.1. I just verified that it compiled and linked on a 4.1.1
system, but I don't have the access needed to test it there.
Enjoy,
-John
#!/bin/sh
# This is a shell archive (shar 3.46)
# made 04/18/1991 05:38 UTC by palkovic at linac
# Source directory /home/palkovic/sun/comsat
#
# existing files will NOT be overwritten unless -c is specified
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 373 -rw-r--r-- README
# 2266 -rw-r--r-- diffs
# 363 -rw-r--r-- strerror.c
#
# ============= README ==============
if test -f 'README' -a X"$1" != X"-c"; then
echo 'x - skipping README (File already exists)'
else
echo 'x - extracting README (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'README' &&
How to build a working SunOS 4.1 in.comsat.
X
1) Get the source for comsat from ftp.uu.net:/bsd-sources/libexec/comsat
2) Get paths.h from ftp.uu.net:/bsd-sources/include
3) Apply these diffs with patch(1) to the Makefile and paths.h
4) Type 'make'.
X
The strerror.c is from the C news source. Thanks to Henry Spencer and
Geoff Collyer for this.
X
-John Palkovic Apr 18, 1991
SHAR_EOF
chmod 0644 README ||
echo 'restore of README failed'
Wc_c="`wc -c < 'README'`"
test 373 -eq "$Wc_c" ||
echo 'README: original size 373, current size' "$Wc_c"
fi
# ============= diffs ==============
if test -f 'diffs' -a X"$1" != X"-c"; then
echo 'x - skipping diffs (File already exists)'
else
echo 'x - extracting diffs (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'diffs' &&
*** orig/Makefile Thu Apr 18 00:20:16 1991
--- Makefile Tue Mar 12 00:31:04 1991
***************
*** 1,6 ****
! # @(#)Makefile 5.3 (Berkeley) 5/11/90
X
- PROG= comsat
- MAN8= comsat.0
X
! .include <bsd.prog.mk>
--- 1,8 ----
! CFLAGS= -O -I.
X
X
! comsat: strerror.o comsat.o
! cc -o in.comsat comsat.o strerror.o -I.
!
! clean:
! rm -f in.comsat a.out core *.o
*** orig/paths.h Thu Apr 18 00:21:38 1991
--- paths.h Mon Feb 11 22:04:21 1991
***************
*** 26,38 ****
X #define _PATH_DEVNULL "/dev/null"
X #define _PATH_DRUM "/dev/drum"
X #define _PATH_KMEM "/dev/kmem"
! #define _PATH_MAILDIR "/var/mail"
X #define _PATH_MAN "/usr/man"
X #define _PATH_MEM "/dev/mem"
X #define _PATH_NOLOGIN "/etc/nologin"
! #define _PATH_SENDMAIL "/usr/sbin/sendmail"
X #define _PATH_TMP "/tmp/"
X #define _PATH_TTY "/dev/tty"
X #define _PATH_UNIX "/vmunix"
X #define _PATH_VARTMP "/var/tmp"
! #define _PATH_VI "/usr/bin/vi"
--- 26,38 ----
X #define _PATH_DEVNULL "/dev/null"
X #define _PATH_DRUM "/dev/drum"
X #define _PATH_KMEM "/dev/kmem"
! #define _PATH_MAILDIR "/var/spool/mail"
X #define _PATH_MAN "/usr/man"
X #define _PATH_MEM "/dev/mem"
X #define _PATH_NOLOGIN "/etc/nologin"
! #define _PATH_SENDMAIL "/usr/lib/sendmail"
X #define _PATH_TMP "/tmp/"
X #define _PATH_TTY "/dev/tty"
X #define _PATH_UNIX "/vmunix"
X #define _PATH_VARTMP "/var/tmp"
! #define _PATH_VI "/usr/ucb/vi"
*** orig/comsat.c Thu Apr 18 00:20:18 1991
--- comsat.c Wed Apr 17 14:55:22 1991
***************
*** 51,56 ****
--- 51,61 ----
X
X #define MAXIDLE 120
X
+ #ifdef _PATH_MAILDIR
+ #undef _PATH_MAILDIR
+ #define _PATH_MAILDIR "/var/spool/mail"
+ #endif
+
X char hostname[MAXHOSTNAMELEN];
X struct utmp *utmp = NULL;
X time_t lastmsgtime, time();
***************
*** 67,72 ****
--- 72,78 ----
X struct sockaddr_in from;
X int fromlen;
X void onalrm(), reapchildren();
+ char *_PATH_UTMP = "/etc/utmp";
X
X /* verify proper invocation */
X fromlen = sizeof(from);
***************
*** 153,159 ****
X register char *cp;
X off_t offset;
X
! if (!(cp = index(name, '@')))
X return;
X *cp = '\0';
X offset = atoi(cp + 1);
--- 159,165 ----
X register char *cp;
X off_t offset;
X
! if (!(cp = (char *) index(name, '@')))
X return;
X *cp = '\0';
X offset = atoi(cp + 1);
SHAR_EOF
chmod 0644 diffs ||
echo 'restore of diffs failed'
Wc_c="`wc -c < 'diffs'`"
test 2266 -eq "$Wc_c" ||
echo 'diffs: original size 2266, current size' "$Wc_c"
fi
# ============= strerror.c ==============
if test -f 'strerror.c' -a X"$1" != X"-c"; then
echo 'x - skipping strerror.c (File already exists)'
else
echo 'x - extracting strerror.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'strerror.c' &&
/*
X * strerror - map error number to descriptive string
X *
X * This version is obviously somewhat Unix-specific.
X */
char *
strerror(errnum)
int errnum;
{
X extern int sys_nerr;
X extern char *sys_errlist[];
X
X if (errnum > 0 && errnum < sys_nerr)
X return(sys_errlist[errnum]);
X else if (errnum != 0)
X return("unknown error");
X else
X return("no details given");
}
SHAR_EOF
chmod 0644 strerror.c ||
echo 'restore of strerror.c failed'
Wc_c="`wc -c < 'strerror.c'`"
test 363 -eq "$Wc_c" ||
echo 'strerror.c: original size 363, current size' "$Wc_c"
fi
exit 0
More information about the Alt.sources
mailing list