From 23d81757394824702c3e8bce31fd0f6d568dd680 Mon Sep 17 00:00:00 2001 From: Chaskiel Grundman Date: Wed, 29 May 2013 13:24:37 -0400 Subject: [PATCH] Remove UKERNEL code from files that don't need it 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 Reviewed-by: Benjamin Kaduk --- src/auth/authcon.c | 8 -------- src/auth/userok.c | 2 -- src/kauth/authclient.c | 8 -------- src/kauth/kalocalcell.c | 17 ----------------- src/kauth/katoken.c | 4 ---- src/kauth/user.c | 7 +------ src/ptserver/ptuser.c | 16 ---------------- src/ubik/ubik.p.h | 14 ++------------ src/ubik/ubikclient.c | 6 ------ 9 files changed, 3 insertions(+), 79 deletions(-) diff --git a/src/auth/authcon.c b/src/auth/authcon.c index 9000fe3..21ef54f 100644 --- a/src/auth/authcon.c +++ b/src/auth/authcon.c @@ -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 diff --git a/src/auth/userok.c b/src/auth/userok.c index 90d6333..fdb3038 100644 --- a/src/auth/userok.c +++ b/src/auth/userok.c @@ -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) diff --git a/src/kauth/authclient.c b/src/kauth/authclient.c index 9507cbd..4db0cbc 100644 --- a/src/kauth/authclient.c +++ b/src/kauth/authclient.c @@ -36,10 +36,6 @@ #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; diff --git a/src/kauth/kalocalcell.c b/src/kauth/kalocalcell.c index 9d03b3a..c28cb4a 100644 --- a/src/kauth/kalocalcell.c +++ b/src/kauth/kalocalcell.c @@ -21,10 +21,6 @@ #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; } diff --git a/src/kauth/katoken.c b/src/kauth/katoken.c index 0387a10..9d9bfd3 100644 --- a/src/kauth/katoken.c +++ b/src/kauth/katoken.c @@ -18,10 +18,6 @@ #include #include -#ifdef UKERNEL -# include "afsincludes.h" -#endif - #include #include #include diff --git a/src/kauth/user.c b/src/kauth/user.c index d4e6417..cc678aa 100644 --- a/src/kauth/user.c +++ b/src/kauth/user.c @@ -27,10 +27,7 @@ #include #include #include - -#ifndef UKERNEL #include -#endif #include #include @@ -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, diff --git a/src/ptserver/ptuser.c b/src/ptserver/ptuser.c index 87142df..4296149 100644 --- a/src/ptserver/ptuser.c +++ b/src/ptserver/ptuser.c @@ -25,10 +25,6 @@ #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) { diff --git a/src/ubik/ubik.p.h b/src/ubik/ubik.p.h index 23a6a0d..8e40264 100644 --- a/src/ubik/ubik.p.h +++ b/src/ubik/ubik.p.h @@ -121,11 +121,7 @@ struct ubik_stat { afs_int32 mtime; }; -#if defined(UKERNEL) -#include "afs/lock.h" -#else /* defined(UKERNEL) */ #include /* 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 */ diff --git a/src/ubik/ubikclient.c b/src/ubik/ubikclient.c index f39ba1e..450b153 100644 --- a/src/ubik/ubikclient.c +++ b/src/ubik/ubikclient.c @@ -21,10 +21,6 @@ # pragma GCC diagnostic warning "-Wstrict-prototypes" #endif -#ifdef UKERNEL -#include "afsincludes.h" -#endif - #include #include #include @@ -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 -- 1.9.4