576c49cd335618ad4b5351bd1c5f2cfd7584dba4lgentis Kerberos 5 Backend Module -- tgt_req and changepw child
cc8190433d13f5e9de618c5d7f10c824c0c1919cgryzor Sumit Bose <sbose@redhat.com>
cc8190433d13f5e9de618c5d7f10c824c0c1919cgryzor Copyright (C) 2009-2010 Red Hat
cc8190433d13f5e9de618c5d7f10c824c0c1919cgryzor This program is free software; you can redistribute it and/or modify
cc8190433d13f5e9de618c5d7f10c824c0c1919cgryzor it under the terms of the GNU General Public License as published by
cc8190433d13f5e9de618c5d7f10c824c0c1919cgryzor the Free Software Foundation; either version 3 of the License, or
cc8190433d13f5e9de618c5d7f10c824c0c1919cgryzor (at your option) any later version.
cc8190433d13f5e9de618c5d7f10c824c0c1919cgryzor This program is distributed in the hope that it will be useful,
cc8190433d13f5e9de618c5d7f10c824c0c1919cgryzor but WITHOUT ANY WARRANTY; without even the implied warranty of
cc8190433d13f5e9de618c5d7f10c824c0c1919cgryzor MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cc8190433d13f5e9de618c5d7f10c824c0c1919cgryzor GNU General Public License for more details.
cc8190433d13f5e9de618c5d7f10c824c0c1919cgryzor You should have received a copy of the GNU General Public License
cc8190433d13f5e9de618c5d7f10c824c0c1919cgryzor along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "providers/krb5/krb5_auth.h"
#include "providers/krb5/krb5_utils.h"
#include "sss_cli.h"
/* Unset option flag to make sure defaults from krb5.conf are used. */
if (kerr != 0) {
return kerr;
/* Unset option flag to make sure defaults from krb5.conf are used. */
if (kerr != 0) {
return kerr;
* must be removed so that libkrb5 can take the defaults from krb5.conf */
if (kerr != 0) {
return EIO;
return EOK;
if (password_expiration == 0) {
switch (format) {
return isdigit;
return isxdigit;
return isalnum;
return NULL;
return ENOTSUP;
return ENOTSUP;
return EPROTO;
return EMSGSIZE;
return ENOMEM;
return ENOMEM;
return ENOMEM;
return ENOMEM;
return EBADMSG;
return ENOTSUP;
return ENOTSUP;
return EPROTO;
return ENOMEM;
return ENOTSUP;
return EMSGSIZE;
return ENOMEM;
return EMSGSIZE;
return EMSGSIZE;
return ENOMEM;
return EBADMSG;
return ret;
case SSS_AUTHTOK_TYPE_2FA:
return ret;
return EINVAL;
size_t i;
return ret;
goto done;
return EAGAIN;
switch (ret) {
case EBADMSG:
case EMSGSIZE:
case ENOTSUP:
case EPROTO:
goto done;
goto done;
goto done;
done:
return ret;
void *data,
size_t c;
return EINVAL;
KRB5_RESPONDER_QUESTION_PASSWORD) == 0) {
return ret;
pwd);
if (kerr != 0) {
return kerr;
return NULL;
size_t c;
if (num_prompts != 0) {
for (c = 0; c < num_prompts; c++) {
return KRB5_LIBOS_CANTREADPWD;
return EOK;
return EOK;
return ENOMEM;
if (kerr != 0) {
goto done;
if (kerr != 0) {
goto done;
done:
if (kerr != 0) {
return kerr;
return EOK;
return ret;
return EOK;
#ifdef HAVE_KRB5_CC_COLLECTION
if (kerr) {
return ERR_INTERNAL;
if (kerr) {
goto done;
if (kerr) {
goto done;
#ifdef HAVE_KRB5_CC_COLLECTION
if (kerr) {
goto done;
switch_to_cc = true;
if (kerr) {
goto done;
if (kerr) {
goto done;
if (kerr) {
goto done;
#ifdef HAVE_KRB5_CC_COLLECTION
if (switch_to_cc) {
if (kerr) {
goto done;
done:
if (kcc) {
return kerr;
size_t p = 0;
if (!buf) {
return ENOMEM;
*_len = p;
return EOK;
return ENOMEM;
return ret;
return ERR_INTERNAL;
return ENOMEM;
return ret;
return ret;
errno = 0;
return ret;
return EOK;
return EOK;
goto done;
if (kerr != 0) {
goto done;
goto done;
done:
return ret;
if (kerr != 0) {
return kerr;
if (kerr != 0) {
return kerr;
if (kerr != 0) {
goto done;
if (kerr != 0) {
realm_entry_found = true;
if (!realm_entry_found) {
if (kerr != 0) {
goto done;
goto done;
if (kerr != 0) {
goto done;
if (kerr == 0) {
goto done;
if (kerr != 0) {
kerr = 0;
goto done;
if (kerr != 0) {
kerr = 0;
done:
return kerr;
char *ccname)
&options);
if (kerr != 0) {
return kerr;
if (kerr != 0) {
goto done;
kerr = 0;
done:
return kerr;
const char *password)
kr);
if (kerr != 0) {
if (realm_length == 0) {
return KRB5KRB_ERR_GENERIC;
kerr);
if (kerr != 0) {
return kerr;
if (kerr != 0) {
return kerr;
if (kerr != 0) {
goto done;
if (kerr) {
goto done;
if (kerr != 0) {
kerr = 0;
done:
return kerr;
if (kerr != 0) {
switch (kerr) {
return ERR_OK;
case KRB5_LIBOS_CANTREADPWD:
return ERR_NO_CREDS;
case KRB5_KDCREP_SKEW:
case KRB5KRB_AP_ERR_SKEW:
case KRB5KRB_AP_ERR_TKT_NYV:
case KRB5_KDC_UNREACH:
case KRB5_REALM_CANT_RESOLVE:
case KRB5_REALM_UNKNOWN:
return ERR_NETWORK_IO;
return ERR_ACCOUNT_LOCKED;
case KRB5KDC_ERR_NAME_EXP:
return ERR_ACCOUNT_EXPIRED;
case KRB5KDC_ERR_KEY_EXP:
return ERR_CREDS_EXPIRED;
return ERR_AUTH_FAILED;
case KRB5_PROG_ETYPE_NOSUPP:
case KRB5_PREAUTH_FAILED:
return ERR_CREDS_INVALID;
case KRB5KRB_ERR_GENERIC:
return ERR_INTERNAL;
return ERR_NO_CREDS;
if (!prelim) {
if (realm_length == 0) {
return ERR_INTERNAL;
if (kerr != 0) {
msg);
return kerr;
if (prelim) {
return EOK;
return ERR_NO_CREDS;
return ERR_NETWORK_IO;
if (kerr != 0) {
return ERR_CHPASS_FAILED;
return ret;
if (kerr == 0) {
switch (ret) {
case EOK:
case EACCES:
return ERR_INVALID_CRED_TYPE;
return ERR_NO_CREDS;
goto done;
if (kerr == 0) {
goto done;
if (kerr != 0) {
if (kerr == 0) {
done:
return ret;
if (kerr != 0) {
if (access_allowed) {
return EOK;
return ERR_AUTH_DENIED;
return ERR_INVALID_CRED_TYPE;
if (kerr != 0) {
goto done;
if (kerr != 0) {
goto done;
if (kerr != 0) {
goto done;
if (kerr != 0) {
goto done;
if (kerr != 0) {
goto done;
if (kerr != 0) {
done:
if (kerr == 0) {
kerr = 0;
if (kerr == 0) {
return EINVAL;
switch (auth_token_type) {
case SSS_AUTHTOK_TYPE_EMPTY:
case SSS_AUTHTOK_TYPE_CCFILE:
case SSS_AUTHTOK_TYPE_2FA:
return EINVAL;
*p += auth_token_length;
return ret;
size_t p = 0;
return ENOMEM;
p += len;
p += len;
if (len > 0) {
p += len;
p += len;
if (ret) {
return ret;
if (ret) {
return ret;
p += len;
return EOK;
return EOK;
if (krberr != 0) {
goto done;
} else if (krberr != 0) {
krberr = 0;
goto done;
krberr = 0;
done:
return krberr;
const char *primary,
const char *realm,
const char *keytab_name,
char **fast_ccname)
return ENOMEM;
goto done;
if (kerr) {
goto done;
if (kerr != 0) {
goto done;
goto done;
if (kerr != 0) {
goto done;
if (kerr == 0) {
goto done;
switch (fchild_pid) {
goto done;
if (kerr != 0) {
if (kerr != 0) {
exit(0);
errno = 0;
if (kerr > 0) {
if (kerr != 0) {
if (kerr != 0) {
goto done;
goto done;
done:
if (kerr == 0) {
return kerr;
errno = 0;
return ret;
return ret;
if (kerr) {
return kerr;
&tmp_str);
if (kerr) {
return kerr;
if (!fast_principal) {
return KRB5KRB_ERR_GENERIC;
if (!fast_principal_realm) {
return ENOMEM;
if (kerr != 0) {
return kerr;
if (kerr != 0) {
return kerr;
if (kerr != 0) {
return kerr;
if (demand) {
if (kerr != 0) {
return kerr;
return EOK;
return EINVAL;
return EOK;
valid = false;
switch (ret) {
case ERR_NOT_FOUND:
case ENOENT:
case EINVAL:
case EOK:
valid = true;
return ret;
return EOK;
return ret;
return ret;
return EOK;
return ret;
return EOK;
return EOK;
if (ret != 0) {
if (ret != 0) {
return ret;
return EOK;
if (kerr != 0) {
return kerr;
if (kerr != 0) {
return EIO;
* missing in krb5.conf or to allow SSSD to work with multiple unconnected
if (kerr != 0) {
if (kerr != 0) {
return kerr;
if (kerr != 0) {
return kerr;
return ENOMEM;
if (kerr != 0) {
return kerr;
if (kerr != 0) {
return kerr;
if (!offline) {
return kerr;
if (kerr != 0) {
return kerr;
if (kerr != 0) {
return kerr;
return ret;
return ret;
if (!(offline ||
NULL);
if (kerr != 0) {
return kerr;
return kerr;
&debug_to_stderr, 0,
switch(opt) {
if (!debug_prg_name) {
goto done;
goto done;
goto done;
if (kerr != 0) {
goto done;
if (kerr != 0) {
goto done;
goto done;
case SSS_PAM_AUTHENTICATE:
if (offline) {
case SSS_PAM_CHAUTHTOK:
case SSS_PAM_CHAUTHTOK_PRELIM:
case SSS_PAM_ACCT_MGMT:
case SSS_CMD_RENEW:
if (offline) {
goto done;
case SSS_PAM_PREAUTH:
goto done;
done:
ret = 0;