fi
fi
fi
+ if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
+ AC_DEFINE(HAVE_IN_SYSTM_H, 1, [define if you have in_systm.h header file])
+ fi
+ if test -f "$LINUX_KERNEL_PATH/include/linux/mm_inline.h"; then
+ AC_DEFINE(HAVE_MM_INLINE_H, 1, [define if you have mm_inline.h header file])
+ fi
+ if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
+ AC_DEFINE(HAVE_IN_SYSTM_H, 1, [define if you have in_systm.h header file])
+ fi
if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then
AC_DEFINE(EXPORTED_SYS_CHDIR, 1, [define if your linux kernel exports sys_chdir])
fi
s390-*-linux*)
AFS_SYSNAME="s390_linuxXX"
;;
+ s390x-*-linux*)
+ AFS_SYSNAME="s390x_linuxXX"
+ ;;
sparc-*-linux*)
AFS_SYSNAME="sparc_linuxXX"
;;
fi
fi
fi
+ if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
+ AC_DEFINE(HAVE_IN_SYSTM_H, 1, [define if you have in_systm.h header file])
+ fi
+ if test -f "$LINUX_KERNEL_PATH/include/linux/mm_inline.h"; then
+ AC_DEFINE(HAVE_MM_INLINE_H, 1, [define if you have mm_inline.h header file])
+ fi
+ if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
+ AC_DEFINE(HAVE_IN_SYSTM_H, 1, [define if you have in_systm.h header file])
+ fi
if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then
AC_DEFINE(EXPORTED_SYS_CHDIR, 1, [define if your linux kernel exports sys_chdir])
fi
s390-*-linux*)
AFS_SYSNAME="s390_linuxXX"
;;
+ s390x-*-linux*)
+ AFS_SYSNAME="s390x_linuxXX"
+ ;;
sparc-*-linux*)
AFS_SYSNAME="sparc_linuxXX"
;;
AIX64="#"
;;
+
rs_aix51)
DBG=""
LEX="lex"
AIX64=""
;;
+ rs_aix52)
+ DBG=""
+ LEX="lex"
+ LIBSYS_AIX_EXP="afsl.exp"
+ MT_CC="xlc_r"
+ MT_CFLAGS='-DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_LIBS="-lpthreads"
+ SHLIB_SUFFIX="o"
+ TXLIBS="-lcurses"
+ XCFLAGS="-K -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void"
+ XLIBS="${LIB_AFSDB} -ldl"
+ SHLIB_LINKER="${MT_CC} -bM:SRE -berok"
+ AIX64=""
+ ;;
s390_linux22)
CC="gcc"
CCOBJ="gcc"
- LD="gcc"
+ LD="ld"
KERN_OPTMZ=-O2
LEX="flex -l"
MT_CC="$CC"
s390_linux24)
CC="gcc"
CCOBJ="gcc"
- LD="gcc"
+ LD="ld"
KERN_OPTMZ=-O2
LEX="flex -l"
MT_CC="$CC"
SHLIB_LINKER="${MT_CC} -shared"
;;
+ s390x_linux24)
+ CC="gcc"
+ CCOBJ="gcc"
+ LD="ld"
+ KERN_OPTMZ=-O2
+ LEX="flex -l"
+ MT_CC="$CC"
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_LIBS="-lpthread"
+ PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC"
+ SHLIB_LDFLAGS="-shared -Xlinker -x"
+ TXLIBS="-lncurses"
+ XCFLAGS="-O -g -D_LARGEFILE64_SOURCE -D__s390x__"
+ YACC="bison -y"
+ SHLIB_LINKER="${MT_CC} -shared"
+ ;;
+
sgi_62)
PINSTALL_LIBS=-lmld
AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a"
AC_INIT(src/libafs/Makefile.common.in)
-AM_INIT_AUTOMAKE(openafs-libafs,devel)
+AM_INIT_AUTOMAKE(openafs-libafs,1.3.71)
AC_CONFIG_HEADER(src/config/afsconfig.h)
define(OPENAFS_CONFIGURE_LIBAFS)
AC_INIT(src/config/stds.h)
-AM_INIT_AUTOMAKE(openafs,devel)
+AM_INIT_AUTOMAKE(openafs,1.3.71)
AC_CONFIG_HEADER(src/config/afsconfig.h)
AC_PROG_CC
$(AFSKFWLIB)
LOGON_DLLSDKLIBS =\
- dnsapi.lib mpr.lib \
+ dnsapi.lib \
+ netapi32.lib \
+ mpr.lib \
advapi32.lib \
secur32.lib \
strsafe.lib \
cm_volume_t *cm_rootVolumep = NULL;
cm_cell_t *cm_rootCellp = NULL;
cm_fid_t cm_rootFid;
-cm_scache_t *cm_rootSCachep;
+cm_scache_t *cm_rootSCachep = NULL;
char cm_mountRoot[1024];
DWORD cm_mountRootLen;
int cm_logChunkSize;
char cm_NetbiosName[MAX_NB_NAME_LENGTH] = "";
-char cm_CachePath[200];
+char cm_CachePath[MAX_PATH];
DWORD cm_CachePathLen;
BOOL isGateway = FALSE;
code = RegQueryValueEx(parmKey, "LogoffTokenTransferTimeout",
NULL, NULL, (BYTE *) <to, &dummyLen);
if (code == ERROR_SUCCESS)
- afsi_log("Logoff token tranfer timeout %d seconds",
- ltto);
+ afsi_log("Logoff token tranfer timeout %d seconds", ltto);
else {
ltto = 10;
afsi_log("Default logoff token transfer timeout 10 seconds");
cm_sysName = cm_sysNameList[0];
dummyLen = MAXSYSNAME;
- code = RegQueryValueEx(parmKey, "SysName", NULL, NULL,
- cm_sysName, &dummyLen);
+ code = RegQueryValueEx(parmKey, "SysName", NULL, NULL, cm_sysName, &dummyLen);
if (code == ERROR_SUCCESS)
afsi_log("Sys name %s", cm_sysName);
else {
}
}
+
#ifdef AFS_FREELANCE_CLIENT
if (cm_freelanceEnabled)
cm_InitFreelance();
#endif
-
return 0;
}
#include <osilog.h>
#include <rxkad_prototypes.h> /* for life_to_time */
+#include <afs/ptserver.h>
/*
* TIMING _____________________________________________________________________
return(0);
}
+
+#define ALLOW_REGISTER 1
+static int
+ViceIDToUsername(char *username,
+ char *realm_of_user,
+ char *realm_of_cell,
+ char * cell_to_use,
+ struct ktc_principal *aclient,
+ struct ktc_principal *aserver,
+ struct ktc_token *atoken)
+{
+ static char lastcell[MAXCELLCHARS+1] = { 0 };
+ static char confname[512] = { 0 };
+ char username_copy[BUFSIZ];
+ long viceId; /* AFS uid of user */
+ int status = 0;
+#ifdef ALLOW_REGISTER
+ afs_int32 id;
+#endif /* ALLOW_REGISTER */
+
+ if (confname[0] == '\0') {
+ strncpy(confname, AFSDIR_CLIENT_ETC_DIRPATH, sizeof(confname));
+ confname[sizeof(confname) - 2] = '\0';
+ }
+
+ /*
+ * Talk about DUMB! It turns out that there is a bug in
+ * pr_Initialize -- even if you give a different cell name
+ * to it, it still uses a connection to a previous AFS server
+ * if one exists. The way to fix this is to change the
+ * _filename_ argument to pr_Initialize - that forces it to
+ * re-initialize the connection. We do this by adding and
+ * removing a "/" on the end of the configuration directory name.
+ */
+
+ if (lastcell[0] != '\0' && (strcmp(lastcell, aserver->cell) != 0)) {
+ int i = strlen(confname);
+ if (confname[i - 1] == '/') {
+ confname[i - 1] = '\0';
+ } else {
+ confname[i] = '/';
+ confname[i + 1] = '\0';
+ }
+ }
+
+ strcpy(lastcell, aserver->cell);
+
+ if (!pr_Initialize (0, confname, aserver->cell))
+ status = pr_SNameToId (username, &viceId);
+
+ /*
+ * This is a crock, but it is Transarc's crock, so
+ * we have to play along in order to get the
+ * functionality. The way the afs id is stored is
+ * as a string in the username field of the token.
+ * Contrary to what you may think by looking at
+ * the code for tokens, this hack (AFS ID %d) will
+ * not work if you change %d to something else.
+ */
+
+ /*
+ * This code is taken from cklog -- it lets people
+ * automatically register with the ptserver in foreign cells
+ */
+
+#ifdef ALLOW_REGISTER
+ if (status == 0) {
+ if (viceId != ANONYMOUSID) {
+#else /* ALLOW_REGISTER */
+ if ((status == 0) && (viceId != ANONYMOUSID))
+#endif /* ALLOW_REGISTER */
+ {
+#ifdef AFS_ID_TO_NAME
+ strncpy(username_copy, username, BUFSIZ);
+ snprintf (username, BUFSIZ, "%s (AFS ID %d)", username_copy, (int) viceId);
+#endif /* AFS_ID_TO_NAME */
+ }
+#ifdef ALLOW_REGISTER
+ } else if (strcmp(realm_of_user, realm_of_cell) != 0) {
+ id = 0;
+ strncpy(aclient->name, username, MAXKTCNAMELEN - 1);
+ strcpy(aclient->instance, "");
+ strncpy(aclient->cell, realm_of_user, MAXKTCREALMLEN - 1);
+ if (status = ktc_SetToken(aserver, atoken, aclient, 0))
+ return status;
+
+ /*
+ * In case you're wondering, we don't need to change the
+ * filename here because we're still connecting to the
+ * same cell -- we're just using a different authentication
+ * level
+ */
+
+ if (status = pr_Initialize(1L, confname, aserver->cell, 0))
+ return status;
+ if (status = pr_CreateUser(username, &id))
+ return status;
+#ifdef AFS_ID_TO_NAME
+ strncpy(username_copy, username, BUFSIZ);
+ snprintf (username, BUFSIZ, "%s (AFS ID %d)", username_copy, (int) viceId);
+#endif /* AFS_ID_TO_NAME */
+ }
+ }
+#endif /* ALLOW_REGISTER */
+ return status;
+}
+
+
int
KFW_AFS_klog(
krb5_context alt_ctx,
p[len] = '\0';
}
+ ViceIDToUsername(aclient.name, realm_of_user, realm_of_cell, CellName,
+ &aclient, &aserver, &atoken);
+
if ( smbname ) {
strncpy(aclient.smbname, smbname, sizeof(aclient.smbname));
aclient.smbname[sizeof(aclient.smbname)-1] = '\0';
strcpy(aclient.cell, CellName);
+ ViceIDToUsername(aclient.name, realm_of_user, realm_of_cell, CellName,
+ &aclient, &aserver, &atoken);
+
if ( smbname ) {
strncpy(aclient.smbname, smbname, sizeof(aclient.smbname));
aclient.smbname[sizeof(aclient.smbname)-1] = '\0';
#include <fcntl.h>
#include <winsock2.h>
+#include <lm.h>
#include <afs/param.h>
#include <afs/stds.h>
void DebugEvent0(char *a)
{
- HANDLE h; char *ptbuf[1];
- if (!ISLOGONTRACE(TraceOption))
- return;
- h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME);
- ptbuf[0] = a;
- ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);
- DeregisterEventSource(h);
+ HANDLE h; char *ptbuf[1];
+ if (!ISLOGONTRACE(TraceOption))
+ return;
+ h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME);
+ ptbuf[0] = a;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);
+ DeregisterEventSource(h);
}
#define MAXBUF_ 512
void DebugEvent(char *b,...)
{
- HANDLE h; char *ptbuf[1],buf[MAXBUF_+1];
- va_list marker;
+ HANDLE h; char *ptbuf[1],buf[MAXBUF_+1];
+ va_list marker;
- if (!ISLOGONTRACE(TraceOption))
- return;
+ if (!ISLOGONTRACE(TraceOption))
+ return;
- h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME);
- va_start(marker,b);
- StringCbVPrintf(buf, MAXBUF_+1,b,marker);
+ h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME);
+ va_start(marker,b);
+ StringCbVPrintf(buf, MAXBUF_+1,b,marker);
buf[MAXBUF_] = '\0';
- ptbuf[0] = buf;
- ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);\
- DeregisterEventSource(h);
- va_end(marker);
+ ptbuf[0] = buf;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);
+ DeregisterEventSource(h);
+ va_end(marker);
}
static HANDLE hInitMutex = NULL;
BOOLEAN APIENTRY DllEntryPoint(HANDLE dll, DWORD reason, PVOID reserved)
{
- hDLL = dll;
- switch (reason) {
+ hDLL = dll;
+ switch (reason) {
case DLL_PROCESS_ATTACH:
/* Initialization Mutex */
hInitMutex = CreateMutex(NULL, FALSE, NULL);
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
default:
- /* Everything else succeeds but does nothing. */
+ /* Everything else succeeds but does nothing. */
break;
- }
+ }
- return TRUE;
+ return TRUE;
}
void AfsLogonInit(void)
{
if ( bInit == FALSE ) {
- if ( WaitForSingleObject( hInitMutex, INFINITE ) == WAIT_OBJECT_0 ) {
- if ( bInit == FALSE ) {
- rx_Init(0);
- initAFSDirPath();
- ka_Init(0);
- bInit = TRUE;
- }
- ReleaseMutex(hInitMutex);
- }
+ if ( WaitForSingleObject( hInitMutex, INFINITE ) == WAIT_OBJECT_0 ) {
+ if ( bInit == FALSE ) {
+ rx_Init(0);
+ initAFSDirPath();
+ ka_Init(0);
+ bInit = TRUE;
+ }
+ ReleaseMutex(hInitMutex);
+ }
}
}
CHAR *GenRandomName(CHAR *pbuf)
{
- int i;
- srand( (unsigned)time( NULL ) );
- for (i=0;i<MAXRANDOMNAMELEN-1;i++)
- pbuf[i]='a'+(rand() % 26);
- pbuf[MAXRANDOMNAMELEN-1]=0;
- return pbuf;
+ int i;
+ srand( (unsigned)time( NULL ) );
+ for (i=0;i<MAXRANDOMNAMELEN-1;i++)
+ pbuf[i]='a'+(rand() % 26);
+ pbuf[MAXRANDOMNAMELEN-1]=0;
+ return pbuf;
}
BOOLEAN AFSWillAutoStart(void)
{
- SC_HANDLE scm;
- SC_HANDLE svc;
- BOOLEAN flag;
- BOOLEAN result = FALSE;
- LPQUERY_SERVICE_CONFIG pConfig = NULL;
- DWORD BufSize;
- LONG status;
-
- /* Open services manager */
- scm = OpenSCManager(NULL, NULL, GENERIC_READ);
- if (!scm) return FALSE;
-
- /* Open AFSD service */
- svc = OpenService(scm, "TransarcAFSDaemon", SERVICE_QUERY_CONFIG);
- if (!svc)
- goto close_scm;
-
- /* Query AFSD service config, first just to get buffer size */
- /* Expected to fail, so don't test return value */
- (void) QueryServiceConfig(svc, NULL, 0, &BufSize);
- status = GetLastError();
- if (status != ERROR_INSUFFICIENT_BUFFER)
- goto close_svc;
-
- /* Allocate buffer */
- pConfig = (LPQUERY_SERVICE_CONFIG)GlobalAlloc(GMEM_FIXED,BufSize);
- if (!pConfig)
- goto close_svc;
-
- /* Query AFSD service config, this time for real */
- flag = QueryServiceConfig(svc, pConfig, BufSize, &BufSize);
- if (!flag)
- goto free_pConfig;
-
- /* Is it autostart? */
- if (pConfig->dwStartType < SERVICE_DEMAND_START)
- result = TRUE;
-
-free_pConfig:
- GlobalFree(pConfig);
-close_svc:
- CloseServiceHandle(svc);
-close_scm:
- CloseServiceHandle(scm);
-
- return result;
+ SC_HANDLE scm;
+ SC_HANDLE svc;
+ BOOLEAN flag;
+ BOOLEAN result = FALSE;
+ LPQUERY_SERVICE_CONFIG pConfig = NULL;
+ DWORD BufSize;
+ LONG status;
+
+ /* Open services manager */
+ scm = OpenSCManager(NULL, NULL, GENERIC_READ);
+ if (!scm) return FALSE;
+
+ /* Open AFSD service */
+ svc = OpenService(scm, "TransarcAFSDaemon", SERVICE_QUERY_CONFIG);
+ if (!svc)
+ goto close_scm;
+
+ /* Query AFSD service config, first just to get buffer size */
+ /* Expected to fail, so don't test return value */
+ (void) QueryServiceConfig(svc, NULL, 0, &BufSize);
+ status = GetLastError();
+ if (status != ERROR_INSUFFICIENT_BUFFER)
+ goto close_svc;
+
+ /* Allocate buffer */
+ pConfig = (LPQUERY_SERVICE_CONFIG)GlobalAlloc(GMEM_FIXED,BufSize);
+ if (!pConfig)
+ goto close_svc;
+
+ /* Query AFSD service config, this time for real */
+ flag = QueryServiceConfig(svc, pConfig, BufSize, &BufSize);
+ if (!flag)
+ goto free_pConfig;
+
+ /* Is it autostart? */
+ if (pConfig->dwStartType < SERVICE_DEMAND_START)
+ result = TRUE;
+
+ free_pConfig:
+ GlobalFree(pConfig);
+ close_svc:
+ CloseServiceHandle(svc);
+ close_scm:
+ CloseServiceHandle(scm);
+
+ return result;
}
DWORD MapAuthError(DWORD code)
{
- switch (code) {
- /* Unfortunately, returning WN_NO_NETWORK results in the MPR abandoning
- * logon scripts for all credential managers, although they will still
- * receive logon notifications. Since we don't want this, we return
- * WN_SUCCESS. This is highly undesirable, but we also don't want to
- * break other network providers.
- */
-/* case KTC_NOCM:
- case KTC_NOCMRPC:
- return WN_NO_NETWORK; */
- default: return WN_SUCCESS;
- }
+ switch (code) {
+ /* Unfortunately, returning WN_NO_NETWORK results in the MPR abandoning
+ * logon scripts for all credential managers, although they will still
+ * receive logon notifications. Since we don't want this, we return
+ * WN_SUCCESS. This is highly undesirable, but we also don't want to
+ * break other network providers.
+ */
+ /* case KTC_NOCM:
+ case KTC_NOCMRPC:
+ return WN_NO_NETWORK; */
+ default: return WN_SUCCESS;
+ }
}
DWORD APIENTRY NPGetCaps(DWORD index)
{
- switch (index) {
- case WNNC_NET_TYPE:
- /* Don't have our own type; use somebody else's. */
- return WNNC_NET_SUN_PC_NFS;
-
- case WNNC_START:
- /* Say we are already started, even though we might wait after we receive NPLogonNotify */
- return 1;
-
- default:
- return 0;
- }
+ switch (index) {
+ case WNNC_NET_TYPE:
+ /* Don't have our own type; use somebody else's. */
+ return WNNC_NET_SUN_PC_NFS;
+
+ case WNNC_START:
+ /* Say we are already started, even though we might wait after we receive NPLogonNotify */
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+NET_API_STATUS
+NetUserGetProfilePath( LPCWSTR Domain, LPCWSTR UserName, char * profilePath,
+ DWORD profilePathLen )
+{
+ NET_API_STATUS code;
+ LPWSTR ServerName = NULL;
+ LPUSER_INFO_3 p3 = NULL;
+
+ NetGetAnyDCName(NULL, Domain, (LPBYTE *)&ServerName);
+ /* if NetGetAnyDCName fails, ServerName == NULL
+ * NetUserGetInfo will obtain local user information
+ */
+ code = NetUserGetInfo(ServerName, UserName, 3, (LPBYTE *)&p3);
+ if (code == NERR_Success)
+ {
+ code = NERR_UserNotFound;
+ if (p3) {
+ if (p3->usri3_profile) {
+ DWORD len = lstrlenW(p3->usri3_profile);
+ if (len > 0) {
+ /* Convert From Unicode to ANSI (UTF-8 for future) */
+ len = len < profilePathLen ? len : profilePathLen - 1;
+ WideCharToMultiByte(CP_UTF8, 0, p3->usri3_profile, len, profilePath, len, NULL, NULL);
+ profilePath[len] = '\0';
+ code = NERR_Success;
+ }
+ }
+ NetApiBufferFree(p3);
+ }
+ }
+ if (ServerName)
+ NetApiBufferFree(ServerName);
+ return code;
}
BOOL IsServiceRunning (void)
/* Get domain specific configuration info. We are returning void because if anything goes wrong
we just return defaults.
*/
-void GetDomainLogonOptions( PLUID lpLogonId, char * username, char * domain, LogonOptions_t *opt ) {
- HKEY hkParm = NULL; /* Service parameter */
- HKEY hkNp = NULL; /* network provider key */
- HKEY hkDoms = NULL; /* domains key */
- HKEY hkDom = NULL; /* DOMAINS/domain key */
- HKEY hkTemp = NULL;
- LONG rv;
- DWORD dwSize;
- DWORD dwType;
- DWORD dwDummy;
- char computerName[MAX_COMPUTERNAME_LENGTH + 1];
- char *effDomain;
-
- DebugEvent("In GetDomainLogonOptions for user [%s] in domain [%s]", username, domain);
- /* If the domain is the same as the Netbios computer name, we use the LOCALHOST domain name*/
- opt->flags = LOGON_FLAG_REMOTE;
- if(domain) {
- dwSize = MAX_COMPUTERNAME_LENGTH;
- if(GetComputerName(computerName, &dwSize)) {
- if(!stricmp(computerName, domain)) {
- effDomain = "LOCALHOST";
- opt->flags = LOGON_FLAG_LOCAL;
- }
- else
- effDomain = domain;
- }
- } else
- effDomain = NULL;
-
- rv = RegOpenKeyEx( HKEY_LOCAL_MACHINE, REG_CLIENT_PARMS_KEY, 0, KEY_READ, &hkParm );
- if(rv != ERROR_SUCCESS) {
- hkParm = NULL;
- DebugEvent("GetDomainLogonOption: Can't open parms key [%d]", rv);
- }
-
- rv = RegOpenKeyEx( HKEY_LOCAL_MACHINE, REG_CLIENT_PROVIDER_KEY, 0, KEY_READ, &hkNp );
- if(rv != ERROR_SUCCESS) {
- hkNp = NULL;
- DebugEvent("GetDomainLogonOptions: Can't open NP key [%d]", rv);
- }
-
- if(hkNp) {
- rv = RegOpenKeyEx( hkNp, REG_CLIENT_DOMAINS_SUBKEY, 0, KEY_READ, &hkDoms );
- if( rv != ERROR_SUCCESS ) {
- hkDoms = NULL;
- DebugEvent("GetDomainLogonOptions: Can't open Domains key [%d]", rv);
- }
- }
-
- if(hkDoms && effDomain) {
- rv = RegOpenKeyEx( hkDoms, effDomain, 0, KEY_READ, &hkDom );
- if( rv != ERROR_SUCCESS ) {
- hkDom = NULL;
- DebugEvent("GetDomainLogonOptions: Can't open domain key for [%s] [%d]", effDomain, rv);
- /* If none of the domains match, we shouldn't use the domain key either */
- RegCloseKey(hkDoms);
- hkDoms = NULL;
- }
- } else
- DebugEvent("Not opening domain key for [%s]", effDomain);
-
- /* Each individual can either be specified on the domain key, the domains key or in the
- net provider key. They fail over in that order. If none is found, we just use the
- defaults. */
-
- /* LogonOption */
- LOOKUPKEYCHAIN(opt->LogonOption, REG_DWORD, DEFAULT_LOGON_OPTION, REG_CLIENT_LOGON_OPTION_PARM);
-
- /* FailLoginsSilently */
- dwSize = sizeof(dwDummy);
- rv = RegQueryValueEx(hkParm, REG_CLIENT_FAIL_SILENTLY_PARM, 0, &dwType, (LPBYTE) &dwDummy, &dwSize);
- if(rv != ERROR_SUCCESS)
- LOOKUPKEYCHAIN(dwDummy, REG_DWORD, DEFAULT_FAIL_SILENTLY, REG_CLIENT_FAIL_SILENTLY_PARM);
+void
+GetDomainLogonOptions( PLUID lpLogonId, char * username, char * domain, LogonOptions_t *opt ) {
+ HKEY hkParm = NULL; /* Service parameter */
+ HKEY hkNp = NULL; /* network provider key */
+ HKEY hkDoms = NULL; /* domains key */
+ HKEY hkDom = NULL; /* DOMAINS/domain key */
+ HKEY hkTemp = NULL;
+ LONG rv;
+ DWORD dwSize;
+ DWORD dwType;
+ DWORD dwDummy;
+ char computerName[MAX_COMPUTERNAME_LENGTH + 1];
+ char *effDomain;
+
+ DebugEvent("In GetDomainLogonOptions for user [%s] in domain [%s]", username, domain);
+ /* If the domain is the same as the Netbios computer name, we use the LOCALHOST domain name*/
+ opt->flags = LOGON_FLAG_REMOTE;
+ if(domain) {
+ dwSize = MAX_COMPUTERNAME_LENGTH;
+ if(GetComputerName(computerName, &dwSize)) {
+ if(!stricmp(computerName, domain)) {
+ effDomain = "LOCALHOST";
+ opt->flags = LOGON_FLAG_LOCAL;
+ }
+ else
+ effDomain = domain;
+ }
+ } else
+ effDomain = NULL;
+
+ rv = RegOpenKeyEx( HKEY_LOCAL_MACHINE, REG_CLIENT_PARMS_KEY, 0, KEY_READ, &hkParm );
+ if(rv != ERROR_SUCCESS) {
+ hkParm = NULL;
+ DebugEvent("GetDomainLogonOption: Can't open parms key [%d]", rv);
+ }
+
+ rv = RegOpenKeyEx( HKEY_LOCAL_MACHINE, REG_CLIENT_PROVIDER_KEY, 0, KEY_READ, &hkNp );
+ if(rv != ERROR_SUCCESS) {
+ hkNp = NULL;
+ DebugEvent("GetDomainLogonOptions: Can't open NP key [%d]", rv);
+ }
+
+ if(hkNp) {
+ rv = RegOpenKeyEx( hkNp, REG_CLIENT_DOMAINS_SUBKEY, 0, KEY_READ, &hkDoms );
+ if( rv != ERROR_SUCCESS ) {
+ hkDoms = NULL;
+ DebugEvent("GetDomainLogonOptions: Can't open Domains key [%d]", rv);
+ }
+ }
+
+ if(hkDoms && effDomain) {
+ rv = RegOpenKeyEx( hkDoms, effDomain, 0, KEY_READ, &hkDom );
+ if( rv != ERROR_SUCCESS ) {
+ hkDom = NULL;
+ DebugEvent("GetDomainLogonOptions: Can't open domain key for [%s] [%d]", effDomain, rv);
+ /* If none of the domains match, we shouldn't use the domain key either */
+ RegCloseKey(hkDoms);
+ hkDoms = NULL;
+ }
+ } else
+ DebugEvent("Not opening domain key for [%s]", effDomain);
+
+ /* Each individual can either be specified on the domain key, the domains key or in the
+ net provider key. They fail over in that order. If none is found, we just use the
+ defaults. */
+
+ /* LogonOption */
+ LOOKUPKEYCHAIN(opt->LogonOption, REG_DWORD, DEFAULT_LOGON_OPTION, REG_CLIENT_LOGON_OPTION_PARM);
+
+ /* FailLoginsSilently */
+ dwSize = sizeof(dwDummy);
+ rv = RegQueryValueEx(hkParm, REG_CLIENT_FAIL_SILENTLY_PARM, 0, &dwType, (LPBYTE) &dwDummy, &dwSize);
+ if (rv != ERROR_SUCCESS)
+ LOOKUPKEYCHAIN(dwDummy, REG_DWORD, DEFAULT_FAIL_SILENTLY, REG_CLIENT_FAIL_SILENTLY_PARM);
opt->failSilently = !!dwDummy;
- /* Retry interval */
- LOOKUPKEYCHAIN(opt->retryInterval, REG_DWORD, DEFAULT_RETRY_INTERVAL, REG_CLIENT_RETRY_INTERVAL_PARM);
+ /* Retry interval */
+ LOOKUPKEYCHAIN(opt->retryInterval, REG_DWORD, DEFAULT_RETRY_INTERVAL, REG_CLIENT_RETRY_INTERVAL_PARM);
- /* Sleep interval */
- LOOKUPKEYCHAIN(opt->sleepInterval, REG_DWORD, DEFAULT_SLEEP_INTERVAL, REG_CLIENT_SLEEP_INTERVAL_PARM);
+ /* Sleep interval */
+ LOOKUPKEYCHAIN(opt->sleepInterval, REG_DWORD, DEFAULT_SLEEP_INTERVAL, REG_CLIENT_SLEEP_INTERVAL_PARM);
- opt->logonScript = NULL;
- opt->smbName = NULL;
+ opt->logonScript = NULL;
+ opt->smbName = NULL;
- if(!ISLOGONINTEGRATED(opt->LogonOption)) {
- goto cleanup; /* no need to lookup the logon script */
- }
+ if(!ISLOGONINTEGRATED(opt->LogonOption)) {
+ goto cleanup; /* no need to lookup the logon script */
+ }
- /* come up with SMB username */
- if(ISHIGHSECURITY(opt->LogonOption)) {
+ /* come up with SMB username */
+ if(ISHIGHSECURITY(opt->LogonOption)) {
opt->smbName = malloc( MAXRANDOMNAMELEN );
- GenRandomName(opt->smbName);
- } else {
- /* username and domain for logon session is not necessarily the same as
- username and domain passed into network provider. */
- PSECURITY_LOGON_SESSION_DATA plsd;
- char lsaUsername[MAX_USERNAME_LENGTH];
- char lsaDomain[MAX_DOMAIN_LENGTH];
- size_t len, tlen;
+ GenRandomName(opt->smbName);
+ } else {
+ /* username and domain for logon session is not necessarily the same as
+ username and domain passed into network provider. */
+ PSECURITY_LOGON_SESSION_DATA plsd;
+ char lsaUsername[MAX_USERNAME_LENGTH];
+ char lsaDomain[MAX_DOMAIN_LENGTH];
+ size_t len, tlen;
LsaGetLogonSessionData(lpLogonId, &plsd);
- UnicodeStringToANSI(plsd->UserName, lsaUsername, MAX_USERNAME_LENGTH);
- UnicodeStringToANSI(plsd->LogonDomain, lsaDomain, MAX_DOMAIN_LENGTH);
-
- DebugEvent("PLSD username[%s] domain[%s]",lsaUsername,lsaDomain);
-
- if(SUCCEEDED(StringCbLength(lsaUsername, MAX_USERNAME_LENGTH, &tlen)))
- len = tlen;
- else
- goto bad_strings;
-
- if(SUCCEEDED(StringCbLength(lsaDomain, MAX_DOMAIN_LENGTH, &tlen)))
- len += tlen;
- else
- goto bad_strings;
-
- len += 2;
-
- opt->smbName = malloc(len);
-
- StringCbCopy(opt->smbName, len, lsaDomain);
- StringCbCat(opt->smbName, len, "\\");
- StringCbCat(opt->smbName, len, lsaUsername);
-
- strlwr(opt->smbName);
-
-bad_strings:
- LsaFreeReturnBuffer(plsd);
- }
-
- DebugEvent("Looking up logon script");
- /* Logon script */
- /* First find out where the key is */
- hkTemp = NULL;
- rv = ~ERROR_SUCCESS;
- dwType = 0;
- if(hkDom)
- rv = RegQueryValueExW(hkDom, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize);
- if(rv == ERROR_SUCCESS && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) {
- hkTemp = hkDom;
- DebugEvent("Located logon script in hkDom");
- }
- else if(hkDoms)
- rv = RegQueryValueExW(hkDoms, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize);
- if(rv == ERROR_SUCCESS && !hkTemp && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) {
- hkTemp = hkDoms;
- DebugEvent("Located logon script in hkDoms");
- }
- /* Note that the LogonScript in the NP key is only used if we are doing high security. */
- else if(hkNp && ISHIGHSECURITY(opt->LogonOption))
- rv = RegQueryValueExW(hkNp, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize);
- if(rv == ERROR_SUCCESS && !hkTemp && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) {
- hkTemp = hkNp;
- DebugEvent("Located logon script in hkNp");
- }
-
- if(hkTemp) {
- WCHAR *regscript = NULL;
- WCHAR *regexscript = NULL;
- WCHAR *regexuscript = NULL;
- WCHAR *wuname = NULL;
- HRESULT hr;
-
- size_t len;
-
- StringCbLength(opt->smbName, MAX_USERNAME_LENGTH, &len);
- len ++;
+ UnicodeStringToANSI(plsd->UserName, lsaUsername, MAX_USERNAME_LENGTH);
+ UnicodeStringToANSI(plsd->LogonDomain, lsaDomain, MAX_DOMAIN_LENGTH);
+
+ DebugEvent("PLSD username[%s] domain[%s]",lsaUsername,lsaDomain);
+
+ if(SUCCEEDED(StringCbLength(lsaUsername, MAX_USERNAME_LENGTH, &tlen)))
+ len = tlen;
+ else
+ goto bad_strings;
+
+ if(SUCCEEDED(StringCbLength(lsaDomain, MAX_DOMAIN_LENGTH, &tlen)))
+ len += tlen;
+ else
+ goto bad_strings;
+
+ len += 2;
+
+ opt->smbName = malloc(len);
+
+ StringCbCopy(opt->smbName, len, lsaDomain);
+ StringCbCat(opt->smbName, len, "\\");
+ StringCbCat(opt->smbName, len, lsaUsername);
+
+ strlwr(opt->smbName);
+
+ bad_strings:
+ LsaFreeReturnBuffer(plsd);
+ }
+
+ DebugEvent("Looking up logon script");
+ /* Logon script */
+ /* First find out where the key is */
+ hkTemp = NULL;
+ rv = ~ERROR_SUCCESS;
+ dwType = 0;
+ if(hkDom)
+ rv = RegQueryValueExW(hkDom, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize);
+ if(rv == ERROR_SUCCESS && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) {
+ hkTemp = hkDom;
+ DebugEvent("Located logon script in hkDom");
+ }
+ else if(hkDoms)
+ rv = RegQueryValueExW(hkDoms, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize);
+ if(rv == ERROR_SUCCESS && !hkTemp && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) {
+ hkTemp = hkDoms;
+ DebugEvent("Located logon script in hkDoms");
+ }
+ /* Note that the LogonScript in the NP key is only used if we are doing high security. */
+ else if(hkNp && ISHIGHSECURITY(opt->LogonOption))
+ rv = RegQueryValueExW(hkNp, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize);
+ if(rv == ERROR_SUCCESS && !hkTemp && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) {
+ hkTemp = hkNp;
+ DebugEvent("Located logon script in hkNp");
+ }
- wuname = malloc(len * sizeof(WCHAR));
- MultiByteToWideChar(CP_ACP,0,opt->smbName,-1,wuname,len*sizeof(WCHAR));
+ if(hkTemp) {
+ WCHAR *regscript = NULL;
+ WCHAR *regexscript = NULL;
+ WCHAR *regexuscript = NULL;
+ WCHAR *wuname = NULL;
+ HRESULT hr;
- DebugEvent("Username is set for [%S]", wuname);
+ size_t len;
- /* dwSize still has the size of the required buffer in bytes. */
+ StringCbLength(opt->smbName, MAX_USERNAME_LENGTH, &len);
+ len ++;
+
+ wuname = malloc(len * sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP,0,opt->smbName,-1,wuname,len*sizeof(WCHAR));
+
+ DebugEvent("Username is set for [%S]", wuname);
+
+ /* dwSize still has the size of the required buffer in bytes. */
regscript = malloc(dwSize);
- rv = RegQueryValueExW(hkTemp, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, (LPBYTE) regscript, &dwSize);
- if(rv != ERROR_SUCCESS) {/* what the ..? */
- DebugEvent("Can't look up logon script [%d]",rv);
- goto doneLogonScript;
- }
-
- DebugEvent("Found logon script [%S]", regscript);
-
- if(dwType == REG_EXPAND_SZ) {
- DWORD dwReq;
-
- dwSize += MAX_PATH * sizeof(WCHAR); /* make room for environment expansion. */
- regexscript = malloc(dwSize);
- dwReq = ExpandEnvironmentStringsW(regscript, regexscript, dwSize / sizeof(WCHAR));
- free(regscript);
- regscript = regexscript;
- regexscript = NULL;
- if(dwReq > (dwSize / sizeof(WCHAR))) {
- DebugEvent("Overflow while expanding environment strings.");
- goto doneLogonScript;
- }
- }
-
- DebugEvent("After expanding env strings [%S]", regscript);
-
- if(wcsstr(regscript, L"%s")) {
- dwSize += len * sizeof(WCHAR); /* make room for username expansion */
- regexuscript = (WCHAR *) LocalAlloc(LMEM_FIXED, dwSize);
- hr = StringCbPrintfW(regexuscript, dwSize, regscript, wuname);
- } else {
- regexuscript = (WCHAR *) LocalAlloc(LMEM_FIXED, dwSize);
- hr = StringCbCopyW(regexuscript, dwSize, regscript);
- }
-
- DebugEvent("After expanding username [%S]", regexuscript);
-
- if(hr == S_OK)
- opt->logonScript = regexuscript;
- else
- LocalFree(regexuscript);
-
-doneLogonScript:
- if(wuname) free(wuname);
- if(regscript) free(regscript);
- if(regexscript) free(regexscript);
- }
-
-cleanup:
- if(hkNp) RegCloseKey(hkNp);
- if(hkDom) RegCloseKey(hkDom);
- if(hkDoms) RegCloseKey(hkDoms);
- if(hkParm) RegCloseKey(hkParm);
-}
+ rv = RegQueryValueExW(hkTemp, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, (LPBYTE) regscript, &dwSize);
+ if(rv != ERROR_SUCCESS) {/* what the ..? */
+ DebugEvent("Can't look up logon script [%d]",rv);
+ goto doneLogonScript;
+ }
+
+ DebugEvent("Found logon script [%S]", regscript);
+
+ if(dwType == REG_EXPAND_SZ) {
+ DWORD dwReq;
+
+ dwSize += MAX_PATH * sizeof(WCHAR); /* make room for environment expansion. */
+ regexscript = malloc(dwSize);
+ dwReq = ExpandEnvironmentStringsW(regscript, regexscript, dwSize / sizeof(WCHAR));
+ free(regscript);
+ regscript = regexscript;
+ regexscript = NULL;
+ if(dwReq > (dwSize / sizeof(WCHAR))) {
+ DebugEvent("Overflow while expanding environment strings.");
+ goto doneLogonScript;
+ }
+ }
+
+ DebugEvent("After expanding env strings [%S]", regscript);
+
+ if(wcsstr(regscript, L"%s")) {
+ dwSize += len * sizeof(WCHAR); /* make room for username expansion */
+ regexuscript = (WCHAR *) LocalAlloc(LMEM_FIXED, dwSize);
+ hr = StringCbPrintfW(regexuscript, dwSize, regscript, wuname);
+ } else {
+ regexuscript = (WCHAR *) LocalAlloc(LMEM_FIXED, dwSize);
+ hr = StringCbCopyW(regexuscript, dwSize, regscript);
+ }
+
+ DebugEvent("After expanding username [%S]", regexuscript);
+
+ if(hr == S_OK)
+ opt->logonScript = regexuscript;
+ else
+ LocalFree(regexuscript);
+
+ doneLogonScript:
+ if(wuname) free(wuname);
+ if(regscript) free(regscript);
+ if(regexscript) free(regexscript);
+ }
+
+ cleanup:
+ if(hkNp) RegCloseKey(hkNp);
+ if(hkDom) RegCloseKey(hkDom);
+ if(hkDoms) RegCloseKey(hkDoms);
+ if(hkParm) RegCloseKey(hkParm);
+}
#undef LOOKUPKEYCHAIN
the contents of *cell in case of failure. *cell is assumed to be
at least cellLen chars */
DWORD GetFileCellName(char * path, char * cell, size_t cellLen) {
- struct ViceIoctl blob;
- char tcell[MAX_PATH];
- DWORD code;
+ struct ViceIoctl blob;
+ char tcell[MAX_PATH];
+ DWORD code;
- blob.in_size = 0;
- blob.out_size = MAX_PATH;
- blob.out = tcell;
+ blob.in_size = 0;
+ blob.out_size = MAX_PATH;
+ blob.out = tcell;
- code = pioctl(path, VIOC_FILE_CELL_NAME, &blob, 1);
+ code = pioctl(path, VIOC_FILE_CELL_NAME, &blob, 1);
- if(!code) {
- strncpy(cell, tcell, cellLen);
- cell[cellLen - 1] = '\0';
- }
- return code;
-}
+ if(!code) {
+ strncpy(cell, tcell, cellLen);
+ cell[cellLen - 1] = '\0';
+ }
+ return code;
+}
static BOOL
lpszOutputString[min(uInputString.Length/2,nOutStringLen-1)] = '\0';
return TRUE;
}
- else
- lpszOutputString[0] = '\0';
+ else
+ lpszOutputString[0] = '\0';
return FALSE;
} // UnicodeStringToANSI
LPVOID StationHandle,
LPWSTR *lpLogonScript)
{
- char uname[MAX_USERNAME_LENGTH]="";
- char password[MAX_PASSWORD_LENGTH]="";
- char logonDomain[MAX_DOMAIN_LENGTH]="";
- char cell[256]="<non-integrated logon>";
- char homePath[MAX_PATH]="";
+ char uname[MAX_USERNAME_LENGTH]="";
+ char password[MAX_PASSWORD_LENGTH]="";
+ char logonDomain[MAX_DOMAIN_LENGTH]="";
+ char cell[256]="<non-integrated logon>";
+ char homePath[MAX_PATH]="";
- MSV1_0_INTERACTIVE_LOGON *IL;
+ MSV1_0_INTERACTIVE_LOGON *IL;
- DWORD code;
+ DWORD code;
- int pw_exp;
- char *reason;
- char *ctemp;
+ int pw_exp;
+ char *reason;
+ char *ctemp;
- BOOLEAN interactive;
- BOOLEAN flag;
- DWORD LSPtype, LSPsize;
- HKEY NPKey;
+ BOOLEAN interactive;
+ BOOLEAN flag;
+ DWORD LSPtype, LSPsize;
+ HKEY NPKey;
- HWND hwndOwner = (HWND)StationHandle;
+ HWND hwndOwner = (HWND)StationHandle;
- BOOLEAN afsWillAutoStart;
+ BOOLEAN afsWillAutoStart;
BOOLEAN uppercased_name = TRUE;
- LogonOptions_t opt; /* domain specific logon options */
- int retryInterval;
- int sleepInterval;
+ LogonOptions_t opt; /* domain specific logon options */
+ int retryInterval;
+ int sleepInterval;
/* Make sure the AFS Libraries are initialized */
AfsLogonInit();
/* Initialize Logon Script to none */
- *lpLogonScript=NULL;
+ *lpLogonScript=NULL;
- /* TODO: We should check the value of lpAuthentInfoType before assuming that it is
- MSV1_0_INTERACTIVE_LOGON though for our purposes KERB_INTERACTIVE_LOGON is
- co-incidentally equivalent. */
- IL = (MSV1_0_INTERACTIVE_LOGON *) lpAuthentInfo;
+ /* TODO: We should check the value of lpAuthentInfoType before assuming that it is
+ MSV1_0_INTERACTIVE_LOGON though for our purposes KERB_INTERACTIVE_LOGON is
+ co-incidentally equivalent. */
+ IL = (MSV1_0_INTERACTIVE_LOGON *) lpAuthentInfo;
- /* Are we interactive? */
- interactive = (wcscmp(lpStationName, L"WinSta0") == 0);
+ /* Are we interactive? */
+ interactive = (wcscmp(lpStationName, L"WinSta0") == 0);
- /* Convert from Unicode to ANSI */
+ /* Convert from Unicode to ANSI */
- /*TODO: Use SecureZeroMemory to erase passwords */
- UnicodeStringToANSI(IL->UserName, uname, MAX_USERNAME_LENGTH);
- UnicodeStringToANSI(IL->Password, password, MAX_PASSWORD_LENGTH);
- UnicodeStringToANSI(IL->LogonDomainName, logonDomain, MAX_DOMAIN_LENGTH);
+ /*TODO: Use SecureZeroMemory to erase passwords */
+ UnicodeStringToANSI(IL->UserName, uname, MAX_USERNAME_LENGTH);
+ UnicodeStringToANSI(IL->Password, password, MAX_PASSWORD_LENGTH);
+ UnicodeStringToANSI(IL->LogonDomainName, logonDomain, MAX_DOMAIN_LENGTH);
- /* Make sure AD-DOMANS sent from login that is sent to us is striped */
+ /* Make sure AD-DOMANS sent from login that is sent to us is striped */
ctemp = strchr(uname, '@');
if (ctemp) *ctemp = 0;
}
}
- (void) RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_CLIENT_PARMS_KEY,
- 0, KEY_QUERY_VALUE, &NPKey);
- LSPsize=sizeof(TraceOption);
- RegQueryValueEx(NPKey, REG_CLIENT_TRACE_OPTION_PARM, NULL,
+ (void) RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_CLIENT_PARMS_KEY,
+ 0, KEY_QUERY_VALUE, &NPKey);
+ LSPsize=sizeof(TraceOption);
+ RegQueryValueEx(NPKey, REG_CLIENT_TRACE_OPTION_PARM, NULL,
&LSPtype, (LPBYTE)&TraceOption, &LSPsize);
- RegCloseKey (NPKey);
+ RegCloseKey (NPKey);
- /*
- * Get Logon options
- */
+ /*
+ * Get Logon options
+ */
- GetDomainLogonOptions( lpLogonId, uname, logonDomain, &opt );
- retryInterval = opt.retryInterval;
- sleepInterval = opt.sleepInterval;
- *lpLogonScript = opt.logonScript;
+ GetDomainLogonOptions( lpLogonId, uname, logonDomain, &opt );
+ retryInterval = opt.retryInterval;
+ sleepInterval = opt.sleepInterval;
+ *lpLogonScript = opt.logonScript;
- DebugEvent("Got logon script: %S",opt.logonScript);
+ DebugEvent("Got logon script: %S",opt.logonScript);
- afsWillAutoStart = AFSWillAutoStart();
+ afsWillAutoStart = AFSWillAutoStart();
- DebugEvent("LogonOption[%x], Service AutoStart[%d]",
+ DebugEvent("LogonOption[%x], Service AutoStart[%d]",
opt.LogonOption,afsWillAutoStart);
/* Check for zero length password if integrated logon*/
- if ( ISLOGONINTEGRATED(opt.LogonOption) ) {
+ if ( ISLOGONINTEGRATED(opt.LogonOption) ) {
if ( password[0] == 0 ) {
DebugEvent("Password is the empty string");
code = GT_PW_NULL;
reason = "zero length password is illegal";
code=0;
- }
+ }
/* Get cell name if doing integrated logon.
- We might overwrite this if we are logging into an AD realm and we find out that
- the user's home dir is in some other cell. */
+ We might overwrite this if we are logging into an AD realm and we find out that
+ the user's home dir is in some other cell. */
DebugEvent("About to call cm_GetRootCellName(%s)",cell);
- code = cm_GetRootCellName(cell);
- if (code < 0) {
+ code = cm_GetRootCellName(cell);
+ if (code < 0) {
DebugEvent("Unable to obtain Root Cell");
- code = KTC_NOCELL;
- reason = "unknown cell";
- code=0;
- } else {
+ code = KTC_NOCELL;
+ reason = "unknown cell";
+ code=0;
+ } else {
DebugEvent("Cell is %s",cell);
- }
+ }
- /* We get the user's home directory path, if applicable, though we can't lookup the
- cell right away because the client service may not have started yet. This call
- also sets the AD_REALM flag in opt.flags if applicable. */
- if(ISREMOTE(opt.flags)) {
+ /* We get the user's home directory path, if applicable, though we can't lookup the
+ cell right away because the client service may not have started yet. This call
+ also sets the AD_REALM flag in opt.flags if applicable. */
+ if(ISREMOTE(opt.flags)) {
DebugEvent("Is Remote");
- GetAdHomePath(homePath,MAX_PATH,lpLogonId,&opt);
- }
+ GetAdHomePath(homePath,MAX_PATH,lpLogonId,&opt);
+ }
}
/* loop until AFS is started. */
opt.LogonOption,afsWillAutoStart);
if(ISADREALM(opt.flags)) {
- code = GetFileCellName(homePath,cell,256);
- if(!code) {
- DebugEvent("profile path [%s] is in cell [%s]",homePath,cell);
- }
- /* Don't bail out if GetFileCellName failed.
- * The home dir may not be in AFS after all.
- */
- } else
- code=0;
+ code = GetFileCellName(homePath,cell,256);
+ if(!code) {
+ DebugEvent("profile path [%s] is in cell [%s]",homePath,cell);
+ }
+ /* Don't bail out if GetFileCellName failed.
+ * The home dir may not be in AFS after all.
+ */
+ } else
+ code=0;
/* if Integrated Logon */
if (ISLOGONINTEGRATED(opt.LogonOption))
- {
- if ( KFW_is_available() ) {
+ {
+ if ( KFW_is_available() ) {
code = KFW_AFS_get_cred(uname, cell, password, 0, opt.smbName, &reason);
- DebugEvent("KFW_AFS_get_cred uname=[%s] smbname=[%s] cell=[%s] code=[%d]",uname,opt.smbName,cell,code);
- }
- else {
+ DebugEvent("KFW_AFS_get_cred uname=[%s] smbname=[%s] cell=[%s] code=[%d]",uname,opt.smbName,cell,code);
+ }
+ else {
code = ka_UserAuthenticateGeneral2(KA_USERAUTH_VERSION+KA_USERAUTH_AUTHENT_LOGON,
- uname, "", cell, password, opt.smbName, 0, &pw_exp, 0,
- &reason);
- DebugEvent("AFS AfsLogon - (INTEGRATED only)ka_UserAuthenticateGeneral2","Code[%x]",
- code);
- }
+ uname, "", cell, password, opt.smbName, 0, &pw_exp, 0,
+ &reason);
+ DebugEvent("AFS AfsLogon - (INTEGRATED only)ka_UserAuthenticateGeneral2","Code[%x]",
+ code);
+ }
if ( code && code != KTC_NOCM && code != KTC_NOCMRPC && uppercased_name ) {
for ( ctemp = uname; *ctemp ; ctemp++) {
*ctemp = tolower(*ctemp);
uppercased_name = FALSE;
continue;
}
- }
- else {
+ }
+ else {
/*JUST check to see if its running*/
- if (IsServiceRunning())
+ if (IsServiceRunning())
break;
- code = KTC_NOCM;
- if (!afsWillAutoStart)
+ code = KTC_NOCM;
+ if (!afsWillAutoStart)
break;
- }
+ }
- /* is service started yet?*/
+ /* is service started yet?*/
DebugEvent("AFS AfsLogon - ka_UserAuthenticateGeneral2","Code[%x] uname[%s] Cell[%s]",
- code,uname,cell);
+ code,uname,cell);
- /* If we've failed because the client isn't running yet and the
+ /* If we've failed because the client isn't running yet and the
* client is set to autostart (and therefore it makes sense for
* us to wait for it to start) then sleep a while and try again.
* If the error was something else, then give up. */
- if (code != KTC_NOCM && code != KTC_NOCMRPC || !afsWillAutoStart)
- break;
-
+ if (code != KTC_NOCM && code != KTC_NOCMRPC || !afsWillAutoStart)
+ break;
+
/* If the retry interval has expired and we still aren't
* logged in, then just give up if we are not in interactive
* mode or the failSilently flag is set, otherwise let the
reason = "AFS not running";
if (!interactive || opt.failSilently)
break;
- flag = MessageBox(hwndOwner,
+ flag = MessageBox(hwndOwner,
"AFS is still starting. Retry?",
"AFS Logon",
MB_ICONQUESTION | MB_RETRYCANCEL);
- if (flag == IDCANCEL)
+ if (flag == IDCANCEL)
break;
/* Wait just a little while and try again */
}
if (retryInterval < sleepInterval)
- sleepInterval = retryInterval;
+ sleepInterval = retryInterval;
- Sleep(sleepInterval * 1000);
+ Sleep(sleepInterval * 1000);
retryInterval -= sleepInterval;
}
if ( KFW_is_available() )
KFW_AFS_destroy_tickets_for_cell(cell);
- if (code) {
+ if (code) {
char msg[128];
HANDLE h;
char *ptbuf[1];
- StringCbPrintf(msg, sizeof(msg), "Integrated login failed: %s", reason);
+ StringCbPrintf(msg, sizeof(msg), "Integrated login failed: %s", reason);
- if (ISLOGONINTEGRATED(opt.LogonOption) && interactive && !opt.failSilently)
- MessageBox(hwndOwner, msg, "AFS Logon", MB_OK);
+ if (ISLOGONINTEGRATED(opt.LogonOption) && interactive && !opt.failSilently)
+ MessageBox(hwndOwner, msg, "AFS Logon", MB_OK);
h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME);
ptbuf[0] = msg;
DeregisterEventSource(h);
code = MapAuthError(code);
- SetLastError(code);
+ SetLastError(code);
- if (ISLOGONINTEGRATED(opt.LogonOption) && (code!=0))
- {
- if (*lpLogonScript)
- LocalFree(*lpLogonScript);
- *lpLogonScript = NULL;
- if (!afsWillAutoStart) // its not running, so if not autostart or integrated logon then just skip
- code = 0;
+ if (ISLOGONINTEGRATED(opt.LogonOption) && (code!=0))
+ {
+ if (*lpLogonScript)
+ LocalFree(*lpLogonScript);
+ *lpLogonScript = NULL;
+ if (!afsWillAutoStart) // its not running, so if not autostart or integrated logon then just skip
+ code = 0;
- }
- }
+ }
+ }
- if(opt.smbName) free(opt.smbName);
+ if(opt.smbName) free(opt.smbName);
- DebugEvent("AFS AfsLogon - Exit","Return Code[%x]",code);
- return code;
-}
+ DebugEvent("AFS AfsLogon - Exit","Return Code[%x]",code);
+ return code;
+}
DWORD APIENTRY NPPasswordChangeNotify(
LPCWSTR lpAuthentInfoType,
/* Make sure the AFS Libraries are initialized */
AfsLogonInit();
- DebugEvent0("AFS AfsLogon - NPPasswordChangeNotify");
- return 0;
+ DebugEvent0("AFS AfsLogon - NPPasswordChangeNotify");
+ return 0;
}
#include <userenv.h>
VOID AFS_Startup_Event( PWLX_NOTIFICATION_INFO pInfo )
{
- DWORD LSPtype, LSPsize;
- HKEY NPKey;
+ DWORD LSPtype, LSPsize;
+ HKEY NPKey;
/* Make sure the AFS Libraries are initialized */
AfsLogonInit();
(void) RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_CLIENT_PARMS_KEY,
0, KEY_QUERY_VALUE, &NPKey);
- LSPsize=sizeof(TraceOption);
- RegQueryValueEx(NPKey, REG_CLIENT_TRACE_OPTION_PARM, NULL,
+ LSPsize=sizeof(TraceOption);
+ RegQueryValueEx(NPKey, REG_CLIENT_TRACE_OPTION_PARM, NULL,
&LSPtype, (LPBYTE)&TraceOption, &LSPsize);
- RegCloseKey (NPKey);
+ RegCloseKey (NPKey);
DebugEvent0("AFS_Startup_Event");
}
VOID AFS_Logoff_Event( PWLX_NOTIFICATION_INFO pInfo )
{
DWORD code;
- TCHAR profileDir[256] = TEXT("");
- DWORD len = 256;
+ TCHAR profileDir[1024] = TEXT("");
+ DWORD len = 1024;
PTOKEN_USER tokenUser = NULL;
DWORD retLen;
HANDLE hToken;
if (QueryAdHomePathFromSid( profileDir, sizeof(profileDir), tokenUser->User.Sid, pInfo->Domain)) {
WCHAR Domain[64]=L"";
GetLocalShortDomain(Domain, sizeof(Domain));
- if (QueryAdHomePathFromSid( profileDir, sizeof(profileDir), tokenUser->User.Sid, Domain))
- GetUserProfileDirectory(pInfo->hToken, profileDir, &len);
+ if (QueryAdHomePathFromSid( profileDir, sizeof(profileDir), tokenUser->User.Sid, Domain)) {
+ if (NetUserGetProfilePath(pInfo->Domain, pInfo->UserName, profileDir, len))
+ GetUserProfileDirectory(pInfo->hToken, profileDir, &len);
+ }
}
if (strlen(profileDir)) {
/* fall through */
done:
- if (didLock) lock_ReleaseMutex(&aclScp->mx);
+ if (didLock)
+ lock_ReleaseMutex(&aclScp->mx);
cm_ReleaseSCache(aclScp);
return code;
}
*/
long buf_SetNBuffers(long nbuffers)
{
- if (nbuffers < 10) return CM_ERROR_INVAL;
- if (nbuffers == buf_nbuffers) return 0;
+ if (nbuffers < 10)
+ return CM_ERROR_INVAL;
+ if (nbuffers == buf_nbuffers)
+ return 0;
else if (nbuffers > buf_nbuffers)
return buf_AddBuffers(nbuffers - buf_nbuffers);
- else return CM_ERROR_INVAL;
+ else
+ return CM_ERROR_INVAL;
}
/* release a buffer. Buffer must be referenced, but unlocked. */
* have any lock conflicts, so we can grab the buffer lock out of
* order in the locking hierarchy.
*/
- osi_Log2(buf_logp,
- "buf_Recycle recycles 0x%x, off 0x%x",
+ osi_Log2( buf_logp, "buf_Recycle recycles 0x%x, off 0x%x",
bp, bp->offset.LowPart);
osi_assert(bp->refCount == 0);
}
lock_ReleaseWrite(&buf_globalLock);
-
}
lock_ReleaseMutex(&scp->mx);
*/
struct cm_buf *allp; /* next in all list */
osi_mutex_t mx; /* mutex protecting structure except refcount */
- int refCount; /* reference count */
+ int refCount; /* reference count (buf_globalLock) */
long idCounter; /* counter for softrefs; bumped at each recycle */
long dirtyCounter; /* bumped at each dirty->clean transition */
#ifdef notdef
/*
* When we lose a callback, may have to send change notification replies.
+ * Do not call with a lock on the scp.
*/
void cm_CallbackNotifyChange(cm_scache_t *scp)
{
osi_Log2(afsd_logp, "CallbackNotifyChange FileType %d Flags %lX",
scp->fileType, scp->flags);
- if (scp->fileType == CM_SCACHETYPE_DIRECTORY) {
- if (scp->flags & CM_SCACHEFLAG_ANYWATCH)
- smb_NotifyChange(0,
- FILE_NOTIFY_GENERIC_DIRECTORY_FILTER,
- scp, NULL, NULL, TRUE);
- } else {
- cm_fid_t tfid;
- cm_scache_t *dscp;
-
- tfid.cell = scp->fid.cell;
- tfid.volume = scp->fid.volume;
- tfid.vnode = scp->parentVnode;
- tfid.unique = scp->parentUnique;
- dscp = cm_FindSCache(&tfid);
- if (dscp &&
- dscp->flags & CM_SCACHEFLAG_ANYWATCH)
- smb_NotifyChange(0,
- FILE_NOTIFY_GENERIC_FILE_FILTER,
- dscp, NULL, NULL, TRUE);
- if (dscp) cm_ReleaseSCache(dscp);
- }
+ if (scp->fileType == CM_SCACHETYPE_DIRECTORY) {
+ if (scp->flags & CM_SCACHEFLAG_ANYWATCH)
+ smb_NotifyChange(0,
+ FILE_NOTIFY_GENERIC_DIRECTORY_FILTER,
+ scp, NULL, NULL, TRUE);
+ } else {
+ cm_fid_t tfid;
+ cm_scache_t *dscp;
+
+ tfid.cell = scp->fid.cell;
+ tfid.volume = scp->fid.volume;
+ tfid.vnode = scp->parentVnode;
+ tfid.unique = scp->parentUnique;
+ dscp = cm_FindSCache(&tfid);
+ if (dscp &&
+ dscp->flags & CM_SCACHEFLAG_ANYWATCH)
+ smb_NotifyChange( 0,
+ FILE_NOTIFY_GENERIC_FILE_FILTER,
+ dscp, NULL, NULL, TRUE);
+ if (dscp) cm_ReleaseSCache(dscp);
+ }
}
/* called with no locks held for every file ID that is revoked directly by
int fdc, fgc;
if (cm_freelanceEnabled &&
- scp->fid.cell==AFS_FAKE_ROOT_CELL_ID &&
- scp->fid.volume==AFS_FAKE_ROOT_VOL_ID) { // if it's something on /afs
- if (!(scp->fid.vnode==0x1 && scp->fid.unique==0x1)) // if it's not root.afs
+ scp->fid.cell==AFS_FAKE_ROOT_CELL_ID && scp->fid.volume==AFS_FAKE_ROOT_VOL_ID) {
+ /* if it's something on /afs */
+ if (!(scp->fid.vnode==0x1 && scp->fid.unique==0x1)) {
+ /* if it's not root.afs */
return 1;
- else {
+ }
+
lock_ObtainMutex(&cm_Freelance_Lock);
fdc = cm_fakeDirCallback;
fgc = cm_fakeGettingCallback;
}
return 0;
}
- }
#endif
if (scp->cbServerp != NULL)
return 1;
- else return 0;
+ else
+ return 0;
}
/* need to detect a broken callback that races with our obtaining a callback.
cm_racingRevokes_t *revp; /* where we are */
cm_racingRevokes_t *nrevp; /* where we'll be next */
int freeFlag;
+ cm_server_t * serverp = 0;
lock_ObtainWrite(&cm_callbackLock);
if (flags & CM_CALLBACK_MAINTAINCOUNT) {
else {
osi_assert(cm_activeCallbackGrantingCalls-- > 0);
}
- if (cm_activeCallbackGrantingCalls == 0) freeFlag = 1;
- else freeFlag = 0;
+ if (cm_activeCallbackGrantingCalls == 0)
+ freeFlag = 1;
+ else
+ freeFlag = 0;
/* record the callback; we'll clear it below if we really lose it */
+ if (cbrp) {
if (scp) {
+ if (scp->cbServerp != cbrp->serverp) {
+ serverp = scp->cbServerp;
+ }
scp->cbServerp = cbrp->serverp;
scp->cbExpires = cbrp->startTime + cbp->ExpirationTime;
+ } else {
+ serverp = cbrp->serverp;
+ }
+ cbrp->serverp = NULL;
}
/* a callback was actually revoked during our granting call, so
* callback-granting call, and if this fid is the right fid,
* then clear the callback.
*/
- if (scp && cbrp->callbackCount != cm_callbackCount
+ if (scp && cbrp && cbrp->callbackCount != cm_callbackCount
&& revp->callbackCount > cbrp->callbackCount
&& (( scp->fid.volume == revp->fid.volume &&
scp->fid.vnode == revp->fid.vnode &&
if (freeFlag) cm_racingRevokesp = NULL;
lock_ReleaseWrite(&cm_callbackLock);
+
+ if ( serverp ) {
+ lock_ObtainWrite(&cm_serverLock);
+ cm_FreeServer(serverp);
+ lock_ReleaseWrite(&cm_serverLock);
+ }
}
/* if flags is 1, we want to force the code to make one call, anyway.
scp->fid.volume==AFS_FAKE_ROOT_VOL_ID &&
scp->fid.unique==0x1 &&
scp->fid.vnode==0x1) {
+
// Start by indicating that we're in the process
// of fetching the callback
-
lock_ObtainMutex(&cm_Freelance_Lock);
+ osi_Log0(afsd_logp,"cm_getGetCallback fakeGettingCallback=1");
cm_fakeGettingCallback = 1;
lock_ReleaseMutex(&cm_Freelance_Lock);
// Indicate that the callback is not done
lock_ObtainMutex(&cm_Freelance_Lock);
+ osi_Log0(afsd_logp,"cm_getGetCallback fakeDirCallback=2");
cm_fakeDirCallback = 2;
+
// Indicate that we're no longer fetching the callback
+ osi_Log0(afsd_logp,"cm_getGetCallback fakeGettingCallback=0");
cm_fakeGettingCallback = 0;
lock_ReleaseMutex(&cm_Freelance_Lock);
cm_MergeStatus(scp, &afsStatus, &volSync, userp, 0);
}
else
- cm_EndCallbackGrantingCall(NULL, NULL, NULL, 0);
+ cm_EndCallbackGrantingCall(NULL, &cbr, NULL, 0);
/* now check to see if we got an error */
if (code) return code;
/* called periodically by cm_daemon to shut down use of expired callbacks */
void cm_CheckCBExpiration(void)
{
- int i;
- cm_scache_t *scp;
- long now;
+ int i;
+ cm_scache_t *scp;
+ long now;
osi_Log0(afsd_logp, "CheckCBExpiration");
- now = osi_Time();
- lock_ObtainWrite(&cm_scacheLock);
- for(i=0; i<cm_hashTableSize; i++) {
- for(scp = cm_hashTablep[i]; scp; scp=scp->nextp) {
- scp->refCount++;
- lock_ReleaseWrite(&cm_scacheLock);
- lock_ObtainMutex(&scp->mx);
- if (scp->cbServerp && now > scp->cbExpires) {
- osi_Log1(afsd_logp, "Discarding SCache scp %x", scp);
- cm_DiscardSCache(scp);
- }
- lock_ReleaseMutex(&scp->mx);
- lock_ObtainWrite(&cm_scacheLock);
- osi_assert(scp->refCount-- > 0);
- }
+ now = osi_Time();
+ lock_ObtainWrite(&cm_scacheLock);
+ for(i=0; i<cm_hashTableSize; i++) {
+ for(scp = cm_hashTablep[i]; scp; scp=scp->nextp) {
+ scp->refCount++;
+ lock_ReleaseWrite(&cm_scacheLock);
+ if (scp->cbExpires > 0 && (scp->cbServerp == NULL || now > scp->cbExpires)) {
+ osi_Log1(afsd_logp, "Callback Expiration Discarding SCache scp %x", scp);
+ cm_CallbackNotifyChange(scp);
+ lock_ObtainMutex(&scp->mx);
+ cm_DiscardSCache(scp);
+ lock_ReleaseMutex(&scp->mx);
+ }
+ lock_ObtainWrite(&cm_scacheLock);
+ osi_assert(scp->refCount-- > 0);
}
- lock_ReleaseWrite(&cm_scacheLock);
+ }
+ lock_ReleaseWrite(&cm_scacheLock);
}
/* debug interface: not implemented */
extern void cm_CheckCBExpiration(void);
+extern osi_rwlock_t cm_callbackLock;
+
#endif /* _CM_CALLBACK_H_ENV__ */
code = cm_SearchCellFile(namep, fullname, cm_AddCellProc, cp);
if (code) {
- afsi_log("in cm_GetCell_gen cm_SearchCellFile(%s) returns code= %d fullname= %s",
+ osi_Log3(afsd_logp,"in cm_GetCell_gen cm_SearchCellFile(%s) returns code= %d fullname= %s",
namep, code, fullname);
#ifdef AFS_AFSDB_ENV
if (cm_dnsEnabled /*&& cm_DomainValid(namep)*/) {
code = cm_SearchCellByDNS(namep, fullname, &ttl, cm_AddCellProc, cp);
if ( code ) {
- afsi_log("in cm_GetCell_gen cm_SearchCellByDNS(%s) returns code= %d fullname= %s",
+ osi_Log3(afsd_logp,"in cm_GetCell_gen cm_SearchCellByDNS(%s) returns code= %d fullname= %s",
namep, code, fullname);
if (dns_expired) {
cp->flags |= CM_CELLFLAG_VLSERVER_INVALID;
#else
gettimeofday(&reqp->startTime, NULL);
#endif
-
}
static long cm_GetServerList(struct cm_fid *fidp, struct cm_user *userp,
cm_serverRef_t * serversp,
cm_callbackRequest_t *cbrp, long errorCode)
{
- cm_server_t *serverp;
+ cm_server_t *serverp = 0;
cm_serverRef_t **serverspp = 0;
cm_serverRef_t *tsrp;
cm_ucell_t *ucellp;
serverp = connp->serverp;
/* Update callback pointer */
- if (cbrp && errorCode == 0)
- cbrp->serverp = connp->serverp;
+ if (cbrp && serverp && errorCode == 0) {
+ if (cbrp->serverp) {
+ if ( cbrp->serverp != serverp ) {
+ lock_ObtainWrite(&cm_serverLock);
+ cm_PutServerNoLock(cbrp->serverp);
+ cm_GetServerNoLock(serverp);
+ lock_ReleaseWrite(&cm_serverLock);
+ }
+ } else {
+ cm_GetServer(serverp);
+ }
+ lock_ObtainWrite(&cm_callbackLock);
+ cbrp->serverp = serverp;
+ lock_ReleaseWrite(&cm_callbackLock);
+ }
/* If not allowed to retry, don't */
if (reqp->flags & CM_REQ_NORETRY)
lock_ObtainWrite(&cm_serverLock);
for (tsrp = serversp; tsrp; tsrp=tsrp->next) {
tsp = tsrp->server;
- tsp->refCount++;
+ cm_GetServerNoLock(tsp);
lock_ReleaseWrite(&cm_serverLock);
if (!(tsp->flags & CM_SERVERFLAG_DOWN)) {
allDown = 0;
rx_SetConnDeadTime((*connpp)->callp, timeLeft);
rx_SetConnHardDeadTime((*connpp)->callp, (u_short) hardTimeLeft);
lock_ReleaseMutex(&(*connpp)->mx);
-
return 0;
}
if (firstError == 0)
}
}
lock_ObtainWrite(&cm_serverLock);
- osi_assert(tsp->refCount-- > 0);
+ cm_PutServerNoLock(tsp);
}
lock_ReleaseWrite(&cm_serverLock);
userp = tcp->userp;
if (userp && tcp->refCount == 0 && (userp->vcRefs == 0)) {
/* do the deletion of this guy */
+ cm_PutServer(tcp->serverp);
cm_ReleaseUser(userp);
*lcpp = tcp->nextp;
rx_DestroyConnection(tcp->callp);
lock_ObtainMutex(&userp->mx);
lock_ObtainWrite(&cm_connLock);
for(tcp = serverp->connsp; tcp; tcp=tcp->nextp) {
- if (tcp->userp == userp) break;
+ if (tcp->userp == userp)
+ break;
}
+
/* find ucell structure */
ucellp = cm_GetUCell(userp, serverp->cellp);
if (!tcp) {
+ cm_GetServer(serverp);
tcp = malloc(sizeof(*tcp));
memset(tcp, 0, sizeof(*tcp));
tcp->nextp = serverp->connsp;
/* periodic check daemon */
void cm_Daemon(long parm)
{
- long now;
- long lastLockCheck;
- long lastVolCheck;
- long lastCBExpirationCheck;
- long lastDownServerCheck;
- long lastUpServerCheck;
- long lastTokenCacheCheck;
+ unsigned long now;
+ unsigned long lastLockCheck;
+ unsigned long lastVolCheck;
+ unsigned long lastCBExpirationCheck;
+ unsigned long lastDownServerCheck;
+ unsigned long lastUpServerCheck;
+ unsigned long lastTokenCacheCheck;
char thostName[200];
- long code;
+ unsigned long code;
struct hostent *thp;
/* ping all file servers, up or down, with unauthenticated connection,
#include <winsock2.h>
#include <nb30.h>
#endif /* !DJGPP */
+#ifdef COMMENT
#include <malloc.h>
+#endif
#include <string.h>
#include <stdlib.h>
#include <osi.h>
while(length > 0) {
/* get callback so we can do a meaningful dataVersion comparison */
code = cm_SyncOp(scp, NULL, up, reqp, 0,
- CM_SCACHESYNC_NEEDCALLBACK
- | CM_SCACHESYNC_GETSTATUS);
+ CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
if (code) {
scp->flags &= ~CM_SCACHEFLAG_PREFETCHING;
lock_ReleaseMutex(&scp->mx);
biop->reserved = 0;
/* first lookup the file's length, so we know when to stop */
- code = cm_SyncOp(scp, NULL, up, reqp, 0, CM_SCACHESYNC_NEEDCALLBACK
- | CM_SCACHESYNC_GETSTATUS);
+ code = cm_SyncOp(scp, NULL, up, reqp, 0,
+ CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
if (code)
return code;
if (bufp->flags & CM_BUF_WAITING) {
osi_Wakeup((long) bufp);
}
- bufp->flags &= ~(CM_BUF_WAITING | CM_BUF_WRITING
- | CM_BUF_DIRTY);
+ bufp->flags &= ~(CM_BUF_WAITING | CM_BUF_WRITING | CM_BUF_DIRTY);
}
lock_ReleaseMutex(&bufp->mx);
#define __CM_DIR_ENV__ 1
#define CM_DIR_PAGESIZE 2048 /* bytes per page */
-#define CM_DIR_NHASHENT 128 /* entries in the hash tbl */
+#define CM_DIR_NHASHENT 256 /* entries in the hash tbl == NHSIZE */
#define CM_DIR_MAXPAGES 128 /* max pages in a dir */
#define CM_DIR_BIGMAXPAGES 1023 /* new big max pages */
#define CM_DIR_EPP 64 /* dir entries per page */
char name[16];
} cm_dirEntry_t;
+#ifdef UNUSED
typedef struct cm_dirXEntry {
/* A directory extension entry. */
char name[32];
cm_pageHeader_t header;
cm_dirEntry_t entry[1];
} cm_dirPage1_t;
+#endif /* UNUSED */
extern int cm_NameEntries(char *namep, size_t *lenp);
#include <osi.h>
#include "afsd.h"
-osi_rwlock_t cm_dnlcLock;
+static osi_rwlock_t cm_dnlcLock;
-cm_dnlcstats_t dnlcstats; /* dnlc statistics */
-int cm_useDnlc = 1; /* yes, start using the dnlc */
-int cm_debugDnlc = 0; /* debug dnlc */
+static cm_dnlcstats_t dnlcstats; /* dnlc statistics */
+static int cm_useDnlc = 1; /* yes, start using the dnlc */
+static int cm_debugDnlc = 0; /* debug dnlc */
/* Hash table invariants:
* 1. If nameHash[i] is NULL, list is empty
* 2. A single element in a hash bucket has itself as prev and next.
*/
-struct nc *ncfreelist = (struct nc *)0;
+static struct nc *ncfreelist = (struct nc *)0;
static struct nc nameCache[NCSIZE];
-struct nc* nameHash[NHSIZE];
-
+static struct nc *nameHash[NHSIZE];
#ifndef DJGPP
#define dnlcNotify(x,debug){ \
#define dnlcNotify(x,debug)
#endif /* !DJGPP */
-
static struct nc *
GetMeAnEntry()
{
#include <ctype.h>
-#define CM_AFSNCNAMESIZE 36 /* multiple of 4 */
-#define NCSIZE 300
-#define NHSIZE 256 /* must be power of 2== NHASHENT */
+#define CM_AFSNCNAMESIZE 40 /* multiple of 8 (for 64-bit) */
+#define NCSIZE 512
+#define NHSIZE 256 /* must be power of 2 == CM_DIR_NHASHENT */
struct nc {
}
// we know the fakeDir is setup properly, so we claim that we have callback
+ osi_Log0(afsd_logp,"cm_InitFakeRootDir fakeDirCallback=1");
cm_fakeDirCallback=1;
// when we get here, we've set up everything! done!
fprintf(fp,"%s#%s:root.cell.\n",rootCellName,rootCellName);
fprintf(fp,".%s%%%s:root.cell.\n",rootCellName,rootCellName);
fclose(fp);
- fopen(hdir, "r");
+ fp = fopen(hdir, "r");
} else {
fputs("0\n", fp);
fclose(fp);
ioctlp->outDatap = cp;
}
- if (tcellp) return 0;
- else return CM_ERROR_NOMORETOKENS; /* mapped to EDOM */
+ if (tcellp)
+ return 0;
+ else
+ return CM_ERROR_NOMORETOKENS; /* mapped to EDOM */
}
extern long cm_AddCellProc(void *rockp, struct sockaddr_in *addrp, char *namep);
cm_scacheLRULastp = (cm_scache_t *) osi_QPrev(&scp->q);
osi_QRemove((osi_queue_t **) &cm_scacheLRUFirstp, &scp->q);
osi_QAdd((osi_queue_t **) &cm_scacheLRUFirstp, &scp->q);
- if (!cm_scacheLRULastp) cm_scacheLRULastp = scp;
+ if (!cm_scacheLRULastp)
+ cm_scacheLRULastp = scp;
}
/* called with cm_scacheLock write-locked; find a vnode to recycle.
for (scp = cm_scacheLRULastp;
scp;
scp = (cm_scache_t *) osi_QPrev(&scp->q)) {
- if (scp->refCount == 0) break;
+ if (scp->refCount == 0)
+ break;
}
if (scp) {
for (tscp = *lscpp;
tscp;
lscpp = &tscp->nextp, tscp = *lscpp) {
- if (tscp == scp) break;
+ if (tscp == scp)
+ break;
}
osi_assertx(tscp, "afsd: scache hash screwup");
*lscpp = scp->nextp;
scp->bulkStatProgress = hzero;
/* discard callback */
+ if (scp->cbServerp) {
+ cm_PutServer(scp->cbServerp);
scp->cbServerp = NULL;
+ }
scp->cbExpires = 0;
/* remove from dnlc */
/* and put it in the LRU queue */
osi_QAdd((osi_queue_t **) &cm_scacheLRUFirstp, &scp->q);
- if (!cm_scacheLRULastp) cm_scacheLRULastp = scp;
+ if (!cm_scacheLRULastp)
+ cm_scacheLRULastp = scp;
cm_currentSCaches++;
cm_dnlcPurgedp(scp); /* make doubly sure that this is not in dnlc */
cm_dnlcPurgevp(scp);
/* like strcmp, only for fids */
int cm_FidCmp(cm_fid_t *ap, cm_fid_t *bp)
{
- if (ap->vnode != bp->vnode) return 1;
- if (ap->volume != bp->volume) return 1;
- if (ap->unique != bp->unique) return 1;
- if (ap->cell != bp->cell) return 1;
+ if (ap->vnode != bp->vnode)
+ return 1;
+ if (ap->volume != bp->volume)
+ return 1;
+ if (ap->unique != bp->unique)
+ return 1;
+ if (ap->cell != bp->cell)
+ return 1;
return 0;
}
long hash;
cm_scache_t *scp;
long code;
- cm_volume_t *volp;
+ cm_volume_t *volp = 0;
cm_cell_t *cellp;
- char* mp;
+ char* mp = 0;
int special; // yj: boolean variable to test if file is on root.afs
int isRoot;
+ extern cm_fid_t cm_rootFid;
hash = CM_SCACHE_HASH(fidp);
osi_assert(fidp->cell != 0);
+ if (fidp->cell== cm_rootFid.cell &&
+ fidp->volume==cm_rootFid.volume &&
+ fidp->vnode==0x0 && fidp->unique==0x0)
+ {
+ osi_Log0(afsd_logp,"cm_getSCache called with root cell/volume and vnode=0 and unique=0");
+ }
+
// yj: check if we have the scp, if so, we don't need
// to do anything else
lock_ObtainWrite(&cm_scacheLock);
if (cm_freelanceEnabled && isRoot) {
osi_Log0(afsd_logp,"cm_getSCache Freelance and isRoot");
/* freelance: if we are trying to get the root scp for the first
- time, we will just put in a place holder entry. */
+ * time, we will just put in a place holder entry.
+ */
volp = NULL;
}
if (cm_freelanceEnabled && special) {
osi_Log0(afsd_logp,"cm_getSCache Freelance and special");
+ if (fidp->vnode > 1) {
lock_ObtainMutex(&cm_Freelance_Lock);
mp =(cm_localMountPoints+fidp->vnode-2)->mountPointStringp;
lock_ReleaseMutex(&cm_Freelance_Lock);
-
+ } else {
+ mp = "";
+ }
scp = cm_GetNewSCache();
scp->fid = *fidp;
lock_ReleaseWrite(&cm_scacheLock);
/*afsi_log(" getscache done");*/
return 0;
-
}
// end of yj code
#endif /* AFS_FREELANCE_CLIENT */
scp->refCount++;
cm_AdjustLRU(scp);
lock_ReleaseWrite(&cm_scacheLock);
+ if (volp)
cm_PutVolume(volp);
*outScpp = scp;
return 0;
cm_hashTablep[hash] = scp;
scp->flags |= CM_SCACHEFLAG_INHASH;
scp->refCount = 1;
+
+ /* XXX - The following fields in the cm_scache are
+ * uninitialized:
+ * fileType
+ * parentVnode
+ * parentUnique
+ */
lock_ReleaseWrite(&cm_scacheLock);
/* now we have a held scache entry; just return it */
// yj: modified this so that callback only checked if we're
// not checking something on /afs
+ /* fix the conditional to match the one in cm_HaveCallback */
if ( (flags & CM_SCACHESYNC_NEEDCALLBACK)
#ifdef AFS_FREELANCE_CLIENT
- && (!cm_freelanceEnabled || !(!(scp->fid.vnode==0x1 &&
- scp->fid.unique==0x1) &&
- scp->fid.cell==AFS_FAKE_ROOT_CELL_ID &&
- scp->fid.volume==AFS_FAKE_ROOT_VOL_ID))
+ && (!cm_freelanceEnabled ||
+ !(scp->fid.vnode==0x1 && scp->fid.unique==0x1) ||
+ scp->fid.cell!=AFS_FAKE_ROOT_CELL_ID ||
+ scp->fid.volume!=AFS_FAKE_ROOT_VOL_ID ||
+ cm_fakeDirCallback < 2)
#endif /* AFS_FREELANCE_CLIENT */
) {
if (!cm_HaveCallback(scp)) {
if (bufLocked) lock_ReleaseMutex(&bufp->mx);
osi_SleepM((long) &scp->flags, &scp->mx);
osi_Log0(afsd_logp, "CM SyncOp woke!");
- if (bufLocked) lock_ObtainMutex(&bufp->mx);
+ if (bufLocked)
+ lock_ObtainMutex(&bufp->mx);
lock_ObtainMutex(&scp->mx);
} /* big while loop */
if (cm_freelanceEnabled && scp == cm_rootSCachep) {
osi_Log0(afsd_logp,"cm_MergeStatus Freelance cm_rootSCachep");
statusp->InterfaceVersion = 0x1;
- statusp->FileType = 0x2;
+ statusp->FileType = CM_SCACHETYPE_DIRECTORY;
statusp->LinkCount = scp->linkCount;
statusp->Length = cm_fakeDirSize;
statusp->DataVersion = cm_fakeDirVersion;
else
scp->fileType = CM_SCACHETYPE_SYMLINK;
}
- else scp->fileType = 0; /* invalid */
-
+ else {
+ osi_Log1(afsd_logp, "Merge, Invalid File Type, scp %x", scp);
+ scp->fileType = 0; /* invalid */
+ }
/* and other stuff */
scp->parentVnode = statusp->ParentVnode;
scp->parentUnique = statusp->ParentUnique;
void cm_DiscardSCache(cm_scache_t *scp)
{
lock_AssertMutex(&scp->mx);
+ if (scp->cbServerp) {
+ cm_PutServer(scp->cbServerp);
scp->cbServerp = NULL;
+ }
scp->cbExpires = 0;
cm_dnlcPurgedp(scp);
cm_FreeAllACLEnts(scp);
/* file status */
int fileType; /* file type */
- unsigned long clientModTime; /* mtime */
- unsigned long serverModTime; /* at server, for concurrent call
+ time_t clientModTime; /* mtime */
+ time_t serverModTime; /* at server, for concurrent call
* comparisons */
osi_hyper_t length; /* file length */
cm_prefetch_t prefetch; /* prefetch info structure */
* the link contents here.
*/
cm_fid_t *mountRootFidp; /* mounted on root */
- unsigned int mountRootGen; /* time to update mountRootFidp? */
+ time_t mountRootGen; /* time to update mountRootFidp? */
cm_fid_t *dotdotFidp; /* parent of volume root */
/* callback info */
struct cm_server *cbServerp; /* server granting callback */
- long cbExpires; /* time callback expires */
+ time_t cbExpires; /* time callback expires */
/* access cache */
long anyAccess; /* anonymous user's access */
lock_ObtainWrite(&cm_serverLock);
for(tsp = cm_allServersp; tsp; tsp = tsp->allNextp) {
- tsp->refCount++;
+ cm_GetServerNoLock(tsp);
lock_ReleaseWrite(&cm_serverLock);
/* now process the server */
cm_GCConnections(tsp);
lock_ObtainWrite(&cm_serverLock);
- osi_assert(tsp->refCount-- > 0);
+ cm_PutServerNoLock(tsp);
}
lock_ReleaseWrite(&cm_serverLock);
}
}
}
+void cm_GetServer(cm_server_t *serverp)
+{
+ lock_ObtainWrite(&cm_serverLock);
+ serverp->refCount++;
+ lock_ReleaseWrite(&cm_serverLock);
+}
+
+void cm_GetServerNoLock(cm_server_t *serverp)
+{
+ serverp->refCount++;
+}
+
void cm_PutServer(cm_server_t *serverp)
{
lock_ObtainWrite(&cm_serverLock);
serverp->ipRank += min(serverp->ipRank, rand() % 0x000f);
} /* and of for loop */
}
- else serverp->ipRank = 10000 + (rand() % 0x00ff); /* VL server */
+ else
+ serverp->ipRank = 10000 + (rand() % 0x00ff); /* VL server */
}
cm_server_t *cm_NewServer(struct sockaddr_in *socketp, int type, cm_cell_t *cellp) {
}
/* bump ref count if we found the server */
- if (tsp) tsp->refCount++;
+ if (tsp)
+ cm_GetServerNoLock(tsp);
/* drop big table lock */
lock_ReleaseWrite(&cm_serverLock);
{
cm_serverRef_t *tsrp;
- lock_ObtainWrite(&cm_serverLock);
- serverp->refCount++;
- lock_ReleaseWrite(&cm_serverLock);
+ cm_GetServer(serverp);
tsrp = malloc(sizeof(*tsrp));
tsrp->server = serverp;
tsrp->status = not_busy;
}
/* call cm_FreeServer while holding a write lock on cm_serverLock */
-void cm_FreeServer(cm_server_t* server)
+void cm_FreeServer(cm_server_t* serverp)
{
- if (--(server->refCount) == 0)
+ cm_PutServerNoLock(serverp);
+ if (serverp->refCount == 0)
{
/* we need to check to ensure that all of the connections
* for this server have a 0 refCount; otherwise, they will
* not be garbage collected
*/
- cm_GCConnections(server); /* connsp */
+ cm_GCConnections(serverp); /* connsp */
- lock_FinalizeMutex(&server->mx);
- if ( cm_allServersp == server )
- cm_allServersp = server->allNextp;
+ lock_FinalizeMutex(&serverp->mx);
+ if ( cm_allServersp == serverp )
+ cm_allServersp = serverp->allNextp;
else {
cm_server_t *tsp;
for(tsp = cm_allServersp; tsp->allNextp; tsp=tsp->allNextp) {
- if ( tsp->allNextp == server ) {
- tsp->allNextp = server->allNextp;
+ if ( tsp->allNextp == serverp ) {
+ tsp->allNextp = serverp->allNextp;
break;
}
}
extern long cm_ChecksumServerList(cm_serverRef_t *serversp);
+extern void cm_GetServer(cm_server_t *);
+
+extern void cm_GetServerNoLock(cm_server_t *);
+
extern void cm_PutServer(cm_server_t *);
extern void cm_PutServerNoLock(cm_server_t *);
psp = tempsp;
tp = psp->data;
cm_ReleaseSCache(tscp);
- tscp = linkScp; /* already held
+ tscp = linkScp;
+ /* already held
* by AssembleLink */
/* now, if linkScp is null, that's
* AssembleLink's way of telling us that
} /* all files in the response */
/* now tell it to drop the count,
* after doing the vnode processing above */
- cm_EndCallbackGrantingCall(NULL, NULL, NULL, 0);
+ cm_EndCallbackGrantingCall(NULL, &cbReq, NULL, 0);
filex += filesThisCall;
} /* while there are still more files to process */
/* make sure we end things properly */
if (!didEnd)
- cm_EndCallbackGrantingCall(NULL, NULL, NULL, 0);
+ cm_EndCallbackGrantingCall(NULL, &cbReq, NULL, 0);
return code;
}
/* make sure we end things properly */
if (!didEnd)
- cm_EndCallbackGrantingCall(NULL, NULL, NULL, 0);
+ cm_EndCallbackGrantingCall(NULL, &cbReq, NULL, 0);
/* and return error code */
return code;
}
/* hold the volume if we found it */
- if (volp) volp->refCount++;
+ if (volp)
+ volp->refCount++;
lock_ReleaseWrite(&cm_volumeLock);
/* return it held */
serverspp = &volp->roServersp;
else if (volume == volp->bkID)
serverspp = &volp->bkServersp;
- else osi_panic("bad volume ID in cm_GetVolServers", __FILE__, __LINE__);
+ else
+ osi_panic("bad volume ID in cm_GetVolServers", __FILE__, __LINE__);
for (current = *serverspp; current; current = current->next)
current->refCount++;
lock_ReleaseWrite(&cm_volumeLock);
/* We should also refresh cached mount points */
-
}
/*
return mydata;
}
+#define AFSCLIENT_ADMIN_GROUPNAME "AFS Client Admins"
+
BOOL IsAdmin (void)
{
static BOOL fAdmin = FALSE;
if (!fTested)
{
- /* Obtain the SID for BUILTIN\Administrators. If this is Windows NT,
- * expect this call to succeed; if it does not, we can presume that
- * it's not NT and therefore the user always has administrative
- * privileges.
+ /* Obtain the SID for the AFS client admin group. If the group does
+ * not exist, then assume we have AFS client admin privileges.
*/
PSID psidAdmin = NULL;
- SID_IDENTIFIER_AUTHORITY auth = SECURITY_NT_AUTHORITY;
+ DWORD dwSize, dwSize2;
+ char pszAdminGroup[ MAX_COMPUTERNAME_LENGTH + sizeof(AFSCLIENT_ADMIN_GROUPNAME) + 2 ];
+ char *pszRefDomain = NULL;
+ SID_NAME_USE snu = SidTypeGroup;
+
+ dwSize = sizeof(pszAdminGroup);
+
+ if (!GetComputerName(pszAdminGroup, &dwSize)) {
+ /* Can't get computer name. We return false in this case.
+ Retain fAdmin and fTested. This shouldn't happen.*/
+ return FALSE;
+ }
fTested = TRUE;
- if (!AllocateAndInitializeSid (&auth, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &psidAdmin))
+ dwSize = 0;
+ dwSize2 = 0;
+
+ strcat(pszAdminGroup,"\\");
+ strcat(pszAdminGroup, AFSCLIENT_ADMIN_GROUPNAME);
+
+ LookupAccountName(NULL, pszAdminGroup, NULL, &dwSize, NULL, &dwSize2, &snu);
+ /* that should always fail. */
+
+ if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
+ /* if we can't find the group, then we allow the operation */
fAdmin = TRUE;
- else
- {
+ return TRUE;
+ }
+
+ if (dwSize == 0 || dwSize2 == 0) {
+ /* Paranoia */
+ fAdmin = TRUE;
+ return TRUE;
+ }
+
+ psidAdmin = (PSID)malloc(dwSize); memset(psidAdmin,0,dwSize);
+ pszRefDomain = (char *)malloc(dwSize2);
+
+ if (!LookupAccountName(NULL, pszAdminGroup, psidAdmin, &dwSize, pszRefDomain, &dwSize2, &snu)) {
+ /* We can't lookup the group now even though we looked it up earlier.
+ Could this happen? */
+ fAdmin = TRUE;
+ } else {
/* Then open our current ProcessToken */
HANDLE hToken;
if (GetTokenInformation (hToken, TokenGroups, pGroups, dwSize, &dwSize))
{
/* Look through the list of group SIDs and see if any of them
- * matches the Administrator group SID.
+ * matches the AFS Client Admin group SID.
*/
size_t iGroup = 0;
for (; (!fAdmin) && (iGroup < pGroups->GroupCount); ++iGroup)
{
- if (EqualSid (psidAdmin, pGroups->Groups[ iGroup ].Sid))
+ if (EqualSid (psidAdmin, pGroups->Groups[ iGroup ].Sid)) {
fAdmin = TRUE;
+ }
}
}
}
}
- if (psidAdmin)
- FreeSid (psidAdmin);
+ free(psidAdmin);
+ free(pszRefDomain);
}
return fAdmin;
if ( checkserv.tinterval != 0 ) {
#ifdef WIN32
if ( !IsAdmin() ) {
- fprintf (stderr,"Permission denied: requires Administrator access.\n");
+ fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n");
return EACCES;
}
#else /* WIN32 */
#ifdef WIN32
if ( !IsAdmin() ) {
- fprintf (stderr,"Permission denied: requires Administrator access.\n");
+ fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n");
return EACCES;
}
#else /* WIN32 */
#ifdef WIN32
if ( !IsAdmin() ) {
- fprintf (stderr,"Permission denied: requires Administrator access.\n");
+ fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n");
return EACCES;
}
#else /* WIN32 */
if (ti) {
#ifdef WIN32
if ( !IsAdmin() ) {
- fprintf (stderr,"Permission denied: requires Administrator access.\n");
+ fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n");
return EACCES;
}
#else /* WIN32 */
#ifdef WIN32
if ( !IsAdmin() ) {
- fprintf (stderr,"Permission denied: requires Administrator access.\n");
+ fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n");
return EACCES;
}
#else /* WIN32 */
#ifdef WIN32
if ( !IsAdmin() ) {
- fprintf (stderr,"Permission denied: requires Administrator access.\n");
+ fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n");
return EACCES;
}
#else /* WIN32 */
#ifdef WIN32
if ( !IsAdmin() ) {
- fprintf (stderr,"Permission denied: requires Administrator access.\n");
+ fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n");
return EACCES;
}
#else /* WIN32 */
#ifdef WIN32
if ( !IsAdmin() ) {
- fprintf (stderr,"Permission denied: requires Administrator access.\n");
+ fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n");
return EACCES;
}
#else /* WIN32 */
#ifdef WIN32
if ( !IsAdmin() ) {
- fprintf (stderr,"Permission denied: requires Administrator access.\n");
+ fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n");
return EACCES;
}
#else /* WIN32 */
#ifdef WIN32
if ( !IsAdmin() ) {
- fprintf (stderr,"Permission denied: requires Administrator access.\n");
+ fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n");
return EACCES;
}
#else /* WIN32 */
static CSCPolicyCmd(struct cmd_syndesc *asp)
{
- struct cmd_item *ti;
- char *share = NULL;
+ struct cmd_item *ti;
+ char *share = NULL;
HKEY hkCSCPolicy;
- for(ti=asp->parms[0].items; ti;ti=ti->next) {
- share = ti->data;
- if (share)
- {
- break;
- }
- }
+ for(ti=asp->parms[0].items; ti;ti=ti->next) {
+ share = ti->data;
+ if (share)
+ {
+ break;
+ }
+ }
- if (share)
- {
+ if (share)
+ {
char *policy;
RegCreateKeyEx( HKEY_LOCAL_MACHINE,
&hkCSCPolicy,
NULL );
- if ( !IsAdmin() || hkCSCPolicy == NULL ) {
+ if ( hkCSCPolicy == NULL ) {
fprintf (stderr,"Permission denied: requires Administrator access.\n");
- if ( hkCSCPolicy )
- RegCloseKey(hkCSCPolicy);
+ return EACCES;
+ }
+
+ if ( !IsAdmin() ) {
+ fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n");
+ RegCloseKey(hkCSCPolicy);
return EACCES;
}
policy = "manual";
- if (asp->parms[1].items)
- policy = "manual";
- if (asp->parms[2].items)
- policy = "programs";
- if (asp->parms[3].items)
- policy = "documents";
- if (asp->parms[4].items)
- policy = "disable";
+ if (asp->parms[1].items)
+ policy = "manual";
+ if (asp->parms[2].items)
+ policy = "programs";
+ if (asp->parms[3].items)
+ policy = "documents";
+ if (asp->parms[4].items)
+ policy = "disable";
RegSetValueEx( hkCSCPolicy, share, 0, REG_SZ, policy, strlen(policy)+1);
- printf("CSC policy on share \"%s\" changed to \"%s\".\n\n", share, policy);
- printf("Close all applications that accessed files on this share or restart AFS Client for the change to take effect.\n");
- }
- else
- {
+ printf("CSC policy on share \"%s\" changed to \"%s\".\n\n", share, policy);
+ printf("Close all applications that accessed files on this share or restart AFS Client for the change to take effect.\n");
+ }
+ else
+ {
DWORD dwIndex, dwPolicies;
- char policyName[256];
- DWORD policyNameLen;
+ char policyName[256];
+ DWORD policyNameLen;
char policy[256];
DWORD policyLen;
DWORD dwType;
- /* list current csc policies */
-
+ /* list current csc policies */
+
RegCreateKeyEx( HKEY_LOCAL_MACHINE,
"SOFTWARE\\OpenAFS\\Client\\CSCPolicy",
0,
NULL /* lpftLastWriteTime */
);
- printf("Current CSC policies:\n");
+ printf("Current CSC policies:\n");
for ( dwIndex = 0; dwIndex < dwPolicies; dwIndex ++ ) {
policyNameLen = sizeof(policyName);
RegEnumValue( hkCSCPolicy, dwIndex, policyName, &policyNameLen, NULL,
&dwType, policy, &policyLen);
- printf(" %s = %s\n", policyName, policy);
- }
- }
+ printf(" %s = %s\n", policyName, policy);
+ }
+ }
RegCloseKey(hkCSCPolicy);
- return (0);
+ return (0);
}
/* TODO; logout mechanism needs to be thread-safe */
char *loggedOutName = NULL;
smb_user_t *loggedOutUserp = NULL;
-unsigned long loggedOutTime;
+time_t loggedOutTime;
int loggedOut = 0;
int smbShutdownFlag = 0;
int smb_LogoffTokenTransfer;
-unsigned long smb_LogoffTransferTimeout;
+time_t smb_LogoffTransferTimeout;
DWORD last_msg_time = 0;
}
#ifndef DJGPP
-void ShowUnixTime(char *FuncName, afs_uint32 unixTime)
+void ShowUnixTime(char *FuncName, time_t unixTime)
{
FILETIME ft;
WORD wDate, wTime;
}
#ifndef DJGPP
-void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, afs_uint32 unixTime)
+void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, time_t unixTime)
{
struct tm *ltp;
SYSTEMTIME stm;
struct tm localJunk;
- long ersatz_unixTime;
+ time_t ersatz_unixTime;
/*
* Must use kludge-GMT instead of real GMT.
SystemTimeToFileTime(&stm, largeTimep);
}
#else /* DJGPP */
-void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, afs_uint32 unixTime)
+void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, time_t unixTime)
{
/* unixTime: seconds since 1/1/1970 00:00:00 GMT */
/* FILETIME: 100ns intervals since 1/1/1601 00:00:00 ??? */
#endif /* !DJGPP */
#ifndef DJGPP
-void smb_UnixTimeFromLargeSearchTime(afs_uint32 *unixTimep, FILETIME *largeTimep)
+void smb_UnixTimeFromLargeSearchTime(time_t *unixTimep, FILETIME *largeTimep)
{
SYSTEMTIME stm;
struct tm lt;
_timezone = save_timezone;
}
#else /* DJGPP */
-void smb_UnixTimeFromLargeSearchTime(afs_uint32 *unixTimep, FILETIME *largeTimep)
+void smb_UnixTimeFromLargeSearchTime(time_t *unixTimep, FILETIME *largeTimep)
{
/* unixTime: seconds since 1/1/1970 00:00:00 GMT */
/* FILETIME: 100ns intervals since 1/1/1601 00:00:00 GMT? */
}
#endif /* !DJGPP */
-void smb_SearchTimeFromUnixTime(long *dosTimep, afs_uint32 unixTime)
+void smb_SearchTimeFromUnixTime(long *dosTimep, time_t unixTime)
{
- struct tm *ltp;
- int dosDate;
- int dosTime;
- struct tm localJunk;
-
- ltp = localtime((time_t*) &unixTime);
-
- /* if we fail, make up something */
- if (!ltp) {
- ltp = &localJunk;
- localJunk.tm_year = 89 - 20;
- localJunk.tm_mon = 4;
- localJunk.tm_mday = 12;
- localJunk.tm_hour = 0;
- localJunk.tm_min = 0;
- localJunk.tm_sec = 0;
- }
-
- dosDate = ((ltp->tm_year-80)<<9) | ((ltp->tm_mon+1) << 5) | (ltp->tm_mday);
- dosTime = (ltp->tm_hour<<11) | (ltp->tm_min << 5) | (ltp->tm_sec / 2);
- *dosTimep = (dosDate<<16) | dosTime;
+ struct tm *ltp;
+ int dosDate;
+ int dosTime;
+ struct tm localJunk;
+ time_t t = unixTime;
+
+ ltp = localtime((time_t*) &t);
+
+ /* if we fail, make up something */
+ if (!ltp) {
+ ltp = &localJunk;
+ localJunk.tm_year = 89 - 20;
+ localJunk.tm_mon = 4;
+ localJunk.tm_mday = 12;
+ localJunk.tm_hour = 0;
+ localJunk.tm_min = 0;
+ localJunk.tm_sec = 0;
+ }
+
+ dosDate = ((ltp->tm_year-80)<<9) | ((ltp->tm_mon+1) << 5) | (ltp->tm_mday);
+ dosTime = (ltp->tm_hour<<11) | (ltp->tm_min << 5) | (ltp->tm_sec / 2);
+ *dosTimep = (dosDate<<16) | dosTime;
}
-void smb_UnixTimeFromSearchTime(afs_uint32 *unixTimep, long searchTime)
+void smb_UnixTimeFromSearchTime(time_t *unixTimep, time_t searchTime)
{
unsigned short dosDate;
unsigned short dosTime;
*unixTimep = mktime(&localTm);
}
-void smb_DosUTimeFromUnixTime(afs_uint32 *dosUTimep, afs_uint32 unixTime)
+void smb_DosUTimeFromUnixTime(time_t *dosUTimep, time_t unixTime)
{
*dosUTimep = unixTime - smb_localZero;
}
-void smb_UnixTimeFromDosUTime(afs_uint32 *unixTimep, afs_uint32 dosTime)
+void smb_UnixTimeFromDosUTime(time_t *unixTimep, time_t dosTime)
{
#ifndef DJGPP
*unixTimep = dosTime + smb_localZero;
char protocol_array[10][1024]; /* protocol signature of the client */
int caps; /* capabilities */
time_t unixTime;
- long dosTime;
+ time_t dosTime;
TIME_ZONE_INFORMATION tzi;
osi_Log1(smb_logp, "SMB receive negotiate; %d + 1 ongoing ops",
long code = 0;
cm_scache_t *scp;
char *dptr;
- long dosTime;
+ time_t dosTime;
u_short shortTemp;
char attr;
smb_dirListPatch_t *patchp;
unsigned short attribute;
cm_attr_t attr;
cm_scache_t *newScp;
- long dosTime;
+ time_t dosTime;
cm_user_t *userp;
int caseFold;
char *tidPathp;
long code = 0;
cm_scache_t *rootScp;
cm_scache_t *newScp, *dscp;
- long dosTime;
+ time_t dosTime;
int attrs;
cm_user_t *userp;
int caseFold;
long code = 0;
cm_user_t *userp;
cm_scache_t *scp;
- long dosTime;
+ time_t dosTime;
int caseFold;
cm_space_t *spacep;
char *tidPathp;
struct smb_user *usersp; /* the first child in the user session list */
struct smb_fid *fidsp; /* the first child in the open file list */
struct smb_user *justLoggedOut; /* ready for profile upload? */
- unsigned long logoffTime; /* tick count when logged off */
+ time_t logoffTime; /* tick count when logged off */
/*struct cm_user *logonDLLUser; /* integrated logon user */
unsigned char errorCount;
char rname[17];
int refCount; /* reference count */
long cookie; /* value returned to the caller */
struct cm_scache *scp; /* vnode of the dir we're searching */
- long lastTime; /* last time we used this */
+ time_t lastTime; /* last time we used this */
long flags; /* flags (see below);
* locked by smb_globalLock */
unsigned short attribute; /* search attribute
} smb_dirListPatch_t;
/* dirListPatch Flags */
-#define SMB_DIRLISTPATCH_DOTFILE 1 /* the file referenced is a dot file
- Note: will not be set if smb_hideDotFiles is false */
+#define SMB_DIRLISTPATCH_DOTFILE 1
+/* the file referenced is a dot file
+ * Note: will not be set if smb_hideDotFiles is false
+ */
/* waiting lock list elements */
typedef struct smb_waitingLock {
smb_vc_t *vcp;
smb_packet_t *inp;
smb_packet_t *outp;
- u_long timeRemaining;
+ time_t timeRemaining;
void *lockp;
} smb_waitingLock_t;
#endif
);
-extern void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, afs_uint32 unixTime);
+extern void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, time_t unixTime);
-extern void smb_UnixTimeFromLargeSearchTime(afs_uint32 *unixTimep, FILETIME *largeTimep);
+extern void smb_UnixTimeFromLargeSearchTime(time_t *unixTimep, FILETIME *largeTimep);
-extern void smb_SearchTimeFromUnixTime(long *dosTimep, afs_uint32 unixTime);
+extern void smb_SearchTimeFromUnixTime(time_t *dosTimep, time_t unixTime);
-extern void smb_UnixTimeFromSearchTime(afs_uint32 *unixTimep, long searchTime);
+extern void smb_UnixTimeFromSearchTime(time_t *unixTimep, time_t searchTime);
-extern void smb_DosUTimeFromUnixTime(afs_uint32 *dosUTimep, afs_uint32 unixTime);
+extern void smb_DosUTimeFromUnixTime(time_t *dosUTimep, time_t unixTime);
-extern void smb_UnixTimeFromDosUTime(afs_uint32 *unixTimep, afs_uint32 dosUTime);
+extern void smb_UnixTimeFromDosUTime(time_t *unixTimep, time_t dosUTime);
extern smb_vc_t *smb_FindVC(unsigned short lsn, int flags, int lana);
/* some globals, too */
extern char *smb_localNamep;
extern int loggedOut;
-extern unsigned long loggedOutTime;
+extern time_t loggedOutTime;
extern char *loggedOutName;
extern smb_user_t *loggedOutUserp;
extern osi_rwlock_t smb_rctLock;
extern int smb_LogoffTokenTransfer;
-extern unsigned long smb_LogoffTransferTimeout;
+extern time_t smb_LogoffTransferTimeout;
extern int smb_maxVCPerServer; /* max # of VCs per server */
extern int smb_maxMpxRequests; /* max # of mpx requests */
*((u_long *)dptr) = SMB_ATTR_HIDDEN;
}
dptr += 4;
-
} else {
/* 1969-12-31 23:59:58 +00*/
dosTime = 0xEBBFBF7D;
/* merge in hidden (dot file) attribute */
if ( patchp->flags & SMB_DIRLISTPATCH_DOTFILE ) {
- attr == SMB_ATTR_HIDDEN;
+ attr = SMB_ATTR_HIDDEN;
*dptr++ = attr & 0xff;
*dptr++ = (attr >> 8) & 0xff;
}
-
}
continue;
}
cm_scache_t *dscp, char *filename, char *otherFilename,
BOOL isDirectParent)
{
- smb_packet_t *watch, *lastWatch, *nextWatch;
- ULONG parmSlot, parmCount, parmOffset, dataOffset, nameLen;
- char *outData, *oldOutData;
- ULONG filter;
- USHORT fid, wtree;
- ULONG maxLen;
- BOOL twoEntries = FALSE;
- ULONG otherNameLen, oldParmCount = 0;
- DWORD otherAction;
- smb_vc_t *vcp;
- smb_fid_t *fidp;
+ smb_packet_t *watch, *lastWatch, *nextWatch;
+ ULONG parmSlot, parmCount, parmOffset, dataOffset, nameLen;
+ char *outData, *oldOutData;
+ ULONG filter;
+ USHORT fid, wtree;
+ ULONG maxLen;
+ BOOL twoEntries = FALSE;
+ ULONG otherNameLen, oldParmCount = 0;
+ DWORD otherAction;
+ smb_vc_t *vcp;
+ smb_fid_t *fidp;
- /* Get ready for rename within directory */
- if (action == FILE_ACTION_RENAMED_OLD_NAME && otherFilename != NULL) {
- twoEntries = TRUE;
- otherAction = FILE_ACTION_RENAMED_NEW_NAME;
- }
+ /* Get ready for rename within directory */
+ if (action == FILE_ACTION_RENAMED_OLD_NAME && otherFilename != NULL) {
+ twoEntries = TRUE;
+ otherAction = FILE_ACTION_RENAMED_NEW_NAME;
+ }
osi_Log2(smb_logp,"in smb_NotifyChange for file [%s] dscp [%x]",
- osi_LogSaveString(smb_logp,filename),dscp);
-
- lock_ObtainMutex(&smb_Dir_Watch_Lock);
- watch = smb_Directory_Watches;
- while (watch) {
- filter = smb_GetSMBParm(watch, 19)
- | (smb_GetSMBParm(watch, 20) << 16);
- fid = smb_GetSMBParm(watch, 21);
- wtree = smb_GetSMBParm(watch, 22) & 0xffff; /* TODO: should this be 0xff ? */
- maxLen = smb_GetSMBOffsetParm(watch, 5, 1)
- | (smb_GetSMBOffsetParm(watch, 6, 1) << 16);
- vcp = watch->vcp;
-
- /*
- * Strange hack - bug in NT Client and NT Server that we
- * must emulate?
- */
- if (filter == 3 && wtree)
- filter = 0x17;
+ osi_LogSaveString(smb_logp,filename),dscp);
+
+ lock_ObtainMutex(&smb_Dir_Watch_Lock);
+ watch = smb_Directory_Watches;
+ while (watch) {
+ filter = smb_GetSMBParm(watch, 19)
+ | (smb_GetSMBParm(watch, 20) << 16);
+ fid = smb_GetSMBParm(watch, 21);
+ wtree = smb_GetSMBParm(watch, 22) & 0xffff; /* TODO: should this be 0xff ? */
+ maxLen = smb_GetSMBOffsetParm(watch, 5, 1)
+ | (smb_GetSMBOffsetParm(watch, 6, 1) << 16);
+ vcp = watch->vcp;
+
+ /*
+ * Strange hack - bug in NT Client and NT Server that we
+ * must emulate?
+ */
+ if (filter == 3 && wtree)
+ filter = 0x17;
- fidp = smb_FindFID(vcp, fid, 0);
+ fidp = smb_FindFID(vcp, fid, 0);
if (!fidp) {
osi_Log1(smb_logp," no fidp for fid[%d]",fid);
- lastWatch = watch;
- watch = watch->nextp;
- continue;
- }
- if (fidp->scp != dscp
- || (filter & notifyFilter) == 0
- || (!isDirectParent && !wtree)) {
+ lastWatch = watch;
+ watch = watch->nextp;
+ continue;
+ }
+ if (fidp->scp != dscp
+ || (filter & notifyFilter) == 0
+ || (!isDirectParent && !wtree)) {
osi_Log1(smb_logp," passing fidp->scp[%x]", fidp->scp);
smb_ReleaseFID(fidp);
- lastWatch = watch;
- watch = watch->nextp;
- continue;
- }
- smb_ReleaseFID(fidp);
+ lastWatch = watch;
+ watch = watch->nextp;
+ continue;
+ }
+ smb_ReleaseFID(fidp);
- osi_Log4(smb_logp,
- "Sending Change Notification for fid %d filter 0x%x wtree %d file %s",
- fid, filter, wtree, osi_LogSaveString(smb_logp, filename));
+ osi_Log4(smb_logp,
+ "Sending Change Notification for fid %d filter 0x%x wtree %d file %s",
+ fid, filter, wtree, osi_LogSaveString(smb_logp, filename));
- nextWatch = watch->nextp;
- if (watch == smb_Directory_Watches)
- smb_Directory_Watches = nextWatch;
- else
- lastWatch->nextp = nextWatch;
+ nextWatch = watch->nextp;
+ if (watch == smb_Directory_Watches)
+ smb_Directory_Watches = nextWatch;
+ else
+ lastWatch->nextp = nextWatch;
- /* Turn off WATCHED flag in dscp */
- lock_ObtainMutex(&dscp->mx);
- if (wtree)
- dscp->flags &= ~CM_SCACHEFLAG_WATCHEDSUBTREE;
- else
- dscp->flags &= ~CM_SCACHEFLAG_WATCHED;
- lock_ReleaseMutex(&dscp->mx);
+ /* Turn off WATCHED flag in dscp */
+ lock_ObtainMutex(&dscp->mx);
+ if (wtree)
+ dscp->flags &= ~CM_SCACHEFLAG_WATCHEDSUBTREE;
+ else
+ dscp->flags &= ~CM_SCACHEFLAG_WATCHED;
+ lock_ReleaseMutex(&dscp->mx);
- /* Convert to response packet */
- ((smb_t *) watch)->reb = 0x80;
- ((smb_t *) watch)->wct = 0;
+ /* Convert to response packet */
+ ((smb_t *) watch)->reb = 0x80;
+ ((smb_t *) watch)->wct = 0;
- /* out parms */
- if (filename == NULL)
- parmCount = 0;
- else {
- nameLen = strlen(filename);
- parmCount = 3*4 + nameLen*2;
- parmCount = (parmCount + 3) & ~3; /* pad to 4 */
- if (twoEntries) {
- otherNameLen = strlen(otherFilename);
- oldParmCount = parmCount;
- parmCount += 3*4 + otherNameLen*2;
- parmCount = (parmCount + 3) & ~3; /* pad to 4 */
- }
- if (maxLen < parmCount)
- parmCount = 0; /* not enough room */
- }
- parmOffset = 8*4 + 39;
- parmOffset += 1; /* pad to 4 */
- dataOffset = parmOffset + parmCount;
-
- parmSlot = 1;
- watch->oddByte = 1;
- /* Total Parameter Count */
- smb_SetSMBParmLong(watch, parmSlot, parmCount); parmSlot += 2;
- /* Total Data Count */
- smb_SetSMBParmLong(watch, parmSlot, 0); parmSlot += 2;
- /* Parameter Count */
- smb_SetSMBParmLong(watch, parmSlot, parmCount); parmSlot += 2;
- /* Parameter Offset */
- smb_SetSMBParmLong(watch, parmSlot, parmOffset); parmSlot += 2;
- /* Parameter Displacement */
- smb_SetSMBParmLong(watch, parmSlot, 0); parmSlot += 2;
- /* Data Count */
- smb_SetSMBParmLong(watch, parmSlot, 0); parmSlot += 2;
- /* Data Offset */
- smb_SetSMBParmLong(watch, parmSlot, dataOffset); parmSlot += 2;
- /* Data Displacement */
- smb_SetSMBParmLong(watch, parmSlot, 0); parmSlot += 2;
- smb_SetSMBParmByte(watch, parmSlot, 0); /* Setup Count */
- smb_SetSMBDataLength(watch, parmCount + 1);
-
- if (parmCount != 0) {
- outData = smb_GetSMBData(watch, NULL);
- outData++; /* round to get to parmOffset */
- oldOutData = outData;
- *((DWORD *)outData) = oldParmCount; outData += 4;
- /* Next Entry Offset */
- *((DWORD *)outData) = action; outData += 4;
- /* Action */
- *((DWORD *)outData) = nameLen*2; outData += 4;
- /* File Name Length */
- mbstowcs((WCHAR *)outData, filename, nameLen);
- /* File Name */
- if (twoEntries) {
- outData = oldOutData + oldParmCount;
- *((DWORD *)outData) = 0; outData += 4;
- /* Next Entry Offset */
- *((DWORD *)outData) = otherAction; outData += 4;
- /* Action */
- *((DWORD *)outData) = otherNameLen*2;
- outData += 4; /* File Name Length */
- mbstowcs((WCHAR *)outData, otherFilename,
- otherNameLen); /* File Name */
- }
- }
+ /* out parms */
+ if (filename == NULL)
+ parmCount = 0;
+ else {
+ nameLen = strlen(filename);
+ parmCount = 3*4 + nameLen*2;
+ parmCount = (parmCount + 3) & ~3; /* pad to 4 */
+ if (twoEntries) {
+ otherNameLen = strlen(otherFilename);
+ oldParmCount = parmCount;
+ parmCount += 3*4 + otherNameLen*2;
+ parmCount = (parmCount + 3) & ~3; /* pad to 4 */
+ }
+ if (maxLen < parmCount)
+ parmCount = 0; /* not enough room */
+ }
+ parmOffset = 8*4 + 39;
+ parmOffset += 1; /* pad to 4 */
+ dataOffset = parmOffset + parmCount;
- /*
- * If filename is null, we don't know the cause of the
- * change notification. We return zero data (see above),
- * and set error code to NT_STATUS_NOTIFY_ENUM_DIR
- * (= 0x010C). We set the error code here by hand, without
- * modifying wct and bcc.
- */
- if (filename == NULL) {
- ((smb_t *) watch)->rcls = 0x0C;
- ((smb_t *) watch)->reh = 0x01;
- ((smb_t *) watch)->errLow = 0;
- ((smb_t *) watch)->errHigh = 0;
- /* Set NT Status codes flag */
- ((smb_t *) watch)->flg2 |= 0x4000;
- }
+ parmSlot = 1;
+ watch->oddByte = 1;
+ /* Total Parameter Count */
+ smb_SetSMBParmLong(watch, parmSlot, parmCount); parmSlot += 2;
+ /* Total Data Count */
+ smb_SetSMBParmLong(watch, parmSlot, 0); parmSlot += 2;
+ /* Parameter Count */
+ smb_SetSMBParmLong(watch, parmSlot, parmCount); parmSlot += 2;
+ /* Parameter Offset */
+ smb_SetSMBParmLong(watch, parmSlot, parmOffset); parmSlot += 2;
+ /* Parameter Displacement */
+ smb_SetSMBParmLong(watch, parmSlot, 0); parmSlot += 2;
+ /* Data Count */
+ smb_SetSMBParmLong(watch, parmSlot, 0); parmSlot += 2;
+ /* Data Offset */
+ smb_SetSMBParmLong(watch, parmSlot, dataOffset); parmSlot += 2;
+ /* Data Displacement */
+ smb_SetSMBParmLong(watch, parmSlot, 0); parmSlot += 2;
+ smb_SetSMBParmByte(watch, parmSlot, 0); /* Setup Count */
+ smb_SetSMBDataLength(watch, parmCount + 1);
+
+ if (parmCount != 0) {
+ outData = smb_GetSMBData(watch, NULL);
+ outData++; /* round to get to parmOffset */
+ oldOutData = outData;
+ *((DWORD *)outData) = oldParmCount; outData += 4;
+ /* Next Entry Offset */
+ *((DWORD *)outData) = action; outData += 4;
+ /* Action */
+ *((DWORD *)outData) = nameLen*2; outData += 4;
+ /* File Name Length */
+ mbstowcs((WCHAR *)outData, filename, nameLen);
+ /* File Name */
+ if (twoEntries) {
+ outData = oldOutData + oldParmCount;
+ *((DWORD *)outData) = 0; outData += 4;
+ /* Next Entry Offset */
+ *((DWORD *)outData) = otherAction; outData += 4;
+ /* Action */
+ *((DWORD *)outData) = otherNameLen*2;
+ outData += 4; /* File Name Length */
+ mbstowcs((WCHAR *)outData, otherFilename,
+ otherNameLen); /* File Name */
+ }
+ }
+
+ /*
+ * If filename is null, we don't know the cause of the
+ * change notification. We return zero data (see above),
+ * and set error code to NT_STATUS_NOTIFY_ENUM_DIR
+ * (= 0x010C). We set the error code here by hand, without
+ * modifying wct and bcc.
+ */
+ if (filename == NULL) {
+ ((smb_t *) watch)->rcls = 0x0C;
+ ((smb_t *) watch)->reh = 0x01;
+ ((smb_t *) watch)->errLow = 0;
+ ((smb_t *) watch)->errHigh = 0;
+ /* Set NT Status codes flag */
+ ((smb_t *) watch)->flg2 |= 0x4000;
+ }
- smb_SendPacket(vcp, watch);
+ smb_SendPacket(vcp, watch);
smb_ReleaseVC(vcp);
- smb_FreePacket(watch);
- watch = nextWatch;
- }
- lock_ReleaseMutex(&smb_Dir_Watch_Lock);
-}
+ smb_FreePacket(watch);
+ watch = nextWatch;
+ }
+ lock_ReleaseMutex(&smb_Dir_Watch_Lock);
+}
long smb_ReceiveNTCancel(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
{
- unsigned char *replyWctp;
- smb_packet_t *watch, *lastWatch;
- USHORT fid, watchtree;
- smb_fid_t *fidp;
- cm_scache_t *scp;
-
- osi_Log0(smb_logp, "SMB3 receive NT cancel");
+ unsigned char *replyWctp;
+ smb_packet_t *watch, *lastWatch;
+ USHORT fid, watchtree;
+ smb_fid_t *fidp;
+ cm_scache_t *scp;
- lock_ObtainMutex(&smb_Dir_Watch_Lock);
- watch = smb_Directory_Watches;
- while (watch) {
- if (((smb_t *)watch)->uid == ((smb_t *)inp)->uid
- && ((smb_t *)watch)->pid == ((smb_t *)inp)->pid
- && ((smb_t *)watch)->mid == ((smb_t *)inp)->mid
- && ((smb_t *)watch)->tid == ((smb_t *)inp)->tid) {
- if (watch == smb_Directory_Watches)
- smb_Directory_Watches = watch->nextp;
- else
- lastWatch->nextp = watch->nextp;
- lock_ReleaseMutex(&smb_Dir_Watch_Lock);
+ osi_Log0(smb_logp, "SMB3 receive NT cancel");
+
+ lock_ObtainMutex(&smb_Dir_Watch_Lock);
+ watch = smb_Directory_Watches;
+ while (watch) {
+ if (((smb_t *)watch)->uid == ((smb_t *)inp)->uid
+ && ((smb_t *)watch)->pid == ((smb_t *)inp)->pid
+ && ((smb_t *)watch)->mid == ((smb_t *)inp)->mid
+ && ((smb_t *)watch)->tid == ((smb_t *)inp)->tid) {
+ if (watch == smb_Directory_Watches)
+ smb_Directory_Watches = watch->nextp;
+ else
+ lastWatch->nextp = watch->nextp;
+ lock_ReleaseMutex(&smb_Dir_Watch_Lock);
- /* Turn off WATCHED flag in scp */
- fid = smb_GetSMBParm(watch, 21);
- watchtree = smb_GetSMBParm(watch, 22) & 0xffff;
+ /* Turn off WATCHED flag in scp */
+ fid = smb_GetSMBParm(watch, 21);
+ watchtree = smb_GetSMBParm(watch, 22) & 0xffff;
if (vcp != watch->vcp)
osi_Log2(smb_logp, "smb_ReceiveNTCancel: vcp %x not equal to watch vcp %x",
- vcp, watch->vcp);
+ vcp, watch->vcp);
- fidp = smb_FindFID(vcp, fid, 0);
+ fidp = smb_FindFID(vcp, fid, 0);
if (fidp) {
osi_Log3(smb_logp, "Cancelling change notification for fid %d wtree %d file %s",
- fid, watchtree,
- osi_LogSaveString(smb_logp, (fidp)?fidp->NTopen_wholepathp:""));
+ fid, watchtree,
+ osi_LogSaveString(smb_logp, (fidp)?fidp->NTopen_wholepathp:""));
scp = fidp->scp;
lock_ObtainMutex(&scp->mx);
osi_Log2(smb_logp,"NTCancel unable to resolve fid [%d] in vcp[%x]", fid,vcp);
}
- /* assume STATUS32; return 0xC0000120 (CANCELED) */
- replyWctp = watch->wctp;
- *replyWctp++ = 0;
- *replyWctp++ = 0;
- *replyWctp++ = 0;
- ((smb_t *)watch)->rcls = 0x20;
- ((smb_t *)watch)->reh = 0x1;
- ((smb_t *)watch)->errLow = 0;
- ((smb_t *)watch)->errHigh = 0xC0;
- ((smb_t *)watch)->flg2 |= 0x4000;
- smb_SendPacket(vcp, watch);
+ /* assume STATUS32; return 0xC0000120 (CANCELED) */
+ replyWctp = watch->wctp;
+ *replyWctp++ = 0;
+ *replyWctp++ = 0;
+ *replyWctp++ = 0;
+ ((smb_t *)watch)->rcls = 0x20;
+ ((smb_t *)watch)->reh = 0x1;
+ ((smb_t *)watch)->errLow = 0;
+ ((smb_t *)watch)->errHigh = 0xC0;
+ ((smb_t *)watch)->flg2 |= 0x4000;
+ smb_SendPacket(vcp, watch);
if (watch->vcp)
smb_ReleaseVC(watch->vcp);
- smb_FreePacket(watch);
- return 0;
- }
- lastWatch = watch;
- watch = watch->nextp;
- }
- lock_ReleaseMutex(&smb_Dir_Watch_Lock);
+ smb_FreePacket(watch);
+ return 0;
+ }
+ lastWatch = watch;
+ watch = watch->nextp;
+ }
+ lock_ReleaseMutex(&smb_Dir_Watch_Lock);
- return 0;
+ return 0;
}
void smb3_Init()
{
static char lastcell[MAXCELLCHARS+1] = { 0 };
static char confname[512] = { 0 };
+ char username_copy[BUFSIZ];
long viceId; /* AFS uid of user */
#ifdef ALLOW_REGISTER
afs_int32 id;
#else /* ALLOW_REGISTER */
if ((*status == 0) && (viceId != ANONYMOUSID))
#endif /* ALLOW_REGISTER */
- sprintf (username, "AFS ID %d", (int) viceId);
+ {
+#ifdef AFS_ID_TO_NAME
+ strncpy(username_copy, username, BUFSIZ);
+ snprintf (username, BUFSIZ, "%s (AFS ID %d)", username_copy, (int) viceId);
+#endif /* AFS_ID_TO_NAME */
+ }
#ifdef ALLOW_REGISTER
} else if (strcmp(realm_of_user, realm_of_cell) != 0) {
if (dflag) {
printf("%s: unable to obtain tokens for cell %s "
"(status: %d).\n", progname, cell_to_use, status);
*status = AKLOG_TOKEN;
+ return ;
}
/*
if ((*status = pr_Initialize(1L, confname, aserver->cell, 0))) {
printf("Error %d\n", status);
+ return;
}
if ((*status = pr_CreateUser(username, &id))) {
} else {
printf("created cross-cell entry for %s at %s\n",
username, cell_to_use);
- sprintf(username, "AFS ID %d", (int) id);
+#ifdef AFS_ID_TO_NAME
+ strncpy(username_copy, username, BUFSIZ);
+ snprintf (username, BUFSIZ, "%s (AFS ID %d)", username_copy, (int) viceId);
+#endif /* AFS_ID_TO_NAME */
}
}
}
*s++ = c;
}
*s++ = 0;
-
}
return krbrlm;
}
memcpy(&atoken.sessionKey, v5cred->keyblock.contents, v5cred->keyblock.length);
atoken.ticketLen = v5cred->ticket.length;
memcpy(atoken.ticket, v5cred->ticket.data, atoken.ticketLen);
- } else
- {
+ } else {
strcpy (username, c.pname);
if (c.pinst[0])
{
progname, status);
return(AKLOG_KERBEROS);
}
- } else
- {
+ } else {
if ((status = krb_get_tf_realm(TKT_FILE, realm_of_user)) != KSUCCESS)
{
fprintf(stderr, "%s: Couldn't determine realm of user: %s)",
*/
strncpy(aclient.name, username, MAXKTCNAMELEN - 1);
strcpy(aclient.instance, "");
+
if (usev5) {
int len = min(v5cred->client->realm.length,MAXKTCNAMELEN - 1);
strncpy(aclient.cell, v5cred->client->realm.data, len);
for (cur_node = cells.first; cur_node; cur_node = cur_node->next)
{
memcpy(&cellinfo, cur_node->data, sizeof(cellinfo));
- if (status = auth_to_cell(
- context,
+ if (status = auth_to_cell(context,
cellinfo.cell, cellinfo.realm))
somethingswrong++;
}
/* Then, log to all paths in the paths list */
for (cur_node = paths.first; cur_node; cur_node = cur_node->next)
{
- if (status = auth_to_path(
- context,
+ if (status = auth_to_path(context,
cur_node->data))
somethingswrong++;
}
{
HKEY hkMappings;
RegCreateKeyEx( HKEY_CURRENT_USER,
- "SOFTWARE\\OpenAFS\\Client\\Mappings",
+ cszSECTION_MAPPINGS,
0,
"AFS",
REG_OPTION_NON_VOLATILE,
RegEnumValue( hkMappings, dwIndex, drive, &driveLen, NULL,
&dwType, (LPBYTE)mapping, &mappingLen);
+ if ( dwType == REG_EXPAND_SZ ) {
+ TCHAR buf[MAX_PATH];
+ DWORD dummyLen = ExpandEnvironmentStrings(buf, mapping, MAX_PATH);
+ if (dummyLen > MAX_PATH)
+ continue;
+ _tcsncpy(mapping, buf, MAX_PATH);
+ }
- DRIVEMAP DriveMap;
- memset (&DriveMap, 0x00, sizeof(DRIVEMAP));
- DriveMap.chDrive = toupper(*drive);
- DriveMap.fPersistent = TRUE;
- if ((DriveMap.chDrive < chDRIVE_A) || (DriveMap.chDrive > chDRIVE_Z))
- continue;
+ DRIVEMAP DriveMap;
+ memset (&DriveMap, 0x00, sizeof(DRIVEMAP));
+ DriveMap.chDrive = toupper(*drive);
+ DriveMap.fPersistent = TRUE;
+ if ((DriveMap.chDrive < chDRIVE_A) || (DriveMap.chDrive > chDRIVE_Z))
+ continue;
if (mapping[0] != TEXT('\0'))
{
{
HKEY hkMappings;
RegCreateKeyEx( HKEY_CURRENT_USER,
- "SOFTWARE\\OpenAFS\\Client\\Mappings",
+ cszSECTION_MAPPINGS,
0,
"AFS",
REG_OPTION_NON_VOLATILE,
if (!pList->aDriveMap[iDrive].fPersistent)
lstrcat (szRHS, TEXT("*"));
- RegSetValueEx( hkMappings, szLHS, 0, REG_SZ, (const BYTE *)szRHS, lstrlen(szRHS) + 1);
+ RegSetValueEx( hkMappings, szLHS, 0, REG_EXPAND_SZ, (const BYTE *)szRHS, lstrlen(szRHS) + 1);
}
}
RegCloseKey( hkMappings );
*
*/
+#define AFSCLIENT_ADMIN_GROUPNAME "AFS Client Admins"
+
BOOL IsAdmin (void)
{
- static BOOL fAdmin = FALSE;
- static BOOL fTested = FALSE;
- if (!fTested)
- {
- fTested = TRUE;
-
- // Obtain the SID for BUILTIN\Administrators. If this is Windows NT,
- // expect this call to succeed; if it does not, we can presume that
- // it's not NT and therefore the user always has administrative
- // privileges.
- //
- PSID psidAdmin = NULL;
- SID_IDENTIFIER_AUTHORITY auth = SECURITY_NT_AUTHORITY;
- if (!AllocateAndInitializeSid (&auth, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &psidAdmin))
- fAdmin = TRUE;
- else
- {
-
- // Then open our current ProcessToken
- //
- HANDLE hToken;
- if (OpenProcessToken (GetCurrentProcess(), TOKEN_QUERY, &hToken))
+ static BOOL fAdmin = FALSE;
+ static BOOL fTested = FALSE;
+
+ if (!fTested)
+ {
+ /* Obtain the SID for the AFS client admin group. If the group does
+ * not exist, then assume we have AFS client admin privileges.
+ */
+ PSID psidAdmin = NULL;
+ DWORD dwSize, dwSize2;
+ char pszAdminGroup[ MAX_COMPUTERNAME_LENGTH + sizeof(AFSCLIENT_ADMIN_GROUPNAME) + 2 ];
+ char *pszRefDomain = NULL;
+ SID_NAME_USE snu = SidTypeGroup;
+
+ dwSize = sizeof(pszAdminGroup);
+
+ if (!GetComputerName(pszAdminGroup, &dwSize)) {
+ /* Can't get computer name. We return false in this case.
+ Retain fAdmin and fTested. This shouldn't happen.*/
+ return FALSE;
+ }
+
+ fTested = TRUE;
+
+ dwSize = 0;
+ dwSize2 = 0;
+
+ strcat(pszAdminGroup,"\\");
+ strcat(pszAdminGroup, AFSCLIENT_ADMIN_GROUPNAME);
+
+ LookupAccountName(NULL, pszAdminGroup, NULL, &dwSize, NULL, &dwSize2, &snu);
+ /* that should always fail. */
+
+ if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
+ /* if we can't find the group, then we allow the operation */
+ fAdmin = TRUE;
+ return TRUE;
+ }
+
+ if (dwSize == 0 || dwSize2 == 0) {
+ /* Paranoia */
+ fAdmin = TRUE;
+ return TRUE;
+ }
+
+ psidAdmin = (PSID) malloc(dwSize); memset(psidAdmin,0,dwSize);
+ pszRefDomain = (char *)malloc(dwSize2);
+
+ if (!LookupAccountName(NULL, pszAdminGroup, psidAdmin, &dwSize, pszRefDomain, &dwSize2, &snu)) {
+ /* We can't lookup the group now even though we looked it up earlier.
+ Could this happen? */
+ fAdmin = TRUE;
+ } else {
+ /* Then open our current ProcessToken */
+ HANDLE hToken;
+
+ if (OpenProcessToken (GetCurrentProcess(), TOKEN_QUERY, &hToken))
{
-
- // We'll have to allocate a chunk of memory to store the list of
- // groups to which this user belongs; find out how much memory
- // we'll need.
- //
- DWORD dwSize = 0;
- GetTokenInformation (hToken, TokenGroups, NULL, dwSize, &dwSize);
+ /* We'll have to allocate a chunk of memory to store the list of
+ * groups to which this user belongs; find out how much memory
+ * we'll need.
+ */
+ DWORD dwSize = 0;
+ PTOKEN_GROUPS pGroups;
+
+ GetTokenInformation (hToken, TokenGroups, NULL, dwSize, &dwSize);
- // Allocate that buffer, and read in the list of groups.
- //
- PTOKEN_GROUPS pGroups = (PTOKEN_GROUPS)Allocate (dwSize);
- if (GetTokenInformation (hToken, TokenGroups, pGroups, dwSize, &dwSize))
- {
- // Look through the list of group SIDs and see if any of them
- // matches the Administrator group SID.
- //
- for (size_t iGroup = 0; (!fAdmin) && (iGroup < pGroups->GroupCount); ++iGroup)
- {
- if (EqualSid (psidAdmin, pGroups->Groups[ iGroup ].Sid))
- fAdmin = TRUE;
- }
- }
-
- if (pGroups)
- Free (pGroups);
+ pGroups = (PTOKEN_GROUPS)malloc(dwSize);
+
+ /* Allocate that buffer, and read in the list of groups. */
+ if (GetTokenInformation (hToken, TokenGroups, pGroups, dwSize, &dwSize))
+ {
+ /* Look through the list of group SIDs and see if any of them
+ * matches the AFS Client Admin group SID.
+ */
+ size_t iGroup = 0;
+ for (; (!fAdmin) && (iGroup < pGroups->GroupCount); ++iGroup)
+ {
+ if (EqualSid (psidAdmin, pGroups->Groups[ iGroup ].Sid)) {
+ fAdmin = TRUE;
+ }
+ }
+ }
+
+ if (pGroups)
+ free(pGroups);
}
- }
+ }
- if (psidAdmin)
- FreeSid (psidAdmin);
- }
+ free(psidAdmin);
+ free(pszRefDomain);
+ }
- return fAdmin;
+ return fAdmin;
}
strcpy(aserver.cell, rootcell);
rc = ktc_GetToken(&aserver, &atoken, sizeof(atoken), &aclient);
+ if ( rc == 0 ) {
+ GetLocalTime (&stNow);
+ SystemTimeToFileTime (&stNow, &ftNow);
+ llNow = (((LONGLONG)ftNow.dwHighDateTime) << 32) + (LONGLONG)(ftNow.dwLowDateTime);
+ llNow /= c100ns1SECOND;
- GetLocalTime (&stNow);
- SystemTimeToFileTime (&stNow, &ftNow);
- llNow = (((LONGLONG)ftNow.dwHighDateTime) << 32) + (LONGLONG)(ftNow.dwLowDateTime);
- llNow /= c100ns1SECOND;
-
- TimeToSystemTime (&stExpires, atoken.endTime);
- SystemTimeToFileTime (&stExpires, &ftExpires);
- llExpires = (((LONGLONG)ftExpires.dwHighDateTime) << 32) + (LONGLONG)(ftExpires.dwLowDateTime);
- llExpires /= c100ns1SECOND;
+ TimeToSystemTime (&stExpires, atoken.endTime);
+ SystemTimeToFileTime (&stExpires, &ftExpires);
+ llExpires = (((LONGLONG)ftExpires.dwHighDateTime) << 32) + (LONGLONG)(ftExpires.dwLowDateTime);
+ llExpires /= c100ns1SECOND;
- if (!rc && (llNow < llExpires))
- goto cleanup;
+ if (llNow < llExpires)
+ goto cleanup;
- if ( IsDebuggerPresent() ) {
- char message[256];
- sprintf(message,"ObtainTokensFromUserIfNeeded: %d now = %ul endTime = %ul\n",
- rc, llNow, llExpires);
- OutputDebugString(message);
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"ObtainTokensFromUserIfNeeded: %d now = %ul endTime = %ul\n",
+ rc, llNow, llExpires);
+ OutputDebugString(message);
+ }
}
#ifdef USE_FSPROBE
{
int cellNum;
int rc;
- int current_time;
+ time_t current_time;
time_t tokenExpireTime;
char *expireString;
char userName[100];
if (b == 0) { return result; }
if (b == 1) { *remainder = 0; return a; }
- a1=(a.HighPart << 32) | a.LowPart;
+ a1 = a.HighPart;
+ a1 <<= 32;
+ a1 |= a.LowPart;
q1=a1/b;
r1=a1-(q1*b);
if (r1 > ULONG_MAX) /*XXX */;
return a;
}
- a1=(a.HighPart << 32) | a.LowPart;
- b1=(b.HighPart << 32) | a.LowPart;
+ a1 = a.HighPart;
+ a1 <<= 32;
+ a1 |= a.LowPart;
+ b1 = b.HighPart;
+ b1 <<= 32;
+ b1 |= b.LowPart;
q1=a1/b1;
r1=a1-(q1*b1);
result.HighPart=q1 >> 32;
--- /dev/null
+#include<windows.h>
+#include<string.h>
+#include<stdio.h>
+#include<lm.h>
+
+#pragma comment(lib,"netapi32.lib")
+
+#define AFSCLIENT_ADMIN_GROUPNAMEW L"AFS Client Admins"
+#define AFSCLIENT_ADMIN_COMMENTW L"AFS Client Administrators"
+
+UINT createAfsAdminGroup(void) {
+ LOCALGROUP_INFO_1 gInfo;
+ DWORD dwError;
+ NET_API_STATUS status;
+
+ gInfo.lgrpi1_name = AFSCLIENT_ADMIN_GROUPNAMEW;
+ gInfo.lgrpi1_comment = AFSCLIENT_ADMIN_COMMENTW;
+ status = NetLocalGroupAdd(NULL, 1, (LPBYTE) &gInfo, &dwError);
+
+ return status;
+}
+
+UINT initializeAfsAdminGroup(void) {
+ PSID psidAdmin = NULL;
+ SID_IDENTIFIER_AUTHORITY auth = SECURITY_NT_AUTHORITY;
+ NET_API_STATUS status;
+ LOCALGROUP_MEMBERS_INFO_0 *gmAdmins = NULL;
+ DWORD dwNEntries, dwTEntries;
+
+ status = NetLocalGroupGetMembers(NULL, L"Administrators", 0, (LPBYTE *) &gmAdmins, MAX_PREFERRED_LENGTH, &dwNEntries, &dwTEntries, NULL);
+ if(status)
+ return status;
+
+ status = NetLocalGroupAddMembers(NULL, AFSCLIENT_ADMIN_GROUPNAMEW, 0, (LPBYTE) gmAdmins, dwNEntries);
+
+ NetApiBufferFree( gmAdmins );
+
+ return status;
+}
+
+UINT removeAfsAdminGroup(void) {
+ NET_API_STATUS status;
+ status = NetLocalGroupDel(NULL, AFSCLIENT_ADMIN_GROUPNAMEW);
+ return status;
+}
+
+void showUsage(char * progname) {
+ printf(
+ "Usage: %s [-create | -remove]\n"
+ " -create : Create AFS Client Admins group and populate it with\n"
+ " the members of the Administrators group\n"
+ " -remove : Remove the AFS Client Admins group\n"
+ , progname);
+}
+
+int main(int argc, char ** argv) {
+
+ UINT rv = 0;
+
+ if(argc < 2) {
+ showUsage(argv[0]);
+ return 1;
+ }
+
+ if(stricmp(argv[1], "-create")) {
+ rv = createAfsAdminGroup();
+ if(rv) {
+ if(rv != ERROR_ALIAS_EXISTS) {
+ fprintf(stderr, "%s: Can't create AFS Client Admin group. NetApi error %u\n", rv);
+ } else {
+ /* The group already exists. (Preserved config from a
+ prior install). */
+ rv = 0;
+ }
+ } else {
+ rv = initializeAfsAdminGroup();
+ if(rv)
+ fprintf(stderr, "%s: Can't populate AFS Client Admin group. NetApi error %u\n", rv);
+ }
+ } else if(stricmp(argv[1], "-remove")) {
+ removeAfsAdminGroup();
+ rv = 0;
+ } else {
+ showUsage(argv[0]);
+ rv = 0;
+ }
+
+ return rv;
+}
\ No newline at end of file
->grand.central.org #GCO Public CellServDB 29 Jun 2004
+>grand.central.org #GCO Public CellServDB 17 Aug 2004
18.7.14.88 #grand-opening.mit.edu
128.2.191.224 #penn.central.org
>wu-wien.ac.at #University of Economics, Vienna, Austria
>physik.uni-wuppertal.de #Physics department of Bergische Universität Wuppertal
132.195.104.3 #afs1.physik.uni-wuppertal.de
132.195.104.230 #afs2.physik.uni-wuppertal.de
+>s-et.aau.dk #Aalborg Univ., The Student Society, Denmark
+130.225.196.22 #afs.s-et.aau.dk
>ies.auc.dk #Aalborg Univ., Inst. of Electronic Systems, Denmark
130.225.51.73 #afsdb1.kom.auc.dk
130.225.51.74 #afsdb2.kom.auc.dk
>qatar.cmu.edu #Carnegie Mellon University - Qatar Campus Cell
204.194.25.7 #afs1.qatar.cmu.edu
204.194.25.8 #afs2.qatar.cmu.edu
+>sbp.ri.cmu.edu #Carnegie Mellon University - Sensor Based Planning Lab
+128.2.105.174 #voronoi.sbp.ri.cmu.edu
+128.2.105.175 #nihao.sbp.ri.cmu.edu
>msc.cornell.edu #Cornell University Materials Science Center
128.84.231.242 #miranda.ccmr.cornell.edu
128.84.241.35 #co.ccmr.cornell.edu
130.85.24.101 #db1.afs.umbc.edu
>glue.umd.edu #University of Maryland - Project Glue
128.8.70.11 #olmec.umd.edu
-128.8.73.3 #babylon.umd.edu
-129.2.128.53 #egypt.umd.edu
+128.8.236.4 #egypt.umd.edu
+128.8.236.230 #babylon.umd.edu
>wam.umd.edu #University of Maryland Network WAM Project
128.8.70.9 #csc-srv.wam.umd.edu
-128.8.73.9 #pg2-srv.wam.umd.edu
-129.2.128.54 #avw-srv.wam.umd.edu
+128.8.236.5 #avw-srv.wam.umd.edu
+128.8.236.231 #ptx-srv.wam.umd.edu
>umich.edu #University of Michigan - Campus
141.211.1.32 #fear.ifs.umich.edu
141.211.1.33 #surprise.ifs.umich.edu
$(EXEDIR)\Killer.exe: $(OUT)\Killer.obj
$(EXECONLINK) $(OUT)\Killer.obj
+$(OUT)\AdminGroup.obj: AdminGroup.cpp
+ $(C2OBJ) AdminGroup.cpp
+
+$(EXEDIR)\AdminGroup.exe: $(OUT)\AdminGroup.obj
+ $(EXECONLINK) $(OUT)\AdminGroup.obj
+
prebuild:
!IF ("$(AFSDEV_BUILDTYPE)" == "FREE")
!IF ("$(AFSVER_CL)"=="1310")
build: prebuild
"C:\Program Files\NSIS\makensis.exe" /DINCLUDEDIR=$(OUT) OpenAFS.nsi
-install: $(OUT)\Service.obj $(EXEDIR)\Service.exe $(OUT)\Killer.obj $(EXEDIR)\Killer.exe build
+install: $(OUT)\Service.obj $(EXEDIR)\Service.exe $(OUT)\Killer.obj $(EXEDIR)\Killer.exe $(EXEDIR)\AdminGroup.exe build
#clean:
# $(DEL) $(OUT)\Service.obj
; Get AFS CellServDB file
Call afs.GetCellServDB
+ GetTempFileName $R0
+ File /oname=$R0 "${AFS_WININSTALL_DIR}\AdminGroup.exe"
+ nsExec::Exec '$R0 -create'
+
!ifdef INSTALL_KFW
; Include Kerberos for Windows files in the installer...
SetOutPath "$INSTDIR\kfw\bin\"
ReadINIStr $R1 $2 "Field 13" "State"
StrCmp $R1 "1" +1 +2
StrCpy $R2 "$R2-S"
-
+
WriteRegStr HKLM "SOFTWARE\OpenAFS\Client" "AfscredsShortcutParams" "$R2"
CreateShortCut "$SMPROGRAMS\OpenAFS\Client\Authentication.lnk" "$INSTDIR\Client\Program\afscreds.exe" "$R2"
!ENDIF
Delete "$INSTDIR\Client\afsdns.ini"
+ GetTempFileName $R0
+ File /oname=$R0 "${AFS_WININSTALL_DIR}\AdminGroup.exe"
+ nsExec::Exec '$R0 -remove'
+
SkipDel:
Delete "$WINDIR\afsd_init.log"
Delete "$INSTDIR\Uninstall.exe"
->grand.central.org #GCO Public CellServDB 11 May 2004
+>grand.central.org #GCO Public CellServDB 17 Aug 2004
18.7.14.88 #grand-opening.mit.edu
128.2.191.224 #penn.central.org
>wu-wien.ac.at #University of Economics, Vienna, Austria
134.109.200.7 #aetius.hrz.tu-chemnitz.de
>e18.ph.tum.de #Experimental Physics, TU Munich, Germany
129.187.154.223 #hamlet.e18.physik.tu-muenchen.de
->uni-bonn.de #Cell name
+>uni-bonn.de #University of Bonn, Computing Center
131.220.14.198 #work15-eth.rhrz.uni-bonn.de
-131.220.14.203 #node03-en2.rhrz.uni-bonn.de
131.220.14.205 #node05.rhrz.uni-bonn.de
+131.220.15.197 #afs-db1.rhrz.uni-bonn.de
+>atlass01.physik.uni-bonn.de #Bonn ATLAS
+131.220.165.43 #atlass01.physik.uni-bonn.de
>uni-freiburg.de #Albert-Ludwigs-Universitat Freiburg
132.230.6.235 #sv6.ruf.uni-freiburg.de
132.230.6.236 #sv7.ruf.uni-freiburg.de
>physik.uni-mainz.de #institute of physics, university Mainz, Germany
134.93.130.93 #hardy.physik.uni-mainz.de
>uni-mannheim.de #Uni Mannheim (Rechenzentrum)
-134.155.50.165 #afsdbx.uni-mannheim.de
-134.155.50.166 #afsdby.uni-mannheim.de
-134.155.50.167 #afsdbz.uni-mannheim.de
+134.155.97.204 #afsdb1.uni-mannheim.de
+134.155.97.205 #afsdb2.uni-mannheim.de
+134.155.97.206 #afsdb3.uni-mannheim.de
>physik.uni-wuppertal.de #Physics department of Bergische Universität Wuppertal
132.195.104.3 #afs1.physik.uni-wuppertal.de
132.195.104.230 #afs2.physik.uni-wuppertal.de
+>s-et.aau.dk #Aalborg Univ., The Student Society, Denmark
+130.225.196.22 #afs.s-et.aau.dk
>ies.auc.dk #Aalborg Univ., Inst. of Electronic Systems, Denmark
130.225.51.73 #afsdb1.kom.auc.dk
130.225.51.74 #afsdb2.kom.auc.dk
130.225.51.85 #afsdb3.kom.auc.dk
+>asu.edu #Arizona State University
+129.219.10.69 #authen2.asu.edu
+129.219.10.70 #authen1.asu.edu
+129.219.10.72 #authen3.asu.edu
+129.219.100.16 #authen4.asu.edu
>hep.caltech.edu #CalTech High Energy Physics
131.215.126.150 #afs.hep.caltech.edu
>andrew.cmu.edu #Carnegie Mellon University - Computing Services Cell
128.2.129.9 #e-xing.ece.cmu.edu
>scotch.ece.cmu.edu #CMU ECE CALCM research group
128.2.134.82 #lagavulin.ece.cmu.edu
+>qatar.cmu.edu #Carnegie Mellon University - Qatar Campus Cell
+204.194.25.7 #afs1.qatar.cmu.edu
+204.194.25.8 #afs2.qatar.cmu.edu
+>sbp.ri.cmu.edu #Carnegie Mellon University - Sensor Based Planning Lab
+128.2.105.174 #voronoi.sbp.ri.cmu.edu
+128.2.105.175 #nihao.sbp.ri.cmu.edu
>msc.cornell.edu #Cornell University Materials Science Center
128.84.231.242 #miranda.ccmr.cornell.edu
128.84.241.35 #co.ccmr.cornell.edu
>ncsa.uiuc.edu #University of Illinois
141.142.3.5 #congo.ncsa.uiuc.edu
141.142.3.8 #nile.ncsa.uiuc.edu
-141.142.230.19 #jinx.ncsa.uiuc.edu
+141.142.3.9 #kaskaskia.ncsa.uiuc.edu
>umbc.edu #University of Maryland, Baltimore County
130.85.24.23 #db2.afs.umbc.edu
130.85.24.87 #db3.afs.umbc.edu
130.85.24.101 #db1.afs.umbc.edu
>glue.umd.edu #University of Maryland - Project Glue
128.8.70.11 #olmec.umd.edu
-128.8.73.3 #babylon.umd.edu
-129.2.128.53 #egypt.umd.edu
+128.8.236.4 #egypt.umd.edu
+128.8.236.230 #babylon.umd.edu
>wam.umd.edu #University of Maryland Network WAM Project
128.8.70.9 #csc-srv.wam.umd.edu
-128.8.73.9 #pg2-srv.wam.umd.edu
-129.2.128.54 #avw-srv.wam.umd.edu
+128.8.236.5 #avw-srv.wam.umd.edu
+128.8.236.231 #ptx-srv.wam.umd.edu
>umich.edu #University of Michigan - Campus
141.211.1.32 #fear.ifs.umich.edu
141.211.1.33 #surprise.ifs.umich.edu
141.211.133.5 #babylon.citi.umich.edu
>lsa.umich.edu #University of Michigan - College of LS&A
141.211.54.132 #curtis.admin.lsa.umich.edu
-141.211.61.23 #zee.admin.lsa.umich.edu
-141.211.68.15 #marshall.lsa.umich.edu
+141.211.211.53 #gerow.lsa.umich.edu
+141.211.211.72 #collines.lsa.umich.edu
+141.211.211.153 #hodges.lsa.umich.edu
>math.lsa.umich.edu #University of Michigan - Math Department
141.211.61.40 #ike.math.lsa.umich.edu
141.211.61.41 #clark.math.lsa.umich.edu
>dementia.org #Dementia Unlimited
128.2.12.45 #alycia.dementia.org
128.2.120.216 #meredith.dementia.org
+>hackish.org #Hackish.org
+24.167.65.213 #avatar.sys.hackish.org
+128.2.120.138 #kurma.sys.hackish.org
>idahofuturetruck.org #University of Idaho hybrid vehicle development
12.18.238.210 #dsle210.fsr.net
>nimlabs.org #Nimlabs, Ink. Cell.
18.238.1.105 #caerbanog.nimlabs.org
>nomh.org #nomh.org
204.29.154.12 #iota.nomh.org
+204.29.154.32 #adversity.xi.nomh.org
>oc7.org #The OC7 Project
128.2.6.107 #vice3.oc7.org
128.2.122.140 #vice2.oc7.org
130.237.57.72 #morpheus.md.kth.se
130.237.67.230 #neo.speech.kth.se
>mech.kth.se #Royal Institute of Technology, MECH
-130.237.233.142 #matterhorn.mech.kth.se
130.237.233.143 #castor.mech.kth.se
130.237.233.144 #pollux.mech.kth.se
>nada.kth.se #Royal Institute of Technology, NADA
>su.se #Stockholm University
130.237.162.81 #afsdb1.su.se
130.237.162.82 #afsdb2.su.se
+130.237.162.230 #afsdb3.su.se
>f9.ijs.si #F9, Jozef Stefan Institue
194.249.156.1 #brenta.ijs.si
>p-ng.si #Nova Gorica Polytechnic
->grand.central.org #GCO Public CellServDB 29 Jun 2004
+>grand.central.org #GCO Public CellServDB 17 Aug 2004
18.7.14.88 #grand-opening.mit.edu
128.2.191.224 #penn.central.org
>wu-wien.ac.at #University of Economics, Vienna, Austria
>physik.uni-wuppertal.de #Physics department of Bergische Universität Wuppertal
132.195.104.3 #afs1.physik.uni-wuppertal.de
132.195.104.230 #afs2.physik.uni-wuppertal.de
+>s-et.aau.dk #Aalborg Univ., The Student Society, Denmark
+130.225.196.22 #afs.s-et.aau.dk
>ies.auc.dk #Aalborg Univ., Inst. of Electronic Systems, Denmark
130.225.51.73 #afsdb1.kom.auc.dk
130.225.51.74 #afsdb2.kom.auc.dk
>qatar.cmu.edu #Carnegie Mellon University - Qatar Campus Cell
204.194.25.7 #afs1.qatar.cmu.edu
204.194.25.8 #afs2.qatar.cmu.edu
+>sbp.ri.cmu.edu #Carnegie Mellon University - Sensor Based Planning Lab
+128.2.105.174 #voronoi.sbp.ri.cmu.edu
+128.2.105.175 #nihao.sbp.ri.cmu.edu
>msc.cornell.edu #Cornell University Materials Science Center
128.84.231.242 #miranda.ccmr.cornell.edu
128.84.241.35 #co.ccmr.cornell.edu
130.85.24.101 #db1.afs.umbc.edu
>glue.umd.edu #University of Maryland - Project Glue
128.8.70.11 #olmec.umd.edu
-128.8.73.3 #babylon.umd.edu
-129.2.128.53 #egypt.umd.edu
+128.8.236.4 #egypt.umd.edu
+128.8.236.230 #babylon.umd.edu
>wam.umd.edu #University of Maryland Network WAM Project
128.8.70.9 #csc-srv.wam.umd.edu
-128.8.73.9 #pg2-srv.wam.umd.edu
-129.2.128.54 #avw-srv.wam.umd.edu
+128.8.236.5 #avw-srv.wam.umd.edu
+128.8.236.231 #ptx-srv.wam.umd.edu
>umich.edu #University of Michigan - Campus
141.211.1.32 #fear.ifs.umich.edu
141.211.1.33 #surprise.ifs.umich.edu
registry.wxi \
lang\$(LANG)\ui.wxi
-WIXOBJ = $(OJT)\openafs-$(LANG).wixobj
+WIXOBJ = $(OUT)\openafs-$(LANG).wixobj
LANGUAGES=en_US de_DE es_ES ja_JP ko_KR pt_BR zh_CN zh_TW
-dVersionMajor=$(AFSPRODUCT_VER_MAJOR) \
-dVersionMinor=$(AFSPRODUCT_VER_MINOR) \
-dVersionPatch=$(AFSPRODUCT_VER_PATCH) \
+ -dProductCode=$(AFSPRODUCT_VER_GUID) \
"-dDestDir=$(DESTDIR)\\" \
-dCellDbFile=CellServDB \
-v0 \
-# rcsid : $Id: NTMakefile,v 1.2 2004/06/23 07:48:23 jaltman Exp $
+# rcsid : $Id: NTMakefile,v 1.2.2.1 2004/08/23 15:55:09 jaltman Exp $
RELDIR=WINNT\install\wix\custom
!INCLUDE ..\..\..\..\config\NTMakefile.$(SYS_NAME)
-EXPORT:ConfigureClientService \
-EXPORT:ConfigureServerService \
-EXPORT:AbortMsiImmediate \
- -EXPORT:UninstallNsisInstallation
+ -EXPORT:UninstallNsisInstallation \
+ -EXPORT:CreateAFSClientAdminGroup \
+ -EXPORT:RemoveAFSClientAdminGroup
DLLLIBFILES=\
- msi.lib advapi32.lib
+ msi.lib advapi32.lib netapi32.lib
LINK=link
* are noted in the comments section of each of the
* functions.
*
-* rcsid: $Id: afscustom.cpp,v 1.2 2004/06/23 03:55:13 jaltman Exp $
+* rcsid: $Id: afscustom.cpp,v 1.2.2.1 2004/08/23 15:55:09 jaltman Exp $
**************************************************************/
// Only works for Win2k and above
}
return rv;
}
+
+/* Create or remove the 'AFS Client Admins' group. Initially
+ it will hold members of the Administrator group. */
+
+MSIDLLEXPORT CreateAFSClientAdminGroup( MSIHANDLE hInstall ) {
+ UINT rv;
+ rv = createAfsAdminGroup();
+ if(rv) {
+ if(rv == ERROR_ALIAS_EXISTS) {
+ /* The group already exists, probably from a previous
+ installation. We let things be. */
+ return ERROR_SUCCESS;
+ }
+
+ ShowMsiError( hInstall, ERR_GROUP_CREATE_FAILED, rv );
+ return rv;
+ }
+
+ rv = initializeAfsAdminGroup();
+ if(rv)
+ ShowMsiError( hInstall, ERR_GROUP_MEMBER_FAILED, rv );
+ return rv;
+}
+
+MSIDLLEXPORT RemoveAFSClientAdminGroup( MSIHANDLE hInstall ) {
+ removeAfsAdminGroup();
+ return ERROR_SUCCESS;
+}
+
+#define AFSCLIENT_ADMIN_GROUPNAMEW L"AFS Client Admins"
+#define AFSCLIENT_ADMIN_COMMENTW L"AFS Client Administrators"
+
+UINT createAfsAdminGroup(void) {
+ LOCALGROUP_INFO_1 gInfo;
+ DWORD dwError;
+ NET_API_STATUS status;
+
+ gInfo.lgrpi1_name = AFSCLIENT_ADMIN_GROUPNAMEW;
+ gInfo.lgrpi1_comment = AFSCLIENT_ADMIN_COMMENTW;
+ status = NetLocalGroupAdd(NULL, 1, (LPBYTE) &gInfo, &dwError);
+
+ return status;
+}
+
+UINT initializeAfsAdminGroup(void) {
+ PSID psidAdmin = NULL;
+ SID_IDENTIFIER_AUTHORITY auth = SECURITY_NT_AUTHORITY;
+ NET_API_STATUS status;
+ LOCALGROUP_MEMBERS_INFO_0 *gmAdmins = NULL;
+ DWORD dwNEntries, dwTEntries;
+
+ status = NetLocalGroupGetMembers(NULL, L"Administrators", 0, (LPBYTE *) &gmAdmins, MAX_PREFERRED_LENGTH, &dwNEntries, &dwTEntries, NULL);
+ if(status)
+ return status;
+
+ status = NetLocalGroupAddMembers(NULL, AFSCLIENT_ADMIN_GROUPNAMEW, 0, (LPBYTE) gmAdmins, dwNEntries);
+
+ NetApiBufferFree( gmAdmins );
+
+ return status;
+}
+
+UINT removeAfsAdminGroup(void) {
+ NET_API_STATUS status;
+ status = NetLocalGroupDel(NULL, AFSCLIENT_ADMIN_GROUPNAMEW);
+ return status;
+}
+
*
* Declarations for OpenAFS MSI setup tools
*
- * rcsid : $Id: afscustom.h,v 1.2 2004/06/23 03:55:13 jaltman Exp $
+ * rcsid : $Id: afscustom.h,v 1.2.2.1 2004/08/23 15:55:09 jaltman Exp $
*/
#ifndef __afsMsiTools_H__
#include<msiquery.h>
#include<stdio.h>
#include<string.h>
+#include<lm.h>
#define MSIDLLEXPORT UINT __stdcall
#define ERR_SCS_FAILED 4003
#define ERR_ABORT 4004
#define ERR_NSS_FAILED 4005
+#define ERR_GROUP_CREATE_FAILED 4006
+#define ERR_GROUP_MEMBER_FAILED 4007
/* non-exported */
int npi_CheckAndAddRemove( LPTSTR, LPTSTR, int );
DWORD InstNetProvider(MSIHANDLE, int);
void ShowMsiError(MSIHANDLE, DWORD, DWORD);
DWORD ConfigService(int);
+UINT createAfsAdminGroup(void);
+UINT initializeAfsAdminGroup(void);
+UINT removeAfsAdminGroup(void);
/* exported */
MSIDLLEXPORT InstallNetProvider( MSIHANDLE );
MSIDLLEXPORT ConfigureServerService( MSIHANDLE );
MSIDLLEXPORT AbortMsiImmediate( MSIHANDLE );
MSIDLLEXPORT UninstallNsisInstallation( MSIHANDLE hInstall );
+MSIDLLEXPORT CreateAFSClientAdminGroup( MSIHANDLE hInstall );
+MSIDLLEXPORT RemoveAFSClientAdminGroup( MSIHANDLE hInstall );
#endif /*__afsMsiTools_H__*/
<ComponentRef Id="cmf_rxdebug_EXE" />
<ComponentRef Id="cmf_backup_EXE" />
<ComponentRef Id="cmf_aklog_EXE" />
-
+
<!-- Runtime -->
<?include runtime.wxi?>
</Feature>
<?xml version="1.0"?>
<Include>
- <Directory Id="SystemFolder">
+ <Directory Id="SystemFolder" SourceName="System" LongSource="System">
<Component Id="cmf_afslogon_DLL" Guid="123197FE-4F53-4035-8D51-FCFB6B50A777">
<File Id="fileafslogon_DLL" Name="afslogon.dll" LongName="afslogon.dll" KeyPath="yes" DiskId="1" src="$(var.ClientDir)afslogon.dll" />
<Registry Id="reg_afslogon01" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" Action="createKeyAndRemoveKeyOnUninstall" />
</Component>
<?endif?>
</Directory>
- <Directory Id="ProgramFilesFolder" Name=".">
+ <Directory Id="ProgramFilesFolder">
<Directory Id="AFSDIR" Name="OpenAFS" SourceName=".">
- <Directory Id="dirCommon" Name="Common" LongName="Common" SourceName=".">
+ <Directory Id="dirCommon" Name="Common" LongName="Common" SourceName="Common">
<Component Id="cmp_CommonDir" Guid="C86B03A1-AE97-48B1-A77B-1B2395F1E117" KeyPath="yes">
<Environment Id="envCommon" Name="PATH" Action="create" System="yes" Permanent="no" Part="last" Separator=";" Value="[AFSDIR]Common" />
<CreateFolder />
<File Id="fileafs_shl_ext_1033_DLL" Name="ashl1033.dll" LongName="afs_shl_ext_1033.dll" KeyPath="yes" DiskId="1" src="$(var.ClientDir)\afs_shl_ext_1033.dll"/>
</Component>
- <Directory Id="dirCommon_en_US" Name="en_US" LongName="en_US" SourceName="." src="$(var.SrcDir)\WINNT\doc\help\en_US\">
+ <Directory Id="dirCommon_en_US" Name="en_US" LongName="en_US" SourceName="en_US" src="$(var.SrcDir)\WINNT\doc\help\en_US\">
<Component Id="cmf_afs_nt_HLP_en_US" Guid="A59FF1E3-984F-47E0-8A65-590A01B6E1C4">
<File Id="fileafs_nt_HLP_en_US" Name="afs-nt.hlp" LongName="afs-nt.hlp" KeyPath="yes" DiskId="1">
<Shortcut Id="scClientHelp_en_US" Directory="dirShortCut" Name="CliHelp.lnk" LongName="Client Help.lnk" Description="$(loc.StrHlpFileDesc)" Icon="ico_Help" IconIndex="0" Show="normal" WorkingDirectory="dirCommon" />
<?endif?>
</Directory> <!-- /common -->
- <Directory Id="dirControl_Center" Name="Contr" LongName="Control Center" SourceName=".">
+ <Directory Id="dirControl_Center" Name="Contr" LongName="Control Center" SourceName="ControlC" LongSource="Control Center">
<Component Id="cmf_TaAfsServerManager_EXE" Guid="B890FB93-2EFD-44B6-8CB3-7A6AFABFF029">
<File Id="fileTaAfsServerManager_EXE" Name="TaAfsSvM.exe" LongName="TaAfsServerManager.exe" KeyPath="yes" DiskId="1" src="$(var.ServerDir)\TaAfsServerManager.exe">
<Shortcut Id="scServerManager" Directory="dirShortCut" Name="SvrMgr.lnk" LongName="Server Manager.lnk" Description="$(loc.StrSvrMgrDesc)" Icon="ico_ServerManager" IconIndex="0" Show="normal" WorkingDirectory="dirCommon" />
</Component>
<?endif?>
- <Directory Id="dirDocumentation" Name="Docum" LongName="Documentation" SourceName=".">
+ <Directory Id="dirDocumentation" Name="Docum" LongName="Documentation" SourceName="Docs">
<!-- The following directory and everything below it is language dependent. -->
- <Directory Id="dirDoc_$(var.Language)" Name="$(var.Language)" LongName="$(var.Language)" SourceName=".">
- <Directory Id="dirHtml_$(var.Language)" Name="Html" LongName="Html" SourceName="." src="$(var.SrcDir)\WINNT\doc\install\Documentation\$(var.Language)\html\">
+ <Directory Id="dirDoc_$(var.Language)" Name="$(var.Language)" LongName="$(var.Language)" SourceName="$(var.Language)">
+ <Directory Id="dirHtml_$(var.Language)" Name="Html" LongName="Html" SourceName="html" src="$(var.SrcDir)\WINNT\doc\install\Documentation\$(var.Language)\html\">
<Component Id="cmf_index2_HTM_$(var.Language)" Guid="$(var.DocHtmlIndexGuid)">
<File Id="fileindex2_HTM_$(var.Language)" Name="index.htm" LongName="index.htm" KeyPath="yes" DiskId="1">
<Shortcut Id="scDoc_$(var.Language)" Directory="dirShortCut" Name="Doc$(var.Language).lnk" LongName="Documentation ($(var.Language)).lnk" Description="$(loc.StrDocLnkDesc)" Icon="ico_Help" IconIndex="0" Show="normal" WorkingDirectory="dirCommon" />
<File Id="filetop_GIF_$(var.Language)" Name="top.gif" LongName="top.gif" DiskId="1" />
<File Id="file$(var.Language)_RTF" Name="$(var.Language).rtf" LongName="$(var.Language).rtf" KeyPath="yes" DiskId="1" src="$(var.SrcDir)\WINNT\license\lang\$(var.Language).rtf"/>
</Component>
- <Directory Id="dirCmdRef_$(var.Language)" Name="CmdRef" LongName="CmdRef" SourceName="." src="$(var.SrcDir)\WINNT\doc\install\Documentation\$(var.Language)\html\CmdRef\">
+ <Directory Id="dirCmdRef_$(var.Language)" Name="CmdRef" LongName="CmdRef" SourceName="CmdRef" src="$(var.SrcDir)\WINNT\doc\install\Documentation\$(var.Language)\html\CmdRef\">
<Component Id="cmp_Cmd_Ref_$(var.Language)" Guid="$(var.DocHtmlCmdRefGuid)">
<File Id="fileauarf000_HTM_$(var.Language)" Name="auarf000.htm" LongName="auarf000.htm" KeyPath="yes" DiskId="1" />
<File Id="fileauarf002_HTM_$(var.Language)" Name="auarf002.htm" LongName="auarf002.htm" DiskId="1" />
<File Id="fileauarf284_HTM_$(var.Language)" Name="auarf284.htm" LongName="auarf284.htm" DiskId="1" />
</Component>
</Directory> <!-- CmdRef -->
- <Directory Id="dirInstallGd_$(var.Language)" Name="InstalGd" LongName="InstallGd" SourceName="." src="$(var.SrcDir)\WINNT\doc\install\Documentation\$(var.Language)\html\InstallGd\">
+ <Directory Id="dirInstallGd_$(var.Language)" Name="InstalGd" LongName="InstallGd" SourceName="InstGd" LongSource="InstallGuide" src="$(var.SrcDir)\WINNT\doc\install\Documentation\$(var.Language)\html\InstallGd\">
<Component Id="cmp_Install_Guide_$(var.Language)" Guid="$(var.DocHtmlInstallGuid)">
<File Id="fileawqbg000_HTM_$(var.Language)" Name="awqbg000.htm" LongName="awqbg000.htm" KeyPath="yes" DiskId="1" />
<File Id="fileawqbg002_HTM_$(var.Language)" Name="awqbg002.htm" LongName="awqbg002.htm" DiskId="1" />
<File Id="fileawqbg004_HTM_$(var.Language)" Name="awqbg004.htm" LongName="awqbg004.htm" DiskId="1" />
</Component>
</Directory> <!-- InstallGd -->
- <Directory Id="dirSysAdminGd_$(var.Language)" Name="SysAd" LongName="SysAdminGd" SourceName="." src="$(var.SrcDir)\WINNT\doc\install\Documentation\$(var.Language)\html\SysAdminGd\">
+ <Directory Id="dirSysAdminGd_$(var.Language)" Name="SysAd" LongName="SysAdminGd" SourceName="SysAdm" LongSource="SysAdminGd" src="$(var.SrcDir)\WINNT\doc\install\Documentation\$(var.Language)\html\SysAdminGd\">
<Component Id="cmp_Sys_Admin_Guide_$(var.Language)" Guid="$(var.DocHtmlSysAdminGuid)">
<File Id="fileauagd000_HTM_$(var.Language)" Name="auagd.htm" LongName="auagd000.htm" KeyPath="yes" DiskId="1" />
<File Id="fileauagd002_HTM_$(var.Language)" Name="auagd~2.htm" LongName="auagd002.htm" DiskId="1" />
<File Id="filecachmgr_GIF_$(var.Language)" Name="cachm.gif" LongName="cachmgr.gif" DiskId="1" />
</Component>
</Directory> <!-- Sys Admin guide -->
- <Directory Id="dirReleaseNotes_$(var.Language)" Name="Relea" LongName="ReleaseNotes" SourceName="." src="$(var.SrcDir)\WINNT\doc\install\Documentation\$(var.Language)\html\ReleaseNotes\">
+ <Directory Id="dirReleaseNotes_$(var.Language)" Name="Relea" LongName="ReleaseNotes" SourceName="Relea" LongSource="ReleaseNotes" src="$(var.SrcDir)\WINNT\doc\install\Documentation\$(var.Language)\html\ReleaseNotes\">
<Component Id="cmp_Release_Notes_$(var.Language)" Guid="$(var.DocHtmlRelNotesGuid)">
<File Id="fileawrns000_HTM_$(var.Language)" Name="awrns.htm" LongName="awrns000.htm" KeyPath="yes" DiskId="1" />
<File Id="fileawrns002_HTM_$(var.Language)" Name="awrns~2.htm" LongName="awrns002.htm" DiskId="1" />
</Directory> <!-- $(var.Language) -->
</Directory> <!-- Documentation -->
- <Directory Id="dirClient" Name="Client" LongName="Client" SourceName=".">
+ <Directory Id="dirClient" Name="Client" LongName="Client" SourceName="Client">
<Component Id="efl_CellServDB" Guid="8E69FDAB-08C5-4927-B1AA-57FCEEB065F2" NeverOverwrite="yes" Permanent="yes">
<File Id="file_CellServDB" Name="CelSrvDB" LongName="CellServDB" KeyPath="yes" DiskId="1" src="$(var.CellDbFile)"/>
<Condition>OLDCELLSERVDB = ""</Condition>
<CopyFile Id="copy_CellServDB" Delete="yes" DestinationDirectory="dirClient" DestinationName="CellServ|CellServDB" SourceDirectory="WindowsFolder" SourceName="afsdcell.ini" />
<Condition>OLDCELLSERVDB <> ""</Condition>
</Component>
- <Directory Id="dirProgram" Name="Program" LongName="Program" SourceName="." src="$(var.ClientDir)">
+ <Directory Id="dirProgram" Name="Program" LongName="Program" SourceName="Program" src="$(var.ClientDir)">
<Component Id="cmf_afsshare_EXE" Guid="E972DA35-E950-4736-AE48-E6DDCE8C97D0">
<File Id="fileafsshare_EXE" Name="afsshare.exe" LongName="afsshare.exe" KeyPath="yes" DiskId="1" />
</Component>
<Component Id="cmf_afsd_service_EXE" Guid="37A90054-505D-4C57-B489-7EF4D97B86F6">
<File Id="fileafsd_service_EXE" Name="afsd_svc.exe" LongName="afsd_service.exe" KeyPath="yes" DiskId="1" />
<ServiceControl Id="TransarcAFSDaemon" Name="TransarcAFSDaemon" Stop="both" Remove="both" Wait="yes" />
- <ServiceInstall Id="svc_Client" Name="TransarcAFSDaemon" DisplayName="OpenAFS Client" Type="ownProcess" Start="auto" ErrorControl="normal" Description="Provides access to files and directories stored in AFS">
+ <ServiceInstall Id="svc_Client" Name="TransarcAFSDaemon" DisplayName="OpenAFS Client" Type="ownProcess" Start="auto" ErrorControl="normal" Description="Provides access to files and directories stored in AFS" Interactive="yes">
<!-- ServiceConfig doesn't currently do what you think it does.
We instead use a custom action to set the service failure actions.
<ServiceConfig FirstFailureActionType="restart" RestartServiceDelayInSeconds="10" SecondFailureActionType="restart" ThirdFailureActionType="none"/>
</Component>
<?endif?>
- <Directory Id="dirSample" Name="Sampl" LongName="Sample" SourceName=".">
+ <Directory Id="dirSample" Name="Sampl" LongName="Sample" SourceName="Sample">
<Component Id="cmp_SDK_Sample" Guid="F9373E95-F410-4AA5-AA79-07C11EE00334">
<File Id="filetoken_C" Name="token.c" LongName="token.c" KeyPath="yes" DiskId="1" src="$(var.SrcDir)WINNT\afsd\sample\token.c"/>
</Component>
</Directory>
- <Directory Id="dirInclude" Name="Include" LongName="Include" SourceName=".">
+ <Directory Id="dirInclude" Name="Include" LongName="Include" SourceName="Include">
<Component Id="cmp_SDK_Include" Guid="9B12B216-B104-4E49-BE31-4042F2CBD318">
<File Id="filebasic_H" Name="basic.h" LongName="basic.h" DiskId="1" src="$(var.IncDir)basic.h" />
<File Id="filecrypt_H" Name="crypt.h" LongName="crypt.h" DiskId="1" src="$(var.IncDir)crypt.h" />
<File Id="fileubik_H" Name="ubik.h" LongName="ubik.h" DiskId="1" src="$(var.IncDir)ubik.h" />
<File Id="fileubik_int_H" Name="ubik_int.h" LongName="ubik_int.h" DiskId="1" src="$(var.IncDir)ubik_int.h" />
</Component>
- <Directory Id="dirIncludeAfs" Name="afs" LongName="afs" SourceName=".">
+ <Directory Id="dirIncludeAfs" Name="afs" LongName="afs" SourceName="afs">
<Component Id="cmp_SDK_Include_afs" Guid="692D18AD-4901-4124-8B1F-5D414E65A7D0">
<File Id="fileacl_H" Name="acl.h" LongName="acl.h" DiskId="1" src="$(var.IncDir)afs\acl.h" />
<File Id="fileafscbint_H" Name="afscbint.h" LongName="afscbint.h" DiskId="1" src="$(var.IncDir)afs\afscbint.h" />
<File Id="filevolume_H" Name="volume.h" LongName="volume.h" DiskId="1" src="$(var.IncDir)afs\volume.h" />
</Component>
</Directory>
- <Directory Id="dirIncludeRx" Name="rx" LongName="rx" SourceName=".">
+ <Directory Id="dirIncludeRx" Name="rx" LongName="rx" SourceName="rx">
<Component Id="cmp_SDK_Include_rx" Guid="2E215D10-C080-42A3-B692-AFF94C7A1A2B">
<File Id="fileasn1_err_H" Name="asn1_err.h" LongName="asn1_err.h" DiskId="1" src="$(var.IncDir)rx\asn1_err.h" />
<File Id="filefcrypt_H" Name="fcrypt.h" LongName="fcrypt.h" DiskId="1" src="$(var.IncDir)rx\fcrypt.h" />
<File Id="filexdr_prototypes_H" Name="XDR_PR~1.h" LongName="xdr_prototypes.h" DiskId="1" src="$(var.IncDir)rx\xdr_prototypes.h" />
</Component>
</Directory>
- <Directory Id="dirIncludeWinnt" Name="WINNT" LongName="WINNT" SourceName=".">
+ <Directory Id="dirIncludeWinnt" Name="WINNT" LongName="WINNT" SourceName="WINNT">
<Component Id="cmp_SDK_Include_Winnt" Guid="BAAF0193-5C33-4EC1-9D40-DD4595F176E6">
<File Id="fileafsapplib_H" Name="AFSAPP~1.h" LongName="afsapplib.h" DiskId="1" src="$(var.IncDir)WINNT\afsapplib.h" />
<File Id="fileafsclass_H" Name="afsclass.h" LongName="afsclass.h" DiskId="1" src="$(var.IncDir)WINNT\afsclass.h" />
</Component>
</Directory>
</Directory>
- <Directory Id="dirLib" Name="lib" LongName="lib" SourceName=".">
+ <Directory Id="dirLib" Name="lib" LongName="lib" SourceName="lib">
<Component Id="cmp_SDK_Lib" Guid="71BC1B4E-4C4C-4FF8-8DDA-C6AB2BE22142">
<File Id="fileafsauthent_LIB" Name="AFSAUT~1.lib" LongName="afsauthent.lib" DiskId="1" src="$(var.LibDir)afsauthent.lib" />
<File Id="fileafsdes_LIB" Name="afsdes.lib" LongName="afsdes.lib" DiskId="1" src="$(var.LibDir)afsdes.lib" />
<File Id="filecm_config_OBJ" Name="CM_CON~1.obj" LongName="cm_config.obj" DiskId="1" src="$(var.LibDir)cm_config.obj" />
<File Id="filecm_dns_OBJ" Name="cm_dns.obj" LongName="cm_dns.obj" DiskId="1" src="$(var.LibDir)cm_dns.obj" />
</Component>
- <Directory Id="dirLibAfs" Name="afs" LongName="afs" SourceName=".">
+ <Directory Id="dirLibAfs" Name="afs" LongName="afs" SourceName="afs">
<Component Id="cmp_SDK_Lib_Afs" Guid="CD671A64-D491-4363-A7AD-645482B481BE">
<File Id="fileafsacl_LIB" Name="afsacl.lib" LongName="afsacl.lib" DiskId="1" src="$(var.LibDir)afs\afsacl.lib" />
<File Id="fileafsadminutil_LIB" Name="AFSADM~1.lib" LongName="afsadminutil.lib" DiskId="1" src="$(var.LibDir)afs\afsadminutil.lib" />
</Directory>
</Directory> <!-- /Program -->
</Directory> <!-- /Client -->
- <Directory Id="dirServer" Name="Server" LongName="Server" SourceName=".">
- <Directory Id="dirusr" Name="usr" LongName="usr" SourceName=".">
- <Directory Id="dirafs" Name="afs" LongName="afs" SourceName=".">
- <Directory Id="dirbin" Name="bin" LongName="bin" SourceName="." src="$(var.ServerDir)">
+ <Directory Id="dirServer" Name="Server" LongName="Server" SourceName="Server">
+ <Directory Id="dirusr" Name="usr" LongName="usr" SourceName="usr">
+ <Directory Id="dirafs" Name="afs" LongName="afs" SourceName="afs">
+ <Directory Id="dirbin" Name="bin" LongName="bin" SourceName="bin" src="$(var.ServerDir)">
<Component Id="cmf_vlserver_EXE" Guid="F6A43B78-EE17-4483-AA81-4B6C6957977D">
<File Id="filevlserver_EXE" Name="vlser.exe" LongName="vlserver.exe" KeyPath="yes" DiskId="1" />
</Component>
<Component Id="cmf_bosctlsvc_EXE" Guid="8F6F62A8-BB6D-46C1-BA80-4F207AA24F0D">
<File Id="filebosctlsvc_EXE" Name="bosct.exe" LongName="bosctlsvc.exe" KeyPath="yes" DiskId="1" />
<ServiceControl Id="TransarcAFSServer" Name="TransarcAFSServer" Stop="both" Remove="both" Wait="yes" />
- <ServiceInstall Id="svc_Server" Name="TransarcAFSServer" DisplayName="OpenAFS Server" Type="ownProcess" Start="auto" ErrorControl="normal" Description="Manages AFS server processes">
+ <ServiceInstall Id="svc_Server" Name="TransarcAFSServer" DisplayName="OpenAFS Server" Type="ownProcess" Start="auto" ErrorControl="normal" Description="Manages AFS server processes" Interactive="yes">
<!-- ServiceConfig does nothing
<ServiceConfig FirstFailureActionType="restart" RestartServiceDelayInSeconds="5" SecondFailureActionType="restart" ThirdFailureActionType="none"/>
-->
<String Id="StrCfgWzdDesc">Server Configuration Wizard</String>
<String Id="StrLaunchCond">OpenAFS for Windows is currently only packaged for Windows 2000,XP and 2003</String>
+ <String Id="AdminRequired">Installation of OpenAFS for Windows requires administrative privileges</String>
<String Id="ErrNPIFailed">Installation of Network Provider failed. System error [2]</String>
<String Id="ErrSCCFailed">Configuration of client service failed. System error [2]</String>
<String Id="ErrSCSFailed">Configuration of server service failed. System error [2]</String>
<String Id="ErrAbort">Installation aborted : [2]</String>
<String Id="ErrNsisFailed">Uninstallation of the NSIS installation of OpenAFS failed with code [2]</String>
+ <String Id="ErrCantCreateGroup">Can't create AFS Client Admin group. NET_API_Error [2]</String>
+ <String Id="ErrCantAddMembers">Can't add members to AFS Client Admin group. NET_API_Error [2]</String>
<String Id="ActInstallLoopback">Installing loopback adapter</String>
<String Id="ActRemoveLoopback">Removing existing loopback adapter</String>
<Dialog Id="AdminWelcomeDlg" Width="370" Height="270" Title="[ProductName] [Setup]" NoMinimize="yes">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="[ButtonText_Next]">
<Publish Property="InstallMode" Value="Server Image">1</Publish>
- <Publish Event="NewDialog" Value="AdminRegistrationDlg">1</Publish>
+ <Publish Event="NewDialog" Value="AdminInstallPointDlg">1</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="[ButtonText_Cancel]">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
<Error Id="4003">$(loc.ErrSCSFailed)</Error>
<Error Id="4004">$(loc.ErrAbort)</Error>
<Error Id="4005">$(loc.ErrNsisFailed)</Error>
+ <Error Id="4006">$(loc.ErrCantCreateGroup)</Error>
+ <Error Id="4007">$(loc.ErrCantAddMembers)</Error>
<ProgressText Action="RemoveLoopback" Template="[1]:([2])([3])([4])">$(loc.ActRemoveLoopback)</ProgressText>
<ProgressText Action="InstallLoopback" Template="[1]:([2])([3])([4])">$(loc.ActInstallLoopback)</ProgressText>
<ProgressText Action="RemoveNetProvider">$(loc.ActRemoveNetProvider)</ProgressText>
<?define ProductName="OpenAFS for Windows"?>
<!-- Localized packages should have different product codes -->
- <?define ProductCode="CCAF9E14-976E-46C0-8A1B-A218EAB7ADC5"?>
+ <!-- Each product release should have a different product code -->
+ <?ifndef ProductCode?>
+ <?define ProductCode="????????-????-????-????-????????????"?>
+ <?endif?>
<!-- Same goes for localized components -->
<?define DocHtmlIndexGuid="B656CA5A-5179-42D8-8972-2F128AEDE751"?>
/>
<!-- Launch conditions -->
- <Condition
- Message="$(loc.StrLaunchCond)">
+ <Condition Message="$(loc.StrLaunchCond)">
<![CDATA[VersionNT >= 500]]>
</Condition>
+ <Condition Message="$(loc.AdminRequired)">Privileged</Condition>
+
<!-- Global Properties -->
<?include property.wxi?>
BinaryKey="BIN_afsCustom"
DllEntry="UninstallNsisInstallation"
Execute="immediate" />
+ <CustomAction
+ Id="CreateAFSAdminGroup"
+ BinaryKey="BIN_afsCustom"
+ DllEntry="CreateAFSClientAdminGroup"
+ Impersonate="no"
+ Execute="deferred" />
+ <CustomAction
+ Id="RemoveAFSAdminGroup"
+ BinaryKey="BIN_afsCustom"
+ DllEntry="RemoveAFSClientAdminGroup"
+ Impersonate="no"
+ Execute="deferred" />
+ <CustomAction
+ Id="RollbackAFSAdminGroup"
+ BinaryKey="BIN_afsCustom"
+ DllEntry="RemoveAFSClientAdminGroup"
+ Impersonate="no"
+ Execute="rollback" />
<CustomAction
Id="AbortInstallationA"
BinaryKey="BIN_afsCustom"
<Custom Action="RemoveNetProvider" After="InstallNetProvider">&feaClient=2</Custom>
<Custom Action="ConfigureClient" After="InstallServices">&feaClient=3</Custom>
<Custom Action="ConfigureServer" After="ConfigureClient">&feaServer=3</Custom>
+ <!-- <Custom Action="RemoveAFSAdminGroup" Before="">&feaClient=2</Custom> -->
+ <Custom Action="RollbackAFSAdminGroup" Before="CreateAFSAdminGroup">&feaClient=3</Custom>
+ <Custom Action="CreateAFSAdminGroup" Before="CreateFolders">&feaClient=3</Custom>
<ScheduleReboot After="PublishProduct">&feaClient=3 OR &feaServer=3 OR &feaClient=2 OR &feaServer=2</ScheduleReboot>
</InstallExecuteSequence>
</Property>
<Property Id="ABORTREASON">$(loc.StrNsisAbortReason)</Property>
-
+
<Property Id="OLDCELLSERVDB">
<DirectorySearch Id="dsOldCellServDB" Path="[WindowsFolder]" >
<FileSearch Id="fsOldCellServDB" Name="afsdcell.ini" />
empty. Due to a bug in Windows Installer, when a feature is empty (i.e. contains no components)
its install state is set as NULL, instead of Local or Absent. This prevents the feature from
being removed when the product is uninstalled. This is just a flag component to add to the
- loopback feature so that it is not empty. -->
+ loopback feature so that it is not empty. -->
<Component Id="rcm_Loopback" Guid="9F9BBDA3-208C-4F93-B81F-313E031B6DDA">
<Registry Root="HKLM" Key="SOFTWARE\OpenAFS\Client" Name="LoopbackInstalled" Type="integer" Value="1" Id="reg_Loopback1" KeyPath="yes" />
</Component>
->andrew.cmu.edu #Carnegie Mellon University - Computing Services
-128.2.10.11 #vice11.fs.andrew.cmu.edu
-128.2.10.12 #vice12.fs.andrew.cmu.edu
-128.2.10.2 #vice2.fs.andrew.cmu.edu
-128.2.10.28 #vice28.fs.andrew.cmu.edu
-128.2.10.7 #vice7.fs.andrew.cmu.edu
->cs.cmu.edu #Carnegie Mellon University - School of Comp. Sci.
-128.2.206.130 #cucumber.srv.cs.cmu.edu
-128.2.222.199 #papaya.srv.cs.cmu.edu
-128.2.242.86 #lemon.srv.cs.cmu.edu
->ece.cmu.edu #Carnegie Mellon University - Elec. Comp. Eng. Dept.
-128.2.129.7 #porok.ece.cmu.edu
-128.2.129.8 #vicio.ece.cmu.edu
-128.2.129.9 #e-xing.ece.cmu.edu
->athena.mit.edu #MIT/Athena cell
-18.70.0.6 #prill.mit.edu.
-18.145.0.25 #agamemnon.mit.edu.
-18.159.0.34 #chimera.mit.edu.
->dev.mit.edu #MIT/IS Development cell
-18.86.0.28 #wham.mit.edu.
-18.86.0.50 #hum.mit.edu.
-18.86.0.51 #rattle.mit.edu.
->net.mit.edu #MIT/Network Group cell
-18.72.1.38 #gracie.mit.edu.
-18.72.0.26 #cetus.mit.edu.
->sipb.mit.edu #MIT/SIPB cell
-18.181.0.19 #reynelda.mit.edu.
-18.181.0.23 #ronald-ann.mit.edu.
-18.181.0.22 #rosebud.mit.edu.
->ir.stanford.edu #Stanford University
-171.64.7.222 #afsdb1.stanford.edu
-171.64.7.234 #afsdb2.stanford.edu
-171.64.7.246 #afsdb3.stanford.edu
->umr.edu #University of Missouri - Rolla
-131.151.1.59 #afs1.umr.edu
-131.151.1.70 #afs6.umr.edu
-131.151.1.146 #afs5.umr.edu
->dementia.org #Dementia Unlimited
-128.2.35.149 #alycia.dementia.org
-128.2.120.216 #meredith.dementia.org
+>grand.central.org #GCO Public CellServDB 17 Aug 2004
+18.7.14.88 #grand-opening.mit.edu
+128.2.191.224 #penn.central.org
+>wu-wien.ac.at #University of Economics, Vienna, Austria
+137.208.3.33 #afsdb1.wu-wien.ac.at
+137.208.7.4 #afsdb2.wu-wien.ac.at
+137.208.7.7 #afsdb3.wu-wien.ac.at
+>hephy.at #hephy-vienna
+193.170.243.10 #mowgli.oeaw.ac.at
+193.170.243.12 #baloo.oeaw.ac.at
+193.170.243.14 #akela.oeaw.ac.at
+>itp.tugraz.at #Institute for Theoretical Physics, TU Graz, Austria
+129.27.157.6 #fubphsv2.tu-graz.ac.at
+129.27.161.7 #faepsv01.tu-graz.ac.at
+129.27.161.15 #faepsv02.tu-graz.ac.at
+>cern.ch #European Laboratory for Particle Physics, Geneva
+137.138.128.148 #afsdb1.cern.ch
+137.138.246.50 #afsdb3.cern.ch
+137.138.246.51 #afsdb2.cern.ch
+>ams.cern.ch #AMS Experiment
+137.138.206.77 #pcamsf2.cern.ch
+137.138.206.123 #pcamsf4.cern.ch
+>ethz.ch #Swiss Federal Inst. of Tech. - Zurich, Switzerland
+129.132.97.19 #amalthea.ethz.ch
+129.132.97.27 #nethzafs-001.ethz.ch
+129.132.115.3 #himalia.ethz.ch
+129.132.115.37 #nethzafs-005.ethz.ch
+129.132.115.38 #nethzafs-006.ethz.ch
+>psi.ch #Paul Scherrer Institut - Villigen, Switzerland
+129.129.16.10 #afs1.psi.ch
+129.129.16.11 #afs2.psi.ch
+>extundo.com #Simon Josefsson's cell
+195.42.214.241 #slipsten.extundo.com
+>mekinok.com #Mekinok, Inc.
+4.36.43.98 #loggerhead.mekinok.com
+>membrain.com #membrain.com
+66.93.118.125 #stormy
+130.85.24.11 #weasel
+130.85.24.13 #straykitten
+>midnightlinux.com #Midnight Linux, Pittsburgh PA
+66.93.62.18 #romulus.midnihtlinux.com
+66.93.62.20 #yar.midnightlinux.com
+>setfilepointer.com #SetFilePointer.com
+63.224.10.2 #hamlet.SetFilePointer.com
+63.224.10.4 #troilus.SetFilePointer.com
+>sodre.cx #Sodre.cx
+128.8.140.165 #greed.sodre.cx
+>desy.de #Deutsches Elektronen-Synchrotron
+131.169.40.62 #vayu.desy.de
+131.169.244.60 #solar00.desy.de
+>gppc.de #GPP Chemnitz mbH
+213.187.92.33 #gpp1.gppc.de
+213.187.92.34 #paulchen.gppc.de
+213.187.92.35 #lotus.gppc.de
+>ifh.de #DESY Zeuthen
+141.34.22.10 #romulus.ifh.de
+141.34.22.11 #remus.ifh.de
+141.34.22.29 #hekate.ifh.de
+>lrz-muenchen.de #Leibniz Computing Centre, Germany
+129.187.10.36 #afs1.lrz-muenchen.de
+129.187.10.56 #afs3.lrz-muenchen.de
+129.187.10.57 #afs2.lrz-muenchen.de
+>ipp-garching.mpg.de #Institut fuer Plasmaphysik
+130.183.9.5 #afs-db1.rzg.mpg.de
+130.183.100.10 #afs-db2.aug.ipp-garching.mpg.de
+130.183.100.23 #afs-db3.aug.ipp-garching.mpg.de
+>mpe.mpg.de #MPE cell
+130.183.130.7 #irafs1.mpe-garching.mpg.de
+130.183.134.20 #irafs2.mpe-garching.mpg.de
+>i1.informatik.rwth-aachen.de #Informatik I, RWTH Aachen
+137.226.244.79 #remus.informatik.rwth-aachen.de
+>tu-chemnitz.de #Technische Universitaet Chemnitz, Germany
+134.109.2.1 #zuse.hrz.tu-chemnitz.de
+134.109.2.15 #phoenix.hrz.tu-chemnitz.de
+134.109.200.7 #aetius.hrz.tu-chemnitz.de
+>e18.ph.tum.de #Experimental Physics, TU Munich, Germany
+129.187.154.223 #hamlet.e18.physik.tu-muenchen.de
+>uni-bonn.de #University of Bonn, Computing Center
+131.220.14.198 #work15-eth.rhrz.uni-bonn.de
+131.220.14.205 #node05.rhrz.uni-bonn.de
+131.220.15.197 #afs-db1.rhrz.uni-bonn.de
+>atlass01.physik.uni-bonn.de #Bonn ATLAS
+131.220.165.43 #atlass01.physik.uni-bonn.de
+>uni-freiburg.de #Albert-Ludwigs-Universitat Freiburg
+132.230.6.235 #sv6.ruf.uni-freiburg.de
+132.230.6.236 #sv7.ruf.uni-freiburg.de
+132.230.6.237 #sv8.ruf.uni-freiburg.de
+>physik.uni-freiburg.de #institute of physics, university Freiburg, Germany
+132.230.77.16 #hepafs.physik.uni-freiburg.de
+>urz.uni-heidelberg.de #Uni Heidelberg (Rechenzentrum)
+129.206.119.10 #afsdb.urz.uni-heidelberg.de
+129.206.119.16 #afsdb1.urz.uni-heidelberg.de
+129.206.119.17 #afsdb2.urz.uni-heidelberg.de
+>uni-hohenheim.de #University of Hohenheim
+144.41.2.2 #rs13.serv.uni-hohenheim.de
+144.41.2.3 #rs14.serv.uni-hohenheim.de
+144.41.2.4 #rs15.serv.uni-hohenheim.de
+>rz.uni-jena.de #Rechenzentrum University of Jena, Germany
+141.35.2.160 #lc00.rz.uni-jena.de
+141.35.7.9 #fsuj01.rz.uni-jena.de
+141.35.7.10 #zaphod.rz.uni-jena
+>meteo.uni-koeln.de #Univ. of Cologne - Inst. for Geophysics & Meteorology
+134.95.144.22 #afs1.meteo.uni-koeln.de
+134.95.144.24 #afs2.meteo.uni-koeln.de
+>rrz.uni-koeln.de #University of Cologne - Reg Comp Center
+134.95.19.3 #afsdb1.rrz.uni-koeln.de
+134.95.19.30 #fileserv3.rrz.uni-koeln.de
+134.95.67.97 #afs.thp.uni-koeln.de
+134.95.140.190 #rzkbserv.rrz.uni-koeln.de
+>physik.uni-mainz.de #institute of physics, university Mainz, Germany
+134.93.130.93 #hardy.physik.uni-mainz.de
+>uni-mannheim.de #Uni Mannheim (Rechenzentrum)
+134.155.97.204 #afsdb1.uni-mannheim.de
+134.155.97.205 #afsdb2.uni-mannheim.de
+134.155.97.206 #afsdb3.uni-mannheim.de
+>physik.uni-wuppertal.de #Physics department of Bergische Universität Wuppertal
+132.195.104.3 #afs1.physik.uni-wuppertal.de
+132.195.104.230 #afs2.physik.uni-wuppertal.de
+>s-et.aau.dk #Aalborg Univ., The Student Society, Denmark
+130.225.196.22 #afs.s-et.aau.dk
+>ies.auc.dk #Aalborg Univ., Inst. of Electronic Systems, Denmark
+130.225.51.73 #afsdb1.kom.auc.dk
+130.225.51.74 #afsdb2.kom.auc.dk
+130.225.51.85 #afsdb3.kom.auc.dk
+>asu.edu #Arizona State University
+129.219.10.69 #authen2.asu.edu
+129.219.10.70 #authen1.asu.edu
+129.219.10.72 #authen3.asu.edu
+129.219.100.16 #authen4.asu.edu
+>hep.caltech.edu #CalTech High Energy Physics
+131.215.126.150 #afs.hep.caltech.edu
+>andrew.cmu.edu #Carnegie Mellon University - Computing Services Cell
+128.2.10.2 #vice2.fs.andrew.cmu.edu
+128.2.10.7 #vice7.fs.andrew.cmu.edu
+128.2.10.11 #vice11.fs.andrew.cmu.edu
+128.2.10.28 #vice28.fs.andrew.cmu.edu
+128.2.32.44 #new-vice12.fs.andrew.cmu.edu
+>club.cc.cmu.edu #Carnegie Mellon University Computer Club
+128.2.4.131 #yttrium.club.cc.cmu.edu
+128.2.4.132 #zirconium.club.cc.cmu.edu
+>chem.cmu.edu #Carnegie Mellon University - Chemistry Dept.
+128.2.40.134 #afs.chem.cmu.edu
+128.2.40.140 #afs2.chem.cmu.edu
+>cs.cmu.edu #Carnegie Mellon University - School of Comp. Sci.
+128.2.194.178 #cherry.srv.cs.cmu.edu
+128.2.194.179 #pumpkin.srv.cs.cmu.edu
+128.2.194.180 #strawberry.srv.cs.cmu.edu
+>ece.cmu.edu #Carnegie Mellon University - Elec. Comp. Eng. Dept.
+128.2.129.7 #porok.ece.cmu.edu
+128.2.129.8 #vicio.ece.cmu.edu
+128.2.129.9 #e-xing.ece.cmu.edu
+>scotch.ece.cmu.edu #CMU ECE CALCM research group
+128.2.134.82 #lagavulin.ece.cmu.edu
+>qatar.cmu.edu #Carnegie Mellon University - Qatar Campus Cell
+204.194.25.7 #afs1.qatar.cmu.edu
+204.194.25.8 #afs2.qatar.cmu.edu
+>sbp.ri.cmu.edu #Carnegie Mellon University - Sensor Based Planning Lab
+128.2.105.174 #voronoi.sbp.ri.cmu.edu
+128.2.105.175 #nihao.sbp.ri.cmu.edu
+>msc.cornell.edu #Cornell University Materials Science Center
+128.84.231.242 #miranda.ccmr.cornell.edu
+128.84.241.35 #co.ccmr.cornell.edu
+128.84.249.78 #dax.ccmr.cornell.edu
+>dbic.dartmouth.edu #Dartmouth Brain Imaging Center
+129.170.30.143 #dbicafs1.dartmouth.edu
+129.170.30.144 #dbicafs2.dartmouth.edu
+129.170.30.145 #dbicafs3.dartmouth.edu
+>northstar.dartmouth.edu #Dartmouth College Research Computing
+129.170.16.22 #halley.dartmouth.edu
+129.170.16.42 #oort.dartmouth.edu
+129.170.16.43 #cygnusx1.dartmouth.edu
+>iastate.edu #Iowa State University
+129.186.1.243 #afsdb-1.iastate.edu
+129.186.6.243 #afsdb-2.iastate.edu
+129.186.142.243 #afsdb-3.iastate.edu
+>athena.mit.edu #MIT/Athena cell
+18.7.1.66 #paris.mit.edu.
+18.7.1.74 #chimera.mit.edu.
+18.158.0.37 #prill.mit.edu.
+>dev.mit.edu #MIT/IS Development cell
+18.7.1.70 #wham.mit.edu.
+18.7.15.89 #rattle.mit.edu.
+18.7.15.93 #hum.mit.edu.
+>net.mit.edu #MIT/Network Group cell
+18.7.7.73 #gracie.mit.edu
+18.7.21.95 #george.mit.edu
+>sipb.mit.edu #MIT/SIPB cell
+18.181.0.19 #reynelda.mit.edu.
+18.181.0.22 #rosebud.mit.edu.
+18.181.0.23 #ronald-ann.mit.edu.
+>msu.edu #Michigan State University Main Cell
+35.9.7.10 #afsdb0.cl.msu.edu
+>nd.edu #University of Notre Dame
+129.74.223.17 #john.helios.nd.edu
+129.74.223.33 #lizardo.helios.nd.edu
+129.74.223.65 #buckaroo.helios.nd.edu
+>pitt.edu #University of Pittsburgh
+136.142.8.15 #afs09.srv.cis.pitt.edu
+136.142.8.20 #afs10.srv.cis.pitt.edu
+136.142.8.21 #afs11.srv.cis.pitt.edu
+>cs.pitt.edu #University of Pittsburgh - Computer Science
+130.49.220.11 #afs01.cs.pitt.edu
+130.49.220.12 #afs02.cs.pitt.edu
+130.49.220.13 #afs03.cs.pitt.edu
+>psc.edu #PSC (Pittsburgh Supercomputing Center)
+128.182.59.182 #shaggy.psc.edu
+128.182.66.184 #velma.psc.edu
+128.182.66.185 #daphne.psc.edu
+>scoobydoo.psc.edu #PSC Test Cell
+128.182.59.181 #scooby.psc.edu
+>cede.psu.edu #Penn State - Center for Engr. Design & Entrepeneurship
+146.186.218.10 #greenly.cede.psu.edu
+146.186.218.60 #b50.cede.psu.edu
+146.186.218.246 #stalin.cede.psu.edu
+>rose-hulman.edu #Rose-Hulman Institute of Technology
+137.112.7.11 #afs1.rose-hulman.edu
+137.112.7.12 #afs2.rose-hulman.edu
+137.112.7.13 #afs3.rose-hulman.edu
+>cs.rose-hulman.edu #Rose-Hulman CS Department
+137.112.40.10 #galaxy.cs.rose-hulman.edu
+>rpi.edu #Rensselaer Polytechnic Institute
+128.113.22.11 #saul.server.rpi.edu
+128.113.22.12 #joab.server.rpi.edu
+128.113.22.13 #korah.server.rpi.edu
+128.113.22.14 #achan.server.rpi.edu
+>hep.sc.edu #University of South Carolina, Dept. of Physics
+129.252.78.77 #cpeven.physics.sc.edu
+>cs.stanford.edu #Stanford University Computer Science Department
+171.64.64.10 #cs-afs-1.Stanford.EDU
+171.64.64.66 #cs-afs-2.stanford.edu
+171.64.64.69 #cs-afs-3.stanford.edu
+>ir.stanford.edu #Stanford University
+171.64.7.222 #afsdb1.stanford.edu
+171.64.7.234 #afsdb2.stanford.edu
+171.64.7.246 #afsdb3.stanford.edu
+>slac.stanford.edu #Stanford Linear Accelerator Center
+134.79.18.25 #afsdb1.slac.stanford.edu
+134.79.18.26 #afsdb2.slac.stanford.edu
+134.79.18.27 #afsdb3.slac.stanford.edu
+>cats.ucsc.edu #UC Santa Cruz, Comm. and Tech. Services, California U.S.A
+128.114.129.14 #elan.ucsc.edu
+128.114.129.15 #ichabod.ucsc.edu
+128.114.129.18 #maneki.ucsc.edu
+>acm.uiuc.edu #ACM at the University of Illinois
+128.174.251.8 #alnitak.acm.uiuc.edu
+128.174.251.9 #alnilam.acm.uiuc.edu
+128.174.251.10 #mintaka.acm.uiuc.edu
+>ncsa.uiuc.edu #University of Illinois
+141.142.3.5 #congo.ncsa.uiuc.edu
+141.142.3.8 #nile.ncsa.uiuc.edu
+141.142.3.9 #kaskaskia.ncsa.uiuc.edu
+>umbc.edu #University of Maryland, Baltimore County
+130.85.24.23 #db2.afs.umbc.edu
+130.85.24.87 #db3.afs.umbc.edu
+130.85.24.101 #db1.afs.umbc.edu
+>glue.umd.edu #University of Maryland - Project Glue
+128.8.70.11 #olmec.umd.edu
+128.8.236.4 #egypt.umd.edu
+128.8.236.230 #babylon.umd.edu
+>wam.umd.edu #University of Maryland Network WAM Project
+128.8.70.9 #csc-srv.wam.umd.edu
+128.8.236.5 #avw-srv.wam.umd.edu
+128.8.236.231 #ptx-srv.wam.umd.edu
+>umich.edu #University of Michigan - Campus
+141.211.1.32 #fear.ifs.umich.edu
+141.211.1.33 #surprise.ifs.umich.edu
+141.211.1.34 #ruthless.ifs.umich.edu
+>atlas.umich.edu #ATLAS group cell in physics at University of Michigan
+141.211.43.102 #linat02.grid.umich.edu
+141.211.43.106 #linat06.grid.umich.edu
+141.211.43.109 #atgrid.grid.umich.edu
+>citi.umich.edu #Center for Information Technology Integration
+141.211.133.5 #babylon.citi.umich.edu
+>lsa.umich.edu #University of Michigan - College of LS&A
+141.211.54.132 #curtis.admin.lsa.umich.edu
+141.211.211.53 #gerow.lsa.umich.edu
+141.211.211.72 #collines.lsa.umich.edu
+141.211.211.153 #hodges.lsa.umich.edu
+>math.lsa.umich.edu #University of Michigan - Math Department
+141.211.61.40 #ike.math.lsa.umich.edu
+141.211.61.41 #clark.math.lsa.umich.edu
+141.211.61.42 #nimitz.math.lsa.umich.edu
+>umr.edu #University of Missouri - Rolla
+131.151.1.59 #afsdb1.umr.edu
+131.151.1.70 #afsdb3.umr.edu
+131.151.1.146 #afsdb2.umr.edu
+>physics.unc.edu #Univ. of NC at Chapel Hill, Dept. of Physics
+152.2.5.2 #valerian.physics.unc.edu
+152.2.5.3 #augustus.physics.unc.edu
+152.2.7.67 #nerva.astro.unc.edu
+>uncc.edu #University of NC at Charlotte Mosaic AFS Cell
+152.15.10.70 #as-sm1.uncc.edu
+152.15.13.7 #as-sm2.uncc.edu
+152.15.30.27 #fs-kenn3.uncc.edu
+>eng.utah.edu #University of Utah - Engineering
+155.99.222.9 #lenny.eng.utah.edu
+155.99.222.10 #carl.eng.utah.edu
+>cs.uwm.edu #University of Wisconsin--Milwaukee
+129.89.38.124 #solomons.cs.uwm.edu
+>cs.wisc.edu #Univ. of Wisconsin-Madison, Computer Sciences Dept.
+128.105.132.14 #timon.cs.wisc.edu
+128.105.132.15 #pumbaa.cs.wisc.edu
+128.105.132.16 #zazu.cs.wisc.edu
+>engr.wisc.edu #University of Wisconsin-Madison, College of Engineering
+144.92.13.14 #larry.cae.wisc.edu
+144.92.13.15 #curly.cae.wisc.edu
+144.92.13.16 #moe.cae.wisc.edu
+>hep.wisc.edu #University of Wisconsin -- High Energy Physics
+128.104.28.219 #anise.physics.wisc.edu
+>physics.wisc.edu #Univ. of Wisconsin-Madison, Physics Department
+128.104.220.51 #bubbles.physics.wisc.edu
+128.104.220.52 #buttercup.physics.wisc.edu
+128.104.220.53 #blossom.physics.wisc.edu
+>ifca.unican.es #Instituto de Fisica de Cantabria (IFCA), Santander, Spain
+193.144.209.20 #gridwall.ifca.unican.es
+>ific.uv.es #Instituto de Fisica Corpuscular, Valencia, Spain
+147.156.163.11 #alpha.ific.uv.es
+>biocenter.helsinki.fi #University of Helsinki, Institute of Biotechnology
+128.214.58.174 #afsdb1.biocenter.helsinki.fi
+128.214.88.114 #afsdb2.biocenter.helsinki.fi
+>dapnia.saclay.cea.fr #CEA DAPNIA
+132.166.32.7 #dphrsg.saclay.cea.fr
+132.166.32.12 #dphrsl.saclay.cea.fr
+>in2p3.fr #IN2P3 production cell
+134.158.232.11 #ccafsdb1.in2p3.fr
+134.158.232.12 #ccafsdb2.in2p3.fr
+134.158.232.13 #ccafsdb3.in2p3.fr
+>anl.gov #Argonne National Laboratory
+146.137.96.33 #arteus.ctd.anl.gov
+146.137.162.88 #agamemnon.ctd.anl.gov
+146.137.194.80 #antenor.ctd.anl.gov
+>rhic.bnl.gov #Relativistic Heavy Ion Collider
+130.199.6.51 #rafs03.rcf.bnl.gov
+130.199.6.52 #rafs02.rcf.bnl.gov
+130.199.6.69 #rafs01.rcf.bnl.gov
+>usatlas.bnl.gov #US Atlas Tier 1 Facility at BNL
+130.199.48.32 #aafs01.usatlas.bnl.gov
+130.199.48.33 #aafs02.usatlas.bnl.gov
+130.199.48.34 #aafs03.usatlas.bnl.gov
+>fnal.gov #Fermi National Acclerator Laboratory
+131.225.68.1 #fsus01.fnal.gov
+131.225.68.4 #fsus03.fnal.gov
+131.225.68.14 #fsus04.fnal.gov
+>ic-afs.arc.nasa.gov #Code IC, Ames Research Center
+128.102.105.62 #udanax.arc.nasa.gov
+>nersc.gov #National Energy Research Supercomputer Center
+128.55.128.250 #mars.nersc.gov
+128.55.128.252 #alfred.nersc.gov
+128.55.128.254 #lurch.nersc.gov
+>caspur.it #CASPUR Inter-University Computing Consortium, Rome
+193.204.5.45 #pomodoro.caspur.it
+193.204.5.46 #banana.caspur.it
+193.204.5.50 #maslo.caspur.it
+>fusione.it #Assoz. FUSIONE/Euratom, ENEA, Frascati-Italy
+192.107.90.2 #fusafs1.frascati.enea.it
+192.107.90.3 #fusafs2.frascati.enea.it
+192.107.90.4 #fusafs3.frascati.enea.it
+>icemb.it #ICEMB, Universita' La Sapienza - Rome - Italy
+193.204.6.130 #icembfs.caspur.it
+>infn.it #Istituto Nazionale di Fisica Nucleare (INFN), Italia
+131.154.1.7 #afs3.infn.it
+141.108.3.252 #afs1.infn.it
+192.84.134.75 #afs2.infn.it
+>kloe.infn.it #INFN, KLOE experiment at Laboratori di Frascati
+192.135.25.111 #kloeafs1.lnf.infn.it
+192.135.25.112 #kloeafs2.lnf.infn.it
+>le.infn.it #INFN, Sezione di Lecce
+192.84.152.40 #afs01.le.infn.it
+192.84.152.148 #afs02.le.infn.it
+>lnf.infn.it #INFN, Laboratori Nazionali di Frascati
+193.206.84.121 #afs1.lnf.infn.it
+193.206.84.122 #afs2.lnf.infn.it
+193.206.84.123 #afs3.lnf.infn.it
+>lngs.infn.it #INFN, Laboratori Nazionali di Gran Sasso
+192.84.135.21 #rsgs05.lngs.infn.it
+>pi.infn.it #INFN, Sezione di Pisa
+131.114.134.26 #unknownhost.pi.infn.it
+192.84.133.50 #aix1.pi.infn.it
+>psm.it #Progetto San Marco, Universita' di Roma-1
+151.100.1.65 #atlante.psm.uniroma1.it
+>tgrid.it #CASPUR-CILEA-CINECA Grid Cell
+193.204.5.33 #cccgrid.caspur.it
+>ictp.trieste.it #The Abdus Salam International Centre for Theoretical Physics (IC
+140.105.16.8 #fs1.ictp.trieste.it
+140.105.16.9 #fs2.ictp.trieste.it
+>ing.uniroma1.it #Universita' La Sapienza, Fac. Ingeneria
+151.100.85.253 #alfa.ing.uniroma1.it
+>vn.uniroma3.it #University of Rome 3, Area Vasca Navale
+193.204.161.136 #alfa.dia.uniroma3.it
+193.204.161.137 #beta.dia.uniroma3.it
+193.204.161.138 #gamma.dia.uniroma3.it
+>italia #Italian public AFS cell
+193.204.5.9 #afs.caspur.it
+>cmf.nrl.navy.mil #Naval Research Lab - CCS
+134.207.10.68 #picard.cmf.nrl.navy.mil
+134.207.10.69 #riker.cmf.nrl.navy.mil
+134.207.10.70 #kirk.cmf.nrl.navy.mil
+>lcp.nrl.navy.mil #Naval Research Lab - Lab for Computational Physics
+132.250.114.2 #afs1.lcp.nrl.navy.mil
+132.250.114.4 #afs2.lcp.nrl.navy.mil
+132.250.114.6 #afs3.lcp.nrl.navy.mil
+>es.net #Energy Sciences Net
+198.128.3.21 #fs1.es.net
+198.128.3.22 #fs2.es.net
+198.128.3.23 #fs3.es.net
+>laroia.net #Laroia Networks
+66.66.102.254 #supercore.laroia.net
+>sinenomine.net #Sine Nomine Associates
+66.92.236.139 #afs.sinenomine.net
+>slackers.net #The Slackers' Network
+63.201.48.27 #alexandria.slackers.net
+>nikhef.nl #The Dutch National Institute for High Energy Physics
+192.16.185.26 #afs1.nikhef.nl
+192.16.185.27 #afs2.nikhef.nl
+>1ts.org #KCR/private Karl Ramm, Cambridge, MA
+4.36.43.102 #dol-guldur.1ts.org
+>bazquux.org #Baz Quux Organization
+66.207.142.196 #baxquux.org
+>coed.org #Adam Pennington's Cell
+66.93.61.184 #vice1.coed.org
+128.2.4.163 #vice3.coed.org
+>dementia.org #Dementia Unlimited
+128.2.12.45 #alycia.dementia.org
+128.2.120.216 #meredith.dementia.org
+>hackish.org #Hackish.org
+24.167.65.213 #avatar.sys.hackish.org
+128.2.120.138 #kurma.sys.hackish.org
+>idahofuturetruck.org #University of Idaho hybrid vehicle development
+12.18.238.210 #dsle210.fsr.net
+>nimlabs.org #Nimlabs, Ink. Cell.
+18.238.1.103 #olfin.nimlabs.org
+18.238.1.105 #caerbanog.nimlabs.org
+>nomh.org #nomh.org
+204.29.154.12 #iota.nomh.org
+204.29.154.32 #adversity.xi.nomh.org
+>oc7.org #The OC7 Project
+128.2.6.107 #vice3.oc7.org
+128.2.122.140 #vice2.oc7.org
+>openafs.org #OpenAFS Project
+128.2.13.199 #new-virtue.openafs.org
+128.2.121.218 #virtue.openafs.org
+130.237.48.87 #andrew.e.kth.se
+130.237.48.107 #onyx.e.kth.se
+>e.kth.se #Royal Institute of Technology, Elektro
+130.237.32.145 #sonen.e.kth.se
+130.237.48.7 #anden.e.kth.se
+130.237.48.244 #fadern.e.kth.se
+>hallf.kth.se #Royal Institute of Technology, HALLF
+130.237.24.141 #rasmus13.hallf.kth.se
+130.237.24.152 #rasmus3.hallf.kth.se
+130.237.24.177 #rasmus29.hallf.kth.se
+>isk.kth.se #Royal Institute of Technology, ISK
+130.237.202.12 #afsdb2.isk.kth.se
+130.237.206.13 #afsdb1.isk.kth.se
+130.237.209.141 #afsdb3.isk.kth.se
+>it.kth.se #Royal Institute of Technology, IT
+130.237.212.15 #ptah.it.kth.se
+130.237.212.16 #toth.it.kth.se
+130.237.215.7 #isis.it.kth.se
+>md.kth.se #Royal Institute of Technology, MMK
+130.237.57.68 #trinity.md.kth.se
+130.237.57.72 #morpheus.md.kth.se
+130.237.67.230 #neo.speech.kth.se
+>mech.kth.se #Royal Institute of Technology, MECH
+130.237.233.143 #castor.mech.kth.se
+130.237.233.144 #pollux.mech.kth.se
+>nada.kth.se #Royal Institute of Technology, NADA
+130.237.222.20 #kosmos.nada.kth.se
+130.237.223.12 #sputnik.nada.kth.se
+130.237.224.78 #mir.nada.kth.se
+130.237.227.23 #gagarin.nada.kth.se
+130.237.228.28 #laika.nada.kth.se
+>pdc.kth.se #Royal Institute of Technology, PDC
+130.237.232.29 #crab.pdc.kth.se
+130.237.232.112 #anna.pdc.kth.se
+130.237.232.114 #hokkigai.pdc.kth.se
+>stacken.kth.se #Stacken Computer Club
+130.237.234.3 #milko.stacken.kth.se
+130.237.234.43 #hot.stacken.kth.se
+130.237.237.230 #fishburger.stacken.kth.se
+>syd.kth.se #Royal Institute of Technology, KTH-Syd
+130.237.83.23 #afs.haninge.kth.se
+>physto.se #Physics department Stockholm University
+130.237.205.36 #sysafs1.physto.se
+130.237.205.72 #sysafs2.physto.se
+>sanchin.se #Sanchin Consulting AB, Sweden
+192.195.148.10 #sesan.sanchin.se
+>su.se #Stockholm University
+130.237.162.81 #afsdb1.su.se
+130.237.162.82 #afsdb2.su.se
+130.237.162.230 #afsdb3.su.se
+>f9.ijs.si #F9, Jozef Stefan Institue
+194.249.156.1 #brenta.ijs.si
+>p-ng.si #Nova Gorica Polytechnic
+193.2.120.2 #solkan.p-ng.si
+>phy.bris.ac.uk #Bristol University - phyics
+137.222.58.9 #afs1.phy.bris.ac.uk
+>hep.man.ac.uk #Manchester HEP
+194.36.2.3 #afs1.hep.man.ac.uk
+194.36.2.4 #afs2.hep.man.ac.uk
+194.36.2.5 #afs3.hep.man.ac.uk
+>rl.ac.uk #Rutherford Appleton Lab, England
+130.246.183.164 #wallace.cc.rl.ac.uk
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/AIX/osi_config.c,v 1.8 2003/07/15 23:14:16 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/AIX/osi_config.c,v 1.8.2.1 2004/08/25 07:16:15 shadow Exp $");
#include "sys/limits.h"
#include "sys/types.h"
*/
if (err == ENOENT)
err = 0;
- else if (!err) {
+#ifndef AFS_AIX51_ENV
+ else
+#endif
+ if (!err) {
+#ifdef AFS_AIX51_ENV
+ if (err = unpin(&afs_callout_lock))
+ err = 0;
+#endif
if (err = unpincode(afs_config))
err = 0;
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/AIX/osi_inode.c,v 1.8 2003/07/15 23:14:17 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/AIX/osi_inode.c,v 1.8.2.1 2004/08/25 07:16:15 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
ip = 0;
goto out;
}
- IREAD_UNLOCK(ip);
if (vpp) {
if (nvfsp)
*vpp = ip->i_gnode.gn_vnode;
else
setuerror(iptovp(vfsp, ip, vpp));
}
+ IREAD_UNLOCK(ip);
out:
return ip;
}
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/AIX/osi_vfsops.c,v 1.11 2003/07/15 23:14:17 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/AIX/osi_vfsops.c,v 1.11.2.1 2004/08/25 07:16:15 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
struct vfs *afs_globalVFS = 0;
struct vcache *afs_globalVp = 0;
+extern int afs_cold_shutdown;
static int afs_root_nolock(struct vfs *afsp, struct vnode **avpp);
afsp->vfs_mntdover->v_mvfsp = afsp;
afsp->vfs_mdata->vmt_flags |= MNT_REMOTE;
+#ifdef AFS_AIX51_ENV
+ afsp->vfs_count = 1;
+ afsp->vfs_mntd->v_count = 1;
+#endif
#ifdef AFS_AIX_IAUTH_ENV
if (afs_iauth_register() < 0)
afs_warn("Can't register AFS iauth interface.\n");
AFS_STATCNT(afs_unmount);
afs_globalVFS = 0;
+ afs_cold_shutdown = 1;
afs_shutdown();
AFS_VFSUNLOCK();
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/IRIX/osi_idbg.c,v 1.6 2003/07/15 23:14:23 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/IRIX/osi_idbg.c,v 1.6.2.1 2004/08/25 07:09:34 shadow Exp $");
#ifdef AFS_SGI62_ENV
#include "afs/sysincludes.h" /* Standard vendor system headers */
int
idbg_prafsnode(OSI_VC_DECL(avc))
{
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
- AFS_GLOCK();
+ AFS_GLOCK();
qprintf(" Len %d DV %d Date %d Own %d Grp %d Mode 0%o Lnk %d\n",
avc->m.Length, avc->m.DataVersion, avc->m.Date, avc->m.Owner,
avc->m.Group, avc->m.Mode, avc->m.LinkCount);
#undef OSI_VN_DECL
#define OSI_VN_DECL(V) bhv_desc_t *bhv_##V
#undef OSI_VN_CONVERT
-#define OSI_VN_CONVERT(V) struct vnode * V = (struct vnode*)BHV_TO_VNODE(bhv_##V);
+#define OSI_VN_CONVERT(V) struct vnode * V = (struct vnode*)BHV_TO_VNODE(bhv_##V)
#undef OSI_VC_ARG
#define OSI_VC_ARG(V) bhv_##V
#undef OSI_VC_DECL
#define OSI_VC_DECL(V) bhv_desc_t *bhv_##V
#undef OSI_VC_CONVERT
-#define OSI_VC_CONVERT(V) struct vcache * V = VTOAFS(BHV_TO_VNODE(bhv_##V));
+#define OSI_VC_CONVERT(V) struct vcache * V = VTOAFS(BHV_TO_VNODE(bhv_##V))
#undef OSI_VFS_ARG
#define OSI_VFS_ARG(V) bhv_##V
#undef OSI_VFS_DECL
#define OSI_VFS_DECL(V) bhv_desc_t *bhv_##V
#undef OSI_VFS_CONVERT
-#define OSI_VFS_CONVERT(V) struct vfs * V = (struct vfs*)bhvtovfs(bhv_##V);
+#define OSI_VFS_CONVERT(V) struct vfs * V = (struct vfs*)bhvtovfs(bhv_##V)
#endif /* AFS_SGI64_ENV */
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/IRIX/osi_vfsops.c,v 1.13 2003/07/15 23:14:23 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/IRIX/osi_vfsops.c,v 1.13.2.1 2004/08/25 07:09:34 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
register struct afs_q *tq;
struct afs_q *uq;
int error, fv_slept;
- OSI_VFS_CONVERT(afsp)
+ OSI_VFS_CONVERT(afsp);
- AFS_STATCNT(afs_unmount);
+ AFS_STATCNT(afs_unmount);
if (!suser())
return EPERM;
register afs_int32 code = 0;
struct vrequest treq;
register struct vcache *tvp = 0;
- OSI_VFS_CONVERT(afsp)
+ OSI_VFS_CONVERT(afsp);
- AFS_STATCNT(afs_root);
+ AFS_STATCNT(afs_root);
if (afs_globalVp && (afs_globalVp->states & CStatd)) {
tvp = afs_globalVp;
} else {
struct statvfs *abp;
struct vnode *avp; /* unused */
{
- OSI_VFS_CONVERT(afsp)
+ OSI_VFS_CONVERT(afsp);
- AFS_STATCNT(afs_statfs);
+ AFS_STATCNT(afs_statfs);
abp->f_bsize = afsp->vfs_bsize;
abp->f_frsize = afsp->vfs_bsize;
/* Fake a high number below to satisfy programs that use the statfs
register struct afs_q *tq;
struct afs_q *uq;
int s;
- OSI_VFS_CONVERT(afsp)
+ OSI_VFS_CONVERT(afsp);
- error = lasterr = 0;
+ error = lasterr = 0;
/*
* if not interested in vnodes, skip all this
*/
afs_fid2_t *afid2;
#endif
- OSI_VFS_CONVERT(afsp)
+ OSI_VFS_CONVERT(afsp);
- AFS_STATCNT(afs_vget);
+ AFS_STATCNT(afs_vget);
*avcp = NULL;
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/IRIX/osi_vnodeops.c,v 1.14 2003/07/15 23:14:23 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/IRIX/osi_vnodeops.c,v 1.14.2.1 2004/08/25 07:09:34 shadow Exp $");
#ifdef AFS_SGI62_ENV
#include "afs/sysincludes.h" /* Standard vendor system headers */
cred_t * cr)
{
int error;
- OSI_VN_CONVERT(vp)
+ OSI_VN_CONVERT(vp);
#ifdef AFS_SGI65_ENV
struct flid flid;
int pid;
struct cred *cr;
{
int code;
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
- osi_Assert(avc->v.v_count > 0);
+ osi_Assert(avc->v.v_count > 0);
if (avc->v.v_type != VREG)
return EISDIR;
struct cred *cr;
{
int code;
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
- osi_Assert(avc->v.v_count > 0);
+ osi_Assert(avc->v.v_count > 0);
if (avc->v.v_type != VREG)
return EISDIR;
int bsize; /* server's block size in bytes */
off_t off;
size_t rem, cnt;
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
- bsize = AFSBSIZE;
+ bsize = AFSBSIZE;
off = offset % bsize; /* offset into block */
bmv->bn = BTOBBT(offset - off);
bmv->offset = bmv->bn;
iovec_t aiovec;
int error;
struct cred *cr;
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
vnode_t *vp = (vnode_t *) avc;
/*
u_int flags;
struct cred *cr;
{
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
struct vnode *vp = AFSTOV(avc);
if (vp->v_flag & VNOMAP)
u_int flags;
struct cred *acred;
{
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
struct vnode *vp = AFSTOV(avc);
register struct brequest *tb;
struct vrequest treq;
struct cred *cr;
#endif
{
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
struct vnode *vp = AFSTOV(avc);
struct vrequest treq;
int error;
struct ucred *acred;
{
int s;
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
vnode_t *vp = (vnode_t *) avc;
int mapcnt = avc->mapcnt; /* We just clear off this many. */
void
afs_rwlock(OSI_VN_DECL(vp), AFS_RWLOCK_T flag)
{
- OSI_VN_CONVERT(vp)
+ OSI_VN_CONVERT(vp);
struct vcache *avc = VTOAFS(vp);
if (OSI_GET_LOCKID() == avc->vc_rwlockid) {
void
afs_rwunlock(OSI_VN_DECL(vp), AFS_RWLOCK_T flag)
{
- OSI_VN_CONVERT(vp)
+ OSI_VN_CONVERT(vp);
struct vcache *avc = VTOAFS(vp);
AFS_ASSERT_GLOCK();
{
struct cell *tcell;
afs_fid2_t *afid = (afs_fid2_t *) fidp;
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
- osi_Assert(sizeof(fid_t) >= sizeof(afs_fid2_t));
+ osi_Assert(sizeof(fid_t) >= sizeof(afs_fid2_t));
afid->af_len = sizeof(afs_fid2_t) - sizeof(afid->af_len);
tcell = afs_GetCell(avc->fid.Cell, READ_LOCK);
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/LINUX/osi_module.c,v 1.52 2004/06/21 21:46:17 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/LINUX/osi_module.c,v 1.52.2.1 2004/08/25 07:03:36 shadow Exp $");
#include "afs/sysincludes.h"
#include "afsincludes.h"
#endif
asmlinkage long (*sys_setgroupsp) (int gidsetsize, gid_t * grouplist);
#ifdef EXPORTED_SYS_CALL_TABLE
-#ifdef AFS_SPARC64_LINUX20_ENV
-extern unsigned int sys_call_table[]; /* changed to uint because SPARC64 has syscaltable of 32bit items */
+#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_S390X_LINUX24_ENV)
+extern unsigned int sys_call_table[]; /* changed to uint because SPARC64 and S390X have syscalltable of 32bit items */
#else
extern void *sys_call_table[]; /* safer for other linuces */
#endif
#else /* EXPORTED_SYS_CALL_TABLE */
-#ifdef AFS_SPARC64_LINUX20_ENV
-static unsigned int *sys_call_table; /* changed to uint because SPARC64 has syscaltable of 32bit items */
+#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_S390X_LINUX24_ENV)
+static unsigned int *sys_call_table; /* changed to uint because SPARC64 and S390X have syscalltable of 32bit items */
#else
static void **sys_call_table; /* safer for other linuces */
#endif
#endif
+
+#if defined(AFS_S390X_LINUX24_ENV)
+#define _S(x) ((x)<<1)
+#else
+#define _S(x) x
+#endif
+
extern struct file_system_type afs_fs_type;
static long get_page_offset(void);
/* Since sys_ni_syscall is not exported, I need to cache it in order to restore
* it.
*/
-#ifdef AFS_SPARC64_LINUX20_ENV
+#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_S390X_LINUX24_ENV)
static unsigned int afs_ni_syscall = 0;
#else
static void *afs_ni_syscall = 0;
__kernel_gid32_t * grouplist);
#endif /* AFS_LINUX24_ENV */
-#ifdef AFS_SPARC64_LINUX20_ENV
+#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_S390X_LINUX24_ENV)
#define POINTER2SYSCALL (unsigned int)(unsigned long)
#define SYSCALL2POINTER (void *)(long)
#else
printf("Failed to find address of sys_call_table\n");
} else {
printf("Found sys_call_table at %x\n", sys_call_table);
-#ifdef AFS_SPARC64_LINUX20_ENV
+#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_S390X_LINUX24_ENV)
error cant support this yet.;
#endif /* AFS_SPARC64_LINUX20_ENV */
#endif /* EXPORTED_SYS_CALL_TABLE */
/* Initialize pointers to kernel syscalls. */
#if !defined(AFS_LINUX24_ENV)
- sys_settimeofdayp = SYSCALL2POINTER sys_call_table[__NR_settimeofday];
+ sys_settimeofdayp = SYSCALL2POINTER sys_call_table[_S(__NR_settimeofday)];
#endif /* AFS_IA64_LINUX20_ENV */
/* setup AFS entry point. */
#if defined(AFS_IA64_LINUX20_ENV)
SYSCALL2POINTER sys_call_table[__NR_afs_syscall - 1024]
#else
- SYSCALL2POINTER sys_call_table[__NR_afs_syscall]
+ SYSCALL2POINTER sys_call_table[_S(__NR_afs_syscall)]
#endif
== afs_syscall) {
printf("AFS syscall entry point already in use!\n");
sys_call_table[__NR_afs_syscall - 1024] =
POINTER2SYSCALL((struct fptr *)afs_syscall_stub)->ip;
#else /* AFS_IA64_LINUX20_ENV */
- afs_ni_syscall = sys_call_table[__NR_afs_syscall];
- sys_call_table[__NR_afs_syscall] = POINTER2SYSCALL afs_syscall;
+ afs_ni_syscall = sys_call_table[_S(__NR_afs_syscall)];
+ sys_call_table[_S(__NR_afs_syscall)] = POINTER2SYSCALL afs_syscall;
#ifdef AFS_SPARC64_LINUX20_ENV
afs_ni_syscall32 = sys_call_table32[__NR_afs_syscall];
sys_call_table32[__NR_afs_syscall] = POINTER2SYSCALL afs_syscall32;
sys_call_table[__NR_setgroups - 1024] =
POINTER2SYSCALL((struct fptr *)afs_xsetgroups_stub)->ip;
#else /* AFS_IA64_LINUX20_ENV */
- sys_setgroupsp = SYSCALL2POINTER sys_call_table[__NR_setgroups];
- sys_call_table[__NR_setgroups] = POINTER2SYSCALL afs_xsetgroups;
+ sys_setgroupsp = SYSCALL2POINTER sys_call_table[_S(__NR_setgroups)];
+ sys_call_table[_S(__NR_setgroups)] = POINTER2SYSCALL afs_xsetgroups;
#ifdef AFS_SPARC64_LINUX20_ENV
sys32_setgroupsp = SYSCALL2POINTER sys_call_table32[__NR_setgroups];
sys_call_table32[__NR_setgroups] = POINTER2SYSCALL afs32_xsetgroups;
POINTER2SYSCALL((struct fptr *)sys_setgroupsp)->ip;
sys_call_table[__NR_afs_syscall - 1024] = afs_ni_syscall;
#else /* AFS_IA64_LINUX20_ENV */
- sys_call_table[__NR_setgroups] = POINTER2SYSCALL sys_setgroupsp;
- sys_call_table[__NR_afs_syscall] = afs_ni_syscall;
+ sys_call_table[_S(__NR_setgroups)] = POINTER2SYSCALL sys_setgroupsp;
+ sys_call_table[_S(__NR_afs_syscall)] = afs_ni_syscall;
# ifdef AFS_SPARC64_LINUX20_ENV
sys_call_table32[__NR_setgroups] = POINTER2SYSCALL sys32_setgroupsp;
sys_call_table32[__NR_afs_syscall] = afs_ni_syscall32;
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81 2004/07/21 22:23:38 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.2 2004/08/25 07:10:39 shadow Exp $");
#include "afs/sysincludes.h"
#include "afsincludes.h"
#include "afs/afs_stats.h"
#include "afs/afs_osidnlc.h"
#include "h/mm.h"
+#ifdef HAVE_MM_INLINE_H
+#include "h/mm_inline.h"
+#endif
#include "h/pagemap.h"
#if defined(AFS_LINUX24_ENV)
#include "h/smp_lock.h"
printk
("afs_linux_lookup: ip->i_mode 0x%x dp->d_name.name %s code %d\n",
ip->i_mode, dp->d_name.name, code);
+#ifdef STRUCT_INODE_HAS_I_SECURITY
+ if (ip->i_security == NULL) {
+ if (security_inode_alloc(ip))
+ panic("afs_linux_lookup: Cannot allocate inode security");
+ }
+#endif
#else
if (S_ISDIR(ip->i_mode))
ip->i_op = &afs_dir_iops;
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/UKERNEL/afs_usrops.c,v 1.27 2004/05/20 19:15:04 kolya Exp $");
+ ("$Header: /cvs/openafs/src/afs/UKERNEL/afs_usrops.c,v 1.27.2.1 2004/08/25 07:15:34 shadow Exp $");
#ifdef UKERNEL
{
/* parse multihomed address files */
char reason[1024];
- st = parseNetFiles(buffer, maskbuffer, mtubuffer, MAXIPADDRS, reason,
+ st = parseNetFiles((afs_uint32*)buffer,(afs_uint32*) maskbuffer, (afs_uint32*)mtubuffer, MAXIPADDRS, reason,
AFSDIR_CLIENT_NETINFO_FILEPATH,
AFSDIR_CLIENT_NETRESTRICT_FILEPATH);
if (st > 0)
/*
* We need execute permission to search a directory
*/
- code = afs_access(vp, VEXEC, u.u_cred);
+ code = afs_access(VTOAFS(vp), VEXEC, u.u_cred);
if (code != 0) {
VN_RELE(vp);
afs_osi_Free(tmpPath, strlen(path) + 1);
struct usr_vattr attrs;
char *nameP;
+ struct vcache* vc;
+
if (uafs_IsRoot(path)) {
fileP = afs_RootVnode;
VN_HOLD(fileP);
attrs.va_size = 0;
}
fileP = NULL;
+ vc=VTOAFS(fileP);
code =
- afs_create(dirP, nameP, &attrs,
+ afs_create(VTOAFS(dirP), nameP, &attrs,
(flags & O_EXCL) ? usr_EXCL : usr_NONEXCL, mode,
- &fileP, u.u_cred);
+ &vc, u.u_cred);
VN_RELE(dirP);
if (code != 0) {
errno = code;
}
if (!fileMode)
fileMode = VREAD; /* since O_RDONLY is 0 */
- code = afs_access(fileP, fileMode, u.u_cred);
+ code = afs_access(VTOAFS(fileP), fileMode, u.u_cred);
if (code != 0) {
VN_RELE(fileP);
errno = code;
/*
* Get the file attributes, all we need is the size
*/
- code = afs_getattr(fileP, &attrs, u.u_cred);
+ code = afs_getattr(VTOAFS(fileP), &attrs, u.u_cred);
if (code != 0) {
VN_RELE(fileP);
errno = code;
if ((flags & O_TRUNC) && (attrs.va_size != 0)) {
usr_vattr_null(&attrs);
attrs.va_size = 0;
- code = afs_setattr(fileP, &attrs, u.u_cred);
+ code = afs_setattr(VTOAFS(fileP), &attrs, u.u_cred);
if (code != 0) {
VN_RELE(fileP);
errno = code;
}
}
+ vc=VTOAFS(fileP);
/*
* do the open
*/
- code = afs_open(&fileP, openFlags, u.u_cred);
+ code = afs_open(&vc, openFlags, u.u_cred);
if (code != 0) {
VN_RELE(fileP);
errno = code;
* do the write
*/
- code = afs_write(fileP, &uio, afs_FileFlags[fd], u.u_cred, 0);
+ code = afs_write(VTOAFS(fileP), &uio, afs_FileFlags[fd], u.u_cred, 0);
if (code) {
errno = code;
return -1;
/*
* do the read
*/
- code = afs_read(fileP, &uio, u.u_cred, 0, &bufP, 0);
+ code = afs_read(VTOAFS(fileP), &uio, u.u_cred, 0, &bufP, 0);
if (code) {
errno = code;
return -1;
/*
* Get the attributes
*/
- code = afs_getattr(vp, &attrs, u.u_cred);
+ code = afs_getattr(VTOAFS(vp), &attrs, u.u_cred);
if (code != 0) {
return code;
}
}
usr_vattr_null(&attrs);
attrs.va_mode = mode;
- code = afs_setattr(vp, &attrs, u.u_cred);
+ code = afs_setattr(VTOAFS(vp), &attrs, u.u_cred);
VN_RELE(vp);
if (code != 0) {
errno = code;
}
usr_vattr_null(&attrs);
attrs.va_mode = mode;
- code = afs_setattr(vp, &attrs, u.u_cred);
+ code = afs_setattr(VTOAFS(vp), &attrs, u.u_cred);
if (code != 0) {
errno = code;
return -1;
}
usr_vattr_null(&attrs);
attrs.va_size = length;
- code = afs_setattr(vp, &attrs, u.u_cred);
+ code = afs_setattr(VTOAFS(vp), &attrs, u.u_cred);
VN_RELE(vp);
if (code != 0) {
errno = code;
}
usr_vattr_null(&attrs);
attrs.va_size = length;
- code = afs_setattr(vp, &attrs, u.u_cred);
+ code = afs_setattr(VTOAFS(vp), &attrs, u.u_cred);
if (code != 0) {
errno = code;
return -1;
newpos = offset;
break;
case SEEK_END:
- code = afs_getattr(vp, &attrs, u.u_cred);
+ code = afs_getattr(VTOAFS(vp), &attrs, u.u_cred);
if (code != 0) {
errno = code;
return -1;
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/UKERNEL/osi_vfsops.c,v 1.10 2003/07/15 23:14:29 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/UKERNEL/osi_vfsops.c,v 1.10.2.1 2004/08/25 07:09:34 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
register afs_int32 code = 0;
struct vrequest treq;
register struct vcache *tvp = 0;
- OSI_VFS_CONVERT(afsp)
+ OSI_VFS_CONVERT(afsp);
- AFS_STATCNT(afs_root);
+ AFS_STATCNT(afs_root);
if (afs_globalVp && (afs_globalVp->states & CStatd)) {
tvp = afs_globalVp;
} else {
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_access.c,v 1.10 2003/07/15 23:14:29 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_access.c,v 1.10.2.1 2004/08/25 07:09:35 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
register afs_int32 code;
struct vrequest treq;
struct afs_fakestat_state fakestate;
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
- AFS_STATCNT(afs_access);
+ AFS_STATCNT(afs_access);
afs_Trace3(afs_iclSetp, CM_TRACE_ACCESS, ICL_TYPE_POINTER, avc,
ICL_TYPE_INT32, amode, ICL_TYPE_OFFSET,
ICL_HANDLE_OFFSET(avc->m.Length));
{
register afs_int32 code;
struct vrequest treq;
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
- if (code = afs_InitReq(&treq, acred))
+ if (code = afs_InitReq(&treq, acred))
return code;
code = afs_VerifyVCache(avc, &treq);
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.27 2003/10/24 06:26:04 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.27.2.1 2004/08/25 07:09:35 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
}
#if defined(AFS_DARWIN_ENV)
{
- extern u_int32_t afs_darwin_realmodes;
+ extern u_int32_t afs_darwin_realmodes;
if (!afs_darwin_realmodes) {
/* Mac OS X uses the mode bits to determine whether a file or
* directory is accessible, and believes them, even though under
* conservatively.
*/
if (S_ISDIR(attrs->va_mode)) {
- /* all access bits need to be set for directories, since even
+ /* all access bits need to be set for directories, since even
* a mode 0 directory can still be used normally.
*/
- attrs->va_mode |= ACCESSPERMS;
+ attrs->va_mode |= ACCESSPERMS;
} else {
- /* for other files, replicate the user bits to group and other */
- mode_t ubits = (attrs->va_mode & S_IRWXU) >> 6;
+ /* for other files, replicate the user bits to group and other */
+ mode_t ubits = (attrs->va_mode & S_IRWXU) >> 6;
attrs->va_mode |= ubits | (ubits << 3);
}
}
attrs->va_fsid = avc->v.v_mount->m_stat.f_fsid.val[0];
#else
#ifdef AFS_DARWIN70_ENV
- attrs->va_fsid = avc->v.v_mount->mnt_stat.f_fsid.val[0];
+ attrs->va_fsid = avc->v.v_mount->mnt_stat.f_fsid.val[0];
#else /* ! AFS_DARWIN70_ENV */
attrs->va_fsid = 1;
#endif /* AFS_DARWIN70_ENV */
extern struct unixuser *afs_FindUser();
struct unixuser *au;
int inited = 0;
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
- AFS_STATCNT(afs_getattr);
+ AFS_STATCNT(afs_getattr);
afs_Trace2(afs_iclSetp, CM_TRACE_GETATTR, ICL_TYPE_POINTER, avc,
ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
struct AFSStoreStatus astat;
register afs_int32 code;
struct afs_fakestat_state fakestate;
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
- AFS_STATCNT(afs_setattr);
+ AFS_STATCNT(afs_setattr);
#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
afs_Trace4(afs_iclSetp, CM_TRACE_SETATTR, ICL_TYPE_POINTER, avc,
ICL_TYPE_INT32, attrs->va_mask, ICL_TYPE_OFFSET,
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_create.c,v 1.16 2003/07/15 23:14:30 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_create.c,v 1.16.2.1 2004/08/25 07:09:35 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
struct vcache *tvc;
struct volume *volp = 0;
struct afs_fakestat_state fakestate;
- XSTATS_DECLS OSI_VC_CONVERT(adp)
+ XSTATS_DECLS;
+ OSI_VC_CONVERT(adp);
- AFS_STATCNT(afs_create);
+ AFS_STATCNT(afs_create);
if ((code = afs_InitReq(&treq, acred)))
goto done2;
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_dirops.c,v 1.14 2003/08/29 22:00:04 rees Exp $");
+ ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_dirops.c,v 1.14.2.1 2004/08/25 07:09:35 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
struct ucred *acred = ndp->ni_cred;
#else /* AFS_OSF_ENV */
afs_mkdir(OSI_VC_ARG(adp), aname, attrs, avcp, acred)
- OSI_VC_DECL(adp);
+ OSI_VC_DECL(adp);
register struct vcache **avcp;
char *aname;
struct vattr *attrs;
struct AFSVolSync tsync;
afs_int32 now;
struct afs_fakestat_state fakestate;
- XSTATS_DECLS OSI_VC_CONVERT(adp)
+ XSTATS_DECLS;
+ OSI_VC_CONVERT(adp);
- AFS_STATCNT(afs_mkdir);
+ AFS_STATCNT(afs_mkdir);
afs_Trace2(afs_iclSetp, CM_TRACE_MKDIR, ICL_TYPE_POINTER, adp,
ICL_TYPE_STRING, aname);
#else
afs_rmdir(adp, aname, acred)
#endif
- OSI_VC_DECL(adp);
+ OSI_VC_DECL(adp);
char *aname;
struct AFS_UCRED *acred;
{
struct AFSFetchStatus OutDirStatus;
struct AFSVolSync tsync;
struct afs_fakestat_state fakestate;
- XSTATS_DECLS OSI_VC_CONVERT(adp)
+ XSTATS_DECLS;
+ OSI_VC_CONVERT(adp);
- AFS_STATCNT(afs_rmdir);
+ AFS_STATCNT(afs_rmdir);
afs_Trace2(afs_iclSetp, CM_TRACE_RMDIR, ICL_TYPE_POINTER, adp,
ICL_TYPE_STRING, aname);
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_fid.c,v 1.11 2003/07/15 23:14:30 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_fid.c,v 1.11.2.1 2004/08/25 07:09:35 shadow Exp $");
#if !defined(AFS_DUX40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_OBSD_ENV)
#include "afs/sysincludes.h" /* Standard vendor system headers */
#else
afs_fid(OSI_VC_ARG(avc), fidpp)
#endif /* AFS_AIX41_ENV */
-OSI_VC_DECL(avc);
+ OSI_VC_DECL(avc);
#if defined(AFS_AIX_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN54_ENV)
struct fid *fidpp;
#else
extern struct vcache *afs_globalVp;
int SizeOfSmallFid = SIZEOF_SMALLFID;
int rootvp = 0;
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
- AFS_STATCNT(afs_fid);
+ AFS_STATCNT(afs_fid);
if (afs_shuttingdown)
return EIO;
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.24 2003/07/15 23:14:30 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.24.2.1 2004/08/25 07:09:35 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
struct AFSVolSync tsync;
afs_int32 lockType;
struct AFS_FLOCK flock;
- XSTATS_DECLS AFS_STATCNT(HandleFlock);
+ XSTATS_DECLS;
+ AFS_STATCNT(HandleFlock);
code = 0; /* default when we don't make any network calls */
lockIdSet(&flock, NULL, clid);
struct AFSCallBack CallBack;
struct AFSVolSync tsync;
int temp;
- XSTATS_DECLS temp = areq->flags & O_NONBLOCK;
+ XSTATS_DECLS;
+ temp = areq->flags & O_NONBLOCK;
areq->flags |= O_NONBLOCK;
do {
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_link.c,v 1.15 2003/08/29 22:00:04 rees Exp $");
+ ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_link.c,v 1.15.2.1 2004/08/25 07:09:35 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
#else
afs_link(avc, OSI_VC_ARG(adp), aname, acred)
#endif
- OSI_VC_DECL(adp);
+ OSI_VC_DECL(adp);
struct vcache *avc;
char *aname;
struct AFS_UCRED *acred;
struct AFSFetchStatus OutFidStatus, OutDirStatus;
struct AFSVolSync tsync;
struct afs_fakestat_state vfakestate, dfakestate;
- XSTATS_DECLS OSI_VC_CONVERT(adp)
+ XSTATS_DECLS;
+ OSI_VC_CONVERT(adp);
- AFS_STATCNT(afs_link);
+ AFS_STATCNT(afs_link);
afs_Trace3(afs_iclSetp, CM_TRACE_LINK, ICL_TYPE_POINTER, adp,
ICL_TYPE_POINTER, avc, ICL_TYPE_STRING, aname);
/* create a hard link; new entry is aname in dir adp */
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.50 2004/03/17 06:43:36 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.50.2.1 2004/08/25 07:09:35 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
static int
afs_getsysname(register struct vrequest *areq, register struct vcache *adp,
- register char *bufp, int *num, char **sysnamelist[])
+ register char *bufp, int *num, char **sysnamelist[])
{
register struct unixuser *au;
register afs_int32 error;
*sysnamelist = afs_sysnamelist;
- if (!afs_nfsexporter)
- strcpy(bufp, (*sysnamelist)[0]);
+ if (!afs_nfsexporter)
+ strcpy(bufp, (*sysnamelist)[0]);
else {
- au = afs_GetUser(areq->uid, adp->fid.Cell, 0);
- if (au->exporter) {
- error = EXP_SYSNAME(au->exporter, (char *)0, sysnamelist, num);
- if (error) {
- strcpy(bufp, "@sys");
- afs_PutUser(au, 0);
- return -1;
- } else {
- strcpy(bufp, (*sysnamelist)[0]);
- }
- } else
- strcpy(bufp, afs_sysname);
- afs_PutUser(au, 0);
+ au = afs_GetUser(areq->uid, adp->fid.Cell, 0);
+ if (au->exporter) {
+ error = EXP_SYSNAME(au->exporter, (char *)0, sysnamelist, num);
+ if (error) {
+ strcpy(bufp, "@sys");
+ afs_PutUser(au, 0);
+ return -1;
+ } else {
+ strcpy(bufp, (*sysnamelist)[0]);
+ }
+ } else
+ strcpy(bufp, afs_sysname);
+ afs_PutUser(au, 0);
}
return 0;
}
void
-Check_AtSys(register struct vcache *avc, char *aname,
- struct sysname_info *state, struct vrequest *areq)
+Check_AtSys(register struct vcache *avc, char *aname,
+ struct sysname_info *state, struct vrequest *areq)
{
int num = 0;
char **sysnamelist[MAXSYSNAME];
state->offset = 0;
state->name = (char *)osi_AllocLargeSpace(AFS_SMALLOCSIZ);
state->allocked = 1;
- state->index = afs_getsysname(areq, avc, state->name, &num, sysnamelist);
+ state->index =
+ afs_getsysname(areq, avc, state->name, &num, sysnamelist);
} else {
state->offset = -1;
state->allocked = 0;
int
Next_AtSys(register struct vcache *avc, struct vrequest *areq,
- struct sysname_info *state)
+ struct sysname_info *state)
{
int num = afs_sysnamecount;
char **sysnamelist[MAXSYSNAME];
if (state->index == -1)
- return 0; /* No list */
+ return 0; /* No list */
- /* Check for the initial state of aname != "@sys" in Check_AtSys*/
+ /* Check for the initial state of aname != "@sys" in Check_AtSys */
if (state->offset == -1 && state->allocked == 0) {
- register char *tname;
-
- /* Check for .*@sys */
- for (tname=state->name; *tname; tname++)
- /*Move to the end of the string*/;
-
- if ((tname > state->name + 4) && (AFS_EQ_ATSYS(tname-4))) {
- state->offset = (tname - 4) - state->name;
- tname = (char *) osi_AllocLargeSpace(AFS_LRALLOCSIZ);
- strncpy(tname, state->name, state->offset);
- state->name = tname;
- state->allocked = 1;
- num = 0;
- state->index = afs_getsysname(areq, avc, state->name+state->offset,
- &num, sysnamelist);
- return 1;
- } else
- return 0; /* .*@sys doesn't match either */
+ register char *tname;
+
+ /* Check for .*@sys */
+ for (tname = state->name; *tname; tname++)
+ /*Move to the end of the string */ ;
+
+ if ((tname > state->name + 4) && (AFS_EQ_ATSYS(tname - 4))) {
+ state->offset = (tname - 4) - state->name;
+ tname = (char *)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
+ strncpy(tname, state->name, state->offset);
+ state->name = tname;
+ state->allocked = 1;
+ num = 0;
+ state->index =
+ afs_getsysname(areq, avc, state->name + state->offset, &num,
+ sysnamelist);
+ return 1;
+ } else
+ return 0; /* .*@sys doesn't match either */
} else {
- register struct unixuser *au;
- register afs_int32 error;
-
- *sysnamelist = afs_sysnamelist;
-
- if (afs_nfsexporter) {
- au = afs_GetUser(areq->uid, avc->fid.Cell, 0);
- if (au->exporter) {
- error = EXP_SYSNAME(au->exporter, (char *)0, sysnamelist, num);
- if (error) {
- return 0;
- }
- }
- afs_PutUser(au, 0);
- }
- if (++(state->index) >= num || !(*sysnamelist)[state->index])
- return 0; /* end of list */
+ register struct unixuser *au;
+ register afs_int32 error;
+
+ *sysnamelist = afs_sysnamelist;
+
+ if (afs_nfsexporter) {
+ au = afs_GetUser(areq->uid, avc->fid.Cell, 0);
+ if (au->exporter) {
+ error =
+ EXP_SYSNAME(au->exporter, (char *)0, sysnamelist, num);
+ if (error) {
+ return 0;
+ }
+ }
+ afs_PutUser(au, 0);
+ }
+ if (++(state->index) >= num || !(*sysnamelist)[state->index])
+ return 0; /* end of list */
}
- strcpy(state->name+state->offset, (*sysnamelist)[state->index]);
+ strcpy(state->name + state->offset, (*sysnamelist)[state->index]);
return 1;
}
#else
#if defined(AFS_HPUX1123_ENV)
/* DEE should use the new afs_inode_t for all */
-extern int BlobScan(ino_t *afile, afs_int32 ablob);
+extern int BlobScan(ino_t * afile, afs_int32 ablob);
#else
#if defined AFS_LINUX_64BIT_KERNEL
extern int BlobScan(long *afile, afs_int32 ablob);
struct VenusFid dotdot;
int flagIndex; /* First file with bulk fetch flag set */
int inlinebulk = 0; /* Did we use InlineBulk RPC or not? */
- XSTATS_DECLS
- /* first compute some basic parameters. We dont want to prefetch more
- * than a fraction of the cache in any given call, and we want to preserve
- * a portion of the LRU queue in any event, so as to avoid thrashing
- * the entire stat cache (we will at least leave some of it alone).
- * presently dont stat more than 1/8 the cache in any one call. */
- nentries = afs_cacheStats / 8;
+ XSTATS_DECLS;
+ /* first compute some basic parameters. We dont want to prefetch more
+ * than a fraction of the cache in any given call, and we want to preserve
+ * a portion of the LRU queue in any event, so as to avoid thrashing
+ * the entire stat cache (we will at least leave some of it alone).
+ * presently dont stat more than 1/8 the cache in any one call. */
+ nentries = afs_cacheStats / 8;
/* dont bother prefetching more than one calls worth of info */
if (nentries > AFSCBMAX)
afs_lookup(adp, aname, avcp, acred)
#endif /* UKERNEL */
#endif /* SUN5 || SGI */
-OSI_VC_DECL(adp);
+ OSI_VC_DECL(adp);
struct vcache **avcp;
char *aname;
struct AFS_UCRED *acred;
int pass = 0, hit = 0;
long dirCookie;
extern afs_int32 afs_mariner; /*Writing activity to log? */
- OSI_VC_CONVERT(adp)
+ OSI_VC_CONVERT(adp);
afs_hyper_t versionNo;
int no_read_access = 0;
struct sysname_info sysState; /* used only for @sys checking */
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.24 2004/08/09 00:54:05 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.24.2.1 2004/08/25 07:09:35 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
#else
#if defined(AFS_HPUX1123_ENV)
/*DEE should use afs_inode_t for all */
-int
-BlobScan(ino_t *afile, afs_int32 ablob)
+int
+BlobScan(ino_t * afile, afs_int32 ablob)
#else
#ifdef AFS_LINUX_64BIT_KERNEL
int
afs_readdir(OSI_VC_ARG(avc), auio, acred)
#endif
#endif
- OSI_VC_DECL(avc);
+ OSI_VC_DECL(avc);
struct uio *auio;
struct AFS_UCRED *acred;
{
#if defined(AFS_SGI53_ENV)
afs_int32 use64BitDirent, dirsiz;
#endif /* defined(AFS_SGI53_ENV) */
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
#ifdef AFS_HPUX_ENV
- /*
- * XXX All the hacks for alloced sdirEntry and inlining of afs_readdir_move instead of calling
- * it is necessary for hpux due to stack problems that seem to occur when coming thru the nfs
- * translator side XXX
- */
+ /*
+ * XXX All the hacks for alloced sdirEntry and inlining of afs_readdir_move instead of calling
+ * it is necessary for hpux due to stack problems that seem to occur when coming thru the nfs
+ * translator side XXX
+ */
struct min_direct *sdirEntry =
(struct min_direct *)osi_AllocSmallSpace(sizeof(struct min_direct));
afs_int32 rlen;
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.31 2004/06/23 22:25:06 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.31.2.1 2004/08/25 07:09:35 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
register struct conn *tc;
struct AFSFetchStatus OutDirStatus;
struct AFSVolSync tsync;
- XSTATS_DECLS
+ XSTATS_DECLS;
do {
tc = afs_Conn(&adp->fid, treqp, SHARED_LOCK);
if (tc) {
struct ucred *acred = ndp->ni_cred;
#else /* AFS_OSF_ENV */
afs_remove(OSI_VC_ARG(adp), aname, acred)
-OSI_VC_DECL(adp);
+ OSI_VC_DECL(adp);
char *aname;
struct AFS_UCRED *acred;
{
register struct vcache *tvc;
afs_size_t offset, len;
struct afs_fakestat_state fakestate;
- OSI_VC_CONVERT(adp)
+ OSI_VC_CONVERT(adp);
- AFS_STATCNT(afs_remove);
+ AFS_STATCNT(afs_remove);
afs_Trace2(afs_iclSetp, CM_TRACE_REMOVE, ICL_TYPE_POINTER, adp,
ICL_TYPE_STRING, aname);
#endif
return code;
}
-
#if 0
if (adp->mvstat == 2) {
afs_PutFakeStat(&fakestate);
#ifdef AFS_OSF_ENV
- afs_PutVCache(adp);
+ afs_PutVCache(adp);
afs_PutVCache(tvc);
#endif
return EISDIR;
Ttvcr = VREFCOUNT(tvc);
#ifdef AFS_AIX_ENV
if (tvc && (VREFCOUNT(tvc) > 2) && tvc->opens > 0
- && !(tvc->states & CUnlinked))
+ && !(tvc->states & CUnlinked))
#else
#ifdef AFS_DARWIN14_ENV
- if (tvc && (VREFCOUNT(tvc) > 1 + DARWIN_REFBASE) && tvc->opens > 0 && !(tvc->states & CUnlinked))
+ if (tvc && (VREFCOUNT(tvc) > 1 + DARWIN_REFBASE) && tvc->opens > 0
+ && !(tvc->states & CUnlinked))
#else
if (tvc && (VREFCOUNT(tvc) > 1) && tvc->opens > 0
- && !(tvc->states & CUnlinked))
+ && !(tvc->states & CUnlinked))
#endif
#endif
{
avc->states &= ~(CUnlinked | CUnlinkedDel);
#ifdef AFS_DARWIN14_ENV
- if (VREFCOUNT(avc) < 4) {
- oldref = 4 - VREFCOUNT(avc);
- VREFCOUNT_SET(avc, 4);
- }
+ if (VREFCOUNT(avc) < 4) {
+ oldref = 4 - VREFCOUNT(avc);
+ VREFCOUNT_SET(avc, 4);
+ }
#endif
ReleaseWriteLock(&avc->lock);
VREFCOUNT_SET(avc, 0);
#else
if (oldref) {
- int newref = VREFCOUNT(avc) - oldref;
+ int newref = VREFCOUNT(avc) - oldref;
VREFCOUNT_SET(avc, newref);
}
#endif
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_rename.c,v 1.16 2003/08/29 22:00:04 rees Exp $");
+ ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_rename.c,v 1.16.2.1 2004/08/25 07:09:35 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
struct dcache *tdc1, *tdc2;
struct AFSFetchStatus OutOldDirStatus, OutNewDirStatus;
struct AFSVolSync tsync;
- XSTATS_DECLS AFS_STATCNT(afs_rename);
+ XSTATS_DECLS;
+ AFS_STATCNT(afs_rename);
afs_Trace4(afs_iclSetp, CM_TRACE_RENAME, ICL_TYPE_POINTER, aodp,
ICL_TYPE_STRING, aname1, ICL_TYPE_POINTER, andp,
ICL_TYPE_STRING, aname2);
#else /* AFS_OSF_ENV */
#if defined(AFS_SGI_ENV)
afs_rename(OSI_VC_ARG(aodp), aname1, andp, aname2, npnp, acred)
- struct pathname *npnp;
+ struct pathname *npnp;
#else
afs_rename(OSI_VC_ARG(aodp), aname1, andp, aname2, acred)
#endif
- OSI_VC_DECL(aodp);
+ OSI_VC_DECL(aodp);
struct vcache *andp;
char *aname1, *aname2;
struct AFS_UCRED *acred;
struct afs_fakestat_state ofakestate;
struct afs_fakestat_state nfakestate;
struct vrequest treq;
- OSI_VC_CONVERT(aodp)
+ OSI_VC_CONVERT(aodp);
- code = afs_InitReq(&treq, acred);
+ code = afs_InitReq(&treq, acred);
if (code)
return code;
afs_InitFakeStat(&ofakestate);
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_symlink.c,v 1.19 2003/08/26 15:09:28 rees Exp $");
+ ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_symlink.c,v 1.19.2.1 2004/08/25 07:09:35 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
/* don't set CDirty in here because RPC is called synchronously */
-int
-afs_symlink
+int afs_symlink
#ifdef AFS_OSF_ENV
(ndp, attrs, atargetName)
struct nameidata *ndp;
struct AFSVolSync tsync;
struct volume *volp = 0;
struct afs_fakestat_state fakestate;
- XSTATS_DECLS OSI_VC_CONVERT(adp)
+ XSTATS_DECLS;
+ OSI_VC_CONVERT(adp);
AFS_STATCNT(afs_symlink);
afs_Trace2(afs_iclSetp, CM_TRACE_SYMLINK, ICL_TYPE_POINTER, adp,
struct vrequest treq;
register char *tp;
struct afs_fakestat_state fakestat;
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
AFS_STATCNT(afs_readlink);
afs_Trace1(afs_iclSetp, CM_TRACE_READLINK, ICL_TYPE_POINTER, avc);
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.36 2004/06/24 17:38:25 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.36.2.1 2004/08/25 07:09:35 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
#else
afs_close(OSI_VC_ARG(avc), aflags, acred)
#endif
-OSI_VC_DECL(avc);
+ OSI_VC_DECL(avc);
afs_int32 aflags;
struct AFS_UCRED *acred;
{
struct flid flid;
#endif
struct afs_fakestat_state fakestat;
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
- AFS_STATCNT(afs_close);
+ AFS_STATCNT(afs_close);
afs_Trace2(afs_iclSetp, CM_TRACE_CLOSE, ICL_TYPE_POINTER, avc,
ICL_TYPE_INT32, aflags);
code = afs_InitReq(&treq, acred);
{
register afs_int32 code;
struct vrequest treq;
- OSI_VC_CONVERT(avc)
+ OSI_VC_CONVERT(avc);
- if (avc->vc_error)
+ if (avc->vc_error)
return avc->vc_error;
#if defined(AFS_SUN5_ENV)
*/
#define afs_inode_t ino64_t
#else
-#if defined(AFS_LINUX_64BIT_KERNEL)
+#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_S390X_LINUX24_ENV)
#define afs_inode_t long
#else
#if defined(AFS_AIX51_ENV) || defined(AFS_HPUX1123_ENV)
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/afs_call.c,v 1.74 2004/07/29 03:32:56 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/afs_call.c,v 1.74.2.2 2004/08/25 07:16:11 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
if (current->thread.flags & THREAD_IA32)
#elif defined(AFS_PPC64_LINUX20_ENV)
if (current->thread.flags & PPC_FLAG_32BIT)
+#elif defined(AFS_S390X_LINUX20_ENV)
+ if (current->thread.flags & S390_FLAG_31BIT)
#else
#error Not done for this linux version
#endif
afs_termState = AFSOP_STOP_RXCALLBACK;
rx_WakeupServerProcs();
+#ifdef AFS_AIX51_ENV
+ shutdown_rxkernel();
+#endif
/* shutdown_rxkernel(); */
while (afs_termState == AFSOP_STOP_RXCALLBACK)
afs_osi_Sleep(&afs_termState);
shutdown_rx();
afs_shutdown_BKG();
shutdown_bufferpackage();
+#endif
+#ifdef AFS_AIX51_ENV
shutdown_daemons();
+#endif
+#ifdef notdef
shutdown_cache();
shutdown_osi();
shutdown_osinet();
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/afs_daemons.c,v 1.28 2004/03/11 19:14:46 rees Exp $");
+ ("$Header: /cvs/openafs/src/afs/afs_daemons.c,v 1.28.2.1 2004/08/25 07:16:11 shadow Exp $");
#ifdef AFS_AIX51_ENV
#define __FULL_PROTO
#ifdef AFS_AIX41_ENV
lock_free(&afs_asyncbuf_lock);
unpin(&afs_asyncbuf, sizeof(struct buf *));
- pin(&afs_asyncbuf_cv, sizeof(afs_int32));
+ unpin(&afs_asyncbuf_cv, sizeof(afs_int32));
#else /* AFS_AIX41_ENV */
afs_busyq = NULL;
afs_biodcnt = 0;
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/afs_dcache.c,v 1.42 2004/05/08 04:33:07 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/afs_dcache.c,v 1.42.2.1 2004/08/25 07:09:32 shadow Exp $");
#include "afs/sysincludes.h" /*Standard vendor system headers */
#include "afsincludes.h" /*AFS-based standard headers */
int doReallyAdjustSize = 0;
int overWriteWholeChunk = 0;
- XSTATS_DECLS
+ XSTATS_DECLS;
#ifndef AFS_NOSTATS
struct afs_stats_xferData *xferP; /* Ptr to this op's xfer struct */
osi_timeval_t xferStartTime, /*FS xfer start time */
#define DQTODC(q) ((struct dcache *)(((char *) (q)) - sizeof(struct afs_q)))
for (tq = DirtyQ.prev; tq != &DirtyQ; tq = QPrev(tq)) {
- tdc = DQTODC(tq);
+ tdc = DQTODC(tq);
if (tdc->dflags & DFEntryMod) {
int wrLock;
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/afs_pioctl.c,v 1.81 2004/06/08 17:27:46 rees Exp $");
+ ("$Header: /cvs/openafs/src/afs/afs_pioctl.c,v 1.81.2.1 2004/08/25 07:03:35 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#ifdef AFS_OBSD_ENV
if (current->thread.flags & THREAD_IA32)
#elif defined(AFS_PPC64_LINUX20_ENV)
if (current->thread.flags & PPC_FLAG_32BIT)
+#elif defined(AFS_S390X_LINUX20_ENV)
+ if (current->thread.flags & S390_FLAG_31BIT)
#else
#error Not done for this linux type
#endif
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/afs_segments.c,v 1.16 2003/07/15 23:14:13 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/afs_segments.c,v 1.16.2.1 2004/08/25 07:09:32 shadow Exp $");
#include "afs/sysincludes.h" /*Standard vendor system headers */
#include "afsincludes.h" /*AFS-based standard headers */
register afs_int32 code;
register struct rx_call *tcall;
afs_size_t tlen, xlen = 0;
- XSTATS_DECLS AFS_STATCNT(afs_StoreMini);
+ XSTATS_DECLS;
+ AFS_STATCNT(afs_StoreMini);
afs_Trace2(afs_iclSetp, CM_TRACE_STOREMINI, ICL_TYPE_POINTER, avc,
ICL_TYPE_INT32, avc->m.Length);
tlen = avc->m.Length;
struct conn *tc;
struct osi_file *tfile;
struct rx_call *tcall;
- XSTATS_DECLS for (bytes = 0, j = 0; !code && j <= high; j++) {
+ XSTATS_DECLS;
+ for (bytes = 0, j = 0; !code && j <= high; j++) {
if (dcList[j]) {
ObtainSharedLock(&(dcList[j]->lock), 629);
if (!bytes)
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/afs_server.c,v 1.33 2004/06/24 17:38:23 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/afs_server.c,v 1.33.2.1 2004/08/25 07:07:53 shadow Exp $");
#include "afs/stds.h"
#include "afs/sysincludes.h" /* Standard vendor system headers */
#ifdef IFF_POINTTOPOINT
/* check for case #4 -- point-to-point link */
if ((ifa->ia_ifp->if_flags & IFF_POINTOPOINT)
- && (myDstaddr == serverAddr))
- ) {
+ && (myDstaddr == serverAddr)) {
if (ifa->ia_ifp->if_metric >= (MAXDEFRANK - MED) / PPWEIGHT)
t = MAXDEFRANK;
else
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/afs/afs_vcache.c,v 1.65 2004/07/14 04:21:54 shadow Exp $");
+ ("$Header: /cvs/openafs/src/afs/afs_vcache.c,v 1.65.2.3 2004/08/25 07:16:11 shadow Exp $");
#include "afs/sysincludes.h" /*Standard vendor system headers */
#include "afsincludes.h" /*AFS-based standard headers */
* Generate an index into the hash table for a given Fid.
*/
static int
-afs_HashCBRFid(struct AFSFid *fid) {
+afs_HashCBRFid(struct AFSFid *fid)
+{
return (fid->Volume + fid->Vnode + fid->Unique) % CBRSIZE;
}
* Must be called with afs_xvcb held.
*/
static void
-afs_InsertHashCBR(struct afs_cbr *cbr) {
+afs_InsertHashCBR(struct afs_cbr *cbr)
+{
int slot = afs_HashCBRFid(&cbr->fid);
cbr->hash_next = afs_cbrHashT[slot];
struct vrequest treq;
struct conn *tc;
int safety1, safety2, safety3;
- XSTATS_DECLS if ((code = afs_InitReq(&treq, afs_osi_credp)))
+ XSTATS_DECLS;
+ if ((code = afs_InitReq(&treq, afs_osi_credp)))
return code;
treq.flags |= O_NONBLOCK;
tfids = afs_osi_Alloc(sizeof(struct AFSFid) * AFS_MAXCBRSCALL);
ncbr = cbr->hash_next;
if (afid->Fid.Volume == cbr->fid.Volume &&
- afid->Fid.Vnode == cbr->fid.Vnode &&
+ afid->Fid.Vnode == cbr->fid.Vnode &&
afid->Fid.Unique == cbr->fid.Unique) {
afs_FreeCBR(cbr);
}
while ((cur = cur->next) != head) {
dentry = list_entry(cur, struct dentry, d_alias);
- if (ICL_SETACTIVE(afs_iclSetp)) {
- AFS_GLOCK();
- afs_Trace3(afs_iclSetp, CM_TRACE_TRYFLUSHDCACHECHILDREN,
- ICL_TYPE_POINTER, ip, ICL_TYPE_STRING,
- dentry->d_parent->d_name.name, ICL_TYPE_STRING,
- dentry->d_name.name);
- AFS_GUNLOCK();
- }
-
if (!list_empty(&dentry->d_hash) && !list_empty(&dentry->d_subdirs))
__shrink_dcache_parent(dentry);
refpanic("VLRU inconsistent");
}
#ifdef AFS_DARWIN_ENV
- if ((VREFCOUNT(tvc) < DARWIN_REFBASE) ||
- (VREFCOUNT(tvc) < 1+DARWIN_REFBASE &&
+ if ((VREFCOUNT(tvc) < DARWIN_REFBASE) ||
+ (VREFCOUNT(tvc) < 1 + DARWIN_REFBASE &&
UBCINFOEXISTS(&tvc->v))) {
- VREFCOUNT_SET(tvc,
- DARWIN_REFBASE + (UBCINFOEXISTS(&tvc->v) ? 1 : 0));
+ VREFCOUNT_SET(tvc,
+ DARWIN_REFBASE +
+ (UBCINFOEXISTS(&tvc->v) ? 1 : 0));
}
if (tvc->opens == 0 && ((tvc->states & CUnlinkedDel) == 0)
- && VREFCOUNT(tvc) == DARWIN_REFBASE+1
+ && VREFCOUNT(tvc) == DARWIN_REFBASE + 1
&& UBCINFOEXISTS(&tvc->v)) {
osi_VM_TryReclaim(tvc, &fv_slept);
if (fv_slept) {
}
#endif
- if (VREFCOUNT(tvc) ==
+ if (VREFCOUNT(tvc) ==
#ifdef AFS_DARWIN_ENV
DARWIN_REFBASE
#else
- 0
+ 0
#endif
- && tvc->opens == 0
- && (tvc->states & CUnlinkedDel) == 0) {
+ && tvc->opens == 0 && (tvc->states & CUnlinkedDel) == 0) {
#if defined(AFS_XBSD_ENV)
/*
* vgone() reclaims the vnode, which calls afs_FlushVCache(),
AFS_GLOCK();
if (tvc->v != NULL) {
/* I'd like to know if this ever happens...
- We don't drop global for the rest of this function,
- so if we do lose the race, the other thread should
- have found the same vnode and finished initializing
- the vcache entry. Is it conceivable that this vcache
- entry could be recycled during this interval? If so,
- then there probably needs to be some sort of additional
- mutual exclusion (an Embryonic flag would suffice).
- -GAW */
+ * We don't drop global for the rest of this function,
+ * so if we do lose the race, the other thread should
+ * have found the same vnode and finished initializing
+ * the vcache entry. Is it conceivable that this vcache
+ * entry could be recycled during this interval? If so,
+ * then there probably needs to be some sort of additional
+ * mutual exclusion (an Embryonic flag would suffice).
+ * -GAW */
printf("afs_NewVCache: lost the race\n");
return (tvc);
}
tvc->truncPos = AFS_NOTRUNC; /* don't truncate until we need to */
hzero(tvc->m.DataVersion); /* in case we copy it into flushDV */
#if defined(AFS_LINUX22_ENV)
-{
- struct inode *ip = AFSTOI(tvc);
- struct address_space *mapping = &ip->i_data;
+ {
+ struct inode *ip = AFSTOI(tvc);
+ struct address_space *mapping = &ip->i_data;
#if defined(AFS_LINUX26_ENV)
- inode_init_once(ip);
+ inode_init_once(ip);
#else
- sema_init(&ip->i_sem, 1);
- INIT_LIST_HEAD(&ip->i_hash);
- INIT_LIST_HEAD(&ip->i_dentry);
+ sema_init(&ip->i_sem, 1);
+ INIT_LIST_HEAD(&ip->i_hash);
+ INIT_LIST_HEAD(&ip->i_dentry);
#if defined(AFS_LINUX24_ENV)
- sema_init(&ip->i_zombie, 1);
- init_waitqueue_head(&ip->i_wait);
- spin_lock_init(&ip->i_data.i_shared_lock);
+ sema_init(&ip->i_zombie, 1);
+ init_waitqueue_head(&ip->i_wait);
+ spin_lock_init(&ip->i_data.i_shared_lock);
#ifdef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
- spin_lock_init(&ip->i_data.page_lock);
+ spin_lock_init(&ip->i_data.page_lock);
#endif
- INIT_LIST_HEAD(&ip->i_data.clean_pages);
- INIT_LIST_HEAD(&ip->i_data.dirty_pages);
- INIT_LIST_HEAD(&ip->i_data.locked_pages);
- INIT_LIST_HEAD(&ip->i_dirty_buffers);
+ INIT_LIST_HEAD(&ip->i_data.clean_pages);
+ INIT_LIST_HEAD(&ip->i_data.dirty_pages);
+ INIT_LIST_HEAD(&ip->i_data.locked_pages);
+ INIT_LIST_HEAD(&ip->i_dirty_buffers);
#ifdef STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
- INIT_LIST_HEAD(&ip->i_dirty_data_buffers);
+ INIT_LIST_HEAD(&ip->i_dirty_data_buffers);
#endif
#ifdef STRUCT_INODE_HAS_I_DEVICES
- INIT_LIST_HEAD(&ip->i_devices);
+ INIT_LIST_HEAD(&ip->i_devices);
#endif
#ifdef STRUCT_INODE_HAS_I_TRUNCATE_SEM
- init_rwsem(&ip->i_truncate_sem);
+ init_rwsem(&ip->i_truncate_sem);
#endif
#ifdef STRUCT_INODE_HAS_I_ALLOC_SEM
- init_rwsem(&ip->i_alloc_sem);
-#endif
+ init_rwsem(&ip->i_alloc_sem);
+#endif
#else /* AFS_LINUX22_ENV */
- sema_init(&ip->i_atomic_write, 1);
- init_waitqueue(&ip->i_wait);
+ sema_init(&ip->i_atomic_write, 1);
+ init_waitqueue(&ip->i_wait);
#endif
#endif
#if defined(AFS_LINUX24_ENV)
- mapping->host = ip;
- ip->i_mapping = mapping;
+ mapping->host = ip;
+ ip->i_mapping = mapping;
#ifdef STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
- ip->i_data.gfp_mask = GFP_HIGHUSER;
+ ip->i_data.gfp_mask = GFP_HIGHUSER;
#endif
#if defined(AFS_LINUX26_ENV)
- mapping_set_gfp_mask(mapping, GFP_HIGHUSER);
-{
- extern struct backing_dev_info afs_backing_dev_info;
+ mapping_set_gfp_mask(mapping, GFP_HIGHUSER);
+ {
+ extern struct backing_dev_info afs_backing_dev_info;
- mapping->backing_dev_info = &afs_backing_dev_info;
-}
+ mapping->backing_dev_info = &afs_backing_dev_info;
+ }
#endif
#endif
#if !defined(AFS_LINUX26_ENV)
- if (afs_globalVFS)
- ip->i_dev = afs_globalVFS->s_dev;
+ if (afs_globalVFS)
+ ip->i_dev = afs_globalVFS->s_dev;
#else
#ifdef STRUCT_INODE_HAS_I_SECURITY
- ip->i_security = NULL;
- if (security_inode_alloc(ip))
- panic("Cannot allocate inode security");
+ ip->i_security = NULL;
+ if (security_inode_alloc(ip))
+ panic("Cannot allocate inode security");
#endif
#endif
- ip->i_sb = afs_globalVFS;
- put_inode_on_dummy_list(ip);
-}
+ ip->i_sb = afs_globalVFS;
+ put_inode_on_dummy_list(ip);
+ }
#endif
#ifdef AFS_OSF_ENV
/* VLISTNONE(&tvc->v); */
tvc->v.v_freelist.tqe_next = 0;
tvc->v.v_freelist.tqe_prev = (struct vnode **)0xdeadb;
- tvc->vrefCount+=DARWIN_REFBASE;
+ tvc->vrefCount += DARWIN_REFBASE;
#endif
/*
* The proper value for mvstat (for root fids) is setup by the caller.
struct vrequest treq, ureq;
struct AFSVolSync tsync;
int didCore;
- XSTATS_DECLS AFS_STATCNT(afs_FlushActiveVcaches);
+ XSTATS_DECLS;
+ AFS_STATCNT(afs_FlushActiveVcaches);
ObtainReadLock(&afs_xvcache);
for (i = 0; i < VCSIZE; i++) {
for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) {
}
}
#ifdef AFS_DARWIN_ENV
- if (VREFCOUNT(tvc) == 1+DARWIN_REFBASE
+ if (VREFCOUNT(tvc) == 1 + DARWIN_REFBASE
&& UBCINFOEXISTS(&tvc->v)) {
if (tvc->opens)
panic("flushactive open, hasubc, but refcnt 1");
struct conn *tc;
struct AFSFetchStatus OutStatus;
struct AFSVolSync tsync;
- XSTATS_DECLS AFS_STATCNT(afs_WriteVCache);
+ XSTATS_DECLS;
+ AFS_STATCNT(afs_WriteVCache);
afs_Trace2(afs_iclSetp, CM_TRACE_WVCACHE, ICL_TYPE_POINTER, avc,
ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
afs_uint32 start;
register struct conn *tc;
struct AFSFetchStatus OutDirStatus;
- XSTATS_DECLS if (!name)
- name = ""; /* XXX */
+ XSTATS_DECLS;
+ if (!name)
+ name = ""; /* XXX */
do {
tc = afs_Conn(afid, areq, SHARED_LOCK);
if (tc) {
#endif /* AFS_OSF_ENV */
#ifdef AFS_DARWIN14_ENV
/* It'd really suck if we allowed duplicate vcaches for the
- same fid to happen. Wonder if this will work? */
+ * same fid to happen. Wonder if this will work? */
struct vnode *vp = AFSTOV(tvc);
- if (vp->v_flag & (VXLOCK|VORECLAIM|VTERMINATE)) {
- printf("precluded FindVCache on %x (%d:%d:%d)\n",
+ if (vp->v_flag & (VXLOCK | VORECLAIM | VTERMINATE)) {
+ printf("precluded FindVCache on %x (%d:%d:%d)\n",
vp, tvc->fid.Fid.Volume, tvc->fid.Fid.Vnode,
tvc->fid.Fid.Unique);
simple_lock(&vp->v_interlock);
SET(vp->v_flag, VTERMWANT);
simple_unlock(&vp->v_interlock);
- (void)tsleep((caddr_t)&vp->v_ubcinfo, PINOD, "vget1", 0);
+ (void)tsleep((caddr_t) & vp->v_ubcinfo, PINOD, "vget1", 0);
printf("VTERMWANT ended on %x\n", vp);
continue;
}
struct AFSCallBack CallBack;
struct AFSVolSync tsync;
struct volume *volp;
- XSTATS_DECLS
+ XSTATS_DECLS;
do {
tc = afs_Conn(afid, areq, SHARED_LOCK);
avc->quick.stamp = 0;
}
afs_cbrSpace = 0;
-#if !defined(AFS_OSF_ENV)
- afs_osi_Free(Initial_freeVCList, afs_cacheStats * sizeof(struct vcache));
-#endif
#ifdef KERNEL_HAVE_PIN
unpin(Initial_freeVCList, afs_cacheStats * sizeof(struct vcache));
#endif
+#if !defined(AFS_OSF_ENV)
+ afs_osi_Free(Initial_freeVCList, afs_cacheStats * sizeof(struct vcache));
+#endif
#if !defined(AFS_OSF_ENV)
freeVCList = Initial_freeVCList = 0;
#endif
#endif
RCSID
- ("$Header: /cvs/openafs/src/auth/authcon.c,v 1.13 2003/07/15 23:14:41 shadow Exp $");
+ ("$Header: /cvs/openafs/src/auth/authcon.c,v 1.13.2.1 2004/08/25 07:09:36 shadow Exp $");
#if defined(UKERNEL)
#include "afs/sysincludes.h"
{
register struct rx_securityClass *tclass;
- LOCK_GLOBAL_MUTEX tclass = (struct rx_securityClass *)
+ LOCK_GLOBAL_MUTEX;
+ tclass = (struct rx_securityClass *)
rxkad_NewServerSecurityObject(0, adir, afsconf_GetKey, NULL);
if (tclass) {
*astr = tclass;
*aindex = 2; /* kerberos security index */
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
} else {
- UNLOCK_GLOBAL_MUTEX return 2;
+ UNLOCK_GLOBAL_MUTEX;
+ return 2;
}
}
#endif /* !defined(UKERNEL) */
{
afs_int32 rc;
- LOCK_GLOBAL_MUTEX rc = GenericAuth(adir, astr, aindex, rxkad_clear);
- UNLOCK_GLOBAL_MUTEX return rc;
+ LOCK_GLOBAL_MUTEX;
+ rc = GenericAuth(adir, astr, aindex, rxkad_clear);
+ UNLOCK_GLOBAL_MUTEX;
+ return rc;
}
/* build a fake ticket for 'afs' using keys from adir, returning an
{
afs_int32 rc;
- LOCK_GLOBAL_MUTEX rc = GenericAuth(adir, astr, aindex, rxkad_crypt);
- UNLOCK_GLOBAL_MUTEX return rc;
+ LOCK_GLOBAL_MUTEX;
+ rc = GenericAuth(adir, astr, aindex, rxkad_crypt);
+ UNLOCK_GLOBAL_MUTEX;
+ return rc;
}
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/auth/cellconfig.c,v 1.40 2004/07/22 09:42:40 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/auth/cellconfig.c,v 1.40.2.1 2004/08/25 07:09:36 shadow Exp $");
#include <afs/stds.h>
#include <afs/pthread_glock.h>
#ifdef AFS_NT40_ENV
/* NT client CellServDB has different file name than NT server or Unix */
if (IsClientConfigDirectory(adir->name)) {
- if ( !afssw_GetClientCellServDBDir(&p) ) {
- strcompose(tbuffer, sizeof(tbuffer), p, "/",
- AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL);
- free(p);
- } else {
- int len;
- strncpy(tbuffer, adir->name, sizeof(tbuffer));
- len = strlen(tbuffer);
- if ( tbuffer[len-1] != '\\' && tbuffer[len-1] != '/' ) {
- strncat(tbuffer, "\\", sizeof(tbuffer));
- }
- strncat(tbuffer, AFSDIR_CELLSERVDB_FILE_NTCLIENT, sizeof(tbuffer));
- tbuffer[sizeof(tbuffer)-1] = '\0';
- }
+ if (!afssw_GetClientCellServDBDir(&p)) {
+ strcompose(tbuffer, sizeof(tbuffer), p, "/",
+ AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL);
+ free(p);
+ } else {
+ int len;
+ strncpy(tbuffer, adir->name, sizeof(tbuffer));
+ len = strlen(tbuffer);
+ if (tbuffer[len - 1] != '\\' && tbuffer[len - 1] != '/') {
+ strncat(tbuffer, "\\", sizeof(tbuffer));
+ }
+ strncat(tbuffer, AFSDIR_CELLSERVDB_FILE_NTCLIENT,
+ sizeof(tbuffer));
+ tbuffer[sizeof(tbuffer) - 1] = '\0';
+ }
} else {
strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE,
NULL);
/* NT client CellServDB has different file name than NT server or Unix */
if (IsClientConfigDirectory(adir->name)) {
- if ( !afssw_GetClientCellServDBDir(&p) ) {
- strcompose(tbuffer, sizeof(tbuffer), p, "/",
- AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL);
- free(p);
- } else {
- int len = strlen(tbuffer);
- if ( tbuffer[len-1] != '\\' && tbuffer[len-1] != '/' ) {
- strncat(tbuffer, "\\", sizeof(tbuffer));
- }
- strncat(tbuffer, AFSDIR_CELLSERVDB_FILE_NTCLIENT, sizeof(tbuffer));
- tbuffer[sizeof(tbuffer)-1] = '\0';
- }
+ if (!afssw_GetClientCellServDBDir(&p)) {
+ strcompose(tbuffer, sizeof(tbuffer), p, "/",
+ AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL);
+ free(p);
+ } else {
+ int len = strlen(tbuffer);
+ if (tbuffer[len - 1] != '\\' && tbuffer[len - 1] != '/') {
+ strncat(tbuffer, "\\", sizeof(tbuffer));
+ }
+ strncat(tbuffer, AFSDIR_CELLSERVDB_FILE_NTCLIENT,
+ sizeof(tbuffer));
+ tbuffer[sizeof(tbuffer) - 1] = '\0';
+ }
} else {
strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE,
NULL);
register struct afsconf_dir *tdir;
register afs_int32 code;
- LOCK_GLOBAL_MUTEX
- /* zero structure and fill in name; rest is done by internal routine */
- tdir = (struct afsconf_dir *)malloc(sizeof(struct afsconf_dir));
+ LOCK_GLOBAL_MUTEX;
+ /* zero structure and fill in name; rest is done by internal routine */
+ tdir = (struct afsconf_dir *)malloc(sizeof(struct afsconf_dir));
memset(tdir, 0, sizeof(struct afsconf_dir));
tdir->name = (char *)malloc(strlen(adir) + 1);
strcpy(tdir->name, adir);
fp = fopen("/.AFSCONF", "r");
if (fp == 0) {
free(tdir);
- UNLOCK_GLOBAL_MUTEX return (struct afsconf_dir *)0;
+ UNLOCK_GLOBAL_MUTEX;
+ return (struct afsconf_dir *)0;
}
fgets(afs_confdir, 128, fp);
fclose(fp);
fp = fopen("/.AFSCONF", "r");
if (fp == 0) {
free(tdir);
- UNLOCK_GLOBAL_MUTEX return (struct afsconf_dir *)0;
+ UNLOCK_GLOBAL_MUTEX;
+ return (struct afsconf_dir *)0;
}
}
fgets(afs_confdir, 128, fp);
len = strlen(afs_confdir);
if (len == 0) {
free(tdir);
- UNLOCK_GLOBAL_MUTEX return (struct afsconf_dir *)0;
+ UNLOCK_GLOBAL_MUTEX;
+ return (struct afsconf_dir *)0;
}
if (afs_confdir[len - 1] == '\n') {
afs_confdir[len - 1] = 0;
if (code) {
free(tdir->name);
free(tdir);
- UNLOCK_GLOBAL_MUTEX return (struct afsconf_dir *)0;
+ UNLOCK_GLOBAL_MUTEX;
+ return (struct afsconf_dir *)0;
}
}
- UNLOCK_GLOBAL_MUTEX return tdir;
+ UNLOCK_GLOBAL_MUTEX;
+ return tdir;
}
*/
if (IsClientConfigDirectory(adir->name)) {
/* NT client config dir */
- char * p;
- if ( !afssw_GetClientCellServDBDir(&p) ) {
- strcompose(tbuffer, sizeof(tbuffer), p, "/",
- AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL);
- free(p);
- } else {
- int len;
- strncpy(tbuffer, adir->name, sizeof(tbuffer));
- len = strlen(tbuffer);
- if ( tbuffer[len-1] != '\\' && tbuffer[len-1] != '/' ) {
- strncat(tbuffer, "\\", sizeof(tbuffer));
- }
- strncat(tbuffer, AFSDIR_CELLSERVDB_FILE_NTCLIENT, sizeof(tbuffer));
- tbuffer[sizeof(tbuffer)-1] = '\0';
- }
+ char *p;
+ if (!afssw_GetClientCellServDBDir(&p)) {
+ strcompose(tbuffer, sizeof(tbuffer), p, "/",
+ AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL);
+ free(p);
+ } else {
+ int len;
+ strncpy(tbuffer, adir->name, sizeof(tbuffer));
+ len = strlen(tbuffer);
+ if (tbuffer[len - 1] != '\\' && tbuffer[len - 1] != '/') {
+ strncat(tbuffer, "\\", sizeof(tbuffer));
+ }
+ strncat(tbuffer, AFSDIR_CELLSERVDB_FILE_NTCLIENT,
+ sizeof(tbuffer));
+ tbuffer[sizeof(tbuffer) - 1] = '\0';
+ }
} else {
/* NT server config dir */
strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE,
{
register struct afsconf_entry *tde;
register afs_int32 code;
- LOCK_GLOBAL_MUTEX for (tde = adir->entries; tde; tde = tde->next) {
+ LOCK_GLOBAL_MUTEX;
+ for (tde = adir->entries; tde; tde = tde->next) {
code = (*aproc) (&tde->cellInfo, arock, adir);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
}
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
/* call aproc(entry, arock, adir) for all cell aliases.
{
register struct afsconf_aliasentry *tde;
register afs_int32 code;
- LOCK_GLOBAL_MUTEX for (tde = adir->alias_entries; tde; tde = tde->next) {
+ LOCK_GLOBAL_MUTEX;
+ for (tde = adir->alias_entries; tde; tde = tde->next) {
code = (*aproc) (&tde->aliasInfo, arock, adir);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
}
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
afs_int32 afsconf_SawCell = 0;
* replaced with a more fine-grained lock just for the resolver
* operations.
*/
- LOCK_GLOBAL_MUTEX len =
- res_search(acellName, C_IN, T_AFSDB, answer, sizeof(answer));
- UNLOCK_GLOBAL_MUTEX if (len < 0)
- return AFSCONF_NOTFOUND;
+ LOCK_GLOBAL_MUTEX;
+ len = res_search(acellName, C_IN, T_AFSDB, answer, sizeof(answer));
+ UNLOCK_GLOBAL_MUTEX;
+ if (len < 0)
+ return AFSCONF_NOTFOUND;
p = answer + sizeof(HEADER); /* Skip header */
code = dn_expand(answer, answer + len, p, host, sizeof(host));
int tservice;
struct afsconf_entry DNSce;
afs_int32 cellHostAddrs[AFSMAXCELLHOSTS];
- char cellHostNames[AFSMAXCELLHOSTS][MAXHOSTCHARS];
+ char cellHostNames[AFSMAXCELLHOSTS][MAXHOSTCHARS];
int numServers;
int rc;
int ttl;
DNSce.cellInfo.numServers = 0;
DNSce.next = NULL;
- rc = getAFSServer(acellName, cellHostAddrs, cellHostNames, &numServers, &ttl);
+ rc = getAFSServer(acellName, cellHostAddrs, cellHostNames, &numServers,
+ &ttl);
/* ignore the ttl here since this code is only called by transitory programs
* like klog, etc. */
if (rc < 0)
acellInfo->numServers = numServers;
strcpy(acellInfo->name, acellName);
if (aservice) {
- LOCK_GLOBAL_MUTEX tservice = afsconf_FindService(aservice);
- UNLOCK_GLOBAL_MUTEX if (tservice < 0) {
+ LOCK_GLOBAL_MUTEX;
+ tservice = afsconf_FindService(aservice);
+ UNLOCK_GLOBAL_MUTEX;
+ if (tservice < 0) {
return AFSCONF_NOTFOUND; /* service not found */
}
for (i = 0; i < acellInfo->numServers; i++) {
int ambig;
char tbuffer[64];
- LOCK_GLOBAL_MUTEX if (adir)
- afsconf_Check(adir);
+ LOCK_GLOBAL_MUTEX;
+ if (adir)
+ afsconf_Check(adir);
if (acellName) {
tcell = acellName;
cnLen = strlen(tcell) + 1;
} else {
i = afsconf_GetLocalCell(adir, tbuffer, sizeof(tbuffer));
if (i) {
- UNLOCK_GLOBAL_MUTEX return i;
+ UNLOCK_GLOBAL_MUTEX;
+ return i;
}
tcell = tbuffer;
}
bestce = (struct afsconf_entry *)0;
ambig = 0;
if (!adir) {
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
/* Look through the list of aliases */
if (aservice) {
tservice = afsconf_FindService(aservice);
if (tservice < 0) {
- UNLOCK_GLOBAL_MUTEX return AFSCONF_NOTFOUND; /* service not found */
+ UNLOCK_GLOBAL_MUTEX;
+ return AFSCONF_NOTFOUND; /* service not found */
}
for (i = 0; i < acellInfo->numServers; i++) {
acellInfo->hostAddr[i].sin_port = tservice;
}
}
acellInfo->timeout = 0;
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
} else {
- UNLOCK_GLOBAL_MUTEX
+ UNLOCK_GLOBAL_MUTEX;
#ifdef AFS_AFSDB_ENV
- return afsconf_GetAfsdbInfo(tcell, aservice, acellInfo);
+ return afsconf_GetAfsdbInfo(tcell, aservice, acellInfo);
#else
- return AFSCONF_NOTFOUND;
+ return AFSCONF_NOTFOUND;
#endif /* AFS_AFSDB_ENV */
}
}
char *afscell_path;
afs_int32 code = 0;
- LOCK_GLOBAL_MUTEX
- /*
- * If a cell switch was specified in a command, then it should override the
- * AFSCELL variable. If a cell was specified, then the afsconf_SawCell flag
- * is set and the cell name in the adir structure is used.
- * Read the AFSCELL var each time: in case it changes (unsetenv AFSCELL).
- */
- if (!afsconf_SawCell && (afscell_path = getenv("AFSCELL"))) {
+ LOCK_GLOBAL_MUTEX;
+ /*
+ * If a cell switch was specified in a command, then it should override the
+ * AFSCELL variable. If a cell was specified, then the afsconf_SawCell flag
+ * is set and the cell name in the adir structure is used.
+ * Read the AFSCELL var each time: in case it changes (unsetenv AFSCELL).
+ */
+ if (!afsconf_SawCell && (afscell_path = getenv("AFSCELL"))) {
if (!afsconf_showcell) {
fprintf(stderr, "Note: Operation is performed on cell %s\n",
afscell_path);
code = AFSCONF_UNKNOWN;
}
- UNLOCK_GLOBAL_MUTEX return (code);
+ UNLOCK_GLOBAL_MUTEX;
+ return (code);
}
int
afsconf_Close(struct afsconf_dir *adir)
{
- LOCK_GLOBAL_MUTEX afsconf_CloseInternal(adir);
+ LOCK_GLOBAL_MUTEX;
+ afsconf_CloseInternal(adir);
if (adir->name)
free(adir->name);
free(adir);
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
static int
}
#endif /* AFS_NT40_ENV */
- LOCK_GLOBAL_MUTEX
- /* compute the key name and other setup */
- strcompose(tbuffer, 256, adir->name, "/", AFSDIR_KEY_FILE, NULL);
+ LOCK_GLOBAL_MUTEX;
+ /* compute the key name and other setup */
+ strcompose(tbuffer, 256, adir->name, "/", AFSDIR_KEY_FILE, NULL);
tstr = (struct afsconf_keys *)malloc(sizeof(struct afsconf_keys));
adir->keystr = tstr;
fd = open(tbuffer, O_RDONLY);
if (fd < 0) {
tstr->nkeys = 0;
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
code = read(fd, tstr, sizeof(struct afsconf_keys));
close(fd);
if (code < sizeof(afs_int32)) {
tstr->nkeys = 0;
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
/* convert key structure to host order */
for (fd = 0; fd < tstr->nkeys; fd++)
tstr->key[fd].kvno = ntohl(tstr->key[fd].kvno);
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
/* get keys structure */
{
register afs_int32 code;
- LOCK_GLOBAL_MUTEX code = afsconf_Check(adir);
+ LOCK_GLOBAL_MUTEX;
+ code = afsconf_Check(adir);
if (code) {
- UNLOCK_GLOBAL_MUTEX return AFSCONF_FAILURE;
+ UNLOCK_GLOBAL_MUTEX;
+ return AFSCONF_FAILURE;
}
memcpy(astr, adir->keystr, sizeof(struct afsconf_keys));
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
/* get latest key */
struct afsconf_key *bestk;
register afs_int32 code;
- LOCK_GLOBAL_MUTEX code = afsconf_Check(adir);
+ LOCK_GLOBAL_MUTEX;
+ code = afsconf_Check(adir);
if (code) {
- UNLOCK_GLOBAL_MUTEX return AFSCONF_FAILURE;
+ UNLOCK_GLOBAL_MUTEX;
+ return AFSCONF_FAILURE;
}
maxa = adir->keystr->nkeys;
memcpy(akey, bestk->key, 8); /* copy out latest key */
if (avno)
*avno = bestk->kvno; /* and kvno to caller */
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
- UNLOCK_GLOBAL_MUTEX return AFSCONF_NOTFOUND; /* didn't find any keys */
+ UNLOCK_GLOBAL_MUTEX;
+ return AFSCONF_NOTFOUND; /* didn't find any keys */
}
/* get a particular key */
register struct afsconf_key *tk;
register afs_int32 code;
- LOCK_GLOBAL_MUTEX code = afsconf_Check(adir);
+ LOCK_GLOBAL_MUTEX;
+ code = afsconf_Check(adir);
if (code) {
- UNLOCK_GLOBAL_MUTEX return AFSCONF_FAILURE;
+ UNLOCK_GLOBAL_MUTEX;
+ return AFSCONF_FAILURE;
}
maxa = adir->keystr->nkeys;
for (tk = adir->keystr->key, i = 0; i < maxa; i++, tk++) {
if (tk->kvno == avno) {
memcpy(akey, tk->key, 8);
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
}
- UNLOCK_GLOBAL_MUTEX return AFSCONF_NOTFOUND;
+ UNLOCK_GLOBAL_MUTEX;
+ return AFSCONF_NOTFOUND;
}
/* save the key structure in the appropriate file */
register afs_int32 i;
int foundSlot;
- LOCK_GLOBAL_MUTEX tk = adir->keystr;
+ LOCK_GLOBAL_MUTEX;
+ tk = adir->keystr;
if (akvno != 999) {
if (akvno < 0 || akvno > 255) {
- UNLOCK_GLOBAL_MUTEX return ERANGE;
+ UNLOCK_GLOBAL_MUTEX;
+ return ERANGE;
}
}
foundSlot = 0;
for (i = 0, tkey = tk->key; i < tk->nkeys; i++, tkey++) {
if (tkey->kvno == akvno) {
if (!overwrite) {
- UNLOCK_GLOBAL_MUTEX return AFSCONF_KEYINUSE;
+ UNLOCK_GLOBAL_MUTEX;
+ return AFSCONF_KEYINUSE;
}
foundSlot = 1;
break;
}
if (!foundSlot) {
if (tk->nkeys >= AFSCONF_MAXKEYS) {
- UNLOCK_GLOBAL_MUTEX return AFSCONF_FULL;
+ UNLOCK_GLOBAL_MUTEX;
+ return AFSCONF_FULL;
}
tkey = &tk->key[tk->nkeys++];
}
memcpy(tkey->key, akey, 8);
i = SaveKeys(adir);
afsconf_Touch(adir);
- UNLOCK_GLOBAL_MUTEX return i;
+ UNLOCK_GLOBAL_MUTEX;
+ return i;
}
/* this proc works by sliding the other guys down, rather than using a funny
register int i;
int foundFlag = 0;
- LOCK_GLOBAL_MUTEX tk = adir->keystr;
+ LOCK_GLOBAL_MUTEX;
+ tk = adir->keystr;
for (i = 0, tkey = tk->key; i < tk->nkeys; i++, tkey++) {
if (tkey->kvno == akvno) {
}
}
if (!foundFlag) {
- UNLOCK_GLOBAL_MUTEX return AFSCONF_NOTFOUND;
+ UNLOCK_GLOBAL_MUTEX;
+ return AFSCONF_NOTFOUND;
}
/* otherwise slide the others down. i and tkey point at the guy to delete */
tk->nkeys--;
i = SaveKeys(adir);
afsconf_Touch(adir);
- UNLOCK_GLOBAL_MUTEX return i;
+ UNLOCK_GLOBAL_MUTEX;
+ return i;
}
#endif
RCSID
- ("$Header: /cvs/openafs/src/auth/ktc.c,v 1.15 2004/04/14 23:26:13 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/auth/ktc.c,v 1.15.2.1 2004/08/25 07:09:36 shadow Exp $");
#if defined(UKERNEL)
#include "afs/sysincludes.h"
{
int ncode, ocode;
- LOCK_GLOBAL_MUTEX
+ LOCK_GLOBAL_MUTEX;
#ifdef AFS_KERBEROS_ENV
- if (!lcell[0])
+ if (!lcell[0])
ktc_LocalCell();
if ( /*!strcmp(aclient->cell, lcell) && this would only store local creds */
}
afs_tf_close();
#ifdef NO_AFS_CLIENT
- UNLOCK_GLOBAL_MUTEX return ncode;
+ UNLOCK_GLOBAL_MUTEX;
+ return ncode;
#endif /* NO_AFS_CLIENT */
}
#endif
} else
ocode = 0;
if (ncode && ocode) {
- UNLOCK_GLOBAL_MUTEX if (ocode == -1)
+ UNLOCK_GLOBAL_MUTEX;
+ if (ocode == -1)
ocode = errno;
else if (ocode == KTC_PIOCTLFAIL)
ocode = errno;
return KTC_PIOCTLFAIL;
}
#endif /* NO_AFS_CLIENT */
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
/* get token, given server we need and token buffer. aclient will eventually
int tktLen; /* server ticket length */
char found = 0;
- LOCK_GLOBAL_MUTEX
+ LOCK_GLOBAL_MUTEX;
#ifndef NO_AFS_CLIENT
- TRY_KERNEL(KTC_GETTOKEN_OP, aserver, aclient, atoken, atokenLen);
+ TRY_KERNEL(KTC_GETTOKEN_OP, aserver, aclient, atoken, atokenLen);
#endif /* NO_AFS_CLIENT */
#ifdef AFS_KERBEROS_ENV
min(atokenLen, sizeof(struct ktc_token)));
if (aclient)
*aclient = local_tokens[i].client;
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
#ifdef AFS_KERBEROS_ENV
if (!afs_tf_init(ktc_tkt_string(), R_TKT_FIL)) {
min(atokenLen, sizeof(struct ktc_token)));
afs_tf_close();
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
}
}
afs_tf_close();
#endif
- UNLOCK_GLOBAL_MUTEX return KTC_NOENT;
+ UNLOCK_GLOBAL_MUTEX;
+ return KTC_NOENT;
}
#ifndef NO_AFS_CLIENT
for (index = 0; index < 200; index++) { /* sanity check in case pioctl fails */
if (code) {
/* failed to retrieve specified token */
if (code < 0 && errno == EDOM) {
- UNLOCK_GLOBAL_MUTEX return KTC_NOENT;
+ UNLOCK_GLOBAL_MUTEX;
+ return KTC_NOENT;
}
} else {
/* token retrieved; parse buffer */
/* get size of clear token and verify */
memcpy(&temp, tp, sizeof(afs_int32));
if (temp != sizeof(struct ClearToken)) {
- UNLOCK_GLOBAL_MUTEX return KTC_ERROR;
+ UNLOCK_GLOBAL_MUTEX;
+ return KTC_ERROR;
}
tp += sizeof(afs_int32);
maxLen =
atokenLen - sizeof(struct ktc_token) + MAXKTCTICKETLEN;
if (maxLen < tktLen) {
- UNLOCK_GLOBAL_MUTEX return KTC_TOOBIG;
+ UNLOCK_GLOBAL_MUTEX;
+ return KTC_TOOBIG;
}
/* set return values */
sprintf(aclient->name, "Unix UID %d", ct.ViceId);
}
}
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
}
}
#endif /* NO_AFS_CLIENT */
- UNLOCK_GLOBAL_MUTEX if ((code < 0) && (errno == EINVAL))
+ UNLOCK_GLOBAL_MUTEX;
+ if ((code < 0) && (errno == EINVAL))
return KTC_NOPIOCTL;
return KTC_PIOCTLFAIL; /* probable cause */
}
{
int rc;
- LOCK_GLOBAL_MUTEX TRY_KERNEL(KTC_FORGETTOKEN_OP, aserver, 0, 0, 0);
+ LOCK_GLOBAL_MUTEX;
+ TRY_KERNEL(KTC_FORGETTOKEN_OP, aserver, 0, 0, 0);
rc = ktc_ForgetAllTokens(); /* bogus, but better */
- UNLOCK_GLOBAL_MUTEX return rc;
+ UNLOCK_GLOBAL_MUTEX;
+ return rc;
}
#endif /* NO_AFS_CLIENT */
memset(tbuffer, 0, sizeof(tbuffer));
- LOCK_GLOBAL_MUTEX
+ LOCK_GLOBAL_MUTEX;
#ifndef NO_AFS_CLIENT
- TRY_KERNEL(KTC_LISTTOKENS_OP, aserver, aprevIndex, aindex, 0);
+ TRY_KERNEL(KTC_LISTTOKENS_OP, aserver, aprevIndex, aindex, 0);
#endif /* NO_AFS_CLIENT */
index = aprevIndex;
if (afs_tf_init(ktc_tkt_string(), R_TKT_FIL)
|| afs_tf_get_pname(tbuffer) || afs_tf_get_pinst(tbuffer)) {
afs_tf_close();
- UNLOCK_GLOBAL_MUTEX return KTC_NOENT;
+ UNLOCK_GLOBAL_MUTEX;
+ return KTC_NOENT;
}
for (i = 214; i < index; i++) {
if (afs_tf_get_cred(&cprincipal, &ctoken)) {
afs_tf_close();
- UNLOCK_GLOBAL_MUTEX return KTC_NOENT;
+ UNLOCK_GLOBAL_MUTEX;
+ return KTC_NOENT;
}
}
again:
if (afs_tf_get_cred(&cprincipal, &ctoken)) {
afs_tf_close();
- UNLOCK_GLOBAL_MUTEX return KTC_NOENT;
+ UNLOCK_GLOBAL_MUTEX;
+ return KTC_NOENT;
}
index++;
*aserver = cprincipal;
*aindex = index;
afs_tf_close();
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
#endif
if (local_tokens[index - 123].valid) {
*aserver = local_tokens[index - 123].server;
*aindex = index + 1;
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
index++;
}
- UNLOCK_GLOBAL_MUTEX
+ UNLOCK_GLOBAL_MUTEX;
#ifdef AFS_KERBEROS_ENV
- return ktc_ListTokens(214, aindex, aserver);
+ return ktc_ListTokens(214, aindex, aserver);
#else
- return KTC_NOENT;
+ return KTC_NOENT;
#endif
}
if (index < 123) {
int rc;
rc = ktc_ListTokens(123, aindex, aserver);
- UNLOCK_GLOBAL_MUTEX return rc;
+ UNLOCK_GLOBAL_MUTEX;
+ return rc;
} else {
- UNLOCK_GLOBAL_MUTEX return KTC_NOENT;
+ UNLOCK_GLOBAL_MUTEX;
+ return KTC_NOENT;
}
}
if (code == 0)
index++;
}
if (code < 0) {
- UNLOCK_GLOBAL_MUTEX if (errno == EINVAL)
+ UNLOCK_GLOBAL_MUTEX;
+ if (errno == EINVAL)
return KTC_NOPIOCTL;
return KTC_PIOCTLFAIL;
}
tp += temp; /* skip ticket for now */
memcpy(&temp, tp, sizeof(afs_int32)); /* get size of clear token */
if (temp != sizeof(struct ClearToken)) {
- UNLOCK_GLOBAL_MUTEX return KTC_ERROR;
+ UNLOCK_GLOBAL_MUTEX;
+ return KTC_ERROR;
}
tp += sizeof(afs_int32); /* skip length */
tp += temp; /* skip clear token itself */
aserver->instance[0] = 0;
strcpy(aserver->name, "afs");
#endif /* NO_AFS_CLIENT */
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
/* discard all tokens from this user's cache */
{
int ncode, ocode;
- LOCK_GLOBAL_MUTEX
+ LOCK_GLOBAL_MUTEX;
#ifdef AFS_KERBEROS_ENV
- (void) afs_tf_dest_tkt();
+ (void)afs_tf_dest_tkt();
#endif
ncode = NewForgetAll();
ocode = errno;
else if (ocode == KTC_PIOCTLFAIL)
ocode = errno;
- UNLOCK_GLOBAL_MUTEX if (ocode == EINVAL)
+ UNLOCK_GLOBAL_MUTEX;
+ if (ocode == EINVAL)
return KTC_NOPIOCTL;
return KTC_PIOCTLFAIL;
}
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
/* ktc_OldPioctl - returns a boolean true if the kernel supports only the old
ktc_OldPioctl()
{
int rc;
- LOCK_GLOBAL_MUTEX
+ LOCK_GLOBAL_MUTEX;
#ifdef KERNEL_KTC_COMPAT
- CHECK_KERNEL;
+ CHECK_KERNEL;
rc = (kernelKTC != 1); /* old style interface */
#else
- rc = 1;
+ rc = 1;
#endif
- UNLOCK_GLOBAL_MUTEX return rc;
+ UNLOCK_GLOBAL_MUTEX;
+ return rc;
}
{
char *env;
- LOCK_GLOBAL_MUTEX if (!*krb_ticket_string) {
+ LOCK_GLOBAL_MUTEX;
+ if (!*krb_ticket_string) {
if (env = getenv("KRBTKFILE")) {
(void)strncpy(krb_ticket_string, env,
sizeof(krb_ticket_string) - 1);
(void)sprintf(krb_ticket_string, "%s%d", TKT_ROOT, getuid());
}
}
- UNLOCK_GLOBAL_MUTEX return krb_ticket_string;
+ UNLOCK_GLOBAL_MUTEX;
+ return krb_ticket_string;
}
/*
char *val;
{
- LOCK_GLOBAL_MUTEX(void) strncpy(krb_ticket_string, val,
- sizeof(krb_ticket_string) - 1);
+ LOCK_GLOBAL_MUTEX;
+ (void)strncpy(krb_ticket_string, val, sizeof(krb_ticket_string) - 1);
krb_ticket_string[sizeof(krb_ticket_string) - 1] = '\0';
- UNLOCK_GLOBAL_MUTEX return;
+ UNLOCK_GLOBAL_MUTEX;
+ return;
}
/*
int numenv;
char **newenv, **senv, **denv;
- LOCK_GLOBAL_MUTEX if (stat("/ticket", &sbuf) == -1) {
+ LOCK_GLOBAL_MUTEX;
+ if (stat("/ticket", &sbuf) == -1) {
prefix = "/tmp/tkt";
}
strcat(*denv, fname);
*++denv = 0;
environ = newenv;
-UNLOCK_GLOBAL_MUTEX}
+ UNLOCK_GLOBAL_MUTEX;
+}
/*
* BLETCH! We have to invoke the entire afsconf package just to
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/auth/ktc_nt.c,v 1.17 2004/07/08 13:24:00 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/auth/ktc_nt.c,v 1.17.2.1 2004/08/25 07:09:36 shadow Exp $");
#include <afs/stds.h>
#include <stdio.h>
"SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters";
static char AFSGlobalKTCMutexName[] = "Global\\AFS_KTC_Mutex";
-static char AFSKTCMutexName[] = "AFS_KTC_Mutex";
+static char AFSKTCMutexName[] = "AFS_KTC_Mutex";
/*
* Support for RPC's to send and receive session keys
#ifndef AFS_WIN95_ENV
ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName);
- if ( ktcMutex == NULL )
- return KTC_PIOCTLFAIL;
- if ( GetLastError() == ERROR_ALREADY_EXISTS ) {
- if ( WaitForSingleObject( ktcMutex, INFINITE) != WAIT_OBJECT_0 ) {
- CloseHandle(ktcMutex);
- return KTC_PIOCTLFAIL;
- }
+ if (ktcMutex == NULL)
+ return KTC_PIOCTLFAIL;
+ if (GetLastError() == ERROR_ALREADY_EXISTS) {
+ if (WaitForSingleObject(ktcMutex, INFINITE) != WAIT_OBJECT_0) {
+ CloseHandle(ktcMutex);
+ return KTC_PIOCTLFAIL;
+ }
}
/* RPC to send session key */
status = send_key(uuid, token->sessionKey.data);
if (status != RPC_S_OK) {
- if (status == 1)
- strcpy(rpcErr, "RPC failure in AFS gateway");
- else
- DceErrorInqText(status, rpcErr);
- if (status == RPC_S_SERVER_UNAVAILABLE ||
- status == EPT_S_NOT_REGISTERED)
- {
- ReleaseMutex(ktcMutex);
- CloseHandle(ktcMutex);
- return KTC_NOCMRPC;
- }
- else
- {
- ReleaseMutex(ktcMutex);
- CloseHandle(ktcMutex);
- return KTC_RPC;
- }
+ if (status == 1)
+ strcpy(rpcErr, "RPC failure in AFS gateway");
+ else
+ DceErrorInqText(status, rpcErr);
+ if (status == RPC_S_SERVER_UNAVAILABLE ||
+ status == EPT_S_NOT_REGISTERED) {
+ ReleaseMutex(ktcMutex);
+ CloseHandle(ktcMutex);
+ return KTC_NOCMRPC;
+ } else {
+ ReleaseMutex(ktcMutex);
+ CloseHandle(ktcMutex);
+ return KTC_RPC;
+ }
}
#endif /* AFS_WIN95_ENV */
#endif /* AFS_WIN95_ENV */
if (code) {
- if (code == -1) {
- if (errno == ESRCH)
- return KTC_NOCELL;
- else if (errno == ENODEV)
- return KTC_NOCM;
- else if (errno == EINVAL)
- return KTC_INVAL;
- else
- return KTC_PIOCTLFAIL;
- } else
- return KTC_PIOCTLFAIL;
+ if (code == -1) {
+ if (errno == ESRCH)
+ return KTC_NOCELL;
+ else if (errno == ENODEV)
+ return KTC_NOCM;
+ else if (errno == EINVAL)
+ return KTC_INVAL;
+ else
+ return KTC_PIOCTLFAIL;
+ } else
+ return KTC_PIOCTLFAIL;
}
return 0;
iob.out = tbuffer;
iob.out_size = sizeof(tbuffer);
-#ifndef AFS_WIN95_ENV
+#ifndef AFS_WIN95_ENV
ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName);
- if ( ktcMutex == NULL )
- return KTC_PIOCTLFAIL;
- if ( GetLastError() == ERROR_ALREADY_EXISTS ) {
- if ( WaitForSingleObject( ktcMutex, INFINITE) != WAIT_OBJECT_0 ) {
- CloseHandle(ktcMutex);
- return KTC_PIOCTLFAIL;
- }
+ if (ktcMutex == NULL)
+ return KTC_PIOCTLFAIL;
+ if (GetLastError() == ERROR_ALREADY_EXISTS) {
+ if (WaitForSingleObject(ktcMutex, INFINITE) != WAIT_OBJECT_0) {
+ CloseHandle(ktcMutex);
+ return KTC_PIOCTLFAIL;
+ }
}
#endif /* AFS_WIN95_ENV */
code = pioctl(0, VIOCNEWGETTOK, &iob, 0);
if (code) {
#ifndef AFS_WIN95_ENV
- ReleaseMutex(ktcMutex);
- CloseHandle(ktcMutex);
+ ReleaseMutex(ktcMutex);
+ CloseHandle(ktcMutex);
#endif /* AFS_WIN95_ENV */
- if (code == -1) {
- if (errno == ESRCH)
- return KTC_NOCELL;
- else if (errno == ENODEV)
- return KTC_NOCM;
- else if (errno == EINVAL)
- return KTC_INVAL;
- else if (errno == EDOM)
- return KTC_NOENT;
- else
- return KTC_PIOCTLFAIL;
- } else
- return KTC_PIOCTLFAIL;
- }
-
-#ifndef AFS_WIN95_ENV
+ if (code == -1) {
+ if (errno == ESRCH)
+ return KTC_NOCELL;
+ else if (errno == ENODEV)
+ return KTC_NOCM;
+ else if (errno == EINVAL)
+ return KTC_INVAL;
+ else if (errno == EDOM)
+ return KTC_NOENT;
+ else
+ return KTC_PIOCTLFAIL;
+ } else
+ return KTC_PIOCTLFAIL;
+ }
+#ifndef AFS_WIN95_ENV
/* get rid of RPC for win95 build */
/* RPC to receive session key */
status = receive_key(uuid, token->sessionKey.data);
CloseHandle(ktcMutex);
if (status != RPC_S_OK) {
- if (status == 1)
- strcpy(rpcErr, "RPC failure in AFS gateway");
- else
- DceErrorInqText(status, rpcErr);
- if (status == RPC_S_SERVER_UNAVAILABLE
- || status == EPT_S_NOT_REGISTERED)
- return KTC_NOCMRPC;
- else
- return KTC_RPC;
+ if (status == 1)
+ strcpy(rpcErr, "RPC failure in AFS gateway");
+ else
+ DceErrorInqText(status, rpcErr);
+ if (status == RPC_S_SERVER_UNAVAILABLE
+ || status == EPT_S_NOT_REGISTERED)
+ return KTC_NOCMRPC;
+ else
+ return KTC_RPC;
}
#endif /* AFS_WIN95_ENV */
/* user name is here */
/* check that ticket will fit
- * this compares the size of the ktc_token allocated by the app
- * which might be smaller than the current definition of MAXKTCTICKETLEN
- */
- maxLen = tokenLen - sizeof(struct ktc_token) + MAXKTCTICKETLEN;
- if (maxLen < ticketLen)
- return KTC_TOOBIG;
+ * this compares the size of the ktc_token allocated by the app
+ * which might be smaller than the current definition of MAXKTCTICKETLEN
+ */
+ maxLen = tokenLen - sizeof(struct ktc_token) + MAXKTCTICKETLEN;
+ if (maxLen < ticketLen)
+ return KTC_TOOBIG;
/* set return values */
memcpy(token->ticket, ticketP, ticketLen);
int code;
HANDLE ktcMutex = NULL;
-#ifndef AFS_WIN95_ENV
+#ifndef AFS_WIN95_ENV
ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName);
- if ( ktcMutex == NULL )
- return KTC_PIOCTLFAIL;
- if ( GetLastError() == ERROR_ALREADY_EXISTS ) {
- if ( WaitForSingleObject( ktcMutex, INFINITE) != WAIT_OBJECT_0 ) {
- CloseHandle(ktcMutex);
- return KTC_PIOCTLFAIL;
- }
+ if (ktcMutex == NULL)
+ return KTC_PIOCTLFAIL;
+ if (GetLastError() == ERROR_ALREADY_EXISTS) {
+ if (WaitForSingleObject(ktcMutex, INFINITE) != WAIT_OBJECT_0) {
+ CloseHandle(ktcMutex);
+ return KTC_PIOCTLFAIL;
+ }
}
#endif /* AFS_WIN95_ENV */
code = pioctl(0, VIOCGETTOK, &iob, 0);
#ifndef AFS_WIN95_ENV
- ReleaseMutex(ktcMutex);
- CloseHandle(ktcMutex);
+ ReleaseMutex(ktcMutex);
+ CloseHandle(ktcMutex);
#endif /* AFS_WIN95_ENV */
if (code) {
if (strcmp(server->name, "afs")) {
return ForgetOneLocalToken(server);
}
-
-#ifndef AFS_WIN95_ENV
+#ifndef AFS_WIN95_ENV
ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName);
- if ( ktcMutex == NULL )
- return KTC_PIOCTLFAIL;
- if ( GetLastError() == ERROR_ALREADY_EXISTS ) {
- if ( WaitForSingleObject( ktcMutex, INFINITE) != WAIT_OBJECT_0 ) {
- CloseHandle(ktcMutex);
- return KTC_PIOCTLFAIL;
- }
+ if (ktcMutex == NULL)
+ return KTC_PIOCTLFAIL;
+ if (GetLastError() == ERROR_ALREADY_EXISTS) {
+ if (WaitForSingleObject(ktcMutex, INFINITE) != WAIT_OBJECT_0) {
+ CloseHandle(ktcMutex);
+ return KTC_PIOCTLFAIL;
+ }
}
#endif /* AFS_WIN95_ENV */
(void)ForgetLocalTokens();
-#ifndef AFS_WIN95_ENV
+#ifndef AFS_WIN95_ENV
ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName);
- if ( ktcMutex == NULL )
- return KTC_PIOCTLFAIL;
- if ( GetLastError() == ERROR_ALREADY_EXISTS ) {
- if ( WaitForSingleObject( ktcMutex, INFINITE) != WAIT_OBJECT_0 ) {
- CloseHandle(ktcMutex);
- return KTC_PIOCTLFAIL;
- }
+ if (ktcMutex == NULL)
+ return KTC_PIOCTLFAIL;
+ if (GetLastError() == ERROR_ALREADY_EXISTS) {
+ if (WaitForSingleObject(ktcMutex, INFINITE) != WAIT_OBJECT_0) {
+ CloseHandle(ktcMutex);
+ return KTC_PIOCTLFAIL;
+ }
}
#endif /* AFS_WIN95_ENV */
int found = -1;
int i;
- LOCK_GLOBAL_MUTEX for (i = 0; i < MAXLOCALTOKENS; i++)
+ LOCK_GLOBAL_MUTEX;
+ for (i = 0; i < MAXLOCALTOKENS; i++)
if (local_tokens[i].valid) {
if ((strcmp(local_tokens[i].server.name, aserver->name) == 0)
&& (strcmp(local_tokens[i].server.instance, aserver->instance)
} else if (found == -1)
found = i; /* remember empty slot but keep looking for a match */
if (found == -1) {
- UNLOCK_GLOBAL_MUTEX return KTC_NOENT;
+ UNLOCK_GLOBAL_MUTEX;
+ return KTC_NOENT;
}
memcpy(&local_tokens[found].token, atoken, sizeof(struct ktc_token));
memcpy(&local_tokens[found].server, aserver,
memcpy(&local_tokens[found].client, aclient,
sizeof(struct ktc_principal));
local_tokens[found].valid = 1;
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
{
int i;
- LOCK_GLOBAL_MUTEX for (i = 0; i < MAXLOCALTOKENS; i++)
+ LOCK_GLOBAL_MUTEX;
+ for (i = 0; i < MAXLOCALTOKENS; i++)
if (local_tokens[i].valid
&& (strcmp(local_tokens[i].server.name, aserver->name) == 0)
&& (strcmp(local_tokens[i].server.instance, aserver->instance) ==
min(atokenLen, sizeof(struct ktc_token)));
memcpy(aclient, &local_tokens[i].client,
sizeof(struct ktc_principal));
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
- UNLOCK_GLOBAL_MUTEX return KTC_NOENT;
+ UNLOCK_GLOBAL_MUTEX;
+ return KTC_NOENT;
}
{
int i;
- LOCK_GLOBAL_MUTEX for (i = 0; i < MAXLOCALTOKENS; i++) {
+ LOCK_GLOBAL_MUTEX;
+ for (i = 0; i < MAXLOCALTOKENS; i++) {
local_tokens[i].valid = 0;
memset(&local_tokens[i].token.sessionKey, 0,
sizeof(struct ktc_encryptionKey));
}
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
{
int i;
- LOCK_GLOBAL_MUTEX for (i = 0; i < MAXLOCALTOKENS; i++) {
+ LOCK_GLOBAL_MUTEX;
+ for (i = 0; i < MAXLOCALTOKENS; i++) {
if (local_tokens[i].valid
&& (strcmp(local_tokens[i].server.name, aserver->name) == 0)
&& (strcmp(local_tokens[i].server.instance, aserver->instance) ==
local_tokens[i].valid = 0;
memset(&local_tokens[i].token.sessionKey, 0,
sizeof(struct ktc_encryptionKey));
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
}
- UNLOCK_GLOBAL_MUTEX return KTC_NOENT;
+ UNLOCK_GLOBAL_MUTEX;
+ return KTC_NOENT;
}
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/auth/userok.c,v 1.12 2003/12/07 22:49:17 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/auth/userok.c,v 1.12.2.1 2004/08/25 07:09:36 shadow Exp $");
#include <afs/stds.h>
#include <afs/pthread_glock.h>
register struct rx_call *acall;
register struct afsconf_dir *adir;
{
- LOCK_GLOBAL_MUTEX return ((afsconf_SuperUser(adir, acall, NULL) == 0) ?
- 10029 : 0);
-UNLOCK_GLOBAL_MUTEX}
+ LOCK_GLOBAL_MUTEX;
+ return ((afsconf_SuperUser(adir, acall, NULL) == 0) ? 10029 : 0);
+ UNLOCK_GLOBAL_MUTEX;
+}
#endif /* !defined(UKERNEL) */
static int
{
int rc;
- LOCK_GLOBAL_MUTEX rc = GetNoAuthFlag(adir);
- UNLOCK_GLOBAL_MUTEX return rc;
+ LOCK_GLOBAL_MUTEX;
+ rc = GetNoAuthFlag(adir);
+ UNLOCK_GLOBAL_MUTEX;
+ return rc;
}
void
{
register afs_int32 code;
- LOCK_GLOBAL_MUTEX if (aflag == 0) {
+ LOCK_GLOBAL_MUTEX;
+ if (aflag == 0) {
/* turn off noauth flag */
code = (unlink(AFSDIR_SERVER_NOAUTH_FILEPATH) ? errno : 0);
osi_audit(NoAuthDisableEvent, code, AUD_END);
} else
osi_audit(NoAuthEnableEvent, errno, AUD_END);
}
-UNLOCK_GLOBAL_MUTEX}
+ UNLOCK_GLOBAL_MUTEX;
+}
/* deletes a user from the UserList file */
int
struct stat tstat;
register afs_int32 code;
- LOCK_GLOBAL_MUTEX strcompose(tbuffer, sizeof tbuffer, adir->name, "/",
- AFSDIR_ULIST_FILE, NULL);
+ LOCK_GLOBAL_MUTEX;
+ strcompose(tbuffer, sizeof tbuffer, adir->name, "/",
+ AFSDIR_ULIST_FILE, NULL);
#ifndef AFS_NT40_ENV
{
/*
#endif /* AFS_NT40_ENV */
tf = fopen(tbuffer, "r");
if (!tf) {
- UNLOCK_GLOBAL_MUTEX return -1;
+ UNLOCK_GLOBAL_MUTEX;
+ return -1;
}
code = stat(tbuffer, &tstat);
if (code < 0) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
strcpy(nbuffer, tbuffer);
strcat(nbuffer, ".NXX");
nf = fopen(nbuffer, "w+");
if (!nf) {
fclose(tf);
- UNLOCK_GLOBAL_MUTEX return EIO;
+ UNLOCK_GLOBAL_MUTEX;
+ return EIO;
}
flag = 0;
found = 0;
unlink(nbuffer);
/* finally, decide what to return to the caller */
- UNLOCK_GLOBAL_MUTEX if (flag)
- return EIO; /* something mysterious went wrong */
+ UNLOCK_GLOBAL_MUTEX;
+ if (flag)
+ return EIO; /* something mysterious went wrong */
if (!found)
return ENOENT; /* entry wasn't found, no changes made */
return 0; /* everything was fine */
register int flag;
register afs_int32 code;
- LOCK_GLOBAL_MUTEX strcompose(tbuffer, sizeof tbuffer, adir->name, "/",
- AFSDIR_ULIST_FILE, NULL);
+ LOCK_GLOBAL_MUTEX;
+ strcompose(tbuffer, sizeof tbuffer, adir->name, "/",
+ AFSDIR_ULIST_FILE, NULL);
tf = fopen(tbuffer, "r");
if (!tf) {
- UNLOCK_GLOBAL_MUTEX return 1;
+ UNLOCK_GLOBAL_MUTEX;
+ return 1;
}
flag = 1;
while (1) {
if (flag == 0)
strcpy(abuffer, tname);
fclose(tf);
- UNLOCK_GLOBAL_MUTEX return flag;
+ UNLOCK_GLOBAL_MUTEX;
+ return flag;
}
/* returns true iff user is in the UserList file */
register afs_int32 code;
char tbuffer[256];
- LOCK_GLOBAL_MUTEX if (FindUser(adir, aname)) {
- UNLOCK_GLOBAL_MUTEX return EEXIST; /* already in the list */
+ LOCK_GLOBAL_MUTEX;
+ if (FindUser(adir, aname)) {
+ UNLOCK_GLOBAL_MUTEX;
+ return EEXIST; /* already in the list */
}
strcompose(tbuffer, sizeof tbuffer, adir->name, "/", AFSDIR_ULIST_FILE,
NULL);
tf = fopen(tbuffer, "a+");
if (!tf) {
- UNLOCK_GLOBAL_MUTEX return EIO;
+ UNLOCK_GLOBAL_MUTEX;
+ return EIO;
}
fprintf(tf, "%s\n", aname);
code = 0;
code = EIO;
if (fclose(tf))
code = EIO;
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
/* special CompFindUser routine that builds up a princ and then
register afs_int32 code;
int flag;
- LOCK_GLOBAL_MUTEX if (!adir) {
- UNLOCK_GLOBAL_MUTEX return 0;
+ LOCK_GLOBAL_MUTEX;
+ if (!adir) {
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
if (afsconf_GetNoAuthFlag(adir)) {
if (namep)
strcpy(namep, "<NoAuth>");
- UNLOCK_GLOBAL_MUTEX return 1;
+ UNLOCK_GLOBAL_MUTEX;
+ return 1;
}
tconn = rx_ConnectionOf(acall);
code = rx_SecurityClassOf(tconn);
if (code == 0) {
- UNLOCK_GLOBAL_MUTEX return 0; /* not authenticated at all, answer is no */
+ UNLOCK_GLOBAL_MUTEX;
+ return 0; /* not authenticated at all, answer is no */
} else if (code == 1) {
/* bcrypt tokens */
- UNLOCK_GLOBAL_MUTEX return 0; /* not supported any longer */
+ UNLOCK_GLOBAL_MUTEX;
+ return 0; /* not supported any longer */
} else if (code == 2) {
char tname[MAXKTCNAMELEN]; /* authentication from ticket */
char tinst[MAXKTCNAMELEN];
rxkad_GetServerInfo(acall->conn, NULL, &exp, tname, tinst, tcell,
NULL);
if (code) {
- UNLOCK_GLOBAL_MUTEX return 0; /* bogus connection/other error */
+ UNLOCK_GLOBAL_MUTEX;
+ return 0; /* bogus connection/other error */
}
/* don't bother checking anything else if tix have expired */
#else
if (exp < FT_ApproxTime()) {
#endif
- UNLOCK_GLOBAL_MUTEX return 0; /* expired tix */
+ UNLOCK_GLOBAL_MUTEX;
+ return 0; /* expired tix */
}
/* generate lowercased version of cell name */
if (namep)
strcpy(namep, uname);
- UNLOCK_GLOBAL_MUTEX return flag;
+ UNLOCK_GLOBAL_MUTEX;
+ return flag;
} else { /* some other auth type */
- UNLOCK_GLOBAL_MUTEX return 0; /* mysterious, just say no */
+ UNLOCK_GLOBAL_MUTEX;
+ return 0; /* mysterious, just say no */
}
}
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/auth/writeconfig.c,v 1.10 2003/12/07 22:49:17 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/auth/writeconfig.c,v 1.10.2.1 2004/08/25 07:09:36 shadow Exp $");
#include <afs/pthread_glock.h>
#include <afs/afsutil.h>
register FILE *tf;
register afs_int32 i;
- LOCK_GLOBAL_MUTEX
- /* write ThisCell file */
- strcompose(tbuffer, 1024, apath, "/", AFSDIR_THISCELL_FILE, NULL);
+ LOCK_GLOBAL_MUTEX;
+ /* write ThisCell file */
+ strcompose(tbuffer, 1024, apath, "/", AFSDIR_THISCELL_FILE, NULL);
fd = open(tbuffer, O_RDWR | O_CREAT | O_TRUNC, 0666);
if (fd < 0) {
- UNLOCK_GLOBAL_MUTEX return errno;
+ UNLOCK_GLOBAL_MUTEX;
+ return errno;
}
i = strlen(acellInfo->name);
code = write(fd, acellInfo->name, i);
if (code != i) {
- UNLOCK_GLOBAL_MUTEX return AFSCONF_FAILURE;
+ UNLOCK_GLOBAL_MUTEX;
+ return AFSCONF_FAILURE;
}
if (close(fd) < 0) {
- UNLOCK_GLOBAL_MUTEX return errno;
+ UNLOCK_GLOBAL_MUTEX;
+ return errno;
}
/* make sure we have both name and address for each host, looking up other
* if need be */
code = VerifyEntries(acellInfo);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
/* write CellServDB */
strcompose(tbuffer, 1024, apath, "/", AFSDIR_CELLSERVDB_FILE, NULL);
tf = fopen(tbuffer, "w");
if (!tf) {
- UNLOCK_GLOBAL_MUTEX return AFSCONF_NOTFOUND;
+ UNLOCK_GLOBAL_MUTEX;
+ return AFSCONF_NOTFOUND;
}
fprintf(tf, ">%s #Cell name\n", acellInfo->name);
for (i = 0; i < acellInfo->numServers; i++) {
}
if (ferror(tf)) {
fclose(tf);
- UNLOCK_GLOBAL_MUTEX return AFSCONF_FAILURE;
+ UNLOCK_GLOBAL_MUTEX;
+ return AFSCONF_FAILURE;
}
code = fclose(tf);
if (adir)
adir->timeRead = 0;
- UNLOCK_GLOBAL_MUTEX if (code == EOF)
+ UNLOCK_GLOBAL_MUTEX;
+ if (code == EOF)
return AFSCONF_FAILURE;
return 0;
}
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/bozo/bos.c,v 1.20 2003/12/07 22:49:18 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/bozo/bos.c,v 1.20.2.1 2004/08/25 07:03:36 shadow Exp $");
#include <afs/stds.h>
#include <stdlib.h>
{
static char tbuffer[30];
register char *tp;
- tp = ctime((time_t *) & atime);
+ time_t t = (time_t) atime;
+ tp = ctime(&t);
if (tp) {
strcpy(tbuffer, tp);
tbuffer[24] = 0; /* get rid of new line */
char *objectSpaceName, char *pathName);
#endif /*xbsa */
+
+
+/* XBSA Global Parameters */
+
+#ifdef XBSA_TCMAIN
+#define XBSA_EXT
+#else
+#define XBSA_EXT extern
+#endif
+
+XBSA_EXT afs_int32 xbsaType;
+#ifdef xbsa
+XBSA_EXT struct butx_transactionInfo butxInfo;
+
+#define rpc_c_protect_level_default 0
+XBSA_EXT afs_uint32 dumpRestAuthnLevel;
+XBSA_EXT char *xbsaObjectOwner;
+XBSA_EXT char *appObjectOwner;
+XBSA_EXT char *adsmServerName;
+XBSA_EXT char *xbsaSecToken;
+XBSA_EXT char *xbsalGName;
+#endif /*xbsa*/
#endif /* OPENAFS_BUTC_XBSA_H */
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/butc/tcmain.c,v 1.14 2003/11/29 21:37:56 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/butc/tcmain.c,v 1.14.2.1 2004/08/25 07:12:37 shadow Exp $");
#include <sys/types.h>
#include <sys/stat.h>
#include "error_macros.h"
#include <afs/budb_errs.h>
#include "afs/butx.h"
+#define XBSA_TCMAIN
#include "butc_xbsa.h"
#define N_SECURITY_OBJECTS 3
char *restoretofile;
int forcemultiple;
-/* XBSA Global Parameters */
-afs_int32 xbsaType;
-#ifdef xbsa
-struct butx_transactionInfo butxInfo;
-
-#define rpc_c_protect_level_default 0
-afs_uint32 dumpRestAuthnLevel = rpc_c_protect_level_default;
-char *xbsaObjectOwner;
-char *appObjectOwner;
-char *adsmServerName;
-char *xbsaSecToken;
-char *xbsalGName;
-#endif
-
int maxpass;
#define PASSESMIN 1
#define PASSESMAX 10
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/butc/tcprocs.c,v 1.12 2004/07/13 05:52:46 shadow Exp $");
+ ("$Header: /cvs/openafs/src/butc/tcprocs.c,v 1.12.2.1 2004/08/25 07:12:37 shadow Exp $");
#include <sys/types.h>
#include <errno.h>
return 1;
}
-/* XBSA Global Parameters */
-afs_int32 xbsaType;
-#ifdef xbsa
-struct butx_transactionInfo butxInfo;
-
-#define rpc_c_protect_level_default 0
-afs_uint32 dumpRestAuthnLevel = rpc_c_protect_level_default;
-char *xbsaObjectOwner;
-char *appObjectOwner;
-char *adsmServerName;
-char *xbsaSecToken;
-char *xbsalGName;
-#endif
-
/* -------------------------
* butc - interface routines - alphabetic order
* -------------------------
AIX64="#"
;;
+
rs_aix51)
DBG=""
LEX="lex"
AIX64=""
;;
+ rs_aix52)
+ DBG=""
+ LEX="lex"
+ LIBSYS_AIX_EXP="afsl.exp"
+ MT_CC="xlc_r"
+ MT_CFLAGS='-DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_LIBS="-lpthreads"
+ SHLIB_SUFFIX="o"
+ TXLIBS="-lcurses"
+ XCFLAGS="-K -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void"
+ XLIBS="${LIB_AFSDB} -ldl"
+ SHLIB_LINKER="${MT_CC} -bM:SRE -berok"
+ AIX64=""
+ ;;
s390_linux22)
CC="gcc"
CCOBJ="gcc"
- LD="gcc"
+ LD="ld"
KERN_OPTMZ=-O2
LEX="flex -l"
MT_CC="$CC"
s390_linux24)
CC="gcc"
CCOBJ="gcc"
- LD="gcc"
+ LD="ld"
KERN_OPTMZ=-O2
LEX="flex -l"
MT_CC="$CC"
SHLIB_LINKER="${MT_CC} -shared"
;;
+ s390x_linux24)
+ CC="gcc"
+ CCOBJ="gcc"
+ LD="ld"
+ KERN_OPTMZ=-O2
+ LEX="flex -l"
+ MT_CC="$CC"
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_LIBS="-lpthread"
+ PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC"
+ SHLIB_LDFLAGS="-shared -Xlinker -x"
+ TXLIBS="-lncurses"
+ XCFLAGS="-O -g -D_LARGEFILE64_SOURCE -D__s390x__"
+ YACC="bison -y"
+ SHLIB_LINKER="${MT_CC} -shared"
+ ;;
+
sgi_62)
PINSTALL_LIBS=-lmld
AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a"
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/comerr/error_msg.c,v 1.5 2003/07/15 23:14:53 shadow Exp $");
+ ("$Header: /cvs/openafs/src/comerr/error_msg.c,v 1.5.2.1 2004/08/25 07:09:36 shadow Exp $");
#include "internal.h"
#include <stdio.h>
}
#define LOCK_ET_LIST \
- (et_list_done || pthread_once(&et_list_once, et_mutex_once)); \
- assert(pthread_mutex_lock(&et_list_mutex)==0);
-#define UNLOCK_ET_LIST assert(pthread_mutex_unlock(&et_list_mutex)==0);
+ do { \
+ (et_list_done || pthread_once(&et_list_once, et_mutex_once)); \
+ assert(pthread_mutex_lock(&et_list_mutex)==0); \
+ } while (0)
+#define UNLOCK_ET_LIST assert(pthread_mutex_unlock(&et_list_mutex)==0)
#else
#define LOCK_ET_LIST
#define UNLOCK_ET_LIST
else
goto oops;
}
- LOCK_ET_LIST for (et = _et_list; et; et = et->next) {
+ LOCK_ET_LIST;
+ for (et = _et_list; et; et = et->next) {
if (et->table->base == table_num) {
/* This is the right table */
if (et->table->n_msgs <= offset)
goto oops;
- UNLOCK_ET_LIST return (et->table->msgs[offset]);
+ UNLOCK_ET_LIST;
+ return (et->table->msgs[offset]);
}
}
oops:
- UNLOCK_ET_LIST strcpy(buffer, "Unknown code ");
+ UNLOCK_ET_LIST;
+ strcpy(buffer, "Unknown code ");
if (table_num) {
strcat(buffer, error_table_name(table_num));
strcat(buffer, " ");
{
struct et_list *et;
- LOCK_ET_LIST
- /*
- * Protect against adding the same error table twice
- */
- for (et = _et_list; et; et = et->next) {
+ LOCK_ET_LIST;
+ /*
+ * Protect against adding the same error table twice
+ */
+ for (et = _et_list; et; et = et->next) {
if (et->table->base == new_table->table->base) {
- UNLOCK_ET_LIST return;
+ UNLOCK_ET_LIST;
+ return;
}
}
new_table->next = _et_list;
_et_list = new_table;
-UNLOCK_ET_LIST}
+ UNLOCK_ET_LIST;
+}
#
####### Special optional defines
-!IFNDEF NO_CRTDBG #don't set _CRTDBG_MAP_ALLOC flag for some module compliations
+!IFNDEF NO_CRTDBG
+#don't set _CRTDBG_MAP_ALLOC flag for some module compliations
#_CRTDBG_MAP_ALLOC=1
!ENDIF
#define used in WinNT/2000 installation and program version display
AFSPRODUCT_VER_MAJOR=1
AFSPRODUCT_VER_MINOR=3
-AFSPRODUCT_VER_PATCH=7000
+AFSPRODUCT_VER_PATCH=7100
AFSPRODUCT_VER_BUILD=0
+
+# For MSI installer, each major release should have a different GUID
+# http://msdn.microsoft.com/library/en-us/msi/setup/changing_the_product_code.asp
+AFSPRODUCT_VER_GUID=CCAF9E14-976E-46C0-8A1B-A218EAB7ADC5
+
AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
AFSPRODUCT_FILE_VERSION=$(AFSPRODUCT_VER_MAJOR),$(AFSPRODUCT_VER_MINOR),$(AFSPRODUCT_VER_PATCH),$(AFSPRODUCT_VER_BUILD)
# Set CELLNAME_DEFAULT to "your cell name"
CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB
TARGETOS = WINNT
-# Define defaults folder locations
+# Define defaults folder locations
DEST=dest
SRC=src
OBJ=obj
!IF ("$(AFSVER_CL)"!="1200")
afscdefs = $(afscdefs) /GT /GS
+#/Wp64
!IF ("$(AFSVER_CL)"!="1400")
afscdefs = $(afscdefs) /G7
!ENDIF
#define SYS_NAME_ID_s390_linux2 1900
#define SYS_NAME_ID_s390_linux22 1901
#define SYS_NAME_ID_s390_linux24 1902
+#define SYS_NAME_ID_s390x_linux2 1903
+#define SYS_NAME_ID_s390x_linux22 1904
+#define SYS_NAME_ID_s390x_linux24 1905
#define SYS_NAME_ID_alpha_linux_2 2000
#define SYS_NAME_ID_alpha_linux_22 2001
/* define if you have redhat buildsystem */
#undef ENABLE_REDHAT_BUILDSYS
+/* define if you have in_systm.h header file */
+#undef HAVE_IN_SYSTM_H
+
+/* define if you have mm_inline.h header file */
+#undef HAVE_MM_INLINE_H
+
+/* define if you have in_systm.h header file */
+#undef HAVE_IN_SYSTM_H
+
/* define if your linux kernel exports sys_chdir */
#undef EXPORTED_SYS_CHDIR
$subdir =~ s|/$||gio;
print "# $dir/$depname\n";
- open(COMPS, "$dir/$depname");
+ open(COMPS, "$depname");
while ( defined($file = <COMPS>) )
{
my ($destdir, $proj_src,$obj_src);
-#ifndef UKERNEL
-/* This section for kernel libafs compiles only */
-
-#ifndef AFS_PARAM_H
-#define AFS_PARAM_H
-
-#ifndef IGNORE_STDS_H
-#include <sys/param.h>
-#endif
+#ifndef AFS_I386_PARAM_H
+#define AFS_I386_PARAM_H
#define AFS_X86_XBSD_ENV 1
-
#define AFS_X86_ENV 1
+#define AFSLITTLE_ENDIAN 1
#define SYS_NAME "i386_nbsd20"
#define SYS_NAME_ID SYS_NAME_ID_i386_nbsd20
-#define AFSLITTLE_ENDIAN 1
-
-#endif /* AFS_PARAM_H */
+#ifndef UKERNEL
+/* This section for kernel libafs compiles only */
#else /* !defined(UKERNEL) */
/* This section for user space compiles only */
-#ifndef AFS_PARAM_H
-#define AFS_PARAM_H
-
-
-#define UKERNEL 1 /* user space kernel */
-#define AFS_ENV 1
-#define AFS_VFSINCL_ENV 1
-#define AFS_NBSD_ENV 1
-#define AFS_NBSD15_ENV 1
-#define AFS_NBSD16_ENV 1
-#define AFS_NBSD20_ENV 1
-#define AFS_NONFSTRANS 1
-#define AFS_KERBEROS_ENV
-
-#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
-#define AFS_SYSCALL 210
-#define AFS_NAMEI_ENV 1 /* User space interface to file system */
-#define AFS_64BIT_ENV 1
-#define AFS_64BIT_CLIENT 1
-#define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */
-#include <afs/afs_sysnames.h>
-
-#define AFS_USERSPACE_IP_ADDR 1
-#define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
-
-/* Machine / Operating system information */
-#define SYS_NAME "i386_nbsd16"
-#define SYS_NAME_ID SYS_NAME_ID_i386_nbsd16
-#define AFSLITTLE_ENDIAN 1
-#define AFS_HAVE_FFS 1 /* Use system's ffs. */
-#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
-#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
-
-#define afsio_iov uio_iov
-#define afsio_iovcnt uio_iovcnt
-#define afsio_offset uio_offset
-#define afsio_seg uio_segflg
-#define afsio_fmode uio_fmode
-#define afsio_resid uio_resid
-#define AFS_UIOSYS 1
-#define AFS_UIOUSER UIO_USERSPACE
-#define AFS_CLBYTES MCLBYTES
-#define AFS_MINCHANGE 2
-#define VATTR_NULL usr_vattr_null
-
-#define AFS_DIRENT
-#ifndef CMSERVERPREF
-#define CMSERVERPREF
-#endif
-
-#include <limits.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/mount.h>
-#include <sys/fcntl.h>
-#include <netinet/in.h>
-#include <sys/uio.h>
-#include <sys/socket.h>
+#endif /* !defined(UKERNEL) */
-#endif /* AFS_PARAM_H */
+#endif /* AFS_I386_PARAM_H */
-#endif /* !defined(UKERNEL) */
-#ifndef UKERNEL
-/* This section for kernel libafs compiles only */
-
+/* NetBSD shared section */
#ifndef AFS_PARAM_COMMON_H
-#define AFS_PARAM_COMMON_H
+#define AFS_PARAM_COMMON_H 1
-#ifndef ASSEMBLER
-#include <sys/param.h>
+#define AFS_64BIT_ENV 1
+#define AFS_NAMEI_ENV 1 /* User space interface to file system */
+#define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */
+#define AFS_64BIT_CLIENT 1
+
+#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+#define AFS_SYSCALL 210
+
+#ifndef MOUNT_AFS
+#define MOUNT_AFS AFS_MOUNT_AFS
#endif
#define AFS_XBSD_ENV 1 /* {Free,Open,Net}BSD */
-#define AFS_64BIT_ENV 1
-#define AFS_NAMEI_ENV 1 /* User space interface to file system */
-#define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */
#define AFS_NBSD_ENV 1
#define AFS_NBSD15_ENV 1
#define AFS_NBSD16_ENV 1
#define AFS_NBSD20_ENV 1
#define AFS_NONFSTRANS 1
#define AFS_KERBEROS_ENV 1
+
+#define AFS_VFSINCL_ENV 1
+
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+
+#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
+#if __NetBSD_Version__ >= 200040000
+#define AFS_HAVE_STATVFS 1 /* System supports statvfs */
+#else
+#define AFS_HAVE_STATVFS 0 /* System doesn't supports statvfs */
+#endif
+#endif
+
+#ifndef UKERNEL
+
+#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
+#include <sys/param.h>
+#endif
+
#define FTRUNC O_TRUNC
#define IUPD 0x0010
#define AFS_VM_RDWR_ENV 1
#define AFS_VFS_ENV 1
-#define AFS_VFSINCL_ENV 1
#define AFS_GREEDY43_ENV 1
-#define AFS_ENV 1
-
-#define AFS_MOUNT_AFS "afs"
-#define AFS_SYSCALL 210
-
-
-#ifndef MOUNT_UFS
-#define MOUNT_UFS "ufs"
-#endif
-
-#ifndef MOUNT_AFS
-#define MOUNT_AFS AFS_MOUNT_AFS
-#endif
-
-#define AFS_HAVE_FFS 1 /* Use system's ffs. */
-#define AFS_HAVE_STATVFS 0 /* System supports statvfs */
#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
#define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */
#define VN_RELE(vp) vrele(((struct vnode *)(vp)))
#define VN_HOLD(vp) VREF(((struct vnode *)(vp)))
-#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
+#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
enum vcexcl { NONEXCL, EXCL };
#ifdef KERNEL
#endif
#endif /* KERNEL */
-#endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
+#endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */
#endif /* _KERNEL */
-#endif /* AFS_PARAM_COMMON_H */
-
#else /* !defined(UKERNEL) */
+
/* This section for user space compiles only */
+#define UKERNEL 1 /* user space kernel */
+
+#include <afs/afs_sysnames.h>
+
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+
+#define afsio_iov uio_iov
+#define afsio_iovcnt uio_iovcnt
+#define afsio_offset uio_offset
+#define afsio_seg uio_segflg
+#define afsio_fmode uio_fmode
+#define afsio_resid uio_resid
+#define AFS_UIOSYS UIO_SYSSPACE
+#define AFS_UIOUSER UIO_USERSPACE
+#define AFS_CLBYTES MCLBYTES
+#define AFS_MINCHANGE 2
+#define VATTR_NULL usr_vattr_null
+
+#define AFS_DIRENT
+#ifndef CMSERVERPREF
+#define CMSERVERPREF
+#endif
+
+#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
+#include <limits.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/fcntl.h>
+#include <netinet/in.h>
+#include <sys/uio.h>
+#include <sys/socket.h>
+#endif
#endif /* !defined(UKERNEL) */
+
+#endif /* AFS_PARAM_COMMON_H */
-#ifndef UKERNEL
-/* This section for kernel libafs compiles only */
-
-#ifndef AFS_PARAM_H
-#define AFS_PARAM_H
-
-#include <sys/param.h>
+#ifndef AFS_PPC_PARAM_H
+#define AFS_PPC_PARAM_H
#define SYS_NAME "macppc_nbsd20"
#define SYS_NAME_ID SYS_NAME_ID_macppc_nbsd20
#define AFS_PPC_ENV 1
#define AFSBIG_ENDIAN 1
-#endif /* AFS_PARAM_H */
-
-#else /* !defined(UKERNEL) */
-
-/* This section for user space compiles only */
-
-#ifndef AFS_PARAM_H
-#define AFS_PARAM_H
-
-
-#define UKERNEL 1 /* user space kernel */
-#define AFS_ENV 1
-#define AFS_VFSINCL_ENV 1
-#define AFS_NBSD_ENV 1
-#define AFS_NBSD15_ENV 1
-#define AFS_NBSD16_ENV 1
-#define AFS_NBSD20_ENV 1
-#define AFS_NONFSTRANS 1
-#define AFS_KERBEROS_ENV
-
-#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
-#define AFS_SYSCALL 210
-#define AFS_NAMEI_ENV 1 /* User space interface to file system */
-#define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */
-#include <afs/afs_sysnames.h>
-
-#define AFS_USERSPACE_IP_ADDR 1
-#define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
-
-/* Machine / Operating system information */
-#define SYS_NAME "i386_nbsd16"
-#define SYS_NAME_ID SYS_NAME_ID_i386_nbsd16
-#define AFSLITTLE_ENDIAN 1
-#define AFS_HAVE_FFS 1 /* Use system's ffs. */
-#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
-#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
-
-#define afsio_iov uio_iov
-#define afsio_iovcnt uio_iovcnt
-#define afsio_offset uio_offset
-#define afsio_seg uio_segflg
-#define afsio_fmode uio_fmode
-#define afsio_resid uio_resid
-#define AFS_UIOSYS 1
-#define AFS_UIOUSER UIO_USERSPACE
-#define AFS_CLBYTES MCLBYTES
-#define AFS_MINCHANGE 2
-#define VATTR_NULL usr_vattr_null
-
-#define AFS_DIRENT
-#ifndef CMSERVERPREF
-#define CMSERVERPREF
-#endif
-
-#include <limits.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/mount.h>
-#include <sys/fcntl.h>
-#include <netinet/in.h>
-#include <sys/uio.h>
-#include <sys/socket.h>
-
-#endif /* AFS_PARAM_H */
-
-#endif /* !defined(UKERNEL) */
+#endif /* AFS_PCC_PARAM_H */
--- /dev/null
+#ifndef UKERNEL
+/* This section for kernel libafs compiles only */
+
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+
+#ifndef AFS_PARAM_H
+#define AFS_PARAM_H
+
+/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+ * it's a judgment call. If something is obviously s390 specific, use that
+ * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+ * in the sysname is the current version of the client. This takes into
+ * account the perferred OS user space configuration as well as the kernel.
+ */
+
+#define AFS_LINUX20_ENV 1
+#define AFS_LINUX22_ENV 1
+#define AFS_LINUX24_ENV 1
+#define AFS_S390_LINUX20_ENV 1
+#define AFS_S390_LINUX22_ENV 1
+#define AFS_S390_LINUX24_ENV 1
+#define AFS_S390X_LINUX20_ENV 1
+#define AFS_S390X_LINUX22_ENV 1
+#define AFS_S390X_LINUX24_ENV 1
+#define AFS_NONFSTRANS 1
+
+#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+#define AFS_SYSCALL 137
+#define AFS_64BIT_ENV 1
+#define AFS_64BITPOINTER_ENV 1
+#define AFS_64BIT_CLIENT 1
+#define AFS_64BIT_KERNEL 1
+#define AFS_64BIT_IOPS_ENV 1
+#define AFS_NAMEI_ENV 1 /* User space interface to file system */
+
+#if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
+#include <linux/threads.h>
+
+#include <linux/config.h>
+#ifdef CONFIG_SMP
+#undef CONFIG_SMP
+#endif
+/* Using "AFS_SMP" to map to however many #define's are required to get
+ * MP to compile for Linux
+ */
+#ifdef AFS_SMP
+#define CONFIG_SMP 1
+#ifndef CONFIG_S390_LOCAL_APIC
+#define CONFIG_S390_LOCAL_APIC 1
+#endif
+#ifndef __SMP__
+#define __SMP__
+#endif
+#define AFS_GLOBAL_SUNLOCK
+#endif
+#if defined(MODULE) && defined(CONFIG_MODVERSIONS)
+#define MODVERSIONS
+#include <linux/modversions.h>
+#endif
+#endif /* __KERNEL__ && !DUMP_KERNEL */
+
+#include <afs/afs_sysnames.h>
+
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS 2 /* Set to Userdisabled, allow sysctl to override */
+
+/* Machine / Operating system information */
+#define SYS_NAME "s390x_linux24"
+#define SYS_NAME_ID SYS_NAME_ID_s390x_linux24
+#define AFSBIG_ENDIAN 1
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
+#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
+
+#ifdef KERNEL
+#ifndef MIN
+#define MIN(A,B) ((A) < (B) ? (A) : (B))
+#endif
+#ifndef MAX
+#define MAX(A,B) ((A) > (B) ? (A) : (B))
+#endif
+#endif /* KERNEL */
+
+#endif /* AFS_PARAM_H */
+
+#else /* !defined(UKERNEL) */
+
+/* This section for user space compiles only */
+
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef AFS_PARAM_H
+#define AFS_PARAM_H
+
+/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+ * it's a judgment call. If something is obviously s390 specific, use that
+ * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+ * in the sysname is the current version of the client. This takes into
+ * account the perferred OS user space configuration as well as the kernel.
+ */
+
+#define UKERNEL 1 /* user space kernel */
+#define AFS_ENV 1
+#define AFS_USR_LINUX20_ENV 1
+#define AFS_USR_LINUX22_ENV 1
+#define AFS_USR_LINUX24_ENV 1
+#define AFS_S390X_LINUX20_ENV 1
+#define AFS_S390X_LINUX22_ENV 1
+#define AFS_S390X_LINUX24_ENV 1
+#define AFS_NONFSTRANS 1
+
+#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+#define AFS_SYSCALL 137
+#define AFS_64BIT_ENV 1
+#define AFS_64BIT_CLIENT 1
+#define AFS_64BITPOINTER_ENV 1
+#define AFS_64BIT_IOPS_ENV 1
+#define AFS_NAMEI_ENV 1 /* User space interface to file system */
+#include <afs/afs_sysnames.h>
+
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+
+
+/* Machine / Operating system information */
+#define SYS_NAME "s390x_linux24"
+#define SYS_NAME_ID SYS_NAME_ID_s390x_linux24
+#define AFSBIG_ENDIAN 1
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
+#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
+
+#define afsio_iov uio_iov
+#define afsio_iovcnt uio_iovcnt
+#define afsio_offset uio_offset
+#define afsio_seg uio_segflg
+#define afsio_fmode uio_fmode
+#define afsio_resid uio_resid
+#define AFS_UIOSYS 1
+#define AFS_UIOUSER UIO_USERSPACE
+#define AFS_CLBYTES MCLBYTES
+#define AFS_MINCHANGE 2
+#define VATTR_NULL usr_vattr_null
+
+#define AFS_DIRENT
+#ifndef CMSERVERPREF
+#define CMSERVERPREF
+#endif
+
+#endif /* AFS_PARAM_H */
+
+#endif /* !defined(UKERNEL) */
make_s: make_s.o misc.o main.o
${CC} make_s.o misc.o main.o ${LDFLAGS} -o make_s
+crypt.o: crypt.c
+ case ${SYS_NAME} in \
+ rs_aix*)\
+ ${CC} -c ${COMMON_INCL} -o crypt.o crypt.c ;;\
+ *)\
+ ${CC} -c ${CFLAGS} -o crypt.o crypt.c ;;\
+ esac
#
# Table/code generation targets
#
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/des/crypt.c,v 1.13 2004/02/03 06:23:37 shadow Exp $");
+ ("$Header: /cvs/openafs/src/des/crypt.c,v 1.13.2.1 2004/08/25 07:03:38 shadow Exp $");
#ifdef AFS_NT40_ENV
#include <windows.h>
*/
/* XXX shouldn't this be !AFS_64BIT_ENV ? */
-#if !defined(cray) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) && !defined(AFS_AMD64_LINUX20_ENV) && !defined(AFS_PPC64_LINUX20_ENV)
+#if !defined(cray) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) && !defined(AFS_AMD64_LINUX20_ENV) && !defined(AFS_PPC64_LINUX20_ENV) & !defined(AFS_S390X_LINUX20_ENV)
#define LONG_IS_32_BITS
#endif
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/des/des.c,v 1.11 2003/07/15 23:14:59 shadow Exp $");
+ ("$Header: /cvs/openafs/src/des/des.c,v 1.11.2.1 2004/08/25 07:09:37 shadow Exp $");
#ifndef KERNEL
#include <stdio.h>
#ifdef DEBUG
afs_uint32 dbg_tmp[2];
#endif
- LOCK_RXKAD_STATS if (encrypt)
- rxkad_stats.des_encrypts[DES_ENCRYPT]++;
+ LOCK_RXKAD_STATS;
+ if (encrypt)
+ rxkad_stats.des_encrypts[DES_ENCRYPT]++;
else
rxkad_stats.des_encrypts[DES_DECRYPT]++;
- UNLOCK_RXKAD_STATS
- /*
- * Use L1,R1 and L2,R2 as two sets of "64-bit" registers always
- * work from L1,R1 input to L2,R2 output; initialize the cleartext
- * into registers.
- */
+ UNLOCK_RXKAD_STATS;
+ /*
+ * Use L1,R1 and L2,R2 as two sets of "64-bit" registers always
+ * work from L1,R1 input to L2,R2 output; initialize the cleartext
+ * into registers.
+ */
#ifdef MUSTALIGN
#ifdef DEBUG
- /*
- * If the alignment is wrong, the programmer really screwed up --
- * we aren't even getting the right data type. His problem. Keep
- * this code for debugging.
- */
- /* Make sure schedule is ok */
- if ((afs_int32) schedule & 3) {
+ /*
+ * If the alignment is wrong, the programmer really screwed up --
+ * we aren't even getting the right data type. His problem. Keep
+ * this code for debugging.
+ */
+ /* Make sure schedule is ok */
+ if ((afs_int32) schedule & 3) {
fprintf(stderr, "des.c schedule arg pointer not aligned\n");
abort();
}
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/des/key_sched.c,v 1.6 2003/07/15 23:15:00 shadow Exp $");
+ ("$Header: /cvs/openafs/src/des/key_sched.c,v 1.6.2.1 2004/08/25 07:09:37 shadow Exp $");
#include <mit-cpyright.h>
#include "des_internal.h"
n = 0;
p_char = k_char;
- LOCK_RXKAD_STATS rxkad_stats.des_key_scheds++;
- UNLOCK_RXKAD_STATS
+ LOCK_RXKAD_STATS;
+ rxkad_stats.des_key_scheds++;
+ UNLOCK_RXKAD_STATS;
#ifdef lint
- n = n; /* fool it in case of VAXASM */
+ n = n; /* fool it in case of VAXASM */
#endif
#ifdef DEBUG
if (des_debug)
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/des/new_rnd_key.c,v 1.13 2003/12/07 22:49:24 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/des/new_rnd_key.c,v 1.13.2.1 2004/08/25 07:09:37 shadow Exp $");
#ifndef KERNEL
#include <stdio.h>
#include <assert.h>
pthread_mutex_t des_init_mutex;
-#define LOCK_INIT assert(pthread_mutex_lock(&des_init_mutex)==0);
-#define UNLOCK_INIT assert(pthread_mutex_unlock(&des_init_mutex)==0);
+#define LOCK_INIT assert(pthread_mutex_lock(&des_init_mutex)==0)
+#define UNLOCK_INIT assert(pthread_mutex_unlock(&des_init_mutex)==0)
#else
#define LOCK_INIT
#define UNLOCK_INIT
int
des_random_key(des_cblock key)
{
- LOCK_INIT if (!is_inited) {
+ LOCK_INIT;
+ if (!is_inited) {
des_init_random_number_generator(key);
}
- UNLOCK_INIT
+ UNLOCK_INIT;
do {
des_generate_random_block(key);
des_fixup_key_parity(key);
#include <assert.h>
pthread_mutex_t des_random_mutex;
-#define LOCK_RANDOM assert(pthread_mutex_lock(&des_random_mutex)==0);
-#define UNLOCK_RANDOM assert(pthread_mutex_unlock(&des_random_mutex)==0);
+#define LOCK_RANDOM assert(pthread_mutex_lock(&des_random_mutex)==0)
+#define UNLOCK_RANDOM assert(pthread_mutex_unlock(&des_random_mutex)==0)
#else
#define LOCK_RANDOM
#define UNLOCK_RANDOM
register int i;
/* select the new stream: (note errors are not possible here...) */
- LOCK_RANDOM des_key_sched(key, random_sequence_key.d);
+ LOCK_RANDOM;
+ des_key_sched(key, random_sequence_key.d);
/* "seek" to the start of the stream: */
for (i = 0; i < 8; i++)
sequence_number[i] = 0;
-UNLOCK_RANDOM}
+ UNLOCK_RANDOM;
+}
/*
* des_set_sequence_number: this routine is used to set the sequence number
static afs_int32
des_set_sequence_number(des_cblock new_sequence_number)
{
- LOCK_RANDOM memcpy((char *)sequence_number, (char *)new_sequence_number,
- sizeof(sequence_number));
- UNLOCK_RANDOM return 0;
+ LOCK_RANDOM;
+ memcpy((char *)sequence_number, (char *)new_sequence_number,
+ sizeof(sequence_number));
+ UNLOCK_RANDOM;
+ return 0;
}
/*
{
int i;
- LOCK_RXKAD_STATS rxkad_stats.des_randoms++;
- UNLOCK_RXKAD_STATS
- /*
- * Encrypt the sequence number to get the new random block:
- */
- LOCK_RANDOM des_ecb_encrypt(sequence_number, block,
- random_sequence_key.d, 1);
+ LOCK_RXKAD_STATS;
+ rxkad_stats.des_randoms++;
+ UNLOCK_RXKAD_STATS;
+ /*
+ * Encrypt the sequence number to get the new random block:
+ */
+ LOCK_RANDOM;
+ des_ecb_encrypt(sequence_number, block, random_sequence_key.d, 1);
/*
* Increment the sequence number as an 8 byte unsigned number with wrap:
if (sequence_number[i])
break;
}
- UNLOCK_RANDOM return 0;
+ UNLOCK_RANDOM;
+ return 0;
}
#include <pthread.h>
#include <assert.h>
extern pthread_mutex_t rxkad_stats_mutex;
-#define LOCK_RXKAD_STATS assert(pthread_mutex_lock(&rxkad_stats_mutex)==0);
-#define UNLOCK_RXKAD_STATS assert(pthread_mutex_unlock(&rxkad_stats_mutex)==0);
+#define LOCK_RXKAD_STATS assert(pthread_mutex_lock(&rxkad_stats_mutex)==0)
+#define UNLOCK_RXKAD_STATS assert(pthread_mutex_unlock(&rxkad_stats_mutex)==0)
#else
#define LOCK_RXKAD_STATS
#define UNLOCK_RXKAD_STATS
noversion system: install
-install: ${DESTDIR}${libdir}/afs/export.exp ${DESTDIR}${libdir}/afs/extras.exp
+install: ${DESTDIR}${afskerneldir}/export.ext \
+ ${DESTDIR}${afskerneldir}/export.ext.nonfs \
+ ${DESTDIR}${afskerneldir}/export64.ext.nonfs \
+ ${DESTDIR}${libdir}/afs/export.exp \
+ ${DESTDIR}${libdir}/afs/export64.exp \
+ ${DESTDIR}${libdir}/afs/extras.exp \
+ ${DESTDIR}${afskerneldir}/cfgexport \
+ ${DESTDIR}${afskerneldir}/cfgafs \
+ ${DESTDIR}${afskerneldir}/export64.ext \
+ ${DESTDIR}${afskerneldir}/cfgexport64 \
+ ${DESTDIR}${afskerneldir}/cfgafs64
export.exp: ${srcdir}/export4.exp ${srcdir}/export5.exp
case ${SYS_NAME} in \
${DEST}/root.client/usr/vice/etc/dkload/cfgexport64: @AIX64@cfgexport64
@AIX64@ ${INSTALL} $? $@
-${DEST}/root.client/usr/vice/etc/dkload/cfgafs: @AIX64@cfgafs
+${DEST}/root.client/usr/vice/etc/dkload/cfgafs: cfgafs
@AIX64@ ${INSTALL} $? $@
${DEST}/root.client/usr/vice/etc/dkload/cfgafs64: @AIX64@cfgafs64
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/kauth/admin_tools.c,v 1.16 2003/12/07 22:49:26 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/kauth/admin_tools.c,v 1.16.2.1 2004/08/25 07:03:39 shadow Exp $");
#include <afs/stds.h>
#include <afs/debug.h>
if (as->parms[3].items)
sscanf(as->parms[3].items->data, "%d", &kvno);
-#ifdef AFS_S390_LINUX20_ENV
+#if defined(AFS_S390_LINUX20_ENV) && !defined(AFS_S390X_LINUX20_ENV)
code = ubik_Call(KAM_SetPassword, conn, 0, name, instance, kvno, 0, key);
#else
code = ubik_Call(KAM_SetPassword, conn, 0, name, instance, kvno, key);
#endif
RCSID
- ("$Header: /cvs/openafs/src/kauth/authclient.c,v 1.14 2003/07/15 23:15:16 shadow Exp $");
+ ("$Header: /cvs/openafs/src/kauth/authclient.c,v 1.14.2.2 2004/08/25 07:09:38 shadow Exp $");
#if defined(UKERNEL)
#include "afs/sysincludes.h"
{
int i;
- LOCK_GLOBAL_MUTEX ka_ExpandCell(cell, explicit_cell_server_list.name, 0);
+ LOCK_GLOBAL_MUTEX;
+ ka_ExpandCell(cell, explicit_cell_server_list.name, 0);
for (i = 0; i < MAXHOSTSPERCELL; i++)
if (serverList[i]) {
explicit_cell_server_list.numServers = i + 1;
explicit = 1;
} else
break;
-UNLOCK_GLOBAL_MUTEX}
+ UNLOCK_GLOBAL_MUTEX;
+}
static int
myCellLookup(struct afsconf_dir *conf, char *cell, char *service,
afs_int32 code;
char cellname[MAXKTCREALMLEN];
- LOCK_GLOBAL_MUTEX if (cell && !strlen(cell))
- cell = 0;
+ LOCK_GLOBAL_MUTEX;
+ if (cell && !strlen(cell))
+ cell = 0;
else
cell = lcstring(cellname, cell, sizeof(cellname));
conf = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH);
#endif /* UKERNEL */
if (!conf) {
- UNLOCK_GLOBAL_MUTEX return KANOCELLS;
+ UNLOCK_GLOBAL_MUTEX;
+ return KANOCELLS;
}
}
code = myCellLookup(conf, cell, AFSCONF_KAUTHSERVICE, cellinfo);
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
afs_int32
ka_GetSecurity(int service, struct ktc_token * token,
struct rx_securityClass ** scP, int *siP)
{ /* security class index */
- LOCK_GLOBAL_MUTEX *scP = 0;
+ LOCK_GLOBAL_MUTEX;
+ *scP = 0;
switch (service) {
case KA_AUTHENTICATION_SERVICE:
case KA_TICKET_GRANTING_SERVICE:
*siP = RX_SCINDEX_KAD;
break;
default:
- UNLOCK_GLOBAL_MUTEX return KABADARGUMENT;
+ UNLOCK_GLOBAL_MUTEX;
+ return KABADARGUMENT;
}
if (*scP == 0) {
printf("Failed gettting security object\n");
- UNLOCK_GLOBAL_MUTEX return KARXFAIL;
+ UNLOCK_GLOBAL_MUTEX;
+ return KARXFAIL;
}
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
afs_int32
char sname[MAXHOSTCHARS];
int snamel;
- LOCK_GLOBAL_MUTEX code = ka_GetServers(cell, &cellinfo);
+ LOCK_GLOBAL_MUTEX;
+ code = ka_GetServers(cell, &cellinfo);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
lcstring(sname, server, sizeof(sname));
for (i = 0; i < cellinfo.numServers; i++) {
if (strncmp(cellinfo.hostName[i], sname, snamel) == 0) {
if (match >= 0) {
- UNLOCK_GLOBAL_MUTEX return KANOCELLS;
+ UNLOCK_GLOBAL_MUTEX;
+ return KANOCELLS;
} else
match = i;
}
}
if (match < 0) {
- UNLOCK_GLOBAL_MUTEX return KANOCELLS;
+ UNLOCK_GLOBAL_MUTEX;
+ return KANOCELLS;
}
code = rx_Init(0);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
code = ka_GetSecurity(service, token, &sc, &si);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
#ifdef AFS_PTHREAD_ENV
serverconns[0] =
*conn = 0;
code = ubik_ClientInit(serverconns, conn);
rxs_Release(sc);
- UNLOCK_GLOBAL_MUTEX if (code)
- return KAUBIKINIT;
+ UNLOCK_GLOBAL_MUTEX;
+ if (code)
+ return KAUBIKINIT;
return 0;
}
int si; /* security class index */
int i;
- LOCK_GLOBAL_MUTEX code = rx_Init(0);
+ LOCK_GLOBAL_MUTEX;
+ code = rx_Init(0);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
code = ka_GetSecurity(service, token, &sc, &si);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
for (i = 0; i < cellinfo->numServers; i++)
*conn = 0;
code = ubik_ClientInit(serverconns, conn);
rxs_Release(sc);
- UNLOCK_GLOBAL_MUTEX if (code)
- return KAUBIKINIT;
+ UNLOCK_GLOBAL_MUTEX;
+ if (code)
+ return KAUBIKINIT;
return 0;
}
int i;
struct afsconf_cell cellinfo; /* for cell auth server list */
- LOCK_GLOBAL_MUTEX code = ka_GetServers(cell, &cellinfo);
+ LOCK_GLOBAL_MUTEX;
+ code = ka_GetServers(cell, &cellinfo);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
code = rx_Init(0);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
code = ka_GetSecurity(service, token, &sc, &si);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
for (i = 0; i < cellinfo.numServers; i++)
*conn = 0;
code = ubik_ClientInit(serverconns, conn);
rxs_Release(sc);
- UNLOCK_GLOBAL_MUTEX if (code)
- return KAUBIKINIT;
+ UNLOCK_GLOBAL_MUTEX;
+ if (code)
+ return KAUBIKINIT;
return 0;
}
char *ans_label;
int version;
- LOCK_GLOBAL_MUTEX if ((code = des_key_sched(key, schedule))) {
- UNLOCK_GLOBAL_MUTEX return KABADKEY;
+ LOCK_GLOBAL_MUTEX;
+ if ((code = des_key_sched(key, schedule))) {
+ UNLOCK_GLOBAL_MUTEX;
+ return KABADKEY;
}
if (service == KA_MAINTENANCE_SERVICE) {
req_label = KA_GETTGT_REQ_LABEL;
ans_label = KA_GETTGT_ANS_LABEL;
} else {
- UNLOCK_GLOBAL_MUTEX return KABADARGUMENT;
+ UNLOCK_GLOBAL_MUTEX;
+ return KABADARGUMENT;
}
request_time = time(0);
}
}
if (code) {
- UNLOCK_GLOBAL_MUTEX if ((code >= KAMINERROR) && (code <= KAMAXERROR))
- return code;
+ UNLOCK_GLOBAL_MUTEX;
+ if ((code >= KAMINERROR) && (code <= KAMAXERROR))
+ return code;
return KAUBIKCALL;
}
des_pcbc_encrypt(oanswer.SeqBody, oanswer.SeqBody, oanswer.SeqLen,
CheckTicketAnswer(&oanswer, request_time + 1, token, &caller,
0, ans_label, pwexpires);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
}
break;
if ((answer_old.time != request_time + 1)
|| (answer_old.ticket_len < MINKTCTICKETLEN)
|| (answer_old.ticket_len > MAXKTCTICKETLEN)) {
- UNLOCK_GLOBAL_MUTEX return KABADPROTOCOL;
+ UNLOCK_GLOBAL_MUTEX;
+ return KABADPROTOCOL;
}
{
char *label = ((char *)answer_old.ticket) + answer_old.ticket_len;
if (strncmp(label, ans_label, sizeof(answer_old.label))) {
- UNLOCK_GLOBAL_MUTEX return KABADPROTOCOL;
+ UNLOCK_GLOBAL_MUTEX;
+ return KABADPROTOCOL;
}
token->startTime = start;
token->endTime = end;
}
break;
default:
- UNLOCK_GLOBAL_MUTEX return KAINTERNALERROR;
+ UNLOCK_GLOBAL_MUTEX;
+ return KAINTERNALERROR;
}
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
afs_int32
int version;
afs_int32 pwexpires;
- LOCK_GLOBAL_MUTEX aticket.SeqLen = auth_token->ticketLen;
+ LOCK_GLOBAL_MUTEX;
+ aticket.SeqLen = auth_token->ticketLen;
aticket.SeqBody = auth_token->ticket;
code = des_key_sched(&auth_token->sessionKey, schedule);
if (code) {
- UNLOCK_GLOBAL_MUTEX return KABADKEY;
+ UNLOCK_GLOBAL_MUTEX;
+ return KABADKEY;
}
times.start = htonl(start);
}
}
if (code) {
- UNLOCK_GLOBAL_MUTEX if ((code >= KAMINERROR) && (code <= KAMAXERROR))
- return code;
+ UNLOCK_GLOBAL_MUTEX;
+ if ((code >= KAMINERROR) && (code <= KAMAXERROR))
+ return code;
return KAUBIKCALL;
}
CheckTicketAnswer(&oanswer, 0, token, 0, &server,
KA_GETTICKET_ANS_LABEL, &pwexpires);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
}
break;
sizeof(token->sessionKey));
if (tkt_CheckTimes(token->startTime, token->endTime, time(0)) < 0) {
- UNLOCK_GLOBAL_MUTEX return KABADPROTOCOL;
+ UNLOCK_GLOBAL_MUTEX;
+ return KABADPROTOCOL;
}
if ((token->ticketLen < MINKTCTICKETLEN)
|| (token->ticketLen > MAXKTCTICKETLEN)) {
- UNLOCK_GLOBAL_MUTEX return KABADPROTOCOL;
+ UNLOCK_GLOBAL_MUTEX;
+ return KABADPROTOCOL;
}
strings = answer_old.name;
len = strlen(strings); /* check client name */
if ((len < 1) || (len > MAXKTCNAMELEN)) {
- UNLOCK_GLOBAL_MUTEX return KABADPROTOCOL;
+ UNLOCK_GLOBAL_MUTEX;
+ return KABADPROTOCOL;
}
strings += len + 1; /* check client instance */
len = strlen(strings);
if ((len < 0) || (len > MAXKTCNAMELEN)) {
- UNLOCK_GLOBAL_MUTEX return KABADPROTOCOL;
+ UNLOCK_GLOBAL_MUTEX;
+ return KABADPROTOCOL;
}
strings += len + 1;
len = strlen(strings); /* check client cell */
if ((len < 0) || (len > MAXKTCNAMELEN)) {
- UNLOCK_GLOBAL_MUTEX return KABADPROTOCOL;
+ UNLOCK_GLOBAL_MUTEX;
+ return KABADPROTOCOL;
}
strings += len + 1;
len = strlen(strings); /* check server name */
if ((len < 1) || (len > MAXKTCNAMELEN) || strcmp(name, strings)) {
- UNLOCK_GLOBAL_MUTEX return KABADPROTOCOL;
+ UNLOCK_GLOBAL_MUTEX;
+ return KABADPROTOCOL;
}
strings += len + 1;
len = strlen(strings); /* check server instance */
if ((len < 0) || (len > MAXKTCNAMELEN) || strcmp(instance, strings)) {
- UNLOCK_GLOBAL_MUTEX return KABADPROTOCOL;
+ UNLOCK_GLOBAL_MUTEX;
+ return KABADPROTOCOL;
}
strings += len + 1;
if ((strings - oanswer.SeqBody + token->ticketLen) - oanswer.SeqLen >=
ENCRYPTIONBLOCKSIZE) {
- UNLOCK_GLOBAL_MUTEX return KABADPROTOCOL;
+ UNLOCK_GLOBAL_MUTEX;
+ return KABADPROTOCOL;
}
memcpy(token->ticket, strings, token->ticketLen);
break;
default:
- UNLOCK_GLOBAL_MUTEX return KAINTERNALERROR;
+ UNLOCK_GLOBAL_MUTEX;
+ return KAINTERNALERROR;
}
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
afs_int32
{
afs_int32 code;
- LOCK_GLOBAL_MUTEX
-#ifdef AFS_S390_LINUX20_ENV
- code =
+ LOCK_GLOBAL_MUTEX;
+#if defined(AFS_S390_LINUX20_ENV) && !defined(AFS_S390X_LINUX20_ENV)
+ code =
ubik_Call_New(KAM_SetPassword, conn, 0, name, instance, 0, 0,
*newkey);
#else
- code =
+ code =
ubik_Call_New(KAM_SetPassword, conn, 0, name, instance, 0, *newkey);
#endif
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
#endif
RCSID
- ("$Header: /cvs/openafs/src/kauth/client.c,v 1.12 2003/07/15 23:15:16 shadow Exp $");
+ ("$Header: /cvs/openafs/src/kauth/client.c,v 1.12.2.1 2004/08/25 07:09:38 shadow Exp $");
#if defined(UKERNEL)
#include "afs/sysincludes.h"
char realm[MAXKTCREALMLEN];
afs_int32 code;
- LOCK_GLOBAL_MUTEX code = ka_CellToRealm(cell, realm, 0 /*local */ );
+ LOCK_GLOBAL_MUTEX;
+ code = ka_CellToRealm(cell, realm, 0 /*local */ );
if (code) /* just take his word for it */
strncpy(realm, cell, sizeof(realm));
else /* for backward compatibility */
StringToKey(str, realm, key);
else
Andrew_StringToKey(str, realm, key);
-UNLOCK_GLOBAL_MUTEX}
+ UNLOCK_GLOBAL_MUTEX;
+}
/* This prints out a prompt and reads a string from the terminal, turning off
echoing. If verify is requested it requests that the string be entered
char password[BUFSIZ];
afs_int32 code;
- LOCK_GLOBAL_MUTEX memset(key, 0, sizeof(struct ktc_encryptionKey));
+ LOCK_GLOBAL_MUTEX;
+ memset(key, 0, sizeof(struct ktc_encryptionKey));
code = read_pw_string(password, sizeof(password), prompt, verify);
if (code) {
- UNLOCK_GLOBAL_MUTEX return KAREADPW;
+ UNLOCK_GLOBAL_MUTEX;
+ return KAREADPW;
}
if (strlen(password) == 0) {
- UNLOCK_GLOBAL_MUTEX return KANULLPASSWORD;
+ UNLOCK_GLOBAL_MUTEX;
+ return KANULLPASSWORD;
}
ka_StringToKey(password, cell, key);
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
/* This performs the backslash quoting defined by AC_ParseLoginName. */
afs_int32 code;
static int inited = 0;
- LOCK_GLOBAL_MUTEX if (inited) {
- UNLOCK_GLOBAL_MUTEX return 0;
+ LOCK_GLOBAL_MUTEX;
+ if (inited) {
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
inited++;
initialize_U_error_table();
initialize_KTC_error_table();
initialize_ACFG_error_table();
code = ka_CellConfig(AFSDIR_CLIENT_ETC_DIRPATH);
- UNLOCK_GLOBAL_MUTEX if (code)
- return code;
+ UNLOCK_GLOBAL_MUTEX;
+ if (code)
+ return code;
return 0;
}
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/kauth/kadatabase.c,v 1.10 2003/12/07 22:49:26 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/kauth/kadatabase.c,v 1.10.2.1 2004/08/25 07:09:38 shadow Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
(keyCache[i].superseded == NEVERDATE);
info->kcInfo[j].keycksum = 0;
#if DEBUG_KEY_CACHE
- {
- int k;
- for (k = 0; k < sizeof(struct ktc_encryptionKey); k++)
- info->kcInfo[j].keycksum += ((char *)&keyCache[i].key)[k];
- }
+ {
+ int k;
+ for (k = 0; k < sizeof(struct ktc_encryptionKey); k++)
+ info->kcInfo[j].keycksum +=
+ ((char *)&keyCache[i].key)[k];
+ }
#endif
strcpy(principal, keyCache[i].name);
strcat(principal, ".");
#endif
RCSID
- ("$Header: /cvs/openafs/src/kauth/kalocalcell.c,v 1.8 2003/07/15 23:15:16 shadow Exp $");
+ ("$Header: /cvs/openafs/src/kauth/kalocalcell.c,v 1.8.2.1 2004/08/25 07:09:38 shadow Exp $");
#if defined(UKERNEL)
#include "afs/pthread_glock.h"
strcpy(cell_name, afs_LclCellName);
return 0;
#else /* UKERNEL */
- LOCK_GLOBAL_MUTEX if (conf)
- afsconf_Close(conf);
+ LOCK_GLOBAL_MUTEX;
+ if (conf)
+ afsconf_Close(conf);
conf = afsconf_Open(dir);
if (!conf) {
- UNLOCK_GLOBAL_MUTEX return KANOCELLS;
+ UNLOCK_GLOBAL_MUTEX;
+ return KANOCELLS;
}
code = afsconf_GetLocalCell(conf, cell_name, sizeof(cell_name));
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
#endif /* UKERNEL */
}
{
int code;
- LOCK_GLOBAL_MUTEX if (conf) {
- UNLOCK_GLOBAL_MUTEX return cell_name;
+ LOCK_GLOBAL_MUTEX;
+ if (conf) {
+ UNLOCK_GLOBAL_MUTEX;
+ return cell_name;
}
#ifdef UKERNEL
conf = afs_cdir;
if (!conf || code) {
printf("** Can't determine local cell name!\n");
conf = 0;
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
#endif /* UKERNEL */
- UNLOCK_GLOBAL_MUTEX return cell_name;
+ UNLOCK_GLOBAL_MUTEX;
+ return cell_name;
}
int
char cellname[MAXKTCREALMLEN];
struct afsconf_cell cellinfo; /* storage for cell info */
- LOCK_GLOBAL_MUTEX ka_LocalCell(); /* initialize things */
+ LOCK_GLOBAL_MUTEX;
+ ka_LocalCell(); /* initialize things */
if (!conf) {
- UNLOCK_GLOBAL_MUTEX return KANOCELLS;
+ UNLOCK_GLOBAL_MUTEX;
+ return KANOCELLS;
}
if ((cell == 0) || (strlen(cell) == 0)) {
cell = lcstring(cellname, cell, sizeof(cellname));
code = afsconf_GetCellInfo(conf, cell, 0, &cellinfo);
if (code) {
- UNLOCK_GLOBAL_MUTEX return KANOCELL;
+ UNLOCK_GLOBAL_MUTEX;
+ return KANOCELL;
}
cell = cellinfo.name;
}
strcpy(fullCell, cell);
if (alocal)
*alocal = local;
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
int
{
int code;
- LOCK_GLOBAL_MUTEX code = ka_ExpandCell(cell, realm, local);
+ LOCK_GLOBAL_MUTEX;
+ code = ka_ExpandCell(cell, realm, local);
ucstring(realm, realm, MAXKTCREALMLEN);
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/kauth/kaprocs.c,v 1.16 2004/04/20 14:56:16 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/kauth/kaprocs.c,v 1.16.2.1 2004/08/25 07:09:38 shadow Exp $");
#include <afs/stds.h>
#include <errno.h>
code = KAANSWERTOOLONG;
if (oanswer->MaxSeqLen <
- sizeof(struct ka_ticketAnswer) - 5 * MAXKTCNAMELEN - MAXKTCTICKETLEN + ticketLen)
+ sizeof(struct ka_ticketAnswer) - 5 * MAXKTCNAMELEN - MAXKTCTICKETLEN +
+ ticketLen)
return code;
answer = (struct ka_ticketAnswer *)oanswer->SeqBody;
case 0:
code = KAANSWERTOOLONG;
if (oanswer->MaxSeqLen <
- sizeof(struct ka_getTicketAnswer) - 5 * MAXKTCNAMELEN - MAXKTCTICKETLEN + ticketLen)
+ sizeof(struct ka_getTicketAnswer) - 5 * MAXKTCNAMELEN -
+ MAXKTCTICKETLEN + ticketLen)
goto abort;
answer = (struct ka_getTicketAnswer *)oanswer->SeqBody;
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/kauth/kdb.c,v 1.7 2003/07/15 23:15:16 shadow Exp $");
+ ("$Header: /cvs/openafs/src/kauth/kdb.c,v 1.7.2.1 2004/08/25 07:18:06 shadow Exp $");
#include <fcntl.h>
#include <sys/types.h>
printf("Printing all entries found in %s\n", dbmfile);
for (key = dbm_firstkey(kdb); key.dptr;
key = afs_dbm_nextkey(kdb, key), cnt++) {
- printf("\t%s\n", key.dptr);
+ if (as->parms[2].items) {
+ data = dbm_fetch(kdb, key);
+ if (!data.dptr) {
+ fprintf(stderr, "%s: no entry exists\n", ti->data);
+ continue;
+ }
+ if (data.dsize != sizeof(kalog_elt)) {
+ fprintf(stderr, "%s: data came out corrupt\n", ti->data);
+ continue;
+ }
+ memcpy(&rdata, data.dptr, sizeof(kalog_elt));
+ if (! as->parms[3].items) {
+ char *hostName;
+ hostName = hostutil_GetNameByINet(rdata.host);
+ printf("%s: last operation from host %s at %s", key.dptr,
+ hostName, ctime(&rdata.last_use));
+ } else {
+ char *hostIP;
+ hostIP = afs_inet_ntoa(rdata.host);
+ printf("%s: last operation from host %s at %s", key.dptr,
+ hostIP, ctime(&rdata.last_use));
+ }
+ } else {
+ printf("\t%s\n", key.dptr);
+ }
}
printf("%d entries were found\n", cnt);
} else {
cmd_AddParm(ts, "-dbmfile", CMD_SINGLE, CMD_OPTIONAL, dbmfile_help);
cmd_AddParm(ts, "-key", CMD_SINGLE, CMD_OPTIONAL,
"extract entries that match specified key");
+ cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL, "print long info for each entry");
+ cmd_AddParm(ts, "-numeric", CMD_FLAG, CMD_OPTIONAL, "addresses only");
code = cmd_Dispatch(argc, argv);
return code;
}
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/kauth/kpasswd.c,v 1.14 2004/06/05 20:11:06 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/kauth/kpasswd.c,v 1.14.2.1 2004/08/25 07:09:38 shadow Exp $");
#include <afs/stds.h>
#include <sys/types.h>
char *arock;
struct cmd_syndesc *as;
{
- char name[MAXKTCNAMELEN]="";
- char instance[MAXKTCNAMELEN]="";
- char cell[MAXKTCREALMLEN]="";
- char realm[MAXKTCREALMLEN]="";
+ char name[MAXKTCNAMELEN] = "";
+ char instance[MAXKTCNAMELEN] = "";
+ char cell[MAXKTCREALMLEN] = "";
+ char realm[MAXKTCREALMLEN] = "";
afs_int32 serverList[MAXSERVERS];
char *lcell; /* local cellname */
int code;
#include <mit-cpyright.h>
- /* #include <krb_conf.h> *//* removed 890221 */
+ /* #include <krb_conf.h> *//* removed 890221 */
#ifndef PROT_DEFS
#define PROT_DEFS
/* Routines to create and read packets may be found in prot.c */
- /* KTEXT create_auth_reply(); *//* removed 890221 */
- /* KTEXT create_death_packet(); *//* removed 890221 */
- /* KTEXT pkt_cipher(); *//* removed 890221 */
+ /* KTEXT create_auth_reply(); *//* removed 890221 */
+ /* KTEXT create_death_packet(); *//* removed 890221 */
+ /* KTEXT pkt_cipher(); *//* removed 890221 */
/* Message types , always leave lsb for byte order */
#endif
RCSID
- ("$Header: /cvs/openafs/src/kauth/token.c,v 1.9 2003/07/15 23:15:17 shadow Exp $");
+ ("$Header: /cvs/openafs/src/kauth/token.c,v 1.9.2.1 2004/08/25 07:09:38 shadow Exp $");
#if defined(UKERNEL)
#include "afs/sysincludes.h"
afs_int32
ka_GetAuthToken(char *name, char *instance, char *cell,
- struct ktc_encryptionKey *key, afs_int32 lifetime,
+ struct ktc_encryptionKey * key, afs_int32 lifetime,
afs_int32 * pwexpires)
{
afs_int32 code;
char realm[MAXKTCREALMLEN];
struct ktc_principal client, server;
- LOCK_GLOBAL_MUTEX code = ka_ExpandCell(cell, cellname, 0 /*local */ );
+ LOCK_GLOBAL_MUTEX;
+ code = ka_ExpandCell(cell, cellname, 0 /*local */ );
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
cell = cellname;
/* get an unauthenticated connection to desired cell */
code = ka_AuthServerConn(cell, KA_AUTHENTICATION_SERVICE, 0, &conn);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
code =
ka_Authenticate(name, instance, cell, conn,
KA_TICKET_GRANTING_SERVICE, key, now, now + lifetime,
&token, pwexpires);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
code = ubik_ClientDestroy(conn);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
code = ka_CellToRealm(cell, realm, 0 /*local */ );
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
strcpy(client.name, name);
strcpy(client.instance, instance);
strcpy(server.instance, realm);
strcpy(server.cell, cell);
code = ktc_SetToken(&server, &token, &client, 0);
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
afs_int32
char authDomain[MAXKTCREALMLEN];
int local;
- LOCK_GLOBAL_MUTEX code = ka_ExpandCell(cell, cellname, 0 /*local */ );
+ LOCK_GLOBAL_MUTEX;
+ code = ka_ExpandCell(cell, cellname, 0 /*local */ );
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
cell = cellname;
code =
ktc_GetToken(&server, token, sizeof(struct ktc_token), &client);
if (!code) {
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
}
code = ka_CellToRealm(cell, realm, &local);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
/* get TGS ticket for proper realm */
}
if (code && local) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
} else if (code) {
/* here we invoke the inter-cell mechanism */
ktc_GetToken(&auth_server, &cell_token, sizeof(cell_token),
&client);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
/* get a connection to the local cell */
if ((code =
ka_AuthServerConn(localCell, KA_TICKET_GRANTING_SERVICE, 0,
&conn))) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
/* get foreign auth ticket */
if ((code =
client.instance, conn, now, now + lifetime,
&cell_token, "" /* local auth domain */ ,
&auth_token))) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
code = ubik_ClientDestroy(conn);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
conn = 0;
lcstring(auth_server.cell, localCell, sizeof(auth_server.cell));
ucstring(authDomain, localCell, sizeof(authDomain));
if ((code = ktc_SetToken(&auth_server, &auth_token, &client, 0))) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
}
if ((code =
ka_AuthServerConn(cell, KA_TICKET_GRANTING_SERVICE, 0, &conn))) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
if ((code =
ka_GetToken(name, instance, cell, client.name, client.instance, conn,
now, now + lifetime, &auth_token, authDomain, token))) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
code = ubik_ClientDestroy(conn);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
if ((code =
ktc_SetToken(&server, token, &client,
dosetpag ? AFS_SETTOK_SETPAG : 0))) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
afs_int32
struct ktc_token localToken;
char cellname[MAXKTCREALMLEN];
- LOCK_GLOBAL_MUTEX code = ka_ExpandCell(cell, cellname, 0 /*local */ );
+ LOCK_GLOBAL_MUTEX;
+ code = ka_ExpandCell(cell, cellname, 0 /*local */ );
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
cell = cellname;
code =
ktc_GetToken(&server, token, sizeof(struct ktc_token), &client);
if (code == 0) {
- UNLOCK_GLOBAL_MUTEX return 0;
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
}
if ((name == 0) || (key == 0)) {
/* just lookup in cache don't get new one */
- UNLOCK_GLOBAL_MUTEX return KANOTICKET;
+ UNLOCK_GLOBAL_MUTEX;
+ return KANOTICKET;
}
/* get an unauthenticated connection to desired cell */
code = ka_AuthServerConn(cell, KA_AUTHENTICATION_SERVICE, 0, &conn);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
code =
ka_Authenticate(name, instance, cell, conn, KA_MAINTENANCE_SERVICE,
key, now, now + lifetime, token, 0);
(void)ubik_ClientDestroy(conn);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
strcpy(client.name, name);
strcpy(client.instance, instance);
strncpy(client.cell, cell, sizeof(client.cell));
code = ktc_SetToken(&server, token, &client, 0);
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
char cellname[MAXKTCREALMLEN];
afs_int32 pwexpires;
- LOCK_GLOBAL_MUTEX code = ka_ExpandCell(cell, cellname, 0 /*local */ );
+ LOCK_GLOBAL_MUTEX;
+ code = ka_ExpandCell(cell, cellname, 0 /*local */ );
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
cell = cellname;
/* get an unauthenticated connection to desired cell */
code = ka_AuthServerConn(cell, KA_AUTHENTICATION_SERVICE, 0, &conn);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
code =
KA_TICKET_GRANTING_SERVICE, key, now,
now + MAXKTCTICKETLIFETIME, &token, &pwexpires);
if (code) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
code = ubik_ClientDestroy(conn);
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
#endif
RCSID
- ("$Header: /cvs/openafs/src/kauth/user.c,v 1.11 2003/07/15 23:15:17 shadow Exp $");
+ ("$Header: /cvs/openafs/src/kauth/user.c,v 1.11.2.1 2004/08/25 07:09:38 shadow Exp $");
#if defined(UKERNEL)
#include "afs/sysincludes.h"
afs_int32
GetTickets(char *name, char *instance, char *realm,
- struct ktc_encryptionKey *key, Date lifetime,
+ struct ktc_encryptionKey * key, Date lifetime,
afs_int32 * pwexpires, afs_int32 flags)
{
afs_int32 code;
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/kauth/user_nt.c,v 1.12 2003/11/29 21:38:00 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/kauth/user_nt.c,v 1.12.2.1 2004/08/25 07:09:38 shadow Exp $");
#include <afs/stds.h>
(void)fflush(stdout);
}
FD_ZERO(&readfds);
- FD_SET(f,&readfds);
+ FD_SET(f, &readfds);
errno = 0;
/* select - either recv is ready, or timeout */
/* see if timeout or error or wrong descriptor */
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/libadmin/adminutil/afs_utilAdmin.c,v 1.7 2003/07/15 23:15:23 shadow Exp $");
+ ("$Header: /cvs/openafs/src/libadmin/adminutil/afs_utilAdmin.c,v 1.7.2.1 2004/08/25 07:09:38 shadow Exp $");
#include <afs/stds.h>
#include <afs/afs_Admin.h>
if (num_converted == 4) {
*serverAddress = (part1 << 24) | (part2 << 16) | (part3 << 8) | part4;
} else {
- LOCK_GLOBAL_MUTEX server = gethostbyname(serverName);
+ LOCK_GLOBAL_MUTEX;
+ server = gethostbyname(serverName);
if (server != NULL) {
memcpy((void *)serverAddress, (const void *)server->h_addr,
sizeof(serverAddress));
UNLOCK_GLOBAL_MUTEX;
goto fail_util_AdminServerAddressGetFromName;
}
- UNLOCK_GLOBAL_MUTEX}
+ UNLOCK_GLOBAL_MUTEX;
+ }
rc = 1;
fail_util_AdminServerAddressGetFromName:
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/libadmin/client/afs_clientAdmin.c,v 1.9 2003/07/15 23:15:28 shadow Exp $");
+ ("$Header: /cvs/openafs/src/libadmin/client/afs_clientAdmin.c,v 1.9.2.1 2004/08/25 07:09:39 shadow Exp $");
#include <afs/stds.h>
#include "afs_clientAdmin.h"
* Iterate over the list and fill in the hostname of each of the servers
*/
- LOCK_GLOBAL_MUTEX for (iserv = 0; iserv < serv->total; iserv++) {
+ LOCK_GLOBAL_MUTEX;
+ for (iserv = 0; iserv < serv->total; iserv++) {
int addr = htonl(serv->server[iserv].serverAddress[0]);
host = gethostbyaddr((const char *)&addr, sizeof(int), AF_INET);
if (host != NULL) {
AFS_MAX_SERVER_NAME_LEN);
}
}
- UNLOCK_GLOBAL_MUTEX
- if (IteratorInit
+ UNLOCK_GLOBAL_MUTEX;
+ if (IteratorInit
(iter, (void *)serv, GetServerRPC, GetServerFromCache, NULL, NULL,
&tst)) {
*iterationIdP = (void *)iter;
CCFLAGS = $(COMMON_KERN_CFLAGS) -fsigned-char
DEFINES = $(COMMON_DEFINES) -D__s390__
+<s390x_linux22 s390x_linux24>
+CCFLAGS = $(COMMON_KERN_CFLAGS) -fsigned-char
+DEFINES = $(COMMON_DEFINES) -D__s390x__
+
<sparc_linux22 sparc_linux24>
LD = ld -m elf32_sparc
CCFLAGS = $(COMMON_KERN_CFLAGS) -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
ln -fs ${LINUX_KERNEL_PATH}/include/asm-x86_64 asm
<s390_linux22 s390_linux24>
ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390 asm
+<s390x_linux22 s390x_linux24>
+ ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390x asm
<ppc_linux22 ppc_linux24>
ln -fs ${LINUX_KERNEL_PATH}/include/asm-ppc asm
<ppc64_linux24>
afs_krb_get_lrealm;
pr_NameToId;
pr_IdToName;
+ pr_ListMembers;
+ pr_End;
+ pr_SNameToId;
+ afs_get_pag_from_groups;
+ setpag;
local:
*;
$(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c -I${TOP_INCDIR} -KPIC -G0 ${srcdir}/process.s;; \
sgi_61 | sgi_62 | sgi_63 ) \
$(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c ${XCFLAGS} -I${TOP_INCDIR} -KPIC -G0 ${srcdir}/process.s;; \
- s390*) \
- /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s >process.ss; \
+ s390_*) \
+ /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s390.s >process.ss; \
+ ${AS} -ahlns process.ss -o process.o >process.lst; \
+ $(RM) process.ss ;; \
+ s390x_*) \
+ /lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s390x.s >process.ss; \
${AS} -ahlns process.ss -o process.o >process.lst; \
$(RM) process.ss ;; \
*_darwin* ) \
$(CC) ${LWP_DBG} ${LWP_OPTMZ} -c ${XCFLAGS} -I${TOP_INCDIR} ${srcdir}/process.s;; \
i386_*bsd*) \
cp ${srcdir}/process.i386.s process.S ; \
- ${CCOBJ} -E -I${srcdir} -I${TOP_INCDIR} process.S >process.ss ; \
+ ${CCOBJ} -DIGNORE_STDS_H -E -I${srcdir} -I${TOP_INCDIR} process.S > process.ss ; \
${AS} process.ss -o process.o ; \
$(RM) -f process.S ;;\
ncrx86_* | sunx86_*) \
#ifdef AFS_PTHREAD_ENV
#include <assert.h>
#include <pthread.h>
-#define LOCK_LOCK(A) assert(pthread_mutex_lock(&(A)->mutex) == 0);
-#define LOCK_UNLOCK(A) assert(pthread_mutex_unlock(&(A)->mutex) == 0);
+#define LOCK_LOCK(A) assert(pthread_mutex_lock(&(A)->mutex) == 0)
+#define LOCK_UNLOCK(A) assert(pthread_mutex_unlock(&(A)->mutex) == 0)
#else /* AFS_PTHREAD_ENV */
#define LOCK_LOCK(A)
#define LOCK_UNLOCK(A)
#define ObtainReadLock(lock)\
BEGINMAC \
- LOCK_LOCK(lock) \
+ LOCK_LOCK(lock); \
if (!((lock)->excl_locked & WRITE_LOCK) && !(lock)->wait_states)\
(lock) -> readers_reading++;\
else\
Afs_Lock_Obtain(lock, READ_LOCK); \
- LOCK_UNLOCK(lock) \
+ LOCK_UNLOCK(lock); \
ENDMAC
#define ObtainReadLockNoBlock(lock, code)\
BEGINMAC \
- LOCK_LOCK(lock) \
+ LOCK_LOCK(lock); \
if (!((lock)->excl_locked & WRITE_LOCK) && !(lock)->wait_states) {\
(lock) -> readers_reading++;\
code = 0;\
}\
else\
code = -1; \
- LOCK_UNLOCK(lock) \
+ LOCK_UNLOCK(lock); \
ENDMAC
#define ObtainWriteLock(lock)\
BEGINMAC \
- LOCK_LOCK(lock) \
+ LOCK_LOCK(lock); \
if (!(lock)->excl_locked && !(lock)->readers_reading)\
(lock) -> excl_locked = WRITE_LOCK;\
else\
Afs_Lock_Obtain(lock, WRITE_LOCK); \
- LOCK_UNLOCK(lock) \
+ LOCK_UNLOCK(lock); \
ENDMAC
#define ObtainWriteLockNoBlock(lock, code)\
BEGINMAC \
- LOCK_LOCK(lock) \
+ LOCK_LOCK(lock); \
if (!(lock)->excl_locked && !(lock)->readers_reading) {\
(lock) -> excl_locked = WRITE_LOCK;\
code = 0;\
}\
else\
code = -1; \
- LOCK_UNLOCK(lock) \
+ LOCK_UNLOCK(lock); \
ENDMAC
#define ObtainSharedLock(lock)\
BEGINMAC \
- LOCK_LOCK(lock) \
+ LOCK_LOCK(lock); \
if (!(lock)->excl_locked && !(lock)->wait_states)\
(lock) -> excl_locked = SHARED_LOCK;\
else\
Afs_Lock_Obtain(lock, SHARED_LOCK); \
- LOCK_UNLOCK(lock) \
+ LOCK_UNLOCK(lock); \
ENDMAC
#define ObtainSharedLockNoBlock(lock, code)\
BEGINMAC \
- LOCK_LOCK(lock) \
+ LOCK_LOCK(lock); \
if (!(lock)->excl_locked && !(lock)->wait_states) {\
(lock) -> excl_locked = SHARED_LOCK;\
code = 0;\
}\
else\
code = -1; \
- LOCK_UNLOCK(lock) \
+ LOCK_UNLOCK(lock); \
ENDMAC
#define BoostSharedLock(lock)\
BEGINMAC \
- LOCK_LOCK(lock) \
+ LOCK_LOCK(lock); \
if (!(lock)->readers_reading)\
(lock)->excl_locked = WRITE_LOCK;\
else\
Afs_Lock_Obtain(lock, BOOSTED_LOCK); \
- LOCK_UNLOCK(lock) \
+ LOCK_UNLOCK(lock); \
ENDMAC
/* this must only be called with a WRITE or boosted SHARED lock! */
#define UnboostSharedLock(lock)\
BEGINMAC\
- LOCK_LOCK(lock) \
+ LOCK_LOCK(lock); \
(lock)->excl_locked = SHARED_LOCK; \
if((lock)->wait_states) \
Afs_Lock_ReleaseR(lock); \
- LOCK_UNLOCK(lock) \
+ LOCK_UNLOCK(lock); \
ENDMAC
#ifdef notdef
#define ReleaseReadLock(lock)\
BEGINMAC\
- LOCK_LOCK(lock) \
+ LOCK_LOCK(lock); \
if (!--(lock)->readers_reading && (lock)->wait_states)\
Afs_Lock_ReleaseW(lock) ; \
- LOCK_UNLOCK(lock) \
+ LOCK_UNLOCK(lock); \
ENDMAC
#define ReleaseWriteLock(lock)\
BEGINMAC\
- LOCK_LOCK(lock) \
+ LOCK_LOCK(lock); \
(lock)->excl_locked &= ~WRITE_LOCK;\
if ((lock)->wait_states) Afs_Lock_ReleaseR(lock);\
- LOCK_UNLOCK(lock) \
+ LOCK_UNLOCK(lock); \
ENDMAC
#ifdef notdef
/* can be used on shared or boosted (write) locks */
#define ReleaseSharedLock(lock)\
BEGINMAC\
- LOCK_LOCK(lock) \
+ LOCK_LOCK(lock); \
(lock)->excl_locked &= ~(SHARED_LOCK | WRITE_LOCK);\
if ((lock)->wait_states) Afs_Lock_ReleaseR(lock);\
- LOCK_UNLOCK(lock) \
+ LOCK_UNLOCK(lock); \
ENDMAC
#ifdef notdef
/* convert a write lock to a read lock */
#define ConvertWriteToReadLock(lock)\
BEGINMAC\
- LOCK_LOCK(lock) \
+ LOCK_LOCK(lock); \
(lock)->excl_locked &= ~WRITE_LOCK;\
(lock)->readers_reading++;\
if ((lock)->wait_states & READ_LOCK) \
Afs_Lock_WakeupR(lock) ; \
- LOCK_UNLOCK(lock) \
+ LOCK_UNLOCK(lock); \
ENDMAC
/* I added this next macro to make sure it is safe to nuke a lock -- Mike K. */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /cvs/openafs/src/lwp/lwp.c,v 1.27 2004/07/28 20:59:58 shadow Exp $");
+RCSID("$Header: /cvs/openafs/src/lwp/lwp.c,v 1.27.2.1 2004/08/25 07:03:40 shadow Exp $");
#include <stdlib.h>
#include <stdio.h>
#define MINFRAME 128
#define STACK_ALIGN 8
#else
+#ifdef __s390x__
+#define MINFRAME 160
+#define STACK_ALIGN 8
+#else
#ifdef __s390__
#define MINFRAME 96
#define STACK_ALIGN 8
#define STACK_ALIGN 4
#endif
#endif
+#endif
/* Debugging macro */
#ifdef DEBUG
* "ojala que es correcto!"
*/
-#define IGNORE_STDS_H 1
-#include <afs/param.h>
#include <lwp_elf.h>
.file "process.s"
.extern PRE_Block[ua]
#endif /* RIOS */
-#if defined(AFS_S390_LINUX20_ENV)
- /* Linux for S/390 (31 bit)
- *
- * Written by Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
- *
- * additional munging by Adam Thornton <adam@sinenomine.net>
- */
- .file "process.s"
-
- .globl savecontext
- .type savecontext,%function
- /*
- * savecontext(f, area1, newsp)
- * int (*f)(); struct savearea *area1; char *newsp;
- * f - r2
- * area1 - r3
- * newsp - r4
- */
-
- /*
- * struct savearea {
- * char *topstack;
- * }
- */
-
-P_PRE: .long PRE_Block
-P_ABORT: .long abort
-
-savecontext:
- stm %r6,%r15,24(%r15) /* Save our registers */
- lr %r1,%r15
- ahi %r15,-96 /* Move out of harm's way */
- st %r1,0(%r15)
- bras %r5,.L0 /* Get A(A(PRE_Block)) */
- .long PRE_Block
- .L0:
- l %r5,0(%r5) /* Get A(PRE_Block) */
- mvi 3(%r5),1 /* Set it */
- lr %r6,%r3 /* Get base of savearea */
- st %r15,0(%r3) /* Save stack pointer */
- ltr %r4,%r4 /* If new sp is 0 */
- jz .L1 /* ... don't change sp */
- lr %r15,%r4 /* Set new stack pointer */
- .L1:
- br %r2 /* Call the routine */
- /* Can't get here....*/
-
- bras %r5,.L2
- .long abort
- .L2:
- l %r5,0(%r5)
- balr %r14,%r5
-
- .savecontext_end:
- .size savecontext,.savecontext_end-savecontext
-
- /*
- * returnto(area2)
- * struct savearea *area2;
- *
- * area2 - r2
- */
- .globl returnto
- .type returnto,%function
-returnto:
- l %r15,0(%r2) /* New frame, to get correct pointer*/
- bras %r5,.L3 /* Get A(A(PRE_Block))
- */
- .long PRE_Block
- .L3:
- l %r5,0(%r5) /* Get A(PRE_Block) */
- /*xc 0(4,%r5),0(%r5) /* Clear it */
- mvi 3(%r5),0 /* Clear it */
- l %r15,0(%r15)
- lm %r6,%r15,24(%r15) /* Restore registers */
- br %r14 /* Return */
-
- /* Can't happen */
- la %r2,1234
- bras %r5,.L4
- .long abort
- .L4:
- l %r5,0(%r5)
- basr %r14,%r5
- .returnto_end:
- .size returnto,.returnto_end-returnto
-#endif /* AFS_S390_LINUX20_ENV */
#ifdef mc68000
/*
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Linux for S/390 (31 bit)
+ *
+ * Written by Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+ *
+ * additional munging by Adam Thornton <adam@sinenomine.net>
+ */
+
+#define IGNORE_STDS_H 1
+#include <afs/param.h>
+
+ .file "process.s"
+
+ .globl savecontext
+ .type savecontext,%function
+ /*
+ * savecontext(f, area1, newsp)
+ * int (*f)(); struct savearea *area1; char *newsp;
+ * f - r2
+ * area1 - r3
+ * newsp - r4
+ */
+
+ /*
+ * struct savearea {
+ * char *topstack;
+ * }
+ */
+
+P_PRE: .long PRE_Block
+P_ABORT: .long abort
+
+savecontext:
+ stm %r6,%r15,24(%r15) /* Save our registers */
+ lr %r1,%r15
+ ahi %r15,-96 /* Move out of harm's way */
+ st %r1,0(%r15)
+ bras %r5,.L0 /* Get A(A(PRE_Block)) */
+ .long PRE_Block
+ .L0:
+ l %r5,0(%r5) /* Get A(PRE_Block) */
+ mvi 3(%r5),1 /* Set it */
+ lr %r6,%r3 /* Get base of savearea */
+ st %r15,0(%r3) /* Save stack pointer */
+ ltr %r4,%r4 /* If new sp is 0 */
+ jz .L1 /* ... don't change sp */
+ lr %r15,%r4 /* Set new stack pointer */
+ .L1:
+ br %r2 /* Call the routine */
+ /* Can't get here....*/
+
+ bras %r5,.L2
+ .long abort
+ .L2:
+ l %r5,0(%r5)
+ balr %r14,%r5
+
+ .savecontext_end:
+ .size savecontext,.savecontext_end-savecontext
+
+ /*
+ * returnto(area2)
+ * struct savearea *area2;
+ *
+ * area2 - r2
+ */
+ .globl returnto
+ .type returnto,%function
+returnto:
+ l %r15,0(%r2) /* New frame, to get correct pointer*/
+ bras %r5,.L3 /* Get A(A(PRE_Block))
+ */
+ .long PRE_Block
+ .L3:
+ l %r5,0(%r5) /* Get A(PRE_Block) */
+ /*xc 0(4,%r5),0(%r5) /* Clear it */
+ mvi 3(%r5),0 /* Clear it */
+ l %r15,0(%r15)
+ lm %r6,%r15,24(%r15) /* Restore registers */
+ br %r14 /* Return */
+
+ /* Can't happen */
+ la %r2,1234
+ bras %r5,.L4
+ .long abort
+ .L4:
+ l %r5,0(%r5)
+ basr %r14,%r5
+ .returnto_end:
+ .size returnto,.returnto_end-returnto
+
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ *
+ * Linux for S/390X (64 bit)
+ * by Soewono Effendi <Soewono.Effendi@sysgo.de>
+ * & Horst Birthelmer <Horst.Birthelmer@sysgo.de>
+ *
+ * based on Linux for S/390 (31 bit)
+ * Written by Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+*/
+
+#define IGNORE_STDS_H 1
+#include <afs/param.h>
+
+ .file "process.s"
+
+ .globl savecontext
+ .type savecontext,%function
+ /*
+ * savecontext(f, area1, newsp)
+ * int (*f)(); struct savearea *area1; char *newsp;
+ * f - r2
+ * area1 - r3
+ * newsp - r4
+ */
+
+ /*
+ * struct savearea {
+ * char *topstack;
+ * }
+ */
+
+P_PRE: .long PRE_Block
+P_ABORT: .long abort
+
+savecontext:
+ stmg %r6,%r15,48(%r15) /* Save our registers */
+ lgr %r1,%r15
+ aghi %r15,-160
+ stg %r1,0(%r15)
+ brasl %r5,.L0 /* Get A(A(PRE_Block)) */
+ .long PRE_Block
+ .L0:
+ l %r5,0(%r5) /* Get A(PRE_Block) */
+ mvi 3(%r5),1 /* Set it */
+ lgr %r6,%r3 /* Get base of savearea */
+ stg %r15,0(%r3) /* Save stack pointer */
+ ltgr %r4,%r4 /* If new sp is 0 */
+ jz .L1 /* ... don't change sp */
+ lgr %r15,%r4 /* Set new stack pointer */
+ .L1:
+ br %r2 /* Call the routine */
+ /* Can't get here....*/
+
+ brasl %r5,.L2
+ .long abort
+ .L2:
+ l %r5,0(%r5)
+ balr %r14,%r5
+
+ .savecontext_end:
+ .size savecontext,.savecontext_end-savecontext
+
+ /*
+ * returnto(area2)
+ * struct savearea *area2;
+ *
+ * area2 - r2
+ */
+ .globl returnto
+ .type returnto,%function
+returnto:
+ lg %r15,0(%r2) /* New frame, to get correct pointer*/
+ brasl %r5,.L3 /* Get A(A(PRE_Block)) */
+ .long PRE_Block
+ .L3:
+ l %r5,0(%r5) /* Get A(PRE_Block) */
+ /*xc 0(4,%r5),0(%r5) /* Clear it */
+ mvi 3(%r5),0 /* Clear it */
+ lg %r15,0(%r15)
+ lmg %r6,%r15,48(%r15) /* Restore registers */
+ br %r14 /* Return */
+
+ /* Can't happen */
+ la %r2,1234
+ brasl %r5,.L4
+ .long abort
+ .L4:
+ l %r5,0(%r5)
+ basr %r14,%r5
+ .returnto_end:
+ .size returnto,.returnto_end-returnto
+
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/rx/AIX/rx_knet.c,v 1.11 2003/07/15 23:16:14 shadow Exp $");
+ ("$Header: /cvs/openafs/src/rx/AIX/rx_knet.c,v 1.11.2.1 2004/08/25 07:16:16 shadow Exp $");
#ifdef AFS_AIX41_ENV
#include "rx/rx_kcommon.h"
rxk_portRocks[i] = NULL;
}
}
+ del_input_type(0xdead);
}
}
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/rx/LINUX/rx_knet.c,v 1.23 2004/07/29 02:46:48 shadow Exp $");
+ ("$Header: /cvs/openafs/src/rx/LINUX/rx_knet.c,v 1.23.2.1 2004/08/25 07:41:00 shadow Exp $");
#include <linux/version.h>
#ifdef AFS_LINUX22_ENV
int code;
-#ifdef LINUX_KERNEL_IS_SELINUX
+ /* We need a better test for this. if you need it back, tell us
+ * how to detect it.
+ */
+#if 0/*def LINUX_KERNEL_IS_SELINUX*/
code = sock_create(AF_INET, SOCK_DGRAM, IPPROTO_UDP, &sockp, 0);
#else
code = sock_create(AF_INET, SOCK_DGRAM, IPPROTO_UDP, &sockp);
#endif
RCSID
- ("$Header: /cvs/openafs/src/rx/rx.c,v 1.58 2004/08/04 19:41:53 shadow Exp $");
+ ("$Header: /cvs/openafs/src/rx/rx.c,v 1.58.2.2 2004/08/25 07:13:09 shadow Exp $");
#ifdef KERNEL
#include "afs/sysincludes.h"
pthread_once_t rx_once_init = PTHREAD_ONCE_INIT;
#define INIT_PTHREAD_LOCKS \
-assert(pthread_once(&rx_once_init, rxi_InitPthread)==0);
+assert(pthread_once(&rx_once_init, rxi_InitPthread)==0)
/*
* The rx_stats_mutex mutex protects the following global variables:
* rxi_dataQuota
* rx_epoch
*/
-#define LOCK_EPOCH assert(pthread_mutex_lock(&epoch_mutex)==0);
-#define UNLOCK_EPOCH assert(pthread_mutex_unlock(&epoch_mutex)==0);
+#define LOCK_EPOCH assert(pthread_mutex_lock(&epoch_mutex)==0)
+#define UNLOCK_EPOCH assert(pthread_mutex_unlock(&epoch_mutex)==0)
#else
#define LOCK_EPOCH
#define UNLOCK_EPOCH
void
rx_SetEpoch(afs_uint32 epoch)
{
- LOCK_EPOCH rx_epoch = epoch;
-UNLOCK_EPOCH}
+ LOCK_EPOCH;
+ rx_epoch = epoch;
+ UNLOCK_EPOCH;
+}
/* Initialize rx. A port number may be mentioned, in which case this
* becomes the default port number for any service installed later.
* rxinit_status
*/
-#define LOCK_RX_INIT assert(pthread_mutex_lock(&rx_init_mutex)==0);
-#define UNLOCK_RX_INIT assert(pthread_mutex_unlock(&rx_init_mutex)==0);
+#define LOCK_RX_INIT assert(pthread_mutex_lock(&rx_init_mutex)==0)
+#define UNLOCK_RX_INIT assert(pthread_mutex_unlock(&rx_init_mutex)==0)
#else
#define LOCK_RX_INIT
#define UNLOCK_RX_INIT
#endif
-int
+int
rx_InitHost(u_int host, u_int port)
{
#ifdef KERNEL
SPLVAR;
- INIT_PTHREAD_LOCKS LOCK_RX_INIT if (rxinit_status == 0) {
+ INIT_PTHREAD_LOCKS;
+ LOCK_RX_INIT;
+ if (rxinit_status == 0) {
tmp_status = rxinit_status;
- UNLOCK_RX_INIT return tmp_status; /* Already started; return previous error code. */
+ UNLOCK_RX_INIT;
+ return tmp_status; /* Already started; return previous error code. */
}
#ifdef AFS_NT40_ENV
if (afs_winsockInit() < 0)
rx_socket = rxi_GetHostUDPSocket(host, (u_short) port);
if (rx_socket == OSI_NULLSOCKET) {
- UNLOCK_RX_INIT return RX_ADDRINUSE;
+ UNLOCK_RX_INIT;
+ return RX_ADDRINUSE;
}
#ifdef RX_ENABLE_LOCKS
#ifdef RX_LOCKS_DB
AFS_RXGUNLOCK();
USERPRI;
tmp_status = rxinit_status = 0;
- UNLOCK_RX_INIT return tmp_status;
+ UNLOCK_RX_INIT;
+ return tmp_status;
}
-int rx_Init(u_int port)
+int
+rx_Init(u_int port)
{
return rx_InitHost(htonl(INADDR_ANY), port);
}
{
register struct rx_connection **conn_ptr, **conn_end;
- INIT_PTHREAD_LOCKS LOCK_RX_INIT if (rxinit_status == 1) {
- UNLOCK_RX_INIT return; /* Already shutdown. */
+ INIT_PTHREAD_LOCKS;
+ LOCK_RX_INIT;
+ if (rxinit_status == 1) {
+ UNLOCK_RX_INIT;
+ return; /* Already shutdown. */
}
rxi_DeleteCachedConnections();
if (rx_connHashTable) {
rxi_flushtrace();
rxinit_status = 1;
-UNLOCK_RX_INIT}
+ UNLOCK_RX_INIT;
+}
#endif
/* if we wakeup packet waiter too often, can get in loop with two
if (type == RX_CLIENT_CONNECTION && pp->port == port)
break;
/* So what happens when it's a callback connection? */
- if (/*type == RX_CLIENT_CONNECTION &&*/ (conn->epoch & 0x80000000))
+ if ( /*type == RX_CLIENT_CONNECTION && */
+ (conn->epoch & 0x80000000))
break;
}
if (!flag) {
if (call->flags & RX_CALL_WAIT_PROC) {
/* Conservative: I don't think this should happen */
call->flags &= ~RX_CALL_WAIT_PROC;
- MUTEX_ENTER(&rx_stats_mutex);
- rx_nWaiting--;
- MUTEX_EXIT(&rx_stats_mutex);
- if (queue_IsOnQueue(call))
- queue_Remove(call);
+ if (queue_IsOnQueue(call)) {
+ queue_Remove(call);
+ MUTEX_ENTER(&rx_stats_mutex);
+ rx_nWaiting--;
+ MUTEX_EXIT(&rx_stats_mutex);
+ }
}
call->state = RX_STATE_ACTIVE;
call->mode = RX_MODE_RECEIVING;
* counter
*/
-#define LOCK_RX_DEBUG assert(pthread_mutex_lock(&rx_debug_mutex)==0);
-#define UNLOCK_RX_DEBUG assert(pthread_mutex_unlock(&rx_debug_mutex)==0);
+#define LOCK_RX_DEBUG assert(pthread_mutex_lock(&rx_debug_mutex)==0)
+#define UNLOCK_RX_DEBUG assert(pthread_mutex_unlock(&rx_debug_mutex)==0)
#else
#define LOCK_RX_DEBUG
#define UNLOCK_RX_DEBUG
register char *tp;
endTime = time(0) + 20; /* try for 20 seconds */
- LOCK_RX_DEBUG counter++;
- UNLOCK_RX_DEBUG tp = &tbuffer[sizeof(struct rx_header)];
+ LOCK_RX_DEBUG;
+ counter++;
+ UNLOCK_RX_DEBUG;
+ tp = &tbuffer[sizeof(struct rx_header)];
taddr.sin_family = AF_INET;
taddr.sin_port = remotePort;
taddr.sin_addr.s_addr = remoteAddr;
tv.tv_sec = 1;
tv.tv_usec = 0;
code = select(socket + 1, &imask, 0, 0, &tv);
- if (code == 1 && FD_ISSET(socket,&imask)) {
+ if (code == 1 && FD_ISSET(socket, &imask)) {
/* now receive a packet */
faddrLen = sizeof(struct sockaddr_in);
code =
recvfrom(socket, tbuffer, sizeof(tbuffer), 0,
(struct sockaddr *)&faddr, &faddrLen);
- if (code > 0) {
- memcpy(&theader, tbuffer, sizeof(struct rx_header));
- if (counter == ntohl(theader.callNumber))
- break;
- }
+ if (code > 0) {
+ memcpy(&theader, tbuffer, sizeof(struct rx_header));
+ if (counter == ntohl(theader.callNumber))
+ break;
+ }
}
/* see if we've timed out */
register struct rx_serverQueueEntry *sq;
#endif /* KERNEL */
- LOCK_RX_INIT if (rxinit_status == 1) {
- UNLOCK_RX_INIT return; /* Already shutdown. */
+ LOCK_RX_INIT;
+ if (rxinit_status == 1) {
+ UNLOCK_RX_INIT;
+ return; /* Already shutdown. */
}
#ifndef KERNEL
rx_port = 0;
MUTEX_EXIT(&rx_stats_mutex);
rxinit_status = 1;
-UNLOCK_RX_INIT}
+ UNLOCK_RX_INIT;
+}
#ifdef RX_ENABLE_LOCKS
void
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/rx/rx_clock_nt.c,v 1.9 2004/02/26 19:23:02 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/rx/rx_clock_nt.c,v 1.9.2.1 2004/08/25 07:09:41 shadow Exp $");
#ifdef AFS_NT40_ENV
#include <stdio.h>
#include <winbase.h>
#include "rx_clock.h"
-void clock_UpdateTime(void); /* forward reference */
+void clock_UpdateTime(void); /* forward reference */
struct clock clock_now; /* The last elapsed time ready by clock_GetTimer */
clock_UnInit(void)
{
clockInitialized = 0;
- return 0;
+ return 0;
}
#endif
#endif
RCSID
- ("$Header: /cvs/openafs/src/rx/rx_conncache.c,v 1.9 2004/05/15 04:53:30 shadow Exp $");
+ ("$Header: /cvs/openafs/src/rx/rx_conncache.c,v 1.9.2.1 2004/08/25 07:09:41 shadow Exp $");
#ifdef UKERNEL
#include "afs/sysincludes.h"
*/
pthread_mutex_t rxi_connCacheMutex;
-#define LOCK_CONN_CACHE assert(pthread_mutex_lock(&rxi_connCacheMutex)==0);
-#define UNLOCK_CONN_CACHE assert(pthread_mutex_unlock(&rxi_connCacheMutex)==0);
+#define LOCK_CONN_CACHE assert(pthread_mutex_lock(&rxi_connCacheMutex)==0)
+#define UNLOCK_CONN_CACHE assert(pthread_mutex_unlock(&rxi_connCacheMutex)==0)
#else
#define LOCK_CONN_CACHE
#define UNLOCK_CONN_CACHE
* increase the frequency of cache hits.
*/
- LOCK_CONN_CACHE if (!rxi_FindCachedConnection(parts, conn)) {
+ LOCK_CONN_CACHE;
+ if (!rxi_FindCachedConnection(parts, conn)) {
/*
* Create a new connection and enter it in the cache
*/
error = 1;
}
}
- UNLOCK_CONN_CACHE return error;
+ UNLOCK_CONN_CACHE;
+ return error;
}
/*
{
cache_entry_p cacheConn, nCacheConn;
- LOCK_CONN_CACHE
- for (queue_Scan
- (&rxi_connectionCache, cacheConn, nCacheConn, cache_entry)) {
+ LOCK_CONN_CACHE;
+ for (queue_Scan(&rxi_connectionCache, cacheConn, nCacheConn, cache_entry)) {
if (!cacheConn)
break;
queue_Remove(cacheConn);
rxi_DestroyConnection(cacheConn->conn);
free(cacheConn);
}
-UNLOCK_CONN_CACHE}
+ UNLOCK_CONN_CACHE;
+}
/*
* External functions
{
cache_entry_p cacheConn, nCacheConn;
- LOCK_CONN_CACHE
- for (queue_Scan
- (&rxi_connectionCache, cacheConn, nCacheConn, cache_entry)) {
+ LOCK_CONN_CACHE;
+ for (queue_Scan(&rxi_connectionCache, cacheConn, nCacheConn, cache_entry)) {
if (conn == cacheConn->conn) {
cacheConn->inUse--;
/*
break;
}
}
-UNLOCK_CONN_CACHE}
+ UNLOCK_CONN_CACHE;
+}
#endif
RCSID
- ("$Header: /cvs/openafs/src/rx/rx_event.c,v 1.14 2003/07/15 23:16:09 shadow Exp $");
+ ("$Header: /cvs/openafs/src/rx/rx_event.c,v 1.14.2.1 2004/08/25 07:09:41 shadow Exp $");
#ifdef KERNEL
#ifndef UKERNEL
#include <assert.h>
pthread_mutex_t rx_event_mutex;
-#define LOCK_EV_INIT assert(pthread_mutex_lock(&rx_event_mutex)==0);
-#define UNLOCK_EV_INIT assert(pthread_mutex_unlock(&rx_event_mutex)==0);
+#define LOCK_EV_INIT assert(pthread_mutex_lock(&rx_event_mutex)==0)
+#define UNLOCK_EV_INIT assert(pthread_mutex_unlock(&rx_event_mutex)==0)
#else
#define LOCK_EV_INIT
#define UNLOCK_EV_INIT
void
rxevent_Init(int nEvents, void (*scheduler) (void))
{
- LOCK_EV_INIT if (rxevent_initialized) {
- UNLOCK_EV_INIT return;
+ LOCK_EV_INIT;
+ if (rxevent_initialized) {
+ UNLOCK_EV_INIT;
+ return;
}
MUTEX_INIT(&rxevent_lock, "rxevent_lock", MUTEX_DEFAULT, 0);
clock_Init();
rxevent_initialized = 1;
clock_Zero(&rxevent_nextRaiseEvents);
rxevent_raiseScheduled = 0;
-UNLOCK_EV_INIT}
+ UNLOCK_EV_INIT;
+}
/* Create and initialize new epoch structure */
struct rxepoch *
{
struct xfreelist *xp, *nxp;
- LOCK_EV_INIT if (!rxevent_initialized) {
- UNLOCK_EV_INIT return;
+ LOCK_EV_INIT;
+ if (!rxevent_initialized) {
+ UNLOCK_EV_INIT;
+ return;
}
rxevent_initialized = 0;
- UNLOCK_EV_INIT MUTEX_DESTROY(&rxevent_lock);
+ UNLOCK_EV_INIT;
+ MUTEX_DESTROY(&rxevent_lock);
#if defined(AFS_AIX32_ENV) && defined(KERNEL)
/* Everything is freed in afs_osinet.c */
#else
#include "afs/param.h"
RCSID
- ("$Header: /cvs/openafs/src/rx/rx_kcommon.c,v 1.44 2004/08/08 19:17:05 shadow Exp $");
+ ("$Header: /cvs/openafs/src/rx/rx_kcommon.c,v 1.44.2.1 2004/08/25 07:09:41 shadow Exp $");
#include "rx/rx_kcommon.h"
memset((void *)mtus, 0, sizeof(mtus));
for (i = 0; i < afs_cb_interface.numberOfInterfaces; i++) {
- if (!afs_cb_interface.mtu[i])
+ if (!afs_cb_interface.mtu[i])
afs_cb_interface.mtu[i] = htonl(1500);
rxmtu = (ntohl(afs_cb_interface.mtu[i]) - RX_IPUDP_SIZE);
ifinaddr = ntohl(afs_cb_interface.addr_in[i]);
#if defined(AFS_HPUX102_ENV)
#if defined(AFS_HPUX110_ENV)
/* we need a file associated with the socket so sosend in NetSend
- will not fail */
+ * will not fail */
/* blocking socket */
code = socreate(AF_INET, &newSocket, SOCK_DGRAM, 0, 0);
fp = falloc();
- if (!fp) goto bad;
+ if (!fp)
+ goto bad;
fp->f_flag = FREAD | FWRITE;
fp->f_type = DTYPE_SOCKET;
- fp->f_ops = &socketops;
+ fp->f_ops = &socketops;
- fp->f_data = (void *) newSocket;
+ fp->f_data = (void *)newSocket;
newSocket->so_fp = (void *)fp;
#else /* AFS_HPUX110_ENV */
#endif
#ifdef AFS_HPUX110_ENV
if (asocket->so_fp) {
- struct file * fp = asocket->so_fp;
+ struct file *fp = asocket->so_fp;
#if !defined(AFS_HPUX1123_ENV)
/* 11.23 still has falloc, but not FPENTRYFREE !
- so for now if we shutdown, we will waist a file
- structure */
+ * so for now if we shutdown, we will waist a file
+ * structure */
FPENTRYFREE(fp);
asocket->so_fp = NULL;
#endif
#else
#include "net/route.h"
#endif
+#if defined(HAVE_IN_SYSTM_H) || !defined(AFS_LINUX22_ENV)
#include "netinet/in_systm.h"
+#endif
#include "netinet/ip.h"
#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN60_ENV) && !defined(AFS_OBSD_ENV)
#include "netinet/in_pcb.h"
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/rx/rx_misc.c,v 1.12 2003/07/15 23:16:09 shadow Exp $");
+ ("$Header: /cvs/openafs/src/rx/rx_misc.c,v 1.12.2.1 2004/08/25 07:09:41 shadow Exp $");
#ifdef KERNEL
#include <afs/sysincludes.h>
#include <assert.h>
pthread_mutex_t osi_malloc_mutex;
-#define LOCK_MALLOC_STATS assert(pthread_mutex_lock(&osi_malloc_mutex)==0);
-#define UNLOCK_MALLOC_STATS assert(pthread_mutex_unlock(&osi_malloc_mutex)==0);
+#define LOCK_MALLOC_STATS assert(pthread_mutex_lock(&osi_malloc_mutex)==0)
+#define UNLOCK_MALLOC_STATS assert(pthread_mutex_unlock(&osi_malloc_mutex)==0)
#else
#define LOCK_MALLOC_STATS
#define UNLOCK_MALLOC_STATS
*/
if (x == 0)
return (char *)&memZero;
- LOCK_MALLOC_STATS osi_alloccnt++;
+ LOCK_MALLOC_STATS;
+ osi_alloccnt++;
osi_allocsize += x;
- UNLOCK_MALLOC_STATS return (char *)(mem_alloc(x));
+ UNLOCK_MALLOC_STATS;
+ return (char *)(mem_alloc(x));
}
int
{
if ((x == &memZero) || !x)
return 0;
- LOCK_MALLOC_STATS osi_alloccnt--;
+ LOCK_MALLOC_STATS;
+ osi_alloccnt--;
osi_allocsize -= size;
- UNLOCK_MALLOC_STATS mem_free(x, size);
+ UNLOCK_MALLOC_STATS;
+ mem_free(x, size);
return 0;
}
#endif
#endif
RCSID
- ("$Header: /cvs/openafs/src/rx/rx_packet.c,v 1.35 2004/06/02 14:50:23 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/rx/rx_packet.c,v 1.35.2.1 2004/08/25 07:09:42 shadow Exp $");
#ifdef KERNEL
#if defined(UKERNEL)
MUTEX_ENTER(&rx_stats_mutex);
rx_stats.noPacketOnRead++;
MUTEX_EXIT(&rx_stats_mutex);
- }
- else {
+ } else {
MUTEX_ENTER(&rx_stats_mutex);
rx_stats.bogusPacketOnRead++;
rx_stats.bogusHost = from.sin_addr.s_addr;
assert(p != NULL);
- dpf(("%c %d %s: %x.%u.%u.%u.%u.%u.%u flags %d, packet %x resend %d.%0.3d len %d",
- deliveryType, p->header.serial, rx_packetTypes[p->header.type - 1],
- peer->host, peer->port, p->header.serial, p->header.epoch,
- p->header.cid, p->header.callNumber, p->header.seq, p->header.flags,
- (int)p, p->retryTime.sec, p->retryTime.usec / 1000, p->length));
+ dpf(("%c %d %s: %x.%u.%u.%u.%u.%u.%u flags %d, packet %x resend %d.%0.3d len %d", deliveryType, p->header.serial, rx_packetTypes[p->header.type - 1], peer->host, peer->port, p->header.serial, p->header.epoch, p->header.cid, p->header.callNumber, p->header.seq, p->header.flags, (int)p, p->retryTime.sec, p->retryTime.usec / 1000, p->length));
#endif
MUTEX_ENTER(&rx_stats_mutex);
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/rx/rx_pthread.c,v 1.17 2004/02/03 06:23:39 shadow Exp $");
+ ("$Header: /cvs/openafs/src/rx/rx_pthread.c,v 1.17.2.1 2004/08/25 07:09:42 shadow Exp $");
#include <sys/types.h>
#include <errno.h>
next.sec = 30; /* Time to sleep if there are no events scheduled */
next.usec = 0;
clock_GetTime(&cv);
- rxevent_RaiseEvents(&next);
+ rxevent_RaiseEvents(&next);
assert(pthread_mutex_lock(&event_handler_mutex) == 0);
if (rx_pthread_event_rescheduled) {
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/rx/rx_user.c,v 1.18 2004/08/06 20:04:07 shadow Exp $");
+ ("$Header: /cvs/openafs/src/rx/rx_user.c,v 1.18.2.1 2004/08/25 07:09:42 shadow Exp $");
# include <sys/types.h>
# include <errno.h>
*/
pthread_mutex_t rx_if_init_mutex;
-#define LOCK_IF_INIT assert(pthread_mutex_lock(&rx_if_init_mutex)==0);
-#define UNLOCK_IF_INIT assert(pthread_mutex_unlock(&rx_if_init_mutex)==0);
+#define LOCK_IF_INIT assert(pthread_mutex_lock(&rx_if_init_mutex)==0)
+#define UNLOCK_IF_INIT assert(pthread_mutex_unlock(&rx_if_init_mutex)==0)
/*
* The rx_if_mutex mutex protects the following global variables:
*/
pthread_mutex_t rx_if_mutex;
-#define LOCK_IF assert(pthread_mutex_lock(&rx_if_mutex)==0);
-#define UNLOCK_IF assert(pthread_mutex_unlock(&rx_if_mutex)==0);
+#define LOCK_IF assert(pthread_mutex_lock(&rx_if_mutex)==0)
+#define UNLOCK_IF assert(pthread_mutex_unlock(&rx_if_mutex)==0)
#else
#define LOCK_IF_INIT
#define UNLOCK_IF_INIT
void
rx_GetIFInfo(void)
{
- LOCK_IF_INIT if (Inited) {
- UNLOCK_IF_INIT return;
+ LOCK_IF_INIT;
+ if (Inited) {
+ UNLOCK_IF_INIT;
+ return;
} else {
u_int maxsize;
u_int rxsize;
afs_uint32 i;
Inited = 1;
- UNLOCK_IF_INIT rxi_numNetAddrs = ADDRSPERSITE;
+ UNLOCK_IF_INIT;
+ rxi_numNetAddrs = ADDRSPERSITE;
- LOCK_IF(void) syscfg_GetIFInfo(&rxi_numNetAddrs, rxi_NetAddrs,
- myNetMasks, myNetMTUs, myNetFlags);
+ LOCK_IF;
+ (void)syscfg_GetIFInfo(&rxi_numNetAddrs, rxi_NetAddrs,
+ myNetMasks, myNetMTUs, myNetFlags);
for (i = 0; i < rxi_numNetAddrs; i++) {
rxsize = rxi_AdjustIfMTU(myNetMTUs[i] - RX_IPUDP_SIZE);
}
}
- UNLOCK_IF ncbufs = (rx_maxJumboRecvSize - RX_FIRSTBUFFERSIZE);
+ UNLOCK_IF;
+ ncbufs = (rx_maxJumboRecvSize - RX_FIRSTBUFFERSIZE);
if (ncbufs > 0) {
ncbufs = ncbufs / RX_CBUFFERSIZE;
npackets = rx_initSendWindow - 1;
struct sockaddr_in *a;
#endif /* AFS_DJGPP_ENV */
- LOCK_IF_INIT if (Inited) {
- UNLOCK_IF_INIT return;
+ LOCK_IF_INIT;
+ if (Inited) {
+ UNLOCK_IF_INIT;
+ return;
}
Inited = 1;
- UNLOCK_IF_INIT LOCK_IF rxi_numNetAddrs = 0;
+ UNLOCK_IF_INIT;
+ LOCK_IF;
+ rxi_numNetAddrs = 0;
memset(rxi_NetAddrs, 0, sizeof(rxi_NetAddrs));
memset(myNetFlags, 0, sizeof(myNetFlags));
memset(myNetMTUs, 0, sizeof(myNetMTUs));
memset(myNetMasks, 0, sizeof(myNetMasks));
- UNLOCK_IF s = socket(AF_INET, SOCK_DGRAM, 0);
+ UNLOCK_IF;
+ s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0)
return;
return;
}
- LOCK_IF
+ LOCK_IF;
#ifdef AFS_AIX41_ENV
#define size(p) MAX((p).sa_len, sizeof(p))
- cplim = buf + ifc.ifc_len; /*skip over if's with big ifr_addr's */
+ cplim = buf + ifc.ifc_len; /*skip over if's with big ifr_addr's */
for (cp = buf; cp < cplim;
cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a))) {
if (rxi_numNetAddrs >= ADDRSPERSITE)
ifr = (struct ifreq *)cp;
#else
- len = ifc.ifc_len / sizeof(struct ifreq);
+ len = ifc.ifc_len / sizeof(struct ifreq);
if (len > ADDRSPERSITE)
len = ADDRSPERSITE;
++rxi_numNetAddrs;
}
}
- UNLOCK_IF close(s);
+ UNLOCK_IF;
+ close(s);
/* have to allocate at least enough to allow a single packet to reach its
* maximum size, so ReadPacket will work. Allocate enough for a couple
- LOCK_IF_INIT if (!Inited) {
- UNLOCK_IF_INIT
- /*
- * there's a race here since more than one thread could call
- * rx_GetIFInfo. The race stops in rx_GetIFInfo.
- */
- rx_GetIFInfo();
+ LOCK_IF_INIT;
+ if (!Inited) {
+ UNLOCK_IF_INIT;
+ /*
+ * there's a race here since more than one thread could call
+ * rx_GetIFInfo. The race stops in rx_GetIFInfo.
+ */
+ rx_GetIFInfo();
} else {
- UNLOCK_IF_INIT}
+ UNLOCK_IF_INIT;
+ }
#ifdef ADAPT_MTU
/* try to second-guess IP, and identify which link is most likely to
* pp->burstSize pp->burst pp->burstWait.sec pp->burstWait.usec
* pp->timeout.usec */
- LOCK_IF for (ix = 0; ix < rxi_numNetAddrs; ++ix) {
+ LOCK_IF;
+ for (ix = 0; ix < rxi_numNetAddrs; ++ix) {
if ((rxi_NetAddrs[ix] & myNetMasks[ix]) == (ppaddr & myNetMasks[ix])) {
#ifdef IFF_POINTOPOINT
if (myNetFlags[ix] & IFF_POINTOPOINT)
pp->ifMTU = MIN(rx_MyMaxSendSize, rxmtu);
}
}
- UNLOCK_IF if (!pp->ifMTU) { /* not local */
+ UNLOCK_IF;
+ if (!pp->ifMTU) { /* not local */
pp->timeout.sec = 3;
pp->ifMTU = MIN(rx_MyMaxSendSize, RX_REMOTE_PACKET_SIZE);
}
/* Override max MTU. If rx_SetNoJumbo is called, it must be
called before calling rx_SetMaxMTU since SetNoJumbo clobbers rx_maxReceiveSize */
-void rx_SetMaxMTU(int mtu)
+void
+rx_SetMaxMTU(int mtu)
{
- rx_MyMaxSendSize = rx_maxReceiveSizeUser = rx_maxReceiveSize = mtu;
+ rx_MyMaxSendSize = rx_maxReceiveSizeUser = rx_maxReceiveSize = mtu;
}
-
#define AFS_RXGUNLOCK()
#ifndef UKERNEL
/* Defined in rx/UKERNEL/rx_kmutex.h */
-#define ISAFS_GLOCK()
-#define ISAFS_RXGLOCK()
+#define ISAFS_GLOCK()
+#define ISAFS_RXGLOCK()
#endif
#define AFS_ASSERT_RXGLOCK()
/* Some "operating-system independent" stuff, for the user mode implementation */
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/rx/rx_xmit_nt.c,v 1.7 2004/06/02 14:50:24 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/rx/rx_xmit_nt.c,v 1.7.2.1 2004/08/25 07:09:42 shadow Exp $");
#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV)
code -= size;
} else {
#ifdef AFS_NT40_ENV
- if (code == SOCKET_ERROR)
- code = WSAGetLastError();
- if (code == WSAEWOULDBLOCK)
- errno = WSAEWOULDBLOCK;
- else
- errno = EIO;
+ if (code == SOCKET_ERROR)
+ code = WSAGetLastError();
+ if (code == WSAEWOULDBLOCK)
+ errno = WSAEWOULDBLOCK;
+ else
+ errno = EIO;
#endif /* AFS_NT40_ENV */
code = -1;
}
case WSAENOBUFS:
errno = 0;
break;
- case WSAEWOULDBLOCK:
- errno = WSAEWOULDBLOCK;
- break;
+ case WSAEWOULDBLOCK:
+ errno = WSAEWOULDBLOCK;
+ break;
default:
errno = EIO;
break;
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/rx/rxdebug.c,v 1.15 2003/12/07 22:49:36 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/rx/rxdebug.c,v 1.15.2.1 2004/08/25 07:09:42 shadow Exp $");
#include <sys/types.h>
#include <errno.h>
printf("getconn call failed with code %d\n", code);
break;
}
- if (tconn.cid == (afs_int32)0xffffffff) {
+ if (tconn.cid == (afs_int32) 0xffffffff) {
printf("Done.\n");
break;
}
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/rx/xdr_int64.c,v 1.9 2003/12/08 03:14:08 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/rx/xdr_int64.c,v 1.9.2.1 2004/08/25 07:09:42 shadow Exp $");
#if defined(KERNEL) && !defined(UKERNEL)
#ifdef AFS_LINUX20_ENV
return (TRUE);
}
if (xdrs->x_op == XDR_ENCODE) {
- high = (afs_int32)(*ulp >> 32);
- low = (afs_uint32)(*ulp & 0xFFFFFFFFL);
+ high = (afs_int32) (*ulp >> 32);
+ low = (afs_uint32) (*ulp & 0xFFFFFFFFL);
if (!XDR_PUTINT32(xdrs, (afs_int32 *) & high))
return (FALSE);
return (XDR_PUTINT32(xdrs, (afs_int32 *) & low));
return (TRUE);
}
if (xdrs->x_op == XDR_ENCODE) {
- high = (afs_uint32)(*ulp >> 32);
- low = (afs_uint32)(*ulp & 0xFFFFFFFFL);
+ high = (afs_uint32) (*ulp >> 32);
+ low = (afs_uint32) (*ulp & 0xFFFFFFFFL);
if (!XDR_PUTINT32(xdrs, (afs_uint32 *) & high))
return (FALSE);
return (XDR_PUTINT32(xdrs, (afs_uint32 *) & low));
#endif
RCSID
- ("$Header: /cvs/openafs/src/rxkad/bg-fcrypt.c,v 1.5 2003/07/15 23:16:42 shadow Exp $");
+ ("$Header: /cvs/openafs/src/rxkad/bg-fcrypt.c,v 1.5.2.1 2004/08/25 07:09:42 shadow Exp $");
#define DEBUG 0
#ifdef KERNEL
fc_ecb_encrypt(afs_uint32 * in, afs_uint32 * out, fc_KeySchedule sched,
int encrypt)
{
- LOCK_RXKAD_STATS rxkad_stats.fc_encrypts[encrypt]++;
- UNLOCK_RXKAD_STATS if (encrypt)
- fc_ecb_enc(in[0], in[1], out, sched);
+ LOCK_RXKAD_STATS;
+ rxkad_stats.fc_encrypts[encrypt]++;
+ UNLOCK_RXKAD_STATS;
+ if (encrypt)
+ fc_ecb_enc(in[0], in[1], out, sched);
else
fc_ecb_dec(in[0], in[1], out, sched);
return 0;
ROT56R(hi, lo, 11);
*sched++ = EFF_NTOHL(lo);
#endif
- LOCK_RXKAD_STATS rxkad_stats.fc_key_scheds++;
- UNLOCK_RXKAD_STATS return 0;
+ LOCK_RXKAD_STATS;
+ rxkad_stats.fc_key_scheds++;
+ UNLOCK_RXKAD_STATS;
+ return 0;
}
/*
obj = rx_SecurityObjectOf(rx_connection_not_used);
tp = (struct rxkad_cprivate *)obj->privateData;
- LOCK_RXKAD_STATS rxkad_stats.bytesEncrypted[rxkad_TypeIndex(tp->type)] +=
- len;
- UNLOCK_RXKAD_STATS {
+ LOCK_RXKAD_STATS;
+ rxkad_stats.bytesEncrypted[rxkad_TypeIndex(tp->type)] += len;
+ UNLOCK_RXKAD_STATS;
+ {
/* What is this good for?
* It turns out that the security header for auth_enc is of
* size 8 bytes and the last 4 bytes are defined to be 0!
obj = rx_SecurityObjectOf(rx_connection_not_used);
tp = (struct rxkad_cprivate *)obj->privateData;
- LOCK_RXKAD_STATS rxkad_stats.bytesDecrypted[rxkad_TypeIndex(tp->type)] +=
- len;
- UNLOCK_RXKAD_STATS memcpy(ivec, iv, sizeof(ivec)); /* Must use copy of iv */
+ LOCK_RXKAD_STATS;
+ rxkad_stats.bytesDecrypted[rxkad_TypeIndex(tp->type)] += len;
+ UNLOCK_RXKAD_STATS;
+ memcpy(ivec, iv, sizeof(ivec)); /* Must use copy of iv */
for (frag = &packet->wirevec[1]; len > 0; frag++) {
int iov_len = frag->iov_len;
afs_uint32 *iov_bas = (afs_uint32 *) frag->iov_base;
#endif
RCSID
- ("$Header: /cvs/openafs/src/rxkad/domestic/crypt_conn.c,v 1.11 2003/07/15 23:16:44 shadow Exp $");
+ ("$Header: /cvs/openafs/src/rxkad/domestic/crypt_conn.c,v 1.11.2.1 2004/08/25 07:17:01 shadow Exp $");
#ifdef KERNEL
#include "afs/stds.h"
obj = rx_SecurityObjectOf(conn);
tp = (struct rxkad_cprivate *)obj->privateData;
- LOCK_RXKAD_STATS rxkad_stats.bytesDecrypted[rxkad_TypeIndex(tp->type)] +=
- len;
- UNLOCK_RXKAD_STATS memcpy((void *)xor, (void *)ivec, sizeof(xor));
+ LOCK_RXKAD_STATS;
+ rxkad_stats.bytesDecrypted[rxkad_TypeIndex(tp->type)] += len;
+ UNLOCK_RXKAD_STATS;
+ memcpy((void *)xor, (void *)ivec, sizeof(xor));
for (i = 0; len; i++) {
data = rx_data(packet, i, tlen);
if (!data || !tlen)
obj = rx_SecurityObjectOf(conn);
tp = (struct rxkad_cprivate *)obj->privateData;
- LOCK_RXKAD_STATS rxkad_stats.bytesEncrypted[rxkad_TypeIndex(tp->type)] +=
- len;
- UNLOCK_RXKAD_STATS
- /*
- * afs_int32 cksum;
- * cksum = htonl(0);
- * * Future option to add cksum here, but for now we just put 0
- */
- rx_PutInt32(packet, 1 * sizeof(afs_int32), 0);
+ LOCK_RXKAD_STATS;
+ rxkad_stats.bytesEncrypted[rxkad_TypeIndex(tp->type)] += len;
+ UNLOCK_RXKAD_STATS;
+ /*
+ * afs_int32 cksum;
+ * cksum = htonl(0);
+ * * Future option to add cksum here, but for now we just put 0
+ */
+ rx_PutInt32(packet, 1 * sizeof(afs_int32), 0);
memcpy((void *)xor, (void *)ivec, sizeof(xor));
for (i = 0; len; i++) {
#endif
RCSID
- ("$Header: /cvs/openafs/src/rxkad/domestic/fcrypt.c,v 1.11 2003/07/15 23:16:44 shadow Exp $");
+ ("$Header: /cvs/openafs/src/rxkad/domestic/fcrypt.c,v 1.11.2.1 2004/08/25 07:17:01 shadow Exp $");
#define DEBUG 0
#ifdef KERNEL
kword[1] = (kword[1] >> 11) | (temp << (56 - 32 - 11));
schedule[i] = kword[0];
}
- LOCK_RXKAD_STATS rxkad_stats.fc_key_scheds++;
- UNLOCK_RXKAD_STATS return 0;
+ LOCK_RXKAD_STATS;
+ rxkad_stats.fc_key_scheds++;
+ UNLOCK_RXKAD_STATS;
+ return 0;
}
/* IN int encrypt; * 0 ==> decrypt, else encrypt */
#endif
if (encrypt) {
- LOCK_RXKAD_STATS rxkad_stats.fc_encrypts[ENCRYPT]++;
- UNLOCK_RXKAD_STATS for (i = 0; i < (ROUNDS / 2); i++) {
+ LOCK_RXKAD_STATS;
+ rxkad_stats.fc_encrypts[ENCRYPT]++;
+ UNLOCK_RXKAD_STATS;
+ for (i = 0; i < (ROUNDS / 2); i++) {
S = *schedule++ ^ R; /* xor R with key bits from schedule */
Pchar[Byte2] = sbox0[Schar[Byte0]]; /* do 8-bit S Box subst. */
Pchar[Byte3] = sbox1[Schar[Byte1]]; /* and permute the result */
R ^= P;
}
} else {
- LOCK_RXKAD_STATS rxkad_stats.fc_encrypts[DECRYPT]++;
- UNLOCK_RXKAD_STATS schedule = &schedule[ROUNDS - 1]; /* start at end of key schedule */
+ LOCK_RXKAD_STATS;
+ rxkad_stats.fc_encrypts[DECRYPT]++;
+ UNLOCK_RXKAD_STATS;
+ schedule = &schedule[ROUNDS - 1]; /* start at end of key schedule */
for (i = 0; i < (ROUNDS / 2); i++) {
S = *schedule-- ^ L; /* xor R with key bits from schedule */
Pchar[Byte2] = sbox0[Schar[Byte0]]; /* do 8-bit S Box subst. and */
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* $Id: hash.h,v 1.2 2004/05/10 03:52:18 shadow Exp $ */
+/* $Id: hash.h,v 1.2.2.1 2004/08/25 07:09:42 shadow Exp $ */
/* stuff in common between md4, md5, and sha1 */
#endif
static inline afs_uint32
-cshift (afs_uint32 x, unsigned int n)
+cshift(afs_uint32 x, unsigned int n)
{
x = CRAYFIX(x);
return CRAYFIX((x << n) | (x >> (32 - n)));
#include "rxkad.h"
#endif /* defined(UKERNEL) */
-RCSID("$Id: md4.c,v 1.1 2004/04/09 05:54:22 jaltman Exp $");
+RCSID("$Id: md4.c,v 1.1.2.1 2004/08/25 07:09:42 shadow Exp $");
#undef WORDS_BIGENDIAN
#ifdef AFSBIG_ENDIAN
#define X data
void
-MD4_Init (struct md4 *m)
+MD4_Init(struct md4 *m)
{
- m->sz[0] = 0;
- m->sz[1] = 0;
- D = 0x10325476;
- C = 0x98badcfe;
- B = 0xefcdab89;
- A = 0x67452301;
+ m->sz[0] = 0;
+ m->sz[1] = 0;
+ D = 0x10325476;
+ C = 0x98badcfe;
+ B = 0xefcdab89;
+ A = 0x67452301;
}
#define F(x,y,z) CRAYFIX((x & y) | (~x & z))
#define DO3(a,b,c,d,k,s,i) DOIT(a,b,c,d,k,s,i,H)
static inline void
-calc (struct md4 *m, afs_uint32 *data)
+calc(struct md4 *m, afs_uint32 * data)
{
- afs_uint32 AA, BB, CC, DD;
-
- AA = A;
- BB = B;
- CC = C;
- DD = D;
-
- /* Round 1 */
-
- DO1(A,B,C,D,0,3,0);
- DO1(D,A,B,C,1,7,0);
- DO1(C,D,A,B,2,11,0);
- DO1(B,C,D,A,3,19,0);
-
- DO1(A,B,C,D,4,3,0);
- DO1(D,A,B,C,5,7,0);
- DO1(C,D,A,B,6,11,0);
- DO1(B,C,D,A,7,19,0);
-
- DO1(A,B,C,D,8,3,0);
- DO1(D,A,B,C,9,7,0);
- DO1(C,D,A,B,10,11,0);
- DO1(B,C,D,A,11,19,0);
-
- DO1(A,B,C,D,12,3,0);
- DO1(D,A,B,C,13,7,0);
- DO1(C,D,A,B,14,11,0);
- DO1(B,C,D,A,15,19,0);
-
- /* Round 2 */
-
- DO2(A,B,C,D,0,3,0x5A827999);
- DO2(D,A,B,C,4,5,0x5A827999);
- DO2(C,D,A,B,8,9,0x5A827999);
- DO2(B,C,D,A,12,13,0x5A827999);
-
- DO2(A,B,C,D,1,3,0x5A827999);
- DO2(D,A,B,C,5,5,0x5A827999);
- DO2(C,D,A,B,9,9,0x5A827999);
- DO2(B,C,D,A,13,13,0x5A827999);
-
- DO2(A,B,C,D,2,3,0x5A827999);
- DO2(D,A,B,C,6,5,0x5A827999);
- DO2(C,D,A,B,10,9,0x5A827999);
- DO2(B,C,D,A,14,13,0x5A827999);
-
- DO2(A,B,C,D,3,3,0x5A827999);
- DO2(D,A,B,C,7,5,0x5A827999);
- DO2(C,D,A,B,11,9,0x5A827999);
- DO2(B,C,D,A,15,13,0x5A827999);
-
- /* Round 3 */
-
- DO3(A,B,C,D,0,3,0x6ED9EBA1);
- DO3(D,A,B,C,8,9,0x6ED9EBA1);
- DO3(C,D,A,B,4,11,0x6ED9EBA1);
- DO3(B,C,D,A,12,15,0x6ED9EBA1);
-
- DO3(A,B,C,D,2,3,0x6ED9EBA1);
- DO3(D,A,B,C,10,9,0x6ED9EBA1);
- DO3(C,D,A,B,6,11,0x6ED9EBA1);
- DO3(B,C,D,A,14,15,0x6ED9EBA1);
-
- DO3(A,B,C,D,1,3,0x6ED9EBA1);
- DO3(D,A,B,C,9,9,0x6ED9EBA1);
- DO3(C,D,A,B,5,11,0x6ED9EBA1);
- DO3(B,C,D,A,13,15,0x6ED9EBA1);
-
- DO3(A,B,C,D,3,3,0x6ED9EBA1);
- DO3(D,A,B,C,11,9,0x6ED9EBA1);
- DO3(C,D,A,B,7,11,0x6ED9EBA1);
- DO3(B,C,D,A,15,15,0x6ED9EBA1);
-
- A += AA;
- B += BB;
- C += CC;
- D += DD;
+ afs_uint32 AA, BB, CC, DD;
+
+ AA = A;
+ BB = B;
+ CC = C;
+ DD = D;
+
+ /* Round 1 */
+
+ DO1(A, B, C, D, 0, 3, 0);
+ DO1(D, A, B, C, 1, 7, 0);
+ DO1(C, D, A, B, 2, 11, 0);
+ DO1(B, C, D, A, 3, 19, 0);
+
+ DO1(A, B, C, D, 4, 3, 0);
+ DO1(D, A, B, C, 5, 7, 0);
+ DO1(C, D, A, B, 6, 11, 0);
+ DO1(B, C, D, A, 7, 19, 0);
+
+ DO1(A, B, C, D, 8, 3, 0);
+ DO1(D, A, B, C, 9, 7, 0);
+ DO1(C, D, A, B, 10, 11, 0);
+ DO1(B, C, D, A, 11, 19, 0);
+
+ DO1(A, B, C, D, 12, 3, 0);
+ DO1(D, A, B, C, 13, 7, 0);
+ DO1(C, D, A, B, 14, 11, 0);
+ DO1(B, C, D, A, 15, 19, 0);
+
+ /* Round 2 */
+
+ DO2(A, B, C, D, 0, 3, 0x5A827999);
+ DO2(D, A, B, C, 4, 5, 0x5A827999);
+ DO2(C, D, A, B, 8, 9, 0x5A827999);
+ DO2(B, C, D, A, 12, 13, 0x5A827999);
+
+ DO2(A, B, C, D, 1, 3, 0x5A827999);
+ DO2(D, A, B, C, 5, 5, 0x5A827999);
+ DO2(C, D, A, B, 9, 9, 0x5A827999);
+ DO2(B, C, D, A, 13, 13, 0x5A827999);
+
+ DO2(A, B, C, D, 2, 3, 0x5A827999);
+ DO2(D, A, B, C, 6, 5, 0x5A827999);
+ DO2(C, D, A, B, 10, 9, 0x5A827999);
+ DO2(B, C, D, A, 14, 13, 0x5A827999);
+
+ DO2(A, B, C, D, 3, 3, 0x5A827999);
+ DO2(D, A, B, C, 7, 5, 0x5A827999);
+ DO2(C, D, A, B, 11, 9, 0x5A827999);
+ DO2(B, C, D, A, 15, 13, 0x5A827999);
+
+ /* Round 3 */
+
+ DO3(A, B, C, D, 0, 3, 0x6ED9EBA1);
+ DO3(D, A, B, C, 8, 9, 0x6ED9EBA1);
+ DO3(C, D, A, B, 4, 11, 0x6ED9EBA1);
+ DO3(B, C, D, A, 12, 15, 0x6ED9EBA1);
+
+ DO3(A, B, C, D, 2, 3, 0x6ED9EBA1);
+ DO3(D, A, B, C, 10, 9, 0x6ED9EBA1);
+ DO3(C, D, A, B, 6, 11, 0x6ED9EBA1);
+ DO3(B, C, D, A, 14, 15, 0x6ED9EBA1);
+
+ DO3(A, B, C, D, 1, 3, 0x6ED9EBA1);
+ DO3(D, A, B, C, 9, 9, 0x6ED9EBA1);
+ DO3(C, D, A, B, 5, 11, 0x6ED9EBA1);
+ DO3(B, C, D, A, 13, 15, 0x6ED9EBA1);
+
+ DO3(A, B, C, D, 3, 3, 0x6ED9EBA1);
+ DO3(D, A, B, C, 11, 9, 0x6ED9EBA1);
+ DO3(C, D, A, B, 7, 11, 0x6ED9EBA1);
+ DO3(B, C, D, A, 15, 15, 0x6ED9EBA1);
+
+ A += AA;
+ B += BB;
+ C += CC;
+ D += DD;
}
/*
#if defined(WORDS_BIGENDIAN)
static inline afs_uint32
-swap_afs_uint32 (afs_uint32 t)
+swap_afs_uint32(afs_uint32 t)
{
- afs_uint32 temp1, temp2;
-
- temp1 = cshift(t, 16);
- temp2 = temp1 >> 8;
- temp1 &= 0x00ff00ff;
- temp2 &= 0x00ff00ff;
- temp1 <<= 8;
- return temp1 | temp2;
+ afs_uint32 temp1, temp2;
+
+ temp1 = cshift(t, 16);
+ temp2 = temp1 >> 8;
+ temp1 &= 0x00ff00ff;
+ temp2 &= 0x00ff00ff;
+ temp1 <<= 8;
+ return temp1 | temp2;
}
#endif
-struct x32{
- unsigned int a:32;
- unsigned int b:32;
+struct x32 {
+ unsigned int a:32;
+ unsigned int b:32;
};
void
-MD4_Update (struct md4 *m, const void *v, size_t len)
+MD4_Update(struct md4 *m, const void *v, size_t len)
{
const unsigned char *p = v;
size_t old_sz = m->sz[0];
m->sz[0] += len * 8;
if (m->sz[0] < old_sz)
++m->sz[1];
- offset = (old_sz / 8) % 64;
- while(len > 0) {
+ offset = (old_sz / 8) % 64;
+ while (len > 0) {
size_t l = min(len, 64 - offset);
memcpy(m->save + offset, p, l);
offset += l;
p += l;
len -= l;
- if(offset == 64) {
+ if (offset == 64) {
#if defined(WORDS_BIGENDIAN)
int i;
afs_uint32 current[16];
- struct x32 *u = (struct x32*)m->save;
- for(i = 0; i < 8; i++){
- current[2*i+0] = swap_afs_uint32(u[i].a);
- current[2*i+1] = swap_afs_uint32(u[i].b);
+ struct x32 *u = (struct x32 *)m->save;
+ for (i = 0; i < 8; i++) {
+ current[2 * i + 0] = swap_afs_uint32(u[i].a);
+ current[2 * i + 1] = swap_afs_uint32(u[i].b);
}
calc(m, current);
#else
- calc(m, (afs_uint32*)m->save);
+ calc(m, (afs_uint32 *) m->save);
#endif
offset = 0;
}
}
void
-MD4_Final (void *res, struct md4 *m)
+MD4_Final(void *res, struct md4 *m)
{
- static unsigned char zeros[72];
- unsigned offset = (m->sz[0] / 8) % 64;
- unsigned int dstart = (120 - offset - 1) % 64 + 1;
-
- *zeros = 0x80;
- memset (zeros + 1, 0, sizeof(zeros) - 1);
- zeros[dstart+0] = (m->sz[0] >> 0) & 0xff;
- zeros[dstart+1] = (m->sz[0] >> 8) & 0xff;
- zeros[dstart+2] = (m->sz[0] >> 16) & 0xff;
- zeros[dstart+3] = (m->sz[0] >> 24) & 0xff;
- zeros[dstart+4] = (m->sz[1] >> 0) & 0xff;
- zeros[dstart+5] = (m->sz[1] >> 8) & 0xff;
- zeros[dstart+6] = (m->sz[1] >> 16) & 0xff;
- zeros[dstart+7] = (m->sz[1] >> 24) & 0xff;
- MD4_Update (m, zeros, dstart + 8);
- {
- int i;
- unsigned char *r = (unsigned char *)res;
-
- for (i = 0; i < 4; ++i) {
- r[4*i] = m->counter[i] & 0xFF;
- r[4*i+1] = (m->counter[i] >> 8) & 0xFF;
- r[4*i+2] = (m->counter[i] >> 16) & 0xFF;
- r[4*i+3] = (m->counter[i] >> 24) & 0xFF;
- }
- }
+ static unsigned char zeros[72];
+ unsigned offset = (m->sz[0] / 8) % 64;
+ unsigned int dstart = (120 - offset - 1) % 64 + 1;
+
+ *zeros = 0x80;
+ memset(zeros + 1, 0, sizeof(zeros) - 1);
+ zeros[dstart + 0] = (m->sz[0] >> 0) & 0xff;
+ zeros[dstart + 1] = (m->sz[0] >> 8) & 0xff;
+ zeros[dstart + 2] = (m->sz[0] >> 16) & 0xff;
+ zeros[dstart + 3] = (m->sz[0] >> 24) & 0xff;
+ zeros[dstart + 4] = (m->sz[1] >> 0) & 0xff;
+ zeros[dstart + 5] = (m->sz[1] >> 8) & 0xff;
+ zeros[dstart + 6] = (m->sz[1] >> 16) & 0xff;
+ zeros[dstart + 7] = (m->sz[1] >> 24) & 0xff;
+ MD4_Update(m, zeros, dstart + 8);
+ {
+ int i;
+ unsigned char *r = (unsigned char *)res;
+
+ for (i = 0; i < 4; ++i) {
+ r[4 * i] = m->counter[i] & 0xFF;
+ r[4 * i + 1] = (m->counter[i] >> 8) & 0xFF;
+ r[4 * i + 2] = (m->counter[i] >> 16) & 0xFF;
+ r[4 * i + 3] = (m->counter[i] >> 24) & 0xFF;
+ }
+ }
#if 0
- {
- int i;
- afs_uint32 *r = (afs_uint32 *)res;
+ {
+ int i;
+ afs_uint32 *r = (afs_uint32 *) res;
- for (i = 0; i < 4; ++i)
- r[i] = swap_afs_uint32 (m->counter[i]);
- }
+ for (i = 0; i < 4; ++i)
+ r[i] = swap_afs_uint32(m->counter[i]);
+ }
#endif
}
* SUCH DAMAGE.
*/
-/* $Id: md4.h,v 1.1 2004/04/09 05:54:22 jaltman Exp $ */
+/* $Id: md4.h,v 1.1.2.1 2004/08/25 07:09:42 shadow Exp $ */
#include <stdlib.h>
#ifdef HAVE_SYS_TYPES_H
#endif
struct md4 {
- unsigned int sz[2];
- afs_uint32 counter[4];
- unsigned char save[64];
+ unsigned int sz[2];
+ afs_uint32 counter[4];
+ unsigned char save[64];
};
typedef struct md4 MD4_CTX;
-void MD4_Init (struct md4 *m);
-void MD4_Update (struct md4 *m, const void *p, size_t len);
-void MD4_Final (void *res, struct md4 *m);
+void MD4_Init(struct md4 *m);
+void MD4_Update(struct md4 *m, const void *p, size_t len);
+void MD4_Final(void *res, struct md4 *m);
#include "rxkad.h"
#endif /* defined(UKERNEL) */
-RCSID("$Id: md5.c,v 1.1 2004/04/09 05:54:22 jaltman Exp $");
+RCSID("$Id: md5.c,v 1.1.2.1 2004/08/25 07:09:42 shadow Exp $");
#undef WORDS_BIGENDIAN
#ifdef AFSBIG_ENDIAN
#define X data
void
-MD5_Init (struct md5 *m)
+MD5_Init(struct md5 *m)
{
- m->sz[0] = 0;
- m->sz[1] = 0;
- D = 0x10325476;
- C = 0x98badcfe;
- B = 0xefcdab89;
- A = 0x67452301;
+ m->sz[0] = 0;
+ m->sz[1] = 0;
+ D = 0x10325476;
+ C = 0x98badcfe;
+ B = 0xefcdab89;
+ A = 0x67452301;
}
#define F(x,y,z) CRAYFIX((x & y) | (~x & z))
#define DO4(a,b,c,d,k,s,i) DOIT(a,b,c,d,k,s,i,I)
static inline void
-calc (struct md5 *m, afs_uint32 *data)
+calc(struct md5 *m, afs_uint32 * data)
{
- afs_uint32 AA, BB, CC, DD;
-
- AA = A;
- BB = B;
- CC = C;
- DD = D;
-
- /* Round 1 */
-
- DO1(A,B,C,D,0,7,0xd76aa478);
- DO1(D,A,B,C,1,12,0xe8c7b756);
- DO1(C,D,A,B,2,17,0x242070db);
- DO1(B,C,D,A,3,22,0xc1bdceee);
-
- DO1(A,B,C,D,4,7,0xf57c0faf);
- DO1(D,A,B,C,5,12,0x4787c62a);
- DO1(C,D,A,B,6,17,0xa8304613);
- DO1(B,C,D,A,7,22,0xfd469501);
-
- DO1(A,B,C,D,8,7,0x698098d8);
- DO1(D,A,B,C,9,12,0x8b44f7af);
- DO1(C,D,A,B,10,17,0xffff5bb1);
- DO1(B,C,D,A,11,22,0x895cd7be);
-
- DO1(A,B,C,D,12,7,0x6b901122);
- DO1(D,A,B,C,13,12,0xfd987193);
- DO1(C,D,A,B,14,17,0xa679438e);
- DO1(B,C,D,A,15,22,0x49b40821);
-
- /* Round 2 */
-
- DO2(A,B,C,D,1,5,0xf61e2562);
- DO2(D,A,B,C,6,9,0xc040b340);
- DO2(C,D,A,B,11,14,0x265e5a51);
- DO2(B,C,D,A,0,20,0xe9b6c7aa);
-
- DO2(A,B,C,D,5,5,0xd62f105d);
- DO2(D,A,B,C,10,9,0x2441453);
- DO2(C,D,A,B,15,14,0xd8a1e681);
- DO2(B,C,D,A,4,20,0xe7d3fbc8);
-
- DO2(A,B,C,D,9,5,0x21e1cde6);
- DO2(D,A,B,C,14,9,0xc33707d6);
- DO2(C,D,A,B,3,14,0xf4d50d87);
- DO2(B,C,D,A,8,20,0x455a14ed);
-
- DO2(A,B,C,D,13,5,0xa9e3e905);
- DO2(D,A,B,C,2,9,0xfcefa3f8);
- DO2(C,D,A,B,7,14,0x676f02d9);
- DO2(B,C,D,A,12,20,0x8d2a4c8a);
-
- /* Round 3 */
-
- DO3(A,B,C,D,5,4,0xfffa3942);
- DO3(D,A,B,C,8,11,0x8771f681);
- DO3(C,D,A,B,11,16,0x6d9d6122);
- DO3(B,C,D,A,14,23,0xfde5380c);
-
- DO3(A,B,C,D,1,4,0xa4beea44);
- DO3(D,A,B,C,4,11,0x4bdecfa9);
- DO3(C,D,A,B,7,16,0xf6bb4b60);
- DO3(B,C,D,A,10,23,0xbebfbc70);
-
- DO3(A,B,C,D,13,4,0x289b7ec6);
- DO3(D,A,B,C,0,11,0xeaa127fa);
- DO3(C,D,A,B,3,16,0xd4ef3085);
- DO3(B,C,D,A,6,23,0x4881d05);
-
- DO3(A,B,C,D,9,4,0xd9d4d039);
- DO3(D,A,B,C,12,11,0xe6db99e5);
- DO3(C,D,A,B,15,16,0x1fa27cf8);
- DO3(B,C,D,A,2,23,0xc4ac5665);
-
- /* Round 4 */
-
- DO4(A,B,C,D,0,6,0xf4292244);
- DO4(D,A,B,C,7,10,0x432aff97);
- DO4(C,D,A,B,14,15,0xab9423a7);
- DO4(B,C,D,A,5,21,0xfc93a039);
-
- DO4(A,B,C,D,12,6,0x655b59c3);
- DO4(D,A,B,C,3,10,0x8f0ccc92);
- DO4(C,D,A,B,10,15,0xffeff47d);
- DO4(B,C,D,A,1,21,0x85845dd1);
-
- DO4(A,B,C,D,8,6,0x6fa87e4f);
- DO4(D,A,B,C,15,10,0xfe2ce6e0);
- DO4(C,D,A,B,6,15,0xa3014314);
- DO4(B,C,D,A,13,21,0x4e0811a1);
-
- DO4(A,B,C,D,4,6,0xf7537e82);
- DO4(D,A,B,C,11,10,0xbd3af235);
- DO4(C,D,A,B,2,15,0x2ad7d2bb);
- DO4(B,C,D,A,9,21,0xeb86d391);
-
- A += AA;
- B += BB;
- C += CC;
- D += DD;
+ afs_uint32 AA, BB, CC, DD;
+
+ AA = A;
+ BB = B;
+ CC = C;
+ DD = D;
+
+ /* Round 1 */
+
+ DO1(A, B, C, D, 0, 7, 0xd76aa478);
+ DO1(D, A, B, C, 1, 12, 0xe8c7b756);
+ DO1(C, D, A, B, 2, 17, 0x242070db);
+ DO1(B, C, D, A, 3, 22, 0xc1bdceee);
+
+ DO1(A, B, C, D, 4, 7, 0xf57c0faf);
+ DO1(D, A, B, C, 5, 12, 0x4787c62a);
+ DO1(C, D, A, B, 6, 17, 0xa8304613);
+ DO1(B, C, D, A, 7, 22, 0xfd469501);
+
+ DO1(A, B, C, D, 8, 7, 0x698098d8);
+ DO1(D, A, B, C, 9, 12, 0x8b44f7af);
+ DO1(C, D, A, B, 10, 17, 0xffff5bb1);
+ DO1(B, C, D, A, 11, 22, 0x895cd7be);
+
+ DO1(A, B, C, D, 12, 7, 0x6b901122);
+ DO1(D, A, B, C, 13, 12, 0xfd987193);
+ DO1(C, D, A, B, 14, 17, 0xa679438e);
+ DO1(B, C, D, A, 15, 22, 0x49b40821);
+
+ /* Round 2 */
+
+ DO2(A, B, C, D, 1, 5, 0xf61e2562);
+ DO2(D, A, B, C, 6, 9, 0xc040b340);
+ DO2(C, D, A, B, 11, 14, 0x265e5a51);
+ DO2(B, C, D, A, 0, 20, 0xe9b6c7aa);
+
+ DO2(A, B, C, D, 5, 5, 0xd62f105d);
+ DO2(D, A, B, C, 10, 9, 0x2441453);
+ DO2(C, D, A, B, 15, 14, 0xd8a1e681);
+ DO2(B, C, D, A, 4, 20, 0xe7d3fbc8);
+
+ DO2(A, B, C, D, 9, 5, 0x21e1cde6);
+ DO2(D, A, B, C, 14, 9, 0xc33707d6);
+ DO2(C, D, A, B, 3, 14, 0xf4d50d87);
+ DO2(B, C, D, A, 8, 20, 0x455a14ed);
+
+ DO2(A, B, C, D, 13, 5, 0xa9e3e905);
+ DO2(D, A, B, C, 2, 9, 0xfcefa3f8);
+ DO2(C, D, A, B, 7, 14, 0x676f02d9);
+ DO2(B, C, D, A, 12, 20, 0x8d2a4c8a);
+
+ /* Round 3 */
+
+ DO3(A, B, C, D, 5, 4, 0xfffa3942);
+ DO3(D, A, B, C, 8, 11, 0x8771f681);
+ DO3(C, D, A, B, 11, 16, 0x6d9d6122);
+ DO3(B, C, D, A, 14, 23, 0xfde5380c);
+
+ DO3(A, B, C, D, 1, 4, 0xa4beea44);
+ DO3(D, A, B, C, 4, 11, 0x4bdecfa9);
+ DO3(C, D, A, B, 7, 16, 0xf6bb4b60);
+ DO3(B, C, D, A, 10, 23, 0xbebfbc70);
+
+ DO3(A, B, C, D, 13, 4, 0x289b7ec6);
+ DO3(D, A, B, C, 0, 11, 0xeaa127fa);
+ DO3(C, D, A, B, 3, 16, 0xd4ef3085);
+ DO3(B, C, D, A, 6, 23, 0x4881d05);
+
+ DO3(A, B, C, D, 9, 4, 0xd9d4d039);
+ DO3(D, A, B, C, 12, 11, 0xe6db99e5);
+ DO3(C, D, A, B, 15, 16, 0x1fa27cf8);
+ DO3(B, C, D, A, 2, 23, 0xc4ac5665);
+
+ /* Round 4 */
+
+ DO4(A, B, C, D, 0, 6, 0xf4292244);
+ DO4(D, A, B, C, 7, 10, 0x432aff97);
+ DO4(C, D, A, B, 14, 15, 0xab9423a7);
+ DO4(B, C, D, A, 5, 21, 0xfc93a039);
+
+ DO4(A, B, C, D, 12, 6, 0x655b59c3);
+ DO4(D, A, B, C, 3, 10, 0x8f0ccc92);
+ DO4(C, D, A, B, 10, 15, 0xffeff47d);
+ DO4(B, C, D, A, 1, 21, 0x85845dd1);
+
+ DO4(A, B, C, D, 8, 6, 0x6fa87e4f);
+ DO4(D, A, B, C, 15, 10, 0xfe2ce6e0);
+ DO4(C, D, A, B, 6, 15, 0xa3014314);
+ DO4(B, C, D, A, 13, 21, 0x4e0811a1);
+
+ DO4(A, B, C, D, 4, 6, 0xf7537e82);
+ DO4(D, A, B, C, 11, 10, 0xbd3af235);
+ DO4(C, D, A, B, 2, 15, 0x2ad7d2bb);
+ DO4(B, C, D, A, 9, 21, 0xeb86d391);
+
+ A += AA;
+ B += BB;
+ C += CC;
+ D += DD;
}
/*
#if defined(WORDS_BIGENDIAN)
static inline afs_uint32
-swap_afs_uint32 (afs_uint32 t)
+swap_afs_uint32(afs_uint32 t)
{
- afs_uint32 temp1, temp2;
-
- temp1 = cshift(t, 16);
- temp2 = temp1 >> 8;
- temp1 &= 0x00ff00ff;
- temp2 &= 0x00ff00ff;
- temp1 <<= 8;
- return temp1 | temp2;
+ afs_uint32 temp1, temp2;
+
+ temp1 = cshift(t, 16);
+ temp2 = temp1 >> 8;
+ temp1 &= 0x00ff00ff;
+ temp2 &= 0x00ff00ff;
+ temp1 <<= 8;
+ return temp1 | temp2;
}
#endif
-struct x32{
- unsigned int a:32;
- unsigned int b:32;
+struct x32 {
+ unsigned int a:32;
+ unsigned int b:32;
};
void
-MD5_Update (struct md5 *m, const void *v, size_t len)
+MD5_Update(struct md5 *m, const void *v, size_t len)
{
- const unsigned char *p = v;
- size_t old_sz = m->sz[0];
- size_t offset;
-
- m->sz[0] += len * 8;
- if (m->sz[0] < old_sz)
- ++m->sz[1];
- offset = (old_sz / 8) % 64;
- while(len > 0){
- size_t l = min(len, 64 - offset);
- memcpy(m->save + offset, p, l);
- offset += l;
- p += l;
- len -= l;
- if(offset == 64){
+ const unsigned char *p = v;
+ size_t old_sz = m->sz[0];
+ size_t offset;
+
+ m->sz[0] += len * 8;
+ if (m->sz[0] < old_sz)
+ ++m->sz[1];
+ offset = (old_sz / 8) % 64;
+ while (len > 0) {
+ size_t l = min(len, 64 - offset);
+ memcpy(m->save + offset, p, l);
+ offset += l;
+ p += l;
+ len -= l;
+ if (offset == 64) {
#if defined(WORDS_BIGENDIAN)
- int i;
- afs_uint32 current[16];
- struct x32 *u = (struct x32*)m->save;
- for(i = 0; i < 8; i++){
- current[2*i+0] = swap_afs_uint32(u[i].a);
- current[2*i+1] = swap_afs_uint32(u[i].b);
- }
- calc(m, current);
+ int i;
+ afs_uint32 current[16];
+ struct x32 *u = (struct x32 *)m->save;
+ for (i = 0; i < 8; i++) {
+ current[2 * i + 0] = swap_afs_uint32(u[i].a);
+ current[2 * i + 1] = swap_afs_uint32(u[i].b);
+ }
+ calc(m, current);
#else
- calc(m, (afs_uint32*)m->save);
+ calc(m, (afs_uint32 *) m->save);
#endif
- offset = 0;
+ offset = 0;
+ }
}
- }
}
void
-MD5_Final (void *res, struct md5 *m)
+MD5_Final(void *res, struct md5 *m)
{
- static unsigned char zeros[72];
- unsigned offset = (m->sz[0] / 8) % 64;
- unsigned int dstart = (120 - offset - 1) % 64 + 1;
-
- *zeros = 0x80;
- memset (zeros + 1, 0, sizeof(zeros) - 1);
- zeros[dstart+0] = (m->sz[0] >> 0) & 0xff;
- zeros[dstart+1] = (m->sz[0] >> 8) & 0xff;
- zeros[dstart+2] = (m->sz[0] >> 16) & 0xff;
- zeros[dstart+3] = (m->sz[0] >> 24) & 0xff;
- zeros[dstart+4] = (m->sz[1] >> 0) & 0xff;
- zeros[dstart+5] = (m->sz[1] >> 8) & 0xff;
- zeros[dstart+6] = (m->sz[1] >> 16) & 0xff;
- zeros[dstart+7] = (m->sz[1] >> 24) & 0xff;
- MD5_Update (m, zeros, dstart + 8);
- {
- int i;
- unsigned char *r = (unsigned char *)res;
-
- for (i = 0; i < 4; ++i) {
- r[4*i] = m->counter[i] & 0xFF;
- r[4*i+1] = (m->counter[i] >> 8) & 0xFF;
- r[4*i+2] = (m->counter[i] >> 16) & 0xFF;
- r[4*i+3] = (m->counter[i] >> 24) & 0xFF;
- }
- }
+ static unsigned char zeros[72];
+ unsigned offset = (m->sz[0] / 8) % 64;
+ unsigned int dstart = (120 - offset - 1) % 64 + 1;
+
+ *zeros = 0x80;
+ memset(zeros + 1, 0, sizeof(zeros) - 1);
+ zeros[dstart + 0] = (m->sz[0] >> 0) & 0xff;
+ zeros[dstart + 1] = (m->sz[0] >> 8) & 0xff;
+ zeros[dstart + 2] = (m->sz[0] >> 16) & 0xff;
+ zeros[dstart + 3] = (m->sz[0] >> 24) & 0xff;
+ zeros[dstart + 4] = (m->sz[1] >> 0) & 0xff;
+ zeros[dstart + 5] = (m->sz[1] >> 8) & 0xff;
+ zeros[dstart + 6] = (m->sz[1] >> 16) & 0xff;
+ zeros[dstart + 7] = (m->sz[1] >> 24) & 0xff;
+ MD5_Update(m, zeros, dstart + 8);
+ {
+ int i;
+ unsigned char *r = (unsigned char *)res;
+
+ for (i = 0; i < 4; ++i) {
+ r[4 * i] = m->counter[i] & 0xFF;
+ r[4 * i + 1] = (m->counter[i] >> 8) & 0xFF;
+ r[4 * i + 2] = (m->counter[i] >> 16) & 0xFF;
+ r[4 * i + 3] = (m->counter[i] >> 24) & 0xFF;
+ }
+ }
#if 0
- {
- int i;
- afs_uint32 *r = (afs_uint32 *)res;
+ {
+ int i;
+ afs_uint32 *r = (afs_uint32 *) res;
- for (i = 0; i < 4; ++i)
- r[i] = swap_afs_uint32 (m->counter[i]);
- }
+ for (i = 0; i < 4; ++i)
+ r[i] = swap_afs_uint32(m->counter[i]);
+ }
#endif
}
* SUCH DAMAGE.
*/
-/* $Id: md5.h,v 1.1 2004/04/09 05:54:22 jaltman Exp $ */
+/* $Id: md5.h,v 1.1.2.1 2004/08/25 07:09:42 shadow Exp $ */
#include <stdlib.h>
#ifdef HAVE_SYS_TYPES_H
#endif
struct md5 {
- unsigned int sz[2];
- afs_uint32 counter[4];
- unsigned char save[64];
+ unsigned int sz[2];
+ afs_uint32 counter[4];
+ unsigned char save[64];
};
typedef struct md5 MD5_CTX;
-void MD5_Init (struct md5 *m);
-void MD5_Update (struct md5 *m, const void *p, size_t len);
-void MD5_Final (void *res, struct md5 *m); /* afs_uint32 res[4] */
+void MD5_Init(struct md5 *m);
+void MD5_Update(struct md5 *m, const void *p, size_t len);
+void MD5_Final(void *res, struct md5 *m); /* afs_uint32 res[4] */
/* no ticket good for longer than 30 days */
#define MAXKTCTICKETLIFETIME (30*24*3600)
#define MINKTCTICKETLEN 32
-#define MAXKTCTICKETLEN 12000 /* was 344 */
+#ifdef AFS_AIX_ENV
+#define MAXKTCTICKETLEN 344 /* XXX why must this be small? */
+#else
+#define MAXKTCTICKETLEN 12000 /* was 344 */
+#endif
+
#define MAXKTCNAMELEN 64 /* name & inst should be 256 */
#define MAXKTCREALMLEN 64 /* should be 256 */
#define KTC_TIME_UNCERTAINTY (15*60) /* max skew bet. machines' clocks */
#define MAXRANDOMNAMELEN 16 /* length of random generated
- * usernames used by afslog for high
- * security must be < MAXKTCNAMELEN && < MAXSMBNAMELEN */
-#define MAXSMBNAMELEN 256 /* max length of an SMB name */
+ * usernames used by afslog for high
+ * security must be < MAXKTCNAMELEN && < MAXSMBNAMELEN */
+#define MAXSMBNAMELEN 256 /* max length of an SMB name */
#define LOGON_OPTION_INTEGRATED 1
#define LOGON_OPTION_HIGHSECURITY 2
#include <pthread.h>
#include <assert.h>
extern pthread_mutex_t rxkad_stats_mutex;
-#define LOCK_RXKAD_STATS assert(pthread_mutex_lock(&rxkad_stats_mutex)==0);
-#define UNLOCK_RXKAD_STATS assert(pthread_mutex_unlock(&rxkad_stats_mutex)==0);
+#define LOCK_RXKAD_STATS assert(pthread_mutex_lock(&rxkad_stats_mutex)==0)
+#define UNLOCK_RXKAD_STATS assert(pthread_mutex_unlock(&rxkad_stats_mutex)==0)
#else
#define LOCK_RXKAD_STATS
#define UNLOCK_RXKAD_STATS
#endif
RCSID
- ("$Header: /cvs/openafs/src/rxkad/rxkad_client.c,v 1.18 2004/04/19 05:43:58 kolya Exp $");
+ ("$Header: /cvs/openafs/src/rxkad/rxkad_client.c,v 1.18.2.1 2004/08/25 07:09:42 shadow Exp $");
#ifdef KERNEL
#include "afs/stds.h"
*/
#include <assert.h>
pthread_mutex_t rxkad_client_uid_mutex;
-#define LOCK_CUID assert(pthread_mutex_lock(&rxkad_client_uid_mutex)==0);
-#define UNLOCK_CUID assert(pthread_mutex_unlock(&rxkad_client_uid_mutex)==0);
+#define LOCK_CUID assert(pthread_mutex_lock(&rxkad_client_uid_mutex)==0)
+#define UNLOCK_CUID assert(pthread_mutex_unlock(&rxkad_client_uid_mutex)==0)
#else
#define LOCK_CUID
#define UNLOCK_CUID
struct rxkad_cidgen tgen;
static afs_int32 counter = 0; /* not used anymore */
- LOCK_CUID if (Cuid[0] == 0) {
+ LOCK_CUID;
+ if (Cuid[0] == 0) {
afs_uint32 xor[2];
tgen.ipAddr = rxi_getaddr(); /* comes back in net order */
clock_GetTime(&tgen.time); /* changes time1 and time2 */
}
if (!aconn) {
- UNLOCK_CUID return 0;
+ UNLOCK_CUID;
+ return 0;
}
aconn->epoch = Cuid[0];
aconn->cid = Cuid[1];
Cuid[1] += 1 << RX_CIDSHIFT;
- UNLOCK_CUID return 0;
+ UNLOCK_CUID;
+ return 0;
}
/* Allocate a new client security object. Called with the encryption level,
}
memcpy(tcp->ticket, ticket, ticketLen);
- LOCK_RXKAD_STATS rxkad_stats_clientObjects++;
- UNLOCK_RXKAD_STATS return tsc;
+ LOCK_RXKAD_STATS;
+ rxkad_stats_clientObjects++;
+ UNLOCK_RXKAD_STATS;
+ return tsc;
}
/* client: respond to a challenge packet */
if (level > tcp->level)
return RXKADLEVELFAIL;
- LOCK_RXKAD_STATS rxkad_stats.challenges[rxkad_LevelIndex(tcp->level)]++;
- UNLOCK_RXKAD_STATS if (v2) {
+ LOCK_RXKAD_STATS;
+ rxkad_stats.challenges[rxkad_LevelIndex(tcp->level)]++;
+ UNLOCK_RXKAD_STATS;
+ if (v2) {
int i;
afs_uint32 xor[2];
memset((void *)&r_v2, 0, sizeof(r_v2));
void
rxkad_ResetState(void)
{
- LOCK_CUID Cuid[0] = 0;
+ LOCK_CUID;
+ Cuid[0] = 0;
rxkad_EpochWasSet = 0;
-UNLOCK_CUID}
+ UNLOCK_CUID;
+}
#define INCLUDE_RXKAD_PRIVATE_DECLS
RCSID
- ("$Header: /cvs/openafs/src/rxkad/rxkad_common.c,v 1.20 2004/06/23 14:27:44 shadow Exp $");
+ ("$Header: /cvs/openafs/src/rxkad/rxkad_common.c,v 1.20.2.1 2004/08/25 07:09:42 shadow Exp $");
#ifdef KERNEL
#ifndef UKERNEL
#endif
/* variable initialization for the benefit of darwin compiler; if it causes
problems elsewhere, conditionalize for darwin or fc_test compile breaks */
-struct rxkad_stats rxkad_stats = {0};
+struct rxkad_stats rxkad_stats = { 0 };
/* static prototypes */
static afs_int32 ComputeSum(struct rx_packet *apacket,
} else {
return RXKADINCONSISTENCY;
} /* unknown type */
- LOCK_RXKAD_STATS rxkad_stats.destroyObject++;
- UNLOCK_RXKAD_STATS return 0;
+ LOCK_RXKAD_STATS;
+ rxkad_stats.destroyObject++;
+ UNLOCK_RXKAD_STATS;
+ return 0;
}
/* rxkad_Close - called by rx with the security class object as a parameter
rxkad_SetLevel(aconn, tcp->level); /* set header and trailer sizes */
rxkad_AllocCID(aobj, aconn); /* CHANGES cid AND epoch!!!! */
rxkad_DeriveXORInfo(aconn, tcp->keysched, tcp->ivec, tccp->preSeq);
- LOCK_RXKAD_STATS rxkad_stats.
- connections[rxkad_LevelIndex(tcp->level)]++;
- UNLOCK_RXKAD_STATS}
+ LOCK_RXKAD_STATS;
+ rxkad_stats.connections[rxkad_LevelIndex(tcp->level)]++;
+ UNLOCK_RXKAD_STATS;
+ }
aobj->refCount++; /* attached connection */
return 0;
sconn = (struct rxkad_sconn *)aconn->securityData;
if (sconn) {
aconn->securityData = 0;
- LOCK_RXKAD_STATS if (sconn->authenticated)
- rxkad_stats.destroyConn[rxkad_LevelIndex(sconn->level)]++;
+ LOCK_RXKAD_STATS;
+ if (sconn->authenticated)
+ rxkad_stats.destroyConn[rxkad_LevelIndex(sconn->level)]++;
else
rxkad_stats.destroyUnauth++;
- UNLOCK_RXKAD_STATS rock = sconn->rock;
+ UNLOCK_RXKAD_STATS;
+ rock = sconn->rock;
if (rock)
rxi_Free(rock, sizeof(struct rxkad_serverinfo));
rxi_Free(sconn, sizeof(struct rxkad_sconn));
} else {
- LOCK_RXKAD_STATS rxkad_stats.destroyUnused++;
- UNLOCK_RXKAD_STATS}
+ LOCK_RXKAD_STATS;
+ rxkad_stats.destroyUnused++;
+ UNLOCK_RXKAD_STATS;
+ }
} else { /* client */
struct rxkad_cconn *cconn;
struct rxkad_cprivate *tcp;
aconn->securityData = 0;
rxi_Free(cconn, sizeof(struct rxkad_cconn));
}
- LOCK_RXKAD_STATS rxkad_stats.destroyClient++;
- UNLOCK_RXKAD_STATS}
+ LOCK_RXKAD_STATS;
+ rxkad_stats.destroyClient++;
+ UNLOCK_RXKAD_STATS;
+ }
aobj->refCount--; /* decrement connection counter */
if (aobj->refCount <= 0) {
afs_int32 code;
if (sconn && sconn->authenticated
&& (osi_Time() < sconn->expirationTime)) {
level = sconn->level;
- LOCK_RXKAD_STATS rxkad_stats.
- checkPackets[rxkad_StatIndex(rxkad_server, level)]++;
- UNLOCK_RXKAD_STATS sconn->stats.packetsReceived++;
+ LOCK_RXKAD_STATS;
+ rxkad_stats.checkPackets[rxkad_StatIndex(rxkad_server, level)]++;
+ UNLOCK_RXKAD_STATS;
+ sconn->stats.packetsReceived++;
sconn->stats.bytesReceived += len;
schedule = (fc_KeySchedule *) sconn->keysched;
ivec = (fc_InitializationVector *) sconn->ivec;
} else {
- LOCK_RXKAD_STATS rxkad_stats.expired++;
- UNLOCK_RXKAD_STATS return RXKADEXPIRED;
+ LOCK_RXKAD_STATS;
+ rxkad_stats.expired++;
+ UNLOCK_RXKAD_STATS;
+ return RXKADEXPIRED;
}
preSeq = sconn->preSeq;
} else { /* client connection */
if (!(tcp->type & rxkad_client))
return RXKADINCONSISTENCY;
level = tcp->level;
- LOCK_RXKAD_STATS rxkad_stats.
- checkPackets[rxkad_StatIndex(rxkad_client, level)]++;
- UNLOCK_RXKAD_STATS cconn->stats.packetsReceived++;
+ LOCK_RXKAD_STATS;
+ rxkad_stats.checkPackets[rxkad_StatIndex(rxkad_client, level)]++;
+ UNLOCK_RXKAD_STATS;
+ cconn->stats.packetsReceived++;
cconn->stats.bytesReceived += len;
preSeq = cconn->preSeq;
schedule = (fc_KeySchedule *) tcp->keysched;
if (sconn && sconn->authenticated
&& (osi_Time() < sconn->expirationTime)) {
level = sconn->level;
- LOCK_RXKAD_STATS rxkad_stats.
+ LOCK_RXKAD_STATS;
+ rxkad_stats.
preparePackets[rxkad_StatIndex(rxkad_server, level)]++;
- UNLOCK_RXKAD_STATS sconn->stats.packetsSent++;
+ UNLOCK_RXKAD_STATS;
+ sconn->stats.packetsSent++;
sconn->stats.bytesSent += len;
schedule = (fc_KeySchedule *) sconn->keysched;
ivec = (fc_InitializationVector *) sconn->ivec;
} else {
- LOCK_RXKAD_STATS rxkad_stats.expired++; /* this is a pretty unlikely path... */
- UNLOCK_RXKAD_STATS return RXKADEXPIRED;
+ LOCK_RXKAD_STATS;
+ rxkad_stats.expired++; /* this is a pretty unlikely path... */
+ UNLOCK_RXKAD_STATS;
+ return RXKADEXPIRED;
}
preSeq = sconn->preSeq;
} else { /* client connection */
if (!(tcp->type & rxkad_client))
return RXKADINCONSISTENCY;
level = tcp->level;
- LOCK_RXKAD_STATS rxkad_stats.
- preparePackets[rxkad_StatIndex(rxkad_client, level)]++;
- UNLOCK_RXKAD_STATS cconn->stats.packetsSent++;
+ LOCK_RXKAD_STATS;
+ rxkad_stats.preparePackets[rxkad_StatIndex(rxkad_client, level)]++;
+ UNLOCK_RXKAD_STATS;
+ cconn->stats.packetsSent++;
cconn->stats.bytesSent += len;
preSeq = cconn->preSeq;
schedule = (fc_KeySchedule *) tcp->keysched;
rxkad_level
rxkad_StringToLevel(char *name)
{
- if (strcmp(name, "clear") == 0)
- return rxkad_clear;
- if (strcmp(name, "auth") == 0)
- return rxkad_auth;
- if (strcmp(name, "crypt") == 0)
- return rxkad_crypt;
- return -1;
+ if (strcmp(name, "clear") == 0)
+ return rxkad_clear;
+ if (strcmp(name, "auth") == 0)
+ return rxkad_auth;
+ if (strcmp(name, "crypt") == 0)
+ return rxkad_crypt;
+ return -1;
}
char *
rxkad_LevelToString(rxkad_level level)
{
- if (level == rxkad_clear)
- return "clear";
- if (level == rxkad_auth)
- return "auth";
- if (level == rxkad_crypt)
- return "crypt";
- return "unknown";
+ if (level == rxkad_clear)
+ return "clear";
+ if (level == rxkad_auth)
+ return "auth";
+ if (level == rxkad_crypt)
+ return "crypt";
+ return "unknown";
}
level, char
*get_key_rock,
int (*get_key)
- (char
- *get_key_rock,
- int kvno,
- struct
- ktc_encryptionKey
- * serverKey),
+
+
+
+ (char
+ *get_key_rock,
+ int kvno,
+ struct
+ ktc_encryptionKey
+ * serverKey),
int (*user_ok)
- (char *name,
- char
- *instance,
- char *cell,
- afs_int32
- kvno));
+
+
+
+ (char *name,
+ char
+ *instance,
+ char *cell,
+ afs_int32
+ kvno));
extern int rxkad_CheckAuthentication(struct rx_securityClass *aobj,
struct rx_connection *aconn);
extern int rxkad_CreateChallenge(struct rx_securityClass *aobj,
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/rxkad/rxkad_server.c,v 1.14 2003/11/29 20:23:35 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/rxkad/rxkad_server.c,v 1.14.2.1 2004/08/25 07:09:42 shadow Exp $");
#include <afs/stds.h>
#include <sys/types.h>
rxkad_CheckPacket, /* check data packet */
rxkad_DestroyConnection,
rxkad_GetStats,
- 0, /* spare 1 */
- 0, /* spare 2 */
- 0, /* spare 3 */
+ 0, /* spare 1 */
+ 0, /* spare 2 */
+ 0, /* spare 3 */
};
extern afs_uint32 rx_MyMaxSendSize;
#include <assert.h>
pthread_mutex_t rxkad_random_mutex;
-#define LOCK_RM assert(pthread_mutex_lock(&rxkad_random_mutex)==0);
-#define UNLOCK_RM assert(pthread_mutex_unlock(&rxkad_random_mutex)==0);
+#define LOCK_RM assert(pthread_mutex_lock(&rxkad_random_mutex)==0)
+#define UNLOCK_RM assert(pthread_mutex_unlock(&rxkad_random_mutex)==0)
#else
#define LOCK_RM
#define UNLOCK_RM
struct timeval key;
gettimeofday(&key, NULL);
- LOCK_RM fc_keysched(&key, random_int32_schedule);
-UNLOCK_RM}
+ LOCK_RM;
+ fc_keysched(&key, random_int32_schedule);
+ UNLOCK_RM;
+}
static afs_int32
get_random_int32(void)
static struct timeval seed;
afs_int32 rc;
- LOCK_RM fc_ecb_encrypt(&seed, &seed, random_int32_schedule, ENCRYPT);
+ LOCK_RM;
+ fc_ecb_encrypt(&seed, &seed, random_int32_schedule, ENCRYPT);
rc = seed.tv_sec;
- UNLOCK_RM return rc;
+ UNLOCK_RM;
+ return rc;
}
/* Called with four parameters. The first is the level of encryption, as
tsp->user_ok = user_ok; /* to inform server of client id. */
init_random_int32();
- LOCK_RXKAD_STATS rxkad_stats_serverObjects++;
- UNLOCK_RXKAD_STATS return tsc;
+ LOCK_RXKAD_STATS;
+ rxkad_stats_serverObjects++;
+ UNLOCK_RXKAD_STATS;
+ return tsc;
}
/* server: called to tell if a connection authenticated properly */
rx_packetwrite(apacket, 0, challengeSize, challenge);
rx_SetDataSize(apacket, challengeSize);
sconn->tried = 1;
- LOCK_RXKAD_STATS rxkad_stats.challengesSent++;
- UNLOCK_RXKAD_STATS return 0;
+ LOCK_RXKAD_STATS;
+ rxkad_stats.challengesSent++;
+ UNLOCK_RXKAD_STATS;
+ return 0;
}
/* server: process a response to a challenge packet */
return RXKADLEVELFAIL;
sconn->level = level;
rxkad_SetLevel(aconn, sconn->level);
- LOCK_RXKAD_STATS rxkad_stats.responses[rxkad_LevelIndex(sconn->level)]++;
- UNLOCK_RXKAD_STATS
- /* now compute endpoint-specific info used for computing 16 bit checksum */
- rxkad_DeriveXORInfo(aconn, sconn->keysched, sconn->ivec,
- sconn->preSeq);
+ LOCK_RXKAD_STATS;
+ rxkad_stats.responses[rxkad_LevelIndex(sconn->level)]++;
+ UNLOCK_RXKAD_STATS;
+ /* now compute endpoint-specific info used for computing 16 bit checksum */
+ rxkad_DeriveXORInfo(aconn, sconn->keysched, sconn->ivec, sconn->preSeq);
/* otherwise things are ok */
sconn->expirationTime = end;
#endif
RCSID
- ("$Header: /cvs/openafs/src/rxkad/ticket5.c,v 1.8 2004/04/09 05:53:14 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/rxkad/ticket5.c,v 1.8.2.1 2004/08/25 07:09:42 shadow Exp $");
#if defined(UKERNEL)
#include "../afs/sysincludes.h"
static int
verify_checksum_md4(void *data, size_t len,
- void *cksum, size_t cksumsz,
- struct ktc_encryptionKey *key)
+ void *cksum, size_t cksumsz,
+ struct ktc_encryptionKey *key)
{
- MD4_CTX md4;
- unsigned char tmp[16];
+ MD4_CTX md4;
+ unsigned char tmp[16];
- MD4_Init(&md4);
- MD4_Update(&md4, data, len);
- MD4_Final (tmp, &md4);
+ MD4_Init(&md4);
+ MD4_Update(&md4, data, len);
+ MD4_Final(tmp, &md4);
- if (memcmp(tmp, cksum, cksumsz) != 0)
- return 1;
- return 0;
+ if (memcmp(tmp, cksum, cksumsz) != 0)
+ return 1;
+ return 0;
}
static int
verify_checksum_md5(void *data, size_t len,
- void *cksum, size_t cksumsz,
- struct ktc_encryptionKey *key)
+ void *cksum, size_t cksumsz,
+ struct ktc_encryptionKey *key)
{
- MD5_CTX md5;
- unsigned char tmp[16];
+ MD5_CTX md5;
+ unsigned char tmp[16];
- MD5_Init(&md5);
- MD5_Update(&md5, data, len);
- MD5_Final (tmp, &md5);
+ MD5_Init(&md5);
+ MD5_Update(&md5, data, len);
+ MD5_Final(tmp, &md5);
- if (memcmp(tmp, cksum, cksumsz) != 0)
- return 1;
- return 0;
+ if (memcmp(tmp, cksum, cksumsz) != 0)
+ return 1;
+ return 0;
}
static int
des_key_schedule s;
char cksum[24];
size_t cksumsz;
- int ret = 1; /* failure */
+ int ret = 1; /* failure */
cksum_func = NULL;
afs_krb_get_lrealm;
pr_NameToId;
pr_IdToName;
+ pr_ListMembers;
+ pr_End;
pr_SNameToId;
afs_get_pag_from_groups;
setpag;
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/ubik/beacon.c,v 1.19 2004/01/10 16:59:35 zacheiss Exp $");
+ ("$Header: /cvs/openafs/src/ubik/beacon.c,v 1.19.2.2 2004/08/25 07:11:03 shadow Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
}
#ifdef AFS_NT40_ENV
- /* get all my interface addresses in net byte order */
- count = rx_getAllAddr(myAddr, UBIK_MAX_INTERFACE_ADDR);
+ /* get all my interface addresses in net byte order */
+ count = rx_getAllAddr(myAddr, UBIK_MAX_INTERFACE_ADDR);
#else
if (AFSDIR_SERVER_NETRESTRICT_FILEPATH || AFSDIR_SERVER_NETINFO_FILEPATH) {
/*
for (i = 0; i < totalServers; i++) {
if (info)
tmpAddr =
- ntohl((afs_uint32) info->hostAddr[i].sin_addr.s_addr);
+ (afs_uint32) info->hostAddr[i].sin_addr.s_addr;
else
tmpAddr = aservers[i];
if (myAddr[j] == tmpAddr) {
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/ubik/remote.c,v 1.12 2003/09/27 06:23:30 shadow Exp $");
+ ("$Header: /cvs/openafs/src/ubik/remote.c,v 1.12.2.1 2004/08/25 07:09:43 shadow Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
(*dbase->truncate) (dbase, file, 0); /* truncate first */
tversion.epoch = 0; /* start off by labelling in-transit db as invalid */
tversion.counter = 0;
- (*dbase->setlabel) (dbase, file, &tversion);/* setlabel does sync */
+ (*dbase->setlabel) (dbase, file, &tversion); /* setlabel does sync */
memcpy(&ubik_dbase->version, &tversion, sizeof(struct ubik_version));
while (length > 0) {
tlen = (length > sizeof(tbuffer) ? sizeof(tbuffer) : length);
};
#ifdef AFS_PTHREAD_ENV
-#define LOCK_UBIK_CLIENT(client) assert(pthread_mutex_lock(&client->cm)==0);
-#define UNLOCK_UBIK_CLIENT(client) assert(pthread_mutex_unlock(&client->cm)==0);
+#define LOCK_UBIK_CLIENT(client) assert(pthread_mutex_lock(&client->cm)==0)
+#define UNLOCK_UBIK_CLIENT(client) assert(pthread_mutex_unlock(&client->cm)==0)
#else
#define LOCK_UBIK_CLIENT(client)
#define UNLOCK_UBIK_CLIENT(client)
extern afs_int32 ubik_ClientDestroy(struct ubik_client *aclient);
/* ubik.c */
-extern int ubik_BeginTrans(register struct ubik_dbase *dbase, afs_int32 transMode, struct ubik_trans **transPtr);
+extern int ubik_BeginTrans(register struct ubik_dbase *dbase,
+ afs_int32 transMode, struct ubik_trans **transPtr);
extern int ubik_EndTrans(register struct ubik_trans *transPtr);
#endif /* UBIK_H */
#endif
RCSID
- ("$Header: /cvs/openafs/src/ubik/ubikclient.c,v 1.8 2003/07/15 23:17:05 shadow Exp $");
+ ("$Header: /cvs/openafs/src/ubik/ubikclient.c,v 1.8.2.1 2004/08/25 07:09:43 shadow Exp $");
#if defined(UKERNEL)
#include "afs/sysincludes.h"
if (*tp == '-')
break; /* done */
/* otherwise this is a new host name */
- LOCK_GLOBAL_MUTEX th = gethostbyname(tp);
+ LOCK_GLOBAL_MUTEX;
+ th = gethostbyname(tp);
if (!th) {
- UNLOCK_GLOBAL_MUTEX return UBADHOST;
+ UNLOCK_GLOBAL_MUTEX;
+ return UBADHOST;
}
memmove((void *)&temp, (const void *)th->h_addr,
sizeof(afs_int32));
- UNLOCK_GLOBAL_MUTEX if (counter++ >= MAXSERVERS)
- return UNHOSTS;
+ UNLOCK_GLOBAL_MUTEX;
+ if (counter++ >= MAXSERVERS)
+ return UNHOSTS;
*aothers++ = temp;
} else {
/* haven't seen a -server yet */
initialize_U_error_table();
if (*aclient) { /* the application is doing a re-initialization */
- LOCK_UBIK_CLIENT((*aclient))
- /* this is an important defensive check */
- if (!((*aclient)->initializationState)) {
- UNLOCK_UBIK_CLIENT((*aclient))
- return UREINITIALIZE;
+ LOCK_UBIK_CLIENT((*aclient));
+ /* this is an important defensive check */
+ if (!((*aclient)->initializationState)) {
+ UNLOCK_UBIK_CLIENT((*aclient));
+ return UREINITIALIZE;
}
/* release all existing connections */
rx_DestroyConnection(rxConn);
#endif
}
- UNLOCK_UBIK_CLIENT((*aclient))
+ UNLOCK_UBIK_CLIENT((*aclient));
#ifdef AFS_PTHREAD_ENV
- if (pthread_mutex_destroy(&((*aclient)->cm)))
+ if (pthread_mutex_destroy(&((*aclient)->cm)))
return UMUTEXDESTROY;
#endif
} else {
pthread_mutex_t ubik_client_mutex;
#define LOCK_UCLNT_CACHE \
assert(pthread_once(&ubik_client_once, ubik_client_init_mutex) == 0 && \
- pthread_mutex_lock(&ubik_client_mutex)==0);
-#define UNLOCK_UCLNT_CACHE assert(pthread_mutex_unlock(&ubik_client_mutex)==0);
+ pthread_mutex_lock(&ubik_client_mutex)==0)
+#define UNLOCK_UCLNT_CACHE assert(pthread_mutex_unlock(&ubik_client_mutex)==0)
void
ubik_client_init_mutex()
rcode = UNOSERVERS;
chaseCount = inlist = needsync = 0;
- LOCK_UCLNT_CACHE for (j = 0; ((j < SYNCCOUNT) && calls_needsync[j]); j++) {
+ LOCK_UCLNT_CACHE;
+ for (j = 0; ((j < SYNCCOUNT) && calls_needsync[j]); j++) {
if (calls_needsync[j] == (int *)aproc) {
inlist = needsync = 1;
break;
}
}
- UNLOCK_UCLNT_CACHE
- /*
- * First pass, we try all servers that are up.
- * Second pass, we try all servers.
- */
- for (pass = 0; pass < 2; pass++) { /*p */
+ UNLOCK_UCLNT_CACHE;
+ /*
+ * First pass, we try all servers that are up.
+ * Second pass, we try all servers.
+ */
+ for (pass = 0; pass < 2; pass++) { /*p */
/* For each entry in our servers list */
for (count = 0;; count++) { /*s */
done:
if (needsync) {
if (!inlist) { /* Remember proc call that needs sync site */
- LOCK_UCLNT_CACHE calls_needsync[synccount % SYNCCOUNT] =
- (int *)aproc;
+ LOCK_UCLNT_CACHE;
+ calls_needsync[synccount % SYNCCOUNT] = (int *)aproc;
synccount++;
- UNLOCK_UCLNT_CACHE inlist = 1;
+ UNLOCK_UCLNT_CACHE;
+ inlist = 1;
}
if (!rcode) { /* Remember the sync site - cmd successful */
rxp = rx_PeerOf(aclient->conns[count]);
short origLevel;
if (needlock) {
- LOCK_UBIK_CLIENT(aclient)
+ LOCK_UBIK_CLIENT(aclient);
}
origLevel = aclient->initializationState;
tc = aclient->conns[*apos];
if (!tc) {
if (needlock) {
- UNLOCK_UBIK_CLIENT(aclient)
+ UNLOCK_UBIK_CLIENT(aclient);
}
return UNOSERVERS;
}
}
if (*apos >= MAXSERVERS) {
if (needlock) {
- UNLOCK_UBIK_CLIENT(aclient)
+ UNLOCK_UBIK_CLIENT(aclient);
}
return UNOSERVERS;
}
p14, p15, p16);
if (aclient->initializationState != origLevel) {
if (needlock) {
- UNLOCK_UBIK_CLIENT(aclient)
+ UNLOCK_UBIK_CLIENT(aclient);
}
return code; /* somebody did a ubik_ClientInit */
}
(*apos)++;
if (needlock) {
- UNLOCK_UBIK_CLIENT(aclient)
+ UNLOCK_UBIK_CLIENT(aclient);
}
return code;
}
int stepBack;
short origLevel;
- LOCK_UBIK_CLIENT(aclient)
+ LOCK_UBIK_CLIENT(aclient);
restart:
rcode = UNOSERVERS;
origLevel = aclient->initializationState;
}
}
} else if ((code >= 0) && (code != UNOQUORUM)) {
- UNLOCK_UBIK_CLIENT(aclient)
- return code; /* success or global error condition */
+ UNLOCK_UBIK_CLIENT(aclient);
+ return code; /* success or global error condition */
}
}
}
- UNLOCK_UBIK_CLIENT(aclient)
- return rcode;
+ UNLOCK_UBIK_CLIENT(aclient);
+ return rcode;
}
/*
extern int pthread_recursive_mutex_unlock(pthread_recursive_mutex_p);
#define LOCK_GLOBAL_MUTEX \
- assert(pthread_recursive_mutex_lock(&grmutex)==0);
+ assert(pthread_recursive_mutex_lock(&grmutex)==0)
#define UNLOCK_GLOBAL_MUTEX \
- assert(pthread_recursive_mutex_unlock(&grmutex)==0);
+ assert(pthread_recursive_mutex_unlock(&grmutex)==0)
#else
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/vfsck/setup.c,v 1.10 2004/06/24 17:38:39 shadow Exp $");
+ ("$Header: /cvs/openafs/src/vfsck/setup.c,v 1.10.2.1 2004/08/25 07:22:22 shadow Exp $");
#include <stdio.h>
#define VICE
return (-1);
#endif
#ifdef AFS_NEWCG_ENV
-# ifndef AFS_SUN510_ENV
+# ifndef AFS_SUN59_ENV
if (sblock.fs_interleave < 1) {
pwarn("IMPOSSIBLE INTERLEAVE=%d IN SUPERBLOCK", sblock.fs_interleave);
sblock.fs_interleave = 1;
dirty(&asblk);
}
}
-# endif /* AFS_SUN510_ENV */
+# endif /* AFS_SUN59_ENV */
#endif /* AFS_NEWCG_ENV */
#ifdef AFS_NEWCG_ENV
if (sblock.fs_npsect < sblock.fs_nsect) {
#if defined(AFS_SUN_ENV) && !defined(AFS_SUN3_ENV)
#ifdef AFS_SUN5_ENV
sblock.fs_npsect = 0;
-# ifndef AFS_SUN510_ENV
+# ifndef AFS_SUN59_ENV
sblock.fs_interleave = 0;
# endif
sblock.fs_state = FSOKAY - sblock.fs_time; /* make mountable */
*/
altsblock.fs_fsbtodb = sblock.fs_fsbtodb;
#ifdef AFS_NEWCG_ENV
-# ifndef AFS_SUN510_ENV
+# ifndef AFS_SUN59_ENV
altsblock.fs_interleave = sblock.fs_interleave;
# endif
altsblock.fs_npsect = sblock.fs_npsect;
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/vol/clone.c,v 1.17 2003/08/08 20:40:45 shadow Exp $");
+ ("$Header: /cvs/openafs/src/vol/clone.c,v 1.17.2.1 2004/08/25 07:14:19 shadow Exp $");
#include <sys/types.h>
#include <stdio.h>
void
CloneVolume(Error * error, Volume * original, Volume * new, Volume * old)
{
- VOL_LOCK CloneVolume_r(error, original, new, old);
-VOL_UNLOCK}
+ VOL_LOCK;
+ CloneVolume_r(error, original, new, old);
+ VOL_UNLOCK;
+}
void
CloneVolume_r(Error * rerror, Volume * original, Volume * new, Volume * old)
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/vol/fssync.c,v 1.26 2004/07/28 21:49:18 shadow Exp $");
+ ("$Header: /cvs/openafs/src/vol/fssync.c,v 1.26.2.1 2004/08/25 07:14:19 shadow Exp $");
#include <sys/types.h>
#include <stdio.h>
#define MAXHANDLERS 4 /* Up to 4 clients; must be at least 2, so that
* move = dump+restore can run on single server */
-#define MAXOFFLINEVOLUMES 128 /* This needs to be as big as the maximum
+#define MAXOFFLINEVOLUMES 128 /* This needs to be as big as the maximum
* number that would be offline for 1 operation.
* Current winner is salvage, which needs all
* cloned read-only copies offline when salvaging
else
command.partName[0] = 0;
assert(FS_sd != -1);
- VFSYNC_LOCK
+ VFSYNC_LOCK;
#ifdef AFS_NT40_ENV
if (send(FS_sd, (char *)&command, sizeof(command), 0) != sizeof(command)) {
printf("FSYNC_askfs: write to file server failed\n");
("FSYNC_askfs: negative response from file server; volume %u, command %d\n",
command.volume, (int)command.command);
}
- done:
- VFSYNC_UNLOCK
-
+ done:
+ VFSYNC_UNLOCK;
return response;
}
FSYNC_Drop(fd);
return;
}
- VATTACH_LOCK VOL_LOCK volumes = OfflineVolumes[FindHandler(fd)];
+ VATTACH_LOCK;
+ VOL_LOCK;
+ volumes = OfflineVolumes[FindHandler(fd)];
for (v = 0, i = 0; i < MAXOFFLINEVOLUMES; i++) {
if (volumes[i].volumeID == command.volume
&& strcmp(volumes[i].partName, command.partName) == 0) {
if (V_BreakVolumeCallbacks) {
Log("fssync: volume %u moved to %x; breaking all call backs\n",
command.volume, command.reason);
- VOL_UNLOCK VATTACH_UNLOCK(*V_BreakVolumeCallbacks) (command.
- volume);
- VATTACH_LOCK VOL_LOCK}
+ VOL_UNLOCK;
+ VATTACH_UNLOCK;
+ (*V_BreakVolumeCallbacks) (command.volume);
+ VATTACH_LOCK;
+ VOL_LOCK;
+ }
break;
case FSYNC_RESTOREVOLUME:
/* if the volume is being restored, break all callbacks on it */
if (V_BreakVolumeCallbacks) {
Log("fssync: volume %u restored; breaking all call backs\n",
command.volume);
- VOL_UNLOCK VATTACH_UNLOCK(*V_BreakVolumeCallbacks) (command.
- volume);
- VATTACH_LOCK VOL_LOCK}
+ VOL_UNLOCK;
+ VATTACH_UNLOCK;
+ (*V_BreakVolumeCallbacks) (command.volume);
+ VATTACH_LOCK;
+ VOL_LOCK;
+ }
break;
default:
rc = FSYNC_DENIED;
break;
}
- VOL_UNLOCK VATTACH_UNLOCK
+ VOL_UNLOCK;
+ VATTACH_UNLOCK;
#ifdef AFS_NT40_ENV
- (void) send(fd, &rc, 1, 0);
+ (void)send(fd, &rc, 1, 0);
#else
- (void) write(fd, &rc, 1);
+ (void)write(fd, &rc, 1);
#endif
}
Error error;
char tvolName[VMAXPATHLEN];
- VATTACH_LOCK VOL_LOCK p = OfflineVolumes[FindHandler(fd)];
+ VATTACH_LOCK;
+ VOL_LOCK;
+ p = OfflineVolumes[FindHandler(fd)];
for (i = 0; i < MAXOFFLINEVOLUMES; i++) {
if (p[i].volumeID) {
Volume *vp;
p[i].volumeID = 0;
}
}
- VOL_UNLOCK VATTACH_UNLOCK RemoveHandler(fd);
+ VOL_UNLOCK;
+ VATTACH_UNLOCK;
+ RemoveHandler(fd);
#ifdef AFS_NT40_ENV
closesocket(fd);
#else
static
fstabscan()
{
- if(_fs_count <= 0)
- return(0);
- _fs_fstab.fs_spec = _fs_ptr->f_mntfromname;
- _fs_fstab.fs_file = _fs_ptr->f_mntonname;
- _fs_fstab.fs_vfstype = _fs_ptr->f_fstypename;
- _fs_fstab.fs_mntops = _fs_ptr->f_fstypename; // no mount options given
- _fs_fstab.fs_type = (_fs_ptr->f_flags & MNT_RDONLY) ? FSTAB_RO : FSTAB_RW;
- _fs_fstab.fs_freq = 0;
- _fs_fstab.fs_passno = 0;
-
- _fs_ptr++;
- _fs_count--;
- return(1);
+ if (_fs_count <= 0)
+ return (0);
+ _fs_fstab.fs_spec = _fs_ptr->f_mntfromname;
+ _fs_fstab.fs_file = _fs_ptr->f_mntonname;
+ _fs_fstab.fs_vfstype = _fs_ptr->f_fstypename;
+ _fs_fstab.fs_mntops = _fs_ptr->f_fstypename; // no mount options given
+ _fs_fstab.fs_type = (_fs_ptr->f_flags & MNT_RDONLY) ? FSTAB_RO : FSTAB_RW;
+ _fs_fstab.fs_freq = 0;
+ _fs_fstab.fs_passno = 0;
+
+ _fs_ptr++;
+ _fs_count--;
+ return (1);
}
struct fstab *
getfsent()
{
- if (!_fs_buf && !setfsent() || !fstabscan())
- return((struct fstab *)NULL);
- return(&_fs_fstab);
+ if (!_fs_buf && !setfsent() || !fstabscan())
+ return ((struct fstab *)NULL);
+ return (&_fs_fstab);
}
struct fstab *
getfsspec(name)
- register const char *name;
+ register const char *name;
{
- if (setfsent())
- while (fstabscan())
- if (!strcmp(_fs_fstab.fs_spec, name))
- return(&_fs_fstab);
- return((struct fstab *)NULL);
+ if (setfsent())
+ while (fstabscan())
+ if (!strcmp(_fs_fstab.fs_spec, name))
+ return (&_fs_fstab);
+ return ((struct fstab *)NULL);
}
struct fstab *
getfsfile(name)
- register const char *name;
+ register const char *name;
{
- if (setfsent())
- while (fstabscan())
- if (!strcmp(_fs_fstab.fs_file, name))
- return(&_fs_fstab);
- return((struct fstab *)NULL);
+ if (setfsent())
+ while (fstabscan())
+ if (!strcmp(_fs_fstab.fs_file, name))
+ return (&_fs_fstab);
+ return ((struct fstab *)NULL);
}
setfsent()
{
- long bufsize;
-
- if (_fs_buf) {
- free(_fs_buf);
- _fs_buf = NULL;
- }
- if((_fs_count = getfsstat(NULL, 0, MNT_WAIT)) < 0) {
- error(errno);
- return(0);
- }
- bufsize = (long)_fs_count * sizeof(struct statfs);
- if((_fs_buf = malloc(bufsize)) == NULL) {
- error(errno);
- return(0);
- }
- if(getfsstat(_fs_buf, bufsize, MNT_WAIT) < 0) {
- error(errno);
- return(0);
- }
- _fs_ptr = _fs_buf;
- return(1);
+ long bufsize;
+
+ if (_fs_buf) {
+ free(_fs_buf);
+ _fs_buf = NULL;
+ }
+ if ((_fs_count = getfsstat(NULL, 0, MNT_WAIT)) < 0) {
+ error(errno);
+ return (0);
+ }
+ bufsize = (long)_fs_count *sizeof(struct statfs);
+ if ((_fs_buf = malloc(bufsize)) == NULL) {
+ error(errno);
+ return (0);
+ }
+ if (getfsstat(_fs_buf, bufsize, MNT_WAIT) < 0) {
+ error(errno);
+ return (0);
+ }
+ _fs_ptr = _fs_buf;
+ return (1);
}
void
endfsent()
{
- if (_fs_buf) {
- free(_fs_buf);
- _fs_buf = NULL;
- }
- _fs_count = 0;
+ if (_fs_buf) {
+ free(_fs_buf);
+ _fs_buf = NULL;
+ }
+ _fs_count = 0;
}
static
error(err)
- int err;
+ int err;
{
- char *p;
-
- (void)write(STDERR_FILENO, "fstab: ", 7);
- (void)write(STDERR_FILENO, _PATH_FSTAB, sizeof(_PATH_FSTAB) - 1);
- (void)write(STDERR_FILENO, ": ", 1);
- p = strerror(err);
- (void)write(STDERR_FILENO, p, strlen(p));
- (void)write(STDERR_FILENO, "\n", 1);
+ char *p;
+
+ (void)write(STDERR_FILENO, "fstab: ", 7);
+ (void)write(STDERR_FILENO, _PATH_FSTAB, sizeof(_PATH_FSTAB) - 1);
+ (void)write(STDERR_FILENO, ": ", 1);
+ p = strerror(err);
+ (void)write(STDERR_FILENO, p, strlen(p));
+ (void)write(STDERR_FILENO, "\n", 1);
}
#endif /* defined(AFS_DARWIN_ENV) */
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/vol/ihandle.c,v 1.18 2003/12/09 19:58:28 shadow Exp $");
+ ("$Header: /cvs/openafs/src/vol/ihandle.c,v 1.18.2.1 2004/08/25 07:14:19 shadow Exp $");
#include <stdio.h>
#include <sys/types.h>
DLL_DELETE(fdP, fdLruHead, fdLruTail, fd_next, fd_prev);
ihP->ih_refcnt++;
IH_UNLOCK;
- (void) FDH_SEEK(fdP, 0, SEEK_SET);
+ (void)FDH_SEEK(fdP, 0, SEEK_SET);
return fdP;
}
}
extern void ih_glock_init(void);
#define IH_LOCK \
assert(pthread_once(&ih_glock_once, ih_glock_init) == 0 && \
- pthread_mutex_lock(&ih_glock_mutex) == 0);
+ pthread_mutex_lock(&ih_glock_mutex) == 0)
#define IH_UNLOCK \
- assert(pthread_mutex_unlock(&ih_glock_mutex) == 0);
+ assert(pthread_mutex_unlock(&ih_glock_mutex) == 0)
#else /* AFS_PTHREAD_ENV */
#define IH_LOCK
#define IH_UNLOCK
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/vol/namei_ops.c,v 1.21 2003/11/24 03:51:24 shadow Exp $");
+ ("$Header: /cvs/openafs/src/vol/namei_ops.c,v 1.21.2.1 2004/08/25 07:14:19 shadow Exp $");
#ifdef AFS_NAMEI_ENV
#include <stdio.h>
if (count == 0) {
IHandle_t *th;
IH_INIT(th, ih->ih_dev, ih->ih_vid, ino);
-#if 0
+#if 0
/* This triggers in the fileserver on the volume index vnodes */
- if (th->ih_refcnt > 1)
- Log("Warning: Leaked ref on ihandle dev %d vid %d ino %lld\n",
+ if (th->ih_refcnt > 1)
+ Log("Warning: Leaked ref on ihandle dev %d vid %d ino %lld\n",
th->ih_dev, th->ih_vid, (int64_t) th->ih_ino);
#endif
- namei_HandleToName(&name, th);
- IH_RELEASE(th);
+ namei_HandleToName(&name, th);
+ IH_RELEASE(th);
code = unlink(name.n_path);
}
FDH_CLOSE(fdP);
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/vol/nuke.c,v 1.13 2003/11/23 04:53:43 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/vol/nuke.c,v 1.13.2.1 2004/08/25 07:14:19 shadow Exp $");
#include <rx/xdr.h>
#include <afs/afsint.h>
*lastDevComp = toupper(*lastDevComp);
#else
{
- char *tfile = vol_DevName(tstat.st_dev, wpath);
- if (!tfile) {
- printf("volnuke: can't find %s's device.\n", aname);
- return 1;
- }
- strcpy(devName, tfile); /* save this from the static buffer */
+ char *tfile = vol_DevName(tstat.st_dev, wpath);
+ if (!tfile) {
+ printf("volnuke: can't find %s's device.\n", aname);
+ return 1;
+ }
+ strcpy(devName, tfile); /* save this from the static buffer */
}
/* aim lastDevComp at the 'foo' of '/dev/foo' */
lastDevComp = strrchr(devName, '/');
}
#else /* AFS_NAMEI_ENV */
IH_INIT(fileH, (int)tstat.st_dev, avolid, ti->inode[i]);
- {
- int j;
- for (j = 0; j < ti->count[i]; j++) {
- code = IH_DEC(fileH, ti->inode[i], avolid);
- }
- }
+ {
+ int j;
+ for (j = 0; j < ti->count[i]; j++) {
+ code = IH_DEC(fileH, ti->inode[i], avolid);
+ }
+ }
IH_RELEASE(fileH);
#endif /* AFS_NAMEI_ENV */
}
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/vol/partition.c,v 1.30 2004/08/08 23:59:51 shadow Exp $");
+ ("$Header: /cvs/openafs/src/vol/partition.c,v 1.30.2.1 2004/08/25 07:14:19 shadow Exp $");
#include <ctype.h>
#ifdef AFS_NT40_ENV
static void
VInitPartition(char *path, char *devname, Device dev)
{
- VOL_LOCK VInitPartition_r(path, devname, dev);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VInitPartition_r(path, devname, dev);
+ VOL_UNLOCK;
+}
#ifndef AFS_NT40_ENV
/* VAttachPartitions() finds the vice partitions on this server. Calls
VGetPartition(char *name, int abortp)
{
struct DiskPartition *retVal;
- VOL_LOCK retVal = VGetPartition_r(name, abortp);
- VOL_UNLOCK return retVal;
+ VOL_LOCK;
+ retVal = VGetPartition_r(name, abortp);
+ VOL_UNLOCK;
+ return retVal;
}
#ifdef AFS_NT40_ENV
void
VSetPartitionDiskUsage(register struct DiskPartition *dp)
{
- VOL_LOCK VSetPartitionDiskUsage_r(dp);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VSetPartitionDiskUsage_r(dp);
+ VOL_UNLOCK;
+}
void
VResetDiskUsage_r(void)
void
VResetDiskUsage(void)
{
- VOL_LOCK VResetDiskUsage_r();
-VOL_UNLOCK}
+ VOL_LOCK;
+ VResetDiskUsage_r();
+ VOL_UNLOCK;
+}
void
VAdjustDiskUsage_r(Error * ec, Volume * vp, afs_sfsize_t blocks,
VAdjustDiskUsage(Error * ec, Volume * vp, afs_sfsize_t blocks,
afs_sfsize_t checkBlocks)
{
- VOL_LOCK VAdjustDiskUsage_r(ec, vp, blocks, checkBlocks);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VAdjustDiskUsage_r(ec, vp, blocks, checkBlocks);
+ VOL_UNLOCK;
+}
int
VDiskUsage_r(Volume * vp, afs_sfsize_t blocks)
VDiskUsage(Volume * vp, afs_sfsize_t blocks)
{
int retVal;
- VOL_LOCK retVal = VDiskUsage_r(vp, blocks);
- VOL_UNLOCK return retVal;
+ VOL_LOCK;
+ retVal = VDiskUsage_r(vp, blocks);
+ VOL_UNLOCK;
+ return retVal;
}
void
void
VPrintDiskStats(void)
{
- VOL_LOCK VPrintDiskStats_r();
-VOL_UNLOCK}
+ VOL_LOCK;
+ VPrintDiskStats_r();
+ VOL_UNLOCK;
+}
#ifdef AFS_NT40_ENV
/* Need a separate lock file on NT, since NT only has mandatory file locks. */
void
VLockPartition(char *name)
{
- VOL_LOCK VLockPartition_r(name);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VLockPartition_r(name);
+ VOL_UNLOCK;
+}
void
VUnlockPartition(char *name)
{
- VOL_LOCK VUnlockPartition_r(name);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VUnlockPartition_r(name);
+ VOL_UNLOCK;
+}
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/vol/purge.c,v 1.9 2003/07/15 23:17:40 shadow Exp $");
+ ("$Header: /cvs/openafs/src/vol/purge.c,v 1.9.2.1 2004/08/25 07:14:19 shadow Exp $");
#include <stdio.h>
#ifdef AFS_NT40_ENV
void
VPurgeVolume(Error * ec, Volume * vp)
{
- VOL_LOCK VPurgeVolume_r(ec, vp);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VPurgeVolume_r(ec, vp);
+ VOL_UNLOCK;
+}
#define MAXOBLITATONCE 200
/* delete a portion of an index, adjusting offset appropriately. Returns 0 if
void
PurgeIndex(Volume * vp, VnodeClass class)
{
- VOL_LOCK PurgeIndex_r(vp, class);
-VOL_UNLOCK}
+ VOL_LOCK;
+ PurgeIndex_r(vp, class);
+ VOL_UNLOCK;
+}
void
PurgeIndex_r(Volume * vp, VnodeClass class)
void
PurgeHeader(Volume * vp)
{
- VOL_LOCK PurgeHeader_r(vp);
-VOL_UNLOCK}
+ VOL_LOCK;
+ PurgeHeader_r(vp);
+ VOL_UNLOCK;
+}
void
PurgeHeader_r(Volume * vp)
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/vol/vnode.c,v 1.19 2004/06/23 14:27:48 shadow Exp $");
+ ("$Header: /cvs/openafs/src/vol/vnode.c,v 1.19.2.1 2004/08/25 07:14:19 shadow Exp $");
#include <errno.h>
#include <stdio.h>
VAllocVnode(Error * ec, Volume * vp, VnodeType type)
{
Vnode *retVal;
- VOL_LOCK retVal = VAllocVnode_r(ec, vp, type);
- VOL_UNLOCK return retVal;
+ VOL_LOCK;
+ retVal = VAllocVnode_r(ec, vp, type);
+ VOL_UNLOCK;
+ return retVal;
}
Vnode *
ObtainWriteLock(&vnp->lock);
} else {
/* follow locking hierarchy */
- VOL_UNLOCK ObtainWriteLock(&vnp->lock);
- VOL_LOCK}
+ VOL_UNLOCK;
+ ObtainWriteLock(&vnp->lock);
+ VOL_LOCK;
+ }
#ifdef AFS_PTHREAD_ENV
vnp->writer = pthread_self();
#else /* AFS_PTHREAD_ENV */
FdHandle_t *fdP;
off_t off = vnodeIndexOffset(vcp, vnodeNumber);
- VOL_UNLOCK fdP = IH_OPEN(ihP);
+ VOL_UNLOCK;
+ fdP = IH_OPEN(ihP);
if (fdP == NULL)
Abort("VAllocVnode: can't open index file!\n");
if ((size = FDH_SIZE(fdP)) < 0)
free(buf);
}
FDH_CLOSE(fdP);
- VOL_LOCK}
+ VOL_LOCK;
+ }
VNLog(4, 2, vnodeNumber, (afs_int32) vnp);
}
VGetVnode(Error * ec, Volume * vp, VnodeId vnodeNumber, int locktype)
{ /* READ_LOCK or WRITE_LOCK, as defined in lock.h */
Vnode *retVal;
- VOL_LOCK retVal = VGetVnode_r(ec, vp, vnodeNumber, locktype);
- VOL_UNLOCK return retVal;
+ VOL_LOCK;
+ retVal = VGetVnode_r(ec, vp, vnodeNumber, locktype);
+ VOL_UNLOCK;
+ return retVal;
}
Vnode *
#endif /* AFS_PTHREAD_ENV */
/* Read vnode from volume index */
- VOL_UNLOCK fdP = IH_OPEN(ihP);
+ VOL_UNLOCK;
+ fdP = IH_OPEN(ihP);
if (fdP == NULL) {
Log("VGetVnode: can't open index dev=%u, i=%s\n", vp->device,
PrintInode(NULL, vp->vnodeIndex[class].handle->ih_ino));
/* Don't take volume off line if the inumber is out of range
* or the inode table is full. */
FDH_REALLYCLOSE(fdP);
- VOL_LOCK if (n == BAD_IGET) {
+ VOL_LOCK;
+ if (n == BAD_IGET) {
Log("VGetVnode: bad inumber %s\n",
PrintInode(NULL, vp->vnodeIndex[class].handle->ih_ino));
*ec = VIO;
return NULL;
}
FDH_CLOSE(fdP);
- VOL_LOCK
- /* Quick check to see that the data is reasonable */
- if (vnp->disk.vnodeMagic != vcp->magic || vnp->disk.type == vNull) {
+ VOL_LOCK;
+ /* Quick check to see that the data is reasonable */
+ if (vnp->disk.vnodeMagic != vcp->magic || vnp->disk.type == vNull) {
if (vnp->disk.type == vNull) {
*ec = VNOVNODE;
mlkReason = 6;
vnp->lruNext->lruPrev = vnp->lruPrev;
}
}
- VOL_UNLOCK if (locktype == READ_LOCK)
+ VOL_UNLOCK;
+ if (locktype == READ_LOCK)
ObtainReadLock(&vnp->lock);
else {
ObtainWriteLock(&vnp->lock);
LWP_CurrentProcess(&vnp->writer);
#endif /* AFS_PTHREAD_ENV */
}
- VOL_LOCK
- /* Check that the vnode hasn't been removed while we were obtaining
- * the lock */
- VNLog(102, 2, vnodeNumber, (afs_int32) vnp);
+ VOL_LOCK;
+ /* Check that the vnode hasn't been removed while we were obtaining
+ * the lock */
+ VNLog(102, 2, vnodeNumber, (afs_int32) vnp);
if ((vnp->disk.type == vNull) || (vnp->cacheCheck == 0)) {
if (vnp->nUsers-- == 1)
StickOnLruChain_r(vnp, vcp);
void
VPutVnode(Error * ec, register Vnode * vnp)
{
- VOL_LOCK VPutVnode_r(ec, vnp);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VPutVnode_r(ec, vnp);
+ VOL_UNLOCK;
+}
void
VPutVnode_r(Error * ec, register Vnode * vnp)
} else {
IHandle_t *ihP = vp->vnodeIndex[class].handle;
FdHandle_t *fdP;
- VOL_UNLOCK fdP = IH_OPEN(ihP);
+ VOL_UNLOCK;
+ fdP = IH_OPEN(ihP);
if (fdP == NULL)
Abort("VPutVnode: can't open index file!\n");
offset = vnodeIndexOffset(vcp, vnp->vnodeNumber);
/* Don't force volume offline if the inumber is out of
* range or the inode table is full.
*/
- VOL_LOCK if (code == BAD_IGET) {
+ VOL_LOCK;
+ if (code == BAD_IGET) {
Log("VPutVnode: bad inumber %s\n",
PrintInode(NULL,
vp->vnodeIndex[class].handle->ih_ino));
VForceOffline_r(vp);
*ec = VSALVAGE;
}
- VOL_UNLOCK FDH_REALLYCLOSE(fdP);
+ VOL_UNLOCK;
+ FDH_REALLYCLOSE(fdP);
} else {
FDH_CLOSE(fdP);
}
- VOL_LOCK
- /* If the vnode is to be deleted, and we wrote the vnode out,
- * free its bitmap entry. Do after the vnode is written so we
- * don't allocate from bitmap before the vnode is written
- * (doing so could cause a "addled bitmap" message).
- */
- if (vnp->delete && !*ec) {
+ VOL_LOCK;
+ /* If the vnode is to be deleted, and we wrote the vnode out,
+ * free its bitmap entry. Do after the vnode is written so we
+ * don't allocate from bitmap before the vnode is written
+ * (doing so could cause a "addled bitmap" message).
+ */
+ if (vnp->delete && !*ec) {
VFreeBitMapEntry_r(ec, &vp->vnodeIndex[class],
vnodeIdToBitNumber(vnp->vnodeNumber));
}
VVnodeWriteToRead(Error * ec, register Vnode * vnp)
{
int retVal;
- VOL_LOCK retVal = VVnodeWriteToRead_r(ec, vnp);
- VOL_UNLOCK return retVal;
+ VOL_LOCK;
+ retVal = VVnodeWriteToRead_r(ec, vnp);
+ VOL_UNLOCK;
+ return retVal;
}
int
changed_oldTime) << 1) | vnp->
delete);
if (thisProcess != vnp->writer)
- Abort("VPutVnode: Vnode at 0x%x locked by another process!\n", (int)vnp);
+ Abort("VPutVnode: Vnode at 0x%x locked by another process!\n",
+ (int)vnp);
if (vnp->delete) {
return 0;
}
IHandle_t *ihP = vp->vnodeIndex[class].handle;
FdHandle_t *fdP;
off_t off = vnodeIndexOffset(vcp, vnp->vnodeNumber);
- VOL_UNLOCK fdP = IH_OPEN(ihP);
+ VOL_UNLOCK;
+ fdP = IH_OPEN(ihP);
if (fdP == NULL)
Abort("VPutVnode: can't open index file!\n");
code = FDH_SEEK(fdP, off, SEEK_SET);
* Don't force volume offline if the inumber is out of
* range or the inode table is full.
*/
- VOL_LOCK if (code == BAD_IGET) {
+ VOL_LOCK;
+ if (code == BAD_IGET) {
Log("VPutVnode: bad inumber %s\n",
- PrintInode(NULL, vp->vnodeIndex[class].handle->ih_ino));
+ PrintInode(NULL,
+ vp->vnodeIndex[class].handle->ih_ino));
*ec = VIO;
} else {
Log("VPutVnode: Couldn't write vnode %u, volume %u (%s)\n", vnp->vnodeNumber, V_id(vnp->volumePtr), V_name(vnp->volumePtr));
VForceOffline_r(vp);
*ec = VSALVAGE;
}
- VOL_UNLOCK}
+ VOL_UNLOCK;
+ }
FDH_CLOSE(fdP);
- VOL_LOCK}
+ VOL_LOCK;
+ }
vcp->writes++;
vnp->changed_newTime = vnp->changed_oldTime = 0;
}
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/vol/vol-info.c,v 1.18 2004/06/23 14:27:48 shadow Exp $");
+ ("$Header: /cvs/openafs/src/vol/vol-info.c,v 1.18.2.1 2004/08/25 07:14:19 shadow Exp $");
#include <ctype.h>
#include <errno.h>
if (saveinodes)
printf
("Volume-Id\t Volsize Auxsize Inodesize AVolsize SizeDiff (VolName)\n");
- printf("%u\t%9d%9d%10d%10d%9d\t%24s\n", V_id(vp), Vdiskused, Vauxsize_k,
- Vvnodesize_k, totvolsize, totvolsize - Vdiskused, V_name(vp));
+ printf("%u\t%9d%9d%10d%10d%9d\t%24s\n", V_id(vp), Vdiskused,
+ Vauxsize_k, Vvnodesize_k, totvolsize, totvolsize - Vdiskused,
+ V_name(vp));
}
}
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/vol/vol-salvage.c,v 1.41 2004/05/15 06:11:40 shadow Exp $");
+ ("$Header: /cvs/openafs/src/vol/vol-salvage.c,v 1.41.2.1 2004/08/25 07:14:19 shadow Exp $");
#include <stdlib.h>
#include <stdio.h>
#ifdef FAST_RESTART
{
- afs_int32 i;
- for (i = 0; i < CMD_MAXPARMS; i++) {
- if (as->parms[i].items) {
- seenany = 1;
- break;
+ afs_int32 i;
+ for (i = 0; i < CMD_MAXPARMS; i++) {
+ if (as->parms[i].items) {
+ seenany = 1;
+ break;
+ }
}
}
- }
if (!seenany) {
char *msg =
"Exiting immediately without salvage. Look into the FileLog to find volumes which really need to be salvaged!";
GetVolumeSummary(singleVolumeNumber);
- for (i = 0,vsp = volumeSummaryp; i < nVolumes; i++) {
+ for (i = 0, vsp = volumeSummaryp; i < nVolumes; i++) {
if (vsp->fileName)
DeleteExtraVolumeHeaderFile(vsp);
}
if (dirOrphaned) {
Log("dir vnode %u: %s/%s parent vnode is %u (vnode %u, unique %u) -- %sdeleted\n", dir->vnodeNumber, (dir->name ? dir->name : "??"), name, vnodeEssence->parent, vnodeNumber, unique, (Testing ? "would have been " : ""));
} else if (vnodeNumber == 1) {
- Log("dir vnode %d: %s/%s is invalid (vnode %d, unique %d) -- %sdeleted\n", dir->vnodeNumber, (dir->name ? dir->name : "??"), name, vnodeNumber, unique, (Testing?"would have been ":""));
+ Log("dir vnode %d: %s/%s is invalid (vnode %d, unique %d) -- %sdeleted\n", dir->vnodeNumber, (dir->name ? dir->name : "??"), name, vnodeNumber, unique, (Testing ? "would have been " : ""));
} else {
Log("dir vnode %u: %s/%s already claimed by directory vnode %u (vnode %u, unique %u) -- %sdeleted\n", dir->vnodeNumber, (dir->name ? dir->name : "??"), name, vnodeEssence->parent, vnodeNumber, unique, (Testing ? "would have been " : ""));
}
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/vol/volume.c,v 1.35 2004/04/18 06:13:54 kolya Exp $");
+ ("$Header: /cvs/openafs/src/vol/volume.c,v 1.35.2.1 2004/08/25 07:14:19 shadow Exp $");
#include <rx/xdr.h>
#include <afs/afsint.h>
VConnectFS(void)
{
int retVal;
- VOL_LOCK retVal = VConnectFS_r();
- VOL_UNLOCK return retVal;
+ VOL_LOCK;
+ retVal = VConnectFS_r();
+ VOL_UNLOCK;
+ return retVal;
}
int
void
VDisconnectFS(void)
{
- VOL_LOCK VDisconnectFS_r();
-VOL_UNLOCK}
+ VOL_LOCK;
+ VDisconnectFS_r();
+ VOL_UNLOCK;
+}
void
VShutdown_r(void)
void
VShutdown(void)
{
- VOL_LOCK VShutdown_r();
-VOL_UNLOCK}
+ VOL_LOCK;
+ VShutdown_r();
+ VOL_UNLOCK;
+}
static void
VAttachVolumeByName(Error * ec, char *partition, char *name, int mode)
{
Volume *retVal;
- VATTACH_LOCK VOL_LOCK retVal =
- VAttachVolumeByName_r(ec, partition, name, mode);
- VOL_UNLOCK VATTACH_UNLOCK return retVal;
+ VATTACH_LOCK;
+ VOL_LOCK;
+ retVal = VAttachVolumeByName_r(ec, partition, name, mode);
+ VOL_UNLOCK;
+ VATTACH_UNLOCK;
+ return retVal;
}
Volume *
strcpy(path, VPartitionPath(partp));
strcat(path, "/");
strcat(path, name);
- VOL_UNLOCK if ((fd = afs_open(path, O_RDONLY)) == -1
- || afs_fstat(fd, &status) == -1) {
+ VOL_UNLOCK;
+ if ((fd = afs_open(path, O_RDONLY)) == -1 || afs_fstat(fd, &status) == -1) {
Log("VAttachVolume: Failed to open %s (errno %d)\n", path, errno);
if (fd > -1)
close(fd);
- VOL_LOCK *ec = VNOVOL;
+ VOL_LOCK;
+ *ec = VNOVOL;
goto done;
}
n = read(fd, &diskHeader, sizeof(diskHeader));
close(fd);
- VOL_LOCK if (n != sizeof(diskHeader)
- || diskHeader.stamp.magic != VOLUMEHEADERMAGIC) {
+ VOL_LOCK;
+ if (n != sizeof(diskHeader)
+ || diskHeader.stamp.magic != VOLUMEHEADERMAGIC) {
Log("VAttachVolume: Error reading volume header %s\n", path);
*ec = VSALVAGE;
goto done;
{
register Volume *vp;
- VOL_UNLOCK vp = (Volume *) calloc(1, sizeof(Volume));
+ VOL_UNLOCK;
+ vp = (Volume *) calloc(1, sizeof(Volume));
assert(vp != NULL);
vp->specialStatus = (byte) (isbusy ? VBUSY : 0);
vp->device = partp->device;
vp->shuttingDown = 0;
vp->goingOffline = 0;
vp->nUsers = 1;
- VOL_LOCK GetVolumeHeader(vp);
- VOL_UNLOCK(void) ReadHeader(ec, V_diskDataHandle(vp), (char *)&V_disk(vp),
- sizeof(V_disk(vp)), VOLUMEINFOMAGIC,
- VOLUMEINFOVERSION);
- VOL_LOCK if (*ec) {
+ VOL_LOCK;
+ GetVolumeHeader(vp);
+ VOL_UNLOCK;
+ (void)ReadHeader(ec, V_diskDataHandle(vp), (char *)&V_disk(vp),
+ sizeof(V_disk(vp)), VOLUMEINFOMAGIC, VOLUMEINFOVERSION);
+ VOL_LOCK;
+ if (*ec) {
Log("VAttachVolume: Error reading diskDataHandle vol header %s; error=%u\n", path, *ec);
}
if (!*ec) {
V_stat_initialized(vp) = 1;
}
#endif /* OPENAFS_VOL_STATS */
- VOL_UNLOCK(void) ReadHeader(ec, vp->vnodeIndex[vSmall].handle,
- (char *)&iHead, sizeof(iHead),
- SMALLINDEXMAGIC, SMALLINDEXVERSION);
- VOL_LOCK if (*ec) {
+ VOL_UNLOCK;
+ (void)ReadHeader(ec, vp->vnodeIndex[vSmall].handle,
+ (char *)&iHead, sizeof(iHead),
+ SMALLINDEXMAGIC, SMALLINDEXVERSION);
+ VOL_LOCK;
+ if (*ec) {
Log("VAttachVolume: Error reading smallVnode vol header %s; error=%u\n", path, *ec);
}
}
if (!*ec) {
struct IndexFileHeader iHead;
- VOL_UNLOCK(void) ReadHeader(ec, vp->vnodeIndex[vLarge].handle,
- (char *)&iHead, sizeof(iHead),
- LARGEINDEXMAGIC, LARGEINDEXVERSION);
- VOL_LOCK if (*ec) {
+ VOL_UNLOCK;
+ (void)ReadHeader(ec, vp->vnodeIndex[vLarge].handle,
+ (char *)&iHead, sizeof(iHead),
+ LARGEINDEXMAGIC, LARGEINDEXVERSION);
+ VOL_LOCK;
+ if (*ec) {
Log("VAttachVolume: Error reading largeVnode vol header %s; error=%u\n", path, *ec);
}
}
#ifdef AFS_NAMEI_ENV
if (!*ec) {
struct versionStamp stamp;
- VOL_UNLOCK(void) ReadHeader(ec, V_linkHandle(vp), (char *)&stamp,
- sizeof(stamp), LINKTABLEMAGIC,
- LINKTABLEVERSION);
- VOL_LOCK if (*ec) {
+ VOL_UNLOCK;
+ (void)ReadHeader(ec, V_linkHandle(vp), (char *)&stamp,
+ sizeof(stamp), LINKTABLEMAGIC, LINKTABLEVERSION);
+ VOL_LOCK;
+ if (*ec) {
Log("VAttachVolume: Error reading namei vol header %s; error=%u\n", path, *ec);
}
}
if (programType == fileServer && VolumeWriteable(vp)) {
int i;
for (i = 0; i < nVNODECLASSES; i++) {
- VOL_UNLOCK GetBitmap(ec, vp, i);
- VOL_LOCK if (*ec) {
+ VOL_UNLOCK;
+ GetBitmap(ec, vp, i);
+ VOL_LOCK;
+ if (*ec) {
FreeVolume(vp);
Log("VAttachVolume: error getting bitmap for volume (%s)\n",
path);
VAttachVolume(Error * ec, VolumeId volumeId, int mode)
{
Volume *retVal;
- VATTACH_LOCK VOL_LOCK retVal = VAttachVolume_r(ec, volumeId, mode);
- VOL_UNLOCK VATTACH_UNLOCK return retVal;
+ VATTACH_LOCK;
+ VOL_LOCK;
+ retVal = VAttachVolume_r(ec, volumeId, mode);
+ VOL_UNLOCK;
+ VATTACH_UNLOCK;
+ return retVal;
}
Volume *
VHold(register Volume * vp)
{
int retVal;
- VOL_LOCK retVal = VHold_r(vp);
- VOL_UNLOCK return retVal;
+ VOL_LOCK;
+ retVal = VHold_r(vp);
+ VOL_UNLOCK;
+ return retVal;
}
void
void
VTakeOffline(register Volume * vp)
{
- VOL_LOCK VTakeOffline_r(vp);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VTakeOffline_r(vp);
+ VOL_UNLOCK;
+}
void
VPutVolume_r(register Volume * vp)
void
VPutVolume(register Volume * vp)
{
- VOL_LOCK VPutVolume_r(vp);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VPutVolume_r(vp);
+ VOL_UNLOCK;
+}
/* Get a pointer to an attached volume. The pointer is returned regardless
of whether or not the volume is in service or on/off line. An error
VGetVolume(Error * ec, VolId volumeId)
{
Volume *retVal;
- VOL_LOCK retVal = VGetVolume_r(ec, volumeId);
- VOL_UNLOCK return retVal;
+ VOL_LOCK;
+ retVal = VGetVolume_r(ec, volumeId);
+ VOL_UNLOCK;
+ return retVal;
}
Volume *
void
VForceOffline(Volume * vp)
{
- VOL_LOCK VForceOffline_r(vp);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VForceOffline_r(vp);
+ VOL_UNLOCK;
+}
/* The opposite of VAttachVolume. The volume header is written to disk, with
the inUse bit turned off. A copy of the header is maintained in memory,
void
VOffline(Volume * vp, char *message)
{
- VOL_LOCK VOffline_r(vp, message);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VOffline_r(vp, message);
+ VOL_UNLOCK;
+}
/* For VDetachVolume, we close all cached file descriptors, but keep
* the Inode handles in case we need to read from a busy volume.
void
VDetachVolume(Error * ec, Volume * vp)
{
- VOL_LOCK VDetachVolume_r(ec, vp);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VDetachVolume_r(ec, vp);
+ VOL_UNLOCK;
+}
VnodeId
* from AddNewReadableResidency */
wasVBUSY = 1;
} else {
- VOL_UNLOCK while (vp->specialStatus == VBUSY)
+ VOL_UNLOCK;
+ while (vp->specialStatus == VBUSY)
#ifdef AFS_PTHREAD_ENV
sleep(2);
#else /* AFS_PTHREAD_ENV */
IOMGR_Sleep(2);
#endif /* AFS_PTHREAD_ENV */
- VOL_LOCK}
+ VOL_LOCK;
+ }
}
if (!index->bitmap) {
vp->specialStatus = VBUSY; /* Stop anyone else from using it. */
for (i = 0; i < nVNODECLASSES; i++) {
- VOL_UNLOCK GetBitmap(ec, vp, i);
- VOL_LOCK if (*ec) {
+ VOL_UNLOCK;
+ GetBitmap(ec, vp, i);
+ VOL_LOCK;
+ if (*ec) {
vp->specialStatus = 0;
vp->shuttingDown = 1; /* Let who has it free it. */
return NULL;
VAllocBitmapEntry(Error * ec, Volume * vp, register struct vnodeIndex * index)
{
VnodeId retVal;
- VOL_LOCK retVal = VAllocBitmapEntry_r(ec, vp, index);
- VOL_UNLOCK return retVal;
+ VOL_LOCK;
+ retVal = VAllocBitmapEntry_r(ec, vp, index);
+ VOL_UNLOCK;
+ return retVal;
}
void
VFreeBitMapEntry(Error * ec, register struct vnodeIndex *index,
unsigned bitNumber)
{
- VOL_LOCK VFreeBitMapEntry_r(ec, index, bitNumber);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VFreeBitMapEntry_r(ec, index, bitNumber);
+ VOL_UNLOCK;
+}
void
VUpdateVolume_r(Error * ec, Volume * vp)
void
VUpdateVolume(Error * ec, Volume * vp)
{
- VOL_LOCK VUpdateVolume_r(ec, vp);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VUpdateVolume_r(ec, vp);
+ VOL_UNLOCK;
+}
void
VSyncVolume_r(Error * ec, Volume * vp)
void
VSyncVolume(Error * ec, Volume * vp)
{
- VOL_LOCK VSyncVolume_r(ec, vp);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VSyncVolume_r(ec, vp);
+ VOL_UNLOCK;
+}
static void
FreeVolume(Volume * vp)
VAdjustVolumeStatistics(register Volume * vp)
{
int retVal;
- VOL_LOCK retVal = VAdjustVolumeStatistics_r(vp);
- VOL_UNLOCK return retVal;
+ VOL_LOCK;
+ retVal = VAdjustVolumeStatistics_r(vp);
+ VOL_UNLOCK;
+ return retVal;
}
void
void
VBumpVolumeUsage(register Volume * vp)
{
- VOL_LOCK VBumpVolumeUsage_r(vp);
-VOL_UNLOCK}
+ VOL_LOCK;
+ VBumpVolumeUsage_r(vp);
+ VOL_UNLOCK;
+}
void
VSetDiskUsage_r(void)
void
VSetDiskUsage(void)
{
- VOL_LOCK VSetDiskUsage_r();
-VOL_UNLOCK}
+ VOL_LOCK;
+ VSetDiskUsage_r();
+ VOL_UNLOCK;
+}
/* The number of minutes that a volume hasn't been updated before the
* "Dont salvage" flag in the volume header will be turned on */
void
VPrintCacheStats(void)
{
- VOL_LOCK VPrintCacheStats_r();
-VOL_UNLOCK}
+ VOL_LOCK;
+ VPrintCacheStats_r();
+ VOL_UNLOCK;
+}
extern pthread_cond_t vol_put_volume_cond;
extern pthread_cond_t vol_sleep_cond;
#define VATTACH_LOCK \
- assert(pthread_mutex_lock(&vol_attach_mutex) == 0);
+ assert(pthread_mutex_lock(&vol_attach_mutex) == 0)
#define VATTACH_UNLOCK \
- assert(pthread_mutex_unlock(&vol_attach_mutex) == 0);
+ assert(pthread_mutex_unlock(&vol_attach_mutex) == 0)
#define VOL_LOCK \
- assert(pthread_mutex_lock(&vol_glock_mutex) == 0);
+ assert(pthread_mutex_lock(&vol_glock_mutex) == 0)
#define VOL_UNLOCK \
- assert(pthread_mutex_unlock(&vol_glock_mutex) == 0);
+ assert(pthread_mutex_unlock(&vol_glock_mutex) == 0)
#define VFSYNC_LOCK \
- assert(pthread_mutex_lock(&vol_fsync_mutex) == 0);
+ assert(pthread_mutex_lock(&vol_fsync_mutex) == 0)
#define VFSYNC_UNLOCK \
- assert(pthread_mutex_unlock(&vol_fsync_mutex) == 0);
+ assert(pthread_mutex_unlock(&vol_fsync_mutex) == 0)
#define VTRANS_LOCK \
- assert(pthread_mutex_lock(&vol_trans_mutex) == 0);
+ assert(pthread_mutex_lock(&vol_trans_mutex) == 0)
#define VTRANS_UNLOCK \
- assert(pthread_mutex_unlock(&vol_trans_mutex) == 0);
+ assert(pthread_mutex_unlock(&vol_trans_mutex) == 0)
#else /* AFS_PTHREAD_ENV */
#define VATTACH_LOCK
#define VATTACH_UNLOCK
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/vol/vutil.c,v 1.15 2003/11/29 21:38:05 jaltman Exp $");
+ ("$Header: /cvs/openafs/src/vol/vutil.c,v 1.15.2.1 2004/08/25 07:14:19 shadow Exp $");
#include <stdio.h>
#include <sys/types.h>
{ /* Should be the same as volumeId if there is
* no parent */
Volume *retVal;
- VOL_LOCK retVal = VCreateVolume_r(ec, partname, volumeId, parentId);
- VOL_UNLOCK return retVal;
+ VOL_LOCK;
+ retVal = VCreateVolume_r(ec, partname, volumeId, parentId);
+ VOL_UNLOCK;
+ return retVal;
}
Volume *
void
AssignVolumeName(register VolumeDiskData * vol, char *name, char *ext)
{
- VOL_LOCK AssignVolumeName_r(vol, name, ext);
-VOL_UNLOCK}
+ VOL_LOCK;
+ AssignVolumeName_r(vol, name, ext);
+ VOL_UNLOCK;
+}
void
AssignVolumeName_r(register VolumeDiskData * vol, char *name, char *ext)
{
afs_int32 code;
- VOL_LOCK code = CopyVolumeHeader_r(from, to);
- VOL_UNLOCK return (code);
+ VOL_LOCK;
+ code = CopyVolumeHeader_r(from, to);
+ VOL_UNLOCK;
+ return (code);
}
void
ClearVolumeStats(register VolumeDiskData * vol)
{
- VOL_LOCK ClearVolumeStats_r(vol);
-VOL_UNLOCK}
+ VOL_LOCK;
+ ClearVolumeStats_r(vol);
+ VOL_UNLOCK;
+}
void
ClearVolumeStats_r(register VolumeDiskData * vol)
#include <afs/param.h>
RCSID
- ("$Header: /cvs/openafs/src/volser/vos.c,v 1.40 2004/07/29 18:51:20 shadow Exp $");
+ ("$Header: /cvs/openafs/src/volser/vos.c,v 1.40.2.1 2004/08/17 04:28:45 jaltman Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
SyncVldb(as)
register struct cmd_syndesc *as;
{
- afs_int32 pnum, code; /* part name */
+ afs_int32 pnum = 0, code; /* part name */
char part[10];
int flags = 0;
char *volname = 0;