Resolve conflicts.

This commit is contained in:
Martin Blapp 2003-09-02 15:42:57 +00:00
parent 6935adfc2f
commit 0974e17d43
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=119682
27 changed files with 437 additions and 1621 deletions

View File

@ -1,5 +1,5 @@
.\"
.\" Copyright (c) 1997-1999 Erez Zadok
.\" Copyright (c) 1997-2003 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,7 @@
.\"
.\" %W% (Berkeley) %G%
.\"
.\" $Id: amd.8,v 1.3 1999/09/30 21:01:29 ezk Exp $
.\" $Id: amd.8,v 1.4.2.4 2003/03/16 01:46:59 ezk Exp $
.\" $FreeBSD$
.\"
.Dd April 19, 1994
@ -183,7 +183,7 @@ Specify the NFS timeout
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
is 0.8 seconds. The second value alters the retransmit 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.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Erez Zadok
* Copyright (c) 1997-2003 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,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: amd.c,v 1.8.2.3 2001/01/10 03:22:59 ezk Exp $
* $Id: amd.c,v 1.8.2.5 2002/12/27 22:44:29 ezk Exp $
* $FreeBSD$
*
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Erez Zadok
* Copyright (c) 1997-2003 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,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: amq_subr.c,v 1.6.2.2 2001/01/12 22:43:42 ro Exp $
* $Id: amq_subr.c,v 1.6.2.4 2002/12/27 22:44:33 ezk Exp $
* $FreeBSD$
*
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Erez Zadok
* Copyright (c) 1997-2003 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,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: get_args.c,v 1.7.2.1 2001/01/10 03:23:05 ezk Exp $
* $Id: get_args.c,v 1.7.2.5 2002/12/27 22:44:34 ezk Exp $
* $FreeBSD$
*
*/
@ -86,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-2001 Erez Zadok",
"Copyright (c) 1997-2003 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.");
@ -128,12 +128,20 @@ 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, "nprvSa:c:d:k:l:o:t:w:x:y:C:D:F:T:O:H")) != -1)
while ((opt_ch = getopt(argc, argv, getopt_args)) != -1)
switch (opt_ch) {
case 'a':

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Erez Zadok
* Copyright (c) 1997-2003 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,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: srvr_nfs.c,v 1.7.2.5 2001/04/14 21:08:23 ezk Exp $
* $Id: srvr_nfs.c,v 1.7.2.10 2002/12/29 01:55:43 ib42 Exp $
* $FreeBSD$
*
*/
@ -412,21 +412,23 @@ 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.
@ -452,6 +454,10 @@ 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)
@ -459,6 +465,12 @@ nfs_timed_out(voidp v)
#endif /* DEBUG */
}
/*
* New RPC xid, so any late responses to the previous ping
* get ignored...
*/
np->np_xid = NPXID_ALLOC(struct );
/*
* Run keepalive again
*/
@ -595,21 +607,22 @@ 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)) {
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 {
if (fs->fs_flags & FSF_PINGING) {
#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);
}
}

View File

@ -1,5 +1,5 @@
.\"
.\" Copyright (c) 1997-1999 Erez Zadok
.\" Copyright (c) 1997-2003 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.
@ -39,6 +39,7 @@
.\" %W% (Berkeley) %G%
.\"
.\" $Id: amq.8,v 1.2 1999/01/10 21:53:58 ezk Exp $
.\" $Id: amq.8,v 1.3.2.7 2002/12/27 22:44:45 ezk Exp $
.\" $FreeBSD$
.\"
.Dd March 16, 1991

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Erez Zadok
* Copyright (c) 1997-2003 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,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: amq.c,v 1.7.2.5 2001/01/12 22:43:43 ro Exp $
* $Id: amq.c,v 1.7.2.8 2002/12/27 22:44:45 ezk Exp $
*
*/
@ -51,13 +51,13 @@ __FBSDID("$FreeBSD$");
#ifndef lint
char copyright[] = "\
@(#)Copyright (c) 1997-2001 Erez Zadok\n\
@(#)Copyright (c) 1997-2003 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.5 2001/01/12 22:43:43 ro Exp $";
static char rcsid[] = "$Id: amq.c,v 1.7.2.8 2002/12/27 22:44:45 ezk Exp $";
static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* __GNUC__ < 2 */
#endif /* not lint */

View File

@ -1,5 +1,5 @@
.\"
.\" Copyright (c) 1997-1999 Erez Zadok
.\" Copyright (c) 1997-2003 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,7 @@
.\"
.\" %W% (Berkeley) %G%
.\"
.\" $Id: pawd.1,v 1.2 1998/09/05 06:56:36 obrien Exp $
.\" $Id: pawd.1,v 1.3.2.3 2002/12/27 22:44:46 ezk Exp $
.\" $FreeBSD$
.\"
.Dd January 6, 1998

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Erez Zadok
* Copyright (c) 1997-2003 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,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: nfs_prot_freebsd2.h,v 1.3.2.1 2001/01/10 03:23:21 ezk Exp $
* $Id: nfs_prot_freebsd2.h,v 1.3.2.3 2002/12/27 22:44:54 ezk Exp $
* $FreeBSD$
*
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Erez Zadok
* Copyright (c) 1997-2003 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,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: nfs_prot_freebsd3.h,v 1.5.2.1 2001/01/10 03:23:22 ezk Exp $
* $Id: nfs_prot_freebsd3.h,v 1.5.2.6 2003/08/27 19:35:16 ib42 Exp $
* $FreeBSD$
*
*/
@ -71,6 +71,11 @@ struct nfs_fh3;
# 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:
*/
@ -96,6 +101,7 @@ struct nfs_fh3;
#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
@ -176,7 +182,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 (aux/macros/struct_nfs_fh3.m4) searches
* listed below. A special macro (m4/macros/struct_nfs_fh3.m4) searches
* for this special name before other names.
*/
struct nfs_fh3_freebsd3 {

View File

@ -1,3 +0,0 @@
@set UPDATED 3 July 2001
@set EDITION 6.0.7
@set VERSION 6.0.7

View File

@ -1,5 +1,5 @@
.\"
.\" Copyright (c) 1997-1999 Erez Zadok
.\" Copyright (c) 1997-2003 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,7 @@
.\"
.\" %W% (Berkeley) %G%
.\"
.\" $Id: fixmount.8,v 1.2 1999/01/10 21:54:26 ezk Exp $
.\" $Id: fixmount.8,v 1.3.2.5 2003/03/16 01:46:59 ezk Exp $
.\" $FreeBSD$
.\"
.Dd February 26, 1993

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Erez Zadok
* Copyright (c) 1997-2003 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,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: fixmount.c,v 1.5.2.1 2001/01/10 03:23:32 ezk Exp $
* $Id: fixmount.c,v 1.5.2.3 2002/12/27 22:45:04 ezk Exp $
* $FreeBSD$
*
*/

View File

@ -1,5 +1,5 @@
.\"
.\" Copyright (c) 1997-1999 Erez Zadok
.\" Copyright (c) 1997-2003 Erez Zadok
.\" Copyright (c) 1993 Jan-Simon Pendry.
.\" Copyright (c) 1993
.\" The Regents of the University of California. All rights reserved.
@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)fsinfo.8 8.1 (Berkeley) 6/28/93
.\" $Id: fsinfo.8,v 1.2 1999/01/10 21:54:28 ezk Exp $
.\" $Id: fsinfo.8,v 1.3.2.4 2003/03/31 20:09:02 ezk Exp $
.\" $FreeBSD$
.\"
.Dd June 26, 1999
@ -63,9 +63,10 @@
The
.Nm
utility takes a set of system configuration information, and generates
a co-ordinated set of
.Xr amd ,
.Xr mount
a coordinated set of
.I amd
,
.I mount
and
.Xr mountd
configuration files.

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 1997-1999 Erez Zadok
* Copyright (c) 1997-2003 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 +39,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: fsinfo.c,v 1.4 1999/02/04 07:24:44 ezk Exp $
* $Id: fsinfo.c,v 1.5.2.5 2003/07/18 04:50:20 ezk Exp $
* $FreeBSD$
*
*/
@ -185,9 +186,9 @@ Usage: %s [-v] [-a autodir] [-h hostname] [-b bootparams] [-d dumpsets]\n\
}
if (g_argv[0])
log("g_argv[0] = %s", g_argv[0]);
fsi_log("g_argv[0] = %s", g_argv[0]);
else
log("g_argv[0] = (nil)");
fsi_log("g_argv[0] = (nil)");
}

View File

@ -1,5 +1,5 @@
.\"
.\" Copyright (c) 1997-1999 Erez Zadok
.\" Copyright (c) 1997-2003 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,7 +36,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id: hlfsd.8,v 1.2 1999/01/10 21:54:32 ezk Exp $
.\" $Id: hlfsd.8,v 1.3.2.4 2003/03/16 01:47:00 ezk Exp $
.\" $FreeBSD$
.\"
.\" HLFSD was written at Columbia University Computer Science Department, by
@ -232,7 +232,7 @@ Force
.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 misdelivery of mail. The option is ignored on systems that can turn
or mis-delivery of mail. The option is ignored on systems that can turn
off the attribute-cache.
.It Fl D Ar log-options
Select from a variety of debugging options. Prefixing an

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Erez Zadok
* Copyright (c) 1997-2003 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,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: hlfsd.c,v 1.7.2.2 2001/01/10 03:23:35 ezk Exp $
* $Id: hlfsd.c,v 1.7.2.7 2002/12/27 22:45:08 ezk Exp $
* $FreeBSD$
*
* HLFSD was written at Columbia University Computer Science Department, by
@ -264,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_FIELD_NFS_ARGS_T_ACREGMIN)
#if !defined(MNT2_NFS_OPT_ACREGMIN) && !defined(MNT2_NFS_OPT_NOAC) && !defined(HAVE_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_FIELD_NFS_ARGS_T_ACREGMIN) */
#endif /* !defined(MNT2_NFS_OPT_ACREGMIN) && !defined(MNT2_NFS_OPT_NOAC) && !defined(HAVE_NFS_ARGS_T_ACREGMIN) */
switch (argc - optind) {
@ -421,7 +421,7 @@ main(int argc, char *argv[])
#ifdef HAVE_SIGACTION
sa.sa_handler = proceed;
sa.sa_flags = 0;
sa.sa_flags = SA_RESTART;
sigemptyset(&(sa.sa_mask));
sigaddset(&(sa.sa_mask), SIGUSR2);
sigaction(SIGUSR2, &sa, NULL);
@ -434,7 +434,7 @@ main(int argc, char *argv[])
#ifdef HAVE_SIGACTION
sa.sa_handler = reaper;
sa.sa_flags = 0;
sa.sa_flags = SA_RESTART;
sigemptyset(&(sa.sa_mask));
sigaddset(&(sa.sa_mask), SIGCHLD);
sigaction(SIGCHLD, &sa, NULL);
@ -686,7 +686,7 @@ hlfsd_init(void)
*/
#ifdef HAVE_SIGACTION
sa.sa_handler = reload;
sa.sa_flags = 0;
sa.sa_flags = SA_RESTART;
sigemptyset(&(sa.sa_mask));
sigaddset(&(sa.sa_mask), SIGALRM);
sigaddset(&(sa.sa_mask), SIGHUP);
@ -702,7 +702,7 @@ hlfsd_init(void)
*/
#ifdef HAVE_SIGACTION
sa.sa_handler = cleanup;
sa.sa_flags = 0;
sa.sa_flags = SA_RESTART;
sigemptyset(&(sa.sa_mask));
sigaddset(&(sa.sa_mask), SIGTERM);
sigaction(SIGTERM, &sa, NULL);
@ -715,7 +715,7 @@ hlfsd_init(void)
*/
#ifdef HAVE_SIGACTION
sa.sa_handler = interlock;
sa.sa_flags = 0;
sa.sa_flags = SA_RESTART;
sigemptyset(&(sa.sa_mask));
sigaddset(&(sa.sa_mask), SIGCHLD);
sigaction(SIGCHLD, &sa, NULL);
@ -732,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 = 0;
sa.sa_flags = SA_RESTART;
sigemptyset(&(sa.sa_mask));
sigaddset(&(sa.sa_mask), SIGUSR1);
sigaction(SIGUSR1, &sa, NULL);
@ -851,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 (;;) {
@ -935,17 +935,8 @@ fatal(char *mess)
strcpy(lessmess, mess);
lessmess[messlen - 4] = '\0';
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);
fprintf(stderr, "%s: %s: %s\n",
am_get_progname(), lessmess, strerror(errno));
}
}
plog(XLOG_FATAL, "%s", mess);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Erez Zadok
* Copyright (c) 1997-2003 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,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: hlfsd.h,v 1.4.2.2 2001/01/12 22:47:21 ro Exp $
* $Id: hlfsd.h,v 1.4.2.6 2002/12/27 22:45:08 ezk Exp $
* $FreeBSD$
*
* HLFSD was written at Columbia University Computer Science Department, by
@ -53,7 +53,7 @@
* MACROS AND CONSTANTS:
*/
#define HLFSD_VERSION "hlfsd 1.1 (1993-2001)"
#define HLFSD_VERSION "hlfsd 1.2 (1993-2002)"
#define PERS_SPOOLMODE 0755
#define OPEN_SPOOLMODE 01777
#define DOTSTRING "."
@ -139,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);
extern char *homedir(int, int);
extern char *mailbox(int, char *);
extern char *passwdfile;
extern char *slinkname;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Erez Zadok
* Copyright (c) 1997-2003 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,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: homedir.c,v 1.5.2.1 2001/01/10 03:23:36 ezk Exp $
* $Id: homedir.c,v 1.5.2.10 2002/12/27 22:45:08 ezk Exp $
* $FreeBSD$
*
* HLFSD was written at Columbia University Computer Science Department, by
@ -68,34 +68,31 @@ 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)
homedir(int userid, int groupid)
{
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 */
}
@ -105,7 +102,10 @@ homedir(int userid)
found->last_status = 1;
return alt_spooldir; /* use alt spool for / or rel. home */
}
sprintf(linkval, "%s/%s", homename, home_subdir);
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);
if (noverify) {
found->last_status = 0;
@ -114,9 +114,9 @@ homedir(int userid)
/*
* To optimize hlfsd, we don't actually check the validity of the
* symlink if it has been in checked in the last N seconds. It is
* symlink if it has been 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 ls large, that may not be
* valid, as long as N is small. But if N is 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,
@ -144,13 +144,33 @@ homedir(int userid)
amuDebug(D_FORK) {
#endif /* DEBUG */
/* fork child to process request if none in progress */
if (found->child && kill(found->child, 0))
if (found->child && kill(found->child, 0) < 0)
found->child = 0;
if (found->child)
delay(found, 5); /* wait a bit if in progress */
if (found->child) { /* better safe than sorry - maybe */
found->last_status = 1;
#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 */
return alt_spooldir;
}
if ((found->child = fork()) < 0) {
@ -184,21 +204,28 @@ homedir(int userid)
*
*/
am_set_mypid(); /* for logging routines */
if (seteuid(userid) < 0) {
if ((old_groupid = setgid(groupid)) < 0) {
plog(XLOG_WARNING, "could not setgid to %d: %m", groupid);
return linkval;
}
if ((old_userid = 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(0);
seteuid(old_userid);
setgid(old_groupid);
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(0);
seteuid(old_userid);
setgid(old_groupid);
plog(XLOG_WARNING, "bad link to %s: %m", linkval);
return alt_spooldir;
}
@ -213,11 +240,13 @@ homedir(int userid)
* We are still seteuid to the user at this point.
*/
if (hlfsd_diskspace(linkval) < 0) {
seteuid(0);
seteuid(old_userid);
setgid(old_groupid);
plog(XLOG_WARNING, "no more space in %s: %m", linkval);
return alt_spooldir;
} else {
seteuid(0);
seteuid(old_userid);
setgid(old_groupid);
return linkval;
}
}
@ -295,30 +324,55 @@ 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);
lostchild->child = 0;
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;
break;
}
}
if (!found)
plog(XLOG_ERROR, "no record of child %d found???", child);
}
}
}
@ -411,7 +465,6 @@ 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;
@ -560,6 +613,18 @@ 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();
@ -568,6 +633,9 @@ 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");
}
@ -610,6 +678,9 @@ plt_reset(void)
}
cur_pwtab_num = 0; /* zero current size */
if (root_home)
XFREE(root_home);
return 0; /* resetting ok */
}
@ -735,7 +806,7 @@ plt_print(int signum)
#else /* not HAVE_MKSTEMP */
mktemp(dumptmp);
if (!dumptmp) {
plot(XLOG_ERROR, "cannot create temporary dump file");
plog(XLOG_ERROR, "cannot create temporary dump file");
return;
}
dumpfd = open(dumptmp, O_RDONLY);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Erez Zadok
* Copyright (c) 1997-2003 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,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: am_defs.h,v 1.15.2.9 2001/04/07 00:47:44 ib42 Exp $
* $Id: am_defs.h,v 1.15.2.13 2002/12/27 22:45:09 ezk Exp $
* $FreeBSD$
*
*/
@ -595,24 +595,6 @@ struct ypall_callback;
# include <linux/auto_fs.h>
#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:
*/
@ -1413,6 +1395,10 @@ 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 */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Erez Zadok
* Copyright (c) 1997-2003 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,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: mount_fs.c,v 1.11.2.5 2001/04/14 21:08:25 ezk Exp $
* $Id: mount_fs.c,v 1.11.2.11 2003/05/08 17:57:53 ib42 Exp $
* $FreeBSD$
*
*/
@ -106,13 +106,10 @@ struct opt_tab mnt_flags[] =
{MNTTAB_OPT_OVERLAY, MNT2_GEN_OPT_OVERLAY},
#endif /* defined(MNT2_GEN_OPT_OVERLAY) && defined(MNTTAB_OPT_OVERLAY) */
#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) */
/*
* Do not define MNT2_NFS_OPT_* entries here! This is for generic
* mount(2) options only, not for NFS mount options.
*/
{0, 0}
};
@ -123,27 +120,14 @@ int
compute_mount_flags(mntent_t *mntp)
{
struct opt_tab *opt;
int flags;
int flags = 0;
/* start: this must come first */
#ifdef MNT2_GEN_OPT_NEWTYPE
flags = MNT2_GEN_OPT_NEWTYPE;
#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) */
#endif /* MNT2_GEN_OPT_NEWTYPE */
#ifdef MNT2_GEN_OPT_AUTOMOUNTED
flags |= MNT2_GEN_OPT_AUTOMOUNTED;
#endif /* not MNT2_GEN_OPT_AUTOMOUNTED */
/*
* Crack basic mount options
@ -301,25 +285,25 @@ mount_fs(mntent_t *mnt, int flags, caddr_t mnt_data, int retry, MTYPE_TYPE type,
* Additional fields in mntent_t
* are fixed up here
*/
# ifdef HAVE_FIELD_MNTENT_T_MNT_CNODE
# ifdef HAVE_MNTENT_T_MNT_CNODE
mnt->mnt_cnode = 0;
# endif /* HAVE_FIELD_MNTENT_T_MNT_CNODE */
# endif /* HAVE_MNTENT_T_MNT_CNODE */
# ifdef HAVE_FIELD_MNTENT_T_MNT_RO
# ifdef HAVE_MNTENT_T_MNT_RO
mnt->mnt_ro = (hasmntopt(mnt, MNTTAB_OPT_RO) != NULL);
# endif /* HAVE_FIELD_MNTENT_T_MNT_RO */
# endif /* HAVE_MNTENT_T_MNT_RO */
# ifdef HAVE_FIELD_MNTENT_T_MNT_TIME
# ifdef HAVE_FIELD_MNTENT_T_MNT_TIME_STRING
# ifdef HAVE_MNTENT_T_MNT_TIME
# ifdef HAVE_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_FIELD_MNTENT_T_MNT_TIME_STRING */
# else /* not HAVE_MNTENT_T_MNT_TIME_STRING */
mnt->mnt_time = time((time_t *) NULL);
# endif /* not HAVE_FIELD_MNTENT_T_MNT_TIME_STRING */
# endif /* HAVE_FIELD_MNTENT_T_MNT_TIME */
# endif /* not HAVE_MNTENT_T_MNT_TIME_STRING */
# endif /* HAVE_MNTENT_T_MNT_TIME */
write_mntent(mnt, mnttabname);
@ -375,7 +359,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_FIELD_NFS_ARGS_T_FHSIZE) || defined(HAVE_FIELD_NFS_ARGS_T_FH_LEN)
# if defined(HAVE_NFS_ARGS_T_FHSIZE) || defined(HAVE_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
@ -383,9 +367,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_FIELD_NFS_ARGS_T_FHSIZE) || defined(HAVE_FIELD_NFS_ARGS_T_FH_LEN) */
# else /* not defined(HAVE_NFS_ARGS_T_FHSIZE) || defined(HAVE_NFS_ARGS_T_FH_LEN) */
NFS_FH_DREF(nap->NFS_FH_FIELD, &fh3);
# endif /* not defined(HAVE_FIELD_NFS_ARGS_T_FHSIZE) || defined(HAVE_FIELD_NFS_ARGS_T_FH_LEN) */
# endif /* not defined(HAVE_NFS_ARGS_T_FHSIZE) || defined(HAVE_NFS_ARGS_T_FH_LEN) */
# ifdef MNT2_NFS_OPT_NFSV3
nap->flags |= MNT2_NFS_OPT_NFSV3;
# endif /* MNT2_NFS_OPT_NFSV3 */
@ -396,24 +380,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_FIELD_NFS_ARGS_T_FHSIZE
#ifdef HAVE_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_FIELD_NFS_ARGS_T_FHSIZE */
#endif /* HAVE_NFS_ARGS_T_FHSIZE */
/* this is the version of the nfs_args structure, not of NFS! */
#ifdef HAVE_FIELD_NFS_ARGS_T_FH_LEN
#ifdef HAVE_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_FIELD_NFS_ARGS_T_FH_LEN */
#endif /* HAVE_NFS_ARGS_T_FH_LEN */
/************************************************************************/
/*** HOST NAME ***/
@ -441,14 +425,14 @@ compute_nfs_args(nfs_args_t *nap, mntent_t *mntp, int genflags, struct sockaddr_
#endif /* MNTTAB_OPT_ACTIMEO */
if (acval) {
#ifdef HAVE_FIELD_NFS_ARGS_T_ACREGMIN
#ifdef HAVE_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_FIELD_NFS_ARGS_T_ACREGMIN */
#ifdef HAVE_FIELD_NFS_ARGS_T_ACDIRMIN
#endif /* HAVE_NFS_ARGS_T_ACREGMIN */
#ifdef HAVE_NFS_ARGS_T_ACDIRMIN
nap->acdirmin = acval; /* min ac timeout for dirs (sec) */
nap->acdirmax = acval; /* max ac timeout for dirs (sec) */
#endif /* HAVE_FIELD_NFS_ARGS_T_ACDIRMIN */
#endif /* HAVE_NFS_ARGS_T_ACDIRMIN */
} else {
#ifdef MNTTAB_OPT_ACREGMIN
nap->acregmin = hasmntval(mntp, MNTTAB_OPT_ACREGMIN);
@ -504,7 +488,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_FIELD_NFS_ARGS_T_SOTYPE
#ifdef HAVE_NFS_ARGS_T_SOTYPE
/* bsdi3 uses this */
if (nfs_proto) {
if (STREQ(nfs_proto, "tcp"))
@ -512,9 +496,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_FIELD_NFS_ARGS_T_SOTYPE */
#endif /* HAVE_NFS_ARGS_T_SOTYPE */
#ifdef HAVE_FIELD_NFS_ARGS_T_PROTO
#ifdef HAVE_NFS_ARGS_T_PROTO
nap->proto = 0; /* bsdi3 sets this field to zero */
# ifdef IPPROTO_TCP
if (nfs_proto) {
@ -524,16 +508,16 @@ compute_nfs_args(nfs_args_t *nap, mntent_t *mntp, int genflags, struct sockaddr_
nap->proto = IPPROTO_UDP;
}
# endif /* IPPROTO_TCP */
#endif /* HAVE_FIELD_NFS_ARGS_T_SOTYPE */
#endif /* HAVE_NFS_ARGS_T_SOTYPE */
#ifdef HAVE_FIELD_NFS_ARGS_T_VERSION
#ifdef HAVE_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_FIELD_NFS_ARGS_VERSION */
#endif /* HAVE_NFS_ARGS_VERSION */
/************************************************************************/
/*** OTHER NFS SOCKET RELATED OPTIONS AND FLAGS ***/
@ -715,18 +699,23 @@ 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) */
#ifdef HAVE_FIELD_NFS_ARGS_T_OPTSTR
#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
nap->optstr = mntp->mnt_opts;
#endif /* HAVE_FIELD_NFS_ARGS_T_OPTSTR */
#endif /* HAVE_NFS_ARGS_T_OPTSTR */
/************************************************************************/
/*** FINAL ACTIONS ***/
/************************************************************************/
#ifdef HAVE_FIELD_NFS_ARGS_T_GFS_FLAGS
#ifdef HAVE_NFS_ARGS_T_GFS_FLAGS
/* Ultrix stores generic flags in nfs_args.gfs_flags. */
nap->gfs_flags = genflags;
#endif /* HAVE_FIELD_NFS_ARGS_T_FLAGS */
#endif /* HAVE_NFS_ARGS_T_FLAGS */
return; /* end of compute_nfs_args() function */
}
@ -864,19 +853,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", (unsigned long) kncp->knc_semantics);
plog(XLOG_DEBUG, "NA->knconf->semantics %lu", (u_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", kncp->knc_rdev);
plog(XLOG_DEBUG, "NA->knconf->rdev %lu", (u_long) 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_FIELD_STRUCT_SOCKADDR_SA_LEN
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
plog(XLOG_DEBUG, "NA->addr.sin_len = \"%d\"", sap->sin_len);
#endif /* HAVE_FIELD_STRUCT_SOCKADDR_SA_LEN */
#endif /* HAVE_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\"",
@ -884,22 +873,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_FIELD_NFS_ARGS_T_NAMLEN
#ifdef HAVE_NFS_ARGS_T_NAMLEN
plog(XLOG_DEBUG, "NA->namlen = %d", nap->namlen);
#endif /* HAVE_FIELD_NFS_ARGS_T_NAMLEN */
#endif /* HAVE_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_FIELD_NFS_ARGS_T_FHSIZE
#ifdef HAVE_NFS_ARGS_T_FHSIZE
plog(XLOG_DEBUG, "NA->fhsize = %d", nap->fhsize);
fhlen = nap->fhsize;
#endif /* HAVE_FIELD_NFS_ARGS_T_FHSIZE */
#ifdef HAVE_FIELD_NFS_ARGS_T_FH_LEN
#endif /* HAVE_NFS_ARGS_T_FHSIZE */
#ifdef HAVE_NFS_ARGS_T_FH_LEN
plog(XLOG_DEBUG, "NA->fh_len = %d", nap->fh_len);
fhlen = nap->fh_len;
#endif /* HAVE_FIELD_NFS_ARGS_T_FH_LEN */
#endif /* HAVE_NFS_ARGS_T_FH_LEN */
/*
* XXX: need to figure out how to correctly print file handles,
@ -910,32 +899,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_FIELD_NFS_ARGS_T_SOTYPE
#ifdef HAVE_NFS_ARGS_T_SOTYPE
plog(XLOG_DEBUG, "NA->sotype = %d", nap->sotype);
#endif /* HAVE_FIELD_NFS_ARGS_T_SOTYPE */
#ifdef HAVE_FIELD_NFS_ARGS_T_PROTO
#endif /* HAVE_NFS_ARGS_T_SOTYPE */
#ifdef HAVE_NFS_ARGS_T_PROTO
plog(XLOG_DEBUG, "NA->proto = %d", (int) nap->proto);
#endif /* HAVE_FIELD_NFS_ARGS_T_PROTO */
#ifdef HAVE_FIELD_NFS_ARGS_T_VERSION
#endif /* HAVE_NFS_ARGS_T_PROTO */
#ifdef HAVE_NFS_ARGS_T_VERSION
plog(XLOG_DEBUG, "NA->version = %d", nap->version);
#endif /* HAVE_FIELD_NFS_ARGS_T_VERSION */
#endif /* HAVE_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_FIELD_NFS_ARGS_T_BSIZE
#ifdef HAVE_NFS_ARGS_T_BSIZE
plog(XLOG_DEBUG, "NA->bsize = %d", nap->bsize);
#endif /* HAVE_FIELD_NFS_ARGS_T_BSIZE */
#endif /* HAVE_NFS_ARGS_T_BSIZE */
plog(XLOG_DEBUG, "NA->timeo = %d", (int) nap->timeo);
plog(XLOG_DEBUG, "NA->retrans = %d", (int) nap->retrans);
#ifdef HAVE_FIELD_NFS_ARGS_T_ACREGMIN
#ifdef HAVE_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_FIELD_NFS_ARGS_T_ACREGMIN */
#endif /* HAVE_NFS_ARGS_T_ACREGMIN */
#ifdef MNTTAB_OPT_SYMTTL
plog(XLOG_DEBUG, "NA->symttl = %d", nap->symttl);
#endif /* MNTTAB_OPT_SYMTTL */

View File

@ -1,5 +1,5 @@
.\"
.\" Copyright (c) 1997-1999 Erez Zadok
.\" Copyright (c) 1997-2003 Erez Zadok
.\" Copyright (c) 1993 Jan-Simon Pendry
.\" Copyright (c) 1993
.\" The Regents of the University of California. All rights reserved.
@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)mk-amd-map.8 8.1 (Berkeley) 6/28/93
.\" $Id: mk-amd-map.8,v 1.2 1999/01/10 21:54:41 ezk Exp $
.\" $Id: mk-amd-map.8,v 1.3.2.3 2002/12/27 22:45:15 ezk Exp $
.\" $FreeBSD$
.\"
.Dd June 28, 1993

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Erez Zadok
* Copyright (c) 1997-2003 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,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: mk-amd-map.c,v 1.5.2.1 2001/01/10 03:23:42 ezk Exp $
* $Id: mk-amd-map.c,v 1.5.2.5 2003/06/09 16:57:46 ezk Exp $
* $FreeBSD$
*/
@ -287,7 +287,22 @@ 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
@ -307,7 +322,7 @@ main(int argc, char *argv[])
}
#endif /* not HAVE_DB_SUFFIX */
db = dbm_open(maptmp, O_RDWR|O_CREAT, 0444);
db = dbm_open(maptmp, O_RDWR|O_CREAT|O_EXCL, 0444);
if (!db) {
fprintf(stderr, "cannot initialize temporary database: %s", maptmp);
exit(1);

View File

@ -1,5 +1,5 @@
.\"
.\" Copyright (c) 1997-1999 Erez Zadok
.\" Copyright (c) 1997-2003 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,7 @@
.\"
.\" %W% (Berkeley) %G%
.\"
.\" $Id: amd.conf.5,v 1.3 1999/03/30 17:23:08 ezk Exp $
.\" $Id: amd.conf.5,v 1.7.2.8 2003/03/16 01:47:00 ezk Exp $
.\" $FreeBSD$
.\"
.Dd April 7, 1997
@ -121,86 +121,56 @@ then amd's top-level mount points will be browsable to
calls. This means you could run for example
.Xr ls 1
and see what keys are available to mount in that directory. Not all entries
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
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)"
Allows you to override the value of the
.Va arch
.Nm amd
@ -450,49 +420,95 @@ Specifies the retransmit counter's value in tenths of seconds.
(numeric, default=8)
.Xc
Same as the
.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
.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)"
Same as the
.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
.I retransmit
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)"
Same as the
.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
.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)"
Same as the
.Fl O
option to
.Nm amd .
Allows you to override the compiled-in name of the operating
.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)"
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)"
Same as the
.B \-O
option to 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
.Dq sunos5 ,

View File

@ -1,5 +1,5 @@
.\"
.\" Copyright (c) 1997-1999 Erez Zadok
.\" Copyright (c) 1997-2003 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,7 @@
.\"
.\" %W% (Berkeley) %G%
.\"
.\" $Id: wire-test.8,v 1.2 1999/01/10 21:54:44 ezk Exp $
.\" $Id: wire-test.8,v 1.3.2.4 2002/12/27 22:45:16 ezk Exp $
.\" $FreeBSD$
.\"
.Dd February 26, 1993

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Erez Zadok
* Copyright (c) 1997-2003 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,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: wire-test.c,v 1.5.2.1 2001/01/10 03:23:43 ezk Exp $
* $Id: wire-test.c,v 1.5.2.3 2002/12/27 22:45:16 ezk Exp $
* $FreeBSD$
*
*/