Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/fs/nfs/nfsservice Use the regular mountd, and include ...



details:   https://anonhg.NetBSD.org/src/rev/cabab44cd890
branches:  trunk
changeset: 341503:cabab44cd890
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Nov 08 21:05:39 2015 +0000

description:
Use the regular mountd, and include the rpcbind stuff here.

diffstat:

 tests/fs/nfs/nfsservice/Makefile             |    23 +-
 tests/fs/nfs/nfsservice/mountd.c             |  2576 --------------------------
 tests/fs/nfs/nfsservice/rpcbind/Makefile.inc |    16 -
 3 files changed, 18 insertions(+), 2597 deletions(-)

diffs (truncated from 2638 to 300 lines):

diff -r e1b2467a6ac9 -r cabab44cd890 tests/fs/nfs/nfsservice/Makefile
--- a/tests/fs/nfs/nfsservice/Makefile  Sun Nov 08 21:05:01 2015 +0000
+++ b/tests/fs/nfs/nfsservice/Makefile  Sun Nov 08 21:05:39 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.8 2015/01/08 04:00:31 pooka Exp $
+#      $NetBSD: Makefile,v 1.9 2015/11/08 21:05:39 christos Exp $
 #
 
 NOMAN= 1
@@ -27,11 +27,24 @@
 LDADD+=        -lpthread -lutil
 
 CPPFLAGS+=     -DDEBUG -DMOUNT_NOMAIN -D_REENTRANT
-CPPFLAGS+=     -DRUMP_SYS_NETWORKING
+CPPFLAGS+=     -DRUMP_SYS_NETWORKING -DMOUNTD_RUMP
+
+.PATH.c: ${NETBSDSRCDIR}/usr.sbin/mountd
+
+# RPCBIND
+.PATH.c: ${NETBSDSRCDIR}/usr.sbin/rpcbind
+SRCS.rumpnfsd+=        check_bound.c rpcb_stat.c rpcb_svc_4.c rpcbind.c pmap_svc.c \
+               rpcb_svc.c rpcb_svc_com.c security.c util.c 
 
-.PATH: ${.CURDIR}/rpcbind
-.include "rpcbind/Makefile.inc"
+LIBRPCDIR=        ${NETBSDSRCDIR}/lib/libc/rpc
+
+CPPFLAGS+=     -I${LIBRPCDIR} -DPORTMAP -DLIBWRAP -DRPCBIND_RUMP
 
-WARNS= 2
+# Uncomment these to get any useful output from 'rpcbind -d'
+# CPPFLAGS+=   -DRPCBIND_DEBUG
+# CPPFLAGS+=   -DSVC_RUN_DEBUG
+
+LDADD+= -lwrap -lutil
+DPADD+= ${LIBWRAP} ${LIBUTIL}
 
 .include <bsd.test.mk>
diff -r e1b2467a6ac9 -r cabab44cd890 tests/fs/nfs/nfsservice/mountd.c
--- a/tests/fs/nfs/nfsservice/mountd.c  Sun Nov 08 21:05:01 2015 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,2576 +0,0 @@
-/*     $NetBSD: mountd.c,v 1.11 2015/11/08 16:38:25 christos Exp $      */
-
-/*
- * Copyright (c) 1989, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Herb Hasler and Rick Macklem at The University of Guelph.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-#ifndef lint
-__COPYRIGHT("@(#) Copyright (c) 1989, 1993\
- The Regents of the University of California.  All rights reserved.");
-#endif                         /* not lint */
-
-#ifndef lint
-#if 0
-static char     sccsid[] = "@(#)mountd.c  8.15 (Berkeley) 5/1/95";
-#else
-__RCSID("$NetBSD: mountd.c,v 1.11 2015/11/08 16:38:25 christos Exp $");
-#endif
-#endif                         /* not lint */
-
-#include <sys/param.h>
-#include <sys/file.h>
-#include <sys/ioctl.h>
-#include <sys/mount.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <syslog.h>
-#include <sys/ucred.h>
-
-#include <rpc/rpc.h>
-#include <rpc/pmap_clnt.h>
-#include <rpc/pmap_prot.h>
-#include <rpcsvc/mount.h>
-#include <nfs/rpcv2.h>
-#include <nfs/nfsproto.h>
-#include <nfs/nfs.h>
-#include <nfs/nfsmount.h>
-
-#include <arpa/inet.h>
-
-#include <rump/rump.h>
-#include <rump/rump_syscalls.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <grp.h>
-#include <netdb.h>
-#include <pwd.h>
-#include <netgroup.h>
-#include <pthread.h>
-#include <semaphore.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <err.h>
-#include <util.h>
-#include "pathnames.h"
-
-#ifdef IPSEC
-#include <netinet6/ipsec.h>
-#ifndef IPSEC_POLICY_IPSEC     /* no ipsec support on old ipsec */
-#undef IPSEC
-#endif
-#include "ipsec.h"
-#endif
-
-#include "svc_fdset.h"
-
-#include <stdarg.h>
-
-/*
- * Structures for keeping the mount list and export list
- */
-struct mountlist {
-       struct mountlist *ml_next;
-       char ml_host[RPCMNT_NAMELEN + 1];
-       char ml_dirp[RPCMNT_PATHLEN + 1];
-       int ml_flag;/* XXX more flags (same as dp_flag) */
-};
-
-struct dirlist {
-       struct dirlist *dp_left;
-       struct dirlist *dp_right;
-       int dp_flag;
-       struct hostlist *dp_hosts;      /* List of hosts this dir exported to */
-       char dp_dirp[1];                /* Actually malloc'd to size of dir */
-};
-/* dp_flag bits */
-#define        DP_DEFSET       0x1
-#define DP_HOSTSET     0x2
-#define DP_KERB                0x4
-#define DP_NORESMNT    0x8
-
-struct exportlist {
-       struct exportlist *ex_next;
-       struct dirlist *ex_dirl;
-       struct dirlist *ex_defdir;
-       int             ex_flag;
-       fsid_t          ex_fs;
-       char           *ex_fsdir;
-       char           *ex_indexfile;
-};
-/* ex_flag bits */
-#define        EX_LINKED       0x1
-
-struct netmsk {
-       struct sockaddr_storage nt_net;
-       int             nt_len;
-       char           *nt_name;
-};
-
-union grouptypes {
-       struct addrinfo *gt_addrinfo;
-       struct netmsk   gt_net;
-};
-
-struct grouplist {
-       int             gr_type;
-       union grouptypes gr_ptr;
-       struct grouplist *gr_next;
-};
-/* Group types */
-#define        GT_NULL         0x0
-#define        GT_HOST         0x1
-#define        GT_NET          0x2
-
-struct hostlist {
-       int             ht_flag;/* Uses DP_xx bits */
-       struct grouplist *ht_grp;
-       struct hostlist *ht_next;
-};
-
-struct fhreturn {
-       int             fhr_flag;
-       int             fhr_vers;
-       size_t          fhr_fhsize;
-       union {
-               uint8_t v2[NFSX_V2FH];
-               uint8_t v3[NFSX_V3FHMAX];
-       } fhr_fh;
-};
-
-/* Global defs */
-static char    *add_expdir __P((struct dirlist **, char *, int));
-static void add_dlist __P((struct dirlist **, struct dirlist *,
-    struct grouplist *, int));
-static void add_mlist __P((char *, char *, int));
-static int check_dirpath __P((const char *, size_t, char *));
-static int check_options __P((const char *, size_t, struct dirlist *));
-static int chk_host __P((struct dirlist *, struct sockaddr *, int *, int *));
-static int del_mlist __P((char *, char *, struct sockaddr *));
-static struct dirlist *dirp_search __P((struct dirlist *, char *));
-static int do_nfssvc __P((const char *, size_t, struct exportlist *,
-    struct grouplist *, int, struct uucred *, char *, int, struct statvfs *));
-static int do_opt __P((const char *, size_t, char **, char **,
-    struct exportlist *, struct grouplist *, int *, int *, struct uucred *));
-static struct exportlist *ex_search __P((fsid_t *));
-static int parse_directory __P((const char *, size_t, struct grouplist *,
-    int, char *, struct exportlist **, struct statvfs *));
-static int parse_host_netgroup __P((const char *, size_t, struct exportlist *,
-    struct grouplist *, char *, int *, struct grouplist **));
-static struct exportlist *get_exp __P((void));
-static void free_dir __P((struct dirlist *));
-static void free_exp __P((struct exportlist *));
-static void free_grp __P((struct grouplist *));
-static void free_host __P((struct hostlist *));
-void get_exportlist __P((int));
-static int get_host __P((const char *, size_t, const char *,
-    struct grouplist *));
-static struct hostlist *get_ht __P((void));
-static void get_mountlist __P((void));
-static int get_net __P((char *, struct netmsk *, int));
-static void free_exp_grp __P((struct exportlist *, struct grouplist *));
-static struct grouplist *get_grp __P((void));
-static void hang_dirp __P((struct dirlist *, struct grouplist *,
-    struct exportlist *, int));
-static void mntsrv __P((struct svc_req *, SVCXPRT *));
-static void nextfield __P((char **, char **));
-static void parsecred __P((char *, struct uucred *));
-static int put_exlist __P((struct dirlist *, XDR *, struct dirlist *, int *));
-static int scan_tree __P((struct dirlist *, struct sockaddr *));
-static void send_umntall __P((int));
-#if 0
-static int umntall_each __P((caddr_t, struct sockaddr_in *));
-#endif
-static int xdr_dir __P((XDR *, char *));
-static int xdr_explist __P((XDR *, caddr_t));
-static int xdr_fhs __P((XDR *, caddr_t));
-static int xdr_mlist __P((XDR *, caddr_t));
-static int bitcmp __P((void *, void *, int));
-static int netpartcmp __P((struct sockaddr *, struct sockaddr *, int));
-static int sacmp __P((struct sockaddr *, struct sockaddr *));
-static int allones __P((struct sockaddr_storage *, int));
-static int countones __P((struct sockaddr *));
-static void bind_resv_port __P((int, sa_family_t, in_port_t));
-static void no_nfs(int);
-static struct exportlist *exphead;
-static struct mountlist *mlhead;
-static struct grouplist *grphead;
-static char    *exname;
-static struct uucred def_anon = {
-       1,
-       (uid_t) -2,
-       (gid_t) -2,
-       0,
-       { 0 }
-};
-
-static int      opt_flags;
-static int     have_v6 = 1;
-static const int ninumeric = NI_NUMERICHOST;
-
-/* Bits for above */
-#define        OP_MAPROOT      0x001
-#define        OP_MAPALL       0x002
-#define        OP_KERB         0x004
-#define        OP_MASK         0x008
-#define        OP_NET          0x010
-#define        OP_ALLDIRS      0x040
-#define OP_NORESPORT   0x080
-#define OP_NORESMNT    0x100
-#define OP_MASKLEN     0x200
-
-static int      debug = 1;
-#if 0
-static void SYSLOG __P((int, const char *,...));
-#endif
-int main __P((int, char *[]));



Home | Main Index | Thread Index | Old Index