summaryrefslogtreecommitdiffstats
path: root/src/providers/krb5/krb5_common.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-05-05 07:35:56 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-05-07 17:14:32 -0400
commit67607dda05e36c4d0be4647160ad376b89d89c51 (patch)
treeb1e03b71bce6513d846cedff236c4e496061ecc3 /src/providers/krb5/krb5_common.c
parent3010e6a1cb1a9d57aa37a2367880c8cc0871b06e (diff)
downloadsssd-67607dda05e36c4d0be4647160ad376b89d89c51.tar.gz
sssd-67607dda05e36c4d0be4647160ad376b89d89c51.tar.xz
sssd-67607dda05e36c4d0be4647160ad376b89d89c51.zip
Clean up kdcinfo and kpasswdinfo files when exiting
Diffstat (limited to 'src/providers/krb5/krb5_common.c')
-rw-r--r--src/providers/krb5/krb5_common.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/providers/krb5/krb5_common.c b/src/providers/krb5/krb5_common.c
index 2b3331ed3..746b3f3c6 100644
--- a/src/providers/krb5/krb5_common.c
+++ b/src/providers/krb5/krb5_common.c
@@ -413,3 +413,43 @@ done:
return ret;
}
+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;
+ errno_t err;
+ char *file;
+
+ file = talloc_asprintf(se, KDCINFO_TMPL, realm);
+ if(file == NULL) {
+ sig_term(signum);
+ }
+ errno = 0;
+ ret = unlink(file);
+ if (ret == -1) {
+ err = errno;
+ DEBUG(5, ("Could not remove [%s], [%d][%s]\n", file,
+ err, strerror(err)));
+ }
+
+ errno = 0;
+ file = talloc_asprintf(se, KPASSWDINFO_TMPL, realm);
+ if(file == NULL) {
+ sig_term(signum);
+ }
+
+ errno = 0;
+ ret = unlink(file);
+ if (ret == -1) {
+ err = errno;
+ DEBUG(5, ("Could not remove [%s], [%d][%s]\n", file,
+ err, strerror(err)));
+ }
+
+ sig_term(signum);
+}