]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
This commit was generated by cvs2svn to compensate for changes in r320,
authorSam Hartman <hartmans@debian.org>
Tue, 11 Sep 2001 14:36:05 +0000 (14:36 +0000)
committerSam Hartman <hartmans@debian.org>
Tue, 11 Sep 2001 14:36:05 +0000 (14:36 +0000)
which included commits to RCS files with non-trunk default branches.

448 files changed:
NEWS
README
acconfig.h
regen.sh
src/Makefile.djgpp
src/NTMake9x
src/NTMakefile
src/README-NT
src/README-WIN9X
src/WINNT/afs_setup_utils/NTMakefile
src/WINNT/afs_setup_utils/afs_setup_utils.cpp
src/WINNT/afsclass/NTMakefile
src/WINNT/afsclass/afsclassfn.cpp
src/WINNT/afsd/cm_callback.c
src/WINNT/afsd/cm_utils.c
src/WINNT/afsd/fs.c
src/WINNT/afsd/krb.h
src/WINNT/afsd/smb_ioctl.c
src/WINNT/install/InstallShield5/BuildSetup.bat
src/WINNT/install/InstallShield5/CreateGeneratedFiles.bat
src/WINNT/install/InstallShield5/CreateISDirTree.bat
src/WINNT/install/InstallShield5/Default.shl
src/WINNT/install/InstallShield5/GatherFiles.bat
src/WINNT/install/InstallShield5/GenDefault.mda.bat
src/WINNT/install/InstallShield5/GenFileGroups.bat
src/WINNT/install/InstallShield5/GenIS5.ipr.bat
src/WINNT/install/InstallShield5/HowToSetTheVersion.txt
src/WINNT/install/InstallShield5/NTMakefile
src/WINNT/install/InstallShield5/ScatterFiles.bat
src/WINNT/install/InstallShield5/setup.rul
src/WINNT/install/Win9x/NTMakeFile
src/WINNT/pthread/NTMakefile
src/WINNT/win9xpanel/CAfs.cpp
src/WINNT/win9xpanel/Change.cpp
src/WINNT/win9xpanel/NTMakefile
src/WINNT/win9xpanel/WinAfsLoad.cpp
src/WINNT/win9xpanel/WinAfsLoad.h
src/WINNT/win9xpanel/WinAfsLoad.rc
src/WINNT/win9xpanel/WinAfsLoadDlg.cpp
src/WINNT/win9xpanel/WinAfsLoadDlg.h
src/WINNT/win9xpanel/cafs.h
src/afs/AIX/osi_file.c
src/afs/AIX/osi_timeout.c
src/afs/AIX/osi_vnodeops.c
src/afs/DARWIN/osi_file.c
src/afs/DARWIN/osi_module.c
src/afs/DARWIN/osi_vfsops.c
src/afs/DARWIN/osi_vnodeops.c
src/afs/DUX/osi_file.c
src/afs/DUX/osi_vfsops.c
src/afs/FBSD/osi_file.c
src/afs/FBSD/osi_vfsops.c
src/afs/HPUX/osi_file.c
src/afs/HPUX/osi_vnodeops.c
src/afs/IRIX/osi_file.c
src/afs/IRIX/osi_groups.c
src/afs/IRIX/osi_inode.c
src/afs/IRIX/osi_vnodeops.c
src/afs/LINUX/osi_alloc.c
src/afs/LINUX/osi_groups.c
src/afs/LINUX/osi_vfs.h
src/afs/LINUX/osi_vfsops.c
src/afs/SOLARIS/osi_file.c
src/afs/SOLARIS/osi_vnodeops.c
src/afs/UKERNEL/afs_usrops.c
src/afs/VNOPS/afs_vnop_fid.c
src/afs/VNOPS/afs_vnop_strategy.c
src/afs/VNOPS/afs_vnop_write.c
src/afs/afs_buffer.c
src/afs/afs_callback.c
src/afs/afs_cbqueue.c
src/afs/afs_cell.c
src/afs/afs_conn.c
src/afs/afs_dcache.c
src/afs/afs_exporter.c
src/afs/afs_init.c
src/afs/afs_memcache.c
src/afs/afs_nfsclnt.c
src/afs/afs_osi.c
src/afs/afs_osi_uio.c
src/afs/afs_osi_vget.c
src/afs/afs_osidnlc.c
src/afs/afs_segments.c
src/afs/afs_server.c
src/afs/afs_stat.c
src/afs/afs_user.c
src/afs/afs_vcache.c
src/afs/afs_volume.c
src/afsd/afs.rc.darwin
src/afsd/afsd.c
src/afsmonitor/afsmonitor.c
src/afsweb/apache_afs_cache.c
src/afsweb/apache_afs_client.c
src/afsweb/apache_afs_utils.c
src/afsweb/apache_includes/1.2/conf.h
src/afsweb/apache_includes/1.3.1/ap_config.h
src/afsweb/apache_includes/1.3.6/ap_config.h
src/afsweb/apache_includes/conf.h
src/afsweb/weblog.c
src/audit/audit.c
src/auth/cellconfig.c
src/auth/ktc.c
src/auth/setkey.c
src/auth/test/testcellconf.c
src/auth/writeconfig.c
src/bozo/bnode.c
src/bozo/bos.c
src/bozo/bosoprocs.c
src/bozo/bosserver.c
src/bozo/cronbnodeops.c
src/bozo/ezbnodeops.c
src/bozo/fsbnodeops.c
src/bu_utils/fms.c
src/bucoord/bc_status.c
src/bucoord/commands.c
src/bucoord/config.c
src/bucoord/dsstub.c
src/bucoord/dsvs.c
src/bucoord/dump.c
src/bucoord/dump_sched.c
src/bucoord/expire.c
src/bucoord/main.c
src/bucoord/restore.c
src/bucoord/status.c
src/bucoord/tape_hosts.c
src/bucoord/ttest.c
src/bucoord/ubik_db_if.c
src/bucoord/vol_sets.c
src/budb/database.c
src/budb/db_alloc.c
src/budb/db_dump.c
src/budb/db_hash.c
src/budb/db_text.c
src/budb/dbs_dump.c
src/budb/ol_verify.c
src/budb/procs.c
src/budb/server.c
src/budb/struct_ops.c
src/butc/dbentries.c
src/butc/dump.c
src/butc/list.c
src/butc/lwps.c
src/butc/recoverDb.c
src/butc/tcmain.c
src/butc/tcprocs.c
src/butc/tcudbprocs.c
src/butc/tdump.c
src/butc/test.c
src/butm/butm_test.c
src/butm/file_tm.c
src/butm/test_ftm.c
src/config/Makefile.alpha_dux40.in
src/config/Makefile.alpha_dux50.in
src/config/Makefile.alpha_linux_22.in
src/config/Makefile.djgpp.common
src/config/Makefile.hp_ux102.in
src/config/Makefile.hp_ux110.in
src/config/Makefile.i386_djgpp
src/config/Makefile.i386_fbsd_42.in
src/config/Makefile.i386_linux24.in
src/config/Makefile.ppc_darwin_12.in
src/config/Makefile.ppc_darwin_13.in
src/config/Makefile.ppc_linux24.in
src/config/Makefile.rs_aix42.in
src/config/Makefile.s390_linux22.in
src/config/Makefile.s390_linux24.in
src/config/Makefile.sgi_62.in
src/config/Makefile.sgi_63.in
src/config/Makefile.sgi_64.in
src/config/Makefile.sgi_65.in
src/config/Makefile.sparc64_linux22.in
src/config/Makefile.sparc64_linux24.in
src/config/Makefile.sparc_linux22.in
src/config/Makefile.sun4x_55.in
src/config/Makefile.sun4x_56.in
src/config/Makefile.sun4x_57.in
src/config/Makefile.sun4x_58.in
src/config/Makefile.sunx86_54.in
src/config/Makefile.version-CML
src/config/Makefile.version-NOCML.in
src/config/NTMakefile
src/config/NTMakefile.i386_nt40
src/config/NTMakefile.i386_win95
src/config/NTVersioninfo.rc
src/config/afs_sysnames.h
src/config/param.i386_nt40.h
src/config/param.i386_win95.h
src/config/param.sun4x_55.h
src/config/param.sun4x_56.h
src/config/param.sun4x_57.h
src/config/param.sun4x_58.h
src/config/param.sun4x_58_usr.h
src/config/param.sunx86_54.h
src/config/stds.h
src/config/util_cr.c
src/dauth/dlog.c
src/des/NTMakefile
src/des/andrew-conf.h
src/des/cbc_encrypt.c
src/des/cksum.c
src/des/crypt.c
src/des/des.c
src/des/enc.c
src/des/misc.c
src/des/new_rnd_key.c
src/des/pcbc_encrypt.c
src/des/read_pssword.c
src/des/strng_to_key.c
src/des/weak_key.c
src/dir/buffer.c
src/dir/salvage.c
src/dir/test/dtest.c
src/export/cfgexport.c
src/export/symtab.c
src/fsprobe/fsprobe.c
src/fsprobe/fsprobe_test.c
src/ftpd43+/ftpcmd.y
src/ftpd43+/ftpd.c
src/ftpd43+/logwtmp.c
src/ftpd43+/popen.c
src/gtx/frame.c
src/gtx/keymap.c
src/gtx/textcb.c
src/inetd/inetd.c
src/inetd/setenv.c
src/inetd/ta-rauth.c
src/kauth/admin_tools.c
src/kauth/authclient.c
src/kauth/client.c
src/kauth/kadatabase.c
src/kauth/kaprocs.c
src/kauth/kaserver.c
src/kauth/kautils.c
src/kauth/kdb.c
src/kauth/kkids.c
src/kauth/klog.c
src/kauth/klogin.c
src/kauth/knfs.c
src/kauth/kpasswd.c
src/kauth/krb_udp.c
src/kauth/manyklog.c
src/kauth/read_passwd.c
src/kauth/rebuild.c
src/kauth/test/multiklog.c
src/kauth/test/test_badtix.c
src/kauth/test/test_getticket.c
src/kauth/test/test_interim_ktc.c
src/kauth/test/test_rxkad_free.c
src/kauth/user.c
src/kauth/user_nt.c
src/libacl/aclprocs.c
src/libadmin/bos/afs_bosAdmin.c
src/libadmin/client/afs_clientAdmin.c
src/libadmin/test/bos.c
src/libadmin/vos/afs_vosAdmin.c
src/libadmin/vos/lockprocs.c
src/libadmin/vos/vosutils.c
src/libadmin/vos/vsprocs.c
src/libafs/MakefileProto.AIX.in
src/libafs/MakefileProto.DARWIN.in
src/libafs/MakefileProto.DUX.in
src/libafs/MakefileProto.FBSD.in
src/libafs/MakefileProto.HPUX.in
src/libafs/MakefileProto.IRIX.in
src/libafs/MakefileProto.SOLARIS.in
src/libuafs/Makefile.common
src/log/kseal.c
src/log/test/testlog.c
src/login/login.c
src/login/setenv.c
src/login/util_logout.c
src/lwp/iomgr.c
src/lwp/test/selsubs.c
src/lwp/test/testlwp.c
src/lwp/threadname.c
src/lwp/waitkey.c
src/mpp/mpp.c
src/ntp/mkntpconf.c
src/ntp/ntp.c
src/ntp/ntp.h
src/ntp/ntp_adjust.c
src/ntp/ntpd.c
src/ntp/ntpdc.c
src/ntp/read_psti.c
src/ntp/runntp.c
src/ntp/test.c
src/package/check.c
src/package/conftree.c
src/pam/Makefile.in
src/pam/afs_auth.c
src/pam/afs_message.c
src/pam/afs_message.h
src/pam/afs_password.c
src/pam/afs_session.c
src/pam/afs_setcred.c
src/pam/afs_util.c
src/pam/afs_util.h
src/pam/test_pam.c
src/pinstall/install.c
src/ptserver/db_verify.c
src/ptserver/ptclient.c
src/ptserver/ptprocs.c
src/ptserver/ptuser.c
src/ptserver/ptutils.c
src/ptserver/readgroup.c
src/ptserver/readpwd.c
src/ptserver/testpt.c
src/ptserver/utils.c
src/rcp/rcp.c
src/rlogind/rexecd.c
src/rlogind/rlogind.c
src/rsh/rcmd.c
src/rsh/rlogin.c
src/rsh/rsh.c
src/rx/AIX/rx_knet.c
src/rx/DARWIN/rx_knet.c
src/rx/DUX/rx_knet.c
src/rx/FBSD/rx_knet.c
src/rx/HPUX/rx_knet.c
src/rx/IRIX/rx_knet.c
src/rx/SOLARIS/rx_knet.c
src/rx/bulk.example/bulk_client.c
src/rx/bulktest/bulk_client.c
src/rx/multi.example/sample_client.c
src/rx/rx.h
src/rx/rx_event.c
src/rx/rx_kcommon.c
src/rx/rx_misc.c
src/rx/rx_packet.h
src/rx/rx_rdwr.c
src/rx/rx_stream.c
src/rx/rx_stream.h
src/rx/rx_trace.c
src/rx/rx_user.c
src/rx/rxdebug.c
src/rx/simple.example/sample_client.c
src/rx/test/kctest.c
src/rx/test/testclient.c
src/rx/xdr_afsuuid.c
src/rx/xdr_int64.c
src/rx/xdr_mem.c
src/rx/xdr_rec.c
src/rx/xdr_refernce.c
src/rxgen/rpc_clntout.c
src/rxgen/rpc_cout.c
src/rxgen/rpc_main.c
src/rxgen/rpc_parse.c
src/rxgen/rpc_scan.c
src/rxgen/rpc_svcout.c
src/rxgen/rpc_util.c
src/rxkad/domestic/crypt_conn.c
src/rxkad/domestic/fcrypt.c
src/rxkad/domestic/tcrypt.c
src/rxkad/rxkad_client.c
src/rxkad/rxkad_common.c
src/rxkad/rxkad_server.c
src/rxkad/test/stress.c
src/rxkad/test/stress_c.c
src/rxkad/test/stress_s.c
src/rxkad/ticket.c
src/scout/scout.c
src/sys/rmtsysc.c
src/sys/rmtsyss.c
src/tbutc/NTMakefile
src/tsm41/aix41_auth.c
src/tviced/NTMakefile
src/ubik/beacon.c
src/ubik/disk.c
src/ubik/recovery.c
src/ubik/remote.c
src/ubik/ubik.c
src/ubik/ubikcmd.c
src/ubik/udebug.c
src/ubik/vote.c
src/update/client.c
src/update/server.c
src/update/utils.c
src/usd/usd_file.c
src/usd/usd_nt.c
src/uss/lex.c
src/uss/uss_fs.c
src/uss/uss_kauth.c
src/uss/uss_procs.c
src/uss/uss_ptserver.c
src/uss/uss_vol.c
src/util/NTMakefile
src/util/hostparse.c
src/util/kreltime.c
src/util/ktime.c
src/util/netutils.c
src/util/serverLog.c
src/util/uuid.c
src/util/volparse.c
src/venus/cacheout.c
src/venus/cmdebug.c
src/venus/fs.c
src/venus/up.c
src/vfsck/dir.c
src/vfsck/inode.c
src/vfsck/main.c
src/vfsck/pass1.c
src/vfsck/pass1b.c
src/vfsck/pass2.c
src/vfsck/pass3.c
src/vfsck/pass4.c
src/vfsck/pass5.c
src/vfsck/proplist.c
src/vfsck/setup.c
src/vfsck/utilities.c
src/viced/callback.c
src/viced/fsprobe.c
src/viced/host.c
src/viced/physio.c
src/viced/profile.c
src/viced/viced.c
src/vlserver/cnvldb.c
src/vlserver/sascnvldb.c
src/vlserver/vlclient.c
src/vlserver/vldb_check.c
src/vlserver/vlprocs.c
src/vlserver/vlserver.c
src/vlserver/vlutils.c
src/vol/clone.c
src/vol/devname.c
src/vol/fs_conv_411.c
src/vol/fssync.c
src/vol/gi.c
src/vol/nuke.c
src/vol/physio.c
src/vol/purge.c
src/vol/test/listVicepx.c
src/vol/vnode.c
src/vol/vol-info.c
src/vol/vol-salvage.c
src/vol/volume.c
src/vol/vutil.c
src/volser/dumpstuff.c
src/volser/physio.c
src/volser/restorevol.c
src/volser/volprocs.c
src/volser/voltrans.c
src/volser/vos.c
src/volser/vsprocs.c
src/volser/vsutils.c
src/xstat/xstat_cm.c
src/xstat/xstat_cm_test.c
src/xstat/xstat_fs.c
src/xstat/xstat_fs_test.c

diff --git a/NEWS b/NEWS
index 85a61c748b20f2d787f71b481fb3d47b16bacd10..f1096ccad1f3e51570a8672fb941b21a2fa5408d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,13 @@
 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
@@ -129,3 +137,11 @@ Openafs News -- history of user Visible changes. 11 July 2001
    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.
diff --git a/README b/README
index ca463b17b1aea9cf9ed1b64f2b68297358792638..9d20c5a0d4b821f53180a0cfcbf4142b7059f8b5 100644 (file)
--- a/README
+++ b/README
@@ -5,6 +5,18 @@ 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
 
+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
 ----------------------------------
 
@@ -28,16 +40,18 @@ A. Creating the proper directory structure.
       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 
@@ -53,15 +67,43 @@ A. Creating the proper directory structure.
       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:
index 395c77a26ec7b1aa7f6105c17cedcff7917b3607..12ef98bd80e34c4c79493aae143a674ef1ad4861 100644 (file)
@@ -22,13 +22,19 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 
 #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 */
index 9875b78d7986d26ca5af85f6410a98665f665631..1aa095317d362dcba741338b25a23f882c23126c 100755 (executable)
--- a/regen.sh
+++ b/regen.sh
@@ -3,6 +3,9 @@ echo "Running aclocal"
 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"
index 362b1b2c1c5b2d49e690db192952ae7e34dc153f..e0316f8d4841f77be61987447a9ca394ec7f9078 100644 (file)
@@ -17,11 +17,11 @@ includes: afsdinc osiinc authinc
 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
index 8b84b89865e2165c41c31981fbfd33d4010c9953..2e766745d5e146dbbf7d0bb0811c91fcae9f275e 100644 (file)
@@ -23,7 +23,7 @@ NTMAKELANG = nmake /nologo /f ntmakefile en_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
@@ -292,10 +292,15 @@ install9x: install
 
 #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
 
@@ -307,9 +312,9 @@ clean: start
        $(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) ..\..
index b6ebfa5e8a010b581d7280b165dbdb52202beafb..268119af63623f2753fa379c31ed657d216649ea 100644 (file)
@@ -22,7 +22,7 @@ NTMAKE = nmake /nologo /f ntmakefile install
 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
@@ -326,37 +326,37 @@ libadmin: tbutc
        $(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\$@
@@ -417,13 +417,7 @@ afssvrcpa: afssvrcfg
        $(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)
@@ -476,6 +470,11 @@ install: start finale
 # InstallShield dependencies
 
 InstallShield5: install
+       echo ***** afs_setup_utils
+       $(CD) $(OBJ)\WINNT\afs_setup_utils
+       $(NTMAKE)
+       $(CD) ..\..\..
+
        $(CD) $(OBJ)\WINNT\install\$@
        $(NTMAKE)
        $(CD) ..\..\..\..
index 9973d5f8275e9fb3daee462ea34dd772a7712600..90b27ace8b6d88726d7aad88a65e81acdb28a2db 100644 (file)
@@ -3,7 +3,7 @@ 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
+directory or on-line at http://www.openafs.org/dl/license10.html
 
 Building OpenAFS on Windows NT
 ------------------------------
@@ -22,10 +22,10 @@ Each step is explained in detail below:
 
 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
 
@@ -53,9 +53,17 @@ C. Optional: Install Installshield 5.x
       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
@@ -91,63 +99,76 @@ E. Configure the OpenAFS build environment
    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.
@@ -166,8 +187,11 @@ F. Begin the build
  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:
index a19ba59f94ad50aa89458a099a49d60c60942d7f..dae84fb673b6aab1aca710bd934ba17803289925 100644 (file)
@@ -124,6 +124,34 @@ or         nmake -f ntmake9x clean
       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
 
@@ -163,3 +191,5 @@ or  nmake -f ntmake9x clean
    5. Reboot the target machine.
    6. You can now start the client by executing the program WinAfsLoad.exe
       from the install directory.
+
+
index dc4d0a263f432e444395445d12e5666ae7fa09cf..0115b0b43a1440e7379a08bfe16ace0e8316c3aa 100644 (file)
@@ -86,14 +86,26 @@ $(AFSRM_EXEFILE): $(AFSRM_EXEOBJS) $(AFSRM_EXELIBS)
 
 ############################################################################
 
+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
@@ -156,7 +168,20 @@ $(DOCS_UNINST_DLLFILE) : d_afs_setup_utils.obj $(DLLOBJS) $(DLLLIBS)
 ############################################################################
 
 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
 
 ############################################################################
 #
index 363adc7b49fb58abe87302e3e7c3c44daaba2d64..7a0aa8ef303312923fcb00bc0c254a5da1f27c25 100644 (file)
  */
 
 /*
- * 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;
+}
+
+
index 3fc4285de65af440e5f3c9d307c94013110b2af0..52b578d2e1ffd2234de8781cacd0d83cb7c65e0e 100644 (file)
@@ -61,3 +61,5 @@ primary: $(LIBINCLUDES) $(LIBFILE)
 $(LIBFILE): $(LIBOBJS)
        $(LIBARCH)
 
+clean::
+
index 736c922f39795beceaf69210ca1fd2c2c9fb1e4e..850a7962d0f16125d4159caa0c0cee9c107fc38e 100644 (file)
@@ -398,7 +398,7 @@ BOOL AfsClass_RestartService (LPIDENT lpiRestart, ULONG *pStatus)
       lpServer->Close();
       }
 
-   BOOL fRestartAll;
+   BOOL fRestartAll = FALSE;
    if (!lpiRestart->fIsService())
       fRestartAll = TRUE;
 
index 2801464e1061995ebe569e023f250f05fafd627c..f00938a4b19e112d275e40e4ce828e0b524fdec2 100644 (file)
@@ -425,7 +425,7 @@ int SRXAFSCB_GetCellServDB(
     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;
 }
 
index e18654adfc4b7504624076bc982f6671bfaaf752..f7e3284c09a78ff9a74279e8af4f159050d45b37 100644 (file)
@@ -129,6 +129,7 @@ cm_space_t *cm_GetSpace(void)
                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;
index 985c44400b181978db973eb057fab24dfed8ae0d..1ad8aaf12baa5a112d4d200e9b18279fc6084885 100644 (file)
@@ -2664,7 +2664,7 @@ static afs_int32 GetCryptCmd(as)
     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");
index 6b24bb8bc6728a7a2fcc382e80eb4ec032631f65..cf8f0ddbab37a8a636ce84e66051b1acd9421ce9 100644 (file)
@@ -175,7 +175,7 @@ typedef struct ktext KTEXT_ST;
  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) {\
@@ -186,7 +186,7 @@ typedef struct ktext KTEXT_ST;
  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) {\
@@ -195,7 +195,7 @@ typedef struct ktext KTEXT_ST;
  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];\
@@ -203,7 +203,7 @@ typedef struct ktext KTEXT_ST;
  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) {\
index 9e06d8822e229a7f7acfe00cd009cc3b61375e6a..3b1722d857f5039d7846829ab9d0a8a182a878e7 100644 (file)
@@ -149,6 +149,10 @@ void smb_IoctlPrepareWrite(smb_fid_t *fidp, smb_ioctl_t *ioctlp)
        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;
index cf019000ba007b86d56a5c1e8dc8cc9cf2294bc4..546fac3aa43c1e6fc2067696fd75c3f7ba5e8547 100644 (file)
@@ -14,11 +14,11 @@ Set SavePath=%Path%
 
 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
index 40f8ae8d14c4e1f2669966048812250d87b91d97..25df3c728d0275ad0351ac2ec6b1dfad5a2e74cd 100644 (file)
@@ -15,6 +15,6 @@ call GenIS5.ipr.bat
 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 ..\..
index b7f8138e7ba9be734e9e6522faf18383dfcd8b87..648a9e00991c3830f1e7fa030a6b5971e832b02f 100644 (file)
@@ -14,7 +14,7 @@ echo Creating the IS dir tree...
 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"
index 8df938577326786e638ac2192eadb415f261798e..310191c8041ba7a2a204b3df43c184f257174dbc 100644 (file)
@@ -271,6 +271,11 @@ Entry102=SERVER_GROUP_NAME
 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=
@@ -432,3 +437,18 @@ 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
+
index 27dcbfe5b453ec452785f8ecb03b1256b547de34..1c3bd5634bf7601c09df2280e5a1357d2c9718cd 100644 (file)
@@ -15,7 +15,7 @@ copy "Component Definitions\Default.fgl" .
 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" .
 
@@ -23,6 +23,9 @@ copy "Script Files\setup.rul" .
 
 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" .
index 5c4e1aef3b4e630206dd31adb3c7034be9243499..9f4db547b333899fb9a01de5ad39bab7340310c7 100644 (file)
@@ -19,12 +19,12 @@ echo [GeneralInfo] >> default.mda
 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
@@ -32,7 +32,7 @@ echo. >> 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
@@ -59,8 +59,8 @@ echo count=8 >> 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
 
index 06b4fe2b1c106869c77e86256d8f71ff32c71577..6978f6685d4859cb7f1c936757f6535680678088 100644 (file)
@@ -69,7 +69,7 @@ echo Version=1.00.000 >> Client_Common_Files.fgl
 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
@@ -145,7 +145,7 @@ echo Version=1.00.000 >> Light_Client_Common_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
@@ -201,7 +201,7 @@ echo Version=1.00.000 >> Light95_Client_Common_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
@@ -324,7 +324,7 @@ echo Version=1.00.000 >> Control_Center_Common_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
index d1c38b3374fa08ca42e1eb043a288f58b342ae39..312e22a0a7380508200791757115020be73dcb04 100644 (file)
@@ -20,9 +20,9 @@ echo [OperatingSystem] >> InstallShield5.ipr
 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
@@ -55,13 +55,13 @@ echo set_compileb4build=No >> 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
 
index ad3ba1cd1073180543b6ace1d887a807a1261c52..70537ce79497dcd0506570165b59d6572a711920 100755 (executable)
 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!
 
 
index c679e5ad7776d45b92a279ea7895414c507e6845..96d30aa211efe4b03a745c293c8a621ddd407a71 100644 (file)
@@ -8,30 +8,62 @@
 !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
index fffb4726b0e3b525e68e2ffb7b6b2227b9de86cb..4f2ae6e6579910e9b1491fb7d37edcd7faa39f58 100644 (file)
@@ -16,7 +16,7 @@ copy Default.fgl "Component Definitions"
 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"
 
@@ -24,6 +24,7 @@ copy setup.rul "Script Files"
 
 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"
index 6c4472191b16c3d2fbe17372e8503d779538b043..4be378da313e939ee01785f81dc0055f98993394 100644 (file)
@@ -1,14 +1,12 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// 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
@@ -321,6 +319,745 @@ end;
        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
@@ -333,26 +1070,40 @@ end;
 //
 ///////////////////////////////////////////////////////////////////////////////
 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,
@@ -395,10 +1146,20 @@ program
 
        // 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;
@@ -459,12 +1220,13 @@ program
 
        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();
@@ -486,37 +1248,83 @@ endprogram
 //
 ///////////////////////////////////////////////////////////////////////////////
 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;
 
 
@@ -531,9 +1339,9 @@ 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;
@@ -1425,6 +2233,7 @@ function SetupInstall()
 begin
     Enable( CORECOMPONENTHANDLING );
 
+    szCellName=@CELLNAME_DEFAULT;
     bInstallAborted = FALSE;
 
     //  Create list of end user selections to be displayed by DialogShowSdStartCopy()
@@ -1549,7 +2358,7 @@ function DialogShowSdWelcome()
 begin
 
     szTitle = "";
-    szMsg   = "";
+    szMsg   = @WELCOME_MESSAGE;
     nResult = SdWelcome( szTitle, szMsg );
 
     return nResult;
@@ -1799,12 +2608,15 @@ begin
                        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, "");
@@ -2652,6 +3464,31 @@ begin
 end;
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 ///////////////////////////////////////////////////////////////////////////////
 //
 // Function: CreateStartMenuEntries
@@ -2738,8 +3575,3 @@ end;
 
 // --- include script file section ---
 #include "sddialog.rul"
-
-
-
-
-
index d0f8d46436a40f827c2f667878419ef03aafca95..fe95e91bad51578f5f05e3174929b31b88913b2d 100644 (file)
@@ -5,8 +5,6 @@
 #      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
@@ -16,7 +14,6 @@ OUTDIR = $(DESTDIR)\WinInstall
 COMPONENTS = \
        INSTALL.BAT \
        afsd.pif \
-       cellservdb \
        readme.RTF \
        license.txt \
        templet.reg \
@@ -37,8 +34,8 @@ COMPONENTS = \
        $(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))
@@ -57,6 +54,6 @@ clean ::
     $(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"
index fc2aa88f0cf296c08475b404b3b26e958f45df68..d2beadb3344993def7a012b87bc2125222fb67f6 100644 (file)
@@ -45,8 +45,8 @@ pthread_95.obj: pthread.c
        $(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
index 2853f48e53c274a6749cf77dce30b0dfd3b09e4c..4d39b66cb2d8a17285ae91e06c0ada25738b7e5f 100644 (file)
@@ -164,14 +164,27 @@ BOOL CAfs::Create(CString &msg,CString sCompName,PROCESS_INFORMATION &procInfo)
                      /*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
@@ -360,6 +373,7 @@ BOOL CAfs::StartExployer(CString &msg,const char *udrive)
        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
index 97171ae9b5d233565d9362830e68387c4e60e6e0..7239359a6eaa8995b795c286faf0d53bb3aad067 100644 (file)
@@ -118,10 +118,6 @@ BOOL CChange::OnInitDialog()
                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
 }
@@ -159,8 +155,6 @@ BOOL CChange::IsValidSubmountName (LPCTSTR pszSubmount)
 {
    if (!*pszSubmount)
       return FALSE;
-   if (stricmp(pszSubmount,"all")==0)
-          return FALSE;                                        //disallow adding a share name of "all"
    for ( ; *pszSubmount; ++pszSubmount)
       {
       if (!isprint(*pszSubmount))
index 4f4c1404ba2389d5f0d98edcf3efa011098db831..8cc9dce0d3e1a49a7016fd16c16e55963b9aa3f5 100644 (file)
@@ -48,7 +48,8 @@ RSC=rc.exe
 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"
 
@@ -76,7 +77,7 @@ CPP_PROJ=/nologo /MD /W3 /GX /O2 \
        /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= \
@@ -137,7 +138,7 @@ CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od \
        /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= \
index cfdb6f70fb785e70d0085c99a1eefab0f165d020..44d4181635953f3e94157a0092fd492f584cba9d 100644 (file)
@@ -154,6 +154,7 @@ BOOL CWinAfsLoadApp::InitInstance()
        // 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)
@@ -170,7 +171,7 @@ BOOL CWinAfsLoadApp::InitInstance()
        {
                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
        {
@@ -407,7 +408,7 @@ void CWinAfsLoadApp::WSANotifyFromUI(WPARAM wp,const char *msg)
                m_wParam=wp;
                m_sMsg=msg;     
                SetEvent(CMyUIThread::m_hEventThreadKilled);
-               m_uNotifyMessage=0;
+               m_uNntifyMessage=0;
                break;
        default:
                break;
index 1755af62b908928026b170ddde04fc9b02812cb6..b6cdece93f254ebdf40cd329b2f3d8c65065251c 100644 (file)
@@ -83,9 +83,7 @@ public:
        UINT m_uEvent;
        UINT m_uNotifyMessage;
        WPARAM m_wParam;
-#if NOKNOK
-       BOOL m_bNokNok;
-#endif
+       BOOL m_bNoID;
 
        //{{AFX_MSG(CWinAfsLoadApp)
        //}}AFX_MSG
index 2260aea1cac788b5899d7ab232a849abd0f62fa3..b17846821b7a8aa26a6f21404731dc6489359056 100644 (file)
@@ -1,19 +1,16 @@
-//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
 
 /////////////////////////////////////////////////////////////////////////////
@@ -63,6 +60,7 @@ BEGIN
     "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"
@@ -265,7 +263,7 @@ END
 
 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
@@ -290,7 +288,7 @@ BEGIN
             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
@@ -493,6 +491,10 @@ BEGIN
     IDH_ADD                 "HELP ADD"
     IDH_CHANGE              "Help Change"
     IDH_MAIN                "Help Main"
+END
+
+STRINGTABLE DISCARDABLE 
+BEGIN
     IDM_CLEAR               "Clear Window"
 END
 
@@ -532,6 +534,7 @@ LANGUAGE 9, 1
 #pragma code_page(1252)
 #endif //_WIN32
 #include "afxres.rc"         // Standard components
+//#include "res\WinAfsLoad.rc2"  // non-Microsoft Visual C++ edited resources
 #endif
 
 /////////////////////////////////////////////////////////////////////////////
index 45c7cf458a4cbb8340e67cc787e3e44a58620f0a..16e583c260e59091195720773bb8010554220d56 100644 (file)
@@ -333,6 +333,7 @@ BOOL CWinAfsLoadDlg::OnInitDialog()
        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);
@@ -341,7 +342,11 @@ BOOL CWinAfsLoadDlg::OnInitDialog()
        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);
 
@@ -349,7 +354,6 @@ BOOL CWinAfsLoadDlg::OnInitDialog()
        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);
@@ -366,28 +370,41 @@ BOOL CWinAfsLoadDlg::OnInitDialog()
        }
        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();
@@ -621,13 +638,30 @@ void CWinAfsLoadDlg::OnSysCommand(UINT nID, LPARAM lParam)
                        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();
@@ -721,17 +755,20 @@ void CWinAfsLoadDlg::OnConnect()
                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;
@@ -739,12 +776,13 @@ void CWinAfsLoadDlg::OnConnect()
        // 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;
@@ -754,34 +792,70 @@ void CWinAfsLoadDlg::OnConnect()
                {
                        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
@@ -789,7 +863,7 @@ void CWinAfsLoadDlg::OnConnect()
        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;
@@ -1028,8 +1102,15 @@ void CWinAfsLoadDlg::UpdateConnect()
                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;
        }
@@ -1073,7 +1154,8 @@ void CWinAfsLoadDlg::OnTrayButton4()
        OnSysCommand(IDM_EXPLORERAFS+64, 0);
 }
 
-#define MAXKEY (SHARENAMESIZE+1)*MAXSHARES
+#define MAXDRIVESIZE (SHARENAMESIZE+5)*MAXSHARES
+
 BOOL CWinAfsLoadDlg::ProfileData(BOOL put)
 {
        CString dINI;
@@ -1106,7 +1188,6 @@ BOOL CWinAfsLoadDlg::ProfileData(BOOL put)
                                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));
@@ -1121,91 +1202,41 @@ BOOL CWinAfsLoadDlg::ProfileData(BOOL put)
                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 *
                                {
@@ -1215,46 +1246,53 @@ BOOL CWinAfsLoadDlg::ProfileData(BOOL put)
                                } 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;
 }
@@ -1359,11 +1397,13 @@ void CWinAfsLoadDlg::OnRemove()
                        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);
@@ -1686,16 +1726,31 @@ void CWinAfsLoadDlg::OnAuthenicate()
        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);
        }
+
 }
 
 
index 19d27200ab145e4cc914ee6fe1b608a513be5df7..433cb6cb6ef3f8751fe28b2b5d212d1e92b7987a 100644 (file)
@@ -37,6 +37,7 @@ public:
        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)
@@ -72,6 +73,7 @@ public:
 
 // Implementation
 protected:
+       CString m_VersionString;
        CAfs m_cAfs;
        CTrayIcon       m_trayIcon;             // my tray icon
        HICON m_hIcon;
index 3a47075ac7ec79ac725f2e9a72a1861a9ceb464a..3784774fd7a7c9f326bebca1caaa51de54c5ec3e 100644 (file)
 #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__
index 246b69592193ea0e6fe4e76a4de915c22b3e0359..4f64a92eea2972f8ac19d2a25e3dc71262f1571a 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
@@ -40,7 +40,7 @@ void *osi_UFSOpen(ainode)
     }
     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;
     }
index 9867a444c1345f56636f8dffa0aa3b59e510ae1d..cbdab56162affaede7b4ce02ebb8857427b6e432 100644 (file)
@@ -15,7 +15,7 @@
 #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 */
@@ -233,7 +233,7 @@ int timeoutcf(
                                break;
                        }
                        else  {
-                               bzero(tos, sizeof(struct tos));
+                               memset(tos, 0, sizeof(struct tos));
                        }
 
                        /*  The trb and the tos were both allocated.  */
index a501544362eb9b518a6e22ba4c3ca0702dbc104e..f52e748cae5b28130fd621c2e586d08c914254d6 100644 (file)
@@ -10,7 +10,7 @@
 #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"
@@ -735,7 +735,7 @@ struct ucred        *cred;
 
    AFS_STATCNT(afs_gn_fclear);
     if (!fclear_init) {
-       bzero(zero_buffer, PAGESIZE);
+       memset(zero_buffer, 0, PAGESIZE);
        fclear_init = 1;
     }
     /*
index 645fff316a96fde5392833756fc1633696feb419..48dbea120f91eebb1479918b75b0da7ed9ab8411 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
@@ -106,7 +106,7 @@ void *osi_UFSOpen(ainode)
     }
     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;
index eefbe6e5246b0c9e2fdc1398d0b7f57705be68af..2769f8c6311469ea707c649918c1012b115cf230 100644 (file)
@@ -1,7 +1,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_module.c,v 1.1.1.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"
@@ -17,16 +17,17 @@ extern int afs3_syscall();
 
 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"); 
index d3393f777aa6dcbdb8a9dc307d0842266d455120..069992e268e28085928a5f437cc4c9bd5469733d 100644 (file)
@@ -1,7 +1,7 @@
 #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 */
@@ -78,8 +78,8 @@ struct proc *p;
     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");
@@ -191,10 +191,8 @@ int afs_statfs(struct mount *mp, struct statfs *abp, struct proc *p)
     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();
@@ -227,7 +225,7 @@ int afs_init(struct vfsconf *vfc) {
 
         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++) {
index 19a68edbd513313b94143f41424457a24d9c8381..e27932b557f76e6dc9bdd73596799934707dc55a 100644 (file)
@@ -1,7 +1,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.1.1.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 */
@@ -121,7 +121,7 @@ struct vnodeopv_desc afs_vnodeop_opv_desc =
     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)
@@ -604,7 +604,7 @@ afs_vop_pageout(ap)
                 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 */
@@ -888,10 +888,10 @@ abortit:
        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';
 
 
index c552da6e5cae7cea034260935a2b663f6db49e40..842f5a2204de51d2b2fcafa4b099d03f9c1e543c 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
@@ -60,7 +60,7 @@ void *osi_UFSOpen(ainode)
        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;
index 98fe663f69a9965e2f0d09dc11f3ca53a06374b6..4cc1497fc0a0f9bb084cf3afd39ccc1211cf85d5 100644 (file)
@@ -13,7 +13,7 @@
 #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 */
@@ -90,10 +90,10 @@ int mp_afs_mount(struct mount *afsp,char * path, caddr_t data,
     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();
@@ -307,12 +307,12 @@ int mp_afs_vptofh(struct vnode *avn, struct fid *fidp)
     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;
index 10a2a87df0a67b4745714ac8645b96e648f0657d..9bc6ad875a8f051993d68c4258921da44490c546 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
@@ -38,7 +38,7 @@ void *osi_UFSOpen(ainode)
     }
     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;
     }
index b052ea28988b3a22d14712e15063dfc60c4c683a..0684307dc5b50d0198d48a7ea0976097cb71a9d5 100644 (file)
@@ -13,7 +13,7 @@
 #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 */
@@ -90,10 +90,10 @@ int mp_afs_mount(struct mount *afsp,char * path, caddr_t data,
     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();
@@ -299,12 +299,12 @@ int mp_afs_vptofh(struct vnode *avn, struct fid *fidp)
     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;
index e777f0c1d52641430a1adeb0abe87ff1e99eda6e..81954b0b07abf0cdbafaf1d6c274a53dd8c956b8 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
@@ -39,7 +39,7 @@ void *osi_UFSOpen(ainode)
     }
     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;
     }
index dcd39a526ca9725cde5ff0779c062e37860003a8..cb2998a258f888c6af8142e6ee97683c8568b6a6 100644 (file)
@@ -12,7 +12,7 @@
 #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 */
@@ -77,14 +77,14 @@ m_cpytoc(m, off, len, cp)
                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;
@@ -1350,7 +1350,7 @@ afs_pageout(vp,prp, start, end, flags)
     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() */
@@ -2039,7 +2039,7 @@ afs_readdir(vp, uiop, cred)
                 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;
         }
 
@@ -2098,7 +2098,7 @@ afs_readdir3(vp, uiop, cred)
              (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);
@@ -2223,7 +2223,7 @@ printf("afsHash: enter\n");
                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);
@@ -2289,7 +2289,7 @@ printf("afsHashInsertFind: %d FOUND\n", key);
                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 */
index 262a331bff54bb4a278cfcb4b09b6e865585d03f..322af9a13ab91e2d07df245d2a62e5692e4c9350 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
@@ -74,7 +74,7 @@ void *osi_UFSOpen(ino_t ainode)
     }
     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;
     }
index 24c17dfaeac83b1b58f3a41a303dc913d1e64268..2a646345b22d4eb124cca6a8ebaee9cebac72e71 100644 (file)
@@ -18,7 +18,7 @@
 #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"
@@ -89,7 +89,7 @@ int fixup_pags(int **credpp, int ngroups, gid_t *gidset, int old_afs_pag,
        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;
index c16636b4c23f2711711a649101d2268966ad6706..4a04d99f0a20f40e77d7408a8a5f3b8bba45c995 100644 (file)
@@ -42,7 +42,7 @@
 #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 */
@@ -460,7 +460,7 @@ xfs_icreatename64(struct vfs *vfsp, int datap, int datalen,
        }
        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,
@@ -482,7 +482,7 @@ xfs_icreatename64(struct vfs *vfsp, int datap, int datalen,
        return code;
     }
 
-    bzero((char*)&attrs, sizeof(attrs));
+    memset((char*)&attrs, 0, sizeof(attrs));
     attrs.at_pino = vattr.va_nodeid;
     VN_RELE(dvp);
        
@@ -510,8 +510,7 @@ xfs_icreatename64(struct vfs *vfsp, int datap, int datalen,
        
     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,
@@ -1200,12 +1199,11 @@ afs_syscall_ilistinode64(int dev, int inode_hi, int inode_lo,
     }
     
     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;
index 81203468ae19fa046bc48078afbe237ab42aa93f..ca25d700eff6d8756d7edc349cc19fb40bcfebc7 100644 (file)
@@ -13,7 +13,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_vnodeops.c,v 1.1.1.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 */
@@ -810,7 +810,7 @@ afs_strategy(OSI_VC_ARG(avc), bp)
            /* 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;
index 45d96de548c1a4b0fb363062110022cb8fe9e4bb..4f3f0bf3f9d5285b4c3b9f26bbff438c06631b44 100644 (file)
 #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"
@@ -86,7 +87,7 @@ static void *linux_alloc(unsigned int asize)
 
     /*  if we can use kmalloc use it to allocate the required memory. */
     if (asize <  MAX_KMALLOC_SIZE) {
-        new = (void *)(long)kmalloc(asize, GFP_KERNEL);
+        new = (void *)(unsigned long)kmalloc(asize, GFP_KERNEL);
         if (new) /* piggy back alloc type */
             (unsigned long)new |= KM_TYPE;
     }
index 259ffc19c69226d900d71c4c95fe05ed165cf663..b260406559dcf229469a39b15d77b07e75d066f2 100644 (file)
@@ -16,7 +16,7 @@
 #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"
@@ -100,8 +100,8 @@ int setpag(cred_t **cr, afs_uint32 pagvalue, afs_uint32 *newpag, int change_pare
 
 
 /* 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();
index ac09f995add1eb13c5aa87c271e8009ba15a659f..b5f92e12530ee40d6af646dd357794fc054663a4 100644 (file)
@@ -27,6 +27,9 @@ typedef struct vnode {
        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;
@@ -54,6 +57,9 @@ typedef struct vnode {
         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
@@ -75,12 +81,21 @@ typedef struct vnode {
         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
index e729b08b91cfb3a34fe60c4acd667c13f091edca..91b7704f620dc72f93952cbbb191061700d2455a 100644 (file)
@@ -15,7 +15,7 @@
 #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"
@@ -244,9 +244,7 @@ void afs_delete_inode(struct inode *ip)
     struct vcache *vc = (struct vcache*)ip;
 
     AFS_GLOCK();
-    ObtainWriteLock(&vc->lock, 504);
     osi_clear_inode(ip);
-    ReleaseWriteLock(&vc->lock);
     AFS_GUNLOCK();
 }
 
@@ -334,6 +332,14 @@ int afs_statfs(struct super_block *sbp, struct statfs *statp, int size)
 }
 
 
+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,
@@ -341,6 +347,7 @@ struct super_operations afs_sops = {
     delete_inode:      afs_delete_inode,
     put_super:         afs_put_super,
     statfs:            afs_statfs,
+    umount_begin:      afs_umount_begin,
 };
 #else
 struct super_operations afs_sops = {
@@ -354,7 +361,7 @@ 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
 
index 20babf31e89dfe821d2d7a2eac8aa41dea48e28d..5f43233456a7c9be4a07f2b303effbbdc90a3f89 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
@@ -189,7 +189,7 @@ void *osi_UFSOpen(ainode)
     }
     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;
     }
index 74d4c063ad5879703457a463bfe597d18285e7fa..485a4e0c2a7edd616f346abf5c64d7e4e521cc4f 100644 (file)
@@ -10,7 +10,7 @@
 #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)
 /*
@@ -265,10 +265,6 @@ struct AFS_UCRED *acred;
     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");
@@ -276,9 +272,36 @@ struct AFS_UCRED *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
@@ -290,12 +313,6 @@ struct AFS_UCRED *acred;
        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) {
@@ -323,7 +340,7 @@ retry:
     }
 
     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,
@@ -337,7 +354,7 @@ retry:
      * 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);
@@ -359,7 +376,7 @@ retry:
     /* 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;
@@ -438,19 +455,17 @@ 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 */
@@ -495,8 +510,13 @@ retry:
 
     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) {
@@ -526,7 +546,7 @@ retry:
     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);
index f678d81fe823338b8d8dc30d54207ac10c3bbc3c..8230a549f5a945503f24e10062a393d9be8135c2 100644 (file)
@@ -14,7 +14,7 @@
 #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
@@ -1419,7 +1419,7 @@ struct afsconf_dir *adir; {
 
     /* 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 */
@@ -1649,7 +1649,7 @@ void uafs_Init(
               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)));
@@ -1747,7 +1747,7 @@ void uafs_Init(
               " 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;
index 22830fbec0a7426c87472afb2b98662645ead3e9..85aadce611f5603c8d50fdcee77fd6bb40a44d78 100644 (file)
@@ -17,7 +17,7 @@
 #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 */
@@ -130,12 +130,12 @@ struct fid **fidpp;
            ||  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. */
@@ -143,12 +143,12 @@ struct fid **fidpp;
     (*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);
index f233ad85c1a5aa55e59101eda908b6891fdc40c0..9b609f76a3142354f422de7e76d27af1d4b0685a 100644 (file)
@@ -15,7 +15,7 @@
 #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)
 
@@ -104,9 +104,9 @@ afs_ustrategy(abp)
        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
            /*
index b327b46a72f209371d3912acef11a2196838b88a..9a5c9b082b75bb9be5fc88dc2c77395267c3e0f4 100644 (file)
@@ -20,7 +20,7 @@
 #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 */
@@ -171,7 +171,7 @@ afs_MemWrite(avc, auio, aio, acred, noLock)
        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.
@@ -280,7 +280,7 @@ afs_MemWrite(avc, auio, aio, acred, noLock)
        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.
index 10de52162c86d0a3840b2c7bdd2edf3817bd97f0..5f668b5564c71859d541e0faeeb58f73ee597901 100644 (file)
@@ -10,7 +10,7 @@
 #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)
@@ -536,6 +536,6 @@ void shutdown_bufferpackage() {
       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));
   }
 }  
index c6983fac485bdff8d68d7e1c39b48c348e85e874..14220fd49f0166421ad5576266fc9f0bc6e69cec 100644 (file)
@@ -16,7 +16,7 @@
 #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*/
@@ -719,7 +719,7 @@ int SRXAFSCB_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVers
         */
        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;
@@ -739,7 +739,7 @@ int SRXAFSCB_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVers
        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;
@@ -757,14 +757,12 @@ int SRXAFSCB_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVers
         */
        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;
@@ -1126,23 +1124,14 @@ int SRXAFSCB_GetCellServDB(
     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);
@@ -1150,12 +1139,29 @@ int SRXAFSCB_GetCellServDB(
         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
@@ -1191,25 +1197,16 @@ int SRXAFSCB_GetLocalCell(
     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.  */
@@ -1218,13 +1215,30 @@ int SRXAFSCB_GetLocalCell(
         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
index 227a72a98d0360a6f945d6ba2fc44c8c3d0f1aa7..e4b3ac65476b70d360d66004eeeefeab5ed98559 100644 (file)
@@ -74,7 +74,7 @@
 #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*/
@@ -367,7 +367,7 @@ int doLockInit;
 {
 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 
index 82230ebf7cfc1de7c36644e07dafc3764a6449fb..75cb5cf8deea77fcdcc91509f7ae80a0341d0c8c 100644 (file)
@@ -13,7 +13,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cell.c,v 1.1.1.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 */
@@ -386,7 +386,7 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport
     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];
index df528e93ddf0bf473f8fd8eed3927a506209f464..d596287c20596b75bf9004dd55104e9b3aac9ab8 100644 (file)
@@ -13,7 +13,7 @@
 #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 */
@@ -172,7 +172,7 @@ struct conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport,
        */
        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;
index 9ceb9e5852a260b5be8352ced64b24b10637b695..79fb2635bc661d1ccf63384bce861ca20583d60b 100644 (file)
@@ -13,7 +13,7 @@
 #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*/
@@ -1432,14 +1432,18 @@ struct tlocal1 {
 
 /* 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*/
@@ -2646,18 +2650,18 @@ void afs_dcacheInit(int afiles, int ablocks, int aDentries, int achunk,
     /* 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 */    
index dd57b69ad5a8da28e64e73d882ee22b8e2c0f555..8e7b489354846aea73ca39a6f3a35c9a799fd61c 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
@@ -37,7 +37,7 @@ char *data;
     }
     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)
index cef2af9375efea802a1ed547aefa02ebca06c049..e9673fc49c84ff4dde8bf45bbb0f1bf104d867f0 100644 (file)
@@ -16,7 +16,7 @@
 #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 */
@@ -695,8 +695,8 @@ shutdown_cache()
     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*/
@@ -860,7 +860,7 @@ void shutdown_AFS()
       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");
index 2fa9cf0df669c120b11aefe144b695e0ef20ac24..5c3fdd7456817c390fb3eeed174f305df8a6fbb1 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -73,7 +73,7 @@ afs_InitMemCache(size, blkSize, flags)
          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);
@@ -132,7 +132,7 @@ afs_MemReadBlk(mceP, offset, dest, size)
       
       if(bytesRead > 0) {
          AFS_GUNLOCK();
-         bcopy(mceP->data + offset, dest, bytesRead);
+         memcpy(dest, mceP->data + offset, bytesRead);
          AFS_GLOCK();
       }
       else
@@ -170,7 +170,7 @@ afs_MemReadvBlk(mceP, offset, iov, nio, size)
          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;
@@ -227,15 +227,15 @@ afs_MemWriteBlk(mceP, offset, src, size)
          
          /* 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;
@@ -264,17 +264,17 @@ afs_MemWritevBlk(mceP, offset, iov, nio, size)
          
          /* 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;
@@ -301,14 +301,14 @@ afs_MemWriteUIO(blkno, uioP)
          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;
index 83952eeebbc93d3d494711c6266e3af2ad691c63..c83173b0575a619229315487ecfeaab1c512c82c 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -72,9 +72,9 @@ register afs_int32 uid, host;
        }
     }
     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;
index 8499bd353ff567a93680cccc29aca1c051ac3e5d..bfb29ca24acdff5fb8839392359fb9998a67997b 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi.c,v 1.1.1.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 */
@@ -72,7 +72,7 @@ void osi_Init()
 
        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;
        }
@@ -935,7 +935,7 @@ const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr)
        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;
index bc5227227934ef89bab90463971dfb0727cfdf5c..ee17fa622a584df2f5a713277ee371115cd0a67b 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
@@ -33,11 +33,11 @@ register struct iovec *aoutvec; {
 
     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++;
     }
index ab18cd0089c54ea795026945ad1dc0eae60a775c..771a25a2dafe602ab2df3f5e1581dc0c3c4e06ed 100644 (file)
@@ -14,7 +14,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi_vget.c,v 1.1.1.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 */
@@ -37,7 +37,7 @@ int afs_osi_vget(struct vcache **avcpp, struct fid *afidp,
     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
index 95de075e58ad766c3de742114cd01996e827a8a2..bfeed8ef7908434108c3e248ba486af821aabb13 100644 (file)
@@ -10,7 +10,7 @@
 #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*/
@@ -174,7 +174,7 @@ retry:
     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 {
@@ -446,8 +446,8 @@ int osi_dnlc_purge()
   }
   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];
@@ -475,13 +475,13 @@ int osi_dnlc_init()
 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];
index fbb19e0b554b52d3f2ebefe766a360be315f89fc..510c06ad7bf395f7239bcd6e194d9823f0b18af2 100644 (file)
@@ -13,7 +13,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_segments.c,v 1.1.1.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*/
@@ -237,7 +237,7 @@ afs_StoreAllSegments(avc, areq, sync)
     minj = 0 ; 
 
     do {
-      bzero ((char *)dcList, NCHUNKSATONCE * sizeof(struct dcache *));
+      memset((char *)dcList, 0, NCHUNKSATONCE * sizeof(struct dcache *));
       high = 0;
       moredata = FALSE;
 
@@ -448,7 +448,7 @@ afs_StoreAllSegments(avc, areq, sync)
  
                        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 */
index 1729981e8a420630eba911b908d09cbc49bbd2bf..e596e613ee2c07ce640e939c9cd060b80989ce2b 100644 (file)
@@ -32,7 +32,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_server.c,v 1.1.1.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 */
@@ -380,26 +380,22 @@ void afs_CountServers()
     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.
@@ -661,7 +657,7 @@ struct server *afs_FindServer (afs_int32 aserver, ushort aport,
        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;
        }
@@ -972,8 +968,8 @@ typedef struct ill_s {                      /**/
 #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
@@ -1004,12 +1000,12 @@ afsi_SetServerIPRank(sa, addr, subnetmask)
    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);
       }
    }
 }
@@ -1382,7 +1378,7 @@ struct server *afs_GetServer(afs_uint32 *aserverp, afs_int32 nservers,
        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]));
@@ -1423,7 +1419,7 @@ struct server *afs_GetServer(afs_uint32 *aserverp, afs_int32 nservers,
          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];
@@ -1471,7 +1467,7 @@ struct server *afs_GetServer(afs_uint32 *aserverp, afs_int32 nservers,
          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.
index cf494009261993396aa9031689799925e3d7fe92..537cf81227889c77084d2cd334b29555a6971f1c 100644 (file)
@@ -12,7 +12,7 @@
 #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*/
@@ -48,10 +48,9 @@ void afs_InitStats()
     /*
      * 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.
index 4949f4f357dd3b237d36c45a9b25a6e8a89811b2..81c08b7aaed255cbe17feec37d91696e65c479b0 100644 (file)
@@ -13,7 +13,7 @@
 #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 */
@@ -479,7 +479,7 @@ struct unixuser *afs_GetUser(auid, acell, locktype)
 #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) {
index 55339b2c6ec4eb62eac55dd8a725f856b6650c5c..b43be2bb9654158321cb8b975736a9fb1a5a5201 100644 (file)
@@ -38,7 +38,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_vcache.c,v 1.1.1.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*/
@@ -752,7 +752,7 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
 #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));
@@ -777,7 +777,7 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
 #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
@@ -851,10 +851,10 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
 #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");
@@ -974,8 +974,8 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
 #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);
 
@@ -2602,7 +2602,7 @@ void afs_vcacheInit(int astatSize)
 #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]);
index 3f7c1e6f3fd298442822c1d937aee6bca32d29ee..d197e58637ef443afdbf8b135d0259dd769f2725 100644 (file)
@@ -18,7 +18,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_volume.c,v 1.1.1.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 */
@@ -464,7 +464,7 @@ static struct volume *afs_SetupVolume(volid, aname, ve, tcell, agood, type, areq
        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 */
@@ -912,11 +912,11 @@ void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve,
                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);
index d82d4efe79141cdb3b0833465c5c0dc99ede2dc9..ed0509004cf6ff4040e2614751a4fa90ed97e3cd 100644 (file)
@@ -50,6 +50,7 @@ if kmodstat | grep -q openafs ; then
 :
 else
        echo "AFS kernel extensions failed to initialize. Skipping AFS startup."
+       exit 1
 fi
 
 #
index cbc7a90baf63334b76f897c841c41b16578ef122..b9547960b63bde509e4aa4eee5405e071a22c973 100644 (file)
   *               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
 
@@ -201,7 +202,7 @@ char fullpn_VolInfoFile[1024];              /*Full pathname of VOLINFOFILE*/
 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;
@@ -215,6 +216,7 @@ afs_int32 lookingForHomeCell;               /*Are we still looking for the home cell?*/
 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 */
@@ -241,6 +243,17 @@ int afsd_CloseSynch = 0;           /*Are closes synchronous or not? */
 #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?*/
@@ -403,6 +416,7 @@ int cs;
   *
   * 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
@@ -415,21 +429,23 @@ int cs;
   *    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);
@@ -453,6 +469,21 @@ int GetVFileNumber(fname)
        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
   *
@@ -462,6 +493,8 @@ int GetVFileNumber(fname)
   *
   * 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,
@@ -474,8 +507,81 @@ int GetVFileNumber(fname)
   *    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*/
@@ -490,6 +596,14 @@ int CreateCacheFile(fname)
               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",
@@ -505,7 +619,7 @@ int CreateCacheFile(fname)
   *
   * 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.
@@ -528,10 +642,14 @@ int CreateCacheFile(fname)
   *    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*/
@@ -541,36 +659,30 @@ int SweepAFSCache(vFilesFound)
     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
@@ -592,24 +704,87 @@ int SweepAFSCache(vFilesFound)
        }
 
        /*
-        * 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.
             */
@@ -630,55 +805,149 @@ int SweepAFSCache(vFilesFound)
        }
        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.
@@ -690,6 +959,61 @@ int SweepAFSCache(vFilesFound)
     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;
@@ -955,6 +1279,15 @@ mainproc(as, 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
@@ -984,7 +1317,7 @@ mainproc(as, arock)
 
     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);
        }
@@ -1088,8 +1421,8 @@ mainproc(as, arock)
      */
     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); 
@@ -1536,6 +1869,7 @@ char **argv; {
                | 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));
 }
 
index f67986a98bac2fc227f66a6f10b57115696b2b12..070765b66ff63a27cd7cdffc93a7a63c115a5b1f 100644 (file)
@@ -16,7 +16,7 @@
 #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>
@@ -319,7 +319,7 @@ char *name;
 #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
@@ -1507,7 +1507,7 @@ char *a_config_filename;
                        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;;
    }
@@ -1525,7 +1525,7 @@ char *a_config_filename;
                        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;;
    }
@@ -1710,8 +1710,7 @@ int a_newProbeCycle;      /* start of a new probe cycle ? */
    /* 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;
@@ -1722,23 +1721,14 @@ int a_newProbeCycle;    /* start of a new probe cycle ? */
    }
 
    /* 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 */
@@ -2198,8 +2188,7 @@ struct xstat_fs_ProbeResults *a_fsResults;
        /* 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.
@@ -2210,7 +2199,7 @@ struct xstat_fs_ProbeResults *a_fsResults;
        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++;
        }
 
@@ -2439,8 +2428,7 @@ int a_newProbeCycle;      /* start of new probe cycle ? */
    /* 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;
@@ -2452,25 +2440,16 @@ int a_newProbeCycle;    /* start of new probe cycle ? */
 
 
    /* 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 */
@@ -2953,8 +2932,7 @@ struct xstat_cm_ProbeResults *a_cmResults;
        /* 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.
@@ -2965,7 +2943,7 @@ struct xstat_cm_ProbeResults *a_cmResults;
        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++;
        }
 
@@ -3359,7 +3337,7 @@ init_print_buffers()
        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); 
@@ -3367,7 +3345,7 @@ init_print_buffers()
        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;
@@ -3394,7 +3372,7 @@ init_print_buffers()
        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); 
@@ -3402,7 +3380,7 @@ init_print_buffers()
        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;
@@ -3496,7 +3474,7 @@ afsmon_execute()
        return(-1);
    }
 
-   bzero(FSSktArray, FSsktbytes);
+   memset(FSSktArray, 0, FSsktbytes);
 
    /* Fill in the socket information for each fileserve        */
    
@@ -3510,7 +3488,7 @@ afsmon_execute()
           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*/
 
@@ -3567,7 +3545,7 @@ afsmon_execute()
        return(-1);
    }
 
-   bzero(CMSktArray, CMsktbytes);
+   memset(CMSktArray, 0, CMsktbytes);
 
    /* Fill in the socket information for each CM       */
    
@@ -3581,7 +3559,7 @@ afsmon_execute()
           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*/
 
index d427ae5300fccdef924d3f11efc0de36690ea347..ee7ef6fe755442e3767b725621945bf1277dfd03 100644 (file)
@@ -12,7 +12,7 @@
 #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"
 
@@ -473,10 +473,10 @@ int getTokenLen(char *buf)
     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:"
@@ -508,9 +508,9 @@ long getExpiration(char *buf)
   } 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:"
@@ -520,6 +520,6 @@ long getExpiration(char *buf)
   }
   
   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;
 }
index 7233e583d589870f4d66c0958b6286496a9ccabd..eda7e7c9f47d2d92bfa35fb97e2b01e2d7fd3f10 100644 (file)
@@ -376,17 +376,17 @@ static int setToken(char *tokenBuf, int tokenLen)
 #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
 
@@ -455,9 +455,9 @@ int authenticateUser(request_rec *r, char *defaultCell,
     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 */ 
     /* 
@@ -468,9 +468,9 @@ int authenticateUser(request_rec *r, char *defaultCell,
     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()));
@@ -503,9 +503,9 @@ int authenticateUser(request_rec *r, char *defaultCell,
                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",
@@ -773,7 +773,7 @@ static int geturi(request_rec *r, char *buf)
   afsassert(r);
   afsassert(buf);
 
-  bzero(buf, APACHEAFS_CELLNAME_MAX);
+  memset(buf, 0, APACHEAFS_CELLNAME_MAX);
   pos = strchr(r->uri,'/');
   if (pos != NULL) {
     pos++;
@@ -820,7 +820,7 @@ static int parseAuthName_int(request_rec *r, char *buf, char *msg)
   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, '<');
@@ -873,7 +873,7 @@ static int parseAuthName_int(request_rec *r, char *buf, char *msg)
       pos++;
       strcat(msg, pos);
       strcpy(buf, msg);
-      bzero(msg, 1024);
+      memset(msg, 0, 1024);
       parseAuthName_int(r, buf, msg);
       return 0;
     }
@@ -899,7 +899,7 @@ static int parseAuthName(request_rec *r, char *buf)
   afsassert(r);
   afsassert(buf);
 
-  bzero(msg, sizeof(msg));
+  memset(msg, 0, sizeof(msg));
 
   pos=strchr(buf,'<');
   while (pos != NULL) {
@@ -910,7 +910,7 @@ static int parseAuthName(request_rec *r, char *buf)
       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", 
index 2309120b191c69114327a88bc7ec2d439c936acc..aa12df4fcf2c30b21656ba7733ef7a014ed1f421 100644 (file)
@@ -74,17 +74,17 @@ flipPrimary(char *tokenBuf)
   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;
 }
@@ -222,21 +222,21 @@ void parseToken(char *buf)
   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 */
index c7a7d757d21d9055f4ed08f93f9075824a84e28d..ee6f0be2a404dc7ad3a950bc52f8ce46d91c1d0f 100644 (file)
@@ -87,7 +87,9 @@ char *mktemp(char *template);
 #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
 
@@ -96,7 +98,6 @@ typedef int rlim_t;
 #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
@@ -299,7 +300,7 @@ extern int strncasecmp(const char *,const char *,unsigned);
 /* 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();
@@ -335,7 +336,6 @@ extern char *crypt();
 #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
@@ -347,7 +347,6 @@ extern char *crypt();
 #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
@@ -364,7 +363,6 @@ extern char *crypt();
 #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
@@ -447,7 +445,6 @@ int initgroups (char *, int);
 #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
index cbb216145c03d8c66ad61e95a40bdfd459526b43..d12a44bb0c9f8a6aa5dd012722d63e12e59d2000 100644 (file)
@@ -141,7 +141,9 @@ char *mktemp(char *template);
 #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
@@ -151,7 +153,6 @@ typedef int rlim_t;
 #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
@@ -252,7 +253,7 @@ typedef int rlim_t;
 #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
@@ -446,7 +447,7 @@ extern int strncasecmp(const char *, const char *, unsigned);
 /* 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();
@@ -489,7 +490,6 @@ extern char *crypt();
 #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
@@ -513,7 +513,6 @@ extern char *crypt();
 #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
@@ -533,7 +532,6 @@ extern char *crypt();
 #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
@@ -653,7 +651,6 @@ typedef int rlim_t;
 #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
index 81f89068ab964757a20fbf8344685acebea9e60b..a33d5630dcc752b581898dfa19b01dfd7e93e889 100644 (file)
@@ -166,7 +166,9 @@ char *mktemp(char *template);
 #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
@@ -176,7 +178,6 @@ typedef int rlim_t;
 #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
@@ -277,7 +278,7 @@ typedef int rlim_t;
 #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
@@ -517,7 +518,7 @@ extern int strncasecmp(const char *, const char *, unsigned);
 /* 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();
@@ -560,7 +561,6 @@ extern char *crypt();
 #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
@@ -589,7 +589,6 @@ extern char *crypt();
 #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
@@ -613,7 +612,6 @@ extern char *crypt();
 #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
@@ -737,7 +735,6 @@ typedef int rlim_t;
 #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
index c7a7d757d21d9055f4ed08f93f9075824a84e28d..ee6f0be2a404dc7ad3a950bc52f8ce46d91c1d0f 100644 (file)
@@ -87,7 +87,9 @@ char *mktemp(char *template);
 #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
 
@@ -96,7 +98,6 @@ typedef int rlim_t;
 #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
@@ -299,7 +300,7 @@ extern int strncasecmp(const char *,const char *,unsigned);
 /* 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();
@@ -335,7 +336,6 @@ extern char *crypt();
 #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
@@ -347,7 +347,6 @@ extern char *crypt();
 #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
@@ -364,7 +363,6 @@ extern char *crypt();
 #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
@@ -447,7 +445,6 @@ int initgroups (char *, int);
 #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
index cacd88c3b289b3db252e41ebf037345d652f241f..3702e2fa2157d5d21ac22ae73809989a45f04521 100644 (file)
@@ -24,7 +24,7 @@
 #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>
@@ -338,7 +338,7 @@ static int store_afs_token(unix_id, realm_p, tkt_type, ticket_p, ticket_len,
 
     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) {
@@ -346,7 +346,7 @@ static int store_afs_token(unix_id, realm_p, tkt_type, ticket_p, ticket_len,
                "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, "");
@@ -370,7 +370,7 @@ static char *make_string(s_p, length)
        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;
 }
@@ -493,7 +493,7 @@ static int decode_reply(buf, buflen, reply_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;
@@ -710,7 +710,7 @@ static int getDFScreds(char *name, char *realm, char *passwd,
   des_string_to_key(passwd, passwd_key);
 
   /* Destroy the password. */
-   bzero(passwd, strlen(passwd));
+   memset(passwd, 0, strlen(passwd));
 
 
    /*
@@ -731,8 +731,8 @@ static int getDFScreds(char *name, char *realm, char *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));
 
 
    /*
@@ -811,7 +811,7 @@ CommandProc (as, arock)
   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 */
index 984bf74a173fafd46c81227e7b595d674fbfdf3b..60f9108f14ac45cb46810956d9adc748c1aa3c5a 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -94,10 +94,10 @@ static aixmakebuf (audEvent, vaList)
       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;
@@ -113,13 +113,13 @@ static aixmakebuf (audEvent, vaList)
          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;
index cc00297ac71bf3dda588d028940fa6c93e3ec4f5..666b2769d65538c6665f28d888aea7219f51acfe 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/auth/cellconfig.c,v 1.1.1.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>
@@ -224,7 +224,7 @@ register char *adir; {
     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);
 
@@ -401,7 +401,7 @@ char clones[];
                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);
@@ -781,7 +781,7 @@ register struct afsconf_dir *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;
 }
@@ -858,7 +858,7 @@ struct afsconf_keys *astr;
     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;
 }
@@ -892,7 +892,7 @@ afs_int32 afsconf_GetLatestKey(adir, avno, akey)
        }
     }
     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;
@@ -919,7 +919,7 @@ char *akey;
 
     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;
        }
@@ -938,7 +938,7 @@ struct afsconf_dir *adir;
     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++ )
@@ -996,7 +996,7 @@ char akey[8];
        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
@@ -1032,7 +1032,7 @@ afs_int32 akvno;
     /* 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);
index 153dba2f3880bcd97c2a7555d2e8e1ec31419a76..595337508feb4d1f31fbfa01c03f43550786486a 100644 (file)
@@ -16,7 +16,7 @@
 #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"
@@ -275,7 +275,7 @@ afs_int32 flags;
                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;
@@ -284,13 +284,13 @@ afs_int32 flags;
     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;
@@ -326,9 +326,9 @@ not_vice_id:
 #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 */
@@ -344,7 +344,7 @@ not_vice_id:
     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 */
@@ -478,7 +478,7 @@ struct ktc_token *atoken; {
                (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
@@ -508,7 +508,7 @@ struct ktc_token *atoken; {
  
                    if (aclient)
                        strcpy(aclient->cell, lcell);
-                   bcopy(&ctoken, atoken,
+                   memcpy(atoken, &ctoken, 
                          min (atokenLen, sizeof(struct ktc_token)));
                    
                    afs_tf_close();
@@ -762,10 +762,10 @@ struct ktc_principal *aserver; {
     /* 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;
@@ -1164,7 +1164,7 @@ afs_tf_close()
        (void) close(fd);
        fd = -1;                /* see declaration of fd above */
     }
-    bzero(tfbfr, sizeof(tfbfr));
+    memset(tfbfr, 0, sizeof(tfbfr));
 }
 
 /*
@@ -1446,7 +1446,7 @@ afs_tf_create(pname,pinst)
        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)) {
@@ -1517,7 +1517,7 @@ afs_tf_dest_tkt()
     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) {
index e55ca8f6515ae09c16fcd48b2124e97028937bad..b9b4e0998d6b08316f59908104b7abd3b3c39931 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -20,11 +20,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/setkey.c,v 1.1.1.4 2001/07/14 22:2
 #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
@@ -77,7 +77,7 @@ char **argv; {
          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;
 
@@ -115,7 +115,7 @@ char **argv; {
            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];
index 42496a6b11a0403f73f76f5aa30aac4782e7cf3c..b113ef9204e97edd9c36b791ff06c2c4cbc6e046 100644 (file)
@@ -25,7 +25,7 @@ Creation date:
 #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>
@@ -48,7 +48,7 @@ struct afsconf_dir *adir; {
 
     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;
index 839181723bf9523bb7e11266c53df999720f7194..f83de614027d90276af8701bf323ffdf4a7a2337 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -51,7 +51,7 @@ register struct afsconf_cell *aci; {
                        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 */
        }
index cf83adce4477225d39c1c727bd16e2556729cbcb..d9ba4c0307754ebb7f695bc046917a257994e904 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bnode.c,v 1.1.1.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>
@@ -281,7 +281,7 @@ struct bnode_ops *aprocs; {
     }
     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;
@@ -425,7 +425,7 @@ struct bnode_ops *abnodeops; {
     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);
@@ -733,13 +733,13 @@ int bnode_Init() {
 
     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;
@@ -831,7 +831,7 @@ char *aexecString; {
     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;
index 17a9ab7aeff5f42bc8dcb6d4c8b92c6363f0fa80..c9ac6d37f4041c79dedc7677f0d81a424f7a4740 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -178,7 +178,7 @@ struct cmd_syndesc *as; {
        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);
@@ -289,7 +289,7 @@ afs_int32 alen; {
     register char *tp;
 
     strcpy(aresult, adir);
-    tp = rindex(aname, '/');
+    tp = strrchr(aname, '/');
     if (!tp) {
        /* no '/' in name */
        strcat(aresult, "/");
@@ -785,7 +785,7 @@ register struct cmd_syndesc *as; {
     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);
@@ -1350,7 +1350,7 @@ struct cmd_syndesc *as; {
     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);
index b2e2bdfb5dadd4bc60c8b0605f6c65da7fb915ee..1a74ad8481b9e5116703cdb00a2dfa20fa1ee04b 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -60,11 +60,11 @@ struct ktime *aktime; {
     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:
@@ -92,11 +92,11 @@ struct ktime *aktime; {
     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:
@@ -472,8 +472,8 @@ char *aname; {
       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:
@@ -534,7 +534,7 @@ char *aname; {
        }
     }
 
-    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);
 
@@ -572,7 +572,7 @@ struct bozo_key *akey;
       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);
@@ -581,9 +581,9 @@ struct bozo_key *akey;
      */
 
     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) {
@@ -1281,7 +1281,7 @@ BOZO_GetInstanceInfo(acall, ainstance, atype, astatus)
        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;
@@ -1316,7 +1316,7 @@ char **aparm; {
     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 */
index d5f9bc22ecca67e83644c69f70fafffc6083b512..fe4255429ca8c44be2e7256c1f7ef2f9a8de7bf3 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosserver.c,v 1.1.1.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>
@@ -866,7 +866,7 @@ char **envp;
            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);
index f0fc2d2c639027ded8214cf6b27c3173a6f7b9a3..a3b30926b20970ddb78ac68689a90930a7f47559 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -151,7 +151,7 @@ char *acommand; {
     }
 
     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);
index 4287742e905854fe8c504100170a313f2b4a8df2..2c5272f06e16f67bf8229d97bbb427a04aa58cd3 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -91,7 +91,7 @@ char *acommand; {
     }
 
     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;
index ac8c935d648541ebc09f0faf726c9c08dd6e218b..ed47e073de9059337d77eadcde661999989b7c90 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -342,7 +342,7 @@ char *ascancmd; {
     }
 
     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;
index fdeb63a1bcc00211be4f2a51517e9004c11aaa80..e9d6af944e5319d237c183dba6faff5cb99453e2 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -58,7 +58,7 @@ main(argc, argv)
     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);
@@ -280,7 +280,7 @@ dataBlock(usd_handle_t hTape, afs_int32 reqSize)
        if ( dB_buffer == 0 )
            ERROR(-1);
        dB_buffersize = reqSize;
-       bzero(dB_buffer, dB_buffersize);
+       memset(dB_buffer, 0, dB_buffersize);
     }
 
     ptr = (int *) dB_buffer;
index 5107e25b0f3d83538b24af11c6f17ddb01e4c2d0..56828f378e153e9f2d4f78402311806a9b952fd9 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -133,7 +133,7 @@ cmdDispatch()
 
 statusWatcher()
 {
-    struct rx_connection *tconn = (struct rc_connection *)0;
+     struct rx_connection *tconn = (struct rc_connection *)0;
     statusP curPollPtr = 0;
 
     struct tciStatusS statusPtr;
index ccf1e6b4ba5ef2c6f53414d1e7426cfb1bad08ba..ca1183832e2ff97106b74eedc046e91f39a79871 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -125,7 +125,7 @@ afs_int32 getSPEntries(server, partition, serverlist, ss, ps)
         *ss = 0;
         return(BC_NOMEM);
       }
-      bzero(*ss, sizeof(struct serversort));
+      memset(*ss, 0, sizeof(struct serversort));
       (*ss)->ipaddr = server;
       (*ss)->next = *serverlist;
       *serverlist = *ss;
@@ -148,7 +148,7 @@ afs_int32 getSPEntries(server, partition, serverlist, ss, ps)
         *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;
@@ -305,7 +305,7 @@ int EvalVolumeSet2(aconfig, avs, avols, uclient)
                 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)) {
@@ -428,7 +428,7 @@ int EvalVolumeSet1(aconfig, avs, avols, uclient)
      */
     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*/
@@ -551,7 +551,7 @@ int EvalVolumeSet1(aconfig, avs, avols, uclient)
                    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)) 
@@ -1044,7 +1044,7 @@ bc_KillCmd(as, arock)
 
 
     tp = as->parms[0].items->data;
-    if (index(tp, '.') == 0) 
+    if (strchr(tp, '.') == 0) 
     {
        slot = bc_SafeATOI(tp);
        if (slot == -1) 
@@ -1181,7 +1181,7 @@ bc_VolRestoreCmd(as, arock)
            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)
@@ -1301,8 +1301,8 @@ char *arock; {
     }
 
     /* 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;
@@ -1331,7 +1331,7 @@ char *arock; {
        }
     }
     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) 
@@ -1515,7 +1515,7 @@ bc_VolsetRestoreCmd (as, arock)
 
            /* 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)
@@ -1524,7 +1524,7 @@ bc_VolsetRestoreCmd (as, arock)
                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 */
@@ -1904,7 +1904,7 @@ int bc_DumpCmd(as, arock)
               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 */
@@ -2763,7 +2763,7 @@ DBLookupByVolume(volumeName)
               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);
@@ -2925,7 +2925,7 @@ dumpInfo(dumpid, detailFlag)
            ERROR(BC_NOMEM);
        }
 
-       bzero(tapeLinkPtr, sizeof(*tapeLinkPtr));
+       memset(tapeLinkPtr, 0, sizeof(*tapeLinkPtr));
        code = bcdb_FindTapeSeq(dumpid, tapeNumber, &tapeLinkPtr->tapeEntry);
        if (code)
        {
@@ -2987,10 +2987,9 @@ dumpInfo(dumpid, detailFlag)
                    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) &&
index 62c7811d89082b68ceb44ce2bae83e2ce0ae6ffb..873273855c48a5d1128f857a21cf529bb9076af1 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -72,7 +72,7 @@ bc_InitConfig(apath)
     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) 
     {
@@ -108,13 +108,13 @@ char *aname; {
 
     /* 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;
index dddba03507d96a2d05b1d45cc0c8f55bc29fa2f8..ca8480ea6adb830962df3f7aabb8fa59812c360f 100644 (file)
@@ -14,7 +14,7 @@
 #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>
@@ -177,7 +177,7 @@ tailCompPtr(pathNamePtr)
      char *pathNamePtr;
 {
     char *ptr;
-    ptr = rindex(pathNamePtr, '/');
+    ptr = strrchr(pathNamePtr, '/');
     if ( ptr == 0 )
     {
        /* this should never happen */
index a0c9885bee815ceb7fa882311641b9d2a4aa0cba..e27c84ab0d000fb5b7d0c550dfce866a6cf0bfcc 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -154,9 +154,9 @@ int bc_ParseHost(aname, asockaddr)
        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);
     }
 
@@ -166,7 +166,7 @@ int bc_ParseHost(aname, asockaddr)
      */
 
     if (strcmp(aname, ".*") == 0) {
-       bzero(asockaddr, sizeof(struct sockaddr_in));
+       memset(asockaddr, 0, sizeof(struct sockaddr_in));
        return 0;
     }
 
@@ -182,10 +182,9 @@ int bc_ParseHost(aname, asockaddr)
      */
     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*/
@@ -203,7 +202,7 @@ bc_CreateVolumeSet(aconfig, avolName, aflags)
     /* 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);
@@ -314,7 +313,7 @@ bc_AddVolumeItem(aconfig, avolName, ahost, apart, avol)
     /* 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);
@@ -381,7 +380,7 @@ afs_int32   expType;
        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;
@@ -568,7 +567,7 @@ FindDump(aconfig, nodeString, parentptr, nodeptr)
 
     matchLength = 0;
     curptr = &nodeString[1];                           /* past first / */
-    separator = index(curptr, '/');
+    separator = strchr(curptr, '/');
     if ( separator == 0 )
        matchLength = strlen(curptr) + 1;               /* +1 for leading / */
     else
@@ -613,7 +612,7 @@ FindDump(aconfig, nodeString, parentptr, nodeptr)
            return(-3);
        }
        
-       separator = index(curptr, '/');
+       separator = strchr(curptr, '/');
        if ( separator == 0 )
                matchLength = strlen(&nodeString[0]);
        else
index 857f0d9f697cc1f8902fa9ab3b1df28a182425e6..14da3ad4214ae2db3c979149be61e1bcb1df9d24 100644 (file)
@@ -14,7 +14,7 @@
 #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>
@@ -120,7 +120,7 @@ bc_Dumper(aindex)
     baseNamePtr = tailCompPtr(dumpTaskPtr->dumpName);
 
     /* setup the interface structure */
-    bzero(tcdiPtr, sizeof(*tcdiPtr));
+    memset(tcdiPtr, 0, sizeof(*tcdiPtr));
 
     /* general */
     strcpy(tcdiPtr->dumpPath, dumpTaskPtr->dumpName);
@@ -273,7 +273,7 @@ bc_StartDmpRst(aconfig, adname, avname, avolsToDump, adestServer, adestPartition
        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;
@@ -298,9 +298,9 @@ bc_StartDmpRst(aconfig, adname, avname, avolsToDump, adestServer, adestPartition
        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)
@@ -373,7 +373,7 @@ afs_int32 size;
     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)
@@ -421,7 +421,7 @@ bc_ReadLabel(config,port)
     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) {
index 5f7c2bd54c1c32a3073d1e327ba79c4a2f124cc3..c34dd148a719eded2adadae787c7a553895fc991 100644 (file)
@@ -16,7 +16,7 @@
 #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>
@@ -394,7 +394,7 @@ bc_ParseDumpSchedule()
            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);
index 7b0519752ef14b4bce32d1454603160e2d4af863..ec88863782a8d7ed31ee5edfa646ec78471d69cd 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -63,7 +63,7 @@ LongTo_ktimeRelDate(longDate, kdptr)
      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 )
@@ -264,7 +264,7 @@ ParseRelDate(dateStr, relDatePtr)
     afs_int32 value, digit_limit;
     afs_int32 type_index;
 
-    bzero(relDatePtr, sizeof(*relDatePtr));
+    memset(relDatePtr, 0, sizeof(*relDatePtr));
     type_index = 0;
 
     while ( 1 )
index 3cdefd9310bb53f553f14b6bac6190f6deaa3e1d..8871b9a50a849775459e2aeba94db95233b24c76 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -195,7 +195,7 @@ bc_InitTextConfig()
 
     for ( i = 0; i < TB_NUM; i++ )
     {
-       bzero(ctPtr, sizeof(*ctPtr));
+       memset(ctPtr, 0, sizeof(*ctPtr));
        ctPtr->textType = i;
        ctPtr->textVersion = -1;
        ctPtr++;
index 908fef59c1168a85704e1c1738cfc1a2a16c579e..38746f4c245d444d1a2dca98c8bf0d9220cbcc6b 100644 (file)
@@ -14,7 +14,7 @@
 #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>
@@ -44,10 +44,6 @@ extern void bc_HandleMisc();
 extern char *whoami;
 extern struct rx_connection *bc_GetConn();
 
-#ifdef AFS_SGI64_ENV
-extern char *rindex();
-#endif
-
 #define        BC_MAXLEVELS        20
 #define        MAXTAPESATONCE      10
 
@@ -139,7 +135,7 @@ extractTapeSeq(tapename)
 {
     char *sptr;
 
-    sptr = rindex(tapename, '.');
+    sptr = strrchr(tapename, '.');
     if ( !sptr ) return(-1);
     sptr++;
     return(atol(sptr));
@@ -277,7 +273,7 @@ bc_Restorer(aindex)
                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;
@@ -303,7 +299,7 @@ bc_Restorer(aindex)
            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)
@@ -337,7 +333,7 @@ bc_Restorer(aindex)
     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++)
        {
@@ -479,7 +475,7 @@ bc_Restorer(aindex)
                                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)
@@ -531,7 +527,7 @@ bc_Restorer(aindex)
                                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)
@@ -630,7 +626,7 @@ bc_Restorer(aindex)
         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;
index 71897687d1b6c1a9c510acf77a209ec66a4fcf3f..884bba1fc73d635d5606ed3cad839e331cfc609a 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -100,7 +100,7 @@ createStatusNode()
     {
        return(0);
     }
-    bzero(ptr, sizeof(*ptr));
+    memset(ptr, 0, sizeof(*ptr));
 
     /* link it onto the chain of status entries */
     ObtainWriteLock(&statusQueueLock);
index f51fe9614598c94958d5e34538256d010758b99a..ea9163d84a8634e90e576e7ed9b8a2aa11e2ba61 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -269,7 +269,7 @@ int bc_ParseHosts()
        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;
@@ -284,7 +284,7 @@ int bc_ParseHosts()
        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;
        }
index 3b1dc84a3197d901d9b006c4a9ad9861286a9a5f..e39495d931e8531a3154ce05348e0560a1936ee9 100644 (file)
@@ -87,7 +87,7 @@ afs_int32 *adumpID; {
     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, ".");
@@ -111,7 +111,7 @@ afs_int32 *adumpID; {
     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 */
@@ -126,10 +126,10 @@ afs_int32 *adumpID; {
 
     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 */
@@ -174,7 +174,7 @@ afs_int32 *adumpID; {
     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);
index c733151f23530c66b5b0c8a8cb9dc0380dd343a7..36da12dc760522003627a84e125af720c2fcc385 100644 (file)
@@ -12,7 +12,7 @@
 #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>
@@ -234,7 +234,7 @@ bcdb_FindDumpByID(dumpID, deptr)
        goto error;
     }
 
-    bcopy(dl.budb_dumpList_val, deptr, sizeof(*deptr));
+    memcpy(deptr, dl.budb_dumpList_val, sizeof(*deptr));
 
 exit:
     if ( dl.budb_dumpList_val )
@@ -245,7 +245,7 @@ exit:
     return(code);
 
 error:
-    bzero(deptr, sizeof(*deptr));
+    memset(deptr, 0, sizeof(*deptr));
     goto exit;
 }
 
@@ -327,7 +327,7 @@ bcdb_FindTape(dumpid, tapeName, teptr)
     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;
 
@@ -341,7 +341,7 @@ bcdb_FindTape(dumpid, tapeName, teptr)
     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 )
@@ -359,7 +359,7 @@ bcdb_FindTapeSeq(dumpid, tapeSeq, teptr)
     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;
 
@@ -372,7 +372,7 @@ bcdb_FindTapeSeq(dumpid, tapeSeq, teptr)
     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 )
@@ -1191,14 +1191,14 @@ ubik_Call_SingleServer(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p
            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);
        }
     }
index 30f4406e7e75d5205225bc3e24fa9c30c603b038..2a495edc5012b5d0c37d1140686ff64b5a183f53 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -496,7 +496,7 @@ bc_ParseVolumeSet()
             * 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);
 
@@ -531,7 +531,7 @@ bc_ParseVolumeSet()
                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);
 
index 97a1ac3672defa288e1ab934a6534853d24217cb..b4f4904adc8b60d67d6d7a03e43b848b0c0ab942 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -44,7 +44,7 @@ afs_int32 InitDB ()
 
     pollCount = 0;
 
-    bzero (&db, sizeof(db));
+    memset(&db, 0, sizeof(db));
     Lock_Init (&db.lock);
     if ((code = InitDBalloc ()) || (code = InitDBhash ())) 
         return code;
@@ -225,7 +225,7 @@ CheckInit (ut, db_init)
                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));
index c1f667ff4732a2f6143040e39170b966dd9d95f2..49b453d9e0ef4a2dd0a89fa17d99d648acbca7c9 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -84,7 +84,7 @@ AllocBlock (ut, block, aP)
     }
 
     /* clear and return the block */
-    bzero (block, sizeof(*block));
+    memset(block, 0, sizeof(*block));
     *aP = a;
     return 0;
 }
@@ -103,7 +103,7 @@ FreeBlock (ut, bh, a)
   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;
index 09a62f6803a650e4e6799d89d44465cc78dc0bc2..ab1393b3bb48ff5a2649799a10f002931c3ef7c3 100644 (file)
@@ -15,7 +15,7 @@
 #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>
@@ -620,7 +620,7 @@ writeDatabase(ut, fid)
                    /* 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)) {
index acea7c2647d8f434f15689d2e1d98cc270ecf861..ef5c4f88aec1be27a439b765f34dfe7fa724b77c 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -159,7 +159,7 @@ afs_int32 ht_AllocTable (ut, mht)
 
     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));
@@ -265,7 +265,7 @@ ht_GetTableBlock (ut, mht, hash, old, blockP, boP)
     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");
index 8ed6a4f462d188d9f20f3a61733825da77e02b9c..74890c3e945050a98e80c1ed02f79a9b5d181c12 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -172,7 +172,7 @@ afs_int32 GetText (call, lockHandle, textType, maxLength, offset,
        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); */
 
@@ -400,7 +400,7 @@ afs_int32 SaveText (call, lockHandle, textType, offset, flags, charListPtr)
        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); */
 
index 2ba92f86367d4df7fb03590f249809a562c81489..a84676567daa252a1fe78dcb86f2b1a943d15033 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -143,7 +143,7 @@ afs_int32 DumpDB (call, firstcall, maxLength, charListPtr, done)
        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 */
@@ -320,7 +320,7 @@ dumpWatcher()
                if (code) LogError(code, "Aborting dump transaction\n");
            }
 
-           bzero(dumpSyncPtr, sizeof(*dumpSyncPtr));
+           memset(dumpSyncPtr, 0, sizeof(*dumpSyncPtr));
            goto exit;
        } /*i*/
 
index f9e09a66fcc6082ebf12b22e1d903b084075d4ae..4cddfb2f9fdd04a435d6abc2f0f8c10a3de49a71 100644 (file)
@@ -12,7 +12,7 @@
 #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
@@ -723,12 +723,12 @@ verifyBlocks(ut)
        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;
     }
 
@@ -1276,7 +1276,7 @@ verifyDatabase(ut, recreateFile)
 
     /* clear verification statistics */
     misc = &miscData;
-    bzero (&miscData, sizeof(miscData));
+    memset(&miscData, 0, sizeof(miscData));
 
 #ifdef PDEBUG
     miscData.maxErrors = 1000000;
@@ -1309,7 +1309,7 @@ verifyDatabase(ut, recreateFile)
     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");
@@ -1462,7 +1462,7 @@ error_exit:
     if (!th) *host = 0;
     else
     {
-       bcopy(th->h_addr, host, sizeof(afs_int32));
+       memcpy(host, th->h_addr, sizeof(afs_int32));
        *host = ntohl(*host);
     }
 
index e6944caac9498687842788cd422624b73f9bfebf..6506fbdcf6510eb39c4cc9d81b1a9a47da324854 100644 (file)
@@ -16,7 +16,7 @@
 #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>
@@ -123,7 +123,7 @@ tailCompPtr(pathNamePtr)
      char *pathNamePtr;
 {
     char *ptr;
-    ptr = rindex(pathNamePtr, '/');
+    ptr = strrchr(pathNamePtr, '/');
     if ( ptr == 0 )
     {
         /* this should never happen */
@@ -516,7 +516,7 @@ SendReturnList (ut, list, FillProc, e_size, index, nextIndexP, dbTimeP, eList)
        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);
@@ -707,7 +707,7 @@ static afs_int32 GetVolInfo (ut, volP, viaP, viP)
     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))
@@ -998,7 +998,7 @@ rememberDump(dumpAddrParam, dumpParam,  dumpListPtrParam)
     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);    
 
@@ -1385,7 +1385,7 @@ afs_int32 CreateDump(call, dump)
     }
            
     /* 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);
 
@@ -2040,7 +2040,7 @@ afs_int32 FindLatestDump (call, vsname, dumpPath, dumpentry)
         /* 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;
@@ -2450,7 +2450,7 @@ afs_int32 GetDumps (call, majorVersion, flags, name, start, end,
        /* 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);
@@ -2737,7 +2737,7 @@ afs_int32 FindLastTape (call, dumpID, dumpEntry, tapeEntry, volEntry)
 
      /* 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));
@@ -3138,7 +3138,7 @@ afs_int32 UseTape (call, tape, new)
 
     *new = 0;
 
-    bzero (&t, sizeof(t));
+    memset(&t, 0, sizeof(t));
     eval = AllocStructure (ut, tape_BLOCK, 0, &a, &t);
     if (eval) ABORT(eval);
 
index c083b4e9f74ff9c3a68a043109c52b633720da11..9b6dc1a85e507f6d56de0b4156284dd9ea8be64d 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -94,7 +94,7 @@ convert_cell_to_ubik (cellinfo, myHost, serverList)
        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 */
@@ -351,7 +351,7 @@ main(argc, argv)
        exit(2);
     }
 
-    bzero(globalConfPtr, sizeof(*globalConfPtr));
+    memset(globalConfPtr, 0, sizeof(*globalConfPtr));
 
     /* set default configuration values */
     strcpy(dbDir, AFSDIR_SERVER_DB_DIRPATH);
@@ -494,7 +494,7 @@ main(argc, argv)
     /* 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 */
index eadb34e46b1d8072f9990c56de857a93f1efdf64..17b2252a1b4920b422c1d51f6fc1f7e72b57b2a7 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -547,7 +547,7 @@ dumpToBudbDump(dumpPtr, budbDumpPtr)
     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);
 }
@@ -611,7 +611,7 @@ default_tapeset(tapesetPtr, dumpname)
      struct budb_tapeSet *tapesetPtr;
      char *dumpname;
 {
-    bzero(tapesetPtr, sizeof(*tapesetPtr));
+    memset(tapesetPtr, 0, sizeof(*tapesetPtr));
 
     strcpy(tapesetPtr->format, dumpname);
     strcat(tapesetPtr->format, ".%d");
index 34282be71e6b7da03885d5ce666637e4b1e065cf..9f46236655732fd24e72bd640db6937dedd9dd7a 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -75,7 +75,7 @@ afs_int32 threadEntryDir(anEntry, size, type)
     entryPtr->dlq_type      = type;
     entryPtr->dlq_structPtr = entry;
 
-    bcopy (anEntry, entry, size);
+    memcpy(entry, anEntry, size);
     dlqLinkb (&entries_to_flush, entryPtr);
     return(0);
 }
@@ -119,7 +119,7 @@ threadEntry(anEntry, size, type)
     entryPtr->dlq_type      = type;
     entryPtr->dlq_structPtr = entry;
 
-    bcopy (anEntry, entry, size);
+    memcpy(entry, anEntry, size);
     dlqLinkb (&savedEntries, (dlqlinkP)entryPtr);
     return(0);
 }
@@ -164,7 +164,7 @@ afs_int32 useTape (aTapeEntryPtr, dumpID, tapename, tapeSeq, useCount, written,
 {
     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 */
@@ -221,7 +221,7 @@ afs_int32 addVolume(aVolEntryPtr, dumpID, tapename, volname, volid, cloneDate,
        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;
@@ -417,7 +417,7 @@ dbWatcher()
                        break;
                     }
 
-                    bcopy(volPtr, &volumes[c], sizeof(struct budb_volumeEntry));
+                    memcpy(&volumes[c], volPtr, sizeof(struct budb_volumeEntry));
                     free(volPtr);
                     free(entryPtr);
                     entryPtr = (dlqlinkP)0;
index 498a8f1d307ca756894fb625e9483f1133a7361a..ee163d52abd4bfe186ac1665d9bc5b844e472b8d 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -106,7 +106,7 @@ localtime_r(t, tm)
    time_t *t;
    struct tm *tm;
 {
-   bcopy(localtime(t), tm, sizeof(struct tm));
+   memcpy(tm, localtime(t), sizeof(struct tm));
 }
 #endif
 
@@ -910,7 +910,7 @@ dumpPass(dparamsPtr, passNumber)
            }
 
            /* 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;
@@ -1124,7 +1124,7 @@ Dumper(nodePtr)
     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);
@@ -1180,7 +1180,7 @@ Dumper(nodePtr)
          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 */
@@ -1535,7 +1535,7 @@ getDumpTape(dparamsPtr, interactiveFlag, append)
              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 */
@@ -1689,8 +1689,8 @@ getDumpTape(dparamsPtr, interactiveFlag, append)
                 */
                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);
@@ -1831,7 +1831,7 @@ makeVolumeHeader(vhptr, dparamsPtr, fragmentNumber)
 
     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;
@@ -1876,7 +1876,7 @@ volumeHeader_hton(hostPtr, netPtr)
     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 */
@@ -1890,7 +1890,7 @@ createDump(dparamsPtr)
     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;
index 3c8672254af813946a1c4447b44538669376ebcf..1106f65deb0f3ea1b1a5c94e5aeddf29b45acb09 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -74,7 +74,7 @@ struct dumpNode **newNode;
     /* 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;
index 0f3a9297ac583b9981e4f7f959e8e1667a862d4b..d20a11780719261e4637a1fb99c29fcf7f55842f 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -102,7 +102,7 @@ struct restoreParams
                magic == TC_VOLENDMAGIC ||                              \
                magic == TC_VOLCONTD )                 {                \
                                                                        \
-               bcopy (&vhptr, header, sizeof(struct volumeHeader));    \
+               memcpy(header, &vhptr, sizeof(struct volumeHeader));    \
                return (0);                                             \
            } /* magic */                                               \
        } /* versionflags */                                            \
@@ -838,7 +838,7 @@ VolHeaderToHost(hostVolHeader, tapeVolHeader)
     {
         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:
@@ -1110,7 +1110,7 @@ afs_int32 xbsaRestoreVolumeData(call, rparamsPtr)
             }
             /* 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) {
@@ -1125,7 +1125,7 @@ afs_int32 xbsaRestoreVolumeData(call, rparamsPtr)
          }
          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;
          }
@@ -1141,10 +1141,10 @@ afs_int32 xbsaRestoreVolumeData(call, rparamsPtr)
             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;
          }
@@ -1681,7 +1681,7 @@ Restorer (newNode)
     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);
@@ -1694,7 +1694,7 @@ Restorer (newNode)
 
     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 */
@@ -1711,7 +1711,7 @@ Restorer (newNode)
     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++) {
@@ -1846,7 +1846,7 @@ GetNewLabel(tapeInfoPtr, pName, AFSName, tapeLabel)
     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);
@@ -1955,9 +1955,9 @@ FindVolTrailer2(buffera, sizea, dataSizea, bufferb, sizeb, dataSizeb, volTrailer
            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) {
@@ -2152,7 +2152,7 @@ Labeller (labelIfPtr)
      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) 
@@ -2245,7 +2245,7 @@ struct tc_tapeLabel *label;
     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)
@@ -2253,7 +2253,7 @@ struct tc_tapeLabel *label;
        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;
 
@@ -2354,20 +2354,20 @@ readVolumeHeader (buffer, bufloc, header)
         (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);
 
     }
index 62bea3da796126da24eac80c5faf9e60b25fcc1e..5cb247fde399b6138b3aa96da209e40187096a1d 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -139,7 +139,7 @@ readDumps(taskId, tapeInfoPtr, scanInfoPtr)
 {
     afs_int32 code, c;
 
-    bcopy(&scanInfoPtr->tapeLabel, &scanInfoPtr->dumpLabel, sizeof(struct butm_tapeLabel));
+    memcpy(&scanInfoPtr->dumpLabel, &scanInfoPtr->tapeLabel, sizeof(struct butm_tapeLabel));
 
     while(1)
     {
@@ -280,10 +280,10 @@ ScanDumps(ptr)
     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)
@@ -359,7 +359,7 @@ scanVolData(taskId, curTapePtr, tapeVersion, volumeHeader, volumeTrailer, bytesR
     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);
@@ -488,7 +488,7 @@ nextTapeLabel(prevTapeName)
 
     /* extract information from previous tape label */
     strcpy(buffer, prevTapeName);
-    prevdot = rindex(buffer, '.');
+    prevdot = strrchr(buffer, '.');
     if (!prevdot) return(retval);
     prevdot++;
 
@@ -800,11 +800,11 @@ validatePath(labelptr, pathptr)
 
     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");
@@ -839,7 +839,7 @@ volumesetNamePtr(ptr)
     char *dotPtr;
     int dotIndex;
 
-    dotPtr = index(ptr, '.');
+    dotPtr = strchr(ptr, '.');
     if ( !dotPtr ) return(0);
 
     dotIndex = dotPtr - ptr;
@@ -859,7 +859,7 @@ extractDumpName(ptr)
     char *dotPtr;
     int dotIndex;
 
-    dotPtr = rindex(ptr, '.');
+    dotPtr = strrchr(ptr, '.');
     if (!dotPtr) return(0);
 
     dotIndex = dotPtr - ptr;
@@ -887,7 +887,7 @@ extractTapeSeq(tapename)
 {
     char *sptr;
 
-    sptr = rindex(tapename, '.');
+    sptr = strrchr(tapename, '.');
     if ( !sptr ) return(-1);
     sptr++;
     return(atol(sptr));
@@ -903,7 +903,7 @@ int databaseTape(tapeName)
     char *sptr;
     int  c;
 
-    sptr = rindex(tapeName, '.');
+    sptr = strrchr(tapeName, '.');
     if ( !sptr ) return(0);
     
     c = (int)( (afs_int32)sptr - (afs_int32)tapeName );
@@ -922,7 +922,7 @@ afs_int32 RcreateDump(tapeScanInfoPtr, volHeaderPtr)
     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;
index 023c46e09447bba0f7051f95b9020e1f4fc9bcf6..99bc27211fe4752657dd9e1b3a2ccd53954a3ecd 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/butc/tcmain.c,v 1.1.1.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>
@@ -1165,7 +1165,7 @@ char **argv;
      */
     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;
index 436db614c7fe4d8750f3f1b8cba4c997b3c58e34..ad1b83f7be4c1cd00cfd9441fd8410a825eb94a2 100644 (file)
@@ -12,7 +12,7 @@
 #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>
@@ -99,7 +99,7 @@ STC_LabelTape(acid, label, taskId)
 
     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 */
index c91f230d6505a9012e57ea6ca02fbf4ad35942f6..68897d30c4334aefd028e8ed97e527b6e0845395 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -58,7 +58,7 @@ afs_int32 CreateDBDump(dumpEntryPtr)
 {
     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);
@@ -140,7 +140,7 @@ afs_int32 GetDBTape(taskId, expires, tapeInfoPtr, dumpid, sequence, queryFlag, w
            goto getNewTape;
        }
 
-       bzero(&oldTapeLabel, sizeof(oldTapeLabel));
+       memset(&oldTapeLabel, 0, sizeof(oldTapeLabel));
        code = butm_ReadLabel(tapeInfoPtr, &oldTapeLabel, 1);   /* rewind tape */
        if (code)
        {
@@ -192,8 +192,8 @@ afs_int32 GetDBTape(taskId, expires, tapeInfoPtr, dumpid, sequence, queryFlag, w
                 */
                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);
@@ -259,7 +259,7 @@ afs_int32 GetDBTape(taskId, expires, tapeInfoPtr, dumpid, sequence, queryFlag, w
        /* 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 )
@@ -404,14 +404,14 @@ saveDbToTape(saveDbIfPtr)
     }
 
     /* 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 */
@@ -513,7 +513,7 @@ afs_int32 makeDbDumpEntry(tapeEntPtr, dumpEntryPtr)
 {
     afs_int32 code;
 
-    bzero(dumpEntryPtr, sizeof(struct budb_dumpEntry));
+    memset(dumpEntryPtr, 0, sizeof(struct budb_dumpEntry));
 
     dumpEntryPtr->id             = tapeEntPtr->dump;
     dumpEntryPtr->initialDumpID  = 0;
@@ -627,7 +627,7 @@ afs_int32 readDbTape(tapeInfoPtr, rstTapeInfoPtr, query)
     /* 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));
@@ -840,7 +840,7 @@ writeDbDump(tapeInfoPtr, taskId, expires, dumpid)
     if (!writeBlock) ERROR_EXIT(TC_NOMEMORY);
 
     writeBuffer = writeBlock + sizeof(struct blockMark);
-    bzero(writeBuffer, BUTM_BLKSIZE);
+    memset(writeBuffer, 0, BUTM_BLKSIZE);
     maxReadSize = 1024;
 
     /* 
@@ -927,7 +927,7 @@ writeDbDump(tapeInfoPtr, taskId, expires, dumpid)
        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;
@@ -943,7 +943,7 @@ writeDbDump(tapeInfoPtr, taskId, expires, dumpid)
                ERROR_EXIT(code);
            }
            
-           bzero(writeBuffer, blockSize);
+           memset(writeBuffer, 0, blockSize);
            writeBufPtr = &writeBuffer[0];
            writeBufNbytes = 0;
 
@@ -1061,7 +1061,7 @@ restoreDbEntries(tapeInfoPtr, rstTapeInfoPtr)
     }
 
     /* 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);
@@ -1138,7 +1138,7 @@ restoreDbHeader(tapeInfo, rstTapeInfoPtr, nextHeader)
     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);
@@ -1152,7 +1152,7 @@ restoreDbHeader(tapeInfo, rstTapeInfoPtr, nextHeader)
     }
 
     /* 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);
@@ -1192,7 +1192,7 @@ restoreDbDump(tapeInfo, rstTapeInfoPtr, 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);
 
@@ -1216,7 +1216,7 @@ restoreDbDump(tapeInfo, rstTapeInfoPtr, nextHeader)
     }
 
     /* 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);
@@ -1226,7 +1226,7 @@ restoreDbDump(tapeInfo, rstTapeInfoPtr, 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);
@@ -1238,7 +1238,7 @@ restoreDbDump(tapeInfo, rstTapeInfoPtr, nextHeader)
        }
        
        /* 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);
@@ -1248,7 +1248,7 @@ restoreDbDump(tapeInfo, rstTapeInfoPtr, 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);
@@ -1259,7 +1259,7 @@ restoreDbDump(tapeInfo, rstTapeInfoPtr, nextHeader)
            }
            
            /* 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);
@@ -1301,7 +1301,7 @@ saveTextFile(taskId, textType, fileName)
     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 */
@@ -1435,7 +1435,7 @@ restoreText(tapeInfo, rstTapeInfoPtr, nextHeader)
     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);
@@ -1541,7 +1541,7 @@ getTapeData(tapeInfoPtr, rstTapeInfoPtr, buffer, requestedBytes)
        
        /* copy out data */
        transferBytes = (nbytes < requestedBytes ) ? nbytes : requestedBytes;
-       bcopy(tapeReadBufferPtr, buffer, transferBytes);
+       memcpy(buffer, tapeReadBufferPtr, transferBytes);
        tapeReadBufferPtr += transferBytes;
        buffer += transferBytes;
        nbytes -= transferBytes;
index b7d90a1aecc424c3028596929fe00b0a16c81f06..d68146eb98125c385af4ef8306230ea476f571b7 100644 (file)
@@ -19,7 +19,7 @@ afs_int32 glong(cp, index)
 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;
 }
 
index 35253ae81c281254db81f809c6e1a4cac9fa7ab7..49c8a9c0066bdc9c2bf252749484d4855628f9d2 100644 (file)
@@ -73,7 +73,7 @@ char *aname; {
     }
     th = gethostbyname(aname);
     if (!th) return 0;
-    bcopy(th->h_addr, &addr, sizeof(addr));
+    memcpy(&addr, th->h_addr, sizeof(addr));
     return addr;
 }
 
index a67e48e5e69b605751f0fd0799375830fdf678a8..ee0377d721dc474f2bb2fb1cc004cfb3be269873 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -182,7 +182,7 @@ goto start;
     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);
@@ -201,7 +201,7 @@ goto start;
     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");
index 54901a7548dbe8c727e9da7bb1dad0356af4d846..f163f671064db8568ba07a2b131b95ed6a24c3f5 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -808,7 +808,7 @@ WriteTapeBlock(info, buffer, length, blockType)
    {
        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);
    }
@@ -899,7 +899,7 @@ ReadTapeBlock(info, buffer, blockType)
 
    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;
@@ -1209,12 +1209,12 @@ static afs_int32 file_WriteLabel (info, label, rewind)
 
     /* 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);
@@ -1312,7 +1312,7 @@ file_ReadLabel (info, label, rewind)
     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);
@@ -1413,7 +1413,7 @@ file_WriteFileData (info, data, blocks, len)
 
         if (len < BUTM_BLKSIZE)
        {
-           bzero(&dstart[len], BUTM_BLKSIZE - len);
+           memset(&dstart[len], 0, BUTM_BLKSIZE - len);
            length = len;
        }
        else
@@ -1430,7 +1430,7 @@ file_WriteFileData (info, data, blocks, len)
 
        if (b < (blocks-1)) b++;
        else if (len) 
-           bcopy(&dstart[BUTM_BLKSIZE], &dstart[0], len);
+           memcpy(&dstart[0], &dstart[BUTM_BLKSIZE], len);
     }
 
 error_exit:
@@ -1745,7 +1745,7 @@ afs_int32 butm_file_Instantiate (info, file)
     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;
index cd8e389b2767dd4c1aa255f3e2b3cbdabc3e3c0d..7ffdcf206b7f7fd32c86e1eed62bc83b36f87462 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -220,7 +220,7 @@ int PerformDumpTest(TestInfo *tip)
     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;
@@ -355,14 +355,14 @@ int PerformDumpTest(TestInfo *tip)
     
     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);
index ae78604e17c1576dcaeb2bd7f37e9a31dc81284e..9884a72e70005687df61db1c88fa55133ed6fc1a 100644 (file)
@@ -21,9 +21,10 @@ OPTMZ=-O2
 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
index 45cbccb9c6ea560428c0cfcf271b7c5372e9ff5b..9c9546ec108fa45d2fde9d29938d374f3b42c99c 100644 (file)
@@ -22,8 +22,9 @@ DBG=-g3
 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
index f26b67d31a4c0ac96b8c7420693fe99f6623f021..eb760eef33060b1552f99a3708b7ff720806d3ca 100644 (file)
@@ -32,17 +32,14 @@ XLIBS=@LIB_AFSDB@
 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
index a315d51e11b62661ce620fe9fde95c50b6148863..7fcaa6f858d84ba97e7d965fc308f1696e7b3d79 100644 (file)
@@ -117,7 +117,7 @@ depends :
 #      Removes all built files
 #
 clean :
-       -rm -f $(TARGETS) *.o *.ss core
+       -$(RM) -f $(TARGETS) *.o *.ss core
 
 #
 # IMPLICIT RULES
@@ -159,7 +159,7 @@ $(DESTBIN)/%.exe : %.exe
 #
 %.a :
        -$(RM) $@
-       $(AR) rv $@ $^
+       $(AR) crv $@ $^
        $(RANLIB) $@
 
 # new implicit rule to create executables
index f23fc92d677834d1503a83a746948388ed080dc5..b0b318d5593f474beea188a8173b49348e51c8e0 100644 (file)
@@ -21,8 +21,7 @@ LWP_OPTMZ=-O
 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
index 058e1f18b4176cb48fbedbcf9473ff97e9f18bc8..c07be9a6725cced4408903ffd992340d523e326e 100644 (file)
@@ -20,9 +20,8 @@ SHLIB_SUFFIX=sl
 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
index fc57153ecd0f5d841494f2832ef0336b6cfc4859..7206ea95f554383bda9267935db3fc61413b134b 100644 (file)
@@ -9,8 +9,6 @@
 #
 # AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
 AFS_OSTYPE = DJGPP
-DESTDIR=DEST/
-SRCDIR=DEST/
 
 # compilation and link editor flags
 #DBG=-g
@@ -33,18 +31,15 @@ XLIBS=
 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
index a627efa32ccf184fa3bdebf73259d33bc1d5af84..a8a0001c0be8ed2bdbc99f4424d8a6d1a949d34e 100644 (file)
@@ -4,9 +4,6 @@
 #
 # 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-
@@ -37,17 +34,14 @@ XLIBS=@LIB_AFSDB@ -lcompat
 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
index 38c7dfba1a6a5aebfd36c7dd68cf6b787717c9fc..9635c318eb5b6f7fe38c1a290d67002fe8ab7ba2 100644 (file)
@@ -6,7 +6,7 @@ AFS_OSTYPE = LINUX
 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
@@ -35,12 +35,9 @@ MT_CC=cc
 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
index 6edb0b62eaaaf697dcc96f8ad9b64c42799a9ad0..be76178b7271317fbe67e641b980da4e8b69af53 100644 (file)
@@ -3,9 +3,6 @@
 # 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
@@ -36,7 +33,7 @@ AR=ar
 AS=as
 CC=cc
 CP=cp
-INSTALL=${DESTDIR}bin/pinstall
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
 LEX=lex -l
 LD= ld
 LORDER = lorder
index 6edb0b62eaaaf697dcc96f8ad9b64c42799a9ad0..be76178b7271317fbe67e641b980da4e8b69af53 100644 (file)
@@ -3,9 +3,6 @@
 # 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
@@ -36,7 +33,7 @@ AR=ar
 AS=as
 CC=cc
 CP=cp
-INSTALL=${DESTDIR}bin/pinstall
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
 LEX=lex -l
 LD= ld
 LORDER = lorder
index 72aeaef0dc2ec288805c9fadcaefbcdb2ed2cfb6..00762dd0e5baffd03e24dec3c66213bf20efefdc 100644 (file)
@@ -35,12 +35,10 @@ MT_CC=cc
 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
index 81c039b44ae0d8f5973f47ace2e9f8b29e1d6331..797477171129270a88630a8fbf0885fcba129c7d 100644 (file)
@@ -34,8 +34,7 @@ LEX=lex
 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
index 9de4d60c5efbb3d08bdd99922cbddba8587448c5..9f7232bffd6132bf3ea8e894867f3ef31b09e7de 100644 (file)
@@ -40,12 +40,9 @@ MT_CC=gcc
 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
index 74bffa280e2bb23a1f00478ea7ac60423d8664f8..421f6216aeaaaecf9375b8911ccc87331c6fec32 100644 (file)
@@ -40,12 +40,9 @@ MT_CC=gcc
 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
index 587636880f06ba650b93020472ede43076c23fc4..8a7d9d6ca586bbcbdd44d84f1a4ed31869ad2861 100644 (file)
@@ -38,8 +38,9 @@ LEX=lex
 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
index 55aa0e3392cc63d17ee2dd9e348d657ce8155f05..fd33e43b079e9fa207643fecce89820a61a8a17e 100644 (file)
@@ -38,5 +38,4 @@ LEX=lex
 MV=mv
 RANLIB=/bin/true
 RM=rm
-WASHTOOL=${DESTDIR}bin/washtool
-INSTALL=${DESTDIR}bin/install
+INSTALL=${TOP_SRCDIR}/pinstall/pinstall
index 61b385dab049a58f0db4c41d43833649966c2335..f8c75148e54efa31affe49d797c82e776b3f8379 100644 (file)
@@ -39,8 +39,9 @@ LEX=lex
 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
index 925e626afff6fe7b2c6dbf1208aeed342379fa59..a0a0c87ca0b23006a8e13bb8450c4d5360972d50 100644 (file)
@@ -39,8 +39,9 @@ LEX=lex
 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
index a8d184fd90a3e912eebe09c23cc45af4c2342fb5..b550bd7d90593e3fe344da05a522947e3bc0e8f0 100644 (file)
@@ -39,12 +39,9 @@ MT_CC=cc
 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
index a8d184fd90a3e912eebe09c23cc45af4c2342fb5..b550bd7d90593e3fe344da05a522947e3bc0e8f0 100644 (file)
@@ -39,12 +39,9 @@ MT_CC=cc
 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
index a8d184fd90a3e912eebe09c23cc45af4c2342fb5..b550bd7d90593e3fe344da05a522947e3bc0e8f0 100644 (file)
@@ -39,12 +39,9 @@ MT_CC=cc
 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
index 8d8d8d941c43bf6cf0f0cf85e359f26e585ec7c0..e7bc37788441eaabc63f34e4f4e14677b5278f3c 100644 (file)
@@ -39,8 +39,9 @@ MV=mv
 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
index e6a173baea3734911d009ce607a5420ff2710872..add17886574361e2503e2c3167fec2cac0b35b54 100644 (file)
@@ -43,11 +43,12 @@ MV=mv
 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
index 75614135c371a0e2b095011080e25682be936c2d..3f5e0c07b50d1271fbd4656f9d7349d5fe32d882 100644 (file)
@@ -47,11 +47,12 @@ MV=mv
 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
index 2b4bf1020444c6e4654866af72dc29df294880e4..945a14282e9ad6cddb56a5787dd07290e71dc0b5 100644 (file)
@@ -40,11 +40,12 @@ MV=mv
 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
index b874f4a6c2ce0242fcf8c1d987b3717ec8861f6f..1c60eca7c454cea8fb509cf4acdfe708178839e9 100644 (file)
@@ -20,5 +20,4 @@ AR = /usr/ccs/bin/ar
 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
index 65b2ae1aac98d6985ba2a758f600704da63eed50..0b6cef86327573d4213f90e15369ceff7eaaf1cf 100644 (file)
@@ -12,14 +12,14 @@ $(VERSFILE).o: $(VERSFILE).c
 # 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
index bc039f9698a6138f8663fe5e50c4932302d306b7..1e57db5844e0e8d369edecfe60c1dc67cc4e5a2d 100644 (file)
@@ -11,8 +11,5 @@ VERSION=@VERSION@
 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
index 9d27966e789aae27968ee376b75d617ed0c338d1..311f97acade68ed738ef5e7f0a1e729ce910063f 100644 (file)
@@ -23,14 +23,18 @@ INCFILES =\
        $(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)
@@ -65,6 +69,9 @@ idirs: doclink
 !      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
@@ -89,30 +96,31 @@ idirs: doclink
 !      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.
@@ -133,24 +141,24 @@ NTMakefile.version: NTMakefile.version-CML NTMakefile.version-NOCML
                $(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
@@ -166,9 +174,9 @@ clean_version:
 
 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
index 54b095fe7937894b40d32ee48f0d5b19ba1408cd..83cce8977154cdf0734d0dd95f1d75426ba2d168 100644 (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
index 22e2feb952768e385f99b49abae0562cbd13f37b..2c314157afe57958be1ed5071176ab64e1758276 100644 (file)
 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
index 5691c78908684855ee027b7783aec797df29496b..ac9fae8e8a16bbda0facf6b0750f92f9a2548a8a 100644 (file)
@@ -16,11 +16,11 @@ BEGIN
     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
index 84e3ef7fd666c7e176d06e951ea9119ea723f075..0323ea6ed7a490c530d9a7c8fb3177fc59dbc79f 100644 (file)
 #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)
index 387ef4e11696e11f086e21dc4ee49c84091f345b..72a926f4577512eaa0fd5757f52740b4f56bfdc5 100644 (file)
@@ -34,14 +34,16 @@ typedef int ssize_t;
 /* 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))
index 2e636912d66e62cc5b08a90396cc2f229ebe0ba8..355714b5d1a268efcfbc3a6c35a0efcd588c1314 100644 (file)
@@ -35,14 +35,16 @@ typedef int ssize_t;
 /* 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))
index 77080d0d8630a8ccb10b729ca8420eb0bb56f74b..443957b91b5808055d80bd166b858b11fc2e6601 100644 (file)
@@ -11,7 +11,7 @@
 #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 */
@@ -77,6 +77,9 @@
 #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
index 64abc206ecc07103854a94c0d75dd7f13cfc5b6c..3492a22a8e52ef7822da840c5252f442f2c05a20 100644 (file)
@@ -13,7 +13,7 @@
 #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 */
@@ -76,6 +76,9 @@
 #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
index 96456f0281e164faee12f3a9d9a0cc5b7ad951b3..4e56aaf99f9c196b83eef400197bae368bd6394f 100644 (file)
@@ -11,7 +11,7 @@
 #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
index a4405847e2e2173c401614552c342c7ddf120341..e943d151d5da98d579625ddb5bef253b228a06fe 100644 (file)
@@ -2,7 +2,7 @@
 #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 */
@@ -99,6 +99,9 @@
 #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
index 98d41088f48f6b8172c273a45cb013166502c8f6..87fec13ec7295a781b9dbbdff93bf0ef0da662bf 100644 (file)
@@ -15,6 +15,8 @@
 #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 */
index e62769c5176293402d020a4c73b7775b0de75404..10c0d2839ebb6d0b5c7a92df099d98d960f49fd4 100644 (file)
@@ -13,7 +13,7 @@
 #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 */
index 10e184ad13c2036d1026b045565e1132d52ccca7..b55170eb7cd05fc62e37bac67ccb965a9b59a4a9 100644 (file)
@@ -189,7 +189,9 @@ typedef struct afs_hyper_t { /* unsigned 64 bit integers */
 #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
 
 
index eb17b8d587337d8445eb675cd9f01be484873f74..15e54e0c85d1a5f96e5508e66f1459501575cb20 100644 (file)
 #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);
 }
@@ -97,15 +103,151 @@ int main(int argc, char* argv[])
        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)
@@ -149,31 +291,62 @@ int main(int argc, char* argv[])
                }
                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;
index 61a62f27c125030960333a7871d5275252aa51da..04ecfd2f8f4ec34971e74449bf0ae91f809976f3 100644 (file)
@@ -71,7 +71,7 @@
 #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>
@@ -108,7 +108,7 @@ static char *getpipepass() {
     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;
@@ -156,14 +156,14 @@ int store_afs_token(unix_id, realm_p, tkt_type, ticket_p, ticket_len,
 
     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, "");
@@ -186,7 +186,7 @@ char *make_string(s_p, length)
        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;
 }
@@ -316,7 +316,7 @@ int decode_reply(buf, buflen, reply_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;
@@ -467,7 +467,7 @@ CommandProc (as, arock)
      * 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
@@ -568,8 +568,7 @@ CommandProc (as, arock)
        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) {
@@ -704,7 +703,7 @@ bad_lifetime:
     }
     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
@@ -724,8 +723,8 @@ bad_lifetime:
     /*
      * 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
index ee9e41e70506c6dd94692f38002c3c80b688c2b7..1f15d978b26e6c7a0682cffd23861f2a9377cf48 100644 (file)
@@ -56,7 +56,7 @@ LIBOBJS = \
        weak_key.obj \
        read_pssword.obj \
        strng_to_key.obj \
-       misco.obj \
+       misc.obj \
        util.obj \
        crypt.obj
 
@@ -65,10 +65,6 @@ LIBFILE = $(DESTDIR)\lib\afsdes.lib
 $(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 ###
 #####################
@@ -113,28 +109,28 @@ ip.c: make_ip.exe
 # 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)
index 6a730b8f4ff5ea7bfe676f5414947c43beaba959..c294e857ac227b8e6e038a104fe0bba9fdcebd6e 100644 (file)
 #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 */
index c71f9ef15adfa66566c0c81db2e67d943efe4106..1c1e41a1fdf84150d8f07c163bb62fab83ea3dcd 100644 (file)
@@ -23,7 +23,7 @@
 #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
@@ -73,8 +73,8 @@ des_cbc_encrypt(in,out,length,key,iv,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
@@ -87,8 +87,8 @@ des_cbc_encrypt(in,out,length,key,iv,encrypt)
            /* 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
@@ -114,10 +114,8 @@ des_cbc_encrypt(in,out,length,key,iv,encrypt)
            /* 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
@@ -140,8 +138,8 @@ des_cbc_encrypt(in,out,length,key,iv,encrypt)
        /* 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
@@ -154,8 +152,8 @@ des_cbc_encrypt(in,out,length,key,iv,encrypt)
            /* 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
@@ -185,10 +183,8 @@ des_cbc_encrypt(in,out,length,key,iv,encrypt)
            /* 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
index b03e41e355fc484cf40b198f34f3f39639773e49..f6dc5948f025bb9b99f13c8782aa3785c545d77b 100644 (file)
 #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>
@@ -74,8 +75,8 @@ des_cbc_cksum(in,out,length,key,iv)
 
 #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
@@ -88,8 +89,8 @@ des_cbc_cksum(in,out,length,key,iv)
        /* 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
@@ -126,8 +127,8 @@ des_cbc_cksum(in,out,length,key,iv)
     /* 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
index c430fbb3bc77c8b30ed2bc8f950f67388e61cfea..aae13084876217214e1599bca08534ce14b129c9 100644 (file)
 #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
 
 /*
@@ -248,8 +249,13 @@ typedef union {
        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;
@@ -500,6 +506,7 @@ crypt(key, setting)
        int num_iter, salt_size;
        C_block keyblock, rsltblock;
 
+
        for (i = 0; i < 8; i++) {
                if ((t = 2*(unsigned char)(*key)) != 0)
                        key++;
index bd37a801a4b3c59da3043696791a6ac8ebab0b02..3cd72956b3ae9637db5403835273d1da2cab9e88 100644 (file)
@@ -36,7 +36,7 @@
 #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
@@ -130,8 +130,8 @@ des_ecb_encrypt(clear, cipher, schedule, encrypt)
     }
 #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;
     }
@@ -442,8 +442,8 @@ des_ecb_encrypt(clear, cipher, schedule, encrypt)
     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
index b6e58c652bd050e1124c84fa62c67453af8babe9..fe73aba5040bacefc21b3bec62d7705ed2048bae 100644 (file)
@@ -8,7 +8,7 @@
 #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>
@@ -74,7 +74,7 @@ main(argc,argv)
     }
     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",
index 231caceae6590c0820f1fc00c6a51e3d22b251e0..62038e60172107df08ab706befc0f9cbab755f8b 100644 (file)
 #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
@@ -286,70 +288,3 @@ void test_set(stream, src, testbit, dest, setbit)
 #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 */
index 8fdbd4fd8e6b582119f3c5a35927c2c6e092bf1f..53cb8fc6d0fc957fc0981b72b7e84974d544000c 100644 (file)
 #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"
 
@@ -242,8 +243,7 @@ static afs_int32
 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;
 }
index a978a9c2c3e9679af70b9d7c5fa266deed43063d..886d93c61446597423bc456f0d9df3a864196f46 100644 (file)
@@ -26,7 +26,7 @@
 #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"
 
@@ -88,8 +88,8 @@ des_pcbc_encrypt(in,out,length,key,iv,encrypt)
     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
@@ -102,8 +102,8 @@ des_pcbc_encrypt(in,out,length,key,iv,encrypt)
            /* 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
@@ -135,9 +135,9 @@ des_pcbc_encrypt(in,out,length,key,iv,encrypt)
             */
 #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
@@ -151,10 +151,8 @@ des_pcbc_encrypt(in,out,length,key,iv,encrypt)
            /* 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
@@ -181,8 +179,8 @@ des_pcbc_encrypt(in,out,length,key,iv,encrypt)
        /* 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
@@ -195,8 +193,8 @@ des_pcbc_encrypt(in,out,length,key,iv,encrypt)
            /* 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
@@ -226,10 +224,8 @@ des_pcbc_encrypt(in,out,length,key,iv,encrypt)
            /* 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
index 0782e9c23fe0178ec2e74535333b2b05de1f01e1..6a8115785a39854b2dce80096b51471765933e00 100644 (file)
 #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
@@ -107,7 +108,7 @@ des_read_password(k,prompt,verify)
 #ifdef BSDUNIX
 lose:
 #endif
-    bzero(key_string, sizeof (key_string));
+    memset(key_string, 0, sizeof (key_string));
     return ok;
 }
 
@@ -215,7 +216,7 @@ des_read_pw_string(s,maxa,prompt,verify)
 #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*/
@@ -223,7 +224,7 @@ des_read_pw_string(s,maxa,prompt,verify)
        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;
@@ -276,7 +277,7 @@ des_read_pw_string(s,maxa,prompt,verify)
            }
            continue;
        }
-       if ((ptr = index(s, '\n')))
+       if ((ptr = strchr(s, '\n')))
            *ptr = '\0';
 #endif
        if (verify) {
@@ -291,7 +292,7 @@ des_read_pw_string(s,maxa,prompt,verify)
                clearerr(stdin);
                continue;
            }
-            if ((ptr = index(key_string, '\n')))
+            if ((ptr = strchr(key_string, '\n')))
            *ptr = '\0';
 #endif
            if (strcmp(s,key_string)) {
@@ -307,7 +308,7 @@ des_read_pw_string(s,maxa,prompt,verify)
 lose:
 #endif
     if (!ok)
-       bzero(s, maxa);
+       memset(s, 0, maxa);
     printf("\n");
 #if defined(AFS_HPUX_ENV) || defined(AFS_FBSD_ENV)
     /*
@@ -338,7 +339,7 @@ lose:
     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;
@@ -361,7 +362,7 @@ lose:
 #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 */
 }
index aac0991b49641de545a3c11eaeb1bafcf8f811b8..8a6637ebb58d9ad84bd60103dd1bb736b8ff150f 100644 (file)
 #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;
@@ -67,7 +68,7 @@ des_string_to_key(str,key)
     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)
@@ -116,7 +117,7 @@ des_string_to_key(str,key)
     (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);
index 42fbd1a87a611ad7af4de21c9be672a20e9bee8a..64d0d2604b9272e19c42e83f5a60c53c420e8440 100644 (file)
 #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
 
 /*
@@ -69,7 +70,7 @@ des_is_weak_key(key)
     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;
     }
 
index 60ae10f49ff71ec3f912bc55c95d280baaaf55b1..218ee756888d166c06f924a82f86ce183a887a11 100644 (file)
@@ -10,8 +10,9 @@
 #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"
index ab525b58a2aeb3324cca0d37478ff8fb1096e787..f7022389e8f4117909b51fe40b3c5d62b77d3eb2 100644 (file)
@@ -12,7 +12,7 @@
 #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>
@@ -398,8 +398,8 @@ int DirSalvage (fromFile, toFile, vn, vu, pvn, pvu)
     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;
index 579437819b89b1da879e41e6498764586837aea0..34fc4463c4a493f5ab0148f216505ad677acab90 100644 (file)
@@ -11,7 +11,7 @@
 #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>
@@ -157,7 +157,7 @@ int count; {
     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);
index ac544f19121119b2c28f8cdc9086f587fa4256aa..69fae58600105f39e0cef522c61b9e0cdeb3eacd 100644 (file)
@@ -13,7 +13,7 @@
 #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>
@@ -328,7 +328,7 @@ char *syms;
        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
index fa9f65ba0667a2b7f07795553b93109af9a93feb..85197e2b7067e5863ef3b48e3e2efa5a399a5442 100644 (file)
@@ -13,7 +13,7 @@
 #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"
@@ -41,7 +41,7 @@ char *name; {
                 */
                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))
index 65b067e31fc2d27fc1292a367ad189dc242729e9..4c61c537ceb5b7f38d64b493ac216d6f9b3cd08d 100644 (file)
@@ -16,7 +16,7 @@
 #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*/
@@ -95,7 +95,7 @@ static int fsprobe_CleanupInit()
     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;
@@ -253,8 +253,8 @@ static void fsprobe_LWP()
       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++) {
          /*
@@ -553,8 +553,7 @@ int fsprobe_Init(a_numServers, a_socketArray, a_ProbeFreqInSecs, a_ProbeHandler,
 
     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.
@@ -624,9 +623,7 @@ int fsprobe_Init(a_numServers, a_socketArray, a_ProbeFreqInSecs, a_ProbeHandler,
                (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) {
@@ -687,7 +684,7 @@ int fsprobe_Init(a_numServers, a_socketArray, a_ProbeFreqInSecs, a_ProbeHandler,
       } 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) {
index 38635493a0318c6341ce69bd404783cb6e2e0e13..3933aacf91849efd45c420690a64cebcdcf573a2 100644 (file)
@@ -16,7 +16,7 @@
 #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*/
 
@@ -158,7 +158,7 @@ main(argc, argv)
       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*/
@@ -167,7 +167,7 @@ main(argc, argv)
       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*/
@@ -176,7 +176,7 @@ main(argc, argv)
       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",
index 472676bbb5301533f74adae55903697f4941e8e3..d74f60562d1bba4eaf7d5749dac0618bac5c39a8 100644 (file)
@@ -980,7 +980,7 @@ yylex()
                        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';
                        }
index d91a96ff6741d49395a6275b9e2a53d4d8760eaa..5ac9ca13ae09962fcd2e229f4ce4138ae236ac64 100644 (file)
@@ -347,7 +347,7 @@ nextopt:
                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);
index e09ea0fabc9dcf35388bd45d3cdd3cd1e5c3d686..ecc46469cb09368d0f5d711465ce3f639b6d0040 100644 (file)
@@ -49,7 +49,7 @@ logwtmp(line, name, host)
                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));
index 4cf0cb678d448c9efac94bee2de53bb05777bddf..2d25c75f049987add394a5e9e4c7ee49fa248833 100644 (file)
@@ -57,7 +57,7 @@ ftpd_popen(program, type)
                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);
@@ -137,7 +137,7 @@ ftpd_pclose(iop)
        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);
index e030f07e009a63951f0e74f182837f43d526a38a..ec2205297fba307bd477acd70b2122970ff0cb5a 100644 (file)
@@ -11,7 +11,7 @@
 #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>
@@ -200,7 +200,7 @@ struct gtx_frame *aframe; {
        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);
@@ -342,7 +342,7 @@ struct gtx_frame *aframe; {
     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;
@@ -354,7 +354,7 @@ struct gtx_frame *aframe; {
     }
     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;
@@ -418,7 +418,7 @@ struct gtx_frame *gtxframe_Create() {
       * 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);
@@ -460,7 +460,7 @@ register struct gtx_frame *aframe; {
        strcat(menubuffer, " ");
     }
     if (menubuffer[0] != 0) {
-      bzero(&strparms, sizeof(strparms));
+      memset(&strparms, 0, sizeof(strparms));
       strparms.x = 0;
       strparms.y = 0;
       strparms.s = menubuffer;
index d2aac1fa03879527c598a28955432f4e607a66fb..29ef139d68ed122771b5f523f61f5c54e76f0bce 100644 (file)
@@ -10,7 +10,7 @@
 #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"
 
@@ -19,7 +19,7 @@ struct keymap_map *keymap_Create() {
 
     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);
 }
 
@@ -125,7 +125,7 @@ register struct keymap_map *amap; {
 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;
index c9f28ccc4789feae5ce1bea8a0d1a4974614889b..8ada5dbc23e30fe2954dcfc084409f68e0589e79 100644 (file)
@@ -16,7 +16,7 @@
 #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*/
@@ -169,7 +169,7 @@ struct gator_textcb_hdr *gator_textcb_Create(a_maxEntriesStored, a_maxCharsPerEn
       */
     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);
@@ -190,7 +190,7 @@ struct gator_textcb_hdr *gator_textcb_Create(a_maxEntriesStored, a_maxCharsPerEn
       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;
 
@@ -266,7 +266,7 @@ static struct gator_textcb_entry *bumpEntry(a_cbhdr)
       * 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;
 
index 3c9b30682ffac0e8204dd0190e98f6e01e439960..ecbd15f66127061bd0a7b660dc91342e753c82f2 100644 (file)
@@ -55,7 +55,7 @@
 #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>
@@ -194,7 +194,7 @@ main(argc, argv, envp)
 #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));
@@ -475,7 +475,7 @@ main(argc, argv, envp)
                                                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
index 578aa1cf903dc5dd2e08eb55232be62a54d93f8d..eb8b8b136f7d6bca7dffce6ff3e27ee7021fb8ac 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -66,7 +66,7 @@ setenv(name, value, rewrite)
                            (cnt + 2)));
                        if (!P)
                                return(-1);
-                       bcopy(environ, P, cnt * sizeof(char *));
+                       memcpy(P, environ, cnt * sizeof(char *));
                        environ = P;
                }
                environ[cnt + 1] = NULL;
index 7a42a294f655f669bfa557e5ddcdbe16cb89d75e..d2b8da9a96f7e8fbbb75517822cb89cb8d2b3197 100644 (file)
@@ -14,7 +14,7 @@
 #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>
@@ -177,7 +177,7 @@ outtoken(s,token,svc,localName)
 
     /* (4) sessionKey */
     bp = buf + strlen(buf);
-    bcopy(&token->sessionKey,bp,8);
+    memcpy(bp, &token->sessionKey, 8);
     bp += 8;
 
     /* (5) - (6) */
@@ -185,7 +185,7 @@ outtoken(s,token,svc,localName)
 
     /* (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) {
index f339a2758e68460883f7bbf556495ffaa20c53d6..b64a3b9d7d48f0f1d307f96d5907d0175298d0f5 100644 (file)
@@ -15,7 +15,7 @@
 #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>
@@ -637,7 +637,7 @@ int SetFields (
 
       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);
@@ -1328,7 +1328,7 @@ static int MyBeforeProc(
        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);
@@ -1391,7 +1391,7 @@ static int MyBeforeProc(
                        "getting Authentication token for %s",
                        PrintedName (name, instance, cell));
          }
-         bzero (&key, sizeof(key));
+         memset(&key, 0, sizeof(key));
        }
     }
 
index 9daa373d10b90ea78ecff3b1cbe2277b109f83bd..9ed8803b82fab021001436e20a39c60f41087156 100644 (file)
@@ -16,7 +16,7 @@
 #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"
@@ -365,7 +365,7 @@ static afs_int32 CheckTicketAnswer(
 
     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);
@@ -401,9 +401,9 @@ static afs_int32 CheckTicketAnswer(
            )
          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;
@@ -412,7 +412,7 @@ static afs_int32 CheckTicketAnswer(
          
          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);
@@ -525,7 +525,7 @@ afs_int32 ka_Authenticate (
 
     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,
@@ -599,9 +599,8 @@ afs_int32 ka_Authenticate (
            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:
@@ -705,8 +704,7 @@ afs_int32 ka_GetToken (
        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
@@ -756,7 +754,7 @@ afs_int32 ka_GetToken (
            UNLOCK_GLOBAL_MUTEX
            return KABADPROTOCOL;
        }
-       bcopy (strings, token->ticket, token->ticketLen);
+       memcpy(token->ticket, strings, token->ticketLen);
        
        break;
       default:
index 8e5f610555083b14681062657f86ec863013be81..7a9ed426cac733b034be38fb838f5391b8553113 100644 (file)
@@ -14,7 +14,7 @@
 #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"
@@ -58,7 +58,7 @@ static void Andrew_StringToKey (
     int          i;
     int   passlen;
 
-    bzero (key, sizeof(struct ktc_encryptionKey));
+    memset(key, 0, sizeof(struct ktc_encryptionKey));
 
     strncpy (password, cell, 8);
     passlen = strlen (str);
@@ -106,13 +106,13 @@ static void StringToKey (
     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);
@@ -158,7 +158,7 @@ afs_int32 ka_ReadPassword (
     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
index 60da2df221bc92628b6a716af66f611d2eb3513e..5ac1ccca84de7c8b071fb8fe7bf15f03f1412644 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -166,7 +166,7 @@ afs_int32 CheckInit (at, db_init)
     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));
@@ -208,7 +208,7 @@ afs_int32 AllocBlock (at, tentry)
 
     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;
 }
 
@@ -224,7 +224,7 @@ afs_int32 FreeBlock (at, index)
     /* 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));
@@ -444,7 +444,7 @@ afs_int32 ka_NewKey (tt, tentryaddr, tentry, key)
               ((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",
@@ -456,7 +456,7 @@ afs_int32 ka_NewKey (tt, tentryaddr, tentry, key)
          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;
          }
@@ -498,7 +498,7 @@ afs_int32 ka_NewKey (tt, tentryaddr, tentry, key)
        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 */
@@ -525,7 +525,7 @@ afs_int32 ka_NewKey (tt, tentryaddr, tentry, key)
     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);
@@ -594,8 +594,8 @@ void ka_debugKeyCache (info)
   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;
@@ -649,7 +649,7 @@ ka_Encache (name, inst, kvno, key, superseded)
            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);
 
@@ -697,7 +697,7 @@ afs_int32 ka_LookupKvno (tt, name, inst, kvno, key)
                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;
@@ -717,7 +717,7 @@ afs_int32 ka_LookupKvno (tt, name, inst, kvno, key)
 
     /* 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;
     }
@@ -728,7 +728,7 @@ afs_int32 ka_LookupKvno (tt, name, inst, kvno, key)
            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;
@@ -759,7 +759,7 @@ afs_int32 ka_LookupKey (tt, name, inst, kvno, key)
                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);
@@ -777,7 +777,7 @@ afs_int32 ka_LookupKey (tt, name, inst, kvno, key)
     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;
index 263304a4bf218f67f3599a36583eb0fab2aebb1e..4c6e422a13a1e57a781a3877b69fcf976787438f 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -115,8 +115,8 @@ static afs_int32 get_time (timeP, tt, admin)
 
     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) &&
@@ -137,7 +137,7 @@ static afs_int32 get_time (timeP, tt, admin)
        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);
@@ -157,7 +157,7 @@ static afs_int32 get_time (timeP, tt, admin)
        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) {
@@ -518,7 +518,7 @@ static int create_user (tt, name, instance, key, caller, flags)
        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);
@@ -669,9 +669,9 @@ afs_int32 ChangePassWord (call, aname, ainstance, arequest, oanswer)
     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);
@@ -720,7 +720,7 @@ impose_reuse_limits ( password, tentry )
   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);
@@ -776,7 +776,7 @@ set_password (tt, name, instance, password, kvno, caller)
        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))
@@ -934,7 +934,7 @@ PrepareTicketAnswer
 
     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;
@@ -956,10 +956,10 @@ PrepareTicketAnswer
        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);
     }
@@ -1085,7 +1085,7 @@ static afs_int32 Authenticate (version, call, aname, ainstance, start, end,
        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;
@@ -1098,7 +1098,7 @@ static afs_int32 Authenticate (version, call, aname, ainstance, start, end,
     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) {
@@ -1127,20 +1127,19 @@ static afs_int32 Authenticate (version, call, aname, ainstance, start, end,
        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:
@@ -1154,7 +1153,7 @@ static afs_int32 Authenticate (version, call, aname, ainstance, start, end,
           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) {
@@ -1347,7 +1346,7 @@ afs_int32 kamSetFields (call, aname, ainstance, aflags,
 
        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;
        }
@@ -1527,7 +1526,7 @@ afs_int32 kamGetEntry (call, aname, ainstance, aversion, aentry)
 
     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);
@@ -1550,8 +1549,8 @@ afs_int32 kamGetEntry (call, aname, ainstance, aversion, aentry)
     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;
@@ -1764,8 +1763,7 @@ static afs_int32 GetTicket (version, call, kvno, authDomain, aticket,
            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;
@@ -1788,7 +1786,7 @@ static afs_int32 GetTicket (version, call, kvno, authDomain, aticket,
            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);
@@ -1891,7 +1889,7 @@ afs_int32 kamGetStats (call, version, admin_accounts, statics, dynamics)
     }
 
     *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);
@@ -1900,7 +1898,7 @@ afs_int32 kamGetStats (call, version, admin_accounts, statics, dynamics)
     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;
 
@@ -1921,8 +1919,8 @@ afs_int32 kamGetStats (call, version, admin_accounts, statics, dynamics)
          * 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;
@@ -1984,7 +1982,7 @@ afs_int32 kamGetPassword (call, name, password)
        return code;
     }
 
-    bcopy (&tentry.key, password, sizeof (*password));
+    memcpy(password, &tentry.key, sizeof (*password));
     code = ubik_EndTrans (tt);
 #endif
     return code;
@@ -2038,7 +2036,7 @@ afs_int32 kamDebug (call, version, checkDB, info)
     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;
index d02c8395dca569ae0b7754c579e386da1331cc20..06c35809b72a9a595eae03a6a1db4632c22448c5 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -82,7 +82,7 @@ afs_int32 es_Report(char *fmt, ...)
 
 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;
 }
@@ -102,7 +102,7 @@ static int convert_cell_to_ubik (cellinfo, myHost, serverList)
        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) {
index 9125f4efdb5a1b9c597f8781e87c174ee8d463be..199f389e7d24c2e027a85dcf1fb7feba836979b8 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -142,11 +142,11 @@ afs_int32 ka_KeyCheckSum (
     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;
 }
index 6ad83192e2c0422e24aafebb2cf3c84879e621f1..bcb41b66bea0b265116ba4ab27667b33eb8ec320 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -66,7 +66,7 @@ static cmdproc(
                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));
        }
index 96958d249e44984932b2485ef03d4922a93e8531..db158f779ba72396413cd322fad5f3fd93275ecc 100644 (file)
@@ -15,7 +15,7 @@
 #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>
@@ -95,7 +95,7 @@ static int simplify_name(
        * 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);
       }
@@ -147,7 +147,7 @@ static int find_me(
     simplify_name(orig_name, truename);
   }
   else {
-    bp = (char *) rindex(arg, '/');
+    bp = (char *) strrchr(arg, '/');
     if (bp) {
       orig_name[0] = '.';
       orig_name[1] = '/';
@@ -182,7 +182,7 @@ static int find_me(
   /*
    * 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,
index 8e0e8dea919fad5593826cf2ddf6418d18bc065d..d225d105efc5a0cc7d1d2bd88fac8aa35ab99a36 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -135,7 +135,7 @@ static char *getpipepass(void)
     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;
@@ -178,7 +178,7 @@ int CommandProc (
     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 */
@@ -290,8 +290,7 @@ int CommandProc (
         */
        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) {
@@ -345,7 +344,7 @@ bad_lifetime:
 
     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,
index 4702589b85e6190b7c577ef748bfa752772992f9..2b76696fec0b7385df06f42e3b98a24f5a92f1c4 100644 (file)
@@ -21,7 +21,7 @@
 #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>
@@ -80,7 +80,7 @@ int   timeout = 60;
 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);
@@ -152,7 +152,7 @@ int main(
        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 = "";
@@ -218,7 +218,7 @@ int main(
        ttyn = ttyname(0);
        if (ttyn == (char *)0 || *ttyn == '\0')
                ttyn = "/dev/tty??";
-       tty = rindex(ttyn, '/');
+       tty = strrchr(ttyn, '/');
        if (tty == NULL)
                tty = ttyn;
        else
@@ -426,7 +426,7 @@ int main(
        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++;
@@ -577,13 +577,13 @@ static void doremoteterm(
   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++)
index 3a3f66070610461e3b9ecdb78d4a1305d5e5a433..69887e2773df852448bf5c5e5885e602f7f31173 100644 (file)
@@ -14,7 +14,7 @@
 #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>
@@ -26,6 +26,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/knfs.c,v 1.1.1.4 2001/07/14 22:22
 #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>
@@ -73,7 +80,7 @@ char *sysname;
     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 */
@@ -81,7 +88,7 @@ char *sysname;
     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;
@@ -141,9 +148,9 @@ static GetTokens(ahost, auid)
        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);
@@ -154,15 +161,15 @@ static GetTokens(ahost, auid)
        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 */
@@ -171,12 +178,12 @@ static GetTokens(ahost, auid)
                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 */
@@ -242,7 +249,7 @@ afs_int32 auid; {
     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);
@@ -293,30 +300,30 @@ afs_int32 auid; {
        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);
@@ -350,7 +357,7 @@ afs_int32 arock; {
        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);
index 64f38e4f3dfec5d5dd7eb1effa87f9537e5ed459..1fe1e3c390e65e4b5aa397be535ba6618f622ce5 100644 (file)
@@ -11,7 +11,7 @@
 #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>
@@ -140,7 +140,7 @@ static void getpipepass(gpbuf, len)
 {
     /* 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;
@@ -226,7 +226,7 @@ CommandProc (as, arock)
 #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 */
@@ -331,8 +331,7 @@ CommandProc (as, arock)
         */
        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) {
@@ -344,8 +343,7 @@ CommandProc (as, arock)
        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);
@@ -365,9 +363,9 @@ CommandProc (as, arock)
            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);
            }
@@ -404,7 +402,7 @@ CommandProc (as, arock)
              printf ("Mismatch - ");
              goto no_change;
            }
-           bzero (verify, sizeof(verify));
+           memset(verify, 0, sizeof(verify));
          }
       }
     if (code = password_bad (npasswd)) {  /* assmt here! */
@@ -423,7 +421,7 @@ CommandProc (as, arock)
 #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);
 
@@ -448,8 +446,8 @@ CommandProc (as, arock)
            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
@@ -471,8 +469,8 @@ CommandProc (as, arock)
            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)
@@ -488,8 +486,8 @@ CommandProc (as, arock)
                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);
@@ -498,8 +496,8 @@ CommandProc (as, arock)
            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) {
@@ -513,8 +511,8 @@ CommandProc (as, arock)
   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);
index 92553871be404f6a37e887794b1c33a55f299502..009e8be339e941748bad9e902bdd95e688de2592 100644 (file)
@@ -15,7 +15,7 @@
 #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>
@@ -85,12 +85,12 @@ char udptgsServerPrincipal[256];
 #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)
 
@@ -139,7 +139,7 @@ static afs_int32 create_cipher (cipher, cipherLen, sessionKey, sname, sinst,
     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);
@@ -147,7 +147,7 @@ static afs_int32 create_cipher (cipher, cipherLen, sessionKey, sname, sinst,
     *answer++ = life;
     *answer++ = (unsigned char) kvno;
     *answer++ = (unsigned char) ticketLen;
-    bcopy (ticket, answer, ticketLen);
+    memcpy(answer, ticket, ticketLen);
     answer += ticketLen;
     putint (start);
 
@@ -201,10 +201,10 @@ static afs_int32 create_reply (ans, name, inst, startTime, endTime, kvno,
     *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;
 }
 
@@ -322,7 +322,7 @@ afs_int32 UDP_Authenticate (ksoc, client, name, inst, startTime, endTime, sname,
                        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;
@@ -358,6 +358,7 @@ afs_int32 UDP_Authenticate (ksoc, client, name, inst, startTime, endTime, sname,
        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;
 
@@ -633,7 +634,7 @@ process_udp_auth (ksoc, pkt)
                    "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;
@@ -690,13 +691,13 @@ process_udp_appl (ksoc, pkt)
        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) {
@@ -825,7 +826,7 @@ afs_int32 init_krb_udp ()
     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 */
index f153078c43fdf30426b55a7982fb3a4de11c4ef3..65575437051a08c5ff961c5f5f816af73ebc619b 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -131,7 +131,7 @@ static char *getpipepass() {
     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;
@@ -174,7 +174,7 @@ CommandProc (as, arock)
     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 */
@@ -286,8 +286,7 @@ p    if (code ||
         */
        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) {
index 067d75c887bb24acc4e6fe50766731bdeb350ac1..f8fd1af64bc148abd633b5799cf919729673979c 100644 (file)
@@ -13,7 +13,7 @@
 #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>
@@ -74,7 +74,7 @@ des_read_password(k,prompt,verify)
        string_to_key(key_string, k);
 
 lose:
-    bzero(key_string, sizeof (key_string));
+    memset(key_string, 0, sizeof (key_string));
     return ok;
 }
 
@@ -137,7 +137,7 @@ read_pw_string(s,max,prompt,verify)
     }
 
 #ifdef BSDUNIX
-    bcopy(env, old_env, sizeof(env));
+    memcpy(old_env, env, sizeof(env));
     if (setjmp(env))
        goto lose;
 
@@ -204,14 +204,14 @@ read_pw_string(s,max,prompt,verify)
 
 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;
@@ -225,7 +225,7 @@ lose:
 #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 */
 }
index c4fec651aff79f17b4dce0130efacc1e1e030da9..64cf2dff34f3da5304964873c5d4d5054eaef794 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -414,7 +414,7 @@ WorkerBee (as, arock)
 
     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));
index 305bf629adb5fddb9847f90b5a51dd2875fee7be..0a2d332975db20124f598316f58bf4b53d5949e4 100644 (file)
@@ -17,7 +17,7 @@
 #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>
@@ -108,7 +108,7 @@ static char *getpipepass() {
     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;
@@ -153,7 +153,7 @@ CommandProc (as, arock)
     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 */
@@ -250,8 +250,7 @@ CommandProc (as, arock)
         */
        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) {
@@ -318,7 +317,7 @@ bad_lifetime:
     }
     code = storecode;
 
-    bzero (passwd, sizeof(passwd));
+    memset(passwd, 0, sizeof(passwd));
     if (code) {
        if (!Silent) {
            fprintf (stderr,
index 7fa0901a6e0b189b066b5a63a9751aba2a874914..056a74b9840b6fdc0a92f133e884aaa03c5c1a24 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -327,7 +327,7 @@ int main (argc, argv)
        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));
@@ -335,7 +335,7 @@ int main (argc, argv)
            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]) {
@@ -344,7 +344,7 @@ int main (argc, argv)
        }
        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));
@@ -432,7 +432,7 @@ abort_1:
     
     {   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) {
@@ -440,7 +440,7 @@ abort_1:
            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);
@@ -505,14 +505,14 @@ abort_3:
 
        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");
index 733b1adfa6dc10b66958676926b1a21ceb182d73..38dcb795a25ec64d0aecfa0eeb979adbbb26522a 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -266,7 +266,7 @@ static long Main (as, arock)
        
     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: ");
index 1aeff22fbac40e6e56dc8f1835091e10faacf3ae..7905cd101129e0f13a8ecc77c068f89db7b233f6 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -234,9 +234,9 @@ static int CheckAuth2 (server)
 
     /*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
@@ -271,8 +271,8 @@ static int CheckAuth2 (server)
        (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;
@@ -302,7 +302,7 @@ static void ListCellsCmd ()
        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 */
@@ -315,7 +315,7 @@ static void ListCellsCmd ()
        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);
@@ -820,7 +820,7 @@ main (argc, argv)
     /* 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");
@@ -849,7 +849,7 @@ main (argc, argv)
        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 */
index 68856501d0439ead9b2df1813ff357a39008d8ff..95516417ff860a917d9c1595f7fc8d7c82d8bcbb 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -140,7 +140,7 @@ static long Main (as, arock)
     
     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: ");
@@ -171,11 +171,11 @@ static long Main (as, arock)
 
     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);
index 75f6bb107825479f6988c839e25340b3ddbe941b..8cca463ea97bacc51462052ad564529f9180eee7 100644 (file)
@@ -17,7 +17,7 @@
 #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"
@@ -71,7 +71,7 @@ afs_int32 GetTickets (
     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;
@@ -238,7 +238,7 @@ afs_int32 ka_UserAuthenticateGeneral (
            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) {
index 29abf1cd3fa1ba35321293b8f93ba6b6cb9d7928..1efc0e72d082a09144c5d0d5dbc168b8ee82ff1b 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/user_nt.c,v 1.1.1.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>
 
@@ -49,6 +49,8 @@ static char *ka_MapKerberosError(int code)
                        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);
index 9673d68f17c58425a01c7c639c187737a647fdc3..2377a4c133f4c42f776f57d731ad4874cdc83b01 100644 (file)
@@ -16,7 +16,7 @@
 #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
@@ -24,6 +24,9 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/libacl/aclprocs.c,v 1.1.1.5 2001/07/14
 #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>
@@ -38,10 +41,6 @@ pthread_mutex_t acl_list_mutex;
 static int AddToList();
 static int GetFromList();
 
-#ifdef AFS_ALPHA_ENV
-extern char *index();
-#endif
-
 struct freeListEntry {
     struct freeListEntry *next;
     int size;
@@ -177,7 +176,7 @@ char **elist;
     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;
@@ -252,14 +251,14 @@ struct acl_accessList **acl;
        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;
index 2db1170779d67de77ac7fa818624b533a3bf56af..dd33f4151237d14775fb1c587b689af15087a9c2 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -3112,7 +3112,7 @@ int ADMINAPI bos_ExecutableRestartTimeSet(
     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;
index 5a2ebada04c6841ae1c06075d3b6639f30f14231..eb88a5929eb94e4c2486a71ac411762d479e697a 100644 (file)
@@ -10,7 +10,7 @@
 #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"
@@ -1260,7 +1260,7 @@ static int Parent(
     int rc = 0;
 
     strcpy(parentDirectory, directory);
-    tp = rindex(parentDirectory, '/');
+    tp = strrchr(parentDirectory, '/');
     if (tp) {
         *tp = 0;
        rc = 1;
index 33cba4a3e6f8ccd55d1482bdf5b61760ad348da9..720690b8877ffb723b8053a040eb9c9d74818849 100644 (file)
@@ -14,7 +14,7 @@
 #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"
 
@@ -203,7 +203,7 @@ int ktime_ParsePeriodic(
     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) {
index 0dcebcf26fe3445caa3e64632f898a5d051a18e0..6b9c9c16d275ac1b500ba2d1b1fc93b997d0cec6 100644 (file)
 #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>
index 4bc5e3c4d1864fe10c537ed043467ca6fa44c22c..907922f29c715e603a8795a53decf09524bfe771 100644 (file)
 #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
 
index 12c92d013a22c4eea87b0dee0bb4ebdd5656a046..a47c3bddce94da56f8db1c97a56ce7e2ba2c8680 100644 (file)
 #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
 
@@ -45,7 +45,7 @@ static int OldVLDB_to_NewVLDB(
     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];
@@ -81,7 +81,7 @@ static int NewVLDB_to_OldVLDB(
     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++) {
@@ -358,11 +358,11 @@ int VLDB_IsSameAddrs(
        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) {
index 74abe9686525b0dc213cd6d37b353ef989b01537..6bc1b404f752304b88f90ae9d1557f3ee70ab02d 100644 (file)
@@ -21,7 +21,7 @@
 #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"
@@ -29,11 +29,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/vos/vsprocs.c,v 1.1.1.5 2001/0
 #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
@@ -1468,8 +1468,8 @@ int UV_ReleaseVolume(
   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)) {
@@ -1675,7 +1675,7 @@ int UV_ReleaseVolume(
 
   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];
@@ -1691,10 +1691,10 @@ int UV_ReleaseVolume(
       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);
@@ -2249,7 +2249,7 @@ int UV_RestoreVolume(
     int index, same;
 
 
-    bzero(&cookie,sizeof(cookie));
+    memset(&cookie, 0, sizeof(cookie));
     islocked  = 0;
     success = 0;
     error = 0;
@@ -2922,7 +2922,7 @@ static afs_int32 ProcessEntries(
        }
        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;
@@ -3512,7 +3512,7 @@ int UV_SyncServer(
 
     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;
index 48d3fff4385c54cd6a832850e811eb97ebf9ec5c..0d7c3ab4e8b48357cdd03ee14674a2d053d78bd2 100644 (file)
@@ -7,9 +7,25 @@
 
 # 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 = \
@@ -23,7 +39,8 @@ AFS_OS_OBJS = \
        osi_timeout.o \
        osi_vm.o \
        xdr.o \
-       xdr_array.o
+       xdr_array.o \
+       xdr_int64.o
 
 AFSNOIAUTHOBJS = \
        afs_call.o \
@@ -48,7 +65,7 @@ OPT2   = -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 \
@@ -56,7 +73,7 @@ KDEFS = -U_IBMR2 -D_POWER -D_AIX -DNLS -D_NLS -DMSG -D__STR31__ -Daiws \
         -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}
@@ -66,15 +83,18 @@ KOBJ = MODLOAD
 
 # 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
@@ -84,21 +104,20 @@ setup:
        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 $? $@
@@ -110,63 +129,74 @@ $(DEST_LIBAFSIAUTH): $(LIBAFSIAUTH)
        -${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
index 39ff8f8d6bcbd5bee3ea593bea13801a60cecf96..91315c3b135428b3766baf9406bf46f2b81f87b8 100644 (file)
@@ -1,11 +1,27 @@
 #/* 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:
@@ -19,7 +35,8 @@ AFS_OS_OBJS = \
        osi_vnodeops.o \
        osi_module.o \
        xdr.o \
-       xdr_array.o
+       xdr_array.o \
+       xdr_int64.o
 
 
 #AFS_OS_NFSOBJS = osi_vfsops_nfs.o
@@ -44,15 +61,18 @@ KOBJ = MODLOAD
 
 # 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
@@ -67,12 +87,22 @@ setup:
 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 $? $@
@@ -109,7 +139,8 @@ osi_vnodeops.o: $(AFS)/osi_vnodeops.c
 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)
index c1abece414ac440496c8da3411f41a0c28e34a81..cf848daa0888dde093a4d05ff08b425ee8497a84 100644 (file)
@@ -7,9 +7,25 @@
 
 # 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:
@@ -48,15 +64,18 @@ KOBJ = STATIC
 
 # 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
@@ -72,21 +91,39 @@ setup:
 # 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)
@@ -95,6 +132,8 @@ ${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
index 13fcbf7697b1e65fffb95dc542fac459a526077c..67e3c39088225584536f4da0ff958066f75ec413 100644 (file)
@@ -1,10 +1,26 @@
 #/* 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 = \
@@ -14,7 +30,8 @@ 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
@@ -42,15 +59,18 @@ KOBJ = STATIC
 
 # 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
@@ -67,15 +87,34 @@ setup:
 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 $? $@
@@ -109,3 +148,5 @@ osi_vm.o: $(AFS)/osi_vm.c
        $(CRULE1)
 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
        $(CRULE1)
+xdr_int64.o: $(RX)/xdr_int64.c
+       $(CRULE1)
index 89656fec768a3462c751044f9d21df8d5f2a15ad..ab50ceb3c97e64cc0b37211c1ddd5644e33112d7 100644 (file)
@@ -7,9 +7,25 @@
 
 # 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 = \
@@ -20,7 +36,8 @@ 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
@@ -69,13 +86,15 @@ KOBJ=STATIC
 #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
@@ -91,15 +110,16 @@ setup:
                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 \
@@ -110,24 +130,37 @@ ${COMPDIRS}:
                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 $? $@
@@ -163,6 +196,8 @@ osi_vm.o: $(AFS)/osi_vm.c
        $(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.
index 286f69fd8d4771e975771896c18ce41facc47e41..76f9afa9bd3443ceb3b40911dfc7b496a2c8e344 100644 (file)
@@ -7,9 +7,25 @@
 
 # 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 = \
@@ -21,7 +37,8 @@ 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
@@ -45,7 +62,7 @@ MPS=MP
 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.
@@ -195,6 +212,8 @@ CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) -G 0 $(KDEFS) $(
 #COMPDIRS = single_compdir
 # This is the irix multiple directory target.
 COMPDIRS = irix_compdirs
+INSTDIRS = irix_instdirs
+DESTDIRS = irix_destdirs
 
 include Makefile.common
 
@@ -213,12 +232,11 @@ KOBJ = STATIC MODLOAD
 
 
 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}" ; \
@@ -232,9 +250,10 @@ setup:
                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
@@ -248,9 +267,10 @@ setup:
                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>
@@ -259,7 +279,7 @@ setup:
 
 # Compile static and modload versions of the clients.
 <all -sgi_65>
-${COMPDIRS}:
+${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
        BUILDPROCS="${PROCESSORS}" ; \
        if [ "${CPUARCH}" != "" ] ; then \
                BUILDPROCS=${CPUARCH}; \
@@ -303,13 +323,13 @@ ${COMPDIRS}:
                        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}"; \
@@ -340,95 +360,144 @@ ${COMPDIRS}:
                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)
index 505692d09a785c8e829378e3023c7ef0e1dd3119..33864289d496081d35972f5396653b2f9ebdea88 100644 (file)
@@ -7,7 +7,25 @@
 
 # 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 = \
@@ -16,7 +34,8 @@ 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
@@ -50,16 +69,20 @@ KOBJ = MODLOAD32 MODLOAD64
 # 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
@@ -71,9 +94,10 @@ setup:
        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
 
 
@@ -81,7 +105,7 @@ setup:
 ## 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 \
@@ -95,10 +119,14 @@ ${COMPDIRS}:
                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:
@@ -106,15 +134,25 @@ LIBAFS = libafs.o
 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 $? $@
@@ -132,27 +170,33 @@ ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
        $(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)
index 8dc837c20b9dc26573f6f36b7bae55fff2a3d0f9..bb8fe04cc9566a9293d528d3dd116a53f16dbfd9 100644 (file)
@@ -21,28 +21,30 @@ NS_INCL =SRC/../afsweb/netscape_includes
 
 # 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 $?
@@ -889,6 +891,56 @@ $(WEBOBJ)/Krxstat.xdr.o: $(AFSINT)/Krxstat.xdr.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} $? $@
index 4c1131f8d6bc2bedce761c8e5f228f8f5a50e53c..4ed56233c99fca9d273d3be3428bf8b0739ea16c 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -74,8 +74,8 @@ char **argv; {
     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) {
@@ -89,7 +89,7 @@ char **argv; {
     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) {
index 76ba2297460cc755f705cc87729f1e2eec6e9f7b..3172285c3b9d7a28e64fc24ff616645a518d5fd3 100644 (file)
@@ -23,7 +23,7 @@
 #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>
@@ -193,7 +193,7 @@ main (argc, argv)
                 */
            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",
index 8494b5f0d9ce0677e3273bb25afe2bd86e650e32..348ee358e58d3e5eb15b7527355cb0b5b31cbb9b 100644 (file)
@@ -39,7 +39,7 @@
 #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>
@@ -747,7 +747,7 @@ doafs:
                    (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));
@@ -2040,7 +2040,7 @@ static char *getlinep(const char *string, int size, FILE *stream) {
     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)
index f599c9b7f11e13b54b287dcd59a4c3e7b991abfc..54e65d6e0c45ed89dd3a117abfb196386ff9d049 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -68,7 +68,7 @@ setenv(name, value, rewrite)
                            (cnt + 2)));
                        if (!P)
                                return(-1);
-                       bcopy(environ, P, cnt * sizeof(char *));
+                       memcpy(P, environ, cnt * sizeof(char *));
                        environ = P;
                }
                environ[cnt + 1] = NULL;
index e762e2a6279411cfb58ff8d43baa3e4bb6a55281..3763af4a16ff71b3f6add28e3b2c31d49afba3e9 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -54,9 +54,9 @@ logout(line)
                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);
index a48915f0c7ca180602c1ce175dc7cf86c238724c..b3cfb20ebc554f1cebef634f857cc1f2a96e1c1d 100644 (file)
@@ -24,7 +24,7 @@
 #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>
@@ -244,7 +244,7 @@ static struct IoRequest *NewRequest()
 #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)
index d95240e3c56fccca8b607baf8407376dd60bee36..b29f03884e9c7a6ee317c86e1518b9194706696f 100644 (file)
@@ -28,7 +28,7 @@
 #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"
@@ -39,7 +39,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/test/selsubs.c,v 1.1.1.4 2001/07/14
 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;
 }
 
index 1bea2a9f6231d82cf160d7f11e2c7d48c70c4e8b..f2c32396d4eccaaa740f169d2870874719e8e3ce 100644 (file)
@@ -20,7 +20,7 @@
 #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"
@@ -376,7 +376,7 @@ int LWP_MwaitProcess(wcount, evlist, ecount)        /* wait on m of n events */
        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);
index 0d23d95814a74d5ae8dfa63f6fc352b7fe7a5190..4dd07ddc37c35b2b2852dd6595c3f81a3510af65 100644 (file)
 #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)
index 54203e7a3e095fda6db96c47eabb1318bece1c6f..42b38199dd9936a617637fd6fc414a63d007b9a5 100644 (file)
@@ -22,7 +22,7 @@
 #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>
index 34fd10ba15a1f445c67964b1eaaa6b743ed35dcf..3aae6b125e862cd958dc66d8ddb8381cad9358ca 100644 (file)
@@ -2,9 +2,9 @@
  *     (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
@@ -215,7 +215,7 @@ static directive(what)
 
        if (*what++ != specialchar)
                return nestp->status;
-       if (cp = rindex(what,'\n'))
+       if (cp = strrchr(what, '\n'))
                *cp = 0;
        for (n = 0; n < 2; n++)
        {
@@ -382,7 +382,7 @@ main( argc, argv )
                                char    *cp, *cp2;
 
                                cp = &argv[0][sizeof("-D")-1];
-                               if (cp2 = rindex(cp,'='))
+                               if (cp2 = strrchr(cp, '='))
                                        *cp2++ = 0;
                                if (cp2 == 0)
                                        cp2 = "";
index 58cdc2c8ffbc6329b3330caddc0eff6ef8c31efd..0f04ee1ee64abeae1bc8109efbde032d0f46d49f 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -97,7 +97,7 @@ main(ac, av)
 
        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;
@@ -137,7 +137,7 @@ main(ac, av)
                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);
@@ -146,12 +146,12 @@ main(ac, av)
                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);
index b1e4a3a9bed11c52f251239727cb4b1f815e96d9..3d94678ed5316c43edf2e2a76d2a0eae358bf253 100644 (file)
@@ -32,7 +32,7 @@
 #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
@@ -160,10 +160,10 @@ main(argc, argv)
                                        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;
index 72fbf110eab6d1fba2e9bbb3f826272a36f3bb33..423c848ceeaf865f64b6f7f95425f7b153a3c463 100644 (file)
@@ -13,7 +13,7 @@
 #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
index d448287b484ed4e0ae0ba715cc6a212fecfedd84..77773da81917b97d38ed64f931b63d3d3c5d632d 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -287,7 +287,7 @@ ZeroAIXcum()
     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)
index 54c16575954ee976ec413cbc43fe9e9b7031d9f8..82f80a9e2cbd1948dc25240db1a4200cfc3fca00 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -284,12 +284,12 @@ main(argc, argv)
 #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)
@@ -753,7 +753,7 @@ init_ntp(config)
        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",
@@ -1296,8 +1296,7 @@ GetHostName(name, sin)
        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);
        }
index e307a6b1cdb4552a0f4e96fb888ce2b465500d7d..691c7ba17ee159200a4ff02b91205d6c32a1340b 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -76,7 +76,7 @@ main(argc, argv)
        sigaction(SIGSEGV, &nsa, NULL);
 #endif
        (void) gethostname(LocalHostName, sizeof LocalHostName);
-       if (p = index(LocalHostName, '.')) {
+       if (p = strchr(LocalHostName, '.')) {
                *p++ = '\0';
                LocalDomain = p;
        }
@@ -213,7 +213,7 @@ query(host)
        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;
@@ -223,7 +223,7 @@ query(host)
                        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) {
@@ -363,7 +363,7 @@ cvthname(f)
        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);
 }
index ab0ca6b667debd2e78af591fc3cb2dc809e1faa3..82c3b47d0b584b2dcf72d0d1c95877a27d75fbe6 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
@@ -126,12 +126,12 @@ char *timesource;
        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';
index ce4aa4d73e22b889140cfe150e30387c14218d97..6020ffd8df41f1431c38abca0336ad79f896253c 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -212,7 +212,7 @@ main (argc, argv)
     /* 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) {
index 0ca778227b7f57a55b45f1640b04afcdc9b75dca..663739fb05cb581853277b70479d1c4370487b0b 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -198,8 +198,8 @@ test5(v)
     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;
index bc774cccb08d526bf1ff4787835ab3d81d17a2fb..068f7f096f3e7c84b53f03b0e1141e0736bf3298 100644 (file)
@@ -26,7 +26,6 @@
 
 char *emalloc();
 char *strcpy();
-char *rindex();
 CTREEPTR LocateChildNode();
 
 static char path2[MAXPATHLEN+1];    /* $$get rid of this */
@@ -71,7 +70,7 @@ static CheckMount(path)
       * 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++ = '/';
@@ -80,7 +79,7 @@ static CheckMount(path)
     /*
       * 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++ = '/';
index c0056c7237bedb89d47566a9a3fb793c83bf05f2..9e8258366d8898947218d64521264610812c9ed4 100644 (file)
@@ -93,7 +93,7 @@ static CTREEPTR AllocConfigNode()
     register CTREEPTR np;
 
     np = (CTREEPTR) emalloc(sizeof(CTREE));
-    bzero((char *)np, sizeof(CTREE));
+    memset((char *)np, 0, sizeof(CTREE));
     return(np);
 
 } /*AllocConfigNode*/
index ee906d21b1283825a2d84b6d70f63c332cf10420..929115c5815f311fb32d992af61d076a35490203 100644 (file)
@@ -5,36 +5,49 @@
 # 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
@@ -91,14 +104,38 @@ test_pam: test_pam.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
+
index 63dfa2c3f5da6e161db1cd6dc0daee0993f271d0..ae9c95dc73544856a8af77475fc1909d76ae5eef 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_auth.c,v 1.1.1.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>
@@ -29,7 +29,6 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_auth.c,v 1.1.1.5 2001/07/14 22:
 
 #define RET(x) { retcode = (x); goto out; }
 
-
 extern int
 pam_sm_authenticate(
        pam_handle_t    *pamh,
@@ -45,14 +44,24 @@ pam_sm_authenticate(
     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;
@@ -67,7 +76,7 @@ pam_sm_authenticate(
 
 
 #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);
 
@@ -85,11 +94,31 @@ pam_sm_authenticate(
        } 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 {
@@ -102,33 +131,33 @@ pam_sm_authenticate(
     /* 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);
@@ -137,41 +166,38 @@ pam_sm_authenticate(
     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;
     }
@@ -211,15 +237,30 @@ try_auth:
          * 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;
@@ -234,9 +275,35 @@ try_auth:
      * 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 */
@@ -249,9 +316,13 @@ try_auth:
        } 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));
        
@@ -260,13 +331,47 @@ try_auth:
        } 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;
@@ -274,11 +379,18 @@ try_auth:
     }
 
     /* 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:
index cf975660507e2fdf023f1f0bfb041e71424f3828..88e8c35e5200c04b2b97b8e9b553742522a1f836 100644 (file)
@@ -17,7 +17,7 @@
 #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>
@@ -40,13 +40,13 @@ static char *fallback_messages[] = {
     "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      */
@@ -68,17 +68,23 @@ static char *fallback_messages[] = {
     "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 *);
index 8b211b0454cf12b569a9eba3dbb31eb32a243a9a..6ed88e1533ef1104600379453e17d0517233ae9c 100644 (file)
 #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, ...);
index b9a91923bec005e8c12c794782f993bdafa51326..eda2fcc9bf67c4372a9926e4d8436efe6f41b627 100644 (file)
@@ -17,7 +17,7 @@
 #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>
@@ -93,8 +93,11 @@ pam_sm_chauthtok(
 
     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);
@@ -109,7 +112,8 @@ pam_sm_chauthtok(
        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,
@@ -129,7 +133,7 @@ pam_sm_chauthtok(
        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));
@@ -147,13 +151,15 @@ pam_sm_chauthtok(
            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;
index 1a6a65c39144a943ef96364d5b3d6319468c398c..462036787f79bb63db70b7e0737bde7b3c9c6408 100644 (file)
 #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(
@@ -26,6 +33,8 @@ pam_sm_open_session(
 }
 
 
+#define REMAINLIFETIME 300
+
 extern int
 pam_sm_close_session(
        pam_handle_t    *pamh,
@@ -33,5 +42,68 @@ pam_sm_close_session(
        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;
 }
index 6542f08a7d801bf5891c6ef1c5d181bc5cc80022..a1ae0bc30d7400e4c83dd17adabc84dcdfc2ec7b 100644 (file)
 #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>
@@ -44,12 +45,15 @@ pam_sm_setcred(
     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];
@@ -83,11 +87,31 @@ pam_sm_setcred(
        } 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 {
@@ -97,16 +121,18 @@ pam_sm_setcred(
 
     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);
     }
@@ -115,6 +141,9 @@ pam_sm_setcred(
      * 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);
@@ -123,38 +152,36 @@ pam_sm_setcred(
     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);
@@ -164,7 +191,8 @@ pam_sm_setcred(
                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;
@@ -175,8 +203,10 @@ pam_sm_setcred(
                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;
@@ -206,6 +236,7 @@ pam_sm_setcred(
                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);
            }
@@ -216,16 +247,30 @@ pam_sm_setcred(
             * 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 */
@@ -238,10 +283,13 @@ pam_sm_setcred(
                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 */
@@ -256,19 +304,22 @@ pam_sm_setcred(
               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); 
@@ -276,14 +327,15 @@ pam_sm_setcred(
                    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
 
index e305adf55c4423463ecde2d5ba20d8acfb26fcf4..be05fada2cb1e2eeddb99a69322cd79cab9073bb 100644 (file)
@@ -9,11 +9,15 @@
 
 #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"
 
@@ -53,12 +57,12 @@ these facilities, we can safely define these to be null functions */
 
 #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);
 }
@@ -85,3 +89,115 @@ char *cv2string(ttp, aval)
     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);
+}
index 7d66bb92ed8049bd0e8d3a456349851fecaaff43..ff1503730a06a918c275a7fe705b663b7b35bdad 100644 (file)
@@ -27,6 +27,11 @@ void nil_cleanup(
 
 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)
index d9f1f99ee4c25b99a4676c3db3723343a88b69aa..5a034aa84b48b62ed0211ca555223ab64eb8c981 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -43,6 +43,7 @@ void main(int argc, char *argv[])
     int authenticated = 0;
     int retcode;
     char *username;
+    int setcred = 1;
 
     if (argc < 2 || argc > 3) {
        fprintf(stderr, "Usage: %s [-u] <user>\n", argv[0]);
@@ -53,7 +54,8 @@ void main(int argc, char *argv[])
            fprintf(stderr, "Usage: %s [-u] <user>\n", argv[0]);
            exit(1);
        }
-       service = "unixtest";
+       /* service = "unixtest"; */
+        setcred = 0;
        username = argv[2];
     } else {
        username = argv[1];
@@ -81,12 +83,18 @@ void main(int argc, char *argv[])
 
     /* 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);
index e05f09fb8314e5b7baaeca006012a151aca0f3d8..e20034e2daf3251540a1c8c01285cd19945a5944 100644 (file)
@@ -49,7 +49,7 @@ Generic install command.  Options are:
 #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>
@@ -94,10 +94,6 @@ extern struct passwd *getpwnam();
 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;
@@ -118,7 +114,7 @@ static char *strrpbrk (s, set)
     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];
@@ -139,7 +135,7 @@ char *ErrorString(aerrno)
 int
 stripName(aname)
     char *aname;
-    {if (rindex(aname, '.') == 0) return 1;
+    {if (strrchr(aname, '.') == 0) return 1;
     else return 0;
     }
 
@@ -642,7 +638,7 @@ main (argc, argv)
 
     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];
        }
index b0bdfba35a2f4f7d1a13f74b9e03d8fd0d3c250e..318b65df9e3451931ff38ca0448628bd6c201d68 100644 (file)
@@ -12,7 +12,7 @@ extern int errno;
 #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>
@@ -269,7 +269,7 @@ afs_int32 WalkHashTable (hashtable, hashType, map, misc)
            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 {
@@ -613,7 +613,7 @@ afs_int32 WalkChains (map, misc)
            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 */
@@ -724,7 +724,7 @@ afs_int32 DumpRecreate (map, misc)
 
     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++) {
@@ -927,7 +927,7 @@ afs_int32 CheckPrDatabase (misc)
     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) {
@@ -959,7 +959,7 @@ afs_int32 CheckPrDatabase (misc)
        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");
@@ -1052,7 +1052,7 @@ WorkerBee (as, arock)
     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  */
index 8ea3a85549a5bac7b4879ad4ddd94ed8f07dc04f..f90061dfc2d04ffbf541f35d89efd7079c1b601a 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptclient.c,v 1.1.1.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>
@@ -284,7 +284,7 @@ char **argv;
            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);
@@ -458,7 +458,7 @@ char **argv;
        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;
@@ -484,7 +484,7 @@ char **argv;
        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;
index a773d5d5f9cfc380dbb17e1c19d4473d9583d86e..db8dec12bb03654c7d70bd3bf1683657e1f206a7 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -410,7 +410,7 @@ afs_int32 gid;
     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 */
@@ -790,8 +790,8 @@ afs_int32 gid;
     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);
@@ -1164,7 +1164,7 @@ struct prcheckentry *aentry;
     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;
@@ -1292,7 +1292,7 @@ afs_int32 put_prentries(tentry, bulkentries)
   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;
 }
index 4cafd418e006128e015bdc81f632fe1263e08aff..69f0156235ebe8b6c522036a31b2306f0e7915d0 100644 (file)
@@ -14,7 +14,7 @@
 #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"
@@ -181,7 +181,7 @@ afs_int32 pr_Initialize (secLevel, confDir, cell)
        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,
index b6bc73052a429b6e2aa7d7b968824c2a9da8244f..2d584910f4b892a6cfc7d38498d8021e12d1d61c 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -56,7 +56,7 @@ static int CorrectUserName (name)
     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;
 }
@@ -104,7 +104,7 @@ static afs_int32 CorrectGroupName (ut, aname, cid, oid, cname)
        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;
     }
@@ -112,7 +112,7 @@ static afs_int32 CorrectGroupName (ut, aname, cid, oid, cname)
     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. */
@@ -126,10 +126,10 @@ static afs_int32 CorrectGroupName (ut, aname, cid, oid, cname)
     }
   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;
@@ -193,7 +193,7 @@ afs_int32 CreateEntry (at, aname, aid, idflag, flag, oid, creator)
     struct prentry tentry, tent;
     char *atsign;
     
-    bzero(&tentry, sizeof(tentry));
+    memset(&tentry, 0, sizeof(tentry));
 
     if ((oid == 0) || (oid == ANONYMOUSID)) oid = creator;
 
@@ -224,7 +224,7 @@ afs_int32 CreateEntry (at, aname, aid, idflag, flag, oid, creator)
         return PRBADARG;
     }
 
-    atsign = index(aname,'@');
+    atsign = strchr(aname, '@');
     if (!atsign) {
        /* A normal user or group. Pick an id for it */
        if (idflag) 
@@ -431,7 +431,7 @@ afs_int32 RemoveFromEntry (at, aid, bid)
     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);
@@ -487,7 +487,7 @@ afs_int32 RemoveFromEntry (at, aid, bid)
        } /* for all coentry slots */
        hloc = nptr;
        nptr = centry.next;
-       bcopy(&centry,&hentry,sizeof(centry));
+       memcpy(&hentry, &centry, sizeof(centry));
     } /* while there are coentries */
     return PRNOENT;
 }
@@ -505,7 +505,7 @@ afs_int32 DeleteEntry (at, tentry, loc)
     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 */
@@ -594,7 +594,7 @@ afs_int32 DeleteEntry (at, tentry, loc)
        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;
@@ -698,7 +698,7 @@ afs_int32 AddToEntry (tt, entry, loc, aid)
     else {
        entry->next = nptr;
     }
-    bzero(&aentry,sizeof(aentry));
+    memset(&aentry, 0, sizeof(aentry));
     aentry.flags |= PRCONT;
     aentry.id = entry->id;
     aentry.next = 0;
@@ -1091,8 +1091,8 @@ afs_int32 ChangeEntry (at, aid, cid, name, oid, newid)
     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);
@@ -1163,7 +1163,7 @@ afs_int32 ChangeEntry (at, aid, cid, name, oid, newid)
        }
     }
 
-    atsign = index(tentry.name, '@'); /* check for foreign entry */
+    atsign = strchr(tentry.name, '@'); /* check for foreign entry */
 
     /* Change the owner */
     if (oid && (oid != tentry.owner)) {
@@ -1216,7 +1216,7 @@ afs_int32 ChangeEntry (at, aid, cid, name, oid, newid)
        {
             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) ||
@@ -1301,7 +1301,7 @@ AddAuthGroup(tentry, alist, size)
   prlist *alist;
   afs_int32 *size;
 {
-       if (!(index(tentry->name, '@'))) 
+       if (!(strchr(tentry->name, '@'))) 
              return (AddToPRList (alist, size, AUTHUSERID));
        else 
             return PRSUCCESS;
index fc1f31f647724028b324b0cc2021d27a243805b4..b4686853639635084283a15b757ada2b8107c395 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -107,14 +107,14 @@ char **argv;
        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);
@@ -133,9 +133,9 @@ char **argv;
            }
            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);
@@ -155,7 +155,7 @@ char **argv;
                        }
                        if (lnames.namelist_val) free(lnames.namelist_val);
                    }
-                   bzero(name,PR_MAXNAMELEN);
+                   memset(name, 0, PR_MAXNAMELEN);
                    skip(&tmp);
                }
            }
@@ -164,11 +164,11 @@ char **argv;
            /* 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);
@@ -188,7 +188,7 @@ char **argv;
                    }
                    if (lnames.namelist_val) free(lnames.namelist_val);
                }
-               bzero(name,PR_MAXNAMELEN);
+               memset(name, 0, PR_MAXNAMELEN);
                skip(&tmp);
            }
        }
index 445306ee10d62a75aa560747835b32dc0c621420..0fc6336159c1c5eaa72f4666b7838e8799b5adc4 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -82,12 +82,12 @@ char **argv;
        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)
index 40a30a3e9623a8bcd1fcef2cfece8ef8261fd521..62844ccfaff4f178625f2b048271d977862c7898 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -464,12 +464,12 @@ TestManyMembers (as, arock)
     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));
@@ -898,7 +898,7 @@ static int MyBeforeProc (as, arock)
            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;
        }
index 9231dca9a335514df1137bff197914e8bea9b605..465e6f98996af95b34247898a4ca7916af24c59a 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -90,7 +90,7 @@ struct prentry *tentry;
     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);
@@ -140,7 +140,7 @@ struct prentry *tentry;
     }
     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);
@@ -181,7 +181,7 @@ pr_WriteCoEntry(tt, afd, pos, tentry)
     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);
@@ -211,7 +211,7 @@ struct contentry *tentry;
     }
     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);
@@ -259,7 +259,7 @@ afs_int32 pos;
     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);
@@ -284,13 +284,13 @@ afs_int32 aid;
     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;
@@ -314,13 +314,13 @@ struct prentry *tentryp;
     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;
@@ -436,8 +436,8 @@ afs_int32 *loc;                             /* ??? in case ID hashed twice ??? */
     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);
@@ -478,7 +478,7 @@ afs_int32 loc;                              /* ??? */
 
     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]);
@@ -503,8 +503,8 @@ afs_int32 *loc;
 
     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);
@@ -544,7 +544,7 @@ afs_int32 loc;
     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]);
@@ -690,7 +690,7 @@ afs_int32 gid;
        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);
@@ -707,7 +707,7 @@ afs_int32 gid;
        }
        loc = nptr;
        nptr = tentry.nextOwned;
-       bcopy(&tentry,&bentry, sizeof(tentry));
+       memcpy(&bentry, &tentry, sizeof(tentry));
     }
     return PRSUCCESS;
 }
@@ -765,7 +765,7 @@ afs_int32 gid;
     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;
@@ -776,7 +776,7 @@ afs_int32 gid;
     if (tentry.next) {
        loc = tentry.next;
        while (loc) {
-           bzero(&centry,sizeof(centry));
+           memset(&centry, 0, sizeof(centry));
            code = pr_ReadCoEntry(at,0,loc,&centry);
            if (code) return 0;
            for (i=0;i<COSIZE;i++) {
index d3e360ba5c36ff4b5029486a4fb33f787d3dfda1..d6b3cc1cc167a2e662da15e2f9a1490bfa5f2348 100644 (file)
@@ -21,7 +21,7 @@
 #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>
@@ -70,7 +70,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rcp/rcp.c,v 1.1.1.4 2001/07/14 22:23:23
 #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[];
@@ -170,7 +170,7 @@ main(argc, argv)
                *targ++ = 0;
                if (*targ == 0)
                        targ = ".";
-               thost = index(argv[argc - 1], '@');
+               thost = strchr(argv[argc - 1], '@');
                if (thost) {
                        *thost++ = 0;
                        tuser = argv[argc - 1];
@@ -197,7 +197,7 @@ main(argc, argv)
                                *src++ = 0;
                                if (*src == 0)
                                        src = ".";
-                               host = index(argv[i], '@');
+                               host = strchr(argv[i], '@');
                                if (host) {
                                        *host++ = 0;
                                        suser = argv[i];
@@ -258,7 +258,7 @@ main(argc, argv)
                                *src++ = 0;
                                if (*src == 0)
                                        src = ".";
-                               host = index(argv[i], '@');
+                               host = strchr(argv[i], '@');
                                if (host) {
                                        *host++ = 0;
                                        suser = argv[i];
@@ -415,7 +415,7 @@ notreg:
                        error("rcp: %s: not a plain file\n", name);
                        continue;
                }
-               last = rindex(name, '/');
+               last = strrchr(name, '/');
                if (last == 0)
                        last = name;
                else
@@ -477,7 +477,7 @@ rsource(name, statp)
                error("rcp: %s: %s\n", name, sys_errlist[errno]);
                return;
        }
-       last = rindex(name, '/');
+       last = strrchr(name, '/');
        if (last == 0)
                last = name;
        else
index 010a3b5ba03ab2bc838e3a79064539ce1e13f4c7..4a32b091c4583be7e7654c4ebf086d78811b72cf 100644 (file)
@@ -7,7 +7,7 @@
 #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>
@@ -36,7 +36,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rlogind/rexecd.c,v 1.1.1.3 2001/07/14 2
 
 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
@@ -326,7 +326,7 @@ doit(f, fromp)
                addenvvar("PASSWORD_EXPIRES", pwd_expires_str);
        } 
 #endif
-       cp = rindex(pwd->pw_shell, '/');
+       cp = strrchr(pwd->pw_shell, '/');
        if (cp)
                cp++;
        else
index 5a9cf2e738b44f485cb72bbda1e2282c10e018fe..e8e442eca6321506f959cbe31ae8b18defaf9135 100644 (file)
@@ -19,7 +19,7 @@
 #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"
@@ -239,7 +239,7 @@ main(argc, argv)
                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;
@@ -378,11 +378,11 @@ doit(f, fromp)
                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++;
@@ -745,7 +745,7 @@ gotpty:
  
                 {
                 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;
@@ -779,7 +779,7 @@ gotpty:
                 {
                 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);
@@ -911,7 +911,7 @@ control(pty, cp, n)
        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);
@@ -1031,7 +1031,7 @@ protocol(f, p)
                                                if (n) {
                                                        left -= n;
                                                        if (left > 0)
-                                                               bcopy(cp+n, cp, left);
+                                                               memcpy(cp, cp+n, left);
                                                        fcc -= n;
                                                        goto top; /* n^2 */
                                                }
@@ -1274,7 +1274,7 @@ setup_term(fd)
        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
@@ -1301,7 +1301,7 @@ setup_term(fd)
        if (cp) {
                *cp++ = '\0';
                speed = cp;
-               cp = index(speed, '/');
+               cp = strchr(speed, '/');
                if (cp)
                        *cp++ = '\0';
 #ifdef _AIX
@@ -1364,7 +1364,7 @@ setup_term(fd)
 #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;
 
@@ -1372,7 +1372,7 @@ setup_term(fd)
         if (cp) {
                 *cp++ = '\0';
                 speed = cp;
-                cp = index(speed, '/');
+                cp = strchr(speed, '/');
                 if (cp)
                         *cp++ = '\0';
                 cfsetspeed(&tt, atoi(speed));
@@ -1381,7 +1381,7 @@ setup_term(fd)
         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;
@@ -1391,7 +1391,7 @@ setup_term(fd)
        if (cp) {
                *cp++ = '\0';
                speed = cp;
-               cp = index(speed, '/');
+               cp = strchr(speed, '/');
                if (cp)
                        *cp++ = '\0';
                for (cpp = speeds; cpp < &speeds[NSPEEDS]; cpp++)
@@ -1421,7 +1421,7 @@ local_domain(h)
        char *h;
 {
        char localhost[MAXHOSTNAMELEN];
-       char *p1, *p2 = index(h, '.');
+       char *p1, *p2 = strchr(h, '.');
 #ifdef AFS_OSF_ENV
        char *topdomain();
 
@@ -1433,7 +1433,7 @@ local_domain(h)
         p1 = topdomain(localhost);
         p2 = topdomain(h);
 #else
-       p1 = index(localhost, '.');
+       p1 = strchr(localhost, '.');
 #endif
        if (p1 == NULL || p2 == NULL || !strcasecmp(p1, p2))
                return(1);
@@ -1793,7 +1793,7 @@ int s;
                /* (5) sessionKey */
 
                bp = bp + index + 1;
-               bcopy(bp, token.sessionKey.data, 8);
+               memcpy(token.sessionKey.data, bp, 8);
     
                /* (6) kvno */
     
@@ -1843,7 +1843,7 @@ int s;
                        exit(1);
                }
 
-               bcopy(bp, token.ticket, token.ticketLen);
+               memcpy(token.ticket, bp, token.ticketLen);
 
                bp = bp + token.ticketLen;
 
index c9e2b26a2d7ab1cd9e0d002b94d7306ea5981058..8f4614e75379f762b534e73e109d11cbfe1fb935 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -76,8 +76,6 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rsh/rcmd.c,v 1.1.1.5 2001/07/14 22:23:2
 #      define  DPRINTF(args)
 #endif
 
-char   *index();
-
 #include <syslog.h>
 
 static _checkhost();
@@ -116,7 +114,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
        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);
 
@@ -156,9 +154,9 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
 #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... */
@@ -231,8 +229,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
                    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;
@@ -597,7 +594,7 @@ _checkhost(rhost, lhost, len)
                        return(0);
                }
                ldomain[MAXHOSTNAMELEN] = '\0';
-               if ((domainp = index(ldomain, '.')) == (char *)NULL) {
+               if ((domainp = strchr(ldomain, '.')) == (char *)NULL) {
                        nodomain = 1;
                        return(0);
                }
index 611920e194aeabd3c8bfb7fb051df4d0cd2be844..6d02dc2d3ecbc63d1fd011635ead1b74bb3b8068 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -32,7 +32,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rsh/rlogin.c,v 1.1.1.3 2001/07/14 22:23
 # define TIOCPKT_WINDOW 0x80
 # endif /* TIOCPKT_WINDOW */
 
-char   *index(), *rindex(), *malloc(), *getenv();
+char   *malloc(), *getenv();
 struct passwd *getpwuid();
 char   *name;
 int    rem;
@@ -78,7 +78,7 @@ main(argc, argv)
        setlocale(LC_ALL,"");
 #endif
 
-       host = rindex(argv[0], '/');
+       host = strrchr(argv[0], '/');
        if (host)
                host++;
        else
@@ -372,7 +372,7 @@ sigwinch()
        struct winsize ws;
 
        if (dosigwinch && !nosigwin && ioctl(0, TIOCGWINSZ, &ws) == 0 &&
-           bcmp(&ws, &winsize, sizeof (ws))) {
+           memcmp(&ws, &winsize, sizeof (ws))) {
                winsize = ws;
                sendwindow();
        }
index 38fa5c8b9dd4e8b70ff88261734addd09a33ec9d..796733af3f220d525a73013ae7a9c18ae861b099 100644 (file)
@@ -18,7 +18,7 @@
 #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 */
@@ -139,7 +139,7 @@ main(argc, argv0)
      */
     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], '/');
@@ -331,7 +331,7 @@ another:
        }
        (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
index ef91730dc61d89c84e89331f417bcba0280303ce..352647f617eff90dbb9e4a1a0be8fb2ac8d6d5ea 100644 (file)
@@ -10,7 +10,7 @@
 #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"
@@ -109,7 +109,7 @@ void ip_stripoptions(struct mbuf *m, STRIP_ARG2_TYPE mopt)
        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;
@@ -382,7 +382,7 @@ int istack;
        m->m_len = 0;
        while (len) {
          rlen = MIN(len, tl);
-         bcopy(tdata, tpa, rlen);
+         memcpy(tpa, tdata, rlen);
          asize -= rlen;
          len -= rlen;
          tpa += rlen;
@@ -416,7 +416,7 @@ int istack;
                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;
index efe356eedcd6dae1d6702ab9685aa0438bea6944..92886b94b32e909d2efbd0362b5b9e61f1279f8f 100644 (file)
@@ -10,7 +10,7 @@
 #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"
 
@@ -153,7 +153,7 @@ osi_NetSend(asocket, addr, dvec, nvecs, alength, istack)
         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:
index 1f0adbaba7385786c983bf48171ff3cd419fd340..6c0c1f379b09cb5b8bed153e6e34a598b381f148 100644 (file)
@@ -10,7 +10,7 @@
 #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"
@@ -31,7 +31,7 @@ rxk_init() {
        /* 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;
           /*
@@ -292,7 +292,7 @@ nopages:
        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;
@@ -328,7 +328,7 @@ nopages:
        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.  */
index b5abc37fd25a5f193ec672a3e209db57b0de599b..5136de96555fe66abdc6782f5c4059010d24c257 100644 (file)
@@ -23,7 +23,7 @@
 #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"
@@ -44,7 +44,7 @@ rxk_init() {
        /* 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;
           /*
@@ -303,7 +303,7 @@ nopages:
        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;
@@ -339,7 +339,7 @@ nopages:
        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.  */
index 8032113aef27bbc181c3fa67e9897835acc1bf4a..ff72371ca39a84355c86ee7d0cda10440d4a053b 100644 (file)
@@ -5,7 +5,7 @@
 #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"
@@ -74,7 +74,7 @@ rxk_init() {
            /* 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;
@@ -227,14 +227,14 @@ osi_NetSend(asocket, addr, dvec, nvec, asize, istack)
     /* 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;
@@ -258,7 +258,7 @@ int osi_NetReceive(struct socket *so, struct sockaddr_in *from,
     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;
@@ -270,7 +270,7 @@ int osi_NetReceive(struct socket *so, struct sockaddr_in *from,
     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;
         }
index 0835620e8333fc8193b2a44c1beae1d60e9dd04e..44493d2b33931822430bffa9a7a55ea54341fd5d 100644 (file)
@@ -10,7 +10,7 @@
 #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"
@@ -68,7 +68,7 @@ int osi_NetReceive(osi_socket so, struct sockaddr_in *from,
     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
@@ -103,7 +103,7 @@ int osi_NetReceive(osi_socket so, struct sockaddr_in *from,
     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);
        }
@@ -262,7 +262,7 @@ void rxk_init(void) {
     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;
@@ -424,7 +424,7 @@ osi_NetSend(asocket, addr, dvec, nvec, asize, istack)
     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;
@@ -441,7 +441,7 @@ osi_NetSend(asocket, addr, dvec, nvec, asize, istack)
 
     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);
@@ -522,7 +522,7 @@ osi_NetSend(asocket, addr, dvec, nvec, asize, istack)
        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;
@@ -559,7 +559,7 @@ osi_NetSend(asocket, addr, dvec, nvec, asize, istack)
        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.  */
index ff7e05264878712d6d54c592ea43cd3229b16ef2..c567ba49aed3957ff595a9d1a5b2e143eea73d08 100644 (file)
@@ -10,7 +10,7 @@
 #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"
@@ -240,7 +240,7 @@ int osi_NetReceive(asocket, addr, dvec, nvecs, alength)
        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;
        }
@@ -350,7 +350,7 @@ struct osi_socket *rxk_NewSocket(short aport)
        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);
@@ -422,7 +422,7 @@ int osi_NetSend(asocket, addr, dvec, nvecs, asize, istack)
     }
 
     /* 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;
 
@@ -439,7 +439,7 @@ int osi_NetSend(asocket, addr, dvec, nvecs, asize, istack)
        }
 
        /* 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;
 
@@ -461,7 +461,7 @@ int osi_NetSend(asocket, addr, dvec, nvecs, asize, istack)
     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;
 
@@ -563,7 +563,7 @@ int osi_NetReceive(asocket, addr, dvec, nvecs, alength)
        /*
         * 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
@@ -580,12 +580,12 @@ int osi_NetReceive(asocket, addr, dvec, nvecs, alength)
            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;
index f86b2c7f6956ffe45debf9f72671187b4af19fad..1e9bbcf503cbf3b9e8c03b99d51967f02ea91b8e 100644 (file)
@@ -12,7 +12,7 @@
 #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>
@@ -35,7 +35,7 @@ static u_long GetIpAddress(hostname)
        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;
 }
 
index bbb106d48d43eb768877e5c4f95146790af8c15d..7fde52204767d9202d0a13805389ab41647987e6 100644 (file)
@@ -12,7 +12,7 @@
 #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>
@@ -45,7 +45,7 @@ static u_long GetIpAddress(hostname)
        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;
 }
 
@@ -116,7 +116,7 @@ async_BulkTest(host, conn, store, count, verbose, file)
     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);
index 3d2a48289c4c663b299056e21d2d75703afeb36b..899636c4e262a9f2b2b55bb6790e22e44c006669 100644 (file)
@@ -12,7 +12,7 @@
 #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>
@@ -33,7 +33,7 @@ static u_long GetIpAddress(hostname)
        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;
 }
 
index addb64cff460d6bc5a7c1f5725492ed8e98b54a2..79ab60835246fb2872ab8cbba86e207342c49671 100644 (file)
@@ -54,6 +54,7 @@
 # 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
index 31e8aa4f0b2891496dd2aed0d84eae47c912eec2..5d42c3a8c9964ea128370db47f4df3b9aae61654 100644 (file)
@@ -7,14 +7,14 @@
  * 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
@@ -420,6 +420,7 @@ void shutdown_rxevent(void)
        osi_Free((char *)xp, sizeof(struct xfreelist));
        xp = nxp;
     }
+    xfreemallocs = (struct xfreelist *) 0;
 #endif
 
 }
index e96185b200dcb2384dd2292bccf614aa0c4d6a34..1d919e69d9cb13125ba3c79be8f9b2bc030ef4c2 100644 (file)
@@ -14,7 +14,7 @@
 #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"
 
@@ -440,8 +440,8 @@ void shutdown_rxkernel(void)
     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;
@@ -468,8 +468,8 @@ int rxi_GetcbiInfo()
    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);
@@ -570,8 +570,8 @@ int rxi_GetIFInfo()
     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) {
@@ -748,7 +748,7 @@ struct osi_socket *rxk_NewSocket(short aport)
        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);
@@ -794,7 +794,7 @@ struct osi_socket *rxk_NewSocket(short aport)
 #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);
index 3014df9bb62e6eae38e89c8955a7cea5fe4b9865..ec5a407bee22f972c0cf35b8655e74f3b88e6466 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -29,11 +29,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_misc.c,v 1.1.1.5 2001/07/14 22:23
 #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
index 8941e26a304930101bb1ba850d4c94ea590d2b66..b77cffe394220a650c05f892c473932ef47fd0cb 100644 (file)
                                     * 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 */
@@ -245,7 +252,7 @@ struct rx_packet {
     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.
@@ -313,13 +320,13 @@ struct rx_packet *rxi_SplitJumboPacket();
 #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; }
index 6784c4c3fbd41520cfc82805ff941e8c2e35f69c..0c04028e26871352083e5eed30e685688751771f 100644 (file)
@@ -14,7 +14,7 @@
 #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
@@ -72,11 +72,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_rdwr.c,v 1.1.1.7 2001/07/14 22:23
 # 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
@@ -250,7 +250,7 @@ MTUXXX  doesn't there need to be an "else" here ???
        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;
@@ -325,7 +325,7 @@ int rx_ReadProc(call, buf, nbytes)
     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;
@@ -383,7 +383,7 @@ int rx_ReadProc32(call, value)
        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);
@@ -795,7 +795,7 @@ int rxi_WriteProc(call, buf, nbytes)
        
          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;
@@ -862,7 +862,7 @@ int rx_WriteProc(call, buf, nbytes)
     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;
@@ -920,7 +920,7 @@ int rx_WriteProc32(call, value)
        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);
index 149469bf6b08a151a98185f27d2eee40404bf3ee..ee1000ef2df268ba96725f40f18ac91e7570e275 100644 (file)
@@ -18,7 +18,7 @@ This file is now obsolete.
 #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"
@@ -58,11 +58,11 @@ int rx_stream_ReadProc(sd, buf, nbytes)
        }
        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);
@@ -152,13 +152,13 @@ int rx_stream_WriteProc(sd, buf, nbytes)
            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;
index b886eecaf7cd35cd6c2e49487ebc9780a9be2981..66dcb1d9f2125e3411775fc3c31ea728f6cf4ae3 100644 (file)
@@ -64,7 +64,7 @@ int rx_stream_AllocIov();
 /* 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))
@@ -74,7 +74,7 @@ int rx_stream_AllocIov();
 /* 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))
 
index f193f37c84950da1d8578a27e4227e752f5ade75..6b0998de2a3923dead6e79a4e8595e429a7055f8 100644 (file)
 #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
@@ -119,7 +119,7 @@ void rxi_calltrace(event, call)
         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();
index 738bc7915a20d4dac6adb1e16255d2919760b73d..e1b92b7e68f2d62e102e5f733a81a31ec09b5370 100644 (file)
@@ -12,7 +12,7 @@
 #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>
@@ -35,11 +35,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_user.c,v 1.1.1.5 2001/07/14 22:23
 #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
 
@@ -372,10 +372,10 @@ void rx_GetIFInfo()
 
     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);
@@ -389,7 +389,7 @@ void rx_GetIFInfo()
 #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) {
index 5f3db760314876e88cff0c741b78d5b4adc5e7a2..92166ac6693ed6f01cd2d82f0a4438fb0af7e1f7 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -30,11 +30,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rxdebug.c,v 1.1.1.6 2001/07/14 22:23
 #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>
@@ -159,7 +159,7 @@ struct cmd_syndesc *as;
            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) {
@@ -184,7 +184,7 @@ struct cmd_syndesc *as;
            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 */
 
index fa5a3eb5d09f276bb9960ee010f7b03dbd71a83c..0299098d24f3a7a4ffc85b879dfc9efb8e48dcc8 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -29,7 +29,7 @@ static u_long GetIpAddress(hostname)
        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;
 }
 
index 3947e1b26c868700c883084c3879a659f5be9f15..0af406f6fa6cae69f7a9c45a9dad9ebfd08acf71 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -36,8 +36,8 @@ static MakeVTest(akey, aticket, asession)
 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;
 }
@@ -71,7 +71,7 @@ char **argv; {
                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")) {
index c3514796242114955efefd35739ffffc555accb8..096dd63a4a5ceb666723d010b555d3ee39b6346f 100644 (file)
@@ -12,7 +12,7 @@
 #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>
@@ -179,7 +179,7 @@ char **argv;
     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) {
index 3a423e46bee9aa252dbb1974640954a342c52571..87707e798c7c16819b3df190085531854eff2b6f 100644 (file)
 #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>
index 6ba1f729e4bc0a20b7b3a74722515a64c1038c56..6fe7a605f592137b20c65c221f4765e2a20bc97d 100644 (file)
@@ -6,12 +6,14 @@
 #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>
index b93d4340105f5ddfc1cd92222cc108271d3c2d2e..b65b0c38b258e2e89dcff70da572415f27d07702 100644 (file)
@@ -29,7 +29,7 @@
 #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
 
@@ -128,7 +128,7 @@ xdrmem_getbytes(xdrs, addr, len)
 
        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);
 }
@@ -142,7 +142,7 @@ xdrmem_putbytes(xdrs, addr, len)
 
        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);
 }
index 5695d36a0cac20c7e17f1eb20b11e03c12d6c893..6af2232af904710d2b6c229f381bda8ed5830394 100644 (file)
@@ -46,7 +46,7 @@
 #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"
@@ -269,7 +269,7 @@ xdrrec_putbytes(xdrs, addr, len)
        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;
@@ -520,7 +520,7 @@ get_input_bytes(rstrm, addr, len)
                        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;
index febbc78a3335f586439344018506a89b5e9d24dc..984c4111d78874791afa2004eba5f14a886408f1 100644 (file)
@@ -29,7 +29,7 @@
 #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
 
@@ -79,7 +79,7 @@ xdr_reference(xdrs, pp, size, proc)
                        if (loc == NULL) {
                                return (FALSE);
                        }
-                       bzero(loc, (int)size);
+                       memset(loc, 0, (int)size);
                        break;
        }
 
index da2f13aeab599f71d94096ab865d8a20b2581ba6..1b403232a5f0861d5359aed87a01096d620f6222 100644 (file)
@@ -35,7 +35,7 @@
 #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>
@@ -112,7 +112,7 @@ printbody(proc)
        }
        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),
index 658d3b7b848ac916b47e75880d8d3966301532a2..ddd1ea84fcd8301524210ed3ad6a139fcb371bb9 100644 (file)
 #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"
index 7427df1f7ba592f401ec9790c4c05002a3f9113a..9f69c7f5dc23336794120d20b82d516e007eeb13 100644 (file)
 #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
@@ -201,7 +201,7 @@ main(argc, argv)
            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);
@@ -286,11 +286,11 @@ extendfile(file, ext)
        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
@@ -404,7 +404,7 @@ c_output(infile, define, extend, outfile, append)
 
     open_input(infile, define);        
     cflag = 1;
-    bzero(fullname, sizeof(fullname));
+    memset(fullname, 0, sizeof(fullname));
     if (append) {
        strcpy(fullname, prefix);
        strcat(fullname, infile);
@@ -516,7 +516,7 @@ h_output(infile, define, extend, outfile, append)
 
        open_input(infile, define);
        hflag = 1;
-       bzero(fullname, sizeof(fullname));
+       memset(fullname, 0, sizeof(fullname));
        if (append) {
            strcpy(fullname, prefix);
            strcat(fullname, infile);
@@ -525,12 +525,13 @@ h_output(infile, define, extend, outfile, append)
        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");
@@ -728,7 +729,7 @@ int append;
    
     Cflag = 1;
     open_input(infile, define);        
-    bzero(fullname, sizeof(fullname));
+    memset(fullname, 0, sizeof(fullname));
     if (append) {
        strcpy(fullname, prefix);
        strcat(fullname, infile);
@@ -803,7 +804,7 @@ int append;
    
     Sflag = 1;
     open_input(infile, define);        
-    bzero(fullname, sizeof(fullname));
+    memset(fullname, 0, sizeof(fullname));
     if (append) {
        strcpy(fullname, prefix);
        strcat(fullname, infile);
@@ -902,7 +903,7 @@ parseargs(argc, argv, cmd)
        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] != '-') {
index bc3fd361d4b4633b10a1f38ffe08912c9aba8bad..3cab4116e743abe43184012b645642c6279eee45 100644 (file)
 #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"
@@ -148,7 +148,7 @@ get_definition()
        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:
@@ -882,7 +882,7 @@ token *tokp;
     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:
@@ -904,7 +904,7 @@ token *tokp;
        *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;
@@ -1172,7 +1172,7 @@ int split_flag;
            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);
@@ -1399,11 +1399,11 @@ int *somefrees;
     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;
@@ -1415,7 +1415,7 @@ int *somefrees;
                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;
index 8d3ecb35e59734d03235b19809999e90fe916a31..1ccbd8be49905cfd8a55d4288e8c1c736386f5eb 100644 (file)
 #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"
index 4a5813ed7cdf0c7973c89116e88690f4544c45a7..8c43c0b36cdd43df00ac55c3e2f009b2cffcdff2 100644 (file)
 #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"
@@ -231,7 +231,7 @@ write_program(def, storage)
                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");
index 8af98b723e19df564b576341c9778d7092416988..39a9e57374eacd4fc1efbd4c0f750ed41f422652 100644 (file)
 #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"
@@ -72,7 +72,7 @@ static printwhere();
 reinitialize()
 {
     int i;
-       bzero(curline, MAXLINESIZE);
+       memset(curline, 0, MAXLINESIZE);
        where = curline;
        linenum = 0;
        defined = NULL;
index c4d7e120b9666750abbbeed8c3e7fa141e3c4c51..00a7f6cab7e2a2cbf8a11d294c8617c5c385639f 100644 (file)
@@ -18,7 +18,7 @@
 #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"
@@ -63,7 +63,7 @@ afs_int32 rxkad_DecryptPacket (conn, schedule, ivec, len, packet)
     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)
@@ -106,7 +106,7 @@ afs_int32 rxkad_EncryptPacket (conn, schedule, ivec, len, packet)
     */
     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)
index d3a25203e26a49f0a7cf1ffb10db963297a35ee3..227bd5e2871f93353ecd9a4a9847238e16bf950f 100644 (file)
@@ -19,7 +19,7 @@
 #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
@@ -130,8 +130,8 @@ afs_int32 fc_ecb_encrypt(clear, cipher, schedule, encrypt)
 #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));
@@ -181,8 +181,8 @@ afs_int32 fc_ecb_encrypt(clear, cipher, schedule, encrypt)
        }
     }
 #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);
@@ -210,7 +210,7 @@ afs_int32 fc_cbc_encrypt (input, output, length, key, xor, encrypt)
     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 */
@@ -224,7 +224,7 @@ afs_int32 fc_cbc_encrypt (input, output, length, key, xor, encrypt)
            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 */
@@ -240,7 +240,7 @@ afs_int32 fc_cbc_encrypt (input, output, length, key, xor, encrypt)
        /* 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 */
@@ -251,7 +251,7 @@ afs_int32 fc_cbc_encrypt (input, output, length, key, xor, encrypt)
            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 */
index 93406a4cce235c9be8c9f113ff2379a42b905459..e27caa308721b7c1e2c7eb561a6db80838e0206f 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -101,14 +101,14 @@ int main (argc, argv)
        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));
@@ -120,7 +120,7 @@ int main (argc, argv)
 #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;
index b0bf3d8d7955aada234d4dbdb8aa1d9517af74fa..211889fd1c3dcfbe1d6449d8b642ae69c49963ca 100644 (file)
@@ -18,7 +18,7 @@
 #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"
@@ -130,15 +130,14 @@ rxkad_AllocCID(aobj, aconn)
        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 */
@@ -174,22 +173,22 @@ rxkad_NewClientSecurityObject(level, sessionkey, kvno, ticketLen, ticket)
 
     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++;
@@ -244,7 +243,7 @@ rxs_return_t rxkad_GetResponse (aobj, aconn, apacket)
     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);
@@ -258,13 +257,13 @@ rxs_return_t rxkad_GetResponse (aobj, aconn, apacket)
        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);
index 8fafce1e4742d081e0cae6b1dc085fb7b8aeeda3..d3b0196fe9dfbf80fbaf2de941cc5df1ceda5770 100644 (file)
@@ -16,7 +16,7 @@
 #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
@@ -59,9 +59,9 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_common.c,v 1.1.1.5 2001/07/
 
 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)
@@ -96,11 +96,10 @@ rxkad_DeriveXORInfo(aconnp, aschedule, aivec, aresult)
     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;
 }
 
@@ -215,7 +214,7 @@ rxs_return_t rxkad_NewConnection (aobj, aconn)
     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;
@@ -223,7 +222,7 @@ rxs_return_t rxkad_NewConnection (aobj, aconn)
        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 */
@@ -453,7 +452,7 @@ rxs_return_t rxkad_PreparePacket (aobj, acall, apacket)
     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)));
index b567c60154cd0aafcfc78d679ab6bade24be401c..d4e1c22dc0c6cb77ac52681c26c58806ecf224e7 100644 (file)
@@ -14,7 +14,7 @@
 #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>
@@ -120,12 +120,12 @@ rxkad_NewServerSecurityObject (level, get_key_rock, get_key, user_ok)
     
     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 */
@@ -190,7 +190,7 @@ rxs_return_t rxkad_GetChallenge (aobj, aconn, apacket)
     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);
@@ -198,7 +198,7 @@ rxs_return_t rxkad_GetChallenge (aobj, aconn, apacket)
        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;
@@ -313,7 +313,7 @@ rxs_return_t rxkad_CheckResponse (aobj, aconn, apacket)
 
     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 */
@@ -322,7 +322,7 @@ rxs_return_t rxkad_CheckResponse (aobj, aconn, apacket)
        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);
@@ -330,7 +330,7 @@ rxs_return_t rxkad_CheckResponse (aobj, aconn, apacket)
            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]);
@@ -370,9 +370,9 @@ rxs_return_t rxkad_CheckResponse (aobj, aconn, apacket)
     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;
index 95015eb66738ef1ef2c6318f8d56c2ffe4db43d7..bfd6057e3cd05da9cbd306f811df89560a872240 100644 (file)
@@ -12,7 +12,7 @@
 #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>
@@ -105,8 +105,8 @@ static int CommandProc (as, arock)
 
     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)) {
index ab81fdb48b5b138029a30d15927740e1547c9a99..a27bf57edc09ace16c96cab404f2c329eca216b5 100644 (file)
@@ -12,7 +12,7 @@
 #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>
@@ -48,7 +48,7 @@ static long GetServer(aname)
        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;
 }
 
@@ -252,7 +252,7 @@ static long CallSimultaneously (threads, rock, proc)
 #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;
@@ -353,7 +353,7 @@ static long RunLoadTest (parms, conn)
     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;
@@ -519,7 +519,7 @@ static long MakeMultiChannelCall (conn, each, expectedCode, codes)
     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;
index dd9e18694400316e574ee4842bb766e50b04c428..81512fe43ed254ad4477add14d7333044e6483b4 100644 (file)
@@ -12,7 +12,7 @@
 #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>
@@ -41,7 +41,7 @@ static long GetKey (rock, kvno, key)
   IN long  kvno;
   OUT struct ktc_encryptionKey *key;
 {
-    bcopy (&serviceKey, key, sizeof(*key));
+    memcpy(key, &serviceKey, sizeof(*key));
     return 0;
 }
 
index ba08b2600c8e878f1111b9aaff2e1430cb156155..5b200ca336d92e8ca98620de1fe718e08aa14678 100644 (file)
@@ -14,7 +14,7 @@
 #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"
@@ -181,15 +181,15 @@ static int decode_athena_ticket (ticket, ticketLen, name, inst, realm,
     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);
@@ -208,7 +208,7 @@ static int decode_athena_ticket (ticket, ticketLen, name, inst, realm,
     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,
@@ -234,7 +234,7 @@ 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);
index ab7e3f4bee1ddff84335edd1f7a2b64527f7f6f2..0820427676427755a224d39d9a864fec4e793f7a 100644 (file)
@@ -14,7 +14,7 @@
 #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
@@ -1546,7 +1546,7 @@ static int init_mini_line(a_skt, a_lineNum, a_line, a_srvname)
       * 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;
@@ -1752,7 +1752,7 @@ static int execute_scout(a_numservers, a_srvname, a_pkg)
        rn, a_numservers, sktbytes);
       scout_CleanExit(-1);
     }
-    bzero(FSSktArray, sktbytes);
+    memset(FSSktArray, 0, sktbytes);
 
     /*
       * Sweep through the server names provided, filling in the socket
@@ -1772,7 +1772,7 @@ static int execute_scout(a_numservers, a_srvname, a_pkg)
                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*/
 
@@ -1794,7 +1794,7 @@ static int execute_scout(a_numservers, a_srvname, a_pkg)
              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
index b0d9d21a095e43fe5ef4f41f1321c93920bf9f1d..13ccbd0626cb406d632637c7b9f2e3775b869e60 100644 (file)
@@ -15,7 +15,7 @@
 #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>
@@ -107,7 +107,7 @@ char *syscall;
        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;
 }
 
@@ -229,7 +229,7 @@ struct ViceIoctl *data;
     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);
index 6ed8badada6250d0efe41dda355fff6f3d2ce963..313730c9f425eee60f4c88a94e2a38b2e1d6b797 100644 (file)
@@ -15,7 +15,7 @@
 #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>
@@ -134,9 +134,9 @@ rmtbulk *InData, *OutData;
     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;
index 6848183f0bb0b4a47bbbc1e3e87fbaf82c1db800..15afcf44c81340e2cad0a067a7ab124ae254bdd0 100644 (file)
@@ -93,7 +93,7 @@ include ..\config\NTMakefile.version
 # nmake /nologo /f ntmakefile install
 #----------------------------------------------- BUTC
 
-$(BUTCEXE): $(BUTCOBJS) $(BUTCLIBS)\r
+$(BUTCEXE): $(BUTCOBJS) $(BUTCLIBS)
        $(EXECONLINK)
        $(EXEPREP)
 
index 1bf1fe19df6d47418a05c6de6b93189e8e570a04..6dcc65cb8c6087a7ec0751121b3ab23f00aadeae 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -107,7 +107,7 @@ int afs_initialize(struct secmethod_table *meths) {
      * 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.
index b989022f9fe55dcca23aca300366ada01c460ad5..f01f165af61aac138c896520516b65f53988df98 100644 (file)
@@ -190,6 +190,7 @@ EXELIBS = \
        $(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)
index d31f43e2a2f5b9cc7a816f492a53481f34084738..968ec1698b9b15675ad2aee3755c0fc3b508f141 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -201,7 +201,7 @@ ubeacon_InitServerListCommon(ame, info, clones, aservers)
         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;
@@ -232,7 +232,7 @@ ubeacon_InitServerListCommon(ame, info, clones, aservers)
         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 */
index 79b94bbed929d002fc331aa597de546c698bbebd..bfd8a1beb0d6615359235fa7a9b04eeaba53d4d0 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -80,7 +80,7 @@ udisk_Debug(aparm)
     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;
@@ -217,7 +217,7 @@ static int DInit (abuffers)
     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;
@@ -306,7 +306,7 @@ static char *DRead(dbase, fid, page)
     /* 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);
@@ -558,7 +558,7 @@ static char *DNew (dbase, fid, page)
 
     if ((tb = newslot(dbase, fid, page)) == 0) return (char *) 0;
     tb->lockers++;
-    bzero(tb->data, PAGESIZE);
+    memset(tb->data, 0, PAGESIZE);
     return tb->data;
 }
 
@@ -582,7 +582,7 @@ udisk_read(atrans, afile, abuffer, apos, alen)
        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;
@@ -658,13 +658,13 @@ udisk_write(atrans, afile, abuffer, apos, alen)
        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;
@@ -694,7 +694,7 @@ udisk_begin(adbase, atype, atrans)
        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;
index c67980a69dab183cba25ff593376aa306cc008cf..a3b1bc1bf652e75f5082b1672ecf472747e9bc7c 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -26,6 +26,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/recovery.c,v 1.1.1.5 2001/07/14 22
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <errno.h>
+#include <afs/afsutil.h>
 
 #define UBIK_INTERNALS
 #include "ubik.h"
@@ -529,7 +530,7 @@ FetchEndCall:
           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);
index 7049d384853bc096ce92f79a033fee9c1250ba8c..f1afaf65e7e8a686848354ce58fd213ae91aadc9 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -522,7 +522,7 @@ SDISK_SendFile(rxcall, file, length, avers)
        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);
index 73f1e73d32d40c12b42443a71070758665af0dbc..ac7dbe65027f686d80d8456a8cf674cbd66f350b 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -222,8 +222,8 @@ int ubik_ServerInitCommon(myHost, myPort, info, clones, serverList, pathName, db
     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;
@@ -399,7 +399,7 @@ int ubik_AbortTrans(transPtr)
     
     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);
@@ -451,7 +451,7 @@ int ubik_EndTrans(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)) {
@@ -530,7 +530,7 @@ int ubik_EndTrans(transPtr)
   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;
@@ -667,9 +667,7 @@ int ubik_Write(transPtr, buffer, length)
     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;
index d8beab6e41acff0788e4224208f2167e4271da10..a016e8b62a71d7622f23b130f85ad7b74ca45f31 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -48,7 +48,7 @@ ubik_ParseServerList(argc, argv, ahost, aothers)
     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 */
@@ -66,7 +66,7 @@ ubik_ParseServerList(argc, argv, ahost, aothers)
                /* 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;
index d3289af71a4361babb341db09f26a04d056413b3..92935b026ad103128fc0e75fa9a7a61401cbd9bb 100644 (file)
 #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
@@ -121,7 +121,7 @@ struct cmd_syndesc *as; {
            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 */
 
index 8a37b308b59a00ae8cba53220e1c228353735f84..fd96741b209fb0ea0a837bee2d410395ef96a0ff 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -343,7 +343,7 @@ SVOTE_XSDebug(rxcall, awhich, aparm, isclone)
                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;
@@ -406,8 +406,8 @@ SVOTE_Debug(rxcall, aparm)
        (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;
     
@@ -437,7 +437,7 @@ SVOTE_SDebugOld(rxcall, awhich, aparm)
            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;
@@ -484,8 +484,8 @@ SVOTE_DebugOld(rxcall, aparm)
        (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;
     
index b5e62b2d2e6a84bc5a77652b4b89015e7092c91c..444e8383e94db98376c5e7dad2f7fc15e7fcc0a5 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -35,11 +35,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/update/client.c,v 1.1.1.5 2001/07/14 22
 #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
@@ -77,7 +77,7 @@ char *aname; {
        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;
 }
 
index 53ab1a53f57868af6593b2817deefb9e6dc67976..c87c09cae9c544c90082a8701ab21761b353d99d 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -30,11 +30,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/update/server.c,v 1.1.1.5 2001/07/14 22
 #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
index cb656ad53cb33f3e05ea80b7a86b1eb04bfc6157..a9ae582176131b177ff478d2ae5b5a82cb04a07e 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -21,11 +21,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/update/utils.c,v 1.1.1.5 2001/07/14 22:
 #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
index f6d76e288eb0fc4f966969f68540ecaa78058fdc..32e4c5fd648cf7b8a7bbb82886c9c880de3fbaac 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -357,7 +357,7 @@ static int usd_FileOpen(
        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;
@@ -427,7 +427,7 @@ static int usd_FileStandardInput(
        *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;
@@ -455,7 +455,7 @@ static int usd_FileStandardOutput(
        *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;
index 105dfd5f12067649e98108dbbe7d24ec44420e2c..0b9759450f1dc876ea8b9f0461173035bd3c521c 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -485,7 +485,7 @@ static int usd_DeviceOpen(
        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));
@@ -541,7 +541,7 @@ static int usd_DeviceStandardInput(usd_handle_t *usdP)
        *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;
@@ -568,7 +568,7 @@ static int usd_DeviceStandardOutput(
        *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;
index 5e14dda949680d7f138990306ab5b5971ab58c70..ce3837141d49ee3b6ab95669e63a2d4456da593d 100644 (file)
 #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);}
@@ -92,7 +91,7 @@ Replace(in, out)
     }
     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);
@@ -185,7 +184,7 @@ Replace(in, out)
        *out_cp++ = *in_text++;
     
     if (isQuotedString) {
-       nullP = index(out, '"');
+       nullP = strchr(out, '"');
        if (nullP == (char *)0)
            nullP = out_cp;
     }
index e3d28e91c9b21816092011a2fc1072579ed63066..236d74c938751ba3af3a0f7d86cc71d60f6b221e 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -131,7 +131,7 @@ static char *ParentAndComponent(a_path, a_parentBuff, a_componentPP)
      * 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;
index 63ee519f1d4ecfee6372a12fbeb102a6568cf987..0167ead34553e59a38b439f45bae840d82400288 100644 (file)
@@ -18,7 +18,7 @@
 #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*/
@@ -30,7 +30,6 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_kauth.c,v 1.1.1.4 2001/07/14 22
 
 extern int errno;
 extern afs_int32 KAM_CreateUser();
-extern char *index();
 
 #define uss_kauth_MAX_SIZE     2048
 
@@ -150,7 +149,7 @@ static char *getpipepass() {
     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;
@@ -555,7 +554,7 @@ afs_int32 uss_kauth_CheckUserName()
                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);
index 73b3ff45177548474d616f80811c76916c80924d..fa5abce5a5f5526ac810e6747e990ab7f1060f8c 100644 (file)
@@ -18,7 +18,7 @@
 #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*/
@@ -43,7 +43,6 @@ extern int errno;
 
 char temp[1000];
 extern int line;
-extern char *rindex();
 
 static int Copy();
 static int Echo();
@@ -234,7 +233,7 @@ afs_int32 uss_procs_CpFile(a_path, a_mode, a_owner, a_proto)
     }
 
     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);
        }
@@ -812,7 +811,7 @@ FILE *uss_procs_FindAndOpen(a_fileToOpen)
     /*
      * 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");
     }
index 9d140f1b91bda8dce6641f9b49e0b885f7138c73..053c2a6f42d439d5c912e52e88863593ec07edff 100644 (file)
@@ -18,7 +18,7 @@
 #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*/
@@ -30,7 +30,6 @@ extern int errno;
 #undef USS_PTSERVER_DB
 
 extern int line;
-extern char *rindex();
 
 
 /*
index 8614f18835d7483e13e8b86fe33974a740c5f031..8eaf0b92446f261a122a47463f61d5f675b43d82 100644 (file)
@@ -18,7 +18,7 @@
 #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*/
@@ -405,7 +405,7 @@ afs_int32 uss_vol_GetServer(a_name)
     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*/
index 04fde9ecdfaacc8bb1aea6817ee090575e7f5620..174691f291e604be64443f8c8d3269411b8ef5e2 100644 (file)
@@ -29,6 +29,9 @@ INCFILES =\
 $(DESTDIR)\include\afs\dirent.h: dirent_nt.h
        $(COPY) $** $@
 
+$(DESTDIR)\include\afs\dirpath.h: dirpath.hin
+       $(COPY) $** $@
+
 LIBFILE = $(DESTDIR)\lib\afs\afsutil.lib
 
 LIBOBJS = \
index 2a5d78d9b2c88c6dc3771ff99361d2ce7cd07ac7..91b36848b21bd679be83948ad1fb6f22f1f72a03 100644 (file)
@@ -14,7 +14,7 @@
 #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"
@@ -33,11 +33,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/util/hostparse.c,v 1.1.1.6 2001/07/14 2
 #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>
@@ -77,7 +77,7 @@ register char *ahost; {
        /* 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 */
index 3836c52b40d191c36364ea3235bf6b668bf5e77e..5794a4924892b6934757e3a5054de8f7637cd3a9 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -76,7 +76,7 @@ Int32To_ktimeRelDate(int32Date, kdptr)
      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 )
@@ -152,7 +152,7 @@ ParseRelDate(dateStr, relDatePtr)
     afs_int32 value, digit_limit;
     afs_int32 type_index;
 
-    bzero(relDatePtr, sizeof(*relDatePtr));
+    memset(relDatePtr, 0, sizeof(*relDatePtr));
     type_index = 0;
 
     while ( 1 )
index c8230cc29a71f28e0fea5dd7e8d7edf1eea45884..468a4e47e66b537a40636ef23821ac8814caee59 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -169,7 +169,7 @@ register char *astr;
 {
 struct ktime tk;
 
-bzero(&tk, sizeof(tk));
+memset(&tk, 0, sizeof(tk));
 if ( ParseTime(&tk, astr) )
   return (-1);    /* syntax error */
 
@@ -243,7 +243,7 @@ char *adate; {
     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) {
index 1859fde9204401cc4421765790e461faf8018f67..bacfc8bd21fb5d51f166b5e84d92879454a773a7 100644 (file)
 #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>
index 6b5412d4dcb14a2179cecb51447a4c5e2b6e9cee..a0a7382a6a5247339f29e9ab84185f8e07700827 100644 (file)
@@ -19,7 +19,7 @@
 #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
@@ -36,11 +36,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/util/serverLog.c,v 1.1.1.7 2001/07/14 2
 #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"
index 2dff1f41020939720535b68f5ed392a4dfd94d74..90b9dea78fd5c9164e54ae64571ef0a0c3aa5c34 100644 (file)
 #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>
index 4d09350e2bd351d8e4116a55f1c51d4f74e5aed2..63c84db05b60390c5697612ed6dc166201bf7c36 100644 (file)
 #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
@@ -85,7 +85,7 @@ char *volutil_PartitionName_r(int avalue, char *tbuffer, int buflen)
            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)) {
index 036248fbac7f3fcc844ad184eccdad2b7b1f91a9..59b4e40175c0c74f3288f2718f09c8594d2c68e6 100644 (file)
@@ -12,7 +12,7 @@
 #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>
@@ -174,8 +174,8 @@ afs_int32 ListServers()
        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)
index 882d7537dc49dccaf1f202c28270697994d0a1d6..ccca38df7989370a7bbe5028fc0294c9303492c5 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -165,7 +165,7 @@ struct cmd_syndesc *as; {
        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) {
index 8d28763c4f15ac6c094c684826b006bc57b0033d..8d6615ce29615bfc0418e400dca8f35c5d4b2912 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/venus/fs.c,v 1.1.1.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>
@@ -250,7 +250,7 @@ static char *Parent(apath)
 {
     char *tp;
     strcpy(tspace, apath);
-    tp = rindex(tspace, '/');
+    tp = strrchr(tspace, '/');
     if (tp) {
        *tp = 0;
     }
@@ -1099,7 +1099,7 @@ static SetQuotaCmd(as)
     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);
 }
 
@@ -1234,7 +1234,7 @@ static WhereIsCmd(as)
        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);
@@ -1373,7 +1373,7 @@ static ListMountCmd(as)
             * 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);
            }
@@ -1384,7 +1384,7 @@ static ListMountCmd(as)
        /*
         * 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,
@@ -1414,7 +1414,7 @@ static ListMountCmd(as)
        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);
 
@@ -1470,7 +1470,7 @@ defect #3069
 
     /* 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)) {
@@ -1550,7 +1550,7 @@ static RemoveMountCmd(as)
 
     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;
@@ -1603,13 +1603,13 @@ static CheckServersCmd(as)
     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 */
@@ -1659,7 +1659,7 @@ static CheckServersCmd(as)
        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",
@@ -1674,7 +1674,7 @@ static CheckServersCmd(as)
     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);
@@ -1695,12 +1695,12 @@ static MessagesCmd(as)
     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"))
@@ -1826,7 +1826,7 @@ static ListCellsCmd(as)
 
     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;
@@ -1843,7 +1843,7 @@ static ListCellsCmd(as)
            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) {
@@ -1899,7 +1899,7 @@ static NewCellCmd(as)
     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;
@@ -1911,7 +1911,7 @@ static NewCellCmd(as)
                   pn, ti->data);
        }
        else {
-           bcopy(thp->h_addr, tp, sizeof(afs_int32));
+           memcpy(tp, thp->h_addr, sizeof(afs_int32));
            tp += sizeof(afs_int32);
        }
     }
@@ -2048,7 +2048,7 @@ static MonitorCmd(as)
                    return 1;
                }
            }
-           else bcopy(thp->h_addr, &hostAddr, sizeof(afs_int32));
+           else memcpy(&hostAddr, thp->h_addr, sizeof(afs_int32));
        }
     }
     else {
@@ -2108,7 +2108,7 @@ static SysNameCmd(as)
        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);
@@ -2119,15 +2119,15 @@ static SysNameCmd(as)
        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");
@@ -2398,7 +2398,7 @@ static VLDBInit(noAuthFlag, info)
                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,
@@ -2493,7 +2493,7 @@ static addServer(name, rank)
        }
 
        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++;
@@ -2724,7 +2724,7 @@ static StoreBehindCmd(as)
     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) {
@@ -2822,7 +2822,7 @@ static afs_int32 GetCryptCmd(as)
     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");
@@ -3306,7 +3306,7 @@ FlushMountCmd(as)
             * 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);
            }
@@ -3317,7 +3317,7 @@ FlushMountCmd(as)
        /*
         * 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,
@@ -3346,7 +3346,7 @@ FlushMountCmd(as)
        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);
 
index 64bf4be52cbeffd22f713e1b8d61257560b141b6..9649145bb4672a56fb4e0908df2c0d8351426836 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -49,8 +49,6 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/venus/up.c,v 1.1.1.6 2001/07/14 22:24:3
 
 #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[];
@@ -191,7 +189,7 @@ Boolean MakeParent(file, owner)
     
     strcpy(parent, file);
     
-    p = rindex(parent, '/');
+    p = strrchr(parent, '/');
     if (!p) {
        strcpy(parent, ".");
     }
@@ -684,7 +682,7 @@ int isMountPoint( name, blob )
     /*
      * 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,
@@ -713,7 +711,7 @@ int isMountPoint( name, blob )
     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);
 
index f306cf61215a2eaced6b1f5c5a410bca2ecc61ca..d72c7b016618a368e4ab4807228feaae61e1b231 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -116,7 +116,7 @@ descend(parentino, inumber)
        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)
@@ -202,11 +202,11 @@ dirscan(idesc)
        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();
                }
@@ -378,7 +378,7 @@ mkentry(idesc)
        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);
 }
 
@@ -387,7 +387,7 @@ chgino(idesc)
 {
        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);
@@ -404,7 +404,7 @@ linkup(orphan, parentdir)
        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");
@@ -482,7 +482,7 @@ linkup(orphan, parentdir)
                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) {
@@ -492,7 +492,7 @@ linkup(orphan, parentdir)
        }
        lncntp[orphan]--;
        *pathp++ = '/';
-       bcopy(tempname, pathp, len + 1);
+       memcpy(pathp, tempname, len + 1);
        pathp += len;
        if (lostdir) {
                dp = ginode(orphan);
@@ -528,7 +528,7 @@ makeentry(parent, ino, name)
        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;
@@ -570,21 +570,21 @@ expanddir(dp)
                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");
@@ -623,11 +623,11 @@ allocdir(parent, request, mode)
                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();
@@ -645,8 +645,7 @@ allocdir(parent, request, mode)
                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) {
index 7a2caa7daf34b1651d5b7418f6b2f410a30be694..85d09d914b9d12166f68e18948f0e96990445463 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -423,7 +423,7 @@ findname(idesc)
 
        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);
 }
 
@@ -607,7 +607,7 @@ freeino(ino)
        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;
index 17d8d960b9fb899641e683403a98d1e86ccccf94..6d3a18b4758926b6adbaf9e37ae2b628e2339848 100644 (file)
@@ -18,7 +18,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/main.c,v 1.1.1.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>
@@ -1092,7 +1092,7 @@ n printf("(%d frags, %d blocks, %.1f%% fragmentation)\n",
 
            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 */
index 231b813d5265cfa67be6a0f8b894509f43236d6f..0b0ddd6799d3957a5ea6e11fac9216422497d414 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -96,7 +96,7 @@ pass1()
        /*
         * 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;
@@ -110,10 +110,9 @@ pass1()
                                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) 
index 2127223b71f85e63338548e545111c699e2505ad..08a3e618a7000db316585bad298419b08ec1e58a 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -74,7 +74,7 @@ pass1b()
        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;
index 3536e58cf2758a983e68da85c2556c2da8ecc866..e4e54246ede96c09a74b6fbdd7889ef73f6a30d9 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -83,7 +83,7 @@ pass2()
        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;
@@ -207,17 +207,17 @@ pass2check(idesc)
 #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;
@@ -238,7 +238,7 @@ chk1:
                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) {
@@ -264,7 +264,7 @@ chk1:
 #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;
        }
@@ -295,7 +295,7 @@ chk2:
                *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;
index 5ce1b00542e8fb89324a4084f5a50414b65692f2..449e9e9195e092d428944d9d8688499387b778fb 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -75,7 +75,7 @@ pass3()
        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)
index 101974475bcb18934cb2080cb7e66e783065cc27..bb9fb0169fc7bce81953834bb447be852ae630e1 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -78,7 +78,7 @@ pass4()
 #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++) {
index 9132d7103f206358c6dcf62ebecd56d918f60b9c..4260627708af185543f0988ba8c758e5fe2995a0 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -101,7 +101,7 @@ pass5()
        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;
@@ -157,10 +157,10 @@ pass5()
 #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
@@ -216,14 +216,14 @@ pass5()
                        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)
@@ -319,49 +319,46 @@ pass5()
                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();
                }
@@ -370,9 +367,9 @@ pass5()
        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();
index 86dd934d2fcfeb6398db2104185c7b065a84f57c..e64696d5b3f78002d69df5517db672f7a90c8167 100644 (file)
@@ -10,7 +10,7 @@
 #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 */
 
@@ -173,8 +173,7 @@ int proplist_blkscan(dp, idesc, entry_list)
               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;
index 8dd3666bd02ba98db1547a7bf1c643c93c844829..98dd79dfeb58a7ca3913c125e28d8c4880ed57e3 100644 (file)
@@ -18,7 +18,7 @@
 #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
@@ -109,7 +109,6 @@ struct bufarea *pbp;
     /* block map */    howmany((fs)->fs_cpg * (fs)->fs_spc / NSPF(fs), NBBY))
 
 char   *malloc(), *calloc();
-char   *index();
 struct disklabel *getdisklabel();
 
 setup(dev)
@@ -485,8 +484,7 @@ restat:
        }
 #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);
        }
        /*
@@ -695,23 +693,18 @@ readsb(listerr)
 #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;
@@ -728,13 +721,12 @@ readsb(listerr)
 #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,
index f3246cafb57cdb4e74ba95ccdd7820648649a7ca..17365281565d299065e68fca68c356565d6cede8 100644 (file)
@@ -18,7 +18,7 @@
 #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 */
@@ -419,7 +419,7 @@ bread(fd, buf, blk, size)
 #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) {
@@ -578,7 +578,7 @@ getpathname(namebuf, curdir, ino)
                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';
@@ -609,7 +609,7 @@ getpathname(namebuf, curdir, ino)
                cp -= len;
                if (cp < &namebuf[MAXNAMLEN])
                        break;
-               bcopy(namebuf, cp, len);
+               memcpy(cp, namebuf, len);
                *--cp = '/';
                ino = idesc.id_number;
        }
@@ -617,7 +617,7 @@ getpathname(namebuf, curdir, ino)
                strcpy(namebuf, "?");
                return;
        }
-       bcopy(cp, namebuf, &namebuf[BUFSIZ] - cp);
+       memcpy(namebuf, cp, &namebuf[BUFSIZ] - cp);
 }
 
 void
index 8fc8b2aecc228f76e5df08dc40f1cf542123b3ac..18ab3d4c843fec71d00f6ec343b6b4d1ba6d63aa 100644 (file)
@@ -82,7 +82,7 @@
 #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() */
@@ -1631,7 +1631,7 @@ main(argc, argv)
     register struct CallBack *cb;
     time_t now;
 
-    bzero(&fid, sizeof(fid));
+    memset(&fid, 0, sizeof(fid));
     argc--; argv++;
     while (argc && **argv == '-') {
        noptions++;
index 1b5f10b8f3a9d61ff349cf1d9917504f336f2be9..b45d2869e9e23fa1f302925e6bab12abc409bb6a 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -98,7 +98,7 @@ main(argc, argv)
        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) {
@@ -108,7 +108,7 @@ main(argc, argv)
        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]);
@@ -272,7 +272,7 @@ FetchData(argp)
     ++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;
@@ -332,7 +332,7 @@ FetchStatus(argp)
     ++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;
@@ -357,7 +357,7 @@ FetchACL(argp)
     ++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;
@@ -384,7 +384,7 @@ StoreData(argp)
     ++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;
@@ -394,7 +394,7 @@ StoreData(argp)
     ++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);
@@ -462,11 +462,11 @@ StoreStatus(argp)
     ++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);
@@ -507,7 +507,7 @@ StoreACL(argp)
     ++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;
@@ -536,13 +536,13 @@ RemoveFile(argp)
     ++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);
@@ -566,13 +566,13 @@ CreateFile(argp)
     ++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);
@@ -613,25 +613,25 @@ Rename(argp)
     ++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,
@@ -657,7 +657,7 @@ Symlink(argp)
     ++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;
@@ -665,7 +665,7 @@ Symlink(argp)
     ++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);
@@ -704,7 +704,7 @@ HardLink(argp)
     ++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;
@@ -714,7 +714,7 @@ HardLink(argp)
     ++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;
@@ -740,13 +740,13 @@ MakeDir(argp)
     ++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);
@@ -786,13 +786,13 @@ RemoveDir(argp)
     ++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);
@@ -820,7 +820,7 @@ Readdir(argp)
     ++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;
@@ -882,7 +882,7 @@ Lookup(argp)
     ++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;
@@ -908,13 +908,13 @@ GetToken(argp)
     ++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);
@@ -945,7 +945,7 @@ KeepAlive(argp)
     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);
@@ -955,7 +955,7 @@ KeepAlive(argp)
     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);
index 627ea478eaf9b5cbab1c1b7d34fb57c69179f345..a320d72e904e2e59951bd3e33db0ac6915e3d6b3 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/host.c,v 1.1.1.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>
@@ -143,7 +143,7 @@ static struct client *GetCE()
     entry = CEFree;
     CEFree = entry->next;
     CEs++;
-    bzero((char *)entry, CLIENT_TO_ZERO(entry));
+    memset((char *)entry, 0, CLIENT_TO_ZERO(entry));
     return(entry);
 
 } /*GetCE*/
@@ -225,7 +225,7 @@ static struct host *GetHT()
     entry = HTFree;
     HTFree = entry->next;
     HTs++;
-    bzero((char *)entry, HOST_TO_ZERO(entry));
+    memset((char *)entry, 0, HOST_TO_ZERO(entry));
     return(entry);
 
 } /*GetHT*/
@@ -1981,7 +1981,7 @@ h_CheckHosts() {
 
     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
index 3b207156758f7a10d49d10b9a1d4010310d63fc6..f878994fa74089475bb41c01fd746f93bc578fc8 100644 (file)
@@ -16,7 +16,7 @@
 #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>
@@ -154,14 +154,14 @@ DirHandle     *   file;
 
 {
     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)
index 8347b48030378ddec13b1a0744175e680a74fe03..8690cbece06f1b057237042f0ed4666d67abf53b 100644 (file)
@@ -12,7 +12,7 @@
 #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>
@@ -58,7 +58,7 @@ void StartProfiling()
 #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;
index 26b615d7b9c330e94a9acfa76c9c84df31cfcb05..e0d58e4d43ad366bd4128cb1cc3dec93369d812d 100644 (file)
@@ -19,7 +19,7 @@
 #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>
@@ -256,7 +256,7 @@ static int get_key(arock, akvno, akey)
     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*/
@@ -604,7 +604,7 @@ main(argc, argv)
     }
     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",
@@ -742,9 +742,9 @@ static void ClearXStatValues()
     /*
      * 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
index 2ab35c5c2f62f540b4b6572ddfd1f5bf4a7c595e..392a149720b106fc89070e630cfc818e1838f208 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -48,7 +48,7 @@ static char *Parent(apath)
 char *apath; {
     register char *tp;
     strcpy(tspace, apath);
-    tp = rindex(tspace, '/');
+    tp = strrchr(tspace, '/');
     if (tp) {
        *tp = 0;
     }
@@ -584,7 +584,7 @@ convert_header(ofd, fd, fromv, tov, fromaddr, toaddr)
 
   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));
@@ -600,7 +600,7 @@ convert_header(ofd, fd, fromv, tov, fromaddr, toaddr)
      } 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) -
@@ -643,7 +643,7 @@ convert_header(ofd, fd, fromv, tov, fromaddr, toaddr)
         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));
@@ -655,7 +655,7 @@ convert_header(ofd, fd, fromv, tov, fromaddr, toaddr)
      } 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);
@@ -771,7 +771,7 @@ convert_vlentry(new, fromvers, tovers, oldheader, newheader, vlentryp)
        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];
@@ -790,7 +790,7 @@ convert_vlentry(new, fromvers, tovers, oldheader, newheader, vlentryp)
        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];
@@ -804,7 +804,7 @@ convert_vlentry(new, fromvers, tovers, oldheader, newheader, vlentryp)
        }
        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];
@@ -822,7 +822,7 @@ convert_vlentry(new, fromvers, tovers, oldheader, newheader, vlentryp)
 
        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];
@@ -837,7 +837,7 @@ convert_vlentry(new, fromvers, tovers, oldheader, newheader, vlentryp)
        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];
@@ -865,7 +865,7 @@ convert_vlentry(new, fromvers, tovers, oldheader, newheader, vlentryp)
         * 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]);
        }
index d90c517d4cdb1840bee196869994bd6cbb8a06ef..69292c254f4fe3bf9c57c72931cca524373399c5 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -95,7 +95,7 @@ static char *Parent(apath)
 char *apath; {
     register char *tp;
     strcpy(tspace, apath);
-    tp = rindex(tspace, '/');
+    tp = strrchr(tspace, '/');
     if (tp) {
        *tp = 0;
     }
@@ -335,7 +335,7 @@ struct vlheader_2 *tvp1;
 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);
 
index f3e17923de40147aa989b40e8398e6ebae6afc0e..94a97f00b662836d4bb9e0b5e3ca78a9d065d6da 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -243,7 +243,7 @@ char *aname; {
     }
     th = gethostbyname(aname);
     if (!th) return 0;
-    bcopy(th->h_addr, &addr, sizeof(addr));
+    memcpy(&addr, th->h_addr, sizeof(addr));
     return addr;
 }
 
@@ -297,9 +297,9 @@ static handleit(as)
     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");
@@ -346,7 +346,7 @@ static handleit(as)
            } 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);
@@ -366,7 +366,7 @@ static handleit(as)
                 }
                 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);
@@ -404,7 +404,7 @@ static handleit(as)
                 }
                 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);
@@ -456,10 +456,10 @@ static handleit(as)
                     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);
@@ -531,7 +531,7 @@ static handleit(as)
                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);
@@ -563,7 +563,7 @@ static handleit(as)
 
                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);
@@ -586,7 +586,7 @@ static handleit(as)
 
                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) {
@@ -606,7 +606,7 @@ static handleit(as)
 
                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) {
@@ -632,7 +632,7 @@ static handleit(as)
                 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);
@@ -643,7 +643,7 @@ static handleit(as)
             } 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);
@@ -653,7 +653,7 @@ static handleit(as)
                 }
                 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);
@@ -873,10 +873,10 @@ static handleit(as)
                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);
@@ -907,7 +907,7 @@ static handleit(as)
                 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);
@@ -916,7 +916,7 @@ static handleit(as)
                 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));
index 5d76a90582eae0da9b6c6872f09d65d6494bde4e..de9351541c8a32dad46cf28a845f57685c46e294 100644 (file)
@@ -24,7 +24,7 @@
 #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>
@@ -636,7 +636,7 @@ CheckIpAddrs(header)
   int ipindex, ipaddrs;
   afsUUID nulluuid;
 
-  bzero(&nulluuid, sizeof(nulluuid));
+  memset(&nulluuid, 0, sizeof(nulluuid));
 
   if (verbose)
      printf("Check Multihomed blocks\n");
@@ -828,8 +828,8 @@ WorkerBee(as, arock)
 
   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);
index 7c79dd69a532fae4f40ae8ca48929b28c0e35252..0f4d80a4ecce68b4bdd7ea0628a9652bfceee7e0 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -192,7 +192,7 @@ VL_CreateEntry(rxcall, newentry)
       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);
@@ -265,7 +265,7 @@ VL_CreateEntryN(rxcall, newentry)
       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);
@@ -1701,8 +1701,8 @@ vital_vlheader    *vital_header;
     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));
 }
 
@@ -1724,7 +1724,7 @@ bulkaddrs             *addrsp;
     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;
@@ -2579,7 +2579,7 @@ struct vldbentry    *VldbEntry;
 {
     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;
@@ -2617,7 +2617,7 @@ struct nvldbentry    *VldbEntry;
 {
     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;
@@ -2653,7 +2653,7 @@ struct uvldbentry    *VldbEntry;
 {
     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;
@@ -2889,7 +2889,7 @@ register afs_uint32       ipaddr1, ipaddr2;
 
     /* 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]),
index 5dd7cc488b96de3b41ae3205e4081e47cd7065e1..79944f897eda8f9d16b535c06fa965b527f835c7 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -229,7 +229,7 @@ char        **argv;
        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);
@@ -244,7 +244,7 @@ char        **argv;
 
     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);
 
@@ -267,7 +267,7 @@ char        **argv;
     }
     rx_SetRxDeadTime(50);
 
-    bzero(HostAddress, sizeof(HostAddress));
+    memset(HostAddress, 0, sizeof(HostAddress));
     initialize_dstats();
 
     sc[0] = rxnull_NewServerSecurityObject();
index ea6055cecdadbe9181fc5d1a8038050fd53ff0aa..a0f1b181cf03889b55a729766dd4f28fe7091b81 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -106,13 +106,13 @@ afs_int32             length; {
        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]);
@@ -123,10 +123,10 @@ afs_int32             length; {
        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);
@@ -158,14 +158,14 @@ afs_int32             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);
@@ -175,10 +175,10 @@ afs_int32             length; {
        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;
 }
@@ -303,7 +303,7 @@ afs_int32 CheckInit (trans, builddb)
        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]);
            }
@@ -322,7 +322,7 @@ afs_int32 CheckInit (trans, builddb)
            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!! */
@@ -373,7 +373,7 @@ afs_int32 GetExtentBlock(trans, base)
            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);
@@ -515,7 +515,7 @@ struct nvlentry                 *tentry;
     }
     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;
 }
 
@@ -528,7 +528,7 @@ afs_int32                   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);
index 59147f479e1f056d094e7ddafaf9403f80f74ab9..15975eb85f37fe60468d238eb96f7b9a78e4bf5f 100644 (file)
@@ -18,7 +18,7 @@
 #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>
@@ -107,7 +107,7 @@ struct clone_head *ah; {
 /* initialize a clone header */
 int ci_InitHead(struct clone_head *ah)
 {
-    bzero(ah, sizeof(*ah));
+    memset(ah, 0, sizeof(*ah));
     return 0;
 }
 
index 1954a44cb99e5be702d3c54e9a4176fe35c47e37..68c473778bc55a5f6c82140abffb764903be275d 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -201,14 +201,14 @@ dev_t adev; {
 #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;
index 1d4222d6063571641434a4a47fb0910475a0852d..9108e0295071f9324842161730201dad75d33b22 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -930,14 +930,13 @@ char *vol_DevName(adev)
     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);
@@ -956,7 +955,7 @@ rawname(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);
index 84474429728522f5214ff2e168ca558b5c5d42f9..9a79dbb4ae21803ff4c6acbb5bc04ae96bdc3343 100644 (file)
@@ -38,7 +38,7 @@ static int newVLDB = 1;
 #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>
@@ -234,7 +234,7 @@ static int getport(addr)
 {
     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 */
index 7511a23ff2873739bb19c7d0664bdaafca1bc9fe..e3a66bb03b4f6a953478136d40cc3841e1b37d95 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -26,6 +26,12 @@ char **argv;
        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)
@@ -65,6 +71,7 @@ char **argv;
                        write(1, buf, n);
        }
        exit(0);
+#endif /* AFS_NT40_ENV || AFS_NAMEI_ENV */
 }
 
 Perror(err, a1, a2, a3)
index ba7aa73f4f9525fbdefe501226d5ec262618adfb..15454c993f9a3e7e8e526edf78007e92f009bd63 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -77,7 +77,7 @@ afs_int32 avolid; {
     /* 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;
     }
index 3789cef3824b414f45fdbf8247cd36e2c6963382..18868e8d2a411d05fad2f3fe09d5b1ef11ca3671 100644 (file)
@@ -17,7 +17,7 @@
 #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>
@@ -120,7 +120,7 @@ Inode inode;
 Device device;
 {
     static SalvageCacheCheck = 1;
-    bzero(dir, sizeof(DirHandle));
+    memset(dir, 0, sizeof(DirHandle));
 
     dir->dirh_device = device;
     dir->dirh_volume = volume;
@@ -135,14 +135,14 @@ DirHandle     *   file;
 
 {
     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)
index b63eb753ce809e40ede2d3bc6ad481cfe5f29b28..25fe927f8fc958be9a23ba9ab3a68da0448a8def 100644 (file)
@@ -16,7 +16,7 @@
 #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
@@ -129,7 +129,7 @@ Volume *avp; {
 
     /* 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;
index ace9b209da69fe19c99ebaa56b22d4992d2b373a..c6b1cc5bb2bc68122c7a882227c530a385950a5f 100644 (file)
@@ -17,7 +17,7 @@
 #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>
@@ -124,7 +124,6 @@ char*       orphan_NoUnique = "ORPHANED_NoUnique";
 #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[];
index 27e09398be93cb610ae8037f56daf832d23477c2..7890ae3ac98dfc7e059a1c1b10fd1fe4e50631fb 100644 (file)
@@ -16,7 +16,7 @@
 #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>
@@ -382,7 +382,7 @@ Vnode *VAllocVnode_r(ec,vp,type)
          } 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);
          }
@@ -398,7 +398,7 @@ Vnode *VAllocVnode_r(ec,vp,type)
 #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;
@@ -698,7 +698,7 @@ VPutVnode_r(ec,vnp)
 
            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);
index 44c9da77ce16a100a8dc46e63e76e12c1cd1407e..61af81b3b4416ea8d630c52a3acdce0eb5427158 100644 (file)
@@ -17,7 +17,7 @@
 #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>
@@ -403,7 +403,7 @@ void HandlePart(struct DiskPartition *partP)
     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;
index 48921a12c0f0ce433394ee1b56cb4ffeda6f2d4a..9d38efc09f32acf1c95bab857673987faad1bc04 100644 (file)
@@ -91,7 +91,7 @@ Vnodes with 0 inode pointers in RW volumes are now deleted.
 #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>
@@ -923,7 +923,7 @@ void SalvageFileSysParallel(struct DiskPartition *partP)
          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++;
@@ -2002,7 +2002,7 @@ int SalvageVolumeHeaderFile(register struct InodeSummary *isp,
 
     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;
@@ -2083,7 +2083,7 @@ int SalvageVolumeHeaderFile(register struct InodeSummary *isp,
        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);
@@ -2102,7 +2102,7 @@ int SalvageVolumeHeaderFile(register struct InodeSummary *isp,
          }
     }
     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 {
@@ -2203,7 +2203,7 @@ int SalvageHeader(register struct stuff *sp, struct InodeSummary *isp,
        /* 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;
@@ -2334,7 +2334,7 @@ int SalvageIndex(Inode ino, VnodeClass class, int RW,
            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;
                }
            }
@@ -2342,7 +2342,7 @@ int SalvageIndex(Inode ino, VnodeClass class, int RW,
                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;
                }
@@ -2512,7 +2512,7 @@ int SalvageIndex(Inode ino, VnodeClass class, int RW,
                        } 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 
@@ -2844,7 +2844,7 @@ void JudgeEntry(struct DirSummary *dir, char *name, VnodeId vnodeNumber,
            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);
@@ -3087,7 +3087,7 @@ void SalvageDir(char *name, VolumeId rwVid, struct VnodeInfo *dirVnodeInfo,
 
     /* 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;
     }
 
@@ -3299,7 +3299,7 @@ int SalvageVolume(register struct InodeSummary *rwIsp, IHandle_t *alinkH)
                           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) {
index 8ac243471554ee2d25a91890275d00cedf71a9d5..80b6df5a1dd788c88befac60a319dc43d57bccfc 100644 (file)
@@ -19,7 +19,7 @@
 #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>
@@ -423,7 +423,7 @@ static void ReadHeader(Error *ec, IHandle_t *h, char *to, int size,
 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;
@@ -453,7 +453,7 @@ void VolumeHeaderToDisk(VolumeDiskHeader_t *dh, VolumeHeader_t *h)
  */
 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;
@@ -721,7 +721,7 @@ private Volume *attach2(ec, path, header, partp, isbusy)
         * 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 */
@@ -1299,7 +1299,7 @@ int VAllocBitmapEntry_r(ec,vp,index)
     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;
@@ -1594,7 +1594,7 @@ VAdjustVolumeStatistics_r(vp)
         * 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*/
 
index 87e4ba6a722a7492028453c826bae522b3fa5d45..b3ec9b3318fd7332e700d833a7ed8ad6cc9e2dc7 100644 (file)
@@ -17,7 +17,7 @@
 #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>
@@ -124,7 +124,7 @@ Volume *VCreateVolume_r(ec, partname, volumeId, parentId)
     
 
     *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
@@ -145,7 +145,7 @@ Volume *VCreateVolume_r(ec, partname, volumeId, parentId)
     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;
@@ -317,7 +317,7 @@ afs_int32 CopyVolumeHeader_r(from, to)
     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;
@@ -349,7 +349,7 @@ ClearVolumeStats(vol)
 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;
 }
index 88f6edff099ddc4ebf20be9381b0fb8f2b88aecb..89fe49f10eec47cdf41e5586b71b29f6e479051f 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -205,7 +205,7 @@ static int ReadVolumeHeader(register struct iod *iodp, VolumeDiskData *vol)
 {
     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':
@@ -488,7 +488,7 @@ static int DumpFile(struct iod *iodp, char tag, int vnode, FdHandle_t *handleP)
           /* 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);
@@ -737,7 +737,7 @@ int ProcessIndex(Volume *vp, VnodeClass class, afs_int32 **Bufp, int *sizep,
     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;
@@ -782,7 +782,7 @@ int ProcessIndex(Volume *vp, VnodeClass class, afs_int32 **Bufp, int *sizep,
        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);
@@ -916,7 +916,7 @@ static int ReadVnodes(register struct iod *iodp, Volume *vp,
     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;
 
index 58173ce832e6e9f2dbf1ef565f525ee0a14f9927..d4c70bcfdd9d1416a15f5c725f7d9a5163a2cbc0 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -113,7 +113,7 @@ Inode inode;
 afs_int32 device;
 {
     private SalvageCacheCheck = 1;
-    bzero(dir, sizeof(DirHandle));
+    memset(dir, 0, sizeof(DirHandle));
 
     dir->dirh_volume = volume;
     dir->dirh_device = device;
@@ -129,14 +129,14 @@ DirHandle     *   file;
 
 {
     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)
index 2905ac8695ac79ca185ebefb1bb5ae4b5b858406..f6f1d9eb6f089fad11534188331eb677c70fc3b9 100644 (file)
@@ -42,7 +42,7 @@
 #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>
@@ -146,7 +146,7 @@ afs_int32 ReadDumpHeader(dh)
   char              tag, c;
   afs_int32             magic;
 
-/*  bzero(&dh, sizeof(dh)); */
+/*  memset(&dh, 0, sizeof(dh)); */
 
   magic   = ntohl(readvalue(4));
   dh->version = ntohl(readvalue(4));
@@ -219,7 +219,7 @@ afs_int32 ReadVolumeHeader(count)
   int               code, i, done, entries;
   char              tag, c;
 
-/*  bzero(&vh, sizeof(vh)); */
+/*  memset(&vh, 0, sizeof(vh)); */
 
   done = 0;
   while (!done) {
@@ -393,7 +393,7 @@ afs_int32 ReadVNode(count)
   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;
index 665273ffe72361d68fae7b9828958d8fd623e093..7e5b7cb1c4f908da51bfcc0da5fe991a8fb632cd 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -190,7 +190,7 @@ Volume      * vp;
     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),
@@ -1146,7 +1146,7 @@ afs_int32 SAFSVolForwardMultiple (acid, fromTrans, fromDate, destinations,
   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*/
@@ -1659,7 +1659,7 @@ struct partEntries *pEntries;
            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*/
@@ -1680,7 +1680,7 @@ struct partEntries *pEntries;
        }
     } 
     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;
@@ -2049,9 +2049,7 @@ afs_int32 VolXListOneVolume (a_rxCidP, a_partID, a_volID, a_volumeXInfoP)
            /*
             * 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
@@ -2445,9 +2443,7 @@ afs_int32 VolXListVolumes (a_rxCidP, a_partID, a_flags, a_volumeXInfoP)
            /*
             * 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.
index c070473d505161013a4875a74f99374a321df3ea..fbfd72f03812119b73e8533e06942aa2d49425f1 100644 (file)
@@ -17,7 +17,7 @@
 #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>
@@ -46,7 +46,7 @@ afs_int32 apart; {
        }
     }
     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;
index 9c89ad6745949c289fbfbf5e37512bc2882ec80d..e24a6cdd0a44f29014c0cba7dce66f5b2bfa7e42 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vos.c,v 1.1.1.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
@@ -101,7 +101,7 @@ static struct tqHead busyHead, notokHead;
 static void qInit(ahead)
 struct tqHead *ahead;
 {
-    bzero((char *)ahead, sizeof(struct tqHead));
+    memset((char *)ahead, 0, sizeof(struct tqHead));
     return;
 }
 
@@ -216,7 +216,7 @@ char *aname; {
     } 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 */
@@ -224,7 +224,7 @@ char *aname; {
        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); 
@@ -764,6 +764,97 @@ static void XDisplayFormat(a_xInfoP, a_servID, a_partID, a_totalOKP,
        } /*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;
@@ -1155,6 +1246,12 @@ register struct cmd_syndesc *as;
          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)) {
@@ -2096,7 +2193,7 @@ register struct cmd_syndesc *as;
     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++;
@@ -2355,6 +2452,12 @@ register struct cmd_syndesc *as;
                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,
@@ -2377,7 +2480,7 @@ static SyncVldb(as)
   afs_int32 pname, code;       /* part name */
   char part[10];
   int flags = 0;
-  char *volname;
+  char *volname = 0;
 
   tserver = 0;
   if (as->parms[0].items) {
@@ -2811,7 +2914,7 @@ register struct cmd_syndesc *as;
     }
 
     /* 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);
@@ -2865,7 +2968,7 @@ register struct cmd_syndesc *as;
     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");
@@ -3041,7 +3144,7 @@ static ListVLDB(as)
     }
 
     for (thisindex = 0; (thisindex != -1); thisindex = nextindex) {
-       bzero(&arrayEntries, sizeof(arrayEntries));
+       memset(&arrayEntries, 0, sizeof(arrayEntries));
        centries = 0;
        nextindex = -1;
 
@@ -3091,8 +3194,7 @@ static ListVLDB(as)
             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;
          }
        }
@@ -3144,7 +3246,7 @@ static BackSys(as)
     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);
@@ -3198,7 +3300,7 @@ static BackSys(as)
        }
     }
 
-    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");
@@ -3407,7 +3509,7 @@ register struct cmd_syndesc *as;
     }
     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");
@@ -3825,6 +3927,10 @@ char **argv; {
     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");
@@ -3842,6 +3948,10 @@ char **argv; {
     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");
 
index 4a666e8ddcdbd24a0c674b5bdc9bff04805a51e1..2d3cbbb61d0becfa5da5a6f1abebc93ea5e8e54b 100644 (file)
@@ -10,7 +10,7 @@
 #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>
@@ -443,7 +443,7 @@ afs_int32 *anewid;
     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;
 
@@ -1955,8 +1955,8 @@ UV_ReleaseVolume(afromvol, afromserver, afrompart, forceflag)
   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) 
@@ -2147,7 +2147,7 @@ UV_ReleaseVolume(afromvol, afromserver, afrompart, forceflag)
 
   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];
@@ -2161,10 +2161,10 @@ UV_ReleaseVolume(afromvol, afromserver, afrompart, forceflag)
   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);
@@ -2566,7 +2566,7 @@ UV_RestoreVolume(toserver, topart, tovolid, tovolname, flags, WriteData, rock)
     char apartName[10];
 
 
-    bzero(&cookie,sizeof(cookie));
+    memset(&cookie, 0, sizeof(cookie));
     islocked  = 0;
     success = 0;
     error = 0;
@@ -3525,7 +3525,7 @@ static afs_int32 CheckVolume(volumeinfo, aserver, apart, modentry, maxvolid)
         ERROR_EXIT(code);
       }
 
-      bzero(&entry, sizeof(entry));
+      memset(&entry, 0, sizeof(entry));
       vsu_ExtractName(entry.name, volumeinfo->name); /* Store name of RW */
 
       createentry = 1;
@@ -4553,7 +4553,7 @@ UV_SyncServer(aserver, apart, flags, force)
 
     /* 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,
index bb2628db3b6f2597d77b69aa870649bef81716cc..367e5f79769fa2fdc226afefcc1dd81e75558d0a 100644 (file)
@@ -10,7 +10,7 @@
 #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
@@ -57,7 +57,7 @@ static void ovlentry_to_nvlentry(oentryp, nentryp)
 {
     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];
@@ -77,7 +77,7 @@ static nvlentry_to_ovlentry(nentryp, oentryp)
 {
     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) {
        /*
@@ -218,7 +218,7 @@ VLDB_ListAttributes(attrp, entriesp, blkentriesp)
 
     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));
@@ -306,11 +306,11 @@ VLDB_IsSameAddrs(serv1, serv2, errorp)
          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) {
index 48d9d21f02c7998359f29e6ab50f69f33db843e0..9b59f9278f322f07e6c7e459f52ac88eaf6c3134 100644 (file)
@@ -17,7 +17,7 @@
 #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*/
@@ -263,8 +263,7 @@ static void xstat_cm_LWP()
                    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;
 
@@ -474,7 +473,7 @@ int xstat_cm_Init(a_numServers, a_socketArray, a_ProbeFreqInSecs,
     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++)
@@ -550,9 +549,7 @@ int xstat_cm_Init(a_numServers, a_socketArray, a_ProbeFreqInSecs,
                   (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);
index 51722f5bca25acd2258beff82605a72b8a9f018c..c483eee2f05cda1c2a7bc47bfa7c9da4a537d910 100644 (file)
@@ -16,7 +16,7 @@
 #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*/
@@ -1282,7 +1282,7 @@ int RunTheTest(a_s)
                    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.
index 1492bd457cc295c7adae746b533fb087238fbccf..1b5438f5de7c8e4bf624ee767d37fc417401899e 100644 (file)
@@ -17,7 +17,7 @@
 #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*/
@@ -299,8 +299,7 @@ static void xstat_fs_LWP()
                               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;
                    
@@ -514,7 +513,7 @@ int xstat_fs_Init(a_numServers, a_socketArray, a_ProbeFreqInSecs, a_ProbeHandler
     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++)
@@ -616,9 +615,7 @@ int xstat_fs_Init(a_numServers, a_socketArray, a_ProbeFreqInSecs, a_ProbeHandler
                   (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);
index 266b8a132b80fc53abede68e0ca7b485a377d11b..55d830906215f2803f5597a48615d8592e1040e2 100644 (file)
@@ -16,7 +16,7 @@
 #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*/
@@ -709,7 +709,7 @@ int RunTheTest(a_s)
                    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.