Compare commits

...
66 Commits
Author SHA1 Message Date
cvs2svn c2429c4972 This commit was manufactured by cvs2svn to create tag
'RELENG_4_4_0_RELEASE'.
2002-02-04 19:23:43 +00:00
cvs2svn b3ea8abeca This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2002-02-04 19:23:42 +00:00
Jacques Vidrine 9164545f1e This time for sure ... revision 1.3 was supposed to be on this branch.
Don't use __FBSDID here because we don't have it.
2002-01-29 17:44:37 +00:00
Warner Losh 5eae6b2562 Note changes to standard-supfile, sdiff and gzip. We are now at p7. 2002-01-28 02:30:13 +00:00
Jacques Vidrine a7e451a639 MFC 1.2: Fix temporary file handling. 2002-01-28 01:29:51 +00:00
Jacques Vidrine 3308a3ac7d MFC 1.6: Use mktemp(1) when creating temporary files. 2002-01-28 01:29:22 +00:00
Crist J. Clark c41cb731de The 'standard-supfile' should track its own branch.
Approved by:	security-officer@
2002-01-28 00:03:14 +00:00
Warner Losh 6a53694e24 Move 4.3 header info. Add p3 and p4. 2002-01-27 07:17:59 +00:00
Jacques Vidrine e4f98b94ab Eliminate ptrace/exec race.
MFC 1.191 src/sys/sys/proc.h
MFC 1.44  src/sys/kern/kern_exec.c (execve)
   Add P_INEXEC flag to indicate that a process is currently exec'ing.

sys/kern/sys_process.c (ptrace)
sys/miscfs/procfs/...
   Do not allow debugging of a process during exec.
2002-01-23 23:05:54 +00:00
Jacques Vidrine 5d95e0d37d Bump patchlevel for fixes to k5su and fstatfs. 2002-01-17 15:47:04 +00:00
Jacques Vidrine 2288c0a175 MFC 1.216: Return EBADF if some vnode field has been reset to a NULL pointer. 2002-01-17 15:46:11 +00:00
Jacques Vidrine 300d4a9e1c MFC 1.1.1.4: Don't use getlogin() to determine whether we are root. 2002-01-17 15:45:27 +00:00
Hiroki Sato 31c540a7bf Fix the footer in Japanese which is likely to mislead
the readers.
2002-01-03 17:42:38 +00:00
Jacques Vidrine b1008d49cf Bump patchlevel for fix to pw(8). 2001-12-21 19:47:50 +00:00
Jacques Vidrine 5b5ef9ff47 MFC 1.18: Use correct mode for temporary file. 2001-12-21 15:23:04 +00:00
Wes Peters 137f467304 MFC directory permission fix.
Approved by:    security-officer
2001-12-07 20:58:46 +00:00
Jacques Vidrine db2fa549af MFC 1.9: Update version string since we applied a fix for the UseLogin issue. 2001-12-03 22:49:18 +00:00
Jacques Vidrine 4e12eb754a p1: fix for OpenSSH `UseLogin yes' environment issue. 2001-12-03 13:15:23 +00:00
Jacques Vidrine ed0a425074 MFC 1.18: Do not pass user-defined environmental variables to /usr/bin/login. 2001-12-03 00:54:54 +00:00
Hiroki Sato beee7146bb Merge Japanese version of RELENG_4_4 relnotes and errata. 2001-09-24 17:14:08 +00:00
cvs2svn 289aac082e This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-09-24 12:56:53 +00:00
cvs2svn 09e559d6bf This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-09-24 12:38:08 +00:00
Murray Stokely ae46147b46 MFS: Don't use kern.disks sysctl.
Makefile (rev 1.27.2.5)
     disk.c (rev 1.50.2.14)
2001-09-18 15:16:21 +00:00
Bruce A. Mah 414cbe64a2 Document disabling of ~/.login_conf.
Submitted by:	rwatson
Approved by:	re (implicitly)
2001-09-17 16:41:36 +00:00
Jordan K. Hubbard e7ca883fb4 MFC: Usual collection of 11th-hour glitches:
o Close login_cap hole by temporarily disabling $HOME login caps
o Fix multiple value returns with DHCP in sysinstall
o Add some misc FTP mirrors as one contribution towards world peace.
2001-09-17 07:30:17 +00:00
Murray Stokely 09e706bdbe MFC (rev 1.196) : The ports collection takes up 100MB of space, not
70MB.

Approved by:	jkh
2001-09-16 03:44:13 +00:00
Akinori MUSHA 95e99f0475 MFC: print/ghostscript6-nox11 -> print/ghostscript-gnu-nox11
Approved by:    jkh
2001-09-15 05:40:00 +00:00
Jordan K. Hubbard 1ab7d89a29 MFFC: RTSOL check fix 2001-09-15 02:58:59 +00:00
Bruce A. Mah 9ec5b03f78 MF4S: savecore(8) on the Alpha works.
Approved by:	jkh
2001-09-14 19:35:01 +00:00
Bruce A. Mah 26fbaf095b Note a problem in printcap(5) comment handling which will not be fixed
before 4.4-RELEASE.

Submitted by:	asmodai
Approved by:	jkh
2001-09-14 19:03:53 +00:00
Bruce A. Mah 326e527006 Trim errata for 4.4-RELEASE.
Approved by:	jkh
2001-09-14 18:52:55 +00:00
Bruce A. Mah ebf8311d3f Update release documentation entities for 4.4-RELEASE.
Approved by:	jkh
2001-09-14 18:44:22 +00:00
Poul-Henning Kamp 355a9e77ac MFC: missing {} made most/all scripted installs fail.
Approved by:	jkh
2001-09-14 18:31:38 +00:00
Bruce A. Mah 0d632bf022 MFC: Polish Books and Articles section.
Approved by:	jkh
2001-09-14 18:21:05 +00:00
Warner Losh 9278c6c21f As discussed in a number of different forums, make updating target be
for the 4.4 branch instead of the 4 branch.
2001-09-14 17:47:51 +00:00
Warner Losh 92728a8982 First best guess for 4.4 release date 2001-09-14 17:46:19 +00:00
Warner Losh f347313ee1 MFC: docs for pccard_ether_delay 2001-09-14 17:38:25 +00:00
Warner Losh 8f2132bbf7 MFS: small delay when starting up dhclient to avoid ed hang bug. 2001-09-14 17:32:25 +00:00
Jordan K. Hubbard 6320e089a3 Bump this to 4.4-RELEASE off the release tag. 2001-09-14 16:30:08 +00:00
cvs2svn 9622c88bb6 This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-09-11 21:06:21 +00:00
cvs2svn 390987ad32 This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-09-05 17:05:27 +00:00
cvs2svn 2f18471c5b This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-09-05 10:00:07 +00:00
cvs2svn a33a14a17e This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-09-05 09:14:01 +00:00
cvs2svn 671b1ed0c8 This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-09-05 09:10:02 +00:00
cvs2svn 5b8b8fac00 This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-09-05 05:50:13 +00:00
cvs2svn 661208396d This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-09-05 00:22:12 +00:00
cvs2svn 8a3dd877cd This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-08-31 20:03:17 +00:00
cvs2svn 6637deed20 This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-08-28 03:45:48 +00:00
cvs2svn cb4a44d6f2 This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-08-24 19:47:06 +00:00
cvs2svn 6f324f98fc This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-08-23 22:42:42 +00:00
cvs2svn d0dbb4fe68 This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-08-23 16:27:42 +00:00
cvs2svn 7c0da636a5 This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-08-17 22:47:14 +00:00
cvs2svn 357bdc2407 This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-08-17 13:08:59 +00:00
cvs2svn cdef692bc0 This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-08-15 19:35:14 +00:00
cvs2svn 3122ea36c8 This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-08-15 18:02:29 +00:00
cvs2svn 4e2c43952b This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-08-12 14:29:20 +00:00
cvs2svn 70a72dca6f This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-08-12 10:48:01 +00:00
cvs2svn 94597b54af This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-05-17 12:33:40 +00:00
cvs2svn 3bddebe8ad This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-04-11 21:50:14 +00:00
cvs2svn 4d8fea4200 This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-03-22 00:28:36 +00:00
cvs2svn a6d81ef744 This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2001-03-04 13:29:37 +00:00
cvs2svn ac3575e18b This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2000-06-28 19:19:05 +00:00
cvs2svn 571b0eac5e This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2000-03-13 04:59:48 +00:00
cvs2svn eea9ea0d6f This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2000-03-13 04:59:47 +00:00
cvs2svn fccf0e18e5 This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2000-03-13 04:59:46 +00:00
cvs2svn dd85ad4dc8 This commit was manufactured by cvs2svn to create branch 'RELENG_4_4'. 2000-03-13 04:59:45 +00:00
389 changed files with 130 additions and 48685 deletions

No files matched your search

+1 -1
View File
@@ -508,7 +508,7 @@ update:
@echo "--------------------------------------------------------------"
@echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; cvs -q update -rRELENG_4 -P -d
cd ${.CURDIR}; cvs -q update -rRELENG_4_4 -P -d
.endif
#
+3
View File
@@ -9,6 +9,9 @@ A reverse chronology since 4.0 was released is included, followed by
the common items quick how-tos, followed by entries for versions of
-current prior to 4.0 Release.
20010915:
FreeBSD 4.4-RELEASE.
20010814:
The pci attachment for pcic device was merged from current. You
should update your pccardd at the same time as you update your
-4
View File
@@ -1,4 +0,0 @@
Authors of GNU CVS
Um, yeah. There were lots of 'em. See the "Credits" section of the
README file and the individual ChangeLog files for more.
-66
View File
@@ -1,66 +0,0 @@
## Process this file with automake to produce Makefile.in
# Master Makefile for the GNU Concurrent Versions System.
# Copyright (C) 1986, 1988-1992, 1994, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program 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 General Public License for more details.
AUTOMAKE_OPTIONS = 1.4a dist-bzip2
## Subdirectories to run make in for the primary targets.
# Unix source subdirs, where we'll want to run lint and etags:
# This is a legacy variable from b4 Automake
USOURCE_SUBDIRS = lib zlib diff src
# All other subdirs:
SUBDIRS = $(USOURCE_SUBDIRS) man doc contrib tools \
windows-NT os2 emx vms
EXTRA_DIST = \
.cvsignore \
BUGS \
ChangeLog.zoo \
DEVEL-CVS \
FAQ \
HACKING \
MINOR-BUGS \
PROJECTS \
README.VMS \
TESTS \
build.com \
cvs-format.el \
cvs.spec \
cvs.spec.in \
cvsnt.dsp \
cvsnt.dsw \
cvsnt.mak
.PHONY: remotecheck
remotecheck: all
cd src && $(MAKE) $(AM_MAKEFLAGS) "$@"
.PHONY: doc
doc:
cd doc && $(MAKE) $(AM_MAKEFLAGS) "$@"
## MAINTAINER Targets
## cvs.spec ##
# - cvs.spec needs to be updated only once, since it depends on
# configure.in, not on the results of a 'configure' run.
# - It is guaranteed (with GNU Make) that when the version in configure.in
# is changed, acversion.m4 is built only after the new version number is
# propagated to the Makefile. (Libtool uses the same guarantee.)
cvs.spec: $(srcdir)/cvs.spec.in $(top_srcdir)/configure.in
sed 's,@VERSION\@,$(VERSION),g' $(srcdir)/cvs.spec.in >cvs.tspec
mv cvs.tspec $(srcdir)/cvs.spec
# for backwards compatibility with the old makefiles
.PHONY: realclean
realclean: maintainer-clean
-231
View File
@@ -1,231 +0,0 @@
/* This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program 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 General Public License for more details. */
AC_DEFUN(ACX_WITH_GSSAPI,[
#
# Use --with-gssapi[=DIR] to enable GSSAPI support.
#
# defaults to enabled with DIR in default list below
#
# Search for /SUNHEA/ and read the comments about this default below.
#
AC_ARG_WITH([gssapi],
[ --with-gssapi=value GSSAPI directory],
[acx_gssapi_withgssapi=$withval], [acx_gssapi_withgssapi=yes])dnl
dnl
dnl FIXME - cache withval and obliterate later cache values when options change
dnl
#
# Try to locate a GSSAPI installation if no location was specified, assuming
# GSSAPI was enabled (the default).
#
if test -n "$acx_gssapi_cv_gssapi"; then
# Granted, this is a slightly ugly way to print this info, but the
# AC_CHECK_HEADER used in the search for a GSSAPI installation makes using
# AC_CACHE_CHECK worse
AC_MSG_CHECKING([for GSSAPI])
else :; fi
AC_CACHE_VAL([acx_gssapi_cv_gssapi], [
if test x$acx_gssapi_withgssapi = xyes; then
# --with but no location specified
# assume a gssapi.h or gssapi/gssapi.h locates our install.
#
# This isn't always strictly true. For instance Solaris 7's SUNHEA (header)
# package installs gssapi.h whether or not the necessary libraries are
# installed. I'm still not sure whether to consider this a bug. The long
# way around is to not consider GSSPAI installed unless gss_import_name is
# found, but that brings up a lot of other hassles, like continuing to let
# gcc & ld generate the error messages when the user uses --with-gssapi=dir
# as a debugging aid. The short way around is to disable GSSAPI by default,
# but I think Sun users have been faced with this for awhile and I haven't
# heard many complaints.
acx_gssapi_save_CPPFLAGS=$CPPFLAGS
for acx_gssapi_cv_gssapi in yes /usr/kerberos /usr/cygnus/kerbnet no; do
if test x$acx_gssapi_cv_gssapi = xno; then
break
fi
if test x$acx_gssapi_cv_gssapi = xyes; then
AC_CHECKING([for GSSAPI])
else
CPPFLAGS="$acx_gssapi_save_CPPFLAGS -I$acx_gssapi_cv_gssapi/include"
AC_CHECKING([for GSSAPI in $acx_gssapi_cv_gssapi])
fi
unset ac_cv_header_gssapi_h
unset ac_cv_header_gssapi_gssapi_h
AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h])
if test "$ac_cv_header_gssapi_h" = "yes" ||
test "$ac_cv_header_gssapi_gssapi_h" = "yes"; then
break
fi
done
CPPFLAGS=$acx_gssapi_save_CPPFLAGS
else
acx_gssapi_cv_gssapi=$acx_gssapi_withgssapi
fi
AC_MSG_CHECKING([for GSSAPI])
])dnl
AC_MSG_RESULT([$acx_gssapi_cv_gssapi])
#
# Set up GSSAPI includes for later use. We don't bother to check for
# $acx_gssapi_cv_gssapi=no here since that will be caught later.
#
if test x$acx_gssapi_cv_gssapi = yes; then
# no special includes necessary
GSSAPI_INCLUDES=""
else
# GSSAPI at $acx_gssapi_cv_gssapi (could be 'no')
GSSAPI_INCLUDES=" -I$acx_gssapi_cv_gssapi/include"
fi
#
# Get the rest of the information CVS needs to compile with GSSAPI support
#
if test x$acx_gssapi_cv_gssapi != xno; then
# define HAVE_GSSAPI and set up the includes
AC_DEFINE([HAVE_GSSAPI],, [Define if you have GSSAPI with Kerberos version 5 available.])
includeopt=$includeopt$GSSAPI_INCLUDES
# locate any other headers
acx_gssapi_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS=$CPPFLAGS$GSSAPI_INCLUDES
dnl We don't use HAVE_KRB5_H anywhere, but including it here might make it
dnl easier to spot errors by reading configure output
AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h gssapi/gssapi_generic.h krb5.h])
# And look through them for GSS_C_NT_HOSTBASED_SERVICE or its alternatives
AC_CACHE_CHECK([for GSS_C_NT_HOSTBASED_SERVICE], [acx_gssapi_cv_gss_c_nt_hostbased_service],
[acx_gssapi_cv_gss_c_nt_hostbased_service=no
if test "$ac_cv_header_gssapi_h" = "yes"; then
AC_EGREP_HEADER([GSS_C_NT_HOSTBASED_SERVICE], [gssapi.h],
[acx_gssapi_cv_gss_c_nt_hostbased_service=yes],
AC_EGREP_HEADER([gss_nt_service_name], [gssapi.h],
[acx_gssapi_cv_gss_c_nt_hostbased_service=gss_nt_service_name]))
fi
if test $acx_gssapi_cv_gss_c_nt_hostbased_service = no &&
test "$ac_cv_header_gssapi_gssapi_h" = "yes"; then
AC_EGREP_HEADER([GSS_C_NT_HOSTBASED_SERVICE], [gssapi/gssapi.h],
[acx_gssapi_cv_gss_c_nt_hostbased_service],
AC_EGREP_HEADER([gss_nt_service_name], [gssapi/gssapi.h],
[acx_gssapi_cv_gss_c_nt_hostbased_service=gss_nt_service_name]))
fi
if test $acx_gssapi_cv_gss_c_nt_hostbased_service = no &&
test "$ac_cv_header_gssapi_gssapi_generic_h" = "yes"; then
AC_EGREP_HEADER([GSS_C_NT_HOSTBASED_SERVICE], [gssapi/gssapi_generic.h],
[acx_gssapi_cv_gss_c_nt_hostbased_service],
AC_EGREP_HEADER([gss_nt_service_name], [gssapi/gssapi_generic.h],
[acx_gssapi_cv_gss_c_nt_hostbased_service=gss_nt_service_name]))
fi])
if test $acx_gssapi_cv_gss_c_nt_hostbased_service != yes &&
test $acx_gssapi_cv_gss_c_nt_hostbased_service != no; then
# don't define for yes since that means it already means something and
# don't define for no since we'd rather the compiler catch the error
AC_DEFINE_UNQUOTED([GSS_C_NT_HOSTBASED_SERVICE], [$acx_gssapi_cv_gss_c_nt_hostbased_service],
[Define to an alternative value if GSS_C_NT_HOSTBASED_SERVICE isn't defined
in the gssapi.h header file. MIT Kerberos 1.2.1 requires this. Only relevant
when using GSSAPI.])
fi
CPPFLAGS=$acx_gssapi_save_CPPFLAGS
# Expect the libs to be installed parallel to the headers
#
# We could try once with and once without, but I'm not sure it's worth the
# trouble.
if test x$acx_gssapi_cv_gssapi != xyes; then
if test -z "$LIBS"; then
LIBS="-L$acx_gssapi_cv_gssapi/lib"
else
LIBS="-L$acx_gssapi_cv_gssapi/lib $LIBS"
fi
else :; fi
dnl What happens if we want to enable, say, krb5 and some other GSSAPI
dnl authentication method at the same time?
#
# Some of the order below is particular due to library dependencies
#
#
# des Heimdal K 0.3d, but Heimdal seems to be set up such
# that it could have been installed from elsewhere.
#
AC_SEARCH_LIBS([des_set_odd_parity], [des])
#
# com_err Heimdal K 0.3d
#
# com_err MIT K5 v1.2.2-beta1
#
AC_SEARCH_LIBS([com_err], [com_err])
#
# asn1 Heimdal K 0.3d -lcom_err
#
AC_SEARCH_LIBS([initialize_asn1_error_table_r], [asn1])
#
# resolv required, but not installed by Heimdal K 0.3d
#
# resolv MIT K5 1.2.2-beta1
# Linux 2.2.17
#
AC_SEARCH_LIBS([__dn_expand], [resolv])
#
# roken Heimdal K 0.3d -lresolv
#
AC_SEARCH_LIBS([roken_gethostbyaddr], [roken])
#
# k5crypto MIT K5 v1.2.2-beta1
#
AC_SEARCH_LIBS([valid_enctype], [k5crypto])
#
# gen ? ? ? Needed on Irix 5.3 with some
# Irix 5.3 version of Kerberos. I'm not
# sure which since Irix didn't
# get any testing this time
# around. Original comment:
#
# This is necessary on Irix 5.3, in order to link against libkrb5 --
# there, an_to_ln.o refers to things defined only in -lgen.
#
AC_SEARCH_LIBS([compile], [gen])
#
# krb5 ? ? ? -lgen -l???
# Irix 5.3
#
# krb5 MIT K5 v1.1.1
#
# krb5 MIT K5 v1.2.2-beta1 -lcrypto -lcom_err
# Linux 2.2.17
#
# krb5 MIT K5 v1.2.2-beta1 -lcrypto -lcom_err -lresolv
#
# krb5 Heimdal K 0.3d -lasn1 -lroken -ldes
#
AC_SEARCH_LIBS([krb5_free_context], [krb5])
#
# gssapi_krb5 Only lib needed with MIT K5 v1.2.1, so find it first in
# order to prefer MIT Kerberos. If both MIT & Heimdal
# Kerberos are installed and in the path, this will leave
# some of the libraries above in LIBS unnecessarily, but
# noone would ever do that, right?
#
# gssapi_krb5 MIT K5 v1.2.2-beta1 -lkrb5
#
# gssapi Heimdal K 0.3d -lkrb5
#
AC_SEARCH_LIBS([gss_import_name], [gssapi_krb5 gssapi])
fi
])dnl
-861
View File
@@ -1,861 +0,0 @@
# aclocal.m4 generated automatically by aclocal 1.4e
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
/* This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program 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 General Public License for more details. */
AC_DEFUN(ACX_WITH_GSSAPI,[
#
# Use --with-gssapi[=DIR] to enable GSSAPI support.
#
# defaults to enabled with DIR in default list below
#
# Search for /SUNHEA/ and read the comments about this default below.
#
AC_ARG_WITH([gssapi],
[ --with-gssapi=value GSSAPI directory],
[acx_gssapi_withgssapi=$withval], [acx_gssapi_withgssapi=yes])dnl
dnl
dnl FIXME - cache withval and obliterate later cache values when options change
dnl
#
# Try to locate a GSSAPI installation if no location was specified, assuming
# GSSAPI was enabled (the default).
#
if test -n "$acx_gssapi_cv_gssapi"; then
# Granted, this is a slightly ugly way to print this info, but the
# AC_CHECK_HEADER used in the search for a GSSAPI installation makes using
# AC_CACHE_CHECK worse
AC_MSG_CHECKING([for GSSAPI])
else :; fi
AC_CACHE_VAL([acx_gssapi_cv_gssapi], [
if test x$acx_gssapi_withgssapi = xyes; then
# --with but no location specified
# assume a gssapi.h or gssapi/gssapi.h locates our install.
#
# This isn't always strictly true. For instance Solaris 7's SUNHEA (header)
# package installs gssapi.h whether or not the necessary libraries are
# installed. I'm still not sure whether to consider this a bug. The long
# way around is to not consider GSSPAI installed unless gss_import_name is
# found, but that brings up a lot of other hassles, like continuing to let
# gcc & ld generate the error messages when the user uses --with-gssapi=dir
# as a debugging aid. The short way around is to disable GSSAPI by default,
# but I think Sun users have been faced with this for awhile and I haven't
# heard many complaints.
acx_gssapi_save_CPPFLAGS=$CPPFLAGS
for acx_gssapi_cv_gssapi in yes /usr/kerberos /usr/cygnus/kerbnet no; do
if test x$acx_gssapi_cv_gssapi = xno; then
break
fi
if test x$acx_gssapi_cv_gssapi = xyes; then
AC_CHECKING([for GSSAPI])
else
CPPFLAGS="$acx_gssapi_save_CPPFLAGS -I$acx_gssapi_cv_gssapi/include"
AC_CHECKING([for GSSAPI in $acx_gssapi_cv_gssapi])
fi
unset ac_cv_header_gssapi_h
unset ac_cv_header_gssapi_gssapi_h
AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h])
if test "$ac_cv_header_gssapi_h" = "yes" ||
test "$ac_cv_header_gssapi_gssapi_h" = "yes"; then
break
fi
done
CPPFLAGS=$acx_gssapi_save_CPPFLAGS
else
acx_gssapi_cv_gssapi=$acx_gssapi_withgssapi
fi
AC_MSG_CHECKING([for GSSAPI])
])dnl
AC_MSG_RESULT([$acx_gssapi_cv_gssapi])
#
# Set up GSSAPI includes for later use. We don't bother to check for
# $acx_gssapi_cv_gssapi=no here since that will be caught later.
#
if test x$acx_gssapi_cv_gssapi = yes; then
# no special includes necessary
GSSAPI_INCLUDES=""
else
# GSSAPI at $acx_gssapi_cv_gssapi (could be 'no')
GSSAPI_INCLUDES=" -I$acx_gssapi_cv_gssapi/include"
fi
#
# Get the rest of the information CVS needs to compile with GSSAPI support
#
if test x$acx_gssapi_cv_gssapi != xno; then
# define HAVE_GSSAPI and set up the includes
AC_DEFINE([HAVE_GSSAPI],, [Define if you have GSSAPI with Kerberos version 5 available.])
includeopt=$includeopt$GSSAPI_INCLUDES
# locate any other headers
acx_gssapi_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS=$CPPFLAGS$GSSAPI_INCLUDES
dnl We don't use HAVE_KRB5_H anywhere, but including it here might make it
dnl easier to spot errors by reading configure output
AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h gssapi/gssapi_generic.h krb5.h])
# And look through them for GSS_C_NT_HOSTBASED_SERVICE or its alternatives
AC_CACHE_CHECK([for GSS_C_NT_HOSTBASED_SERVICE], [acx_gssapi_cv_gss_c_nt_hostbased_service],
[acx_gssapi_cv_gss_c_nt_hostbased_service=no
if test "$ac_cv_header_gssapi_h" = "yes"; then
AC_EGREP_HEADER([GSS_C_NT_HOSTBASED_SERVICE], [gssapi.h],
[acx_gssapi_cv_gss_c_nt_hostbased_service=yes],
AC_EGREP_HEADER([gss_nt_service_name], [gssapi.h],
[acx_gssapi_cv_gss_c_nt_hostbased_service=gss_nt_service_name]))
fi
if test $acx_gssapi_cv_gss_c_nt_hostbased_service = no &&
test "$ac_cv_header_gssapi_gssapi_h" = "yes"; then
AC_EGREP_HEADER([GSS_C_NT_HOSTBASED_SERVICE], [gssapi/gssapi.h],
[acx_gssapi_cv_gss_c_nt_hostbased_service],
AC_EGREP_HEADER([gss_nt_service_name], [gssapi/gssapi.h],
[acx_gssapi_cv_gss_c_nt_hostbased_service=gss_nt_service_name]))
fi
if test $acx_gssapi_cv_gss_c_nt_hostbased_service = no &&
test "$ac_cv_header_gssapi_gssapi_generic_h" = "yes"; then
AC_EGREP_HEADER([GSS_C_NT_HOSTBASED_SERVICE], [gssapi/gssapi_generic.h],
[acx_gssapi_cv_gss_c_nt_hostbased_service],
AC_EGREP_HEADER([gss_nt_service_name], [gssapi/gssapi_generic.h],
[acx_gssapi_cv_gss_c_nt_hostbased_service=gss_nt_service_name]))
fi])
if test $acx_gssapi_cv_gss_c_nt_hostbased_service != yes &&
test $acx_gssapi_cv_gss_c_nt_hostbased_service != no; then
# don't define for yes since that means it already means something and
# don't define for no since we'd rather the compiler catch the error
AC_DEFINE_UNQUOTED([GSS_C_NT_HOSTBASED_SERVICE], [$acx_gssapi_cv_gss_c_nt_hostbased_service],
[Define to an alternative value if GSS_C_NT_HOSTBASED_SERVICE isn't defined
in the gssapi.h header file. MIT Kerberos 1.2.1 requires this. Only relevant
when using GSSAPI.])
fi
CPPFLAGS=$acx_gssapi_save_CPPFLAGS
# Expect the libs to be installed parallel to the headers
#
# We could try once with and once without, but I'm not sure it's worth the
# trouble.
if test x$acx_gssapi_cv_gssapi != xyes; then
if test -z "$LIBS"; then
LIBS="-L$acx_gssapi_cv_gssapi/lib"
else
LIBS="-L$acx_gssapi_cv_gssapi/lib $LIBS"
fi
else :; fi
dnl What happens if we want to enable, say, krb5 and some other GSSAPI
dnl authentication method at the same time?
#
# Some of the order below is particular due to library dependencies
#
#
# des Heimdal K 0.3d, but Heimdal seems to be set up such
# that it could have been installed from elsewhere.
#
AC_SEARCH_LIBS([des_set_odd_parity], [des])
#
# com_err Heimdal K 0.3d
#
# com_err MIT K5 v1.2.2-beta1
#
AC_SEARCH_LIBS([com_err], [com_err])
#
# asn1 Heimdal K 0.3d -lcom_err
#
AC_SEARCH_LIBS([initialize_asn1_error_table_r], [asn1])
#
# resolv required, but not installed by Heimdal K 0.3d
#
# resolv MIT K5 1.2.2-beta1
# Linux 2.2.17
#
AC_SEARCH_LIBS([__dn_expand], [resolv])
#
# roken Heimdal K 0.3d -lresolv
#
AC_SEARCH_LIBS([roken_gethostbyaddr], [roken])
#
# k5crypto MIT K5 v1.2.2-beta1
#
AC_SEARCH_LIBS([valid_enctype], [k5crypto])
#
# gen ? ? ? Needed on Irix 5.3 with some
# Irix 5.3 version of Kerberos. I'm not
# sure which since Irix didn't
# get any testing this time
# around. Original comment:
#
# This is necessary on Irix 5.3, in order to link against libkrb5 --
# there, an_to_ln.o refers to things defined only in -lgen.
#
AC_SEARCH_LIBS([compile], [gen])
#
# krb5 ? ? ? -lgen -l???
# Irix 5.3
#
# krb5 MIT K5 v1.1.1
#
# krb5 MIT K5 v1.2.2-beta1 -lcrypto -lcom_err
# Linux 2.2.17
#
# krb5 MIT K5 v1.2.2-beta1 -lcrypto -lcom_err -lresolv
#
# krb5 Heimdal K 0.3d -lasn1 -lroken -ldes
#
AC_SEARCH_LIBS([krb5_free_context], [krb5])
#
# gssapi_krb5 Only lib needed with MIT K5 v1.2.1, so find it first in
# order to prefer MIT Kerberos. If both MIT & Heimdal
# Kerberos are installed and in the path, this will leave
# some of the libraries above in LIBS unnecessarily, but
# noone would ever do that, right?
#
# gssapi_krb5 MIT K5 v1.2.2-beta1 -lkrb5
#
# gssapi Heimdal K 0.3d -lkrb5
#
AC_SEARCH_LIBS([gss_import_name], [gssapi_krb5 gssapi])
fi
])dnl
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
# serial 5
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# We require 2.13 because we rely on SHELL being computed by configure.
AC_PREREQ([2.13])
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
# -----------------------------------------------------------
# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
# The purpose of this macro is to provide the user with a means to
# check macros which are provided without letting her know how the
# information is coded.
# If this macro is not defined by Autoconf, define it here.
ifdef([AC_PROVIDE_IFELSE],
[],
[define([AC_PROVIDE_IFELSE],
[ifdef([AC_PROVIDE_$1],
[$2], [$3])])])
# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
# ----------------------------------------------
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_REQUIRE([AC_PROG_INSTALL])dnl
# test to see if srcdir already configured
if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
fi
# Define the identity of the package.
PACKAGE=$1
AC_SUBST(PACKAGE)dnl
VERSION=$2
AC_SUBST(VERSION)dnl
ifelse([$3],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
# the ones we care about.
ifdef([m4_pattern_allow],
[m4_pattern_allow([^AM_(C|CPP|CXX|OBJC|F|R|GCJ)FLAGS])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal)
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake)
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_MISSING_PROG(AMTAR, tar)
AM_MISSING_INSTALL_SH
AM_PROG_INSTALL_STRIP
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_PROG_ETAGS])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_PROVIDE_IFELSE([AC_PROG_][CC],
[AM_DEPENDENCIES(CC)],
[define([AC_PROG_][CC],
defn([AC_PROG_][CC])[AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_][CXX],
[AM_DEPENDENCIES(CXX)],
[define([AC_PROG_][CXX],
defn([AC_PROG_][CXX])[AM_DEPENDENCIES(CXX)])])dnl
])
#
# Check to make sure that the build environment is sane.
#
# serial 3
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftest.file`
fi
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
rm -f conftest*
AC_MSG_RESULT(yes)])
# serial 2
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_INSTALL_SH
# ---------------------
# Like AM_MISSING_PROG, but only looks for install-sh.
AC_DEFUN([AM_MISSING_INSTALL_SH],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
if test -z "$install_sh"; then
for install_sh in "$ac_aux_dir/install-sh" \
"$ac_aux_dir/install.sh" \
"${am_missing_run}${ac_auxdir}/install-sh";
do
test -f "$install_sh" && break
done
# FIXME: an evil hack: we remove the SHELL invocation from
# install_sh because automake adds it back in. Sigh.
install_sh=`echo $install_sh | sed -e 's/\${SHELL}//'`
fi
AC_SUBST(install_sh)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[test x"${MISSING+set}" = xset ||
MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
am_backtick='`'
AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
fi
])
# AM_AUX_DIR_EXPAND
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to ${srcdir}/foo. In other projects, it is set to `.'.
# Of course, Automake must honor this variable whenever it call a tool
# from the auxiliary directory. The problem is that $srcdir (hence
# $ac_aux_dir) can be either an absolute path or a path relative to
# $top_srcdir or absolute, this depends on how configure is run. This
# is pretty anoying since it makes $ac_aux_dir quite unusable in
# subdirectories: on the top source directory, any form will work
# fine, but in subdirectories relative pat needs to be adapted.
# - calling $top_srcidr/$ac_aux_dir/missing would success if $srcdir is
# relative, but fail if $srcdir is absolute
# - conversly, calling $ax_aux_dir/missing would fail if $srcdir is
# absolute, and success on relative paths.
#
# Consequently, we define and use $am_aux_dir, the "always absolute"
# version of $ac_aux_dir.
AC_DEFUN([AM_AUX_DIR_EXPAND], [
# expand $ac_aux_dir to an absolute path
am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
])
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross=compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so if we ever
# need to use a non standard strip, we just have to make sure we use
# install-sh with the STRIPPROG variable set.
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_MISSING_INSTALL_SH])
dnl Don't test for $cross_compiling = yes, it might be `maybe'...
# We'd like to do this but we can't because it will unconditionally
# require config.guess. One way would be if autoconf had the capability
# to let us compile in this code only when config.guess was already
# a possibility.
#if test "$cross_compiling" != no; then
# # since we are cross-compiling, we need to check for a suitable `strip'
# AM_PROG_STRIP
# if test -z "$STRIP"; then
# AC_MSG_WARN([strip missing, install-strip will not strip binaries])
# fi
#fi
# If $STRIP is defined (either by the user, or by AM_PROG_STRIP),
# instruct install-strip to use install-sh and the given $STRIP program.
# Otherwise, just use ${INSTALL}: the idea is to use the vendor install
# as much as possible, because it's faster.
if test -z "$STRIP"; then
# The top level make will set INSTALL_PROGRAM=$(INSTALL_STRIP_PROGRAM)
# and the double dolard below is there to make sure that ${INSTALL}
# is substitued in the sub-makes, not at the top-level; this is
# needed if ${INSTALL} is a relative path (ajusted in each subdirectory
# by config.status).
INSTALL_STRIP_PROGRAM='$${INSTALL} -s'
INSTALL_STRIP_PROGRAM_ENV=''
else
_am_dirpart="`echo $install_sh | sed -e 's,//*[[^/]]*$,,'`"
INSTALL_STRIP_PROGRAM="\${SHELL} \`CDPATH=: && cd $_am_dirpart && pwd\`/install-sh -c -s"
INSTALL_STRIP_PROGRAM_ENV="STRIPPROG='\$(STRIP)'"
fi
AC_SUBST([STRIP])
AC_SUBST([INSTALL_STRIP_PROGRAM])
AC_SUBST([INSTALL_STRIP_PROGRAM_ENV])])
#AC_DEFUN([AM_PROG_STRIP],
#[# Check for `strip', unless the installer
# has set the STRIP environment variable.
# Note: don't explicitly check for -z "$STRIP" here because
# that will cause problems if AC_CANONICAL_* is AC_REQUIREd after
# this macro, and anyway it doesn't have an effect anyway.
#AC_CHECK_TOOL([STRIP],[strip])
#])
#
# Find some information about the etags program
#
# Sets
# ETAGS = path to etags
# ETAGS_INCLUDE_OPTION = option to pass to etags with arg for includes
#
AC_DEFUN([AM_PROG_ETAGS],
[AC_BEFORE([$0], [AM_PROG_ETAGS_WORKS])dnl
AC_CHECK_PROG(ETAGS, etags, etags)
if test -z "$ETAGS"; then
AC_CHECK_PROG(ETAGS, ctags, ctags -e)
fi
if test -n "$ETAGS"; then
AM_PROG_ETAGS_WORKS
if test "$am_cv_prog_etags_works" = yes ; then
AM_PROG_ETAGS_INCLUDE_OPTION
else
AM_MISSING_PROG(ETAGS, etags)
fi
else
AM_MISSING_PROG(ETAGS, etags)
fi])
AC_DEFUN([AM_PROG_ETAGS_WORKS],
[AC_CACHE_CHECK([whether ${ETAGS-etags} works], [am_cv_prog_etags_works],
[cat >conftest.c <<EOF
int globalvar;
EOF
if AC_TRY_COMMAND([${ETAGS-etags} -f - conftest.c |egrep ^int\ globalvar\; >&2]); then
am_cv_prog_etags_works=yes
else
am_cv_prog_etags_works=no
fi
rm -f conftest.c])])
AC_DEFUN([AM_PROG_ETAGS_INCLUDE_OPTION],
[AC_REQUIRE([AM_PROG_ETAGS_WORKS])dnl
if test "$am_cv_prog_etags_works" = yes ; then
AC_CACHE_CHECK([for etags include option],
[am_cv_prog_etags_include_option],
[cat >conftest.c <<EOF
int globalvar;
EOF
if AC_TRY_COMMAND([${ETAGS-etags} --etags-include=TAGS.inc -f - conftest.c |egrep ^TAGS.inc,include\$ >&2]); then
am_cv_prog_etags_include_option=--etags-include=
elif AC_TRY_COMMAND([${ETAGS-etags} -i TAGS.inc -f - conftest.c |egrep ^TAGS.inc,include\$ >&2]); then
am_cv_prog_etags_include_option='"-i "'
else :
# AC_MSG_ERROR(unfamiliar etags implementation)
fi
rm -f conftest.c])
else
:
fi
ETAGS_INCLUDE_OPTION="$am_cv_prog_etags_include_option"
AC_SUBST(ETAGS_INCLUDE_OPTION)])
# serial 3
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# AM_DEPENDENCIES(NAME)
# ---------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX" or "OBJC".
# We try a few techniques and use that to set a single cache variable.
AC_DEFUN([AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
ifelse([$1], CC,
[AC_REQUIRE([AC_PROG_][CC])dnl
AC_REQUIRE([AC_PROG_][CPP])
depcc="$CC"
depcpp="$CPP"],
[$1], CXX, [AC_REQUIRE([AC_PROG_][CXX])dnl
AC_REQUIRE([AC_PROG_][CXXCPP])
depcc="$CXX"
depcpp="$CXXCPP"],
[$1], OBJC, [am_cv_OBJC_dependencies_compiler_type=gcc],
[AC_REQUIRE([AC_PROG_][$1])dnl
depcc="$$1"
depcpp=""])
AC_REQUIRE([AM_MAKE_INCLUDE])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
mkdir confdir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" confdir
cd confdir
am_cv_$1_dependencies_compiler_type=none
for depmode in `sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < "./depcomp"`; do
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
echo '#include "conftest.h"' > conftest.c
echo 'int i;' > conftest.h
case "$depmode" in
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
none) break ;;
esac
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode="$depmode" \
source=conftest.c object=conftest.o \
depfile=conftest.Po tmpdepfile=conftest.TPo \
$SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
grep conftest.h conftest.Po > /dev/null 2>&1; then
am_cv_$1_dependencies_compiler_type="$depmode"
break
fi
done
cd ..
rm -rf confdir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
AC_SUBST([$1DEPMODE])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
DEPDIR=.deps
# We redirect because .deps might already exist and be populated.
# In this situation we don't want to see an error.
rmdir .deps > /dev/null 2>&1
else
DEPDIR=_deps
fi
AC_SUBST(DEPDIR)
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking Speeds up one-time builds
--enable-dependency-tracking Do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
pushdef([subst], defn([AC_SUBST]))
subst(AMDEPBACKSLASH)
popdef([subst])
])
# Generate code to set up dependency tracking.
# This macro should only be invoked once -- use via AC_REQUIRE.
# Usage:
# AM_OUTPUT_DEPENDENCY_COMMANDS
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
AC_OUTPUT_COMMANDS([
test x"$AMDEP" != x"" ||
for mf in $CONFIG_FILES; do
case "$mf" in
Makefile) dirpart=.;;
*/Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
*) continue;;
esac
grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
# Extract the definition of DEP_FILES from the Makefile without
# running `make'.
DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
test -z "$DEPDIR" && continue
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n -e '/^U = / s///p' < "$mf"`
test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
# We invoke sed twice because it is the simplest approach to
# changing $(DEPDIR) to its actual value in the expansion.
for file in `sed -n -e '
/^DEP_FILES = .*\\\\$/ {
s/^DEP_FILES = //
:loop
s/\\\\$//
p
n
/\\\\$/ b loop
p
}
/^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
$ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
], [AMDEP="$AMDEP"
ac_aux_dir="$ac_aux_dir"])])
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
doit:
@echo done
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
_am_include='#'
_am_quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
_am_include=include
_am_quote=
_am_result=GNU
fi
# Now try BSD make style include.
if test "$_am_include" = "#"; then
echo '.include "confinc"' > confmf
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
_am_include=.include
_am_quote='"'
_am_result=BSD
fi
fi
AC_SUBST(_am_include)
AC_SUBST(_am_quote)
AC_MSG_RESULT($_am_result)
rm -f confinc confmf
])
# serial 3
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
#
# FIXME: Once using 2.50, use this:
# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_DEFUN([AM_CONDITIONAL],
[ifelse([$1], [TRUE],
[errprint(__file__:__line__: [$0: invalid condition: $1
])dnl
m4exit(1)])dnl
ifelse([$1], [FALSE],
[errprint(__file__:__line__: [$0: invalid condition: $1
])dnl
m4exit(1)])dnl
AC_SUBST([$1_TRUE])
AC_SUBST([$1_FALSE])
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi])
# Like AC_CONFIG_HEADER, but automatically create stamp file.
# serial 3
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. We must strip everything past the first ":",
# and everything past the last "/".
AC_PREREQ([2.12])
AC_DEFUN([AM_CONFIG_HEADER],
[ifdef([AC_FOREACH],dnl
[dnl init our file count if it isn't already
m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
dnl prepare to store our destination file list for use in config.status
AC_FOREACH([_AM_File], [$1],
[m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
dnl and add it to the list of files AC keeps track of, along
dnl with our hook
AC_CONFIG_HEADERS(_AM_File,
dnl COMMANDS, [, INIT-CMDS]
[# update the timestamp
echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
m4_popdef([_AM_Dest])])],dnl
[AC_CONFIG_HEADER([$1])
AC_OUTPUT_COMMANDS(
ifelse(patsubst([$1], [[^ ]], []),
[],
[test -z "$CONFIG_HEADERS" || echo timestamp >dnl
patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
[am_indx=1
for am_file in $1; do
case " \$CONFIG_HEADERS " in
*" \$am_file "*)
am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
if test -n "\$am_dir"; then
am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
am_tmpdir=\$am_tmpdir\$am_subdir/
if test ! -d \$am_tmpdir; then
mkdir \$am_tmpdir
fi
done
fi
echo timestamp > "\$am_dir"stamp-h\$am_indx
;;
esac
am_indx=\`expr \$am_indx + 1\`
done])
])]) # AM_CONFIG_HEADER
# _AM_DIRNAME(PATH)
# -----------------
# Like AS_DIRNAME, only do it during macro expansion
AC_DEFUN([_AM_DIRNAME],
[m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
m4_if(m4_regexp([$1], [^/.*]), -1,
[.],
m4_patsubst([$1], [^\(/\).*], [\1])),
m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
]) # _AM_DIRNAME
-108
View File
@@ -1,108 +0,0 @@
## Process this file with automake to produce Makefile.in
# Makefile for GNU CVS contributed sources.
# Do not use this makefile directly, but only from `../Makefile'.
# Copyright (C) 1986, 1988-1990 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program 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 General Public License for more details.
# DISTFILES = \
# ChangeLog README .cvsignore intro.doc \
# Makefile.in clmerge.pl cln_hist.pl commit_prep.pl cvs2vendor.sh \
# cvs_acls.pl cvscheck.sh cvscheck.man cvshelp.man debug_check_log.sh \
# descend.sh \
# descend.man dirfns.shar log.pl log_accum.pl mfpipe.pl rcs-to-cvs.sh \
# rcs2log.sh rcslock.pl sccs2rcs.csh rcs2sccs.sh
# files installed in $(pkgdatadir)
#
# CONTRIB_FILES = README intro.doc cvscheck.man
contribdir = $(pkgdatadir)/contrib
contrib_SCRIPTS = \
clmerge \
cln_hist \
commit_prep \
cvs2vendor \
cvs_acls \
cvscheck \
debug_check_log \
log \
log_accum \
mfpipe \
rcs-to-cvs \
rcs2log \
rcslock \
sccs2rcs
contrib_DATA = \
README \
intro.doc
contrib_MANS = \
cvscheck.man
bin_LINKS = \
rcs2log
EXTRA_DIST = \
.cvsignore \
$(contrib_DATA) \
$(contrib_MANS) \
cvs2vendor.sh \
cvscheck.sh \
cvshelp.man \
debug_check_log.sh \
descend.sh \
descend.man \
dirfns.shar \
rcs-to-cvs.sh \
rcs2log.sh \
rcs2sccs.sh
CLEANFILES = $(bin_SCRIPTS) $(contrib_SCRIPTS)
# we'd rather have a link here rather than two copies of a script
install-data-local:
# FIXME - this path should be determined dynamically from bindir
# & contribdir
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_LINKS)'; for p in $$list; do \
echo "test ! -e $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
echo " && cd $(DESTDIR)$(bindir) && $(LN_S) ../share/$(PACKAGE)/contrib/`echo $$p|sed '$(transform)'` ."; \
(test ! -e $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'` \
&& cd $(DESTDIR)$(bindir) && $(LN_S) ../share/$(PACKAGE)/contrib/`echo $$p|sed '$(transform)'` .) \
|| (echo "Link creation failed" && if test -f $$p; then \
echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
$(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
else if test -f $(srcdir)/$$p; then \
echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
$(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
else :; fi; fi); \
done
uninstall-local:
@$(NORMAL_UNINSTALL)
list='$(bin_LINKS)'; for p in $$list; do \
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
done
SUFFIXES = .sh
.sh:
rm -f $@
cp $< $@
chmod +x $@
# for backwards compatibility with the old makefiles
realclean: maintainer-clean
.PHONY: realclean
-152
View File
@@ -1,152 +0,0 @@
#! @PERL@
# Merge conflicted ChangeLogs
# tromey Mon Aug 15 1994
# Usage is:
#
# cl-merge [-i] file ...
#
# With -i, it works in place (backups put in a ~ file). Otherwise the
# merged ChangeLog is printed to stdout.
# Please report any bugs to me. I wrote this yesterday, so there are no
# guarantees about its performance. I recommend checking its output
# carefully. If you do send a bug report, please include the failing
# ChangeLog, so I can include it in my test suite.
#
# Tom
# ---
# [email protected] Member, League for Programming Freedom
# Sadism and farce are always inexplicably linked.
# -- Alexander Theroux
# Month->number mapping. Used for sorting.
%months = ('Jan', 0,
'Feb', 1,
'Mar', 2,
'Apr', 3,
'May', 4,
'Jun', 5,
'Jul', 6,
'Aug', 7,
'Sep', 8,
'Oct', 9,
'Nov', 10,
'Dec', 11);
# If '-i' is given, do it in-place.
if ($ARGV[0] eq '-i') {
shift (@ARGV);
$^I = '~';
}
$lastkey = '';
$lastval = '';
$conf = 0;
%conflist = ();
$tjd = 0;
# Simple state machine. The states:
#
# 0 Not in conflict. Just copy input to output.
# 1 Beginning an entry. Next non-blank line is key.
# 2 In entry. Entry beginner transitions to state 1.
while (<>) {
if (/^<<<</ || /^====/) {
# Start of a conflict.
# Copy last key into array.
if ($lastkey ne '') {
$conflist{$lastkey} = $lastval;
$lastkey = '';
$lastval = '';
}
$conf = 1;
} elsif (/^>>>>/) {
# End of conflict. Output.
# Copy last key into array.
if ($lastkey ne '') {
$conflist{$lastkey} = $lastval;
$lastkey = '';
$lastval = '';
}
foreach (reverse sort clcmp keys %conflist) {
print STDERR "doing $_" if $tjd;
print $_;
print $conflist{$_};
}
$lastkey = '';
$lastval = '';
$conf = 0;
%conflist = ();
} elsif ($conf == 1) {
# Beginning an entry. Skip empty lines. Error if not a real
# beginner.
if (/^$/) {
# Empty line; just skip at this point.
} elsif (/^[MTWFS]/) {
# Looks like the name of a day; assume opener and move to
# "in entry" state.
$lastkey = $_;
$conf = 2;
print STDERR "found $_" if $tjd;
} else {
die ("conflict crosses entry boundaries: $_");
}
} elsif ($conf == 2) {
# In entry. Copy into variable until we see beginner line.
if (/^[MTWFS]/) {
# Entry beginner line.
# Copy last key into array.
if ($lastkey ne '') {
$conflist{$lastkey} = $lastval;
$lastkey = '';
$lastval = '';
}
$lastkey = $_;
print STDERR "found $_" if $tjd;
$lastval = '';
} else {
$lastval .= $_;
}
} else {
# Just copy.
print;
}
}
# Compare ChangeLog time strings like <=>.
#
# 0 1 2 3
# Thu Aug 11 13:22:42 1994 Tom Tromey ([email protected])
# 0123456789012345678901234567890
#
sub clcmp {
# First check year.
$r = substr ($a, 20, 4) <=> substr ($b, 20, 4);
# Now check month.
$r = $months{substr ($a, 4, 3)} <=> $months{substr ($b, 4, 3)} if !$r;
# Now check day.
$r = substr ($a, 8, 2) <=> substr ($b, 8, 2) if !$r;
# Now check time (3 parts).
$r = substr ($a, 11, 2) <=> substr ($b, 11, 2) if !$r;
$r = substr ($a, 14, 2) <=> substr ($b, 14, 2) if !$r;
$r = substr ($a, 17, 2) <=> substr ($b, 17, 2) if !$r;
$r;
}
-91
View File
@@ -1,91 +0,0 @@
#! @PERL@
# -*-Perl-*-
#
# Contributed by David G. Grubbs <[email protected]>
#
# Clean up the history file. 10 Record types: MAR OFT WUCG
#
# WUCG records are thrown out.
# MAR records are retained.
# T records: retain only last tag with same combined tag/module.
#
# Two passes: Walk through the first time and remember the
# 1. Last Tag record with same "tag" and "module" names.
# 2. Last O record with unique user/module/directory, unless followed
# by a matching F record.
#
$r = $ENV{"CVSROOT"};
$c = "$r/CVSROOT";
$h = "$c/history";
eval "print STDERR \$die='Unknown parameter $1\n' if !defined \$$1; \$$1=\$';"
while ($ARGV[0] =~ /^(\w+)=/ && shift(@ARGV));
exit 255 if $die; # process any variable=value switches
%tags = ();
%outs = ();
#
# Move history file to safe place and re-initialize a new one.
#
rename($h, "$h.bak");
open(XX, ">$h");
close(XX);
#
# Pass1 -- remember last tag and checkout.
#
open(HIST, "$h.bak");
while (<HIST>) {
next if /^[MARWUCG]/;
# Save whole line keyed by tag|module
if (/^T/) {
@tmp = split(/\|/, $_);
$tags{$tmp[4] . '|' . $tmp[5]} = $_;
}
# Save whole line
if (/^[OF]/) {
@tmp = split(/\|/, $_);
$outs{$tmp[1] . '|' . $tmp[2] . '|' . $tmp[5]} = $_;
}
}
#
# Pass2 -- print out what we want to save.
#
open(SAVE, ">$h.work");
open(HIST, "$h.bak");
while (<HIST>) {
next if /^[FWUCG]/;
# If whole line matches saved (i.e. "last") one, print it.
if (/^T/) {
@tmp = split(/\|/, $_);
next if $tags{$tmp[4] . '|' . $tmp[5]} ne $_;
}
# Save whole line
if (/^O/) {
@tmp = split(/\|/, $_);
next if $outs{$tmp[1] . '|' . $tmp[2] . '|' . $tmp[5]} ne $_;
}
print SAVE $_;
}
#
# Put back the saved stuff
#
system "cat $h >> $h.work";
if (-s $h) {
rename ($h, "$h.interim");
print "history.interim has non-zero size.\n";
} else {
unlink($h);
}
rename ("$h.work", $h);
exit(0);
-215
View File
@@ -1,215 +0,0 @@
#! @PERL@
# -*-Perl-*-
#
#
# Perl filter to handle pre-commit checking of files. This program
# records the last directory where commits will be taking place for
# use by the log_accum.pl script. For new files, it forces the
# existence of a RCS "Id" keyword in the first ten lines of the file.
# For existing files, it checks version number in the "Id" line to
# prevent losing changes because an old version of a file was copied
# into the direcory.
#
# Possible future enhancements:
#
# Check for cruft left by unresolved conflicts. Search for
# "^<<<<<<<$", "^-------$", and "^>>>>>>>$".
#
# Look for a copyright and automagically update it to the
# current year. [[ bad idea! -- woods ]]
#
#
# Contributed by David Hampton <[email protected]>
#
# Hacked on lots by Greg A. Woods <[email protected]>
#
# Configurable options
#
# Constants (remember to protect strings from RCS keyword substitution)
#
$LAST_FILE = "/tmp/#cvs.lastdir"; # must match name in log_accum.pl
$ENTRIES = "CVS/Entries";
# Patterns to find $Log keywords in files
#
$LogString1 = "\\\$\\Log: .* \\\$";
$LogString2 = "\\\$\\Log\\\$";
$NoLog = "%s - contains an RCS \$Log keyword. It must not!\n";
# pattern to match an RCS Id keyword line with an existing ID
#
$IDstring = "\"@\\(#\\)[^:]*:.*\\\$\Id: .*\\\$\"";
$NoId = "
%s - Does not contain a properly formatted line with the keyword \"Id:\".
I.e. no lines match \"" . $IDstring . "\".
Please see the template files for an example.\n";
# pattern to match an RCS Id keyword line for a new file (i.e. un-expanded)
#
$NewId = "\"@(#)[^:]*:.*\\$\Id\\$\"";
$NoName = "
%s - The ID line should contain only \"@(#)module/path:\$Name\$:\$\Id\$\"
for a newly created file.\n";
$BadName = "
%s - The file name '%s' in the ID line does not match
the actual filename.\n";
$BadVersion = "
%s - How dare you!!! You replaced your copy of the file '%s',
which was based upon version %s, with an %s version based
upon %s. Please move your '%s' out of the way, perform an
update to get the current version, and them merge your changes
into that file, then try the commit again.\n";
#
# Subroutines
#
sub write_line {
local($filename, $line) = @_;
open(FILE, ">$filename") || die("Cannot open $filename, stopped");
print(FILE $line, "\n");
close(FILE);
}
sub check_version {
local($i, $id, $rname, $version);
local($filename, $cvsversion) = @_;
open(FILE, "<$filename") || return(0);
@all_lines = ();
$idpos = -1;
$newidpos = -1;
for ($i = 0; <FILE>; $i++) {
chop;
push(@all_lines, $_);
if ($_ =~ /$IDstring/) {
$idpos = $i;
}
if ($_ =~ /$NewId/) {
$newidpos = $i;
}
}
if (grep(/$LogString1/, @all_lines) || grep(/$LogString2/, @all_lines)) {
print STDERR sprintf($NoLog, $filename);
return(1);
}
if ($debug != 0) {
print STDERR sprintf("file = %s, version = %d.\n", $filename, $cvsversion{$filename});
}
if ($cvsversion{$filename} == 0) {
if ($newidpos != -1 && $all_lines[$newidpos] !~ /$NewId/) {
print STDERR sprintf($NoName, $filename);
return(1);
}
return(0);
}
if ($idpos == -1) {
print STDERR sprintf($NoId, $filename);
return(1);
}
$line = $all_lines[$idpos];
$pos = index($line, "Id: ");
if ($debug != 0) {
print STDERR sprintf("%d in '%s'.\n", $pos, $line);
}
($id, $rname, $version) = split(' ', substr($line, $pos));
if ($rname ne "$filename,v") {
print STDERR sprintf($BadName, $filename, substr($rname, 0, length($rname)-2));
return(1);
}
if ($cvsversion{$filename} < $version) {
print STDERR sprintf($BadVersion, $filename, $filename, $cvsversion{$filename},
"newer", $version, $filename);
return(1);
}
if ($cvsversion{$filename} > $version) {
print STDERR sprintf($BadVersion, $filename, $filename, $cvsversion{$filename},
"older", $version, $filename);
return(1);
}
return(0);
}
#
# Main Body
#
$id = getpgrp(); # You *must* use a shell that does setpgrp()!
# Check each file (except dot files) for an RCS "Id" keyword.
#
$check_id = 0;
# Record the directory for later use by the log_accumulate stript.
#
$record_directory = 0;
# parse command line arguments
#
while (@ARGV) {
$arg = shift @ARGV;
if ($arg eq '-d') {
$debug = 1;
print STDERR "Debug turned on...\n";
} elsif ($arg eq '-c') {
$check_id = 1;
} elsif ($arg eq '-r') {
$record_directory = 1;
} else {
push(@files, $arg);
}
}
$directory = shift @files;
if ($debug != 0) {
print STDERR "dir - ", $directory, "\n";
print STDERR "files - ", join(":", @files), "\n";
print STDERR "id - ", $id, "\n";
}
# Suck in the CVS/Entries file
#
open(ENTRIES, $ENTRIES) || die("Cannot open $ENTRIES.\n");
while (<ENTRIES>) {
local($filename, $version) = split('/', substr($_, 1));
$cvsversion{$filename} = $version;
}
# Now check each file name passed in, except for dot files. Dot files
# are considered to be administrative files by this script.
#
if ($check_id != 0) {
$failed = 0;
foreach $arg (@files) {
if (index($arg, ".") == 0) {
next;
}
$failed += &check_version($arg);
}
if ($failed) {
print STDERR "\n";
exit(1);
}
}
# Record this directory as the last one checked. This will be used
# by the log_accumulate script to determine when it is processing
# the final directory of a multi-directory commit.
#
if ($record_directory != 0) {
&write_line("$LAST_FILE.$id", $directory);
}
exit(0);
-141
View File
@@ -1,141 +0,0 @@
#! @PERL@
# -*-Perl-*-
#
# Access control lists for CVS. [email protected] (David G. Grubbs)
#
# CVS "commitinfo" for matching repository names, running the program it finds
# on the same line. More information is available in the CVS man pages.
#
# ==== INSTALLATION:
#
# To use this program as I intended, do the following four things:
#
# 0. Install PERL. :-)
#
# 1. Put one line, as the *only* non-comment line, in your commitinfo file:
#
# DEFAULT /usr/local/bin/cvs_acls
#
# 2. Install this file as /usr/local/bin/cvs_acls and make it executable.
#
# 3. Create a file named $CVSROOT/CVSROOT/avail.
#
# ==== FORMAT OF THE avail FILE:
#
# The avail file determines whether you may commit files. It contains lines
# read from top to bottom, keeping track of a single "bit". The "bit"
# defaults to "on". It can be turned "off" by "unavail" lines and "on" by
# "avail" lines. ==> Last one counts.
#
# Any line not beginning with "avail" or "unavail" is ignored.
#
# Lines beginning with "avail" or "unavail" are assumed to be '|'-separated
# triples: (All spaces and tabs are ignored in a line.)
#
# {avail.*,unavail.*} [| user,user,... [| repos,repos,...]]
#
# 1. String starting with "avail" or "unavail".
# 2. Optional, comma-separated list of usernames.
# 3. Optional, comma-separated list of repository pathnames.
# These are pathnames relative to $CVSROOT. They can be directories or
# filenames. A directory name allows access to all files and
# directories below it.
#
# Example: (Text from the ';;' rightward may not appear in the file.)
#
# unavail ;; Make whole repository unavailable.
# avail|dgg ;; Except for user "dgg".
# avail|fred, john|bin/ls ;; Except when "fred" or "john" commit to
# ;; the module whose repository is "bin/ls"
#
# PROGRAM LOGIC:
#
# CVS passes to @ARGV an absolute directory pathname (the repository
# appended to your $CVSROOT variable), followed by a list of filenames
# within that directory.
#
# We walk through the avail file looking for a line that matches both
# the username and repository.
#
# A username match is simply the user's name appearing in the second
# column of the avail line in a space-or-comma separate list.
#
# A repository match is either:
# - One element of the third column matches $ARGV[0], or some
# parent directory of $ARGV[0].
# - Otherwise *all* file arguments ($ARGV[1..$#ARGV]) must be
# in the file list in one avail line.
# - In other words, using directory names in the third column of
# the avail file allows committing of any file (or group of
# files in a single commit) in the tree below that directory.
# - If individual file names are used in the third column of
# the avail file, then files must be committed individually or
# all files specified in a single commit must all appear in
# third column of a single avail line.
#
$debug = 0;
$cvsroot = $ENV{'CVSROOT'};
$availfile = $cvsroot . "/CVSROOT/avail";
$myname = $ENV{"USER"} if !($myname = $ENV{"LOGNAME"});
eval "print STDERR \$die='Unknown parameter $1\n' if !defined \$$1; \$$1=\$';"
while ($ARGV[0] =~ /^(\w+)=/ && shift(@ARGV));
exit 255 if $die; # process any variable=value switches
die "Must set CVSROOT\n" if !$cvsroot;
($repos = shift) =~ s:^$cvsroot/::;
grep($_ = $repos . '/' . $_, @ARGV);
print "$$ Repos: $repos\n","$$ ==== ",join("\n$$ ==== ",@ARGV),"\n" if $debug;
$exit_val = 0; # Good Exit value
$universal_off = 0;
open (AVAIL, $availfile) || exit(0); # It is ok for avail file not to exist
while (<AVAIL>) {
chop;
next if /^\s*\#/;
next if /^\s*$/;
($flagstr, $u, $m) = split(/[\s,]*\|[\s,]*/, $_);
# Skip anything not starting with "avail" or "unavail" and complain.
(print "Bad avail line: $_\n"), next
if ($flagstr !~ /^avail/ && $flagstr !~ /^unavail/);
# Set which bit we are playing with. ('0' is OK == Available).
$flag = (($& eq "avail") ? 0 : 1);
# If we find a "universal off" flag (i.e. a simple "unavail") remember it
$universal_off = 1 if ($flag && !$u && !$m);
# $myname considered "in user list" if actually in list or is NULL
$in_user = (!$u || grep ($_ eq $myname, split(/[\s,]+/,$u)));
print "$$ \$myname($myname) in user list: $_\n" if $debug && $in_user;
# Module matches if it is a NULL module list in the avail line. If module
# list is not null, we check every argument combination.
if (!($in_repo = !$m)) {
@tmp = split(/[\s,]+/,$m);
for $j (@tmp) {
# If the repos from avail is a parent(or equal) dir of $repos, OK
$in_repo = 1, last if ($repos eq $j || $repos =~ /^$j\//);
}
if (!$in_repo) {
$in_repo = 1;
for $j (@ARGV) {
last if !($in_repo = grep ($_ eq $j, @tmp));
}
}
}
print "$$ \$repos($repos) in repository list: $_\n" if $debug && $in_repo;
$exit_val = $flag if ($in_user && $in_repo);
print "$$ ==== \$exit_val = $exit_val\n$$ ==== \$flag = $flag\n" if $debug;
}
close(AVAIL);
print "$$ ==== \$exit_val = $exit_val\n" if $debug;
print "**** Access denied: Insufficient Karma ($myname|$repos)\n" if $exit_val;
print "**** Access allowed: Personal Karma exceeds Environmental Karma.\n"
if $universal_off && !$exit_val;
exit($exit_val);
-197
View File
@@ -1,197 +0,0 @@
#!/bin/sh
#
# This program is intended to take a check.log file generated by a failed run of
# sanity.sh as input and run expr line by line on it. It seems a much easier
# way of spotting a single failed line in a 100 line test result.
#
#
# This script falls under the GNU General Public License and is intended to
# be distributed with CVS.
#
#
# No warranties, express or implied.
#
#
# Contributed by Derek R. Price <[email protected]>
#
usage ()
{
echo "\
usage: $0 [-afh] [file...]
-a process alternate pattern
-f process first pattern (default)
-h print this text
file files to process (default = check.log)"
}
# Do a line by line match with expr
#
# INPUTS
# $1 = text file name
# $2 = pattern file name
expr_line_by_line ()
{
dcl_line=0
dcl_wrong=
# We are assuming a newline at the end of the file. The way sanity.sh
# uses echo to create the log message guarantees this newline and since
# expr ignores the last newline when the anchor is present anyhow, no
# information is being lost in the transition
while test $dcl_line -lt `wc -l <$1` -a $dcl_line -lt `wc -l <$2`; do
dcl_line=`expr $dcl_line + 1`
if test `sed -ne${dcl_line}p <$1 |wc -c` -eq 1 \
-a `sed -ne${dcl_line}p <$2 |wc -c` -eq 1; then
# This is a workaround for what I am calling a bug in GNU
# expr - it won't match the empty string to the empty
# string. In this case the assumption is that a single
# character is always a newline. Since we already checked
# for the end of the file, we know sed will echo the
# newline.
:
elif expr "`sed -ne${dcl_line}p <$1`" : \
"`sed -ne${dcl_line}p <$2`\$" >/dev/null; then
:
else
echo "$dcl_line: `sed -ne${dcl_line}p <$1`"
echo "$dcl_line: `sed -ne${dcl_line}p <$2`\$"
dcl_wrong="$dcl_wrong $dcl_line"
fi
done
if test `wc -l <$1` -ne `wc -l <$2`; then
echo "output & pattern contain differing number of lines"
elif test -z "$dcl_wrong"; then
echo "no mismatched lines"
else
echo "mismatched lines: $dcl_wrong"
fi
}
# Process a single check.log file
#
# INPUTS
# $1 = filename
process_check_log ()
{
# abort if we can't find any expressions
if grep '^\*\* got: $' <$1 >/dev/null; then
:
else
echo "WARNING: No expressions in file: $1" >&2
echo " Either not a check.log or sanity.sh exited for some other reason," >&2
echo " like bad exit status. Try tail." >&2
return
fi
dcl_exprfiles=""
if grep '^\*\* or: $' <$1 >/dev/null; then
# file contains a second regex
if test $dcl_dofirst -eq 1; then
# get the first pattern
sed -ne '/^\*\* expected: $/,/^\*\* or: $/p' <$1 >/tmp/dcle$$
dcl_exprfiles="$dcl_exprfiles /tmp/dcle$$"
fi
if test $dcl_doalternate -eq 1; then
# get the alternate pattern
sed -ne '/^\*\* or: $/,/^\*\* got: $/p' <$1 >/tmp/dclo$$
dcl_exprfiles="$dcl_exprfiles /tmp/dclo$$"
else
echo "WARNING: Ignoring alternate pattern in file: $1" >&2
fi
else
# file doesn't contain a second regex
if test $dcl_dofirst = 1; then
# get the only pattern
sed -ne '/^\*\* expected: $/,/^\*\* got: $/p' <$1 >/tmp/dcle$$
dcl_exprfiles="$dcl_exprfiles /tmp/dcle$$"
fi
if test $dcl_doalternate -eq 1; then
echo "WARNING: No alternate pattern in file: $1" >&2
fi
fi
# and get the actual output
sed -ne '/^\*\* got: $/,$p' <$1 >/tmp/dclg$$
sed -ne '1D
$D
p' </tmp/dclg$$ >/tmp/dclh$$
mv /tmp/dclh$$ /tmp/dclg$$
# compare the output against each pattern requested
for dcl_f in $dcl_exprfiles; do
sed -ne '1D
$D
p' <$dcl_f >/tmp/dclp$$
mv /tmp/dclp$$ $dcl_f
case $dcl_f in
/tmp/dcle*)
echo "********** $1 : Primary **********"
;;
/tmp/dclo*)
echo "********** $1 : Alternate **********"
;;
esac
expr_line_by_line /tmp/dclg$$ $dcl_f
rm $dcl_f
done
rm /tmp/dclg$$
}
###
### MAIN
###
# set up defaults
dcl_doalternate=0
dcl_dofirst=0
# process options
while getopts afh arg; do
case $arg in
a)
dcl_doalternate=1
;;
f)
dcl_dofirst=1
;;
\?|h)
usage
exit 1
;;
esac
done
# dispose of processed args
shift `expr $OPTIND - 1`
OPTIND=1
# set the default mode
if test $dcl_doalternate -eq 0; then
dcl_dofirst=1
fi
# set default arg
if test $# -eq 0; then
dcl_argvar=dcl_default
dcl_default=check.log
else
dcl_argvar=@
fi
eval for file in \"\$$dcl_argvar\"\; do \
process_check_log \$file\; \
done
exit 0
-208
View File
@@ -1,208 +0,0 @@
#! @PERL@
# -*-Perl-*-
#
# XXX: FIXME: handle multiple '-f logfile' arguments
#
# XXX -- I HATE Perl! This *will* be re-written in shell/awk/sed soon!
#
# Usage: log.pl [-u user] [[-m mailto] ...] [-s] [-V] -f logfile 'dirname file ...'
#
# -u user - $USER passed from loginfo
# -m mailto - for each user to receive cvs log reports
# (multiple -m's permitted)
# -s - to prevent "cvs status -v" messages
# -V - without '-s', don't pass '-v' to cvs status
# -f logfile - for the logfile to append to (mandatory,
# but only one logfile can be specified).
# here is what the output looks like:
#
# From: [email protected]
# Subject: CVS update: testmodule
#
# Date: Wednesday November 23, 1994 @ 14:15
# Author: woods
#
# Update of /local/src-CVS/testmodule
# In directory kuma:/home/kuma/woods/work.d/testmodule
#
# Modified Files:
# test3
# Added Files:
# test6
# Removed Files:
# test4
# Log Message:
# - wow, what a test
#
# (and for each file the "cvs status -v" output is appended unless -s is used)
#
# ==================================================================
# File: test3 Status: Up-to-date
#
# Working revision: 1.41 Wed Nov 23 14:15:59 1994
# Repository revision: 1.41 /local/src-CVS/cvs/testmodule/test3,v
# Sticky Options: -ko
#
# Existing Tags:
# local-v2 (revision: 1.7)
# local-v1 (revision: 1.1.1.2)
# CVS-1_4A2 (revision: 1.1.1.2)
# local-v0 (revision: 1.2)
# CVS-1_4A1 (revision: 1.1.1.1)
# CVS (branch: 1.1.1)
use strict;
use IO::File;
my $cvsroot = $ENV{'CVSROOT'};
# turn off setgid
#
$) = $(;
my $dostatus = 1;
my $verbosestatus = 1;
my $users;
my $login;
my $donefiles;
my $logfile;
my @files;
# parse command line arguments
#
while (@ARGV) {
my $arg = shift @ARGV;
if ($arg eq '-m') {
$users = "$users " . shift @ARGV;
} elsif ($arg eq '-u') {
$login = shift @ARGV;
} elsif ($arg eq '-f') {
($logfile) && die "Too many '-f' args";
$logfile = shift @ARGV;
} elsif ($arg eq '-s') {
$dostatus = 0;
} elsif ($arg eq '-V') {
$verbosestatus = 0;
} else {
($donefiles) && die "Too many arguments!\n";
$donefiles = 1;
@files = split(/ /, $arg);
}
}
# the first argument is the module location relative to $CVSROOT
#
my $modulepath = shift @files;
my $mailcmd = "| Mail -s 'CVS update: $modulepath'";
# Initialise some date and time arrays
#
my @mos = ('January','February','March','April','May','June','July',
'August','September','October','November','December');
my @days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
$year += 1900;
# get a login name for the guy doing the commit....
#
if ($login eq '') {
$login = getlogin || (getpwuid($<))[0] || "nobody";
}
# open log file for appending
#
my $logfh = new IO::File ">>" . $logfile
or die "Could not open(" . $logfile . "): $!\n";
# send mail, if there's anyone to send to!
#
my $mailfh;
if ($users) {
$mailcmd = "$mailcmd $users";
$mailfh = new IO::File $mailcmd
or die "Could not Exec($mailcmd): $!\n";
}
# print out the log Header
#
$logfh->print ("\n");
$logfh->print ("****************************************\n");
$logfh->print ("Date:\t$days[$wday] $mos[$mon] $mday, $year @ $hour:" . sprintf("%02d", $min) . "\n");
$logfh->print ("Author:\t$login\n\n");
if ($mailfh) {
$mailfh->print ("\n");
$mailfh->print ("Date:\t$days[$wday] $mos[$mon] $mday, $year @ $hour:" . sprintf("%02d", $min) . "\n");
$mailfh->print ("Author:\t$login\n\n");
}
# print the stuff from logmsg that comes in on stdin to the logfile
#
my $infh = new IO::File "< -";
foreach ($infh->getlines) {
$logfh->print;
if ($mailfh) {
$mailfh->print ($_);
}
}
undef $infh;
$logfh->print ("\n");
# after log information, do an 'cvs -Qq status -v' on each file in the arguments.
#
if ($dostatus != 0) {
while (@files) {
my $file = shift @files;
if ($file eq "-") {
$logfh->print ("[input file was '-']\n");
if ($mailfh) {
$mailfh->print ("[input file was '-']\n");
}
last;
}
my $rcsfh = new IO::File;
my $pid = $rcsfh->open ("-|");
if ( !defined $pid )
{
die "fork failed: $!";
}
if ($pid == 0)
{
my @command = ('cvs', '-nQq', 'status');
if ($verbosestatus)
{
push @command, '-v';
}
push @command, $file;
exec @command;
die "cvs exec failed: $!";
}
my $line;
while ($line = $rcsfh->getline) {
$logfh->print ($line);
if ($mailfh) {
$mailfh->print ($line);
}
}
undef $rcsfh;
}
}
$logfh->close()
or die "Write to $logfile failed: $!";
if ($mailfh)
{
$mailfh->close;
die "Pipe to $mailcmd failed" if $?;
}
## must exit cleanly
##
exit 0;
-576
View File
@@ -1,576 +0,0 @@
#! @PERL@
# -*-Perl-*-
#
# Perl filter to handle the log messages from the checkin of files in
# a directory. This script will group the lists of files by log
# message, and mail a single consolidated log message at the end of
# the commit.
#
# This file assumes a pre-commit checking program that leaves the
# names of the first and last commit directories in a temporary file.
#
# Contributed by David Hampton <[email protected]>
#
# hacked greatly by Greg A. Woods <[email protected]>
# Usage: log_accum.pl [-d] [-s] [-w] [-M module] [-u user] [[-m mailto] ...] [[-R replyto] ...] [-f logfile]
# -d - turn on debugging
# -m mailto - send mail to "mailto" (multiple)
# -R replyto - set the "Reply-To:" to "replyto" (multiple)
# -M modulename - set module name to "modulename"
# -f logfile - write commit messages to logfile too
# -s - *don't* run "cvs status -v" for each file
# -w - show working directory with log message
# -u user - $USER passed from loginfo
#
# Configurable options
#
# set this to something that takes a whole message on stdin
$MAILER = "/usr/lib/sendmail -t";
#
# End user configurable options.
#
# Constants (don't change these!)
#
$STATE_NONE = 0;
$STATE_CHANGED = 1;
$STATE_ADDED = 2;
$STATE_REMOVED = 3;
$STATE_LOG = 4;
$LAST_FILE = "/tmp/#cvs.lastdir";
$CHANGED_FILE = "/tmp/#cvs.files.changed";
$ADDED_FILE = "/tmp/#cvs.files.added";
$REMOVED_FILE = "/tmp/#cvs.files.removed";
$LOG_FILE = "/tmp/#cvs.files.log";
$FILE_PREFIX = "#cvs.files";
#
# Subroutines
#
sub cleanup_tmpfiles {
local($wd, @files);
$wd = `pwd`;
chdir("/tmp") || die("Can't chdir('/tmp')\n");
opendir(DIR, ".");
push(@files, grep(/^$FILE_PREFIX\..*\.$id$/, readdir(DIR)));
closedir(DIR);
foreach (@files) {
unlink $_;
}
unlink $LAST_FILE . "." . $id;
chdir($wd);
}
sub write_logfile {
local($filename, @lines) = @_;
open(FILE, ">$filename") || die("Cannot open log file $filename.\n");
print FILE join("\n", @lines), "\n";
close(FILE);
}
sub append_to_logfile {
local($filename, @lines) = @_;
open(FILE, ">$filename") || die("Cannot open log file $filename.\n");
print FILE join("\n", @lines), "\n";
close(FILE);
}
sub format_names {
local($dir, @files) = @_;
local(@lines);
$format = "\t%-" . sprintf("%d", length($dir)) . "s%s ";
$lines[0] = sprintf($format, $dir, ":");
if ($debug) {
print STDERR "format_names(): dir = ", $dir, "; files = ", join(":", @files), ".\n";
}
foreach $file (@files) {
if (length($lines[$#lines]) + length($file) > 65) {
$lines[++$#lines] = sprintf($format, " ", " ");
}
$lines[$#lines] .= $file . " ";
}
@lines;
}
sub format_lists {
local(@lines) = @_;
local(@text, @files, $lastdir);
if ($debug) {
print STDERR "format_lists(): ", join(":", @lines), "\n";
}
@text = ();
@files = ();
$lastdir = shift @lines; # first thing is always a directory
if ($lastdir !~ /.*\/$/) {
die("Damn, $lastdir doesn't look like a directory!\n");
}
foreach $line (@lines) {
if ($line =~ /.*\/$/) {
push(@text, &format_names($lastdir, @files));
$lastdir = $line;
@files = ();
} else {
push(@files, $line);
}
}
push(@text, &format_names($lastdir, @files));
@text;
}
sub append_names_to_file {
local($filename, $dir, @files) = @_;
if (@files) {
open(FILE, ">>$filename") || die("Cannot open file $filename.\n");
print FILE $dir, "\n";
print FILE join("\n", @files), "\n";
close(FILE);
}
}
sub read_line {
local($line);
local($filename) = @_;
open(FILE, "<$filename") || die("Cannot open file $filename.\n");
$line = <FILE>;
close(FILE);
chop($line);
$line;
}
sub read_logfile {
local(@text);
local($filename, $leader) = @_;
open(FILE, "<$filename");
while (<FILE>) {
chop;
push(@text, $leader.$_);
}
close(FILE);
@text;
}
sub build_header {
local($header);
local($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$header = sprintf("CVSROOT:\t%s\nModule name:\t%s\nRepository:\t%s\nChanges by:\t%s@%s\t%02d/%02d/%02d %02d:%02d:%02d",
$cvsroot,
$modulename,
$dir,
$login, $hostdomain,
$year%100, $mon+1, $mday,
$hour, $min, $sec);
}
sub mail_notification {
local(@text) = @_;
# if only we had strftime()... stuff stolen from perl's ctime.pl:
local($[) = 0;
@DoW = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
@MoY = ('Jan','Feb','Mar','Apr','May','Jun',
'Jul','Aug','Sep','Oct','Nov','Dec');
# Determine what time zone is in effect.
# Use GMT if TZ is defined as null, local time if TZ undefined.
# There's no portable way to find the system default timezone.
#
$TZ = defined($ENV{'TZ'}) ? ( $ENV{'TZ'} ? $ENV{'TZ'} : 'GMT' ) : '';
# Hack to deal with 'PST8PDT' format of TZ
# Note that this can't deal with all the esoteric forms, but it
# does recognize the most common: [:]STDoff[DST[off][,rule]]
#
if ($TZ =~ /^([^:\d+\-,]{3,})([+-]?\d{1,2}(:\d{1,2}){0,2})([^\d+\-,]{3,})?/) {
$TZ = $isdst ? $4 : $1;
$tzoff = sprintf("%05d", -($2) * 100);
}
# perl-4.036 doesn't have the $zone or $gmtoff...
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst, $zone, $gmtoff) =
($TZ eq 'GMT') ? gmtime(time) : localtime(time);
$year += ($year < 70) ? 2000 : 1900;
if ($gmtoff != 0) {
$tzoff = sprintf("%05d", ($gmtoff / 60) * 100);
}
if ($zone ne '') {
$TZ = $zone;
}
# ok, let's try....
$rfc822date = sprintf("%s, %2d %s %4d %2d:%02d:%02d %s (%s)",
$DoW[$wday], $mday, $MoY[$mon], $year,
$hour, $min, $sec, $tzoff, $TZ);
open(MAIL, "| $MAILER");
print MAIL "Date: " . $rfc822date . "\n";
print MAIL "Subject: CVS Update: " . $modulename . "\n";
print MAIL "To: " . $mailto . "\n";
print MAIL "Reply-To: " . $replyto . "\n";
print MAIL "\n";
print MAIL join("\n", @text), "\n";
close(MAIL);
}
sub write_commitlog {
local($logfile, @text) = @_;
open(FILE, ">>$logfile");
print FILE join("\n", @text), "\n";
close(FILE);
}
#
# Main Body
#
# Initialize basic variables
#
$debug = 0;
$id = getpgrp(); # note, you *must* use a shell which does setpgrp()
$state = $STATE_NONE;
chop($hostname = `hostname`);
chop($domainname = `domainname`);
if ($domainname !~ '^\..*') {
$domainname = '.' . $domainname;
}
$hostdomain = $hostname . $domainname;
$cvsroot = $ENV{'CVSROOT'};
$do_status = 1; # moderately useful
$show_wd = 0; # useless in client/server
$modulename = "";
# parse command line arguments (file list is seen as one arg)
#
while (@ARGV) {
$arg = shift @ARGV;
if ($arg eq '-d') {
$debug = 1;
print STDERR "Debug turned on...\n";
} elsif ($arg eq '-m') {
if ($mailto eq '') {
$mailto = shift @ARGV;
} else {
$mailto = $mailto . ", " . shift @ARGV;
}
} elsif ($arg eq '-R') {
if ($replyto eq '') {
$replyto = shift @ARGV;
} else {
$replyto = $replyto . ", " . shift @ARGV;
}
} elsif ($arg eq '-M') {
$modulename = shift @ARGV;
} elsif ($arg eq '-u') {
$login = shift @ARGV;
} elsif ($arg eq '-s') {
$do_status = 0;
} elsif ($arg eq '-w') {
$show_wd = 1;
} elsif ($arg eq '-f') {
($commitlog) && die("Too many '-f' args\n");
$commitlog = shift @ARGV;
} else {
($donefiles) && die("Too many arguments! Check usage.\n");
$donefiles = 1;
@files = split(/ /, $arg);
}
}
if ($login eq '') {
$login = getlogin || (getpwuid($<))[0] || "nobody";
}
($mailto) || die("No mail recipient specified (use -m)\n");
if ($replyto eq '') {
$replyto = $login;
}
# for now, the first "file" is the repository directory being committed,
# relative to the $CVSROOT location
#
@path = split('/', $files[0]);
# XXX There are some ugly assumptions in here about module names and
# XXX directories relative to the $CVSROOT location -- really should
# XXX read $CVSROOT/CVSROOT/modules, but that's not so easy to do, since
# XXX we have to parse it backwards.
# XXX
# XXX Fortunately it's relatively easy for the user to specify the
# XXX module name as appropriate with a '-M' via the directory
# XXX matching in loginfo.
#
if ($modulename eq "") {
$modulename = $path[0]; # I.e. the module name == top-level dir
}
if ($#path == 0) {
$dir = ".";
} else {
$dir = join('/', @path);
}
$dir = $dir . "/";
if ($debug) {
print STDERR "module - ", $modulename, "\n";
print STDERR "dir - ", $dir, "\n";
print STDERR "path - ", join(":", @path), "\n";
print STDERR "files - ", join(":", @files), "\n";
print STDERR "id - ", $id, "\n";
}
# Check for a new directory first. This appears with files set as follows:
#
# files[0] - "path/name/newdir"
# files[1] - "-"
# files[2] - "New"
# files[3] - "directory"
#
if ($files[2] =~ /New/ && $files[3] =~ /directory/) {
local(@text);
@text = ();
push(@text, &build_header());
push(@text, "");
push(@text, $files[0]);
push(@text, "");
while (<STDIN>) {
chop; # Drop the newline
push(@text, $_);
}
&mail_notification($mailto, @text);
exit 0;
}
# Check for an import command. This appears with files set as follows:
#
# files[0] - "path/name"
# files[1] - "-"
# files[2] - "Imported"
# files[3] - "sources"
#
if ($files[2] =~ /Imported/ && $files[3] =~ /sources/) {
local(@text);
@text = ();
push(@text, &build_header());
push(@text, "");
push(@text, $files[0]);
push(@text, "");
while (<STDIN>) {
chop; # Drop the newline
push(@text, $_);
}
&mail_notification(@text);
exit 0;
}
# Iterate over the body of the message collecting information.
#
while (<STDIN>) {
chop; # Drop the newline
if (/^In directory/) {
if ($show_wd) { # useless in client/server mode
push(@log_lines, $_);
push(@log_lines, "");
}
next;
}
if (/^Modified Files/) { $state = $STATE_CHANGED; next; }
if (/^Added Files/) { $state = $STATE_ADDED; next; }
if (/^Removed Files/) { $state = $STATE_REMOVED; next; }
if (/^Log Message/) { $state = $STATE_LOG; next; }
s/^[ \t\n]+//; # delete leading whitespace
s/[ \t\n]+$//; # delete trailing whitespace
if ($state == $STATE_CHANGED) { push(@changed_files, split); }
if ($state == $STATE_ADDED) { push(@added_files, split); }
if ($state == $STATE_REMOVED) { push(@removed_files, split); }
if ($state == $STATE_LOG) { push(@log_lines, $_); }
}
# Strip leading and trailing blank lines from the log message. Also
# compress multiple blank lines in the body of the message down to a
# single blank line.
#
while ($#log_lines > -1) {
last if ($log_lines[0] ne "");
shift(@log_lines);
}
while ($#log_lines > -1) {
last if ($log_lines[$#log_lines] ne "");
pop(@log_lines);
}
for ($i = $#log_lines; $i > 0; $i--) {
if (($log_lines[$i - 1] eq "") && ($log_lines[$i] eq "")) {
splice(@log_lines, $i, 1);
}
}
if ($debug) {
print STDERR "Searching for log file index...";
}
# Find an index to a log file that matches this log message
#
for ($i = 0; ; $i++) {
local(@text);
last if (! -e "$LOG_FILE.$i.$id"); # the next available one
@text = &read_logfile("$LOG_FILE.$i.$id", "");
last if ($#text == -1); # nothing in this file, use it
last if (join(" ", @log_lines) eq join(" ", @text)); # it's the same log message as another
}
if ($debug) {
print STDERR " found log file at $i.$id, now writing tmp files.\n";
}
# Spit out the information gathered in this pass.
#
&append_names_to_file("$CHANGED_FILE.$i.$id", $dir, @changed_files);
&append_names_to_file("$ADDED_FILE.$i.$id", $dir, @added_files);
&append_names_to_file("$REMOVED_FILE.$i.$id", $dir, @removed_files);
&write_logfile("$LOG_FILE.$i.$id", @log_lines);
# Check whether this is the last directory. If not, quit.
#
if ($debug) {
print STDERR "Checking current dir against last dir.\n";
}
$_ = &read_line("$LAST_FILE.$id");
if ($_ ne $cvsroot . "/" . $files[0]) {
if ($debug) {
print STDERR sprintf("Current directory %s is not last directory %s.\n", $cvsroot . "/" .$files[0], $_);
}
exit 0;
}
if ($debug) {
print STDERR sprintf("Current directory %s is last directory %s -- all commits done.\n", $files[0], $_);
}
#
# End Of Commits!
#
# This is it. The commits are all finished. Lump everything together
# into a single message, fire a copy off to the mailing list, and drop
# it on the end of the Changes file.
#
#
# Produce the final compilation of the log messages
#
@text = ();
@status_txt = ();
push(@text, &build_header());
push(@text, "");
for ($i = 0; ; $i++) {
last if (! -e "$LOG_FILE.$i.$id"); # we're done them all!
@lines = &read_logfile("$CHANGED_FILE.$i.$id", "");
if ($#lines >= 0) {
push(@text, "Modified files:");
push(@text, &format_lists(@lines));
}
@lines = &read_logfile("$ADDED_FILE.$i.$id", "");
if ($#lines >= 0) {
push(@text, "Added files:");
push(@text, &format_lists(@lines));
}
@lines = &read_logfile("$REMOVED_FILE.$i.$id", "");
if ($#lines >= 0) {
push(@text, "Removed files:");
push(@text, &format_lists(@lines));
}
if ($#text >= 0) {
push(@text, "");
}
@lines = &read_logfile("$LOG_FILE.$i.$id", "\t");
if ($#lines >= 0) {
push(@text, "Log message:");
push(@text, @lines);
push(@text, "");
}
if ($do_status) {
local(@changed_files);
@changed_files = ();
push(@changed_files, &read_logfile("$CHANGED_FILE.$i.$id", ""));
push(@changed_files, &read_logfile("$ADDED_FILE.$i.$id", ""));
push(@changed_files, &read_logfile("$REMOVED_FILE.$i.$id", ""));
if ($debug) {
print STDERR "main: pre-sort changed_files = ", join(":", @changed_files), ".\n";
}
sort(@changed_files);
if ($debug) {
print STDERR "main: post-sort changed_files = ", join(":", @changed_files), ".\n";
}
foreach $dofile (@changed_files) {
if ($dofile =~ /\/$/) {
next; # ignore the silly "dir" entries
}
if ($debug) {
print STDERR "main(): doing 'cvs -nQq status -v $dofile'\n";
}
open(STATUS, "-|") || exec 'cvs', '-nQq', 'status', '-v', $dofile;
while (<STATUS>) {
chop;
push(@status_txt, $_);
}
}
}
}
# Write to the commitlog file
#
if ($commitlog) {
&write_commitlog($commitlog, @text);
}
if ($#status_txt >= 0) {
push(@text, @status_txt);
}
# Mailout the notification.
#
&mail_notification(@text);
# cleanup
#
if (! $debug) {
&cleanup_tmpfiles();
}
exit 0;
-85
View File
@@ -1,85 +0,0 @@
#! @PERL@
# -*-Perl-*-
#
# From: [email protected] (John Clyne)
# Date: Fri, 28 Feb 92 09:54:21 MST
#
# BTW, i wrote a perl script that is similar to 'nfpipe' except that in
# addition to logging to a file it provides a command line option for mailing
# change notices to a group of users. Obviously you probably wouldn't want
# to mail every change. But there may be certain directories that are commonly
# accessed by a group of users who would benefit from an email notice.
# Especially if they regularly beat on the same directory. Anyway if you
# think anyone would be interested here it is.
#
# File: mfpipe
#
# Author: John Clyne
# National Center for Atmospheric Research
# PO 3000, Boulder, Colorado
#
# Date: Wed Feb 26 18:34:53 MST 1992
#
# Description: Tee standard input to mail a list of users and to
# a file. Used by CVS logging.
#
# Usage: mfpipe [-f file] [user@host...]
#
# Environment: CVSROOT
# Path to CVS root.
#
# Files:
#
#
# Options: -f file
# Capture output to 'file'
#
$header = "Log Message:\n";
$mailcmd = "| mail -s 'CVS update notice'";
$whoami = `whoami`;
chop $whoami;
$date = `date`;
chop $date;
$cvsroot = $ENV{'CVSROOT'};
while (@ARGV) {
$arg = shift @ARGV;
if ($arg eq '-f') {
$file = shift @ARGV;
}
else {
$users = "$users $arg";
}
}
if ($users) {
$mailcmd = "$mailcmd $users";
open(MAIL, $mailcmd) || die "Execing $mail: $!\n";
}
if ($file) {
$logfile = "$cvsroot/LOG/$file";
open(FILE, ">> $logfile") || die "Opening $logfile: $!\n";
}
print FILE "$whoami $date--------BEGIN LOG ENTRY-------------\n" if ($logfile);
while (<>) {
print FILE $log if ($log && $logfile);
print FILE $_ if ($logfile);
print MAIL $_ if ($users);
$log = "log: " if ($_ eq $header);
}
close FILE;
die "Write failed" if $?;
close MAIL;
die "Mail failed" if $?;
exit 0;
-235
View File
@@ -1,235 +0,0 @@
#! @PERL@
# -*-Perl-*-
# Author: John Rouillard ([email protected])
# Supported: Yeah right. (Well what do you expect for 2 hours work?)
# Blame-to: [email protected]
# Complaints to: Anybody except Brian Berliner, he's blameless for
# this script.
# Acknowlegements: The base code for this script has been acquired
# from the log.pl script.
# rcslock.pl - A program to prevent commits when a file to be ckecked
# in is locked in the repository.
# There are times when you need exclusive access to a file. This
# often occurs when binaries are checked into the repository, since
# cvs's (actually rcs's) text based merging mechanism won't work. This
# script allows you to use the rcs lock mechanism (rcs -l) to make
# sure that no changes to a repository are able to be committed if
# those changes would result in a locked file being changed.
# WARNING:
# This script will work only if locking is set to strict.
#
# Setup:
# Add the following line to the commitinfo file:
# ALL /local/location/for/script/lockcheck [options]
# Where ALL is replaced by any suitable regular expression.
# Options are -v for verbose info, or -d for debugging info.
# The %s will provide the repository directory name and the names of
# all changed files.
# Use:
# When a developer needs exclusive access to a version of a file, s/he
# should use "rcs -l" in the repository tree to lock the version they
# are working on. CVS will automagically release the lock when the
# commit is performed.
# Method:
# An "rlog -h" is exec'ed to give info on all about to be
# committed files. This (header) information is parsed to determine
# if any locks are outstanding and what versions of the file are
# locked. This filename, version number info is used to index an
# associative array. All of the files to be committed are checked to
# see if any locks are outstanding. If locks are outstanding, the
# version number of the current file (taken from the CVS/Entries
# subdirectory) is used in the key to determine if that version is
# locked. If the file being checked in is locked by the person doing
# the checkin, the commit is allowed, but if the lock is held on that
# version of a file by another person, the commit is not allowed.
$ext = ",v"; # The extension on your rcs files.
$\="\n"; # I hate having to put \n's at the end of my print statements
$,=' '; # Spaces should occur between arguments to print when printed
# turn off setgid
#
$) = $(;
#
# parse command line arguments
#
require 'getopts.pl';
&Getopts("vd"); # verbose or debugging
# Verbose is useful when debugging
$opt_v = $opt_d if defined $opt_d;
# $files[0] is really the name of the subdirectory.
# @files = split(/ /,$ARGV[0]);
@files = @ARGV[0..$#ARGV];
$cvsroot = $ENV{'CVSROOT'};
#
# get login name
#
$login = getlogin || (getpwuid($<))[0] || "nobody";
#
# save the current directory since we have to return here to parse the
# CVS/Entries file if a lock is found.
#
$pwd = `/bin/pwd`;
chop $pwd;
print "Starting directory is $pwd" if defined $opt_d ;
#
# cd to the repository directory and check on the files.
#
print "Checking directory ", $files[0] if defined $opt_v ;
if ( $files[0] =~ /^\// )
{
print "Directory path is $files[0]" if defined $opt_d ;
chdir $files[0] || die "Can't change to repository directory $files[0]" ;
}
else
{
print "Directory path is $cvsroot/$files[0]" if defined $opt_d ;
chdir ($cvsroot . "/" . $files[0]) ||
die "Can't change to repository directory $files[0] in $cvsroot" ;
}
# Open the rlog process and apss all of the file names to that one
# process to cut down on exec overhead. This may backfire if there
# are too many files for the system buffer to handle, but if there are
# that many files, chances are that the cvs repository is not set up
# cleanly.
print "opening rlog -h @files[1..$#files] |" if defined $opt_d;
open( RLOG, "rlog -h @files[1..$#files] |") || die "Can't run rlog command" ;
# Create the locks associative array. The elements in the array are
# of two types:
#
# The name of the RCS file with a value of the total number of locks found
# for that file,
# or
#
# The name of the rcs file concatenated with the version number of the lock.
# The value of this element is the name of the locker.
# The regular expressions used to split the rcs info may have to be changed.
# The current ones work for rcs 5.6.
$lock = 0;
while (<RLOG>)
{
chop;
next if /^$/; # ditch blank lines
if ( $_ =~ /^RCS file: (.*)$/ )
{
$curfile = $1;
next;
}
if ( $_ =~ /^locks: strict$/ )
{
$lock = 1 ;
next;
}
if ( $lock )
{
# access list: is the line immediately following the list of locks.
if ( /^access list:/ )
{ # we are done getting lock info for this file.
$lock = 0;
}
else
{ # We are accumulating lock info.
# increment the lock count
$locks{$curfile}++;
# save the info on the version that is locked. $2 is the
# version number $1 is the name of the locker.
$locks{"$curfile" . "$2"} = $1
if /[ ]*([a-zA-Z._]*): ([0-9.]*)$/;
print "lock by $1 found on $curfile version $2" if defined $opt_d;
}
}
}
# Lets go back to the starting directory and see if any locked files
# are ones we are interested in.
chdir $pwd;
# fo all of the file names (remember $files[0] is the directory name
foreach $i (@files[1..$#files])
{
if ( defined $locks{$i . $ext} )
{ # well the file has at least one lock outstanding
# find the base version number of our file
&parse_cvs_entry($i,*entry);
# is our version of this file locked?
if ( defined $locks{$i . $ext . $entry{"version"}} )
{ # if so, it is by us?
if ( $login ne ($by = $locks{$i . $ext . $entry{"version"}}) )
{# crud somebody else has it locked.
$outstanding_lock++ ;
print "$by has file $i locked for version " , $entry{"version"};
}
else
{ # yeah I have it locked.
print "You have a lock on file $i for version " , $entry{"version"}
if defined $opt_v;
}
}
}
}
exit $outstanding_lock;
### End of main program
sub parse_cvs_entry
{ # a very simple minded hack at parsing an entries file.
local ( $file, *entry ) = @_;
local ( @pp );
open(ENTRIES, "< CVS/Entries") || die "Can't open entries file";
while (<ENTRIES>)
{
if ( $_ =~ /^\/$file\// )
{
@pp = split('/');
$entry{"name"} = $pp[1];
$entry{"version"} = $pp[2];
$entry{"dates"} = $pp[3];
$entry{"name"} = $pp[4];
$entry{"name"} = $pp[5];
$entry{"sticky"} = $pp[6];
return;
}
}
}
-281
View File
@@ -1,281 +0,0 @@
#! @CSH@ -f
#
# Sccs2rcs is a script to convert an existing SCCS
# history into an RCS history without losing any of
# the information contained therein.
# It has been tested under the following OS's:
# SunOS 3.5, 4.0.3, 4.1
# Ultrix-32 2.0, 3.1
#
# Things to note:
# + It will NOT delete or alter your ./SCCS history under any circumstances.
#
# + Run in a directory where ./SCCS exists and where you can
# create ./RCS
#
# + /usr/local/bin is put in front of the default path.
# (SCCS under Ultrix is set-uid sccs, bad bad bad, so
# /usr/local/bin/sccs here fixes that)
#
# + Date, time, author, comments, branches, are all preserved.
#
# + If a command fails somewhere in the middle, it bombs with
# a message -- remove what it's done so far and try again.
# "rm -rf RCS; sccs unedit `sccs tell`; sccs clean"
# There is no recovery and exit is far from graceful.
# If a particular module is hanging you up, consider
# doing it separately; move it from the current area so that
# the next run will have a better chance or working.
# Also (for the brave only) you might consider hacking
# the s-file for simpler problems: I've successfully changed
# the date of a delta to be in sync, then run "sccs admin -z"
# on the thing.
#
# + After everything finishes, ./SCCS will be moved to ./old-SCCS.
#
# This file may be copied, processed, hacked, mutilated, and
# even destroyed as long as you don't tell anyone you wrote it.
#
# Ken Cox
# Viewlogic Systems, Inc.
# [email protected]
# ...!harvard!cg-atla!viewlog!kenstir
#
# Various hacks made by Brian Berliner before inclusion in CVS contrib area.
# $FreeBSD$
#we'll assume the user set up the path correctly
# for the Pmax, /usr/ucb/sccs is suid sccs, what a pain
# /usr/local/bin/sccs should override /usr/ucb/sccs there
set path = (/usr/local/bin $path)
############################################################
# Error checking
#
if (! -w .) then
echo "Error: ./ not writeable by you."
exit 1
endif
if (! -d SCCS) then
echo "Error: ./SCCS directory not found."
exit 1
endif
set edits = (`sccs tell`)
if ($#edits) then
echo "Error: $#edits file(s) out for edit...clean up before converting."
exit 1
endif
if (-d RCS) then
echo "Warning: RCS directory exists"
if (`ls -a RCS | wc -l` > 2) then
echo "Error: RCS directory not empty"
exit 1
endif
else
mkdir RCS
endif
sccs clean
set logfile = /tmp/sccs2rcs_$$_log
rm -f $logfile
set tmpfile = /tmp/sccs2rcs_$$_tmp
rm -f $tmpfile
set emptyfile = /tmp/sccs2rcs_$$_empty
echo -n "" > $emptyfile
set initialfile = /tmp/sccs2rcs_$$_init
echo "Initial revision" > $initialfile
set sedfile = /tmp/sccs2rcs_$$_sed
rm -f $sedfile
set revfile = /tmp/sccs2rcs_$$_rev
rm -f $revfile
# the quotes surround the dollar signs to fool RCS when I check in this script
set sccs_keywords = (\
'%W%[ ]*%G%'\
'%W%[ ]*%E%'\
'%W%'\
'%Z%%M%[ ]*%I%[ ]*%G%'\
'%Z%%M%[ ]*%I%[ ]*%E%'\
'%M%[ ]*%I%[ ]*%G%'\
'%M%[ ]*%I%[ ]*%E%'\
'%M%'\
'%I%'\
'%G%'\
'%E%'\
'%U%')
set rcs_keywords = (\
'$'Id'$'\
'$'Id'$'\
'$'Id'$'\
'$'SunId'$'\
'$'SunId'$'\
'$'Id'$'\
'$'Id'$'\
'$'RCSfile'$'\
'$'Revision'$'\
'$'Date'$'\
'$'Date'$'\
'')
############################################################
# Get some answers from user
#
echo ""
echo "Do you want to be prompted for a description of each"
echo "file as it is checked in to RCS initially?"
echo -n "(y=prompt for description, n=null description) [y] ?"
set ans = $<
if ((_$ans == _) || (_$ans == _y) || (_$ans == _Y)) then
set nodesc = 0
else
set nodesc = 1
endif
echo ""
echo "The default keyword substitutions are as follows and are"
echo "applied in the order specified:"
set i = 1
while ($i <= $#sccs_keywords)
# echo ' '\"$sccs_keywords[$i]\"' ==> '\"$rcs_keywords[$i]\"
echo " $sccs_keywords[$i] ==> $rcs_keywords[$i]"
@ i = $i + 1
end
echo ""
echo -n "Do you want to change them [n] ?"
set ans = $<
if ((_$ans != _) && (_$ans != _n) && (_$ans != _N)) then
echo "You can't always get what you want."
echo "Edit this script file and change the variables:"
echo ' $sccs_keywords'
echo ' $rcs_keywords'
else
echo "good idea."
endif
# create the sed script
set i = 1
while ($i <= $#sccs_keywords)
echo "s,$sccs_keywords[$i],$rcs_keywords[$i],g" >> $sedfile
@ i = $i + 1
end
onintr ERROR
############################################################
# Loop over every s-file in SCCS dir
#
foreach sfile (SCCS/s.*)
# get rid of the "s." at the beginning of the name
set file = `echo $sfile:t | sed -e "s/^..//"`
# work on each rev of that file in ascending order
set firsttime = 1
sccs prs $file | grep "^D " | awk '{print $2}' | sed -e 's/\./ /g' | sort -n -u +0 +1 +2 +3 +4 +5 +6 +7 +8 | sed -e 's/ /./g' > $revfile
foreach rev (`cat $revfile`)
if ($status != 0) goto ERROR
# get file into current dir and get stats
set date = `sccs prs -r$rev $file | grep "^D " | awk '{printf("19%s %s", $3, $4); exit}'`
set year = `echo $date | cut -c3-4`
if ($year < 70) then
# Y2K Bug, change century to 20
set date = `echo $date | sed -e s/19/20/`
endif
set author = `sccs prs -r$rev $file | grep "^D " | awk '{print $5; exit}'`
echo ""
echo "==> file $file, rev=$rev, date=$date, author=$author"
sccs edit -r$rev $file >>& $logfile
if ($status != 0) goto ERROR
echo checked out of SCCS
# add RCS keywords in place of SCCS keywords
sed -f $sedfile $file > $tmpfile
if ($status != 0) goto ERROR
echo performed keyword substitutions
cp $tmpfile $file
# check file into RCS
if ($firsttime) then
set firsttime = 0
if ($nodesc) then
echo about to do ci
echo ci -f -r$rev -d"$date" -w$author -t$emptyfile $file
ci -f -r$rev -d"$date" -w$author -t$emptyfile $file < $initialfile >>& $logfile
if ($status != 0) goto ERROR
echo initial rev checked into RCS without description
else
echo ""
echo Enter a brief description of the file $file \(end w/ Ctrl-D\):
cat > $tmpfile
ci -f -r$rev -d"$date" -w$author -t$tmpfile $file < $initialfile >>& $logfile
if ($status != 0) goto ERROR
echo initial rev checked into RCS
endif
else
# get RCS lock
set lckrev = `echo $rev | sed -e 's/\.[0-9]*$//'`
if ("$lckrev" =~ [0-9]*.*) then
# need to lock the brach -- it is OK if the lock fails
rcs -l$lckrev $file >>& $logfile
else
# need to lock the trunk -- must succeed
rcs -l $file >>& $logfile
if ($status != 0) goto ERROR
endif
echo got lock
sccs prs -r$rev $file | grep "." > $tmpfile
# it's OK if grep fails here and gives status == 1
# put the delta message in $tmpfile
ed $tmpfile >>& $logfile <<EOF
/COMMENTS
1,.d
w
q
EOF
ci -f -r$rev -d"$date" -w$author $file < $tmpfile >>& $logfile
if ($status != 0) goto ERROR
echo checked into RCS
endif
sccs unedit $file >>& $logfile
if ($status != 0) goto ERROR
end
rm -f $file
end
############################################################
# Clean up
#
echo cleaning up...
mv SCCS old-SCCS
rm -f $tmpfile $emptyfile $initialfile $sedfile
echo ===================================================
echo " Conversion Completed Successfully"
echo ""
echo " SCCS history now in old-SCCS/"
echo ===================================================
set exitval = 0
goto cleanup
ERROR:
foreach f (`sccs tell`)
sccs unedit $f
end
echo ""
echo ""
echo Danger\! Danger\!
echo Some command exited with a non-zero exit status.
echo Log file exists in $logfile.
echo ""
echo Incomplete history in ./RCS -- remove it
echo Original unchanged history in ./SCCS
set exitval = 1
cleanup:
# leave log file
rm -f $tmpfile $emptyfile $initialfile $sedfile $revfile
exit $exitval
-358
View File
@@ -1,358 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
# Copyright 1999, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program 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 General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# Originally written by Alexandre Oliva <[email protected]>.
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# `libtool' can also be set to `yes' or `no'.
depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay!
"$@" -MT "$object" -MF "$tmpdepfile" -MD -MP
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
rm -f "$depfile"
cp "$tmpdepfile" "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file.
tr ' ' '
' < "$tmpdepfile" | \
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' -e '/^#/d' | sed -e 's/$/ :/' >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file.
tmpdepfile=`echo "$object" | sed 's/\(.*\)\..*$/\1.u/'`
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
rm -f "$depfile"
cp "$tmpdepfile" "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file.
tr ' ' '
' < "$tmpdepfile" | \
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
test -z "$dashmflag" && dashmflag=-M
( IFS=" "
case " $* " in
*" --mode=compile "*) # this is libtool, let us make it quiet
for arg
do # cycle over the arguments
case "$arg" in
"--mode=compile")
# insert --quiet before "--mode=compile"
set fnord "$@" --quiet
shift # fnord
;;
esac
set fnord "$@" "$arg"
shift # fnord
shift # "$arg"
done
;;
esac
"$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
# X makedepend
(
shift
cleared=no
for arg in "$@"; do
case $cleared in no)
set ""; shift
cleared=yes
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift;;
-*)
;;
*)
set fnord "$@" "$arg"; shift;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tail +3 "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
( IFS=" "
case " $* " in
*" --mode=compile "*)
for arg
do # cycle over the arguments
case $arg in
"--mode=compile")
# insert --quiet before "--mode=compile"
set fnord "$@" --quiet
shift # fnord
;;
esac
set fnord "$@" "$arg"
shift # fnord
shift # "$arg"
done
;;
esac
"$@" -E |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
( IFS=" "
case " $* " in
*" --mode=compile "*)
for arg
do # cycle over the arguments
case $arg in
"--mode=compile")
# insert --quiet before "--mode=compile"
set fnord "$@" --quiet
shift # fnord
;;
esac
set fnord "$@" "$arg"
shift # fnord
shift # "$arg"
done
;;
esac
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
-24
View File
@@ -1,24 +0,0 @@
## Makefile.am for GNU DIFF
## Copyright (C) 2001 Free Software Foundation, Inc.
##
## This file is part of GNU DIFF.
##
## GNU DIFF is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later version.
##
## GNU DIFF 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 General Public License for more details.
INCLUDES = -I$(top_srcdir)/lib
noinst_LIBRARIES = libdiff.a
libdiff_a_SOURCES = diff.c diff3.c analyze.c cmpbuf.c cmpbuf.h io.c \
context.c ed.c normal.c ifdef.c util.c dir.c version.c diff.h \
side.c system.h diffrun.h
EXTRA_DIST = ChangeLog build_diff.com diagmeet.note libdiff.dsp
-157
View File
@@ -1,157 +0,0 @@
## Process this file with automake to produce Makefile.in
# Makefile for GNU CVS documentation (excluding man pages - see ../man).
# Copyright (C) 1986, 1988-1990, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program 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 General Public License for more details.
#DISTFILES = \
# .cvsignore \
# RCSFILES \
# AUTOMAKE_OPTIONS = no-texinfo.tex
# FIXME - these rebuild every 'make dist' with some BSD makes due to a bug
# that prevents make from searching VPATH for targets. There is some
# machinery in place in configure.in to work around this for some targets
# (see the CVSvn.texi target below) now, but fixing the two info_TEXINFOS
# targets below is probably going to require work on Automake
info_TEXINFOS = cvs.texinfo cvsclient.texi
cvs_TEXINFOS = CVSvn.texi
cvsclient_TEXINFOS = CVSvn.texi
POSTSCRIPTS = \
cvs.ps \
cvs-paper.ps \
cvsclient.ps
PDFS = \
cvs-paper.pdf \
cvs.pdf \
cvsclient.pdf
TXTS = \
cvs.txt \
cvsclient.txt
EXTRA_DIST = \
$(POSTSCRIPTS) \
.cvsignore \
CVSvn.texi.in \
ChangeLog.fsf \
RCSFILES \
cvs-paper.ms \
cvs.aux \
cvsclient.aux
# Listing cvs.cps & cvs.fns here is a workaround for an Automake deficiency
MOSTLYCLEANFILES = \
cvs.cps \
cvs.fns
CLEANFILES = \
$(PDFS) \
$(TXTS)
MAINTAINERCLEANFILES = \
cvs-paper.ps
doc ps: $(POSTSCRIPTS)
.PHONY: doc ps
pdf: $(PDFS)
.PHONY: pdf
txt: $(TXTS)
.PHONY: txt
dvi: cvs.dvi cvsclient.dvi
.PHONY: dvi
cvs.aux cvs.pdf cvs.txt: cvs.texinfo $(cvs_TEXINFOS)
cvsclient.aux cvsclient.pdf cvsclient.txt: cvsclient.texi $(cvsclient_TEXINFOS)
# These targets need to be very specific so that the other PDFs get generated correctly.
# If they are more generic and cvs.ps is made before cvs.pdf, then cvs.pdf will be
# generated from the generic target and the PS source, which contains less information
# than the usual texinfo source.
cvs-paper.pdf: cvs-paper.ps
$(ROFF) -t -p -ms -Tps $< > $@-t
mv $@-t $@
cvs-paper.ps: cvs-paper.ms
$(PS2PDF) $< $@
SUFFIXES = .aux .txt .pdf
# texinfo based targets automake neglects to include
.texinfo.pdf:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) --pdf $<
.txi.pdf:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) --pdf $<
.texi.pdf:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) --pdf $<
.texinfo.aux:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi.aux:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.texi.aux:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.texinfo.txt:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(MAKEINFO) $< --no-headers -o $@
.txi.txt:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(MAKEINFO) $< --no-headers -o $@
.texi.txt:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(MAKEINFO) $< --no-headers -o $@
## MAINTAINER Targets
## CVSvn.texi ##
# - CVSvn.texi needs to be updated only once, since it depends on
# configure.in, not on the results of a 'configure' run.
# - It is guaranteed (with GNU Make) that when the version in configure.in
# is changed, acversion.m4 is built only after the new version number is
# propagated to the Makefile. (Libtool uses the same guarantee.)
# - Of the next three targets, only the next one or the following two should be
# enabled, not all three
if MAKE_TARGETS_IN_VPATH
# - This is the target for systems without the BSD VPATH bug in make or with
# $(srcdir) = $(builddir)
CVSvn.texi: $(srcdir)/CVSvn.texi.in $(top_srcdir)/configure.in
sed 's,@VERSION\@,$(VERSION),g' $(srcdir)/CVSvn.texi.in >$(srcdir)/CVSvn.ttexi
mv $(srcdir)/CVSvn.ttexi $(srcdir)/CVSvn.texi
else
# - The next two targets are a workaround for the fact that some BSD makes
# don't look through VPATH for targets, but only for sources.
# - They should be disabled on systems without the bug and in environments
# where $(srcdir) = $(builddir)
CVSvn.texi: $(srcdir)/CVSvn.texi
# use cat so the time stamp gets set properly
cat $(srcdir)/CVSvn.texi >$@
$(srcdir)/CVSvn.texi: $(srcdir)/CVSvn.texi.in $(top_srcdir)/configure.in
sed 's,@VERSION\@,$(VERSION),g' $(srcdir)/CVSvn.texi.in >$(srcdir)/CVSvn.ttexi
mv $(srcdir)/CVSvn.ttexi $(srcdir)/CVSvn.texi
endif
## realclean ##
# for backwards compatibility with the old makefiles
realclean: maintainer-clean
.PHONY: realclean
-88
View File
@@ -1,88 +0,0 @@
## Process this file with automake to produce Makefile.in
# Makefile for library files used by GNU CVS.
# Copyright (C) 1986, 1988-1994, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program 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 General Public License for more details.
# For now we need to include $(top_srcdir)/src because some systems
# (at least 'AIX rioscpu2 3 4 000030498200',
# 'HP-UX hp60 B.10.20 A 9000/770 hp60 two-user license', &
# 'IRIX64 sgiop110 6.5 07151433 IP30') have trouble finding error.h
# when compiling savecwd.c
#
# FIXME - the fact that compiling on my Linux 2.2.16 system finds
# /usr/include/error.h instead of $(top_srcdir)/src/error.h but
# everything compiles and tests anyhow implies that src/error.h may
# be unecessary now. Should look more deeply into this
#
# $(includeopt) is CVS specific and set by configure
INCLUDES = -I$(top_srcdir)/src $(includeopt)
noinst_LIBRARIES = libcvs.a
# Always use CVS's regular expression matcher regex.o, because of
# variations in regular expression syntax - we want to be the same
# across systems and (probably) compared with old versions of CVS too.
#
# On a more mundane/detail level, having regex.h match regex.c can be
# an issue if we aren't careful.
#
# Also should look into unifying regular expression matching in CVS
# with the diff library (perhaps to have the caller, CVS, do the
# matching?)
libcvs_a_SOURCES = \
argmatch.c \
ftruncate.c \
getdate.y \
getline.c \
getopt.c \
getopt1.c \
md5.c \
regex.c \
savecwd.c \
sighandle.c \
stripslash.c \
xgetwd.c \
yesno.c \
getline.h \
getopt.h \
fnmatch.h \
md5.h \
regex.h \
savecwd.h \
system.h \
wait.h \
xselect.h \
xtime.h
## because @LIBOBJS@ is included below, automake automatically knows about
## dup2.c
## fncase.c
## fnmatch.c
## hostname.c
## memmove.c
## mkdir.c
## rename.c
## strstr.c
## strerror.c
## strtoul.c
## valloc.c
## waitpid.c
libcvs_a_LIBADD = @LIBOBJS@
EXTRA_DIST = \
.cvsignore \
ChangeLog.fsf \
build_lib.com \
xgssapi.h
# for backwards compatibility with the old makefiles
realclean: maintainer-clean
.PHONY: realclean
-30
View File
@@ -1,30 +0,0 @@
/* This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program 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 General Public License for more details. */
/* This file performs the generic include magic necessary for using
* cross platform gssapi which configure doesn't perform itself.
*/
/* Can't include both of these headers at the same time with Solaris 7 &
* Heimdal Kerberos 0.3. If some system ends up requiring both, a configure
* test like TIME_AND_SYS_TIME will probably be necessary.
*/
#ifdef HAVE_GSSAPI_H
# include <gssapi.h>
#else
/* Assume existance of this header so that the user will get an informative
* message if HAVE_GSSAPI somehow gets defined with both headers missing.
*/
# include <gssapi/gssapi.h>
#endif
#ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H
/* MIT Kerberos 5 v1.2.1 */
# include <gssapi/gssapi_generic.h>
#endif
-21
View File
@@ -1,21 +0,0 @@
/* This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program 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 General Public License for more details. */
/* This file simply performs the include magic necessary for using select */
#include <sys/types.h>
#ifdef HAVE_SYS_BSDTYPES_H
# include <sys/bsdtypes.h>
#endif
#include "xtime.h"
#if HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif
-57
View File
@@ -1,57 +0,0 @@
/* This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program 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 General Public License for more details. */
/* This file simply performs the include magic necessary for using time
* functions
*/
#ifdef vms
# include <time.h>
#else /* vms */
# if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
# else /* TIME_WITH_SYS_TIME */
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else /* HAVE_SYS_TIME_H */
# include <time.h>
# endif /* !HAVE_SYS_TIME_H */
# endif /* !TIME_WITH_SYS_TIME */
# ifdef HAVE_SYS_TIMEB_H
# include <sys/timeb.h>
# else /* HAVE_SYS_TIMEB_H */
/*
* We use the obsolete `struct timeb' as part of our interface!
* Since the system doesn't have it, we define it here;
* our callers must do likewise.
*
* At the least we were using this in lib/getdate.y, but lib/system.h used to
* define it too, so maybe CVS is using it elsewhere.
*/
struct timeb {
time_t time; /* Seconds since the epoch */
unsigned short millitm; /* Field not used */
short timezone; /* Minutes west of GMT */
short dstflag; /* Field not used */
};
# endif /* !HAVE_SYS_TIMEB_H */
# ifdef timezone
# undef timezone /* needed for sgi */
# endif /* timezone */
# if !defined(HAVE_FTIME) && !defined(HAVE_TIMEZONE)
extern long timezone;
# endif /* !defined(HAVE_FTIME) && !defined(HAVE_TIMEZONE) */
#endif /* !vms */
-22
View File
@@ -1,22 +0,0 @@
## Process this file with automake to produce Makefile.in
# Makefile.am for GNU CVS man pages.
# Copyright (C) 1986-1992, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program 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 General Public License for more details.
man_MANS = cvs.1 cvs.5 cvsbug.8
EXTRA_DIST = \
.cvsignore \
$(man_MANS)
# for backwards compatibility with the old makefiles
realclean: maintainer-clean
.PHONY: realclean
-265
View File
@@ -1,265 +0,0 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <[email protected]>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program 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 General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing 0.3 - GNU automake"
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
aclocal)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`configure.in'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`configure.in'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`configure.in'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
tar)
shift
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
fi
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar ${1+"$@"} && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar ${1+"$@"} && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" ${1+"$@"} && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" ${1+"$@"} && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequirements for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
-144
View File
@@ -1,144 +0,0 @@
## Process this file with automake to produce Makefile.in
# Makefile for GNU CVS program.
# Copyright (C) 1986, 1988-1990, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program 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 General Public License for more details.
SHELL = /bin/sh
# $(includeopt) is CVS specific and set by configure
# FIXME - This includes line is dependant on its order. This means there is
# some namespace hackery going on that maybe shouldn't be. Long term fix is to
# try and remove naming ocnflicts and fix Automake to allow particular includes
# to be attached only to particular object files. Short term fix is either or.
##INCLUDES = -I. -I.. -I$(srcdir) -I$(top_srcdir)/lib
INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/diff -I$(top_srcdir)/zlib $(includeopt)
bin_PROGRAMS = cvs
bin_SCRIPTS = cvsbug
# The cvs executable
cvs_SOURCES = \
add.c \
admin.c \
annotate.c \
buffer.c \
checkin.c \
checkout.c \
classify.c \
client.c \
commit.c \
create_adm.c \
cvsrc.c diff.c \
edit.c \
entries.c \
error.c \
expand_path.c \
fileattr.c \
filesubr.c \
find_names.c \
hardlink.c \
hash.c \
history.c \
ignore.c \
import.c \
lock.c \
log.c \
login.c \
logmsg.c \
main.c \
mkmodules.c \
modules.c \
myndbm.c \
no_diff.c \
parseinfo.c \
patch.c \
rcs.c \
rcscmds.c \
recurse.c \
release.c \
remove.c \
repos.c \
root.c \
run.c \
scramble.c \
server.c \
status.c \
subr.c \
tag.c \
update.c \
vers_ts.c \
watch.c \
wrapper.c \
zlib.c \
buffer.h \
client.h \
cvs.h \
edit.h \
error.h \
fileattr.h \
hardlink.h \
hash.h \
myndbm.h \
rcs.h \
server.h \
update.h \
watch.h
cvs_LDADD = \
../diff/libdiff.a \
../lib/libcvs.a \
../zlib/libz.a \
version.o
cvs_EXTRA_DIST = version.c
# extra clean targets
# wish this could be distclean-hdr-local but it's not part of automake
DISTCLEANFILES = options.h-SAVED check.log check.plog
# General
EXTRA_DIST = \
$(cvs_EXTRA_DIST) \
.cvsignore \
ChangeLog-9194 \
ChangeLog-9395 \
ChangeLog-96 \
ChangeLog-97 \
build_src.com \
sanity.sh \
version.c \
version.c.in
check-local:
$(SHELL) $(srcdir)/sanity.sh `pwd`/cvs
.PHONY: remotecheck
remotecheck: all
$(SHELL) $(srcdir)/sanity.sh -r `pwd`/cvs
## MAINTAINER Targets
# version.c
# - build this here so that we can distribute it
# - version.c needs to be updated only once, since it depends on
# configure.in, not on the results of a 'configure' run.
# - It is guaranteed (with GNU Make) that when the version in configure.in
# is changed, acversion.m4 is built only after the new version number is
# propagated to the Makefile. (Libtool uses the same guarantee.)
# - need the explicit version.o dependency or else make won't match
# $(srcdir)/version.c when looking for a dependency for version.c
version.o: $(srcdir)/version.c
$(srcdir)/version.c: $(srcdir)/version.c.in $(top_srcdir)/configure.in
sed 's,@VERSION\@,$(VERSION),g' $(srcdir)/version.c.in >$(srcdir)/version.tc
mv $(srcdir)/version.tc $(srcdir)/version.c
# for backwards compatibility with the old makefiles
.PHONY: realclean
realclean: maintainer-clean
-277
View File
@@ -1,277 +0,0 @@
/*
* Copyright (c) 1992, Brian Berliner and Jeff Polk
* Copyright (c) 1989-1992, Brian Berliner
*
* You may distribute under the terms of the GNU General Public License as
* specified in the README file that comes with the CVS source distribution.
*
* Show last revision where each line modified
*
* Prints the specified files with each line annotated with the revision
* number where it was last modified. With no argument, annotates all
* all the files in the directory (recursive by default).
*/
#include "cvs.h"
/* Options from the command line. */
static int force_tag_match = 1;
static char *tag = NULL;
static int tag_validated;
static char *date = NULL;
static int is_rannotate;
static int annotate_fileproc PROTO ((void *callerdat, struct file_info *));
static int rannotate_proc PROTO((int argc, char **argv, char *xwhere,
char *mwhere, char *mfile, int shorten,
int local, char *mname, char *msg));
static const char *const annotate_usage[] =
{
"Usage: %s %s [-lRf] [-r rev] [-D date] [files...]\n",
"\t-l\tLocal directory only, no recursion.\n",
"\t-R\tProcess directories recursively.\n",
"\t-f\tUse head revision if tag/date not found.\n",
"\t-r rev\tAnnotate file as of specified revision/tag.\n",
"\t-D date\tAnnotate file as of specified date.\n",
"(Specify the --help global option for a list of other help options)\n",
NULL
};
/* Command to show the revision, date, and author where each line of a
file was modified. */
int
annotate (argc, argv)
int argc;
char **argv;
{
int local = 0;
int err = 0;
int c;
is_rannotate = (strcmp(command_name, "rannotate") == 0);
if (argc == -1)
usage (annotate_usage);
optind = 0;
while ((c = getopt (argc, argv, "+lr:D:fR")) != -1)
{
switch (c)
{
case 'l':
local = 1;
break;
case 'R':
local = 0;
break;
case 'r':
tag = optarg;
break;
case 'D':
date = Make_Date (optarg);
break;
case 'f':
force_tag_match = 0;
break;
case '?':
default:
usage (annotate_usage);
break;
}
}
argc -= optind;
argv += optind;
#ifdef CLIENT_SUPPORT
if (current_parsed_root->isremote)
{
start_server ();
if (is_rannotate && !supported_request ("rannotate"))
error (1, 0, "server does not support rannotate");
ign_setup ();
if (local)
send_arg ("-l");
if (!force_tag_match)
send_arg ("-f");
option_with_arg ("-r", tag);
if (date)
client_senddate (date);
if (is_rannotate)
{
int i;
for (i = 0; i < argc; i++)
send_arg (argv[i]);
send_to_server ("rannotate\012", 0);
}
else
{
send_files (argc, argv, local, 0, SEND_NO_CONTENTS);
send_file_names (argc, argv, SEND_EXPAND_WILD);
send_to_server ("annotate\012", 0);
}
return get_responses_and_close ();
}
#endif /* CLIENT_SUPPORT */
if (is_rannotate)
{
DBM *db;
int i;
db = open_module ();
for (i = 0; i < argc; i++)
{
err += do_module (db, argv[i], MISC, "Annotating", rannotate_proc,
(char *) NULL, 0, 0, 0, 0, (char *) NULL);
}
close_module (db);
}
else
{
err = rannotate_proc (argc + 1, argv - 1, (char *) NULL,
(char *) NULL, (char *) NULL, 0, 0, (char *) NULL,
(char *) NULL);
}
return err;
}
static int
rannotate_proc (argc, argv, xwhere, mwhere, mfile, shorten, local, mname, msg)
int argc;
char **argv;
char *xwhere;
char *mwhere;
char *mfile;
int shorten;
int local;
char *mname;
char *msg;
{
/* Begin section which is identical to patch_proc--should this
be abstracted out somehow? */
char *myargv[2];
int err = 0;
int which;
char *repository;
char *where;
if (is_rannotate)
{
repository = xmalloc (strlen (current_parsed_root->directory) + strlen (argv[0])
+ (mfile == NULL ? 0 : strlen (mfile) + 1) + 2);
(void) sprintf (repository, "%s/%s", current_parsed_root->directory, argv[0]);
where = xmalloc (strlen (argv[0]) + (mfile == NULL ? 0 : strlen (mfile) + 1)
+ 1);
(void) strcpy (where, argv[0]);
/* if mfile isn't null, we need to set up to do only part of the module */
if (mfile != NULL)
{
char *cp;
char *path;
/* if the portion of the module is a path, put the dir part on repos */
if ((cp = strrchr (mfile, '/')) != NULL)
{
*cp = '\0';
(void) strcat (repository, "/");
(void) strcat (repository, mfile);
(void) strcat (where, "/");
(void) strcat (where, mfile);
mfile = cp + 1;
}
/* take care of the rest */
path = xmalloc (strlen (repository) + strlen (mfile) + 5);
(void) sprintf (path, "%s/%s", repository, mfile);
if (isdir (path))
{
/* directory means repository gets the dir tacked on */
(void) strcpy (repository, path);
(void) strcat (where, "/");
(void) strcat (where, mfile);
}
else
{
myargv[0] = argv[0];
myargv[1] = mfile;
argc = 2;
argv = myargv;
}
free (path);
}
/* cd to the starting repository */
if ( CVS_CHDIR (repository) < 0)
{
error (0, errno, "cannot chdir to %s", repository);
free (repository);
return (1);
}
free (repository);
/* End section which is identical to patch_proc. */
if (force_tag_match && tag != NULL)
which = W_REPOS | W_ATTIC;
else
which = W_REPOS;
repository = NULL;
}
else
{
where = NULL;
which = W_LOCAL;
repository = "";
}
if (tag != NULL && !tag_validated)
{
tag_check_valid (tag, argc - 1, argv + 1, local, 0, repository);
tag_validated = 1;
}
err = start_recursion (annotate_fileproc, (FILESDONEPROC) NULL,
(DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL,
argc - 1, argv + 1, local, which, 0, 1,
where, 1);
return err;
}
static int
annotate_fileproc (callerdat, finfo)
void *callerdat;
struct file_info *finfo;
{
char *version;
if (finfo->rcs == NULL)
return (1);
if (finfo->rcs->flags & PARTIAL)
RCS_reparsercsfile (finfo->rcs, (FILE **) NULL, (struct rcsbuffer *) NULL);
version = RCS_getversion (finfo->rcs, tag, date, force_tag_match,
(int *) NULL);
if (version == NULL)
return 0;
/* Distinguish output for various files if we are processing
several files. */
cvs_outerr ("Annotations for ", 0);
cvs_outerr (finfo->fullname, 0);
cvs_outerr ("\n***************\n", 0);
RCS_deltas (finfo->rcs, (FILE *) NULL, (struct rcsbuffer *) NULL,
version, RCS_ANNOTATE, NULL, NULL, NULL, NULL);
free (version);
return 0;
}
-526
View File
@@ -1,526 +0,0 @@
#! /bin/sh
# Submit a problem report to a GNATS site.
# Copyright (C) 1993 Free Software Foundation, Inc.
# Contributed by Brendan Kehoe ([email protected]), based on a
# version written by Heinz G. Seidl ([email protected]).
#
# This file is part of GNU GNATS.
# Modified by Berliner for CVS.
#
# GNU GNATS is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# GNU GNATS 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 General Public License for more details.
# The version of this send-pr.
VERSION=3.2
# The submitter-id for your site.
SUBMITTER=net
## # Where the GNATS directory lives, if at all.
## [ -z "$GNATS_ROOT" ] &&
## GNATS_ROOT=/usr/local/lib/gnats/gnats-db
# The default mail address for PR submissions.
[email protected]
## # Where the gnats category tree lives.
## DATADIR=/usr/local/lib
## # If we've been moved around, try using GCC_EXEC_PREFIX.
## [ ! -d $DATADIR/gnats -a -d "$GCC_EXEC_PREFIX" ] && DATADIR=${GCC_EXEC_PREFIX}..
# The default release for this host.
DEFAULT_RELEASE="@VERSION@"
# The default organization.
DEFAULT_ORGANIZATION="net"
## # The default site to look for.
## GNATS_SITE=unknown
## # Newer config information?
## [ -f ${GNATS_ROOT}/gnats-adm/config ] && . ${GNATS_ROOT}/gnats-adm/config
# What mailer to use. This must come after the config file, since it is
# host-dependent.
if [ -f /usr/sbin/sendmail ]; then
MAIL_AGENT="/usr/sbin/sendmail -oi -t"
else
MAIL_AGENT="/usr/lib/sendmail -oi -t"
fi
MAILER=`echo $MAIL_AGENT | sed -e 's, .*,,'`
if [ ! -f "$MAILER" ] ; then
echo "$COMMAND: Cannot file mail program \"$MAILER\"."
echo "$COMMAND: Please fix the MAIL_AGENT entry in the $COMMAND file."
exit 1
fi
if test "`echo -n foo`" = foo ; then
ECHON=bsd
elif test "`echo 'foo\c'`" = foo ; then
ECHON=sysv
else
ECHON=none
fi
if [ $ECHON = bsd ] ; then
ECHON1="echo -n"
ECHON2=
elif [ $ECHON = sysv ] ; then
ECHON1=echo
ECHON2='\c'
else
ECHON1=echo
ECHON2=
fi
#
[ -z "$TMPDIR" ] && TMPDIR=/tmp
TEMP=$TMPDIR/p$$
BAD=$TMPDIR/pbad$$
REF=$TMPDIR/pf$$
if [ -z "$LOGNAME" -a -n "$USER" ]; then
LOGNAME=$USER
fi
FROM="$LOGNAME"
REPLY_TO="$LOGNAME"
# Find out the name of the originator of this PR.
if [ -n "$NAME" ]; then
ORIGINATOR="$NAME"
elif [ -f $HOME/.fullname ]; then
ORIGINATOR="`sed -e '1q' $HOME/.fullname`"
elif [ -f /bin/domainname ]; then
if [ "`/bin/domainname`" != "" -a -f /usr/bin/ypcat ]; then
# Must use temp file due to incompatibilities in quoting behavior
# and to protect shell metacharacters in the expansion of $LOGNAME
/usr/bin/ypcat passwd 2>/dev/null | cat - /etc/passwd | grep "^$LOGNAME:" |
cut -f5 -d':' | sed -e 's/,.*//' > $TEMP
ORIGINATOR="`cat $TEMP`"
rm -f $TEMP
fi
fi
if [ "$ORIGINATOR" = "" ]; then
grep "^$LOGNAME:" /etc/passwd | cut -f5 -d':' | sed -e 's/,.*//' > $TEMP
ORIGINATOR="`cat $TEMP`"
rm -f $TEMP
fi
if [ -n "$ORGANIZATION" ]; then
if [ -f "$ORGANIZATION" ]; then
ORGANIZATION="`cat $ORGANIZATION`"
fi
else
if [ -n "$DEFAULT_ORGANIZATION" ]; then
ORGANIZATION="$DEFAULT_ORGANIZATION"
elif [ -f $HOME/.organization ]; then
ORGANIZATION="`cat $HOME/.organization`"
elif [ -f $HOME/.signature ]; then
ORGANIZATION="`cat $HOME/.signature`"
fi
fi
# If they don't have a preferred editor set, then use
if [ -z "$VISUAL" ]; then
if [ -z "$EDITOR" ]; then
EDIT=vi
else
EDIT="$EDITOR"
fi
else
EDIT="$VISUAL"
fi
# Find out some information.
SYSTEM=`( [ -f /bin/uname ] && /bin/uname -a ) || \
( [ -f /usr/bin/uname ] && /usr/bin/uname -a ) || echo ""`
ARCH=`[ -f /bin/arch ] && /bin/arch`
MACHINE=`[ -f /bin/machine ] && /bin/machine`
COMMAND=`echo $0 | sed -e 's,.*/,,'`
## USAGE="Usage: $COMMAND [-PVL] [-t address] [-f filename] [--request-id]
USAGE="Usage: $COMMAND [-PVL]
[--version]"
REMOVE=
BATCH=
while [ $# -gt 0 ]; do
case "$1" in
-r) ;; # Ignore for backward compat.
## -t | --to) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
## shift ; GNATS_ADDR="$1"
## EXPLICIT_GNATS_ADDR=true
## ;;
## -f | --file) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
## shift ; IN_FILE="$1"
## if [ "$IN_FILE" != "-" -a ! -r "$IN_FILE" ]; then
## echo "$COMMAND: cannot read $IN_FILE"
## exit 1
## fi
## ;;
-b | --batch) BATCH=true ;;
-p | -P | --print) PRINT=true ;;
-L | --list) FORMAT=norm ;;
-l | -CL | --lisp) FORMAT=lisp ;;
## --request-id) REQUEST_ID=true ;;
-h | --help) echo "$USAGE"; exit 0 ;;
-V | --version) echo "$VERSION"; exit 0 ;;
-*) echo "$USAGE" ; exit 1 ;;
*) echo "$USAGE" ; exit 1
## if [ -z "$USER_GNATS_SITE" ]; then
## if [ ! -r "$DATADIR/gnats/$1" ]; then
## echo "$COMMAND: the GNATS site $1 does not have a categories list."
## exit 1
## else
## # The site name is the alias they'll have to have created.
## USER_GNATS_SITE=$1
## fi
## else
## echo "$USAGE" ; exit 1
## fi
;;
esac
shift
done
if [ -n "$USER_GNATS_SITE" ]; then
GNATS_SITE=$USER_GNATS_SITE
GNATS_ADDR=$USER_GNATS_SITE-gnats
fi
if [ "$SUBMITTER" = "unknown" -a -z "$REQUEST_ID" -a -z "$IN_FILE" ]; then
cat << '__EOF__'
It seems that send-pr is not installed with your unique submitter-id.
You need to run
install-sid YOUR-SID
where YOUR-SID is the identification code you received with `send-pr'.
`send-pr' will automatically insert this value into the template field
`>Submitter-Id'. If you've downloaded `send-pr' from the Net, use `net'
for this value. If you do not know your id, run `send-pr --request-id' to
get one from your support site.
__EOF__
exit 1
fi
## if [ -r "$DATADIR/gnats/$GNATS_SITE" ]; then
## CATEGORIES=`grep -v '^#' $DATADIR/gnats/$GNATS_SITE | sort`
## else
## echo "$COMMAND: could not read $DATADIR/gnats/$GNATS_SITE for categories list."
## exit 1
## fi
CATEGORIES="contrib cvs doc pcl-cvs portability"
if [ -z "$CATEGORIES" ]; then
echo "$COMMAND: the categories list for $GNATS_SITE was empty!"
exit 1
fi
case "$FORMAT" in
lisp) echo "$CATEGORIES" | \
awk 'BEGIN {printf "( "}
{printf "(\"%s\") ",$0}
END {printf ")\n"}'
exit 0
;;
norm) l=`echo "$CATEGORIES" | \
awk 'BEGIN {max = 0; }
{ if (length($0) > max) { max = length($0); } }
END {print max + 1;}'`
c=`expr 70 / $l`
if [ $c -eq 0 ]; then c=1; fi
echo "$CATEGORIES" | \
awk 'BEGIN {print "Known categories:"; i = 0 }
{ printf ("%-'$l'.'$l's", $0); if ((++i % '$c') == 0) { print "" } }
END { print ""; }'
exit 0
;;
esac
ORIGINATOR_C='<name of the PR author (one line)>'
ORGANIZATION_C='<organization of PR author (multiple lines)>'
CONFIDENTIAL_C='<[ yes | no ] (one line)>'
SYNOPSIS_C='<synopsis of the problem (one line)>'
SEVERITY_C='<[ non-critical | serious | critical ] (one line)>'
PRIORITY_C='<[ low | medium | high ] (one line)>'
CATEGORY_C='<name of the product (one line)>'
CLASS_C='<[ sw-bug | doc-bug | change-request | support ] (one line)>'
RELEASE_C='<release number or tag (one line)>'
ENVIRONMENT_C='<machine, os, target, libraries (multiple lines)>'
DESCRIPTION_C='<precise description of the problem (multiple lines)>'
HOW_TO_REPEAT_C='<code/input/activities to reproduce the problem (multiple lines)>'
FIX_C='<how to correct or work around the problem, if known (multiple lines)>'
# Catch some signals. ($xs kludge needed by Sun /bin/sh)
xs=0
trap 'rm -f $REF $TEMP; exit $xs' 0
trap 'echo "$COMMAND: Aborting ..."; rm -f $REF $TEMP; xs=1; exit' 1 2 3 13 15
# If they told us to use a specific file, then do so.
if [ -n "$IN_FILE" ]; then
if [ "$IN_FILE" = "-" ]; then
# The PR is coming from the standard input.
if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" > $TEMP
else
cat > $TEMP
fi
else
# Use the file they named.
if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" $IN_FILE > $TEMP
else
cat $IN_FILE > $TEMP
fi
fi
else
if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
# If their PR_FORM points to a bogus entry, then bail.
if [ ! -f "$PR_FORM" -o ! -r "$PR_FORM" -o ! -s "$PR_FORM" ]; then
echo "$COMMAND: can't seem to read your template file (\`$PR_FORM'), ignoring PR_FORM"
sleep 1
PRINT_INTERN=bad_prform
fi
fi
if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
cp $PR_FORM $TEMP ||
( echo "$COMMAND: could not copy $PR_FORM" ; xs=1; exit )
else
for file in $TEMP $REF ; do
cat > $file << '__EOF__'
SEND-PR: -*- send-pr -*-
SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
SEND-PR: will all comments (text enclosed in `<' and `>').
SEND-PR:
SEND-PR: Choose from the following categories:
SEND-PR:
__EOF__
# Format the categories so they fit onto lines.
l=`echo "$CATEGORIES" | \
awk 'BEGIN {max = 0; }
{ if (length($0) > max) { max = length($0); } }
END {print max + 1;}'`
c=`expr 61 / $l`
if [ $c -eq 0 ]; then c=1; fi
echo "$CATEGORIES" | \
awk 'BEGIN {printf "SEND-PR: "; i = 0 }
{ printf ("%-'$l'.'$l's", $0);
if ((++i % '$c') == 0) { printf "\nSEND-PR: " } }
END { printf "\nSEND-PR:\n"; }' >> $file
cat >> $file << __EOF__
To: $GNATS_ADDR
Subject:
From: $FROM
Reply-To: $REPLY_TO
X-send-pr-version: $VERSION
>Submitter-Id: $SUBMITTER
>Originator: $ORIGINATOR
>Organization:
${ORGANIZATION-$ORGANIZATION_C}
>Confidential: $CONFIDENTIAL_C
>Synopsis: $SYNOPSIS_C
>Severity: $SEVERITY_C
>Priority: $PRIORITY_C
>Category: $CATEGORY_C
>Class: $CLASS_C
>Release: ${DEFAULT_RELEASE-$RELEASE_C}
>Environment:
$ENVIRONMENT_C
`[ -n "$SYSTEM" ] && echo System: $SYSTEM`
`[ -n "$ARCH" ] && echo Architecture: $ARCH`
`[ -n "$MACHINE" ] && echo Machine: $MACHINE`
>Description:
$DESCRIPTION_C
>How-To-Repeat:
$HOW_TO_REPEAT_C
>Fix:
$FIX_C
__EOF__
done
fi
if [ "$PRINT" = true -o "$PRINT_INTERN" = true ]; then
cat $TEMP
xs=0; exit
fi
chmod u+w $TEMP
if [ -z "$REQUEST_ID" ]; then
eval $EDIT $TEMP
else
ed -s $TEMP << '__EOF__'
/^Subject/s/^Subject:.*/Subject: request for a customer id/
/^>Category/s/^>Category:.*/>Category: send-pr/
w
q
__EOF__
fi
if cmp -s $REF $TEMP ; then
echo "$COMMAND: problem report not filled out, therefore not sent"
xs=1; exit
fi
fi
#
# Check the enumeration fields
# This is a "sed-subroutine" with one keyword parameter
# (with workaround for Sun sed bug)
#
SED_CMD='
/$PATTERN/{
s|||
s|<.*>||
s|^[ ]*||
s|[ ]*$||
p
q
}'
while [ -z "$REQUEST_ID" ]; do
CNT=0
# 1) Confidential
#
PATTERN=">Confidential:"
CONFIDENTIAL=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
case "$CONFIDENTIAL" in
""|yes|no) CNT=`expr $CNT + 1` ;;
*) echo "$COMMAND: \`$CONFIDENTIAL' is not a valid value for \`Confidential'." ;;
esac
#
# 2) Severity
#
PATTERN=">Severity:"
SEVERITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
case "$SEVERITY" in
""|non-critical|serious|critical) CNT=`expr $CNT + 1` ;;
*) echo "$COMMAND: \`$SEVERITY' is not a valid value for \`Severity'."
esac
#
# 3) Priority
#
PATTERN=">Priority:"
PRIORITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
case "$PRIORITY" in
""|low|medium|high) CNT=`expr $CNT + 1` ;;
*) echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'."
esac
#
# 4) Category
#
PATTERN=">Category:"
CATEGORY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
FOUND=
for C in $CATEGORIES
do
if [ "$C" = "$CATEGORY" ]; then FOUND=true ; break ; fi
done
if [ -n "$FOUND" ]; then
CNT=`expr $CNT + 1`
else
if [ -z "$CATEGORY" ]; then
echo "$COMMAND: you must include a Category: field in your report."
else
echo "$COMMAND: \`$CATEGORY' is not a known category."
fi
fi
#
# 5) Class
#
PATTERN=">Class:"
CLASS=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
case "$CLASS" in
""|sw-bug|doc-bug|change-request|support) CNT=`expr $CNT + 1` ;;
*) echo "$COMMAND: \`$CLASS' is not a valid value for \`Class'."
esac
[ $CNT -lt 5 -a -z "$BATCH" ] &&
echo "Errors were found with the problem report."
while true; do
if [ -z "$BATCH" ]; then
$ECHON1 "a)bort, e)dit or s)end? $ECHON2"
read input
else
if [ $CNT -eq 5 ]; then
input=s
else
input=a
fi
fi
case "$input" in
a*)
if [ -z "$BATCH" ]; then
echo "$COMMAND: the problem report remains in $BAD and is not sent."
mv $TEMP $BAD
else
echo "$COMMAND: the problem report is not sent."
fi
xs=1; exit
;;
e*)
eval $EDIT $TEMP
continue 2
;;
s*)
break 2
;;
esac
done
done
#
# Remove comments and send the problem report
# (we have to use patterns, where the comment contains regex chars)
#
# /^>Originator:/s;$ORIGINATOR;;
sed -e "
/^SEND-PR:/d
/^>Organization:/,/^>[A-Za-z-]*:/s;$ORGANIZATION_C;;
/^>Confidential:/s;<.*>;;
/^>Synopsis:/s;$SYNOPSIS_C;;
/^>Severity:/s;<.*>;;
/^>Priority:/s;<.*>;;
/^>Category:/s;$CATEGORY_C;;
/^>Class:/s;<.*>;;
/^>Release:/,/^>[A-Za-z-]*:/s;$RELEASE_C;;
/^>Environment:/,/^>[A-Za-z-]*:/s;$ENVIRONMENT_C;;
/^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;;
/^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;;
/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;;
" $TEMP > $REF
if $MAIL_AGENT < $REF; then
echo "$COMMAND: problem report sent"
xs=0; exit
else
echo "$COMMAND: mysterious mail failure."
if [ -z "$BATCH" ]; then
echo "$COMMAND: the problem report remains in $BAD and is not sent."
mv $REF $BAD
else
echo "$COMMAND: the problem report is not sent."
fi
xs=1; exit
fi
-1
View File
@@ -1 +0,0 @@
timestamp
-86
View File
@@ -1,86 +0,0 @@
/*
* Copyright (c) 1994 david d `zoo' zuhn
* Copyright (c) 1994 Free Software Foundation, Inc.
* Copyright (c) 1992, Brian Berliner and Jeff Polk
* Copyright (c) 1989-1992, Brian Berliner
*
* You may distribute under the terms of the GNU General Public License as
* specified in the README file that comes with this CVS source distribution.
*
* version.c - the CVS version number
*/
#include "cvs.h"
char *version_string = "Concurrent Versions System (CVS) @VERSION@";
#ifdef CLIENT_SUPPORT
#ifdef SERVER_SUPPORT
char *config_string = " (client/server)\n";
#else
char *config_string = " (client)\n";
#endif
#else
#ifdef SERVER_SUPPORT
char *config_string = " (server)\n";
#else
char *config_string = "\n";
#endif
#endif
static const char *const version_usage[] =
{
"Usage: %s %s\n",
NULL
};
/*
* Output a version string for the client and server.
*
* This function will output the simple version number (for the '--version'
* option) or the version numbers of the client and server (using the 'version'
* command).
*/
int
version (argc, argv)
int argc;
char **argv;
{
int err = 0;
if (argc == -1)
usage (version_usage);
#ifdef CLIENT_SUPPORT
if (current_parsed_root && current_parsed_root->isremote)
(void) fputs ("Client: ", stdout);
#endif
/* Having the year here is a good idea, so people have
some idea of how long ago their version of CVS was
released. */
(void) fputs (version_string, stdout);
(void) fputs (config_string, stdout);
#ifdef CLIENT_SUPPORT
if (current_parsed_root && current_parsed_root->isremote)
{
(void) fputs ("Server: ", stdout);
start_server ();
if (supported_request ("version"))
send_to_server ("version\012", 0);
else
{
send_to_server ("noop\012", 0);
fputs ("(unknown)\n", stdout);
}
err = get_responses_and_close ();
}
#endif
return err;
}
-1
View File
@@ -1 +0,0 @@
timestamp
-21
View File
@@ -1,21 +0,0 @@
## Process this file with automake to produce Makefile.in
# Makefile for GNU CVS auxiliary tools.
# Do not use this makefile directly, but only from `../Makefile'.
# Copyright (C) 1986, 1988-1990, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program 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 General Public License for more details.
EXTRA_DIST = \
README .cvsignore
# for backwards compatibility with the old makefiles
realclean: maintainer-clean
.PHONY: realclean
-47
View File
@@ -1,47 +0,0 @@
Copyright 2001 Luke Mewburn <[email protected]>. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by Luke Mewburn.
4. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This product also contains software developed by other people, and you
are advised to read the various source files to read the full details
of the other licenses. Those licenses also require the following
acknowledgements:
This product includes software developed by the NetBSD Foundation,
Inc. and its contributors. Those contributors include:
- Simon Burge
- Luke Mewburn
- Christos Zoulas
This product includes software developed by the University of
California, Berkeley and its contributors. Those contributors
include:
- Michael Fischbein
- Guido van Rossum
- Institute of Electrical and Electronics Engineers, Inc
This product includes software developed by Christos Zoulas.
-29
View File
@@ -1,29 +0,0 @@
# $Id: Makefile.in,v 1.1 2000/07/29 13:34:15 lukem Exp $
#
srcdir = @srcdir@
VPATH = @srcdir@
SHELL = /bin/sh
@SET_MAKE@
SUBDIRS = libukem src
all: ftpd
ftpd: @LIBUKEM@
( cd src; ${MAKE} )
libukem.a:
( cd libukem; ${MAKE} )
install clean:
@for i in ${SUBDIRS}; do \
( echo "$@ ===> $$i" ; cd $$i ; ${MAKE} $@ ); \
done
distclean: clean
@for i in ${SUBDIRS}; do \
( echo "$@ ===> $$i" ; cd $$i ; ${MAKE} $@ ); \
done
rm -f Makefile config.cache config.log config.status config.h
-101
View File
@@ -1,101 +0,0 @@
/* $Id: acconfig.h,v 1.9 2001/04/28 07:11:06 lukem Exp $ */
@TOP@
@BOTTOM@
/* Define if your compiler supports `long long' */
#undef HAVE_LONG_LONG
/* Define if *printf() uses %qd to print `long long' (otherwise uses %lld) */
#undef HAVE_PRINTF_QD
/* Define if in_port_t exists */
#undef HAVE_IN_PORT_T
/* Define if struct sockaddr.sa_len exists (implies sockaddr_in.sin_len, etc) */
#undef HAVE_SOCKADDR_SA_LEN
/* Define if socklen_t exists */
#undef HAVE_SOCKLEN_T
/* Define if AF_INET6 exists in <sys/socket.h> */
#undef HAVE_AF_INET6
/* Define if `struct sockaddr_in6' exists in <netinet/in.h> */
#undef HAVE_SOCKADDR_IN6
/* Define if `struct addrinfo' exists in <netdb.h> */
#undef HAVE_ADDRINFO
/*
* Define if <netdb.h> contains AI_NUMERICHOST et al.
* Systems which only implement RFC2133 will need this.
*/
#undef HAVE_RFC2553_NETDB
/* Define if `struct direct' has a d_namlen element */
#undef HAVE_D_NAMLEN
/* Define if struct passwd.pw_expire exists. */
#undef HAVE_PW_EXPIRE
/* Define if GLOB_BRACE, gl_path and gl_match exist in <glob.h> */
#undef HAVE_WORKING_GLOB
/* Define if crypt() is declared in <unistd.h> */
#undef HAVE_CRYPT_D
/* Define if fclose() is declared in <stdio.h> */
#undef HAVE_FCLOSE_D
/* Define if optarg is declared in <stdlib.h> or <unistd.h> */
#undef HAVE_OPTARG_D
/* Define if optind is declared in <stdlib.h> or <unistd.h> */
#undef HAVE_OPTIND_D
/* Define if optreset exists */
#undef HAVE_OPTRESET
/* Define if pclose() is declared in <stdio.h> */
#undef HAVE_PCLOSE_D
/* Define if getusershell() is declared in <unistd.h> */
#undef HAVE_GETUSERSHELL_D
/* Define if `long long' is supported and sizeof(off_t) >= 8 */
#undef HAVE_QUAD_SUPPORT
/* Define if not using in-built /bin/ls code */
#undef NO_INTERNAL_LS
/* Define if using S/Key */
#undef SKEY
/*
* Define this if compiling with SOCKS (the firewall traversal library).
* Also, you must define connect, getsockname, bind, accept, listen, and
* select to their R-versions.
*/
#undef SOCKS
#undef SOCKS4
#undef SOCKS5
#undef connect
#undef getsockname
#undef bind
#undef accept
#undef listen
#undef select
#undef dup
#undef dup2
#undef fclose
#undef gethostbyname
#undef getpeername
#undef read
#undef recv
#undef recvfrom
#undef rresvport
#undef send
#undef sendto
#undef shutdown
#undef write
-257
View File
@@ -1,257 +0,0 @@
dnl $Id: aclocal.m4,v 1.1 2000/07/29 13:34:15 lukem Exp $
dnl
dnl
dnl AC_MSG_TRY_COMPILE
dnl
dnl Written by Luke Mewburn <[email protected]>
dnl
dnl Usage:
dnl AC_MSG_TRY_COMPILE(Message, CacheVar, Includes, Code,
dnl ActionPass [,ActionFail] )
dnl
dnl effectively does:
dnl AC_CACHE_CHECK(Message, CacheVar,
dnl AC_TRY_COMPILE(Includes, Code, CacheVar = yes, CacheVar = no)
dnl if CacheVar == yes
dnl AC_MESSAGE_RESULT(yes)
dnl ActionPass
dnl else
dnl AC_MESSAGE_RESULT(no)
dnl ActionFail
dnl )
dnl
AC_DEFUN(AC_MSG_TRY_COMPILE, [
AC_CACHE_CHECK($1, $2, [
AC_TRY_COMPILE([ $3 ], [ $4; ], [ $2=yes ], [ $2=no ])
])
if test "x[$]$2" = "xyes"; then
$5
else
$6
:
fi
])
dnl
dnl AC_MSG_TRY_LINK
dnl
dnl Usage:
dnl AC_MSG_TRY_LINK(Message, CacheVar, Includes, Code,
dnl ActionPass [,ActionFail] )
dnl
dnl as AC_MSG_TRY_COMPILE, but uses AC_TRY_LINK instead of AC_TRY_COMPILE
dnl
AC_DEFUN(AC_MSG_TRY_LINK, [
AC_CACHE_CHECK($1, $2, [
AC_TRY_LINK([ $3 ], [ $4; ], [ $2=yes ], [ $2=no ])
])
if test "x[$]$2" = "xyes"; then
$5
else
$6
:
fi
])
dnl
dnl AC_LIBRARY_NET: #Id: net.m4,v 1.5 1997/11/09 21:36:54 jhawk Exp #
dnl
dnl Written by John Hawkinson <[email protected]>. This code is in the Public
dnl Domain.
dnl
dnl This test is for network applications that need socket() and
dnl gethostbyname() -ish functions. Under Solaris, those applications need to
dnl link with "-lsocket -lnsl". Under IRIX, they should *not* link with
dnl "-lsocket" because libsocket.a breaks a number of things (for instance:
dnl gethostbyname() under IRIX 5.2, and snoop sockets under most versions of
dnl IRIX).
dnl
dnl Unfortunately, many application developers are not aware of this, and
dnl mistakenly write tests that cause -lsocket to be used under IRIX. It is
dnl also easy to write tests that cause -lnsl to be used under operating
dnl systems where neither are necessary (or useful), such as SunOS 4.1.4, which
dnl uses -lnsl for TLI.
dnl
dnl This test exists so that every application developer does not test this in
dnl a different, and subtly broken fashion.
dnl
dnl It has been argued that this test should be broken up into two seperate
dnl tests, one for the resolver libraries, and one for the libraries necessary
dnl for using Sockets API. Unfortunately, the two are carefully intertwined and
dnl allowing the autoconf user to use them independantly potentially results in
dnl unfortunate ordering dependancies -- as such, such component macros would
dnl have to carefully use indirection and be aware if the other components were
dnl executed. Since other autoconf macros do not go to this trouble, and almost
dnl no applications use sockets without the resolver, this complexity has not
dnl been implemented.
dnl
dnl The check for libresolv is in case you are attempting to link statically
dnl and happen to have a libresolv.a lying around (and no libnsl.a).
dnl
AC_DEFUN(AC_LIBRARY_NET, [
# Most operating systems have gethostbyname() in the default searched
# libraries (i.e. libc):
AC_CHECK_FUNC(gethostbyname, ,
# Some OSes (eg. Solaris) place it in libnsl:
AC_CHECK_LIB(nsl, gethostbyname, ,
# Some strange OSes (SINIX) have it in libsocket:
AC_CHECK_LIB(socket, gethostbyname, ,
# Unfortunately libsocket sometimes depends on libnsl.
# AC_CHECK_LIB's API is essentially broken so the following
# ugliness is necessary:
AC_CHECK_LIB(socket, gethostbyname,
LIBS="-lsocket -lnsl $LIBS",
AC_CHECK_LIB(resolv, gethostbyname),
-lnsl)
)
)
)
AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, ,
AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl)))
])
dnl Checks for SOCKS firewall support.
dnl
dnl Written by Matthew R. Green <[email protected]>
dnl
AC_DEFUN(AC_LIBRARY_SOCKS, [
AC_MSG_CHECKING(whether to support SOCKS)
AC_ARG_WITH(socks,
[ --with-socks Compile with SOCKS firewall traversal support.],
[
case "$withval" in
no)
AC_MSG_RESULT(no)
;;
yes)
AC_MSG_RESULT(yes)
AC_CHECK_LIB(socks5, SOCKSconnect, [
socks=5
LIBS="-lsocks5 $LIBS"], [
AC_CHECK_LIB(socks, Rconnect, [
socks=4
LIBS="-lsocks $LIBS"], [
AC_MSG_ERROR(Could not find socks library. You must first install socks.) ] ) ] )
;;
esac
],
AC_MSG_RESULT(no)
)
if test "x$socks" = "x"; then
AC_MSG_CHECKING(whether to support SOCKS5)
AC_ARG_WITH(socks5,
[ --with-socks5[=PATH] Compile with SOCKS5 firewall traversal support.],
[
case "$withval" in
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(yes)
socks=5
if test "x$withval" = "xyes"; then
withval="-lsocks5"
else
if test -d "$withval"; then
if test -d "$withval/include"; then
CFLAGS="$CFLAGS -I$withval/include"
else
CFLAGS="$CFLAGS -I$withval"
fi
if test -d "$withval/lib"; then
withval="-L$withval/lib -lsocks5"
else
withval="-L$withval -lsocks5"
fi
fi
fi
LIBS="$withval $LIBS"
# If Socks was compiled with Kerberos support, we will need
# to link against kerberos libraries. Temporarily append
# to LIBS. This is harmless if there is no kerberos support.
TMPLIBS="$LIBS"
LIBS="$LIBS $KERBEROS_LIBS"
AC_TRY_LINK([],
[ SOCKSconnect(); ],
[],
[ AC_MSG_ERROR(Could not find the $withval library. You must first install socks5.) ])
LIBS="$TMPLIBS"
;;
esac
],
AC_MSG_RESULT(no)
)
fi
if test "x$socks" = "x"; then
AC_MSG_CHECKING(whether to support SOCKS4)
AC_ARG_WITH(socks4,
[ --with-socks4[=PATH] Compile with SOCKS4 firewall traversal support.],
[
case "$withval" in
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(yes)
socks=4
if test "x$withval" = "xyes"; then
withval="-lsocks"
else
if test -d "$withval"; then
withval="-L$withval -lsocks"
fi
fi
LIBS="$withval $LIBS"
AC_TRY_LINK([],
[ Rconnect(); ],
[],
[ AC_MSG_ERROR(Could not find the $withval library. You must first install socks.) ])
;;
esac
],
AC_MSG_RESULT(no)
)
fi
if test "x$socks" = "x4"; then
AC_DEFINE(SOCKS)
AC_DEFINE(SOCKS4)
AC_DEFINE(connect, Rconnect)
AC_DEFINE(getsockname, Rgetsockname)
AC_DEFINE(bind, Rbind)
AC_DEFINE(accept, Raccept)
AC_DEFINE(listen, Rlisten)
AC_DEFINE(select, Rselect)
fi
if test "x$socks" = "x5"; then
AC_DEFINE(SOCKS)
AC_DEFINE(SOCKS5)
AC_DEFINE(connect,SOCKSconnect)
AC_DEFINE(getsockname,SOCKSgetsockname)
AC_DEFINE(getpeername,SOCKSgetpeername)
AC_DEFINE(bind,SOCKSbind)
AC_DEFINE(accept,SOCKSaccept)
AC_DEFINE(listen,SOCKSlisten)
AC_DEFINE(select,SOCKSselect)
AC_DEFINE(recvfrom,SOCKSrecvfrom)
AC_DEFINE(sendto,SOCKSsendto)
AC_DEFINE(recv,SOCKSrecv)
AC_DEFINE(send,SOCKSsend)
AC_DEFINE(read,SOCKSread)
AC_DEFINE(write,SOCKSwrite)
AC_DEFINE(rresvport,SOCKSrresvport)
AC_DEFINE(shutdown,SOCKSshutdown)
AC_DEFINE(listen,SOCKSlisten)
AC_DEFINE(close,SOCKSclose)
AC_DEFINE(dup,SOCKSdup)
AC_DEFINE(dup2,SOCKSdup2)
AC_DEFINE(fclose,SOCKSfclose)
AC_DEFINE(gethostbyname,SOCKSgethostbyname)
fi
])
-274
View File
@@ -1,274 +0,0 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* $Id: config.h.in,v 1.15 2001/04/28 07:11:46 lukem Exp $ */
/* Define if the closedir function returns void instead of int. */
#undef CLOSEDIR_VOID
/* Define to empty if the keyword does not work. */
#undef const
/* Define if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
/* Define if your Fortran 77 compiler doesn't accept -c and -o together. */
#undef F77_NO_MINUS_C_MINUS_O
/* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t
/* Define to the type of arg1 for select(). */
#undef SELECT_TYPE_ARG1
/* Define to the type of args 2, 3 and 4 for select(). */
#undef SELECT_TYPE_ARG234
/* Define to the type of arg5 for select(). */
#undef SELECT_TYPE_ARG5
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define if the closedir function returns void instead of int. */
#undef VOID_CLOSEDIR
/* The number of bytes in a off_t. */
#undef SIZEOF_OFF_T
/* Define if you have the err function. */
#undef HAVE_ERR
/* Define if you have the fgetln function. */
#undef HAVE_FGETLN
/* Define if you have the flock function. */
#undef HAVE_FLOCK
/* Define if you have the fparseln function. */
#undef HAVE_FPARSELN
/* Define if you have the fts_open function. */
#undef HAVE_FTS_OPEN
/* Define if you have the getaddrinfo function. */
#undef HAVE_GETADDRINFO
/* Define if you have the getgrouplist function. */
#undef HAVE_GETGROUPLIST
/* Define if you have the getnameinfo function. */
#undef HAVE_GETNAMEINFO
/* Define if you have the getspnam function. */
#undef HAVE_GETSPNAM
/* Define if you have the getusershell function. */
#undef HAVE_GETUSERSHELL
/* Define if you have the inet_net_pton function. */
#undef HAVE_INET_NET_PTON
/* Define if you have the inet_ntop function. */
#undef HAVE_INET_NTOP
/* Define if you have the inet_pton function. */
#undef HAVE_INET_PTON
/* Define if you have the lockf function. */
#undef HAVE_LOCKF
/* Define if you have the mkstemp function. */
#undef HAVE_MKSTEMP
/* Define if you have the setlogin function. */
#undef HAVE_SETLOGIN
/* Define if you have the setproctitle function. */
#undef HAVE_SETPROCTITLE
/* Define if you have the sl_init function. */
#undef HAVE_SL_INIT
/* Define if you have the snprintf function. */
#undef HAVE_SNPRINTF
/* Define if you have the strdup function. */
#undef HAVE_STRDUP
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
/* Define if you have the strlcat function. */
#undef HAVE_STRLCAT
/* Define if you have the strlcpy function. */
#undef HAVE_STRLCPY
/* Define if you have the strmode function. */
#undef HAVE_STRMODE
/* Define if you have the strsep function. */
#undef HAVE_STRSEP
/* Define if you have the strtoll function. */
#undef HAVE_STRTOLL
/* Define if you have the user_from_uid function. */
#undef HAVE_USER_FROM_UID
/* Define if you have the usleep function. */
#undef HAVE_USLEEP
/* Define if you have the vfork function. */
#undef HAVE_VFORK
/* Define if you have the vsyslog function. */
#undef HAVE_VSYSLOG
/* Define if you have the <arpa/nameser.h> header file. */
#undef HAVE_ARPA_NAMESER_H
/* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define if you have the <err.h> header file. */
#undef HAVE_ERR_H
/* Define if you have the <fts.h> header file. */
#undef HAVE_FTS_H
/* Define if you have the <libutil.h> header file. */
#undef HAVE_LIBUTIL_H
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
/* Define if you have the <paths.h> header file. */
#undef HAVE_PATHS_H
/* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H
/* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H
/* Define if you have the <sys/sysmacros.h> header file. */
#undef HAVE_SYS_SYSMACROS_H
/* Define if you have the <util.h> header file. */
#undef HAVE_UTIL_H
/* Define if you have the crypt library (-lcrypt). */
#undef HAVE_LIBCRYPT
/* Define if you have the nsl library (-lnsl). */
#undef HAVE_LIBNSL
/* Define if you have the skey library (-lskey). */
#undef HAVE_LIBSKEY
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define if you have the util library (-lutil). */
#undef HAVE_LIBUTIL
/* Define if your compiler supports `long long' */
#undef HAVE_LONG_LONG
/* Define if *printf() uses %qd to print `long long' (otherwise uses %lld) */
#undef HAVE_PRINTF_QD
/* Define if in_port_t exists */
#undef HAVE_IN_PORT_T
/* Define if struct sockaddr.sa_len exists (implies sockaddr_in.sin_len, etc) */
#undef HAVE_SOCKADDR_SA_LEN
/* Define if socklen_t exists */
#undef HAVE_SOCKLEN_T
/* Define if AF_INET6 exists in <sys/socket.h> */
#undef HAVE_AF_INET6
/* Define if `struct sockaddr_in6' exists in <netinet/in.h> */
#undef HAVE_SOCKADDR_IN6
/* Define if `struct addrinfo' exists in <netdb.h> */
#undef HAVE_ADDRINFO
/*
* Define if <netdb.h> contains AI_NUMERICHOST et al.
* Systems which only implement RFC2133 will need this.
*/
#undef HAVE_RFC2553_NETDB
/* Define if `struct direct' has a d_namlen element */
#undef HAVE_D_NAMLEN
/* Define if struct passwd.pw_expire exists. */
#undef HAVE_PW_EXPIRE
/* Define if GLOB_BRACE, gl_path and gl_match exist in <glob.h> */
#undef HAVE_WORKING_GLOB
/* Define if crypt() is declared in <unistd.h> */
#undef HAVE_CRYPT_D
/* Define if fclose() is declared in <stdio.h> */
#undef HAVE_FCLOSE_D
/* Define if optarg is declared in <stdlib.h> or <unistd.h> */
#undef HAVE_OPTARG_D
/* Define if optind is declared in <stdlib.h> or <unistd.h> */
#undef HAVE_OPTIND_D
/* Define if optreset exists */
#undef HAVE_OPTRESET
/* Define if pclose() is declared in <stdio.h> */
#undef HAVE_PCLOSE_D
/* Define if getusershell() is declared in <unistd.h> */
#undef HAVE_GETUSERSHELL_D
/* Define if `long long' is supported and sizeof(off_t) >= 8 */
#undef HAVE_QUAD_SUPPORT
/* Define if not using in-built /bin/ls code */
#undef NO_INTERNAL_LS
/* Define if using S/Key */
#undef SKEY
/*
* Define this if compiling with SOCKS (the firewall traversal library).
* Also, you must define connect, getsockname, bind, accept, listen, and
* select to their R-versions.
*/
#undef SOCKS
#undef SOCKS4
#undef SOCKS5
#undef connect
#undef getsockname
#undef bind
#undef accept
#undef listen
#undef select
#undef dup
#undef dup2
#undef fclose
#undef gethostbyname
#undef getpeername
#undef read
#undef recv
#undef recvfrom
#undef rresvport
#undef send
#undef sendto
#undef shutdown
#undef write
-251
View File
@@ -1,251 +0,0 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0
-61
View File
@@ -1,61 +0,0 @@
# $Id: Makefile.in,v 1.5 2001/03/29 05:29:07 lukem Exp $
#
srcdir = @srcdir@
VPATH = @srcdir@
SHELL = /bin/sh
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
mandir = @mandir@
sbindir = @sbindir@
mandircat5 = ${mandir}/cat5
mandircat8 = ${mandir}/cat8
CC = @CC@
CFLAGS = -I${srcdir} -I${srcdir}/.. -I. -I.. @INCLUDES@ @CFLAGS@
LIBS = @LIBS@
LDFLAGS = @LDFLAGS@
INSTALL = @INSTALL@
PROG = ftpd
OBJS = cmds.o conf.o ftpd.o ftpcmd.o popen.o @LSOBJS@
# removed: logutmp.o logwtmp.o
all: ${PROG}
cmp.o: ${srcdir}/../ls/cmp.c
${CC} ${CFLAGS} -c -o cmp.o ${srcdir}/../ls/cmp.c
ls.o: ${srcdir}/../ls/ls.c
${CC} ${CFLAGS} -c -o ls.o ${srcdir}/../ls/ls.c
print.o: ${srcdir}/../ls/print.c
${CC} ${CFLAGS} -c -o print.o ${srcdir}/../ls/print.c
stat_flags.o: ${srcdir}/../ls/stat_flags.c
${CC} ${CFLAGS} -c -o stat_flags.o ${srcdir}/../ls/stat_flags.c
util.o: ${srcdir}/../ls/util.c
${CC} ${CFLAGS} -c -o util.o ${srcdir}/../ls/util.c
install: all
-mkdir -p ${sbindir}
${INSTALL} -m 555 ${PROG} ${sbindir}
-mkdir -p ${mandircat5}
${INSTALL} -m 444 ${srcdir}/ftpd.conf.cat5 ${mandircat5}/ftpd.conf.5
${INSTALL} -m 444 ${srcdir}/ftpusers.cat5 ${mandircat5}/ftpusers.5
-mkdir -p ${mandircat8}
${INSTALL} -m 444 ${srcdir}/${PROG}.cat8 ${mandircat8}/${PROG}.8
${PROG}: ${OBJS} @LIBDEPENDS@
${CC} ${CFLAGS} ${LDFLAGS} -o ${PROG} ${OBJS} ${LIBS}
clean:
rm -f core ${PROG} ${OBJS}
distclean: clean
rm -f Makefile
-111
View File
@@ -1,111 +0,0 @@
/* $NetBSD: ftp.h,v 1.5 1998/02/10 00:32:50 perry Exp $ */
/*
* Copyright (c) 1983, 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ftp.h 8.1 (Berkeley) 6/2/93
*/
#ifndef _ARPA_FTP_H_
#define _ARPA_FTP_H_
/* Definitions for FTP; see RFC-765. */
/*
* Reply codes.
*/
#define PRELIM 1 /* positive preliminary */
#define COMPLETE 2 /* positive completion */
#define CONTINUE 3 /* positive intermediate */
#define TRANSIENT 4 /* transient negative completion */
#define ERROR 5 /* permanent negative completion */
/*
* Type codes
*/
#define TYPE_A 1 /* ASCII */
#define TYPE_E 2 /* EBCDIC */
#define TYPE_I 3 /* image */
#define TYPE_L 4 /* local byte size */
#ifdef FTP_NAMES
char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
#endif
/*
* Form codes
*/
#define FORM_N 1 /* non-print */
#define FORM_T 2 /* telnet format effectors */
#define FORM_C 3 /* carriage control (ASA) */
#ifdef FTP_NAMES
char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
#endif
/*
* Structure codes
*/
#define STRU_F 1 /* file (no record structure) */
#define STRU_R 2 /* record structure */
#define STRU_P 3 /* page structure */
#ifdef FTP_NAMES
char *strunames[] = {"0", "File", "Record", "Page" };
#endif
/*
* Mode types
*/
#define MODE_S 1 /* stream */
#define MODE_B 2 /* block */
#define MODE_C 3 /* compressed */
#ifdef FTP_NAMES
char *modenames[] = {"0", "Stream", "Block", "Compressed" };
#endif
/*
* Record Tokens
*/
#define REC_ESC '\377' /* Record-mode Escape */
#define REC_EOR '\001' /* Record-mode End-of-Record */
#define REC_EOF '\002' /* Record-mode End-of-File */
/*
* Block Header
*/
#define BLK_EOR 0x80 /* Block is End-of-Record */
#define BLK_EOF 0x40 /* Block is End-of-File */
#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
#define BLK_RESTART 0x10 /* Block is Restart Marker */
#define BLK_BYTECOUNT 2 /* Bytes in this block */
#endif /* _ARPA_FTP_H_ */
-111
View File
@@ -1,111 +0,0 @@
/*
* Portions Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
* Portions Copyright (c) 1996, Jason Downs. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "lukemftpd.h"
typedef struct utmp UTMP;
static int fd = -1;
static int topslot = -1;
/*
* Special versions of login()/logout() which hold the utmp file open,
* for use with ftpd.
*/
void
login(const UTMP *ut)
{
UTMP ubuf;
/*
* First, loop through /etc/ttys, if needed, to initialize the
* top of the tty slots, since ftpd has no tty.
*/
if (topslot < 0) {
topslot = 0;
while (getttyent() != (struct ttyent *)NULL)
topslot++;
}
if ((topslot < 0) || ((fd < 0)
&& (fd = open(_PATH_UTMP, O_RDWR|O_CREAT, 0644)) < 0))
return;
/*
* Now find a slot that's not in use...
*/
(void)lseek(fd, (off_t)(topslot * sizeof(UTMP)), SEEK_SET);
while (1) {
if (read(fd, &ubuf, sizeof(UTMP)) == sizeof(UTMP)) {
if (!ubuf.ut_name[0]) {
(void)lseek(fd, -(off_t)sizeof(UTMP), SEEK_CUR);
break;
}
topslot++;
} else {
(void)lseek(fd, (off_t)(topslot * sizeof(UTMP)),
SEEK_SET);
break;
}
}
(void)write(fd, ut, sizeof(UTMP));
}
int
logout(const char *line)
{
UTMP ut;
int rval;
rval = 0;
if (fd < 0)
return(rval);
(void)lseek(fd, 0, SEEK_SET);
while (read(fd, &ut, sizeof(UTMP)) == sizeof(UTMP)) {
if (!ut.ut_name[0]
|| strncmp(ut.ut_line, line, UT_LINESIZE))
continue;
memset(ut.ut_name, 0, UT_NAMESIZE);
memset(ut.ut_host, 0, UT_HOSTSIZE);
(void)time(&ut.ut_time);
(void)lseek(fd, -(off_t)sizeof(UTMP), SEEK_CUR);
(void)write(fd, &ut, sizeof(UTMP));
rval = 1;
}
return(rval);
}
-65
View File
@@ -1,65 +0,0 @@
/* $NetBSD: logwtmp.c,v 1.16 2001/02/04 22:04:12 christos Exp $ */
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#include "lukemftpd.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
* after login, but before logout).
*/
void
logwtmp(const char *line, const char *name, const char *host)
{
struct utmp ut;
struct stat buf;
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);
}
}
-51
View File
@@ -1,51 +0,0 @@
/* $NetBSD: pathnames.h,v 1.10 2000/03/06 21:42:26 lukem Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)pathnames.h 8.1 (Berkeley) 6/4/93
*/
#ifndef _DEFAULT_CONFDIR
#define _DEFAULT_CONFDIR "/etc"
#endif
#define _PATH_FTPCHROOT "ftpchroot"
#define _PATH_FTPDCONF "ftpd.conf"
#define _PATH_FTPLOGINMESG "motd"
#undef _PATH_FTPUSERS
#define _PATH_FTPUSERS "ftpusers"
#define _PATH_FTPWELCOME "ftpwelcome"
#define _PATH_CLASSPIDS "/var/run/ftpd.pids-"
#define TMPFILE "/tmp/ftpdXXXXXXX"
-105
View File
@@ -1,105 +0,0 @@
If you want to use the RSA stuff for crypto keys:
- Get RSAREF or RSAEURO.
- - Unpack it in the top-level source directory of the NTP distribution
in a directory named rsaref2 or rsaeuro1, respectively
(You should see directories like ports, rsaref2, scripts)
Make sure rsa.c has the security patch applied - a copy of it is at the
end of this file.
When you run configure, the Right Thing will happen.
Be advised that the RSA DES code is not quite as portable os one might
wish for. In particular, DES under NTP will only work between machines
of the same "endianness".
Dave would prefer that new/alternative encryption schemes follow the
RSA API.
--- rsa.c.orig Fri Mar 25 14:01:48 1994
+++ rsaref2/source/rsa.c Mon Dec 13 13:10:28 1999
@@ -33,6 +33,9 @@
unsigned char byte, pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen;
+ if (publicKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
+
modulusLen = (publicKey->bits + 7) / 8;
if (inputLen + 11 > modulusLen)
return (RE_LEN);
@@ -78,6 +81,9 @@
unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen, pkcsBlockLen;
+ if (publicKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
+
modulusLen = (publicKey->bits + 7) / 8;
if (inputLen > modulusLen)
return (RE_LEN);
@@ -128,6 +134,9 @@
int status;
unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen;
+
+ if (privateKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
modulusLen = (privateKey->bits + 7) / 8;
if (inputLen + 11 > modulusLen)
@@ -168,6 +177,9 @@
unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen, pkcsBlockLen;
+ if (privateKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
+
modulusLen = (privateKey->bits + 7) / 8;
if (inputLen > modulusLen)
return (RE_LEN);
--- rsa.c.orig Sat Sep 28 22:59:40 1996
+++ rsaeuro1/source/rsa.c Sat Jul 8 00:33:13 2000
@@ -51,6 +51,9 @@ R_RANDOM_STRUCT *randomStruct; /* rando
unsigned char byte, pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen;
+ if (publicKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
+
modulusLen = (publicKey->bits + 7) / 8;
if(inputLen + 11 > modulusLen)
@@ -101,6 +104,9 @@ R_RSA_PUBLIC_KEY *publicKey; /* RSA p
unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen, pkcsBlockLen;
+ if (publicKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
+
modulusLen = (publicKey->bits + 7) / 8;
if(inputLen > modulusLen)
@@ -154,6 +160,9 @@ R_RSA_PRIVATE_KEY *privateKey; /* RSA p
unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen;
+ if (privateKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
+
modulusLen = (privateKey->bits + 7) / 8;
if(inputLen + 11 > modulusLen)
@@ -193,6 +202,9 @@ R_RSA_PRIVATE_KEY *privateKey; /* RSA p
unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen, pkcsBlockLen;
+ if (privateKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
+
modulusLen = (privateKey->bits + 7) / 8;
if(inputLen > modulusLen)
-36
View File
@@ -1,36 +0,0 @@
AC_DEFUN(hs_ULONG_CONST,
[ AC_EGREP_CPP(Circus,
[#define ACAT(a,b)a ## b
ACAT(Cir,cus)
], AC_DEFINE([ULONG_CONST(a)], [a ## UL]),
AC_EGREP_CPP(Reiser,
[#define RCAT(a,b)a/**/b
RCAT(Rei,ser)
], AC_DEFINE([ULONG_CONST(a)], [a/**/L]),
AC_MSG_ERROR([How do we create an unsigned long constant?])))])
dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
dnl
dnl This macro defines (with AC_DEFINE) VARNAME to the expansion of the DIR
dnl variable, taking care of fixing up ${prefix} and such.
dnl
dnl Note that the 3 argument form is only supported with autoconf 2.13 and
dnl later (i.e. only where AC_DEFINE supports 3 arguments).
dnl
dnl Examples:
dnl
dnl AC_DEFINE_DIR(DATADIR, datadir)
dnl AC_DEFINE_DIR(PROG_PATH, bindir, [Location of installed binaries])
dnl
dnl @version $Id: acinclude.m4,v 1.3 2000/08/04 03:26:22 stenn Exp $
dnl @author Alexandre Oliva <[email protected]>
AC_DEFUN(AC_DEFINE_DIR, [
ac_expanded=`(
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
eval echo \""[$]$2"\"
)`
ifelse($3, ,
AC_DEFINE_UNQUOTED($1, "$ac_expanded"),
AC_DEFINE_UNQUOTED($1, "$ac_expanded", $3))
])
-48
View File
@@ -1,48 +0,0 @@
#
# NTP configuration file (ntp.conf)
# SunOS rackety.u 4.1.3 243 sun4c
#
server 127.127.4.0 prefer # Spectracom GPS receiver #1
fudge 127.127.4.0 refid GPS1 time1 -.000097 flag1 1
server 127.127.4.1 # Spectracom GPS receiver #2
fudge 127.127.4.1 refid GPS2 time1 -.000097 flag1 1
server 127.127.4.2 # Spectracom WWVB receiver #1
# delays: prop 0.0088 ant .0002 rcvr .0173 = 26.3 ms; os .0035
fudge 127.127.4.2 refid WVB1 time1 .0021 flag4 1 flag1 1
server 127.127.4.3 # Spectracom WWVB receiver #2
# delays: prop 0.0088 ant .0002 rcvr .0173 = 26.3 ms; os .0035
fudge 127.127.4.3 refid WVB2 time1 .0021 flag4 1 flag1 1
server 127.127.22.1 # PPS
fudge 127.127.22.1 flag3 1 # kernel PPS
#
# Services
#
broadcast 224.0.1.1 autokey # multicast
broadcast 128.4.1.255 autokey # local subnet broadcast
manycastclient 239.1.1.1 autokey maxpoll 12 ttl 7 # manycast
manycastserver 239.1.1.1 # manycast
#
# Access controls
#
restrict default limited # default limit clients per net
restrict 127.0.0.1 # allow local host
restrict 128.4.0.0 mask 255.255.0.0 # allow DCnet clients
restrict 128.175.0.0 mask 255.255.0.0 # allow UDELnet clients
restrict 140.173.0.0 mask 255.255.0.0 # allow DARTnet/CAIRN clients
#
# Authentication stuff
#
crypto # enable public key
keys /usr/local/etc/ntp.keys # symmetric keys file
trustedkey 3 4 5 14 # define trusted keys
requestkey 14 # key (7) for accessing server variables
controlkey 14 # key (6) for accessing server variables
#
# Miscellaneous stuff
#
driftfile /etc/ntp.drift # frequency offset
statsdir /rackety/ntpstats/ # directory for statistics files
filegen peerstats file peerstats type day enable
filegen loopstats file loopstats type day enable
filegen clockstats file clockstats type day enable
-45
View File
@@ -1,45 +0,0 @@
#! /bin/sh
BUILD_ARGS="$@"
PARSE="--enable-parse-clocks"
#PARSE=
# * baldwin sparc-sun-solaris2.7
# bridgeport sparc-sun-solaris2.6
# bunnylou alpha-dec-osf4.0
# * churchy alpha-dec-osf4.0
# cowbird alpha-dec-osf4.0
# grundoon sparc-sun-sunos4.1.3
# * hepzibah freebsd-2.2.5
# malarky sparc-sun-solaris2.8
# * pogo sparc-sun-solaris2.8
# * porkypine mips-dec-ultrix4.4
# * rackety sparc-sun-sunos4.1.3/cc
# * snavely hppa1.1-hp-hpux10.20
# whimsy sparc-sun-solaris2.7
c_d=`pwd`
SIG=`perl -e 'print rand'`
echo $SIG > .buildkey
case "$LIST" in
'') LIST="baldwin churchy hepzibah pogo porkypine rackety snavely" ;;
esac
for i in $LIST
do
echo $i
case "1" in
0)
ssh $i "cd $c_d ; ./build $SIG $PARSE $BUILD_ARGS" &
ssh $i "cd $c_d ; ./build $SIG $PARSE --with-crypto=autokey $BUILD_ARGS" &
ssh $i "cd $c_d ; ./build $SIG $PARSE --without-crypto $BUILD_ARGS" &
;;
1) ssh $i "cd $c_d ; \
./build $SIG $PARSE $BUILD_ARGS ; \
./build $SIG $PARSE --with-crypto=autokey $BUILD_ARGS ; \
./build $SIG $PARSE --without-crypto $BUILD_ARGS" &
;;
esac
done
-257
View File
@@ -1,257 +0,0 @@
<HTML>
<HEAD>
<TITLE> ONCORE - SHMEM </TITLE>
</HEAD>
<BODY>
<H3>
Motorola ONCORE - The Shared Memory Interface
</H3>
<HR>
<H4>
Introduction
</H4>
<P>
In NMEA mode, the Oncore GPS receiver provides the user with the same information as
other GPS receivers.
In BINARY mode, it can provide a lot of additional information.
<P>
In particular, you can ask for satellite positions, satellite health, signal levels,
the ephemeris and the almanac, and you can set many operational parameters.
In the case of the VP,
you can get the pseudorange corrections necessary to act as a DGPS base station, and you can see
the raw satellite data messages themselves.
<P>
When using the Oncore GPS receiver with NTP, this additional information is usually
not available since the receiver is only talking to the oncore driver in NTPD.
To make this information available for use in other programs,
(say graphic displays of satellites positions, plots of SA, etc.), a shared memory interface
(SHMEM) has been added to the refclock_oncore driver on those operating systems that support
shared memory.
<P>
To make use of this information you will need an Oncore Reference Manual for the
Oncore GPS receiver that you have. The Manual for the VP only exists as a paper
document, the UT manuals are available as a pdf document online.
<P>
This interface was written by Poul-Henning Kamp ([email protected]), and modified by
Reg Clemens ([email protected]).
The interface is known to work in FreeBSD, Linux, and Solaris.
<H4>
Activating the Interface
</H4>
Although the Shared Memory Interface will be compiled into the Oncore driver
on those systems where Shared Memory is supported, to activate this interface you must
include a <B>STATUS</B> line in the <tt>/etc/ntp.oncore</tt> data file that looks like
<PRE>
STATUS < file_name >
</PRE>
Thus a line like
<PRE>
STATUS /var/adm/ntpstats/ONCORE
</PRE>
would be acceptable.
This file name will be used to access the Shared Memory.
<P>
In addition, one the two keywords <B>Posn2D</B> and <B>Posn3D</B> can be added to
see @@Ea records containing the 2D or 3D position of the station (see below).
Thus to activate the interface, and see 3D positions, something like
<PRE>
STATUS /var/adm/ntpstats/ONCORE
Posn3D
</PRE>
would be required.
<H4>
Storage of Messages in Shared Memory
</H4>
With the shared memory interface, the oncore driver (refclock_oncore) allocates space
for all of the messages that it is configured to receive, and then puts each message
in the appropriate slot in shared memory as it arrives from the receiver.
Since there is no easy way for a client program to know when the shared memory has
been updated,
a sequence number is associated with each message, and is incremented when a new message
arrives.
With the sequence number it is easy to check through the shared memory segment for messages that
have changed.
<P>
The Oncore binary messages are kept in their full length, as described in the Reference
manual, that is everything from the @@ prefix thru the &lt;checksum&gt;&lt;CR&gt;&lt;LF&gt;.
<P>
The data starts at location ONE of SHMEM (NOT location ZERO).
<P>
The messages are stacked in a series of variable length structures, that look like
<PRE>
struct message {
u_int length;
u_char sequence;
u_char message[length];
}
</PRE>
<P>
if something like that were legal.
That is, there are two bytes (caution, these may NOT be aligned with word boundaries, so
the field needs to be treated as a pair of u_char), that contains the length of the next
message.
This is followed by a u_char sequence number, that is incremented whenever a new message of
this type is received.
This is followed by 'length' characters of the actual message.
<P>
The next structure starts immediately following the last char of the previous message (no alignment).
Thus, each structure starts a distance of 'length+3' from the previous structure.
<P>
Following the last structure, is a u_int containing a zero length to indicate the end
of the data.
<P>
The messages are recognized by reading the headers in the data itself, viz @@Ea or whatever.
<P>
There are two special cases.
<P>
(1) The almanac takes a total of 34 submessages all starting with @@Cb. <br>
35 slots are allocated in shared memory.
Each @@Cb message is initially placed in the first of these locations,
and then later it is moved to the appropriate location for that submessage.
The submessages can be distinguished by the first two characters following the @@Cb header,
and new data is received only when the almanac changes.
<P>
(2) The @@Ea message contains the calculated location of the antenna, and is received
once per second.
However, when in timekeeping mode, the receiver is normally put in 0D mode, with the
position fixed, to get better accuracy.
In 0D mode no position is calculated.
<P>
When the SHMEM option is active,
and if one of <B>Posn2D</B> or <B>Posn3D</B> is specified,
one @@Ea record is hijacked each 15s, and the receiver
is put back in 2D/3D mode so the the current location can be determined (for position determination, or for
tracking SA).
The timekeeping code is careful NOT to use the time associated with this (less accurate) 2D/3D tick
in its timekeeping functions.
<P>
Following the initial @@Ea message are 3 additional slots for a total of four.
As with the almanac, the first gets filled each time a new record becomes available,
later in the code, the message is distributed to the appropriate slot.
The additional slots are for messages containing 0D, 2D and 3D positions.
These messages can be distinguished by different bit patterns in the last data byte of the record.
<H4>
Opening the Shared Memory File
</H4>
The shared memory segment is accessed through a file name given on a <B>ACCESS</B> card in the
<tt>/etc/ntp.oncore</tt> input file.
The following code could be used to open the Shared Memory Segment:
<PRE>
char *Buf, *file;
int size, fd;
struct stat statbuf;
file = "/var/adm/ntpstats/ONCORE"; /* the file name on my ACCESS card */
if ((fd=open(file, O_RDONLY)) < 0) {
fprintf(stderr, "Cant open %s\n", file);
exit(1);
}
if (stat(file, &statbuf) < 0) {
fprintf(stderr, "Cant stat %s\n", file);
exit(1);
}
size = statbuf.st_size;
if ((Buf=mmap(0, size, PROT_READ, MAP_SHARED, fd, (off_t) 0)) < 0) {
fprintf(stderr, "MMAP failed\n");
exit(1);
}
</PRE>
<H4>
Accessing the data
</H4>
The following code shows how to get to the individual records.
<PRE>
void oncore_msg_Ea(), oncore_msg_As(), oncore_msg_Bb();
struct Msg {
char c[5];
unsigned int seq;
void (*go_to)(uchar *);
};
struct Msg Hdr[] = { {"@@Bb", 0, &oncore_msg_Bb},
{"@@Ea", 0, &oncore_msg_Ea},
{"@@As", 0, &oncore_msg_As}};
void
read_data()
{
int i, j, k, n, iseq, jseq;
uchar *cp, *cp1;
for(cp=Buf+1; (n = 256*(*cp) + *(cp+1)) != 0; cp+=(n+3)) {
for (k=0; k < sizeof(Hdr)/sizeof(Hdr[0]); k++) {
if (!strncmp(cp+3, Hdr[k].c, 4)) { /* am I interested? */
iseq = *(cp+2);
jseq = Hdr[k].seq;
Hdr[k].seq = iseq;
if (iseq > jseq) { /* has it changed? */
/* verify checksum */
j = 0;
cp1 = cp+3; /* points to start of oncore response */
for (i=2; i < n-3; i++)
j ^= cp1[i];
if (j == cp1[n-3]) { /* good checksum */
Hdr[k].go_to(cp1);
} else {
fprintf(stderr, "Bad Checksum for %s\n", Hdr[k].c);
break;
}
}
}
}
if (!strncmp(cp+3, "@@Ea", 4))
cp += 3*(n+3);
if (!strncmp(cp+3, "@@Cb", 4))
cp += 34*(n+3);
}
}
oncore_msg_Bb(uchar *buf)
{
/* process Bb messages */
}
oncore_msg_Ea(uchar *buf)
{
/* process Ea messages */
}
oncore_msg_As(uchar *buf)
{
/* process As messages */
}
</PRE>
The structure Hdr contains the Identifying string for each of the messages that
we want to examine, and the name of a program to call when a new message of that
type is arrives.
The loop can be run every few seconds to check for new data.
<H4>
Examples
</H4>
There are two complete examples available.
The first plots satellite positions and the station position as affected by SA, and
keeps track of the mean station position, so you can run it for periods of days
to get a better station position.
The second shows the effective horizon by watching satellite tracks.
The examples will be found in the GNU-zipped tar file
<A HREF=ftp://ftp.udel.edu/pub/ntp/software/OncorePlot.tar.gz>
ftp://ftp.udel.edu/pub/ntp/software/OncorePlot.tar.gz</A>.
<P>
Try the new interface, enjoy.
<HR>
<ADDRESS>
Reg.Clemens ([email protected]),
Poul-Henning Kamp ([email protected])
<ADDRESS>
</BODY>
</HTML>
-191
View File
@@ -1,191 +0,0 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>hopf clock drivers by ATLSoft</title>
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#800080" alink="#FF0000">
<h1>
<font face="Arial"><i><blink><font size="5">hopf</font></blink></i><font size="+2">
</font><font size="3">Serial Line Receivers (6021 and&nbsp; kompatible)</font></font></h1>
<hr>
<h2>
<font size=+1>Synopsis</font></h2>
<table border="0" cellpadding cellspacing width="100%">
<tr>
<td>
<table border="0" cellpadding="3" bgcolor="#C0C0C0">
<tr>
<td height="21">
<div align=right><tt>Address:&nbsp;&nbsp;</tt></div>
</td>
<td><b>127.127.38.<i>X</i></b></td>
</tr>
<tr>
<td height="1">
<div align=right><tt>Reference ID:&nbsp;&nbsp;</tt></div>
</td>
<td height="1"><a NAME="REFID"></a><b>.hopf. </b>(default)<b>, GPS, DCF</b></td>
</tr>
<tr>
<td height="21">
<div align=right><tt>Driver ID:&nbsp;&nbsp;</tt></div>
</td>
<td height="21"><b>HOPF_S</b></td>
</tr>
<tr>
<td height="16">
<div align=right><tt>Serial Port:&nbsp;&nbsp;</tt></div>
</td>
<td height="16"><b>/dev/hopfclock<i>X</i></b></td>
</tr>
<tr>
<td height="23">
<div align=right><tt><font size=+1>Serial I/O</font>:&nbsp;&nbsp;</tt></div>
</td>
<td height="23"><b>9600 baud, 8-bits, 1-stop, no parity</b></td>
</tr>
</table>
</td>
<td align="center"><img border="0" src="pic/fg6021.gif" width="238" height="207"></td>
</tr>
</table>
<hr>
<h2>
<font size=+1>Description</font></h2>
The <b>refclock_hopf_serial</b> driver supports <a href="http://www.hopf.com">hopf
electronic receivers</a> with serial Interface kompatibel 6021.
<br>Additional software and information about the software drivers is available
from: <a href="http://www.ATLSoft.de/ntp">http://www.ATLSoft.de/ntp</a>.
<br>Latest NTP driver source, executables and documentation is maintained
at: <a href="http://www.ATLSoft.de/ntp">http://www.ATLSoft.de/ntp</a>
<hr>
<h2>
<font size=+1>Operating System Compatibility</font></h2>
<p align="left">
The hopf clock driver has been tested on the following software and hardware
platforms:
<br>&nbsp;<table bgcolor="#C0C0C0">
<tr>
<td VALIGN=CENTER WIDTH="23%" nowrap>
<p align="left"><b>Platform</b></p>
</td>
<td VALIGN=CENTER nowrap>
<p align="left"><b>Operating System</b></p>
</td>
</tr>
<tr>
<td VALIGN=CENTER WIDTH="23%" nowrap>
<p align="left">i386 (PC)&nbsp;</p>
</td>
<td VALIGN=CENTER nowrap>
<p align="left">Linux</p>
</td>
</tr>
<tr>
<td nowrap>
<p align="left">i386 (PC)&nbsp;</p>
</td>
<td nowrap>
<p align="left">Windows NT</p>
</td>
</tr>
<tr>
<td nowrap>
<p align="left">i386 (PC)&nbsp;</p>
</td>
<center>
<td nowrap>Windows 2000</td>
</tr>
</table></center>
<hr>
<h2>
<font size=+1>O/S Serial Port Configuration</font></h2>
The driver attempts to open the device <b><tt><a href="#REFID">/dev/hopfclock<i>X</i></a></tt></b>
where <i><b>X</b></i> is the NTP refclock unit number as defined by the
LSB of the refclock address.&nbsp; Valid refclock unit numbers are 0 -
3.
<p>The user is expected to provide a symbolic link to an available serial
port device.&nbsp; This is typically performed by a command such as:
<blockquote><tt>ln -s /dev/ttyS0 /dev/hopfclock0</tt></blockquote>
Windows NT does not support symbolic links to device files.&nbsp;<br>
<b> COMx</b>:
is used by the driver, based on the refclock unit number, where <b> unit 1</b>
corresponds to <b> COM1</b>: and <b> unit 3</b> corresponds to <b>COM3</b>:
<br>&nbsp;
<hr>
<h2>
<font size=+1>Fudge Factors</font></h2>
<dl>
<dt>
<b>
<a NAME="time1"></a><tt><font size=+1><a href="#Configuration">time1 <i>time</i></a></font></tt></b></dt>
<dd>
Specifies the time offset calibration factor, in seconds and fraction,
with default 0.0. Should be set to
20 milliseconds to correct serial line and operating system delays incurred
in capturing time stamps from the synchronous packets.</dd>
<dt>
<tt><font size=+1><a href="#REFID"><b>refid <i>string</i></b></a></font></tt></dt>
<dd>
Specifies the driver reference identifier, <b>GPS </b><i>or</i> <b> DCF</b>.</dd>
<dt>
<tt><font size=+1><b>flag1 0
| 1</b></font></tt></dt>
<dd>
When set to 1, driver sync's even if only crystal driven.</dd>
</dl>
<hr>
<h2>
<a NAME="DataFormat"></a><font size=+1>Data Format</font></h2>
<p>as specified in clock manual under pt. <u>[ <span lang="EN-GB" style="font-size:10.0pt;font-family:
Arial;mso-fareast-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;
mso-ansi-language:EN-GB;mso-fareast-language:DE;mso-bidi-language:AR-SA"><b>Data
String for NTP</b> ( <b><i>Network Time Protocol </i></b>) </span>]</u></p>
<hr>
<h3>Questions or Comments:</h3>
<p><a href="mailto:[email protected]">Bernd Altmeier</a><a href="http://www.ATLSoft.de"><br>
Ing.-B’ro f’r Software www.ATLSoft.de</a><p>(last updated 02/28/2001)
<br>&nbsp;
</body>
</html>
-162
View File
@@ -1,162 +0,0 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>hopf clock drivers by ATLSoft</title>
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#800080" alink="#FF0000">
<h1>
<font face="Arial"><i><blink><font size="5">hopf</font></blink></i><font size="+2">
</font><font size="3">PCI-Bus Receiver (6039 GPS/DCF77)</font></font></h1>
<hr>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="50%">
<h2>
<font size=+1>Synopsis</font></h2>
<table border="0" cellpadding="3" bgcolor="#C0C0C0">
<tr>
<td height="21">
<div align=right><tt>Address:&nbsp;&nbsp;</tt></div>
</td>
<td height="21"><b>127.127.39.<i>X</i></b></td>
</tr>
<tr>
<td height="21">
<div align=right><tt>Reference ID:&nbsp;&nbsp;</tt></div>
</td>
<td height="21"><a NAME="REFID"></a><b>.hopf. </b>(default)<b>, GPS, DCF</b></td>
</tr>
<tr>
<td height="21">
<div align=right><tt>Driver ID:&nbsp;&nbsp;</tt></div>
</td>
<td height="21"><b>HOPF_P</b></td>
</tr>
</table>
</td>
<td valign="middle" align="center"><font face="Arial"><i><blink><font size="5"><img border="0" src="pic/fg6039.jpg" width="141" height="140"></font></blink></i></font></td>
</tr>
</table>
</center>
</div>
<hr>
<h2>
<font size=+1>Description</font></h2>
The <b>refclock_hopf_pci </b>driver supports the <a href="http://www.hopf.com">hopf</a>
PCI-bus interface 6039 GPS/DCF77.
<br>Additional software and information about the software drivers maybe available
from: <a href="http://www.ATLSoft.de/ntp">http://www.ATLSoft.de/ntp</a>.
<br>Latest NTP driver source, executables and documentation is maintained
at: <a href="http://www.ATLSoft.de/ntp">http://www.ATLSoft.de/ntp</a>
<hr>
<h2>
<font size=+1>Operating System Compatibility</font></h2>
<p align="left">
The hopf clock driver has been tested on the following software and hardware
platforms:
<br>&nbsp;<table bgcolor="#C0C0C0">
<tr>
<td VALIGN=CENTER WIDTH="23%" nowrap>
<p align="left"><b>Platform</b></p>
</td>
<td VALIGN=CENTER nowrap>
<p align="left"><b>Operating System</b></p>
</td>
</tr>
<tr>
<td VALIGN=CENTER WIDTH="23%" nowrap>
<p align="left">i386 (PC)&nbsp;</p>
</td>
<td VALIGN=CENTER nowrap>
<p align="left">Linux</p>
</td>
</tr>
<tr>
<td nowrap>
<p align="left">i386 (PC)&nbsp;</p>
</td>
<td nowrap>
<p align="left">Windows NT</p>
</td>
</tr>
<tr>
<td nowrap>
<p align="left">i386 (PC)&nbsp;</p>
</td>
<center>
<td nowrap>Windows 2000</td>
</tr>
</table></center>
<hr>
<h2>
<font size=+1>O/S System Configuration</font></h2>
<p>
<b>UNIX</b></p>
The driver attempts to open the device <b><tt><a href="#REFID">/dev/hopf6039</a></tt></b>
. The device entry will be made by the installation process of the kernel module
for the PCI-bus board. The driver sources belongs to the delivery equipment of
the PCI-board.
<p><b>Windows NT/2000</b>
<p>
The driver attempts to open the device by calling the function &quot;OpenHopfDevice()&quot;.
This function will be installed by the Device Driver for the PCI-bus board. The
driver belongs to the delivery equipment of the PCI-board.</p>
<hr>
<h2>
<font size=+1>Fudge Factors</font></h2>
<dl>
<dt>
<tt><font size=+1><a href="#REFID"><b>refid <i>string</i></b></a></font></tt></dt>
<dd>
Specifies the driver reference identifier, <b>GPS </b><i>or</i> <b> DCF</b>.</dd>
<dt>
<tt><font size=+1><b>flag1 0
| 1</b></font></tt></dt>
<dd>
When set to 1, driver sync's even if only crystal driven.</dd>
</dl>
<hr>
<h3>Questions or Comments:</h3>
<p><a href="mailto:[email protected]">Bernd Altmeier</a><a href="http://www.ATLSoft.de"><br>
Ing.-B’ro f’r Software www.ATLSoft.de</a><p>(last updated 03/02/2001)
<br>&nbsp;
</body>
</html>
-181
View File
@@ -1,181 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<title>ntp-genkeys - generate public and private keys</title>
</head>
<body>
<h3><tt>ntp-genkeys</tt> - generate public and private keys</h3>
<img align="left" src="pic/alice23.gif" alt="gif"><a href=
"http://www.eecis.udel.edu/~mills/pictures.htm">from <i>Alice's
Adventures in Wonderland</i>, Lewis Carroll</a>
<p>Alice holds the key.<br clear="left">
</p>
<hr>
<h4>Synopsis</h4>
<tt>ntp-genkeys</tt>
<h4>Description</h4>
<p>This program generates random keys used by either or both the
NTPv3/NTPv4 symmetric key or the NTPv4 public key (Autokey)
cryptographic authentication schemes. By default the program
generates the <tt>ntp.keys</tt> file containing 16 random symmetric
keys. In addition, if the <tt>rsaref20</tt> package is configured
for the software build, the program generates cryptographic values
used by the Autokey scheme. These values are incorporated as a set
of three files, <tt>ntpkey</tt> containing the RSA private key,
<tt>ntpkey_<i>host</i></tt> containing the RSA public key, where
<tt><i>host</i></tt> is the DNS name of the generating machine, and
<tt>ntpkey_dh</tt> containing the parameters for the Diffie-Hellman
key-agreement algorithm. All files and are in printable ASCII
format. A timestamp in NTP seconds is appended to each. Since the
algorithms are seeded by the system clock, each run of this program
produces a different file and file name.</p>
<p>The <tt>ntp.keys</tt> file contains 16 MD5 keys. Each key
consists of 16 characters randomized over the ASCII 95-character
printing subset. The file is read by the daemon at the location
specified by the <tt>keys</tt> configuration file command and made
visible only to root. An additional key consisting of a easily
remembered password should be added by hand for use with the <tt>
ntpq</tt> and <tt>ntpdc</tt> programs. The file must be distributed
by secure means to other servers and clients sharing the same
security compartment. While the key identifiers for MD5 and DES
keys must be in the range 1-65534, inclusive, the <tt>
ntp-genkeys</tt> program uses only the identifiers from 1 to 16.
The key identifier for each association is specified as the key
argument in the <tt>server</tt> or peer configuration file
command.</p>
<p>The <tt>ntpkey</tt> file contains the RSA private key. It is
read by the daemon at the location specified by the <tt>
privatekey</tt> argument of the <tt>crypto</tt> configuration file
command and made visible only to root. This file is useful only to
the machine that generated it and never shared with any other
daemon or application program.</p>
<p>The <tt>ntpkey_<i>host</i></tt> file contains the RSA public
key, where <tt><i>host</i></tt> is the DNS name of the host that
generated it. The file is read by the daemon at the location
specified by the <tt>publickey</tt> argument to the <tt>server</tt>
or <tt>peer</tt> configuration file command. This file can be
widely distributed and stored without using secure means, since the
data are public values.</p>
<p>The <tt>ntp_dh</tt> file contains two Diffie-Hellman parameters:
the prime modulus and the generator. The file is read by the daemon
at the location specified by the <tt>dhparams</tt> argument of the
<tt>crypto</tt> configuration file command. The file can be
distributed by insecure means to other servers and clients sharing
the same key agreement compartment, since the data are public
values.</p>
<p>The file formats begin with two lines, the first containing the
generating system DNS name and the second the datestamp. Lines
beginning with <tt>#</tt> are considered comments and ignored by
the daemon. In the <tt>ntp.keys</tt> file, the next 16 lines
contain the MD5 keys in order. If necessary, this file can be
further customized by an ordinary text editor. The format is
described in the following section. In the <tt>ntpkey</tt> and <tt>
ntpkey_<i>host</i></tt> files, the next line contains the modulus
length in bits followed by the key as a PEM encoded string. In the
<tt>ntpkey_dh</tt> file, the next line contains the prime length in
bytes followed by the prime as a PEM encoded string, and the next
and final line contains the generator length in bytes followed by
the generator as a PEM encoded string.</p>
<p>Note: See the file <tt>./source/rsaref.h</tt> in the <tt>
rsaref20</tt> package for explanation of return values, if
necessary.</p>
<h4>Symmetric Key File Format</h4>
In the case of DES, the keys are 56 bits long with, depending on
type, a parity check on each byte. In the case of MD5, the keys are
64 bits (8 bytes). <tt>ntpd</tt> reads its keys from a file
specified using the <tt>-k</tt> command line option or the <tt>
keys</tt> statement in the configuration file. While key number 0
is fixed by the NTP standard (as 56 zero bits) and may not be
changed, one or more of the keys numbered 1 through 15 may be
arbitrarily set in the keys file.
<p>The key file uses the same comment conventions as the
configuration file. Key entries use a fixed format of the form</p>
<p><i><tt>keyno type key</tt></i></p>
<p>where <i><tt>keyno</tt></i> is a positive integer, <i><tt>
type</tt></i> is a single character which defines the key format,
and <i><tt>key</tt></i> is the key itself.</p>
<p>The key may be given in one of three different formats,
controlled by the <i><tt>type</tt></i> character. The three key
types, and corresponding formats, are listed following.</p>
<dl>
<dt><tt>S</tt></dt>
<dd>The key is a 64-bit hexadecimal number in the format specified
in the DES specification; that is, the high order seven bits of
each octet are used to form the 56-bit key while the low order bit
of each octet is given a value such that odd parity is maintained
for the octet. Leading zeroes must be specified (i.e., the key must
be exactly 16 hex digits long) and odd parity must be maintained.
Hence a zero key, in standard format, would be given as <tt>
0101010101010101</tt>.</dd>
<dt><tt>N</tt></dt>
<dd>The key is a 64-bit hexadecimal number in the format specified
in the NTP standard. This is the same as the DES format, except the
bits in each octet have been rotated one bit right so that the
parity bit is now the high order bit of the octet. Leading zeroes
must be specified and odd parity must be maintained. A zero key in
NTP format would be specified as <tt>8080808080808080</tt>.</dd>
<dt><tt>A</tt></dt>
<dd>The key is a 1-to-8 character ASCII string. A key is formed
from this by using the low order 7 bits of each ASCII character in
the string, with zeroes added on the right when necessary to form a
full width 56-bit key, in the same way that encryption keys are
formed from Unix passwords.</dd>
<dt><tt>M</tt></dt>
<dd>The key is a 1-to-8 character ASCII string, using the MD5
authentication scheme. Note that both the keys and the
authentication schemes (DES or MD5) must be identical between a set
of peers sharing the same key number.</dd>
</dl>
<p>Note that the keys used by the <tt>ntpq</tt> and <tt>ntpdc</tt>
programs are checked against passwords requested by the programs
and entered by hand, so it is generally appropriate to specify
these keys in ASCII format.</p>
<h4>Files</h4>
The RSA Laboratories package <tt>rsaref20</tt> of cryptographic
routines is necessary in order to build and use this program.
<h4>Bugs</h4>
It can take quite a while to generate the RSA public/private key
pair and Diffie-Hellman parameters, from a few seconds on a modern
workstation to several minutes on older machines.
<hr>
<a href="index.htm"><img align="left" src="pic/home.gif" alt=
"gif"></a>
<address><a href="mailto:[email protected]">David L. Mills
&lt;[email protected]&gt;</a></address>
</body>
</html>
-15
View File
@@ -1,15 +0,0 @@
If you are compiling under FreeBSD and see messages in the syslogs that
indicate that the ntpd process is trying to use unavailable sched_
calls, it means you are running a kernel that does not have the POSIX
scheduling calls enabled.
You have two choices:
- Ignore the messages
- Generate a new kernel, where the kernel configuration file contains
the lines:
options "P1003_1B"
options "_KPOSIX_PRIORITY_SCHEDULING"
options "_KPOSIX_VERSION=199309L"
-153
View File
@@ -1,153 +0,0 @@
<HTML>
<HEAD>
<TITLE>vxWorks Port of NTP</TITLE>
</HEAD>
<BODY LINK="#00008B" VLINK="#8B0000">
<H1>VxWorks port of NTP </H1>
<P>Creating a port for vxWorks posed some problems. This port may help
as a starting point for similar ports to real-time OS's and other embeddable
kernels, particularly where main() is not allowed, and where the configure
scripts need to be altered. </P>
<H1><B>Configuration issues</B></H1>
<P>I decided to do as little invasive surgery as possible on the NTP code,
so I brought the vxWorks header tree in line with the standard unix tree.
The following changes were needed, as a side effect these changes will
allow for easy porting of other autoconfigure enabled code. </P>
<P>Where I have 386 you will need to put in your target type. The vxWorks
tree entry point is /usr/wind. If these are the same for your system, you
should be able to cut and paste the changes. </P>
<P><BLINK>WARNING: Check you are not overwriting files, before entering
the following: there should be no conflict, but check first... </BLINK></P>
<P>export CC=&quot;cc386 -nostdlib -m486 -DCPU=I80486 -I/usr/wind/target/h&quot;
<BR>
export RANLIB=ranlib386 <BR>
export AR=ar386 <BR>
export VX_KERNEL=/usr/wind/target/config/ims_std_bsp/vxWorks <BR>
cd /usr/wind/target/sys <BR>
ln -s ../signal.h <BR>
ln -s ../time.h <BR>
ln -s socket.h sockio.h <BR>
ln -s ../selectLib.h select.h <BR>
ln -s ../timers.h <BR>
touch file.h param.h resource.h utsname.h var.h ../netdb.h ../a.out.h ../termios.h
<BR>
echo &quot; ******ADD #include \&quot;sys/times.h\&quot; to sys/time.h
&quot; </P>
<P>The configure script must be changed in the following way to get the
linking tests to work, once in the correct directory issue the following
commands: <BR>
sed -e 's%main.*()%vxmain()%' configure &gt; configure.vxnew <BR>
mv configure.vxnew configure <BR>
chmod 755 configure </P>
<P>The new version 4 of NTP requires some maths functions so it links in the
maths library (-lm) in the ntpd <a href="../ntpd/Makefile.am">Makefile.am</a>
change the line "ntpd_LDADD = $(LDADD) -lm" by removing the "-lm".<BR>
You are now ready to compile</P>
<P><BR>
The <A HREF="../configure.in">configure.in </A>file needed to be altered
to allow for a host-target configuration to take place. </P>
<UL>
<LI>The define SYS_VXWORKS was added to the compilation flags. </LI>
<LI>Little endianess is set if the target is of type iX86. </LI>
<LI>The size of char, integer, long values are all set. If Wind River ever
changes these values they will need to be updated. </LI>
<LI>clock_settime() is defined to be used for setting the clock. </LI>
<LI>The Linking flags have -r added to allow for relinking into the vxWorks
kernel </LI>
</UL>
<P>Unfortunately I have had to make use of the <A HREF="../include/ntp_machine.h">ntp_machine.h
</A>file to add in the checks that would have been checked at linking stage
by autoconf, a better method should be devised. </P>
<UL>
<LI>There is now a NO_MAIN_ALLOWED define that simulates command line args,
this allows the use of the normal startup sysntax. </LI>
<LI>POSIX timers have been added. </LI>
<LI>Structures normally found in netdb.h have been added with, the corresponding
code is in <A HREF="../libntp/machines.c">machines.c </A>. Where possible
the defines for these have been kept non-vxWorks specific.</LI>
</UL>
<P>Unfortunately there are still quite a few SYS_VXWORKS type defines in
the source, but I have eliminated as many as possible. You have the choice
of using the usrtime.a library avaliable from the vxworks archives or forgoing
adjtime() and using the clock_[get|set]time().The <A HREF="../include/ntp_machine.h">ntp_machine.h
</A>file clearly marks how to do this. </P>
<H1><B>Compilation issues</B> </H1>
<P>You will need autoconf and automake ... available free from the gnu
archives worldwide. </P>
<P>The variable arch is the target architecture (e.g. i486) </P>
<P>mkdir A.vxworks (or whatever....) <BR>
cd A.vxworks <BR>
../configure --target=arch-wrs-vxworks [any other options] <BR>
make </P>
<P>Options I normally use are the --disable-all-clocks --enable-LOCAL-CLOCK flags.
The program should proceed to compile without problem. The daemon ntpd,
ntpdate, ntptrace, ntpdc, ntpq programs and of course the libraries are
all fully ported. The other utilities are not, but they should be easy
to port. </P>
<H1>Running the software </H1>
<P>Load in the various files, call them in the normal vxWorks function
type manner. Here are some examples. Refer to the man pages for further
information. </P>
<P>ld &lt; ntpdate/ntpdate <BR>
ld &lt; ntpd/ntpd <BR>
ld &lt; ntptrace/ntptrace <BR>
ld &lt; ntpq/ntpq <BR>
ld &lt; ntpdc/ntpdc <BR>
ntpdate (&quot;-b&quot;, &quot;192.168.0.245&quot;) <BR>
sp(ntpd, &quot;-c&quot;, &quot;/export/home/casey/ntp/ntp.conf&quot;)
<BR>
ntpdc(&quot;-c&quot;, &quot;monlist&quot;, &quot;192.168.0.244&quot;)
<BR>
ntpq(&quot;-c&quot;, &quot;peers&quot;, &quot;192.168.0.244&quot;) <BR>
ntptrace(&quot;192.168.0.244&quot;) <BR>
</P>
<H1>Bugs and such </H1>
<P>Should you happen across any bugs, please let me know, or better yet
fix them and submit a patch. Remember to make you patch general for Vxworks,
not just for your particular architecture.
<A HREF="http://www.ccii.co.za">CCII Systems
(Pty) Ltd</A>, my ex employers, sponsored the time to this port.
Please let me know how it goes, I would be most interested in offsets
and configurations. </P>
<P><BR>
</P>
<P>Casey Crellin</A> <BR>
<A HREF="mailto:[email protected]">[email protected]</A> </P>
<P><BR>
</P>
</BODY>
</HTML>
-250
View File
@@ -1,250 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<title>NTP Timescale and Leap Seconds</title>
</head>
<body>
<h3>NTP Timescale and Leap Seconds</h3>
<img align="left" src="pic/alice15.gif" alt="gif"><a href=
"pictures.htm">from <i>Alice's Adventures in Wonderland</i>, Lewis
Carroll</a>
<p>The Mad Hatter and the March Hare are discussing whether the
Teapot serial number should have two or four digits.<br clear=
"left">
</p>
<hr>
<h4>Introduction</h4>
<p>In the year 2001 the Network Time Protocol (NTP) has been in use
for over two decades and remains the longest running, continuously
operating application protocol in the Internet. There was some
concern, especially in government and financial institutions, that
NTP might cause Internet applications to misbehave in terrible ways
on the epoch of the new century, but this didn't happen. However,
how NTP reckons the time is important when considering the
relationship between NTP time and conventional civil time.</p>
<p>This document presents an analysis of the NTP timescale, in
particular the metrication relative to the conventional civil
timescale and when the NTP timescale rolls over in 2036. These
issues are also important with respect to the Unix timescale, but
that rollover will not happen until 2038. This document does not
establish a standard, nor does it present specific algorithms which
metricate the NTP timescale with respect to other timescales.</p>
<h4>The NTP Timescale</h4>
<p>It will be helpful in understanding the issues raised in this
document to consider the concept of a universal timescale. The
conventional civil timescale used in most parts of the world is
based on Coordinated Universal Time (UTC) (sic), formerly known as
Greenwich Mean Time (GMT). UTC is based on International Atomic
Time (TAI sic), which is derived from hundreds of cesium clocks in
the national standards laboratories of many countries. Deviations
of UTC from TAI are implemented in the form of leap seconds, which
occur on average every eighteen months.</p>
<p>For almost every computer application today, UTC represents the
universal timescale extending into the indefinite past and
indefinite future. We know of course that the UTC timescale did not
exist prior to 1972, the Gregorian calendar did not exist prior to
1582, the Julian calendar did not exist prior to 54 BC and we
cannot predict exactly when the next leap second will occur.
Nevertheless, most folks would prefer that, even if we can't get
future seconds numbering right beyond the next leap second, at
least we can get the days numbering right until the end of
reason.</p>
<p>The universal timescale can be implemented using a binary
counter of indefinite width and with the unit seconds bit placed
somewhere in the middle. The counter is synchronized to UTC such
that it runs at the same rate (also the rate of TAI) and the units
increment coincides with the UTC seconds tick. The NTP timescale is
constructed from 64 bits of this counter, of which 32 bits number
the seconds and 32 bits represent the fraction. With this design,
the counter runs in 136-year cycles, called eras, the latest of
which began with a counter value of zero at 0h 1 January 1900. The
next era will begin when the seconds counter rolls over sometime in
2036. The design assumption is that further low order bits, if
required, are provided by local interpolation, while further high
order bits, when required, are provided by external means.</p>
<p>The important point to be made here is that the high order bits
must ultimately be provided by astronomers and disseminated to the
population by international means. Ultimately, should a need exist
to align a particular NTP era to the current calendar, the
operating system in which NTP is embedded must provide the
necessary high order bits, most conveniently from the file system
or flash memory.</p>
<p>With respect to the recent year 2000 issue, the most important
thing to observe about the NTP timescale is that it knows nothing
about days, years or centuries, only the seconds since the
beginning of the current era which began on 1 January 1900. On 1
January 1970 when Unix life began, the NTP timescale showed
2,208,988,800 and on 1 January 1972 when UTC life began, it showed
2,272,060,800. On the last second of the year 1999, the NTP
timescale showed 3,155,673,599 and one second later on the first
second of the next century showed 3,155,673,600. Other than this
observation, the NTP timescale has no knowledge of or provision for
any of these eclectic seconds.</p>
<h4>Conversion to Other Timescales</h4>
<p>The NTP timescale is almost never used directly by system or
application programs. The generic Unix kernel keeps time in seconds
and microseconds (or nanoseconds) to provide both time of day and
interval timer functions. In order to synchronize the Unix clock,
NTP must convert to and from NTP representation and Unix
representation. Unix kernels implement the time of day function
using two 32-bit counters, one representing the signed seconds
since Unix life began and the other the microseconds or nanoseconds
of the second. In principle, the seconds counter will change sign
in 2038. How the particular Unix semantics interprets the counter
values is of concern, but is beyond the scope of discussion
here.</p>
<p>While incorrect NTP time values are unlikely in a properly
configured subnet using strong cryptography, redundant sources and
diverse network paths, hazards remain due to incorrect software
external to NTP. These include the Unix kernel and library routines
which convert NTP time to and from Unix time and to and from
conventional civil time in seconds, minutes, hours, days and years.
Although NTP uses these routines to format monitoring data
displays, they are not used to read or set the NTP clock. They may
in fact cause problems with certain application programs, but this
is not an issue which concerns NTP correctness.</p>
<p>It is possible that some external source to which NTP
synchronizes may produce a discontinuity which could then induce a
NTP discontinuity. The NTP primary (stratum 1) time servers, which
are the ultimate time references for the entire NTP population,
obtain time from various sources, including radio and satellite
receivers and telephone modems. Not all sources provide year
information and not all of these provide time in four-digit form.
In point of fact, the NTP reference implementation does not use the
year information, even if available. Instead, the year information
is provided from the file system, which itself depends on the Unix
clock.</p>
<p>Most computers include a time-of-year (TOY) clock chip which
maintains the time when the power is off. When the operating system
is booted, the system clock is set from the chip. As the chip does
not record the year, this value is determined from the datestamp on
a system configuration file. For this to be correct, the filestamp must by updated at least once each year. The NTP protocol specification
requires the apparent NTP time derived from external servers to be
compared to the system time before the clock is set. If the
discrepancy is over 1000 seconds, an error alarm is raised
requiring manual intervention. This makes it very unlikely that
even a clique of seriously corrupted NTP servers will result in
grossly incorrect time values. When the system clock is synchronized to
NTP, the TOY chip is corrected to system time on a regular
basis.</p>
<h4>Timescale Resolution and the Tick Interval</h4>
<p>Modern computer clocks use a hardware counter to generate processor interrupts at tick intervals in the order of a few milliseconds. At each tick the processor increments the software system clock by the number of microseconds or nanoseconds in the tick. The software resolution of the system clock is defined as the tick interval. Most modern processors implement some kind of high resolution hardware counter that can be used to interpolate the interval between the most recent tick and the actual clock reading. The hardware resolution of the system clock is defined as the time between increments of this counter. However, the actual reading latency due to the kernel interface and interpolation code can range from a few tens of microseconds in older processors to under a microsecond in modern processors.</p>
<p>System clock correctness principles require that clock readings must be always monotonically increasing, so that no two clock readings will be the same. As long as the reading latency exceeds the hardware resolution, this behavior is guaranteed. With reading latencies dropping below the microsecond in modern processors, the system clock in modern operating systems runs in nanoseconds, rather than the microseconds used in the original Unix kernel. With processor speeds exceeding 1 GHz, this assumption may be in jeopardy.
<h4>Leap Seconds</h4>
<p>The International Earth Rotation Service (IERS) uses
astronomical observations provided by USNO and other observatories
to determine UTC, which is syntonic (identical frequency) with TAI
but offset by a integral number of seconds. Starting from apparent
mean solar time as observed, the UT0 timescale is determined using
corrections for Earth orbit and inclination (the Equation of Time,
as used by sundials), the UT1 (navigator's) timescale by adding
corrections for polar migration and the UT2 timescale by adding
corrections for known periodicity variations. UTC is based on UT1,
which is presently fast relative to TAI by a fraction of a second
per year. Since the UTC timescale runs at the TAI rate, when the
magnitude of the UT1 correction approaches 0.5 second, a leap
second is inserted or deleted in the UTC timescale on the last day
of June or December.</p>
<p>For the most precise coordination and timestamping of events
since 1972, it is necessary to know when leap seconds are
implemented in UTC and how the seconds are numbered. The insertion
of leap seconds into UTC is currently the responsibility of the
IERS, which is located at the Paris Observatory. As specified in
CCIR Report 517, a leap second is inserted following second
23:59:59 on the last day of June or December and becomes second
23:59:60 of that day. A leap second would be deleted by omitting
second 23:59:59 on one of these days, although this has never
happened. A table of historic leap seconds and the NTP time when
each occurred is available via FTP from any NIST NTP server.</p>
<p>The UTC timescale thus ticks in standard (atomic) seconds and
was set to an initial offset of 10 seconds relative to TAI at 0h
MJD 41,318.0 according to the Julian calendar or 0h on 1 January
1972 according to the Gregorian calendar. This established the
first tick of the UTC era and its reckoning with these calendars.
Subsequently, the UTC timescale has marched backward relative to
the TAI timescale exactly one second on scheduled occasions
recorded in the institutional memory of our civilization. Note in
passing that leap second adjustments affect the number of seconds
per day and thus the number of seconds per year. Apparently, should
we choose to worry about it, the UTC clock, Gregorian calendar and
various cosmic oscillators will inexorably drift apart with time
until rationalized by some future papal bull.</p>
<h4>Reckoning with NTP and UTC Leap seconds</h4>
<p>The NTP timescale is based on the UTC timescale, but not
necessarily always coincident with it. At the first tick of the UTC
Era, which began at 0h on 1 January 1972 (MJD 41,318.0) the NTP
clock read 2,272,060,800, representing the number of standard
seconds since the beginning of the NTP era at 0h on 1 January 1900
(MJD 15,021.0) according to the Gregorian calendar. The insertion
of leap seconds in UTC and subsequently into NTP does not affect
the UTC or NTP oscillator frequency, only the conversion between
NTP network time and UTC civil time. However, since the only
institutional memory available to NTP are the UTC broadcast
services, the NTP timescale is in effect reset to UTC as each
broadcast timecode is received. Thus, when a leap second is
inserted in UTC and subsequently in NTP, knowledge of all previous
leap seconds is lost.</p>
<p>Another way to describe this is to say there are as many NTP
timescales as historic leap seconds. In effect, a new timescale is
established after each new leap second. Thus, all previous leap
seconds, not to mention the apparent origin of the timescale
itself, lurch forward one second as each new timescale is
established. If a clock synchronized to NTP in early 2001 was used
to establish the UTC epoch of an event that occurred in early 1972
without correction, the event would appear 22 seconds late.
However, NTP primary time servers resolve the epoch using the
broadcast timecode, so that the NTP clock is set to the broadcast
value on the current timescale. As a result, for the most precise
determination of epoch relative to the historic Gregorian calendar
and UTC timescale, the user must subtract from the apparent NTP
epoch the offsets derived from the NIST table. This is a feature of
almost all present day time distribution mechanisms.</p>
<p>The obvious question raised by this scenario is what happens
during the leap second when NTP time stops and the clock remains
unchanged. If the precision time kernel modifications have been
implemented, the kernel includes a state machine that implements
the actions required by the scenario. At the exact instant of the
leap, the logical clock is stepped backward one second. However,
the routine that actually reads the clock is constrained never to
step backwards, unless the step is significantly larger than one
second, which might occur due to explicit operator direction.</p>
<p>In this design time stands still during the leap second, but is correct commencing with the next second. Since clock readings must be positive monotonic, the apparent time will increase by one nanosecond for each reading. At the end of the second the apparent time may be ahead of the actual time depending on how many times the clocks was read during the second. Eventually, the actual time will catch up with the apparent time and operation continues normally.</p>
<hr>
<a href="index.htm"><img align="left" src="pic/home.gif" alt=
"gif"></a>
<address><a href="mailto:[email protected]">David L. Mills
&lt;[email protected]&gt;</a></address>
</body>
</html>
-144
View File
@@ -1,144 +0,0 @@
/****************************************************************************/
/* hopf6039.h */
/* hopf Elektronik 6039 PCI radio clock header */
/* (c) 1999, 2000 Bernd Altmeier <[email protected]> */
/* Rev. 1.00 Date 25.03.2000 */
/* History: */
/****************************************************************************/
#ifndef _hopf6039_H_
#define _hopf6039_H_
#define HOPF_MAXVERSION 8
#define HOPF_CNTR_MEM_LEN 0x7f
#define HOPF_DATA_MEM_LEN 0x3ff /* this is our memory size */
/* macros and definition for 32 to 16 to 8 bit conversion */
typedef unsigned long DWORD;
typedef unsigned char BYTE;
typedef unsigned short WORD;
#define LOWORD(l) ((WORD)(l))
#define HIWORD(l) ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
#define LOBYTE(w) ((BYTE)(w))
#define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xFF))
/* iocntl codes for driver access */
#define HOPF_CLOCK_CMD_MASK 0xff000
#define HOPF_CLOCK_GET_LOCAL 0x10000
#define HOPF_CLOCK_GET_UTC 0x20000
#define HOPF_CLOCK_GET_ANTENNA 0x30000
#define HOPF_CLOCK_GET_DIFFERENCE 0x40000
#define HOPF_CLOCK_GET_VERSION 0x50000
#define HOPF_CLOCK_GET_POSITION 0x60000
#define HOPF_CLOCK_GET_SATDATA 0x70000
#define HOPF_CLOCK_GET_SYSTEMBYTE 0x80000
#define HOPF_CLOCK_GET_IRIG 0x90000
#define HOPF_CLOCK_SET_DIFFERENCE 0x01000
#define HOPF_CLOCK_SET_ANTENNA 0x02000
#define HOPF_CLOCK_SET_TIME 0x03000
#define HOPF_CLOCK_SET_POSITION 0x04000
#define HOPF_CLOCK_SET_SATMODE 0x05000
#define HOPF_CLOCK_SET_SYSTEMBYTE 0x06000
#define HOPF_CLOCK_SET_RESET 0x07000
#define HOPF_CLOCK_SET_IRIG 0x08000
/* clock command codes */
#define HOPF_CLOCK_HARDRESET 0x00008000
#define HOPF_CLOCK_SOFTRESET 0x00004000
/* sat-information */
typedef struct SatStat{
BYTE wVisible;
BYTE wMode;
BYTE wSat0;
BYTE wRat0;
BYTE wSat1;
BYTE wRat1;
BYTE wSat2;
BYTE wRat2;
BYTE wSat3;
BYTE wRat3;
BYTE wSat4;
BYTE wRat4;
BYTE wSat5;
BYTE wRat5;
BYTE wSat6;
BYTE wRat6;
BYTE wSat7;
BYTE wRat7;
} SatStat;
/* GPS position */
typedef struct GPSPos { /* Position */
long wAltitude;
long wLongitude;
long wLatitude;
} GPSPos;
/* clock hardware version */
typedef struct ClockVersion {
char cVersion[255]; /* Hardware Version like " DCF-RECEIVER, VERSION 01.01, DAT: 23.NOV.1999" */
char dVersion[255]; /* Driver Version */
} ClockVersion;
/* hopftime what you think */
typedef struct HOPFTIME {
unsigned int wYear;
unsigned int wMonth;
unsigned int wDayOfWeek;
unsigned int wDay;
unsigned int wHour;
unsigned int wMinute;
unsigned int wSecond;
unsigned int wMilliseconds;
unsigned int wStatus;
} HOPFTIME;
/* DCF77 antenna alignment */
typedef struct DcfAntenne {
BYTE bStatus;
BYTE bStatus1;
WORD wAntValue;
} DcfAntenne;
/* hopf PCI clock */
typedef struct hopfCard {
char name[32];
unsigned irq;
unsigned long membase; /* without mmap */
unsigned int port;
int versionlen;
char versionbuf[1024];
char *version[HOPF_MAXVERSION];
char cardname[32];
int interrupt;
void *mbase; /* this will be our memory base address */
} hopfCard;
typedef struct cardparams {
unsigned int port;
unsigned irq;
int cardtype;
int cardnr;
unsigned int membase;
} cardparams;
#define WRITE_REGISTER 0x00
#define READ_REGISTER 0x01
#endif /* _hopf6039_H_ */
-4
View File
@@ -1,4 +0,0 @@
#include "ntp_types.h"
extern void getstartup P((int, char **));
extern void getCmdOpts P((int, char **));
-151
View File
@@ -1,151 +0,0 @@
/*
* Configuration file name
*/
#ifndef CONFIG_FILE
# ifndef SYS_WINNT
# define CONFIG_FILE "/etc/ntp.conf"
# else /* SYS_WINNT */
# define CONFIG_FILE "%windir%\\system32\\drivers\\etc\\ntp.conf"
# define ALT_CONFIG_FILE "%windir%\\ntp.conf"
# endif /* SYS_WINNT */
#endif /* not CONFIG_FILE */
/*
* Types of entries we understand.
*/
#define CONFIG_UNKNOWN 0
/*
* Command keywords
*/
#define CONFIG_PEER 1
#define CONFIG_SERVER 2
#define CONFIG_AUTOMAX 3
#define CONFIG_DRIFTFILE 4
#define CONFIG_BROADCAST 5
#define CONFIG_BROADCASTCLIENT 6
#define CONFIG_AUTHENTICATE 7
#define CONFIG_KEYS 8
#define CONFIG_REVOKE 9
#define CONFIG_PPS 10
#define CONFIG_RESTRICT 11
#define CONFIG_BDELAY 12
#define CONFIG_TRUSTEDKEY 13
#define CONFIG_REQUESTKEY 14
#define CONFIG_CONTROLKEY 15
#define CONFIG_TRAP 16
#define CONFIG_FUDGE 17
#define CONFIG_TINKER 18
#define CONFIG_STATSDIR 19
#define CONFIG_FILEGEN 20
#define CONFIG_STATISTICS 21
#define CONFIG_PIDFILE 22
#define CONFIG_SETVAR 23
#define CONFIG_CLIENTLIMIT 24
#define CONFIG_CLIENTPERIOD 25
#define CONFIG_MULTICASTCLIENT 26
#define CONFIG_ENABLE 27
#define CONFIG_DISABLE 28
#define CONFIG_PHONE 29
#define CONFIG_LOGFILE 30
#define CONFIG_LOGCONFIG 31
#define CONFIG_MANYCASTCLIENT 32
#define CONFIG_MANYCASTSERVER 33
#ifdef PUBKEY
#define CONFIG_CRYPTO 34
#define CONFIG_KEYSDIR 35
#endif /* PUBKEY */
#define CONFIG_INCLUDEFILE 36
/*
* "peer", "server", "broadcast" modifier keywords
*/
#define CONF_MOD_VERSION 1
#define CONF_MOD_KEY 2
#define CONF_MOD_MINPOLL 3
#define CONF_MOD_MAXPOLL 4
#define CONF_MOD_PREFER 5
#define CONF_MOD_BURST 6
#define CONF_MOD_IBURST 7
#define CONF_MOD_SKEY 8
#define CONF_MOD_TTL 9
#define CONF_MOD_MODE 10
#define CONF_MOD_NOSELECT 11
#ifdef PUBKEY
#define CONF_MOD_PUBLICKEY 12
#endif /* PUBKEY */
/*
* "restrict" modifier keywords
*/
#define CONF_RES_MASK 1
#define CONF_RES_IGNORE 2
#define CONF_RES_NOSERVE 3
#define CONF_RES_NOTRUST 4
#define CONF_RES_NOQUERY 5
#define CONF_RES_NOMODIFY 6
#define CONF_RES_NOPEER 7
#define CONF_RES_NOTRAP 8
#define CONF_RES_LPTRAP 9
#define CONF_RES_NTPPORT 10
#define CONF_RES_LIMITED 11
#define CONF_RES_VERSION 12
#define CONF_RES_DEMOBILIZE 13
/*
* "trap" modifier keywords
*/
#define CONF_TRAP_PORT 1
#define CONF_TRAP_INTERFACE 2
/*
* "fudge" modifier keywords
*/
#define CONF_FDG_TIME1 1
#define CONF_FDG_TIME2 2
#define CONF_FDG_STRATUM 3
#define CONF_FDG_REFID 4
#define CONF_FDG_FLAG1 5
#define CONF_FDG_FLAG2 6
#define CONF_FDG_FLAG3 7
#define CONF_FDG_FLAG4 8
/*
* "filegen" modifier keywords
*/
#define CONF_FGEN_FILE 1
#define CONF_FGEN_TYPE 2
#define CONF_FGEN_FLAG_LINK 3
#define CONF_FGEN_FLAG_NOLINK 4
#define CONF_FGEN_FLAG_ENABLE 5
#define CONF_FGEN_FLAG_DISABLE 6
/*
* "pps" modifier keywords
*/
#define CONF_PPS_ASSERT 1
#define CONF_PPS_CLEAR 2
#define CONF_PPS_HARDPPS 3
/*
* "tinker" modifier keywords
*/
#define CONF_CLOCK_MAX 1
#define CONF_CLOCK_PANIC 2
#define CONF_CLOCK_PHI 3
#define CONF_CLOCK_MINSTEP 4
#define CONF_CLOCK_MINPOLL 5
#define CONF_CLOCK_ALLAN 6
#define CONF_CLOCK_HUFFPUFF 7
#ifdef PUBKEY
/*
* "crypto" modifier keywords
*/
#define CONF_CRYPTO_DH 1
#define CONF_CRYPTO_PRIVATEKEY 2
#define CONF_CRYPTO_PUBLICKEY 3
#define CONF_CRYPTO_LEAP 4
#define CONF_CRYPTO_FLAGS 5
#define CONF_CRYPTO_CERT 6
#endif /* PUBKEY */
-93
View File
@@ -1,93 +0,0 @@
/*
* ntp_crypto.h - definitions for cryptographic operations
*/
#ifdef AUTOKEY
#include "global.h"
#include "md5.h"
#ifdef RSAREF
#include "rsaref.h"
#include "rsa.h"
#define EVP_SignInit(a, b) R_SignInit(a, b)
#define EVP_SignUpdate(a, b, c) R_SignUpdate(a, b, c);
#define EVP_SignFinal(a, b, c, d) R_SignFinal(a, b, c, d);
#define EVP_VerifyInit(a, b) R_VerifyInit(a, b)
#define EVP_VerifyUpdate(a, b, c) R_VerifyUpdate(a, b, c);
#define EVP_VerifyFinal(a, b, c, d) R_VerifyFinal(a, b, c, d);
#endif /* RSAREF */
/*
* Cryptostatus word
*/
#define CRYPTO_FLAG_ENAB 0x01 /* crypto enable */
#define CRYPTO_FLAG_RSA 0x02 /* public/private keys */
#define CRYPTO_FLAG_CERT 0x04 /* certificate */
#define CRYPTO_FLAG_DH 0x08 /* agreement parameters */
#define CRYPTO_FLAG_TAI 0x10 /* leapseconds table */
/*
* Extension field definitions
*/
#define CRYPTO_VN 1 /* current protocol version number */
#define CRYPTO_NULL ((CRYPTO_VN << 8) | 0) /* no operation */
#define CRYPTO_STAT ((CRYPTO_VN << 8) | 1) /* status */
#define CRYPTO_ASSOC ((CRYPTO_VN << 8) | 2) /* association ID */
#define CRYPTO_AUTO ((CRYPTO_VN << 8) | 3) /* autokey values */
#define CRYPTO_PRIV ((CRYPTO_VN << 8) | 4) /* cookie value */
#define CRYPTO_DHPAR ((CRYPTO_VN << 8) | 5) /* agreement params */
#define CRYPTO_DH ((CRYPTO_VN << 8) | 6) /* public value */
#define CRYPTO_NAME ((CRYPTO_VN << 8) | 7) /* host name/pub key */
#define CRYPTO_CERT ((CRYPTO_VN << 8) | 8) /* PKI certificate */
#define CRYPTO_TAI ((CRYPTO_VN << 8) | 9) /* leapseconds table */
#define CRYPTO_RESP 0x8000 /* response */
#define CRYPTO_ERROR 0x4000 /* error */
#ifdef PUBKEY
/*
* Configuration codes
*/
#define CRYPTO_CONF_NONE 0 /* nothing doing */
#define CRYPTO_CONF_FLAGS 1 /* initialize flags */
#define CRYPTO_CONF_PRIV 2 /* load private key from file */
#define CRYPTO_CONF_PUBL 3 /* load public key from file */
#define CRYPTO_CONF_DH 4 /* load Diffie_Hellman pars from file */
#define CRYPTO_CONF_LEAP 5 /* load leapsecond table */
#define CRYPTO_CONF_KEYS 6 /* set keys directory path */
#define CRYPTO_CONF_CERT 7 /* load PKI certificate from file */
#endif /* PUBKEY */
/*
* Function prototypes
*/
extern void crypto_recv P((struct peer *, struct recvbuf *));
extern int crypto_xmit P((u_int32 *, int, u_int, keyid_t,
u_int));
extern keyid_t session_key P((struct sockaddr_in *, struct
sockaddr_in *, keyid_t, keyid_t,
u_long));
extern void make_keylist P((struct peer *, struct interface *));
extern void key_expire P((struct peer *));
extern void crypto_agree P((void));
#ifdef PUBKEY
extern void crypto_config P((int, char *));
extern void crypto_setup P((void));
extern int crypto_public P((struct peer *, u_char *, u_int));
#endif /* PUBKEY */
/*
* Cryptographic values
*/
extern u_int crypto_flags; /* status word */
#ifdef PUBKEY
extern R_DH_PARAMS dh_params;
extern struct value host; /* host name/public key */
extern struct value certif; /* certificate */
extern struct value dhparam; /* agreement parameters */
extern struct value dhpub; /* public value */
extern struct value tai_leap; /* leapseconds table */
extern u_int crypto_flags; /* status word */
extern u_int sys_tai; /* current UTC offset from TAI */
#endif /* PUBKEY */
#endif /* AUTOKEY */
-68
View File
@@ -1,68 +0,0 @@
/*
* ntp_tty.h - header file for serial lines handling
*/
#ifndef NTP_TTY_H
#define NTP_TTY_H
#if defined(HAVE_BSD_TTYS)
#include <sgtty.h>
#define TTY struct sgttyb
#endif /* HAVE_BSD_TTYS */
#if defined(HAVE_SYSV_TTYS)
#include <termio.h>
#define TTY struct termio
#ifndef tcsetattr
#define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg)
#endif
#ifndef TCSANOW
#define TCSANOW TCSETA
#endif
#ifndef TCIFLUSH
#define TCIFLUSH 0
#endif
#ifndef TCOFLUSH
#define TCOFLUSH 1
#endif
#ifndef TCIOFLUSH
#define TCIOFLUSH 2
#endif
#ifndef tcflush
#define tcflush(fd, arg) ioctl(fd, TCFLSH, arg)
#endif
#endif /* HAVE_SYSV_TTYS */
#if defined(HAVE_TERMIOS)
# ifdef TERMIOS_NEEDS__SVID3
# define _SVID3
# endif
# include <termios.h>
# ifdef TERMIOS_NEEDS__SVID3
# undef _SVID3
# endif
#define TTY struct termios
#endif
#if defined(HAVE_SYS_MODEM_H)
#include <sys/modem.h>
#endif
#if !defined(SYSV_TTYS) && !defined(STREAM) & !defined(BSD_TTYS)
#define BSD_TTYS
#endif /* SYSV_TTYS STREAM BSD_TTYS */
/*
* Line discipline flags. These require line discipline or streams
* modules to be installed/loaded in the kernel. If specified, but not
* installed, the code runs as if unspecified.
*/
#define LDISC_STD 0x0 /* standard */
#define LDISC_CLK 0x1 /* tty_clk \n intercept */
#define LDISC_CLKPPS 0x2 /* tty_clk \377 intercept */
#define LDISC_ACTS 0x4 /* tty_clk #* intercept */
#define LDISC_CHU 0x8 /* depredated */
#define LDISC_PPS 0x10 /* ppsclock, ppsapi */
#define LDISC_RAW 0x20 /* raw binary */
#endif /* NTP_TTY_H */
-482
View File
@@ -1,482 +0,0 @@
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)random.c 8.2 (Berkeley) 5/19/95";
#endif /* LIBC_SCCS and not lint */
#include "config.h"
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <stdio.h>
#include <ntp_types.h>
/*
* random.c:
*
* An improved random number generation package. In addition to the standard
* rand()/srand() like interface, this package also has a special state info
* interface. The initstate() routine is called with a seed, an array of
* bytes, and a count of how many bytes are being passed in; this array is
* then initialized to contain information for random number generation with
* that much state information. Good sizes for the amount of state
* information are 32, 64, 128, and 256 bytes. The state can be switched by
* calling the setstate() routine with the same array as was initiallized
* with initstate(). By default, the package runs with 128 bytes of state
* information and generates far better random numbers than a linear
* congruential generator. If the amount of state information is less than
* 32 bytes, a simple linear congruential R.N.G. is used.
*
* Internally, the state information is treated as an array of longs; the
* zeroeth element of the array is the type of R.N.G. being used (small
* integer); the remainder of the array is the state information for the
* R.N.G. Thus, 32 bytes of state information will give 7 longs worth of
* state information, which will allow a degree seven polynomial. (Note:
* the zeroeth word of state information also has some other information
* stored in it -- see setstate() for details).
*
* The random number generation technique is a linear feedback shift register
* approach, employing trinomials (since there are fewer terms to sum up that
* way). In this approach, the least significant bit of all the numbers in
* the state table will act as a linear feedback shift register, and will
* have period 2^deg - 1 (where deg is the degree of the polynomial being
* used, assuming that the polynomial is irreducible and primitive). The
* higher order bits will have longer periods, since their values are also
* influenced by pseudo-random carries out of the lower bits. The total
* period of the generator is approximately deg*(2**deg - 1); thus doubling
* the amount of state information has a vast influence on the period of the
* generator. Note: the deg*(2**deg - 1) is an approximation only good for
* large deg, when the period of the shift register is the dominant factor.
* With deg equal to seven, the period is actually much longer than the
* 7*(2**7 - 1) predicted by this formula.
*
* Modified 28 December 1994 by Jacob S. Rosenberg.
* The following changes have been made:
* All references to the type u_int have been changed to unsigned long.
* All references to type int have been changed to type long. Other
* cleanups have been made as well. A warning for both initstate and
* setstate has been inserted to the effect that on Sparc platforms
* the 'arg_state' variable must be forced to begin on word boundaries.
* This can be easily done by casting a long integer array to char *.
* The overall logic has been left STRICTLY alone. This software was
* tested on both a VAX and Sun SpacsStation with exactly the same
* results. The new version and the original give IDENTICAL results.
* The new version is somewhat faster than the original. As the
* documentation says: "By default, the package runs with 128 bytes of
* state information and generates far better random numbers than a linear
* congruential generator. If the amount of state information is less than
* 32 bytes, a simple linear congruential R.N.G. is used." For a buffer of
* 128 bytes, this new version runs about 19 percent faster and for a 16
* byte buffer it is about 5 percent faster.
*/
/*
* For each of the currently supported random number generators, we have a
* break value on the amount of state information (you need at least this
* many bytes of state info to support this random number generator), a degree
* for the polynomial (actually a trinomial) that the R.N.G. is based on, and
* the separation between the two lower order coefficients of the trinomial.
*/
#define TYPE_0 0 /* linear congruential */
#define BREAK_0 8
#define DEG_0 0
#define SEP_0 0
#define TYPE_1 1 /* x**7 + x**3 + 1 */
#define BREAK_1 32
#define DEG_1 7
#define SEP_1 3
#define TYPE_2 2 /* x**15 + x + 1 */
#define BREAK_2 64
#define DEG_2 15
#define SEP_2 1
#define TYPE_3 3 /* x**31 + x**3 + 1 */
#define BREAK_3 128
#define DEG_3 31
#define SEP_3 3
#define TYPE_4 4 /* x**63 + x + 1 */
#define BREAK_4 256
#define DEG_4 63
#define SEP_4 1
/*
* Array versions of the above information to make code run faster --
* relies on fact that TYPE_i == i.
*/
#define MAX_TYPES 5 /* max number of types above */
static long degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 };
static long seps [MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 };
/*
* Initially, everything is set up as if from:
*
* initstate(1, randtbl, 128);
*
* Note that this initialization takes advantage of the fact that srandom()
* advances the front and rear pointers 10*rand_deg times, and hence the
* rear pointer which starts at 0 will also end up at zero; thus the zeroeth
* element of the state information, which contains info about the current
* position of the rear pointer is just
*
* MAX_TYPES * (rptr - state) + TYPE_3 == TYPE_3.
*/
static long randtbl[DEG_3 + 1] = {
TYPE_3,
#ifdef USE_WEAK_SEEDING
/* Historic implementation compatibility */
/* The random sequences do not vary much with the seed */
0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342, 0xde3b81e0, 0xdf0a6fb5,
0xf103bc02, 0x48f340fb, 0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd,
0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86, 0xda672e2a, 0x1588ca88,
0xe369735d, 0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc,
0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, 0xf5ad9d0e, 0x8999220b,
0x27fb47b9,
#else /* !USE_WEAK_SEEDING */
0x991539b1, 0x16a5bce3, 0x6774a4cd, 0x3e01511e, 0x4e508aaa, 0x61048c05,
0xf5500617, 0x846b7115, 0x6a19892c, 0x896a97af, 0xdb48f936, 0x14898454,
0x37ffd106, 0xb58bff9c, 0x59e17104, 0xcf918a49, 0x09378c83, 0x52c7a471,
0x8d293ea9, 0x1f4fc301, 0xc3db71be, 0x39b44e1c, 0xf8a44ef9, 0x4c8b80b1,
0x19edc328, 0x87bf4bdd, 0xc9b240e5, 0xe9ee4b1b, 0x4382aee7, 0x535b6b41,
0xf3bec5da
#endif /* !USE_WEAK_SEEDING */
};
/*
* fptr and rptr are two pointers into the state info, a front and a rear
* pointer. These two pointers are always rand_sep places aparts, as they
* cycle cyclically through the state information. (Yes, this does mean we
* could get away with just one pointer, but the code for random() is more
* efficient this way). The pointers are left positioned as they would be
* from the call
*
* initstate(1, randtbl, 128);
*
* (The position of the rear pointer, rptr, is really 0 (as explained above
* in the initialization of randtbl) because the state table pointer is set
* to point to randtbl[1] (as explained below).
*/
static long *fptr = &randtbl[SEP_3 + 1];
static long *rptr = &randtbl[1];
/*
* The following things are the pointer to the state information table, the
* type of the current generator, the degree of the current polynomial being
* used, and the separation between the two pointers. Note that for efficiency
* of random(), we remember the first location of the state information, not
* the zeroeth. Hence it is valid to access state[-1], which is used to
* store the type of the R.N.G. Also, we remember the last location, since
* this is more efficient than indexing every time to find the address of
* the last element to see if the front and rear pointers have wrapped.
*/
static long *state = &randtbl[1];
static long rand_type = TYPE_3;
static long rand_deg = DEG_3;
static long rand_sep = SEP_3;
static long *end_ptr = &randtbl[DEG_3 + 1];
static inline long good_rand P((long));
long random P((void));
static inline long
good_rand (
register long x
)
{
#ifdef USE_WEAK_SEEDING
/*
* Historic implementation compatibility.
* The random sequences do not vary much with the seed,
* even with overflowing.
*/
return (1103515245 * x + 12345);
#else /* !USE_WEAK_SEEDING */
/*
* Compute x = (7^5 * x) mod (2^31 - 1)
* wihout overflowing 31 bits:
* (2^31 - 1) = 127773 * (7^5) + 2836
* From "Random number generators: good ones are hard to find",
* Park and Miller, Communications of the ACM, vol. 31, no. 10,
* October 1988, p. 1195.
*/
register long hi, lo;
hi = x / 127773;
lo = x % 127773;
x = 16807 * lo - 2836 * hi;
if (x <= 0)
x += 0x7fffffff;
return (x);
#endif /* !USE_WEAK_SEEDING */
}
/*
* srandom:
*
* Initialize the random number generator based on the given seed. If the
* type is the trivial no-state-information type, just remember the seed.
* Otherwise, initializes state[] based on the given "seed" via a linear
* congruential generator. Then, the pointers are set to known locations
* that are exactly rand_sep places apart. Lastly, it cycles the state
* information a given number of times to get rid of any initial dependencies
* introduced by the L.C.R.N.G. Note that the initialization of randtbl[]
* for default usage relies on values produced by this routine.
*/
void
srandom(
unsigned long x
)
{
register long i;
if (rand_type == TYPE_0)
state[0] = x;
else {
state[0] = x;
for (i = 1; i < rand_deg; i++)
state[i] = good_rand(state[i - 1]);
fptr = &state[rand_sep];
rptr = &state[0];
for (i = 0; i < 10 * rand_deg; i++)
(void)random();
}
}
/*
* srandomdev:
*
* Many programs choose the seed value in a totally predictable manner.
* This often causes problems. We seed the generator using the much more
* secure urandom(4) interface. Note that this particular seeding
* procedure can generate states which are impossible to reproduce by
* calling srandom() with any value, since the succeeding terms in the
* state buffer are no longer derived from the LC algorithm applied to
* a fixed seed.
*/
void
srandomdev( void )
{
struct timeval tv;
unsigned long junk; /* Purposely used uninitialized */
gettimeofday(&tv, NULL);
srandom(getpid() ^ tv.tv_sec ^ tv.tv_usec ^ junk);
return;
}
/*
* initstate:
*
* Initialize the state information in the given array of n bytes for future
* random number generation. Based on the number of bytes we are given, and
* the break values for the different R.N.G.'s, we choose the best (largest)
* one we can and set things up for it. srandom() is then called to
* initialize the state information.
*
* Note that on return from srandom(), we set state[-1] to be the type
* multiplexed with the current value of the rear pointer; this is so
* successive calls to initstate() won't lose this information and will be
* able to restart with setstate().
*
* Note: the first thing we do is save the current state, if any, just like
* setstate() so that it doesn't matter when initstate is called.
*
* Returns a pointer to the old state.
*
* Note: The Sparc platform requires that arg_state begin on a long
* word boundary; otherwise a bus error will occur. Even so, lint will
* complain about mis-alignment, but you should disregard these messages.
*/
char *
initstate(
unsigned long seed, /* seed for R.N.G. */
char *arg_state, /* pointer to state array */
long n /* # bytes of state info */
)
{
register char *ostate = (char *)(&state[-1]);
register long *long_arg_state = (long *) arg_state;
if (rand_type == TYPE_0)
state[-1] = rand_type;
else
state[-1] = MAX_TYPES * (rptr - state) + rand_type;
if (n < BREAK_0) {
(void)fprintf(stderr,
"random: not enough state (%ld bytes); ignored.\n", n);
return(0);
}
if (n < BREAK_1) {
rand_type = TYPE_0;
rand_deg = DEG_0;
rand_sep = SEP_0;
} else if (n < BREAK_2) {
rand_type = TYPE_1;
rand_deg = DEG_1;
rand_sep = SEP_1;
} else if (n < BREAK_3) {
rand_type = TYPE_2;
rand_deg = DEG_2;
rand_sep = SEP_2;
} else if (n < BREAK_4) {
rand_type = TYPE_3;
rand_deg = DEG_3;
rand_sep = SEP_3;
} else {
rand_type = TYPE_4;
rand_deg = DEG_4;
rand_sep = SEP_4;
}
state = (long *) (long_arg_state + 1); /* first location */
end_ptr = &state[rand_deg]; /* must set end_ptr before srandom */
srandom(seed);
if (rand_type == TYPE_0)
long_arg_state[0] = rand_type;
else
long_arg_state[0] = MAX_TYPES * (rptr - state) + rand_type;
return(ostate);
}
/*
* setstate:
*
* Restore the state from the given state array.
*
* Note: it is important that we also remember the locations of the pointers
* in the current state information, and restore the locations of the pointers
* from the old state information. This is done by multiplexing the pointer
* location into the zeroeth word of the state information.
*
* Note that due to the order in which things are done, it is OK to call
* setstate() with the same state as the current state.
*
* Returns a pointer to the old state information.
*
* Note: The Sparc platform requires that arg_state begin on a long
* word boundary; otherwise a bus error will occur. Even so, lint will
* complain about mis-alignment, but you should disregard these messages.
*/
char *
setstate(
char *arg_state /* pointer to state array */
)
{
register long *new_state = (long *) arg_state;
register long type = new_state[0] % MAX_TYPES;
register long rear = new_state[0] / MAX_TYPES;
char *ostate = (char *)(&state[-1]);
if (rand_type == TYPE_0)
state[-1] = rand_type;
else
state[-1] = MAX_TYPES * (rptr - state) + rand_type;
switch(type) {
case TYPE_0:
case TYPE_1:
case TYPE_2:
case TYPE_3:
case TYPE_4:
rand_type = type;
rand_deg = degrees[type];
rand_sep = seps[type];
break;
default:
(void)fprintf(stderr,
"random: state info corrupted; not changed.\n");
}
state = (long *) (new_state + 1);
if (rand_type != TYPE_0) {
rptr = &state[rear];
fptr = &state[(rear + rand_sep) % rand_deg];
}
end_ptr = &state[rand_deg]; /* set end_ptr too */
return(ostate);
}
/*
* random:
*
* If we are using the trivial TYPE_0 R.N.G., just do the old linear
* congruential bit. Otherwise, we do our fancy trinomial stuff, which is
* the same in all the other cases due to all the global variables that have
* been set up. The basic operation is to add the number at the rear pointer
* into the one at the front pointer. Then both pointers are advanced to
* the next location cyclically in the table. The value returned is the sum
* generated, reduced to 31 bits by throwing away the "least random" low bit.
*
* Note: the code takes advantage of the fact that both the front and
* rear pointers can't wrap on the same call by not testing the rear
* pointer if the front one has wrapped.
*
* Returns a 31-bit random number.
*/
long
random( void )
{
register long i;
register long *f, *r;
if (rand_type == TYPE_0) {
i = state[0];
state[0] = i = (good_rand(i)) & 0x7fffffff;
} else {
/*
* Use local variables rather than static variables for speed.
*/
f = fptr; r = rptr;
*f += *r;
i = (*f >> 1) & 0x7fffffff; /* chucking least random bit */
if (++f >= end_ptr) {
f = state;
++r;
}
else if (++r >= end_ptr) {
r = state;
}
fptr = f; rptr = r;
}
return(i);
}
-55
View File
@@ -1,55 +0,0 @@
#include <config.h>
#include <sys/types.h>
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <stdio.h>
#ifdef __STDC__
int snprintf(char *str, size_t n, const char *fmt, ...)
#else
int snprintf(str, n, fmt, va_alist)
char *str;
size_t n;
const char *fmt;
va_dcl
#endif
{
va_list ap;
int rval;
#ifdef VSPRINTF_CHARSTAR
char *rp;
#endif
#ifdef __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
#ifdef VSPRINTF_CHARSTAR
rp = vsprintf(str, fmt, ap);
va_end(ap);
return (strlen(rp));
#else
rval = vsprintf(str, fmt, ap);
va_end(ap);
return (rval);
#endif
}
int
vsnprintf(str, n, fmt, ap)
char *str;
size_t n;
const char *fmt;
va_list ap;
{
#ifdef VSPRINTF_CHARSTAR
return (strlen(vsprintf(str, fmt, ap)));
#else
return (vsprintf(str, fmt, ap));
#endif
}
-20
View File
@@ -1,20 +0,0 @@
#define NULL 0
char *
strdup(
const char *s
)
{
char *cp;
if (s) {
cp = (char *) malloc((unsigned) (strlen(s)+1));
if (cp) {
(void) strcpy(cp, s);
}
} else {
cp = (char *) NULL;
}
return(cp);
}
-69
View File
@@ -1,69 +0,0 @@
#! /bin/sh
#
# (hacked from egcs_update and pikt_update)
#
# Update a local CVS tree from the NTP repository, with an emphasis
# on treating generated files correctly, so that autoconf, bison et
# al are not required for the ``end'' user.
#
# By default all command-line options are passed to `cvs update` in
# addition to $UPDATE_OPTIONS (defined below). If the first parameter
# reads --nostdflags, $UPDATE_OPTIONS as well as this parameter itself
# are omitted.
#
# Examples:
#
# ntp_update -r ntp_latest_snapshot
# ntp_update -A
# ntp_update --nostdflags -P -r ntp_1_1_branch foo/bar
#
#
# (C) 1998 Free Software Foundation
# Originally by Gerald Pfeifer <[email protected]>, August 1998.
#
# This script is Free Software, and it can be copied, distributed and
# modified as defined in the GNU General Public License. A copy of
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html
UPDATE_OPTIONS="-P -d"
# Add -d to create any directories that exist in the repository but not
# locally.
# Add -A to reset any sticky tags, dates, or `-k' options.
echo "Current directory is `pwd`."
# First of all, check whether this indeed looks like a local CVS of ntp.
if [ ! -d CVS ] || [ ! -f ntpd/ntpd.c ]; then
echo "This does not seem to be an ntp CVS tree!"
exit
fi
# Check command-line options
if [ x"${1}"x = x"--nostdflags"x ]; then
shift
else
set -- $UPDATE_OPTIONS ${1+"$@"}
fi
echo "Pass 1: Updating autoconf and bison source files"
find . -name configure.in -o -name '*.y' -o -name copyright.htm | grep -v '^\./A\.'| xargs cvs -q update
echo "Pass 2: Updating full tree"
cvs -q update ${1+"$@"}
echo "Pass 3: Fixing local tree"
touch `find . -name aclocal.m4 -print`
touch `find . -name configure -print`
touch `find . -name Makefile.in -print`
#touch `find texinfo -name \*.pot -print`
#touch `find texinfo -name \*.gmo -print`
# The following code should also touch the generated lex/yacc/rpc files
for f in \
stamp-h.in \
COPYRIGHT
do
touch $f
done
-313
View File
@@ -1,313 +0,0 @@
/*
* cmd_args.c = command-line argument processing
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "ntpd.h"
#include "ntp_stdlib.h"
#include "ntp_cmdargs.h"
/*
* Definitions of things either imported from or exported to outside
*/
extern char const *progname;
int listen_to_virtual_ips = 0;
static const char *ntp_options = "aAbc:dD:f:gk:l:LmnN:p:P:qr:s:t:v:V:x";
#ifdef HAVE_NETINFO
extern int check_netinfo;
#endif
/*
* getstartup - search through the options looking for a debugging flag
*/
void
getstartup(
int argc,
char *argv[]
)
{
int errflg;
extern int priority_done;
int c;
#ifdef DEBUG
debug = 0; /* no debugging by default */
#endif
/*
* This is a big hack. We don't really want to read command line
* configuration until everything else is initialized, since
* the ability to configure the system may depend on storage
* and the like having been initialized. Except that we also
* don't want to initialize anything until after detaching from
* the terminal, but we won't know to do that until we've
* parsed the command line. Do that now, crudely, and do it
* again later. Our ntp_getopt() is explicitly reusable, by the
* way. Your own mileage may vary.
*
* This hack is even called twice (to allow complete logging to file)
*/
errflg = 0;
progname = argv[0];
/*
* Decode argument list
*/
while ((c = ntp_getopt(argc, argv, ntp_options)) != EOF)
switch (c) {
#ifdef DEBUG
case 'd':
++debug;
break;
case 'D':
debug = (int)atol(ntp_optarg);
printf("Debug1: %s -> %x = %d\n", ntp_optarg, debug, debug);
break;
#else
case 'd':
case 'D':
msyslog(LOG_ERR, "ntpd not compiled with -DDEBUG option - no DEBUG support");
fprintf(stderr, "ntpd not compiled with -DDEBUG option - no DEBUG support");
++errflg;
break;
#endif
case 'L':
listen_to_virtual_ips = 1;
break;
case 'l':
{
FILE *new_file;
new_file = fopen(ntp_optarg, "a");
if (new_file != NULL) {
NLOG(NLOG_SYSINFO)
msyslog(LOG_NOTICE, "logging to file %s", ntp_optarg);
if (syslog_file != NULL &&
fileno(syslog_file) != fileno(new_file))
(void)fclose(syslog_file);
syslog_file = new_file;
syslogit = 0;
}
else
msyslog(LOG_ERR,
"Cannot open log file %s",
ntp_optarg);
}
break;
case 'n':
case 'q':
++nofork;
break;
case 'N':
priority_done = strcmp(ntp_optarg, "high");
break;
case '?':
++errflg;
break;
default:
break;
}
if (errflg || ntp_optind != argc) {
(void) fprintf(stderr, "usage: %s [ -abdgmnqx ] [ -c config_file ] [ -e e_delay ]\n", progname);
(void) fprintf(stderr, "\t\t[ -f freq_file ] [ -k key_file ] [ -l log_file ]\n");
(void) fprintf(stderr, "\t\t[ -p pid_file ] [ -r broad_delay ] [ -s statdir ]\n");
(void) fprintf(stderr, "\t\t[ -t trust_key ] [ -v sys_var ] [ -V default_sysvar ]\n");
#if defined(HAVE_SCHED_SETSCHEDULER)
(void) fprintf(stderr, "\t\t[ -P fixed_process_priority ]\n");
#endif
exit(2);
}
ntp_optind = 0; /* reset ntp_optind to restart ntp_getopt */
#ifdef DEBUG
if (debug) {
#ifdef HAVE_SETVBUF
static char buf[BUFSIZ];
setvbuf(stdout, buf, _IOLBF, BUFSIZ);
#else
setlinebuf(stdout);
#endif
}
#endif
}
/*
* getCmdOpts - get command line options
*/
void
getCmdOpts(
int argc,
char *argv[]
)
{
extern char *config_file;
int errflg;
int c;
/*
* Initialize, initialize
*/
errflg = 0;
#ifdef DEBUG
debug = 0;
#endif /* DEBUG */
progname = argv[0];
/*
* Decode argument list
*/
while ((c = ntp_getopt(argc, argv, ntp_options)) != EOF) {
switch (c) {
case 'a':
proto_config(PROTO_AUTHENTICATE, 1, 0.);
break;
case 'A':
proto_config(PROTO_AUTHENTICATE, 0, 0.);
break;
case 'b':
proto_config(PROTO_BROADCLIENT, 1, 0.);
break;
case 'c':
config_file = ntp_optarg;
#ifdef HAVE_NETINFO
check_netinfo = 0;
#endif
break;
case 'd':
#ifdef DEBUG
debug++;
#else
errflg++;
#endif /* DEBUG */
break;
case 'D':
#ifdef DEBUG
debug = (int)atol(ntp_optarg);
printf("Debug2: %s -> %x = %d\n", ntp_optarg, debug, debug);
#else
errflg++;
#endif /* DEBUG */
break;
case 'f':
stats_config(STATS_FREQ_FILE, ntp_optarg);
break;
case 'g':
allow_panic = TRUE;
break;
case 'k':
getauthkeys(ntp_optarg);
break;
case 'L': /* already done at pre-scan */
case 'l': /* already done at pre-scan */
break;
case 'm':
proto_config(PROTO_MULTICAST_ADD, htonl(INADDR_NTP), 0.);
sys_bclient = 1;
break;
case 'n': /* already done at pre-scan */
break;
case 'N': /* already done at pre-scan */
break;
case 'p':
stats_config(STATS_PID_FILE, ntp_optarg);
break;
case 'P':
#if defined(HAVE_SCHED_SETSCHEDULER)
config_priority = (int)atol(ntp_optarg);
config_priority_override = 1;
#else
errflg++;
#endif
break;
case 'q':
mode_ntpdate = TRUE;
break;
case 'r':
do {
double tmp;
if (sscanf(ntp_optarg, "%lf", &tmp) != 1) {
msyslog(LOG_ERR,
"command line broadcast delay value %s undecodable",
ntp_optarg);
} else {
proto_config(PROTO_BROADDELAY, 0, tmp);
}
} while (0);
break;
case 's':
stats_config(STATS_STATSDIR, ntp_optarg);
break;
case 't':
do {
u_long tkey;
tkey = (int)atol(ntp_optarg);
if (tkey <= 0 || tkey > NTP_MAXKEY) {
msyslog(LOG_ERR,
"command line trusted key %s is invalid",
ntp_optarg);
} else {
authtrust(tkey, 1);
}
} while (0);
break;
case 'v':
case 'V':
set_sys_var(ntp_optarg, strlen(ntp_optarg)+1,
RW | ((c == 'V') ? DEF : 0));
break;
case 'x':
allow_step = FALSE;
break;
default:
errflg++;
break;
}
}
if (errflg || ntp_optind != argc) {
(void) fprintf(stderr, "usage: %s [ -abdgmnx ] [ -c config_file ] [ -e e_delay ]\n", progname);
(void) fprintf(stderr, "\t\t[ -f freq_file ] [ -k key_file ] [ -l log_file ]\n");
(void) fprintf(stderr, "\t\t[ -p pid_file ] [ -r broad_delay ] [ -s statdir ]\n");
(void) fprintf(stderr, "\t\t[ -t trust_key ] [ -v sys_var ] [ -V default_sysvar ]\n");
#if defined(HAVE_SCHED_SETSCHEDULER)
(void) fprintf(stderr, "\t\t[ -P fixed_process_priority ]\n");
#endif
exit(2);
}
return;
}
File diff suppressed because it is too large. Load diff
-987
View File
@@ -1,987 +0,0 @@
/*
** Ancestor was ripped off from ../ntpres/ntpres.c by Greg Troxel 4/2/92
**
** The previous resolver only needed to do forward lookups, and all names
** were known before we started the resolver process.
**
** The new code must be able to handle reverse lookups, and the requests can
** show up at any time.
**
** Here's the drill for the new logic.
**
** We want to be able to do forward or reverse lookups. Forward lookups
** require one set of information to be sent back to the daemon, reverse
** lookups require a different set of information. The caller knows this.
**
** The daemon must not block. This includes communicating with the resolver
** process (if the resolver process is a separate task).
**
** Current resolver code blocks waiting for the response, so the
** alternatives are:
**
** - Find a nonblocking resolver library
** - Do each (initial) lookup in a separate process
** - - subsequent lookups *could* be handled by a different process that has
** a queue of pending requests
**
** We could use nonblocking lookups in a separate process (just to help out
** with timers).
**
** If we don't have nonblocking resolver calls we have more opportunities
** for denial-of-service problems.
**
** - too many fork()s
** - communications path
**
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_request.h"
#include "ntp_stdlib.h"
#include "ntp_syslog.h"
#include <stdio.h>
#include <ctype.h>
#include <netdb.h>
#include <signal.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0)
/*
* Each item we are to resolve and configure gets one of these
* structures defined for it.
*/
struct dns_entry {
int de_done;
#define DE_NAME 001
#define DE_ADDR 002
#define DE_NA (DE_NAME | DE_ADDR)
#define DE_PENDING 000
#define DE_GOT 010
#define DE_FAIL 020
#define DE_RESULT (DE_PENDING | DE_GOT | DE_FAIL)
struct dns_entry *de_next;
struct info_dns_assoc de_info; /* DNS info for peer */
};
#define de_associd de_info.associd
#define de_peeraddr de_info.peeraddr
#define de_hostname de_info.hostname
/*
* dns_entries is a pointer to the list of configuration entries
* we have left to do.
*/
static struct dns_entry *dns_entries = NULL;
/*
* We take an interrupt every thirty seconds, at which time we decrement
* config_timer and resolve_timer. The former is set to 2, so we retry
* unsucessful reconfigurations every minute. The latter is set to
* an exponentially increasing value which starts at 2 and increases to
* 32. When this expires we retry failed name resolutions.
*
* We sleep SLEEPTIME seconds before doing anything, to give the server
* time to arrange itself.
*/
#define MINRESOLVE 2
#define MAXRESOLVE 32
#define CONFIG_TIME 2
#define ALARM_TIME 30
#define SLEEPTIME 2
static volatile int config_timer = 0;
static volatile int resolve_timer = 0;
static int resolve_value; /* next value of resolve timer */
/*
* Big hack attack
*/
#define LOCALHOST 0x7f000001 /* 127.0.0.1, in hex, of course */
#define SKEWTIME 0x08000000 /* 0.03125 seconds as a l_fp fraction */
/*
* Select time out. Set to 2 seconds. The server is on the local machine,
* after all.
*/
#define TIMEOUT_SEC 2
#define TIMEOUT_USEC 0
/*
* File descriptor for ntp request code.
*/
static int sockfd = -1;
/*
* Pipe descriptors
*/
int p_fd[2] = { -1, -1 };
/* stuff to be filled in by caller */
extern keyid_t req_keyid; /* request keyid */
/* end stuff to be filled in */
void ntp_res P((void));
static RETSIGTYPE bong P((int));
static void checkparent P((void));
static void removeentry P((struct dns_entry *));
static void addentry P((char *, u_int32, u_short));
static void findhostaddr P((struct dns_entry *));
static void openntp P((void));
static int tell_ntpd P((struct info_dns_assoc *));
static void doconfigure P((int));
struct ntp_res_t_pkt { /* Tagged packet: */
void *tag; /* For the caller */
u_int32 paddr; /* IP to look up, or 0 */
char name[NTP_MAXHOSTNAME]; /* Name to look up (if 1st byte is not 0) */
};
struct ntp_res_c_pkt { /* Control packet: */
char name[NTP_MAXHOSTNAME];
u_int32 paddr;
int mode;
int version;
int minpoll;
int maxpoll;
int flags;
int ttl;
keyid_t keyid;
u_char keystr[MAXFILENAME];
};
/*
* ntp_res_name
*/
void
ntp_res_name(
u_int32 paddr, /* Address to resolve */
u_short associd /* Association ID */
)
{
pid_t pid;
/*
* fork.
* - parent returns
* - child stuffs data and calls ntp_res()
*/
for (pid = -1; pid == -1;) {
#ifdef RES_TEST
pid = 0;
#else
pid = fork();
#endif
if (pid == -1) {
msyslog(LOG_ERR, "ntp_res_name: fork() failed: %m");
sleep(2);
}
}
switch (pid) {
case -1: /* Error */
msyslog(LOG_INFO, "ntp_res_name: error...");
/* Can't happen */
break;
case 0: /* Child */
closelog();
kill_asyncio();
(void) signal_no_reset(SIGCHLD, SIG_DFL);
#ifndef LOG_DAEMON
openlog("ntp_res", LOG_PID);
# else /* LOG_DAEMON */
# ifndef LOG_NTP
# define LOG_NTP LOG_DAEMON
# endif
openlog("ntp_res_name", LOG_PID | LOG_NDELAY, LOG_NTP);
#endif
addentry(NULL, paddr, associd);
ntp_res();
break;
default: /* Parent */
/* Nothing to do. (In Real Life, this never happens.) */
return;
}
}
/*
* ntp_res needs;
*
* req_key(???), req_keyid valid
* syslog still open
*/
void
ntp_res(void)
{
#ifdef HAVE_SIGSUSPEND
sigset_t set;
sigemptyset(&set);
#endif /* HAVE_SIGSUSPEND */
#ifdef DEBUG
if (debug) {
msyslog(LOG_INFO, "NTP_RESOLVER running");
}
#endif
/* check out auth stuff */
if (sys_authenticate) {
if (!authistrusted(req_keyid)) {
msyslog(LOG_ERR, "invalid request keyid %08x",
req_keyid );
exit(1);
}
}
/*
* Make a first cut at resolving the bunch
*/
doconfigure(1);
if (dns_entries == NULL) {
if (debug) {
msyslog(LOG_INFO, "NTP_RESOLVER done!");
}
#if defined SYS_WINNT
ExitThread(0); /* Don't want to kill whole NT process */
#else
exit(0); /* done that quick */
#endif
}
/*
* Here we've got some problem children. Set up the timer
* and wait for it.
*/
resolve_value = resolve_timer = MINRESOLVE;
config_timer = CONFIG_TIME;
#ifndef SYS_WINNT
(void) signal_no_reset(SIGALRM, bong);
alarm(ALARM_TIME);
#endif /* SYS_WINNT */
for (;;) {
if (dns_entries == NULL)
exit(0);
checkparent();
if (resolve_timer == 0) {
if (resolve_value < MAXRESOLVE)
resolve_value <<= 1;
resolve_timer = resolve_value;
#ifdef DEBUG
msyslog(LOG_INFO, "resolve_timer: 0->%d", resolve_timer);
#endif
config_timer = CONFIG_TIME;
doconfigure(1);
continue;
} else if (config_timer == 0) {
config_timer = CONFIG_TIME;
#ifdef DEBUG
msyslog(LOG_INFO, "config_timer: 0->%d", config_timer);
#endif
doconfigure(0);
continue;
}
#ifndef SYS_WINNT
/*
* There is a race in here. Is okay, though, since
* all it does is delay things by 30 seconds.
*/
# ifdef HAVE_SIGSUSPEND
sigsuspend(&set);
# else
sigpause(0);
# endif /* HAVE_SIGSUSPEND */
#else
if (config_timer > 0)
config_timer--;
if (resolve_timer > 0)
resolve_timer--;
sleep(ALARM_TIME);
#endif /* SYS_WINNT */
}
}
#ifndef SYS_WINNT
/*
* bong - service and reschedule an alarm() interrupt
*/
static RETSIGTYPE
bong(
int sig
)
{
if (config_timer > 0)
config_timer--;
if (resolve_timer > 0)
resolve_timer--;
alarm(ALARM_TIME);
}
#endif /* SYS_WINNT */
/*
* checkparent - see if our parent process is still running
*
* No need to worry in the Windows NT environment whether the
* main thread is still running, because if it goes
* down it takes the whole process down with it (in
* which case we won't be running this thread either)
* Turn function into NOP;
*/
static void
checkparent(void)
{
#if !defined (SYS_WINNT) && !defined (SYS_VXWORKS)
/*
* If our parent (the server) has died we will have been
* inherited by init. If so, exit.
*/
if (getppid() == 1) {
msyslog(LOG_INFO, "parent died before we finished, exiting");
exit(0);
}
#endif /* SYS_WINNT && SYS_VXWORKS*/
}
/*
* removeentry - we are done with an entry, remove it from the list
*/
static void
removeentry(
struct dns_entry *entry
)
{
register struct dns_entry *de;
de = dns_entries;
if (de == entry) {
dns_entries = de->de_next;
return;
}
while (de != NULL) {
if (de->de_next == entry) {
de->de_next = entry->de_next;
return;
}
de = de->de_next;
}
}
/*
* addentry - add an entry to the configuration list
*/
static void
addentry(
char *name,
u_int32 paddr,
u_short associd
)
{
register struct dns_entry *de;
#ifdef DEBUG
if (debug > 1) {
struct in_addr si;
si.s_addr = paddr;
msyslog(LOG_INFO,
"ntp_res_name: <%s> %s associd %d\n",
(name) ? name : "", inet_ntoa(si), associd);
}
#endif
de = (struct dns_entry *)emalloc(sizeof(struct dns_entry));
if (name) {
strncpy(de->de_hostname, name, sizeof de->de_hostname);
de->de_done = DE_PENDING | DE_ADDR;
} else {
de->de_hostname[0] = 0;
de->de_done = DE_PENDING | DE_NAME;
}
de->de_peeraddr = paddr;
de->de_associd = associd;
de->de_next = NULL;
if (dns_entries == NULL) {
dns_entries = de;
} else {
register struct dns_entry *dep;
for (dep = dns_entries; dep->de_next != NULL;
dep = dep->de_next)
/* nothing */;
dep->de_next = de;
}
}
/*
* findhostaddr - resolve a host name into an address (Or vice-versa)
*
* sets entry->de_done appropriately when we're finished. We're finished if
* we either successfully look up the missing name or address, or if we get a
* "permanent" failure on the lookup.
*
*/
static void
findhostaddr(
struct dns_entry *entry
)
{
struct hostent *hp;
checkparent(); /* make sure our guy is still running */
/*
* The following should never trip - this subroutine isn't
* called if hostname and peeraddr are "filled".
*/
if (entry->de_hostname[0] && entry->de_peeraddr) {
struct in_addr si;
si.s_addr = entry->de_peeraddr;
msyslog(LOG_ERR, "findhostaddr: both de_hostname and de_peeraddr are defined: <%s>/%s: state %#x",
&entry->de_hostname[0], inet_ntoa(si), entry->de_done);
return;
}
/*
* The following should never trip.
*/
if (!entry->de_hostname[0] && !entry->de_peeraddr) {
msyslog(LOG_ERR, "findhostaddr: both de_hostname and de_peeraddr are undefined!");
entry->de_done |= DE_FAIL;
return;
}
if (entry->de_hostname[0]) {
#ifdef DEBUG
if (debug > 2)
msyslog(LOG_INFO, "findhostaddr: Resolving <%s>",
&entry->de_hostname[0]);
#endif /* DEBUG */
hp = gethostbyname(&entry->de_hostname[0]);
} else {
#ifdef DEBUG
if (debug > 2) {
struct in_addr si;
si.s_addr = entry->de_peeraddr;
msyslog(LOG_INFO, "findhostaddr: Resolving %s",
inet_ntoa(si));
}
#endif
hp = gethostbyaddr((const char *)&entry->de_peeraddr,
sizeof entry->de_peeraddr,
AF_INET);
}
if (hp == NULL) {
/*
* Bail if we should TRY_AGAIN.
* Otherwise, we have a permanent failure.
*/
if (h_errno == TRY_AGAIN)
return;
entry->de_done |= DE_FAIL;
} else {
entry->de_done |= DE_GOT;
}
if (entry->de_done & DE_GOT) {
switch (entry->de_done & DE_NA) {
case DE_NAME:
#ifdef DEBUG
if (debug > 2)
msyslog(LOG_INFO,
"findhostaddr: name resolved.");
#endif
/*
* Use the first address. We don't have any way to
* tell preferences and older gethostbyname()
* implementations only return one.
*/
memmove((char *)&(entry->de_peeraddr),
(char *)hp->h_addr,
sizeof(struct in_addr));
break;
case DE_ADDR:
#ifdef DEBUG
if (debug > 2)
msyslog(LOG_INFO,
"findhostaddr: address resolved.");
#endif
strncpy(&entry->de_hostname[0], hp->h_name,
sizeof entry->de_hostname);
break;
default:
msyslog(LOG_ERR, "findhostaddr: Bogus de_done: %#x",
entry->de_done);
break;
}
} else {
#ifdef DEBUG
if (debug > 2) {
struct in_addr si;
const char *hes;
#ifndef HAVE_HSTRERROR
char hnum[20];
switch (h_errno) {
case HOST_NOT_FOUND:
hes = "Authoritive Answer Host not found";
break;
case TRY_AGAIN:
hes = "Non-Authoritative Host not found, or SERVERFAIL";
break;
case NO_RECOVERY:
hes = "Non recoverable errors, FORMERR, REFUSED, NOTIMP";
break;
case NO_DATA:
hes = "Valid name, no data record of requested type";
break;
default:
snprintf(hnum, sizeof hnum, "%d", h_errno);
hes = hnum;
break;
}
#else
hes = hstrerror(h_errno);
#endif
si.s_addr = entry->de_peeraddr;
msyslog(LOG_INFO,
"findhostaddr: Failed resolution on <%s>/%s: %s",
entry->de_hostname, inet_ntoa(si), hes);
}
#endif
/* Send a NAK message back to the daemon */
}
return;
}
/*
* openntp - open a socket to the ntp server
*/
static void
openntp(void)
{
struct sockaddr_in saddr;
if (sockfd >= 0)
return;
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
if (sockfd == -1) {
msyslog(LOG_ERR, "socket() failed: %m");
exit(1);
}
memset((char *)&saddr, 0, sizeof(saddr));
saddr.sin_family = AF_INET;
saddr.sin_port = htons(NTP_PORT); /* trash */
saddr.sin_addr.s_addr = htonl(LOCALHOST); /* garbage */
/*
* Make the socket non-blocking. We'll wait with select()
*/
#ifndef SYS_WINNT
# if defined(O_NONBLOCK)
if (fcntl(sockfd, F_SETFL, O_NONBLOCK) == -1) {
msyslog(LOG_ERR, "fcntl(O_NONBLOCK) failed: %m");
exit(1);
}
# else
# if defined(FNDELAY)
if (fcntl(sockfd, F_SETFL, FNDELAY) == -1) {
msyslog(LOG_ERR, "fcntl(FNDELAY) failed: %m");
exit(1);
}
# else
# include "Bletch: NEED NON BLOCKING IO"
# endif /* FNDDELAY */
# endif /* O_NONBLOCK */
#else /* SYS_WINNT */
{
int on = 1;
if (ioctlsocket(sockfd,FIONBIO,(u_long *) &on) == SOCKET_ERROR) {
msyslog(LOG_ERR, "ioctlsocket(FIONBIO) fails: %m");
exit(1); /* Windows NT - set socket in non-blocking mode */
}
}
#endif /* SYS_WINNT */
if (connect(sockfd, (struct sockaddr *)&saddr, sizeof(saddr)) == -1) {
msyslog(LOG_ERR, "openntp: connect() failed: %m");
exit(1);
}
}
/*
* tell_ntpd: Tell ntpd what we discovered.
*/
static int
tell_ntpd(
struct info_dns_assoc *conf
)
{
fd_set fdset;
struct timeval tvout;
struct req_pkt reqpkt;
l_fp ts;
int n;
#ifdef SYS_WINNT
HANDLE hReadWriteEvent = NULL;
BOOL ret;
DWORD NumberOfBytesWritten, NumberOfBytesRead, dwWait;
OVERLAPPED overlap;
#endif /* SYS_WINNT */
checkparent(); /* make sure our guy is still running */
if (sockfd < 0)
openntp();
#ifdef SYS_WINNT
hReadWriteEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
#endif /* SYS_WINNT */
/*
* Try to clear out any previously received traffic so it
* doesn't fool us. Note the socket is nonblocking.
*/
tvout.tv_sec = 0;
tvout.tv_usec = 0;
FD_ZERO(&fdset);
FD_SET(sockfd, &fdset);
while (select(sockfd + 1, &fdset, (fd_set *)0, (fd_set *)0, &tvout) >
0) {
recv(sockfd, (char *)&reqpkt, REQ_LEN_MAC, 0);
FD_ZERO(&fdset);
FD_SET(sockfd, &fdset);
}
/*
* Make up a request packet with the configuration info
*/
memset((char *)&reqpkt, 0, sizeof(reqpkt));
reqpkt.rm_vn_mode = RM_VN_MODE(0, 0, 0);
reqpkt.auth_seq = AUTH_SEQ(1, 0); /* authenticated, no seq */
reqpkt.implementation = IMPL_XNTPD; /* local implementation */
reqpkt.request = REQ_HOSTNAME_ASSOCID; /* Hostname for associd */
reqpkt.err_nitems = ERR_NITEMS(0, 1); /* one item */
reqpkt.mbz_itemsize = MBZ_ITEMSIZE(sizeof(struct info_dns_assoc));
memmove(reqpkt.data, (char *)conf, sizeof(struct info_dns_assoc));
reqpkt.keyid = htonl(req_keyid);
get_systime(&ts);
L_ADDUF(&ts, SKEWTIME);
HTONL_FP(&ts, &reqpkt.tstamp);
n = 0;
if (sys_authenticate)
n = authencrypt(req_keyid, (u_int32 *)&reqpkt, REQ_LEN_NOMAC);
/*
* Done. Send it.
*/
#ifndef SYS_WINNT
n = send(sockfd, (char *)&reqpkt, (unsigned)(REQ_LEN_NOMAC + n), 0);
if (n < 0) {
msyslog(LOG_ERR, "send to NTP server failed: %m");
return 0; /* maybe should exit */
}
#else
/* In the NT world, documentation seems to indicate that there
* exist _write and _read routines that can be used to do blocking
* I/O on sockets. Problem is these routines require a socket
* handle obtained through the _open_osf_handle C run-time API
* of which there is no explanation in the documentation. We need
* nonblocking write's and read's anyway for our purpose here.
* We're therefore forced to deviate a little bit from the Unix
* model here and use the ReadFile and WriteFile Win32 I/O API's
* on the socket
*/
overlap.Offset = overlap.OffsetHigh = (DWORD)0;
overlap.hEvent = hReadWriteEvent;
ret = WriteFile((HANDLE)sockfd, (char *)&reqpkt, REQ_LEN_NOMAC + n,
(LPDWORD)&NumberOfBytesWritten, (LPOVERLAPPED)&overlap);
if ((ret == FALSE) && (GetLastError() != ERROR_IO_PENDING)) {
msyslog(LOG_ERR, "send to NTP server failed: %m");
return 0;
}
dwWait = WaitForSingleObject(hReadWriteEvent, (DWORD) TIMEOUT_SEC * 1000);
if ((dwWait == WAIT_FAILED) || (dwWait == WAIT_TIMEOUT)) {
if (dwWait == WAIT_FAILED)
msyslog(LOG_ERR, "WaitForSingleObject failed: %m");
return 0;
}
#endif /* SYS_WINNT */
/*
* Wait for a response. A weakness of the mode 7 protocol used
* is that there is no way to associate a response with a
* particular request, i.e. the response to this configuration
* request is indistinguishable from that to any other. I should
* fix this some day. In any event, the time out is fairly
* pessimistic to make sure that if an answer is coming back
* at all, we get it.
*/
for (;;) {
FD_ZERO(&fdset);
FD_SET(sockfd, &fdset);
tvout.tv_sec = TIMEOUT_SEC;
tvout.tv_usec = TIMEOUT_USEC;
n = select(sockfd + 1, &fdset, (fd_set *)0,
(fd_set *)0, &tvout);
if (n < 0)
{
msyslog(LOG_ERR, "select() fails: %m");
return 0;
}
else if (n == 0)
{
if(debug)
msyslog(LOG_INFO, "select() returned 0.");
return 0;
}
#ifndef SYS_WINNT
n = recv(sockfd, (char *)&reqpkt, REQ_LEN_MAC, 0);
if (n <= 0) {
if (n < 0) {
msyslog(LOG_ERR, "recv() fails: %m");
return 0;
}
continue;
}
#else /* Overlapped I/O used on non-blocking sockets on Windows NT */
ret = ReadFile((HANDLE)sockfd, (char *)&reqpkt, (DWORD)REQ_LEN_MAC,
(LPDWORD)&NumberOfBytesRead, (LPOVERLAPPED)&overlap);
if ((ret == FALSE) && (GetLastError() != ERROR_IO_PENDING)) {
msyslog(LOG_ERR, "ReadFile() fails: %m");
return 0;
}
dwWait = WaitForSingleObject(hReadWriteEvent, (DWORD) TIMEOUT_SEC * 1000);
if ((dwWait == WAIT_FAILED) || (dwWait == WAIT_TIMEOUT)) {
if (dwWait == WAIT_FAILED) {
msyslog(LOG_ERR, "WaitForSingleObject fails: %m");
return 0;
}
continue;
}
n = NumberOfBytesRead;
#endif /* SYS_WINNT */
/*
* Got one. Check through to make sure it is what
* we expect.
*/
if (n < RESP_HEADER_SIZE) {
msyslog(LOG_ERR, "received runt response (%d octets)",
n);
continue;
}
if (!ISRESPONSE(reqpkt.rm_vn_mode)) {
#ifdef DEBUG
if (debug > 1)
msyslog(LOG_INFO, "received non-response packet");
#endif
continue;
}
if (ISMORE(reqpkt.rm_vn_mode)) {
#ifdef DEBUG
if (debug > 1)
msyslog(LOG_INFO, "received fragmented packet");
#endif
continue;
}
if ( ( (INFO_VERSION(reqpkt.rm_vn_mode) < 2)
|| (INFO_VERSION(reqpkt.rm_vn_mode) > NTP_VERSION))
|| INFO_MODE(reqpkt.rm_vn_mode) != MODE_PRIVATE) {
#ifdef DEBUG
if (debug > 1)
msyslog(LOG_INFO,
"version (%d/%d) or mode (%d/%d) incorrect",
INFO_VERSION(reqpkt.rm_vn_mode),
NTP_VERSION,
INFO_MODE(reqpkt.rm_vn_mode),
MODE_PRIVATE);
#endif
continue;
}
if (INFO_SEQ(reqpkt.auth_seq) != 0) {
#ifdef DEBUG
if (debug > 1)
msyslog(LOG_INFO,
"nonzero sequence number (%d)",
INFO_SEQ(reqpkt.auth_seq));
#endif
continue;
}
if (reqpkt.implementation != IMPL_XNTPD ||
reqpkt.request != REQ_HOSTNAME_ASSOCID) {
#ifdef DEBUG
if (debug > 1)
msyslog(LOG_INFO,
"implementation (%d/%d) or request (%d/%d) incorrect",
reqpkt.implementation, IMPL_XNTPD,
reqpkt.request, REQ_HOSTNAME_ASSOCID);
#endif
continue;
}
if (INFO_NITEMS(reqpkt.err_nitems) != 0 ||
INFO_MBZ(reqpkt.mbz_itemsize) != 0 ||
INFO_ITEMSIZE(reqpkt.mbz_itemsize) != 0) {
#ifdef DEBUG
if (debug > 1)
msyslog(LOG_INFO,
"nitems (%d) mbz (%d) or itemsize (%d) nonzero",
INFO_NITEMS(reqpkt.err_nitems),
INFO_MBZ(reqpkt.mbz_itemsize),
INFO_ITEMSIZE(reqpkt.mbz_itemsize));
#endif
continue;
}
n = INFO_ERR(reqpkt.err_nitems);
switch (n) {
case INFO_OKAY:
/* success */
return 1;
case INFO_ERR_IMPL:
msyslog(LOG_ERR,
"server reports implementation mismatch!!");
return 0;
case INFO_ERR_REQ:
msyslog(LOG_ERR,
"server claims configuration request is unknown");
return 0;
case INFO_ERR_FMT:
msyslog(LOG_ERR,
"server indicates a format error occurred(!!)");
return 0;
case INFO_ERR_NODATA:
msyslog(LOG_ERR,
"server indicates no data available (shouldn't happen)");
return 0;
case INFO_ERR_AUTH:
msyslog(LOG_ERR,
"server returns a permission denied error");
return 0;
default:
msyslog(LOG_ERR,
"server returns unknown error code %d", n);
return 0;
}
}
}
/*
* doconfigure - attempt to resolve names/addresses
*/
static void
doconfigure(
int dores
)
{
register struct dns_entry *de;
register struct dns_entry *deremove;
char *done_msg = "";
de = dns_entries;
while (de != NULL) {
#ifdef DEBUG
if (debug > 1) {
struct in_addr si;
si.s_addr = de->de_peeraddr;
msyslog(LOG_INFO,
"doconfigure: name: <%s> peeraddr: %s",
de->de_hostname, inet_ntoa(si));
}
#endif
if (dores && (de->de_hostname[0] == 0 || de->de_peeraddr == 0)) {
findhostaddr(de);
}
switch (de->de_done & DE_RESULT) {
case DE_PENDING:
done_msg = "";
break;
case DE_GOT:
done_msg = "succeeded";
break;
case DE_FAIL:
done_msg = "failed";
break;
default:
done_msg = "(error - shouldn't happen)";
break;
}
if (done_msg[0]) {
/* Send the answer */
if (tell_ntpd(&de->de_info)) {
struct in_addr si;
si.s_addr = de->de_peeraddr;
#ifdef DEBUG
if (debug > 1) {
msyslog(LOG_INFO,
"DNS resolution on <%s>/%s %s",
de->de_hostname, inet_ntoa(si),
done_msg);
}
#endif
deremove = de;
de = deremove->de_next;
removeentry(deremove);
}
} else {
de = de->de_next;
}
}
}
-274
View File
@@ -1,274 +0,0 @@
/*
* refclock_hopfpci.c
*
* - clock driver for hopf 6039 PCI board (GPS or DCF77)
* Bernd Altmeier [email protected]
*
* latest source and further information can be found at:
* http://www.ATLSoft.de/ntp
*
* In order to run this driver you have to install and test
* the PCI-board driver for your system first.
*
* On Linux/UNIX
*
* The driver attempts to open the device /dev/hopf6039 .
* The device entry will be made by the installation process of
* the kernel module for the PCI-bus board. The driver sources
* belongs to the delivery equipment of the PCI-board.
*
* On Windows NT/2000
*
* The driver attempts to open the device by calling the function
* "OpenHopfDevice()". This function will be installed by the
* Device Driver for the PCI-bus board. The driver belongs to the
* delivery equipment of the PCI-board.
*
*
* Start 21.03.2000 Revision: 01.20
* changes 22.12.2000 Revision: 01.40 flag1 = 1 sync even if Quarz
*
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#if defined(REFCLOCK) && defined(CLOCK_HOPF_PCI)
#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"
#undef fileno
#include <ctype.h>
#undef fileno
#ifndef SYS_WINNT
# include <sys/ipc.h>
# include <assert.h>
# include <unistd.h>
# include <stdio.h>
# include "hopf6039.h"
#else
# include "hopf_PCI_io.h"
#endif
/*
* hopfpci interface definitions
*/
#define PRECISION (-10) /* precision assumed (1 ms) */
#define REFID "hopf" /* reference ID */
#define DESCRIPTION "hopf Elektronik PCI radio board"
#define NSAMPLES 3 /* stages of median filter */
#ifndef SYS_WINNT
# define DEVICE "/dev/hopf6039" /* device name inode*/
#else
# define DEVICE "hopf6039" /* device name WinNT */
#endif
#define LEWAPWAR 0x20 /* leap second warning bit */
#define HOPF_OPMODE 0xC0 /* operation mode mask */
#define HOPF_INVALID 0x00 /* no time code available */
#define HOPF_INTERNAL 0x40 /* internal clock */
#define HOPF_RADIO 0x80 /* radio clock */
#define HOPF_RADIOHP 0xC0 /* high precision radio clock */
/*
* hopfclock unit control structure.
*/
struct hopfclock_unit {
short unit; /* NTP refclock unit number */
char leap_status; /* leap second flag */
};
int fd; /* file descr. */
/*
* Function prototypes
*/
static int hopfpci_start (int, struct peer *);
static void hopfpci_shutdown (int, struct peer *);
static void hopfpci_poll (int unit, struct peer *);
/*
* Transfer vector
*/
struct refclock refclock_hopfpci = {
hopfpci_start, /* start up driver */
hopfpci_shutdown, /* shut down driver */
hopfpci_poll, /* transmit poll message */
noentry, /* not used */
noentry, /* initialize driver (not used) */
noentry, /* not used */
NOFLAGS /* not used */
};
/*
* hopfpci_start - attach to hopf PCI board 6039
*/
static int
hopfpci_start(
int unit,
struct peer *peer
)
{
struct refclockproc *pp;
struct hopfclock_unit *up;
/*
* Allocate and initialize unit structure
*/
up = (struct hopfclock_unit *) emalloc(sizeof(struct hopfclock_unit));
if (!(up)) {
msyslog(LOG_ERR, "hopfPCIClock(%d) emalloc: %m",unit);
#ifdef DEBUG
printf("hopfPCIClock(%d) emalloc\n",unit);
#endif
return (0);
}
memset((char *)up, 0, sizeof(struct hopfclock_unit));
#ifndef SYS_WINNT
fd = open(DEVICE,O_RDWR); /* try to open hopf clock device */
#else
if (!OpenHopfDevice()){
msyslog(LOG_ERR,"Start: %s unit: %d failed!",DEVICE,unit);
return (0);
}
#endif
pp = peer->procptr;
pp->io.clock_recv = noentry;
pp->io.srcclock = (caddr_t)peer;
pp->io.datalen = 0;
pp->io.fd = -1;
pp->unitptr = (caddr_t)up;
get_systime(&pp->lastrec);
/*
* Initialize miscellaneous peer variables
*/
if (pp->unitptr!=0) {
memcpy((char *)&pp->refid, REFID, 4);
peer->precision = PRECISION;
pp->clockdesc = DESCRIPTION;
up->leap_status = 0;
up->unit = (short) unit;
return (1);
}
else {
return 0;
}
}
/*
* hopfpci_shutdown - shut down the clock
*/
static void
hopfpci_shutdown(
int unit,
struct peer *peer
)
{
struct refclockproc *pp;
register struct hopfpciTime *up;
pp = peer->procptr;
up = (struct hopfpciTime *)pp->unitptr;
#ifndef SYS_WINNT
close(fd);
#else
CloseHopfDevice();
// UnmapViewOfFile (up);
#endif
}
/*
* hopfpci_poll - called by the transmit procedure
*/
static void
hopfpci_poll(
int unit,
struct peer *peer
)
{
struct refclockproc *pp;
register struct hopfpciTime *up;
HOPFTIME m_time;
pp = peer->procptr;
up = (struct hopfpciTime *)pp->unitptr;
#ifndef SYS_WINNT
ioctl(fd,HOPF_CLOCK_GET_UTC,&m_time);
#else
GetHopfSystemTime(&m_time);
#endif
pp->polls++;
pp->day = ymd2yd(m_time.wYear,m_time.wMonth,m_time.wDay);
pp->hour = m_time.wHour;
pp->minute = m_time.wMinute;
pp->second = m_time.wSecond;
pp->msec=m_time.wMilliseconds;
pp->usec=0;
if (m_time.wStatus & LEWAPWAR)
pp->leap = LEAP_ADDSECOND;
else
pp->leap = LEAP_NOWARNING;
sprintf(pp->a_lastcode,"ST: %02X T: %02d:%02d:%02d.%03d D: %02d.%02d.%04d",
m_time.wStatus, pp->hour, pp->minute, pp->second, pp->msec,
m_time.wDay, m_time.wMonth, m_time.wYear);
pp->lencode = strlen(pp->a_lastcode);
get_systime(&pp->lastrec);
/*
* If clock has no valid status then report error and exit
*/
if ((m_time.wStatus & HOPF_OPMODE) == HOPF_INVALID) { /* time ok? */
refclock_report(peer, CEVNT_BADTIME);
pp->leap = LEAP_NOTINSYNC;
return;
}
/*
* Test if time is running on internal quarz
* if CLK_FLAG1 is set, sychronize even if no radio operation
*/
if ((m_time.wStatus & HOPF_OPMODE) == HOPF_INTERNAL){
if ((pp->sloppyclockflag & CLK_FLAG1) == 0) {
refclock_report(peer, CEVNT_BADTIME);
pp->leap = LEAP_NOTINSYNC;
return;
}
}
if (!refclock_process(pp)) {
refclock_report(peer, CEVNT_BADTIME);
return;
}
refclock_receive(peer);
record_clock_stats(&peer->srcadr, pp->a_lastcode);
return;
}
#else
int refclock_hopfpci_bs;
#endif /* REFCLOCK */
-372
View File
@@ -1,372 +0,0 @@
/*
*
* refclock_hopfser.c
* - clock driver for hopf serial boards (GPS or DCF77)
*
* Date: 30.03.2000 Revision: 01.10
*
* latest source and further information can be found at:
* http://www.ATLSoft.de/ntp
*
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#if defined(REFCLOCK) && (defined(CLOCK_HOPF_SERIAL))
#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_control.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"
#if defined HAVE_SYS_MODEM_H
# include <sys/modem.h>
# define TIOCMSET MCSETA
# define TIOCMGET MCGETA
# define TIOCM_RTS MRTS
#endif
#ifdef HAVE_TERMIOS_H
# ifdef TERMIOS_NEEDS__SVID3
# define _SVID3
# endif
# include <termios.h>
# ifdef TERMIOS_NEEDS__SVID3
# undef _SVID3
# endif
#endif
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
/*
* clock definitions
*/
#define DESCRIPTION "hopf Elektronik serial clock" /* Long name */
#define PRECISION (-10) /* precision assumed (about 1 ms) */
#define REFID "hopf\0" /* reference ID */
/*
* I/O definitions
*/
#define DEVICE "/dev/hopfclock%d" /* device name and unit */
#define SPEED232 B9600 /* uart speed (9600 baud) */
#define STX 0x02
#define ETX 0x03
#define CR 0x0c
#define LF 0x0a
/* parse states */
#define REC_QUEUE_EMPTY 0
#define REC_QUEUE_FULL 1
#define HOPF_OPMODE 0x0C /* operation mode mask */
#define HOPF_INVALID 0x00 /* no time code available */
#define HOPF_INTERNAL 0x04 /* internal clock */
#define HOPF_RADIO 0x08 /* radio clock */
#define HOPF_RADIOHP 0x0C /* high precision radio clock */
/*
* hopfclock unit control structure.
*/
struct hopfclock_unit {
l_fp laststamp; /* last receive timestamp */
short unit; /* NTP refclock unit number */
u_long polled; /* flag to detect noreplies */
char leap_status; /* leap second flag */
int rpt_next;
};
/*
* Function prototypes
*/
static int hopfserial_start P((int, struct peer *));
static void hopfserial_shutdown P((int, struct peer *));
static void hopfserial_receive P((struct recvbuf *));
static void hopfserial_poll P((int, struct peer *));
/* static void hopfserial_io P((struct recvbuf *)); */
/*
* Transfer vector
*/
struct refclock refclock_hopfser = {
hopfserial_start, /* start up driver */
hopfserial_shutdown, /* shut down driver */
hopfserial_poll, /* transmit poll message */
noentry, /* not used */
noentry, /* initialize driver (not used) */
noentry, /* not used */
NOFLAGS /* not used */
};
/*
* hopfserial_start - open the devices and initialize data for processing
*/
static int
hopfserial_start (
int unit,
struct peer *peer
)
{
register struct hopfclock_unit *up;
struct refclockproc *pp;
int fd;
char gpsdev[20];
#ifdef SYS_WINNT
(void) sprintf(gpsdev, "COM%d:", unit);
#else
(void) sprintf(gpsdev, DEVICE, unit);
#endif
/* LDISC_STD, LDISC_RAW
* Open serial port. Use CLK line discipline, if available.
*/
fd = refclock_open(gpsdev, SPEED232, LDISC_CLK);
if (fd <= 0) {
#ifdef DEBUG
printf("hopfSerialClock(%d) start: open %s failed\n", unit, gpsdev);
#endif
return 0;
}
msyslog(LOG_NOTICE, "hopfSerialClock(%d) fd: %d dev: %s", unit, fd,
gpsdev);
/*
* Allocate and initialize unit structure
*/
up = (struct hopfclock_unit *) emalloc(sizeof(struct hopfclock_unit));
if (!(up)) {
msyslog(LOG_ERR, "hopfSerialClock(%d) emalloc: %m",unit);
#ifdef DEBUG
printf("hopfSerialClock(%d) emalloc\n",unit);
#endif
(void) close(fd);
return (0);
}
memset((char *)up, 0, sizeof(struct hopfclock_unit));
pp = peer->procptr;
pp->unitptr = (caddr_t)up;
pp->io.clock_recv = hopfserial_receive;
pp->io.srcclock = (caddr_t)peer;
pp->io.datalen = 0;
pp->io.fd = fd;
if (!io_addclock(&pp->io)) {
#ifdef DEBUG
printf("hopfSerialClock(%d) io_addclock\n",unit);
#endif
(void) close(fd);
free(up);
return (0);
}
/*
* Initialize miscellaneous variables
*/
pp->clockdesc = DESCRIPTION;
peer->precision = PRECISION;
peer->burst = NSTAGE;
memcpy((char *)&pp->refid, REFID, 4);
up->leap_status = 0;
up->unit = (short) unit;
return (1);
}
/*
* hopfserial_shutdown - shut down the clock
*/
static void
hopfserial_shutdown (
int unit,
struct peer *peer
)
{
register struct hopfclock_unit *up;
struct refclockproc *pp;
pp = peer->procptr;
up = (struct hopfclock_unit *)pp->unitptr;
io_closeclock(&pp->io);
free(up);
}
/*
* hopfserial_receive - receive data from the serial interface
*/
static void
hopfserial_receive (
struct recvbuf *rbufp
)
{
struct hopfclock_unit *up;
struct refclockproc *pp;
struct peer *peer;
int sync; /* synchronization indicator */
int DoW; /* Dow */
int day, month; /* ddd conversion */
/*
* Initialize pointers and read the timecode and timestamp.
*/
peer = (struct peer *)rbufp->recv_srcclock;
pp = peer->procptr;
up = (struct hopfclock_unit *)pp->unitptr;
if (up->rpt_next == 0 )
return;
up->rpt_next = 0; /* wait until next poll interval occur */
pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &pp->lastrec);
if (pp->lencode == 0)
return;
sscanf(pp->a_lastcode,
#if 1
"%1x%1x%2d%2d%2d%2d%2d%2d", /* ...cr,lf */
#else
"%*c%1x%1x%2d%2d%2d%2d%2d%2d", /* stx...cr,lf,etx */
#endif
&sync,
&DoW,
&pp->hour,
&pp->minute,
&pp->second,
&day,
&month,
&pp->year);
/*
Validate received values at least enough to prevent internal
array-bounds problems, etc.
*/
if((pp->hour < 0) || (pp->hour > 23) ||
(pp->minute < 0) || (pp->minute > 59) ||
(pp->second < 0) || (pp->second > 60) /*Allow for leap seconds.*/ ||
(day < 1) || (day > 31) ||
(month < 1) || (month > 12) ||
(pp->year < 0) || (pp->year > 99)) {
/* Data out of range. */
refclock_report(peer, CEVNT_BADREPLY);
return;
}
/*
some preparations
*/
pp->day = ymd2yd(pp->year,month,day);
pp->leap=0;
/* Year-2000 check! */
/* wrap 2-digit date into 4-digit */
if(pp->year < YEAR_PIVOT) { pp->year += 100; } /* < 98 */
pp->year += 1900;
/* preparation for timecode ntpq rl command ! */
#if 0
wsprintf(pp->a_lastcode,
"STATUS: %1X%1X, DATE: %02d.%02d.%04d TIME: %02d:%02d:%02d",
sync,
DoW,
day,
month,
pp->year,
pp->hour,
pp->minute,
pp->second);
pp->lencode = strlen(pp->a_lastcode);
if ((sync && 0xc) == 0 ){ /* time ok? */
refclock_report(peer, CEVNT_BADTIME);
pp->leap = LEAP_NOTINSYNC;
return;
}
#endif
/*
* If clock has no valid status then report error and exit
*/
if ((sync & HOPF_OPMODE) == HOPF_INVALID ){ /* time ok? */
refclock_report(peer, CEVNT_BADTIME);
pp->leap = LEAP_NOTINSYNC;
return;
}
/*
* Test if time is running on internal quarz
* if CLK_FLAG1 is set, sychronize even if no radio operation
*/
if ((sync & HOPF_OPMODE) == HOPF_INTERNAL){
if ((pp->sloppyclockflag & CLK_FLAG1) == 0) {
refclock_report(peer, CEVNT_BADTIME);
pp->leap = LEAP_NOTINSYNC;
return;
}
}
if (!refclock_process(pp)) {
refclock_report(peer, CEVNT_BADTIME);
return;
}
refclock_receive(peer);
#if 0
msyslog(LOG_ERR, " D:%x D:%d D:%d",sync,pp->minute,pp->second);
#endif
record_clock_stats(&peer->srcadr, pp->a_lastcode);
return;
}
/*
* hopfserial_poll - called by the transmit procedure
*
*/
static void
hopfserial_poll (
int unit,
struct peer *peer
)
{
register struct hopfclock_unit *up;
struct refclockproc *pp;
pp = peer->procptr;
up = (struct hopfclock_unit *)pp->unitptr;
pp->polls++;
up->rpt_next = 1;
#if 0
record_clock_stats(&peer->srcadr, pp->a_lastcode);
#endif
return;
}
#else
int refclock_hopfser_bs;
#endif /* REFCLOCK */
-38
View File
@@ -1,38 +0,0 @@
#! @PATH_PERL@
#
# drift of 104.8576 -> +1 tick. Base of 10000 ticks.
#
# 970306 HMS Deal with nanoseconds. Fix sign of adjustments.
$df="/etc/ntp.drift";
# Assumes a 100Hz box with "tick" of 10000
# Someday, we might call "tickadj" for better values...
$base=10000; # tick: 1,000,000 / HZ
$cvt=104.8576; # 2 ** 20 / $base
$v1=0.;
$v2="";
if (open(DF, $df))
{
if ($_=<DF>)
{
($v1, $v2) = split;
}
while ($v1 < 0)
{
$v1 += $cvt;
$base--;
}
while ($v1 > $cvt)
{
$v1 -= $cvt;
$base++;
}
}
printf("%.3f (drift)\n", $v1);
printf("%d usec; %d nsec\n", $base, ($base + ($v1/$cvt)) * 1000);
-79
View File
@@ -1,79 +0,0 @@
#! @PATH_PERL@
#! @PATH_PERL@ -d
#
# This script compares the time of several machines with the
# time on the local host.
#
# Use or modify it as you wish.
#
# As the original author is only expecting 14 minutes of fame,
# leaving his name attached would be appreciated.
#
# R. Gary Cutbill <[email protected]>
# 21 April 1999
#
$tol=2.0;
$|=1;
print "Time Check";
open(HOSTS,"ypcat hosts.byaddr |"); # get a list of hosts from the yp server.
while ($line=<HOSTS>) { # loop for each host getting the offset compared to localhost
($addr,$host,$aliases)=split(/\s+/,$line,3);
$res=`/usr/local/bin/ntptrace -m 1 -r 1 -t 1 $host`;
print ".";
chop $res;
push (@results,$res);
}
print "\n";
#
# Sort the list of hosts, and print out there offsets
# from the local host.
#
@list=sort appropriately @results;
foreach $i ( @list ) {
@dargs=split(/\s+/,$i);
if ( $dargs[1] eq "\*Timeout\*" ) {
print "$i\n";
chop $dargs[0];
push(@down,$dargs[0]);
} else {
printf "%-25s %7s %3s %6s %10s %5s %8s %8s\n",@dargs;
if ( ( $dargs[4] > $tol ) || ( $dargs[4] < -$tol ) ) {
chop $dargs[0];
push(@toofarout,$dargs[0]); }
}
}
#
# When the above list finishes, hosts that are different by +/- $tol (two seconds)
# are in @toofarout. Hosts that are down are in @down. They are treated the same
# way here, but you might want to do something different depending on your site.
#
# print a set of suggested rsh commands to run on the hosts that
# don't have "good" time. "restartntp" is left as an excersize to the reader.
# I usually use it to kill a running xntpd, ntpdate some server, and the start xntp
# again.
#
print "\nConsider:\n";
foreach $i ( (@down,@toofarout) ) {
print " rsh $i sudo restartntp\n";
}
#
# sort the results from the list. First by stratum, then by time deviation
# Put hosts that didn't respond (timed out) on the bottom.
#
sub appropriately {
@af=split(/\s+/,$a);
@bf=split(/\s+/,$b);
$aba= ($af[4]<0)?-$af[4]:$af[4];
$abb= ($bf[4]<0)?-$bf[4]:$bf[4];
( $af[1] ne $bf[1] ) ? $bf[1] cmp $af[1] :
( ( $af[2] != $bf[2] ) ? ( $bf[2] <=> $af[2] ) :
( ( $aba != $abb ) ? ( $abb <=> $aba ) : ($af[0] cmp $bf[0] ) ) );
}
-97
View File
@@ -1,97 +0,0 @@
#! @PATH_PERL@ -w
die "perl5 needed\n" unless ($] > 5);
use Getopt::Std;
use vars qw($opt_n);
getopts('d:nt:');
#chop($ncpu = `sysctl -n hw.ncpu`);
#die "Found $ncpu CPUs; can only be run on systems with 1 CPU.\n" if ($ncpu > 1);
$driftfile = "/etc/ntp.drift";
$driftfile = $opt_d if defined($opt_d);
chop($timer = `sysctl -n kern.timecounter.hardware 2> /dev/null`);
$timer =~ tr/\U/\L/;
if ($timer eq '') {
open(DM, "/var/run/dmesg.boot");
while(<DM>) {
# Timecounter "i8254" frequency 1193182 Hz
if (/^Timecounter "(\w+)"\s+/) {
$timer = $1;
last;
}
}
close(DM);
}
$opt_t = $timer if !defined($opt_t);
if ($timer ne '') { # $timer found...
if ($opt_t ne '') { # - and $opt_t found
if ($timer ne $opt_t) { # - - and they differ
warn "You specified a $opt_t timer but I detected a $timer timer.\n";
usage();
exit 1;
} else { # - - and they are the same
;
}
} else { # - but no $opt_t specified; this is OK
;
}
} else { # No $timer found...
if ($opt_t ne '') { # - but $opt_t was specified
$timer = $opt_t; # - - so use it.
} else { # - and neither was $opt_t
warn "I can't tell what timer you have. Please specify one.\n";
usage();
exit 1;
}
}
open(DF, $driftfile) || die "Can't open driftfile ($driftfile): $!\n";
while(<DF>) {
chop;
if (/^(-?\d+\.\d+)(\s\d)?$/) {
$drift = $1;
} else {
die "Bogus value in driftfile $driftfile: <$_>\n";
}
}
close(DF);
print "NTP drift is <$drift>\n";
# Convert from NTP's idea of PPM to a decimal equivalent
$freq_adj = int ( $drift * ( 10 ** 6 / 2 ** 20) );
print "normalized freq_adj is <$freq_adj>\n";
$freq_adj = int ( ( $freq_adj - 1 ) / 2 );
print "Applying freq_adj of <".-$freq_adj.">\n";
$sysctl = "machdep.".$timer."_freq";
chop($mach_freq = `sysctl -n $sysctl`);
print "$sysctl is <$mach_freq>\n";
$n_mach_freq = $mach_freq - $freq_adj;
if (defined($opt_n)) {
print "$sysctl $mach_freq -> $n_mach_freq\n";
} else {
print "i8254: ".`sysctl -w $sysctl=$n_mach_freq`;
}
sub usage {
print STDERR <<EOUsage
Usage: $0 [-d drift_file] [-n] [-t timer]
where "drift_file" defaults to /etc/ntp.drift
and "timer" is usually "tsc" or "i8254"
and "-n" says "don't really change anything, just say what would happen".
EOUsage
}
-8
View File
@@ -1,8 +0,0 @@
#! /bin/sh
lynx -source http://www.eecis.udel.edu/~mills/ntp/clock2.htm |
sed -n -e 's,).*,,' -e' /([0-9.]*$/s/.*(//p' |
xargs ntpdate -q |
sort -n +7 > /tmp/ntp-close
# From: Neal McBurnett <[email protected]>
-42
View File
@@ -1,42 +0,0 @@
#! @PATH_PERL@ -w
die "perl5 needed\n" unless ($] > 5);
use Getopt::Std;
$opt_f = 0; # 'Hard' failure if 'state' is unknown
$opt_n = 1000; # How many tries before we give up? (10 min+)
$opt_s = 6; # Seconds to sleep between tries (6s = 10/min)
$opt_v = 0; # Be verbose?
getopts('fn:s:v');
$cmd = 'ntpq -c "rv 0 state"';
$| = 1; # Autoflush output.
print "Waiting for ntpd to synchronize... " if ($opt_v);
for ($i = 0; $i < $opt_n; ++$i) {
open(Q, $cmd." 2>&1 |") || die "Can't start ntpq: $!";
while(<Q>) {
if (/^state=4/) {
print "\bOK!\n" if ($opt_v);
exit 0;
}
if (/request variable was unknown/) {
print "\bCan't tell!\nPerhaps you are running an old version of ntpd.\n" if ($opt_v);
exit $opt_f;
}
if (/Connection refused/) {
print "\bntpd is not running!\n" if ($opt_v);
exit 1;
}
}
close(Q);
print "\b".substr("*+:.", $i % 4, 1) if ($opt_v);
sleep($opt_s);
}
print "\bNo!\nntpd did not synchronize.\n" if ($opt_v);
exit 1;
-301
View File
@@ -1,301 +0,0 @@
#! @PATH_PERL@ -w
#
# $Id: ntpsweep.in,v 1.1 2000/02/10 08:13:40 stenn Exp $
#
# DISCLAIMER
#
# Copyright (C) 1999,2000 Hans Lambermont and Origin B.V.
#
# Permission to use, copy, modify and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appears in all copies and
# that both the copyright notice and this permission notice appear in
# supporting documentation. This software is supported as is and without
# any express or implied warranties, including, without limitation, the
# implied warranties of merchantability and fitness for a particular
# purpose. The name Origin B.V. must not be used to endorse or promote
# products derived from this software without prior written permission.
#
# Hans Lambermont <[email protected]>/<[email protected]>
# 14 Jan 2000
require 5.0; # But actually tested on 5.004 ;)
use Getopt::Long; # GetOptions()
use strict;
my $version = 1.3;
(my $program = $0) =~ s%.*/(.+?)(.pl)?$%$1%;
# Hardcoded paths/program names
my $ntpdate = "ntpdate";
my $ntpq = "ntpq";
# no STDOUT buffering
$| = 1;
my ($help, $single_host, $showpeers, $maxlevel, $strip, $askversion);
my $res = GetOptions("help!" => \$help,
"host=s" => \$single_host,
"peers!" => \$showpeers,
"maxlevel=s" => \$maxlevel,
"strip=s" => \$strip,
"version!" => \$askversion);
if ($askversion) {
print("$version\n");
exit 0;
}
if ($help || ((@ARGV != 1) && !$single_host)) {
warn <<EOF;
This is $program, version $version
Copyright (C) 1999,2000 Hans Lambermont and Origin B.V. Disclaimer inside.
Usage:
$program [--help|--peers|--strip <string>|--maxlevel <level>|--version] \\
<file>|[--host <hostname>]
Description:
$program prints per host given in <file> the NTP stratum level, the
clock offset in seconds, the daemon version, the operating system and
the processor. Optionally recursing through all peers.
Options:
--help
Print this short help text and exit.
--version
Print version ($version) and exit.
<file>
Specify hosts file. File format is one hostname or ip number per line.
Lines beginning with # are considered as comment.
--host <hostname>
Speficy a single host, bypassing the need for a hosts file.
--peers
Recursively list all peers a host synchronizes to.
An '= ' before a peer means a loop. Recursion stops here.
--maxlevel <level>
Traverse peers up to this level (4 is a reasonable number).
--strip <string>
Strip <string> from hostnames.
Examples:
$program myhosts.txt --strip .foo.com
$program --host some.host --peers --maxlevel 4
EOF
exit 1;
}
my $hostsfile = shift;
my (@hosts, @known_hosts);
my (%known_host_info, %known_host_peers);
sub read_hosts()
{
local *HOSTS;
open (HOSTS, $hostsfile) ||
die "$program: FATAL: unable to read $hostsfile: $!\n";
while (<HOSTS>) {
next if /^\s*(#|$)/; # comment/empty
chomp;
push(@hosts, $_);
}
close(HOSTS);
}
# translate IP to hostname if possible
sub ip2name {
my($ip) = @_;
my($addr, $name, $aliases, $addrtype, $length, @addrs);
$addr = pack('C4', split(/\./, $ip));
($name, $aliases, $addrtype, $length, @addrs) = gethostbyaddr($addr, 2);
if ($name) {
# return lower case name
return("\L$name");
} else {
return($ip);
}
}
# item_in_list($item, @list): returns 1 if $item is in @list, 0 if not
sub item_in_list {
my($item, @list) = @_;
my($i);
foreach $i (@list) {
return 1 if ($item eq $i);
}
return 0;
}
sub scan_host($;$;$) {
my($host, $level, @trace) = @_;
my $stratum = 0;
my $offset = 0;
my $daemonversion = "";
my $system = "";
my $processor = "";
my @peers;
my $known_host = 0;
if (&item_in_list($host, @known_hosts)) {
$known_host = 1;
} else {
# ntpdate part
open(NTPDATE, "$ntpdate -bd $host 2>/dev/null |") ||
die "Cannot open ntpdate pipe: $!\n";
while (<NTPDATE>) {
/^stratum\s+(\d+).*$/ && do {
$stratum = $1;
};
/^offset\s+([0-9.-]+)$/ && do {
$offset = $1;
};
}
close(NTPDATE);
# got answers ? If so, go on.
if ($stratum) {
# ntpq part
my $ntpqparams = "-c 'rv 0 processor,system,daemon_version'";
open(NTPQ, "$ntpq $ntpqparams $host 2>/dev/null |") ||
die "Cannot open ntpq pipe: $!\n";
while (<NTPQ>) {
/daemon_version="(.*)"/ && do {
$daemonversion = $1;
};
/system="([^"]*)"/ && do {
$system = $1;
};
/processor="([^"]*)"/ && do {
$processor = $1;
};
}
close(NTPQ);
# Shorten daemon_version string.
$daemonversion =~ s/(;|Mon|Tue|Wed|Thu|Fri|Sat|Sun).*$//;
$daemonversion =~ s/version=//;
$daemonversion =~ s/(x|)ntpd //;
$daemonversion =~ s/(\(|\))//g;
$daemonversion =~ s/beta/b/;
$daemonversion =~ s/multicast/mc/;
# Shorten system string
$system =~ s/UNIX\///;
$system =~ s/RELEASE/r/;
$system =~ s/CURRENT/c/;
# Shorten processor string
$processor =~ s/unknown//;
}
# got answers ? If so, go on.
if ($daemonversion) {
# ntpq again, find out the peers this time
if ($showpeers) {
my $ntpqparams = "-pn";
open(NTPQ, "$ntpq $ntpqparams $host 2>/dev/null |") ||
die "Cannot open ntpq pipe: $!\n";
while (<NTPQ>) {
/^No association ID's returned$/ && do {
last;
};
/^ remote/ && do {
next;
};
/^==/ && do {
next;
};
/^( |x|\.|-|\+|#|\*|o)([^ ]+)/ && do {
push(@peers, ip2name($2));
next;
};
print "ERROR: $_";
}
close(NTPQ);
}
}
# Add scanned host to known_hosts array
push(@known_hosts, $host);
if ($stratum) {
$known_host_info{$host} = sprintf("%2d %9.3f %-11s %-12s %s",
$stratum, $offset, substr($daemonversion,0,11),
substr($system,0,12), substr($processor,0,9));
} else {
# Stratum level 0 is consider invalid
$known_host_info{$host} = sprintf(" ?");
}
$known_host_peers{$host} = [@peers];
}
if ($stratum || $known_host) { # Valid or known host
my $printhost = ' ' x $level . $host;
# Shorten host string
if ($strip) {
$printhost =~ s/$strip//;
}
# append number of peers in brackets if requested and valid
if ($showpeers && ($known_host_info{$host} ne " ?")) {
$printhost .= " (" . @{$known_host_peers{$host}} . ")";
}
# Finally print complete host line
printf("%-32s %s\n",
substr($printhost,0,32), $known_host_info{$host});
if ($showpeers && (eval($maxlevel ? $level < $maxlevel : 1))) {
my $peer;
push(@trace, $host);
# Loop through peers
foreach $peer (@{$known_host_peers{$host}}) {
if (&item_in_list($peer, @trace)) {
# we've detected a loop !
$printhost = ' ' x ($level + 1) . "= " . $peer;
# Shorten host string
if ($strip) {
$printhost =~ s/$strip//;
}
printf("%-32s %s\n",
substr($printhost,0,32));
} else {
if (substr($peer,0,3) ne "127") {
&scan_host($peer, $level + 1, @trace);
}
}
}
}
} else { # We did not get answers from this host
my $printhost = ' ' x $level . $host;
# Shorten host string
if ($strip) {
$printhost =~ s/$strip//;
}
printf("%-32s ?\n", substr($printhost,0,32));
}
}
sub scan_hosts()
{
my $host;
for $host (@hosts) {
my @trace;
push(@trace, $host);
scan_host($host, 0, @trace);
}
}
# Main program
if ($single_host) {
push(@hosts, $single_host);
} else {
&read_hosts($hostsfile);
}
# Print header
print <<EOF;
Host st offset(s) version system processor
--------------------------------+--+---------+-----------+------------+---------
EOF
&scan_hosts();
exit 0;
-337
View File
@@ -1,337 +0,0 @@
#! @PATH_PERL@ -w
# $Id: plot_summary.in,v 1.1 2000/02/10 08:13:40 stenn Exp $
#
# Use Gnuplot to display data in summary files produced by summary.pl.
# This script requires GNUPLOT 3.7!
#
# Copyright (c) 1997, 1999 by Ulrich Windl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
require 5.003; # "never tested with any other version of Perl"
use strict;
use Time::Local;
use Getopt::Long;
# parse command line
my $summary_dir = "/tmp";
my $identifier = "host " . `hostname`; # origin of these data
chomp $identifier; # remove newline
my $offset_limit = 0.128; # limit of absolute offset
my $output_file = ""; # output file defaults to stdout
my $output_file_number = 1; # numbering of output files
my $gnuplot_terminal = $ENV{DISPLAY} ? "x11" : "dumb";
my $wait_after_plot = 1;
my @peer_list = ();
my %options = ("directory|input-directory=s" => \$summary_dir,
"identifier=s" => \$identifier,
"offset-limit=f" => \$offset_limit,
"output-file=s" => \$output_file,
"peer=s@" => \@peer_list,
"plot-term|gnuplot-term=s" => \$gnuplot_terminal,
"wait-after-plot!" => \$wait_after_plot,
);
if ( !GetOptions(%options) )
{
print STDERR "valid options for $0 are:\n";
my $opt;
foreach $opt (sort(keys %options)) {
print STDERR "\t--$opt\t(default is ";
if ( ref($options{$opt}) eq "ARRAY" ) {
print STDERR join(", ", map { "'$_'" } @{$options{$opt}});
} else {
print STDERR "'${$options{$opt}}'";
}
print STDERR ")\n";
}
print STDERR "\n";
die;
}
chomp $identifier;
die "illegal offset-limit: $offset_limit" unless $offset_limit > 0.0;
$offset_limit *= 1e6; # scale to microseconds
# return the smallest value in the given list
sub min
{
my ($result, @rest) = @_;
map { $result = $_ if ($_ < $result) } @rest;
return($result);
}
# return the largest value in the given list
sub max
{
my ($result, @rest) = @_;
map { $result = $_ if ($_ > $result) } @rest;
return($result);
}
# maybe open alternate output file
sub open_output
{
my $file;
if ($output_file) {
while ( -r ($file = "$output_file$output_file_number") ) {
++$output_file_number;
}
open TOUCH, ">$file" and close TOUCH or die "$file: $!";
print "set output \"$file\"\n";
}
}
# make Gnuplot wait
sub maybe_add_pause
{
print "pause -1 \"Press key to continue...\"\n" if $wait_after_plot;
}
# plot data from loop summary
sub do_loop
{
my $fname = shift;
my $line;
my $out_file = "/tmp/tempdata$$";
my $cmd_file = "/tmp/tempcmd$$";
my ($first_day, $day_out) = ("", 0);
my ($lower_bound, $upper_bound, $rms);
my ($min_offs, $max_offs) = (1e9, -1e9);
my ($min_rms, $max_rms) = (1e9, -1e9);
open INPUT, "$fname" or die "$fname: $!";
open OUTPUT, ">$out_file" or die "$out_file: $!";
my @Fld;
while (<INPUT>) {
chop; # strip record separator
@Fld = split;
if ($#Fld == 0) {
# loops.19960405
$_ = $Fld[0]; s/.*([12]\d{3}[01]\d[0-3]\d)$/$1/;
m/(\d{4})(\d{2})(\d{2})/;
$line = timegm(59, 59, 23, $3, $2 - 1, $1 - 1900, 0, 0, 0);
$line = int $line / 86400; # days relative to 1970
$first_day = "$1-$2-$3 ($line)" unless $day_out;
next;
}
if ($#Fld != 8) {
warn "Illegal number of fields in file $fname, line $.";
next;
}
# loop 216, 856106+/-874041.5, rms 117239.8, freq 67.52+/-10.335, var 4.850
$_ = $Fld[1]; s/,/ /; $line .= " $_";
$_ = $Fld[2]; m:(.+?)\+/-(.+),:;
$lower_bound = $1 - $2;
$upper_bound = $1 + $2;
$line .= "$1 $lower_bound $upper_bound";
$min_offs = min($min_offs, $lower_bound);
$max_offs = max($max_offs, $upper_bound);
$_ = $Fld[4]; s/,/ /; $rms = $_;
$min_rms = min($min_rms, $rms);
$max_rms = max($max_rms, $rms);
$line .= " $rms";
$_ = $Fld[6]; m:(.+?)\+/-(.+),:;
$line .= " $1 " . ($1-$2) . " " . ($1+$2);
$line .= " $Fld[8]";
print OUTPUT "$line\n";
$day_out = 1;
# 9621 216 856106 -17935.5 1730147.5 117239.8 67.52 57.185 77.855 4.850
}
close INPUT;
close OUTPUT or die "close failed on $out_file: $!";
my $ylimit = "[";
if ($min_offs < -$offset_limit) {
$ylimit .= "-$offset_limit";
}
$ylimit .= ":";
if ($max_offs > $offset_limit) {
$ylimit .= "$offset_limit";
}
if ( $ylimit eq "[:" ) {
$ylimit = "";
} else {
$ylimit = "[] $ylimit]";
}
# build command file for GNUplot
open OUTPUT, "> $cmd_file" or die "$cmd_file: $!";
my $oldfh = select OUTPUT;
print "set term $gnuplot_terminal\n";
open_output;
print "set grid\n";
print "set title \"Loop Summary for $identifier: " .
"Daily mean values since $first_day\\n" .
"(Offset limit is $offset_limit microseconds)\"\n";
print "set ylabel \"[us]\"\n";
print "set data style yerrorbars\n";
print "set multiplot\n";
print "set size 1, 0.5\n";
print "set lmargin 8\n";
print "set origin 0, 0.5\n";
print "plot $ylimit \"$out_file\"" .
" using 1:3:4:5 title \"mean offset\", ";
print "\"$out_file\" using 1:(\$3-\$6/2) " .
"title \"(sigma low)\" with lines, ";
print "\"$out_file\" using 1:3 smooth bezier " .
"title \"(Bezier med)\" with lines, ";
print "\"$out_file\" using 1:(\$3+\$6/2) " .
"title \"(sigma high)\" with lines\n";
print "set ylabel \"[ppm]\"\n";
print "set origin 0, 0.0\n";
print "set title\n";
print "set xlabel \"Days relative to 1970\"\n";
print "plot \"$out_file\" using 1:7:8:9 title \"mean frequency\", ";
print "\"$out_file\" using 1:(\$7-\$10/2) " .
"title \"(sigma low)\" with lines, ";
print "\"$out_file\" using 1:7 smooth bezier " .
"title \"(Bezier med)\" with lines, ";
print "\"$out_file\" using 1:(\$7+\$10/2) " .
"title \"(sigma high)\" with lines\n";
print "set nomultiplot\n";
maybe_add_pause;
$ylimit = "[";
if ($min_rms < -$offset_limit) {
$ylimit .= "-$offset_limit";
}
$ylimit .= ":";
if ($max_rms > $offset_limit) {
$ylimit .= "$offset_limit";
}
if ( $ylimit eq "[:" ) {
$ylimit ="";
} else {
$ylimit = "[] $ylimit]";
}
open_output;
print "set title \"Loop Summary for $identifier: " .
"Standard deviation since $first_day\\n" .
"(Offset limit is $offset_limit microseconds)\"\n";
print "set xlabel\n";
print "set ylabel \"[us]\"\n";
print "set origin 0, 0.5\n";
print "set data style linespoints\n";
print "set multiplot\n";
print "plot $ylimit \"$out_file\" using 1:6 title \"Offset\", ";
print "\"$out_file\" using 1:6 smooth bezier " .
"title \"(Bezier)\" with lines\n";
print "set title\n";
print "set origin 0, 0.0\n";
print "set xlabel \"Days relative to 1970\"\n";
print "set ylabel \"[ppm]\"\n";
print "plot \"$out_file\" using 1:10 title \"Frequency\", ";
print "\"$out_file\" using 1:10 smooth bezier " .
"title \"(Bezier)\" with lines\n";
print "set nomultiplot\n";
maybe_add_pause;
close OUTPUT or die "close failed on $cmd_file: $!";
select $oldfh;
print `gnuplot $cmd_file`;
unlink $cmd_file;
unlink $out_file;
}
# plot data form peer summary
sub do_peer
{
my $fname = shift;
my $peer = shift;
my $out_file = "/tmp/tempdata$$";
my $cmd_file = "/tmp/tempcmd$$";
my $line;
my ($first_day, $day_out) = ("", 0);
open INPUT, "$fname" or die "$fname: $!";
open OUTPUT, ">$out_file" or die "$out_file: $!";
my @Fld;
while (<INPUT>) {
chop; # strip record separator
@Fld = split;
if ($#Fld == 0) {
# peers.19960405
$_ = $Fld[0]; s/.*([12]\d{3}[01]\d[0-3]\d)$/$1/;
m/(\d{4})(\d{2})(\d{2})/ or next;
$line = timegm(59, 59, 23, $3, $2 - 1, $1 - 1900, 0, 0, 0);
$line = int $line / 86400; # days relative to 1970
$first_day = "$1-$2-$3 ($line)" unless $day_out;
next;
}
if ($#Fld != 7) {
warn "Illegal number of fields in file $fname, line $.";
next;
}
next if ($Fld[0] ne $peer);
# ident cnt mean rms max delay dist disp
# 127.127.8.1 38 30.972 189.867 1154.607 0.000 879.760 111.037
$Fld[0] = $line;
print OUTPUT join(' ', @Fld) . "\n";
# 9969 38 30.972 189.867 1154.607 0.000 879.760 111.037
$day_out = 1;
}
close INPUT;
close OUTPUT or die "close failed on $out_file: $!";
die "no data found for peer $peer" if !$day_out;
open OUTPUT, "> $cmd_file" or die "$cmd_file: $!";
my $oldfh = select OUTPUT;
print "set term $gnuplot_terminal\n";
open_output;
print "set grid\n";
print "set multiplot\n";
print "set lmargin 8\n";
print "set size 1, 0.34\n";
print "set origin 0, 0.66\n";
print "set title " .
"\"Peer Summary for $peer on $identifier since $first_day\"\n";
print "set data style linespoints\n";
print "set ylabel \"[us]\"\n";
print "plot \"$out_file\" using 1:3 title \"mean offset\", ";
print "\"$out_file\" using 1:3 smooth bezier " .
"title \"(Bezier)\" with lines, ";
print "\"$out_file\" using 1:(\$3-\$7/2) " .
"title \"(sigma low)\" with lines, ";
print "\"$out_file\" using 1:(\$3+\$7/2) " .
"title \"(sigma high)\" with lines\n";
print "set title\n";
print "set origin 0, 0.34\n";
print "set size 1, 0.32\n";
print "set ylabel\n";
print "plot \"$out_file\" using 1:7 title \"dist\", ";
print "\"$out_file\" using 1:7 smooth bezier " .
"title \"(Bezier)\" with lines\n";
print "set origin 0, 0.00\n";
print "set size 1, 0.35\n";
print "set xlabel \"Days relative to 1970\"\n";
print "plot \"$out_file\" using 1:8 title \"disp\", ";
print "\"$out_file\" using 1:8 smooth bezier " .
"title \"(Bezier)\" with lines\n";
print "set nomultiplot\n";
maybe_add_pause;
select $oldfh;
close OUTPUT or die "close failed on $cmd_file: $!";
print `gnuplot $cmd_file`;
unlink $cmd_file;
unlink $out_file;
}
my $loop_summary ="$summary_dir/loop_summary";
my $peer_summary ="$summary_dir/peer_summary";
my $clock_summary="$summary_dir/clock_summary";
do_loop $loop_summary;
map { do_peer $peer_summary, $_ } @peer_list;
-373
View File
@@ -1,373 +0,0 @@
#! @PATH_PERL@ -w
# $Id: summary.in,v 1.1 2000/02/10 08:13:40 stenn Exp $
# Perl version of (summary.sh, loop.awk, peer.awk):
# Create summaries from xntpd's loop and peer statistics.
#
# Copyright (c) 1997, 1999 by Ulrich Windl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
require 5.003; # "never tested with any other version of Perl"
use strict;
use Getopt::Long;
my $log_date_pattern = '[12]\d{3}[01]\d[0-3]\d';
my $statsdir = "/var/log/ntp"; # directory with input files
my $outputdir = "/tmp"; # directory for output files
my $skip_time_steps = 3600.0; # ignore time offsets larger that this
my $startdate = "19700101"; # first data file to use (YYYYMMDD)
my $enddate=`date -u +%Y%m%d`; chomp $enddate; --$enddate;
my $peer_dist_limit = 400.0;
my %options = ("directory|input-directory=s" => \$statsdir,
"output-directory=s" => \$outputdir,
"skip-time-steps:f" => \$skip_time_steps,
"start-date=s" => \$startdate,
"end-date=s" => \$enddate,
"peer-dist-limit=f" => \$peer_dist_limit);
if ( !GetOptions(%options) )
{
print STDERR "valid options for $0 are:\n";
my $opt;
foreach $opt (sort(keys %options)) {
print STDERR "\t--$opt\t(default is ";
if ( ref($options{$opt}) eq "ARRAY" ) {
print STDERR join(", ", map { "'$_'" } @{$options{$opt}});
} else {
print STDERR "'${$options{$opt}}'";
}
print STDERR ")\n";
}
print STDERR "\n";
die;
}
# check possibly current values of options
die "$statsdir: no such directory" unless (-d $statsdir);
die "$outputdir: no such directory" unless (-d $outputdir);
die "$skip_time_steps: skip-time-steps must be positive"
unless ($skip_time_steps >= 0.0);
die "$startdate: invalid start date|$`|$&|$'"
unless ($startdate =~ m/.*$log_date_pattern$/);
die "$enddate: invalid end date"
unless ($enddate =~ m/.*$log_date_pattern$/);
$skip_time_steps = 0.128 if ($skip_time_steps == 0);
sub min
{
my ($result, @rest) = @_;
map { $result = $_ if ($_ < $result) } @rest;
return($result);
}
sub max
{
my ($result, @rest) = @_;
map { $result = $_ if ($_ > $result) } @rest;
return($result);
}
# calculate mean, range, and standard deviation for offset and frequency
sub do_loop
{
my ($directory, $fname, $out_file) = @_;
print "$directory/$fname\n";
open INPUT, "$directory/$fname" or warn "can't open $directory/$fname: $!";
open OUTPUT, ">>$out_file" or die "can't open $out_file: $!";
print OUTPUT "$fname\n";
my ($loop_tmax, $loop_fmax) = (-1e9, -1e9);
my ($loop_tmin, $loop_fmin) = (1e9, 1e9);
my ($loop_time_rms, $loop_freq_rms) = (0, 0);
my $loop_count = 0;
my $loop_time = 0;
my $loop_freq = 0;
my ($freq, $offs);
my @Fld;
while (<INPUT>) {
chop; # strip record separator
@Fld = split;
next if ($#Fld < 4);
#NTPv3: 50529 74356.259 -0.000112 16.1230 8
#NTPv3: day, sec.msec, offset, drift_comp, sys_poll
#NTPv4: 51333 54734.582 0.000001648 16.981964 0.000001094 0.020938 6
#NTPv4: day, sec.msec, offset, drift_comp, sys_error, clock_stabil, sys_poll
if ($Fld[2] > $skip_time_steps || $Fld[2] < -$skip_time_steps) {
warn "ignoring loop offset $Fld[2] (file $fname, line $.)\n";
next
}
$loop_count++;
($offs, $freq) = ($Fld[2], $Fld[3]);
$loop_tmax = max($loop_tmax, $offs);
$loop_tmin = min($loop_tmin, $offs);
$loop_fmax = max($loop_fmax, $freq);
$loop_fmin = min($loop_fmin, $freq);
$loop_time += $offs;
$loop_time_rms += $offs * $offs;
$loop_freq += $freq;
$loop_freq_rms += $freq * $freq;
}
close INPUT;
if ($loop_count > 1) {
$loop_time /= $loop_count;
$loop_time_rms = $loop_time_rms / $loop_count - $loop_time * $loop_time;
if ($loop_time_rms < 0) {
warn "loop_time_rms: $loop_time_rms < 0";
$loop_time_rms = 0;
}
$loop_time_rms = sqrt($loop_time_rms);
$loop_freq /= $loop_count;
$loop_freq_rms = $loop_freq_rms / $loop_count - $loop_freq * $loop_freq;
if ($loop_freq_rms < 0) {
warn "loop_freq_rms: $loop_freq_rms < 0";
$loop_freq_rms = 0;
}
$loop_freq_rms = sqrt($loop_freq_rms);
printf OUTPUT
("loop %d, %.0f+/-%.1f, rms %.1f, freq %.2f+/-%0.3f, var %.3f\n",
$loop_count, ($loop_tmax + $loop_tmin) / 2 * 1e6,
($loop_tmax - $loop_tmin) / 2 * 1e6, $loop_time_rms * 1e6,
($loop_fmax + $loop_fmin) / 2, ($loop_fmax - $loop_fmin) / 2,
$loop_freq_rms);
}
else {
warn "no valid lines in $directory/$fname";
}
close OUTPUT
}
# calculate mean, standard deviation, maximum offset, mean dispersion,
# and maximum distance for each peer
sub do_peer
{
my ($directory, $fname, $out_file) = @_;
print "$directory/$fname\n";
open INPUT, "$directory/$fname" or warn "can't open $directory/$fname: $!";
open OUTPUT, ">>$out_file" or die "can't open $out_file: $!";
print OUTPUT "$fname\n";
# we toss out all distances greater than one second on the assumption the
# peer is in initial acquisition
my ($n, $MAXDISTANCE) = (0, 1.0);
my %peer_time;
my %peer_time_rms;
my %peer_count;
my %peer_delay;
my %peer_disp;
my %peer_dist;
my %peer_ident;
my %peer_tmin;
my %peer_tmax;
my @Fld;
my ($i, $j);
my ($dist, $offs);
while (<INPUT>) {
chop; # strip record separator
@Fld = split;
next if ($#Fld < 6);
#NTPv3: 50529 83316.249 127.127.8.1 9674 0.008628 0.00000 0.00700
#NTPv3: day, sec.msec, addr, status, offset, delay, dispersion
#NTPv4: 51333 56042.037 127.127.8.1 94f5 -0.000014657 0.000000000 0.000000000 0.000013214
#NTPv4: day, sec.msec, addr, status, offset, delay, dispersion, skew
$dist = $Fld[6] + $Fld[5] / 2;
next if ($dist > $MAXDISTANCE);
$offs = $Fld[4];
if ($offs > $skip_time_steps || $offs < -$skip_time_steps) {
warn "ignoring peer offset $offs (file $fname, line $.)\n";
next
}
$i = $n;
for ($j = 0; $j < $n; $j++) {
if ($Fld[2] eq $peer_ident{$j}) {
$i = $j; # peer found
last;
}
}
if ($i == $n) { # add new peer
$peer_ident{$i} = $Fld[2];
$peer_tmax{$i} = $peer_dist{$i} = -1e9;
$peer_tmin{$i} = 1e9;
$peer_time{$i} = $peer_time_rms{$i} = 0;
$peer_delay{$i} = $peer_disp{$i} = 0;
$peer_count{$i} = 0;
$n++;
}
$peer_count{$i}++;
$peer_tmax{$i} = max($peer_tmax{$i}, $offs);
$peer_tmin{$i} = min($peer_tmin{$i}, $offs);
$peer_dist{$i} = max($peer_dist{$i}, $dist);
$peer_time{$i} += $offs;
$peer_time_rms{$i} += $offs * $offs;
$peer_delay{$i} += $Fld[5];
$peer_disp{$i} += $Fld[6];
}
close INPUT;
print OUTPUT
" ident cnt mean rms max delay dist disp\n";
print OUTPUT
"==========================================================================\n";
my @lines = ();
for ($i = 0; $i < $n; $i++) {
next if $peer_count{$i} < 2;
$peer_time{$i} /= $peer_count{$i};
eval { $peer_time_rms{$i} = sqrt($peer_time_rms{$i} / $peer_count{$i} -
$peer_time{$i} * $peer_time{$i}); };
$peer_time_rms{$i} = 0, warn $@ if $@;
$peer_delay{$i} /= $peer_count{$i};
$peer_disp{$i} /= $peer_count{$i};
$peer_tmax{$i} = $peer_tmax{$i} - $peer_time{$i};
$peer_tmin{$i} = $peer_time{$i} - $peer_tmin{$i};
if ($peer_tmin{$i} > $peer_tmax{$i}) { # can this happen at all?
$peer_tmax{$i} = $peer_tmin{$i};
}
push @lines, sprintf
"%-15s %4d %8.3f %8.3f %8.3f %8.3f %8.3f %8.3f\n",
$peer_ident{$i}, $peer_count{$i}, $peer_time{$i} * 1e3,
$peer_time_rms{$i} * 1e3, $peer_tmax{$i} * 1e3,
$peer_delay{$i} * 1e3, $peer_dist{$i} * 1e3, $peer_disp{$i} * 1e3;
}
print OUTPUT sort @lines;
close OUTPUT;
}
sub do_clock
{
my ($directory, $fname, $out_file) = @_;
print "$directory/$fname\n";
open INPUT, "$directory/$fname";
open OUTPUT, ">>$out_file" or die "can't open $out_file: $!";
print OUTPUT "$fname\n";
close INPUT;
close OUTPUT;
}
sub peer_summary
{
my $in_file = shift;
my ($i, $j, $n);
my (%peer_ident, %peer_count, %peer_mean, %peer_var, %peer_max);
my (%peer_1, %peer_2, %peer_3, %peer_4);
my $dist;
my $max;
open INPUT, "<$in_file" or die "can't open $in_file: $!";
my @Fld;
$n = 0;
while (<INPUT>) {
chop; # strip record separator
@Fld = split;
next if ($#Fld < 7 || $Fld[0] eq 'ident');
$i = $n;
for ($j = 0; $j < $n; $j++) {
if ($Fld[0] eq $peer_ident{$j}) {
$i = $j;
last; # peer found
}
}
if ($i == $n) { # add new peer
$peer_count{$i} = $peer_mean{$i} = $peer_var{$i} = 0;
$peer_max{$i} = 0;
$peer_1{$i} = $peer_2{$i} = $peer_3{$i} = $peer_4{$i} = 0;
$peer_ident{$i} = $Fld[0];
++$n;
}
$dist = $Fld[6] - $Fld[5] / 2;
if ($dist < $peer_dist_limit) {
$peer_count{$i}++;
$peer_mean{$i} += $Fld[2];
$peer_var{$i} += $Fld[3] * $Fld[3];
$max = $Fld[4];
$peer_max{$i} = max($peer_max{$i}, $max);
if ($max > 1) {
$peer_1{$i}++;
if ($max > 5) {
$peer_2{$i}++;
if ($max > 10) {
$peer_3{$i}++;
if ($max > 50) {
$peer_4{$i}++;
}
}
}
}
}
else {
warn "dist exceeds limit: $dist (file $in_file, line $.)\n";
}
}
close INPUT;
my @lines = ();
print
" host days mean rms max >1 >5 >10 >50\n";
print
"==================================================================\n";
for ($i = 0; $i < $n; $i++) {
next if ($peer_count{$i} < 2);
$peer_mean{$i} /= $peer_count{$i};
eval { $peer_var{$i} = sqrt($peer_var{$i} / $peer_count{$i} -
$peer_mean{$i} * $peer_mean{$i}); };
$peer_var{$i} = 0, warn $@ if $@;
push @lines, sprintf
"%-15s %3d %9.3f% 9.3f %9.3f %3d %3d %3d %3d\n",
$peer_ident{$i}, $peer_count{$i}, $peer_mean{$i}, $peer_var{$i},
$peer_max{$i}, $peer_1{$i}, $peer_2{$i}, $peer_3{$i}, $peer_4{$i};
}
print sort @lines;
}
my $loop_summary="$outputdir/loop_summary";
my $peer_summary="$outputdir/peer_summary";
my $clock_summary="$outputdir/clock_summary";
my (@loopfiles, @peerfiles, @clockfiles);
print STDERR "Creating summaries from $statsdir ($startdate to $enddate)\n";
opendir SDIR, $statsdir or die "directory ${statsdir}: $!";
rewinddir SDIR;
@loopfiles=sort grep /loop.*$log_date_pattern/, readdir SDIR;
rewinddir SDIR;
@peerfiles=sort grep /peer.*$log_date_pattern/, readdir SDIR;
rewinddir SDIR;
@clockfiles=sort grep /clock.*$log_date_pattern/, readdir SDIR;
closedir SDIR;
# remove old summary files
map { unlink $_ if -f $_ } ($loop_summary, $peer_summary, $clock_summary);
my $date;
map {
$date = $_; $date =~ s/.*($log_date_pattern)$/$1/;
if ($date ge $startdate && $date le $enddate) {
do_loop $statsdir, $_, $loop_summary;
}
} @loopfiles;
map {
$date = $_; $date =~ s/.*($log_date_pattern)$/$1/;
if ($date ge $startdate && $date le $enddate) {
do_peer $statsdir, $_, $peer_summary;
}
} @peerfiles;
map {
$date = $_; $date =~ s/.*($log_date_pattern)$/$1/;
if ($date ge $startdate && $date le $enddate) {
do_clock $statsdir, $_, $clock_summary;
}
} @clockfiles;
print STDERR "Creating peer summary with limit $peer_dist_limit\n";
peer_summary $peer_summary if (-f $peer_summary);
File diff suppressed because it is too large. Load diff
-71
View File
@@ -1,71 +0,0 @@
KTUTIL(8) UNIX System Manager's Manual KTUTIL(8)
NNAAMMEE
kkttuuttiill - manage Kerberos keytabs
SSYYNNOOPPSSIISS
kkttuuttiill [--kk _k_e_y_t_a_b | ----kkeeyyttaabb==_k_e_y_t_a_b] [--vv | ----vveerrbboossee] [----vveerrssiioonn] [--hh |
----hheellpp] _c_o_m_m_a_n_d [_a_r_g_s]
DDEESSCCRRIIPPTTIIOONN
kkttuuttiill is a program for managing keytabs. _c_o_m_m_a_n_d can be one of the fol-
lowing:
add [--pp _p_r_i_n_c_i_p_a_l] [----pprriinncciippaall==_p_r_i_n_c_i_p_a_l] [--VV _k_v_n_o] [----kkvvnnoo==_k_v_n_o] [--ee
_e_n_c_y_p_e] [----eennccttyyppee==_e_n_c_t_y_p_e] [--ww _p_a_s_s_w_o_r_d] [----ppaasssswwoorrdd==_p_a_s_s_w_o_r_d]
[--rr] [----rraannddoomm] [--ss] [----nnoo--ssaalltt]
Adds a key to the keytab. Options that are not specified will be
prompted for.
change [--rr _r_e_a_l_m] [----rreeaallmm==_r_e_a_l_m] [----aa _h_o_s_t] [----aaddmmiinn--sseerrvveerr==_h_o_s_t] [----ss
_p_o_r_t] [----sseerrvveerr--ppoorrtt==_p_o_r_t]
Update one or several keys to new versions. By default, use the
admin server for the realm of an keytab entry. Otherwise it will
use the values specified by the options.
If no principals are given, all the ones in the keytab are updat-
ed.
copy _k_e_y_t_a_b_-_s_r_c _k_e_y_t_a_b_-_d_e_s_t
Copies all the entries from _k_e_y_t_a_b_-_s_r_c to _k_e_y_t_a_b_-_d_e_s_t.
get [--pp _a_d_m_i_n _p_r_i_n_c_i_p_a_l] [----pprriinncciippaall==_a_d_m_i_n _p_r_i_n_c_i_p_a_l] [--ee _e_n_c_t_y_p_e |
----eennccttyyppeess==_e_n_c_t_y_p_e
sseerrvveerr==_a_d_m_i_n _s_e_r_v_e_r] [--ss _s_e_r_v_e_r _p_o_r_t] [----sseerrvveerr--ppoorrtt==_s_e_r_v_e_r _p_o_r_t]
_p_r_i_n_c_i_p_a_l ][--rr _r_e_a_l_m] [----rreeaallmm==_r_e_a_l_m] [--aa _a_d_m_i_n _s_e_r_v_e_r]
[----aaddmmiinn-- Get a key for pprriinncciippaall and store it in a keytab.
list [----kkeeyyss] [----ttiimmeessttaammpp]
List the keys stored in the keytab.
remove [--pp _p_r_i_n_c_i_p_a_l] [----pprriinncciippaall==_p_r_i_n_c_i_p_a_l] [--VV --kkvvnnoo] [----kkvvnnoo==_k_v_n_o]
[--ee --eennccttyyppee] [----eennccttyyppee==_e_n_c_t_y_p_e]
Removes the specified key or keys. Not specifying a _k_v_n_o removes
keys with any version number. Not specifying a _e_n_c_t_y_p_e removes
keys of any type.
purge [----aaggee==_a_g_e]
Removes all old entries (for which there is a newer version) that
are older than _a_g_e (default one week).
srvconvert
srv2keytab [--ss _s_r_v_t_a_b] [----ssrrvvttaabb==_s_r_v_t_a_b]
Converts the version 4 srvtab in _s_r_v_t_a_b to a version 5 keytab and
stores it in _k_e_y_t_a_b. Identical to:
ktutil copy krb4:_s_r_v_t_a_b _k_e_y_t_a_b
srvcreate
key2srvtab [--ss _s_r_v_t_a_b] [----ssrrvvttaabb==_s_r_v_t_a_b]
Converts the version 5 keytab in _k_e_y_t_a_b to a version 4 srvtab and
stores it in _s_r_v_t_a_b. Identical to:
ktutil copy _k_e_y_t_a_b krb4:_s_r_v_t_a_b
SSEEEE AALLSSOO
kadmin(8)
HEIMDAL December 16, 2000 2
-650
View File
@@ -1,650 +0,0 @@
FTP(1) UNIX Reference Manual FTP(1)
NNAAMMEE
ffttpp - ARPANET file transfer program
SSYYNNOOPPSSIISS
ffttpp [--tt] [--vv] [--dd] [--ii] [--nn] [--gg] [--pp] [--ll] [_h_o_s_t]
DDEESSCCRRIIPPTTIIOONN
FFttpp is the user interface to the ARPANET standard File Transfer Protocol.
The program allows a user to transfer files to and from a remote network
site.
Modifications has been made so that it almost follows the ftpsec Internet
draft.
Options may be specified at the command line, or to the command inter-
preter.
--tt Enables packet tracing.
--vv Verbose option forces ffttpp to show all responses from the remote
server, as well as report on data transfer statistics.
--nn Restrains ffttpp from attempting ``auto-login'' upon initial connec-
tion. If auto-login is enabled, ffttpp will check the _._n_e_t_r_c (see be-
low) file in the user's home directory for an entry describing an
account on the remote machine. If no entry exists, ffttpp will prompt
for the remote machine login name (default is the user identity on
the local machine), and, if necessary, prompt for a password and an
account with which to login.
--ii Turns off interactive prompting during multiple file transfers.
--pp Turn on passive mode.
--dd Enables debugging.
--gg Disables file name globbing.
--ll Disables command line editing.
The client host with which ffttpp is to communicate may be specified on the
command line. If this is done, ffttpp will immediately attempt to establish
a connection to an FTP server on that host; otherwise, ffttpp will enter its
command interpreter and await instructions from the user. When ffttpp is
awaiting commands from the user the prompt `ftp>' is provided to the us-
er. The following commands are recognized by ffttpp:
!! [_c_o_m_m_a_n_d [_a_r_g_s]]
Invoke an interactive shell on the local machine. If there
are arguments, the first is taken to be a command to execute
directly, with the rest of the arguments as its arguments.
$$ _m_a_c_r_o_-_n_a_m_e [_a_r_g_s]
Execute the macro _m_a_c_r_o_-_n_a_m_e that was defined with the mmaaccddeeff
command. Arguments are passed to the macro unglobbed.
aaccccoouunntt [_p_a_s_s_w_d]
Supply a supplemental password required by a remote system
for access to resources once a login has been successfully
completed. If no argument is included, the user will be
prompted for an account password in a non-echoing input mode.
aappppeenndd _l_o_c_a_l_-_f_i_l_e [_r_e_m_o_t_e_-_f_i_l_e]
Append a local file to a file on the remote machine. If
_r_e_m_o_t_e_-_f_i_l_e is left unspecified, the local file name is used
in naming the remote file after being altered by any nnttrraannss
or nnmmaapp setting. File transfer uses the current settings for
ttyyppee, ffoorrmmaatt, mmooddee, and ssttrruuccttuurree.
aasscciiii Set the file transfer ttyyppee to network ASCII. This is the de-
fault type.
bbeellll Arrange that a bell be sounded after each file transfer com-
mand is completed.
bbiinnaarryy Set the file transfer ttyyppee to support binary image transfer.
bbyyee Terminate the FTP session with the remote server and exit
ffttpp. An end of file will also terminate the session and exit.
ccaassee Toggle remote computer file name case mapping during mmggeett
commands. When ccaassee is on (default is off), remote computer
file names with all letters in upper case are written in the
local directory with the letters mapped to lower case.
ccdd _r_e_m_o_t_e_-_d_i_r_e_c_t_o_r_y
Change the working directory on the remote machine to _r_e_m_o_t_e_-
_d_i_r_e_c_t_o_r_y.
ccdduupp Change the remote machine working directory to the parent of
the current remote machine working directory.
cchhmmoodd _m_o_d_e _f_i_l_e_-_n_a_m_e
Change the permission modes of the file _f_i_l_e_-_n_a_m_e on the re-
mote sytem to _m_o_d_e.
cclloossee Terminate the FTP session with the remote server, and return
to the command interpreter. Any defined macros are erased.
ccrr Toggle carriage return stripping during ascii type file re-
trieval. Records are denoted by a carriage return/linefeed
sequence during ascii type file transfer. When ccrr is on (the
default), carriage returns are stripped from this sequence to
conform with the UNIX single linefeed record delimiter.
Records on non-UNIX remote systems may contain single line-
feeds; when an ascii type transfer is made, these linefeeds
may be distinguished from a record delimiter only when ccrr is
off.
ddeelleettee _r_e_m_o_t_e_-_f_i_l_e
Delete the file _r_e_m_o_t_e_-_f_i_l_e on the remote machine.
ddeebbuugg [_d_e_b_u_g_-_v_a_l_u_e]
Toggle debugging mode. If an optional _d_e_b_u_g_-_v_a_l_u_e is speci-
fied it is used to set the debugging level. When debugging
is on, ffttpp prints each command sent to the remote machine,
preceded by the string `-->'
ddiirr [_r_e_m_o_t_e_-_d_i_r_e_c_t_o_r_y] [_l_o_c_a_l_-_f_i_l_e]
Print a listing of the directory contents in the directory,
_r_e_m_o_t_e_-_d_i_r_e_c_t_o_r_y, and, optionally, placing the output in
_l_o_c_a_l_-_f_i_l_e. If interactive prompting is on, ffttpp will prompt
the user to verify that the last argument is indeed the tar-
get local file for receiving ddiirr output. If no directory is
specified, the current working directory on the remote ma-
chine is used. If no local file is specified, or _l_o_c_a_l_-_f_i_l_e
is --, output comes to the terminal.
ddiissccoonnnneecctt A synonym for _c_l_o_s_e.
ffoorrmm _f_o_r_m_a_t
Set the file transfer ffoorrmm to _f_o_r_m_a_t. The default format is
``file''.
ggeett _r_e_m_o_t_e_-_f_i_l_e [_l_o_c_a_l_-_f_i_l_e]
Retrieve the _r_e_m_o_t_e_-_f_i_l_e and store it on the local machine.
If the local file name is not specified, it is given the same
name it has on the remote machine, subject to alteration by
the current ccaassee, nnttrraannss, and nnmmaapp settings. The current
settings for ttyyppee, ffoorrmm, mmooddee, and ssttrruuccttuurree are used while
transferring the file.
gglloobb Toggle filename expansion for mmddeelleettee, mmggeett and mmppuutt. If
globbing is turned off with gglloobb, the file name arguments are
taken literally and not expanded. Globbing for mmppuutt is done
as in csh(1). For mmddeelleettee and mmggeett, each remote file name is
expanded separately on the remote machine and the lists are
not merged. Expansion of a directory name is likely to be
different from expansion of the name of an ordinary file: the
exact result depends on the foreign operating system and ftp
server, and can be previewed by doing `mls remote-files -'.
As a security measure, remotely globbed files that starts
with `/' or contains `../', will not be automatically re-
ceived. If you have interactive prompting turned off, these
filenames will be ignored. Note: mmggeett and mmppuutt are not meant
to transfer entire directory subtrees of files. That can be
done by transferring a tar(1) archive of the subtree (in bi-
nary mode).
hhaasshh Toggle hash-sign (``#'') printing for each data block trans-
ferred. The size of a data block is 1024 bytes.
hheellpp [_c_o_m_m_a_n_d]
Print an informative message about the meaning of _c_o_m_m_a_n_d. If
no argument is given, ffttpp prints a list of the known com-
mands.
iiddllee [_s_e_c_o_n_d_s]
Set the inactivity timer on the remote server to _s_e_c_o_n_d_s sec-
onds. If _s_e_c_o_n_d_s is omitted, the current inactivity timer is
printed.
llccdd [_d_i_r_e_c_t_o_r_y]
Change the working directory on the local machine. If no
_d_i_r_e_c_t_o_r_y is specified, the user's home directory is used.
llss [_r_e_m_o_t_e_-_d_i_r_e_c_t_o_r_y] [_l_o_c_a_l_-_f_i_l_e]
Print a listing of the contents of a directory on the remote
machine. The listing includes any system-dependent informa-
tion that the server chooses to include; for example, most
UNIX systems will produce output from the command `ls -l'.
(See also nnlliisstt.) If _r_e_m_o_t_e_-_d_i_r_e_c_t_o_r_y is left unspecified,
the current working directory is used. If interactive
prompting is on, ffttpp will prompt the user to verify that the
last argument is indeed the target local file for receiving
llss output. If no local file is specified, or if _l_o_c_a_l_-_f_i_l_e
is `--', the output is sent to the terminal.
mmaaccddeeff _m_a_c_r_o_-_n_a_m_e
Define a macro. Subsequent lines are stored as the macro
_m_a_c_r_o_-_n_a_m_e; a null line (consecutive newline characters in a
file or carriage returns from the terminal) terminates macro
input mode. There is a limit of 16 macros and 4096 total
characters in all defined macros. Macros remain defined un-
til a cclloossee command is executed. The macro processor inter-
prets `$' and `\' as special characters. A `$' followed by a
number (or numbers) is replaced by the corresponding argument
on the macro invocation command line. A `$' followed by an
`i' signals that macro processor that the executing macro is
to be looped. On the first pass `$i' is replaced by the
first argument on the macro invocation command line, on the
second pass it is replaced by the second argument, and so on.
A `\' followed by any character is replaced by that charac-
ter. Use the `\' to prevent special treatment of the `$'.
mmddeelleettee [_r_e_m_o_t_e_-_f_i_l_e_s]
Delete the _r_e_m_o_t_e_-_f_i_l_e_s on the remote machine.
mmddiirr _r_e_m_o_t_e_-_f_i_l_e_s _l_o_c_a_l_-_f_i_l_e
Like ddiirr, except multiple remote files may be specified. If
interactive prompting is on, ffttpp will prompt the user to ver-
ify that the last argument is indeed the target local file
for receiving mmddiirr output.
mmggeett _r_e_m_o_t_e_-_f_i_l_e_s
Expand the _r_e_m_o_t_e_-_f_i_l_e_s on the remote machine and do a ggeett
for each file name thus produced. See gglloobb for details on
the filename expansion. Resulting file names will then be
processed according to ccaassee, nnttrraannss, and nnmmaapp settings.
Files are transferred into the local working directory, which
can be changed with `lcd directory'; new local directories
can be created with `! mkdir directory'.
mmkkddiirr _d_i_r_e_c_t_o_r_y_-_n_a_m_e
Make a directory on the remote machine.
mmllss _r_e_m_o_t_e_-_f_i_l_e_s _l_o_c_a_l_-_f_i_l_e
Like nnlliisstt, except multiple remote files may be specified,
and the _l_o_c_a_l_-_f_i_l_e must be specified. If interactive prompt-
ing is on, ffttpp will prompt the user to verify that the last
argument is indeed the target local file for receiving mmllss
output.
mmooddee [_m_o_d_e_-_n_a_m_e]
Set the file transfer mmooddee to _m_o_d_e_-_n_a_m_e. The default mode is
``stream'' mode.
mmooddttiimmee _f_i_l_e_-_n_a_m_e
Show the last modification time of the file on the remote ma-
chine.
mmppuutt _l_o_c_a_l_-_f_i_l_e_s
Expand wild cards in the list of local files given as argu-
ments and do a ppuutt for each file in the resulting list. See
gglloobb for details of filename expansion. Resulting file names
will then be processed according to nnttrraannss and nnmmaapp settings.
nneewweerr _f_i_l_e_-_n_a_m_e
Get the file only if the modification time of the remote file
is more recent that the file on the current system. If the
file does not exist on the current system, the remote file is
considered nneewweerr. Otherwise, this command is identical to
_g_e_t.
nnlliisstt [_r_e_m_o_t_e_-_d_i_r_e_c_t_o_r_y] [_l_o_c_a_l_-_f_i_l_e]
Print a list of the files in a directory on the remote ma-
chine. If _r_e_m_o_t_e_-_d_i_r_e_c_t_o_r_y is left unspecified, the current
working directory is used. If interactive prompting is on,
ffttpp will prompt the user to verify that the last argument is
indeed the target local file for receiving nnlliisstt output. If
no local file is specified, or if _l_o_c_a_l_-_f_i_l_e is --, the output
is sent to the terminal.
nnmmaapp [_i_n_p_a_t_t_e_r_n _o_u_t_p_a_t_t_e_r_n]
Set or unset the filename mapping mechanism. If no arguments
are specified, the filename mapping mechanism is unset. If
arguments are specified, remote filenames are mapped during
mmppuutt commands and ppuutt commands issued without a specified re-
mote target filename. If arguments are specified, local
filenames are mapped during mmggeett commands and ggeett commands
issued without a specified local target filename. This com-
mand is useful when connecting to a non-UNIX remote computer
with different file naming conventions or practices. The
mapping follows the pattern set by _i_n_p_a_t_t_e_r_n and _o_u_t_p_a_t_t_e_r_n.
[_I_n_p_a_t_t_e_r_n] is a template for incoming filenames (which may
have already been processed according to the nnttrraannss and ccaassee
settings). Variable templating is accomplished by including
the sequences `$1', `$2', ..., `$9' in _i_n_p_a_t_t_e_r_n. Use `\' to
prevent this special treatment of the `$' character. All
other characters are treated literally, and are used to de-
termine the nnmmaapp [_i_n_p_a_t_t_e_r_n] variable values. For example,
given _i_n_p_a_t_t_e_r_n $1.$2 and the remote file name "mydata.data",
$1 would have the value "mydata", and $2 would have the value
"data". The _o_u_t_p_a_t_t_e_r_n determines the resulting mapped file-
name. The sequences `$1', `$2', ...., `$9' are replaced by
any value resulting from the _i_n_p_a_t_t_e_r_n template. The se-
quence `$0' is replace by the original filename. Additional-
ly, the sequence `[_s_e_q_1, _s_e_q_2]' is replaced by [_s_e_q_1] if _s_e_q_1
is not a null string; otherwise it is replaced by _s_e_q_2. For
example, the command
nmap $1.$2.$3 [$1,$2].[$2,file]
would yield the output filename "myfile.data" for input file-
names "myfile.data" and "myfile.data.old", "myfile.file" for
the input filename "myfile", and "myfile.myfile" for the in-
put filename ".myfile". Spaces may be included in
_o_u_t_p_a_t_t_e_r_n, as in the example: `nmap $1 sed "s/ *$//" > $1'
. Use the `\' character to prevent special treatment of the
`$','[','[', and `,' characters.
nnttrraannss [_i_n_c_h_a_r_s [_o_u_t_c_h_a_r_s]]
Set or unset the filename character translation mechanism.
If no arguments are specified, the filename character trans-
lation mechanism is unset. If arguments are specified, char-
acters in remote filenames are translated during mmppuutt com-
mands and ppuutt commands issued without a specified remote tar-
get filename. If arguments are specified, characters in lo-
cal filenames are translated during mmggeett commands and ggeett
commands issued without a specified local target filename.
This command is useful when connecting to a non-UNIX remote
computer with different file naming conventions or practices.
Characters in a filename matching a character in _i_n_c_h_a_r_s are
replaced with the corresponding character in _o_u_t_c_h_a_r_s. If the
character's position in _i_n_c_h_a_r_s is longer than the length of
_o_u_t_c_h_a_r_s, the character is deleted from the file name.
ooppeenn _h_o_s_t [_p_o_r_t]
Establish a connection to the specified _h_o_s_t FTP server. An
optional port number may be supplied, in which case, ffttpp will
attempt to contact an FTP server at that port. If the aauuttoo--
llooggiinn option is on (default), ffttpp will also attempt to auto-
matically log the user in to the FTP server (see below).
ppaassssiivvee Toggle passive mode. If passive mode is turned on (default
is off), the ftp client will send a PASV command for all data
connections instead of the usual PORT command. The PASV com-
mand requests that the remote server open a port for the data
connection and return the address of that port. The remote
server listens on that port and the client connects to it.
When using the more traditional PORT command, the client lis-
tens on a port and sends that address to the remote server,
who connects back to it. Passive mode is useful when using
ffttpp through a gateway router or host that controls the direc-
tionality of traffic. (Note that though ftp servers are re-
quired to support the PASV command by RFC 1123, some do not.)
pprroommpptt Toggle interactive prompting. Interactive prompting occurs
during multiple file transfers to allow the user to selec-
tively retrieve or store files. If prompting is turned off
(default is on), any mmggeett or mmppuutt will transfer all files,
and any mmddeelleettee will delete all files.
pprrooxxyy _f_t_p_-_c_o_m_m_a_n_d
Execute an ftp command on a secondary control connection.
This command allows simultaneous connection to two remote ftp
servers for transferring files between the two servers. The
first pprrooxxyy command should be an ooppeenn, to establish the sec-
ondary control connection. Enter the command "proxy ?" to
see other ftp commands executable on the secondary connec-
tion. The following commands behave differently when pref-
aced by pprrooxxyy: ooppeenn will not define new macros during the au-
to-login process, cclloossee will not erase existing macro defini-
tions, ggeett and mmggeett transfer files from the host on the pri-
mary control connection to the host on the secondary control
connection, and ppuutt, mmppuutt, and aappppeenndd transfer files from the
host on the secondary control connection to the host on the
primary control connection. Third party file transfers de-
pend upon support of the ftp protocol PASV command by the
server on the secondary control connection.
ppuutt _l_o_c_a_l_-_f_i_l_e [_r_e_m_o_t_e_-_f_i_l_e]
Store a local file on the remote machine. If _r_e_m_o_t_e_-_f_i_l_e is
left unspecified, the local file name is used after process-
ing according to any nnttrraannss or nnmmaapp settings in naming the
remote file. File transfer uses the current settings for
ttyyppee, ffoorrmmaatt, mmooddee, and ssttrruuccttuurree.
ppwwdd Print the name of the current working directory on the remote
machine.
qquuiitt A synonym for bbyyee.
qquuoottee _a_r_g_1 _a_r_g_2 _._._.
The arguments specified are sent, verbatim, to the remote FTP
server.
rreeccvv _r_e_m_o_t_e_-_f_i_l_e [_l_o_c_a_l_-_f_i_l_e]
A synonym for get.
rreeggeett _r_e_m_o_t_e_-_f_i_l_e [_l_o_c_a_l_-_f_i_l_e]
Reget acts like get, except that if _l_o_c_a_l_-_f_i_l_e exists and is
smaller than _r_e_m_o_t_e_-_f_i_l_e, _l_o_c_a_l_-_f_i_l_e is presumed to be a par-
tially transferred copy of _r_e_m_o_t_e_-_f_i_l_e and the transfer is
continued from the apparent point of failure. This command
is useful when transferring very large files over networks
that are prone to dropping connections.
rreemmootteehheellpp [_c_o_m_m_a_n_d_-_n_a_m_e]
Request help from the remote FTP server. If a _c_o_m_m_a_n_d_-_n_a_m_e
is specified it is supplied to the server as well.
rreemmootteessttaattuuss [_f_i_l_e_-_n_a_m_e]
With no arguments, show status of remote machine. If _f_i_l_e_-
_n_a_m_e is specified, show status of _f_i_l_e_-_n_a_m_e on remote ma-
chine.
rreennaammee [_f_r_o_m] [_t_o]
Rename the file _f_r_o_m on the remote machine, to the file _t_o.
rreesseett Clear reply queue. This command re-synchronizes command/re-
ply sequencing with the remote ftp server. Resynchronization
may be necessary following a violation of the ftp protocol by
the remote server.
rreessttaarrtt _m_a_r_k_e_r
Restart the immediately following ggeett or ppuutt at the indicated
_m_a_r_k_e_r. On UNIX systems, marker is usually a byte offset into
the file.
rrmmddiirr _d_i_r_e_c_t_o_r_y_-_n_a_m_e
Delete a directory on the remote machine.
rruunniiqquuee Toggle storing of files on the local system with unique file-
names. If a file already exists with a name equal to the
target local filename for a ggeett or mmggeett command, a ".1" is
appended to the name. If the resulting name matches another
existing file, a ".2" is appended to the original name. If
this process continues up to ".99", an error message is
printed, and the transfer does not take place. The generated
unique filename will be reported. Note that rruunniiqquuee will not
affect local files generated from a shell command (see be-
low). The default value is off.
sseenndd _l_o_c_a_l_-_f_i_l_e [_r_e_m_o_t_e_-_f_i_l_e]
A synonym for put.
sseennddppoorrtt Toggle the use of PORT commands. By default, ffttpp will at-
tempt to use a PORT command when establishing a connection
for each data transfer. The use of PORT commands can prevent
delays when performing multiple file transfers. If the PORT
command fails, ffttpp will use the default data port. When the
use of PORT commands is disabled, no attempt will be made to
use PORT commands for each data transfer. This is useful for
certain FTP implementations which do ignore PORT commands
but, incorrectly, indicate they've been accepted.
ssiittee _a_r_g_1 _a_r_g_2 _._._.
The arguments specified are sent, verbatim, to the remote FTP
server as a SITE command.
ssiizzee _f_i_l_e_-_n_a_m_e
Return size of _f_i_l_e_-_n_a_m_e on remote machine.
ssttaattuuss Show the current status of ffttpp.
ssttrruucctt [_s_t_r_u_c_t_-_n_a_m_e]
Set the file transfer _s_t_r_u_c_t_u_r_e to _s_t_r_u_c_t_-_n_a_m_e. By default
``stream'' structure is used.
ssuunniiqquuee Toggle storing of files on remote machine under unique file
names. Remote ftp server must support ftp protocol STOU com-
mand for successful completion. The remote server will re-
port unique name. Default value is off.
ssyysstteemm Show the type of operating system running on the remote ma-
chine.
tteenneexx Set the file transfer type to that needed to talk to TENEX
machines.
ttrraaccee Toggle packet tracing.
ttyyppee [_t_y_p_e_-_n_a_m_e]
Set the file transfer ttyyppee to _t_y_p_e_-_n_a_m_e. If no type is speci-
fied, the current type is printed. The default type is net-
work ASCII.
uummaasskk [_n_e_w_m_a_s_k]
Set the default umask on the remote server to _n_e_w_m_a_s_k. If
_n_e_w_m_a_s_k is omitted, the current umask is printed.
uusseerr _u_s_e_r_-_n_a_m_e [_p_a_s_s_w_o_r_d] [_a_c_c_o_u_n_t]
Identify yourself to the remote FTP server. If the _p_a_s_s_w_o_r_d
is not specified and the server requires it, ffttpp will prompt
the user for it (after disabling local echo). If an _a_c_c_o_u_n_t
field is not specified, and the FTP server requires it, the
user will be prompted for it. If an _a_c_c_o_u_n_t field is speci-
fied, an account command will be relayed to the remote server
after the login sequence is completed if the remote server
did not require it for logging in. Unless ffttpp is invoked
with ``auto-login'' disabled, this process is done automati-
cally on initial connection to the FTP server.
vveerrbboossee Toggle verbose mode. In verbose mode, all responses from the
FTP server are displayed to the user. In addition, if ver-
bose is on, when a file transfer completes, statistics re-
garding the efficiency of the transfer are reported. By de-
fault, verbose is on.
?? [_c_o_m_m_a_n_d]
A synonym for help.
The following command can be used with ftpsec-aware servers.
pprroott _c_l_e_a_r | _s_a_f_e | _c_o_n_f_i_d_e_n_t_i_a_l | _p_r_i_v_a_t_e
Set the data protection level to the requested level.
The following command can be used with ftp servers that has implemented
the KAUTH site command.
kkaauutthh [_p_r_i_n_c_i_p_a_l]
Obtain remote tickets.
Command arguments which have embedded spaces may be quoted with quote `"'
marks.
AABBOORRTTIINNGG AA FFIILLEE TTRRAANNSSFFEERR
To abort a file transfer, use the terminal interrupt key (usually Ctrl-
C). Sending transfers will be immediately halted. Receiving transfers
will be halted by sending a ftp protocol ABOR command to the remote serv-
er, and discarding any further data received. The speed at which this is
accomplished depends upon the remote server's support for ABOR process-
ing. If the remote server does not support the ABOR command, an `ftp>'
prompt will not appear until the remote server has completed sending the
requested file.
The terminal interrupt key sequence will be ignored when ffttpp has complet-
ed any local processing and is awaiting a reply from the remote server.
A long delay in this mode may result from the ABOR processing described
above, or from unexpected behavior by the remote server, including viola-
tions of the ftp protocol. If the delay results from unexpected remote
server behavior, the local ffttpp program must be killed by hand.
FFIILLEE NNAAMMIINNGG CCOONNVVEENNTTIIOONNSS
Files specified as arguments to ffttpp commands are processed according to
the following rules.
1. If the file name `--' is specified, the _s_t_d_i_n (for reading) or _s_t_d_o_u_t
(for writing) is used.
2. If the first character of the file name is `|', the remainder of the
argument is interpreted as a shell command. FFttpp then forks a shell,
using popen(3) with the argument supplied, and reads (writes) from
the stdout (stdin). If the shell command includes spaces, the argu-
ment must be quoted; e.g. ``" ls -lt"''. A particularly useful ex-
ample of this mechanism is: ``dir more''.
3. Failing the above checks, if ``globbing'' is enabled, local file
names are expanded according to the rules used in the csh(1); c.f.
the gglloobb command. If the ffttpp command expects a single local file
(.e.g. ppuutt), only the first filename generated by the "globbing"
operation is used.
4. For mmggeett commands and ggeett commands with unspecified local file
names, the local filename is the remote filename, which may be al-
tered by a ccaassee, nnttrraannss, or nnmmaapp setting. The resulting filename
may then be altered if rruunniiqquuee is on.
5. For mmppuutt commands and ppuutt commands with unspecified remote file
names, the remote filename is the local filename, which may be al-
tered by a nnttrraannss or nnmmaapp setting. The resulting filename may then
be altered by the remote server if ssuunniiqquuee is on.
FFIILLEE TTRRAANNSSFFEERR PPAARRAAMMEETTEERRSS
The FTP specification specifies many parameters which may affect a file
transfer. The ttyyppee may be one of ``ascii'', ``image'' (binary),
``ebcdic'', and ``local byte size'' (for PDP-10's and PDP-20's mostly).
FFttpp supports the ascii and image types of file transfer, plus local byte
size 8 for tteenneexx mode transfers.
FFttpp supports only the default values for the remaining file transfer pa-
rameters: mmooddee, ffoorrmm, and ssttrruucctt.
TTHHEE ..nneettrrcc FFIILLEE
The _._n_e_t_r_c file contains login and initialization information used by the
auto-login process. It resides in the user's home directory. The fol-
lowing tokens are recognized; they may be separated by spaces, tabs, or
new-lines:
mmaacchhiinnee _n_a_m_e
Identify a remote machine _n_a_m_e. The auto-login process searches
the _._n_e_t_r_c file for a mmaacchhiinnee token that matches the remote ma-
chine specified on the ffttpp command line or as an ooppeenn command
argument. Once a match is made, the subsequent _._n_e_t_r_c tokens
are processed, stopping when the end of file is reached or an-
other mmaacchhiinnee or a ddeeffaauulltt token is encountered.
ddeeffaauulltt This is the same as mmaacchhiinnee _n_a_m_e except that ddeeffaauulltt matches
any name. There can be only one ddeeffaauulltt token, and it must be
after all mmaacchhiinnee tokens. This is normally used as:
default login anonymous password user@site
thereby giving the user _a_u_t_o_m_a_t_i_c anonymous ftp login to ma-
chines not specified in _._n_e_t_r_c. This can be overridden by using
the --nn flag to disable auto-login.
llooggiinn _n_a_m_e
Identify a user on the remote machine. If this token is pre-
sent, the auto-login process will initiate a login using the
specified _n_a_m_e.
ppaasssswwoorrdd _s_t_r_i_n_g
Supply a password. If this token is present, the auto-login
process will supply the specified string if the remote server
requires a password as part of the login process. Note that if
this token is present in the _._n_e_t_r_c file for any user other
than _a_n_o_n_y_m_o_u_s, ffttpp will abort the auto-login process if the
_._n_e_t_r_c is readable by anyone besides the user.
aaccccoouunntt _s_t_r_i_n_g
Supply an additional account password. If this token is pre-
sent, the auto-login process will supply the specified string
if the remote server requires an additional account password,
or the auto-login process will initiate an ACCT command if it
does not.
mmaaccddeeff _n_a_m_e
Define a macro. This token functions like the ffttpp mmaaccddeeff com-
mand functions. A macro is defined with the specified name;
its contents begin with the next _._n_e_t_r_c line and continue until
a null line (consecutive new-line characters) is encountered.
If a macro named iinniitt is defined, it is automatically executed
as the last step in the auto-login process.
EENNVVIIRROONNMMEENNTT
FFttpp utilizes the following environment variables.
HOME For default location of a _._n_e_t_r_c file, if one exists.
SHELL For default shell.
SSEEEE AALLSSOO
ftpd(8), _R_F_C_2_2_2_8
HHIISSTTOORRYY
The ffttpp command appeared in 4.2BSD.
BBUUGGSS
Correct execution of many commands depends upon proper behavior by the
remote server.
An error in the treatment of carriage returns in the 4.2BSD ascii-mode
transfer code has been corrected. This correction may result in incor-
rect transfers of binary files to and from 4.2BSD servers using the ascii
type. Avoid this problem by using the binary image type.
4.2 Berkeley Distribution April 27, 1996 10
-296
View File
@@ -1,296 +0,0 @@
FTPD(8) UNIX System Manager's Manual FTPD(8)
NNAAMMEE
ffttppdd - Internet File Transfer Protocol server
SSYYNNOOPPSSIISS
ffttppdd [--aa _a_u_t_h_m_o_d_e] [--ddiillvv] [--gg _u_m_a_s_k] [--pp _p_o_r_t] [--TT _m_a_x_t_i_m_e_o_u_t] [--tt
_t_i_m_e_o_u_t] [--uu _d_e_f_a_u_l_t _u_m_a_s_k] [--BB | ----bbuuiillttiinn--llss] [----ggoooodd--cchhaarrss==_s_t_r_i_n_g]
DDEESSCCRRIIPPTTIIOONN
FFttppdd is the Internet File Transfer Protocol server process. The server
uses the TCP protocol and listens at the port specified in the ``ftp''
service specification; see services(5).
Available options:
--aa Select the level of authentication required. Kerberised login
can not be turned off. The default is to only allow kerberised
login. Other possibilities can be turned on by giving a string
of comma separated flags as argument to --aa. Recognised flags are:
_p_l_a_i_n Allow logging in with plaintext password. The password can
be a(n) OTP or an ordinary password.
_o_t_p Same as _p_l_a_i_n, but only OTP is allowed.
_f_t_p Allow anonymous login.
The following combination modes exists for backwards compatibili-
ty:
_n_o_n_e Same as _p_l_a_i_n_,_f_t_p.
_s_a_f_e Same as _f_t_p.
_u_s_e_r Ignored.
--dd Debugging information is written to the syslog using LOG_FTP.
--gg Anonymous users will get a umask of _u_m_a_s_k.
--ii Open a socket and wait for a connection. This is mainly used for
debugging when ftpd isn't started by inetd.
--ll Each successful and failed ftp(1) session is logged using syslog
with a facility of LOG_FTP. If this option is specified twice,
the retrieve (get), store (put), append, delete, make directory,
remove directory and rename operations and their filename argu-
ments are also logged.
--pp Use _p_o_r_t (a service name or number) instead of the default
_f_t_p_/_t_c_p.
--TT A client may also request a different timeout period; the maximum
period allowed may be set to _t_i_m_e_o_u_t seconds with the --TT option.
The default limit is 2 hours.
--tt The inactivity timeout period is set to _t_i_m_e_o_u_t seconds (the de-
fault is 15 minutes).
--uu Set the initial umask to something else than the default 027.
--vv Verbose mode.
--BB, ----bbuuiillttiinn--llss
use built-in ls to list files
----ggoooodd--cchhaarrss==_s_t_r_i_n_g
allowed anonymous upload filename chars
The file _/_e_t_c_/_n_o_l_o_g_i_n can be used to disable ftp access. If the file ex-
ists, ffttppdd displays it and exits. If the file _/_e_t_c_/_f_t_p_w_e_l_c_o_m_e exists,
ffttppdd prints it before issuing the ``ready'' message. If the file
_/_e_t_c_/_m_o_t_d exists, ffttppdd prints it after a successful login.
The ftp server currently supports the following ftp requests. The case
of the requests is ignored.
Request Description
ABOR abort previous command
ACCT specify account (ignored)
ALLO allocate storage (vacuously)
APPE append to a file
CDUP change to parent of current working directory
CWD change working directory
DELE delete a file
HELP give help information
LIST give list files in a directory (``ls -lgA'')
MKD make a directory
MDTM show last modification time of file
MODE specify data transfer _m_o_d_e
NLST give name list of files in directory
NOOP do nothing
PASS specify password
PASV prepare for server-to-server transfer
PORT specify data connection port
PWD print the current working directory
QUIT terminate session
REST restart incomplete transfer
RETR retrieve a file
RMD remove a directory
RNFR specify rename-from file name
RNTO specify rename-to file name
SITE non-standard commands (see next section)
SIZE return size of file
STAT return status of server
STOR store a file
STOU store a file with a unique name
STRU specify data transfer _s_t_r_u_c_t_u_r_e
SYST show operating system type of server system
TYPE specify data transfer _t_y_p_e
USER specify user name
XCUP change to parent of current working directory
(deprecated)
XCWD change working directory (deprecated)
XMKD make a directory (deprecated)
XPWD print the current working directory (deprecated)
XRMD remove a directory (deprecated)
The following commands are specified by RFC2228.
AUTH authentication/security mechanism
ADAT authentication/security data
PROT data channel protection level
PBSZ protection buffer size
MIC integrity protected command
CONF confidentiality protected command
ENC privacy protected command
CCC clear command channel
The following non-standard or UNIX specific commands are supported by the
SITE request.
UMASK change umask, (e.g. SSIITTEE UUMMAASSKK 000022)
IDLE set idle-timer, (e.g. SSIITTEE IIDDLLEE 6600)
CHMOD change mode of a file (e.g. SSIITTEE CCHHMMOODD 775555 ffiilleennaammee)
FIND quickly find a specific file with GNU locate(1).
HELP give help information.
The following Kerberos related site commands are understood.
KAUTH obtain remote tickets.
KLIST show remote tickets
The remaining ftp requests specified in Internet RFC 959 are recognized,
but not implemented. MDTM and SIZE are not specified in RFC 959, but
will appear in the next updated FTP RFC.
The ftp server will abort an active file transfer only when the ABOR com-
mand is preceded by a Telnet "Interrupt Process" (IP) signal and a Telnet
"Synch" signal in the command Telnet stream, as described in Internet RFC
959. If a STAT command is received during a data transfer, preceded by a
Telnet IP and Synch, transfer status will be returned.
FFttppdd interprets file names according to the ``globbing'' conventions used
by csh(1). This allows users to utilize the metacharacters ``*?[]{}~''.
FFttppdd authenticates users according to these rules.
1. If Kerberos authentication is used, the user must pass valid
tickets and the principal must be allowed to login as the re-
mote user.
2. The login name must be in the password data base, and not have
a null password (if kerberos is used the password field is not
checked). In this case a password must be provided by the
client before any file operations may be performed. If the
user has an OTP key, the response from a successful USER com-
mand will include an OTP challenge. The client may choose to
respond with a PASS command giving either a standard password
or an OTP one-time password. The server will automatically de-
termine which type of password it has been given and attempt
to authenticate accordingly. See otp(1) for more information
on OTP authentication.
3. The login name must not appear in the file _/_e_t_c_/_f_t_p_u_s_e_r_s.
4. The user must have a standard shell returned by
getusershell(3).
5. If the user name appears in the file _/_e_t_c_/_f_t_p_c_h_r_o_o_t the ses-
sion's root will be changed to the user's login directory by
chroot(2) as for an ``anonymous'' or ``ftp'' account (see next
item). However, the user must still supply a password. This
feature is intended as a compromise between a fully anonymous
account and a fully privileged account. The account should
also be set up as for an anonymous account.
6. If the user name is ``anonymous'' or ``ftp'', an anonymous ftp
account must be present in the password file (user ``ftp'').
In this case the user is allowed to log in by specifying any
password (by convention an email address for the user should
be used as the password).
In the last case, ffttppdd takes special measures to restrict the client's
access privileges. The server performs a chroot(2) to the home directory
of the ``ftp'' user. In order that system security is not breached, it
is recommended that the ``ftp'' subtree be constructed with care, consid-
er following these guidelines for anonymous ftp.
In general all files should be owned by ``root'', and have non-write per-
missions (644 or 755 depending on the kind of file). No files should be
owned or writable by ``ftp'' (possibly with exception for the
_~_f_t_p_/_i_n_c_o_m_i_n_g, as specified below).
_~_f_t_p The ``ftp'' homedirectory should be owned by root.
_~_f_t_p_/_b_i_n The directory for external programs (such as ls(1)).
These programs must either be statically linked, or you
must setup an environment for dynamic linking when run-
ning chrooted. These programs will be used if present:
ls Used when listing files.
compress
When retrieving a filename that ends in _._Z,
and that file isn't present, ffttppdd will try
to find the filename without _._Z and com-
press it on the fly.
gzip Same as compress, just with files ending in
_._g_z.
gtar Enables retrieval of whole directories as
files ending in _._t_a_r. Can also be combined
with compression. You must use GNU Tar (or
some other that supports the --zz and --ZZ
flags).
locate Will enable ``fast find'' with the SSIITTEE
FFIINNDD command. You must also create a
_l_o_c_a_t_e_d_b file in _~_f_t_p_/_e_t_c.
_~_f_t_p_/_e_t_c If you put copies of the passwd(5) and group(5) files
here, ls will be able to produce owner names rather than
numbers. Remember to remove any passwords from these
files.
The file _m_o_t_d, if present, will be printed after a suc-
cessful login.
_~_f_t_p_/_d_e_v Put a copy of /dev/null(7) here.
_~_f_t_p_/_p_u_b Traditional place to put whatever you want to make pub-
lic.
If you want guests to be able to upload files, create a _~_f_t_p_/_i_n_c_o_m_i_n_g di-
rectory owned by ``root'', and group ``ftp'' with mode 730 (make sure
``ftp'' is member of group ``ftp''). The following restrictions apply to
anonymous users:
++oo Directories created will have mode 700.
++oo Uploaded files will be created with an umask of 777, if not changed
with the --gg option.
++oo These command are not accessible: DDEELLEE, RRMMDD, RRNNTTOO, RRNNFFRR, SSIITTEE UUMMAASSKK,
and SSIITTEE CCHHMMOODD.
++oo Filenames must start with an alpha-numeric character, and consist of
alpha-numeric characters or any of the following: + (plus), - (mi-
nus), = (equal), _ (underscore), . (period), and , (comma).
FFIILLEESS
/etc/ftpusers Access list for users.
/etc/ftpchroot List of normal users who should be chroot'd.
/etc/ftpwelcome Welcome notice.
/etc/motd Welcome notice after login.
/etc/nologin Displayed and access refused.
~/.klogin Login access for Kerberos.
SSEEEE AALLSSOO
ftp(1), otp(1), getusershell(3), ftpusers(5), syslogd(8),
SSTTAANNDDAARRDDSS
RRFFCC 995599 FTP PROTOCOL SPECIFICATION
RRFFCC 11993388 OTP Specification
RRFFCC 22222288 FTP Security Extensions.
BBUUGGSS
The server must run as the super-user to create sockets with privileged
port numbers. It maintains an effective user id of the logged in user,
reverting to the super-user only when binding addresses to sockets. The
possible security holes have been extensively scrutinized, but are possi-
bly incomplete.
HHIISSTTOORRYY
The ffttppdd command appeared in 4.2BSD.
4.2 Berkeley Distribution April 19, 1997 5
@@ -1,27 +0,0 @@
FTPUSERS(5) UNIX Programmer's Manual FTPUSERS(5)
NNAAMMEE
_/_e_t_c_/_f_t_p_u_s_e_r_s - FTP access list file
DDEESSCCRRIIPPTTIIOONN
_/_e_t_c_/_f_t_p_u_s_e_r_s contains a list of users that should be allowed or denied
FTP access. Each line contains a user, optionally followed by ``allow''
(anything but ``allow'' is ignored). The semi-user ``*'' matches any us-
er. Users that has an explicit ``allow'', or that does not match any
line, are allowed access. Anyone else is denied access.
Note that this is compatible with the old format, where this file con-
tained a list of users that should be denied access.
EEXXAAMMPPLLEESS
This will deny anyone but ``foo'' and ``bar'' to use FTP:
foo allow
bar allow
*
SSEEEE AALLSSOO
ftpd(8)
KTH-KRB May 7, 1997 1
-46
View File
@@ -1,46 +0,0 @@
KF(1) UNIX Reference Manual KF(1)
NNAAMMEE
kkff - securly forward tickets
SSYYNNOOPPSSIISS
kkff [--pp _p_o_r_t | ----ppoorrtt=_p_o_r_t] [--ll _l_o_g_i_n | ----llooggiinn=_l_o_g_i_n] [--cc _c_c_a_c_h_e |
----ccccaacchhee=_c_c_a_c_h_e] [--FF | ----ffoorrwwaarrddaabbllee] [--GG | ----nnoo--ffoorrwwaarrddaabbllee] [--hh |
----hheellpp] [----vveerrssiioonn] _h_o_s_t _._._.
DDEESSCCRRIIPPTTIIOONN
The kkff program forwards tickets to a remove host through an authenticated
and encrypted stream. Options supported are:
--pp _p_o_r_t, ----ppoorrtt=_p_o_r_t
port to connect to
--ll _l_o_g_i_n, ----llooggiinn=_l_o_g_i_n
remote login name
--cc _c_c_a_c_h_e, ----ccccaacchhee=_c_c_a_c_h_e
remote cred cache
--FF, ----ffoorrwwaarrddaabbllee
forward forwardable credentials
--GG, ----nnoo--ffoorrwwaarrddaabbllee
do not forward forwardable credentials
--hh, ----hheellpp
----vveerrssiioonn
kkff is useful when you do not want to enter your password on a remote host
but want to have your tickets one for example afs.
In order for kkff to work you will need to acquire your initial ticket with
forwardable flag, ie kkiinniitt ----ffoorrwwaarrddaabbllee.
tteellnneett is able to forward ticket by itself.
SSEEEE AALLSSOO
kinit(1), telnet(1), kfd(8)
Heimdal July 2, 2000 1
-31
View File
@@ -1,31 +0,0 @@
KFD(8) UNIX System Manager's Manual KFD(8)
NNAAMMEE
kkffdd - receive forwarded tickets
SSYYNNOOPPSSIISS
kkffdd [--pp _p_o_r_t | ----ppoorrtt=_p_o_r_t] [--ii | ----iinneettdd] [--RR _r_e_g_p_a_g | ----rreeggppaagg=_r_e_g_p_a_g]
[--hh | ----hheellpp] [----vveerrssiioonn]
DDEESSCCRRIIPPTTIIOONN
This is the daemon for kf(1). Supported options:
--pp _p_o_r_t, ----ppoorrtt=_p_o_r_t
port to listen to
--ii, ----iinneettdd
not started from inetd
--RR _r_e_g_p_a_g, ----rreeggppaagg==_r_e_g_p_a_g
path to regpag binary
EEXXAAMMPPLLEESS
Put the following in _/_e_t_c_/_i_n_e_t_d_._c_o_n_f:
kf stream tcp nowait root /usr/heimdal/libexec/kfd kfd
SSEEEE AALLSSOO
kf(1)
Heimdal July 2, 2000 1
-17
View File
@@ -1,17 +0,0 @@
PFROM(1) UNIX Reference Manual PFROM(1)
NNAAMMEE
ppffrroomm - fetch a list of the current mail via POP
SSYYNNOOPPSSIISS
ppffrroomm [--44 | ----kkrrbb44] [--55 | ----kkrrbb55] [--vv | ----vveerrbboossee] [--cc | ----ccoouunntt]
[----hheeaaddeerr] [--pp _p_o_r_t_-_s_p_e_c | ----ppoorrtt==_p_o_r_t_-_s_p_e_c]
DDEESSCCRRIIPPTTIIOONN
ppffrroomm is a script that does push --from.
SSEEEE AALLSSOO
push(8)
HEIMDAL Mars 4, 2000 1
-77
View File
@@ -1,77 +0,0 @@
PUSH(8) UNIX System Manager's Manual PUSH(8)
NNAAMMEE
ppuusshh - fetch mail via POP
SSYYNNOOPPSSIISS
ppuusshh [--44 | ----kkrrbb44] [--55 | ----kkrrbb55] [--vv | ----vveerrbboossee] [--ff | ----ffoorrkk] [--ll |
----lleeaavvee] [----ffrroomm] [--cc | ----ccoouunntt] [----hheeaaddeerrss=_h_e_a_d_e_r_s] [--pp _p_o_r_t_-_s_p_e_c |
----ppoorrtt=_p_o_r_t_-_s_p_e_c] _p_o_-_b_o_x _f_i_l_e_n_a_m_e
DDEESSCCRRIIPPTTIIOONN
ppuusshh retrieves mail from the post office box _p_o_-_b_o_x, and stores the mail
in mbox format in _f_i_l_e_n_a_m_e. The _p_o_-_b_o_x can have any of the following for-
mats:
`hostname:username'
`po:hostname:username'
`username@hostname'
`po:username@hostname'
`hostname'
`po:username'
If no username is specified, ppuusshh assumes that it's the same as on the
local machine; _h_o_s_t_n_a_m_e defaults to the value of the MAILHOST environment
variable.
Supported options:
--44, ----kkrrbb44
use Kerberos 4 (if compiled with support for Kerberos 4)
--55, ----kkrrbb55
use Kerberos 5 (if compiled with support for Kerberos 5)
--ff, ----ffoorrkk
fork before starting to delete messages
--ll, ----lleeaavvee
don't delete fetched mail
----ffrroomm behave like from.
--cc, ----ccoouunntt
first print how many messages and bytes there are.
----hheeaaddeerrss=_h_e_a_d_e_r_s
a list of comma-separated headers that should get printed.
--pp _p_o_r_t_-_s_p_e_c, ----ppoorrtt=_p_o_r_t_-_s_p_e_c
use this port instead of the default `kpop' or `1109'.
The default is to first try Kerberos 5 authentication and then, if that
fails, Kerberos 4.
EENNVVIIRROONNMMEENNTT
MAILHOST
points to the post office, if no other hostname is specified.
EEXXAAMMPPLLEESS
$ push cornfield:roosta ~/.emacs-mail-crash-box
tries to fetch mail for the user _r_o_o_s_t_a from the post office at
``cornfield'', and stores the mail in _~_/_._e_m_a_c_s_-_m_a_i_l_-_c_r_a_s_h_-_b_o_x (you are
using Gnus, aren't you?)
$ push --from -5 havregryn
tries to fetch FFrroomm:: lines for current user at post office ``havregryn''
using Kerberos 5.
SSEEEE AALLSSOO
movemail(8), popper(8), from(1), pfrom(1)
HHIISSTTOORRYY
ppuusshh was written while waiting for mmoovveemmaaiill to finish getting the mail.
HEIMDAL May 31, 1998 2
@@ -1,718 +0,0 @@
TELNET(1) UNIX Reference Manual TELNET(1)
NNAAMMEE
tteellnneett - user interface to the TELNET protocol
SSYYNNOOPPSSIISS
tteellnneett [--7788EEFFKKLLaaccddffrrxx] [--SS _t_o_s] [--XX _a_u_t_h_t_y_p_e] [--ee _e_s_c_a_p_e_c_h_a_r] [--kk _r_e_a_l_m]
[--ll _u_s_e_r] [--nn _t_r_a_c_e_f_i_l_e] [_h_o_s_t [port]]
DDEESSCCRRIIPPTTIIOONN
The tteellnneett command is used to communicate with another host using the
TELNET protocol. If tteellnneett is invoked without the _h_o_s_t argument, it en-
ters command mode, indicated by its prompt (tteellnneett>>). In this mode, it
accepts and executes the commands listed below. If it is invoked with
arguments, it performs an ooppeenn command with those arguments.
Options:
--88 Specifies an 8-bit data path. This causes an attempt to negoti-
ate the TELNET BINARY option on both input and output.
--77 Do not try to negotiate TELNET BINARY option.
--EE Stops any character from being recognized as an escape character.
--FF If Kerberos V5 authentication is being used, the --FF option allows
the local credentials to be forwarded to the remote system, in-
cluding any credentials that have already been forwarded into the
local environment.
--KK Specifies no automatic login to the remote system.
--LL Specifies an 8-bit data path on output. This causes the BINARY
option to be negotiated on output.
--SS _t_o_s Sets the IP type-of-service (TOS) option for the telnet connec-
tion to the value _t_o_s, which can be a numeric TOS value or, on
systems that support it, a symbolic TOS name found in the
/etc/iptos file.
--XX _a_t_y_p_e
Disables the _a_t_y_p_e type of authentication.
--aa Attempt automatic login. Currently, this sends the user name via
the USER variable of the ENVIRON option if supported by the re-
mote system. The name used is that of the current user as re-
turned by getlogin(2) if it agrees with the current user ID, oth-
erwise it is the name associated with the user ID.
--cc Disables the reading of the user's _._t_e_l_n_e_t_r_c file. (See the
ttooggggllee sskkiipprrcc command on this man page.)
--dd Sets the initial value of the ddeebbuugg toggle to TRUE
--ee _e_s_c_a_p_e _c_h_a_r
Sets the initial tteellnneett tteellnneett escape character to _e_s_c_a_p_e _c_h_a_r.
If _e_s_c_a_p_e _c_h_a_r is omitted, then there will be no escape charac-
ter.
--ff If Kerberos V5 authentication is being used, the --ff option allows
the local credentials to be forwarded to the remote system.
--kk _r_e_a_l_m
If Kerberos authentication is being used, the --kk option requests
that telnet obtain tickets for the remote host in realm realm in-
stead of the remote host's realm, as determined by
krb_realmofhost(3).
--ll _u_s_e_r
When connecting to the remote system, if the remote system under-
stands the ENVIRON option, then _u_s_e_r will be sent to the remote
system as the value for the variable USER. This option implies
the --aa option. This option may also be used with the ooppeenn com-
mand.
--nn _t_r_a_c_e_f_i_l_e
Opens _t_r_a_c_e_f_i_l_e for recording trace information. See the sseett
ttrraacceeffiillee command below.
--rr Specifies a user interface similar to rlogin(1). In this mode,
the escape character is set to the tilde (~) character, unless
modified by the -e option.
--xx Turns on encryption of the data stream if possible. This is cur-
rently the default and when it fails a warning is issued.
_h_o_s_t Indicates the official name, an alias, or the Internet address of
a remote host.
_p_o_r_t Indicates a port number (address of an application). If a number
is not specified, the default tteellnneett port is used.
When in rlogin mode, a line of the form ~. disconnects from the remote
host; ~ is the telnet escape character. Similarly, the line ~^Z suspends
the telnet session. The line ~^] escapes to the normal telnet escape
prompt.
Once a connection has been opened, tteellnneett will attempt to enable the
TELNET LINEMODE option. If this fails, then tteellnneett will revert to one of
two input modes: either ``character at a time'' or ``old line by line''
depending on what the remote system supports.
When LINEMODE is enabled, character processing is done on the local sys-
tem, under the control of the remote system. When input editing or char-
acter echoing is to be disabled, the remote system will relay that infor-
mation. The remote system will also relay changes to any special charac-
ters that happen on the remote system, so that they can take effect on
the local system.
In ``character at a time'' mode, most text typed is immediately sent to
the remote host for processing.
In ``old line by line'' mode, all text is echoed locally, and (normally)
only completed lines are sent to the remote host. The ``local echo char-
acter'' (initially ``^E'') may be used to turn off and on the local echo
(this would mostly be used to enter passwords without the password being
echoed).
If the LINEMODE option is enabled, or if the llooccaallcchhaarrss toggle is TRUE
(the default for ``old line by line``; see below), the user's qquuiitt, iinnttrr,
and fflluusshh characters are trapped locally, and sent as TELNET protocol se-
quences to the remote side. If LINEMODE has ever been enabled, then the
user's ssuusspp and eeooff are also sent as TELNET protocol sequences, and qquuiitt
is sent as a TELNET ABORT instead of BREAK There are options (see ttooggggllee
aauuttoofflluusshh and ttooggggllee aauuttoossyynncchh below) which cause this action to flush
subsequent output to the terminal (until the remote host acknowledges the
TELNET sequence) and flush previous terminal input (in the case of qquuiitt
and iinnttrr).
While connected to a remote host, tteellnneett command mode may be entered by
typing the tteellnneett ``escape character'' (initially ``^]''). When in com-
mand mode, the normal terminal editing conventions are available.
The following tteellnneett commands are available. Only enough of each command
to uniquely identify it need be typed (this is also true for arguments to
the mmooddee, sseett, ttooggggllee, uunnsseett, ssllcc, eennvviirroonn, and ddiissppllaayy commands).
aauutthh _a_r_g_u_m_e_n_t _._._.
The auth command manipulates the information sent through the
TELNET AUTHENTICATE option. Valid arguments for the auth com-
mand are as follows:
ddiissaabbllee _t_y_p_e Disables the specified type of authentication.
To obtain a list of available types, use the
aauutthh ddiissaabbllee ?? command.
eennaabbllee _t_y_p_e Enables the specified type of authentication.
To obtain a list of available types, use the
aauutthh eennaabbllee ?? command.
ssttaattuuss Lists the current status of the various types of
authentication.
cclloossee Close a TELNET session and return to command mode.
ddiissppllaayy _a_r_g_u_m_e_n_t _._._.
Displays all, or some, of the sseett and ttooggggllee values (see be-
low).
eennccrryypptt _a_r_g_u_m_e_n_t _._._.
The encrypt command manipulates the information sent through
the TELNET ENCRYPT option.
Note: Because of export controls, the TELNET ENCRYPT option
is not supported outside of the United States and Canada.
Valid arguments for the encrypt command are as follows:
ddiissaabbllee _t_y_p_e [iinnppuutt | oouuttppuutt]
Disables the specified type of encryption. If
you omit the input and output, both input and
output are disabled. To obtain a list of avail-
able types, use the eennccrryypptt ddiissaabbllee ?? command.
eennaabbllee _t_y_p_e [iinnppuutt | oouuttppuutt]
Enables the specified type of encryption. If
you omit input and output, both input and output
are enabled. To obtain a list of available
types, use the eennccrryypptt eennaabbllee ?? command.
iinnppuutt This is the same as the eennccrryypptt ssttaarrtt iinnppuutt com-
mand.
--iinnppuutt This is the same as the eennccrryypptt ssttoopp iinnppuutt com-
mand.
oouuttppuutt This is the same as the eennccrryypptt ssttaarrtt oouuttppuutt
command.
--oouuttppuutt This is the same as the eennccrryypptt ssttoopp oouuttppuutt com-
mand.
ssttaarrtt [iinnppuutt | oouuttppuutt]
Attempts to start encryption. If you omit iinnppuutt
and oouuttppuutt, both input and output are enabled.
To obtain a list of available types, use the
eennccrryypptt eennaabbllee ?? command.
ssttaattuuss Lists the current status of encryption.
ssttoopp [iinnppuutt | oouuttppuutt]
Stops encryption. If you omit input and output,
encryption is on both input and output.
ttyyppee _t_y_p_e Sets the default type of encryption to be used
with later eennccrryypptt ssttaarrtt or eennccrryypptt ssttoopp com-
mands.
eennvviirroonn _a_r_g_u_m_e_n_t_s _._._.
The eennvviirroonn command is used to manipulate the the variables
that my be sent through the TELNET ENVIRON option. The ini-
tial set of variables is taken from the users environment,
with only the DISPLAY and PRINTER variables being exported by
default. The USER variable is also exported if the --aa or --ll
options are used.
Valid arguments for the eennvviirroonn command are:
ddeeffiinnee _v_a_r_i_a_b_l_e _v_a_l_u_e
Define the variable _v_a_r_i_a_b_l_e to have a value of
_v_a_l_u_e. Any variables defined by this command are
automatically exported. The _v_a_l_u_e may be enclosed
in single or double quotes so that tabs and spaces
may be included.
uunnddeeffiinnee _v_a_r_i_a_b_l_e
Remove _v_a_r_i_a_b_l_e from the list of environment vari-
ables.
eexxppoorrtt _v_a_r_i_a_b_l_e
Mark the variable _v_a_r_i_a_b_l_e to be exported to the
remote side.
uunneexxppoorrtt _v_a_r_i_a_b_l_e
Mark the variable _v_a_r_i_a_b_l_e to not be exported un-
less explicitly asked for by the remote side.
lliisstt List the current set of environment variables.
Those marked with a ** will be sent automatically,
other variables will only be sent if explicitly
requested.
?? Prints out help information for the eennvviirroonn com-
mand.
llooggoouutt Sends the TELNET LOGOUT option to the remote side. This com-
mand is similar to a cclloossee command; however, if the remote
side does not support the LOGOUT option, nothing happens. If,
however, the remote side does support the LOGOUT option, this
command should cause the remote side to close the TELNET con-
nection. If the remote side also supports the concept of sus-
pending a user's session for later reattachment, the logout
argument indicates that you should terminate the session imme-
diately.
mmooddee _t_y_p_e _T_y_p_e is one of several options, depending on the state of the
TELNET session. The remote host is asked for permission to go
into the requested mode. If the remote host is capable of en-
tering that mode, the requested mode will be entered.
cchhaarraacctteerr Disable the TELNET LINEMODE option, or, if the
remote side does not understand the LINEMODE op-
tion, then enter ``character at a time`` mode.
lliinnee Enable the TELNET LINEMODE option, or, if the
remote side does not understand the LINEMODE op-
tion, then attempt to enter ``old-line-by-line``
mode.
iissiigg (--iissiigg) Attempt to enable (disable) the TRAPSIG mode of
the LINEMODE option. This requires that the
LINEMODE option be enabled.
eeddiitt (--eeddiitt) Attempt to enable (disable) the EDIT mode of the
LINEMODE option. This requires that the
LINEMODE option be enabled.
ssooffttttaabbss (--ssooffttttaabbss)
Attempt to enable (disable) the SOFT_TAB mode of
the LINEMODE option. This requires that the
LINEMODE option be enabled.
lliitteecchhoo (--lliitteecchhoo)
Attempt to enable (disable) the LIT_ECHO mode of
the LINEMODE option. This requires that the
LINEMODE option be enabled.
?? Prints out help information for the mmooddee com-
mand.
ooppeenn _h_o_s_t [--ll _u_s_e_r] [[--]_p_o_r_t]
Open a connection to the named host. If no port number is
specified, tteellnneett will attempt to contact a TELNET server at
the default port. The host specification may be either a host
name (see hosts(5)) or an Internet address specified in the
``dot notation'' (see inet(3)). The [--ll] option may be used
to specify the user name to be passed to the remote system via
the ENVIRON option. When connecting to a non-standard port,
tteellnneett omits any automatic initiation of TELNET options. When
the port number is preceded by a minus sign, the initial op-
tion negotiation is done. After establishing a connection,
the file _._t_e_l_n_e_t_r_c in the users home directory is opened.
Lines beginning with a # are comment lines. Blank lines are
ignored. Lines that begin without white space are the start
of a machine entry. The first thing on the line is the name
of the machine that is being connected to. The rest of the
line, and successive lines that begin with white space are as-
sumed to be tteellnneett commands and are processed as if they had
been typed in manually to the tteellnneett command prompt.
qquuiitt Close any open TELNET session and exit tteellnneett. An end of file
(in command mode) will also close a session and exit.
sseenndd _a_r_g_u_m_e_n_t_s
Sends one or more special character sequences to the remote
host. The following are the arguments which may be specified
(more than one argument may be specified at a time):
aabboorrtt Sends the TELNET ABORT (Abort processes) sequence.
aaoo Sends the TELNET AO (Abort Output) sequence, which
should cause the remote system to flush all output
_f_r_o_m the remote system _t_o the user's terminal.
aayytt Sends the TELNET AYT (Are You There) sequence, to
which the remote system may or may not choose to re-
spond.
bbrrkk Sends the TELNET BRK (Break) sequence, which may have
significance to the remote system.
eecc Sends the TELNET EC (Erase Character) sequence, which
should cause the remote system to erase the last char-
acter entered.
eell Sends the TELNET EL (Erase Line) sequence, which
should cause the remote system to erase the line cur-
rently being entered.
eeooff Sends the TELNET EOF (End Of File) sequence.
eeoorr Sends the TELNET EOR (End of Record) sequence.
eessccaappee Sends the current tteellnneett escape character (initially
``^'').
ggaa Sends the TELNET GA (Go Ahead) sequence, which likely
has no significance to the remote system.
ggeettssttaattuuss
If the remote side supports the TELNET STATUS command,
ggeettssttaattuuss will send the subnegotiation to request that
the server send its current option status.
iipp Sends the TELNET IP (Interrupt Process) sequence,
which should cause the remote system to abort the cur-
rently running process.
nnoopp Sends the TELNET NOP (No OPeration) sequence.
ssuusspp Sends the TELNET SUSP (SUSPend process) sequence.
ssyynncchh Sends the TELNET SYNCH sequence. This sequence causes
the remote system to discard all previously typed (but
not yet read) input. This sequence is sent as TCP ur-
gent data (and may not work if the remote system is a
4.2BSD system -- if it doesn't work, a lower case
``r'' may be echoed on the terminal).
ddoo _c_m_d
ddoonntt _c_m_d
wwiillll _c_m_d
wwoonntt _c_m_d
Sends the TELNET DO _c_m_d sequence. _C_m_d can be either a
decimal number between 0 and 255, or a symbolic name
for a specific TELNET command. _C_m_d can also be either
hheellpp or ?? to print out help information, including a
list of known symbolic names.
?? Prints out help information for the sseenndd command.
sseett _a_r_g_u_m_e_n_t _v_a_l_u_e
uunnsseett _a_r_g_u_m_e_n_t _v_a_l_u_e
The sseett command will set any one of a number of tteellnneett vari-
ables to a specific value or to TRUE. The special value ooffff
turns off the function associated with the variable, this is
equivalent to using the uunnsseett command. The uunnsseett command will
disable or set to FALSE any of the specified functions. The
values of variables may be interrogated with the ddiissppllaayy com-
mand. The variables which may be set or unset, but not tog-
gled, are listed here. In addition, any of the variables for
the ttooggggllee command may be explicitly set or unset using the
sseett and uunnsseett commands.
aayytt If TELNET is in localchars mode, or LINEMODE is en-
abled, and the status character is typed, a TELNET AYT
sequence (see sseenndd aayytt preceding) is sent to the re-
mote host. The initial value for the "Are You There"
character is the terminal's status character.
eecchhoo This is the value (initially ``^E'') which, when in
``line by line'' mode, toggles between doing local
echoing of entered characters (for normal processing),
and suppressing echoing of entered characters (for en-
tering, say, a password).
eeooff If tteellnneett is operating in LINEMODE or ``old line by
line'' mode, entering this character as the first
character on a line will cause this character to be
sent to the remote system. The initial value of the
eof character is taken to be the terminal's eeooff char-
acter.
eerraassee If tteellnneett is in llooccaallcchhaarrss mode (see ttooggggllee llooccaallcchhaarrss
below), aanndd if tteellnneett is operating in ``character at a
time'' mode, then when this character is typed, a
TELNET EC sequence (see sseenndd eecc above) is sent to the
remote system. The initial value for the erase char-
acter is taken to be the terminal's eerraassee character.
eessccaappee This is the tteellnneett escape character (initially ``^['')
which causes entry into tteellnneett command mode (when con-
nected to a remote system).
fflluusshhoouuttppuutt
If tteellnneett is in llooccaallcchhaarrss mode (see ttooggggllee llooccaallcchhaarrss
below) and the fflluusshhoouuttppuutt character is typed, a
TELNET AO sequence (see sseenndd aaoo above) is sent to the
remote host. The initial value for the flush charac-
ter is taken to be the terminal's fflluusshh character.
ffoorrww11
ffoorrww22 If TELNET is operating in LINEMODE, these are the
characters that, when typed, cause partial lines to be
forwarded to the remote system. The initial value for
the forwarding characters are taken from the termi-
nal's eol and eol2 characters.
iinntteerrrruupptt
If tteellnneett is in llooccaallcchhaarrss mode (see ttooggggllee llooccaallcchhaarrss
below) and the iinntteerrrruupptt character is typed, a TELNET
IP sequence (see sseenndd iipp above) is sent to the remote
host. The initial value for the interrupt character
is taken to be the terminal's iinnttrr character.
kkiillll If tteellnneett is in llooccaallcchhaarrss mode (see ttooggggllee llooccaallcchhaarrss
below), aanndd if tteellnneett is operating in ``character at a
time'' mode, then when this character is typed, a
TELNET EL sequence (see sseenndd eell above) is sent to the
remote system. The initial value for the kill charac-
ter is taken to be the terminal's kkiillll character.
llnneexxtt If tteellnneett is operating in LINEMODE or ``old line by
line`` mode, then this character is taken to be the
terminal's llnneexxtt character. The initial value for the
lnext character is taken to be the terminal's llnneexxtt
character.
qquuiitt If tteellnneett is in llooccaallcchhaarrss mode (see ttooggggllee llooccaallcchhaarrss
below) and the qquuiitt character is typed, a TELNET BRK
sequence (see sseenndd bbrrkk above) is sent to the remote
host. The initial value for the quit character is
taken to be the terminal's qquuiitt character.
rreepprriinntt
If tteellnneett is operating in LINEMODE or ``old line by
line`` mode, then this character is taken to be the
terminal's rreepprriinntt character. The initial value for
the reprint character is taken to be the terminal's
rreepprriinntt character.
rrllooggiinn This is the rlogin escape character. If set, the nor-
mal TELNET escape character is ignored unless it is
preceded by this character at the beginning of a line.
This character, at the beginning of a line followed by
a "." closes the connection; when followed by a ^Z it
suspends the telnet command. The initial state is to
disable the rlogin escape character.
ssttaarrtt If the TELNET TOGGLE-FLOW-CONTROL option has been en-
abled, then this character is taken to be the termi-
nal's ssttaarrtt character. The initial value for the kill
character is taken to be the terminal's ssttaarrtt charac-
ter.
ssttoopp If the TELNET TOGGLE-FLOW-CONTROL option has been en-
abled, then this character is taken to be the termi-
nal's ssttoopp character. The initial value for the kill
character is taken to be the terminal's ssttoopp charac-
ter.
ssuusspp If tteellnneett is in llooccaallcchhaarrss mode, or LINEMODE is en-
abled, and the ssuussppeenndd character is typed, a TELNET
SUSP sequence (see sseenndd ssuusspp above) is sent to the re-
mote host. The initial value for the suspend charac-
ter is taken to be the terminal's ssuussppeenndd character.
ttrraacceeffiillee
This is the file to which the output, caused by
nneettddaattaa or ooppttiioonn tracing being TRUE, will be written.
If it is set to ``--'', then tracing information will
be written to standard output (the default).
wwoorrddeerraassee
If tteellnneett is operating in LINEMODE or ``old line by
line`` mode, then this character is taken to be the
terminal's wwoorrddeerraassee character. The initial value for
the worderase character is taken to be the terminal's
wwoorrddeerraassee character.
?? Displays the legal sseett (uunnsseett) commands.
ssllcc _s_t_a_t_e The ssllcc command (Set Local Characters) is used to set or
change the state of the the special characters when the TELNET
LINEMODE option has been enabled. Special characters are
characters that get mapped to TELNET commands sequences (like
iipp or qquuiitt) or line editing characters (like eerraassee and kkiillll).
By default, the local special characters are exported.
cchheecckk Verify the current settings for the current spe-
cial characters. The remote side is requested to
send all the current special character settings,
and if there are any discrepancies with the local
side, the local side will switch to the remote
value.
eexxppoorrtt Switch to the local defaults for the special char-
acters. The local default characters are those of
the local terminal at the time when tteellnneett was
started.
iimmppoorrtt Switch to the remote defaults for the special
characters. The remote default characters are
those of the remote system at the time when the
TELNET connection was established.
?? Prints out help information for the ssllcc command.
ssttaattuuss Show the current status of tteellnneett. This includes the peer one
is connected to, as well as the current mode.
ttooggggllee _a_r_g_u_m_e_n_t_s _._._.
Toggle (between TRUE and FALSE) various flags that control how
tteellnneett responds to events. These flags may be set explicitly
to TRUE or FALSE using the sseett and uunnsseett commands listed
above. More than one argument may be specified. The state of
these flags may be interrogated with the ddiissppllaayy command.
Valid arguments are:
aauutthhddeebbuugg Turns on debugging information for the authenti-
cation code.
aauuttoofflluusshh If aauuttoofflluusshh and llooccaallcchhaarrss are both TRUE, then
when the aaoo, or qquuiitt characters are recognized
(and transformed into TELNET sequences; see sseett
above for details), tteellnneett refuses to display
any data on the user's terminal until the remote
system acknowledges (via a TELNET TIMING MARK
option) that it has processed those TELNET se-
quences. The initial value for this toggle is
TRUE if the terminal user had not done an "stty
noflsh", otherwise FALSE (see stty(1)).
aauuttooddeeccrryypptt When the TELNET ENCRYPT option is negotiated, by
default the actual encryption (decryption) of
the data stream does not start automatically.
The autoencrypt (autodecrypt) command states
that encryption of the output (input) stream
should be enabled as soon as possible.
Note: Because of export controls, the TELNET
ENCRYPT option is not supported outside the
United States and Canada.
aauuttoollooggiinn If the remote side supports the TELNET
AUTHENTICATION option TELNET attempts to use it
to perform automatic authentication. If the
AUTHENTICATION option is not supported, the us-
er's login name are propagated through the
TELNET ENVIRON option. This command is the same
as specifying _a option on the ooppeenn command.
aauuttoossyynncchh If aauuttoossyynncchh and llooccaallcchhaarrss are both TRUE, then
when either the iinnttrr or qquuiitt characters is typed
(see sseett above for descriptions of the iinnttrr and
qquuiitt characters), the resulting TELNET sequence
sent is followed by the TELNET SYNCH sequence.
This procedure sshhoouulldd cause the remote system to
begin throwing away all previously typed input
until both of the TELNET sequences have been
read and acted upon. The initial value of this
toggle is FALSE.
bbiinnaarryy Enable or disable the TELNET BINARY option on
both input and output.
iinnbbiinnaarryy Enable or disable the TELNET BINARY option on
input.
oouuttbbiinnaarryy Enable or disable the TELNET BINARY option on
output.
ccrrllff If this is TRUE, then carriage returns will be
sent as <CR><LF>. If this is FALSE, then car-
riage returns will be send as <CR><NUL>. The
initial value for this toggle is FALSE.
ccrrmmoodd Toggle carriage return mode. When this mode is
enabled, most carriage return characters re-
ceived from the remote host will be mapped into
a carriage return followed by a line feed. This
mode does not affect those characters typed by
the user, only those received from the remote
host. This mode is not very useful unless the
remote host only sends carriage return, but nev-
er line feed. The initial value for this toggle
is FALSE.
ddeebbuugg Toggles socket level debugging (useful only to
the ssuuppeerr uusseerr). The initial value for this tog-
gle is FALSE.
eennccddeebbuugg Turns on debugging information for the encryp-
tion code.
llooccaallcchhaarrss If this is TRUE, then the fflluusshh, iinntteerrrruupptt,
qquuiitt, eerraassee, and kkiillll characters (see sseett above)
are recognized locally, and transformed into
(hopefully) appropriate TELNET control sequences
(respectively aaoo, iipp, bbrrkk, eecc, and eell; see sseenndd
above). The initial value for this toggle is
TRUE in ``old line by line'' mode, and FALSE in
``character at a time'' mode. When the LINEMODE
option is enabled, the value of llooccaallcchhaarrss is
ignored, and assumed to always be TRUE. If
LINEMODE has ever been enabled, then qquuiitt is
sent as aabboorrtt, and eeooff and ssuussppeenndd are sent as
eeooff and ssuusspp, see sseenndd above).
nneettddaattaa Toggles the display of all network data (in hex-
adecimal format). The initial value for this
toggle is FALSE.
ooppttiioonnss Toggles the display of some internal tteellnneett pro-
tocol processing (having to do with TELNET op-
tions). The initial value for this toggle is
FALSE.
pprreettttyydduummpp When the nneettddaattaa toggle is enabled, if
pprreettttyydduummpp is enabled the output from the
nneettddaattaa command will be formatted in a more user
readable format. Spaces are put between each
character in the output, and the beginning of
any TELNET escape sequence is preceded by a '*'
to aid in locating them.
sskkiipprrcc When the skiprc toggle is TRUE, TELNET skips the
reading of the _._t_e_l_n_e_t_r_c file in the users home
directory when connections are opened. The ini-
tial value for this toggle is FALSE.
tteerrmmddaattaa Toggles the display of all terminal data (in
hexadecimal format). The initial value for this
toggle is FALSE.
vveerrbboossee__eennccrryypptt
When the vveerrbboossee__eennccrryypptt toggle is TRUE, TELNET
prints out a message each time encryption is en-
abled or disabled. The initial value for this
toggle is FALSE. Note: Because of export con-
trols, data encryption is not supported outside
of the United States and Canada.
?? Displays the legal ttooggggllee commands.
zz Suspend tteellnneett. This command only works when the user is using
the csh(1).
!! [_c_o_m_m_a_n_d]
Execute a single command in a subshell on the local system.
If ccoommmmaanndd is omitted, then an interactive subshell is in-
voked.
?? [_c_o_m_m_a_n_d]
Get help. With no arguments, tteellnneett prints a help summary.
If a command is specified, tteellnneett will print the help informa-
tion for just that command.
EENNVVIIRROONNMMEENNTT
TTeellnneett uses at least the HOME, SHELL, DISPLAY, and TERM environment vari-
ables. Other environment variables may be propagated to the other side
via the TELNET ENVIRON option.
FFIILLEESS
~/.telnetrc user customized telnet startup values
HHIISSTTOORRYY
The TTeellnneett command appeared in 4.2BSD.
NNOOTTEESS
On some remote systems, echo has to be turned off manually when in ``old
line by line'' mode.
In ``old line by line'' mode or LINEMODE the terminal's eeooff character is
only recognized (and sent to the remote system) when it is the first
character on a line.
4.2 Berkeley Distribution June 1, 1994 11
@@ -1,297 +0,0 @@
TELNETD(8) UNIX System Manager's Manual TELNETD(8)
NNAAMMEE
tteellnneettdd - DARPA TELNET protocol server
SSYYNNOOPPSSIISS
tteellnneettdd [--BBUUhhkkllnn] [--DD _d_e_b_u_g_m_o_d_e] [--SS _t_o_s] [--XX _a_u_t_h_t_y_p_e] [--aa _a_u_t_h_m_o_d_e]
[--rr_l_o_w_p_t_y_-_h_i_g_h_p_t_y] [--uu _l_e_n] [--ddeebbuugg] [--LL _/_b_i_n_/_l_o_g_i_n] [_p_o_r_t]
DDEESSCCRRIIPPTTIIOONN
The tteellnneettdd command is a server which supports the DARPA standard TELNET
virtual terminal protocol. TTeellnneettdd is normally invoked by the internet
server (see inetd(8)) for requests to connect to the TELNET port as in-
dicated by the _/_e_t_c_/_s_e_r_v_i_c_e_s file (see services(5)). The --ddeebbuugg option
may be used to start up tteellnneettdd manually, instead of through inetd(8).
If started up this way, _p_o_r_t may be specified to run tteellnneettdd on an alter-
nate TCP port number.
The tteellnneettdd command accepts the following options:
--aa _a_u_t_h_m_o_d_e This option may be used for specifying what mode should be
used for authentication. Note that this option is only use-
ful if tteellnneettdd has been compiled with support for the
AUTHENTICATION option. There are several valid values for
_a_u_t_h_m_o_d_e:
debug Turns on authentication debugging code.
user Only allow connections when the remote user can pro-
vide valid authentication information to identify the
remote user, and is allowed access to the specified
account without providing a password.
valid Only allow connections when the remote user can pro-
vide valid authentication information to identify the
remote user. The login(1) command will provide any
additional user verification needed if the remote us-
er is not allowed automatic access to the specified
account.
other Only allow connections that supply some authentica-
tion information. This option is currently not sup-
ported by any of the existing authentication mecha-
nisms, and is thus the same as specifying --aa vvaalliidd.
otp Only allow authenticated connections (as with --aa
uusseerr) and also logins with one-time passwords (OTPs).
This option will call login with an option so that
only OTPs are accepted. The user can of course still
type secret information at the prompt.
none This is the default state. Authentication informa-
tion is not required. If no or insufficient authen-
tication information is provided, then the login(1)
program will provide the necessary user verification.
off This disables the authentication code. All user ver-
ification will happen through the login(1) program.
--BB Ignored.
--DD _d_e_b_u_g_m_o_d_e
This option may be used for debugging purposes. This allows
tteellnneettdd to print out debugging information to the connec-
tion, allowing the user to see what tteellnneettdd is doing. There
are several possible values for _d_e_b_u_g_m_o_d_e:
ooppttiioonnss Prints information about the negotiation of TELNET
options.
rreeppoorrtt Prints the ooppttiioonnss information, plus some addi-
tional information about what processing is going
on.
nneettddaattaa Displays the data stream received by tteellnneettdd.
ppttyyddaattaa Displays data written to the pty.
eexxeerrcciissee Has not been implemented yet.
--hh Disables the printing of host-specific information before
login has been completed.
--kk
--ll Ignored.
--nn Disable TCP keep-alives. Normally tteellnneettdd enables the TCP
keep-alive mechanism to probe connections that have been
idle for some period of time to determine if the client is
still there, so that idle connections from machines that
have crashed or can no longer be reached may be cleaned up.
--rr _l_o_w_p_t_y_-_h_i_g_h_p_t_y
This option is only enabled when tteellnneettdd is compiled for
UNICOS. It specifies an inclusive range of pseudo-terminal
devices to use. If the system has sysconf variable
_SC_CRAY_NPTY configured, the default pty search range is 0
to _SC_CRAY_NPTY; otherwise, the default range is 0 to 128.
Either _l_o_w_p_t_y or _h_i_g_h_p_t_y may be omitted to allow changing
either end of the search range. If _l_o_w_p_t_y is omitted, the -
character is still required so that tteellnneettdd can differenti-
ate _h_i_g_h_p_t_y from _l_o_w_p_t_y.
--SS _t_o_s
--uu _l_e_n This option is used to specify the size of the field in the
utmp structure that holds the remote host name. If the re-
solved host name is longer than _l_e_n, the dotted decimal val-
ue will be used instead. This allows hosts with very long
host names that overflow this field to still be uniquely
identified. Specifying --uu00 indicates that only dotted deci-
mal addresses should be put into the _u_t_m_p file.
--UU This option causes tteellnneettdd to refuse connections from ad-
dresses that cannot be mapped back into a symbolic name via
the gethostbyaddr(3) routine.
--XX _a_u_t_h_t_y_p_e This option is only valid if tteellnneettdd has been built with
support for the authentication option. It disables the use
of _a_u_t_h_t_y_p_e authentication, and can be used to temporarily
disable a specific authentication type without having to re-
compile tteellnneettdd.
--LL --ppaatthhnnaammee
Specify pathname to an alternative login program.
TTeellnneettdd operates by allocating a pseudo-terminal device (see pty(4)) for
a client, then creating a login process which has the slave side of the
pseudo-terminal as stdin, stdout and stderr. TTeellnneettdd manipulates the mas-
ter side of the pseudo-terminal, implementing the TELNET protocol and
passing characters between the remote client and the login process.
When a TELNET session is started up, tteellnneettdd sends TELNET options to the
client side indicating a willingness to do the following TELNET options,
which are described in more detail below:
DO AUTHENTICATION
WILL ENCRYPT
DO TERMINAL TYPE
DO TSPEED
DO XDISPLOC
DO NEW-ENVIRON
DO ENVIRON
WILL SUPPRESS GO AHEAD
DO ECHO
DO LINEMODE
DO NAWS
WILL STATUS
DO LFLOW
DO TIMING-MARK
The pseudo-terminal allocated to the client is configured to operate in
``cooked'' mode, and with XTABS and CRMOD enabled (see tty(4)).
TTeellnneettdd has support for enabling locally the following TELNET options:
WILL ECHO When the LINEMODE option is enabled, a WILL ECHO or
WONT ECHO will be sent to the client to indicate the
current state of terminal echoing. When terminal echo
is not desired, a WILL ECHO is sent to indicate that
telnetd will take care of echoing any data that needs
to be echoed to the terminal, and then nothing is
echoed. When terminal echo is desired, a WONT ECHO is
sent to indicate that telnetd will not be doing any
terminal echoing, so the client should do any terminal
echoing that is needed.
WILL BINARY Indicates that the client is willing to send a 8 bits
of data, rather than the normal 7 bits of the Network
Virtual Terminal.
WILL SGA Indicates that it will not be sending IAC GA, go
ahead, commands.
WILL STATUS Indicates a willingness to send the client, upon re-
quest, of the current status of all TELNET options.
WILL TIMING-MARK Whenever a DO TIMING-MARK command is received, it is
always responded to with a WILL TIMING-MARK
WILL LOGOUT When a DO LOGOUT is received, a WILL LOGOUT is sent in
response, and the TELNET session is shut down.
WILL ENCRYPT Only sent if tteellnneettdd is compiled with support for data
encryption, and indicates a willingness to decrypt the
data stream.
TTeellnneettdd has support for enabling remotely the following TELNET options:
DO BINARY Sent to indicate that telnetd is willing to receive an
8 bit data stream.
DO LFLOW Requests that the client handle flow control charac-
ters remotely.
DO ECHO This is not really supported, but is sent to identify
a 4.2BSD telnet(1) client, which will improperly re-
spond with WILL ECHO. If a WILL ECHO is received, a
DONT ECHO will be sent in response.
DO TERMINAL-TYPE Indicates a desire to be able to request the name of
the type of terminal that is attached to the client
side of the connection.
DO SGA Indicates that it does not need to receive IAC GA, the
go ahead command.
DO NAWS Requests that the client inform the server when the
window (display) size changes.
DO TERMINAL-SPEED Indicates a desire to be able to request information
about the speed of the serial line to which the client
is attached.
DO XDISPLOC Indicates a desire to be able to request the name of
the X windows display that is associated with the tel-
net client.
DO NEW-ENVIRON Indicates a desire to be able to request environment
variable information, as described in RFC 1572.
DO ENVIRON Indicates a desire to be able to request environment
variable information, as described in RFC 1408.
DO LINEMODE Only sent if tteellnneettdd is compiled with support for
linemode, and requests that the client do line by line
processing.
DO TIMING-MARK Only sent if tteellnneettdd is compiled with support for both
linemode and kludge linemode, and the client responded
with WONT LINEMODE. If the client responds with WILL
TM, the it is assumed that the client supports kludge
linemode. Note that the [--kk] option can be used to
disable this.
DO AUTHENTICATION Only sent if tteellnneettdd is compiled with support for au-
thentication, and indicates a willingness to receive
authentication information for automatic login.
DO ENCRYPT Only sent if tteellnneettdd is compiled with support for data
encryption, and indicates a willingness to decrypt the
data stream.
EENNVVIIRROONNMMEENNTT
FFIILLEESS
/etc/services
/etc/inittab (UNICOS systems only)
/etc/iptos (if supported)
SSEEEE AALLSSOO
telnet(1), login(1)
SSTTAANNDDAARRDDSS
RRFFCC--885544 TELNET PROTOCOL SPECIFICATION
RRFFCC--885555 TELNET OPTION SPECIFICATIONS
RRFFCC--885566 TELNET BINARY TRANSMISSION
RRFFCC--885577 TELNET ECHO OPTION
RRFFCC--885588 TELNET SUPPRESS GO AHEAD OPTION
RRFFCC--885599 TELNET STATUS OPTION
RRFFCC--886600 TELNET TIMING MARK OPTION
RRFFCC--886611 TELNET EXTENDED OPTIONS - LIST OPTION
RRFFCC--888855 TELNET END OF RECORD OPTION
RRFFCC--11007733 Telnet Window Size Option
RRFFCC--11007799 Telnet Terminal Speed Option
RRFFCC--11009911 Telnet Terminal-Type Option
RRFFCC--11009966 Telnet X Display Location Option
RRFFCC--11112233 Requirements for Internet Hosts -- Application and Support
RRFFCC--11118844 Telnet Linemode Option
RRFFCC--11337722 Telnet Remote Flow Control Option
RRFFCC--11441166 Telnet Authentication Option
RRFFCC--11441111 Telnet Authentication: Kerberos Version 4
RRFFCC--11441122 Telnet Authentication: SPX
RRFFCC--11557711 Telnet Environment Option Interoperability Issues
RRFFCC--11557722 Telnet Environment Option
BBUUGGSS
Some TELNET commands are only partially implemented.
Because of bugs in the original 4.2 BSD telnet(1), tteellnneettdd performs some
dubious protocol exchanges to try to discover if the remote client is, in
fact, a 4.2 BSD telnet(1).
Binary mode has no common interpretation except between similar operating
systems (Unix in this case).
The terminal type name received from the remote client is converted to
lower case.
TTeellnneettdd never sends TELNET IAC GA (go ahead) commands.
4.2 Berkeley Distribution June 1, 1994 5
-287
View File
@@ -1,287 +0,0 @@
@c $Id: programming.texi,v 1.2 2001/05/16 22:11:00 assar Exp $
@node Programming with Kerberos
@chapter Programming with Kerberos
First you need to know how the Kerberos model works, go read the
introduction text (@pxref{What is Kerberos?}).
@macro manpage{man, section}
@cite{\man\(\section\)}
@end macro
@menu
* Kerberos 5 API Overview::
* Walkthru a sample Kerberos 5 client::
* Validating a password in a server application::
@end menu
@node Kerberos 5 API Overview, Walkthru a sample Kerberos 5 client, Programming with Kerberos, Programming with Kerberos
@section Kerberos 5 API Overview
Most functions are documenteded in manual pages. This overview only
tries to point to where to look for a specific function.
@subsection Kerberos context
A kerberos context (@code{krb5_context}) holds all per thread state. All global variables that
are context specific are stored in this struture, including default
encryption types, credential-cache (ticket file), and default realms.
See the manual pages for @manpage{krb5_context,3} and
@manpage{krb5_init_context,3}.
@subsection Kerberos authenication context
Kerberos authentication context (@code{krb5_auth_context}) holds all
context related to an authenticated connection, in a similar way to the
kerberos context that holds the context for the thread or process.
The @code{krb5_auth_context} is used by various functions that are
directly related to authentication between the server/client. Example of
data that this structure contains are various flags, addresses of client
and server, port numbers, keyblocks (and subkeys), sequence numbers,
replay cache, and checksum types.
See the manual page for @manpage{krb5_auth_context,3}.
@subsection Keytab managment
A keytab is a storage for locally stored keys. Heimdal includes keytab
support for Kerberos 5 keytabs, Kerberos 4 srvtab, AFS-KeyFile's,
and for storing keys in memory.
See also manual page for @manpage{krb5_keytab,3}
@node Walkthru a sample Kerberos 5 client, Validating a password in a server application, Kerberos 5 API Overview, Programming with Kerberos
@section Walkthru a sample Kerberos 5 client
This example contains parts of a sample TCP Kerberos 5 clients, if you
want a real working client, please look in @file{appl/test} directory in
the Heimdal distribution.
All Kerberos error-codes that are returned from kerberos functions in
this program are passed to @code{krb5_err}, that will print a
descriptive text of the error code and exit. Graphical programs can
convert error-code to a humal readable error-string with the
@manpage{krb5_get_err_text,3} function.
Note that you should not use any Kerberos function before
@code{krb5_init_context()} have completed successfully. That is the
reson @code{err()} is used when @code{krb5_init_context()} fails.
First the client needs to call @code{krb5_init_context} to initialize
the Kerberos 5 library. This is only needed once per thread
in the program. If the function returns a non-zero value it indicates
that either the Kerberos implemtation is failing or its disabled on
this host.
@example
#include <krb5.h>
int
main(int argc, char **argv)
@{
krb5_context context;
if (krb5_context(&context))
errx (1, "krb5_context");
@end example
Now the client wants to connect to the host at the other end. The
preferred way of doing this is using @manpage{getaddrinfo,3} (for
operating system that have this function implemented), since getaddrinfo
is neutral to the address type and can use any protocol that is available.
@example
struct addrinfo *ai, *a;
struct addrinfo hints;
int error;
memset (&hints, 0, sizeof(hints));
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
error = getaddrinfo (hostname, "pop3", &hints, &ai);
if (error)
errx (1, "%s: %s", hostname, gai_strerror(error));
for (a = ai; a != NULL; a = a->ai_next) @{
int s;
s = socket (a->ai_family, a->ai_socktype, a->ai_protocol);
if (s < 0)
continue;
if (connect (s, a->ai_addr, a->ai_addrlen) < 0) @{
warn ("connect(%s)", hostname);
close (s);
continue;
@}
freeaddrinfo (ai);
ai = NULL;
@}
if (ai) @{
freeaddrinfo (ai);
errx ("failed to contact %s", hostname);
@}
@end example
Before authenticating, an authentication context needs to be
created. This context keeps all information for one (to be) authenticated
connection (see @manpage{krb5_auth_context,3}).
@example
status = krb5_auth_con_init (context, &auth_context);
if (status)
krb5_err (context, 1, status, "krb5_auth_con_init");
@end example
For setting the address in the authentication there is a help function
@code{krb5_auth_con_setaddrs_from_fd} that does everthing that is needed
when given a connected file descriptor to the socket.
@example
status = krb5_auth_con_setaddrs_from_fd (context,
auth_context,
&sock);
if (status)
krb5_err (context, 1, status,
"krb5_auth_con_setaddrs_from_fd");
@end example
The next step is to build a server principal for the service we want
to connect to. (See also @manpage{krb5_sname_to_principal,3}.)
@example
status = krb5_sname_to_principal (context,
hostname,
service,
KRB5_NT_SRV_HST,
&server);
if (status)
krb5_err (context, 1, status, "krb5_sname_to_principal");
@end example
The client principal is not passed to @manpage{krb5_sendauth,3}
function, this causes the @code{krb5_sendauth} function to try to figure it
out itself.
The server program is using the function @manpage{krb5_recvauth,3} to
receive the Kerberos 5 authenticator.
In this case, mutual authenication will be tried. That means that the server
will authenticate to the client. Using mutual authenication
is good since it enables the user to verify that they are talking to the
right server (a server that knows the key).
If you are using a non-blocking socket you will need to do all work of
@code{krb5_sendauth} yourself. Basically you need to send over the
authenticator from @manpage{krb5_mk_req,3} and, in case of mutual
authentication, verifying the result from the server with
@manpage{krb5_rd_rep,3}.
@example
status = krb5_sendauth (context,
&auth_context,
&sock,
VERSION,
NULL,
server,
AP_OPTS_MUTUAL_REQUIRED,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (status)
krb5_err (context, 1, status, "krb5_sendauth");
@end example
Once authentication has been performed, it is time to send some
data. First we create a krb5_data structure, then we sign it with
@manpage{krb5_mk_safe,3} using the @code{auth_context} that contains the
session-key that was exchanged in the
@manpage{krb5_sendauth,3}/@manpage{krb5_recvauth,3} authentication
sequence.
@example
data.data = "hej";
data.length = 3;
krb5_data_zero (&packet);
status = krb5_mk_safe (context,
auth_context,
&data,
&packet,
NULL);
if (status)
krb5_err (context, 1, status, "krb5_mk_safe");
@end example
And send it over the network.
@example
len = packet.length;
net_len = htonl(len);
if (krb5_net_write (context, &sock, &net_len, 4) != 4)
err (1, "krb5_net_write");
if (krb5_net_write (context, &sock, packet.data, len) != len)
err (1, "krb5_net_write");
@end example
To send encrypted (and signed) data @manpage{krb5_mk_priv,3} should be
used instead. @manpage{krb5_mk_priv,3} works the same way as
@manpage{krb5_mk_safe,3}, with the exception that it encrypts the data
in addition to signing it.
@example
data.data = "hemligt";
data.length = 7;
krb5_data_free (&packet);
status = krb5_mk_priv (context,
auth_context,
&data,
&packet,
NULL);
if (status)
krb5_err (context, 1, status, "krb5_mk_priv");
@end example
And send it over the network.
@example
len = packet.length;
net_len = htonl(len);
if (krb5_net_write (context, &sock, &net_len, 4) != 4)
err (1, "krb5_net_write");
if (krb5_net_write (context, &sock, packet.data, len) != len)
err (1, "krb5_net_write");
@end example
The server is using @manpage{krb5_rd_safe,3} and
@manpage{krb5_rd_priv,3} to verify the signature and decrypt the packet.
@node Validating a password in a server application, , Walkthru a sample Kerberos 5 client, Programming with Kerberos
@section Validating a password in an application
See the manual page for @manpage{krb5_verify_user,3}.
@c @node Why you should use GSS-API for new applications, Walkthru a sample GSS-API client, Validating a password in a server application, Programming with Kerberos
@c @section Why you should use GSS-API for new applications
@c
@c SSPI, bah, bah, microsoft, bah, bah, almost GSS-API.
@c
@c It would also be possible for other mechanisms then Kerberos, but that
@c doesn't exist any other GSS-API implementations today.
@c
@c @node Walkthru a sample GSS-API client, , Why you should use GSS-API for new applications, Programming with Kerberos
@c @section Walkthru a sample GSS-API client
@c
@c Write about how gssapi_clent.c works.
@@ -1,725 +0,0 @@
Kerberos Working Group M. Swift
Internet Draft University of WA
Document: draft-ietf-krb-wg-kerberos-referrals-00.txt J. Brezak
Category: Standards Track Microsoft
J. Trostle
Cisco Systems
K. Raeburn
MIT
February 2001
Generating KDC Referrals to locate Kerberos realms
Status of this Memo
This document is an Internet-Draft and is in full conformance with
all provisions of Section 10 of RFC2026 [1].
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet-
Drafts. Internet-Drafts are draft documents valid for a maximum of
six months and may be updated, replaced, or obsoleted by other
documents at any time. It is inappropriate to use Internet- Drafts
as reference material or to cite them other than as "work in
progress."
The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt
The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html.
1. Abstract
The draft documents a new method for a Kerberos Key Distribution
Center (KDC) to respond to client requests for kerberos tickets when
the client does not have detailed configuration information on the
realms of users or services. The KDC will handle requests for
principals in other realms by returning either a referral error or a
cross-realm TGT to another realm on the referral path. The clients
will use this referral information to reach the realm of the target
principal and then receive the ticket.
2. Conventions used in this document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in
this document are to be interpreted as described in RFC-2119 [2].
3. Introduction
Swift Category - Standards Track 1
KDC Referrals February 2001
Current implementations of the Kerberos AS and TGS protocols, as
defined in RFC 1510 [3], use principal names constructed from a
known user or service name and realm. A service name is typically
constructed from a name of the service and the DNS host name of the
computer that is providing the service. Many existing deployments of
Kerberos use a single Kerberos realm where all users and services
would be using the same realm. However in an environment where there
are multiple trusted Kerberos realms, the client needs to be able to
determine what realm a particular user or service is in before
making an AS or TGS request. Traditionally this requires client
configuration to make this possible.
When having to deal with multiple trusted realms, users are forced
to know what realm they are in before they can obtain a ticket
granting ticket (TGT) with an AS request. However, in many cases the
user would like to use a more familiar name that is not directly
related to the realm of their Kerberos principal name. A good
example of this is an RFC-822 style email name. This document
describes a mechanism that would allow a user to specify a user
principal name that is an alias for the user's Kerberos principal
name. In practice this would be the name that the user specifies to
obtain a TGT from a Kerberos KDC. The user principal name no longer
has a direct relationship with the Kerberos principal or realm. Thus
the administrator is able to move the user's principal to other
realms without the user having to know that it happened.
Once a user has a TGT, they would like to be able to access services
in any trusted Kerberos realm. To do this requires that the client
be able to determine what realm the target service's host is in
before making the TGS request. Current implementations of Kerberos
typically have a table that maps DNS host names to corresponding
Kerberos realms. In order for this to work on the client, each
application canonicalizes the host name of the service by doing a
DNS lookup followed by a reverse lookup using the returned IP
address. The returned primary host name is then used in the
construction of the principal name for the target service. In order
for the correct realm to be added for the target host, the mapping
table [domain_to_realm] is consulted for the realm corresponding to
the DNS host name. The corresponding realm is then used to complete
the target service principal name.
This traditional mechanism requires that each client have very
detailed configuration information about the hosts that are
providing services and their corresponding realms. Having client
side configuration information can be very costly from an
administration point of view - especially if there are many realms
and computers in the environment.
Current implementations of Kerberos also have difficulty with
services on hosts that can have multiple host names (multi-homed
hosts). Traditionally, each host name would need to have a distinct
principal and a corresponding key. An extreme example of this would
be a Web server with multiple host names for each domain that it is
Swift Category - Standards Track 2
KDC Referrals February 2001
supporting. Principal aliases allow multi-homed hosts to have a
single Kerberos principal (with a single key) that can have
identities for each distinct host name. This mechanism allows the
Kerberos client to request a service ticket for the distinct
hostname and allows the KDC to return a ticket for the single
principal that the host is using. This canonical principal name
allows the host to only have to manage a single key for all of the
identities that it supports. In addition, the client only needs to
know the realm of the canonical service name, not all of the
identities.
This draft proposes a solution for these problems and simplifies
administration by minimizing the configuration information needed on
each computer using Kerberos. Specifically it describes a mechanism
to allow the KDC to handle Canonicalization of names, provide for
principal aliases for users and services and provide a mechanism for
the KDC to determine the trusted realm authentication path by being
able to generate referrals to other realms in order to locate
principals.
To rectify these problems, this draft introduces three new kinds of
KDC referrals:
1. AS ticket referrals, in which the client doesn't know which realm
contains a user account.
2. TGS ticket referrals, in which the client doesn't know which
realm contains a server account.
3. Cross realm shortcut referrals, in which the KDC chooses the next
path on a referral chain
4. Realm Organization Model
This draft assumes that the world of principals is arranged on
multiple levels: the realm, the enterprise, and the world. A KDC may
issue tickets for any principal in its realm or cross-realm tickets
for realms with which it has a direct trust relationship. The KDC
also has access to a trusted name service that can resolve any name
from within its enterprise into a realm. This trusted name service
removes the need to use an untrusted DNS lookup for name resolution.
For example, consider the following configuration, where lines
indicate trust relationships:
MS.COM
/ \
/ \
OFFICE.MS.COM NT.MS.COM
In this configuration, all users in the MS.COM enterprise could have
a principal name such as [email protected], with the same realm portion.
In addition, servers at MS.COM should be able to have DNS host names
from any DNS domain independent of what Kerberos realm their
principal resides in.
Swift Category - Standards Track 3
KDC Referrals February 2001
5. Principal Names
5.1 Service Principal Names
The standard Kerberos model in RFC 1510 [3] gives each Kerberos
principal a single name. However, if a service is reachable by
several addresses, it is useful for a principal to have multiple
names. Consider a service running on a multi-homed machine. Rather
than requiring a separate principal and password for each name it
exports, a single account with multiple names could be used.
Multiple names are also useful for services in that clients need not
perform DNS lookups to resolve a host name into a full DNS address.
Instead, the service may have a name for each of its supported host
names, including its IP address. Nonetheless, it is still convenient
for the service to not have to be aware of all these names. Thus a
new name may be added to DNS for a service by updating DNS and the
KDC database without having to notify the service. In addition, it
implies that these aliases are globally unique: they do not include
a specifier dictating what realm contains the principal. Thus, an
alias for a server is of the form "class/instance/name" and may be
transmitted as any name type.
5.2 Client Principal Names
Similarly, a client account may also have multiple principal names.
More useful, though, is a globally unique name that allows
unification of email and security principal names. For example, all
users at MS may have a client principal name of the form
"[email protected]" even though the principals are contained in multiple
realms. This global name is again an alias for the true client
principal name, which is indicates what realm contains the
principal. Thus, accounts "alice" in the realm ntdev.MS.COM and
"bob" in office.MS.COM may logon as "[email protected]" and "[email protected]".
This requires a new client principal name type, as the AS-REQ
message only contains a single realm field, and the realm portion of
this name doesn't correspond to any Kerberos realm. Thus, the entire
name "[email protected]" is transmitted in the client name field of the
AS-REQ message, with a name type of KRB-NT-ENTERPRISE-PRINCIPAL.
KRB-NT-ENTERPRISE-PRINCIPAL 10
5.3 Name Canonicalization
In order to support name aliases, the Kerberos client must
explicitly request the name-canonicalization KDC option (bit 15) in
the ticket flags for the TGS-REQ. This flag indicates to the KDC
that the client is prepared to receive a reply with a different
client or server principal name than the request. Thus, the
KDCOptions types is redefined as:
KDCOptions ::= BIT STRING {
Swift Category - Standards Track 4
KDC Referrals February 2001
reserved(0),
forwardable(1),
forwarded(2),
proxiable(3),
proxy(4),
allow-postdate(5),
postdated(6),
unused7(7),
renewable(8),
unused9(9),
unused10(10),
unused11(11),
name-canonicalize(15),
renewable-ok(27),
enc-tkt-in-skey(28),
renew(30),
validate(31)
}
6. Client Referrals
The simplest form of ticket referral is for a user requesting a
ticket using an AS-REQ. In this case, the client machine will send
the AS request to a convenient trusted realm, either the realm of
the client machine or the realm of the client name. In the case of
the name [email protected], the client may optimistically choose to send
the request to MS.COM.
The client will send the string "[email protected]" in the client
principal name field using the KRB-NT-ENTERPRISE-PRINCIPAL name type
with the crealm set to MS.COM. The KDC will try to lookup the name
in its local account database. If the account is present in the
crealm of the request, it MUST return a KDC reply structure with the
appropriate ticket. If the account is not present in the crealm
specified in the request and the name-canonicalize flag in the
KDCoptions is set, the KDC will try to lookup the entire name,
[email protected], using a name service. If this lookup is unsuccessful,
it MUST return the error KDC_ERR_C_PRINCIPAL_UNKNOWN. If the lookup
is successful, it MUST return an error KDC_ERR_WRONG_REALM (0x44)
and in the error message the cname and crealm field MUST contain the
client name and the true realm of the client. If the KDC contains
the account locally, it MUST return a normal ticket. The client name
and realm portions of the ticket and KDC reply message MUST be the
client's true name in the realm, not the globally unique name.
If the client receives a KDC_ERR_WRONG_REALM error, it will issue a
new AS request with the same client principal name used to generate
the first referral to the realm specified by the crealm field of the
kerberos error message from the first request. This request MUST
produce a valid AS response with a ticket for the canonical user
name. The ticket MUST also include the ticket extension containing
the TE-REFERRAL-DATA with the referred-names set to the name from
Swift Category - Standards Track 5
KDC Referrals February 2001
the AS request. Any other error or referral will terminate the
request and result in a failed AS request.
7. Server Referrals
The server referral mechanism is a bit more complex than the client
referral mechanism. The primary problem is that the KDC must return
a referral ticket rather than an error message, so it will include
in the TGS response information about what realm contains the
service. This is done by returning information about the server name
in the pre-auth data field of the KDC reply.
If the KDC resolves the server principal name into a principal in
its realm, it may return a normal ticket. If the name-canonicalize
flag in the KDCoptions is not set, then the KDC MUST only look up
the name as a normal principal name. Otherwise, it MUST search all
aliases as well. The server principal name in both the ticket and
the KDC reply MUST be the true server principal name instead of one
of the aliases. This frees the application server from needing to
know about all its aliases.
If the name-canonicalize flag in the KDCoptions is set and the KDC
doesn't find the principal locally, the KDC can return a cross-realm
ticket granting ticket to the next hop on the trust path towards a
realm that may be able to resolve the principal name.
If the KDC can determine the service principal's realm, it can
return the server realm as ticket extension data. The ticket
extension MUST be encrypted using the session key from the ticket,
and the same etype as is used to protect the TGS reply body.
The data itself is an ASN.1 encoded structure containing the
server's realm, and if known, canonical principal name and alias
names. The first name in the sequence is the canonical principal
name.
TE-REFERRAL-INFO 20
TE-REFERRAL-DATA ::= SEQUENCE {
referred-server-realm[0] KERB-REALM
referred-names[1] SEQUENCE OF
PrincipalNames OPTIONAL
}
The client can use this information to request a chain of cross-
realm ticket granting tickets until it reaches the realm of the
server, and can then expect to receive a valid service ticket.
In order to facilitate cross-realm interoperability, a client SHOULD
NOT send short names in TGS requests to the KDC. A short name is
defined as a Kerberos name that includes a DNS name that is not
fully qualified. The client MAY use forward DNS lookups to obtain
Swift Category - Standards Track 6
KDC Referrals February 2001
the long name that corresponds to the user entered short name (the
short name will be a prefix of the corresponding long name).
The client may use the referred-names field to tell if it already
has a ticket to the server in its ticket cache.
The client can use this information to request a chain of cross-
realm ticket granting tickets until it reaches the realm of the
server, and can then expect to receive a valid service ticket.
However an implementation should limit the number of referrals that
it processes to avoid infinite referral loops. A suggested limit is
5 referrals before giving up.
8. Cross Realm Routing
The current Kerberos protocol requires the client to explicitly
request a cross-realm TGT for each pair of realms on a referral
chain. As a result, the client machines need to be aware of the
trust hierarchy and of any short-cut trusts (those that aren't
parent-child trusts). This requires more configurations on the
client. Instead, the client should be able to request a TGT to the
target realm from each realm on the route. The KDC will determine
the best path for the client and return a cross-realm TGT. The
client has to be aware that a request for a cross-realm TGT may
return a TGT for a realm different from the one requested.
9. Security Considerations
The original Kerberos specification stated that the server principal
name in the KDC reply was the same as the server name in the
request. These protocol changes break that assumption, so the client
may be vulnerable to a denial of service attack by an attacker that
replays replies from previous requests. It can verify that the
request was one of its own by checking the client-address field or
authtime field, though, so the damage is limited and detectable.
For the AS exchange case, it is important that the logon mechanism
not trust a name that has not been used to authenticate the user.
For example, the name that the user enters as part of a logon
exchange may not be the name that the user authenticates as, given
that the KDC_ERR_WRONG_REALM error may have been returned. The
relevant Kerberos naming information for logon (if any), is the
client name and client realm in the service ticket targeted at the
workstation that was obtained using the user's initial TGT.
How the client name and client realm is mapped into a local account
for logon is a local matter, but the client logon mechanism MUST use
additional information such as the client realm and/or authorization
attributes from the service ticket presented to the workstation by
the user, when mapping the logon credentials to a local account on
the workstation.
10. Discussion
Swift Category - Standards Track 7
KDC Referrals February 2001
This section contains issues and suggestions that need to be
incorporated into this draft. From Ken Raeburn [[email protected]]:
1) No means to do name canonicalization if you're not
authenticating. Is it okay to require credentials in order to do
canonicalization? If so, how about this: Send a TGS_REQ for the
service name you have. If you get back a TGS_REP for a service,
great; pull out the name and throw out the credentials. If you
get back a TGS_REP for a TGT service, ask again in the specified
realm. If you get back a KRB_ERROR because policy prohibits you
from authenticating to that service, we can add to the
specification that the {realm,sname} in the KRB_ERROR must be the
canonical name, and the checksum must be used. As long as the
checksum is present, it's still a secure exchange with the KDC.
If we have to be able to do name canonicalization without any
sort of credentials, either client-side (tickets) or server-side
(tickets automatically acquired via service key), I think we just
lose. But maybe GSSAPI should be changed if that's the case.
2) Can't refer to another realm and specify a different service name
to give to that realm's KDC. The local KDC can tell you a
different service name or a different realm name, but not both.
This comes up in the "gnuftp.raeburn.org CNAME ftp.gnu.org" type
of case I've mentioned.
Except ... the KDC-REP structure includes padata and ticket
extensions fields that are extensible. We could add a required
value to one of them -- perhaps only in the case where you return
a TGT when not asked -- that contains signed information about
the principal name to ask for in the other realm. (It would have
to be required, otherwise a man-in-the-middle could make it go
away.) Signing would be done using the session key for the TGS.
3) Secure canonicalization of service name in AS_REQ. If the
response is an AS_REP, we need a way to tell that the altered
server name wasn't a result of a MITM attack on the AS_REQ
message. Again, the KDC-REP extensible fields could have a new
required value added when name canonicalization happens,
indicating what the original principal name (in the AS_REQ
message) was, and signed using the same key as protects the
AS_REP. If it doesn't match what the client requested, the
messages were altered in transit.
4) Client name needs referral to another realm, and server name
needs canonicalization of some sort. The above fixes wouldn't
work for this case, and I'm not even sure which KDC should be
doing the canonicalization anyways.
The other-principal-name datum would probably look something like:
Swift Category - Standards Track 8
KDC Referrals February 2001
PrincipalAndNonce ::= SEQUENCE {
name[0] PrincipalName,
nonce[1] INTEGER -- copied from KDC_REQ
}
SignedPrincipal ::= SEQUENCE {
name-and-nonce[0] PrincipalAndNonce,
cksum[1] Checksum
}
{PA,TE}-ORIGINAL-SERVER-PRINCIPAL ::= SignedPrincipal
{PA,TE}-REMOTE-SERVER-PRINCIPAL ::= SignedPrincipal
with the checksum computed over the encoding of the 'name-and-nonce'
field, and appropriate PA- or TE- numbers assigned. I don't have a
strong opinion on whether it'd be a pa-data or ticket extension;
conceptually it seems like an abuse of either, but, well, I think
I'd rather abuse them than leave the facility both in and
inadequate.
The nonce is needed because multiple exchanges may be made with the
same key, and these extension fields aren't packed in with the other
encrypted data in the same response, so a MITM could pick apart
multiple messages and mix-and-match components. (In a TGS_REQ
exchange, a subsession key would help, but it's not required.)
The extension field would be required to prevent a MITM from
discarding the field from a response; a flag bit in a protected part
of the message (probably in 'flags' in EncKDCRepPart) could also let
us know of a cases where the information can be omitted, namely,
when no name change is done. Perhaps the bit should be set to
indicate that a name change *was* done, and clear if it wasn't,
making the no-change case more directly compatible with RFC1510.
11. References
1 Bradner, S., "The Internet Standards Process -- Revision 3", BCP
9, RFC 2026, October 1996.
2 Bradner, S., "Key words for use in RFCs to Indicate Requirement
Levels", BCP 14, RFC 2119, March 1997
3 Kohl, J., Neuman, C., "The Kerberos Network Authentication
Service (V5)", RFC 1510, September 1993
12. Author's Addresses
Michael Swift
University of Washington
Seattle, Washington
Email: [email protected]
John Brezak
Swift Category - Standards Track 9
KDC Referrals February 2001
Microsoft
One Microsoft Way
Redmond, Washington
Email: [email protected]
Jonathan Trostle
Cisco Systems
170 W. Tasman Dr.
San Jose, CA 95134
Email: [email protected]
Kenneth Raeburn
Massachusetts Institute of Technology 77
Massachusetts Avenue
Cambridge, Massachusetts 02139
Email: [email protected]
Swift Category - Standards Track 10
KDC Referrals February 2001
Full Copyright Statement
Copyright (C) The Internet Society (1999). All Rights Reserved.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph
are included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE."
Swift Category - Standards Track 11
-123
View File
@@ -1,123 +0,0 @@
KADMIN(8) UNIX System Manager's Manual KADMIN(8)
NNAAMMEE
kkaaddmmiinn - Kerberos administration utility
SSYYNNOOPPSSIISS
kkaaddmmiinn [--pp _s_t_r_i_n_g | ----pprriinncciippaall==_s_t_r_i_n_g] [--KK _s_t_r_i_n_g | ----kkeeyyttaabb==_s_t_r_i_n_g] [--cc
_f_i_l_e | ----ccoonnffiigg--ffiillee==_f_i_l_e] [--kk _f_i_l_e | ----kkeeyy--ffiillee==_f_i_l_e] [--rr _r_e_a_l_m |
----rreeaallmm==_r_e_a_l_m] [--aa _h_o_s_t | ----aaddmmiinn--sseerrvveerr==_h_o_s_t] [--ss _p_o_r_t _n_u_m_b_e_r |
----sseerrvveerr--ppoorrtt==_p_o_r_t _n_u_m_b_e_r] [--ll | ----llooccaall] [--hh | ----hheellpp] [--vv | ----vveerrssiioonn]
[_c_o_m_m_a_n_d]
DDEESSCCRRIIPPTTIIOONN
The kkaaddmmiinn program is used to make modification to the Kerberos database,
either remotely via the kadmind(8) daemon, or locally (with the --ll op-
tion).
Supported options:
--pp _s_t_r_i_n_g, ----pprriinncciippaall==_s_t_r_i_n_g
principal to authenticate as
--KK _s_t_r_i_n_g, ----kkeeyyttaabb==_s_t_r_i_n_g
keytab for authentication pricipal
--cc _f_i_l_e, ----ccoonnffiigg--ffiillee==_f_i_l_e
location of config file
--kk _f_i_l_e, ----kkeeyy--ffiillee==_f_i_l_e
location of master key file
--rr _r_e_a_l_m, ----rreeaallmm==_r_e_a_l_m
realm to use
--aa _h_o_s_t, ----aaddmmiinn--sseerrvveerr==_h_o_s_t
server to contact
--ss _p_o_r_t _n_u_m_b_e_r, ----sseerrvveerr--ppoorrtt==_p_o_r_t _n_u_m_b_e_r
port to use
--ll, ----llooccaall
local admin mode
If no _c_o_m_m_a_n_d is given on the command line, kkaaddmmiinn will prompt for com-
mands to process. Commands include:
aadddd [--rr | ----rraannddoomm--kkeeyy] [----rraannddoomm--ppaasssswwoorrdd] [--pp _s_t_r_i_n_g |
----ppaasssswwoorrdd==_s_t_r_i_n_g] [----kkeeyy==_s_t_r_i_n_g] [----mmaaxx--ttiicckkeett--lliiffee==_l_i_f_e_t_i_m_e]
[----mmaaxx--rreenneewwaabbllee--lliiffee==_l_i_f_e_t_i_m_e] [----aattttrriibbuutteess==_a_t_t_r_i_b_u_t_e_s]
[----eexxppiirraattiioonn--ttiimmee==_t_i_m_e] [----ppww--eexxppiirraattiioonn--ttiimmee==_t_i_m_e] _p_r_i_n_c_i_p_a_l_._._.
creates a new principal
ppaasssswwdd [--rr | ----rraannddoomm--kkeeyy] [----rraannddoomm--ppaasssswwoorrdd] [--pp _s_t_r_i_n_g |
----ppaasssswwoorrdd==_s_t_r_i_n_g] [----kkeeyy==_s_t_r_i_n_g] _p_r_i_n_c_i_p_a_l_._._.
changes the password of an existing principal
ddeelleettee _p_r_i_n_c_i_p_a_l_._._.
removes a principal
ddeell__eennccttyyppee _p_r_i_n_c_i_p_a_l _e_n_c_t_y_p_e_s_._._.
removes some enctypes from a principal, this can be useful
the service belonging to the principal is known to not handle
certain enctypes
eexxtt__kkeeyyttaabb [--kk _s_t_r_i_n_g | ----kkeeyyttaabb==_s_t_r_i_n_g] _p_r_i_n_c_i_p_a_l_._._.
creates a keytab with the keys of the specified principals
ggeett [--ll | ----lloonngg] [--ss | ----sshhoorrtt] [--tt | ----tteerrssee] _e_x_p_r_e_s_s_i_o_n_._._.
lists the principals that match the expressions (which are
shell glob like), long format gives more information, and
terse just prints the names
rreennaammee _f_r_o_m _t_o
renames a principal
mmooddiiffyy [--aa _a_t_t_r_i_b_u_t_e_s | ----aattttrriibbuutteess==_a_t_t_r_i_b_u_t_e_s]
[----mmaaxx--ttiicckkeett--lliiffee==_l_i_f_e_t_i_m_e] [----mmaaxx--rreenneewwaabbllee--lliiffee==_l_i_f_e_t_i_m_e]
[----eexxppiirraattiioonn--ttiimmee==_t_i_m_e] [----ppww--eexxppiirraattiioonn--ttiimmee==_t_i_m_e]
[----kkvvnnoo==_n_u_m_b_e_r] _p_r_i_n_c_i_p_a_l
modifies certain attributes of a principal
pprriivviilleeggeess
lists the operations you are allowd to perform
When running in local mode, the following commands can also be used.
dduummpp [--dd | ----ddeeccrryypptt] [_d_u_m_p_-_f_i_l_e]
writes the database in ``human readable'' form to the speci-
fied file, or standard out
iinniitt [----rreeaallmm--mmaaxx--ttiicckkeett--lliiffee==_s_t_r_i_n_g]
[----rreeaallmm--mmaaxx--rreenneewwaabbllee--lliiffee==_s_t_r_i_n_g] _r_e_a_l_m
initialises the Kerberos database with entries for a new
realm, it's possible to have more than one realm served by
one server
llooaadd _f_i_l_e
reads a previously dumped database, and re-creates that
database from scratch
mmeerrggee _f_i_l_e
similar to lliisstt but just modifies the database with the en-
tries in the dump file
SSEEEE AALLSSOO
kadmind(8), kdc(8)
HEIMDAL September 10, 2000 2
-93
View File
@@ -1,93 +0,0 @@
KADMIND(8) UNIX System Manager's Manual KADMIND(8)
NNAAMMEE
kkaaddmmiinndd - server for administrative access to kerberos database
SSYYNNOOPPSSIISS
kkaaddmmiinndd [--cc _f_i_l_e | ----ccoonnffiigg--ffiillee==_f_i_l_e] [--kk _f_i_l_e | ----kkeeyy--ffiillee==_f_i_l_e]
[----kkeeyyttaabb==_k_e_y_t_a_b] [--rr _r_e_a_l_m | ----rreeaallmm==_r_e_a_l_m] [--dd | ----ddeebbuugg] [--pp _p_o_r_t |
----ppoorrttss==_p_o_r_t]
DDEESSCCRRIIPPTTIIOONN
kkaaddmmiinndd listens for requests for changes to the Kerberos database and
performs these, subject to permissions. When starting, if stdin is a
socket it assumes that it has been started by inetd(8), otherwise it be-
haves as a daemon, forking processes for each new connection. The ----ddeebbuugg
option causes kkaaddmmiinndd to accept exactly one connection, which is useful
for debugging.
If built with krb4 support, it implements both the Heimdal Kerberos 5 ad-
ministrative protocol and the Kerberos 4 protocol. Password changes via
the Kerberos 4 protocol are also performed by kkaaddmmiinndd, but the kpass-
wdd(8) daemon is responsible for the Kerberos 5 password changing proto-
col (used by kpasswd(1))
This daemon should only be run on ther master server, and not on any
slaves.
Principals are always allowed to change their own password and list their
own principals. Apart from that, doing any operation requires permission
explicitly added in the ACL file _/_v_a_r_/_h_e_i_m_d_a_l_/_k_a_d_m_i_n_d_._a_c_l. The format of
this file is:
_p_r_i_n_c_i_p_a_l _r_i_g_h_t_s [_p_r_i_n_c_i_p_a_l_-_p_a_t_t_e_r_n]
Where rights is any combination of:
++oo change-password | cpw
++oo list
++oo delete
++oo modify
++oo add
++oo get
++oo all
And the optional _p_r_i_n_c_i_p_a_l_-_p_a_t_t_e_r_n restricts the rights to principals
that match the glob-style pattern.
Supported options:
--cc _f_i_l_e, ----ccoonnffiigg--ffiillee==_f_i_l_e
location of config file
--kk _f_i_l_e, ----kkeeyy--ffiillee==_f_i_l_e
location of master key file
----kkeeyyttaabb==_k_e_y_t_a_b
what keytab to use
--rr _r_e_a_l_m, ----rreeaallmm==_r_e_a_l_m
realm to use
--dd, ----ddeebbuugg
enable debugging
--pp _p_o_r_t, ----ppoorrttss==_p_o_r_t
ports to listen to. By default, if run as a daemon, it listen to
ports 749, and 751 (if built with Kerberos 4 support), but you
can add any number of ports with this option. The port string is
a whitespace separated list of port specifications, with the spe-
cial string ``+'' representing the default set of ports.
FFIILLEESS
_/_v_a_r_/_h_e_i_m_d_a_l_/_k_a_d_m_i_n_d_._a_c_l
EEXXAAMMPPLLEESS
This will cause kadmind to listen to port 4711 in addition to any com-
piled in defaults:
# kadmind --ports="+ 4711" &
SSEEEE AALLSSOO
kdc(8), kadmin(1), kpasswdd(8), kpasswd(1)
HEIMDAL June 7, 2000 2
-103
View File
@@ -1,103 +0,0 @@
HPROP(8) UNIX System Manager's Manual HPROP(8)
NNAAMMEE
hhpprroopp - propagate the KDC database
SSYYNNOOPPSSIISS
hhpprroopp [--mm _f_i_l_e | ----mmaasstteerr--kkeeyy==_f_i_l_e] [--dd _f_i_l_e | ----ddaattaabbaassee==_f_i_l_e]
[----ssoouurrccee==_h_e_i_m_d_a_l_|_m_i_t_-_d_u_m_p_|_k_r_b_4_-_d_b_|_k_r_b_4_-_d_u_m_p] [--44 | ----vv44--ddbb] [--KK |
----kkaa--ddbb] [--cc _c_e_l_l | ----cceellll==_c_e_l_l] [--SS | ----kkaassppeecciiaallss] [--rr _s_t_r_i_n_g |
----vv44--rreeaallmm==_s_t_r_i_n_g] [--kk _k_e_y_t_a_b | ----kkeeyyttaabb==_k_e_y_t_a_b] [--RR _s_t_r_i_n_g |
----vv55--rreeaallmm==_s_t_r_i_n_g] [--DD | ----ddeeccrryypptt] [--EE | ----eennccrryypptt] [--nn | ----ssttddoouutt] [--vv
| ----vveerrbboossee] [----vveerrssiioonn] [--hh | ----hheellpp] _h_o_s_t[:_p_o_r_t] _._._.
DDEESSCCRRIIPPTTIIOONN
hhpprroopp takes a principal database in a specified format and converts it
into a stream of Heimdal database records. This stream can either be
written to standard out, or (more commonly) be propagated to a hpropd(8)
server running on a different machine.
If propagating, it connects to all _h_o_s_t_s specified on the command by
opening a TCP connection to port 754 (service hprop) and sends the
database in encrypted form.
Supported options:
--mm _f_i_l_e, ----mmaasstteerr--kkeeyy==_f_i_l_e
Where to find the master key to encrypt or decrypt keys with.
--dd _f_i_l_e, ----ddaattaabbaassee==_f_i_l_e
The database to be propagated.
----ssoouurrccee==_h_e_i_m_d_a_l_|_m_i_t_-_d_u_m_p_|_k_r_b_4_-_d_b_|_k_r_b_4_-_d_u_m_p
Specifies the type of the source database. Alternatives include:
heimdal a Heimdal database
mit-dump a MIT Kerberos 5 dump file
krb4-db a Kerberos 4 database
krb4-dump a Kerberos 4 dump file
kaserver a Transarc kaserver database
--kk _k_e_y_t_a_b, ----kkeeyyttaabb==_k_e_y_t_a_b
The keytab to use for fetching the key to be used for authenti-
cating to the propagation daemon(s). The key _k_a_d_m_i_n_/_h_p_r_o_p is used
from this keytab. The default is to fetch the key from the KDC
database.
--RR _s_t_r_i_n_g, ----vv55--rreeaallmm==_s_t_r_i_n_g
Local realm override.
--DD, ----ddeeccrryypptt
The encryption keys in the database can either be in clear, or
encrypted with a master key. This option thansmits the database
with unencrypted keys.
--EE, ----eennccrryypptt
This option thansmits the database with encrypted keys.
--nn, ----ssttddoouutt
Dump the database on stdout, in a format that can be fed to
hpropd.
The following options are only valid if hhpprroopp is compiled with support
for Kerberos 4 (kaserver).
--rr _s_t_r_i_n_g, ----vv44--rreeaallmm==_s_t_r_i_n_g
v4 realm to use
--cc _c_e_l_l, ----cceellll==_c_e_l_l
The AFS cell name, used if reading a kaserver database.
--SS, ----kkaassppeecciiaallss
Also dump the principals marked as special in the kaserver
database.
--44, ----vv44--ddbb
Deprecated, identical to `--source=krb4-db'.
--KK, ----kkaa--ddbb
Deprecated, identical to `--source=kaserver'.
EEXXAAMMPPLLEESS
The following will propagate a database to another machine (which should
run hpropd(8):)
$ hprop slave-1 slave-2
Copy a Kerberos 4 database to a Kerberos 5 slave:
$ hprop --source=krb4-db -E krb5-slave
Convert a Kerberos 4 dump-file for use with a Heimdal KDC:
$ hprop -n --source=krb4-dump -d /var/kerberos/principal.dump -E | hpropd -n
SSEEEE AALLSSOO
hpropd(8)
HEIMDAL June 19, 2000 2
-43
View File
@@ -1,43 +0,0 @@
HPROPD(8) UNIX System Manager's Manual HPROPD(8)
NNAAMMEE
hhpprrooppdd - receive a propagated database
SSYYNNOOPPSSIISS
hhpprrooppdd [--dd _f_i_l_e | ----ddaattaabbaassee==_f_i_l_e] [--nn | ----ssttddiinn] [----pprriinntt] [--ii |
----nnoo--iinneettdd] [--kk _k_e_y_t_a_b | ----kkeeyyttaabb==_k_e_y_t_a_b] [--44 | ----vv44dduummpp]
DDEESSCCRRIIPPTTIIOONN
hhpprrooppdd receives databases sent by hhpprroopp. and writes it as a local
database.
By default, hhpprrooppdd expects to be started from iinneettdd if stdin is a socket
and expects to receive the dumped database over stdin otherwise. If the
database is sent over the network, it is authenticated and encrypted.
Only connections from kadmin/hprop are accepted.
Options supported:
--dd _f_i_l_e, ----ddaattaabbaassee==_f_i_l_e
database
--nn, ----ssttddiinn
read from stdin
----pprriinntt
print dump to stdout
--ii, ----nnoo--iinneettdd
Not started from inetd
--kk _k_e_y_t_a_b, ----kkeeyyttaabb==_k_e_y_t_a_b
keytab to use for authentication
--44, ----vv44dduummpp
create v4 type DB
SSEEEE AALLSSOO
hprop(8)
HEIMDAL August 27, 1997 1
-118
View File
@@ -1,118 +0,0 @@
KDC(8) UNIX System Manager's Manual KDC(8)
NNAAMMEE
kkddcc - Kerberos 5 server
SSYYNNOOPPSSIISS
kkddcc [--cc _f_i_l_e | ----ccoonnffiigg--ffiillee==_f_i_l_e] [--pp | ----nnoo--rreeqquuiirree--pprreeaauutthh]
[----mmaaxx--rreeqquueesstt==_s_i_z_e] [--HH | ----eennaabbllee--hhttttpp] [--rr _s_t_r_i_n_g | ----vv44--rreeaallmm==_s_t_r_i_n_g]
[--KK | ----nnoo--kkaasseerrvveerr] [--rr _r_e_a_l_m] [----vv44--rreeaallmm==_r_e_a_l_m] [--PP _s_t_r_i_n_g |
----ppoorrttss==_s_t_r_i_n_g] [----aaddddrreesssseess==_l_i_s_t _o_f _a_d_d_r_e_s_s_e_s]
DDEESSCCRRIIPPTTIIOONN
kkddcc serves requests for tickets. When it starts, it first checks the
flags passed, any options that are not specified with a command line flag
is taken from a config file, or from a default compiled-in value.
Options supported:
--cc _f_i_l_e
----ccoonnffiigg--ffiillee==_f_i_l_e
Specifies the location of the config file, the default is
_/_v_a_r_/_h_e_i_m_d_a_l_/_k_d_c_._c_o_n_f. This is the only value that can't be spec-
ified in the config file.
--pp
----nnoo--rreeqquuiirree--pprreeaauutthh
Turn off the requirement for pre-autentication in the initial AS-
REQ for all principals. The use of pre-authentication makes it
more difficult to do offline password attacks. You might want to
turn it off if you have clients that doesn't do pre-authentica-
tion. Since the version 4 protocol doesn't support any pre-au-
thentication, so serving version 4 clients is just about the same
as not requiring pre-athentication. The default is to require
pre-authentication. Adding the require-preauth per principal is a
more flexible way of handling this.
----mmaaxx--rreeqquueesstt==_s_i_z_e
Gives an upper limit on the size of the requests that the kdc is
willing to handle.
--HH, ----eennaabbllee--hhttttpp
Makes the kdc listen on port 80 and handle requests encapsulated
in HTTP.
--KK, ----nnoo--kkaasseerrvveerr
Disables kaserver emulation (in case it's compiled in).
--rr _r_e_a_l_m
----vv44--rreeaallmm==_r_e_a_l_m
What realm this server should act as when dealing with version 4
requests. The database can contain any number of realms, but
since the version 4 protocol doesn't contain a realm for the
server, it must be explicitly specified. The default is whatever
is returned by kkrrbb__ggeett__llrreeaallmm(). This option is only availabe if
the KDC has been compiled with version 4 support.
--PP _s_t_r_i_n_g, ----ppoorrttss==_s_t_r_i_n_g
Specifies the set of ports the KDC should listen on. It is given
as a white-space separated list of services or port numbers.
----aaddddrreesssseess==_l_i_s_t _o_f _a_d_d_r_e_s_s_e_s
The list of addresses to listen for requests on. By default, the
kdc will listen on all the locally configured addresses. If only
a subset is desired, or the automatic detection fails, this op-
tion might be used.
All activities , are logged to one or more destinations, see
krb5.conf(5), and krb5_openlog(3). The entity used for logging is kkddcc.
CCOONNFFIIGGUURRAATTIIOONN FFIILLEE
The configuration file has the same syntax as the _k_r_b_5_._c_o_n_f file (you can
actually put the configuration in _/_e_t_c_/_k_r_b_5_._c_o_n_f, and then start the KDC
with ----ccoonnffiigg--ffiillee==_/_e_t_c_/_k_r_b_5_._c_o_n_f). All options should be in a section
called ``kdc''. All the command-line options can preferably be added in
the configuration file. The only difference is the pre-authentication
flag, that has to be specified as:
require-preauth = no
(in fact you can specify the option as ----rreeqquuiirree--pprreeaauutthh==nnoo).
And there are some configuration options which do not have command-line
equivalents:
check-ticket-addresses = _b_o_o_l_e_a_n
Check the addresses in the ticket when processing TGS re-
quests. The default is FALSE.
allow-null-ticket-addresses = _b_o_o_l_e_a_n
Permit tickets with no addresses. This option is only rele-
vant when check-ticket-addresses is TRUE.
allow-anonymous = _b_o_o_l_e_a_n
Permit anonymous tickets with no addresses.
encode_as_rep_as_tgs_rep = _b_o_o_l_e_a_n
Encode AS-Rep as TGS-Rep to be bug-compatible with old DCE
code. The Heimdal clients allow both.
kdc_warn_pwexpire = _t_i_m_e
How long before password/principal expiration the KDC should
start sending out warning messages.
An example of a config file:
[kdc]
require-preauth = no
v4-realm = FOO.SE
key-file = /key-file
SSEEEE AALLSSOO
kinit(1)
HEIMDAL July 27, 1997 2
-34
View File
@@ -1,34 +0,0 @@
KSTASH(8) UNIX System Manager's Manual KSTASH(8)
NNAAMMEE
kkssttaasshh - store the KDC master password in a file
SSYYNNOOPPSSIISS
kkssttaasshh [--ee _s_t_r_i_n_g | ----eennccttyyppee==_s_t_r_i_n_g] [--kk _f_i_l_e | ----kkeeyy--ffiillee==_f_i_l_e]
[----ccoonnvveerrtt--ffiillee] [----mmaasstteerr--kkeeyy--ffdd==_f_d] [--hh | ----hheellpp] [----vveerrssiioonn]
DDEESSCCRRIIPPTTIIOONN
kkssttaasshh reads the Kerberos master key and stores it in a file that will be
used by the KDC.
Supported options:
--ee _s_t_r_i_n_g, ----eennccttyyppee==_s_t_r_i_n_g
the encryption type to use, defaults to DES3-CBC-SHA1
--kk _f_i_l_e, ----kkeeyy--ffiillee==_f_i_l_e
the name of the master key file
----ccoonnvveerrtt--ffiillee
don't ask for a new master key, just read an old master key file,
and writes it back in the new keyfile format
----mmaasstteerr--kkeeyy--ffdd==_f_d
filedescriptor to read passphrase from, if not specified the
passphrase will be read from the terminal
SSEEEE AALLSSOO
kdc(8)
HEIMDAL September 1, 2000 1
-42
View File
@@ -1,42 +0,0 @@
STRING2KEY(8) UNIX System Manager's Manual STRING2KEY(8)
NNAAMMEE
ssttrriinngg22kkeeyy - map a password into a key
SSYYNNOOPPSSIISS
ssttrriinngg22kkeeyy [--55 | ----vveerrssiioonn55] [--44 | ----vveerrssiioonn44] [--aa | ----aaffss] [--cc _c_e_l_l |
----cceellll==_c_e_l_l] [--ww _p_a_s_s_w_o_r_d | ----ppaasssswwoorrdd==_p_a_s_s_w_o_r_d] [--pp _p_r_i_n_c_i_p_a_l |
----pprriinncciippaall==_p_r_i_n_c_i_p_a_l] [--kk _s_t_r_i_n_g | ----kkeeyyttyyppee==_s_t_r_i_n_g] _p_a_s_s_w_o_r_d
DDEESSCCRRIIPPTTIIOONN
ssttrriinngg22kkeeyy performs the string-to-key function. This is useful when you
want to handle the raw key instead of the password. Supported options:
--55, ----vveerrssiioonn55
Output Kerberos v5 string-to-key
--44, ----vveerrssiioonn44
Output Kerberos v4 string-to-key
--aa, ----aaffss
Output AFS string-to-key
--cc _c_e_l_l, ----cceellll==_c_e_l_l
AFS cell to use
--ww _p_a_s_s_w_o_r_d, ----ppaasssswwoorrdd==_p_a_s_s_w_o_r_d
Password to use
--pp _p_r_i_n_c_i_p_a_l, ----pprriinncciippaall==_p_r_i_n_c_i_p_a_l
Kerberos v5 principal to use
--kk _s_t_r_i_n_g, ----kkeeyyttyyppee==_s_t_r_i_n_g
Keytype
----vveerrssiioonn
print version
----hheellpp
HEIMDAL March 4, 2000 1
-20
View File
@@ -1,20 +0,0 @@
KPASSWD(1) UNIX Reference Manual KPASSWD(1)
NNAAMMEE
kkppaasssswwdd - Kerberos 5 password changing program
SSYYNNOOPPSSIISS
kkppaasssswwdd [_p_r_i_n_c_i_p_a_l]
DDEESSCCRRIIPPTTIIOONN
kkppaasssswwdd is the client for changing passwords.
DDIIAAGGNNOOSSTTIICCSS
If the password quality check fails or some other error occurs, an expla-
nation is printed.
SSEEEE AALLSSOO
kpasswdd(8)
HEIMDAL Aug 27, 1997 1
-54
View File
@@ -1,54 +0,0 @@
KPASSWDD(8) UNIX System Manager's Manual KPASSWDD(8)
NNAAMMEE
kkppaasssswwdddd - Kerberos 5 password changing server
SSYYNNOOPPSSIISS
kkppaasssswwdddd [----cchheecckk--lliibbrraarryy==_l_i_b_r_a_r_y] [----cchheecckk--ffuunnccttiioonn==_f_u_n_c_t_i_o_n] [--kk _k_s_p_e_c
| ----kkeeyyttaabb==_k_s_p_e_c] [--rr _r_e_a_l_m | ----rreeaallmm==_r_e_a_l_m] [--pp _s_t_r_i_n_g | ----ppoorrtt==_s_t_r_i_n_g]
[----vveerrssiioonn] [----hheellpp]
DDEESSCCRRIIPPTTIIOONN
kkppaasssswwdddd serves request for password changes. It listens on UDP port 464
(service kpasswd) and processes requests when they arrive. It changes the
database directly and should thus only run on the master KDC.
Supported options:
----cchheecckk--lliibbrraarryy==_l_i_b_r_a_r_y
If your system has support for dynamic loading of shared li-
braries, you can use an external function to check password qual-
ity. This option specifies which library to load.
----cchheecckk--ffuunnccttiioonn==_f_u_n_c_t_i_o_n
This is the function to call in the loaded library. The function
should look like this:
_c_o_n_s_t _c_h_a_r _* ppaasssswwdd__cchheecckk(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___p_r_i_n_c_i_p_a_l
_p_r_i_n_c_i_p_a_l, _k_r_b_5___d_a_t_a _*_p_a_s_s_w_o_r_d)
_c_o_n_t_e_x_t is an initialized context; _p_r_i_n_c_i_p_a_l is the one who tries
to change passwords, and _p_a_s_s_w_o_r_d is the new password. Note that
the password (in _p_a_s_s_w_o_r_d_-_>_d_a_t_a) is not zero terminated.
--kk _k_s_p_e_c, ----kkeeyyttaabb==_k_s_p_e_c
keytab to get authentication key from
--rr _r_e_a_l_m, ----rreeaallmm==_r_e_a_l_m
default realm
--pp _s_t_r_i_n_g, ----ppoorrtt==_s_t_r_i_n_g
port to listen on (default service kpasswd - 464).
DDIIAAGGNNOOSSTTIICCSS
If an error occurs, the error message is returned to the user and/or
logged to syslog.
BBUUGGSS
The default password quality checks are too basic.
SSEEEE AALLSSOO
kdc(8), kpasswd(1)
HEIMDAL April 19, 1999 1
-30
View File
@@ -1,30 +0,0 @@
KDESTROY(1) UNIX Reference Manual KDESTROY(1)
NNAAMMEE
kkddeessttrrooyy - destroy the current ticket file
SSYYNNOOPPSSIISS
kkddeessttrrooyy [--cc _c_a_c_h_e_f_i_l_e] [----ccaacchhee==_c_a_c_h_e_f_i_l_e] [----nnoo--uunnlloogg] [----nnoo--ddeelleettee--vv44]
[----vveerrssiioonn] [----hheellpp]
DDEESSCCRRIIPPTTIIOONN
kkddeessttrrooyy remove the current set of tickets.
Supported options:
--cc _c_a_c_h_e_f_i_l_e
--ccaacchhee==_c_a_c_h_e_f_i_l_e
The cache file to remove.
----nnoo--uunnlloogg
Do not remove AFS tokens.
----nnoo--ddeelleettee--vv44
Do not remove v4 tickets.
SSEEEE AALLSSOO
kinit(1), klist(1)
HEIMDAL August 27, 1997 1
Loaded 100 of 389 files, more files were not shown because too many files have changed in this diff. Show more