]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
util: Completely remove get_krbrlm
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 21 Apr 2012 19:55:23 +0000 (20:55 +0100)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 22 Apr 2012 12:37:04 +0000 (05:37 -0700)
Commit d85ece0977e043154b7d8f5aef5f4cd972771e8e added a new
mechanism for determining whether a realm is local or not, and
susequent commits removed all in-tree calls to the now-legacy
functions in get_krbrlm.c

To avoid confusion, just remove all of these legacy functions, as
we don't want to end up supporting two ways of doing this
operation.

This change is not suitable for pullup to a stable release.

Change-Id: Ie2f5c447f751d12a0d85a4a438efd7e210133e97
Reviewed-on: http://gerrit.openafs.org/7263
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
src/libafsauthent/Makefile.in
src/libafsauthent/NTMakefile
src/shlibafsauthent/Makefile.in
src/shlibafsauthent/NTMakefile
src/shlibafsauthent/libafsauthent.map
src/tvlserver/Makefile.in
src/util/Makefile.in
src/util/NTMakefile
src/util/afsutil_prototypes.h
src/util/get_krbrlm.c [deleted file]

index 79af7164b24aec08122a74c4864a27c8003676a2..160268251d2baa1c531e7564fd1bce72873fa680 100644 (file)
@@ -59,7 +59,6 @@ UBIKOBJS = \
 
 UTILOBJS = \
        pthread_glock.o \
-       get_krbrlm.o \
        dirpath.o \
        serverLog.o \
        fileutil.o
@@ -207,10 +206,6 @@ ubik_int.cs.o: ../ubik/ubik_int.cs.c
 ubik_int.xdr.o: ../ubik/ubik_int.xdr.c
        ${AFS_CCRULE} ../ubik/ubik_int.xdr.c
 
-
-get_krbrlm.o: ${UTIL}/get_krbrlm.c
-       ${AFS_CCRULE} ${UTIL}/get_krbrlm.c
-
 dirpath.o: ${UTIL}/dirpath.c
        ${AFS_CCRULE} ${UTIL}/dirpath.c
 
index 11bd6d97d28a53d941ae92866ba299bba9acde4b..c06436edeb07036abb02dbda6187b7cc3320580f 100644 (file)
@@ -69,7 +69,6 @@ UBIKOBJS = \
 
 UTILOBJS = \
        $(OUT)\pthread_glock.obj \
-       $(OUT)\get_krbrlm.obj \
        $(OUT)\fileutil.obj \
        $(OUT)\dirpath.obj \
        $(OUT)\readdir_nt.obj
index 2212a7966921b7cf26a493eeab4d1363e345d72e..57ba5c8f833a681d59a52aa17f2e1688353851b7 100644 (file)
@@ -66,7 +66,6 @@ UBIKOBJS = \
 
 UTILOBJS = \
        pthread_glock.o \
-       get_krbrlm.o \
        dirpath.o \
        serverLog.o \
        fileutil.o \
@@ -264,9 +263,6 @@ ubik_int.cs.o: ../ubik/ubik_int.cs.c
 ubik_int.xdr.o: ../ubik/ubik_int.xdr.c
        ${AFS_CCRULE} ../ubik/ubik_int.xdr.c
 
-get_krbrlm.o: ${UTIL}/get_krbrlm.c
-       ${AFS_CCRULE} ${UTIL}/get_krbrlm.c
-
 dirpath.o: ${UTIL}/dirpath.c
        ${AFS_CCRULE} ${UTIL}/dirpath.c
 
index e05377dc3b03ea52d8302c5a143257094d0ccd75..238eabf2f5f4223810cdcde5434292567de0bd82 100644 (file)
@@ -56,7 +56,6 @@ UBIKOBJS = \
 
 UTILOBJS = \
        $(OUT)\pthread_glock.obj \
-       $(OUT)\get_krbrlm.obj \
        $(OUT)\fileutil.obj \
        $(OUT)\dirpath.obj \
        $(OUT)\readdir_nt.obj
@@ -158,9 +157,6 @@ ubik_int.cs.obj: $(UBIK)\ubik_int.cs.c
 ubik_int.xdr.obj: $(UBIK)\ubik_int.xdr.c
        $(C2OBJ) $(UBIK)\ubik_int.xdr.c
 
-get_krbrlm.obj: $(UTIL)\get_krbrlm.c
-       $(C2OBJ) $(UTIL)\get_krbrlm.c
-
 dirpath.obj: $(UTIL)\dirpath.c
        $(C2OBJ) $(UTIL)\dirpath.c
 
index 346eac86e4bd6299c3aab3cb54208f49d7f373d2..fb2e6519e9c96b7974696d0cea7f5122fde9a9f7 100644 (file)
@@ -75,7 +75,6 @@
        pr_GetCPS;
        pr_Initialize;
        pr_GetHostCPS;
-       afs_krb_get_lrealm;
        pr_NameToId;
        pr_IdToName;
        pr_ListMembers;
index 0174404eff914333b90f7dca82339781ea10cdb7..6648b3f57ce0e8c6ed59553b6eb5d3c550827704 100644 (file)
@@ -20,7 +20,7 @@ RXOBJS= rx_pthread.o rxkad_errs.o
 
 UTILOBJS=uuid.o serverLog.o fileutil.o netutils.o dirpath.o \
      volparse.o flipbase64.o softsig.o hostparse.o pthread_glock.o \
-     pthread_threadname.o get_krbrlm.o
+     pthread_threadname.o
 
 INCLS=${TOP_INCDIR}/ubik.h \
              ${TOP_INCDIR}/lwp.h \
@@ -93,9 +93,6 @@ pthread_glock.o: ${UTIL}/pthread_glock.c
 pthread_threadname.o: ${UTIL}/pthread_threadname.c
        $(AFS_CCRULE) $(UTIL)/pthread_threadname.c
 
-get_krbrlm.o: ${UTIL}/get_krbrlm.c
-       $(AFS_CCRULE) $(UTIL)/get_krbrlm.c
-
 #
 # Other stuff
 #
index 6de1ba183025cc08472fe2e4a2f2f4cc21fce170..69866a9447e5059ddff7779d666bd5061ed1d1f1 100644 (file)
@@ -13,7 +13,7 @@ HELPER_SPLINT=@HELPER_SPLINT@
 
 
 objects =base64.o ktime.o volparse.o hostparse.o exec.o \
-        hputil.o kreltime.o get_krbrlm.o uuid.o serverLog.o \
+        hputil.o kreltime.o uuid.o serverLog.o \
         dirpath.o fileutil.o netutils.o flipbase64.o fstab.o \
         afs_atomlist.o afs_lhash.o pthread_glock.o tabular_output.o \
         pthread_threadname.o ${REGEX_OBJ}
@@ -26,7 +26,6 @@ objects_pic = \
        exec_pic.o \
        hputil_pic.o \
        kreltime_pic.o \
-       get_krbrlm_pic.o \
        uuid_pic.o \
        serverLog_pic.o \
        dirpath_pic.o \
@@ -203,9 +202,6 @@ hputil_pic.o: ${srcdir}/hputil.c ${includes}
 kreltime_pic.o: ${srcdir}/kreltime.c ${includes}
        $(SHD_CCRULE) ${srcdir}/kreltime.c
 
-get_krbrlm_pic.o: ${srcdir}/get_krbrlm.c ${includes}
-       $(SHD_CCRULE) ${srcdir}/get_krbrlm.c
-
 uuid_pic.o: ${srcdir}/uuid.c ${includes}
        $(SHD_CCRULE) ${srcdir}/uuid.c
 
@@ -321,6 +317,6 @@ include ../config/Makefile.version
 check-splint:
        sh $(HELPER_SPLINT) $(CFLAGS) \
            base64.c ktime.c volparse.c hostparse.c \
-           hputil.c kreltime.c get_krbrlm.c uuid.c serverLog.c \
+           hputil.c kreltime.c uuid.c serverLog.c \
            dirpath.c fileutil.c netutils.c flipbase64.c \
            afs_atomlist.c afs_lhash.c fstab.c
index edbb013575af392fb660408091eea8c3a8e574c2..6a31d47eebe3d5e994792afcf3f0ebedb9971cf4 100644 (file)
@@ -40,7 +40,6 @@ MT_LIBFILE = $(DESTDIR)\lib\afs\mtafsutil.lib
 
 LIBOBJS = \
        $(OUT)\base32.obj \
-       $(OUT)\get_krbrlm.obj \
        $(OUT)\hostparse.obj \
         $(OUT)\krb5_nt.obj \
        $(OUT)\kreltime.obj \
@@ -59,7 +58,6 @@ LIBOBJS = \
 
 MT_LIBOBJS = \
        $(OUT)\base32.obj \
-       $(OUT)\get_krbrlm.obj \
        $(OUT)\hostparse.obj \
         $(OUT)\krb5_nt.obj \
        $(OUT)\kreltime.obj \
index 592ac65fadcf2bca04f35de39a91aa838c9df019..dd3d7fbbf7fce3a84964ccb7a1fd5c1729fee009 100644 (file)
@@ -59,10 +59,6 @@ extern char *int64_to_flipbase64(lb64_string_t s, afs_uint64 a);
 extern afs_int64 flipbase64_to_int64(char *s);
 #endif
 
-/* get_krbrlm.c */
-extern int afs_krb_get_lrealm(char *r, int n);
-extern int afs_krb_exclusion(char *name);
-extern int afs_is_foreign_ticket_name(char *tname, char *tinst, char * tcell, char *localrealm);
 /* hostparse.c */
 extern struct hostent *hostutil_GetHostByName(char *ahost);
 extern char *hostutil_GetNameByINet(afs_uint32 addr);
diff --git a/src/util/get_krbrlm.c b/src/util/get_krbrlm.c
deleted file mode 100644 (file)
index 770d764..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, please see the file <mit-copyright.h>.
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-#include <roken.h>
-
-#include <ctype.h>
-
-#include "afsutil.h"
-
-/*
- * Specialized version of the kerberos krb_get_lrealm function.
- * krb_get_lrealm takes a pointer to a string, and a number, n.  It fills
- * in the string, r, with the name of the nth realm specified on the
- * first line of the kerberos config file (KRB_CONF, defined in "krb.h").
- * It returns 0 (KSUCCESS) on success, and KFAILURE on failure.
- *
- * On the kerberos version if the config file does not exist, and if n=1, a
- * successful return will occur with r = KRB_REALM (also defined in "krb.h").
- *
- */
-#define        KSUCCESS        0
-#define        KFAILURE        (-1)
-
-static char *
-parse_str(char *buffer, char *result, int size)
-{
-    int n=0;
-
-    if (!buffer)
-        goto cleanup;
-
-    while (*buffer && isspace(*buffer))
-        buffer++;
-    while (*buffer && !isspace(*buffer)) {
-       if (n < size - 1) {
-           *result++=*buffer++;
-           n++;
-       } else {
-           buffer++;
-       }
-    }
-
-  cleanup:
-    *result='\0';
-    return buffer;
-}
-
-
-int
-afs_krb_get_lrealm(char *r, int n)
-{
-    char linebuf[2048];
-    char tr[AFS_REALM_SZ] = "";
-    char *p;
-    FILE *cnffile/*, *fopen()*/;
-    int i;
-    int rv = KFAILURE;
-
-    *r = '\0';
-
-    if ((cnffile = fopen(AFSDIR_SERVER_KCONF_FILEPATH, "r")) == NULL) {
-       return (KFAILURE);
-    }
-    if (fgets(linebuf, sizeof(linebuf)-1, cnffile) == NULL) {
-       goto cleanup;
-    }
-    linebuf[sizeof(linebuf)-1] = '\0';
-    for (i=0, p=linebuf; i<=n && *p; i++) {
-        p = parse_str(p, tr, AFS_REALM_SZ);
-    }
-
-    if (*tr) {
-       strcpy(r,tr);
-       rv = KSUCCESS;
-    }
-
-  cleanup:
-    (void)fclose(cnffile);
-    return rv;
-}
-
-int
-afs_krb_exclusion(char * name)
-{
-    char linebuf[2048];
-    char excl_name[256] = "";
-    FILE *cnffile/*, *fopen()*/;
-    int exclude = 0;
-
-    if ((cnffile = fopen(AFSDIR_SERVER_KRB_EXCL_FILEPATH, "r")) == NULL)
-       return exclude;
-
-    for (;;) {
-       if (fgets(linebuf, sizeof(linebuf)-1, cnffile) == NULL) {
-           goto cleanup;
-       }
-       linebuf[sizeof(linebuf)-1] = '\0';
-        parse_str(linebuf, excl_name, sizeof(excl_name));
-
-       if (!strcmp(name,excl_name)) {
-           exclude = 1;
-           break;
-       }
-    }
-
-  cleanup:
-    (void)fclose(cnffile);
-    return exclude;
-}
-
-int
-afs_is_foreign_ticket_name(char *tname, char *tinst, char * tcell, char *localrealm)
-{
-    int foreign = 0;
-
-    if (localrealm && strcasecmp(localrealm, tcell))
-       foreign = 1;
-
-    if (foreign) {
-       static char local_realms[AFS_NUM_LREALMS][AFS_REALM_SZ];
-       static int  num_lrealms = -1;
-       int lrealm_match, i;
-       char uname[256];
-
-       if (num_lrealms == -1) {
-           for (i=0; i<AFS_NUM_LREALMS; i++) {
-               if (afs_krb_get_lrealm(local_realms[i], i) != 0 /*KSUCCESS*/)
-                   break;
-           }
-
-           if (i==0 && localrealm) {
-               strncpy(local_realms[0], localrealm, AFS_REALM_SZ);
-               num_lrealms = 1;
-           } else {
-               num_lrealms = i;
-           }
-       }
-
-       /* See if the ticket cell matches one of the local realms */
-       lrealm_match = 0;
-       for ( i=0;i<num_lrealms;i++ ) {
-           if (!strcasecmp(local_realms[i], tcell)) {
-               lrealm_match = 1;
-               break;
-           }
-       }
-
-       /* If yes, then make sure that the name is not present in
-        * an exclusion list */
-       if (lrealm_match) {
-           if (tinst && tinst[0])
-               snprintf(uname,sizeof(uname),"%s.%s@%s",tname,tinst,tcell);
-           else
-               snprintf(uname,sizeof(uname),"%s@%s",tname,tcell);
-
-           if (afs_krb_exclusion(uname))
-               lrealm_match = 0;
-       }
-
-       foreign = !lrealm_match;
-    }
-    return foreign;
-}
-
-
-