From 212a26960ed1aebef03fdf6db8f764f296ef63ba Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sat, 30 Jan 1999 18:14:18 +0000 Subject: [PATCH] (fkt_remove_entry): remove KRB5_KT_NOTFOUND if we weren't able to remove it. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5290 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/keytab.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/krb5/keytab.c b/lib/krb5/keytab.c index 10f3e7072..a7ee7cb37 100644 --- a/lib/krb5/keytab.c +++ b/lib/krb5/keytab.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1998 Kungliga Tekniska Högskolan + * Copyright (c) 1997, 1998, 1999 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -676,6 +676,7 @@ fkt_remove_entry(krb5_context context, krb5_keytab_entry e; krb5_kt_cursor cursor; off_t pos_start, pos_end; + int found = 0; fkt_start_seq_get_int(context, id, O_RDWR | O_BINARY, &cursor); pos_start = cursor.offset; @@ -684,6 +685,7 @@ fkt_remove_entry(krb5_context context, entry->vno, entry->keyblock.keytype)) { int32_t len; unsigned char buf[128]; + found = 1; pos_end = cursor.offset; cursor.sp->seek(cursor.sp, pos_start, SEEK_SET); krb5_ret_int32(cursor.sp, &len); @@ -701,6 +703,8 @@ fkt_remove_entry(krb5_context context, pos_start = cursor.offset; } krb5_kt_end_seq_get(context, id, &cursor); + if (!found) + return KRB5_KT_NOTFOUND; return 0; }