Remove UKERNEL code from files that don't need it
authorChaskiel Grundman <cg2v@andrew.cmu.edu>
Wed, 29 May 2013 17:24:37 +0000 (13:24 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Mon, 1 Dec 2014 23:23:51 +0000 (18:23 -0500)
Remove #ifdef UKERNEL sections from auth, kauth, ptserver, and ubik sources
that are no longer part of libuafs

Change-Id: I515f65c7e634d9562680c60666a15758261aaae0
Reviewed-on: http://gerrit.openafs.org/9955
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/auth/authcon.c
src/auth/userok.c
src/kauth/authclient.c
src/kauth/kalocalcell.c
src/kauth/katoken.c
src/kauth/user.c
src/ptserver/ptuser.c
src/ubik/ubik.p.h
src/ubik/ubikclient.c

index 9000fe3..21ef54f 100644 (file)
@@ -42,7 +42,6 @@ QuickAuth(struct rx_securityClass **astr, afs_int32 *aindex)
     return 0;
 }
 
-#if !defined(UKERNEL)
 static int _afsconf_GetRxkadKrb5Key(void *arock, int kvno, int enctype, void *outkey,
                                    size_t *keylen)
 {
@@ -91,7 +90,6 @@ afsconf_ServerAuth(void *arock,
        return 2;
     }
 }
-#endif /* !defined(UKERNEL) */
 
 static afs_int32
 GenericAuth(struct afsconf_dir *adir,
@@ -99,9 +97,6 @@ GenericAuth(struct afsconf_dir *adir,
            afs_int32 *aindex,
            rxkad_level enclevel)
 {
-#ifdef UKERNEL
-    return QuickAuth(astr, aindex);
-#else
     int enctype_preflist[]={18, 17, 23, 16, 0};
     char tbuffer[512];
     struct ktc_encryptionKey key, session;
@@ -179,7 +174,6 @@ GenericAuth(struct afsconf_dir *adir,
     *astr = tclass;
     *aindex = RX_SECIDX_KAD;
     return 0;
-#endif
 }
 
 /* build a fake ticket for 'afs' using keys from adir, returning an
@@ -302,7 +296,6 @@ afsconf_SetSecurityFlags(struct afsconf_dir *dir,
  * Build a set of security classes suitable for a server accepting
  * incoming connections
  */
-#if !defined(UKERNEL)
 void
 afsconf_BuildServerSecurityObjects(void *rock,
                                   struct rx_securityClass ***classes,
@@ -328,7 +321,6 @@ afsconf_BuildServerSecurityObjects(void *rock,
            rxkad_NewKrb5ServerSecurityObject(rxkad_crypt, dir, afsconf_GetKey,
                                              _afsconf_GetRxkadKrb5Key, NULL);
 }
-#endif
 
 /*!
  * Pick a security class to use for an outgoing connection
index 90d6333..fdb3038 100644 (file)
@@ -46,7 +46,6 @@ UserListFileName(struct afsconf_dir *adir,
     strcompose(buffer, len, adir->name, "/", AFSDIR_ULIST_FILE, (char *)NULL);
 }
 
-#if !defined(UKERNEL)
 int
 afsconf_CheckAuth(void *arock, struct rx_call *acall)
 {
@@ -57,7 +56,6 @@ afsconf_CheckAuth(void *arock, struct rx_call *acall)
     UNLOCK_GLOBAL_MUTEX;
     return rc;
 }
-#endif /* !defined(UKERNEL) */
 
 static int
 GetNoAuthFlag(struct afsconf_dir *adir)
index 9507cbd..4db0cbc 100644 (file)
 #include "kauth.h"
 #include "kautils.h"
 
-#ifdef UKERNEL
-#include "afs_usrops.h"
-#endif
-
 static struct afsconf_dir *conf = 0;
 static struct afsconf_cell explicit_cell_server_list;
 static struct afsconf_cell debug_cell_server_list;
@@ -110,11 +106,7 @@ ka_GetServers(char *cell, struct afsconf_cell * cellinfo)
        cell = lcstring(cellname, cell, sizeof(cellname));
 
     if (!conf) {
-#ifdef UKERNEL
-       conf = afs_cdir;
-#else /* UKERNEL */
        conf = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH);
-#endif /* UKERNEL */
        if (!conf) {
            UNLOCK_GLOBAL_MUTEX;
            return KANOCELLS;
index 9d03b3a..c28cb4a 100644 (file)
 #include "kauth.h"
 #include "kautils.h"
 
-#ifdef UKERNEL
-#include "afs_usrops.h"
-#endif
-
 /* This is a utility routine that many parts of kauth use but it invokes the
    afsconf package so its best to have it in a separate .o file to make the
    linker happy. */
@@ -35,11 +31,6 @@ static char cell_name[MAXCELLCHARS];
 int
 ka_CellConfig(const char *dir)
 {
-#ifdef UKERNEL
-    conf = afs_cdir;
-    strcpy(cell_name, afs_LclCellName);
-    return 0;
-#else /* UKERNEL */
     int code;
 
     LOCK_GLOBAL_MUTEX;
@@ -53,25 +44,18 @@ ka_CellConfig(const char *dir)
     code = afsconf_GetLocalCell(conf, cell_name, sizeof(cell_name));
     UNLOCK_GLOBAL_MUTEX;
     return code;
-#endif /* UKERNEL */
 }
 
 char *
 ka_LocalCell(void)
 {
-#ifndef UKERNEL
     int code = 0;
-#endif
 
     LOCK_GLOBAL_MUTEX;
     if (conf) {
        UNLOCK_GLOBAL_MUTEX;
        return cell_name;
     }
-#ifdef UKERNEL
-    conf = afs_cdir;
-    strcpy(cell_name, afs_LclCellName);
-#else /* UKERNEL */
     if ((conf = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH))) {
        code = afsconf_GetLocalCell(conf, cell_name, sizeof(cell_name));
 /* leave conf open so we can lookup other cells */
@@ -83,7 +67,6 @@ ka_LocalCell(void)
        UNLOCK_GLOBAL_MUTEX;
        return 0;
     }
-#endif /* UKERNEL */
     UNLOCK_GLOBAL_MUTEX;
     return cell_name;
 }
index 0387a10..9d9bfd3 100644 (file)
 #include <roken.h>
 #include <afs/opr.h>
 
-#ifdef UKERNEL
-# include "afsincludes.h"
-#endif
-
 #include <rx/xdr.h>
 #include <afs/pthread_glock.h>
 #include <afs/cellconfig.h>
index d4e6417..cc678aa 100644 (file)
 #include <afs/ptuser.h>
 #include <afs/ptserver.h>
 #include <afs/afsutil.h>
-
-#ifndef UKERNEL
 #include <afs/sys_prototypes.h>
-#endif
 
 #include <rx/rx.h>
 #include <rx/rx_globals.h>
@@ -186,7 +183,7 @@ ka_UserAuthenticateGeneral(afs_int32 flags, char *name, char *instance,
        if (flags & KA_USERAUTH_DOSETPAG)
            afs_setpag();
 #else
-#if !defined(UKERNEL) && !defined(AFS_NT40_ENV)
+#if !defined(AFS_NT40_ENV)
        if (flags & KA_USERAUTH_DOSETPAG)
            setpag();
 #endif
@@ -244,7 +241,6 @@ ka_UserAuthenticate(char *name, char *instance, char *realm, char *password,
                                      reasonP);
 }
 
-#if !defined(UKERNEL)
 afs_int32
 ka_UserReadPassword(char *prompt, char *password, int plen, char **reasonP)
 {
@@ -268,7 +264,6 @@ ka_UserReadPassword(char *prompt, char *password, int plen, char **reasonP)
     }
     return code;
 }
-#endif /* !defined(UKERNEL) */
 
 afs_int32
 ka_VerifyUserPassword(afs_int32 version, char *name, char *instance,
index 87142df..4296149 100644 (file)
 #include "ptuser.h"
 #include "pterror.h"
 
-#ifdef UKERNEL
-# include "afs_usrops.h"
-#endif
-
 struct ubik_client *pruclient = 0;
 static afs_int32 lastLevel;    /* security level pruclient, if any */
 
@@ -188,9 +184,7 @@ pr_Initialize(IN afs_int32 secLevel, IN const char *confDir, IN char *cell)
     afs_int32 secFlags;
     static struct afsconf_cell info;
     afs_int32 i;
-#if !defined(UKERNEL)
     char cellstr[64];
-#endif
     afs_int32 gottdir = 0;
     afs_int32 refresh = 0;
 
@@ -199,11 +193,6 @@ pr_Initialize(IN afs_int32 secLevel, IN const char *confDir, IN char *cell)
     initialize_ACFG_error_table();
     initialize_KTC_error_table();
 
-#if defined(UKERNEL)
-    if (!cell) {
-        cell = afs_LclCellName;
-    }
-#else /* defined(UKERNEL) */
     if (!cell) {
         if (!tdir)
             tdir = afsconf_Open(confDir);
@@ -228,7 +217,6 @@ pr_Initialize(IN afs_int32 secLevel, IN const char *confDir, IN char *cell)
         }
         cell = cellstr;
     }
-#endif /* defined(UKERNEL) */
 
     if (tdir == NULL || strcmp(confDir, tconfDir) || strcmp(cell, tcell)) {
        /*
@@ -247,9 +235,6 @@ pr_Initialize(IN afs_int32 secLevel, IN const char *confDir, IN char *cell)
        strncpy(tconfDir, confDir, sizeof(tconfDir));
         strncpy(tcell, cell, sizeof(tcell));
 
-#if defined(UKERNEL)
-       tdir = afs_cdir;
-#else /* defined(UKERNEL) */
         if (!gottdir)
             tdir = afsconf_Open(confDir);
        if (!tdir) {
@@ -262,7 +247,6 @@ pr_Initialize(IN afs_int32 secLevel, IN const char *confDir, IN char *cell)
                        "libprot: No configuration directory specified.\n");
            return -1;
        }
-#endif /* defined(UKERNEL) */
 
        code = afsconf_GetCellInfo(tdir, cell, "afsprot", &info);
        if (code) {
index 23a6a0d..8e40264 100644 (file)
@@ -121,11 +121,7 @@ struct ubik_stat {
     afs_int32 mtime;
 };
 
-#if defined(UKERNEL)
-#include "afs/lock.h"
-#else /* defined(UKERNEL) */
 #include <lock.h>              /* just to make sure we've got this */
-#endif /* defined(UKERNEL) */
 
 /*!
  * \brief representation of a ubik database.
@@ -139,11 +135,9 @@ struct ubik_dbase {
     struct ubik_version version;       /*!< version number */
 #ifdef AFS_PTHREAD_ENV
     pthread_mutex_t versionLock;       /*!< lock on version number */
-#elif defined(UKERNEL)
-    struct afs_lock versionLock;       /*!< lock on version number */
-#else                          /* defined(UKERNEL) */
+#else
     struct Lock versionLock;   /*!< lock on version number */
-#endif                         /* defined(UKERNEL) */
+#endif
     afs_int32 tidCounter;      /*!< last RW or RO trans tid counter */
     afs_int32 writeTidCounter; /*!< last write trans tid counter */
     afs_int32 flags;           /*!< flags */
@@ -163,11 +157,7 @@ struct ubik_dbase {
     int (*getnfiles) (struct ubik_dbase * adbase);     /*!< find out number of files */
     short readers;             /*!< number of current read transactions */
     struct ubik_version cachedVersion; /*!< version of caller's cached data */
-#ifdef UKERNEL
-    struct afs_lock cache_lock;
-#else
     struct Lock cache_lock; /*!< protects cached application data */
-#endif
 #ifdef AFS_PTHREAD_ENV
     pthread_cond_t version_cond;    /*!< condition variable to manage changes to version */
     pthread_cond_t flags_cond;      /*!< condition variable to manage changes to flags */
index f39ba1e..450b153 100644 (file)
 # pragma GCC diagnostic warning "-Wstrict-prototypes"
 #endif
 
-#ifdef UKERNEL
-#include "afsincludes.h"
-#endif
-
 #include <afs/pthread_glock.h>
 #include <rx/xdr.h>
 #include <rx/rx.h>
@@ -103,7 +99,6 @@ afs_random_once(void)
 
 #endif
 
-#if !defined(UKERNEL)
 /*!
  * \brief use time and pid to try to get some initial randomness.
  */
@@ -179,7 +174,6 @@ afs_randomMod15(void)
 
     return temp;
 }
-#endif /* !defined(UKERNEL) */
 
 #ifdef abs
 #undef abs