diff options
author | ache <ache@FreeBSD.org> | 1995-01-25 19:57:27 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1995-01-25 19:57:27 +0000 |
commit | b987bbd15209f34502a60717db687921bab1ce21 (patch) | |
tree | ffe46ef6448dd3e1858ede2fdc6c909624dd6fab /eBones | |
parent | ef8fdd5889e230dfc51ee5ef77ae1f4e30286d57 (diff) | |
download | FreeBSD-src-b987bbd15209f34502a60717db687921bab1ce21.zip FreeBSD-src-b987bbd15209f34502a60717db687921bab1ce21.tar.gz |
Fix database deletion, we don't have .dir & .pag, use .db instead
Diffstat (limited to 'eBones')
-rw-r--r-- | eBones/kdb_destroy/kdb_destroy.c | 16 | ||||
-rw-r--r-- | eBones/usr.sbin/kdb_destroy/kdb_destroy.c | 16 |
2 files changed, 28 insertions, 4 deletions
diff --git a/eBones/kdb_destroy/kdb_destroy.c b/eBones/kdb_destroy/kdb_destroy.c index 0c45896..29c68a8 100644 --- a/eBones/kdb_destroy/kdb_destroy.c +++ b/eBones/kdb_destroy/kdb_destroy.c @@ -4,12 +4,12 @@ * <Copyright.MIT>. * * from: kdb_destroy.c,v 4.0 89/01/24 21:49:02 jtkohl Exp $ - * $Id: kdb_destroy.c,v 1.2 1994/07/19 19:23:49 g89r4222 Exp $ + * $Id: kdb_destroy.c,v 1.1.1.1 1994/09/30 14:49:56 csgr Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kdb_destroy.c,v 1.2 1994/07/19 19:23:49 g89r4222 Exp $"; +"$Id: kdb_destroy.c,v 1.1.1.1 1994/09/30 14:49:56 csgr Exp $"; #endif lint #include <strings.h> @@ -22,12 +22,20 @@ main() char answer[10]; /* user input */ char dbm[256]; /* database path and name */ char dbm1[256]; /* database path and name */ +#ifndef __FreeBSD__ char *file1, *file2; /* database file names */ +#else + char *file; /* database file names */ +#endif strcpy(dbm, DBM_FILE); +#ifndef __FreeBSD__ strcpy(dbm1, DBM_FILE); file1 = strcat(dbm, ".dir"); file2 = strcat(dbm1, ".pag"); +#else + file = strcat(dbm, ".db"); +#endif printf("You are about to destroy the Kerberos database "); printf("on this machine.\n"); @@ -35,7 +43,11 @@ main() fgets(answer, sizeof(answer), stdin); if (answer[0] == 'y' || answer[0] == 'Y') { +#ifndef __FreeBSD__ if (unlink(file1) == 0 && unlink(file2) == 0) +#else + if (unlink(file) == 0) +#endif fprintf(stderr, "Database deleted at %s\n", DBM_FILE); else fprintf(stderr, "Database cannot be deleted at %s\n", diff --git a/eBones/usr.sbin/kdb_destroy/kdb_destroy.c b/eBones/usr.sbin/kdb_destroy/kdb_destroy.c index 0c45896..29c68a8 100644 --- a/eBones/usr.sbin/kdb_destroy/kdb_destroy.c +++ b/eBones/usr.sbin/kdb_destroy/kdb_destroy.c @@ -4,12 +4,12 @@ * <Copyright.MIT>. * * from: kdb_destroy.c,v 4.0 89/01/24 21:49:02 jtkohl Exp $ - * $Id: kdb_destroy.c,v 1.2 1994/07/19 19:23:49 g89r4222 Exp $ + * $Id: kdb_destroy.c,v 1.1.1.1 1994/09/30 14:49:56 csgr Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kdb_destroy.c,v 1.2 1994/07/19 19:23:49 g89r4222 Exp $"; +"$Id: kdb_destroy.c,v 1.1.1.1 1994/09/30 14:49:56 csgr Exp $"; #endif lint #include <strings.h> @@ -22,12 +22,20 @@ main() char answer[10]; /* user input */ char dbm[256]; /* database path and name */ char dbm1[256]; /* database path and name */ +#ifndef __FreeBSD__ char *file1, *file2; /* database file names */ +#else + char *file; /* database file names */ +#endif strcpy(dbm, DBM_FILE); +#ifndef __FreeBSD__ strcpy(dbm1, DBM_FILE); file1 = strcat(dbm, ".dir"); file2 = strcat(dbm1, ".pag"); +#else + file = strcat(dbm, ".db"); +#endif printf("You are about to destroy the Kerberos database "); printf("on this machine.\n"); @@ -35,7 +43,11 @@ main() fgets(answer, sizeof(answer), stdin); if (answer[0] == 'y' || answer[0] == 'Y') { +#ifndef __FreeBSD__ if (unlink(file1) == 0 && unlink(file2) == 0) +#else + if (unlink(file) == 0) +#endif fprintf(stderr, "Database deleted at %s\n", DBM_FILE); else fprintf(stderr, "Database cannot be deleted at %s\n", |