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

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