aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/rpc.yppasswdd/yppasswdd_main.c
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1996-06-05 06:13:09 +0000
committerBill Paul <wpaul@FreeBSD.org>1996-06-05 06:13:09 +0000
commit8b6a78c2ecfde465e04373b12b14f71c6b363b4c (patch)
tree627428a37ccfcc7fae695e0dfa4875af3910fcd1 /usr.sbin/rpc.yppasswdd/yppasswdd_main.c
parent7de385477058c1c7e1c38a619d38beb969699ec1 (diff)
downloadsrc-8b6a78c2ecfde465e04373b12b14f71c6b363b4c.tar.gz
src-8b6a78c2ecfde465e04373b12b14f71c6b363b4c.zip
Added support for in-place updates:
If rpc.yppasswdd is invoked with the -i flag, password changes will be made to the master.passwd template file and the hash map files in-place, which means it won't have to run a complete map update. Instead, it calls /var/yp/Makefile with the 'pushpw' target, which just pushes the maps to the slaves and runs yp_mkdb -c to tell the local ypserv to flush its database cache. The server will check the passwd.byname and passwd.byuid maps to see if they were built in 'insecure' or 'secure' mode (i.e. with real encrypted passwords in them or without) and update them accordingly. This combined with rpc.ypxfrd greatly reduces the amount of time it takes to complete an NIS password change, especially with very large passwd databases.
Notes
Notes: svn path=/head/; revision=16134
Diffstat (limited to 'usr.sbin/rpc.yppasswdd/yppasswdd_main.c')
-rw-r--r--usr.sbin/rpc.yppasswdd/yppasswdd_main.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/rpc.yppasswdd/yppasswdd_main.c b/usr.sbin/rpc.yppasswdd/yppasswdd_main.c
index 66da5596598e..d882b738f49a 100644
--- a/usr.sbin/rpc.yppasswdd/yppasswdd_main.c
+++ b/usr.sbin/rpc.yppasswdd/yppasswdd_main.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: yppasswdd_main.c,v 1.10 1996/02/24 21:41:15 wpaul Exp $
+ * $Id: yppasswdd_main.c,v 1.11 1996/06/03 03:21:24 wpaul Exp $
*/
#include "yppasswd.h"
@@ -72,7 +72,7 @@ struct dom_binding {};
#define _RPCSVC_CLOSEDOWN 120
#ifndef lint
-static const char rcsid[] = "$Id: yppasswdd_main.c,v 1.10 1996/02/24 21:41:15 wpaul Exp $";
+static const char rcsid[] = "$Id: yppasswdd_main.c,v 1.11 1996/06/03 03:21:24 wpaul Exp $";
#endif /* not lint */
int _rpcpmstart = 0; /* Started by a port monitor ? */
static int _rpcfdtype;
@@ -94,6 +94,7 @@ int allow_additions = 0;
int multidomain = 0;
int verbose = 0;
int resvport = 1;
+int inplace = 0;
char *yp_dir = "/var/yp/";
int yp_sock;
@@ -188,7 +189,7 @@ closedown(int sig)
static void usage()
{
fprintf(stderr, "Usage: %s [-t master.passwd file] [-d domain] \
-[-p path] [-s] [-f] [-m] [-a] [-v] [-u] [-h]\n",
+[-p path] [-s] [-f] [-m] [-i] [-a] [-v] [-u] [-h]\n",
progname);
exit(1);
}
@@ -211,7 +212,7 @@ main(argc, argv)
debug = 1;
- while ((ch = getopt(argc, argv, "t:d:p:sfamvh")) != EOF) {
+ while ((ch = getopt(argc, argv, "t:d:p:sfamivh")) != EOF) {
switch(ch) {
case 't':
passfile_default = optarg;
@@ -234,6 +235,9 @@ main(argc, argv)
case 'm':
multidomain++;
break;
+ case 'i':
+ inplace++;
+ break;
case 'v':
verbose++;
break;