summaryrefslogtreecommitdiffstats
path: root/contrib/amd/amd
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/amd/amd')
-rw-r--r--contrib/amd/amd/amd.85
-rw-r--r--contrib/amd/amd/amd.c20
-rw-r--r--contrib/amd/amd/amq_subr.c23
-rw-r--r--contrib/amd/amd/get_args.c7
-rw-r--r--contrib/amd/amd/srvr_nfs.c21
5 files changed, 28 insertions, 48 deletions
diff --git a/contrib/amd/amd/amd.8 b/contrib/amd/amd/amd.8
index 5e5e5eb..32ffb2c 100644
--- a/contrib/amd/amd/amd.8
+++ b/contrib/amd/amd/amd.8
@@ -1,5 +1,5 @@
.\"
-.\" Copyright (c) 1997-1998 Erez Zadok
+.\" Copyright (c) 1997-1999 Erez Zadok
.\" Copyright (c) 1989 Jan-Simon Pendry
.\" Copyright (c) 1989 Imperial College of Science, Technology & Medicine
.\" Copyright (c) 1989 The Regents of the University of California.
@@ -38,7 +38,8 @@
.\"
.\" %W% (Berkeley) %G%
.\"
-.\" $Id: amd.8,v 1.2 1998/09/05 05:52:24 obrien Exp $
+.\" $Id: amd.8,v 1.2 1999/01/10 21:53:40 ezk Exp $
+.\" $FreeBSD$
.\"
.Dd April 19, 1994
.Dt AMD 8
diff --git a/contrib/amd/amd/amd.c b/contrib/amd/amd/amd.c
index 6f6a03d..191a5e1 100644
--- a/contrib/amd/amd/amd.c
+++ b/contrib/amd/amd/amd.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997-1998 Erez Zadok
+ * Copyright (c) 1997-1999 Erez Zadok
* Copyright (c) 1989 Jan-Simon Pendry
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
* Copyright (c) 1989 The Regents of the University of California.
@@ -38,7 +38,8 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amd.c,v 1.3 1998/11/14 03:13:19 obrien Exp $
+ * $Id: amd.c,v 1.5 1999/02/04 07:24:14 ezk Exp $
+ * $FreeBSD$
*
*/
@@ -55,13 +56,7 @@
struct amu_global_options gopt; /* where global options are stored */
char pid_fsname[16 + MAXHOSTNAMELEN]; /* "kiska.southseas.nz:(pid%d)" */
-#if 0
-char *progname; /* "amd" */
-#endif
char *hostdomain = "unknown.domain";
-#if 0
-char hostname[MAXHOSTNAMELEN + 1] = "localhost"; /* Hostname */
-#endif
char hostd[2 * MAXHOSTNAMELEN + 1]; /* Host+domain */
char *endian = ARCH_ENDIAN; /* Big or Little endian */
char *cpu = HOST_CPU; /* CPU type */
@@ -73,11 +68,6 @@ int orig_umask = 022;
int select_intr_valid;
jmp_buf select_intr;
-#if 0
-pid_t mypid; /* Current process id */
-serv_state amd_state;
-int foreground = 1; /* This is the top-level server */
-#endif
struct amd_stats amd_stats; /* Server statistics */
struct in_addr myipaddr; /* (An) IP address of this host */
time_t do_mapc_reload = 0; /* mapc_reload() call required? */
@@ -490,7 +480,7 @@ main(int argc, char *argv[])
* can mount the automounter.
*/
amu_get_myaddress(&myipaddr);
- plog(XLOG_INFO, "My ip addr is 0x%x", htonl(myipaddr.s_addr));
+ plog(XLOG_INFO, "My ip addr is %s", inet_ntoa(myipaddr));
/* avoid hanging on other NFS servers if started elsewhere */
if (chdir("/") < 0)
@@ -500,7 +490,7 @@ main(int argc, char *argv[])
* Now check we are root.
*/
if (geteuid() != 0) {
- plog(XLOG_FATAL, "Must be root to mount filesystems (euid = %d)", geteuid());
+ plog(XLOG_FATAL, "Must be root to mount filesystems (euid = %ld)", (long) geteuid());
going_down(1);
}
diff --git a/contrib/amd/amd/amq_subr.c b/contrib/amd/amd/amq_subr.c
index 69869fb..4fb0541 100644
--- a/contrib/amd/amd/amq_subr.c
+++ b/contrib/amd/amd/amq_subr.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997-1998 Erez Zadok
+ * Copyright (c) 1997-1999 Erez Zadok
* Copyright (c) 1990 Jan-Simon Pendry
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
* Copyright (c) 1990 The Regents of the University of California.
@@ -38,7 +38,8 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amq_subr.c,v 1.3 1999/01/13 20:03:54 obrien Exp $
+ * $Id: amq_subr.c,v 1.5 1999/08/24 21:31:06 ezk Exp $
+ * $FreeBSD$
*
*/
/*
@@ -187,7 +188,7 @@ ok_security(struct svc_req *rqstp)
return(0); /* assume security is therefore not OK */
}
- if (ntohs(sin->sin_port) >= 1024 ||
+ if (ntohs(sin->sin_port) >= IPPORT_RESERVED ||
!(sin->sin_addr.s_addr == htonl(0x7f000001) ||
sin->sin_addr.s_addr == myipaddr.s_addr)) {
char dq[20];
@@ -253,21 +254,7 @@ amqproc_mount_1_svc(voidp argp, struct svc_req *rqstp)
return 0;
return &rc;
}
-
-#else /* not ENABLE_AMQ_MOUNT */
-
-int *
-amqproc_mount_1_svc(voidp argp, struct svc_req *rqstp)
-{
- static int rc;
- char *s = *(amq_string *) argp;
-
- plog(XLOG_ERROR, "amq requested mount of %s, but code is disabled", s);
-
- rc = EINVAL;
- return &rc;
-}
-#endif /* not ENABLE_AMQ_MOUNT */
+#endif /* ENABLE_AMQ_MOUNT */
amq_string *
diff --git a/contrib/amd/amd/get_args.c b/contrib/amd/amd/get_args.c
index 607b3fb..37ca84a 100644
--- a/contrib/amd/amd/get_args.c
+++ b/contrib/amd/amd/get_args.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997-1998 Erez Zadok
+ * Copyright (c) 1997-1999 Erez Zadok
* Copyright (c) 1990 Jan-Simon Pendry
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
* Copyright (c) 1990 The Regents of the University of California.
@@ -38,7 +38,8 @@
*
* %W% (Berkeley) %G%
*
- * $Id: get_args.c,v 1.2 1998/09/05 06:06:00 obrien Exp $
+ * $Id: get_args.c,v 1.3 1999/01/10 21:53:45 ezk Exp $
+ * $FreeBSD$
*
*/
@@ -85,7 +86,7 @@ get_version_string(void)
vers = xmalloc(2048 + wire_buf_len);
sprintf(vers, "%s\n%s\n%s\n%s\n",
- "Copyright (c) 1997-1998 Erez Zadok",
+ "Copyright (c) 1997-1999 Erez Zadok",
"Copyright (c) 1990 Jan-Simon Pendry",
"Copyright (c) 1990 Imperial College of Science, Technology & Medicine",
"Copyright (c) 1990 The Regents of the University of California.");
diff --git a/contrib/amd/amd/srvr_nfs.c b/contrib/amd/amd/srvr_nfs.c
index 5a56d9d..b5425bf 100644
--- a/contrib/amd/amd/srvr_nfs.c
+++ b/contrib/amd/amd/srvr_nfs.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997-1998 Erez Zadok
+ * Copyright (c) 1997-1999 Erez Zadok
* Copyright (c) 1990 Jan-Simon Pendry
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
* Copyright (c) 1990 The Regents of the University of California.
@@ -38,7 +38,8 @@
*
* %W% (Berkeley) %G%
*
- * $Id: srvr_nfs.c,v 1.2 1998/09/14 08:20:37 obrien Exp $
+ * $Id: srvr_nfs.c,v 1.5 1999/09/08 23:36:39 ezk Exp $
+ * $FreeBSD$
*
*/
@@ -136,7 +137,7 @@ start_ping(u_long nfs_version)
nfs_version = NFS_VERSION;
plog(XLOG_WARNING, "start_ping: nfs_version = 0 fixed");
}
- plog(XLOG_INFO, "start_ping: nfs_version: %d", nfs_version);
+ plog(XLOG_INFO, "start_ping: nfs_version: %d", (int) nfs_version);
rpc_msg_init(&ping_msg, NFS_PROGRAM, nfs_version, NFSPROC_NULL);
@@ -187,7 +188,7 @@ got_portmap(voidp pkt, int len, struct sockaddr_in * sa, struct sockaddr_in * ia
if (!error && port) {
#ifdef DEBUG
- dlog("got port (%d) for mountd on %s", port, fs->fs_host);
+ dlog("got port (%d) for mountd on %s", (int) port, fs->fs_host);
#endif /* DEBUG */
/*
* Grab the port number. Portmap sends back
@@ -201,7 +202,7 @@ got_portmap(voidp pkt, int len, struct sockaddr_in * sa, struct sockaddr_in * ia
} else {
#ifdef DEBUG
dlog("Error fetching port for mountd on %s", fs->fs_host);
- dlog("\t error=%d, port=%d", error, port);
+ dlog("\t error=%d, port=%d", error, (int) port);
#endif /* DEBUG */
/*
* Almost certainly no mountd running on remote host
@@ -282,7 +283,7 @@ recompute_portmap(fserver *fs)
if (fs->fs_version == 0)
plog(XLOG_WARNING, "recompute_portmap: nfs_version = 0 fixed");
- plog(XLOG_INFO, "recompute_portmap: NFS version %d", fs->fs_version);
+ plog(XLOG_INFO, "recompute_portmap: NFS version %d", (int) fs->fs_version);
#ifdef HAVE_FS_NFS3
if (fs->fs_version == NFS_VERSION3)
mnt_version = MOUNTVERS3;
@@ -290,7 +291,7 @@ recompute_portmap(fserver *fs)
#endif /* HAVE_FS_NFS3 */
mnt_version = MOUNTVERS;
- plog(XLOG_INFO, "Using MOUNT version: %d", mnt_version);
+ plog(XLOG_INFO, "Using MOUNT version: %d", (int) mnt_version);
call_portmap(fs, nfs_auth, MOUNTPROG, mnt_version, (u_long) IPPROTO_UDP);
}
@@ -667,7 +668,7 @@ find_nfs_srvr(mntfs *mf)
/* allow overriding if nfsv2 option is specified in mount options */
if (hasmntopt(&mnt, "nfsv2")) {
nfs_version = (u_long) 2; /* nullify any ``vers=X'' statements */
- nfs_proto = "udp"; /* nullify any ``proto=tcp'' stmts */
+ nfs_proto = "udp"; /* nullify any ``proto=tcp'' statements */
plog(XLOG_WARNING, "found compatiblity option \"nfsv2\": set options vers=2, proto=udp for host %s", host);
}
#endif /* HAVE_NFS_NFSV2_H */
@@ -725,7 +726,7 @@ find_nfs_srvr(mntfs *mf)
int proto_nfs_version;
char **p;
- for (p = protocols; *p; p ++) {
+ for (p = protocols; *p; p++) {
proto_nfs_version = get_nfs_version(host, ip, nfs_version, *p);
if (proto_nfs_version > best_nfs_version) {
@@ -756,7 +757,7 @@ find_nfs_srvr(mntfs *mf)
nfs_proto = "udp";
plog(XLOG_INFO, "Using NFS version %d, protocol %s on host %s",
- nfs_version, nfs_proto, host);
+ (int) nfs_version, nfs_proto, host);
/*
* Try to find an existing fs server structure for this host.
OpenPOWER on IntegriCloud