[Midnightbsd-cvs] src: usr.sbin/mount_portalfs: merge

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Nov 23 17:22:08 EST 2008


Log Message:
-----------
merge

Modified Files:
--------------
    src/usr.sbin/mount_portalfs:
        Makefile (r1.1.1.1 -> r1.2)
        activate.c (r1.1.1.1 -> r1.2)
        conf.c (r1.1.1.1 -> r1.2)
        mount_portalfs.c (r1.1.1.1 -> r1.2)
        portald.h (r1.1.1.1 -> r1.2)
        pt_exec.c (r1.1.1.1 -> r1.2)
        pt_file.c (r1.1.1.1 -> r1.2)
        pt_pipe.c (r1.1.1.1 -> r1.2)
        pt_tcp.c (r1.1.1.1 -> r1.2)
        pt_tcplisten.c (r1.1.1.1 -> r1.2)

-------------- next part --------------
Index: pt_tcplisten.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/mount_portalfs/pt_tcplisten.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L usr.sbin/mount_portalfs/pt_tcplisten.c -L usr.sbin/mount_portalfs/pt_tcplisten.c -u -r1.1.1.1 -r1.2
--- usr.sbin/mount_portalfs/pt_tcplisten.c
+++ usr.sbin/mount_portalfs/pt_tcplisten.c
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/pt_tcplisten.c,v 1.4 2004/08/07 04:27:50 imp Exp $");
+__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/pt_tcplisten.c,v 1.5 2007/01/20 21:35:11 rodrigc Exp $");
 
 #include <stdio.h>
 #include <unistd.h>
@@ -67,12 +67,8 @@
  * 	 may cause remote auth (identd) to return unexpected results.
  *
  */
-int portal_tcplisten(pcr, key, v, kso, fdp)
-       struct portal_cred *pcr;
-       char *key;
-       char **v;
-       int kso;
-       int *fdp;
+int portal_tcplisten(struct portal_cred *pcr, char *key, char **v,
+    int kso __unused, int *fdp)
 {
        char host[MAXHOSTNAMELEN];
        char port[MAXHOSTNAMELEN];
@@ -80,7 +76,7 @@
        char *q;
        struct hostent *hp;
        struct servent *sp;
-       struct in_addr **ipp;
+       struct in_addr **ipp = NULL;
        struct in_addr *ip[2];
        struct in_addr ina;
        u_short s_port;
@@ -88,7 +84,7 @@
        struct sockaddr_in sain;
 
        q = strchr(p, '/');
-       if (q == 0 || q - p >= sizeof(host))
+       if (q == 0 || q - p >= (int)sizeof(host))
                return (EINVAL);
        *q = '\0';
        snprintf(host, sizeof(host), "%s", p);
Index: pt_pipe.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/mount_portalfs/pt_pipe.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L usr.sbin/mount_portalfs/pt_pipe.c -L usr.sbin/mount_portalfs/pt_pipe.c -u -r1.1.1.1 -r1.2
--- usr.sbin/mount_portalfs/pt_pipe.c
+++ usr.sbin/mount_portalfs/pt_pipe.c
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/pt_pipe.c,v 1.2 2005/03/11 08:39:58 dds Exp $");
+__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/pt_pipe.c,v 1.3 2007/01/20 21:35:11 rodrigc Exp $");
 
 #include <ctype.h>
 #include <errno.h>
@@ -48,12 +48,8 @@
 static int  errlog(void);
 static int  parse_argv(char *args, char **argv);
 
-int portal_pipe(pcr, key, v, so, fdp)
-struct portal_cred *pcr;
-char *key;
-char **v;
-int so;
-int *fdp;
+int portal_pipe(struct portal_cred *pcr, char *key, char **v,
+    int kso __unused, int *fdp)
 {
 	int fd[2];		/* Pipe endpoints. */
 	int caller_end;		/* The pipe end we will use. */
Index: activate.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/mount_portalfs/activate.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L usr.sbin/mount_portalfs/activate.c -L usr.sbin/mount_portalfs/activate.c -u -r1.1.1.1 -r1.2
--- usr.sbin/mount_portalfs/activate.c
+++ usr.sbin/mount_portalfs/activate.c
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/activate.c,v 1.11 2005/05/11 02:47:54 jmallett Exp $");
+__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/activate.c,v 1.12 2007/01/20 21:35:11 rodrigc Exp $");
 
 #include <errno.h>
 #include <string.h>
@@ -51,12 +51,8 @@
  * Scan the providers list and call the
  * appropriate function.
  */
-static int activate_argv(pcr, key, v, so, fdp)
-struct portal_cred *pcr;
-char *key;
-char **v;
-int so;
-int *fdp;
+static int activate_argv(struct portal_cred *pcr, char *key, char **v, int so,
+    int *fdp)
 {
 	provider *pr;
 
@@ -67,11 +63,7 @@
 	return (ENOENT);
 }
 
-static int get_request(so, pcr, key, klen)
-int so;
-struct portal_cred *pcr;
-char *key;
-int klen;
+static int get_request(int so, struct portal_cred *pcr, char *key, int klen)
 {
 	struct iovec iov[2];
 	struct msghdr msg;
@@ -90,7 +82,7 @@
 	if (n < 0)
 		return (errno);
 
-	if (n <= sizeof(*pcr))
+	if (n <= (int)sizeof(*pcr))
 		return (EINVAL);
 
 	n -= sizeof(*pcr);
@@ -99,10 +91,7 @@
 	return (0);
 }
 
-static void send_reply(so, fd, error)
-int so;
-int fd;
-int error;
+static void send_reply(int so, int fd, int error)
 {
 	int n;
 	struct iovec iov;
@@ -158,9 +147,7 @@
 	(void) close(fd);
 }
 
-void activate(q, so)
-qelem *q;
-int so;
+void activate(qelem *q, int so)
 {
 	struct portal_cred pcred;
 	char key[MAXPATHLEN+1];
Index: pt_tcp.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/mount_portalfs/pt_tcp.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L usr.sbin/mount_portalfs/pt_tcp.c -L usr.sbin/mount_portalfs/pt_tcp.c -u -r1.1.1.1 -r1.2
--- usr.sbin/mount_portalfs/pt_tcp.c
+++ usr.sbin/mount_portalfs/pt_tcp.c
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/pt_tcp.c,v 1.12 2004/08/07 04:27:50 imp Exp $");
+__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/pt_tcp.c,v 1.13 2007/01/20 21:35:11 rodrigc Exp $");
 
 #include <errno.h>
 #include <stdlib.h>
@@ -57,12 +57,8 @@
  * Some trailing suffix values have special meanings.
  * An unrecognized suffix is an error.
  */
-int portal_tcp(pcr, key, v, kso, fdp)
-	struct portal_cred *pcr;
-	char *key;
-	char **v;
-	int kso;
-	int *fdp;
+int portal_tcp(struct portal_cred *pcr, char *key, char **v,
+    int kso __unused, int *fdp)
 {
 	char host[MAXHOSTNAMELEN];
 	char port[MAXHOSTNAMELEN];
@@ -78,7 +74,7 @@
 	struct sockaddr_in sain;
 
 	q = strchr(p, '/');
-	if (q == 0 || q - p >= sizeof(host))
+	if (q == 0 || q - p >= (int)sizeof(host))
 		return (EINVAL);
 	*q = '\0';
 	strcpy(host, p);
Index: pt_exec.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/mount_portalfs/pt_exec.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L usr.sbin/mount_portalfs/pt_exec.c -L usr.sbin/mount_portalfs/pt_exec.c -u -r1.1.1.1 -r1.2
--- usr.sbin/mount_portalfs/pt_exec.c
+++ usr.sbin/mount_portalfs/pt_exec.c
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/pt_exec.c,v 1.7 2004/08/07 04:27:50 imp Exp $");
+__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/pt_exec.c,v 1.8 2007/01/20 21:35:11 rodrigc Exp $");
 
 #include <errno.h>
 #include <sys/types.h>
@@ -42,12 +42,8 @@
 
 #include "portald.h"
 
-int portal_exec(pcr, key, v, so, fdp)
-struct portal_cred *pcr;
-char *key;
-char **v;
-int so;
-int *fdp;
+int portal_exec(struct portal_cred *pcr __unused, char *key __unused,
+    char **v __unused, int so __unused, int *fdp __unused)
 {
 	return (ENOEXEC);
 }
Index: conf.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/mount_portalfs/conf.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L usr.sbin/mount_portalfs/conf.c -L usr.sbin/mount_portalfs/conf.c -u -r1.1.1.1 -r1.2
--- usr.sbin/mount_portalfs/conf.c
+++ usr.sbin/mount_portalfs/conf.c
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/conf.c,v 1.10 2004/08/07 04:27:50 imp Exp $");
+__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/conf.c,v 1.11 2007/01/20 21:35:11 rodrigc Exp $");
 
 #include <errno.h>
 #include <limits.h>
@@ -70,8 +70,7 @@
  * Add an element to a 2-way list,
  * just after (pred)
  */
-static void ins_que(elem, pred)
-qelem *elem, *pred;
+static void ins_que(qelem *elem, qelem *pred)
 {
 	qelem *p = pred->q_forw;
 	elem->q_back = pred;
@@ -83,8 +82,7 @@
 /*
  * Remove an element from a 2-way list
  */
-static void rem_que(elem)
-qelem *elem;
+static void rem_que(qelem *elem)
 {
 	qelem *p = elem->q_forw;
 	qelem *p2 = elem->q_back;
@@ -95,8 +93,7 @@
 /*
  * Error checking malloc
  */
-static void *xmalloc(siz)
-unsigned siz;
+static void *xmalloc(unsigned siz)
 {
 	void *p = malloc(siz);
 	if (p)
@@ -112,9 +109,7 @@
  * not found then the path is added to the end of the list
  * and 1 is returned.
  */
-static int pinsert(p0, q0)
-path *p0;
-qelem *q0;
+static int pinsert(path *p0, qelem *q0)
 {
 	qelem *q;
 
@@ -131,9 +126,7 @@
 
 }
 
-static path *palloc(cline, lno)
-char *cline;
-int lno;
+static path *palloc(char *cline, int lno)
 {
 	int c;
 	char *s;
@@ -219,8 +212,7 @@
 /*
  * Free a path structure
  */
-static void pfree(p)
-path *p;
+static void pfree(path *p)
 {
 	free(p->p_args);
 	if (p->p_rxvalid) {
@@ -234,9 +226,7 @@
  * Discard all currently held path structures on q0.
  * and add all the ones on xq.
  */
-static void preplace(q0, xq)
-qelem *q0;
-qelem *xq;
+static void preplace(qelem *q0, qelem *xq)
 {
 	/*
 	 * While the list is not empty,
@@ -259,9 +249,7 @@
  * Read the lines from the configuration file and
  * add them to the list of paths.
  */
-static void readfp(q0, fp)
-qelem *q0;
-FILE *fp;
+static void readfp(qelem *q0, FILE *fp)
 {
 	char cline[LINE_MAX];
 	int nread = 0;
@@ -296,9 +284,7 @@
  * the existing path list with the new version.
  * If the file is not readable, then no changes take place
  */
-void conf_read(q, conf)
-qelem *q;
-char *conf;
+void conf_read(qelem *q, char *conf)
 {
 	FILE *fp = fopen(conf, "r");
 	if (fp) {
@@ -312,9 +298,7 @@
 }
 
 
-char **conf_match(q0, key)
-qelem *q0;
-char *key;
+char **conf_match(qelem *q0, char *key)
 {
 	qelem *q;
 
Index: mount_portalfs.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/mount_portalfs/mount_portalfs.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L usr.sbin/mount_portalfs/mount_portalfs.c -L usr.sbin/mount_portalfs/mount_portalfs.c -u -r1.1.1.1 -r1.2
--- usr.sbin/mount_portalfs/mount_portalfs.c
+++ usr.sbin/mount_portalfs/mount_portalfs.c
@@ -41,7 +41,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/mount_portalfs.c,v 1.23 2005/03/11 07:50:09 dds Exp $");
+__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/mount_portalfs.c,v 1.24 2007/01/20 21:35:11 rodrigc Exp $");
 
 #include <sys/param.h>
 #include <sys/wait.h>
@@ -65,21 +65,19 @@
 
 struct mntopt mopts[] = {
 	MOPT_STDOPTS,
-	{ NULL }
+	MOPT_END
 };
 
 static void usage(void) __dead2;
 
 static sig_atomic_t readcf;	/* Set when SIGHUP received */
 
-static void sighup(sig)
-int sig;
+static void sighup(int sig __unused)
 {
 	readcf ++;
 }
 
-static void sigchld(sig)
-int sig;
+static void sigchld(int sig __unused)
 {
 	pid_t pid;
 
@@ -93,9 +91,7 @@
 }
 
 int
-main(argc, argv)
-	int argc;
-	char *argv[];
+main(int argc, char *argv[])
 {
 	struct portal_args args;
 	struct sockaddr_un un;
@@ -206,7 +202,6 @@
 		int so2;
 		pid_t pid;
 		fd_set fdset;
-		int rc;
 
 		/*
 		 * Check whether we need to re-read the configuration file
Index: portald.h
===================================================================
RCS file: /home/cvs/src/usr.sbin/mount_portalfs/portald.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L usr.sbin/mount_portalfs/portald.h -L usr.sbin/mount_portalfs/portald.h -u -r1.1.1.1 -r1.2
--- usr.sbin/mount_portalfs/portald.h
+++ usr.sbin/mount_portalfs/portald.h
@@ -32,7 +32,7 @@
  *
  *	@(#)portald.h	8.1 (Berkeley) 6/5/93
  *
- * $FreeBSD: src/usr.sbin/mount_portalfs/portald.h,v 1.10 2005/03/11 08:39:58 dds Exp $
+ * $FreeBSD: src/usr.sbin/mount_portalfs/portald.h,v 1.11 2007/01/20 21:35:11 rodrigc Exp $
  */
 
 #include <sys/cdefs.h>
@@ -54,7 +54,7 @@
 
 typedef struct provider provider;
 struct provider {
-	char *pr_match;
+	const char *pr_match;
 	int (*pr_func)(struct portal_cred *,
 				char *key, char **v, int so, int *fdp);
 };
Index: pt_file.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/mount_portalfs/pt_file.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L usr.sbin/mount_portalfs/pt_file.c -L usr.sbin/mount_portalfs/pt_file.c -u -r1.1.1.1 -r1.2
--- usr.sbin/mount_portalfs/pt_file.c
+++ usr.sbin/mount_portalfs/pt_file.c
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/pt_file.c,v 1.12 2005/05/20 12:57:01 charnier Exp $");
+__FBSDID("$FreeBSD: src/usr.sbin/mount_portalfs/pt_file.c,v 1.13 2007/01/20 21:35:11 rodrigc Exp $");
 
 #include <errno.h>
 #include <fcntl.h>
@@ -46,12 +46,8 @@
 
 #include "portald.h"
 
-int portal_file(pcr, key, v, so, fdp)
-struct portal_cred *pcr;
-char *key;
-char **v;
-int so;
-int *fdp;
+int portal_file(struct portal_cred *pcr,
+    char *key, char **v, int so __unused, int *fdp)
 {
 	int fd;
 	char pbuf[MAXPATHLEN];
Index: Makefile
===================================================================
RCS file: /home/cvs/src/usr.sbin/mount_portalfs/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L usr.sbin/mount_portalfs/Makefile -L usr.sbin/mount_portalfs/Makefile -u -r1.1.1.1 -r1.2
--- usr.sbin/mount_portalfs/Makefile
+++ usr.sbin/mount_portalfs/Makefile
@@ -1,5 +1,5 @@
 #	From: @(#)Makefile	8.3 (Berkeley) 3/27/94
-# $FreeBSD: src/usr.sbin/mount_portalfs/Makefile,v 1.19 2005/03/11 08:39:58 dds Exp $
+# $FreeBSD: src/usr.sbin/mount_portalfs/Makefile,v 1.21 2007/01/20 23:24:11 rodrigc Exp $
 
 PROG=	mount_portalfs
 SRCS=	mount_portalfs.c activate.c conf.c cred.c getmntopts.c pt_conf.c \
@@ -8,7 +8,7 @@
 
 MOUNT=	${.CURDIR}/../../sbin/mount
 CFLAGS+=-I${MOUNT}
-WARNS?=	0
+WARNS?=	3
 
 .PATH:	${MOUNT}
 


More information about the Midnightbsd-cvs mailing list