diff options
Diffstat (limited to 'usr.bin/sudo/auth/kerb5.c')
-rw-r--r-- | usr.bin/sudo/auth/kerb5.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.bin/sudo/auth/kerb5.c b/usr.bin/sudo/auth/kerb5.c index 358c4f18e37..f4c90b87faa 100644 --- a/usr.bin/sudo/auth/kerb5.c +++ b/usr.bin/sudo/auth/kerb5.c @@ -33,6 +33,10 @@ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ #include "config.h" @@ -65,13 +69,15 @@ #include "sudo_auth.h" #ifndef lint -static const char rcsid[] = "$Sudo: kerb5.c,v 1.16 2003/04/04 17:46:57 millert Exp $"; +static const char rcsid[] = "$Sudo: kerb5.c,v 1.18 2003/04/16 00:42:10 millert Exp $"; #endif /* lint */ #ifdef HAVE_HEIMDAL +# define extract_name(c, p) krb5_principal_get_comp_string(c, p, 0); # define krb5_free_data_contents(c, d) krb5_data_free(d) +# define ENCTYPE_DES_CBC_MD5 ETYPE_DES_CBC_MD5 /* XXX */ #else -# define krb5_principal_get_realm(c, p) (krb5_princ_realm(c, p)->data) +# define extract_name(c, p) (krb5_princ_component(c, p, 1)->data) #endif static int verify_krb_v5_tgt __P((krb5_context, krb5_ccache, char *)); @@ -272,9 +278,8 @@ verify_krb_v5_tgt(sudo_context, ccache, auth_name) return(-1); } - /* Extract the name directly. */ - strlcpy(phost, krb5_principal_get_realm(sudo_context, princ), - sizeof(phost)); + /* Extract the name directly. Yow. */ + strlcpy(phost, extract_name(sudo_context, princ), sizeof(phost)); /* * Do we have host/<host> keys? |