}
ret = pam_putenv(ctx->pamh, var);
- if (ret) {
+ if (ret != PAM_SUCCESS) {
_pam_log(ctx, LOG_ERR,
"failed to set KRB5CCNAME to %s: %s",
var, pam_strerror(ctx->pamh, ret));
ret = pam_set_data(ctx->pamh, data_name, talloc_strdup(NULL, value),
_pam_winbind_cleanup_func);
- if (ret) {
+ if (ret != PAM_SUCCESS) {
_pam_log_debug(ctx, LOG_DEBUG,
"Could not set data %s: %s\n",
data_name, pam_strerror(ctx->pamh, ret));
}
ret = _pam_create_homedir(ctx, create_dir, mode);
- if (ret) {
+ if (ret != PAM_SUCCESS) {
return ret;
}
}
const char *ret = NULL;
ret = get_conf_item_string(ctx, "require_membership_of",
WINBIND_REQUIRED_MEMBERSHIP);
- if (ret) {
+ if (ret != NULL) {
return ret;
}
return get_conf_item_string(ctx, "require-membership-of",
char *domain = NULL;
char *name;
char *p;
+ char *result;
/* This cannot work when the winbind separator = @ */
return NULL;
}
- return talloc_asprintf(ctx, "%s%c%s", domain, sep, name);
+ result = talloc_asprintf(ctx, "%s%c%s", domain, sep, name);
+ wbcFreeMemory(domain);
+ wbcFreeMemory(name);
+ return result;
}
static int _pam_delete_cred(pam_handle_t *pamh, int flags,
ZERO_STRUCT(logoff);
retval = _pam_winbind_init_context(pamh, flags, argc, argv, type, &ctx);
- if (retval) {
- goto out;
+ if (retval != PAM_SUCCESS) {
+ return retval;
}
_PAM_LOG_FUNCTION_ENTER("_pam_delete_cred", ctx);
struct passwd *pwd = NULL;
retval = pam_get_user(pamh, &user, _("Username: "));
- if (retval) {
+ if (retval != PAM_SUCCESS) {
_pam_log(ctx, LOG_ERR,
"could not identify user");
goto out;
retval = _pam_winbind_init_context(pamh, flags, argc, argv,
PAM_WINBIND_AUTHENTICATE, &ctx);
- if (retval) {
- goto out;
+ if (retval != PAM_SUCCESS) {
+ return retval;
}
_PAM_LOG_FUNCTION_ENTER("pam_sm_authenticate", ctx);
ret = _pam_winbind_init_context(pamh, flags, argc, argv,
PAM_WINBIND_SETCRED, &ctx);
- if (ret) {
- goto out;
+ if (ret != PAM_SUCCESS) {
+ return ret;
}
_PAM_LOG_FUNCTION_ENTER("pam_sm_setcred", ctx);
break;
}
- out:
-
_PAM_LOG_FUNCTION_LEAVE("pam_sm_setcred", ctx, ret);
TALLOC_FREE(ctx);
ret = _pam_winbind_init_context(pamh, flags, argc, argv,
PAM_WINBIND_ACCT_MGMT, &ctx);
- if (ret) {
- goto out;
+ if (ret != PAM_SUCCESS) {
+ return ret;
}
_PAM_LOG_FUNCTION_ENTER("pam_sm_acct_mgmt", ctx);
ret = _pam_winbind_init_context(pamh, flags, argc, argv,
PAM_WINBIND_OPEN_SESSION, &ctx);
- if (ret) {
- goto out;
+ if (ret != PAM_SUCCESS) {
+ return ret;
}
_PAM_LOG_FUNCTION_ENTER("pam_sm_open_session", ctx);
/* check and create homedir */
ret = _pam_mkhomedir(ctx);
}
- out:
+
_PAM_LOG_FUNCTION_LEAVE("pam_sm_open_session", ctx, ret);
TALLOC_FREE(ctx);
ret = _pam_winbind_init_context(pamh, flags, argc, argv,
PAM_WINBIND_CLOSE_SESSION, &ctx);
- if (ret) {
- goto out;
+ if (ret != PAM_SUCCESS) {
+ return ret;
}
_PAM_LOG_FUNCTION_ENTER("pam_sm_close_session", ctx);
-out:
_PAM_LOG_FUNCTION_LEAVE("pam_sm_close_session", ctx, ret);
TALLOC_FREE(ctx);
ret = _pam_winbind_init_context(pamh, flags, argc, argv,
PAM_WINBIND_CHAUTHTOK, &ctx);
- if (ret) {
- goto out;
+ if (ret != PAM_SUCCESS) {
+ return ret;
}
_PAM_LOG_FUNCTION_ENTER("pam_sm_chauthtok", ctx);
* First get the name of a user
*/
ret = pam_get_user(pamh, &user, _("Username: "));
- if (ret) {
+ if (ret != PAM_SUCCESS) {
_pam_log(ctx, LOG_ERR,
"password - could not identify user");
goto out;
ret = winbind_chauthtok_request(ctx, user, pass_old,
pass_new, pwdlastset_update);
- if (ret) {
+ if (ret != PAM_SUCCESS) {
pass_old = pass_new = NULL;
goto out;
}