which included commits to RCS files with non-trunk default branches.
Openafs News -- history of user Visible changes. 11 July 2001
+* Changes since OpenAFS 1.1.1
+
+** AFS now supports --prefix and the other directory options of
+ configure. By default AFS builds assuming it will be installed in
+ /usr/local. In order to get traditional AFS directory paths (/usr/afs
+ and /usr/vice/etc) use the --enable-transarc-paths option to
+ configure. More details on the new directory layout are found in README.
+
* Changes since Openafs 1.0
** AFS now builds with configure. The README for building has been
install directory. These commands include klog, unlog, tokens, kpasswd,
symlink, fs and pts. The installable includes a readme file that contains
more information on how to use the client program and known issues.
+
+** support for large caches in afsd. Cachefiles are stored in
+ subdirectories. The default is 2048 files per subdirectory, which
+ should work fine in most situations. You can use the new afsd
+ option -files_per_subdir to change this number. Note that the first
+ time you run afsd with this patch, your cachefiles will get moved
+ into subdirectories. If you subsequently run an older version of
+ afsd, you will lose all your cached files.
License. For details, see the LICENSE file in the top-level source
directory or online at http://www.openafs.org/dl/license10.html
+Short instructions for sites upgrading from a previous version of AFS:
+% ./configure --enable-transarc-paths
+% make
+% make dest
+
+will create a Transarc-style dest tree in ${SYS_NAME}/dest where
+${SYS_NAME} is the AFS sysname of the system you built for.
+This assumes if you're building for Linux that your kernel source is
+in /usr/src/linux.
+
+Otherwise, please read on.
+
Building OpenAFS on UNIX and LINUX
----------------------------------
sun4x_57
sun4x_58
ppc_darwin_13
- alpha_linux_22 (DES does not work, will require one more change to
+ ppc_linux22
+ ppc_linux24
+ alpha_linux22 (DES does not work, will require one more change to
compile)
hp_ux110 (No client support, but db servers and utilities work)
hp_ux102 (No client support, but db servers and utilities work)
2. Using configure in the top level directory, configure for your
AFS system type, providing the necessary flags:
- % ./configure --with-afs-sysname=sun4x_58
+ % ./configure --with-afs-sysname=sun4x_58 --enable-transarc-paths
- For Linux systems you need also provide the patch in which your
+ For Linux systems you need also provide the path in which your
kernel headers for your configured kernel can be found. This should
be the path of the directory containing a child directory named
"include". So if your version file was
or insecure software included with OpenAFS. See README.obsolete and
README.insecure for more details.
+ There are two modes for directory path handling: "Transarc mode" and "default mode":
+ - In Transarc mode, we retain compatibility with Transarc/IBM AFS tools
+ by putting client configuaration files in /usr/vice/etc, and server
+ files in /usr/afs under the traditional directory layout.
+ - In default mode, files are located in standardized locations, usually
+ under $(prefix).
+ - Client programs, libraries, and related files always go in standard
+ directories under $(prefix). This rule covers things that would go
+ into $(bindir), $(includedir), $(libdir), $(mandir), and $(sbindir).
+ - Other files get located in the following places:
+
+ Directory Transarc Mode Default Mode
+ ============ ========================= ==============================
+ viceetcdir /usr/vice/etc $(sysconfdir)/openafs
+ afssrvdir /usr/afs/bin (servers) $(libexecdir)/openafs
+ afsconfdir /usr/afs/etc $(sysconfdir)/openafs/server
+ afslocaldir /usr/afs/local $(localstatedir)/openafs
+ afsdbdir /usr/afs/db $(localstatedir)/openafs/db
+ afslogdir /usr/afs/logs $(localstatedir)/openafs/logs
+ afsbosconfig $(afslocaldir)/BosConfig $(afsconfdir)/BosConfig
+ afsbosserver $(afsbindir)/bosserver $(sbindir)/bosserver
+
+
B Building
1. Now, you can build OpenAFS.
% make
- When the build completes, you will have a complete binary tree
- in the dest directory under the directory named for the sys_name you
- built for, e.g. sun4x_57/dest or i386_linux22/dest
+ 2. Install your build using either "make install" to install
+ into the current system (you will need to be root, and files
+ will be placed as appropriate for Transarc or standard paths),
+ "make install DESTDIR=/some/path" to install into an alternate
+ directory tree, or if you configured with --enable-transarc-paths
+ make dest to create a complete binary tree in the dest directory
+ under the directory named for the sys_name you built for,
+ e.g. sun4x_57/dest or i386_linux22/dest
2. As appropriate you can clean up or, if you're using Linux, build for
another kernel version:
#undef AFS_AFSDB_ENV
#undef AFS_NAMEI_ENV
-#undef BOS_RESTRICTED_MODE
-#undef FAST_RESTART
#undef BITMAP_LATER
+#undef BOS_RESTRICTED_MODE
+#undef FAST_RESTART
+#undef FULL_LISTVOL_SWITCH
#undef INODE_SETATTR_NOT_VOID
#undef STRUCT_INODE_HAS_I_BYTES
+#undef STRUCT_INODE_HAS_I_CDEV
+#undef STRUCT_INODE_HAS_I_TRUNCATE_SEM
+#undef STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
+#undef STRUCT_INODE_HAS_I_MAPPING_OVERLOAD
+#undef STRUCT_INODE_HAS_I_MMAP_SHARED
#undef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
/* glue for RedHat kernel bug */
aclocal -I src/cf
echo "Running autoconf"
autoconf
+echo "Running autoconf for configure-libafs"
+autoconf configure-libafs.in > configure-libafs
+chmod +x configure-libafs
echo "Running autoheader"
autoheader
#echo "Running automake"
libs: fsint cmd lwp osi rx rxkad vldb rxstat acl
clean:
- -rm -f $(SYS_NAME)/dest/include/*
- -rm -f $(SYS_NAME)/dest/include/afs/*
- -rm -f $(SYS_NAME)/dest/lib/*
- -rm -f $(SYS_NAME)/dest/lib/afs/*
- -rm -f $(SYS_NAME)/dest/bin/*
+ -$(RM) -f $(SYS_NAME)/dest/include/*
+ -$(RM) -f $(SYS_NAME)/dest/include/afs/*
+ -$(RM) -f $(SYS_NAME)/dest/lib/*
+ -$(RM) -f $(SYS_NAME)/dest/lib/afs/*
+ -$(RM) -f $(SYS_NAME)/dest/bin/*
config:
-make -C $(OBJ)/config install
NTMAKE_HEADERS = nmake /nologo /f ntmakefile install_headers
NTMAKE_LIBUTILS = nmake /nologo /f ntmakefile install_libutils
MKDIR = mkdir
-#OBJ = src
+OBJ = src
# Standard install directory.
!IFDEF AFSDEV_DESTDIR
#Leave last echo in - it helps the build reconize the last $(CD)
Win9x::
- $(CD) $(OBJ)\WINNT\install\$@
- nmake /nologo /f NTMakefile install9x
+ echo ***** afs_setup_utils
+ $(CD) $(OBJ)\WINNT\afs_setup_utils
+ nmake -f ntmakefile install
+ $(CD) ..\..\..
+ echo ***** Win9x
+ $(CD) $(OBJ)\WINNT\install\Win9x
+ nmake /nologo /f NTMakefile isinstall
$(CD) ..\..\..\..
- echo **** End of Install Scripts
+ eho **** End of Install Scripts
media: Win9x
$(CD) $(OBJ)\WINNT\install\Win9x
nmake /nologo /f NTMakefile clean
$(CD) ..\..\..\..
- .\src\rmbat $(DESTDIR)\include\*.* $(DESTDIR)\include\afs\*.* $(DESTDIR)\include\WINNT\*.* $(DESTDIR)\include\rx\*.*
- .\src\rmbat $(DESTDIR)\LIB\*.LIB $(DESTDIR)\LIB\*.DLL $(DESTDIR)\LIB\AFS\*.LIB
- .\src\RMBAT $(DESTDIR)\root.client\usr\vice\etc\*.*
+ $(DESTDIR)\BIN\rmbat $(DESTDIR)\include\*.* $(DESTDIR)\include\afs\*.* $(DESTDIR)\include\WINNT\*.* $(DESTDIR)\include\rx\*.*
+ $(DESTDIR)\BIN\rmbat $(DESTDIR)\LIB\*.LIB $(DESTDIR)\LIB\*.DLL $(DESTDIR)\LIB\AFS\*.LIB
+ $(DESTDIR)\BIN\rmbat $(DESTDIR)\root.client\usr\vice\etc\*.*
$(CD) $(OBJ)\config
nmake /nologo /f ntmakefile clean_version
$(CD) ..\..
NTMAKELANG = nmake /nologo /f ntmakefile en_US
NTMAKE_HEADERS = nmake /nologo /f ntmakefile install_headers
MKDIR = mkdir
-OBJ = obj
+OBJ = src
# Standard install directory.
!IFDEF AFSDEV_DESTDIR
$(CD) $(OBJ)\$@
$(NTMAKE)
$(CD) ..\..
-
+
adminutil: libadmin
echo ***** $@
$(CD) $(OBJ)\libadmin\$@
$(NTMAKE)
$(CD) ..\..\..
-
+
vos: adminutil
echo ***** $@
$(CD) $(OBJ)\libadmin\$@
$(NTMAKE)
$(CD) ..\..\..
-
+
client: vos
echo ***** $@
$(CD) $(OBJ)\libadmin\$@
$(NTMAKE)
$(CD) ..\..\..
-
+
kas: client
echo ***** $@
$(CD) $(OBJ)\libadmin\$@
$(NTMAKE)
$(CD) ..\..\..
-
+
pts: kas
echo ***** $@
$(CD) $(OBJ)\libadmin\$@
$(NTMAKE)
$(CD) ..\..\..
-
+
bos: pts
echo ***** $@
$(CD) $(OBJ)\libadmin\$@
$(NTMAKE)
$(CD) ..\..\..
-afs_setup_utils: afssvrcpa
- echo ***** $@
- $(CD) $(OBJ)\WINNT\$@
- $(NTMAKE)
- $(CD) ..\..\..
-
-client_talocale: afs_setup_utils
+client_talocale: afssvrcpa
echo ***** $@
$(CD) $(OBJ)\WINNT\talocale
$(NTMAKE)
# InstallShield dependencies
InstallShield5: install
+ echo ***** afs_setup_utils
+ $(CD) $(OBJ)\WINNT\afs_setup_utils
+ $(NTMAKE)
+ $(CD) ..\..\..
+
$(CD) $(OBJ)\WINNT\install\$@
$(NTMAKE)
$(CD) ..\..\..\..
This software has been released under the terms of the IBM Public
License. For details, see the LICENSE file in the top-level source
-directory or online at http://www.openafs.org/dl/license10.html
+directory or on-line at http://www.openafs.org/dl/license10.html
Building OpenAFS on Windows NT
------------------------------
A. Install a compiler
- You must install a copy of Microsoft Visual C++ 5.0 (6 might also
- work). The "Typical" install setting is sufficient. It may be
- possible to use other compilers, but the source code as provided
- will work with MS VC++ 5.0.
+ You must install a copy of Microsoft Visual C++ 5.0 or 6.0. The
+ "Typical" install setting is sufficient. It may be possible to use
+ other compilers, but the source code as provided will work with MS
+ VC++ 5.0/6.0.
B. Add missing header files
2. build of the product plus an installer package
In order to do the build that includes the installer package, a
- copy of InstallShield 5.x must be installed. NOTE: InstallShield
+ copy of Installshield 5.x must be installed. NOTE: Installshield
versions 6 and higher WILL NOT WORK.
+ Optional DLL's missing for Install Script
+ Two Microsoft DLL's must be included at DEST\WinInstall\Config\.
+ SHLWAPI.DLL
+ WININET.DLL
+
+ These files are only used for the Install, they will not be left
+ on the target machine.
+
D. Optional: Install flex and bison
There are two files in the source tree that are processed with lex
settings for you. Within this file there are the following lines
that must be set to match your system settings:
- set MSVCDIR=<path to vc directory of MS Visual C++>
+ * set SYS_NAME=<sys type>
+
+ * set MSVCDIR=<path to vc directory of MS Visual C++>
Ex: set MSVCDIR=c:\progra~1\DevStudio\vc
- This is the path to the compiler directory of the Microsot Visual
+ This is the path to the compiler directory of the Microsoft Visual
C++ installation.
- set AFSDEV_INCLUDE=<default include directories>
+ * set AFSDEV_INCLUDE=<default include directories>
Ex: set AFSDEV_INCLUDE=%MSVCDIR%\include;%MSVCDIR%\mfc\include
This contains a semicolon separated list of directories that
- contain compiler provided include files. You do not need to add paths
- here of AFS include files.
+ contain compiler provided include files. You should not need to
+ edit this other than to point to the DDK includes not provided
+ with the distribution
- set AFSDEV_LIB=<default library directories>
- Ex: set AFSDEV_LIB=%MSVCDIR%\lib;%MSVCDIR%\mfc\lib
-
- This contains a semicolon separated list of directories that
- contain compiler provided library files. You do not need to add
- paths here of AFS library files.
-
- set AFSDEV_BIN=<compiler binaries directory>
- Ex: set AFSDEV_BIN=%MSVCDIR%\bin
-
- This is the path to the compiler binary files.
-
- set AFSROOT=<Root directory of OpenAFS - parent of the src directory>
+ * set AFSROOT=<Root directory of OpenAFS - parent of the src directory>
Ex: set AFSROOT=d:\OpenAFS
This is the root directory of OpenAFS, which is the parent
directory of the src directory.
- set IS5ROOT=<root directory of the InstallShield5 program files>
+ * set IS5ROOT=<root directory of the Installshield5 program files>
Ex: set IS5ROOT=d:\progra~1\instal~1\instal~1.1pr
- This is the path to the InstallShield5 program directory. You
- should only define this if you have InstallShield installed on
- your computer and want to create the install package as part of
+ This is the path to the Installshield5 program directory. You
+ should only define this if you have Installshield installed on
+ your computer and want to create the install script as part of
the build.
- set BISON_SIMPLE=<path to bison.simple>
- set BISON_HAIRY=<path to bison.hairy>
- Ex: set BISON_SIMPLE=c:\bin\bison.simple
- Ex: set BISON_HAIRY=c:\bin\bison.hairy
+ NOTES: There are other settings in ntbuild.bat, but the ones listed
+ above must be set correctly for the build to succeed.
+
+ As can be seen in the examples above, all paths in
+ ntbuild.bat must be in the old MSDOS 8.3 format.
- bison has two files (in addition to the bison executable) that
- must be on the system. In order for bison to find these files,
- you must set the environment variables listed above to the paths
- to these files. There are other ways to do this, but this is
- what the build system expects.
+F. Set version and installation options
- NOTE: There are other settings in ntbuild.bat, but the ones listed
- above must be set correctly for the build to succeed.
+ Modify .\src\config\NTMakefile.i386_nt40
+ AFSPRODUCT_VERSION - Product version
+ CELLNAME_DEFAULT - The default AFS cell name
+ CELLSERVDB_INSTALL - The default name for the CellServDB included in the install script
+ CELLSERVDB_WEB - The default web address to obtain CellServDB
+
+For Example:
+
+ .\src\config\NTMakefile.i386_nt40
+
+ AFSPRODUCT_VERSION=1.1.1a
+ CELLNAME_DEFAULT=openafs.org
+ CELLSERVDB_INSTALL=CellServDB.GrandCentral
+ CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB
- As can be seen in the examples above, all paths in ntbuild.bat must
- be in the old MSDOS 8.3 format.
+NOTE: If CELLNAME_DEFAULT has a '.' in cell name, then the name is assumed to be
+a valid cell name and when the user installs AFS the AFS Control Center
+will default to NOT installed!
-F. Begin the build
+Version level may be specified in different formats, for example the following
+forms all have the same version level; however will be displayed differently:
+
+AFSPRODUCT_VERSION=1.1.1a
+AFSPRODUCT_VERSION=1.1.1 a
+AFSPRODUCT_VERSION=1.1.1.1
+AFSPRODUCT_VERSION=1.1.101
+
+Add CellServDB file to install area.
+ For the previous example you would add file:
+ DEST\Winistall\Config\CellServDB.GrandCentral
+
+G. Begin the build
1. Make sure you are running the default NT command shell, cmd.exe.
Other shells may work, but many do not.
3. Copy the file src/NTMakefile to the parent of the src directory.
You only need to do this once.
- 4. Begin the build. You can choose to build just the product bits,
- or, if InstallShield is installed, the product bits and the
+ 4. If you have not created a separate object build directory, edit NTMakefile and
+ OBJ=obj to OBJ=src.
+
+ 5. Begin the build. You can choose to build just the product bits,
+ or, if Installshield is installed, the product bits and the
install package.
To build just the product bits, run:
VC6RedistSetup_enu.exe
This is located at:
http://support.microsoft.com/support/kb/articles/Q259/4/03.ASP
+ Two Microsoft DLL's must be included at DEST\WinInstall\Config\.
+ SHLWAPI.DLL
+ WININET.DLL
+ These DLL's will not be left on the target machine, there are only
+ used for installation and removed after installation is complete.
+
+6) Required changes to configuration file .\src\config\NTMakefile.i386_win95
+
+AFSPRODUCT_VERSION - Product version
+CELLNAME_DEFAULT - The default AFS cell name
+CELLSERVDB_INSTALL - The default name for the CellServDB included in the install script
+CELLSERVDB_WEB - The default web address to obtain CellServDB
+
+For Example:
+
+ .\src\config\NTMakefile.i386_win95
+ AFSPRODUCT_VERSION=1.1.1a
+ CELLNAME_DEFAULT=openafs.org
+ CELLSERVDB_INSTALL=CellServDB.GrandCentral
+ CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB
+
+Version level may be specified in different formats, for example the following
+forms all have the same version level; however will be displayed differently:
+
+AFSPRODUCT_VERSION=1.1.1a
+AFSPRODUCT_VERSION=1.1.1 a
+AFSPRODUCT_VERSION=1.1.1.1
+AFSPRODUCT_VERSION=1.1.101
6) Installation
5. Reboot the target machine.
6. You can now start the client by executing the program WinAfsLoad.exe
from the install directory.
+
+
############################################################################
+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) \
- $(AFSRM_EXEFILE) lang
-lang ::
+media : install
+ $(AFSRM_EXEFILE) $(DIRLANG)
+ cd _isuser
+ nmake -fntmakefile install
+ $(CD) ..
+ cd getwebdll
+ nmake -fntmakefile install
+ $(CD) ..
+ echo
+
+$(DIRLANG) ::
$(CD) lang
- for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile install
+ @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
$(CD) ..
+ echo done lang
############################################################################
# How to build the shared source file for each uninstall dll
############################################################################
clean::
-
+ $(CD) _isuser
+ nmake -fntmakefile clean
+ $(CD) ..
+ $(CD) getwebdll
+ nmake -fntmakefile clean
+ $(CD) ..
+ echo done clean
+ cd _isuser
+ nmake -fntmakefile clean
+ $(CD) ..
+ cd getwebdll
+ nmake -fntmakefile clean
+ $(CD) ..
+ echo
############################################################################
#
*/
/*
- * INCLUDES _________________________________________________________________\r
- *\r
- */\r
-\r
-extern "C" {\r
-#include <afs/param.h>\r
-#include <afs/stds.h>\r
-#include <afs/fileutil.h>\r
-}\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include <time.h>\r
-#include <assert.h>\r
-#include <stdlib.h>\r
-#include <io.h>\r
-#include <string.h>\r
-#include <SYS\STAT.H>\r
-#include <shellapi.h>\r
-\r
-#include <WINNT/afsreg.h>\r
-#include <WINNT/afssw.h>\r
-#include <WINNT/talocale.h>\r
-\r
-#include "resource.h"\r
-#include "progress_dlg.h"\r
-#include "sutil.h"\r
-#include "forceremove.h"\r
-\r
-\r
-/*\r
- * PROTOTYPES _________________________________________________________________\r
- *\r
- */\r
-static char *GetAppInstallDir(struct APPINFO *pApp, BOOL bRemembered);\r
-BOOL UninstallCredsTool();\r
-BOOL ServerSpecificUninstall();\r
-BOOL ClientSpecificUninstall();\r
-\r
-\r
-\r
-/*\r
- * DEFINITIONS _________________________________________________________________\r
- *\r
- */\r
-#define SUCALLCONV WINAPI\r
-\r
-#define UNINSTALL_TEMP_INFO_KEY "HKEY_LOCAL_MACHINE\\Software\\AfsUninstallTempInfo"\r
-#define INSTALL_DIR_VALUE_NAME "InstallDir"\r
-\r
-#define AFS_PRESERVED_CFG_INFO_KEY "HKEY_LOCAL_MACHINE\\Software\\AfsPreservedConfigInfo"\r
-\r
-#define MS_SHARED_FILES_KEY "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\SharedDLLs"\r
-\r
-// Log file to use when running in silent mode\r
-#define UNINSTALL_ERROR_LOG_NAME "\\AfsUninstallErrorLog.txt"\r
-#define INSTALL_ERROR_LOG_NAME "\\AfsInstallErrorLog.txt"\r
-\r
-#define TARGETDIR "<TARGETDIR>"\r
-#define WINDIR "<WINDIR>"\r
-#define WINSYSDIR "<WINSYSDIR>"\r
-\r
-#define WIN9X_START_MENU_REG_KEY "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"\r
-#define WIN9X_START_MENU_REG_VALUE "Programs"\r
- \r
-#define WINNT_START_MENU_REG_KEY "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"\r
-#define WINNT_START_MENU_REG_VALUE "Common Programs"\r
-\r
-#define LOCALE_ID_LEN 4\r
-\r
-struct REGVALUE {\r
- char *pszKey;\r
- char *pszValue;\r
-};\r
-\r
-\r
-typedef BOOL (APP_UNINSTALL_FUNC)();\r
-\r
-\r
-\r
-struct APPINFO {\r
- char *pszAppName;\r
-\r
- // Service Info\r
- char *pszSvcName;\r
- char *pszSvcKey;\r
- char *pszSvcDependOn;\r
- char *pszSvcDisplayName;\r
-\r
- char *pszNetworkProviderOrder;\r
-\r
- // Message to use to tell the user that we have to stop the service\r
- int nServiceShutdownMsgID;\r
-\r
- // Message to use for the progress dialog that is shown while\r
- // waiting for the service to stop.\r
- int nServiceShutdownProgressMsgID;\r
-\r
- // Location in registry of a key we can use to know that the app is installed\r
- char *pszAppKey;\r
-\r
- // Location in registry of this app's install dir\r
- struct REGVALUE regInstallDir;\r
-\r
- // Path Info\r
- char *pszLocalRoot; // The root dir below the install dir\r
- char *pszBinPath; // Path to remove from the system path\r
-\r
- // Generated files and directories to delete. These are both multistring lists.\r
- char *pszDirsToDel; // All files in these dirs will be deleted\r
- char *pszFilesToDel; // Use this if you want to delete files but leave the dir. Wildcards can be used.\r
-\r
- // Registry values to remove\r
- struct REGVALUE *pRegValues;\r
- struct REGVALUE *pWinNTRegValues; // Only remove these if running WinNT\r
- struct REGVALUE *pWin9XRegValues; // Only remove these if running Win9X\r
-\r
- // Start menu entries to delete\r
- char *pszStartMenuEntries;\r
-\r
- // Registry keys to save if a user wants to preserve config info during uninstall\r
- char *pszRegKeysToPreserve;\r
- int nPreserveConfigInfoMsgID;\r
-\r
- // Uninstall func - used for things specific to this app\r
- APP_UNINSTALL_FUNC *pUninstallFunc;\r
-};\r
-\r
-\r
-/*\r
- * App info structure for the Server product\r
- */\r
-struct APPINFO appServer = {\r
- "AFS Server",\r
- \r
- AFSREG_SVR_SVC_NAME,\r
- AFSREG_SVR_SVC_KEY,\r
- 0, // No depend on\r
- AFSREG_SVR_SVC_DISPLAYNAME_DATA,\r
-\r
- 0, // No network provider order\r
-\r
- IDS_MUST_STOP_SERVER,\r
- IDS_WAITING_FOR_SERVER_TO_STOP,\r
-\r
- AFSREG_SVR_SW_VERSION_KEY,\r
- \r
- { AFSREG_SVR_SW_VERSION_KEY, AFSREG_SVR_SW_VERSION_DIR_VALUE },\r
-\r
- "\\Server",\r
- "\\usr\\afs\\bin",\r
-\r
- // Dirs to delete\r
- TARGETDIR"\\Server\\usr\\afs\\bin\\backup\0"\r
- TARGETDIR"\\Server\\usr\\afs\\bin\0"\r
- TARGETDIR"\\Server\\usr\\afs\\db\0"\r
- TARGETDIR"\\Server\\usr\\afs\\logs\0"\r
- TARGETDIR"\\Server\\usr\\afs\\etc\0"\r
- TARGETDIR"\\Server\\usr\\afs\\local\0"\r
- TARGETDIR"\\Server\\usr\\afs\0"\r
- TARGETDIR"\\Server\\usr\0",\r
- \r
- // Files to delete\r
- TARGETDIR"\\Common\\*.gid\0"\r
- TARGETDIR"\\Common\\*.fts\0",\r
-\r
- 0, // No reg values\r
- 0, // No NT only reg values\r
- 0, // No 9x only reg values\r
-\r
- "Server\0",\r
-\r
- // Config info to preserve\r
- AFSREG_SVR_SVC_KEY"\0", \r
- IDS_PRESERVE_SERVER_CONFIG_INFO,\r
-\r
- 0 // No special uninstall function\r
-};\r
-\r
-// Registry values to remove for the Client\r
-struct REGVALUE clientRegValues[] = {\r
- { "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved", "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" },\r
- { 0, 0 } // This indicates there are no more entries\r
-};\r
-\r
-struct REGVALUE clientWinNTRegValues[] = {\r
- { "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\File Manager\\AddOns", "AFS Client FME" },\r
- { 0, 0 }\r
-};\r
-\r
-struct REGVALUE clientWin9XRegValues[] = {\r
- { "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\NetworkProvider\\Order", "TransarcAFSDaemon" },\r
- { 0, 0 }\r
-};\r
-\r
-/*\r
- * App info structure for the Client product\r
- */\r
-struct APPINFO appClient = {\r
- "AFS Client",\r
- \r
- AFSREG_CLT_SVC_NAME,\r
- AFSREG_CLT_SVC_KEY,\r
- "5250435353004E657462696F730000",\r
- AFSREG_CLT_SVC_DISPLAYNAME_DATA,\r
-\r
- AFSREG_CLT_SVC_NAME,\r
-\r
- IDS_MUST_STOP_CLIENT,\r
- IDS_WAITING_FOR_CLIENT_TO_STOP,\r
-\r
- AFSREG_CLT_SW_VERSION_KEY,\r
-\r
- { AFSREG_CLT_SW_VERSION_KEY, AFSREG_CLT_SW_VERSION_DIR_VALUE },\r
-\r
- "\\Client",\r
- "\\Program",\r
-\r
- // No dirs to delete\r
- 0,\r
- \r
- // Files to delete\r
- TARGETDIR"\\Common\\*.gid\0"\r
- TARGETDIR"\\Common\\*.fts\0"\r
- WINDIR"\\..\\AFSCache\0"\r
- WINDIR"\\afsd.log\0"\r
- WINDIR"\\afsd.ini\0"\r
- WINDIR"\\afsdsbmt.ini\0"\r
- WINDIR"\\afsd_init.log\0",\r
- \r
- clientRegValues,\r
- clientWinNTRegValues,\r
- clientWin9XRegValues,\r
-\r
- // Start menu entries to remove\r
- "Client\0",\r
-\r
- // Config info to preserve\r
- AFSREG_CLT_SVC_KEY"\0",\r
- IDS_PRESERVE_CLIENT_CONFIG_INFO,\r
-\r
- ClientSpecificUninstall\r
-};\r
-\r
-\r
-/*\r
- * App info structure for the Light Client product\r
- */\r
-struct APPINFO appLightClient = {\r
- "AFS Light",\r
- \r
- // No service info \r
- 0,\r
- 0,\r
- 0,\r
- 0,\r
-\r
- AFSREG_CLT_SVC_NAME,\r
-\r
- // No service shutdown messages\r
- 0,\r
- 0,\r
-\r
- "HKEY_LOCAL_MACHINE\\SOFTWARE\\TransarcCorporation\\AFS Light Client",\r
-\r
- { AFSREG_CLT_SW_VERSION_KEY, AFSREG_CLT_SW_VERSION_DIR_VALUE },\r
-\r
- "\\Client",\r
- "\\Program",\r
-\r
- // No dirs to delete\r
- 0,\r
- \r
- // Files to delete\r
- TARGETDIR"\\Common\\*.gid\0"\r
- TARGETDIR"\\Common\\*.fts\0",\r
-\r
- clientRegValues,\r
- clientWinNTRegValues,\r
- clientWin9XRegValues,\r
-\r
- // Start menu entries to remove\r
- "Light\0",\r
-\r
- // Config info to preserve\r
- AFSREG_CLT_SVC_KEY"\0",\r
- IDS_PRESERVE_LIGHT_CLIENT_CONFIG_INFO,\r
-\r
- UninstallCredsTool\r
-};\r
-\r
-\r
-/*\r
- * App info structure for the Control Center product\r
- */\r
-struct APPINFO appControlCenter = {\r
- "AFS Control Center",\r
- \r
- // No service info\r
- 0,\r
- 0,\r
- 0,\r
- 0,\r
-\r
- // No network provider order\r
- 0,\r
-\r
- // No service shutdown messages \r
- 0,\r
- 0,\r
-\r
- "HKEY_LOCAL_MACHINE\\SOFTWARE\\TransarcCorporation\\AFS Control Center",\r
- \r
- { "HKEY_LOCAL_MACHINE\\SOFTWARE\\TransarcCorporation\\AFS Control Center\\CurrentVersion", "PathName" },\r
-\r
- "\\Control Center",\r
- "",\r
-\r
- // No dirs to delete\r
- 0,\r
- \r
- // Files to delete\r
- TARGETDIR"\\Common\\*.gid\0"\r
- TARGETDIR"\\Common\\*.fts\0",\r
- \r
- 0, // No reg values\r
- 0, // No NT only reg values\r
- 0, // No 9x only reg values\r
-\r
- // Start menu entries to remove\r
- "Control Center\0",\r
-\r
- // Config info to preserve\r
- AFSREG_CLT_SVC_KEY"\0",\r
- IDS_PRESERVE_CC_CONFIG_INFO,\r
-\r
- 0 // No uninstall function\r
-};\r
-\r
-\r
-/*\r
- * App info structure for the Sys Admin Doc files\r
- */\r
-struct APPINFO appDocs = {\r
- "AFS Supplemental Documentation",\r
-\r
- // No service info\r
- 0,\r
- 0,\r
- 0,\r
- 0,\r
-\r
- // No network provider order\r
- 0,\r
-\r
- // No service shutdown messages \r
- 0,\r
- 0,\r
-\r
- "HKEY_LOCAL_MACHINE\\SOFTWARE\\TransarcCorporation\\AFS Supplemental Documentation",\r
- \r
- { "HKEY_LOCAL_MACHINE\\SOFTWARE\\TransarcCorporation\\AFS Supplemental Documentation\\CurrentVersion", "PathName" },\r
-\r
- "\\Documentation",\r
- "",\r
-\r
- // No dirs to delete\r
- 0,\r
- \r
- // Files to delete\r
- TARGETDIR"\\Common\\*.gid\0"\r
- TARGETDIR"\\Common\\*.fts\0",\r
-\r
- 0, // No reg values\r
- 0, // No NT only reg values\r
- 0, // No 9x only reg values\r
-\r
- // Start menu entries to remove\r
- "Documentation\\AFS for Windows Backup Command Reference.lnk\0Documentation\\AFS Command Reference Manual.lnk\0Documentation\\AFS System Administrator's Guide.lnk\0",\r
-\r
- 0, // No config info to preserve\r
-\r
- 0 // No uninstall function\r
-};\r
-\r
-\r
-// Shared and in-use files\r
-struct FILEINFO {\r
- char *pszName;\r
- int nUsedBy;\r
-};\r
-\r
-#define SERVER 1\r
-#define CLIENT 2\r
-#define LCLIENT 4\r
-#define CC 8\r
-#define DOCS 16\r
-\r
-\r
-struct FILEINFO fileInfo[] = {\r
- { TARGETDIR"\\Common\\afsbosadmin.dll", SERVER | CC },\r
- { TARGETDIR"\\Common\\afscfgadmin.dll", SERVER | CC },\r
- { TARGETDIR"\\Common\\afsclientadmin.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afskasadmin.dll", SERVER | CC },\r
- { TARGETDIR"\\Common\\afsptsadmin.dll", SERVER | CC },\r
- { TARGETDIR"\\Common\\afsvosadmin.dll", SERVER | CC },\r
- { TARGETDIR"\\Common\\afsadminutil.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afsrpc.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afsauthent.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\pthread.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\TaAfsAppLib.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afsprocmgmt.dll", SERVER | CLIENT | LCLIENT },\r
- { TARGETDIR"\\Common\\afs_config.exe", CLIENT | LCLIENT| CC },\r
- { TARGETDIR"\\Common\\afseventmsg_????.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afslegal_????.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afsserver_????.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afssvrcfg_????.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\TaAfsAccountManager_????.dll",SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\TaAfsAppLib_????.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\TaAfsServerManager_????.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afscreds_????.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afs_config_????.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afs_cpa_????.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afs_shl_ext_????.dll", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afs-nt.hlp", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afs-nt.cnt", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\taafssvrmgr.cnt", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\taafssvrmgr.hlp", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\taafsusrmgr.cnt", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\taafsusrmgr.hlp", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afs-cc.cnt", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afs-cc.hlp", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afs-light.cnt", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\afs-light.hlp", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\taafscfg.cnt", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Common\\taafscfg.hlp", SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Client\\PROGRAM\\afs_shl_ext.dll", CLIENT | LCLIENT },\r
- { TARGETDIR"\\Client\\PROGRAM\\libafsconf.dll", CLIENT | LCLIENT },\r
- { TARGETDIR"\\Client\\PROGRAM\\afslogon.dll", CLIENT },\r
- { TARGETDIR"\\Client\\PROGRAM\\afslog95.dll", LCLIENT },\r
- { TARGETDIR"\\Control Center\\TaAfsAdmSvr.exe", CC },\r
- { WINSYSDIR"\\afs_cpa.cpl", CLIENT | LCLIENT | CC },\r
- { WINSYSDIR"\\afsserver.cpl", SERVER },\r
- { TARGETDIR"\\Common\\afsdcell.ini", CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Documentation\\Html\\banner.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },\r
- { TARGETDIR"\\Documentation\\Html\\books.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },\r
- { TARGETDIR"\\Documentation\\Html\\bot.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },\r
- { TARGETDIR"\\Documentation\\Html\\index.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },\r
- { TARGETDIR"\\Documentation\\Html\\index.htm", SERVER | CLIENT | LCLIENT | CC | DOCS },\r
- { TARGETDIR"\\Documentation\\Html\\next.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },\r
- { TARGETDIR"\\Documentation\\Html\\prev.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },\r
- { TARGETDIR"\\Documentation\\Html\\toc.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },\r
- { TARGETDIR"\\Documentation\\Html\\top.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },\r
- { TARGETDIR"\\Documentation\\Html\\ReleaseNotes\\relnotes.htm",\r
- SERVER | CLIENT | LCLIENT | CC },\r
- { TARGETDIR"\\Documentation\\Html\\InstallGd\\afsnt35i.htm",\r
- SERVER | CLIENT | LCLIENT | CC },\r
- { 0, 0 } // End of list\r
-};\r
-\r
-\r
-/*\r
- * VARIABLES _________________________________________________________________\r
- *\r
- */\r
-HINSTANCE hinst;\r
-\r
-static HWND hDlg;\r
-static BOOL bPreserveConfigInfo;\r
-static BOOL bSilentMode;\r
-static char *pszInstallDir;\r
-\r
-\r
-/*\r
- * FUNCTIONS _________________________________________________________________\r
- *\r
- */\r
-\r
-static BOOL UpgradeClientIntParm(HKEY hKey, char *pszOldParm, char *pszNewParm)\r
-{\r
- int nData;\r
- LONG result = ERROR_SUCCESS;\r
-\r
- nData = GetPrivateProfileInt("AFS Client", pszOldParm, -1, "afsd.ini");\r
- if (nData > -1)\r
- result = RegSetValueEx(hKey, pszNewParm, 0, REG_DWORD, (BYTE *)&nData, sizeof(nData));\r
-\r
- return (result == ERROR_SUCCESS);\r
-}\r
-\r
-static BOOL UpgradeClientStringParm(HKEY hKey, char *pszOldParm, char *pszNewParm)\r
-{\r
- char szData[1024];\r
- LONG result = ERROR_SUCCESS;\r
-\r
- GetPrivateProfileString("AFS Client", pszOldParm, "", szData, sizeof(szData), "afsd.ini");\r
- if (szData[0])\r
- result = RegSetValueEx(hKey, pszNewParm, 0, REG_SZ, (PBYTE)szData, strlen(szData) + 1);\r
-\r
- return (result == ERROR_SUCCESS);\r
-}\r
-\r
-int SUCALLCONV Upgrade34ClientConfigInfo()\r
-{\r
- HKEY hKey;\r
- LONG result;\r
- int nData;\r
- \r
- result = RegOpenKeyAlt(AFSREG_NULL_KEY, AFSREG_CLT_SVC_PARAM_KEY, KEY_WRITE, TRUE, &hKey, 0);\r
- if (result != ERROR_SUCCESS)\r
- return -1;\r
-\r
- UpgradeClientIntParm(hKey, "CacheSize", "CacheSize");\r
- UpgradeClientIntParm(hKey, "Stats", "Stats");\r
- UpgradeClientIntParm(hKey, "LogoffTokenTransfer", "LogoffTokenTransfer");\r
- UpgradeClientIntParm(hKey, "LogoffTokenTransferTimeout", "LogoffTokenTransferTimeout");\r
- UpgradeClientIntParm(hKey, "TrapOnPanic", "TrapOnPanic");\r
- UpgradeClientIntParm(hKey, "TraceBufferSize", "TraceBufferSize");\r
- UpgradeClientIntParm(hKey, "TraceOnShutdown", "TraceOnShutdown");\r
- UpgradeClientIntParm(hKey, "ReportSessionStartups", "ReportSessionStartups");\r
- \r
- UpgradeClientStringParm(hKey, "MountRoot", "MountRoot");\r
- UpgradeClientStringParm(hKey, "Cell", "Cell");\r
-\r
- /* BlockSize to ChunkSize requires convertion */\r
- nData = GetPrivateProfileInt("AFS Client", "BlockSize", -1, "afsd.ini");\r
- if (nData > -1) {\r
- DWORD chunkSize;\r
- for (chunkSize = 0; (1 << chunkSize) < nData; chunkSize++);\r
- (void) RegSetValueEx(hKey, "ChunkSize", 0, REG_DWORD, (BYTE *)&chunkSize, sizeof(chunkSize));\r
- }\r
-\r
- RegCloseKey(hKey);\r
-\r
- return 0;\r
-}\r
-\r
-int SUCALLCONV Eradicate34Client()\r
-{\r
- if (Client34Eradicate(TRUE) != ERROR_SUCCESS)\r
- return -1;\r
-\r
- return 0;\r
-}\r
-\r
-// This function was written a long time ago by Mike Comer for use by the \r
-// original DFS Client for NT install program.\r
-int SUCALLCONV CheckIfAdmin(void)\r
-{\r
- HANDLE token = INVALID_HANDLE_VALUE;\r
- PVOID buffer = 0;\r
- DWORD bufLength;\r
- DWORD realBufLength;\r
- TOKEN_PRIMARY_GROUP *pgroup;\r
- TOKEN_GROUPS *groups;\r
- int result = -1;\r
- DWORD groupCount;\r
- LONG status;\r
- PSID AdministratorSID = NULL;\r
- SID_IDENTIFIER_AUTHORITY authority = SECURITY_NT_AUTHORITY;\r
-\r
- // allocate the SID for the Administrators group\r
- if (!AllocateAndInitializeSid(&authority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &AdministratorSID)) {\r
- status = GetLastError();\r
- goto getout;\r
- }\r
-\r
- // open the process token\r
- if (!OpenProcessToken(GetCurrentProcess(), TOKEN_READ, &token)) {\r
- status = GetLastError();\r
- token = INVALID_HANDLE_VALUE;\r
- goto getout;\r
- }\r
-\r
- // check primary group first\r
- buffer = GlobalAlloc(GMEM_FIXED, sizeof(TOKEN_PRIMARY_GROUP));\r
- if (!buffer) {\r
- goto getout;\r
- }\r
-\r
- bufLength = sizeof(TOKEN_PRIMARY_GROUP);\r
- while(1) {\r
- if (!GetTokenInformation(token, TokenPrimaryGroup, buffer, bufLength, &realBufLength)) {\r
- if (realBufLength > bufLength) {\r
- // not enough space\r
- GlobalFree(buffer);\r
- bufLength = realBufLength;\r
- buffer = GlobalAlloc(GMEM_FIXED, realBufLength);\r
- if (!buffer) {\r
- goto getout;\r
- }\r
- continue;\r
- }\r
-\r
- goto getout;\r
- }\r
- break;\r
- }\r
-\r
- pgroup = (TOKEN_PRIMARY_GROUP *)buffer;\r
- if (EqualSid(pgroup->PrimaryGroup, AdministratorSID)) {\r
- result = 0;\r
- } else {\r
- // okay, try the secondary groups\r
- while(1) {\r
- if (!GetTokenInformation(token, TokenGroups, buffer, bufLength, &realBufLength)) {\r
- if (realBufLength > bufLength) {\r
- // not enough space\r
- GlobalFree(buffer);\r
- bufLength = realBufLength;\r
- buffer = GlobalAlloc(GMEM_FIXED, realBufLength);\r
- if (!buffer) {\r
- goto getout;\r
- }\r
- continue;\r
- }\r
-\r
- // a real error\r
- goto getout;\r
- }\r
- break;\r
- }\r
-\r
- // we have the list of groups here. Process them:\r
- groups = (TOKEN_GROUPS *)buffer;\r
- for(groupCount = 0; groupCount < groups->GroupCount; groupCount++) {\r
- if (EqualSid(groups->Groups[groupCount].Sid, AdministratorSID)) {\r
- result = 0;\r
- break;\r
- }\r
- }\r
- }\r
-\r
-getout:\r
-\r
- if (token != INVALID_HANDLE_VALUE) {\r
- CloseHandle(token);\r
- }\r
-\r
- if (buffer) {\r
- GlobalFree(buffer);\r
- }\r
-\r
- if (AdministratorSID) {\r
- FreeSid(AdministratorSID);\r
- }\r
-\r
- return result;\r
-}\r
-\r
-static void SetSharedFileRefCount(char *pszFile, int nRefCount)\r
-{\r
- LONG result;\r
- HKEY hKey;\r
- \r
- result = RegOpenKeyAlt(AFSREG_NULL_KEY, MS_SHARED_FILES_KEY, KEY_WRITE, FALSE, &hKey, 0);\r
- if (result != ERROR_SUCCESS)\r
- return;\r
- \r
- if (nRefCount <= 0)\r
- RegDeleteValue(hKey, pszFile);\r
- else\r
- RegSetValueEx(hKey, pszFile, 0, REG_DWORD, (BYTE *)&nRefCount, sizeof(int)); \r
- \r
- RegCloseKey(hKey);\r
-}\r
-\r
-static char *GetTimeStamp()\r
-{\r
- char szTime[64], szDate[64];\r
- static char szTimeDate[128];\r
-\r
- _strtime(szTime);\r
- _strdate(szDate);\r
-\r
- sprintf(szTimeDate, "[%s %s] ", szTime, szDate);\r
- \r
- return szTimeDate;\r
-}\r
-\r
-int SUCALLCONV WriteToInstallErrorLog(char *pszMsg)\r
-{\r
- static BOOL bWritten = FALSE;\r
- FILE *fp;\r
-\r
- // On the first write, recreate the file \r
- fp = fopen(INSTALL_ERROR_LOG_NAME, bWritten ? "a" : "w");\r
- if (!fp)\r
- return -1;\r
- \r
- fprintf(fp, "%s%s\r\n", GetTimeStamp(), pszMsg);\r
- \r
- fclose(fp);\r
- \r
- bWritten = TRUE;\r
- \r
- return 0;\r
-}\r
-\r
-static void WriteToUninstallErrorLog(char *pszMsg)\r
-{\r
- static BOOL bWritten = FALSE;\r
- FILE *fp;\r
-\r
- // On the first write, recreate the file \r
- fp = fopen(UNINSTALL_ERROR_LOG_NAME, bWritten ? "a" : "w");\r
- if (!fp)\r
- return;\r
- \r
- fprintf(fp, "%s%s\r\n", GetTimeStamp(), pszMsg);\r
- \r
- fclose(fp);\r
- \r
- bWritten = TRUE;\r
-}\r
-\r
-static char *LoadResString(UINT uID)\r
-{\r
- static char str[256];\r
- GetString (str, uID);\r
- return str;\r
-}\r
-\r
-static void ShowError(UINT nResID, LONG nError)\r
-{\r
- char szErr[256];\r
- char szPrompt[256];\r
- char szMsg[256];\r
- char szTitle[256];\r
- char *psz;\r
-\r
- psz = LoadResString(nResID);\r
- if (psz)\r
- strcpy(szErr, psz);\r
- else\r
- sprintf(szErr, "unknown error msg (Msg ID = %d)", nResID);\r
- \r
- psz = LoadResString(IDS_INSTALLATION_FAILURE);\r
- strcpy(szPrompt, psz ? psz : "An error has occurred: %s (Last Error = %ld).");\r
-\r
- sprintf(szMsg, szPrompt, szErr, nError);\r
-\r
- psz = LoadResString(IDS_TITLE);\r
- strcpy(szTitle, psz ? psz : "AFS");\r
-\r
- if (bSilentMode)\r
- WriteToUninstallErrorLog(szMsg);\r
- else\r
- MessageBox(hDlg, szMsg, szTitle, MB_OK);\r
-}\r
-\r
-static int ShowMsg(UINT nResID, int nType)\r
-{\r
- char szTitle[256];\r
- char *psz;\r
-\r
- psz = LoadResString(IDS_TITLE);\r
- strcpy(szTitle, psz ? psz : "AFS");\r
-\r
- return MessageBox(hDlg, LoadResString(nResID), szTitle, nType);\r
-}\r
-\r
-static char *GetAppInstallDir(struct APPINFO *pApp, BOOL bRemembered)\r
-{\r
- HKEY hKey;\r
- LONG nResult;\r
- DWORD dwType;\r
- static char szInstallDir[256];\r
- DWORD dwSize;\r
- char *pszKey;\r
- char *pszValue;\r
-\r
- pszKey = bRemembered ? UNINSTALL_TEMP_INFO_KEY : pApp->regInstallDir.pszKey;\r
- pszValue = bRemembered ? INSTALL_DIR_VALUE_NAME : pApp->regInstallDir.pszValue;\r
-\r
- dwSize = sizeof(szInstallDir);\r
-\r
- nResult = RegOpenKeyAlt(AFSREG_NULL_KEY, pszKey, KEY_READ, FALSE, &hKey, 0);\r
- if (nResult == ERROR_SUCCESS) {\r
- nResult = RegQueryValueEx(hKey, pszValue, 0, &dwType, (PBYTE)szInstallDir, &dwSize);\r
- RegCloseKey(hKey);\r
- }\r
-\r
- if (nResult != ERROR_SUCCESS) {\r
- ShowError(IDS_CANT_DETERMINE_APP_PATH, nResult);\r
- return 0;\r
- }\r
-\r
- FilepathNormalizeEx(szInstallDir, FPN_BACK_SLASHES);\r
-\r
- return szInstallDir;\r
-}\r
-\r
-static BOOL DoesRegKeyExist(char *pszKey)\r
-{\r
- HKEY hKey;\r
- LONG nResult;\r
-\r
- nResult = RegOpenKeyAlt(AFSREG_NULL_KEY, pszKey, KEY_READ, FALSE, &hKey, 0);\r
- if (nResult == ERROR_SUCCESS) {\r
- RegCloseKey(hKey);\r
- return TRUE;\r
- }\r
-\r
- return FALSE;\r
-}\r
-\r
-static BOOL IsAppInstalled(struct APPINFO *pApp)\r
-{\r
- return DoesRegKeyExist(pApp->pszAppKey);\r
-}\r
-\r
-static void BuildShortPath(char *pszShortPath, UINT nShortPathLen, char *pszInstallDir, char *pszPath)\r
-{\r
- strncpy(pszShortPath, pszInstallDir, nShortPathLen);\r
- strncat(pszShortPath, pszPath, nShortPathLen);\r
- \r
- GetShortPathName(pszShortPath, pszShortPath, nShortPathLen);\r
-}\r
-\r
-static BOOL IsWin95()\r
-{\r
- OSVERSIONINFO versionInformation;\r
-\r
- versionInformation.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);\r
- \r
- GetVersionEx(&versionInformation);\r
- \r
- if ((versionInformation.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) &&\r
- (versionInformation.dwMinorVersion == 0))\r
- return TRUE;\r
- \r
- return FALSE;\r
-}\r
-\r
-int IsWin98()\r
-{\r
- OSVERSIONINFO versionInformation;\r
-\r
- versionInformation.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);\r
- \r
- GetVersionEx(&versionInformation);\r
- \r
- if ((versionInformation.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) &&\r
- (versionInformation.dwMinorVersion == 10))\r
- return 0;\r
- \r
- return -1;\r
-}\r
-\r
-static BOOL IsServiceInstalled(char *pszServiceKey)\r
-{\r
- HKEY hKey;\r
-\r
- if (RegOpenKeyAlt(0, pszServiceKey, KEY_READ, FALSE, &hKey, 0) == ERROR_SUCCESS) {\r
- RegCloseKey(hKey);\r
- return TRUE;\r
- }\r
-\r
- return FALSE;\r
-}\r
-\r
-// If this fails in anyway we just return. No error is displayed.\r
-static void MakeSureServiceDoesNotExist(char *pszName)\r
-{\r
- SC_HANDLE hServer = 0, hSCM = 0;\r
- SERVICE_STATUS status;\r
-\r
- hSCM = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE);\r
- if (hSCM) {\r
- hServer = OpenService(hSCM, pszName, SERVICE_ALL_ACCESS | DELETE);\r
- if (hServer) {\r
- if (QueryServiceStatus(hServer, &status)) {\r
- if (status.dwCurrentState != SERVICE_STOPPED) {\r
- if (!ControlService(hServer, SERVICE_CONTROL_STOP, &status)) {\r
- CloseServiceHandle(hServer);\r
- CloseServiceHandle(hSCM);\r
- return;\r
- }\r
- }\r
- }\r
- \r
- // Try to delete even if status query fails\r
- DeleteService(hServer);\r
- }\r
- }\r
-\r
- if (hServer)\r
- CloseServiceHandle(hServer);\r
- if (hSCM)\r
- CloseServiceHandle(hSCM);\r
-}\r
-\r
-static int InstallService(char *pszName, char *pszDependOn, char *pszDisplayName, char *pszServicePath, BOOL bInteractive)\r
-{\r
- SC_HANDLE hServer = 0, hSCM;\r
- BOOL bRestoreOldConfig = FALSE;\r
-\r
- hSCM = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE);\r
- if (!hSCM) {\r
- ShowError(IDS_SCM_OPEN_FAILED, GetLastError());\r
- return -1;\r
- }\r
-\r
-/* This code is not used, but it could be handy in the future so I am keeping it here.\r
-\r
- // If the service exists, then we (most probably) are in the middle of an upgrade or reinstall.\r
- bRestoreOldConfig = IsServiceInstalled(pszName);\r
-\r
- if (bRestoreOldConfig) {\r
- hServer = OpenService(hSCM, pszName, SERVICE_ALL_ACCESS);\r
- if (!hServer || !ChangeServiceConfig(hServer, SERVICE_NO_CHANGE, SERVICE_AUTO_START, SERVICE_NO_CHANGE, 0, 0, 0, 0, 0, 0, 0)) {\r
- ShowError(IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED, GetLastError());\r
- bRestoreOldConfig = FALSE;\r
- // Fall through to service creation below\r
- }\r
- } \r
-*/\r
- \r
- if (!bRestoreOldConfig) {\r
- DWORD dwServiceType;\r
-\r
- // If the service already exists, the create call will fail. This can\r
- // happen if uninstall failed (which is not infrequent). Making sure the\r
- // service does not exist makes it easier for a user to install over top of\r
- // a previously failed uninstall.\r
- MakeSureServiceDoesNotExist(pszName);\r
-\r
- dwServiceType = SERVICE_WIN32_OWN_PROCESS;\r
- if (bInteractive)\r
- dwServiceType |= SERVICE_INTERACTIVE_PROCESS;\r
- \r
- hServer = CreateService(hSCM, pszName, pszDisplayName,\r
- SERVICE_ALL_ACCESS, dwServiceType, SERVICE_AUTO_START, \r
- SERVICE_ERROR_NORMAL, pszServicePath, 0, 0, "RPCSS\0Netbios\0\0", 0, 0);\r
- \r
- if (!hServer)\r
- ShowError(IDS_SERVICE_CREATE_FAILED, GetLastError());\r
- }\r
-\r
- if (hServer)\r
- CloseServiceHandle(hServer);\r
-\r
- CloseServiceHandle(hSCM);\r
-\r
- return 0;\r
-}\r
-\r
-int SUCALLCONV InstallServerService(char *pszServicePath)\r
-{\r
- return InstallService(appServer.pszSvcName, 0, appServer.pszSvcDisplayName, pszServicePath, TRUE);\r
-}\r
-\r
-int SUCALLCONV InstallClientService(char *pszServicePath)\r
-{\r
- return InstallService(appClient.pszSvcName, appClient.pszSvcDependOn, appClient.pszSvcDisplayName, pszServicePath, FALSE);\r
-}\r
-\r
-static int UninstallService(struct APPINFO *pAppInfo)\r
-{\r
- SC_HANDLE hServer, hSCM;\r
- SERVICE_STATUS status;\r
- BOOL bOk;\r
- BOOL bServer = FALSE;\r
- BOOL bShowingProgressDlg = FALSE;\r
-\r
- hSCM = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE);\r
- if (!hSCM) {\r
- ShowError(IDS_SCM_OPEN_FAILED, GetLastError());\r
- return -1;\r
- }\r
- \r
- hServer = OpenService(hSCM, pAppInfo->pszSvcName, SERVICE_ALL_ACCESS | DELETE);\r
- if (!hServer) {\r
- ShowError(IDS_SERVICE_OPEN_FAILED, GetLastError());\r
- CloseServiceHandle(hSCM);\r
- return -1;\r
- }\r
-\r
- if (!QueryServiceStatus(hServer, &status)) {\r
- ShowError(IDS_SERVICE_QUERY_FAILED, GetLastError());\r
- CloseServiceHandle(hServer);\r
- CloseServiceHandle(hSCM);\r
- return -1;\r
- }\r
-\r
- if (status.dwCurrentState != SERVICE_STOPPED) {\r
- if (pAppInfo->nServiceShutdownMsgID) {\r
- if (!bSilentMode && (ShowMsg(pAppInfo->nServiceShutdownMsgID, MB_YESNO | MB_ICONQUESTION) == IDNO)) {\r
- CloseServiceHandle(hServer);\r
- CloseServiceHandle(hSCM);\r
- return 1;\r
- }\r
- }\r
-\r
- if (!bSilentMode)\r
- bShowingProgressDlg = ShowProgressDialog(LoadResString(pAppInfo->nServiceShutdownProgressMsgID));\r
-\r
- if (!ControlService(hServer, SERVICE_CONTROL_STOP, &status)) {\r
- if (bShowingProgressDlg)\r
- HideProgressDialog();\r
- ShowError(IDS_SERVICE_STOP_FAILED, GetLastError());\r
- CloseServiceHandle(hServer);\r
- CloseServiceHandle(hSCM);\r
- return -1;\r
- }\r
- }\r
-\r
- // Wait for the service to stop\r
- while (status.dwCurrentState != SERVICE_STOPPED) {\r
- // I stopped waiting on dwWaitHint because it seemed the wait hint was too long.\r
- // The service would be stopped but we'd still be asleep for a long time yet.\r
- Sleep(5000); //status.dwWaitHint);\r
-\r
- if (!QueryServiceStatus(hServer, &status)) {\r
- if (bShowingProgressDlg)\r
- HideProgressDialog();\r
- ShowError(IDS_SERVICE_QUERY_FAILED, GetLastError());\r
- CloseServiceHandle(hServer);\r
- CloseServiceHandle(hSCM);\r
- return -1;\r
- }\r
- }\r
-\r
- // The service has been stopped\r
- if (bShowingProgressDlg)\r
- HideProgressDialog();\r
-\r
- // This code to disable the service may be of use some day so I am keeping it here.\r
- // bOk = ChangeServiceConfig(hServer, SERVICE_NO_CHANGE, SERVICE_DISABLED, SERVICE_NO_CHANGE, 0, 0, 0, 0, 0, 0, 0); \r
-\r
- bOk = DeleteService(hServer);\r
-\r
- if (!bOk)\r
- ShowError(IDS_SERVICE_DELETE_FAILED, GetLastError());\r
-\r
- CloseServiceHandle(hServer);\r
- CloseServiceHandle(hSCM);\r
-\r
- return (bOk ? 0 : -1);\r
-}\r
-\r
-int SUCALLCONV AddToNetworkProviderOrder(char *pszWhatToAdd)\r
-{\r
- return AddToProviderOrder(pszWhatToAdd) ? 0 : -1;\r
-}\r
-\r
-static int RemoveFromNetworkProviderOrder(char *pszWhatToDel)\r
-{\r
- return RemoveFromProviderOrder(pszWhatToDel) ? 0 : -1;\r
-}\r
-\r
-int SUCALLCONV AddToPath(char *pszPath)\r
-{\r
- return AddToSystemPath(pszPath) ? 0 : -1;\r
-}\r
-\r
-static int RemoveFromPath(char *pszPath)\r
-{\r
- return RemoveFromSystemPath(pszPath) ? 0 : -1;\r
-}\r
-\r
-static void RemoveFiles(char *pszFileSpec)\r
-{\r
- struct _finddata_t fileinfo;\r
- long hSearch;\r
- char szDel[MAX_PATH];\r
- char szDir[MAX_PATH];\r
- char *p;\r
-\r
- strcpy(szDir, pszFileSpec);\r
- p = strrchr(szDir, '\\');\r
- if (p)\r
- *p = 0;\r
- \r
- hSearch = _findfirst(pszFileSpec, &fileinfo);\r
- if (hSearch == -1)\r
- return;\r
-\r
- while (1) {\r
- if ((strcmp(fileinfo.name, ".") != 0) && (strcmp(fileinfo.name, "..") != 0)) {\r
- sprintf(szDel, "%s\\%s", szDir, fileinfo.name);\r
- DeleteFile(szDel);\r
- }\r
-\r
- if (_findnext(hSearch, &fileinfo) == -1)\r
- break;\r
- }\r
-\r
- _findclose(hSearch);\r
-}\r
-\r
-static void RemoveDir(char *pszDir)\r
-{\r
- char szFileSpec[MAX_PATH];\r
-\r
- sprintf(szFileSpec, "%s\\*.*", pszDir);\r
-\r
- RemoveFiles(szFileSpec);\r
- RemoveDirectory(pszDir);\r
-}\r
-\r
-static void RemoveRegValues(struct REGVALUE *pRegValues)\r
-{\r
- struct REGVALUE *pCurValue;\r
- HKEY hKey;\r
- LONG nResult;\r
-\r
- if (!pRegValues)\r
- return;\r
-\r
- for (pCurValue = pRegValues; pCurValue->pszKey; pCurValue++) {\r
- nResult = RegOpenKeyAlt(AFSREG_NULL_KEY, pCurValue->pszKey, KEY_ALL_ACCESS, FALSE, &hKey, 0);\r
-\r
- if (nResult == ERROR_SUCCESS) {\r
- nResult = RegDeleteValue(hKey, pCurValue->pszValue);\r
- RegCloseKey(hKey);\r
- }\r
-\r
- if (nResult != ERROR_SUCCESS)\r
- ShowError(IDS_REG_DELETE_VALUE_ERROR, nResult);\r
- }\r
-}\r
-\r
-static BOOL UninstallCredsTool()\r
-{\r
- int nResult = WinExec("afscreds /uninstall", SW_HIDE);\r
-\r
- if (nResult <= 31) {\r
- if (nResult != ERROR_FILE_NOT_FOUND)\r
- ShowError(IDS_CANT_UNINSTALL_AFSCREDS, nResult);\r
- }\r
-\r
- // Always return true. We don't want the uninstall to completely fail just\r
- // because the creds tool didn't uninstall.\r
- return TRUE;\r
-}\r
-\r
-\r
-static char *GetTempDir()\r
-{\r
- DWORD result;\r
- static char szTempDir[MAX_PATH];\r
-\r
- result = GetTempPath(sizeof(szTempDir) - 1, szTempDir);\r
- if (result == 0)\r
- return "\\";\r
- \r
- return szTempDir;\r
-}\r
-\r
-static char *GetRootInstallDir()\r
-{\r
- char *psz;\r
- static char szRootInstallDir[MAX_PATH] = "";\r
-\r
- if (szRootInstallDir[0] == 0) {\r
- strcpy(szRootInstallDir, pszInstallDir);\r
- \r
- // Strip off the app specific part of the install dir\r
- psz = strrchr(szRootInstallDir, '\\');\r
- if (psz)\r
- *psz = 0;\r
- }\r
-\r
- return szRootInstallDir;\r
-}\r
-\r
-static BOOL ClientSpecificUninstall()\r
-{\r
- int nChoice;\r
-\r
- // This function needs to do two things. First it needs to see if the server is\r
- // installed, and if it is, ask the user if they really want to uninstall the\r
- // client given that the server needs the client. Second, if we are uninstalling\r
- // the client, we need to uninstall the creds tool.\r
-\r
- if (!bSilentMode) {\r
- if (IsAppInstalled(&appServer)) {\r
- nChoice = ShowMsg(IDS_CLIENT_NEEDED_BY_SERVER, MB_ICONQUESTION | MB_YESNO);\r
- if (nChoice == IDNO)\r
- return FALSE; // Cancel the uninstall\r
- }\r
- }\r
- \r
- UninstallCredsTool();\r
-\r
- return TRUE;\r
-}\r
-\r
-static struct APPINFO *GetApp()\r
-{\r
-#ifdef SERVER_UNINST\r
- return &appServer;\r
-#elif CLIENT_UNINST\r
- return &appClient;\r
-#elif CC_UNINST\r
- return &appControlCenter;\r
-#elif LIGHT_CLIENT_UNINST\r
- return &appLightClient;\r
-#elif DOCS_UNINST\r
- return &appDocs;\r
-#else\r
- return 0;\r
-#endif;\r
-}\r
-\r
-static void RememberInstallDir(char *pszInstallDir)\r
-{\r
- HKEY hKey;\r
-\r
- // We remember the install dir so that when the UninstUninitialize function is called\r
- // by the InstallShield uninstaller, we can find out where we were installed to. We\r
- // have to do this because by the time that function is called, the registry values\r
- // created at install time are already gone. We need to be able to find out where we\r
- // were installed so we can clean up anything IS couldn't uninstall. If this fails in \r
- // any way then we don't care. The only consequence is that some junk might be left on\r
- // the users' system after an uninstall.\r
- \r
- LONG result = RegOpenKeyAlt(AFSREG_NULL_KEY, UNINSTALL_TEMP_INFO_KEY, KEY_WRITE, TRUE, &hKey, 0);\r
- if (result != ERROR_SUCCESS)\r
- return;\r
-\r
- RegSetValueEx(hKey, INSTALL_DIR_VALUE_NAME, 0, REG_SZ, (PBYTE)pszInstallDir, strlen(pszInstallDir) + 1); \r
-\r
- RegCloseKey(hKey);\r
-}\r
-\r
-int SUCALLCONV SetSilentMode()\r
-{\r
- bSilentMode = TRUE;\r
-\r
- return 0;\r
-}\r
-\r
-static char *GetWinDir()\r
-{\r
- static char szWinDir[MAX_PATH] = "";\r
-\r
- if (!szWinDir[0]) \r
- GetWindowsDirectory(szWinDir, sizeof(szWinDir));\r
- \r
- return szWinDir;\r
-}\r
-\r
-static char *GetWinSysDir()\r
-{\r
- static char szWinSysDir[MAX_PATH] = "";\r
-\r
- if (!szWinSysDir[0])\r
- GetSystemDirectory(szWinSysDir, sizeof(szWinSysDir));\r
- \r
- return szWinSysDir;\r
-} \r
-\r
-static char *GetLocaleID()\r
-{\r
- static char szID[25] = "";\r
-\r
- if (szID[0] == 0) {\r
- LCID dwID = GetSystemDefaultLCID();\r
- \r
- // Nuke the high word. It contains a sort ID.\r
- dwID &= 0x0000FFFF;\r
- \r
- // Convert locale ID to a string\r
- itoa(dwID, szID, 10);\r
-\r
- // This thing should never be more than LOCALE_ID_LEN characters long.\r
- szID[LOCALE_ID_LEN] = 0;\r
- }\r
-\r
- return szID;\r
-}\r
-\r
-static char *ExpandPath(char *pszFile)\r
-{\r
- static char szPath[MAX_PATH];\r
- char *psz;\r
-\r
- szPath[0] = 0;\r
-\r
- // Convert a path containing TARGETDIR, WINDIR, or WINSYSDIR to a \r
- // real path in the file system. One of these MUST be the start of\r
- // the file path passed in. Also convert the string ???? to an\r
- // actual locale number.\r
- if (strncmp(pszFile, TARGETDIR, strlen(TARGETDIR)) == 0)\r
- strcpy(szPath, GetRootInstallDir());\r
- else if (strncmp(pszFile, WINDIR, strlen(WINDIR)) == 0)\r
- strcpy(szPath, GetWinDir());\r
- else if (strncmp(pszFile, WINSYSDIR, strlen(WINSYSDIR)) == 0)\r
- strcpy(szPath, GetWinSysDir());\r
- \r
- if (szPath[0]) { \r
- psz = strchr(pszFile, '\\');\r
- if (psz)\r
- strcat(szPath, psz);\r
- } else\r
- strcpy(szPath, pszFile);\r
-\r
- // Is this a language dll?\r
- psz = strstr(szPath, "????.");\r
- \r
- // If it is, replace ???? with the locale number\r
- if (psz)\r
- strncpy(psz, GetLocaleID(), LOCALE_ID_LEN);\r
-\r
- return szPath;\r
-}\r
-\r
-static BOOL FileNeededByOtherApp(struct APPINFO *pApp, struct FILEINFO *pFileInfo)\r
-{\r
- // If the file is used by the server, the app being uninstalled is not the server, and\r
- // the server is installed, then this file is used by another app.\r
- if (!IsWinNT()) {\r
- if ((pFileInfo->nUsedBy & LCLIENT) && (pApp != &appLightClient) && IsAppInstalled(&appLightClient))\r
- return TRUE;\r
- return FALSE;\r
- }\r
-\r
- if ((pFileInfo->nUsedBy & SERVER) && (pApp != &appServer) && IsAppInstalled(&appServer))\r
- return TRUE;\r
-\r
- if ((pFileInfo->nUsedBy & CLIENT) && (pApp != &appClient) && IsAppInstalled(&appClient))\r
- return TRUE;\r
-\r
- if ((pFileInfo->nUsedBy & CC) && (pApp != &appControlCenter) && IsAppInstalled(&appControlCenter))\r
- return TRUE;\r
- \r
- return FALSE;\r
-}\r
-\r
-static void DeleteInUseFiles(struct APPINFO *pAppInfo, struct FILEINFO *pFileInfo)\r
-{\r
- char szSrcPath[MAX_PATH];\r
- char szDestPath[MAX_PATH];\r
- char szTempDir[MAX_PATH];\r
- int ii;\r
-\r
- // If some app's file has been loaded before the app is uninstalled, then\r
- // when an uninstall is attempted, the application and all of the dlls that\r
- // its uses will be in use and IS will not be able to delete them. Normally this\r
- // is not a problem because IS will tell the user to reboot to finish the uninstall.\r
- // However, we must support the ability to perform a silent uninstall followed\r
- // immediatly by an install of the same product to the same directories. If we let\r
- // IS handle the uninstall of these files, this is not possible. The reason is that\r
- // when IS fails to remove these in use files, it marks them for deletion after the\r
- // next reboot, which is fine. Unfortunately, it leaves them in the dirs they were\r
- // installed to. So if we don't immediately reboot and perform an install to the\r
- // same dirs, once a reboot is performed, those files get deleted and we have a \r
- // broken installation.\r
-\r
- // What we will do to fix all of this, is when the client is uninstalled, but\r
- // before IS does anything, we will move the in use files and associated dlls\r
- // into the temp dir and mark them for delete after a reboot. Then an install\r
- // that follows will succeed.\r
-\r
- // Delete the files that may be in use. If they are we actually move\r
- // them to the temp dir and mark them for deletion after the next reboot.\r
- for (ii = 0; pFileInfo[ii].pszName != 0; ii++) {\r
- // Get the source path\r
- strcpy(szSrcPath, ExpandPath(pFileInfo[ii].pszName));\r
-\r
- // Only delete the file if it is not used by some other app\r
- if (FileNeededByOtherApp(pAppInfo, &pFileInfo[ii]))\r
- continue;\r
-\r
- // If the file doesn't exist then go on to the next file.\r
- if (_access(szSrcPath, 0) != 0)\r
- continue;\r
- \r
- // See if we can do a regular delete of the file\r
- if (DeleteFile(szSrcPath)) {\r
- SetSharedFileRefCount(szSrcPath, 0);\r
- continue;\r
- }\r
-\r
- // Get a temp dir that is on the same drive as the src path.\r
- // We can't move an in use file to a different drive.\r
- strcpy(szTempDir, GetTempDir());\r
- if (szTempDir[0] != szSrcPath[0]) {\r
- // Get the drive, colon, and slash of the src path\r
- strncpy(szTempDir, szSrcPath, 3);\r
- szTempDir[3] = 0;\r
- }\r
- \r
- // Get the dest path - we will rename the file during the move\r
- GetTempFileName(szTempDir, "AFS", 0, szDestPath);\r
-\r
- // Move from source to dest, marking the file for deletion after a reboot\r
- if (IsWin95()) {\r
- if (MoveFile(szSrcPath, szDestPath)) { \r
- WritePrivateProfileString("rename", szSrcPath, szDestPath, "wininit.ini");\r
- SetSharedFileRefCount(szSrcPath, 0);\r
- }\r
- } else { // WinNT or Win98\r
- if (MoveFileEx(szSrcPath, szDestPath, MOVEFILE_REPLACE_EXISTING)) {\r
- SetFileAttributes(szDestPath, FILE_ATTRIBUTE_NORMAL);\r
- MoveFileEx(szDestPath, 0, MOVEFILE_DELAY_UNTIL_REBOOT);\r
- SetSharedFileRefCount(szSrcPath, 0);\r
- }\r
- }\r
- }\r
-}\r
-\r
-// Delete a directory and all its files and subdirectories - Yee haaa!\r
-static void RemoveDirectoryTree(char *pszDir)\r
-{\r
- HANDLE hFind;\r
- WIN32_FIND_DATA findFileData;\r
- char szSpec[MAX_PATH];\r
- char szSubFileOrDir[MAX_PATH];\r
- BOOL bContinue;\r
-\r
- sprintf(szSpec, "%s\\*.*", pszDir);\r
- \r
- // First delete the contents of the dir\r
- hFind = FindFirstFile(szSpec, &findFileData);\r
- bContinue = (hFind != INVALID_HANDLE_VALUE);\r
- \r
- while (bContinue) {\r
- if ((strcmp(findFileData.cFileName, ".") != 0) && (strcmp(findFileData.cFileName, "..") != 0)) {\r
- sprintf(szSubFileOrDir, "%s\\%s", pszDir, findFileData.cFileName);\r
- \r
- if (findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)\r
- RemoveDirectoryTree(szSubFileOrDir);\r
- else\r
- DeleteFile(szSubFileOrDir);\r
- }\r
-\r
- bContinue = FindNextFile(hFind, &findFileData);\r
- }\r
-\r
- FindClose(hFind);\r
- \r
- // Now remove the dir\r
- RemoveDirectory(pszDir);\r
-} \r
-\r
-static char *GetStartMenuRoot()\r
-{\r
- HKEY hKey;\r
- LONG nResult;\r
- DWORD dwType;\r
- DWORD dwSize;\r
- char *pszKey;\r
- char *pszValue;\r
-\r
- static char szStartMenuRoot[MAX_PATH] = "";\r
-\r
- if (szStartMenuRoot[0] == 0) {\r
- dwSize = sizeof(szStartMenuRoot);\r
- \r
- if (IsWinNT()) {\r
- pszKey = WINNT_START_MENU_REG_KEY;\r
- pszValue = WINNT_START_MENU_REG_VALUE;\r
- } else {\r
- pszKey = WIN9X_START_MENU_REG_KEY;\r
- pszValue = WIN9X_START_MENU_REG_VALUE;\r
- }\r
- \r
- nResult = RegOpenKeyAlt(AFSREG_NULL_KEY, pszKey, KEY_READ, FALSE, &hKey, 0);\r
- if (nResult == ERROR_SUCCESS) {\r
- nResult = RegQueryValueEx(hKey, pszValue, 0, &dwType, (PBYTE)szStartMenuRoot, &dwSize);\r
- RegCloseKey(hKey);\r
- }\r
-\r
- if (nResult != ERROR_SUCCESS)\r
- return 0;\r
- }\r
-\r
- FilepathNormalizeEx(szStartMenuRoot, FPN_BACK_SLASHES);\r
-\r
- return szStartMenuRoot;\r
-}\r
-\r
-static char *GetAfsStartMenuRoot()\r
-{\r
- static char szAfsStartMenuRoot[MAX_PATH] = "";\r
- char *pszStartMenuRoot;\r
- \r
- if (szAfsStartMenuRoot[0] == 0) { \r
- pszStartMenuRoot = GetStartMenuRoot();\r
- if (!pszStartMenuRoot)\r
- return 0;\r
-\r
- if (bSilentMode)\r
- sprintf(szAfsStartMenuRoot, "%s\\IBM WebSphere\\Performance Pack\\AFS", pszStartMenuRoot );\r
- else\r
- sprintf(szAfsStartMenuRoot, "%s\\IBM AFS", pszStartMenuRoot );\r
- }\r
-\r
- return szAfsStartMenuRoot;\r
-}\r
-\r
-static BOOL IsADir(char *pszName)\r
-{\r
- struct _stat statbuf;\r
-\r
- if (_stat(pszName, &statbuf) < 0)\r
- return FALSE;\r
-\r
- return statbuf.st_mode & _S_IFDIR;\r
-}\r
-\r
-static void DeleteStartMenuEntries(char *pszEntries)\r
-{\r
- char szStartMenuPath[MAX_PATH];\r
- char *pszAfsStartMenuRoot;\r
- char *pszCurEntry;\r
-\r
- pszAfsStartMenuRoot = GetAfsStartMenuRoot();\r
-\r
- if (!pszAfsStartMenuRoot)\r
- return;\r
- \r
- for (pszCurEntry = pszEntries; *pszCurEntry; pszCurEntry += strlen(pszCurEntry) + 1) {\r
- sprintf(szStartMenuPath, "%s\\%s", pszAfsStartMenuRoot, pszCurEntry);\r
- if (IsADir(szStartMenuPath))\r
- RemoveDirectoryTree(szStartMenuPath);\r
- else\r
- DeleteFile(szStartMenuPath);\r
- }\r
-}\r
-\r
-static void RefreshStartMenu()\r
-{\r
- char *pszAfsStartMenuRoot;\r
- char szTemp[MAX_PATH];\r
- \r
- pszAfsStartMenuRoot = GetAfsStartMenuRoot();\r
- if (!pszAfsStartMenuRoot)\r
- return;\r
-\r
- sprintf(szTemp, "%s - Refresh Attempt", pszAfsStartMenuRoot);\r
- \r
- // Deleting items from below the root level of the start menu does not \r
- // cause it to refresh. In order that users can see changes without\r
- // rebooting we will temporarily rename our root most entry, which \r
- // does cause a refresh of the start menu.\r
- MoveFileEx(pszAfsStartMenuRoot, szTemp, MOVEFILE_REPLACE_EXISTING);\r
- MoveFileEx(szTemp, pszAfsStartMenuRoot, MOVEFILE_REPLACE_EXISTING);\r
-}\r
-\r
-static BOOL PreserveConfigInfo(struct APPINFO *pApp)\r
-{\r
- char *pszRegKey;\r
- char szDestKey[256];\r
- LONG result;\r
-\r
- bPreserveConfigInfo = TRUE;\r
-\r
- // If not in silent mode, ask user if they want to preserve the cfg info\r
- if (!bSilentMode) {\r
- int nChoice = ShowMsg(pApp->nPreserveConfigInfoMsgID, MB_ICONQUESTION | MB_YESNOCANCEL);\r
- if (nChoice == IDCANCEL)\r
- return FALSE; // Cancel the uninstall\r
- else if (nChoice == IDNO) { \r
- bPreserveConfigInfo = FALSE; // User doesn't want to preserve the config info\r
- return TRUE;\r
- }\r
- }\r
-\r
- // Copy each reg key (and all of its subkeys and values) to another place in the registry.\r
- for (pszRegKey = pApp->pszRegKeysToPreserve; *pszRegKey; pszRegKey += strlen(pszRegKey) + 1) {\r
- if (!DoesRegKeyExist(pszRegKey))\r
- continue;\r
-\r
- // Create the destination path for the copy\r
- sprintf(szDestKey, "%s\\%s\\%s", AFS_PRESERVED_CFG_INFO_KEY, pApp->pszAppName, pszRegKey);\r
-\r
- // Try to copy it\r
- result = RegDupKeyAlt(pszRegKey, szDestKey);\r
-\r
- if ((result != ERROR_SUCCESS) && (result != ERROR_FILE_NOT_FOUND)) {\r
- // If the copy failed, then delete any copies that succeeded\r
- sprintf(szDestKey, "%s\\%s", AFS_PRESERVED_CFG_INFO_KEY, pApp->pszAppName);\r
- RegDeleteEntryAlt(szDestKey, REGENTRY_KEY);\r
- goto done;\r
- }\r
- }\r
-\r
- // Remember the integrated login setting if this app supports that and it was turned on\r
- if (pApp->pszNetworkProviderOrder) {\r
- // Was integerated login turned on?\r
- BOOL bOn, bOk;\r
- bOk = InNetworkProviderOrder(pApp->pszNetworkProviderOrder, &bOn);\r
- if (bOk && bOn) {\r
- HKEY hKey;\r
- sprintf(szDestKey, "%s\\%s\\IntegratedLogin", AFS_PRESERVED_CFG_INFO_KEY, pApp->pszAppName);\r
- result = RegOpenKeyAlt(AFSREG_NULL_KEY, szDestKey, KEY_WRITE, TRUE, &hKey, 0);\r
- // The existance of the key is a flag indicating that integrated login was turned on\r
- RegCloseKey(hKey);\r
- }\r
- }\r
- \r
-done:\r
- if ((result == ERROR_SUCCESS) || bSilentMode)\r
- return TRUE; // Continue with uninstall\r
-\r
- // Report the error and ask the user if they want to continue the uninstall\r
- return (ShowMsg(IDS_SAVE_OF_CONFIG_INFO_FAILED, MB_ICONEXCLAMATION | MB_YESNO) == IDYES); \r
-}\r
-\r
-int SUCALLCONV RestoreConfigInfo(int nApp)\r
-{\r
- char *pszRegKey;\r
- char szSrcKey[256];\r
- struct APPINFO *pApp = 0;\r
- BOOL bError = FALSE;\r
- LONG result;\r
-\r
- switch (nApp) {\r
- case SERVER: pApp = &appServer; break;\r
- case CLIENT: pApp = &appClient; break;\r
- case LCLIENT: pApp = &appLightClient; break;\r
- case CC: pApp = &appControlCenter; break;\r
- }\r
- \r
- if (!pApp)\r
- return -1;\r
- \r
- // Copy each reg key (and all of its subkeys and values) back to its original place in the registry.\r
- for (pszRegKey = pApp->pszRegKeysToPreserve; *pszRegKey; pszRegKey += strlen(pszRegKey) + 1) {\r
- // Create the source path for the copy\r
- sprintf(szSrcKey, "%s\\%s\\%s", AFS_PRESERVED_CFG_INFO_KEY, pApp->pszAppName, pszRegKey);\r
-\r
- if (!DoesRegKeyExist(szSrcKey))\r
- continue;\r
-\r
- // Try to restore as many of the keys as possible. Report any errors at the end.\r
-\r
- // Try to copy it\r
- result = RegDupKeyAlt(szSrcKey, pszRegKey);\r
- if ((result != ERROR_SUCCESS) && (result != ERROR_FILE_NOT_FOUND))\r
- bError = TRUE;\r
- }\r
-\r
- // Restore integrated login if this app was using it\r
- if (pApp->pszNetworkProviderOrder) {\r
- // Check if integrated login was turned on. The IntegratedLogin key is a flag\r
- // telling us that it was on. If the key does not exist, integrated login was\r
- // not on.\r
- sprintf(szSrcKey, "%s\\%s\\IntegratedLogin", AFS_PRESERVED_CFG_INFO_KEY, pApp->pszAppName);\r
- if (DoesRegKeyExist(szSrcKey)) {\r
- if (!AddToProviderOrder(pApp->pszNetworkProviderOrder))\r
- bError = TRUE;\r
- }\r
- }\r
-\r
- // Remove our saved copies of the config info\r
- sprintf(szSrcKey, "%s\\%s", AFS_PRESERVED_CFG_INFO_KEY, pApp->pszAppName);\r
- RegDeleteEntryAlt(szSrcKey, REGENTRY_KEY);\r
- \r
- if (bError)\r
- ShowError(IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED, 0);\r
-\r
- return TRUE;\r
-}\r
-\r
-static BOOL DoSubKeysExist(char *pszKey)\r
-{\r
- LONG result;\r
- HKEY hKey;\r
- char *pszSubKeys = 0;\r
- BOOL bExist;\r
- \r
- result = RegOpenKeyAlt(AFSREG_NULL_KEY, pszKey, KEY_READ, FALSE, &hKey, 0);\r
- if (result != ERROR_SUCCESS)\r
- return FALSE;\r
- \r
- result = RegEnumKeyAlt(hKey, &pszSubKeys);\r
- RegCloseKey(hKey);\r
- \r
- if (result != ERROR_SUCCESS)\r
- return FALSE;\r
- \r
- if (pszSubKeys) {\r
- bExist = TRUE;\r
- free(pszSubKeys);\r
- } else\r
- bExist = FALSE; \r
-\r
- return bExist;\r
-}\r
-\r
-/*\r
- * The following definitions are taken from richedit.h:\r
- *\r
- */\r
-\r
-#define EM_SETBKGNDCOLOR (WM_USER + 67) // from Richedit.h\r
-#define EM_STREAMIN (WM_USER + 73) // from Richedit.h\r
-#define SF_RTF 0x0002\r
-\r
-typedef DWORD (CALLBACK *EDITSTREAMCALLBACK)(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);\r
-\r
-typedef struct _editstream {\r
- DWORD dwCookie; /* user value passed to callback as first parameter */\r
- DWORD dwError; /* last error */\r
- EDITSTREAMCALLBACK pfnCallback;\r
-} EDITSTREAM;\r
-\r
-/*\r
- *\r
- */\r
-\r
-DWORD CALLBACK License_StreamText (DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)\r
-{\r
- LPTSTR psz = (LPTSTR)dwCookie;\r
- LONG cchAvail = lstrlen(psz);\r
- if ((*pcb = min(cchAvail, cb)) != 0) {\r
- memcpy (pbBuff, psz, *pcb);\r
- memmove (psz, &psz[*pcb], cchAvail - *pcb + 1);\r
- }\r
- return 0;\r
-}\r
-\r
-\r
-void License_OnInitDialog (HWND hDlg, LPTSTR pszFile)\r
-{\r
- // Open the license file and shove its text in our RichEdit control\r
- //\r
- HANDLE hFile;\r
- if ((hFile = CreateFile (pszFile, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) != INVALID_HANDLE_VALUE) {\r
-\r
- size_t cbText;\r
- if ((cbText = GetFileSize (hFile, NULL)) != 0) {\r
-\r
- LPTSTR abText = (LPTSTR)GlobalAlloc (GMEM_FIXED, cbText + 3);\r
-\r
- DWORD cbRead;\r
- if (ReadFile (hFile, abText, cbText, &cbRead, NULL)) {\r
- abText[ cbRead ] = 0;\r
-\r
- EDITSTREAM Stream;\r
- memset (&Stream, 0x00, sizeof(Stream));\r
- Stream.dwCookie = (DWORD)abText;\r
- Stream.pfnCallback = License_StreamText;\r
-\r
- SendDlgItemMessage (hDlg, IDC_TEXT, EM_STREAMIN, SF_RTF, (LPARAM)&Stream);\r
- }\r
-\r
- GlobalFree (abText);\r
- }\r
-\r
- CloseHandle (hFile);\r
- }\r
-\r
- // Make the control's background be gray\r
- //\r
- SendDlgItemMessage (hDlg, IDC_TEXT, EM_SETBKGNDCOLOR, FALSE, (LPARAM)GetSysColor(COLOR_BTNFACE));\r
-}\r
-\r
-BOOL CALLBACK License_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)\r
-{\r
- switch (msg) {\r
- case WM_INITDIALOG:\r
- SetWindowLong (hDlg, DWL_USER, lp);\r
- License_OnInitDialog (hDlg, (LPTSTR)lp);\r
- break;\r
-\r
- case WM_COMMAND:\r
- switch (LOWORD(wp)) {\r
- case IDCANCEL:\r
- case IDOK:\r
- EndDialog (hDlg, LOWORD(wp));\r
- break;\r
-\r
- case IDC_PRINT:\r
- TCHAR szDir[ MAX_PATH ];\r
- GetCurrentDirectory (MAX_PATH, szDir);\r
- ShellExecute (hDlg, TEXT("print"), (LPTSTR)GetWindowLong (hDlg, DWL_USER), NULL, szDir, SW_HIDE);\r
- break;\r
- }\r
- break;\r
- }\r
- return FALSE;\r
-}\r
-\r
-BOOL FindAfsInstallationPathByComponent (LPTSTR pszInstallationPath, LPTSTR pszComponent)\r
-{\r
- *pszInstallationPath = 0;\r
-\r
- TCHAR szRegPath[ MAX_PATH ];\r
- wsprintf (szRegPath, TEXT("Software\\TransarcCorporation\\%s\\CurrentVersion"), pszComponent);\r
-\r
- HKEY hk;\r
- if (RegOpenKey (HKEY_LOCAL_MACHINE, szRegPath, &hk) == 0) {\r
- DWORD dwType = REG_SZ;\r
- DWORD dwSize = MAX_PATH;\r
-\r
- if (RegQueryValueEx (hk, TEXT("PathName"), NULL, &dwType, (PBYTE)pszInstallationPath, &dwSize) == 0) {\r
- *(LPTSTR)FindBaseFileName (pszInstallationPath) = TEXT('\0');\r
-\r
- if (pszInstallationPath[0] && (pszInstallationPath[ lstrlen(pszInstallationPath)-1 ] == TEXT('\\')))\r
- pszInstallationPath[ lstrlen(pszInstallationPath)-1 ] = TEXT('\0');\r
- }\r
-\r
- RegCloseKey (hk);\r
- }\r
-\r
- return !!*pszInstallationPath;\r
-}\r
-\r
-BOOL FindAfsInstallationPath (LPTSTR pszInstallationPath)\r
-{\r
- if (FindAfsInstallationPathByComponent (pszInstallationPath, TEXT("AFS Client")))\r
- return TRUE;\r
- if (FindAfsInstallationPathByComponent (pszInstallationPath, TEXT("AFS Control Center")))\r
- return TRUE;\r
- if (FindAfsInstallationPathByComponent (pszInstallationPath, TEXT("AFS Server")))\r
- return TRUE;\r
- if (FindAfsInstallationPathByComponent (pszInstallationPath, TEXT("AFS Supplemental Documentation")))\r
- return TRUE;\r
- return FALSE;\r
-}\r
-\r
-HINSTANCE LoadRichTextControl (void)\r
-{\r
- HINSTANCE hInst;\r
- if ((hInst = LoadLibrary ("riched20.dll")) != NULL)\r
- return hInst;\r
- if ((hInst = LoadLibrary ("riched32.dll")) != NULL)\r
- return hInst;\r
- if ((hInst = LoadLibrary ("riched.dll")) != NULL)\r
- return hInst;\r
- if ((hInst = LoadLibrary ("richedit.dll")) != NULL)\r
- return hInst;\r
- return NULL;\r
-}\r
-\r
-int SUCALLCONV ShowLicense (char *pszTarget, char *pszSource)\r
-{\r
- // If the license already lives on this user's machine, don't show\r
- // it again. This only has to be done if the user has never\r
- // accepted the license agreement before (it's part of the setup\r
- // program, so it gets installed if they've accepted it).\r
- //\r
- // We were handed a relative path of the form:\r
- // Documentation/html/license.rtf\r
- //\r
- // We'll need to find the AFS installation directory, in order to\r
- // find that Documentation subtree.\r
- //\r
- BOOL fShowLicense = TRUE;\r
-\r
- TCHAR szInstallationPath[ MAX_PATH ];\r
- if (FindAfsInstallationPath (szInstallationPath)) {\r
- TCHAR szLicensePath[ MAX_PATH ];\r
- wsprintf (szLicensePath, TEXT("%s\\%s"), szInstallationPath, pszTarget);\r
-\r
- if (GetFileAttributes (szLicensePath) != (DWORD)-1) {\r
- fShowLicense = FALSE;\r
- }\r
- }\r
-\r
- // Before we can show the license file, we have to prepare the RichEdit\r
- // control. That means loading the appropriate library and calling its\r
- // initialization functions.\r
- //\r
- HINSTANCE hRichEdit;\r
- if ((hRichEdit = LoadRichTextControl()) != NULL) {\r
-\r
- // If we must show the license, do so now. This is a modal dialog,\r
- // so we'll know whether or not the user accepts the license.\r
- //\r
- if (ModalDialogParam (IDD_LICENSE, GetActiveWindow(), License_DlgProc, (LPARAM)pszSource) == IDCANCEL) {\r
- // The user rejected the license; fail setup\r
- return FALSE;\r
- }\r
-\r
- FreeLibrary (hRichEdit);\r
- }\r
-\r
- // The user accepted the license, so we can continue with Setup.\r
- // The license file is installed as part of Setup.\r
- return TRUE;\r
-}\r
-\r
-int SUCALLCONV UninstInitialize(HWND hIS, HINSTANCE hIS5, long Reserved)\r
-{\r
- char szPath[MAX_PATH];\r
- struct APPINFO *pAppInfo;\r
- char *pszFile = 0;\r
- char *pszSubDir = 0;\r
-\r
- hDlg = hIS;\r
-\r
- bSilentMode = !IsWindowVisible(hIS);\r
-\r
- // Which app are we uninstalling?\r
- pAppInfo = GetApp();\r
- if (!pAppInfo) {\r
- ShowError(IDS_CANT_DETERMINE_PRODUCT, 0);\r
- return -1;\r
- }\r
-\r
- // Get the app's install dir\r
- pszInstallDir = GetAppInstallDir(pAppInfo, FALSE);\r
- if (!pszInstallDir)\r
- return -1;\r
-\r
- // If this app has a custom uninstall func, call it here\r
- if (pAppInfo->pUninstallFunc)\r
- if (!pAppInfo->pUninstallFunc())\r
- return -1;\r
-\r
- if (pAppInfo->pszRegKeysToPreserve)\r
- if (!PreserveConfigInfo(pAppInfo))\r
- return -1;\r
-\r
- // Unconfigure the service, if there is one for this app\r
- if (pAppInfo->pszSvcKey) {\r
- if (IsServiceInstalled(pAppInfo->pszSvcKey))\r
- if (UninstallService(pAppInfo) == 1)\r
- return -1;\r
- }\r
-\r
- RememberInstallDir(pszInstallDir);\r
-\r
- DeleteInUseFiles(pAppInfo, fileInfo);\r
-\r
- // Remove the app's bin path from the system path\r
- if (pAppInfo->pszBinPath) {\r
- BuildShortPath(szPath, sizeof(szPath), pszInstallDir, pAppInfo->pszBinPath);\r
- RemoveFromPath(szPath);\r
- }\r
-\r
- // Remove entry from NetworkProvider\Order key in registry\r
- if (pAppInfo->pszNetworkProviderOrder)\r
- RemoveFromNetworkProviderOrder(pAppInfo->pszNetworkProviderOrder);\r
-\r
- // Remove any generated subdirectories\r
- if (!bPreserveConfigInfo && pAppInfo->pszDirsToDel) {\r
- for (pszSubDir = pAppInfo->pszDirsToDel; *pszSubDir; pszSubDir += strlen(pszSubDir) + 1)\r
- RemoveDir(ExpandPath(pszSubDir));\r
- }\r
-\r
- // Remove any generated files\r
- if (!bPreserveConfigInfo && pAppInfo->pszFilesToDel) {\r
- for (pszFile = pAppInfo->pszFilesToDel; *pszFile; pszFile += strlen(pszFile) + 1)\r
- RemoveFiles(ExpandPath(pszFile));\r
- }\r
-\r
- // Remove any registry values that IS can't handle\r
- RemoveRegValues(pAppInfo->pRegValues);\r
- if (IsWinNT())\r
- RemoveRegValues(pAppInfo->pWinNTRegValues);\r
- else \r
- RemoveRegValues(pAppInfo->pWin9XRegValues);\r
-\r
- // Remove the start menu entries for this app\r
- if (pAppInfo->pszStartMenuEntries) {\r
- DeleteStartMenuEntries(pAppInfo->pszStartMenuEntries);\r
- RefreshStartMenu();\r
- }\r
-\r
- // Remove the install dir\r
- RemoveDirectory(pszInstallDir);\r
-\r
- return 0;\r
-}\r
-\r
-void SUCALLCONV UninstUnInitialize(HWND hIS, HINSTANCE hIS5, long Reserved)\r
-{\r
- char *pszInstallDir;\r
- char szDirPath[MAX_PATH];\r
- char *psz;\r
- struct APPINFO *pAppInfo;\r
-\r
- // If we just uninstalled the last AFS app, then do some cleanup.\r
- if (IsAppInstalled(&appServer) || IsAppInstalled(&appClient) ||\r
- IsAppInstalled(&appControlCenter) || IsAppInstalled(&appLightClient) ||\r
- IsAppInstalled(&appDocs))\r
- {\r
- return;\r
- }\r
-\r
- bSilentMode = !IsWindowVisible(hIS);\r
- \r
- // Which app did we just uninstall?\r
- pAppInfo = GetApp();\r
- if (!pAppInfo) {\r
- ShowError(IDS_CANT_DETERMINE_PRODUCT, 0);\r
- return;\r
- }\r
-\r
- // Get the app's install dir\r
- pszInstallDir = GetAppInstallDir(pAppInfo, TRUE);\r
- if (!pszInstallDir)\r
- return;\r
-\r
- // Remove the reg key we used to remember the app install dir\r
- RegDeleteEntryAlt(UNINSTALL_TEMP_INFO_KEY, REGENTRY_KEY);\r
-\r
- // Try to remove the reg key used to store config info, but only\r
- // if there are no app config info sub keys present.\r
- if (!DoSubKeysExist(AFS_PRESERVED_CFG_INFO_KEY))\r
- RegDeleteEntryAlt(AFS_PRESERVED_CFG_INFO_KEY, REGENTRY_KEY);\r
-\r
- // Remove the install dir\r
- RemoveDirectory(pszInstallDir);\r
-\r
- // Attempt to remove the install root and common directories. The are \r
- // shared and so no single app knows to delete them.\r
-\r
- // Strip off the app specific part of the install dir\r
- psz = strrchr(pszInstallDir, '\\');\r
- if (psz)\r
- *psz = 0;\r
-\r
- sprintf(szDirPath, "%s\\%s", pszInstallDir, "Common");\r
- RemoveDirectory(szDirPath);\r
-\r
- // Remove the Common directory from the system path\r
- RemoveFromPath(szDirPath);\r
-\r
- // Remove all of the documentation dirs\r
- sprintf(szDirPath, "%s\\%s", pszInstallDir, "Documentation");\r
- RemoveDirectoryTree(szDirPath);\r
-\r
- // Ok, up to this point we have been removing files we know we\r
- // created. However, after this point we are into the path\r
- // that the user chose for our install root. The default for\r
- // this is IBM/Afs, but they could have chosen anything,\r
- // including a dir or dirs that have other products in them.\r
- // We will check to see if it is IBM\AFS and if it is then we \r
- // will attempt to remove them.\r
- \r
- // Back up a level and look for AFS\r
- psz = strrchr(pszInstallDir, '\\');\r
- if (psz) {\r
- if (stricmp(psz + 1, "AFS") == 0) {\r
- RemoveDirectory(pszInstallDir);\r
- *psz = 0;\r
- }\r
- }\r
-\r
- // Back up a level and look for IBM\r
- psz = strrchr(pszInstallDir, '\\');\r
- if (psz) {\r
- if (stricmp(psz + 1, "IBM") == 0) {\r
- RemoveDirectory(pszInstallDir);\r
- *psz = 0;\r
- }\r
- }\r
-\r
- // Remove the root afs start menu entry\r
- psz = GetStartMenuRoot();\r
- if (psz) {\r
- if (bSilentMode) {\r
- // Remove everything under our branch\r
- sprintf(szDirPath, "%s\\IBM WebSphere\\Performance Pack\\AFS", psz);\r
- RemoveDirectoryTree(szDirPath);\r
- \r
- // Remove the IBM stuff only if the dirs are empty\r
- sprintf(szDirPath, "%s\\IBM WebSphere\\Performance Pack", psz);\r
- if (RemoveDirectory(szDirPath)) {\r
- sprintf(szDirPath, "%s\\IBM WebSphere", psz);\r
- RemoveDirectory(szDirPath);\r
- }\r
- } else {\r
- sprintf(szDirPath, "%s\\IBM AFS", psz);\r
- RemoveDirectoryTree(szDirPath);\r
- }\r
- }\r
-}\r
-\r
-BOOLEAN _stdcall DllEntryPoint(HANDLE dll, DWORD reason, PVOID reserved)\r
-{\r
- if (reason == DLL_PROCESS_ATTACH) {\r
- hinst = (HINSTANCE)dll;\r
- TaLocale_LoadCorrespondingModuleByName (hinst, "afs_setup_utils.dll");\r
- }\r
-\r
- return TRUE;\r
-}\r
-\r
-extern "C" int WINAPI Test (HINSTANCE hInst, HINSTANCE hPrev, LPSTR psz, int nCmdShow)\r
-{\r
- ShowLicense ("TEST", "\\\\fury\\afssetup\\license\\ja_JP.rtf");\r
- return 0;\r
-}\r
-\r
-\r
+ * INCLUDES _________________________________________________________________
+ *
+ */
+
+extern "C" {
+#include <afs/param.h>
+#include <afs/stds.h>
+#include <afs/fileutil.h>
+}
+
+#include <windows.h>
+#include <stdio.h>
+#include <time.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <io.h>
+#include <string.h>
+#include <SYS\STAT.H>
+#include <shellapi.h>
+
+#include <WINNT/afsreg.h>
+#include <WINNT/afssw.h>
+#include <WINNT/talocale.h>
+
+#include "resource.h"
+#include "progress_dlg.h"
+#include "sutil.h"
+#include "forceremove.h"
+
+
+/*
+ * PROTOTYPES _________________________________________________________________
+ *
+ */
+static char *GetAppInstallDir(struct APPINFO *pApp, BOOL bRemembered);
+BOOL UninstallCredsTool();
+BOOL ServerSpecificUninstall();
+BOOL ClientSpecificUninstall();
+
+
+
+/*
+ * DEFINITIONS _________________________________________________________________
+ *
+ */
+#define SUCALLCONV WINAPI
+
+#define UNINSTALL_TEMP_INFO_KEY "HKEY_LOCAL_MACHINE\\Software\\AfsUninstallTempInfo"
+#define INSTALL_DIR_VALUE_NAME "InstallDir"
+
+#define AFS_PRESERVED_CFG_INFO_KEY "HKEY_LOCAL_MACHINE\\Software\\AfsPreservedConfigInfo"
+
+#define MS_SHARED_FILES_KEY "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\SharedDLLs"
+
+// Log file to use when running in silent mode
+#define UNINSTALL_ERROR_LOG_NAME "\\AfsUninstallErrorLog.txt"
+#define INSTALL_ERROR_LOG_NAME "\\AfsInstallErrorLog.txt"
+
+#define TARGETDIR "<TARGETDIR>"
+#define WINDIR "<WINDIR>"
+#define WINSYSDIR "<WINSYSDIR>"
+
+#define WIN9X_START_MENU_REG_KEY "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"
+#define WIN9X_START_MENU_REG_VALUE "Programs"
+
+#define WINNT_START_MENU_REG_KEY "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"
+#define WINNT_START_MENU_REG_VALUE "Common Programs"
+
+#define LOCALE_ID_LEN 4
+
+struct REGVALUE {
+ char *pszKey;
+ char *pszValue;
+};
+
+
+typedef BOOL (APP_UNINSTALL_FUNC)();
+
+
+
+struct APPINFO {
+ char *pszAppName;
+
+ // Service Info
+ char *pszSvcName;
+ char *pszSvcKey;
+ char *pszSvcDependOn;
+ char *pszSvcDisplayName;
+
+ char *pszNetworkProviderOrder;
+
+ // Message to use to tell the user that we have to stop the service
+ int nServiceShutdownMsgID;
+
+ // Message to use for the progress dialog that is shown while
+ // waiting for the service to stop.
+ int nServiceShutdownProgressMsgID;
+
+ // Location in registry of a key we can use to know that the app is installed
+ char *pszAppKey;
+
+ // Location in registry of this app's install dir
+ struct REGVALUE regInstallDir;
+
+ // Path Info
+ char *pszLocalRoot; // The root dir below the install dir
+ char *pszBinPath; // Path to remove from the system path
+
+ // Generated files and directories to delete. These are both multistring lists.
+ char *pszDirsToDel; // All files in these dirs will be deleted
+ char *pszFilesToDel; // Use this if you want to delete files but leave the dir. Wildcards can be used.
+
+ // Registry values to remove
+ struct REGVALUE *pRegValues;
+ struct REGVALUE *pWinNTRegValues; // Only remove these if running WinNT
+ struct REGVALUE *pWin9XRegValues; // Only remove these if running Win9X
+
+ // Start menu entries to delete
+ char *pszStartMenuEntries;
+
+ // Registry keys to save if a user wants to preserve config info during uninstall
+ char *pszRegKeysToPreserve;
+ int nPreserveConfigInfoMsgID;
+
+ // Uninstall func - used for things specific to this app
+ APP_UNINSTALL_FUNC *pUninstallFunc;
+};
+
+
+/*
+ * App info structure for the Server product
+ */
+struct APPINFO appServer = {
+ "AFS Server",
+
+ AFSREG_SVR_SVC_NAME,
+ AFSREG_SVR_SVC_KEY,
+ 0, // No depend on
+ AFSREG_SVR_SVC_DISPLAYNAME_DATA,
+
+ 0, // No network provider order
+
+ IDS_MUST_STOP_SERVER,
+ IDS_WAITING_FOR_SERVER_TO_STOP,
+
+ AFSREG_SVR_SW_VERSION_KEY,
+
+ { AFSREG_SVR_SW_VERSION_KEY, AFSREG_SVR_SW_VERSION_DIR_VALUE },
+
+ "\\Server",
+ "\\usr\\afs\\bin",
+
+ // Dirs to delete
+ TARGETDIR"\\Server\\usr\\afs\\bin\\backup\0"
+ TARGETDIR"\\Server\\usr\\afs\\bin\0"
+ TARGETDIR"\\Server\\usr\\afs\\db\0"
+ TARGETDIR"\\Server\\usr\\afs\\logs\0"
+ TARGETDIR"\\Server\\usr\\afs\\etc\0"
+ TARGETDIR"\\Server\\usr\\afs\\local\0"
+ TARGETDIR"\\Server\\usr\\afs\0"
+ TARGETDIR"\\Server\\usr\0",
+
+ // Files to delete
+ TARGETDIR"\\Common\\*.gid\0"
+ TARGETDIR"\\Common\\*.fts\0",
+
+ 0, // No reg values
+ 0, // No NT only reg values
+ 0, // No 9x only reg values
+
+ "Server\0",
+
+ // Config info to preserve
+ AFSREG_SVR_SVC_KEY"\0",
+ IDS_PRESERVE_SERVER_CONFIG_INFO,
+
+ 0 // No special uninstall function
+};
+
+// Registry values to remove for the Client
+struct REGVALUE clientRegValues[] = {
+ { "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved", "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" },
+ { 0, 0 } // This indicates there are no more entries
+};
+
+struct REGVALUE clientWinNTRegValues[] = {
+ { "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\File Manager\\AddOns", "AFS Client FME" },
+ { "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\NetBT\\Parameters", "SMBDeviceEnabled" },
+ { 0, 0 }
+};
+
+struct REGVALUE clientWin9XRegValues[] = {
+ { "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\NetworkProvider\\Order", "TransarcAFSDaemon" },
+ { 0, 0 }
+};
+
+/*
+ * App info structure for the Client product
+ */
+struct APPINFO appClient = {
+ "AFS Client",
+
+ AFSREG_CLT_SVC_NAME,
+ AFSREG_CLT_SVC_KEY,
+ "5250435353004E657462696F730000",
+ AFSREG_CLT_SVC_DISPLAYNAME_DATA,
+
+ AFSREG_CLT_SVC_NAME,
+
+ IDS_MUST_STOP_CLIENT,
+ IDS_WAITING_FOR_CLIENT_TO_STOP,
+
+ AFSREG_CLT_SW_VERSION_KEY,
+
+ { AFSREG_CLT_SW_VERSION_KEY, AFSREG_CLT_SW_VERSION_DIR_VALUE },
+
+ "\\Client",
+ "\\Program",
+
+ // No dirs to delete
+ 0,
+
+ // Files to delete
+ TARGETDIR"\\Common\\*.gid\0"
+ TARGETDIR"\\Common\\*.fts\0"
+ WINDIR"\\..\\AFSCache\0"
+ WINDIR"\\afsd.log\0"
+ WINDIR"\\afsd.ini\0"
+ WINDIR"\\afsdsbmt.ini\0"
+ WINDIR"\\afsdcell.ini\0"
+ WINDIR"\\afsd_init.log\0",
+
+ clientRegValues,
+ clientWinNTRegValues,
+ clientWin9XRegValues,
+
+ // Start menu entries to remove
+ "Client\0",
+
+ // Config info to preserve
+ AFSREG_CLT_SVC_KEY"\0",
+ IDS_PRESERVE_CLIENT_CONFIG_INFO,
+
+ ClientSpecificUninstall
+};
+
+
+/*
+ * App info structure for the Light Client product
+ */
+struct APPINFO appLightClient = {
+ "AFS Light",
+
+ // No service info
+ 0,
+ 0,
+ 0,
+ 0,
+
+ AFSREG_CLT_SVC_NAME,
+
+ // No service shutdown messages
+ 0,
+ 0,
+
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\TransarcCorporation\\AFS Light Client",
+
+ { AFSREG_CLT_SW_VERSION_KEY, AFSREG_CLT_SW_VERSION_DIR_VALUE },
+
+ "\\Client",
+ "\\Program",
+
+ // No dirs to delete
+ 0,
+
+ // Files to delete
+ TARGETDIR"\\Common\\*.gid\0"
+ TARGETDIR"\\Common\\*.fts\0",
+
+ clientRegValues,
+ clientWinNTRegValues,
+ clientWin9XRegValues,
+
+ // Start menu entries to remove
+ "Light\0",
+
+ // Config info to preserve
+ AFSREG_CLT_SVC_KEY"\0",
+ IDS_PRESERVE_LIGHT_CLIENT_CONFIG_INFO,
+
+ UninstallCredsTool
+};
+
+
+/*
+ * App info structure for the Control Center product
+ */
+struct APPINFO appControlCenter = {
+ "AFS Control Center",
+
+ // No service info
+ 0,
+ 0,
+ 0,
+ 0,
+
+ // No network provider order
+ 0,
+
+ // No service shutdown messages
+ 0,
+ 0,
+
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\TransarcCorporation\\AFS Control Center",
+
+ { "HKEY_LOCAL_MACHINE\\SOFTWARE\\TransarcCorporation\\AFS Control Center\\CurrentVersion", "PathName" },
+
+ "\\Control Center",
+ "",
+
+ // No dirs to delete
+ 0,
+
+ // Files to delete
+ TARGETDIR"\\Common\\*.gid\0"
+ TARGETDIR"\\Common\\*.fts\0",
+
+ 0, // No reg values
+ 0, // No NT only reg values
+ 0, // No 9x only reg values
+
+ // Start menu entries to remove
+ "Control Center\0",
+
+ // Config info to preserve
+ AFSREG_CLT_SVC_KEY"\0",
+ IDS_PRESERVE_CC_CONFIG_INFO,
+
+ 0 // No uninstall function
+};
+
+
+/*
+ * App info structure for the Sys Admin Doc files
+ */
+struct APPINFO appDocs = {
+ "AFS Supplemental Documentation",
+
+ // No service info
+ 0,
+ 0,
+ 0,
+ 0,
+
+ // No network provider order
+ 0,
+
+ // No service shutdown messages
+ 0,
+ 0,
+
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\TransarcCorporation\\AFS Supplemental Documentation",
+
+ { "HKEY_LOCAL_MACHINE\\SOFTWARE\\TransarcCorporation\\AFS Supplemental Documentation\\CurrentVersion", "PathName" },
+
+ "\\Documentation",
+ "",
+
+ // No dirs to delete
+ 0,
+
+ // Files to delete
+ TARGETDIR"\\Common\\*.gid\0"
+ TARGETDIR"\\Common\\*.fts\0",
+
+ 0, // No reg values
+ 0, // No NT only reg values
+ 0, // No 9x only reg values
+
+ // Start menu entries to remove
+ "Documentation\\AFS for Windows Backup Command Reference.lnk\0Documentation\\AFS Command Reference Manual.lnk\0Documentation\\AFS System Administrator's Guide.lnk\0",
+
+ 0, // No config info to preserve
+
+ 0 // No uninstall function
+};
+
+
+// Shared and in-use files
+struct FILEINFO {
+ char *pszName;
+ int nUsedBy;
+};
+
+#define SERVER 1
+#define CLIENT 2
+#define LCLIENT 4
+#define CC 8
+#define DOCS 16
+
+
+struct FILEINFO fileInfo[] = {
+ { TARGETDIR"\\Common\\afsbosadmin.dll", SERVER | CC },
+ { TARGETDIR"\\Common\\afscfgadmin.dll", SERVER | CC },
+ { TARGETDIR"\\Common\\afsclientadmin.dll", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afskasadmin.dll", SERVER | CC },
+ { TARGETDIR"\\Common\\afsptsadmin.dll", SERVER | CC },
+ { TARGETDIR"\\Common\\afsvosadmin.dll", SERVER | CC },
+ { 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\\TaAfsAppLib.dll", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afsprocmgmt.dll", SERVER | CLIENT | LCLIENT },
+ { TARGETDIR"\\Common\\afs_config.exe", CLIENT | LCLIENT| CC },
+ { TARGETDIR"\\Common\\afseventmsg_????.dll", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afslegal_????.dll", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afsserver_????.dll", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afssvrcfg_????.dll", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\TaAfsAccountManager_????.dll",SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\TaAfsAppLib_????.dll", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\TaAfsServerManager_????.dll", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afscreds_????.dll", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afs_config_????.dll", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afs_cpa_????.dll", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afs_shl_ext_????.dll", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afs-nt.hlp", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afs-nt.cnt", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\taafssvrmgr.cnt", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\taafssvrmgr.hlp", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\taafsusrmgr.cnt", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\taafsusrmgr.hlp", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afs-cc.cnt", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afs-cc.hlp", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afs-light.cnt", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\afs-light.hlp", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\taafscfg.cnt", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Common\\taafscfg.hlp", SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Client\\PROGRAM\\afs_shl_ext.dll", CLIENT | LCLIENT },
+ { TARGETDIR"\\Client\\PROGRAM\\libafsconf.dll", CLIENT | LCLIENT },
+ { TARGETDIR"\\Client\\PROGRAM\\afslogon.dll", CLIENT },
+ { TARGETDIR"\\Client\\PROGRAM\\afslog95.dll", LCLIENT },
+ { TARGETDIR"\\Control Center\\TaAfsAdmSvr.exe", CC },
+ { WINSYSDIR"\\afs_cpa.cpl", CLIENT | LCLIENT | CC },
+ { WINSYSDIR"\\afsserver.cpl", SERVER },
+ { TARGETDIR"\\Common\\afsdcell.ini", CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Documentation\\Html\\banner.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },
+ { TARGETDIR"\\Documentation\\Html\\books.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },
+ { TARGETDIR"\\Documentation\\Html\\bot.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },
+ { TARGETDIR"\\Documentation\\Html\\index.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },
+ { TARGETDIR"\\Documentation\\Html\\index.htm", SERVER | CLIENT | LCLIENT | CC | DOCS },
+ { TARGETDIR"\\Documentation\\Html\\next.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },
+ { TARGETDIR"\\Documentation\\Html\\prev.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },
+ { TARGETDIR"\\Documentation\\Html\\toc.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },
+ { TARGETDIR"\\Documentation\\Html\\top.gif", SERVER | CLIENT | LCLIENT | CC | DOCS },
+ { TARGETDIR"\\Documentation\\Html\\ReleaseNotes\\relnotes.htm",
+ SERVER | CLIENT | LCLIENT | CC },
+ { TARGETDIR"\\Documentation\\Html\\InstallGd\\afsnt35i.htm",
+ SERVER | CLIENT | LCLIENT | CC },
+ { 0, 0 } // End of list
+};
+
+
+/*
+ * VARIABLES _________________________________________________________________
+ *
+ */
+HINSTANCE hinst;
+
+static HWND hDlg;
+static BOOL bPreserveConfigInfo;
+static BOOL bSilentMode;
+static char *pszInstallDir;
+
+
+/*
+ * FUNCTIONS _________________________________________________________________
+ *
+ */
+
+static BOOL UpgradeClientIntParm(HKEY hKey, char *pszOldParm, char *pszNewParm)
+{
+ int nData;
+ LONG result = ERROR_SUCCESS;
+
+ nData = GetPrivateProfileInt("AFS Client", pszOldParm, -1, "afsd.ini");
+ if (nData > -1)
+ result = RegSetValueEx(hKey, pszNewParm, 0, REG_DWORD, (BYTE *)&nData, sizeof(nData));
+
+ return (result == ERROR_SUCCESS);
+}
+
+static BOOL UpgradeClientStringParm(HKEY hKey, char *pszOldParm, char *pszNewParm)
+{
+ char szData[1024];
+ LONG result = ERROR_SUCCESS;
+
+ GetPrivateProfileString("AFS Client", pszOldParm, "", szData, sizeof(szData), "afsd.ini");
+ if (szData[0])
+ result = RegSetValueEx(hKey, pszNewParm, 0, REG_SZ, (PBYTE)szData, strlen(szData) + 1);
+
+ return (result == ERROR_SUCCESS);
+}
+
+int SUCALLCONV Upgrade34ClientConfigInfo()
+{
+ HKEY hKey;
+ LONG result;
+ int nData;
+
+ result = RegOpenKeyAlt(AFSREG_NULL_KEY, AFSREG_CLT_SVC_PARAM_KEY, KEY_WRITE, TRUE, &hKey, 0);
+ if (result != ERROR_SUCCESS)
+ return -1;
+
+ UpgradeClientIntParm(hKey, "CacheSize", "CacheSize");
+ UpgradeClientIntParm(hKey, "Stats", "Stats");
+ UpgradeClientIntParm(hKey, "LogoffTokenTransfer", "LogoffTokenTransfer");
+ UpgradeClientIntParm(hKey, "LogoffTokenTransferTimeout", "LogoffTokenTransferTimeout");
+ UpgradeClientIntParm(hKey, "TrapOnPanic", "TrapOnPanic");
+ UpgradeClientIntParm(hKey, "TraceBufferSize", "TraceBufferSize");
+ UpgradeClientIntParm(hKey, "TraceOnShutdown", "TraceOnShutdown");
+ UpgradeClientIntParm(hKey, "ReportSessionStartups", "ReportSessionStartups");
+
+ UpgradeClientStringParm(hKey, "MountRoot", "MountRoot");
+ UpgradeClientStringParm(hKey, "Cell", "Cell");
+
+ /* BlockSize to ChunkSize requires convertion */
+ nData = GetPrivateProfileInt("AFS Client", "BlockSize", -1, "afsd.ini");
+ if (nData > -1) {
+ DWORD chunkSize;
+ for (chunkSize = 0; (1 << chunkSize) < nData; chunkSize++);
+ (void) RegSetValueEx(hKey, "ChunkSize", 0, REG_DWORD, (BYTE *)&chunkSize, sizeof(chunkSize));
+ }
+
+ RegCloseKey(hKey);
+
+ return 0;
+}
+
+int SUCALLCONV Eradicate34Client()
+{
+ if (Client34Eradicate(TRUE) != ERROR_SUCCESS)
+ return -1;
+
+ return 0;
+}
+
+// This function was written a long time ago by Mike Comer for use by the
+// original DFS Client for NT install program.
+int SUCALLCONV CheckIfAdmin(void)
+{
+ HANDLE token = INVALID_HANDLE_VALUE;
+ PVOID buffer = 0;
+ DWORD bufLength;
+ DWORD realBufLength;
+ TOKEN_PRIMARY_GROUP *pgroup;
+ TOKEN_GROUPS *groups;
+ int result = -1;
+ DWORD groupCount;
+ LONG status;
+ PSID AdministratorSID = NULL;
+ SID_IDENTIFIER_AUTHORITY authority = SECURITY_NT_AUTHORITY;
+
+ // allocate the SID for the Administrators group
+ if (!AllocateAndInitializeSid(&authority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &AdministratorSID)) {
+ status = GetLastError();
+ goto getout;
+ }
+
+ // open the process token
+ if (!OpenProcessToken(GetCurrentProcess(), TOKEN_READ, &token)) {
+ status = GetLastError();
+ token = INVALID_HANDLE_VALUE;
+ goto getout;
+ }
+
+ // check primary group first
+ buffer = GlobalAlloc(GMEM_FIXED, sizeof(TOKEN_PRIMARY_GROUP));
+ if (!buffer) {
+ goto getout;
+ }
+
+ bufLength = sizeof(TOKEN_PRIMARY_GROUP);
+ while(1) {
+ if (!GetTokenInformation(token, TokenPrimaryGroup, buffer, bufLength, &realBufLength)) {
+ if (realBufLength > bufLength) {
+ // not enough space
+ GlobalFree(buffer);
+ bufLength = realBufLength;
+ buffer = GlobalAlloc(GMEM_FIXED, realBufLength);
+ if (!buffer) {
+ goto getout;
+ }
+ continue;
+ }
+
+ goto getout;
+ }
+ break;
+ }
+
+ pgroup = (TOKEN_PRIMARY_GROUP *)buffer;
+ if (EqualSid(pgroup->PrimaryGroup, AdministratorSID)) {
+ result = 0;
+ } else {
+ // okay, try the secondary groups
+ while(1) {
+ if (!GetTokenInformation(token, TokenGroups, buffer, bufLength, &realBufLength)) {
+ if (realBufLength > bufLength) {
+ // not enough space
+ GlobalFree(buffer);
+ bufLength = realBufLength;
+ buffer = GlobalAlloc(GMEM_FIXED, realBufLength);
+ if (!buffer) {
+ goto getout;
+ }
+ continue;
+ }
+
+ // a real error
+ goto getout;
+ }
+ break;
+ }
+
+ // we have the list of groups here. Process them:
+ groups = (TOKEN_GROUPS *)buffer;
+ for(groupCount = 0; groupCount < groups->GroupCount; groupCount++) {
+ if (EqualSid(groups->Groups[groupCount].Sid, AdministratorSID)) {
+ result = 0;
+ break;
+ }
+ }
+ }
+
+getout:
+
+ if (token != INVALID_HANDLE_VALUE) {
+ CloseHandle(token);
+ }
+
+ if (buffer) {
+ GlobalFree(buffer);
+ }
+
+ if (AdministratorSID) {
+ FreeSid(AdministratorSID);
+ }
+
+ return result;
+}
+
+static void SetSharedFileRefCount(char *pszFile, int nRefCount)
+{
+ LONG result;
+ HKEY hKey;
+
+ result = RegOpenKeyAlt(AFSREG_NULL_KEY, MS_SHARED_FILES_KEY, KEY_WRITE, FALSE, &hKey, 0);
+ if (result != ERROR_SUCCESS)
+ return;
+
+ if (nRefCount <= 0)
+ RegDeleteValue(hKey, pszFile);
+ else
+ RegSetValueEx(hKey, pszFile, 0, REG_DWORD, (BYTE *)&nRefCount, sizeof(int));
+
+ RegCloseKey(hKey);
+}
+
+static char *GetTimeStamp()
+{
+ char szTime[64], szDate[64];
+ static char szTimeDate[128];
+
+ _strtime(szTime);
+ _strdate(szDate);
+
+ sprintf(szTimeDate, "[%s %s] ", szTime, szDate);
+
+ return szTimeDate;
+}
+
+int SUCALLCONV WriteToInstallErrorLog(char *pszMsg)
+{
+ static BOOL bWritten = FALSE;
+ FILE *fp;
+
+ // On the first write, recreate the file
+ fp = fopen(INSTALL_ERROR_LOG_NAME, bWritten ? "a" : "w");
+ if (!fp)
+ return -1;
+
+ fprintf(fp, "%s%s\r\n", GetTimeStamp(), pszMsg);
+
+ fclose(fp);
+
+ bWritten = TRUE;
+
+ return 0;
+}
+
+static void WriteToUninstallErrorLog(char *pszMsg)
+{
+ static BOOL bWritten = FALSE;
+ FILE *fp;
+
+ // On the first write, recreate the file
+ fp = fopen(UNINSTALL_ERROR_LOG_NAME, bWritten ? "a" : "w");
+ if (!fp)
+ return;
+
+ fprintf(fp, "%s%s\r\n", GetTimeStamp(), pszMsg);
+
+ fclose(fp);
+
+ bWritten = TRUE;
+}
+
+static char *LoadResString(UINT uID)
+{
+ static char str[256];
+ GetString (str, uID);
+ return str;
+}
+
+static void ShowError(UINT nResID, LONG nError)
+{
+ char szErr[256];
+ char szPrompt[256];
+ char szMsg[256];
+ char szTitle[256];
+ char *psz;
+
+ psz = LoadResString(nResID);
+ if (psz)
+ strcpy(szErr, psz);
+ else
+ sprintf(szErr, "unknown error msg (Msg ID = %d)", nResID);
+
+ psz = LoadResString(IDS_INSTALLATION_FAILURE);
+ strcpy(szPrompt, psz ? psz : "An error has occurred: %s (Last Error = %ld).");
+
+ sprintf(szMsg, szPrompt, szErr, nError);
+
+ psz = LoadResString(IDS_TITLE);
+ strcpy(szTitle, psz ? psz : "AFS");
+
+ if (bSilentMode)
+ WriteToUninstallErrorLog(szMsg);
+ else
+ MessageBox(hDlg, szMsg, szTitle, MB_OK);
+}
+
+static int ShowMsg(UINT nResID, int nType)
+{
+ char szTitle[256];
+ char *psz;
+
+ psz = LoadResString(IDS_TITLE);
+ strcpy(szTitle, psz ? psz : "AFS");
+
+ return MessageBox(hDlg, LoadResString(nResID), szTitle, nType);
+}
+
+static char *GetAppInstallDir(struct APPINFO *pApp, BOOL bRemembered)
+{
+ HKEY hKey;
+ LONG nResult;
+ DWORD dwType;
+ static char szInstallDir[256];
+ DWORD dwSize;
+ char *pszKey;
+ char *pszValue;
+
+ pszKey = bRemembered ? UNINSTALL_TEMP_INFO_KEY : pApp->regInstallDir.pszKey;
+ pszValue = bRemembered ? INSTALL_DIR_VALUE_NAME : pApp->regInstallDir.pszValue;
+
+ dwSize = sizeof(szInstallDir);
+
+ nResult = RegOpenKeyAlt(AFSREG_NULL_KEY, pszKey, KEY_READ, FALSE, &hKey, 0);
+ if (nResult == ERROR_SUCCESS) {
+ nResult = RegQueryValueEx(hKey, pszValue, 0, &dwType, (PBYTE)szInstallDir, &dwSize);
+ RegCloseKey(hKey);
+ }
+
+ if (nResult != ERROR_SUCCESS) {
+ ShowError(IDS_CANT_DETERMINE_APP_PATH, nResult);
+ return 0;
+ }
+
+ FilepathNormalizeEx(szInstallDir, FPN_BACK_SLASHES);
+
+ return szInstallDir;
+}
+
+static BOOL DoesRegKeyExist(char *pszKey)
+{
+ HKEY hKey;
+ LONG nResult;
+
+ nResult = RegOpenKeyAlt(AFSREG_NULL_KEY, pszKey, KEY_READ, FALSE, &hKey, 0);
+ if (nResult == ERROR_SUCCESS) {
+ RegCloseKey(hKey);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static BOOL IsAppInstalled(struct APPINFO *pApp)
+{
+ return DoesRegKeyExist(pApp->pszAppKey);
+}
+
+static void BuildShortPath(char *pszShortPath, UINT nShortPathLen, char *pszInstallDir, char *pszPath)
+{
+ strncpy(pszShortPath, pszInstallDir, nShortPathLen);
+ strncat(pszShortPath, pszPath, nShortPathLen);
+
+ GetShortPathName(pszShortPath, pszShortPath, nShortPathLen);
+}
+
+static BOOL IsWin95()
+{
+ OSVERSIONINFO versionInformation;
+
+ versionInformation.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+
+ GetVersionEx(&versionInformation);
+
+ if ((versionInformation.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) &&
+ (versionInformation.dwMinorVersion == 0))
+ return TRUE;
+
+ return FALSE;
+}
+
+int IsWin98()
+{
+ OSVERSIONINFO versionInformation;
+
+ versionInformation.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+
+ GetVersionEx(&versionInformation);
+
+ if ((versionInformation.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) &&
+ (versionInformation.dwMinorVersion == 10))
+ return 0;
+
+ return -1;
+}
+
+static BOOL IsServiceInstalled(char *pszServiceKey)
+{
+ HKEY hKey;
+
+ if (RegOpenKeyAlt(0, pszServiceKey, KEY_READ, FALSE, &hKey, 0) == ERROR_SUCCESS) {
+ RegCloseKey(hKey);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+// If this fails in anyway we just return. No error is displayed.
+static void MakeSureServiceDoesNotExist(char *pszName)
+{
+ SC_HANDLE hServer = 0, hSCM = 0;
+ SERVICE_STATUS status;
+
+ hSCM = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE);
+ if (hSCM) {
+ hServer = OpenService(hSCM, pszName, SERVICE_ALL_ACCESS | DELETE);
+ if (hServer) {
+ if (QueryServiceStatus(hServer, &status)) {
+ if (status.dwCurrentState != SERVICE_STOPPED) {
+ if (!ControlService(hServer, SERVICE_CONTROL_STOP, &status)) {
+ CloseServiceHandle(hServer);
+ CloseServiceHandle(hSCM);
+ return;
+ }
+ }
+ }
+
+ // Try to delete even if status query fails
+ DeleteService(hServer);
+ }
+ }
+
+ if (hServer)
+ CloseServiceHandle(hServer);
+ if (hSCM)
+ CloseServiceHandle(hSCM);
+}
+
+static int InstallService(char *pszName, char *pszDependOn, char *pszDisplayName, char *pszServicePath, BOOL bInteractive)
+{
+ SC_HANDLE hServer = 0, hSCM;
+ BOOL bRestoreOldConfig = FALSE;
+
+ hSCM = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE);
+ if (!hSCM) {
+ ShowError(IDS_SCM_OPEN_FAILED, GetLastError());
+ return -1;
+ }
+
+/* This code is not used, but it could be handy in the future so I am keeping it here.
+
+ // If the service exists, then we (most probably) are in the middle of an upgrade or reinstall.
+ bRestoreOldConfig = IsServiceInstalled(pszName);
+
+ if (bRestoreOldConfig) {
+ hServer = OpenService(hSCM, pszName, SERVICE_ALL_ACCESS);
+ if (!hServer || !ChangeServiceConfig(hServer, SERVICE_NO_CHANGE, SERVICE_AUTO_START, SERVICE_NO_CHANGE, 0, 0, 0, 0, 0, 0, 0)) {
+ ShowError(IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED, GetLastError());
+ bRestoreOldConfig = FALSE;
+ // Fall through to service creation below
+ }
+ }
+*/
+
+ if (!bRestoreOldConfig) {
+ DWORD dwServiceType;
+
+ // If the service already exists, the create call will fail. This can
+ // happen if uninstall failed (which is not infrequent). Making sure the
+ // service does not exist makes it easier for a user to install over top of
+ // a previously failed uninstall.
+ MakeSureServiceDoesNotExist(pszName);
+
+ dwServiceType = SERVICE_WIN32_OWN_PROCESS;
+ if (bInteractive)
+ dwServiceType |= SERVICE_INTERACTIVE_PROCESS;
+
+ hServer = CreateService(hSCM, pszName, pszDisplayName,
+ SERVICE_ALL_ACCESS, dwServiceType, SERVICE_AUTO_START,
+ SERVICE_ERROR_NORMAL, pszServicePath, 0, 0, "RPCSS\0Netbios\0\0", 0, 0);
+
+ if (!hServer)
+ ShowError(IDS_SERVICE_CREATE_FAILED, GetLastError());
+ }
+
+ if (hServer)
+ CloseServiceHandle(hServer);
+
+ CloseServiceHandle(hSCM);
+
+ return 0;
+}
+
+int SUCALLCONV InstallServerService(char *pszServicePath)
+{
+ return InstallService(appServer.pszSvcName, 0, appServer.pszSvcDisplayName, pszServicePath, TRUE);
+}
+
+int SUCALLCONV InstallClientService(char *pszServicePath)
+{
+ return InstallService(appClient.pszSvcName, appClient.pszSvcDependOn, appClient.pszSvcDisplayName, pszServicePath, FALSE);
+}
+
+static int UninstallService(struct APPINFO *pAppInfo)
+{
+ SC_HANDLE hServer, hSCM;
+ SERVICE_STATUS status;
+ BOOL bOk;
+ BOOL bServer = FALSE;
+ BOOL bShowingProgressDlg = FALSE;
+
+ hSCM = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE);
+ if (!hSCM) {
+ ShowError(IDS_SCM_OPEN_FAILED, GetLastError());
+ return -1;
+ }
+
+ hServer = OpenService(hSCM, pAppInfo->pszSvcName, SERVICE_ALL_ACCESS | DELETE);
+ if (!hServer) {
+ ShowError(IDS_SERVICE_OPEN_FAILED, GetLastError());
+ CloseServiceHandle(hSCM);
+ return -1;
+ }
+
+ if (!QueryServiceStatus(hServer, &status)) {
+ ShowError(IDS_SERVICE_QUERY_FAILED, GetLastError());
+ CloseServiceHandle(hServer);
+ CloseServiceHandle(hSCM);
+ return -1;
+ }
+
+ if (status.dwCurrentState != SERVICE_STOPPED) {
+ if (pAppInfo->nServiceShutdownMsgID) {
+ if (!bSilentMode && (ShowMsg(pAppInfo->nServiceShutdownMsgID, MB_YESNO | MB_ICONQUESTION) == IDNO)) {
+ CloseServiceHandle(hServer);
+ CloseServiceHandle(hSCM);
+ return 1;
+ }
+ }
+
+ if (!bSilentMode)
+ bShowingProgressDlg = ShowProgressDialog(LoadResString(pAppInfo->nServiceShutdownProgressMsgID));
+
+ if (!ControlService(hServer, SERVICE_CONTROL_STOP, &status)) {
+ if (bShowingProgressDlg)
+ HideProgressDialog();
+ ShowError(IDS_SERVICE_STOP_FAILED, GetLastError());
+ CloseServiceHandle(hServer);
+ CloseServiceHandle(hSCM);
+ return -1;
+ }
+ }
+
+ // Wait for the service to stop
+ while (status.dwCurrentState != SERVICE_STOPPED) {
+ // I stopped waiting on dwWaitHint because it seemed the wait hint was too long.
+ // The service would be stopped but we'd still be asleep for a long time yet.
+ Sleep(5000); //status.dwWaitHint);
+
+ if (!QueryServiceStatus(hServer, &status)) {
+ if (bShowingProgressDlg)
+ HideProgressDialog();
+ ShowError(IDS_SERVICE_QUERY_FAILED, GetLastError());
+ CloseServiceHandle(hServer);
+ CloseServiceHandle(hSCM);
+ return -1;
+ }
+ }
+
+ // The service has been stopped
+ if (bShowingProgressDlg)
+ HideProgressDialog();
+
+ // This code to disable the service may be of use some day so I am keeping it here.
+ // bOk = ChangeServiceConfig(hServer, SERVICE_NO_CHANGE, SERVICE_DISABLED, SERVICE_NO_CHANGE, 0, 0, 0, 0, 0, 0, 0);
+
+ bOk = DeleteService(hServer);
+
+ if (!bOk)
+ ShowError(IDS_SERVICE_DELETE_FAILED, GetLastError());
+
+ CloseServiceHandle(hServer);
+ CloseServiceHandle(hSCM);
+
+ return (bOk ? 0 : -1);
+}
+
+int SUCALLCONV AddToNetworkProviderOrder(char *pszWhatToAdd)
+{
+ return AddToProviderOrder(pszWhatToAdd) ? 0 : -1;
+}
+
+static int RemoveFromNetworkProviderOrder(char *pszWhatToDel)
+{
+ return RemoveFromProviderOrder(pszWhatToDel) ? 0 : -1;
+}
+
+int SUCALLCONV AddToPath(char *pszPath)
+{
+ return AddToSystemPath(pszPath) ? 0 : -1;
+}
+
+static int RemoveFromPath(char *pszPath)
+{
+ return RemoveFromSystemPath(pszPath) ? 0 : -1;
+}
+
+static void RemoveFiles(char *pszFileSpec)
+{
+ struct _finddata_t fileinfo;
+ long hSearch;
+ char szDel[MAX_PATH];
+ char szDir[MAX_PATH];
+ char *p;
+
+ strcpy(szDir, pszFileSpec);
+ p = strrchr(szDir, '\\');
+ if (p)
+ *p = 0;
+
+ hSearch = _findfirst(pszFileSpec, &fileinfo);
+ if (hSearch == -1)
+ return;
+
+ while (1) {
+ if ((strcmp(fileinfo.name, ".") != 0) && (strcmp(fileinfo.name, "..") != 0)) {
+ sprintf(szDel, "%s\\%s", szDir, fileinfo.name);
+ DeleteFile(szDel);
+ }
+
+ if (_findnext(hSearch, &fileinfo) == -1)
+ break;
+ }
+
+ _findclose(hSearch);
+}
+
+static void RemoveDir(char *pszDir)
+{
+ char szFileSpec[MAX_PATH];
+
+ sprintf(szFileSpec, "%s\\*.*", pszDir);
+
+ RemoveFiles(szFileSpec);
+ RemoveDirectory(pszDir);
+}
+
+static void RemoveRegValues(struct REGVALUE *pRegValues)
+{
+ struct REGVALUE *pCurValue;
+ HKEY hKey;
+ LONG nResult;
+
+ if (!pRegValues)
+ return;
+
+ for (pCurValue = pRegValues; pCurValue->pszKey; pCurValue++) {
+ nResult = RegOpenKeyAlt(AFSREG_NULL_KEY, pCurValue->pszKey, KEY_ALL_ACCESS, FALSE, &hKey, 0);
+
+ if (nResult == ERROR_SUCCESS) {
+ nResult = RegDeleteValue(hKey, pCurValue->pszValue);
+ RegCloseKey(hKey);
+ }
+
+ if (nResult != ERROR_SUCCESS)
+ ShowError(IDS_REG_DELETE_VALUE_ERROR, nResult);
+ }
+}
+
+static BOOL UninstallCredsTool()
+{
+ int nResult = WinExec("afscreds /uninstall", SW_HIDE);
+
+ if (nResult <= 31) {
+ if (nResult != ERROR_FILE_NOT_FOUND)
+ ShowError(IDS_CANT_UNINSTALL_AFSCREDS, nResult);
+ }
+
+ // Always return true. We don't want the uninstall to completely fail just
+ // because the creds tool didn't uninstall.
+ return TRUE;
+}
+
+
+static char *GetTempDir()
+{
+ DWORD result;
+ static char szTempDir[MAX_PATH];
+
+ result = GetTempPath(sizeof(szTempDir) - 1, szTempDir);
+ if (result == 0)
+ return "\\";
+
+ return szTempDir;
+}
+
+static char *GetRootInstallDir()
+{
+ char *psz;
+ static char szRootInstallDir[MAX_PATH] = "";
+
+ if (szRootInstallDir[0] == 0) {
+ strcpy(szRootInstallDir, pszInstallDir);
+
+ // Strip off the app specific part of the install dir
+ psz = strrchr(szRootInstallDir, '\\');
+ if (psz)
+ *psz = 0;
+ }
+
+ return szRootInstallDir;
+}
+
+static BOOL ClientSpecificUninstall()
+{
+ int nChoice;
+
+ // This function needs to do two things. First it needs to see if the server is
+ // installed, and if it is, ask the user if they really want to uninstall the
+ // client given that the server needs the client. Second, if we are uninstalling
+ // the client, we need to uninstall the creds tool.
+
+ if (!bSilentMode) {
+ if (IsAppInstalled(&appServer)) {
+ nChoice = ShowMsg(IDS_CLIENT_NEEDED_BY_SERVER, MB_ICONQUESTION | MB_YESNO);
+ if (nChoice == IDNO)
+ return FALSE; // Cancel the uninstall
+ }
+ }
+
+ UninstallCredsTool();
+
+ return TRUE;
+}
+
+static struct APPINFO *GetApp()
+{
+#ifdef SERVER_UNINST
+ return &appServer;
+#elif CLIENT_UNINST
+ return &appClient;
+#elif CC_UNINST
+ return &appControlCenter;
+#elif LIGHT_CLIENT_UNINST
+ return &appLightClient;
+#elif DOCS_UNINST
+ return &appDocs;
+#else
+ return 0;
+#endif;
+}
+
+static void RememberInstallDir(char *pszInstallDir)
+{
+ HKEY hKey;
+
+ // We remember the install dir so that when the UninstUninitialize function is called
+ // by the InstallShield uninstaller, we can find out where we were installed to. We
+ // have to do this because by the time that function is called, the registry values
+ // created at install time are already gone. We need to be able to find out where we
+ // were installed so we can clean up anything IS couldn't uninstall. If this fails in
+ // any way then we don't care. The only consequence is that some junk might be left on
+ // the users' system after an uninstall.
+
+ LONG result = RegOpenKeyAlt(AFSREG_NULL_KEY, UNINSTALL_TEMP_INFO_KEY, KEY_WRITE, TRUE, &hKey, 0);
+ if (result != ERROR_SUCCESS)
+ return;
+
+ RegSetValueEx(hKey, INSTALL_DIR_VALUE_NAME, 0, REG_SZ, (PBYTE)pszInstallDir, strlen(pszInstallDir) + 1);
+
+ RegCloseKey(hKey);
+}
+
+int SUCALLCONV SetSilentMode()
+{
+ bSilentMode = TRUE;
+
+ return 0;
+}
+
+static char *GetWinDir()
+{
+ static char szWinDir[MAX_PATH] = "";
+
+ if (!szWinDir[0])
+ GetWindowsDirectory(szWinDir, sizeof(szWinDir));
+
+ return szWinDir;
+}
+
+static char *GetWinSysDir()
+{
+ static char szWinSysDir[MAX_PATH] = "";
+
+ if (!szWinSysDir[0])
+ GetSystemDirectory(szWinSysDir, sizeof(szWinSysDir));
+
+ return szWinSysDir;
+}
+
+static char *GetLocaleID()
+{
+ static char szID[25] = "";
+
+ if (szID[0] == 0) {
+ LCID dwID = GetSystemDefaultLCID();
+
+ // Nuke the high word. It contains a sort ID.
+ dwID &= 0x0000FFFF;
+
+ // Convert locale ID to a string
+ itoa(dwID, szID, 10);
+
+ // This thing should never be more than LOCALE_ID_LEN characters long.
+ szID[LOCALE_ID_LEN] = 0;
+ }
+
+ return szID;
+}
+
+static char *ExpandPath(char *pszFile)
+{
+ static char szPath[MAX_PATH];
+ char *psz;
+
+ szPath[0] = 0;
+
+ // Convert a path containing TARGETDIR, WINDIR, or WINSYSDIR to a
+ // real path in the file system. One of these MUST be the start of
+ // the file path passed in. Also convert the string ???? to an
+ // actual locale number.
+ if (strncmp(pszFile, TARGETDIR, strlen(TARGETDIR)) == 0)
+ strcpy(szPath, GetRootInstallDir());
+ else if (strncmp(pszFile, WINDIR, strlen(WINDIR)) == 0)
+ strcpy(szPath, GetWinDir());
+ else if (strncmp(pszFile, WINSYSDIR, strlen(WINSYSDIR)) == 0)
+ strcpy(szPath, GetWinSysDir());
+
+ if (szPath[0]) {
+ psz = strchr(pszFile, '\\');
+ if (psz)
+ strcat(szPath, psz);
+ } else
+ strcpy(szPath, pszFile);
+
+ // Is this a language dll?
+ psz = strstr(szPath, "????.");
+
+ // If it is, replace ???? with the locale number
+ if (psz)
+ strncpy(psz, GetLocaleID(), LOCALE_ID_LEN);
+
+ return szPath;
+}
+
+static BOOL FileNeededByOtherApp(struct APPINFO *pApp, struct FILEINFO *pFileInfo)
+{
+ // If the file is used by the server, the app being uninstalled is not the server, and
+ // the server is installed, then this file is used by another app.
+ if (!IsWinNT()) {
+ if ((pFileInfo->nUsedBy & LCLIENT) && (pApp != &appLightClient) && IsAppInstalled(&appLightClient))
+ return TRUE;
+ return FALSE;
+ }
+
+ if ((pFileInfo->nUsedBy & SERVER) && (pApp != &appServer) && IsAppInstalled(&appServer))
+ return TRUE;
+
+ if ((pFileInfo->nUsedBy & CLIENT) && (pApp != &appClient) && IsAppInstalled(&appClient))
+ return TRUE;
+
+ if ((pFileInfo->nUsedBy & CC) && (pApp != &appControlCenter) && IsAppInstalled(&appControlCenter))
+ return TRUE;
+
+ return FALSE;
+}
+
+static void DeleteInUseFiles(struct APPINFO *pAppInfo, struct FILEINFO *pFileInfo)
+{
+ char szSrcPath[MAX_PATH];
+ char szDestPath[MAX_PATH];
+ char szTempDir[MAX_PATH];
+ int ii;
+
+ // If some app's file has been loaded before the app is uninstalled, then
+ // when an uninstall is attempted, the application and all of the dlls that
+ // its uses will be in use and IS will not be able to delete them. Normally this
+ // is not a problem because IS will tell the user to reboot to finish the uninstall.
+ // However, we must support the ability to perform a silent uninstall followed
+ // immediatly by an install of the same product to the same directories. If we let
+ // IS handle the uninstall of these files, this is not possible. The reason is that
+ // when IS fails to remove these in use files, it marks them for deletion after the
+ // next reboot, which is fine. Unfortunately, it leaves them in the dirs they were
+ // installed to. So if we don't immediately reboot and perform an install to the
+ // same dirs, once a reboot is performed, those files get deleted and we have a
+ // broken installation.
+
+ // What we will do to fix all of this, is when the client is uninstalled, but
+ // before IS does anything, we will move the in use files and associated dlls
+ // into the temp dir and mark them for delete after a reboot. Then an install
+ // that follows will succeed.
+
+ // Delete the files that may be in use. If they are we actually move
+ // them to the temp dir and mark them for deletion after the next reboot.
+ for (ii = 0; pFileInfo[ii].pszName != 0; ii++) {
+ // Get the source path
+ strcpy(szSrcPath, ExpandPath(pFileInfo[ii].pszName));
+
+ // Only delete the file if it is not used by some other app
+ if (FileNeededByOtherApp(pAppInfo, &pFileInfo[ii]))
+ continue;
+
+ // If the file doesn't exist then go on to the next file.
+ if (_access(szSrcPath, 0) != 0)
+ continue;
+
+ // See if we can do a regular delete of the file
+ if (DeleteFile(szSrcPath)) {
+ SetSharedFileRefCount(szSrcPath, 0);
+ continue;
+ }
+
+ // Get a temp dir that is on the same drive as the src path.
+ // We can't move an in use file to a different drive.
+ strcpy(szTempDir, GetTempDir());
+ if (szTempDir[0] != szSrcPath[0]) {
+ // Get the drive, colon, and slash of the src path
+ strncpy(szTempDir, szSrcPath, 3);
+ szTempDir[3] = 0;
+ }
+
+ // Get the dest path - we will rename the file during the move
+ GetTempFileName(szTempDir, "AFS", 0, szDestPath);
+
+ // Move from source to dest, marking the file for deletion after a reboot
+ if (IsWin95()) {
+ if (MoveFile(szSrcPath, szDestPath)) {
+ WritePrivateProfileString("rename", szSrcPath, szDestPath, "wininit.ini");
+ SetSharedFileRefCount(szSrcPath, 0);
+ }
+ } else { // WinNT or Win98
+ if (MoveFileEx(szSrcPath, szDestPath, MOVEFILE_REPLACE_EXISTING)) {
+ SetFileAttributes(szDestPath, FILE_ATTRIBUTE_NORMAL);
+ MoveFileEx(szDestPath, 0, MOVEFILE_DELAY_UNTIL_REBOOT);
+ SetSharedFileRefCount(szSrcPath, 0);
+ }
+ }
+ }
+}
+
+// Delete a directory and all its files and subdirectories - Yee haaa!
+static void RemoveDirectoryTree(char *pszDir)
+{
+ HANDLE hFind;
+ WIN32_FIND_DATA findFileData;
+ char szSpec[MAX_PATH];
+ char szSubFileOrDir[MAX_PATH];
+ BOOL bContinue;
+
+ sprintf(szSpec, "%s\\*.*", pszDir);
+
+ // First delete the contents of the dir
+ hFind = FindFirstFile(szSpec, &findFileData);
+ bContinue = (hFind != INVALID_HANDLE_VALUE);
+
+ while (bContinue) {
+ if ((strcmp(findFileData.cFileName, ".") != 0) && (strcmp(findFileData.cFileName, "..") != 0)) {
+ sprintf(szSubFileOrDir, "%s\\%s", pszDir, findFileData.cFileName);
+
+ if (findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ RemoveDirectoryTree(szSubFileOrDir);
+ else
+ DeleteFile(szSubFileOrDir);
+ }
+
+ bContinue = FindNextFile(hFind, &findFileData);
+ }
+
+ FindClose(hFind);
+
+ // Now remove the dir
+ RemoveDirectory(pszDir);
+}
+
+static char *GetStartMenuRoot()
+{
+ HKEY hKey;
+ LONG nResult;
+ DWORD dwType;
+ DWORD dwSize;
+ char *pszKey;
+ char *pszValue;
+
+ static char szStartMenuRoot[MAX_PATH] = "";
+
+ if (szStartMenuRoot[0] == 0) {
+ dwSize = sizeof(szStartMenuRoot);
+
+ if (IsWinNT()) {
+ pszKey = WINNT_START_MENU_REG_KEY;
+ pszValue = WINNT_START_MENU_REG_VALUE;
+ } else {
+ pszKey = WIN9X_START_MENU_REG_KEY;
+ pszValue = WIN9X_START_MENU_REG_VALUE;
+ }
+
+ nResult = RegOpenKeyAlt(AFSREG_NULL_KEY, pszKey, KEY_READ, FALSE, &hKey, 0);
+ if (nResult == ERROR_SUCCESS) {
+ nResult = RegQueryValueEx(hKey, pszValue, 0, &dwType, (PBYTE)szStartMenuRoot, &dwSize);
+ RegCloseKey(hKey);
+ }
+
+ if (nResult != ERROR_SUCCESS)
+ return 0;
+ }
+
+ FilepathNormalizeEx(szStartMenuRoot, FPN_BACK_SLASHES);
+
+ return szStartMenuRoot;
+}
+
+static char *GetAfsStartMenuRoot()
+{
+ static char szAfsStartMenuRoot[MAX_PATH] = "";
+ char *pszStartMenuRoot;
+
+ if (szAfsStartMenuRoot[0] == 0) {
+ pszStartMenuRoot = GetStartMenuRoot();
+ if (!pszStartMenuRoot)
+ return 0;
+
+ if (bSilentMode)
+ sprintf(szAfsStartMenuRoot, "%s\\IBM WebSphere\\Performance Pack\\AFS", pszStartMenuRoot );
+ else
+ sprintf(szAfsStartMenuRoot, "%s\\IBM AFS", pszStartMenuRoot );
+ }
+
+ return szAfsStartMenuRoot;
+}
+
+static BOOL IsADir(char *pszName)
+{
+ struct _stat statbuf;
+
+ if (_stat(pszName, &statbuf) < 0)
+ return FALSE;
+
+ return statbuf.st_mode & _S_IFDIR;
+}
+
+static void DeleteStartMenuEntries(char *pszEntries)
+{
+ char szStartMenuPath[MAX_PATH];
+ char *pszAfsStartMenuRoot;
+ char *pszCurEntry;
+
+ pszAfsStartMenuRoot = GetAfsStartMenuRoot();
+
+ if (!pszAfsStartMenuRoot)
+ return;
+
+ for (pszCurEntry = pszEntries; *pszCurEntry; pszCurEntry += strlen(pszCurEntry) + 1) {
+ sprintf(szStartMenuPath, "%s\\%s", pszAfsStartMenuRoot, pszCurEntry);
+ if (IsADir(szStartMenuPath))
+ RemoveDirectoryTree(szStartMenuPath);
+ else
+ DeleteFile(szStartMenuPath);
+ }
+}
+
+static void RefreshStartMenu()
+{
+ char *pszAfsStartMenuRoot;
+ char szTemp[MAX_PATH];
+
+ pszAfsStartMenuRoot = GetAfsStartMenuRoot();
+ if (!pszAfsStartMenuRoot)
+ return;
+
+ sprintf(szTemp, "%s - Refresh Attempt", pszAfsStartMenuRoot);
+
+ // Deleting items from below the root level of the start menu does not
+ // cause it to refresh. In order that users can see changes without
+ // rebooting we will temporarily rename our root most entry, which
+ // does cause a refresh of the start menu.
+ MoveFileEx(pszAfsStartMenuRoot, szTemp, MOVEFILE_REPLACE_EXISTING);
+ MoveFileEx(szTemp, pszAfsStartMenuRoot, MOVEFILE_REPLACE_EXISTING);
+}
+
+static BOOL PreserveConfigInfo(struct APPINFO *pApp)
+{
+ char *pszRegKey;
+ char szDestKey[256];
+ LONG result;
+
+ bPreserveConfigInfo = TRUE;
+
+ // If not in silent mode, ask user if they want to preserve the cfg info
+ if (!bSilentMode) {
+ int nChoice = ShowMsg(pApp->nPreserveConfigInfoMsgID, MB_ICONQUESTION | MB_YESNOCANCEL);
+ if (nChoice == IDCANCEL)
+ return FALSE; // Cancel the uninstall
+ else if (nChoice == IDNO) {
+ bPreserveConfigInfo = FALSE; // User doesn't want to preserve the config info
+ return TRUE;
+ }
+ }
+
+ // Copy each reg key (and all of its subkeys and values) to another place in the registry.
+ for (pszRegKey = pApp->pszRegKeysToPreserve; *pszRegKey; pszRegKey += strlen(pszRegKey) + 1) {
+ if (!DoesRegKeyExist(pszRegKey))
+ continue;
+
+ // Create the destination path for the copy
+ sprintf(szDestKey, "%s\\%s\\%s", AFS_PRESERVED_CFG_INFO_KEY, pApp->pszAppName, pszRegKey);
+
+ // Try to copy it
+ result = RegDupKeyAlt(pszRegKey, szDestKey);
+
+ if ((result != ERROR_SUCCESS) && (result != ERROR_FILE_NOT_FOUND)) {
+ // If the copy failed, then delete any copies that succeeded
+ sprintf(szDestKey, "%s\\%s", AFS_PRESERVED_CFG_INFO_KEY, pApp->pszAppName);
+ RegDeleteEntryAlt(szDestKey, REGENTRY_KEY);
+ goto done;
+ }
+ }
+
+ // Remember the integrated login setting if this app supports that and it was turned on
+ if (pApp->pszNetworkProviderOrder) {
+ // Was integerated login turned on?
+ BOOL bOn, bOk;
+ bOk = InNetworkProviderOrder(pApp->pszNetworkProviderOrder, &bOn);
+ if (bOk && bOn) {
+ HKEY hKey;
+ sprintf(szDestKey, "%s\\%s\\IntegratedLogin", AFS_PRESERVED_CFG_INFO_KEY, pApp->pszAppName);
+ result = RegOpenKeyAlt(AFSREG_NULL_KEY, szDestKey, KEY_WRITE, TRUE, &hKey, 0);
+ // The existance of the key is a flag indicating that integrated login was turned on
+ RegCloseKey(hKey);
+ }
+ }
+
+done:
+ if ((result == ERROR_SUCCESS) || bSilentMode)
+ return TRUE; // Continue with uninstall
+
+ // Report the error and ask the user if they want to continue the uninstall
+ return (ShowMsg(IDS_SAVE_OF_CONFIG_INFO_FAILED, MB_ICONEXCLAMATION | MB_YESNO) == IDYES);
+}
+
+int SUCALLCONV RestoreConfigInfo(int nApp)
+{
+ char *pszRegKey;
+ char szSrcKey[256];
+ struct APPINFO *pApp = 0;
+ BOOL bError = FALSE;
+ LONG result;
+
+ switch (nApp) {
+ case SERVER: pApp = &appServer; break;
+ case CLIENT: pApp = &appClient; break;
+ case LCLIENT: pApp = &appLightClient; break;
+ case CC: pApp = &appControlCenter; break;
+ }
+
+ if (!pApp)
+ return -1;
+
+ // Copy each reg key (and all of its subkeys and values) back to its original place in the registry.
+ for (pszRegKey = pApp->pszRegKeysToPreserve; *pszRegKey; pszRegKey += strlen(pszRegKey) + 1) {
+ // Create the source path for the copy
+ sprintf(szSrcKey, "%s\\%s\\%s", AFS_PRESERVED_CFG_INFO_KEY, pApp->pszAppName, pszRegKey);
+
+ if (!DoesRegKeyExist(szSrcKey))
+ continue;
+
+ // Try to restore as many of the keys as possible. Report any errors at the end.
+
+ // Try to copy it
+ result = RegDupKeyAlt(szSrcKey, pszRegKey);
+ if ((result != ERROR_SUCCESS) && (result != ERROR_FILE_NOT_FOUND))
+ bError = TRUE;
+ }
+
+ // Restore integrated login if this app was using it
+ if (pApp->pszNetworkProviderOrder) {
+ // Check if integrated login was turned on. The IntegratedLogin key is a flag
+ // telling us that it was on. If the key does not exist, integrated login was
+ // not on.
+ sprintf(szSrcKey, "%s\\%s\\IntegratedLogin", AFS_PRESERVED_CFG_INFO_KEY, pApp->pszAppName);
+ if (DoesRegKeyExist(szSrcKey)) {
+ if (!AddToProviderOrder(pApp->pszNetworkProviderOrder))
+ bError = TRUE;
+ }
+ }
+
+ // Remove our saved copies of the config info
+ sprintf(szSrcKey, "%s\\%s", AFS_PRESERVED_CFG_INFO_KEY, pApp->pszAppName);
+ RegDeleteEntryAlt(szSrcKey, REGENTRY_KEY);
+
+ if (bError)
+ ShowError(IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED, 0);
+
+ return TRUE;
+}
+
+static BOOL DoSubKeysExist(char *pszKey)
+{
+ LONG result;
+ HKEY hKey;
+ char *pszSubKeys = 0;
+ BOOL bExist;
+
+ result = RegOpenKeyAlt(AFSREG_NULL_KEY, pszKey, KEY_READ, FALSE, &hKey, 0);
+ if (result != ERROR_SUCCESS)
+ return FALSE;
+
+ result = RegEnumKeyAlt(hKey, &pszSubKeys);
+ RegCloseKey(hKey);
+
+ if (result != ERROR_SUCCESS)
+ return FALSE;
+
+ if (pszSubKeys) {
+ bExist = TRUE;
+ free(pszSubKeys);
+ } else
+ bExist = FALSE;
+
+ return bExist;
+}
+
+/*
+ * The following definitions are taken from richedit.h:
+ *
+ */
+
+#define EM_SETBKGNDCOLOR (WM_USER + 67) // from Richedit.h
+#define EM_STREAMIN (WM_USER + 73) // from Richedit.h
+#define SF_RTF 0x0002
+
+typedef DWORD (CALLBACK *EDITSTREAMCALLBACK)(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);
+
+typedef struct _editstream {
+ DWORD dwCookie; /* user value passed to callback as first parameter */
+ DWORD dwError; /* last error */
+ EDITSTREAMCALLBACK pfnCallback;
+} EDITSTREAM;
+
+/*
+ *
+ */
+
+DWORD CALLBACK License_StreamText (DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
+{
+ LPTSTR psz = (LPTSTR)dwCookie;
+ LONG cchAvail = lstrlen(psz);
+ if ((*pcb = min(cchAvail, cb)) != 0) {
+ memcpy (pbBuff, psz, *pcb);
+ memmove (psz, &psz[*pcb], cchAvail - *pcb + 1);
+ }
+ return 0;
+}
+
+
+void License_OnInitDialog (HWND hDlg, LPTSTR pszFile)
+{
+ // Open the license file and shove its text in our RichEdit control
+ //
+ HANDLE hFile;
+ if ((hFile = CreateFile (pszFile, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) != INVALID_HANDLE_VALUE) {
+
+ size_t cbText;
+ if ((cbText = GetFileSize (hFile, NULL)) != 0) {
+
+ LPTSTR abText = (LPTSTR)GlobalAlloc (GMEM_FIXED, cbText + 3);
+
+ DWORD cbRead;
+ if (ReadFile (hFile, abText, cbText, &cbRead, NULL)) {
+ abText[ cbRead ] = 0;
+
+ EDITSTREAM Stream;
+ memset (&Stream, 0x00, sizeof(Stream));
+ Stream.dwCookie = (DWORD)abText;
+ Stream.pfnCallback = License_StreamText;
+
+ SendDlgItemMessage (hDlg, IDC_TEXT, EM_STREAMIN, SF_RTF, (LPARAM)&Stream);
+ }
+
+ GlobalFree (abText);
+ }
+
+ CloseHandle (hFile);
+ }
+
+ // Make the control's background be gray
+ //
+ SendDlgItemMessage (hDlg, IDC_TEXT, EM_SETBKGNDCOLOR, FALSE, (LPARAM)GetSysColor(COLOR_BTNFACE));
+}
+
+BOOL CALLBACK License_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
+{
+ switch (msg) {
+ case WM_INITDIALOG:
+ SetWindowLong (hDlg, DWL_USER, lp);
+ License_OnInitDialog (hDlg, (LPTSTR)lp);
+ break;
+
+ case WM_COMMAND:
+ switch (LOWORD(wp)) {
+ case IDCANCEL:
+ case IDOK:
+ EndDialog (hDlg, LOWORD(wp));
+ break;
+
+ case IDC_PRINT:
+ TCHAR szDir[ MAX_PATH ];
+ GetCurrentDirectory (MAX_PATH, szDir);
+ ShellExecute (hDlg, TEXT("print"), (LPTSTR)GetWindowLong (hDlg, DWL_USER), NULL, szDir, SW_HIDE);
+ break;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+BOOL FindAfsInstallationPathByComponent (LPTSTR pszInstallationPath, LPTSTR pszComponent)
+{
+ *pszInstallationPath = 0;
+
+ TCHAR szRegPath[ MAX_PATH ];
+ wsprintf (szRegPath, TEXT("Software\\TransarcCorporation\\%s\\CurrentVersion"), pszComponent);
+
+ HKEY hk;
+ if (RegOpenKey (HKEY_LOCAL_MACHINE, szRegPath, &hk) == 0) {
+ DWORD dwType = REG_SZ;
+ DWORD dwSize = MAX_PATH;
+
+ if (RegQueryValueEx (hk, TEXT("PathName"), NULL, &dwType, (PBYTE)pszInstallationPath, &dwSize) == 0) {
+ *(LPTSTR)FindBaseFileName (pszInstallationPath) = TEXT('\0');
+
+ if (pszInstallationPath[0] && (pszInstallationPath[ lstrlen(pszInstallationPath)-1 ] == TEXT('\\')))
+ pszInstallationPath[ lstrlen(pszInstallationPath)-1 ] = TEXT('\0');
+ }
+
+ RegCloseKey (hk);
+ }
+
+ return !!*pszInstallationPath;
+}
+
+BOOL FindAfsInstallationPath (LPTSTR pszInstallationPath)
+{
+ if (FindAfsInstallationPathByComponent (pszInstallationPath, TEXT("AFS Client")))
+ return TRUE;
+ if (FindAfsInstallationPathByComponent (pszInstallationPath, TEXT("AFS Control Center")))
+ return TRUE;
+ if (FindAfsInstallationPathByComponent (pszInstallationPath, TEXT("AFS Server")))
+ return TRUE;
+ if (FindAfsInstallationPathByComponent (pszInstallationPath, TEXT("AFS Supplemental Documentation")))
+ return TRUE;
+ return FALSE;
+}
+
+HINSTANCE LoadRichTextControl (void)
+{
+ HINSTANCE hInst;
+ if ((hInst = LoadLibrary ("riched20.dll")) != NULL)
+ return hInst;
+ if ((hInst = LoadLibrary ("riched32.dll")) != NULL)
+ return hInst;
+ if ((hInst = LoadLibrary ("riched.dll")) != NULL)
+ return hInst;
+ if ((hInst = LoadLibrary ("richedit.dll")) != NULL)
+ return hInst;
+ return NULL;
+}
+
+int SUCALLCONV ShowLicense (char *pszTarget, char *pszSource)
+{
+ // If the license already lives on this user's machine, don't show
+ // it again. This only has to be done if the user has never
+ // accepted the license agreement before (it's part of the setup
+ // program, so it gets installed if they've accepted it).
+ //
+ // We were handed a relative path of the form:
+ // Documentation/html/license.rtf
+ //
+ // We'll need to find the AFS installation directory, in order to
+ // find that Documentation subtree.
+ //
+ BOOL fShowLicense = TRUE;
+
+ TCHAR szInstallationPath[ MAX_PATH ];
+ if (FindAfsInstallationPath (szInstallationPath)) {
+ TCHAR szLicensePath[ MAX_PATH ];
+ wsprintf (szLicensePath, TEXT("%s\\%s"), szInstallationPath, pszTarget);
+
+ if (GetFileAttributes (szLicensePath) != (DWORD)-1) {
+ fShowLicense = FALSE;
+ }
+ }
+
+ // Before we can show the license file, we have to prepare the RichEdit
+ // control. That means loading the appropriate library and calling its
+ // initialization functions.
+ //
+ HINSTANCE hRichEdit;
+ if ((hRichEdit = LoadRichTextControl()) != NULL) {
+
+ // If we must show the license, do so now. This is a modal dialog,
+ // so we'll know whether or not the user accepts the license.
+ //
+ if (ModalDialogParam (IDD_LICENSE, GetActiveWindow(), License_DlgProc, (LPARAM)pszSource) == IDCANCEL) {
+ // The user rejected the license; fail setup
+ return FALSE;
+ }
+
+ FreeLibrary (hRichEdit);
+ }
+
+ // The user accepted the license, so we can continue with Setup.
+ // The license file is installed as part of Setup.
+ return TRUE;
+}
+
+int SUCALLCONV UninstInitialize(HWND hIS, HINSTANCE hIS5, long Reserved)
+{
+ char szPath[MAX_PATH];
+ struct APPINFO *pAppInfo;
+ char *pszFile = 0;
+ char *pszSubDir = 0;
+
+ hDlg = hIS;
+
+ bSilentMode = !IsWindowVisible(hIS);
+
+ // Which app are we uninstalling?
+ pAppInfo = GetApp();
+ if (!pAppInfo) {
+ ShowError(IDS_CANT_DETERMINE_PRODUCT, 0);
+ return -1;
+ }
+
+ // Get the app's install dir
+ pszInstallDir = GetAppInstallDir(pAppInfo, FALSE);
+ if (!pszInstallDir)
+ return -1;
+
+ // If this app has a custom uninstall func, call it here
+ if (pAppInfo->pUninstallFunc)
+ if (!pAppInfo->pUninstallFunc())
+ return -1;
+
+ if (pAppInfo->pszRegKeysToPreserve)
+ if (!PreserveConfigInfo(pAppInfo))
+ return -1;
+
+ // Unconfigure the service, if there is one for this app
+ if (pAppInfo->pszSvcKey) {
+ if (IsServiceInstalled(pAppInfo->pszSvcKey))
+ if (UninstallService(pAppInfo) == 1)
+ return -1;
+ }
+
+ RememberInstallDir(pszInstallDir);
+
+ DeleteInUseFiles(pAppInfo, fileInfo);
+
+ // Remove the app's bin path from the system path
+ if (pAppInfo->pszBinPath) {
+ BuildShortPath(szPath, sizeof(szPath), pszInstallDir, pAppInfo->pszBinPath);
+ RemoveFromPath(szPath);
+ }
+
+ // Remove entry from NetworkProvider\Order key in registry
+ if (pAppInfo->pszNetworkProviderOrder)
+ RemoveFromNetworkProviderOrder(pAppInfo->pszNetworkProviderOrder);
+
+ // Remove any generated subdirectories
+ if (!bPreserveConfigInfo && pAppInfo->pszDirsToDel) {
+ for (pszSubDir = pAppInfo->pszDirsToDel; *pszSubDir; pszSubDir += strlen(pszSubDir) + 1)
+ RemoveDir(ExpandPath(pszSubDir));
+ }
+
+ // Remove any generated files
+ if (!bPreserveConfigInfo && pAppInfo->pszFilesToDel) {
+ for (pszFile = pAppInfo->pszFilesToDel; *pszFile; pszFile += strlen(pszFile) + 1)
+ RemoveFiles(ExpandPath(pszFile));
+ }
+
+ // Remove any registry values that IS can't handle
+ RemoveRegValues(pAppInfo->pRegValues);
+ if (IsWinNT())
+ RemoveRegValues(pAppInfo->pWinNTRegValues);
+ else
+ RemoveRegValues(pAppInfo->pWin9XRegValues);
+
+ // Remove the start menu entries for this app
+ if (pAppInfo->pszStartMenuEntries) {
+ DeleteStartMenuEntries(pAppInfo->pszStartMenuEntries);
+ RefreshStartMenu();
+ }
+
+ // Remove the install dir
+ RemoveDirectory(pszInstallDir);
+
+ return 0;
+}
+
+void SUCALLCONV UninstUnInitialize(HWND hIS, HINSTANCE hIS5, long Reserved)
+{
+ char *pszInstallDir;
+ char szDirPath[MAX_PATH];
+ char *psz;
+ struct APPINFO *pAppInfo;
+
+ // If we just uninstalled the last AFS app, then do some cleanup.
+ if (IsAppInstalled(&appServer) || IsAppInstalled(&appClient) ||
+ IsAppInstalled(&appControlCenter) || IsAppInstalled(&appLightClient) ||
+ IsAppInstalled(&appDocs))
+ {
+ return;
+ }
+
+ bSilentMode = !IsWindowVisible(hIS);
+
+ // Which app did we just uninstall?
+ pAppInfo = GetApp();
+ if (!pAppInfo) {
+ ShowError(IDS_CANT_DETERMINE_PRODUCT, 0);
+ return;
+ }
+
+ // Get the app's install dir
+ pszInstallDir = GetAppInstallDir(pAppInfo, TRUE);
+ if (!pszInstallDir)
+ return;
+
+ // Remove the reg key we used to remember the app install dir
+ RegDeleteEntryAlt(UNINSTALL_TEMP_INFO_KEY, REGENTRY_KEY);
+
+ // Try to remove the reg key used to store config info, but only
+ // if there are no app config info sub keys present.
+ if (!DoSubKeysExist(AFS_PRESERVED_CFG_INFO_KEY))
+ RegDeleteEntryAlt(AFS_PRESERVED_CFG_INFO_KEY, REGENTRY_KEY);
+
+ // Remove the install dir
+ RemoveDirectory(pszInstallDir);
+
+ // Attempt to remove the install root and common directories. The are
+ // shared and so no single app knows to delete them.
+
+ // Strip off the app specific part of the install dir
+ psz = strrchr(pszInstallDir, '\\');
+ if (psz)
+ *psz = 0;
+
+ sprintf(szDirPath, "%s\\%s", pszInstallDir, "Common");
+ RemoveDirectory(szDirPath);
+
+ // Remove the Common directory from the system path
+ RemoveFromPath(szDirPath);
+
+ // Remove all of the documentation dirs
+ sprintf(szDirPath, "%s\\%s", pszInstallDir, "Documentation");
+ RemoveDirectoryTree(szDirPath);
+
+ // Ok, up to this point we have been removing files we know we
+ // created. However, after this point we are into the path
+ // that the user chose for our install root. The default for
+ // this is IBM/Afs, but they could have chosen anything,
+ // including a dir or dirs that have other products in them.
+ // We will check to see if it is IBM\AFS and if it is then we
+ // will attempt to remove them.
+
+ // Back up a level and look for AFS
+ psz = strrchr(pszInstallDir, '\\');
+ if (psz) {
+ if (stricmp(psz + 1, "AFS") == 0) {
+ RemoveDirectory(pszInstallDir);
+ *psz = 0;
+ }
+ }
+
+ // Back up a level and look for IBM
+ psz = strrchr(pszInstallDir, '\\');
+ if (psz) {
+ if (stricmp(psz + 1, "IBM") == 0) {
+ RemoveDirectory(pszInstallDir);
+ *psz = 0;
+ }
+ }
+
+ // Remove the root afs start menu entry
+ psz = GetStartMenuRoot();
+ if (psz) {
+ if (bSilentMode) {
+ // Remove everything under our branch
+ sprintf(szDirPath, "%s\\IBM WebSphere\\Performance Pack\\AFS", psz);
+ RemoveDirectoryTree(szDirPath);
+
+ // Remove the IBM stuff only if the dirs are empty
+ sprintf(szDirPath, "%s\\IBM WebSphere\\Performance Pack", psz);
+ if (RemoveDirectory(szDirPath)) {
+ sprintf(szDirPath, "%s\\IBM WebSphere", psz);
+ RemoveDirectory(szDirPath);
+ }
+ } else {
+ sprintf(szDirPath, "%s\\IBM AFS", psz);
+ RemoveDirectoryTree(szDirPath);
+ }
+ }
+}
+
+BOOLEAN _stdcall DllEntryPoint(HANDLE dll, DWORD reason, PVOID reserved)
+{
+ if (reason == DLL_PROCESS_ATTACH) {
+ hinst = (HINSTANCE)dll;
+ TaLocale_LoadCorrespondingModuleByName (hinst, "afs_setup_utils.dll");
+ }
+
+ return TRUE;
+}
+
+extern "C" int WINAPI Test (HINSTANCE hInst, HINSTANCE hPrev, LPSTR psz, int nCmdShow)
+{
+ ShowLicense ("TEST", "\\\\fury\\afssetup\\license\\ja_JP.rtf");
+ return 0;
+}
+
+
$(LIBFILE): $(LIBOBJS)
$(LIBARCH)
+clean::
+
lpServer->Close();
}
- BOOL fRestartAll;
+ BOOL fRestartAll = FALSE;
if (!lpiRestart->fIsService())
fRestartAll = TRUE;
t_name = (char *)malloc(AFSNAMEMAX);
t_name[0] = '\0';
*a_name = t_name;
- bzero(a_hosts, AFSMAXCELLHOSTS * sizeof(afs_int32));
+ memset(a_hosts, 0, AFSMAXCELLHOSTS * sizeof(afs_int32));
return 0;
}
cm_spaceListp = tsp->nextp;
}
else tsp = (cm_space_t *) malloc(sizeof(cm_space_t));
+ (void) memset(tsp, 0, sizeof(cm_space_t));
lock_ReleaseWrite(&cm_utilsLock);
return tsp;
if (code) Die(code, (char *) 0);
else {
tp = space;
- bcopy(tp, &flag, sizeof(afs_int32));
+ memcpy(&flag, tp, sizeof(afs_int32));
printf("Security level is currently ");
if (flag == 1)
printf("crypt (data security).\n");
swab(((char *) x) +10,((char *) _krb_swap_tmp) +4 ,2); \
swab(((char *) x) +12,((char *) _krb_swap_tmp) +2 ,2); \
swab(((char *) x) +14,((char *) _krb_swap_tmp) +0 ,2); \
- bcopy((char *)_krb_swap_tmp,(char *)x,16);\
+ memcpy((char *)x, (char *)_krb_swap_tmp, 16);\
}
#define swap_u_12(x) {\
swab(((char *) x) +6, ((char *) _krb_swap_tmp) +4 ,2); \
swab(((char *) x) +8, ((char *) _krb_swap_tmp) +2 ,2); \
swab(((char *) x) +10,((char *) _krb_swap_tmp) +0 ,2); \
- bcopy((char *)_krb_swap_tmp,(char *)x,12);\
+ memcpy((char *)x, (char *)_krb_swap_tmp, 12);\
}
#define swap_C_Block(x) {\
swab(((char *) x) +2,((char *) _krb_swap_tmp) +4 ,2); \
swab(((char *) x) +4,((char *) _krb_swap_tmp) +2 ,2); \
swab(((char *) x) +6,((char *) _krb_swap_tmp) ,2); \
- bcopy((char *)_krb_swap_tmp,(char *)x,8);\
+ memcpy((char *)x, (char *)_krb_swap_tmp, 8);\
}
#define swap_u_quad(x) {\
unsigned long _krb_swap_tmp[4];\
swab(((char *) &x) +2,((char *) _krb_swap_tmp) +4 ,2); \
swab(((char *) &x) +4,((char *) _krb_swap_tmp) +2 ,2); \
swab(((char *) &x) +6,((char *) _krb_swap_tmp) ,2); \
- bcopy((char *)_krb_swap_tmp,(char *)&x,8);\
+ memcpy((char *)&x, (char *)_krb_swap_tmp, 8);\
}
#define swap_u_long(x) {\
if (!ioctlp->inAllocp) ioctlp->inAllocp = malloc(SMB_IOCTL_MAXDATA);
if (!ioctlp->outAllocp) ioctlp->outAllocp = malloc(SMB_IOCTL_MAXDATA);
+ /* Fixes fs la problem. We do a StrToOEM later and if this data isn't initialized we get memory issues. */
+ (void) memset(ioctlp->inAllocp, 0, SMB_IOCTL_MAXDATA);
+ (void) memset(ioctlp->outAllocp, 0, SMB_IOCTL_MAXDATA);
+
/* and make sure that we've reset our state for the new incoming request */
if (!(ioctlp->flags & SMB_IOCTLFLAG_DATAIN)) {
ioctlp->inCopied = 0;
Path %IS5ROOT%\Program;%PATH%
-ISbuild -p"%AFSROOT%\src\WINNT\install\InstallShield5" -m"Transarc AFS"
+ISbuild -p"%AFSROOT%\src\WINNT\install\InstallShield5" -m"OpenAFS"
-if not exist "Media\Transarc AFS\Disk Images\disk1" goto nocopylicense
-mkdir "Media\Transarc AFS\Disk Images\disk1\License"
-copy ..\..\license\lang\*.rtf "Media\Transarc AFS\Disk Images\disk1\License"
+if not exist "Media\OpenAFS\Disk Images\disk1" goto nocopylicense
+mkdir "Media\OpenAFS\Disk Images\disk1\License"
+copy ..\..\license\lang\*.rtf "Media\OpenAFS\Disk Images\disk1\License"
:nocopylicense
If errorlevel 1 goto BuildErrorOccurred
cd File Groups
rem This next file must run using cmd.exe
cmd /c GenFileGroups.bat
-cd ..\Media\Transarc AFS
+cd ..\Media\OpenAFS
call GenDefault.mda.bat
cd ..\..
if not exist "Component Definitions" mkdir "Component Definitions"
if not exist "File Groups" mkdir "File Groups"
if not exist Media mkdir Media
-if not exist "Media\Transarc AFS" mkdir "Media\Transarc AFS"
+if not exist "Media\OpenAFS" mkdir "Media\OpenAFS"
if not exist "Registry Entries" mkdir "Registry Entries"
if not exist "Script Files" mkdir "Script Files"
if not exist "Setup Files" mkdir "Setup Files"
Entry103=CLIENT_GROUP_NAME
Entry104=CCENTER_GROUP_NAME
Entry105=LIGHT_GROUP_NAME
+Entry106=CELLNAME_DEFAULT
+Entry107=WELCOME_MESSAGE
+Entry108=CELLSERVDB_WEB
+Entry109=CELLSERVDB_INSTALL
+Entry110=CELLSERVDB_CONFIGNAME
[CONFIGURING_AFS_CREDS]
Comment=
[LIGHT_GROUP_NAME]
Comment=
+[CELLNAME_DEFAULT]
+Comment=Default Cell name
+
+[WELCOME_MESSAGE]
+Comment=Display in Welcome Box
+
+[CELLSERVDB_WEB]
+Comment=Web address to load cellservdb
+
+[CELLSERVDB_INSTALL]
+Comment=Source file for installable Cellservdb
+
+[CELLSERVDB_CONFIGNAME]
+Comment=Cellservdb file name
+
copy "File Groups\Default.fdf" .
copy "File Groups\GenFileGroups.bat" .
-copy "Media\Transarc AFS\GenDefault.mda.bat" .
+copy "Media\OpenAFS\GenDefault.mda.bat" .
copy "Registry Entries\Default.rge" .
copy "Setup Files\Uncompressed Files\Language Independent\OS Independent\setup.bmp" .
+
+copy "Setup Files\Uncompressed Files\Language Independent\OS Independent\_isuser.dll" .
+
copy "Shell Objects\Default.shl" .\Default.shell
copy "String Tables\Default.shl" .
echo MEDIATYPE=CDROM >> default.mda
echo DATAASFILES=No >> default.mda
echo BUILDTYPE=Full >> default.mda
-echo BuildLocation=Media\Transarc AFS >> default.mda
+echo BuildLocation=Media\OpenAFS >> default.mda
echo BREAKBYTOPCOMPONENT=No >> default.mda
echo REFRESH_DATAFILES=Yes >> default.mda
echo REFRESH_SPLASH=Yes >> default.mda
echo BUILDSIZE= >> default.mda
-echo Name=AFS for Windows >> default.mda
+echo Name=OpenAFS for Windows >> default.mda
echo REVIEWREPORT=No >> default.mda
echo REFRESH_IFILES=Yes >> default.mda
echo PASSWORD= >> default.mda
echo [SetupInfo] >> default.mda
echo ENABLELANGDLG=Yes >> default.mda
echo ALTERNATEISDELETENAME= >> default.mda
-echo APPLICATIONNAME=AFS for Windows >> default.mda
+echo APPLICATIONNAME=OpenAFS for Windows >> default.mda
echo HIDESTATUSBAR=No >> default.mda
echo WIN32SENABLE=No >> default.mda
echo. >> default.mda
echo. >> default.mda
echo [TagFileInfo] >> default.mda
echo PRODUCTCATEGORY=System Tool >> default.mda
-echo APPLICATIONNAME=AFS for Windows >> default.mda
-echo COMPANYNAME=Transarc Corpration >> default.mda
+echo APPLICATIONNAME=OpenAFS for Windows >> default.mda
+echo COMPANYNAME=OpenAFS >> default.mda
echo VERSION=1.00.000 >> default.mda
-echo INFO= >> default.mda
+echo INFO=http://www.openafs.org >> default.mda
rem -------------- Client_WinDir_Files.fgl -----------------------------
echo [TopDir] > Client_WinDir_Files.fgl
-echo file0=%IS5_DEST%\root.client\usr\vice\etc\afsdcell.ini >> Client_WinDir_Files.fgl
+rem echo file0=%IS5_DEST%\root.client\usr\vice\etc\afsdcell.ini >> Client_WinDir_Files.fgl
echo. >> Client_WinDir_Files.fgl
echo [General] >> Client_WinDir_Files.fgl
echo Type=FILELIST >> Client_WinDir_Files.fgl
rem -------------- Light_Client_WinDir_Files.fgl -----------------------
echo [TopDir] > Light_Client_WinDir_Files.fgl
-echo file0=%IS5_DEST%\root.client\usr\vice\etc\afsdcell.ini >> Light_Client_WinDir_Files.fgl
+rem echo file0=%IS5_DEST%\root.client\usr\vice\etc\afsdcell.ini >> Light_Client_WinDir_Files.fgl
echo. >> Light_Client_WinDir_Files.fgl
echo [General] >> Light_Client_WinDir_Files.fgl
echo Type=FILELIST >> Light_Client_WinDir_Files.fgl
rem -------------- Light95_Client_WinDir_Files.fgl -----------------------
echo [TopDir] > Light95_Client_WinDir_Files.fgl
-echo file0=%IS5_DEST%\root.client\usr\vice\etc\afsdcell.ini >> Light95_Client_WinDir_Files.fgl
+rem echo file0=%IS5_DEST%\root.client\usr\vice\etc\afsdcell.ini >> Light95_Client_WinDir_Files.fgl
echo. >> Light95_Client_WinDir_Files.fgl
echo [General] >> Light95_Client_WinDir_Files.fgl
echo Type=FILELIST >> Light95_Client_WinDir_Files.fgl
rem -------------- Control_Center_WinDir_Files.fgl ---------------------
echo [TopDir] > Control_Center_WinDir_Files.fgl
-echo file0=%IS5_DEST%\root.client\usr\vice\etc\afsdcell.ini >> Control_Center_Windir_Files.fgl
+rem echo file0=%IS5_DEST%\root.client\usr\vice\etc\afsdcell.ini >> Control_Center_Windir_Files.fgl
echo. >> Control_Center_WinDir_Files.fgl
echo [General] >> Control_Center_WinDir_Files.fgl
echo Type=FILELIST >> Control_Center_WinDir_Files.fgl
echo OSSupport=0000000000010000 >> InstallShield5.ipr
echo. >> InstallShield5.ipr
echo [Data] >> InstallShield5.ipr
-echo CurrentMedia=Transarc AFS >> InstallShield5.ipr
+echo CurrentMedia=OpenAFS >> InstallShield5.ipr
echo set_mifserial= >> InstallShield5.ipr
-echo ProductName=AFS for Windows >> InstallShield5.ipr
+echo ProductName=OpenAFS for Windows >> InstallShield5.ipr
echo CurrentComponentDef=Default.cdf >> InstallShield5.ipr
echo set_dlldebug=No >> InstallShield5.ipr
echo AppExe= >> InstallShield5.ipr
echo set_crc=Yes >> InstallShield5.ipr
echo set_maxwarn=50 >> InstallShield5.ipr
echo Description=Description.txt >> InstallShield5.ipr
-echo CompanyName=Transarc Corpration >> InstallShield5.ipr
+echo CompanyName=OpenAFS >> InstallShield5.ipr
echo CurrentLanguage=English >> InstallShield5.ipr
echo. >> InstallShield5.ipr
echo [MediaInfo] >> InstallShield5.ipr
-echo mediadata0=Transarc AFS/Media\Transarc AFS >> InstallShield5.ipr
+echo mediadata0=OpenAFS/Media\OpenAFS >> InstallShield5.ipr
echo. >> InstallShield5.ipr
echo [General] >> InstallShield5.ipr
echo Type=INSTALLMAIN >> InstallShield5.ipr
-echo Version=1.10.000 >> InstallShield5.ipr
+echo Version=1.20.000 >> InstallShield5.ipr
Copyright 2000, International Business Machines Corporation and others.
All Rights Reserved.
-
This software has been released under the terms of the IBM Public
License. For details, see the LICENSE file in the top-level source
directory or online at http://www.openafs.org/dl/license10.html
-
HOW TO SET THE AFS FOR WINDOWS VERSION INFORMATION
+Set AFSPRODUCT_VERSION in the following files:
+src\config\NTMakefile.i386_win95
+src\config\NTMakefile.i386_nt40
-DECIDE WHAT THE VERSION INFO SHOULD BE
-
-First decide what the version information should be. There are
-the following values that will need to be set:
-
-MajorVersion
-MinorVersion
-PatchLevel
-BetaLevel
-ReleaseType
-Title (called VersionString in the registry)
-
-MajorVersion is the first number in a dotted version scheme. For
-example, if the version is 3.5, then MajorVersion is set to 3.
-
-MinorVersion is the second number in a dotted version scheme. For
-example, if the version is 3.5, then MinorVersion is set to 5.
-
-PatchLevel is an integer number representing the patch level. If
-the patch level is 4, then PatchLevel is set to 400. If the patch
-level is 3.32, then PatchLevel is set to 332. The reason patch
-numbers aren't just 1, 2, etc., is that they are currently set to
-the cml configuration number of the build used to produce the patch.
-We may later switch to just making the patch level a single digit,
-in which case the PatchLevel value must be set to something big
-enough so that in a comparison with the old patch levels, it will
-evaluate as bigger. So if you want a patch level of 4, use a
-PatchLevel setting of 400. If this is not a patch release, then
-set PatchLevel to 0.
-
-BetaLevel is an integer number representing the beta level. This is
-just a way to have multiple beta releases. So if this is the first
-beta release, set BetaLevel to 1. If this is not a beta release,
-then set BetaLevel to 0.
-
-ReleaseType is kind of redundant; it is set to the string "GA" if
-this is a non-beta release and "Beta" if this is a beta release.
-
-Title is the product version as a full string. So if this is
-release 3.5 3.22, then Title is set to "3.5 3.22". If this is
-3.6 Beta 2, then Title is set to "3.6 Beta 2".
-
-Title is used when showing the version to the user, like, for
-example, in the afs creds tool.
-
-************************* NOTE ******************************
-You MUST set all of these values correctly and in a consistent
-manner from one release to the next so that the installer can
-properly determine whether to perform upgrades, downgrades, or
-reinstalls.
-
-Look at the function CompareVersions in file setup.rul to see
-how these values are used to make version info decisions.
-
-
-SET THE VERSION IN THE INSTALLSHIELD FILES
-
-You will need to edit the following InstallShield files:
-
-value.shl:
-
-This file contains all of the strings used by the program. Set
-all of the following identifiers to the new version number:
-
-TITLE_MAIN
-UNINST_DISPLAY_NAME_CC
-UNINST_DISPLAY_NAME_CLIENT
-UNINST_DISPLAY_NAME_DOCS
-UNINST_DISPLAY_NAME_LIGHT_CLIENT
-UNINST_DISPLAY_NAME_SERVER
-
-These identifiers below correspond to the version information
-discussed in the first section above.
-
-PRODUCT_VERSION_MAJOR
-PRODUCT_VERSION_MINOR
-PRODUCT_VERSION_PATCH_LEVEL
-PRODUCT_VERSION_BETA_LEVEL
-PRODUCT_VERSION_RELEASE_TYPE
-PRODUCT_VERSION_TITLE
-
-Default.rge:
-
-This file contains information that will be written to the registry
-at install time.
-
-Change all occurances of the following to the proper verison info:
-
-MajorVersion (set to same value as PRODUCT_VERSION_MAJOR in value.shl)
-MinorVersion (set to same value as PRODUCT_VERSION_MINOR in value.shl)
-PatchLevel (set to same value as PRODUCT_VERSION_PATCH_LEVEL in value.shl)
-BetaLevel (set to same value as PRODUCT_VERSION_BETA_LEVEL in value.shl)
-ReleaseType (set to same value as PRODUCT_RELEASE_TYPE in value.shl)
-VersionString (set to same value as PRODUCT_VERSION_TITLE in value.shl)
-
-Finally, change any string matching the form below to have the new verison
-info:
-
-HKLMn=Software\TransarcCorporation\Product Name\Version
-
-For example, one such string may be:
+The format of this variable should be
+x.y.z.p or x.y.z p
-HKLM2=Software\TransarcCorporation\AFS Control Center\3.5 3.32
+x= major verson (1-9)
+y= minor verson (1-9)
+z.p= patch level z=(1-9) p=(1-99 or a-z)
-To update the verison info to 3.6 patch 3, the string would change
-to:
+For example:
+AFSPRODUCT_VERSION=1.1.1 a
+AFSPRODUCT_VERSION=1.1.1.1
+AFSPRODUCT_VERSION=1.1.101
+AFSPRODUCT_VERSION=1.1.1a
-HKLM2=Software\TransarcCorporation\AFS Control Center\3.6 3
+These examples represent different forms of the same version.
+However the version will be displayed to the user as they are shown!
-That's it! Build and test the thing, making sure that the version info
-in the registry is correct for each app, and that upgrades of previous
-versions, downgrades to previous versions from this version, and reinstalls
-of this version work correctly.
-If you're the poor sucker who had to do this, then I offer you my sympathy!
!INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME)
!INCLUDE ..\..\..\config\NTMakefile.version
-############################################################################
-
-CELLSERVDB = $(DESTDIR)\root.client\usr\vice\etc\afsdcell.ini
+# Install comments
+# Don't use '=' in the following strings!
+# WELCOMEMESSAGE=Display during installation process
+# AFSBUILDCOMMENTS=Displayed in properity page for install file
+# CELLSERVDB_CONFIGNAME = name of configuration file (ThisCell)
-$(CELLSERVDB): afsdcell.ini
- copy $** $@
+CELLSERVDB_CONFIGNAME=afsdcell.ini
+WELCOMEMESSAGE=Default Configuration Information:\nBuild:*DatE* *TimE* Ver:$(AFSPRODUCT_VERSION)\nCellname:$(CELLNAME_DEFAULT)\nCellSrvDB:$(CELLSERVDB_INSTALL)
+AFSBUILDCOMMENTS=Build:*DatE* *TimE* CellServDB:$(CELLSERVDB_INSTALL)
+
+############################################################################
-prep: $(CELLSERVDB) AFS_component_version_number.txt
+prep: AFS_component_version_number.txt
+ $(DESTDIR)\bin\util_cr.exe } "$(AFSPRODUCT_VERSION)" ".\lang\en_US\value.txt" ".\lang\en_US\value.shl"
+ $(DESTDIR)\bin\util_cr.exe } "$(AFSPRODUCT_VERSION)" "default.txt" "default.rge"
+ $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\lang\en_US\value.shl" "[DATA] CELLSERVDB_CONFIGNAME=$(CELLSERVDB_CONFIGNAME)"
+ $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\lang\en_US\value.shl" "[DATA] CELLNAME_DEFAULT=$(CELLNAME_DEFAULT)"
+ $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\lang\en_US\value.shl" "[DATA] CELLSERVDB_INSTALL=$(CELLSERVDB_INSTALL)"
+ $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\lang\en_US\value.shl" "[DATA] CELLSERVDB_WEB=$(CELLSERVDB_WEB)"
+!IF "$(WELCOMEMESSAGE)" != ""
+ $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\lang\en_US\value.shl" "[DATA] WELCOME_MESSAGE=$(WELCOMEMESSAGE)"
+!ENDIF
+! IF ((EXIST("$(ISWEB)")) &&("$(ISWEB)"!=""))
+ $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] Version=$(AFSPRODUCT_VERSION)"
+ $(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] OutputSpec="$(DESTDIR)\WinInstall\PackageWeb\AFSforWindows.exe"
+! ENDIF
CreateISDirTree.bat
ScatterFiles.bat
CreateGeneratedFiles.bat
CompileScript.bat
+ $(COPY) $(DESTDIR)\WinInstall\Config\wininet.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\."
+ $(COPY) $(DESTDIR)\WinInstall\Config\shlwapi.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\."
+ $(COPY) ..\..\afs_setup_utils\_isuser\_isuser.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\."
+ $(COPY) ..\..\afs_setup_utils\getwebdll\getwebdll.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\."
+ $(COPY) $(DESTDIR)\WinInstall\Config\$(CELLSERVDB_INSTALL) ".\Setup Files\Compressed Files\0009-English\Intel 32\$(CELLSERVDB_CONFIGNAME)"
+ $(DESTDIR)\bin\util_cr.exe ~ ".\Setup Files\Compressed Files\0009-English\Intel 32\$(CELLSERVDB_CONFIGNAME)"
+ $(DESTDIR)\bin\util_cr.exe ~ ".\Setup Files\Compressed Files\0009-English\Intel 32\_ISUSER.DLL"
+ $(DESTDIR)\bin\util_cr.exe ~ ".\Setup Files\Compressed Files\0009-English\Intel 32\shlwapi.DLL"
+ $(DESTDIR)\bin\util_cr.exe ~ ".\Setup Files\Compressed Files\0009-English\Intel 32\wininet.DLL"
+ $(DESTDIR)\bin\util_cr.exe ~ ".\Setup Files\Compressed Files\0009-English\Intel 32\GETWEBDLL.DLL"
build:
- BuildSetup.bat\r
- xcopy/s/e/y "Media\Transarc AFS\Disk Images\disk1\*.*" $(DESTDIR)\WinInstall
- copy AFS_component_version_number.txt $(DESTDIR)\WinInstall\Version.txt\r
- $(DEL) /q "Media\Transarc AFS\Disk Images\disk1\*.*"
-!IF ((EXIST("$(ISWEB)")) &&("$(ISWEB)"!=""))\r
+ BuildSetup.bat
+!IF ((EXIST("$(ISWEB)")) &&("$(ISWEB)"!=""))
! IF (!EXIST($(DESTDIR)\Wininstall\PackageWeb))
$(MKDIR) $(DESTDIR)\Wininstall\PackageWeb
! ENDIF
- $(DEL) /q $(DESTDIR)\Wininstall\PackageWeb\*.*\r
- $(ISWEB)\Pftwwiz.exe $(AFSROOT)\src\winnt\install\InstallShield5\PackageWeb.pfw -s -a \r
-!ENDIF\r
+ $(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
+ copy AFS_component_version_number.txt $(DESTDIR)\WinInstall\Version.txt
+ $(DEL) /q "Media\Transarc AFS\Disk Images\disk1\*.*"
install: prep build
copy Default.fdf "File Groups"
copy GenFileGroups.bat "File Groups"
-copy GenDefault.mda.bat "Media\Transarc AFS"
+copy GenDefault.mda.bat "Media\OpenAFS"
copy Default.rge "Registry Entries"
rem Only copy this file when NOT doing a WSPP build
if not defined AFSBLD_IS_WSPP copy setup.bmp "Setup Files\Uncompressed Files\Language Independent\OS Independent"
+if not defined AFSBLD_IS_WSPP copy _isuser.dll "Setup Files\Uncompressed Files\Language Independent\OS Independent"
copy %AFSROOT%\DEST\root.server\usr\afs\bin\InstallUtils.dll "Setup Files\Compressed Files\Language Independent\OS Independent"
copy %AFSROOT%\DEST\root.server\usr\afs\bin\afs_setup_utils_*.dll "Setup Files\Compressed Files\Language Independent\OS Independent"
-////////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (C) 1998 OpenAFS
-// All rights reserved.
-//
+
//
-// File Name: Setup.rul
+// Copyright 2000, International Business Machines Corporation and others.
+// All Rights Reserved.
//
-// Description: InstallShield script
+// This software has been released under the terms of the IBM Public
+// License. For details, see the LICENSE file in the top-level source
+// directory or online at http://www.openafs.org/dl/license10.html
//
-////////////////////////////////////////////////////////////////////////////////
// Include header files
BOOL bPreinstallReplace;
+////////////////////////////////////////////////////////////////////////////////
+//
+// Function Name: Template
+//
+// Description: This dialog will show a dialog template which can be
+// used for creating any user-defined dialog with the
+// Windows 95 look and feel.
+// Comments:
+//
+////////////////////////////////////////////////////////////////////////////////
+
+number nvSection,nFileIsLocked;
+STRING szTemp,szCellName;
+
+#define IDC_HOMEPATH 301
+#define IDC_ROOTPATH 302
+#define IDC_HOMEDRIVELIST 1007
+#define IDC_ROOTDRIVELIST 1008
+#define IDC_ENABLEROOT 1010
+#define IDC_ENABLEHOME 1011
+#define IDC_INSTALL 1011
+#define IDC_WEB 1016
+#define IDC_CHECK_INSTALL 1018
+#define IDC_CHECK_WEB 1019
+#define IDC_CHECK_BROWSEFILE 1020
+#define IDC_CHECK_PREVIOUSFILE 1021
+#define IDC_PREVIOUSFILE 1024
+#define IDC_BROWSE 1025
+#define IDC_BROWSEFILE 1026
+#define DLG_TEMPLATE 13029
+#define DLG_DRIVEPATH 13030
+#define DLG_CELLSERVDB 13031
+#define IDC_PATH 13032
+
+prototype Logit(STRING);
+function Logit(szMsg)
+HWND handle;
+begin
+ return;
+ OpenFileMode(FILE_MODE_APPEND);
+ if (OpenFile (handle, "y:\\dest", "silent.log") < 0) then
+ CreateFile(handle,"y:\\dest", "silent.log");
+ endif;
+ WriteLine(handle,szMsg);
+ CloseFile(handle);
+end;
+
+prototype Logitn(STRING,NUMBER);
+function Logitn(szMsg,i)
+HWND handle;
+STRING sz;
+begin
+ Sprintf(sz,szMsg,i);
+ Logit(sz);
+end;
+prototype INT GetWebDll.BrowseFile(NUMBER,BYREF STRING,BYREF STRING,NUMBER);
+prototype INT GetWebDll.GetWebPage(BYREF STRING,BYREF STRING,BYREF STRING);
+prototype INT GetWebDll.GetUserLogon(BYREF STRING);
+prototype SetCellServDB(STRING,BYREF NUMBER,BYREF STRING,BYREF STRING,BYREF STRING,BYREF STRING);
+prototype FormErrorMessage(NUMBER,BYREF STRING);
+prototype SetHomeRoot( STRING,BYREF STRING,BYREF STRING,BYREF STRING,BYREF STRING );
+prototype BOOL getWebCellSrvDB(STRING,STRING);
+
+prototype BOOL GetDefaultDrive(BYREF NUMBER);
+function GetDefaultDrive(listAv)
+ NUMBER listAc;
+ NUMBER I,nResult;
+ STRING item,iitem;
+begin
+ listAc = ListCreate (STRINGLIST);
+ Enable (STATUS);
+ SetStatusWindow (50, "Scaning for available Drives...");
+ nResult=GetValidDrivesList (listAc, -1,-1);
+ SetStatusWindow (100, "Completed.");
+ Delay (2);
+ if (nResult<0) then
+ SetStatusWindow(0, "");
+ MessageBox ("Scan Drive Error" , SEVERE);
+ abort;
+ endif;
+ SetStatusWindow(0, "");
+ listAv = ListCreate (STRINGLIST);
+ ListAddString(listAv,"None:",AFTER);
+ ListGetFirstString(listAc, iitem);
+ for I=67 to 90
+ Sprintf(item,"%c",I);
+ nResult=ListFindString(listAc,item);
+ if nResult==END_OF_LIST then
+ ListAddString(listAv,item+":",AFTER);
+ endif;
+ ListGetNextString(listAc,iitem);
+ endfor;
+ ListDestroy(listAc);
+ return TRUE;
+end;
+
+function FormErrorMessage(nResult,szResult)
+begin
+ switch(nResult)
+ case COPY_ERR_CREATEDIR:
+ szResult=TARGETDIR+ "could not be created. Make sure that you have access rights to the target drive.";
+ case COPY_ERR_MEMORY:
+ szResult="The function was unable to allocate the memory required to complete the copy file process. Terminate as many running applications as possible to free memory.";
+ case COPY_ERR_NODISKSPACE:
+ szResult="The function could not find enough disk space on "+TARGETDIR+" to copy the files. Free disk space on the target drive.";
+ case COPY_ERR_OPENINPUT:
+ szResult="The function was unable to open the input file in "+SRCDIR+". Make sure the source file is a valid filename and that both the source file and target directory exist.";
+ case COPY_ERR_OPENOUTPUT:
+ szResult="The function was unable to copy the requested file.";
+ case COPY_ERR_TARGETREADONLY:
+ szResult="The file in "+TARGETDIR+" is read-only. Remove the read-only attribute from the target file and try again.";
+ default:
+ szResult="Unknown error";
+ endswitch;
+end;
+
+function getWebCellSrvDB(szDefaultWeb,szDestFile)
+ NUMBER nResult;
+ STRING szFile,szErrMsg,szURL;
+begin
+ szErrMsg=" ";
+ Enable (STATUS);
+ SetStatusWindow (50, "Now Downloading CellServDB file...");
+ nResult=GetWebPage(szErrMsg,szDestFile,szDefaultWeb);
+ SetStatusWindow (100, "Downloading completed.");
+ Delay (2);
+ if (nResult!=0) then
+ SetStatusWindow(0, "");
+ MessageBox (szErrMsg, INFORMATION);
+ return FALSE;
+ endif;
+ // setup default status
+ SetStatusWindow(0, "");
+ return TRUE;
+end;
+
+// Transfer file to CELLSERVDB
+prototype BOOL InstallCellServDB(NUMBER,STRING,STRING);
+function InstallCellServDB(DefaultItem,szDefaultWeb,szDefaultBrowse)
+STRING szFile,svErrorMessage;
+begin
+ switch (DefaultItem)
+ case IDC_CHECK_WEB:
+ nResult=getWebCellSrvDB(szDefaultWeb,TARGETDIR^@CELLSERVDB_CONFIGNAME);
+ case IDC_CHECK_BROWSEFILE:
+ // open file and copy to area
+ ParsePath(szFile,szDefaultBrowse,PATH);
+ SRCDIR=szFile;
+ ParsePath(szFile,szDefaultBrowse,FILENAME);
+ nResult=CopyFile ( szFile ,@CELLSERVDB_CONFIGNAME );
+ if nResult < 0 then
+ if nResult = -1 then
+ MessageBox ( "CopyFile failed with error code -1!", WARNING );
+ else
+ FormErrorMessage(nResult,svErrorMessage);
+ SprintfBox ( WARNING, "",
+ "CopyFile failed!\n\nError code: %ld\nMessage text: %s",
+ nResult, svErrorMessage );
+ endif;
+ nResult=FALSE;
+ else
+ nResult=TRUE;
+ endif;
+ case IDC_CHECK_INSTALL: //need to delete because install will never overwrite
+ SRCDIR=SUPPORTDIR;
+ nResult=CopyFile (@CELLSERVDB_CONFIGNAME,@CELLSERVDB_CONFIGNAME );
+ if nResult < 0 then
+ if nResult = -1 then
+ MessageBox ( "CopyFile failed with error code -1!", WARNING );
+ else
+ FormErrorMessage(nResult,svErrorMessage);
+ SprintfBox ( WARNING, "",
+ "CopyFile failed!\n\nError code: %ld\nMessage text: %s",
+ nResult, svErrorMessage );
+ endif;
+ nResult=FALSE;
+ else
+ nResult=TRUE;
+ endif;
+ case IDC_CHECK_PREVIOUSFILE:
+ nResult=TRUE;// work is done, it will use previous file
+ default:
+ nResult=TRUE;
+ ;
+ endswitch;
+ return nResult;
+end;
+
+// Return TRUE if silent mode active
+prototype BOOL SilentSetCellServDB(STRING,NUMBER,NUMBER,NUMBER,BYREF STRING,BYREF STRING);
+function SilentSetCellServDB(szDlg,option,nResult,DefaultItem,szDefaultWeb,szDefaultBrowse)
+STRING svSection,szTemp;
+NUMBER nTemp;
+begin
+ switch (option)
+ case 0: //READ function
+ if (MODE!=SILENTMODE) then
+ return FALSE;
+ endif;
+ SdMakeName( svSection, szDlg, "", nvSection );
+ SilentReadData( svSection, "Result", DATA_NUMBER,szTemp,nResult);
+ if (nResult!=NEXT) then
+ return TRUE;
+ endif;
+ SilentReadData( svSection, "DefaultItem", DATA_NUMBER,szTemp,DefaultItem);
+ SilentReadData( svSection, "szDefaultWeb", DATA_STRING, szDefaultWeb,nTemp);
+ SilentReadData( svSection, "szDefaultBrowse", DATA_STRING,szDefaultBrowse,nTemp );
+ if (InstallCellServDB(DefaultItem,szDefaultWeb,szDefaultBrowse)==FALSE) then
+ nResult=CANCEL;
+ else
+ nResult=NEXT;
+ endif;
+ return TRUE;
+ default: //write
+ SdMakeName( svSection, szDlg, "", nvSection );
+ SilentWriteData( svSection, "Result", DATA_NUMBER,szTemp, nResult );
+ SilentWriteData( svSection, "DefaultItem", DATA_NUMBER,szTemp, DefaultItem );
+ SilentWriteData( svSection, "szDefaultWeb", DATA_STRING, szDefaultWeb,nTemp );
+ SilentWriteData( svSection, "szDefaultBrowse", DATA_STRING, szDefaultBrowse,nTemp );
+ return TRUE;
+ endswitch;
+end;
+
+function SetCellServDB( szTitle,DefaultItem,szPreviousInstall,szDefaultWeb,szDefaultBrowse,szDefaultInstall)
+STRING szDlg, szTemp,szResult[256],svErrorMessage,szFile,svSection;
+NUMBER bDone, nId, nMessage, nTemp,AvailableDrives,nResult;
+INT hwndDlg,hwndItem;
+
+begin
+ szDlg = "DLG_CELLSERVDB";
+ // record data produced by this dialog
+ if SilentSetCellServDB(szDlg,0,nResult,DefaultItem,szDefaultWeb,szDefaultBrowse) then
+ return nResult;
+ endif;
+
+ // ensure general initialization is complete
+ if (!bSdInit) then
+ SdInit();
+ endif;
+
+ if (EzDefineDialog( szDlg, "", "",
+ DLG_CELLSERVDB ) = DLG_ERR) then
+ return -1;
+ endif;
+
+ // Loop in dialog until the user selects a standard button
+ Disable(LOGGING);
+ VarSave(SRCTARGETDIR);
+ TARGETDIR=WINDIR;
+ doagain:
+ bDone = FALSE;
+
+ while (!bDone)
+
+ nId = WaitOnDialog( szDlg );
+ hwndDlg = CmdGetHwndDlg( szDlg );
+
+ switch(nId)
+
+ case DLG_INIT:
+ // Initialize List Control
+ // set file
+ CtrlSetState (szDlg, DefaultItem,BUTTON_CHECKED);
+ if !Is(FILE_EXISTS,szPreviousInstall) then
+ hwndItem = GetDlgItem( hwndDlg, IDC_CHECK_PREVIOUSFILE );
+ EnableWindow( hwndItem, FALSE);
+ endif;
+ hwndItem = GetDlgItem( hwndDlg, IDC_PREVIOUSFILE );
+ EnableWindow( hwndItem, DefaultItem==IDC_CHECK_PREVIOUSFILE);
+ hwndItem = GetDlgItem( hwndDlg, IDC_BROWSEFILE );
+ EnableWindow( hwndItem, DefaultItem==IDC_CHECK_BROWSEFILE);
+ hwndItem = GetDlgItem( hwndDlg, IDC_BROWSE );
+ EnableWindow( hwndItem, DefaultItem==IDC_CHECK_BROWSEFILE);
+ hwndItem = GetDlgItem( hwndDlg, IDC_WEB );
+ EnableWindow( hwndItem, DefaultItem==IDC_CHECK_WEB);
+ hwndItem = GetDlgItem( hwndDlg, IDC_INSTALL );
+ EnableWindow( hwndItem, DefaultItem==IDC_CHECK_INSTALL);
+ CtrlSetText (szDlg, IDC_PREVIOUSFILE, szPreviousInstall);
+ CtrlSetText (szDlg, IDC_BROWSEFILE, szDefaultBrowse);
+ CtrlSetText (szDlg, IDC_WEB, szDefaultWeb);
+ CtrlSetText (szDlg, IDC_INSTALL, szDefaultInstall);
+
+ SdGeneralInit( szDlg, hwndDlg, STYLE_NORMAL, szSdProduct );
+
+ //This function sets the caption for old style dialogs or
+ //sets the text in the top banner area of win2k style dialogs
+// SdSetDlgTitle(szDlg, hwndDlg, szTitle); //Version 6.0 only
+
+ case OK:
+ nId = NEXT;
+ bDone = TRUE;
+
+ case BACK:
+ nId = BACK;
+ bDone = TRUE;
+
+ case DLG_ERR:
+ SdError( -1, "DLG_CELLSERVDB" );
+ nId = -1;
+ bDone = TRUE;
+
+ case DLG_CLOSE:
+ SdCloseDlg( hwndDlg, nId, bDone );
+
+ case IDC_BROWSE:
+ szResult=szDefaultBrowse;
+ szTitle="Select file to be used for CellServDB";
+ nResult=BrowseFile(hwndDlg,szTitle,szResult,256);
+ CtrlSetText (szDlg, IDC_BROWSEFILE, szResult);
+ szDefaultBrowse=szResult;
+
+ case IDC_CHECK_BROWSEFILE:
+ hwndItem = GetDlgItem( hwndDlg, IDC_BROWSEFILE );
+ EnableWindow( hwndItem, TRUE);
+ hwndItem = GetDlgItem( hwndDlg, IDC_BROWSE );
+ EnableWindow( hwndItem, TRUE);
+ CtrlSetState (szDlg, DefaultItem,BUTTON_UNCHECKED);
+ CtrlSetState (szDlg, nId,BUTTON_CHECKED);
+ switch (DefaultItem)
+ case IDC_CHECK_WEB:
+ hwndItem = GetDlgItem( hwndDlg, IDC_WEB );
+ EnableWindow( hwndItem, FALSE);
+ case IDC_CHECK_PREVIOUSFILE:
+ hwndItem = GetDlgItem( hwndDlg, IDC_PREVIOUSFILE );
+ EnableWindow( hwndItem, FALSE);
+ case IDC_CHECK_INSTALL:
+ hwndItem = GetDlgItem( hwndDlg, IDC_INSTALL);
+ EnableWindow( hwndItem, FALSE);
+ default:
+ ;
+ endswitch;
+ DefaultItem=nId;
+ case IDC_CHECK_INSTALL:
+ hwndItem = GetDlgItem( hwndDlg, IDC_INSTALL );
+ EnableWindow( hwndItem, TRUE);
+ CtrlSetState (szDlg, DefaultItem,BUTTON_UNCHECKED);
+ CtrlSetState (szDlg, nId,BUTTON_CHECKED);
+ switch (DefaultItem)
+ case IDC_CHECK_BROWSEFILE:
+ hwndItem = GetDlgItem( hwndDlg, IDC_BROWSE );
+ EnableWindow( hwndItem, FALSE);
+ hwndItem = GetDlgItem( hwndDlg, IDC_BROWSEFILE );
+ EnableWindow( hwndItem, FALSE);
+ case IDC_CHECK_WEB:
+ hwndItem = GetDlgItem( hwndDlg, IDC_WEB );
+ EnableWindow( hwndItem, FALSE);
+ case IDC_CHECK_PREVIOUSFILE:
+ hwndItem = GetDlgItem( hwndDlg, IDC_PREVIOUSFILE );
+ EnableWindow( hwndItem, FALSE);
+ default:
+ ;
+ endswitch;
+ DefaultItem=nId;
+ case IDC_CHECK_WEB:
+ hwndItem = GetDlgItem( hwndDlg, IDC_WEB );
+ EnableWindow( hwndItem, TRUE);
+ CtrlSetState (szDlg, DefaultItem,BUTTON_UNCHECKED);
+ CtrlSetState (szDlg, nId,BUTTON_CHECKED);
+ switch (DefaultItem)
+ case IDC_CHECK_BROWSEFILE:
+ hwndItem = GetDlgItem( hwndDlg, IDC_BROWSE );
+ EnableWindow( hwndItem, FALSE);
+ hwndItem = GetDlgItem( hwndDlg, IDC_BROWSEFILE );
+ EnableWindow( hwndItem, FALSE);
+ case IDC_CHECK_INSTALL:
+ hwndItem = GetDlgItem( hwndDlg, IDC_INSTALL);
+ EnableWindow( hwndItem, FALSE);
+ case IDC_CHECK_PREVIOUSFILE:
+ hwndItem = GetDlgItem( hwndDlg, IDC_PREVIOUSFILE );
+ EnableWindow( hwndItem, FALSE);
+ default:
+ ;
+ endswitch;
+ DefaultItem=nId;
+ case IDC_CHECK_PREVIOUSFILE:
+ hwndItem = GetDlgItem( hwndDlg, IDC_PREVIOUSFILE );
+ EnableWindow( hwndItem, TRUE);
+ CtrlSetState (szDlg, DefaultItem,BUTTON_UNCHECKED);
+ CtrlSetState (szDlg, nId,BUTTON_CHECKED);
+ switch (DefaultItem)
+ case IDC_CHECK_BROWSEFILE:
+ hwndItem = GetDlgItem( hwndDlg, IDC_BROWSE );
+ EnableWindow( hwndItem, FALSE);
+ hwndItem = GetDlgItem( hwndDlg, IDC_BROWSEFILE );
+ EnableWindow( hwndItem, FALSE);
+ case IDC_CHECK_INSTALL:
+ hwndItem = GetDlgItem( hwndDlg, IDC_INSTALL);
+ EnableWindow( hwndItem, FALSE);
+ case IDC_CHECK_WEB:
+ hwndItem = GetDlgItem( hwndDlg, IDC_WEB );
+ EnableWindow( hwndItem, FALSE);
+ default:
+ ;
+ endswitch;
+ DefaultItem=nId;
+ default:
+ // check standard handling
+ if (SdIsStdButton( nId ) && SdDoStdButton( nId )) then
+ bDone = TRUE;
+ endif;
+ endswitch;
+
+ endwhile;
+
+ CtrlGetText (szDlg, IDC_BROWSEFILE, szDefaultBrowse);
+ CtrlGetText (szDlg, IDC_WEB, szDefaultWeb);
+ if (nId != NEXT) then
+ return nId;
+ endif;
+ if InstallCellServDB(DefaultItem,szDefaultWeb,szDefaultBrowse)==FALSE then
+ goto doagain;
+ endif;
+ EndDialog( szDlg );
+ ReleaseDialog( szDlg );
+ VarRestore(SRCTARGETDIR);
+ Enable(LOGGING);
+ SdUnInit( );
+ // record data produced by this dialog
+ SilentSetCellServDB(szDlg,1,nId,DefaultItem,szDefaultWeb,szDefaultBrowse);
+ return nId;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Function Name: Template
+//
+// Description: This dialog will show a dialog template which can be
+// used for creating any user-defined dialog with the
+// Windows 95 look and feel.
+// Comments:
+//
+////////////////////////////////////////////////////////////////////////////////
+
+prototype BOOL GetUser(BYREF STRING);
+
+function GetUser(sUser)
+ NUMBER nResult;
+begin
+ sUser=" ";
+ nResult=GetUserLogon(sUser);
+ if (nResult!=1) then
+ sUser="";
+ endif;
+ return (nResult==1);
+end;
+
+
+prototype BOOL SetDriveMaps(STRING,STRING,STRING,STRING,STRING);
+function SetDriveMaps(szPath,szRootDrive,szRootPath,szHomeDrive,szHomePath)
+HWND handle;
+begin
+ VarSave(SRCTARGETDIR);
+ DeleteFile("afsdsbmt.ini");
+ VarRestore(SRCTARGETDIR);
+ CreateFile(handle, szPath, "afsdsbmt.ini");
+ WriteLine(handle, "[AFS Submounts]");
+ if (StrLength(szRootDrive)==2) then
+ WriteLine(handle, "all="+szRootPath);
+ endif;
+ if (StrLength(szHomeDrive)==2) then
+ WriteLine(handle, "home=" + szHomePath);
+ endif;
+ WriteLine(handle, "[AFS Mappings]");
+ if (StrLength(szRootDrive)>0) then
+ WriteLine(handle, szRootDrive+"="+szRootPath);
+ endif;
+ if (StrLength(szHomeDrive)>0) then
+ WriteLine(handle, szHomeDrive+"="+szHomePath);
+ endif;
+ CloseFile(handle);
+end;
+
+// Return TRUE if silent mode active
+prototype BOOL SilentSetHomeRoot(STRING,NUMBER,NUMBER,BYREF STRING,BYREF STRING,BYREF STRING,BYREF STRING);
+function SilentSetHomeRoot(szDlg,option,nResult,szRootDrive,szRootPath,szHomeDrive,szHomePath)
+STRING svSection,szTemp,szTPath,szTShare,szTDrive,szLogname;
+NUMBER nTemp,nCount,I;
+HWND handle;
+begin
+ Logitn("SilentSetHomeRoot option=%i",option);
+ switch (option)
+ case 0: //READ function
+ if (MODE!=SILENTMODE) then
+ return FALSE;
+ endif; // this section is a little more complicated, allowing installation of n mappings
+ SdMakeName( svSection, szDlg, "", nvSection );
+ Logit("SdMakeName="+svSection);
+ SilentReadData( svSection, "Result", DATA_NUMBER,szTemp,nResult);
+ Logitn("nResult=%i",nResult);
+ if (nResult!=NEXT) then
+ return TRUE;
+ endif;
+ Logit("Do count");
+ SilentReadData( svSection, "Count", DATA_NUMBER, szTemp,nCount);
+ Logitn("nCount=%i",nCount);
+ if nCount==0 then
+ return TRUE;
+ endif;
+ VarSave(SRCTARGETDIR);
+ TARGETDIR=WINDIR;
+ DeleteFile("afsdsbmt.ini");
+ VarRestore(SRCTARGETDIR);
+ CreateFile(handle, WINDIR, "afsdsbmt.ini");
+ WriteLine(handle, "[AFS Submounts]");
+ for I=0 to nCount-1
+ Logitn("I=%i",I);
+ Sprintf(szTemp,"Path_%i",I);
+ Logit("Path="+szTemp);
+ SilentReadData( svSection, szTemp, DATA_STRING, szTPath,nTemp);
+ Logit("TPath="+szTPath);
+ if (szTPath % "%LOGINNAME%") then
+ //Replace loginname with actual loging name
+ nTemp=StrFind(szTPath,"%LOGINNAME%");
+ StrSub(szTemp,szTPath,nTemp+11,StrLength(szTPath));
+ StrSub(szTPath,szTPath,0,nTemp);
+ if (GetUser(szLogname)) then
+ szTPath=szTPath+szLogname+szTemp;
+ endif;
+ endif;
+ Sprintf(szTemp,"Share_%i",I);
+ SilentReadData( svSection, szTemp, DATA_STRING, szTShare,nTemp);
+ WriteLine(handle, szTShare+"="+szTPath);
+ endfor;
+ WriteLine(handle, "[AFS Mappings]");
+ for I=0 to nCount-1
+ Sprintf(szTemp,"Drive_%i",I);
+ SilentReadData( svSection, szTemp, DATA_STRING, szTDrive,nTemp);
+ Sprintf(szTemp,"Path_%i",I);
+ SilentReadData( svSection, szTemp, DATA_STRING, szTPath,nTemp);
+ if (szTPath % "%LOGINNAME%") then
+ //Replace loginname with actual loging name
+ nTemp=StrFind(szTPath,"%LOGINNAME%");
+ StrSub(szTemp,szTPath,nTemp+11,StrLength(szTPath));
+ StrSub(szTPath,szTPath,0,nTemp);
+ if (GetUser(szLogname)) then
+ szTPath=szTPath+szLogname+szTemp;
+ endif;
+ endif;
+ WriteLine(handle, szTDrive+"="+szTPath);
+ endfor;
+ CloseFile(handle);
+ nResult=NEXT;
+ return TRUE;
+ default: //write
+ SdMakeName( svSection, szDlg, "", nvSection );
+ nCount=0;
+ SilentWriteData( svSection, "Result", DATA_NUMBER,szTemp, nResult );
+ if (StrLength(szRootDrive)==2) then
+ Sprintf(szTemp,"Drive_%i",nCount);
+ SilentWriteData( svSection,szTemp, DATA_STRING,szRootDrive, nTemp );//root drive
+ Sprintf(szTemp,"Path_%i",nCount);
+ SilentWriteData( svSection,szTemp, DATA_STRING,szRootPath, nTemp );//root drive
+ Sprintf(szTemp,"Share_%i",nCount);
+ SilentWriteData( svSection,szTemp, DATA_STRING,"all", nTemp );//root drive
+ nCount++;
+ endif;
+ if (StrLength(szHomeDrive)==2) then
+ Sprintf(szTemp,"Drive_%i",nCount);
+ SilentWriteData( svSection,szTemp, DATA_STRING,szHomeDrive, nTemp );//root drive
+ Sprintf(szTemp,"Path_%i",nCount);
+ SilentWriteData( svSection,szTemp, DATA_STRING,szHomePath, nTemp );//root drive
+ Sprintf(szTemp,"Share_%i",nCount);
+ SilentWriteData( svSection,szTemp, DATA_STRING,"home", nTemp );//root drive
+ nCount++;
+ endif;
+ SilentWriteData( svSection, "Count", DATA_NUMBER,szTemp, nCount ); // only two can be defined through Dialog box
+ SetDriveMaps(WINDIR,szRootDrive,szRootPath,szHomeDrive,szHomePath);
+ return TRUE;
+ endswitch;
+end;
+
+function SetHomeRoot( szTitle,szRootDrive,szRootPath,szHomeDrive,szHomePath )
+
+STRING szDlg, szTemp,svSection;
+NUMBER bDone, nId, nMessage, nTemp,AvailableDrives,nResult;
+INT hwndDlg,hwndItem,hwndItem2;
+
+begin
+ szDlg = "DLG_DRIVEPATH";
+
+ // record data produced by this dialog
+ Logit("SetHomeRoot");
+ if SilentSetHomeRoot(szDlg,0,nResult,szRootDrive,szRootPath,szHomeDrive,szHomePath ) then
+ return nResult;
+ endif;
+
+ GetDefaultDrive(AvailableDrives);
+ // ensure general initialization is complete
+ if (!bSdInit) then
+ SdInit();
+ endif;
+
+ if (EzDefineDialog( szDlg, "", "",
+ DLG_DRIVEPATH ) = DLG_ERR) then
+ return -1;
+ endif;
+
+ // Loop in dialog until the user selects a standard button
+ bDone = FALSE;
+
+ while (!bDone)
+
+ nId = WaitOnDialog( szDlg );
+
+ switch(nId)
+
+ case DLG_INIT:
+ hwndDlg = CmdGetHwndDlg( szDlg );
+ // Initialize List Control
+ nResult=CtrlSetList( szDlg, IDC_HOMEDRIVELIST, AvailableDrives );
+ if (nResult != 0) then
+ // Handle error from CtrlSetList.
+ MessageBox ("Unable to create folder name list.", SEVERE);
+ bDone = TRUE;
+ endif;
+ if (CtrlSetCurSel(szDlg,IDC_HOMEDRIVELIST,szHomeDrive)!=0) then
+ szHomeDrive="None:";
+ CtrlSetCurSel(szDlg,IDC_HOMEDRIVELIST,szHomeDrive);
+ endif;
+
+ nResult=CtrlSetList( szDlg, IDC_ROOTDRIVELIST, AvailableDrives );
+ if (nResult != 0) then
+ // Handle error from CtrlSetList.
+ MessageBox ("Unable to create folder name list.", SEVERE);
+ bDone = TRUE;
+ endif;
+ if (CtrlSetCurSel(szDlg,IDC_ROOTDRIVELIST,szRootDrive)!=0) then
+ szRootDrive="None:";
+ CtrlSetCurSel(szDlg,IDC_ROOTDRIVELIST,szRootDrive);
+ endif;
+
+ nResult=CtrlSetText( szDlg, IDC_ROOTPATH,szRootPath );
+ if (nResult != 0) then
+ MessageBox ("Unable to create szRootPath.", SEVERE);
+ bDone = TRUE;
+ endif;
+ nResult=CtrlSetText( szDlg, IDC_HOMEPATH,szHomePath );
+ if (nResult != 0) then
+ MessageBox ("Unable to create szHomePath.", SEVERE);
+ bDone = TRUE;
+ endif;
+
+ CtrlSetState (szDlg, IDC_ENABLEHOME,BUTTON_CHECKED);
+ CtrlSetState (szDlg, IDC_ENABLEROOT,BUTTON_CHECKED);
+ SdGeneralInit( szDlg, hwndDlg, STYLE_NORMAL, szSdProduct );
+
+ //This function sets the caption for old style dialogs or
+ //sets the text in the top banner area of win2k style dialogs
+ case OK:
+ if (szRootDrive!=szHomeDrive) then
+ nId = NEXT;
+ bDone = TRUE;
+ else
+ MessageBox("Home and Root drives cannot be the same",WARNING);
+ endif;
+
+ case BACK:
+ nId = BACK;
+ bDone = TRUE;
+
+ case DLG_ERR:
+ SdError( -1, "DLG_DRIVEPATH" );
+ nId = -1;
+ bDone = TRUE;
+
+ case DLG_CLOSE:
+ SdCloseDlg( hwndDlg, nId, bDone );
+
+ case IDC_ENABLEROOT:
+
+ hwndItem = GetDlgItem( hwndDlg, IDC_ROOTDRIVELIST );//get handle of control in custom dialog box
+ hwndItem2 = GetDlgItem( hwndDlg, IDC_ROOTPATH );//get handle of control in custom dialog box
+ if (CtrlGetState (szDlg, nId)==BUTTON_CHECKED) then
+ EnableWindow( hwndItem2, TRUE);
+ EnableWindow( hwndItem, TRUE);
+ else
+ EnableWindow( hwndItem2, FALSE);
+ EnableWindow( hwndItem, FALSE);
+ endif;
+ case IDC_ENABLEHOME:
+ hwndItem = GetDlgItem( hwndDlg, IDC_HOMEDRIVELIST );//get handle of control in custom dialog box
+ hwndItem2 = GetDlgItem( hwndDlg, IDC_HOMEPATH );//get handle of control in custom dialog box
+ if (CtrlGetState (szDlg, nId)==BUTTON_CHECKED) then
+ EnableWindow( hwndItem2, TRUE);
+ EnableWindow( hwndItem, TRUE);
+ else
+ EnableWindow( hwndItem2, FALSE);
+ EnableWindow( hwndItem, FALSE);
+ endif;
+
+ case IDC_HOMEDRIVELIST:
+ ;
+ case IDC_ROOTDRIVELIST:
+ ;
+ case IDC_HOMEPATH:
+ CtrlGetText (szDlg, nId,szHomePath);
+
+ case IDC_ROOTPATH:
+ CtrlGetText (szDlg, nId,szRootPath);
+
+ default:
+ // check standard handling
+ if (SdIsStdButton( nId ) && SdDoStdButton( nId )) then
+ bDone = TRUE;
+ endif;
+ endswitch;
+
+ endwhile;
+
+ CtrlGetCurSel (szDlg, nId, szRootDrive);
+ if (CtrlGetState (szDlg, IDC_ENABLEROOT)==BUTTON_UNCHECKED) then
+ szRootDrive="None:";
+ endif;
+ CtrlGetCurSel (szDlg, nId, szHomeDrive);
+ if (CtrlGetState (szDlg, IDC_ENABLEHOME)==BUTTON_UNCHECKED) then
+ szHomeDrive="None:";
+ endif;
+ EndDialog( szDlg );
+ ReleaseDialog( szDlg );
+
+ SdUnInit( );
+
+ // record data produced by this dialog
+ if (nId==NEXT) then
+ SilentSetHomeRoot(szDlg,1,nId,szRootDrive,szRootPath,szHomeDrive,szHomePath );
+ endif;
+ ListDestroy (AvailableDrives);
+ return nId;
+
+end;
+
+
+// ---- script function prototypes -----
+
+
+ // your script function prototypes
+
+
+
///////////////////////////////////////////////////////////////////////////////
//
// MAIN PROGRAM
//
///////////////////////////////////////////////////////////////////////////////
program
+ Logit("Begin");
+ nvSection=0;
Disable( BACKGROUND );
-
if (UseDLL(SUPPORTDIR ^ SETUP_UTILS_DLL_PATH) < 0) then
ShowError(@SETUPUTILS_NOT_FOUND, SEVERE);
bInstallAborted = TRUE;
goto end_install;
endif;
-
- SetupInstall();
-
+ Logit("UseDLL1");
+ ChangeDirectory (SUPPORTDIR);
+ if (UseDLL("GetWebDLL.dll") != 0) then
+ MessageBox ("DLL failed.\n\nCouldn't load"+SUPPORTDIR^"GetWebDLL.dll", INFORMATION);
+ abort;
+ endif;
+ Logit("UseDLL2");
+
+ SetupInstall();
+ Logit("SetupInstall");
+
CheckRequirements();
-
- ParseCommandLine();
+ Logit("CheckRequirements");
+ ParseCommandLine();
+ Logit("ParseCommandLine");
+
SetupAppInfo();
-
+ Logit("SetupAppInfo");
+
LocalizeComponents();
-
+ Logit("LocalizeComponents");
+
DetectInstalledComponents();
-
+ Logit("DetectInstalledComponents");
+
// Can't upgrade, downgrade, or reinstall the light client, so if it is
// already installed, we must abort. This is because on Win9x, we can't
// move in-use files, and so we can't silently uninstall the light client,
// Install the Client
if (bFullClientSel) then
+ RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
+ Enable(LOGGING);
+ if RegDBSetKeyValueEx ("SYSTEM\\CurrentControlSet\\Services\\NetBT\\Parameters"
+ ,"SmbDeviceEnabled", REGDB_NUMBER, "0", 8) < 0 then
+ MessageBox ("RegDBCreateKeyEx failed.", SEVERE);
+ abort;
+ endif;
pApp = &appFullClient;
if (InstallApp(pApp) < 0) goto end_install;
endif;
-
+ if RegDBSetKeyValueEx("SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters","Cell", REGDB_STRING, szCellName, -1) < 0 then
+ MessageBox ("RegDBCreateKeyEx failed.", SEVERE);
+ abort;
+ endif;
// Install the Light Client
if (bLightClientSel) then
pApp = &appLightClient;
CreateStartMenuEntries();
- if (bFullClientSel || bLightClientSel || bCcSel) then
- CheckCopyCellServDB();
- endif;
+// if (bFullClientSel || bLightClientSel || bCcSel) then
+// CheckCopyCellServDB();
+// endif;
end_install:
+ UnUseDLL(SUPPORTDIR^"GetWebDLL.dll");
UnUseDLL(SUPPORTDIR ^ SETUP_UTILS_DLL_PATH);
CleanUpInstall();
//
///////////////////////////////////////////////////////////////////////////////
function ShowDialogs()
- NUMBER nResult;
+ NUMBER nResult,handle;
STRING szTargetLicense;
STRING szSourceLicense;
+ STRING sRootDrive,sHomeDrive,userID,rootPath,homePath;
+ NUMBER DefaultItem;
+ STRING szDefaultWeb,szDefaultBrowse,szDefaultInstall,szPreviousInstall;
+ STRING szResult[256],svResult;
begin
Dlg_Start:
// beginning of dialogs label
-
Dlg_SdWelcome:
nResult = DialogShowSdWelcome();
if (nResult = BACK) goto Dlg_Start;
Dlg_License:
- szTargetLicense = DOCUMENTATION_LICENSE_PATH;
- GetLicenseFilename (szSourceLicense);
- Disable( DIALOGCACHE );
- nResult = ShowLicense(szTargetLicense,szSourceLicense);
- if (nResult = 0) then
- abort;
- endif;
- Enable( DIALOGCACHE );
-
+// szTargetLicense = DOCUMENTATION_LICENSE_PATH;
+// GetLicenseFilename (szSourceLicense);
+// Logit("ShowLicense");
+// Disable( DIALOGCACHE );
+// if (MODE!=SILENTMODE) then
+// nResult = ShowLicense(szTargetLicense,szSourceLicense);
+// if (nResult = 0) then
+// abort;
+// endif;
+// Enable( DIALOGCACHE );
+// endif;
+ if (nResult = BACK) goto Dlg_Start;
Dlg_SdCompDlg:
nResult = DialogShowSdAskComponentDialog();
+ Logit("DialogShowSdAskComponentDialog");
if (nResult = BACK) goto Dlg_License;
Dlg_SdSelectFolder:
nResult = DialogShowSdSelectFolder();
- if (nResult = BACK) goto Dlg_SdCompDlg;
-
- return 0;
-
+ Logit("DialogShowSdSelectFolder");
+ if (nResult = BACK) goto Dlg_SdCompDlg;
+ if (bFullClientSel || bLightClientSel) then
+ szDefaultWeb=@CELLSERVDB_WEB;
+ szDefaultBrowse=TARGETDIR^"*";
+ szDefaultInstall=@CELLSERVDB_INSTALL;
+ szPreviousInstall=WINDIR^@CELLSERVDB_CONFIGNAME;
+ if (Is(FILE_EXISTS,szPreviousInstall)) then
+ DefaultItem=IDC_CHECK_PREVIOUSFILE;
+ else
+ DefaultItem=IDC_CHECK_INSTALL;
+ endif;
+ Dlg_SdSelectCellServDB:
+ Logit("SetCellServDB-next");
+ nResult =SetCellServDB("Select AFS Cell Data base (afsdcell.ini)"
+ ,DefaultItem
+ ,szPreviousInstall
+ ,szDefaultWeb
+ ,szDefaultBrowse
+ ,szDefaultInstall);
+ Logit("SetCellServDB");
+ if (nResult=BACK) goto Dlg_SdSelectFolder;
+ Dlg_SdSelectCellName:
+ nResult=SdShowDlgEdit1 ("Select AFS Cell Name","A valid cell name should be entered here.\nIf you don't know your cell name, you may enter one after installation using the AFS Control Center.","Enter Cell Name:", szCellName);
+ if (nResult = BACK) goto Dlg_SdSelectCellName;
+ if (Is(FILE_EXISTS, WINDIR^"afsdsbmt.ini")) then
+ Logit("AskYesNo next");
+ if (AskYesNo("Previous Drive Mapping Configuration already exist.\n\nPress Yes to keep previous configuration\nPress No to change previous configuration.",YES)=YES) then
+ return 0;
+ endif;
+ endif;
+ userID=" ";
+ GetUser(userID);
+ sRootDrive="Z:";
+ sHomeDrive="U:";
+ rootPath="/";
+ homePath = "/afs/" + szCellName + "/u/" + userID;
+ nResult=SetHomeRoot( "Home and Root Drive Assignment\nThese drives will be mapped each time AFS is connected!",sRootDrive,rootPath,sHomeDrive,homePath );
+ Logit("SetHomeRoot");
+ if (nResult = BACK) goto Dlg_SdSelectCellServDB;
+ endif;
+ Logit("ShowDialogs-done");
+ return 0;
end;
function NotUpgradable(pApp)
begin
// The 3.5 beta is not upgradable
- if ((pApp->iVer.nMajorVersion = 3) && (pApp->iVer.nMinorVersion = 5) && (pApp->iVer.nPatchLevel = 0) && (pApp->iVer.szReleaseType = RELEASE_TYPE_BETA)) then
- return TRUE;
- endif;
+// if ((pApp->iVer.nMajorVersion = 3) && (pApp->iVer.nMinorVersion = 5) && (pApp->iVer.nPatchLevel = 0) && (pApp->iVer.szReleaseType = RELEASE_TYPE_BETA)) then
+// return TRUE;
+// endif;
return FALSE;
end;
begin
Enable( CORECOMPONENTHANDLING );
+ szCellName=@CELLNAME_DEFAULT;
bInstallAborted = FALSE;
// Create list of end user selections to be displayed by DialogShowSdStartCopy()
begin
szTitle = "";
- szMsg = "";
+ szMsg = @WELCOME_MESSAGE;
nResult = SdWelcome( szTitle, szMsg );
return nResult;
ComponentSetData(MEDIA, SERVER_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
ComponentSetData(MEDIA, CC_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
ComponentSetData(MEDIA, DOCS_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
-
- ComponentSelectItem(MEDIA, SERVER_COMP_NAME, FALSE);
- ComponentSelectItem(MEDIA, CC_COMP_NAME, FALSE);
ComponentSelectItem(MEDIA, DOCS_COMP_NAME, FALSE);
+ endif;
+ ComponentSelectItem(MEDIA, SERVER_COMP_NAME, FALSE);
+ if (@CELLNAME_DEFAULT % ".") then
+ ComponentSelectItem(MEDIA, CC_COMP_NAME, FALSE);
+ else
+ ComponentSelectItem(MEDIA, CC_COMP_NAME, TRUE);
endif;
- else
+else
ComponentSetData(MEDIA, CLIENT_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
ComponentSetData(MEDIA, SERVER_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
ComponentSetData(MEDIA, CC_COMP_NAME, COMPONENT_FIELD_VISIBLE, FALSE, "");
end;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
///////////////////////////////////////////////////////////////////////////////
//
// Function: CreateStartMenuEntries
// --- include script file section ---
#include "sddialog.rul"
-
-
-
-
-
# License. For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html
-
-
!INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME)
!INCLUDE ..\..\..\config\NTMakefile.version
OUTDIR = $(DESTDIR)\WinInstall
COMPONENTS = \
INSTALL.BAT \
afsd.pif \
- cellservdb \
readme.RTF \
license.txt \
templet.reg \
$(DESTDIR)\lib\win95\pthread.dll \
$(DESTDIR)\lib\afsrpc.dll
-$(COMPONENTS)::\r
- $(DESTDIR)\bin\util_cr.exe ~ $@ "Missing $@"
+$(COMPONENTS)::
+ $(DESTDIR)\bin\util_cr.exe ~ $@
$(COPY) $@ $(DESTDIR)\WinInstall\.
!IF (EXIST(ISBUILD.MAK))
$(DEL) $(OUTDIR)\DiskIm~1\WebInstall\*
prep :
- $(DESTDIR)\bin\util_cr.exe ~ "$(DESTDIR)\WinInstall\sock.vxd" "SOCK.VXD is missing from $(DESTDIR)\WinInstall\."
- $(DESTDIR)\bin\util_cr.exe ~ "$(DESTDIR)\WinInstall\MMAP.vxd" "MMAP.VXD is missing from $(DESTDIR)\WinInstall\."
- $(DESTDIR)\bin\util_cr.exe ~ "$(DESTDIR)\WinInstall\AFSD.EXE" "AFSD.EXE is missing from $(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"
$(C2OBJ) pthread.c -DAFS_WIN95_ENV /Fopthread_95.obj
install: $(PTHR95_DLLFILE) $(PTHR_DLLFILE) $(LIBINCLUDES)
-\r
-install9x: install\r
+
+install9x: install
pthread.res: pthread.rc AFS_component_version_number.h
$(RC) $*.rc
/*DETACHED_PROCESS |*/ CREATE_NEW_CONSOLE | HIGH_PRIORITY_CLASS /*NORMAL_PRIORITY_CLASS*/,
NULL, NULL, &m_startUpInfo, &procInfo);
- LOG("AFSD Creation done - wait for notification");
if (!rc) {
- msg.Format("Error creating AFS Client Console process, Status=0x%0x", GetLastError());
+ LPVOID lpMsgBuf;
+ FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR) &lpMsgBuf,
+ 0,
+ NULL
+ );
+ msg.Format("Error creating AFS Client Console process, Status=%s.",lpMsgBuf);
return FALSE;
}
+ LOG("AFSD Creation done - wait for notification");
WPARAM wp;
CWINAFSLOADAPP->WaitForEvent(logintime*1000,&wp,&msg);
switch (wp)
+
{
case AFS_EXITCODE_NORMAL:
// extract machine name for logon
int code;
WIN32_FIND_DATA FileData;
CString dir;
+ if ((udrive==NULL) || (strlen(udrive)==0)) return TRUE;
dir.Format("%s\\*",udrive);
HANDLE hFile= FindFirstFile(
dir, // file name
szDrive[3]='*';
m_cDrive.SetCurSel(m_cDrive.FindString(0,szDrive));
}
- if (stricmp(m_sDescription,"all")) return TRUE;
- m_cPath.ModifyStyle(0,WS_DISABLED);
- m_cShare.ModifyStyle(0,WS_DISABLED);
- m_cAuto.ModifyStyle(0,WS_DISABLED);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
{
if (!*pszSubmount)
return FALSE;
- if (stricmp(pszSubmount,"all")==0)
- return FALSE; //disallow adding a share name of "all"
for ( ; *pszSubmount; ++pszSubmount)
{
if (!isprint(*pszSubmount))
HLPDIR= .\HELP
prep :
- $(DESTDIR)\bin\util_cr.exe ~ "$(MSSDK)\Include\windows.h" "MSSDK must point to SDK include headers "
+ $(DESTDIR)\bin\util_cr.exe ~ "$(MSSDK)\Include\windows.h" "Enviornment variable MSSDK must point to SDK"
+
!IF "$(AFSDEV_BUILDTYPE)" == "FREE"
/D "NDEBUG" /D "_MFC" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_WINNT" /D "_AFXDLL" /D "ENCRIPT" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
-RSC_PROJ=/l 0x409 /fo"$(INTDIR)\WinAfsLoad.res" $(AFSD_INC_MFC) /d "NDEBUG" /d "_AFXDLL"
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\WinAfsLoad.res" $(AFSD_INC_MFC) /d "AFSPRODUCT_VERSION=\"$(AFSPRODUCT_VERSION)\"" /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(INTDIR)\WinAfsLoad.bsc"
BSC32_SBRS= \
/D "_DEBUG" /D "WIN32_LEAN_AND_MEAN" /D _WIN32_IE=0x0400 /D "TESTBUTTONS" /D "_MFC" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_WINNT" /D "_AFXDLL" /D "ENCRIPT" /D "NOKNOK" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
-RSC_PROJ=/l 0x409 /fo"$(INTDIR)\WinAfsLoad.res" $(AFSD_INC_MFC) /d "_DEBUG" /d "_AFXDLL"
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\WinAfsLoad.res" $(AFSD_INC_MFC) /d "AFSPRODUCT_VERSION=\"$(AFSPRODUCT_VERSION)\"" /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(INTDIR)\WinAfsLoad.bsc"
BSC32_SBRS= \
// show userid: password: connect
CharLower(m_lpCmdLine);
m_bShowAfs=(strstr(m_lpCmdLine,"show")!=NULL);
+ m_bConnect=(strstr(m_lpCmdLine,"connect")!=NULL);
if (m_bLogWindow)
ShowLog(TRUE);
if (m_bLog)
{
cPassWord=(strstr(str,":"));
}
-// BOOL bConnect=(strstr(m_lpCmdLine,"connect")!=NULL);
+ m_bNoID=(strstr(m_lpCmdLine,"noid")!=NULL);
if (m_hAfsLoadFinish) // SOME REASON THE WINDOW WAS NOT SHUT DOWN, SO LETES KILL IT
{
m_wParam=wp;
m_sMsg=msg;
SetEvent(CMyUIThread::m_hEventThreadKilled);
- m_uNotifyMessage=0;
+ m_uNntifyMessage=0;
break;
default:
break;
UINT m_uEvent;
UINT m_uNotifyMessage;
WPARAM m_wParam;
-#if NOKNOK
- BOOL m_bNokNok;
-#endif
+ BOOL m_bNoID;
//{{AFX_MSG(CWinAfsLoadApp)
//}}AFX_MSG
-//generated resource script.
+//Microsoft Developer Studio generated resource script.
//
-/* Copyright 2000, International Business Machines Corporation and others.
- All Rights Reserved.
-
- This software has been released under the terms of the IBM Public
- License. For details, see the LICENSE file in the top-level source
- directory or online at http://www.openafs.org/dl/license10.html
-*/
-
#include "resource.h"
// Generated Help ID header file
#define APSTUDIO_HIDDEN_SYMBOLS
+//#include "resource.hm"
#undef APSTUDIO_HIDDEN_SYMBOLS
+
#define APSTUDIO_READONLY_SYMBOLS
+// Microsoft Developer Studio generated Help ID include file.
+// Used by WinAfsLoad.rc
+//
#define HIDC_STATIC 0x80fcffff // IDD_SETTINGS
/////////////////////////////////////////////////////////////////////////////
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n"
+ "#include ""res\\WinAfsLoad.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#endif\r\n"
"\0"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
- PRODUCTVERSION 2,0,0,0
+ PRODUCTVERSION 1,0,4,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
VALUE "OriginalFilename", "WinAfsLoad.EXE\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "WinAfsLoad Application\0"
- VALUE "ProductVersion", "2, 0, 0, 0\0"
+ VALUE "ProductVersion", AFSPRODUCT_VERSION,"\0"
VALUE "SpecialBuild", "\0"
END
END
IDH_ADD "HELP ADD"
IDH_CHANGE "Help Change"
IDH_MAIN "Help Main"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
IDM_CLEAR "Clear Window"
END
#pragma code_page(1252)
#endif //_WIN32
#include "afxres.rc" // Standard components
+//#include "res\WinAfsLoad.rc2" // non-Microsoft Visual C++ edited resources
#endif
/////////////////////////////////////////////////////////////////////////////
LOG("ADVAPI32 %d.%d",(vernum>>16) & 0xff,vernum & 0xff);
m_pEncript = (CEncript *)new CEncript(this);
+
// initiallze AFS and setup Progress display
if (!m_cAfs.Init(this,msg))
HandleError(msg);
EnableToolTips(TRUE);
m_bServiceIsActive=FALSE;
- SetWindowText(AFSTITLE);
+ // Obtain Version String
+ CRegkey key(HKEY_LOCAL_MACHINE,"Software\\Open AFS\\AFS Control Center","CurrentVersion");
+ key.GetString("VersionString",m_VersionString,128);
+ msg.Format("%s %s",AFSTITLE,m_VersionString);
+ SetWindowText(msg);
UpdateData(TRUE);
m_sComputername=compName;
m_sMountDisplay.Format("Connected Drives on Computer:%s",compName);
m_sUsername="";
- m_bHomepath=FALSE;
CRect rect;
GetWindowRect(&m_OriginalRect);
m_cOptionLine.GetWindowRect(&rect);
}
CHAR pLoginName[UNLEN + 1];
size=UNLEN;
- if (GetUserName(pLoginName,&size))
- m_sLoginName=pLoginName;
- else
- m_sLoginName="Bozo";
- CString sUser,sPass;
- RegPassword(sUser,sPass,TRUE);
- if ((m_sUsername=="") || (m_sLoginName.IsEmpty()))
- {
- m_sUsername=sUser;
- }
- if ((m_sPassword=="") || (m_sPassword.IsEmpty()))
+ if (CWINAFSLOADAPP->m_bNoID)
{
- m_sPassword=sPass;
+ CWnd *w=GetDlgItem(IDC_USERNAME);
+ w->EnableWindow(FALSE);
+ w=GetDlgItem(IDC_PASSWORD);
+ w->EnableWindow(FALSE);
+ w=GetDlgItem(IDC_SAVEUSERNAME);
+ w->EnableWindow(FALSE);
+ } else {
+ if (GetUserName(pLoginName,&size))
+ {
+ m_sLoginName=pLoginName;
+ } else
+ m_sLoginName="Bozo";
+ CString sUser,sPass;
+ RegPassword(sUser,sPass,TRUE);
+ if (m_sUsername=="")
+ {
+ m_sUsername=sUser;
+ }
+ if ((m_sUsername=="") && (m_sLoginName!="Bozo"))
+ {
+ m_sUsername=m_sLoginName;
+ }
+ if ((m_sPassword=="") || (m_sPassword.IsEmpty()))
+ {
+ m_sPassword=sPass;
+ }
+ if (m_sPassword.IsEmpty())
+ {
+ m_cSaveUsername.SetCheck(FALSE);
+ RegLastUser(m_sUsername,TRUE);
+ } else
+ m_cSaveUsername.SetCheck(TRUE);
}
-
- if (m_sPassword.IsEmpty())
- {
- m_cSaveUsername.SetCheck(FALSE);
- RegLastUser(m_sUsername,TRUE);
- } else
- m_cSaveUsername.SetCheck(TRUE);
-
// Initialize mount control list
m_pImagelist = new CImageList();
BYTE *lpData=(BYTE *)new BYTE[rc];
if (GetFileVersionInfo(wdir,wHandle,rc,lpData))
{
- VS_FIXEDFILEINFO *pver;
UINT len;
- if (VerQueryValue(lpData,"\\",(PVOID *)&pver,&len))
- {
- dlgAbout.m_sVersion.Format("WinAFSload Version %d.%d.%d",(pver->dwProductVersionMS>>16) &0xff ,pver->dwProductVersionMS & 0xff,(pver->dwProductVersionLS>>16) &0xff );
+ struct TRANSLATION {
+ WORD langID; // language ID
+ WORD charset; // character set (code page)
+ };
+ CString msg;
+ TRANSLATION mTrans,* pTrans;
+ if (VerQueryValue(lpData,
+ "\\VarFileInfo\\Translation", (PVOID *)&pTrans, &len) && len >= 4) {
+ mTrans = *pTrans;
+ TRACE("code page = %d\n", mTrans.charset);
+ }
+ LPCTSTR pVal;
+ UINT iLenVal;
+ CString query;
+ query.Format(_T("\\StringFileInfo\\%04x%04x\\%s"),
+ mTrans.langID,
+ mTrans.charset,
+ _T("ProductVersion"));
+ if (VerQueryValue(lpData, (LPTSTR)(LPCTSTR)query,
+ (LPVOID*)&pVal, &iLenVal)) {
+// dlgAbout.m_sVersion.Format("WinAFSload Version %s",pVal);
}
- }
+ }
delete lpData;
}
dlgAbout.DoModal();
return;
}
CCancel cancel(m_bConnect,FALSE); //clear m_bConnect when connection done
- if (m_sUsername.IsEmpty() || m_sPassword.IsEmpty())
+ if ( // if username is present then must have password
+ IsGetTokens()
+ && (m_sPassword=="")
+ )
{
- HandleError("You must enter a username and password!");
- if (m_sUsername.IsEmpty()) m_cUsername.SetFocus();
- else m_cPassword.SetFocus();
+ HandleError("You must enter a password!");
+ m_cPassword.SetFocus();
return;
}
CProgress progress(this,7);
progress.Next();
if (!m_cAfs.Create(msg,m_sComputername,m_procInfo))
{
+ progress.Finish();
HandleError(msg);
m_procInfo.hThread=0;
return;
// CWINAFSLOADAPP->m_sMsg contains the host name used for login
LOG("AFS Client Console started successfully [%s].",(const char *)m_sComputername);
CString sDrive;
- // lets find the All
+
CString sKey;
+ int iMounted=-1;
for (int iItem=0;iItem<m_cMountlist.GetItemCount();iItem++)
{
sKey = m_cMountlist.GetItemText(iItem,COLSHARE);
- if (stricmp(sKey,"all")!=0) continue;
+ if (stricmp(sKey,"all")!=0) continue; // lets find the All first
CString sAuto(m_cMountlist.GetItemText(iItem,COLAUTO));
if (sAuto!="*")
continue;
{
m_cMountlist.SetCheck(iItem,TRUE);
AddMenu(sDrive,sKey);
+ iMounted=iItem;
} else {
CString msg2;
m_cAfs.Shutdown(msg2);
m_procInfo.hThread=0;
msg2.Format("Connect can't continue: %s",msg);
+ progress.Finish();
HandleError(msg2);
return;
}
break;
}
- if (stricmp(sKey,"all")!=0){
- m_cAfs.Shutdown(msg);
- m_procInfo.hThread=0;
- msg="Connect can't continue, 'all' path not defined";
- HandleError(msg);
- return;
+ if (iMounted<0){
+ // Scan for any other connection
+ for (int iItem=0;iItem<m_cMountlist.GetItemCount();iItem++)
+ {
+ CString sAuto(m_cMountlist.GetItemText(iItem,COLAUTO));
+ if (sAuto!="*")
+ continue;
+ sDrive=m_cMountlist.GetItemText(iItem,COLDRIVE);
+ LOG("Connect %s %s",sDrive,sKey);
+ if (m_cAfs.Mount(msg,sDrive,sKey))
+ {
+ m_cMountlist.SetCheck(iItem,TRUE);
+ AddMenu(sDrive,sKey);
+ iMounted=iItem;
+ } else {
+ CString msg2;
+ m_cAfs.Shutdown(msg2);
+ m_procInfo.hThread=0;
+ msg2.Format("Connect can't continue: %s",msg);
+ progress.Finish();
+ HandleError(msg2);
+ return;
+ }
+ break;
+ }
}
progress.Next();
- if (!m_cAfs.Authencate(msg,m_sUsername,m_sPassword))
+ if (IsGetTokens())
{
- CString msg2;
- m_cAfs.Dismount(msg2,sDrive,TRUE);
- m_cMountlist.SetCheck(iItem,FALSE);
- RemoveMenu(sDrive);
- m_cAfs.Shutdown(msg2);
- m_procInfo.hThread=0;
- HandleError(msg);
- return;
+#if 0
+ if (iMounted<0) //have we mounted at least one drive
+ {
+ m_cAfs.Shutdown(msg);
+ m_procInfo.hThread=0;
+ msg="Connect can't continue, mountable drive not defined";
+ progress.Finish();
+ HandleError(msg);
+ return;
+ }
+#endif
+ if (!m_cAfs.Authencate(msg,m_sUsername,m_sPassword))
+ {
+ CString msg2;
+ m_cAfs.Dismount(msg2,sDrive,TRUE);
+ m_cMountlist.SetCheck(iItem,FALSE);
+ RemoveMenu(sDrive);
+ m_cAfs.Shutdown(msg2);
+ m_procInfo.hThread=0;
+ progress.Finish();
+ HandleError(msg);
+ return;
+ }
}
progress.Next();
// scan through the list for any additional items to connect
for (iItem=0;iItem<m_cMountlist.GetItemCount();iItem++)
{
CString sKey(m_cMountlist.GetItemText(iItem,COLSHARE));
- if (stricmp(sKey,"all")==0) continue;
+ if (iItem==iMounted) continue;
CString sAuto(m_cMountlist.GetItemText(iItem,COLAUTO));
if (sAuto!="*")
continue;
m_cConnect.Invalidate();
m_cCancel.SetWindowText("Cancel");
m_cCancel.Invalidate();
- m_cAuthenicate.ModifyStyle(WS_DISABLED,0);
- m_cAuthenicate.Invalidate();
+ if (!CWINAFSLOADAPP->m_bNoID)
+ {
+ m_cAuthenicate.ModifyStyle(WS_DISABLED,0);
+ if (IsGetTokens())
+ m_cAuthenicate.SetWindowText("ReAuthenicate");
+ else //tokens are not gotten; allow authenication
+ m_cAuthenicate.SetWindowText("Authenicate");
+ m_cAuthenicate.Invalidate();
+ }
m_trayIcon.SetConnectState(0);
return;
}
OnSysCommand(IDM_EXPLORERAFS+64, 0);
}
-#define MAXKEY (SHARENAMESIZE+1)*MAXSHARES
+#define MAXDRIVESIZE (SHARENAMESIZE+5)*MAXSHARES
+
BOOL CWinAfsLoadDlg::ProfileData(BOOL put)
{
CString dINI;
dptr=dblock+dused;
wsprintf(dptr,"%s=%s%s",sKey,sAuto,sDrive);
dused+=len;
- if (stricmp(sKey,"all")==0) continue; //skip 'all' output
len=sKey.GetLength()+sPath.GetLength()+2;
if (sused+len>=scur)
sblock=(char *)realloc(sblock,(scur+=BLOCKSIZE));
WritePrivateProfileSection("AFS Drivemounts",dblock,dINI);
delete dblock;
delete sblock;
- } else {
- char sKey[MAXKEY+2];
+ } else { //get
+ char sShare[SHARENAMESIZE+1];
CHAR sPath[MAX_PATH+1];
+ CHAR sDriveMount[MAXDRIVESIZE+2];
CHAR sDrive[DRIVESIZE+1];
CHAR sAuto[AUTOSIZE+1];
strcpy(sAuto," ");
- int len;
CString path;
- int keylen=GetPrivateProfileString("AFS Submounts", NULL, "", sKey, MAXKEY,tINI);
- PCHAR pkey=sKey;
- if (keylen>=MAXKEY)
- {
- CString msg;
- msg.Format("Profile String Error - Too many entries (%d)",MAXSHARES);
- HandleError(msg,TRUE);
- return FALSE;
- }
- // lets scan for all and home first, we want to place them
+ // lets scan for all and home first, we want to place them first
//mode: 0=look for all, 1=look for home, 2=finish the rest
for(int mode=0;mode<3;mode++)
{
- while (keylen>1)
+ int drivelen=GetPrivateProfileString("AFS Drivemounts", NULL, "", sDriveMount, MAXDRIVESIZE,dINI);
+ if (drivelen>=MAXDRIVESIZE)
{
- switch (mode)
+ CString msg;
+ msg.Format("Profile String Error - Too many entries (%d)",MAXSHARES);
+ HandleError(msg,TRUE);
+ return FALSE;
+ }
+ PCHAR pDrivekey=sDriveMount;
+ while (drivelen>1)
+ {
+ if ((strlen(pDrivekey)==0) || (strlen(pDrivekey)>SHARENAMESIZE))
{
- case 0: //we skip looking for all
- break;
- case 1:
- if (stricmp(pkey,"home")!=0)
- {
- keylen-=(strlen(pkey)+1);
- pkey+=(strlen(pkey)+1);
- continue;
- }
- break;
- default:
- if((stricmp(pkey,"all")==0) || (stricmp(pkey,"home")==0))
- {
- keylen-=(strlen(pkey)+1);
- pkey+=(strlen(pkey)+1);
- continue;
- }
+ HandleError("Profile String Error - AFS Drivemounts - Share Name",FALSE);
+ ret=FALSE;
break;
}
- if (strlen(pkey)==0)
+ strcpy(sShare,pDrivekey);
+ if (GetPrivateProfileString("AFS Drivemounts", sShare, "", sDrive, DRIVESIZE,dINI)==0)
{
- HandleError("Profile String Error - Empty key",FALSE);
+ HandleError("Profile String Error - AFS Drivemounts - Drive Name",FALSE);
ret=FALSE;
- keylen-=(strlen(pkey)+1);
- continue;
- }
- if (mode!=0)
- {
- if ((len=GetPrivateProfileString("AFS Submounts", pkey, "", sPath, MAX_PATH,tINI))==0)
- {
- CString msg;
- msg.Format("Profile String Error on Submount key:%s",pkey);
- HandleError(msg,FALSE);
- ret=FALSE;
- keylen-=(strlen(pkey)+1);
- pkey+=(strlen(pkey)+1);
- continue;
- }
- } else {
- strcpy(sPath,"\\");
- pkey="all";
- }
- *sDrive=0;
- if ((len=GetPrivateProfileString("AFS Drivemounts", pkey, "", sDrive, DRIVESIZE,dINI))==0)
- {
- if ((stricmp("all",pkey)==0)||(stricmp("home",pkey)==0))
- {// allow for no drive id on home
- if (stricmp("home",pkey)==0)
- strcpy(sDrive,"*U");
- else
- strcpy(sDrive,"*Z");
- } else {
- CString msg;
- msg.Format("Profile String Error on Path key:%s",pkey);
- HandleError(msg,TRUE);
- ret=FALSE;
- keylen-=(strlen(pkey)+1);
- pkey+=(strlen(pkey)+1);
- continue;
- }
+ break;
}
if (sDrive[0]=='*') //test for leading *
{
} else
strcpy(sAuto," ");
sDrive[1]=0; //force to be single character
- if (stricmp("home",pkey)==0) //force auto connect for home and all
- {
- m_bHomepath=TRUE;
- }
strupr(sDrive);
- if ((strlen(sDrive)!=1)||(strspn(sDrive,"ABCDEFGHIJKLMNOPQRSTUVWXYZ")==0))
+ if (strspn(sDrive,"DEFGHIJKLMNOPQRSTUVWXYZ")==0)
{
- if (stricmp("home",pkey)==0)
- strcpy(sDrive,"U");
- else if (stricmp("all",pkey)==0)
- strcpy(sDrive,"Z");
- else
- strcpy(sDrive,"");
+ HandleError("Profile String Error - AFS Drivemounts - Drive Letter",FALSE);
+ ret=FALSE;
+ break;
}
strcat(sDrive,":");
- if (mode==0)
- strcpy(sAuto,"*"); //no matter how it turns out 'all' is forced on.
- AddToList(sDrive,sPath,pkey,sAuto);
- if (mode<2) break;
- keylen-=(strlen(pkey)+1);
- pkey+=(strlen(pkey)+1);
- }
- switch (mode)
- {
- case 0:
- if (keylen<=1) //we never found "all"
- AddToList("Z:","\\","all","*");
- keylen=GetPrivateProfileString("AFS Submounts", NULL, "", sKey, MAXKEY,tINI);
- pkey=sKey;
- break;
- case 1:
- if (keylen<=1) //we never found "home"
+ switch (mode)
+ {
+ case 0:
+ if (stricmp("all",sShare)!=0) break;
+ if (GetPrivateProfileString("AFS Submounts", sShare, "", sPath, MAX_PATH,tINI)==0)
+ {
+ strcpy(sPath,"/"); //none defined
+ }
+ AddToList(sDrive,sPath,sShare,sAuto);
+ drivelen=0;
+ continue;
+
+ case 1:
+ if (stricmp("home",sShare)!=0) break;
+ if (GetPrivateProfileString("AFS Submounts", sShare, "", sPath, MAX_PATH,tINI)==0)
+ {
+ HandleError("Profile String Error - AFS Drivemounts - Share Name",FALSE);
+ ret=FALSE;
+ break;
+ }
+ AddToList(sDrive,sPath,sShare,sAuto);
+ drivelen=0;
+ continue;
+ default:
+ if ((stricmp("all",sShare)==0)|| (stricmp("home",sShare)==0)) break;
+ if (GetPrivateProfileString("AFS Submounts", sShare, "", sPath, MAX_PATH,tINI)==0)
+ {
+ HandleError("Profile String Error - AFS Drivemounts - Share Name",FALSE);
+ ret=FALSE;
+ break;
+ }
+ AddToList(sDrive,sPath,sShare,sAuto);
break;
- keylen=GetPrivateProfileString("AFS Submounts", NULL, "", sKey, MAXKEY,tINI);
- pkey=sKey;
- break;
- default:
- break;
+ }
+ drivelen-=(strlen(pDrivekey)+1);
+ pDrivekey+=(strlen(pDrivekey)+1);
}
}
+
}
return ret;
}
HandleError("You cannot remove Item from the list while connected!");
continue;
}
+#if 0
if (stricmp(m_cMountlist.GetItemText(nItem,COLSHARE),"all")==0)
{
HandleError("You cannot remove 'All' Item from the list!");
continue;
}
+#endif
m_cMountlist.DeleteItem(nItem);
}
ProfileData(TRUE);
m_nShown=0;
m_cAuthWarn.ShowWindow(SW_HIDE);
LOG("Re-Authenication");
+ if (m_sUsername=="")
+ {
+ HandleError("You must enter a user name!");
+ m_cUsername.SetFocus();
+ return;
+ }
+ if (m_sPassword=="")
+ {
+ HandleError("You must enter a password!");
+ m_cPassword.SetFocus();
+ return;
+ }
if (!m_cAfs.Authencate(msg,m_sUsername,m_sPassword))
{
HandleError(msg);
return;
}
+ m_cAuthenicate.SetWindowText("ReAuthenicate");
+ m_cAuthenicate.Invalidate();
if (!m_cSaveUsername.GetCheck())
{
m_sPassword.Empty();
UpdateData(FALSE);
}
+
}
void OnShowAddMenus();
LRESULT OnNotifyReturn(WPARAM wParam, LPARAM lParam);
LRESULT OnAfsEvent(WPARAM wParam, LPARAM lParam);
+ BOOL IsGetTokens(){return (!CWINAFSLOADAPP->m_bNoID) && (m_sUsername!="");}
// Dialog Data
//{{AFX_DATA(CWinAfsLoadDlg)
// Implementation
protected:
+ CString m_VersionString;
CAfs m_cAfs;
CTrayIcon m_trayIcon; // my tray icon
HICON m_hIcon;
#define DOSTITLEFINISH "Finished - AFS Client Console"
#define APPTITLE "AFS"
#define APPTITLEFINISH "Finished - AFSD"
-#ifdef _DEBUG
-#define CMDLINE "AFSD.PIF -startup"
-//#define CMDLINE ".//debug//AFSD.EXE -startup"
-#else
+#ifdef DEV_IDE
+#ifdef _DEBUG
#define CMDLINE "AFSD.EXE -startup"
-//#define CMDLINE "AFSD.PIF -startup"
-//#define CMDLINE "AFSD.EXE"
+#else
+#define CMDLINE ".//release//AFSD.EXE -startup"
+#endif
+#else
+#define CMDLINE "AFSD.PIF -startup"
#endif
#ifndef __CAFS__
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_file.c,v 1.1.1.4 2001/07/14 22:19:32 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_file.c,v 1.1.1.5 2001/09/11 14:24:51 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
}
if (!afs_osicred_initialized) {
/* valid for alpha_osf, SunOS, Ultrix */
- bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
+ memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_timeout.c,v 1.1.1.4 2001/07/14 22:19:35 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_timeout.c,v 1.1.1.5 2001/09/11 14:24:52 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
break;
}
else {
- bzero(tos, sizeof(struct tos));
+ memset(tos, 0, sizeof(struct tos));
}
/* The trb and the tos were both allocated. */
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_vnodeops.c,v 1.1.1.4 2001/07/14 22:19:35 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_vnodeops.c,v 1.1.1.5 2001/09/11 14:24:53 hartmans Exp $");
#include "../h/systm.h"
#include "../h/types.h"
AFS_STATCNT(afs_gn_fclear);
if (!fclear_init) {
- bzero(zero_buffer, PAGESIZE);
+ memset(zero_buffer, 0, PAGESIZE);
fclear_init = 1;
}
/*
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_file.c,v 1.1.1.3 2001/07/14 22:20:00 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_file.c,v 1.1.1.4 2001/09/11 14:24:53 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
}
if (!afs_osicred_initialized) {
/* valid for alpha_osf, SunOS, Ultrix */
- bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
+ memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
afs_osi_cred.cr_ref++;
afs_osi_cred.cr_ngroups=1;
afs_osicred_initialized = 1;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_module.c,v 1.1.1.3 2001/07/14 22:20:01 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_module.c,v 1.1.1.4 2001/09/11 14:24:54 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
extern int ioctl();
extern int setgroups();
+extern int maxvfsconf;
kern_return_t afs_modload(struct kmod_info *ki, void *data)
{
if (sysent[AFS_SYSCALL].sy_call != nosys) {
printf("AFS_SYSCALL in use. aborting\n");
return KERN_FAILURE;
}
- bzero(&afs_vfsconf, sizeof(struct vfsconf));
+ memset(&afs_vfsconf, 0, sizeof(struct vfsconf));
strcpy(afs_vfsconf.vfc_name, "afs");
afs_vfsconf.vfc_vfsops=&afs_vfsops;
- afs_vfsconf.vfc_typenum=VT_AFS;
+ afs_vfsconf.vfc_typenum=maxvfsconf++;/* oddly not VT_AFS */
afs_vfsconf.vfc_flags=MNT_NODEV;
if (vfsconf_add(&afs_vfsconf)) {
printf("AFS: vfsconf_add failed. aborting\n");
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vfsops.c,v 1.1.1.3 2001/07/14 22:20:02 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vfsops.c,v 1.1.1.4 2001/09/11 14:24:55 hartmans Exp $");
#include <afs/sysincludes.h> /* Standard vendor system headers */
#include <afs/afsincludes.h> /* Afs-based standard headers */
mp->mnt_stat.f_iosize=8192;
(void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN-1, &size);
- bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
- bzero(mp->mnt_stat.f_mntfromname, MNAMELEN);
+ memset(mp->mnt_stat.f_mntonname + size, 0, MNAMELEN - size);
+ memset(mp->mnt_stat.f_mntfromname, 0, MNAMELEN);
strcpy(mp->mnt_stat.f_mntfromname, "AFS");
/* null terminated string "AFS" will fit, just leave it be. */
strcpy(mp->mnt_stat.f_fstypename, "afs");
abp->f_fsid.val[1] = mp->mnt_stat.f_fsid.val[1];
if (abp != &mp->mnt_stat) {
abp->f_type = mp->mnt_vfc->vfc_typenum;
- bcopy((caddr_t)mp->mnt_stat.f_mntonname,
- (caddr_t)&abp->f_mntonname[0], MNAMELEN);
- bcopy((caddr_t)mp->mnt_stat.f_mntfromname,
- (caddr_t)&abp->f_mntfromname[0], MNAMELEN);
+ memcpy((caddr_t)&abp->f_mntonname[0], (caddr_t)mp->mnt_stat.f_mntonname, MNAMELEN);
+ memcpy((caddr_t)&abp->f_mntfromname[0], (caddr_t)mp->mnt_stat.f_mntfromname, MNAMELEN);
}
AFS_GUNLOCK();
MALLOC(afs_vnodeop_p, PFI *, vfs_opv_numops*sizeof(PFI), M_TEMP, M_WAITOK);
- bzero (afs_vnodeop_p, vfs_opv_numops*sizeof(PFI));
+ memset(afs_vnodeop_p, 0, vfs_opv_numops*sizeof(PFI));
opv_desc_vector = afs_vnodeop_p;
for (j=0; afs_vnodeop_opv_desc.opv_desc_ops[j].opve_op; j++) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.1.1.3 2001/07/14 22:20:01 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.1.1.4 2001/09/11 14:24:55 hartmans Exp $");
#include <afs/sysincludes.h> /* Standard vendor system headers */
#include <afs/afsincludes.h> /* Afs-based standard headers */
struct componentname *cnp = ap->a_cnp; \
char *name; \
MALLOC(name, char *, cnp->cn_namelen+1, M_TEMP, M_WAITOK); \
- bcopy(cnp->cn_nameptr, name, cnp->cn_namelen); \
+ memcpy(name, cnp->cn_nameptr, cnp->cn_namelen); \
name[cnp->cn_namelen] = '\0'
#define DROPNAME() FREE(name, M_TEMP)
if ((f_offset < tvc->m.Length) && (f_offset + size) > tvc->m.Length) {
size_t io = tvc->m.Length - f_offset;
- bzero((caddr_t)(ioaddr + pl_offset + io), size - io);
+ memset((caddr_t)(ioaddr + pl_offset + io), 0, size - io);
}
}
#endif /* ] USV */
goto abortit;
MALLOC(fname, char *, fcnp->cn_namelen+1, M_TEMP, M_WAITOK);
- bcopy(fcnp->cn_nameptr, fname, fcnp->cn_namelen);
+ memcpy(fname, fcnp->cn_nameptr, fcnp->cn_namelen);
fname[fcnp->cn_namelen] = '\0';
MALLOC(tname, char *, tcnp->cn_namelen+1, M_TEMP, M_WAITOK);
- bcopy(tcnp->cn_nameptr, tname, tcnp->cn_namelen);
+ memcpy(tname, tcnp->cn_nameptr, tcnp->cn_namelen);
tname[tcnp->cn_namelen] = '\0';
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_file.c,v 1.1.1.5 2001/07/14 22:19:36 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_file.c,v 1.1.1.6 2001/09/11 14:24:56 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
struct utask_nd utnd = { NULL, NULL };
struct vattr attr;
- bzero(&nd, sizeof(nd));
+ memset(&nd, 0, sizeof(nd));
ndp->ni_utnd = &utnd;
ndp->ni_nameiop = LOOKUP;
ndp->ni_cred = &afs_osi_cred;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_vfsops.c,v 1.1.1.5 2001/07/14 22:19:38 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_vfsops.c,v 1.1.1.6 2001/09/11 14:24:57 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
if ( !afsp->m_stat.f_mntonname || !afsp->m_stat.f_mntfromname)
panic("malloc failure in afs_mount\n");
- bzero(afsp->m_stat.f_mntonname, MNAMELEN);
- bzero(afsp->m_stat.f_mntfromname, MNAMELEN);
+ memset(afsp->m_stat.f_mntonname, 0, MNAMELEN);
+ memset(afsp->m_stat.f_mntfromname, 0, MNAMELEN);
AFS_COPYINSTR(path, (caddr_t)afsp->m_stat.f_mntonname, MNAMELEN, &size, code);
- bcopy("AFS", afsp->m_stat.f_mntfromname, 4);
+ memcpy(afsp->m_stat.f_mntfromname, "AFS", 4);
AFS_GUNLOCK();
(void) mp_afs_statfs(afsp);
AFS_GLOCK();
fidp->fid_len = AFS_SIZEOFSMALLFID;
if (afs_NFSRootOnly) {
if (rootvp) {
- bcopy((caddr_t)&Sfid, fidp->fid_data, AFS_FIDDATASIZE);
+ memcpy(fidp->fid_data, (caddr_t)&Sfid, AFS_FIDDATASIZE);
} else {
- bcopy((caddr_t)addr, fidp->fid_data, AFS_FIDDATASIZE);
+ memcpy(fidp->fid_data, (caddr_t)addr, AFS_FIDDATASIZE);
}
} else {
- bcopy((caddr_t)&Sfid, fidp->fid_data, AFS_FIDDATASIZE);
+ memcpy(fidp->fid_data, (caddr_t)&Sfid, AFS_FIDDATASIZE);
}
AFS_GUNLOCK();
return 0;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_file.c,v 1.1.1.3 2001/07/14 22:20:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_file.c,v 1.1.1.4 2001/09/11 14:24:57 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
}
if (!afs_osicred_initialized) {
/* valid for alpha_osf, SunOS, Ultrix */
- bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
+ memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
afs_osi_cred.cr_ref++;
afs_osicred_initialized = 1;
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_vfsops.c,v 1.1.1.3 2001/07/14 22:20:05 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_vfsops.c,v 1.1.1.4 2001/09/11 14:24:58 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
if ( !afsp->m_stat.f_mntonname || !afsp->m_stat.f_mntfromname)
panic("malloc failure in afs_mount\n");
- bzero(afsp->m_stat.f_mntonname, MNAMELEN);
- bzero(afsp->m_stat.f_mntfromname, MNAMELEN);
+ memset(afsp->m_stat.f_mntonname, 0, MNAMELEN);
+ memset(afsp->m_stat.f_mntfromname, 0, MNAMELEN);
AFS_COPYINSTR(path, (caddr_t)afsp->m_stat.f_mntonname, MNAMELEN, &size, code);
- bcopy("AFS", afsp->m_stat.f_mntfromname, 4);
+ memcpy(afsp->m_stat.f_mntfromname, "AFS", 4);
AFS_GUNLOCK();
(void) mp_afs_statfs(afsp);
AFS_GLOCK();
fidp->fid_len = AFS_SIZEOFSMALLFID;
if (afs_NFSRootOnly) {
if (rootvp) {
- bcopy((caddr_t)&Sfid, fidp->fid_data, AFS_FIDDATASIZE);
+ memcpy(fidp->fid_data, (caddr_t)&Sfid, AFS_FIDDATASIZE);
} else {
- bcopy((caddr_t)addr, fidp->fid_data, AFS_FIDDATASIZE);
+ memcpy(fidp->fid_data, (caddr_t)addr, AFS_FIDDATASIZE);
}
} else {
- bcopy((caddr_t)&Sfid, fidp->fid_data, AFS_FIDDATASIZE);
+ memcpy(fidp->fid_data, (caddr_t)&Sfid, AFS_FIDDATASIZE);
}
AFS_GUNLOCK();
return 0;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/HPUX/osi_file.c,v 1.1.1.4 2001/07/14 22:19:38 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/HPUX/osi_file.c,v 1.1.1.5 2001/09/11 14:24:59 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
}
if (!afs_osicred_initialized) {
/* valid for alpha_osf, SunOS, Ultrix */
- bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
+ memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/HPUX/osi_vnodeops.c,v 1.1.1.4 2001/07/14 22:19:40 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/HPUX/osi_vnodeops.c,v 1.1.1.5 2001/09/11 14:25:01 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
return (len);
ml = MIN(len, m->m_len - off);
- bcopy(mtod(m, caddr_t)+off, cp, (u_int)ml);
+ memcpy(cp, mtod(m, caddr_t)+off, (u_int)ml);
cp += ml;
len -= ml;
m = m->m_next;
while (len && m) {
ml = m->m_len;
- bcopy(mtod(m, caddr_t), cp, (u_int)ml);
+ memcpy(cp, mtod(m, caddr_t), (u_int)ml);
cp += ml;
len -= ml;
m = m->m_next;
filevp = VM_GET_PAGEOUT_VNODE(&vm_info); /* always page out to back store */
VASSERT(filevp != NULL);
- bzero((caddr_t)&args, sizeof(fsdata_t));
+ memset((caddr_t)&args, 0, sizeof(fsdata_t));
args.remote_down = 0; /* assume remote file servers are up */
args.remote = 1; /* we are remote */
args.bsize = 0; /* filled up later by afs_vm_checkpage() */
if ((caddr_t) odp + odp->d_reclen > obufend)
break;
/* record offset *after* we're sure to use this entry */
- bcopy((char *)&idp->__d_off, (char *)&tmp_offset, sizeof tmp_offset);
+ memcpy((char *)&tmp_offset, (char *)&idp->__d_off, sizeof tmp_offset);
offset = tmp_offset;
}
(caddr_t)idp < ibufend;
idp = (struct __dirent32 *) ((caddr_t) idp + idp->__d_reclen),
odp = (struct __dirent64 *) ((caddr_t) odp + odp->__d_reclen)) {
- bcopy((char *)&idp->__d_off, (char *)&odp->__d_off, sizeof odp->__d_off);
+ memcpy((char *)&odp->__d_off, (char *)&idp->__d_off, sizeof odp->__d_off);
odp->__d_ino = idp->__d_ino;
odp->__d_namlen = idp->__d_namlen;
(void) strcpy(odp->__d_name, idp->__d_name);
osi_Panic("afs: cannot create SEMA Hashtable\n");
/* initialize the hash table and associated locks */
- bzero((char *)hashTable, sizeOfHashTable * sizeof(Bucket ));
+ memset((char *)hashTable, 0, sizeOfHashTable * sizeof(Bucket ));
for ( i=0;i < sizeOfHashTable; i ++)
hashLockInit( hashTable[i].lock);
hashLockInit(afsHashLock);
osi_Panic("afs: SEMA Hashtable cannot create new entry\n");
/* create new entry */
ptr->key = key;
- bzero((char *)&ptr->element, sizeof(ptr->element));
+ memset((char *)&ptr->element, 0, sizeof(ptr->element));
ptr->refCnt = 1; /* this guy */
/* insert new entry in bucket */
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_file.c,v 1.1.1.5 2001/07/14 22:19:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_file.c,v 1.1.1.6 2001/09/11 14:25:01 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
}
if (!afs_osicred_initialized) {
/* valid for alpha_osf, SunOS, Ultrix */
- bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
+ memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_groups.c,v 1.1.1.4 2001/07/14 22:19:41 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_groups.c,v 1.1.1.5 2001/09/11 14:25:01 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
return EINVAL; /* sorry */
cr = crdup(OSI_GET_CURRENT_CRED()); /* we will replace all the groups. */
- bzero((char*)&cr->cr_groups, ngroups_max * sizeof(gid_t));
+ memset((char*)&cr->cr_groups, 0, ngroups_max * sizeof(gid_t));
/* Now cobble the new groups list together. */
new = 0;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_inode.c,v 1.1.1.5 2001/07/14 22:19:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_inode.c,v 1.1.1.6 2001/09/11 14:25:02 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
}
else
createdDir = 1;
- bzero((char*)&dattr, sizeof(dattr));
+ memset((char*)&dattr, 0, sizeof(dattr));
dattr.atd_version = AFS_XFS_ATD_VERS;
dattr.atd_volume = rw_vno;
AFS_VOP_ATTR_SET(dvp, AFS_XFS_DATTR, (char*)&dattr,
return code;
}
- bzero((char*)&attrs, sizeof(attrs));
+ memset((char*)&attrs, 0, sizeof(attrs));
attrs.at_pino = vattr.va_nodeid;
VN_RELE(dvp);
if (!code) {
/* Set attributes. */
- bcopy((char*)params, (char*)attrs.at_param,
- sizeof(afs_inode_params_t));
+ memcpy((char*)attrs.at_param, (char*)params, sizeof(afs_inode_params_t));
attrs.at_attr_version = AFS_XFS_ATTR_VERS;
attrs.at_name_version = name_version;
AFS_VOP_ATTR_SET(vp, AFS_XFS_ATTR, (char*)&attrs,
}
if (!code) {
- bzero((char*)&data, sizeof(data));
+ memset((char*)&data, 0, sizeof(data));
data.ili_info.inodeNumber = inode;
data.ili_info.byteCount = vattr.va_size;
data.ili_info.linkCount = (vattr.va_mode & AFS_XFS_MODE_LINK_MASK);
- bcopy((char*)attrs.at_param, (char*)data.ili_info.param,
- sizeof(data.ili_info.param));
+ memcpy((char*)data.ili_info.param, (char*)attrs.at_param, sizeof(data.ili_info.param));
data.ili_attr_version = attrs.at_attr_version;
data.ili_name_version = attrs.at_name_version;
data.ili_tag = attrs.at_tag;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_vnodeops.c,v 1.1.1.6 2001/07/14 22:19:44 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_vnodeops.c,v 1.1.1.7 2001/09/11 14:25:03 hartmans Exp $");
#ifdef AFS_SGI62_ENV
#include "../afs/sysincludes.h" /* Standard vendor system headers */
/* we are responsible for zero'ing the page */
caddr_t c;
c = bp_mapin(bp);
- bzero(c, bp->b_bcount);
+ memset(c, 0, bp->b_bcount);
iodone(bp);
ReleaseReadLock(&avc->lock);
return;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_alloc.c,v 1.1.1.7 2001/07/14 22:19:45 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_alloc.c,v 1.1.1.8 2001/09/11 14:25:03 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
#include "../h/mm.h"
+#include "../h/slab.h"
#include "../afs/afs_atomlist.h"
#include "../afs/afs_lhash.h"
/* if we can use kmalloc use it to allocate the required memory. */
if (asize < MAX_KMALLOC_SIZE) {
- new = (void *)(long)kmalloc(asize, GFP_KERNEL);
+ new = (void *)(unsigned long)kmalloc(asize, GFP_KERNEL);
if (new) /* piggy back alloc type */
(unsigned long)new |= KM_TYPE;
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_groups.c,v 1.1.1.7 2001/07/14 22:19:45 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_groups.c,v 1.1.1.8 2001/09/11 14:25:04 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
/* Intercept the standard system call. */
-extern int (*sys_setgroupsp)(int gidsetsize, gid_t *grouplist);
-asmlinkage int afs_xsetgroups(int gidsetsize, gid_t *grouplist)
+extern long (*sys_setgroupsp)(int gidsetsize, gid_t *grouplist);
+asmlinkage long afs_xsetgroups(int gidsetsize, gid_t *grouplist)
{
int code;
cred_t *cr = crref();
struct list_head i_dentry;
#if defined(AFS_LINUX24_ENV)
struct list_head i_dirty_buffers;
+#endif
+#if defined(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS)
+ struct list_head i_dirty_data_buffers;
#endif
unsigned long i_ino;
unsigned int i_count;
unsigned short i_bytes;
#endif
struct semaphore i_sem;
+#ifdef STRUCT_INODE_HAS_I_TRUNCATE_SEM
+ struct rw_semaphore i_truncate_sem;
+#endif
#if defined(AFS_LINUX24_ENV)
struct semaphore i_zombie;
#else
struct address_space i_data;
#else
struct vm_area_struct *i_mmap;
+#if defined(STRUCT_INODE_HAS_I_MMAP_SHARED)
+ struct vm_area_struct *i_mmap_shared;
+#endif
struct page *i_pages;
+#endif
+#if defined(STRUCT_INODE_HAS_I_MAPPING_OVERLOAD)
+ int i_mapping_overload;
#endif
struct dquot *i_dquot[MAXQUOTAS];
#if defined(AFS_LINUX24_ENV)
struct pipe_inode_info *i_pipe;
struct block_device *i_bdev;
+#if defined(STRUCT_INODE_HAS_I_CDEV)
+ struct char_device *i_cdev;
+#endif
unsigned long i_dnotify_mask;
struct dnotify_struct *i_dnotify;
#endif
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vfsops.c,v 1.1.1.8 2001/07/14 22:19:47 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vfsops.c,v 1.1.1.9 2001/09/11 14:25:07 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
struct vcache *vc = (struct vcache*)ip;
AFS_GLOCK();
- ObtainWriteLock(&vc->lock, 504);
osi_clear_inode(ip);
- ReleaseWriteLock(&vc->lock);
AFS_GUNLOCK();
}
}
+void
+afs_umount_begin(struct super_block *sbp)
+{
+ afs_shuttingdown=1;
+ afs_put_super(sbp);
+ afs_was_mounted=0;
+}
+
#if defined(AFS_LINUX24_ENV)
struct super_operations afs_sops = {
read_inode: afs_read_inode,
delete_inode: afs_delete_inode,
put_super: afs_put_super,
statfs: afs_statfs,
+ umount_begin: afs_umount_begin,
};
#else
struct super_operations afs_sops = {
afs_statfs,
NULL, /* afs_remount_fs - see doc above */
NULL, /* afs_clear_inode */
- NULL, /* afs_umount_begin */
+ afs_umount_begin,
};
#endif
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_file.c,v 1.1.1.5 2001/07/14 22:19:48 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_file.c,v 1.1.1.6 2001/09/11 14:25:08 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
}
if (!afs_osicred_initialized) {
/* valid for alpha_osf, SunOS, Ultrix */
- bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
+ memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.1.1.6 2001/07/14 22:19:50 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.1.1.7 2001/09/11 14:25:09 hartmans Exp $");
#if defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
/*
afs_int32 toffset;
#endif
- if (!pl) return 0; /* punt asynch requests */
-
- len = PAGESIZE;
- pl[0] = NULL; /* Make sure it's empty */
if (!acred)
#ifdef AFS_SUN5_ENV
osi_Panic("GetOnePage: !acred");
acred = u.u_cred; /* better than nothing */
#endif
- /* first, obtain the proper lock for the VM system */
avc = (struct vcache *) vp; /* cast to afs vnode */
+#ifdef AFS_SUN5_ENV
+ if (avc->credp /*&& AFS_NFSXLATORREQ(acred)*/ && AFS_NFSXLATORREQ(avc->credp)) {
+ acred = avc->credp;
+ }
+#endif
+ if (code = afs_InitReq(&treq, acred)) return code;
+
+ if (!pl) {
+ /*
+ * This is a read-ahead request, e.g. due to madvise.
+ */
+ tdc = afs_GetDCache(avc, (afs_int32)off, &treq, &offset, &nlen, 1);
+ if (!tdc) return 0;
+
+ if (!(tdc->flags & DFNextStarted)) {
+ ObtainReadLock(&avc->lock);
+ afs_PrefetchChunk(avc, tdc, acred, &treq);
+ ReleaseReadLock(&avc->lock);
+ }
+ afs_PutDCache(tdc);
+ return 0;
+ }
+
+ len = PAGESIZE;
+ pl[0] = NULL; /* Make sure it's empty */
+
+ /* first, obtain the proper lock for the VM system */
+
/* if this is a read request, map the page in read-only. This will
* allow us to swap out the dcache entry if there are only read-only
* pages created for the chunk, which helps a *lot* when dealing
mapForRead = 1;
if (protp) *protp = PROT_ALL;
-#ifdef AFS_SUN5_ENV
- if (avc->credp /*&& AFS_NFSXLATORREQ(acred)*/ && AFS_NFSXLATORREQ(avc->credp)) {
- acred = avc->credp;
- }
-#endif
- if (code = afs_InitReq(&treq, acred)) return code;
#ifndef AFS_SUN5_ENV
if (AFS_NFSXLATORREQ(acred)) {
if (rw == S_READ) {
}
afs_BozonLock(&avc->pvnLock, avc);
- ObtainSharedLock(&avc->lock,566);
+ ObtainReadLock(&avc->lock);
afs_Trace4(afs_iclSetp, CM_TRACE_PAGEIN, ICL_TYPE_POINTER, (afs_int32) vp,
ICL_TYPE_LONG, (afs_int32) off, ICL_TYPE_LONG, (afs_int32) len,
* the locks and try again when the VM purge is done. */
ObtainWriteLock(&avc->vlock, 550);
if (avc->activeV) {
- ReleaseSharedLock(&avc->lock);
+ ReleaseReadLock(&avc->lock);
ReleaseWriteLock(&avc->vlock);
afs_BozonUnlock(&avc->pvnLock, avc);
afs_PutDCache(tdc);
/* Check to see whether the cache entry is still valid */
if (!(avc->states & CStatd)
|| !hsame(avc->m.DataVersion, tdc->f.versionNo)) {
- ReleaseSharedLock(&avc->lock);
+ ReleaseReadLock(&avc->lock);
afs_BozonUnlock(&avc->pvnLock, avc);
afs_PutDCache(tdc);
goto retry;
buf->b_blkno = btodb(toffset);
bp_mapin(buf); /* map it in to our address space */
#ifndef AFS_SUN5_ENV
- ReleaseSharedLock(&avc->lock);
+ ReleaseReadLock(&avc->lock);
#endif
#if defined(AFS_SUN5_ENV)
AFS_GLOCK();
- UpgradeSToWLock(&avc->lock, 564);
code = afs_ustrategy(buf, acred); /* do the I/O */
- ConvertWToSLock(&avc->lock);
AFS_GUNLOCK();
#else
code = afs_ustrategy(buf); /* do the I/O */
#endif
#ifndef AFS_SUN5_ENV
- ObtainSharedLock(&avc->lock,245);
+ ObtainReadLock(&avc->lock);
#endif
#ifdef AFS_SUN5_ENV
/* Before freeing unmap the buffer */
AFS_GLOCK();
pl[slot] = (struct page *) 0;
+ /*
+ * XXX This seems kind-of wrong: we shouldn't be modifying
+ * avc->states while not holding the write lock (even
+ * though nothing really uses CHasPages..)
+ */
avc->states |= CHasPages;
- ReleaseSharedLock(&avc->lock);
+ ReleaseReadLock(&avc->lock);
#ifdef AFS_SUN5_ENV
ObtainWriteLock(&afs_xdcache,246);
if (!mapForRead) {
for(i=0; i<slot; i++)
PAGE_RELE(pl[i]);
#endif
- ReleaseSharedLock(&avc->lock);
+ ReleaseReadLock(&avc->lock);
afs_BozonUnlock(&avc->pvnLock, avc);
#ifdef AFS_SUN5_ENV
afs_PutDCache(tdc);
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/UKERNEL/afs_usrops.c,v 1.1.1.6 2001/07/14 22:19:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/UKERNEL/afs_usrops.c,v 1.1.1.7 2001/09/11 14:25:10 hartmans Exp $");
#ifdef UKERNEL
/* build address list */
for(i=0;i<MAXHOSTSPERCELL;i++)
- bcopy(&aci->hostAddr[i].sin_addr, &hosts[i], sizeof(afs_int32));
+ memcpy(&hosts[i], &aci->hostAddr[i].sin_addr, sizeof(afs_int32));
if (aci->linkedCell) cellFlags |= 4; /* Flag that linkedCell arg exists,
for upwards compatibility */
rn, cacheFiles);
exit(1);
}
- bzero(pathname_for_V, (cacheFiles * sizeof(char *)));
+ memset(pathname_for_V, 0, (cacheFiles * sizeof(char *)));
if (afsd_debug)
printf("%s: %d pathname_for_V entries at 0x%x, %d bytes\n",
rn, cacheFiles, (cacheFiles * sizeof(AFSD_INO_T)));
" flags = 0x%x, dcache entries %d\n",
rn, cacheStatEntries, cacheFiles, cacheBlocks, cacheFlags,
dCacheSize);
- bzero(&cparams, sizeof(cparams));
+ memset(&cparams, 0, sizeof(cparams));
cparams.cacheScaches = cacheStatEntries;
cparams.cacheFiles = cacheFiles;
cparams.cacheBlocks = cacheBlocks;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_fid.c,v 1.1.1.5 2001/07/14 22:19:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_fid.c,v 1.1.1.6 2001/09/11 14:25:12 hartmans Exp $");
#if !defined(AFS_DUX40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
#include "../afs/sysincludes.h" /* Standard vendor system headers */
|| USE_SMALLFID(credp)
#endif
) {
- bcopy((caddr_t)&Sfid, fidpp->fid_data, SizeOfSmallFid);
+ memcpy(fidpp->fid_data, (caddr_t)&Sfid, SizeOfSmallFid);
} else {
- bcopy((caddr_t)addr, fidpp->fid_data, SizeOfSmallFid);
+ memcpy(fidpp->fid_data, (caddr_t)addr, SizeOfSmallFid);
}
} else {
- bcopy((caddr_t)&Sfid, fidpp->fid_data, SizeOfSmallFid);
+ memcpy(fidpp->fid_data, (caddr_t)&Sfid, SizeOfSmallFid);
}
#else
/* malloc a fid pointer ourselves. */
(*fidpp)->fid_len = SizeOfSmallFid;
if (afs_NFSRootOnly) {
if (rootvp) {
- bcopy((char *)&Sfid, (*fidpp)->fid_data, SizeOfSmallFid);
+ memcpy((*fidpp)->fid_data, (char *)&Sfid, SizeOfSmallFid);
} else {
- bcopy((char *)addr, (*fidpp)->fid_data, SizeOfSmallFid);
+ memcpy((*fidpp)->fid_data, (char *)addr, SizeOfSmallFid);
}
} else {
- bcopy((char *)&Sfid, (*fidpp)->fid_data, SizeOfSmallFid);
+ memcpy((*fidpp)->fid_data, (char *)&Sfid, SizeOfSmallFid);
}
#endif
return (0);
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_strategy.c,v 1.1.1.5 2001/07/14 22:19:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_strategy.c,v 1.1.1.6 2001/09/11 14:25:13 hartmans Exp $");
#if !defined(AFS_HPUX_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV)
if (code == 0) {
if (tuio.afsio_resid > 0)
#if defined(AFS_FBSD_ENV)
- bzero(abp->b_saveaddr + abp->b_bcount - tuio.afsio_resid, tuio.afsio_resid);
+ memset(abp->b_saveaddr + abp->b_bcount - tuio.afsio_resid, 0, tuio.afsio_resid);
#else
- bzero(abp->b_un.b_addr + abp->b_bcount - tuio.afsio_resid, tuio.afsio_resid);
+ memset(abp->b_un.b_addr + abp->b_bcount - tuio.afsio_resid, 0, tuio.afsio_resid);
#endif /* AFS_FBSD_ENV */
#ifdef AFS_AIX32_ENV
/*
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.1.1.6 2001/07/14 22:19:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.1.1.7 2001/09/11 14:25:15 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
return (EFBIG);
}
#endif
-#ifdef AFS_VM_RDWR_ENV
+#if (!defined(AFS_VM_RDWR_ENV)||defined(AFS_LINUX20_ENV))
/*
* If write is implemented via VM, afs_FakeOpen() is called from the
* high-level write op.
if (filePos > avc->m.Length)
avc->m.Length = filePos;
#endif
-#ifndef AFS_VM_RDWR_ENV
+#if (!defined(AFS_VM_RDWR_ENV)||defined(AFS_LINUX20_ENV))
/*
* If write is implemented via VM, afs_DoPartialWrite() is called from
* the high-level write op.
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_buffer.c,v 1.1.1.4 2001/07/14 22:19:17 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_buffer.c,v 1.1.1.5 2001/09/11 14:24:36 hartmans Exp $");
#include "../afs/sysincludes.h"
#if !defined(UKERNEL)
nbuffers = 0;
timecounter = 1;
for(i=0;i<PHSIZE;i++) phTable[i] = 0;
- bzero((char *)&afs_bufferLock, sizeof(afs_lock_t));
+ memset((char *)&afs_bufferLock, 0, sizeof(afs_lock_t));
}
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_callback.c,v 1.1.1.4 2001/07/14 22:19:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_callback.c,v 1.1.1.5 2001/09/11 14:24:37 hartmans Exp $");
#include "../afs/sysincludes.h" /*Standard vendor system headers*/
#include "../afs/afsincludes.h" /*AFS-based standard headers*/
*/
dataBytes = sizeof(struct afs_CMStats);
dataBuffP = (afs_int32 *)afs_osi_Alloc(dataBytes);
- bcopy((char *)&afs_cmstats, (char *)dataBuffP, dataBytes);
+ memcpy((char *)dataBuffP, (char *)&afs_cmstats, dataBytes);
a_dataP->AFSCB_CollData_len = dataBytes>>2;
a_dataP->AFSCB_CollData_val = dataBuffP;
break;
afs_CountServers();
dataBytes = sizeof(afs_stats_cmperf);
dataBuffP = (afs_int32 *)afs_osi_Alloc(dataBytes);
- bcopy((char *)&afs_stats_cmperf, (char *)dataBuffP, dataBytes);
+ memcpy((char *)dataBuffP, (char *)&afs_stats_cmperf, dataBytes);
a_dataP->AFSCB_CollData_len = dataBytes>>2;
a_dataP->AFSCB_CollData_val = dataBuffP;
break;
*/
afs_stats_cmperf.numPerfCalls++;
afs_CountServers();
- bcopy((char *)(&afs_stats_cmperf),
- (char *)(&(afs_stats_cmfullperf.perf)),
- sizeof(struct afs_stats_CMPerf));
+ memcpy((char *)(&(afs_stats_cmfullperf.perf)), (char *)(&afs_stats_cmperf), sizeof(struct afs_stats_CMPerf));
afs_stats_cmfullperf.numFullPerfCalls++;
dataBytes = sizeof(afs_stats_cmfullperf);
dataBuffP = (afs_int32 *)afs_osi_Alloc(dataBytes);
- bcopy((char *)(&afs_stats_cmfullperf), (char *)dataBuffP, dataBytes);
+ memcpy((char *)dataBuffP, (char *)(&afs_stats_cmfullperf), dataBytes);
a_dataP->AFSCB_CollData_len = dataBytes>>2;
a_dataP->AFSCB_CollData_val = dataBuffP;
break;
afs_int32 i, j;
struct cell *tcell;
struct afs_q *cq, *tq;
- char *t_name;
+ char *t_name, *p_name = NULL;
#ifdef RX_ENABLE_LOCKS
AFS_GLOCK();
#endif /* RX_ENABLE_LOCKS */
AFS_STATCNT(SRXAFSCB_GetCellServDB);
- t_name = (char *)rxi_Alloc(AFSNAMEMAX);
- if (t_name == NULL) {
-#ifdef RX_ENABLE_LOCKS
- AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
- return ENOMEM;
- }
-
- t_name[0] = '\0';
- bzero(a_hosts, AFSMAXCELLHOSTS * sizeof(afs_int32));
+ memset(a_hosts, 0, AFSMAXCELLHOSTS * sizeof(afs_int32));
/* search the list for the cell with this index */
ObtainReadLock(&afs_xcell);
tq = QNext(cq);
if (i == a_index) {
tcell = QTOC(cq);
- strcpy(t_name, tcell->cellName);
+ p_name = tcell->cellName;
for (j = 0 ; j < AFSMAXCELLHOSTS && tcell->cellHosts[j] ; j++) {
a_hosts[j] = ntohl(tcell->cellHosts[j]->addr->sa_ip);
}
}
}
+
+ if (p_name)
+ i = strlen(p_name);
+ else
+ i = 0;
+ t_name = (char *)rxi_Alloc(i+1);
+ if (t_name == NULL) {
+#ifdef RX_ENABLE_LOCKS
+ AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ return ENOMEM;
+ }
+
+ t_name[i] = '\0';
+ if (p_name)
+ bcopy(p_name, t_name, i);
+
ReleaseReadLock(&afs_xcell);
#ifdef RX_ENABLE_LOCKS
struct rx_call *a_call,
char **a_name)
{
+ int plen;
struct cell *tcell;
struct afs_q *cq, *tq;
- char *t_name;
+ char *t_name, *p_name = NULL;
#ifdef RX_ENABLE_LOCKS
AFS_GLOCK();
#endif /* RX_ENABLE_LOCKS */
AFS_STATCNT(SRXAFSCB_GetLocalCell);
- t_name = (char *)rxi_Alloc(AFSNAMEMAX);
- if (t_name == NULL) {
-#ifdef RX_ENABLE_LOCKS
- AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
- return ENOMEM;
- }
-
- t_name[0] = '\0';
-
/* Search the list for the primary cell. Cell number 1 is only
* the primary cell is when no other cell is explicitly marked as
* the primary cell. */
tq = QNext(cq);
tcell = QTOC(cq);
if (tcell->states & CPrimary) {
- strcpy(t_name, tcell->cellName);
+ p_name = tcell->cellName;
break;
}
if (tcell->cell == 1) {
- strcpy(t_name, tcell->cellName);
+ p_name = tcell->cellName;
}
}
+
+ if (p_name)
+ plen = strlen(p_name);
+ else
+ plen = 0;
+ t_name = (char *)rxi_Alloc(plen+1);
+ if (t_name == NULL) {
+#ifdef RX_ENABLE_LOCKS
+ AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ return ENOMEM;
+ }
+
+ t_name[plen] = '\0';
+ if (p_name)
+ bcopy(p_name, t_name, plen);
+
ReleaseReadLock(&afs_xcell);
#ifdef RX_ENABLE_LOCKS
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cbqueue.c,v 1.1.1.4 2001/07/14 22:19:18 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cbqueue.c,v 1.1.1.5 2001/09/11 14:24:37 hartmans Exp $");
#include "../afs/sysincludes.h" /*Standard vendor system headers*/
#include "../afs/afsincludes.h" /*AFS-based standard headers*/
{
register int i;
-bzero((char *)cbHashT, CBHTSIZE*sizeof(struct bucket));
+memset((char *)cbHashT, 0, CBHTSIZE*sizeof(struct bucket));
for (i=0;i<CBHTSIZE;i++) {
QInit(&(cbHashT[i].head));
/* Lock_Init(&(cbHashT[i].lock)); only if you want lots of locks, which
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cell.c,v 1.1.1.6 2001/07/14 22:19:18 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cell.c,v 1.1.1.7 2001/09/11 14:24:38 hartmans Exp $");
#include "../afs/stds.h"
#include "../afs/sysincludes.h" /* Standard vendor system headers */
tc->states |= aflags;
tc->timeout = timeout;
- bzero((char *)tc->cellHosts, sizeof(tc->cellHosts));
+ memset((char *)tc->cellHosts, 0, sizeof(tc->cellHosts));
for (i=0; i<MAXCELLHOSTS; i++) {
struct server *ts;
afs_uint32 temp = acellHosts[i];
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_conn.c,v 1.1.1.6 2001/07/14 22:19:20 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_conn.c,v 1.1.1.7 2001/09/11 14:24:38 hartmans Exp $");
#include "../afs/stds.h"
#include "../afs/sysincludes.h" /* Standard vendor system headers */
*/
UpgradeSToWLock(&afs_xconn,37);
tc = (struct conn *) afs_osi_Alloc(sizeof(struct conn));
- bzero((char *)tc, sizeof(struct conn));
+ memset((char *)tc, 0, sizeof(struct conn));
tc->user = tu;
tc->port = aport;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_dcache.c,v 1.1.1.5 2001/07/14 22:19:21 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_dcache.c,v 1.1.1.6 2001/09/11 14:24:39 hartmans Exp $");
#include "../afs/sysincludes.h" /*Standard vendor system headers*/
#include "../afs/afsincludes.h" /*AFS-based standard headers*/
/* these fields are protected by the lock on the vcache and luck
* on the dcache */
-#define updateV2DC(l,v,d,src) { if (l) ObtainWriteLock(&((v)->lock),src);\
- if (hsame((v)->m.DataVersion, (d)->f.versionNo) && (v)->callback) { \
- (v)->quick.dc = (d); \
- (v)->quick.stamp = (d)->stamp = MakeStamp(); \
- (v)->quick.minLoc = AFS_CHUNKTOBASE((d)->f.chunk); \
- /* Don't think I need these next two lines forever */ \
- (v)->quick.len = (d)->f.chunkBytes; \
- (v)->h1.dchint = (d); } if(l) ReleaseWriteLock(&((v)->lock)); }
+#define updateV2DC(l,v,d,src) { \
+ if (!l || 0 == NBObtainWriteLock(&((v)->lock),src)) { \
+ if (hsame((v)->m.DataVersion, (d)->f.versionNo) && (v)->callback) { \
+ (v)->quick.dc = (d); \
+ (v)->quick.stamp = (d)->stamp = MakeStamp(); \
+ (v)->quick.minLoc = AFS_CHUNKTOBASE((d)->f.chunk); \
+ /* Don't think I need these next two lines forever */ \
+ (v)->quick.len = (d)->f.chunkBytes; \
+ (v)->h1.dchint = (d); \
+ } \
+ if(l) ReleaseWriteLock(&((v)->lock)); \
+ } }
struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags)
register struct vcache *avc; /*Held*/
/* Allocate and zero the pointer array to the dcache entries */
afs_indexTable = (struct dcache **)
afs_osi_Alloc(sizeof(struct dcache *) * afiles);
- bzero((char *)afs_indexTable, sizeof(struct dcache *) * afiles);
+ memset((char *)afs_indexTable, 0, sizeof(struct dcache *) * afiles);
afs_indexTimes = (afs_hyper_t *) afs_osi_Alloc(afiles * sizeof(afs_hyper_t));
- bzero((char *)afs_indexTimes, afiles * sizeof(afs_hyper_t));
+ memset((char *)afs_indexTimes, 0, afiles * sizeof(afs_hyper_t));
afs_indexUnique = (afs_int32 *) afs_osi_Alloc(afiles * sizeof(afs_uint32));
- bzero((char *)afs_indexUnique, afiles * sizeof(afs_uint32));
+ memset((char *)afs_indexUnique, 0, afiles * sizeof(afs_uint32));
afs_indexFlags = (u_char *) afs_osi_Alloc(afiles * sizeof(u_char));
- bzero((char *)afs_indexFlags, afiles * sizeof(char));
+ memset((char *)afs_indexFlags, 0, afiles * sizeof(char));
/* Allocate and thread the struct dcache entries themselves */
tdp = afs_Initial_freeDSList =
(struct dcache *) afs_osi_Alloc(aDentries * sizeof(struct dcache));
- bzero((char *)tdp, aDentries * sizeof(struct dcache));
+ memset((char *)tdp, 0, aDentries * sizeof(struct dcache));
#ifdef AFS_AIX32_ENV
pin((char *)afs_indexTable, sizeof(struct dcache *) * afiles);/* XXX */
pin((char *)afs_indexTimes, sizeof(afs_hyper_t) * afiles); /* XXX */
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_exporter.c,v 1.1.1.4 2001/07/14 22:19:22 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_exporter.c,v 1.1.1.5 2001/09/11 14:24:40 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
}
length = (size ? size : sizeof(struct afs_exporter));
ex = (struct afs_exporter *) afs_osi_Alloc(length);
- bzero((char *)ex, length);
+ memset((char *)ex, 0, length);
MObtainWriteLock(&afs_xexp,308);
for (op = root_exported; op; op = op->exp_next) {
if (!op->exp_next)
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_init.c,v 1.1.1.6 2001/07/14 22:19:21 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_init.c,v 1.1.1.7 2001/09/11 14:24:40 hartmans Exp $");
#include "../afs/stds.h"
#include "../afs/sysincludes.h" /* Standard vendor system headers */
cacheInfoModTime = 0;
afs_fsfragsize = 1023;
- bzero((char *)&afs_stats_cmperf, sizeof(afs_stats_cmperf));
- bzero((char *)&cacheDev, sizeof(struct osi_dev));
+ memset((char *)&afs_stats_cmperf, 0, sizeof(afs_stats_cmperf));
+ memset((char *)&cacheDev, 0, sizeof(struct osi_dev));
osi_dnlc_shutdown();
}
} /*shutdown_cache*/
afs_FVIndex = -1;
afs_server = (struct rx_service *)0;
RWLOCK_INIT(&afs_xconn, "afs_xconn");
- bzero((char *)&afs_rootFid, sizeof(struct VenusFid));
+ memset((char *)&afs_rootFid, 0, sizeof(struct VenusFid));
RWLOCK_INIT(&afs_xuser, "afs_xuser");
RWLOCK_INIT(&afs_xvolume, "afs_xvolume"), RWLOCK_INIT(&afs_xcell, "afs_xcell");
RWLOCK_INIT(&afs_xserver, "afs_xserver"), LOCK_INIT(&afs_puttofileLock, "afs_puttofileLock");
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_memcache.c,v 1.1.1.4 2001/07/14 22:19:23 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_memcache.c,v 1.1.1.5 2001/09/11 14:24:41 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#ifndef AFS_LINUX22_ENV
if (blk == NULL)
goto nomem;
(memCache+index)->data = blk;
- bzero((memCache+index)->data, memCacheBlkSize);
+ memset((memCache+index)->data, 0, memCacheBlkSize);
}
#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS)
afs_InitDualFSCacheOps((struct vnode*)0);
if(bytesRead > 0) {
AFS_GUNLOCK();
- bcopy(mceP->data + offset, dest, bytesRead);
+ memcpy(dest, mceP->data + offset, bytesRead);
AFS_GLOCK();
}
else
for (i = 0 , size = bytesRead ; i < nio && size > 0 ; i++) {
bytesToRead = (size < iov[i].iov_len) ? size : iov[i].iov_len;
AFS_GUNLOCK();
- bcopy(mceP->data + offset, iov[i].iov_base, bytesToRead);
+ memcpy(iov[i].iov_base, mceP->data + offset, bytesToRead);
AFS_GLOCK();
offset += bytesToRead;
size -= bytesToRead;
/* may overlap, but this is OK */
AFS_GUNLOCK();
- bcopy(oldData, mceP->data, mceP->size);
+ memcpy(mceP->data, oldData, mceP->size);
AFS_GLOCK();
afs_osi_Free(oldData,mceP->dataSize);
mceP->dataSize = size+offset;
}
AFS_GUNLOCK();
if (mceP->size < offset)
- bzero(mceP->data+mceP->size, offset-mceP->size);
- bcopy(src, mceP->data + offset, size);
+ memset(mceP->data+mceP->size, 0, offset-mceP->size);
+ memcpy(mceP->data + offset, src, size);
AFS_GLOCK();
mceP->size = (size+offset < mceP->size) ? mceP->size :
size + offset;
/* may overlap, but this is OK */
AFS_GUNLOCK();
- bcopy(oldData, mceP->data, mceP->size);
+ memcpy(mceP->data, oldData, mceP->size);
AFS_GLOCK();
afs_osi_Free(oldData,mceP->dataSize);
mceP->dataSize = size+offset;
}
if (mceP->size < offset)
- bzero(mceP->data+mceP->size, offset-mceP->size);
+ memset(mceP->data+mceP->size, 0, offset-mceP->size);
for (bytesWritten = 0, i = 0 ; i < nio && size > 0 ; i++) {
bytesToWrite = (size < iov[i].iov_len) ? size : iov[i].iov_len;
AFS_GUNLOCK();
- bcopy(iov[i].iov_base, mceP->data + offset, bytesToWrite);
+ memcpy(mceP->data + offset, iov[i].iov_base, bytesToWrite);
AFS_GLOCK();
offset += bytesToWrite;
bytesWritten += bytesToWrite;
mceP->data = afs_osi_Alloc(uioP->uio_resid + uioP->uio_offset);
AFS_GUNLOCK();
- bcopy(oldData, mceP->data, mceP->size);
+ memcpy(mceP->data, oldData, mceP->size);
AFS_GLOCK();
afs_osi_Free(oldData,mceP->dataSize);
mceP->dataSize = uioP->uio_resid + uioP->uio_offset;
}
if (mceP->size < uioP->uio_offset)
- bzero(mceP->data+mceP->size, (int)(uioP->uio_offset-mceP->size));
+ memset(mceP->data+mceP->size, 0, (int)(uioP->uio_offset-mceP->size));
AFS_UIOMOVE(mceP->data+uioP->uio_offset, uioP->uio_resid, UIO_WRITE, uioP, code);
if (uioP->uio_offset > mceP->size)
mceP->size = uioP->uio_offset;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_nfsclnt.c,v 1.1.1.4 2001/07/14 22:19:23 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_nfsclnt.c,v 1.1.1.5 2001/09/11 14:24:41 hartmans Exp $");
#if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)
#ifndef AFS_DEC_ENV
}
}
np = (struct nfsclientpag *) afs_osi_Alloc(sizeof (struct nfsclientpag));
- bzero((char *)np, sizeof(struct nfsclientpag));
+ memset((char *)np, 0, sizeof(struct nfsclientpag));
/* Copy the necessary afs_exporter fields */
- bcopy((char *)afs_nfsexporter, (char *)np, sizeof(struct afs_exporter));
+ memcpy((char *)np, (char *)afs_nfsexporter, sizeof(struct afs_exporter));
np->next = afs_nfspags[i];
afs_nfspags[i] = np;
np->uid = uid;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi.c,v 1.1.1.6 2001/07/14 22:19:22 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi.c,v 1.1.1.7 2001/09/11 14:24:42 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
if ( !afs_osicred_initialized )
{
- bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
+ memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
crhold(&afs_osi_cred); /* don't let it evaporate */
afs_osicred_initialized = 1;
}
cr.cr_ref=1;
cr.cr_uid=pr->p_cred->pc_ucred->cr_uid;
cr.cr_ngroups=pr->p_cred->pc_ucred->cr_ngroups;
- bcopy(pr->p_cred->pc_ucred->cr_groups, cr.cr_groups,NGROUPS *
+ memcpy(cr.cr_groups, pr->p_cred->pc_ucred->cr_groups, NGROUPS *
sizeof(gid_t));
pcred_unlock(pr);
rv = &cr;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi_uio.c,v 1.1.1.4 2001/07/14 22:19:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi_uio.c,v 1.1.1.5 2001/09/11 14:24:42 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
AFS_STATCNT(afsio_copy);
if (ainuio->afsio_iovcnt > AFS_MAXIOVCNT) return EINVAL;
- bcopy((char *)ainuio, (char *)aoutuio, sizeof(struct uio));
+ memcpy((char *)aoutuio, (char *)ainuio, sizeof(struct uio));
tvec = ainuio->afsio_iov;
aoutuio->afsio_iov = aoutvec;
for(i=0;i<ainuio->afsio_iovcnt;i++){
- bcopy((char *)tvec, (char *)aoutvec, sizeof(struct iovec));
+ memcpy((char *)aoutvec, (char *)tvec, sizeof(struct iovec));
tvec++; /* too many compiler bugs to do this as one expr */
aoutvec++;
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi_vget.c,v 1.1.1.4 2001/07/14 22:19:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi_vget.c,v 1.1.1.5 2001/09/11 14:24:43 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
register afs_int32 code = 0, cellindex;
afs_int32 ret;
- bcopy(afidp->fid_data, (char *)&Sfid, SIZEOF_SMALLFID);
+ memcpy((char *)&Sfid, afidp->fid_data, SIZEOF_SMALLFID);
#ifdef AFS_OSF_ENV
Sfid.Vnode = afidp->fid_reserved;
#endif
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osidnlc.c,v 1.1.1.4 2001/07/14 22:19:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osidnlc.c,v 1.1.1.5 2001/09/11 14:24:43 hartmans Exp $");
#include "../afs/sysincludes.h" /*Standard vendor system headers*/
#include "../afs/afsincludes.h" /*AFS-based standard headers*/
tnc->dirp = adp;
tnc->vp = avc;
tnc->key = key;
- bcopy (aname, (char *)tnc->name, ts-aname+1); /* include the NULL */
+ memcpy((char *)tnc->name, aname, ts-aname+1); /* include the NULL */
InsertEntry(tnc);
} else {
}
else { /* did get the lock */
ncfreelist = (struct nc *) 0;
- bzero ((char *)nameCache, sizeof(struct nc) * NCSIZE);
- bzero ((char *)nameHash, sizeof(struct nc *) * NHSIZE);
+ memset((char *)nameCache, 0, sizeof(struct nc) * NCSIZE);
+ memset((char *)nameHash, 0, sizeof(struct nc *) * NHSIZE);
for (i=0; i<NCSIZE; i++) {
nameCache[i].next = ncfreelist;
ncfreelist = &nameCache[i];
int i;
Lock_Init(&afs_xdnlc);
- bzero ((char *)&dnlcstats, sizeof(dnlcstats));
- bzero ((char *)dnlctracetable, sizeof(dnlctracetable));
+ memset((char *)&dnlcstats, 0, sizeof(dnlcstats));
+ memset((char *)dnlctracetable, 0, sizeof(dnlctracetable));
dnlct=0;
ObtainWriteLock(&afs_xdnlc,223);
ncfreelist = (struct nc *) 0;
- bzero ((char *)nameCache, sizeof(struct nc) * NCSIZE);
- bzero ((char *)nameHash, sizeof(struct nc *) * NHSIZE);
+ memset((char *)nameCache, 0, sizeof(struct nc) * NCSIZE);
+ memset((char *)nameHash, 0, sizeof(struct nc *) * NHSIZE);
for (i=0; i<NCSIZE; i++) {
nameCache[i].next = ncfreelist;
ncfreelist = &nameCache[i];
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_segments.c,v 1.1.1.4 2001/07/14 22:19:27 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_segments.c,v 1.1.1.5 2001/09/11 14:24:45 hartmans Exp $");
#include "../afs/sysincludes.h" /*Standard vendor system headers*/
#include "../afs/afsincludes.h" /*AFS-based standard headers*/
minj = 0 ;
do {
- bzero ((char *)dcList, NCHUNKSATONCE * sizeof(struct dcache *));
+ memset((char *)dcList, 0, NCHUNKSATONCE * sizeof(struct dcache *));
high = 0;
moredata = FALSE;
while (sbytes > 0) {
tlen = (sbytes > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : sbytes);
- bzero(tbuffer, tlen);
+ memset(tbuffer, 0, tlen);
#ifdef RX_ENABLE_LOCKS
AFS_GUNLOCK();
#endif /* RX_ENABLE_LOCKS */
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_server.c,v 1.1.1.8 2001/07/14 22:19:27 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_server.c,v 1.1.1.9 2001/09/11 14:24:45 hartmans Exp $");
#include "../afs/stds.h"
#include "../afs/sysincludes.h" /* Standard vendor system headers */
afs_stats_cmperf.fs_UpDown[0].sumOfRecordAges = 0;
afs_stats_cmperf.fs_UpDown[0].ageOfYoungestRecord = 0;
afs_stats_cmperf.fs_UpDown[0].ageOfOldestRecord = 0;
- bzero((char *) afs_stats_cmperf.fs_UpDown[0].downIncidents,
- AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
+ memset((char *) afs_stats_cmperf.fs_UpDown[0].downIncidents, 0, AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
afs_stats_cmperf.fs_UpDown[1].sumOfRecordAges = 0;
afs_stats_cmperf.fs_UpDown[1].ageOfYoungestRecord = 0;
afs_stats_cmperf.fs_UpDown[1].ageOfOldestRecord = 0;
- bzero((char *) afs_stats_cmperf.fs_UpDown[1].downIncidents,
- AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
+ memset((char *) afs_stats_cmperf.fs_UpDown[1].downIncidents, 0, AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
afs_stats_cmperf.vl_UpDown[0].sumOfRecordAges = 0;
afs_stats_cmperf.vl_UpDown[0].ageOfYoungestRecord = 0;
afs_stats_cmperf.vl_UpDown[0].ageOfOldestRecord = 0;
- bzero((char *) afs_stats_cmperf.vl_UpDown[0].downIncidents,
- AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
+ memset((char *) afs_stats_cmperf.vl_UpDown[0].downIncidents, 0, AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
afs_stats_cmperf.vl_UpDown[1].sumOfRecordAges = 0;
afs_stats_cmperf.vl_UpDown[1].ageOfYoungestRecord = 0;
afs_stats_cmperf.vl_UpDown[1].ageOfOldestRecord = 0;
- bzero((char *) afs_stats_cmperf.vl_UpDown[1].downIncidents,
- AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
+ memset((char *) afs_stats_cmperf.vl_UpDown[1].downIncidents, 0, AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32));
/*
* Compute the current time, used to figure out server record ages.
i = afs_uuid_hash(uuidp) % NSERVERS;
for (ts = afs_servers[i]; ts; ts = ts->next) {
if ( (ts->flags & SRVR_MULTIHOMED) &&
- (bcmp((char *)uuidp, (char *)&ts->sr_uuid, sizeof(*uuidp)) == 0) &&
+ (memcmp((char *)uuidp, (char *)&ts->sr_uuid, sizeof(*uuidp)) == 0) &&
(!ts->addr || (ts->addr->sa_portal == aport)) )
return ts;
}
#endif
#ifdef AFS_USERSPACE_IP_ADDR
-#ifndef min
-#define min(A,B) ((A)<(B)) ? (A) : (B)
+#ifndef afs_min
+#define afs_min(A,B) ((A)<(B)) ? (A) : (B)
#endif
/*
* The IP addresses and ranks are determined by afsd (in user space) and
if ( (serverAddr & netMask ) == myNet ) {
if ( (serverAddr & subnetmask ) == mySubnet) {
if ( serverAddr == myAddr ) { /* same machine */
- sa->sa_iprank = min(sa->sa_iprank, TOPR);
+ sa->sa_iprank = afs_min(sa->sa_iprank, TOPR);
} else { /* same subnet */
- sa->sa_iprank = min(sa->sa_iprank, HI);
+ sa->sa_iprank = afs_min(sa->sa_iprank, HI);
}
} else { /* same net */
- sa->sa_iprank = min(sa->sa_iprank, MED);
+ sa->sa_iprank = afs_min(sa->sa_iprank, MED);
}
}
}
newts = (struct server *) afs_osi_Alloc(sizeof(struct server));
if (!newts) panic("malloc of server struct");
afs_totalServers++;
- bzero((char *)newts, sizeof(struct server));
+ memset((char *)newts, 0, sizeof(struct server));
/* Add the server struct to the afs_servers[] hash chain */
srvhash = (uuidp ? (afs_uuid_hash(uuidp)%NSERVERS) : SHash(aserverp[0]));
newsa = (struct srvAddr *) afs_osi_Alloc(sizeof(struct srvAddr));
if (!newsa) panic("malloc of srvAddr struct");
afs_totalSrvAddrs++;
- bzero((char *)newsa, sizeof(struct srvAddr));
+ memset((char *)newsa, 0, sizeof(struct srvAddr));
/* Add the new srvAddr to the afs_srvAddrs[] hash chain */
newsa->next_bkt = afs_srvAddrs[iphash];
if (!orphts) {
orphts = (struct server *) afs_osi_Alloc(sizeof(struct server));
if (!orphts) panic("malloc of lo server struct");
- bzero((char *)orphts, sizeof(struct server));
+ memset((char *)orphts, 0, sizeof(struct server));
afs_totalServers++;
/* Add the orphaned server to the afs_servers[] hash chain.
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_stat.c,v 1.1.1.4 2001/07/14 22:19:23 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_stat.c,v 1.1.1.5 2001/09/11 14:24:46 hartmans Exp $");
#include "../afs/sysincludes.h" /*Standard vendor system headers*/
#include "../afs/afsincludes.h" /*AFS-based standard headers*/
/*
* First step is to zero everything out.
*/
- bzero((char *)(&afs_cmstats), sizeof(struct afs_CMStats));
- bzero((char *)(&afs_stats_cmperf), sizeof(struct afs_stats_CMPerf));
- bzero((char *)(&afs_stats_cmfullperf),
- sizeof(struct afs_stats_CMFullPerf));
+ memset((char *)(&afs_cmstats), 0, sizeof(struct afs_CMStats));
+ memset((char *)(&afs_stats_cmperf), 0, sizeof(struct afs_stats_CMPerf));
+ memset((char *)(&afs_stats_cmfullperf), 0, sizeof(struct afs_stats_CMFullPerf));
/*
* Some fields really should be non-zero at the start, so set 'em up.
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_user.c,v 1.1.1.6 2001/07/14 22:19:28 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_user.c,v 1.1.1.7 2001/09/11 14:24:47 hartmans Exp $");
#include "../afs/stds.h"
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#ifndef AFS_NOSTATS
afs_stats_cmfullperf.authent.PAGCreations++;
#endif /* AFS_NOSTATS */
- bzero((char *)tu, sizeof(struct unixuser));
+ memset((char *)tu, 0, sizeof(struct unixuser));
tu->next = afs_users[i];
afs_users[i] = tu;
if (RmtUser) {
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_vcache.c,v 1.1.1.7 2001/07/14 22:19:27 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_vcache.c,v 1.1.1.8 2001/09/11 14:24:48 hartmans Exp $");
#include "../afs/sysincludes.h" /*Standard vendor system headers*/
#include "../afs/afsincludes.h" /*AFS-based standard headers*/
#endif /* AFS_MACH_ENV */
#if defined(AFS_SGI_ENV)
{ char name[METER_NAMSZ];
- bzero(tvc, sizeof(struct vcache));
+ memset(tvc, 0, sizeof(struct vcache));
tvc->v.v_number = ++afsvnumbers;
tvc->vc_rwlockid = OSI_NO_LOCKID;
initnsema(&tvc->vc_rwlock, 1, makesname(name, "vrw", tvc->v.v_number));
#endif /* AFS_MACH_ENV */
#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV)
- bzero((char *)tvc, sizeof(struct vcache));
+ memset((char *)tvc, 0, sizeof(struct vcache));
#else
tvc->uncred = 0;
#endif
#ifdef AFS_AIX_ENV
/* Don't forget to free the gnode space */
tvc->v.v_gnode = gnodepnt = (struct gnode *) osi_AllocSmallSpace(sizeof(struct gnode));
- bzero((char *)gnodepnt, sizeof(struct gnode));
+ memset((char *)gnodepnt, 0, sizeof(struct gnode));
#endif
#ifdef AFS_SGI64_ENV
- bzero((void*)&(tvc->vc_bhv_desc), sizeof(tvc->vc_bhv_desc));
+ memset((void*)&(tvc->vc_bhv_desc), 0, sizeof(tvc->vc_bhv_desc));
bhv_desc_init(&(tvc->vc_bhv_desc), tvc, tvc, &Afs_vnodeops);
#ifdef AFS_SGI65_ENV
vn_bhv_head_init(&(tvc->v.v_bh), "afsvp");
#endif
tvc->h1.dchint = 0;
osi_dnlc_purgedp(tvc); /* this may be overkill */
- bzero((char *)&(tvc->quick),sizeof(struct vtodc));
- bzero((char *)&(tvc->callsort),sizeof(struct afs_q));
+ memset((char *)&(tvc->quick), 0, sizeof(struct vtodc));
+ memset((char *)&(tvc->callsort), 0, sizeof(struct afs_q));
tvc->slocks = (struct SimpleLocks *)0;
i = VCHash(afid);
#if !defined(AFS_OSF_ENV)
/* Allocate and thread the struct vcache entries */
tvp = (struct vcache *) afs_osi_Alloc(astatSize * sizeof(struct vcache));
- bzero((char *)tvp, sizeof(struct vcache)*astatSize);
+ memset((char *)tvp, 0, sizeof(struct vcache)*astatSize);
Initial_freeVCList = tvp;
freeVCList = &(tvp[0]);
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_volume.c,v 1.1.1.5 2001/07/14 22:19:29 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_volume.c,v 1.1.1.6 2001/09/11 14:24:48 hartmans Exp $");
#include "../afs/stds.h"
#include "../afs/sysincludes.h" /* Standard vendor system headers */
struct fvolume *tf=0;
tv = afs_GetVolSlot();
- bzero((char *)tv, sizeof(struct volume));
+ memset((char *)tv, 0, sizeof(struct volume));
tv->cell = tcell->cell;
RWLOCK_INIT(&tv->lock, "volume lock");
tv->next = afs_volumes[i]; /* thread into list */
ListAddrByAttributes attrs;
afsUUID uuid;
- bzero((char *)&attrs, sizeof(attrs));
+ memset((char *)&attrs, 0, sizeof(attrs));
attrs.Mask = VLADDR_UUID;
attrs.uuid = ve->serverNumber[i];
- bzero((char *)&uuid, sizeof(uuid));
- bzero((char *)&addrs, sizeof(addrs));
+ memset((char *)&uuid, 0, sizeof(uuid));
+ memset((char *)&addrs, 0, sizeof(addrs));
do {
tconn = afs_ConnByMHosts(tcell->cellHosts, tcell->vlport,
tcell->cell, areq, SHARED_LOCK);
:
else
echo "AFS kernel extensions failed to initialize. Skipping AFS startup."
+ exit 1
fi
#
* This option is now disabled.
* -logfile Place where to put the logfile (default in <cache>/etc/AFSLog.
* -waitclose make close calls always synchronous (slows em down, tho)
+ * -files_per_subdir [n] number of files per cache subdir. (def=2048)
* -shutdown Shutdown afs daemons
*---------------------------------------------------------------------------*/
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/afsd.c,v 1.1.1.8 2001/07/14 22:20:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/afsd.c,v 1.1.1.9 2001/09/11 14:30:47 hartmans Exp $");
#define VFS 1
char fullpn_AFSLogFile[1024]; /*Full pathname of AFSLOGFILE*/
char fullpn_CacheInfo[1024]; /*Full pathname of CACHEINFO*/
char fullpn_VFile[1024]; /*Full pathname of data cache files*/
-char *vFileNumber; /*Ptr to the number part of above pathname*/
+char *vFilePtr; /*Ptr to the number part of above pathname*/
int sawCacheMountDir = 0; /* from cmd line */
int sawCacheBaseDir = 0;
int sawCacheBlocks = 0;
int createAndTrunc = O_CREAT | O_TRUNC; /*Create & truncate on open*/
int ownerRWmode = 0600; /*Read/write OK by owner*/
static int filesSet = 0; /*True if number of files explicitly set*/
+static int nFilesPerDir = 2048; /* # files per cache dir */
static int nDaemons = 2; /* Number of background daemons */
static int chunkSize = 0; /* 2^chunkSize bytes per chunk */
static int dCacheSize = 300; /* # of dcache entries */
#else
#define AFSD_INO_T afs_uint32
#endif
+struct afsd_file_list {
+ int fileNum;
+ struct afsd_file_list *next;
+};
+struct afsd_file_list **cache_dir_filelist = NULL;
+int *cache_dir_list = NULL; /* Array of cache subdirs */
+int *dir_for_V = NULL; /* Array: dir of each cache file.
+ * -1: file does not exist
+ * -2: file exists in top-level
+ * >=0: file exists in Dxxx
+ */
AFSD_INO_T *inode_for_V; /* Array of inodes for desired
* cache files */
int missing_DCacheFile = 1; /*Is the DCACHEFILE missing?*/
*
* Arguments:
* fname : Char ptr to the filename to parse.
+ * max : integer for the highest number to accept
*
* Returns:
* >= 0 iff the file is really a data cache file numbered from 0 to cacheFiles-1, or
* None.
*---------------------------------------------------------------------------*/
-int GetVFileNumber(fname)
+static int doGetXFileNumber(fname, filechar, maxNum)
char *fname;
+ char filechar;
+ int maxNum;
{
int computedVNumber; /*The computed file number we return*/
int filenameLen; /*Number of chars in filename*/
int currDigit; /*Current digit being processed*/
/*
- * The filename must have at least two characters, the first of which must be a ``V''
+ * The filename must have at least two characters, the first of which must be a ``filechar''
* and the second of which cannot be a zero unless the file is exactly two chars long.
*/
filenameLen = strlen(fname);
if (filenameLen < 2)
return(-1);
- if (fname[0] != 'V')
+ if (fname[0] != filechar)
return(-1);
if ((filenameLen > 2) && (fname[1] == '0'))
return(-1);
return(-1);
}
+int GetVFileNumber(fname, maxFile)
+ char *fname;
+ int maxFile;
+{
+ return doGetXFileNumber(fname, 'V', maxFile);
+}
+
+int GetDDirNumber(fname, maxDir)
+ char *fname;
+ int maxDir;
+{
+ return doGetXFileNumber(fname, 'D', maxDir);
+}
+
+
/*-----------------------------------------------------------------------------
* CreateCacheFile
*
*
* Arguments:
* fname : Full pathname of file to create.
+ * statp : A pointer to a stat buffer which, if NON-NULL, will be
+ * filled by fstat()
*
* Returns:
* 0 iff the file was created,
* As described.
*---------------------------------------------------------------------------*/
-int CreateCacheFile(fname)
+static int CreateCacheSubDir (basename, dirNum)
+ char *basename;
+ int dirNum;
+{
+ static char rn[] = "CreateCacheSubDir"; /* Routine Name */
+ char dir[1024];
+ int ret;
+
+ /* Build the new cache subdirectory */
+ sprintf (dir, "%s/D%d", basename, dirNum);
+
+ if (afsd_verbose)
+ printf("%s: Creating cache subdir '%s'\n",
+ rn, dir);
+
+ if ((ret = mkdir(dir, 0700)) != 0) {
+ printf("%s: Can't create '%s', error return is %d (%d)\n",
+ rn, dir, ret, errno);
+ if (errno != EEXIST)
+ return (-1);
+ }
+
+ /* Mark this directory as created */
+ cache_dir_list[dirNum] = 0;
+
+ /* And return success */
+ return (0);
+}
+
+static int MoveCacheFile (basename, fromDir, toDir, cacheFile, maxDir)
+ char *basename;
+ int fromDir, toDir, cacheFile, maxDir;
+{
+ static char rn[] = "MoveCacheFile";
+ char from[1024], to[1024];
+ int ret;
+
+ if (cache_dir_list[toDir] < 0 &&
+ (ret = CreateCacheSubDir(basename, toDir))) {
+ printf("%s: Can't create directory '%s/D%d'\n", rn, basename, toDir);
+ return ret;
+ }
+
+ /* Build the from,to dir */
+ if (fromDir < 0) {
+ /* old-style location */
+ snprintf (from, sizeof(from), "%s/V%d", basename, cacheFile);
+ } else {
+ snprintf (from, sizeof(from), "%s/D%d/V%d", basename, fromDir, cacheFile);
+ }
+
+ snprintf (to, sizeof(from), "%s/D%d/V%d", basename, toDir, cacheFile);
+
+ if (afsd_verbose)
+ printf("%s: Moving cacheFile from '%s' to '%s'\n",
+ rn, from, to);
+
+ if ((ret = rename (from, to)) != 0) {
+ printf("%s: Can't rename '%s' to '%s', error return is %d (%d)\n",
+ rn, from, to, ret, errno);
+ return -1;
+ }
+
+ /* Reset directory pointer; fix file counts */
+ dir_for_V[cacheFile] = toDir;
+ cache_dir_list[toDir]++;
+ if (fromDir < maxDir && fromDir >= 0)
+ cache_dir_list[fromDir]--;
+
+ return 0;
+}
+
+int CreateCacheFile(fname, statp)
char *fname;
+ struct stat *statp;
{
static char rn[] = "CreateCacheFile"; /*Routine name*/
int cfd; /*File descriptor to AFS cache file*/
rn, fname, cfd, errno);
return(-1);
}
+ if (statp != NULL) {
+ closeResult = fstat (cfd, statp);
+ if (closeResult) {
+ printf("%s: Can't stat newly-created AFS cache file '%s' (code %d)\n",
+ rn, fname, errno);
+ return(-1);
+ }
+ }
closeResult = close(cfd);
if (closeResult) {
printf("%s: Can't close newly-created AFS cache file '%s' (code %d)\n",
*
* Description:
* Sweep through the AFS cache directory, recording the inode number for
- * each valid data cache file there. Also, delete any file that doesn't beint32
+ * each valid data cache file there. Also, delete any file that doesn't belong
* in the cache directory during this sweep, and remember which of the other
* residents of this directory were seen. After the sweep, we create any data
* cache files that were missing.
* explained above.
*---------------------------------------------------------------------------*/
-int SweepAFSCache(vFilesFound)
- int *vFilesFound;
+
+static int doSweepAFSCache(vFilesFound,directory,dirNum,maxDir)
+ int *vFilesFound;
+ char *directory; /* /path/to/cache/directory */
+ int dirNum; /* current directory number */
+ int maxDir; /* maximum directory number */
{
- static char rn[] = "SweepAFSCache"; /*Routine name*/
+ static char rn[] = "doSweepAFSCache"; /* Routine Name */
char fullpn_FileToDelete[1024]; /*File to be deleted from cache*/
char *fileToDelete; /*Ptr to last component of above*/
DIR *cdirp; /*Ptr to cache directory structure*/
struct dirent *currp; /*Current directory entry*/
#endif
int vFileNum; /*Data cache file's associated number*/
-
- if (cacheFlags & AFSCALL_INIT_MEMCACHE) {
- if (afsd_debug)
- printf("%s: Memory Cache, no cache sweep done\n", rn);
- *vFilesFound = 0;
- return 0;
- }
+ int thisDir; /* A directory number */
+ int highDir = 0;
if (afsd_debug)
- printf("%s: Opening cache directory '%s'\n",
- rn, cacheBaseDir);
+ printf("%s: Opening cache directory '%s'\n", rn, directory);
- if (chmod(cacheBaseDir, 0700)) { /* force it to be 700 */
- printf("%s: Can't 'chmod 0700' the cache dir, '%s'.\n",
- rn, cacheBaseDir);
+ if (chmod(directory, 0700)) { /* force it to be 700 */
+ printf("%s: Can't 'chmod 0700' the cache dir, '%s'.\n", rn, directory);
return (-1);
}
- cdirp = opendir(cacheBaseDir);
+ cdirp = opendir(directory);
if (cdirp == (DIR *)0) {
- printf("%s: Can't open AFS cache directory, '%s'.\n",
- rn, cacheBaseDir);
+ printf("%s: Can't open AFS cache directory, '%s'.\n", rn, directory);
return(-1);
}
/*
- * Scan the directory entries, remembering data cache file inodes and the existance
- * of other important residents. Delete all files that don't belong here.
+ * Scan the directory entries, remembering data cache file inodes
+ * and the existance of other important residents. Recurse into
+ * the data subdirectories.
+ *
+ * Delete all files and directories that don't belong here.
*/
- *vFilesFound = 0;
- sprintf(fullpn_FileToDelete, "%s/", cacheBaseDir);
+ sprintf(fullpn_FileToDelete, "%s/", directory);
fileToDelete = fullpn_FileToDelete + strlen(fullpn_FileToDelete);
#ifdef AFS_SGI62_ENV
}
/*
- * Guess current entry is for a data cache file.
+ * If dirNum < 0, we are a top-level cache directory and should
+ * only contain sub-directories and other sundry files. Therefore,
+ * V-files are valid only if dirNum >= 0, and Directories are only
+ * valid if dirNum < 0.
*/
- vFileNum = GetVFileNumber(currp->d_name);
- if (vFileNum >= 0) {
+
+ if (*(currp->d_name) == 'V' &&
+ ((vFileNum = GetVFileNumber(currp->d_name, cacheFiles)) >= 0)) {
/*
- * Found a valid data cache filename. Remember this file's inode and bump
- * the number of files found.
+ * Found a valid data cache filename. Remember this
+ * file's inode, directory, and bump the number of files found
+ * total and in this directory.
*/
inode_for_V[vFileNum] = currp->d_ino;
+ dir_for_V[vFileNum] = dirNum; /* remember this directory */
+
+ if (!maxDir) {
+ /* If we're in a real subdir, mark this file to be moved
+ * if we've already got too many files in this directory
+ */
+ assert(dirNum >= 0);
+ cache_dir_list[dirNum]++; /* keep directory's file count */
+ if (cache_dir_list[dirNum] > nFilesPerDir) {
+ /* Too many files -- add to filelist */
+ struct afsd_file_list *tmp = (struct afsd_file_list *)
+ malloc(sizeof(*tmp));
+ if (!tmp)
+ printf ("%s: MALLOC FAILED allocating file_list entry\n",
+ rn);
+ else {
+ tmp->fileNum = vFileNum;
+ tmp->next = cache_dir_filelist[dirNum];
+ cache_dir_filelist[dirNum] = tmp;
+ }
+ }
+ }
(*vFilesFound)++;
}
- else if (strcmp(currp->d_name, DCACHEFILE) == 0) {
+ else if (dirNum < 0 && (*(currp->d_name) == 'D') &&
+ GetDDirNumber(currp->d_name, 1<<30) >= 0) {
+ int retval = 0;
+ if ((vFileNum = GetDDirNumber(currp->d_name, maxDir)) >= 0) {
+ /* Found a valid cachefile sub-Directory. Remember this number
+ * and recurse into it. Note that subdirs cannot have subdirs.
+ */
+ retval = 1;
+ } else if ((vFileNum = GetDDirNumber(currp->d_name, 1<<30)) >= 0) {
+ /* This directory is going away, but figure out if there
+ * are any cachefiles in here that should be saved by
+ * moving them to other cache directories. This directory
+ * will be removed later.
+ */
+ retval = 2;
+ }
+
+ /* Save the highest directory number we've seen */
+ if (vFileNum > highDir)
+ highDir = vFileNum;
+
+ /* If this directory is staying, be sure to mark it as 'found' */
+ if (retval == 1) cache_dir_list[vFileNum] = 0;
+
+ /* Print the dirname for recursion */
+ sprintf(fileToDelete, "%s", currp->d_name);
+
+ /* Note: vFileNum is the directory number */
+ retval = doSweepAFSCache(vFilesFound, fullpn_FileToDelete,
+ vFileNum, (retval == 1 ? 0 : -1));
+ if (retval) {
+ printf ("%s: Recursive sweep failed on directory %s\n",
+ rn, currp->d_name);
+ return retval;
+ }
+ }
+ else if (dirNum < 0 && strcmp(currp->d_name, DCACHEFILE) == 0) {
/*
* Found the file holding the dcache entries.
*/
missing_DCacheFile = 0;
}
- else if (strcmp(currp->d_name, VOLINFOFILE) == 0) {
+ else if (dirNum < 0 && strcmp(currp->d_name, VOLINFOFILE) == 0) {
/*
* Found the file holding the volume info.
*/
}
else {
/*
- * This file doesn't belong in the cache. Nuke it.
+ * This file/directory doesn't belong in the cache. Nuke it.
*/
sprintf(fileToDelete, "%s", currp->d_name);
if (afsd_verbose)
printf("%s: Deleting '%s'\n",
rn, fullpn_FileToDelete);
if (unlink(fullpn_FileToDelete)) {
- printf("%s: Can't unlink '%s', errno is %d\n",
- rn, fullpn_FileToDelete, errno);
+ if (errno == EISDIR && *fileToDelete == 'D') {
+ if (rmdir(fullpn_FileToDelete)) {
+ printf("%s: Can't rmdir '%s', errno is %d\n",
+ rn, fullpn_FileToDelete, errno);
+ }
+ } else
+ printf("%s: Can't unlink '%s', errno is %d\n",
+ rn, fullpn_FileToDelete, errno);
}
}
}
- /*
- * Create all the cache files that are missing.
- */
- if (missing_DCacheFile) {
- if (afsd_verbose)
- printf("%s: Creating '%s'\n",
- rn, fullpn_DCacheFile);
- if (CreateCacheFile(fullpn_DCacheFile))
- printf("%s: Can't create '%s'\n",
- rn, fullpn_DCacheFile);
- }
- if (missing_VolInfoFile) {
- if (afsd_verbose)
- printf("%s: Creating '%s'\n",
- rn, fullpn_VolInfoFile);
- if (CreateCacheFile(fullpn_VolInfoFile))
- printf("%s: Can't create '%s'\n",
- rn, fullpn_VolInfoFile);
- }
+ if (dirNum < 0) {
- if (*vFilesFound < cacheFiles) {
- /*
- * We came up short on the number of data cache files found. Scan through the inode
- * list and create all missing files.
+ /*
+ * Create all the cache files that are missing.
*/
- for (vFileNum = 0; vFileNum < cacheFiles; vFileNum++)
- if (inode_for_V[vFileNum] == (AFSD_INO_T)0) {
- sprintf(vFileNumber, "%d", vFileNum);
- if (afsd_verbose)
- printf("%s: Creating '%s'\n",
- rn, fullpn_VFile);
- if (CreateCacheFile(fullpn_VFile))
- printf("%s: Can't create '%s'\n",
- rn, fullpn_VFile);
+ if (missing_DCacheFile) {
+ if (afsd_verbose)
+ printf("%s: Creating '%s'\n",
+ rn, fullpn_DCacheFile);
+ if (CreateCacheFile(fullpn_DCacheFile, NULL))
+ printf("%s: Can't create '%s'\n",
+ rn, fullpn_DCacheFile);
+ }
+ if (missing_VolInfoFile) {
+ if (afsd_verbose)
+ printf("%s: Creating '%s'\n",
+ rn, fullpn_VolInfoFile);
+ if (CreateCacheFile(fullpn_VolInfoFile, NULL))
+ printf("%s: Can't create '%s'\n",
+ rn, fullpn_VolInfoFile);
+ }
+
+ /* ADJUST CACHE FILES */
+
+ /* First, let's walk through the list of files and figure out
+ * if there are any leftover files in extra directories or
+ * missing files. Move the former and create the latter in
+ * subdirs with extra space.
+ */
+
+ thisDir = 0; /* Keep track of which subdir has space */
+
+ for (vFileNum = 0; vFileNum < cacheFiles; vFileNum++) {
+ if (dir_for_V[vFileNum] == -1) {
+ /* This file does not exist. Create it in the first
+ * subdir that still has extra space.
+ */
+ while (thisDir < maxDir &&
+ cache_dir_list[thisDir] >= nFilesPerDir)
+ thisDir++;
+ if (thisDir >= maxDir)
+ printf("%s: can't find directory to create V%d\n", rn, vFileNum);
+ else {
+ struct stat statb;
+ assert (inode_for_V[vFileNum] == (AFSD_INO_T)0);
+ sprintf(vFilePtr, "D%d/V%d", thisDir, vFileNum);
+ if (afsd_verbose)
+ printf("%s: Creating '%s'\n", rn, fullpn_VFile);
+ if (cache_dir_list[thisDir] < 0 &&
+ CreateCacheSubDir(directory, thisDir))
+ printf("%s: Can't create directory for '%s'\n",
+ rn, fullpn_VFile);
+ if (CreateCacheFile(fullpn_VFile, &statb))
+ printf("%s: Can't create '%s'\n", rn, fullpn_VFile);
+ else {
+ inode_for_V[vFileNum] = statb.st_ino;
+ dir_for_V[vFileNum] = thisDir;
+ cache_dir_list[thisDir]++;
+ (*vFilesFound)++;
+ }
}
- }
+
+ } else if (dir_for_V[vFileNum] >= maxDir ||
+ dir_for_V[vFileNum] == -2) {
+ /* This file needs to move; move it to the first subdir
+ * that has extra space. (-2 means it's in the toplevel)
+ */
+ while (thisDir < maxDir && cache_dir_list[thisDir] >= nFilesPerDir)
+ thisDir++;
+ if (thisDir >= maxDir)
+ printf("%s: can't find directory to move V%d\n", rn, vFileNum);
+ else {
+ if (MoveCacheFile (directory, dir_for_V[vFileNum], thisDir,
+ vFileNum, maxDir)) {
+ /* Cannot move. Ignore this file??? */
+ /* XXX */
+ }
+ }
+ }
+ } /* for */
+
+ /* At this point, we've moved all of the valid cache files
+ * into the valid subdirs, and created all the extra
+ * cachefiles we need to create. Next, rebalance any subdirs
+ * with too many cache files into the directories with not
+ * enough cache files. Note that thisDir currently sits at
+ * the lowest subdir that _may_ have room.
+ */
+
+ for (dirNum = 0; dirNum < maxDir; dirNum++) {
+ struct afsd_file_list *thisFile;
+
+ for (thisFile = cache_dir_filelist[dirNum];
+ thisFile && cache_dir_list[dirNum] >= nFilesPerDir;
+ thisFile = thisFile->next) {
+ while (thisDir < maxDir && cache_dir_list[thisDir] >= nFilesPerDir)
+ thisDir++;
+ if (thisDir >= maxDir)
+ printf("%s: can't find directory to move V%d\n", rn, vFileNum);
+ else {
+ if (MoveCacheFile (directory, dirNum, thisDir,
+ thisFile->fileNum, maxDir)) {
+ /* Cannot move. Ignore this file??? */
+ /* XXX */
+ }
+ }
+ } /* for each file to move */
+ } /* for each directory */
+
+ /* Remove any directories >= maxDir -- they should be empty */
+ for (; highDir >= maxDir; highDir--) {
+ sprintf(fileToDelete, "D%d", highDir);
+ if (unlink(fullpn_FileToDelete)) {
+ if (errno == EISDIR && *fileToDelete == 'D') {
+ if (rmdir(fullpn_FileToDelete)) {
+ printf("%s: Can't rmdir '%s', errno is %d\n",
+ rn, fullpn_FileToDelete, errno);
+ }
+ } else
+ printf("%s: Can't unlink '%s', errno is %d\n",
+ rn, fullpn_FileToDelete, errno);
+ }
+ }
+ } /* dirNum < 0 */
/*
* Close the directory, return success.
return(0);
}
+int SweepAFSCache(vFilesFound)
+ int *vFilesFound;
+{
+ static char rn[] = "SweepAFSCache"; /*Routine name*/
+ int maxDir = (cacheFiles + nFilesPerDir - 1 ) / nFilesPerDir;
+ int i;
+
+ *vFilesFound = 0;
+
+ if (cacheFlags & AFSCALL_INIT_MEMCACHE) {
+ if (afsd_debug)
+ printf("%s: Memory Cache, no cache sweep done\n", rn);
+ return 0;
+ }
+
+ if (cache_dir_list == NULL) {
+ cache_dir_list = (int *) malloc (maxDir * sizeof(*cache_dir_list));
+ if (cache_dir_list == NULL) {
+ printf("%s: Malloc Failed!\n", rn);
+ return (-1);
+ }
+ for (i=0; i < maxDir; i++)
+ cache_dir_list[i] = -1; /* Does not exist */
+ }
+
+ if (cache_dir_filelist == NULL) {
+ cache_dir_filelist = (struct afsd_file_list **)
+ malloc (maxDir * sizeof(*cache_dir_filelist));
+ if (cache_dir_filelist == NULL) {
+ printf("%s: Malloc Failed!\n", rn);
+ return (-1);
+ }
+ memset (cache_dir_filelist, 0, maxDir * sizeof(*cache_dir_filelist));
+ }
+
+ if (dir_for_V == NULL) {
+ dir_for_V = (int *) malloc (cacheFiles * sizeof(*dir_for_V));
+ if (dir_for_V == NULL) {
+ printf("%s: Malloc Failed!\n", rn);
+ return (-1);
+ }
+ for (i=0; i < cacheFiles; i++)
+ dir_for_V[i] = -1; /* Does not exist */
+ }
+
+ /* Note, setting dirNum to -2 here will cause cachefiles found in
+ * the toplevel directory to be marked in directory "-2". This
+ * allows us to differentiate between 'file not seen' (-1) and
+ * 'file seen in top-level' (-2). Then when we try to move the
+ * file into a subdirectory, we know it's in the top-level instead
+ * of some other cache subdir.
+ */
+ return doSweepAFSCache (vFilesFound, cacheBaseDir, -2, maxDir);
+}
+
static ConfigCell(aci, arock, adir)
register struct afsconf_cell *aci;
char *arock;
printf("afsd: No AFSDB support; ignoring -afsdb");
#endif
}
+ if (as->parms[25].items) {
+ /* -files_per_subdir */
+ int res = atoi(as->parms[25].items->data);
+ if ( res < 10 || res > 2^30) {
+ printf("afsd:invalid number of files per subdir, \"%s\". Ignored\n", as->parms[25].items->data);
+ } else {
+ nFilesPerDir = res;
+ }
+ }
/*
* Pull out all the configuration info for the workstation's AFS cache and
if ((logfd = fopen(fullpn_AFSLogFile,"r+")) == 0) {
if (afsd_verbose) printf("%s: Creating '%s'\n", rn, fullpn_AFSLogFile);
- if (CreateCacheFile(fullpn_AFSLogFile)) {
+ if (CreateCacheFile(fullpn_AFSLogFile, NULL)) {
printf("%s: Can't create '%s' (You may want to use the -logfile option)\n", rn, fullpn_AFSLogFile);
exit(1);
}
*/
sprintf(fullpn_DCacheFile, "%s/%s", cacheBaseDir, DCACHEFILE);
sprintf(fullpn_VolInfoFile, "%s/%s", cacheBaseDir, VOLINFOFILE);
- sprintf(fullpn_VFile, "%s/V", cacheBaseDir);
- vFileNumber = fullpn_VFile + strlen(fullpn_VFile);
+ sprintf(fullpn_VFile, "%s/", cacheBaseDir);
+ vFilePtr = fullpn_VFile + strlen(fullpn_VFile);
#if 0
fputs(AFS_GOVERNMENT_MESSAGE, stdout);
| CMD_HIDE
#endif
), "Enable AFSDB support");
+ cmd_AddParm(ts, "-files_per_subdir", CMD_SINGLE, CMD_OPTIONAL, "log(2) of the number of cache files per cache subdirectory");
return (cmd_Dispatch(argc, argv));
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/afsmonitor/afsmonitor.c,v 1.1.1.6 2001/07/14 22:20:30 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afsmonitor/afsmonitor.c,v 1.1.1.7 2001/09/11 14:31:07 hartmans Exp $");
#include <stdio.h>
#include <math.h>
#ifdef AFS_SUN5_ENV
/* On solaris the above does not resolve hostnames to full names */
if (he != (struct hostent *)0) {
- bcopy(he->h_addr, ip_addr, he->h_length);
+ memcpy(ip_addr, he->h_addr, he->h_length);
he = gethostbyaddr(ip_addr, he->h_length, he->h_addrtype);
}
#endif
fprintf(stderr,"[ %s ] Memory Allocation error 1",rn);
afsmon_Exit(25);
}
- bzero(curr_host->thresh,numBytes);
+ memset(curr_host->thresh, 0, numBytes);
}
curr_host = curr_host->next;;
}
fprintf(stderr,"[ %s ] Memory Allocation error 2",rn);
afsmon_Exit(35);
}
- bzero(curr_host->thresh,numBytes);
+ memset(curr_host->thresh, 0, numBytes);
}
curr_host = curr_host->next;;
}
/* copy hostname and probe number and probe time and probe status.
if the probe failed return now */
- bcopy(xstat_fs_Results.connP->hostName, tmp_fsPR->connP->hostName,
- sizeof(xstat_fs_Results.connP->hostName));
+ memcpy(tmp_fsPR->connP->hostName, xstat_fs_Results.connP->hostName, sizeof(xstat_fs_Results.connP->hostName));
tmp_fsPR->probeNum = xstat_fs_Results.probeNum;
tmp_fsPR->probeTime = xstat_fs_Results.probeTime;
tmp_fsPR->probeOK = xstat_fs_Results.probeOK;
}
/* copy connection information */
-#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- bcopy(&(xstat_fs_Results.connP->skt), &(tmp_fsPR->connP->skt),
- sizeof(struct sockaddr_in));
-#else
- bcopy(xstat_fs_Results.connP->skt, tmp_fsPR->connP->skt,
- sizeof(struct sockaddr_in));
-#endif
+ memcpy(&(tmp_fsPR->connP->skt), &(xstat_fs_Results.connP->skt), sizeof(struct sockaddr_in));
- bcopy(xstat_fs_Results.connP->hostName, tmp_fsPR->connP->hostName,
- sizeof(xstat_fs_Results.connP->hostName));
+ memcpy(tmp_fsPR->connP->hostName, xstat_fs_Results.connP->hostName, sizeof(xstat_fs_Results.connP->hostName));
tmp_fsPR->collectionNumber = xstat_fs_Results.collectionNumber;
/* copy the probe data information */
tmp_fsPR->data.AFS_CollData_len = xstat_fs_Results.data.AFS_CollData_len;
- bcopy(xstat_fs_Results.data.AFS_CollData_val,
- tmp_fsPR->data.AFS_CollData_val,
- xstat_fs_Results.data.AFS_CollData_len * sizeof(afs_int32));
+ memcpy(tmp_fsPR->data.AFS_CollData_val, xstat_fs_Results.data.AFS_CollData_val, xstat_fs_Results.data.AFS_CollData_len * sizeof(afs_int32));
/* we have a valid results structure so mark the list item used */
/* backup the display data of the probe cycle that just completed -
ie., store curr_fsData in prev_fsData */
- bcopy((char *)curr_fsData, (char *)prev_fsData,
- (numFS * sizeof(struct fs_Display_Data)) );
+ memcpy((char *)prev_fsData, (char *)curr_fsData, (numFS * sizeof(struct fs_Display_Data)) );
/* initialize curr_fsData but retain the threshold flag information.
for(i=0; i<numFS; i++) {
curr_fsDataP->probeOK = 0;
curr_fsDataP->ovfCount = 0;
- bzero((char *)curr_fsDataP->data, numBytes);
+ memset((char *)curr_fsDataP->data, 0, numBytes);
curr_fsDataP++;
}
/* copy hostname and probe number and probe time and probe status.
if the probe failed return now */
- bcopy(xstat_cm_Results.connP->hostName, tmp_cmPR->connP->hostName,
- sizeof(xstat_cm_Results.connP->hostName));
+ memcpy(tmp_cmPR->connP->hostName, xstat_cm_Results.connP->hostName, sizeof(xstat_cm_Results.connP->hostName));
tmp_cmPR->probeNum = xstat_cm_Results.probeNum;
tmp_cmPR->probeTime = xstat_cm_Results.probeTime;
tmp_cmPR->probeOK = xstat_cm_Results.probeOK;
/* copy connection information */
-#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- bcopy(&(xstat_cm_Results.connP->skt), &(tmp_cmPR->connP->skt),
- sizeof(struct sockaddr_in));
-#else
- bcopy(xstat_cm_Results.connP->skt, tmp_cmPR->connP->skt,
- sizeof(struct sockaddr_in));
-#endif
+ memcpy(&(tmp_cmPR->connP->skt), &(xstat_cm_Results.connP->skt), sizeof(struct sockaddr_in));
/**** NEED TO COPY rx_connection INFORMATION HERE ******/
- bcopy(xstat_cm_Results.connP->hostName, tmp_cmPR->connP->hostName,
- sizeof(xstat_cm_Results.connP->hostName));
+ memcpy(tmp_cmPR->connP->hostName, xstat_cm_Results.connP->hostName, sizeof(xstat_cm_Results.connP->hostName));
tmp_cmPR->collectionNumber = xstat_cm_Results.collectionNumber;
/* copy the probe data information */
tmp_cmPR->data.AFSCB_CollData_len = xstat_cm_Results.data.AFSCB_CollData_len;
- bcopy(xstat_cm_Results.data.AFSCB_CollData_val,
- tmp_cmPR->data.AFSCB_CollData_val,
- xstat_cm_Results.data.AFSCB_CollData_len * sizeof(afs_int32));
+ memcpy(tmp_cmPR->data.AFSCB_CollData_val, xstat_cm_Results.data.AFSCB_CollData_val, xstat_cm_Results.data.AFSCB_CollData_len * sizeof(afs_int32));
/* we have a valid results structure so mark the list item used */
/* backup the display data of the probe cycle that just completed -
ie., store curr_cmData in prev_cmData */
- bcopy((char *)curr_cmData, (char *)prev_cmData,
- (numCM * sizeof(struct cm_Display_Data)) );
+ memcpy((char *)prev_cmData, (char *)curr_cmData, (numCM * sizeof(struct cm_Display_Data)) );
/* initialize curr_cmData but retain the threshold flag information.
for(i=0; i<numCM; i++) {
curr_cmDataP->probeOK = 0;
curr_cmDataP->ovfCount = 0;
- bzero((char *)curr_cmDataP->data, numBytes);
+ memset((char *)curr_cmDataP->data, 0, numBytes);
curr_cmDataP++;
}
fprintf(stderr,"[ %s ] Memory allocation failure\n",rn);
return(-1);
}
- bzero(curr_fsData,numBytes);
+ memset(curr_fsData, 0, numBytes);
numBytes = numFS * sizeof(struct fs_Display_Data);
prev_fsData = (struct fs_Display_Data *) malloc(numBytes);
fprintf(stderr,"[ %s ] Memory allocation failure\n",rn);
return(-5);
}
- bzero(prev_fsData,numBytes);
+ memset(prev_fsData, 0, numBytes);
/* fill in the host names */
tmp_fsData1 = curr_fsData;
fprintf(stderr,"[ %s ] Memory allocation failure\n",rn);
return(-10);
}
- bzero(curr_cmData,numBytes);
+ memset(curr_cmData, 0, numBytes);
numBytes = numCM * sizeof(struct cm_Display_Data);
prev_cmData = (struct cm_Display_Data *) malloc(numBytes);
fprintf(stderr,"[ %s ] Memory allocation failure\n",rn);
return(-15);
}
- bzero(prev_cmData,numBytes);
+ memset(prev_cmData, 0, numBytes);
/* fill in the host names */
tmp_cmData1 = curr_cmData;
return(-1);
}
- bzero(FSSktArray, FSsktbytes);
+ memset(FSSktArray, 0, FSsktbytes);
/* Fill in the socket information for each fileserve */
return(-1);
}
strncpy(curr_FS->hostName,he->h_name,HOST_NAME_LEN); /* complete name*/
- bcopy(he->h_addr, &(curr_skt->sin_addr.s_addr), 4);
+ memcpy(&(curr_skt->sin_addr.s_addr), he->h_addr, 4);
curr_skt->sin_family = htons(AF_INET); /*Internet family*/
curr_skt->sin_port = htons(7000); /*FileServer port*/
return(-1);
}
- bzero(CMSktArray, CMsktbytes);
+ memset(CMSktArray, 0, CMsktbytes);
/* Fill in the socket information for each CM */
return(-1);
}
strncpy(curr_CM->hostName,he->h_name,HOST_NAME_LEN); /* complete name*/
- bcopy(he->h_addr, &(curr_skt->sin_addr.s_addr), 4);
+ memcpy(&(curr_skt->sin_addr.s_addr), he->h_addr, 4);
curr_skt->sin_family = htons(AF_INET); /*Internet family*/
curr_skt->sin_port = htons(7001); /*Cache Manager port*/
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/afsweb/apache_afs_cache.c,v 1.1.1.4 2001/07/14 22:20:32 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afsweb/apache_afs_cache.c,v 1.1.1.5 2001/09/11 14:31:09 hartmans Exp $");
#include "apache_afs_cache.h"
afs_int32 EndTimestamp;
} token;
tp=buf;
- bcopy(tp, &len, sizeof(afs_int32)); /* get size of secret token */
+ memcpy(&len, tp, sizeof(afs_int32)); /* get size of secret token */
rc=(len+sizeof(afs_int32));
tp += (sizeof(afs_int32) + len); /* skip secret token and its length */
- bcopy(tp, &len, sizeof(afs_int32)); /* get size of clear token */
+ memcpy(&len, tp, sizeof(afs_int32)); /* get size of clear token */
if (len != sizeof(struct ClearToken)) {
#ifdef DEBUG
fprintf(stderr, "apache_afs_cache.c:getExpiration:"
} token;
tp = buf;
- bcopy(tp, &len, sizeof(afs_int32)); /* get size of secret token */
+ memcpy(&len, tp, sizeof(afs_int32)); /* get size of secret token */
tp += (sizeof(afs_int32) + len); /* skip secret token and its length */
- bcopy(tp, &len, sizeof(afs_int32)); /* get size of clear token */
+ memcpy(&len, tp, sizeof(afs_int32)); /* get size of clear token */
if (len != sizeof(struct ClearToken)) {
#ifdef DEBUG
fprintf(stderr, "apache_afs_cache.c:getExpiration:"
}
tp += sizeof(afs_int32); /* skip length of clear token */
- bcopy(tp, &token, sizeof(struct ClearToken)); /* copy the token */
+ memcpy(&token, tp, sizeof(struct ClearToken)); /* copy the token */
return token.EndTimestamp;
}
#ifdef OLDSETPAG
/* skip over the secret token */
temp = tokenBuf;
- bcopy(temp, &i, sizeof(afs_int32));
+ memcpy(&i, temp, sizeof(afs_int32));
temp += (i + sizeof(afs_int32));
/* skip over the clear token */
- bcopy(temp, &i, sizeof(afs_int32));
+ memcpy(&i, temp, sizeof(afs_int32));
temp += (i + sizeof(afs_int32));
doneSETPAG = 1;
- bcopy(temp, &i, sizeof(afs_int32));
+ memcpy(&i, temp, sizeof(afs_int32));
i |= 0x8000;
- bcopy(&i, temp, sizeof(afs_int32));
+ memcpy(temp, &i, sizeof(afs_int32));
temp += sizeof(afs_int32);
#endif
strcpy(global_default_cell, defaultCell);
}
- bzero(user,APACHEAFS_USERNAME_MAX);
- bzero(passwd,APACHEAFS_PASSWORD_MAX);
- bzero(cell,APACHEAFS_CELLNAME_MAX);
+ memset(user, 0, APACHEAFS_USERNAME_MAX);
+ memset(passwd, 0, APACHEAFS_PASSWORD_MAX);
+ memset(cell, 0, APACHEAFS_CELLNAME_MAX);
if (auth_line == NULL) { /* No Authorization field - we don't do anything */
/*
afslog(15, ("%s: No authline recieved", module_name));
haveAuth = 0;
userChanged=1;
- bzero(lastUser, APACHEAFS_USERNAME_MAX);
- bzero(lastCell, APACHEAFS_CELLNAME_MAX);
- bzero(lastCksum, SHA_HASH_BYTES);
+ memset(lastUser, 0, APACHEAFS_USERNAME_MAX);
+ memset(lastCell, 0, APACHEAFS_CELLNAME_MAX);
+ memset(lastCksum, 0, SHA_HASH_BYTES);
rc = unlog();
afslog(25, ("%s: pid:%d No Authorization field. Unlogging ...",
module_name, getpid()));
module_name, getpid()));
haveAuth = 0;
userChanged = 1;
- bzero(lastUser, APACHEAFS_USERNAME_MAX);
- bzero(lastCell, APACHEAFS_CELLNAME_MAX);
- bzero(lastCksum, SHA_HASH_BYTES);
+ memset(lastUser, 0, APACHEAFS_USERNAME_MAX);
+ memset(lastCell, 0, APACHEAFS_CELLNAME_MAX);
+ memset(lastCksum, 0, SHA_HASH_BYTES);
rc = unlog();
if (rc) {
sprintf(err_msg, "%s: Error unlogging from AFS cell - rc: %d, errno:%d",
afsassert(r);
afsassert(buf);
- bzero(buf, APACHEAFS_CELLNAME_MAX);
+ memset(buf, 0, APACHEAFS_CELLNAME_MAX);
pos = strchr(r->uri,'/');
if (pos != NULL) {
pos++;
afsassert(buf);
afsassert(msg);
- bzero(blank, sizeof(blank));
+ memset(blank, 0, sizeof(blank));
afslog(50, ("%s: Parsing Authorization Required reply. buf:%s", module_name, buf));
pos = strchr(buf, '<');
pos++;
strcat(msg, pos);
strcpy(buf, msg);
- bzero(msg, 1024);
+ memset(msg, 0, 1024);
parseAuthName_int(r, buf, msg);
return 0;
}
afsassert(r);
afsassert(buf);
- bzero(msg, sizeof(msg));
+ memset(msg, 0, sizeof(msg));
pos=strchr(buf,'<');
while (pos != NULL) {
return -1;
}
strcpy(buf, msg);
- bzero(msg, sizeof(msg));
+ memset(msg, 0, sizeof(msg));
pos = strchr(buf, '<');
}
afslog(50, ("%s: Parsing WWW Auth required reply. final message:%s",
char * temp = tokenBuf;
/* skip over the secret token */
- bcopy(temp, &i, sizeof(afs_int32));
+ memcpy(&i, temp, sizeof(afs_int32));
temp += (i + sizeof(afs_int32));
/* skip over the clear token */
- bcopy(temp, &i, sizeof(afs_int32));
+ memcpy(&i, temp, sizeof(afs_int32));
temp += (i + sizeof(afs_int32));
/* set the primary flag */
- bcopy(temp, &i, sizeof(afs_int32));
+ memcpy(&i, temp, sizeof(afs_int32));
i |= 0x8000;
- bcopy(&i, temp, sizeof(afs_int32));
+ memcpy(temp, &i, sizeof(afs_int32));
temp += sizeof(afs_int32);
return 0;
}
assert ( buf != NULL );
tp = buf;
- bcopy(tp, &len, sizeof(afs_int32)); /* get size of secret token */
+ memcpy(&len, tp, sizeof(afs_int32)); /* get size of secret token */
tp += (sizeof(afs_int32)+ len); /* skip secret token */
- bcopy(tp, &len, sizeof(afs_int32)); /* get size of clear token */
+ memcpy(&len, tp, sizeof(afs_int32)); /* get size of clear token */
if (len != sizeof(struct ClearToken)) {
fprintf(stderr, "weblog:parseToken: error getting length of ClearToken\n");
return;
}
tp += sizeof(afs_int32); /* skip length of cleartoken */
- bcopy(tp, &clearToken, sizeof(struct ClearToken)); /* copy cleartoken */
+ memcpy(&clearToken, tp, sizeof(struct ClearToken)); /* copy cleartoken */
tp += len; /* skip clear token itself */
- bcopy(tp, &len, sizeof(afs_int32)); /* copy the primary flag */
+ memcpy(&len, tp, sizeof(afs_int32)); /* copy the primary flag */
tp += sizeof(afs_int32); /* skip primary flag */
/* tp now points to the cell name */
#include <sys/time.h>
#define NEED_STRERROR
typedef int rlim_t;
-#define memmove(a,b,c) bcopy(b,a,c)
+#ifndef HAVE_MEMMOVE
+#define memmove(a,b,c) memcpy(a, b, c)
+#endif
#define NO_LINGCLOSE
#define USE_FLOCK_SERIALIZED_ACCEPT
#define NO_KILLPG
#undef NO_SETSID
#define HAVE_SYS_RESOURCE_H
-#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
#define USE_FCNTL_SERIALIZED_ACCEPT
#define HAVE_MMAP
/* These are to let -Wall compile more cleanly */
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *,const char *,unsigned);
-extern int set42sig(), getopt(), getpeername(), bzero();
+extern int set42sig(), getopt(), getpeername();
extern int listen(), bind(), socket(), getsockname();
extern int accept(), gethostname(), connect(), lstat();
extern int select(), killpg(), shutdown();
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
-#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
/* A lot of SVR4 systems need this */
#define USE_FCNTL_SERIALIZED_ACCEPT
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
-#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
#define HAVE_RESOURCE
#define HAVE_MMAP
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
-#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
/* A lot of SVR4 systems need this */
#define USE_FCNTL_SERIALIZED_ACCEPT
#define NO_KILLPG
#undef NO_SETSID
#define HAVE_RESOURCE 1
-#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
#define USE_FCNTL_SERIALIZED_ACCEPT
#define HAVE_MMAP
#include <sys/time.h>
#define NEED_STRERROR
typedef int rlim_t;
-#define memmove(a,b,c) bcopy(b,a,c)
+#ifndef HAVE_MEMMOVE
+#define memmove(a,b,c) memcpy(a, b, c)
+#endif
#define NO_LINGCLOSE
#define USE_FLOCK_SERIALIZED_ACCEPT
#define NEED_DIFFTIME
#undef HAVE_GMTOFF
#define NO_KILLPG
#undef NO_SETSID
-#define bzero(a,b) memset(a,0,b)
#if !defined(USE_SYSVSEM_SERIALIZED_ACCEPT) && \
!defined(USE_PTHREAD_SERIALIZED_ACCEPT)
#define USE_FCNTL_SERIALIZED_ACCEPT
#endif
#define USE_FCNTL_SERIALIZED_ACCEPT
#ifdef USEBCOPY
-#define memmove(a,b,c) bcopy(b,a,c)
+#define memmove(a,b,c) memcpy(a, b, c)
#endif
#if AIX >= 42
#define NET_SIZE_T size_t
/* These are to let -Wall compile more cleanly */
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *, const char *, unsigned);
-extern int set42sig(), getopt(), getpeername(), bzero();
+extern int set42sig(), getopt(), getpeername();
extern int listen(), bind(), socket(), getsockname();
extern int accept(), gethostname(), connect(), lstat();
extern int select(), killpg(), shutdown();
#define NEED_STRNCASECMP
#endif /* ENCORE */
#endif /* MPRAS */
-#define bzero(a,b) memset(a,0,b)
/* A lot of SVR4 systems need this */
#ifndef USE_SYSVSEM_SERIALIZED_ACCEPT
#define USE_FCNTL_SERIALIZED_ACCEPT
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
-#define bzero(a,b) memset(a,0,b)
#define HAVE_MMAP 1
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
-#define bzero(a,b) memset(a,0,b)
/* A lot of SVR4 systems need this */
#define USE_FCNTL_SERIALIZED_ACCEPT
#define ap_inet_addr inet_network
#undef HAVE_GMTOFF
#define NO_KILLPG
#undef NO_SETSID
-#define bzero(a,b) memset(a,0,b)
#define USE_FCNTL_SERIALIZED_ACCEPT
#define HAVE_MMAP 1
#define USE_MMAP_SCOREBOARD
#include <sys/time.h>
#define NEED_STRERROR
typedef int rlim_t;
-#define memmove(a,b,c) bcopy(b,a,c)
+#ifndef HAVE_MEMMOVE
+#define memmove(a,b,c) memcpy(a, b, c)
+#endif
#define NO_LINGCLOSE
#define USE_FLOCK_SERIALIZED_ACCEPT
#define NEED_DIFFTIME
#undef HAVE_GMTOFF
#define NO_KILLPG
#undef NO_SETSID
-#define bzero(a,b) memset(a,0,b)
#if !defined(USE_SYSVSEM_SERIALIZED_ACCEPT) && \
!defined(USE_PTHREAD_SERIALIZED_ACCEPT)
#define USE_FCNTL_SERIALIZED_ACCEPT
#endif
#define USE_FCNTL_SERIALIZED_ACCEPT
#ifdef USEBCOPY
-#define memmove(a,b,c) bcopy(b,a,c)
+#define memmove(a,b,c) memcpy(a, b, c)
#endif
#if AIX >= 42
#define NET_SIZE_T size_t
/* These are to let -Wall compile more cleanly */
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *, const char *, unsigned);
-extern int set42sig(), getopt(), getpeername(), bzero();
+extern int set42sig(), getopt(), getpeername();
extern int listen(), bind(), socket(), getsockname();
extern int accept(), gethostname(), connect(), lstat();
extern int select(), killpg(), shutdown();
#define NEED_STRNCASECMP
#endif /* ENCORE */
#endif /* MPRAS */
-#define bzero(a,b) memset(a,0,b)
/* A lot of SVR4 systems need this */
#ifndef USE_SYSVSEM_SERIALIZED_ACCEPT
#define USE_FCNTL_SERIALIZED_ACCEPT
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
-#define bzero(a,b) memset(a,0,b)
#define HAVE_MMAP 1
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#endif
-#define bzero(a,b) memset(a,0,b)
/* A lot of SVR4 systems need this */
#define USE_FCNTL_SERIALIZED_ACCEPT
#define ap_inet_addr inet_network
#undef HAVE_GMTOFF
#define NO_KILLPG
#undef NO_SETSID
-#define bzero(a,b) memset(a,0,b)
#define USE_FCNTL_SERIALIZED_ACCEPT
#define HAVE_MMAP 1
#define USE_MMAP_SCOREBOARD
#include <sys/time.h>
#define NEED_STRERROR
typedef int rlim_t;
-#define memmove(a,b,c) bcopy(b,a,c)
+#ifndef HAVE_MEMMOVE
+#define memmove(a,b,c) memcpy(a, b, c)
+#endif
#define NO_LINGCLOSE
#define USE_FLOCK_SERIALIZED_ACCEPT
#define NO_KILLPG
#undef NO_SETSID
#define HAVE_SYS_RESOURCE_H
-#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
#define USE_FCNTL_SERIALIZED_ACCEPT
#define HAVE_MMAP
/* These are to let -Wall compile more cleanly */
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *,const char *,unsigned);
-extern int set42sig(), getopt(), getpeername(), bzero();
+extern int set42sig(), getopt(), getpeername();
extern int listen(), bind(), socket(), getsockname();
extern int accept(), gethostname(), connect(), lstat();
extern int select(), killpg(), shutdown();
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
-#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
/* A lot of SVR4 systems need this */
#define USE_FCNTL_SERIALIZED_ACCEPT
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
-#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
#define HAVE_RESOURCE
#define HAVE_MMAP
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
-#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
/* A lot of SVR4 systems need this */
#define USE_FCNTL_SERIALIZED_ACCEPT
#define NO_KILLPG
#undef NO_SETSID
#define HAVE_RESOURCE 1
-#define bzero(a,b) memset(a,0,b)
#define JMP_BUF sigjmp_buf
#define USE_FCNTL_SERIALIZED_ACCEPT
#define HAVE_MMAP
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/afsweb/weblog.c,v 1.1.1.5 2001/07/14 22:20:33 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afsweb/weblog.c,v 1.1.1.6 2001/09/11 14:31:11 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
token.startTime = starttime;
token.endTime = endtime;
- bcopy(session_key, (char *) &token.sessionKey, sizeof(token.sessionKey));
+ memcpy((char *) &token.sessionKey, session_key, sizeof(token.sessionKey));
token.kvno = tkt_type;
token.ticketLen = ticket_len;
if (ticket_len > MAXKTCTICKETLEN) {
"Maximum length accepted by AFS cache manager is %d\n", MAXKTCTICKETLEN);
return -1;
}
- bcopy((char *) ticket_p, (char *) token.ticket, ticket_len);
+ memcpy((char *) token.ticket, (char *) ticket_p, ticket_len);
sprintf(client.name, "AFS ID %d", unix_id);
strcpy(client.instance, "");
fprintf(stderr, "dlog: out of memory\n");
exit(1);
}
- bcopy(s_p, new_p, length);
+ memcpy(new_p, s_p, length);
new_p[length] = '\0';
return new_p;
}
case ASN_OCTET_STRING:
if (context == 1 && len == sizeof(reply_p->session_key)) {
saw_session_key++;
- bcopy(buf, reply_p->session_key, len);
+ memcpy(reply_p->session_key, buf, len);
}
buf += len;
break;
des_string_to_key(passwd, passwd_key);
/* Destroy the password. */
- bzero(passwd, strlen(passwd));
+ memset(passwd, 0, strlen(passwd));
/*
/*
* Destroy the key block: it's no longer needed.
*/
- bzero(schedule, sizeof(schedule));
- bzero(passwd_key, sizeof(passwd_key));
+ memset(schedule, 0, sizeof(schedule));
+ memset(passwd_key, 0, sizeof(passwd_key));
/*
char type[10]; /* authentication type AFS or DFS */
/* blow away command line arguments */
- for (i=1; i<zero_argc; i++) bzero (zero_argv[i], strlen(zero_argv[i]));
+ for (i=1; i<zero_argc; i++) memset(zero_argv[i], 0, strlen(zero_argv[i]));
zero_argc = 0;
/* first determine quiet flag based on -silent switch */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/audit/audit.c,v 1.1.1.5 2001/07/14 22:20:37 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/audit/audit.c,v 1.1.1.6 2001/09/11 14:31:18 hartmans Exp $");
#include <fcntl.h>
#include <stdarg.h>
case AUD_FID : /* AFSFid - contains 3 entries */
vaFid = (struct AFSFid *) va_arg(vaList, int);
if (vaFid) {
- bcopy(vaFid, bufferPtr, sizeof(struct AFSFid));
+ memcpy(bufferPtr, vaFid, sizeof(struct AFSFid));
}
else {
- bzero (bufferPtr, sizeof(struct AFSFid));
+ memset(bufferPtr, 0, sizeof(struct AFSFid));
}
bufferPtr += sizeof(struct AFSFid);
break;
if (Fids && Fids->AFSCBFids_len) {
*((u_int *)bufferPtr) = Fids->AFSCBFids_len;
bufferPtr += sizeof(u_int);
- bcopy(Fids->AFSCBFids_val, bufferPtr, sizeof(struct AFSFid));
+ memcpy(bufferPtr, Fids->AFSCBFids_val, sizeof(struct AFSFid));
}
else {
struct AFSFid dummy;
*((u_int *)bufferPtr) = 0;
bufferPtr += sizeof(u_int);
- bzero (bufferPtr, sizeof(struct AFSFid));
+ memset(bufferPtr, 0, sizeof(struct AFSFid));
}
bufferPtr += sizeof(struct AFSFid);
break;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/auth/cellconfig.c,v 1.1.1.8 2001/07/16 07:16:46 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/auth/cellconfig.c,v 1.1.1.9 2001/09/11 14:31:21 hartmans Exp $");
#include <afs/stds.h>
#include <afs/pthread_glock.h>
LOCK_GLOBAL_MUTEX
/* zero structure and fill in name; rest is done by internal routine */
tdir = (struct afsconf_dir *) malloc(sizeof(struct afsconf_dir));
- bzero(tdir, sizeof(struct afsconf_dir));
+ memset(tdir, 0, sizeof(struct afsconf_dir));
tdir->name = (char *) malloc(strlen(adir)+1);
strcpy(tdir->name, adir);
curEntry = 0;
}
curEntry = (struct afsconf_entry *) malloc(sizeof(struct afsconf_entry));
- bzero(curEntry, sizeof(struct afsconf_entry));
+ memset(curEntry, 0, sizeof(struct afsconf_entry));
code = ParseCellLine(tbuffer, curEntry->cellInfo.name, linkedcell);
if (code) {
afsconf_CloseInternal(adir);
if (adir->keystr) free(adir->keystr);
/* reinit */
- bzero(adir, sizeof(struct afsconf_dir));
+ memset(adir, 0, sizeof(struct afsconf_dir));
adir->name = tname; /* restore it */
return 0;
}
code = afsconf_Check(adir);
if (code)
return AFSCONF_FAILURE;
- bcopy(adir->keystr, astr, sizeof(struct afsconf_keys));
+ memcpy(astr, adir->keystr, sizeof(struct afsconf_keys));
UNLOCK_GLOBAL_MUTEX
return 0;
}
}
}
if (bestk) { /* found any */
- if (akey) bcopy(bestk->key, akey, 8); /* copy out latest key */
+ if (akey) memcpy(akey, bestk->key, 8); /* copy out latest key */
if (avno) *avno = bestk->kvno; /* and kvno to caller */
UNLOCK_GLOBAL_MUTEX
return 0;
for(tk = adir->keystr->key,i=0;i<maxa;i++,tk++) {
if (tk->kvno == avno) {
- bcopy(tk->key, akey, 8);
+ memcpy(akey, tk->key, 8);
UNLOCK_GLOBAL_MUTEX
return 0;
}
register afs_int32 i;
char tbuffer[256];
- bcopy(adir->keystr, &tkeys, sizeof(struct afsconf_keys));
+ memcpy(&tkeys, adir->keystr, sizeof(struct afsconf_keys));
/* convert it to net byte order */
for(i = 0; i<tkeys.nkeys; i++ )
tkey = &tk->key[tk->nkeys++];
}
tkey->kvno = akvno;
- bcopy(akey, tkey->key, 8);
+ memcpy(tkey->key, akey, 8);
i = SaveKeys(adir);
afsconf_Touch(adir);
UNLOCK_GLOBAL_MUTEX
/* otherwise slide the others down. i and tkey point at the guy to delete */
for(;i<tk->nkeys-1; i++,tkey++) {
tkey->kvno = (tkey+1)->kvno;
- bcopy((tkey+1)->key, tkey->key, 8);
+ memcpy(tkey->key, (tkey+1)->key, 8);
}
tk->nkeys--;
i = SaveKeys(adir);
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/auth/ktc.c,v 1.1.1.5 2001/07/14 22:20:40 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/auth/ktc.c,v 1.1.1.6 2001/09/11 14:31:22 hartmans Exp $");
#if defined(UKERNEL)
#include "../afs/sysincludes.h"
else /* valid, but no match */ ;
} else found = i; /* remember this empty slot */
if (found == -1) return KTC_NOENT;
- bcopy (atoken, &local_tokens[found].token, sizeof(struct ktc_token));
+ memcpy(&local_tokens[found].token, atoken, sizeof(struct ktc_token));
local_tokens[found].server = *aserver;
local_tokens[found].client = *aclient;
local_tokens[found].valid = 1;
tp = tbuffer; /* start copying here */
if ((atoken->ticketLen < MINKTCTICKETLEN) ||
(atoken->ticketLen > MAXKTCTICKETLEN)) return KTC_TOOBIG;
- bcopy(&atoken->ticketLen, tp, sizeof(afs_int32)); /* copy in ticket length */
+ memcpy(tp, &atoken->ticketLen, sizeof(afs_int32)); /* copy in ticket length */
tp += sizeof(afs_int32);
- bcopy(atoken->ticket, tp, atoken->ticketLen); /* copy in ticket */
+ memcpy(tp, atoken->ticket, atoken->ticketLen); /* copy in ticket */
tp += atoken->ticketLen;
/* next, copy in the "clear token", describing who we are */
ct.AuthHandle = atoken->kvno; /* hide auth handle here */
- bcopy(&atoken->sessionKey, ct.HandShakeKey, 8);
+ memcpy(ct.HandShakeKey, &atoken->sessionKey, 8);
ct.BeginTimestamp = atoken->startTime;
ct.EndTimestamp = atoken->endTime;
#endif
temp = sizeof(struct ClearToken);
- bcopy(&temp, tp, sizeof(afs_int32));
+ memcpy(tp, &temp, sizeof(afs_int32));
tp += sizeof(afs_int32);
- bcopy(&ct, tp, sizeof(struct ClearToken));
+ memcpy(tp, &ct, sizeof(struct ClearToken));
tp += sizeof(struct ClearToken);
/* next copy in primary flag */
if (flags & AFS_SETTOK_SETPAG)
temp |= 0x8000;
- bcopy(&temp, tp, sizeof(afs_int32));
+ memcpy(tp, &temp, sizeof(afs_int32));
tp += sizeof(afs_int32);
/* finally copy in the cell name */
(strcmp (local_tokens[i].server.name, aserver->name) == 0) &&
(strcmp (local_tokens[i].server.instance, aserver->instance) == 0) &&
(strcmp (local_tokens[i].server.cell, aserver->cell) == 0)) {
- bcopy (&local_tokens[i].token, atoken, min (atokenLen, sizeof(struct ktc_token)));
+ memcpy (atoken, &local_tokens[i].token, min (atokenLen, sizeof(struct ktc_token)));
if (aclient)
*aclient = local_tokens[i].client;
UNLOCK_GLOBAL_MUTEX
if (aclient)
strcpy(aclient->cell, lcell);
- bcopy(&ctoken, atoken,
+ memcpy(atoken, &ctoken,
min (atokenLen, sizeof(struct ktc_token)));
afs_tf_close();
/* next iterator determined by earlier loop */
*aindex = index+1;
- bcopy(tp, &temp, sizeof(afs_int32)); /* get size of secret token */
+ memcpy(&temp, tp, sizeof(afs_int32)); /* get size of secret token */
tp += sizeof(afs_int32);
tp += temp; /* skip ticket for now */
- bcopy(tp, &temp, sizeof(afs_int32)); /* get size of clear token */
+ memcpy(&temp, tp, sizeof(afs_int32)); /* get size of clear token */
if (temp != sizeof(struct ClearToken)) {
UNLOCK_GLOBAL_MUTEX
return KTC_ERROR;
(void) close(fd);
fd = -1; /* see declaration of fd above */
}
- bzero(tfbfr, sizeof(tfbfr));
+ memset(tfbfr, 0, sizeof(tfbfr));
}
/*
if ((fd = open(file, O_RDWR, 0)) < 0)
goto out; /* can't zero it, but we can still try truncating it */
- bzero(zerobuf, sizeof(zerobuf));
+ memset(zerobuf, 0, sizeof(zerobuf));
for (i = 0; i < sbuf.st_size; i += sizeof(zerobuf))
if (write(fd, zerobuf, sizeof(zerobuf)) != sizeof(zerobuf)) {
if ((fd = open(file, O_RDWR, 0)) < 0)
goto out;
- bzero(buf, BUFSIZ);
+ memset(buf, 0, BUFSIZ);
for (i = 0; i < statb.st_size; i += BUFSIZ)
if (write(fd, buf, BUFSIZ) != BUFSIZ) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/auth/setkey.c,v 1.1.1.4 2001/07/14 22:20:41 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/auth/setkey.c,v 1.1.1.5 2001/09/11 14:31:23 hartmans Exp $");
#include <sys/types.h>
#include <stdio.h>
#include <WINNT/afsreg.h>
#include <WINNT/afsevent.h>
#endif
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#ifdef HAVE_NETINET_IN_H
printf(" Ex: setkey add 0 \"80b6a7cd7a9dadb6\"\n");
exit(1);
}
- bzero(tkey, sizeof(tkey));
+ memset(tkey, 0, sizeof(tkey));
for(i=7, cp = argv[3] + 15;i>=0; i--,cp-=2)
tkey[i] = char2hex(*cp) + char2hex(*(cp-1))*16;
char hexbuf[17];
unsigned char c;
int j;
- bcopy(tkeys.key[i].key, tbuffer, 8);
+ memcpy(tbuffer, tkeys.key[i].key, 8);
tbuffer[8] = 0;
for(j=0;j<8;j++) {
c = tbuffer[j];
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/auth/test/testcellconf.c,v 1.1.1.4 2001/07/14 22:20:41 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/auth/test/testcellconf.c,v 1.1.1.5 2001/09/11 14:31:24 hartmans Exp $");
#include <sys/types.h>
#include <stddef.h>
printf("Cell %s:\n", ainfo->name);
for(i=0;i<ainfo->numServers;i++) {
- bcopy(&ainfo->hostAddr[i].sin_addr, &temp, sizeof(long));
+ memcpy(&temp, &ainfo->hostAddr[i].sin_addr, sizeof(long));
printf(" host %s at %x.%x\n", ainfo->hostName[i], temp, ainfo->hostAddr[i].sin_port);
}
return 0;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/auth/writeconfig.c,v 1.1.1.5 2001/07/14 22:20:40 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/auth/writeconfig.c,v 1.1.1.6 2001/09/11 14:31:23 hartmans Exp $");
#include <afs/pthread_glock.h>
#include <afs/afsutil.h>
printf("Host %s not found in host database...\n", aci->hostName[i]);
return AFSCONF_FAILURE;
}
- bcopy(th->h_addr, &aci->hostAddr[i].sin_addr, sizeof(afs_int32));
+ memcpy(&aci->hostAddr[i].sin_addr, th->h_addr, sizeof(afs_int32));
}
/* otherwise we're deleting this entry */
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bnode.c,v 1.1.1.5 2001/07/14 22:20:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bnode.c,v 1.1.1.6 2001/09/11 14:31:25 hartmans Exp $");
#include <stddef.h>
#include <stdlib.h>
}
if (!tt) {
tt = (struct bnode_type *) malloc(sizeof(struct bnode_type));
- bzero(tt, sizeof(struct bnode_type));
+ memset(tt, 0, sizeof(struct bnode_type));
tt->next = allTypes;
allTypes = tt;
tt->name = atype;
struct bnode **lb, *nb;
/* format the bnode properly */
- bzero(abnode, sizeof(struct bnode));
+ memset(abnode, 0, sizeof(struct bnode));
abnode->ops = abnodeops;
abnode->name = (char *) malloc(strlen(aname)+1);
strcpy(abnode->name, aname);
if (initDone) return 0;
initDone = 1;
- bzero(&bnode_stats, sizeof(bnode_stats));
+ memset(&bnode_stats, 0, sizeof(bnode_stats));
LWP_InitializeProcessSupport(1, &junk); /* just in case */
IOMGR_Initialize();
code = LWP_CreateProcess(bproc, BNODE_LWP_STACKSIZE,
/* priority */ 1, /* parm */0, "bnode-manager", &bproc_pid);
if (code) return code;
- bzero((char *)&newaction, sizeof(newaction));
+ memset((char *)&newaction, 0, sizeof(newaction));
newaction.sa_handler = bnode_Int;
code = sigaction(SIGCHLD, &newaction, NULL);
if (code) return errno;
code = bnode_ParseLine(aexecString, &tlist); /* try parsing first */
if (code) return code;
tp = (struct bnode_proc *) malloc(sizeof(struct bnode_proc));
- bzero(tp, sizeof(struct bnode_proc));
+ memset(tp, 0, sizeof(struct bnode_proc));
tp->next = allProcs;
allProcs = tp;
*aproc = tp;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bos.c,v 1.1.1.6 2001/07/14 22:20:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bos.c,v 1.1.1.7 2001/09/11 14:31:25 hartmans Exp $");
#include <afs/stds.h>
#include <stdlib.h>
printf("bos: can't find address for host '%s'\n", hostname);
exit(1);
}
- bcopy(th->h_addr, &addr, sizeof(afs_int32));
+ memcpy(&addr, th->h_addr, sizeof(afs_int32));
/* get tokens for making authenticated connections */
localauth = (as->parms[ADDPARMOFFSET + 2].items != 0);
register char *tp;
strcpy(aresult, adir);
- tp = rindex(aname, '/');
+ tp = strrchr(aname, '/');
if (!tp) {
/* no '/' in name */
strcat(aresult, "/");
char buf[BUFSIZ], ver[BUFSIZ];
tconn = GetConn(as, 1);
- bzero(&tkey, sizeof(struct ktc_encryptionKey));
+ memset(&tkey, 0, sizeof(struct ktc_encryptionKey));
if(as->parms[1].items)
strcpy(buf,as->parms[1].items->data);
char *orphans;
char *tp;
- bzero(&mrafsParm, sizeof(mrafsParm));
+ memset(&mrafsParm, 0, sizeof(mrafsParm));
/* parm 0 is machine name, 1 is partition, 2 is volume, 3 is -all flag */
tconn = GetConn(as, 0);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosoprocs.c,v 1.1.1.5 2001/07/14 22:20:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosoprocs.c,v 1.1.1.6 2001/09/11 14:31:26 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
code = 0; /* assume success */
switch (atype) {
case 1:
- bcopy(&bozo_nextRestartKT, aktime, sizeof(struct ktime));
+ memcpy(aktime, &bozo_nextRestartKT, sizeof(struct ktime));
break;
case 2:
- bcopy(&bozo_nextDayKT, aktime, sizeof(struct ktime));
+ memcpy(aktime, &bozo_nextDayKT, sizeof(struct ktime));
break;
default:
code = 0; /* assume success */
switch (atype) {
case 1:
- bcopy(aktime, &bozo_nextRestartKT, sizeof(struct ktime));
+ memcpy(&bozo_nextRestartKT, aktime, sizeof(struct ktime));
break;
case 2:
- bcopy(aktime, &bozo_nextDayKT, sizeof(struct ktime));
+ memcpy(&bozo_nextDayKT, aktime, sizeof(struct ktime));
break;
default:
goto fail;
}
- bzero(&tcell.hostAddr[which], sizeof(struct sockaddr_in));
- bzero(tcell.hostName[which], MAXHOSTCHARS);
+ memset(&tcell.hostAddr[which], 0, sizeof(struct sockaddr_in));
+ memset(tcell.hostName[which], 0, MAXHOSTCHARS);
code = afsconf_SetCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell);
fail:
}
}
- bzero(&tcell.hostAddr[which], sizeof(struct sockaddr_in));
+ memset(&tcell.hostAddr[which], 0, sizeof(struct sockaddr_in));
strcpy(tcell.hostName[which], aname);
code = afsconf_SetCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell);
goto fail;
}
*akvno = tkeys.key[an].kvno;
- bzero(akeyinfo, sizeof(struct bozo_keyInfo));
+ memset(akeyinfo, 0, sizeof(struct bozo_keyInfo));
noauth = afsconf_GetNoAuthFlag(bozo_confdir);
rxkad_GetServerInfo(acall->conn, &enc_level, 0, 0, 0, 0, 0);
*/
if ((noauth) || (enc_level == rxkad_crypt)) {
- bcopy(tkeys.key[an].key, akey, 8);
+ memcpy(akey, tkeys.key[an].key, 8);
}
- else bzero (akey, 8);
+ else memset(akey, 0, 8);
code = stat(AFSDIR_SERVER_KEY_FILEPATH, &tstat);
if (code == 0) {
strcpy(*atype, tb->type->name);
else
(*atype)[0] = 0; /* null string */
- bzero(astatus, sizeof(struct bozo_status)); /* good defaults */
+ memset(astatus, 0, sizeof(struct bozo_status)); /* good defaults */
astatus->goal = tb->goal;
astatus->fileGoal = tb->fileGoal;
astatus->procStartTime = tb->procStartTime;
bnode_Hold(tb);
if (anum == 999) {
if (tb->notifier) {
- bcopy(tb->notifier, tp, strlen(tb->notifier)+1);
+ memcpy(tp, tb->notifier, strlen(tb->notifier)+1);
code = 0;
} else
code = BZNOENT; /* XXXXX */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosserver.c,v 1.1.1.7 2001/07/14 22:20:44 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosserver.c,v 1.1.1.8 2001/09/11 14:31:27 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
bozo_Log("try the 'hostname' command\n");
exit(1);
}
- bzero(tcell.hostAddr, sizeof(tcell.hostAddr)); /* not computed */
+ memset(tcell.hostAddr, 0, sizeof(tcell.hostAddr)); /* not computed */
code = afsconf_SetCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell);
if (code) {
bozo_Log("could not create cell database in '%s' (code %d), quitting\n", AFSDIR_SERVER_ETC_DIRPATH, code);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/cronbnodeops.c,v 1.1.1.4 2001/07/14 22:20:45 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/cronbnodeops.c,v 1.1.1.5 2001/09/11 14:31:27 hartmans Exp $");
#include <sys/types.h>
#include <sys/stat.h>
}
te = (struct cronbnode *) malloc(sizeof(struct cronbnode));
- bzero(te, sizeof(struct cronbnode));
+ memset(te, 0, sizeof(struct cronbnode));
code = ktime_ParsePeriodic(awhen, &te->whenToRun);
if (code < 0) {
free(te);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/ezbnodeops.c,v 1.1.1.4 2001/07/14 22:20:45 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/ezbnodeops.c,v 1.1.1.5 2001/09/11 14:31:28 hartmans Exp $");
#include <sys/types.h>
#include <errno.h>
}
te = (struct ezbnode *) malloc(sizeof(struct ezbnode));
- bzero(te, sizeof(struct ezbnode));
+ memset(te, 0, sizeof(struct ezbnode));
bnode_InitBnode(te, &ezbnode_ops, ainstance);
te->command = cmdpath;
return (struct bnode *) te;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/fsbnodeops.c,v 1.1.1.5 2001/07/14 22:20:45 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/fsbnodeops.c,v 1.1.1.6 2001/09/11 14:31:28 hartmans Exp $");
#include <sys/types.h>
#include <lwp.h>
}
te = (struct fsbnode *) malloc(sizeof(struct fsbnode));
- bzero(te, sizeof(struct fsbnode));
+ memset(te, 0, sizeof(struct fsbnode));
te->filecmd = fileCmdpath;
te->volcmd = volCmdpath;
te->salcmd = salCmdpath;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bu_utils/fms.c,v 1.1.1.4 2001/07/14 22:20:46 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bu_utils/fms.c,v 1.1.1.5 2001/09/11 14:31:30 hartmans Exp $");
#undef IN
#include <stdio.h>
struct sigaction intaction, oldaction;
struct cmd_syndesc *cptr;
- bzero((char *)&intaction, sizeof(intaction));
+ memset((char *)&intaction, 0, sizeof(intaction));
intaction.sa_handler = (int (*)())quitFms;
sigaction(SIGINT, &intaction, &oldaction);
if ( dB_buffer == 0 )
ERROR(-1);
dB_buffersize = reqSize;
- bzero(dB_buffer, dB_buffersize);
+ memset(dB_buffer, 0, dB_buffersize);
}
ptr = (int *) dB_buffer;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/bc_status.c,v 1.1.1.4 2001/07/14 22:20:48 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/bc_status.c,v 1.1.1.5 2001/09/11 14:31:32 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
statusWatcher()
{
- struct rx_connection *tconn = (struct rc_connection *)0;
+ struct rx_connection *tconn = (struct rc_connection *)0;
statusP curPollPtr = 0;
struct tciStatusS statusPtr;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/commands.c,v 1.1.1.5 2001/07/14 22:20:50 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/commands.c,v 1.1.1.6 2001/09/11 14:31:33 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
*ss = 0;
return(BC_NOMEM);
}
- bzero(*ss, sizeof(struct serversort));
+ memset(*ss, 0, sizeof(struct serversort));
(*ss)->ipaddr = server;
(*ss)->next = *serverlist;
*serverlist = *ss;
*ss = 0;
return(BC_NOMEM);
}
- bzero(*ps, sizeof(struct partitionsort));
+ memset(*ps, 0, sizeof(struct partitionsort));
(*ps)->part = partition;
(*ps)->next = (*ss)->partitions;
(*ss)->partitions = *ps;
com_err(whoami, BC_NOMEM, "");
ERROR(BC_NOMEM);
}
- bzero(tvd, sizeof(*tvd));
+ memset(tvd, 0, sizeof(*tvd));
tvd->name = (char *) malloc(strlen(entries[e].name)+10);
if (!(tvd->name)) {
*/
for (index=0; 1; index=next_index)
{ /*w*/
- bzero(&entry, sizeof(entry));
+ memset(&entry, 0, sizeof(entry));
code = ubik_Call(VL_ListEntry, /*Routine to invoke*/
uclient, /*Ubik client structure*/
0, /*Ubik flags*/
com_err(whoami, BC_NOMEM,"");
return(BC_NOMEM);
}
- bzero(tvd, sizeof(*tvd));
+ memset(tvd, 0, sizeof(*tvd));
tvd->name = (char *) malloc(strlen(entry.name)+10);
if (!(tvd->name))
tp = as->parms[0].items->data;
- if (index(tp, '.') == 0)
+ if (strchr(tp, '.') == 0)
{
slot = bc_SafeATOI(tp);
if (slot == -1)
com_err(whoami,BC_NOMEM,"");
return BC_NOMEM;
}
- bzero(tvol, sizeof(struct bc_volumeDump));
+ memset(tvol, 0, sizeof(struct bc_volumeDump));
tvol->name = (char *) malloc(VOLSER_MAXVOLNAME +1);
if (!tvol->name)
}
/* create a volume set corresponding to the volume pattern we've been given */
- bzero(&tvolumeSet, sizeof(tvolumeSet));
- bzero(&tvolumeEntry, sizeof(tvolumeEntry));
+ memset(&tvolumeSet, 0, sizeof(tvolumeSet));
+ memset(&tvolumeEntry, 0, sizeof(tvolumeEntry));
tvolumeSet.name = "TempVolumeSet";
tvolumeSet.ventries = &tvolumeEntry;
tvolumeEntry.serverName = as->parms[0].items->data;
}
}
else /* use destination host == original host */
- bcopy(&tvolumeEntry.server, &destServ, sizeof(destServ));
+ memcpy(&destServ, &tvolumeEntry.server, sizeof(destServ));
/* specified other destination partition */
if (as->parms[9].items)
/* Allocate a volumeDump structure and link it in */
tvol = (struct bc_volumeDump *) malloc(sizeof(struct bc_volumeDump));
- bzero(tvol, sizeof(struct bc_volumeDump));
+ memset(tvol, 0, sizeof(struct bc_volumeDump));
tvol->name = (char *) malloc(VOLSER_MAXVOLNAME+1);
if (!tvol->name)
return BC_NOMEM;
}
strncpy(tvol->name, volume, VOLSER_OLDMAXVOLNAME);
- bcopy(&destServer, &tvol->server, sizeof(destServer));
+ memcpy(&tvol->server, &destServer, sizeof(destServer));
tvol->partition = destPartition;
if (lastVol) lastVol->next = tvol; /* thread onto end of list */
if (parent) problemFindingDump = 1;
parent = dumpEntry.id;
level = dumpEntry.level+1;
- bcopy(&dumpEntry, &fde, sizeof(dumpEntry));
+ memcpy(&fde, &dumpEntry, sizeof(dumpEntry));
}
else {
/* Dump hierarchy not complete so can't base off the latest */
tempPtr = (struct dumpedVol *) malloc(sizeof(struct dumpedVol));
if (!tempPtr) ERROR(BC_NOMEM);
- bzero(tempPtr, sizeof(*tempPtr));
+ memset(tempPtr, 0, sizeof(*tempPtr));
tempPtr->incTime = volumeEntry[i].clone;
tempPtr->dumpID = volumeEntry[i].dump;
strncpy(tempPtr->tapeName, volumeEntry[i].tape, BU_MAXTAPELEN);
ERROR(BC_NOMEM);
}
- bzero(tapeLinkPtr, sizeof(*tapeLinkPtr));
+ memset(tapeLinkPtr, 0, sizeof(*tapeLinkPtr));
code = bcdb_FindTapeSeq(dumpid, tapeNumber, &tapeLinkPtr->tapeEntry);
if (code)
{
com_err(whoami,BC_NOMEM,"");
ERROR(BC_NOMEM);
}
- bzero(volumeLinkPtr, sizeof(*volumeLinkPtr));
+ memset(volumeLinkPtr, 0, sizeof(*volumeLinkPtr));
- bcopy(&vl.budb_volumeList_val[i], &volumeLinkPtr->volumeEntry,
- sizeof(struct budb_volumeEntry));
+ memcpy(&volumeLinkPtr->volumeEntry, &vl.budb_volumeList_val[i], sizeof(struct budb_volumeEntry));
/* now insert it onto the right place */
while ( (*link != 0) &&
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/config.c,v 1.1.1.4 2001/07/14 22:20:51 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/config.c,v 1.1.1.5 2001/09/11 14:31:33 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
if (!tb) return(BC_NOMEM);
bc_globalConfig = tb;
- bzero(tb, sizeof(struct bc_config));
+ memset(tb, 0, sizeof(struct bc_config));
tb->path = (char *) malloc(strlen(apath)+1);
if (!tb->path)
{
/* tlast now points to the next pointer (or head pointer) we should overwrite */
tentry = (struct bc_hostEntry *) malloc(sizeof(struct bc_hostEntry));
- bzero(tentry, sizeof(*tentry));
+ memset(tentry, 0, sizeof(*tentry));
tentry->name = (char *) malloc(strlen(aname)+1);
strcpy(tentry->name, aname);
*tlast = tentry;
tentry->next = (struct bc_hostEntry *) 0;
tentry->addr.sin_family = AF_INET;
- bcopy(th->h_addr, &tentry->addr.sin_addr.s_addr, sizeof(afs_int32));
+ memcpy(&tentry->addr.sin_addr.s_addr, th->h_addr, sizeof(afs_int32));
tentry->addr.sin_port = 0;
tentry->portOffset = aport;
return 0;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dsstub.c,v 1.1.1.4 2001/07/14 22:20:51 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dsstub.c,v 1.1.1.5 2001/09/11 14:31:34 hartmans Exp $");
#include <sys/types.h>
#include <afs/cmd.h>
char *pathNamePtr;
{
char *ptr;
- ptr = rindex(pathNamePtr, '/');
+ ptr = strrchr(pathNamePtr, '/');
if ( ptr == 0 )
{
/* this should never happen */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dsvs.c,v 1.1.1.4 2001/07/14 22:20:51 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dsvs.c,v 1.1.1.5 2001/09/11 14:31:35 hartmans Exp $");
#include <sys/types.h>
#include <afs/cmd.h>
asockaddr->sin_family = AF_INET;
asockaddr->sin_port = 0;
addr = (b1<<24) | (b2<<16) | (b3<<8) | b4;
- bcopy(&addr,&tmp1,sizeof(afs_int32));
+ memcpy(&tmp1, &addr, sizeof(afs_int32));
tmp2 = htonl(tmp1);
- bcopy(&tmp2, &asockaddr->sin_addr.s_addr, sizeof(afs_int32));
+ memcpy(&asockaddr->sin_addr.s_addr, &tmp2, sizeof(afs_int32));
return(0);
}
*/
if (strcmp(aname, ".*") == 0) {
- bzero(asockaddr, sizeof(struct sockaddr_in));
+ memset(asockaddr, 0, sizeof(struct sockaddr_in));
return 0;
}
*/
asockaddr->sin_family = AF_INET;
asockaddr->sin_port = 0;
- bcopy(th->h_addr,&tmp1,sizeof(afs_int32));
+ memcpy(&tmp1, th->h_addr, sizeof(afs_int32));
tmp2 = htonl(tmp1);
- bcopy(&tmp2,&(asockaddr->sin_addr.s_addr),
- sizeof(asockaddr->sin_addr.s_addr));
+ memcpy(&(asockaddr->sin_addr.s_addr), &tmp2, sizeof(asockaddr->sin_addr.s_addr));
return(0);
} /*bc_ParseHost*/
/* move to end of the list */
nset = (struct bc_volumeSet *) malloc(sizeof(struct bc_volumeSet));
- bzero(nset, sizeof(*nset));
+ memset(nset, 0, sizeof(*nset));
nset->flags = aflags;
nset->name = (char *) malloc(strlen(avolName)+1);
strcpy(nset->name, avolName);
/* move to end of the list */
for(tentry = *tlast; tentry; tlast = &tentry->next, tentry = *tlast);
tentry = (struct bc_volumeEntry *) malloc(sizeof(struct bc_volumeEntry));
- bzero(tentry, sizeof(*tentry));
+ memset(tentry, 0, sizeof(*tentry));
tentry->serverName = (char *) malloc(strlen(ahost)+1);
strcpy(tentry->serverName, ahost);
tentry->partname = (char *) malloc(strlen(apart)+1);
return -2; /* name specification error */
tdump = (struct bc_dumpSchedule *) malloc(sizeof(struct bc_dumpSchedule));
- bzero(tdump, sizeof(*tdump));
+ memset(tdump, 0, sizeof(*tdump));
/* prepend this node to the dump schedule list */
tdump->next = aconfig->dsched;
matchLength = 0;
curptr = &nodeString[1]; /* past first / */
- separator = index(curptr, '/');
+ separator = strchr(curptr, '/');
if ( separator == 0 )
matchLength = strlen(curptr) + 1; /* +1 for leading / */
else
return(-3);
}
- separator = index(curptr, '/');
+ separator = strchr(curptr, '/');
if ( separator == 0 )
matchLength = strlen(&nodeString[0]);
else
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dump.c,v 1.1.1.4 2001/07/14 22:20:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dump.c,v 1.1.1.5 2001/09/11 14:31:35 hartmans Exp $");
#include <sys/types.h>
#include <afs/cmd.h>
baseNamePtr = tailCompPtr(dumpTaskPtr->dumpName);
/* setup the interface structure */
- bzero(tcdiPtr, sizeof(*tcdiPtr));
+ memset(tcdiPtr, 0, sizeof(*tcdiPtr));
/* general */
strcpy(tcdiPtr->dumpPath, dumpTaskPtr->dumpName);
return(BC_NOTLOCKED);
}
- bzero(&bc_dumpTasks[i], sizeof(struct bc_dumpTask));
+ memset(&bc_dumpTasks[i], 0, sizeof(struct bc_dumpTask));
bc_dumpTasks[i].callProc = aproc;
bc_dumpTasks[i].config = aconfig;
bc_dumpTasks[i].volumes = avolsToDump;
bc_dumpTasks[i].expType = dsptr->expType;
}
if (adestServer)
- bcopy(adestServer, &bc_dumpTasks[i].destServer, sizeof(struct sockaddr_in));
+ memcpy(&bc_dumpTasks[i].destServer, adestServer, sizeof(struct sockaddr_in));
else
- bzero(&bc_dumpTasks[i].destServer, sizeof(struct sockaddr_in));
+ memset(&bc_dumpTasks[i].destServer, 0, sizeof(struct sockaddr_in));
code = LWP_CreateProcess(bc_DmpRstStart, 20480, LWP_NORMAL_PRIORITY, i, "helper", &junk);
if (code)
code = ConnectButc(config, port, &tconn);
if (code) return(code);
- bzero(&label,sizeof(label));
+ memset(&label, 0, sizeof(label));
if (afsname)
strcpy(label.afsname, afsname);
if (pname)
code = ConnectButc(config, port, &tconn);
if (code) return(code);
- bzero(&label,sizeof(label));
+ memset(&label, 0, sizeof(label));
code = TC_ReadLabel(tconn, &label, &taskId);
if (code) {
if (code == BUTM_NOLABEL) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dump_sched.c,v 1.1.1.4 2001/07/14 22:20:48 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dump_sched.c,v 1.1.1.5 2001/09/11 14:31:36 hartmans Exp $");
#ifdef AFS_NT40_ENV
#include <winsock2.h>
return (BC_INTERNALERROR);
}
tds = (struct bc_dumpSchedule *)malloc(sizeof(struct bc_dumpSchedule));
- bzero(tds, sizeof(*tds));
+ memset(tds, 0, sizeof(*tds));
tds->next = (struct bc_dumpSchedule *) 0;
tds->name = (char *) malloc(strlen(dsname)+1);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/expire.c,v 1.1.1.4 2001/07/14 22:20:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/expire.c,v 1.1.1.5 2001/09/11 14:31:36 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
afs_int32 longDate;
struct ktime_date *kdptr;
{
- bzero(kdptr, sizeof(*kdptr));
+ memset(kdptr, 0, sizeof(*kdptr));
kdptr->day = longDate % (MAX_DAY_VALUE + 1);
if ( kdptr->day != 0 )
afs_int32 value, digit_limit;
afs_int32 type_index;
- bzero(relDatePtr, sizeof(*relDatePtr));
+ memset(relDatePtr, 0, sizeof(*relDatePtr));
type_index = 0;
while ( 1 )
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/main.c,v 1.1.1.5 2001/07/20 10:06:30 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/main.c,v 1.1.1.6 2001/09/11 14:31:36 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
for ( i = 0; i < TB_NUM; i++ )
{
- bzero(ctPtr, sizeof(*ctPtr));
+ memset(ctPtr, 0, sizeof(*ctPtr));
ctPtr->textType = i;
ctPtr->textVersion = -1;
ctPtr++;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/restore.c,v 1.1.1.4 2001/07/14 22:20:53 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/restore.c,v 1.1.1.5 2001/09/11 14:31:37 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
extern char *whoami;
extern struct rx_connection *bc_GetConn();
-#ifdef AFS_SGI64_ENV
-extern char *rindex();
-#endif
-
#define BC_MAXLEVELS 20
#define MAXTAPESATONCE 10
{
char *sptr;
- sptr = rindex(tapename, '.');
+ sptr = strrchr(tapename, '.');
if ( !sptr ) return(-1);
sptr++;
return(atol(sptr));
com_err(whoami,BC_NOMEM,"");
ERROR(BC_NOMEM);
}
- bzero (di, sizeof(struct dumpinfo));
+ memset(di, 0, sizeof(struct dumpinfo));
di->DumpId = dumpDescr->id;
di->initialDumpId = dumpDescr->initialDumpID;
com_err(whoami,BC_NOMEM,"");
ERROR(BC_NOMEM);
}
- bzero (vi, sizeof(struct volinfo));
+ memset(vi, 0, sizeof(struct volinfo));
vi->volname = (char*)malloc(strlen(vname)+1);
if (!vi->volname)
for (di=dumpinfolist; di; di=di->next)
{
/* Find each of the parent dumps */
- bcopy(di, &dlevels[0], sizeof(struct dumpinfo));
+ memcpy(&dlevels[0], di, sizeof(struct dumpinfo));
for (lvl=1, parent=dlevels[0].parentDumpId; parent;
parent=dlevels[lvl].parentDumpId, lvl++)
{
com_err(whoami,BC_NOMEM,"");
return(BC_NOMEM);
}
- bzero(tle, sizeof(struct bc_tapeList));
+ memset(tle, 0, sizeof(struct bc_tapeList));
tle->tapeName = (char*)malloc(strlen(volumeEntries[ve].tape)+1);
if (!tle->tapeName)
com_err(whoami,BC_NOMEM,"");
return(BC_NOMEM);
}
- bzero(ti, sizeof(struct bc_tapeItem));
+ memset(ti, 0, sizeof(struct bc_tapeItem));
ti->volumeName = (char*)malloc(strlen(volumeEntries[ve].name)+1);
if (!ti->volumeName)
com_err(whoami,BC_NOMEM,"");
ERROR(BC_NOMEM);
}
- bzero(tcarray, nentries*sizeof(struct tc_restoreDesc));
+ memset(tcarray, 0, nentries*sizeof(struct tc_restoreDesc));
/* Fill in the array with the list above */
i = 0;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/status.c,v 1.1.1.4 2001/07/14 22:20:53 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/status.c,v 1.1.1.5 2001/09/11 14:31:37 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
{
return(0);
}
- bzero(ptr, sizeof(*ptr));
+ memset(ptr, 0, sizeof(*ptr));
/* link it onto the chain of status entries */
ObtainWriteLock(&statusQueueLock);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/tape_hosts.c,v 1.1.1.4 2001/07/14 22:20:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/tape_hosts.c,v 1.1.1.5 2001/09/11 14:31:38 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
the = (struct bc_hostEntry *) malloc(sizeof(struct bc_hostEntry));
if (the == (struct bc_hostEntry *)0)
return (BC_NOMEM);
- bzero(the, sizeof(struct bc_hostEntry));
+ memset(the, 0, sizeof(struct bc_hostEntry));
if (tlast)
{
tlast->next = the;
strcpy(the->name, hostName);
the->portOffset = port;
if (th) {
- bcopy(th->h_addr, &the->addr.sin_addr.s_addr, 4);
+ memcpy(&the->addr.sin_addr.s_addr, th->h_addr, 4);
the->addr.sin_family = AF_INET;
the->addr.sin_port = 0;
}
printf("tape controller received request to start dump %s.\n", adumpName);
*adumpID = ++transID; /* send result back to caller */
- bzero(&tdentry, sizeof(tdentry));
+ memset(&tdentry, 0, sizeof(tdentry));
tdentry.created = time(0);
strcpy(tdentry.name, atapeSet->format);
strcat(tdentry.name, ".");
printf("created dump %d\n", tdentry.id);
/* start tape (preent all fits on one tape at first */
- bzero(&ttentry, sizeof(ttentry));
+ memset(&ttentry, 0, sizeof(ttentry));
sprintf(ttentry.name, tdentry.tapes.format, 1);
ttentry.written = time(0);
ttentry.dump = tdentry.id; /* dump we're in */
tdescr = adumpArray->tc_dumpArray_val;
for(i=0;i<adumpArray->tc_dumpArray_len;i++, tdescr++) {
- bcopy(tdescr->hostID, &taddr, sizeof(taddr));
+ memcpy(&taddr, tdescr->hostID, sizeof(taddr));
printf("dumping volid %s(%d) from host %08x since date %d\n", tdescr->name,
tdescr->vid, taddr.sin_addr.s_addr, tdescr->date);
- bzero(&tventry, sizeof(tventry));
+ memset(&tventry, 0, sizeof(tventry));
strcpy(tventry.name, tdescr->name);
tventry.clone = tdescr->date;
tventry.seq = 0; /* frag in volume */
printf("tape controller received request to start restore %s.\n", aname);
tdescr = arestore->tc_restoreArray_val;
for(i=0;i<arestore->tc_restoreArray_len; i++, tdescr++) {
- bcopy(tdescr->hostID, &taddr, sizeof(taddr));
+ memcpy(&taddr, tdescr->hostID, sizeof(taddr));
printf("restoring frag %d of volume %s from tape %s at position %d.\n New name is '%s', new vid is %d, new host is %08x, new partition is %d\n",
tdescr->frag, tdescr->oldName, tdescr->tapeName, tdescr->position, tdescr->newName,
tdescr->vid, taddr.sin_addr.s_addr, tdescr->partition);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/ubik_db_if.c,v 1.1.1.5 2001/07/14 22:20:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/ubik_db_if.c,v 1.1.1.6 2001/09/11 14:31:38 hartmans Exp $");
#include <stdio.h>
#include <sys/types.h>
goto error;
}
- bcopy(dl.budb_dumpList_val, deptr, sizeof(*deptr));
+ memcpy(deptr, dl.budb_dumpList_val, sizeof(*deptr));
exit:
if ( dl.budb_dumpList_val )
return(code);
error:
- bzero(deptr, sizeof(*deptr));
+ memset(deptr, 0, sizeof(*deptr));
goto exit;
}
afs_int32 dbTime;
afs_int32 code = 0;
- bzero(teptr, sizeof(*teptr));
+ memset(teptr, 0, sizeof(*teptr));
tl.budb_tapeList_len = 0;
tl.budb_tapeList_val = 0;
if (tl.budb_tapeList_len != 1)
ERROR(BC_NOTUNIQUE); /* expecting a single descriptor */
- bcopy(tl.budb_tapeList_val, teptr, sizeof(*teptr));
+ memcpy(teptr, tl.budb_tapeList_val, sizeof(*teptr));
error_exit:
if ( tl.budb_tapeList_val )
afs_int32 dbTime;
afs_int32 code = 0;
- bzero(teptr, sizeof(*teptr));
+ memset(teptr, 0, sizeof(*teptr));
tl.budb_tapeList_len = 0;
tl.budb_tapeList_val = 0;
if (tl.budb_tapeList_len != 1)
ERROR(BC_NOTUNIQUE); /* expecting a single descriptor */
- bcopy(tl.budb_tapeList_val, teptr, sizeof(*teptr));
+ memcpy(teptr, tl.budb_tapeList_val, sizeof(*teptr));
error_exit:
if ( tl.budb_tapeList_val )
if ( code )
{
/* error. Clean up single server state */
- bzero(&uServer, sizeof(uServer));
+ memset(&uServer, 0, sizeof(uServer));
}
return(code);
}
else
if ( (aflags & UF_END_SINGLESERVER) != 0 )
{
- bzero(&uServer, sizeof(uServer));
+ memset(&uServer, 0, sizeof(uServer));
return(0);
}
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/vol_sets.c,v 1.1.1.6 2001/07/14 22:20:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/vol_sets.c,v 1.1.1.7 2001/09/11 14:31:40 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
* global configuration structure.
*/
tvs = (struct bc_volumeSet *) malloc(sizeof(struct bc_volumeSet));
- bzero(tvs, sizeof(*tvs));
+ memset(tvs, 0, sizeof(*tvs));
tvs->name = (char *) malloc(strlen(vsname)+1);
strcpy(tvs->name, vsname);
com_err(whoami,0, "Can't malloc() a new volume spec record!");
return(-1);
}
- bzero(tve, sizeof(*tve));
+ memset(tve, 0, sizeof(*tve));
if (bc_ParseHost(serverName, &(tve->server)))
com_err(whoami,0, "Can't get required info on host '%s'", serverName);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/budb/database.c,v 1.1.1.4 2001/07/14 22:20:56 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/budb/database.c,v 1.1.1.5 2001/09/11 14:31:41 hartmans Exp $");
#ifdef AFS_NT40_ENV
#include <winsock2.h>
pollCount = 0;
- bzero (&db, sizeof(db));
+ memset(&db, 0, sizeof(db));
Lock_Init (&db.lock);
if ((code = InitDBalloc ()) || (code = InitDBhash ()))
return code;
LogDebug(0, "No data base - Building new one\n");
/* try to write a good header */
- bzero(&db.h,sizeof(db.h));
+ memset(&db.h, 0, sizeof(db.h));
db.h.version = htonl(BUDB_VERSION);
db.h.checkVersion = htonl(BUDB_VERSION);
db.h.lastUpdate = db.h.lastDumpId = htonl(time(0));
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_alloc.c,v 1.1.1.4 2001/07/14 22:20:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_alloc.c,v 1.1.1.5 2001/09/11 14:31:41 hartmans Exp $");
#ifdef AFS_NT40_ENV
#include <winsock2.h>
}
/* clear and return the block */
- bzero (block, sizeof(*block));
+ memset(block, 0, sizeof(*block));
*aP = a;
return 0;
}
dbadr a; /* db address of block */
{
if (a != BlockBase(a)) db_panic ("Block addr no good");
- bzero (bh, sizeof(*bh));
+ memset(bh, 0, sizeof(*bh));
bh->next = db.h.freePtrs[0];
if (set_header_word (ut, freePtrs[0], htonl(a)) ||
dbwrite (ut, a, (char *)bh, sizeof(*bh))) return BUDB_IO;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_dump.c,v 1.1.1.4 2001/07/14 22:20:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_dump.c,v 1.1.1.5 2001/09/11 14:31:41 hartmans Exp $");
#ifdef AFS_NT40_ENV
#include <winsock2.h>
/* Read the dump entry */
if (dbAddr == dbAppAddr) {
/* First time through, don't need to read the dump entry again */
- bcopy(&diskDump, &apDiskDump, sizeof(diskDump));
+ memcpy(&apDiskDump, &diskDump, sizeof(diskDump));
}
else {
if (badEntry(dbAppAddr)) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_hash.c,v 1.1.1.4 2001/07/14 22:20:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_hash.c,v 1.1.1.5 2001/09/11 14:31:42 hartmans Exp $");
#ifdef AFS_NT40_ENV
#include <winsock2.h>
mht->size = nb*sizeof(struct memoryHTBlock *);
b = mht->blocks = (struct memoryHTBlock **)malloc (mht->size);
- bzero (b, mht->size);
+ memset(b, 0, mht->size);
for (i=0; i<nb; i++) {
b[i] = (struct memoryHTBlock *)malloc (sizeof (struct memoryHTBlock));
if (*blocksP == 0) {
*sizeP = ht_TableSize (length);
*blocksP = (struct memoryHTBlock **)malloc (*sizeP);
- bzero (*blocksP, *sizeP);
+ memset(*blocksP, 0, *sizeP);
}
n = *sizeP / sizeof (struct memoryHTBlock *);
if (bi >= n) db_panic ("table size inconsistent");
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_text.c,v 1.1.1.5 2001/07/14 22:20:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_text.c,v 1.1.1.6 2001/09/11 14:31:42 hartmans Exp $");
#ifdef AFS_NT40_ENV
#include <winsock2.h>
textRemaining = BLOCK_DATA_SIZE - blockOffset;
chunkSize = min(textRemaining, transferSize);
- bcopy(&block.a[blockOffset], textPtr, chunkSize);
+ memcpy(textPtr, &block.a[blockOffset], chunkSize);
/* LogDebug(5, "transfering %d bytes: %s\n", chunkSize, textPtr); */
chunkSize = MIN(remainingInBlock, textLength);
/* copy in the data */
- bcopy(textptr, &diskBlock.a[offset % BLOCK_DATA_SIZE], chunkSize);
+ memcpy(&diskBlock.a[offset % BLOCK_DATA_SIZE], textptr, chunkSize);
/* LogDebug(5, "text is %s\n", textptr); */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/budb/dbs_dump.c,v 1.1.1.4 2001/07/14 22:20:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/budb/dbs_dump.c,v 1.1.1.5 2001/09/11 14:31:43 hartmans Exp $");
#ifdef AFS_NT40_ENV
#include <winsock2.h>
LogDebug(5, "Setup dump\n");
/* no dump in progress - setup and retake lock */
- bzero(dumpSyncPtr, sizeof(*dumpSyncPtr));
+ memset(dumpSyncPtr, 0, sizeof(*dumpSyncPtr));
/* ObtainWriteLock(&dumpSyncPtr->ds_lock); */
/* mark dump in progress */
if (code) LogError(code, "Aborting dump transaction\n");
}
- bzero(dumpSyncPtr, sizeof(*dumpSyncPtr));
+ memset(dumpSyncPtr, 0, sizeof(*dumpSyncPtr));
goto exit;
} /*i*/
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/budb/ol_verify.c,v 1.1.1.4 2001/07/14 22:20:59 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/budb/ol_verify.c,v 1.1.1.5 2001/09/11 14:31:43 hartmans Exp $");
#include <stdio.h>
#ifdef AFS_NT40_ENV
bmsize = sizeof(*ablockMap) + (blockEntries[blocktype]-1) * sizeof(ablockMap->entries[0]);
ablockMap = (struct blockMap *) malloc(bmsize);
if (!ablockMap) ERROR(BUDB_NOMEM);
- bzero(ablockMap, bmsize);
+ memset(ablockMap, 0, bmsize);
ablockMap->nEntries = blockEntries[blocktype];
/* save the block header in the block map */
- bcopy(&block.h, &ablockMap->header, sizeof(ablockMap->header));
+ memcpy(&ablockMap->header, &block.h, sizeof(ablockMap->header));
blockMap[i] = ablockMap;
}
/* clear verification statistics */
misc = &miscData;
- bzero (&miscData, sizeof(miscData));
+ memset(&miscData, 0, sizeof(miscData));
#ifdef PDEBUG
miscData.maxErrors = 1000000;
bmsize = nBlocks*sizeof(struct blockMap *);
blockMap = (struct blockMap **) malloc(bmsize);
if (!blockMap) ERROR(BUDB_NOMEM);
- bzero(blockMap, bmsize);
+ memset(blockMap, 0, bmsize);
/* verify blocks and construct the block map */
Log("Read header of every block\n");
if (!th) *host = 0;
else
{
- bcopy(th->h_addr, host, sizeof(afs_int32));
+ memcpy(host, th->h_addr, sizeof(afs_int32));
*host = ntohl(*host);
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/budb/procs.c,v 1.1.1.4 2001/07/14 22:21:02 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/budb/procs.c,v 1.1.1.5 2001/09/11 14:31:45 hartmans Exp $");
#ifdef AFS_NT40_ENV
#include <winsock2.h>
char *pathNamePtr;
{
char *ptr;
- ptr = rindex(pathNamePtr, '/');
+ ptr = strrchr(pathNamePtr, '/');
if ( ptr == 0 )
{
/* this should never happen */
eList->budb_dumpList_val = (struct budb_dumpEntry *)malloc (e_size * to_return);
if (!eList->budb_dumpList_val) return(BUDB_NOMEM);
}
- bzero(eList->budb_dumpList_val, e_size * to_return);
+ memset(eList->budb_dumpList_val, 0, e_size * to_return);
eList->budb_dumpList_len = to_return;
e = (char *)(eList->budb_dumpList_val);
else if ( !VolInfoMatch(volP,viP) ) /* Not the head volinfo struct */
{
hvia = via; /* remember the head volinfo struct */
- bcopy(viP, &hvi, sizeof(hvi));
+ memcpy(&hvi, viP, sizeof(hvi));
/* Search the same name chain for the correct volinfo structure */
for (via=ntohl(viP->sameNameChain); via; via=ntohl(viP->sameNameChain))
ptr = (struct chosenDump *) malloc(sizeof(*ptr));
if (!ptr)
return(0);
- bzero(ptr, sizeof(*ptr));
+ memset(ptr, 0, sizeof(*ptr));
ptr->addr = dumpAddr;
ptr->date = (afs_uint32) ntohl(dumpPtr->created);
}
/* Allocate a dump structure */
- bzero (&d, sizeof(d));
+ memset(&d, 0, sizeof(d));
eval = AllocStructure (ut, dump_BLOCK, 0, &da, &d);
if (eval) ABORT(eval);
/* Construct a database dump name */
strcpy(dumpName, DUMP_TAPE_NAME);
}
- else if (index(dumpPath,'/') == 0) {
+ else if (strchr(dumpPath,'/') == 0) {
int level, old, length, hash;
struct dump hostDump, diskDump;
struct memoryHashTable *mht;
/* end specifies how many dumps */
if (!end) ABORT(BUDB_BADFLAGS);
- bzero(&rock, sizeof(rock));
+ memset(&rock, 0, sizeof(rock));
rock.maxDumps = end;
scanHashTable(ut, &db.dumpName, wantDump, rememberDump, (char *) &rock);
/* Zero volume entry if the last tape has no volumes */
if (!lastVol) {
- bzero(volEntry, sizeof(*volEntry));
+ memset(volEntry, 0, sizeof(*volEntry));
} else {
/* Follow the volumes until we reach the last volume */
eval = dbread (ut,lastVol,&vf,sizeof(vf));
*new = 0;
- bzero (&t, sizeof(t));
+ memset(&t, 0, sizeof(t));
eval = AllocStructure (ut, tape_BLOCK, 0, &a, &t);
if (eval) ABORT(eval);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/budb/server.c,v 1.1.1.4 2001/07/14 22:21:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/budb/server.c,v 1.1.1.5 2001/09/11 14:31:45 hartmans Exp $");
#ifdef AFS_NT40_ENV
#include <winsock2.h>
printf("prserver: couldn't get address of this host.\n");
BUDB_EXIT(1);
}
- bcopy(th->h_addr,myHost,sizeof(afs_int32));
+ memcpy(myHost, th->h_addr, sizeof(afs_int32));
for (i=0; i<cellinfo->numServers; i++)
/* omit my host from serverList */
exit(2);
}
- bzero(globalConfPtr, sizeof(*globalConfPtr));
+ memset(globalConfPtr, 0, sizeof(*globalConfPtr));
/* set default configuration values */
strcpy(dbDir, AFSDIR_SERVER_DB_DIRPATH);
/* misc. initialization */
/* database dump synchronization */
- bzero(dumpSyncPtr, sizeof(*dumpSyncPtr));
+ memset(dumpSyncPtr, 0, sizeof(*dumpSyncPtr));
Lock_Init(&dumpSyncPtr->ds_lock);
rx_StartServer(0); /* start handling requests */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/budb/struct_ops.c,v 1.1.1.4 2001/07/14 22:21:02 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/budb/struct_ops.c,v 1.1.1.5 2001/09/11 14:31:46 hartmans Exp $");
#include <stdio.h>
#ifdef AFS_NT40_ENV
budbDumpPtr->created = dumpPtr->created;
budbDumpPtr->nVolumes = dumpPtr->nVolumes;
- bcopy(&dumpPtr->tapes, &budbDumpPtr->tapes, sizeof(struct budb_tapeSet));
+ memcpy(&budbDumpPtr->tapes, &dumpPtr->tapes, sizeof(struct budb_tapeSet));
copy_ktcPrincipal_to_budbPrincipal(&dumpPtr->dumper, &budbDumpPtr->dumper);
return(0);
}
struct budb_tapeSet *tapesetPtr;
char *dumpname;
{
- bzero(tapesetPtr, sizeof(*tapesetPtr));
+ memset(tapesetPtr, 0, sizeof(*tapesetPtr));
strcpy(tapesetPtr->format, dumpname);
strcat(tapesetPtr->format, ".%d");
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/butc/dbentries.c,v 1.1.1.4 2001/07/14 22:21:04 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butc/dbentries.c,v 1.1.1.5 2001/09/11 14:31:47 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
entryPtr->dlq_type = type;
entryPtr->dlq_structPtr = entry;
- bcopy (anEntry, entry, size);
+ memcpy(entry, anEntry, size);
dlqLinkb (&entries_to_flush, entryPtr);
return(0);
}
entryPtr->dlq_type = type;
entryPtr->dlq_structPtr = entry;
- bcopy (anEntry, entry, size);
+ memcpy(entry, anEntry, size);
dlqLinkb (&savedEntries, (dlqlinkP)entryPtr);
return(0);
}
{
afs_int32 code = 0;
- bzero(aTapeEntryPtr, sizeof(struct budb_tapeEntry));
+ memset(aTapeEntryPtr, 0, sizeof(struct budb_tapeEntry));
strcpy(aTapeEntryPtr->name, tapename);
aTapeEntryPtr->flags = BUDB_TAPE_BEINGWRITTEN;
aTapeEntryPtr->written = written; /* When label was written */
allo = 1;
}
- bzero(aVolEntryPtr, sizeof(struct budb_volumeEntry));
+ memset(aVolEntryPtr, 0, sizeof(struct budb_volumeEntry));
strcpy(aVolEntryPtr->name, volname);
aVolEntryPtr->flags = flags;
aVolEntryPtr->id = volid;
break;
}
- bcopy(volPtr, &volumes[c], sizeof(struct budb_volumeEntry));
+ memcpy(&volumes[c], volPtr, sizeof(struct budb_volumeEntry));
free(volPtr);
free(entryPtr);
entryPtr = (dlqlinkP)0;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/butc/dump.c,v 1.1.1.5 2001/07/14 22:21:05 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butc/dump.c,v 1.1.1.6 2001/09/11 14:31:47 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
time_t *t;
struct tm *tm;
{
- bcopy(localtime(t), tm, sizeof(struct tm));
+ memcpy(tm, localtime(t), sizeof(struct tm));
}
#endif
}
/* Remember the server and partition the volume exists on */
- bzero (&server, sizeof(server));
+ memset(&server, 0, sizeof(server));
server.sin_addr.s_addr = vldbEntry.serverNumber[e];
server.sin_port = 0;
server.sin_family = AF_INET;
TapeLog(2, taskId, 0, 0, "Dump %s\n", nodePtr->dumpSetName);
/* setup the dump parameters */
- bzero(&dparams, sizeof(dparams));
+ memset(&dparams, 0, sizeof(dparams));
dparams.node = nodePtr;
dparams.tapeInfoPtr = &tapeInfo;
dlqInit(&savedEntries);
ErrorLog(0, taskId, code, 0, "Can't read backup database\n");
ERROR_EXIT(code);
}
- bzero(&dparams.lastDump, sizeof(dparams.lastDump));
+ memset(&dparams.lastDump, 0, sizeof(dparams.lastDump));
}
code = createDump(&dparams); /* enter dump into database */
ErrorLog(0, taskId, code, tapeInfoPtr->error,
"Warning: Tape error while reading label (will proceed with dump)\n");
}
- bzero(&oldTapeLabel, sizeof(oldTapeLabel));
+ memset(&oldTapeLabel, 0, sizeof(oldTapeLabel));
}
/* Check if null tape. Prior 3.3, backup tapes have no dump id */
*/
for (dmp=oldTapeLabel.dumpid; dmp; dmp=de.appendedDumpID) {
if (dmp == dparamsPtr->lastDump.id) {
- bcopy(&dparamsPtr->lastDump, &de, sizeof(de));
- bcopy(&dparamsPtr->lastDump, &de2, sizeof(de2));
+ memcpy(&de, &dparamsPtr->lastDump, sizeof(de));
+ memcpy(&de2, &dparamsPtr->lastDump, sizeof(de2));
}
else {
code = bcdb_FindDumpByID(dmp, &de);
curDump = &nodePtr->dumps[dparamsPtr->curVolume];
- bzero(vhptr, sizeof(*vhptr));
+ memset(vhptr, 0, sizeof(*vhptr));
strcpy(vhptr->volumeName, curDump->name);
vhptr->volumeID = curDump->vid;
vhptr->cloneDate = curDump->cloneDate;
volHdr.versionflags = htonl(hostPtr->versionflags);
volHdr.cloneDate = htonl(hostPtr->cloneDate);
- bcopy(&volHdr, netPtr, sizeof(struct volumeHeader));
+ memcpy(netPtr, &volHdr, sizeof(struct volumeHeader));
}
/* database related routines */
afs_int32 code = 0;
dumpPtr = &dparamsPtr->dump;
- bzero(dumpPtr, sizeof(*dumpPtr));
+ memset(dumpPtr, 0, sizeof(*dumpPtr));
/* id filled in by database */
dumpPtr->parent = nodePtr->parent;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/butc/list.c,v 1.1.1.4 2001/07/14 22:21:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butc/list.c,v 1.1.1.5 2001/09/11 14:31:48 hartmans Exp $");
#ifndef AFS_NT40_ENV
#include <sys/time.h>
/* get space */
*newNode = (struct dumpNode *) (malloc (sizeof (struct dumpNode)));
- bzero(*newNode, sizeof(struct dumpNode));
+ memset(*newNode, 0, sizeof(struct dumpNode));
(*newNode)->next = dumpQHeader->next;
dumpQHeader->next = *newNode;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/butc/lwps.c,v 1.1.1.4 2001/07/14 22:21:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butc/lwps.c,v 1.1.1.5 2001/09/11 14:31:48 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
magic == TC_VOLENDMAGIC || \
magic == TC_VOLCONTD ) { \
\
- bcopy (&vhptr, header, sizeof(struct volumeHeader)); \
+ memcpy(header, &vhptr, sizeof(struct volumeHeader)); \
return (0); \
} /* magic */ \
} /* versionflags */ \
{
case TAPE_VERSION_0:
/* sizes in bytes and fields in host order */
- bcopy(hostVolHeader, tapeVolHeader, sizeof(struct volumeHeader));
+ memcpy(tapeVolHeader, hostVolHeader, sizeof(struct volumeHeader));
break;
case TAPE_VERSION_1:
}
/* fill tbuffer with end of buffer */
bytesRead -= sizeof(tbuffer);
- bcopy(buffer+bytesRead, tbuffer, sizeof(tbuffer));
+ memcpy(tbuffer, buffer+bytesRead, sizeof(tbuffer));
tbuffersize = sizeof(tbuffer);
/* Write out whatever is left over in buffer */
if (bytesRead) {
}
else if ((tbuffersize + bytesRead) <= sizeof(tbuffer)) {
/* Copy all of buffer into tbuffer (it will fit) */
- bcopy(buffer, tbuffer+tbuffersize, bytesRead);
+ memcpy(tbuffer+tbuffersize, buffer, bytesRead);
tbuffersize += bytesRead;
bytesRead = 0;
}
tbuffersize -= w;
/* Move the data in tbuffer up */
- bcopy(tbuffer+towrite, tbuffer, tbuffersize);
+ memcpy(tbuffer, tbuffer+towrite, tbuffersize);
/* Now copy buffer in */
- bcopy(buffer, tbuffer+tbuffersize, bytesRead);
+ memcpy(tbuffer+tbuffersize, buffer, bytesRead);
tbuffersize += bytesRead;
bytesRead = 0;
}
printf("\n\n");
TLog (taskId, "Restore\n");
- bzero(&tapeInfo, sizeof(tapeInfo));
+ memset(&tapeInfo, 0, sizeof(tapeInfo));
if (!CONF_XBSA) {
tapeInfo.structVersion = BUTM_MAJORVERSION;
tcode = butm_file_Instantiate (&tapeInfo, &globalTapeConfig);
if ( checkAbortByTaskId(taskId) ) ERROR_EXIT(TC_ABORTEDBYREQUEST);
- bzero(&rparams, sizeof(rparams));
+ memset(&rparams, 0, sizeof(rparams));
rparams.nodePtr = newNode;
rparams.tapeInfoPtr = &tapeInfo;
Restore = newNode->restores; /* Array of vol fragments to restore */
bufferBlock = (struct TapeBlock *)0;
bufferBlock = (struct TapeBlock *) malloc(allocbufferSize);
if (!bufferBlock) ERROR_EXIT(TC_NOMEMORY);
- bzero(bufferBlock, allocbufferSize);
+ memset(bufferBlock, 0, allocbufferSize);
startTime = time(0);
for (rparams.frag=0; (rparams.frag < newNode->arraySize); rparams.frag++) {
struct timezone tzp;
afs_uint32 size;
- bzero(tapeLabel,sizeof(struct butm_tapeLabel));
+ memset(tapeLabel, 0, sizeof(struct butm_tapeLabel));
if (!CONF_XBSA) {
butm_GetSize(tapeInfoPtr, &size);
if (!s) return 0;
}
- bzero(tapeVolumeHT, sizeof(tapeVolumeHT));
- if (headB) bcopy (buffera + sizea - headB, tapeVolumeHT , headB);
- if (tailB) bcopy (bufferb , tapeVolumeHT + headB, tailB);
+ memset(tapeVolumeHT, 0, sizeof(tapeVolumeHT));
+ if (headB) memcpy(tapeVolumeHT , buffera + sizea - headB, headB);
+ if (tailB) memcpy(tapeVolumeHT + headB, bufferb , tailB);
if (ExtractTrailer (tapeVolumeHT, s, &offset, volTrailerPtr)) {
found = 1;
if (offset > headB) {
printf("\n\n");
TLog (taskId, "Labeltape\n");
- bzero(&tapeInfo, sizeof(tapeInfo));
+ memset(&tapeInfo, 0, sizeof(tapeInfo));
tapeInfo.structVersion = BUTM_MAJORVERSION;
code = butm_file_Instantiate (&tapeInfo, &globalTapeConfig);
if (code)
printf("\n\n");
TLog (taskId, "Readlabel\n");
- bzero(&tapeInfo,sizeof(tapeInfo));
+ memset(&tapeInfo, 0, sizeof(tapeInfo));
tapeInfo.structVersion = BUTM_MAJORVERSION;
code = butm_file_Instantiate (&tapeInfo, &globalTapeConfig);
if (code)
ErrorLog(0, taskId, code, tapeInfo.error, "Can't initialize the tape module\n");
ERROR_EXIT(code);
}
- bzero(&newTapeLabel,sizeof(newTapeLabel));
+ memset(&newTapeLabel, 0, sizeof(newTapeLabel));
interactiveFlag = autoQuery;
(strncmp(tempvhptr->postamble, "T--NAME#",8) == 0) )
{
/* Handle Cases 2 & 3 */
- bcopy (buffer+bufloc, &vhptr, sizeof(struct volumeHeader));
+ memcpy(&vhptr, buffer+bufloc, sizeof(struct volumeHeader));
HEADER_CHECKS(vhptr, header);
/* Handle Case 4 */
- bzero (&vhptr, sizeof(struct volumeHeader));
- bcopy (buffer+bufloc, &vhptr, firstSplice);
- bzero (&vhptr.pad, padLen);
- bcopy (buffer+bufloc+firstSplice, &vhptr.volumeID, nextSplice);
+ memset(&vhptr, 0, sizeof(struct volumeHeader));
+ memcpy(&vhptr, buffer+bufloc, firstSplice);
+ memset(&vhptr.pad, 0, padLen);
+ memcpy(&vhptr.volumeID, buffer+bufloc+firstSplice, nextSplice);
HEADER_CHECKS(vhptr, header);
/* Handle Case 1 */
- bzero (&vhptr, sizeof(struct volumeHeader));
- bcopy (buffer+bufloc, &vhptr, firstSplice);
- bcopy (buffer+bufloc+firstSplice+padLen, &vhptr+firstSplice, nextSplice);
+ memset(&vhptr, 0, sizeof(struct volumeHeader));
+ memcpy(&vhptr, buffer+bufloc, firstSplice);
+ memcpy(&vhptr+firstSplice, buffer+bufloc+firstSplice+padLen, nextSplice);
HEADER_CHECKS(vhptr, header);
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/butc/recoverDb.c,v 1.1.1.4 2001/07/14 22:21:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butc/recoverDb.c,v 1.1.1.5 2001/09/11 14:31:51 hartmans Exp $");
#include <stdio.h>
#ifdef AFS_NT40_ENV
{
afs_int32 code, c;
- bcopy(&scanInfoPtr->tapeLabel, &scanInfoPtr->dumpLabel, sizeof(struct butm_tapeLabel));
+ memcpy(&scanInfoPtr->dumpLabel, &scanInfoPtr->tapeLabel, sizeof(struct butm_tapeLabel));
while(1)
{
if (ptr->addDbFlag) TLog(taskId, "ScanTape and add to the database\n");
else TLog(taskId, "Scantape\n");
- bzero(&tapeScanInfo, sizeof(tapeScanInfo));
+ memset(&tapeScanInfo, 0, sizeof(tapeScanInfo));
tapeScanInfo.addDbFlag = ptr->addDbFlag;
- bzero(&curTapeInfo, sizeof(curTapeInfo));
+ memset(&curTapeInfo, 0, sizeof(curTapeInfo));
curTapeInfo.structVersion = BUTM_MAJORVERSION;
code = butm_file_Instantiate (&curTapeInfo, &globalTapeConfig);
if (code)
afs_int32 code = 0;
afs_int32 rcode, tcode;
- bzero(volumeHeader, sizeof(struct volumeHeader));
+ memset(volumeHeader, 0, sizeof(struct volumeHeader));
block = (char *) malloc(2*BUTM_BLOCKSIZE);
if (!block) return(TC_NOMEMORY);
/* extract information from previous tape label */
strcpy(buffer, prevTapeName);
- prevdot = rindex(buffer, '.');
+ prevdot = strrchr(buffer, '.');
if (!prevdot) return(retval);
prevdot++;
strcpy(tapeName, labelptr->AFSName);
- tp = rindex(tapeName, '.');
+ tp = strrchr(tapeName, '.');
if ( !tp ) return(1);
tp++;
- up = rindex(pathptr, '/');
+ up = strrchr(pathptr, '/');
if ( !up )
{
fprintf(stderr, "Invalid path name, missing /\n");
char *dotPtr;
int dotIndex;
- dotPtr = index(ptr, '.');
+ dotPtr = strchr(ptr, '.');
if ( !dotPtr ) return(0);
dotIndex = dotPtr - ptr;
char *dotPtr;
int dotIndex;
- dotPtr = rindex(ptr, '.');
+ dotPtr = strrchr(ptr, '.');
if (!dotPtr) return(0);
dotIndex = dotPtr - ptr;
{
char *sptr;
- sptr = rindex(tapename, '.');
+ sptr = strrchr(tapename, '.');
if ( !sptr ) return(-1);
sptr++;
return(atol(sptr));
char *sptr;
int c;
- sptr = rindex(tapeName, '.');
+ sptr = strrchr(tapeName, '.');
if ( !sptr ) return(0);
c = (int)( (afs_int32)sptr - (afs_int32)tapeName );
struct budb_dumpEntry *dumpEntryPtr = &tapeScanInfoPtr->dumpEntry;
/* construct dump entry */
- bzero(dumpEntryPtr, sizeof(struct budb_dumpEntry));
+ memset(dumpEntryPtr, 0, sizeof(struct budb_dumpEntry));
dumpEntryPtr->id = volHeaderPtr->dumpID;
dumpEntryPtr->initialDumpID = tapeScanInfoPtr->initialDumpId;
dumpEntryPtr->parent = volHeaderPtr->parentID;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/butc/tcmain.c,v 1.1.1.4 2001/07/14 22:21:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butc/tcmain.c,v 1.1.1.5 2001/09/11 14:31:51 hartmans Exp $");
#include <sys/types.h>
#include <sys/stat.h>
*/
if (argc == 1) {
ts = (struct cmd_syndesc *) malloc(sizeof(struct cmd_syndesc));
- bzero(ts, sizeof(*ts));
+ memset(ts, 0, sizeof(*ts));
ti = (struct cmd_item *) malloc(sizeof(struct cmd_item));
ti->next = 0;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/butc/tcprocs.c,v 1.1.1.4 2001/07/14 22:21:08 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butc/tcprocs.c,v 1.1.1.5 2001/09/11 14:31:52 hartmans Exp $");
#include <sys/types.h>
#include <errno.h>
ptr = (struct labelTapeIf *) malloc(sizeof(*ptr));
if (!ptr) ERROR_EXIT(TC_NOMEMORY);
- bcopy(label, &ptr->label, sizeof(ptr->label));
+ memcpy(&ptr->label, label, sizeof(ptr->label));
/* set up the status node */
*taskId = allocTaskId(); /* for bucoord */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/butc/tcudbprocs.c,v 1.1.1.5 2001/07/14 22:21:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butc/tcudbprocs.c,v 1.1.1.6 2001/09/11 14:31:53 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
{
afs_int32 code = 0;
- bzero(dumpEntryPtr, sizeof(struct budb_dumpEntry));
+ memset(dumpEntryPtr, 0, sizeof(struct budb_dumpEntry));
strcpy(dumpEntryPtr->name, DUMP_TAPE_NAME);
strcpy(dumpEntryPtr->tapes.format, DUMP_TAPE_NAME);
goto getNewTape;
}
- bzero(&oldTapeLabel, sizeof(oldTapeLabel));
+ memset(&oldTapeLabel, 0, sizeof(oldTapeLabel));
code = butm_ReadLabel(tapeInfoPtr, &oldTapeLabel, 1); /* rewind tape */
if (code)
{
*/
for (dmp=oldTapeLabel.dumpid; dmp; dmp=de.appendedDumpID) {
if (dmp == lastDump.id) {
- bcopy(&lastDump, &de, sizeof(de));
- bcopy(&lastDump, &de2, sizeof(de2));
+ memcpy(&de, &lastDump, sizeof(de));
+ memcpy(&de2, &lastDump, sizeof(de2));
}
else {
code = bcdb_FindDumpByID(dmp, &de);
/* Initialize a tapeEntry for later inclusion into the database*/
listEntryPtr = (struct tapeEntryList *)malloc(sizeof(struct tapeEntryList));
if (!listEntryPtr) ERROR_EXIT(TC_NOMEMORY);
- bzero(listEntryPtr, sizeof(struct tapeEntryList));
+ memset(listEntryPtr, 0, sizeof(struct tapeEntryList));
/* Remember dumpid so we can delete it later */
if ( (oldTapeLabel.structVersion >= TAPE_VERSION_3) && oldTapeLabel.dumpid )
}
/* Determine what the last database dump was */
- bzero(&lastDump, sizeof(lastDump));
+ memset(&lastDump, 0, sizeof(lastDump));
code = bcdb_FindLatestDump("", "", &lastDump);
if (code) {
if (code != BUDB_NODUMPNAME) {
ErrorLog(0, taskId, code, 0, "Can't read backup database\n");
ERROR_EXIT(code);
}
- bzero(&lastDump, sizeof(lastDump));
+ memset(&lastDump, 0, sizeof(lastDump));
}
code = CreateDBDump(&dumpEntry); /* Create a dump for this tape */
{
afs_int32 code;
- bzero(dumpEntryPtr, sizeof(struct budb_dumpEntry));
+ memset(dumpEntryPtr, 0, sizeof(struct budb_dumpEntry));
dumpEntryPtr->id = tapeEntPtr->dump;
dumpEntryPtr->initialDumpID = 0;
/* Initialize a tapeEntry for later inclusion into the database*/
listEntryPtr = (struct tapeEntryList *) malloc(sizeof(struct tapeEntryList));
if (!listEntryPtr) ERROR_EXIT(TC_NOMEMORY);
- bzero(listEntryPtr, sizeof(struct tapeEntryList));
+ memset(listEntryPtr, 0, sizeof(struct tapeEntryList));
/* Fill in tape entry so we can save it later */
strcpy(tapeEntryPtr->name, TNAME(&oldTapeLabel));
if (!writeBlock) ERROR_EXIT(TC_NOMEMORY);
writeBuffer = writeBlock + sizeof(struct blockMark);
- bzero(writeBuffer, BUTM_BLKSIZE);
+ memset(writeBuffer, 0, BUTM_BLKSIZE);
maxReadSize = 1024;
/*
transferSize = (charList.charListT_len < (blockSize - writeBufNbytes)) ?
charList.charListT_len : (blockSize - writeBufNbytes);
- bcopy(readBufPtr, writeBufPtr, transferSize);
+ memcpy(writeBufPtr, readBufPtr, transferSize);
charList.charListT_len -= transferSize;
writeBufPtr += transferSize;
readBufPtr += transferSize;
ERROR_EXIT(code);
}
- bzero(writeBuffer, blockSize);
+ memset(writeBuffer, 0, blockSize);
writeBufPtr = &writeBuffer[0];
writeBufNbytes = 0;
}
/* get the first item-header */
- bzero(&netItemHeader, sizeof(netItemHeader));
+ memset(&netItemHeader, 0, sizeof(netItemHeader));
code = getTapeData(tapeInfoPtr, rstTapeInfoPtr, &netItemHeader, sizeof(netItemHeader));
if (code) ERROR_EXIT(code);
structDumpHeader_ntoh(&netItemHeader, &hostItemHeader);
extern struct udbHandleS udbHandle;
/* Read the database header */
- bzero(&netDbHeader, sizeof(netDbHeader));
+ memset(&netDbHeader, 0, sizeof(netDbHeader));
code = getTapeData(tapeInfo, rstTapeInfoPtr, &netDbHeader, sizeof(netDbHeader));
if (code) ERROR_EXIT(code);
DbHeader_ntoh(&netDbHeader, &hostDbHeader);
}
/* get the next item-header */
- bzero(nextHeader, sizeof(*nextHeader));
+ memset(nextHeader, 0, sizeof(*nextHeader));
code = getTapeData(tapeInfo, rstTapeInfoPtr, &netItemHeader, sizeof(netItemHeader));
if (code) ERROR_EXIT(code);
structDumpHeader_ntoh(&netItemHeader, nextHeader);
taskId = rstTapeInfoPtr->taskId;
/* read dump entry */
- bzero(&netDumpEntry, sizeof(netDumpEntry));
+ memset(&netDumpEntry, 0, sizeof(netDumpEntry));
code = getTapeData(tapeInfo, rstTapeInfoPtr, &netDumpEntry, sizeof(netDumpEntry));
if (code) ERROR_EXIT(code);
}
/* get the next item-header */
- bzero(nextHeader, sizeof(*nextHeader));
+ memset(nextHeader, 0, sizeof(*nextHeader));
code = getTapeData(tapeInfo, rstTapeInfoPtr, &netItemHeader, sizeof(netItemHeader));
if (code) ERROR_EXIT(code);
structDumpHeader_ntoh(&netItemHeader, nextHeader);
{ /*t*/
/* read the tape entry */
- bzero(&netTapeEntry, sizeof(netTapeEntry));
+ memset(&netTapeEntry, 0, sizeof(netTapeEntry));
code = getTapeData(tapeInfo, rstTapeInfoPtr, &netTapeEntry, sizeof(netTapeEntry));
if (code) ERROR_EXIT(code);
tapeEntry_ntoh(&netTapeEntry, &hostTapeEntry);
}
/* get the next item-header */
- bzero(nextHeader, sizeof(*nextHeader));
+ memset(nextHeader, 0, sizeof(*nextHeader));
code = getTapeData(tapeInfo, rstTapeInfoPtr, &netItemHeader, sizeof(netItemHeader));
if (code) ERROR_EXIT(code);
structDumpHeader_ntoh(&netItemHeader, nextHeader);
{ /*v*/
/* read the volume entry */
- bzero(&netVolumeEntry, sizeof(netVolumeEntry));
+ memset(&netVolumeEntry, 0, sizeof(netVolumeEntry));
code = getTapeData(tapeInfo, rstTapeInfoPtr, &netVolumeEntry, sizeof(netVolumeEntry));
if (code) ERROR_EXIT(code);
volumeEntry_ntoh(&netVolumeEntry, &hostVolumeEntry);
}
/* get the next item-header */
- bzero(nextHeader, sizeof(*nextHeader));
+ memset(nextHeader, 0, sizeof(*nextHeader));
code = getTapeData(tapeInfo, rstTapeInfoPtr, &netItemHeader, sizeof(netItemHeader));
if (code) ERROR_EXIT(code);
structDumpHeader_ntoh(&netItemHeader, nextHeader);
ctPtr = (udbClientTextP) malloc(sizeof(*ctPtr));
if (!ctPtr) ERROR_EXIT(TC_NOMEMORY);
- bzero(ctPtr, sizeof(*ctPtr));
+ memset(ctPtr, 0, sizeof(*ctPtr));
ctPtr->textType = textType;
/* lock the text in the database */
unlink(filename);
/* get the next item-header */
- bzero(nextHeader, sizeof(*nextHeader));
+ memset(nextHeader, 0, sizeof(*nextHeader));
code = getTapeData(tapeInfo, rstTapeInfoPtr, &netItemHeader, sizeof(netItemHeader));
if (code) ERROR_EXIT(code);
structDumpHeader_ntoh(&netItemHeader, nextHeader);
/* copy out data */
transferBytes = (nbytes < requestedBytes ) ? nbytes : requestedBytes;
- bcopy(tapeReadBufferPtr, buffer, transferBytes);
+ memcpy(buffer, tapeReadBufferPtr, transferBytes);
tapeReadBufferPtr += transferBytes;
buffer += transferBytes;
nbytes -= transferBytes;
int index;
char *cp; {
afs_int32 temp;
- bcopy(cp+index*4, &temp, sizeof(afs_int32));
+ memcpy(&temp, cp+index*4, sizeof(afs_int32));
return temp;
}
}
th = gethostbyname(aname);
if (!th) return 0;
- bcopy(th->h_addr, &addr, sizeof(addr));
+ memcpy(&addr, th->h_addr, sizeof(addr));
return addr;
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/butm/butm_test.c,v 1.1.1.4 2001/07/14 22:21:09 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butm/butm_test.c,v 1.1.1.5 2001/09/11 14:31:56 hartmans Exp $");
#include <sys/types.h>
#include <sys/file.h>
code = tapeInfo.ops.mount(&tapeInfo, "TAPE_NAME");
PASSq ("Mount tape", 0);
- bzero(tapeLabelWrite, sizeof(tapeLabelWrite));
+ memset(tapeLabelWrite, 0, sizeof(tapeLabelWrite));
tapeLabelWrite.structVersion = CUR_TAPE_VERSION;
tapeLabelWrite.creationTime = time(0);
tapeLabelWrite.expirationDate = time(0);
code = tapeInfo.ops.readLabel(&tapeInfo, &tapeLabelRead, REWIND);
PASS ("Read a label", 0);
- if ( bcmp(&tapeLabelWrite, &tapeLabelRead, sizeof(tapeLabelWrite)) )
+ if ( memcmp(&tapeLabelWrite, &tapeLabelRead, sizeof(tapeLabelWrite)) )
printf("FAILURE: Label Read is not same as label Written\n");
else
printf("PASSED: Label Read is same as label Written\n");
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/butm/file_tm.c,v 1.1.1.4 2001/07/14 22:21:10 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butm/file_tm.c,v 1.1.1.5 2001/09/11 14:31:57 hartmans Exp $");
#ifdef AFS_NT40_ENV
#include <winsock2.h>
{
if (length == 0) ERROR_EXIT(0);
bmark = (struct blockMark *)buffer;
- bzero(bmark, sizeof(struct blockMark));
+ memset(bmark, 0, sizeof(struct blockMark));
bmark->magic = htonl(BLOCK_MAGIC);
bmark->count = htonl(length);
}
p = (struct progress *)info->tmRock;
- bzero(buffer, BUTM_BLOCKSIZE);
+ memset(buffer, 0, BUTM_BLOCKSIZE);
label = (struct tapeLabel *)buffer;
fmark = (struct fileMark *)buffer;
bmark = (struct blockMark *)buffer;
/* Copy the label into the tape block
* ---------------------------------- */
- bzero(tapeBlock, BUTM_BLOCKSIZE);
+ memset(tapeBlock, 0, BUTM_BLOCKSIZE);
if (!label->creationTime) label->creationTime = time(0);
tlabel = (struct tapeLabel *)tapeBlock;
- bcopy(label, &tlabel->label, sizeof(struct butm_tapeLabel));
+ memcpy(&tlabel->label, label, sizeof(struct butm_tapeLabel));
tlabel->label.structVersion = htonl(CUR_TAPE_VERSION);
tlabel->label.creationTime = htonl(tlabel->label.creationTime);
tlabel->label.expirationDate = htonl(tlabel->label.expirationDate);
if (label)
{
tlabel = (struct tapeLabel *) tapeBlock;
- bcopy(&tlabel->label, label, sizeof(struct butm_tapeLabel));
+ memcpy(label, &tlabel->label, sizeof(struct butm_tapeLabel));
label->structVersion = ntohl(label->structVersion);
label->creationTime = ntohl(label->creationTime);
label->expirationDate = ntohl(label->expirationDate);
if (len < BUTM_BLKSIZE)
{
- bzero(&dstart[len], BUTM_BLKSIZE - len);
+ memset(&dstart[len], 0, BUTM_BLKSIZE - len);
length = len;
}
else
if (b < (blocks-1)) b++;
else if (len)
- bcopy(&dstart[BUTM_BLKSIZE], &dstart[0], len);
+ memcpy(&dstart[0], &dstart[BUTM_BLKSIZE], len);
}
error_exit:
if (!info) ERROR_EXIT(BUTM_BADARGUMENT);
if (info->structVersion != BUTM_MAJORVERSION) ERROR_EXIT(BUTM_OLDINTERFACE);
- bzero (info, sizeof(struct butm_tapeInfo));
+ memset(info, 0, sizeof(struct butm_tapeInfo));
info->structVersion = BUTM_MAJORVERSION;
info->ops.mount = file_Mount;
info->ops.dismount = file_Dismount;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/butm/test_ftm.c,v 1.1.1.4 2001/07/14 22:21:10 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butm/test_ftm.c,v 1.1.1.5 2001/09/11 14:31:57 hartmans Exp $");
#include <sys/types.h>
#include <fcntl.h>
ERROR_EXIT (2);
}
- bzero(&label, sizeof(label));
+ memset(&label, 0, sizeof(label));
gettimeofday(&tp, 0);
label.structVersion = CUR_TAPE_VERSION;
label.creationTime = tp.tv_sec;
tprogress = tlen = fprogress = flen = 0;
while (1) {
- bzero(tbuffer,BUTM_BLKSIZE);
+ memset(tbuffer, 0, BUTM_BLKSIZE);
code = butm_ReadFileData (&info, tbuffer, BUTM_BLKSIZE, &tlen);
if (code && code != BUTM_STATUS_EOF) {
com_err (whoami, code, "Reading %dth tape data", i+1);
ERROR_EXIT(6);
}
- bzero(fbuffer,BUTM_BLKSIZE);
+ memset(fbuffer, 0, BUTM_BLKSIZE);
flen = read (fid, fbuffer, sizeof(fbuffer));
if (flen < 0) {
com_err (whoami, errno, "Reading %dth file data", i+1);
DBG=-g3
CSTATIC=-non_shared
RANLIB=/bin/true
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
CP=cp
#this is for the vol package
-FS_CONV_OSF40D= $(DESTDIR)root.server/usr/afs/bin/fs_conv_dux40D
+FS_CONV_OSF40D = fs_conv_dux40D
+install_FS_CONV_OSF40D = $(DESTDIR)${afssrvsbindir}/fs_conv_dux40D
+dest_FS_CONV_OSF40D = $(DEST)/root.server/usr/afs/bin/fs_conv_dux40D
CP=cp
CSTATIC=-non_shared
RANLIB=/bin/true
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#this is for the vol package
-FS_CONV_OSF40D= $(DESTDIR)root.server/usr/afs/bin/fs_conv_dux40D
+FS_CONV_OSF40D = fs_conv_dux40D
+install_FS_CONV_OSF40D = $(DESTDIR)${afssrvsbindir}/fs_conv_dux40D
+dest_FS_CONV_OSF40D = $(DEST)/root.server/usr/afs/bin/fs_conv_dux40D
AR=ar
AS=as
CP=cp
-INSTALL=${SRCDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
LD=ld
MT_CC=cc
MV=mv
RANLIB=ranlib
RM=rm
-WASHTOOL=${SRCDIR}bin/washtool
#
# Other OS specific requirements
#
YACC = bison -y
LEX = flex -l
-# Used in des library.
-CRYPT_OBJ = crypt.o
# Removes all built files
#
clean :
- -rm -f $(TARGETS) *.o *.ss core
+ -$(RM) -f $(TARGETS) *.o *.ss core
#
# IMPLICIT RULES
#
%.a :
-$(RM) $@
- $(AR) rv $@ $^
+ $(AR) crv $@ $^
$(RANLIB) $@
# new implicit rule to create executables
OPTMZ=-O
DBG=-g
RANLIB=ranlib
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
RM=/bin/rm
CP=/bin/cp
AR=/bin/ar
LWP_OPTMZ=-O
OPTMZ=-O
DBG=-g
-RANLIB=ranlib
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+RANLIB=/usr/bin/ranlib
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
RM=/bin/rm
CP=/bin/cp
AR=/bin/ar
#
# AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
AFS_OSTYPE = DJGPP
-DESTDIR=DEST/
-SRCDIR=DEST/
# compilation and link editor flags
#DBG=-g
AR=dos-ar
AS=dos-as
CP=cp
-INSTALL=${SRCDIR}bin/install
+INSTALL=${SRCDIR}/bin/install
LD=dos-ld
CC=dos-gcc -bmmap
RANLIB=dos-ranlib
MT_CC=dos-gcc -bmmap
MV=mv
RM=rm
-WASHTOOL=${SRCDIR}bin/washtool
#
# Other OS specific requirements
#
YACC = bison -y
LEX = flex -l
-# Used in des library.
-CRYPT_OBJ = crypt.o
#
# AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
AFS_OSTYPE = FBSD
-# Pointers to destination and source directories
-DESTDIR=DEST/
-SRCDIR=DEST/
# Base directory for linux kernel source. Actually a prefix which is complete
# when LINUX_VERS is appended to it.
# LINUX_SRCDIR = /usr/src/linux-
AR=ar
AS=as
CP=cp
-INSTALL=${SRCDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
LD=ld
MT_CC=cc
MV=mv
RANLIB=ranlib
RM=rm
-WASHTOOL=${SRCDIR}bin/washtool
#
# Other OS specific requirements
#
YACC = bison -y
LEX = flex -l
-# Used in des library.
-CRYPT_OBJ = crypt.o
LINUX_SRCDIR = /usr/src/linux-
# Default list of Linux kernels to build. Build will run only if all
# can be built. To build a different set, specify LINUX_VERS to make.
-LINUX_VERS = 2.3.99-pre3
+LINUX_VERS = @LINUX_VERSION@
#
# compilation and link editor flags
MV=mv
RANLIB=ranlib
RM=rm
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#
# Other OS specific requirements
#
YACC = bison -y
LEX = flex -l
-# Used in des library.
-CRYPT_OBJ = crypt.o
# AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
AFS_OSTYPE = DARWIN
#
-# Pointers to destination and source directories
-DESTDIR=DEST/
-DESTDIR=DEST/
#
# compilation and link editor flags
XCFLAGS=-traditional-cpp
AS=as
CC=cc
CP=cp
-INSTALL=${DESTDIR}bin/pinstall
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
LEX=lex -l
LD= ld
LORDER = lorder
# AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
AFS_OSTYPE = DARWIN
#
-# Pointers to destination and source directories
-DESTDIR=DEST/
-DESTDIR=DEST/
#
# compilation and link editor flags
XCFLAGS=-traditional-cpp
AS=as
CC=cc
CP=cp
-INSTALL=${DESTDIR}bin/pinstall
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
LEX=lex -l
LD= ld
LORDER = lorder
MV=mv
RANLIB=ranlib
RM=rm
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#
# Other OS specific requirements
#
YACC = bison -y
LEX = flex -l
-# Used in des library.
-CRYPT_OBJ = crypt.o
MV=mv
RANLIB=ranlib
RM=rm
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#
# This is the XBSA make flag and pathname to XBSA header files (xbsa.h)
XBSA_FLAGS=-Dxbsa
MV=mv
RANLIB=ranlib
RM=rm
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#
# Other OS specific requirements
#
YACC = bison -y
LEX = flex -l
-# Used in des library.
-CRYPT_OBJ = crypt.o
MV=mv
RANLIB=ranlib
RM=rm
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#
# Other OS specific requirements
#
YACC = bison -y
LEX = flex -l
-# Used in des library.
-CRYPT_OBJ = crypt.o
MV=mv
RANLIB=/bin/true
RM=rm
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#
# This is for the vol package
-XFS_SIZE_CHECK = $(DESTDIR)root.server/usr/afs/bin/xfs_size_check
+XFS_SIZE_CHECK = xfs_size_check
+install_XFS_SIZE_CHECK = $(DESTDIR)${afssrvsbindir}/xfs_size_check
+dest_XFS_SIZE_CHECK = $(DEST)/root.server/usr/afs/bin/xfs_size_check
MV=mv
RANLIB=/bin/true
RM=rm
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
MV=mv
RANLIB=/bin/true
RM=rm
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#
# This is for the vol package
-XFS_SIZE_CHECK = $(DESTDIR)root.server/usr/afs/bin/xfs_size_check
+XFS_SIZE_CHECK = xfs_size_check
+install_XFS_SIZE_CHECK = $(DESTDIR)${afssrvsbindir}/xfs_size_check
+dest_XFS_SIZE_CHECK = $(DEST)/root.server/usr/afs/bin/xfs_size_check
MV=mv
RANLIB=/bin/true
RM=rm
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#
# This is for the vol package
-XFS_SIZE_CHECK = $(DESTDIR)root.server/usr/afs/bin/xfs_size_check
+XFS_SIZE_CHECK = xfs_size_check
+install_XFS_SIZE_CHECK = $(DESTDIR)${afssrvsbindir}/xfs_size_check
+dest_XFS_SIZE_CHECK = $(DEST)/root.server/usr/afs/bin/xfs_size_check
MV=mv
RANLIB=ranlib
RM=rm
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#
# Other OS specific requirements
#
YACC = bison -y
LEX = flex -l
-# Used in des library.
-CRYPT_OBJ = crypt.o
MV=mv
RANLIB=ranlib
RM=rm
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#
# Other OS specific requirements
#
YACC = bison -y
LEX = flex -l
-# Used in des library.
-CRYPT_OBJ = crypt.o
MV=mv
RANLIB=ranlib
RM=rm
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#
# Other OS specific requirements
#
YACC = bison -y
LEX = flex -l
-# Used in des library.
-CRYPT_OBJ = crypt.o
RANLIB=/bin/true
RM=rm
STRIP= /usr/ccs/bin/strip
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#
# this is for the vol package
-FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26
+FS_CONV_SOL26 = fs_conv_sol26
+install_FS_CONV_SOL26 = $(DESTDIR)${afssrvsbindir}/fs_conv_sol26
+dest_FS_CONV_SOL26 = $(DEST)/root.server/usr/afs/bin/fs_conv_sol26
RANLIB=/bin/true
RM=rm
STRIP= /usr/ccs/bin/strip
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#
# this is for the vol package
-FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26
+FS_CONV_SOL26 = fs_conv_sol26
+install_FS_CONV_SOL26 = $(DESTDIR)${afssrvsbindir}/fs_conv_sol26
+dest_FS_CONV_SOL26 = $(DEST)/root.server/usr/afs/bin/fs_conv_sol26
#
# This is the XBSA make flag and pathname to XBSA header files (xbsa.h)
XBSA_FLAGS=-Dxbsa
RANLIB=/bin/true
RM=rm
STRIP= /usr/ccs/bin/strip
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#
# this is for the vol package
-FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26
+FS_CONV_SOL26 = fs_conv_sol26
+install_FS_CONV_SOL26 = $(DESTDIR)${afssrvsbindir}/fs_conv_sol26
+dest_FS_CONV_SOL26 = $(DEST)/root.server/usr/afs/bin/fs_conv_sol26
#
# This is the XBSA make flag and pathname to XBSA header files (xbsa.h)
XBSA_FLAGS=-Dxbsa
RANLIB=/bin/true
RM=rm
STRIP= /usr/ccs/bin/strip
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
#
# this is for the vol package
-FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26
+FS_CONV_SOL26 = fs_conv_sol26
+install_FS_CONV_SOL26 = $(DESTDIR)${afssrvsbindir}/fs_conv_sol26
+dest_FS_CONV_SOL26 = $(DEST)/root.server/usr/afs/bin/fs_conv_sol26
#
# This is the XBSA make flag and pathname to XBSA header files (xbsa.h)
XBSA_FLAGS=-Dxbsa
LD = /usr/ccs/bin/ld
LORDER = /usr/ccs/bin/lorder
STRIP= /usr/ccs/bin/strip
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
# mkvers checks timestamps
$(VERSFILE).c:
- $(DESTDIR)bin/mkvers -o $(VERSFILE).c
+ $(TOP_SRCDIR)/config/mkvers -o $(VERSFILE).c
# only done for RX in NT
# -c $(CML_PREFIX)
$(VERSFILE).h:
- $(DESTDIR)bin/mkvers -o $(VERSFILE).h -v
+ $(TOP_SRCDIR)/config/mkvers -o $(VERSFILE).h -v
$(VERSFILE).txt:
- $(DESTDIR)bin/mkvers -o $(VERSFILE).txt -t
+ $(TOP_SRCDIR)/config/mkvers -o $(VERSFILE).txt -t
noversion: install
AFS_component_version_number.o: AFS_component_version_number.c
AFS_component_version_number.c:
- echo 'char cml_version_number[]="@(#) OpenAFS ${VERSION} built ' `date +"%Y-%m-%d"` '";' >AFS_component_version_number.c;
- echo 'char* AFSVersion = "${PACKAGE} ${VERSION}"; ' >>AFS_component_version_number.c;
-
-noversion: install
-
+ echo 'char cml_version_number[]="@(#) OpenAFS ${VERSION} built ' `date +"%Y-%m-%d"` '";' >AFS_component_version_number.c
+ echo 'char* AFSVersion = "${PACKAGE} ${VERSION}"; ' >>AFS_component_version_number.c
$(INCFILEDIR)\afs_args.h \
$(INCFILEDIR)\debug.h \
$(INCFILEDIR)\param.h \
+ $(INCFILEDIR)\afsconfig.h \
$(INCFILEDIR)\afs_sysnames.h \
$(INCFILEDIR)\stds.h \
$(INCFILEDIR)\icl.h
-\r
+
$(INCFILEDIR)\param.h: param.$(SYS_NAME).h
$(COPY) $? $@
+$(INCFILEDIR)\afsconfig.h: afsconfig-windows.h
+ $(COPY) $? $@
+
idirs: doclink
! IF (!EXIST($(DESTDIR)))
$(MKDIR) $(DESTDIR)
! IF (!EXIST($(DESTDIR)\WinInstall))
$(MKDIR) $(DESTDIR)\WinInstall
! ENDIF
+! IF (!EXIST($(DESTDIR)\WinInstall\Config))
+ $(MKDIR) $(DESTDIR)\WinInstall\Config
+! ENDIF
! IF (!EXIST($(DESTDIR)\root.server))
$(MKDIR) $(DESTDIR)\root.server
! ENDIF
! IF (!EXIST($(DESTDIR)\root.client\usr\vice\etc))
$(MKDIR) $(DESTDIR)\root.client\usr\vice\etc
! ENDIF
+ $(COPY) AFSCONFIG-WINDOWS.H $(DESTDIR)\include\afs\afsconfig.h
-INCCOPY = \\r
- $(DESTDIR)\bin\rmbat.bat \\r
- $(DESTDIR)\bin\rmbat.rsp \\r
- $(DESTDIR)\bin\NTBUILD.bat\r
-\r
-$(DESTDIR)\bin\rmbat.bat:..\rmbat.bat\r
+INCCOPY = \
+ $(DESTDIR)\bin\rmbat.bat \
+ $(DESTDIR)\bin\rmbat.rsp \
+ $(DESTDIR)\bin\NTBUILD.bat
+
+$(DESTDIR)\bin\rmbat.bat:..\rmbat.bat
$(COPY) $? $@
util_cr + $@
-\r
-$(DESTDIR)\bin\rmbat.rsp:..\rmbat.rsp\r
+
+$(DESTDIR)\bin\rmbat.rsp:..\rmbat.rsp
$(COPY) $? $@
-\r
-$(DESTDIR)\bin\NTBUILD.bat:..\NTBUILD.bat\r
+
+$(DESTDIR)\bin\NTBUILD.bat:..\NTBUILD.bat
$(COPY) $? $@
util_cr + $@
-\r
+
$(DESTDIR)\bin\NTLang.bat: NTLang.bat util_cr.exe
$(COPY) NTLang.bat $(DESTDIR)\bin
util_cr + $(DESTDIR)\bin\NTLang.bat
-\r
-$(DESTDIR)\NTDllmap.txt:NTDllmap.txt\r
+
+$(DESTDIR)\NTDllmap.txt:NTDllmap.txt
$(COPY) $? $@
-\r
+
# Create link to docs needed for media build; allow to fail in case
# symlink not available, e.g. if using a 3.4a client, since most builds
# aren't media builds.
$(COPY) NTMakefile.version-NOCML NTMakefile.version
! ENDIF
-INCTOOLS = \\r
- $(DESTDIR)\bin\mkvers.exe \\r
- $(DESTDIR)\bin\util_cr.exe \\r
- $(DESTDIR)\bin\touch.exe\r
-\r
+INCTOOLS = \
+ $(DESTDIR)\bin\mkvers.exe \
+ $(DESTDIR)\bin\util_cr.exe \
+ $(DESTDIR)\bin\touch.exe
+
#mkvers.exe : mkvers.obj
# $(EXECONLINK)
-\r
-$(DESTDIR)\bin\mkvers.exe:mkvers.exe\r
+
+$(DESTDIR)\bin\mkvers.exe:mkvers.exe
$(COPY) mkvers.exe $(DESTDIR)\bin\.
-$(DESTDIR)\bin\util_cr.exe:util_cr.exe\r
+$(DESTDIR)\bin\util_cr.exe:util_cr.exe
$(COPY) util_cr.exe $(DESTDIR)\bin\.
-\r
+
util_cr.exe : util_cr.obj
$(EXECONLINK)
-\r
-$(DESTDIR)\bin\touch.exe:touch.exe\r
+
+$(DESTDIR)\bin\touch.exe:touch.exe
$(COPY) touch.exe $(DESTDIR)\bin\.
langsetup: $(DESTDIR)\bin\NTLang.bat
clean::
$(DEL) $(DESTDIR)\LIB\*.DLL
- $(DEL) $(DESTDIR)\bin\mkver.exe\r
- $(DEL) $(DESTDIR)\bin\touch.exe\r
- $(DEL) $(DESTDIR)\bin\util_cr.exe\r
- $(DEL) mkver.exe\r
- $(DEL) touch.exe\r
+ $(DEL) $(DESTDIR)\bin\mkver.exe
+ $(DEL) $(DESTDIR)\bin\touch.exe
+ $(DEL) $(DESTDIR)\bin\util_cr.exe
+ $(DEL) mkver.exe
+ $(DEL) touch.exe
$(DEL) util_cr.exe
\ No newline at end of file
APPVER = 4.0
!ENDIF
+#define used in WinNT/2000 installation and program version display
+AFSPRODUCT_VERSION=1.1.1 a
+CELLNAME_DEFAULT=Your Cell Name
+CELLSERVDB_INSTALL=CellServDB.GrandCentral
+CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB
+
!IFNDEF TARGETOS
TARGETOS = WINNT
!ENDIF
APPVER = 4.0
!ENDIF
+#define used in Win9x installation and program version display
+AFSPRODUCT_VERSION=1.1.1 a
+CELLNAME_DEFAULT=Your Cell Name
+CELLSERVDB_INSTALL=CellServDB.GrandCentral
+CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB
+
!IFNDEF TARGETOS
TARGETOS = WIN95
#TARGETOS = WINNT
BEGIN
BLOCK "040904E4"
BEGIN
- VALUE "CompanyName", "IBM Corporation", "\0"
- VALUE "LegalCopyright", "Copyright \251 IBM Corporation, 1998, 1999.", "\0"
- VALUE "ProductName", "AFS for Windows", "\0"
- VALUE "ProductVersion", "3.5", "\0"
- VALUE "FileVersion", "3.5", "\0"
+ VALUE "CompanyName", "OpenAFS Project", "\0"
+ VALUE "LegalCopyright", "Copyright \251 IBM Corporation and others, 1998, 1999, 2000, 2001.", "\0"
+ VALUE "ProductName", "OpenAFS for Windows", "\0"
+ VALUE "ProductVersion", "1.1", "\0"
+ VALUE "FileVersion", "1.1", "\0"
VALUE "FileDescription", AFS_VERINFO_FILE_DESCRIPTION, "\0"
VALUE "Build", AFS_VERINFO_BUILD, "\0"
END
#define SYS_NAME_ID_sun4x_57 938
#define SYS_NAME_ID_sun4x_58 939
+/* Sigh. If I leave a gap here IBM will do this sequentially. If I don't
+ they won't allocate sunx86 IDs at all. So leave a gap and pray. */
+#define SYS_NAME_ID_sunx86_57 950
+#define SYS_NAME_ID_sunx86_58 951
#define SYS_NAME_ID_vax_ul4 1003
#define SYS_NAME_ID_vax_ul40 1004
#define SYS_NAME_ID_i386_fbsd_42 2100
+#define SYS_NAME_ID_ia64_linux2 2200
+#define SYS_NAME_ID_ia64_linux22 2201
+#define SYS_NAME_ID_ia64_linux24 2202
+
/*
* Placeholder to keep system-wide standard flags since this file is included by all
* files (i.e in afs/param.h)
/* these macros define Unix-style functions missing in VC++5.0/NT4.0 */
#define MAXPATHLEN _MAX_PATH
-#define bzero(A, S) memset((void*)(A), 0, (size_t)(S))
-#define bcopy(A, B, S) memcpy((void*)(B), (void*)(A), (size_t)(S))
+#if 0
+#define memset(A, 0, S) memset((void*)(A), 0, (size_t)(S))
+#define memcpy(B, A, S) memcpy((void*)(B), (void*)(A), (size_t)(S))
/* There is a minor syntactic difference between memcmp and bcmp... */
-#define bcmp(A,B,S) (memcmp((void*)(A), (void*)(B), (size_t)(S)) ? 1 : 0)
+#define memcmp(A, B, S) (memcmp((void*)(A), (void*)(B), (size_t)(S)) ? 1 : 0)
+#define strchr(s, c) strchr(s, c)
+#define strrchr(s, c) strrchr(s, c)
+#endif
#define strcasecmp(s1,s2) _stricmp(s1,s2)
#define strncasecmp(s1,s2,n) _strnicmp(s1,s2,n)
-#define index(s, c) strchr(s, c)
-#define rindex(s, c) strrchr(s, c)
#define sleep(seconds) Sleep((seconds) * 1000)
#define fsync(fileno) _commit(fileno)
#define ftruncate(fd, size) _chsize((fd), (long)(size))
/* these macros define Unix-style functions missing in VC++5.0/NT4.0 */
#define MAXPATHLEN _MAX_PATH
-#define bzero(A, S) memset((void*)(A), 0, (size_t)(S))
-#define bcopy(A, B, S) memcpy((void*)(B), (void*)(A), (size_t)(S))
+#if 0
+#define memset(A, 0, S) memset((void*)(A), 0, (size_t)(S))
+#define memcpy(B, A, S) memcpy((void*)(B), (void*)(A), (size_t)(S))
/* There is a minor syntactic difference between memcmp and bcmp... */
-#define bcmp(A,B,S) (memcmp((void*)(A), (void*)(B), (size_t)(S)) ? 1 : 0)
+#define memcmp(A, B, S) (memcmp((void*)(A), (void*)(B), (size_t)(S)) ? 1 : 0)
+#define strchr(s, c) strchr(s, c)
+#define strrchr(s, c) strrchr(s, c)
+#endif
#define strcasecmp(s1,s2) _stricmp(s1,s2)
#define strncasecmp(s1,s2,n) _strnicmp(s1,s2,n)
-#define index(s, c) strchr(s, c)
-#define rindex(s, c) strrchr(s, c)
#define sleep(seconds) Sleep((seconds) * 1000)
#define fsync(fileno) _commit(fileno)
#define ftruncate(fd, size) _chsize((fd), (long)(size))
#define AFS_PARAM_H
#define AFS_VFS_ENV 1
-/* Used only in vfsck/* code; is it needed any more???? */
+/* Used only in vfsck code; is it needed any more???? */
#define AFS_VFSINCL_ENV 1 /* NOBODY uses this.... */
#define AFS_GREEDY43_ENV 1 /* Used only in rx/rx_user.c */
#define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KM_NOSLEEP)
#define AFS_KFREE kmem_free
#define VATTR_NULL vattr_null
+#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 */
#define AFS_DIRENT
#ifndef CMSERVERPREF
#include <afs/afs_sysnames.h>
#define AFS_VFS_ENV 1
-/* Used only in vfsck/* code; is it needed any more???? */
+/* Used only in vfsck code; is it needed any more???? */
#define AFS_VFSINCL_ENV 1 /* NOBODY uses this.... */
#define AFS_GREEDY43_ENV 1 /* Used only in rx/rx_user.c */
#define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KM_NOSLEEP)
#define AFS_KFREE kmem_free
#define VATTR_NULL vattr_null
+#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 */
#define AFS_DIRENT
#ifndef CMSERVERPREF
#define AFS_PARAM_H
#define AFS_VFS_ENV 1
-/* Used only in vfsck/* code; is it needed any more???? */
+/* Used only in vfsck code; is it needed any more???? */
#define AFS_VFSINCL_ENV 1 /* NOBODY uses this.... */
#define AFS_GREEDY43_ENV 1 /* Used only in rx/rx_user.c */
#define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KM_NOSLEEP)
#define AFS_KFREE kmem_free
#define VATTR_NULL vattr_null
+#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 */
#define AFS_DIRENT
#ifndef CMSERVERPREF
#define AFS_PARAM_H
#define AFS_VFS_ENV 1
-/* Used only in vfsck/* code; is it needed any more???? */
+/* Used only in vfsck code; is it needed any more???? */
#define AFS_VFSINCL_ENV 1 /* NOBODY uses this.... */
#define AFS_GREEDY43_ENV 1 /* Used only in rx/rx_user.c */
#define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KM_NOSLEEP)
#define AFS_KFREE kmem_free
#define VATTR_NULL vattr_null
+#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 */
#define AFS_DIRENT
#ifndef CMSERVERPREF
#define AFS_USR_SUN7_ENV 1
#define AFS_USR_SUN8_ENV 1
+#define AFS_64BIT_ENV 1
+
#include <afs/afs_sysnames.h>
/*#define AFS_GLOBAL_SUNLOCK 1 /* For global locking */
#include <afs/afs_sysnames.h>
#define AFS_VFS_ENV 1
-/* Used only in vfsck/* code; is it needed any more???? */
+/* Used only in vfsck code; is it needed any more???? */
#define AFS_VFSINCL_ENV 1 /* NOBODY uses this.... */
#define AFS_GREEDY43_ENV 1 /* Used only in rx/rx_user.c */
#if defined(AFS_LINUX20_ENV) && defined(KERNEL)
/* This is here instead of osi_machdep.h so fcrypt.c can pick it up. */
#include "../h/string.h"
-#define bcopy(F,T,C) memcpy((T), (F), (C))
+#if 0
+#define bcopy(F, T, C) memcpy((T), (F), (C))
+#endif
#endif
#include "process.h"
#include "windows.h"
#include "malloc.h"
+#include "time.h"
void usuage()
{
printf("util_cr file ;remove cr (from crlf)\n\
+ OR util_cr } ProductVersion in_filename out_filename ; substitute for %1-%5 in file\n\
+ %1=Major version, %2=Minor version, %3=Patch(first digit) %4=(last two digits) %5=Version display string \n\
+ ProductVersion=maj.min.pat.pat2 ;maj=numeric, min=numeric pat,pat2 are not more than 3 digits or 1-2 digits and one alpha \n\
+ e.g 1.0.4.1, 1.0.4 a 1.0.401, 1.0.4a all represent the same version\n\
OR util_cr + file ;add cr\n \
OR util_cr * \"+[register key value] x=y\" ; add register key value\n\
OR util_cr * \"-[register key value]\" ; aremove register key value\n\
- OR util_cr & file.ini \"SectionKey=value\" ; update ini-ipr-pwf file\n\
+ OR util_cr @ file.ini \"[SectionKey]variable=value\" ; update ini-ipr-pwf file\n\
+ OR util_cr @ file.ini \"[SectionKey]variable=value*DatE*\" ; update ini-ipr-pwf file, insert date\n\
OR util_cr ~ ;force error\n");
exit(0xc000);
}
int l,i;
char **pvar,*ch;
long len;
- typedef char * CHARP;\r
+ typedef char * CHARP;
if (argc<3)
usuage();
+ if (strcmp(argv[1],"}")==0)
+ {
+ char v1[4],v2[4],v3[4],v4[4];
+ char v5[132];
+ char *ptr=NULL;
+ char *buf;
+ int maj;
+ int min;
+ int pat,pat2;
+ strcpy(v5,argv[2]);
+ if (argc<5)
+ usuage();
+ if ((ptr=strtok(argv[2],". \n"))==NULL)
+ return 0;
+ maj=atoi(ptr);
+ if ((ptr=strtok(NULL,". \n"))==NULL)
+ return 0;
+ min=atoi(ptr);
+ if ((ptr=strtok(NULL,". \n"))==NULL)
+ return 0;
+ pat2=-1;
+ switch (strlen(ptr))
+ {
+ case 0:
+ usuage();
+ case 1:
+ pat=atoi(ptr);
+ if (isdigit(*ptr)!=0)
+ break;
+ usuage();
+ case 2: //ONLY 1.0.44 is interpreted as 1.0.4.4 or 1.0.4a as 1.0.4.a
+ if (isdigit(*ptr)==0)
+ usuage();
+ pat=*ptr-'0';
+ ptr++;
+ if (isalpha(*ptr)==0)
+ {
+ pat2=atoi(ptr);
+ } else if (isalpha(*ptr)!=0)
+ {
+ pat2=tolower(*ptr)-'a'+1;
+ } else
+ usuage();
+ break;
+ case 3://1.0.401 or 1.0.40a are the same;
+ if ((isdigit(*ptr)==0) // first 2 must be digit
+ || (isdigit(*(ptr+1)==0))
+ || (*(ptr+1)!='0' && isdigit(*(ptr+2))==0) // disallow 1.0.4b0 or 1.0.41a
+ )
+ usuage();
+ pat=*ptr-'0';
+ ptr++;
+ pat2=atoi(ptr);
+ ptr++;
+ if (isalpha(*ptr))
+ pat2=tolower(*ptr)-'a'+1;
+ break;
+ default:
+ usuage();
+ }
+ // last can be 1-2 digits or one alpha (if pat2 hasn't been set)
+ if ((ptr=strtok(NULL,". \n"))!=NULL)
+ {
+ if (pat2>=0)
+ usuage();
+ switch (strlen(ptr))
+ {
+ case 1:
+ pat2=(isdigit(*ptr))?atoi(ptr):tolower(*ptr)-'a'+1;
+ break;
+ case 2:
+ if (
+ isdigit(*ptr)==0
+ || isdigit(*(ptr+1))==0
+ )
+ usuage();
+ pat2=atoi(ptr);
+ default:
+ usuage();
+ }
+ }
+ file=fopen(argv[3],"r");
+ if (file==NULL)
+ usuage();
+ len=filelength(_fileno(file));
+ buf=(char *)malloc(len+1);
+ len=fread(buf,sizeof(char),len,file);
+ buf[len]=0; //set eof
+ fclose(file);
+ file=fopen(argv[4],"w");
+ if (file==NULL)
+ usuage();
+ sprintf(v1,"%i",maj);
+ sprintf(v2,"%i",min);
+ sprintf(v3,"%i",pat);
+ sprintf(v4,"%02i",pat2);
+ while (1)
+ {
+ ptr=strstr(buf,"%");
+ fwrite(buf,1,(ptr)?ptr-buf:strlen(buf),file); //write file if no % found or up to %
+ if (ptr==NULL)
+ break;
+ switch (*(ptr+1)) //skip first scan if buf="1...."
+ {
+ case '1':
+ fwrite(v1,1,strlen(v1),file);
+ ptr++;
+ break;
+ case '2':
+ fwrite(v2,1,strlen(v2),file);
+ ptr++;
+ break;
+ case '3':
+ fwrite(v3,1,strlen(v3),file);
+ ptr++;
+ break;
+ case '4':
+ fwrite(v4,1,strlen(v4),file);
+ ptr++;
+ break;
+ case '5':
+ fwrite(v5,1,strlen(v5),file);
+ ptr++;
+ break;
+ default:
+ fwrite("%",1,1,file); //either % at end of file or no %1...
+ break;
+ }
+ buf=ptr+1;
+ }
+ fclose(file);
+ return 0;
+ }
if (strcmp(argv[1],"~")==0)
- { //check for file presence\r
- if (fopen(argv[2],"r"))\r
- return(0);
- printf("Error---%s\n",argv[3]);\r
+ { //check for file presence
+ if (fopen(argv[2],"r"))
+ return(0);
+ if(argc<4)
+ printf("ERROR --- File not present %s\n",argv[2]);
+ else
+ printf("Error---%s\n",argv[3]);
exit(0xc000);
}
if (strcmp(argv[1],"*")==0)
}
return 0;
}
- if (strcmp(argv[1],"&")==0)
+ if (strcmp(argv[1],"@")==0)
{
+ char msg[256],msgt[256];
+ char *ptr;
if (argc<4)
usuage();
for (i=3;argc>=4;i++)
{
- char *ssect=strtok(argv[i],"[");
- char *skey=strtok(argv[i],"]");
+
+ char *ssect=strstr(argv[i],"[");
+ char *skey=strstr(ssect,"]");
char *sval;
- skey=strtok(NULL,"=");
if ((ssect==NULL) || (skey==NULL))
{
printf("format error parameter %s\n",argv[i]);
exit(0xc000);
}
- while(*skey==' ')
- skey++;
-
- sval=strtok(NULL,"=");
+ ssect++;
+ *skey=0;
+ if ((strlen(skey+1)==0)||(strlen(ssect)==0))
+ {
+ printf("format error parameter %s\n",argv[i]);
+ exit(0xc000);
+ }
+ while(*++skey==' ');
+ sval=strstr(skey,"=");
if (sval==NULL)
{
printf("format error parameter %s\n",argv[i]);
exit(0xc000);
}
-// printf("parameters %s %s %s %s\n",ssect,skey,sval,argv[2]);
+ ptr=sval;
+ while(*--ptr==' ') ;
+ *(ptr+1)=0;
+ while(*++sval==' ') ;
+ if (ptr=strstr(sval,"*DatE*"))
+ {// ok so lets substitute date in this string;
+ char tmpbuf[32];
+ *(ptr)=0;
+ strcpy(msg,sval);
+ _tzset();
+ _strdate( tmpbuf );
+ strcat(msg,tmpbuf);
+ strcat(msg,ptr+6);
+ sval=msg;
+ }
+ if (ptr=strstr(sval,"*TimE*"))
+ {
+ char tmpbuf[32];
+ *(ptr)=0;
+ strcpy(msgt,sval);
+ _strtime( tmpbuf );
+ strncat(msgt,tmpbuf,5);
+ strcat(msgt,ptr+6);
+ sval=msgt;
+ }
if (WritePrivateProfileString(ssect,skey,sval,argv[2])==0)
{
LPVOID lpMsgBuf;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/dauth/dlog.c,v 1.1.1.5 2001/07/14 22:21:26 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/dauth/dlog.c,v 1.1.1.6 2001/09/11 14:32:24 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
static char gpbuf[MAX_PASSWD_LEN];
register int i, tc;
- bzero(gpbuf, sizeof(gpbuf));
+ memset(gpbuf, 0, sizeof(gpbuf));
for(i=0; i<(sizeof(gpbuf)-1); i++) {
tc = fgetc(stdin);
if (tc == '\n' || tc == EOF) break;
token.startTime = starttime;
token.endTime = endtime;
- bcopy(session_key, (char *) &token.sessionKey, sizeof(token.sessionKey));
+ memcpy((char *) &token.sessionKey, session_key, sizeof(token.sessionKey));
token.kvno = tkt_type;
token.ticketLen = ticket_len;
if (ticket_len > MAXKTCTICKETLEN) {
fprintf(stderr, "dlog: DCE ticket is too long (length %d). Maximum length accepted by AFS cache manager is %d\n", MAXKTCTICKETLEN);
exit(1);
}
- bcopy((char *) ticket_p, (char *) token.ticket, ticket_len);
+ memcpy((char *) token.ticket, (char *) ticket_p, ticket_len);
sprintf(client.name, "AFS ID %d", unix_id);
strcpy(client.instance, "");
fprintf(stderr, "dlog: out of memory\n");
exit(1);
}
- bcopy(s_p, new_p, length);
+ memcpy(new_p, s_p, length);
new_p[length] = '\0';
return new_p;
}
case ASN_OCTET_STRING:
if (context == 1 && len == sizeof(reply_p->session_key)) {
saw_session_key++;
- bcopy(buf, reply_p->session_key, len);
+ memcpy(reply_p->session_key, buf, len);
}
buf += len;
break;
* Discard command line arguments, in case the password is on the
* command line (to avoid it showing up from a ps command).
*/
- for (i=1; i<zero_argc; i++) bzero (zero_argv[i], strlen(zero_argv[i]));
+ for (i=1; i<zero_argc; i++) memset(zero_argv[i], 0, strlen(zero_argv[i]));
zero_argc = 0;
#ifdef DLOG_TEST
foundPassword = 1;
strncpy (passwd, as->parms[aPASSWORD].items->data, sizeof(passwd) - 1);
passwd[sizeof(passwd) - 1] = '\0';
- bzero (as->parms[aPASSWORD].items->data,
- strlen(as->parms[aPASSWORD].items->data));
+ memset(as->parms[aPASSWORD].items->data, 0, strlen(as->parms[aPASSWORD].items->data));
}
if (as->parms[aLIFETIME].items) {
}
strcat(passwd, reply_p->salt);
des_string_to_key(passwd, passwd_key);
- bzero(passwd, strlen(passwd));
+ memset(passwd, 0, strlen(passwd));
/*
* Decrypt the private data returned by the DCE KDC, and forwarded
/*
* Destroy the key block: it's no longer needed.
*/
- bzero(schedule, sizeof(schedule));
- bzero(passwd_key, sizeof(passwd_key));
+ memset(schedule, 0, sizeof(schedule));
+ memset(passwd_key, 0, sizeof(passwd_key));
/*
* Do a very quick and dirty ASN.1 decode of the relevant parts
weak_key.obj \
read_pssword.obj \
strng_to_key.obj \
- misco.obj \
+ misc.obj \
util.obj \
crypt.obj
$(LIBFILE): $(LIBOBJS)
$(LIBARCH)
-# Special case, since misc.c includes a "main" for the table generators.
-misco.obj: misc.c
- $(C2OBJ) misc.c /Fomisco.obj -DDONT_INCL_MAIN
-
#####################
# Generator Files ###
#####################
# Make generators.
misc.obj: AFS_component_version_number.c
-make_keyperm.exe: make_keyperm.obj misc.obj
+make_keyperm.exe: make_keyperm.obj misc.obj main.obj
$(EXECONLINK)
-make_p_table.exe: make_p_table.obj misc.obj
+make_p_table.exe: make_p_table.obj misc.obj main.obj
$(EXECONLINK)
-make_s_table.exe: make_s_table.obj misc.obj
+make_s_table.exe: make_s_table.obj misc.obj main.obj
$(EXECONLINK)
-make_odd.exe: make_odd.obj misc.obj
+make_odd.exe: make_odd.obj misc.obj main.obj
$(EXECONLINK)
-make_p.exe: make_p.obj misc.obj
+make_p.exe: make_p.obj misc.obj main.obj
$(EXECONLINK)
-make_s.exe: make_s.obj misc.obj
+make_s.exe: make_s.obj misc.obj main.obj
$(EXECONLINK)
-make_fp.exe: make_fp.obj misc.obj
+make_fp.exe: make_fp.obj misc.obj main.obj
$(EXECONLINK)
-make_ip.exe: make_ip.obj misc.obj
+make_ip.exe: make_ip.obj misc.obj main.obj
$(EXECONLINK)
install: $(GENERATED_FILES) $(LIBFILE) $(INCFILES)
#ifdef AFS_ALPHA_LINUX20_ENV
#include "conf-alpha-linux.h"
#else
+#ifdef AFS_IA64_LINUX20_ENV
+#include "conf-ia64-linux.h"
+#else
#include "conf-i386-linux.h"
+#endif /* AFS_IA64_LINUX20_ENV */
#endif /* AFS_ALPHA_LINUX20_ENV */
#endif /* AFS_S390_LINUX20_ENV */
#endif /* AFS_SPARC64_LINUX20_ENV */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/des/cbc_encrypt.c,v 1.1.1.4 2001/07/14 22:21:28 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/des/cbc_encrypt.c,v 1.1.1.5 2001/09/11 14:32:26 hartmans Exp $");
#define XPRT_CBC_ENCRYPT
if (encrypt) {
#ifdef MUSTALIGN
if ((afs_int32) ivec & 3) {
- bcopy((char *)ivec++, (char *)&t_output[0], sizeof(t_output[0]));
- bcopy((char *)ivec, (char *)&t_output[1], sizeof(t_output[1]));
+ memcpy((char *)&t_output[0], (char *)ivec++, sizeof(t_output[0]));
+ memcpy((char *)&t_output[1], (char *)ivec, sizeof(t_output[1]));
}
else
#endif
/* get input */
#ifdef MUSTALIGN
if ((afs_int32) input & 3) {
- bcopy((char *)input++,(char *)&t_input[0],sizeof(t_input[0]));
- bcopy((char *)input++,(char *)&t_input[1],sizeof(t_input[1]));
+ memcpy((char *)&t_input[0], (char *)input++, sizeof(t_input[0]));
+ memcpy((char *)&t_input[1], (char *)input++, sizeof(t_input[1]));
}
else
#endif
/* copy temp output and save it for cbc */
#ifdef MUSTALIGN
if ((afs_int32) output & 3) {
- bcopy((char *)&t_output[0],(char *)output++,
- sizeof(t_output[0]));
- bcopy((char *)&t_output[1],(char *)output++,
- sizeof(t_output[1]));
+ memcpy((char *)output++, (char *)&t_output[0], sizeof(t_output[0]));
+ memcpy((char *)output++, (char *)&t_output[1], sizeof(t_output[1]));
}
else
#endif
/* decrypt */
#ifdef MUSTALIGN
if ((afs_int32) ivec & 3) {
- bcopy((char *)ivec++,(char *)&xor_0,sizeof(xor_0));
- bcopy((char *)ivec,(char *)&xor_1,sizeof(xor_1));
+ memcpy((char *)&xor_0, (char *)ivec++, sizeof(xor_0));
+ memcpy((char *)&xor_1, (char *)ivec, sizeof(xor_1));
}
else
#endif
/* get input */
#ifdef MUSTALIGN
if ((afs_int32) input & 3) {
- bcopy((char *)input++,(char *)&t_input[0],sizeof(t_input[0]));
- bcopy((char *)input++,(char *)&t_input[1],sizeof(t_input[0]));
+ memcpy((char *)&t_input[0], (char *)input++, sizeof(t_input[0]));
+ memcpy((char *)&t_input[1], (char *)input++, sizeof(t_input[0]));
}
else
#endif
/* copy temp output */
#ifdef MUSTALIGN
if ((afs_int32) output & 3) {
- bcopy((char *)&t_output[0],(char *)output++,
- sizeof(t_output[0]));
- bcopy((char *)&t_output[1],(char *)output++,
- sizeof(t_output[1]));
+ memcpy((char *)output++, (char *)&t_output[0], sizeof(t_output[0]));
+ memcpy((char *)output++, (char *)&t_output[1], sizeof(t_output[1]));
}
else
#endif
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/des/cksum.c,v 1.1.1.5 2001/07/14 22:21:27 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/des/cksum.c,v 1.1.1.6 2001/09/11 14:32:26 hartmans Exp $");
#include <mit-cpyright.h>
#include <stdio.h>
-#if defined(HAVE_STRINGS_H)
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
-#if defined(HAVE_STRING_H)
-#include <string.h>
#endif
#include <des.h>
#ifdef MUSTALIGN
if ((afs_int32) ivec & 3) {
- bcopy((char *)ivec++,(char *)&t_output[0],sizeof(t_output[0]));
- bcopy((char *)ivec,(char *)&t_output[1],sizeof(t_output[1]));
+ memcpy((char *)&t_output[0], (char *)ivec++, sizeof(t_output[0]));
+ memcpy((char *)&t_output[1], (char *)ivec, sizeof(t_output[1]));
}
else
#endif
/* get input */
#ifdef MUSTALIGN
if ((afs_int32) input & 3) {
- bcopy((char *)input++,(char *)&t_input[0],sizeof(t_input[0]));
- bcopy((char *)input++,(char *)&t_input[1],sizeof(t_input[1]));
+ memcpy((char *)&t_input[0], (char *)input++, sizeof(t_input[0]));
+ memcpy((char *)&t_input[1], (char *)input++, sizeof(t_input[1]));
}
else
#endif
/* copy temp output and save it for checksum */
#ifdef MUSTALIGN
if ((afs_int32) output & 3) {
- bcopy((char *)&t_output[0],(char *)output++,sizeof(t_output[0]));
- bcopy((char *)&t_output[1],(char *)output,sizeof(t_output[1]));
+ memcpy((char *)output++, (char *)&t_output[0], sizeof(t_output[0]));
+ memcpy((char *)output, (char *)&t_output[1], sizeof(t_output[1]));
}
else
#endif
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/des/crypt.c,v 1.1.1.4 2001/07/14 22:21:31 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/des/crypt.c,v 1.1.1.5 2001/09/11 14:32:29 hartmans Exp $");
#ifdef AFS_NT40_ENV
#include <windows.h>
#endif
#include <stdlib.h>
-#if defined(HAVE_STRINGS_H)
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
-#if defined(HAVE_STRING_H)
-#include <string.h>
#endif
/*
struct {
#if defined(LONG_IS_32_BITS)
/* long is often faster than a 32-bit bit field */
+#if defined(AFS_IA64_LINUX20_ENV)
+ int i0;
+ int i1;
+#else
long i0;
long i1;
+#endif
#else
long i0: 32;
long i1: 32;
int num_iter, salt_size;
C_block keyblock, rsltblock;
+
for (i = 0; i < 8; i++) {
if ((t = 2*(unsigned char)(*key)) != 0)
key++;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/des/des.c,v 1.1.1.4 2001/07/14 22:21:31 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/des/des.c,v 1.1.1.5 2001/09/11 14:32:30 hartmans Exp $");
#include <stdio.h>
#ifdef AFS_PTHREAD_ENV
}
#endif
if ((afs_int32) clear & 3) {
- bcopy((char *)clear++,(char *)&L_save,sizeof(L_save));
- bcopy((char *)clear,(char *)&R_save,sizeof(R_save));
+ memcpy((char *)&L_save, (char *)clear++, sizeof(L_save));
+ memcpy((char *)&R_save, (char *)clear, sizeof(R_save));
L1 = L_save;
R1 = R_save;
}
if ((afs_int32) cipher & 3) {
L_save = L2; /* cant bcopy a reg */
R_save = R2;
- bcopy((char *)&L_save,(char *)cipher++,sizeof(L_save));
- bcopy((char *)&R_save,(char *)cipher,sizeof(R_save));
+ memcpy((char *)cipher++, (char *)&L_save, sizeof(L_save));
+ memcpy((char *)cipher, (char *)&R_save, sizeof(R_save));
}
else
#endif
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/des/enc.c,v 1.1.1.3 2001/07/14 22:21:32 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/des/enc.c,v 1.1.1.4 2001/09/11 14:32:30 hartmans Exp $");
#include <mit-cpyright.h>
#include <des.h>
}
ivec[0] = 0;
ivec[1] = 0;
- bcopy(key,sum,sizeof(C_Block));
+ memcpy(sum, key, sizeof(C_Block));
for (;;) {
if ((length = read (ind, inbuf, 512)) < 0) {
fprintf (stderr, "%s: Error reading from input.\n",
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/des/misc.c,v 1.1.1.4 2001/07/14 22:21:35 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/des/misc.c,v 1.1.1.5 2001/09/11 14:32:31 hartmans Exp $");
#include <mit-cpyright.h>
#include <stdio.h>
#include "des_internal.h"
+int des_debug;
+
/*
* The DES algorithm is defined in terms of MSBFIRST, so sometimes,
* e.g. VAXes, we need to fix it up. ANSI order means the DES
#endif
}
-extern void gen PROTOTYPE((FILE * stream));
-int des_debug;
-char const *whoami;
-
-
-#ifndef DONT_INCL_MAIN
-
-#include "AFS_component_version_number.c"
-
-int main(argc, argv)
- int argc;
- char *argv[];
-{
- char *filename;
- char *arg;
- FILE * stream;
-
- whoami = argv[0];
- filename = (char *)NULL;
-
- while (argc--, *++argv) {
- arg = *argv;
- if (*arg == '-') {
- if (!strcmp(arg, "-d") && !strcmp(arg, "-debug"))
- des_debug++;
- else {
- fprintf(stderr, "%s: unknown control argument %s\n",
- whoami, arg);
- goto usage;
- }
- }
- else if (filename) {
- fprintf(stderr,
- "%s: multiple file names provided: %s, %s\n",
- whoami, filename, arg);
- goto usage;
- }
- else
- filename = arg;
- }
-
- if (!filename) {
- fprintf(stderr, "%s: no file name provided\n", whoami);
- goto usage;
- }
-
- stream = fopen(filename, "w");
- if (!stream) {
- perror(filename);
- usage:
- fprintf(stderr, "usage: %s [-debug] filename\n", whoami);
- exit(1);
- }
-
- fputs(
- "/* This file is automatically generated. Do not edit it. */\n",
- stream);
-
- /* This routine will generate the contents of the file. */
- gen(stream);
- if (fclose(stream) == EOF) {
- perror(filename);
- exit(1);
- }
- exit(0);
-}
-#endif /* DONT_INCL_MAIN */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/des/new_rnd_key.c,v 1.1.1.5 2001/07/14 22:21:36 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/des/new_rnd_key.c,v 1.1.1.6 2001/09/11 14:32:32 hartmans Exp $");
#include <des.h>
#include "des_internal.h"
#ifdef AFS_PTHREAD_ENV
#include <pthread.h>
#endif
-#if defined(HAVE_STRINGS_H)
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
-#if defined(HAVE_STRING_H)
-#include <string.h>
#endif
#include "stats.h"
des_set_sequence_number(des_cblock new_sequence_number)
{
LOCK_RANDOM
- bcopy((char *)new_sequence_number, (char *)sequence_number,
- sizeof(sequence_number));
+ memcpy((char *)sequence_number, (char *)new_sequence_number, sizeof(sequence_number));
UNLOCK_RANDOM
return 0;
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/des/pcbc_encrypt.c,v 1.1.1.4 2001/07/14 22:21:36 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/des/pcbc_encrypt.c,v 1.1.1.5 2001/09/11 14:32:32 hartmans Exp $");
#include "des_internal.h"
if (encrypt) {
#ifdef MUSTALIGN
if ((afs_int32) ivec & 3) {
- bcopy((char *)ivec++,(char *)&xor_0,sizeof(xor_0));
- bcopy((char *)ivec,(char *)&xor_1,sizeof(xor_1));
+ memcpy((char *)&xor_0, (char *)ivec++, sizeof(xor_0));
+ memcpy((char *)&xor_1, (char *)ivec, sizeof(xor_1));
}
else
#endif
/* get input */
#ifdef MUSTALIGN
if ((afs_int32) input & 3) {
- bcopy((char *)input,(char *)&t_input[0],sizeof(t_input[0]));
- bcopy((char *)(input+1),(char *)&t_input[1],sizeof(t_input[1]));
+ memcpy((char *)&t_input[0], (char *)input, sizeof(t_input[0]));
+ memcpy((char *)&t_input[1], (char *)(input+1), sizeof(t_input[1]));
}
else
#endif
*/
#ifdef MUSTALIGN
if ((afs_int32) input & 3) {
- bcopy((char *)input++,(char *)&xor_0,sizeof(xor_0));
+ memcpy((char *)&xor_0, (char *)input++, sizeof(xor_0));
xor_0 ^= t_output[0];
- bcopy((char *)input++,(char *)&xor_1,sizeof(xor_1));
+ memcpy((char *)&xor_1, (char *)input++, sizeof(xor_1));
xor_1 ^= t_output[1];
}
else
/* copy temp output and save it for cbc */
#ifdef MUSTALIGN
if ((afs_int32) output & 3) {
- bcopy((char *)&t_output[0],(char *)output++,
- sizeof(t_output[0]));
- bcopy((char *)&t_output[1],(char *)output++,
- sizeof(t_output[1]));
+ memcpy((char *)output++, (char *)&t_output[0], sizeof(t_output[0]));
+ memcpy((char *)output++, (char *)&t_output[1], sizeof(t_output[1]));
}
else
#endif
/* decrypt */
#ifdef MUSTALIGN
if ((afs_int32) ivec & 3) {
- bcopy((char *)ivec++,(char *)&xor_0,sizeof(xor_0));
- bcopy((char *)ivec,(char *)&xor_1,sizeof(xor_1));
+ memcpy((char *)&xor_0, (char *)ivec++, sizeof(xor_0));
+ memcpy((char *)&xor_1, (char *)ivec, sizeof(xor_1));
}
else
#endif
/* get input */
#ifdef MUSTALIGN
if ((afs_int32) input & 3) {
- bcopy((char *)input++,(char *)&t_input[0],sizeof(t_input[0]));
- bcopy((char *)input++,(char *)&t_input[1],sizeof(t_input[1]));
+ memcpy((char *)&t_input[0], (char *)input++, sizeof(t_input[0]));
+ memcpy((char *)&t_input[1], (char *)input++, sizeof(t_input[1]));
}
else
#endif
/* copy temp output */
#ifdef MUSTALIGN
if ((afs_int32) output & 3) {
- bcopy((char *)&t_output[0],(char *)output++,
- sizeof(t_output[0]));
- bcopy((char *)&t_output[1],(char *)output++,
- sizeof(t_output[1]));
+ memcpy((char *)output++, (char *)&t_output[0], sizeof(t_output[0]));
+ memcpy((char *)output++, (char *)&t_output[1], sizeof(t_output[1]));
}
else
#endif
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/des/read_pssword.c,v 1.1.1.5 2001/07/14 22:21:37 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/des/read_pssword.c,v 1.1.1.6 2001/09/11 14:32:33 hartmans Exp $");
#include <mit-cpyright.h>
#include <des.h>
#include "conf.h"
#include <stdio.h>
-#if defined(HAVE_STRINGS_H)
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
-#if defined(HAVE_STRING_H)
-#include <string.h>
#endif
#ifdef BSDUNIX
#ifdef BSDUNIX
lose:
#endif
- bzero(key_string, sizeof (key_string));
+ memset(key_string, 0, sizeof (key_string));
return ok;
}
#else
#ifdef BSDUNIX
/* XXX assume jmp_buf is typedef'ed to an array */
- bcopy((char *)old_env, (char *)env, sizeof(env));
+ memcpy((char *)env, (char *)old_env, sizeof(env));
if (setjmp(env))
goto lose;
/* save terminal state*/
return -1;
push_signals();
/* Turn off echo */
- bcopy (&tty_state, &echo_off_tty_state, sizeof (tty_state));
+ memcpy(&echo_off_tty_state, &tty_state, sizeof (tty_state));
echo_off_tty_state.sg_flags &= ~ECHO;
if (ioctl(0,TIOCSETP,(char *)&echo_off_tty_state) == -1)
return -1;
}
continue;
}
- if ((ptr = index(s, '\n')))
+ if ((ptr = strchr(s, '\n')))
*ptr = '\0';
#endif
if (verify) {
clearerr(stdin);
continue;
}
- if ((ptr = index(key_string, '\n')))
+ if ((ptr = strchr(key_string, '\n')))
*ptr = '\0';
#endif
if (strcmp(s,key_string)) {
lose:
#endif
if (!ok)
- bzero(s, maxa);
+ memset(s, 0, maxa);
printf("\n");
#if defined(AFS_HPUX_ENV) || defined(AFS_FBSD_ENV)
/*
if (ioctl(0,TIOCSETP,(char *)&tty_state))
ok = 0;
pop_signals();
- bcopy((char *)env, (char *)old_env, sizeof(env));
+ memcpy((char *)old_env, (char *)env, sizeof(env));
#else
#if defined (AFS_AIX_ENV) /*|| defined (AFS_HPUX_ENV)*/ || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV)
ttyb.c_lflag = flags;
#endif
#endif
if (verify)
- bzero(key_string, sizeof (key_string));
+ memset(key_string, 0, sizeof (key_string));
s[maxa-1] = 0; /* force termination */
return !ok; /* return nonzero if not okay */
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/des/strng_to_key.c,v 1.1.1.5 2001/07/14 22:21:36 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/des/strng_to_key.c,v 1.1.1.6 2001/09/11 14:32:33 hartmans Exp $");
#include <des.h>
#include "des_internal.h"
-#if defined(HAVE_STRINGS_H)
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
-#if defined(HAVE_STRING_H)
-#include <string.h>
#endif
extern int des_debug;
length = strlen(str);
/* init key array for bits */
- bzero(k_char,sizeof(k_char));
+ memset(k_char, 0, sizeof(k_char));
#ifdef DEBUG
if (des_debug)
(void) des_key_sched(key,key_sked);
(void) des_cbc_cksum((des_cblock *)in_str,key,length,key_sked,key);
/* erase key_sked */
- bzero((char *)key_sked,sizeof(key_sked));
+ memset((char *)key_sked, 0, sizeof(key_sked));
/* now fix up key parity again */
des_fixup_key_parity(key);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/des/weak_key.c,v 1.1.1.5 2001/07/14 22:21:37 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/des/weak_key.c,v 1.1.1.6 2001/09/11 14:32:33 hartmans Exp $");
#include <des.h>
#include "des_internal.h"
-#if defined(HAVE_STRINGS_H)
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
-#if defined(HAVE_STRING_H)
-#include <string.h>
#endif
/*
const des_cblock *weak_p = weak;
for (i = 0; i < (sizeof(weak)/sizeof(des_cblock)); i++) {
- if (!bcmp((char *)weak_p++,(char *)key,sizeof(des_cblock)))
+ if (!memcmp((char *)weak_p++,(char *)key,sizeof(des_cblock)))
return 1;
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/dir/buffer.c,v 1.1.1.4 2001/07/14 22:21:40 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/dir/buffer.c,v 1.1.1.5 2001/09/11 14:32:35 hartmans Exp $");
+#include <stdlib.h>
#include <lock.h>
#include "dir.h"
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/dir/salvage.c,v 1.1.1.4 2001/07/14 22:21:50 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/dir/salvage.c,v 1.1.1.5 2001/09/11 14:32:36 hartmans Exp $");
#include <sys/types.h>
#include <errno.h>
struct DirEntry *ep;
int entry;
- bzero(dot, sizeof(dot));
- bzero(dotdot, sizeof(dotdot));
+ memset(dot, 0, sizeof(dot));
+ memset(dotdot, 0, sizeof(dotdot));
dot[1] = vn;
dot[2] = vu;
dotdot[1] = pvn;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/dir/test/dtest.c,v 1.1.1.4 2001/07/14 22:21:51 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/dir/test/dtest.c,v 1.1.1.5 2001/09/11 14:32:36 hartmans Exp $");
#ifdef AFS_NT40_ENV
#include <fcntl.h>
dirhandle dir;
CreateDir(dname, &dir);
- bzero(fid, sizeof(fid));
+ memset(fid, 0, sizeof(fid));
MakeDir(&dir, fid, fid);
for(i=0;i<count;i++) {
sprintf(tbuffer, "%s%d", ename, i);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/export/cfgexport.c,v 1.1.1.4 2001/07/14 22:21:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/export/cfgexport.c,v 1.1.1.5 2001/09/11 14:32:37 hartmans Exp $");
#include <stdio.h>
#include <fcntl.h>
kstr_size = 0;
nksyms = 0;
- bzero(xsq = &xcoff_sym, sizeof (*xsq));
+ memset(xsq = &xcoff_sym, 0, sizeof (*xsq));
for (i = 1; i < nxsyms; ++i, xsq = xsp++) {
if (xsp->n_zeroes != xsq->n_zeroes
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/export/symtab.c,v 1.1.1.4 2001/07/14 22:21:53 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/export/symtab.c,v 1.1.1.5 2001/09/11 14:32:38 hartmans Exp $");
#include "sys/types.h"
#include "sym.h"
*/
if (sym = symsrch(name))
return sym;
- bcopy(name, buf+1, sizeof (buf) - 2);
+ memcpy(buf+1, name, sizeof (buf) - 2);
buf[0] = '.';
if (sym = symsrch(buf))
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/fsprobe/fsprobe.c,v 1.1.1.4 2001/07/14 22:21:56 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/fsprobe/fsprobe.c,v 1.1.1.5 2001/09/11 14:32:40 hartmans Exp $");
#include <fsprobe.h> /*Interface for this module*/
#include <lwp.h> /*Lightweight process package*/
struct interfaceAddr *interfaceAddr; /*Bogus param*/
fsprobe_ConnInfo = (struct fsprobe_ConnectionInfo *)0;
- bzero(fsprobe_Results, sizeof(struct fsprobe_ProbeResults));
+ memset(&fsprobe_Results, 0, sizeof(struct fsprobe_ProbeResults));
rxcall = (struct rx_call *)0;
Fids_Array = (AFSCBFids *)0;
curr_stats = fsprobe_Results.stats;
curr_probeOK = fsprobe_Results.probeOK;
fsprobe_Results.probeNum++;
- bzero(fsprobe_Results.stats, fsprobe_statsBytes);
- bzero(fsprobe_Results.probeOK, fsprobe_probeOKBytes);
+ memset(fsprobe_Results.stats, 0, fsprobe_statsBytes);
+ memset(fsprobe_Results.probeOK, 0, fsprobe_probeOKBytes);
for (conn_idx = 0; conn_idx < fsprobe_numServers; conn_idx++) {
/*
fsprobe_Results.probeNum = 0;
fsprobe_Results.probeTime = 0;
- bzero(fsprobe_Results.stats,
- (a_numServers * sizeof(struct ProbeViceStatistics)));
+ memset(fsprobe_Results.stats, 0, (a_numServers * sizeof(struct ProbeViceStatistics)));
/*
* Initialize the Rx subsystem, just in case nobody's done it.
(a_socketArray + curr_srv)->sin_addr.s_addr,
(a_socketArray + curr_srv)->sin_port);
}
- bcopy(a_socketArray + curr_srv,
- &(curr_conn->skt),
- sizeof(struct sockaddr_in));
+ memcpy(&(curr_conn->skt), a_socketArray + curr_srv, sizeof(struct sockaddr_in));
hostNameFound = hostutil_GetNameByINet(curr_conn->skt.sin_addr.s_addr);
if (hostNameFound == (char *)0) {
} else {
int i, cnt;
- bzero(&curr_conn->partList, sizeof(struct partList));
+ memset(&curr_conn->partList, 0, sizeof(struct partList));
curr_conn->partCnt = 0;
i = XListPartitions(curr_conn->rxVolconn, &curr_conn->partList, &cnt);
if (!i) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/fsprobe/fsprobe_test.c,v 1.1.1.4 2001/07/14 22:21:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/fsprobe/fsprobe_test.c,v 1.1.1.5 2001/09/11 14:32:40 hartmans Exp $");
#include <fsprobe.h> /*Interface for fsprobe module*/
fprintf(stderr, "[%s] Can't get host info for servername1\n", rn);
exit(-1);
}
- bcopy(he->h_addr, &(FSSktArray[0].sin_addr.s_addr), 4);
+ memcpy(&(FSSktArray[0].sin_addr.s_addr), he->h_addr, 4);
FSSktArray[1].sin_family = htons(AF_INET); /*Internet address family*/
FSSktArray[1].sin_port = htons(7000); /*FileServer port*/
fprintf(stderr, "[%s] Can't get host info for servername2\n", rn);
exit(-1);
}
- bcopy(he->h_addr, &(FSSktArray[1].sin_addr.s_addr), 4);
+ memcpy(&(FSSktArray[1].sin_addr.s_addr), he->h_addr, 4);
FSSktArray[2].sin_family = htons(AF_INET); /*Internet address family*/
FSSktArray[2].sin_port = htons(7000); /*FileServer port*/
fprintf(stderr, "[%s] Can't get host info for servername3\n", rn);
exit(-1);
}
- bcopy(he->h_addr, &(FSSktArray[2].sin_addr.s_addr), 4);
+ memcpy(&(FSSktArray[2].sin_addr.s_addr), he->h_addr, 4);
printf("Sockets for the 3 AFS FileServers to be probed:\n");
printf("\t Host servername1: IP addr 0x%lx, port %d\n",
if (strncasecmp(cbuf, "PASS", 4) != NULL)
setproctitle("%s: %s", proctitle, cbuf);
#endif /* SETPROCTITLE */
- if ((cp = index(cbuf, '\r'))) {
+ if ((cp = strchr(cbuf, '\r'))) {
*cp++ = '\n';
*cp = '\0';
}
syslog(LOG_ERR, MSGSTR(SOCKOPT, "setsockopt: %m"));
/* set-up signal handler routines for SRC TRACE ON/OFF support */
- bzero((char *)&sa, sizeof(sa));
+ memset((char *)&sa, 0, sizeof(sa));
sa.sa_mask.losigs = sigmask(SIGUSR2);
sa.sa_handler = trace_handler;
sigaction(SIGUSR1, &sa, (struct sigaction *)0);
return;
}
- bzero((char *)&ut, sizeof(ut));
+ memset((char *)&ut, 0, sizeof(ut));
if (!fstat(fd, &buf)) {
(void)strncpy(ut.ut_line, line, sizeof(ut.ut_line));
(void)strncpy(ut.ut_name, name, sizeof(ut.ut_name));
if (!(pids =
(uid_t *)malloc((u_int)(fds * sizeof(uid_t)))))
return(NULL);
- bzero(pids, fds * sizeof(uid_t));
+ memset(pids, 0, fds * sizeof(uid_t));
}
if (pipe(pdes) < 0)
return(NULL);
if (pids[fdes = fileno(iop)] == 0)
return(-1);
(void)fclose(iop);
- bzero((char *)someSignals, sizeof(someSignals));
+ memset((char *)someSignals, 0, sizeof(someSignals));
someSignals[0] = (1<<(SIGINT-1)) + (1<<(SIGQUIT-1)) + (1<<(SIGHUP-1));
sigBlock = *((sigset_t *) someSignals);
sigprocmask(SIG_BLOCK, &sigBlock, &oset);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/gtx/frame.c,v 1.1.1.4 2001/07/14 22:21:59 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/gtx/frame.c,v 1.1.1.5 2001/09/11 14:32:44 hartmans Exp $");
#ifdef AFS_HPUX_ENV
#include <sys/types.h>
tmenu = (struct gtxframe_menu *) malloc(sizeof(*tmenu));
if (tmenu == (struct gtxframe_menu *)0)
return(-1);
- bzero(tmenu, sizeof(*tmenu));
+ memset(tmenu, 0, sizeof(*tmenu));
tmenu->next = aframe->menus;
aframe->menus = tmenu;
tmenu->name = gtx_CopyString(alabel);
WOP_GETDIMENSIONS(aframe->window, &sizeparms);
if (aframe->promptLine) {
- bzero(&strparms, sizeof(strparms));
+ memset(&strparms, 0, sizeof(strparms));
strparms.x = 0;
strparms.y = sizeparms.maxy-1;
strparms.highlight = 1;
}
else if (aframe->messageLine) {
/* Otherwise we're visible, print the message at the bottom */
- bzero(&strparms, sizeof(strparms));
+ memset(&strparms, 0, sizeof(strparms));
strparms.highlight = 1;
strparms.x = 0;
strparms.y = sizeparms.maxy-1;
* Now that all the pieces exist, fill them in and stick them in
* the right places.
*/
- bzero(tframe, sizeof(struct gtx_frame));
+ memset(tframe, 0, sizeof(struct gtx_frame));
tframe->keymap = newkeymap;
tframe->keystate = newkeystate;
keymap_InitState(tframe->keystate, tframe->keymap);
strcat(menubuffer, " ");
}
if (menubuffer[0] != 0) {
- bzero(&strparms, sizeof(strparms));
+ memset(&strparms, 0, sizeof(strparms));
strparms.x = 0;
strparms.y = 0;
strparms.s = menubuffer;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/gtx/keymap.c,v 1.1.1.4 2001/07/14 22:22:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/gtx/keymap.c,v 1.1.1.5 2001/09/11 14:32:46 hartmans Exp $");
#include "gtxkeymap.h"
tmap = (struct keymap_map *) malloc(sizeof(struct keymap_map));
if (tmap != (struct keymap_map *)0)
- bzero(tmap, sizeof(*tmap));
+ memset(tmap, 0, sizeof(*tmap));
return(tmap);
}
keymap_InitState(astate, amap)
register struct keymap_state *astate;
struct keymap_map *amap; {
- bzero(astate, sizeof(*astate));
+ memset(astate, 0, sizeof(*astate));
astate->initMap = amap;
astate->currentMap = amap;
return 0;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/gtx/textcb.c,v 1.1.1.4 2001/07/14 22:22:05 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/gtx/textcb.c,v 1.1.1.5 2001/09/11 14:32:47 hartmans Exp $");
#include "gtxtextcb.h" /*Module interface*/
#include <stdio.h> /*Standard I/O stuff*/
*/
if (gator_textcb_debug)
fprintf(stderr, "[%s] Zeroing %d bytes in text buffer at 0x%x\n", rn, numBuffBytes, newBuff);
- bzero(newBuff, numBuffBytes);
+ memset(newBuff, 0, numBuffBytes);
if (gator_textcb_debug)
fprintf(stderr, "[%s] Initializing blank line buffer at 0x%x\n", rn, blankLine);
curr_ent->numInversions = 0;
curr_ent->charsUsed = 0;
curr_ent->textp = curr_buff;
- bcopy(blankLine, curr_ent->textp, a_maxCharsPerEntry+1);
+ memcpy(curr_ent->textp, blankLine, a_maxCharsPerEntry+1);
for (curr_inv = 0; curr_inv < GATOR_TEXTCB_MAXINVERSIONS; curr_inv++)
curr_ent->inversion[curr_inv] = 0;
* Copy over a blank line into the one we're initializing. We
* copy over the trailing null, too.
*/
- bcopy(a_cbhdr->blankLine, curr_ent->textp, a_cbhdr->maxCharsPerEntry+1);
+ memcpy(curr_ent->textp, a_cbhdr->blankLine, a_cbhdr->maxCharsPerEntry+1);
for (inv=0; inv < GATOR_TEXTCB_MAXINVERSIONS; inv++)
curr_ent->inversion[inv] = 0;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/inetd/inetd.c,v 1.1.1.4 2001/07/14 22:22:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/inetd/inetd.c,v 1.1.1.5 2001/09/11 14:32:48 hartmans Exp $");
#include <sys/param.h>
#include <sys/stat.h>
#endif /* defined(AFS_HPUX_ENV) */
memset((char *)allZeroes, '\0', sizeof(allZeroes));
- bzero((char *)allZeroes, sizeof(allZeroes));
+ memset((char *)allZeroes, 0, sizeof(allZeroes));
sigNone = *((sigset_t *) allZeroes);
allZeroes[0] = (1<<(SIGCHLD-1)) + (1<<(SIGHUP-1)) + (1<<(SIGALRM-1));
inet_ntoa(his_addr.sin_addr.s_addr),
ntohs(his_addr.sin_port));
execl(sep->se_server,
- rindex(sep->se_server, '/')+1,
+ strrchr(sep->se_server, '/')+1,
sep->se_socktype == SOCK_DGRAM
? (char *)0 : addrbuf, (char *)0);
} else
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/inetd/setenv.c,v 1.1.1.3 2001/07/14 22:22:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/inetd/setenv.c,v 1.1.1.4 2001/09/11 14:32:49 hartmans Exp $");
#include <sys/types.h>
#include <stdio.h>
(cnt + 2)));
if (!P)
return(-1);
- bcopy(environ, P, cnt * sizeof(char *));
+ memcpy(P, environ, cnt * sizeof(char *));
environ = P;
}
environ[cnt + 1] = NULL;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/inetd/ta-rauth.c,v 1.1.1.4 2001/07/14 22:22:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/inetd/ta-rauth.c,v 1.1.1.5 2001/09/11 14:32:51 hartmans Exp $");
#include <sys/types.h>
#include <sys/param.h>
/* (4) sessionKey */
bp = buf + strlen(buf);
- bcopy(&token->sessionKey,bp,8);
+ memcpy(bp, &token->sessionKey, 8);
bp += 8;
/* (5) - (6) */
/* (7) ticket */
bp += strlen(bp);
- bcopy(token->ticket, bp, token->ticketLen);
+ memcpy(bp, token->ticket, token->ticketLen);
bp += token->ticketLen;
if((count = write(s, buf, (int)(bp - buf))) == -1) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/admin_tools.c,v 1.1.1.7 2001/07/14 22:22:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/admin_tools.c,v 1.1.1.8 2001/09/11 14:32:52 hartmans Exp $");
#include <afs/stds.h>
#include <afs/debug.h>
hrs = 0;
s = as->parms[7].items->data;
- if (index(s, ':'))
+ if (strchr(s, ':'))
sscanf(s, "%d:%d", &hrs, &mins);
else
sscanf(s, "%d", &mins);
if (code) { /* if not then get key and try again */
if (as->parms[13].items) { /* if password specified */
strncpy (passwd, as->parms[13].items->data, sizeof(passwd));
- bzero (as->parms[13].items->data, strlen (as->parms[13].items->data));
+ memset(as->parms[13].items->data, 0, strlen (as->parms[13].items->data));
} else {
char msg[MAXKTCNAMELEN+50];
if (as->parms[12].items) sprintf (msg, "Administrator's (%s) Password: ", name);
"getting Authentication token for %s",
PrintedName (name, instance, cell));
}
- bzero (&key, sizeof(key));
+ memset(&key, 0, sizeof(key));
}
}
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/authclient.c,v 1.1.1.6 2001/07/14 22:22:09 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/authclient.c,v 1.1.1.7 2001/09/11 14:32:52 hartmans Exp $");
#if defined(UKERNEL)
#include "../afs/sysincludes.h"
cksum = ntohl(answer->cksum);
if (challenge != ntohl(answer->challenge)) return KABADPROTOCOL;
- bcopy (&answer->sessionKey, &token->sessionKey, sizeof(token->sessionKey));
+ memcpy(&token->sessionKey, &answer->sessionKey, sizeof(token->sessionKey));
token->startTime = ntohl(answer->startTime);
token->endTime = ntohl(answer->endTime);
token->kvno = (short) ntohl(answer->kvno);
)
return KABADPROTOCOL;
- bcopy (strings, token->ticket, token->ticketLen);
+ memcpy(token->ticket, strings, token->ticketLen);
strings += token->ticketLen;
- if (bcmp (strings, label, KA_LABELSIZE) != 0) return KABADPROTOCOL;
+ if (memcmp (strings, label, KA_LABELSIZE) != 0) return KABADPROTOCOL;
if (pwexpires) {
afs_int32 temp;
if (oanswer->SeqLen > temp) {
strings = oanswer->SeqBody + temp;
- bcopy (strings, &temp, sizeof(afs_int32));
+ memcpy(&temp, strings, sizeof(afs_int32));
tempc = ntohl(temp) >> 24;
/* don't forget this if you add any more fields!
strings += sizeof(afs_int32);
request_time = time(0);
request.time = htonl(request_time);
- bcopy (req_label, request.label, sizeof(request.label));
+ memcpy(request.label, req_label, sizeof(request.label));
arequest.SeqLen = sizeof(request);
arequest.SeqBody = (char *)&request;
des_pcbc_encrypt (arequest.SeqBody, arequest.SeqBody, arequest.SeqLen,
token->endTime = end;
token->kvno = ntohl(answer_old.kvno);
token->ticketLen = answer_old.ticket_len;
- bcopy (answer_old.ticket, token->ticket, sizeof(token->ticket));
- bcopy (&answer_old.sessionkey, &token->sessionKey,
- sizeof(struct ktc_encryptionKey));
+ memcpy(token->ticket, answer_old.ticket, sizeof(token->ticket));
+ memcpy(&token->sessionKey, &answer_old.sessionkey, sizeof(struct ktc_encryptionKey));
}
break;
default:
token->endTime = ntohl(answer_old.endTime);
token->ticketLen = ntohl(answer_old.ticketLen);
token->kvno = ntohl(answer_old.kvno);
- bcopy (&answer_old.sessionKey, &token->sessionKey,
- sizeof(token->sessionKey));
+ memcpy(&token->sessionKey, &answer_old.sessionKey, sizeof(token->sessionKey));
if (tkt_CheckTimes (token->startTime, token->endTime, time(0)) < 0) {
UNLOCK_GLOBAL_MUTEX
UNLOCK_GLOBAL_MUTEX
return KABADPROTOCOL;
}
- bcopy (strings, token->ticket, token->ticketLen);
+ memcpy(token->ticket, strings, token->ticketLen);
break;
default:
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/client.c,v 1.1.1.5 2001/07/14 22:22:08 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/client.c,v 1.1.1.6 2001/09/11 14:32:53 hartmans Exp $");
#if defined(UKERNEL)
#include "../afs/sysincludes.h"
int i;
int passlen;
- bzero (key, sizeof(struct ktc_encryptionKey));
+ memset(key, 0, sizeof(struct ktc_encryptionKey));
strncpy (password, cell, 8);
passlen = strlen (str);
if ((passlen = strlen(password)) > sizeof(password))
passlen = sizeof(password);
- bcopy ("kerberos", ivec, 8);
- bcopy ("kerberos", temp_key, 8);
+ memcpy(ivec, "kerberos", 8);
+ memcpy(temp_key, "kerberos", 8);
des_fixup_key_parity (temp_key);
des_key_sched (temp_key, schedule);
des_cbc_cksum (password, ivec, passlen, schedule, ivec);
- bcopy (ivec, temp_key, 8);
+ memcpy(temp_key, ivec, 8);
des_fixup_key_parity (temp_key);
des_key_sched (temp_key, schedule);
des_cbc_cksum (password, key, passlen, schedule, ivec);
afs_int32 code;
LOCK_GLOBAL_MUTEX
- bzero (key, sizeof(struct ktc_encryptionKey));
+ memset(key, 0, sizeof(struct ktc_encryptionKey));
code = read_pw_string (password, sizeof(password), prompt, verify);
if (code) {
UNLOCK_GLOBAL_MUTEX
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kadatabase.c,v 1.1.1.4 2001/07/14 22:22:10 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kadatabase.c,v 1.1.1.5 2001/09/11 14:32:54 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
printf ("Error discovered in header, rebuilding.\n");
/* try to write a good header */
- bzero(&cheader,sizeof(cheader));
+ memset(&cheader, 0, sizeof(cheader));
cheader.version = htonl(KADBVERSION);
cheader.checkVersion = htonl(KADBVERSION);
cheader.headerSize = htonl(sizeof(cheader));
code = inc_header_word (at, stats.allocs);
if (code) return 0;
- bzero (tentry, sizeof(kaentry)); /* zero new entry */
+ memset(tentry, 0, sizeof(kaentry)); /* zero new entry */
return temp;
}
/* check index just to be on the safe side */
if (!index_OK (index)) return KABADINDEX;
- bzero (&tentry, sizeof(kaentry));
+ memset(&tentry, 0, sizeof(kaentry));
tentry.next = cheader.freePtr;
tentry.flags = htonl(KAFFREE);
code = set_header_word (at, freePtr, htonl(index));
((now - ntohl(okeys.keys[i].superseded) > maxKeyLifetime)) ) {
okeys.keys[i].superseded = 0;
okeys.keys[i].version = htonl(-1);
- bzero(&okeys.keys[i].key, sizeof(struct ktc_encryptionKey));
+ memset(&okeys.keys[i].key, 0, sizeof(struct ktc_encryptionKey));
modified = 1;
es_Report ("Dropped oldkey %d seconds old with kvno %d\n",
if (!addednewkey && (okeys.keys[i].superseded == 0)) {
okeys.keys[i].version = htonl(newkeyver);
okeys.keys[i].superseded = htonl(NEVERDATE);
- bcopy (key, &okeys.keys[i].key, sizeof(struct ktc_encryptionKey));
+ memcpy(&okeys.keys[i].key, key, sizeof(struct ktc_encryptionKey));
modified = 1;
addednewkey = okeysaddr;
}
okeys.entry = htonl(tentryaddr);
okeys.keys[0].version = htonl(newkeyver);
okeys.keys[0].superseded = htonl(NEVERDATE);
- bcopy (key, &okeys.keys[0].key, sizeof(struct ktc_encryptionKey));
+ memcpy(&okeys.keys[0].key, key, sizeof(struct ktc_encryptionKey));
newtotalkeyentries++;
/* Thread onto the header's chain of oldkeys */
tentry->misc.asServer.oldKeys = htonl(addednewkey);
tentry->misc.asServer.nOldKeys = htonl(newtotalkeyentries);
tentry->key_version = htonl(newkeyver);
- bcopy (key, &tentry->key, sizeof (tentry->key));
+ memcpy(&tentry->key, key, sizeof (tentry->key));
/* invalidate key caches everywhere */
code = inc_header_word (tt, specialKeysVersion);
struct ka_debugInfo *info;
{ int i;
- bcopy (&cheader_lock, &info->cheader_lock, sizeof (info->cheader_lock));
- bcopy (&keycache_lock, &info->keycache_lock, sizeof (info->keycache_lock));
+ memcpy(&info->cheader_lock, &cheader_lock, sizeof (info->cheader_lock));
+ memcpy(&info->keycache_lock, &keycache_lock, sizeof (info->keycache_lock));
info->kcVersion = keyCacheVersion;
info->kcSize = maxCachedKeys;
strncpy (keyCache[i].name, name, sizeof (keyCache[i].name));
strncpy (keyCache[i].inst, inst, sizeof (keyCache[i].inst));
keyCacheVersion = ntohl(cheader.specialKeysVersion);
- bcopy (key, &keyCache[i].key, sizeof(*key));
+ memcpy(&keyCache[i].key, key, sizeof(*key));
keyCache[i].superseded = superseded;
keyCache[i].used = time(0);
if ((keyCache[i].kvno == kvno) &&
(strcmp(keyCache[i].name, name) == 0) &&
(strcmp(keyCache[i].inst, inst) == 0)) {
- bcopy (&keyCache[i].key, key, sizeof(*key));
+ memcpy(key, &keyCache[i].key, sizeof(*key));
keyCache[i].used = time(0);
ReleaseReadLock (&keycache_lock);
return 0;
/* first check the current key */
if (tentry.key_version == htonl(kvno)) {
- bcopy (&tentry.key, key, sizeof(*key));
+ memcpy(key, &tentry.key, sizeof(*key));
ka_Encache (name, inst, kvno, key, NEVERDATE);
return 0;
}
for (i=0; i<NOLDKEYS; i++)
if (okeys.keys[i].superseded &&
(ntohl(okeys.keys[i].version) == kvno)) {
- bcopy (&okeys.keys[i].key, key, sizeof(*key));
+ memcpy(key, &okeys.keys[i].key, sizeof(*key));
ka_Encache (name, inst, kvno, key,
ntohl(okeys.keys[i].superseded));
return 0;
if ((keyCache[i].superseded == NEVERDATE) &&
(strcmp(keyCache[i].name, name) == 0) &&
(strcmp(keyCache[i].inst, inst) == 0)){
- bcopy (&keyCache[i].key, key, sizeof(*key));
+ memcpy(key, &keyCache[i].key, sizeof(*key));
*kvno = keyCache[i].kvno;
keyCache[i].used = time(0);
ReleaseReadLock (&keycache_lock);
code = FindBlock (tt, name, inst, &to, &tentry);
if (code) return code;
if (to == 0) return KANOENT;
- bcopy (&tentry.key, key, sizeof(*key));
+ memcpy(key, &tentry.key, sizeof(*key));
*kvno = ntohl(tentry.key_version);
ka_Encache (name, inst, *kvno, key, NEVERDATE);
return 0;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kaprocs.c,v 1.1.1.6 2001/07/14 22:22:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kaprocs.c,v 1.1.1.7 2001/09/11 14:32:56 hartmans Exp $");
#include <afs/stds.h>
#include <errno.h>
if (nextAutoCPWTime == 0) { /* initialize things */
nextAutoCPWTime = time.tv_sec + autoCPWInterval;
- bcopy (&time, &random_value[0], 8);
- bcopy (&time, &random_value[2], 8);
+ memcpy(&random_value[0], &time, 8);
+ memcpy(&random_value[2], &time, 8);
}
if ((++totalUpdates >= autoCPWUpdates) &&
if (code) return code;
if (to) { /* check if auto cpw is disabled */
if (!(ntohl(tentry.flags) & KAFNOCPW)) {
- bcopy (&random_value[0], &key, sizeof(key));
+ memcpy(&key, &random_value[0], sizeof(key));
des_fixup_key_parity (&key);
code = set_password (tt, KA_ADMIN_NAME, KA_ADMIN_INST,
&key, 0, 0);
if (code) return code;
if (to) { /* check if auto cpw is disabled */
if (!(ntohl(tentry.flags) & KAFNOCPW)) {
- bcopy (&random_value[2], &key, sizeof(key));
+ memcpy(&key, &random_value[2], sizeof(key));
des_fixup_key_parity (&key);
code = set_password (tt, KA_TGS_NAME, lrealm, &key, 0, 0);
if (code == 0) {
if (code = ka_NewKey (tt, to, &tentry, key)) return code;
}
else {
- bcopy(key, &tentry.key, sizeof(tentry.key));
+ memcpy(&tentry.key, key, sizeof(tentry.key));
tentry.key_version = htonl(0);
}
tentry.user_expiration = htonl(NEVERDATE);
oanswer->SeqLen = answer_len;
answer = oanswer->SeqBody;
request.time = htonl (request_time+1);
- bcopy ((char *)&request.time, answer, sizeof(Date));
+ memcpy(answer, (char *)&request.time, sizeof(Date));
answer += sizeof(Date);
- bcopy (KA_CPW_ANS_LABEL, answer, KA_LABELSIZE);
+ memcpy(answer, KA_CPW_ANS_LABEL, KA_LABELSIZE);
des_pcbc_encrypt (oanswer->SeqBody, oanswer->SeqBody, answer_len,
user_schedule, &tentry.key, ENCRYPT);
if ((now - ntohl(tentry->change_password_time)) < MinHours*60*60)
return KATOOSOON;
- if (!bcmp(password, &(tentry->key), sizeof(EncryptionKey)))
+ if (!memcmp(password, &(tentry->key), sizeof(EncryptionKey)))
return KAREUSED;
code = ka_KeyCheckSum ((char *)password, &newsum);
if (code = ka_NewKey (tt, to, &tentry, password)) return(code);
}
else {
- bcopy (password, &tentry.key, sizeof(tentry.key));
+ memcpy(&tentry.key, password, sizeof(tentry.key));
if (!kvno) {
kvno = ntohl(tentry.key_version);
if ((kvno < 1) || (kvno >= MAXKAKVNO))
answer = (struct ka_ticketAnswer *)oanswer->SeqBody;
answer->challenge = htonl(challenge);
- bcopy (sessionKey, &answer->sessionKey, sizeof(struct ktc_encryptionKey));
+ memcpy(&answer->sessionKey, sessionKey, sizeof(struct ktc_encryptionKey));
answer->startTime = htonl(start);
answer->endTime = htonl(end);
answer->kvno = server->key_version;
putstr (server->userID.name);
putstr (server->userID.instance);
if (rem < ticketLen+KA_LABELSIZE) return code;
- bcopy (ticket, ans, ticketLen);
+ memcpy(ans, ticket, ticketLen);
ans += ticketLen;
- if (label) bcopy (label, ans, KA_LABELSIZE);
- else bzero (ans, KA_LABELSIZE);
+ if (label) memcpy(ans, label, KA_LABELSIZE);
+ else memset(ans, 0, KA_LABELSIZE);
ans += KA_LABELSIZE;
oanswer->SeqLen = (ans - oanswer->SeqBody);
}
else { /* return our time if possible */
oanswer->SeqLen = sizeof(afs_int32);
request.time = htonl(now);
- bcopy (&request.time, oanswer->SeqBody, sizeof(afs_int32));
+ memcpy(oanswer->SeqBody, &request.time, sizeof(afs_int32));
}
#endif
code = KACLOCKSKEW;
if (to == 0) {code = KANOENT; goto abort; }
tgskvno = ntohl(server.key_version);
- bcopy (&server.key, &tgskey, sizeof(tgskey));
+ memcpy(&tgskey, &server.key, sizeof(tgskey));
code = des_random_key (&sessionKey);
if (code) {
oanswer->SeqLen = answer_len;
answer = oanswer->SeqBody;
answer_time = htonl(request.time+1);
- bcopy ((char *)&answer_time, answer, sizeof(Date));
+ memcpy(answer, (char *)&answer_time, sizeof(Date));
answer += sizeof(Date);
- bcopy ((char *)&sessionKey, answer, sizeof(struct ktc_encryptionKey));
+ memcpy(answer, (char *)&sessionKey, sizeof(struct ktc_encryptionKey));
answer += sizeof(struct ktc_encryptionKey);
temp = htonl(tgskvno);
- bcopy ((char *)&temp, answer, sizeof(afs_int32));
+ memcpy(answer, (char *)&temp, sizeof(afs_int32));
answer += sizeof(afs_int32);
temp = htonl(ticketLen);
- bcopy ((char *)&temp, answer, sizeof(afs_int32));
+ memcpy(answer, (char *)&temp, sizeof(afs_int32));
answer += sizeof(afs_int32);
- bcopy (ticket, answer, ticketLen);
+ memcpy(answer, ticket, ticketLen);
answer += ticketLen;
- bcopy ((tgt ? KA_GETTGT_ANS_LABEL : KA_GETADM_ANS_LABEL), answer,
- KA_LABELSIZE);
+ memcpy(answer, (tgt ? KA_GETTGT_ANS_LABEL : KA_GETADM_ANS_LABEL), KA_LABELSIZE);
break;
case 1:
case 2:
temp = pwexpires << 24; /* move it into the high byte */
pwexpires = htonl(temp);
- bcopy (&pwexpires, (char * )oanswer->SeqBody + oanswer->SeqLen, sizeof(afs_int32));
+ memcpy((char * )oanswer->SeqBody + oanswer->SeqLen, &pwexpires, sizeof(afs_int32));
oanswer->SeqLen += sizeof(afs_int32);
oanswer->SeqLen = round_up_to_ebs(oanswer->SeqLen);
if (oanswer->SeqLen > oanswer->MaxSeqLen) {
if (newvals[REUSEFLAGS]) {
if (newvals[REUSEFLAGS] & KA_REUSEPW)
- bzero(tentry.pwsums, KA_NPWSUMS);
+ memset(tentry.pwsums, 0, KA_NPWSUMS);
else if ((newvals[REUSEFLAGS] & KA_NOREUSEPW) && !tentry.pwsums[0])
tentry.pwsums[0] = 0xff;
}
get_time (0,0,0); /* generate random update */
- bzero (aentry, sizeof(*aentry));
+ memset(aentry, 0, sizeof(*aentry));
aentry->minor_version = KAMINORVERSION;
aentry->flags = ntohl(tentry.flags);
aentry->user_expiration = ntohl(tentry.user_expiration);
rxkad_GetServerInfo(call->conn, &enc_level, 0, 0, 0, 0, 0);
if ((noAuthenticationRequired) ||
(callerIsAdmin && enc_level == rxkad_crypt))
- bcopy (&tentry.key, &aentry->key, sizeof(struct ktc_encryptionKey));
- else bzero (&aentry->key, sizeof(aentry->key));
+ memcpy(&aentry->key, &tentry.key, sizeof(struct ktc_encryptionKey));
+ else memset(&aentry->key, 0, sizeof(aentry->key));
code = ka_KeyCheckSum ((char *)&tentry.key, &aentry->keyCheckSum);
if (!tentry.pwsums[0] && npwSums > 1 && !tentry.pwsums[1]) {
aentry->reserved3 = 0x12340000;
sizeof(struct ka_getTicketAnswer) - 5*MAXKTCNAMELEN) goto abort;
answer = (struct ka_getTicketAnswer *)oanswer->SeqBody;
- bcopy (&sessionKey, &answer->sessionKey,
- sizeof(struct ktc_encryptionKey));
+ memcpy(&answer->sessionKey, &sessionKey, sizeof(struct ktc_encryptionKey));
answer->startTime = htonl(times.start);
answer->endTime = htonl(end);
answer->kvno = server.key_version;
putstr (sname);
putstr (sinstance);
if (rem < ticketLen) goto abort;
- bcopy (ticket, ans, ticketLen);
+ memcpy(ans, ticket, ticketLen);
oanswer->SeqLen = (ans - oanswer->SeqBody) + ticketLen;
}
oanswer->SeqLen = round_up_to_ebs(oanswer->SeqLen);
}
*admin_accounts = ntohl(cheader.admin_accounts);
- /* bcopy ((char *)&cheader.stats, (char *)statics, sizeof(kasstats)); */
+ /* memcpy((char *)statics, (char *)&cheader.stats, sizeof(kasstats)); */
/* these are stored in network byte order and must be copied */
statics->allocs = ntohl(cheader.stats.allocs);
statics->frees = ntohl(cheader.stats.frees);
check that the statistics command copies all the fields
#endif
- bcopy ((char *)&dynamic_statistics, (char *)dynamics, sizeof(kadstats));
+ memcpy((char *)dynamics, (char *)&dynamic_statistics, sizeof(kadstats));
statics->minor_version = KAMINORVERSION;
dynamics->minor_version = KAMINORVERSION;
* ignore this for aix till v3.1... */
getrusage(RUSAGE_SELF, &ru);
#if (KAMAJORVERSION>5)
- bcopy (&ru.ru_utime, &dynamics->utime, sizeof(struct katimeval));
- bcopy (&ru.ru_stime, &dynamics->stime, sizeof(struct katimeval));
+ memcpy(&dynamics->utime, &ru.ru_utime, sizeof(struct katimeval));
+ memcpy(&dynamics->stime, &ru.ru_stime, sizeof(struct katimeval));
dynamics->dataSize = ru.ru_idrss;
dynamics->stackSize = ru.ru_isrss;
dynamics->pageFailts = ru.ru_majflt;
return code;
}
- bcopy (&tentry.key, password, sizeof (*password));
+ memcpy(password, &tentry.key, sizeof (*password));
code = ubik_EndTrans (tt);
#endif
return code;
if (sizeof(struct ka_cpwRequest) % 8) return KAINTERNALERROR;
if (version != KAMAJORVERSION) return KAOLDINTERFACE;
- bzero (info, sizeof(*info));
+ memset(info, 0, sizeof(*info));
info->minorVersion = KAMINORVERSION;
info->host = dynamic_statistics.host;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kaserver.c,v 1.1.1.6 2001/07/14 22:22:12 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kaserver.c,v 1.1.1.7 2001/09/11 14:32:56 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
static void initialize_dstats ()
{
- bzero (&dynamic_statistics, sizeof(dynamic_statistics));
+ memset(&dynamic_statistics, 0, sizeof(dynamic_statistics));
dynamic_statistics.start_time = time(0);
dynamic_statistics.host = myHost;
}
ViceLog(0, ("kaserver: couldn't get address of this host.\n"));
exit(1);
}
- bcopy(th->h_addr,myHost,sizeof(afs_int32));
+ memcpy(myHost, th->h_addr, sizeof(afs_int32));
for (i=0; i<cellinfo->numServers; i++)
if (cellinfo->hostAddr[i].sin_addr.s_addr != *myHost) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kautils.c,v 1.1.1.5 2001/07/14 22:22:13 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kautils.c,v 1.1.1.6 2001/09/11 14:32:57 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
afs_int32 code;
*cksumP = 0;
- bzero (block, 8);
+ memset(block, 0, 8);
code = des_key_sched (key, s);
if (code) return KABADKEY;
des_ecb_encrypt (block, block, s, ENCRYPT);
- bcopy (block, &cksum, sizeof(afs_int32));
+ memcpy(&cksum, block, sizeof(afs_int32));
*cksumP = ntohl(cksum);
return 0;
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kdb.c,v 1.1.1.4 2001/07/14 22:22:13 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kdb.c,v 1.1.1.5 2001/09/11 14:32:58 hartmans Exp $");
#include <fcntl.h>
#include <sys/types.h>
fprintf(stderr, "%s: data came out corrupt\n", ti->data);
continue;
}
- bcopy(data.dptr, &rdata, sizeof(kalog_elt));
+ memcpy(&rdata, data.dptr, sizeof(kalog_elt));
printf("%s: last operation from host %x at %s", ti->data, rdata.host,
ctime(&rdata.last_use));
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kkids.c,v 1.1.1.4 2001/07/14 22:22:13 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kkids.c,v 1.1.1.5 2001/09/11 14:32:58 hartmans Exp $");
#include <stdio.h>
#include <sys/types.h>
* name (we know there is one) and splice in the symlink contents.
*/
if (true_name[0] != '/') {
- last_component = (char *) rindex(orig_name, '/');
+ last_component = (char *) strrchr(orig_name, '/');
strcpy(++last_component, true_name);
strcpy(true_name, orig_name);
}
simplify_name(orig_name, truename);
}
else {
- bp = (char *) rindex(arg, '/');
+ bp = (char *) strrchr(arg, '/');
if (bp) {
orig_name[0] = '.';
orig_name[1] = '/';
/*
* Find rightmost slash, if any.
*/
- bp = (char *) rindex(truename, '/');
+ bp = (char *) strrchr(truename, '/');
if (bp) {
/*
* Found it. Designate everything before it as the parent directory,
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/klog.c,v 1.1.1.4 2001/07/14 22:22:14 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/klog.c,v 1.1.1.5 2001/09/11 14:32:58 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
static char gpbuf[BUFSIZ];
/* read a password from stdin, stop on \n or eof */
register int i, tc;
- bzero(gpbuf, sizeof(gpbuf));
+ memset(gpbuf, 0, sizeof(gpbuf));
for(i=0; i<(sizeof(gpbuf)-1); i++) {
tc = fgetc(stdin);
if (tc == '\n' || tc == EOF) break;
char *reason; /* string describing errors */
/* blow away command line arguments */
- for (i=1; i<zero_argc; i++) bzero (zero_argv[i], strlen(zero_argv[i]));
+ for (i=1; i<zero_argc; i++) memset(zero_argv[i], 0, strlen(zero_argv[i]));
zero_argc = 0;
/* first determine quiet flag based on -silent switch */
*/
foundPassword = 1;
strncpy (passwd, as->parms[aPASSWORD].items->data, sizeof(passwd));
- bzero (as->parms[aPASSWORD].items->data,
- strlen(as->parms[aPASSWORD].items->data));
+ memset(as->parms[aPASSWORD].items->data, 0, strlen(as->parms[aPASSWORD].items->data));
}
if (as->parms[aLIFETIME].items) {
code = ka_UserAuthenticateGeneral (KA_USERAUTH_VERSION + (dosetpag ? KA_USERAUTH_DOSETPAG2:0), pw->pw_name,
instance, realm, passwd, lifetime, &password_expires, 0, &reason);
- bzero (passwd, sizeof(passwd));
+ memset(passwd, 0, sizeof(passwd));
if (code) {
if (!Silent) {
fprintf (stderr,
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/klogin.c,v 1.1.1.5 2001/07/14 22:22:14 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/klogin.c,v 1.1.1.6 2001/09/11 14:32:58 hartmans Exp $");
#if !defined(AFS_SUN_ENV) && !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) &&!defined(AFS_FBSD_ENV)
#include <sys/param.h>
char term[64];
struct passwd *pwd;
-char *strcat(), *rindex(), *index(), *malloc(), *realloc();
+char *strcat(), *malloc(), *realloc();
static void timedout(void);
static void showmotd(void);
static void doremoteterm(char *term, struct sgttyb *tp);
quota(Q_SETUID, 0, 0, 0);
/* create a dummy user */
- bzero (&nouser, sizeof(nouser));
+ memset(&nouser, 0, sizeof(nouser));
nouser.pw_name = "";
nouser.pw_passwd = "*";
nouser.pw_dir = nouser.pw_shell = "";
ttyn = ttyname(0);
if (ttyn == (char *)0 || *ttyn == '\0')
ttyn = "/dev/tty??";
- tty = rindex(ttyn, '/');
+ tty = strrchr(ttyn, '/');
if (tty == NULL)
tty = ttyn;
else
setenv("USER=", pwd->pw_name, 1);
setenv("PATH=", ":/usr/ucb:/bin:/usr/bin", 0);
- if ((namep = rindex(pwd->pw_shell, '/')) == NULL)
+ if ((namep = strrchr(pwd->pw_shell, '/')) == NULL)
namep = pwd->pw_shell;
else
namep++;
char *term,
struct sgttyb *tp)
{
- register char *cp = index(term, '/'), **cpp;
+ register char *cp = strchr(term, '/'), **cpp;
char *speed;
if (cp) {
*cp++ = '\0';
speed = cp;
- cp = index(speed, '/');
+ cp = strchr(speed, '/');
if (cp)
*cp++ = '\0';
for (cpp = speeds; cpp < &speeds[NSPEEDS]; cpp++)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/knfs.c,v 1.1.1.4 2001/07/14 22:22:15 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/knfs.c,v 1.1.1.5 2001/09/11 14:33:00 hartmans Exp $");
#include <stdio.h>
#include <afs/stds.h>
#include <netdb.h>
#include <errno.h>
#include <sys/ioctl.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
#include <afs/vice.h>
#include <afs/cmd.h>
#include <afs/auth.h>
pheader[5] = 1; /* NFS protocol exporter # */
/* copy stuff in */
- bcopy(pheader, space, sizeof(pheader));
+ memcpy(space, pheader, sizeof(pheader));
tp = space + sizeof(pheader);
/* finally setup the pioctl call's parameters */
blob.in = space;
blob.out_size = 0;
blob.out = (char *) 0;
- bcopy(&setp, tp, sizeof(afs_int32));
+ memcpy(tp, &setp, sizeof(afs_int32));
tp += sizeof(afs_int32);
strcpy(tp, sysname);
blob.in_size += sizeof(afs_int32) + strlen(sysname) + 1;
if (strcmp(clientName.name, "afs") != 0) continue; /* wrong ticket service */
/* copy stuff in */
- bcopy(pheader, tbuffer, sizeof(pheader));
+ memcpy(tbuffer, pheader, sizeof(pheader));
tp = tbuffer + sizeof(pheader);
- bcopy(&index, tp, sizeof(afs_int32));
+ memcpy(tp, &index, sizeof(afs_int32));
tp += sizeof(afs_int32);
iob.in = tbuffer;
iob.in_size = sizeof(afs_int32) + sizeof(pheader);
else if (code == 0) {
/* check to see if this is the right cell/realm */
tp = tbuffer;
- bcopy(tp, &temp, sizeof(afs_int32)); /* get size of secret token */
+ memcpy(&temp, tp, sizeof(afs_int32)); /* get size of secret token */
tktLen = temp; /* remember size of ticket */
tp += sizeof(afs_int32);
stp = tp; /* remember where ticket is, for later */
tp += temp; /* skip ticket for now */
- bcopy(tp, &temp, sizeof(afs_int32)); /* get size of clear token */
+ memcpy(&temp, tp, sizeof(afs_int32)); /* get size of clear token */
if (temp != sizeof(struct ClearToken)) return KTC_ERROR;
tp += sizeof(afs_int32); /* skip length */
- bcopy(tp, &ct, temp); /* copy token for later use */
+ memcpy(&ct, tp, temp); /* copy token for later use */
tp += temp; /* skip clear token itself */
tp += sizeof(afs_int32); /* skip primary flag */
/* tp now points to the cell name */
gotit = 1;
maxLen = sizeof(token) - sizeof(struct ktc_token) + MAXKTCTICKETLEN;
if (maxLen < tktLen) return KTC_TOOBIG;
- bcopy(stp, token.ticket, tktLen);
+ memcpy(token.ticket, stp, tktLen);
token.startTime = ct.BeginTimestamp;
token.endTime = ct.EndTimestamp;
if (ct.AuthHandle == -1) ct.AuthHandle = 999;
token.kvno = ct.AuthHandle;
- bcopy(ct.HandShakeKey, &token.sessionKey, sizeof(struct ktc_encryptionKey));
+ memcpy(&token.sessionKey, ct.HandShakeKey, sizeof(struct ktc_encryptionKey));
token.ticketLen = tktLen;
if ((token.kvno == 999) || /* old style bcrypt ticket */
(ct.BeginTimestamp && /* new w/ prserver lookup */
pheader[5] = 1; /* NFS protocol exporter # */
/* copy stuff in */
- bcopy(pheader, space, sizeof(pheader));
+ memcpy(space, pheader, sizeof(pheader));
/* finally setup the pioctl call's parameters */
blob.in_size = sizeof(pheader);
pheader[5] = 1; /* NFS protocol exporter # */
/* copy in the header */
- bcopy(pheader, space, sizeof(pheader));
+ memcpy(space, pheader, sizeof(pheader));
tp = space + sizeof(pheader);
/* copy in the size of the encrypted part */
- bcopy(&theTicket.ticketLen, tp, sizeof(afs_int32));
+ memcpy(tp, &theTicket.ticketLen, sizeof(afs_int32));
tp += sizeof(afs_int32);
/* copy in the ticket itself */
- bcopy(theTicket.ticket, tp, theTicket.ticketLen);
+ memcpy(tp, theTicket.ticket, theTicket.ticketLen);
tp += theTicket.ticketLen;
/* copy in "clear token"'s size */
temp = sizeof(struct ClearToken);
- bcopy(&temp, tp, sizeof(afs_int32));
+ memcpy(tp, &temp, sizeof(afs_int32));
tp += sizeof(afs_int32);
/* create the clear token and copy *it* in */
ct.AuthHandle = theTicket.kvno; /* where we hide the key version # */
- bcopy(&theTicket.sessionKey, ct.HandShakeKey, sizeof(ct.HandShakeKey));
+ memcpy(ct.HandShakeKey, &theTicket.sessionKey, sizeof(ct.HandShakeKey));
ct.ViceId = auid;
ct.BeginTimestamp = theTicket.startTime;
ct.EndTimestamp = theTicket.endTime;
- bcopy(&ct, tp, sizeof(ct));
+ memcpy(tp, &ct, sizeof(ct));
tp += sizeof(ct);
/* copy in obsolete primary flag */
temp = 0;
- bcopy(&temp, tp, sizeof(afs_int32));
+ memcpy(tp, &temp, sizeof(afs_int32));
tp += sizeof(afs_int32);
/* copy in cell name, null terminated */
strcpy(tp, server.cell);
printf("knfs: unknown host '%s'.\n", tp);
return -1;
}
- bcopy(the->h_addr, &addr, sizeof(afs_int32));
+ memcpy(&addr, the->h_addr, sizeof(afs_int32));
uid = -1;
if (as->parms[1].items) {
code = util_GetInt32(tp = as->parms[1].items->data, &uid);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kpasswd.c,v 1.1.1.5 2001/07/14 22:22:15 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kpasswd.c,v 1.1.1.6 2001/09/11 14:33:00 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
{
/* read a password from stdin, stop on \n or eof */
register int i, tc;
- bzero(gpbuf, len);
+ memset(gpbuf, 0, len);
for(i=0;i<len;i++) {
tc = fgetc(stdin);
if (tc == '\n' || tc == EOF) break;
#endif
/* blow away command line arguments */
- for (i=1; i<zero_argc; i++) bzero (zero_argv[i], strlen(zero_argv[i]));
+ for (i=1; i<zero_argc; i++) memset(zero_argv[i], 0, strlen(zero_argv[i]));
zero_argc = 0;
/* first determine quiet flag based on -pipe switch */
*/
foundPassword = 1;
strncpy (passwd, as->parms[aPASSWORD].items->data, sizeof(passwd));
- bzero (as->parms[aPASSWORD].items->data,
- strlen(as->parms[aPASSWORD].items->data));
+ memset(as->parms[aPASSWORD].items->data, 0, strlen(as->parms[aPASSWORD].items->data));
}
if (as->parms[aNEWPASSWORD].items) {
foundNewPassword = 1;
strncpy (npasswd, as->parms[aNEWPASSWORD].items->data,
sizeof(npasswd));
- bzero (as->parms[aNEWPASSWORD].items->data,
- strlen(as->parms[aNEWPASSWORD].items->data));
+ memset(as->parms[aNEWPASSWORD].items->data, 0, strlen(as->parms[aNEWPASSWORD].items->data));
}
if (!foundExplicitCell) strcpy (realm, lcell);
code = read_pass (passwd, sizeof(passwd), "Old password: ", 0);
if (code || (strlen (passwd) == 0)) {
if (code) code = KAREADPW;
- bzero (&mitkey, sizeof(mitkey));
- bzero (&key, sizeof(key));
- bzero (passwd, sizeof(passwd));
+ memset(&mitkey, 0, sizeof(mitkey));
+ memset(&key, 0, sizeof(key));
+ memset(passwd, 0, sizeof(passwd));
if (code) com_err (rn, code, "reading password");
exit (1);
}
printf ("Mismatch - ");
goto no_change;
}
- bzero (verify, sizeof(verify));
+ memset(verify, 0, sizeof(verify));
}
}
if (code = password_bad (npasswd)) { /* assmt here! */
#endif
ka_StringToKey (npasswd, realm, &newkey);
des_string_to_key(npasswd, &newmitkey);
- bzero (npasswd, sizeof(npasswd));
+ memset(npasswd, 0, sizeof(npasswd));
if (lexplicit) ka_ExplicitCell (realm, serverList);
strncpy (pass8, passwd, 8);
pass8[8] = 0;
ka_StringToKey (pass8, realm, &key);
- bzero (pass8, sizeof(pass8));
- bzero (passwd, sizeof(passwd));
+ memset(pass8, 0, sizeof(pass8));
+ memset(passwd, 0, sizeof(passwd));
code = ka_GetAdminToken (pw->pw_name, instance, realm,
&key, ADMIN_LIFETIME, &token, /*!new*/0);
#ifdef notdef
dess2k=0;
}
- bzero (&mitkey, sizeof(mitkey));
- bzero (&key, sizeof(key));
+ memset(&mitkey, 0, sizeof(mitkey));
+ memset(&key, 0, sizeof(key));
if (code == KAUBIKCALL) com_err (rn, code, "(Authentication Server unavailable, try later)");
else if (code) {
if (code == KABADREQUEST)
code = ka_ChangePassword (pw->pw_name, instance, conn, 0, &newmitkey);
else
code = ka_ChangePassword (pw->pw_name, instance, conn, 0, &newkey);
- bzero (&newkey, sizeof(newkey));
- bzero (&newmitkey, sizeof(newmitkey));
+ memset(&newkey, 0, sizeof(newkey));
+ memset(&newmitkey, 0, sizeof(newmitkey));
if (code) {
char * reason;
reason = (char *) error_message(code);
else printf("Password changed.\n\n");
}
}
- bzero (&newkey, sizeof(newkey));
- bzero (&newmitkey, sizeof(newmitkey));
+ memset(&newkey, 0, sizeof(newkey));
+ memset(&newmitkey, 0, sizeof(newmitkey));
/* Might need to close down the ubik_Client connection */
if (conn) {
no_change: /* yuck, yuck, yuck */
if (code) com_err (rn, code, "getting new password");
no_change_no_msg:
- bzero (&key, sizeof(key));
- bzero (npasswd, sizeof(npasswd));
+ memset(&key, 0, sizeof(key));
+ memset(npasswd, 0, sizeof(npasswd));
printf("Password for '%s' in cell '%s' unchanged.\n\n", pw->pw_name, cell);
terminate_child();
exit (code ? code : 1);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/krb_udp.c,v 1.1.1.8 2001/07/14 22:22:16 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/krb_udp.c,v 1.1.1.9 2001/09/11 14:33:00 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
#define putstr(name) if ((slen = strlen(name)) >= MAXKTCNAMELEN) return -1;\
else strcpy (answer, name), answer += slen+1
#define putint(num) num = htonl(num), \
- bcopy (&num, answer, sizeof(afs_int32)), \
+ memcpy(answer, &num, sizeof(afs_int32)), \
answer += sizeof(afs_int32)
#define getstr(name) if ((slen = strlen(packet)) >= sizeof(name)) return -1;\
strcpy (name, packet), packet += slen+1
-#define getint(num) bcopy (packet, &num, sizeof(afs_int32)), \
+#define getint(num) memcpy(&num, packet, sizeof(afs_int32)), \
num = ktohl (byteOrder, num), \
packet += sizeof(afs_int32)
if (ticketLen > 255) return KAANSWERTOOLONG;
if (kvno > 255) return KAANSWERTOOLONG;
- bcopy (sessionKey, answer, sizeof(*sessionKey));
+ memcpy(answer, sessionKey, sizeof(*sessionKey));
answer += sizeof(*sessionKey);
putstr (sname);
putstr (sinst);
*answer++ = life;
*answer++ = (unsigned char) kvno;
*answer++ = (unsigned char) ticketLen;
- bcopy (ticket, answer, ticketLen);
+ memcpy(answer, ticket, ticketLen);
answer += ticketLen;
putint (start);
*answer++ = (unsigned char) kvno;
{ short w = (short) cipherLen;
w = htons(w);
- bcopy (&w, answer, sizeof(short));
+ memcpy(answer, &w, sizeof(short));
answer += sizeof(short);
}
- bcopy (cipher, answer, cipherLen);
+ memcpy(answer, cipher, cipherLen);
return 0;
}
startTime + ntohl(tentry.max_ticket_lifetime));
if ((code = ka_LookupKey (tt, sname, sinst, &tgskvno, &tgskey)) ||
(code = tkt_MakeTicket (ticket, &ticketLen, &tgskey,
- name, inst, "",
+ name, inst, lrealm,
startTime, endTime, &sessionKey,
htonl(client->sin_addr.s_addr), sname, sinst)))
goto abort;
code = -1;
goto fail;
}
+ KALOG(name, inst, sname, sinst, NULL, client->sin_addr.s_addr, LOG_AUTHENTICATE);
osi_audit ( UDPAuthenticateEvent, 0, AUD_STR, name, AUD_STR, inst, AUD_END);
return 0;
"null realm name not allowed");
return;
}
- bcopy (packet, &startTime, sizeof(startTime));
+ memcpy(&startTime, packet, sizeof(startTime));
packet += sizeof(startTime);
startTime = ktohl (pkt->byteOrder, startTime);
pkt->time = startTime;
err_packet (ksoc, pkt, KERB_ERR_TEXT_LENGTH, "ticket too long");
return;
}
- bcopy (packet, ticket, ticketLen);
+ memcpy(ticket, packet, ticketLen);
packet += ticketLen;
if (authLen > sizeof(auth)) {
err_packet (ksoc, pkt, KERB_ERR_TEXT_LENGTH, "authenticator too long");
return;
}
- bcopy (packet, auth, authLen);
+ memcpy(auth, packet, authLen);
pkt->rest = packet + authLen;
code = UDP_GetTicket (ksoc, pkt, kvno, realm, ticket, ticketLen, auth, authLen);
if (code) {
if (inited) return -1;
inited = 1;
- bzero (&taddr, sizeof(taddr));
+ memset(&taddr, 0, sizeof(taddr));
krb4name = "kerberos4";
sp = getservbyname(krb4name, "udp");
taddr.sin_family = AF_INET; /* added for NCR port */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/manyklog.c,v 1.1.1.4 2001/07/14 22:22:16 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/manyklog.c,v 1.1.1.5 2001/09/11 14:33:01 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
static char gpbuf[BUFSIZ];
/* read a password from stdin, stop on \n or eof */
register int i, tc;
- bzero(gpbuf, sizeof(gpbuf));
+ memset(gpbuf, 0, sizeof(gpbuf));
for(i=0; i<(sizeof(gpbuf)-1); i++) {
tc = fgetc(stdin);
if (tc == '\n' || tc == EOF) break;
char *reason; /* string describing errors */
/* blow away command line arguments */
- for (i=1; i<zero_argc; i++) bzero (zero_argv[i], strlen(zero_argv[i]));
+ for (i=1; i<zero_argc; i++) memset(zero_argv[i], 0, strlen(zero_argv[i]));
zero_argc = 0;
/* first determine quiet flag based on -silent switch */
*/
foundPassword = 1;
strncpy (passwd, as->parms[aPASSWORD].items->data, sizeof(passwd));
- bzero (as->parms[aPASSWORD].items->data,
- strlen(as->parms[aPASSWORD].items->data));
+ memset(as->parms[aPASSWORD].items->data, 0, strlen(as->parms[aPASSWORD].items->data));
}
if (as->parms[aLIFETIME].items) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/read_passwd.c,v 1.1.1.3 2001/07/14 22:22:13 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/read_passwd.c,v 1.1.1.4 2001/09/11 14:33:01 hartmans Exp $");
#include <mit-cpyright.h>
#include <des.h>
string_to_key(key_string, k);
lose:
- bzero(key_string, sizeof (key_string));
+ memset(key_string, 0, sizeof (key_string));
return ok;
}
}
#ifdef BSDUNIX
- bcopy(env, old_env, sizeof(env));
+ memcpy(old_env, env, sizeof(env));
if (setjmp(env))
goto lose;
lose:
if (!ok)
- bzero(s, max);
+ memset(s, 0, max);
#ifdef BSDUNIX
/* turn echo back on */
tty_state.sg_flags |= ECHO;
if (ioctl(0,TIOCSETP,&tty_state))
ok = 0;
pop_signals();
- bcopy(old_env, env, sizeof(env));
+ memcpy(env, old_env, sizeof(env));
#else
#if defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV)
ttyb.c_lflag = flags;
#endif
#endif
if (verify)
- bzero(key_string, sizeof (key_string));
+ memset(key_string, 0, sizeof (key_string));
s[max-1] = 0; /* force termination */
return !ok; /* return nonzero if not okay */
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/rebuild.c,v 1.1.1.6 2001/07/14 22:22:17 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/rebuild.c,v 1.1.1.7 2001/09/11 14:33:02 hartmans Exp $");
#include <sys/types.h>
#include <sys/stat.h>
nentries = (info.st_size-(UBIK_HEADERSIZE + header.headerSize)) / sizeof(struct kaentry);
entrys = (int *)malloc(nentries * sizeof(int));
- bzero(entrys, nentries * sizeof(int));
+ memset(entrys, 0, nentries * sizeof(int));
for (i=0, index=sizeof(header); i<nentries; i++, index+=sizeof(struct kaentry)) {
readDB (index, &entry, sizeof(entry));
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/test/multiklog.c,v 1.1.1.4 2001/07/14 22:22:18 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/test/multiklog.c,v 1.1.1.5 2001/09/11 14:33:03 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
static char gpbuf[BUFSIZ];
/* read a password from stdin, stop on \n or eof */
register int i, tc;
- bzero(gpbuf, sizeof(gpbuf));
+ memset(gpbuf, 0, sizeof(gpbuf));
for(i=0; i<(sizeof(gpbuf)-1); i++) {
tc = fgetc(stdin);
if (tc == '\n' || tc == EOF) break;
char *reason; /* string describing errors */
/* blow away command line arguments */
- for (i=1; i<zero_argc; i++) bzero (zero_argv[i], strlen(zero_argv[i]));
+ for (i=1; i<zero_argc; i++) memset(zero_argv[i], 0, strlen(zero_argv[i]));
zero_argc = 0;
/* first determine quiet flag based on -silent switch */
*/
foundPassword = 1;
strncpy (passwd, as->parms[aPASSWORD].items->data, sizeof(passwd));
- bzero (as->parms[aPASSWORD].items->data,
- strlen(as->parms[aPASSWORD].items->data));
+ memset(as->parms[aPASSWORD].items->data, 0, strlen(as->parms[aPASSWORD].items->data));
}
if (as->parms[aLIFETIME].items) {
}
code = storecode;
- bzero (passwd, sizeof(passwd));
+ memset(passwd, 0, sizeof(passwd));
if (code) {
if (!Silent) {
fprintf (stderr,
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/test/test_badtix.c,v 1.1.1.4 2001/07/14 22:22:18 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/test/test_badtix.c,v 1.1.1.5 2001/09/11 14:33:03 hartmans Exp $");
#include <sys/types.h>
#include <des.h>
password[truncate[i]] = 0;
ka_StringToKey (password, "andy.edu", &key);
ka_ReadBytes (answer[i], &correct_key, sizeof(key));
- if (bcmp (&key, &correct_key, sizeof(key)) != 0) {
+ if (memcmp (&key, &correct_key, sizeof(key)) != 0) {
printf ("String to key error converting '%s'; should be '%s' instead got '",
password, answer[i]);
ka_PrintBytes (&key, sizeof(key));
exit (1);
}
}
- bzero (password, sizeof(password));
+ memset(password, 0, sizeof(password));
j=0; /* current password length */
for (i=(sizeof(truncate)/sizeof(int))-1; i>=0; i--) {
while (j<truncate[i]) {
}
ka_StringToKey (password, "andy.edu", &key);
ka_ReadBytes (answer[i], &correct_key, sizeof(key));
- if (bcmp (&key, &correct_key, sizeof(key)) != 0) {
+ if (memcmp (&key, &correct_key, sizeof(key)) != 0) {
printf ("String to key error converting '%s'; should be '%s' instead got '",
password, answer[i]);
ka_PrintBytes (&key, sizeof(key));
{ struct ktc_encryptionKey badkey;
- bcopy (&key, &badkey, sizeof(badkey));
+ memcpy(&badkey, &key, sizeof(badkey));
*(int *)&badkey ^= 1; /* toggle some bit */
code = ubik_Call (KAM_SetPassword, conn, 0, name, inst, 0, badkey);
if (code != KABADKEY) {
com_err (whoami, code, "Trying to set bad key");
exit(1);
}
- bzero (&badkey, sizeof(badkey));
+ memset(&badkey, 0, sizeof(badkey));
code = ubik_Call (KAM_SetPassword, conn, 0, name, inst, 0, badkey);
if (code != KABADKEY) goto abort_5;
code = ubik_Call (KAM_SetPassword, conn, 0, name, inst, 9999, key);
code = ubik_Call (KAM_GetEntry, conn, 0, name, inst, KAMAJORVERSION, &entry);
if (code) goto abort_3;
- if (bcmp (&tentry, &entry, sizeof(entry)) != 0) {
+ if (memcmp (&tentry, &entry, sizeof(entry)) != 0) {
printf ("Entries obtained not the same!\n");
print_entry (&entry, name, inst);
}
}
/* try bashing a ticket to make sure it fails to work */
- bzero (atoken.ticket+10, 1);
+ memset(atoken.ticket+10, 0, 1);
code = ka_AuthServerConn (localCell, KA_MAINTENANCE_SERVICE, &atoken, &conn);
if (code) {
com_err (whoami, code, "contacting admin server with bashed ticket");
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/test/test_getticket.c,v 1.1.1.4 2001/07/14 22:22:20 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/test/test_getticket.c,v 1.1.1.5 2001/09/11 14:33:04 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
if (as->parms[13].items) { /* if password specified */
strncpy (passwd, as->parms[13].items->data, sizeof(passwd));
- bzero (as->parms[13].items->data, strlen (as->parms[13].items->data));
+ memset(as->parms[13].items->data, 0, strlen (as->parms[13].items->data));
} else {
char msg[sizeof(name)+15];
if (as->parms[12].items) strcpy (msg, "Admin Password: ");
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/test/test_interim_ktc.c,v 1.1.1.4 2001/07/14 22:22:20 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/test/test_interim_ktc.c,v 1.1.1.5 2001/09/11 14:33:05 hartmans Exp $");
#include <afs/stds.h>
#include <afs/com_err.h>
/*Copy in the sizes and bodies of the secret and clear tokens*/
inbuff.sTokenSize = sizeof(EncryptedSecretToken);
- bcopy(&sToken, (char *)&inbuff.stoken, sizeof(EncryptedSecretToken));
+ memcpy((char *)&inbuff.stoken, &sToken, sizeof(EncryptedSecretToken));
inbuff.cTokenSize = sizeof(ClearToken);
- bcopy(&cToken, (char*)&inbuff.ctoken, sizeof(ClearToken));
+ memcpy((char*)&inbuff.ctoken, &cToken, sizeof(ClearToken));
/* Copy in the Primary ID flag and the cell name */
#if DB_CELLS
(token.startTime != 0) ||
(token.endTime != cToken.EndTimestamp) ||
(token.ticketLen != sizeof(sToken)) ||
- (bcmp (&cToken.HandShakeKey, &token.sessionKey, sizeof(struct ktc_encryptionKey)) != 0) ||
- (bcmp (&sToken, token.ticket, sizeof(sToken)) != 0)) {
+ (memcmp (&cToken.HandShakeKey, &token.sessionKey, sizeof(struct ktc_encryptionKey)) != 0) ||
+ (memcmp (&sToken, token.ticket, sizeof(sToken)) != 0)) {
fprintf (stdout, "Auth2 token was bad\n");
PrintAuthentication (stdout, server, &token, &client);
return 1;
blob.in_size = sizeof(long);
blob.in = space;
blob.out = space;
- bcopy(&i, space, sizeof(long));
+ memcpy(space, &i, sizeof(long));
code = pioctl(0, VIOCGETCELL, &blob, 1);
if (code < 0) {
if (errno == EDOM) break; /* done with the list */
if (verbose > 1) {
printf("Cell %s on hosts", cellname);
for (j=0; j < 8; j++) {
- bcopy(space + j*sizeof(long), &clear, sizeof(long));
+ memcpy(&clear, space + j*sizeof(long), sizeof(long));
if (clear == 0) break;
#if SLOW
tcp = hostutil_GetNameByINet(clear);
/* First check for various pathological cases */
strcpy (server.cell, "foo.bar.baz");
- bcopy (&token, &ntoken, sizeof(ntoken));
+ memcpy(&ntoken, &token, sizeof(ntoken));
code = ktc_SetToken (&server, &ntoken, &client, 0);
if (code != KTC_NOCELL) {
com_err (whoami, code, "should have gotten bad pioctl error calling SetToken with bogus cell name");
com_err (whoami, code, "calling SetToken with bogus client cell");
goto failed;
}
- bcopy (&token, &ntoken, sizeof(ntoken));
+ memcpy(&ntoken, &token, sizeof(ntoken));
if (token.kvno == 999) ntoken.kvno = 99;
/* Now check out SetToken parsing of specially formed names */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/test/test_rxkad_free.c,v 1.1.1.4 2001/07/14 22:22:21 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/test/test_rxkad_free.c,v 1.1.1.5 2001/09/11 14:33:05 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
if (as->parms[13].items) { /* if password specified */
strncpy (passwd, as->parms[13].items->data, sizeof(passwd));
- bzero (as->parms[13].items->data, strlen (as->parms[13].items->data));
+ memset(as->parms[13].items->data, 0, strlen (as->parms[13].items->data));
} else {
char msg[sizeof(name)+15];
if (as->parms[12].items) strcpy (msg, "Admin Password: ");
if (!doAuth) {
ka_StringToKey (passwd, cell, &key);
- bzero (passwd, sizeof(passwd));
+ memset(passwd, 0, sizeof(passwd));
}
if (hostUsage) {
- bzero (serversUse, sizeof(serversUse));
- bzero (serversHost, sizeof(serversHost));
+ memset(serversUse, 0, sizeof(serversUse));
+ memset(serversHost, 0, sizeof(serversHost));
}
startTime = time(0);
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/user.c,v 1.1.1.6 2001/07/14 22:22:17 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/user.c,v 1.1.1.7 2001/09/11 14:33:02 hartmans Exp $");
#if defined(UKERNEL)
#include "../afs/sysincludes.h"
struct ktc_token token;
code = ka_GetAuthToken (name, instance, realm, key, lifetime, pwexpires);
- bzero (key, sizeof(*key));
+ memset(key, 0, sizeof(*key));
if (code) return code;
code = ka_GetAFSTicket (name, instance, realm, lifetime, flags);
return code;
strncpy (pass8, password, 8);
pass8[8] = 0;
ka_StringToKey (pass8, realm, &key);
- bzero (pass8, sizeof(pass8));
+ memset(pass8, 0, sizeof(pass8));
code = GetTickets (name, instance, realm, &key, lifetime,
password_expires, dosetpag);
if (code == 0) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/user_nt.c,v 1.1.1.5 2001/07/14 22:22:17 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/user_nt.c,v 1.1.1.6 2001/09/11 14:33:02 hartmans Exp $");
#include <afs/stds.h>
return "server and client clocks are badly skewed";
case SKDC_RETRY:
return "Authentication Server was unavailable";
+ case RD_AP_TIME:
+ return "server and client clocks are badly skewed";
default:
sprintf(bogusReason, "unknown authentication error %d",
code);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/libacl/aclprocs.c,v 1.1.1.5 2001/07/14 22:22:21 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/libacl/aclprocs.c,v 1.1.1.6 2001/09/11 14:33:06 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
#else
#include <netinet/in.h>
#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
#include <rx/xdr.h>
#include <rx/rx.h>
#include <ptclient.h>
static int AddToList();
static int GetFromList();
-#ifdef AFS_ALPHA_ENV
-extern char *index();
-#endif
-
struct freeListEntry {
struct freeListEntry *next;
int size;
acl_NewExternalACL(acl->total, elist);
nextc = *elist;
lids.idlist_val = (afs_int32 *)malloc(ACL_MAXENTRIES *sizeof(afs_int32));
- bzero(lids.idlist_val, ACL_MAXENTRIES * sizeof(afs_int32));
+ memset(lids.idlist_val, 0, ACL_MAXENTRIES * sizeof(afs_int32));
lids.idlist_len = acl->total;
lnames.namelist_len = 0;
lnames.namelist_val = (prname *)0;
if (sscanf(nextc, "%s\t%d\n", lnames.namelist_val[i], &k) != 2)
return(-1);
(*acl)->entries[i].rights = k;
- nextc = (char *) (index(nextc, '\n'));
+ nextc = strchr(nextc, '\n');
nextc ++; /* 1 + index can cast ptr to integer */
}
j=i;
for (i = (*acl)->total - 1; i >= (*acl)->total - (*acl)->negative; i--,j++) {
if (sscanf(nextc, "%s\t%d\n", lnames.namelist_val[j], &((*acl)->entries[j].rights)) != 2)
return(-1);
- nextc = (char *) (index(nextc, '\n'));
+ nextc = strchr(nextc, '\n');
nextc ++;
}
lids.idlist_len = 0;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/bos/afs_bosAdmin.c,v 1.1.1.6 2001/07/14 22:22:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/bos/afs_bosAdmin.c,v 1.1.1.7 2001/09/11 14:33:08 hartmans Exp $");
#include <stdio.h>
#include <afs/stds.h>
restartTime.sec = time.sec;
restartTime.day = time.day;
- tst = BOZO_SetRestartTime(b_handle->server, restartType, restartTime);
+ tst = BOZO_SetRestartTime(b_handle->server, restartType, &restartTime);
if (tst == 0) {
rc = 1;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/client/afs_clientAdmin.c,v 1.1.1.6 2001/07/14 22:22:31 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/client/afs_clientAdmin.c,v 1.1.1.7 2001/09/11 14:33:12 hartmans Exp $");
#include <afs/stds.h>
#include "afs_clientAdmin.h"
int rc = 0;
strcpy(parentDirectory, directory);
- tp = rindex(parentDirectory, '/');
+ tp = strrchr(parentDirectory, '/');
if (tp) {
*tp = 0;
rc = 1;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/test/bos.c,v 1.1.1.4 2001/07/14 22:22:40 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/test/bos.c,v 1.1.1.5 2001/09/11 14:33:18 hartmans Exp $");
#include "bos.h"
register afs_int32 code;
struct ptemp *tp;
- bzero(ak, sizeof(*ak));
+ memset(ak, 0, sizeof(*ak));
code = LocalParseLine(adate, &tt);
if (code) return -1;
for(;tt;tt=tt->next) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/vos/afs_vosAdmin.c,v 1.1.1.5 2001/07/14 22:22:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/vos/afs_vosAdmin.c,v 1.1.1.6 2001/09/11 14:33:21 hartmans Exp $");
#include <afs/stds.h>
#include <stdio.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#include <ctype.h>
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/vos/lockprocs.c,v 1.1.1.5 2001/07/14 22:22:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/vos/lockprocs.c,v 1.1.1.6 2001/09/11 14:33:22 hartmans Exp $");
#include "lockprocs.h"
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/vos/vosutils.c,v 1.1.1.5 2001/07/14 22:22:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/vos/vosutils.c,v 1.1.1.6 2001/09/11 14:33:23 hartmans Exp $");
#include "vosutils.h"
#include "vsprocs.h"
#include "lockprocs.h"
#include <afs/afs_AdminErrors.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
int rc = 0;
afs_status_t tst = 0;
- bzero(dest, sizeof(struct nvldbentry));
+ memset(dest, 0, sizeof(struct nvldbentry));
strncpy(dest->name, source->name, sizeof(dest->name));
for (i = 0; i < source->nServers; i++) {
dest->serverNumber[i] = source->serverNumber[i];
afs_status_t tst = 0;
int rc = 0;
- bzero(dest, sizeof(struct vldbentry));
+ memset(dest, 0, sizeof(struct vldbentry));
strncpy(dest->name, source->name, sizeof(dest->name));
if (source->nServers <= OMAXNSERVERS) {
for (i = 0; i < source->nServers; i++) {
goto fail_VLDB_IsSameAddrs;
}
- bzero(&attrs, sizeof(attrs));
+ memset(&attrs, 0, sizeof(attrs));
attrs.Mask = VLADDR_IPADDR;
attrs.ipaddr = serv1;
- bzero(&addrs, sizeof(addrs));
- bzero(&uuid, sizeof(uuid));
+ memset(&addrs, 0, sizeof(addrs));
+ memset(&uuid, 0, sizeof(uuid));
tst = ubik_Call(VL_GetAddrsU, cellHandle->vos, 0, &attrs, &uuid,
&unique, &nentries, &addrs);
if (tst) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/vos/vsprocs.c,v 1.1.1.5 2001/07/14 22:22:45 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/vos/vsprocs.c,v 1.1.1.6 2001/09/11 14:33:23 hartmans Exp $");
#include "vsprocs.h"
#include "vosutils.h"
#include "../adminutil/afs_AdminInternal.h"
#include <afs/afs_AdminErrors.h>
#include "afs_vosAdmin.h"
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#ifdef HAVE_UNISTD_H
int releasecount = 0;
struct volser_status volstatus;
- bzero((char *)remembertime, sizeof(remembertime));
- bzero((char *)&results, sizeof(results));
+ memset((char *)remembertime, 0, sizeof(remembertime));
+ memset((char *)&results, 0, sizeof(results));
tst = ubik_Call(VL_SetLock, cellHandle->vos, 0, afromvol, RWVOL, VLOP_RELEASE);
if ((tst) && (tst != VL_RERELEASE)) {
strcpy(vname, entry.name);
strcat(vname, ".readonly");
- bzero(&cookie,sizeof(cookie));
+ memset(&cookie, 0, sizeof(cookie));
strncpy(cookie.name, vname, VOLSER_OLDMAXVOLNAME);
cookie.type = ROVOL;
cookie.parent = entry.volumeId[RWVOL];
goto fail_UV_ReleaseVolume;
}
- bzero (replicas, (sizeof(struct replica)*nservers+1));
- bzero (times, (sizeof(struct release)*nservers+1));
- bzero (toconns, (sizeof(struct rx_connection *)*nservers+1));
- bzero (results.manyResults_val, (sizeof(afs_int32)*nservers+1));
+ memset(replicas, 0, (sizeof(struct replica)*nservers+1));
+ memset(times, 0, (sizeof(struct release)*nservers+1));
+ memset(toconns, 0, (sizeof(struct rx_connection *)*nservers+1));
+ memset(results.manyResults_val, 0, (sizeof(afs_int32)*nservers+1));
/* Create a transaction on the cloned volume */
tst = AFSVolTransCreate(fromconn, cloneVolId, afrompart, ITBusy, &fromtid);
int index, same;
- bzero(&cookie,sizeof(cookie));
+ memset(&cookie, 0, sizeof(cookie));
islocked = 0;
success = 0;
error = 0;
}
else if(tst && (tst == VL_NOENT)) { /*entry doesnot exist */
/*set up a vldb entry for elem */
- bzero(&entry, sizeof(entry));
+ memset(&entry, 0, sizeof(entry));
strncpy(entry.name,elem.name,VOLSER_OLDMAXVOLNAME);
if(elem.isValid[RWVOL]) { /*rw exists */
entry.flags |= RW_EXISTS;
for(si = 0;si != -1; si=nsi) {
/*initialize to hint the stub to alloc space */
- bzero(&arrayEntries, sizeof(arrayEntries));
+ memset(&arrayEntries, 0, sizeof(arrayEntries));
if (!VLDB_ListAttributes(cellHandle, &attributes, &nentries,
&arrayEntries, &tst)) {
goto fail_UV_SyncServer;
# MakefileProto for AIX systems
#
-
-DESTDIR=DEST/
-include ../config/Makefile.${SYS_NAME}
+DEST=@DEST@
+TOP_INCDIR=@TOP_INCDIR@
+TOP_LIBDIR=@TOP_LIBDIR@
+TOP_SRCDIR=@TOP_SRCDIR@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+sbindir=@sbindir@
+libexecdir=@libexecdir@
+libdir=@libdir@
+includedir=@includedir@
+mandir=@mandir@
+afssrvbindir=@afssrvbindir@
+afssrvsbindir=@afssrvsbindir@
+afssrvlibexecdir=@afssrvlibexecdir@
+afskerneldir=@afskerneldir@
+SYS_NAME=@AFS_SYSNAME@
+
+include config/Makefile.${SYS_NAME}
# OS specific object files:
AFS_OS_OBJS = \
osi_timeout.o \
osi_vm.o \
xdr.o \
- xdr_array.o
+ xdr_array.o \
+ xdr_int64.o
AFSNOIAUTHOBJS = \
afs_call.o \
IMPORTS = -bI:/lib/kernex.exp -bI:/lib/syscalls.exp -bI:/lib/sockets.exp \
-bI:/lib/netinet.exp \
- -bI:${DESTDIR}lib/afs/extras.exp -bI:${DESTDIR}lib/afs/export.exp
+ -bI:${TOP_LIBDIR}/extras.exp -bI:${TOP_LIBDIR}/export.exp
KDEFS = -U_IBMR2 -D_POWER -D_AIX -DNLS -D_NLS -DMSG -D__STR31__ -Daiws \
-D_POWER_RS -D_POWER_PC -D_POWER_RS1 -D_POWER_RS2 -D_POWER_RSC \
-D_POWER_601 -D_POWER_603 -D_POWER_604 -D_THREADS -M -D_KERNEL \
-DGETMOUNT -H8 -DAFS -DAFS_COMMON -D_VOPS -D_SUN -DKERNEL
LDSTUFF= -b"binder:/usr/lib/bind glink:/usr/lib/glink.o" -bnoentry -b h:4 \
-D0 -T512
-LDFLAGS = -m -eafs_config -bexport:${DESTDIR}/lib/afs/afs.exp ${IMPORTS} \
+LDFLAGS = -m -eafs_config -bexport:${TOP_LIBDIR}/afs.exp ${IMPORTS} \
-lsys -lcsys
CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(KDEFS) $(KOPTS) ${DBUG}
# This tells Makefile.common to use it's single directory build target.
COMPDIRS = single_compdir
+INSTDIRS = single_instdir
+DESTDIRS = single_destdir
include Makefile.common
setup:
-mkdir $(KOBJ)
- -rm $(KOBJ)/Makefile $(KOBJ)/Makefile.common
+ -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common $(KOBJ)/config
ln -s ../Makefile $(KOBJ)/Makefile
ln -s ../Makefile.common $(KOBJ)/Makefile.common
- -rm -f h net netinet rpc ufs nfs machine sys
+ ln -s ../config $(KOBJ)/config
+ -$(RM) -f h net netinet rpc ufs nfs machine sys
ln -s /usr/include/sys h
ln -s /usr/include/net net
ln -s /usr/include/netinet netinet
ln -s /usr/include/jfs ufs
-
-
-
# Standard AFS->NFS translator support is removed in AFS 3.5 in favor of
# the iauth authentication mechanism. The model was changed by IBM in the
# middle of an OS release. So iauth is only supported on AIX 4.1.5 and
# later 4.1.x (if they are ever made) and AIX 4.2.1 (and later AIX 4.2.x if
# they are ever made. AIX 4.3 also uses the iauth translator.
-CLIENTDIR = $(DESTDIR)root.client/usr/vice/etc/dkload
LIBAFSIAUTH = afs.ext.iauth
LIBAFS = afs.ext
-DEST_LIBAFSIAUTH = $(CLIENTDIR)/$(LIBAFSIAUTH)
-DEST_LIBAFS = $(CLIENTDIR)/$(LIBAFS)
+DEST_LIBAFSIAUTH = $(DEST)/root.client/usr/vice/etc/dkload/$(LIBAFSIAUTH)
+DEST_LIBAFS = $(DEST)/root.client/usr/vice/etc/dkload/$(LIBAFS)
+
+INST_LIBAFSIAUTH = ${DESTDIR}${afskerneldir}/$(LIBAFSIAUTH)
+INST_LIBAFS = ${DESTDIR}${afskerneldir}/$(LIBAFS)
$(DEST_LIBAFS): $(LIBAFS)
$(INSTALL) -f $? $@
-${STRIP} $@
$(INSTALL) -f $?.map $@.map
+$(INST_LIBAFS): $(LIBAFS)
+ $(INSTALL) -f $? $@
+ -${STRIP} $@
+ $(INSTALL) -f $?.map $@.map
+
+$(INST_LIBAFSIAUTH): $(LIBAFSIAUTH)
+ $(INSTALL) -f $? $@
+ -${STRIP} $@
+ $(INSTALL) -f $?.map $@.map
$(LIBAFSIAUTH): $(AFSAOBJS) $(AFSIAUTHOBJS)
- ${LD} ${LDSTUFF} -bloadmap:afs.ext.iauth.loadmap \
+ ${LD} ${LDSTUFF} -bloadmap:afs.ext.iauth.loadmap \
-bmap:afs.ext.iauth.map -o afs.ext.iauth \
${AFSAOBJS} ${AFSIAUTHOBJS} ${LIBS} ${LDFLAGS}
$(LIBAFS): $(AFSAOBJS) $(AFSNOIAUTHOBJS)
- ${LD} ${LDSTUFF} -bloadmap:afs.ext.loadmap \
+ ${LD} ${LDSTUFF} -bloadmap:afs.ext.loadmap \
-bmap:afs.ext.map -o afs.ext \
${AFSAOBJS} $(AFSNOIAUTHOBJS) ${LIBS} ${LDFLAGS}
-libafs: $(DEST_LIBAFS) $(DEST_LIBAFSIAUTH)
+libafs: $(LIBAFS) $(LIBAFSIAUTH)
+install_libafs: $(INST_LIBAFS) $(INST_LIBAFSIAUTH)
+dest_libafs: $(DEST_LIBAFS) $(DEST_LIBAFSIAUTH)
# Object build rules:
# Common objects
xdr.o: $(RX)/xdr.c
- $(CRULE1);
+ $(CRULE1)
xdr_int64.o: $(RX)/xdr_int64.c
- $(CRULE1);
+ $(CRULE1)
xdr_array.o: $(RX)/xdr_array.c
- $(CRULE1);
+ $(CRULE1)
osi_assem.o: ${AFS}/osi_assem.s
${AS} -o osi_assem.o ${AFS}/osi_assem.s
osi_config.o: $(AFS)/osi_config.c
- $(CRULE1);
+ $(CRULE1)
osi_groups.o: $(AFS)/osi_groups.c
- $(CRULE1);
+ $(CRULE1)
osi_file.o: $(AFS)/osi_file.c
- $(CRULE1);
+ $(CRULE1)
osi_inode.o: $(AFS)/osi_inode.c
- $(CRULE1);
+ $(CRULE1)
osi_misc.o: $(AFS)/osi_misc.c
- $(CRULE1);
+ $(CRULE1)
osi_sleep.o: $(AFS)/osi_sleep.c
- $(CRULE1);
+ $(CRULE1)
osi_timeout.o: $(AFS)/osi_timeout.c
- $(CRULE1);
+ $(CRULE1)
osi_vfsops.o: $(AFS)/osi_vfsops.c
- $(CRULE1);
+ $(CRULE1)
osi_vm.o: $(AFS)/osi_vm.c
- $(CRULE1);
+ $(CRULE1)
osi_vnodeops.o: $(AFS)/osi_vnodeops.c
- $(CRULE1);
+ $(CRULE1)
# Build rules for iauth objects.
afs_call_iauth.o: $(AFS)/afs_call.c
- $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_call_iauth.o;
+ $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_call_iauth.o
afs_nfsclnt_iauth.o: $(AFS)/afs_nfsclnt.c
- $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_nfsclnt_iauth.o;
+ $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_nfsclnt_iauth.o
afs_pioctl_iauth.o: $(AFS)/afs_pioctl.c
- $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_pioctl_iauth.o;
+ $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o afs_pioctl_iauth.o
osi_vfsops_iauth.o: $(AFS)/osi_vfsops.c
- $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o osi_vfsops_iauth.o;
+ $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o osi_vfsops_iauth.o
osi_vnodeops_iauth.o: $(AFS)/osi_vnodeops.c
- $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o osi_vnodeops_iauth.o;
+ $(CRULE1) -DAFS_NONFSTRANS -DAFS_AIX_IAUTH_ENV -o osi_vnodeops_iauth.o
#/* Copyright (C) 1995, 1989 Transarc Corporation - All rights reserved */
-# $Header: /tmp/cvstemp/openafs/src/libafs/MakefileProto.DARWIN.in,v 1.1 2001/07/05 01:03:17 hartmans Exp $
+# $Header: /tmp/cvstemp/openafs/src/libafs/MakefileProto.DARWIN.in,v 1.1.1.2 2001/09/11 14:33:26 hartmans Exp $
#
# MakefileProto for Digital Unix systems
#
-
-DESTDIR=DEST/
-include ../config/Makefile.${SYS_NAME}
+DEST=@DEST@
+TOP_INCDIR=@TOP_INCDIR@
+TOP_LIBDIR=@TOP_LIBDIR@
+TOP_SRCDIR=@TOP_SRCDIR@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+sbindir=@sbindir@
+libexecdir=@libexecdir@
+libdir=@libdir@
+includedir=@includedir@
+mandir=@mandir@
+afssrvbindir=@afssrvbindir@
+afssrvsbindir=@afssrvsbindir@
+afssrvlibexecdir=@afssrvlibexecdir@
+afskerneldir=@afskerneldir@
+SYS_NAME=@AFS_SYSNAME@
+
+include config/Makefile.${SYS_NAME}
# OS specific object files:
osi_vnodeops.o \
osi_module.o \
xdr.o \
- xdr_array.o
+ xdr_array.o \
+ xdr_int64.o
#AFS_OS_NFSOBJS = osi_vfsops_nfs.o
# This tells Makefile.common to use it's single directory build target.
COMPDIRS = single_compdir
+INSTDIRS = single_instdir
+DESTDIRS = single_destdir
include Makefile.common
setup:
-mkdir $(KOBJ)
- -rm $(KOBJ)/Makefile $(KOBJ)/Makefile.common
+ -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common $(KOBJ)/config
ln -s ../Makefile $(KOBJ)/Makefile
ln -s ../Makefile.common $(KOBJ)/Makefile.common
- -rm -f h net netinet rpc ufs nfs machine sys vm mach kern
+ ln -s ../config $(KOBJ)/config
+ -$(RM) -f h net netinet rpc ufs nfs machine sys vm mach kern
-ln -s $(KROOT)/System/Library/Frameworks/Kernel.framework/Headers/net net
-ln -s $(KROOT)/System/Library/Frameworks/Kernel.framework/Headers/machine machine
-ln -s $(KROOT)/System/Library/Frameworks/Kernel.framework/Headers/netinet netinet
LIBAFS = libafs.o
LIBAFSNONFS = libafs.nonfs.o
-DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs-nfs
-DEST_LIBAFSNONFS = ${DESTDIR}/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs
+INST_LIBAFS = ${DESTDIR}${afskerneldir}/afs-nfs
+INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/afs
+DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs-nfs
+DEST_LIBAFSNONFS = ${DEST}/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs
+
+libafs: $(LIBAFSNONFS) ;
+install_libafs: $(INST_LIBAFSNONFS) ;
+dest_libafs: $(DEST_LIBAFSNONFS) ;
-libafs: $(DEST_LIBAFSNONFS) ;
+$(INST_LIBAFS): $(LIBAFS)
+ $(INSTALL) -f $? $@
+
+$(INST_LIBAFSNONFS): $(LIBAFSNONFS)
+ $(INSTALL) -f $? $@
$(DEST_LIBAFS): $(LIBAFS)
$(INSTALL) -f $? $@
osi_module.o: $(AFS)/osi_module.c
$(CRULE1)
xdr.o: $(RX)/xdr.c
- $(CRULE1);
+ $(CRULE1)
xdr_array.o: $(RX)/xdr_array.c
- $(CRULE1);
-
+ $(CRULE1)
+xdr_int64.o: $(RX)/xdr_int64.c
+ $(CRULE1)
# MakefileProto for Digital Unix systems
#
-
-DESTDIR=DEST/
-include ../config/Makefile.${SYS_NAME}
+DEST=@DEST@
+TOP_INCDIR=@TOP_INCDIR@
+TOP_LIBDIR=@TOP_LIBDIR@
+TOP_SRCDIR=@TOP_SRCDIR@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+sbindir=@sbindir@
+libexecdir=@libexecdir@
+libdir=@libdir@
+includedir=@includedir@
+mandir=@mandir@
+afssrvbindir=@afssrvbindir@
+afssrvsbindir=@afssrvsbindir@
+afssrvlibexecdir=@afssrvlibexecdir@
+afskerneldir=@afskerneldir@
+SYS_NAME=@AFS_SYSNAME@
+
+include config/Makefile.${SYS_NAME}
# OS specific object files:
# This tells Makefile.common to use it's single directory build target.
COMPDIRS = single_compdir
+INSTDIRS = single_instdir
+DESTDIRS = single_destdir
include Makefile.common
setup:
-mkdir $(KOBJ)
- -rm $(KOBJ)/Makefile $(KOBJ)/Makefile.common
+ -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common $(KOBJ)/config
ln -s ../Makefile $(KOBJ)/Makefile
ln -s ../Makefile.common $(KOBJ)/Makefile.common
- -rm -f h net netinet rpc ufs nfs machine sys vm
+ ln -s ../config $(KOBJ)/config
+ -$(RM) -f h net netinet rpc ufs nfs machine sys vm
-ln -s /usr/sys/include/net net
-ln -s /usr/sys/include/machine machine
-ln -s /usr/sys/include/netinet netinet
# Below this line are targets when in the COMMON directory:
LIBAFS = libafs.o
LIBAFSNONFS = libafs.nonfs.o
+AFSMOD = afs.mod
+
+INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
+INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
+INST_AFSMOD = ${DESTDIR}${afskerneldir}/${AFSMOD}
-DEST_LIBAFS = ${DESTDIR}/root.client/bin/${LIBAFS}
-DEST_LIBAFSNONFS = ${DESTDIR}/root.client/bin/${LIBAFSNONFS}
+DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
+DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
+DEST_AFSMOD = ${DEST}/root.client/bin/${AFSMOD}
-# libafs: $(DEST_LIBAFS) $(DEST_LIBAFSNONFS)
+.PHONY: libafs install_libafs
+libafs: ${LIBAFSNONFS} ${AFSMOD}
+install_libafs: ${INST_LIBAFSNONFS} ${INST_AFSMOD}
+dest_libafs: ${DEST_LIBAFSNONFS} ${DEST_AFSMOD}
-.PHONY: libafs
-libafs: $(DEST_LIBAFSNONFS)
+${INST_LIBAFS}: ${LIBAFS}
+ $(INSTALL) -f $? $@
+
+${INST_LIBAFSNONFS}: ${LIBAFSNONFS}
+ $(INSTALL) -f $? $@
+
+${INST_AFSMOD}: ${AFSMOD}
+ $(INSTALL) -f $? $@
+
+${DEST_LIBAFS}: ${LIBAFS}
+ $(INSTALL) -f $? $@
-$(DEST_LIBAFS): $(LIBAFS)
+${DEST_LIBAFSNONFS}: ${LIBAFSNONFS}
$(INSTALL) -f $? $@
-$(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
+${DEST_AFSMOD}: ${AFSMOD}
$(INSTALL) -f $? $@
${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
${LIBAFSNONFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
$(LD) -r -o ${LIBAFSNONFS} ${AFSAOBJS} ${AFSNONFSOBJS}
+${AFSMOD}: ${LIBAFSNONFS}
+ $(LD) -dc -r -o ${AFSMOD} ${LIBAFSNONFS}
# Object build rules:
osi_groups.o: $(AFS)/osi_groups.c
#/* Copyright (C) 1995, 1989 Transarc Corporation - All rights reserved */
#
-# MakefileProto for Digital Unix systems
+# MakefileProto for FreeBSD systems
#
-
-DESTDIR=DEST/
-# include ../config/Makefile.${SYS_NAME}
+DEST=@DEST@
+TOP_INCDIR=@TOP_INCDIR@
+TOP_LIBDIR=@TOP_LIBDIR@
+TOP_SRCDIR=@TOP_SRCDIR@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+sbindir=@sbindir@
+libexecdir=@libexecdir@
+libdir=@libdir@
+includedir=@includedir@
+mandir=@mandir@
+afssrvbindir=@afssrvbindir@
+afssrvsbindir=@afssrvsbindir@
+afssrvlibexecdir=@afssrvlibexecdir@
+afskerneldir=@afskerneldir@
+SYS_NAME=@AFS_SYSNAME@
+
+# include config/Makefile.${SYS_NAME}
# OS specific object files:
AFS_OS_OBJS = \
osi_misc.o \
osi_sleep.o \
osi_vm.o \
- osi_vnodeops.o
+ osi_vnodeops.o \
+ xdr_int64.o
AFS_OS_NFSOBJS = \
osi_vfsops_nfs.o
# This tells Makefile.common to use it's single directory build target.
COMPDIRS = single_compdir
+INSTDIRS = single_instdir
+DESTDIRS = single_destdir
include Makefile.common
setup:
-mkdir $(KOBJ)
- -rm $(KOBJ)/Makefile $(KOBJ)/Makefile.common
+ -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common $(KOBJ)/config
ln -s ../Makefile $(KOBJ)/Makefile
ln -s ../Makefile.common $(KOBJ)/Makefile.common
- -rm -f h net netinet rpc ufs nfs machine sys vm
+ ln -s ../config $(KOBJ)/config
+ -$(RM) -f h net netinet rpc ufs nfs machine sys vm
-ln -s /usr/src/sys/net net
-ln -s /usr/src/sys/i386/include machine
-ln -s /usr/src/sys/netinet netinet
LIBAFS = libafs.o
LIBAFSNONFS = libafs.nonfs.o
-DEST_LIBAFS = ${DESTDIR}/root.client/bin/${LIBAFS}
-DEST_LIBAFSNONFS = ${DESTDIR}/root.client/bin/${LIBAFSNONFS}
+INST_LIBAFS ${DESTDIR}${afskerneldir}/${LIBAFS}
+INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
+
+DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
+DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
-# libafs: $(DEST_LIBAFS) $(DEST_LIBAFSNONFS)
-# libafs: $(DEST_LIBAFSNONFS)
+# libafs: $(LIBAFS) $(LIBAFSNONFS)
+# libafs: $(LIBAFSNONFS)
+# install_libafs: $(INST_LIBAFS) $(INST_LIBAFSNONFS)
+# install_libafs: $(INST_LIBAFSNONFS)
+# dest_libafs: $(DEST_LIBAFS) $(DEST_LIBAFSNONFS)
+# dest_libafs: $(DEST_LIBAFSNONFS)
libafs:
echo WARNING: No kernel module for ${SYS_NAME}
+install_libafs:
+ echo WARNING: No kernel module for ${SYS_NAME}
+
+dest_libafs:
+ echo WARNING: No kernel module for ${SYS_NAME}
+
+
+$(INST_LIBAFS): $(LIBAFS)
+ $(INSTALL) -f $? $@
+
+$(INST_LIBAFSNONFS): $(LIBAFSNONFS)
+ $(INSTALL) -f $? $@
$(DEST_LIBAFS): $(LIBAFS)
$(INSTALL) -f $? $@
$(CRULE1)
osi_vnodeops.o: $(AFS)/osi_vnodeops.c
$(CRULE1)
+xdr_int64.o: $(RX)/xdr_int64.c
+ $(CRULE1)
# MakefileProto for HP systems
#
-
-DESTDIR=DEST/
-include ../config/Makefile.${SYS_NAME}
+DEST=@DEST@
+TOP_INCDIR=@TOP_INCDIR@
+TOP_LIBDIR=@TOP_LIBDIR@
+TOP_SRCDIR=@TOP_SRCDIR@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+sbindir=@sbindir@
+libexecdir=@libexecdir@
+libdir=@libdir@
+includedir=@includedir@
+mandir=@mandir@
+afssrvbindir=@afssrvbindir@
+afssrvsbindir=@afssrvsbindir@
+afssrvlibexecdir=@afssrvlibexecdir@
+afskerneldir=@afskerneldir@
+SYS_NAME=@AFS_SYSNAME@
+
+include config/Makefile.${SYS_NAME}
# OS specific object files:
AFS_OS_OBJS = \
osi_misc.o \
osi_sleep.o \
osi_vnodeops.o \
- osi_vm.o
+ osi_vm.o \
+ xdr_int64.o
AFS_OS_NFSOBJS = \
osi_vfsops_nfs.o
#COMPDIRS = single_compdir
# This is the hpux multiple directory target.
COMPDIRS = hpux_compdirs
+INSTDIRS = hpux_instdirs
+DESTDIRS = hpux_destdirs
include Makefile.common
BITS = 64 32
setup:
- -rm -f h net dux machine netinet nfs rpc s200 ufs sys
+ -$(RM) -f h net dux machine netinet nfs rpc s200 ufs sys
ln -s /usr/include/sys h
ln -s /etc/conf/net net
ln -s /etc/conf/dux dux
dir=$$t.$$b; \
echo Making directory: $$dir; \
mkdir -p $$dir; \
- rm -f $$dir/Makefile $$dir/Makefile.common; \
+ $(RM) -f $$dir/Makefile $$dir/Makefile.common $$dir/config; \
ln -s ../Makefile $$dir/Makefile; \
ln -s ../Makefile.common $$dir/Makefile.common; \
+ ln -s ../config $$dir/config; \
done; \
done
echo Setup complete.
# Compile the clients.
-${COMPDIRS}:
+${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
if false; then \
for b in $(BITS); do \
for t in $(KOBJ); do \
64) bopts="$(KDEFS_64)"; bsuff="64";; \
esac; \
cd $$dir; \
- $(MAKE) BITSUFFIX=$$bsuff CPU_KDEFS="$$bopts" DESTDIR=${DESTDIR} libafs || exit $$?; \
+ $(MAKE) BITSUFFIX=$$bsuff CPU_KDEFS="$$bopts" $@_libafs || exit $$?; \
cd ..; \
done; \
done; \
fi
+hpux_compdirs_libafs: libafs
+hpux_instdirs_libafs: install_libafs
+hpux_destdirs_libafs: dest_libafs
+
# Below this line are targets when in the static directory:
LIBAFS = libafs$(BITSUFFIX).a
LIBAFSNONFS = libafs$(BITSUFFIX).nonfs.a
+INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
+INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
-DEST_LIBAFS = ${DESTDIR}root.client/bin/${LIBAFS}
-DEST_LIBAFSNONFS = ${DESTDIR}root.client/bin/${LIBAFSNONFS}
+DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
+DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
-# libafs: ${DEST_LIBAFS} ${DEST_LIBAFSNONFS}
-libafs: ${DEST_LIBAFSNONFS}
+libafs: ${LIBAFSNONFS}
+install_libafs: ${INST_LIBAFSNONFS}
+dest_libafs: ${DEST_LIBAFSNONFS}
+
+$(INST_LIBAFS): $(LIBAFS)
+ ${INSTALL} -f $? $@
+
+$(INST_LIBAFSNONFS): $(LIBAFSNONFS)
+ ${INSTALL} -f $? $@
$(DEST_LIBAFS): $(LIBAFS)
${INSTALL} -f $? $@
$(CRULE1)
osi_vnodeops.o: $(AFS)/osi_vnodeops.c
$(CRULE1)
+xdr_int64.o: $(RX)/xdr_int64.c
+ $(CRULE1)
# This is a list of header files compiled with the -g option. It allows
# examination of AFS structures in a dump.
# MakefileProto for IRIX systems
#
-
-DESTDIR=DEST/
-include ../config/Makefile.${SYS_NAME}
+DEST=@DEST@
+TOP_INCDIR=@TOP_INCDIR@
+TOP_LIBDIR=@TOP_LIBDIR@
+TOP_SRCDIR=@TOP_SRCDIR@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+sbindir=@sbindir@
+libexecdir=@libexecdir@
+libdir=@libdir@
+includedir=@includedir@
+mandir=@mandir@
+afssrvbindir=@afssrvbindir@
+afssrvsbindir=@afssrvsbindir@
+afssrvlibexecdir=@afssrvlibexecdir@
+afskerneldir=@afskerneldir@
+SYS_NAME=@AFS_SYSNAME@
+
+include config/Makefile.${SYS_NAME}
# OS specific object files:
AFS_OS_OBJS = \
osi_misc.o \
osi_sleep.o \
osi_vm.o \
- osi_vnodeops.o
+ osi_vnodeops.o \
+ xdr_int64.o
AFS_OS_NFSOBJS = \
osi_vfsops_nfs.o
KDEFS=-D_K64U64 -D_KERNEL -DSTATIC=static -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE \
-DTFP -non_shared -elf -xansi -64 -mips4 -TENV:kernel \
-TENV:misalignment=1 -OPT:space \
- -D${CPUBOARD} -D${MPSP} -D${CPUARCH} -DAFS_SGIMP_ENV ${NODYNOPT} \
+ -D${CPUBOARD} -D${MPSP} -D${CPUARCH} -DAFS_SGIMP_ENV ${NODYNOPT} \
-jalr -woff 1209,1196,1496
<sgi_62>
# Turning off warnings regarding constant conditionals and not prototyped.
#COMPDIRS = single_compdir
# This is the irix multiple directory target.
COMPDIRS = irix_compdirs
+INSTDIRS = irix_instdirs
+DESTDIRS = irix_destdirs
include Makefile.common
setup:
- -rm -f h net netinet rpc ufs nfs machine sys
+ -$(RM) -f h net netinet rpc ufs nfs machine sys
-ln -s /usr/include/sys h
-ln -s /usr/include/net /usr/include/netinet .
-ln -s /usr/include/rpc /usr/include/sys .
-ln -s /usr/include/sys/fs .
- -mkdir ${DESTDIR}root.client/bin
<all -sgi_65>
BUILDPROCS="${PROCESSORS}" ; \
BUILDMPS="${MPS}" ; \
dir=$$t.$$n.$$p ; \
echo Making directory: $$dir; \
mkdir -p $$dir; \
- rm -f $$dir/Makefile.common $$dir/Makefile; \
+ $(RM) -f $$dir/Makefile.common $$dir/Makefile $$dir/config; \
ln -s ../Makefile.common $$dir/Makefile.common; \
ln -s ../Makefile $$dir/Makefile; \
+ ln -s ../config $$dir/config; \
done; \
done; \
done
dir=$$t.$$p ; \
echo Making directory: $$dir; \
mkdir -p $$dir; \
- rm -f $$dir/Makefile.common $$dir/Makefile; \
+ $(RM) -f $$dir/Makefile.common $$dir/Makefile $$dir/config; \
ln -s ../Makefile.common $$dir/Makefile.common; \
ln -s ../Makefile $$dir/Makefile; \
+ ln -s ../config $$dir/config; \
done; \
done
<all>
# Compile static and modload versions of the clients.
<all -sgi_65>
-${COMPDIRS}:
+${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
BUILDPROCS="${PROCESSORS}" ; \
if [ "${CPUARCH}" != "" ] ; then \
BUILDPROCS=${CPUARCH}; \
export CPU_KDEFS ;\
export LDFLAGS; \
cd $$dir ; \
- $(MAKE) CPUARCH=$$p MPSP=$$n DESTDIR=../${DESTDIR} $$t.libafs || exit $$?;\
+ $(MAKE) CPUARCH=$$p MPSP=$$n $@_$$t.libafs || exit $$?;\
cd ../ ; \
done; \
done; \
done
<sgi_65>
-${COMPDIRS}:
+${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
BUILDPROCS="${PROCESSORS}" ; \
if [ "${IPNO}" != "" ] ; then \
BUILDPROCS="${IPNO}"; \
export CPU_KDEFS ;\
export LDFLAGS ;\
cd $$dir ; \
- $(MAKE) IPNO=$$p DESTDIR=${DESTDIR} $$t.libafs || exit $$?; \
+ $(MAKE) IPNO=$$p $@_$$t.libafs || exit $$?; \
cd ../ ; \
done; \
done
<all>
+irix_compdirs_STATIC.libafs: STATIC.libafs
+irix_compdirs_MODLOAD.libafs: MODLOAD.libafs
+irix_instdirs_STATIC.libafs: install_STATIC.libafs
+irix_instdirs_MODLOAD.libafs: install_MODLOAD.libafs
+irix_destdirs_STATIC.libafs: dest_STATIC.libafs
+irix_destdirs_MODLOAD.libafs: dest_MODLOAD.libafs
+
+
+
+${INSTDIRS}: install_COPYFILES install_LINKFILES
+${DESTDIRS}: dest_COPYFILES dest_LINKFILES
+
+
LIBAFSNONFSA = libafs.nonfs.a
-COPYFILES = copyfiles
-LINKFILES = linkfiles
-STATICCLIENTDIR = ${DESTDIR}root.client/bin
-MODLOADCLIENTDIR = ${DESTDIR}root.client/usr/vice/etc/sgiload
+STATIC.libafs: ${LIBAFSNONFSA}
-# Make the NFS and no-NFS clients for this directory.
-# STATIC.libafs: ${LIBAFSNONFSA} ${COPYFILES} ${LINKFILES}
-STATIC.libafs: ${LIBAFSNONFSA} ${COPYFILES} ${LINKFILES}
+install_STATIC.libafs: ${LIBAFSNONFSA}
<all -sgi_65>
${CP} ${LIBAFSNONFSA} \
- ${STATICCLIENTDIR}/libafs.${MPSP}.${CPUARCH}.nonfs.a
+ ${DESTDIR}${afskerneldir}/libafs.${MPSP}.${CPUARCH}.nonfs.a
<sgi_65>
${CP} ${LIBAFSNONFSA} \
- ${STATICCLIENTDIR}/libafs.${IPNO}.nonfs.a
+ ${DESTDIR}${afskerneldir}/libafs.${IPNO}.nonfs.a
+<all>
+
+dest_STATIC.libafs: ${LIBAFSNONFSA}
+<all -sgi_65>
+ ${CP} ${LIBAFSNONFSA} \
+ ${DEST}/root.client/bin/libafs.${MPSP}.${CPUARCH}.nonfs.a
+<sgi_65>
+ ${CP} ${LIBAFSNONFSA} \
+ ${DEST}/root.client/bin/libafs.${IPNO}.nonfs.a
<all>
${LIBAFSNONFSA}: $(AFSAOBJS) $(AFSNONFSOBJS)
$(AR) cru $@ $?
-LIBAFSNONFSO = libaf.nonfs.o
+
+LIBAFSNONFSO = libafs.nonfs.o
# MODLOAD.libafs: ${LIBAFSNONFSO} ${COPYFILES} ${LINKFILES}
-MODLOAD.libafs: ${LIBAFSNONFSO} ${COPYFILES} ${LINKFILES}
+MODLOAD.libafs: ${LIBAFSNONFSO}
+
+install_MODLOAD.libafs: ${LIBAFSNONFSO}
<all -sgi_65>
${CP} ${LIBAFSNONFSO} \
- ${MODLOADCLIENTDIR}/libafs.${MPSP}.${CPUARCH}.nonfs.o
+ ${DESTDIR}${afskerneldir}/libafs.${MPSP}.${CPUARCH}.nonfs.o
<sgi_65>
${CP} ${LIBAFSNONFSO} \
- ${MODLOADCLIENTDIR}/libafs.${IPNO}.nonfs.o
+ ${DESTDIR}${afskerneldir}/libafs.${IPNO}.nonfs.o
+<all>
+
+dest_MODLOAD.libafs: ${LIBAFSNONFSO}
+<all -sgi_65>
+ ${CP} ${LIBAFSNONFSO} \
+ ${DEST}/root.client/usr/vice/etc/sgiload/libafs.${MPSP}.${CPUARCH}.nonfs.o
+<sgi_65>
+ ${CP} ${LIBAFSNONFSO} \
+ ${DEST}/root.client/usr/vice/etc/sgiload/libafs.${IPNO}.nonfs.o
<all>
${LIBAFSNONFSO}: $(AFSAOBJS) $(AFSNONFSOBJS)
$(LD) ${LDFLAGS} -elf -r -d -G 0 -o ${LIBAFSNONFSO} \
$(AFSAOBJS) $(AFSNONFSOBJS)
-${COPYFILES}:
- ${CP} ../sgi_system ${STATICCLIENTDIR}/afs.sm
- chmod 644 ${STATICCLIENTDIR}/afs.sm
- ${CP} ../sgi_master ${STATICCLIENTDIR}/afs
- chmod 644 ${STATICCLIENTDIR}/afs
+
+install_COPYFILES:
+ ${CP} sgi_system ${DESTDIR}${afskerneldir}/afs.sm
+ chmod 644 ${DESTDIR}${afskerneldir}/afs.sm
+ ${CP} sgi_master ${DESTDIR}${afskerneldir}/afs
+ chmod 644 ${DESTDIR}${afskerneldir}/afs
+
+dest_COPYFILES:
+ ${INSTALL} -f sgi_system ${DEST}/root.client/bin/afs.sm
+ chmod 644 ${DEST}/root.client/bin/afs.sm
+ ${INSTALL} -f sgi_master ${DEST}/root.client/bin/afs
+ chmod 644 ${DEST}/root.client/bin/afs
# Create symlinks to clients we don't need to build.
# If this changes, also change the kdump symlinks.
-${LINKFILES}:
+install_LINKFILES:
<sgi_65>
- ln -fs libafs.IP20.a ${DESTDIR}root.client/bin/libafs.IP22.a
- ln -fs libafs.IP20.a ${DESTDIR}root.client/bin/libafs.IP32.a
- ln -fs libafs.IP20.nonfs.a ${DESTDIR}root.client/bin/libafs.IP22.nonfs.a
- ln -fs libafs.IP20.nonfs.a ${DESTDIR}root.client/bin/libafs.IP32.nonfs.a
- ln -fs libafs.IP20.o ${DESTDIR}root.client/usr/vice/etc/sgiload/libafs.IP22.o
- ln -fs libafs.IP20.o ${DESTDIR}root.client/usr/vice/etc/sgiload/libafs.IP32.o
- ln -fs libafs.IP20.nonfs.o ${DESTDIR}root.client/usr/vice/etc/sgiload/libafs.IP22.nonfs.o
- ln -fs libafs.IP20.nonfs.o ${DESTDIR}root.client/usr/vice/etc/sgiload/libafs.IP32.nonfs.o
+ ln -fs libafs.IP20.a ${DESTDIR}${afskerneldir}/libafs.IP22.a
+ ln -fs libafs.IP20.a ${DESTDIR}${afskerneldir}/libafs.IP32.a
+ ln -fs libafs.IP20.nonfs.a ${DESTDIR}${afskerneldir}/libafs.IP22.nonfs.a
+ ln -fs libafs.IP20.nonfs.a ${DESTDIR}${afskerneldir}/libafs.IP32.nonfs.a
+ ln -fs libafs.IP20.o ${DESTDIR}${afskerneldir}/libafs.IP22.o
+ ln -fs libafs.IP20.o ${DESTDIR}${afskerneldir}/libafs.IP32.o
+ ln -fs libafs.IP20.nonfs.o ${DESTDIR}${afskerneldir}/libafs.IP22.nonfs.o
+ ln -fs libafs.IP20.nonfs.o ${DESTDIR}${afskerneldir}/libafs.IP32.nonfs.o
+<all>
-
+# Create symlinks to clients we don't need to build.
+# If this changes, also change the kdump symlinks.
+dest_LINKFILES:
+<sgi_65>
+ ln -fs libafs.IP20.a ${DEST}/root.client/bin/libafs.IP22.a
+ ln -fs libafs.IP20.a ${DEST}/root.client/bin/libafs.IP32.a
+ ln -fs libafs.IP20.nonfs.a ${DEST}/root.client/bin/libafs.IP22.nonfs.a
+ ln -fs libafs.IP20.nonfs.a ${DEST}/root.client/bin/libafs.IP32.nonfs.a
+ ln -fs libafs.IP20.o ${DEST}/root.client/usr/vice/etc/sgiload/libafs.IP22.o
+ ln -fs libafs.IP20.o ${DEST}/root.client/usr/vice/etc/sgiload/libafs.IP32.o
+ ln -fs libafs.IP20.nonfs.o ${DEST}/root.client/usr/vice/etc/sgiload/libafs.IP22.nonfs.o
+ ln -fs libafs.IP20.nonfs.o ${DEST}/root.client/usr/vice/etc/sgiload/libafs.IP32.nonfs.o
+<all>
# Object build rules:
# Common objects
afs_base64.o: $(AFS)/afs_base64.c
- $(CRULE1);
+ $(CRULE1)
osi_groups.o: $(AFS)/osi_groups.c
- $(CRULE1);
+ $(CRULE1)
osi_idbg.o: $(AFS)/osi_idbg.c
- $(CRULE1);
+ $(CRULE1)
osi_inode.o: $(AFS)/osi_inode.c
- $(CRULE1);
+ $(CRULE1)
osi_file.o: $(AFS)/osi_file.c
- $(CRULE1);
+ $(CRULE1)
osi_misc.o: $(AFS)/osi_misc.c
- $(CRULE1);
+ $(CRULE1)
osi_sleep.o: $(AFS)/osi_sleep.c
- $(CRULE1);
+ $(CRULE1)
osi_vfsops_nfs.o: $(AFS)/osi_vfsops.c
- $(CRULE1) -o osi_vfsops_nfs.o;
+ $(CRULE1) -o osi_vfsops_nfs.o
osi_vfsops.o: $(AFS)/osi_vfsops.c
- $(CRULE1) -DAFS_NONFSTRANS;
+ $(CRULE1) -DAFS_NONFSTRANS
osi_vm.o: $(AFS)/osi_vm.c
- $(CRULE1);
+ $(CRULE1)
osi_vnodeops.o: $(AFS)/osi_vnodeops.c
- $(CRULE1);
-
-
+ $(CRULE1)
+xdr_int64.o: $(RX)/xdr_int64.c
+ $(CRULE1)
# MakefileProto for Solaris systems
#
-include ../config/Makefile.${SYS_NAME}
+DEST=@DEST@
+TOP_INCDIR=@TOP_INCDIR@
+TOP_LIBDIR=@TOP_LIBDIR@
+TOP_SRCDIR=@TOP_SRCDIR@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+sbindir=@sbindir@
+libexecdir=@libexecdir@
+libdir=@libdir@
+includedir=@includedir@
+mandir=@mandir@
+afssrvbindir=@afssrvbindir@
+afssrvsbindir=@afssrvsbindir@
+afssrvlibexecdir=@afssrvlibexecdir@
+afskerneldir=@afskerneldir@
+SYS_NAME=@AFS_SYSNAME@
+
+include config/Makefile.${SYS_NAME}
# OS specific object files:
AFS_OS_OBJS = \
osi_file.o \
osi_sleep.o \
osi_vm.o \
- osi_vnodeops.o
+ osi_vnodeops.o \
+ xdr_int64.o
AFS_OS_NFSOBJS = \
osi_vfsops_nfs.o
# This tells Makefile.common to use it's single directory build target.
<all -sun4x_57 -sun4x_58>
COMPDIRS = single_compdir
+INSTDIRS = single_instdir
+DESTDIRS = single_destdir
<sun4x_57 sun4x_58>
COMPDIRS = solaris_compdirs
+INSTDIRS = solaris_instdirs
+DESTDIRS = solaris_destdirs
<all>
include Makefile.common
setup:
- -rm -f h net netinet rpc ufs nfs machine sys inet
+ -$(RM) -f h net netinet rpc ufs nfs machine sys inet
-ln -s /usr/include/sys h
-ln -s /usr/include/net net
-ln -s /usr/include/netinet netinet
for t in ${KOBJ} ; do \
echo Making directory: $$t; \
mkdir -p $$t; \
- rm -f $$t/Makefile.common $$t/Makefile ; \
+ $(RM) -f $$t/Makefile.common $$t/Makefile $$t/config ; \
ln -s ../Makefile.common $$t/Makefile.common ; \
ln -s ../Makefile $$t/Makefile ;\
+ ln -s ../config $$t/config ;\
done
## the 64 bit libafs in MODLOAD32 and MODLOAD64 directories respectively
<sun4x_57 sun4x_58>
-${COMPDIRS}:
+${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
for t in ${KOBJ} ; do \
echo Building directory: $$t ; \
case $$t in \
export ARCH_DEFS ; \
export BITS ; \
cd $$t ; \
- $(MAKE) DESTDIR=${DESTDIR} libafs ; \
+ $(MAKE) $@_libafs ; \
cd ../ ;\
done
+solaris_compdirs_libafs: libafs
+solaris_instdirs_libafs: install_libafs
+solaris_destdirs_libafs: dest_libafs
+
<all>
# Below this line are targets when in the COMMON directory:
LIBAFSNONFS = libafs.nonfs.o
<all -sun4x_57 -sun4x_58>
-DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS}
-DEST_LIBAFSNONFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFSNONFS}
+INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
+INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
+
+DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS}
+DEST_LIBAFSNONFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFSNONFS}
# Without this line, gmake tries to build libafs.o
.PHONY: libafs
-# libafs: $(DEST_LIBAFS) $(DEST_LIBAFSNONFS)
-libafs: $(DEST_LIBAFSNONFS)
+libafs: $(LIBAFSNONFS)
+install_libafs: $(INST_LIBAFSNONFS)
+dest_libafs: $(DEST_LIBAFSNONFS)
+
+
+$(INST_LIBAFS): $(LIBAFS)
+ ${INSTALL} -f $? $@
+$(INST_LIBAFSNONFS): $(LIBAFSNONFS)
+ ${INSTALL} -f $? $@
$(DEST_LIBAFS): $(LIBAFS)
${INSTALL} -f $? $@
$(LD) -r -o $@ $(AFSAOBJS) ${AFSNONFSOBJS}
<sun4x_57 sun4x_58>
-MODLOADDIR = ${DESTDIR}root.client/usr/vice/etc/modload
libafs: ${LIBAFSNONFS}
- ${INSTALL} -f ${LIBAFSNONFS} ${MODLOADDIR}/libafs${BITS}.nonfs.o
+
+install_libafs: ${LIBAFSNONFS}
+ ${INSTALL} -f ${LIBAFSNONFS} ${DESTDIR}${afskerneldir}/libafs${BITS}.nonfs.o
+
+dest_libafs: ${LIBAFSNONFS}
+ ${INSTALL} -f ${LIBAFSNONFS} ${DEST}/root.client/usr/vice/etc/modload/libafs${BITS}.nonfs.o
<all>
# Solaris specific objects
osi_groups.o: $(AFS)/osi_groups.c
- $(CRULE1);
+ $(CRULE1)
osi_inode.o: $(AFS)/osi_inode.c
- $(CRULE1);
+ $(CRULE1)
osi_file.o: $(AFS)/osi_file.c
- $(CRULE1);
+ $(CRULE1)
osi_sleep.o: $(AFS)/osi_sleep.c
- $(CRULE1);
+ $(CRULE1)
osi_vfsops_nfs.o: $(AFS)/osi_vfsops.c
- $(CRULE1) -o osi_vfsops_nfs.o;
+ $(CRULE1) -o osi_vfsops_nfs.o
osi_vfsops.o: $(AFS)/osi_vfsops.c
- $(CRULE1) -DAFS_NONFSTRANS;
+ $(CRULE1) -DAFS_NONFSTRANS
osi_vm.o: $(AFS)/osi_vm.c
- $(CRULE1);
+ $(CRULE1)
osi_vnodeops.o: $(AFS)/osi_vnodeops.c
- $(CRULE1);
+ $(CRULE1)
+xdr_int64.o: $(RX)/xdr_int64.c
+ $(CRULE1)
# Build rules - CC and CFLAGS are defined in system specific MakefileProtos.
-install: ukinstall
+all: ${TOP_LIBDIR}/$(LIBUAFS) linktest
-webinstall: AFSWEB/$(LIBAFSWEB) AFSWEB/$(LIBAFSWEBKRB)
- ${INSTALL} AFSWEB/$(LIBAFSWEB) ${DESTDIR}root.afsweb/usr/lib
- ${INSTALL} AFSWEB/$(LIBAFSWEBKRB) ${DESTDIR}root.afsweb/usr/lib
+webinstall: all \
+ ${TOP_LIBDIR}/$(LIBAFSWEB) \
+ ${TOP_LIBDIR}/$(LIBAFSWEBKRB)
-ukinsthdrs:
- ${INSTALL} afs/param.h ${DESTDIR}root.perf/include/afs
- ${INSTALL} afs/stds.h ${DESTDIR}root.perf/include/afs
- ${INSTALL} afs/afs_sysnames.h ${DESTDIR}root.perf/include/afs
- ${INSTALL} afs/afs_stats.h ${DESTDIR}root.perf/include/afs
- ${INSTALL} afs/sysincludes.h ${DESTDIR}root.perf/include/afs
- ${INSTALL} afs/afs_usrops.h ${DESTDIR}root.perf/include/afs
+linktest: UAFS/$(LIBUAFS) des/libdes.a
+ $(CC) $(TEST_CFLAGS) $(TEST_LDFLAGS) -o linktest linktest.c -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I${TOP_INCDIR}/rx -I. UAFS/$(LIBUAFS) des/libdes.a $(TEST_LIBS) $(XLIBS)
-ukinstlibs:
- ${INSTALL} des/libdes.a ${DESTDIR}root.perf/lib
- ${INSTALL} UAFS/$(LIBUAFS) ${DESTDIR}root.perf/lib
+ukinstall: install
-ukinstall: ukinsthdrs UAFS/$(LIBUAFS) linktest ukinstlibs
+install: \
+ ${DESTDIR}${libdir}/$(LIBUAFS)
+
+dest: \
+ ${DEST}/root.perf/include/afs/param.h \
+ ${DEST}/root.perf/include/afs/stds.h \
+ ${DEST}/root.perf/include/afs/afs_sysnames.h \
+ ${DEST}/root.perf/include/afs/afs_stats.h \
+ ${DEST}/root.perf/include/afs/sysincludes.h \
+ ${DEST}/root.perf/include/afs/afs_usrops.h \
+ ${DEST}/root.perf/lib/libdes.a \
+ ${DEST}/root.perf/lib/$(LIBUAFS)
-linktest: UAFS/$(LIBUAFS) des/libdes.a
- $(CC) $(TEST_CFLAGS) $(TEST_LDFLAGS) -o linktest linktest.c -I${TOP_SRCDIR}/config -I${DESTDIR}include -I${DESTDIR}include/rx -I${DESTDIR}root.perf/include UAFS/$(LIBUAFS) des/libdes.a $(TEST_LIBS) $(XLIBS)
CRULE1= $(CC) $(OPTF) -DKERNEL $(CFLAGS) -c $?
CRULE2= $(CC) $(OPTF) $(WEBOPTS) -DKERNEL $(CFLAGS) -c $?
$(CRULE2);
clean:
- -rm -rf UAFS* AFSWEB* nsapi des afs afsint config rx
- -rm -f h net netinet rpc ufs machine inet nfs sys des linktest
+ -$(RM) -rf UAFS* AFSWEB* nsapi des afs afsint config rx
+ -$(RM) -f h net netinet rpc ufs machine inet nfs sys des linktest
+
+
+${TOP_LIBDIR}/$(LIBAFSWEB): AFSWEB/$(LIBAFSWEB)
+ ${INSTALL} $? $@
+
+${TOP_LIBDIR}/$(LIBAFSWEBKRB): AFSWEB/$(LIBAFSWEBKRB)
+ ${INSTALL} $? $@
+
+${TOP_LIBDIR}/$(LIBUAFS): UAFS/$(LIBUAFS)
+ ${INSTALL} $? $@
+
+
+${DESTDIR}${libdir}/$(LIBAFSWEB): AFSWEB/$(LIBAFSWEB)
+ ${INSTALL} $? $@
+
+${DESTDIR}${libdir}/$(LIBAFSWEBKRB): AFSWEB/$(LIBAFSWEBKRB)
+ ${INSTALL} $? $@
+
+${DESTDIR}${libdir}/$(LIBUAFS): UAFS/$(LIBUAFS)
+ ${INSTALL} $? $@
+
+
+${DEST}/root.afsweb/usr/lib/$(LIBAFSWEB): AFSWEB/$(LIBAFSWEB)
+ ${INSTALL} $? $@
+
+${DEST}/root.afsweb/usr/lib/$(LIBAFSWEBKRB): AFSWEB/$(LIBAFSWEBKRB)
+ ${INSTALL} $? $@
+
+${DEST}/root.perf/include/afs/param.h: afs/param.h
+ ${INSTALL} $? $@
+
+${DEST}/root.perf/include/afs/stds.h: afs/stds.h
+ ${INSTALL} $? $@
+
+${DEST}/root.perf/include/afs/afs_sysnames.h: afs/afs_sysnames.h
+ ${INSTALL} $? $@
+
+${DEST}/root.perf/include/afs/afs_stats.h: afs/afs_stats.h
+ ${INSTALL} $? $@
+
+${DEST}/root.perf/include/afs/sysincludes.h: afs/sysincludes.h
+ ${INSTALL} $? $@
+
+${DEST}/root.perf/include/afs/afs_usrops.h: afs/afs_usrops.h
+ ${INSTALL} $? $@
+
+${DEST}/root.perf/lib/libdes.a: des/libdes.a
+ ${INSTALL} $? $@
+${DEST}/root.perf/lib/$(LIBUAFS): UAFS/$(LIBUAFS)
+ ${INSTALL} $? $@
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/log/kseal.c,v 1.1.1.4 2001/07/14 22:22:50 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/log/kseal.c,v 1.1.1.5 2001/09/11 14:33:31 hartmans Exp $");
#include <sys/types.h>
#include <netinet/in.h>
string_to_key(argv[2], skey);
now = time(0);
- bcopy(&now, session, 4); /* but this is only a test pgm */
- bcopy(&now, session+4, 4);
+ memcpy(session, &now, 4); /* but this is only a test pgm */
+ memcpy(session+4, &now, 4);
code = tkt_MakeTicket(token.ticket, &token.ticketLen, skey, argv[1], "", cellName,
now-300, now+25*3600, session, /* host */ 0, "afs", "");
if (code) {
strcpy(sname.cell, cellName);
token.startTime = 0;
token.endTime = 0x7fffffff;
- bcopy(session, &token.sessionKey, 8);
+ memcpy(&token.sessionKey, session, 8);
token.kvno = 0;
code = ktc_SetToken (&sname, &token, (char *) 0, 0);
if (code) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/log/test/testlog.c,v 1.1.1.4 2001/07/14 22:22:51 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/log/test/testlog.c,v 1.1.1.5 2001/09/11 14:33:32 hartmans Exp $");
#include <itc.h>
#include <stdio.h>
*/
foundPassword = TRUE;
strcpy(passwd, argv[currArg]);
- bzero(argv[currArg], strlen(passwd));
+ memset(argv[currArg], 0, strlen(passwd));
currArg++;
#if DB_ARGPARSE
fprintf(stderr, "Found password: '%s' (%d chars), erased from arg list (now '%s').\n",
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/login/login.c,v 1.1.1.4 2001/07/14 22:22:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/login/login.c,v 1.1.1.5 2001/09/11 14:33:33 hartmans Exp $");
#include <unistd.h>
#include <stdlib.h>
(void)signal(SIGTSTP, SIG_IGN);
tbuf[0] = '-';
- (void)strcpy(tbuf + 1, (p = rindex(shell, '/')) ? p + 1 : shell);
+ (void)strcpy(tbuf + 1, (p = strrchr(shell, '/')) ? p + 1 : shell);
sia_ses_release(&entity);
execlp(shell, tbuf, 0);
(void)printf("login: no shell: %s.\n", strerror(errno));
if(!fgets(string, size, stream) || ferror(stream) || errno == EINTR)
return NULL;
else
- if(cp=index(string, '\n'))
+ if(cp=strchr(string, '\n'))
*cp = '\0';
else
while((c=getc(stdin)) != '\n' && c != EOF && errno != EINTR)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/login/setenv.c,v 1.1.1.3 2001/07/14 22:22:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/login/setenv.c,v 1.1.1.4 2001/09/11 14:33:33 hartmans Exp $");
#include <sys/types.h>
#include <stdio.h>
(cnt + 2)));
if (!P)
return(-1);
- bcopy(environ, P, cnt * sizeof(char *));
+ memcpy(P, environ, cnt * sizeof(char *));
environ = P;
}
environ[cnt + 1] = NULL;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/login/util_logout.c,v 1.1.1.3 2001/07/14 22:22:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/login/util_logout.c,v 1.1.1.4 2001/09/11 14:33:33 hartmans Exp $");
#include <sys/types.h>
#include <sys/file.h>
if (!ut.ut_name[0] ||
strncmp(ut.ut_line, line, sizeof(ut.ut_line)))
continue;
- bzero(ut.ut_name, sizeof(ut.ut_name));
+ memset(ut.ut_name, 0, sizeof(ut.ut_name));
#if !defined(AIX) && !defined(AFS_SUN5_ENV)
- bzero(ut.ut_host, sizeof(ut.ut_host));
+ memset(ut.ut_host, 0, sizeof(ut.ut_host));
#endif /* AIX */
(void)time(&ut.ut_time);
(void)fseek(fp, (long)-sizeof(struct utmp), L_INCR);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/iomgr.c,v 1.1.1.5 2001/07/14 22:22:53 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/iomgr.c,v 1.1.1.6 2001/09/11 14:33:35 hartmans Exp $");
#include <stdio.h>
#include <stdlib.h>
#else
#define FDS_P_POS (sizeof(int)*8)
#define INTS_PER_FDS(x) (((x)+(FDS_P_POS-1)) / FDS_P_POS)
-#define FD_N_ZERO(nfds, x) bzero((char*)(x), (INTS_PER_FDS(nfds))*sizeof(int))
+#define FD_N_ZERO(nfds, x) memset((char*)(x), 0, (INTS_PER_FDS(nfds))*sizeof(int))
#endif
#if defined(AFS_LINUX22_ENV) && (__GLIBC_MINOR__ > 0)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/test/selsubs.c,v 1.1.1.4 2001/07/14 22:22:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/test/selsubs.c,v 1.1.1.5 2001/09/11 14:33:42 hartmans Exp $");
#include "../lwp.h"
fd_set *IOMGR_AllocFDSet(void)
{
fd_set *tmp = (fd_set*)malloc(sizeof(fd_set));
- bzero((char*)tmp, sizeof(fd_set));
+ memset((char*)tmp, 0, sizeof(fd_set));
return tmp;
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/test/testlwp.c,v 1.1.1.4 2001/07/14 22:23:01 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/test/testlwp.c,v 1.1.1.5 2001/09/11 14:33:43 hartmans Exp $");
#define LWP_KERNEL
#include "lwp.h"
if (ecount == 1)
lwp_cpptr->eventlist[0] = evlist[0];
else
- bcopy(evlist, lwp_cpptr->eventlist, ecount*sizeof(char *));
+ memcpy(lwp_cpptr->eventlist, evlist, ecount*sizeof(char *));
if (wcount > 0) {
lwp_cpptr -> status = WAITING;
move(lwp_cpptr, &runnable[lwp_cpptr->priority], &blocked);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/threadname.c,v 1.1.1.4 2001/07/14 22:22:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/threadname.c,v 1.1.1.5 2001/09/11 14:33:40 hartmans Exp $");
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#if defined(AFS_PTHREAD_ENV)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/waitkey.c,v 1.1.1.7 2001/07/20 10:07:28 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/waitkey.c,v 1.1.1.8 2001/09/11 14:33:41 hartmans Exp $");
#include <stdio.h>
#include <sys/types.h>
* (C) Copyright 10/17/86 by Carnegie Mellon University
*/
#include <stdio.h>
+#include <unistd.h>
extern char *malloc();
-extern char *rindex();
#define maxinputdepth 16
#define maxlinesize 1024
if (*what++ != specialchar)
return nestp->status;
- if (cp = rindex(what,'\n'))
+ if (cp = strrchr(what, '\n'))
*cp = 0;
for (n = 0; n < 2; n++)
{
char *cp, *cp2;
cp = &argv[0][sizeof("-D")-1];
- if (cp2 = rindex(cp,'='))
+ if (cp2 = strrchr(cp, '='))
*cp2++ = 0;
if (cp2 == 0)
cp2 = "";
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/mkntpconf.c,v 1.1.1.4 2001/07/14 22:23:01 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/mkntpconf.c,v 1.1.1.5 2001/09/11 14:33:52 hartmans Exp $");
#include <sys/param.h>
#include <sys/socket.h>
name = (ac > 0) ? (ac--, *av++) : (ac = 0, "mkntpconf");
(void) strcpy(tempfn, name);
- if ((p = rindex(tempfn, '/')) == 0)
+ if ((p = strrchr(tempfn, '/')) == 0)
p = tempfn;
else
p += 1;
peerline(guava, f);
peerline(cluster1, f);
} else {
- if ((p = index(hostname, '.')) != 0
+ if ((p = strchr(hostname, '.')) != 0
&& strcmp(p+1, "srv.cs.cmu.edu") == 0) {
peerline(papaya, f);
peerline(guava, f);
serv.s_addr = 0;
if ((g = fopen("/etc/attributes", "r")) != NULL) {
while (fgets(line, sizeof(line), g) != NULL) {
- if ((p = index(line, ':')) != 0)
+ if ((p = strchr(line, ':')) != 0)
*p = 0;
if (strcmp(line, papaya.s_name) == 0
|| strcmp(line, guava.s_name) == 0)
continue;
- if ((p = index(line, '.')) == 0
+ if ((p = strchr(line, '.')) == 0
|| strcmp(p+1, "srv.cs.cmu.edu") != 0)
continue;
peerline(serv, f);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/ntp.c,v 1.1.1.4 2001/07/14 22:23:05 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/ntp.c,v 1.1.1.5 2001/09/11 14:33:52 hartmans Exp $");
#include <stdio.h>
#ifdef AFS_AIX32_ENV
argv[host]);
continue;
}
- bcopy(hp->h_addr, (char *) &dst.sin_addr,hp->h_length);
+ memcpy((char *) &dst.sin_addr, hp->h_addr, hp->h_length);
}
- bzero((char *)pkt, sizeof(ntp_data));
+ memset((char *)pkt, 0, sizeof(ntp_data));
pkt->status = NTPVERSION_1 | NO_WARNING | MODE_CLIENT;
pkt->stratum = UNSPECIFIED;
#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
-#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
+#define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
#endif
#ifndef NBBY
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/ntp_adjust.c,v 1.1.1.4 2001/07/14 22:23:05 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/ntp_adjust.c,v 1.1.1.5 2001/09/11 14:33:53 hartmans Exp $");
#include <stdio.h>
#include <sys/types.h>
if (debug > 6)
printf ("Zeroing aix_adjtime accumulation: %d %d\n",
cum.tv_sec, cum.tv_usec);
- bzero (&cum, sizeof(cum));
+ memset(&cum, 0, sizeof(cum));
}
int adjtime(newdelta, olddelta)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/ntpd.c,v 1.1.1.4 2001/07/14 22:23:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/ntpd.c,v 1.1.1.5 2001/09/11 14:33:53 hartmans Exp $");
#if defined(AFS_SGI_ENV)
#define NOSWAP 1
#endif /* DEBUG */
setlogmask(LOG_UPTO(LOG_INFO));
- syslog(LOG_NOTICE, "%s version $Revision: 1.1.1.4 $", prog_name);
+ syslog(LOG_NOTICE, "%s version $Revision: 1.1.1.5 $", prog_name);
syslog(LOG_NOTICE, "patchlevel %d", PATCHLEVEL);
#ifdef DEBUG
if (debug)
- printf("%s version $Revision: 1.1.1.4 $ patchlevel %d\n",
+ printf("%s version $Revision: 1.1.1.5 $ patchlevel %d\n",
prog_name, PATCHLEVEL);
#endif
#if defined(AFS_AIX_ENV)
double j;
extern double drift_comp;
- bzero((char *) &sin, sizeof(sin));
+ memset((char *) &sin, 0, sizeof(sin));
fp = fopen(config, "r");
if (fp == NULL) {
fprintf(stderr,"Problem opening NTP initialization file %s\n",
if (hp = gethostbyname(name)) {
if (hp->h_addrtype != AF_INET)
return (0);
- bcopy((char *) hp->h_addr, (char *) &sin->sin_addr,
- hp->h_length);
+ memcpy((char *) &sin->sin_addr, (char *) hp->h_addr, hp->h_length);
sin->sin_family = hp->h_addrtype;
return (1);
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/ntpdc.c,v 1.1.1.4 2001/07/14 22:23:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/ntpdc.c,v 1.1.1.5 2001/09/11 14:33:54 hartmans Exp $");
#include <sys/types.h>
#include <sys/param.h>
sigaction(SIGSEGV, &nsa, NULL);
#endif
(void) gethostname(LocalHostName, sizeof LocalHostName);
- if (p = index(LocalHostName, '.')) {
+ if (p = strchr(LocalHostName, '.')) {
*p++ = '\0';
LocalDomain = p;
}
static struct servent *sp = NULL;
afs_int32 HostAddr;
- bzero((char *) &watcher, sizeof(watcher));
+ memset((char *) &watcher, 0, sizeof(watcher));
watcher.sin_family = AF_INET;
HostAddr = inet_addr(host);
watcher.sin_addr.s_addr = (afs_uint32) HostAddr;
fprintf(stderr,"%s: unknown\n", host);
return 0;
}
- bcopy(hp->h_addr, (char *) &watcher.sin_addr, hp->h_length);
+ memcpy((char *) &watcher.sin_addr, hp->h_addr, hp->h_length);
}
sp = getservbyname("ntp", "udp");
if (sp == 0) {
if (hp == 0)
return (inet_ntoa(f->sin_addr));
- if ((p = index(hp->h_name, '.')) && strcmp(p + 1, LocalDomain) == 0)
+ if ((p = strchr(hp->h_name, '.')) && strcmp(p + 1, LocalDomain) == 0)
*p = '\0';
return (hp->h_name);
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/read_psti.c,v 1.1.1.4 2001/07/14 22:23:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/read_psti.c,v 1.1.1.5 2001/09/11 14:33:55 hartmans Exp $");
#if defined(REFCLOCK) && defined(PSTI)
#define ERR_RATE 60 /* Repeat errors once an hour */
tty.c_iflag = ICRNL;
tty.c_oflag = 0;
tty.c_lflag = 0;
- bzero((char *)tty.c_cc, sizeof tty.c_cc);
+ memset((char *)tty.c_cc, 0, sizeof tty.c_cc);
tty.c_cc[VMIN] = MIN_READ;
tty.c_cc[VTIME] = 0;
if (ioctl(cfd, TCSETA, &tty) < 0) {
#else /* TCSETA Use older Berkeley style IOCTL's */
- bzero((char *)&tty, sizeof tty);
+ memset((char *)&tty, 0, sizeof tty);
tty.sg_ispeed = tty.sg_ospeed = B9600;
tty.sg_flags = ANYP|CRMOD;
tty.sg_erase = tty.sg_kill = '\0';
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/runntp.c,v 1.1.1.4 2001/07/14 22:23:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/runntp.c,v 1.1.1.5 2001/09/11 14:33:55 hartmans Exp $");
#include <afs/stds.h>
#include <signal.h>
/* handle bozo kills right */
{ struct sigaction sa;
- bzero((char *)&sa, sizeof(sa));
+ memset((char *)&sa, 0, sizeof(sa));
sa.sa_handler = terminate;
code = sigaction (SIGTERM, &sa, NULL);
if (code) {
#include <sys/param.h>
#include <afsconfig.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/test.c,v 1.1.1.3 2001/07/11 03:10:22 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ntp/test.c,v 1.1.1.4 2001/09/11 14:33:56 hartmans Exp $");
#include <afs/stds.h>
#include <stdio.h>
struct sysdata sys;
double delay;
- bzero (&peer, sizeof(peer));
- bzero (&sys, sizeof(sys));
+ memset(&peer, 0, sizeof(peer));
+ memset(&sys, 0, sizeof(sys));
pkt.precision = -6;
peer.precision = pkt.precision;
sys.precision = pkt.precision;
char *emalloc();
char *strcpy();
-char *rindex();
CTREEPTR LocateChildNode();
static char path2[MAXPATHLEN+1]; /* $$get rid of this */
* Copy out the candidate mountpoint's pathname into dir, throwing
* off any leaf component from the original path.
*/
- ep = rindex(path, '/');
+ ep = strrchr(path, '/');
for (sp = path, dp = dir; sp < ep; *dp++ = *sp++);
if (dp == dir)
*dp++ = '/';
/*
* Copy out the parent's pathname into parent.
*/
- ep = rindex(dir, '/');
+ ep = strrchr(dir, '/');
for (sp = dir, dp = parent; sp < ep; *dp++ = *sp++);
if (dp == parent)
*dp++ = '/';
register CTREEPTR np;
np = (CTREEPTR) emalloc(sizeof(CTREE));
- bzero((char *)np, sizeof(CTREE));
+ memset((char *)np, 0, sizeof(CTREE));
return(np);
} /*AllocConfigNode*/
# License. For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html
+DEST=@DEST@
+TOP_INCDIR=@TOP_INCDIR@
+TOP_LIBDIR=@TOP_LIBDIR@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+sbindir=@sbindir@
+libexecdir=@libexecdir@
+libdir=@libdir@
+includedir=@includedir@
+mandir=@mandir@
+afssrvbindir=@afssrvbindir@
+afssrvsbindir=@afssrvsbindir@
+afssrvlibexecdir=@afssrvlibexecdir@
+COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et
+RXGEN=${TOP_SRCDIR}/rxgen/rxgen
+TOP_SRCDIR=@TOP_SRCDIR@
+SYS_NAME=@AFS_SYSNAME@
SHELL=/bin/sh
KERNELDIR = ../libafs/
-COMPONENT=afs
include ../config/Makefile.${SYS_NAME}
-LIBDIR = ${DESTDIR}lib/
- LIBSA = ${LIBDIR}afs/libprot.a ${LIBDIR}libubik.a
-AFSLIBS = ${DESTDIR}lib/librxkad.a \
- ${LIBDIR}afs/libsys.a ${DESTDIR}lib/libdes.a \
- ${LIBDIR}librx.a ${LIBDIR}liblwp.a ${LIBDIR}afs/libaudit.a \
- ${LIBDIR}afs/libcmd.a ${LIBDIR}afs/libcom_err.a ${LIBDIR}afs/util.a
+ LIBSA = ${TOP_LIBDIR}/libprot.a ${TOP_LIBDIR}/libubik.a
+AFSLIBS = ${TOP_LIBDIR}/librxkad.a ${TOP_LIBDIR}/libsys.a \
+ ${TOP_LIBDIR}/libdes.a ${TOP_LIBDIR}/librx.a \
+ ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/libaudit.a \
+ ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/libcom_err.a \
+ ${TOP_LIBDIR}/util.a
LDFLAGS = ${SHARE_LDFLAGS}
- LIBS = ${LIBDIR}afs/libkauth.a ${LIBSA} ${LIBDIR}afs/libauth.a \
+ LIBS = ${TOP_LIBDIR}/libkauth.a ${LIBSA} ${TOP_LIBDIR}/libauth.a \
${AFSLIBS} ${PAMLIBS} @LIB_AFSDB@
- KLIBS = ${LIBDIR}afs/libkauth.krb.a ${LIBSA} ${LIBDIR}afs/libauth.krb.a \
+ KLIBS = ${TOP_LIBDIR}/libkauth.krb.a ${LIBSA} ${TOP_LIBDIR}/libauth.krb.a \
${AFSLIBS} ${PAMLIBS} @LIB_AFSDB@
SHOBJS = afs_auth.o afs_account.o afs_session.o afs_password.o \
afs_pam_msg.o afs_message.o afs_util.o AFS_component_version_number.o
OBJS = $(SHOBJS) test_pam.o
-INCLUDES = -I${TOP_SRCDIR}/config -I${DESTDIR}include \
+INCLUDES=-I${TOP_SRCDIR}/config -I${TOP_INCDIR} \
-I/usr/include -I/usr/include/sys
-CFLAGS = ${DEBUG} ${INCLUDES} ${PAM_CFLAGS}
+CFLAGS = ${DEBUG} ${INCLUDES} ${PAM_CFLAGS}
-TARGETS = pam_afs.so.1 test_pam pam_afs.krb.so.1
-
-include ../config/Makefile.version
-
-system all: $(TARGETS)
+all: test_pam ${TOP_LIBDIR}/pam_afs.so.1 ${TOP_LIBDIR}/pam_afs.krb.so.1
afs_setcred.o: afs_setcred.c afs_pam_msg.h afs_message.h afs_util.h
${CC} ${CFLAGS} -c afs_setcred.c -o afs_setcred.o
echo No link line for system $(SYS_NAME). ;; \
esac
-clean:
- /bin/rm -f $(TARGETS) $(OBJS) afs_setcred.o afs_setcred_krb.o core *~ AFS_component_version_number.c
+install: ${DESTDIR}${libdir}/pam_afs.so.1 ${DESTDIR}${libdir}/pam_afs.krb.so.1
-install: all
- ${INSTALL} -s pam_afs.so.1 ${DESTDIR}lib/pam_afs.so.1
- ${INSTALL} -s pam_afs.krb.so.1 ${DESTDIR}lib/pam_afs.krb.so.1
+${DEST}/lib/pam_afs.so.1: pam_afs.so.1
+ ${INSTALL} $? $@
+
+${DEST}/lib/pam_afs.krb.so.1: pam_afs.krb.so.1
+ ${INSTALL} $? $@
afs_auth.o: afs_auth.c afs_pam_msg.h afs_message.h afs_util.h
afs_pam_msg.o: afs_pam_msg.c afs_pam_msg.h afs_message.h
afs_message.o: afs_message.c afs_message.h
afs_util.o: afs_util.c afs_util.h
+
+#
+# Misc. targets
+#
+clean:
+ $(RM) -f *.a *.o *.so.1 test_pam core *~ AFS_component_version_number.c
+
+include ../config/Makefile.version
+
+${DESTDIR}${libdir}/pam_afs.so.1: pam_afs.so.1
+ ${INSTALL} $? $@
+
+${TOP_LIBDIR}/pam_afs.so.1: pam_afs.so.1
+ ${INSTALL} $? $@
+
+${DESTDIR}${libdir}/pam_afs.krb.so.1: pam_afs.krb.so.1
+ ${INSTALL} $? $@
+
+${TOP_LIBDIR}/pam_afs.krb.so.1: pam_afs.krb.so.1
+ ${INSTALL} $? $@
+
+dest: ${DEST}/lib/pam_afs.so.1 ${DEST}/lib/pam_afs.krb.so.1
+
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_auth.c,v 1.1.1.5 2001/07/14 22:23:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_auth.c,v 1.1.1.6 2001/09/11 14:34:00 hartmans Exp $");
#include <security/pam_appl.h>
#include <security/pam_modules.h>
#define RET(x) { retcode = (x); goto out; }
-
extern int
pam_sm_authenticate(
pam_handle_t *pamh,
int nowarn = 0;
int use_first_pass = 0;
int try_first_pass = 0;
- int ignore_root = 0;
- int trust_root = 0;
- int catch_su = 0;
+ int ignore_uid = 0;
+ uid_t ignore_uid_id = 0;
+ char my_password_buf[256];
+ /*
+ * these options are added to handle stupid apps, which won't call
+ * pam_set_cred()
+ */
+ int refresh_token = 0;
+ int set_token = 0;
+ int dont_fork = 0;
+ /* satisfy kdm 2.x
+ */
+ int use_klog = 0;
int set_expires = 0; /* This option is only used in pam_set_cred() */
int got_authtok = 0; /* got PAM_AUTHTOK upon entry */
int nouser = 0;
- char my_password_buf[256];
char *user = NULL, *password = NULL;
+ long password_expires = -1;
int torch_password = 1;
int i;
struct pam_conv *pam_convp = NULL;
#ifndef AFS_SUN56_ENV
- openlog(pam_afs_ident, LOG_CONS, LOG_AUTH);
+ openlog(pam_afs_ident, LOG_CONS|LOG_PID, LOG_AUTH);
#endif
origmask = setlogmask(logmask);
} else if (strcasecmp(argv[i], "try_first_pass") == 0) {
try_first_pass = 1;
} else if (strcasecmp(argv[i], "ignore_root" ) == 0) {
- ignore_root = 1;
- } else if (strcasecmp(argv[i], "trust_root" ) == 0) {
- trust_root = 1;
- } else if (strcasecmp(argv[i], "catch_su" ) == 0) {
- catch_su = 1;
+ ignore_uid = 1;
+ ignore_uid_id = 0;
+ } else if (strcasecmp(argv[i], "ignore_uid" ) == 0) {
+ i++;
+ if (i == argc) {
+ pam_afs_syslog(LOG_ERR, PAMAFS_IGNOREUID, "ignore_uid missing argument");
+ ignore_uid = 0;
+ } else {
+ ignore_uid = 1;
+ ignore_uid_id = (uid_t) strtol(argv[i], (char**)NULL, 10);
+ if ( (ignore_uid_id < 0) || (ignore_uid_id > IGNORE_MAX)) {
+ ignore_uid = 0;
+ pam_afs_syslog(LOG_ERR, PAMAFS_IGNOREUID, argv[i]);
+ }
+ }
+ } else if (strcasecmp(argv[i], "refresh_token" ) == 0) {
+ refresh_token = 1;
+ } else if (strcasecmp(argv[i], "set_token" ) == 0) {
+ set_token = 1;
+ } else if (strcasecmp(argv[i], "dont_fork" ) == 0) {
+ if (!use_klog) dont_fork = 1;
+ else pam_afs_syslog(LOG_ERR, PAMAFS_CONFLICTOPT, "dont_fork");
+ } else if (strcasecmp(argv[i], "use_klog" ) == 0) {
+ if (!dont_fork) use_klog = 1;
+ else pam_afs_syslog(LOG_ERR, PAMAFS_CONFLICTOPT, "use_klog");
} else if (strcasecmp(argv[i], "setenv_password_expires") == 0) {
set_expires = 1;
} else {
/* so turn that flag off right now. */
if (use_first_pass) try_first_pass = 0;
- pam_afs_syslog(LOG_DEBUG, PAMAFS_OPTIONS, nowarn, use_first_pass, try_first_pass);
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ pam_afs_syslog(LOG_DEBUG, PAMAFS_OPTIONS, nowarn, use_first_pass, try_first_pass, ignore_uid, ignore_uid_id, refresh_token, set_token, dont_fork, use_klog);
/* Try to get the user-interaction info, if available. */
- errcode = pam_get_item(pamh, PAM_CONV, (void **) &pam_convp);
+ errcode = pam_get_item(pamh, PAM_CONV, (const void **) &pam_convp);
if (errcode != PAM_SUCCESS) {
pam_afs_syslog(LOG_WARNING, PAMAFS_NO_USER_INT);
pam_convp = NULL;
}
/* Who are we trying to authenticate here? */
- if ((errcode = pam_get_user(pamh, &user, "login: ")) != PAM_SUCCESS) {
+ if ((errcode = pam_get_user(pamh, (const char **)&user, "login: ")) != PAM_SUCCESS) {
pam_afs_syslog(LOG_ERR, PAMAFS_NOUSER, errcode);
RET(PAM_USER_UNKNOWN);
}
- if ((!strncmp ("root", user, 4)) && trust_root) {
- pam_afs_syslog(LOG_INFO, PAMAFS_TRUSTROOT, user);
- RET(PAM_SUCCESS);
- }
-
- pam_afs_syslog(LOG_DEBUG, PAMAFS_USERNAMEDEBUG, user);
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ pam_afs_syslog(LOG_DEBUG, PAMAFS_USERNAMEDEBUG, user);
/*
* If the user has a "local" (or via nss, possibly nss_dce) pwent,
* and its uid==0, and "ignore_root" was given in pam.conf,
* ignore the user.
*/
+ /* enhanced: use "ignore_uid <number>" to specify the largest uid
+ * which should be ignored by this module
+ */
#if defined(AFS_HPUX_ENV)
#if defined(AFS_HPUX110_ENV)
i = getpwnam_r(user, &unix_pwd, upwd_buf, sizeof(upwd_buf), &upwd);
if ( i == 0 ) /* getpwnam_r success */
upwd = &unix_pwd;
#endif /* else AFS_HPUX110_ENV */
- if (ignore_root && i == 0 && upwd->pw_uid == 0) {
+ if (ignore_uid && i == 0 && upwd->pw_uid <= ignore_uid_id) {
pam_afs_syslog(LOG_INFO, PAMAFS_IGNORINGROOT, user);
RET(PAM_AUTH_ERR);
}
#else
-#ifdef AFS_LINUX20_ENV
+#if defined(AFS_LINUX20_ENV) || defined(AFS_FBSD_ENV)
upwd = getpwnam(user);
#else
upwd = getpwnam_r(user, &unix_pwd, upwd_buf, sizeof(upwd_buf));
#endif
- if (upwd != NULL && upwd->pw_uid == 0) {
- if (ignore_root) {
- pam_afs_syslog(LOG_INFO, PAMAFS_IGNORINGROOT, user);
- RET(PAM_AUTH_ERR);
- } else if (trust_root && !catch_su) {
- pam_afs_syslog(LOG_INFO, PAMAFS_TRUSTROOT, user);
- RET(PAM_SUCCESS);
- }
+ if (ignore_uid && upwd != NULL && upwd->pw_uid <= ignore_uid_id) {
+ pam_afs_syslog(LOG_INFO, PAMAFS_IGNORINGROOT, user);
+ RET(PAM_AUTH_ERR);
}
#endif
- errcode = pam_get_item(pamh, PAM_AUTHTOK, (void **) &password);
+ errcode = pam_get_item(pamh, PAM_AUTHTOK, (const void **) &password);
if (errcode != PAM_SUCCESS || password == NULL) {
if (use_first_pass) {
pam_afs_syslog(LOG_ERR, PAMAFS_PASSWD_REQ, user);
RET(PAM_AUTH_ERR);
}
password = NULL; /* In case it isn't already NULL */
- pam_afs_syslog(LOG_DEBUG, PAMAFS_NOFIRSTPASS, user);
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ pam_afs_syslog(LOG_DEBUG, PAMAFS_NOFIRSTPASS, user);
} else if (password[0] == '\0') {
/* Actually we *did* get one but it was empty. */
torch_password = 0;
pam_afs_syslog(LOG_INFO, PAMAFS_NILPASSWORD, user);
RET(PAM_NEW_AUTHTOK_REQD);
} else {
- pam_afs_syslog(LOG_DEBUG, PAMAFS_GOTPASS, user);
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ pam_afs_syslog(LOG_DEBUG, PAMAFS_GOTPASS, user);
torch_password = 0;
got_authtok = 1;
}
* this storage, copy it to a buffer that won't need to be freed
* later, and free this storage now.
*/
+
strncpy(my_password_buf, password, sizeof(my_password_buf));
my_password_buf[sizeof(my_password_buf)-1] = '\0';
memset(password, 0, strlen(password));
free(password);
password = my_password_buf;
+ }
+ /* Be sure to allocate a PAG here if we should set a token,
+ * All of the remaining stuff to authenticate the user and to
+ * get a token is done in a child process - if not suppressed by the config,
+ * see below
+ * But dont get a PAG if the refresh_token option was set
+ * We have to do this in such a way because some
+ * apps (such as screensavers) wont call setcred but authenticate :-(
+ */
+ if (!refresh_token) {
+ setpag();
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ syslog(LOG_DEBUG, "New PAG created in pam_authenticate()");
}
+ if (!dont_fork) {
/* Prepare for fork(): set SIGCHLD signal handler to default */
sigemptyset(&newAction.sa_mask);
newAction.sa_handler = SIG_DFL;
* memory/sockets allocated will get cleaned up when the child
* exits: defect 11686.
*/
+ if (use_klog) { /* used by kdm 2.x */
+ if (refresh_token || set_token) {
+ i = do_klog(user, password, NULL);
+ } else {
+ i = do_klog(user, password, "00:00:01");
+ ktc_ForgetAllTokens();
+ }
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ syslog(LOG_DEBUG, "do_klog returned %d", i);
+ auth_ok = i ? 0 : 1;
+ } else {
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ syslog(LOG_DEBUG, "forking ...");
cpid = fork();
if (cpid <= 0) { /* The child process */
- code = ka_VerifyUserPassword(KA_USERAUTH_VERSION + KA_USERAUTH_DOSETPAG,
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ syslog(LOG_DEBUG, "in child");
+ if (refresh_token || set_token)
+ code = ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION,
+ user, /* kerberos name */
+ (char *)0, /* instance */
+ (char *)0, /* realm */
+ password, /* password */
+ 0, /* default lifetime */
+ &password_expires,
+ 0, /* spare 2 */
+ &reason /* error string */ );
+ else
+ code = ka_VerifyUserPassword(KA_USERAUTH_VERSION,
user, /* kerberos name */
(char *)0, /* instance */
(char *)0, /* realm */
} else {
auth_ok = 1;
}
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ syslog(LOG_DEBUG, "child: auth_ok=%d", auth_ok);
if (cpid == 0) exit(auth_ok);
} else {
do {
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ syslog(LOG_DEBUG, "in parent, waiting ...");
rcpid = waitpid(cpid, &status, 0);
} while ((rcpid == -1) && (errno == EINTR));
} else {
auth_ok = 0;
}
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ syslog(LOG_DEBUG, "parent: auth_ok=%d", auth_ok);
+ }
}
-
/* Restore old signal handler */
code = sigaction(SIGCHLD, &origAction, (struct sigaction *)0);
if (code) {
pam_afs_syslog(LOG_ERR, PAMAFS_PAMERROR, errno);
}
+ } else { /* dont_fork, used by httpd */
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ syslog(LOG_DEBUG, "dont_fork");
+ if (refresh_token || set_token)
+ code = ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION,
+ user, /* kerberos name */
+ (char *)0, /* instance */
+ (char *)0, /* realm */
+ password, /* password */
+ 0, /* default lifetime */
+ &password_expires,
+ 0, /* spare 2 */
+ &reason /* error string */ );
+ else
+ code = ka_VerifyUserPassword(KA_USERAUTH_VERSION,
+ user, /* kerberos name */
+ (char *)0, /* instance */
+ (char *)0, /* realm */
+ password, /* password */
+ 0, /* spare 2 */
+ &reason /* error string */ );
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ syslog(LOG_DEBUG, "dont_fork, code = %d",code);
+ if (code) {
+ pam_afs_syslog(LOG_ERR, PAMAFS_LOGIN_FAILED, user, reason);
+ auth_ok = 0;
+ } else {
+ auth_ok = 1;
+ }
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ syslog(LOG_DEBUG, "dont_fork: auth_ok=%d", auth_ok);
+ }
if (!auth_ok && try_first_pass) {
password = NULL;
}
/* We don't care if this fails; all we can do is try. */
- if (auth_ok && !got_authtok) {
+ /* It is not reasonable to store the password only if it was correct
+ * because it could satisfy another module that is called in the chain
+ * after pam_afs
+ */
+ if (!got_authtok) {
torch_password = 0;
- pam_set_item(pamh, PAM_AUTHTOK, password);
+ (void) pam_set_item(pamh, PAM_AUTHTOK, password);
}
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ syslog(LOG_DEBUG, "leaving auth: auth_ok=%d", auth_ok);
+ if (code == KANOENT) RET(PAM_USER_UNKNOWN);
RET(auth_ok ? PAM_SUCCESS : PAM_AUTH_ERR);
out:
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_message.c,v 1.1.1.5 2001/07/14 22:23:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_message.c,v 1.1.1.6 2001/09/11 14:34:00 hartmans Exp $");
#include <sys/param.h>
#include <afs/kautils.h>
"AFS not available", /* 10: AFS_UNAVAIL */
"AFS error code 0x%x", /* 11: AFS_ERROR */
"AFS Authentication succeeded.\n", /* 12: LOGIN_OK */
- "AFS Authentication failed for user %s %s\n",
+ "AFS Authentication failed for user %s. %s\n",
/* 13: LOGIN_FAILED */
"AFS PAM error, code=%d", /* 14: PAMERROR */
"AFS uid exceeds OS bounds.\n", /* 15: UID_OVERFLOW */
"The AFS PAM module may not be used from a non-MT program.\n",
/* 16: NON_MT_PROG */
- "AFS Options: nowarn=%d, use_first_pass=%d, try_first_pass=%d",
+ "AFS Options: nowarn=%d, use_first_pass=%d, try_first_pass=%d, ignore_uid = %d, ignore_uid_id = %d, refresh_token=%d, set_token=%d, dont_fork=%d, use_klog=%d",
/* 17: OPTIONS */
"AFS No pam_conv conversation structure found; no user interaction",
/* 18: NO_USER_INT */
"AFS ReInitializing creds for user %s\n", /* 31: REINITCRED */
"AFS Failed to set PASSWORD_EXPIRES for user %s\n",
/* 32: PASSEXPFAIL */
- "",
- /* 33: */
- "",
- /* 34: */
- "AFS blindly trusting user %s\n", /* 35: TRUSTROOT */
- "New AFS Password: ", /* 36: NEW_PWD_PROMPT */
- "New AFS Password (again): ", /* 37: VERIFY_PWD_PROMPT */
- "Failed to change AFS password", /* 38: KRBPASS_FAIL */
- "Missing PAM flag: %s", /* 39: FLAGS */
- "ka error, code=%d", /* 40: KAERROR */
- "Passwords are not equal" /* 41: NE_PASSWORD */
+ "AFS Failed to chown krb ticketfile\n", /* 33: CHOWNKRB */
+ "AFS Failed to set KRBTKTFILE\n", /* 34: KRBFAIL */
+ "AFS Unknown remaining lifetime %s using default %d seconds\n",
+ /* 35: REMAINLIFETIME */
+ "AFS Session closed", /* 36: SESSIONCLOSED1 */
+ "AFS Session closed, Tokens destroyed\n", /* 37: SESSIONCLOSED2 */
+ "AFS Option conflict dont_fork and use_klog: %s\n",
+ /* 38: CONFLICTOPT */
+ "AFS Unknown uid: %s, option ignored\n",
+ /* 39: IGNOREUID */
+ "New AFS Password: ", /* 40: NEW_PWD_PROMPT */
+ "New AFS Password (again): ", /* 41: VERIFY_PWD_PROMPT */
+ "Failed to change AFS password", /* 42: KRBPASS_FAIL */
+ "Missing PAM flag: %s", /* 43: FLAGS */
+ "ka error, code=%d", /* 44: KAERROR */
+ "Passwords are not equal", /* 45: NE_PASSWORD */
+ "AFS ignoring unregistered user %s\n" /* 46: IGNORE_UNREG */
};
static int num_fallbacks = sizeof(fallback_messages)/sizeof(char *);
#define PAMAFS_PASSEXPFAIL 32 /* "Failed to set PASSWORD_EXPIRES" */
#define PAMAFS_CHOWNKRB 33 /* "Failed to chown krb ticketfile" */
#define PAMAFS_KRBFAIL 34 /* "Failed to set KRBTKTFILE" */
-#define PAMAFS_TRUSTROOT 35 /* "Ignoring superuser %s" */
-#define PAMAFS_NEW_PWD_PROMPT 36 /* "New AFS Password:" */
-#define PAMAFS_VERIFY_PWD_PROMPT 37 /* "New AFS Password (again):" */
-#define PAMAFS_KAPASS_FAIL 38 /* "Failed to change AFS password" */
-#define PAMAFS_FLAGS 39 /* "Missing PAM flag:" */
-#define PAMAFS_KAERROR 40 /* "ka error, code=%d" */
-#define PAMAFS_NE_PASSWORD 41 /* "Passwords are not equal" */
+#define PAMAFS_REMAINLIFETIME 35 /* "Unknown remaining lifetime" */
+#define PAMAFS_SESSIONCLOSED1 36 /* "Session closed" */
+#define PAMAFS_SESSIONCLOSED2 37 /* "Session closed, Tokens destroyed"*/
+#define PAMAFS_CONFLICTOPT 38 /* "Option conflict" */
+#define PAMAFS_IGNOREUID 39 /* "Unknown uid" */
+#define PAMAFS_NEW_PWD_PROMPT 40 /* "New AFS Password:" */
+#define PAMAFS_VERIFY_PWD_PROMPT 41 /* "New AFS Password (again):" */
+#define PAMAFS_KAPASS_FAIL 42 /* "Failed to change AFS password" */
+#define PAMAFS_FLAGS 43 /* "Missing PAM flag:" */
+#define PAMAFS_KAERROR 44 /* "ka error, code=%d" */
+#define PAMAFS_NE_PASSWORD 45 /* "Passwords are not equal" */
+#define PAMAFS_IGNORE_UNREG 46 /* "AFS ignoring unregistered user" */
+
char *pam_afs_message(int msgnum, int *freeit);
void pam_afs_syslog(int priority, int msgid, ...);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_password.c,v 1.1.1.5 2001/07/14 22:23:12 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_password.c,v 1.1.1.6 2001/09/11 14:34:01 hartmans Exp $");
#include <sys/param.h>
#include <afs/kautils.h>
if (use_first_pass) try_first_pass = 0;
- pam_afs_syslog(LOG_DEBUG, PAMAFS_OPTIONS, nowarn, use_first_pass, try_first_pass);
- pam_afs_syslog(LOG_DEBUG, PAMAFS_PAMERROR, flags);
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ {
+ pam_afs_syslog(LOG_DEBUG, PAMAFS_OPTIONS, nowarn, use_first_pass, try_first_pass);
+ pam_afs_syslog(LOG_DEBUG, PAMAFS_PAMERROR, flags);
+ }
/* Try to get the user-interaction info, if available. */
errcode = pam_get_item(pamh, PAM_CONV, (const void **) &pam_convp);
RET(PAM_USER_UNKNOWN);
}
- pam_afs_syslog(LOG_DEBUG, PAMAFS_USERNAMEDEBUG, user);
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ pam_afs_syslog(LOG_DEBUG, PAMAFS_USERNAMEDEBUG, user);
/*
* If the user has a "local" (or via nss, possibly nss_dce) pwent,
RET(PAM_AUTH_ERR);
}
#else
-#ifdef AFS_LINUX20_ENV
+#if defined(AFS_LINUX20_ENV) || defined(AFS_FBSD_ENV)
upwd = getpwnam(user);
#else
upwd = getpwnam_r(user, &unix_pwd, upwd_buf, sizeof(upwd_buf));
RET(PAM_AUTH_ERR);
}
password = NULL; /* In case it isn't already NULL */
- pam_afs_syslog(LOG_DEBUG, PAMAFS_NOFIRSTPASS, user);
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ pam_afs_syslog(LOG_DEBUG, PAMAFS_NOFIRSTPASS, user);
} else if (password[0] == '\0') {
/* Actually we *did* get one but it was empty. */
torch_password = 0;
pam_afs_syslog(LOG_INFO, PAMAFS_NILPASSWORD, user);
RET(PAM_NEW_AUTHTOK_REQD);
} else {
+ if (logmask && LOG_MASK(LOG_DEBUG))
pam_afs_syslog(LOG_DEBUG, PAMAFS_GOTPASS, user);
torch_password = 0;
got_authtok = 1;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_session.c,v 1.1.1.4 2001/07/14 22:23:12 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_session.c,v 1.1.1.5 2001/09/11 14:34:01 hartmans Exp $");
#include <security/pam_appl.h>
#include <security/pam_modules.h>
+#include <syslog.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include "afs_message.h"
+#include "afs_util.h"
extern int
pam_sm_open_session(
}
+#define REMAINLIFETIME 300
+
extern int
pam_sm_close_session(
pam_handle_t *pamh,
int argc,
const char **argv)
{
+ int i;
+ int logmask = LOG_UPTO(LOG_INFO);
+ int origmask;
+ int remain = 0;
+ int remainlifetime = REMAINLIFETIME;
+ int no_unlog = 0;
+
+ openlog(pam_afs_ident, LOG_CONS|LOG_PID, LOG_AUTH);
+ origmask = setlogmask(logmask);
+
+ /*
+ * Parse the user options. Log an error for any unknown options.
+ */
+ for (i = 0; i < argc; i++) {
+ if ( strcasecmp(argv[i], "debug" ) == 0) {
+ logmask |= LOG_MASK(LOG_DEBUG);
+ (void) setlogmask(logmask);
+ } else if (strcasecmp(argv[i], "remain" ) == 0) {
+ remain = 1;
+ } else if (strcasecmp(argv[i], "remainlifetime") == 0) {
+ i++;
+ remain = 1;
+ remainlifetime = (int) strtol(argv[i], (char**)NULL, 10);
+ if (remainlifetime == 0)
+ if((errno == EINVAL) || (errno == ERANGE)) {
+ remainlifetime = REMAINLIFETIME;
+ pam_afs_syslog(LOG_ERR, PAMAFS_REMAINLIFETIME, argv[i], REMAINLIFETIME);
+ } else {
+ no_unlog = 0;
+ remain = 0;
+ }
+ } else if (strcmp(argv[i], "no_unlog") == 0) {
+ no_unlog = 1;
+ } else {
+ pam_afs_syslog(LOG_ERR, PAMAFS_UNKNOWNOPT, argv[i]);
+ }
+ }
+
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ syslog(LOG_DEBUG, "pam_afs_session_close: remain: %d, remainlifetime: %d, no_unlog: %d",remain,remainlifetime,no_unlog);
+ if(remain && !no_unlog) {
+ switch (fork()) {
+ case -1 : /* error */
+ return(PAM_SESSION_ERR);
+ case 0 : /* child */
+#ifdef AFS_LINUX20_ENV
+ setpgrp();
+#endif
+ setsid();
+ for (i = 0; i <64; i++) close (i);
+ sleep(remainlifetime);
+ ktc_ForgetAllTokens();
+ pam_afs_syslog(LOG_INFO, PAMAFS_SESSIONCLOSED2);
+ exit(0);
+ default : /* parent */
+ pam_afs_syslog(LOG_INFO, PAMAFS_SESSIONCLOSED1);
+ return(PAM_SUCCESS);
+ }
+ }
+ if (!no_unlog && ktc_ForgetAllTokens())
+ return PAM_SESSION_ERR;
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ syslog(LOG_DEBUG, "pam_afs_session_close: Session closed");
return PAM_SUCCESS;
}
#include <string.h>
#include <pwd.h>
#include <unistd.h>
+#include <errno.h>
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_setcred.c,v 1.1.1.5 2001/07/14 22:23:12 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_setcred.c,v 1.1.1.6 2001/09/11 14:34:01 hartmans Exp $");
#include <sys/param.h>
#include <afs/kautils.h>
int origmask;
int logmask = LOG_UPTO(LOG_INFO);
int nowarn = 0;
- int use_first_pass = 1; /* use the password passed in by auth */
+ int use_first_pass = 0; /* use the password passed in by auth */
int try_first_pass = 0;
int got_authtok = 0;
- int ignore_root = 0;
- int trust_root = 0;
+ int ignore_uid = 0;
+ int no_unlog = 0;
+ uid_t ignore_uid_id = 0;
+ int refresh_token = 0;
int set_expires = 0; /* the default is to not to set the env variable */
+ int use_klog = 0;
int i;
struct pam_conv *pam_convp = NULL;
char my_password_buf[256];
} else if (strcasecmp(argv[i], "try_first_pass") == 0) {
try_first_pass = 1;
} else if (strcasecmp(argv[i], "ignore_root" ) == 0) {
- ignore_root = 1;
- } else if (strcasecmp(argv[i], "trust_root" ) == 0) {
- trust_root = 1;
- } else if (strcasecmp(argv[i], "catch_su" ) == 0) {
- use_first_pass = 0;
+ ignore_uid = 1;
+ ignore_uid_id = 0;
+ } else if (strcasecmp(argv[i], "ignore_uid" ) == 0) {
+ i++;
+ if (i == argc) {
+ pam_afs_syslog(LOG_ERR, PAMAFS_IGNOREUID, "ignore_uid missing argument");
+ ignore_uid = 0;
+ } else {
+ ignore_uid = 1;
+ ignore_uid_id = (uid_t) strtol(argv[i], (char**)NULL, 10);
+ if ( (0 > ignore_uid_id) || (ignore_uid_id > IGNORE_MAX) ) {
+ ignore_uid = 0;
+ pam_afs_syslog(LOG_ERR, PAMAFS_IGNOREUID, argv[i]);
+ }
+ }
+ } else if (strcasecmp(argv[i], "no_unlog") == 0) {
+ no_unlog = 1;
+ } else if (strcasecmp(argv[i], "refresh_token" ) == 0) {
+ refresh_token = 1;
+ } else if (strcasecmp(argv[i], "set_token" ) == 0) {
+ ;
+ } else if (strcasecmp(argv[i], "dont_fork" ) == 0) {
+ ;
+ } else if (strcasecmp(argv[i], "use_klog" ) == 0) {
+ use_klog = 1;
} else if (strcasecmp(argv[i], "setenv_password_expires")==0) {
set_expires = 1;
} else {
if (use_first_pass) try_first_pass = 0;
- pam_afs_syslog(LOG_DEBUG, PAMAFS_OPTIONS, nowarn, use_first_pass, try_first_pass);
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ pam_afs_syslog(LOG_DEBUG, PAMAFS_OPTIONS, nowarn, use_first_pass, try_first_pass, ignore_uid, ignore_uid_id, 8, 8, 8, 8);
/* Try to get the user-interaction info, if available. */
- errcode = pam_get_item(pamh, PAM_CONV, (void **) &pam_convp);
+ errcode = pam_get_item(pamh, PAM_CONV, (const void **) &pam_convp);
if (errcode != PAM_SUCCESS) {
+ if (logmask && LOG_MASK(LOG_DEBUG))
pam_afs_syslog(LOG_DEBUG, PAMAFS_NO_USER_INT);
pam_convp = NULL;
}
/* Who are we trying to authenticate here? */
- if ((errcode = pam_get_user(pamh, &user, "AFS username:")) != PAM_SUCCESS) {
+ if ((errcode = pam_get_user(pamh, (const char **)&user, "AFS username:")) != PAM_SUCCESS) {
pam_afs_syslog(LOG_ERR, PAMAFS_NOUSER, errcode);
RET(PAM_USER_UNKNOWN);
}
* and its uid==0, and "ignore_root" was given in pam.conf,
* ignore the user.
*/
+ /* enhanced: use "ignore_uid <number>" to specify the largest uid
+ * which should be ignored by this module
+ */
#if defined(AFS_HPUX_ENV)
#if defined(AFS_HPUX110_ENV)
i = getpwnam_r(user, &unix_pwd, upwd_buf, sizeof(upwd_buf), &upwd);
if ( i == 0 ) /* getpwnam_r success */
upwd = &unix_pwd;
#endif /* AFS_HPUX110_ENV */
- if (ignore_root && i == 0 && upwd->pw_uid == 0) {
+ if (ignore_uid && i == 0 && upwd->pw_uid <= ignore_uid_id) {
pam_afs_syslog(LOG_INFO, PAMAFS_IGNORINGROOT, user);
RET(PAM_AUTH_ERR);
}
#else
-#ifdef AFS_LINUX20_ENV
+#if defined(AFS_LINUX20_ENV) || defined(AFS_FBSD_ENV)
upwd = getpwnam(user);
#else
upwd = getpwnam_r(user, &unix_pwd, upwd_buf, sizeof(upwd_buf));
#endif
- if (upwd != NULL && upwd->pw_uid == 0) {
- if (ignore_root) {
+ if (ignore_uid && upwd != NULL && upwd->pw_uid <= ignore_uid_id) {
pam_afs_syslog(LOG_INFO, PAMAFS_IGNORINGROOT, user);
RET(PAM_AUTH_ERR);
- } else if (trust_root) {
- pam_afs_syslog(LOG_INFO, PAMAFS_TRUSTROOT, user);
- RET(PAM_SUCCESS);
- }
}
#endif
if (flags & PAM_DELETE_CRED) {
+ if (logmask && LOG_MASK(LOG_DEBUG))
pam_afs_syslog(LOG_DEBUG, PAMAFS_DELCRED, user);
RET(PAM_SUCCESS);
} else if (flags & PAM_REINITIALIZE_CRED) {
+ if (logmask && LOG_MASK(LOG_DEBUG))
pam_afs_syslog(LOG_DEBUG, PAMAFS_REINITCRED, user);
RET(PAM_SUCCESS);
} else { /* flags are PAM_REFRESH_CRED, PAM_ESTABLISH_CRED, unknown */
+ if (logmask && LOG_MASK(LOG_DEBUG))
pam_afs_syslog(LOG_DEBUG, PAMAFS_ESTABCRED, user);
errcode = pam_get_data(pamh, pam_afs_lh, (const void **) &password);
RET(PAM_AUTH_ERR);
}
password = NULL; /* In case it isn't already NULL */
- pam_afs_syslog(LOG_DEBUG, PAMAFS_NOFIRSTPASS, user);
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ pam_afs_syslog(LOG_DEBUG, PAMAFS_NOFIRSTPASS, user);
} else if (password[0] == '\0') {
/* Actually we *did* get one but it was empty. */
got_authtok = 1;
pam_afs_syslog(LOG_ERR, PAMAFS_PASSWD_REQ, user);
RET(PAM_NEW_AUTHTOK_REQD);
}
- pam_afs_syslog(LOG_DEBUG, PAMAFS_NILPASSWORD, user);
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ pam_afs_syslog(LOG_DEBUG, PAMAFS_NILPASSWORD, user);
} else {
+ if (logmask && LOG_MASK(LOG_DEBUG))
pam_afs_syslog(LOG_DEBUG, PAMAFS_GOTPASS, user);
torch_password = 0;
got_authtok = 1;
RET(PAM_AUTH_ERR);
}
if (password[0] == '\0') {
+ if (logmask && LOG_MASK(LOG_DEBUG))
pam_afs_syslog(LOG_DEBUG, PAMAFS_NILPASSWORD);
RET(PAM_NEW_AUTHTOK_REQD);
}
* this storage, copy it to a buffer that won't need to be freed
* later, and free this storage now.
*/
+
strncpy(my_password_buf, password, sizeof(my_password_buf));
my_password_buf[sizeof(my_password_buf)-1] = '\0';
memset(password, 0, strlen(password));
free(password);
password = my_password_buf;
}
+ /*
+ * We only set a PAG here, if we haven't got one before in
+ * pam_sm_authenticate() or if it was destroyed by the application
+ */
+ if ((!refresh_token) && (getPAG() == -1)) {
+ if (logmask && LOG_MASK(LOG_DEBUG))
+ syslog(LOG_DEBUG, "New PAG created in pam_setcred()");
+ setpag();
+ }
if ( flags & PAM_REFRESH_CRED ) {
+ if (use_klog) {
+ auth_ok = do_klog(user, password, "00:00:01");
+ ktc_ForgetAllTokens();
+ } else {
if ( ka_VerifyUserPassword(
- KA_USERAUTH_VERSION + KA_USERAUTH_DOSETPAG,
+ KA_USERAUTH_VERSION,
user, /* kerberos name */
(char *)0, /* instance */
(char *)0, /* realm */
auth_ok = 1;
}
}
+ }
if ( flags & PAM_ESTABLISH_CRED ) {
+ if (use_klog) auth_ok = do_klog(user, password, NULL);
+ else {
if ( ka_UserAuthenticateGeneral(
- KA_USERAUTH_VERSION + KA_USERAUTH_DOSETPAG,
+ KA_USERAUTH_VERSION,
user, /* kerberos name */
(char *)0, /* instance */
(char *)0, /* realm */
auth_ok = 1;
}
}
+ }
if (!auth_ok && try_first_pass) {
password = NULL;
goto try_auth;
}
- if (auth_ok && !got_authtok) {
- torch_password = 0;
- (void) pam_set_item(pamh, PAM_AUTHTOK, password);
- }
+ /* pam_sm_authenticate should have set this
+ * if (auth_ok && !got_authtok) {
+ * torch_password = 0;
+ * (void) pam_set_item(pamh, PAM_AUTHTOK, password);
+ * }
+ */
if (auth_ok) {
- if (set_expires && (password_expires >= 0) ) {
+ if (set_expires && !use_klog && (password_expires >= 0) ) {
strcpy(sbuffer, "PASSWORD_EXPIRES=");
strcat(sbuffer, cv2string(&sbuffer[100], password_expires));
errcode = pam_putenv( pamh, sbuffer);
pam_afs_syslog(LOG_ERR, PAMAFS_PASSEXPFAIL, user);
}
#if defined(AFS_KERBEROS_ENV)
- if (upwd)
- {
+ 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);
sprintf(sbuffer, "KRBTKFILE=%s", ktc_tkt_string());
errcode = pam_putenv( pamh, sbuffer);
if ( errcode != PAM_SUCCESS )
pam_afs_syslog(LOG_ERR, PAMAFS_KRBFAIL, user);
+ }
}
#endif
#include <stdio.h>
#include <assert.h>
+#include <unistd.h>
+#include <errno.h>
+#include <syslog.h>
#include <security/pam_appl.h>
#include <afsconfig.h>
#include <afs/param.h>
+#include <sys/wait.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_util.c,v 1.1.1.4 2001/07/14 22:23:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_util.c,v 1.1.1.5 2001/09/11 14:34:02 hartmans Exp $");
#include "afs_util.h"
#if !defined(AFS_HPUX110_ENV)
/* For HP 11.0, this function is in util/hputil.c */
-sigvec()
+sigvec(int sig, const struct sigvec* vec, struct sigvec* ovec)
{
assert(0);
}
#endif /* AFS_HPUX110_ENV */
-sigsetmask()
+sigsetmask(int mask)
{
assert(0);
}
return tp;
}
+int do_klog(const char* user, const char* password, const char* lifetime)
+{
+pid_t pid;
+int pipedes[2];
+int status;
+char* argv[32];
+int argc = 0;
+char* klog_prog;
+int ret = 1;
+
+#if defined(AFS_KERBEROS_ENV)
+ klog_prog = KLOGKRB;
+#else
+ klog_prog = KLOG;
+#endif
+ if (access(klog_prog, X_OK) != 0) {
+ syslog(LOG_ERR, "can not access klog program '%s'", KLOG);
+ goto out;
+ }
+#if defined(AFS_KERBEROS_ENV)
+ argv[argc++] = "klog.krb";
+
+#else
+ argv[argc++] = "klog";
+#endif
+ argv[argc++] = (char*)user;
+ argv[argc++] = "-silent";
+ argv[argc++] = "-pipe";
+ if (lifetime != NULL) {
+ argv[argc++] = "-lifetime";
+ argv[argc++] = (char*)lifetime;
+ }
+ argv[argc] = NULL;
+
+ if (pipe(pipedes) != 0) {
+ syslog(LOG_ERR, "can not open pipe: %s", strerror(errno));
+ goto out;
+ }
+ pid = fork();
+ switch(pid) {
+ case (-1): /* Error: fork failed */
+ syslog(LOG_ERR, "fork failed: %s", strerror(errno));
+ goto out;
+ case (0) : /* child */
+ close(0);
+ dup(pipedes[0]);
+ close(pipedes[0]);
+ close(1);
+ dup(pipedes[1]);
+ close(pipedes[1]);
+ execv(klog_prog, argv);
+ /* notreached */
+ syslog(LOG_ERR, "execv failed: %s", strerror(errno));
+ close(0);
+ close(1);
+ goto out;
+ default :
+ write(pipedes[1], password, strlen(password));
+ write(pipedes[1], "\n", 1);
+ close(pipedes[0]);
+ close(pipedes[1]);
+ if (pid != wait(&status)) return(0);
+ if (WIFEXITED(status)) {
+ ret = WEXITSTATUS(status);
+ goto out;
+ }
+ syslog(LOG_NOTICE, "%s for %s failed", klog_prog, user) ;
+ }
+out:
+ /* syslog(LOG_DEBUG, "do_klog returns %d", ret); */
+ return(ret);
+}
+
+/* get the current AFS pag for the calling process */
+static afs_int32 curpag()
+{
+ gid_t groups[30];
+ afs_uint32 g0, g1;
+ afs_uint32 h, l, ret;
+
+ if (getgroups(sizeof groups/sizeof groups[0], groups) < 2) return 0;
+
+ g0 = groups[0] & 0xffff;
+ g1 = groups[1] & 0xffff;
+ g0 -= 0x3f00;
+ g1 -= 0x3f00;
+ if (g0 < 0xc000 && g1 < 0xc000) {
+ l = ((g0 & 0x3fff) << 14) | (g1 & 0x3fff);
+ h = (g0 >> 14);
+ h = (g1 >> 14) + h + h + h;
+ ret = ((h << 28) | l);
+ /* Additional testing */
+ if (((ret >> 24) & 0xff) == 'A')
+ return ret;
+ else
+ return -1;
+ }
+ return -1;
+}
+
+/* Returns the AFS pag number, if any, otherwise return -1 */
+afs_int32 getPAG()
+{
+ afs_int32 pag;
+
+ pag = curpag();
+ if (pag == 0 || pag == -1)
+ return -1;
+
+ /* high order byte is always 'A'; actual pag value is low 24 bits */
+ return (pag & 0xFFFFFF);
+}
extern char* cv2string();
+#define KLOG "/usr/afsws/bin/klog"
+#define KLOGKRB "/usr/afsws/bin/klog.krb"
+#define UNLOG "/usr/afsws/bin/unlog"
+#define IGNORE_MAX 1000
+
#if defined(AFS_HPUX_ENV)
#if !defined(AFS_HPUX110_ENV)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/pam/test_pam.c,v 1.1.1.5 2001/07/14 22:23:13 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/pam/test_pam.c,v 1.1.1.6 2001/09/11 14:34:02 hartmans Exp $");
#include <stdio.h>
#include <security/pam_appl.h>
int authenticated = 0;
int retcode;
char *username;
+ int setcred = 1;
if (argc < 2 || argc > 3) {
fprintf(stderr, "Usage: %s [-u] <user>\n", argv[0]);
fprintf(stderr, "Usage: %s [-u] <user>\n", argv[0]);
exit(1);
}
- service = "unixtest";
+ /* service = "unixtest"; */
+ setcred = 0;
username = argv[2];
} else {
username = argv[1];
/* pam_open_session */
+ if (setcred)
if ((retcode = pam_setcred(pamh, PAM_ESTABLISH_CRED)) != PAM_SUCCESS) {
fprintf(stderr, "pam_setcred returned %d.\n", retcode);
pam_end(pamh, PAM_ABORT);
exit(1);
}
+ if ((retcode = pam_open_session(pamh, PAM_SILENT)) != PAM_SUCCESS) {
+ fprintf(stderr, "pam_open_session returned %d.\n", retcode);
+ pam_end(pamh, PAM_ABORT);
+ exit(1);
+ }
pam_end(pamh, PAM_SUCCESS);
putenv(new_envstring);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/pinstall/install.c,v 1.1.1.5 2001/07/14 22:23:13 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/pinstall/install.c,v 1.1.1.6 2001/09/11 14:34:03 hartmans Exp $");
#include <stdio.h>
#include <pwd.h>
int stripcalled = 0;
#endif
-#ifndef rindex
-extern char *rindex(); /* this should always be defined, shouldn't it? */
-#endif
-
#if defined(AFS_HPUX_ENV) && !defined(AFS_HPUX102_ENV)
utimes(file,tvp)
char *file;
char sets[256];
int i;
- bzero (sets, sizeof(sets));
+ memset(sets, 0, sizeof(sets));
while (*set) sets[(int) *set++] = 1;
i = strlen (s);
while (i > 0) if (sets[(int)s[--i]]) return &s[i];
int
stripName(aname)
char *aname;
- {if (rindex(aname, '.') == 0) return 1;
+ {if (strrchr(aname, '.') == 0) return 1;
else return 0;
}
for (i=0;i<fptr;i++)
{/* figure out name to put as entry name for file */
- tp = rindex(fnames[i], '/');
+ tp = strrchr(fnames[i], '/');
if (tp) newNames[i] = tp+1;
else newNames[i] = fnames[i];
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/db_verify.c,v 1.1.1.5 2001/07/14 22:23:16 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/db_verify.c,v 1.1.1.6 2001/09/11 14:34:06 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
id = ntohl(e.id);
if ( ((ntohl(e.flags) & (PRGRP | PRINST)) == 0) &&
- (index(e.name,'@')) ) {
+ (strchr(e.name,'@')) ) {
/* Foreign user */
if (id > misc->maxForId) misc->maxForId = id;
} else {
if (code) return code;
code = WalkNextChain (map, misc, ea, &e);
if (code) return code;
- if (index(e.name,'@') == 0) {
+ if (strchr(e.name,'@') == 0) {
misc->nusers++; /* Not a foreign user */
} else {
misc->nforeigns++; /* A foreign user */
rc = misc->recreate;
idmap = misc->idmap;
- bzero (idmap, misc->idRange*sizeof(misc->idmap[0]));
+ memset(idmap, 0, misc->idRange*sizeof(misc->idmap[0]));
do {
found = 0;
for (ei=createLow; ei<misc->nEntries; ei++) {
if (misc->verbose)
printf ("Database has %d entries\n", n);
map = (char *)malloc (n);
- bzero (map, n);
+ memset(map, 0, n);
misc->nEntries = n;
if (misc->verbose) {
code = -1;
goto abort;
}
- bzero (misc->idmap, misc->idRange*sizeof(misc->idmap[0]));
+ memset(misc->idmap, 0, misc->idRange*sizeof(misc->idmap[0]));
if (misc->verbose) {
printf ("\nChecking entry chains\n");
initialize_u_error_table();
pr_dbaseName = AFSDIR_SERVER_PRDB_FILEPATH;
- bzero (&misc, sizeof(misc));
+ memset(&misc, 0, sizeof(misc));
pr_dbaseName = as->parms[0].items->data; /* -database */
misc.listuheader = (as->parms[1].items ? 1 : 0); /* -uheader */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptclient.c,v 1.1.1.4 2001/07/14 22:23:17 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptclient.c,v 1.1.1.5 2001/09/11 14:34:06 hartmans Exp $");
#ifdef AFS_AIX32_ENV
#include <signal.h>
else printf("location %d\n",pos);
}
else if (!strcmp(op,"du")) {
- bzero(&entry,sizeof(entry));
+ memset(&entry, 0, sizeof(entry));
/* scanf("%d",&pos); */
if (GetInt32 (&pos)) code = PRBADARG;
else code = ubik_Call(PR_DumpEntry, pruclient, 0, pos, &entry);
else if (!strcmp(op,"fih")) {
char tname[128];
struct PrUpdateEntry uentry;
- bzero(&uentry, sizeof(uentry));
+ memset(&uentry, 0, sizeof(uentry));
/* scanf("%s",name); */
if (GetString (name, sizeof(name))) {
code = PRBADARG;
else if (!strcmp(op,"fnh")) {
int tid;
struct PrUpdateEntry uentry;
- bzero(&uentry, sizeof(uentry));
+ memset(&uentry, 0, sizeof(uentry));
/* scanf("%d", &id); */
if (GetInt32 (&id)) {
code = PRBADARG;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptprocs.c,v 1.1.1.5 2001/07/14 22:23:18 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptprocs.c,v 1.1.1.6 2001/09/11 14:34:07 hartmans Exp $");
#include <afs/stds.h>
#include <ctype.h>
if (code) ABORT_WITH(tt,PRPERM);
tempu = FindByID(tt,aid);
if (!tempu) ABORT_WITH(tt,PRNOENT);
- bzero(&uentry,sizeof(uentry));
+ memset(&uentry, 0, sizeof(uentry));
code = pr_ReadEntry(tt,0,tempu,&uentry);
if (code != 0) ABORT_WITH(tt,code);
/* we don't allow groups as members of groups at present */
if (!tempu) ABORT_WITH(tt,PRNOENT);
tempg = FindByID(tt,gid);
if (!tempg) ABORT_WITH(tt,PRNOENT);
- bzero(&uentry,sizeof(uentry));
- bzero(&gentry,sizeof(gentry));
+ memset(&uentry, 0, sizeof(uentry));
+ memset(&gentry, 0, sizeof(gentry));
code = pr_ReadEntry(tt,0,tempu,&uentry);
if (code != 0) ABORT_WITH(tt,code);
code = pr_ReadEntry(tt,0,tempg,&gentry);
aentry->ngroups = tentry.ngroups;
aentry->nusers = tentry.nusers;
aentry->count = tentry.count;
- bzero (aentry->reserved, sizeof(aentry->reserved));
+ memset(aentry->reserved, 0, sizeof(aentry->reserved));
code = ubik_EndTrans(tt);
if (code) return code;
return PRSUCCESS;
entry->nusers = tentry->nusers;
entry->count = tentry->count;
strncpy(entry->name,tentry->name,PR_MAXNAMELEN);
- bzero(entry->reserved, sizeof(entry->reserved));
+ memset(entry->reserved, 0, sizeof(entry->reserved));
bulkentries->prentries_len++;
return 0;
}
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptuser.c,v 1.1.1.5 2001/07/14 22:23:21 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptuser.c,v 1.1.1.6 2001/09/11 14:34:08 hartmans Exp $");
#if defined(UKERNEL)
#include "../afs/sysincludes.h"
com_err (whoami, code,
"Could not get afs tokens, running unauthenticated.");
- bzero (serverconns, sizeof(serverconns)); /* terminate list!!! */
+ memset(serverconns, 0, sizeof(serverconns)); /* terminate list!!! */
for (i = 0;i<info.numServers;i++)
serverconns[i] = rx_NewConnection
(info.hostAddr[i].sin_addr.s_addr, info.hostAddr[i].sin_port,
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptutils.c,v 1.1.1.7 2001/07/14 22:23:21 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptutils.c,v 1.1.1.8 2001/09/11 14:34:08 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
extern int pr_realmNameLen;
/* We accept foreign names, so we will deal with '@' later */
- if (index (name, ':') || index(name, '\n')) return 0;
+ if (strchr (name, ':') || strchr(name, '\n')) return 0;
if (strlen (name) >= PR_MAXNAMELEN - pr_realmNameLen - 1) return 0;
return 1;
}
if (ntohl(tentry.flags) & PRGRP) {
if ((tentry.count == 0) && !admin) return PRGROUPEMPTY;
/* terminate prefix at colon if there is one */
- if (prefix = index(tentry.name, ':')) *prefix = 0;
+ if (prefix = strchr(tentry.name, ':')) *prefix = 0;
}
prefix = tentry.name;
}
if ((strcmp (prefix, "system") == 0) && !admin) return PRPERM;
strcpy (name, aname); /* in case aname & cname are same */
- suffix = index(name, ':');
+ suffix = strchr(name, ':');
if (suffix == 0) {
/* sysadmin can make groups w/o ':', but they must still look like
* legal user names. */
}
done:
/* check for legal name with either group rules or user rules */
- if (suffix = index(cname, ':')) {
+ if (suffix = strchr(cname, ':')) {
/* check for confusing characters */
- if (index(cname, '\n') || /* restrict so recreate can work */
- index(suffix+1, ':')) /* avoid multiple colons */
+ if (strchr(cname, '\n') || /* restrict so recreate can work */
+ strchr(suffix+1, ':')) /* avoid multiple colons */
return PRBADNAM;
} else {
if (!CorrectUserName (cname)) return PRBADNAM;
struct prentry tentry, tent;
char *atsign;
- bzero(&tentry, sizeof(tentry));
+ memset(&tentry, 0, sizeof(tentry));
if ((oid == 0) || (oid == ANONYMOUSID)) oid = creator;
return PRBADARG;
}
- atsign = index(aname,'@');
+ atsign = strchr(aname, '@');
if (!atsign) {
/* A normal user or group. Pick an id for it */
if (idflag)
afs_int32 hloc;
if (aid == bid) return PRINCONSISTENT;
- bzero(&hentry,sizeof(hentry));
+ memset(&hentry, 0, sizeof(hentry));
temp = FindByID(at,bid);
if (temp == 0) return PRNOENT;
code = pr_ReadEntry(at, 0, temp, &tentry);
} /* for all coentry slots */
hloc = nptr;
nptr = centry.next;
- bcopy(¢ry,&hentry,sizeof(centry));
+ memcpy(&hentry, ¢ry, sizeof(centry));
} /* while there are coentries */
return PRNOENT;
}
afs_int32 i;
afs_int32 nptr;
- if (index(tentry->name,'@')) {
+ if (strchr(tentry->name,'@')) {
if (tentry->flags & PRGRP) {
/* If there are still foreign user accounts from that cell
don't delete the group */
if (inc_header_word (at, instcount, -1)) return PRDBFAIL;
}
else {
- if (index(tentry->name,'@')) {
+ if (strchr(tentry->name,'@')) {
if (inc_header_word (at, foreigncount, -1)) return PRDBFAIL;
} else {
if (inc_header_word (at, usercount, -1)) return PRDBFAIL;
else {
entry->next = nptr;
}
- bzero(&aentry,sizeof(aentry));
+ memset(&aentry, 0, sizeof(aentry));
aentry.flags |= PRCONT;
aentry.id = entry->id;
aentry.next = 0;
char oldname[PR_MAXNAMELEN];
char *atsign;
- bzero(holder,PR_MAXNAMELEN);
- bzero(temp,PR_MAXNAMELEN);
+ memset(holder, 0, PR_MAXNAMELEN);
+ memset(temp, 0, PR_MAXNAMELEN);
loc = FindByID(at,aid);
if (!loc) return PRNOENT;
code = pr_ReadEntry(at,0,loc,&tentry);
}
}
- atsign = index(tentry.name, '@'); /* check for foreign entry */
+ atsign = strchr(tentry.name, '@'); /* check for foreign entry */
/* Change the owner */
if (oid && (oid != tentry.owner)) {
{
char *newatsign;
- newatsign = index (name, '@');
+ newatsign = strchr(name, '@');
if (newatsign != atsign){ /* if they are the same no problem*/
/*if the pointers are not equal the strings better be */
if ((atsign == NULL) || (newatsign == NULL) ||
prlist *alist;
afs_int32 *size;
{
- if (!(index(tentry->name, '@')))
+ if (!(strchr(tentry->name, '@')))
return (AddToPRList (alist, size, AUTHUSERID));
else
return PRSUCCESS;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/readgroup.c,v 1.1.1.4 2001/07/14 22:23:20 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/readgroup.c,v 1.1.1.5 2001/09/11 14:34:09 hartmans Exp $");
#include <stdio.h>
#ifndef AFS_NT40_ENV
if (buf[0] == '\n') break;
if (buf[0] != ' ' && buf[0] != '\t') {
/* grab the group name */
- bzero(gname,PR_MAXNAMELEN);
- bzero(owner,PR_MAXNAMELEN);
+ memset(gname, 0, PR_MAXNAMELEN);
+ memset(owner, 0, PR_MAXNAMELEN);
sscanf(buf,"%s %d",gname,&id);
tmp = buf;
skip(&tmp);
skip(&tmp);
stolower(gname);
- ptr = index(gname,':');
+ ptr = strchr(gname, ':');
strncpy(owner,gname,ptr-gname);
if (strcmp(owner,"system") == 0)
strncpy(owner,"system:administrators",PR_MAXNAMELEN);
}
if (!fail) {
/* read members out of buf and add to the group */
- bzero(name,PR_MAXNAMELEN);
+ memset(name, 0, PR_MAXNAMELEN);
while (sscanf(tmp,"%s",name) != EOF) {
- if (index(name,':') == NULL) {
+ if (strchr(name,':') == NULL) {
/* then it's not a group */
code = pr_AddToGroup(name,gname);
report_error (code, name, gname);
}
if (lnames.namelist_val) free(lnames.namelist_val);
}
- bzero(name,PR_MAXNAMELEN);
+ memset(name, 0, PR_MAXNAMELEN);
skip(&tmp);
}
}
/* if we couldn't create the group, and it wasn't already there, don't try to add more users */
if (fail) continue;
/* read members out of buf and add to the group */
- bzero(name,PR_MAXNAMELEN);
+ memset(name, 0, PR_MAXNAMELEN);
tmp = buf;
tmp++;
while (sscanf(tmp,"%s",name) != EOF) {
- if (index(name,':') == NULL) {
+ if (strchr(name,':') == NULL) {
/* then it's not a group */
code = pr_AddToGroup(name,gname);
report_error (code, name, gname);
}
if (lnames.namelist_val) free(lnames.namelist_val);
}
- bzero(name,PR_MAXNAMELEN);
+ memset(name, 0, PR_MAXNAMELEN);
skip(&tmp);
}
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/readpwd.c,v 1.1.1.4 2001/07/14 22:23:21 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/readpwd.c,v 1.1.1.5 2001/09/11 14:34:09 hartmans Exp $");
#include <stdio.h>
#ifndef AFS_NT40_ENV
exit(2);
}
while ((tmp = fgets(buf,150,fp)) != NULL) {
- bzero(name,PR_MAXNAMELEN);
- bzero(uid,8);
- ptr = index(buf,':');
+ memset(name, 0, PR_MAXNAMELEN);
+ memset(uid, 0, 8);
+ ptr = strchr(buf, ':');
strncpy(name,buf,ptr-buf);
- aptr = index(++ptr,':');
- ptr = index(++aptr,':');
+ aptr = strchr(++ptr, ':');
+ ptr = strchr(++aptr, ':');
strncpy(uid,aptr,ptr-aptr);
id = atoi(uid);
if (verbose)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/testpt.c,v 1.1.1.5 2001/07/14 22:23:21 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/testpt.c,v 1.1.1.6 2001/09/11 14:34:10 hartmans Exp $");
#include <ctype.h>
#include <errno.h>
population = (char *)malloc (sqr(number)*sizeof(char));
nFilled = 0;
- bzero (filled, number);
+ memset(filled, 0, number);
nCleaned = 0;
- bzero (cleaned, number);
- bzero (population, sqr(number));
- bzero (users, number*sizeof(afs_int32));
- bzero (groups, number*sizeof(afs_int32));
+ memset(cleaned, 0, number);
+ memset(population, 0, sqr(number));
+ memset(users, 0, number*sizeof(afs_int32));
+ memset(groups, 0, number*sizeof(afs_int32));
ownerUser = lastGroup = 0;
groupOwners = (afs_int32 *) malloc (number*sizeof(afs_int32));
strncpy (cellinfo.hostName[i], serverList->data, MAXHOSTCHARS);
th = gethostbyname(cellinfo.hostName[i]);
if (!th) return UBADHOST;
- bcopy(th->h_addr, &cellinfo.hostAddr[i].sin_addr, sizeof(afs_int32));
+ memcpy(&cellinfo.hostAddr[i].sin_addr, th->h_addr, sizeof(afs_int32));
cellinfo.hostAddr[i].sin_family = AF_INET;
cellinfo.hostAddr[i].sin_port = 0;
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/utils.c,v 1.1.1.5 2001/07/14 22:23:22 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/utils.c,v 1.1.1.6 2001/09/11 14:34:10 hartmans Exp $");
#include <sys/types.h>
#include <lock.h>
struct prentry nentry;
if (ntohl(1) != 1) { /* Need to swap bytes. */
- bzero (&nentry, sizeof(nentry)); /* make sure reseved fields are zero */
+ memset(&nentry, 0, sizeof(nentry)); /* make sure reseved fields are zero */
nentry.flags = htonl(tentry->flags);
nentry.id = htonl(tentry->id);
nentry.cellid = htonl(tentry->cellid);
}
code = ubik_Read(tt, (char *) &nentry, sizeof(struct prentry));
if (code) return (code);
- bzero (tentry, sizeof(*tentry)); /* make sure reseved fields are zero */
+ memset(tentry, 0, sizeof(*tentry)); /* make sure reseved fields are zero */
tentry->flags = ntohl(nentry.flags);
tentry->id = ntohl(nentry.id);
tentry->cellid = ntohl(nentry.cellid);
struct contentry nentry;
if (ntohl(1) != 1) { /* No need to swap */
- bzero (&nentry, sizeof(nentry)); /* make reseved fields zero */
+ memset(&nentry, 0, sizeof(nentry)); /* make reseved fields zero */
nentry.flags = htonl(tentry->flags);
nentry.id = htonl(tentry->id);
nentry.cellid = htonl(tentry->cellid);
}
code = ubik_Read(tt, (char *) &nentry, sizeof(struct contentry));
if (code) return (code);
- bzero (tentry, sizeof(*tentry)); /* make reseved fields zero */
+ memset(tentry, 0, sizeof(*tentry)); /* make reseved fields zero */
tentry->flags = ntohl(nentry.flags);
tentry->id = ntohl(nentry.id);
tentry->cellid = ntohl(nentry.cellid);
register afs_int32 code;
struct prentry tentry;
- bzero(&tentry,sizeof(tentry));
+ memset(&tentry, 0, sizeof(tentry));
tentry.next = ntohl(cheader.freePtr);
tentry.flags |= PRFREE;
cheader.freePtr = htonl(pos);
i = IDHash(aid);
entry = ntohl(cheader.idHash[i]);
if (entry == 0) return entry;
- bzero(&tentry,sizeof(tentry));
+ memset(&tentry, 0, sizeof(tentry));
code = pr_ReadEntry(at, 0, entry, &tentry);
if (code != 0) return 0;
if (aid == tentry.id) return entry;
entry = tentry.nextID;
while (entry != 0) {
- bzero(&tentry,sizeof(tentry));
+ memset(&tentry, 0, sizeof(tentry));
code = pr_ReadEntry(at,0,entry,&tentry);
if (code != 0) return 0;
if (aid == tentry.id) return entry;
i = NameHash(aname);
entry = ntohl(cheader.nameHash[i]);
if (entry == 0) return entry;
- bzero(tentryp,sizeof(struct prentry));
+ memset(tentryp, 0, sizeof(struct prentry));
code = pr_ReadEntry(at, 0, entry, tentryp);
if (code != 0) return 0;
if ((strncmp(aname,tentryp->name,PR_MAXNAMELEN)) == 0) return entry;
entry = tentryp->nextName;
while (entry != 0) {
- bzero(tentryp, sizeof(struct prentry));
+ memset(tentryp, 0, sizeof(struct prentry));
code = pr_ReadEntry(at,0,entry, tentryp);
if (code != 0) return 0;
if ((strncmp(aname,tentryp->name,PR_MAXNAMELEN)) == 0) return entry;
if ((aid == PRBADID) || (aid == 0)) return PRINCONSISTENT;
i = IDHash(aid);
current = ntohl(cheader.idHash[i]);
- bzero(&tentry,sizeof(tentry));
- bzero(&bentry,sizeof(bentry));
+ memset(&tentry, 0, sizeof(tentry));
+ memset(&bentry, 0, sizeof(bentry));
trail = 0;
if (current == 0) return PRSUCCESS; /* already gone */
code = pr_ReadEntry(tt,0,current,&tentry);
if ((aid == PRBADID) || (aid == 0)) return PRINCONSISTENT;
i = IDHash(aid);
- bzero(&tentry,sizeof(tentry));
+ memset(&tentry, 0, sizeof(tentry));
code = pr_ReadEntry(tt,0,loc,&tentry);
if (code) return PRDBFAIL;
tentry.nextID = ntohl(cheader.idHash[i]);
i = NameHash(aname);
current = ntohl(cheader.nameHash[i]);
- bzero(&tentry,sizeof(tentry));
- bzero(&bentry,sizeof(bentry));
+ memset(&tentry, 0, sizeof(tentry));
+ memset(&bentry, 0, sizeof(bentry));
trail = 0;
if (current == 0) return PRSUCCESS; /* already gone */
code = pr_ReadEntry(tt,0,current,&tentry);
struct prentry tentry;
i = NameHash(aname);
- bzero(&tentry,sizeof(tentry));
+ memset(&tentry, 0, sizeof(tentry));
code = pr_ReadEntry(tt,0,loc,&tentry);
if (code) return PRDBFAIL;
tentry.nextName = ntohl(cheader.nameHash[i]);
return PRSUCCESS;
}
nptr = ntohl(cheader.orphan);
- bzero(&bentry,sizeof(bentry));
+ memset(&bentry, 0, sizeof(bentry));
loc = 0;
while (nptr != 0) {
code = pr_ReadEntry(at,0,nptr,&tentry);
}
loc = nptr;
nptr = tentry.nextOwned;
- bcopy(&tentry,&bentry, sizeof(tentry));
+ memcpy(&bentry, &tentry, sizeof(tentry));
}
return PRSUCCESS;
}
if ((gid == 0) || (aid == 0)) return 0;
loc = FindByID(at,gid);
if (!loc) return 0;
- bzero(&tentry,sizeof(tentry));
+ memset(&tentry, 0, sizeof(tentry));
code = pr_ReadEntry(at, 0, loc,&tentry);
if (code) return 0;
if (!(tentry.flags & PRGRP)) return 0;
if (tentry.next) {
loc = tentry.next;
while (loc) {
- bzero(¢ry,sizeof(centry));
+ memset(¢ry, 0, sizeof(centry));
code = pr_ReadCoEntry(at,0,loc,¢ry);
if (code) return 0;
for (i=0;i<COSIZE;i++) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rcp/rcp.c,v 1.1.1.4 2001/07/14 22:23:23 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rcp/rcp.c,v 1.1.1.5 2001/09/11 14:34:11 hartmans Exp $");
#include <sys/param.h>
#include <sys/file.h>
#endif
int rem;
-char *colon(), *index(), *rindex(), *malloc(), *strcpy();
+char *colon(), *malloc(), *strcpy();
int errs;
#if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
extern char *sys_errlist[];
*targ++ = 0;
if (*targ == 0)
targ = ".";
- thost = index(argv[argc - 1], '@');
+ thost = strchr(argv[argc - 1], '@');
if (thost) {
*thost++ = 0;
tuser = argv[argc - 1];
*src++ = 0;
if (*src == 0)
src = ".";
- host = index(argv[i], '@');
+ host = strchr(argv[i], '@');
if (host) {
*host++ = 0;
suser = argv[i];
*src++ = 0;
if (*src == 0)
src = ".";
- host = index(argv[i], '@');
+ host = strchr(argv[i], '@');
if (host) {
*host++ = 0;
suser = argv[i];
error("rcp: %s: not a plain file\n", name);
continue;
}
- last = rindex(name, '/');
+ last = strrchr(name, '/');
if (last == 0)
last = name;
else
error("rcp: %s: %s\n", name, sys_errlist[errno]);
return;
}
- last = rindex(name, '/');
+ last = strrchr(name, '/');
if (last == 0)
last = name;
else
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rlogind/rexecd.c,v 1.1.1.3 2001/07/14 22:23:23 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rlogind/rexecd.c,v 1.1.1.4 2001/09/11 14:34:11 hartmans Exp $");
#include <afs/kautils.h> /* for UserAuthGeneral */
#include <sys/types.h>
extern errno;
struct passwd *getpwnam();
-char *crypt(), *rindex(), *strncat();
+char *crypt(), *strncat();
#if !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SUN5_ENV)
char *sprintf();
#endif
addenvvar("PASSWORD_EXPIRES", pwd_expires_str);
}
#endif
- cp = rindex(pwd->pw_shell, '/');
+ cp = strrchr(pwd->pw_shell, '/');
if (cp)
cp++;
else
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rlogind/rlogind.c,v 1.1.1.3 2001/07/14 22:23:24 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rlogind/rlogind.c,v 1.1.1.4 2001/09/11 14:34:12 hartmans Exp $");
#ifdef MSG
#include "rlogind_msg.h"
syslog(LOG_WARNING,MSGSTR(SETDEBUG,"setsockopt (SO_DEBUG): %m")); /*MSG*/
/* set-up signal handler routines for SRC TRACE ON/OFF support */
- bzero((char *)&sa, sizeof(sa));
+ memset((char *)&sa, 0, sizeof(sa));
sa.sa_mask.losigs = sigmask(SIGUSR2);
sa.sa_handler = trace_handler;
sa.sa_flags = SA_RESTART;
hp = gethostbyname(remotehost);
if (hp)
#if defined(BSD_42)
- if (!bcmp(hp->h_addr, (caddr_t)&fromp->sin_addr,
+ if (!memcmp(hp->h_addr, (caddr_t)&fromp->sin_addr,
sizeof(fromp->sin_addr))) {
#else /* BSD_42 */
for (; hp->h_addr_list[0]; hp->h_addr_list++)
- if (!bcmp(hp->h_addr_list[0], (caddr_t)&fromp->sin_addr,
+ if (!memcmp(hp->h_addr_list[0], (caddr_t)&fromp->sin_addr,
sizeof(fromp->sin_addr))) {
#endif /* BSD_42 */
hostok++;
{
struct sigaction sa;
- bzero((char *)&sa, sizeof(sa));
+ memset((char *)&sa, 0, sizeof(sa));
sa.sa_handler = SIG_DFL;
sigaction(SIGQUIT, &sa, (struct sigaction *)0);
sa.sa_handler = SIG_DFL;
{
struct sigaction sa;
- bzero((char *)&sa, sizeof(sa));
+ memset((char *)&sa, 0, sizeof(sa));
sa.sa_mask.losigs = sigmask(SIGUSR2);
sa.sa_handler = trace_handler;
sigaction(SIGUSR1, &sa, (struct sigaction *)0);
if (n < 4+sizeof (w) || cp[2] != 's' || cp[3] != 's')
return (0);
oobdata[0] &= ~TIOCPKT_WINDOW; /* we know he heard */
- bcopy(cp+4, (char *)&w, sizeof(w));
+ memcpy((char *)&w, cp+4, sizeof(w));
w.ws_row = ntohs(w.ws_row);
w.ws_col = ntohs(w.ws_col);
w.ws_xpixel = ntohs(w.ws_xpixel);
if (n) {
left -= n;
if (left > 0)
- bcopy(cp+n, cp, left);
+ memcpy(cp, cp+n, left);
fcc -= n;
goto top; /* n^2 */
}
int fd;
{
#ifndef AFS_OSF_ENV
- register char *cp = index(term, '/'), **cpp;
+ register char *cp = strchr(term, '/'), **cpp;
#endif
#ifdef AFS_AIX32_ENV
#ifdef _AIX
if (cp) {
*cp++ = '\0';
speed = cp;
- cp = index(speed, '/');
+ cp = strchr(speed, '/');
if (cp)
*cp++ = '\0';
#ifdef _AIX
#else /* AFS_AIX32_ENV */
#ifdef AFS_OSF_ENV
- register char *cp = index(term+ENVSIZE, '/');
+ register char *cp = strchr(term+ENVSIZE, '/');
char *speed;
struct termios tt;
if (cp) {
*cp++ = '\0';
speed = cp;
- cp = index(speed, '/');
+ cp = strchr(speed, '/');
if (cp)
*cp++ = '\0';
cfsetspeed(&tt, atoi(speed));
tt.c_iflag = TTYDEF_IFLAG;
tt.c_oflag = TTYDEF_OFLAG;
tt.c_lflag = TTYDEF_LFLAG;
- bcopy(ttydefchars, tt.c_cc, sizeof(tt.c_cc));
+ memcpy(tt.c_cc, ttydefchars, sizeof(tt.c_cc));
tcsetattr(fd, TCSAFLUSH, &tt);
#else
struct sgttyb sgttyb;
if (cp) {
*cp++ = '\0';
speed = cp;
- cp = index(speed, '/');
+ cp = strchr(speed, '/');
if (cp)
*cp++ = '\0';
for (cpp = speeds; cpp < &speeds[NSPEEDS]; cpp++)
char *h;
{
char localhost[MAXHOSTNAMELEN];
- char *p1, *p2 = index(h, '.');
+ char *p1, *p2 = strchr(h, '.');
#ifdef AFS_OSF_ENV
char *topdomain();
p1 = topdomain(localhost);
p2 = topdomain(h);
#else
- p1 = index(localhost, '.');
+ p1 = strchr(localhost, '.');
#endif
if (p1 == NULL || p2 == NULL || !strcasecmp(p1, p2))
return(1);
/* (5) sessionKey */
bp = bp + index + 1;
- bcopy(bp, token.sessionKey.data, 8);
+ memcpy(token.sessionKey.data, bp, 8);
/* (6) kvno */
exit(1);
}
- bcopy(bp, token.ticket, token.ticketLen);
+ memcpy(token.ticket, bp, token.ticketLen);
bp = bp + token.ticketLen;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rsh/rcmd.c,v 1.1.1.5 2001/07/14 22:23:26 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rsh/rcmd.c,v 1.1.1.6 2001/09/11 14:34:12 hartmans Exp $");
#ifdef aiws /*AIX*/
#include <sys/types.h>
# define DPRINTF(args)
#endif
-char *index();
-
#include <syslog.h>
static _checkhost();
struct hostent *hp;
fd_set reads;
- bzero((char *)someSignals, sizeof(someSignals));
+ memset((char *)someSignals, 0, sizeof(someSignals));
someSignals[0] = 1<<(SIGURG-1);
sigBlock = *((sigset_t *)someSignals);
#endif
sin.sin_family = hp->h_addrtype;
#ifdef AFS_OSF_ENV
- bcopy(hp->h_addr_list[0], (caddr_t)&sin.sin_addr, hp->h_length);
+ memcpy((caddr_t)&sin.sin_addr, hp->h_addr_list[0], hp->h_length);
#else
- bcopy(hp->h_addr, (caddr_t)&sin.sin_addr, hp->h_length);
+ memcpy((caddr_t)&sin.sin_addr, hp->h_addr, hp->h_length);
#endif
sin.sin_port = rport;
/* attempt to remote authenticate first... */
errno = oerrno;
perror(0);
hp->h_addr_list++;
- bcopy(hp->h_addr_list[0], (caddr_t)&sin.sin_addr,
- hp->h_length);
+ memcpy((caddr_t)&sin.sin_addr, hp->h_addr_list[0], hp->h_length);
fprintf(stderr, "Trying %s...\n",
inet_ntoa(sin.sin_addr));
continue;
return(0);
}
ldomain[MAXHOSTNAMELEN] = '\0';
- if ((domainp = index(ldomain, '.')) == (char *)NULL) {
+ if ((domainp = strchr(ldomain, '.')) == (char *)NULL) {
nodomain = 1;
return(0);
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rsh/rlogin.c,v 1.1.1.3 2001/07/14 22:23:26 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rsh/rlogin.c,v 1.1.1.4 2001/09/11 14:34:13 hartmans Exp $");
#if !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV)
#include <sys/param.h>
# define TIOCPKT_WINDOW 0x80
# endif /* TIOCPKT_WINDOW */
-char *index(), *rindex(), *malloc(), *getenv();
+char *malloc(), *getenv();
struct passwd *getpwuid();
char *name;
int rem;
setlocale(LC_ALL,"");
#endif
- host = rindex(argv[0], '/');
+ host = strrchr(argv[0], '/');
if (host)
host++;
else
struct winsize ws;
if (dosigwinch && !nosigwin && ioctl(0, TIOCGWINSZ, &ws) == 0 &&
- bcmp(&ws, &winsize, sizeof (ws))) {
+ memcmp(&ws, &winsize, sizeof (ws))) {
winsize = ws;
sendwindow();
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rsh/rsh.c,v 1.1.1.3 2001/07/14 22:23:26 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rsh/rsh.c,v 1.1.1.4 2001/09/11 14:34:13 hartmans Exp $");
#include <unistd.h> /* select() prototype */
#include <sys/types.h> /* fd_set on older platforms */
*/
check_and_run_afs_vers(argv);
#endif
- bzero(&ign_act, sizeof(ign_act));
+ memset(&ign_act, 0, sizeof(ign_act));
ign_act.sa_handler=SIG_IGN;
#endif
host = strrchr(argv[0], '/');
}
(void) setuid(getuid());
- bzero((char *)someSignals, sizeof(someSignals));
+ memset((char *)someSignals, 0, sizeof(someSignals));
#ifdef AFS_HPUX_ENV
someSignals[0] = mask(SIGINT)|mask(SIGQUIT)|mask(SIGTERM)|mask(SIGHUP);
#else
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/AIX/rx_knet.c,v 1.1.1.4 2001/07/14 22:23:39 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/AIX/rx_knet.c,v 1.1.1.5 2001/09/11 14:34:28 hartmans Exp $");
#ifdef AFS_AIX41_ENV
#include "../rx/rx_kcommon.h"
olen = (ip->ip_hl<<2) - sizeof (struct ip);
opts = (caddr_t)(ip + 1);
i = m->m_len - (sizeof (struct ip) + olen);
- bcopy(opts + olen, opts, (unsigned)i);
+ memcpy(opts, opts + olen, (unsigned)i);
m->m_len -= olen;
if (m->m_flags & M_PKTHDR)
m->m_pkthdr.len -= olen;
m->m_len = 0;
while (len) {
rlen = MIN(len, tl);
- bcopy(tdata, tpa, rlen);
+ memcpy(tpa, tdata, rlen);
asize -= rlen;
len -= rlen;
tpa += rlen;
m_freem(top); /* free mbuf chain */
return 1;
}
- bcopy(addr, mtod(um, caddr_t), sizeof(*addr));
+ memcpy(mtod(um, caddr_t), addr, sizeof(*addr));
um->m_len = sizeof(*addr);
um->m_pkthdr.len = sizeof(*addr);
um->m_flags |= M_PKTHDR;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/DARWIN/rx_knet.c,v 1.1.1.3 2001/07/14 22:23:47 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/DARWIN/rx_knet.c,v 1.1.1.4 2001/09/11 14:34:30 hartmans Exp $");
#include "../rx/rx_kcommon.h"
goto bad;
}
nam->m_len=addr->sin_len=sizeof(struct sockaddr_in);
- bcopy((caddr_t)addr, mtod(nam, caddr_t), addr->sin_len);
+ memcpy(mtod(nam, caddr_t), (caddr_t)addr, addr->sin_len);
code = sosend(asocket, mtod(nam, struct sockaddr *), &u, NULL, NULL, 0);
m_freem(nam);
bad:
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/DUX/rx_knet.c,v 1.1.1.4 2001/07/14 22:23:40 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/DUX/rx_knet.c,v 1.1.1.5 2001/09/11 14:34:29 hartmans Exp $");
#ifdef AFS_DUX40_ENV
#include "../rx/rx_kcommon.h"
/* force UDP checksumming on for AFS */
extern int udpcksum;
udpcksum = 1;
- bcopy(tpro, &parent_proto, sizeof(parent_proto));
+ memcpy(&parent_proto, tpro, sizeof(parent_proto));
tpro->pr_input = rxk_input;
tpro->pr_fasttimo = rxk_fasttimo;
/*
tpa = mtod(m, caddr_t);
while (len) {
rlen = MIN(len, tl);
- bcopy(tdata, tpa, rlen);
+ memcpy(tpa, tdata, rlen);
asize -= rlen;
len -= rlen;
tpa += rlen;
splx(s);
return 1;
}
- bcopy(addr, mtod(um, caddr_t), sizeof(*addr));
+ memcpy(mtod(um, caddr_t), addr, sizeof(*addr));
um->m_len = sizeof(*addr);
/* note that udp_usrreq frees funny mbuf. We hold onto data, but mbuf
* around it is gone. we free address ourselves. */
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/FBSD/rx_knet.c,v 1.1.1.3 2001/07/14 22:23:47 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/FBSD/rx_knet.c,v 1.1.1.4 2001/09/11 14:34:30 hartmans Exp $");
#ifdef AFS_FBSD40_ENV
#include "../rx/rx_kcommon.h"
/* force UDP checksumming on for AFS */
extern int udpcksum;
udpcksum = 1;
- bcopy(tpro, &parent_proto, sizeof(parent_proto));
+ memcpy(&parent_proto, tpro, sizeof(parent_proto));
tpro->pr_input = rxk_input;
tpro->pr_fasttimo = rxk_fasttimo;
/*
tpa = mtod(m, caddr_t);
while (len) {
rlen = MIN(len, tl);
- bcopy(tdata, tpa, rlen);
+ memcpy(tpa, tdata, rlen);
asize -= rlen;
len -= rlen;
tpa += rlen;
splx(s);
return 1;
}
- bcopy(addr, mtod(um, caddr_t), sizeof(*addr));
+ memcpy(mtod(um, caddr_t), addr, sizeof(*addr));
um->m_len = sizeof(*addr);
/* note that udp_usrreq frees funny mbuf. We hold onto data, but mbuf
* around it is gone. we free address ourselves. */
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/HPUX/rx_knet.c,v 1.1.1.3 2001/07/14 22:23:48 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/HPUX/rx_knet.c,v 1.1.1.4 2001/09/11 14:34:31 hartmans Exp $");
#include "../h/types.h"
#include "../h/param.h"
/* force UDP checksumming on for AFS */
int udpcksum;
udpcksum = 1;
- bcopy(tpro, &parent_proto, sizeof(parent_proto));
+ memcpy(&parent_proto, tpro, sizeof(parent_proto));
tpro->pr_input = rxk_input;
tpro->pr_fasttimo = rxk_fasttimo;
rxk_initDone = 1;
/* Guess based on rxk_NewSocket */
bp = allocb((size+SO_MSGOFFSET+1), BPRI_MED);
if (!bp) return ENOBUFS;
- bcopy((caddr_t)addr, (caddr_t)bp->b_rptr+SO_MSGOFFSET, size);
+ memcpy((caddr_t)bp->b_rptr+SO_MSGOFFSET, (caddr_t)addr, size);
bp->b_wptr = bp->b_rptr + (size+SO_MSGOFFSET+1);
- bcopy((caddr_t)dvec, (caddr_t)temp, nvec * sizeof(struct iovec));
+ memcpy((caddr_t)temp, (caddr_t)dvec, nvec * sizeof(struct iovec));
/* devresource.hp.com/Drivers/Docs/Refs/11i/ddRef/Chap02R.pdf has details
on use of uio */
- bzero((caddr_t)&uio, sizeof(uio));
+ memset((caddr_t)&uio, 0, sizeof(uio));
uio.uio_resid = asize;
uio.uio_iov = temp;
uio.uio_iovcnt = nvec;
if (iovcnt > RX_MAXWVECS+2) {
osi_Panic("Too many (%d) iovecs passed to osi_NetReceive\n", iovcnt);
}
- bcopy((char*)iov, tmpvec, iovcnt/*(RX_MAXWVECS+1)*/ * sizeof(struct iovec));
+ memcpy(tmpvec, (char*)iov, iovcnt/*(RX_MAXWVECS+1)*/ * sizeof(struct iovec));
tuio.uio_iov = tmpvec;
tuio.uio_iovcnt = iovcnt;
tuio.uio_fpflags = 0;
if (!code) {
*lengthp = *lengthp - tuio.uio_resid;
if (bp) {
- bcopy((char*)bp->b_rptr, (char*)from, sizeof(struct sockaddr_in));
+ memcpy((char*)from, (char*)bp->b_rptr, sizeof(struct sockaddr_in));
} else {
code = -1;
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/IRIX/rx_knet.c,v 1.1.1.4 2001/07/14 22:23:40 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/IRIX/rx_knet.c,v 1.1.1.5 2001/09/11 14:34:31 hartmans Exp $");
#include "../rx/rx_kcommon.h"
#include "../h/tcp-param.h"
if (iovcnt > RX_MAXWVECS+2) {
osi_Panic("Too many (%d) iovecs passed to osi_NetReceive\n", iovcnt);
}
- bcopy((char*)iov, tmpvec, (RX_MAXWVECS+1) * sizeof(struct iovec));
+ memcpy(tmpvec, (char*)iov, (RX_MAXWVECS+1) * sizeof(struct iovec));
#ifdef AFS_SGI65_ENV
code = soreceive(&bhv, &maddr, &tuio, NULL, NULL);
#else
else {
*lengthp = *lengthp - tuio.uio_resid;
if (maddr) {
- bcopy((char*)mtod(maddr, struct sockaddr_in *), (char*)from,
+ memcpy((char*)from, (char*)mtod(maddr, struct sockaddr_in *),
sizeof(struct sockaddr_in));
m_freem(maddr);
}
last = inetdomain.dom_protoswNPROTOSW;
for (tpro = inetdomain.dom_protosw; tpro < last; tpro++) {
if (tpro->pr_protocol == IPPROTO_UDP) {
- bcopy(tpro, &parent_proto, sizeof(parent_proto));
+ memcpy(&parent_proto, tpro, sizeof(parent_proto));
tpro->pr_input = rxk_input;
tpro->pr_fasttimo = rxk_fasttimo;
rxk_initDone = 1;
if (nvec > RX_MAXWVECS+1) {
osi_Panic("osi_NetSend: %d: Too many iovecs.\n", nvec);
}
- bcopy((char*)dvec, (char*)tvecs, nvec * sizeof(struct iovec));
+ memcpy((char*)tvecs, (char*)dvec, nvec * sizeof(struct iovec));
tuio.uio_iov = tvecs;
tuio.uio_iovcnt = nvec;
to = m_get(M_WAIT, MT_SONAME);
to->m_len = sizeof(struct sockaddr_in);
- bcopy((char*)addr, mtod(to, caddr_t), to->m_len);
+ memcpy(mtod(to, caddr_t), (char*)addr, to->m_len);
BHV_PDATA(&bhv) = (void*)asocket;
code = sosend(&bhv, to, &tuio, 0, NULL);
tpa = mtod(m, caddr_t);
while (len) {
rlen = MIN(len, tl);
- bcopy(tdata, tpa, rlen);
+ memcpy(tpa, tdata, rlen);
asize -= rlen;
len -= rlen;
tpa += rlen;
AFS_SBUNLOCK(&asocket->so_snd, NETEVENT_SODOWN, asocket, s1);
return 1;
}
- bcopy(addr, mtod(um, caddr_t), sizeof(*addr));
+ memcpy(mtod(um, caddr_t), addr, sizeof(*addr));
um->m_len = sizeof(*addr);
/* note that udp_usrreq frees funny mbuf. We hold onto data, but mbuf
* around it is gone. we free address ourselves. */
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/SOLARIS/rx_knet.c,v 1.1.1.5 2001/07/14 22:23:41 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/SOLARIS/rx_knet.c,v 1.1.1.6 2001/09/11 14:34:32 hartmans Exp $");
#ifdef AFS_SUN5_ENV
#include "../rx/rx_kcommon.h"
if (msg.msg_name == NULL) {
error = -1;
} else {
- bcopy(msg.msg_name, addr, msg.msg_namelen);
+ memcpy(addr, msg.msg_name, msg.msg_namelen);
kmem_free(msg.msg_name, msg.msg_namelen);
*alength = *alength - uio.uio_resid;
}
t_kclose(udp_tiptr, 0);
return (struct osi_socket *)0;
}
- if (bcmp(reqp->addr.buf, rspp->addr.buf, rspp->addr.len)) {
+ if (memcmp(reqp->addr.buf, rspp->addr.buf, rspp->addr.len)) {
t_kfree(udp_tiptr, (char *)reqp, T_BIND);
t_kfree(udp_tiptr, (char *)rspp, T_BIND);
t_kclose(udp_tiptr, 0);
}
/* Copy the data into the buffer */
- bcopy((char *)dvec[0].iov_base, (char *)bp->b_wptr, dvec[0].iov_len);
+ memcpy((char *)bp->b_wptr, (char *)dvec[0].iov_base, dvec[0].iov_len);
bp->b_datap->db_type = M_DATA;
bp->b_wptr += dvec[0].iov_len;
}
/* Copy the data into the buffer */
- bcopy((char *)dvec[i].iov_base, (char *)dbp->b_wptr, dvec[i].iov_len);
+ memcpy((char *)dbp->b_wptr, (char *)dvec[i].iov_base, dvec[i].iov_len);
dbp->b_datap->db_type = M_DATA;
dbp->b_wptr += dvec[i].iov_len;
udreq->addr.buf = (char *)kmem_alloc(sizeof(struct sockaddr_in), KM_SLEEP);
udreq->opt.len = 0;
udreq->opt.maxlen = 0;
- bcopy((char *)&sin, udreq->addr.buf, sizeof(struct sockaddr_in));
+ memcpy(udreq->addr.buf, (char *)&sin, sizeof(struct sockaddr_in));
udreq->udata.udata_mp = bp;
udreq->udata.len = asize;
/*
* Save the source address
*/
- bcopy(udreq->addr.buf, (char *)addr, sizeof(struct sockaddr_in));
+ memcpy((char *)addr, udreq->addr.buf, sizeof(struct sockaddr_in));
/*
* Copy out the message buffers, take care not to overflow
while (dbp != NULL && tlen > 0) {
blen = dbp->b_wptr - dbp->b_rptr;
if (blen > tlen) {
- bcopy((char *)dbp->b_rptr, tbase, tlen);
+ memcpy(tbase, (char *)dbp->b_rptr, tlen);
length -= tlen;
dbp->b_rptr += tlen;
tlen = 0;
} else {
- bcopy((char *)dbp->b_rptr, tbase, blen);
+ memcpy(tbase, (char *)dbp->b_rptr, blen);
length -= blen;
tlen -= blen;
tbase += blen;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/bulk.example/bulk_client.c,v 1.1.1.4 2001/07/14 22:23:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/bulk.example/bulk_client.c,v 1.1.1.5 2001/09/11 14:34:33 hartmans Exp $");
#include <sys/types.h>
#include <sys/stat.h>
printf("host address is disagreeable length (%d)", hostent->h_length);
exit(1);
}
- bcopy(hostent->h_addr, (char *)&host, sizeof(host));
+ memcpy((char *)&host, hostent->h_addr, sizeof(host));
return host;
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/bulktest/bulk_client.c,v 1.1.1.4 2001/07/14 22:23:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/bulktest/bulk_client.c,v 1.1.1.5 2001/09/11 14:34:34 hartmans Exp $");
#include <sys/types.h>
#include <sys/stat.h>
printf("host address is disagreeable length (%d)", hostent->h_length);
exit(1);
}
- bcopy(hostent->h_addr, (char *)&host, sizeof(host));
+ memcpy((char *)&host, hostent->h_addr, sizeof(host));
return host;
}
work->store = store;
work->count = count;
work->verbose = verbose;
- name = (char *)rindex(file, '/');
+ name = strrchr(file, '/');
if (!name) name = file; else name++;
/* sprintf(tempfile, "/usr/tmp/%s.%s", myHostName, name);*/
sprintf(tempfile, "/usr/tmp/%s", name);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/multi.example/sample_client.c,v 1.1.1.4 2001/07/14 22:23:44 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/multi.example/sample_client.c,v 1.1.1.5 2001/09/11 14:34:35 hartmans Exp $");
#include <sys/types.h>
#include <netdb.h>
printf("host address is disagreeable length (%d)", hostent->h_length);
exit(1);
}
- bcopy(hostent->h_addr, (char *)&host, sizeof(host));
+ memcpy((char *)&host, hostent->h_addr, sizeof(host));
return host;
}
# include "rx_event.h"
# include "rx_packet.h"
# include "rx_misc.h"
+# include "rx_null.h"
#ifndef AFS_NT40_ENV
# include <netinet/in.h>
#endif
* directory or online at http://www.openafs.org/dl/license10.html
*/
+#include <afsconfig.h>
#ifdef KERNEL
#include "../afs/param.h"
#else
#include <afs/param.h>
#endif
-#include <afsconfig.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_event.c,v 1.1.1.4 2001/07/11 03:10:48 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_event.c,v 1.1.1.5 2001/09/11 14:34:16 hartmans Exp $");
#ifdef KERNEL
#ifndef UKERNEL
osi_Free((char *)xp, sizeof(struct xfreelist));
xp = nxp;
}
+ xfreemallocs = (struct xfreelist *) 0;
#endif
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_kcommon.c,v 1.1.1.6 2001/07/14 22:23:32 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_kcommon.c,v 1.1.1.7 2001/09/11 14:34:17 hartmans Exp $");
#include "../rx/rx_kcommon.h"
for (tpro = inetdomain.dom_protosw; tpro < last; tpro++)
if (tpro->pr_protocol == IPPROTO_UDP) {
/* restore original udp protocol switch */
- bcopy((void *)&parent_proto, (void *)tpro, sizeof(parent_proto));
- bzero((void *)&parent_proto, sizeof(parent_proto));
+ memcpy((void *)tpro, (void *)&parent_proto, sizeof(parent_proto));
+ memset((void *)&parent_proto, 0, sizeof(parent_proto));
rxk_initDone = 0;
rxk_shutdownPorts();
return;
afs_uint32 addrs[ADDRSPERSITE];
int mtus[ADDRSPERSITE];
- bzero((void *)addrs, sizeof(addrs));
- bzero((void *)mtus, sizeof(mtus));
+ memset((void *)addrs, 0, sizeof(addrs));
+ memset((void *)mtus, 0, sizeof(mtus));
for (i=0; i<afs_cb_interface.numberOfInterfaces; i++) {
rxmtu = (ntohl(afs_cb_interface.mtu[i]) - RX_IPUDP_SIZE);
struct ifaddr *ifad; /* ifnet points to a if_addrlist of ifaddrs */
afs_uint32 ifinaddr;
- bzero(addrs, sizeof(addrs));
- bzero(mtus, sizeof(mtus));
+ memset(addrs, 0, sizeof(addrs));
+ memset(mtus, 0, sizeof(mtus));
#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
TAILQ_FOREACH(ifn, &ifnet, if_link) {
setuerror(ENOBUFS);
goto bad;
}
- bcopy((caddr_t)&myaddr, (caddr_t)bindnam->b_rptr+SO_MSGOFFSET, addrsize);
+ memcpy((caddr_t)bindnam->b_rptr+SO_MSGOFFSET, (caddr_t)&myaddr, addrsize);
bindnam->b_wptr = bindnam->b_rptr + (addrsize+SO_MSGOFFSET+1);
code = sobind(newSocket, bindnam, addrsize);
#ifdef AFS_OSF_ENV
myaddr.sin_len = nam->m_len;
#endif /* AFS_OSF_ENV */
- bcopy(&myaddr, mtod(nam, caddr_t), sizeof(myaddr));
+ memcpy(mtod(nam, caddr_t), &myaddr, sizeof(myaddr));
#ifdef AFS_SGI65_ENV
BHV_PDATA(&bhv) = (void*)newSocket;
code = sobind(&bhv, nam);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_misc.c,v 1.1.1.5 2001/07/14 22:23:32 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_misc.c,v 1.1.1.6 2001/09/11 14:34:18 hartmans Exp $");
#ifdef KERNEL
#include <afs/sysincludes.h>
#include "rx.h"
#endif /* AFS_PTHREAD_ENV */
#include <stdlib.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#ifdef HAVE_UNISTD_H
* the receiver should be greater than
* this one, rather than a resend of an
* earlier sequence number */
-#define RX_FREE_PACKET 16 /* Unallocated to a call */
#define RX_SLOW_START_OK 32 /* Set this flag in an ack packet to
* inform the sender that slow start is
* supported by the receiver. */
#define RX_PRESET_FLAGS (RX_CLIENT_INITIATED | RX_LAST_PACKET)
+/*
+ * Flags for the packet structure itself, housekeeping for the
+ * most part. These live in rx_packet->flags.
+ */
+#define RX_PKTFLAG_ACKED 0x01
+#define RX_PKTFLAG_FREE 0x02
+
+
/* The rx part of the header of a packet, in host form */
struct rx_header {
afs_uint32 epoch; /* Start time of client process */
unsigned int niovecs;
struct iovec wirevec[RX_MAXWVECS+1]; /* the new form of the packet */
- u_char acked; /* This packet has been *tentatively* acknowledged */
+ u_char flags; /* Flags for local state of this packet */
u_char backoff; /* for multiple re-sends */
u_short length; /* Data length */
/* NT port relies on the fact that the next two are physically adjacent.
#define rx_packetwrite(p, off, len, in) \
( (off) + (len) > (p)->wirevec[1].iov_len ? \
rx_SlowWritePacket(p, off, len, (char*)(in)) : \
- ((bcopy((char *)(in), (char*)((p)->wirevec[1].iov_base)+(off), (len))),0))
+ ((memcpy((char*)((p)->wirevec[1].iov_base)+(off), (char *)(in), (len))),0))
/* copy data from an RX packet */
#define rx_packetread(p, off, len, out) \
( (off) + (len) > (p)->wirevec[1].iov_len ? \
rx_SlowReadPacket(p, off, len, (char*)out) : \
- ((bcopy((char*)((p)->wirevec[1].iov_base)+(off), (char *)(out), len)),0))
+ ((memcpy((char *)(out), (char*)((p)->wirevec[1].iov_base)+(off), len)),0))
#define rx_computelen(p,l) { register int i; \
for (l=0, i=1; i < p->niovecs; i++ ) l += p->wirevec[i].iov_len; }
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_rdwr.c,v 1.1.1.7 2001/07/14 22:23:35 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_rdwr.c,v 1.1.1.8 2001/09/11 14:34:22 hartmans Exp $");
#ifdef KERNEL
#ifndef UKERNEL
# include <sys/stat.h>
# include <sys/time.h>
#endif
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#ifdef HAVE_UNISTD_H
while (nbytes && cp) {
t = MIN((int)call->curlen, nbytes);
t = MIN(t, (int)call->nLeft);
- bcopy (call->curpos, buf, t);
+ memcpy(buf, call->curpos, t);
buf += t;
nbytes -= t;
call->curpos += t;
tnLeft = call->nLeft;
if (!call->error && tcurlen > nbytes && tnLeft > nbytes) {
tcurpos = call->curpos;
- bcopy(tcurpos, buf, nbytes);
+ memcpy(buf, tcurpos, nbytes);
call->curpos = tcurpos + nbytes;
call->curlen = tcurlen - nbytes;
call->nLeft = tnLeft - nbytes;
if (!((long)tcurpos & (sizeof(afs_int32)-1))) {
*value = *((afs_int32 *)(tcurpos));
} else {
- bcopy(tcurpos, (char *)value, sizeof(afs_int32));
+ memcpy((char *)value, tcurpos, sizeof(afs_int32));
}
call->curpos = tcurpos + sizeof(afs_int32);
call->curlen = tcurlen - sizeof(afs_int32);
t = MIN((int)call->curlen, nbytes);
t = MIN((int)call->nFree, t);
- bcopy (buf, call->curpos, t);
+ memcpy(call->curpos, buf, t);
buf += t;
nbytes -= t;
call->curpos += t;
tnFree = (int)call->nFree;
if (!call->error && tcurlen >= nbytes && tnFree >= nbytes) {
tcurpos = call->curpos;
- bcopy(buf, tcurpos, nbytes);
+ memcpy(tcurpos, buf, nbytes);
call->curpos = tcurpos + nbytes;
call->curlen = tcurlen - nbytes;
call->nFree = tnFree - nbytes;
if (!((long)tcurpos & (sizeof(afs_int32)-1))) {
*((afs_int32 *)(tcurpos)) = *value;
} else {
- bcopy((char *)value, tcurpos, sizeof(afs_int32));
+ memcpy(tcurpos, (char *)value, sizeof(afs_int32));
}
call->curpos = tcurpos + sizeof(afs_int32);
call->curlen = tcurlen - sizeof(afs_int32);
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_stream.c,v 1.1.1.4 2001/07/14 22:23:33 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_stream.c,v 1.1.1.5 2001/09/11 14:34:23 hartmans Exp $");
#ifdef KERNEL
#include "../h/types.h"
}
if (nbytes < sd->sd.rd.nLeft) {
sd->sd.rd.nLeft -= nbytes;
- bcopy(sd->sd.rd.nextByte, buf, nbytes);
+ memcpy(buf, sd->sd.rd.nextByte, nbytes);
sd->sd.rd.nextByte += nbytes;
return totalBytes;
}
- bcopy(sd->sd.rd.nextByte, buf, sd->sd.rd.nLeft);
+ memcpy(buf, sd->sd.rd.nextByte, sd->sd.rd.nLeft);
buf += sd->sd.rd.nLeft;
nbytes -= sd->sd.rd.nLeft;
tp = queue_First(&sd->sd.rd.rq, rx_packet);
sd->sd.wd.freePtr = rx_DataOf(queue_First(&sd->sd.wd.wq, rx_packet));
}
if (nbytes < sd->sd.wd.nFree) {
- if (buf) bcopy(buf, sd->sd.wd.freePtr, nbytes), buf += nbytes;
+ if (buf) memcpy(sd->sd.wd.freePtr, buf, nbytes), buf += nbytes;
sd->sd.wd.nFree -= nbytes;
sd->sd.wd.freePtr += nbytes;
nbytes = 0;
break;
}
- if (buf) bcopy(buf, sd->sd.wd.freePtr, sd->sd.wd.nFree), buf += sd->sd.wd.nFree;
+ if (buf) memcpy(sd->sd.wd.freePtr, buf, sd->sd.wd.nFree), buf += sd->sd.wd.nFree;
nbytes -= sd->sd.wd.nFree;
sd->sd.wd.nFree = 0;
if (rx_stream_FlushWrite(sd)) break;
/* If it returns 0, the call status should be checked with rx_Error. */
#define rx_stream_Write(iod, buf, nbytes) \
(iod)->sd.wd.nFree > (nbytes) ? \
- (buf) && bcopy((buf), (iod)->sd.wd.freePtr, (nbytes)), \
+ (buf) && memcpy((iod)->sd.wd.freePtr, (buf), (nbytes)), \
(iod)->sd.wd.nFree -= (nbytes), \
(iod)->sd.wd.freePtr += (nbytes), (nbytes) \
: rx_stream_WriteProc((iod), (buf), (nbytes))
/* If it returns less than requested, the call status should be checked with rx_Error */
#define rx_stream_Read(iod, buf, nbytes) \
(iod)->sd.rd.nLeft > (nbytes) ? \
- bcopy((iod)->sd.rd.nextByte, (buf), (nbytes)), \
+ memcpy((buf), (iod)->sd.rd.nextByte, (nbytes)), \
(iod)->sd.rd.nLeft -= (nbytes), (iod)->sd.rd.nextByte += (nbytes), (nbytes) \
: rx_stream_ReadProc((iod), (buf), (nbytes))
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_trace.c,v 1.1.1.5 2001/07/14 22:23:35 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_trace.c,v 1.1.1.6 2001/09/11 14:34:23 hartmans Exp $");
#ifdef RXDEBUG
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#ifdef AFS_NT40_ENV
break;
}
- bcopy(&rxtinfo, rxi_tracebuf+rxi_tracepos, sizeof(struct rx_trace));
+ memcpy(rxi_tracebuf+rxi_tracepos, &rxtinfo, sizeof(struct rx_trace));
rxi_tracepos += sizeof(struct rx_trace);
if (rxi_tracepos >= (4096 - sizeof(struct rx_trace)))
rxi_flushtrace();
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_user.c,v 1.1.1.5 2001/07/14 22:23:35 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_user.c,v 1.1.1.6 2001/09/11 14:34:25 hartmans Exp $");
# include <sys/types.h>
# include <errno.h>
#endif
#include <afs/afs_args.h>
#include <afs/afsutil.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
LOCK_IF
rxi_numNetAddrs = 0;
- bzero(rxi_NetAddrs, sizeof(rxi_NetAddrs));
- bzero(myNetFlags, sizeof(myNetFlags));
- bzero(myNetMTUs, sizeof(myNetMTUs));
- bzero(myNetMasks, sizeof(myNetMasks));
+ memset(rxi_NetAddrs, 0, sizeof(rxi_NetAddrs));
+ memset(myNetFlags, 0, sizeof(myNetFlags));
+ memset(myNetMTUs, 0, sizeof(myNetMTUs));
+ memset(myNetMasks, 0, sizeof(myNetMasks));
UNLOCK_IF
s = socket(AF_INET, SOCK_DGRAM, 0);
#else
ifc.ifc_len = sizeof(ifs);
ifc.ifc_buf = (caddr_t) &ifs[0];
- bzero(&ifs[0], sizeof(ifs));
+ memset(&ifs[0], 0, sizeof(ifs));
#endif
res = ioctl(s, SIOCGIFCONF, &ifc);
if (res < 0) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rxdebug.c,v 1.1.1.6 2001/07/14 22:23:36 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rxdebug.c,v 1.1.1.7 2001/09/11 14:34:25 hartmans Exp $");
#include <sys/types.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_STRINGS_H
-#include <string.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#include <sys/stat.h>
printf("rxdebug: host %s not found in host table\n", name);
exit(1);
}
- bcopy(th->h_addr, &onlyHost, sizeof(afs_int32));
+ memcpy(&onlyHost, th->h_addr, sizeof(afs_int32));
} else onlyHost = -1;
if (as->parms[9].items) {
printf("rxdebug: host %s not found in host table\n", hostName);
exit(1);
}
- bcopy(th->h_addr, &host, sizeof(afs_int32));
+ memcpy(&host, th->h_addr, sizeof(afs_int32));
}
else host = htonl(0x7f000001); /* IP localhost */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/simple.example/sample_client.c,v 1.1.1.4 2001/07/14 22:23:45 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/simple.example/sample_client.c,v 1.1.1.5 2001/09/11 14:34:36 hartmans Exp $");
#include <sys/types.h>
#include <netdb.h>
printf("host address is disagreeable length (%d)", hostent->h_length);
exit(1);
}
- bcopy(hostent->h_addr, (char *)&host, sizeof(host));
+ memcpy((char *)&host, hostent->h_addr, sizeof(host));
return host;
}
#include "afs/param.h"
#include <afsconfig.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/test/kctest.c,v 1.1.1.3 2001/07/11 03:11:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/test/kctest.c,v 1.1.1.4 2001/09/11 14:34:36 hartmans Exp $");
#include <sys/types.h>
#include <netinet/in.h>
struct rxvab_EncryptionKey *akey, *asession;
struct rxvab_Ticket *aticket; {
aticket->ViceId = htonl(71);
- bcopy("testkeyx", &aticket->HandShakeKey, 8);
- bcopy("testkeyx", asession, 8);
+ memcpy(&aticket->HandShakeKey, "testkeyx", 8);
+ memcpy(asession, "testkeyx", 8);
bcrypt_encrypt(aticket, aticket, sizeof(struct rxvab_Ticket), akey);
return 0;
}
printf("could not find host '%s' in host table\n", argv[i+1]);
return -1;
}
- bcopy(th->h_addr, &host, sizeof(long));
+ memcpy(&host, th->h_addr, sizeof(long));
i++;
}
else if (!strcmp(argv[i],"-count")) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/test/testclient.c,v 1.1.1.4 2001/07/14 22:23:46 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/test/testclient.c,v 1.1.1.5 2001/09/11 14:34:37 hartmans Exp $");
#include <sys/types.h>
#include <stdio.h>
if (!hostent) Abort("host %s not found", hostname);
if (hostent->h_length != 4)
Abort("host address is disagreeable length (%d)", hostent->h_length);
- bcopy(hostent->h_addr, (char *)&host, sizeof(host));
+ memcpy((char *)&host, hostent->h_addr, sizeof(host));
if (setFD>0)
OpenFD(setFD);
if (rx_Init(0) != 0) {
#include "afs/param.h"
#include <afsconfig.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/xdr_afsuuid.c,v 1.1.1.3 2001/07/11 03:10:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/xdr_afsuuid.c,v 1.1.1.4 2001/09/11 14:34:26 hartmans Exp $");
#if defined(KERNEL) && !defined(UKERNEL)
#ifdef AFS_LINUX20_ENV
#include "../h/string.h"
-#define bzero(A,C) memset((A), 0, (C))
+#if 0
+#define bzero(A, C) memset((A), 0, (C))
+#endif
#else
#include <sys/param.h>
#include <sys/systm.h>
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/xdr_int64.c,v 1.1.1.3 2001/07/14 22:23:39 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/xdr_int64.c,v 1.1.1.4 2001/09/11 14:34:27 hartmans Exp $");
#if defined(KERNEL) && !defined(UKERNEL)
#ifdef AFS_LINUX20_ENV
#include "../h/string.h"
+#if 0
#define bzero(A,C) memset((A), 0, (C))
+#endif
#else
#include <sys/param.h>
#include <sys/systm.h>
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/xdr_mem.c,v 1.1.1.3 2001/07/14 22:23:37 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/xdr_mem.c,v 1.1.1.4 2001/09/11 14:34:27 hartmans Exp $");
#ifndef NeXT
if ((xdrs->x_handy -= len) < 0)
return (FALSE);
- bcopy(xdrs->x_private, addr, len);
+ memcpy(addr, xdrs->x_private, len);
xdrs->x_private += len;
return (TRUE);
}
if ((xdrs->x_handy -= len) < 0)
return (FALSE);
- bcopy(addr, xdrs->x_private, len);
+ memcpy(xdrs->x_private, addr, len);
xdrs->x_private += len;
return (TRUE);
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/xdr_rec.c,v 1.1.1.3 2001/07/14 22:23:38 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/xdr_rec.c,v 1.1.1.4 2001/09/11 14:34:27 hartmans Exp $");
#include <stdio.h>
#include "xdr.h"
while (len > 0) {
current = (u_int)rstrm->out_boundry - (u_int)rstrm->out_finger;
current = (len < current) ? len : current;
- bcopy(addr, rstrm->out_finger, current);
+ memcpy(rstrm->out_finger, addr, current);
rstrm->out_finger += current;
addr += current;
len -= current;
continue;
}
current = (len < current) ? len : current;
- bcopy(rstrm->in_finger, addr, current);
+ memcpy(addr, rstrm->in_finger, current);
rstrm->in_finger += current;
addr += current;
len -= current;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/xdr_refernce.c,v 1.1.1.3 2001/07/14 22:23:37 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/xdr_refernce.c,v 1.1.1.4 2001/09/11 14:34:28 hartmans Exp $");
#ifndef NeXT
if (loc == NULL) {
return (FALSE);
}
- bzero(loc, (int)size);
+ memset(loc, 0, (int)size);
break;
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_clntout.c,v 1.1.1.4 2001/07/14 22:23:48 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_clntout.c,v 1.1.1.5 2001/09/11 14:34:38 hartmans Exp $");
#include <stdio.h>
#include <string.h>
}
f_print(fout, "res;\n");
f_print(fout, "\n");
- f_print(fout, "\tbzero(%sres, sizeof(res));\n", ampr(proc->res_type));
+ f_print(fout, "\tmemset(%sres, 0, sizeof(res));\n", ampr(proc->res_type));
f_print(fout,
"\tif (clnt_call(clnt, %s, xdr_%s, argp, xdr_%s, %sres, TIMEOUT) != RPC_SUCCESS) {\n",
proc->proc_name, stringfix(proc->arg_type),
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_cout.c,v 1.1.1.4 2001/07/14 22:23:50 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_cout.c,v 1.1.1.5 2001/09/11 14:34:38 hartmans Exp $");
#include <stdio.h>
#include <stdlib.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#include "rpc_util.h"
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_main.c,v 1.1.1.6 2001/07/14 22:23:51 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_main.c,v 1.1.1.7 2001/09/11 14:34:39 hartmans Exp $");
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#ifdef HAVE_SIGNAL_H
OutFileFlag = NULL;
S_output(cmd.infile, "-DRPC_SERVER", !EXTEND, cmd.outfile, 1);
} else {
- if (OutFileFlag && (rindex(OutFile,'.') == NULL))
+ if (OutFileFlag && (strrchr(OutFile,'.') == NULL))
strcat(OutFile, ".");
if (cmd.rflag) {
C_output((OutFileFlag ? OutFile : cmd.infile), "-DRPC_CLIENT", EXTEND, ".cs.c", 1);
if (res == NULL) {
abort();
}
- p = (char *) rindex(file, '.');
+ p = (char *) strrchr(file, '.');
if (p == NULL) {
p = file + strlen(file);
}
- sname = (char *) rindex(file,'/');
+ sname = (char *) strrchr(file, '/');
if (sname == NULL)
sname = file;
else
open_input(infile, define);
cflag = 1;
- bzero(fullname, sizeof(fullname));
+ memset(fullname, 0, sizeof(fullname));
if (append) {
strcpy(fullname, prefix);
strcat(fullname, infile);
open_input(infile, define);
hflag = 1;
- bzero(fullname, sizeof(fullname));
+ memset(fullname, 0, sizeof(fullname));
if (append) {
strcpy(fullname, prefix);
strcat(fullname, infile);
outfilename = extend ? extendfile(fullname, outfile) : outfile;
open_output(infile, outfilename);
strcpy(fullname, outfilename);
- if (p = (char *)index(fullname, '.')) *p = '\0';
+ if (p = strchr(fullname, '.')) *p = '\0';
f_print(fout, "/* Machine generated file -- Do NOT edit */\n\n");
f_print(fout, "#ifndef _RXGEN_%s_\n", uppercase(fullname));
f_print(fout, "#define _RXGEN_%s_\n\n", uppercase(fullname));
f_print(fout, "#ifdef KERNEL\n");
f_print(fout, "/* The following 'ifndefs' are not a good solution to the vendor's omission of surrounding all system includes with 'ifndef's since it requires that this file is included after the system includes...*/\n");
+ f_print(fout, "#include <afsconfig.h>\n");
f_print(fout, "#include \"../afs/param.h\"\n");
f_print(fout, "#ifdef UKERNEL\n");
f_print(fout, "#include \"../afs/sysincludes.h\"\n");
Cflag = 1;
open_input(infile, define);
- bzero(fullname, sizeof(fullname));
+ memset(fullname, 0, sizeof(fullname));
if (append) {
strcpy(fullname, prefix);
strcat(fullname, infile);
Sflag = 1;
open_input(infile, define);
- bzero(fullname, sizeof(fullname));
+ memset(fullname, 0, sizeof(fullname));
if (append) {
strcpy(fullname, prefix);
strcat(fullname, infile);
if (argc < 2) {
return (0);
}
- bzero(flag, sizeof(flag));
+ memset(flag, 0, sizeof(flag));
cmd->outfile = NULL;
for (i = 1; i < argc; i++) {
if (argv[i][0] != '-') {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_parse.c,v 1.1.1.5 2001/07/14 22:23:50 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_parse.c,v 1.1.1.6 2001/09/11 14:34:40 hartmans Exp $");
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#include "rpc_util.h"
token tok;
defp = ALLOC(definition);
- bzero((char *)defp, sizeof(definition));
+ memset((char *)defp, 0, sizeof(definition));
get_token(&tok);
switch (tok.kind) {
case TOK_STRUCT:
do {
get_token(tokp);
Proc_list = ALLOC(proc1_list);
- bzero((char *)Proc_list, sizeof(proc1_list));
+ memset((char *)Proc_list, 0, sizeof(proc1_list));
Proc_list->pl.param_flag = 0;
switch (tokp->kind) {
case TOK_IN:
*Proc_listp = Proc_list;
Proc_listp = &Proc_list->next;
decls = ALLOC(decl_list);
- bzero((char *)decls, sizeof(decl_list));
+ memset((char *)decls, 0, sizeof(decl_list));
decls->decl = dec;
*tailp = decls;
tailp = &decls->next;
for (plist1 = defp->pc.plists; plist1; plist1 = plist1->next) {
if ((plist1->component_kind == DEF_PARAM) && streq(plist->pl.param_type, plist1->pl.param_type) && !(plist1->pl.param_flag & PROCESSED_PARAM)) {
char *star="";
- char *pntr = index(plist1->pl.param_type, '*');
+ char *pntr = strchr(plist1->pl.param_type, '*');
if (pntr) star = "*";
if (plist1->pl.param_flag & OUT_STRING) {
f_print(fout, ", *%s%s", star, plist1->pl.param_name);
for (plist = defp->pc.plists; plist; plist = plist->next) {
if ((plist->component_kind == DEF_PARAM) && !(plist->pl.param_flag & PROCESSED_PARAM)) {
if (plist->pl.param_flag & INDIRECT_PARAM) {
- char pres, *pntr = index(plist->pl.param_type, '*');
+ char pres, *pntr = strchr(plist->pl.param_type, '*');
if (pntr){ --pntr; pres = *pntr; *pntr = (char)0; }
f_print(fout, "\t%s %s", plist->pl.param_type, plist->pl.param_name);
*pntr = pres;
- } else if (index(plist->pl.param_type, '*') == 0) {
+ } else if (strchr(plist->pl.param_type, '*') == 0) {
f_print(fout, "\t%s %s", plist->pl.param_type, plist->pl.param_name);
} else {
plist->pl.param_flag |= FREETHIS_PARAM;
if ((plist1->component_kind == DEF_PARAM) && streq(plist->pl.param_type, plist1->pl.param_type) && !(plist1->pl.param_flag & PROCESSED_PARAM)) {
if (plist1->pl.param_flag & INDIRECT_PARAM) {
f_print(fout, ", %s", plist1->pl.param_name);
- } else if (index(plist1->pl.param_type, '*') == 0) {
+ } else if (strchr(plist1->pl.param_type, '*') == 0) {
f_print(fout, ", %s", plist1->pl.param_name);
} else {
plist1->pl.param_flag |= FREETHIS_PARAM;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_scan.c,v 1.1.1.4 2001/07/14 22:23:51 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_scan.c,v 1.1.1.5 2001/09/11 14:34:40 hartmans Exp $");
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#include "rpc_scan.h"
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_svcout.c,v 1.1.1.4 2001/07/14 22:23:51 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_svcout.c,v 1.1.1.5 2001/09/11 14:34:40 hartmans Exp $");
#include <stdio.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#include "rpc_parse.h"
f_print(fout, "\t\treturn;\n");
f_print(fout, "\t}\n");
- f_print(fout, "\tbzero(&%s, sizeof(%s));\n", ARG, ARG);
+ f_print(fout, "\tmemset(&%s, 0, sizeof(%s));\n", ARG, ARG);
printif("getargs", TRANSP, "&", ARG);
printerr("decode", TRANSP);
f_print(fout, "\t\treturn;\n");
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_util.c,v 1.1.1.4 2001/07/14 22:23:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_util.c,v 1.1.1.5 2001/09/11 14:34:41 hartmans Exp $");
#include <stdio.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#include "rpc_scan.h"
reinitialize()
{
int i;
- bzero(curline, MAXLINESIZE);
+ memset(curline, 0, MAXLINESIZE);
where = curline;
linenum = 0;
defined = NULL;
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/domestic/crypt_conn.c,v 1.1.1.5 2001/07/14 22:23:54 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/domestic/crypt_conn.c,v 1.1.1.6 2001/09/11 14:34:45 hartmans Exp $");
#ifdef KERNEL
#include "../afs/stds.h"
rxkad_stats.bytesDecrypted[rxkad_TypeIndex(tp->type)] += len;
UNLOCK_RXKAD_STATS
- bcopy ((void *)ivec, (void *)xor, sizeof(xor));
+ memcpy((void *)xor, (void *)ivec, sizeof(xor));
for (i = 0; len ; i++) {
data = rx_data(packet, i, tlen);
if (!data || !tlen)
*/
rx_PutInt32(packet, 1*sizeof(afs_int32), 0);
- bcopy ((void *)ivec, (void *)xor, sizeof(xor));
+ memcpy((void *)xor, (void *)ivec, sizeof(xor));
for (i = 0; len ; i++) {
data = rx_data(packet, i, tlen);
if (!data || !tlen)
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/domestic/fcrypt.c,v 1.1.1.5 2001/07/14 22:23:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/domestic/fcrypt.c,v 1.1.1.6 2001/09/11 14:34:46 hartmans Exp $");
#define DEBUG 0
#ifdef KERNEL
#endif
#if 0
- bcopy (clear, &L, sizeof(afs_int32));
- bcopy (clear+1, &R, sizeof(afs_int32));
+ memcpy(&L, clear, sizeof(afs_int32));
+ memcpy(&R, clear+1, sizeof(afs_int32));
#else
L = ntohl(*clear);
R = ntohl(*(clear+1));
}
}
#if 0
- bcopy (&L, cipher, sizeof(afs_int32));
- bcopy (&R, cipher+1, sizeof(afs_int32));
+ memcpy(cipher, &L, sizeof(afs_int32));
+ memcpy(cipher+1, &R, sizeof(afs_int32));
#else
*cipher = htonl(L);
*(cipher+1) = htonl(R);
if (encrypt) {
for (i = 0; length > 0; i++, length -= 8) {
/* get input */
- bcopy (input, t_input, sizeof(t_input));
+ memcpy(t_input, input, sizeof(t_input));
input += sizeof(t_input);
/* zero pad */
fc_ecb_encrypt (xor, t_output, key, encrypt);
/* copy temp output and save it for cbc */
- bcopy (t_output, output, sizeof(t_output));
+ memcpy(output, t_output, sizeof(t_output));
output += sizeof(t_output);
/* calculate xor value for next round from plain & cipher text */
/* decrypt */
for (i = 0; length > 0; i++, length -= 8) {
/* get input */
- bcopy (input, t_input, sizeof(t_input));
+ memcpy(t_input, input, sizeof(t_input));
input += sizeof(t_input);
/* no padding for decrypt */
t_output[1] ^= xor[1] ;
/* copy temp output */
- bcopy (t_output, output, sizeof(t_output));
+ memcpy(output, t_output, sizeof(t_output));
output += sizeof(t_output);
/* calculate xor value for next round from plain & cipher text */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/domestic/tcrypt.c,v 1.1.1.4 2001/07/14 22:23:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/domestic/tcrypt.c,v 1.1.1.5 2001/09/11 14:34:46 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
afs_uint32 xor[2];
for (i=0; i<10; i++) msg[i]=htonl(i);
- bcopy ("abcdefgh", &key, sizeof(struct ktc_encryptionKey));
+ memcpy(&key, "abcdefgh", sizeof(struct ktc_encryptionKey));
fc_keysched (&key, schedule);
print_msg ("Starting msg is:", msg, sizeof(msg));
- bcopy(&key, xor, 2*sizeof(afs_int32));
+ memcpy(xor, &key, 2*sizeof(afs_int32));
fc_cbc_encrypt (msg, out, sizeof(msg), schedule, &key, ENCRYPT);
- bcopy(&key, xor, 2*sizeof(afs_int32));
+ memcpy(xor, &key, 2*sizeof(afs_int32));
fc_cbc_encrypt (out, dec, sizeof(msg), schedule, &key, DECRYPT);
- if (bcmp (msg, dec, sizeof(msg)) != 0)
+ if (memcmp (msg, dec, sizeof(msg)) != 0)
printf ("Encryption FAILED!\n");
print_msg ("Encrypted is:", out, sizeof(out));
print_msg ("Decrypted is:", dec, sizeof(dec));
#endif
e[0] = 0x11111111;
e[1] = 0xaaaaaaaa;
- bcopy ("abcdefgh", &key, sizeof(struct ktc_encryptionKey));
+ memcpy(&key, "abcdefgh", sizeof(struct ktc_encryptionKey));
for (rounds=2; rounds<=MAXROUNDS; rounds +=2) {
#ifdef TCRYPT
ROUNDS = rounds;
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_client.c,v 1.1.1.5 2001/07/14 22:23:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_client.c,v 1.1.1.6 2001/09/11 14:34:42 hartmans Exp $");
#ifdef KERNEL
#include "../afs/stds.h"
if (aobj) {
/* block is ready for encryption with session key, let's go for it. */
tcp = (struct rxkad_cprivate *) aobj->privateData;
- bcopy((void *)tcp->ivec, (void *)xor, 2*sizeof(afs_int32));
+ memcpy((void *)xor, (void *)tcp->ivec, 2*sizeof(afs_int32));
fc_cbc_encrypt((char *) &tgen, (char *) &tgen, sizeof(tgen),
tcp->keysched, xor, ENCRYPT);
} else {
/* Create a session key so that we can encrypt it */
}
- bcopy(((char *)&tgen) + sizeof(tgen) - ENCRYPTIONBLOCKSIZE,
- (void *)Cuid, ENCRYPTIONBLOCKSIZE);
+ memcpy((void *)Cuid, ((char *)&tgen) + sizeof(tgen) - ENCRYPTIONBLOCKSIZE, ENCRYPTIONBLOCKSIZE);
Cuid[0] = (Cuid[0] & ~0x40000000) | 0x80000000;
Cuid[1] &= RX_CIDMASK;
rx_SetEpoch (Cuid[0]); /* for future rxnull connections */
size = sizeof(struct rx_securityClass);
tsc = (struct rx_securityClass *) rxi_Alloc (size);
- bzero ((void *)tsc, size);
+ memset((void *)tsc, 0, size);
tsc->refCount = 1; /* caller gets one for free */
tsc->ops = &rxkad_client_ops;
size = sizeof(struct rxkad_cprivate);
tcp = (struct rxkad_cprivate *) rxi_Alloc (size);
- bzero ((void *)tcp, size);
+ memset((void *)tcp, 0, size);
tsc->privateData = (char *) tcp;
tcp->type |= rxkad_client;
tcp->level = level;
code = fc_keysched (sessionkey, tcp->keysched);
if (code) return 0; /* bad key */
- bcopy ((void *)sessionkey, (void *)tcp->ivec, sizeof(tcp->ivec));
+ memcpy((void *)tcp->ivec, (void *)sessionkey, sizeof(tcp->ivec));
tcp->kvno = kvno; /* key version number */
tcp->ticketLen = ticketLen; /* length of ticket */
- bcopy(ticket, tcp->ticket, ticketLen);
+ memcpy(tcp->ticket, ticket, ticketLen);
LOCK_RXKAD_STATS
rxkad_stats_clientObjects++;
if (v2) {
int i;
afs_uint32 xor[2];
- bzero ((void *)&r_v2, sizeof(r_v2));
+ memset((void *)&r_v2, 0, sizeof(r_v2));
r_v2.version = htonl(RXKAD_CHALLENGE_PROTOCOL_VERSION);
r_v2.spare = 0;
(void) rxkad_SetupEndpoint (aconn, &r_v2.encrypted.endpoint);
r_v2.kvno = htonl(tcp->kvno);
r_v2.ticketLen = htonl(tcp->ticketLen);
r_v2.encrypted.endpoint.cksum = rxkad_CksumChallengeResponse (&r_v2);
- bcopy((void *)tcp->ivec, (void *)xor, 2*sizeof(afs_int32));
+ memcpy((void *)xor, (void *)tcp->ivec, 2*sizeof(afs_int32));
fc_cbc_encrypt (&r_v2.encrypted, &r_v2.encrypted,
sizeof(r_v2.encrypted), tcp->keysched, xor, ENCRYPT);
response = (char *)&r_v2;
responseSize = sizeof(r_v2);
} else {
- bzero ((void *)&r_old, sizeof(r_old));
+ memset((void *)&r_old, 0, sizeof(r_old));
r_old.encrypted.incChallengeID = htonl(challengeID + 1);
r_old.encrypted.level = htonl((afs_int32)tcp->level);
r_old.kvno = htonl(tcp->kvno);
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_common.c,v 1.1.1.5 2001/07/14 22:23:53 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_common.c,v 1.1.1.6 2001/09/11 14:34:42 hartmans Exp $");
#ifdef KERNEL
#ifndef UKERNEL
char *rxi_Alloc();
-#ifndef max
-#define max(a,b) ((a) < (b)? (b) : (a))
-#endif /* max */
+#ifndef afs_max
+#define afs_max(a,b) ((a) < (b)? (b) : (a))
+#endif /* afs_max */
#ifndef KERNEL
#define osi_Time() time(0)
afs_uint32 xor[2];
rxkad_SetupEndpoint(aconnp, &tendpoint);
- bcopy(aivec, (void *)xor, 2*sizeof(afs_int32));
+ memcpy((void *)xor, aivec, 2*sizeof(afs_int32));
fc_cbc_encrypt(&tendpoint, &tendpoint, sizeof(tendpoint),
aschedule, xor, ENCRYPT);
- bcopy(((char *)&tendpoint) + sizeof(tendpoint) - ENCRYPTIONBLOCKSIZE,
- aresult, ENCRYPTIONBLOCKSIZE);
+ memcpy(aresult, ((char *)&tendpoint) + sizeof(tendpoint) - ENCRYPTIONBLOCKSIZE, ENCRYPTIONBLOCKSIZE);
return 0;
}
if (rx_IsServerConn(aconn)) {
int size = sizeof(struct rxkad_sconn);
aconn->securityData = (char *) rxi_Alloc (size);
- bzero(aconn->securityData, size); /* initialize it conveniently */
+ memset(aconn->securityData, 0, size); /* initialize it conveniently */
}
else { /* client */
struct rxkad_cprivate *tcp;
int size = sizeof(struct rxkad_cconn);
tccp = (struct rxkad_cconn *) rxi_Alloc (size);
aconn->securityData = (char *) tccp;
- bzero(aconn->securityData, size); /* initialize it conveniently */
+ memset(aconn->securityData, 0, size); /* initialize it conveniently */
tcp = (struct rxkad_cprivate *) aobj->privateData;
if (!(tcp->type & rxkad_client)) return RXKADINCONSISTENCY;
rxkad_SetLevel(aconn, tcp->level); /* set header and trailer sizes */
switch (level) {
case rxkad_clear: return 0; /* shouldn't happen */
case rxkad_auth:
- nlen = max (ENCRYPTIONBLOCKSIZE,
+ nlen = afs_max (ENCRYPTIONBLOCKSIZE,
len + rx_GetSecurityHeaderSize(tconn));
if (nlen > (len + rx_GetSecurityHeaderSize(tconn))) {
rxi_RoundUpPacket(apacket, nlen - (len + rx_GetSecurityHeaderSize(tconn)));
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_server.c,v 1.1.1.6 2001/07/14 22:23:54 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_server.c,v 1.1.1.7 2001/09/11 14:34:43 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
size = sizeof(struct rx_securityClass);
tsc = (struct rx_securityClass *) osi_Alloc (size);
- bzero (tsc, size);
+ memset(tsc, 0, size);
tsc->refCount = 1; /* caller has one reference */
tsc->ops = &rxkad_server_ops;
size = sizeof(struct rxkad_sprivate);
tsp = (struct rxkad_sprivate *) osi_Alloc (size);
- bzero (tsp, size);
+ memset(tsp, 0, size);
tsc->privateData = (char *) tsp;
tsp->type |= rxkad_server; /* so can identify later */
if (rx_IsUsingPktCksum(aconn)) sconn->cksumSeen = 1;
if (sconn->cksumSeen) {
- bzero (&c_v2, sizeof(c_v2));
+ memset(&c_v2, 0, sizeof(c_v2));
c_v2.version = htonl(RXKAD_CHALLENGE_PROTOCOL_VERSION);
c_v2.challengeID = htonl(sconn->challengeID);
c_v2.level = htonl((afs_int32)sconn->level);
challenge = (char *)&c_v2;
challengeSize = sizeof(c_v2);
} else {
- bzero (&c_old, sizeof(c_old));
+ memset(&c_old, 0, sizeof(c_old));
c_old.challengeID = htonl(sconn->challengeID);
c_old.level = htonl((afs_int32)sconn->level);
challenge = (char *)&c_old;
code = fc_keysched (&sessionkey, sconn->keysched);
if (code) return RXKADBADKEY;
- bcopy (&sessionkey, sconn->ivec, sizeof(sconn->ivec));
+ memcpy(sconn->ivec, &sessionkey, sizeof(sconn->ivec));
if (sconn->cksumSeen) {
/* using v2 response */
int i;
afs_uint32 xor[2];
- bcopy(sconn->ivec, xor, 2*sizeof(afs_int32));
+ memcpy(xor, sconn->ivec, 2*sizeof(afs_int32));
fc_cbc_encrypt (&v2r.encrypted, &v2r.encrypted, sizeof(v2r.encrypted),
sconn->keysched, xor, DECRYPT);
cksum = rxkad_CksumChallengeResponse (&v2r);
return RXKADSEALEDINCON;
(void) rxkad_SetupEndpoint (aconn, &endpoint);
v2r.encrypted.endpoint.cksum = 0;
- if (bcmp (&endpoint, &v2r.encrypted.endpoint, sizeof(endpoint)) != 0)
+ if (memcmp (&endpoint, &v2r.encrypted.endpoint, sizeof(endpoint)) != 0)
return RXKADSEALEDINCON;
for (i=0; i<RX_MAXCALLS; i++) {
v2r.encrypted.callNumbers[i] = ntohl(v2r.encrypted.callNumbers[i]);
else { /* save the info for later retreival */
int size = sizeof(struct rxkad_serverinfo);
rock = (struct rxkad_serverinfo *) osi_Alloc (size);
- bzero (rock, size);
+ memset(rock, 0, size);
rock->kvno = kvno;
- bcopy (&client, &rock->client, sizeof(rock->client));
+ memcpy(&rock->client, &client, sizeof(rock->client));
sconn->rock = rock;
}
return 0;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/test/stress.c,v 1.1.1.4 2001/07/14 22:23:56 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/test/stress.c,v 1.1.1.5 2001/09/11 14:34:43 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
sParms = (struct serverParms *) osi_Alloc (sizeof(*sParms));
cParms = (struct clientParms *) osi_Alloc (sizeof(*cParms));
- bzero (sParms, sizeof(*sParms));
- bzero (cParms, sizeof(*cParms));
+ memset(sParms, 0, sizeof(*sParms));
+ memset(cParms, 0, sizeof(*cParms));
sParms->whoami = cParms->whoami = whoami;
if (!(startServer || startClient)) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/test/stress_c.c,v 1.1.1.5 2001/07/14 22:23:56 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/test/stress_c.c,v 1.1.1.6 2001/09/11 14:34:44 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
fprintf (stderr, "host %s not found\n", aname);
return errno;
}
- bcopy(th->h_addr, &addr, sizeof(addr));
+ memcpy(&addr, th->h_addr, sizeof(addr));
return addr;
}
#endif
assert (i < MAX_CTHREADS);
w = (struct worker *) osi_Alloc (sizeof(struct worker));
- bzero (w, sizeof(*w));
+ memset(w, 0, sizeof(*w));
w->next = workers;
workers = w;
w->index = i;
DivideUpCalls (parms->slowCalls, parms->threads, slowCalls);
DivideUpCalls (parms->copiousCalls, parms->threads, copiousCalls);
- bzero (&c, sizeof(c));
+ memset(&c, 0, sizeof(c));
c.conn = conn;
c.sendLen = parms->sendLen;
c.recvLen = parms->recvLen;
int i;
struct multiChannel mc;
- bzero (&mc, sizeof(mc));
+ memset(&mc, 0, sizeof(mc));
mc.conn = conn;
for (i=0; i<RX_MAXCALLS; i++) {
codes[i] = RXKST_PROCESSRUNNING;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/test/stress_s.c,v 1.1.1.4 2001/07/14 22:23:56 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/test/stress_s.c,v 1.1.1.5 2001/09/11 14:34:45 hartmans Exp $");
#include <afs/stds.h>
#include <stdio.h>
IN long kvno;
OUT struct ktc_encryptionKey *key;
{
- bcopy (&serviceKey, key, sizeof(*key));
+ memcpy(key, &serviceKey, sizeof(*key));
return 0;
}
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/ticket.c,v 1.1.1.5 2001/07/14 22:23:53 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/ticket.c,v 1.1.1.6 2001/09/11 14:34:43 hartmans Exp $");
#if defined(UKERNEL)
#include "../afs/sysincludes.h"
getstr (inst, 0);
getstr (realm, 0);
- bcopy (ticket, host, sizeof (*host));
+ memcpy(host, ticket, sizeof (*host));
ticket += sizeof(*host);
*host = ktohl (flags, *host);
- bcopy (ticket, sessionKey, sizeof (struct ktc_encryptionKey));
+ memcpy(sessionKey, ticket, sizeof (struct ktc_encryptionKey));
ticket += sizeof (struct ktc_encryptionKey);
lifetime = *ticket++;
- bcopy (ticket, start, sizeof (*start));
+ memcpy(start, ticket, sizeof (*start));
ticket += sizeof(*start);
*start = ktohl (flags, *start);
*end = life_to_time (*start, lifetime);
strcpy (ticket, name); \
ticket += slen+1
#define putint(num) num = htonl(num);\
- bcopy (&num, ticket, sizeof(num));\
+ memcpy(ticket, &num, sizeof(num));\
ticket += sizeof(num)
static int assemble_athena_ticket (ticket, ticketLen, name, inst, realm,
putstr (realm, 0);
putint (host);
- bcopy (sessionKey, ticket, sizeof(struct ktc_encryptionKey));
+ memcpy(ticket, sessionKey, sizeof(struct ktc_encryptionKey));
ticket += sizeof(struct ktc_encryptionKey);
life = time_to_life (start, end);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/scout/scout.c,v 1.1.1.4 2001/07/14 22:23:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/scout/scout.c,v 1.1.1.5 2001/09/11 14:34:47 hartmans Exp $");
#undef IN
#ifdef AFS_AIX32_ENV
* Fill in the top fields (except the disk fields, which will be
* done elsewhere), then create the light onodes.
*/
- bcopy((char *)a_skt, (char *)&(a_line->skt), sizeof(struct sockaddr_in));
+ memcpy((char *)&(a_line->skt), (char *)a_skt, sizeof(struct sockaddr_in));
a_line->numDisks = 0;
a_line->base_line = a_lineNum + scout_screen.base_line_num;
a_line->num_lines = 1;
rn, a_numservers, sktbytes);
scout_CleanExit(-1);
}
- bzero(FSSktArray, sktbytes);
+ memset(FSSktArray, 0, sktbytes);
/*
* Sweep through the server names provided, filling in the socket
rn, fullsrvname);
return(-1);
}
- bcopy(he->h_addr, &(curr_skt->sin_addr.s_addr), 4);
+ memcpy(&(curr_skt->sin_addr.s_addr), he->h_addr, 4);
curr_skt->sin_family = htons(AF_INET); /*Internet family*/
curr_skt->sin_port = htons(7000); /*FileServer port*/
rn, mini_line_bytes, a_numservers);
return(-1);
}
- bzero(mini_lines, mini_line_bytes);
+ memset(mini_lines, 0, mini_line_bytes);
/*
* Set up each line in the mini_lines, creating and initializing
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/sys/rmtsysc.c,v 1.1.1.6 2001/07/14 22:24:04 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/sys/rmtsysc.c,v 1.1.1.7 2001/09/11 14:34:51 hartmans Exp $");
#include <errno.h>
#include <limits.h>
printf("host %s not found; %s call aborted\n", afs_server, syscall);
return 0;
}
- bcopy(th->h_addr, &hostAddr, sizeof(hostAddr));
+ memcpy(&hostAddr, th->h_addr, sizeof(hostAddr));
return hostAddr;
}
if (!(inbuffer = (char *)malloc(ins)))
return (-1); /* helpless here */
if (data->in_size)
- bcopy(data->in, inbuffer, data->in_size);
+ memcpy(inbuffer, data->in, data->in_size);
InData.rmtbulk_len = data->in_size;
InData.rmtbulk_val = inbuffer;
inparam_conversion(cmd, InData.rmtbulk_val, 0);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/sys/rmtsyss.c,v 1.1.1.5 2001/07/14 22:24:05 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/sys/rmtsyss.c,v 1.1.1.6 2001/09/11 14:34:52 hartmans Exp $");
#include <sys/types.h>
#include <sys/ioctl.h>
data.in = (char *)malloc(InData->rmtbulk_len + PIOCTL_HEADER*sizeof(afs_int32));
if (!data.in) return (-1); /* helpless here */
if (!strcmp(path, NIL_PATHP)) pathp = (char *)0; /* It meant to be NIL */
- bcopy(blob, data.in, sizeof(blob));
+ memcpy(data.in, blob, sizeof(blob));
inparam_conversion(cmd, InData->rmtbulk_val, 1);
- bcopy(InData->rmtbulk_val, data.in+sizeof(blob), InData->rmtbulk_len);
+ memcpy(data.in+sizeof(blob), InData->rmtbulk_val, InData->rmtbulk_len);
data.in_size = InData->rmtbulk_len + PIOCTL_HEADER*sizeof(afs_int32);
data.out = OutData->rmtbulk_val;
data.out_size = OutData->rmtbulk_len;
# nmake /nologo /f ntmakefile install
#----------------------------------------------- BUTC
-$(BUTCEXE): $(BUTCOBJS) $(BUTCLIBS)\r
+$(BUTCEXE): $(BUTCOBJS) $(BUTCLIBS)
$(EXECONLINK)
$(EXEPREP)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/tsm41/aix41_auth.c,v 1.1.1.4 2001/07/14 22:24:05 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/tsm41/aix41_auth.c,v 1.1.1.5 2001/09/11 14:34:53 hartmans Exp $");
#if defined(AFS_AIX41_ENV)
#include <sys/types.h>
* each time we call the authenticate routine.
*/
ka_Init(0);
- bzero(meths, sizeof(struct secmethod_table));
+ memset(meths, 0, sizeof(struct secmethod_table));
/*
* Initialize the exported interface routines. Except the authenticate one
* the others are currently mainly noops.
$(DESTDIR)\lib\afs\afsreg.lib \
$(DESTDIR)\lib\afs\afsprocmgmt.lib \
$(DESTDIR)\lib\afs\afseventlog.lib \
+ $(DESTDIR)\lib\afs\afsutil.lib \
$(DESTDIR)\lib\pthread.lib
$(EXEFILE): $(EXEOBJS) $(EXELIBS)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/beacon.c,v 1.1.1.7 2001/07/14 22:24:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/beacon.c,v 1.1.1.8 2001/09/11 14:34:55 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
for (i = 0; i < info->numServers; i++) {
if (i == me) continue;
ts = (struct ubik_server *) malloc(sizeof(struct ubik_server));
- bzero(ts, sizeof(struct ubik_server));
+ memset(ts, 0, sizeof(struct ubik_server));
ts->next = ubik_servers;
ubik_servers = ts;
ts->addr[0] = info->hostAddr[i].sin_addr.s_addr;
while (servAddr = *aservers++) {
if (i >= MAXSERVERS) return UNHOSTS; /* too many hosts */
ts = (struct ubik_server *) malloc(sizeof(struct ubik_server));
- bzero(ts, sizeof(struct ubik_server));
+ memset(ts, 0, sizeof(struct ubik_server));
ts->next = ubik_servers;
ubik_servers = ts;
ts->addr[0] = servAddr; /* primary address in net byte order */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/disk.c,v 1.1.1.4 2001/07/14 22:24:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/disk.c,v 1.1.1.5 2001/09/11 14:34:55 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
struct buffer *tb;
int i;
- bcopy(&ubik_dbase->version, &aparm->localVersion, sizeof(struct ubik_version));
+ memcpy(&aparm->localVersion, &ubik_dbase->version, sizeof(struct ubik_version));
aparm->lockedPages = 0;
aparm->writeLockedPages = 0;
tb = Buffers;
int i;
struct buffer *tb;
Buffers = (struct buffer *) malloc(abuffers * sizeof(struct buffer));
- bzero(Buffers, abuffers * sizeof(struct buffer));
+ memset(Buffers, 0, abuffers * sizeof(struct buffer));
BufferData = (char *) malloc(abuffers * PAGESIZE);
nbuffers = abuffers;
for(i=0;i<PHSIZE;i++) phTable[i] = 0;
/* can't find it */
tb = newslot(dbase, fid, page);
if (!tb) return 0;
- bzero(tb->data, PAGESIZE);
+ memset(tb->data, 0, PAGESIZE);
tb->lockers++;
code = (*dbase->read)(dbase, fid, tb->data, page*PAGESIZE, PAGESIZE);
if ((tb = newslot(dbase, fid, page)) == 0) return (char *) 0;
tb->lockers++;
- bzero(tb->data, PAGESIZE);
+ memset(tb->data, 0, PAGESIZE);
return tb->data;
}
offset = apos & (PAGESIZE-1);
len = PAGESIZE - offset;
if (len > alen) len = alen;
- bcopy(bp+offset, abuffer, len);
+ memcpy(abuffer, bp+offset, len);
abuffer += len;
apos += len;
alen -= len;
if (!bp) {
bp = DNew(dbase, afile, apos>>LOGPAGESIZE);
if (!bp) return UIOERROR;
- bzero(bp, PAGESIZE);
+ memset(bp, 0, PAGESIZE);
}
/* otherwise, min of remaining bytes and end of buffer to user mode */
offset = apos & (PAGESIZE-1);
len = PAGESIZE-offset;
if (len > alen) len = alen;
- bcopy(abuffer, bp+offset, len);
+ memcpy(bp+offset, abuffer, len);
abuffer += len;
apos += len;
alen -= len;
if (code) return code;
}
tt = (struct ubik_trans *) malloc(sizeof(struct ubik_trans));
- bzero(tt, sizeof(struct ubik_trans));
+ memset(tt, 0, sizeof(struct ubik_trans));
tt->dbase = adbase;
tt->next = adbase->activeTrans;
adbase->activeTrans = tt;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/recovery.c,v 1.1.1.5 2001/07/14 22:24:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/recovery.c,v 1.1.1.6 2001/09/11 14:34:56 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
#include <rx/xdr.h>
#include <rx/rx.h>
#include <errno.h>
+#include <afs/afsutil.h>
#define UBIK_INTERNALS
#include "ubik.h"
if (!code) {
/* we got a new file, set up its header */
urecovery_state |= UBIK_RECHAVEDB;
- bcopy(&tversion, &ubik_dbase->version, sizeof(struct ubik_version));
+ memcpy(&ubik_dbase->version, &tversion, sizeof(struct ubik_version));
(*ubik_dbase->sync)(ubik_dbase, 0); /* get data out first */
/* after data is good, sync disk with correct label */
code = (*ubik_dbase->setlabel)(ubik_dbase, 0, &ubik_dbase->version);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/remote.c,v 1.1.1.5 2001/07/14 22:24:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/remote.c,v 1.1.1.6 2001/09/11 14:34:56 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
This way, good label is only on good database. */
(*ubik_dbase->sync)(dbase, file);
code = (*ubik_dbase->setlabel)(dbase, file, avers);
- bcopy(avers, &ubik_dbase->version, sizeof(struct ubik_version));
+ memcpy(&ubik_dbase->version, avers, sizeof(struct ubik_version));
udisk_Invalidate(dbase, file); /* new dbase, flush disk buffers */
LWP_NoYieldSignal(&dbase->version);
DBRELE(dbase);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/ubik.c,v 1.1.1.6 2001/07/14 22:24:08 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/ubik.c,v 1.1.1.7 2001/09/11 14:34:57 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
tdb->pathName = (char *) malloc(strlen(pathName)+1);
strcpy(tdb->pathName, pathName);
tdb->activeTrans = (struct ubik_trans *) 0;
- bzero(&tdb->version, sizeof(struct ubik_version));
- bzero(&tdb->cachedVersion, sizeof(struct ubik_version));
+ memset(&tdb->version, 0, sizeof(struct ubik_version));
+ memset(&tdb->cachedVersion, 0, sizeof(struct ubik_version));
Lock_Init(&tdb->versionLock);
tdb->flags = 0;
tdb->read = uphys_read;
dbase = transPtr->dbase;
DBHOLD(dbase);
- bzero(&dbase->cachedVersion, sizeof(struct ubik_version));
+ memset(&dbase->cachedVersion, 0, sizeof(struct ubik_version));
/* see if we're still up-to-date */
if (!urecovery_AllBetter(dbase, transPtr->flags & TRREADANY)) {
udisk_abort(transPtr);
dbase = transPtr->dbase;
DBHOLD(dbase);
- bzero(&dbase->cachedVersion, sizeof(struct ubik_version));
+ memset(&dbase->cachedVersion, 0, sizeof(struct ubik_version));
/* give up if no longer current */
if (!urecovery_AllBetter(dbase, transPtr->flags & TRREADANY)) {
success:
udisk_end(transPtr);
/* update version on successful EndTrans */
- bcopy(&dbase->version, &dbase->cachedVersion, sizeof(struct ubik_version));
+ memcpy(&dbase->cachedVersion, &dbase->version, sizeof(struct ubik_version));
DBRELE(dbase);
return 0;
iovec[transPtr->iovec_info.iovec_wrt_len].position = transPtr->seekPos;
iovec[transPtr->iovec_info.iovec_wrt_len].length = length;
- bcopy(buffer,
- &transPtr->iovec_data.iovec_buf_val[transPtr->iovec_data.iovec_buf_len],
- length);
+ memcpy(&transPtr->iovec_data.iovec_buf_val[transPtr->iovec_data.iovec_buf_len], buffer, length);
transPtr->iovec_info.iovec_wrt_len++;
transPtr->iovec_data.iovec_buf_len += length;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/ubikcmd.c,v 1.1.1.4 2001/07/14 22:24:08 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/ubikcmd.c,v 1.1.1.5 2001/09/11 14:34:58 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
gethostname(hostname, sizeof(hostname));
th = gethostbyname(hostname);
if (!th) return UBADHOST;
- bcopy(th->h_addr, &myHost, sizeof(afs_int32));
+ memcpy(&myHost, th->h_addr, sizeof(afs_int32));
*ahost = myHost;
inServer = 0; /* haven't seen -servers yet */
/* otherwise this is a new host name */
th = gethostbyname(tp);
if (!th) return UBADHOST;
- bcopy(th->h_addr, &temp, sizeof(afs_int32));
+ memcpy(&temp, th->h_addr, sizeof(afs_int32));
if (temp != myHost) {
if (counter++ >= MAXSERVERS) return UNHOSTS;
*aothers++ = temp;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/udebug.c,v 1.1.1.7 2001/07/14 22:24:09 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/udebug.c,v 1.1.1.8 2001/09/11 14:34:58 hartmans Exp $");
#include <sys/types.h>
#include <stdlib.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#ifdef AFS_NT40_ENV
printf("udebug: host %s not found in host table\n", hostName);
exit(1);
}
- bcopy(th->h_addr, &hostAddr, sizeof(afs_int32));
+ memcpy(&hostAddr, th->h_addr, sizeof(afs_int32));
}
else hostAddr = htonl(0x7f000001); /* IP localhost */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/vote.c,v 1.1.1.6 2001/07/14 22:24:10 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/vote.c,v 1.1.1.7 2001/09/11 14:34:59 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
aparm->altAddr[i] = ntohl(ts->addr[i+1]);
aparm->lastVoteTime = ts->lastVoteTime;
aparm->lastBeaconSent = ts->lastBeaconSent;
- bcopy(&ts->version, &aparm->remoteVersion, sizeof(struct ubik_version));
+ memcpy(&aparm->remoteVersion, &ts->version, sizeof(struct ubik_version));
aparm->lastVote = ts->lastVote;
aparm->up = ts->up;
aparm->beaconSinceDown = ts->beaconSinceDown;
(urecovery_state & UBIK_RECHAVEDB ) ) {
aparm->recoveryState |= UBIK_RECLABELDB;
}
- bcopy(&ubik_dbVersion, &aparm->syncVersion, sizeof(struct ubik_version));
- bcopy(&ubik_dbTid, &aparm->syncTid, sizeof(struct ubik_tid));
+ memcpy(&aparm->syncVersion, &ubik_dbVersion, sizeof(struct ubik_version));
+ memcpy(&aparm->syncTid, &ubik_dbTid, sizeof(struct ubik_tid));
aparm->activeWrite = (ubik_dbase->flags & DBWRITING);
aparm->tidCounter = ubik_dbase->tidCounter;
aparm->addr = ntohl(ts->addr[0]); /* primary interface */
aparm->lastVoteTime = ts->lastVoteTime;
aparm->lastBeaconSent = ts->lastBeaconSent;
- bcopy(&ts->version, &aparm->remoteVersion, sizeof(struct ubik_version));
+ memcpy(&aparm->remoteVersion, &ts->version, sizeof(struct ubik_version));
aparm->lastVote = ts->lastVote;
aparm->up = ts->up;
aparm->beaconSinceDown = ts->beaconSinceDown;
(urecovery_state & UBIK_RECHAVEDB ) ) {
aparm->recoveryState |= UBIK_RECLABELDB;
}
- bcopy(&ubik_dbVersion, &aparm->syncVersion, sizeof(struct ubik_version));
- bcopy(&ubik_dbTid, &aparm->syncTid, sizeof(struct ubik_tid));
+ memcpy(&aparm->syncVersion, &ubik_dbVersion, sizeof(struct ubik_version));
+ memcpy(&aparm->syncTid, &ubik_dbTid, sizeof(struct ubik_tid));
aparm->activeWrite = (ubik_dbase->flags & DBWRITING);
aparm->tidCounter = ubik_dbase->tidCounter;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/update/client.c,v 1.1.1.5 2001/07/14 22:24:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/update/client.c,v 1.1.1.6 2001/09/11 14:35:00 hartmans Exp $");
#include <afs/stds.h>
#ifdef AFS_AIX32_ENV
#include <sys/time.h>
#include <dirent.h>
#endif
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#ifdef HAVE_UNISTD_H
printf("host %s not found \n", aname);
exit(1);
}
- bcopy(th->h_addr, &addr, sizeof(addr));
+ memcpy(&addr, th->h_addr, sizeof(addr));
return addr;
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/update/server.c,v 1.1.1.5 2001/07/14 22:24:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/update/server.c,v 1.1.1.6 2001/09/11 14:35:01 hartmans Exp $");
#include <afs/stds.h>
#ifdef AFS_AIX32_ENV
#include <sys/file.h>
#include <dirent.h>
#endif
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#ifdef HAVE_UNISTD_H
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/update/utils.c,v 1.1.1.5 2001/07/14 22:24:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/update/utils.c,v 1.1.1.6 2001/09/11 14:35:02 hartmans Exp $");
#include <afs/stds.h>
#include <rx/rxkad.h>
#include <WINNT/afssw.h>
#endif
#include <stdio.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#ifdef HAVE_UNISTD_H
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/usd/usd_file.c,v 1.1.1.6 2001/07/14 22:24:12 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/usd/usd_file.c,v 1.1.1.7 2001/09/11 14:35:03 hartmans Exp $");
#include <errno.h>
#include <fcntl.h>
return errno;
usd = (usd_handle_t) malloc(sizeof(*usd));
- bzero(usd, sizeof(*usd));
+ memset(usd, 0, sizeof(*usd));
usd->handle = (void *)fd;
usd->read = usd_FileRead;
usd->write = usd_FileWrite;
*usdP = NULL;
usd = (usd_handle_t) malloc(sizeof(*usd));
- bzero(usd, sizeof(*usd));
+ memset(usd, 0, sizeof(*usd));
usd->handle = (void *)((unsigned long)0);
usd->read = usd_FileRead;
usd->write = usd_FileWrite;
*usdP = NULL;
usd = (usd_handle_t) malloc(sizeof(*usd));
- bzero(usd, sizeof(*usd));
+ memset(usd, 0, sizeof(*usd));
usd->handle = (void *)((unsigned long)1);
usd->read = usd_FileRead;
usd->write = usd_FileWrite;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/usd/usd_nt.c,v 1.1.1.4 2001/07/14 22:24:12 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/usd/usd_nt.c,v 1.1.1.5 2001/09/11 14:35:03 hartmans Exp $");
#include <windows.h>
#include <stdio.h>
return nterr_nt2unix(GetLastError(), EIO);
usd = (usd_handle_t) malloc(sizeof(*usd));
- bzero(usd, sizeof(*usd));
+ memset(usd, 0, sizeof(*usd));
_ASSERT(sizeof(devhandle) <= sizeof(usd->handle));
*usdP = NULL;
usd = (usd_handle_t) malloc(sizeof(*usd));
- bzero(usd, sizeof(*usd));
+ memset(usd, 0, sizeof(*usd));
usd->handle = (void *)0;
usd->read = usd_DeviceRead;
usd->write = usd_DeviceWrite;
*usdP = NULL;
usd = (usd_handle_t) malloc(sizeof(*usd));
- bzero(usd, sizeof(*usd));
+ memset(usd, 0, sizeof(*usd));
usd->handle = (void *)1;
usd->read = usd_DeviceRead;
usd->write = usd_DeviceWrite;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/uss/lex.c,v 1.1.1.4 2001/07/14 22:24:13 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/uss/lex.c,v 1.1.1.5 2001/09/11 14:35:04 hartmans Exp $");
#include "y.tab.h"
#include "uss_common.h"
-extern char *index();
int line=1;
#ifdef DEBUG
#define dprint(x) {fprintf(stderr, x); fflush(stderr);}
}
out_cp = out;
- while ((in_var = index(in_text, '$')) != NULL) {
+ while ((in_var = strchr(in_text, '$')) != NULL) {
while(in_text < in_var)
*out_cp++ = *in_text++;
VarNo = *(in_var+1);
*out_cp++ = *in_text++;
if (isQuotedString) {
- nullP = index(out, '"');
+ nullP = strchr(out, '"');
if (nullP == (char *)0)
nullP = out_cp;
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_fs.c,v 1.1.1.4 2001/07/14 22:24:15 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_fs.c,v 1.1.1.5 2001/09/11 14:35:06 hartmans Exp $");
#include "uss_fs.h" /*Interface to this module*/
#include <sys/types.h>
* we cheat and return ``.''.
*/
strcpy(a_parentBuff, a_path);
- rightSlashP = (char *) rindex(a_parentBuff, '/');
+ rightSlashP = (char *) strrchr(a_parentBuff, '/');
if (rightSlashP) {
*rightSlashP = 0;
*a_componentPP = rightSlashP+1;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_kauth.c,v 1.1.1.4 2001/07/14 22:24:15 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_kauth.c,v 1.1.1.5 2001/09/11 14:35:06 hartmans Exp $");
#include "uss_kauth.h" /*Module interface*/
#include "uss_common.h" /*Common defs & operations*/
extern int errno;
extern afs_int32 KAM_CreateUser();
-extern char *index();
#define uss_kauth_MAX_SIZE 2048
static char gpbuf[BUFSIZ];
/* read a password from stdin, stop on \n or eof */
register int i, tc;
- bzero(gpbuf, sizeof(gpbuf));
+ memset(gpbuf, 0, sizeof(gpbuf));
for(i=0; i<(sizeof(gpbuf)-1); i++) {
tc = fgetc(stdin);
if (tc == '\n' || tc == EOF) break;
uss_whoami, UserCell);
return(-1);
}
- if (index(UserPrincipal, ':') != NULL) {
+ if (strchr(UserPrincipal, ':') != NULL) {
fprintf(stderr, "%s: User name '%s' can't have a colon\n",
uss_whoami, UserPrincipal);
return(-1);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_procs.c,v 1.1.1.4 2001/07/14 22:24:16 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_procs.c,v 1.1.1.5 2001/09/11 14:35:06 hartmans Exp $");
#include "uss_procs.h" /*Module interface*/
#include "uss_common.h" /*Common defs & operations*/
char temp[1000];
extern int line;
-extern char *rindex();
static int Copy();
static int Echo();
}
if (stbuf.st_mode & S_IFDIR) {
- if ((cp = rindex(a_path, '/')) == NULL) {
+ if ((cp = strrchr(a_path, '/')) == NULL) {
strcat(a_proto, "/");
strcat(a_proto, a_path);
}
/*
* If a full pathname was given, just take it as is.
*/
- if (index(a_fileToOpen, '/')) {
+ if (strchr(a_fileToOpen, '/')) {
strcpy(tmp_str, a_fileToOpen);
rv = fopen(a_fileToOpen, "r");
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_ptserver.c,v 1.1.1.4 2001/07/14 22:24:16 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_ptserver.c,v 1.1.1.5 2001/09/11 14:35:07 hartmans Exp $");
#include "uss_ptserver.h" /*Module interface*/
#include <afs/ptclient.h> /*Protection Server client interface*/
#undef USS_PTSERVER_DB
extern int line;
-extern char *rindex();
/*
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_vol.c,v 1.1.1.4 2001/07/14 22:24:16 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_vol.c,v 1.1.1.5 2001/09/11 14:35:07 hartmans Exp $");
#include "uss_vol.h" /*Interface to this module*/
#include "uss_common.h" /*Common definitions*/
th = gethostbyname(a_name);
if (!th)
return(0);
- bcopy(th->h_addr, &addr, sizeof(addr));
+ memcpy(&addr, th->h_addr, sizeof(addr));
return(addr);
} /*uss_vol_GetServer*/
$(DESTDIR)\include\afs\dirent.h: dirent_nt.h
$(COPY) $** $@
+$(DESTDIR)\include\afs\dirpath.h: dirpath.hin
+ $(COPY) $** $@
+
LIBFILE = $(DESTDIR)\lib\afs\afsutil.lib
LIBOBJS = \
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/hostparse.c,v 1.1.1.6 2001/07/14 22:24:22 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/hostparse.c,v 1.1.1.7 2001/09/11 14:35:12 hartmans Exp $");
#ifdef UKERNEL
#include "../afs/sysincludes.h"
#include <netdb.h>
#include <ctype.h>
#endif
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#include <errno.h>
/* decimal address, return fake hostent with only hostaddr field good */
tval = 0;
dots = 0;
- bzero(addr, sizeof(addr));
+ memset(addr, 0, sizeof(addr));
while ((tc = *ahost++)) {
if (tc == '.') {
if (dots >= 3) return (struct hostent *) 0; /* too many dots */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/kreltime.c,v 1.1.1.4 2001/07/14 22:24:22 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/kreltime.c,v 1.1.1.5 2001/09/11 14:35:13 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
afs_int32 int32Date;
struct ktime_date *kdptr;
{
- bzero(kdptr, sizeof(*kdptr));
+ memset(kdptr, 0, sizeof(*kdptr));
kdptr->day = int32Date % (MAX_DAY_VALUE + 1);
if ( kdptr->day != 0 )
afs_int32 value, digit_limit;
afs_int32 type_index;
- bzero(relDatePtr, sizeof(*relDatePtr));
+ memset(relDatePtr, 0, sizeof(*relDatePtr));
type_index = 0;
while ( 1 )
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/ktime.c,v 1.1.1.4 2001/07/14 22:24:23 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/ktime.c,v 1.1.1.5 2001/09/11 14:35:14 hartmans Exp $");
#include <sys/types.h>
#include <stdio.h>
{
struct ktime tk;
-bzero(&tk, sizeof(tk));
+memset(&tk, 0, sizeof(tk));
if ( ParseTime(&tk, astr) )
return (-1); /* syntax error */
register afs_int32 code;
struct ptemp *tp;
- bzero(ak, sizeof(*ak));
+ memset(ak, 0, sizeof(*ak));
code = LocalParseLine(adate, &tt);
if (code) return -1;
for(;tt;tt=tt->next) {
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/netutils.c,v 1.1.1.5 2001/07/14 22:24:23 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/netutils.c,v 1.1.1.6 2001/09/11 14:35:15 hartmans Exp $");
#include <stdlib.h>
#include <stdio.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#include <ctype.h>
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/serverLog.c,v 1.1.1.7 2001/07/14 22:24:26 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/serverLog.c,v 1.1.1.8 2001/09/11 14:35:17 hartmans Exp $");
#include <stdio.h>
#ifdef AFS_NT40_ENV
#include <afs/procmgmt.h> /* signal(), kill(), wait(), etc. */
#include <fcntl.h>
#include <afs/stds.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#include "afsutil.h"
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/uuid.c,v 1.1.1.5 2001/07/14 22:24:26 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/uuid.c,v 1.1.1.6 2001/09/11 14:35:18 hartmans Exp $");
#ifdef KERNEL
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
-#define uuid_memcmp(A,B,C) bcmp(A,B,C)
-#define uuid_memcpy(A,B,C) bcopy(B,A,C)
+#define uuid_memcmp(A,B,C) memcmp(A, B, C)
+#define uuid_memcpy(A,B,C) memcpy(A, B, C)
#else /* KERNEL */
#include <stdio.h>
#include <errno.h>
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/volparse.c,v 1.1.1.6 2001/07/14 22:24:26 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/volparse.c,v 1.1.1.7 2001/09/11 14:35:19 hartmans Exp $");
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
#endif
#endif
#ifdef HAVE_STDLIB_H
tbuffer[0] = '\0';
return tbuffer;
}
- bzero(tbuffer, buflen);
+ memset(tbuffer, 0, buflen);
tempString[1] = tempString[2] = 0;
strcpy(tbuffer, "/vicep");
if (avalue < 0 || avalue >= (26*26+26)) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/venus/cacheout.c,v 1.1.1.4 2001/07/14 22:24:35 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/venus/cacheout.c,v 1.1.1.5 2001/09/11 14:35:22 hartmans Exp $");
#include <stdio.h>
#include <string.h>
afs_uint32 *p;
/* get list of file servers in NW byte order */
- bzero(&addrs, sizeof(addrs));
- bzero(&spare3, sizeof(spare3));
+ memset(&addrs, 0, sizeof(addrs));
+ memset(&spare3, 0, sizeof(spare3));
code=ubik_Call(VL_GetAddrs,client,0,Handle,spare2,&spare3,
&server_count,&addrs);
if(code)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/venus/cmdebug.c,v 1.1.1.4 2001/07/14 22:24:35 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/venus/cmdebug.c,v 1.1.1.5 2001/09/11 14:35:22 hartmans Exp $");
#include <sys/types.h>
printf("cmdebug: can't resolve address for host %s.\n", hostName);
exit(1);
}
- bcopy(thp->h_addr, &addr, sizeof(afs_int32));
+ memcpy(&addr, thp->h_addr, sizeof(afs_int32));
secobj = rxnull_NewServerSecurityObject();
conn = rx_NewConnection(addr, htons(port), 1, secobj, 0);
if (!conn) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/venus/fs.c,v 1.1.1.7 2001/07/14 22:24:35 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/venus/fs.c,v 1.1.1.8 2001/09/11 14:35:23 hartmans Exp $");
#include <afs/afs_args.h>
#include <rx/xdr.h>
{
char *tp;
strcpy(tspace, apath);
- tp = rindex(tspace, '/');
+ tp = strrchr(tspace, '/');
if (tp) {
*tp = 0;
}
struct cmd_syndesc ts;
/* copy useful stuff from our command slot; we may later have to reorder */
- bcopy(as, &ts, sizeof(ts)); /* copy whole thing */
+ memcpy(&ts, as, sizeof(ts)); /* copy whole thing */
return SetVolCmd(&ts);
}
blob.out_size = MAXSIZE;
blob.in_size = 0;
blob.out = space;
- bzero(space, sizeof(space));
+ memset(space, 0, sizeof(space));
code = pioctl(ti->data, VIOCWHEREIS, &blob, 1);
if (code) {
Die(errno, ti->data);
* name (we know there is one) and splice in the symlink value.
*/
if (true_name[0] != '/') {
- last_component = (char *) rindex(orig_name, '/');
+ last_component = (char *) strrchr(orig_name, '/');
strcpy(++last_component, true_name);
strcpy(true_name, orig_name);
}
/*
* Find rightmost slash, if any.
*/
- last_component = (char *) rindex(true_name, '/');
+ last_component = (char *) strrchr(true_name, '/');
if (last_component) {
/*
* Found it. Designate everything before it as the parent directory,
blob.in_size = strlen(last_component)+1;
blob.out_size = MAXSIZE;
blob.out = space;
- bzero(space, MAXSIZE);
+ memset(space, 0, MAXSIZE);
code = pioctl(parent_dir, VIOC_AFS_STAT_MT_PT, &blob, 1);
/* Check for a cellname in the volume specification, and complain
* if it doesn't match what was specified with -cell */
- if (tmpName = index(volName, ':')) {
+ if (tmpName = strchr(volName, ':')) {
*tmpName = '\0';
if (cellName) {
if (strcasecmp(cellName,volName)) {
for(ti=as->parms[0].items; ti; ti=ti->next) {
/* once per file */
- tp = (char *) rindex(ti->data, '/');
+ tp = (char *) strrchr(ti->data, '/');
if (tp) {
strncpy(tbuffer, ti->data, code=tp-ti->data); /* the dir name */
tbuffer[code] = 0;
struct afsconf_cell info;
struct chservinfo checkserv;
- bzero(&checkserv,sizeof(struct chservinfo));
+ memset(&checkserv, 0, sizeof(struct chservinfo));
blob.in_size=sizeof(struct chservinfo);
blob.in=(caddr_t)&checkserv;
blob.out_size = MAXSIZE;
blob.out = space;
- bzero(space, sizeof(afs_int32)); /* so we assure zero when nothing is copied back */
+ memset(space, 0, sizeof(afs_int32)); /* so we assure zero when nothing is copied back */
/* prepare flags for checkservers command */
temp = 2; /* default to checking local cell only */
Die(errno, 0);
return 1;
}
- bcopy(space, &temp, sizeof(afs_int32));
+ memcpy(&temp, space, sizeof(afs_int32));
if (checkserv.tinterval >= 0) {
if (checkserv.tinterval > 0)
printf("The new down server probe interval (%d secs) is now in effect (old interval was %d secs)\n",
else {
printf("These servers unavailable due to network or server problems: ");
for(j=0; ; j++) {
- bcopy(space + j*sizeof(afs_int32), &temp, sizeof(afs_int32));
+ memcpy(&temp, space + j*sizeof(afs_int32), sizeof(afs_int32));
if (temp == 0) break;
tp = hostutil_GetNameByINet(temp);
printf(" %s", tp);
struct gaginfo gagflags;
struct cmd_item *show;
- bzero (&gagflags, sizeof(struct gaginfo));
+ memset(&gagflags, 0, sizeof(struct gaginfo));
blob.in_size = sizeof(struct gaginfo);
blob.in = (caddr_t) &gagflags;
blob.out_size = MAXSIZE;
blob.out = space;
- bzero(space, sizeof(afs_int32)); /* so we assure zero when nothing is copied back */
+ memset(space, 0, sizeof(afs_int32)); /* so we assure zero when nothing is copied back */
if (show = as->parms[0].items) {
if (!strcasecmp (show->data, "user"))
for(i=0;;i++) {
tp = space;
- bcopy(&i, tp, sizeof(afs_int32));
+ memcpy(tp, &i, sizeof(afs_int32));
blob.out_size = MAXSIZE;
blob.in_size = sizeof(afs_int32);
blob.in = space;
afs_int32 addr;
char *name, tbuffer[20];
- bcopy(tp + j*sizeof(afs_int32), &addr, sizeof(afs_int32));
+ memcpy(&addr, tp + j*sizeof(afs_int32), sizeof(afs_int32));
if (addr == 0) break;
if (resolve) {
scount = ((cellname[0] != '\0') ? MAXCELLHOSTS : MAXHOSTS);
/* Now setup and do the NEWCELL pioctl call */
- bzero(space, (scount+1) * sizeof(afs_int32));
+ memset(space, 0, (scount+1) * sizeof(afs_int32));
tp = space;
lp = (afs_int32 *)tp;
*lp++ = 0x12345678;
pn, ti->data);
}
else {
- bcopy(thp->h_addr, tp, sizeof(afs_int32));
+ memcpy(tp, thp->h_addr, sizeof(afs_int32));
tp += sizeof(afs_int32);
}
}
return 1;
}
}
- else bcopy(thp->h_addr, &hostAddr, sizeof(afs_int32));
+ else memcpy(&hostAddr, thp->h_addr, sizeof(afs_int32));
}
}
else {
input += strlen(ti->data);
*(input++) = '\0';
}
- bcopy(&setp, space, sizeof(afs_int32));
+ memcpy(space, &setp, sizeof(afs_int32));
code = pioctl(0, VIOC_AFS_SYSNAME, &blob, 1);
if (code) {
Die(errno, 0);
return 0;
}
input = space;
- bcopy(input, &setp, sizeof(afs_int32));
+ memcpy(&setp, input, sizeof(afs_int32));
input += sizeof(afs_int32);
if (!setp) {
fprintf(stderr, "No sysname name value was found\n");
return 1;
}
- printf("Current sysname%s is:", setp>1 ? " list" : "");
+ printf("Current sysname%s is", setp>1 ? " list" : "");
for(;setp>0;--setp) {
- printf(" %s", input);
+ printf(" \'%s\'", input);
input += strlen(input) + 1;
}
printf("\n");
pn, info->numServers, VLDB_MAXSERVERS);
exit(1);
}
- bzero(serverconns, sizeof(serverconns));
+ memset(serverconns, 0, sizeof(serverconns));
for (i = 0;i<info->numServers;i++)
serverconns[i] = rx_NewConnection(info->hostAddr[i].sin_addr.s_addr,
info->hostAddr[i].sin_port, USER_SERVICE_ID,
}
sp = (struct spref *) (gblob.in + gblob.in_size);
- bcopy (thostent->h_addr_list[t], &(sp->server.s_addr), sizeof(afs_uint32));
+ memcpy(&(sp->server.s_addr), thostent->h_addr_list[t], sizeof(afs_uint32));
sp->rank = (rank > MAXUSHORT ? MAXUSHORT : rank);
gblob.in_size += sizeof(struct spref);
ssp->num_servers++;
blob.in = (char *)&tsb;
blob.out = (char *)&tsb2;
blob.in_size = blob.out_size = sizeof(struct sbstruct);
- bzero (&tsb2, sizeof(tsb2));
+ memset(&tsb2, 0, sizeof(tsb2));
/* once per -file */
for (ti=as->parms[1].items; ti; ti=ti->next) {
if (code) Die(errno, (char *) 0);
else {
tp = space;
- bcopy(tp, &flag, sizeof(afs_int32));
+ memcpy(&flag, tp, sizeof(afs_int32));
printf("Security level is currently ");
if (flag == 1)
printf("crypt (data security).\n");
* name (we know there is one) and splice in the symlink value.
*/
if (true_name[0] != '/') {
- last_component = (char *) rindex(orig_name, '/');
+ last_component = (char *) strrchr(orig_name, '/');
strcpy(++last_component, true_name);
strcpy(true_name, orig_name);
}
/*
* Find rightmost slash, if any.
*/
- last_component = (char *) rindex(true_name, '/');
+ last_component = (char *) strrchr(true_name, '/');
if (last_component) {
/*
* Found it. Designate everything before it as the parent directory,
blob.in = last_component;
blob.in_size = strlen(last_component)+1;
blob.out_size = 0;
- bzero(space, MAXSIZE);
+ memset(space, 0, MAXSIZE);
code = pioctl(parent_dir, VIOC_AFS_FLUSHMOUNT, &blob, 1);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/venus/up.c,v 1.1.1.6 2001/07/14 22:24:37 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/venus/up.c,v 1.1.1.7 2001/09/11 14:35:26 hartmans Exp $");
/* missing type from C language */
#define Boolean short
#define MAXACL 400
-extern char *index ();
-extern char *rindex ();
#if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
extern sys_nerr;
extern char *sys_errlist[];
strcpy(parent, file);
- p = rindex(parent, '/');
+ p = strrchr(parent, '/');
if (!p) {
strcpy(parent, ".");
}
/*
* Find rightmost slash, if any.
*/
- last_component = (char *) rindex(true_name, '/');
+ last_component = (char *) strrchr(true_name, '/');
if (last_component) {
/*
* Found it. Designate everything before it as the parent directory,
blob->in_size = strlen(last_component)+1;
blob->out_size = MAXSIZE;
blob->out = space;
- bzero(space, MAXSIZE);
+ memset(space, 0, MAXSIZE);
code = pioctl(parent_dir, VIOC_AFS_STAT_MT_PT, blob, 0);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/dir.c,v 1.1.1.3 2001/07/14 22:24:40 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/dir.c,v 1.1.1.4 2001/09/11 14:35:27 hartmans Exp $");
#define VICE /* allow us to put our changes in at will */
#include <stdio.h>
register struct dinode *dp;
struct inodesc curino;
- bzero((char *)&curino, sizeof(struct inodesc));
+ memset((char *)&curino, 0, sizeof(struct inodesc));
if (statemap[inumber] != DSTATE)
errexit("BAD INODE %d TO DESCEND", statemap[inumber]);
#if defined(ACLS) && defined(AFS_HPUX_ENV)
idesc->id_loc = 0;
for (dp = fsck_readdir(idesc); dp != NULL; dp = fsck_readdir(idesc)) {
dsize = dp->d_reclen;
- bcopy((char *)dp, dbuf, dsize);
+ memcpy(dbuf, (char *)dp, dsize);
idesc->id_dirp = (struct direct *)dbuf;
if ((n = (*idesc->id_func)(idesc)) & ALTERED) {
bp = getdirblk(idesc->id_blkno, blksiz);
- bcopy(dbuf, (char *)dp, dsize);
+ memcpy((char *)dp, dbuf, dsize);
dirty(bp);
sbdirty();
}
dirp->d_ino = idesc->id_parent; /* ino to be entered is in id_parent */
dirp->d_reclen = newent.d_reclen;
dirp->d_namlen = strlen(idesc->id_name);
- bcopy(idesc->id_name, dirp->d_name, (int)dirp->d_namlen + 1);
+ memcpy(dirp->d_name, idesc->id_name, (int)dirp->d_namlen + 1);
return (ALTERED|STOP);
}
{
register struct direct *dirp = idesc->id_dirp;
- if (bcmp(dirp->d_name, idesc->id_name, (int)dirp->d_namlen + 1))
+ if (memcmp(dirp->d_name, idesc->id_name, (int)dirp->d_namlen + 1))
return (KEEPON);
dirp->d_ino = idesc->id_parent;
return (ALTERED|STOP);
char tempname[BUFSIZ];
extern int pass4check();
- bzero((char *)&idesc, sizeof(struct inodesc));
+ memset((char *)&idesc, 0, sizeof(struct inodesc));
dp = ginode(orphan);
lostdir = (dp->di_mode & IFMT) == IFDIR;
pwarn("UNREF %s ", lostdir ? "DIR" : "FILE");
return (0);
}
len = strlen(lfname);
- bcopy(lfname, pathp, len + 1);
+ memcpy(pathp, lfname, len + 1);
pathp += len;
len = lftempname(tempname, orphan);
if (makeentry(lfdir, orphan, tempname) == 0) {
}
lncntp[orphan]--;
*pathp++ = '/';
- bcopy(tempname, pathp, len + 1);
+ memcpy(pathp, tempname, len + 1);
pathp += len;
if (lostdir) {
dp = ginode(orphan);
if (parent < ROOTINO || parent >= maxino ||
ino < ROOTINO || ino >= maxino)
return (0);
- bzero((char *)&idesc, sizeof(struct inodesc));
+ memset((char *)&idesc, 0, sizeof(struct inodesc));
idesc.id_type = DATA;
idesc.id_func = mkentry;
idesc.id_number = parent;
dblksize(&sblock, dp, lastbn + 1));
if (bp->b_errs)
goto bad;
- bcopy(bp->b_un.b_buf, firstblk, DIRBLKSIZ);
+ memcpy(firstblk, bp->b_un.b_buf, DIRBLKSIZ);
bp = getdirblk(newblk, sblock.fs_bsize);
if (bp->b_errs)
goto bad;
- bcopy(firstblk, bp->b_un.b_buf, DIRBLKSIZ);
+ memcpy(bp->b_un.b_buf, firstblk, DIRBLKSIZ);
for (cp = &bp->b_un.b_buf[DIRBLKSIZ];
cp < &bp->b_un.b_buf[sblock.fs_bsize];
cp += DIRBLKSIZ)
- bcopy((char *)&emptydir, cp, sizeof emptydir);
+ memcpy(cp, (char *)&emptydir, sizeof emptydir);
dirty(bp);
bp = getdirblk(dp->di_db[lastbn + 1],
dblksize(&sblock, dp, lastbn + 1));
if (bp->b_errs)
goto bad;
- bcopy((char *)&emptydir, bp->b_un.b_buf, sizeof emptydir);
+ memcpy(bp->b_un.b_buf, (char *)&emptydir, sizeof emptydir);
pwarn("NO SPACE LEFT IN %s", pathname);
if (preen)
printf(" (EXPANDED)\n");
freeino(ino);
return (0);
}
- bcopy((char *)&dirhead, bp->b_un.b_buf, sizeof dirhead);
+ memcpy(bp->b_un.b_buf, (char *)&dirhead, sizeof dirhead);
for (cp = &bp->b_un.b_buf[DIRBLKSIZ];
cp < &bp->b_un.b_buf[sblock.fs_fsize];
cp += DIRBLKSIZ)
- bcopy((char *)&emptydir, cp, sizeof emptydir);
+ memcpy(cp, (char *)&emptydir, sizeof emptydir);
dirty(bp);
dp->di_nlink = 2;
inodirty();
inp->i_isize = dp->di_size;
inp->i_numblks = dp->di_blocks * sizeof(daddr_t);
inp->i_parent = parent;
- bcopy((char *)&dp->di_db[0], (char *)&inp->i_blks[0],
- (int)inp->i_numblks);
+ memcpy((char *)&inp->i_blks[0], (char *)&dp->di_db[0], (int)inp->i_numblks);
}
#endif
if (ino == ROOTINO) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/inode.c,v 1.1.1.3 2001/07/14 22:24:41 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/inode.c,v 1.1.1.4 2001/09/11 14:35:27 hartmans Exp $");
#define VICE /* control whether AFS changes are present */
#include <stdio.h>
if (dirp->d_ino != idesc->id_parent)
return (KEEPON);
- bcopy(dirp->d_name, idesc->id_name, (int)dirp->d_namlen + 1);
+ memcpy(idesc->id_name, dirp->d_name, (int)dirp->d_namlen + 1);
return (STOP|FOUND);
}
extern int pass4check();
struct dinode *dp;
- bzero((char *)&idesc, sizeof(struct inodesc));
+ memset((char *)&idesc, 0, sizeof(struct inodesc));
idesc.id_type = ADDR;
idesc.id_func = pass4check;
idesc.id_number = ino;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/main.c,v 1.1.1.4 2001/07/14 22:24:41 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/main.c,v 1.1.1.5 2001/09/11 14:35:28 hartmans Exp $");
#define VICE /* allow us to put our changes in at will */
#include <stdio.h>
msgprintf("%s: AFS file system partition was modified; forcing full salvage\n", devname);
devname = unrawname(devname);
- special = (char *) rindex(devname, '/');
+ special = (char *) strrchr(devname, '/');
if (!special++) special = devname;
strcpy(pname, "/etc/vfsck."); /* Using /etc, rather than /tmp, since
/tmp is a link to /usr/tmp on some systems, and isn't mounted now */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/pass1.c,v 1.1.1.3 2001/07/14 22:24:41 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/pass1.c,v 1.1.1.4 2001/09/11 14:35:28 hartmans Exp $");
#define VICE
#include <sys/param.h>
/*
* Find all allocated blocks.
*/
- bzero((char *)&idesc, sizeof(struct inodesc));
+ memset((char *)&idesc, 0, sizeof(struct inodesc));
idesc.id_type = ADDR;
idesc.id_func = pass1check;
inumber = 0;
continue;
dp = ginode(inumber);
if ((dp->di_mode & IFMT) == 0) {
- if (bcmp((char *)dp->di_db, (char *)zino.di_db,
+ if (memcmp((char *)dp->di_db, (char *)zino.di_db,
NDADDR * sizeof(daddr_t)) ||
- bcmp((char *)dp->di_ib, (char *)zino.di_ib,
- NIADDR * sizeof(daddr_t)) ||
+ memcmp((char *)dp->di_ib, (char *)zino.di_ib, NIADDR * sizeof(daddr_t)) ||
#if defined(ACLS) && defined(AFS_HPUX_ENV)
dp->di_mode || dp->di_size || dp->di_contin) {
if (dp->di_contin != 0)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/pass1b.c,v 1.1.1.3 2001/07/14 22:24:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/pass1b.c,v 1.1.1.4 2001/09/11 14:35:29 hartmans Exp $");
#define VICE
#include <sys/param.h>
struct inodesc idesc;
ino_t inumber;
- bzero((char *)&idesc, sizeof(struct inodesc));
+ memset((char *)&idesc, 0, sizeof(struct inodesc));
idesc.id_type = ADDR;
idesc.id_func = pass1bcheck;
duphead = duplist;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/pass2.c,v 1.1.1.3 2001/07/14 22:24:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/pass2.c,v 1.1.1.4 2001/09/11 14:35:30 hartmans Exp $");
#define VICE
#include <sys/time.h>
register struct dinode *dp;
struct inodesc rootdesc;
- bzero((char *)&rootdesc, sizeof(struct inodesc));
+ memset((char *)&rootdesc, 0, sizeof(struct inodesc));
rootdesc.id_type = ADDR;
rootdesc.id_func = pass2check;
rootdesc.id_number = ROOTINO;
#endif
} else if (dirp->d_reclen < 2 * entrysize) {
proto.d_reclen = dirp->d_reclen;
- bcopy((char *)&proto, (char *)dirp, entrysize);
+ memcpy((char *)dirp, (char *)&proto, entrysize);
if (reply("FIX") == 1)
ret |= ALTERED;
} else {
n = dirp->d_reclen - entrysize;
proto.d_reclen = entrysize;
- bcopy((char *)&proto, (char *)dirp, entrysize);
+ memcpy((char *)dirp, (char *)&proto, entrysize);
idesc->id_entryno++;
lncntp[dirp->d_ino]--;
dirp = (struct direct *)((char *)(dirp) + entrysize);
- bzero((char *)dirp, n);
+ memset((char *)dirp, 0, n);
dirp->d_reclen = n;
if (reply("FIX") == 1)
ret |= ALTERED;
idesc->id_entryno++;
lncntp[dirp->d_ino]--;
dirp = (struct direct *)((char *)(dirp) + n);
- bzero((char *)dirp, n);
+ memset((char *)dirp, 0, n);
dirp->d_reclen = n;
}
if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") == 0) {
#endif
} else {
proto.d_reclen = dirp->d_reclen;
- bcopy((char *)&proto, (char *)dirp, entrysize);
+ memcpy((char *)dirp, (char *)&proto, entrysize);
if (reply("FIX") == 1)
ret |= ALTERED;
}
*pathp = '\0';
errexit("NAME TOO LONG %s%s\n", pathname, dirp->d_name);
}
- bcopy(dirp->d_name, pathp, (int)dirp->d_namlen + 1);
+ memcpy(pathp, dirp->d_name, (int)dirp->d_namlen + 1);
pathp += dirp->d_namlen;
idesc->id_entryno++;
n = 0;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/pass3.c,v 1.1.1.3 2001/07/14 22:24:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/pass3.c,v 1.1.1.4 2001/09/11 14:35:30 hartmans Exp $");
#define VICE
#include <sys/param.h>
ino_t inumber, orphan;
int loopcnt;
- bzero((char *)&idesc, sizeof(struct inodesc));
+ memset((char *)&idesc, 0, sizeof(struct inodesc));
idesc.id_type = DATA;
for (inumber = ROOTINO; inumber <= lastino; inumber++) {
#if defined(ACLS) && defined(AFS_HPUX_ENV)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/pass4.c,v 1.1.1.3 2001/07/14 22:24:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/pass4.c,v 1.1.1.4 2001/09/11 14:35:30 hartmans Exp $");
#define VICE
#include <sys/param.h>
#endif /* ACLS */
- bzero((char *)&idesc, sizeof(struct inodesc));
+ memset((char *)&idesc, 0, sizeof(struct inodesc));
idesc.id_type = ADDR;
idesc.id_func = pass4check;
for (inumber = ROOTINO; inumber <= lastino; inumber++) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/pass5.c,v 1.1.1.3 2001/07/14 22:24:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/pass5.c,v 1.1.1.4 2001/09/11 14:35:30 hartmans Exp $");
#define VICE
#include <sys/param.h>
struct cg *ocg = (struct cg *) buf;
#endif /* AFS_NEWCG_ENV */
- bzero((char *)newcg, (int)fs->fs_cgsize);
+ memset((char *)newcg, 0, (int)fs->fs_cgsize);
newcg->cg_niblk = fs->fs_ipg;
#ifdef AFS_NEWCG_ENV
postype = (int) fs->fs_postblformat;
#endif /* AFS_NEWCG_ENV */
}
- bzero((char *)&idesc[0], sizeof idesc);
+ memset((char *)&idesc[0], 0, sizeof idesc);
for (i = 0; i < 3; i++)
idesc[i].id_type = ADDR;
- bzero((char *)&cstotal, sizeof(struct csum));
+ memset((char *)&cstotal, 0, sizeof(struct csum));
(void)time(&now);
#ifdef notdef
/* this is the original from UCB/McKusick, but it is clearly wrong. It is
newcg->cg_irotor = cg->cg_irotor;
else
newcg->cg_irotor = 0;
- bzero((char *)&newcg->cg_frsum[0], sizeof newcg->cg_frsum);
+ memset((char *)&newcg->cg_frsum[0], 0, sizeof newcg->cg_frsum);
#ifdef AFS_NEWCG_ENV
- bzero((char *)&cg_blktot(newcg)[0], sumsize + mapsize);
+ memset((char *)&cg_blktot(newcg)[0], 0, sumsize + mapsize);
#else /* AFS_NEWCG_ENV */
- bzero((char *)newcg->cg_btot, sizeof(newcg->cg_btot));
- bzero((char *)newcg->cg_b, sizeof(newcg->cg_b));
- bzero((char *)newcg->cg_iused, sizeof(newcg->cg_iused));
- bzero((char *)newcg->cg_free, howmany(fs->fs_fpg, NBBY));
+ memset((char *)newcg->cg_btot, 0, sizeof(newcg->cg_btot));
+ memset((char *)newcg->cg_b, 0, sizeof(newcg->cg_b));
+ memset((char *)newcg->cg_iused, 0, sizeof(newcg->cg_iused));
+ memset((char *)newcg->cg_free, 0, howmany(fs->fs_fpg, NBBY));
#endif /* AFS_NEWCG_ENV */
#ifdef AFS_NEWCG_ENV
if (fs->fs_postblformat == FS_42POSTBLFMT)
cstotal.cs_nifree += newcg->cg_cs.cs_nifree;
cstotal.cs_ndir += newcg->cg_cs.cs_ndir;
cs = &fs->fs_cs(fs, c);
- if (bcmp((char *)&newcg->cg_cs, (char *)cs, sizeof *cs) != 0 &&
+ if (memcmp((char *)&newcg->cg_cs, (char *)cs, sizeof *cs) != 0 &&
dofix(&idesc[0], "FREE BLK COUNT(S) WRONG IN CYL GROUP (SUPERBLK)")) {
- bcopy((char *)&newcg->cg_cs, (char *)cs, sizeof *cs);
+ memcpy((char *)cs, (char *)&newcg->cg_cs, sizeof *cs);
sbdirty();
}
#ifdef AFS_NEWCG_ENV
if (cvtflag) {
- bcopy((char *)newcg, (char *)cg, (int)fs->fs_cgsize);
+ memcpy((char *)cg, (char *)newcg, (int)fs->fs_cgsize);
cgdirty();
continue;
}
#endif /* AFS_NEWCG_ENV */
#ifdef AFS_NEWCG_ENV
- if (bcmp(cg_inosused(newcg),
+ if (memcmp(cg_inosused(newcg),
cg_inosused(cg), mapsize) != 0 &&
dofix(&idesc[1], "BLK(S) MISSING IN BIT MAPS")) {
- bcopy(cg_inosused(newcg), cg_inosused(cg), mapsize);
+ memcpy(cg_inosused(cg), cg_inosused(newcg), mapsize);
cgdirty();
}
#else /* AFS_NEWCG_ENV */
- if (bcmp(newcg->cg_iused,
+ if (memcmp(newcg->cg_iused,
cg->cg_iused, mapsize) != 0 &&
dofix(&idesc[1], "BLK(S) MISSING IN BIT MAPS")) {
- bcopy(newcg->cg_iused, cg->cg_iused, mapsize);
+ memcpy(cg->cg_iused, newcg->cg_iused, mapsize);
cgdirty();
}
#endif /* AFS_NEWCG_ENV */
- if ((bcmp((char *)newcg, (char *)cg, basesize) != 0 ||
+ if ((memcmp((char *)newcg, (char *)cg, basesize) != 0 ||
#ifdef AFS_NEWCG_ENV
- bcmp((char *)&cg_blktot(newcg)[0],
- (char *)&cg_blktot(cg)[0], sumsize) != 0) &&
+ memcmp((char *)&cg_blktot(newcg)[0], (char *)&cg_blktot(cg)[0], sumsize) != 0) &&
#else /* AFS_NEWCG_ENV */
- bcmp((char *)newcg->cg_btot,
- (char *)cg->cg_btot, sumsize) != 0) &&
+ memcmp((char *)newcg->cg_btot, (char *)cg->cg_btot, sumsize) != 0) &&
#endif /* AFS_NEWCG_ENV */
dofix(&idesc[2], "SUMMARY INFORMATION BAD")) {
#ifdef AFS_NEWCG_ENV
- bcopy((char *)newcg, (char *)cg, basesize);
- bcopy((char *)&cg_blktot(newcg)[0],
- (char *)&cg_blktot(cg)[0], sumsize);
+ memcpy((char *)cg, (char *)newcg, basesize);
+ memcpy((char *)&cg_blktot(cg)[0], (char *)&cg_blktot(newcg)[0], sumsize);
#else /* AFS_NEWCG_ENV */
- bcopy((char *)newcg, (char *)cg, basesize);
- bcopy((char *)newcg->cg_btot, (char *)cg->cg_btot, sumsize);
+ memcpy((char *)cg, (char *)newcg, basesize);
+ memcpy((char *)cg->cg_btot, (char *)newcg->cg_btot, sumsize);
#endif /* AFS_NEWCG_ENV */
cgdirty();
}
if (fs->fs_postblformat == FS_42POSTBLFMT)
fs->fs_nrpos = savednrpos;
#endif /* AFS_NEWCG_ENV */
- if (bcmp((char *)&cstotal, (char *)&fs->fs_cstotal, sizeof *cs) != 0
+ if (memcmp((char *)&cstotal, (char *)&fs->fs_cstotal, sizeof *cs) != 0
&& dofix(&idesc[0], "FREE BLK COUNT(S) WRONG IN SUPERBLK")) {
- bcopy((char *)&cstotal, (char *)&fs->fs_cstotal, sizeof *cs);
+ memcpy((char *)&fs->fs_cstotal, (char *)&cstotal, sizeof *cs);
fs->fs_ronly = 0;
sbfine(fs);
sbdirty();
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/proplist.c,v 1.1.1.4 2001/07/14 22:24:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/proplist.c,v 1.1.1.5 2001/09/11 14:35:31 hartmans Exp $");
#define VICE /* control whether AFS changes are present */
return(SKIP);
entry->next = NULL;
entry->flags = 0;
- bcopy((char *)&pl_descp[1], entry->name,
- pl_descp->pl_namelen);
+ memcpy(entry->name, (char *)&pl_descp[1], pl_descp->pl_namelen);
entry->blkno = idesc->id_blkno;
entry->blksize = blksize;
entry->offset = idesc->id_loc;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/setup.c,v 1.1.1.3 2001/07/14 22:24:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/setup.c,v 1.1.1.4 2001/09/11 14:35:31 hartmans Exp $");
#include <stdio.h>
#define VICE
/* block map */ howmany((fs)->fs_cpg * (fs)->fs_spc / NSPF(fs), NBBY))
char *malloc(), *calloc();
-char *index();
struct disklabel *getdisklabel();
setup(dev)
}
#endif /* AFS_NEWCG_ENV */
if (asblk.b_dirty) {
- bcopy((char *)&sblock, (char *)&altsblock,
- (int)sblock.fs_sbsize);
+ memcpy((char *)&altsblock, (char *)&sblock, (int)sblock.fs_sbsize);
flush(fswritefd, &asblk);
}
/*
#if !defined(__alpha) && !defined(AFS_SUN56_ENV)
#if !defined(AFS_HPUX110_ENV)
/* HPUX110 will use UpdateAlternateSuper() below */
- bcopy((char *)sblock.fs_csp, (char *)altsblock.fs_csp,
- sizeof sblock.fs_csp);
+ memcpy((char *)altsblock.fs_csp, (char *)sblock.fs_csp, sizeof sblock.fs_csp);
#endif /* ! AFS_HPUX110_ENV */
#endif /* ! __alpha */
#if defined(AFS_SUN56_ENV)
- bcopy((char *)sblock.fs_u.fs_csp_pad, (char *)altsblock.fs_u.fs_csp_pad,
- sizeof (sblock.fs_u.fs_csp_pad));
+ memcpy((char *)altsblock.fs_u.fs_csp_pad, (char *)sblock.fs_u.fs_csp_pad, sizeof (sblock.fs_u.fs_csp_pad));
#endif
- bcopy((char *)sblock.fs_fsmnt, (char *)altsblock.fs_fsmnt,
- sizeof sblock.fs_fsmnt);
+ memcpy((char *)altsblock.fs_fsmnt, (char *)sblock.fs_fsmnt, sizeof sblock.fs_fsmnt);
#ifndef AFS_HPUX_ENV
- bcopy((char *)sblock.fs_sparecon, (char *)altsblock.fs_sparecon,
- sizeof sblock.fs_sparecon);
+ memcpy((char *)altsblock.fs_sparecon, (char *)sblock.fs_sparecon, sizeof sblock.fs_sparecon);
#endif
#if defined(AFS_DEC_ENV)
- bcopy((char *)sblock.fs_extra, (char *)altsblock.fs_extra,
- sizeof sblock.fs_extra);
+ memcpy((char *)altsblock.fs_extra, (char *)sblock.fs_extra, sizeof sblock.fs_extra);
altsblock.fs_deftimer = sblock.fs_deftimer;
altsblock.fs_lastfsck = sblock.fs_lastfsck;
altsblock.fs_gennum = sblock.fs_gennum;
#if defined(AFS_HPUX110_ENV)
UpdateAlternateSuper(&sblock, &altsblock);
#endif /* AFS_HPUX110_ENV */
- if (bcmp((char *)&sblock, (char *)&altsblock, (int)sblock.fs_sbsize)) {
+ if (memcmp((char *)&sblock, (char *)&altsblock, (int)sblock.fs_sbsize)) {
#ifdef __alpha
- if (bcmp((char *)&sblock.fs_blank[0],
+ if (memcmp((char *)&sblock.fs_blank[0],
(char *)&altsblock.fs_blank[0],
MAXCSBUFS*sizeof(int))) {
- bzero((char *)sblock.fs_blank,
- sizeof(sblock.fs_blank));
+ memset((char *)sblock.fs_blank, 0, sizeof(sblock.fs_blank));
} else {
#endif /* __alpha */
badsb(listerr,
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/utilities.c,v 1.1.1.3 2001/07/14 22:24:41 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/utilities.c,v 1.1.1.4 2001/09/11 14:35:32 hartmans Exp $");
#include <sys/param.h>
#define VICE /* allow us to put our changes in at will */
#endif
rwerror("SEEK", blk);
errs = 0;
- bzero(buf, (int)size);
+ memset(buf, 0, (int)size);
printf("THE FOLLOWING DISK SECTORS COULD NOT BE READ:");
#ifdef AFS_SUN5_ENV
for (cp = buf, i = 0; i < btodb(size); i++, cp += DEV_BSIZE) {
strcpy(namebuf, "?");
return;
}
- bzero((char *)&idesc, sizeof(struct inodesc));
+ memset((char *)&idesc, 0, sizeof(struct inodesc));
idesc.id_type = DATA;
cp = &namebuf[BUFSIZ - 1];
*cp = '\0';
cp -= len;
if (cp < &namebuf[MAXNAMLEN])
break;
- bcopy(namebuf, cp, len);
+ memcpy(cp, namebuf, len);
*--cp = '/';
ino = idesc.id_number;
}
strcpy(namebuf, "?");
return;
}
- bcopy(cp, namebuf, &namebuf[BUFSIZ] - cp);
+ memcpy(namebuf, cp, &namebuf[BUFSIZ] - cp);
}
void
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/callback.c,v 1.1.1.5 2001/07/14 22:24:46 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/callback.c,v 1.1.1.6 2001/09/11 14:35:33 hartmans Exp $");
#include <stdio.h>
#include <stdlib.h> /* for malloc() */
register struct CallBack *cb;
time_t now;
- bzero(&fid, sizeof(fid));
+ memset(&fid, 0, sizeof(fid));
argc--; argv++;
while (argc && **argv == '-') {
noptions++;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/fsprobe.c,v 1.1.1.4 2001/07/14 22:24:46 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/fsprobe.c,v 1.1.1.5 2001/09/11 14:35:35 hartmans Exp $");
#include <afs/stds.h>
#include <afs/afsint.h>
printf("usage: pxclient <serverHost>\n");
exit(1);
}
- bzero((char *)&host, sizeof(struct sockaddr_in));
+ memset((char *)&host, 0, sizeof(struct sockaddr_in));
host.sin_family = AF_INET;
host.sin_addr.s_addr = inet_addr(av[0]);
if (host.sin_addr.s_addr != -1) {
hp = gethostbyname(av[0]);
if (hp) {
host.sin_family = hp->h_addrtype;
- bcopy(hp->h_addr, (caddr_t)&host.sin_addr, hp->h_length);
+ memcpy((caddr_t)&host.sin_addr, hp->h_addr, hp->h_length);
hostname = hp->h_name;
} else {
printf("unknown server host %s\n", av[0]);
++argp;
sscanf(&(*argp)[0], "%d", &unique);
++argp;
- bzero(&fid, sizeof(struct afsFid));
+ memset(&fid, 0, sizeof(struct afsFid));
fid.Volume.low = 10; /* XXX */
fid.Vnode = vnode;
fid.Unique = unique;
++argp;
sscanf(&(*argp)[0], "%d", &unique);
++argp;
- bzero(&fid, sizeof(struct afsFid));
+ memset(&fid, 0, sizeof(struct afsFid));
fid.Volume.low = 10; /* XXX */
fid.Vnode = vnode;
fid.Unique = unique;
++argp;
sscanf(&(*argp)[0], "%d", &unique);
++argp;
- bzero(&fid, sizeof(struct afsFid));
+ memset(&fid, 0, sizeof(struct afsFid));
fid.Volume.low = 10; /* XXX */
fid.Vnode = vnode;
fid.Unique = unique;
++argp;
sscanf(&(*argp)[0], "%d", &unique);
++argp;
- bzero(&fid, sizeof(struct afsFid));
+ memset(&fid, 0, sizeof(struct afsFid));
fid.Volume.low = 10; /* XXX */
fid.Vnode = vnode;
fid.Unique = unique;
++argp;
sscanf(&(*argp)[0], "%d", &filelength);
++argp;
- bzero(&InStatus, sizeof(struct afsStoreStatus));
+ memset(&InStatus, 0, sizeof(struct afsStoreStatus));
sscanf(&(*argp)[0], "%d", &mode);
++argp;
sscanf(&(*argp)[0], "%d", &owner);
++argp;
sscanf(&(*argp)[0], "%d", &unique);
++argp;
- bzero(&fid, sizeof(struct afsFid));
+ memset(&fid, 0, sizeof(struct afsFid));
fid.Volume.low = 10; /* XXX */
fid.Vnode = vnode;
fid.Unique = unique;
- bzero(&InStatus, sizeof(struct afsStoreStatus));
+ memset(&InStatus, 0, sizeof(struct afsStoreStatus));
sscanf(&(*argp)[0], "%d", &mode);
++argp;
sscanf(&(*argp)[0], "%d", &owner);
++argp;
sscanf(&(*argp)[0], "%d", &unique);
++argp;
- bzero(&fid, sizeof(struct afsFid));
+ memset(&fid, 0, sizeof(struct afsFid));
fid.Volume.low = 10; /* XXX */
fid.Vnode = vnode;
fid.Unique = unique;
++argp;
sscanf(&(*argp)[0], "%d", &unique);
++argp;
- bzero(&fid, sizeof(struct afsFid));
+ memset(&fid, 0, sizeof(struct afsFid));
fid.Volume.low = 10; /* XXX */
fid.Vnode = vnode;
fid.Unique = unique;
name = &argp[0][0];
++argp;
- bzero(&nameFid, sizeof(struct afsFidName));
+ memset(&nameFid, 0, sizeof(struct afsFidName));
strcpy(nameFid.name, name);
code = ubik_Call(AFS_RemoveFile, cstruct, 0, &fid, &nameFid, &hyp0, 0,
&OutDirStatus, &OutFidStatus, &outFid, &tsync);
++argp;
sscanf(&(*argp)[0], "%d", &unique);
++argp;
- bzero(&fid, sizeof(struct afsFid));
+ memset(&fid, 0, sizeof(struct afsFid));
fid.Volume.low = 10; /* XXX */
fid.Vnode = vnode;
fid.Unique = unique;
name = &argp[0][0];
++argp;
- bzero(&InStatus, sizeof(struct afsStoreStatus));
+ memset(&InStatus, 0, sizeof(struct afsStoreStatus));
sscanf(&(*argp)[0], "%d", &mode);
++argp;
sscanf(&(*argp)[0], "%d", &owner);
++argp;
sscanf(&(*argp)[0], "%d", &ounique);
++argp;
- bzero(&OldDirFid, sizeof(struct afsFid));
+ memset(&OldDirFid, 0, sizeof(struct afsFid));
OldDirFid.Volume.low = 10; /* XXX */
OldDirFid.Vnode = ovnode;
OldDirFid.Unique = ounique;
oname = &argp[0][0];
++argp;
- bzero(&OldName, sizeof(struct afsFidName));
+ memset(&OldName, 0, sizeof(struct afsFidName));
strcpy(OldName.name, oname);
sscanf(&(*argp)[0], "%d", &nvnode);
++argp;
sscanf(&(*argp)[0], "%d", &nunique);
++argp;
- bzero(&NewDirFid, sizeof(struct afsFid));
+ memset(&NewDirFid, 0, sizeof(struct afsFid));
NewDirFid.Volume.low = 10; /* XXX */
NewDirFid.Vnode = nvnode;
NewDirFid.Unique = nunique;
nname = &argp[0][0];
++argp;
- bzero(&NewName, sizeof(struct afsFidName));
+ memset(&NewName, 0, sizeof(struct afsFidName));
strcpy(NewName.name, nname);
code = ubik_Call(AFS_Rename, cstruct, 0, &OldDirFid, &OldName, &NewDirFid, &NewName, &hyp0, 0,
&OutOldDirStatus, &OutNewDirStatus,
++argp;
sscanf(&(*argp)[0], "%d", &unique);
++argp;
- bzero(&fid, sizeof(struct afsFid));
+ memset(&fid, 0, sizeof(struct afsFid));
fid.Volume.low = 10; /* XXX */
fid.Vnode = vnode;
fid.Unique = unique;
++argp;
linkcontents = &argp[0][0];
++argp;
- bzero(&InStatus, sizeof(struct afsStoreStatus));
+ memset(&InStatus, 0, sizeof(struct afsStoreStatus));
sscanf(&(*argp)[0], "%d", &mode);
++argp;
sscanf(&(*argp)[0], "%d", &owner);
++argp;
sscanf(&(*argp)[0], "%d", &unique);
++argp;
- bzero(&fid, sizeof(struct afsFid));
+ memset(&fid, 0, sizeof(struct afsFid));
fid.Volume.low = 10; /* XXX */
fid.Vnode = vnode;
fid.Unique = unique;
++argp;
sscanf(&(*argp)[0], "%d", &unique);
++argp;
- bzero(&existingFid, sizeof(struct afsFid));
+ memset(&existingFid, 0, sizeof(struct afsFid));
existingFid.Volume.low = 10; /* XXX */
existingFid.Vnode = vnode;
existingFid.Unique = unique;
++argp;
sscanf(&(*argp)[0], "%d", &unique);
++argp;
- bzero(&fid, sizeof(struct afsFid));
+ memset(&fid, 0, sizeof(struct afsFid));
fid.Volume.low = 10; /* XXX */
fid.Vnode = vnode;
fid.Unique = unique;
name = &argp[0][0];
++argp;
- bzero(&InStatus, sizeof(struct afsStoreStatus));
+ memset(&InStatus, 0, sizeof(struct afsStoreStatus));
sscanf(&(*argp)[0], "%d", &mode);
++argp;
sscanf(&(*argp)[0], "%d", &owner);
++argp;
sscanf(&(*argp)[0], "%d", &unique);
++argp;
- bzero(&fid, sizeof(struct afsFid));
+ memset(&fid, 0, sizeof(struct afsFid));
fid.Volume.low = 10; /* XXX */
fid.Vnode = vnode;
fid.Unique = unique;
name = &argp[0][0];
++argp;
- bzero(&nameFid, sizeof(struct afsFidName));
+ memset(&nameFid, 0, sizeof(struct afsFidName));
strcpy(nameFid.name, name);
code = ubik_Call(AFS_RemoveDir, cstruct, 0, &fid, &nameFid, &hyp0, 0,
&OutDirStatus, &outFid, &tsync);
++argp;
sscanf(&(*argp)[0], "%d", &length);
++argp;
- bzero(&fid, sizeof(struct afsFid));
+ memset(&fid, 0, sizeof(struct afsFid));
fid.Volume.low = 10; /* XXX */
fid.Vnode = vnode;
fid.Unique = unique;
++argp;
sscanf(&(*argp)[0], "%d", &unique);
++argp;
- bzero(&fid, sizeof(struct afsFid));
+ memset(&fid, 0, sizeof(struct afsFid));
fid.Volume.low = 10; /* XXX */
fid.Vnode = vnode;
fid.Unique = unique;
++argp;
sscanf(&(*argp)[0], "%d", &unique);
++argp;
- bzero(&fid, sizeof(struct afsFid));
+ memset(&fid, 0, sizeof(struct afsFid));
fid.Volume.low = 10; /* XXX */
fid.Vnode = vnode;
fid.Unique = unique;
sscanf(&(*argp)[0], "%d", &tokenId);
++argp;
- bzero(&MinToken, sizeof(struct afsToken));
+ memset(&MinToken, 0, sizeof(struct afsToken));
MinToken.tokenID.low = tokenId; /* XXX */
code = ubik_Call(AFS_GetToken, cstruct, 0, &fid, &MinToken, &hyp0, 0,
&RealToken, &OutStatus, &tsync);
struct afsFidExp fx;
int code;
- bzero(&fx, sizeof(struct afsFidExp));
+ memset(&fx, 0, sizeof(struct afsFidExp));
sscanf(&(*argp)[0], "%d", &fx.fid.Volume.low);
++argp;
sscanf(&(*argp)[0], "%d", &fx.fid.Vnode);
sscanf(&(*argp)[0], "%d", &numExec);
++argp;
sscanf(&(*argp)[0], "%d", &fx.keepAliveTime);
- bzero(&fex, sizeof(struct afsBulkFEX));
+ memset(&fex, 0, sizeof(struct afsBulkFEX));
fex.afsBulkFEX_val = &fx;
fex.afsBulkFEX_len = 1;
code = ubik_Call(AFS_BulkKeepAlive, cstruct, 0, &fex, numExec, 0, 0, 0, &spare4);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/host.c,v 1.1.1.5 2001/07/14 22:24:47 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/host.c,v 1.1.1.6 2001/09/11 14:35:35 hartmans Exp $");
#include <stdio.h>
#include <errno.h>
entry = CEFree;
CEFree = entry->next;
CEs++;
- bzero((char *)entry, CLIENT_TO_ZERO(entry));
+ memset((char *)entry, 0, CLIENT_TO_ZERO(entry));
return(entry);
} /*GetCE*/
entry = HTFree;
HTFree = entry->next;
HTs++;
- bzero((char *)entry, HOST_TO_ZERO(entry));
+ memset((char *)entry, 0, HOST_TO_ZERO(entry));
return(entry);
} /*GetHT*/
afs_uint32 now = FT_ApproxTime();
- bzero((char *)&zerofid, sizeof(zerofid));
+ memset((char *)&zerofid, 0, sizeof(zerofid));
/*
* Send a probe to the workstation if it hasn't been heard from in
* 15 minutes
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/physio.c,v 1.1.1.4 2001/07/14 22:24:47 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/physio.c,v 1.1.1.5 2001/09/11 14:35:35 hartmans Exp $");
#include <stdio.h>
#include <errno.h>
{
IH_RELEASE(file->dirh_handle);
- bzero((char *)file, sizeof(DirHandle));
+ memset((char *)file, 0, sizeof(DirHandle));
}
FidZero (file)
DirHandle * file;
{
- bzero((char *)file, sizeof(DirHandle));
+ memset((char *)file, 0, sizeof(DirHandle));
}
FidEq (afile, bfile)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/profile.c,v 1.1.1.4 2001/07/14 22:24:47 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/profile.c,v 1.1.1.5 2001/09/11 14:35:36 hartmans Exp $");
#include <stdio.h>
#include <sys/file.h>
#if !defined (AFS_AIX_ENV) && !defined (AFS_HPUX_ENV)
/* Soon should handle aix profiling */
AllocProfBuf();
- bzero (profBuf, profBufSize);
+ memset(profBuf, 0, profBufSize);
/* the following code is to replace the monitor call below */
/* monitor (PROFSTART, &etext, profBuf, profBufSize, 0); */
profileHeader.startpc = PROFSTART;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/viced.c,v 1.1.1.6 2001/07/14 22:24:48 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/viced.c,v 1.1.1.7 2001/09/11 14:35:36 hartmans Exp $");
#include <stdio.h>
#include <stdlib.h>
code = afsconf_GetKey(confDir, akvno, tkey.key);
if (code)
return code;
- bcopy(tkey.key, akey, sizeof(tkey.key));
+ memcpy(akey, tkey.key, sizeof(tkey.key));
return 0;
} /*get_key*/
}
else {
char hoststr[16];
- bcopy(he->h_addr, &FS_HostAddr_NBO, 4);
+ memcpy(&FS_HostAddr_NBO, he->h_addr, 4);
afs_inet_ntoa_r(FS_HostAddr_NBO, hoststr);
FS_HostAddr_HBO = ntohl(FS_HostAddr_NBO);
ViceLog(0,("FileServer %s has address %s (0x%x or 0x%x in host byte order)\n",
/*
* Zero all xstat-related structures.
*/
- bzero((char *)(&afs_perfstats), sizeof(struct afs_PerfStats));
+ memset((char *)(&afs_perfstats), 0, sizeof(struct afs_PerfStats));
#if FS_STATS_DETAILED
- bzero((char *)(&afs_FullPerfStats), sizeof(struct fs_stats_FullPerfStats));
+ memset((char *)(&afs_FullPerfStats), 0, sizeof(struct fs_stats_FullPerfStats));
/*
* That's not enough. We have to set reasonable minima for
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/cnvldb.c,v 1.1.1.4 2001/07/14 22:24:50 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/cnvldb.c,v 1.1.1.5 2001/09/11 14:35:37 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
char *apath; {
register char *tp;
strcpy(tspace, apath);
- tp = rindex(tspace, '/');
+ tp = strrchr(tspace, '/');
if (tp) {
*tp = 0;
}
if (fromv == 1) {
if (tov == 1) {
- bcopy (fromaddr, toaddr, sizeof(struct vlheader_1));
+ memcpy(toaddr, fromaddr, sizeof(struct vlheader_1));
tvp1 = (struct vlheader_1 *) toaddr;
w = write (fd, tvp1, sizeof(struct vlheader_1));
} else if (tov == 2 || tov == 3) {
tvp1 = (struct vlheader_1 *) fromaddr;
tvp2 = (struct vlheader_2 *) toaddr;
- bzero(tvp2, sizeof(struct vlheader_2));
+ memset(tvp2, 0, sizeof(struct vlheader_2));
tvp2->vital_header.vldbversion = htonl(tov);
tvp2->vital_header.headersize = htonl(sizeof(struct vlheader_2));
diff = ntohl(tvp2->vital_header.headersize) -
return EINVAL;
} else if (fromv == 2 || fromv == 3 || fromv == 4) {
if (tov == 2 || tov == 3 || tov == 4) {
- bcopy (fromaddr, toaddr, sizeof(struct vlheader_2));
+ memcpy(toaddr, fromaddr, sizeof(struct vlheader_2));
tvp2 = (struct vlheader_2 *) toaddr;
tvp2->vital_header.vldbversion = htonl(tov);
w = write (fd, tvp2, sizeof(struct vlheader_2));
} else if (tov == 1) {
tvp2 = (struct vlheader_2 *) fromaddr;
tvp1 = (struct vlheader_1 *) toaddr;
- bzero(tvp1, sizeof(struct vlheader_1));
+ memset(tvp1, 0, sizeof(struct vlheader_1));
tvp1->vital_header.vldbversion = htonl(1);
tvp1->vital_header.headersize = htonl(sizeof(struct vlheader_1));
diff = ntohl(tvp1->vital_header.headersize) - ntohl(tvp2->vital_header.headersize);
vl.nextIdHash[1] = vlentryp->nextIdHash[1];
vl.nextIdHash[2] = vlentryp->nextIdHash[2];
vl.nextNameHash = vlentryp->nextNameHash;
- bcopy(vlentryp->name, vl.name, 65);
+ memcpy(vl.name, vlentryp->name, 65);
for (i = 0; i < 8; i++) {
vl.serverNumber[i] = vlentryp->serverNumber[i];
vl.serverPartition[i] = vlentryp->serverPartition[i];
struct vlentry_2 vl;
struct vlentry_3 *xnvlentry = (struct vlentry_3 *) vlentryp;
- bzero((char *)&vl, sizeof (struct vlentry_2));
+ memset((char *)&vl, 0, sizeof (struct vlentry_2));
vl.volumeId[0] = xnvlentry->volumeId[0];
vl.volumeId[1] = xnvlentry->volumeId[1];
vl.volumeId[2] = xnvlentry->volumeId[2];
}
if (ntohl(xnvlentry->nextNameHash))
vl.nextNameHash = xnvlentry->nextNameHash;
- bcopy(xnvlentry->name, vl.name, 65);
+ memcpy(vl.name, xnvlentry->name, 65);
for (i = 0; i < 8; i++) {
vl.serverNumber[i] = xnvlentry->serverNumber[i];
vl.serverPartition[i] = xnvlentry->serverPartition[i];
diff = (tovers == 1 ? sizeof(struct vlheader_1) : sizeof(struct vlheader_2))
- (fromvers == 1 ? sizeof(struct vlheader_1) : sizeof(struct vlheader_2));
- bzero((char *)&vl, sizeof (struct vlentry_1));
+ memset((char *)&vl, 0, sizeof (struct vlentry_1));
vl.volumeId[0] = xnvlentry->volumeId[0];
vl.volumeId[1] = xnvlentry->volumeId[1];
vl.volumeId[2] = xnvlentry->volumeId[2];
if (ntohl(xnvlentry->nextNameHash))
vl.nextNameHash = htonl(ntohl(xnvlentry->nextNameHash) + diff);
- bcopy(xnvlentry->name, vl.name, 65);
+ memcpy(vl.name, xnvlentry->name, 65);
for (i = 0; i < 8; i++) {
vl.serverNumber[i] = xnvlentry->serverNumber[i];
vl.serverPartition[i] = xnvlentry->serverPartition[i];
* blocks go away and all vlentries after them move up in the vldb file.
* When this happens, the linked list pointers need to be updated.
*/
- bcopy(vlentryp, &vl, sizeof(vl));
+ memcpy(&vl, vlentryp, sizeof(vl));
for (i=0; i<3; i++) {
vl.nextIdHash[i] = Conv4to3(vl.nextIdHash[i]);
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/sascnvldb.c,v 1.1.1.4 2001/07/14 22:24:48 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/sascnvldb.c,v 1.1.1.5 2001/09/11 14:35:37 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
char *apath; {
register char *tp;
strcpy(tspace, apath);
- tp = rindex(tspace, '/');
+ tp = strrchr(tspace, '/');
if (tp) {
*tp = 0;
}
struct vlheader_2 *tvp2;
int i,j,diff;
- bcopy (fromaddr, toaddr, sizeof(struct vlheader_2));
+ memcpy(toaddr, fromaddr, sizeof(struct vlheader_2));
tvp2 = (struct vlheader_2 *) toaddr;
tvp2->vital_header.vldbversion = htonl(2);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vlclient.c,v 1.1.1.4 2001/07/14 22:24:51 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vlclient.c,v 1.1.1.5 2001/09/11 14:35:38 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
}
th = gethostbyname(aname);
if (!th) return 0;
- bcopy(th->h_addr, &addr, sizeof(addr));
+ memcpy(&addr, th->h_addr, sizeof(addr));
return addr;
}
while (1) {
char line[500];
int nargs, releasetype;
- bzero(&entry, sizeof(entry));
- bzero(&updateentry, sizeof(updateentry));
- bzero(&listbyattributes, sizeof(listbyattributes));
+ memset(&entry, 0, sizeof(entry));
+ memset(&updateentry, 0, sizeof(updateentry));
+ memset(&listbyattributes, 0, sizeof(listbyattributes));
printf("vl> ");
if (fgets(line, 499, stdin) == NULL) {
printf("\n");
} else if (!strcmp(oper,"ls")) {
afs_int32 index, count, next_index;
for (index = 0; 1; index = next_index) {
- bzero(&entry, sizeof(entry));
+ memset(&entry, 0, sizeof(entry));
code = ubik_Call(VL_ListEntry,cstruct,0,index,&count,&next_index,&entry);
if (code) {
printf("VL_ListEntry returned code = %d\n", code);
}
printf("Enumerating all entries in vldb...\n");
for (index = 0; 1; index = next_index) {
- bzero(&entry, sizeof(entry));
+ memset(&entry, 0, sizeof(entry));
code = ubik_Call(VL_ListEntry,cstruct,0,index,&count,&next_index,&entry);
if (code) {
printf("VL_ListEntry returned code = %d\n", code);
}
printf("Volumes not found in main hash tables in vldb...\n");
for (index = 0; 1; index = next_index) {
- bzero(&entry, sizeof(entry));
+ memset(&entry, 0, sizeof(entry));
code = ubik_Call(VL_ListEntry,cstruct,0,index,&count,&next_index,&entry);
if (code) {
printf("VL_ListEntry returned code = %d\n", code);
exit(1);
}
printf("Volumes not found in main hash tables in vldb will be fixed...\n");
- bzero(&updateentry, sizeof(updateentry));
+ memset(&updateentry, 0, sizeof(updateentry));
for (index = 0; 1; index = next_index) {
int n1=0, n2=0, n3=0, n4=0;
- bzero(&entry, sizeof(entry));
+ memset(&entry, 0, sizeof(entry));
code = ubik_Call(VL_ListEntry,cstruct,0,index,&count,&next_index,&entry);
if (code) {
printf("VL_ListEntry returned code = %d\n", code);
bulkentries entries;
struct vldbentry *entry;
- bzero(&entries,sizeof(entries));
+ memset(&entries, 0, sizeof(entries));
fill_listattributes_entry(&listbyattributes, argp, nargs);
display_listattributes_entry(&listbyattributes, 0);
code = ubik_Call(VL_ListAttributes, cstruct, 0, &listbyattributes, &nentries, &entries);
for (si=0; si!=-1; si=nsi) {
nentries = 0;
- bzero(&entries,sizeof(entries));
+ memset(&entries, 0, sizeof(entries));
code = ubik_Call(VL_ListAttributesN2, cstruct, 0,
&listbyattributes, name, si,
&nentries, &entries, &nsi);
fill_listattributes_entry(&listbyattributes, argp, nargs);
display_listattributes_entry(&listbyattributes, 0);
- bzero(&linkedvldbs, sizeof(vldb_list));
+ memset(&linkedvldbs, 0, sizeof(vldb_list));
code = ubik_Call(VL_LinkedList, cstruct, 0, &listbyattributes,
&netries, &linkedvldbs);
if (code) {
fill_listattributes_entry(&listbyattributes, argp, nargs);
display_listattributes_entry(&listbyattributes, 0);
- bzero(&linkedvldbs, sizeof(vldb_list));
+ memset(&linkedvldbs, 0, sizeof(vldb_list));
code = ubik_Call(VL_LinkedListN, cstruct, 0, &listbyattributes,
&netries, &linkedvldbs);
if (code) {
sscanf(&(*argp)[0], "%d", &voltype);
code = ubik_Call(VL_GetEntryByID, cstruct, 0, id, voltype, &entry);
display_entry(&entry, code);
- bzero(&updateentry, sizeof(updateentry));
+ memset(&updateentry, 0, sizeof(updateentry));
updateentry.Mask = VLUPDATE_VOLNAMEHASH;
printf("\tRehashing namehash table for %s (%d)\n", entry.name, entry.volumeId[RWVOL]);
code = ubik_Call(VL_UpdateEntry, cstruct, 0, entry.volumeId[RWVOL], -1, &updateentry, 0);
} else if (!strcmp(oper,"undelete")) {
afs_int32 index, count, next_index;
- bzero(&updateentry, sizeof(updateentry));
+ memset(&updateentry, 0, sizeof(updateentry));
sscanf(&(*argp)[0], "%d", &id);
++argp, --nargs;
sscanf(&(*argp)[0], "%d", &voltype);
}
printf("Searching vldb for volume %d...\n", id);
for (index = 0; 1; index = next_index) {
- bzero(&entry, sizeof(entry));
+ memset(&entry, 0, sizeof(entry));
code = ubik_Call(VL_ListEntry,cstruct,0,index,&count,&next_index,&entry);
if (code) {
printf("VL_ListEntry returned code = %d\n", code);
struct vldbentry *entry;
afsUUID uuid;
- bzero(&uuid,sizeof(uuid));
+ memset(&uuid, 0, sizeof(uuid));
sscanf(&(*argp)[0], "%d", &i);
++argp, --nargs;
- bcopy(&i, uuid.node, sizeof(i));
+ memcpy(uuid.node, &i, sizeof(i));
if (nargs < 0 || nargs > 16) {
printf("Illegal # entries = %d\n", nargs);
printf("cmdebug: can't resolve address for host %s");
continue;
}
- bcopy((afs_int32 *)h1->h_addr, &a1, sizeof(afs_uint32));
+ memcpy(&a1, (afs_int32 *)h1->h_addr, sizeof(afs_uint32));
++argp, --nargs;
printf(" to %s\n", *argp);
printf("cmdebug: can't resolve address for host %s", *argp);
continue;
}
- bcopy((afs_int32 *)h2->h_addr, &a2, sizeof(afs_uint32));
+ memcpy(&a2, (afs_int32 *)h2->h_addr, sizeof(afs_uint32));
printf("changing 0x%x to 0x%x\n", ntohl(a1), ntohl(a2));
code = ubik_Call(VL_ChangeAddr, cstruct, 0, ntohl(a1), ntohl(a2));
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vldb_check.c,v 1.1.1.4 2001/07/14 22:24:51 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vldb_check.c,v 1.1.1.5 2001/09/11 14:35:38 hartmans Exp $");
#include <sys/types.h>
#include <sys/stat.h>
int ipindex, ipaddrs;
afsUUID nulluuid;
- bzero(&nulluuid, sizeof(nulluuid));
+ memset(&nulluuid, 0, sizeof(nulluuid));
if (verbose)
printf("Check Multihomed blocks\n");
maxentries = (header.vital_header.eofPtr / sizeof(vlentry)) + 1;
record = (struct er *)malloc(maxentries * sizeof(struct er));
- bzero((char *)record, (maxentries * sizeof(struct er)));
- bzero((char *)serveraddrs, sizeof(serveraddrs));
+ memset((char *)record, 0, (maxentries * sizeof(struct er)));
+ memset((char *)serveraddrs, 0, sizeof(serveraddrs));
/* Will fill in the record array of entries it found */
ReadAllEntries(&header);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vlprocs.c,v 1.1.1.4 2001/07/14 22:24:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vlprocs.c,v 1.1.1.5 2001/09/11 14:35:39 hartmans Exp $");
#include <sys/types.h>
#include <stdio.h>
goto abort;
}
- bzero(&tentry, sizeof(struct nvlentry));
+ memset(&tentry, 0, sizeof(struct nvlentry));
/* Convert to its internal representation; both in host byte order */
if (errorcode = vldbentry_to_vlentry(trans, newentry, &tentry)) {
FreeBlock(trans, blockindex);
goto abort;
}
- bzero(&tentry, sizeof(struct nvlentry));
+ memset(&tentry, 0, sizeof(struct nvlentry));
/* Convert to its internal representation; both in host byte order */
if (errorcode = nvldbentry_to_vlentry(trans, newentry, &tentry)) {
FreeBlock(trans, blockindex);
if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
return errorcode;
VLog(5, ("GetStats %\n", rxinfo(rxcall)));
- bcopy((char *)&cheader.vital_header, (char *) vital_header, sizeof(vital_vlheader));
- bcopy((char *)&dynamic_statistics, (char *) stats, sizeof(vldstats));
+ memcpy((char *) vital_header, (char *)&cheader.vital_header, sizeof(vital_vlheader));
+ memcpy((char *) stats, (char *)&dynamic_statistics, sizeof(vldstats));
return(ubik_EndTrans(trans));
}
COUNT_REQ(VLGETADDRS);
addrsp->bulkaddrs_len = *nentries = 0;
addrsp->bulkaddrs_val = 0;
- bzero (spare3, sizeof (struct VLCallBack));
+ memset(spare3, 0, sizeof (struct VLCallBack));
if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
return errorcode;
{
int i, j;
- bzero(VldbEntry, sizeof(struct vldbentry));
+ memset(VldbEntry, 0, sizeof(struct vldbentry));
strncpy(VldbEntry->name, VlEntry->name, sizeof(VldbEntry->name));
for (i=0; i < OMAXNSERVERS; i++) {
if (VlEntry->serverNumber[i] == BADSERVERID) break;
{
int i, j;
- bzero(VldbEntry, sizeof(struct vldbentry));
+ memset(VldbEntry, 0, sizeof(struct vldbentry));
strncpy(VldbEntry->name, VlEntry->name, sizeof(VldbEntry->name));
for (i=0; i < NMAXNSERVERS; i++) {
if (VlEntry->serverNumber[i] == BADSERVERID) break;
{
int i, j;
- bzero(VldbEntry, sizeof(struct vldbentry));
+ memset(VldbEntry, 0, sizeof(struct vldbentry));
strncpy(VldbEntry->name, VlEntry->name, sizeof(VldbEntry->name));
for (i=0; i < NMAXNSERVERS; i++) {
if (VlEntry->serverNumber[i] == BADSERVERID) break;
/* Change the registered uuuid addresses */
if (exp) {
- bzero(&tuuid, sizeof(afsUUID));
+ memset(&tuuid, 0, sizeof(afsUUID));
afs_htonuuid(&tuuid);
exp->ex_hostuuid = tuuid;
code = vlwrite(atrans, DOFFSET(ntohl(ex_addr[0]->ex_contaddrs[base]),
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vlserver.c,v 1.1.1.8 2001/07/14 22:24:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vlserver.c,v 1.1.1.9 2001/09/11 14:35:40 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
printf("vlserver: couldn't get address of this host (%s).\n", hostname);
exit(1);
}
- bcopy(th->h_addr,&myHost,sizeof(afs_int32));
+ memcpy(&myHost, th->h_addr, sizeof(afs_int32));
#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
signal(SIGXCPU, CheckSignal_Signal);
vldb_confdir = tdir; /* Preserve our configuration dir */
/* rxvab no longer supported */
- bzero(&tkey, sizeof(tkey));
+ memset(&tkey, 0, sizeof(tkey));
if (noAuth) afsconf_SetNoAuthFlag(tdir, 1);
}
rx_SetRxDeadTime(50);
- bzero(HostAddress, sizeof(HostAddress));
+ memset(HostAddress, 0, sizeof(HostAddress));
initialize_dstats();
sc[0] = rxnull_NewServerSecurityObject();
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vlutils.c,v 1.1.1.4 2001/07/14 22:24:53 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vlutils.c,v 1.1.1.5 2001/09/11 14:35:40 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
for (i=0;i<MAXTYPES;i++)
nentry.nextIdHash[i] = htonl(nep->nextIdHash[i]);
nentry.nextNameHash = htonl(nep->nextNameHash);
- bcopy(nep->name, nentry.name, VL_MAXNAMELEN);
- bcopy(nep->serverNumber, nentry.serverNumber, NMAXNSERVERS);
- bcopy(nep->serverPartition, nentry.serverPartition, NMAXNSERVERS);
- bcopy(nep->serverFlags, nentry.serverFlags, NMAXNSERVERS);
+ memcpy(nentry.name, nep->name, VL_MAXNAMELEN);
+ memcpy(nentry.serverNumber, nep->serverNumber, NMAXNSERVERS);
+ memcpy(nentry.serverPartition, nep->serverPartition, NMAXNSERVERS);
+ memcpy(nentry.serverFlags, nep->serverFlags, NMAXNSERVERS);
bufp = (char *)&nentry;
} else {
- bzero(&oentry, sizeof(struct vlentry));
+ memset(&oentry, 0, sizeof(struct vlentry));
nep = (struct nvlentry *)buffer;
for (i=0;i<MAXTYPES;i++)
oentry.volumeId[i] = htonl(nep->volumeId[i]);
for (i=0;i<MAXTYPES;i++)
oentry.nextIdHash[i] = htonl(nep->nextIdHash[i]);
oentry.nextNameHash = htonl(nep->nextNameHash);
- bcopy(nep->name, oentry.name, VL_MAXNAMELEN);
- bcopy(nep->serverNumber, oentry.serverNumber, OMAXNSERVERS);
- bcopy(nep->serverPartition, oentry.serverPartition, OMAXNSERVERS);
- bcopy(nep->serverFlags, oentry.serverFlags, OMAXNSERVERS);
+ memcpy(oentry.name, nep->name, VL_MAXNAMELEN);
+ memcpy(oentry.serverNumber, nep->serverNumber, OMAXNSERVERS);
+ memcpy(oentry.serverPartition, nep->serverPartition, OMAXNSERVERS);
+ memcpy(oentry.serverFlags, nep->serverFlags, OMAXNSERVERS);
bufp = (char *)&oentry;
}
return vlwrite(trans, offset, bufp, length);
for(i=0;i<MAXTYPES;i++)
nbufp->nextIdHash[i] = ntohl(nep->nextIdHash[i]);
nbufp->nextNameHash = ntohl(nep->nextNameHash);
- bcopy(nep->name, nbufp->name, VL_MAXNAMELEN);
- bcopy(nep->serverNumber, nbufp->serverNumber, NMAXNSERVERS);
- bcopy(nep->serverPartition, nbufp->serverPartition, NMAXNSERVERS);
- bcopy(nep->serverFlags, nbufp->serverFlags, NMAXNSERVERS);
+ memcpy(nbufp->name, nep->name, VL_MAXNAMELEN);
+ memcpy(nbufp->serverNumber, nep->serverNumber, NMAXNSERVERS);
+ memcpy(nbufp->serverPartition, nep->serverPartition, NMAXNSERVERS);
+ memcpy(nbufp->serverFlags, nep->serverFlags, NMAXNSERVERS);
} else {
oep = (struct vlentry *)bufp;
nbufp = (struct nvlentry *)buffer;
- bzero(nbufp, sizeof (struct nvlentry));
+ memset(nbufp, 0, sizeof (struct nvlentry));
for(i=0;i<MAXTYPES;i++)
nbufp->volumeId[i] = ntohl(oep->volumeId[i]);
nbufp->flags = ntohl(oep->flags);
for(i=0;i<MAXTYPES;i++)
nbufp->nextIdHash[i] = ntohl(oep->nextIdHash[i]);
nbufp->nextNameHash = ntohl(oep->nextNameHash);
- bcopy(oep->name, nbufp->name, VL_MAXNAMELEN);
- bcopy(oep->serverNumber, nbufp->serverNumber, NMAXNSERVERS);
- bcopy(oep->serverPartition, nbufp->serverPartition, NMAXNSERVERS);
- bcopy(oep->serverFlags, nbufp->serverFlags, NMAXNSERVERS);
+ memcpy(nbufp->name, oep->name, VL_MAXNAMELEN);
+ memcpy(nbufp->serverNumber, oep->serverNumber, NMAXNSERVERS);
+ memcpy(nbufp->serverPartition, oep->serverPartition, NMAXNSERVERS);
+ memcpy(nbufp->serverFlags, oep->serverFlags, NMAXNSERVERS);
}
return 0;
}
vldbversion = ntohl(cheader.vital_header.vldbversion);
if (!ubcode && (vldbversion != 0)) {
- bcopy(cheader.IpMappedAddr, HostAddress, sizeof(cheader.IpMappedAddr));
+ memcpy(HostAddress, cheader.IpMappedAddr, sizeof(cheader.IpMappedAddr));
for (i=0; i<MAXSERVERID+1; i++) { /* cvt HostAddress to host order */
HostAddress[i] = ntohl(HostAddress[i]);
}
printf("Can't read VLDB header, re-initialising...\n");
/* try to write a good header */
- bzero(&cheader,sizeof(cheader));
+ memset(&cheader, 0, sizeof(cheader));
cheader.vital_header.vldbversion = htonl(VLDBVERSION);
cheader.vital_header.headersize = htonl(sizeof(cheader));
/* DANGER: Must get this from a master place!! */
if (!ex_addr[base])
ERROR_EXIT(VL_NOMEM);
}
- bzero((char *)ex_addr[base], VL_ADDREXTBLK_SIZE);
+ memset((char *)ex_addr[base], 0, VL_ADDREXTBLK_SIZE);
/* Write the full extension block at end of vldb */
ex_addr[base]->ex_flags = htonl(VLCONTBLOCK);
}
cheader.vital_header.allocs++;
if (write_vital_vlheader(trans)) return 0;
- bzero (tentry, sizeof(nvlentry)); /* zero new entry */
+ memset(tentry, 0, sizeof(nvlentry)); /* zero new entry */
return blockindex;
}
/* check validity of blockindex just to be on the safe side */
if (!index_OK (trans, blockindex)) return VL_BADINDEX;
- bzero (&tentry, sizeof(nvlentry));
+ memset(&tentry, 0, sizeof(nvlentry));
tentry.nextIdHash[0] = cheader.vital_header.freePtr; /* already in network order */
tentry.flags = htonl(VLFREE);
cheader.vital_header.freePtr = htonl(blockindex);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/clone.c,v 1.1.1.4 2001/07/14 22:24:54 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/clone.c,v 1.1.1.5 2001/09/11 14:35:41 hartmans Exp $");
#include <sys/types.h>
#include <stdio.h>
/* initialize a clone header */
int ci_InitHead(struct clone_head *ah)
{
- bzero(ah, sizeof(*ah));
+ memset(ah, 0, sizeof(*ah));
return 0;
}
#include <sys/param.h>
#include <afsconfig.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/devname.c,v 1.1.1.5 2001/07/11 03:12:18 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/devname.c,v 1.1.1.6 2001/09/11 14:35:41 hartmans Exp $");
#include <afs/param.h>
#include <rx/xdr.h>
#endif
if (wpath) {
strcpy(pbuf, pbuffer);
- ptr = (char *)rindex(pbuf, '/');
+ ptr = (char *)strrchr(pbuf, '/');
if (ptr) {
*ptr = '\0';
strcpy(wpath, pbuf);
} else
return (char *)0;
}
- ptr = (char *)rindex(pbuffer, '/');
+ ptr = (char *)strrchr(pbuffer, '/');
if (ptr) {
strcpy(pbuffer, ptr+1);
return pbuffer;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/fs_conv_411.c,v 1.1.1.4 2001/07/14 22:24:53 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/fs_conv_411.c,v 1.1.1.5 2001/09/11 14:35:41 hartmans Exp $");
#if defined(AFS_DUX40_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) || defined(AFS_SUN54_ENV)
#if defined AFS_DUX40_ENV
return (char *) 0; /* failed */
}
-extern char *rindex();
char *unrawname(name)
char *name;
{
char *dp;
struct stat stb;
- if ((dp = rindex(name, '/')) == 0)
+ if ((dp = strrchr(name, '/')) == 0)
return (name);
if (stat(name, &stb) < 0)
return (name);
static char rawbuf[32];
char *dp;
- if ((dp = rindex(name, '/')) == 0)
+ if ((dp = strrchr(name, '/')) == 0)
return (0);
*dp = 0;
(void)strcpy(rawbuf, name);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/fssync.c,v 1.1.1.4 2001/07/14 22:24:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/fssync.c,v 1.1.1.5 2001/09/11 14:35:42 hartmans Exp $");
#include <sys/types.h>
#include <stdio.h>
{
int sd;
- bzero(addr, sizeof(*addr));
+ memset(addr, 0, sizeof(*addr));
assert((sd = socket(AF_INET, SOCK_STREAM, 0)) >= 0);
addr->sin_addr.s_addr = htonl(0x7f000001);
addr->sin_family = AF_INET; /* was localhost->h_addrtype */
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/gi.c,v 1.1.1.4 2001/07/14 22:24:56 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/gi.c,v 1.1.1.5 2001/09/11 14:35:42 hartmans Exp $");
#include <sys/types.h>
#include <sys/stat.h>
int error=0;
struct stat status;
int dev, fd, inode;
+
+#if defined(AFS_NT40_ENV) || defined(AFS_NAMEI_ENV)
+ fprintf(stderr, "gi not supported on NT or NAMEI systems.\n");
+ exit(1);
+#else
+
argc--; argv++;
while (argc && **argv == '-') {
if (strcmp(*argv, "-stat") == 0)
write(1, buf, n);
}
exit(0);
+#endif /* AFS_NT40_ENV || AFS_NAMEI_ENV */
}
Perror(err, a1, a2, a3)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/nuke.c,v 1.1.1.4 2001/07/14 22:24:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/nuke.c,v 1.1.1.5 2001/09/11 14:35:44 hartmans Exp $");
#include <rx/xdr.h>
#include <afs/afsint.h>
/* record the info */
if (!allInodes || allInodes->freePtr >= MAXATONCE) {
ti = (struct ilist *) malloc(sizeof(struct ilist));
- bzero(ti, sizeof(*ti));
+ memset(ti, 0, sizeof(*ti));
ti->next = allInodes;
allInodes = ti;
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/physio.c,v 1.1.1.4 2001/07/14 22:24:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/physio.c,v 1.1.1.5 2001/09/11 14:35:45 hartmans Exp $");
#include <stdio.h>
#include <sys/types.h>
Device device;
{
static SalvageCacheCheck = 1;
- bzero(dir, sizeof(DirHandle));
+ memset(dir, 0, sizeof(DirHandle));
dir->dirh_device = device;
dir->dirh_volume = volume;
{
IH_RELEASE(file->dirh_handle);
- bzero(file, sizeof(DirHandle));
+ memset(file, 0, sizeof(DirHandle));
}
FidZero (file)
DirHandle * file;
{
- bzero(file, sizeof(DirHandle));
+ memset(file, 0, sizeof(DirHandle));
}
FidEq (afile, bfile)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/purge.c,v 1.1.1.4 2001/07/14 22:24:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/purge.c,v 1.1.1.5 2001/09/11 14:35:46 hartmans Exp $");
#include <stdio.h>
#ifdef AFS_NT40_ENV
/* next, obliterate the index and fflush (and fsync) it */
STREAM_SEEK(afile, *aoffset, 0); /* seek back to start of vnode index region */
- bzero(buf, sizeof(buf)); /* zero out our proto-vnode */
+ memset(buf, 0, sizeof(buf)); /* zero out our proto-vnode */
for(i=0;i<nscanned;i++) {
if (STREAM_WRITE(buf, vcp->diskSize, 1, afile) != 1)
goto fail;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/test/listVicepx.c,v 1.1.1.4 2001/07/14 22:25:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/test/listVicepx.c,v 1.1.1.5 2001/09/11 14:35:52 hartmans Exp $");
#include <rx/xdr.h>
#include <afs/afsint.h>
#define contentsDInode 0x08 /* list contents of dir inode */
#define volInfo 0x10 /* list info from vol header */
-extern char *rindex();
extern DirEnt *lookup();
extern char *getFileName(), *getDirName(), *printStack();
extern DirEnt* hash[];
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vnode.c,v 1.1.1.4 2001/07/14 22:25:01 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vnode.c,v 1.1.1.5 2001/09/11 14:35:47 hartmans Exp $");
#include <errno.h>
#include <stdio.h>
} else {
/* growing file - grow in a reasonable increment */
char *buf = (char *)malloc(16*1024);
- bzero(buf, 16*1024);
+ memset(buf, 0, 16*1024);
FDH_WRITE(fdP, buf, 16*1024);
free(buf);
}
#else /* AFS_PTHREAD_ENV */
LWP_CurrentProcess(&vnp->writer);
#endif /* AFS_PTHREAD_ENV */
- bzero(&vnp->disk, sizeof(vnp->disk));
+ memset(&vnp->disk, 0, sizeof(vnp->disk));
vnp->changed_newTime = 0; /* set this bit when vnode is updated */
vnp->changed_oldTime = 0; /* set this on CopyOnWrite. */
vnp->delete = 0;
if (vnp->delete) {
/* No longer any directory entries for this vnode. Free the Vnode */
- bzero(&vnp->disk, sizeof (vnp->disk));
+ memset(&vnp->disk, 0, sizeof (vnp->disk));
mlkLastDelete = vnp->vnodeNumber;
/* delete flag turned off further down */
VNLog(202, 2, vnp->vnodeNumber, (afs_int32) vnp);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vol-info.c,v 1.1.1.5 2001/07/14 22:25:02 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vol-info.c,v 1.1.1.6 2001/09/11 14:35:47 hartmans Exp $");
#include <ctype.h>
#include <errno.h>
if (dsizeOnly && !saveinodes)
printf("Volume-Id\t Volsize Auxsize Inodesize AVolsize SizeDiff (VolName)\n");
while (dp = readdir(dirp)) {
- p = (char *)rindex(dp->d_name, '.');
+ p = (char *)strrchr(dp->d_name, '.');
if (p != NULL && strcmp(p, VHDREXT) == 0) {
HandleVolume(partP, dp->d_name);
Totvolsize += totvolsize;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vol-salvage.c,v 1.1.1.6 2001/07/14 22:25:01 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vol-salvage.c,v 1.1.1.7 2001/09/11 14:35:48 hartmans Exp $");
#include <stdlib.h>
#include <stdio.h>
Log("Can't salvage '%s'. Not enough memory\n", partP->name);
return;
}
- bzero(thisjob, sizeof(struct job));
+ memset(thisjob, 0, sizeof(struct job));
thisjob->partP = partP;
thisjob->jobnumb = jobcount;
jobcount++;
if (deleteMe)
*deleteMe = 0;
- bzero(&tempHeader, sizeof(tempHeader));
+ memset(&tempHeader, 0, sizeof(tempHeader));
tempHeader.stamp.magic = VOLUMEHEADERMAGIC;
tempHeader.stamp.version = VOLUMEHEADERVERSION;
tempHeader.id = isp->volumeId;
isp->volSummary->header.volumeAcl = 0;
isp->volSummary->header.volumeMountTable = 0;
- if (bcmp(&isp->volSummary->header, &tempHeader, sizeof(struct VolumeHeader))) {
+ if (memcmp(&isp->volSummary->header, &tempHeader, sizeof(struct VolumeHeader))) {
/* We often remove the name before calling us, so we make a fake one up */
if (isp->volSummary->fileName) {
strcpy(name, isp->volSummary->fileName);
}
}
if (headerFd) {
- bcopy(&tempHeader,&isp->volSummary->header,sizeof(struct VolumeHeader));
+ memcpy(&isp->volSummary->header, &tempHeader, sizeof(struct VolumeHeader));
if (Testing) {
if (!Showmode) Log("It would have written a new header file for volume %u\n", isp->volumeId);
} else {
/* The following code should be moved into vutil.c */
if (sp->inodeType == VI_VOLINFO) {
struct timeval tp;
- bzero(&header.volumeInfo, sizeof (header.volumeInfo));
+ memset(&header.volumeInfo, 0, sizeof (header.volumeInfo));
header.volumeInfo.stamp = sp->stamp;
header.volumeInfo.id = isp->volumeId;
header.volumeInfo.parentId = isp->RWvolumeId;
if (VNDISK_GET_INO(vnode) == 0) {
if (RW) {
/* Log("### DEBUG ### Deleted Vnode with 0 inode (vnode %d)\n", vnodeNumber); */
- bzero(vnode, vcp->diskSize);
+ memset(vnode, 0, vcp->diskSize);
vnodeChanged = 1;
}
}
if (vcp->magic != vnode->vnodeMagic) {
/* bad magic #, probably partially created vnode */
Log("Partially allocated vnode %d deleted.\n", vnodeNumber);
- bzero(vnode, vcp->diskSize);
+ memset(vnode, 0, vcp->diskSize);
vnodeChanged = 1;
goto vnodeDone;
}
} else {
if (!Showmode) Log("Vnode %d (unique %d): bad directory vnode (no inode number listed); vnode deleted, vnode mod time=%s", vnodeNumber, vnode->uniquifier, ctime((time_t *)&(vnode->serverModifyTime)));
}
- bzero(vnode, vcp->diskSize);
+ memset(vnode, 0, vcp->diskSize);
vnodeChanged = 1;
} else {
/* Should not reach here becuase we checked for
assert(fdP != NULL);
size = FDH_SIZE(fdP);
assert(size != -1);
- bzero(buf, 1024);
+ memset(buf, 0, 1024);
if (size > 1024) size = 1024;
code = FDH_READ(fdP, buf, size);
assert(code == size);
/* Remember rootdir DirSummary _after_ it has been judged */
if (dir.vnodeNumber == 1 && dir.unique == 1) {
- bcopy(&dir, rootdir, sizeof(struct DirSummary));
+ memcpy(rootdir, &dir, sizeof(struct DirSummary));
*rootdirfound = 1;
}
code = IH_DEC(alinkH, VNDISK_GET_INO(&vnode), vid);
assert(code == 0);
}
- bzero(&vnode, sizeof(vnode));
+ memset(&vnode, 0, sizeof(vnode));
}
} else if (vnp->count) {
if (!Showmode) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/volume.c,v 1.1.1.8 2001/07/14 22:25:02 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/volume.c,v 1.1.1.9 2001/09/11 14:35:50 hartmans Exp $");
#include <rx/xdr.h>
#include <afs/afsint.h>
void VolumeHeaderToDisk(VolumeDiskHeader_t *dh, VolumeHeader_t *h)
{
- bzero((char*)dh, sizeof(VolumeDiskHeader_t));
+ memset((char*)dh, 0, sizeof(VolumeDiskHeader_t));
dh->stamp = h->stamp;
dh->id = h->id;
dh->parent = h->parent;
*/
void DiskToVolumeHeader(VolumeHeader_t *h, VolumeDiskHeader_t *dh)
{
- bzero((char*)h, sizeof(VolumeHeader_t));
+ memset((char*)h, 0, sizeof(VolumeHeader_t));
h->stamp = dh->stamp;
h->id = dh->id;
h->parent = dh->parent;
* area and mark it as initialized.
*/
if (! (V_stat_initialized(vp))) {
- bzero((char *)(V_stat_area(vp)), VOL_STATS_BYTES);
+ memset((char *)(V_stat_area(vp)), 0, VOL_STATS_BYTES);
V_stat_initialized(vp) = 1;
}
#endif /* TRANSARC_VOL_STATS */
assert(bp != NULL);
index->bitmap = bp;
bp += index->bitmapSize;
- bzero(bp, VOLUME_BITMAP_GROWSIZE);
+ memset(bp, 0, VOLUME_BITMAP_GROWSIZE);
index->bitmapOffset = index->bitmapSize;
index->bitmapSize += VOLUME_BITMAP_GROWSIZE;
*bp = 1;
* All we need to do is bzero the entire VOL_STATS_BYTES of
* the detailed volume statistics area.
*/
- bzero((char *)(V_stat_area(vp)), VOL_STATS_BYTES);
+ memset((char *)(V_stat_area(vp)), 0, VOL_STATS_BYTES);
#endif /* TRANSARC_VOL_STATS */
} /*It's been more than a day of collection*/
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vutil.c,v 1.1.1.5 2001/07/14 22:25:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vutil.c,v 1.1.1.6 2001/09/11 14:35:51 hartmans Exp $");
#include <stdio.h>
#include <sys/types.h>
*ec = 0;
- bzero(&vol, sizeof (vol));
+ memset(&vol, 0, sizeof (vol));
vol.id = volumeId;
vol.parentId = parentId;
vol.copyDate = time(0); /* The only date which really means when this
nearInode %= partition->f_files;
#endif
VLockPartition(partname);
- bzero(&tempHeader, sizeof (tempHeader));
+ memset(&tempHeader, 0, sizeof (tempHeader));
tempHeader.stamp.magic = VOLUMEHEADERMAGIC;
tempHeader.stamp.version = VOLUMEHEADERVERSION;
tempHeader.id = vol.id;
id = to->id;
parent = to->parentId;
copydate = to->copyDate;
- bcopy(from, to, sizeof(*from));
+ memcpy(to, from, sizeof(*from));
to->id = id;
to->parentId = parent;
to->copyDate = copydate;
ClearVolumeStats_r(vol)
register VolumeDiskData *vol;
{
- bzero(vol->weekUse, sizeof(vol->weekUse));
+ memset(vol->weekUse, 0, sizeof(vol->weekUse));
vol->dayUse = 0;
vol->dayUseDate = 0;
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/dumpstuff.c,v 1.1.1.5 2001/07/14 22:25:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/dumpstuff.c,v 1.1.1.6 2001/09/11 14:35:53 hartmans Exp $");
#include <sys/types.h>
#include <ctype.h>
{
register tag;
afs_uint32 trash;
- bzero(vol, sizeof(*vol));
+ memset(vol, 0, sizeof(*vol));
while ((tag = iod_getc(iodp)) > D_MAX && tag != EOF) {
switch (tag) {
case 'i':
/* Pad the rest of the buffer with zeros. Remember offset we started
* padding. Keep total tally of padding.
*/
- bzero(p+n, howMany-n);
+ memset(p+n, 0, howMany-n);
if (!pad)
offset = (status.st_size - nbytes) + n;
pad += (howMany-n);
char buf[SIZEOF_LARGEDISKVNODE], zero[SIZEOF_LARGEDISKVNODE];
register struct VnodeDiskObject *vnode = (struct VnodeDiskObject *) buf;
- bzero(zero, sizeof(zero)); /* zero out our proto-vnode */
+ memset(zero, 0, sizeof(zero)); /* zero out our proto-vnode */
fdP = IH_OPEN(vp->vnodeIndex[class].handle);
if (fdP == NULL)
return -1;
if (nVnodes > 0) {
Buf = (afs_int32 *) malloc(nVnodes * sizeof(afs_int32));
if (Buf == NULL) return 1;
- bzero((char *)Buf, nVnodes * sizeof(afs_int32));
+ memset((char *)Buf, 0, nVnodes * sizeof(afs_int32));
STREAM_SEEK(afile, offset = vcp->diskSize, 0);
while (1) {
code = STREAM_READ(vnode, vcp->diskSize, 1, afile);
V_pref(vp, nearInode);
while (tag == D_VNODE) {
int haveStuff = 0;
- bzero(buf, sizeof (buf));
+ memset(buf, 0, sizeof (buf));
if (!ReadInt32(iodp, (afs_uint32 *)&vnodeNumber))
break;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/physio.c,v 1.1.1.4 2001/07/14 22:25:08 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/physio.c,v 1.1.1.5 2001/09/11 14:35:54 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
afs_int32 device;
{
private SalvageCacheCheck = 1;
- bzero(dir, sizeof(DirHandle));
+ memset(dir, 0, sizeof(DirHandle));
dir->dirh_volume = volume;
dir->dirh_device = device;
{
IH_RELEASE(file->dirh_handle);
- bzero(file, sizeof(DirHandle));
+ memset(file, 0, sizeof(DirHandle));
}
FidZero (file)
DirHandle * file;
{
- bzero(file, sizeof(DirHandle));
+ memset(file, 0, sizeof(DirHandle));
}
FidEq (afile, bfile)
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/restorevol.c,v 1.1.1.4 2001/07/14 22:25:08 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/restorevol.c,v 1.1.1.5 2001/09/11 14:35:54 hartmans Exp $");
#include <afs/afsint.h>
#include <afs/nfs.h>
char tag, c;
afs_int32 magic;
-/* bzero(&dh, sizeof(dh)); */
+/* memset(&dh, 0, sizeof(dh)); */
magic = ntohl(readvalue(4));
dh->version = ntohl(readvalue(4));
int code, i, done, entries;
char tag, c;
-/* bzero(&vh, sizeof(vh)); */
+/* memset(&vh, 0, sizeof(vh)); */
done = 0;
while (!done) {
afs_int32 vnode;
afs_int32 mode=0;
-/* bzero(&vn, sizeof(vn)); */
+/* memset(&vn, 0, sizeof(vn)); */
vn.dataSize = 0;
vn.vnode = 0;
vn.parent = 0;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/volprocs.c,v 1.1.1.5 2001/07/14 22:25:09 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/volprocs.c,v 1.1.1.6 2001/09/11 14:35:55 hartmans Exp $");
#include <stdio.h>
#include <sys/types.h>
int code;
int length;
- bzero(vnode, SIZEOF_LARGEDISKVNODE);
+ memset(vnode, 0, SIZEOF_LARGEDISKVNODE);
V_pref(vp, nearInode);
inodeNumber = IH_CREATE(V_linkHandle(vp), V_device(vp),
int i, nconns, is_incremental;
if (results)
- bzero(results, sizeof(manyResults));
+ memset(results, 0, sizeof(manyResults));
if (!afsconf_SuperUser(tdir, acid, caller))
return VOLSERBAD_ACCESS;/*not a super user*/
partList.partId[j++] = i;
}
pEntries->partEntries_val = (afs_int32 *) malloc(j * sizeof(int));
- bcopy((char *)&partList, (char *)pEntries->partEntries_val, j * sizeof(int));
+ memcpy((char *)pEntries->partEntries_val, (char *)&partList, j * sizeof(int));
pEntries->partEntries_len = j;
#else
code = stat("/",&rbuf); /*interested in buf->st_dev*/
}
}
pEntries->partEntries_val = (afs_int32 *) malloc(j * sizeof(int));
- bcopy((char *)&partList, (char *)pEntries->partEntries_val, j * sizeof(int));
+ memcpy((char *)pEntries->partEntries_val, (char *)&partList, j * sizeof(int));
pEntries->partEntries_len = j;
#endif
return 0;
/*
* Copy out the stat fields in a single operation.
*/
- bcopy((char *)&(volDiskDataP->stat_reads[0]),
- (char *)&(xInfoP->stat_reads[0]),
- numStatBytes);
+ memcpy((char *)&(xInfoP->stat_reads[0]), (char *)&(volDiskDataP->stat_reads[0]), numStatBytes);
/*
* We're done copying. Detach the volume and iterate (at this
/*
* Copy out the stat fields in a single operation.
*/
- bcopy((char *)&(volDiskDataP->stat_reads[0]),
- (char *)&(xInfoP->stat_reads[0]),
- numStatBytes);
+ memcpy((char *)&(xInfoP->stat_reads[0]), (char *)&(volDiskDataP->stat_reads[0]), numStatBytes);
/*
* We're done copying. Detach the volume and iterate.
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/voltrans.c,v 1.1.1.4 2001/07/14 22:25:10 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/voltrans.c,v 1.1.1.5 2001/09/11 14:35:56 hartmans Exp $");
#ifdef AFS_NT40_ENV
#include <afs/afsutil.h>
}
}
tt = (struct volser_trans *) malloc(sizeof(struct volser_trans));
- bzero(tt, sizeof(struct volser_trans));
+ memset(tt, 0, sizeof(struct volser_trans));
tt->volid = avol;
tt->partition = apart;
tt->next = allTrans;
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vos.c,v 1.1.1.5 2001/07/14 22:25:10 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vos.c,v 1.1.1.6 2001/09/11 14:35:57 hartmans Exp $");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
static void qInit(ahead)
struct tqHead *ahead;
{
- bzero((char *)ahead, sizeof(struct tqHead));
+ memset((char *)ahead, 0, sizeof(struct tqHead));
return;
}
} else {
th = gethostbyname(aname);
if (!th) return 0;
- bcopy(th->h_addr, &addr, sizeof(addr));
+ memcpy(&addr, th->h_addr, sizeof(addr));
}
if (addr == htonl(0x7f000001)) { /* local host */
if (code) return 0;
th = gethostbyname(hostname); /* returns host byte order */
if (!th) return 0;
- bcopy(th->h_addr, &addr, sizeof(addr));
+ memcpy(&addr, th->h_addr, sizeof(addr));
}
return (addr);
} /*Default listing*/
} /*XDisplayFormat*/
+#ifdef FULL_LISTVOL_SWITCH
+static void DisplayFormat2(server, partition, pntr)
+ long server, partition;
+ volintInfo *pntr;
+{
+ static long server_cache = -1, partition_cache = -1;
+ static char hostname[256],
+ address[32],
+ pname[16];
+
+ if (server != server_cache) {
+ struct in_addr s;
+
+ s.s_addr = server;
+ strcpy(hostname, hostutil_GetNameByINet(server));
+ strcpy(address, inet_ntoa(s));
+ server_cache = server;
+ }
+ if (partition != partition_cache) {
+ MapPartIdIntoName(partition, pname);
+ partition_cache = partition;
+ }
+ fprintf(STDOUT, "name\t\t%s\n", pntr->name);
+ fprintf(STDOUT, "id\t\t%lu\n", pntr->volid);
+ fprintf(STDOUT, "serv\t\t%s\t%s\n", address, hostname);
+ fprintf(STDOUT, "part\t\t%s\n", pname);
+ switch (pntr->status) {
+ case VOK:
+ fprintf(STDOUT, "status\t\tOK\n");
+ break;
+ case VBUSY:
+ fprintf(STDOUT, "status\t\tBUSY\n");
+ return;
+ default:
+ fprintf(STDOUT, "status\t\tUNATTACHABLE\n");
+ return;
+ }
+ fprintf(STDOUT, "backupID\t%lu\n", pntr->backupID);
+ fprintf(STDOUT, "parentID\t%lu\n", pntr->parentID);
+ fprintf(STDOUT, "cloneID\t\t%lu\n", pntr->cloneID);
+ fprintf(STDOUT, "inUse\t\t%s\n", pntr->inUse ? "Y" : "N");
+ fprintf(STDOUT, "needsSalvaged\t%s\n", pntr->needsSalvaged ? "Y" : "N");
+ /* 0xD3 is from afs/volume.h since I had trouble including the file */
+ fprintf(STDOUT, "destroyMe\t%s\n", pntr->destroyMe == 0xD3 ? "Y" : "N");
+ switch (pntr->type) {
+ case 0:
+ fprintf(STDOUT, "type\t\tRW\n");
+ break;
+ case 1:
+ fprintf(STDOUT, "type\t\tRO\n");
+ break;
+ case 2:
+ fprintf(STDOUT, "type\t\tBK\n");
+ break;
+ default:
+ fprintf(STDOUT, "type\t\t?\n");
+ break;
+ }
+ fprintf(STDOUT, "creationDate\t%-9lu\t%s", pntr->creationDate, ctime(&pntr->creationDate));
+ fprintf(STDOUT, "accessDate\t%-9lu\t%s", pntr->accessDate, ctime(&pntr->accessDate));
+ fprintf(STDOUT, "updateDate\t%-9lu\t%s", pntr->updateDate, ctime(&pntr->updateDate));
+ fprintf(STDOUT, "backupDate\t%-9lu\t%s", pntr->backupDate, ctime(&pntr->backupDate));
+ fprintf(STDOUT, "copyDate\t%-9lu\t%s", pntr->copyDate, ctime(&pntr->copyDate));
+ fprintf(STDOUT, "flags\t\t%#lx\t(Optional)\n", pntr->flags);
+ fprintf(STDOUT, "diskused\t%u\n", pntr->size);
+ fprintf(STDOUT, "maxquota\t%u\n", pntr->maxquota);
+ fprintf(STDOUT, "minquota\t%lu\t(Optional)\n", pntr->spare0);
+ fprintf(STDOUT, "filecount\t%u\n", pntr->filecount);
+ fprintf(STDOUT, "dayUse\t\t%u\n", pntr->dayUse);
+ fprintf(STDOUT, "weekUse\t\t%lu\t(Optional)\n", pntr->spare1);
+ fprintf(STDOUT, "spare2\t\t%lu\t(Optional)\n", pntr->spare2);
+ fprintf(STDOUT, "spare3\t\t%lu\t(Optional)\n", pntr->spare3);
+ return;
+}
+
+static void DisplayVolumes2(server, partition, pntr, count)
+ volintInfo *pntr;
+ long server, partition, count;
+{
+ long i;
+
+ for (i = 0; i < count; i++) {
+ fprintf(STDOUT, "BEGIN_OF_ENTRY\n");
+ DisplayFormat2(server, partition, pntr);
+ fprintf(STDOUT, "END_OF_ENTRY\n\n");
+ pntr++;
+ }
+ return;
+}
+#endif /* FULL_LISTVOL_SWITCH */
+
static void DisplayVolumes(server,part,pntr,count,longlist,fast,quiet)
afs_int32 server,part;
volintInfo *pntr;
if (wantExtendedInfo)
XVolumeStats(xInfoP, &entry, aserver, apart, voltype);
else
+#ifdef FULL_LISTVOL_SWITCH
+ if (as->parms[2].items) {
+ DisplayFormat2(aserver, apart, pntr);
+ EnumerateEntry(&entry);
+ } else
+#endif /* FULL_LISTVOL_SWITCH */
VolumeStats(pntr, &entry, aserver, apart, voltype);
if ((voltype == BACKVOL) && !(entry.flags & BACK_EXISTS)) {
fprintf(STDOUT,"The partitions on the server are:\n");
for(i = 0 ; i < cnt ; i++){
if(dummyPartList.partFlags[i] & PARTVALID){
- bzero(pname,sizeof(pname));
+ memset(pname, 0, sizeof(pname));
MapPartIdIntoName(dummyPartList.partId[i],pname);
fprintf(STDOUT," %10s ",pname);
total++;
xInfoP = (volintXInfo *)0;
}
else {
+#ifdef FULL_LISTVOL_SWITCH
+ if (as->parms[6].items)
+ DisplayVolumes2(aserver, dummyPartList.partId[i], oldpntr,
+ count);
+ else
+#endif /* FULL_LISTVOL_SWITCH */
DisplayVolumes(aserver,
dummyPartList.partId[i],
oldpntr,
afs_int32 pname, code; /* part name */
char part[10];
int flags = 0;
- char *volname;
+ char *volname = 0;
tserver = 0;
if (as->parms[0].items) {
}
/* Zero out search attributes */
- bzero(&attributes,sizeof(struct VldbListByAttributes));
+ memset(&attributes, 0, sizeof(struct VldbListByAttributes));
if (as->parms[1].items) { /* -prefix */
strncpy(prefix, as->parms[1].items->data, VOLSER_MAXVOLNAME);
fflush(STDOUT);
/* Get all the VLDB entries on a server and/or partition */
- bzero(&arrayEntries, sizeof(arrayEntries));
+ memset(&arrayEntries, 0, sizeof(arrayEntries));
vcode = VLDB_ListAttributes(&attributes, &nentries, &arrayEntries);
if (vcode) {
fprintf(STDERR,"Could not access the VLDB for attributes\n");
}
for (thisindex = 0; (thisindex != -1); thisindex = nextindex) {
- bzero(&arrayEntries, sizeof(arrayEntries));
+ memset(&arrayEntries, 0, sizeof(arrayEntries));
centries = 0;
nextindex = -1;
tarray = ttarray;
/* Copy them in */
- bcopy((char *)arrayEntries.nbulkentries_val,
- ((char *)tarray)+tarraysize, parraysize);
+ memcpy(((char *)tarray)+tarraysize, (char *)arrayEntries.nbulkentries_val, parraysize);
tarraysize += parraysize;
}
}
char *ccode;
int match;
- bzero(&attributes,sizeof(struct VldbListByAttributes));
+ memset(&attributes, 0, sizeof(struct VldbListByAttributes));
attributes.Mask = 0;
seenprefix = (as->parms[0].items ? 1 : 0);
}
}
- bzero(&arrayEntries, sizeof(arrayEntries)); /* initialize to hint the stub to alloc space */
+ memset(&arrayEntries, 0, sizeof(arrayEntries)); /* initialize to hint the stub to alloc space */
vcode = VLDB_ListAttributes(&attributes, &nentries, &arrayEntries);
if (vcode) {
fprintf(STDERR,"Could not access the VLDB for attributes\n");
}
attributes.flag = VLOP_ALLOPERS;
attributes.Mask |= VLLIST_FLAG;
- bzero(&arrayEntries, sizeof(arrayEntries)); /*initialize to hint the stub to alloc space */
+ memset(&arrayEntries, 0, sizeof(arrayEntries)); /*initialize to hint the stub to alloc space */
vcode = VLDB_ListAttributes(&attributes, &nentries, &arrayEntries);
if(vcode) {
fprintf(STDERR,"Could not access the VLDB for attributes\n");
cmd_AddParm(ts, "-quiet", CMD_FLAG, CMD_OPTIONAL, "generate minimal information");
cmd_AddParm(ts, "-extended", CMD_FLAG, CMD_OPTIONAL,
"list extended volume fields");
+#ifdef FULL_LISTVOL_SWITCH
+ cmd_AddParm(ts, "-format", CMD_FLAG, CMD_OPTIONAL,
+ "machine readable format");
+#endif /* FULL_LISTVOL_SWITCH */
COMMONPARMS;
ts = cmd_CreateSyntax("syncvldb", SyncVldb, 0, "synchronize VLDB with server");
cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
cmd_AddParm(ts, "-extended", CMD_FLAG, CMD_OPTIONAL,
"list extended volume fields");
+#ifdef FULL_LISTVOL_SWITCH
+ cmd_AddParm(ts, "-format", CMD_FLAG, CMD_OPTIONAL,
+ "machine readable format");
+#endif /* FULL_LISTVOL_SWITCH */
COMMONPARMS;
cmd_CreateAlias (ts, "volinfo");
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vsprocs.c,v 1.1.1.5 2001/07/14 22:25:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vsprocs.c,v 1.1.1.6 2001/09/11 14:35:57 hartmans Exp $");
#include <stdio.h>
#include <sys/types.h>
tid = 0;
aconn = (struct rx_connection *)0;
error = 0;
- bzero (&tstatus, sizeof(struct volintInfo));
+ memset(&tstatus, 0, sizeof(struct volintInfo));
tstatus.dayUse = -1;
tstatus.maxquota = aquota;
int releasecount = 0;
struct volser_status volstatus;
- bzero((char *)remembertime, sizeof(remembertime));
- bzero((char *)&results, sizeof(results));
+ memset((char *)remembertime, 0, sizeof(remembertime));
+ memset((char *)&results, 0, sizeof(results));
vcode = ubik_Call(VL_SetLock, cstruct, 0, afromvol, RWVOL, VLOP_RELEASE);
if (vcode != VL_RERELEASE)
strcpy(vname, entry.name);
strcat(vname, ".readonly");
- bzero(&cookie,sizeof(cookie));
+ memset(&cookie, 0, sizeof(cookie));
strncpy(cookie.name, vname, VOLSER_OLDMAXVOLNAME);
cookie.type = ROVOL;
cookie.parent = entry.volumeId[RWVOL];
if ( !replicas || !times || !! !results.manyResults_val || !toconns )
ONERROR(ENOMEM, 0, "Failed to create transaction on the release clone\n");
- bzero (replicas, (sizeof(struct replica)*nservers+1));
- bzero (times, (sizeof(struct release)*nservers+1));
- bzero (toconns, (sizeof(struct rx_connection *)*nservers+1));
- bzero (results.manyResults_val, (sizeof(afs_int32)*nservers+1));
+ memset(replicas, 0, (sizeof(struct replica)*nservers+1));
+ memset(times, 0, (sizeof(struct release)*nservers+1));
+ memset(toconns, 0, (sizeof(struct rx_connection *)*nservers+1));
+ memset(results.manyResults_val, 0, (sizeof(afs_int32)*nservers+1));
/* Create a transaction on the cloned volume */
code = AFSVolTransCreate(fromconn, cloneVolId, afrompart, ITBusy, &fromtid);
char apartName[10];
- bzero(&cookie,sizeof(cookie));
+ memset(&cookie, 0, sizeof(cookie));
islocked = 0;
success = 0;
error = 0;
ERROR_EXIT(code);
}
- bzero(&entry, sizeof(entry));
+ memset(&entry, 0, sizeof(entry));
vsu_ExtractName(entry.name, volumeinfo->name); /* Store name of RW */
createentry = 1;
/* While we need to collect more VLDB entries */
for (si=0; si != -1; si=nsi) {
- bzero(&arrayEntries, sizeof(arrayEntries));
+ memset(&arrayEntries, 0, sizeof(arrayEntries));
/* Collect set of VLDB entries */
code = VLDB_ListAttributesN2(&attributes, 0, si,
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vsutils.c,v 1.1.1.6 2001/07/14 22:25:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vsutils.c,v 1.1.1.7 2001/09/11 14:35:58 hartmans Exp $");
#include <afs/stds.h>
#ifdef AFS_NT40_ENV
{
register int i;
- bzero(nentryp, sizeof(struct nvldbentry));
+ memset(nentryp, 0, sizeof(struct nvldbentry));
strncpy(nentryp->name, oentryp->name, sizeof(nentryp->name));
for (i=0; i < oentryp->nServers; i++) {
nentryp->serverNumber[i] = oentryp->serverNumber[i];
{
register int i;
- bzero(oentryp, sizeof(struct vldbentry));
+ memset(oentryp, 0, sizeof(struct vldbentry));
strncpy(oentryp->name, nentryp->name, sizeof(oentryp->name));
if (nentryp->nServers > OMAXNSERVERS) {
/*
if (newvlserver == 1) {
tryold:
- bzero(&arrayEntries, sizeof(arrayEntries)); /*initialize to hint the stub to alloc space */
+ memset(&arrayEntries, 0, sizeof(arrayEntries)); /*initialize to hint the stub to alloc space */
code = ubik_Call(VL_ListAttributes, cstruct, 0, attrp, entriesp, &arrayEntries);
if (!code) {
blkentriesp->nbulkentries_val = (nvldbentry *)malloc(*entriesp * sizeof(struct nvldbentry));
return 0;
}
- bzero(&attrs, sizeof(attrs));
+ memset(&attrs, 0, sizeof(attrs));
attrs.Mask = VLADDR_IPADDR;
attrs.ipaddr = serv1;
- bzero(&addrs, sizeof(addrs));
- bzero(&uuid, sizeof(uuid));
+ memset(&addrs, 0, sizeof(addrs));
+ memset(&uuid, 0, sizeof(uuid));
code = ubik_Call(VL_GetAddrsU, cstruct, 0, &attrs, &uuid, &unique, &nentries, &addrs);
if (vlserverv4 == -1) {
if (code == RXGEN_OPCODE) {
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/xstat/xstat_cm.c,v 1.1.1.4 2001/07/14 22:25:16 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/xstat/xstat_cm.c,v 1.1.1.5 2001/09/11 14:36:03 hartmans Exp $");
#include "xstat_cm.h" /*Interface for this module*/
#include <lwp.h> /*Lightweight process package*/
xstat_cm_Results.collectionNumber = *currCollIDP;
xstat_cm_Results.data.AFSCB_CollData_len =
AFSCB_MAX_XSTAT_LONGS;
- bzero(xstat_cm_Results.data.AFSCB_CollData_val,
- AFSCB_MAX_XSTAT_LONGS * 4);
+ memset(xstat_cm_Results.data.AFSCB_CollData_val, 0, AFSCB_MAX_XSTAT_LONGS * 4);
xstat_cm_Results.connP = curr_conn;
xstat_cm_numCollections = a_numCollections;
collIDBytes = xstat_cm_numCollections * sizeof(afs_int32);
xstat_cm_collIDP = (afs_int32 *)(malloc(collIDBytes));
- bcopy(a_collIDP, xstat_cm_collIDP, collIDBytes);
+ memcpy(xstat_cm_collIDP, a_collIDP, collIDBytes);
if (xstat_cm_debug) {
printf("[%s] Asking for %d collection(s): ", rn, xstat_cm_numCollections);
for (curr_srv = 0; curr_srv < xstat_cm_numCollections; curr_srv++)
(a_socketArray + curr_srv)->sin_addr.s_addr,
(a_socketArray + curr_srv)->sin_port);
}
- bcopy(a_socketArray + curr_srv,
- &(curr_conn->skt),
- sizeof(struct sockaddr_in));
+ memcpy(&(curr_conn->skt), a_socketArray + curr_srv, sizeof(struct sockaddr_in));
hostNameFound =
hostutil_GetNameByINet(curr_conn->skt.sin_addr.s_addr);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/xstat/xstat_cm_test.c,v 1.1.1.4 2001/07/14 22:25:16 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/xstat/xstat_cm_test.c,v 1.1.1.5 2001/09/11 14:36:04 hartmans Exp $");
#include "xstat_cm.h" /*Interface for xstat_cm module*/
#include <cmd.h> /*Command line interpreter*/
rn, curr_item->data);
exit(-1);
}
- bcopy(he->h_addr, &(CMSktArray[currCM].sin_addr.s_addr), 4);
+ memcpy(&(CMSktArray[currCM].sin_addr.s_addr), he->h_addr, 4);
/*
* Move to the next CM name.
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/xstat/xstat_fs.c,v 1.1.1.4 2001/07/14 22:25:17 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/xstat/xstat_fs.c,v 1.1.1.5 2001/09/11 14:36:05 hartmans Exp $");
#include "xstat_fs.h" /*Interface for this module*/
#include <lwp.h> /*Lightweight process package*/
rn, *currCollIDP);
xstat_fs_Results.collectionNumber = *currCollIDP;
xstat_fs_Results.data.AFS_CollData_len = AFS_MAX_XSTAT_LONGS;
- bzero(xstat_fs_Results.data.AFS_CollData_val,
- AFS_MAX_XSTAT_LONGS * 4);
+ memset(xstat_fs_Results.data.AFS_CollData_val, 0, AFS_MAX_XSTAT_LONGS * 4);
xstat_fs_Results.connP = curr_conn;
xstat_fs_numCollections = a_numCollections;
collIDBytes = xstat_fs_numCollections * sizeof(afs_int32);
xstat_fs_collIDP = (afs_int32 *)(malloc(collIDBytes));
- bcopy(a_collIDP, xstat_fs_collIDP, collIDBytes);
+ memcpy(xstat_fs_collIDP, a_collIDP, collIDBytes);
if (xstat_fs_debug) {
printf("[%s] Asking for %d collection(s): ", rn, xstat_fs_numCollections);
for (curr_srv = 0; curr_srv < xstat_fs_numCollections; curr_srv++)
(a_socketArray + curr_srv)->sin_addr.s_addr,
(a_socketArray + curr_srv)->sin_port);
}
- bcopy(a_socketArray + curr_srv,
- &(curr_conn->skt),
- sizeof(struct sockaddr_in));
+ memcpy(&(curr_conn->skt), a_socketArray + curr_srv, sizeof(struct sockaddr_in));
hostNameFound =
hostutil_GetNameByINet(curr_conn->skt.sin_addr.s_addr);
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/xstat/xstat_fs_test.c,v 1.1.1.4 2001/07/14 22:25:16 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/xstat/xstat_fs_test.c,v 1.1.1.5 2001/09/11 14:36:05 hartmans Exp $");
#include "xstat_fs.h" /*Interface for xstat_fs module*/
#include <cmd.h> /*Command line interpreter*/
rn, curr_item->data);
exit(-1);
}
- bcopy(he->h_addr, &(FSSktArray[currFS].sin_addr.s_addr), 4);
+ memcpy(&(FSSktArray[currFS].sin_addr.s_addr), he->h_addr, 4);
/*
* Move to the next File Server name.