Fix wrong keepold default in kadmin and ktutil

This commit is contained in:
Nicolas Williams
2019-01-08 22:15:25 -06:00
parent 7808e898e5
commit c2b106def5
5 changed files with 6 additions and 6 deletions

View File

@@ -147,7 +147,7 @@ kt_change(struct change_options *opt, int argc, char **argv)
krb5_key_salt_tuple *kstuple = NULL; krb5_key_salt_tuple *kstuple = NULL;
const char *enctype; const char *enctype;
size_t i, j, max, nkstuple; size_t i, j, max, nkstuple;
int keep = 0; int keep = 1;
struct change_set *changeset; struct change_set *changeset;
int errors = 0; int errors = 0;

View File

@@ -129,7 +129,7 @@ kt_get(struct get_options *opt, int argc, char **argv)
unsigned int failed = 0; unsigned int failed = 0;
i = 0; i = 0;
keep = 0; keep = 1;
if (opt->keepallold_flag) { if (opt->keepallold_flag) {
keep = 2; keep = 2;
i++; i++;

View File

@@ -158,7 +158,7 @@ cpw_entry(struct passwd_options *opt, int argc, char **argv)
* needed to decrypt extant tickets". * needed to decrypt extant tickets".
*/ */
num = 0; num = 0;
data.keepold = 0; data.keepold = 1;
if (opt->keepold_flag) { if (opt->keepold_flag) {
data.keepold = 1; data.keepold = 1;
num++; num++;

View File

@@ -160,7 +160,7 @@ ext_keytab(struct ext_keytab_options *opt, int argc, char **argv)
size_t i; size_t i;
data.random_key_flag = opt->random_key_flag; data.random_key_flag = opt->random_key_flag;
data.keep = 0; data.keep = 1;
i = 0; i = 0;
if (opt->keepallold_flag) { if (opt->keepallold_flag) {
data.keep = 2; data.keep = 2;
@@ -171,7 +171,7 @@ ext_keytab(struct ext_keytab_options *opt, int argc, char **argv)
i++; i++;
} }
if (opt->pruneall_flag) { if (opt->pruneall_flag) {
data.keep = 1; data.keep = 0;
i++; i++;
} }
if (i > 1) { if (i > 1) {

View File

@@ -52,7 +52,7 @@ kadmind_dispatch(void *kadm_handlep, krb5_boolean initial,
char *password = NULL, *expression; char *password = NULL, *expression;
krb5_keyblock *new_keys; krb5_keyblock *new_keys;
krb5_key_salt_tuple *ks_tuple = NULL; krb5_key_salt_tuple *ks_tuple = NULL;
krb5_boolean keepold = FALSE; int keepold = FALSE;
int n_ks_tuple = 0; int n_ks_tuple = 0;
int n_keys; int n_keys;
char **princs; char **princs;