]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
This commit was generated by cvs2svn to compensate for changes in r417,
authorSam Hartman <hartmans@debian.org>
Tue, 22 Jan 2002 19:55:17 +0000 (19:55 +0000)
committerSam Hartman <hartmans@debian.org>
Tue, 22 Jan 2002 19:55:17 +0000 (19:55 +0000)
which included commits to RCS files with non-trunk default branches.

151 files changed:
NEWS
acconfig.h
acinclude.m4
src/NTMake9x
src/NTMakefile
src/WINNT/afs_setup_utils/NTMakefile
src/WINNT/afs_setup_utils/_isuser/_IsUser.RC
src/WINNT/afs_setup_utils/_isuser/ntmakefile
src/WINNT/afs_setup_utils/afs_setup_utils.cpp
src/WINNT/afsd/NTMakefile
src/WINNT/afsd/afsd_service.c
src/WINNT/afsd/afslogon.c
src/WINNT/afsd/cm_callback.c
src/WINNT/afsd/cm_cell.c
src/WINNT/afsd/cm_cell.h
src/WINNT/afsd/cm_config.c
src/WINNT/afsd/cm_dcache.c
src/WINNT/afsd/cm_freelance.c
src/WINNT/afsd/cm_ioctl.c
src/WINNT/afsd/cm_scache.c
src/WINNT/afsd/cm_vnodeops.c
src/WINNT/afsd/fs.c
src/WINNT/afsd/smb.c
src/WINNT/afsd/smb.h
src/WINNT/afsd/smb3.c
src/WINNT/afsd/smb3.h
src/WINNT/afsd/smb_ioctl.c
src/WINNT/client_config/config.cpp
src/WINNT/client_config/config.h
src/WINNT/client_config/dlg_automap.cpp
src/WINNT/client_config/dlg_misc.cpp
src/WINNT/client_config/drivemap.cpp
src/WINNT/client_config/drivemap.h
src/WINNT/client_config/lang/en_US/afs_config.rc
src/WINNT/client_config/resource.h
src/WINNT/client_config/tab_drives.cpp
src/WINNT/client_config/tab_general.cpp
src/WINNT/client_creds/NTMakefile
src/WINNT/client_creds/advtab.cpp
src/WINNT/client_creds/afswiz.cpp
src/WINNT/client_creds/main.cpp
src/WINNT/client_osi/libosi.def
src/WINNT/client_osi/osilog.c
src/WINNT/client_osi/osilog.h
src/WINNT/install/InstallShield5/Default.txt
src/WINNT/install/InstallShield5/GenFileGroups.bat
src/WINNT/install/InstallShield5/NTMakefile
src/WINNT/install/InstallShield5/PackageWeb.pfw
src/WINNT/install/InstallShield5/setup.rul
src/WINNT/install/Win9x/NTMakeFile
src/WINNT/pthread/NTMakefile
src/WINNT/pthread/test/NTMakefile
src/WINNT/win9xpanel/WinAfsLoad.cpp
src/afs/DARWIN/osi_module.c
src/afs/DARWIN/osi_sleep.c
src/afs/DARWIN/osi_vm.c
src/afs/DARWIN/osi_vnodeops.c
src/afs/IRIX/osi_misc.c
src/afs/IRIX/osi_vfs.h
src/afs/IRIX/osi_vfsops.c
src/afs/IRIX/osi_vnodeops.c
src/afs/LINUX/osi_alloc.c
src/afs/LINUX/osi_sleep.c
src/afs/VNOPS/afs_vnop_remove.c
src/afs/VNOPS/afs_vnop_symlink.c
src/afs/afs_cell.c
src/afs/afs_dynroot.c
src/afs/afs_nfsdisp.c
src/afs/afs_osi.c
src/afs/afs_osi_vget.c
src/afs/afs_segments.c
src/afs/afs_server.c
src/afs/afs_vcache.c
src/afs/afs_volume.c
src/afs/lock.h
src/afsd/afsd.c
src/auth/Makefile.in
src/auth/cellconfig.c
src/auth/cellconfig.p.h
src/auth/ktc.c
src/auth/ktc_nt.c
src/bozo/.cvsignore
src/bozo/Makefile.in
src/bozo/NTMakefile
src/bozo/bnode.c
src/bozo/bosint.xg
src/bozo/bosserver.c
src/bucoord/NTMakefile
src/budb/NTMakefile
src/butc/NTMakefile
src/butc/tcmain.c
src/cf/linux-test2.m4
src/cf/linux-test4.m4
src/config/Makefile.ppc_darwin_13.in
src/config/NTDllmap.txt
src/config/NTMakefile
src/config/NTMakefile.i386_nt40
src/config/NTMakefile.i386_win95
src/config/afs_args.h
src/config/afs_sysnames.h
src/config/param.alpha_dux40.h
src/config/param.alpha_dux50.h
src/config/venus.h
src/des/Makefile.in
src/des/make_p_table.c
src/export/export.c
src/fsint/afsint.xg
src/kauth/Makefile.in
src/kauth/kautils.p.h
src/kauth/user_nt.c
src/libadmin/adminutil/NTMakefile
src/libadmin/bos/NTMakefile
src/libadmin/cfg/NTMakefile
src/libadmin/cfg/test/NTMakefile
src/libadmin/client/NTMakefile
src/libadmin/kas/NTMakefile
src/libadmin/pts/NTMakefile
src/libadmin/test/NTMakefile
src/libadmin/vos/NTMakefile
src/libafs/MakefileProto.IRIX.in
src/libafs/afs.ppc_darwin_14.plist.in
src/libafsauthent/NTMakefile
src/libafsauthent/afsauthent.def
src/libafsrpc/NTMakefile
src/pam/afs_auth.c
src/pam/afs_setcred.c
src/pam/afs_util.c
src/procmgmt/NTMakefile
src/procmgmt/test/NTMakefile
src/ptserver/ptclient.c
src/rx/LINUX/rx_knet.c
src/rx/Makefile.in
src/rx/rx.h
src/rxkad/rxkad.p.h
src/rxkad/test/.cvsignore
src/rxkad/test/Makefile.in
src/sys/pagsh.c
src/tbutc/NTMakefile
src/tviced/NTMakefile
src/update/NTMakefile
src/util/dirpath.hin
src/util/vice.h
src/venus/Makefile.in
src/venus/fs.c
src/vfsck/main.c
src/viced/host.c
src/vlserver/NTMakefile
src/vol/Makefile.in
src/vol/NTMakefile
src/volser/NTMakefile
src/volser/vos.c

diff --git a/NEWS b/NEWS
index a805cee9fca330d8df04d64971c5449fb706fc9b..535c5286194fa70768333972eda21a82799494d2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,11 @@
-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
 
index e02e143df1671fbf04492a35fb6d02ddf724f8c8..ece70bd0edfc6835459787fbde93e5ad6e4300f6 100644 (file)
@@ -30,6 +30,7 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 
 #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
index 505148178804c3ed81355d32798ff3985ce1a8fb..7d985f7a6f88403fd57cc4a3fcad27062164c567 100644 (file)
@@ -48,8 +48,6 @@ AC_ARG_ENABLE(tivoli-tsm,
 [  --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
@@ -58,6 +56,7 @@ AC_MINIX
 dnl Various compiler setup.
 AC_C_INLINE
 AC_C_CONST
+AC_PROG_CC
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 AC_TYPE_SIGNAL
@@ -126,6 +125,9 @@ case $system in
                   [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
@@ -135,6 +137,9 @@ case $system in
                 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
                 ;;
@@ -148,6 +153,9 @@ case $system in
                 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)
                 ;;
@@ -203,18 +211,15 @@ else
                        ;;
                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"
@@ -288,6 +293,12 @@ else
         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.
@@ -478,5 +489,6 @@ AC_SUBST(DEST)
 AC_SUBST(WITH_OBSOLETE)
 AC_SUBST(WITH_INSECURE)
 AC_SUBST(DARWIN_INFOFILE)
+AC_SUBST(IRIX_BUILD_IP35)
 
 ])
index 8fb98427d89c5f1c75f0054669669bf39789f122..6be23b41fb893740fe15cd8741ac39483594705b 100644 (file)
@@ -22,6 +22,7 @@ NTMAKE = nmake /nologo /f ntmakefile install9x
 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
 
@@ -41,7 +42,7 @@ start:
     $(MKDIR) $(DESTDIR)
 !      ENDIF
 
-config:
+config: start
      echo ***** $@
        $(CD) $(OBJ)\$@
        $(NTMAKE)
@@ -306,7 +307,7 @@ Win9x::
        $(CD) $(OBJ)\WINNT\install\Win9x
        nmake /nologo /f NTMakefile  isinstall
        $(CD) ..\..\..\..
-       eho **** End of Install Scripts
+       echo **** End of Install Scripts
 
 media: Win9x
 
@@ -314,7 +315,7 @@ 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) ..\..\..\..
index 07cc29a8fceedd15a7cc3b035b64f03de84a1a78..e1d4902240b2b7c2245284edd827ce18452147c6 100644 (file)
@@ -471,12 +471,13 @@ finale: client_creds
        $(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)
@@ -487,12 +488,12 @@ InstallShield5: install
        $(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) ..\..
index 0115b0b43a1440e7379a08bfe16ace0e8316c3aa..07e09e969b8cb0a14ddb73e814b941e9a72aee2a 100644 (file)
@@ -90,8 +90,6 @@ DIRLANG= ZH_TW ZH_CN PT_BR KO_KR JA_JP ES_ES EN_US DE_DE
 
 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
index ce9d4c4bd08c31dae264e8e9514e88a7b0546434..fb4a8d7aef5e42b9a05f57109303ec2ff6a3e342 100644 (file)
@@ -10,7 +10,7 @@
 #define APSTUDIO_HIDDEN_SYMBOLS
 #include "windows.h"
 #undef APSTUDIO_HIDDEN_SYMBOLS
-#include <.\sdrc.h>
+#include <sdrc.h>
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
index 990561647a210ab1018b6136505f7a3b022bc39e..437b9b101a178e7fd9824fdf1856edbd76f48746 100644 (file)
@@ -30,14 +30,6 @@ CLEAN ::
 "$(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 
 
@@ -85,21 +77,11 @@ LINK32_OBJS= \
        "$(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)"
index 7a0aa8ef303312923fcb00bc0c254a5da1f27c25..2e6ff61cc46897407b769352e795e320a990d2a1 100644 (file)
@@ -419,7 +419,7 @@ struct FILEINFO fileInfo[] = {
     { 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 },
@@ -908,6 +908,10 @@ static int InstallService(char *pszName, char *pszDependOn, char *pszDisplayName
     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());
@@ -976,6 +980,10 @@ static int UninstallService(struct APPINFO *pAppInfo)
     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());
index 4e5af5afc7f36da16e0bebd6fa003ea141c39e95..da8bc97c1df240185a1a7bb0d32fdac682e453a3 100644 (file)
@@ -5,6 +5,7 @@
 # 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
 
@@ -168,7 +169,7 @@ install: install_headers $(CONF_DLLFILE) \
        $(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
 
@@ -306,7 +307,7 @@ $(DESTDIR)\bin\kpasswd.exe: $(KPASSWD_OBJS) $(KPASSWD_LIBS)
        $(EXECONLINK)
        $(EXEPREP)
 
-       
+
 ############################################################################
 # generate versioninfo resources
 
index 3df9c7f51e71c31a6eaad2d20ac3227d2ad7985e..42979d5c94d221d8adce7b579c7339659e32d40b 100644 (file)
@@ -137,6 +137,8 @@ doneTrace:
        }
 }
 
+#if 0
+/* This code was moved to Drivemap.cpp*/
 /* Mount a drive into AFS if the user wants us to */
 void CheckMountDrive()
 {
@@ -177,6 +179,7 @@ void CheckMountDrive()
 
         RegCloseKey(hKey);
 }
+#endif
 
 void afsd_Main()
 {
@@ -185,6 +188,7 @@ void afsd_Main()
        int jmpret;
 
        osi_InitPanic(afsd_notifier);
+       osi_InitTraceOption();
 
        GlobalStatus = 0;
 
@@ -247,10 +251,10 @@ void afsd_Main()
        }
 
         /* 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);
index 9d9881697ccdec5568688b96338b1250c517257a..8ad61f28c14b33769fc1d0aeb64266a7773af716 100644 (file)
 #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 {
@@ -57,24 +67,65 @@ typedef struct _MSV1_0_INTERACTIVE_LOGON {
  *
  * 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) {
@@ -87,14 +138,29 @@ WCHAR *GetLogonScript(void)
                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;
@@ -153,9 +219,12 @@ close_scm:
 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;
        }
 }
 
@@ -212,12 +281,34 @@ static void GetLoginBehavior(int *pRetryInterval, BOOLEAN *pFailSilently)
                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,
@@ -237,11 +328,15 @@ DWORD APIENTRY NPLogonNotify(
        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;
 
@@ -252,72 +347,118 @@ DWORD APIENTRY NPLogonNotify(
        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);
@@ -331,17 +472,19 @@ checkauth:
                                    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;
 }
 
@@ -354,6 +497,7 @@ DWORD APIENTRY NPPasswordChangeNotify(
        LPVOID StationHandle,
        DWORD dwChangeInfo)
 {
+       DebugEvent0("AFS AfsLogon - NPPasswordChangeNotify");
        return 0;
 }
 
index 959b35ade5530ed68679c1367073e4ed6b4322a7..e8d7665a131a90ae65307121f8fa50346db80b84 100644 (file)
@@ -311,6 +311,13 @@ SRXAFSCB_Probe(struct rx_call *callp)
        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)
 {
index 5ef16bc9a6328dd896884a59ff696892e2fce3f4..e2ba9e4cac8c500fc8600f80442aa1d52f1fcef7 100644 (file)
@@ -56,15 +56,24 @@ long cm_AddCellProc(void *rockp, struct sockaddr_in *addrp, char *namep)
 
 /* 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))
@@ -75,10 +84,11 @@ cm_cell_t *cm_GetCell(char *namep, long flags)
          ) {
                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);
@@ -90,8 +100,8 @@ cm_cell_t *cm_GetCell(char *namep, long flags)
                    cp->flags |= CM_CELLFLAG_DNS;
                    cp->timeout = time(0) + ttl;
                  }
-               }
 #endif
+               }
 
                /* randomise among those vlservers having the same rank*/ 
                cm_RandomizeServer(&cp->vlServersp);
@@ -100,8 +110,8 @@ cm_cell_t *cm_GetCell(char *namep, long flags)
                 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;
@@ -111,6 +121,8 @@ cm_cell_t *cm_GetCell(char *namep, long flags)
         }
 
 done:
+       if (newnamep)
+         strcpy(newnamep, fullname);
        lock_ReleaseWrite(&cm_cellLock);
         return cp;
 }
index a642d04d2a179332a757722e5d10050a23651990..bf0363435e220217ff675006ecdfe64560c2f471 100644 (file)
@@ -30,6 +30,8 @@ extern void cm_InitCell(void);
 
 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);
index 10a0d44f6213e43f4fc3a4c4482a11f53cf46698..f09e9fcc6b46e9f8c8192243721d7867e6a6cf25 100644 (file)
@@ -438,7 +438,7 @@ long cm_WriteConfigInt(char *labelp, long value)
                return -1;
 
        code = RegSetValueEx(parmKey, labelp, 0, REG_DWORD,
-                            &value, sizeof(value));
+                            (LPBYTE)&value, sizeof(value));
        RegCloseKey (parmKey);
        if (code != ERROR_SUCCESS)
                return -1;
@@ -535,7 +535,7 @@ long cm_AppendNewCellLine(cm_configFile_t *filep, char *linep)
         return 0;
 }
 
-extern long cm_CloseCellFile(cm_configFile_t *filep)
+long cm_CloseCellFile(cm_configFile_t *filep)
 {
        char wdir[256];
         char sdir[256];
index 6a7a3ac96901c5c462c231f5a82a2e58050c894c..fb7b25181943adb7a6a98f89e4b4665ba8be255a 100644 (file)
@@ -1155,7 +1155,7 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *up,
                afsStatus.UnixModeBits = 0x1ff;
                afsStatus.ParentVnode = 0x1;
                afsStatus.ParentUnique = 0x1;
-               afsStatus.SegSize = 0;
+               afsStatus.ResidencyMask = 0;
                afsStatus.ClientModTime = 0x3b49f6e2;
                afsStatus.ServerModTime = 0x3b49f6e2;
                afsStatus.Group = 0;
index 1da7f857dc86bbc37517bbb64ac57ba769049ff1..9f82b1cded4d4a56af12ef97e6f60977b933d81a 100644 (file)
@@ -82,7 +82,9 @@ void cm_InitFakeRootDir() {
        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);
@@ -435,13 +437,24 @@ cm_localMountPoint_t* cm_getLocalMountPoint(int vnode) {
        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);
@@ -455,12 +468,17 @@ long cm_FreelanceAddMount(char *filename, char *cellname, char *volume)
      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;
 }
 
index eb5a6715ced8ab867d0fc7205412a07cd629146c..8ae076640db1bdb86f307f3e326e9524e694406d 100644 (file)
@@ -1176,7 +1176,7 @@ long cm_IoctlCreateMountPoint(struct smb_ioctl *ioctlp, struct cm_user *userp)
        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
@@ -1356,6 +1356,7 @@ long cm_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
        afs_uuid_t uuid;
        int flags;
        char sessionKey[8];
+       char *smbname;
 
        saveDataPtr = ioctlp->inDatap;
 
@@ -1400,6 +1401,13 @@ long cm_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
                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));
@@ -1410,8 +1418,7 @@ long cm_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
                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 */
@@ -1876,3 +1883,15 @@ long cm_IoctlShutdown(smb_ioctl_t *ioctlp, cm_user_t *userp) {
 }
 #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;
+}
+
index d3add600903837ee4ac09c6a08026df7084ccf17..e8371b7d8e8a681667a9280fefa5adc435d18707 100644 (file)
@@ -806,7 +806,7 @@ void cm_MergeStatus(cm_scache_t *scp, AFSFetchStatus *statusp, AFSVolSync *volp,
                statusp->UnixModeBits = 0x1ff;
                statusp->ParentVnode = 0x1;
                statusp->ParentUnique = 0x1;
-               statusp->SegSize = 0;
+               statusp->ResidencyMask = 0;
                statusp->ClientModTime = 0x3b49f6e2;
                statusp->ServerModTime = 0x3b49f6e2;
                statusp->Group = 0;
index 1d0eb87e231c6442c5d9860c31b186f9ceeae9df..e06667789d834370d5a11612f176eb01a81aef32 100644 (file)
@@ -959,6 +959,7 @@ long cm_Lookup(cm_scache_t *dscp, char *namep, long flags, cm_user_t *userp,
         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) {
@@ -988,12 +989,27 @@ long cm_Lookup(cm_scache_t *dscp, char *namep, long flags, cm_user_t *userp,
         * 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 */
@@ -1190,9 +1206,17 @@ long cm_AssembleLink(cm_scache_t *linkScp, char *pathSuffixp,
                 *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 */
index 1ad8aaf12baa5a112d4d200e9b18279fc6084885..a981f238a26ac12efca2e9da0444fac0fbac39d0 100644 (file)
@@ -1754,7 +1754,7 @@ register struct cmd_syndesc *as; {
        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;
index 5a03d90e2ac847a564f929eedb9254b6ec807ffc..e1c8c85d998cbe2c788de52ee8c6eb27a6484456 100644 (file)
@@ -778,16 +778,7 @@ smb_user_t *smb_FindUID(smb_vc_t *vcp, unsigned short uid, int flags)
        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;
                }
         }
@@ -800,16 +791,7 @@ smb_user_t *smb_FindUID(smb_vc_t *vcp, unsigned short uid, int flags)
                 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;
@@ -850,16 +832,7 @@ smb_user_t *smb_FindUserByNameThisSession(smb_vc_t *vcp, char *usern)
             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;
@@ -5391,27 +5364,11 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
                                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) {
@@ -5465,7 +5422,7 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
                                    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 */
 
index e3a9c2076d84bc5eb2d74f559b8fdf6b6c2d111a..8afe8d45935ef4ff843956ea94707b97f0fc84ac 100644 (file)
@@ -208,6 +208,10 @@ typedef struct smb_ioctl {
 
         /* fid pointer */
         struct smb_fid *fidp;
+
+  /* uid pointer */
+  smb_user_t *uidp;
+
 } smb_ioctl_t;
 
 /* flags for smb_ioctl_t */
index 207f9f8fbe4a1a92b22885e00326afb895b08356..fad864de709584c9bbf595d4477be8ff5b7ce7d2 100644 (file)
@@ -139,24 +139,6 @@ long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_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
@@ -171,16 +153,8 @@ long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *
         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 {
@@ -192,7 +166,7 @@ long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *
         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 */
@@ -203,21 +177,12 @@ long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *
         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 */
@@ -619,6 +584,8 @@ long smb_ReceiveV3Tran2A(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
                 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,
@@ -4137,7 +4104,6 @@ cm_user_t *smb_FindCMUserByName(/*smb_vc_t *vcp,*/ char *usern, char *machine)
 {
     cm_user_t *userp;
     /*int newUid;*/
-    smb_user_t *uidp;
     smb_username_t *unp;
 
     unp = smb_FindUserByName(usern, machine, SMB_FLAG_CREATE);
@@ -4145,27 +4111,10 @@ cm_user_t *smb_FindCMUserByName(/*smb_vc_t *vcp,*/ char *usern, char *machine)
         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;
 }
 
index 937ed42ba516ad31e4942307e3d78b4ff017c029..136ffab31e0828ef065b6213586b855789c2d9a4 100644 (file)
@@ -164,6 +164,7 @@ extern long smb_ReceiveNTCancel(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *
 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)
index 3b1722d857f5039d7846829ab9d0a8a182a878e7..a5d36df76cfea5791212b95d232a0f850db9d6d2 100644 (file)
@@ -283,9 +283,14 @@ long smb_IoctlV3Read(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_pack
                    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);
        }
 
index 7a0435ac7daca03f14d08fc624e176e9ff4d3eeb..69b40c3f1307f29cdab5700affc9ecf1a17feafe 100644 (file)
@@ -217,7 +217,15 @@ BOOL Config_SetCellName (LPCTSTR pszName, ULONG *pStatus)
    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;
@@ -335,7 +343,7 @@ BOOL Config_SetAuthentFlag (BOOL fFlag, ULONG *pStatus)
       Message (MB_ICONHAND, GetErrorTitle(), IDS_FAILCONFIG_AUTHENT, TEXT("%ld"), status);
    return rc;
 }
-
+#endif
 
 void Config_GetTrayIconFlag (BOOL *pfFlag)
 {
@@ -811,7 +819,7 @@ BOOL Config_SetCachePath(LPCTSTR pszPath, ULONG *pStatus)
 void Config_GetLanAdapter (ULONG *pnLanAdapter)
 {
    if (!Config_ReadNum (TEXT("LANadapter"), (DWORD*)pnLanAdapter))
-      *pnLanAdapter = 0;
+      *pnLanAdapter = -1;
 }
 
 BOOL Config_SetLanAdapter (ULONG nLanAdapter, ULONG *pStatus)
index 44ca2199128427b646994743912249db1f03f212..712ff745470be40c6c0feee177ebb55a36bcf7f9 100644 (file)
@@ -57,9 +57,6 @@ BOOL Config_SetGatewayName (LPCTSTR pszName, ULONG *pStatus = NULL);
 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);
 
index d179543a1d5ac443c570fc177638d2282530666c..096b32412e58b06a37a0f0b4dbd67095a064c1e6 100644 (file)
@@ -237,29 +237,39 @@ BOOL UpdateRegistry(DRIVEMAP *pDrive, BOOL bRemove)
 
 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;
 }   
 
index c16df9ca5e7d501a30457a2cebd234300f5c16c5..a1d87595d0c34dececcebeb5e99d563979a1f6bb 100644 (file)
@@ -95,6 +95,13 @@ BOOL CALLBACK Misc_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
             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;
 
@@ -129,7 +136,7 @@ void Misc_OnInitDialog (HWND hDlg)
       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);
@@ -137,11 +144,14 @@ void Misc_OnInitDialog (HWND hDlg)
    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));
   
@@ -161,7 +171,7 @@ BOOL Misc_OnApply()
 {
    if (fFirstTime)
       return TRUE;
-   
+
    if (nLanAdapter != g.Configuration.nLanAdapter) {
       if (!Config_SetLanAdapter (nLanAdapter))
          return FALSE;
index 0acaed0a1e6d17a5a65221e63ea64fe1ab057643..db61e27310295a58a6b687825c61638bd65b4237 100644 (file)
 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");
 
 
 /*
@@ -452,7 +455,7 @@ BOOL DriveIsGlobalAfsDrive(TCHAR chDrive)
    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;
@@ -637,7 +640,8 @@ BOOL ActivateDriveMap (TCHAR chDrive, LPTSTR pszMapping, LPTSTR pszSubmountReq,
    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;
 
@@ -649,10 +653,7 @@ BOOL ActivateDriveMap (TCHAR chDrive, LPTSTR pszMapping, LPTSTR pszSubmountReq,
 
 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;
 
@@ -745,8 +746,11 @@ BOOL GetDriveSubmount (TCHAR chDrive, LPTSTR pszSubmountNow)
       pszSubmount = &szMapping[ lstrlen(cszLANMANDEVICE) ];
 
       if (IsWindows2000())
+         {
           if (*(pszSubmount) != TEXT(';'))
              return FALSE;
+         } else 
+               --pszSubmount;
 
       if (toupper(*(++pszSubmount)) != chDrive)
          return FALSE;
@@ -758,8 +762,12 @@ BOOL GetDriveSubmount (TCHAR chDrive, LPTSTR pszSubmountNow)
           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;
@@ -791,3 +799,384 @@ BOOL GetDriveSubmount (TCHAR chDrive, LPTSTR pszSubmountNow)
    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);
+}
index 4aaff4d8ffef6bd4986037b4442866abefa5c5dd..f694eb3891cd92ea3318996956e4fa2fbd4d20ef 100644 (file)
@@ -85,5 +85,24 @@ BOOL GetDriveSubmount (TCHAR chDrive, LPTSTR pszSubmountNow);
 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
 
index 2fbb0f3c40807ee022d3299bee743d2a8278a2b6..9aec58a419e66135e24606bf823cf281aaba993a 100644 (file)
@@ -348,7 +348,7 @@ STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
 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
@@ -367,8 +367,10 @@ BEGIN
     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
index 33acd06d7d37ce8839755674280e8592752e3056..ccdaf504c72c2e3dd1228c2565af401f33a22528 100644 (file)
 #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
index 914b5143b956697201c57df1d4c3dc1f540b69b5..565e660a1ebe0c149e8d9bbfa16cb94fcdd66012 100644 (file)
@@ -618,6 +618,8 @@ void Submounts_OnApply (HWND hDlg)
 
    FreeDriveMapList (&g.Configuration.NetDrives);
    QueryDriveMapList (&g.Configuration.NetDrives);
+   if (g.Configuration.fLogonAuthent)
+          DoMapShareChange();
 }
 
 
@@ -682,6 +684,7 @@ void Submounts_OnEdit (HWND hDlg)
       }
 }
 
+// Action - On Remove submount item
 
 void Submounts_OnRemove (HWND hDlg)
 {
@@ -698,6 +701,7 @@ 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);
index 36760054f891f4fdb7a601babf8718dbabf04c81..8ec755eb2522bec6c63266692da34a7f9c1168b4 100644 (file)
@@ -10,6 +10,7 @@
 extern "C" {
 #include <afs/param.h>
 #include <afs/stds.h>
+#include <rx/rxkad.h>
 }
 
 #include "afs_config.h"
@@ -17,6 +18,8 @@ extern "C" {
 #include "tab_hosts.h"
 #include "tab_advanced.h"
 
+#include "drivemap.h"
+#include <adssts.h>
 
 /*
  * VARIABLES __________________________________________________________________
@@ -70,7 +73,6 @@ BOOL fIsCellInCellServDB (LPCTSTR pszCell);
 BOOL CALLBACK Status_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp);
 void Status_OnRefresh (HWND hDlg);
 
-
 /*
  * ROUTINES ___________________________________________________________________
  *
@@ -220,7 +222,6 @@ BOOL GeneralTab_VerifyOK (HWND hDlg, BOOL fComplainIfInvalid)
    return TRUE;
 }
 
-
 BOOL GeneralTab_OnApply (HWND hDlg, BOOL fForce, BOOL fComplainIfInvalid)
 {
    if (!fForce)
@@ -260,8 +261,7 @@ BOOL GeneralTab_OnApply (HWND hDlg, BOOL fForce, BOOL fComplainIfInvalid)
    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;
       }
 
@@ -325,7 +325,7 @@ void GeneralTab_OnRefresh (HWND hDlg, BOOL fRequery)
          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)
@@ -406,6 +406,7 @@ void GeneralTab_OnTimer (HWND hDlg)
 {
    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)
@@ -684,6 +685,7 @@ void GeneralTab_DoStartStop (HWND hDlg, BOOL fStart, BOOL fRestart)
             {
             g.fNeedRestart = FALSE;
             if (StartService (hService, 0, 0))
+                               TestAndDoMapShare(SERVICE_START_PENDING);
                fSuccess = TRUE;
             }
          else // (!fStart)
@@ -691,6 +693,8 @@ void GeneralTab_DoStartStop (HWND hDlg, BOOL fStart, BOOL fRestart)
             SERVICE_STATUS Status;
             if (ControlService (hService, SERVICE_CONTROL_STOP, &Status))
                fSuccess = TRUE;
+                          if (g.Configuration.fLogonAuthent)
+                                  DoUnMapShare(FALSE);
             }
 
          CloseServiceHandle (hService);
index 279dc2f0deb7805f97db87e39eb417a6dc79bc22..cd4d6a2d5b8d76a4a109a80f87423a4e86caefb1 100644 (file)
@@ -14,7 +14,6 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -WX
 AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I ..\afsd
 
 # include the primary makefile
-
 !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
 !INCLUDE ..\..\config\NTMakefile.version
 
index a5aff1e596b56d585295dd48c88a613ec1888e66..760fc1d32738c96d77cddfbfefffd8848308a06d 100644 (file)
@@ -122,6 +122,7 @@ void Advanced_OnServiceTimer (HWND hDlg)
          DWORD dwSize = sizeof(Config);
          QueryServiceConfig (hService, (QUERY_SERVICE_CONFIG*)&Config, sizeof(Config), &dwSize);
          QueryServiceStatus (hService, &Status);
+                TestAndDoMapShare(Status.dwCurrentState);
 
          CloseServiceHandle (hService);
          }
@@ -156,6 +157,7 @@ void Advanced_OnServiceTimer (HWND hDlg)
       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))
@@ -194,13 +196,17 @@ void Advanced_OnChangeService (HWND hDlg, WORD wCmd)
 
             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;
             }
 
index c5384796e22aaaacee13d07c3b9bb935737feda6..b3d7fce4a5106cae7f359f11798a11b48fe0f571 100644 (file)
@@ -225,7 +225,8 @@ void WizStarting_OnInitDialog (HWND hDlg)
       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);
          }
@@ -253,6 +254,7 @@ void WizStarting_OnTimer (HWND hDlg)
          {
          QueryServiceStatus (hService, &Status);
          CloseServiceHandle (hService);
+                TestAndDoMapShare(Status.dwCurrentState);
          }
 
       CloseServiceHandle (hManager);
index e43b91032fcf750a9f9a630c9c4a52ab8f9ede58..747c32dd297703308b2e679dd01ea152ed2bd824 100644 (file)
@@ -14,7 +14,11 @@ extern "C" {
 
 #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 ________________________________________________________________
@@ -69,6 +73,8 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR pCmdLine, int nCmdSh
    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)
 {
@@ -111,10 +117,29 @@ 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)
index 2efa1b3c9ff0c5abae3cb7dbc3d2b00d08d6a719..b60c39c9213ffadc6a0943de4ff4d76245ab27af 100644 (file)
@@ -65,3 +65,6 @@ EXPORTS
        osi_LogPrint            @58
        osi_LogSaveString       @59
        osi_InitPanic           @60
+       osi_InitTraceOption @61
+       osi_LogEvent0           @62
+       osi_LogEvent            @63
index 5f44377b8de2b4309dd58eb96a461180c96dbaf7..890745e1dc711ff810ff91112dfd7843b74ada1a 100644 (file)
@@ -330,3 +330,55 @@ void osi_LogDisable(osi_log_t *logp)
        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);
+}
index 569f429d48a7036b77a631eb5983f8b715575b3a..9eb11ab9fd00b6c23e26c0dee874de54c606d88f 100644 (file)
@@ -6,8 +6,6 @@
  *
  */
 
-/* Copyright (C) 1994 Cazamar Systems, Inc. */
-
 #ifndef _OSI_LOG_H__
 #define _OSI_LOG_H__ 1
 
@@ -82,6 +80,9 @@ extern void osi_LogPanic(char *filep, long line);
 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)
@@ -90,4 +91,56 @@ extern char *osi_LogSaveString(osi_log_t *logp, char *s);
 #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__ */
index f0f68c94d495ab10414f78e17d0a321f6009fbab..0ae6a4593676ff4c6014443bc2c94e2eb5eb2fb5 100644 (file)
@@ -195,7 +195,9 @@ AFS Client FME=S,<TARGETDIR>\Client\Program\afs_fme.dll
 ---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>
 
index 6978f6685d4859cb7f1c936757f6535680678088..5ce9d630b6da5f35cbc39ef66b870578da26c993 100644 (file)
@@ -54,7 +54,7 @@ echo [TopDir] > Client_Common_Files.fgl
 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
@@ -130,7 +130,7 @@ echo [TopDir] > Light_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
@@ -188,7 +188,7 @@ echo [TopDir] > Light95_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
@@ -258,7 +258,7 @@ echo file5=%IS5_DEST%\root.server\usr\afs\bin\afsvosadmin.dll >> Server_Common_F
 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
@@ -312,7 +312,7 @@ echo file5=%IS5_DEST%\root.server\usr\afs\bin\afsvosadmin.dll >> Control_Center_
 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
index 96d30aa211efe4b03a745c293c8a621ddd407a71..5577a96b49f6b3cccd3322bd4d2dbb69340d7bb0 100644 (file)
@@ -35,7 +35,7 @@ prep: AFS_component_version_number.txt
        $(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
@@ -62,8 +62,8 @@ build:
        $(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
index 8db507b43b983e0f96208263be88baee27d52cc2..ca9a7a5f7eb05bb70e183221ea726c5434a3484c 100644 (file)
@@ -2,20 +2,20 @@
 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
@@ -70,198 +70,198 @@ Folder10=Disk1\License
 
 [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
index 4be378da313e939ee01785f81dc0055f98993394..0cb572c8a3f126c04311e40fbfebea42fe99c42d 100644 (file)
@@ -442,6 +442,7 @@ begin
        szErrMsg="                                                                 ";
        Enable (STATUS);
        SetStatusWindow (50, "Now Downloading CellServDB file...");
+       CreateDir(TARGETDIR);
        nResult=GetWebPage(szErrMsg,szDestFile,szDefaultWeb);
        SetStatusWindow (100, "Downloading completed.");
        Delay (2);
index fe95e91bad51578f5f05e3174929b31b88913b2d..d0bb112dcecb8162c762b841cdb5275061247504 100644 (file)
@@ -12,40 +12,41 @@ OUTDIR = $(DESTDIR)\WinInstall
 ############################################################################
 
 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
 
@@ -54,6 +55,9 @@ clean ::
     $(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"
index d2beadb3344993def7a012b87bc2125222fb67f6..682faf9ed236299ec7cb2e022b9c71e60e4f5d50 100644 (file)
@@ -16,9 +16,9 @@ LIBINCLUDES = \
        $(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 \
@@ -29,9 +29,9 @@ $(PTHR_DLLFILE): $(PTHR_DLLOBJS)
        $(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 \
index bb6827f3eab24bb81ab83ab1e79a990dadb08083..a56c1820d2bc6f92f6dfb6705c4fc8b4b4071aa0 100644 (file)
 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)
 
index 44d4181635953f3e94157a0092fd492f584cba9d..10111350b8ae3fc4fd214c74585d807ecb35edf4 100644 (file)
@@ -408,7 +408,7 @@ void CWinAfsLoadApp::WSANotifyFromUI(WPARAM wp,const char *msg)
                m_wParam=wp;
                m_sMsg=msg;     
                SetEvent(CMyUIThread::m_hEventThreadKilled);
-               m_uNntifyMessage=0;
+               m_uNotifyMessage=0;
                break;
        default:
                break;
index 2769f8c6311469ea707c649918c1012b115cf230..500b2421dce1a4854a4fdf5f3ff84f3dabd6814a 100644 (file)
@@ -1,7 +1,7 @@
 #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"
@@ -58,4 +58,4 @@ kern_return_t afs_modunload(struct kmod_info *ki, void *data)
    return KERN_SUCCESS;
  } 
 
-KMOD_EXPLICIT_DECL(openafs, VERSION, afs_modload, afs_modunload)
+KMOD_EXPLICIT_DECL(org.openafs.filesystems.afs, VERSION, afs_modload, afs_modunload)
index c0d75bc1812bf3a942349223058b80961fd401cc..5025b12f4a4c8d03c255bc1dacfc0dd0fd5d9dc5 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
@@ -131,9 +131,14 @@ void afs_osi_Sleep(char *event)
     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);
@@ -153,24 +158,37 @@ static int osi_TimedSleep(char *event, afs_int32 ams, int aintok)
     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;
@@ -184,7 +202,12 @@ void afs_osi_Wakeup(char *event)
     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);
 }
index f99b342e24b2d497a1af9216216a9095eebe0f9b..0a258bd345c97eb52f923f2668bb82439ffddf49 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
@@ -39,6 +39,10 @@ osi_VM_FlushVCache(avc, slept)
     int *slept;
 {
     struct vnode *vp=(struct vnode *)avc;
+#ifdef AFS_DARWIN14_ENV
+    if (UBCINFOEXISTS(vp))
+       return EBUSY;
+#endif
     if (avc->vrefCount)
        return EBUSY;
 
@@ -51,6 +55,7 @@ osi_VM_FlushVCache(avc, slept)
 
     AFS_GUNLOCK();
     cache_purge(vp);
+#ifndef AFS_DARWIN14_ENV
     if (UBCINFOEXISTS(vp))
        {
                 ubc_clean(vp, 1);
@@ -58,6 +63,7 @@ osi_VM_FlushVCache(avc, slept)
                 ubc_release(vp);
                ubc_info_free(vp);
        }
+#endif
 
     AFS_GLOCK();
 
@@ -186,11 +192,19 @@ void osi_VM_TryReclaim(avc, slept)
         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);
@@ -209,14 +223,22 @@ void osi_VM_TryReclaim(avc, slept)
     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);
@@ -224,6 +246,7 @@ void osi_VM_TryReclaim(avc, slept)
            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);
@@ -232,13 +255,14 @@ void osi_VM_TryReclaim(avc, slept)
               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);
    }
@@ -254,8 +278,19 @@ void osi_VM_NukePages(struct vnode *vp, off_t offset, off_t size) {
     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
@@ -268,7 +303,7 @@ void osi_VM_NukePages(struct vnode *vp, off_t offset, off_t size) {
     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,
@@ -277,10 +312,12 @@ void osi_VM_NukePages(struct vnode *vp, off_t offset, off_t size) {
         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) {
@@ -296,15 +333,17 @@ 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);
       }
index e27932b557f76e6dc9bdd73596799934707dc55a..92ca7dc12039d45c60c79d5df92802d2e2789137 100644 (file)
@@ -1,7 +1,7 @@
 #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 */
@@ -755,12 +755,10 @@ afs_vop_remove(ap)
     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)
@@ -768,7 +766,13 @@ afs_vop_remove(ap)
              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();
@@ -1218,8 +1222,13 @@ afs_vop_print(ap)
     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;
 }
index 2c75c05a38091a95a3d0c05bd77ddde0356b1a31..3e5403bdbc5f4012df4e2895cc1d162975bb9df8 100644 (file)
@@ -13,7 +13,7 @@
 #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 */
@@ -51,14 +51,16 @@ int afs_init_kernel_config(int flag)
            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;
@@ -85,6 +87,8 @@ int afs_ipno = 27;
 int afs_ipno = 28;
 #elif defined(IP30)
 int afs_ipno = 30;
+#elif defined(IP35)
+int afs_ipno = 35;
 #else
 int afs_ipno = -1;
 #endif
index 2c061c91dc3391ffdb2f91de936a8ae3ced34bd0..d0225ed4e7237644769353bd6a8b41b098d01e2c 100644 (file)
@@ -88,7 +88,7 @@ extern off_t VnodeToSize(vnode_t *vp);
  */
 #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))
@@ -291,6 +291,9 @@ typedef struct vnode1 {
 #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*);
index 9589c64845760df821712752c4c77caa8e86fb2f..66e75cd15daac57a749d7d56588a72e3f5bac046 100644 (file)
@@ -13,7 +13,7 @@
 #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 */
@@ -523,7 +523,7 @@ afs_vget(OSI_VFS_DECL(afsp), vnode_t **avcp, struct fid *fidp)
     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    
 
@@ -533,11 +533,11 @@ afs_vget(OSI_VFS_DECL(afsp), vnode_t **avcp, struct fid *fidp)
 
     *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;
index ca25d700eff6d8756d7edc349cc19fb40bcfebc7..9e670fdb38a4a183d8e91a44b8fcf4ee2d84c805 100644 (file)
@@ -13,7 +13,7 @@
 #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 */
@@ -1258,7 +1258,7 @@ int afs_rwlock_nowait(vnode_t *vp, AFS_RWLOCK_T flag)
     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;
@@ -1283,10 +1283,21 @@ int afs_fid2(OSI_VC_DECL(avc), struct fid *fidp)
  * 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 */
 
index 4f3f0bf3f9d5285b4c3b9f26bbff438c06631b44..ac2b23d71a71db3f86c68b83e33925121fbd4587 100644 (file)
@@ -14,7 +14,7 @@
 #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"
@@ -87,7 +87,13 @@ static void *linux_alloc(unsigned int asize)
 
     /*  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;
     }
@@ -97,7 +103,12 @@ static void *linux_alloc(unsigned int asize)
             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;
index fcb6df58d96c16b385d7505256b05eb1b3694eee..2466821dd51f248e66585d4284c8b5e31e238cce 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
@@ -25,7 +25,7 @@ static int osi_TimedSleep(char *event, afs_int32 ams, int aintok);
 void afs_osi_Wakeup(char *event);
 void afs_osi_Sleep(char *event);
 
-static char waitV;
+static char waitV, dummyV;
 
 #if ! defined(AFS_GLOBAL_SUNLOCK)
 
@@ -96,15 +96,14 @@ int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok)
     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);
@@ -113,10 +112,10 @@ int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok)
 #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;
 }
 
 
@@ -160,26 +159,52 @@ static afs_event_t *afs_getevent(char *event)
            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)
 {
@@ -187,7 +212,17 @@ 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();
@@ -204,11 +239,8 @@ void afs_osi_Sleep(char *event)
  * 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)
 {
@@ -216,6 +248,14 @@ 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)
@@ -224,6 +264,8 @@ static int osi_TimedSleep(char *event, afs_int32 ams, int aintok)
        t = sleep_on_timeout(&evp->cond, t);
     AFS_GLOCK();
 
+    relevent(evp);
+
     return t ? EINTR : 0;
 }
 
@@ -233,6 +275,9 @@ void afs_osi_Wakeup(char *event)
     struct afs_event *evp;
 
     evp = afs_getevent(event);
+    if (!evp)                          /* No sleepers */
+       return;
+
     if (evp->refcount > 1) {
        evp->seq++;    
        wake_up(&evp->cond);
index 9026135987e149e54d56b7b6c35496c599e70dc1..00c1978fb3967069f1324b2d6d7e535126701d5b 100644 (file)
@@ -22,7 +22,7 @@
 #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 */
@@ -233,6 +233,10 @@ afs_remove(OSI_VC_ARG(adp), aname, acred)
     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:
index 3f41db182919e5b8379fb104c65e455518113f4e..00657dcfedea34871d64267d18f5c78dcfc8ef8a 100644 (file)
@@ -21,7 +21,7 @@
 #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 */
@@ -77,6 +77,10 @@ afs_symlink
     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;
 
index f2cce3069486bdbb0581bc5d3b87fbc25acb3271..17e52be91f6f2eec7af74990aa2c56a24260bf71 100644 (file)
@@ -13,7 +13,7 @@
 #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 */
@@ -78,7 +78,7 @@ char afs_AfsdbHandler_ReqPending = 0;
 char afs_AfsdbHandler_Completed = 0;
 
 
-static struct cell *afs_GetCellByName_int();
+struct cell *afs_GetCellByName2();
 
 int afs_strcasecmp(s1, s2)
     register char *s1, *s2;
@@ -220,17 +220,18 @@ int afs_GetCellHostsFromDns(acellName, acellHosts, timeout, realName)
 }
 
 
-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;
 
@@ -238,9 +239,19 @@ void afs_RefreshCell(tc)
     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)
@@ -254,6 +265,7 @@ struct cell *afs_GetCellByName_Dns(acellName, locktype)
 {
     afs_int32 cellHosts[MAXCELLHOSTS];
     char *realName = NULL;
+    struct cell *tc;
     int timeout;
 
     if (afs_GetCellHostsFromDns(acellName, cellHosts, &timeout, &realName))
@@ -264,14 +276,26 @@ struct cell *afs_GetCellByName_Dns(acellName, locktype)
 
     /* 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)
@@ -280,15 +304,17 @@ bad:
 }
 
 
-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);
@@ -297,9 +323,11 @@ static struct cell *afs_GetCellByName_int(acellName, locktype, trydns)
            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;
        }
@@ -308,47 +336,65 @@ static struct cell *afs_GetCellByName_int(acellName, locktype, trydns)
     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;
@@ -361,7 +407,7 @@ struct cell *afs_GetCellByIndex(cellindex, locktype)
            QRemove(&tc->lruq);
            QAdd(&CellLRU, &tc->lruq);
            ReleaseWriteLock(&afs_xcell);
-           afs_RefreshCell(tc);
+           if (refresh) afs_RefreshCell(tc);
            return tc;
        }
     }
@@ -419,6 +465,7 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport
     }
     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);
@@ -464,25 +511,19 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport
     }
     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;
     }
 
index 6e42e2b234ecfeb79036ac180d9ed76717999dd8..7ca29aa428c04f09dd4731673fba6850eb3f1162 100644 (file)
@@ -20,6 +20,8 @@
  * 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;
 
@@ -57,6 +72,20 @@ static int afs_dynrootVersion = 1;
 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;
 
@@ -178,13 +207,15 @@ afs_RefreshDynroot()
     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
@@ -199,9 +230,7 @@ afs_RefreshDynroot()
     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);
@@ -224,6 +253,18 @@ afs_RefreshDynroot()
        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);
 
@@ -253,32 +294,45 @@ afs_RefreshDynroot()
     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;
@@ -376,37 +430,75 @@ afs_DynrootNewVnode(avc, status)
        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;
@@ -424,15 +516,7 @@ afs_DynrootNewVnode(avc, status)
            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;
     }
@@ -459,3 +543,100 @@ afs_GetDynrootEnable()
 {
     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;
+}
index 56c0549df3887dbe0ac65af8edf0b245d19f6a7a..1117b04dd1f5326ed16a1f011ea39075bd3eac98 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
@@ -494,7 +494,7 @@ nfs3_to_afs_call(int which, caddr_t *args, nfs_fh3 **fhpp, nfs_fh3 **fh2pp)
         case NFSPROC3_LOOKUP: 
        {
             LOOKUP3args *arg = (LOOKUP3args *)args;
-            fhp1 = (nfs_fh3 *) &arg->what.dir;
+            fhp1 = (nfs_fh3 *) &arg->what.dirp;
             break;
         } 
         case NFSPROC3_ACCESS: 
index bfb29ca24acdff5fb8839392359fb9998a67997b..7e6de81f85d76290a88e2fb626c7c8b0cd5f3756 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
@@ -300,6 +300,7 @@ void afs_osi_Invisible() {
     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)
index 771a25a2dafe602ab2df3f5e1581dc0c3c4e06ed..766a5bab3e780af91fdc33c6bb90bc6532705942 100644 (file)
@@ -14,7 +14,7 @@
 #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 */
@@ -55,7 +55,7 @@ int afs_osi_vget(struct vcache **avcpp, struct fid *afidp,
         */
        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;
         }
index 510c06ad7bf395f7239bcd6e194d9823f0b18af2..a5e80cabee3688591c097903219474c7ffe1d712 100644 (file)
@@ -13,7 +13,7 @@
 #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*/
@@ -182,13 +182,13 @@ afs_StoreAllSegments(avc, areq, sync)
     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
index 0399a2c8c6a9bb43bbc9a5f3d8c54a08c80eec1c..fe9cf2eff4f78ea15e9b8fec2fb982a805024eb2 100644 (file)
@@ -32,7 +32,7 @@
 #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 */
@@ -504,13 +504,15 @@ void afs_CheckServers(adown, acellp)
     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);
@@ -518,128 +520,152 @@ void afs_CheckServers(adown, acellp)
     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*/
 
index 6e0a3da831be8f7c8e14ee559c7f7336d3e229f7..5c1c57aa2e7e2d269383a418a039584930a059e4 100644 (file)
@@ -38,7 +38,7 @@
 #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*/
@@ -525,7 +525,97 @@ afs_RemoveVCB(afid)
 } /*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
  *
@@ -560,79 +650,6 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
     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) 
@@ -723,6 +740,10 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
                   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) {
@@ -962,8 +983,17 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
        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);
index 832a5ab0ad8e1b51c4d384bb22504bfff54ac1ff..ebd3cb9c62a3cc02aeed23572d13efacfa8ebd9c 100644 (file)
@@ -18,7 +18,7 @@
 #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 */
@@ -225,6 +225,7 @@ void afs_ResetVolumes(struct server *srvp)
      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;
           }
index 343776412740c2c0d5645487487c397982a60fad..33565093f365081b7a045d1f31f02bf22207f538 100644 (file)
@@ -175,7 +175,7 @@ extern int afs_trclock;
        (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  \
@@ -188,6 +188,8 @@ extern int afs_trclock;
        (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);} */ \
@@ -274,7 +276,7 @@ extern int afs_trclock;
            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  \
@@ -285,6 +287,8 @@ extern int afs_trclock;
            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);} */ \
index e9bf6ef9ba67056973b2acc60d3ad951371c3b0a..f644cbfc2edd1f01dffd10abe2a71dbd87059b74 100644 (file)
@@ -55,7 +55,7 @@
 #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
 
@@ -806,6 +806,10 @@ static int doSweepAFSCache(vFilesFound,directory,dirNum,maxDir)
                  (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)) {
            /*
@@ -1058,6 +1062,16 @@ struct afsconf_dir *adir; {
     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()
 {
@@ -1612,6 +1626,7 @@ mainproc(as, arock)
     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
@@ -1996,7 +2011,7 @@ long param1, param2, param3, param4, param5, param6, param7;
 #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 */
index 04d8ba6a883894ab77fdbcf05f1f6d7d6b2daa2e..60f8aeb238c3e0494ae222ae489be75caacff1bd 100644 (file)
@@ -39,7 +39,7 @@ CFLAGS=-g -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS}
 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 \
@@ -69,11 +69,11 @@ libauth.krb.a: $(KOBJS) AFS_component_version_number.o
        $(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
 
index 9ea48559c7bc3a3af28e895b113ebd252ccc47a1..9c1fc5860823562bbc56f9e17e2418e65ece3618 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -33,12 +33,12 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/cellconfig.c,v 1.1.1.11 2001/10/14
 #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>
@@ -357,6 +357,7 @@ char clones[];
     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];
@@ -469,7 +470,44 @@ char clones[];
        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);
@@ -545,6 +583,28 @@ char *arock; {
     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)
@@ -658,6 +718,11 @@ afsconf_GetAfsdbInfo(acellName, aservice, acellInfo)
 
     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;
 
@@ -734,6 +799,7 @@ char *aservice;
 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;
@@ -765,6 +831,15 @@ struct afsconf_cell *acellInfo; {
        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 */
@@ -797,7 +872,7 @@ struct afsconf_cell *acellInfo; {
     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 */
index d5fa161bfa6b3f3bfca9304622f226cbc4e66cfb..5fa71d1bab8ddc1c1e6e798a46a84a478aad2990 100644 (file)
@@ -69,17 +69,28 @@ struct afsconf_cell {
     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();
index b89eb9e86e7dd73ae2754fde5927c616dd00ce8b..7024a9729d9f5bdc4f6150a08ca2341f1f167be5 100644 (file)
@@ -16,7 +16,7 @@
 #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"
index 0faa0af71e75a55626cb05b9e986ec96d313f1b8..e75287c888c748b129639875d1b82719c0294f88 100644 (file)
@@ -12,7 +12,7 @@
 #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>
@@ -333,6 +333,19 @@ int ktc_SetToken(
        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));
index bf4029e85c48ed61fe23f960aa8a0bac5237b21c..73aff8d62cefe61ca1632f562de9ab72a73b22d1 100644 (file)
@@ -2,6 +2,7 @@ AFS_component_version_number.c
 Makefile
 bnode.h
 bos
+bos_util
 boserr.c
 bosint.cs.c
 bosint.h
index cafaed0cce0ec5ce26c21f3c0ef7f5d9b565b667..b6c00e4cdd2bd46a388294aca46005286755f153 100644 (file)
@@ -60,7 +60,7 @@ LIBS=${TOP_LIBDIR}/librx.a \
 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)
 
@@ -87,6 +87,11 @@ bos.o: bos.c ${INCLS} AFS_component_version_number.o
 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}
@@ -107,6 +112,7 @@ install: \
        ${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
 
@@ -122,6 +128,9 @@ ${DEST}/bin/bos: bos
 ${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} $? $@
 
@@ -132,8 +141,9 @@ ${DEST}/include/afs/bnode.h: bnode.h
 # 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) 
@@ -154,6 +164,9 @@ ${DESTDIR}${bindir}/bos: bos
 ${DESTDIR}${afssrvbindir}/bos: bos
        ${INSTALL} $? $@
 
+${DESTDIR}${afssrvsbindir}/bos_util: bos_util
+       ${INSTALL} $? $@
+
 ${DESTDIR}${libdir}/afs/libbos.a: libbos.a
        ${INSTALL} $? $@
 
@@ -171,6 +184,6 @@ dest: \
        ${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
-
index 4653dc80c91403ce545d11d3ec1e8257e5060dd9..7a6f085246481a3e07c871a4fa9d298f910d5814 100644 (file)
@@ -66,7 +66,8 @@ BOSSERVER_EXELIBS =\
        $(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)
@@ -100,7 +101,8 @@ BOS_EXELIBS =\
        $(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)
index 28af78f5f256d981afb22c96b36f46492bdafa03..50da68a64b6512349430d5e6f2e90fc3b9740d2a 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -534,10 +534,10 @@ static int bproc() {
                            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 {
@@ -554,11 +554,11 @@ static int bproc() {
                            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);
index 98c5fc1ffcc91e951b71a330e9590abbfbd37f49..fef2f4d86b6f8c27b5851458698d9a115f3e8a33 100644 (file)
@@ -135,7 +135,7 @@ GetCellName(
 ) = 94;
 
 GetCellHost(
-  IN afs_int32 awhich,
+  IN afs_uint32 awhich,
   OUT string name<BOZO_BSSIZE>
 ) = 95;
 
index b240762f1af1977835e9debff057f8793b4910dc..1e0ae548de2cd4186b6e0cb7142f8aad0c2ad344 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -670,7 +670,9 @@ char **envp;
     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;
 
@@ -748,6 +750,9 @@ char **envp;
            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();
@@ -768,6 +773,7 @@ char **envp;
            printf("Usage: bosserver [-noauth] [-log] "
                   "[-syslog[=FACILITY]] "
                   "[-enable_peer_stats] [-enable_process_stats] "
+                  "[-nofork] "
                   "[-help]\n");
 #else
            printf("Usage: bosserver [-noauth] [-log] "
@@ -811,6 +817,7 @@ char **envp;
     /* go into the background and remove our controlling tty */
 
 #ifndef AFS_NT40_ENV
+    if (!nofork)
     background();
 #endif /* ! AFS_NT40_ENV */
 
index bc2437b26231b586b34d373885d3ff6942291139..68e5fe6073aa2ccb51d3fa75501c6eeb7b8846f6 100644 (file)
@@ -79,7 +79,8 @@ EXELIBS =\
         $(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)
index 278bf71b8a7988b24f29bc68941c01641b22e13e..2bbe304567b6c687ae1bd9e9e85e376cc4c94efd 100644 (file)
@@ -75,7 +75,8 @@ 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)
index e798e6de007c3d67e61d425e82dcc55650ae0726..9c87cf826b866fec16d94373aca9e3d1895f74ee 100644 (file)
@@ -49,7 +49,8 @@ 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)
index f1d648e0bd0f33886fa3f2cb27048a991e88008b..69129eb9d3f85ccd03121c64245e128bf4f5645c 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -355,7 +355,7 @@ static afs_int32 GetDeviceConfig(filename, config, portOffset)
         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);
@@ -366,7 +366,7 @@ static afs_int32 GetDeviceConfig(filename, config, portOffset)
            }
        } else {
            count = sscanf(line, "%s %u%s\n", devName, &aport, trest);
-           if (count == 2) {
+           if (count == 2 || count == 3) {
                capacity = 0x7fffffff;
                fmSize = 0;
            } else {
index 8e0753b1115a1bef93ba55375bb0c5dbd72e5b59..22047a5a757913406b5efd0b9d4c57f97dd97711 100644 (file)
@@ -13,6 +13,21 @@ ac_cv_linux_fs_struct_inode_has_i_bytes=no)])
 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"
index 98ad569998ce52743eca41a1809833ea62af9354..a21a2365fbf5f91553ba0e67399b9e45f754d43d 100644 (file)
@@ -58,21 +58,6 @@ ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
 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"
index 2559ee45c1ed78713e5dba000f278b53c97ddeb3..3dfaaaa015b19ee1096825a4ee596846fdd0315f 100644 (file)
@@ -5,7 +5,7 @@ AFS_OSTYPE = DARWIN
 #
 #
 # compilation and link editor flags
-XCFLAGS=-no-precomp
+XCFLAGS=-no-cpp-precomp
 #MT_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV ${XCFLAGS}
 #MT_CC=cc
 KROOT=
index 64603f32e4b7dc7d3fca6ca7934aa1dfda617e63..9d1770162cc61ece12ea37ddc1e0bf73602d75c9 100644 (file)
@@ -1,4 +1,4 @@
-pthread.dll                    0x61000000    0x00080000
+afspthread.dll                 0x61000000    0x00080000
 afsrpc.dll                     0x61080000    0x00080000
 afsauthent.dll                 0x61100000    0x00080000
 afspioctl.dll                  0x61200000    0x00080000
index 311f97acade68ed738ef5e7f0a1e729ce910063f..4307f5da0d1f20d6373d8cfc77a80291d3a2990d 100644 (file)
@@ -72,6 +72,9 @@ idirs: doclink
 !      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
@@ -114,7 +117,7 @@ $(DESTDIR)\bin\NTBUILD.bat:..\NTBUILD.bat
        $(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
 
@@ -131,7 +134,7 @@ doclink:
        - 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
@@ -163,7 +166,7 @@ $(DESTDIR)\bin\touch.exe:touch.exe
 
 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
 
index 2d48de1d5eed9e6d6c5822fe0eeeffa1373fb625..43f278963e925c1c294538ef298c474ec9a586d9 100644 (file)
@@ -37,10 +37,11 @@ APPVER = 4.0
 !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
@@ -156,7 +157,7 @@ afscdefs =\
      -DAFS_AFSDB_ENV \
      -DAFS_FREELANCE_CLIENT
 
-afscdefs = $(afscdefs) $(AFSDEV_AUXCDEFINES)
+afscdefs = $(afscdefs) $(AFSDEV_AUXCDEFINES) $(NMAKE_DEFINES)
 
 
 # Compiler switches (except include paths and preprocessor defines)
@@ -308,10 +309,10 @@ C2OBJ = $(cc) $(cflags) $(cdebug) $(cvarsdll) $(afscflags) $(afscdefs) /c
 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
index 176015c36d8a31703dacabefe3275e0277a04255..13799adf9db9e792f07bf09e4786f70ebdaef8a6 100644 (file)
@@ -37,7 +37,7 @@ APPVER = 4.0
 !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
@@ -327,7 +327,7 @@ C2OBJ = $(cc) $(cflags) $(cdebug) $(cvarsdll) $(afscflags) $(afscdefs) /c
 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
index 93a50a9079be14d3b1a0b2d09c6937e5c77dc8d7..14644a269f6c4514a7d2af3dd81e9da212515dfd 100644 (file)
@@ -40,6 +40,7 @@
 #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
index 8fdc667fbec06a97c922b4285c69d1d5ff103e23..4cdc5e61cd5cc368708b0f310784615b640f9877 100644 (file)
@@ -49,6 +49,7 @@
 #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
index 1b5c8c45ccf9fdf90ba4aab8b22f92f39f78eaa4..1270ee9bc75bf44340e340aed3df684dc0b91ba9 100644 (file)
@@ -102,6 +102,10 @@ enum vcexcl {NONEXCL, EXCL};
 #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 */
index 02517aecd0a0ecfd8f06a0f158863f8e6fde3c79..651fadbdf728c56d29d7199676560c0874067045 100644 (file)
@@ -103,6 +103,10 @@ enum vcexcl {NONEXCL, EXCL};
 #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 */
index 13f85f3284116cfd6cd6b4f3de471b5cbe52722b..26801268d4bccbf1b4929637dfefbe86ecc432dd 100644 (file)
@@ -177,4 +177,9 @@ struct cm_initparams {
 #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 */
index 6e685cc75a6561935c657de8416f3d5bfa936350..3887801501e5e56732edbc962835114ceaba32ed 100644 (file)
@@ -75,7 +75,7 @@ all: ukinstall ${TOP_LIBDIR}/libdes.a ${TOP_INCDIR}/des.h ${TOP_INCDIR}/des_conf
 
 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
@@ -189,7 +189,7 @@ ukinstall: \
        ${UKERNELDIR}/des/libdes.a \
        ${UKERNELDIR}/des/des.h \
        ${UKERNELDIR}/des/mit-cpyright.h 
-       
+
 ${UKERNELDIR}/des:
        mkdir -p $?
 
index f9cd73c3ef05edd89cde398afcaa4f0bfb14cdbf..22988e606437be6588fd0423e0784579cd6af827 100644 (file)
@@ -9,7 +9,7 @@
 #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>
@@ -58,7 +58,7 @@ void gen(stream)
        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))
index b198047a276ea6e2373a56804114cf41ba69b965..b777267c272f69fdb3a94225b7977ace980a55e3 100644 (file)
@@ -13,9 +13,8 @@
 
 /* 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"
index aa210a8b12ca8c4c33fd3552ebc525b180fcab44..549b5badf8cdef840b242ad4356d0461bd876727 100644 (file)
@@ -348,9 +348,9 @@ FetchStatus(
 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;
index d30fc494ff40794e3ee0493f17a421154b215b0f..59360c1dbc04ca548f5ac111aa6142d27c649738 100644 (file)
@@ -200,7 +200,7 @@ user.krb.o: user.c ${INCLS} ${TOP_INCDIR}/afs/vice.h
 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
 
index 717775f87b8002ae224f88caba233a9ffa3aac26..ca89d2a40273b56c6b7480e2783b9fafb09663fa 100644 (file)
@@ -279,6 +279,18 @@ extern afs_int32 ka_UserAuthenticateGeneral (
   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,
index 6fc0ab1f915d273a795cda3df2c4a74594afee43..b9253dc6b9f8c45a8d38c7a7f1b3c0cbd78a85f1 100644 (file)
@@ -10,7 +10,7 @@
 #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>
 
@@ -85,6 +85,22 @@ afs_int32 ka_UserAuthenticateGeneral(
        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;
@@ -147,6 +163,8 @@ afs_int32 ka_UserAuthenticateGeneral(
        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;
@@ -317,8 +335,8 @@ static check_response
 
     /* 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';
@@ -326,8 +344,8 @@ static check_response
 
     /* 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';
@@ -335,8 +353,8 @@ static check_response
 
     /* 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';
@@ -351,7 +369,7 @@ static check_response
     if ((ticket_len < 0) ||
        ((ticket_len + (ptr - (char *) cip->dat)) > (int) cip->length)) {
        return(INTK_BADPW);
-    }
+       }
 
     /* Check returned server name, instance, and realm fields */
     /*
index 564de8cd255cf53701826f0157d4bcf4ecf0f7c3..49ef8e53abd8b5a8f9b3630af89679a01fa41067 100644 (file)
@@ -105,7 +105,7 @@ DLLFILE = $(DESTDIR)\root.server\usr\afs\bin\afsadminutil.dll
 ILIBDIR = $(DESTDIR)\lib\afs
 
 DLLLIBS =\
-       $(DESTDIR)\lib\pthread.lib \
+       $(DESTDIR)\lib\afspthread.lib \
        $(DESTDIR)\lib\afsrpc.lib \
        $(DESTDIR)\lib\afsauthent.lib
 
index 3ce6cd7b914924dc620033619b22d8737fc92c04..f41a3d908ffd5b97dbeb7bbb987600491a72c0af 100644 (file)
@@ -35,7 +35,7 @@ DLLLIBS =\
        $(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
index 8669a699ab46c1fac6171afb9614a0db1677114b..a5c89a737647c24943e4b98799ae0bbb22132ef3 100644 (file)
@@ -40,7 +40,7 @@ DLLOBJS =\
        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 \
index 3772d6538c5c643f8d9c305db81383d2d6e2cd03..ca2864c3b9540de6fe39a70c0a31530395de0c11 100644 (file)
@@ -13,7 +13,7 @@ AFSDEV_AUXCDEFINES = -DAFS_PTHREAD_ENV
 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 \
index 63bc4ab6e2fcaa5716bdc1edc8f63ffa1604024d..8107a1a01ac9c3a45a39d5f39ef27fc3b253fed8 100644 (file)
@@ -26,7 +26,7 @@ DLLLIBS =\
        $(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
index f61c99fd69c00e3d9e3711f4ea071d64a8038392..de1ede309e7fa49a5b7c07c7b2d8a3c789816ab4 100644 (file)
@@ -31,7 +31,7 @@ DLLLIBS =\
        $(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
index 36a2e698aa625fd51616986de81597993a1b4bce..b32fc603518a97144f398d109222e39663337681 100644 (file)
@@ -33,7 +33,7 @@ DLLLIBS =\
        $(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
index 648068e4a19d3bdc83265de7d820b2c818943e44..7edffae82b59057dd03b7c9e5f3dddafca78a1f4 100644 (file)
@@ -13,7 +13,7 @@ AFSDEV_AUXCDEFINES = -DAFS_PTHREAD_ENV
 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 \
index 91e69b10af5426b606b22ea9a5b88e4db0aff52f..288760886796710897c4b40e96b07438dc9247e5 100644 (file)
@@ -50,7 +50,7 @@ DLLFILE = $(DESTDIR)\root.server\usr\afs\bin\afsvosadmin.dll
 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
index 76f9afa9bd3443ceb3b40911dfc7b496a2c8e344..1d9c6b1a8d0cdd891b199a56525759cfe3f2ac55 100644 (file)
@@ -182,7 +182,7 @@ KDEFS_64 = -64 -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE -mips4
 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)
@@ -197,6 +197,12 @@ IP28_KDEFS = -DIP28 -DR10000 -DSCACHE_SET_ASSOC=2 -D_NO_UNCACHED_MEM_WAR \
        -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
@@ -225,7 +231,7 @@ PROCESSORS = R5000 R1000
 <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
@@ -349,6 +355,7 @@ ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
                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 \
index a5d80a6e8dde69ee458acc2518edfb1def131534..7e4f1bf1ac10152cb47934f68e2b9493c6e7f6d6 100644 (file)
@@ -25,7 +25,7 @@
                <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>
index c739b875408bba4353d3cdb784cafc8e50b8e681..d4e5ddf503fa0ab083ca626fb456db7196fb5392 100644 (file)
@@ -209,9 +209,9 @@ cm_config.obj: $(WINNTAFSD)\cm_config.c
 
 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 \
index 46a00d8acd1bf7ecad42c8a838d2e1158f8d24ff..20fd1192d462629118aaa9575ab9bced628bb43a 100644 (file)
@@ -77,6 +77,7 @@ EXPORTS
        ktc_OldPioctl                                   @76
        pioctl                                          @77
        rx_Init                                         @78
+       ka_UserAuthenticateGeneral2                     @79
 
 
 
index d87af312696741a5f69a15816aba985652fca151..f8131dd31d3a41e0db3939562de0c9ebe5d5a2d4 100644 (file)
@@ -257,9 +257,9 @@ NTMAKE = nmake /nologo /f ntmakefile
 
 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
index ae9c95dc73544856a8af77475fc1909d76ae5eef..9c2f6b492481829a2a85b59b547a8dd6e7610bf4 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -256,6 +256,9 @@ try_auth:
      */
     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()");
     }
index a1ae0bc30d7400e4c83dd17adabc84dcdfc2ec7b..0d6ad6a6db3a92837d2b0349ff8332098bd99a7f 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -45,7 +45,7 @@ pam_sm_setcred(
     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;
@@ -262,11 +262,14 @@ pam_sm_setcred(
          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(
@@ -286,7 +289,7 @@ pam_sm_setcred(
        }
            
        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,
@@ -327,7 +330,6 @@ pam_sm_setcred(
                    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);
@@ -336,7 +338,6 @@ pam_sm_setcred(
                 if ( errcode != PAM_SUCCESS )
                     pam_afs_syslog(LOG_ERR, PAMAFS_KRBFAIL, user);
               }
-           }
 #endif
 
            RET(PAM_SUCCESS);
index 044b6ea063b73e9bf385310d72e7147a2e95e0d8..9b2f80ea873e58a5291fa71daf051bb6eea487ea 100644 (file)
@@ -16,8 +16,9 @@
 #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"
 
@@ -166,7 +167,7 @@ out:
 /* 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;
       
index 71dfb0284babe4eda5e8b25da91b6ba045e23689..8638c6e6e2f2d948fef44fc1cfef308e58b06250 100644 (file)
@@ -27,7 +27,7 @@ DLLOBJS =\
        afsprocmgmt.res
 
 DLLLIBS =\
-       $(DESTDIR)\lib\pthread.lib \
+       $(DESTDIR)\lib\afspthread.lib \
        $(DESTDIR)\lib\afs\afsutil.lib
 
 $(DLLFILE): $(DLLOBJS) $(DLLLIBS)
index 4e45267f1c158c502451ddb6a8108e45c1af4ada..887eaec7f4529fbdfe9986390f0ade30b1f08e90 100644 (file)
@@ -10,7 +10,7 @@
 test tests: pmgttest.exe
 
 PMGTTEST_EXELIBS =\
-       $(DESTDIR)\lib\pthread.lib \
+       $(DESTDIR)\lib\afspthread.lib \
        $(DESTDIR)\lib\afs\afsprocmgmt.lib \
        $(DESTDIR)\lib\afs\afsutil.lib
 
index 8d4de394fbdbe7a196e90b87ff4bf0bd3a43f076..e823ca9c794adb228fc010862c5999594a3e85cd 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -21,8 +21,8 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptclient.c,v 1.1.1.7 2001/10/1
 #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>
index 4555bb89fd68f1c6780d3cf0d618db0095d4b466..53d8c0e09d4ad75b20afa326adb3e7c42883a6c9 100644 (file)
@@ -15,7 +15,7 @@
 #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"
@@ -181,7 +181,8 @@ void osi_StopListener(void)
     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
index 1e5bad7be583c29df3f1139a6bbb45e775152860..9fd3e7214da5f9d9043662b1cbbf003575c49d7f 100644 (file)
@@ -85,6 +85,8 @@ ${MULTIOBJS}: rx.h rx_multi.h
 
 ${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
@@ -105,6 +107,9 @@ xdr_rx.o: xdr.h rx.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
index d05cae904f600df081c34e4180de61816d5a5b51..6242ec3d42c28f92403785abbdde2dbf1d7bd071 100644 (file)
@@ -506,6 +506,7 @@ struct rx_connection {
     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 */
 };
@@ -735,9 +736,10 @@ struct rx_ackPacket {
 #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 */
 
index 8e4914b7911ab64a138ce0bae2d24a13f42d36bd..8c876dbc206177639e3cf58f21f06c369f0fdf72 100644 (file)
 #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
@@ -46,6 +52,9 @@ struct ktc_principal {
     char name[MAXKTCNAMELEN];
     char instance[MAXKTCNAMELEN];
     char cell[MAXKTCREALMLEN];
+#ifdef AFS_NT40_ENV
+    char smbname[MAXRANDOMNAMELEN];
+#endif
 };
 
 #ifndef NEVERDATE
index f3c7a7c5da68804a1bdf391127ba34aed33c3cca..e8759a03ab4eacf4c851ee2fd8fb5bfdaf118078 100644 (file)
@@ -1 +1,7 @@
 Makefile
+stress.h
+stress.xdr.c
+stress.cs.c
+stress.ss.c
+stress_errs.h
+stress_errs.c
index 96d5257d1ec01f348a953b838f5a7fa7fab0d0ed..e7a0c457644ecb7b9c7587789fe7096271c8e607 100644 (file)
@@ -14,29 +14,27 @@ include ../../config/Makefile.${SYS_NAME}
 
 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:
@@ -57,7 +55,7 @@ th_stress.xdr.o: stress.xdr.c stress.h
        ${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
 
index cfea59d94a50e8537bf81dfae513aabff8e446f5..9cf7afd308865fd90bb4082164f0c8a2a6ee4015 100644 (file)
 #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
@@ -84,11 +85,11 @@ char **argv;
 
 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;
index 6d3ec64504f1ee9195f19d2540c8e02279c34104..a9dcc551bd0c61c5d44ce72252b70e30e29808cf 100644 (file)
@@ -69,11 +69,12 @@ BUTCLIBS=$(DESTDIR)\lib\afs\afsbudb.lib  \
             $(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 \
index f01f165af61aac138c896520516b65f53988df98..b9ebed8b0d073a85a6e346996a828f36507771b0 100644 (file)
@@ -191,7 +191,7 @@ EXELIBS = \
        $(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)
index 607c7452078ce82e31924e31d9d3de4c600d28d4..8643cca38a6447da7c3b70a2ffdcec57151ff1ce 100644 (file)
@@ -21,7 +21,8 @@ LIBS = \
        $(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
index a4efdb43d2d545c27238659510cb4cc9dbb74328..b94d8d7b6c5f970eedb1c3b71cdeb8a29aad9dd2 100644 (file)
@@ -118,6 +118,7 @@ ConstructLocalLogPath(const char *cpath,
 /* 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"
@@ -260,6 +261,7 @@ typedef enum afsdir_id {
       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 
@@ -331,6 +333,7 @@ const char *getDirPath(afsdir_id_t string_id);
 /* 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)
 
index ad817fae15c0e9628379616d6eae91a6ed1dd1e9..52e0e597dac8d0d08d161418dc7a4c1bb7ecdee7 100644 (file)
@@ -62,8 +62,10 @@ struct ViceIoctl {
  */
 #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
@@ -72,4 +74,3 @@ struct ViceIoctl {
    into the kernel by the normal ioctl parameter passing mechanism.
  */
 
-#define _VALIDVICEIOCTL(com) (com >= _VICEIOCTL(0) && com <= _VICEIOCTL(255))
index 1d6cdf2680d4120718f0f2702df1d9181d38b9d4..cdf33b56844ca5e4035bfb9d13b83129cda6d006 100644 (file)
@@ -105,7 +105,7 @@ ${DEST}/etc/kdump: kdump
                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* ) \
@@ -121,7 +121,7 @@ ${DEST}/etc/kdump: kdump
 ${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} ;; \
@@ -183,9 +183,9 @@ kdump.o: kdump.c ${INCLS} AFS_component_version_number.c
        -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? ) \
@@ -219,7 +219,7 @@ kdump.o: kdump.c ${INCLS} AFS_component_version_number.c
 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
 
@@ -262,7 +262,7 @@ kdump:  kdump.o
 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
 
@@ -320,7 +320,7 @@ ${DESTDIR}${sbindir}/kdump: kdump
                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* ) \
@@ -335,7 +335,7 @@ ${DESTDIR}${sbindir}/kdump: kdump
 ${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} ;; \
index 8d6615ce29615bfc0418e400dca8f35c5d4b2912..9d370ecff62df2c1ede9ff6f1b7f8c59a6103238 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -1863,6 +1863,35 @@ static ListCellsCmd(as)
     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;
 {
@@ -1964,6 +1993,40 @@ static NewCellCmd(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;
 {
@@ -2984,6 +3047,8 @@ defect 3069
     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");
@@ -2997,6 +3062,10 @@ defect 3069
     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
index 6d3a18b4758926b6adbaf9e37ae2b628e2339848..675e1c4ae9dd3e0a9d5a5212d341e56adb4b9381 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -1074,7 +1074,11 @@ n        printf("(%d frags, %d blocks, %.1f%% fragmentation)\n",
                         exit(-1);
                 else
 #endif
+#ifdef  AFS_SUN5_ENV
+                   exit(exitstat);
+#else
                exit(4);
+#endif
        }
 #endif
 #ifdef VICE
index aa2e0984820ca71c0f026cfe166ff9093faa941f..0a0b37bf01e4c15309d26181a757dec56c6b2518 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -748,6 +748,10 @@ h_TossStuff_r(host)
            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;
index 9f0a5e4b5abc04ec72c546399d5f16193b7d7f94..e2331e4e101d7ed6cdbb8e4a3a41aa09c24e2dfd 100644 (file)
@@ -85,7 +85,8 @@ VLSERVER_EXECLIBS = \
        $(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)
index c93d917949d7bafa771e1cc57be3f7914f9fe779..e36f8564dd2183d0f549b271f21f0a5e7f922d49 100644 (file)
@@ -33,7 +33,7 @@ LDFLAGS = ${OPTMZ} ${PROF} ${LDIRS} ${XLDFLAGS}
 
 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}
 
@@ -156,7 +156,7 @@ vlib.a:     ${VLIBOBJS} AFS_component_version_number.o
 
 # 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
@@ -183,18 +183,18 @@ volinfo: 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
index ec4f3443575854342f513f511c3fe69f97a9fb91..3d577ae493eb4f158832f4d1947dc4dfb1628dcd 100644 (file)
@@ -63,7 +63,7 @@ EXEC_LIBS = \
        $(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
index 90d4038fc955345620f15f904e0e671f14c962c3..f9f2e70392cf1b16b9dc46f7824a4ac95f782399 100644 (file)
@@ -64,7 +64,8 @@ EXEC_LIBS = \
        $(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
 
 
 ############################################################################
index e7a4aee79e0bcf70eab4f2c66a7e30810300c70f..e290ea1832f1f81f95bdefd516abce04c9950843 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -67,7 +67,7 @@ cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");\
 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;}