entered into RCS

This commit is contained in:
Miles Bader
1996-07-10 23:21:46 +00:00
parent 8826bbefec
commit f188b1ef9e
25 changed files with 188 additions and 75 deletions

View File

@@ -50,17 +50,31 @@ LDFLAGS = @LDFLAGS@
RM = @RM@
MKINSTDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs
LIBCURSES=@LIBCURSES@
LIBAUTH=@LIBAUTH@
LIBTERMCAP=@LIBTERMCAP@
CPPFLAGS += $(DEFS) -D_BSD_SOURCE -I$(srcdir) -I../include
LDLIBS += $(LIBS) -L../libinetutils -linetutils
LDLIBS += -L../libinetutils -linetutils $(LIBS)
RULES = $(top_srcdir)/rules.make
# Link or copy every file in $(DISTFILES) into $(DISTDIR)
define LINK_DISTFILES
@for FILE in $(DISTFILES); do \
{ ln 2>/dev/null $(srcdir)/$$FILE $(DISTDIR) \
&& echo ln $(srcdir)/$$FILE $(DISTDIR); } \
|| { echo cp -p $(srcdir)/$$FILE $(DISTDIR) \
; cp -p $(srcdir)/$$FILE $(DISTDIR); }; \
done
# Link or copy the file $$DISTFILE (a shell variable) into $(DISTDIR)
define _LINK_DISTFILE
{ { ln 2>/dev/null $$DISTFILE $(DISTDIR) \
&& echo ln $$DISTFILE $(DISTDIR); } \
|| { echo cp -p $$DISTFILE $(DISTDIR) \
; cp -p $$DISTFILE $(DISTDIR); }; }
endef
# Link or copy every file in $(DISTFILES) + Makefile.in from $(srcdir)
# and any file in $(OPT_DISTFILE) that exists in the current directory,
# into $(DISTDIR)
define LINK_DISTFILES
@for FILE in Makefile.in $(DISTFILES); do \
DISTFILE=$(srcdir)/$$FILE; $(_LINK_DISTFILE); \
done
@for DISTFILE in $(OPT_DISTFILES); do \
test -e "$$DISTFILE" && $(_LINK_DISTFILE) || :; \
done
endef

View File

@@ -14,6 +14,11 @@ AC_SUBST(CLIENTS)
SUBDIRS="$SERVERS $CLIENTS $COMMON"
AC_SUBST(SUBDIRS)
# Optional things we put into libinetutils (we use the name `LIBOBJS' because
# that's what AC_REPLACE_FUNCS uses).
LIBOBJS=''
AC_SUBST(LIBOBJS)
AC_ARG_ENABLE(encryption, [ --enable-encryption enable encryption],
, enable_encryption=no)
AC_ARG_ENABLE(authentication,
@@ -40,15 +45,35 @@ AC_PATH_PROG(RM, rm, rm)
AC_CHECK_HEADERS(malloc.h termio.h termios.h sys/tty.h sys/utsname.h \
sys/msgbuf.h krb.h des.h netinet/in_systm.h \
netinet/ip.h netinet/ip_icmp.h netinet/ip_var.h paths.h)
AC_CHECK_FUNCS(cgetent uname strdup)
AC_CHECK_LIB(util, logout)
AC_CHECK_FUNCS(cgetent uname strdup setutent_r logwtmp)
if test "$enable_encryption" = yes -o "$enable_authentication" = yes; then
AC_CHECK_LIB(krb, krb_mk_req)
AC_CHECK_LIB(des, des_key_sched)
AC_CHECK_LIB(krb, krb_mk_req, LIBAUTH=-lkrb)
AC_CHECK_LIB(des, des_key_sched, LIBAUTH="$LIBAUTH -ldes")
AC_SUBST(LIBAUTH)
fi
# If there's no libtermcap, add a bogus version of tgetent to libinetutils,
# as that's the only function actually used (except for dependencies from
# curses).
AC_CHECK_LIB(termcap, tgetent,
LIBTERMCAP=-ltermcap,
LIBOBJS="$LIBOBJS stub_tgetent.o")
AC_SUBST(LIBTERMCAP)
# Only talk uses curses
if test "$enable_talk" != no; then
AC_CHECK_LIB(curses, printw)
if test "$ac_cv_lib_termcap" != yes; then
# Curses needs termcap. This should be generalized
ac_cv_lib_curses=no
else
AC_CHECK_LIB(curses, printw, LIBCURSES="-lcurses $LIBTERMCAP")
fi
fi
AC_SUBST(LIBCURSES)
AC_TYPE_SIGNAL
# Use `setpgid' if it's around, otherwise assume a BSD setpgrp
@@ -114,11 +139,6 @@ if test "$enable_encryption" = yes -a "$ac_cv_lib_des" = yes; then
AC_DEFINE(DES_ENCRYPTION)
fi
# Optional things we put into libinetutils (we use the name `LIBOBJS' because
# that's what AC_REPLACE_FUNCS uses).
LIBOBJS=''
AC_SUBST(LIBOBJS)
# include files for libinetutils that we use
LIB_INCLUDES=version.h

View File

@@ -23,7 +23,8 @@ include ../config.make
INSTALL_TARGETS = $(bindir)/ftp $(man1dir)/ftp.1
SRCS = cmds.c cmdtab.c ftp.c main.c ruserpass.c domacro.c
DISTFILES = $(SRCS) ftp.1 Makefile.in
HDRS = ftp_var.h extern.h
DISTFILES = $(SRCS) $(HDRS) ftp.1
all: ftp
ftp: $(SRCS:.c=.o)

View File

@@ -23,7 +23,9 @@ include ../config.make
INSTALL_TARGETS = $(libexecdir)/in.ftpd $(man8dir)/ftpd.8
SRCS = ftpd.c ftpcmd.y logwtmp.c popen.c
DISTFILES = $(SRCS) ftpd.8 Makefile.in
DISTFILES = $(SRCS) extern.h ftpd.8
OPT_DISTFILES = ftpcmd.c
MAINTCLEAN = ftpcmd.c
CPPFLAGS += \
-D_PATH_FTPUSERS=\"$(sysconfdir)/ftpusers\" \

View File

@@ -1,4 +1,27 @@
/*
SYSVish version:
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
* BSDish version:
*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -47,8 +70,6 @@ static char sccsid[] = "@(#)logwtmp.c 8.1 (Berkeley) 6/4/93";
#include <string.h>
#include "extern.h"
static int fd = -1;
/*
* Modified version of logwtmp that holds wtmp file open
* after first call, for use with ftp (which may chroot
@@ -58,18 +79,62 @@ void
logwtmp(line, name, host)
const char *line, *name, *host;
{
struct utmp ut;
/* Set information in new entry. */
bzero (&ut, sizeof (ut));
#if _HAVE_UT_TYPE - 0
ut.ut_type = USER_PROCESS;
#endif
strncpy (ut.ut_line, line, sizeof ut.ut_line);
strncpy (ut.ut_name, name, sizeof ut.ut_name);
#if _HAVE_UT_HOST - 0
strncpy (ut.ut_host, host, sizeof ut.ut_host);
#endif
#if _HAVE_UT_TV - 0
gettimeofday (&ut.ut_tv, NULL);
#else
time (&ut.ut_time);
#endif
#ifdef HAVE_SETUTENT_R
/* XXX I think frobbing the details of DATA is GNU libc specific. */
{
static struct utmp_data data = { -1 };
if (data.ut_fd < 0)
/* Open the file. */
{
/* Tell that we want to use the WTMP file. */
if (utmpname (_PATH_WTMP) == 0)
return;
/* Open WTMP file. */
setutent_r (&data);
}
/* Position at end of file. */
data.loc_utmp = lseek (data.ut_fd, 0, SEEK_END);
if (data.loc_utmp == -1)
return;
/* Write the entry. */
pututline_r (&ut, &data);
}
#else
{
struct utmp ut;
struct stat buf;
static int fd = -1;
if (fd < 0 && (fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) < 0)
return;
if (fstat(fd, &buf) == 0) {
(void)strncpy(ut.ut_line, line, sizeof(ut.ut_line));
(void)strncpy(ut.ut_name, name, sizeof(ut.ut_name));
(void)strncpy(ut.ut_host, host, sizeof(ut.ut_host));
(void)time(&ut.ut_time);
if (write(fd, (char *)&ut, sizeof(struct utmp)) !=
sizeof(struct utmp))
(void)ftruncate(fd, buf.st_size);
}
}
#endif
}

View File

@@ -22,8 +22,7 @@ top_srcdir = @top_srcdir@
include ../config.make
INSTALL_TARGETS = $(sbindir)/inetd $(man8dir)/inetd.8
SRCS = inetd.c
DISTFILES = $(SRCS) inetd.8 Makefile.in
DISTFILES = inetd.c inetd.8
CPPFLAGS += -D_PATH_INETDCONF=\"$(sysconfdir)/inetd.conf\"

View File

@@ -21,14 +21,13 @@ srcdir = @srcdir@
top_srcdir = @top_srcdir@
include ../config.make
SRCS = ttymsg.c version.c @LIBOBJS@
DISTFILES = $(SRCS) version.h getopt.h Makefile.in
OBJS = $(SRCS:.c=.o)
SRCS = ttymsg.c version.c getopt.c getopt1.c stub_tgetent.c
HDRS = version.h getopt.h
DISTFILES = $(SRCS) $(HDRS)
all: libinetutils.a
libinetutils.a: $(OBJS)
$(AR) rcv $@ $(OBJS)
libinetutils.a: ttymsg.o version.o @LIBOBJS@
$(AR) rcv $@ $?
$(RANLIB) $@
clean:

View File

@@ -22,14 +22,16 @@ top_srcdir = @top_srcdir@
include ../config.make
INSTALL_TARGETS = $(libdir)/libtelnet.a
SRCS = auth.c encrypt.c genget.c getent.c misc.c kerberos.c enc_des.c kerberos5.c
DISTFILES = $(SRCS) Makefile.in
SRCS = auth.c enc_des.c encrypt.c genget.c getent.c kerberos.c kerberos5.c \
krb4encpwd.c misc.c read_password.c rsaencpwd.c spx.c
HDRS = auth-proto.h auth.h enc-proto.h encrypt.h key-proto.h misc-proto.h misc.h
DISTFILES = $(SRCS) $(HDRS)
OBJS = $(SRCS:.c=.o)
all: libtelnet.a
libtelnet.a: $(OBJS)
$(AR) rcv $@ $(OBJS)
$(AR) rcv $@ $?
$(RANLIB) $@
clean:

View File

@@ -23,7 +23,7 @@ include ../config.make
INSTALL_TARGETS = $(bindir)/rcp $(man1dir)/rcp.1
SRCS = rcp.c util.c
DISTFILES = $(SRCS) rcp.1 Makefile.in
DISTFILES = $(SRCS) extern.h rcp.1
CPPFLAGS += -D_PATH_CP=\"$(bindir)/cp\" -D_PATH_RSH=\"$(bindir)/rsh\"

View File

@@ -22,8 +22,7 @@ top_srcdir = @top_srcdir@
include ../config.make
INSTALL_TARGETS=$(libexecdir)/in.rexecd $(man8dir)/rexecd.8
SRCS = rexecd.c
DISTFILES = $(SRCS) rexecd.8 Makefile.in
DISTFILES = rexecd.c rexecd.8
all: rexecd

View File

@@ -21,10 +21,9 @@ srcdir = @srcdir@
top_srcdir = @top_srcdir@
include ../config.make
INST_PROG_FLAGS=-o root -m 04755
INSTALL_TARGETS = $(bindir)/rlogin $(man1dir)/rlogin.1
SRCS = rlogin.c
DISTFILES = $(SRCS) rlogin.1 Makefile.in
INST_PROG_FLAGS=-o root -m 04755
DISTFILES = rlogin.c krb.h rlogin.1
all: rlogin

View File

@@ -22,8 +22,7 @@ top_srcdir = @top_srcdir@
include ../config.make
INSTALL_TARGETS = $(libexecdir)/in.rlogind $(man8dir)/rlogind.8
SRCS = rlogind.c
DISTFILES = $(SRCS) rlogind.8 Makefile.in
DISTFILES = rlogind.c rlogind.8
CPPFLAGS += -D_PATH_LOGIN=\"$(bindir)/login\"

View File

@@ -22,8 +22,7 @@ top_srcdir = @top_srcdir@
include ../config.make
INSTALL_TARGETS = $(bindir)/rsh $(man1dir)/rsh.1
SRCS = rsh.c
DISTFILES = $(SRCS) rsh.1 Makefile.in
DISTFILES = rsh.c rsh.1
CPPFLAGS += -D_PATH_RLOGIN=\"$(bindir)/rlogin\"

View File

@@ -22,8 +22,7 @@ top_srcdir = @top_srcdir@
include ../config.make
INSTALL_TARGETS = $(libexecdir)/in.rshd $(man8dir)/rshd.8
SRCS = rshd.c
DISTFILES = $(SRCS) rshd.8 Makefile.in
DISTFILES = rshd.c rshd.8
all: rshd

View File

@@ -24,7 +24,9 @@ uninstall: -$(RM) -f $(INSTALL_TARGETS)
mostlyclean: clean
distclean: clean
$(RM) -f Makefile
$(RM) -f Makefile $(DISTCLEAN)
maintainer-clean: distclean
$(RM) -f $(MAINTCLEAN)
dist: $(DISTFILES)
$(LINK_DISTFILES)

View File

@@ -22,8 +22,7 @@ top_srcdir = @top_srcdir@
include ../config.make
INSTALL_TARGETS = $(bindir)/syslog $(bindir)/logger $(man1dir)/syslog.1
SRCS = syslog.c
DISTFILES = $(SRCS) syslog.1 Makefile.in
DISTFILES = syslog.c syslog.1
all: syslog

View File

@@ -23,8 +23,7 @@ include ../config.make
INSTALL_TARGETS = \
$(sbindir)/syslogd $(man5dir)/syslog.conf.5 $(man8dir)/syslogd.8
SRCS = syslogd.c
DISTFILES = $(SRCS) syslogd.8 syslog.conf.5 Makefile.in
DISTFILES = syslogd.c syslogd.8 syslog.conf.5
CPPFLAGS += \
-D_PATH_LOGCONF=\"$(sysconfdir)/syslog.conf\" \

View File

@@ -22,11 +22,12 @@ top_srcdir = @top_srcdir@
include ../config.make
INSTALL_TARGETS = $(bindir)/talk $(man1dir)/talk.1
SRCS = talk.c ctl.c ctl_transact.c display.c get_addrs.c get_names.c \
init_disp.c invite.c io.c look_up.c msgs.c
DISTFILES = $(SRCS) talk.1 Makefile.in
SRCS = talk.c ctl.c ctl_transact.c display.c get_addrs.c get_names.c \
init_disp.c invite.c io.c look_up.c msgs.c
HDRS = talk.h talk_ctl.h
DISTFILES = $(SRCS) $(HDRS) talk.1
LDLIBS := -lcurses -ltermcap $(LDLIBS)
LDLIBS := $(LIBCURSES) $(LDLIBS)
all: talk
talk: $(SRCS:.c=.o)

View File

@@ -23,7 +23,7 @@ include ../config.make
INSTALL_TARGETS = $(libexecdir)/in.talkd $(man8dir)/talkd.8
SRCS = talkd.c announce.c process.c table.c print.c
DISTFILES = $(SRCS) talkd.8 Makefile.in
DISTFILES = $(SRCS) talkd.8
all: talkd
talkd: $(SRCS:.c=.o)

View File

@@ -23,13 +23,14 @@ include ../config.make
INSTALL_TARGETS = $(bindir)/telnet $(man1dir)/telnet.1
SRCS = authenc.c commands.c main.c network.c ring.c sys_bsd.c telnet.c \
terminal.c tn3270.c utilities.c
DISTFILES = $(SRCS) telnet.1 Makefile.in
terminal.c tn3270.c utilities.c
HDRS = defines.h externs.h fdset.h general.h krb4-proto.h ring.h types.h
DISTFILES = $(SRCS) $(HDRS) telnet.1
OPTIONS = -DTERMCAP -DLINEMODE -DKLUDGELINEMODE -DENV_HACK
CPPFLAGS += $(OPTIONS)
LDLIBS := -L../libtelnet -ltelnet -ltermcap $(LDLIBS)
LDLIBS := -L../libtelnet -ltelnet $(LIBTERMCAP) $(LDLIBS)
all: telnet
telnet: $(SRCS:.c=.o)

View File

@@ -23,13 +23,14 @@ include ../config.make
INSTALL_TARGETS = $(libexecdir)/in.telnetd $(man8dir)/telnetd.8
SRCS = authenc.c global.c slc.c state.c sys_term.c telnetd.c termstat.c \
utility.c
DISTFILES = $(SRCS) telnetd.8 Makefile.in
utility.c
HDRS = defs.h ext.h telnetd.h
DISTFILES = $(SRCS) $(HDRS) telnetd.8
OPTIONS = -DLINEMODE -DKLUDGELINEMODE -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON
CPPFLAGS += $(OPTIONS) -D_PATH_LOGIN=\"$(bindir)/login\"
LDLIBS := -L../libtelnet -ltelnet -ltermcap $(LDLIBS)
LDLIBS := -L../libtelnet -ltelnet $(LIBTERMCAP) $(LDLIBS)
all: telnetd
telnetd: $(SRCS:.c=.o)

View File

@@ -23,7 +23,8 @@ include ../config.make
INSTALL_TARGETS = $(bindir)/tftp $(man1dir)/tftp.1
SRCS = main.c tftp.c tftpsubs.c
DISTFILES = $(SRCS) tftp.1 Makefile.in
HDRS = extern.h tftpsubs.h
DISTFILES = $(SRCS) $(HDRS) tftp.1
all: tftp
tftp: $(SRCS:.c=.o)

View File

@@ -22,8 +22,7 @@ top_srcdir = @top_srcdir@
include ../config.make
INSTALL_TARGETS = $(libexecdir)/in.tftpd $(man8dir)/tftpd.8
SRCS = tftpd.c
DISTFILES = $(SRCS) tftpd.8 Makefile.in
DISTFILES = tftpd.c tftpd.8
CPPFLAGS += -I$(top_srcdir)/tftp

View File

@@ -22,8 +22,7 @@ top_srcdir = @top_srcdir@
include ../config.make
INSTALL_TARGETS = $(libexecdir)/in.uucpd
SRCS = uucpd.c
DISTFILES = $(SRCS) Makefile.in
DISTFILES = uucpd.c
# the /libexec/uucp/... path is consistent with netbsd.
CPPFLAGS += -D_PATH_UUCICO=\"$(libexecdir)/uucp/uucicio\"

View File

@@ -237,22 +237,28 @@ struct utmp utmp;
dologout()
{
union wait status;
int pid, wtmp;
int pid;
#ifdef BSDINETD
while ((pid=wait((int *)&status)) > 0) {
#else !BSDINETD
while ((pid=wait3((int *)&status,WNOHANG,0)) > 0) {
#endif !BSDINETD
wtmp = open(_PATH_WTMP, O_WRONLY|O_APPEND);
#ifdef HAVE_LOGWTMP
char line[100];
sprintf(line, "uucp%.4d", pid);
logwtmp (line, "", "");
#else
int wtmp = open(_PATH_WTMP, O_WRONLY|O_APPEND);
if (wtmp >= 0) {
sprintf(utmp.ut_line, "uucp%.4d", pid);
SCPYN(utmp.ut_name, "");
SCPYN(utmp.ut_host, "");
(void) time(&utmp.ut_time);
(void) write(wtmp, (char *)&utmp, sizeof (utmp));
(void) close(wtmp);
}
#endif
}
}
@@ -275,17 +281,25 @@ struct sockaddr_in *sin;
} else
strncpy(remotehost, inet_ntoa(sin->sin_addr),
sizeof (remotehost));
sprintf(line, "uucp%.4d", getpid());
#ifdef HAVE_LOGWTMP
logwtmp (line, pw->pw_name, remotehost);
#else
/* Do things the old bsd way. */
wtmp = open(_PATH_WTMP, O_WRONLY|O_APPEND);
if (wtmp >= 0) {
/* hack, but must be unique and no tty line */
sprintf(line, "uucp%.4d", getpid());
SCPYN(utmp.ut_line, line);
SCPYN(utmp.ut_name, pw->pw_name);
SCPYN(utmp.ut_name, );
SCPYN(utmp.ut_host, remotehost);
time(&utmp.ut_time);
(void) write(wtmp, (char *)&utmp, sizeof (utmp));
(void) close(wtmp);
}
#endif
#ifdef _PATH_LASTLOG
if ((f = open(_PATH_LASTLOG, O_RDWR)) >= 0) {
struct lastlog ll;