need to setuid(0) to make kerb4 stuff work.
This commit is contained in:
9
check.c
9
check.c
@@ -581,7 +581,11 @@ int sudo_krb_validate_user(user, pass)
|
|||||||
(void) sprintf(tkfile, "%s/tkt%d", _PATH_SUDO_TIMEDIR, uid);
|
(void) sprintf(tkfile, "%s/tkt%d", _PATH_SUDO_TIMEDIR, uid);
|
||||||
(void) krb_set_tkt_string(tkfile);
|
(void) krb_set_tkt_string(tkfile);
|
||||||
|
|
||||||
/* Update the ticket if password is ok */
|
/*
|
||||||
|
* Update the ticket if password is ok. Kerb4 expects
|
||||||
|
* the ruid and euid to be the same here so we setuid to root.
|
||||||
|
*/
|
||||||
|
set_perms(PERM_ROOT);
|
||||||
k_errno = krb_get_pw_in_tkt(user, "", realm, "krbtgt", realm,
|
k_errno = krb_get_pw_in_tkt(user, "", realm, "krbtgt", realm,
|
||||||
DEFAULT_TKT_LIFE, pass);
|
DEFAULT_TKT_LIFE, pass);
|
||||||
|
|
||||||
@@ -595,6 +599,9 @@ int sudo_krb_validate_user(user, pass)
|
|||||||
(void) fprintf(stderr, "Warning: Kerberos error: %s\n",
|
(void) fprintf(stderr, "Warning: Kerberos error: %s\n",
|
||||||
krb_err_txt[k_errno]);
|
krb_err_txt[k_errno]);
|
||||||
|
|
||||||
|
/* done with rootly stuff */
|
||||||
|
set_perms(PERM_USER);
|
||||||
|
|
||||||
return(!(k_errno == INTK_OK));
|
return(!(k_errno == INTK_OK));
|
||||||
}
|
}
|
||||||
#endif /* HAVE_KERB4 */
|
#endif /* HAVE_KERB4 */
|
||||||
|
Reference in New Issue
Block a user