=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/passwd/passwd.c,v retrieving revision 1.17 retrieving revision 1.18 diff -c -r1.17 -r1.18 *** src/usr.bin/passwd/passwd.c 2003/07/10 00:06:51 1.17 --- src/usr.bin/passwd/passwd.c 2003/08/04 07:29:22 1.18 *************** *** 1,4 **** ! /* $OpenBSD: passwd.c,v 1.17 2003/07/10 00:06:51 david Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. --- 1,4 ---- ! /* $OpenBSD: passwd.c,v 1.18 2003/08/04 07:29:22 hin Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. *************** *** 37,43 **** #ifndef lint /*static const char sccsid[] = "from: @(#)passwd.c 5.5 (Berkeley) 7/6/91";*/ ! static const char rcsid[] = "$OpenBSD: passwd.c,v 1.17 2003/07/10 00:06:51 david Exp $"; #endif /* not lint */ #include --- 37,43 ---- #ifndef lint /*static const char sccsid[] = "from: @(#)passwd.c 5.5 (Berkeley) 7/6/91";*/ ! static const char rcsid[] = "$OpenBSD: passwd.c,v 1.18 2003/08/04 07:29:22 hin Exp $"; #endif /* not lint */ #include *************** *** 45,53 **** #include #include #include - #ifdef KERBEROS - #include - #endif /* * Note on configuration: --- 45,50 ---- *************** *** 65,71 **** extern int local_passwd(char *, int); extern int yp_passwd(char *); - extern int krb_passwd(int, char **); extern int krb5_passwd(int, char **); extern int _yp_check(char **); void usage(int retval); --- 62,67 ---- *************** *** 80,86 **** int status = 0; #endif ! #if defined(KERBEROS) || defined(KERBEROS5) extern char realm[]; if (krb_get_lrealm(realm,1) == KSUCCESS) --- 76,82 ---- int status = 0; #endif ! #if defined(KERBEROS5) extern char realm[]; if (krb_get_lrealm(realm,1) == KSUCCESS) *************** *** 91,112 **** #endif /* Process args and options */ ! while ((ch = getopt(argc, argv, "lykK")) != -1) switch (ch) { case 'l': /* change local password file */ use_kerberos = 0; use_yp = 0; break; - case 'k': /* change Kerberos password */ - #if defined(KERBEROS) - use_kerberos = 1; - use_yp = 0; - exit(krb_passwd(argc, argv)); - break; - #else - fprintf(stderr, "passwd: Kerberos not compiled in\n"); - exit(1); - #endif case 'K': #ifdef KRB5 /* Skip programname and '-K' option */ --- 87,98 ---- #endif /* Process args and options */ ! while ((ch = getopt(argc, argv, "lyK")) != -1) switch (ch) { case 'l': /* change local password file */ use_kerberos = 0; use_yp = 0; break; case 'K': #ifdef KRB5 /* Skip programname and '-K' option */ *************** *** 148,158 **** case 0: 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); } --- 134,144 ---- case 0: break; case 1: ! #if 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); } *************** *** 162,172 **** default: usage(1); } - - #if defined(KERBEROS) || defined(KERBEROS5) - if (use_kerberos) - exit(krb_passwd(argc, argv)); - #endif #ifdef YP if (force_yp || ((status = local_passwd(username, 0)) && use_yp)) --- 148,153 ----