krb5_auth.c revision 01ec08efd0e166ac6f390f8627c6d08dcc63ccc4
0N/A along with this program. If not, see <http://www.gnu.org/licenses/>.
0N/A#include "util/find_uid.h"
#include "util/auth_utils.h"
#include "util/sss_utf8.h"
#include "util/child_common.h"
#include "providers/krb5/krb5_auth.h"
#include "providers/krb5/krb5_utils.h"
#include "providers/krb5/krb5_ccache.h"
const char *name,
const char *ccname,
int mod_op)
int ret;
bool in_transaction = false;
return EINVAL;
return EINVAL;
if (!tmpctx) {
return ENOMEM;
if (!attrs) {
goto done;
goto done;
goto done;
in_transaction = true;
goto done;
goto done;
in_transaction = false;
done:
if (in_transaction) {
return ret;
const char *name,
const char *ccname)
const char *name,
const char *ccname)
case SSS_PAM_AUTHENTICATE:
case SSS_CMD_RENEW:
struct krb5_ctx);
case SSS_PAM_ACCT_MGMT:
struct krb5_ctx);
case SSS_PAM_CHAUTHTOK:
case SSS_PAM_CHAUTHTOK_PRELIM:
struct krb5_ctx);
return NULL;
return EOK;
static errno_t
goto done;
done:
return ret;
const char *mapped_name;
return ENOMEM;
goto done;
goto done;
done:
return ret;
const char *ccname_template;
return ENOMEM;
return EOK;
const char *fa2;
case SSS_CMD_RENEW:
case SSS_PAM_AUTHENTICATE:
case SSS_PAM_CHAUTHTOK_PRELIM:
case SSS_PAM_CHAUTHTOK:
if (ret) {
size_t i;
struct krb5_auth_state {
bool search_kpasswd;
int pam_status;
int dp_err;
const char **attrs;
const char *realm;
int ret;
bool otp;
return NULL;
goto done;
case SSS_PAM_AUTHENTICATE:
case SSS_PAM_CHAUTHTOK:
goto done;
goto done;
case SSS_PAM_CHAUTHTOK_PRELIM:
goto done;
case SSS_CMD_RENEW:
goto done;
case SSS_PAM_PREAUTH:
goto done;
goto done;
goto done;
goto done;
if (ret) {
goto done;
goto done;
goto done;
goto done;
if (ret != 0) {
goto done;
NULL);
SYSDB_UIDNUM, 0);
goto done;
SYSDB_GIDNUM, 0);
goto done;
goto done;
goto done;
goto done;
if (!subreq) {
goto done;
return req;
done:
return req;
int ret;
goto done;
goto done;
goto done;
goto done;
done:
int ret;
char *renew_interval_str;
bool use_enterprise_principal;
case SSS_PAM_AUTHENTICATE:
case SSS_CMD_RENEW:
case SSS_PAM_CHAUTHTOK:
case SSS_PAM_CHAUTHTOK_PRELIM:
goto done;
goto done;
goto done;
&res);
if (ret) {
goto done;
goto done;
use_enterprise_principal == true) {
goto done;
goto done;
goto done;
case ERR_OK:
goto done;
case ERR_NETWORK_IO:
goto done;
goto done;
case ERR_CREDS_EXPIRED_CCACHE:
case ERR_CREDS_EXPIRED:
goto done;
case ERR_CREDS_INVALID:
goto done;
case ERR_ACCOUNT_EXPIRED:
goto done;
case ERR_NO_CREDS:
goto done;
case ERR_AUTH_FAILED:
goto done;
case ERR_CHPASS_FAILED:
goto done;
goto done;
goto done;
if (ret) {
goto done;
renew_interval_delta = 0;
goto done;
SSS_AUTHTOK_TYPE_2FA))) {
goto done;
done:
return EOK;
goto done;
case SSS_PAM_AUTHENTICATE:
case SSS_CMD_RENEW:
case SSS_PAM_CHAUTHTOK_PRELIM:
case SSS_PAM_CHAUTHTOK:
goto done;
case SSS_PAM_ACCT_MGMT:
goto done;
case SSS_PAM_SETCRED:
case SSS_PAM_OPEN_SESSION:
case SSS_PAM_CLOSE_SESSION:
goto done;
goto done;
done:
int ret;
int pam_status;
int dp_err;
if (ret) {
int ret;
bool access_allowed;
goto done;
done: