This commit is contained in:
parent
080eecb6ae
commit
97cfa9b2f8
@ -1,26 +1,27 @@
|
|||||||
Index: pam_krb5-2.4.4/src/auth.c
|
Index: pam_krb5-2.4.13/src/auth.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- pam_krb5-2.4.4.orig/src/auth.c
|
--- pam_krb5-2.4.13.orig/src/auth.c
|
||||||
+++ pam_krb5-2.4.4/src/auth.c
|
+++ pam_krb5-2.4.13/src/auth.c
|
||||||
@@ -434,13 +434,32 @@ int
|
@@ -435,13 +435,33 @@ pam_sm_setcred(pam_handle_t *pamh, int f
|
||||||
pam_sm_setcred(pam_handle_t *pamh, int flags,
|
|
||||||
int argc, PAM_KRB5_MAYBE_CONST char **argv)
|
int argc, PAM_KRB5_MAYBE_CONST char **argv)
|
||||||
{
|
{
|
||||||
|
const char *why = "";
|
||||||
+ krb5_context ctx;
|
+ krb5_context ctx;
|
||||||
+ struct _pam_krb5_options *options;
|
+ struct _pam_krb5_options *options;
|
||||||
struct _pam_krb5_perms *saved_perms;
|
struct _pam_krb5_perms *saved_perms;
|
||||||
- notice("pam_setcred (%s) called",
|
- notice("pam_setcred (%s) called",
|
||||||
- (flags & PAM_ESTABLISH_CRED)?"establish credential":
|
- (flags & PAM_ESTABLISH_CRED)?"establish credential":
|
||||||
- (flags & PAM_REINITIALIZE_CRED)?"reinitialize credential":
|
- (flags & PAM_REINITIALIZE_CRED)?"reinitialize credential":
|
||||||
- (flags & PAM_REFRESH_CRED)?"refresh credential":
|
- (flags & PAM_REFRESH_CRED)?"refresh credential":
|
||||||
- (flags & PAM_DELETE_CRED)?"delete credential":"unknown flag");
|
- (flags & PAM_DELETE_CRED)?"delete credential":"unknown flag");
|
||||||
+
|
+
|
||||||
+ if (_pam_krb5_init_ctx(&ctx, argc, argv) != 0) {
|
+ if (_pam_krb5_init_ctx(&ctx, argc, argv) != 0) {
|
||||||
+ warn("error initializing Kerberos");
|
+ warn("error initializing Kerberos");
|
||||||
+ return PAM_SERVICE_ERR;
|
+ return PAM_SERVICE_ERR;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ options = _pam_krb5_options_init(pamh, argc, argv, ctx);
|
+ options = _pam_krb5_options_init(pamh, argc, argv, ctx,
|
||||||
|
+ _pam_krb5_option_role_general);
|
||||||
+ if (options == NULL) {
|
+ if (options == NULL) {
|
||||||
+ warn("error parsing options (shouldn't happen)");
|
+ warn("error parsing options (shouldn't happen)");
|
||||||
+ krb5_free_context(ctx);
|
+ krb5_free_context(ctx);
|
||||||
@ -40,7 +41,7 @@ Index: pam_krb5-2.4.4/src/auth.c
|
|||||||
return _pam_krb5_open_session(pamh, flags, argc, argv,
|
return _pam_krb5_open_session(pamh, flags, argc, argv,
|
||||||
"pam_setcred(PAM_ESTABLISH_CRED)",
|
"pam_setcred(PAM_ESTABLISH_CRED)",
|
||||||
_pam_krb5_session_caller_setcred);
|
_pam_krb5_session_caller_setcred);
|
||||||
@@ -455,21 +474,31 @@ pam_sm_setcred(pam_handle_t *pamh, int f
|
@@ -464,20 +484,30 @@ pam_sm_setcred(pam_handle_t *pamh, int f
|
||||||
}
|
}
|
||||||
saved_perms = NULL;
|
saved_perms = NULL;
|
||||||
|
|
||||||
@ -55,7 +56,6 @@ Index: pam_krb5-2.4.4/src/auth.c
|
|||||||
if (saved_perms != NULL) {
|
if (saved_perms != NULL) {
|
||||||
_pam_krb5_restore_perms_r2e(saved_perms);
|
_pam_krb5_restore_perms_r2e(saved_perms);
|
||||||
}
|
}
|
||||||
saved_perms = NULL;
|
|
||||||
+ _pam_krb5_options_free(pamh, ctx, options);
|
+ _pam_krb5_options_free(pamh, ctx, options);
|
||||||
+ krb5_free_context(ctx);
|
+ krb5_free_context(ctx);
|
||||||
return PAM_IGNORE;
|
return PAM_IGNORE;
|
||||||
|
Loading…
Reference in New Issue
Block a user