krb5_delayed_online_authentication.c revision e369fc08906383e6d5c39832f31bb6600a33f887
/*
SSSD
Kerberos 5 Backend Module -- Request a TGT when the system gets online
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2010 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <security/pam_modules.h>
#ifdef USE_KEYRING
#include <keyutils.h>
#endif
#include "providers/krb5/krb5_auth.h"
#include "dhash.h"
#include "util/find_uid.h"
#define INITIAL_USER_TABLE_SIZE 10
struct deferred_auth_ctx {
struct tevent_context *ev;
};
struct auth_data {
};
{
}
{
}
struct tevent_timer *te,
struct timeval current_time,
void *private_data)
{
struct auth_data);
struct tevent_req *req;
return;
}
#ifdef USE_KEYRING
long keysize;
long keyrevoke;
int ret;
pd->authtok_size);
if (keysize == -1) {
return;
return;
}
if (keyrevoke == -1) {
}
#endif
return;
}
}
struct auth_data);
int ret;
int pam_status = PAM_SYSTEM_ERR;
int dp_err;
if (ret) {
} else {
if (pam_status == PAM_SUCCESS) {
} else {
}
}
}
static errno_t authenticate_stored_users(
struct deferred_auth_ctx *deferred_auth_ctx)
{
int ret;
struct hash_iter_context_t *iter;
struct tevent_timer *te;
if (ret != HASH_SUCCESS) {
return ret;
}
return EINVAL;
}
if (ret == HASH_SUCCESS) {
struct auth_data);
} else {
}
}
} else {
}
if (ret != HASH_SUCCESS) {
hash_error_string(ret)));
}
}
return EOK;
}
static void delayed_online_authentication_callback(void *private_data)
{
struct deferred_auth_ctx *deferred_auth_ctx =
int ret;
"but user table does not exists.\n"));
return;
}
}
return;
}
{
int ret;
return EINVAL;
}
return EINVAL;
}
return EINVAL;
}
return ENOMEM;
}
#ifdef USE_KEYRING
return ret;
}
#endif
if (ret != HASH_SUCCESS) {
"delayed online authentication not possible.\n",
return ENOMEM;
}
return EOK;
}
struct tevent_context *ev)
{
int ret;
DEBUG(0, ("Delayed online auth was requested "
"on an unsupported system.\n"));
} else {
DEBUG(0, ("Delayed online auth was requested "
"but initialisation failed.\n"));
}
return ret;
}
if (ret != HASH_SUCCESS) {
return EFAULT;
}
struct deferred_auth_ctx);
return ENOMEM;
}
0, 0, 0, 0, hash_talloc, hash_talloc_free,
if (ret != HASH_SUCCESS) {
goto fail;
}
goto fail;
}
/* TODO: add destructor */
return EOK;
fail:
return ret;
}