which included commits to RCS files with non-trunk default branches.
-OpenAFS News -- history of user-visible changes. October 13, 2001
+OpenAFS News -- history of user-visible changes. October 19, 2001
+
+* Changes incorporated in OpenAFS 1.2.3
+
+** Cell aliases for dynroot can be specified in the CellAlias file in
+ /usr/vice/etc or /usr/local/etc/openafs, in format "realname alias",
+ one per line. They can also be managed at runtime with "fs newalias"
+ and "fs listaliases".
* Changes incorporated in OpenAFS 1.2.2
#undef INODE_SETATTR_NOT_VOID
#undef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
+#undef STRUCT_INODE_HAS_I_TRUNCATE_SEM
/* glue for RedHat kernel bug */
#undef ENABLE_REDHAT_BUILDSYS
[ --enable-tivoli-tsm Enable use of the Tivoli TSM API libraries for butc support],, enable_tivoli_tsm="no"
)
-AC_PROG_CC
-
dnl weird ass systems
AC_AIX
AC_ISC_POSIX
dnl Various compiler setup.
AC_C_INLINE
AC_C_CONST
+AC_PROG_CC
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
[LINUX_BUILD_VNODE_FROM_INODE(src/config,src/afs/LINUX)]
)
LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
+ LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM
+ LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
+ LINUX_FS_STRUCT_INODE_HAS_I_DEVICES
LINUX_INODE_SETATTR_RETURN_TYPE
LINUX_NEED_RHCONFIG
LINUX_WHICH_MODULES
if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then
AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK)
fi
+ if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then
+ AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM)
+ fi
:
fi
;;
AC_MSG_RESULT(hp_ux)
;;
*-irix*)
+ if test -d /usr/include/sys/SN/SN1; then
+ IRIX_BUILD_IP35="IP35"
+ fi
MKAFS_OSTYPE=IRIX
AC_MSG_RESULT(sgi)
;;
;;
powerpc-apple-darwin1.2*)
AFS_SYSNAME="ppc_darwin_12"
- DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist
- DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist
;;
powerpc-apple-darwin1.3*)
AFS_SYSNAME="ppc_darwin_13"
- DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist
- DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist
;;
powerpc-apple-darwin1.4*)
AFS_SYSNAME="ppc_darwin_14"
- DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist
- DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist
+ ;;
+ powerpc-apple-darwin5.1*)
+ AFS_SYSNAME="ppc_darwin_51"
;;
sparc-sun-solaris2.5*)
AFS_SYSNAME="sun4x_55"
AC_MSG_RESULT($AFS_SYSNAME)
fi
+case $AFS_SYSNAME in
+ *_darwin*)
+ DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist
+ DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist
+ ;;
+esac
if test "x${MKAFS_OSTYPE}" = "xIRIX"; then
echo Skipping library tests because they confuse Irix.
AC_SUBST(WITH_OBSOLETE)
AC_SUBST(WITH_INSECURE)
AC_SUBST(DARWIN_INFOFILE)
+AC_SUBST(IRIX_BUILD_IP35)
])
NTMAKELANG = nmake /nologo /f ntmakefile en_install
NTMAKE_HEADERS = nmake /nologo /f ntmakefile install_headers
NTMAKE_LIBUTILS = nmake /nologo /f ntmakefile install_libutils
+NTMAKE_OBJS = nmake /nologo /f ntmakefile install_objs
MKDIR = mkdir
OBJ = src
$(MKDIR) $(DESTDIR)
! ENDIF
-config:
+config: start
echo ***** $@
$(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) $(OBJ)\WINNT\install\Win9x
nmake /nologo /f NTMakefile isinstall
$(CD) ..\..\..\..
- eho **** End of Install Scripts
+ echo **** End of Install Scripts
media: Win9x
# Fake the version copy so clean will go through the complete cycle with undefines
clean: start
if not exist .\src\config\NTMakefile.version copy .\src\config\NTMakefile.version-NOCML .\src\config\NTMakefile.version
- nmake /nologo /f ntmake9x "NTMAKE = nmake /nologo /f ntmakefile clean" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile clean" "NTMAKE_LIBUTILS = nmake /nologo /f ntmakefile clean" install
+ nmake /nologo /f ntmake9x "NTMAKE = nmake /nologo /f ntmakefile clean" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile clean" "NTMAKE_LIBUTILS = nmake /nologo /f ntmakefile clean" "NTMAKE_OBJS = nmake /nologo /f ntmakefile clean" install
$(CD) $(OBJ)\WINNT\install\Win9x
nmake /nologo /f NTMakefile clean
$(CD) ..\..\..\..
$(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
+ echo Build Finished Successfully
install: start finale
# InstallShield dependencies
-InstallShield5: install
+InstallShield5:
echo ***** afs_setup_utils
$(CD) $(OBJ)\WINNT\afs_setup_utils
$(NTMAKE)
$(CD) ..\..\..\..
media: InstallShield5
-
+ echo Install Script Finished Successfully
# Clean target for obj tree
clean: start
- nmake /nologo /f ntmakefile "NTMAKE = nmake /nologo /f ntmakefile clean" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile clean" install
+ nmake /nologo /f ntmakefile "NTMAKE = nmake /nologo /f ntmakefile clean" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile clean" "NTMAKE_OBJS = nmake /nologo /f ntmakefile clean" install
$(CD) $(OBJ)\config
nmake /nologo /f ntmakefile clean_version
$(CD) ..\..
install : $(INSTALL_UTILS_DLLFILE) $(SERVER_UNINST_DLLFILE) $(CLIENT_UNINST_DLLFILE) \
$(CC_UNINST_DLLFILE) $(LIGHT_CLIENT_UNINST_DLLFILE) $(DOCS_UNINST_DLLFILE) \
-
-media : install
$(AFSRM_EXEFILE) $(DIRLANG)
cd _isuser
nmake -fntmakefile install
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
-#include <.\sdrc.h>
+#include <sdrc.h>
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
"$(OUTDIR)" ::
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-HEADERS = ".\sdrc.h"
-
-".\sdrc.h" : $(IS5ROOT)\INCLUDE\sdrc.h
- $(COPY) $(IS5ROOT)\INCLUDE\sdrc.h .
-! IF EXIST($(IS5ROOT)\Script\ISRT\Include\sdrc.h)
- $(COPY) $(IS5ROOT)\Script\ISRT\Include\sdrc.h .
-! ENDIF
-
CPP=cl.exe
CPP_PROJ=/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ISUSER_EXPORTS" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
"$(INTDIR)\_isuser.obj" \
"$(INTDIR)\_Isuser.res"
-"$(OUTDIR)\_IsUser.dll" : "$(OUTDIR)" $(HEADERS) $(DEF_FILE) $(LINK32_OBJS)
+"$(OUTDIR)\_IsUser.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
-
-!IF "$(NO_EXTERNAL_DEPS)" != "1"
-!IF EXISTS("_IsUser.dep")
-!INCLUDE "_IsUser.dep"
-!ELSE
-!MESSAGE Warning: cannot find "_IsUser.dep"
-!ENDIF
-!ENDIF
-
-
SOURCE=.\_isuser.c
"$(INTDIR)\_isuser.obj" : $(SOURCE) "$(INTDIR)"
{ TARGETDIR"\\Common\\afsadminutil.dll", SERVER | CLIENT | LCLIENT | CC },
{ TARGETDIR"\\Common\\afsrpc.dll", SERVER | CLIENT | LCLIENT | CC },
{ TARGETDIR"\\Common\\afsauthent.dll", SERVER | CLIENT | LCLIENT | CC },
- { TARGETDIR"\\Common\\pthread.dll", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afspthread.dll", SERVER | CLIENT | LCLIENT | CC },
{ TARGETDIR"\\Common\\TaAfsAppLib.dll", SERVER | CLIENT | LCLIENT | CC },
{ TARGETDIR"\\Common\\afsprocmgmt.dll", SERVER | CLIENT | LCLIENT },
{ TARGETDIR"\\Common\\afs_config.exe", CLIENT | LCLIENT| CC },
SC_HANDLE hServer = 0, hSCM;
BOOL bRestoreOldConfig = FALSE;
+ if (!AddToProviderOrder(AFSREG_CLT_SVC_NAME)) {
+ ShowError(ERROR_FILE_NOT_FOUND, GetLastError());
+ return -1;
+ }
hSCM = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE);
if (!hSCM) {
ShowError(IDS_SCM_OPEN_FAILED, GetLastError());
BOOL bServer = FALSE;
BOOL bShowingProgressDlg = FALSE;
+ if (!RemoveFromProviderOrder(AFSREG_CLT_SVC_NAME)) {
+ ShowError(ERROR_FILE_NOT_FOUND, GetLastError());
+ return -1;
+ }
hSCM = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE);
if (!hSCM) {
ShowError(IDS_SCM_OPEN_FAILED, GetLastError());
# License. For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html
+AFSDEV_NETGUI = 1
!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
!INCLUDE ..\..\config\NTMakefile.version
$(EXEDIR)\tokens.exe \
$(EXEDIR)\unlog.exe $(EXEDIR)\afsd.exe $(EXEDIR)\afsd_service.exe \
$(EXEDIR)\fs.exe $(EXEDIR)\symlink.exe \
- $(LOGON_DLLFILE) $(LOG95_DLLFILE) \
+ $(LOGON_DLLFILE) \
$(EXEDIR)\afsshare.exe \
$(DESTDIR)\bin\kpasswd.exe
$(EXECONLINK)
$(EXEPREP)
-
+
############################################################################
# generate versioninfo resources
}
}
+#if 0
+/* This code was moved to Drivemap.cpp*/
/* Mount a drive into AFS if the user wants us to */
void CheckMountDrive()
{
RegCloseKey(hKey);
}
+#endif
void afsd_Main()
{
int jmpret;
osi_InitPanic(afsd_notifier);
+ osi_InitTraceOption();
GlobalStatus = 0;
}
/* Check if we should mount a drive into AFS */
- CheckMountDrive();
+/* CheckMountDrive();*/
WaitForSingleObject(WaitToTerminate, INFINITE);
-
+
{
HANDLE h; char *ptbuf[1];
h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME);
#include "cm_config.h"
#include "krb.h"
+#include <io.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+
+DWORD LogonOption,TraceOption;
HANDLE hDLL;
WSADATA WSAjunk;
-char NPName[] = "System\\CurrentControlSet\\Services\\TransarcAFSDaemon\\NetworkProvider";
-
#define REG_CLIENT_PARMS_KEY "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"
+#define REG_CLIENT_PROVIDER_KEY "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\NetworkProvider"
#define REG_CLIENT_RETRY_INTERVAL_PARM "LoginRetryInterval"
#define REG_CLIENT_FAIL_SILENTLY_PARM "FailLoginsSilently"
-#define DEFAULT_RETRY_INTERVAL 30 // seconds
+#define DEFAULT_RETRY_INTERVAL 30 /* seconds*/
#define DEFAULT_FAIL_SILENTLY FALSE
-#define DEFAULT_SLEEP_INTERVAL 5 // seconds
+#define DEFAULT_SLEEP_INTERVAL 5 /* seconds*/
+
+#define ISLOGONINTEGRATED(v) ( ((v) & LOGON_OPTION_INTEGRATED)==LOGON_OPTION_INTEGRATED)
+#define ISHIGHSECURITY(v) ( ((v) & LOGON_OPTION_HIGHSECURITY)==LOGON_OPTION_HIGHSECURITY)
+#define TRACE_OPTION_EVENT 1
+#define ISLOGONTRACE(v) ( ((v) & TRACE_OPTION_EVENT)==TRACE_OPTION_EVENT)
/* Structure def copied from DDK (NTDEF.H) */
typedef struct UNICODE_STRING {
*
* Returns NULL on failure.
*/
-WCHAR *GetLogonScript(void)
+
+
+void DebugEvent0(char *a)
+{
+ HANDLE h; char *ptbuf[1];
+ if (!ISLOGONTRACE(TraceOption))
+ return;
+ h = RegisterEventSource(NULL, a);
+ ptbuf[0] = a;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);
+ DeregisterEventSource(h);
+}
+
+#define MAXBUF_ 131
+void DebugEvent(char *a,char *b,...)
+{
+ HANDLE h; char *ptbuf[1],buf[MAXBUF_+1];
+ va_list marker;
+ if (!ISLOGONTRACE(TraceOption))
+ return;
+ h = RegisterEventSource(NULL, a);
+ va_start(marker,b);
+ _vsnprintf(buf,MAXBUF_,b,marker);
+ ptbuf[0] = buf;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);\
+ DeregisterEventSource(h);
+ va_end(marker);
+}
+
+CHAR *GenRandomName(CHAR *pbuf)
{
- WCHAR *script;
+ int i;
+ srand( (unsigned)time( NULL ) );
+ for (i=0;i<MAXRANDOMNAMELEN-1;i++)
+ pbuf[i]='a'+(rand() % 26);
+ pbuf[MAXRANDOMNAMELEN-1]=0;
+ return pbuf;
+}
+
+WCHAR *GetLogonScript(CHAR *pname)
+{
+ WCHAR *script,*buf;
DWORD code;
DWORD LSPtype, LSPsize;
HKEY NPKey;
+ WCHAR randomName[MAXRANDOMNAMELEN];
/*
* Get Network Provider key.
* Assume this works or we wouldn't be here.
*/
- (void) RegOpenKeyEx(HKEY_LOCAL_MACHINE, NPName,
+ (void) RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_CLIENT_PROVIDER_KEY,
0, KEY_QUERY_VALUE, &NPKey);
/*
* Get Logon Script pathname length
*/
- code = RegQueryValueEx(NPKey, "LogonScript", NULL,
+
+ code = RegQueryValueExW(NPKey, L"LogonScript", NULL,
&LSPtype, NULL, &LSPsize);
if (code) {
return NULL;
}
- script = (WCHAR *)LocalAlloc(LMEM_FIXED, LSPsize);
-
+ buf=(WCHAR *)LocalAlloc(LMEM_FIXED, LSPsize);
+ script=(WCHAR *)LocalAlloc(LMEM_FIXED,LSPsize+(MAXRANDOMNAMELEN)*sizeof(WCHAR));
/*
* Explicitly call UNICODE version
* Assume it will succeed since it did before
*/
(void) RegQueryValueExW(NPKey, L"LogonScript", NULL,
- &LSPtype, (LPBYTE)script, &LSPsize);
+ &LSPtype, (LPBYTE)buf, &LSPsize);
+ MultiByteToWideChar(CP_ACP,0,pname,strlen(pname)+1,randomName,(strlen(pname)+1)*sizeof(WCHAR));
+ swprintf(script,buf,randomName);
+ free(buf);
+
+#ifdef DEBUG_VERBOSE
+ {
+ HANDLE h; char *ptbuf[1],buf[132],tbuf[255];
+ WideCharToMultiByte(CP_ACP,0,script,LSPsize,tbuf,255,NULL,NULL);
+ h = RegisterEventSource(NULL, "AFS AfsLogon - GetLogonScript");
+ sprintf(buf, "Script[%s,%d] Return Code[%x]",tbuf,LSPsize,code);
+ ptbuf[0] = buf;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+ DeregisterEventSource(h);
+ }
+#endif
RegCloseKey (NPKey);
return script;
DWORD MapAuthError(DWORD code)
{
switch (code) {
- case INTK_BADPW: return WN_BAD_PASSWORD;
- case KERB_ERR_PRINCIPAL_UNKNOWN: return WN_BAD_USER;
- default: return WN_NO_NETWORK;
+ case KTC_NOCM:
+ case KTC_NOCMRPC:
+ return WN_NO_NETWORK;
+/* case INTK_BADPW: return WN_BAD_PASSWORD;*/
+/* case KERB_ERR_PRINCIPAL_UNKNOWN: return WN_BAD_USER;*/
+ default: return WN_SUCCESS;
}
}
if (result != ERROR_SUCCESS)
*pFailSilently = DEFAULT_FAIL_SILENTLY;
- // Make sure this is really a bool value in the strict sense
+ /* Make sure this is really a bool value in the strict sense*/
*pFailSilently = !!*pFailSilently;
RegCloseKey(hKey);
}
+BOOL IsServiceRunning (void)
+{
+ SERVICE_STATUS Status;
+ SC_HANDLE hManager;
+ memset (&Status, 0x00, sizeof(Status));
+ Status.dwCurrentState = SERVICE_STOPPED;
+
+ if ((hManager = OpenSCManager (NULL, NULL, GENERIC_READ)) != NULL)
+ {
+ SC_HANDLE hService;
+ if ((hService = OpenService (hManager, TEXT("TransarcAFSDaemon"), GENERIC_READ)) != NULL)
+ {
+ QueryServiceStatus (hService, &Status);
+ CloseServiceHandle (hService);
+ }
+
+ CloseServiceHandle (hManager);
+ }
+ DebugEvent("AFS AfsLogon - Test Service Running","Return Code[%x] ?Running[%d]",Status.dwCurrentState,(Status.dwCurrentState == SERVICE_RUNNING));
+ return (Status.dwCurrentState == SERVICE_RUNNING);
+}
+
DWORD APIENTRY NPLogonNotify(
PLUID lpLogonId,
LPCWSTR lpAuthentInfoType,
char *reason;
BOOLEAN interactive;
BOOLEAN flag;
+ DWORD LSPtype, LSPsize;
+ HKEY NPKey;
HWND hwndOwner = (HWND)StationHandle;
- BOOLEAN failSilently;
- int retryInterval;
- int sleepInterval = DEFAULT_SLEEP_INTERVAL; // seconds
- BOOLEAN afsWillAutoStart;
+ BOOLEAN failSilently;
+ int retryInterval;
+ int sleepInterval = DEFAULT_SLEEP_INTERVAL; /* seconds */
+ BOOLEAN afsWillAutoStart;
+ CHAR RandomName[MAXRANDOMNAMELEN];
+ *lpLogonScript=NULL;
IL = (MSV1_0_INTERACTIVE_LOGON *) lpAuthentInfo;
wcstombs(uname, IL->UserName.Buffer, 256);
wcstombs(password, IL->Password.Buffer, 256);
- /* Check for zero length password */
- if (password[0] == 0) {
+ (void) RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_CLIENT_PARMS_KEY,
+ 0, KEY_QUERY_VALUE, &NPKey);
+ LSPsize=sizeof(TraceOption);
+ RegQueryValueEx(NPKey, "TraceOption", NULL,
+ &LSPtype, (LPBYTE)&TraceOption, &LSPsize);
+ RegCloseKey (NPKey);
+
+ /*
+ * Get Logon OPTIONS
+ */
+
+ (void) RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_CLIENT_PROVIDER_KEY,
+ 0, KEY_QUERY_VALUE, &NPKey);
+
+ LSPsize=sizeof(LogonOption);
+ code = RegQueryValueEx(NPKey, "LogonOptions", NULL,
+ &LSPtype, (LPBYTE)&LogonOption, &LSPsize);
+
+ RegCloseKey (NPKey);
+ if ((code!=0) || (LSPtype!=REG_DWORD))
+ LogonOption=LOGON_OPTION_INTEGRATED; /*default to integrated logon only*/
+ DebugEvent("AFS AfsLogon - NPLogonNotify","LogonOption[%x], Service AutoStart[%d]",LogonOption,AFSWillAutoStart());
+ /* Check for zero length password if integrated logon*/
+ if ( ISLOGONINTEGRATED(LogonOption) && (password[0] == 0) ) {
code = GT_PW_NULL;
reason = "zero length password is illegal";
- goto checkauth;
+ code=0;
}
- /* Get cell name */
- code = cm_GetRootCellName(cell);
- if (code < 0) {
- code = KTC_NOCELL;
- reason = "unknown cell";
- goto checkauth;
+ /* Get cell name if doing integrated logon */
+ if (ISLOGONINTEGRATED(LogonOption))
+ {
+ code = cm_GetRootCellName(cell);
+ if (code < 0) {
+ code = KTC_NOCELL;
+ reason = "unknown cell";
+ code=0;
+ }
}
- /* Get user specified login behavior (or defaults) */
- GetLoginBehavior(&retryInterval, &failSilently);
+ /* Get user specified login behavior (or defaults) */
+ GetLoginBehavior(&retryInterval, &failSilently);
- afsWillAutoStart = AFSWillAutoStart();
+ afsWillAutoStart = AFSWillAutoStart();
- /* Possibly loop until AFS is started. */
- while (1) {
- code = ka_UserAuthenticateGeneral(
- KA_USERAUTH_VERSION+KA_USERAUTH_AUTHENT_LOGON,
- uname, "", cell, password, 0, &pw_exp, 0,
- &reason);
+ *lpLogonScript = GetLogonScript(GenRandomName(RandomName)); /*only do if high security option is on*/
+
+
+ /* loop until AFS is started. */
+ while (TRUE) {
+ code=0;
+
+ /* is service started yet?*/
+ if (ISLOGONINTEGRATED(LogonOption) && !ISHIGHSECURITY(LogonOption)) /* if Integrated Logon only */
+ {
+ DebugEvent("AFS AfsLogon - ka_UserAuthenticateGeneral2","Code[%x],uame[%s] Cell[%s]",code,uname,cell);
+ code = ka_UserAuthenticateGeneral2(
+ KA_USERAUTH_VERSION+KA_USERAUTH_AUTHENT_LOGON,
+ uname, "", cell, password,uname, 0, &pw_exp, 0,
+ &reason);
+ DebugEvent("AFS AfsLogon - (INTEGERTED only)ka_UserAuthenticateGeneral2","Code[%x]",code);
+ } else if (ISLOGONINTEGRATED(LogonOption) && ISHIGHSECURITY(LogonOption)) /* if Integrated Logon and High Security pass random generated name*/
+ {
+ code = ka_UserAuthenticateGeneral2(
+ KA_USERAUTH_VERSION+KA_USERAUTH_AUTHENT_LOGON,
+ uname, "", cell, password,RandomName, 0, &pw_exp, 0,
+ &reason);
+ DebugEvent("AFS AfsLogon - (Both)ka_UserAuthenticateGeneral2","Code[%x],RandomName[%s]",code,RandomName);
+ } else { /*JUST check to see if its running*/
+ if (IsServiceRunning())
+ break;
+ code = KTC_NOCM;
+ if (!afsWillAutoStart)
+ break;
+ }
/* 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;
+ 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
* user know we failed and give them a chance to try again. */
- if (retryInterval <= 0) {
- if (!interactive || failSilently)
- break;
-
+ if (retryInterval <= 0) {
+ if (!interactive || failSilently)
+ break;
flag = MessageBox(hwndOwner,
"AFS is still starting. Retry?",
"AFS Logon",
MB_ICONQUESTION | MB_RETRYCANCEL);
if (flag == IDCANCEL)
- break;
+ break;
/* Wait just a little while and try again */
- retryInterval = sleepInterval = DEFAULT_SLEEP_INTERVAL;
- }
+ retryInterval = sleepInterval = DEFAULT_SLEEP_INTERVAL;
+ }
- if (retryInterval < sleepInterval)
- sleepInterval = retryInterval;
+ if (retryInterval < sleepInterval)
+ sleepInterval = retryInterval;
- Sleep(sleepInterval * 1000);
+ Sleep(sleepInterval * 1000);
- retryInterval -= sleepInterval;
- }
+ retryInterval -= sleepInterval;
+ }
-checkauth:
if (code) {
char msg[128];
-
- sprintf(msg, "Integrated login failed: %s", reason);
+ sprintf(msg, "Integrated login failed: %s", reason);
if (interactive && !failSilently)
MessageBox(hwndOwner, msg, "AFS Logon", MB_OK);
1, 0, ptbuf, NULL);
DeregisterEventSource(h);
}
- }
-
- /* Get logon script */
- if (interactive)
- *lpLogonScript = GetLogonScript();
-
- if (code) {
- code = MapAuthError(code);
+ code = MapAuthError(code);
SetLastError(code);
+ if (ISHIGHSECURITY(LogonOption) && (code!=0))
+ {
+ if (*lpLogonScript)
+ LocalFree(*lpLogonScript);
+ *lpLogonScript = NULL;
+ if (!(afsWillAutoStart || ISLOGONINTEGRATED(LogonOption))) // its not running, so if not autostart or integrated logon then just skip
+ return 0;
+
+ }
}
-
+ DebugEvent("AFS AfsLogon - Exit","Return Code[%x]",code);
return code;
}
LPVOID StationHandle,
DWORD dwChangeInfo)
{
+ DebugEvent0("AFS AfsLogon - NPPasswordChangeNotify");
return 0;
}
return 0;
}
+/* debug interface: not implemented */
+SRXAFSCB_GetCE64(struct rx_call *callp, long index, AFSDBCacheEntry *cep)
+{
+ /* XXXX */
+ return RXGEN_OPCODE;
+}
+
/* debug interface: not implemented */
SRXAFSCB_GetLock(struct rx_call *callp, long index, AFSDBLock *lockp)
{
/* load up a cell structure from the cell database, afsdcell.ini */
cm_cell_t *cm_GetCell(char *namep, long flags)
+{
+ return cm_GetCell_Gen(namep, NULL, flags);
+}
+
+cm_cell_t *cm_GetCell_Gen(char *namep, char *newnamep, long flags)
{
cm_cell_t *cp;
long code;
static cellCounter = 1; /* locked by cm_cellLock */
int ttl;
+ char fullname[200];
lock_ObtainWrite(&cm_cellLock);
for(cp = cm_allCellsp; cp; cp=cp->nextp) {
- if (strcmp(namep, cp->namep) == 0) break;
+ if (strcmp(namep, cp->namep) == 0) {
+ strcpy(fullname, cp->namep);
+ break;
+ }
}
if ((!cp && (flags & CM_FLAG_CREATE))
) {
if (!cp) cp = malloc(sizeof(*cp));
memset(cp, 0, sizeof(*cp));
- code = cm_SearchCellFile(namep, NULL, cm_AddCellProc, cp);
+ code = cm_SearchCellFile(namep, fullname, cm_AddCellProc, cp);
+ if (code) {
#ifdef AFS_AFSDB_ENV
- if (code && cm_dnsEnabled) {
- code = cm_SearchCellByDNS(namep, NULL, &ttl, cm_AddCellProc, cp);
+ if (cm_dnsEnabled /*&& cm_DomainValid(namep)*/)
+ code = cm_SearchCellByDNS(namep, fullname, &ttl, cm_AddCellProc, cp);
#endif
if (code) {
free(cp);
cp->flags |= CM_CELLFLAG_DNS;
cp->timeout = time(0) + ttl;
}
- }
#endif
+ }
/* randomise among those vlservers having the same rank*/
cm_RandomizeServer(&cp->vlServersp);
lock_InitializeMutex(&cp->mx, "cm_cell_t mutex");
/* copy in name */
- cp->namep = malloc(strlen(namep)+1);
- strcpy(cp->namep, namep);
+ cp->namep = malloc(strlen(fullname)+1);
+ strcpy(cp->namep, fullname);
/* thread on global list */
cp->nextp = cm_allCellsp;
}
done:
+ if (newnamep)
+ strcpy(newnamep, fullname);
lock_ReleaseWrite(&cm_cellLock);
return cp;
}
extern cm_cell_t *cm_GetCell(char *namep, long flags);
+extern cm_cell_t *cm_GetCell_Gen(char *namep, char *newnamep, long flags);
+
extern cm_cell_t *cm_FindCellByID(long cellID);
extern void cm_ChangeRankCellVLServer(cm_server_t *tsp);
return -1;
code = RegSetValueEx(parmKey, labelp, 0, REG_DWORD,
- &value, sizeof(value));
+ (LPBYTE)&value, sizeof(value));
RegCloseKey (parmKey);
if (code != ERROR_SUCCESS)
return -1;
return 0;
}
-extern long cm_CloseCellFile(cm_configFile_t *filep)
+long cm_CloseCellFile(cm_configFile_t *filep)
{
char wdir[256];
char sdir[256];
afsStatus.UnixModeBits = 0x1ff;
afsStatus.ParentVnode = 0x1;
afsStatus.ParentUnique = 0x1;
- afsStatus.SegSize = 0;
+ afsStatus.ResidencyMask = 0;
afsStatus.ClientModTime = 0x3b49f6e2;
afsStatus.ServerModTime = 0x3b49f6e2;
afsStatus.Group = 0;
int curDirEntryInPage = 0;
int sizeOfCurEntry;
int dirSize;
-
+
+ /* Reserve 2 directory chunks for "." and ".." */
+ curChunk += 2;
while (curDirEntry!=cm_noLocalMountPoints) {
sizeOfCurEntry = cm_NameEntries((cm_localMountPoints+curDirEntry)->namep, 0);
return 0;
}
-long cm_FreelanceAddMount(char *filename, char *cellname, char *volume)
+long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, cm_fid_t *fidp)
{
FILE *fp;
char hfile[120];
char line[200];
+ char fullname[200];
int n;
+ /* before adding, verify the cell name; if it is not a valid cell,
+ don't add the mount point */
+ /* major performance issue? */
+ if (!cm_GetCell_Gen(cellname, fullname, CM_FLAG_CREATE))
+ return -1;
+#if 0
+ if (strcmp(cellname, fullname) != 0) /* no partial matches allowed */
+ return -1;
+#endif
+
lock_ObtainMutex(&cm_Freelance_Lock);
cm_GetConfigDir(hfile);
fseek(fp, 0, SEEK_SET);
fprintf(fp, "%d", n);
fseek(fp, 0, SEEK_END);
- fprintf(fp, "%s#%s:%s\n", filename, cellname, volume);
+ fprintf(fp, "%s#%s:%s\n", filename, fullname, volume);
fclose(fp);
lock_ReleaseMutex(&cm_Freelance_Lock);
+ /*cm_reInitLocalMountPoints(&vnode);*/
+ if (fidp) {
+ fidp->unique = 1;
+ fidp->vnode = cm_noLocalMountPoints + 1; /* vnode value of last mt pt */
+ }
cm_noteLocalMountPointChange();
-
+
return 0;
}
if (cm_freelanceEnabled && dscp == cm_rootSCachep) {
/* we are adding the mount point to the root dir., so call
the freelance code to do the add. */
- code = cm_FreelanceAddMount(leaf, fullCell, volume);
+ code = cm_FreelanceAddMount(leaf, fullCell, volume, NULL);
return code;
}
#endif
afs_uuid_t uuid;
int flags;
char sessionKey[8];
+ char *smbname;
saveDataPtr = ioctlp->inDatap;
uname = tp;
tp += strlen(tp) + 1;
+ if (flags & PIOCTL_LOGON) {
+ /* SMB user name with which to associate tokens */
+ smbname = tp;
+ fprintf(stderr, "SMB name = %s\n", smbname);
+ tp += strlen(tp) + 1;
+ }
+
#ifndef DJGPP /* for win95, session key is back in pioctl */
/* uuid */
memcpy(&uuid, tp, sizeof(uuid));
cellp = cm_rootCellp;
if (flags & PIOCTL_LOGON) {
- userp = smb_FindCMUserByName(/*ioctlp->fidp->vcp,*/ uname,
- ioctlp->fidp->vcp->rname);
+ userp = smb_FindCMUserByName(smbname, ioctlp->fidp->vcp->rname);
}
/* store the token */
}
#endif /* DJGPP */
+long cm_IoctlGetSMBName(smb_ioctl_t *ioctlp, cm_user_t *userp)
+{
+ smb_user_t *uidp = ioctlp->uidp;
+
+ if (uidp && uidp->unp) {
+ memcpy(ioctlp->outDatap, uidp->unp->name, strlen(uidp->unp->name));
+ ioctlp->outDatap += strlen(uidp->unp->name);
+ }
+
+ return 0;
+}
+
statusp->UnixModeBits = 0x1ff;
statusp->ParentVnode = 0x1;
statusp->ParentUnique = 0x1;
- statusp->SegSize = 0;
+ statusp->ResidencyMask = 0;
statusp->ClientModTime = 0x3b49f6e2;
statusp->ServerModTime = 0x3b49f6e2;
statusp->Group = 0;
cm_scache_t *mountedScp;
cm_lookupSearch_t rock;
char tname[256];
+ int getroot;
if (dscp->fid.vnode == 1 && dscp->fid.unique == 1
&& strcmp(namep, "..") == 0) {
* looking for. Any other non-zero code is an error.
*/
if (code && code != CM_ERROR_STOPNOW) return code;
-
- if (!rock.found)
+
+ getroot = (dscp==cm_rootSCachep) ;
+ if (!rock.found) {
+ if (!cm_freelanceEnabled || !getroot) {
if (flags & CM_FLAG_CHECKPATH)
return CM_ERROR_NOSUCHPATH;
else
return CM_ERROR_NOSUCHFILE;
+ }
+ else { /* nonexistent dir on freelance root, so add it */
+ code = cm_FreelanceAddMount(namep, namep, "root.cell.",
+ &rock.fid);
+ if (code < 0) { /* add mount point failed, so give up */
+ if (flags & CM_FLAG_CHECKPATH)
+ return CM_ERROR_NOSUCHPATH;
+ else
+ return CM_ERROR_NOSUCHFILE;
+ }
+ tscp = NULL; /* to force call of cm_GetSCache */
+ }
+ }
haveFid:
if ( !tscp ) /* we did not find it in the dnlc */
*newRootScpp = cm_rootSCachep;
cm_HoldSCache(cm_rootSCachep);
} else if (*linkp == '\\' || *linkp == '/') {
+ /* formerly, this was considered to be from the AFS root,
+ but this seems to create problems. instead, we will just
+ reject the link */
+#if 0
strcpy(tsp->data, linkp+1);
*newRootScpp = cm_rootSCachep;
cm_HoldSCache(cm_rootSCachep);
+#else
+ code = CM_ERROR_NOSUCHPATH;
+ goto done;
+#endif
}
else {
/* a relative link */
tp = (char *)(space + sizeof(afs_int32));
lp = (afs_int32 *)tp;
*lp++ = 0x12345678;
- size == sizeof(afs_int32) + sizeof(afs_int32);
+ size = sizeof(afs_int32) + sizeof(afs_int32);
blob.out_size = MAXSIZE;
blob.in_size = sizeof(afs_int32);
blob.in = space;
for(uidp = vcp->usersp; uidp; uidp = uidp->nextp) {
if (uid == uidp->userID) {
uidp->refCount++;
-#ifdef DEBUG_VERBOSE
- {
- HANDLE h; char *ptbuf[1],buf[132];
- h = RegisterEventSource(NULL, "AFS Service - smb_FindUID (Find by UID)");
- sprintf(buf, "VCP[%x] found-uid[%d] name[%s]",vcp,uidp->userID,(uidp->unp ? uidp->unp->name : ""));
- ptbuf[0] = buf;
- ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
- DeregisterEventSource(h);
- }
-#endif
+ osi_LogEvent("AFS smb_FindUID (Find by UID)",NULL," VCP[%x] found-uid[%d] name[%s]",vcp,uidp->userID,(uidp->unp) ? uidp->unp->name : "");
break;
}
}
vcp->usersp = uidp;
lock_InitializeMutex(&uidp->mx, "uid_t mutex");
uidp->userID = uid;
-#ifdef DEBUG_VERBOSE
- {
- HANDLE h; char *ptbuf[1],buf[132];
- h = RegisterEventSource(NULL, "AFS Service - smb_FindUID (Find by UID)");
- sprintf(buf, "VCP[%x] new-uid[%d] name[%s]",vcp,uidp->userID,(uidp->unp ? uidp->unp->name : ""));
- ptbuf[0] = buf;
- ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
- DeregisterEventSource(h);
- }
-#endif
+ osi_LogEvent("AFS smb_FindUID (Find by UID)",NULL,"VCP[%x] new-uid[%d] name[%s]",vcp,uidp->userID,(uidp->unp ? uidp->unp->name : ""));
}
lock_ReleaseWrite(&smb_rctLock);
return uidp;
continue;
if (stricmp(uidp->unp->name, usern) == 0) {
uidp->refCount++;
-#ifdef DEBUG_VERBOSE
- {
- HANDLE h; char *ptbuf[1],buf[132];
- h = RegisterEventSource(NULL, "AFS Service - smb_FindUserByNameThisSession");
- sprintf(buf, "VCP[%x] uid[%d] match-name[%s]",vcp,uidp->userID,usern);
- ptbuf[0] = buf;
- ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
- DeregisterEventSource(h);
- }
-#endif
+ osi_LogEvent("AFS smb_FindUserByNameThisSession",NULL,"VCP[%x] uid[%d] match-name[%s]",vcp,uidp->userID,usern);
break;
} else
continue;
code = smb_ReceiveCoreWriteRaw (vcp, inp, outp,
rwcp);
else {
-
-#ifdef DEBUG_VERBOSE
- HANDLE h; char *ptbuf[1],buf[132];DWORD err;
- h = RegisterEventSource(NULL, "AFS Server - Dispatch");
- sprintf(buf,"%s vcp[%x] lana[%d] lsn[%d]",myCrt_Dispatch(inp->inCom),vcp,vcp->lana,vcp->lsn);
- ptbuf[0] = buf;
- ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
- DeregisterEventSource(h);
-#endif
+ osi_LogEvent("AFS Dispatch %s",(myCrt_Dispatch(inp->inCom)),"vcp[%x] lana[%d] lsn[%d]",vcp,vcp->lana,vcp->lsn);
+ osi_Log4(afsd_logp,"Dispatch %s vcp[%x] lana[%d] lsn[%d]",(myCrt_Dispatch(inp->inCom)),vcp,vcp->lana,vcp->lsn);
code = (*(dp->procp)) (vcp, inp, outp);
-
-#ifdef DEBUG_VERBOSE
- h = RegisterEventSource(NULL, "AFS Server - Dispatch return ");
- sprintf(buf,"code[%d]",code-CM_ERROR_BASE);
- if (code)
- ptbuf[0] = buf;
- else
- ptbuf[0] = "code[0]";
- ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
- DeregisterEventSource(h);
-#endif
+ osi_LogEvent("AFS Dispatch return",NULL,"Code[%d]",(code==0)?0:code-CM_ERROR_BASE,"");
+ osi_Log1(afsd_logp,"Dispatch return code[%d]",(code==0)?0:code-CM_ERROR_BASE);
}
if (oldGen != sessionGen) {
1, ncbp->ncb_length, ptbuf, smbp);
DeregisterEventSource(h);
#else /* DJGPP */
- osi_Log1(afsd_logp, "Invalid SMB message, length %d",
+ osi_Log1(afsd_logp, "Invalid SMB message, length %d",
ncbp->ncb_length);
#endif /* !DJGPP */
/* fid pointer */
struct smb_fid *fidp;
+
+ /* uid pointer */
+ smb_user_t *uidp;
+
} smb_ioctl_t;
/* flags for smb_ioctl_t */
pwd = smb_ParseString(tp, &tp);
usern = smb_ParseString(tp, &tp);
- if (strlen(usern)==0) {
- /*return CM_ERROR_NOACCESS;*/
- newUid = 0; /* always assign uid 0 for blank username */
- uidp = smb_FindUID(vcp, newUid, SMB_FLAG_CREATE);
-#ifdef DEBUG_VERBOSE
- {
- HANDLE h; char *ptbuf[1],buf[132];
- h = RegisterEventSource(NULL, "AFS Service - smb_ReceiveV3SessionSetupX");
- sprintf(buf, "VCP[%x] lsn[%d] anonymous, uid[%d]",vcp,vcp->lsn,uidp->userID);
- ptbuf[0] = buf;
- ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
- DeregisterEventSource(h);
- }
-#endif
- smb_ReleaseUID(uidp);
- goto done;
- }
-
/* On Windows 2000, this function appears to be called more often than
it is expected to be called. This resulted in multiple smb_user_t
records existing all for the same user session which results in all
unp = uidp->unp;
userp = unp->userp;
newUid = (unsigned short)uidp->userID; /* For some reason these are different types!*/
-#ifdef DEBUG_VERBOSE
- {
- HANDLE h; char *ptbuf[1],buf[132];
- h = RegisterEventSource(NULL, "AFS Service - smb_ReceiveV3SessionSetupX");
- sprintf(buf,"FindUserByName:VCP[%x],Lana[%d],lsn[%d],userid[%d],name[%s]",vcp,vcp->lana,vcp->lsn,newUid,usern);
- ptbuf[0] = buf;
- ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
- DeregisterEventSource(h);
- }
-#endif
+ osi_LogEvent("AFS smb_ReceiveV3SessionSetupX",NULL,"FindUserByName:Lana[%d],lsn[%d],userid[%d],name[%s]",vcp->lana,vcp->lsn,newUid,usern);
+ osi_Log3(afsd_logp,"smb_ReceiveV3SessionSetupX FindUserByName:Lana[%d],lsn[%d],userid[%d]",vcp->lana,vcp->lsn,newUid);
smb_ReleaseUID(uidp);
}
else {
if (!userp)
userp = cm_NewUser();
lock_ObtainMutex(&vcp->mx);
- newUid = vcp->uidCounter++;
+ newUid = (strlen(usern)==0)?0:vcp->uidCounter++;
lock_ReleaseMutex(&vcp->mx);
/* Create a new smb_user_t structure and connect them up */
uidp = smb_FindUID(vcp, newUid, SMB_FLAG_CREATE);
lock_ObtainMutex(&uidp->mx);
uidp->unp = unp;
-#ifdef DEBUG_VERBOSE
- {
- HANDLE h; char *ptbuf[1],buf[132];
- h = RegisterEventSource(NULL, "AFS Service - smb_ReceiveV3SessionSetupX");
- sprintf(buf,"NewUser:VCP[%x],Lana[%d],lsn[%d],userid[%d],name[%s]",vcp,vcp->lana,vcp->lsn,newUid,usern);
- ptbuf[0] = buf;
- ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
- DeregisterEventSource(h);
- }
-#endif
+ osi_LogEvent("AFS smb_ReceiveV3SessionSetupX",NULL,"MakeNewUser:VCP[%x],Lana[%d],lsn[%d],userid[%d],TicketKTCName[%s]",vcp,vcp->lana,vcp->lsn,newUid,usern);
+ osi_Log4(afsd_logp,"smb_ReceiveV3SessionSetupX MakeNewUser:VCP[%x],Lana[%d],lsn[%d],userid[%d]",vcp,vcp->lana,vcp->lsn,newUid);
lock_ReleaseMutex(&uidp->mx);
smb_ReleaseUID(uidp);
}
- done:
/* Return UID to the client */
((smb_t *)outp)->uid = newUid;
/* Also to the next chained message */
lock_ReleaseWrite(&smb_globalLock);
/* now dispatch it */
+ osi_LogEvent("AFS-Dispatch-2[%s]",myCrt_2Dispatch(asp->opcode),"vcp[%x] lana[%d] lsn[%d]",vcp,vcp->lana,vcp->lsn);
+ osi_Log4(afsd_logp,"AFS Server - Dispatch-2 %s vcp[%x] lana[%d] lsn[%d]",myCrt_2Dispatch(asp->opcode),vcp,vcp->lana,vcp->lsn);
code = (*smb_tran2DispatchTable[asp->opcode].procp)(vcp, asp, outp);
/* if an error is returned, we're supposed to send an error packet,
{
cm_user_t *userp;
/*int newUid;*/
- smb_user_t *uidp;
smb_username_t *unp;
unp = smb_FindUserByName(usern, machine, SMB_FLAG_CREATE);
lock_ObtainMutex(&unp->mx);
unp->userp = cm_NewUser();
lock_ReleaseMutex(&unp->mx);
-#ifdef DEBUG_VERBOSE
- { //jimpeter
- HANDLE h; char *ptbuf[1],buf[132];
- h = RegisterEventSource(NULL, "AFS Service - smb_FindCMUserByName");
- sprintf(buf,"New User name[%s] machine[%s]",usern,machine);
- ptbuf[0] = buf;
- ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
- DeregisterEventSource(h);
- }
-#endif
- }
-#ifdef DEBUG_VERBOSE
- else { //jimpeter
- HANDLE h; char *ptbuf[1],buf[132];
- h = RegisterEventSource(NULL, "AFS Service - smb_FindCMUserByName");
- sprintf(buf,"Found-name[%s] machine[%s]",usern,machine);
- ptbuf[0] = buf;
- ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
- DeregisterEventSource(h);
- }
-#endif
+ osi_LogEvent("AFS smb_FindCMUserByName New User",NULL,"name[%s] machine[%s]",usern,machine);
+ } else {
+ osi_LogEvent("AFS smb_FindCMUserByName Found",NULL,"name[%s] machine[%s]",usern,machine);
+ }
return unp->userp;
}
extern int smb_V3MatchMask(char *namep, char *maskp, int flags);
extern void smb3_Init();
+extern cm_user_t *smb_FindCMUserByName(/*smb_vc_t *vcp,*/ char *usern, char *machine);
#ifdef DJGPP
#define DELETE (0x00010000)
osi_Log3(afsd_logp, "Ioctl uid %d user %x name %s",
uidp->userID, userp,
osi_LogSaveString(afsd_logp, uidp->unp->name));
- else
+ else {
+ if (uidp)
osi_Log2(afsd_logp, "Ioctl uid %d user %x no name",
uidp->userID, userp);
+ else
+ osi_Log1(afsd_logp, "Ioctl no uid user %x no name",
+ userp);
+ }
smb_ReleaseUID(uidp);
}
return TRUE;
}
-
+#if 0
+/* These two functions are not needed as of the 1.2.2a updates.
+ The old implementation used to 'bind' afslogon.dll to the credentials manager
+ when the Integrated Logon was selected.
+
+ With version 1.2.2a afslogon.dll is always 'bound' to the credentials manager; therefore,
+ the binding operation is done during installation. Note: the Integrated Logon is
+ selected by an entry in the registry (LogonOptions).
+*/
void Config_GetAuthentFlag (BOOL *pfFlag)
{
*pfFlag = FALSE;
Message (MB_ICONHAND, GetErrorTitle(), IDS_FAILCONFIG_AUTHENT, TEXT("%ld"), status);
return rc;
}
-
+#endif
void Config_GetTrayIconFlag (BOOL *pfFlag)
{
void Config_GetLanAdapter (ULONG *pnLanAdapter)
{
if (!Config_ReadNum (TEXT("LANadapter"), (DWORD*)pnLanAdapter))
- *pnLanAdapter = 0;
+ *pnLanAdapter = -1;
}
BOOL Config_SetLanAdapter (ULONG nLanAdapter, ULONG *pStatus)
BOOL Config_ContactGateway (LPTSTR pszGateway, LPTSTR pszCell);
void Config_FixGatewayDrives (void);
-void Config_GetAuthentFlag (BOOL *pfFlag);
-BOOL Config_SetAuthentFlag (BOOL fFlag, ULONG *pStatus = NULL);
-
void Config_GetTrayIconFlag (BOOL *pfFlag);
BOOL Config_SetTrayIconFlag (BOOL fFlag, ULONG *pStatus = NULL);
BOOL DefineDosDrive(DRIVEMAP *pDrive, DDDACTION dddAction)
{
- TCHAR szAfsPath[MAX_PATH];
- TCHAR szDrive[3] = TEXT("?:");
+ // TCHAR szAfsPath[MAX_PATH];
+ // TCHAR szDrive[3] = TEXT("?:");
BOOL fResult = FALSE;
if (!pDrive)
return FALSE;
- szDrive[0] = pDrive->chDrive;
- _stprintf(szAfsPath, TEXT("\\Device\\LanmanRedirector\\%s\\%s-AFS\\%s"), szDrive, szHostName, pDrive->szSubmount);
-
if (dddAction == DDD_REMOVE) {
- fResult = DefineDosDevice(DDD_RAW_TARGET_PATH | DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, szDrive, szAfsPath);
- if (!fResult)
- Message (MB_OK | MB_ICONHAND, IDS_ERROR_UNMAP, IDS_ERROR_UNMAP_DESC, TEXT("%08lX"), GetLastError());
+ if (!(fResult=(DisMountDOSDrive(pDrive->chDrive)==NO_ERROR)))
+ Message (MB_OK | MB_ICONHAND, IDS_ERROR_UNMAP, IDS_ERROR_UNMAP_DESC, TEXT("%08lX"), GetLastError());
} else if (dddAction == DDD_ADD) {
- fResult = DefineDosDevice(DDD_RAW_TARGET_PATH, szDrive, szAfsPath);
- if (!fResult)
- Message (MB_OK | MB_ICONHAND, IDS_ERROR_MAP, IDS_ERROR_MAP_DESC, TEXT("%08lX"), GetLastError());
+ if (!(fResult=(MountDOSDrive(pDrive->chDrive, pDrive->szSubmount,FALSE)==NO_ERROR)))
+ Message (MB_OK | MB_ICONHAND, IDS_ERROR_MAP, IDS_ERROR_MAP_DESC, TEXT("%08lX"), GetLastError());
}
-
+ /*
+ Replace this code with Drive mapping routine that doesn't require different formats for each OS
+ szDrive[0] = pDrive->chDrive;
+ _stprintf(szAfsPath, TEXT("\\Device\\LanmanRedirector\\%s\\%s-AFS\\%s"), szDrive, szHostName, pDrive->szSubmount);
+
+ if (dddAction == DDD_REMOVE) {
+ fResult = DefineDosDevice(DDD_RAW_TARGET_PATH | DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, szDrive, szAfsPath);
+ if (!fResult)
+ Message (MB_OK | MB_ICONHAND, IDS_ERROR_UNMAP, IDS_ERROR_UNMAP_DESC, TEXT("%08lX"), GetLastError());
+ } else if (dddAction == DDD_ADD) {
+ fResult = DefineDosDevice(DDD_RAW_TARGET_PATH, szDrive, szAfsPath);
+ if (!fResult)
+ Message (MB_OK | MB_ICONHAND, IDS_ERROR_MAP, IDS_ERROR_MAP_DESC, TEXT("%08lX"), GetLastError());
+ }
+
+ */
if (fResult)
- UpdateRegistry(pDrive, dddAction == DDD_REMOVE);
-
+ UpdateRegistry(pDrive, dddAction == DDD_REMOVE);
+
return fResult;
}
case IDCANCEL:
Misc_OnCancel(hDlg);
break;
+ case IDC_AUTOLANA:
+ if (IsDlgButtonChecked(hDlg,IDC_AUTOLANA))
+ nLanAdapter=-1;
+ else
+ nLanAdapter=0;
+ SP_SetPos (GetDlgItem (hDlg, IDC_LAN_ADAPTER),nLanAdapter);
+ EnableWindow(GetDlgItem(hDlg,IDC_LAN_ADAPTER),(nLanAdapter!=-1));
}
break;
fFirstTime = FALSE;
}
- CreateSpinner (GetDlgItem (hDlg, IDC_LAN_ADAPTER), 10, FALSE, nLANA_MIN, nLanAdapter, nLANA_MAX);
+ CreateSpinner (GetDlgItem (hDlg, IDC_LAN_ADAPTER), 99, FALSE, nLANA_MIN, nLanAdapter, nLANA_MAX);
CreateSpinner (GetDlgItem (hDlg, IDC_PROBE), 10, FALSE, csecPROBE_MIN, csecProbe, csecPROBE_MAX);
CreateSpinner (GetDlgItem (hDlg, IDC_THREADS), 10, FALSE, cTHREADS_MIN, nThreads, cTHREADS_MAX);
CreateSpinner (GetDlgItem (hDlg, IDC_DAEMONS), 10, FALSE, cDAEMONS_MIN, nDaemons, cDAEMONS_MAX);
SetDlgItemText (hDlg, IDC_SYSNAME, szSysName);
SetDlgItemText (hDlg, IDC_ROOTVOLUME, szRootVolume);
SetDlgItemText (hDlg, IDC_MOUNTDIR, szMountDir);
+ CheckDlgButton (hDlg, IDC_AUTOLANA, (nLanAdapter==-1));
+ EnableWindow(GetDlgItem(hDlg,IDC_LAN_ADAPTER),(nLanAdapter!=-1));
}
void Misc_OnOK (HWND hDlg)
{
- nLanAdapter = SP_GetPos (GetDlgItem (hDlg, IDC_LAN_ADAPTER));
+ nLanAdapter = (IsDlgButtonChecked(hDlg,IDC_AUTOLANA))?-1
+ :SP_GetPos (GetDlgItem (hDlg, IDC_LAN_ADAPTER));
csecProbe = SP_GetPos (GetDlgItem (hDlg, IDC_PROBE));
{
if (fFirstTime)
return TRUE;
-
+
if (nLanAdapter != g.Configuration.nLanAdapter) {
if (!Config_SetLanAdapter (nLanAdapter))
return FALSE;
extern "C" {
#include <afs/param.h>
#include <afs/stds.h>
+#include <rx/rxkad.h>
}
-
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <WINNT/TaLocale.h>
#include "drivemap.h"
-
+#include <time.h>
+#include <adssts.h>
+#include <osilog.h>
/*
* REGISTRY ___________________________________________________________________
*
*/
-static const TCHAR AFSConfigKeyName[] = TEXT("SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters");
+#undef AFSConfigKeyName
+const TCHAR sAFSConfigKeyName[] = TEXT("SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters");
/*
TCHAR szValue[128];
HKEY hKey;
- _stprintf(szKeyName, TEXT("%s\\GlobalAutoMapper"), AFSConfigKeyName);
+ _stprintf(szKeyName, TEXT("%s\\GlobalAutoMapper"), sAFSConfigKeyName);
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
return FALSE;
Resource.lpLocalName = szLocal;
Resource.lpRemoteName = szRemote;
- DWORD rc = WNetAddConnection2 (&Resource, NULL, NULL, ((fPersistent) ? CONNECT_UPDATE_PROFILE : 0));
+ // DWORD rc = WNetAddConnection2 (&Resource, NULL, NULL, ((fPersistent) ? CONNECT_UPDATE_PROFILE : 0));
+ DWORD rc=MountDOSDrive(chDrive,szSubmount,fPersistent);
if (rc == NO_ERROR)
return TRUE;
BOOL InactivateDriveMap (TCHAR chDrive, DWORD *pdwStatus)
{
- TCHAR szLocal[ MAX_PATH ] = TEXT("*:");
- szLocal[0] = chDrive;
-
- DWORD rc = WNetCancelConnection (szLocal, FALSE);
+ DWORD rc = DisMountDOSDrive(chDrive, FALSE);
if (rc == NO_ERROR)
return TRUE;
pszSubmount = &szMapping[ lstrlen(cszLANMANDEVICE) ];
if (IsWindows2000())
+ {
if (*(pszSubmount) != TEXT(';'))
return FALSE;
+ } else
+ --pszSubmount;
if (toupper(*(++pszSubmount)) != chDrive)
return FALSE;
if (*(++pszSubmount) != TEXT('0'))
return FALSE;
- if (*(++pszSubmount) != TEXT('\\'))
- return FALSE;
+ // scan for next "\"
+ while (*(++pszSubmount) != TEXT('\\'))
+ {
+ if (*pszSubmount==0)
+ return FALSE;
+ }
for (++pszSubmount; *pszSubmount && (*pszSubmount != TEXT('\\')); ++pszSubmount)
if (!lstrncmpi (pszSubmount, TEXT("-afs\\"), lstrlen(TEXT("-afs\\"))))
break;
return TRUE;
}
+/* Generate Random User name random acording to time*/
+DWORD dwOldState=0;
+TCHAR pUserName[MAXRANDOMNAMELEN];
+BOOL fUserName=FALSE;
+#define AFSLogonOptionName TEXT("System\\CurrentControlSet\\Services\\TransarcAFSDaemon\\NetworkProvider")
+
+void SetBitLogonOption(BOOL set,DWORD value)
+{
+
+ RWLogonOption(FALSE,((set)?value | RWLogonOption(TRUE,0):RWLogonOption(TRUE,0) & ~value) );
+}
+
+DWORD RWLogonOption(BOOL read,DWORD value)
+{
+ // if read is true then if value==0 return registry value
+ // if read and value!=0 then use value to test registry, return TRUE if value bits match value read
+ HKEY hk;
+ DWORD dwDisp;
+ DWORD LSPtype, LSPsize;
+ DWORD rval;
+ if (read)
+ {
+ rval=0;
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSLogonOptionName,0, KEY_QUERY_VALUE, &hk)==ERROR_SUCCESS)
+ {
+ LSPsize=sizeof(rval);
+ RegQueryValueEx(hk, "LogonOptions", NULL,
+ &LSPtype, (LPBYTE)&rval, &LSPsize);
+ RegCloseKey (hk);
+ }
+ return (value==0)?rval:((rval & value)==value);
+
+ } else { //write
+ if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, AFSLogonOptionName, 0, NULL, 0, KEY_SET_VALUE, NULL, &hk, &dwDisp) == ERROR_SUCCESS)
+ {
+ RegSetValueEx(hk,TEXT("LogonOptions"),NULL,REG_DWORD,(LPBYTE)&value,sizeof(value));
+ RegCloseKey (hk);
+ }
+ return TRUE;
+ }
+}
+
+void MapShareName(char *pszCmdLineA)
+{
+ fUserName = TRUE;
+ TCHAR *p=pUserName;
+ pszCmdLineA++;
+ while (*pszCmdLineA && (*pszCmdLineA != ' '))
+ {
+ *p++=*pszCmdLineA++;
+ }
+}
+
+void GenRandomName(TCHAR *pname,int len)
+{
+ if (fUserName)
+ { //user name was passed through command line, use once
+ fUserName=FALSE;
+ return;
+ }
+ srand( (unsigned)time( NULL ) );
+ for (int i=0;i<len;i++)
+ pname[i]='a'+(rand() % 26);
+ pname[len]=0;
+ return;
+}
+
+/*
+ Make a connection using users name
+ if fUserName then force a connection
+*/
+
+BOOL TestAndDoMapShare(DWORD dwState)
+{
+ if ((dwState!=SERVICE_RUNNING) || (dwOldState!=SERVICE_START_PENDING))
+ {
+ dwOldState=dwState;
+ return TRUE;
+ }
+ dwOldState=SERVICE_RUNNING;
+ if (RWLogonOption(TRUE,LOGON_OPTION_HIGHSECURITY))
+ return (DoMapShare() && GlobalMountDrive());
+ return GlobalMountDrive();
+}
+
+BOOL IsServiceActive()
+{
+ SC_HANDLE hManager;
+ SERVICE_STATUS Status;
+ if ((hManager = OpenSCManager (NULL, NULL, GENERIC_READ)) != NULL)
+ {
+ SC_HANDLE hService;
+ if ((hService = OpenService (hManager, TEXT("TransarcAFSDaemon"), GENERIC_READ)) != NULL)
+ {
+ QueryServiceStatus (hService, &Status);
+ CloseServiceHandle (hService);
+ }
+
+ CloseServiceHandle (hManager);
+ }
+
+ return (Status.dwCurrentState == SERVICE_RUNNING) ? TRUE : FALSE;
+}
+
+void TestAndDoUnMapShare()
+{
+ if (!RWLogonOption(TRUE,LOGON_OPTION_HIGHSECURITY))
+ return;
+ DoUnMapShare(FALSE);
+}
+
+void DoUnMapShare(BOOL drivemap) //disconnect drivemap
+{
+ TCHAR szMachine[ MAX_PATH],szPath[MAX_PATH];
+ DWORD rc=28;
+ HANDLE hEnum;
+ LPNETRESOURCE lpnrLocal,lpnr=NULL;
+ DWORD res;
+ DWORD cbBuffer=16384;
+ DWORD cEntries=-1;
+ GetComputerName(szMachine,&rc);
+ CHAR *pSubmount="";
+ // Initialize the data structure
+ if ((res=WNetOpenEnum(RESOURCE_CONNECTED,RESOURCETYPE_DISK,RESOURCEUSAGE_CONNECTABLE,lpnr,&hEnum))!=NO_ERROR)
+ return;
+ sprintf(szPath,"\\\\%s-afs\\",szMachine);
+ _strlwr(szPath);
+ lpnrLocal=(LPNETRESOURCE) GlobalAlloc(GPTR,cbBuffer);
+ do {
+ memset(lpnrLocal,0,cbBuffer);
+ if ((res = WNetEnumResource(hEnum,&cEntries,lpnrLocal,&cbBuffer))==NO_ERROR)
+ {
+ for (DWORD i=0;i<cEntries;i++)
+ {
+ if (strstr(_strlwr(lpnrLocal[i].lpRemoteName),szPath))
+ {
+ if ((lpnrLocal[i].lpLocalName) && (strlen(lpnrLocal[i].lpLocalName)>0))
+ {
+ if (drivemap)
+ DisMountDOSDrive(*lpnrLocal[i].lpLocalName);
+ //WNetCancelConnection(lpnrLocal[i].lpLocalName,TRUE);
+ } else
+ DisMountDOSDriveFull(lpnrLocal[i].lpRemoteName);
+ //WNetCancelConnection(lpnrLocal[i].lpRemoteName,TRUE);
+ DEBUG_EVENT1("AFS DriveUnMap","UnMap-Remote=%x",res);
+ }
+ }
+ }
+ } while (res!=ERROR_NO_MORE_ITEMS);
+ GlobalFree((HGLOBAL)lpnrLocal);
+ WNetCloseEnum(hEnum);
+}
+
+BOOL DoMapShareChange()
+{
+ DRIVEMAPLIST List;
+ TCHAR szMachine[ MAX_PATH],szPath[MAX_PATH];
+ DWORD rc=28;
+ HANDLE hEnum;
+ LPNETRESOURCE lpnrLocal,lpnr=NULL;
+ DWORD res;
+ DWORD cbBuffer=16384;
+ DWORD cEntries=-1;
+ GetComputerName(szMachine,&rc);
+ CHAR szUser[MAXRANDOMNAMELEN];
+ // Initialize the data structure
+ if (!IsServiceActive())
+ return TRUE;
+ memset (&List, 0x00, sizeof(DRIVEMAPLIST));
+ for (size_t ii = 0; ii < 26; ++ii)
+ List.aDriveMap[ii].chDrive = chDRIVE_A + ii;
+ QueryDriveMapList_ReadSubmounts (&List);
+ if ((res=WNetOpenEnum(RESOURCE_CONNECTED,RESOURCETYPE_DISK,RESOURCEUSAGE_CONNECTABLE,lpnr,&hEnum))!=NO_ERROR)
+ return FALSE;
+ lpnrLocal=(LPNETRESOURCE) GlobalAlloc(GPTR,cbBuffer);
+ sprintf(szPath,"\\\\%s-afs\\",szMachine);
+ _strlwr(szPath);
+ do {
+ memset(lpnrLocal,0,cbBuffer);
+ if ((res = WNetEnumResource(hEnum,&cEntries,lpnrLocal,&cbBuffer))==NO_ERROR)
+ {
+ for (DWORD i=0;i<cEntries;i++)
+ {
+ if (strstr(_strlwr(lpnrLocal[i].lpRemoteName),szPath)==NULL)
+ continue; //only look at real afs mappings
+ CHAR * pSubmount=strrchr(lpnrLocal[i].lpRemoteName,'\\')+1;
+ if (strcmpi(pSubmount,"all")==0)
+ continue; // do not remove 'all'
+ for (DWORD j=0;j<List.cSubmounts;j++)
+ {
+ if (
+ (List.aSubmounts[j].szSubmount[0]) &&
+ (strcmpi(List.aSubmounts[j].szSubmount,pSubmount)==0)
+ )
+ {
+ List.aSubmounts[j].fInUse=TRUE;
+ goto nextname;
+ }
+ }
+ // wasn't on list so lets remove
+ DisMountDOSDrive(pSubmount);
+ nextname:;
+ }
+ }
+ } while (res!=ERROR_NO_MORE_ITEMS);
+ GlobalFree((HGLOBAL)lpnrLocal);
+ WNetCloseEnum(hEnum);
+ sprintf(szPath,"\\\\%s-afs\\all",szMachine);
+ cbBuffer=MAXRANDOMNAMELEN-1;
+ // Lets connect all submounts that weren't connectd
+ CHAR * pUser=szUser;
+ if (WNetGetUser(szPath,(LPSTR)szUser,&cbBuffer)!=NO_ERROR)
+ GenRandomName(szUser,MAXRANDOMNAMELEN-1);
+ else {
+ if ((pUser=strchr(szUser,'\\'))==NULL)
+ return FALSE;
+ pUser++;
+ }
+ for (DWORD j=0;j<List.cSubmounts;j++)
+ {
+ if (List.aSubmounts[j].fInUse)
+ continue;
+ sprintf(szPath,"\\\\%s-afs\\%s",szMachine,List.aSubmounts[j].szSubmount);
+ NETRESOURCE nr;
+ memset (&nr, 0x00, sizeof(NETRESOURCE));
+ nr.dwType=RESOURCETYPE_DISK;
+ nr.lpLocalName="";
+ nr.lpRemoteName=szPath;
+ //DWORD res=WNetAddConnection2(&nr,NULL,pUser,0);
+ DWORD res=MountDOSDrive(0,List.aSubmounts[j].szSubmount,FALSE,pUser);
+ }
+ return TRUE;
+}
+
+BOOL DoMapShare()
+{
+ DRIVEMAPLIST List;
+ TCHAR szMachine[ MAX_PATH ];
+ TCHAR szPath[ MAX_PATH ];
+ DWORD rc=28;
+ BOOL bMappedAll=FALSE;
+ GetComputerName(szMachine,&rc);
+ // Initialize the data structure
+ DEBUG_EVENT0("AFS DoMapShare");
+ QueryDriveMapList (&List);
+ DoUnMapShare(TRUE);
+ // All connections have been removed
+ // Lets restore them after making the connection from the random name
+
+ GenRandomName(pUserName,MAXRANDOMNAMELEN-1);
+ for (DWORD i=0;i<List.cSubmounts;i++)
+ {
+ if (List.aSubmounts[i].szSubmount[0])
+ {
+ sprintf(szPath,"\\\\%s-afs\\%s",szMachine,List.aSubmounts[i].szSubmount);
+ NETRESOURCE nr;
+ memset (&nr, 0x00, sizeof(NETRESOURCE));
+ nr.dwType=RESOURCETYPE_DISK;
+ nr.lpLocalName="";
+ nr.lpRemoteName=szPath;
+ //DWORD res=WNetAddConnection2(&nr,NULL,pUserName,0);
+ DWORD res=MountDOSDrive(0,List.aSubmounts[i].szSubmount,FALSE,pUserName);
+ DEBUG_EVENT2("AFS DriveMap","Remote[%s]=%x",szPath,res);
+ if (strcmpi("all",List.aSubmounts[i].szSubmount)==0)
+ bMappedAll=TRUE;
+ }
+ }
+ if (!bMappedAll) //make sure all is mapped also
+ {
+ sprintf(szPath,"\\\\%s-afs\\all",szMachine);
+ NETRESOURCE nr;
+ memset (&nr, 0x00, sizeof(NETRESOURCE));
+ nr.dwType=RESOURCETYPE_DISK;
+ nr.lpLocalName="";
+ nr.lpRemoteName=szPath;
+ DWORD res=MountDOSDrive(0,"all",FALSE,pUserName);
+ DEBUG_EVENT2("AFS DriveMap","Remote[%s]=%x",szPath,res);
+ if (res==ERROR_SESSION_CREDENTIAL_CONFLICT)
+ {
+ DisMountDOSDrive("all");
+ MountDOSDrive(0,"all",FALSE,pUserName);
+ }
+ }
+ for (TCHAR chDrive = chDRIVE_A; chDrive <= chDRIVE_Z; ++chDrive)
+ {
+ if (List.aDriveMap[chDrive-chDRIVE_A].fActive)
+ {
+ DWORD res=MountDOSDrive(chDrive
+ ,List.aDriveMap[chDrive-chDRIVE_A].szSubmount
+ ,List.aDriveMap[chDrive-chDRIVE_A].fPersistent);
+ }
+ }
+ return TRUE;
+}
+
+BOOL GlobalMountDrive()
+{
+ char szDriveToMapTo[5];
+ DWORD dwResult;
+ char szKeyName[256];
+ HKEY hKey;
+ DWORD dwIndex = 0;
+ DWORD dwDriveSize;
+ DWORD dwSubMountSize;
+ char unsigned szSubMount[256];
+ char cm_HostName[200];
+ DWORD dwType=sizeof(cm_HostName);
+ if (!IsServiceActive())
+ return TRUE;
+ if (!GetComputerName(cm_HostName, &dwType))
+ return TRUE;
+ sprintf(szKeyName, "%s\\GlobalAutoMapper", sAFSConfigKeyName);
+
+ dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_QUERY_VALUE,
+ &hKey);
+ if (dwResult != ERROR_SUCCESS)
+ return TRUE;
+
+ while (1) {
+ dwDriveSize = sizeof(szDriveToMapTo);
+ dwSubMountSize = sizeof(szSubMount);
+ dwResult = RegEnumValue(hKey, dwIndex++, szDriveToMapTo, &dwDriveSize,
+ 0, &dwType, szSubMount, &dwSubMountSize);
+ if (dwResult != ERROR_MORE_DATA) {
+ if (dwResult != ERROR_SUCCESS) {
+ if (dwResult != ERROR_NO_MORE_ITEMS)
+ {
+ DEBUG_EVENT1("AFS DriveMap","Failed to read \GlobalAutoMapper values: %d",dwResult);
+ }
+ break;
+ }
+ }
+ dwResult=MountDOSDrive(*szDriveToMapTo,(const char *)szSubMount,FALSE);
+ }
+ RegCloseKey(hKey);
+ return TRUE;
+}
+
+DWORD MountDOSDrive(char chDrive,const char *szSubmount,BOOL bPersistent,const char * pUsername)
+{
+ TCHAR szPath[MAX_PATH];
+ TCHAR szClient[MAX_PATH];
+ TCHAR szDrive[3] = TEXT("?:");
+ sprintf(szDrive,"%c:",chDrive);
+ GetClientNetbiosName (szClient);
+ sprintf(szPath,"\\\\%s\\%s",szClient,szSubmount);
+ NETRESOURCE nr;
+ memset (&nr, 0x00, sizeof(NETRESOURCE));
+ nr.dwType=RESOURCETYPE_DISK;
+ nr.lpLocalName=szDrive;
+ nr.lpRemoteName=szPath;
+ nr.dwDisplayType = RESOURCEDISPLAYTYPE_GENERIC;
+ nr.dwDisplayType = RESOURCEDISPLAYTYPE_SHARE;
+ DWORD res=WNetAddConnection2(&nr,NULL,pUsername,(bPersistent)?CONNECT_UPDATE_PROFILE:0);
+ DEBUG_EVENT3("AFS DriveMap","Mount %s Remote[%s]=%x",(bPersistent)?"Persistant" : "NonPresistant",szPath,res);
+ return res;
+}
+
+DWORD DisMountDOSDriveFull(const char *szPath,BOOL bForce)
+{
+ DWORD res=WNetCancelConnection(szPath,bForce);
+ DEBUG_EVENT2("AFS DriveMap","Dismount Remote[%s]=%x",szPath,res);
+ return (res==ERROR_NOT_CONNECTED)?NO_ERROR:res;
+}
+
+DWORD DisMountDOSDrive(const char *pSubmount,BOOL bForce)
+{
+ TCHAR szPath[MAX_PATH];
+ TCHAR szClient[MAX_PATH];
+ GetClientNetbiosName (szClient);
+ sprintf(szPath,"\\\\%s\\%s",szClient,pSubmount);
+ return DisMountDOSDriveFull(szPath,bForce);
+}
+
+
+DWORD DisMountDOSDrive(const char chDrive,BOOL bForce)
+{
+ TCHAR szPath[MAX_PATH];
+ sprintf(szPath,"%c:",chDrive);
+ return DisMountDOSDriveFull(szPath,bForce);
+}
BOOL SubmountToPath (PDRIVEMAPLIST pList, LPTSTR pszPath, LPTSTR pszSubmount, BOOL fMarkInUse);
BOOL PathToSubmount (LPTSTR pszSubmount, LPTSTR pszMapping, LPTSTR pszSubmountReq, ULONG *pStatus);
+BOOL TestAndDoMapShare(DWORD);
+BOOL DoMapShare();
+void MapShareName(char *);
+void DoUnMapShare(BOOL);
+BOOL DoMapShareChange();
+DWORD RWLogonOption(BOOL read,DWORD value);
+BOOL GlobalMountDrive();
+DWORD MountDOSDrive(char chDrive,const char *szSubmount,BOOL bPresistant=TRUE,const char *puser=NULL);
+DWORD DisMountDOSDrive(const char *szSubmount,BOOL bForce=TRUE);
+DWORD DisMountDOSDrive(char chDrive,BOOL bForce=TRUE);
+DWORD DisMountDOSDriveFull(const char *pPath,BOOL bForce=TRUE);
+#ifndef DRIVEMAP_DEF_H
+extern void TestAndDoUnMapShare();
+extern TCHAR pUserName[];
+extern BOOL fUserName;
+extern DWORD RWLogonOption(BOOL read,DWORD value);
+extern void SetBitLogonOption(BOOL set,DWORD value);
+extern BOOL TestAndDoMapShare(DWORD);
+#endif
#endif
CAPTION "Miscellaneous Configuration"
FONT 8, "MS Sans Serif"
BEGIN
- EDITTEXT IDC_LAN_ADAPTER,90,20,32,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_LAN_ADAPTER,162,22,32,13,ES_AUTOHSCROLL
EDITTEXT IDC_PROBE,90,40,32,13,ES_AUTOHSCROLL
EDITTEXT IDC_THREADS,90,60,32,13,ES_AUTOHSCROLL
EDITTEXT IDC_DAEMONS,90,80,32,13,ES_AUTOHSCROLL
LTEXT "threads",IDC_STATIC,138,82,68,8
LTEXT "S&ystem Name:",IDC_STATIC,15,102,71,8
LTEXT "&Mount Directory:",IDC_STATIC,15,122,71,8
- LTEXT "&Lan Adapter Number:",IDC_STATIC,15,22,71,8
LTEXT "&Root Volume:",IDC_STATIC,15,141,71,8
+ CONTROL "Automatic Lana scan",IDC_AUTOLANA,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,19,22,82,10
+ RTEXT "Lana Number:",IDC_STATICLANA,106,24,53,8
END
IDD_DIAG_PARMS DIALOG DISCARDABLE 0, 0, 217, 135
#define IDC_CHANGE 1059
#define IDC_DIAG_PARMS 1060
#define IDC_ROOTVOLUME 1061
+#define IDC_AUTOLANA 1062
+#define IDC_STATICLANA 1063
#define IDC_STATIC -1
// Next default values for new objects
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 122
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1062
+#define _APS_NEXT_CONTROL_VALUE 1064
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
FreeDriveMapList (&g.Configuration.NetDrives);
QueryDriveMapList (&g.Configuration.NetDrives);
+ if (g.Configuration.fLogonAuthent)
+ DoMapShareChange();
}
}
}
+// Action - On Remove submount item
void Submounts_OnRemove (HWND hDlg)
{
}
+// Action - On Add or On Edit a submount item
void Submounts_EditSubmount (HWND hDlg, PSUBMOUNT pSubmount)
{
HWND hList = GetDlgItem (hDlg, IDC_LIST);
extern "C" {
#include <afs/param.h>
#include <afs/stds.h>
+#include <rx/rxkad.h>
}
#include "afs_config.h"
#include "tab_hosts.h"
#include "tab_advanced.h"
+#include "drivemap.h"
+#include <adssts.h>
/*
* VARIABLES __________________________________________________________________
BOOL CALLBACK Status_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp);
void Status_OnRefresh (HWND hDlg);
-
/*
* ROUTINES ___________________________________________________________________
*
return TRUE;
}
-
BOOL GeneralTab_OnApply (HWND hDlg, BOOL fForce, BOOL fComplainIfInvalid)
{
if (!fForce)
BOOL fLogonAuthent = IsDlgButtonChecked (hDlg, IDC_LOGON);
if (fLogonAuthent != g.Configuration.fLogonAuthent)
{
- if (!Config_SetAuthentFlag (fLogonAuthent))
- return FALSE;
+ SetBitLogonOption(fLogonAuthent,LOGON_OPTION_INTEGRATED);
g.Configuration.fLogonAuthent = fLogonAuthent;
}
Config_GetGatewayName (g.Configuration.szGateway);
Config_GetCellName (g.Configuration.szCell);
- Config_GetAuthentFlag (&g.Configuration.fLogonAuthent);
+ g.Configuration.fLogonAuthent=RWLogonOption(TRUE,LOGON_OPTION_INTEGRATED);
Config_GetTrayIconFlag (&g.Configuration.fShowTrayIcon);
if (!g.fIsWinNT)
{
DWORD CurrentState = Config_GetServiceState();
DWORD DisplayState = GeneralTab_GetDisplayState(hDlg);
+ TestAndDoMapShare(CurrentState); //Re map mounted drives if necessary
BOOL fInEndState = ((CurrentState == SERVICE_RUNNING) || (CurrentState == SERVICE_STOPPED));
if (fInEndState && l.hStatus)
{
g.fNeedRestart = FALSE;
if (StartService (hService, 0, 0))
+ TestAndDoMapShare(SERVICE_START_PENDING);
fSuccess = TRUE;
}
else // (!fStart)
SERVICE_STATUS Status;
if (ControlService (hService, SERVICE_CONTROL_STOP, &Status))
fSuccess = TRUE;
+ if (g.Configuration.fLogonAuthent)
+ DoUnMapShare(FALSE);
}
CloseServiceHandle (hService);
AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I ..\afsd
# include the primary makefile
-
!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
!INCLUDE ..\..\config\NTMakefile.version
DWORD dwSize = sizeof(Config);
QueryServiceConfig (hService, (QUERY_SERVICE_CONFIG*)&Config, sizeof(Config), &dwSize);
QueryServiceStatus (hService, &Status);
+ TestAndDoMapShare(Status.dwCurrentState);
CloseServiceHandle (hService);
}
GetString (szStatus, IDS_SERVICE_STARTING);
else
GetString (szStatus, IDS_SERVICE_UNKNOWN);
+ TestAndDoMapShare(Status.dwCurrentState);
SetDlgItemText (hDlg, IDC_SERVICE_STATUS, szStatus);
if (fFinal && GetWindowLong (hDlg, DWL_USER))
case IDC_SERVICE_START:
if (StartService (hService, 0, 0))
+ {
+ TestAndDoMapShare(SERVICE_START_PENDING);
fSuccess = TRUE;
+ }
break;
case IDC_SERVICE_STOP:
SERVICE_STATUS Status;
- if (ControlService (hService, SERVICE_CONTROL_STOP, &Status))
- fSuccess = TRUE;
+ TestAndDoUnMapShare();
+ ControlService (hService, SERVICE_CONTROL_STOP, &Status);
+ fSuccess = TRUE;
break;
}
SC_HANDLE hService;
if ((hService = OpenService (hManager, TEXT("TransarcAFSDaemon"), SERVICE_ALL_ACCESS)) != NULL)
{
- StartService (hService, 0, 0);
+ if (StartService (hService, 0, 0))
+ TestAndDoMapShare(SERVICE_START_PENDING);
CloseServiceHandle (hService);
}
{
QueryServiceStatus (hService, &Status);
CloseServiceHandle (hService);
+ TestAndDoMapShare(Status.dwCurrentState);
}
CloseServiceHandle (hManager);
#include "afscreds.h"
#include "..\afsreg\afsreg.h" // So we can see if the server's installed
-
+#include "drivemap.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <osilog.h>
+#include "rxkad.h"
/*
* DEFINITIONS ________________________________________________________________
return 0;
}
+#define ISHIGHSECURITY(v) ( ((v) & LOGON_OPTION_HIGHSECURITY)==LOGON_OPTION_HIGHSECURITY)
+#define REG_CLIENT_PROVIDER_KEY "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\NetworkProvider"
BOOL InitApp (LPSTR pszCmdLineA)
{
case 'U':
fUninstall = TRUE;
break;
+ case ':':
+ MapShareName(pszCmdLineA);
+ break;
+ case 'x':
+ case 'X':
+ DWORD LogonOption;
+ DWORD LSPtype, LSPsize;
+ HKEY NPKey;
+ LSPsize=sizeof(LogonOption);
+ (void) RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_CLIENT_PROVIDER_KEY,
+ 0, KEY_QUERY_VALUE, &NPKey);
+ RegQueryValueEx(NPKey, "LogonOptions", NULL,
+ &LSPtype, (LPBYTE)&LogonOption, &LSPsize);
+ RegCloseKey (NPKey);
+ if (ISHIGHSECURITY(LogonOption))
+ DoMapShare();
+ GlobalMountDrive();
+ return 0;
}
while (*pszCmdLineA && (*pszCmdLineA != ' '))
++pszCmdLineA;
+ if (*pszCmdLineA==' ') ++pszCmdLineA;
}
if (fInstall)
osi_LogPrint @58
osi_LogSaveString @59
osi_InitPanic @60
+ osi_InitTraceOption @61
+ osi_LogEvent0 @62
+ osi_LogEvent @63
if (logp)
logp->enabled = 0;
}
+
+#define REG_CLIENT_PARMS_KEY "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"
+#define TRACE_OPTION_EVENT 1
+#define ISLOGONTRACE(v) ( ((v) & TRACE_OPTION_EVENT)==TRACE_OPTION_EVENT)
+
+DWORD osi_TraceOption=0;
+
+void osi_InitTraceOption()
+{
+ DWORD LSPtype, LSPsize;
+ HKEY NPKey;
+ (void) RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_CLIENT_PARMS_KEY,
+ 0, KEY_QUERY_VALUE, &NPKey);
+ LSPsize=sizeof(osi_TraceOption);
+ RegQueryValueEx(NPKey, "TraceOption", NULL,
+ &LSPtype, (LPBYTE)&osi_TraceOption, &LSPsize);\r
+}
+
+
+#define MAXBUF_ 131
+void osi_LogEvent0(char *a,char *b)
+{
+ HANDLE h; char *ptbuf[1],buf[MAXBUF_+1];
+ if (!ISLOGONTRACE(osi_TraceOption))
+ return;
+ h = RegisterEventSource(NULL, a);
+ ptbuf[0] = b;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);
+ DeregisterEventSource(h);
+}
+
+
+void osi_LogEvent(char *a,char *b,char *c,...)
+{
+ HANDLE h; char *ptbuf[1],buf[MAXBUF_+1];
+ va_list marker;
+ if (!ISLOGONTRACE(osi_TraceOption))
+ return;
+ if (b)
+ {
+ wsprintf(buf,a,b);
+ h = RegisterEventSource(NULL, buf);
+ }
+ else
+ h = RegisterEventSource(NULL, a);
+ va_start(marker,c);
+ _vsnprintf(buf,MAXBUF_,c,marker);
+ ptbuf[0] = buf;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);\
+ DeregisterEventSource(h);
+ va_end(marker);
+}
*
*/
-/* Copyright (C) 1994 Cazamar Systems, Inc. */
-
#ifndef _OSI_LOG_H__
#define _OSI_LOG_H__ 1
extern void osi_LogPrint(osi_log_t *logp, FILE_HANDLE handle);
extern char *osi_LogSaveString(osi_log_t *logp, char *s);
+extern void osi_InitTraceOption();
+extern void osi_LogEvent0(char *a,char *b);
+extern void osi_LogEvent(char *a,char *b,char *c,...);
/* define macros */
#define osi_Log0(l,f) osi_LogAdd((l), (f), 0, 0, 0, 0)
#define osi_Log3(l,f,a,b,c) osi_LogAdd((l), (f), (long) (a), (long) (b), (long) (c), 0)
#define osi_Log4(l,f,a,b,c,d) osi_LogAdd((l), (f), (long) (a), (long) (b), (long) (c), (long) (d))
+#ifdef DEBUG_VERBOSE
+#define DEBUG_EVENT1(a,b,c) {HANDLE h; char *ptbuf[1],buf[132];\
+ h = RegisterEventSource(NULL, a);\
+ sprintf(buf, b,c);\
+ ptbuf[0] = buf;\
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);\
+ DeregisterEventSource(h);}
+#define DEBUG_EVENT0(a) {HANDLE h; char *ptbuf[1];\
+ h = RegisterEventSource(NULL, a);\
+ ptbuf[0] = "";\
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0,(const char **) ptbuf, NULL);\
+ DeregisterEventSource(h);}
+#define DEBUG_EVENT2(a,b,c,d) {HANDLE h; char *ptbuf[1],buf[132];\
+ h = RegisterEventSource(NULL, a);\
+ sprintf(buf, b,c,d);\
+ ptbuf[0] = buf;\
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0,(const char **) ptbuf, NULL);\
+ DeregisterEventSource(h);}
+#define DEBUG_EVENT3(a,b,c,d,e) {HANDLE h; char *ptbuf[1],buf[132];\
+ h = RegisterEventSource(NULL, a);\
+ sprintf(buf, b,c,d,e);\
+ ptbuf[0] = buf;\
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0,(const char **)ptbuf, NULL);\
+ DeregisterEventSource(h);}
+#define DEBUG_EVENT4(a,b,c,d,e,f) {HANDLE h; char *ptbuf[1],buf[132];\
+ h = RegisterEventSource(NULL, a);\
+ sprintf(buf, b,c,d,e,f);\
+ ptbuf[0] = buf;\
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0,(const char **) ptbuf, NULL);\
+ DeregisterEventSource(h);}
+#define DEBUG_EVENT5(a,b,c,d,e,f,g) {HANDLE h; char *ptbuf[1],buf[132];\
+ h = RegisterEventSource(NULL, a);\
+ sprintf(buf, b,c,d,e,f,g);\
+ ptbuf[0] = buf;\
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0,(const char **) ptbuf, NULL);\
+ DeregisterEventSource(h);}
+#define DEBUG_EVENT6(a,b,c,d,e,f,g,h) {HANDLE h; char *ptbuf[1],buf[132];\
+ h = RegisterEventSource(NULL, a);\
+ sprintf(buf,b,c,d,e,f,g,h);\
+ ptbuf[0] = buf;\
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0,(const char **) ptbuf, NULL);\
+ DeregisterEventSource(h);}
+#else
+#define DEBUG_EVENT0(a)
+#define DEBUG_EVENT1(a,b,c)
+#define DEBUG_EVENT2(a,b,c,d)
+#define DEBUG_EVENT3(a,b,c,d,e)
+#define DEBUG_EVENT4(a,b,c,d,e,f)
+#define DEBUG_EVENT5(a,b,c,d,e,f,g)
+#define DEBUG_EVENT6(a,b,c,d,e,f,g,h)
+#endif
+
#endif /* _OSI_LOG_H__ */
---Comment---=
(Default)=S,
Class=N,2
+LogonOptions=N,0
Name=S,TransarcAFSDaemon
+LogonScript=S,<TARGETDIR>\Client\Program\afscreds.exe -:%s -x
ProviderPath=S,<LOGON_DLL>
AuthentProviderPath=S,<LOGON_DLL>
echo file0=%IS5_DEST%\root.client\usr\vice\etc\afs_config.exe >> Client_Common_Files.fgl
echo file1=%IS5_DEST%\lib\afsrpc.dll >> Client_Common_Files.fgl
echo file2=%IS5_DEST%\lib\afsauthent.dll >> Client_Common_Files.fgl
-echo file3=%IS5_DEST%\lib\pthread.dll >> Client_Common_Files.fgl
+echo file3=%IS5_DEST%\lib\afspthread.dll >> Client_Common_Files.fgl
echo file4=%IS5_DEST%\root.server\usr\afs\bin\afsprocmgmt.dll >> Client_Common_Files.fgl
echo file5=%IS5_DEST%\root.server\usr\afs\bin\TaAfsAppLib.dll >> Client_Common_Files.fgl
echo file6=%IS5_DEST%\root.server\usr\afs\bin\afsadminutil.dll >> Client_Common_Files.fgl
echo file0=%IS5_DEST%\root.client\usr\vice\etc\afs_config.exe >> Light_Client_Common_Files.fgl
echo file1=%IS5_DEST%\lib\afsrpc.dll >> Light_Client_Common_Files.fgl
echo file2=%IS5_DEST%\lib\afsauthent.dll >> Light_Client_Common_Files.fgl
-echo file3=%IS5_DEST%\lib\pthread.dll >> Light_Client_Common_Files.fgl
+echo file3=%IS5_DEST%\lib\afspthread.dll >> Light_Client_Common_Files.fgl
echo file4=%IS5_DEST%\root.server\usr\afs\bin\afsprocmgmt.dll >> Light_Client_Common_Files.fgl
echo file5=%IS5_DEST%\root.server\usr\afs\bin\TaAfsAppLib.dll >> Light_Client_Common_Files.fgl
echo file6=%IS5_DEST%\root.server\usr\afs\bin\afsadminutil.dll >> Light_Client_Common_Files.fgl
echo file0=%IS5_DEST%\root.client\usr\vice\etc\afs_config.exe >> Light95_Client_Common_Files.fgl
echo file1=%IS5_DEST%\lib\afsrpc.dll >> Light95_Client_Common_Files.fgl
echo file2=%IS5_DEST%\lib\afsauthent.dll >> Light95_Client_Common_Files.fgl
-echo file3=%IS5_DEST%\lib\win95\pthread.dll >> Light95_Client_Common_Files.fgl
+echo file3=%IS5_DEST%\lib\win95\afspthread.dll >> Light95_Client_Common_Files.fgl
echo file4=%IS5_DEST%\root.server\usr\afs\bin\TaAfsAppLib.dll >> Light95_Client_Common_Files.fgl
echo file5=%IS5_DEST%\root.server\usr\afs\bin\afsadminutil.dll >> Light95_Client_Common_Files.fgl
echo file6=%IS5_DEST%\root.server\usr\afs\bin\afsclientadmin.dll >> Light95_Client_Common_Files.fgl
echo file6=%IS5_DEST%\root.server\usr\afs\bin\afsadminutil.dll >> Server_Common_Files.fgl
echo file7=%IS5_DEST%\lib\afsrpc.dll >> Server_Common_Files.fgl
echo file8=%IS5_DEST%\lib\afsauthent.dll >> Server_Common_Files.fgl
-echo file9=%IS5_DEST%\lib\pthread.dll >> Server_Common_Files.fgl
+echo file9=%IS5_DEST%\lib\afspthread.dll >> Server_Common_Files.fgl
echo file10=%IS5_DEST%\root.server\usr\afs\bin\TaAfsAppLib.dll >> Server_Common_Files.fgl
echo file11=%IS5_DEST%\root.server\usr\afs\bin\afsprocmgmt.dll >> Server_Common_Files.fgl
echo. >> Server_Common_Files.fgl
echo file6=%IS5_DEST%\root.server\usr\afs\bin\afsadminutil.dll >> Control_Center_Common_Files.fgl
echo file7=%IS5_DEST%\lib\afsrpc.dll >> Control_Center_Common_Files.fgl
echo file8=%IS5_DEST%\lib\afsauthent.dll >> Control_Center_Common_Files.fgl
-echo file9=%IS5_DEST%\lib\pthread.dll >> Control_Center_Common_Files.fgl
+echo file9=%IS5_DEST%\lib\afspthread.dll >> Control_Center_Common_Files.fgl
echo file10=%IS5_DEST%\root.server\usr\afs\bin\TaAfsAppLib.dll >> Control_Center_Common_Files.fgl
echo file11=%IS5_DEST%\root.client\usr\vice\etc\afs_config.exe >> Control_Center_Common_Files.fgl
echo. >> Control_Center_Common_Files.fgl
$(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] Comments=$(AFSBUILDCOMMENTS)"
$(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] ApplicationName=AFSforWindows"
$(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] Company=Open AFS"
- $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] Title=AFS for Windows"
+ $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] Title=Open AFS for Windows"
$(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] OutputSpec="$(DESTDIR)\WinInstall\PackageWeb\AFSforWindows.exe"
! ENDIF
CreateISDirTree.bat
$(DEL) /q $(DESTDIR)\Wininstall\PackageWeb\*.*
$(ISWEB)\Pftwwiz.exe $(AFSROOT)\src\winnt\install\InstallShield5\PackageWeb.pfw -s -a
!ENDIF
- xcopy/s/e/y "Media\Transarc AFS\Disk Images\disk1\*.*" $(DESTDIR)\WinInstall
+ xcopy /s/e/y "Media\OpenAFS\Disk Images\disk1\*.*" $(DESTDIR)\WinInstall
copy AFS_component_version_number.txt $(DESTDIR)\WinInstall\Version.txt
- $(DEL) /q "Media\Transarc AFS\Disk Images\disk1\*.*"
+ $(DEL) /q "Media\OpenAFS\Disk Images\disk1\*.*"
install: prep build
Version=2.0
[Options]
-Title=AFS for Windows
-Company=Open AFS
-CompanyEMail=
-BasePath=.\Media\Transarc AFS\Disk Images
-ImportPath=.\Media\Transarc AFS
+Title=OpenAFS for Windows
+Company=OpenAFS
+CompanyEMail=openafs-info@openafs.org
+BasePath=.\Media\OpenAFS\Disk Images
+ImportPath=.\Media\OpenAFS
UseRTF=0
SaveFiles=0
SubFolders=1
ApplicationName=AFSforWindows
Description=
-Comments=Build:09/05/01 09:41 CellServDB:CellServDB.IBM_Internal
+Comments=Build:11/07/01 10:26 CellServDB:
Notice=
-Version=1.1.1 a
-OutputSpec=W:\DEST\WinInstall\PackageWeb\AFSforWindows.exe
+Version=1.2.2 a
+OutputSpec=Y:\DEST\WinInstall\PackageWeb\AFSforWindows.exe
GUIDs=0
Type=2
Compress=1
[File 1]
Name=_ISDel.exe
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=589825
Disk=0
[File 2]
Name=Setup.exe
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=589825
Disk=0
[File 3]
Name=_inst32i.ex_
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=524289
Disk=0
[File 4]
Name=os.dat
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=1
Disk=0
[File 5]
Name=lang.dat
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=1
Disk=0
[File 6]
Name=_Setup.dll
-Path=.\Media\Transarc AFS\Disk Images\Disk1\setupdir\0009\
+Path=.\Media\OpenAFS\Disk Images\Disk1\setupdir\0009\
Flags=655377
Disk=0
[File 7]
Name=_Setup.dll
-Path=.\Media\Transarc AFS\Disk Images\Disk1\setupdir\0416\
+Path=.\Media\OpenAFS\Disk Images\Disk1\setupdir\0416\
Flags=655377
Disk=0
[File 8]
Name=_Setup.dll
-Path=.\Media\Transarc AFS\Disk Images\Disk1\setupdir\0804\
+Path=.\Media\OpenAFS\Disk Images\Disk1\setupdir\0804\
Flags=655377
Disk=0
[File 9]
Name=_Setup.dll
-Path=.\Media\Transarc AFS\Disk Images\Disk1\setupdir\0404\
+Path=.\Media\OpenAFS\Disk Images\Disk1\setupdir\0404\
Flags=655377
Disk=0
[File 10]
Name=_Setup.dll
-Path=.\Media\Transarc AFS\Disk Images\Disk1\setupdir\0007\
+Path=.\Media\OpenAFS\Disk Images\Disk1\setupdir\0007\
Flags=655377
Disk=0
[File 11]
Name=_Setup.dll
-Path=.\Media\Transarc AFS\Disk Images\Disk1\setupdir\0011\
+Path=.\Media\OpenAFS\Disk Images\Disk1\setupdir\0011\
Flags=655377
Disk=0
[File 12]
Name=_Setup.dll
-Path=.\Media\Transarc AFS\Disk Images\Disk1\setupdir\0012\
+Path=.\Media\OpenAFS\Disk Images\Disk1\setupdir\0012\
Flags=655377
Disk=0
[File 13]
Name=_Setup.dll
-Path=.\Media\Transarc AFS\Disk Images\Disk1\setupdir\000a\
+Path=.\Media\OpenAFS\Disk Images\Disk1\setupdir\000a\
Flags=655377
Disk=0
[File 14]
Name=setup.ins
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=1
Disk=0
[File 15]
Name=_sys1.hdr
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=2097153
Disk=0
[File 16]
Name=_sys1.cab
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=2097153
Disk=0
[File 17]
Name=_user1.hdr
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=2097153
Disk=0
[File 18]
Name=_user1.cab
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=2097153
Disk=0
[File 19]
Name=DATA.TAG
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=1
Disk=0
[File 20]
Name=SETUP.INI
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=1
Disk=0
[File 21]
Name=setup.lid
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=1
Disk=0
[File 22]
Name=setup.bmp
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=1
Disk=0
[File 23]
Name=data1.hdr
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=2097153
Disk=0
[File 24]
Name=data1.cab
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=2097153
Disk=0
[File 25]
Name=layout.bin
-Path=.\Media\Transarc AFS\Disk Images\Disk1\
+Path=.\Media\OpenAFS\Disk Images\Disk1\
Flags=1
Disk=0
[File 26]
Name=en_US.rtf
-Path=.\Media\Transarc AFS\Disk Images\Disk1\License\
+Path=.\Media\OpenAFS\Disk Images\Disk1\License\
Flags=1
Disk=0
[File 27]
Name=ja_JP.rtf
-Path=.\Media\Transarc AFS\Disk Images\Disk1\License\
+Path=.\Media\OpenAFS\Disk Images\Disk1\License\
Flags=1
Disk=0
[File 28]
Name=ko_KR.rtf
-Path=.\Media\Transarc AFS\Disk Images\Disk1\License\
+Path=.\Media\OpenAFS\Disk Images\Disk1\License\
Flags=1
Disk=0
[File 29]
Name=zh_CN.rtf
-Path=.\Media\Transarc AFS\Disk Images\Disk1\License\
+Path=.\Media\OpenAFS\Disk Images\Disk1\License\
Flags=1
Disk=0
[File 30]
Name=zh_TW.rtf
-Path=.\Media\Transarc AFS\Disk Images\Disk1\License\
+Path=.\Media\OpenAFS\Disk Images\Disk1\License\
Flags=1
Disk=0
[File 31]
Name=pt_BR.rtf
-Path=.\Media\Transarc AFS\Disk Images\Disk1\License\
+Path=.\Media\OpenAFS\Disk Images\Disk1\License\
Flags=1
Disk=0
[File 32]
Name=es_ES.rtf
-Path=.\Media\Transarc AFS\Disk Images\Disk1\License\
+Path=.\Media\OpenAFS\Disk Images\Disk1\License\
Flags=1
Disk=0
[File 33]
Name=de_DE.rtf
-Path=.\Media\Transarc AFS\Disk Images\Disk1\License\
+Path=.\Media\OpenAFS\Disk Images\Disk1\License\
Flags=1
Disk=0
szErrMsg=" ";
Enable (STATUS);
SetStatusWindow (50, "Now Downloading CellServDB file...");
+ CreateDir(TARGETDIR);
nResult=GetWebPage(szErrMsg,szDestFile,szDefaultWeb);
SetStatusWindow (100, "Downloading completed.");
Delay (2);
############################################################################
COMPONENTS = \
- INSTALL.BAT \
afsd.pif \
readme.RTF \
- license.txt \
- templet.reg \
- runonce.pif \
$(DESTDIR)\bin\util_cr.exe \
$(DESTDIR)\root.client\usr\vice\etc\unlog.exe \
- $(DESTDIR)\root.client\usr\vice\etc\afs_shl_ext_1033.dll \
- $(DESTDIR)\lib\afsauthent.dll \
$(DESTDIR)\root.client\usr\vice\etc\afsshare.exe \
$(DESTDIR)\root.client\usr\vice\etc\fs.exe \
$(DESTDIR)\root.client\usr\vice\etc\klog.exe \
$(DESTDIR)\bin\kpasswd.exe \
+ $(DESTDIR)\bin\pts.exe \
+ $(DESTDIR)\root.client\usr\vice\etc\tokens.exe
+
+DLLCOMPONENTS = \
+ $(DESTDIR)\root.client\usr\vice\etc\afs_shl_ext_1033.dll \
+ $(DESTDIR)\lib\afsauthent.dll \
$(DESTDIR)\root.client\usr\vice\etc\libosi.dll \
$(DESTDIR)\root.client\usr\vice\etc\libafsconf.dll \
- $(DESTDIR)\bin\pts.exe \
- $(DESTDIR)\root.client\usr\vice\etc\tokens.exe \
$(DESTDIR)\root.client\usr\vice\etc\afs_shl_ext.dll \
- $(DESTDIR)\lib\win95\pthread.dll \
+ $(DESTDIR)\lib\win95\afspthread.dll \
$(DESTDIR)\lib\afsrpc.dll
$(COMPONENTS)::
$(DESTDIR)\bin\util_cr.exe ~ $@
$(COPY) $@ $(DESTDIR)\WinInstall\.
+$(DLLCOMPONENTS)::
+ $(DESTDIR)\bin\util_cr.exe ~ $@
+ $(COPY) $@ $(DESTDIR)\WinInstall\Dll\.
+
!IF (EXIST(ISBUILD.MAK))
!INCLUDE ISBUILD.MAK
!ENDIF
build:
- copy install.bat $(OUTDIR)\.
-install: prep $(COMPONENTS) build
+install: prep $(COMPONENTS) $(DLLCOMPONENTS) build
install9x: install
$(DEL) $(OUTDIR)\DiskIm~1\WebInstall\*
prep :
+ $(COPY) "$(DESTDIR)\WinInstall\config\sock.vxd" "$(DESTDIR)\WinInstall\."
+ $(COPY) "$(DESTDIR)\WinInstall\config\MMAP.vxd" "$(DESTDIR)\WinInstall\."
+ $(COPY) "$(DESTDIR)\WinInstall\config\AFSD.EXE" "$(DESTDIR)\WinInstall\."
$(DESTDIR)\bin\util_cr.exe ~ "$(DESTDIR)\WinInstall\sock.vxd"
$(DESTDIR)\bin\util_cr.exe ~ "$(DESTDIR)\WinInstall\MMAP.vxd"
$(DESTDIR)\bin\util_cr.exe ~ "$(DESTDIR)\WinInstall\AFSD.EXE"
$(DESTDIR)\include\pthread.h
############################################################################
-# Build standard pthread.dll
+# Build standard afspthread.dll
-PTHR_DLLFILE = $(DESTDIR)\lib\pthread.dll
+PTHR_DLLFILE = $(DESTDIR)\lib\afspthread.dll
PTHR_DLLOBJS = \
pthread.obj \
$(DLLPREP)
############################################################################
-# Build Windows 95 version of pthread.dll
+# Build Windows 95 version of afspthread.dll
-PTHR95_DLLFILE = $(DESTDIR)\lib\win95\pthread.dll
+PTHR95_DLLFILE = $(DESTDIR)\lib\win95\afspthread.dll
PTHR95_DLLOBJS = \
pthread_95.obj \
test tests: ptest.exe tsd.exe native.exe
-ptest.exe: ptest.obj $(DESTDIR)/lib/pthread.lib $(DESTDIR)/lib/afs/afsutil.lib
+ptest.exe: ptest.obj $(DESTDIR)/lib/afspthread.lib $(DESTDIR)/lib/afs/afsutil.lib
$(EXECONLINK)
-tsd.exe: tsd.obj $(DESTDIR)/lib/pthread.lib $(DESTDIR)/lib/afs/afsutil.lib
+tsd.exe: tsd.obj $(DESTDIR)/lib/afspthread.lib $(DESTDIR)/lib/afs/afsutil.lib
$(EXECONLINK)
-native.exe: native.obj $(DESTDIR)/lib/pthread.lib $(DESTDIR)/lib/afs/afsutil.lib
+native.exe: native.obj $(DESTDIR)/lib/afspthread.lib $(DESTDIR)/lib/afs/afsutil.lib
$(EXECONLINK)
m_wParam=wp;
m_sMsg=msg;
SetEvent(CMyUIThread::m_hEventThreadKilled);
- m_uNntifyMessage=0;
+ m_uNotifyMessage=0;
break;
default:
break;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_module.c,v 1.1.1.4 2001/09/11 14:24:54 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_module.c,v 1.1.1.5 2002/01/22 19:48:05 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
return KERN_SUCCESS;
}
-KMOD_EXPLICIT_DECL(openafs, VERSION, afs_modload, afs_modunload)
+KMOD_EXPLICIT_DECL(org.openafs.filesystems.afs, VERSION, afs_modload, afs_modunload)
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_sleep.c,v 1.1.1.3 2001/07/14 22:20:02 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_sleep.c,v 1.1.1.4 2002/01/22 19:48:05 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
seq = evp->seq;
while (seq == evp->seq) {
AFS_ASSERT_GLOCK();
- assert_wait((event_t)event, 0);
AFS_GUNLOCK();
+#ifdef AFS_DARWIN14_ENV
+ /* this is probably safe for all versions, but testing is hard */
+ sleep(event, PVFS);
+#else
+ assert_wait((event_t)event, 0);
thread_block(0);
+#endif
AFS_GLOCK();
}
relevent(evp);
int code = 0;
struct afs_event *evp;
int ticks,seq;
+ int prio;
ticks = ( ams * afs_hz )/1000;
evp = afs_getevent(event);
seq=evp->seq;
- assert_wait((event_t)event, aintok ? THREAD_ABORTSAFE : 0);
AFS_GUNLOCK();
+#ifdef AFS_DARWIN14_ENV
+ /* this is probably safe for all versions, but testing is hard. */
+ /* using tsleep instead of assert_wait/thread_set_timer/thread_block
+ allows shutdown to work in 1.4 */
+ /* lack of PCATCH does *not* prevent signal delivery, neither does
+ a low priority. We would need to deal with ERESTART here if we
+ wanted to mess with p->p_sigmask, and messing with p_sigignore is
+ not the way to go.... (someone correct me if I'm wrong)
+ */
+ if (aintok)
+ prio=PCATCH|PPAUSE;
+ else
+ prio=PVFS;
+ code=tsleep(event, prio, "afs_osi_TimedSleep", ticks);
+#else
+ assert_wait((event_t)event, aintok ? THREAD_ABORTSAFE : THREAD_UNINT);
thread_set_timer(ticks, NSEC_PER_SEC / hz);
thread_block(0);
+ code=0;
+#endif
AFS_GLOCK();
-#if 0 /* thread_t structure only available if MACH_KERNEL_PRIVATE */
- if (current_thread()->wait_result != THREAD_AWAKENED)
- code = EINTR;
-#else
if (seq == evp->seq)
code = EINTR;
-#endif
relevent(evp);
return code;
evp = afs_getevent(event);
if (evp->refcount > 1) {
evp->seq++;
+#ifdef AFS_DARWIN14_ENV
+ /* this is probably safe for all versions, but testing is hard. */
+ wakeup(event);
+#else
thread_wakeup((event_t)event);
+#endif
}
relevent(evp);
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vm.c,v 1.1.1.3 2001/07/14 22:20:02 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vm.c,v 1.1.1.4 2002/01/22 19:48:05 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
int *slept;
{
struct vnode *vp=(struct vnode *)avc;
+#ifdef AFS_DARWIN14_ENV
+ if (UBCINFOEXISTS(vp))
+ return EBUSY;
+#endif
if (avc->vrefCount)
return EBUSY;
AFS_GUNLOCK();
cache_purge(vp);
+#ifndef AFS_DARWIN14_ENV
if (UBCINFOEXISTS(vp))
{
ubc_clean(vp, 1);
ubc_release(vp);
ubc_info_free(vp);
}
+#endif
AFS_GLOCK();
AFS_RELE(vp);
return;
}
+#ifdef AFS_DARWIN14_ENV
+ if (vp->v_ubcinfo->ui_refcount > 1) {
+ simple_unlock(&vp->v_interlock);
+ AFS_RELE(vp);
+ return;
+ }
+#else
if (vp->v_ubcinfo->ui_holdcnt) {
simple_unlock(&vp->v_interlock);
AFS_RELE(vp);
return;
}
+#endif
if (slept && ubc_issetflags(vp, UI_WASMAPPED)) {
/* We can't possibly release this in time for this NewVCache to get it */
simple_unlock(&vp->v_interlock);
obj=0;
if (ubc_issetflags(vp, UI_WASMAPPED)) {
simple_unlock(&vp->v_interlock);
+#ifdef AFS_DARWIN14_ENV
+ ubc_release_named(vp);
+#else
ubc_release(vp);
+#endif
if (ubc_issetflags(vp, UI_HASOBJREF))
printf("ubc_release didn't release the reference?!\n");
} else if (!vn_lock(vp, LK_EXCLUSIVE|LK_INTERLOCK,current_proc())) {
-#ifdef UBC_NOREACTIVATE
+#ifdef AFS_DARWIN14_ENV
+ obj = ubc_getobject(vp,UBC_HOLDOBJECT);
+#else
+#ifdef AFS_DARWIN13_ENV
obj = ubc_getobject(vp,(UBC_NOREACTIVATE|UBC_HOLDOBJECT));
#else
obj = ubc_getobject(vp);
+#endif
#endif
(void)ubc_clean(vp, 1);
vinvalbuf(vp, V_SAVE, &afs_osi_cred, p, 0, 0);
VOP_INACTIVE(vp, p);
else
VOP_UNLOCK(vp, 0, p);
+ if (obj) {
if (ISSET(vp->v_flag, VTERMINATE))
panic("afs_vnreclaim: already teminating");
SET(vp->v_flag, VTERMINATE);
SET(vp->v_flag, VTERMWANT);
tsleep((caddr_t)&vp->v_ubcinfo, PINOD, "afs_vnreclaim", 0);
}
+ }
} else {
if (simple_lock_try(&vp->v_interlock))
panic("afs_vnreclaim: slept, but did no work :(");
if (UBCINFOEXISTS(vp) && vp->v_count == 1) {
vp->v_usecount++;
simple_unlock(&vp->v_interlock);
- AFS_RELE(vp);
+ VN_RELE(vp);
} else
simple_unlock(&vp->v_interlock);
}
void *object;
struct vcache *avc = (struct vcache *)vp;
+#ifdef AFS_DARWIN14_ENV
+ offset=trunc_page(offset);
+ size=round_page(size+1);
+ while (size) {
+ ubc_page_op(vp, (vm_offset_t)offset,
+ UPL_POP_SET | UPL_POP_BUSY | UPL_POP_DUMP,
+ 0, 0);
+ size-=PAGE_SIZE;
+ offset+=PAGE_SIZE;
+ }
+#else
object=NULL;
-#ifdef UBC_NOREACTIVATE
+#ifdef AFS_DARWIN13_ENV
if (UBCINFOEXISTS(vp))
object = ubc_getobject(vp, UBC_NOREACTIVATE);
#else
offset=trunc_page(offset);
size=round_page(size+1);
-#ifdef UBC_NOREACTIVATE
+#ifdef AFS_DARWIN13_ENV
while (size) {
memory_object_page_op(object, (vm_offset_t)offset,
UPL_POP_SET | UPL_POP_BUSY | UPL_POP_DUMP,
offset+=PAGE_SIZE;
}
#else
+ /* This is all we can do, and it's not enough. sucks to be us */
ubc_setsize(vp, offset);
size=(offset + size > avc->m.Length) ? offset + size : avc->m.Length;
ubc_setsize(vp, size);
#endif
+#endif
}
int osi_VM_Setup(struct vcache *avc) {
AFS_RELE(avc);
return error;
}
+#ifndef AFS_DARWIN14_ENV
simple_lock(&avc->v.v_interlock);
if (!ubc_issetflags(&avc->v, UI_HASOBJREF))
-#ifdef UBC_NOREACTIVATE
+#ifdef AFS_DARWIN13_ENV
if (ubc_getobject(&avc->v, (UBC_NOREACTIVATE|UBC_HOLDOBJECT)))
panic("VM_Setup: null object");
#else
(void)_ubc_getobject(&avc->v, 1); /* return value not used */
#endif
simple_unlock(&avc->v.v_interlock);
+#endif
AFS_GLOCK();
AFS_RELE(avc);
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.1.1.4 2001/09/11 14:24:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.1.1.5 2002/01/22 19:48:06 hartmans Exp $");
#include <afs/sysincludes.h> /* Standard vendor system headers */
#include <afs/afsincludes.h> /* Afs-based standard headers */
error = afs_remove((struct vcache *)dvp, name, cnp->cn_cred);
AFS_GUNLOCK();
cache_purge(vp);
- if (dvp == vp)
- vrele(vp);
- else
- vput(vp);
- vput(dvp);
- if (UBCINFOEXISTS(vp)) {
+ if (!error && UBCINFOEXISTS(vp)) {
+#ifdef AFS_DARWIN14_ENV
+ (void) ubc_uncache(vp);
+#else
int wasmapped=ubc_issetflags(vp, UI_WASMAPPED);
int hasobjref=ubc_issetflags(vp, UI_HASOBJREF);
if (wasmapped)
if (hasobjref)
ubc_release(vp);
/* WARNING vp may not be valid after this */
+#endif
}
+ if (dvp == vp)
+ vrele(vp);
+ else
+ vput(vp);
+ vput(dvp);
FREE_ZONE(cnp->cn_pnbuf, cnp->cn_pnlen, M_NAMEI);
DROPNAME();
if (UBCISVALID(vp))
printf("\n UBC: %s%s",
UBCINFOEXISTS(vp) ? "exists, " : "does not exist",
+#ifdef AFS_DARWIN14_ENV
+ UBCINFOEXISTS(vp) ?
+ sprintf(buf, "refs %d", vp->v_ubcinfo->ui_refcount),buf : "");
+#else
UBCINFOEXISTS(vp) ?
sprintf(buf, "holdcnt %d", vp->v_ubcinfo->ui_holdcnt),buf : "");
+#endif
printf("\n");
return 0;
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_misc.c,v 1.1.1.4 2001/07/14 22:19:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_misc.c,v 1.1.1.5 2002/01/22 19:48:10 hartmans Exp $");
#ifdef AFS_SGI62_ENV
#include "../afs/sysincludes.h" /* Standard vendor system headers */
inventory_t *pinv;
/* test for numa arch. */
/* Determine if thisis a NUMA platform. Currently, this is true
- * only if it's an IP27.
+ * only if it's an IP27 or IP35.
*/
pinv = find_inventory((inventory_t*)NULL, INV_PROCESSOR,
INV_CPUBOARD, -1, -1, -1);
if (!pinv)
code = ENODEV;
- else
- afs_is_numa_arch = (pinv->inv_state == INV_IP27BOARD) ? 1 : 0;
+ else
+ afs_is_numa_arch = ((pinv->inv_state == INV_IP27BOARD) ||
+ (pinv->inv_state == INV_IP35BOARD))
+ ? 1 : 0;
}
else
afs_is_numa_arch = flag;
int afs_ipno = 28;
#elif defined(IP30)
int afs_ipno = 30;
+#elif defined(IP35)
+int afs_ipno = 35;
#else
int afs_ipno = -1;
#endif
*/
#ifdef AFS_SGI65_ENV
#define PTOSSVP(vp, off, len) VOP_TOSS_PAGES((vp), (off), (len), 0)
-#define PFLUSHINVALVP(vp, off, len) VOP_INVALFREE_PAGES((vp), (len))
+#define PFLUSHINVALVP(vp, off, len) VOP_FLUSHINVAL_PAGES((vp), (off), (len), 0)
#define PFLUSHVP(vp, len, flags, code) \
VOP_FLUSH_PAGES((vp), 0, (len), (flags), 0, code)
#define PINVALFREE(vp, off) VOP_INVALFREE_PAGES((vp), (off))
#ifdef VNODE_TRACING
struct ktrace *v_trace; /* trace header structure */
#endif
+#ifdef CKPT
+ ckpt_handle_t v_ckpt; /* ckpt lookup info */
+#endif
} vnode1_t;
extern struct pfdat *vnode_get_dpages(vnode_t*);
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_vfsops.c,v 1.1.1.4 2001/07/14 22:19:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_vfsops.c,v 1.1.1.5 2002/01/22 19:48:10 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
register afs_int32 code = 0;
afs_int32 ret;
-#if defined(AFS_SGI64_ENV) && defined(CKPT)
+#if defined(AFS_SGI64_ENV) && defined(CKPT) && !defined(_R5000_CVT_WAR)
afs_fid2_t *afid2;
#endif
*avcp = NULL;
-#if defined(AFS_SGI64_ENV) && defined(CKPT)
+#if defined(AFS_SGI64_ENV) && defined(CKPT) && !defined(_R5000_CVT_WAR)
afid2 = (afs_fid2_t*)fidp;
if (afid2->af_len == sizeof(afs_fid2_t) - sizeof(afid2->af_len)) {
/* It's a checkpoint restart fid. */
- tcell = afs_GetCellByIndex(afid2->af_cell, READ_LOCK);
+ tcell = afs_GetCellByIndex(afid2->af_cell, READ_LOCK, 0 /* !refresh */);
if (!tcell) {
code = ENOENT;
goto out;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_vnodeops.c,v 1.1.1.7 2001/09/11 14:25:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_vnodeops.c,v 1.1.1.8 2002/01/22 19:48:10 hartmans Exp $");
#ifdef AFS_SGI62_ENV
#include "../afs/sysincludes.h" /* Standard vendor system headers */
return 0;
}
-#if defined(AFS_SGI64_ENV) && defined(CKPT)
+#if defined(AFS_SGI64_ENV) && defined(CKPT) && !defined(_R5000_CVT_WAR)
int afs_fid2(OSI_VC_DECL(avc), struct fid *fidp)
{
struct cell *tcell;
* return of ENOSYS would make the code fail over to VOP_FID. We can't let
* that happen, since we do a VN_HOLD there in the expectation that
* posthandle will be called to release the vnode.
+ *
+ * afs_fid2 is used to support the R5000 workarounds (_R5000_CVT_WAR)
*/
int afs_fid2(OSI_VC_DECL(avc), struct fid *fidp)
{
+#if defined(_R5000_CVT_WAR)
+ extern int R5000_cvt_war;
+
+ if (R5000_cvt_war)
+ return ENOSYS;
+ else
+ return EINVAL;
+#else
return EINVAL;
+#endif
}
#endif /* AFS_SGI64_ENV && CKPT */
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_alloc.c,v 1.1.1.8 2001/09/11 14:25:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_alloc.c,v 1.1.1.9 2002/01/22 19:48:11 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
/* if we can use kmalloc use it to allocate the required memory. */
if (asize < MAX_KMALLOC_SIZE) {
- new = (void *)(unsigned long)kmalloc(asize, GFP_KERNEL);
+ new = (void *)(unsigned long)kmalloc(asize,
+#ifdef GFP_NOFS
+ GFP_NOFS
+#else
+ GFP_KERNEL
+#endif
+ );
if (new) /* piggy back alloc type */
(unsigned long)new |= KM_TYPE;
}
if (--max_wait <=0) {
break;
}
- schedule();
+#ifdef set_current_state
+ set_current_state(TASK_INTERRUPTIBLE);
+#else
+ current->state = TASK_INTERRUPTIBLE;
+#endif
+ schedule_timeout(HZ);
}
if (new) /* piggy back alloc type */
(unsigned long)new |= VM_TYPE;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_sleep.c,v 1.1.1.6 2001/07/14 22:19:47 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_sleep.c,v 1.1.1.7 2002/01/22 19:48:12 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
void afs_osi_Wakeup(char *event);
void afs_osi_Sleep(char *event);
-static char waitV;
+static char waitV, dummyV;
#if ! defined(AFS_GLOBAL_SUNLOCK)
if (ahandle)
ahandle->proc = (caddr_t) current;
+ AFS_ASSERT_GLOCK();
do {
- AFS_ASSERT_GLOCK();
- code = 0;
#if defined(AFS_GLOBAL_SUNLOCK)
code = osi_TimedSleep(&waitV, ams, 1);
- if (code) {
- if (aintok) break;
+ if (code == EINTR) {
+ if (aintok)
+ return EINTR;
flush_signals(current);
- code = 0;
}
#else
timer = afs_osi_CallProc(AfsWaitHack, (char *) current, ams);
#endif /* AFS_GLOBAL_SUNLOCK */
if (ahandle && (ahandle->proc == (caddr_t) 0)) {
/* we've been signalled */
- break;
+ return EINTR;
}
} while (osi_Time() < endTime);
- return code;
+ return 0;
}
newp = evp;
evp = evp->next;
}
- if (!newp) {
- newp = (afs_event_t *) osi_AllocSmallSpace(sizeof (afs_event_t));
- afs_evhashcnt++;
- newp->next = afs_evhasht[hashcode];
- afs_evhasht[hashcode] = newp;
-#if defined(AFS_LINUX24_ENV)
- init_waitqueue_head(&newp->cond);
-#else
- init_waitqueue(&newp->cond);
-#endif
- newp->seq = 0;
- }
+ if (!newp)
+ return NULL;
+
newp->event = event;
newp->refcount = 1;
return newp;
}
+/* afs_addevent -- allocates a new event for the address. It isn't returned;
+ * instead, afs_getevent should be called again. Thus, the real effect of
+ * this routine is to add another event to the hash bucket for this
+ * address.
+ *
+ * Locks:
+ * Called with GLOCK held. However the function might drop
+ * GLOCK when it calls osi_AllocSmallSpace for allocating
+ * a new event (In Linux, the allocator drops GLOCK to avoid
+ * a deadlock).
+ */
+
+static void afs_addevent(char *event)
+{
+ int hashcode;
+ afs_event_t *newp;
+
+ AFS_ASSERT_GLOCK();
+ hashcode = afs_evhash(event);
+ newp = osi_AllocSmallSpace(sizeof(afs_event_t));
+ afs_evhashcnt++;
+ newp->next = afs_evhasht[hashcode];
+ afs_evhasht[hashcode] = newp;
+#if defined(AFS_LINUX24_ENV)
+ init_waitqueue_head(&newp->cond);
+#else
+ init_waitqueue(&newp->cond);
+#endif
+ newp->seq = 0;
+ newp->event = &dummyV; /* Dummy address for new events */
+ newp->refcount = 0;
+}
+
+
/* Release the specified event */
#define relevent(evp) ((evp)->refcount--)
+/* afs_osi_Sleep -- waits for an event to be notified. */
void afs_osi_Sleep(char *event)
{
int seq;
evp = afs_getevent(event);
+ if (!evp) {
+ /* Can't block because allocating a new event would require dropping
+ * the GLOCK, which may cause us to miss the wakeup. So call the
+ * allocator then return immediately. We'll find the new event next
+ * time around without dropping the GLOCK. */
+ afs_addevent(event);
+ return;
+ }
+
seq = evp->seq;
+
while (seq == evp->seq) {
AFS_ASSERT_GLOCK();
AFS_GUNLOCK();
* ams --- max sleep time in milliseconds
* aintok - 1 if should sleep interruptibly
*
- * Returns 0 if timeout and EINTR if signalled.
- *
- * While the Linux kernel still has a global lock, we can use the standard
- * sleep calls and drop our locks early. The kernel lock will protect us
- * until we get to sleep.
+ * Returns 0 if timeout, EINTR if signalled, and EGAIN if it might
+ * have raced.
*/
static int osi_TimedSleep(char *event, afs_int32 ams, int aintok)
{
struct afs_event *evp;
evp = afs_getevent(event);
+ if (!evp) {
+ /* Can't block because allocating a new event would require dropping
+ * the GLOCK, which may cause us to miss the wakeup. So call the
+ * allocator then return immediately. We'll find the new event next
+ * time around without dropping the GLOCK. */
+ afs_addevent(event);
+ return EAGAIN;
+ }
AFS_GUNLOCK();
if (aintok)
t = sleep_on_timeout(&evp->cond, t);
AFS_GLOCK();
+ relevent(evp);
+
return t ? EINTR : 0;
}
struct afs_event *evp;
evp = afs_getevent(event);
+ if (!evp) /* No sleepers */
+ return;
+
if (evp->refcount > 1) {
evp->seq++;
wake_up(&evp->cond);
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.1.1.5 2001/10/14 17:59:13 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.1.1.6 2002/01/22 19:48:17 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
afs_Trace2(afs_iclSetp, CM_TRACE_REMOVE, ICL_TYPE_POINTER, adp,
ICL_TYPE_STRING, aname);
+ /* Check if this is dynroot */
+ if (afs_IsDynroot(adp))
+ return afs_DynrootVOPRemove(adp, acred, aname);
+
if (code = afs_InitReq(&treq, acred))
return code;
tagain:
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_symlink.c,v 1.1.1.4 2001/07/14 22:19:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_symlink.c,v 1.1.1.5 2002/01/22 19:48:17 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
AFS_STATCNT(afs_symlink);
afs_Trace2(afs_iclSetp, CM_TRACE_SYMLINK, ICL_TYPE_POINTER, adp,
ICL_TYPE_STRING, aname);
+
+ if (afs_IsDynroot(adp))
+ return afs_DynrootVOPSymlink(adp, acred, aname, atargetName);
+
if (code = afs_InitReq(&treq, acred))
return code;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cell.c,v 1.1.1.8 2001/10/14 17:58:54 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cell.c,v 1.1.1.9 2002/01/22 19:47:57 hartmans Exp $");
#include "../afs/stds.h"
#include "../afs/sysincludes.h" /* Standard vendor system headers */
char afs_AfsdbHandler_Completed = 0;
-static struct cell *afs_GetCellByName_int();
+struct cell *afs_GetCellByName2();
int afs_strcasecmp(s1, s2)
register char *s1, *s2;
}
-void afs_RefreshCell(tc)
- register struct cell *tc;
+void afs_RefreshCell(ac)
+ register struct cell *ac;
{
afs_int32 cellHosts[MAXCELLHOSTS];
char *realName = NULL;
+ struct cell *tc;
int timeout;
/* Don't need to do anything if no timeout or it's not expired */
- if (!tc->timeout || tc->timeout > osi_Time()) return;
+ if (!ac->timeout || ac->timeout > osi_Time()) return;
- if (afs_GetCellHostsFromDns(tc->cellName, cellHosts, &timeout, &realName))
+ if (afs_GetCellHostsFromDns(ac->cellName, cellHosts, &timeout, &realName))
/* In case of lookup failure, keep old data */
goto done;
afs_NewCell(realName, cellHosts, 0, (char *) 0, 0, 0, timeout, (char *) 0);
/* If this is an alias, update the alias entry too */
- if (afs_strcasecmp(tc->cellName, realName))
- afs_NewCell(tc->cellName, 0, CAlias, (char *) 0, 0, 0,
- timeout, realName);
+ if (afs_strcasecmp(ac->cellName, realName)) {
+ /*
+ * Look up the entry we just updated, to compensate for
+ * uppercase-vs-lowercase lossage with DNS.
+ */
+ tc = afs_GetCellByName2(realName, READ_LOCK, 0 /* no AFSDB */);
+
+ if (tc) {
+ afs_NewCell(ac->cellName, 0, CAlias, (char *) 0, 0, 0,
+ timeout, tc->cellName);
+ afs_PutCell(tc, READ_LOCK);
+ }
+ }
done:
if (realName)
{
afs_int32 cellHosts[MAXCELLHOSTS];
char *realName = NULL;
+ struct cell *tc;
int timeout;
if (afs_GetCellHostsFromDns(acellName, cellHosts, &timeout, &realName))
/* If this is an alias, create an entry for it too */
if (afs_strcasecmp(acellName, realName)) {
+ /*
+ * Look up the entry we just updated, to compensate for
+ * uppercase-vs-lowercase lossage with DNS.
+ */
+ tc = afs_GetCellByName2(realName, READ_LOCK, 0 /* no AFSDB */);
+ if (!tc)
+ goto bad;
+
if (afs_NewCell(acellName, 0, CAlias, (char *) 0, 0, 0,
- timeout, realName))
+ timeout, tc->cellName)) {
+ afs_PutCell(tc, READ_LOCK);
goto bad;
+ }
+
+ afs_PutCell(tc, READ_LOCK);
}
if (realName)
afs_osi_Free(realName, strlen(realName) + 1);
- return afs_GetCellByName_int(acellName, locktype, 0);
+ return afs_GetCellByName2(acellName, locktype, 0);
bad:
if (realName)
}
-static struct cell *afs_GetCellByName_int(acellName, locktype, trydns)
+struct cell *afs_GetCellByName2(acellName, locktype, trydns)
register char *acellName;
afs_int32 locktype;
char trydns;
{
register struct cell *tc;
register struct afs_q *cq, *tq;
+ int didAlias = 0;
AFS_STATCNT(afs_GetCellByName);
+retry:
ObtainWriteLock(&afs_xcell,100);
for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
tc = QTOC(cq); tq = QNext(cq);
QAdd(&CellLRU, &tc->lruq);
ReleaseWriteLock(&afs_xcell);
afs_RefreshCell(tc);
- if (tc->states & CAlias) {
- tc = tc->alias;
- afs_RefreshCell(tc);
+ if ((tc->states & CAlias) && (didAlias == 0)) {
+ acellName = tc->realName;
+ if (!acellName) return (struct cell *) 0;
+ didAlias = 1;
+ goto retry;
}
return tc;
}
return trydns ? afs_GetCellByName_Dns(acellName, locktype)
: (struct cell *) 0;
-} /*afs_GetCellByName_int*/
+} /*afs_GetCellByName2*/
struct cell *afs_GetCellByName(acellName, locktype)
register char *acellName;
afs_int32 locktype;
{
- return afs_GetCellByName_int(acellName, locktype, 1);
+ return afs_GetCellByName2(acellName, locktype, 1);
} /*afs_GetCellByName*/
-
-struct cell *afs_GetCell(acell, locktype)
+static struct cell *afs_GetCellInternal(acell, locktype, holdxcell)
register afs_int32 acell;
afs_int32 locktype;
+ int holdxcell;
{
register struct cell *tc;
register struct afs_q *cq, *tq;
AFS_STATCNT(afs_GetCell);
if (acell == 1 && afs_rootcell) return afs_rootcell;
- ObtainWriteLock(&afs_xcell,101);
+ if (holdxcell)
+ ObtainWriteLock(&afs_xcell,101);
for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
tc = QTOC(cq); tq = QNext(cq);
if (tc->cell == acell) {
QRemove(&tc->lruq);
QAdd(&CellLRU, &tc->lruq);
- ReleaseWriteLock(&afs_xcell);
+ if (holdxcell)
+ ReleaseWriteLock(&afs_xcell);
afs_RefreshCell(tc);
return tc;
}
}
- ReleaseWriteLock(&afs_xcell);
+ if (holdxcell)
+ ReleaseWriteLock(&afs_xcell);
return (struct cell *) 0;
} /*afs_GetCell*/
+struct cell *afs_GetCell(acell, locktype)
+ register afs_int32 acell;
+ afs_int32 locktype;
+{
+ return afs_GetCellInternal(acell, locktype, 1);
+}
+
+/* This is only to be called if the caller is already holding afs_xcell */
+struct cell *afs_GetCellNoLock(acell, locktype)
+ register afs_int32 acell;
+ afs_int32 locktype;
+{
+ return afs_GetCellInternal(acell, locktype, 0);
+}
-struct cell *afs_GetCellByIndex(cellindex, locktype)
+struct cell *afs_GetCellByIndex(cellindex, locktype, refresh)
register afs_int32 cellindex;
afs_int32 locktype;
+ afs_int32 refresh;
{
register struct cell *tc;
register struct afs_q *cq, *tq;
QRemove(&tc->lruq);
QAdd(&CellLRU, &tc->lruq);
ReleaseWriteLock(&afs_xcell);
- afs_RefreshCell(tc);
+ if (refresh) afs_RefreshCell(tc);
return tc;
}
}
}
else {
tc = (struct cell *) afs_osi_Alloc(sizeof(struct cell));
+ memset((char *)tc, 0, sizeof(*tc));
QAdd(&CellLRU, &tc->lruq); /* put in lruq */
tc->cellName = (char *) afs_osi_Alloc(strlen(acellName)+1);
strcpy(tc->cellName, acellName);
}
tc->states |= aflags;
tc->timeout = timeout;
+
+ /* Allow converting an alias into a real cell */
+ if (!(aflags & CAlias)) tc->states &= ~CAlias;
memset((char *)tc->cellHosts, 0, sizeof(tc->cellHosts));
if (aflags & CAlias) {
- struct cell *tca = NULL;
-
if (!aliasFor) {
code = EINVAL;
goto bad;
}
- for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
- tca = QTOC(cq); tq = QNext(cq);
- if (!afs_strcasecmp(tca->cellName, aliasFor))
- break;
- }
- if (!tca) {
- code = ENOENT;
- goto bad;
- }
- tc->alias = tca;
+ if (tc->realName) afs_osi_Free(tc->realName, strlen(tc->realName)+1);
+ tc->realName = (char *) afs_osi_Alloc(strlen(aliasFor)+1);
+ strcpy(tc->realName, aliasFor);
goto done;
}
* afs_DynrootNewVnode
* afs_SetDynrootEnable
* afs_GetDynrootEnable
+ * afs_DynrootVOPRemove
+ * afs_DynrootVOPSymlink
*
*/
#define AFS_DYNROOT_VNODE 1
#define AFS_DYNROOT_UNIQUE 1
-#define VNUM2CIDX(vnum) ((vnum) >> 2)
-#define VNUM2RW(vnum) (((vnum) >> 1) & 1)
-#define CIDXRW2VNUM(cidx, rw) (((cidx) << 2) | ((rw) << 1))
+/*
+ * Vnode numbers in dynroot are composed of a type field (upper 8 bits)
+ * and a type-specific identifier in the lower 24 bits.
+ */
+#define VN_TYPE_CELL 0x01 /* Corresponds to a struct cell */
+#define VN_TYPE_SYMLINK 0x02 /* User-created symlink in /afs */
+
+#define VNUM_TO_VNTYPE(vnum) ((vnum) >> 24)
+#define VNUM_TO_VNID(vnum) ((vnum) & 0x00ffffff)
+#define VNUM_FROM_TYPEID(type, id) \
+ ((type) << 24 | (id))
+#define VNUM_TO_CIDX(vnum) (VNUM_TO_VNID(vnum) >> 2)
+#define VNUM_TO_RW(vnum) (VNUM_TO_VNID(vnum) >> 1 & 1)
+#define VNUM_FROM_CIDX_RW(cidx, rw) \
+ VNUM_FROM_TYPEID(VN_TYPE_CELL, \
+ ((cidx) << 2 | (rw) << 1))
static int afs_dynrootEnable = 0;
static int afs_dynrootVersionHigh = 1;
/* End of variables protected by afs_dynrootDirLock */
+/* A dynamically-created symlink in a dynroot /afs */
+struct afs_dynSymlink {
+ struct afs_dynSymlink *next;
+ int index;
+ char *name;
+ char *target;
+};
+
+static afs_rwlock_t afs_dynSymlinkLock;
+/* Start of variables protected by afs_dynSymlinkLock */
+static struct afs_dynSymlink *afs_dynSymlinkBase = NULL;
+static int afs_dynSymlinkIndex = 0;
+/* End of variables protected by afs_dynSymlinkLock */
+
extern afs_int32 afs_cellindex;
extern afs_rwlock_t afs_xvcache;
int cellidx, maxcellidx, i;
struct cell *c;
int curChunk, curPage;
- int dirSize;
+ int dirSize, sizeOfCurEntry;
char *newDir, *dotCell;
struct DirHeader *dirHeader;
struct PageHeader *pageHeader;
struct DirEntry *dirEntry;
int doFlush = 0;
int linkCount = 0;
+ struct afs_dynSymlink *ts;
+ int newCellCount;
/*
* Save afs_cellindex here, in case it changes between the
curPage = 0;
for (cellidx = 0; cellidx < maxcellidx; cellidx++) {
- int sizeOfCurEntry;
-
- c = afs_GetCellByIndex(cellidx, READ_LOCK);
+ c = afs_GetCellByIndex(cellidx, READ_LOCK, 0 /* don't refresh */);
if (!c) continue;
sizeOfCurEntry = afs_dir_NameBlobs(c->cellName);
afs_PutCell(c, READ_LOCK);
}
+ ObtainReadLock(&afs_dynSymlinkLock);
+ ts = afs_dynSymlinkBase;
+ while (ts) {
+ sizeOfCurEntry = afs_dir_NameBlobs(ts->name);
+ if (curChunk + sizeOfCurEntry > EPP) {
+ curPage++;
+ curChunk = 1;
+ }
+ curChunk += sizeOfCurEntry;
+ ts = ts->next;
+ }
+
dirSize = (curPage + 1) * AFS_PAGESIZE;
newDir = afs_osi_Alloc(dirSize);
afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk, "..", 1);
linkCount += 2;
+ /* Reserve space for "." and ".." */
+ curChunk += 2;
+
for (cellidx = 0; cellidx < maxcellidx; cellidx++) {
- c = afs_GetCellByIndex(cellidx, READ_LOCK);
+ c = afs_GetCellByIndex(cellidx, READ_LOCK, 0 /* don't refresh */);
afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk,
- c->cellName, CIDXRW2VNUM(cellidx, 0));
+ c->cellName, VNUM_FROM_CIDX_RW(cellidx, 0));
dotCell = afs_osi_Alloc(strlen(c->cellName) + 2);
strcpy(dotCell, ".");
strcat(dotCell, c->cellName);
afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk,
- dotCell, CIDXRW2VNUM(cellidx, 1));
-
- linkCount += 2;
+ dotCell, VNUM_FROM_CIDX_RW(cellidx, 1));
+ if (!(c->states & CAlias)) linkCount += 2;
afs_PutCell(c, READ_LOCK);
}
+ ts = afs_dynSymlinkBase;
+ while (ts) {
+ int vnum = VNUM_FROM_TYPEID(VN_TYPE_SYMLINK, ts->index);
+ afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk,
+ ts->name, vnum);
+ ts = ts->next;
+ }
+
+ newCellCount = maxcellidx + afs_dynSymlinkIndex;
+ ReleaseReadLock(&afs_dynSymlinkLock);
+
ObtainWriteLock(&afs_dynrootDirLock, 549);
if (afs_dynrootDir) afs_osi_Free(afs_dynrootDir, afs_dynrootDirLen);
afs_dynrootDir = newDir;
afs_dynrootDirLen = dirSize;
afs_dynrootDirLinkcnt = linkCount;
- if (afs_dynrootCellCount != maxcellidx) {
+ if (afs_dynrootCellCount != newCellCount) {
/*
- * New cells added -- bump data version, invalidate vcache.
+ * New cells/symlinks added -- bump data version, invalidate vcache.
*/
- afs_dynrootCellCount = maxcellidx;
+ afs_dynrootCellCount = newCellCount;
afs_dynrootVersion++;
afs_dynrootVersionHigh = osi_Time();
doFlush = 1;
struct cell *c;
int namelen, linklen, cellidx, rw;
- cellidx = VNUM2CIDX(avc->fid.Fid.Vnode);
- rw = VNUM2RW(avc->fid.Fid.Vnode);
+ memset(status, 0, sizeof(struct AFSFetchStatus));
+
+ status->FileType = SymbolicLink;
+ status->LinkCount = 1;
+ status->DataVersion = 1;
+ status->CallerAccess = PRSFS_LOOKUP | PRSFS_READ;
+ status->AnonymousAccess = PRSFS_LOOKUP | PRSFS_READ;
+ status->ParentVnode = 1;
+ status->ParentUnique = 1;
+
+ if (VNUM_TO_VNTYPE(avc->fid.Fid.Vnode) == VN_TYPE_SYMLINK) {
+ struct afs_dynSymlink *ts;
+ int index = VNUM_TO_VNID(avc->fid.Fid.Vnode);
- c = afs_GetCellByIndex(cellidx, READ_LOCK);
+ ObtainReadLock(&afs_dynSymlinkLock);
+ ts = afs_dynSymlinkBase;
+ while (ts) {
+ if (ts->index == index) break;
+ ts = ts->next;
+ }
+
+ if (ts) {
+ linklen = strlen(ts->target);
+ avc->linkData = afs_osi_Alloc(linklen + 1);
+ strcpy(avc->linkData, ts->target);
+
+ status->Length = linklen;
+ status->UnixModeBits = 0755;
+ }
+ ReleaseReadLock(&afs_dynSymlinkLock);
+
+ return ts ? 1 : 0;
+ }
+
+ if (VNUM_TO_VNTYPE(avc->fid.Fid.Vnode) != VN_TYPE_CELL) {
+ afs_warn("dynroot vnode inconsistency, unknown VNTYPE %d\n",
+ VNUM_TO_VNTYPE(avc->fid.Fid.Vnode));
+ return 0;
+ }
+
+ cellidx = VNUM_TO_CIDX(avc->fid.Fid.Vnode);
+ rw = VNUM_TO_RW(avc->fid.Fid.Vnode);
+
+ c = afs_GetCellByIndex(cellidx, READ_LOCK, 1 /* refresh */);
if (!c) {
afs_warn("dynroot vnode inconsistency, can't find cell %d\n",
cellidx);
return 0;
}
- memset(status, 0, sizeof(struct AFSFetchStatus));
-
if (c->states & CAlias) {
/*
* linkData needs to contain the name of the cell
* we're aliasing for.
*/
- struct cell *tca = c->alias;
+ char *realName = c->realName;
- if (!tca) {
- afs_warn("dynroot: alias %s missing cell alias pointer\n",
+ if (!realName) {
+ afs_warn("dynroot: alias %s missing real cell name\n",
c->cellName);
linklen = 7;
avc->linkData = afs_osi_Alloc(linklen + 1);
strcpy(avc->linkData, "unknown");
} else {
- int namelen = strlen(tca->cellName);
+ int namelen = strlen(realName);
linklen = rw + namelen;
avc->linkData = afs_osi_Alloc(linklen + 1);
strcpy(avc->linkData, rw ? "." : "");
- strcat(avc->linkData, tca->cellName);
+ strcat(avc->linkData, realName);
}
status->UnixModeBits = 0755;
status->UnixModeBits = 0644;
}
- status->FileType = SymbolicLink;
- status->LinkCount = 1;
- status->Length = linklen;
- status->DataVersion = 1;
- status->CallerAccess = PRSFS_LOOKUP | PRSFS_READ;
- status->AnonymousAccess = PRSFS_LOOKUP | PRSFS_READ;
- status->ParentVnode = 1;
- status->ParentUnique = 1;
-
+ status->Length = linklen;
afs_PutCell(c, READ_LOCK);
return 1;
}
{
return afs_dynrootEnable;
}
+
+/*
+ * Remove a temporary symlink entry from /afs.
+ */
+int
+afs_DynrootVOPRemove(avc, acred, aname)
+ struct vcache *avc;
+ struct AFS_UCRED *acred;
+ char *aname;
+{
+ struct afs_dynSymlink **tpps;
+ struct afs_dynSymlink *tps;
+ struct cell *c;
+ int found = 0;
+
+ if (acred->cr_uid)
+ return EPERM;
+
+ ObtainWriteLock(&afs_dynSymlinkLock, 97);
+ tpps = &afs_dynSymlinkBase;
+ while (*tpps) {
+ tps = *tpps;
+ if (afs_strcasecmp(aname, tps->name) == 0) {
+ afs_osi_Free(tps->name, strlen(tps->name) + 1);
+ afs_osi_Free(tps->target, strlen(tps->target) + 1);
+ *tpps = tps->next;
+ afs_osi_Free(tps, sizeof(*tps));
+ afs_dynSymlinkIndex++;
+ found = 1;
+ break;
+ }
+ tpps = &(tps->next);
+ }
+ ReleaseWriteLock(&afs_dynSymlinkLock);
+ if (found) {
+ afs_RefreshDynroot();
+ return 0;
+ }
+
+ /* Check if this is an actual cell? */
+ c = afs_GetCellByName2(aname, READ_LOCK, 0 /* no AFSDB */);
+ if (c) {
+ afs_PutCell(c, READ_LOCK);
+ return EROFS;
+ } else {
+ return ENOENT;
+ }
+}
+
+/*
+ * Create a temporary symlink entry in /afs.
+ */
+int
+afs_DynrootVOPSymlink(avc, acred, aname, atargetName)
+ struct vcache *avc;
+ struct AFS_UCRED *acred;
+ char *aname;
+ char *atargetName;
+{
+ struct afs_dynSymlink *tps;
+ struct cell *c;
+
+ if (acred->cr_uid)
+ return EPERM;
+
+ /* Check if it's already a cell */
+ c = afs_GetCellByName2(aname, READ_LOCK, 0 /* no AFSDB */);
+ if (c) {
+ afs_PutCell(c, READ_LOCK);
+ return EEXIST;
+ }
+
+ /* Check if it's already a symlink */
+ ObtainWriteLock(&afs_dynSymlinkLock, 91);
+ tps = afs_dynSymlinkBase;
+ while (tps) {
+ if (afs_strcasecmp(aname, tps->name) == 0) {
+ ReleaseWriteLock(&afs_dynSymlinkLock);
+ return EEXIST;
+ }
+ tps = tps->next;
+ }
+
+ /* Doesn't already exist -- go ahead and create it */
+ tps = afs_osi_Alloc(sizeof(*tps));
+ tps->index = afs_dynSymlinkIndex++;
+ tps->next = afs_dynSymlinkBase;
+ tps->name = afs_osi_Alloc(strlen(aname) + 1);
+ strcpy(tps->name, aname);
+ tps->target = afs_osi_Alloc(strlen(atargetName) + 1);
+ strcpy(tps->target, atargetName);
+ afs_dynSymlinkBase = tps;
+ ReleaseWriteLock(&afs_dynSymlinkLock);
+
+ afs_RefreshDynroot();
+ return 0;
+}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_nfsdisp.c,v 1.1 2001/10/14 17:58:56 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_nfsdisp.c,v 1.1.1.2 2002/01/22 19:47:58 hartmans Exp $");
#include "../afs/stds.h"
#include "../afs/sysincludes.h" /* Standard vendor system headers */
case NFSPROC3_LOOKUP:
{
LOOKUP3args *arg = (LOOKUP3args *)args;
- fhp1 = (nfs_fh3 *) &arg->what.dir;
+ fhp1 = (nfs_fh3 *) &arg->what.dirp;
break;
}
case NFSPROC3_ACCESS:
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi.c,v 1.1.1.7 2001/09/11 14:24:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi.c,v 1.1.1.8 2002/01/22 19:47:59 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
set_system_proc(u.u_procp);
#else
#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+ /* maybe call init_process instead? */
current_proc()->p_flag |= P_SYSTEM;
#else
#if !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV)
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi_vget.c,v 1.1.1.5 2001/09/11 14:24:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi_vget.c,v 1.1.1.6 2002/01/22 19:47:59 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
*/
struct cell *tcell;
cellindex = (Sfid.CellAndUnique >> 24) & 0xff;
- tcell = afs_GetCellByIndex(cellindex, READ_LOCK);
+ tcell = afs_GetCellByIndex(cellindex, READ_LOCK, 0 /* don't refresh */);
if (!tcell) {
return ENOENT;
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_segments.c,v 1.1.1.5 2001/09/11 14:24:45 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_segments.c,v 1.1.1.6 2002/01/22 19:48:00 hartmans Exp $");
#include "../afs/sysincludes.h" /*Standard vendor system headers*/
#include "../afs/afsincludes.h" /*AFS-based standard headers*/
dcList = (struct dcache **) osi_AllocLargeSpace(AFS_LRALLOCSIZ);
afs_Trace2(afs_iclSetp, CM_TRACE_STOREALL, ICL_TYPE_POINTER, avc,
ICL_TYPE_INT32, avc->m.Length);
-#ifndef AFS_AIX32_ENV
+#if !defined(AFS_AIX32_ENV) && !defined(AFS_SGI65_ENV)
/* In the aix vm implementation we need to do the vm_writep even
* on the memcache case since that's we adjust the file's size
* and finish flushing partial vm pages.
*/
if (cacheDiskType != AFS_FCACHE_TYPE_MEM)
-#endif /* AFS_AIX32_ENV */
+#endif /* !AFS_AIX32_ENV && !AFS_SGI65_ENV */
{
/* If we're not diskless, reading a file may stress the VM
* system enough to cause a pageout, and this vnode would be
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_server.c,v 1.1.1.10 2001/10/14 17:58:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_server.c,v 1.1.1.11 2002/01/22 19:48:01 hartmans Exp $");
#include "../afs/stds.h"
#include "../afs/sysincludes.h" /* Standard vendor system headers */
struct server *ts;
struct srvAddr *sa;
struct conn *tc;
- afs_int32 i;
+ afs_int32 i, j;
afs_int32 code;
afs_int32 start, end, delta;
osi_timeval_t tv;
int setTimer;
struct unixuser *tu;
char tbuffer[CVBS];
+ int srvAddrCount;
+ struct srvAddr **addrs;
XSTATS_DECLS;
AFS_STATCNT(afs_CheckServers);
ObtainReadLock(&afs_xserver); /* Necessary? */
ObtainReadLock(&afs_xsrvAddr);
+ srvAddrCount = 0;
for (i=0;i<NSERVERS;i++) {
- for (sa = afs_srvAddrs[i]; sa; sa = sa->next_bkt) {
- ts = sa->server;
- if (!ts)
- continue;
- /* See if a cell to check was specified. If it is spec'd and not
- * this server's cell, just skip the server.
- */
- if (acellp && acellp != ts->cell)
- continue;
-
- if ((!adown && (sa->sa_flags & SRVADDR_ISDOWN))
- || (adown && !(sa->sa_flags & SRVADDR_ISDOWN)))
- continue;
- /* check vlserver with special code */
- if (sa->sa_portal == AFS_VLPORT) {
- CheckVLServer(sa, &treq);
- continue;
- }
+ for (sa = afs_srvAddrs[i]; sa; sa = sa->next_bkt) {
+ srvAddrCount++;
+ }
+ }
+
+ addrs = afs_osi_Alloc(srvAddrCount * sizeof(*addrs));
+ j = 0;
+ for (i=0;i<NSERVERS;i++) {
+ for (sa = afs_srvAddrs[i]; sa; sa = sa->next_bkt) {
+ if (j >= srvAddrCount) break;
+ addrs[j++] = sa;
+ }
+ }
+
+ ReleaseReadLock(&afs_xsrvAddr);
+ ReleaseReadLock(&afs_xserver);
- if (!ts->cell) /* not really an active server, anyway, it must */
- continue; /* have just been added by setsprefs */
-
- /* get a connection, even if host is down; bumps conn ref count */
- tu = afs_GetUser(treq.uid, ts->cell, SHARED_LOCK);
- tc = afs_ConnBySA(sa, ts->cell->fsport, ts->cell->cell, tu,
- 1/*force*/, 1/*create*/, SHARED_LOCK);
- afs_PutUser(tu, SHARED_LOCK);
- if (!tc)
- continue;
-
- if ((sa->sa_flags & SRVADDR_ISDOWN) || HaveCallBacksFrom(ts) ||
- (tc->srvr->server == afs_setTimeHost)) {
- if (sa->sa_flags & SRVADDR_ISDOWN) {
+ for (i=0; i<j; i++) {
+ sa = addrs[i];
+ ts = sa->server;
+ if (!ts)
+ continue;
+
+ /* See if a cell to check was specified. If it is spec'd and not
+ * this server's cell, just skip the server.
+ */
+ if (acellp && acellp != ts->cell)
+ continue;
+
+ if ((!adown && (sa->sa_flags & SRVADDR_ISDOWN)) ||
+ (adown && !(sa->sa_flags & SRVADDR_ISDOWN)))
+ continue;
+
+ /* check vlserver with special code */
+ if (sa->sa_portal == AFS_VLPORT) {
+ CheckVLServer(sa, &treq);
+ continue;
+ }
+
+ if (!ts->cell) /* not really an active server, anyway, it must */
+ continue; /* have just been added by setsprefs */
+
+ /* get a connection, even if host is down; bumps conn ref count */
+ tu = afs_GetUser(treq.uid, ts->cell, SHARED_LOCK);
+ tc = afs_ConnBySA(sa, ts->cell->fsport, ts->cell->cell, tu,
+ 1/*force*/, 1/*create*/, SHARED_LOCK);
+ afs_PutUser(tu, SHARED_LOCK);
+ if (!tc) continue;
+
+ if ((sa->sa_flags & SRVADDR_ISDOWN) || HaveCallBacksFrom(ts) ||
+ (tc->srvr->server == afs_setTimeHost)) {
+ if (sa->sa_flags & SRVADDR_ISDOWN) {
rx_SetConnDeadTime(tc->id, 3);
setTimer = 1;
- } else
- setTimer = 0;
- XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GETTIME);
- start = osi_Time(); /* time the gettimeofday call */
+ } else {
+ setTimer = 0;
+ }
+
+ XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GETTIME);
+ start = osi_Time(); /* time the gettimeofday call */
#ifdef RX_ENABLE_LOCKS
- AFS_GUNLOCK();
+ AFS_GUNLOCK();
#endif /* RX_ENABLE_LOCKS */
- code = RXAFS_GetTime(tc->id, &tv.tv_sec, &tv.tv_usec);
+ code = RXAFS_GetTime(tc->id, &tv.tv_sec, &tv.tv_usec);
#ifdef RX_ENABLE_LOCKS
- AFS_GLOCK();
+ AFS_GLOCK();
#endif /* RX_ENABLE_LOCKS */
- end = osi_Time();
- XSTATS_END_TIME;
- /*
- * If we're supposed to set the time, and the call worked
- * quickly (same second response) and this is the host we
- * use for the time and the time is really different, then
- * really set the time
- */
- if (code == 0 && start == end && afs_setTime != 0 &&
- (tc->srvr->server == afs_setTimeHost ||
- /*
- * Sync only to a server in the local cell: cell(id)==1
- * or CPrimary.
- */
- (afs_setTimeHost == (struct server *)0 &&
- (ts->cell->cell == 1 || (ts->cell->states&CPrimary))))) {
- char msgbuf[90]; /* strlen("afs: setting clock...") + slop */
+ end = osi_Time();
+ XSTATS_END_TIME;
+ /*
+ * If we're supposed to set the time, and the call worked
+ * quickly (same second response) and this is the host we
+ * use for the time and the time is really different, then
+ * really set the time
+ */
+ if (code == 0 && start == end && afs_setTime != 0 &&
+ (tc->srvr->server == afs_setTimeHost ||
+ /*
+ * Sync only to a server in the local cell: cell(id)==1
+ * or CPrimary.
+ */
+ (afs_setTimeHost == (struct server *)0 &&
+ (ts->cell->cell == 1 || (ts->cell->states&CPrimary))))) {
+
+ char msgbuf[90]; /* strlen("afs: setting clock...") + slop */
/* set the time */
delta = end - tv.tv_sec; /* how many secs fast we are */
/* see if clock has changed enough to make it worthwhile */
if (delta >= AFS_MINCHANGE || delta <= -AFS_MINCHANGE) {
- if (delta > AFS_MAXCHANGEBACK) {
- /* setting clock too far back, just do it a little */
- tv.tv_sec = end - AFS_MAXCHANGEBACK;
- }
- afs_osi_SetTime(&tv);
- if (delta > 0) {
- strcpy(msgbuf, "afs: setting clock back ");
- if (delta > AFS_MAXCHANGEBACK) {
- afs_strcat(msgbuf, afs_cv2string(&tbuffer[CVBS], AFS_MAXCHANGEBACK));
- afs_strcat(msgbuf, " seconds (of ");
- afs_strcat(msgbuf, afs_cv2string(&tbuffer[CVBS], delta - AFS_MAXCHANGEBACK));
- afs_strcat(msgbuf, ", via ");
- print_internet_address(msgbuf, sa, "); clock is still fast.", 0);
- } else {
- afs_strcat(msgbuf, afs_cv2string(&tbuffer[CVBS], delta));
- afs_strcat(msgbuf, " seconds (via ");
- print_internet_address(msgbuf, sa, ").", 0);
- }
- }
- else {
- strcpy(msgbuf, "afs: setting clock ahead ");
- afs_strcat(msgbuf, afs_cv2string(&tbuffer[CVBS], -delta));
- afs_strcat(msgbuf, " seconds (via ");
- print_internet_address(msgbuf, sa, ").", 0);
- }
+ if (delta > AFS_MAXCHANGEBACK) {
+ /* setting clock too far back, just do it a little */
+ tv.tv_sec = end - AFS_MAXCHANGEBACK;
+ }
+ afs_osi_SetTime(&tv);
+ if (delta > 0) {
+ strcpy(msgbuf, "afs: setting clock back ");
+ if (delta > AFS_MAXCHANGEBACK) {
+ afs_strcat(msgbuf, afs_cv2string(&tbuffer[CVBS], AFS_MAXCHANGEBACK));
+ afs_strcat(msgbuf, " seconds (of ");
+ afs_strcat(msgbuf, afs_cv2string(&tbuffer[CVBS], delta - AFS_MAXCHANGEBACK));
+ afs_strcat(msgbuf, ", via ");
+ print_internet_address(msgbuf, sa, "); clock is still fast.", 0);
+ } else {
+ afs_strcat(msgbuf, afs_cv2string(&tbuffer[CVBS], delta));
+ afs_strcat(msgbuf, " seconds (via ");
+ print_internet_address(msgbuf, sa, ").", 0);
+ }
+ } else {
+ strcpy(msgbuf, "afs: setting clock ahead ");
+ afs_strcat(msgbuf, afs_cv2string(&tbuffer[CVBS], -delta));
+ afs_strcat(msgbuf, " seconds (via ");
+ print_internet_address(msgbuf, sa, ").", 0);
+ }
}
afs_setTimeHost = tc->srvr->server;
- }
- if (setTimer)
- rx_SetConnDeadTime(tc->id, 50);
- if (code >= 0 && (sa->sa_flags & SRVADDR_ISDOWN) && (tc->srvr == sa)) {
+ }
+ if (setTimer)
+ rx_SetConnDeadTime(tc->id, 50);
+ if (code >= 0 && (sa->sa_flags & SRVADDR_ISDOWN) && (tc->srvr == sa)) {
/* server back up */
print_internet_address("afs: file server ", sa, " is back up", 2);
- /*
- * XXX We should hold a server write lock here XXX
- */
+
+ ObtainWriteLock(&afs_xserver, 244);
+ ObtainWriteLock(&afs_xsrvAddr, 245);
afs_MarkServerUpOrDown(sa, 0);
+ ReleaseWriteLock(&afs_xsrvAddr);
+ ReleaseWriteLock(&afs_xserver);
+
if (afs_waitForeverCount) {
- afs_osi_Wakeup(&afs_waitForever);
+ afs_osi_Wakeup(&afs_waitForever);
}
- }
- else
- if (code < 0) {
- /* server crashed */
- afs_ServerDown(sa);
- ForceNewConnections(sa); /* multi homed clients */
- }
- }
+ } else {
+ if (code < 0) {
+ /* server crashed */
+ afs_ServerDown(sa);
+ ForceNewConnections(sa); /* multi homed clients */
+ }
+ }
+ }
- afs_PutConn(tc, SHARED_LOCK); /* done with it now */
- } /* for each server loop */
- } /* for each server hash bucket loop */
- ReleaseReadLock(&afs_xsrvAddr);
- ReleaseReadLock(&afs_xserver);
+ afs_PutConn(tc, SHARED_LOCK); /* done with it now */
+ } /* Outer loop over addrs */
+
+ afs_osi_Free(addrs, srvAddrCount * sizeof(*addrs));
} /*afs_CheckServers*/
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_vcache.c,v 1.1.1.9 2001/10/14 17:58:59 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_vcache.c,v 1.1.1.10 2002/01/22 19:48:01 hartmans Exp $");
#include "../afs/sysincludes.h" /*Standard vendor system headers*/
#include "../afs/afsincludes.h" /*AFS-based standard headers*/
} /*afs_RemoveVCB*/
+#if defined(AFS_LINUX22_ENV)
+/* afs_TryFlushDcacheChildren -- Shakes loose vcache references held by
+ * children of the dentry
+ * LOCKS -- Called with afs_xvcache write locked. Drops and reaquires
+ * AFS_GLOCK, so it can call dput, which may call iput, but
+ * keeps afs_xvcache exclusively.
+ *
+ * Tree traversal algorithm from fs/dcache.c: select_parent()
+ */
+static void afs_TryFlushDcacheChildren(struct dentry *parent)
+{
+ struct dentry *this_parent = parent;
+ struct list_head *next;
+
+ repeat:
+ next = this_parent->d_subdirs.next;
+ resume:
+ while (next != &this_parent->d_subdirs) {
+ struct list_head *tmp = next;
+ struct dentry *dentry = list_entry(tmp, struct dentry, d_child);
+
+ next = tmp->next;
+ if (!DCOUNT(dentry) && !dentry->d_inode) {
+ DGET(dentry);
+ DUNLOCK();
+ AFS_GUNLOCK();
+ d_drop(dentry);
+ dput(dentry);
+ AFS_GLOCK();
+ DLOCK();
+ goto repeat;
+ }
+
+ /*
+ * Descend a level if the d_subdirs list is non-empty.
+ */
+ if (!list_empty(&dentry->d_subdirs)) {
+ this_parent = dentry;
+ goto repeat;
+ }
+ }
+
+ /*
+ * All done at this level ... ascend and resume the search.
+ */
+ if (this_parent != parent) {
+ next = this_parent->d_child.next;
+ this_parent = this_parent->d_parent;
+ goto resume;
+ }
+}
+/* afs_TryFlushDcache -- Shakes loose vcache references held by the Linux
+ * dcache.
+ *
+ * LOCKS -- Called with afs_xvcache write locked. Drops and reaquires
+ * AFS_GLOCK, so it can call dput, which may call iput, but
+ * keeps afs_xvcache exclusively.
+ */
+static void afs_TryFlushDcache(struct vcache *vcp)
+{
+ struct inode *ip = (struct inode *) vcp;
+
+ DLOCK();
+ retry:
+ if (!list_empty(&ip->i_dentry)) {
+ struct list_head *cur, *head = &ip->i_dentry;
+ cur = head;
+ while ((cur = cur->next) != head) {
+ struct dentry *dentry = list_entry(cur, struct dentry, d_alias);
+
+ if (DCOUNT(dentry)) {
+ afs_TryFlushDcacheChildren(dentry);
+ }
+
+ if (!DCOUNT(dentry)) {
+ DGET(dentry);
+ DUNLOCK();
+ AFS_GUNLOCK();
+ d_drop(dentry);
+ dput(dentry);
+ AFS_GLOCK();
+ DLOCK();
+ goto retry;
+ }
+ }
+ DUNLOCK();
+ }
+}
+#endif
+
/*
* afs_NewVCache
*
int code, fv_slept;
AFS_STATCNT(afs_NewVCache);
-#ifdef AFS_LINUX22_ENV
- if (!freeVCList) {
- /* Free some if possible. */
- struct afs_q *tq, *uq;
- int i; char *panicstr;
- int vmax = 2 * afs_cacheStats;
- int vn = VCACHE_FREE;
-
- AFS_GUNLOCK();
- shrink_dcache_sb(afs_globalVFS);
- AFS_GLOCK();
-
- i = 0;
- for(tq = VLRU.prev; tq != &VLRU && vn > 0; tq = uq) {
- tvc = QTOV(tq);
- uq = QPrev(tq);
- if (tvc->states & CVFlushed)
- refpanic ("CVFlushed on VLRU");
- else if (i++ > vmax)
- refpanic ("Exceeded pool of AFS vnodes(VLRU cycle?)");
- else if (QNext(uq) != tq)
- refpanic ("VLRU inconsistent");
-
- if (tvc == afs_globalVp)
- continue;
-
- if ( VREFCOUNT(tvc) && tvc->opens == 0 ) {
- struct inode *ip = (struct inode*)tvc;
- if (list_empty(&ip->i_dentry)) {
- vn --;
- }
- else {
- struct list_head *cur;
- struct list_head *head = &ip->i_dentry;
- int all = 1;
- restart:
-#if defined(AFS_LINUX24_ENV)
- spin_lock(&dcache_lock);
-#endif
- cur = head;
- while ((cur = cur->next) != head) {
- struct dentry *dentry = list_entry(cur, struct dentry, d_alias);
-#if defined(AFS_LINUX24_ENV)
- if (!atomic_read(&dentry->d_count)) {
-#else
- if (!dentry->d_count) {
-#endif
- AFS_GUNLOCK();
-#if defined(AFS_LINUX24_ENV)
- dget_locked(dentry);
- spin_unlock(&dcache_lock);
-#else
- dget(dentry);
-#endif
- d_drop(dentry);
- dput(dentry);
- AFS_GLOCK();
- goto restart;
- }
- else {
- all = 0;
- }
- }
-#if defined(AFS_LINUX24_ENV)
- spin_unlock(&dcache_lock);
-#endif
- if (all) vn --;
- }
- }
- if (tq == uq) break;
- }
- }
-#endif /* AFS_LINUX22_ENV */
#ifdef AFS_OSF_ENV
#ifdef AFS_OSF30_ENV
if (afs_vcount >= afs_maxvcount)
continue; /* start over - may have raced. */
}
}
+#endif
+#if defined(AFS_LINUX22_ENV)
+ if (tvc != afs_globalVp && VREFCOUNT(tvc) && tvc->opens == 0)
+ afs_TryFlushDcache(tvc);
#endif
if (VREFCOUNT(tvc) == 0 && tvc->opens == 0
&& (tvc->states & CUnlinkedDel) == 0) {
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(&inode->i_dirty_data_buffers);
+#endif
+#ifdef STRUCT_INODE_HAS_I_DEVICES
+ INIT_LIST_HEAD(&inode->i_devices);
+#endif
ip->i_data.host = (void*) ip;
ip->i_mapping = &ip->i_data;
+#ifdef STRUCT_INODE_HAS_I_TRUNCATE_SEM
+ init_rwsem(&ip->i_truncate_sem);
+#endif
#else
sema_init(&ip->i_atomic_write, 1);
init_waitqueue(&ip->i_wait);
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_volume.c,v 1.1.1.8 2001/10/14 17:59:00 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_volume.c,v 1.1.1.9 2002/01/22 19:48:02 hartmans Exp $");
#include "../afs/stds.h"
#include "../afs/sysincludes.h" /* Standard vendor system headers */
for (vp=afs_volumes[j]; vp; vp=vp->next) {
for (k=0; k<MAXHOSTS; k++) {
if (!srvp || (vp->serverHost[k] == srvp)) {
+ vp->serverHost[k] = 0;
afs_ResetVolumeInfo(vp);
break;
}
(lock)->src_indicator = src;\
ENDMAC
-#define NBObtainWriteLock(lock, src) (((lock)->excl_locked || (lock)->readers_reading) ? EWOULDBLOCK : ((lock) -> excl_locked = WRITE_LOCK), ((lock)->pid_writer = MyPidxx), ((lock)->src_indicator = src), 0)
+#define NBObtainWriteLock(lock, src) (((lock)->excl_locked || (lock)->readers_reading) ? EWOULDBLOCK : (((lock) -> excl_locked = WRITE_LOCK), ((lock)->pid_writer = MyPidxx), ((lock)->src_indicator = src), 0))
#define ObtainSharedLock(lock, src)\
BEGINMAC \
(lock)->src_indicator = src;\
ENDMAC
+#define NBObtainSharedLock(lock, src) (((lock)->excl_locked) ? EWOULDBLOCK : (((lock) -> excl_locked = SHARED_LOCK), ((lock)->pid_writer = MyPidxx), ((lock)->src_indicator = src), 0))
+
#define UpgradeSToWLock(lock, src)\
BEGINMAC \
/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKOBTAIN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)BOOSTED_LOCK);} */ \
Afs_Lock_Obtain(lock, WRITE_LOCK); \
ENDMAC
-#define NBObtainWriteLock(lock, src) (((lock)->excl_locked || (lock)->readers_reading) ? EWOULDBLOCK : ((lock) -> excl_locked = WRITE_LOCK), 0)
+#define NBObtainWriteLock(lock, src) (((lock)->excl_locked || (lock)->readers_reading) ? EWOULDBLOCK : (((lock) -> excl_locked = WRITE_LOCK), 0))
#define ObtainSharedLock(lock, src)\
BEGINMAC \
Afs_Lock_Obtain(lock, SHARED_LOCK); \
ENDMAC
+#define NBObtainSharedLock(lock, src) (((lock)->excl_locked) ? EWOULDBLOCK : (((lock) -> excl_locked = SHARED_LOCK), 0))
+
#define UpgradeSToWLock(lock, src)\
BEGINMAC \
/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKOBTAIN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)BOOSTED_LOCK);} */ \
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/afsd.c,v 1.1.1.11 2001/10/14 18:03:37 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/afsd.c,v 1.1.1.12 2002/01/22 19:52:07 hartmans Exp $");
#define VFS 1
(strcmp(currp->d_name, ".tags") == 0) ||
(strcmp(currp->d_name, "quota.user") == 0) ||
(strcmp(currp->d_name, "quota.group") == 0) ||
+#endif
+#ifdef AFS_LINUX22_ENV
+ /* this is the ext3 journal file */
+ (strcmp(currp->d_name, ".journal") == 0) ||
#endif
(strcmp(currp->d_name, "lost+found") == 0)) {
/*
return 0;
}
+static ConfigCellAlias(aca, arock, adir)
+ register struct afsconf_cellalias *aca;
+ char *arock;
+ struct afsconf_dir *adir;
+{
+ /* push the alias into the kernel */
+ call_syscall(AFSOP_ADDCELLALIAS, aca->aliasName, aca->realName);
+ return 0;
+}
+
#ifdef AFS_AFSDB_ENV
static AfsdbLookupHandler()
{
lookingForHomeCell = 1;
afsconf_CellApply(cdir, ConfigCell, (char *) 0);
+ afsconf_CellAliasApply(cdir, ConfigCellAlias, (char *) 0);
/*
* If we're still looking for the home cell after the whole cell configuration database
#endif
error = syscall(AFS_SYSCALL, AFSCALL_CALL, param1, param2, param3, param4, param5, param6, param7);
- if (afsd_verbose) printf("SScall(%d, %d)=%d ", AFS_SYSCALL, AFSCALL_CALL, error);
+ if (afsd_verbose) printf("SScall(%d, %d, %d)=%d ", AFS_SYSCALL, AFSCALL_CALL, param1, error);
return (error);
}
#else /* AFS_AIX32_ENV */
LIBS=libauth.a ${TOP_LIBDIR}/libsys.a \
${TOP_LIBDIR}/librxkad.a ${TOP_LIBDIR}/libdes.a \
${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/libsys.a \
- ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a ${XLIBS}
+ ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a
INCLS=cellconfig.h auth.h keys.h
KSRCS=auth.h
UKSRCS=${KSRCS} cellconfig.h acfg_errors.c keys.h cellconfig.c \
$(AR) crv $@ $(KOBJS) AFS_component_version_number.o
$(RANLIB) $@
-copyauth: copyauth.o
- $(CC) $(CFLAGS) -o copyauth copyauth.o ${LIBS}
+copyauth: copyauth.o
+ $(CC) $(CFLAGS) -o copyauth copyauth.o ${LIBS} ${XLIBS}
-setkey: setkey.o
- ${CC} $(CFLAGS) -o setkey setkey.o ${LIBS}
+setkey: setkey.o
+ ${CC} $(CFLAGS) -o setkey setkey.o ${LIBS} ${XLIBS}
acfg_errors.o: acfg_errors.c
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/auth/cellconfig.c,v 1.1.1.11 2001/10/14 18:04:01 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/auth/cellconfig.c,v 1.1.1.12 2002/01/22 19:52:29 hartmans Exp $");
#include <afs/stds.h>
#include <afs/pthread_glock.h>
#include <netdb.h>
#include <sys/file.h>
#include <sys/time.h>
-#include <afs/afsint.h>
#ifdef AFS_AFSDB_ENV
#include <arpa/nameser.h>
#include <resolv.h>
#endif /* AFS_AFSDB_ENV */
#endif /* AFS_NT40_ENV */
+#include <afs/afsint.h>
#include <errno.h>
#include <ctype.h>
#include <time.h>
FILE *tf;
register char *tp, *bp;
register struct afsconf_entry *curEntry;
+ struct afsconf_aliasentry *curAlias;
register afs_int32 code;
afs_int32 i;
char tbuffer[256], tbuf1[256];
curEntry->next = adir->entries;
adir->entries = curEntry;
}
-
+
+ /* Read in the alias list */
+ strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLALIAS_FILE, NULL);
+
+ tf = fopen(tbuffer, "r");
+ while (tf) {
+ char *aliasPtr;
+
+ tp = fgets(tbuffer, sizeof(tbuffer), tf);
+ if (!tp) break;
+ TrimLine(tbuffer); /* remove white space */
+
+ if (tbuffer[0] == '\0' ||
+ tbuffer[0] == '\n' ||
+ tbuffer[0] == '#') continue; /* empty line */
+
+ tp = tbuffer;
+ while (tp[0] != '\0' && tp[0] != ' ' && tp[0] != '\t') tp++;
+ if (tp[0] == '\0') continue; /* invalid line */
+
+ while (tp[0] != '\0' && (tp[0] == ' ' || tp[0] == '\t')) 0[tp++] = '\0';
+ if (tp[0] == '\0') continue; /* invalid line */
+
+ aliasPtr = tp;
+ while (tp[0] != '\0' && tp[0] != ' ' && tp[0] != '\t' &&
+ tp[0] != '\r' && tp[0] != '\n') tp++;
+ tp[0] = '\0';
+
+ curAlias = malloc(sizeof(*curAlias));
+ memset(curAlias, 0, sizeof(*curAlias));
+
+ strcpy(curAlias->aliasInfo.aliasName, aliasPtr);
+ strcpy(curAlias->aliasInfo.realName, tbuffer);
+
+ curAlias->next = adir->alias_entries;
+ adir->alias_entries = curAlias;
+ }
+
/* now read the fs keys, if possible */
adir->keystr = (struct afsconf_keys *) 0;
afsconf_IntGetKeys(adir);
return 0;
}
+/* call aproc(entry, arock, adir) for all cell aliases.
+ * Proc must return 0, or we'll stop early and return the code it returns
+ */
+afsconf_CellAliasApply(adir, aproc, arock)
+ struct afsconf_dir *adir;
+ int (*aproc)();
+ char *arock;
+{
+ register struct afsconf_aliasentry *tde;
+ register afs_int32 code;
+ 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 0;
+}
+
afs_int32 afsconf_SawCell = 0;
afsconf_GetExtendedCellInfo(adir, acellName, aservice, acellInfo, clones)
if (server_num == 0) /* No AFSDB records */
return AFSCONF_NOTFOUND;
+
+ /* Convert the real cell name to lowercase */
+ for (p = (unsigned char *) realCellName; *p; p++)
+ *p = tolower(*p);
+
strncpy(acellInfo->name, realCellName, sizeof(acellInfo->name));
acellInfo->numServers = server_num;
char *acellName;
struct afsconf_cell *acellInfo; {
register struct afsconf_entry *tce;
+ struct afsconf_aliasentry *tcae;
struct afsconf_entry *bestce;
register afs_int32 i;
int tservice;
UNLOCK_GLOBAL_MUTEX
return 0;
}
+
+ /* Look through the list of aliases */
+ for (tcae = adir->alias_entries; tcae; tcae = tcae->next) {
+ if (strcasecmp(tcae->aliasInfo.aliasName, tcell) == 0) {
+ tcell = tcae->aliasInfo.realName;
+ break;
+ }
+ }
+
for(tce=adir->entries;tce;tce=tce->next) {
if (strcasecmp(tce->cellInfo.name, tcell) == 0) {
/* found our cell */
else {
UNLOCK_GLOBAL_MUTEX
#ifdef AFS_AFSDB_ENV
- return afsconf_GetAfsdbInfo(acellName, aservice, acellInfo);
+ return afsconf_GetAfsdbInfo(tcell, aservice, acellInfo);
#else
return AFSCONF_NOTFOUND;
#endif /* AFS_AFSDB_ENV */
int timeout; /* Data timeout, if non-zero */
};
+struct afsconf_cellalias {
+ char aliasName[MAXCELLCHARS];
+ char realName[MAXCELLCHARS];
+};
+
struct afsconf_entry {
struct afsconf_entry *next; /* next guy in afsconf_dir */
struct afsconf_cell cellInfo; /* info for this cell */
};
+struct afsconf_aliasentry {
+ struct afsconf_aliasentry *next;
+ struct afsconf_cellalias aliasInfo;
+};
+
struct afsconf_dir {
char *name; /* pointer to dir prefix */
char *cellName; /* cell name, if any, we're in */
struct afsconf_entry *entries; /* list of cell entries */
struct afsconf_keys *keystr; /* structure containing keys */
afs_int32 timeRead; /* time stamp of file last read */
+ struct afsconf_aliasentry *alias_entries; /* cell aliases */
};
extern struct afsconf_dir *afsconf_Open();
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/auth/ktc.c,v 1.2 2001/11/25 23:10:38 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/auth/ktc.c,v 1.1.1.8 2002/01/22 19:52:29 hartmans Exp $");
#if defined(UKERNEL)
#include "../afs/sysincludes.h"
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/auth/ktc_nt.c,v 1.1.1.5 2001/07/14 22:20:41 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/auth/ktc_nt.c,v 1.1.1.6 2002/01/22 19:52:29 hartmans Exp $");
#include <afs/stds.h>
#include <stdio.h>
strcpy(tp, client->name);
tp += temp+1;
+ /* we need the SMB user name to associate the tokens with in the
+ integrated logon case. */
+ if (flags & AFS_SETTOK_LOGON) {
+ if (client->smbname == NULL)
+ temp = 0;
+ else
+ temp = strlen(client->smbname);
+ if (temp == 0 || temp >= MAXKTCNAMELEN)
+ return KTC_INVAL;
+ strcpy(tp, client->smbname);
+ tp += temp+1;
+ }
+
/* uuid */
status = UuidCreate((UUID *)&uuid);
memcpy(tp, &uuid, sizeof(uuid));
Makefile
bnode.h
bos
+bos_util
boserr.c
bosint.cs.c
bosint.h
OBJS=bosserver.o bnode.o ezbnodeops.o fsbnodeops.o bosint.ss.o bosint.xdr.o \
bosoprocs.o cronbnodeops.o
-all: bosserver ${TOP_INCDIR}/afs/bosint.h bos ${TOP_LIBDIR}/libbos.a ${TOP_INCDIR}/afs/bnode.h
+all: bosserver ${TOP_INCDIR}/afs/bosint.h bos ${TOP_LIBDIR}/libbos.a ${TOP_INCDIR}/afs/bnode.h bos_util
$(OBJS) bosint.xdr.o bosint.cs.o boserr.o: $(INCLS)
bos: bos.o $(LIBS) libbos.a
${CC} ${CFLAGS} -o bos bos.o libbos.a $(LIBS) ${XLIBS}
+bos_util.o: bos_util.c ${INCLS} AFS_component_version_number.o
+
+bos_util: bos_util.o $(LIBS)
+ ${CC} ${CFLAGS} -o bos_util bos_util.o $(LIBS) ${XLIBS}
+
ezbnodeops.o: ezbnodeops.c ${INCLS}
fsbnodeops.o: fsbnodeops.c ${INCLS}
${DESTDIR}${includedir}/afs/bosint.h \
${DESTDIR}${bindir}/bos \
${DESTDIR}${afssrvbindir}/bos \
+ ${DESTDIR}${afssrvsbindir}/bos_util \
${DESTDIR}${libdir}/afs/libbos.a \
${DESTDIR}${includedir}/afs/bnode.h
${DEST}/root.server/usr/afs/bin/bos: bos
${INSTALL} $? $@
+${DEST}/root.server/usr/afs/bin/bos_util: bos_util
+ ${INSTALL} $? $@
+
${DEST}/lib/afs/libbos.a: libbos.a
${INSTALL} $? $@
# Misc. targets
#
clean:
- $(RM) -f *.a *.o bos bosserver testproc bosint.cs.c bosint.ss.c bosint.xdr.c \
- bosint.h core boserr.c bnode.h AFS_component_version_number.c
+ $(RM) -f *.a *.o bos bosserver testproc bos_util \
+ bosint.cs.c bosint.ss.c bosint.xdr.c bosint.h \
+ core boserr.c bnode.h AFS_component_version_number.c
test:
cd test; $(MAKE)
${DESTDIR}${afssrvbindir}/bos: bos
${INSTALL} $? $@
+${DESTDIR}${afssrvsbindir}/bos_util: bos_util
+ ${INSTALL} $? $@
+
${DESTDIR}${libdir}/afs/libbos.a: libbos.a
${INSTALL} $? $@
${DEST}/include/afs/bosint.h \
${DEST}/bin/bos \
${DEST}/root.server/usr/afs/bin/bos \
+ ${DEST}/root.server/usr/afs/bin/bos_util \
${DEST}/lib/afs/libbos.a \
${DEST}/include/afs/bnode.h
-
$(DESTDIR)\lib\afs\afsaudit.lib \
$(DESTDIR)\lib\afs\afsreg.lib \
$(DESTDIR)\lib\afs\afseventlog.lib \
- $(DESTDIR)\lib\afs\afsprocmgmt.lib
+ $(DESTDIR)\lib\afs\afsprocmgmt.lib \
+ $(DESTDIR)\lib\cm_dns.obj
$(BOSSERVER_EXEFILE): $(BOSSERVER_EXEOBJS) $(BOSSERVER_EXELIBS)
$(EXECONLINK)
$(DESTDIR)\lib\afs\afsbos.lib \
$(DESTDIR)\lib\afs\afsreg.lib \
$(DESTDIR)\lib\afs\afsprocmgmt.lib \
- $(DESTDIR)\lib\afs\afspioctl.lib
+ $(DESTDIR)\lib\afs\afspioctl.lib \
+ $(DESTDIR)\lib\cm_dns.obj
$(RS_BOS_EXEFILE): $(BOS_EXEOBJS) $(BOS_EXELIBS)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bnode.c,v 1.1.1.7 2001/10/14 18:04:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bnode.c,v 1.1.1.8 2002/01/22 19:52:31 hartmans Exp $");
#include <stddef.h>
#include <stdlib.h>
tb->errorSignal = 0;
}
if (tp->coreName)
- bozo_Log("%s:%s exited with code %d",
+ bozo_Log("%s:%s exited with code %d\n",
tb->name, tp->coreName, tp->lastExit);
else
- bozo_Log("%s exited with code %d",
+ bozo_Log("%s exited with code %d\n",
tb->name, tp->lastExit);
}
else {
RememberProcName(tp);
}
if (tp->coreName)
- bozo_Log("%s:%s exited on signal %d%s",
+ bozo_Log("%s:%s exited on signal %d%s\n",
tb->name, tp->coreName, tp->lastSignal,
WCOREDUMP(status) ? " (core dumped)" : "");
else
- bozo_Log("%s exited on signal %d%s",
+ bozo_Log("%s exited on signal %d%s\n",
tb->name, tp->lastSignal,
WCOREDUMP(status) ? " (core dumped)" : "");
SaveCore(tb, tp);
) = 94;
GetCellHost(
- IN afs_int32 awhich,
+ IN afs_uint32 awhich,
OUT string name<BOZO_BSSIZE>
) = 95;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosserver.c,v 1.1.1.10 2001/10/14 18:04:05 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosserver.c,v 1.1.1.11 2002/01/22 19:52:32 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
struct ktc_encryptionKey tkey;
int i;
char namebuf[AFSDIR_PATH_MAX];
-
+#ifndef AFS_NT40_ENV
+ int nofork = 0;
+#endif
#ifdef AFS_AIX32_ENV
struct sigaction nsa;
DoSyslog = 1;
DoSyslogFacility = atoi(argv[code]+8);
}
+ else if (strcmp(argv[code], "-nofork")==0) {
+ nofork = 1;
+ }
#endif
else if (strcmp(argv[code], "-enable_peer_stats")==0) {
rx_enablePeerRPCStats();
printf("Usage: bosserver [-noauth] [-log] "
"[-syslog[=FACILITY]] "
"[-enable_peer_stats] [-enable_process_stats] "
+ "[-nofork] "
"[-help]\n");
#else
printf("Usage: bosserver [-noauth] [-log] "
/* go into the background and remove our controlling tty */
#ifndef AFS_NT40_ENV
+ if (!nofork)
background();
#endif /* ! AFS_NT40_ENV */
$(DESTDIR)\lib\afs\afsusd.lib \
$(DESTDIR)\lib\afs\afsprocmgmt.lib \
$(DESTDIR)\lib\afs\afspioctl.lib \
- $(DESTDIR)\lib\afs\afsreg.lib
+ $(DESTDIR)\lib\afs\afsreg.lib \
+ $(DESTDIR)\lib\cm_dns.obj
$(EXEFILE): $(EXEOBJS) $(EXELIBS)
$(DESTDIR)\lib\afsubik.lib \
$(DESTDIR)\lib\afs\afseventlog.lib \
$(DESTDIR)\lib\afs\afsreg.lib \
- $(DESTDIR)\lib\afs\afsprocmgmt.lib
+ $(DESTDIR)\lib\afs\afsprocmgmt.lib \
+ $(DESTDIR)\lib\cm_dns.obj
$(EXEFILE): $(EXEOBJS) $(EXELIBS)
$(DESTDIR)\lib\afs\afsprocmgmt.lib \
$(DESTDIR)\lib\afs\afspioctl.lib \
$(DESTDIR)\lib\afs\afseventlog.lib \
- $(DESTDIR)\lib\afs\afsreg.lib
+ $(DESTDIR)\lib\afs\afsreg.lib \
+ $(DESTDIR)\lib\cm_dns.obj
$(EXEFILE): $(EXEOBJS) $(EXELIBS)
$(EXECONLINK)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/butc/tcmain.c,v 1.1.1.7 2001/10/14 18:04:17 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butc/tcmain.c,v 1.1.1.8 2002/01/22 19:52:42 hartmans Exp $");
#include <sys/types.h>
#include <sys/stat.h>
count = sscanf(line, "%s %s %s %u%s\n",
tcapacity, tfmsize, devName, &aport, trest);
- if (count == 4) {
+ if (count == 4 || count == 5) {
if ( atocl(tcapacity, 'K', &capacity) ) {
fprintf(stderr, "tapeconfig: Tape capacity parse error in: %s\n", line);
ERROR_EXIT(-1);
}
} else {
count = sscanf(line, "%s %u%s\n", devName, &aport, trest);
- if (count == 2) {
+ if (count == 2 || count == 3) {
capacity = 0x7fffffff;
fmSize = 0;
} else {
AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes)
CPPFLAGS="$save_CPPFLAGS"])
+AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM, [
+AC_MSG_CHECKING(for i_truncate_sem in struct inode)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_truncate_sem,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>],
+[struct inode _i;
+printf("%x\n", _i.i_truncate_sem);],
+ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes,
+ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)])
+AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem)
+CPPFLAGS="$save_CPPFLAGS"])
+
AC_DEFUN(LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, [
AC_MSG_CHECKING(for page_lock in struct address_space)
save_CPPFLAGS="$CPPFLAGS"
AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)
CPPFLAGS="$save_CPPFLAGS"])
-AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM, [
-AC_MSG_CHECKING(for i_truncate_sem in struct inode)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_truncate_sem,
-[
-AC_TRY_COMPILE(
-[#include <linux/fs.h>],
-[struct inode _inode;
-printf("%d\n", _inode.i_truncate_sem);],
-ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes,
-ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem)
-CPPFLAGS="$save_CPPFLAGS"])
-
AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DEVICES, [
AC_MSG_CHECKING(for i_devices in struct inode)
save_CPPFLAGS="$CPPFLAGS"
#
#
# compilation and link editor flags
-XCFLAGS=-no-precomp
+XCFLAGS=-no-cpp-precomp
#MT_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV ${XCFLAGS}
#MT_CC=cc
KROOT=
-pthread.dll 0x61000000 0x00080000
+afspthread.dll 0x61000000 0x00080000
afsrpc.dll 0x61080000 0x00080000
afsauthent.dll 0x61100000 0x00080000
afspioctl.dll 0x61200000 0x00080000
! IF (!EXIST($(DESTDIR)\WinInstall\Config))
$(MKDIR) $(DESTDIR)\WinInstall\Config
! ENDIF
+! IF (!EXIST($(DESTDIR)\WinInstall\Dll))
+ $(MKDIR) $(DESTDIR)\WinInstall\Dll
+! ENDIF
! IF (!EXIST($(DESTDIR)\root.server))
$(MKDIR) $(DESTDIR)\root.server
! ENDIF
$(COPY) $? $@
util_cr + $@
-$(DESTDIR)\bin\NTLang.bat: NTLang.bat util_cr.exe
+$(DESTDIR)\bin\NTLang.bat: NTLang.bat util_cr.exe
$(COPY) NTLang.bat $(DESTDIR)\bin
util_cr + $(DESTDIR)\bin\NTLang.bat
- symlink make $(DESTDIR)\doc doc-pathname
-version: $(DESTDIR)\bin\mkvers.exe NTMakefile.version
+version: $(DESTDIR)\bin\mkvers.exe NTMakefile.version
NTMakefile.version: NTMakefile.version-CML NTMakefile.version-NOCML
$(DEL) NTMakefile.version
langsetup: $(DESTDIR)\bin\NTLang.bat
-install: idirs $(INCTOOLS) $(INCCOPY) version $(INCFILES) $(DESTDIR)\NTDllmap.txt langsetup
+install: idirs $(INCTOOLS) $(INCCOPY) version $(INCFILES) $(DESTDIR)\NTDllmap.txt langsetup
install9x: install
!ENDIF
#define used in WinNT/2000 installation and program version display
-AFSPRODUCT_VERSION=1.1.1 a
+AFSPRODUCT_VERSION=1.2.2 b
CELLNAME_DEFAULT=Your Cell Name
CELLSERVDB_INSTALL=CellServDB.GrandCentral
CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB
+#NMAKE_DEFINES=-DDEBUG_VERBOSE
!IFNDEF TARGETOS
TARGETOS = WINNT
-DAFS_AFSDB_ENV \
-DAFS_FREELANCE_CLIENT
-afscdefs = $(afscdefs) $(AFSDEV_AUXCDEFINES)
+afscdefs = $(afscdefs) $(AFSDEV_AUXCDEFINES) $(NMAKE_DEFINES)
# Compiler switches (except include paths and preprocessor defines)
CPP2OBJ = $(cc) $(cflags) $(cdebug) $(cvarsdll) $(afscflags) $(afscdefs) /c
# Resource compiler macro
-RC = $(rc) $(rcvars) $(rcflags) $(AFSDEV_AUXRCFLAGS)
+RC = $(rc) $(rcvars) $(rcflags) $(AFSDEV_AUXRCFLAGS) /d "AFSPRODUCT_VERSION=\"$(AFSPRODUCT_VERSION)\""
# Lex/Yacc macros
-LEX = flex -l
+LEX =1.2.2 a
YACC = bison
# Inference rules for building and installing targets
!ENDIF
#define used in Win9x installation and program version display
-AFSPRODUCT_VERSION=1.1.1 a
+AFSPRODUCT_VERSION=1.2.2 b
CELLNAME_DEFAULT=Your Cell Name
CELLSERVDB_INSTALL=CellServDB.GrandCentral
CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB
CPP2OBJ = $(cc) $(cflags) $(cdebug) $(cvarsdll) $(afscflags) $(afscdefs) $(afscppdefs) /c
# Resource compiler macro
-RC = $(rc) $(rcvars) $(rcflags) $(AFSDEV_AUXRCFLAGS)
+RC = $(rc) $(rcvars) $(rcflags) $(AFSDEV_AUXRCFLAGS) /d "AFSPRODUCT_VERSION=\"$(AFSPRODUCT_VERSION)\""
# Lex/Yacc macros
LEX = flex -l
#define AFSOP_ADDCELL2 29 /* 2nd add cell protocol interface */
#define AFSOP_AFSDB_HANDLER 30 /* userspace AFSDB lookup handler */
#define AFSOP_SET_DYNROOT 31 /* enable/disable dynroot support */
+#define AFSOP_ADDCELLALIAS 32 /* create alias for existing cell */
/* The range 20-30 is reserved for AFS system offsets in the afs_syscall */
#define AFSCALL_PIOCTL 20
#define SYS_NAME_ID_mac_mach51 502
#define SYS_NAME_ID_ppc_darwin_12 503
#define SYS_NAME_ID_ppc_darwin_13 504
+#define SYS_NAME_ID_ppc_darwin_14 505
#define SYS_NAME_ID_next_mach20 601
#define SYS_NAME_ID_next_mach30 602
#define SYS_NAME_ID_sparc_linux2 1700
#define SYS_NAME_ID_sparc_linux22 1701
+#define SYS_NAME_ID_sparc_linux24 1702
#define SYS_NAME_ID_sparc64_linux2 1800
#define SYS_NAME_ID_sparc64_linux22 1801
#include <net/net_globals.h>
#endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
+
+#define memset(A, B, S) bzero(A, S)
+#define memcpy(B, A, S) bcopy(A, B, S)
+#define memcmp(A, B, S) bcmp(A, B, S)
#endif /* _KERNEL */
#endif /* AFS_PARAM_H */
#include <net/net_globals.h>
#endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
+
+#define memset(A, B, S) bzero(A, S)
+#define memcpy(B, A, S) bcopy(A, B, S)
+#define memcmp(A, B, S) bcmp(A, B, S)
#endif /* _KERNEL */
#endif /* AFS_PARAM_H */
#define VIOC_PREFETCHTAPE _VICEIOCTL(66) /* MR-AFS prefetch from tape */
#define VIOC_RESIDENCY_CMD _VICEIOCTL(67) /* generic MR-AFS cmds */
#define VIOC_STATISTICS _VICEIOCTL(68) /* arla: fetch statistics */
+
+/* Coordinated 'C' pioctl's */
+#define VIOC_NEWALIAS _VICEIOCTL2('C', 1) /* create new cell alias */
+#define VIOC_GETALIAS _VICEIOCTL2('C', 2) /* get alias info */
+
#endif /* AFS_VENUS_H */
libdes.a: ${OBJS} AFS_component_version_number.o
$(RM) -f libdes.a
- ar r libdes.a ${OBJS} AFS_component_version_number.o
+ $(AR) crv libdes.a ${OBJS} AFS_component_version_number.o
$(RANLIB) libdes.a
make_ip: make_ip.o misc.o main.o
${UKERNELDIR}/des/libdes.a \
${UKERNELDIR}/des/des.h \
${UKERNELDIR}/des/mit-cpyright.h
-
+
${UKERNELDIR}/des:
mkdir -p $?
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/des/make_p_table.c,v 1.1.1.5 2001/07/14 22:21:34 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/des/make_p_table.c,v 1.1.1.6 2002/01/22 19:53:08 hartmans Exp $");
#include <mit-cpyright.h>
#include <stdio.h>
for (j = 0; j < 64; j++) {
fprintf(stream,"\n");
for (k = 0; k < 4; k++) {
- fprintf(stream,"0x%08lX",P_prime[i][j*4+k]);
+ fprintf(stream,"0x%08lX",(unsigned long)P_prime[i][j*4+k]);
if ((j == 63) && (k == 3))
fprintf(stream, "}");
if ((i == 3) && (j == 63) && (k == 3))
/* Unsafe: conflicts with _KERNEL inclusion of headers below */
/* #include <afs/param.h> */
-#include <afsconfig.h>
-
-RCSID("$Header: /tmp/cvstemp/openafs/src/export/export.c,v 1.1.1.3 2001/07/11 03:08:53 hartmans Exp $");
+/* #include <afsconfig.h> */
+/* RCSID("$Header: /tmp/cvstemp/openafs/src/export/export.c,v 1.1.1.4 2002/01/22 19:53:11 hartmans Exp $"); */
#define _KERNEL
#include "sys/types.h"
StoreData(
IN AFSFid *Fid,
AFSStoreStatus *InStatus,
- afs_int32 Pos,
- afs_int32 Length,
- afs_int32 FileLength,
+ afs_uint32 Pos,
+ afs_uint32 Length,
+ afs_uint32 FileLength,
OUT AFSFetchStatus *OutStatus,
AFSVolSync *Sync
) split = 133;
user.o: user.c ${INCLS} ${TOP_INCDIR}/afs/vice.h
${CC} ${CFLAGS} -c user.c
-kdb: kdb.o ${INCLS}
+kdb: kdb.o ${INCLS} ${LIBS} libkauth.a
${CC} ${LDFLAGS} -o kdb kdb.o libkauth.a ${LIBS} ${XLIBS}
kdb.o: kdb.c AFS_component_version_number.o
char **reasonP
);
+extern afs_int32 ka_UserAuthenticateGeneral2 (
+ afs_int32 flags,
+ char *name,
+ char *instance,
+ char *realm,
+ char *password,
+ char *smbname,
+ Date lifetime,
+ afs_int32 *password_expires,
+ afs_int32 spare2,
+ char **reasonP
+);
extern afs_int32 ka_UserAuthenticate (
char *name,
char *instance,
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/user_nt.c,v 1.1.1.7 2001/10/14 18:05:12 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/user_nt.c,v 1.1.1.8 2002/01/22 19:53:24 hartmans Exp $");
#include <afs/stds.h>
afs_int32 *password_expiresP,
afs_int32 spare,
char **reasonP)
+{
+ return ka_UserAuthenticateGeneral2(flags, name, instance, realm, password, NULL,
+ lifetime, password_expiresP, spare, reasonP);
+}
+
+afs_int32 ka_UserAuthenticateGeneral2(
+ afs_int32 flags,
+ char *name,
+ char *instance,
+ char *realm,
+ char *password,
+ char *smbname,
+ Date lifetime,
+ afs_int32 *password_expiresP,
+ afs_int32 spare,
+ char **reasonP)
{
int code;
struct ktc_encryptionKey key1, key2;
strcpy(client.name, name);
strcpy(client.instance, instance);
strcpy(client.cell, upperRealm);
+ if (smbname)
+ strcpy(client.smbname, smbname);
token.startTime = 0; /* XXX */
token.endTime = expirationTime;
/* Check and extract server's name */
if ((strlen(ptr) + (ptr - (char *) cip->dat)) > cip->length) {
- return(INTK_BADPW);
- }
+ return(INTK_BADPW);
+ }
(void) strncpy(s_service, ptr, sizeof(s_service)-1);
s_service[sizeof(s_service)-1] = '\0';
/* Check and extract server's instance */
if ((strlen(ptr) + (ptr - (char *) cip->dat)) > cip->length) {
- return(INTK_BADPW);
- }
+ return(INTK_BADPW);
+ }
(void) strncpy(s_instance,ptr, sizeof(s_instance)-1);
s_instance[sizeof(s_instance)-1] = '\0';
/* Check and extract server's realm */
if ((strlen(ptr) + (ptr - (char *) cip->dat)) > cip->length) {
- return(INTK_BADPW);
- }
+ return(INTK_BADPW);
+ }
(void) strncpy(s_realm,ptr, sizeof(s_realm));
s_realm[sizeof(s_realm)-1] = '\0';
if ((ticket_len < 0) ||
((ticket_len + (ptr - (char *) cip->dat)) > (int) cip->length)) {
return(INTK_BADPW);
- }
+ }
/* Check returned server name, instance, and realm fields */
/*
ILIBDIR = $(DESTDIR)\lib\afs
DLLLIBS =\
- $(DESTDIR)\lib\pthread.lib \
+ $(DESTDIR)\lib\afspthread.lib \
$(DESTDIR)\lib\afsrpc.lib \
$(DESTDIR)\lib\afsauthent.lib
$(DESTDIR)\lib\afs\afsvosadmin.lib \
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afsrpc.lib \
- $(DESTDIR)\lib\pthread.lib
+ $(DESTDIR)\lib\afspthread.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
$(DLLCONLINK) /DEF:bosadmin.def
afscfgadmin.res
DLLLIBS =\
- $(DESTDIR)\lib\pthread.lib \
+ $(DESTDIR)\lib\afspthread.lib \
$(DESTDIR)\lib\afs\afsadminutil.lib \
$(DESTDIR)\lib\afs\afsbosadmin.lib \
$(DESTDIR)\lib\afs\afskasadmin.lib \
test tests: cfgtest.exe
CFGTEST_EXELIBS =\
- $(DESTDIR)\lib\pthread.lib \
+ $(DESTDIR)\lib\afspthread.lib \
$(DESTDIR)\lib\afs\afsadminutil.lib \
$(DESTDIR)\lib\afs\afsclientadmin.lib \
$(DESTDIR)\lib\afs\afscfgadmin.lib \
$(DESTDIR)\lib\afs\afsadminutil.lib \
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afsrpc.lib \
- $(DESTDIR)\lib\pthread.lib
+ $(DESTDIR)\lib\afspthread.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
$(DLLCONLINK) /DEF:clientadmin.def
$(DESTDIR)\lib\afs\afsadminutil.lib \
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afsrpc.lib \
- $(DESTDIR)\lib\pthread.lib
+ $(DESTDIR)\lib\afspthread.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
$(DLLCONLINK) /DEF:kasadmin.def
$(DESTDIR)\lib\afs\afsadminutil.lib \
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afsrpc.lib \
- $(DESTDIR)\lib\pthread.lib
+ $(DESTDIR)\lib\afspthread.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
$(DLLCONLINK) /DEF:ptsadmin.def
install test tests: afscp.exe
AFSCP_EXELIBS =\
- $(DESTDIR)\lib\pthread.lib \
+ $(DESTDIR)\lib\afspthread.lib \
$(DESTDIR)\lib\afs\afsadminutil.lib \
$(DESTDIR)\lib\afs\afsclientadmin.lib \
$(DESTDIR)\lib\afs\afsbosadmin.lib \
ILIBDIR = $(DESTDIR)\lib\afs
DLLLIBS =\
- $(DESTDIR)\lib\pthread.lib \
+ $(DESTDIR)\lib\afspthread.lib \
$(DESTDIR)\lib\afs\afsadminutil.lib \
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afsrpc.lib
IP19_KDEFS = -DIP19 -DEVEREST -DMP -DR4000 \
-mips3 -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE -64
IP20_KDEFS = -DIP20 -DR4000 -DJUMP_WAR -DBADVA_WAR -DTRITON -DUSE_PCI_PIO \
- $(KDEFS_32)
+ -D_R5000_CVT_WAR=1 -DCKPT -D_MTEXT_VFS $(KDEFS_32)
IP21_KDEFS = -DIP21 -DEVEREST -DMP -DTFP -TARG:processor=r8000 $(KDEFS_64)
IP25_KDEFS = -DIP25 -DEVEREST -DMP -DR10000 -TARG:processor=r10000 $(KDEFS_64)
IP26_KDEFS = -DIP26 -DTFP -TARG:sync=off -TARG:processor=r8000 $(KDEFS_64)
-TARG:t5_no_spec_stores $(KDEFS_64)
IP30_KDEFS = -DIP30 -DR10000 -DMP -DCELL_PREPARE -DBHV_PREPARE \
-TARG:processor=r10000 $(KDEFS_64)
+IP35_KDEFS = -DIP35 -DR10000 -DMP -DSN -DSN1 -DMAPPED_KERNEL \
+ -DLARGE_CPU_COUNT \
+ -DPTE_64BIT -DULI -DCKPT -DMIPS4_ISA -DNUMA_BASE \
+ -DNUMA_PM -DNUMA_TBORROW -DNUMA_MIGR_CONTROL -DNUMA_REPLICATION \
+ -DNUMA_REPL_CONTROL -DNUMA_SCHED -DCELL_PREPARE -DBHV_PREPARE \
+ -TARG:processor=r10000 $(KDEFS_64)
# Loader flags
LDFLAGS_64 = -64
LDFLAGS_32 = -n32
<sgi_64>
PROCESSORS = R10000
<sgi_65>
-PROCESSORS = IP19 IP20 IP21 IP25 IP26 IP27 IP28 IP30
+PROCESSORS = IP19 IP20 IP21 IP25 IP26 IP27 IP28 IP30 @IRIX_BUILD_IP35@
<all>
KOBJ = STATIC MODLOAD
IP27) CPU_KDEFS="${IP27_KDEFS}";; \
IP28) CPU_KDEFS="${IP28_KDEFS}";; \
IP30) CPU_KDEFS="${IP30_KDEFS}";; \
+ IP35) CPU_KDEFS="${IP35_KDEFS}";; \
*) echo Unknown IP number $$p ; exit 1 ;; \
esac ;\
case $$t in \
<key>com.apple.kernel.bsd</key>
<string>1.1</string>
<key>com.apple.kernel.mach</key>
- <string>1.0.0b1</string>
+ <string>1.1</string>
</dict>
</dict>
</plist>
DLLLIBS =\
!IF (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" ))
- $(DESTDIR)\lib\win95\pthread.lib \
+ $(DESTDIR)\lib\win95\afspthread.lib \
!ELSE
- $(DESTDIR)\lib\pthread.lib \
+ $(DESTDIR)\lib\afspthread.lib \
!ENDIF
$(DESTDIR)\lib\afsrpc.lib \
$(DESTDIR)\lib\afsdes.lib \
ktc_OldPioctl @76
pioctl @77
rx_Init @78
+ ka_UserAuthenticateGeneral2 @79
DLLLIBS =\
!IF (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" ))
- $(DESTDIR)\lib\win95\pthread.lib \
+ $(DESTDIR)\lib\win95\afspthread.lib \
!ELSE
- $(DESTDIR)\lib\pthread.lib \
+ $(DESTDIR)\lib\afspthread.lib \
!ENDIF
$(DESTDIR)\lib\afs\afsutil.lib \
$(DESTDIR)\lib\afs\afsreg.lib
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_auth.c,v 1.1.1.6 2001/09/11 14:34:00 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_auth.c,v 1.1.1.7 2002/01/22 19:54:09 hartmans Exp $");
#include <security/pam_appl.h>
#include <security/pam_modules.h>
*/
if (!refresh_token) {
setpag();
+#ifdef AFS_KERBEROS_ENV
+ ktc_newpag();
+#endif
if (logmask && LOG_MASK(LOG_DEBUG))
syslog(LOG_DEBUG, "New PAG created in pam_authenticate()");
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_setcred.c,v 1.1.1.6 2001/09/11 14:34:01 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_setcred.c,v 1.1.1.7 2002/01/22 19:54:10 hartmans Exp $");
#include <sys/param.h>
#include <afs/kautils.h>
int origmask;
int logmask = LOG_UPTO(LOG_INFO);
int nowarn = 0;
- int use_first_pass = 0; /* use the password passed in by auth */
+ int use_first_pass = 1; /* use the password passed in by auth */
int try_first_pass = 0;
int got_authtok = 0;
int ignore_uid = 0;
if (logmask && LOG_MASK(LOG_DEBUG))
syslog(LOG_DEBUG, "New PAG created in pam_setcred()");
setpag();
+#ifdef AFS_KERBEROS_ENV
+ ktc_newpag();
+#endif
}
if ( flags & PAM_REFRESH_CRED ) {
if (use_klog) {
- auth_ok = do_klog(user, password, "00:00:01");
+ auth_ok = ! do_klog(user, password, "00:00:01");
ktc_ForgetAllTokens();
} else {
if ( ka_VerifyUserPassword(
}
if ( flags & PAM_ESTABLISH_CRED ) {
- if (use_klog) auth_ok = do_klog(user, password, NULL);
+ if (use_klog) auth_ok = ! do_klog(user, password, NULL);
else {
if ( ka_UserAuthenticateGeneral(
KA_USERAUTH_VERSION,
pam_afs_syslog(LOG_ERR, PAMAFS_PASSEXPFAIL, user);
}
#if defined(AFS_KERBEROS_ENV)
- if (!use_klog) {
if (upwd) {
if ( chown(ktc_tkt_string(), upwd->pw_uid, upwd->pw_gid) < 0 )
pam_afs_syslog(LOG_ERR, PAMAFS_CHOWNKRB, user);
if ( errcode != PAM_SUCCESS )
pam_afs_syslog(LOG_ERR, PAMAFS_KRBFAIL, user);
}
- }
#endif
RET(PAM_SUCCESS);
#include <afsconfig.h>
#include <afs/param.h>
#include <sys/wait.h>
+#include <limits.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_util.c,v 1.1.1.6 2001/10/14 18:06:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_util.c,v 1.1.1.7 2002/01/22 19:54:10 hartmans Exp $");
#include "afs_util.h"
/* get the current AFS pag for the calling process */
static afs_int32 curpag()
{
- gid_t groups[30];
+ gid_t groups[NGROUPS_MAX];
afs_uint32 g0, g1;
afs_uint32 h, l, ret;
afsprocmgmt.res
DLLLIBS =\
- $(DESTDIR)\lib\pthread.lib \
+ $(DESTDIR)\lib\afspthread.lib \
$(DESTDIR)\lib\afs\afsutil.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
test tests: pmgttest.exe
PMGTTEST_EXELIBS =\
- $(DESTDIR)\lib\pthread.lib \
+ $(DESTDIR)\lib\afspthread.lib \
$(DESTDIR)\lib\afs\afsprocmgmt.lib \
$(DESTDIR)\lib\afs\afsutil.lib
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptclient.c,v 1.1.1.7 2001/10/14 18:06:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptclient.c,v 1.1.1.8 2002/01/22 19:54:13 hartmans Exp $");
#ifdef AFS_AIX32_ENV
#include <signal.h>
#include <WINNT/afsevent.h>
#else
#include <netinet/in.h>
-#endif
#include <netdb.h>
+#endif
#include <stdio.h>
#include <rx/xdr.h>
#include <rx/rx.h>
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/LINUX/rx_knet.c,v 1.1.1.6 2001/07/14 22:23:41 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/LINUX/rx_knet.c,v 1.1.1.7 2002/01/22 19:54:25 hartmans Exp $");
#ifdef AFS_LINUX22_ENV
#include "../rx/rx_kcommon.h"
if (rxk_ListenerPid) {
(void) (*sys_killp)(rxk_ListenerPid, 9);
#ifdef AFS_LINUX24_ENV
- afs_osi_Sleep(&rxk_ListenerPid);
+ afs_osi_Sleep(&rxk_ListenerPid); /* get an event */
+ afs_osi_Sleep(&rxk_ListenerPid); /* actually sleep */
#else
rxk_ListenerPid = 0;
#endif
${XDROBJS}: xdr.h
+rxperf.o: rx.h rx_null.h rx_globals.h
+
rx_user.o: rx.h rx_user.h
rx_packet.o: rx_packet.c rx_packet.h
xdr_refernce.o: xdr_refernce.c xdr.h
+rxperf: rxperf.o librx.a
+ ${CC} -o $@ rxperf.o ${LIBS}
+
librx.a: ${LIBOBJS} RX_component_version_number.o
-$(RM) -f $@
$(AR) crv $@ ${LIBOBJS} RX_component_version_number.o
u_short secondsUntilDead; /* Maximum silence from peer before RX_CALL_DEAD */
u_short hardDeadTime; /* hard max for call execution */
u_char ackRate; /* how many packets between ack requests */
+ u_char makeCallWaiters; /* how many rx_NewCalls are waiting */
int nSpecific; /* number entries in specific data */
void **specific; /* pointer to connection specific data */
};
#define RX_ACK_TYPE_ACK 1 /* I have this packet, although I may discard it later */
/* The packet size transmitted for an acknowledge is adjusted to reflect the actual size of the acks array. This macro defines the size */
-#define rx_AckDataSize(nAcks) (sizeof(struct rx_ackPacket) - RX_MAXACKS + (nAcks))
+#define rx_AckDataSize(nAcks) (3 + offsetof(struct rx_ackPacket, acks[nAcks]))
#define RX_CHALLENGE_TIMEOUT 2 /* Number of seconds before another authentication request packet is generated */
+#define RX_CHALLENGE_MAXTRIES 50 /* Max # of times we resend challenge */
/* RX error codes. RX uses error codes from -1 to -64. Rxgen may use other error codes < -64; user programs are expected to return positive error codes */
#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 */
+#define LOGON_OPTION_INTEGRATED 1
+#define LOGON_OPTION_HIGHSECURITY 2
+
/*
* Define ticket types. For Kerberos V4 tickets, this is overloaded as
* the server key version number, so class numbers 0 through 255 are reserved
char name[MAXKTCNAMELEN];
char instance[MAXKTCNAMELEN];
char cell[MAXKTCREALMLEN];
+#ifdef AFS_NT40_ENV
+ char smbname[MAXRANDOMNAMELEN];
+#endif
};
#ifndef NEVERDATE
Makefile
+stress.h
+stress.xdr.c
+stress.cs.c
+stress.ss.c
+stress_errs.h
+stress_errs.c
OPTIMIZE=-g
-INCDIRS= -I${DESTDIR}/include -I..
+CFLAGS=-g -I. -I${srcdir} -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} ${XCFLAGS}
HEADERS = ../rxkad.h stress.h stress_internal.h stress_errs.h
-LDIR= ${DESTDIR}/lib/
-ULIBS = ${LDIR}/afs/libcmd.a ${LDIR}/afs/libcom_err.a ${DESTDIR}/lib/afs/util.a
-
-LIBS = ../librxkad.a ${LDIR}/librx.a ${LDIR}/libdes.a \
- ${LDIR}/liblwp.a ${ULIBS} ${XLIBS}
+LIBS=${TOP_LIBDIR}/librx.a \
+ ${TOP_LIBDIR}/liblwp.a \
+ ${TOP_LIBDIR}/libcmd.a \
+ ${TOP_LIBDIR}/librxkad.a \
+ ${TOP_LIBDIR}/libdes.a \
+ ${TOP_LIBDIR}/librx.a \
+ ${TOP_LIBDIR}/libcom_err.a \
+ ${TOP_LIBDIR}/util.a
LIBRPC = ../../librpc/libafsrpc.so
THLIBS= ${LDIR}/afs/libcmd.a ${LDIR}/afs/libcom_err.a \
${ULIBS} ${XLIBS} ${LIBRPC} -lpthread
-CFLAGS = ${OPTIMIZE} ${INCDIRS} ${XCFLAGS}
-
-
THFLAGS = -mt -DAFS_PTHREAD_ENV
THRULE = ${CC} ${CFLAGS} ${THFLAGS} -c $?
-COMPILE_ET = ${SRCDIR}/bin/compile_et
-
noversion all test system: stress
clean:
${THRULE} -o th_stress.xdr.o
stress.ss.c stress.cs.c stress.xdr.c stress.h: stress.rg
- ${SRCDIR}/bin/rxgen stress.rg
+ ${RXGEN} stress.rg
stress_errs.o: stress_errs.c
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/sys/pagsh.c,v 1.1.1.5 2001/07/14 22:24:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/sys/pagsh.c,v 1.1.1.6 2002/01/22 19:54:37 hartmans Exp $");
#ifdef AFS_AIX32_ENV
#include <signal.h>
#endif
#include <stdio.h>
#include <stdlib.h>
+#include <limits.h>
#ifndef AFS_NT40_ENV
#include <unistd.h>
#endif
static afs_uint32 curpag()
{
- afs_uint32 groups[30];
+ afs_uint32 groups[NGROUPS_MAX];
afs_uint32 g0, g1;
afs_uint32 h, l, ret;
- if (getgroups(30, groups) < 2) return 0;
+ if (getgroups(sizeof groups/sizeof groups[0], groups) < 2) return 0;
g0 = groups[0] & 0xffff;
g1 = groups[1] & 0xffff;
$(DESTDIR)\lib\afs\afsprocmgmt.lib \
$(DESTDIR)\lib\afs\afseventlog.lib \
!IF (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" ))
- $(DESTDIR)\lib\win95\pthread.lib \
+ $(DESTDIR)\lib\win95\afspthread.lib \
!ELSE
- $(DESTDIR)\lib\pthread.lib \
+ $(DESTDIR)\lib\afspthread.lib \
!ENDIF
- $(DESTDIR)\lib\afsdes.lib
+ $(DESTDIR)\lib\afsdes.lib \
+ $(DESTDIR)\lib\cm_dns.obj
# $(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afs\afsprocmgmt.lib \
$(DESTDIR)\lib\afs\afseventlog.lib \
$(DESTDIR)\lib\afs\afsutil.lib \
- $(DESTDIR)\lib\pthread.lib
+ $(DESTDIR)\lib\afspthread.lib
$(EXEFILE): $(EXEOBJS) $(EXELIBS)
$(EXECONLINK)
$(DESTDIR)\lib\afsubik.lib \
$(DESTDIR)\lib\afs\afseventlog.lib \
$(DESTDIR)\lib\afsrxkad.lib \
- $(DESTDIR)\lib\afs\afsprocmgmt.lib
+ $(DESTDIR)\lib\afs\afsprocmgmt.lib \
+ $(DESTDIR)\lib\cm_dns.obj
############################################################################
# Definitions for generating files via RXGEN
/* file names */
#define AFSDIR_THISCELL_FILE "ThisCell"
#define AFSDIR_CELLSERVDB_FILE "CellServDB"
+#define AFSDIR_CELLALIAS_FILE "CellAlias"
#define AFSDIR_KEY_FILE "KeyFile"
#define AFSDIR_ULIST_FILE "UserList"
#define AFSDIR_NOAUTH_FILE "NoAuth"
AFSDIR_SERVER_MIGRATE_DIRPATH_ID,
AFSDIR_SERVER_MIGRATELOG_FILEPATH_ID,
AFSDIR_SERVER_BIN_FILE_DIRPATH_ID,
+ AFSDIR_CLIENT_CELLALIAS_FILEPATH_ID,
AFSDIR_PATHSTRING_MAX } afsdir_id_t;
/* getDirPath() returns a pointer to a string from an internal array of path strings
/* client file paths */
#define AFSDIR_CLIENT_THISCELL_FILEPATH getDirPath(AFSDIR_CLIENT_THISCELL_FILEPATH_ID)
#define AFSDIR_CLIENT_CELLSERVDB_FILEPATH getDirPath(AFSDIR_CLIENT_CELLSERVDB_FILEPATH_ID)
+#define AFSDIR_CLIENT_CELLALIAS_FILEPATH getDirPath(AFSDIR_CLIENT_CELLALIAS_FILEPATH_ID)
#define AFSDIR_CLIENT_NETINFO_FILEPATH getDirPath(AFSDIR_CLIENT_NETINFO_FILEPATH_ID)
#define AFSDIR_CLIENT_NETRESTRICT_FILEPATH getDirPath(AFSDIR_CLIENT_NETRESTRICT_FILEPATH_ID)
*/
#if defined(KERNEL) && !defined(AFS_OSF_ENV) && !defined(AFS_ALPHA_LINUX20_ENV)
#define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl32))
+#define _VICEIOCTL2(dev, id) ((unsigned int ) _IOW(dev, id, struct ViceIoctl32))
#else
#define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl))
+#define _VICEIOCTL2(dev, id) ((unsigned int ) _IOW(dev, id, struct ViceIoctl))
#endif
/* Use this macro to define up to 256 vice ioctl's. These ioctl's
into the kernel by the normal ioctl parameter passing mechanism.
*/
-#define _VALIDVICEIOCTL(com) (com >= _VICEIOCTL(0) && com <= _VICEIOCTL(255))
for f in kdump.IP??; \
do ${INSTALL} -s $$f ${DEST}/etc/$$f || exit $$? ; \
done ;; \
- sun4x_5[78] ) \
+ sun4x_5[789] ) \
${INSTALLex} -f kdump.sh.solaris7 $@; \
${INSTALL} -s -f $? ${DEST}/etc/kdump32;; \
*linux* ) \
${DEST}/etc/kdump64: kdump64
-set -x; \
case ${SYS_NAME} in \
- sun4x_5[78] | hp_ux11* ) \
+ sun4x_5[789] | hp_ux11* ) \
${INSTALL} -s $? $@ ;;\
* ) \
echo skipping kdump64 for ${SYS_NAME} ;; \
-set -x; \
case ${SYS_NAME} in \
alpha_linux* ) \
- ${CC} -g -I${LINUX_KERNEL_PATH}/include -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} -mno-fp-regs -ffixed-8 -o kdump-${LINUX_VERSION}.o -c kdump.c ;; \
+ ${CC} -g -I${LINUX_KERNEL_PATH}/include -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_SRCDIR}/libafs/afs -I${TOP_INCDIR} ${XCFLAGS} -mno-fp-regs -ffixed-8 -o kdump-${LINUX_VERSION}.o -c kdump.c ;; \
*linux* ) \
- ${CC} -g -I${LINUX_KERNEL_PATH}/include -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} -o kdump-${LINUX_VERSION}.o -c kdump.c ;; \
+ ${CC} -g -I${LINUX_KERNEL_PATH}/include -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_SRCDIR}/libafs/afs -I${TOP_INCDIR} ${XCFLAGS} -o kdump-${LINUX_VERSION}.o -c kdump.c ;; \
alpha_osf1 | alpha_osf20 | alpha_osf30 | alpha_osf32 | alpha_osf32c| alpha_dux?? ) \
${CC} -g ${CFLAGS} -I/usr/sys/include -I/usr/sys/BINARY -I/usr/sys/AFS -DDEBUGGER -c kdump.c ;;\
sgi_6? ) \
kdump64.o : kdump.c ${INCLS} AFS_component_version_number.c
-set -x; \
case ${SYS_NAME} in \
- sun4x_5[78] | hp_ux11* ) \
+ sun4x_5[789] | hp_ux11* ) \
${CC} -g -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS64} -o kdump64.o -c kdump.c ;; \
esac
kdump64 : kdump64.o
-set -x; \
case ${SYS_NAME} in \
- sun4x_5[78] | hp_ux11* ) \
+ sun4x_5[789] | hp_ux11* ) \
${CC} -g ${XCFLAGS64} -o kdump64 kdump64.o ${TOP_LIBDIR}/libcmd64.a ${XLIBELFA} ${XLIBKVM} ${XLIBS} ;; \
esac
for f in kdump.IP??; \
do ${INSTALL} -s $$f ${DESTDIR}${sbindir}/$$f || exit $$? ; \
done ;; \
- sun4x_5[78] ) \
+ sun4x_5[789] ) \
${INSTALLex} -f kdump.sh.solaris7 $@; \
${INSTALL} -s -f $? ${DESTDIR}${sbindir}/kdump32;; \
*linux* ) \
${DESTDIR}${sbindir}/kdump64: kdump64
-set -x; \
case ${SYS_NAME} in \
- sun4x_5[78] | hp_ux11* ) \
+ sun4x_5[789] | hp_ux11* ) \
${INSTALL} -s $? $@ ;;\
* ) \
echo skipping kdump64 for ${SYS_NAME} ;; \
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/venus/fs.c,v 1.1.1.8 2001/09/11 14:35:23 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/venus/fs.c,v 1.1.1.9 2002/01/22 19:54:57 hartmans Exp $");
#include <afs/afs_args.h>
#include <rx/xdr.h>
return 0;
}
+static ListAliasesCmd(as)
+ struct cmd_syndesc *as;
+{
+ afs_int32 code, i;
+ char *tp, *aliasName, *realName;
+ struct ViceIoctl blob;
+
+ for(i=0;;i++) {
+ tp = space;
+ memcpy(tp, &i, sizeof(afs_int32));
+ blob.out_size = MAXSIZE;
+ blob.in_size = sizeof(afs_int32);
+ blob.in = space;
+ blob.out = space;
+ code = pioctl(0, VIOC_GETALIAS, &blob, 1);
+ if (code < 0) {
+ if (errno == EDOM) break; /* done with the list */
+ Die(errno, 0);
+ return 1;
+ }
+ tp = space;
+ aliasName = tp;
+ tp += strlen(aliasName) + 1;
+ realName = tp;
+ printf("Alias %s for cell %s\n", aliasName, realName);
+ }
+ return 0;
+}
+
static NewCellCmd(as)
struct cmd_syndesc *as;
{
return 0;
}
+static NewAliasCmd(as)
+ struct cmd_syndesc *as;
+{
+ afs_int32 code;
+ struct ViceIoctl blob;
+ char *tp;
+ char *aliasName, *realName;
+
+ /* Now setup and do the NEWCELL pioctl call */
+ aliasName = as->parms[0].items->data;
+ realName = as->parms[1].items->data;
+ tp = space;
+ strcpy(tp, aliasName);
+ tp += strlen(aliasName) + 1;
+ strcpy(tp, realName);
+ tp += strlen(realName) + 1;
+
+ blob.in_size = tp - space;
+ blob.in = space;
+ blob.out_size = 0;
+ blob.out = space;
+ code = pioctl(0, VIOC_NEWALIAS, &blob, 1);
+ if (code < 0) {
+ if (errno == EEXIST) {
+ fprintf(stderr, "%s: cell name `%s' in use by an existing cell.\n",
+ pn, aliasName);
+ } else {
+ Die(errno, 0);
+ }
+ return 1;
+ }
+ return 0;
+}
+
static WhichCellCmd(as)
struct cmd_syndesc *as;
{
ts = cmd_CreateSyntax("listcells", ListCellsCmd, 0, "list configured cells");
cmd_AddParm(ts, "-numeric", CMD_FLAG, CMD_OPTIONAL, "addresses only");
+ ts = cmd_CreateSyntax("listaliases", ListAliasesCmd, 0, "list configured cell aliases");
+
ts = cmd_CreateSyntax("setquota", SetQuotaCmd, 0, "set volume quota");
cmd_AddParm(ts, "-path", CMD_SINGLE, CMD_OPTIONAL, "dir/file path");
cmd_AddParm(ts, "-max", CMD_SINGLE, 0, "max quota in kbytes");
cmd_AddParm(ts, "-servers", CMD_LIST, CMD_REQUIRED, "primary servers");
cmd_AddParm(ts, "-linkedcell", CMD_SINGLE, CMD_OPTIONAL, "linked cell name");
+ ts = cmd_CreateSyntax("newalias", NewAliasCmd, 0, "configure new cell alias");
+ cmd_AddParm(ts, "-alias", CMD_SINGLE, 0, "alias name");
+ cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "real name of cell");
+
#ifdef FS_ENABLE_SERVER_DEBUG_PORTS
/*
* Turn this on only if you wish to be able to talk to a server which is listening
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/main.c,v 1.1.1.5 2001/09/11 14:35:28 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/main.c,v 1.1.1.6 2002/01/22 19:55:03 hartmans Exp $");
#define VICE /* allow us to put our changes in at will */
#include <stdio.h>
exit(-1);
else
#endif
+#ifdef AFS_SUN5_ENV
+ exit(exitstat);
+#else
exit(4);
+#endif
}
#endif
#ifdef VICE
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/host.c,v 1.1.1.7 2001/10/14 18:07:13 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/host.c,v 1.1.1.8 2002/01/22 19:55:12 hartmans Exp $");
#include <stdio.h>
#include <errno.h>
FreeCE(client);
} else cp = &client->next;
}
+
+ /* We've just cleaned out all the deleted clients; clear the flag */
+ host->hostFlags &= ~CLIENTDELETED;
+
if (host->hostFlags & HOSTDELETED) {
register struct h_hashChain **hp, *th;
register struct rx_connection *rxconn;
$(DESTDIR)\lib\afs\afsaudit.lib \
$(DESTDIR)\lib\afs\afseventlog.lib \
$(DESTDIR)\lib\afs\afsreg.lib \
- $(DESTDIR)\lib\afs\afsprocmgmt.lib
+ $(DESTDIR)\lib\afs\afsprocmgmt.lib \
+ $(DESTDIR)\lib\cm_dns.obj
$(VLSERVER): $(VLSERVER_EXEOBJS) $(LIBFILE) $(VLSERVER_EXECLIBS)
LIBS=${TOP_LIBDIR}/libcmd.a vlib.a ${TOP_LIBDIR}/util.a \
${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libdir.a \
- ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/libacl.a ${XLIBS}
+ ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/libacl.a
CFLAGS = -D${SYS_NAME} ${OPTMZ} ${INCDIRS} ${XCFLAGS} ${DBG}
# new salvager: remove references to /vice by linking with novice.o
salvager: vol-salvage.o physio.o vlib.a
- ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o ${LIBS}
+ ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o ${LIBS} ${XLIBS}
vol-salvage: vol-salvage.o
vol-info: vol-info.o physio.o ihandle.o
case ${SYS_NAME} in \
*linux* | *fbsd*) \
${CC} ${CFLAGS} ${DBG} -o volinfo vol-info.o physio.o \
- ihandle.o ${LIBS} ;; \
+ ihandle.o ${LIBS} ${XLIBS} ;; \
*) \
${CC} ${CFLAGS} ${DBG} -o volinfo vol-info.o physio.o \
- ihandle.o ${LIBS} ;; \
+ ihandle.o ${LIBS} ${XLIBS} ;; \
esac
fs_conv_dux40D: fs_conv_411.o
- ${CC} ${CFLAGS} ${TOP_LIBDIR}/libcmd.a -o fs_conv_dux40D fs_conv_411.o ${LIBS}
+ ${CC} ${CFLAGS} ${TOP_LIBDIR}/libcmd.a -o fs_conv_dux40D fs_conv_411.o ${LIBS} ${XLIBS}
fs_conv_sol26: fs_conv_411.o vlib.a
- ${CC} ${CFLAGS} ${TOP_LIBDIR}/libcmd.a -o fs_conv_sol26 fs_conv_411.o ${LIBS}
+ ${CC} ${CFLAGS} ${TOP_LIBDIR}/libcmd.a -o fs_conv_sol26 fs_conv_411.o ${LIBS} ${XLIBS}
fs_conv_411.o: fs_conv_411.c AFS_component_version_number.c
${CC} ${CFLAGS} -c fs_conv_411.c
$(DESTDIR)\lib\afs\afsreg.lib \
$(DESTDIR)\lib\afs\afsprocmgmt.lib \
$(DESTDIR)\lib\afs\afseventlog.lib \
- $(DESTDIR)\lib\pthread.lib
+ $(DESTDIR)\lib\afspthread.lib
############################################################################
# build salvager
$(DESTDIR)\lib\afslwp.lib \
$(DESTDIR)\lib\afs\afsacl.lib \
$(DESTDIR)\lib\afs\afsreg.lib \
- $(DESTDIR)\lib\afs\afseventlog.lib
+ $(DESTDIR)\lib\afs\afseventlog.lib \
+ $(DESTDIR)\lib\cm_dns.obj
############################################################################
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vos.c,v 1.1.1.8 2001/10/14 18:07:31 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vos.c,v 1.1.1.9 2002/01/22 19:55:17 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
cmd_AddParm(ts, "-noauth", CMD_FLAG, CMD_OPTIONAL, "don't authenticate");\
cmd_AddParm(ts, "-localauth",CMD_FLAG,CMD_OPTIONAL,"use server tickets");\
cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, "verbose");\
-cmd_AddParm(ts, "-crypt", CMD_FLAG, CMD_OPTIONAL, "encrypt commands");\
+cmd_AddParm(ts, "-encrypt", CMD_FLAG, CMD_OPTIONAL, "encrypt commands");\
#define ERROR_EXIT(code) {error=(code); goto error_exit;}