changeset 5655:2b4de7c11b38

6397024 nfs umount command has incorrect usage message
author th199096
date Sat, 08 Dec 2007 07:06:37 -0800
parents f880529472a6
children f4e79a736a87
files usr/src/Targetdirs usr/src/cmd/fs.d/nfs/mount/mount.c usr/src/cmd/fs.d/nfs/umount/umount.c usr/src/lib/librpcsvc/Makefile.com usr/src/lib/librpcsvc/common/llib-lrpcsvc usr/src/lib/librpcsvc/i386/Makefile usr/src/lib/librpcsvc/sparc/Makefile usr/src/pkgdefs/SUNWarc/prototype_com usr/src/pkgdefs/SUNWarc/prototype_i386 usr/src/pkgdefs/SUNWarc/prototype_sparc usr/src/pkgdefs/SUNWarcr/prototype_com usr/src/pkgdefs/SUNWarcr/prototype_i386 usr/src/pkgdefs/SUNWarcr/prototype_sparc
diffstat 13 files changed, 110 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/Targetdirs	Fri Dec 07 19:57:28 2007 -0800
+++ b/usr/src/Targetdirs	Sat Dec 08 07:06:37 2007 -0800
@@ -18,12 +18,15 @@
 #
 # CDDL HEADER END
 #
+
 #
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
 #
+
+#
 # The list is built of owner-group combinations.  ROOT.SYS occurs twice
 # because some directories owned by root and in group sys are subdirectories
 # of directories having other owner-group attributes.
@@ -1027,6 +1030,8 @@
 $(ROOT)/usr/lib/llib-lpthread:=		REALPATH=../../lib/llib-lpthread
 $(ROOT)/usr/lib/llib-lresolv.ln:=	REALPATH=../../lib/llib-lresolv.ln
 $(ROOT)/usr/lib/llib-lresolv:=		REALPATH=../../lib/llib-lresolv
+$(ROOT)/usr/lib/llib-lrpcsvc.ln:=	REALPATH=../../lib/llib-lrpcsvc.ln
+$(ROOT)/usr/lib/llib-lrpcsvc:=		REALPATH=../../lib/llib-lrpcsvc
 $(ROOT)/usr/lib/llib-lrt.ln:=		REALPATH=../../lib/llib-lrt.ln
 $(ROOT)/usr/lib/llib-lrt:=		REALPATH=../../lib/llib-lrt
 $(ROOT)/usr/lib/llib-lrtld_db.ln:=	REALPATH=../../lib/llib-lrtld_db.ln
@@ -1362,6 +1367,8 @@
 	REALPATH=../../../lib/$(MACH64)/llib-lpthread.ln
 $(ROOT)/usr/lib/$(MACH64)/llib-lresolv.ln:= \
 	REALPATH=../../../lib/$(MACH64)/llib-lresolv.ln
+$(ROOT)/usr/lib/$(MACH64)/llib-lrpcsvc.ln:= \
+	REALPATH=../../../lib/$(MACH64)/llib-lrpcsvc.ln
 $(ROOT)/usr/lib/$(MACH64)/llib-lrt.ln:= \
 	REALPATH=../../../lib/$(MACH64)/llib-lrt.ln
 $(ROOT)/usr/lib/$(MACH64)/llib-lrtld_db.ln:= \
@@ -1607,6 +1614,8 @@
 	/usr/lib/llib-lpthread.ln \
 	/usr/lib/llib-lresolv \
 	/usr/lib/llib-lresolv.ln \
+	/usr/lib/llib-lrpcsvc \
+	/usr/lib/llib-lrpcsvc.ln \
 	/usr/lib/llib-lrt \
 	/usr/lib/llib-lrt.ln \
 	/usr/lib/llib-lrtld_db \
@@ -1802,6 +1811,7 @@
 	/usr/lib/$(MACH64)/llib-lposix4.ln \
 	/usr/lib/$(MACH64)/llib-lpthread.ln \
 	/usr/lib/$(MACH64)/llib-lresolv.ln \
+	/usr/lib/$(MACH64)/llib-lrpcsvc.ln \
 	/usr/lib/$(MACH64)/llib-lrt.ln \
 	/usr/lib/$(MACH64)/llib-lrtld_db.ln \
 	/usr/lib/$(MACH64)/llib-lscf.ln \
--- a/usr/src/cmd/fs.d/nfs/mount/mount.c	Fri Dec 07 19:57:28 2007 -0800
+++ b/usr/src/cmd/fs.d/nfs/mount/mount.c	Sat Dec 08 07:06:37 2007 -0800
@@ -18,6 +18,7 @@
  *
  * CDDL HEADER END
  */
+
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
@@ -128,7 +129,7 @@
 	{ (args)->nfs_args_ext = NFS_ARGS_EXTB, \
 	(args)->nfs_ext_u.nfs_extB.secdata = secdata; }
 
-extern int __clnt_bindresvport();
+extern int __clnt_bindresvport(CLIENT *);
 extern char *nfs_get_qop_name();
 extern AUTH * nfs_create_ah();
 extern enum snego_stat nfs_sec_nego();
--- a/usr/src/cmd/fs.d/nfs/umount/umount.c	Fri Dec 07 19:57:28 2007 -0800
+++ b/usr/src/cmd/fs.d/nfs/umount/umount.c	Sat Dec 08 07:06:37 2007 -0800
@@ -18,6 +18,7 @@
  *
  * CDDL HEADER END
  */
+
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
@@ -75,7 +76,7 @@
 static	int	nfs_unmount(char *, int);
 static	void	inform_server(char *, char *, bool_t);
 static	struct extmnttab *mnttab_find();
-extern int __clnt_bindresvport();
+extern int __clnt_bindresvport(CLIENT *);
 
 static	int is_v4_mount(struct extmnttab *);
 
@@ -98,7 +99,7 @@
 
 	myname = strrchr(argv[0], '/');
 	myname = myname ? myname+1 : argv[0];
-	(void) sprintf(typename, "nfs %s", myname);
+	(void) snprintf(typename, sizeof (typename), "nfs %s", myname);
 	argv[0] = typename;
 
 	/*
@@ -154,7 +155,7 @@
 usage()
 {
 	(void) fprintf(stderr,
-	    gettext("Usage: nfs umount [-o opts] {server:path | dir}\n"));
+	    gettext("Usage: nfs umount [-f] {server:path | dir}\n"));
 	exit(RET_ERR);
 }
 
@@ -226,7 +227,7 @@
 		}
 	}
 
-	fclose(fp);
+	(void) fclose(fp);
 	return (res);
 }
 
@@ -251,7 +252,7 @@
 	if (list == NULL) {
 		if (n < 0)
 			pr_err(gettext("%s is not hostname:path format\n"),
-				string);
+			    string);
 		else
 			pr_err(gettext("no memory\n"));
 		return;
@@ -296,7 +297,7 @@
 		 */
 		timep = (quick ? &create_timeout : NULL);
 		cl = clnt_create_timed(list[i].host, MOUNTPROG, vers,
-				"datagram_n", timep);
+		    "datagram_n", timep);
 		/*
 		 * Do not print any error messages in case of forced
 		 * unmount.
@@ -305,7 +306,7 @@
 			if (!quick)
 				pr_err("%s:%s %s\n", list[i].host, list[i].path,
 				    clnt_spcreateerror(
-					"server not responding"));
+				    "server not responding"));
 			continue;
 		}
 		/*
@@ -334,8 +335,8 @@
 		clnt_control(cl, CLSET_RETRY_TIMEOUT, (char *)&timeout);
 		timeout.tv_sec = 25;
 		rpc_stat = clnt_call(cl, MOUNTPROC_UMNT, xdr_dirpath,
-			(char *)&list[i].path, xdr_void, (char *)NULL,
-			timeout);
+		    (char *)&list[i].path, xdr_void, (char *)NULL,
+		    timeout);
 		AUTH_DESTROY(cl->cl_auth);
 		clnt_destroy(cl);
 		if (rpc_stat == RPC_PROGVERSMISMATCH && vers == MOUNTVERS) {
@@ -361,7 +362,6 @@
 {
 	kstat_ctl_t *kc = NULL;		/* libkstat cookie */
 	kstat_t *ksp;
-	ulong_t fsid;
 	struct mntinfo_kstat mik;
 
 	if (mntp == NULL)
--- a/usr/src/lib/librpcsvc/Makefile.com	Fri Dec 07 19:57:28 2007 -0800
+++ b/usr/src/lib/librpcsvc/Makefile.com	Sat Dec 08 07:06:37 2007 -0800
@@ -18,8 +18,9 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -45,9 +46,12 @@
 	$(COMPILE.c) -o $@ $<
 	$(POST_PROCESS_O)
 
-LIBS = $(DYNLIB)
+LIBS = $(DYNLIB) $(LINTLIB)
 
 CPPFLAGS += -DYP
+
+$(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC)
+
 LDLIBS += -lnsl -lc
 
 .KEEP_STATE:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/librpcsvc/common/llib-lrpcsvc	Sat Dec 08 07:06:37 2007 -0800
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident	"%Z%%M%	%I%	%E% SMI"
+
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+#include <rpcsvc/autofs_prot.h>
+#include <rpcsvc/bootparam_prot.h>
+#include <rpcsvc/mount.h>
+#include <rpcsvc/nfs4_prot.h>
+#include <rpcsvc/nlm_prot.h>
+#include <rpcsvc/rpc_sztypes.h>
+#include <rpcsvc/rstat.h>
+#include <rpcsvc/ufs_prot.h>
+
+extern int __clnt_bindresvport(CLIENT *);
+
--- a/usr/src/lib/librpcsvc/i386/Makefile	Fri Dec 07 19:57:28 2007 -0800
+++ b/usr/src/lib/librpcsvc/i386/Makefile	Sat Dec 08 07:06:37 2007 -0800
@@ -18,8 +18,9 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -29,4 +30,4 @@
 
 all: $(LIBS)
 
-install: all $(ROOTLIBS) $(ROOTLINKS)
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
--- a/usr/src/lib/librpcsvc/sparc/Makefile	Fri Dec 07 19:57:28 2007 -0800
+++ b/usr/src/lib/librpcsvc/sparc/Makefile	Sat Dec 08 07:06:37 2007 -0800
@@ -18,8 +18,9 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -29,4 +30,4 @@
 
 all: $(LIBS)
 
-install: all $(ROOTLIBS) $(ROOTLINKS)
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
--- a/usr/src/pkgdefs/SUNWarc/prototype_com	Fri Dec 07 19:57:28 2007 -0800
+++ b/usr/src/pkgdefs/SUNWarc/prototype_com	Sat Dec 08 07:06:37 2007 -0800
@@ -17,19 +17,21 @@
 # information: Portions Copyright [yyyy] [name of copyright owner]
 #
 # CDDL HEADER END
-
+#
 
 #
-#
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
 #
+
+#
 # This required package information file contains a list of package contents.
 # The 'pkgmk' command uses this file to identify the contents of a package
 # and their location on the development machine when building the package.
 # Can be created via a text editor or through use of the 'pkgproto' command.
+#
 
 #!search <pathname pathname ...>	# where to find pkg objects
 #!include <filename>			# include another 'prototype' file
@@ -161,6 +163,8 @@
 f none usr/lib/llib-lrcm.ln 644 root bin
 s none usr/lib/llib-lresolv=../../lib/llib-lresolv
 s none usr/lib/llib-lresolv.ln=../../lib/llib-lresolv.ln
+s none usr/lib/llib-lrpcsvc=../../lib/llib-lrpcsvc
+s none usr/lib/llib-lrpcsvc.ln=../../lib/llib-lrpcsvc.ln
 s none usr/lib/llib-lrt=../../lib/llib-lrt
 s none usr/lib/llib-lrt.ln=../../lib/llib-lrt.ln
 s none usr/lib/llib-lrtld_db=../../lib/llib-lrtld_db
--- a/usr/src/pkgdefs/SUNWarc/prototype_i386	Fri Dec 07 19:57:28 2007 -0800
+++ b/usr/src/pkgdefs/SUNWarc/prototype_i386	Sat Dec 08 07:06:37 2007 -0800
@@ -17,19 +17,21 @@
 # information: Portions Copyright [yyyy] [name of copyright owner]
 #
 # CDDL HEADER END
-
+#
 
 #
-#
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Use is subject to license terms.`
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
 #
+
+#
 # This required package information file contains a list of package contents.
 # The 'pkgmk' command uses this file to identify the contents of a package
 # and their location on the development machine when building the package.
 # Can be created via a text editor or through use of the 'pkgproto' command.
+#
 
 #!search <pathname pathname ...>	# where to find pkg objects
 #!include <filename>			# include another 'prototype' file
@@ -118,6 +120,7 @@
 f none usr/lib/amd64/llib-l450.ln 644 root bin
 s none usr/lib/amd64/llib-lpthread.ln=../../../lib/amd64/llib-lpthread.ln
 s none usr/lib/amd64/llib-lresolv.ln=../../../lib/amd64/llib-lresolv.ln
+s none usr/lib/amd64/llib-lrpcsvc.ln=../../../lib/amd64/llib-lrpcsvc.ln
 s none usr/lib/amd64/llib-lrt.ln=../../../lib/amd64/llib-lrt.ln
 s none usr/lib/amd64/llib-lrtld_db.ln=../../../lib/amd64/llib-lrtld_db.ln
 f none usr/lib/amd64/llib-lpasswdutil.ln 644 root bin
--- a/usr/src/pkgdefs/SUNWarc/prototype_sparc	Fri Dec 07 19:57:28 2007 -0800
+++ b/usr/src/pkgdefs/SUNWarc/prototype_sparc	Sat Dec 08 07:06:37 2007 -0800
@@ -17,19 +17,21 @@
 # information: Portions Copyright [yyyy] [name of copyright owner]
 #
 # CDDL HEADER END
-
+#
 
 #
-#
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
 #
+
+#
 # This required package information file contains a list of package contents.
 # The 'pkgmk' command uses this file to identify the contents of a package
 # and their location on the development machine when building the package.
 # Can be created via a text editor or through use of the 'pkgproto' command.
+#
 
 #!search <pathname pathname ...>	# where to find pkg objects
 #!include <filename>			# include another 'prototype' file
@@ -114,6 +116,7 @@
 f none usr/lib/sparcv9/llib-l450.ln 644 root bin
 s none usr/lib/sparcv9/llib-lpthread.ln=../../../lib/sparcv9/llib-lpthread.ln
 s none usr/lib/sparcv9/llib-lresolv.ln=../../../lib/sparcv9/llib-lresolv.ln
+s none usr/lib/sparcv9/llib-lrpcsvc.ln=../../../lib/sparcv9/llib-lrpcsvc.ln
 s none usr/lib/sparcv9/llib-lrt.ln=../../../lib/sparcv9/llib-lrt.ln
 s none usr/lib/sparcv9/llib-lrtld_db.ln=../../../lib/sparcv9/llib-lrtld_db.ln
 s none usr/lib/sparcv9/llib-lposix4.ln=../../../lib/sparcv9/llib-lrt.ln
--- a/usr/src/pkgdefs/SUNWarcr/prototype_com	Fri Dec 07 19:57:28 2007 -0800
+++ b/usr/src/pkgdefs/SUNWarcr/prototype_com	Sat Dec 08 07:06:37 2007 -0800
@@ -17,19 +17,21 @@
 # information: Portions Copyright [yyyy] [name of copyright owner]
 #
 # CDDL HEADER END
-
+#
 
 #
-#
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
 #
+
+#
 # This required package information file contains a list of package contents.
 # The 'pkgmk' command uses this file to identify the contents of a package
 # and their location on the development machine when building the package.
 # Can be created via a text editor or through use of the 'pkgproto' command.
+#
 
 #!search <pathname pathname ...>	# where to find pkg objects
 #!include <filename>			# include another 'prototype' file
@@ -100,6 +102,8 @@
 f none lib/llib-lpthread.ln 644 root bin
 f none lib/llib-lresolv 644 root bin
 f none lib/llib-lresolv.ln 644 root bin
+f none lib/llib-lrpcsvc 644 root bin
+f none lib/llib-lrpcsvc.ln 644 root bin
 f none lib/llib-lrt 644 root bin
 f none lib/llib-lrt.ln 644 root bin
 f none lib/llib-lrtld_db 644 root bin
--- a/usr/src/pkgdefs/SUNWarcr/prototype_i386	Fri Dec 07 19:57:28 2007 -0800
+++ b/usr/src/pkgdefs/SUNWarcr/prototype_i386	Sat Dec 08 07:06:37 2007 -0800
@@ -17,19 +17,21 @@
 # information: Portions Copyright [yyyy] [name of copyright owner]
 #
 # CDDL HEADER END
-
+#
 
 #
-#
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
 #
+
+#
 # This required package information file contains a list of package contents.
 # The 'pkgmk' command uses this file to identify the contents of a package
 # and their location on the development machine when building the package.
 # Can be created via a text editor or through use of the 'pkgproto' command.
+#
 
 #!search <pathname pathname ...>	# where to find pkg objects
 #!include <filename>			# include another 'prototype' file
@@ -79,6 +81,7 @@
 s none lib/amd64/llib-lposix4.ln=./llib-lrt.ln
 f none lib/amd64/llib-lpthread.ln 644 root bin
 f none lib/amd64/llib-lresolv.ln 644 root  bin
+f none lib/amd64/llib-lrpcsvc.ln 644 root  bin
 f none lib/amd64/llib-lrt.ln 644 root  bin
 f none lib/amd64/llib-lrtld_db.ln 644 root  bin
 f none lib/amd64/llib-lscf.ln 644 root bin
--- a/usr/src/pkgdefs/SUNWarcr/prototype_sparc	Fri Dec 07 19:57:28 2007 -0800
+++ b/usr/src/pkgdefs/SUNWarcr/prototype_sparc	Sat Dec 08 07:06:37 2007 -0800
@@ -17,19 +17,21 @@
 # information: Portions Copyright [yyyy] [name of copyright owner]
 #
 # CDDL HEADER END
-
+#
 
 #
-#
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
 #
+
+#
 # This required package information file contains a list of package contents.
 # The 'pkgmk' command uses this file to identify the contents of a package
 # and their location on the development machine when building the package.
 # Can be created via a text editor or through use of the 'pkgproto' command.
+#
 
 #!search <pathname pathname ...>	# where to find pkg objects
 #!include <filename>			# include another 'prototype' file
@@ -79,6 +81,7 @@
 s none lib/sparcv9/llib-lposix4.ln=./llib-lrt.ln
 f none lib/sparcv9/llib-lpthread.ln 644 root bin
 f none lib/sparcv9/llib-lresolv.ln 644 root  bin
+f none lib/sparcv9/llib-lrpcsvc.ln 644 root  bin
 f none lib/sparcv9/llib-lrt.ln 644 root  bin
 f none lib/sparcv9/llib-lrtld_db.ln 644 root  bin
 f none lib/sparcv9/llib-lscf.ln 0644 root bin