diff options
| author | John Kohl <jtkohl@mit.edu> | 1990-02-03 15:45:47 +0000 |
|---|---|---|
| committer | John Kohl <jtkohl@mit.edu> | 1990-02-03 15:45:47 +0000 |
| commit | 372f6bedc6ff4f3b2c8306e7349055ce845a7556 (patch) | |
| tree | ce274f48cb28d8db39973dd9b6908e5fc06ac475 /src | |
| parent | be1fc0a3e45172ded7dae367cd0f9aa55563d220 (diff) | |
| download | krb5-372f6bedc6ff4f3b2c8306e7349055ce845a7556.tar.gz krb5-372f6bedc6ff4f3b2c8306e7349055ce845a7556.tar.xz krb5-372f6bedc6ff4f3b2c8306e7349055ce845a7556.zip | |
*** empty log message ***
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@248 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/krb5/krb/princ_comp.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/lib/krb5/krb/princ_comp.c b/src/lib/krb5/krb/princ_comp.c new file mode 100644 index 000000000..03921200b --- /dev/null +++ b/src/lib/krb5/krb/princ_comp.c @@ -0,0 +1,40 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1990 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * <krb5/mit-copyright.h>. + * + * compare two principals, returning a krb5_boolean true if equal, false if + * not. + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_princ_comp_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include <krb5/copyright.h> + +#include <krb5/krb5.h> + +#ifndef min +#define min(a,b) ((a) < (b) ? (a) : (b)) +#endif min + +krb5_boolean +krb5_principal_compare(princ1, princ2) +krb5_principal princ1, princ2; +{ + register krb5_data **p1, **p2; + + for (p1 = princ1, p2 = princ2; *p1 && *p2; p1++, p2++) + if (strncmp((*p1)->data, (*p2)->data, min((*p1)->length, + (*p2)->length))) + return FALSE; + if (*p1 || *p2) /* didn't both run out at once */ + return FALSE; + return TRUE; +} |
