diff options
author | Michael Adam <obnox@samba.org> | 2008-08-01 00:05:42 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-08-01 16:07:59 +0200 |
commit | 8876d793110262625adefe91efdd835119979e5e (patch) | |
tree | d1c7fb4cae3f82778fc24b864721fb342cd91a74 /source3/libnet | |
parent | 18573c3e1fba45cd5f8ae3f3e2634d2a1efdf3e3 (diff) | |
download | samba-8876d793110262625adefe91efdd835119979e5e.tar.gz samba-8876d793110262625adefe91efdd835119979e5e.tar.bz2 samba-8876d793110262625adefe91efdd835119979e5e.zip |
libnet keytab: add parameter ingnore_kvno to libnet_keytab_remove_entries()
to allow for removing all entries with given principal and enctype without
repecting the kvno (i.e. cleaning "old" entries...)
This is called with ignore_kvno == false from libnet_keytab_add_entry() to
keep the original behaviour.
Michael
(This used to be commit 6047f7b68548b33a2c132fc4333355a2c6abb19a)
Diffstat (limited to 'source3/libnet')
-rw-r--r-- | source3/libnet/libnet_keytab.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/libnet/libnet_keytab.c b/source3/libnet/libnet_keytab.c index ffff0f59ab..87d83fc46e 100644 --- a/source3/libnet/libnet_keytab.c +++ b/source3/libnet/libnet_keytab.c @@ -113,7 +113,8 @@ static krb5_error_code libnet_keytab_remove_entries(krb5_context context, krb5_keytab keytab, const char *principal, int kvno, - const krb5_enctype enctype) + const krb5_enctype enctype, + bool ignore_kvno) { krb5_error_code ret; krb5_kt_cursor cursor; @@ -131,7 +132,7 @@ static krb5_error_code libnet_keytab_remove_entries(krb5_context context, { char *princ_s = NULL; - if (kt_entry.vno != kvno) { + if (kt_entry.vno != kvno && !ignore_kvno) { goto cont; } @@ -210,7 +211,7 @@ static krb5_error_code libnet_keytab_add_entry(krb5_context context, /* remove duplicates first ... */ ret = libnet_keytab_remove_entries(context, keytab, princ_s, kvno, - enctype); + enctype, false); if (ret) { DEBUG(1, ("libnet_keytab_remove_entries failed: %s\n", error_message(ret))); |