diff options
Diffstat (limited to 'contrib/amd')
33 files changed, 1960 insertions, 1972 deletions
diff --git a/contrib/amd/FREEBSD-Xlist b/contrib/amd/FREEBSD-Xlist new file mode 100644 index 0000000..0e0ec9b --- /dev/null +++ b/contrib/amd/FREEBSD-Xlist @@ -0,0 +1,138 @@ +$FreeBSD$ +*LSM.am-utils +*Makefile.* +*README.autofs +*ac*.m4 +*acconfig.h +*aux +*buildall +*config* +*depcomp +*install-sh +*lt* +*missing +*mkinstalldirs +*stamp-h.in +*amd/Makefile.* +*amq/Makefile.* +*conf/checkmount/checkmount_aix.c +*conf/checkmount/checkmount_default.c +*conf/checkmount/checkmount_osf.c +*conf/checkmount/checkmount_svr4.c +*conf/checkmount/checkmount_ultrix.c +*conf/fh_dref/fh_dref_aix3.h +*conf/fh_dref/fh_dref_aix42.h +*conf/fh_dref/fh_dref_bsd44.h +*conf/fh_dref/fh_dref_default.h +*conf/fh_dref/fh_dref_hpux.h +*conf/fh_dref/fh_dref_irix.h +*conf/fh_dref/fh_dref_isc3.h +*conf/fh_dref/fh_dref_linux.h +*conf/fh_dref/fh_dref_nextstep.h +*conf/fh_dref/fh_dref_osf2.h +*conf/fh_dref/fh_dref_osf4.h +*conf/fh_dref/fh_dref_sunos3.h +*conf/fh_dref/fh_dref_sunos4.h +*conf/fh_dref/fh_dref_svr4.h +*conf/hn_dref/hn_dref_isc3.h +*conf/hn_dref/hn_dref_linux.h +*conf/mount/mount_aix.c +*conf/mount/mount_bsdi3.c +*conf/mount/mount_freebsd3.c +*conf/mount/mount_hpux.c +*conf/mount/mount_irix5.c +*conf/mount/mount_irix6.c +*conf/mount/mount_isc3.c +*conf/mount/mount_linux.c +*conf/mount/mount_mach3.c +*conf/mount/mount_stellix.c +*conf/mount/mount_svr4.c +*conf/mtab/mtab_aix.c +*conf/mtab/mtab_file.c +*conf/mtab/mtab_isc3.c +*conf/mtab/mtab_mach3.c +*conf/mtab/mtab_osf.c +*conf/mtab/mtab_svr4.c +*conf/mtab/mtab_ultrix.c +*conf/nfs_prot/nfs_prot_aix3.h +*conf/nfs_prot/nfs_prot_aix4.h +*conf/nfs_prot/nfs_prot_aix4_2.h +*conf/nfs_prot/nfs_prot_aix4_3.h +*conf/nfs_prot/nfs_prot_bsdi2.h +*conf/nfs_prot/nfs_prot_bsdi3.h +*conf/nfs_prot/nfs_prot_default.h +*conf/nfs_prot/nfs_prot_hpux.h +*conf/nfs_prot/nfs_prot_hpux11.h +*conf/nfs_prot/nfs_prot_irix5.h +*conf/nfs_prot/nfs_prot_irix6.h +*conf/nfs_prot/nfs_prot_linux.h +*conf/nfs_prot/nfs_prot_ncr2.h +*conf/nfs_prot/nfs_prot_netbsd.h +*conf/nfs_prot/nfs_prot_netbsd1_3.h +*conf/nfs_prot/nfs_prot_netbsd1_4.h +*conf/nfs_prot/nfs_prot_nextstep.h +*conf/nfs_prot/nfs_prot_openbsd.h +*conf/nfs_prot/nfs_prot_osf2.h +*conf/nfs_prot/nfs_prot_osf4.h +*conf/nfs_prot/nfs_prot_osf5_1.h +*conf/nfs_prot/nfs_prot_sunos3.h +*conf/nfs_prot/nfs_prot_sunos4.h +*conf/nfs_prot/nfs_prot_sunos5_3.h +*conf/nfs_prot/nfs_prot_sunos5_4.h +*conf/nfs_prot/nfs_prot_sunos5_5.h +*conf/nfs_prot/nfs_prot_sunos5_6.h +*conf/nfs_prot/nfs_prot_sunos5_7.h +*conf/nfs_prot/nfs_prot_sunos5_8.h +*conf/nfs_prot/nfs_prot_svr4.h +*conf/nfs_prot/nfs_prot_ultrix.h +*conf/sa_dref/sa_dref_386bsd.h +*conf/sa_dref/sa_dref_aix3.h +*conf/sa_dref/sa_dref_aoi.h +*conf/sa_dref/sa_dref_default.h +*conf/sa_dref/sa_dref_isc3.h +*conf/sa_dref/sa_dref_linux.h +*conf/sa_dref/sa_dref_svr4.h +*conf/transp/transp_tli.c +*conf/trap/trap_aix3.h +*conf/trap/trap_aux.h +*conf/trap/trap_dgux.h +*conf/trap/trap_hcx.h +*conf/trap/trap_hpux.h +*conf/trap/trap_hpux11.h +*conf/trap/trap_irix.h +*conf/trap/trap_isc3.h +*conf/trap/trap_linux.h +*conf/trap/trap_mach3.h +*conf/trap/trap_news4.h +*conf/trap/trap_rtu6.h +*conf/trap/trap_stellix.h +*conf/trap/trap_svr4.h +*conf/trap/trap_ultrix.h +*conf/umount/umount_default.c +*conf/umount/umount_osf.c +*doc/Makefile.am +*doc/Makefile.in +*doc/am-utils.dvi +*doc/am-utils.info +*doc/am-utils.info-1 +*doc/am-utils.info-2 +*doc/am-utils.info-3 +*doc/am-utils.info-4 +*doc/am-utils.info-5 +*doc/am-utils.info-6 +*doc/am-utils.info-7 +*doc/am-utils.ps +*doc/hlfsd.ps +*doc/mdate-sh +*fixmount/Makefile.* +*fsinfo/Makefile.* +*hlfsd/Makefile.* +*libamu/Makefile.* +*libamu/clnt_sperrno.c +*libamu/memcmp.c +*libamu/strcasecmp.c +*libamu/strdup.c +*libamu/strstr.c +*libamu/ualarm.c +*mk-amd-map/Makefile.* +*wire-test/Makefile.* diff --git a/contrib/amd/FREEBSD-upgrade b/contrib/amd/FREEBSD-upgrade new file mode 100644 index 0000000..f8f1090 --- /dev/null +++ b/contrib/amd/FREEBSD-upgrade @@ -0,0 +1,30 @@ +# ex:ts=8 +$FreeBSD$ + +AMD (am-utils) 6.0.7 + originals can be found at: ftp://shekel.mcl.cs.columbia.edu/pub/am-utils/ + (http://www.cs.columbia.edu/~ezk/am-utils/index.html) + + +For the import of AMD many files were pruned by: + + tar -X FREEBSD-Xlist -xzf am-utils-6.0.7.tar.gz + +Then imported by: + + cvs import -m 'Virgin import of AMD (am-utils) v6.0.7' \ + src/contrib/amd COLUMBIA amd_6_0_7 + +After the import, a separate extraction of am-utils was GNU configured in +the "normal" way. The resulting config.h file should be compared with +src/usr.sbin/amd/include/config.h, and src/usr.sbin/amd/include/config.h +updated as needed. + +To make local changes to amd, simply patch and commit to the main +branch (aka HEAD). Never make local changes on the vendor (COLUMBIA) branch. + +All local changes should be submitted to "amd-dev@majordomo.cs.columbia.edu" +for inclusion in the next vendor release. + +obrien@NUXI.com +05-November-1999 diff --git a/contrib/amd/LSM.am-utils b/contrib/amd/LSM.am-utils deleted file mode 100644 index 07b736f..0000000 --- a/contrib/amd/LSM.am-utils +++ /dev/null @@ -1,20 +0,0 @@ -Begin3 -Title: am-utils -Version: 6.0.1 -Entered-date: 08SEP99 -Description: BSD Automounter Utilities - Replaces the old amd-upl102. Offers NFS V3 support, many - new features, and numerous ports. The home page for - am-utils is in http://www.am-utils.org -Keywords: amd amq hlfsd fsinfo wire-test fixmount mk-amd-map automount -Author: ezk@cs.columbia.edu (Erez Zadok) -Maintained-by: ezk@cs.columbia.edu (Erez Zadok) -Primary-site: shekel.mcl.cs.columbia.edu /pub/am-utils - 1.3MB am-utils-6.0.1.tar.gz - 1.3MB am-utils.tar.gz - 1.3MB am-utils-snapshot.tar.gz -Alternate-site: http://www.am-utils.org/mirrors.html -Original-site: ftp.cs.columbia.edu /pub/amd -Platforms: all modern Unix systems -Copying-policy: BSD -End diff --git a/contrib/amd/TODO b/contrib/amd/TODO deleted file mode 100644 index 07fb555..0000000 --- a/contrib/amd/TODO +++ /dev/null @@ -1,177 +0,0 @@ -# -*- text -*- - -Make a tasks file that people can pick jobs off of. - -take a look at am_compat.h and fix everything there... - -fix all $Id bla bla bla $ on every file. -add my own copyright 1997 etc. - -NOT NEEDED: convert DEBUG symbol to ENABLE_DEBUG -NOT NEEDED: convert DEBUG_MEM symbol to ENABLE_DEBUG_MEM - -Use these two somewhere: -AC_DEFINE(AM_UTILS_NAME_PACKAGE, "am-utils") -AC_DEFINE(AM_UTILS_VERSION, "6.0a1) - -check all "dnl XXX: in configure.in - -check for: INLINE, Const->const, P_void, VOIDP - -rename DEBUG_MTAB to DEBUG_MNTTAB -rename UPDATE_MTAB to MOUNT_TABLE_ON_FILE -rename HAS_NIS_MAPS to HAVE_MAP_NIS -rename HAS_TFS to HAVE_FS_TFS -rename SIG_HNDL_TYP to RETSIGTYPE - -remove HOST_EXEC #define from everywhere. add to am_ops.c a static flag -initialized_vops, which if not true, should set the host_ops vector field to -0 or host_umounted. This way let the feature be turned on if -h option to -amd is given. - -nuke all code that is ifdef'd SUNOS4_COMPAT - -rename NEED_MNTOPT_PARSER to HAVE_HASMNTOPT and cleanup the code. also take -the supplied code in amd/mount_fs.c and include it as the library function -libamd/hasmntopt.c - -TLI code needs to be fixed. - -a way to include a site-specific configuration file IFF it exists from -directory local/<${target}.h> - -replace #include WAIT with nothing (HAVE_SYS_WAIT_H?) - -replace SYS5_SIGNALS with HAVE_SYS_WAIT_H (which is on only if it sys/wait.h -exists and is using the newer "int" for type, not "union wait". The macro -AC_HEADER_SYS_WAIT turns on HAVE_SYS_WAIT_H iff wait*() functions are -posix.1 compliant. Make sure you don't remove SYS5_SIGNALS ifdef's that are -not related to wait*() syscalls. - -add username, hostname, and date at which time amd was compiled. - -No more need for MOUNT_HELPER_SOURCE. - -any code which is included by NEED_UMOUNT_FS, should be on iff -MOUNT_TABLE_ON_FILE is on. - -replace NFS_FH_FIELD with references fo ".fh" in calls to -NFS_FH_DREF(src, dst) macro - -For *EVERY* M4 Macro with case/esac, check that the $host_os case entries -are correct. - -I'm not using amd's regexp code. Instead, use generic system code. If the -system has posix style regexp functions, then change amd/map.c to use -correct new prototype. - -use HAVE_SVC_GETREQSET instead of RPC_4. - -replace all "jsp" in *.[hc] $Id: TODO,v 1.1.1.1 1998/11/05 02:04:19 ezk Exp $ with ezk. - -use MNTTAB_FILE_NAME instead of MOUNTED - -use MOUNT_TABLE_ON_FILE instead of READ_MTAB_FROM_FILE - -no more HAS_EMPTY_AUTOMOUNTS, which was used if a df(1) divide by zero bug -was invoked. Instead, change nfs_statfs() code to always return non-zero -values. Then nuke HAS_EMPTY_AUTOMOUNTS. - -REGEXP: use whatever regular expressionlibrary you have on the system, -including regexp.h if available, and using regcomp/regexec. Amd was written -with BSD regexps in mind, not Sys V, so if I use any of those, I have to -watch for correct usage. Otherwise, I can include the older include/re.h -and amd/re.c. Replace HAS_REGEXP with HAVE_REGEXEC. - -The regex code in amd/mapc.c has changed a lot. It probably has bugs. Must -test and debug it!!! - -# string name of filesystem in /etc/mnttab file -Use MNTTAB_TYPE_FOO instead of MTAB_TYPE_FOO. -# string name of mount option in /etc/mnttab file -Use MNTTAB_OPT_FOO instead of MNTOPT_FOO. -# string (or integer?) name of filesystem type in mount(2) syscall -Use MOUNT_TYPE_FOO instead of MNTTYPE_FOO or MOUNT_FOO. -# hex/number of FS mount option in nfs_args passed to mount(2) syscall -Use MNT2_NFS_OPT_FOO instead NFSMNT_FOO. -# hex/number of generic FS mount option directly passed to mount(2) syscall -Use MNT2_GEN_OPT_FOO instead of MS_FOO or M_FOO. - - -update AMD_COMPAT to 6.0 in include/am_utils.h - -convert all mem* functions b* functions (memset to bzero, etc.) or vice -verse. - -put my name/copyright on every src file - -change all struct mnttab/mntent to "mntent_t" - -cleanup lib/resvport.c (TLI vs. Sockets). TLI code is #defin'ed -HAVE_T_OPEN. -[ -setting MTAB_LOCK_FILE (mtab_svr4.c) should be an amd run-time configuration -option. - -change all UMOUNT_FS macros to umount_fs() fxn calls. - -remove getnetbyaddr() from lib/getnetbyaddr.c and then link w/ -lsocket - -take care of various (hlfsd et al) scripts in Makefile.am files. - -rename HOSTNAMESZ to MAXHOSTNAMELEN - -turn on all the NEW_TOPLVL_READDIR code (for "ls" to work in an amd point) - -change all NEW_DEFAULTS to ENABLE_DEFAULT_SELECTOTS (which is now on by -default) - -remove refereces to mnt_freq and mnt_passno in mntent_t since it's not in -use any more. - -remove all the (lint?) comments /*ARGSUSED */ - -change HAS_FOOFS to HAVE_AM_FS_FOO (for example HAS_NFSX -> HAVE_AM_FS_FOO), -but change HAS_UNION_FS to HAVE_AM_FS_UNION. - -some code uses #ifdef M_NEWTYPE to tell if mount(2)'s type field is "char *" -or int. Use MTYPE_TYPE declaration instead (not ifdef macro!) - -change DEBUG_MTAB to DEBUG_MNTTAB - -deal with the changes in values of $os, $arch, and $osver! - -replace SYS5_SIGNALS with REINSTATE_SIGNAL_HANDLER - -figure out how to auto-conf HAS_HESIOD_RELOAD (amd/info_hesiod.c). For now -I've used the macro HAVE_HS_ZONE_TRANSFER. - - - - -****************************************************************************** -PERL SCRIPT TO FIX OLD AMD MAPS: -- fix '=' to ':=' -- fix sos5 -> solaris2, etc. - -****************************************************************************** -USE AS IS: - -- SVC_IN_ARG_TYPE (change from SVC_IN_ARGS_TYPE, with an 'S') -- NFS_FH_TYPE -- MTYPE_TYPE -- MOUNT_TYPE_* NO!!! - -****************************************************************************** -NEW FEATURES: - -- autofs -- cachefs -- dbm/gdbm/db file maps -- add amd option -O (override) to override $os, $osver, $arch, $karch, etc. - -****************************************************************************** -DONE: - -HAS_TFS is gone and all of it's code too. -major code cleanup, removed if 0 code and if notdef diff --git a/contrib/amd/amd/amd.8 b/contrib/amd/amd/amd.8 index ff2bfc2..da10482 100644 --- a/contrib/amd/amd/amd.8 +++ b/contrib/amd/amd/amd.8 @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 1997-2003 Erez Zadok +.\" Copyright (c) 1997-1999 Erez Zadok .\" Copyright (c) 1989 Jan-Simon Pendry .\" Copyright (c) 1989 Imperial College of Science, Technology & Medicine .\" Copyright (c) 1989 The Regents of the University of California. @@ -38,320 +38,312 @@ .\" .\" %W% (Berkeley) %G% .\" -.\" $Id: amd.8,v 1.4.2.4 2003/03/16 01:46:59 ezk Exp $ +.\" $Id: amd.8,v 1.3 1999/09/30 21:01:29 ezk Exp $ +.\" $FreeBSD$ .\" -.TH AMD 8 "3 November 1989" -.SH NAME -amd \- automatically mount file systems -.SH SYNOPSIS -.B amd -.B \-H -.br -.B amd -[ -.BI \-F " conf_file" -] -.br -.B amd -[ -.B \-nprvHS -] [ -.BI \-a " mount_point" -] [ -.BI \-c " duration" -] [ -.BI \-d " domain" -] [ -.BI \-k " kernel-arch" -] [ -.BI \-l " logfile" -] [ -.BI \-o " op_sys_ver" -] [ -.BI \-t " interval.interval" -] [ -.BI \-w " interval" -] [ -.BI \-x " log-option" -] [ -.BI \-y " YP-domain" -] [ -.BI \-C " cluster-name" -] [ -.BI \-D " option" -] [ -.BI \-F " conf_file" -] [ -.BI \-O " op_sys_name" -] [ -.BI \-T " tag" -] -[ -.I directory -.I mapname -.RI [ " \-map-options " ] -] .\|.\|. -.SH DESCRIPTION -.B Amd -is a daemon that automatically mounts filesystems -whenever a file or directory -within that filesystem is accessed. -Filesystems are automatically unmounted when they -appear to have become quiescent. -.LP -.B Amd +.Dd April 19, 1994 +.Dt AMD 8 +.Os +.Sh NAME +.Nm amd +.Nd automatically mount file systems +.Sh SYNOPSIS +.Nm amd +.Fl H +.Nm amd +.Op Fl F Ar conf_file +.Nm amd +.Op Fl nprvHS +.Op Fl a Ar mount_point +.Op Fl c Ar duration +.Op Fl d Ar domain +.Bk -words +.Op Fl k Ar kernel-arch +.Ek +.Op Fl l Ar logfile +.Op Fl o Ar op_sys_ver +.Op Fl t Ar timeout.retransmit +.Bk -words +.Op Fl w Ar interval +.Ek +.Op Fl x Ar log-option +.Op Fl y Ar YP-domain +.Bk -words +.Op Fl C Ar cluster-name +.Ek +.Op Fl D Ar option +.Op Fl F Ar conf_file +.Op Fl O Ar op_sys_name +.Op Fl T Ar tag +.Oo +.Ar directory mapname +.Op Fl map-options +.Oc +.Ar ... +.Sh DESCRIPTION +.Nm Amd +is a daemon that automatically mounts file systems whenever a file or directory +within that file system is accessed. File systems are automatically unmounted +when they appear to be quiescent. +.Pp +.Nm Amd operates by attaching itself as an -.SM NFS +.Tn NFS server to each of the specified -.IB directories . +.Ar directories . Lookups within the specified directories are handled by -.BR amd , +.Nm amd , which uses the map defined by -.I mapname -to determine how to resolve the lookup. -Generally, this will be a host name, some filesystem information -and some mount options for the given filesystem. -.LP +.Ar mapname +to determine how to resolve the lookup. Generally, this will be a host name, +some file system information and some mount options for the given file system. +.Pp In the first form depicted above, -.B amd +.Nm amd will print a short help string. In the second form, if no options are -specified, or the -.B -F -is used, -.B amd -will read configuration parameters from the file -.I conf_file +specified, or if the +.Fl F +is used, +.Nm amd +will read configuration parameters from the file +.Ar conf_file which defaults to -.BR /etc/amd.conf . +.Pa /etc/amd.conf . The last form is described below. -.SH OPTIONS - -.\"*******************************************************" - -.TP -.BI \-a " temporary-directory" +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl a Ar temporary-directory Specify an alternative location for the real mount points. The default is -.BR /a . - -.TP -.BI \-c " duration" +.Pa /.amd_mnt . +.It Fl c Ar duration Specify a -.IR duration , +.Ar duration , in seconds, that a looked up name remains cached when not in use. The default is 5 minutes. - -.TP -.BI \-d " domain" +.It Fl d Ar domain Specify the local domain name. If this option is not given the domain name is determined from the hostname. - -.TP -.BI \-k " kernel-arch" +.It Fl k Ar kernel-arch Specifies the kernel architecture. This is used solely to set the ${karch} selector. - -.TP -.BI \-l " logfile" +.It Fl l Ar logfile Specify a logfile in which to record mount and unmount events. If -.I logfile +.Ar logfile is the string -.B syslog -then the log messages will be sent to the system log daemon by -.IR syslog (3). -The default syslog facility used is LOG_DAEMON. If you -wish to change it, append its name to the log file name, delimited by a -single colon. For example, if -.I logfile +.Em syslog , +the log messages will be sent to the system log daemon by +.Xr syslog 3 . +The default syslog facility used is LOG_DAEMON. +If you wish to change it, append its name to the log file name, +delimited by a single colon. +For example, if +.Ar logfile is the string -.B syslog:local7 +.Dq Li syslog:local7 then -.B Amd -will log messages via -.IR syslog (3) +.Nm amd +will log messages via +.Xr syslog 3 using the LOG_LOCAL7 facility (if it exists on the system). - -.TP -.B \-n +.It Fl n Normalize hostnames. -The name refereed to by ${rhost} is normalized relative to the +The name referred to by ${rhost} is normalized relative to the host database before being used. The effect is to translate aliases into ``official'' names. - -.TP -.BI \-o " op_sys_ver" -Override the compiled-in version number of the operating system. Useful -when the built in version is not desired for backward compatibility reasons. -For example, if the build in version is ``2.5.1'', you can override it to -``5.5.1'', and use older maps that were written with the latter in mind. - -.TP -.B \-p -Print PID. +.It Fl o Ar op_sys_ver +Override the compiled-in version number of the operating system. +Useful when the built in version is not desired for backward +compatibility reasons. +For example, if the build in version is +.Dq 2.5.1 , +you can override it to +.Dq 5.5.1 , +and use older maps that were written with the latter in mind. +.It Fl p +Print +.Em PID . Outputs the process-id of -.B amd +.Nm amd to standard output where it can be saved into a file. - -.TP -.B \-r +.It Fl r Restart existing mounts. -.B Amd -will scan the mount file table to determine which filesystems +.Nm Amd +will scan the mount file table to determine which file systems are currently mounted. Whenever one of these would have been auto-mounted, -.B amd -.I inherits +.Nm amd +.Em inherits it. - -.TP -.BI \-t " timeout.retransmit" +.It Fl t Ar timeout.retransmit Specify the NFS timeout -.IR interval , -in tenths of a second, between NFS/RPC retries (for UDP only). The default -is 0.8 seconds. The second value alters the retransmit counter, which +.Ar interval , +in tenths of a second, between +.Tn NFS/RPC +retries (for UDP only). The default +is 0.8 seconds. The second value alters the restransmit counter, which defaults to 11 retransmissions. Both of these values are used by the kernel to communicate with amd. Useful defaults are supplied if either or both values are missing. - +.Pp Amd relies on the kernel RPC retransmit mechanism to trigger mount retries. The values of these parameters change the overall retry interval. Too long an interval gives poor interactive response; too short an interval causes excessive retries. - -.TP -.B \-v +.It Fl v Version. Displays version and configuration information on standard error. - -.TP -.BI \-w " interval" +.It Fl w Ar interval Specify an -.IR interval , -in seconds, between attempts to dismount -filesystems that have exceeded their cached times. -The default is 2 minutes. - -.TP -.BI \-x " options" -Specify run-time logging options. The options are a comma separated -list chosen from: fatal, error, user, warn, info, map, stats, all. - -.TP -.BI \-y " domain" -Specify an alternative NIS domain from which to fetch the NIS maps. -The default is the system domain name. This option is ignored if NIS +.Ar interval , +in seconds, between attempts to dismount file systems that have exceeded their +cached times. The default is 2 minutes. +.It Fl x Ar options +Specify run-time logging options. The options are a comma separated list +chosen from: fatal, error, user, warn, info, map, stats, all. +.It Fl y Ar domain +Specify an alternative +.Tn NIS +domain from which to fetch the +.Tn NIS +maps. +The default is the system domain name. +This option is ignored if +.Tn NIS support is not available. - -.TP -.BI \-C " cluster-name" +.It Fl C Ar cluster-name Specify an alternative HP-UX cluster name to use. - -.TP -.BI \-D " option" +.It Fl D Ar option Select from a variety of debug options. Prefixing an -option with the strings -.B no +option with the string +.Em no reverses the effect of that option. Options are cumulative. The most useful option is -.BR all . +.Ar all . +.Pp Since -.I \-D +.Fl D is only used for debugging other options are not documented here: -the current supported set of options is listed by the \-v option +the current supported set of options is listed by the +.Fl v +option and a fuller description is available in the program source. - -.TP -.BI \-F " conf_file" -Specify an amd configuration file to use. See -.BR amd.conf (5) +.It Fl F Ar conf_file +Specify an +.Nm amd +configuration file to use. See +.Xr amd.conf 5 for description of this file's format. This configuration file is used to specify any options in lieu of typing many of them on the command line. The -.I amd.conf -file includes directives for every command line option amd has, and many -more that are only available via the configuration file facility. The -configuration file specified by this option is processed after all other -options had been processed, regardless of the actual location of this option -on the command line. - -.TP -.B \-H +.Nm amd.conf +file includes directives for every command line option amd has, +and many more that are only available via the configuration file +facility. The configuration file specified by this option is +processed after all other options have been processed, regardless +of the actual location of this option on the command line. +.It Fl H Print help and usage string. - -.TP -.BI \-O " op_sys_name" -Override the compiled-in name of the operating system. Useful when the -built in name is not desired for backward compatibility reasons. For -example, if the build in name is ``sunos5'', you can override it to -``sos5'', and use older maps which were written with the latter in mind. - -.TP -.B \-S -Do not lock the running executable pages of amd into memory. To improve -amd's performance, systems that support the -.BR plock (3) -call, could lock the amd process into memory. This way there is less chance -the operating system will schedule, page out, and swap the amd process as -needed. This tends improves amd's performance, at the cost of reserving the -memory used by the amd process (making it unavailable for other processes). +.It Fl O Ar op_sys_name +Override the compiled-in name of the operating system. +Useful when the built in name is not desired for backward +compatibility reasons. +For example, if the build in name is +.Dq sunos5 , +you can override it to +.Dq sos5 +and use older maps which were written with the latter in mind. +.It Fl S +Do not lock the running executable pages of +.Nm amd +into memory. To improve +.Nm amd's +performance, systems that support the +.Xr plock 3 +call, could lock the +.Nm amd +process into memory. This way there is less chance the operating system will +schedule, page out, and swap the +.Nm amd +process as needed. This tends to improve +.Nm amd's +performance, at the cost of reserving the memory used by the +.Nm amd +process +(making it unavailable for other processes). If this behavior is not desired, use the -.B \-S +.Fl S option. - -.TP -.BI \-T " tag" +.It Fl T Ar tag Specify a tag to use with -.BR amd.conf (5). -All map entries tagged with -.I tag -will be processed. Map entries that are not tagged are always processed. +.Xr amd.conf 5 . +All Map entries tagged with tag will be processed. +Map entries that are not tagged are always processed. Map entries that are tagged with a tag other than -.I tag +.Ar tag will not be processed. - -.SH FILES -.PD 0 -.TP 5 -.B /a -directory under which filesystems are dynamically mounted -.TP 5 -.B /etc/amd.conf +.El +.Sh FILES +.Bl -tag -width /axx +.It Pa /.amd_mnt +directory under which file systems are dynamically mounted +.It Pa /etc/amd.conf default configuration file -.PD -.SH CAVEATS +.El +.Sh CAVEATS Some care may be required when creating a mount map. -.LP -Symbolic links on an NFS filesystem can be incredibly inefficient. -In most implementations of NFS, their interpolations are not cached -by the kernel and each time a symlink is encountered during a -.I lookuppn -translation it costs an RPC call to the NFS server. -It would appear that a large improvement in real-time +.Pp +Symbolic links on an +.Tn NFS +file system can be incredibly inefficient. +In most implementations of +.Tn NFS , +their interpolations are not cached by +the kernel and each time a symbolic link is +encountered during a +.Em lookuppn +translation it costs an +.Tn RPC +call to the +.Tn NFS +server. +A large improvement in real-time performance could be gained by adding a cache somewhere. -Replacing symlinks with a suitable incarnation of the auto-mounter +Replacing +.Xr symlink 2 +with a suitable incarnation of the auto-mounter results in a large real-time speedup, but also causes a large number of process context switches. -.LP +.Pp A weird imagination is most useful to gain full advantage of all the features. -.SH "SEE ALSO" -.BR amd.conf (5), -.BR amq (8), -.BR domainname (1), -.BR hostname (1), -.BR automount (8), -.BR mount (8), -.BR umount (8), -.BR mtab (5), -.BR syslog (3). -.LP -.I "Amd \- The 4.4 BSD Automounter" -.SH AUTHORS -Jan-Simon Pendry <jsp@doc.ic.ac.uk>, Department of Computing, Imperial College, London, UK. -.P -Erez Zadok <ezk@cs.columbia.edu>, Department of Computer Science, Columbia -University, New York, USA. -.P +.Sh SEE ALSO +.Xr domainname 1 , +.Xr hostname 1 , +.Xr syslog 3 , +.Xr amd.conf 5 , +.Xr mtab 5 , +.Xr amq 8 , +.Xr mount 8 , +.Xr umount 8 +.Rs +.%T Amd \- The 4.4 BSD Automounter +.Re +.Pp +.Pa http://www.cs.columbia.edu/~ezk/am-utils/ +.Sh AUTHORS +.An Jan-Simon Pendry Aq jsp@doc.ic.ac.uk , +Department of Computing, Imperial College, London, UK. +.Pp +.An Erez Zadok Aq ezk@cs.columbia.edu , +Department of Computer Science, Columbia University, +New York, USA. +.Pp Other authors and contributors to am-utils are listed in the -.B AUTHORS +.Pa AUTHORS file distributed with am-utils. +.Sh HISTORY +The +.Nm amd +utility first appeared in +.Bx 4.4 . diff --git a/contrib/amd/amd/amd.c b/contrib/amd/amd/amd.c index 6f0374a..1ad6d0a 100644 --- a/contrib/amd/amd/amd.c +++ b/contrib/amd/amd/amd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-2001 Erez Zadok * Copyright (c) 1989 Jan-Simon Pendry * Copyright (c) 1989 Imperial College of Science, Technology & Medicine * Copyright (c) 1989 The Regents of the University of California. @@ -38,7 +38,8 @@ * * %W% (Berkeley) %G% * - * $Id: amd.c,v 1.8.2.5 2002/12/27 22:44:29 ezk Exp $ + * $Id: amd.c,v 1.8.2.3 2001/01/10 03:22:59 ezk Exp $ + * $FreeBSD$ * */ @@ -224,7 +225,7 @@ init_global_options(void) gopt.arch = HOST_ARCH; /* automounter temp dir */ - gopt.auto_dir = "/a"; + gopt.auto_dir = "/.amd_mnt"; /* cluster name */ gopt.cluster = NULL; diff --git a/contrib/amd/amd/amq_subr.c b/contrib/amd/amd/amq_subr.c index 1c4170f..e8b8c78 100644 --- a/contrib/amd/amd/amq_subr.c +++ b/contrib/amd/amd/amq_subr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-2001 Erez Zadok * Copyright (c) 1990 Jan-Simon Pendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine * Copyright (c) 1990 The Regents of the University of California. @@ -38,7 +38,8 @@ * * %W% (Berkeley) %G% * - * $Id: amq_subr.c,v 1.6.2.4 2002/12/27 22:44:33 ezk Exp $ + * $Id: amq_subr.c,v 1.6.2.2 2001/01/12 22:43:42 ro Exp $ + * $FreeBSD$ * */ /* diff --git a/contrib/amd/amd/get_args.c b/contrib/amd/amd/get_args.c index c0280f7..0f52218 100644 --- a/contrib/amd/amd/get_args.c +++ b/contrib/amd/amd/get_args.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-2001 Erez Zadok * Copyright (c) 1990 Jan-Simon Pendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine * Copyright (c) 1990 The Regents of the University of California. @@ -38,7 +38,8 @@ * * %W% (Berkeley) %G% * - * $Id: get_args.c,v 1.7.2.5 2002/12/27 22:44:34 ezk Exp $ + * $Id: get_args.c,v 1.7.2.1 2001/01/10 03:23:05 ezk Exp $ + * $FreeBSD$ * */ @@ -85,7 +86,7 @@ get_version_string(void) vers = xmalloc(2048 + wire_buf_len); sprintf(vers, "%s\n%s\n%s\n%s\n", - "Copyright (c) 1997-2003 Erez Zadok", + "Copyright (c) 1997-2001 Erez Zadok", "Copyright (c) 1990 Jan-Simon Pendry", "Copyright (c) 1990 Imperial College of Science, Technology & Medicine", "Copyright (c) 1990 The Regents of the University of California."); @@ -127,20 +128,12 @@ get_args(int argc, char *argv[]) { int opt_ch; FILE *fp = stdin; - char getopt_arguments[] = "+nprvSa:c:d:k:l:o:t:w:x:y:C:D:F:T:O:H"; - char *getopt_args; - -#ifdef HAVE_GNU_GETOPT - getopt_args = getopt_arguments; -#else /* ! HAVE_GNU_GETOPT */ - getopt_args = &getopt_arguments[1]; -#endif /* HAVE_GNU_GETOPT */ /* if no arguments were passed, try to use /etc/amd.conf file */ if (argc <= 1) use_conf_file = 1; - while ((opt_ch = getopt(argc, argv, getopt_args)) != -1) + while ((opt_ch = getopt(argc, argv, "nprvSa:c:d:k:l:o:t:w:x:y:C:D:F:T:O:H")) != -1) switch (opt_ch) { case 'a': diff --git a/contrib/amd/amd/srvr_nfs.c b/contrib/amd/amd/srvr_nfs.c index d2b7a62..b5687ac 100644 --- a/contrib/amd/amd/srvr_nfs.c +++ b/contrib/amd/amd/srvr_nfs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-2001 Erez Zadok * Copyright (c) 1990 Jan-Simon Pendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine * Copyright (c) 1990 The Regents of the University of California. @@ -38,7 +38,8 @@ * * %W% (Berkeley) %G% * - * $Id: srvr_nfs.c,v 1.7.2.10 2002/12/29 01:55:43 ib42 Exp $ + * $Id: srvr_nfs.c,v 1.7.2.5 2001/04/14 21:08:23 ezk Exp $ + * $FreeBSD$ * */ @@ -411,23 +412,21 @@ nfs_timed_out(voidp v) * Another ping has failed */ np->np_ping++; - if (np->np_ping > 1) - srvrlog(fs, "not responding"); /* * Not known to be up any longer */ - if (FSRV_ISUP(fs)) + if (FSRV_ISUP(fs)) { fs->fs_flags &= ~FSF_VALID; + if (np->np_ping > 1) + srvrlog(fs, "not responding"); + } /* * If ttl has expired then guess that it is dead */ if (np->np_ttl < clocktime()) { int oflags = fs->fs_flags; -#ifdef DEBUG - dlog("ttl has expired"); -#endif /* DEBUG */ if ((fs->fs_flags & FSF_DOWN) == 0) { /* * Server was up, but is now down. @@ -453,10 +452,6 @@ nfs_timed_out(voidp v) } if (oflags != fs->fs_flags && (fs->fs_flags & FSF_WANT)) wakeup_srvr(fs); - /* - * Reset failed ping count - */ - np->np_ping = 0; } else { #ifdef DEBUG if (np->np_ping > 1) @@ -465,12 +460,6 @@ nfs_timed_out(voidp v) } /* - * New RPC xid, so any late responses to the previous ping - * get ignored... - */ - np->np_xid = NPXID_ALLOC(struct ); - - /* * Run keepalive again */ nfs_keepalive(fs); @@ -606,22 +595,21 @@ nfs_srvr_port(fserver *fs, u_short *port, voidp wchan) static void start_nfs_pings(fserver *fs, int pingval) { - if (fs->fs_flags & FSF_PINGING) { + if (!(fs->fs_flags & FSF_PINGING)) { + fs->fs_flags |= FSF_PINGING; + if (fs->fs_cid) + untimeout(fs->fs_cid); + if (pingval < 0) { + srvrlog(fs, "wired up"); + fs->fs_flags |= FSF_VALID; + fs->fs_flags &= ~FSF_DOWN; + } else { + nfs_keepalive(fs); + } + } else { #ifdef DEBUG dlog("Already running pings to %s", fs->fs_host); #endif /* DEBUG */ - return; - } - - if (fs->fs_cid) - untimeout(fs->fs_cid); - if (pingval < 0) { - srvrlog(fs, "wired up"); - fs->fs_flags |= FSF_VALID; - fs->fs_flags &= ~FSF_DOWN; - } else { - fs->fs_flags |= FSF_PINGING; - nfs_keepalive(fs); } } diff --git a/contrib/amd/amq/amq.8 b/contrib/amd/amq/amq.8 index 7f705a8..7d928bb 100644 --- a/contrib/amd/amq/amq.8 +++ b/contrib/amd/amq/amq.8 @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 1997-2003 Erez Zadok +.\" Copyright (c) 1997-1999 Erez Zadok .\" Copyright (c) 1990 Jan-Simon Pendry .\" Copyright (c) 1990 Imperial College of Science, Technology & Medicine .\" Copyright (c) 1990 The Regents of the University of California. @@ -38,181 +38,177 @@ .\" .\" %W% (Berkeley) %G% .\" -.\" $Id: amq.8,v 1.3.2.7 2002/12/27 22:44:45 ezk Exp $ +.\" $Id: amq.8,v 1.2 1999/01/10 21:53:58 ezk Exp $ +.\" $FreeBSD$ .\" -.TH AMQ 8 "25 April 1989" -.SH NAME -amq \- automounter query tool -.SH SYNOPSIS -.B amq -[ -.BI \-fmpsvwHTU -] [ -.BI \-h " hostname" -] [ -.BI \-l " log_file" -] [ -.BI \-x " log_options" -] [ -.BI \-D " debug_options" -] [ -.BI \-P " program_number" -] [[ -.B \-u -] -.I directory .\|.\|. -] -.SH DESCRIPTION -.B Amq -provides a simple way of determining the current state of -.B amd +.Dd March 16, 1991 +.Dt AMQ 8 +.Os +.Sh NAME +.Nm amq +.Nd automounter query tool +.Sh SYNOPSIS +.Nm amq +.Op Fl fmpsuvTU +.Op Fl h Ar hostname +.Op Fl l Ar log_file +.Op Fl x Ar log_options +.Op Fl D Ar debug_options +.Op Fl M Ar mountmap_entry +.Op Fl P Ar program_number +.Op Ar directory +.Ar ... +.Sh DESCRIPTION +.Nm Amq +provides a simple way of determining the current state of the +.Xr amd 8 program. Communication is by -.SM RPC. -Three modes of operation are supported by the current protocol. By default -a list of mount points and auto-mounted filesystems is output. An -alternative host can be specified using the -.I \-h +.Tn RPC . +Three modes of operation are supported by the current protocol. +By default a list of mount points and auto-mounted file systems +is output. +An alternative host can be specified using the +.Fl h option. -.LP -If -.I directory -names are given, as output by default, then per-filesystem -information is displayed. -.SH OPTIONS - -.TP -.B \-f -Ask the automounter to flush the internal caches and reload all the maps. - -.TP -.BI \-h " hostname" -Specify an alternate host to query. By default the local host is used. In -an -.SM HP-UX -cluster, the root server is queried by default, since that is the system on -which the automounter is normally run. - -.TP -.BI \-l " log_file" +.Pp +If directory names are given, as output by default, +then per file system information is displayed. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl f +Request automounter to flush the internal caches. +.It Fl h Ar hostname +Query alternate host +.Ar hostname . +By default the local host is used. In an +.Tn HP-UX +cluster, the root server is queried by default, since +that is the system on which the automounter is normally run. +.It Fl l Ar log_file Tell amd to use -.I log_file -as the log file name. For security reasons, this must be the same log file -which amd used when started. This option is therefore only useful to -refresh amd's open file handle on the log file, so that it can be rotated -and compressed via daily cron jobs. - -.TP -.B \-m -Ask the automounter to provide a list of mounted filesystems, including the -number of references to each filesystem and any error which occurred while -mounting. - -.TP -.B \-p -Return the process ID of the remote or locally running amd. Useful when you -need to send a signal to the local amd process, and would rather not have to -search through the process table. This option is used in the -.I ctl-amd +.Ar log_file +as the log file name. +For security reasons, this must be the same log file which +.Nm amd +used when started. This option is therefore only useful to +refresh +.Nm amd Ns \'s +open file handle on the log file, so that it can be rotated and compressed via +daily cron jobs. +.It Fl m +Request the automounter to provide a list of mounted file systems, +including the number of references to each file system and any error +which occurred while mounting. +.It Fl p +Return the process ID of the remote or locally running +.Nm amd . +Useful when you need to send a signal to the local +.Nm amd +process, and would rather not have to search through the process table. This +option is used in the +.Pa ctl-amd script. - -.TP -.B \-s -Ask the automounter to provide system-wide mount statistics. - -.TP -.B \-u -Ask the automounter to unmount the filesystems named in -.I directory -instead of providing -information about them. Unmounts are requested, not forced. They merely -cause the mounted filesystem to timeout, which will be picked up by -.BR amd 's +.It Fl s +Request the automounter to provide system-wide mount statistics. +.It Fl u +Request the automounter to unmount the named file systems +instead of providing information about them. Unmounts are requested, +not forced. They merely cause the mounted file system to timeout, +which will be picked up by +.Nm amd Ns \'s main scheduler thus causing the normal timeout action to be taken. - -.TP -.B \-v -Ask the automounter for its version information. This is a subset of the -information output by -.BR amd 's -.I -v +.It Fl v +Request the automounter to provide version information. This is a subset +of the information provided by +.Nm amd Ns \'s Fl v option. - -.TP -.B \-w -Translate a full pathname as returned by -.IR getpwd (3) -into a short -.B Amd -pathname that goes through its mount points. This option requires that -.B Amd -is running. - -.TP -.BI \-x " log_options" -Ask the automounter to use the logging options specified in -.I log_options +.It Fl x Ar log_options +Ask the automounter to use the logging options specified in +.Ar log_options from now on. - -.TP -.BI \-D " log_options" -Ask the automounter to use the debugging options specified in -.I debug_options +.It Fl D Ar log_options +Ask the automounter to use the debugging options specified in +.Ar debug_options from now on. - -.TP -.B \-H -Display short usage message. - -.TP -.BI \-P " program_number" -Contact an alternate running amd that had registered itself on a different -RPC -.I program_number -and apply all other operations to that instance of the automounter. This is -useful when you run multiple copies of amd, and need to manage each -one separately. If not specified, amq will use the default program number -for amd, 300019. For security reasons, the only alternate program numbers -amd can use range from 300019 to 300029, inclusive. - -.TP -.B \-T +.It Fl M +Pass a mount map entry to +.Nm amd +and wait for it to be evaluated, possibly causing a mount. +This option is highly insecure. +By default, +.Nm amd +and +.Nm amq +do not support it. +It is necessary to configure +.Nm am-utils +with +.Ar --enable-amq-mount +to enable this option. +.It Fl P Ar program_number +Contact an alternate running +.Nm amd +that had registered itself on a different RPC +.Ar program_number +and apply all other operations to that instance of the automounter. +This is useful when running multiple copies of +.Nm amd , +and need to manage each one separately. +If not specified, +.Nm amq +will use the default program number for +.Nm amd , +300019. +For security reasons, the only alternate program numbers +.Nm amd +can use range from 300019 to 300029, inclusive. +.It Fl T Contact -.B amd -using the TCP transport only. Normally -.B amq -will try TCP, and if that failed, will try UDP. - -.TP -.B \-U -Contact -.B amd -using UDP (connectionless) transport only. Normally -.B amq -will try TCP, and if that failed, will try UDP. - -.SH FILES -.PD 0 -.TP 20 -.B amq.x -.SM RPC +.Nm amd +using the TCP transport only. +Normally +.Nm amq +will try TCP, and if that fails, will try UDP. +.It Fl U +Contact +.Nm amd +using UDP (connectionless) transport only. +Normally +.Nm amq +will try TCP, and if that fails, will try UDP. +.El +.Sh FILES +.Bl -tag -width amq.x -compact +.It Pa amq.x +.Tn RPC protocol description. -.SH CAVEATS -.B Amq +.El +.Sh CAVEATS +.Nm Amq uses a Sun registered -.SM RPC +.Tn RPC program number (300019 decimal) which may not -be in the /etc/rpc database. -.SH "SEE ALSO" -.BR amd (8), -.BR ctl-amd (8), -.BR amd.conf (5). -.SH AUTHORS -Jan-Simon Pendry <jsp@doc.ic.ac.uk>, Department of Computing, Imperial College, London, UK. -.P -Erez Zadok <ezk@cs.columbia.edu>, Department of Computer Science, Columbia -University, New York, USA. -.P -Other authors and contributors to am-utils are listed in the -.B AUTHORS -file distributed with am-utils. +be in the +.Pa /etc/rpc +database. +.Sh SEE ALSO +.Xr amd.conf 5 , +.Xr amd 8 +.Sh AUTHORS +.An Jan-Simon Pendry Aq jsp@doc.ic.ac.uk , +Department of Computing, Imperial College, London, UK. +.Pp +.An Erez Zadok Aq ezk@cs.columbia.edu , +Department of Computer Science, Columbia University, New York, USA. +.Pp +.An Other authors and contributors to +.Nm am-utils +are listed in the +.Nm AUTHORS +file distributed with +.Nm am-utils . +.Sh HISTORY +.Nm Amq +first appeared in +.Bx 4.4 . diff --git a/contrib/amd/amq/amq.c b/contrib/amd/amq/amq.c index 98f70d8..e49cabc 100644 --- a/contrib/amd/amq/amq.c +++ b/contrib/amd/amq/amq.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-2001 Erez Zadok * Copyright (c) 1990 Jan-Simon Pendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine * Copyright (c) 1990 The Regents of the University of California. @@ -38,23 +38,26 @@ * * %W% (Berkeley) %G% * - * $Id: amq.c,v 1.7.2.8 2002/12/27 22:44:45 ezk Exp $ + * $Id: amq.c,v 1.7.2.5 2001/01/12 22:43:43 ro Exp $ * */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + /* * Automounter query tool */ #ifndef lint char copyright[] = "\ -@(#)Copyright (c) 1997-2003 Erez Zadok\n\ +@(#)Copyright (c) 1997-2001 Erez Zadok\n\ @(#)Copyright (c) 1990 Jan-Simon Pendry\n\ @(#)Copyright (c) 1990 Imperial College of Science, Technology & Medicine\n\ @(#)Copyright (c) 1990 The Regents of the University of California.\n\ @(#)All rights reserved.\n"; #if __GNUC__ < 2 -static char rcsid[] = "$Id: amq.c,v 1.7.2.8 2002/12/27 22:44:45 ezk Exp $"; +static char rcsid[] = "$Id: amq.c,v 1.7.2.5 2001/01/12 22:43:43 ro Exp $"; static char sccsid[] = "%W% (Berkeley) %G%"; #endif /* __GNUC__ < 2 */ #endif /* not lint */ @@ -251,7 +254,14 @@ show_mi(amq_mount_info_list *ml, enum show_opt e, int *mwid, int *dwid, int *twi mi->mi_up > 0 ? "up" : mi->mi_up < 0 ? "starting" : "down"); if (mi->mi_error > 0) { - printf(" (%s)", strerror(mi->mi_error)); + if (mi->mi_error < sys_nerr) +#ifdef HAVE_STRERROR + printf(" (%s)", strerror(mi->mi_error)); +#else /* not HAVE_STRERROR */ + printf(" (%s)", sys_errlist[mi->mi_error]); +#endif /* not HAVE_STRERROR */ + else + printf(" (Error %d)", mi->mi_error); } else if (mi->mi_error < 0) { fputs(" (in progress)", stdout); } diff --git a/contrib/amd/amq/pawd.1 b/contrib/amd/amq/pawd.1 index 99fca6a..6713907 100644 --- a/contrib/amd/amq/pawd.1 +++ b/contrib/amd/amq/pawd.1 @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 1997-2003 Erez Zadok +.\" Copyright (c) 1997-1999 Erez Zadok .\" Copyright (c) 1990 Jan-Simon Pendry .\" Copyright (c) 1990 Imperial College of Science, Technology & Medicine .\" Copyright (c) 1990 The Regents of the University of California. @@ -38,35 +38,43 @@ .\" .\" %W% (Berkeley) %G% .\" -.\" $Id: pawd.1,v 1.3.2.3 2002/12/27 22:44:46 ezk Exp $ +.\" $Id: pawd.1,v 1.2 1998/09/05 06:56:36 obrien Exp $ +.\" $FreeBSD$ .\" -.TH PAWD 1 "6 Jan 1998" -.SH NAME -pawd \- print automounter working directory -.SH SYNOPSIS -.B pawd -[ -.I path ... -] -.SH DESCRIPTION -.LP -.B pawd +.Dd January 6, 1998 +.Dt PAWD 1 +.Os +.Sh NAME +.Nm pawd +.Nd print automounter working directory +.Sh SYNOPSIS +.Nm +.Op Ar path ... +.Sh DESCRIPTION +.Nm is used to print the current working directory, adjusted to reflect proper paths that can be reused to go through the automounter for the shortest possible path. In particular, the path printed back does not include any of -.BR Amd 's +.Nm Amd Ns \'s local mount points. Using them is unsafe, because -.B Amd +.Nm Amd may unmount managed file systems from the mount points, and thus including them in paths may not always find the files within. -.P +.Pp Without any arguments, -.B pawd +.Nm will print the automounter adjusted current working directory. With any -number of arguments, it will print the adjusted path of each one of the +number of arguments, it will print the adjusted +.Ar path +of each one of the arguments. -.SH "SEE ALSO" -.BR amd (8), -.BR amq (8), -.BR pwd (1). +.Sh SEE ALSO +.Xr pwd 1 , +.Xr amd 8 , +.Xr amq 8 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 3.0 . diff --git a/contrib/amd/conf/mount/mount_freebsd3.c b/contrib/amd/conf/mount/mount_freebsd3.c deleted file mode 100644 index 5888ed9..0000000 --- a/contrib/amd/conf/mount/mount_freebsd3.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 1997-1998 Erez Zadok - * Copyright (c) 1990 Jan-Simon Pendry - * Copyright (c) 1990 Imperial College of Science, Technology & Medicine - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Jan-Simon Pendry at Imperial College, London. - * - * 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. - * - * %W% (Berkeley) %G% - * - * $Id: mount_freebsd3.c,v 5.2.2.1 1992/02/09 15:10:08 jsp beta $ - * - */ - -/* - * FreeBSD 3.x (as of snapshot 3.0-980311-SNAP) Mount helper - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif /* HAVE_CONFIG_H */ -#include <am_defs.h> -#include <amu.h> - -/* - * Map from conventional mount arguments - * to FreeBSD 3.0 style arguments. - */ -int -mount_freebsd3(MTYPE_TYPE type, const char *dir, int flags, voidp data) -{ - char const *namelist[] = INITMOUNTNAMES; - - return mount(namelist[type], - dir, - flags, - data); -} diff --git a/contrib/amd/conf/nfs_prot/nfs_prot_freebsd2.h b/contrib/amd/conf/nfs_prot/nfs_prot_freebsd2.h index 53bb906..252da9b 100644 --- a/contrib/amd/conf/nfs_prot/nfs_prot_freebsd2.h +++ b/contrib/amd/conf/nfs_prot/nfs_prot_freebsd2.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-2001 Erez Zadok * Copyright (c) 1990 Jan-Simon Pendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine * Copyright (c) 1990 The Regents of the University of California. @@ -38,7 +38,8 @@ * * %W% (Berkeley) %G% * - * $Id: nfs_prot_freebsd2.h,v 1.3.2.3 2002/12/27 22:44:54 ezk Exp $ + * $Id: nfs_prot_freebsd2.h,v 1.3.2.1 2001/01/10 03:23:21 ezk Exp $ + * $FreeBSD$ * */ diff --git a/contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h b/contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h index edecdf7..6ea5c45 100644 --- a/contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h +++ b/contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-2001 Erez Zadok * Copyright (c) 1990 Jan-Simon Pendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine * Copyright (c) 1990 The Regents of the University of California. @@ -38,31 +38,39 @@ * * %W% (Berkeley) %G% * - * $Id: nfs_prot_freebsd3.h,v 1.5.2.6 2003/08/27 19:35:16 ib42 Exp $ + * $Id: nfs_prot_freebsd3.h,v 1.5.2.1 2001/01/10 03:23:22 ezk Exp $ + * $FreeBSD$ * */ #ifndef _AMU_NFS_PROT_H #define _AMU_NFS_PROT_H +/* nfs_prot.h defines struct `nfs_fh3', but it is a ``dmr "unwarranted + * chumminess with the C implementation". We need the more complete + * structure, which is defined below. So get the stock `nfs_fh3' + * out of the way. + */ +struct nfs_fh3; +#define nfs_fh3 nfs_fh3_fbsd_ + #ifdef HAVE_RPCSVC_NFS_PROT_H # include <rpcsvc/nfs_prot.h> #endif /* HAVE_RPCSVC_NFS_PROT_H */ + +#undef nfs_fh3 + #ifdef HAVE_NFS_RPCV2_H # include <nfs/rpcv2.h> #endif /* HAVE_NFS_RPCV2_H */ #ifdef HAVE_NFS_NFS_H -# include <nfs/nfs.h> +# include <nfsclient/nfs.h> +# include <nfsserver/nfs.h> #endif /* HAVE_NFS_NFS_H */ #ifdef HAVE_UFS_UFS_UFSMOUNT_H # include <ufs/ufs/ufsmount.h> #endif /* HAVE_UFS_UFS_UFSMOUNT_H */ -/* nfsclient/nfsargs.h was introduced in FreeBSD 5.0, and is needed */ -#ifdef HAVE_NFSCLIENT_NFSARGS_H -# include <nfsclient/nfsargs.h> -#endif /* HAVE_NFSCLIENT_NFSARGS_H */ - /* * MACROS: */ @@ -88,7 +96,6 @@ #define na_nlink nlink #define na_size size #define na_type type -#define na_uid uid #define ne_cookie cookie #define ne_fileid fileid #define ne_name name @@ -169,7 +176,7 @@ typedef writeargs nfswriteargs; /* * as of 3.0-RELEASE the nfs_fh3 that is defined in the system headers * (or the one generated by rpcgen) lacks the proper full definition, - * listed below. A special macro (m4/macros/struct_nfs_fh3.m4) searches + * listed below. A special macro (aux/macros/struct_nfs_fh3.m4) searches * for this special name before other names. */ struct nfs_fh3_freebsd3 { @@ -183,6 +190,10 @@ struct nfs_fh3_freebsd3 { }; typedef struct nfs_fh3_freebsd3 nfs_fh3_freebsd3; +/* since we don't use Am-utils's aux/macros/struct_nfs_fh3.m4, we don't get + their special searching. So restore the standard name. */ +typedef struct nfs_fh3_freebsd3 nfs_fh3; + #endif /* NFSMNT_NFSV3 */ #endif /* not _AMU_NFS_PROT_H */ diff --git a/contrib/amd/conf/trap/trap_freebsd3.h b/contrib/amd/conf/trap/trap_freebsd3.h deleted file mode 100644 index 95c6642..0000000 --- a/contrib/amd/conf/trap/trap_freebsd3.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $srcdir/conf/trap/trap_freebsd3.h */ -extern int mount_freebsd3(MTYPE_TYPE type, const char *dir, int flags, voidp data); -#define MOUNT_TRAP(type, mnt, flags, mnt_data) mount_freebsd3(type, mnt->mnt_dir, flags, mnt_data) diff --git a/contrib/amd/fixmount/fixmount.8 b/contrib/amd/fixmount/fixmount.8 index e16c50b..0f2c9e6 100644 --- a/contrib/amd/fixmount/fixmount.8 +++ b/contrib/amd/fixmount/fixmount.8 @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 1997-2003 Erez Zadok +.\" Copyright (c) 1997-1999 Erez Zadok .\" Copyright (c) 1990 Jan-Simon Pendry .\" Copyright (c) 1990 Imperial College of Science, Technology & Medicine .\" Copyright (c) 1990 The Regents of the University of California. @@ -38,122 +38,143 @@ .\" .\" %W% (Berkeley) %G% .\" -.\" $Id: fixmount.8,v 1.3.2.5 2003/03/16 01:46:59 ezk Exp $ +.\" $Id: fixmount.8,v 1.2 1999/01/10 21:54:26 ezk Exp $ +.\" $FreeBSD$ .\" -.TH FIXMOUNT 8 "26 Feb 1993" -.SH NAME -fixmount \- fix remote mount entries -.SH SYNOPSIS -.B fixmount -[ -.B \-adervq -] -[ -.B \-h -.I name -] -.I host +.Dd February 26, 1993 +.Dt FIXMOUNT 8 +.Os +.Sh NAME +.Nm fixmount +.Nd fix remote mount entries +.Sh SYNOPSIS +.Nm +.Op Fl adervq +.Op Fl h Ar name +.Ar host \&... -.SH DESCRIPTION -.IX "fixmount command" "" "\fLfixmount\fP \(em fix remote mount entries" -.LP -.B fixmount -is a variant of -.BR showmount (8) +.Sh DESCRIPTION +.Nm +is a variant of +.Xr showmount 8 that can delete bogus mount entries in remote -.BR mountd (8C) -daemons. -The actions specified by the options are performed for each -.I host +.Xr mountd 8 +daemons. The actions specified by the options are performed for each +.Ar host in turn. -.SH OPTIONS -.TP -.B \-a \-d \-e +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl a Fl d Fl e These options work as in -.BR showmount (8) +.Xr showmount 8 except that only entries pertaining to the local host are printed. -.TP -.B \-r +.It Fl r Removes those remote mount entries on -.I host +.Ar host that do not correspond to current mounts, i.e., which are left-over from a crash or are the result of improper mount protocol. The actuality of mounts is verified using the entries in -.BR /etc/mtab . -.TP -.B \-v +.Pa /etc/mtab . +.It Fl v Verify remote mounts. Similar to -.B \-r +.Fl r except that only a notification message is printed for each bogus entry found. The remote mount table is not changed. -.TP -.B \-A -Issues a command to the remote mountd declaring that ALL of its filesystems -have been unmounted. This should be used with caution, as it removes all -remote mount entries pertaining to the local system, whether or not any -filesystems are still mounted locally. -.TP -.B \-q -Be quiet. -Suppresses error messages due to timeouts and "Program not registered", -i.e., due to remote hosts not supporting RPC or not running mountd. -.TP -.BI \-h \ name +.It Fl A +Issues a command to the remote mountd declaring that +.Em all +of its file systems have been unmounted. This should be used with caution, as +it removes all remote mount entries pertaining to the local system, whether or +not any file systems are still mounted locally. +.It Fl v +Be quiet. Suppresses error messages due to timeouts and +.Dq Program not Registered , +i.e., due to remote hosts not supporting RPC or not running +.Nm mountd . +.It Fl h Ar name Pretend the local hostname is -.IR name . +.Ar name . This is useful after the local hostname has been changed and rmtab entries using the old name remain on a remote machine. Unfortunately, most mountd's won't be able to successfully handle removal of such entries, so this option is useful in combination with -.B \-v +.Fl v only. -.br +.Pp This option also saves time as comparisons of remotely recorded and local hostnames by address are avoided. -.SH FILES -.PD 0 -.TP 20 -.B /etc/mtab +.El +.Sh FILES +.Bl -tag -width /axx +.It Pa /etc/mtab List of current mounts. -.TP -.B /etc/rmtab -Backup file for remote mount entries on NFS server. -.PD -.SH "SEE ALSO" -.BR showmount (8), -.BR mtab (5), -.BR rmtab (5), -.BR mountd (8C). -.SH BUGS +.It Pa /etc/rmtab +Backup file for remote mount entries on +.Tn NFS +server. +.El +.Sh SEE ALSO +.Xr mtab 5 , +.Xr rmtab 5 , +.Xr mountd 8 , +.Xr showmount 8 +.Sh BUGS No attempt is made to verify the information in -.B /etc/mtab +.Pa /etc/mtab itself. -.PP +.Pp Since swap file mounts are not recorded in -.BR /etc/mtab , +.Pa /etc/mtab , a heuristic specific to SunOS is used to determine whether such a mount -is actual (replacing the string "swap" with "root" and verifying the resulting -path). -.PP +is actual (replacing the string +.Ql swap +with +.Ql root +and verifying the resulting path). +.Pp Symbolic links on the server will cause the path in the remote entry to differ -from the one in -.BR /etc/mtab . -To catch those cases, a filesystem is also deemed mounted if its -.I local +from the one in +.Pa /etc/mtab . +To catch those cases, a file system is also deemed mounted if its +.Em local mount point is identical to the remote entry. I.e., on a SunOS diskless client, -.B server:/export/share/sunos.4.1.1 +.Pa server:/export/share/sunos.4.1.1 is actually -.BR /usr/share . +.Pa /usr/share . Since the local mount point is -.B /usr/share +.Pa /usr/share as well this will be handled correctly. -.PP -There is no way to clear a stale entry in a remote mountd after the -local hostname (or whatever reverse name resolution returns for it) -has been changed. To take care of these cases, -the remote /etc/rmtab file has to be edited and mountd restarted. -.PP -The RPC timeouts for mountd calls can only be changed by recompiling. -The defaults are 2 seconds for client handle creation and 5 seconds for -RPC calls. +.Pp +There is no way to clear a stale entry in a remote +.Nm mountd +after the local hostname (or whatever reverse name resolution +returns for it) has been changed. To take care of these cases, +the remote +.Pa /etc/rmtab +file has to be edited and +.Nm mountd +restarted. +.Pp +The RPC timeouts for +.Nm mountd +calls can only be changed by recompiling. The defaults are 2 seconds +for client handle creation and 5 seconds for RPC calls. +.Sh AUTHORS +.An Jan-Simon Pendry Aq jsp@doc.ic.ac.uk , +Department of Computing, Imperial College, London, UK. +.Pp +.An Erez Zadok Aq ezk@cs.columbia.edu , +Department of Computer Science, Columbia University, New York, USA. +.Pp +.An Other authors and contributors to +.Nm am-utils +are listed in the +.Nm AUTHORS +file distributed with +.Nm am-utils . +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 3.0 . diff --git a/contrib/amd/fixmount/fixmount.c b/contrib/amd/fixmount/fixmount.c index cff31d1..f582724 100644 --- a/contrib/amd/fixmount/fixmount.c +++ b/contrib/amd/fixmount/fixmount.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-2001 Erez Zadok * Copyright (c) 1990 Jan-Simon Pendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine * Copyright (c) 1990 The Regents of the University of California. @@ -38,7 +38,8 @@ * * %W% (Berkeley) %G% * - * $Id: fixmount.c,v 1.5.2.3 2002/12/27 22:45:04 ezk Exp $ + * $Id: fixmount.c,v 1.5.2.1 2001/01/10 03:23:32 ezk Exp $ + * $FreeBSD$ * */ diff --git a/contrib/amd/fsinfo/fsinfo.8 b/contrib/amd/fsinfo/fsinfo.8 index 18c1bf5..004980d 100644 --- a/contrib/amd/fsinfo/fsinfo.8 +++ b/contrib/amd/fsinfo/fsinfo.8 @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 1997-2003 Erez Zadok +.\" Copyright (c) 1997-1999 Erez Zadok .\" Copyright (c) 1993 Jan-Simon Pendry. .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -33,69 +33,156 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)fsinfo.8 8.1 (Berkeley) 6/28/93 -.\" $Id: fsinfo.8,v 1.3.2.4 2003/03/31 20:09:02 ezk Exp $ +.\" $Id: fsinfo.8,v 1.2 1999/01/10 21:54:28 ezk Exp $ +.\" $FreeBSD$ .\" -.TH FSINFO 8 "June 28, 1993" -.SH NAME -fsinfo \- coordinate site-wide filesystem information -.SH SYNOPSIS -.B fsinfo -[ -.B \-v -] [ -.B \-a -.I autodir -] [ -.B \-b -.I bootparams -] [ -.B \-d -.I dumpsets -] [ -.B \-e -.I exports -] [ -.B \-f -.I fstabs -] [ -.B \-h -.I hostname -] [ -.B \-m -.I automounts -] [ -.B \-I -.I dir -] [ -.B \-D -.I string[=string]] -] [ -.B \-U -.I string[=string]] -] -.I config -.I ... -.SH DESCRIPTION +.Dd June 26, 1999 +.Dt FSINFO 8 +.Os +.Sh NAME +.Nm fsinfo +.Nd co-ordinate site-wide file system information +.Sh SYNOPSIS +.Nm +.Op Fl qv +.Op Fl a Ar autodir +.Op Fl b Ar bootparams_prefix +.Op Fl d Ar dumpsets_prefix +.Op Fl e Ar exports_prefix +.Op Fl f Ar fstabs_prefix +.Op Fl h Ar hostname +.Op Fl m Ar automounts_prefix +.Op Fl I Ar dir +.Oo +.Fl D +.Ar name Ns Op = Ns Ar string +.Oc +.Op Fl U Ar name +.Ar config ... +.Sh DESCRIPTION The -.B fsinfo +.Nm utility takes a set of system configuration information, and generates -a coordinated set of -.I amd -, -.I mount +a co-ordinated set of +.Xr amd , +.Xr mount and -.I mountd +.Xr mountd configuration files. -.PP +.Pp +The following options are available: +.Bl -tag -width Fl +.It Fl a Ar autodir +Specifies the directory name in which to place the automounter's +mount points. This defaults to +.Pa /a . +.It Fl b Ar bootparams_prefix +Specifies the prefix for the +.Pa bootparams +file. If it is not given, then the file will not be generated. +The file will be constructed for the destination machine and will be +placed into a file named +.Pa bootparams +and prefixed by the +.Ar bootparams_prefix +string. +The file generated contains a list of entries describing each +diskless client that can boot from the destination machine. +.It Fl d Ar dumpsets_prefix +Specifies the prefix for the +.Pa dumpsets +file. If it is not specified, then the file will not be generated. +The file will be for the destination machine and will be placed into a file +named +.Pa dumpsets +prefixed by the +.Ar dumpsets_prefix +string. +This file is for use by +.Tn Imperial College's +local backup system. +.It Fl e Ar exports_prefix +Defines the prefix for the +.Pa exports +files. If it is not given, then the file will not be generated. +For each machine defined in the configuration files as having disks, +and +.Pa exports +file is constructed and given a file name determined by the name of the +machine, prefixed with the +.Ar exports_prefix +string. +If a machine is defined as diskless, then no +file will be created for it. The files contain entries +for directories on the machine that may be exported to clients. +.It Fl f Ar fstabs_prefix +This defines the prefix for the +.Pa fstab +files. The files will only be created if this prefix is defined. +For each machine defined in the configuration files, a +.Pa fstab +file is created with the file name determined by prefixing this +.Ar fstabs_prefix +string with the name of the machine. These files contain entries +for file systems and partitions to mount at boot time. +.It Fl h Ar hostname +Defines the hostname of the destination machine to process for. +If this is not specified, it defaults to the local machine name, +as returned by +.Xr gethostname 3 . +.It Fl m Ar automounts_prefix +Defines the prefix for the automounter files. The maps will +only be produced if this option is specified. The mount maps +suitable for the network defined by the configuration files will +be placed into files with names calculated by prefixing the +.Ar automounts_prefix +string to the name of each map. +.It Fl q +Selects quite mode. Only error messages that are generated will +be displayed. +.It Fl v +Selects verbose mode. When this is activated, more messages +will be displayed, and all information discovered when performing the semantic +analysis phase will be displayed. Each verbose message +is output to the standard output on a line starting with a `#' +character. +.It Fl D Xo +.Ar name Ns Op = Ns Ar string +.Xc +Defines a symbol +.Ar name +for the preprocessor when reading the configuration files. +Equivalent to the +.Em #define +directive. +.It Fl I Ar dir +This option is passed into the preprocessor for the configuration +files. It specifies directories in which to find include files. +.It Fl U Ar name +Removes and initial definition of the symbol +.Ar name . +Inverse of the +.Fl D +option. +.It Ar config +One or more configuration files to be passed as input to +.Nm fsinfo . +.El +.Pp The -.B fsinfo +.Nm command is fully described in the document -.I "Amd - The 4.4BSD Automounter" -.SH "SEE ALSO" -.BR amd (8), -.BR mount (8), -.BR mountd (8). -.SH HISTORY +.%T "Amd - The 4.4BSD Automounter" +and in the +.Nm amd +section in +.Xr info 1 . +.Sh "SEE ALSO" +.Xr amd 8 , +.Xr mount 8 , +.Xr mountd 8 +.Sh HISTORY The -.B fsinfo -command first appeared in 4.4BSD. +.Nm +command first appeared in +.Bx 4.4 . diff --git a/contrib/amd/fsinfo/fsinfo.c b/contrib/amd/fsinfo/fsinfo.c index 6db1910..111d205 100644 --- a/contrib/amd/fsinfo/fsinfo.c +++ b/contrib/amd/fsinfo/fsinfo.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-1999 Erez Zadok * Copyright (c) 1989 Jan-Simon Pendry * Copyright (c) 1989 Imperial College of Science, Technology & Medicine * Copyright (c) 1989 The Regents of the University of California. @@ -38,7 +38,8 @@ * * %W% (Berkeley) %G% * - * $Id: fsinfo.c,v 1.5.2.5 2003/07/18 04:50:20 ezk Exp $ + * $Id: fsinfo.c,v 1.4 1999/02/04 07:24:44 ezk Exp $ + * $FreeBSD$ * */ @@ -184,9 +185,9 @@ Usage: %s [-v] [-a autodir] [-h hostname] [-b bootparams] [-d dumpsets]\n\ } if (g_argv[0]) - fsi_log("g_argv[0] = %s", g_argv[0]); + log("g_argv[0] = %s", g_argv[0]); else - fsi_log("g_argv[0] = (nil)"); + log("g_argv[0] = (nil)"); } @@ -196,7 +197,7 @@ Usage: %s [-v] [-a autodir] [-h hostname] [-b bootparams] [-d dumpsets]\n\ static char * find_username(void) { - const char *u = getlogin(); + char *u = getlogin(); if (!u) { struct passwd *pw = getpwuid(getuid()); @@ -233,7 +234,6 @@ main(int argc, char *argv[]) perror("gethostname"); exit(1); } - hostname[sizeof(hostname) - 1] = '\0'; /* * Get the username diff --git a/contrib/amd/hlfsd/hlfsd.8 b/contrib/amd/hlfsd/hlfsd.8 index cdf69e8..9eeeadf 100644 --- a/contrib/amd/hlfsd/hlfsd.8 +++ b/contrib/amd/hlfsd/hlfsd.8 @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 1997-2003 Erez Zadok +.\" Copyright (c) 1997-1999 Erez Zadok .\" Copyright (c) 1989 Jan-Simon Pendry .\" Copyright (c) 1989 Imperial College of Science, Technology & Medicine .\" Copyright (c) 1989 The Regents of the University of California. @@ -36,275 +36,284 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: hlfsd.8,v 1.3.2.4 2003/03/16 01:47:00 ezk Exp $ +.\" $Id: hlfsd.8,v 1.2 1999/01/10 21:54:32 ezk Exp $ +.\" $FreeBSD$ .\" .\" HLFSD was written at Columbia University Computer Science Department, by .\" Erez Zadok <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@smarts.com> .\" It is distributed under the same terms and conditions as AMD. .\" -.TH HLFSD 8 "14 September 1993" -.SH NAME -hlfsd \- home-link file system daemon -.SH SYNOPSIS -.B hlfsd -[ -.B \-fhnpvC -] [ -.BI \-a " alt_dir" -] [ -.BI \-c " cache-interval" -] [ -.BI \-g " group" -] [ -.BI \-i " reload-interval" -] [ -.BI \-l " logfile" -] [ -.BI \-o " mount-options" -] [ -.BI \-x " log-options" -] [ -.BI \-D " debug-options" -] [ -.BI \-P " password-file" -] -[ -.I linkname -.RI [ " subdir " ] -] -.SH DESCRIPTION -.B Hlfsd -is a daemon which implements a filesystem containing a symbolic link to +.Dd September 14, 1993 +.Dt HLFSD 8 +.Os +.Sh NAME +.Nm hlfsd +.Nd home-link file system daemon +.Sh SYNOPSIS +.Nm +.Op Fl fhnpvC +.Op Fl a Ar alt_dir +.Bk -words +.Op Fl c Ar cache-interval +.Ek +.Op Fl g Ar group +.Bk -words +.Op Fl i Ar reload-interval +.Ek +.Op Fl l Ar logfile +.Bk -words +.Op Fl o Ar mount-options +.Op Fl x Ar log-options +.Op Fl D Ar debug-options +.Op Fl P Ar password-file +.Ek +.Op linkname Op subdir +.Sh DESCRIPTION +.Nm +is a daemon which implements a file system containing a symbolic link to subdirectory within a user's home directory, depending on the user which accessed that link. It was primarily designed to redirect incoming mail to users' home directories, so that it can read from anywhere. -.LP -.B Hlfsd +.Pp +.Nm operates by mounting itself as an -.SM NFS +.Tn NFS server for the directory containing -.IR linkname , +.Ar linkname , which defaults to -.BR /hlfs/home . +.Pa /hlfs/home . Lookups within that directory are handled by -.BR hlfsd , -which uses the password map to determine how to resolve the lookup. -The directory will be created if it doesn't already exist. The symbolic link will be to the accessing user's home directory, with -.I subdir +.Nm hlfsd , +which uses the password map to determine how to resolve the lookup. The +directory will be created if it doesn't already exist. The symbolic link will +be to the accessing user's home directory, with +.Ar subdir appended to it. If not specified, -.I subdir -defaults to -.BR .hlfsdir . +.Ar subdir +defaults to +.Pa .hlfsdir . This directory will also be created if it does not already exist. -.LP -A SIGTERM sent to -.B hlfsd -will cause it to shutdown. A SIGHUP will flush the internal -caches, and reload the password map. It will also close and -reopen the log file, to enable the original log file to be -removed or rotated. A SIGUSR1 will cause it to dump its internal -table of user IDs and home directories to the file -.BR /usr/tmp/hlfsd.dump.XXXXXX . -.SH OPTIONS -.TP -.BI \-a " alt_dir" +.Pp +A +.Er SIGHUP +will flush the internal caches, and reload the password map. It will also +close and reopen the log file, to enable the original log file to be removed +or rotated. A +.Er SIGUSR1 +will cause it to dump its internal table of user IDs and home directories to +the file +.Pa /usr/tmp/hlfsd.dump.XXXXXX . +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl a Ar alt_dir Alternate directory. The name of the directory to which the symbolic link returned by -.B hlfsd +.Nm will point, if it cannot access the home directory of the user. This defaults to -.BR /var/hlfs . +.Pa /var/hlfs . This directory will be created if it doesn't exist. It is expected that either users will read these files, or the system administrators -will run a script to resend this "lost mail" to its owner. -.TP -.BI \-c " cache-interval" +will run a script to resend this +.Dq lost mail +to its owner. +.It Fl c Ar cache-interval Caching interval. -.B Hlfsd +.Nm will cache the validity of home directories for this interval, in seconds. Entries which have been verified within the last -.I cache-interval +.Ar cache-interval seconds will not be verified again, since the operation could be expensive, and the entries are most likely still valid. After the interval has expired, -.B hlfsd +.Nm will re-verify the validity of the user's home directory, and reset the cache time-counter. The default value for -.I cache-interval -is 300 seconds (5 minutes). -.TP -.B \-f +.Ar cache-interval +is 300 seconds +(5 minutes). +.It Fl f Force fast startup. This option tells -.B hlfsd +.Nm to skip startup-time consistency checks such as existence of mount directory, alternate spool directory, symlink to be hidden under the mount directory, their permissions and validity. -.TP -.BI \-g " group" -Set the special group HLFS_GID to -.IR group . +.It Fl g Ar group +Set the special group +.Va HLFS_GID +to +.Ar group . Programs such as -.B from -or -.BR comsat , -which access the mailboxes of other users) must be setgid HLFS_GID to -work properly. The default group is "hlfs". If no group is provided, -and there is no group "hlfs", this feature is disabled. -.TP -.B \-h +.Ic comsat , +(which access the mailboxes of other users) +must be setgid +.Va HLFS_GID +to work properly. The default group is +.Dq hlfs . +If no group is provided, and there is no group +.Dq hlfs , +this feature is disabled. +.It Fl h Help. Print a brief help message, and exit. -.TP -.BI \-i " reload-interval" +.It Fl i Ar reload-interval Map-reloading interval. Each -.I reload-interval +.Ar reload-interval seconds, -.B hlfsd +.Nm will reload the password map. -.B Hlfsd +.Nm needs the password map for the UIDs and home directory pathnames. -.B Hlfsd -schedules a SIGALRM to reload the password maps. A SIGHUP sent to -.B hlfsd -will force it to reload the maps immediately. The default -value for -.I reload-interval -is 900 seconds (15 minutes.) -.TP -.BI \-l " logfile" +.Nm +schedules a +.Va SIGALRM +to reload the password maps. A +.Va SIGHUP +sent to +.Nm +will force it to reload the maps immediately. The default value for +.Ar reload-interval +is 900 seconds +(15 minutes). +.It Fl l Ar logfile Specify a log file to which -.B hlfsd +.Nm will record events. If -.I logfile +.Pa logfile is the string -.B syslog +.Pa syslog then the log messages will be sent to the system log daemon by -.IR syslog (3), -using the LOG_DAEMON facility. -This is also the default. -.TP -.B \-n +.Xr syslog 3 , +using the +.Va LOG_DAEMON +facility. This is also the default. +.It Fl n No verify. -.B Hlfsd +.Nm will not verify the validity of the symbolic link it will be returning, or that the user's home directory contains sufficient disk-space for spooling. This can speed up -.B hlfsd +.Nm at the cost of possibly returning symbolic links to home directories which are not currently accessible or are full. By default, -.B hlfsd +.Nm validates the symbolic-link in the background. -The -.B \-n +The +.Fl n option overrides the meaning of the -.B \-c +.Fl c option, since no caching is necessary. -.TP -.BI \-o " mount-options" +.It Fl o Ar mount-options Mount options. Mount options which -.B hlfsd +.Nm will use to mount itself on top of -.I dirname. +.Pa dirname . By default, -.IR mount-options -is set to "ro". If the system supports symbolic-link caching, default -options are set to "ro,nocache". -.TP -.B \-p -Print PID. +.Ar mount-options +is set to +.Qq ro . +If the system supports symbolic-link caching, default +options are set to +.Qq ro,nocache . +.It Fl p +Prints +.Va PID . Outputs the process-id of -.B hlfsd +.Nm to standard output where it can be saved into a file. -.TP -.B \-v +.It Fl v Version. Displays version information to standard error. -.TP -.BI \-x " log-options" +.It Fl x Ar log-options Specify run-time logging options. The options are a comma separated list chosen from: fatal, error, user, warn, info, map, stats, all. -.TP -.BI \-C +.It Fl C Force -.B hlfsd +.Nm to run on systems that cannot turn off the NFS attribute-cache. Use of this option on those systems is discouraged, as it may result in loss -or mis-delivery of mail. The option is ignored on systems that can turn +or misdelivery of mail. The option is ignored on systems that can turn off the attribute-cache. -.TP -.BI \-D " log-options" +.It Fl D Ar log-options Select from a variety of debugging options. Prefixing an option with the string -.B no +.Qq no reverses the effect of that option. Options are cumulative. The most useful option is -.BR all . +.Em all . Since this option is only used for debugging other options are not documented here. A fuller description is available in the program -source. A SIGUSR1 sent to -.B hlfsd +source. A +.Va SIGUSR1 +sent to +.Nm will cause it to dump its internal password map to the file -.BR /usr/tmp/hlfsd.dump.XXXXXX . -.TP -.BI \-P " password-file" +.Pa /usr/tmp/hlfsd.dump.XXXXXX . +.It Fl P Ar password-file Read the user-name, user-id, and home directory information from the file -.I password-file. +.Ar password-file . Normally, -.B hlfsd +.Nm will use -.IR getpwent (3) +.Xr getpwent 3 to read the password database. This option allows you to override the default database, and is useful if you want to map users' mail files to a directory other than their home directory. Only the username, uid, and home-directory fields of the file -.I password-file +.Ar password-file are read and checked. All other fields are ignored. The file -.I password-file -must otherwise be compliant with Unix System 7 colon-delimited format -.IR passwd (4). -.SH FILES -.PD 0 -.TP 5 -.B /hlfs +.Ar password-file +must be compliant with +.Ux +System 7 colon-delimited format +.Xr passwd 5 . +.El +.Sh FILES +.Bl -tag -width /axx +.It Pa /hlfs directory under which -.B hlfsd +.Nm mounts itself and manages the symbolic link -.BR home . -.TP 5 -.B .hlfsdir +.Pa home . +.It Pa .hlfsdir default sub-directory in the user's home directory, to which the -.B home +.Pa home symbolic link returned by -.B hlfsd +.Nm points. -.TP 5 -.B /var/hlfs +.It Pa /var/hlfs directory to which -.B home +.Pa home symbolic link returned by -.B hlfsd +.Nm points if it is unable to verify the that user's home directory is accessible. -.SH "SEE ALSO" -.BR amd (8), -.BR automount (8), -.BR cron(8), -.BR getgrent (3), -.BR getpwent (3), -.BR mail(1), -.BR mnttab (4), -.BR mount (8), -.BR mtab (5), -.BR passwd (4), -.BR sendmail (8), -.BR umount (8). -.LP -.IR "HLFSD: Delivering Email to Your $HOME" , -in -.IR "Proc. LISA-VII, The 7th Usenix System Administration Conference" , -November 1993. -.SH AUTHORS -Erez Zadok <ezk@cs.columbia.edu>, Computer Science Department, -Columbia University, New York City, New York, USA, and -Alexander Dupuy <dupuy@smarts.com>, System Management ARTS, -White Plains, New York, USA. +.El +.Sh SEE ALSO +.Xr mail 1 , +.Xr getgrent 3 , +.Xr getpwent 3 , +.Xr mtab 5 , +.Xr passwd 5 , +.Xr amd 8 , +.Xr cron 8 , +.Xr mount 8 , +.Xr sendmail 8 , +.Xr umount 8 +.Rs +.%T HLFSD: Delivering Email to Your $HOME +.%B Proc. LISA-VII, The 7th Usenix System Administration Conference +.%D November 1993 +.Re +.Sh AUTHORS +.An Erez Zadok Aq ezk@cs.columbia.edu , +Department of Computer Science, Columbia University, +New York, USA. +.Pp +.An Alexander Dupuy Aq dupuy@smarts.com , +System Management ARTS, White Plains, New York, USA. +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 3.0 . diff --git a/contrib/amd/hlfsd/hlfsd.c b/contrib/amd/hlfsd/hlfsd.c index 0eaa7ec..3601598 100644 --- a/contrib/amd/hlfsd/hlfsd.c +++ b/contrib/amd/hlfsd/hlfsd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-2001 Erez Zadok * Copyright (c) 1989 Jan-Simon Pendry * Copyright (c) 1989 Imperial College of Science, Technology & Medicine * Copyright (c) 1989 The Regents of the University of California. @@ -38,7 +38,8 @@ * * %W% (Berkeley) %G% * - * $Id: hlfsd.c,v 1.7.2.7 2002/12/27 22:45:08 ezk Exp $ + * $Id: hlfsd.c,v 1.7.2.2 2001/01/10 03:23:35 ezk Exp $ + * $FreeBSD$ * * HLFSD was written at Columbia University Computer Science Department, by * Erez Zadok <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@cs.columbia.edu> @@ -263,12 +264,12 @@ main(int argc, char *argv[]) * Terminate if did not ask to forcecache (-C) and hlfsd would not be able * to set the minimum cache intervals. */ -#if !defined(MNT2_NFS_OPT_ACREGMIN) && !defined(MNT2_NFS_OPT_NOAC) && !defined(HAVE_NFS_ARGS_T_ACREGMIN) +#if !defined(MNT2_NFS_OPT_ACREGMIN) && !defined(MNT2_NFS_OPT_NOAC) && !defined(HAVE_FIELD_NFS_ARGS_T_ACREGMIN) if (!forcecache) { fprintf(stderr, "%s: will not be able to turn off attribute caches.\n", am_get_progname()); exit(1); } -#endif /* !defined(MNT2_NFS_OPT_ACREGMIN) && !defined(MNT2_NFS_OPT_NOAC) && !defined(HAVE_NFS_ARGS_T_ACREGMIN) */ +#endif /* !defined(MNT2_NFS_OPT_ACREGMIN) && !defined(MNT2_NFS_OPT_NOAC) && !defined(HAVE_FIELD_NFS_ARGS_T_ACREGMIN) */ switch (argc - optind) { @@ -420,7 +421,7 @@ main(int argc, char *argv[]) #ifdef HAVE_SIGACTION sa.sa_handler = proceed; - sa.sa_flags = SA_RESTART; + sa.sa_flags = 0; sigemptyset(&(sa.sa_mask)); sigaddset(&(sa.sa_mask), SIGUSR2); sigaction(SIGUSR2, &sa, NULL); @@ -433,7 +434,7 @@ main(int argc, char *argv[]) #ifdef HAVE_SIGACTION sa.sa_handler = reaper; - sa.sa_flags = SA_RESTART; + sa.sa_flags = 0; sigemptyset(&(sa.sa_mask)); sigaddset(&(sa.sa_mask), SIGCHLD); sigaction(SIGCHLD, &sa, NULL); @@ -685,7 +686,7 @@ hlfsd_init(void) */ #ifdef HAVE_SIGACTION sa.sa_handler = reload; - sa.sa_flags = SA_RESTART; + sa.sa_flags = 0; sigemptyset(&(sa.sa_mask)); sigaddset(&(sa.sa_mask), SIGALRM); sigaddset(&(sa.sa_mask), SIGHUP); @@ -701,7 +702,7 @@ hlfsd_init(void) */ #ifdef HAVE_SIGACTION sa.sa_handler = cleanup; - sa.sa_flags = SA_RESTART; + sa.sa_flags = 0; sigemptyset(&(sa.sa_mask)); sigaddset(&(sa.sa_mask), SIGTERM); sigaction(SIGTERM, &sa, NULL); @@ -714,7 +715,7 @@ hlfsd_init(void) */ #ifdef HAVE_SIGACTION sa.sa_handler = interlock; - sa.sa_flags = SA_RESTART; + sa.sa_flags = 0; sigemptyset(&(sa.sa_mask)); sigaddset(&(sa.sa_mask), SIGCHLD); sigaction(SIGCHLD, &sa, NULL); @@ -731,7 +732,7 @@ hlfsd_init(void) # else /* not defined(DEBUG) || defined(DEBUG_PRINT) */ sa.sa_handler = SIG_IGN; # endif /* not defined(DEBUG) || defined(DEBUG_PRINT) */ - sa.sa_flags = SA_RESTART; + sa.sa_flags = 0; sigemptyset(&(sa.sa_mask)); sigaddset(&(sa.sa_mask), SIGUSR1); sigaction(SIGUSR1, &sa, NULL); @@ -850,16 +851,16 @@ cleanup(int signum) amuDebug(D_DAEMON) #endif /* DEBUG */ if (getpid() != masterpid) - return; + return; #ifdef DEBUG amuDebug(D_DAEMON) #endif /* DEBUG */ if (fork() != 0) { - masterpid = 0; - am_set_mypid(); - return; - } + masterpid = 0; + am_set_mypid(); + return; + } am_set_mypid(); for (;;) { @@ -934,8 +935,17 @@ fatal(char *mess) strcpy(lessmess, mess); lessmess[messlen - 4] = '\0'; - fprintf(stderr, "%s: %s: %s\n", - am_get_progname(), lessmess, strerror(errno)); + if (errno < sys_nerr) + fprintf(stderr, "%s: %s: %s\n", am_get_progname(), lessmess, +#ifdef HAVE_STRERROR + strerror(errno) +#else /* not HAVE_STRERROR */ + sys_errlist[errno] +#endif /* not HAVE_STRERROR */ + ); + else + fprintf(stderr, "%s: %s: Error %d\n", + am_get_progname(), lessmess, errno); } } plog(XLOG_FATAL, "%s", mess); diff --git a/contrib/amd/hlfsd/hlfsd.h b/contrib/amd/hlfsd/hlfsd.h index bce4631..54e7541 100644 --- a/contrib/amd/hlfsd/hlfsd.h +++ b/contrib/amd/hlfsd/hlfsd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-2001 Erez Zadok * Copyright (c) 1989 Jan-Simon Pendry * Copyright (c) 1989 Imperial College of Science, Technology & Medicine * Copyright (c) 1989 The Regents of the University of California. @@ -38,7 +38,8 @@ * * %W% (Berkeley) %G% * - * $Id: hlfsd.h,v 1.4.2.6 2002/12/27 22:45:08 ezk Exp $ + * $Id: hlfsd.h,v 1.4.2.2 2001/01/12 22:47:21 ro Exp $ + * $FreeBSD$ * * HLFSD was written at Columbia University Computer Science Department, by * Erez Zadok <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@cs.columbia.edu> @@ -52,7 +53,7 @@ * MACROS AND CONSTANTS: */ -#define HLFSD_VERSION "hlfsd 1.2 (1993-2002)" +#define HLFSD_VERSION "hlfsd 1.1 (1993-2001)" #define PERS_SPOOLMODE 0755 #define OPEN_SPOOLMODE 01777 #define DOTSTRING "." @@ -138,7 +139,7 @@ extern SVCXPRT *nfs_program_2_transp; /* For quick_reply() */ extern SVCXPRT *nfsxprt; extern char *alt_spooldir; extern char *home_subdir; -extern char *homedir(int, int); +extern char *homedir(int); extern char *mailbox(int, char *); extern char *passwdfile; extern char *slinkname; diff --git a/contrib/amd/hlfsd/homedir.c b/contrib/amd/hlfsd/homedir.c index 91431bf..904e2c6 100644 --- a/contrib/amd/hlfsd/homedir.c +++ b/contrib/amd/hlfsd/homedir.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-2001 Erez Zadok * Copyright (c) 1989 Jan-Simon Pendry * Copyright (c) 1989 Imperial College of Science, Technology & Medicine * Copyright (c) 1989 The Regents of the University of California. @@ -38,7 +38,8 @@ * * %W% (Berkeley) %G% * - * $Id: homedir.c,v 1.5.2.10 2002/12/27 22:45:08 ezk Exp $ + * $Id: homedir.c,v 1.5.2.1 2001/01/10 03:23:36 ezk Exp $ + * $FreeBSD$ * * HLFSD was written at Columbia University Computer Science Department, by * Erez Zadok <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@cs.columbia.edu> @@ -67,31 +68,34 @@ static uid2home_t *lastchild; static uid2home_t *pwtab; static void delay(uid2home_t *, int); static void table_add(int, const char *, const char *); -static char mboxfile[MAXPATHLEN]; -static char *root_home; /* root's home directory */ /* GLOBAL FUNCTIONS */ char *homeof(char *username); int uidof(char *username); /* GLOBALS VARIABLES */ +char mboxfile[MAXPATHLEN]; username2uid_t *untab; /* user name table */ + /* * Return the home directory pathname for the user with uid "userid". */ char * -homedir(int userid, int groupid) +homedir(int userid) { static char linkval[MAXPATHLEN + 1]; static struct timeval tp; uid2home_t *found; char *homename; struct stat homestat; - int old_groupid, old_userid; clock_valid = 0; /* invalidate logging clock */ + if ((int) userid == 0) { /* force superuser to use "/" as home */ + sprintf(linkval, "/%s", home_subdir); + return linkval; + } if ((found = plt_search(userid)) == (uid2home_t *) NULL) { return alt_spooldir; /* use alt spool for unknown uid */ } @@ -101,10 +105,7 @@ homedir(int userid, int groupid) found->last_status = 1; return alt_spooldir; /* use alt spool for / or rel. home */ } - if ((int) userid == 0) /* force all uid 0 to use root's home */ - sprintf(linkval, "%s/%s", root_home, home_subdir); - else - sprintf(linkval, "%s/%s", homename, home_subdir); + sprintf(linkval, "%s/%s", homename, home_subdir); if (noverify) { found->last_status = 0; @@ -113,9 +114,9 @@ homedir(int userid, int groupid) /* * To optimize hlfsd, we don't actually check the validity of the - * symlink if it has been checked in the last N seconds. It is + * symlink if it has been in checked in the last N seconds. It is * very likely that the link, machine, and filesystem are still - * valid, as long as N is small. But if N is large, that may not be + * valid, as long as N is small. But if N ls large, that may not be * true. That's why the default N is 5 minutes, but we allow the * user to override this value via a command line option. Note that * we do not update the last_access_time each time it is accessed, @@ -143,33 +144,13 @@ homedir(int userid, int groupid) amuDebug(D_FORK) { #endif /* DEBUG */ /* fork child to process request if none in progress */ - if (found->child && kill(found->child, 0) < 0) + if (found->child && kill(found->child, 0)) found->child = 0; if (found->child) delay(found, 5); /* wait a bit if in progress */ - -#if defined(DEBUG) && defined(HAVE_WAITPID) - if (found->child) { - /* perhaps it's a child we lost count of? let's wait on it */ - int status, child; - if ((child = waitpid((pid_t) found->child, &status, WNOHANG)) > 0) { - plog(XLOG_ERROR, "found lost child %d", child); - found->child = 0; - if (WIFEXITED(status)) - found->last_status = WEXITSTATUS(status); - else if (WIFSIGNALED(status)) - found->last_status = -WTERMSIG(status); - else { - plog(XLOG_ERROR, "unknown child exit status (%d) ???", status); - found->last_status = 255; - } - } - } -#endif /* DEBUG && HAVE_WAITPID */ - - if (found->child) { - found->last_status = 1; /* better safe than sorry - maybe */ + if (found->child) { /* better safe than sorry - maybe */ + found->last_status = 1; return alt_spooldir; } if ((found->child = fork()) < 0) { @@ -203,28 +184,21 @@ homedir(int userid, int groupid) * */ am_set_mypid(); /* for logging routines */ - if ((old_groupid = setgid(groupid)) < 0) { - plog(XLOG_WARNING, "could not setgid to %d: %m", groupid); - return linkval; - } - if ((old_userid = seteuid(userid)) < 0) { + if (seteuid(userid) < 0) { plog(XLOG_WARNING, "could not seteuid to %d: %m", userid); - setgid(old_groupid); return linkval; } if (hlfsd_stat(linkval, &homestat) < 0) { if (errno == ENOENT) { /* make the spool dir if possible */ /* don't use recursive mkdirs here */ if (mkdir(linkval, PERS_SPOOLMODE) < 0) { - seteuid(old_userid); - setgid(old_groupid); + seteuid(0); plog(XLOG_WARNING, "can't make directory %s: %m", linkval); return alt_spooldir; } /* fall through to testing the disk space / quota */ } else { /* the home dir itself must not exist then */ - seteuid(old_userid); - setgid(old_groupid); + seteuid(0); plog(XLOG_WARNING, "bad link to %s: %m", linkval); return alt_spooldir; } @@ -239,13 +213,11 @@ homedir(int userid, int groupid) * We are still seteuid to the user at this point. */ if (hlfsd_diskspace(linkval) < 0) { - seteuid(old_userid); - setgid(old_groupid); + seteuid(0); plog(XLOG_WARNING, "no more space in %s: %m", linkval); return alt_spooldir; } else { - seteuid(old_userid); - setgid(old_groupid); + seteuid(0); return linkval; } } @@ -323,55 +295,30 @@ interlock(int signum) int child; uid2home_t *lostchild; int status; - int max_errors = 10; /* avoid infinite loops */ #ifdef HAVE_WAITPID - while ((child = waitpid((pid_t) -1, &status, WNOHANG)) != 0) { + while ((child = waitpid((pid_t) -1, &status, WNOHANG)) > 0) { #else /* not HAVE_WAITPID */ - while ((child = wait3(&status, WNOHANG, (struct rusage *) 0)) != 0) { + while ((child = wait3(&status, WNOHANG, (struct rusage *) 0)) > 0) { #endif /* not HAVE_WAITPID */ - if (child < 0) { - plog(XLOG_WARNING, "waitpid/wait3: %m"); - if (--max_errors > 0) - continue; - else - break; - } - /* high chances this was the last child forked */ if (lastchild && lastchild->child == child) { lastchild->child = 0; if (WIFEXITED(status)) lastchild->last_status = WEXITSTATUS(status); - else if (WIFSIGNALED(status)) - lastchild->last_status = -WTERMSIG(status); - else { - plog(XLOG_ERROR, "unknown child exit status (%d) ???", status); - lastchild->last_status = 255; - } lastchild = (uid2home_t *) NULL; } else { /* and if not, we have to search for it... */ - int found = 0; for (lostchild = pwtab; lostchild < &pwtab[cur_pwtab_num]; lostchild++) { if (lostchild->child == child) { - lostchild->child = 0; if (WIFEXITED(status)) lostchild->last_status = WEXITSTATUS(status); - else if (WIFSIGNALED(status)) - lostchild->last_status = -WTERMSIG(status); - else { - plog(XLOG_ERROR, "unknown child exit status (%d) ???", status); - lostchild->last_status = 255; - } - found = 1; + lostchild->child = 0; break; } } - if (!found) - plog(XLOG_ERROR, "no record of child %d found???", child); } } } @@ -464,6 +411,7 @@ mailbox(int uid, char *username) static int plt_compare_fxn(const voidp x, const voidp y) + { uid2home_t *i = (uid2home_t *) x; uid2home_t *j = (uid2home_t *) y; @@ -612,18 +560,6 @@ plt_init(void) hlfsd_setpwent(); /* prepare to read passwd entries */ while ((pent_p = hlfsd_getpwent()) != (struct passwd *) NULL) { table_add(pent_p->pw_uid, pent_p->pw_dir, pent_p->pw_name); - if (STREQ("root", pent_p->pw_name)) { - int len; - if (root_home) - XFREE(root_home); - root_home = strdup(pent_p->pw_dir); - len = strlen(root_home); - /* remove any trailing '/' chars from root's home (even if just one) */ - while (len > 0 && root_home[len - 1] == '/') { - len--; - root_home[len] = '\0'; - } - } } hlfsd_endpwent(); @@ -632,9 +568,6 @@ plt_init(void) qsort((char *) untab, cur_pwtab_num, sizeof(username2uid_t), unt_compare_fxn); - if (!root_home) - root_home = strdup(""); - plog(XLOG_INFO, "password map read and sorted"); } @@ -677,9 +610,6 @@ plt_reset(void) } cur_pwtab_num = 0; /* zero current size */ - if (root_home) - XFREE(root_home); - return 0; /* resetting ok */ } @@ -805,7 +735,7 @@ plt_print(int signum) #else /* not HAVE_MKSTEMP */ mktemp(dumptmp); if (!dumptmp) { - plog(XLOG_ERROR, "cannot create temporary dump file"); + plot(XLOG_ERROR, "cannot create temporary dump file"); return; } dumpfd = open(dumptmp, O_RDONLY); diff --git a/contrib/amd/include/am_defs.h b/contrib/amd/include/am_defs.h index da483d7..c42afe0 100644 --- a/contrib/amd/include/am_defs.h +++ b/contrib/amd/include/am_defs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-2001 Erez Zadok * Copyright (c) 1990 Jan-Simon Pendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine * Copyright (c) 1990 The Regents of the University of California. @@ -38,7 +38,8 @@ * * %W% (Berkeley) %G% * - * $Id: am_defs.h,v 1.15.2.13 2002/12/27 22:45:09 ezk Exp $ + * $Id: am_defs.h,v 1.15.2.9 2001/04/07 00:47:44 ib42 Exp $ + * $FreeBSD$ * */ @@ -595,6 +596,24 @@ struct ypall_callback; #endif /* HAVE_LINUX_AUTO_FS_H */ /* + * Actions to take if <sys/fs/autofs.h> exists. + */ +#ifdef HAVE_SYS_FS_AUTOFS_H +# include <sys/fs/autofs.h> +#endif /* HAVE_SYS_FS_AUTOFS_H */ + +/* + * Actions to take if <sys/fs/autofs_prot.h> exists. + * We really don't want <linux/fs.h> pulled in here + */ +#ifndef _LINUX_FS_H +#define _LINUX_FS_H +#endif /* _LINUX_FS_H */ +#ifdef HAVE_SYS_FS_AUTOFS_PROT_H +# include <sys/fs/autofs_prot.h> +#endif /* HAVE_SYS_FS_AUTOFS_PROT_H */ + +/* * NFS PROTOCOL HEADER FILES: */ @@ -751,6 +770,9 @@ struct sockaddr_dl; #ifdef HAVE_MSDOSFS_MSDOSFSMOUNT_H # include <msdosfs/msdosfsmount.h> #endif /* HAVE_MSDOSFS_MSDOSFSMOUNT_H */ +#ifdef HAVE_FS_MSDOSFS_MSDOSFSMOUNT_H +# include <fs/msdosfs/msdosfsmount.h> +#endif /* HAVE_FS_MSDOSFS_MSDOSFSMOUNT_H */ /* * Actions to take if <sys/fs/tmp.h> exists. @@ -765,10 +787,12 @@ struct sockaddr_dl; #ifdef HAVE_SYS_FS_UFS_MOUNT_H # include <sys/fs/ufs_mount.h> #endif /* HAVE_SYS_FS_UFS_MOUNT_H */ -#ifdef HAVE_UFS_UFS_UFSMOUNT_H_off -# error do not include this file here because on netbsd/openbsd it -# error causes errors with other header files. Instead, add it to the -# error specific conf/nfs_prot_*.h file. +/* + * HAVE_UFS_UFS_UFSMOUNT_H should NOT be defined on netbsd/openbsd because it + * causes errors with other header files. Instead, add it to the specific + * conf/nfs_prot_*.h file. + */ +#ifdef HAVE_UFS_UFS_UFSMOUNT_H # include <ufs/ufs/ufsmount.h> #endif /* HAVE_UFS_UFS_UFSMOUNT_H */ @@ -1389,10 +1413,6 @@ extern int wait3(int *statusp, int options, struct rusage *rusage); extern int vsnprintf(char *, int, const char *, ...); #endif /* defined(HAVE_VSNPRINTF) && !defined(HAVE_EXTERN_VSNPRINTF) */ -#ifndef HAVE_EXTERN_XDR_CALLMSG -extern bool_t xdr_callmsg(XDR *xdrs, struct rpc_msg *msg); -#endif /* not HAVE_EXTERN_XDR_CALLMSG */ - #ifndef HAVE_EXTERN_XDR_OPAQUE_AUTH extern bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *auth); #endif /* not HAVE_EXTERN_XDR_OPAQUE_AUTH */ diff --git a/contrib/amd/libamu/clnt_sperrno.c b/contrib/amd/libamu/clnt_sperrno.c deleted file mode 100644 index d3b48d1..0000000 --- a/contrib/amd/libamu/clnt_sperrno.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 1997-1998 Erez Zadok - * Copyright (c) 1990 Jan-Simon Pendry - * Copyright (c) 1990 Imperial College of Science, Technology & Medicine - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Jan-Simon Pendry at Imperial College, London. - * - * 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. - * - * %W% (Berkeley) %G% - * - * $Id: clnt_sperrno.c,v 5.2.2.1 1992/02/09 15:08:40 jsp beta $ - * - */ - -/* - * Early RPC seems to be missing these.. - * Extracted from the RPC 3.9 sources as indicated - */ - -/* @(#)clnt_perror.c 1.1 87/11/04 3.9 RPCSRC */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif /* HAVE_CONFIG_H */ -#include <am_defs.h> -#include <amu.h> - - -struct rpc_errtab { - enum clnt_stat status; - char *message; -}; - -static struct rpc_errtab rpc_errlist[] = -{ - {RPC_SUCCESS, - "RPC: Success"}, - {RPC_CANTENCODEARGS, - "RPC: Can't encode arguments"}, - {RPC_CANTDECODERES, - "RPC: Can't decode result"}, - {RPC_CANTSEND, - "RPC: Unable to send"}, - {RPC_CANTRECV, - "RPC: Unable to receive"}, - {RPC_TIMEDOUT, - "RPC: Timed out"}, - {RPC_VERSMISMATCH, - "RPC: Incompatible versions of RPC"}, - {RPC_AUTHERROR, - "RPC: Authentication error"}, - {RPC_PROGUNAVAIL, - "RPC: Program unavailable"}, - {RPC_PROGVERSMISMATCH, - "RPC: Program/version mismatch"}, - {RPC_PROCUNAVAIL, - "RPC: Procedure unavailable"}, - {RPC_CANTDECODEARGS, - "RPC: Server can't decode arguments"}, - {RPC_SYSTEMERROR, - "RPC: Remote system error"}, - {RPC_UNKNOWNHOST, - "RPC: Unknown host"}, -/* { RPC_UNKNOWNPROTO, - * "RPC: Unknown protocol" }, */ - {RPC_PMAPFAILURE, - "RPC: Port mapper failure"}, - {RPC_PROGNOTREGISTERED, - "RPC: Program not registered"}, - {RPC_FAILED, - "RPC: Failed (unspecified error)"} -}; - - -/* - * This interface for use by clntrpc - */ -char * -clnt_sperrno(enum clnt_stat stat) -{ - int i; - - for (i = 0; i < sizeof(rpc_errlist) / sizeof(struct rpc_errtab); i++) { - if (rpc_errlist[i].status == stat) { - return (rpc_errlist[i].message); - } - } - return ("RPC: (unknown error code)"); -} diff --git a/contrib/amd/libamu/mount_fs.c b/contrib/amd/libamu/mount_fs.c index c6a468f..c4a4738 100644 --- a/contrib/amd/libamu/mount_fs.c +++ b/contrib/amd/libamu/mount_fs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-2001 Erez Zadok * Copyright (c) 1990 Jan-Simon Pendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine * Copyright (c) 1990 The Regents of the University of California. @@ -38,7 +38,8 @@ * * %W% (Berkeley) %G% * - * $Id: mount_fs.c,v 1.11.2.11 2003/05/08 17:57:53 ib42 Exp $ + * $Id: mount_fs.c,v 1.11.2.5 2001/04/14 21:08:25 ezk Exp $ + * $FreeBSD$ * */ @@ -105,10 +106,13 @@ struct opt_tab mnt_flags[] = {MNTTAB_OPT_OVERLAY, MNT2_GEN_OPT_OVERLAY}, #endif /* defined(MNT2_GEN_OPT_OVERLAY) && defined(MNTTAB_OPT_OVERLAY) */ - /* - * Do not define MNT2_NFS_OPT_* entries here! This is for generic - * mount(2) options only, not for NFS mount options. - */ +#if defined(MNT2_NFS_OPT_PROPLIST) && defined(MNTTAB_OPT_PROPLIST) + {MNTTAB_OPT_PROPLIST, MNT2_NFS_OPT_PROPLIST}, +#endif /* defined(MNT2_NFS_OPT_PROPLIST) && defined(MNTTAB_OPT_PROPLIST) */ + +#if defined(MNT2_NFS_OPT_NONLM) && defined(MNTTAB_OPT_NOLOCK) + {MNTTAB_OPT_NOLOCK, MNT2_NFS_OPT_NONLM}, +#endif /* defined(MNT2_NFS_OPT_NONLM) && defined(MNTTAB_OPT_NOLOCK) */ {0, 0} }; @@ -119,14 +123,27 @@ int compute_mount_flags(mntent_t *mntp) { struct opt_tab *opt; - int flags = 0; + int flags; + /* start: this must come first */ #ifdef MNT2_GEN_OPT_NEWTYPE flags = MNT2_GEN_OPT_NEWTYPE; -#endif /* MNT2_GEN_OPT_NEWTYPE */ -#ifdef MNT2_GEN_OPT_AUTOMOUNTED - flags |= MNT2_GEN_OPT_AUTOMOUNTED; -#endif /* not MNT2_GEN_OPT_AUTOMOUNTED */ +#else /* not MNT2_GEN_OPT_NEWTYPE */ + /* Not all machines have MNT2_GEN_OPT_NEWTYPE (HP-UX 9.01) */ + flags = 0; +#endif /* not MNT2_GEN_OPT_NEWTYPE */ + +#if defined(MNT2_GEN_OPT_OVERLAY) && defined(MNTTAB_OPT_OVERLAY) + /* + * Overlay this amd mount (presumably on another amd which died + * before and left the machine hung). This will allow a new amd or + * hlfsd to be remounted on top of another one. + */ + if (hasmntopt(mntp, MNTTAB_OPT_OVERLAY)) { + flags |= MNT2_GEN_OPT_OVERLAY; + plog(XLOG_INFO, "using an overlay mount"); + } +#endif /* defined(MNT2_GEN_OVERLAY) && defined(MNTOPT_OVERLAY) */ /* * Crack basic mount options @@ -284,25 +301,25 @@ again: * Additional fields in mntent_t * are fixed up here */ -# ifdef HAVE_MNTENT_T_MNT_CNODE +# ifdef HAVE_FIELD_MNTENT_T_MNT_CNODE mnt->mnt_cnode = 0; -# endif /* HAVE_MNTENT_T_MNT_CNODE */ +# endif /* HAVE_FIELD_MNTENT_T_MNT_CNODE */ -# ifdef HAVE_MNTENT_T_MNT_RO +# ifdef HAVE_FIELD_MNTENT_T_MNT_RO mnt->mnt_ro = (hasmntopt(mnt, MNTTAB_OPT_RO) != NULL); -# endif /* HAVE_MNTENT_T_MNT_RO */ +# endif /* HAVE_FIELD_MNTENT_T_MNT_RO */ -# ifdef HAVE_MNTENT_T_MNT_TIME -# ifdef HAVE_MNTENT_T_MNT_TIME_STRING +# ifdef HAVE_FIELD_MNTENT_T_MNT_TIME +# ifdef HAVE_FIELD_MNTENT_T_MNT_TIME_STRING { /* allocate enough space for a long */ char *str = (char *) xmalloc(13 * sizeof(char)); sprintf(str, "%ld", time((time_t *) NULL)); mnt->mnt_time = str; } -# else /* not HAVE_MNTENT_T_MNT_TIME_STRING */ +# else /* not HAVE_FIELD_MNTENT_T_MNT_TIME_STRING */ mnt->mnt_time = time((time_t *) NULL); -# endif /* not HAVE_MNTENT_T_MNT_TIME_STRING */ -# endif /* HAVE_MNTENT_T_MNT_TIME */ +# endif /* not HAVE_FIELD_MNTENT_T_MNT_TIME_STRING */ +# endif /* HAVE_FIELD_MNTENT_T_MNT_TIME */ write_mntent(mnt, mnttabname); @@ -358,7 +375,7 @@ compute_nfs_args(nfs_args_t *nap, mntent_t *mntp, int genflags, struct sockaddr_ fhp->v3.mountres3_u.mountinfo.fhandle.fhandle3_val, fh3.fh3_length); -# if defined(HAVE_NFS_ARGS_T_FHSIZE) || defined(HAVE_NFS_ARGS_T_FH_LEN) +# if defined(HAVE_FIELD_NFS_ARGS_T_FHSIZE) || defined(HAVE_FIELD_NFS_ARGS_T_FH_LEN) /* * Some systems (Irix/bsdi3) have a separate field in nfs_args for * the length of the file handle for NFS V3. They insist that @@ -366,9 +383,9 @@ compute_nfs_args(nfs_args_t *nap, mntent_t *mntp, int genflags, struct sockaddr_ * include the length field. */ NFS_FH_DREF(nap->NFS_FH_FIELD, &(fh3.fh3_u.data)); -# else /* not defined(HAVE_NFS_ARGS_T_FHSIZE) || defined(HAVE_NFS_ARGS_T_FH_LEN) */ +# else /* not defined(HAVE_FIELD_NFS_ARGS_T_FHSIZE) || defined(HAVE_FIELD_NFS_ARGS_T_FH_LEN) */ NFS_FH_DREF(nap->NFS_FH_FIELD, &fh3); -# endif /* not defined(HAVE_NFS_ARGS_T_FHSIZE) || defined(HAVE_NFS_ARGS_T_FH_LEN) */ +# endif /* not defined(HAVE_FIELD_NFS_ARGS_T_FHSIZE) || defined(HAVE_FIELD_NFS_ARGS_T_FH_LEN) */ # ifdef MNT2_NFS_OPT_NFSV3 nap->flags |= MNT2_NFS_OPT_NFSV3; # endif /* MNT2_NFS_OPT_NFSV3 */ @@ -379,24 +396,24 @@ compute_nfs_args(nfs_args_t *nap, mntent_t *mntp, int genflags, struct sockaddr_ #endif /* HAVE_FS_NFS3 */ NFS_FH_DREF(nap->NFS_FH_FIELD, &(fhp->v2.fhs_fh)); -#ifdef HAVE_NFS_ARGS_T_FHSIZE +#ifdef HAVE_FIELD_NFS_ARGS_T_FHSIZE # ifdef HAVE_FS_NFS3 if (nfs_version == NFS_VERSION3) nap->fhsize = fh3.fh3_length; else # endif /* HAVE_FS_NFS3 */ nap->fhsize = FHSIZE; -#endif /* HAVE_NFS_ARGS_T_FHSIZE */ +#endif /* HAVE_FIELD_NFS_ARGS_T_FHSIZE */ /* this is the version of the nfs_args structure, not of NFS! */ -#ifdef HAVE_NFS_ARGS_T_FH_LEN +#ifdef HAVE_FIELD_NFS_ARGS_T_FH_LEN # ifdef HAVE_FS_NFS3 if (nfs_version == NFS_VERSION3) nap->fh_len = fh3.fh3_length; else # endif /* HAVE_FS_NFS3 */ nap->fh_len = FHSIZE; -#endif /* HAVE_NFS_ARGS_T_FH_LEN */ +#endif /* HAVE_FIELD_NFS_ARGS_T_FH_LEN */ /************************************************************************/ /*** HOST NAME ***/ @@ -424,14 +441,14 @@ compute_nfs_args(nfs_args_t *nap, mntent_t *mntp, int genflags, struct sockaddr_ #endif /* MNTTAB_OPT_ACTIMEO */ if (acval) { -#ifdef HAVE_NFS_ARGS_T_ACREGMIN +#ifdef HAVE_FIELD_NFS_ARGS_T_ACREGMIN nap->acregmin = acval; /* min ac timeout for reg files (sec) */ nap->acregmax = acval; /* max ac timeout for reg files (sec) */ -#endif /* HAVE_NFS_ARGS_T_ACREGMIN */ -#ifdef HAVE_NFS_ARGS_T_ACDIRMIN +#endif /* HAVE_FIELD_NFS_ARGS_T_ACREGMIN */ +#ifdef HAVE_FIELD_NFS_ARGS_T_ACDIRMIN nap->acdirmin = acval; /* min ac timeout for dirs (sec) */ nap->acdirmax = acval; /* max ac timeout for dirs (sec) */ -#endif /* HAVE_NFS_ARGS_T_ACDIRMIN */ +#endif /* HAVE_FIELD_NFS_ARGS_T_ACDIRMIN */ } else { #ifdef MNTTAB_OPT_ACREGMIN nap->acregmin = hasmntval(mntp, MNTTAB_OPT_ACREGMIN); @@ -487,7 +504,7 @@ compute_nfs_args(nfs_args_t *nap, mntent_t *mntp, int genflags, struct sockaddr_ nap->flags |= MNT2_NFS_OPT_TCP; #endif /* MNT2_NFS_OPT_TCP */ -#ifdef HAVE_NFS_ARGS_T_SOTYPE +#ifdef HAVE_FIELD_NFS_ARGS_T_SOTYPE /* bsdi3 uses this */ if (nfs_proto) { if (STREQ(nfs_proto, "tcp")) @@ -495,9 +512,9 @@ compute_nfs_args(nfs_args_t *nap, mntent_t *mntp, int genflags, struct sockaddr_ else if (STREQ(nfs_proto, "udp")) nap->sotype = SOCK_DGRAM; } -#endif /* HAVE_NFS_ARGS_T_SOTYPE */ +#endif /* HAVE_FIELD_NFS_ARGS_T_SOTYPE */ -#ifdef HAVE_NFS_ARGS_T_PROTO +#ifdef HAVE_FIELD_NFS_ARGS_T_PROTO nap->proto = 0; /* bsdi3 sets this field to zero */ # ifdef IPPROTO_TCP if (nfs_proto) { @@ -507,16 +524,16 @@ compute_nfs_args(nfs_args_t *nap, mntent_t *mntp, int genflags, struct sockaddr_ nap->proto = IPPROTO_UDP; } # endif /* IPPROTO_TCP */ -#endif /* HAVE_NFS_ARGS_T_SOTYPE */ +#endif /* HAVE_FIELD_NFS_ARGS_T_SOTYPE */ -#ifdef HAVE_NFS_ARGS_T_VERSION +#ifdef HAVE_FIELD_NFS_ARGS_T_VERSION # ifdef NFS_ARGSVERSION nap->version = NFS_ARGSVERSION; /* BSDI 3.0 and OpenBSD 2.2 */ # endif /* NFS_ARGSVERSION */ # ifdef DG_MOUNT_NFS_VERSION nap->version = DG_MOUNT_NFS_VERSION; /* dg-ux */ # endif /* DG_MOUNT_NFS_VERSION */ -#endif /* HAVE_NFS_ARGS_VERSION */ +#endif /* HAVE_FIELD_NFS_ARGS_VERSION */ /************************************************************************/ /*** OTHER NFS SOCKET RELATED OPTIONS AND FLAGS ***/ @@ -698,23 +715,18 @@ compute_nfs_args(nfs_args_t *nap, mntent_t *mntp, int genflags, struct sockaddr_ nap->flags |= MNT2_NFS_OPT_MAXGRPS; #endif /* defined(MNT2_NFS_OPT_MAXGRPS) && defined(MNTTAB_OPT_MAXGROUPS) */ -#if defined(MNT2_NFS_OPT_NONLM) && defined(MNTTAB_OPT_NOLOCK) - if (hasmntopt(mntp, MNTTAB_OPT_NOLOCK) != NULL) - nap->flags |= MNT2_NFS_OPT_NONLM; -#endif /* defined(MNT2_NFS_OPT_NONLM) && defined(MNTTAB_OPT_NOLOCK) */ - -#ifdef HAVE_NFS_ARGS_T_OPTSTR +#ifdef HAVE_FIELD_NFS_ARGS_T_OPTSTR nap->optstr = mntp->mnt_opts; -#endif /* HAVE_NFS_ARGS_T_OPTSTR */ +#endif /* HAVE_FIELD_NFS_ARGS_T_OPTSTR */ /************************************************************************/ /*** FINAL ACTIONS ***/ /************************************************************************/ -#ifdef HAVE_NFS_ARGS_T_GFS_FLAGS +#ifdef HAVE_FIELD_NFS_ARGS_T_GFS_FLAGS /* Ultrix stores generic flags in nfs_args.gfs_flags. */ nap->gfs_flags = genflags; -#endif /* HAVE_NFS_ARGS_T_FLAGS */ +#endif /* HAVE_FIELD_NFS_ARGS_T_FLAGS */ return; /* end of compute_nfs_args() function */ } @@ -852,19 +864,19 @@ print_nfs_args(const nfs_args_t *nap, u_long nfs_version) nbp = nap->syncaddr; plog(XLOG_DEBUG, "NA->syncaddr {netbuf} 0x%x", (int) nbp); kncp = nap->knconf; - plog(XLOG_DEBUG, "NA->knconf->semantics %lu", (u_long) kncp->knc_semantics); + plog(XLOG_DEBUG, "NA->knconf->semantics %lu", (unsigned long) kncp->knc_semantics); plog(XLOG_DEBUG, "NA->knconf->protofmly \"%s\"", kncp->knc_protofmly); plog(XLOG_DEBUG, "NA->knconf->proto \"%s\"", kncp->knc_proto); - plog(XLOG_DEBUG, "NA->knconf->rdev %lu", (u_long) kncp->knc_rdev); + plog(XLOG_DEBUG, "NA->knconf->rdev %lu", kncp->knc_rdev); /* don't print knconf->unused field */ #else /* not HAVE_TRANSPORT_TYPE_TLI */ sap = (struct sockaddr_in *) &nap->addr; plog(XLOG_DEBUG, "NA->addr {sockaddr_in} (len=%d) = \"%s\"", (int) sizeof(struct sockaddr_in), get_hex_string(sizeof(struct sockaddr_in), (const char *)sap)); -#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN +#ifdef HAVE_FIELD_STRUCT_SOCKADDR_SA_LEN plog(XLOG_DEBUG, "NA->addr.sin_len = \"%d\"", sap->sin_len); -#endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */ +#endif /* HAVE_FIELD_STRUCT_SOCKADDR_SA_LEN */ plog(XLOG_DEBUG, "NA->addr.sin_family = \"%d\"", sap->sin_family); plog(XLOG_DEBUG, "NA->addr.sin_port = \"%d\"", sap->sin_port); plog(XLOG_DEBUG, "NA->addr.sin_addr = \"%s\"", @@ -872,22 +884,22 @@ print_nfs_args(const nfs_args_t *nap, u_long nfs_version) #endif /* not HAVE_TRANSPORT_TYPE_TLI */ plog(XLOG_DEBUG, "NA->hostname = \"%s\"", nap->hostname ? nap->hostname : "null"); -#ifdef HAVE_NFS_ARGS_T_NAMLEN +#ifdef HAVE_FIELD_NFS_ARGS_T_NAMLEN plog(XLOG_DEBUG, "NA->namlen = %d", nap->namlen); -#endif /* HAVE_NFS_ARGS_T_NAMLEN */ +#endif /* HAVE_FIELD_NFS_ARGS_T_NAMLEN */ #ifdef MNT2_NFS_OPT_FSNAME plog(XLOG_DEBUG, "NA->fsname = \"%s\"", nap->fsname ? nap->fsname : "null"); #endif /* MNT2_NFS_OPT_FSNAME */ -#ifdef HAVE_NFS_ARGS_T_FHSIZE +#ifdef HAVE_FIELD_NFS_ARGS_T_FHSIZE plog(XLOG_DEBUG, "NA->fhsize = %d", nap->fhsize); fhlen = nap->fhsize; -#endif /* HAVE_NFS_ARGS_T_FHSIZE */ -#ifdef HAVE_NFS_ARGS_T_FH_LEN +#endif /* HAVE_FIELD_NFS_ARGS_T_FHSIZE */ +#ifdef HAVE_FIELD_NFS_ARGS_T_FH_LEN plog(XLOG_DEBUG, "NA->fh_len = %d", nap->fh_len); fhlen = nap->fh_len; -#endif /* HAVE_NFS_ARGS_T_FH_LEN */ +#endif /* HAVE_FIELD_NFS_ARGS_T_FH_LEN */ /* * XXX: need to figure out how to correctly print file handles, @@ -898,32 +910,32 @@ print_nfs_args(const nfs_args_t *nap, u_long nfs_version) plog(XLOG_DEBUG, "NA->filehandle = \"%s\"", get_hex_string(fhlen, (const char *) &nap->NFS_FH_FIELD)); -#ifdef HAVE_NFS_ARGS_T_SOTYPE +#ifdef HAVE_FIELD_NFS_ARGS_T_SOTYPE plog(XLOG_DEBUG, "NA->sotype = %d", nap->sotype); -#endif /* HAVE_NFS_ARGS_T_SOTYPE */ -#ifdef HAVE_NFS_ARGS_T_PROTO +#endif /* HAVE_FIELD_NFS_ARGS_T_SOTYPE */ +#ifdef HAVE_FIELD_NFS_ARGS_T_PROTO plog(XLOG_DEBUG, "NA->proto = %d", (int) nap->proto); -#endif /* HAVE_NFS_ARGS_T_PROTO */ -#ifdef HAVE_NFS_ARGS_T_VERSION +#endif /* HAVE_FIELD_NFS_ARGS_T_PROTO */ +#ifdef HAVE_FIELD_NFS_ARGS_T_VERSION plog(XLOG_DEBUG, "NA->version = %d", nap->version); -#endif /* HAVE_NFS_ARGS_T_VERSION */ +#endif /* HAVE_FIELD_NFS_ARGS_T_VERSION */ plog(XLOG_DEBUG, "NA->flags = 0x%x", (int) nap->flags); plog(XLOG_DEBUG, "NA->rsize = %d", (int) nap->rsize); plog(XLOG_DEBUG, "NA->wsize = %d", (int) nap->wsize); -#ifdef HAVE_NFS_ARGS_T_BSIZE +#ifdef HAVE_FIELD_NFS_ARGS_T_BSIZE plog(XLOG_DEBUG, "NA->bsize = %d", nap->bsize); -#endif /* HAVE_NFS_ARGS_T_BSIZE */ +#endif /* HAVE_FIELD_NFS_ARGS_T_BSIZE */ plog(XLOG_DEBUG, "NA->timeo = %d", (int) nap->timeo); plog(XLOG_DEBUG, "NA->retrans = %d", (int) nap->retrans); -#ifdef HAVE_NFS_ARGS_T_ACREGMIN +#ifdef HAVE_FIELD_NFS_ARGS_T_ACREGMIN plog(XLOG_DEBUG, "NA->acregmin = %d", (int) nap->acregmin); plog(XLOG_DEBUG, "NA->acregmax = %d", (int) nap->acregmax); plog(XLOG_DEBUG, "NA->acdirmin = %d", (int) nap->acdirmin); plog(XLOG_DEBUG, "NA->acdirmax = %d", (int) nap->acdirmax); -#endif /* HAVE_NFS_ARGS_T_ACREGMIN */ +#endif /* HAVE_FIELD_NFS_ARGS_T_ACREGMIN */ #ifdef MNTTAB_OPT_SYMTTL plog(XLOG_DEBUG, "NA->symttl = %d", nap->symttl); #endif /* MNTTAB_OPT_SYMTTL */ diff --git a/contrib/amd/mk-amd-map/mk-amd-map.8 b/contrib/amd/mk-amd-map/mk-amd-map.8 index b9587f7..f6f31f5 100644 --- a/contrib/amd/mk-amd-map/mk-amd-map.8 +++ b/contrib/amd/mk-amd-map/mk-amd-map.8 @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 1997-2003 Erez Zadok +.\" Copyright (c) 1997-1999 Erez Zadok .\" Copyright (c) 1993 Jan-Simon Pendry .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -33,30 +33,32 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)mk-amd-map.8 8.1 (Berkeley) 6/28/93 -.\" $Id: mk-amd-map.8,v 1.3.2.3 2002/12/27 22:45:15 ezk Exp $ +.\" $Id: mk-amd-map.8,v 1.2 1999/01/10 21:54:41 ezk Exp $ +.\" $FreeBSD$ .\" -.TH MK-AMD-MAP 8 "June 28, 1993" -.SH NAME -.B mk-amd-map -\- create database maps for Amd -.SH SYNOPSIS -.B mk-amd-map -[ -.B \-p -] -.I mapname -.SH DESCRIPTION -.B mk-amd-map +.Dd June 28, 1993 +.Dt MK-AMD-MAP 8 +.Os +.Sh NAME +.Nm mk-amd-map +.Nd create database maps for Amd +.Sh SYNOPSIS +.Nm +.Op Fl p +.Ar mapname +.Sh DESCRIPTION +.Nm creates the database maps used by the keyed map lookups in -amd(8). +.Xr amd 8 . It reads input from the named file and outputs them to a correspondingly named hashed database. -.TP -.B \-p -This +.Pp +The +.Fl p option prints the map on standard output instead of generating a database. This is usually used to merge continuation lines into one physical line. -.SH SEE ALSO -.BR amd (8). +.Sh SEE ALSO +.Xr amd.conf 5 , +.Xr amd 8 diff --git a/contrib/amd/mk-amd-map/mk-amd-map.c b/contrib/amd/mk-amd-map/mk-amd-map.c index 1503600..c059f70 100644 --- a/contrib/amd/mk-amd-map/mk-amd-map.c +++ b/contrib/amd/mk-amd-map/mk-amd-map.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-2001 Erez Zadok * Copyright (c) 1990 Jan-Simon Pendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine * Copyright (c) 1990 The Regents of the University of California. @@ -38,7 +38,8 @@ * * %W% (Berkeley) %G% * - * $Id: mk-amd-map.c,v 1.5.2.5 2003/06/09 16:57:46 ezk Exp $ + * $Id: mk-amd-map.c,v 1.5.2.1 2001/01/10 03:23:42 ezk Exp $ + * $FreeBSD$ */ /* @@ -286,22 +287,7 @@ main(int argc, char *argv[]) exit(1); } -#ifdef HAVE_MKSTEMP - { - /* - * XXX: hack to avoid compiler complaints about mktemp not being - * secure, since we have to do a dbm_open on this anyway. So use - * mkstemp if you can, and then close the fd, but we get a safe - * and unique file name. - */ - int dummyfd; - dummyfd = mkstemp(maptmp); - if (dummyfd >= 0) - close(dummyfd); - } -#else /* not HAVE_MKSTEMP */ mktemp(maptmp); -#endif /* not HAVE_MKSTEMP */ /* remove existing temps (if any) */ #ifdef HAVE_DB_SUFFIX @@ -321,7 +307,7 @@ main(int argc, char *argv[]) } #endif /* not HAVE_DB_SUFFIX */ - db = dbm_open(maptmp, O_RDWR|O_CREAT|O_EXCL, 0444); + db = dbm_open(maptmp, O_RDWR|O_CREAT, 0444); if (!db) { fprintf(stderr, "cannot initialize temporary database: %s", maptmp); exit(1); diff --git a/contrib/amd/scripts/amd.conf.5 b/contrib/amd/scripts/amd.conf.5 index 14cc54e..8e29faa 100644 --- a/contrib/amd/scripts/amd.conf.5 +++ b/contrib/amd/scripts/amd.conf.5 @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 1997-2003 Erez Zadok +.\" Copyright (c) 1997-1999 Erez Zadok .\" Copyright (c) 1990 Jan-Simon Pendry .\" Copyright (c) 1990 Imperial College of Science, Technology & Medicine .\" Copyright (c) 1990 The Regents of the University of California. @@ -38,504 +38,664 @@ .\" .\" %W% (Berkeley) %G% .\" -.\" $Id: amd.conf.5,v 1.7.2.8 2003/03/16 01:47:00 ezk Exp $ +.\" $Id: amd.conf.5,v 1.3 1999/03/30 17:23:08 ezk Exp $ +.\" $FreeBSD$ .\" -.TH AMD.CONF 5 "7 August 1997" -.SH NAME -amd.conf \- amd configuration file -.SH SYNOPSIS -.B amd.conf -.SH DESCRIPTION +.Dd April 7, 1997 +.Dt AMD.CONF 5 +.Os +.Sh NAME +.Nm amd.conf +.Nd amd configuration file +.Sh SYNOPSIS +.Nm +.Sh DESCRIPTION The -.B amd.conf +.Nm file is the configuration file for amd, as part of the am-utils suite. -.P -.B amd.conf +.Pp +.Nm contains runtime configuration information for the -.B amd +.Xr amd 8 automounter program. -.\" ************************************************************************** -.SH FILE FORMAT -.P +.Sh FILE FORMAT The file consists of sections and parameters. A section begins with the name of the section in square brackets and continues until the next section -begins or the end the file is reached. Sections contain parameters of the -form 'name = value'. -.P +begins or the end of the file is reached. Sections contain parameters of +the form +.Sq name = value . +.Pp The file is line-based - that is, each newline-terminated line represents either a comment, a section name or a parameter. No line-continuation syntax is available. -.P +.Pp Section, parameter names and their values are case sensitive. -.P +.Pp Only the first equals sign in a parameter is significant. Whitespace before or after the first equals sign is discarded. Leading, trailing and internal whitespace in section and parameter names is irrelevant. Leading and trailing whitespace in a parameter value is discarded. Internal whitespace within a parameter value is not allowed, unless the whole -parameter value is quoted with double quotes as in 'name = "some value"'. -.P +parameter value is quoted with double quotes as in +.Sq name = Qq some\ value . +.Pp Any line beginning with a pound sign (#) is ignored, as are lines containing only whitespace. -.P +.Pp The values following the equals sign in parameters are all either a string (no quotes needed if string does not include spaces) or a boolean, which may be given as yes/no. Case is significant in all values. Some items such as cache timeouts are numeric. -.\" ************************************************************************** -.SH SECTIONS -.SS The [global] section -Parameters in this section either apply to amd as a whole, or to all other -regular map sections which follow. There should be only one global section -defined in one configuration file. -.P +.Sh SECTIONS +.Ss "The [global] section" +Parameters in this section either apply to +.Nm amd +as a whole, or to all other regular map sections which follow. There +should be only one global section defined in one configuration file. +.Pp It is highly recommended that this section be specified first in the configuration file. If it is not, then regular map sections which precede it will not use global values defined later. - -.SS Regular [/map] sections +.Ss "Regular [/map] sections" Parameters in regular (non-global) sections apply to a single map entry. For example, if the map section -.B [/homes] +.Bq Pa /homes is defined, then all parameters following it will be applied to the -.I /homes +.Pa /homes amd-managed mount point. -.\" ************************************************************************** -.SH PARAMETERS -.SS Parameters common to all sections +.Sh PARAMETERS +.Ss "Parameters common to all sections" These parameters can be specified either in the global or a map specific section. Entries specified in a map-specific section override the default value or one defined in the global section. If such a common parameter is specified only in the global section, it is applicable to all regular map sections that follow. -.\" ************************************************************************** -.TP -.BR browsable_dirs " (string, default=no)" -If "yes", then amd's top-level mount points will be browsable to -.BR readdir (3) +.Bl -tag -width 4n +.It Ic browsable_dirs Xo +(string, default=no) +.Xc +If +.Qq yes , +then amd's top-level mount points will be browsable to +.Xr readdir 3 calls. This means you could run for example -.BR ls (3) +.Xr ls 1 and see what keys are available to mount in that directory. Not all entries -are made visible to readdir(3): the "/default" entry, wildcard -entries, and those with a "/" in them are not included. If you specify -"full" to this option, all but "/default" will be visible. -Note that if you run a command which will attempt to -.BR stat (2) -the entries, such as often done by "ls -l" or "ls -F", amd will attempt to -mount -.I every -entry in that map. This is often called a ``mount storm''. - -.TP -.BR map_options " (string, default no options)" -This option is the same as specifying map options on the command line to -amd, such as "cache:=all". - -.TP -.BR map_type " (string, default search all map types)" -If specified, amd will initialize the map only for the type given. This is -useful to avoid the default map search type used by amd which takes longer -and can have undesired side-effects such as initializing NIS even if not -used. Possible values are - -.nf -\fBfile\fR plain files -\fBhesiod\fR Hesiod name service from MIT -\fBldap\fR Lightweight Directory Access Protocol -\fBndbm\fR (New) dbm style hash files -\fBnis\fR Network Information Services (version 2) -\fBnisplus\fR Network Information Services Plus (version 3) -\fBpasswd\fR local password files -\fBunion\fR union maps -.fi - -.TP -.BR mount_type " (string, default=nfs)" -All amd mount types must be NFS. That is, amd is an NFS server on the -map mount points, for the local host it is running on. If "autofs" is -specified, amd will log an error and convert it to NFS. - -.TP -.BR search_path " (string, default no search path)" -This provides a (colon-delimited) search path for file maps. Using a search -path, sites can allow for local map customizations and overrides, and can -distributed maps in several locations as needed. - -.\" ************************************************************************** -.SS Parameters applicable to the global section only - -.TP -.BR arch " (string, default to compiled in value)" +are made visible to +.Xr readdir 3 : +the +.Qq Pa /default +entry, wildcardentries, and those with a +.Qq Pa / +in them are not included. If you specify +.Qq full +to this option, all but +.Qq Pa /default +will be visible. Note that if you run a command which will attempt to +.Xr stat 2 +the entries, such as often done by +.Qq ls -l +or +.Qq ls -F , +.Nm amd +will attempt to mount +.Em every +entry in that map. This is often called a +.Em mount storm . +.It Ic map_options Xo +(string, default no options) +.Xc +This option is the same as specifying map options on the command line to +.Nm amd , +such as +.Ql cache\&:\&=all . +.It Ic map_type Xo +(string, default search all map types) +.Xc +If specified, amd will initialize the map only for the type given. +This is useful to avoid the default map search type used by amd which +takes longer and can have undesired side-effects such as initializing +NIS even if not used. Possible values are: +.Pp +.Bl -tag -width "nisplus" -compact +.It Ic file +plain files +.It Ic hesiod +Hesiod name service from MIT +.It Ic ldap +Lightweight Directory Access Protocol +.It Ic ndbm +(New) dbm style hash files +.It Ic nis +Network Information Services (version 2) +.It Ic nisplus +Network Information Services Plus (version 3) +.It Ic passwd +local password files +.It Ic union +union maps +.El +.It Ic mount_type Xo +(string, default=nfs) +.Xc +All amd mount types default to +.Tn NFS . +That is, +.Nm amd +is an +.Tn NFS +server on the map mount points, for the local host it is running on. If +.Qq autofs +is specified, amd will be an autofs server for those mount points. +.It Ic search_path Xo +(string, default no search path) +.Xc +This provides a +(colon-delimited) +search path for file maps. Using a search path, sites can allow for +local map customizations and overrides, and can distributed maps in +several locations as needed. +.El +.Ss "Parameters applicable to the global section only" +.Bl -tag -width 4n +.It Ic arch Xo +(string, default to compiled in value) +.Xc Allows you to override the value of the -.I arch -amd variable. - -.TP -.BR auto_dir " (string, default=/a)" -Same as the -.B \-a -option to amd. This sets the private directory where amd will create -sub-directories for its real mount points. - -.TP -.BR cache_duration " (numeric, default=300)" +.Va arch +.Nm amd +variable. +.It Ic auto_dir Xo +(string, default=/a) +.Xc +Same as the +.Fl a +option to +.Nm amd . +This sets the private directory where amd will create sub-directories for its +real mount points. +.It Ic cache_duration Xo +(numeric, default=300) +.Xc Same as the -.B \-c -option to amd. Sets the duration in seconds that looked up map entries -remain in the cache. - -.TP -.BR cluster " (string, default no cluster)" -Same as the -.B \-C -option to amd. Specifies the alternate HP-UX cluster to use. - -.TP -.BR debug_options " (string, default no debug options)" +.Fl c +option to +.Nm amd . +Sets the duration in seconds that looked up map entries remain in the cache. +.It Ic cluster Xo +(string, default no cluster) +.Xc Same as the -.B \-D -option to amd. Specify any debugging options for amd. Works only if -am-utils was configured for debugging using the --enable-debug option. The -"mem" option, as well as all other options, can be turned on via ---enable-debug=mem. Otherwise debugging options are ignored. Options are -comma delimited, and can be preceded by the string "no" to negate their -meaning. You can get the list of supported debugging options by running amd -\-H. Possible values are: - -.nf -\fBall\fR all options -\fBamq\fR register for amq -\fBdaemon\fR enter daemon mode -\fBfork\fR fork server -\fBfull\fR program trace -\fBhrtime\fR print high resolution time stamps (only if syslog(3) is not used) -\fBinfo\fR info service specific debugging (hesiod, nis, etc.) -\fBmem\fR trace memory allocations -\fBmtab\fR use local "./mtab" file -\fBreaddir\fR show browsable_dirs progress -\fBstr\fR debug string munging -\fBtest\fR full debug but no daemon -\fBtrace\fR trace protocol and NFS mount arguments -\fBxdrtrace\fR trace XDR routines -.fi - -.TP -.BR dismount_interval " (numeric, default=120)" +.Fl C +option to +.Nm amd . +Specifies the alternate +.Tn HP-UX +cluster to use. +.It Ic debug_options Xo +(string, default no debug options) +.Xc +Same as the +.Fl D +option to +.Nm amd . +Specify any debugging options for +.Nm amd . +Works only if am-utils was configured for debugging using the +.Fl -enable-debug +option. +The +.Qq mem +option alone can be turned on via +.Fl -enable-debug Ns = Ns Ic mem . +Otherwise debugging options are ignored. Options are comma delimited, and can +be preceded by the string +.Qq no +to negate their meaning. You can get the list of supported debugging options +by running +.Nm amd Fl v . +Possible values are: +.Pp +.Bl -tag -width "daemon" -compact +.It Ic all +all options +.It Ic amq +register for +.Xr amq 8 +.It Ic daemon +enter daemon mode +.It Ic fork +fork server +.It Ic full +program trace +.It Ic info +info service specific debugging +(hesiod, nis, etc.) +.It mem +trace memory allocations +.It Ic mtab +use local +.Pa ./mtab +file +.It Ic str +debug string munging +.It Ic test +full debug but no daemon +.It Ic trace +protocol trace +.El +.It Ic dismount_interval Xo +(numeric, default=120) +.Xc Same as the -.B \-w -option to amd. Specify in seconds, the time between attempts to dismount -file systems that have exceeded their cached times. - -.TP -.BR full_os " (string, default to compiled in value)" -The full name of the operating system, along with its version. Allows you -to override the compiled-in full name and version of the operating system. -Useful when the compiled-in name is not desired. For example, the full -operating system name on linux comes up as ``linux'', but you can override -it to ``linux-2.2.5.'' - -.TP -.BR fully_qualified_hosts " (string, default=no)" -If "yes", -.I Amd +.Fl w +option to +.Nm amd . +Specify, in seconds, the time between attempts to dismount file systems that +have exceeded their cached times. +.It Ic fully_qualified_hosts Xo +(string, default=no) +.Xc +If +.Qq yes , +.Nm Amd will perform RPC authentication using fully-qualified host names. This is necessary for some systems, and especially when performing cross-domain mounting. For this function to work, the -.I Amd -variable ${hostd} is used, requiring that ${domain} not be null. - -.TP -.BR hesiod_base " (string, default=automount)" +.Nm amd +variable +.Va ${hostd} +is used, requiring that +.Va ${domain} +not be null. +.It Ic hesiod_base Xo +(string, default=automount) +.Xc Specify the base name for hesiod maps. - -.TP -.BR karch " (string, default to karch of the system)" +.It Ic karch Xo +(string, default to karch of the system) +.Xc Same as the -.B \-k -option to amd. Allows you to override the kernel-architecture of your -system. Useful for example on Sun (Sparc) machines, where you can build one -amd binary, and run it on multiple machines, yet you want each one to get -the correct -.I karch -variable set (for example, sun4c, sun4m, sun4u, etc.) Note that if not -specified, amd will use uname(2) to figure out the kernel architecture of -the machine. - -.TP -.BR ldap_base " (string, default not set)" -Specify the base name for LDAP. This often includes LDAP-specific -values such as country and organization. - -.TP -.BR ldap_cache_maxmem " (numeric, default=131072)" +.Fl k +option to +.Nm amd . +Allows you to override the kernel-architecture of your system. Useful for +example on Sun +(Sparc) +machines, where you can build one +.Nm amd +binary and run it on multiple machines, yet you want each one to get the +correct +.Va karch +variable set +(for example, sun4c, sun4m, sun4u, etc.) +Note that if not +specified, +.Nm amd +will use +.Xr uname 3 +to figure out the kernel architecture of the machine. +.It Ic ldap_base Xo +(string, default not set) +.Xc +Specify the base name for LDAP. +.It Ic ldap_cache_maxmem Xo +(numeric, default=131072) +.Xc Specify the maximum memory amd should use to cache LDAP entries. - -.TP -.BR ldap_cache_seconds " (numeric, default=0)" +.It Ic ldap_cache_seconds Xo +(numeric, default=0) +.Xc Specify the number of seconds to keep entries in the cache. - -.TP -.BR ldap_hostports " (string, default not set)" -Specify the LDAP host and port values. - -.TP -.BR local_domain " (string, default no sub-domain)" +.It Ic ldap_hostports Xo +(string, default not set) +.Xc +Specify LDAP-specific values such as country and organization. +.It Ic local_domain Xo +(string, default no sub-domain) +.Xc Same as the -.B \-d -option to amd. Specify the local domain name. If this option is not given -the domain name is determined from the hostname, by removing the first -component of the fully-qualified host name. - -.TP -.BR log_file " (string, default=/dev/stderr)" +.Fl d +option to +.Nm amd . +Specify the local domain name. If this option is not given the domain name is +determined from the hostname by removing the first component of the +fully-qualified host name. +.It Ic log_file Xo +(string, default=/dev/stderr) +.Xc Same as the -.B \-l -option to amd. Specify a file name to log amd events to. -If the string -.B /dev/stderr -is specified, amd will send its events to the standard error file descriptor. -If the string -.B syslog -is given, amd will record its events with the system logger -.BR syslogd (8). -The default syslog facility used is LOG_DAEMON. If you -wish to change it, append its name to the log file name, delimited by a +.Fl l +option to +.Nm amd . +Specify a file name to log +.Nm amd +events to. If the string +.Pa /dev/stderr +is specified, +.Nm amd +will send its events to the standard error file descriptor. IF the string +.Pa syslog +is given, +.Nm amd +will record its events with the system logger +.Xr syslogd 8 . +The default syslog facility used is +.Ev LOG_DAEMON . +If you wish to change it, append its name to the log file name, delimited by a single colon. For example, if -.I logfile +.Pa logfile is the string -.B syslog:local7 -then amd will log messages via -.IR syslog (3) -using the LOG_LOCAL7 facility (if it exists on the system). - -.TP -.BR log_options " (string, default no logging options)" +.Qq syslog:local7 +then +.Nm amd +will log messages via +.Xr syslog 3 +using the +.Ev LOG_LOCAL7 +facility +(if it exists on the system). +.It Ic log_options Xo +(string, default no logging options) +.Xc Same as the -.B \-x -option to amd. Specify any logging options for amd. Options are comma -delimited, and can be preceded by the string "no" to negate their meaning. -The "debug" logging option is only available if am-utils was configured with ---enable-debug. You can get the list of supported debugging and logging -options by running amd \-H. Possible values are: - -.nf -\fBall\fR all messages -\fBdebug\fR debug messages -\fBerror\fR non-fatal system errors -\fBfatal\fR fatal errors -\fBinfo\fR information -\fBmap\fR map errors -\fBstats\fR additional statistical information -\fBuser\fR non-fatal user errors -\fBwarn\fR warnings -\fBwarning\fR warnings -.fi - -.TP -.BR nfs_vers " (numeric, default to trying version 3 then 2)" -By default, amd tries version 3 and then version 2. This option forces the -overall NFS protocol used to version 3 or 2. It overrides what is in the -amd maps, and is useful when amd is compiled with NFSv3 support that may not -be stable. With this option you can turn off the complete usage of NFSv3 -dynamically (without having to recompile amd) until such time as NFSv3 -support is desired again. - -.TP -.BR nfs_retransmit_counter " (numeric, default=11)" +.Fl x +option to +.Nm amd . +Specify any logging options for +.Nm amd . +Options are comma delimited, and can be preceded by the string +.Dq no +to negate their meaning. The +.Dq debug +logging option is only available if am-utils was configured with +.Fl -enable-debug . +You can get the list of supported debugging options by running +.Nm amd Fl v . +Possible values are: +.Pp +.Bl -tag -width "warning" -compact +.It Ic all +all messages +.It Ic debug +debug messages +.It Ic error +non-fatal system errors +.It Ic fatal +fatal errors +.It Ic info +information +.It Ic map +map errors +.It Ic stats +additional statistical information +.It Ic user +non-fatal user errors +.It Ic warn +warnings +.It Ic warning +warnings +.El +.It Ic nfs_retransmit_counter Xo +(numeric, default=110) +.Xc Same as the -.I retransmit +.Ic counter part of the -.BI \-t " timeout.retransmit" -option to amd. -Specifies the number of NFS retransmissions that the kernel will use to -communicate with amd. - -.TP -.BR nfs_retry_interval " (numeric, default=8)" +.Fl t Ar interval.counter +option to +.Nm amd . +Specifies the retransmit counter's value in tenths of seconds. +.It Ic nfs_retry_interval Xo +(numeric, default=8) +.Xc Same as the -.I timeout -part of the -.BI \-t " timeout.retransmit" -option to amd. Specifies the NFS timeout interval, in -.I tenths -of seconds, between NFS/RPC retries (for UDP only). -This is the value that the kernel will use to -communicate with amd. - -Amd relies on the kernel RPC retransmit mechanism to trigger mount retries. -The values of the -.B nfs_retransmit_counter -and the -.B nfs_retry_interval -parameters change the overall retry interval. Too long an interval gives -poor interactive response; too short an interval causes excessive retries. - -.TP -.BR nfs_proto " (string, default to trying version tcp then udp)" -By default, amd tries TCP and then UDP. This option forces the overall NFS -protocol used to TCP or UDP. It overrides what is in the amd maps, and is -useful when amd is compiled with NFSv3 support that may not be stable. With -this option you can turn off the complete usage of NFSv3 dynamically -(without having to recompile amd) until such time as NFSv3 support is -desired again. - -.TP -.BR nis_domain " (string, default to local NIS domain name)" +.Ic interval +part of the +.Fl t Ar interval.counter +option to +.Nm amd . +Specifies the interval in tenths of seconds, between NFS/RPC/UDP retries. +.It Ic nis_domain Xo +(string, default to local NIS domain name) +.Xc Same as the -.B \-y -option to amd. Specify an alternative NIS domain from which to fetch the -NIS maps. The default is the system domain name. This option is ignored if -NIS support is not available. - -.TP -.BR normalize_hostnames " (boolean, default=no)" +.Fl y +option to +.Nm amd . +Specify an alternative +.Tn NIS +domain from which to fetch the +.Tn NIS +maps. The default is the system domain name. This option is ignored if +.Tn NIS +support is not available. +.It Ic normalize_hostnames Xo +(boolean, default=no) +.Xc Same as the -.B \-n -option to amd. If "yes", then the name refereed to by ${rhost} is -normalized relative to the host database before being used. The effect is -to translate aliases into ``official'' names. - -.TP -.BR os " (string, default to compiled in value)" +.Fl n +option to +.Nm amd . +If +.Dq yes , +then the name refereed to by +.Va ${rhost} +is normalized relative to the host database before being used. The effect is +to translate aliases into +.Qq official +names. +.It Ic os Xo +(string, default to compiled in value) +.Xc Same as the -.B \-O -option to amd. Allows you to override the compiled-in name of the operating +.Fl O +option to +.Nm amd . +Allows you to override the compiled-in name of the operating system. Useful when the built-in name is not desired for backward -compatibility reasons. For example, if the build in name is ``sunos5'', you -can override it to ``sos5'', and use older maps which were written with the -latter in mind. - -.TP -.BR osver " (string, default to compiled in value)" +compatibility reasons. For example, if the build in name is +.Dq sunos5 , +you can override it to +.Dq sos5 , +and use older maps which were written with the latter in mind. +.It Ic osver Xo +(string, default to compiled in value) +.Xc Same as the -.B \-o -option to amd. Overrides the compiled-in version number of the operating +.Fl o +option to +.Nm amd . +Override the compiled-in version number of the operating system. Useful when the built in version is not desired for backward -compatibility reasons. For example, if the build in version is ``2.5.1'', -you can override it to ``5.5.1'', and use older maps that were written with -the latter in mind. - -.TP -.BR pid_file " (string, default=/dev/stdout)" +compatibility reasons. For example, if the build in version is +.Dq 2.5.1 , +you can override it to +.Dq 5.5.1 , +and use older maps that were written with the latter in mind. +.It Ic pid_file Xo +(string, default=/dev/stdout) +.Xc Specify a file to store the process ID of the running daemon into. If not -specified, amd will print its process id onto the standard output. Useful -for killing amd after it had run. Note that the PID of a running amd can -also be retrieved via -.B amq -.BR \-p . -This file is used only if the print_pid option is on. - -.TP -.BR plock " (boolean, default=yes)" +specified, +.Nm amd +will print its process id only the standard output. Useful for killing +.Nm amd +after it had run. Note that the PID of a running +.Nm amd +can also be retrieved via +.Nm amq Fl p . +This file is used only if the +.Ar print_pid +option is on. +.It Ic plock Xo +(boolean, default=yes) +.Xc Same as the -.B \-S -option to amd. -If "yes", lock the running executable pages of amd into memory. To improve -amd's performance, systems that support the -.BR plock (3) -call can lock the amd process into memory. This way there is less chance it -the operating system will schedule, page out, and swap the amd process as -needed. This improves amd's performance, at the cost of reserving the -memory used by the amd process (making it unavailable for other processes). - -.TP -.BR portmap_program " (numeric, default=300019)" +.Fl S +option to +.Nm amd . +If +.Dq yes , +lock the running executable pages of +.Nm amd +into memory. To improve +.Nm amd Ns 's +performance, systems that support the +.Xr plock 3 +call can lock the +.Nm amd +process into memory. This way there is less chance it that the operating +system will schedule, page out, and swap the +.Nm amd +process as needed. This improves +.Nm amd Ns 's +performance, at the cost of reserving the memory used by the +.Nm amd +process +(making it unavailable for other processes). +.It Ic portmap_program Xo +(numeric, default=300019) +.Xc Specify an alternate Port-mapper RPC program number, other than the official -number. This is useful when running multiple amd processes. For example, -you can run another amd in "test" mode, without affecting the primary amd +number. This is useful when running multiple +.Nm amd +processes. For example, you can run another +.Nm amd +in +.Dq test +mode, without affecting the primary +.Nm amd process in any way. For safety reasons, the alternate program numbers that can be specified must be in the range 300019-300029, inclusive. -.B amq +.Nm amq has an option -.B -P -which can be used to specify an alternate program number of an amd to -contact. In this way, amq can fully control any number of amd processes -running on the same host. - -.TP -.BR print_pid " (boolean, default=no)" +.Fl P +which can be used to specify an alternate program number of an +.Nm amd +to contact. In this way, +.Nm amq +can fully control any number of +.Nm amd +processes running on the same host. +.It Ic print_pid Xo +(boolean, default=no) +.Xc Same as the -.B \-p -option to amd. If "yes", amd will print its process ID upon starting. - -.TP -.BR print_version " (boolean, default=no)" +.Fl p +option to +.Nm amd . +If +.Dq yes , +.Nm amd +will print its process ID upon starting. +.It Ic print_version Xo +(boolean, default=no) +.Xc Same as the -.B \-v -option to amd, but the version prints and amd continues to run. If "yes", -amd will print its version information string, which includes some -configuration and compilation values. - -.TP -.BR restart_mounts " (boolean, default=no)" +.Fl v +option to +.Nm amd , +but the version prints and +.Nm amd +continues to run. If +.Dq yes , +.Nm amd +will print its version information string, which includes some configuration +and compilation values. +.It Ic restart_mounts Xo +(boolean, default=no) +.Xc Same as the -.B \-r -option to amd. If "yes" -.B amd +.Fl r +option to +.Nm amd . +If +.Dq yes , +.Nm amd will scan the mount table to determine which file systems are currently mounted. Whenever one of these would have been auto-mounted, -.B amd +.Nm amd inherits it. - -.TP -.BR selectors_in_defaults " (boolean, default=no)" -If "yes", then the /defaults entry of maps will search for and process any -selectors before setting defaults for all other keys in that map. Useful -when you want to set different options for a complete map based on some -parameters. For example, you may want to better the NFS performance over -slow slip-based networks as follows: - -.nf +.It Ic selectors_on_default Xo +(boolean, default=no) +.Xc +If +.Dq yes , +then the +.Pa /default +entry of maps will be looked for and process any selectors before setting +defaults for all other keys in that map. Useful when you want to set +different options for a complete map based on some parameters. For example, +you may want to better the +.Tn NFS +performance over slow slip-based networks as +follows: +.Pp +.Bd -literal /defaults \\ wire==slip-net;opts:=intr,rsize=1024,wsize=1024 \\ wire!=slip-net;opts:=intr,rsize=8192,wsize=8192 -.fi - -Deprecated form: selectors_on_default - -.TP -.BR show_statfs_entries " (boolean), default=no)" -If "yes", then all maps which are browsable will also show the number of -entries (keys) they have when "df" runs. (This is accomplished by returning -non-zero values to the statfs(2) system call). - -.TP -.BR unmount_on_exit " (boolean), default=no)" -If "yes", then amd will attempt to unmount all file systems which it knows -about. Normally amd leaves all (esp. NFS) mounted file systems intact. -Note that amd does not know about file systems mounted before it starts up, -unless the restart_mounts option or -.B \-r +.Ed +.It Ic show_statfs_entries Xo +(boolean, default=no) +.Xc +If +.Dq yes , +then all maps which are browsable will also show the number of entries +(keys) +they have when +.Qq df +runs. +(This is accomplished by returning non-zero values to the +.Xr statfs 2 +system call.) +.It Ic unmount_on_exit Xo +(boolean, default=no) +.Xc +If +.Dq yes , +then +.Nm amd +will attempt to unmount all file systems which it knows about. Normally +.Nm amd +leaves all +(esp.\&) +.Tn NFS +mounted file systems intact. Note that +.Nm amd +does not know about file systems mounted before it starts up, unless the +.Ar restart_mounts +option or +.Fl r flag are used. - -.TP -.BR vendor " (string, default to compiled in value)" -The name of the vendor of the operating system. Overrides the compiled-in -vendor name. Useful when the compiled-in name is not desired. For example, -most Intel based systems set the vendor name to ``unknown'', but you can set -it to ``redhat.'' - -.\" ************************************************************************** -.SS Parameters applicable to regular map sections - -.TP -.BR map_name " (string, must be specified)" +.El +.Ss "Parameters applicable to regular map sections" +.Bl -tag -width 4n +.It Ic map_name Xo +(string, must be specified) +.Xc Name of the map where the keys are located. - -.TP -.BR tag " (string, default no tag)" +.It Ic tag Xo +(string, default no tag) +.Xc Each map entry in the configuration file can be tagged. If no tag is -specified, that map section will always be processed by amd. If it is -specified, then amd will process the map if the -.B -T -option was given to amd, and the value given to that command-line option -matches that in the map section. - -.\" ************************************************************************** -.SH EXAMPLES -Here is a real amd configuration file I use daily. -.P -.nf +specified, that map section will always be processed by +.Nm amd . +If it is specified, then +.Nm amd +will process the map if the +.Fl T +option was given to +.Nm amd , +and the value given to that command-line option matches that in the map +section. +.El +.Sh EXAMPLES +Here is a real +.Nm amd +configuration I use daily. +.Bd -literal # GLOBAL OPTIONS SECTION [ global ] normalize_hostnames = no @@ -546,7 +706,7 @@ log_file = /var/log/amd log_options = all #debug_options = all plock = no -selectors_in_defaults = yes +selectors_on_default = yes # config.guess picks up "sunos5" and I don't want to edit my maps yet os = sos5 # if you print_version after setting up "os", it will show it. @@ -574,16 +734,22 @@ map_name = amd.import [ /tftpboot/.amd ] tag = tftpboot map_name = amd.tftpboot -.fi -.\" ************************************************************************** -.SH "SEE ALSO" -.BR amd (8), -.BR amq (8), -.BR ctl-amd (8). -.SH AUTHORS -Erez Zadok <ezk@cs.columbia.edu>, Department of Computer Science, Columbia -University, New York, USA. -.P -Other authors and contributors to am-utils are listed in the -.B AUTHORS +.Ed +.Sh SEE ALSO +.Xr amd 8 , +.Xr amq 8 +.Sh AUTHORS +.An Erez Zadok Aq ezk@cs.columbia.edu , +Department of Computer Science, Columbia University, New York, USA. +.Pp +.An Jan-Simon Pendry Aq jsp@doc.ic.ac.uk , +Department of Computing, Imperial College, London, UK. +.Pp +Other authors and contributers to am-utils are listed in the +.Pa AUTHORS file distributed with am-utils. +.Sh HISTORY +The +.Nm amd +utility first appeared in +.Bx 4.4 . diff --git a/contrib/amd/scripts/fixrmtab b/contrib/amd/scripts/fixrmtab deleted file mode 100755 index 33b7bcf..0000000 --- a/contrib/amd/scripts/fixrmtab +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# Invalidate /etc/rmtab entries for hosts named. -# Restart mountd for changes to take effect. -# -# usage: fixrmtab host1 host2 ... -# -# Package: am-utils-6.0 -# Author: Andreas Stolcke <stolcke@icsi.berkeley.edu> - -#set -x - -RMTAB=/etc/rmtab -TMP=/tmp/rmtab.$$ - -if [ ! -f /etc/rmtab ]; then - exit 0 -fi - -for host in $* -do - sed -e '/^'$host':/s/^./#/' $RMTAB > $TMP && cp $TMP $RMTAB -done -rm -f $TMP diff --git a/contrib/amd/wire-test/wire-test.8 b/contrib/amd/wire-test/wire-test.8 index ecd85cc..dfb8a86 100644 --- a/contrib/amd/wire-test/wire-test.8 +++ b/contrib/amd/wire-test/wire-test.8 @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 1997-2003 Erez Zadok +.\" Copyright (c) 1997-1999 Erez Zadok .\" Copyright (c) 1990 Jan-Simon Pendry .\" Copyright (c) 1990 Imperial College of Science, Technology & Medicine .\" Copyright (c) 1990 The Regents of the University of California. @@ -38,33 +38,45 @@ .\" .\" %W% (Berkeley) %G% .\" -.\" $Id: wire-test.8,v 1.3.2.4 2002/12/27 22:45:16 ezk Exp $ +.\" $Id: wire-test.8,v 1.2 1999/01/10 21:54:44 ezk Exp $ +.\" $FreeBSD$ .\" -.TH WIRE-TEST 8 "26 Feb 1993" -.SH NAME -wire-test \- test your network interfaces and local IP address -.SH SYNOPSIS -.B wire-test -[ -.I host -] -.SH DESCRIPTION -.LP -.B wire-test -is used to find out what amd thinks are the first two network -interfaces and network names/numbers used, as well as the IP address -used for amd to NFS-mount itself. - +.Dd February 26, 1993 +.Dt WIRE-TEST 8 +.Os +.Sh NAME +.Nm wire-test +.Nd test your network interfaces and local IP address +.Sh SYNOPSIS +.Nm +.Op Ar host +.Sh DESCRIPTION +.Nm +is used to find out what +.Nm Amd +thinks are the first two network interfaces and network names/numbers +used, as well as the IP address used for +.Nm Amd +to NFS-mount itself. +.Pp If -.I host +.Ar host is specified, then -.B wire-test -will test for the working combinations of NFS protocol and version from -the current client to the NFS server -.I host. +.Nm +will test for the working combinations of +.Tn NFS +protocol and version from the current client to the +.Tn NFS +server +.Ar host . If not specified, -.I host -defaults to "localhost". - -.SH "SEE ALSO" -.BR amd (8). +.Ar host +defaults to +.Dq localhost . +.Sh SEE ALSO +.Xr amd 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 3.0 . diff --git a/contrib/amd/wire-test/wire-test.c b/contrib/amd/wire-test/wire-test.c index 9eb5aa2..ef5897a 100644 --- a/contrib/amd/wire-test/wire-test.c +++ b/contrib/amd/wire-test/wire-test.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-2003 Erez Zadok + * Copyright (c) 1997-2001 Erez Zadok * Copyright (c) 1990 Jan-Simon Pendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine * Copyright (c) 1990 The Regents of the University of California. @@ -38,7 +38,8 @@ * * %W% (Berkeley) %G% * - * $Id: wire-test.c,v 1.5.2.3 2002/12/27 22:45:16 ezk Exp $ + * $Id: wire-test.c,v 1.5.2.1 2001/01/10 03:23:43 ezk Exp $ + * $FreeBSD$ * */ |