Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/passwd Separate kerberos5 implementation from kerber...
details: https://anonhg.NetBSD.org/src/rev/a1e96aed427e
branches: trunk
changeset: 481316:a1e96aed427e
user: aidan <aidan%NetBSD.org@localhost>
date: Wed Jan 26 01:18:48 2000 +0000
description:
Separate kerberos5 implementation from kerberos4.
diffstat:
usr.bin/passwd/extern.h | 3 ++-
usr.bin/passwd/passwd.c | 28 ++++++++++++++++++----------
2 files changed, 20 insertions(+), 11 deletions(-)
diffs (95 lines):
diff -r 315369eb99c6 -r a1e96aed427e usr.bin/passwd/extern.h
--- a/usr.bin/passwd/extern.h Wed Jan 26 01:06:03 2000 +0000
+++ b/usr.bin/passwd/extern.h Wed Jan 26 01:18:48 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.5 1997/10/19 12:29:35 lukem Exp $ */
+/* $NetBSD: extern.h,v 1.6 2000/01/26 01:18:48 aidan Exp $ */
/*
* Copyright (c) 1994
@@ -36,6 +36,7 @@
*/
int kadm_passwd __P((char *, char *, char *, char *));
+int kadm5_passwd __P((char *));
int krb_check __P((void));
int krb_passwd __P((void));
int local_passwd __P((char *));
diff -r 315369eb99c6 -r a1e96aed427e usr.bin/passwd/passwd.c
--- a/usr.bin/passwd/passwd.c Wed Jan 26 01:06:03 2000 +0000
+++ b/usr.bin/passwd/passwd.c Wed Jan 26 01:18:48 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: passwd.c,v 1.14 1999/08/26 07:33:16 marc Exp $ */
+/* $NetBSD: passwd.c,v 1.15 2000/01/26 01:18:48 aidan Exp $ */
/*
* Copyright (c) 1988, 1993, 1994
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "from: @(#)passwd.c 8.3 (Berkeley) 4/2/94";
#else
-__RCSID("$NetBSD: passwd.c,v 1.14 1999/08/26 07:33:16 marc Exp $");
+__RCSID("$NetBSD: passwd.c,v 1.15 2000/01/26 01:18:48 aidan Exp $");
#endif
#endif /* not lint */
@@ -83,9 +83,14 @@
extern int optind;
int ch;
char *username;
+#if defined(KERBEROS)
+ char *iflag = 0, *rflag = 0;
+#endif
#if defined(KERBEROS) || defined(KERBEROS5)
- char *iflag = 0, *rflag = 0, *uflag = 0;
+ char *uflag = 0;
+#endif
+#if defined(KERBEROS) || defined(KERBEROS5)
if (strcmp(__progname, "kpasswd") == 0)
use_kerberos = 1;
else
@@ -121,6 +126,8 @@
case 'r':
rflag = optarg;
break;
+#endif
+#if defined(KERBEROS) || defined(KERBEROS5)
case 'u':
uflag = optarg;
break;
@@ -136,8 +143,11 @@
#ifndef KERBEROS
case 'i':
case 'r':
+ errx(1, "Kerberos4 support not compiled in.");
+#endif
+#if !defined(KERBEROS) && !defined(KERBEROS5)
case 'u':
- errx(1, "Kerberos4 support not compiled in.");
+ errx(1, "Kerberos support not compiled in.");
#endif
case 'y': /* change YP password */
#ifdef YP
@@ -182,17 +192,15 @@
exit(1);
}
-#if defined(KERBEROS) || defined(KERBEROS5)
+#if defined(KERBEROS5)
+ if (use_kerberos)
+ exit(kadm5_passwd(username));
+#elif defined(KERBEROS)
if (uflag && (iflag || rflag))
errx(1, "-u cannot be used with -r or -i");
if (use_kerberos)
exit(kadm_passwd(username, iflag, rflag, uflag));
-#else
-#ifdef KERBEROS5
- if (use_kerberos)
- exit(krb_passwd());
-#endif
#endif
#ifdef YP
if (use_yp)
Home |
Main Index |
Thread Index |
Old Index