View | Details | Raw Unified | Return to bug 169911
Collapse All | Expand All

(-)head/usr.sbin/yp_mkdb/yp_mkdb.c (-6 / +15 lines)
Lines 57-67 Link Here
57
static void
57
static void
58
usage(void)
58
usage(void)
59
{
59
{
60
	fprintf(stderr, "%s\n%s\n%s\n%s\n",
60
	fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n",
61
	"usage: yp_mkdb -c",
61
	"usage: yp_mkdb [-c | -C hostname]",
62
	"       yp_mkdb -u dbname",
62
	"       yp_mkdb -u dbname",
63
	"       yp_mkdb [-c] [-b] [-s] [-f] [-i inputfile] [-o outputfile]",
63
	"       yp_mkdb [-c | -C hostname] [-b] [-s] [-f] [-i inputfile]",
64
	"               [-d domainname ] [-m mastername] inputfile dbname");
64
	"               [-o outputfile] [-d domainname ] [-m mastername]",
65
	"               inputfile dbname");
65
	exit(1);
66
	exit(1);
66
}
67
}
67
68
Lines 105-110 Link Here
105
	char *infile = NULL;
106
	char *infile = NULL;
106
	char *map = NULL;
107
	char *map = NULL;
107
	char *domain = NULL;
108
	char *domain = NULL;
109
	char *clearhost = "localhost";
108
	char *infilename = NULL;
110
	char *infilename = NULL;
109
	char *outfilename = NULL;
111
	char *outfilename = NULL;
110
	char *mastername = NULL;
112
	char *mastername = NULL;
Lines 117-123 Link Here
117
	FILE *ifp;
119
	FILE *ifp;
118
	char hname[MAXHOSTNAMELEN + 2];
120
	char hname[MAXHOSTNAMELEN + 2];
119
121
120
	while ((ch = getopt(argc, argv, "uhcbsfd:i:o:m:")) != -1) {
122
	while ((ch = getopt(argc, argv, "uhcC:bsfd:i:o:m:")) != -1) {
121
		switch (ch) {
123
		switch (ch) {
122
		case 'f':
124
		case 'f':
123
			filter_plusminus++;
125
			filter_plusminus++;
Lines 128-133 Link Here
128
		case 'c':
130
		case 'c':
129
			clear++;
131
			clear++;
130
			break;
132
			break;
133
		case 'C':
134
			clear++;
135
			clearhost = optarg;
136
			break;
131
		case 'b':
137
		case 'b':
132
			interdom++;
138
			interdom++;
133
			break;
139
			break;
Lines 156-161 Link Here
156
	argc -= optind;
162
	argc -= optind;
157
	argv += optind;
163
	argv += optind;
158
164
165
	if (clear > 1)
166
		usage();
167
159
	if (un) {
168
	if (un) {
160
		map = argv[0];
169
		map = argv[0];
161
		if (map == NULL)
170
		if (map == NULL)
Lines 332-338 Link Here
332
		char in = 0;
341
		char in = 0;
333
		char *out = NULL;
342
		char *out = NULL;
334
		int stat;
343
		int stat;
335
		if ((stat = callrpc("localhost", YPPROG,YPVERS, YPPROC_CLEAR,
344
		if ((stat = callrpc(clearhost, YPPROG,YPVERS, YPPROC_CLEAR,
336
			(xdrproc_t)xdr_void, &in,
345
			(xdrproc_t)xdr_void, &in,
337
			(xdrproc_t)xdr_void, out)) != RPC_SUCCESS) {
346
			(xdrproc_t)xdr_void, out)) != RPC_SUCCESS) {
338
			warnx("failed to send 'clear' to local ypserv: %s",
347
			warnx("failed to send 'clear' to local ypserv: %s",
(-)head/usr.sbin/yp_mkdb/yp_mkdb.8 (-1 / +7 lines)
Lines 42-48 Link Here
42
.Nm
42
.Nm
43
.Fl u Ar dbname
43
.Fl u Ar dbname
44
.Nm
44
.Nm
45
.Op Fl c
45
.Op Fl c | Fl C Ar hostname
46
.Op Fl b
46
.Op Fl b
47
.Op Fl s
47
.Op Fl s
48
.Op Fl f
48
.Op Fl f
Lines 111-116 Link Here
111
.Nm
111
.Nm
112
will send the signal only after the new database has been successfully
112
will send the signal only after the new database has been successfully
113
created.
113
created.
114
.It Fl C
115
As
116
.Fl c
117
but send the YPPROC_CLEAR to the specified
118
.Ar hostname
119
instead.
114
.It Fl b
120
.It Fl b
115
Cause
121
Cause
116
.Nm
122
.Nm

Return to bug 169911