Import the latest to deal with security problems related to amq RPC.

This commit is contained in:
christos 1999-09-04 22:24:52 +00:00
parent 39e85679c4
commit 39656c1d33
16 changed files with 10948 additions and 309 deletions

View File

@ -1,4 +1,4 @@
$NetBSD: AUTHORS,v 1.1.1.6 1999/02/01 18:45:37 christos Exp $
$NetBSD: AUTHORS,v 1.1.1.7 1999/09/04 22:24:52 christos Exp $
# -*- text -*-
PRIMARY AUTHORS AND MAJOR CONTRIBUTORS TO AM_UTILS:
@ -33,6 +33,8 @@ for hesiod zone files. Always use /etc/amd.conf if exists.
August 8, 1998: add detection support for NFS V.3 for NetBSD 1.3F.
February 1, 1998: fixes for NetBSD to better detect its features.
* Hannes Reinecke <hare@MathI.UNI-Heidelberg.DE>
Back in 1995, contributed code for linux. A new parser for file system
@ -119,6 +121,9 @@ January 11, 1999: hesiod_isup function. Fix format errors in dlog/plog.
Remove obsolete or unnecessary files/macros. Don't report disabled file
systems. More misc fixes.
February 3, 1998: don't start autofs listener unless autofs maps were in
use.
* Jason Thorpe <thorpej@nas.nasa.gov>
August 25, 1997: make amd work when talking to NIS+ servers in NIS
@ -224,3 +229,33 @@ of a looked up entry before unmounting it.
* Douglas K. Rand" <rand@aero.und.edu>
December 3, 1998: case insensitive host name match for nfsl.
* David Wolfskill <dhw@whistle.com>
January 28, 1999: don't turn on/off noconn option if it was already in that
state.
* Jeffrey C Honig <jch@BSDI.COM>
March 14, 1999: clean up more autogenerated files upon "make distclean".
March 15, 1999: avoid overly verbose NIS warning even on systems that don't
run NIS. On BSD systems, wire.c uses getifaddrs(), sysctl(), IRS routines,
and more fixes. Numerous IP packet security fixes.
March 16, 1999: documentation typos. new cdfs options. ufs structure
detection for bsdi4.
* Paul Balyoz <pbalyoz@sedona.ch.intel.com>
March 26, 1999: ensure lostaltmail displays Y2K compliant dates.
* Jon Peatfield <J.S.Peatfield@damtp.cam.ac.uk>
March 30, 1999: turn off incomplete NFS V.3 support in HPUX 10.20.
* Peter Breitenlohner <peb@mppmu.mpg.de>
July 24, 1999: patch for linux 2.2.x to work with older libc5 systems, and
nis_isup mis-logic fixes.
* Dale Talcott <aeh@quest.cc.purdue.edu>
July 26, 1999: added NFS3 support for AIX mounting.
* Christophe Kalt <Christophe-Kalt@deshaw.com>
July 14, 1999: add netgrpd() syntax function which uses FQHN.

View File

@ -1,4 +1,4 @@
/* $NetBSD: amfs_auto.c,v 1.1.1.2 1999/02/01 18:45:57 christos Exp $ */
/* $NetBSD: amfs_auto.c,v 1.1.1.3 1999/09/04 22:25:05 christos Exp $ */
/*
* Copyright (c) 1997-1999 Erez Zadok
@ -40,7 +40,7 @@
*
* %W% (Berkeley) %G%
*
* Id: amfs_auto.c,v 1.3 1999/01/13 23:30:57 ezk Exp
* Id: amfs_auto.c,v 1.4 1999/08/09 06:09:43 ezk Exp
*
*/
@ -62,12 +62,13 @@
/* DEVELOPERS: turn this on for special debugging of readdir code */
#undef DEBUG_READDIR
#define DOT_DOT_COOKIE (u_int) 1
/****************************************************************************
*** STRUCTURES ***
****************************************************************************/
/****************************************************************************
*** FORWARD DEFINITIONS ***
****************************************************************************/
@ -1323,7 +1324,7 @@ amfs_auto_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, i
* fairly unbelievable) then tough.
*/
#ifdef DEBUG
dlog("default search");
dlog("amfs_auto_readdir: default search");
#endif /* DEBUG */
/*
* Check for enough room. This is extremely approximate but is more
@ -1352,8 +1353,7 @@ amfs_auto_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, i
ep[1].ne_fileid = mp->am_gen;
ep[1].ne_name = "..";
ep[1].ne_nextentry = 0;
*(u_int *) ep[1].ne_cookie =
xp ? xp->am_gen : ~(u_int) 0;
*(u_int *) ep[1].ne_cookie = (xp ? xp->am_gen : DOT_DOT_COOKIE);
if (!xp)
dp->dl_eof = TRUE; /* by default assume readdir done */
@ -1361,12 +1361,12 @@ amfs_auto_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, i
return 0;
}
#ifdef DEBUG
dlog("real child");
dlog("amfs_auto_readdir: real child");
#endif /* DEBUG */
if (gen == ~(u_int) 0) {
if (gen == DOT_DOT_COOKIE) {
#ifdef DEBUG
dlog("End of readdir in %s", mp->am_path);
dlog("amfs_auto_readdir: End of readdir in %s", mp->am_path);
#endif /* DEBUG */
dp->dl_eof = TRUE;
dp->dl_entries = 0;
@ -1381,6 +1381,7 @@ amfs_auto_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, i
if (xp) {
int nbytes = count / 2; /* conservative */
int todo = MAX_READDIR_ENTRIES;
dp->dl_entries = ep;
do {
am_node *xp_next = next_nonerror_node(xp->am_osib);
@ -1388,7 +1389,7 @@ amfs_auto_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, i
if (xp_next) {
*(u_int *) ep->ne_cookie = xp_next->am_gen;
} else {
*(u_int *) ep->ne_cookie = ~(u_int) 0;
*(u_int *) ep->ne_cookie = DOT_DOT_COOKIE;
dp->dl_eof = TRUE;
}
@ -1446,7 +1447,7 @@ amfs_auto_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsen
* fairly unbelievable) then tough.
*/
#ifdef DEBUG
dlog("default search");
dlog("amfs_auto_readdir_browsable: default search");
#endif /* DEBUG */
/*
* Check for enough room. This is extremely approximate but is more
@ -1486,7 +1487,7 @@ amfs_auto_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsen
ep[1].ne_fileid = mp->am_gen;
ep[1].ne_name = "..";
ep[1].ne_nextentry = 0;
*(u_int *) ep[1].ne_cookie = ~(u_int) 0;
*(u_int *) ep[1].ne_cookie = DOT_DOT_COOKIE;
/*
* If map is browsable, call a function make_entry_chain() to construct
@ -1498,8 +1499,7 @@ amfs_auto_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsen
if (!te)
return 0;
#ifdef DEBUG_READDIR
j = 0;
for (ne=te; ne; ne=ne->ne_nextentry)
for (j=0,ne=te; ne; ne=ne->ne_nextentry)
plog(XLOG_INFO, "gen1 key %4d \"%s\"", j++, ne->ne_name);
#endif /* DEBUG_READDIR */
@ -1520,19 +1520,23 @@ amfs_auto_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsen
}
ep[1].ne_nextentry = te; /* append this chunk of "te" chain */
#ifdef DEBUG_READDIR
for (ne=te; ne; ne=ne->ne_nextentry)
for (j=0,ne=te; ne; ne=ne->ne_nextentry)
plog(XLOG_INFO, "gen2 key %4d \"%s\"", j++, ne->ne_name);
for (j=0,ne=ep; ne; ne=ne->ne_nextentry)
plog(XLOG_INFO, "gen2+ key %4d \"%s\" fi=%d ck=%d",
j++, ne->ne_name, ne->ne_fileid, *(u_int *)ne->ne_cookie);
plog(XLOG_INFO, "EOF is %d", dp->dl_eof);
#endif /* DEBUG_READDIR */
return 0;
} /* end of "if (gen == 0)" statement */
#ifdef DEBUG
dlog("real child");
dlog("amfs_auto_readdir_browsable: real child");
#endif /* DEBUG */
if (gen == ~(u_int) 0) {
if (gen == DOT_DOT_COOKIE) {
#ifdef DEBUG
dlog("End of readdir in %s", mp->am_path);
dlog("amfs_auto_readdir_browsable: End of readdir in %s", mp->am_path);
#endif /* DEBUG */
dp->dl_eof = TRUE;
dp->dl_entries = 0;
@ -1574,7 +1578,7 @@ amfs_auto_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsen
dp->dl_entries = ep;
#ifdef DEBUG_READDIR
plog(XLOG_INFO, "dl_entries=0x%x, te_next=0x%x, dl_eof=%d",
dp->dl_entries, te_next, dp->dl_eof);
(int) dp->dl_entries, (int) te_next, dp->dl_eof);
for (ne=te; ne; ne=ne->ne_nextentry)
plog(XLOG_INFO, "gen3 key %4d \"%s\"", j++, ne->ne_name);
#endif /* DEBUG_READDIR */

View File

@ -1,4 +1,4 @@
/* $NetBSD: amfs_program.c,v 1.1.1.2 1999/02/01 18:46:03 christos Exp $ */
/* $NetBSD: amfs_program.c,v 1.1.1.3 1999/09/04 22:25:07 christos Exp $ */
/*
* Copyright (c) 1997-1999 Erez Zadok
@ -40,7 +40,7 @@
*
* %W% (Berkeley) %G%
*
* Id: amfs_program.c,v 1.3 1999/01/13 23:30:58 ezk Exp
* Id: amfs_program.c,v 1.4 1999/06/24 06:15:55 ezk Exp
*
*/
@ -133,6 +133,8 @@ amfs_program_exec(char *info)
* Put stdout to stderr
*/
(void) fclose(stdout);
if (!logfp)
logfp = stderr; /* initialize before possible first use */
(void) dup(fileno(logfp));
if (fileno(logfp) != fileno(stderr)) {
(void) fclose(stderr);

View File

@ -1,4 +1,4 @@
/* $NetBSD: amfs_toplvl.c,v 1.1.1.2 1999/02/01 18:46:04 christos Exp $ */
/* $NetBSD: amfs_toplvl.c,v 1.1.1.3 1999/09/04 22:25:08 christos Exp $ */
/*
* Copyright (c) 1997-1999 Erez Zadok
@ -40,7 +40,7 @@
*
* %W% (Berkeley) %G%
*
* Id: amfs_toplvl.c,v 1.3 1999/01/10 21:53:43 ezk Exp
* Id: amfs_toplvl.c,v 1.5 1999/02/04 07:24:14 ezk Exp
*
*/
@ -229,8 +229,10 @@ mount_amfs_toplvl(char *dir, char *opts)
/* This is it! Here we try to mount amd on its mount points */
#ifdef DEBUG
amuDebug(D_TRACE)
amuDebug(D_TRACE) {
print_nfs_args(&nfs_args, 0);
plog(XLOG_DEBUG, "Generic mount flags 0x%x", genflags);
}
#endif /* DEBUG */
error = mount_fs(&mnt, genflags, (caddr_t) &nfs_args, retry, type,
0, NULL, mnttab_file_name);

View File

@ -1,4 +1,4 @@
/* $NetBSD: info_hesiod.c,v 1.1.1.1 1999/02/01 18:46:09 christos Exp $ */
/* $NetBSD: info_hesiod.c,v 1.1.1.2 1999/09/04 22:25:13 christos Exp $ */
/*
* Copyright (c) 1997-1999 Erez Zadok
@ -40,7 +40,7 @@
*
* %W% (Berkeley) %G%
*
* Id: info_hesiod.c,v 1.4 1999/01/13 23:30:58 ezk Exp
* Id: info_hesiod.c,v 1.5 1999/02/04 07:24:15 ezk Exp
*
*/
@ -64,6 +64,7 @@ extern int hesiod_init(void **context);
static voidp hesiod_context;
#endif /* HAVE_HESIOD_INIT */
/* forward declarations */
int amu_hesiod_init(mnt_map *m, char *map, time_t *tp);
int hesiod_search(mnt_map *m, char *map, char *key, char **pval, time_t *tp);
int hesiod_isup(mnt_map *m, char *map);

View File

@ -0,0 +1,684 @@
$NetBSD: am-utils.info-7,v 1.1.1.1 1999/09/04 22:25:45 christos Exp $
This is Info file am-utils.info, produced by Makeinfo version 1.68 from
the input file am-utils.texi.
START-INFO-DIR-ENTRY
* Am-utils: (am-utils). The Amd automounter suite of utilities
END-INFO-DIR-ENTRY

File: am-utils.info, Node: Index, Prev: Acknowledgments & Trademarks, Up: Top
Index
*****
* Menu:
* !exists, boolean mount selector: exists Selector Function.
* !false, boolean mount selector: false Selector Function.
* !in_network, boolean mount selector: in_network Selector Function.
* !netgrp, boolean mount selector: netgrp Selector Function.
* !netgrpd, boolean mount selector: netgrpd Selector Function.
* !true, boolean mount selector: true Selector Function.
* /defaults with selectors: /defaults with selectors.
* /etc/passwd maps: Password maps.
* /etc/rc.local additions: Starting Amd.
* /tftpboot in a chroot-ed environment: /tftpboot in a chroot-ed environment.
* /vol: /vol.
* Additions to /etc/rc.local: Starting Amd.
* addopts, mount option: addopts Option.
* Aliased hostnames: -n Option.
* Alternate locations: Mounting a Volume.
* am-eject: am-eject.
* Amd command line options: Amd Command Line Options.
* Amd Configuration File: Amd Configuration File.
* Amd configuration file: -F Option.
* Amd configuration file; specifying name: -F Option.
* Amd's PID: Amq -p option.
* Amd's process ID: Amq -p option.
* amd.conf: Amd Configuration File.
* amd.conf common parameters: Common Parameters.
* amd.conf examples: amd.conf Examples.
* amd.conf file: -F Option.
* amd.conf file format: File Format.
* amd.conf global parameters: Global Parameters.
* amd.conf global section: The Global Section.
* amd.conf regular map parameters: Regular Map Parameters.
* amd.conf regular map sections: Regular Map Sections.
* amd.conf-sample: amd.conf-sample.
* amd2ldif: amd2ldif.
* amd2sun: amd2sun.
* Amq command: Run-time Administration.
* arch Parameter: arch Parameter.
* arch Selector Variable: arch Selector Variable.
* arch, FSinfo host attribute: FSinfo host arch.
* arch, mount selector: arch Selector Variable.
* Architecture dependent volumes: Architecture Sharing.
* Architecture sharing: Architecture Sharing.
* Architecture specific mounts: rwho servers.
* Assorted Tools: Assorted Tools.
* Atomic NFS mounts: Network Filesystem Group.
* auto, filesystem type: Automount Filesystem.
* auto_dir Parameter: auto_dir Parameter.
* autodir Selector Variable: autodir Selector Variable.
* autodir, mount selector: autodir Selector Variable.
* Autofs filesystem: Autofs Filesystem.
* autofs, filesystem type: Autofs Filesystem.
* Automatic generation of user maps: Password maps.
* Automount directory: -a Option.
* Automount filesystem: Automount Filesystem.
* automount2amd: automount2amd.
* Automounter configuration maps: Mount Maps.
* Automounter fundamentals: Fundamentals.
* Background mounts: Mounting a Volume.
* Background to Mail Delivery: Background to Mail Delivery.
* Binding names to filesystems: Volume Binding.
* bootparams, FSinfo prefix: -b FSinfo Option.
* browsable_dirs Parameter: browsable_dirs Parameter.
* Bug reports: Distrib.
* byte Selector Variable: byte Selector Variable.
* byte, mount selector: byte Selector Variable.
* Cache interval: -c Option.
* cache, mount option: Automount Filesystem.
* cache_duration Parameter: cache_duration Parameter.
* cachedir, mount option: Caching Filesystem.
* cachefs, filesystem type: Caching Filesystem.
* Caching Filesystem: Caching Filesystem.
* Catch-all mount point: /vol.
* CD-ROM Filesystem: CD-ROM Filesystem.
* cdfs, filesystem type: CD-ROM Filesystem.
* Centralized Mail Spool Directory: Centralized Mail Spool Directory.
* Changing the interval before a filesystem times out: -c Option.
* chroot: /tftpboot example: /tftpboot in a chroot-ed environment.
* Cluster names: -C-Option.
* cluster Parameter: cluster Parameter.
* cluster Selector Variable: cluster Selector Variable.
* cluster, FSinfo host attribute: FSinfo host cluster.
* cluster, mount selector: cluster Selector Variable.
* Command line options, Amd: Amd Command Line Options.
* Command line options, FSinfo: FSinfo Command Line Options.
* config, FSinfo host attribute: FSinfo host config.
* Configuration file; tags: -T-Option.
* Configuration map types: Map Types.
* Controlling Amd: Controlling Amd.
* Controlling Hlfsd: Controlling Hlfsd.
* Creating a pid file: -p Option.
* ctl-amd <1>: Starting Amd.
* ctl-amd: ctl-amd.
* ctl-hlfsd <1>: ctl-hlfsd.
* ctl-hlfsd: Controlling Hlfsd.
* Debug options: -D-Option.
* debug_options Parameter: debug_options Parameter.
* Debugging a new Amd configuration: Amq -P-option.
* debugging hesiod resolver service: -D-Option.
* Debugging options via Amq: Other Amq options.
* Defining a host, FSinfo: FSinfo host definitions.
* Defining an Amd mount map, FSinfo: FSinfo automount definitions.
* Defining host attributes, FSinfo: FSinfo host attributes.
* delay, mount option: delay Option.
* Delaying mounts from specific locations: delay Option.
* Determining the map type: Map Types.
* dev, mount option <1>: Floppy Filesystem.
* dev, mount option <2>: Unix Filesystem.
* dev, mount option: CD-ROM Filesystem.
* Direct automount filesystem: Direct Automount Filesystem.
* direct, filesystem type: Direct Automount Filesystem.
* Discovering version information: -v Option.
* Discovering what is going on at run-time: Controlling Amd.
* Disk filesystems: Unix Filesystem.
* dismount_interval Parameter: dismount_interval Parameter.
* Displaying brief help: -H Option.
* Displaying the process id: -p Option.
* Distributed Mail Spool Service: Distributed Mail Spool Service.
* Domain name: -d Option.
* domain Selector Variable: domain Selector Variable.
* Domain stripping: Variable Expansion.
* domain, mount selector: domain Selector Variable.
* Domainname operators: Variable Expansion.
* dumpset, FSinfo filesystems option: FSinfo filesystems dumpset.
* dumpset, FSinfo prefix: -d FSinfo Option.
* Duplicated volumes: Volume Naming.
* EFS: Unix Filesystem.
* efs, filesystem type: Unix Filesystem.
* Environment variables: Variable Expansion.
* Error filesystem: Error Filesystem.
* error, filesystem type: Error Filesystem.
* Example of architecture specific mounts: rwho servers.
* Example of mounting home directories: Home Directories.
* exists Selector Function: exists Selector Function.
* exists, boolean mount selector: exists Selector Function.
* expn: expn.
* export, FSinfo special fstype: FSinfo filesystems fstype.
* exportfs, FSinfo mount option: FSinfo filesystems mount.
* exports, FSinfo prefix: -e FSinfo Option.
* false Selector Function: false Selector Function.
* false, boolean mount selector: false Selector Function.
* File map syntactic conventions: File maps.
* File maps: File maps.
* Fileserver: Filesystems and Volumes.
* Filesystem: Filesystems and Volumes.
* Filesystem info package: FSinfo.
* Filesystem type; auto: Automount Filesystem.
* Filesystem type; autofs: Autofs Filesystem.
* Filesystem type; cachefs: Caching Filesystem.
* Filesystem type; cdfs: CD-ROM Filesystem.
* Filesystem type; direct: Direct Automount Filesystem.
* Filesystem type; efs: Unix Filesystem.
* Filesystem type; error: Error Filesystem.
* Filesystem type; host: Network Host Filesystem.
* Filesystem type; inherit: Inheritance Filesystem.
* Filesystem type; link: Symbolic Link Filesystem.
* Filesystem type; linkx: Symbolic Link Filesystem II.
* Filesystem type; lofs: Loopback Filesystem.
* Filesystem type; mfs: Memory/RAM Filesystem.
* Filesystem type; nfs: Network Filesystem.
* Filesystem type; nfsl: NFS-Link Filesystem.
* Filesystem type; nfsx: Network Filesystem Group.
* Filesystem type; nullfs: Null Filesystem.
* Filesystem type; pcfs: Floppy Filesystem.
* Filesystem type; program: Program Filesystem.
* Filesystem type; root: Root Filesystem.
* Filesystem type; tfs: Translucent Filesystem.
* Filesystem type; tmpfs: Shared Memory+Swap Filesystem.
* Filesystem type; toplvl: Top-level Filesystem.
* Filesystem type; ufs: Unix Filesystem.
* Filesystem type; umapfs: User ID Mapping Filesystem.
* Filesystem type; union: Union Filesystem.
* Filesystem type; xfs: Unix Filesystem.
* Filesystem types: Filesystem Types.
* fix-amd-map: fix-amd-map.
* fixmount: fixmount.
* fixrmtab: fixrmtab.
* Flat file maps: File maps.
* Floppy Filesystem: Floppy Filesystem.
* Flushing the map cache: Amq -f option.
* Forcing Amq to use a TCP transport: Amq -T option.
* Forcing Amq to use a UDP transport: Amq -U-option.
* Forcing filesystem to time out: Amq -u option.
* freq, FSinfo filesystems option: FSinfo filesystems freq.
* fs, mount option: fs Option.
* FSinfo: FSinfo.
* FSinfo arch host attribute: FSinfo host arch.
* FSinfo automount definitions: FSinfo automount definitions.
* FSinfo cluster host attribute: FSinfo host cluster.
* FSinfo command line options: FSinfo Command Line Options.
* FSinfo config host attribute: FSinfo host config.
* FSinfo dumpset filesystems option: FSinfo filesystems dumpset.
* FSinfo error messages: FSinfo errors.
* FSinfo filesystems: FSinfo filesystems.
* FSinfo freq filesystems option: FSinfo filesystems freq.
* FSinfo fstype filesystems option: FSinfo filesystems fstype.
* FSinfo grammar: FSinfo Grammar.
* FSinfo host attributes: FSinfo host attributes.
* FSinfo host definitions: FSinfo host definitions.
* FSinfo log filesystems option: FSinfo filesystems log.
* FSinfo mount filesystems option: FSinfo filesystems mount.
* FSinfo opts filesystems option: FSinfo filesystems opts.
* FSinfo os host attribute: FSinfo host os.
* FSinfo overview: FSinfo Overview.
* FSinfo passno filesystems option: FSinfo filesystems passno.
* FSinfo static mounts: FSinfo static mounts.
* fstab, FSinfo prefix: -f FSinfo Option.
* fstype, FSinfo filesystems option: FSinfo filesystems fstype.
* fully_qualified_hosts Parameter: fully_qualified_hosts Parameter.
* Generic volume name: /vol.
* Global statistics: Amq -s option.
* Grammar, FSinfo: FSinfo Grammar.
* Help; showing from Amd: -H Option.
* Hesiod maps: Hesiod maps.
* Hesiod: turning on RES_DEBUG: -D-Option.
* hesiod_base Parameter: hesiod_base Parameter.
* History: History.
* Hlfsd: Hlfsd.
* Hlfsd Files: Hlfsd Files.
* Hlfsd Options: Hlfsd Options.
* Hlfsd; background: Background to Mail Delivery.
* Hlfsd; controlling: Controlling Hlfsd.
* Hlfsd; Files: Hlfsd Files.
* Hlfsd; introduction: Introduction to Hlfsd.
* Hlfsd; Options: Hlfsd Options.
* Hlfsd; using: Using Hlfsd.
* Hlfsd; Why Deliver Into the Home Directory?: Why Deliver Into the Home Directory?.
* Home directories: Home Directories.
* Home-Link Filesystem: Hlfsd.
* host Selector Variable: host Selector Variable.
* host, filesystem type: Network Host Filesystem.
* host, mount selector: host Selector Variable.
* hostd Selector Variable: hostd Selector Variable.
* hostd, mount selector: hostd Selector Variable.
* Hostname normalization: -n Option.
* hostname, FSinfo command line option: -h FSinfo Option.
* How keys are looked up: Key Lookup.
* How locations are parsed: Location Format.
* How to access environment variables in maps: Variable Expansion.
* How to discover your version of Amd: -v Option.
* How to mount a local disk: Unix Filesystem.
* How to mount a UFS filesystems: Unix Filesystem.
* How to mount all NFS exported filesystems: Network Host Filesystem.
* How to mount an atomic group of NFS filesystems: Network Filesystem Group.
* How to mount and NFS filesystem: Network Filesystem.
* How to reference an existing part of the local name space: Symbolic Link Filesystem II.
* How to reference part of the local name space: Symbolic Link Filesystem.
* How to select log messages: -x Option.
* How to set default map parameters: Map Defaults.
* How to set map cache parameters: Automount Filesystem.
* How to start a direct automount point: Direct Automount Filesystem.
* How to start an indirect automount point: Automount Filesystem.
* How variables are expanded: Variable Expansion.
* in_network Selector Function: in_network Selector Function.
* in_network, boolean mount selector: in_network Selector Function.
* inherit, filesystem type: Inheritance Filesystem.
* Inheritance filesystem: Inheritance Filesystem.
* Interval before a filesystem times out: -c Option.
* Introduction: Intro.
* Introduction to Hlfsd: Introduction to Hlfsd.
* karch Parameter: karch Parameter.
* karch Selector Variable: karch Selector Variable.
* karch, mount selector: karch Selector Variable.
* Keep-alives: Keep-alives.
* Key lookup: Key Lookup.
* key Selector Variable: key Selector Variable.
* key, mount selector: key Selector Variable.
* Killing and starting Amd: Restarting Amd.
* LDAP maps: LDAP maps.
* ldap_base Parameter: ldap_base Parameter.
* ldap_cache_maxmem Parameter: ldap_cache_maxmem Parameter.
* ldap_cache_seconds Parameter: ldap_cache_seconds Parameter.
* ldap_hostports Parameter: ldap_hostports Parameter.
* License Information: License.
* Lightweight Directory Access Protocol: LDAP maps.
* link, filesystem type: Symbolic Link Filesystem.
* linkx, filesystem type: Symbolic Link Filesystem II.
* Listing currently mounted filesystems: Controlling Amd.
* local_domain Parameter: local_domain Parameter.
* Location format: Location Format.
* Location lists: Mounting a Volume.
* locking executable pages in memory: -S Option.
* lofs, filesystem type: Loopback Filesystem.
* Log file, resetting: Amq -l option.
* Log filename: -l Option.
* Log message selection: -x Option.
* log, FSinfo filesystems option: FSinfo filesystems log.
* log_file Parameter: log_file Parameter.
* log_options Parameter: log_options Parameter.
* Logging options via Amq: Other Amq options.
* Looking up keys: Key Lookup.
* Loopback Filesystem: Loopback Filesystem.
* lostaltmail: lostaltmail.
* lostaltmail.conf-sample: lostaltmail.conf-sample.
* lostaltmail; configuration file: lostaltmail.conf-sample.
* Mailing list: Distrib.
* Map cache options: Automount Filesystem.
* Map cache synchronizing: Automount Filesystem.
* Map cache types: Automount Filesystem.
* Map cache, flushing: Amq -f option.
* Map defaults: Map Defaults.
* Map entry format: Location Format.
* Map lookup: Key Lookup.
* Map options: Map Options.
* map Selector Variable: map Selector Variable.
* Map types: Map Types.
* map, mount selector: map Selector Variable.
* map_name Parameter: map_name Parameter.
* map_options Parameter: map_options Parameter.
* map_type Parameter: map_type Parameter.
* maps, FSinfo command line option: -m FSinfo Option.
* Memory/RAM Filesystem: Memory/RAM Filesystem.
* mfs, filesystem type: Memory/RAM Filesystem.
* mk-amd-map: mk-amd-map.
* Mount a filesystem under program control: Program Filesystem.
* Mount flags; acdirmax: opts Option.
* Mount flags; acdirmin: opts Option.
* Mount flags; acregmax: opts Option.
* Mount flags; acregmin: opts Option.
* Mount flags; actimeo: opts Option.
* Mount flags; auto: opts Option.
* Mount flags; cache: opts Option.
* Mount flags; compress: opts Option.
* Mount flags; defperm: opts Option.
* Mount flags; dev: opts Option.
* Mount flags; dumbtimr: opts Option.
* Mount flags; extatt: opts Option.
* Mount flags; fsid: opts Option.
* Mount flags; gens: opts Option.
* Mount flags; grpid: opts Option.
* Mount flags; ignore: opts Option.
* Mount flags; int: opts Option.
* Mount flags; intr: opts Option.
* Mount flags; maxgroups: opts Option.
* Mount flags; multi: opts Option.
* Mount flags; nfsv3: opts Option.
* Mount flags; noac: opts Option.
* Mount flags; noauto: opts Option.
* Mount flags; nocache: opts Option.
* Mount flags; noconn: opts Option.
* Mount flags; nocto: opts Option.
* Mount flags; nodefperm: opts Option.
* Mount flags; nodev: opts Option.
* Mount flags; nodevs: opts Option.
* Mount flags; noint: opts Option.
* Mount flags; norrip: opts Option.
* Mount flags; nosub: opts Option.
* Mount flags; nosuid: opts Option.
* Mount flags; nounmount: opts Option.
* Mount flags; noversion: opts Option.
* Mount flags; overlay: opts Option.
* Mount flags; pgthresh: opts Option.
* Mount flags; ping: opts Option.
* Mount flags; port: opts Option.
* Mount flags; posix: opts Option.
* Mount flags; proto: opts Option.
* Mount flags; quota: opts Option.
* Mount flags; rdonly: opts Option.
* Mount flags; resvport: opts Option.
* Mount flags; retrans: opts Option.
* Mount flags; retry: opts Option.
* Mount flags; retry=N: opts Option.
* Mount flags; ro: opts Option.
* Mount flags; rrip: opts Option.
* Mount flags; rsize: opts Option.
* Mount flags; rw: opts Option.
* Mount flags; soft: opts Option.
* Mount flags; spongy: opts Option.
* Mount flags; suid: opts Option.
* Mount flags; symttl: opts Option.
* Mount flags; sync: opts Option.
* Mount flags; tcp: opts Option.
* Mount flags; timeo: opts Option.
* Mount flags; utimeout=N: opts Option.
* Mount flags; vers: opts Option.
* Mount flags; wsize: opts Option.
* Mount home directories: Home Directories.
* Mount information: Mount Maps.
* Mount map types: Map Types.
* Mount maps: Mount Maps.
* Mount option; addopts: addopts Option.
* Mount option; cache: Automount Filesystem.
* Mount option; cachedir: Caching Filesystem.
* Mount option; delay: delay Option.
* Mount option; dev <1>: CD-ROM Filesystem.
* Mount option; dev <2>: Unix Filesystem.
* Mount option; dev: Floppy Filesystem.
* Mount option; fs: fs Option.
* Mount option; mount: Program Filesystem.
* Mount option; opts: opts Option.
* Mount option; remopts: remopts Option.
* Mount option; rfs <1>: Network Filesystem.
* Mount option; rfs: Loopback Filesystem.
* Mount option; rhost: Network Filesystem.
* Mount option; sublink: sublink Option.
* Mount option; type: type Option.
* Mount option; unmount: Program Filesystem.
* Mount retries: Mounting a Volume.
* Mount selector; arch: arch Selector Variable.
* Mount selector; autodir: autodir Selector Variable.
* Mount selector; byte: byte Selector Variable.
* Mount selector; cluster: cluster Selector Variable.
* Mount selector; domain: domain Selector Variable.
* Mount selector; exists: exists Selector Function.
* Mount selector; false: false Selector Function.
* Mount selector; host: host Selector Variable.
* Mount selector; hostd: hostd Selector Variable.
* Mount selector; in_network: in_network Selector Function.
* Mount selector; karch: karch Selector Variable.
* Mount selector; key: key Selector Variable.
* Mount selector; map: map Selector Variable.
* Mount selector; netgrp: netgrp Selector Function.
* Mount selector; netgrpd: netgrpd Selector Function.
* Mount selector; netnumber: netnumber Selector Variable.
* Mount selector; network: network Selector Variable.
* Mount selector; os: os Selector Variable.
* Mount selector; osver: osver Selector Variable.
* Mount selector; path: path Selector Variable.
* Mount selector; true: true Selector Function.
* Mount selector; wire: wire Selector Variable.
* mount system call: opts Option.
* mount system call flags: opts Option.
* Mount types: Filesystem Types.
* mount, FSinfo filesystems option: FSinfo filesystems mount.
* mount, mount option: Program Filesystem.
* mount_type Parameter: mount_type Parameter.
* Mounting a local disk: Unix Filesystem.
* Mounting a remote part of the name space if target is missing: NFS-Link Filesystem.
* Mounting a UFS filesystem: Unix Filesystem.
* Mounting a volume: Mounting a Volume.
* Mounting an atomic group of NFS filesystems: Network Filesystem Group.
* Mounting an existing part of the local name space: Symbolic Link Filesystem II.
* Mounting an NFS filesystem: Network Filesystem.
* Mounting entire export trees: Network Host Filesystem.
* Mounting part of the local name space: Symbolic Link Filesystem.
* Mounting user filesystems: User Filesystems.
* Multiple Amd processes: Amq -P-option.
* Multiple-threaded server: Non-blocking Operation.
* Namespace: Volume Binding.
* ndbm maps: ndbm maps.
* netgrp Selector Function: netgrp Selector Function.
* netgrp, boolean mount selector: netgrp Selector Function.
* netgrpd Selector Function: netgrpd Selector Function.
* netgrpd, boolean mount selector: netgrpd Selector Function.
* netnumber Selector Variable: netnumber Selector Variable.
* netnumber, mount selector: netnumber Selector Variable.
* Network filesystem group: Network Filesystem Group.
* Network host filesystem: Network Host Filesystem.
* network Selector Variable: network Selector Variable.
* network, mount selector: network Selector Variable.
* Network-wide naming: Volume Naming.
* NFS: Network Filesystem.
* NFS ping: Keep-alives.
* NFS V.3 support: Supported Platforms.
* nfs, filesystem type: Network Filesystem.
* NFS-Link filesystem II: NFS-Link Filesystem.
* nfs_retransmit_counter Parameter: nfs_retransmit_counter Parameter.
* nfs_retry_interval Parameter: nfs_retry_interval Parameter.
* nfsl, filesystem type: NFS-Link Filesystem.
* nfsx, filesystem type: Network Filesystem Group.
* NIS (YP) domain name: -y Option.
* NIS (YP) maps: NIS maps.
* NIS+ maps: NIS+ maps.
* nis_domain Parameter: nis_domain Parameter.
* Nodes generated on a restart: Inheritance Filesystem.
* Non-blocking operation: Non-blocking Operation.
* normalize_hostnames Parameter: normalize_hostnames Parameter.
* Normalizing hostnames: -n Option.
* Null Filesystem: Null Filesystem.
* nullfs, filesystem type: Null Filesystem.
* Obtaining the source code: Distrib.
* Operating System name: -O-Option.
* Operating System version: -o Option.
* Operational principles: Operational Principles.
* opts, FSinfo filesystems option: FSinfo filesystems opts.
* opts, mount option: opts Option.
* os Parameter: os Parameter.
* os Selector Variable: os Selector Variable.
* os, FSinfo host attribute: FSinfo host os.
* os, mount selector: os Selector Variable.
* osver Parameter: osver Parameter.
* osver Selector Variable: osver Selector Variable.
* osver, mount selector: osver Selector Variable.
* Overriding defaults on the command line: Amd Command Line Options.
* Overriding or adding options to a mount: addopts Option.
* Overriding the default mount point: fs Option.
* Overriding the local domain name: -d Option.
* Overriding the NIS (YP) domain name: -y Option.
* Passing parameters to the mount system call: opts Option.
* passno, FSinfo filesystems option: FSinfo filesystems passno.
* Password file maps: Password maps.
* path Selector Variable: path Selector Variable.
* path, mount selector: path Selector Variable.
* Pathname operators: Variable Expansion.
* pawd: pawd.
* pcfs, filesystem type: Floppy Filesystem.
* Picking up existing mounts: -r Option.
* pid file, creating with -p option: -p Option.
* PID; Amd: Amq -p option.
* pid_file Parameter: pid_file Parameter.
* plock Parameter: plock Parameter.
* plock; using: -S Option.
* portmap_program Parameter: portmap_program Parameter.
* Primary server: delay Option.
* print_pid Parameter: print_pid Parameter.
* print_version Parameter: print_version Parameter.
* Process id: -p Option.
* process id of Amd daemon: -p Option.
* Process ID; Amd: Amq -p option.
* Program filesystem: Program Filesystem.
* program, filesystem type: Program Filesystem.
* Querying an alternate host: Amq -h option.
* quiet, FSinfo command line option: -q FSinfo Option.
* Referencing an existing part of the local name space: Symbolic Link Filesystem II.
* Referencing an existing part of the name space if target exists: NFS-Link Filesystem.
* Referencing part of the local name space: Symbolic Link Filesystem.
* Regular expressions in maps: Automount Filesystem.
* remopts, mount option: remopts Option.
* Replacement volumes: Volume Naming.
* Replicated volumes: Volume Naming.
* Resetting the Amd log file: Amq -l option.
* Resolving aliased hostnames: -n Option.
* restart_mounts Parameter: restart_mounts Parameter.
* Restarting Amd: Restarting Amd.
* Restarting existing mounts: -r Option.
* rfs, mount option <1>: Loopback Filesystem.
* rfs, mount option: Network Filesystem.
* rhost, mount option: Network Filesystem.
* Root filesystem: Root Filesystem.
* root, filesystem type: Root Filesystem.
* RPC Program numbers; Amd: Amq -P-option.
* RPC retries: Non-blocking Operation.
* Run-time administration: Run-time Administration.
* Running multiple Amd: Amq -P-option.
* rwho servers: rwho servers.
* search_path Parameter: search_path Parameter.
* Secondary server: delay Option.
* sel, FSinfo mount option: FSinfo filesystems mount.
* Selecting specific log messages: -x Option.
* Selector; arch: arch Selector Variable.
* Selector; autodir: autodir Selector Variable.
* Selector; byte: byte Selector Variable.
* Selector; cluster: cluster Selector Variable.
* Selector; domain: domain Selector Variable.
* Selector; exists: exists Selector Function.
* Selector; false: false Selector Function.
* Selector; host: host Selector Variable.
* Selector; hostd: hostd Selector Variable.
* Selector; in_network: in_network Selector Function.
* Selector; karch: karch Selector Variable.
* Selector; key: key Selector Variable.
* Selector; map: map Selector Variable.
* Selector; netgrp: netgrp Selector Function.
* Selector; netgrpd: netgrpd Selector Function.
* Selector; netnumber: netnumber Selector Variable.
* Selector; network: network Selector Variable.
* Selector; os: os Selector Variable.
* Selector; osver: osver Selector Variable.
* Selector; path: path Selector Variable.
* Selector; true: true Selector Function.
* Selector; wire: wire Selector Variable.
* Selectors: Selectors.
* selectors on default: /defaults with selectors.
* selectors_on_default Parameter: selectors_on_default Parameter.
* Server crashes: Keep-alives.
* Setting a delay on a mount location: delay Option.
* Setting additional options on a mount location: addopts Option.
* Setting Amd's RPC parameters: -t Option.
* Setting debug flags: -D-Option.
* Setting default map parameters: Map Defaults.
* Setting map cache parameters: Automount Filesystem.
* Setting map options: Map Options.
* Setting system mount options: opts Option.
* Setting system mount options for non-local networks: remopts Option.
* Setting the Amd log file via Amq: Amq -l option.
* Setting the cluster name: -C-Option.
* Setting the default mount directory: -a Option.
* Setting the filesystem type option: type Option.
* Setting the interval before a filesystem times out: -c Option.
* Setting the interval between unmount attempts: -w Option.
* Setting the Kernel architecture: -k Option.
* Setting the local domain name: -d Option.
* Setting the local mount point: fs Option.
* Setting the log file: -l Option.
* Setting the NIS (YP) domain name: -y Option.
* Setting the Operating System name: -O-Option.
* Setting the Operating System version: -o Option.
* Setting the sublink option: sublink Option.
* shared libraries: Supported Platforms.
* Shared Memory and Swap Filesystem: Shared Memory+Swap Filesystem.
* Sharing a fileserver between architectures: Architecture Sharing.
* show_statfs_entries Parameter: show_statfs_entries Parameter.
* SIGHUP signal: Automount Filesystem.
* SIGINT signal: Stopping Amd.
* SIGTERM signal: Stopping Amd.
* Single-Host Mail Spool Directory: Single-Host Mail Spool Directory.
* Source code distribution: Distrib.
* Starting Amd: Starting Amd.
* Statically mounts filesystems, FSinfo: FSinfo static mounts.
* Statistics: Amq -s option.
* Stopping Amd: Stopping Amd.
* Stripping the local domain name: Variable Expansion.
* sublink: Filesystems and Volumes.
* sublink, mount option: sublink Option.
* Supported Platforms: Supported Platforms.
* Symbolic link filesystem: Symbolic Link Filesystem.
* Symbolic link filesystem II: Symbolic Link Filesystem II.
* Symlink if target exists, NFS otherwise: NFS-Link Filesystem.
* symlink, link filesystem type: Symbolic Link Filesystem.
* symlink, linkx filesystem type: Symbolic Link Filesystem II.
* symlink, nfsl filesystem type: NFS-Link Filesystem.
* Synchronizing the map cache: Automount Filesystem.
* syslog: -l Option.
* syslog facility; specifying an alternate: -l Option.
* syslog priorities: -x Option.
* tag Parameter: tag Parameter.
* Tags for Amd configuration file: -T-Option.
* TCP; using with Amq: Amq -T option.
* tfs, filesystem type: Translucent Filesystem.
* The mount system call: opts Option.
* tmpfs, filesystem type: Shared Memory+Swap Filesystem.
* Top level filesystem: Top-level Filesystem.
* toplvl, filesystem type: Top-level Filesystem.
* Translucent Filesystem: Translucent Filesystem.
* true Selector Function: true Selector Function.
* true, boolean mount selector: true Selector Function.
* type, mount option: type Option.
* Types of configuration map: Map Types.
* Types of filesystem: Filesystem Types.
* Types of mount map: Map Types.
* UDP; using with Amq: Amq -U-option.
* UFS: Unix Filesystem.
* ufs, filesystem type: Unix Filesystem.
* umapfs, filesystem type: User ID Mapping Filesystem.
* Union file maps: Union maps.
* Union filesystem: Union Filesystem.
* union, filesystem type: Union Filesystem.
* Unix filesystem: Unix Filesystem.
* Unix namespace: Volume Binding.
* unmount attempt backoff interval: -w Option.
* unmount, mount option: Program Filesystem.
* unmount_on_exit Parameter: unmount_on_exit Parameter.
* Unmounting a filesystem: Amq -u option.
* User filesystems: User Filesystems.
* User ID Mapping Filesystem: User ID Mapping Filesystem.
* User maps, automatic generation: Password maps.
* Using FSinfo: Using FSinfo.
* Using Hlfsd: Using Hlfsd.
* Using syslog to log errors: -l Option.
* Using the password file as a map: Password maps.
* Variable expansion: Variable Expansion.
* verbose, FSinfo command line option: -v FSinfo Option.
* Version information: -v Option.
* Version information at run-time: Amq -v option.
* volname, FSinfo mount option: FSinfo filesystems mount.
* Volume: Filesystems and Volumes.
* Volume binding: Volume Binding.
* Volume names: Volume Naming.
* wait4amd: wait4amd.
* wait4amd2die: wait4amd2die.
* Why Deliver Into the Home Directory?: Why Deliver Into the Home Directory?.
* Wildcards in maps: Key Lookup.
* wire Selector Variable: wire Selector Variable.
* wire, mount selector: wire Selector Variable.
* wire-test: wire-test.
* XFS: Unix Filesystem.
* xfs, filesystem type: Unix Filesystem.
* YP domain name: -y Option.

9684
usr.sbin/amd/doc/am-utils.ps Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
$NetBSD: am-utils.texi,v 1.1.1.5 1999/02/01 18:47:05 christos Exp $
\input texinfo @c -*-texinfo-*-
@c $NetBSD: am-utils.texi,v 1.1.1.6 1999/09/04 22:25:37 christos Exp $
@c
@c Copyright (c) 1997-1999 Erez Zadok
@c Copyright (c) 1989 Jan-Simon Pendry
@ -39,7 +39,7 @@ $NetBSD: am-utils.texi,v 1.1.1.5 1999/02/01 18:47:05 christos Exp $
@c
@c %W% (Berkeley) %G%
@c
@c Id: am-utils.texi,v 1.4 1999/01/10 21:54:24 ezk Exp
@c Id: am-utils.texi,v 1.9 1999/08/16 01:16:33 ezk Exp
@c
@setfilename am-utils.info
@ -716,7 +716,7 @@ features.
@item @b{hppa1.1-hp-hpux10.20}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab n/a @tab no @tab ?
@tab yes @tab yes @tab yes @tab no @tab no @tab ?
@item @b{hppa1.1-hp-hpux9.01}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@ -750,6 +750,10 @@ features.
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
@item @b{i386-pc-bsdi4.0.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
@item @b{i386-pc-solaris2.5.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab yes
@ -786,6 +790,22 @@ features.
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
@item @b{i386-unknown-freebsdelf3.0}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
@item @b{i386-unknown-freebsdelf3.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
@item @b{i386-unknown-freebsdelf3.2}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
@item @b{i386-unknown-freebsdelf4.0}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
@item @b{i386-unknown-netbsd1.2.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
@ -806,6 +826,10 @@ features.
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
@item @b{i386-unknown-netbsd1.4}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
@item @b{i386-unknown-openbsd2.1}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
@ -822,6 +846,10 @@ features.
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
@item @b{i386-unknown-openbsd2.5}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab yes @tab yes @tab ?
@item @b{i486-ncr-sysv4.3.03}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab ? @tab yes @tab yes @tab ?
@ -898,6 +926,10 @@ features.
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab ? @tab yes @tab ? @tab ?
@item @b{powerpc-unknown-linux-gnu}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab n/a @tab yes @tab ?
@item @b{rs6000-ibm-aix3.2}
@c {Config} {Compile} {Amd} {NFS V.3} {Shlib} {Hlfsd}
@tab yes @tab yes @tab yes @tab n/a @tab ? @tab ?
@ -1577,6 +1609,7 @@ These are the selectors currently implemented.
* exists Selector Function::
* false Selector Function::
* netgrp Selector Function::
* netgrpd Selector Function::
* in_network Selector Function::
* true Selector Function::
@end menu
@ -1855,7 +1888,7 @@ evaluates to true. Otherwise it evaluates to false.
Always evaluates to false. @i{ARG} is ignored.
@c ----------------------------------------------------------------
@node netgrp Selector Function, in_network Selector Function, false Selector Function, Selectors
@node netgrp Selector Function, netgrpd Selector Function, false Selector Function, Selectors
@comment node-name, next, previous, up
@subsubsection netgrp Selector Function
@cindex netgrp Selector Function
@ -1864,9 +1897,9 @@ Always evaluates to false. @i{ARG} is ignored.
@cindex Mount selector; netgrp
@cindex Selector; netgrp
If the current host as determined by the value of @code{$@{host@}} is a
member of the netgroup @i{ARG}, this selector evaluates to true.
Otherwise it evaluates to false.
If the current host as determined by the value of @code{$@{host@}}
(e.g., short host name) is a member of the netgroup @i{ARG}, this
selector evaluates to true. Otherwise it evaluates to false.
For example, suppose you have a netgroup @samp{ppp-hosts}, and for
reasons of performance, these have a local @file{/home} partition, while
@ -1879,7 +1912,26 @@ home/* netgrp(ppp-hosts);type:=link;fs:=/local/$@{key@} \
@end example
@c ----------------------------------------------------------------
@node in_network Selector Function, true Selector Function, netgrp Selector Function, Selectors
@node netgrpd Selector Function, in_network Selector Function, netgrp Selector Function, Selectors
@comment node-name, next, previous, up
@subsubsection netgrpd Selector Function
@cindex netgrpd Selector Function
@cindex netgrpd, boolean mount selector
@cindex !netgrpd, boolean mount selector
@cindex Mount selector; netgrpd
@cindex Selector; netgrpd
If the current host as determined by the value of @code{$@{hostd@}} is a
member of the netgroup @i{ARG}, this selector evaluates to true.
Otherwise it evaluates to false.
The @samp{netgrpd} function uses fully-qualified host names
(@code{$@{hostd@}}) to match netgroup names, while the @samp{netgrp}
function (@pxref{netgrp Selector Function}) uses short host names
(@code{$@{host@}}).
@c ----------------------------------------------------------------
@node in_network Selector Function, true Selector Function, netgrpd Selector Function, Selectors
@comment node-name, next, previous, up
@subsubsection in_network Selector Function
@cindex in_network Selector Function
@ -1957,8 +2009,12 @@ This option adds additional options to default options normally
specified in the @samp{/defaults} entry or the defaults of the key entry
being processed (@pxref{opts Option}). Normally when you specify
@samp{opts} in both the @samp{/defaults} and the map entry, the latter
overrides the former completely. But with @samp{addopts} it will
append the options and override any conflicting ones.
overrides the former completely. But with @samp{addopts} it will append
the options and override any conflicting ones.
@samp{addopts} also overrides the value of the @samp{remopts} option
(@pxref{remopts Option}), which unless specified defaults to the value
of @samp{opts}.
Options which start with @samp{no} will override those with the same
name that do not start with @samp{no} and vice verse. Special handling
@ -2113,12 +2169,23 @@ Allow local special devices on this filesystem.
@item dumbtimr
@cindex Mount flags; dumbtimr
(XXX: a dumb timer?)
Turn off the dynamic retransmit timeout estimator. This may be useful
for UDP mounts that exhibit high retry rates, since it is possible that
the dynamically estimated timeout interval is too short.
@item extatt
@cindex Mount flags; extatt
Enable extended attributes in ISO-9660 file systems.
@item fsid
@cindex Mount flags; fsid
Set ID of filesystem.
@item gens
@cindex Mount flags; gens
Enable generations in ISO-9660 file systems. Generations allow you to
see all versions of a given file.
@item grpid
@cindex Mount flags; grpid
Use BSD directory group-id semantics.
@ -2147,7 +2214,9 @@ Turn off the attribute cache.
@item noauto
@cindex Mount flags; noauto
(XXX: No automatic what?)
This option is used by the mount command in @samp{/etc/fstab} or
@samp{/etc/vfstab} and means not to mount this file system when mount -a
is used.
@item nocache
@cindex Mount flags; nocache
@ -2177,6 +2246,11 @@ Don't allow local special devices on this filesystem.
@cindex Mount flags; noint
Do not allow keyboard interrupts for this mount
@item norrip
@cindex Mount flags; norrip
Turn off using of the Rock Ridge Interchange Protocol (RRIP) extensions
to ISO-9660.
@item nosub
@cindex Mount flags; nosub
Disallow mounts beneath this mount.
@ -3301,11 +3375,12 @@ The following option must be specified:
the block special device to be mounted.
@end table
A cdfs entry might be:
Some operating systems will fail to mount read-only CDs unless the
@samp{ro} option is specified. A cdfs entry might be:
@example
cdfs os==sunos4;type:=cdfs;dev:=/dev/sr0 \
os==sunos5;type:=cdfs;dev:=/dev/dsk/c0t6d0s2
os==sunos5;addopts:=ro;type:=cdfs;dev:=/dev/dsk/c0t6d0s2
@end example
@c ----------------------------------------------------------------
@ -6810,6 +6885,7 @@ am-utils, and get installed.
* amd.conf-sample::
* amd2ldif::
* amd2sun::
* automount2amd::
* ctl-amd::
* ctl-hlfsd::
* expn::
@ -6855,7 +6931,7 @@ amd2ldif @i{mapname} @i{base} < @i{amd.mapfile} > @i{mapfile.ldif}
@end example
@c ----------------------------------------------------------------
@node amd2sun, ctl-amd, amd2ldif, Assorted Tools
@node amd2sun, automount2amd, amd2ldif, Assorted Tools
@comment node-name, next, previous, up
@section amd2sun
@pindex amd2sun
@ -6868,7 +6944,57 @@ amd2sun < @i{amd.mapfile} > @i{auto_mapfile}
@end example
@c ----------------------------------------------------------------
@node ctl-amd, ctl-hlfsd, amd2sun, Assorted Tools
@node automount2amd, ctl-amd, amd2sun, Assorted Tools
@comment node-name, next, previous, up
@section automount2amd
@pindex automount2amd
A script to convert old Sun Automounter maps to @i{Amd} maps.
Say you have the Sun automount file @i{auto.foo}, with these two lines:
@example
home earth:/home
moon -ro,intr server:/proj/images
@end example
Running
@example
automount2amd auto.foo > amd.foo
@end example
will produce the @i{Amd} map @i{amd.foo} with this content:
@example
# generated by automount2amd on Sat Aug 14 17:59:32 US/Eastern 1999
/defaults \\
type:=nfs;opts:=rw,grpid,nosuid,utimeout=600
home \
host==earth;type:=link;fs:=/home \\
rhost:=earth;rfs:=/home
moon \
-addopts:=ro,intr \\
host==server;type:=link;fs:=/proj/images \\
rhost:=server;rfs:=/proj/images
@end example
This perl script will use the following @i{/default} entry
@example
type:=nfs;opts:=rw,grpid,nosuid,utimeout=600
@end example
If you wish to override that, define the @b{$DEFAULTS} environment
variable, or modify the script.
If you wish to generate Amd maps using the @i{hostd} (@pxref{hostd
Selector Variable}) @i{Amd} map syntax, then define the environment
variable @b{$DOMAIN} or modify the script.
Note that automount2amd does not understand newer Sun Automount map
syntax, those used by autofs.
@c ----------------------------------------------------------------
@node ctl-amd, ctl-hlfsd, automount2amd, Assorted Tools
@comment node-name, next, previous, up
@section ctl-amd
@pindex ctl-amd
@ -7894,5 +8020,7 @@ All other registered trademarks are owned by their respective owners.
@c LocalWords: moisil FSinfo Libtool Unmounting sublink fileservers NullProc
@c LocalWords: gethostname mount's unmounts linkx remounts unmounting UAs SA's
@c LocalWords: mountpoint mountpoints unescaped UIDs util's overlayed uref EFS
@c LocalWords: serv maxgroups nfsl cachedir copt cfsadmin efs addopts fg
@c LocalWords: nointr
@c LocalWords: serv maxgroups nfsl cachedir copt cfsadmin efs addopts fg ROMs
@c LocalWords: nointr extatt setchapternewpage columnfractions alphaev gnulibc
@c LocalWords: freebsdelf gnuoldld ifhtml defperm nodefperm norrip RRIP rrip
@c LocalWords: noversion attr XXXXXX netgrpd

View File

@ -1,5 +1,5 @@
$NetBSD: hlfsd.ps,v 1.1.1.2 1997/10/26 00:03:50 christos Exp $
%!PS-Adobe-2.0
% $NetBSD: hlfsd.ps,v 1.1.1.3 1999/09/04 22:25:40 christos Exp $
%%Creator: dvips 5.47 Copyright 1986-91 Radical Eye Software
%%Title: hlfsd.dvi
%%Pages: 15 1

View File

@ -1,4 +1,4 @@
$NetBSD: version.texi,v 1.1.1.5 1999/02/01 18:47:09 christos Exp $
@set UPDATED 13 January 1999
@set EDITION 6.0.1s3
@set VERSION 6.0.1s3
@c $NetBSD: version.texi,v 1.1.1.6 1999/09/04 22:25:41 christos Exp $
@set UPDATED 16 August 1999
@set EDITION 6.0.1s11
@set VERSION 6.0.1s11

View File

@ -1,4 +1,4 @@
/* $NetBSD: am_compat.h,v 1.1.1.4 1998/08/08 22:05:25 christos Exp $ */
/* $NetBSD: am_compat.h,v 1.1.1.5 1999/09/04 22:25:00 christos Exp $ */
/*
* am_compat.h:
@ -113,6 +113,16 @@
#if defined(MNT2_CDFS_OPT_RRIP) && !defined(MNTTAB_OPT_RRIP)
# define MNTTAB_OPT_RRIP "rrip"
#endif /* defined(MNT2_CDFS_OPT_RRIP) && !defined(MNTTAB_OPT_RRIP) */
#if defined(MNT2_CDFS_OPT_NORRIP) && !defined(MNTTAB_OPT_NORRIP)
# define MNTTAB_OPT_NORRIP "norrip"
#endif /* defined(MNT2_CDFS_OPT_NORRIP) && !defined(MNTTAB_OPT_NORRIP) */
#if defined(MNT2_CDFS_OPT_GENS) && !defined(MNTTAB_OPT_GENS)
# define MNTTAB_OPT_GENS "gens"
#endif /* defined(MNT2_CDFS_OPT_GENS) && !defined(MNTTAB_OPT_GENS) */
#if defined(MNT2_CDFS_OPT_EXTATT) && !defined(MNTTAB_OPT_EXTATT)
# define MNTTAB_OPT_EXTATT "extatt"
#endif /* defined(MNT2_CDFS_OPT_EXTATT) && !defined(MNTTAB_OPT_EXTATT) */
/*
* Complete MNTTAB_OPT_* options based on MNT2_GEN_OPT_* mount options.

View File

@ -1,24 +1,29 @@
# $NetBSD: mkconf,v 1.1.1.1 1997/07/24 21:20:12 christos Exp $
# $NetBSD: mkconf,v 1.1.1.2 1999/09/04 22:25:00 christos Exp $
# mkconf
# Generate local configuration parameters for amd
#
cat << __EOF
/* Automatically generated file, do not edit! */
/* Define name and version of host machine (eg. solaris2.5.1) */
#define HOST_OS "`uname -s | tr '[A-Z]' '[a-z]'``uname -r`"
/* Define only name of host machine OS (eg. solaris2) */
#define HOST_OS_NAME "`uname -s | tr '[A-Z]' '[a-z]'``uname -r | cut -d. -f 1`"
/* Define only version of host machine (eg. 2.5.1) */
#define HOST_OS_VERSION "`uname -r`"
/* Define the header version of (linux) hosts (eg. 2.2.10) */
#define HOST_HEADER_VERSION "`uname -r`"
/* Define name of host */
#define HOST_NAME "`hostname`"
/* Define user name */
#define USER_NAME "`whoami`"
/* Define configuration date */
#define CONFIG_DATE "`date`"
/* Define name of host */
#define HOST_NAME "`hostname`"
/* Define only version of host machine (eg. 2.5.1) */
#define HOST_OS_VERSION "`uname -r`"
/* Define only name of host machine OS (eg. solaris2) */
#define HOST_OS_NAME "`uname -s | tr '[A-Z]' '[a-z]'``uname -r | cut -d. -f 1`"
#define HOST_OS "`uname -s | tr '[A-Z]' '[a-z]'``uname -r`"
__EOF

View File

@ -1,4 +1,4 @@
/* $NetBSD: mount_fs.c,v 1.1.1.6 1999/02/01 18:45:43 christos Exp $ */
/* $NetBSD: mount_fs.c,v 1.1.1.7 1999/09/04 22:24:56 christos Exp $ */
/*
* Copyright (c) 1997-1999 Erez Zadok
@ -40,7 +40,7 @@
*
* %W% (Berkeley) %G%
*
* Id: mount_fs.c,v 1.3 1999/01/13 23:31:21 ezk Exp
* Id: mount_fs.c,v 1.7 1999/08/22 21:12:33 ezk Exp
*
*/
@ -545,12 +545,16 @@ compute_nfs_args(nfs_args_t *nap, mntent_t *mntp, int genflags, struct sockaddr_
* conf/nfs_prot/nfs_prot_*.h files.
*/
# ifdef USE_UNCONNECTED_NFS_SOCKETS
if (!(nap->flags & MNT2_NFS_OPT_NOCONN)) {
nap->flags |= MNT2_NFS_OPT_NOCONN;
plog(XLOG_WARNING, "noconn option exists, and was turned ON! (May cause NFS hangs on some systems...)");
plog(XLOG_WARNING, "noconn option not specified, and was just turned ON (OS override)! (May cause NFS hangs on some systems...)");
}
# endif /* USE_UNCONNECTED_NFS_SOCKETS */
# ifdef USE_CONNECTED_NFS_SOCKETS
if (nap->flags & MNT2_NFS_OPT_NOCONN) {
nap->flags &= ~MNT2_NFS_OPT_NOCONN;
plog(XLOG_WARNING, "noconn option exists, and was turned OFF! (May cause NFS hangs on some systems...)");
plog(XLOG_WARNING, "noconn option specified, and was just turned OFF (OS override)! (May cause NFS hangs on some systems...)");
}
# endif /* USE_CONNECTED_NFS_SOCKETS */
}
#endif /* MNT2_NFS_OPT_NOCONN */
@ -767,6 +771,13 @@ compute_automounter_nfs_args(nfs_args_t *nap, mntent_t *mntp)
nap->flags |= MNT2_NFS_OPT_ACDIRMIN | MNT2_NFS_OPT_ACDIRMAX;
# endif /* defined(MNT2_NFS_OPT_ACDIRMIN) && defined(MNT2_NFS_OPT_ACDIRMAX) */
#endif /* not MNT2_NFS_OPT_NOAC */
/*
* Provide a slight bit more security by requiring the kernel to use
* reserved ports.
*/
#ifdef MNT2_NFS_OPT_RESVPORT
nap->flags |= MNT2_NFS_OPT_RESVPORT;
#endif /* MNT2_NFS_OPT_RESVPORT */
}
@ -839,7 +850,7 @@ print_nfs_args(const nfs_args_t *nap, u_long nfs_version)
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_FIELD_STRUCT_SOCKADDR_SA_LEN_off
#ifdef HAVE_FIELD_STRUCT_SOCKADDR_SA_LEN
plog(XLOG_DEBUG, "NA->addr.sin_len = \"%d\"", sap->sin_len);
#endif /* HAVE_FIELD_STRUCT_SOCKADDR_SA_LEN */
plog(XLOG_DEBUG, "NA->addr.sin_family = \"%d\"", sap->sin_family);
@ -849,6 +860,10 @@ 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_FIELD_NFS_ARGS_T_NAMLEN
plog(XLOG_DEBUG, "NA->namlen = %d", nap->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 */
@ -885,6 +900,9 @@ print_nfs_args(const nfs_args_t *nap, u_long nfs_version)
plog(XLOG_DEBUG, "NA->rsize = %d", nap->rsize);
plog(XLOG_DEBUG, "NA->wsize = %d", nap->wsize);
#ifdef HAVE_FIELD_NFS_ARGS_T_BSIZE
plog(XLOG_DEBUG, "NA->bsize = %d", nap->bsize);
#endif /* HAVE_FIELD_NFS_ARGS_T_BSIZE */
plog(XLOG_DEBUG, "NA->timeo = %d", nap->timeo);
plog(XLOG_DEBUG, "NA->retrans = %d", nap->retrans);

View File

@ -1,4 +1,4 @@
/* $NetBSD: tranputil.c,v 1.1.1.6 1999/02/01 18:45:49 christos Exp $ */
/* $NetBSD: tranputil.c,v 1.1.1.7 1999/09/04 22:24:59 christos Exp $ */
/*
* Copyright (c) 1997-1999 Erez Zadok
@ -40,7 +40,7 @@
*
* %W% (Berkeley) %G%
*
* Id: transp_sockets.c,v 1.4 1999/01/13 23:31:14 ezk Exp
* Id: transp_sockets.c,v 1.5 1999/08/22 21:12:31 ezk Exp
*
* Socket specific utilities.
* -Erez Zadok <ezk@cs.columbia.edu>
@ -180,21 +180,6 @@ amu_svc_getcaller(SVCXPRT *xprt)
}
/*
* Bind NFS to a reserved port.
*/
static int
bindnfs_port(int so, u_short *nfs_portp)
{
u_short port;
int error = bind_resv_port(so, &port);
if (error == 0)
*nfs_portp = port;
return error;
}
/*
* Create the nfs service for amd
*/
@ -204,7 +189,7 @@ create_nfs_service(int *soNFSp, u_short *nfs_portp, SVCXPRT **nfs_xprtp, void (*
*soNFSp = socket(AF_INET, SOCK_DGRAM, 0);
if (*soNFSp < 0 || bindnfs_port(*soNFSp, nfs_portp) < 0) {
if (*soNFSp < 0 || bind_resv_port(*soNFSp, NULL) < 0) {
plog(XLOG_FATAL, "Can't create privileged nfs port");
return 1;
}
@ -212,6 +197,10 @@ create_nfs_service(int *soNFSp, u_short *nfs_portp, SVCXPRT **nfs_xprtp, void (*
plog(XLOG_FATAL, "cannot create rpc/udp service");
return 2;
}
if ((*nfs_portp = (*nfs_xprtp)->xp_port) >= IPPORT_RESERVED) {
plog(XLOG_FATAL, "Can't create privileged nfs port");
return 1;
}
if (!svc_register(*nfs_xprtp, NFS_PROGRAM, NFS_VERSION, dispatch_fxn, 0)) {
plog(XLOG_FATAL, "unable to register (NFS_PROGRAM, NFS_VERSION, 0)");
return 3;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wire.c,v 1.1.1.4 1999/02/01 18:45:46 christos Exp $ */
/* $NetBSD: wire.c,v 1.1.1.5 1999/09/04 22:24:57 christos Exp $ */
/*
* Copyright (c) 1997-1999 Erez Zadok
@ -40,7 +40,7 @@
*
* %W% (Berkeley) %G%
*
* Id: wire.c,v 1.2 1999/01/10 21:54:39 ezk Exp
* Id: wire.c,v 1.4 1999/08/22 21:12:34 ezk Exp
*
*/
@ -63,6 +63,14 @@
#include <amu.h>
#ifdef HAVE_IFADDRS_H
#include <ifaddrs.h>
#endif /* HAVE_IFADDRS_H */
#ifdef HAVE_IRS_H
# include <irs.h>
#endif /* HAVE_IRS_H */
/*
* List of locally connected networks
*/
@ -80,16 +88,9 @@ static addrlist *localnets = NULL;
# define IFF_LOOPBACK IFF_LOCAL_LOOPBACK
#endif /* defined(IFF_LOCAL_LOOPBACK) && !defined(IFF_LOOPBACK) */
#if defined(HAVE_FIELD_STRUCT_IFREQ_IFR_ADDR) && defined(HAVE_FIELD_STRUCT_SOCKADDR_SA_LEN)
# define SIZE(ifr) (MAX((ifr)->ifr_addr.sa_len, sizeof((ifr)->ifr_addr)) + sizeof(ifr->ifr_name))
#else /* not defined(HAVE_FIELD_STRUCT_IFREQ_IFR_ADDR) && defined(HAVE_FIELD_STRUCT_SOCKADDR_SA_LEN) */
# define SIZE(ifr) sizeof(struct ifreq)
#endif /* not defined(HAVE_FIELD_STRUCT_IFREQ_IFR_ADDR) && defined(HAVE_FIELD_STRUCT_SOCKADDR_SA_LEN) */
#define C(x) ((x) & 0xff)
#define GFBUFLEN 1024
#define clist (ifc.ifc_ifcu.ifcu_req)
#define count (ifc.ifc_len/sizeof(struct ifreq))
#define S2IN(s) (((struct sockaddr_in *)(s))->sin_addr.s_addr)
/* return malloc'ed buffer. caller must free it */
@ -103,7 +104,7 @@ print_wires(void)
int bufcount = 0;
int buf_size = 1024;
buf = malloc(1024);
buf = SALLOC(1024);
if (!buf)
return NULL;
@ -133,107 +134,18 @@ print_wires(void)
}
void
getwire(char **name1, char **number1)
static struct addrlist *
getwire_lookup(u_long address, u_long netmask, int ishost)
{
struct hostent *hp;
struct netent *np;
struct ifconf ifc;
struct ifreq *ifr;
caddr_t cp, cplim;
u_long address, netmask, subnet;
char buf[GFBUFLEN], *s;
int fd = -1;
u_long net;
u_long mask;
u_long subnetshift;
struct addrlist *al;
u_long subnet;
char netNumberBuf[64];
addrlist *al = NULL, *tail = NULL;
#ifndef SIOCGIFFLAGS
/* if cannot get interface flags, return nothing */
plog(XLOG_ERROR, "getwire unable to get interface flags");
localnets = NULL;
return;
#endif /* not SIOCGIFFLAGS */
/*
* Get suitable socket
*/
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
goto out;
/*
* Fill in ifconf details
*/
memset(&buf[0], 0, GFBUFLEN);
ifc.ifc_len = sizeof(buf);
ifc.ifc_buf = buf;
/*
* Get network interface configurations
*/
if (ioctl(fd, SIOCGIFCONF, (caddr_t) & ifc) < 0)
goto out;
/*
* Upper bound on array
*/
cplim = buf + ifc.ifc_len;
/*
* This is some magic to cope with both "traditional" and the
* new 4.4BSD-style struct sockaddrs. The new structure has
* variable length and a size field to support longer addresses.
* AF_LINK is a new definition for 4.4BSD.
*/
/*
* Scan the list looking for a suitable interface
*/
for (cp = buf; cp < cplim; cp += SIZE(ifr)) {
ifr = (struct ifreq *) cp;
if (ifr->ifr_addr.sa_family != AF_INET)
continue;
else
address = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr;
/*
* Get interface flags
*/
if (ioctl(fd, SIOCGIFFLAGS, (caddr_t) ifr) < 0)
continue;
/*
* If the interface is a loopback, or its not running
* then ignore it.
*/
#ifdef IFF_LOOPBACK
if ((ifr->ifr_flags & IFF_LOOPBACK) != 0)
continue;
#endif /* IFF_LOOPBACK */
/*
* Fix for 0.0.0.0 loopback on SunOS 3.X which defines IFF_ROUTE
* instead of IFF_LOOPBACK.
*/
#ifdef IFF_ROUTE
if (ifr->ifr_flags == (IFF_UP|IFF_RUNNING))
continue;
#endif /* IFF_ROUTE */
/* if the interface is not UP or not RUNNING, skip it */
if ((ifr->ifr_flags & IFF_RUNNING) == 0 ||
(ifr->ifr_flags & IFF_UP) == 0)
continue;
/*
* Get the netmask of this interface
*/
if (ioctl(fd, SIOCGIFNETMASK, (caddr_t) ifr) < 0)
continue;
netmask = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr;
char buf[GFBUFLEN], *s;
#ifdef HAVE_IRS_H
struct nwent *np;
#else /* not HAVE_IRS_H */
struct netent *np;
#endif /* not HAVE_IRS_H */
/*
* Add interface to local network singly linked list
@ -244,58 +156,52 @@ getwire(char **name1, char **number1)
al->ip_net_name = NO_SUBNET; /* fill in a bit later */
al->ip_net_num = "0.0.0.0"; /* fill in a bit later */
al->ip_next = NULL;
/* append to the end of the list */
if (!localnets) {
localnets = tail = al;
tail->ip_next = NULL;
} else {
tail->ip_next = al;
tail = al;
subnet = ntohl(address) & ntohl(netmask);
if (ishost)
np = NULL;
else {
#ifdef HAVE_IRS_H
u_long mask = ntohl(netmask);
static struct irs_acc *irs_gen;
static struct irs_nw *irs_nw;
u_long net;
int maskbits;
u_char addr[4];
if (irs_gen == NULL)
irs_gen = irs_gen_acc("");
if (irs_gen && irs_nw == NULL)
irs_nw = (*irs_gen->nw_map)(irs_gen);
net = ntohl(address) & (mask = ntohl(netmask));
addr[0] = (0xFF000000 & net) >> 24;
addr[1] = (0x00FF0000 & net) >> 16;
addr[2] = (0x0000FF00 & net) >> 8;
addr[3] = (0x000000FF & net);
for (maskbits = 32; !(mask & 1); mask >>= 1)
maskbits--;
np = (*irs_nw->byaddr)(irs_nw, addr, maskbits, AF_INET);
#else /* not HAVE_IRS_H */
np = getnetbyaddr(subnet, AF_INET);
/*
* Some systems (IRIX 6.4) cannot getnetbyaddr on networks such as
* "128.59.16.0". Instead, they need to look for the short form of
* the network, "128.59.16". So if the first getnetbyaddr failed, we
* shift the subnet way from zeros and try again.
*/
if (!np) {
u_long short_subnet = subnet;
while(short_subnet && (short_subnet & 0x000000ff) == 0)
short_subnet >>= 8;
np = getnetbyaddr(short_subnet, AF_INET);
if (np)
plog(XLOG_WARNING, "getnetbyaddr failed on 0x%x, suceeded on 0x%x",
(u_int) subnet, (u_int) short_subnet);
}
#endif /* not HAVE_IRS_H */
}
/*
* Figure out the subnet's network address
*/
subnet = address & netmask;
#ifdef IN_CLASSA
subnet = htonl(subnet);
if (IN_CLASSA(subnet)) {
mask = IN_CLASSA_NET;
subnetshift = 8;
} else if (IN_CLASSB(subnet)) {
mask = IN_CLASSB_NET;
subnetshift = 8;
} else {
mask = IN_CLASSC_NET;
subnetshift = 4;
}
/*
* If there are more bits than the standard mask
* would suggest, subnets must be in use.
* Guess at the subnet mask, assuming reasonable
* width subnet fields.
* XXX: Or-in at least 1 byte's worth of 1s to make
* sure the top bits remain set.
*/
while (subnet & ~mask)
mask = (mask >> subnetshift) | 0xff000000;
net = subnet & mask;
while ((mask & 1) == 0)
mask >>= 1, net >>= 1;
/*
* Now get a usable name.
* First use the network database,
* then the host database,
* and finally just make a dotted quad.
*/
np = getnetbyaddr(net, AF_INET);
/* the network address has been masked off */
if ((subnet & 0xffffff) == 0) {
sprintf(netNumberBuf, "%lu", C(subnet >> 24));
} else if ((subnet & 0xffff) == 0) {
@ -314,17 +220,14 @@ getwire(char **name1, char **number1)
/* fill in network number (string) */
al->ip_net_num = strdup(netNumberBuf);
#else /* not IN_CLASSA */
/* This is probably very wrong. */
np = getnetbyaddr(subnet, AF_INET);
#endif /* not IN_CLASSA */
if (np)
if (np != NULL)
s = np->n_name;
else {
struct hostent *hp;
subnet = address & netmask;
hp = gethostbyaddr((char *) &subnet, 4, AF_INET);
if (hp)
if (hp != NULL)
s = (char *) hp->h_name;
else
s = inet_dquad(buf, subnet);
@ -332,18 +235,8 @@ getwire(char **name1, char **number1)
/* fill in network name (string) */
al->ip_net_name = strdup(s);
}
out:
if (fd >= 0)
close(fd);
if (localnets) {
*name1 = localnets->ip_net_name;
*number1 = localnets->ip_net_num;
} else {
*name1 = NO_SUBNET;
*number1 = "0.0.0.0";
}
return (al);
}
@ -404,3 +297,197 @@ is_network_member(const char *net)
return FALSE;
}
#ifdef HAVE_GETIFADDRS
void
getwire(char **name1, char **number1)
{
addrlist *al = NULL, *tail = NULL;
struct ifaddrs *ifaddrs, *ifap;
ifaddrs = NULL;
if (getifaddrs(&ifaddrs) < 0)
goto out;
for (ifap = ifaddrs; ifap != NULL; ifap = ifap->ifa_next) {
if (ifap->ifa_addr->sa_family != AF_INET)
continue;
/*
* If the interface is a loopback, or its not running
* then ignore it.
*/
if ((ifap->ifa_flags & IFF_LOOPBACK) != 0)
continue;
if ((ifap->ifa_flags & IFF_RUNNING) == 0)
continue;
if ((ifap->ifa_flags & IFF_POINTOPOINT) == 0)
al = getwire_lookup(S2IN(ifap->ifa_addr), S2IN(ifap->ifa_netmask), 0);
else
al = getwire_lookup(S2IN(ifap->ifa_dstaddr), 0xffffffff, 1);
/* append to the end of the list */
if (!localnets) {
localnets = tail = al;
tail->ip_next = NULL;
} else {
tail->ip_next = al;
tail = al;
}
}
out:
if (ifaddrs)
XFREE(ifaddrs);
if (localnets) {
*name1 = localnets->ip_net_name;
*number1 = localnets->ip_net_num;
} else {
*name1 = NO_SUBNET;
*number1 = "0.0.0.0";
}
}
#else /* not HAVE_GETIFADDRS */
#if defined(HAVE_FIELD_STRUCT_IFREQ_IFR_ADDR) && defined(HAVE_FIELD_STRUCT_SOCKADDR_SA_LEN)
# define SIZE(ifr) (MAX((ifr)->ifr_addr.sa_len, sizeof((ifr)->ifr_addr)) + sizeof(ifr->ifr_name))
#else /* not defined(HAVE_FIELD_STRUCT_IFREQ_IFR_ADDR) && defined(HAVE_FIELD_STRUCT_SOCKADDR_SA_LEN) */
# define SIZE(ifr) sizeof(struct ifreq)
#endif /* not defined(HAVE_FIELD_STRUCT_IFREQ_IFR_ADDR) && defined(HAVE_FIELD_STRUCT_SOCKADDR_SA_LEN) */
#define clist (ifc.ifc_ifcu.ifcu_req)
#define count (ifc.ifc_len/sizeof(struct ifreq))
void
getwire(char **name1, char **number1)
{
struct ifconf ifc;
struct ifreq *ifr;
caddr_t cp, cplim;
int fd = -1;
u_long address;
addrlist *al = NULL, *tail = NULL;
char buf[GFBUFLEN];
#if 0
u_long net;
u_long mask;
u_long subnetshift;
char buf[GFBUFLEN], *s;
#endif
#ifndef SIOCGIFFLAGS
/* if cannot get interface flags, return nothing */
plog(XLOG_ERROR, "getwire unable to get interface flags");
localnets = NULL;
return;
#endif /* not SIOCGIFFLAGS */
/*
* Get suitable socket
*/
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
goto out;
/*
* Fill in ifconf details
*/
memset(&buf[0], 0, GFBUFLEN);
ifc.ifc_len = sizeof(buf);
ifc.ifc_buf = buf;
/*
* Get network interface configurations
*/
if (ioctl(fd, SIOCGIFCONF, (caddr_t) & ifc) < 0)
goto out;
/*
* Upper bound on array
*/
cplim = buf + ifc.ifc_len;
/*
* This is some magic to cope with both "traditional" and the
* new 4.4BSD-style struct sockaddrs. The new structure has
* variable length and a size field to support longer addresses.
* AF_LINK is a new definition for 4.4BSD.
*/
/*
* Scan the list looking for a suitable interface
*/
for (cp = buf; cp < cplim; cp += SIZE(ifr)) {
ifr = (struct ifreq *) cp;
if (ifr->ifr_addr.sa_family != AF_INET)
continue;
address = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr;
/*
* Get interface flags
*/
if (ioctl(fd, SIOCGIFFLAGS, (caddr_t) ifr) < 0)
continue;
/*
* If the interface is a loopback, or its not running
* then ignore it.
*/
#ifdef IFF_LOOPBACK
if ((ifr->ifr_flags & IFF_LOOPBACK) != 0)
continue;
#endif /* IFF_LOOPBACK */
/*
* Fix for 0.0.0.0 loopback on SunOS 3.X which defines IFF_ROUTE
* instead of IFF_LOOPBACK.
*/
#ifdef IFF_ROUTE
if (ifr->ifr_flags == (IFF_UP|IFF_RUNNING))
continue;
#endif /* IFF_ROUTE */
/* if the interface is not UP or not RUNNING, skip it */
if ((ifr->ifr_flags & IFF_RUNNING) == 0 ||
(ifr->ifr_flags & IFF_UP) == 0)
continue;
if ((ifr->ifr_flags & IFF_POINTOPOINT) == 0) {
/*
* Get the netmask of this interface
*/
if (ioctl(fd, SIOCGIFNETMASK, (caddr_t) ifr) < 0)
continue;
al = getwire_lookup(address, S2IN(&ifr->ifr_addr), 0);
} else
al = getwire_lookup(address, 0xffffffff, 1);
/* append to the end of the list */
if (!localnets) {
localnets = tail = al;
tail->ip_next = NULL;
} else {
tail->ip_next = al;
tail = al;
}
}
out:
if (fd >= 0)
close(fd);
if (localnets) {
*name1 = localnets->ip_net_name;
*number1 = localnets->ip_net_num;
} else {
*name1 = NO_SUBNET;
*number1 = "0.0.0.0";
}
}
#endif /* not HAVE_GETIFADDRS */

View File

@ -1,4 +1,4 @@
/* $NetBSD: pawd.c,v 1.1.1.2 1999/02/01 18:46:57 christos Exp $ */
/* $NetBSD: pawd.c,v 1.1.1.3 1999/09/04 22:25:35 christos Exp $ */
/*
* Copyright (c) 1997-1999 Erez Zadok
@ -40,7 +40,7 @@
*
* %W% (Berkeley) %G%
*
* Id: pawd.c,v 1.3 1999/01/10 21:54:00 ezk Exp
* Id: pawd.c,v 1.4 1999/02/04 07:24:20 ezk Exp
*
*/
@ -60,16 +60,6 @@
#include <am_defs.h>
#include <amq.h>
/* dummy variables */
#if 0
char *progname;
char hostname[MAXHOSTNAMELEN];
pid_t mypid;
serv_state amd_state;
int foreground, orig_umask;
int debug_flags;
#endif
/* statics */
static char *localhost="localhost";
static char newdir[MAXPATHLEN];