struct context *ctx = (struct context *) data;
/*
- * Do nothing if the status contains PAM_DATA_SILENT, since in that case we
- * may be in a child and the parent will still rely on underlying resources
- * such as the ticket cache to exist.
+ * Do not destroy the cache if the status contains PAM_DATA_SILENT, since
+ * in that case we may be in a child and the parent will still rely on
+ * underlying resources such as the ticket cache to exist.
*/
- if (PAM_DATA_SILENT != 0 && pam_end_status & PAM_DATA_SILENT)
- return;
+ if (PAM_DATA_SILENT != 0 && (pam_end_status & PAM_DATA_SILENT))
+ ctx->dont_destroy_cache = true;
- /* Otherwise, just call context_free. */
+ /* The rest of the work is in context_free. */
if (ctx != NULL)
context_free(ctx, true);
}
if (config->oldauthtok != NULL)
pamh->oldauthtok = bstrdup(config->oldauthtok);
- /*
- * Run the actions and check their return status. If one of the actions
- * is to call pam_end, we have to call any callback before then.
- */
+ /* Run the actions and check their return status. */
for (action = work->actions; action != NULL; action = action->next) {
if (work->options[action->group].argv == NULL)
status = (*action->call)(pamh, action->flags, 0, argv_empty);
check_output(work->output, output);
pam_output_free(output);
- /* If we have a test callback we haven't called, call it now. */
+ /* If we have a test callback, call it now. */
if (config->callback != NULL)
config->callback(pamh, config, config->data);