diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-06-17 10:13:15 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-06-17 10:13:15 +0000 |
commit | 4fa365e5f68d2c3c6707044db9557cc80667ebe7 (patch) | |
tree | f28c89956c0a3617aa7cdf18b1f1133be83c7e10 /libexec/rpc.yppasswdd/rpc.yppasswdd.c | |
parent | 1e5d8b4f0d89c2f7dff323f6dacc2d5c47c7d54e (diff) |
Add a -d flag which takes the directory where the YP password files are.
This change makes it possible to separate the host's passwords from the ones
served to YP clients.
Diffstat (limited to 'libexec/rpc.yppasswdd/rpc.yppasswdd.c')
-rw-r--r-- | libexec/rpc.yppasswdd/rpc.yppasswdd.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libexec/rpc.yppasswdd/rpc.yppasswdd.c b/libexec/rpc.yppasswdd/rpc.yppasswdd.c index 9ff4879d59a..c092f50a3da 100644 --- a/libexec/rpc.yppasswdd/rpc.yppasswdd.c +++ b/libexec/rpc.yppasswdd/rpc.yppasswdd.c @@ -30,7 +30,7 @@ */ #ifndef LINT -static char rcsid[] = "$Id: rpc.yppasswdd.c,v 1.4 1997/04/23 09:33:43 deraadt Exp $"; +static char rcsid[] = "$Id: rpc.yppasswdd.c,v 1.5 1997/06/17 10:13:13 niklas Exp $"; #endif #include <stdio.h> @@ -41,6 +41,7 @@ static char rcsid[] = "$Id: rpc.yppasswdd.c,v 1.4 1997/04/23 09:33:43 deraadt Ex #include <sys/types.h> #include <unistd.h> #include <string.h> +#include <pwd.h> #include "yppasswd.h" @@ -51,13 +52,15 @@ int noshell, nogecos, nopw, domake; char make_arg[1024] = "make"; char *progname = "yppasswdd"; char *tempname; +char *dir; void usage() { - fprintf(stderr, "%s%s", + fprintf(stderr, "%s%s%s", "usage: rpc.yppasswdd ", - "[-noshell] [-nogecos] [-nopw] [-m arg1 arg2 ... ]\n"); + "[-d dir] [-noshell] [-nogecos] [-nopw]\n", + " [-m arg1 arg2 ... ]\n"); exit(1); } @@ -84,6 +87,10 @@ main(argc, argv) strcat(make_arg, argv[i]); i++; } + } else if (strcmp("-d", argv[i]) == 0 + && i < argc + 1) { + i++; + dir = argv[i]; } else usage(); i++; |