diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/providers/krb5/krb5_common.c | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/src/providers/krb5/krb5_common.c b/src/providers/krb5/krb5_common.c index f038557d9..dfcb50260 100644 --- a/src/providers/krb5/krb5_common.c +++ b/src/providers/krb5/krb5_common.c @@ -435,22 +435,19 @@ done: return ret; } -void krb5_finalize(struct tevent_context *ev, - struct tevent_signal *se, - int signum, - int count, - void *siginfo, - void *private_data) + +static errno_t remove_krb5_info_files(TALLOC_CTX *mem_ctx, const char *realm) { - char *realm = (char *)private_data; int ret; errno_t err; char *file; - file = talloc_asprintf(se, KDCINFO_TMPL, realm); + file = talloc_asprintf(mem_ctx, KDCINFO_TMPL, realm); if(file == NULL) { - sig_term(signum); + DEBUG(1, ("talloc_asprintf failed.\n")); + return ENOMEM; } + errno = 0; ret = unlink(file); if (ret == -1) { @@ -459,10 +456,10 @@ void krb5_finalize(struct tevent_context *ev, err, strerror(err))); } - errno = 0; - file = talloc_asprintf(se, KPASSWDINFO_TMPL, realm); + file = talloc_asprintf(mem_ctx, KPASSWDINFO_TMPL, realm); if(file == NULL) { - sig_term(signum); + DEBUG(1, ("talloc_asprintf failed.\n")); + return ENOMEM; } errno = 0; @@ -473,5 +470,23 @@ void krb5_finalize(struct tevent_context *ev, err, strerror(err))); } + return EOK; +} + +void krb5_finalize(struct tevent_context *ev, + struct tevent_signal *se, + int signum, + int count, + void *siginfo, + void *private_data) +{ + char *realm = (char *)private_data; + int ret; + + ret = remove_krb5_info_files(se, realm); + if (ret != EOK) { + DEBUG(1, ("remove_krb5_info_files failed.\n")); + } + sig_term(signum); } |