=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/passwd/passwd.c,v retrieving revision 1.6 retrieving revision 1.7 diff -c -r1.6 -r1.7 *** src/usr.bin/passwd/passwd.c 1997/03/27 00:30:54 1.6 --- src/usr.bin/passwd/passwd.c 1998/01/20 15:32:21 1.7 *************** *** 1,4 **** ! /* $OpenBSD: passwd.c,v 1.6 1997/03/27 00:30:54 weingart Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. --- 1,4 ---- ! /* $OpenBSD: passwd.c,v 1.7 1998/01/20 15:32:21 art Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. *************** *** 41,47 **** #ifndef lint /*static char sccsid[] = "from: @(#)passwd.c 5.5 (Berkeley) 7/6/91";*/ ! static char rcsid[] = "$OpenBSD: passwd.c,v 1.6 1997/03/27 00:30:54 weingart Exp $"; #endif /* not lint */ #include --- 41,47 ---- #ifndef lint /*static char sccsid[] = "from: @(#)passwd.c 5.5 (Berkeley) 7/6/91";*/ ! static char rcsid[] = "$OpenBSD: passwd.c,v 1.7 1998/01/20 15:32:21 art Exp $"; #endif /* not lint */ #include *************** *** 68,74 **** extern int local_passwd(char *); extern int yp_passwd(char *); ! extern int krb_passwd(void); void usage(void); --- 68,74 ---- extern int local_passwd(char *); extern int yp_passwd(char *); ! extern int krb_passwd(int, char **); void usage(void); *************** *** 92,98 **** #endif /* Process args and options */ ! while ((ch = getopt(argc, argv, "lky")) != -1) switch (ch) { case 'l': /* change local password file */ use_kerberos = 0; --- 92,98 ---- #endif /* Process args and options */ ! while ((ch = getopt(argc, argv, "lyk")) != -1) switch (ch) { case 'l': /* change local password file */ use_kerberos = 0; *************** *** 102,107 **** --- 102,108 ---- #if defined(KERBEROS) || defined(KERBEROS5) use_kerberos = 1; use_yp = 0; + exit(krb_passwd(argc, argv)); break; #else fprintf(stderr, "passwd: Kerberos not compiled in\n"); *************** *** 140,152 **** break; case 1: #if defined(KERBEROS) || defined(KERBEROS5) ! if (use_kerberos && strcmp(argv[0], username)) { ! (void)fprintf(stderr, "passwd: %s\n\t%s\n%s\n", ! "to change another user's Kerberos password, do", ! "\"kinit ; passwd; kdestroy\";", ! "to change a user's local passwd, use \"passwd -l \""); ! exit(1); ! } #endif username = argv[0]; break; --- 141,153 ---- break; case 1: #if defined(KERBEROS) || defined(KERBEROS5) ! if (use_kerberos && strcmp(argv[0], username)) { ! (void)fprintf(stderr, "passwd: %s\n\t%s\n%s\n", ! "to change another user's Kerberos password, do", ! "\"passwd -k -u \";", ! "to change a user's local passwd, use \"passwd -l \""); ! exit(1); ! } #endif username = argv[0]; break; *************** *** 156,164 **** } #if defined(KERBEROS) || defined(KERBEROS5) ! if (use_kerberos) ! exit(krb_passwd()); #endif #ifdef YP if (force_yp || ((status = local_passwd(username)) && use_yp)) exit(yp_passwd(username)); --- 157,166 ---- } #if defined(KERBEROS) || defined(KERBEROS5) ! if (use_kerberos) ! exit(krb_passwd(argc, argv)); #endif + #ifdef YP if (force_yp || ((status = local_passwd(username)) && use_yp)) exit(yp_passwd(username)); *************** *** 170,174 **** void usage(void) { ! fprintf(stderr, "usage: passwd [-l] [-k] [-y] user\n"); } --- 172,176 ---- void usage(void) { ! fprintf(stderr, "usage: passwd [-l] [-y] [-k [-n name] [-i instance] [-r realm] [-u username[.instance][@realm]] [user]\n"); }