summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/amd/amd/afs_ops.c15
-rw-r--r--usr.sbin/amd/amd/amd.c4
-rw-r--r--usr.sbin/amd/amd/get_args.c24
-rw-r--r--usr.sbin/amd/amd/host_ops.c59
-rw-r--r--usr.sbin/amd/amd/info_file.c4
-rw-r--r--usr.sbin/amd/amd/info_nis.c6
-rw-r--r--usr.sbin/amd/amd/info_passwd.c4
-rw-r--r--usr.sbin/amd/amd/info_union.c4
-rw-r--r--usr.sbin/amd/amd/mapc.c38
-rw-r--r--usr.sbin/amd/amd/mount_fs.c47
-rw-r--r--usr.sbin/amd/amd/nfs_ops.c94
-rw-r--r--usr.sbin/amd/amd/nfs_start.c13
-rw-r--r--usr.sbin/amd/amd/nfs_subr.c10
-rw-r--r--usr.sbin/amd/amd/srvr_nfs.c4
-rw-r--r--usr.sbin/amd/amd/ufs_ops.c8
-rw-r--r--usr.sbin/amd/amd/util.c18
-rw-r--r--usr.sbin/amd/config/Makefile.config41
-rw-r--r--usr.sbin/amd/config/os-bsd44.h39
-rw-r--r--usr.sbin/amd/config/os-defaults.h20
-rw-r--r--usr.sbin/amd/include/am.h21
-rw-r--r--usr.sbin/amd/rpcx/mount.h11
-rw-r--r--usr.sbin/amd/rpcx/mount_xdr.c30
-rw-r--r--usr.sbin/amd/rpcx/nfs_prot.h43
23 files changed, 24 insertions, 533 deletions
diff --git a/usr.sbin/amd/amd/afs_ops.c b/usr.sbin/amd/amd/afs_ops.c
index db628208588..1e45685c040 100644
--- a/usr.sbin/amd/amd/afs_ops.c
+++ b/usr.sbin/amd/amd/afs_ops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: afs_ops.c,v 1.12 2004/07/17 06:55:02 otto Exp $ */
+/* $OpenBSD: afs_ops.c,v 1.13 2014/10/20 02:33:42 guenther Exp $ */
/*
* Copyright (c) 1990 Jan-Simon Pendry
@@ -136,10 +136,8 @@ mount_toplvl(char *dir, char *opts)
return EINVAL;
}
-#if NFS_PROTOCOL_VERSION >= 3
nfs_args.fhsize = NFSX_V2FH;
nfs_args.version = NFS_ARGSVERSION;
-#endif
NFS_FH_DREF(nfs_args.fh, (NFS_FH_TYPE) fhp);
/*
@@ -168,13 +166,8 @@ mount_toplvl(char *dir, char *opts)
#ifndef HOSTNAMESZ
#define SHORT_MOUNT_NAME
#endif /* HOSTNAMESZ */
-#ifdef SHORT_MOUNT_NAME
snprintf(fs_hostname, sizeof(fs_hostname), "amd:%ld",
foreground ? (long)mypid : (long)getppid());
-#else
- snprintf(fs_hostname, sizeof(fs_hostname), "pid%ld@%s:%s",
- foreground ? (long)mypid : (long)getppid(), hostname, dir);
-#endif /* SHORT_MOUNT_NAME */
nfs_args.hostname = fs_hostname;
nfs_args.flags |= NFSMNT_HOSTNAME;
#ifdef HOSTNAMESZ
@@ -226,12 +219,6 @@ mount_toplvl(char *dir, char *opts)
#endif /* MNTOPT_INTR */
flags = compute_mount_flags(&mnt);
-#ifdef ULTRIX_HACK
- nfs_args.gfs_flags = flags;
- flags &= M_RDONLY;
- if (flags & M_RDONLY)
- nfs_args.flags |= NFSMNT_RONLY;
-#endif /* ULTRIX_HACK */
return mount_fs(&mnt, flags, (caddr_t) &nfs_args, retry, type);
}
diff --git a/usr.sbin/amd/amd/amd.c b/usr.sbin/amd/amd/amd.c
index 7e01fd2cb93..3e990cd7c18 100644
--- a/usr.sbin/amd/amd/amd.c
+++ b/usr.sbin/amd/amd/amd.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)amd.c 8.1 (Berkeley) 6/6/93
- * $Id: amd.c,v 1.18 2014/10/20 00:20:04 guenther Exp $
+ * $Id: amd.c,v 1.19 2014/10/20 02:33:42 guenther Exp $
*/
/*
@@ -298,7 +298,6 @@ main(int argc, char *argv[])
going_down(1);
}
-#ifdef HAS_NIS_MAPS
/*
* If the domain was specified then bind it here
* to circumvent any default bindings that may
@@ -308,7 +307,6 @@ main(int argc, char *argv[])
plog(XLOG_FATAL, "Can't bind to domain \"%s\"", domain);
going_down(1);
}
-#endif /* HAS_NIS_MAPS */
#ifdef DEBUG
Debug(D_DAEMON)
diff --git a/usr.sbin/amd/amd/get_args.c b/usr.sbin/amd/amd/get_args.c
index 33d3afb03de..5e930bcc173 100644
--- a/usr.sbin/amd/amd/get_args.c
+++ b/usr.sbin/amd/amd/get_args.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)get_args.c 8.1 (Berkeley) 6/6/93
- * $Id: get_args.c,v 1.13 2014/10/20 00:20:04 guenther Exp $
+ * $Id: get_args.c,v 1.14 2014/10/20 02:33:42 guenther Exp $
*/
/*
@@ -55,12 +55,7 @@ int print_pid;
int normalize_hosts;
char *karch; /* Kernel architecture */
char *cluster; /* Cluster name */
-#ifdef HAS_NIS_MAPS
char *domain; /* YP domain */
-#endif /* HAS_NIS_MAPS */
-#ifdef UPDATE_MTAB
-char *mtab;
-#endif /* UPDATE_MTAB */
int afs_timeo = -1;
int afs_retrans = -1;
int am_timeo = AM_TTL;
@@ -194,11 +189,7 @@ get_args(int c, char *v[])
break;
case 'y':
-#ifdef HAS_NIS_MAPS
domain = optarg;
-#else
- plog(XLOG_USER, "-y: option ignored. No NIS support available.");
-#endif /* HAS_NIS_MAPS */
break;
case 'C':
@@ -257,20 +248,11 @@ get_args(int c, char *v[])
strlcat(hostd, ".", 2 * MAXHOSTNAMELEN);
strlcat(hostd, hostdomain, 2 * MAXHOSTNAMELEN);
-#ifdef UPDATE_MTAB
-#ifdef DEBUG
- if (debug_flags & D_MTAB)
- mtab = DEBUG_MTAB;
- else
-#endif /* DEBUG */
- mtab = MOUNTED;
-#else
#ifdef DEBUG
{ if (debug_flags & D_MTAB) {
dlog("-D mtab option ignored");
} }
#endif /* DEBUG */
-#endif /* UPDATE_MTAB */
if (switch_to_logfile(logfile) != 0)
plog(XLOG_USER, "Cannot switch logfile");
@@ -306,11 +288,7 @@ show_usage:
fputs(" [-h host_helper]\n", stderr);
#endif /* defined(HAS_HOST) && defined(HOST_EXEC) */
-#ifdef HAS_NIS_MAPS
fputs(" [-y YP-domain]\n", stderr);
-#else
- fputc('\n', stderr);
-#endif /* HAS_NIS_MAPS */
show_opts('x', xlog_opt);
#ifdef DEBUG
diff --git a/usr.sbin/amd/amd/host_ops.c b/usr.sbin/amd/amd/host_ops.c
index 86864721d16..e797ddc919f 100644
--- a/usr.sbin/amd/amd/host_ops.c
+++ b/usr.sbin/amd/amd/host_ops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: host_ops.c,v 1.13 2003/06/02 23:36:51 millert Exp $ */
+/* $OpenBSD: host_ops.c,v 1.14 2014/10/20 02:33:42 guenther Exp $ */
/*
* Copyright (c) 1990 Jan-Simon Pendry
@@ -172,9 +172,7 @@ fetch_fhandle(CLIENT *client, char *dir, fhstatus *fhp)
* Call the mount daemon on the remote host to
* get the filehandle.
*/
-#if NFS_PROTOCOL_VERSION >= 3
fhp->fhs_vers = MOUNTVERS;
-#endif
clnt_stat = clnt_call(client, MOUNTPROC_MNT, xdr_dirpath, &dir, xdr_fhstatus, fhp, tv);
if (clnt_stat != RPC_SUCCESS) {
extern char *clnt_sperrno();
@@ -494,61 +492,6 @@ host_fumount(mntfs *mf)
*/
static void host_umounted(am_node *mp)
{
-#ifdef INFORM_MOUNTD
- mntfs *mf = mp->am_mnt;
- char *host;
- CLIENT *client;
- enum clnt_stat clnt_stat;
- struct sockaddr_in sin;
- int sock = RPC_ANYSOCK;
- struct timeval tv;
- tv.tv_sec = 10; tv.tv_usec = 0;
-
- if (mf->mf_error || mf->mf_refc > 1 || ! mf->mf_server)
- return;
-
- host = mf->mf_server->fs_host;
- sin = *mf->mf_server->fs_ip;
-
- /*
- * Zero out the port - make sure we recompute
- */
- sin.sin_port = 0;
- /*
- * Make a client end-point.
- * Try TCP first
- */
- if ((client = clnttcp_create(&sin, MOUNTPROG, MOUNTVERS, &sock, 0, 0)) == NULL &&
- (client = clntudp_create(&sin, MOUNTPROG, MOUNTVERS, tv, &sock)) == NULL) {
- plog(XLOG_ERROR, "Failed to make rpc connection to mountd on %s", host);
- goto out;
- }
-
- if (!nfs_auth) {
- if (make_nfs_auth())
- goto out;
- }
-
- client->cl_auth = nfs_auth;
-
-#ifdef DEBUG
- dlog("Unmounting all from %s", host);
-#endif /* DEBUG */
-
- clnt_stat = clnt_call(client, MOUNTPROC_UMNTALL, xdr_void, 0, xdr_void, 0, tv);
- if (clnt_stat != RPC_SUCCESS && clnt_stat != RPC_SYSTEMERROR) {
- /* RPC_SYSTEMERROR seems to be returned for no good reason ...*/
- extern char *clnt_sperrno();
- char *msg = clnt_sperrno(clnt_stat);
- plog(XLOG_ERROR, "unmount all from %s rpc failed: %s", host, msg, clnt_stat);
- goto out;
- }
-
-out:
- if (client)
- clnt_destroy(client);
-
-#endif /* INFORM_MOUNTD */
}
diff --git a/usr.sbin/amd/amd/info_file.c b/usr.sbin/amd/amd/info_file.c
index 21e29d41429..18dcca408dd 100644
--- a/usr.sbin/amd/amd/info_file.c
+++ b/usr.sbin/amd/amd/info_file.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)info_file.c 8.1 (Berkeley) 6/6/93
- * $Id: info_file.c,v 1.7 2013/12/03 02:14:57 deraadt Exp $
+ * $Id: info_file.c,v 1.8 2014/10/20 02:33:42 guenther Exp $
*/
/*
@@ -41,7 +41,6 @@
#include "am.h"
-#ifdef HAS_FILE_MAPS
#include <ctype.h>
#include <sys/stat.h>
@@ -260,4 +259,3 @@ file_mtime(char *map, time_t *tp)
return errno;
}
-#endif /* HAS_FILE_MAPS */
diff --git a/usr.sbin/amd/amd/info_nis.c b/usr.sbin/amd/amd/info_nis.c
index 33d26cc0304..7276b09a306 100644
--- a/usr.sbin/amd/amd/info_nis.c
+++ b/usr.sbin/amd/amd/info_nis.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)info_nis.c 8.1 (Berkeley) 6/6/93
- * $Id: info_nis.c,v 1.10 2003/06/02 23:36:51 millert Exp $
+ * $Id: info_nis.c,v 1.11 2014/10/20 02:33:42 guenther Exp $
*/
/*
@@ -43,7 +43,6 @@
#include <unistd.h>
-#ifdef HAS_NIS_MAPS
#include <rpcsvc/yp_prot.h>
#include <rpcsvc/ypclnt.h>
#include <time.h>
@@ -84,7 +83,6 @@ determine_nis_domain(void)
}
-#ifdef HAS_NIS_RELOAD
struct nis_callback_data {
mnt_map *ncd_m;
char *ncd_map;
@@ -160,7 +158,6 @@ nis_reload(mnt_map *m, char *map, void (*fn)())
return error;
}
-#endif /* HAS_NIS_RELOAD */
/*
* Try to locate a key using NIS.
@@ -282,4 +279,3 @@ nis_init(char *map, time_t *tp)
}
return 0;
}
-#endif /* HAS_NIS_MAPS */
diff --git a/usr.sbin/amd/amd/info_passwd.c b/usr.sbin/amd/amd/info_passwd.c
index 22eb8c77242..9f55e942838 100644
--- a/usr.sbin/amd/amd/info_passwd.c
+++ b/usr.sbin/amd/amd/info_passwd.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)info_passwd.c 8.1 (Berkeley) 6/6/93
- * $Id: info_passwd.c,v 1.8 2010/03/30 17:10:37 zinovik Exp $
+ * $Id: info_passwd.c,v 1.9 2014/10/20 02:33:42 guenther Exp $
*/
/*
@@ -44,7 +44,6 @@
#include "am.h"
-#ifdef HAS_PASSWD_MAPS
#include <pwd.h>
#define PASSWD_MAP "/etc/passwd"
@@ -149,4 +148,3 @@ enoent:
return ENOENT;
}
-#endif /* HAS_PASSWD_MAPS */
diff --git a/usr.sbin/amd/amd/info_union.c b/usr.sbin/amd/amd/info_union.c
index 621f3aef29d..0c2d90db204 100644
--- a/usr.sbin/amd/amd/info_union.c
+++ b/usr.sbin/amd/amd/info_union.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)info_union.c 8.1 (Berkeley) 6/6/93
- * $Id: info_union.c,v 1.7 2013/06/02 06:25:20 guenther Exp $
+ * $Id: info_union.c,v 1.8 2014/10/20 02:33:42 guenther Exp $
*/
/*
@@ -44,7 +44,6 @@
#include "am.h"
-#ifdef HAS_UNION_MAPS
#include <dirent.h>
#define DIRENT struct dirent
@@ -136,4 +135,3 @@ union_reload(mnt_map *m, char *map, void (*fn)())
return 0;
}
-#endif /* HAS_UNION_MAPS */
diff --git a/usr.sbin/amd/amd/mapc.c b/usr.sbin/amd/amd/mapc.c
index a23f19f0866..869616381f2 100644
--- a/usr.sbin/amd/amd/mapc.c
+++ b/usr.sbin/amd/amd/mapc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mapc.c,v 1.15 2014/10/20 00:20:04 guenther Exp $ */
+/* $OpenBSD: mapc.c,v 1.16 2014/10/20 02:33:42 guenther Exp $ */
/*-
* Copyright (c) 1989 Jan-Simon Pendry
@@ -39,9 +39,7 @@
*/
#include "am.h"
-#ifdef HAS_REGEXP
#include <regex.h>
-#endif
/*
* Hash table size
@@ -64,12 +62,8 @@ static char wildcard[] = "*";
#define MAPC_INC 0x002
#define MAPC_ROOT 0x004
#define MAPC_ALL 0x010
-#ifdef HAS_REGEXP
#define MAPC_RE 0x020
#define MAPC_ISRE(m) ((m)->alloc == MAPC_RE)
-#else
-#define MAPC_ISRE(m) FALSE
-#endif
#define MAPC_CACHE_MASK 0x0ff
#define MAPC_SYNC 0x100
@@ -79,10 +73,8 @@ static struct opt_tab mapc_opt[] = {
{ "inc", MAPC_INC },
{ "mapdefault", MAPC_DFLT },
{ "none", MAPC_NONE },
-#ifdef HAS_REGEXP
{ "re", MAPC_RE },
{ "regexp", MAPC_RE },
-#endif
{ "sync", MAPC_SYNC },
{ 0, 0 }
};
@@ -161,39 +153,27 @@ qelem map_list_head = { &map_list_head, &map_list_head };
static int root_init(char *, time_t *);
/* FILE MAPS */
-#ifdef HAS_FILE_MAPS
extern int file_init(char *, time_t *);
extern int file_reload(mnt_map *, char *, add_fn *);
extern int file_search(mnt_map *, char *, char *, char **, time_t *);
extern int file_mtime(char *, time_t *);
-#endif /* HAS_FILE_MAPS */
/* Network Information Service (NIS) MAPS */
-#ifdef HAS_NIS_MAPS
extern int nis_init(char *, time_t *);
-#ifdef HAS_NIS_RELOAD
extern int nis_reload(mnt_map *, char *, add_fn *);
-#else
-#define nis_reload error_reload
-#endif
extern int nis_search(mnt_map *, char *, char *, char **, time_t *);
#define nis_mtime nis_init
-#endif /* HAS_NIS_MAPS */
/* NDBM MAPS */
#ifdef HAS_NDBM_MAPS
-#ifdef OS_HAS_NDBM
extern int ndbm_init(char *, time_t *);
extern int ndbm_search(mnt_map *, char *, charo *, char **, time_t *);
#define ndbm_mtime ndbm_init
-#endif /* OS_HAS_NDBM */
#endif /* HAS_NDBM_MAPS */
/* PASSWD MAPS */
-#ifdef HAS_PASSWD_MAPS
extern int passwd_init(char *, time_t *);
extern int passwd_search(mnt_map *, char *, char *, char **, time_t *);
-#endif /* HAS_PASSWD_MAPS */
/* HESIOD MAPS */
#ifdef HAS_HESIOD_MAPS
@@ -207,11 +187,9 @@ extern int hesiod_search(mnt_map *, char *, char *, char **, time_t *);
#endif /* HAS_HESIOD_MAPS */
/* UNION MAPS */
-#ifdef HAS_UNION_MAPS
extern int union_init(char *, time_t *);
extern int union_search(mnt_map *, char *, char *, char **, time_t *);
extern int union_reload(mnt_map *, char *, add_fn *);
-#endif /* HAS_UNION_MAPS */
/* ERROR MAP */
static int error_init(char *, time_t *);
@@ -222,29 +200,21 @@ static int error_mtime(char *, time_t *);
static map_type maptypes[] = {
{ "root", root_init, error_reload, error_search, error_mtime, MAPC_ROOT },
-#ifdef HAS_PASSWD_MAPS
{ "passwd", passwd_init, error_reload, passwd_search, error_mtime, MAPC_INC },
-#endif
#ifdef HAS_HESIOD_MAPS
{ "hesiod", hesiod_init, hesiod_reload, hesiod_search, error_mtime, MAPC_ALL },
#endif
-#ifdef HAS_UNION_MAPS
{ "union", union_init, union_reload, union_search, error_mtime, MAPC_ALL },
-#endif
-#ifdef HAS_NIS_MAPS
{ "nis", nis_init, nis_reload, nis_search, nis_mtime, MAPC_INC },
-#endif
#ifdef HAS_NDBM_MAPS
{ "ndbm", ndbm_init, error_reload, ndbm_search, ndbm_mtime, MAPC_INC },
#endif
-#ifdef HAS_FILE_MAPS
{ "file", file_init, file_reload, file_search, file_mtime, MAPC_ALL },
-#endif
{ "error", error_init, error_reload, error_search, error_mtime, MAPC_NONE },
};
@@ -290,7 +260,6 @@ mapc_add_kv(mnt_map *m, char *key, char *val)
dlog("add_kv: %s -> %s", key, val);
#endif
-#ifdef HAS_REGEXP
if (MAPC_ISRE(m)) {
char keyb[MAXPATHLEN];
regex_t *re;
@@ -308,7 +277,6 @@ mapc_add_kv(mnt_map *m, char *key, char *val)
key = (char *)re;
}
}
-#endif
h = &m->kvhash[hash];
n = ALLOC(kv);
@@ -449,7 +417,6 @@ mapc_create(char *map, char *opt)
alloc = MAPC_INC;
}
break;
-#ifdef HAS_REGEXP
case MAPC_RE:
if (mt->reload == error_reload) {
plog(XLOG_WARNING, "Map type \"%s\" does not support cache type \"re\"", mt->name);
@@ -457,7 +424,6 @@ mapc_create(char *map, char *opt)
/* assert: mt->name == "error" */
}
break;
-#endif
}
#ifdef DEBUG
@@ -605,7 +571,6 @@ mapc_meta_search(mnt_map *m, char *key, char **pval, int recurse)
while (k && !FSTREQ(k->key, key)) k = k->next;
}
-#ifdef HAS_REGEXP
else if (recurse == MREC_FULL) {
/*
* Try for an RE match against the entire map.
@@ -627,7 +592,6 @@ mapc_meta_search(mnt_map *m, char *key, char **pval, int recurse)
break;
}
}
-#endif
/*
* If found then take a copy
diff --git a/usr.sbin/amd/amd/mount_fs.c b/usr.sbin/amd/amd/mount_fs.c
index 52c9d4f2245..7a83fb1c7e1 100644
--- a/usr.sbin/amd/amd/mount_fs.c
+++ b/usr.sbin/amd/amd/mount_fs.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)mount_fs.c 8.1 (Berkeley) 6/6/93
- * $Id: mount_fs.c,v 1.12 2014/10/20 00:20:04 guenther Exp $
+ * $Id: mount_fs.c,v 1.13 2014/10/20 02:33:42 guenther Exp $
*/
#include "am.h"
@@ -101,10 +101,6 @@ mount_fs(struct mntent *mnt, int flags, caddr_t mnt_data, int retry,
MTYPE_TYPE type)
{
int error = 0;
-#ifdef MNTINFO_DEV
- struct stat stb;
- char *xopts = 0;
-#endif /* MNTINFO_DEV */
#ifdef DEBUG
#ifdef NFS_4
@@ -149,50 +145,10 @@ again:
return errno;
}
-#ifdef UPDATE_MTAB
-#ifdef MNTINFO_DEV
- /*
- * Add the extra dev= field to the mount table.
- */
- if (lstat(mnt->mnt_dir, &stb) == 0) {
- char *zopts = (char *) xmalloc(strlen(mnt->mnt_opts) + 32);
- xopts = mnt->mnt_opts;
- if (sizeof(stb.st_dev) == 2) {
- /* e.g. SunOS 4.1 */
- snprintf(zopts, strlen(mnt->mnt_opts) + 32,
- "%s,%s=%s%04x", xopts, MNTINFO_DEV,
- MNTINFO_PREF, (u_int) stb.st_dev & 0xffff);
- } else {
- /* e.g. System Vr4 */
- snprintf(zopts, strlen(mnt->mnt_opts) + 32,
- "%s,%s=%s%08x", xopts, MNTINFO_DEV,
- MNTINFO_PREF, (u_int) stb.st_dev);
- }
- mnt->mnt_opts = zopts;
- }
-#endif /* MNTINFO_DEV */
-
-#ifdef FIXUP_MNTENT
- /*
- * Additional fields in struct mntent
- * are fixed up here
- */
- FIXUP_MNTENT(mnt);
-#endif
-
- write_mntent(mnt);
-#ifdef MNTINFO_DEV
- if (xopts) {
- free(mnt->mnt_opts);
- mnt->mnt_opts = xopts;
- }
-#endif /* MNTINFO_DEV */
-#endif /* UPDATE_MTAB */
return 0;
}
-#ifdef NEED_MNTOPT_PARSER
/*
* Some systems don't provide these to the user,
* but amd needs them, so...
@@ -251,7 +207,6 @@ hasmntopt(struct mntent *mnt, char *opt)
return 0;
}
-#endif /* NEED_MNTOPT_PARSER */
#ifdef MOUNT_HELPER_SOURCE
#include MOUNT_HELPER_SOURCE
diff --git a/usr.sbin/amd/amd/nfs_ops.c b/usr.sbin/amd/amd/nfs_ops.c
index 239146f4ceb..e45266d044a 100644
--- a/usr.sbin/amd/amd/nfs_ops.c
+++ b/usr.sbin/amd/amd/nfs_ops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_ops.c,v 1.19 2009/10/27 23:59:50 deraadt Exp $ */
+/* $OpenBSD: nfs_ops.c,v 1.20 2014/10/20 02:33:42 guenther Exp $ */
/*-
* Copyright (c) 1990 Jan-Simon Pendry
@@ -150,9 +150,7 @@ got_nfs_fh(void *pkt, int len, struct sockaddr_in *sa,
{
fh_cache *fp = find_nfs_fhandle_cache(idv, done);
if (fp) {
-#if NFS_PROTOCOL_VERSION >= 3
fp->fh_handle.fhs_vers = MOUNTVERS;
-#endif
fp->fh_error = pickup_rpc_reply(pkt, len, (void *)&fp->fh_handle, xdr_fhstatus);
if (!fp->fh_error) {
#ifdef DEBUG
@@ -321,7 +319,6 @@ prime_nfs_fhandle_cache(char *path, fserver *fs, fhstatus *fhbuf, void *wchan)
int
make_nfs_auth(void)
{
-#ifdef HAS_NFS_QUALIFIED_NAMES
/*
* From: Chris Metcalf <metcalf@masala.lcs.mit.edu>
* Use hostd, not just hostname. Note that uids
@@ -330,9 +327,6 @@ make_nfs_auth(void)
*/
static int group_wheel = 0;
nfs_auth = authunix_create(hostd, 0, 0, 1, &group_wheel);
-#else
- nfs_auth = authunix_create_default();
-#endif
if (!nfs_auth)
return ENOBUFS;
return 0;
@@ -476,13 +470,7 @@ mount_nfs_fh(fhstatus *fhp, char *dir, char *fs_name, char *opts,
*/
if (!(colon = strchr(fs_name, ':')))
return ENOENT;
-#ifndef NFS_ARGS_NEEDS_PATH
- *colon = '\0';
-#endif
strlcpy(host, fs_name, sizeof(host));
-#ifndef NFS_ARGS_NEEDS_PATH
- *colon = ':';
-#endif /* NFS_ARGS_NEEDS_PATH */
/*path = colon + 1;*/
if (mf->mf_remopts && *mf->mf_remopts && !islocalnet(fs->fs_ip->sin_addr.s_addr))
@@ -510,13 +498,8 @@ mount_nfs_fh(fhstatus *fhp, char *dir, char *fs_name, char *opts,
*/
NFS_FH_DREF(nfs_args.fh, (NFS_FH_TYPE) fhp->fhs_fhandle);
-#if NFS_PROTOCOL_VERSION >= 3
nfs_args.fhsize = fhp->fhs_size;
nfs_args.version = NFS_ARGSVERSION;
-#endif
-#ifdef ULTRIX_HACK
- nfs_args.optstr = mnt.mnt_opts;
-#endif /* ULTRIX_HACK */
nfs_args.hostname = host;
nfs_args.flags |= NFSMNT_HOSTNAME;
@@ -599,10 +582,6 @@ mount_nfs_fh(fhstatus *fhp, char *dir, char *fs_name, char *opts,
nfs_args.flags |= NFSMNT_NODEVS;
#endif /* MNTOPT_NODEVS */
-#ifdef MNTOPT_COMPRESS
- if (hasmntopt(&mnt, MNTOPT_COMPRESS) != NULL)
- nfs_args.flags |= NFSMNT_COMPRESS;
-#endif /* MNTOPT_COMPRESS */
#ifdef MNTOPT_NOCONN
if (hasmntopt(&mnt, MNTOPT_NOCONN) != NULL)
@@ -614,14 +593,6 @@ mount_nfs_fh(fhstatus *fhp, char *dir, char *fs_name, char *opts,
nfs_args.flags |= NFSMNT_RESVPORT;
#endif /* MNTOPT_RESVPORT */
-#ifdef MNTOPT_NQNFS
- if (hasmntopt(&mnt, MNTOPT_NQNFS) != NULL)
- nfs_args.flags |= NFSMNT_NQNFS;
-#ifdef NFSMNT_NQLOOKLEASE
- if (hasmntopt(&mnt, "nolooklease") == NULL)
- nfs_args.flags |= NFSMNT_NQLOOKLEASE;
-#endif /* NFSMNT_NQLOOKLEASE */
-#endif /* MNTOPT_NQNFS */
#ifdef NFSMNT_PGTHRESH
if (nfs_args.pg_thresh = hasmntval(&mnt, "pgthresh"))
@@ -637,28 +608,10 @@ mount_nfs_fh(fhstatus *fhp, char *dir, char *fs_name, char *opts,
nfs_args.flags |= NFSMNT_NOCTO;
#endif /* NFSMNT_NOCTO */
-#ifdef HAS_TCP_NFS
if (hasmntopt(&mnt, "tcp") != NULL)
nfs_args.sotype = SOCK_STREAM;
-#endif /* HAS_TCP_NFS */
-#ifdef ULTRIX_HACK
- /*
- * Ultrix passes the flags argument as part of the
- * mount data structure, rather than using the
- * flags argument to the system call. This is
- * confusing...
- */
- if (!(nfs_args.flags & NFSMNT_PGTHRESH)) {
- nfs_args.pg_thresh = 64; /* 64k - XXX */
- nfs_args.flags |= NFSMNT_PGTHRESH;
- }
- nfs_args.gfs_flags = flags;
- flags &= M_RDONLY;
- if (flags & M_RDONLY)
- nfs_args.flags |= NFSMNT_RONLY;
-#endif /* ULTRIX_HACK */
error = mount_fs(&mnt, flags, (caddr_t) &nfs_args, retry, type);
free(xopts);
@@ -723,51 +676,6 @@ nfs_fumount(mntfs *mf)
static void
nfs_umounted(am_node *mp)
{
-#ifdef INFORM_MOUNTD
- /*
- * Don't bother to inform remote mountd
- * that we are finished. Until a full
- * track of filehandles is maintained
- * the mountd unmount callback cannot
- * be done correctly anyway...
- */
-
- mntfs *mf = mp->am_mnt;
- fserver *fs;
- char *colon, *path;
-
- if (mf->mf_error || mf->mf_refc > 1)
- return;
-
- fs = mf->mf_server;
-
- /*
- * Call the mount daemon on the server to
- * announce that we are not using the fs any more.
- *
- * This is *wrong*. The mountd should be called
- * when the fhandle is flushed from the cache, and
- * a reference held to the cached entry while the
- * fs is mounted...
- */
- colon = path = strchr(mf->mf_info, ':');
- if (fs && colon) {
- fh_cache f;
-#ifdef DEBUG
- dlog("calling mountd for %s", mf->mf_info);
-#endif /* DEBUG */
- *path++ = '\0';
- f.fh_path = path;
- f.fh_sin = *fs->fs_ip;
- f.fh_sin.sin_port = (u_short) 0;
- f.fh_fs = fs;
- f.fh_id = 0;
- f.fh_error = 0;
- (void) prime_nfs_fhandle_cache(colon+1, mf->mf_server, (fhstatus *) 0, (void *)mf);
- (void) call_mountd(&f, MOUNTPROC_UMNT, (fwd_fun) 0, (void *)0);
- *colon = ':';
- }
-#endif /* INFORM_MOUNTD */
#ifdef KICK_KERNEL
/* This should go into the mainline code, not in nfs_ops... */
diff --git a/usr.sbin/amd/amd/nfs_start.c b/usr.sbin/amd/amd/nfs_start.c
index 0453928b089..dd07526a2e5 100644
--- a/usr.sbin/amd/amd/nfs_start.c
+++ b/usr.sbin/amd/amd/nfs_start.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)nfs_start.c 8.1 (Berkeley) 6/6/93
- * $Id: nfs_start.c,v 1.16 2013/04/17 15:55:44 deraadt Exp $
+ * $Id: nfs_start.c,v 1.17 2014/10/20 02:33:42 guenther Exp $
*/
#include "am.h"
@@ -206,7 +206,6 @@ run_rpc(void)
struct timeval tvv;
int nsel;
time_t now;
-#ifdef RPC_4
#ifdef __OpenBSD__
extern int __svc_fdsetsize;
extern fd_set *__svc_fdset;
@@ -230,12 +229,6 @@ run_rpc(void)
memcpy(fdsp, &svc_fdset, bytes);
FD_SET(fwd_sock, fdsp);
#endif
-#else
- fd_set readfds;
- FD_ZERO(&readfds);
- readfds.fds_bits[0] = svc_fds;
- FD_SET(fwd_sock, &readfds);
-#endif /* RPC_4 */
#ifdef DEBUG
checkup();
@@ -306,15 +299,11 @@ run_rpc(void)
* Anything left must be a normal
* RPC request.
*/
-#ifdef RPC_4
#ifdef __OpenBSD__
svc_getreqset2(fdsp, fdsn);
#else
svc_getreqset(fdsp);
#endif
-#else
- svc_getreq(readfds.fds_bits[0]);
-#endif /* RPC_4 */
}
break;
}
diff --git a/usr.sbin/amd/amd/nfs_subr.c b/usr.sbin/amd/amd/nfs_subr.c
index 0468a8708af..9e2471304b7 100644
--- a/usr.sbin/amd/amd/nfs_subr.c
+++ b/usr.sbin/amd/amd/nfs_subr.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)nfs_subr.c 8.1 (Berkeley) 6/6/93
- * $Id: nfs_subr.c,v 1.5 2003/06/02 23:36:51 millert Exp $
+ * $Id: nfs_subr.c,v 1.6 2014/10/20 02:33:42 guenther Exp $
*/
#include "am.h"
@@ -103,16 +103,13 @@ nfsproc_getattr_2(struct nfs_fh *argp, struct svc_req *rqstp)
mp = fh_to_mp2(argp, &retry);
if (mp == 0) {
-#ifdef PRECISE_SYMLINKS
getattr_retry:
-#endif /* PRECISE_SYMLINKS */
if (retry < 0)
return 0;
res.status = nfs_error(retry);
} else {
struct attrstat *attrp = &mp->am_attr;
-#ifdef PRECISE_SYMLINKS
if (mp->am_fattr.type == NFLNK) {
/*
* Make sure we can read the link,
@@ -122,7 +119,6 @@ getattr_retry:
if (ln == 0)
goto getattr_retry;
}
-#endif /* PRECISE_SYMLINKS */
#ifdef DEBUG
Debug(D_TRACE)
plog(XLOG_DEBUG, "\tstat(%s), size = %d", mp->am_path, attrp->attrstat_u.attributes.size);
@@ -490,11 +486,7 @@ nfsproc_statfs_2(struct nfs_fh *argp, struct svc_req *rqstp)
fp->tsize = 1024;
fp->bsize = 4096;
-#ifdef HAS_EMPTY_AUTOMOUNTS
fp->blocks = 0;
-#else
- fp->blocks = 1;
-#endif
fp->bfree = 0;
fp->bavail = 0;
diff --git a/usr.sbin/amd/amd/srvr_nfs.c b/usr.sbin/amd/amd/srvr_nfs.c
index e2998817b8c..bbc53d8bad8 100644
--- a/usr.sbin/amd/amd/srvr_nfs.c
+++ b/usr.sbin/amd/amd/srvr_nfs.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)srvr_nfs.c 8.1 (Berkeley) 6/6/93
- * $Id: srvr_nfs.c,v 1.6 2003/06/02 23:36:51 millert Exp $
+ * $Id: srvr_nfs.c,v 1.7 2014/10/20 02:33:42 guenther Exp $
*/
/*
@@ -591,7 +591,6 @@ find_nfs_srvr(mntfs *mf)
{ struct mntent mnt;
mnt.mnt_opts = mf->mf_mopts;
pingval = hasmntval(&mnt, "ping");
-#ifdef HAS_TCP_NFS
/*
* Over TCP mount, don't bother to do pings.
* This is experimental - maybe you want to
@@ -599,7 +598,6 @@ find_nfs_srvr(mntfs *mf)
*/
if (pingval == 0 && hasmntopt(&mnt, "tcp"))
pingval = -1;
-#endif /* HAS_TCP_NFS */
}
diff --git a/usr.sbin/amd/amd/ufs_ops.c b/usr.sbin/amd/amd/ufs_ops.c
index 6515ddce474..b105762bed9 100644
--- a/usr.sbin/amd/amd/ufs_ops.c
+++ b/usr.sbin/amd/amd/ufs_ops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs_ops.c,v 1.6 2003/06/02 23:36:51 millert Exp $ */
+/* $OpenBSD: ufs_ops.c,v 1.7 2014/10/20 02:33:42 guenther Exp $ */
/*
* Copyright (c) 1990 Jan-Simon Pendry
@@ -101,13 +101,7 @@ mount_ufs(char *dir, char *fs_name, char *opts)
flags = compute_mount_flags(&mnt);
-#ifdef ULTRIX_HACK
- ufs_args.ufs_flags = flags;
- ufs_args.ufs_pgthresh = 64; /* 64K - XXX */
- flags &= M_RDONLY;
-#else
ufs_args.fspec = fs_name;
-#endif /* ULTRIX_HACK */
/*
* Call generic mount routine
diff --git a/usr.sbin/amd/amd/util.c b/usr.sbin/amd/amd/util.c
index ed9e5e25471..3dfe494b02a 100644
--- a/usr.sbin/amd/amd/util.c
+++ b/usr.sbin/amd/amd/util.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)util.c 8.1 (Berkeley) 6/6/93
- * $Id: util.c,v 1.12 2013/12/03 02:14:57 deraadt Exp $
+ * $Id: util.c,v 1.13 2014/10/20 02:33:42 guenther Exp $
*/
/*
@@ -541,22 +541,6 @@ mkdirs(char *path, int mode)
#endif
}
-#ifdef SUNOS4_WORKAROUND
- /*
- * Do a sync - if we do rmdirs() immediately
- * and then the system crashes it leaves
- * the filesystem in a state that fsck -p
- * can't fix. (Observed more than once on
- * SunOS 4 ...)
- *
- * The problem was caused by a bug somewhere
- * in the UFS code which has since been fixed
- * (at least at Berkeley).
- *
- * Attempted workaround - XXX.
- */
- sync();
-#endif /* SUNOS4_WORKAROUND */
free(p2);
diff --git a/usr.sbin/amd/config/Makefile.config b/usr.sbin/amd/config/Makefile.config
index a2a3afb1b5c..7855c9fb7ab 100644
--- a/usr.sbin/amd/config/Makefile.config
+++ b/usr.sbin/amd/config/Makefile.config
@@ -1,5 +1,5 @@
# from: @(#)Makefile.config 8.1 (Berkeley) 6/6/93
-# $Id: Makefile.config,v 1.3 1997/04/19 21:26:32 millert Exp $
+# $Id: Makefile.config,v 1.4 2014/10/20 02:33:42 guenther Exp $
#
.include <bsd.own.mk>
@@ -40,20 +40,6 @@ OS = bsd44
#RPCLIB = -lrpc
#
-# Include support for Network Information Service (NIS)
-# Also define HAS_NIS_RELOAD to include map
-# enumeration code implementing "cache:=all"
-#
-.if (${YP} == "yes")
-HAS_NIS_MAPS = -DHAS_NIS_MAPS -DHAS_NIS_RELOAD
-.endif
-
-#
-# Include support for file maps
-#
-HAS_FILE_MAPS = -DHAS_FILE_MAPS
-
-#
# Include support for Hesiod
# Also define HAS_HESIOD_RELOAD to include zone
# transfer code implementing "cache:=all"
@@ -61,36 +47,13 @@ HAS_FILE_MAPS = -DHAS_FILE_MAPS
#HAS_HESIOD_MAPS = -DHAS_HESIOD_MAPS -DHAS_HESIOD_RELOAD
#
-# Include support for /etc/passwd
-#
-HAS_PASSWD_MAPS = -DHAS_PASSWD_MAPS
-
-#
-# Include support for union maps
-#
-HAS_UNION_MAPS = -DHAS_UNION_MAPS
-
-#
# Include support for ndbm.
# This removes support for gdbm and is only supported
# if your operating system supports ndbm
#
#HAS_NDBM_MAPS = -DHAS_NDBM_MAPS
-#
-# Include support for "regexp" maps
-#
-HAS_REGEXP = -DHAS_REGEXP
-
-#
-# Make sure that the hostname passed in RPC authentication packets
-# contains a fully qualified domain name. See nfs_ops.c
-#
-HAS_NFS_QUALIFIED_NAMES = -DHAS_NFS_QUALIFIED_NAMES
-
##############################################################
# Do NOT edit the following lines
#
-CONFIG = ${XINCLUDE} ${HAS_NIS_MAPS} ${HAS_FILE_MAPS} ${HAS_HESIOD_MAPS} \
- ${HAS_NDBM_MAPS} ${HAS_MOUNTD_MAPS} ${HAS_PASSWD_MAPS} ${HAS_UNION_MAPS} \
- ${HAS_REGEXP} ${HAS_NFS_QUALIFIED_NAMES}
+CONFIG = ${XINCLUDE} ${HAS_HESIOD_MAPS} ${HAS_NDBM_MAPS}
diff --git a/usr.sbin/amd/config/os-bsd44.h b/usr.sbin/amd/config/os-bsd44.h
index 252b709d767..67eb1342b28 100644
--- a/usr.sbin/amd/config/os-bsd44.h
+++ b/usr.sbin/amd/config/os-bsd44.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: os-bsd44.h,v 1.10 2014/10/20 00:20:04 guenther Exp $ */
+/* $OpenBSD: os-bsd44.h,v 1.11 2014/10/20 02:33:42 guenther Exp $ */
/*
* Copyright (c) 1990 Jan-Simon Pendry
@@ -39,34 +39,11 @@
*/
/*
- * Which version of the Sun RPC library we are using
- * This is the implementation release number, not
- * the protocol revision number.
- */
-#define RPC_4
-
-/*
* Which version of the NFS interface are we using.
* This is the implementation release number, not
* the protocol revision number.
*/
#define NFS_44
-#define HAS_TCP_NFS
-
-/*
- * Does this OS have NDBM support?
- */
-#define OS_HAS_NDBM
-
-/*
- * The mount table is obtained from the kernel
- */
-#undef UPDATE_MTAB
-
-/*
- * No mntent info on 4.4 BSD
- */
-#undef MNTENT_HDR
/*
* Name of filesystem types
@@ -91,8 +68,6 @@
/*
* Miscellaneous 4.4 BSD bits
*/
-#define NEED_MNTOPT_PARSER
-#define SHORT_MOUNT_NAME
#define MNTMAXSTR 128
@@ -129,15 +104,3 @@ struct mntent {
*/
#undef NFS_FH_TYPE
#define NFS_FH_TYPE void *
-
-/*
- * The data for the mount syscall needs the path in addition to the
- * host name since that is the only source of information about the
- * mounted filesystem.
- */
-#define NFS_ARGS_NEEDS_PATH
-
-/*
- * Need precise length links
- */
-#define PRECISE_SYMLINKS
diff --git a/usr.sbin/amd/config/os-defaults.h b/usr.sbin/amd/config/os-defaults.h
index 693f7e114a8..75c972761cf 100644
--- a/usr.sbin/amd/config/os-defaults.h
+++ b/usr.sbin/amd/config/os-defaults.h
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* from: @(#)os-defaults.h 8.1 (Berkeley) 6/6/93
- * $Id: os-defaults.h,v 1.3 2014/10/20 00:20:04 guenther Exp $
+ * $Id: os-defaults.h,v 1.4 2014/10/20 02:33:42 guenther Exp $
*/
/*
@@ -44,16 +44,6 @@
#define AMD_COMPAT 5000000 /* 5.0 */
/*
- * Is the mount table mirrored in software
- */
-#define UPDATE_MTAB
-
-/*
- * Where to get mount entry info
- */
-#define MNTENT_HDR <mntent.h>
-
-/*
* Name of filesystem types
*/
#define MTAB_TYPE_NFS "nfs"
@@ -85,11 +75,3 @@
* Type of filesystem type
*/
#define MTYPE_TYPE char *
-
-/*
- * Make Amd automount points appear
- * to be zero sized. undef this
- * if the O/S has a divide by zero
- * problem in df et al.
- */
-#define HAS_EMPTY_AUTOMOUNTS
diff --git a/usr.sbin/amd/include/am.h b/usr.sbin/amd/include/am.h
index a176b7e8b1f..54fcd5746fe 100644
--- a/usr.sbin/amd/include/am.h
+++ b/usr.sbin/amd/include/am.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: am.h,v 1.12 2009/10/27 23:59:51 deraadt Exp $ */
+/* $OpenBSD: am.h,v 1.13 2014/10/20 02:33:42 guenther Exp $ */
/*
* Copyright (c) 1990 Jan-Simon Pendry
@@ -47,14 +47,6 @@
#include <sys/mount.h>
#include <string.h>
#include <stdlib.h>
-#ifdef MNTENT_HDR
-#include MNTENT_HDR
-#endif /* MNTENT_HDR */
-#ifndef NFS_PROTOCOL_VERSION
-#if NFS_ARGSVERSION >= 3
-#define NFS_PROTOCOL_VERSION 3
-#endif /* NFS_ARGSVERSION >= 3 */
-#endif /* NFS_PROTOCOL_VERSION */
#include "nfs_prot.h"
#include <assert.h>
@@ -85,9 +77,7 @@
extern int print_pid; /* Print pid to stdout */
extern int normalize_hosts; /* Normalize host names before use */
extern int restart_existing_mounts;
-#ifdef HAS_NIS_MAPS
extern char *domain; /* NIS domain to use */
-#endif /* HAS_NIS_MAPS */
extern int am_timeo; /* Cache period */
extern int afs_timeo; /* AFS timeout */
extern int afs_retrans; /* AFS retrans */
@@ -252,9 +242,7 @@ extern int fwd_packet(int, void *, int, struct sockaddr_in *,
extern void fwd_reply(void);
extern void get_args(int, char *[]);
extern char *getwire(void);
-#ifdef NEED_MNTOPT_PARSER
extern char *hasmntopt(struct mntent *, char *);
-#endif /* NEED_MNTOPT_PARSER */
extern int hasmntval(struct mntent *, char *);
extern void host_normalize(char **);
extern char *inet_dquad(char *, size_t, u_int32_t);
@@ -297,9 +285,6 @@ extern mntfs *realloc_mntfs(mntfs *, am_ops *, am_opts *, char *,
extern void rem_que(qelem *);
extern void reschedule_timeout_mp(void);
extern void restart(void);
-#ifdef UPDATE_MTAB
-extern void rewrite_mtab(mntlist *);
-#endif /* UPDATE_MTAB */
extern void rmdirs(char *);
extern am_node *root_ap(char *, int);
extern int root_keyiter(void (*)(char *,void *), void *);
@@ -330,11 +315,7 @@ extern void wakeup(void *);
extern void wakeup_task(int, int, void *);
extern void wakeup_srvr(fserver *);
extern void write_mntent(struct mntent *);
-#ifdef UPDATE_MTAB
-extern void unlock_mntlist(void);
-#else
#define unlock_mntlist()
-#endif /* UPDATE_MTAB */
#define ALLOC(ty) ((struct ty *) xmalloc(sizeof(struct ty)))
diff --git a/usr.sbin/amd/rpcx/mount.h b/usr.sbin/amd/rpcx/mount.h
index 7d47819f133..1a883c81364 100644
--- a/usr.sbin/amd/rpcx/mount.h
+++ b/usr.sbin/amd/rpcx/mount.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mount.h,v 1.6 2003/06/02 23:36:52 millert Exp $ */
+/* $OpenBSD: mount.h,v 1.7 2014/10/20 02:33:42 guenther Exp $ */
/*
* Copyright (c) 1990 Jan-Simon Pendry
@@ -39,14 +39,6 @@
#define MNTPATHLEN 1024
#define MNTNAMLEN 255
-#if NFS_PROTOCOL_VERSION < 3
-#define FHSIZE 32
-typedef char fhandle[FHSIZE];
-typedef struct fhstatus {
- u_int fhs_stat;
- fhandle fhs_fhandle;
-} fhstatus;
-#else
#define FHSIZE NFSX_V3FHMAX
typedef char fhandle[NFSX_V3FHMAX];
typedef struct fhstatus {
@@ -56,7 +48,6 @@ typedef struct fhstatus {
long fhs_size;
fhandle fhs_fhandle;
} fhstatus;
-#endif
bool_t xdr_fhandle();
diff --git a/usr.sbin/amd/rpcx/mount_xdr.c b/usr.sbin/amd/rpcx/mount_xdr.c
index 6c5f5f1fd9c..bc4cf4e6cfc 100644
--- a/usr.sbin/amd/rpcx/mount_xdr.c
+++ b/usr.sbin/amd/rpcx/mount_xdr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mount_xdr.c,v 1.4 2003/06/02 23:36:52 millert Exp $ */
+/* $OpenBSD: mount_xdr.c,v 1.5 2014/10/20 02:33:42 guenther Exp $ */
/*
* Copyright (c) 1989 Jan-Simon Pendry
@@ -40,33 +40,6 @@
#include "mount.h"
-#if NFS_PROTOCOL_VERSION < 3
-bool_t
-xdr_fhandle(XDR *xdrs, fhandle objp)
-{
- if (!xdr_opaque(xdrs, objp, FHSIZE)) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-bool_t
-xdr_fhstatus(XDR *xdrs, fhstatus *objp)
-{
- if (!xdr_u_int(xdrs, &objp->fhs_stat)) {
- return (FALSE);
- }
- switch (objp->fhs_stat) {
- case 0:
- if (!xdr_fhandle(xdrs, objp->fhs_fhandle)) {
- return (FALSE);
- }
- break;
- }
- return (TRUE);
-}
-
-#else
#include <nfs/rpcv2.h>
int
@@ -110,7 +83,6 @@ xdr_fhstatus(XDR *xdrsp, fhstatus *objp)
return (0);
};
}
-#endif
bool_t
xdr_dirpath(XDR *xdrs, dirpath *objp)
diff --git a/usr.sbin/amd/rpcx/nfs_prot.h b/usr.sbin/amd/rpcx/nfs_prot.h
index 8315d67c4d4..377706828c7 100644
--- a/usr.sbin/amd/rpcx/nfs_prot.h
+++ b/usr.sbin/amd/rpcx/nfs_prot.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_prot.h,v 1.4 2003/06/02 23:36:52 millert Exp $ */
+/* $OpenBSD: nfs_prot.h,v 1.5 2014/10/20 02:33:42 guenther Exp $ */
/*
* Copyright (c) 1990 Jan-Simon Pendry
@@ -36,9 +36,7 @@
* from: @(#)nfs_prot.h 8.1 (Berkeley) 6/6/93
*/
-#if NFS_PROTOCOL_VERSION >= 3
#include <nfs/nfsproto.h>
-#endif
#define xdr_nfsstat xdr_enum
#define xdr_ftype xdr_enum
@@ -61,51 +59,12 @@
#define NFSMODE_SOCK 0140000
#define NFSMODE_FIFO 0010000
-#if NFS_PROTOCOL_VERSION < 3
-enum nfsstat {
- NFS_OK = 0,
- NFSERR_PERM = 1,
- NFSERR_NOENT = 2,
- NFSERR_IO = 5,
- NFSERR_NXIO = 6,
- NFSERR_ACCES = 13,
- NFSERR_EXIST = 17,
- NFSERR_NODEV = 19,
- NFSERR_NOTDIR = 20,
- NFSERR_ISDIR = 21,
- NFSERR_FBIG = 27,
- NFSERR_NOSPC = 28,
- NFSERR_ROFS = 30,
- NFSERR_NAMETOOLONG = 63,
- NFSERR_NOTEMPTY = 66,
- NFSERR_DQUOT = 69,
- NFSERR_STALE = 70,
- NFSERR_WFLUSH = 99
-};
-typedef enum nfsstat nfsstat;
-#else
typedef int nfsstat;
-#endif
bool_t xdr_nfsstat();
-#if NFS_PROTOCOL_VERSION < 3
-enum ftype {
- NFNON = 0,
- NFREG = 1,
- NFDIR = 2,
- NFBLK = 3,
- NFCHR = 4,
- NFLNK = 5,
- NFSOCK = 6,
- NFBAD = 7,
- NFFIFO = 8
-};
-typedef enum ftype ftype;
-#else
typedef int ftype;
-#endif
/* static bool_t xdr_ftype(); */