Blame SOURCES/nfs-utils-1.3.0-rpcidmapd-usage.patch

64c563
diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c
64c563
index aff89d1..f55d2e1 100644
64c563
--- a/utils/idmapd/idmapd.c
64c563
+++ b/utils/idmapd/idmapd.c
64c563
@@ -199,6 +199,12 @@ flush_nfsd_idmap_cache(void)
64c563
 	return ret;
64c563
 }
64c563
 
64c563
+void usage(char *progname)
64c563
+{
64c563
+	fprintf(stderr, "Usage: %s [-hfvCS] [-p path] [-c path]\n",
64c563
+		basename(progname));
64c563
+}
64c563
+
64c563
 int
64c563
 main(int argc, char **argv)
64c563
 {
64c563
@@ -225,16 +231,18 @@ main(int argc, char **argv)
64c563
 		progname = argv[0];
64c563
 	xlog_open(progname);
64c563
 
64c563
-#define GETOPTSTR "vfd:p:U:G:c:CS"
64c563
+#define GETOPTSTR "hvfd:p:U:G:c:CS"
64c563
 	opterr=0; /* Turn off error messages */
64c563
 	while ((opt = getopt(argc, argv, GETOPTSTR)) != -1) {
64c563
 		if (opt == 'c')
64c563
 			conf_path = optarg;
64c563
 		if (opt == '?') {
64c563
 			if (strchr(GETOPTSTR, optopt))
64c563
-				errx(1, "'-%c' option requires an argument.", optopt);
64c563
+				warnx("'-%c' option requires an argument.", optopt);
64c563
 			else
64c563
-				errx(1, "'-%c' is an invalid argument.", optopt);
64c563
+				warnx("'-%c' is an invalid argument.", optopt);
64c563
+			usage(progname);
64c563
+			exit(1);
64c563
 		}
64c563
 	}
64c563
 	optind = 1;
64c563
@@ -276,6 +284,9 @@ main(int argc, char **argv)
64c563
 		case 'S':
64c563
 			clientstart = 0;
64c563
 			break;
64c563
+		case 'h':
64c563
+			usage(progname);
64c563
+			exit(0);
64c563
 		default:
64c563
 			break;
64c563
 		}
64c563
diff --git a/utils/idmapd/idmapd.man b/utils/idmapd/idmapd.man
64c563
index 185cd1b..b9200c7 100644
64c563
--- a/utils/idmapd/idmapd.man
64c563
+++ b/utils/idmapd/idmapd.man
64c563
@@ -10,8 +10,11 @@
64c563
 .Sh SYNOPSIS
64c563
 .\" For a program:  program [-abc] file ...
64c563
 .Nm rpc.idmapd
64c563
-.Op Fl v
64c563
+.Op Fl h
64c563
 .Op Fl f
64c563
+.Op Fl v
64c563
+.Op Fl C
64c563
+.Op Fl S
64c563
 .Op Fl p Ar path
64c563
 .Op Fl c Ar path
64c563
 .Sh DESCRIPTION
64c563
@@ -20,8 +23,20 @@ is the NFSv4 ID <-> name mapping daemon.  It provides functionality to
64c563
 the NFSv4 kernel client and server, to which it communicates via
64c563
 upcalls, by translating user and group IDs to names, and vice versa.
64c563
 .Pp
64c563
+Note that on more recent kernels only the NFSv4 server uses
64c563
+.Nm .
64c563
+The NFSv4 client instead uses
64c563
+.Xr nfsidmap 8 ,
64c563
+and only falls back to 
64c563
+.Nm 
64c563
+if there was a problem running the
64c563
+.Xr nfsidmap 8
64c563
+program.
64c563
+.Pp
64c563
 The options are as follows:
64c563
 .Bl -tag -width Ds_imagedir
64c563
+.It Fl h
64c563
+Display usage message.
64c563
 .It Fl v
64c563
 Increases the verbosity level (can be specified multiple times).
64c563
 .It Fl f
64c563
@@ -58,7 +73,8 @@ messages to console, and with a verbosity level of 3.
64c563
 .Sh FILES
64c563
 .Pa /etc/idmapd.conf
64c563
 .Sh SEE ALSO
64c563
-.Xr idmapd.conf 5
64c563
+.Xr idmapd.conf 5 ,
64c563
+.Xr nfsidmap 8
64c563
 .\".Sh SEE ALSO
64c563
 .\".Xr nylon.conf 4
64c563
 .\" .Sh COMPATIBILITY