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

234 files changed:
NEWS
README
acconfig.h
config.sub
configure-libafs.in
src/Makefile.djgpp
src/NTMake9x
src/NTMakefile
src/WINNT/afsd/Makefile.djgpp
src/WINNT/afsd/NTMakefile
src/WINNT/afsd/afsd.h
src/WINNT/afsd/afsd95.c
src/WINNT/afsd/afsd_init.c
src/WINNT/afsd/afsd_init95.c
src/WINNT/afsd/cm_callback.c
src/WINNT/afsd/cm_cell.c
src/WINNT/afsd/cm_cell.h
src/WINNT/afsd/cm_config.c
src/WINNT/afsd/cm_config.h
src/WINNT/afsd/cm_dcache.c
src/WINNT/afsd/cm_ioctl.c
src/WINNT/afsd/cm_ioctl.h
src/WINNT/afsd/cm_scache.c
src/WINNT/afsd/cm_vnodeops.c
src/WINNT/afsd/libafsconf.def
src/WINNT/client_osi/osisleep.h
src/afs/LINUX/osi_vfsops.c
src/afs/LINUX/osi_vm.c
src/afs/SOLARIS/osi_file.c
src/afs/SOLARIS/osi_vfsops.c
src/afs/SOLARIS/osi_vnodeops.c
src/afs/VNOPS/afs_vnop_flock.c
src/afs/VNOPS/afs_vnop_remove.c
src/afs/VNOPS/afs_vnop_strategy.c
src/afs/VNOPS/afs_vnop_write.c
src/afs/afs_analyze.c
src/afs/afs_buffer.c
src/afs/afs_callback.c
src/afs/afs_cell.c
src/afs/afs_dcache.c
src/afs/afs_server.c
src/afs/afs_util.c
src/afs/afs_vcache.c
src/afs/afs_volume.c
src/afs/lock.h
src/afsd/Makefile.in
src/afsd/afsd.c
src/afsd/vsys.c
src/audit/audit.h
src/auth/NTMakefile
src/auth/authcon.c
src/auth/cellconfig.c
src/auth/ktc.c
src/auth/userok.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/fsbnodeops.c
src/bucoord/main.c
src/budb/server.c
src/butc/tcmain.c
src/butm/butm_test.c
src/butm/test_ftm.c
src/cf/linux-test2.m4
src/cf/linux-test4.m4
src/cmd/cmd.c
src/cmd/test/itest.c
src/comerr/compile_et.c
src/comerr/error_table.y
src/comerr/error_table_nt.c
src/comerr/test/test.c
src/config/.cvsignore
src/config/Makefile.i386_djgpp
src/config/Makefile.ppc_darwin_13.in
src/config/Makefile.rs_aix42.in
src/config/Makefile.sun4x_56.in
src/config/Makefile.sun4x_57.in
src/config/Makefile.sun4x_58.in
src/config/NTMakefile.i386_nt40
src/config/NTMakefile.i386_win95
src/config/afs_args.h
src/config/afs_sysnames.h
src/config/afsconfig-windows.h
src/config/mkvers.c
src/config/param.i386_obsd29.h
src/config/param.sgi_62.h
src/config/param.sgi_63.h
src/config/param.sgi_64.h
src/config/param.sgi_65.h
src/dauth/dlog.c
src/des/andrew-conf.h
src/des/main.c
src/des/make_ip.c
src/des/read_pssword.c
src/dir/buffer.c
src/dir/dir.h
src/dir/salvage.c
src/finale/translate_et.c
src/fsint/afsint.xg
src/kauth/NTMakefile
src/kauth/admin_tools.c
src/kauth/authclient.c
src/kauth/client.c
src/kauth/decode_ticket.c
src/kauth/kaauxdb.c
src/kauth/kadatabase.c
src/kauth/kalocalcell.c
src/kauth/kalog.c
src/kauth/kaprocs.c
src/kauth/kas.c
src/kauth/kaserver.c
src/kauth/kautils.c
src/kauth/klog.c
src/kauth/klogin.c
src/kauth/kpasswd.c
src/kauth/kpwvalid.c
src/kauth/krb_tf.c
src/kauth/krb_udp.c
src/kauth/rebuild.c
src/kauth/test/test_getticket.c
src/kauth/test/test_interim_ktc.c
src/kauth/test/test_rxkad_free.c
src/kauth/token.c
src/kauth/user.c
src/kauth/user_nt.c
src/libacl/aclprocs.c
src/libadmin/adminutil/afs_utilAdmin.c
src/libafs/.cvsignore
src/libafs/MakefileProto.DARWIN.in
src/libafs/MakefileProto.FBSD.in
src/libafs/MakefileProto.SOLARIS.in
src/libafsauthent/NTMakefile
src/libuafs/Makefile.common
src/login/Makefile.in
src/lwp/waitkey.c
src/ntp/.cvsignore
src/pam/afs_util.c
src/pinstall/install.c
src/ptserver/.cvsignore
src/ptserver/NTMakefile
src/ptserver/db_verify.c
src/ptserver/display.c
src/ptserver/ptclient.c
src/ptserver/ptprocs.c
src/ptserver/pts.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/rx/IRIX/rx_knet.c
src/rx/SOLARIS/rx_knet.c
src/rx/rx.h
src/rx/rx_clock.c
src/rx/rx_getaddr.c
src/rx/rx_kcommon.c
src/rx/rx_kcommon.h
src/rx/rx_misc.h
src/rx/rx_pthread.c
src/rx/rx_rdwr.c
src/rx/rx_trace.c
src/rx/test/generator.c
src/rxdebug/rxdebug.c
src/rxgen/rpc_main.c
src/rxgen/rpc_parse.c
src/rxkad/rxkad_client.c
src/rxkad/rxkad_common.c
src/rxkad/rxkad_server.c
src/rxkad/test/stress.c
src/rxkad/ticket.c
src/sys/pioctl_nt.c
src/sys/rmtsysnet.c
src/tbutc/Makefile.in
src/ubik/beacon.c
src/ubik/disk.c
src/ubik/lock.c
src/ubik/phys.c
src/ubik/recovery.c
src/ubik/remote.c
src/ubik/ubik.c
src/ubik/ubikclient.c
src/ubik/ubikcmd.c
src/ubik/utst_client.c
src/ubik/utst_server.c
src/ubik/vote.c
src/update/client.c
src/usd/usd_file.c
src/uss/uss.c
src/util/Makefile.in
src/util/assert.c
src/util/casestrcpy.c
src/util/dirpath.hin
src/util/fileutil.c
src/util/kreltime.c
src/util/ktime.c
src/util/uuid.c
src/venus/.cvsignore
src/venus/Makefile.in
src/vfsck/.cvsignore
src/vfsck/setup.c
src/viced/callback.c
src/viced/host.c
src/viced/viced.c
src/vlserver/vlclient.c
src/vlserver/vldb_check.c
src/vlserver/vldbint.xg
src/vlserver/vlprocs.c
src/vlserver/vlserver.p.h
src/vlserver/vlutils.c
src/vol/.cvsignore
src/vol/Makefile.in
src/vol/clone.c
src/vol/devname.c
src/vol/ihandle.c
src/vol/ihandle.h
src/vol/listinodes.c
src/vol/namei_ops.c
src/vol/partition.h
src/vol/vnode.c
src/vol/vol-salvage.c
src/vol/volume.c
src/vol/vutil.c
src/volser/common.c
src/volser/dumpstuff.c
src/volser/lockprocs.c
src/volser/volprocs.c
src/volser/volser.p.h
src/volser/vos.c
src/volser/vsprocs.c
src/volser/vsutils.c

diff --git a/NEWS b/NEWS
index da8a0eea7e5af00df20283cff3ded4a0f16f5057..a805cee9fca330d8df04d64971c5449fb706fc9b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,34 @@
-Openafs News -- history of user Visible changes. September 17, 2001
+OpenAFS News -- history of user-visible changes. October 13, 2001
+
+* Changes incorporated in OpenAFS 1.2.2
+
+** Solaris 9 and Linux PA-RISC are now supported
+
+** fileserver will not erroneously delay legitimate errors for 3 seconds
+   after 10 errors are returned (e.g. stat() on a directory you can't read)
+
+** Rx MTU calculation now works for Irix, Solaris and Linux
+
+** If afsd is started with the -dynroot flag, /afs will be locally
+   generated from the CellServDB.  AFSDB cells will be mounted
+   automatically upon access.
+
+** The namei fileserver allows vice "partitions" to be directories instead
+   of partitions and will attach and display accordingly. Creating the file
+   "AlwaysAttach" in the /vicepX directory is used as the trigger to attach it.
+
+** TSM support for butc no longer requires editing a Makefile, simply
+   specify the --enable-tivoli-tsm configure option.
+
+** Linux builds no longer require source changes every time the kernel
+   inode structure changes; the OpenAFS sources will now configure
+   itself to the actual inode structure as defined in the kernel
+   sources.
+
+* Changes incorporated in OpenAFS 1.2.1
+
+** vfsck on Digital UNIX and Solaris will now refuse to fsck mounted
+   mounted partitions.
 
 * Changes incorporated in OpenAFS 1.2.0
 
@@ -8,7 +38,6 @@ Openafs News -- history of user Visible changes. September 17, 2001
    and /usr/vice/etc) use the --enable-transarc-paths option to
    configure.  More details on the new directory layout are found in README.
 
-
 * Changes incorporated in OpenAFS 1.1.1a
  
 ** Windows 95/98/ME/NT/2000 - Consistent versioning
diff --git a/README b/README
index 9d20c5a0d4b821f53180a0cfcbf4142b7059f8b5..44ed3d5e918f9d5494122bf467e03f6514e1482f 100644 (file)
--- a/README
+++ b/README
@@ -39,6 +39,7 @@ A. Creating the proper directory structure.
       sun4x_56
       sun4x_57
       sun4x_58
+      sun4x_59
       ppc_darwin_13
       ppc_linux22
       ppc_linux24
index 12ef98bd80e34c4c79493aae143a674ef1ad4861..e02e143df1671fbf04492a35fb6d02ddf724f8c8 100644 (file)
@@ -29,12 +29,6 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 #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 4ac0c8b0cbd16f4f465730bd9f08c982458f5401..791bcded7c3bf807b4ecb7521fcd2ef9ad175b2c 100644 (file)
@@ -3,7 +3,7 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
 #   Free Software Foundation, Inc.
 
-timestamp='2001-03-30'
+timestamp='2001-10-05'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -29,7 +29,8 @@ timestamp='2001-03-30'
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# Please send patches to <config-patches@gnu.org>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -117,7 +118,7 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*)
+  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -157,6 +158,14 @@ case $os in
                os=-vxworks
                basic_machine=$1
                ;;
+       -chorusos*)
+               os=-chorusos
+               basic_machine=$1
+               ;;
+       -chorusrdb)
+               os=-chorusrdb
+               basic_machine=$1
+               ;;
        -hiux*)
                os=-hiuxwe2
                ;;
@@ -215,25 +224,36 @@ esac
 case $basic_machine in
        # Recognize the basic CPU types without company name.
        # Some are omitted here because they have special meanings below.
-       tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
-               | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
-               | pyramid | mn10200 | mn10300 | tron | a29k \
-               | 580 | i960 | h8300 \
-               | x86 | ppcbe | mipsbe | mipsle | shbe | shle \
-               | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
-               | hppa64 \
-               | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
-               | alphaev6[78] \
-               | we32k | ns16k | clipper | i370 | sh | sh[34] \
-               | powerpc | powerpcle \
-               | 1750a | dsp16xx | pdp10 | pdp11 \
-               | mips16 | mips64 | mipsel | mips64el \
-               | mips64orion | mips64orionel | mipstx39 | mipstx39el \
-               | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
-               | mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \
-               | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
-               | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
-               | pj | pjl | h8500)
+       1750a | 580 \
+       | a29k \
+       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+       | c4x | clipper \
+       | d10v | d30v | dsp16xx \
+       | fr30 \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | m32r | m68000 | m68k | m88k | mcore \
+       | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
+       | mips64vr4100 | mips64vr4100el | mips64vr4300 \
+       | mips64vr4300el | mips64vr5000 | mips64vr5000el \
+       | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
+       | mipsisa32 \
+       | mn10200 | mn10300 \
+       | ns16k | ns32k \
+       | openrisc \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | s390 | s390x \
+       | sh | sh[34] | sh[34]eb | shbe | shle \
+       | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
+       | stormy16 | strongarm \
+       | tahoe | thumb | tic80 | tron \
+       | v850 \
+       | we32k \
+       | x86 | xscale \
+       | z8k)
                basic_machine=$basic_machine-unknown
                ;;
        m6811 | m68hc11 | m6812 | m68hc12)
@@ -241,13 +261,13 @@ case $basic_machine in
                basic_machine=$basic_machine-unknown
                os=-none
                ;;
-       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65)
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
                ;;
 
        # We use `pc' rather than `unknown'
        # because (1) that's what they normally are, and
        # (2) the word "unknown" tends to confuse beginning users.
-       i[234567]86 | x86_64)
+       i*86 | x86_64)
          basic_machine=$basic_machine-pc
          ;;
        # Object if more than one company name word.
@@ -256,30 +276,44 @@ case $basic_machine in
                exit 1
                ;;
        # Recognize the basic CPU types with company name.
-       # FIXME: clean up the formatting here.
-       vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
-             | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
-             | arm-*  | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
-             | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
-             | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
-             | xmp-* | ymp-* \
-             | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
-             | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
-             | hppa2.0n-* | hppa64-* \
-             | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
-             | alphaev6[78]-* \
-             | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
-             | clipper-* | orion-* \
-             | sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
-             | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
-             | mips64el-* | mips64orion-* | mips64orionel-* \
-             | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
-             | mipstx39-* | mipstx39el-* | mcore-* \
-             | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
-             | [cjt]90-* \
-             | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
-             | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
-             | bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
+       580-* \
+       | a29k-* \
+       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+       | alphapca5[67]-* | arc-* \
+       | arm-*  | armbe-* | armle-* | armv*-* \
+       | avr-* \
+       | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c54x-* \
+       | clipper-* | cray2-* | cydra-* \
+       | d10v-* | d30v-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fr30-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | m32r-* \
+       | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | mcore-* \
+       | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
+       | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
+       | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | pyramid-* \
+       | romp-* | rs6000-* \
+       | s390-* | s390x-* \
+       | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
+       | sparc-* | sparc64-* | sparc86x-* | sparclite-* \
+       | sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \
+       | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
+       | v850-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \
+       | ymp-* \
+       | z8k-*)
                ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
@@ -506,19 +540,19 @@ case $basic_machine in
                basic_machine=i370-ibm
                ;;
 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
-       i[34567]86v32)
+       i*86v32)
                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
                os=-sysv32
                ;;
-       i[34567]86v4*)
+       i*86v4*)
                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
                os=-sysv4
                ;;
-       i[34567]86v)
+       i*86v)
                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
                os=-sysv
                ;;
-       i[34567]86sol2)
+       i*86sol2)
                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
                os=-solaris2
                ;;
@@ -692,7 +726,7 @@ case $basic_machine in
         pc532 | pc532-*)
                basic_machine=ns32k-pc532
                ;;
-       pentium | p5 | k5 | k6 | nexgen)
+       pentium | p5 | k5 | k6 | nexgen | viac3)
                basic_machine=i586-pc
                ;;
        pentiumpro | p6 | 6x86 | athlon)
@@ -701,7 +735,7 @@ case $basic_machine in
        pentiumii | pentium2)
                basic_machine=i686-pc
                ;;
-       pentium-* | p5-* | k5-* | k6-* | nexgen-*)
+       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
                basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
        pentiumpro-* | p6-* | 6x86-* | athlon-*)
@@ -725,6 +759,16 @@ case $basic_machine in
        ppcle-* | powerpclittle-*)
                basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
+       ppc64)  basic_machine=powerpc64-unknown
+               ;;
+       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+               basic_machine=powerpc64le-unknown
+               ;;
+       ppc64le-* | powerpc64little-*)
+               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        ps2)
                basic_machine=i386-ibm
                ;;
@@ -753,7 +797,7 @@ case $basic_machine in
                basic_machine=sh-hitachi
                os=-hms
                ;;
-       sparclite-wrs)
+       sparclite-wrs | simso-wrs)
                basic_machine=sparclite-wrs
                os=-vxworks
                ;;
@@ -879,6 +923,10 @@ case $basic_machine in
                basic_machine=hppa1.1-winbond
                os=-proelf
                ;;
+       windows32)
+               basic_machine=i386-pc
+               os=-windows32-msvcrt
+               ;;
        xmp)
                basic_machine=xmp-cray
                os=-unicos
@@ -932,10 +980,10 @@ case $basic_machine in
        we32k)
                basic_machine=we32k-att
                ;;
-       sh3 | sh4)
+       sh3 | sh4 | sh3eb | sh4eb)
                basic_machine=sh-unknown
                ;;
-       sparc | sparcv9)
+       sparc | sparcv9 | sparcv9b)
                basic_machine=sparc-sun
                ;;
         cydra)
@@ -1016,16 +1064,18 @@ case $os in
              | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+             | -chorusos* | -chorusrdb* \
              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
              | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
              | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
+             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+             | -os2* | -vos*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
                case $basic_machine in
-                   x86-* | i[34567]86-*)
+                   x86-* | i*86-*)
                        ;;
                    *)
                        os=-nto$os
@@ -1344,6 +1394,9 @@ case $basic_machine in
                        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
                                vendor=atari
                                ;;
+                       -vos*)
+                               vendor=stratus
+                               ;;
                esac
                basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
                ;;
index af5bb9d3a77bedb9e2f09d6543eb395e2a0e8c3c..8aee6cf17e643c250f4138bb3ef4f3f6cf130092 100644 (file)
 AC_INIT(Makefile.common)
-AM_INIT_AUTOMAKE(openafs-libafs,1.2.1)
-AC_CANONICAL_HOST
+AM_INIT_AUTOMAKE(openafs-libafs,1.2.2)
 AC_CONFIG_HEADER(config/afsconfig.h)
+define(OPENAFS_CONFIGURE_LIBAFS)
 
-#BOZO_SAVE_CORES BOS_RESTRICTED_MODE BOS_NEW_CONFIG pam sia
-AC_ARG_WITH(afs-sysname,
-[  --with-afs-sysname=sys    use sys for the afs sysname]
-)
-AC_ARG_ENABLE( obsolete,
-[  --enable-obsolete                   enable obsolete portions of AFS (mpp, ntp and package)],, enable_obsolete="no")
-AC_ARG_ENABLE( insecure,
-[  --enable-insecure                   enable insecure portions of AFS (ftpd, inetd, rcp, rlogind and rsh)],, enable_insecure="no")
-AC_ARG_ENABLE( afsdb,
-[  --disable-afsdb                     disable AFSDB RR support],, enable_afsdb="yes")
-AC_ARG_ENABLE( bos-restricted-mode,
-[  --enable-bos-restricted-mode        enable bosserver restricted mode which disables certain bosserver functionality],, enable_bos_restricted_mode="no")
-AC_ARG_ENABLE( namei-fileserver,
-[  --enable-namei-fileserver           force compilation of namei fileserver in preference to inode fileserver],, enable_namei_fileserver="no")
-AC_ARG_ENABLE( fast-restart,
-[  --enable-fast-restart               enable fast startup of file server without salvaging],, enable_fast_restart="no")
-AC_ARG_ENABLE( bitmap-later,
-[  --enable-bitmap-later               enable fast startup of file server by not reading bitmap till needed],, enable_bitmap_later="no")
-AC_ARG_ENABLE( full-vos-listvol-switch,
-[  --enable-full-vos-listvol-switch     enable vos full listvol switch for formatted output],, enable_full_vos_listvol_switch="no")
-AC_ARG_WITH(dux-kernel-headers,
-[  --with-dux-kernel-headers=path      use the kernel headers found at path(optional, defaults to first match in /usr/sys)]
-)
-AC_ARG_WITH(linux-kernel-headers,
-[  --with-linux-kernel-headers=path            use the kernel headers found at path(optional, defaults to /usr/src/linux)]
-)
-AC_ARG_ENABLE(kernel-module,
-[  --disable-kernel-module                     disable compilation of the kernel module (defaults to enabled)],, enable_kernel_module="yes"
-)
-AC_ARG_ENABLE(redhat-buildsys,
-[  --enable-redhat-buildsys            enable compilation of the redhat build system kernel (defaults to disabled)],, enable_redhat_buildsys="no"
-)
-AC_ARG_ENABLE(transarc-paths,
-[  --enable-transarc-paths                     Use Transarc style paths like /usr/afs and /usr/vice],, enable_transarc_paths="no"
-)
-
-AC_PROG_CC
-
-dnl weird ass systems
-AC_AIX
-AC_ISC_POSIX
-AC_MINIX
-
-dnl Various compiler setup.
-AC_C_INLINE
-AC_C_CONST
-AC_TYPE_PID_T
-AC_TYPE_SIZE_T
-AC_TYPE_SIGNAL
-
-dnl Checks for programs.
-AC_PROG_INSTALL
-AC_PROG_LN_S
-AC_PROG_RANLIB
-AC_PROG_YACC
-AM_PROG_LEX
-
-OPENAFS_CHECK_BIGENDIAN
-
-AC_MSG_CHECKING(your OS)
-system=$host
-case $system in
-        *-linux*)
-               MKAFS_OSTYPE=LINUX
-               if test "x$enable_redhat_buildsys" = "xyes"; then
-                AC_DEFINE(ENABLE_REDHAT_BUILDSYS)
-               fi
-               if test "x$enable_kernel_module" = "xyes"; then
-                if test "x$with_linux_kernel_headers" != "x"; then
-                  LINUX_KERNEL_PATH="$with_linux_kernel_headers"
-                else
-                  LINUX_KERNEL_PATH="/usr/src/linux"
-                fi
-                if test -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then
-                 linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $2 }'|tail -1`
-                 if test "x$linux_kvers" = "x"; then
-                   if test -f "$LINUX_KERNEL_PATH/include/linux/version-up.h"; then
-                     linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $2 }'|tail -1`
-                     if test "x$linux_kvers" = "x"; then
-
-                       AC_MSG_ERROR(Linux headers lack version definition [2])
-                       exit 1
-                     else
-                       LINUX_VERSION="$linux_kvers"
-                      fi
-                    else
-                      AC_MSG_ERROR(Linux headers lack version definition)
-                     exit 1
-                   fi
-                 else
-                   LINUX_VERSION="$linux_kvers"
-                 fi
-                else
-                    enable_kernel_module="no"
-                 fi
-                if test ! -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then
-                    enable_kernel_module="no"
-                fi
-                if test "x$enable_kernel_module" = "xno"; then
-                 if test "x$with_linux_kernel_headers" != "x"; then
-                  AC_MSG_ERROR(No usable linux headers found at $LINUX_KERNEL_PATH)
-                  exit 1
-                 else
-                  AC_MSG_WARN(No usable linux headers found at $LINUX_KERNEL_PATH so disabling kernel module)
-                 fi
-                fi
-               fi
-               AC_MSG_RESULT(linux)
-               if test "x$enable_kernel_module" = "xyes"; then
-                LINUX_FS_STRUCT_INODE_HAS_I_BYTES
-                LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
-                LINUX_FS_STRUCT_INODE_HAS_I_CDEV
-                LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM
-                LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
-                LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD
-                LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED
-                LINUX_INODE_SETATTR_RETURN_TYPE
-                LINUX_NEED_RHCONFIG
-                LINUX_WHICH_MODULES
-                if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
-                 AC_DEFINE(INODE_SETATTR_NOT_VOID)
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS)
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_mmap_shared" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_MMAP_SHARED)
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_mapping_overload" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_MAPPING_OVERLOAD)
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_cdev" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_CDEV)
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM)
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_bytes" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_BYTES)
-                fi
-                if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then 
-                 AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK)
-                fi
-                :
-               fi
-                ;;
-        *-solaris*)
-               MKAFS_OSTYPE=SOLARIS
-                AC_MSG_RESULT(sun4)
-               SOLARIS_UFSVFS_HAS_DQRWLOCK
-                ;;
-        *-hpux*)
-               MKAFS_OSTYPE=HPUX
-                AC_MSG_RESULT(hp_ux)
-                ;;
-        *-irix*)
-               MKAFS_OSTYPE=IRIX
-                AC_MSG_RESULT(sgi)
-                ;;
-        *-aix*)
-               MKAFS_OSTYPE=AIX
-                AC_MSG_RESULT(rs_aix)
-                ;;
-        *-osf*)
-               MKAFS_OSTYPE=DUX
-                AC_MSG_RESULT(alpha_dux)
-               if test "x$enable_kernel_module" = "xyes"; then
-                if test "x$with_dux_kernel_headers" != "x"; then
-                  HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
-                else
-                  HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
-                fi
-               fi
-               if test "$HEADER_RT" = "*" ; then
-                       AC_MSG_ERROR([Need a configured kernel directory])
-               fi
-               AC_SUBST([HEADER_RT])
-                ;;
-        *-darwin*)
-               MKAFS_OSTYPE=DARWIN
-                AC_MSG_RESULT(ppc_darwin)
-                ;;
-       *-freebsd*)
-               MKAFS_OSTYPE=FBSD
-               AC_MSG_RESULT(i386_fbsd)
-               ;;
-       *-openbsd*)
-               MKAFS_OSTYPE=OBSD
-               AC_MSG_RESULT(i386_obsd)
-               ;;
-        *)
-                AC_MSG_RESULT($system)
-                ;;
-esac
-
-if test "x$with_afs_sysname" != "x"; then
-        AFS_SYSNAME="$with_afs_sysname"
-else
-       AC_MSG_CHECKING(your AFS sysname)
-       case $host in
-               i?86-*-freebsd4.2*)
-                       AFS_SYSNAME="i386_fbsd_42"
-                       ;;
-               hppa*-hp-hpux11*)
-                       AFS_SYSNAME="hp_ux110"
-                       ;;
-               hppa*-hp-hpux10*)
-                       AFS_SYSNAME="hp_ux102"
-                       ;;
-               powerpc-apple-darwin1.2*)
-                       AFS_SYSNAME="ppc_darwin_12"
-                       DARWIN_PLIST=afs.${AFS_SYSNAME}.plist
-                       DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist
-                       ;;
-               powerpc-apple-darwin1.3*)
-                       AFS_SYSNAME="ppc_darwin_13"
-                       DARWIN_PLIST=afs.${AFS_SYSNAME}.plist
-                       DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist
-                       ;;
-               powerpc-apple-darwin1.4*)
-                       AFS_SYSNAME="ppc_darwin_14"
-                       DARWIN_PLIST=afs.${AFS_SYSNAME}.plist
-                       DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist
-                       ;;
-               sparc-sun-solaris2.5*)
-                       AFS_SYSNAME="sun4x_55"
-                       ;;
-               sparc-sun-solaris2.6)
-                       AFS_SYSNAME="sun4x_56"
-                       ;;
-               sparc-sun-solaris2.7)
-                       AFS_SYSNAME="sun4x_57"
-                       ;;
-               sparc-sun-solaris2.8)
-                       AFS_SYSNAME="sun4x_58"
-                       ;;
-               alpha*-dec-osf4.0*)
-                       AFS_SYSNAME="alpha_dux40"
-                       ;;
-               alpha*-dec-osf5.0*)
-                       AFS_SYSNAME="alpha_dux50"
-                       ;;
-               mips-sgi-irix6.5)
-                       AFS_SYSNAME="sgi_65"
-                       ;;
-               ia64-*-linux*)
-                       AFS_SYSNAME="ia64_linuxXX"
-                       ;;
-               powerpc-*-linux*)
-                       AFS_SYSNAME="ppc_linuxXX"
-                       ;;
-               alpha*-linux*)
-                       AFS_SYSNAME="alpha_linux_XX"
-                       ;;
-               s390-*-linux*)
-                       AFS_SYSNAME="s390_linuxXX"
-                       ;;
-               sparc-*-linux*)
-                       AFS_SYSNAME="sparc_linuxXX"
-                       ;;
-               sparc64-*-linux*)
-                       AFS_SYSNAME="sparc64_linuxXX"
-                       ;;
-               i?86-*-linux*)
-                       AFS_SYSNAME="i386_linuxXX"
-                       ;;
-               power*-ibm-aix4.2*)
-                       AFS_SYSNAME="rs_aix42"
-                       ;;
-               power*-ibm-aix4.3*)
-                       AFS_SYSNAME="rs_aix42"
-                       ;;
-               *)
-                       AC_MSG_ERROR(An AFS sysname is required)
-                       exit 1
-                       ;;
-       esac
-       case $AFS_SYSNAME in
-               *_linux*)
-                       AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $1 $2}'`
-                       if test "x${AFS_SYSKVERS}" = "x"; then
-                        AC_MSG_ERROR(Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname.)
-                       fi
-                       _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/`
-                       AFS_SYSNAME="$_AFS_SYSNAME"
-                       ;;
-       esac
-        AC_MSG_RESULT($AFS_SYSNAME)
-fi
-
-
-if test "x${MKAFS_OSTYPE}" = "xIRIX"; then
-        echo Skipping library tests because they confuse Irix.
-else
-  AC_CHECK_FUNCS(socket)
-
-  if test "$ac_cv_func_socket" = no; then
-    for lib in socket inet; do
-        if test "$HAVE_SOCKET" != 1; then
-                AC_CHECK_LIB(${lib}, socket,LIBS="$LIBS -l$lib";HAVE_SOCKET=1;AC_DEFINE(HAVE_SOCKET))
-        fi
-    done
-  fi
-  
-  AC_CHECK_FUNCS(connect)       
-
-  if test "$ac_cv_func_connect" = no; then
-    for lib in nsl; do
-        if test "$HAVE_CONNECT" != 1; then
-                AC_CHECK_LIB(${lib}, connect,LIBS="$LIBS -l$lib";HAVE_CONNECT=1;AC_DEFINE(HAVE_CONNECT))
-        fi
-    done
-  fi
-
-  AC_CHECK_FUNCS(gethostbyname)
-  if test "$ac_cv_func_gethostbyname" = no; then
-        for lib in dns nsl resolv; do
-          if test "$HAVE_GETHOSTBYNAME" != 1; then
-            AC_CHECK_LIB(${lib}, gethostbyname, LIBS="$LIBS -l$lib";HAVE_GETHOSTBYNAME=1;AC_DEFINE(HAVE_GETHOSTBYNAME))
-          fi
-        done    
-  fi    
-
-  AC_CHECK_FUNCS(res_search)
-  if test "$ac_cv_func_res_search" = no; then
-        for lib in dns nsl resolv; do
-          if test "$HAVE_RES_SEARCH" != 1; then
-            AC_CHECK_LIB(${lib}, res_search, LIBS="$LIBS -l$lib";HAVE_RES_SEARCH=1;AC_DEFINE(HAVE_RES_SEARCH))
-          fi
-        done    
-       if test "$HAVE_RES_SEARCH" = 1; then
-         LIB_res_search="-l$lib"       
-       fi
-  fi    
-fi
-
-PTHREAD_LIBS=error
-AC_CHECK_LIB(pthread, pthread_attr_init,
-             PTHREAD_LIBS="-lpthread")
-if test "x$PTHREAD_LIBS" = xerror; then
-        AC_CHECK_LIB(pthreads, pthread_attr_init,
-                PTHREAD_LIBS="-lpthreads")
-fi
-if test "x$PTHREAD_LIBS" = xerror; then
-        AC_CHECK_LIB(c_r, pthread_attr_init,
-                PTHREAD_LIBS="-lc_r")
-fi
-if test "x$PTHREAD_LIBS" = xerror; then
-        AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="")
-fi
-if test "x$PTHREAD_LIBS" = xerror; then
-        AC_MSG_WARN(*** Unable to locate working posix thread library ***)
-fi
-AC_SUBST(PTHREAD_LIBS)
-
-WITH_OBSOLETE=NO
-if test "$enable_obsolete" = "yes"; then
-       WITH_OBSOLETE=YES
-fi
-
-WITH_INSECURE=NO
-if test "$enable_insecure" = "yes"; then
-       WITH_INSECURE=YES
-fi
-
-# Fast restart
-if test "$enable_fast_restart" = "yes"; then
-       AC_DEFINE(FAST_RESTART)
-fi
-
-if test "$enable_bitmap_later" = "yes"; then
-       AC_DEFINE(BITMAP_LATER)
-fi
-
-if test "$enable_full_vos_listvol_switch" = "yes"; then
-       AC_DEFINE(FULL_LISTVOL_SWITCH)
-fi
-
-if test "$enable_bos_restricted_mode" = "yes"; then
-       AC_DEFINE(BOS_RESTRICTED_MODE)
-fi
-
-if test "$enable_namei_fileserver" = "yes"; then
-       AC_DEFINE(AFS_NAMEI_ENV)
-fi
-
-if test "$enable_afsdb" = "yes"; then
-       LIB_AFSDB="$LIB_res_search"
-       AC_DEFINE(AFS_AFSDB_ENV)
-fi
+OPENAFS_CONFIGURE_COMMON
 
-SRCDIR_PARENT=`pwd`
 TOP_SRCDIR="${SRCDIR_PARENT}"
-DESTDIR="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest/"
 TOP_INCDIR="${SRCDIR_PARENT}/include"
 TOP_LIBDIR="${SRCDIR_PARENT}/lib"
-
-dnl checks for header files.
-AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-AC_HEADER_DIRENT
-AC_CHECK_HEADERS(stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h)
-AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h)
-AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h)
-AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h)
-AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h)
-AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h)
-
-AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf re_comp re_exec)
-
-dnl Directory PATH handling
-if test "x$enable_transarc_paths" = "xyes"  ; then 
-    afsconfdir=${afsconfdir=/usr/afs/etc}
-    viceetcdir=${viceetcdir=/usr/vice/etc}
-    afskerneldir=${afskerneldir=${viceetcdir}}
-    afssrvbindir=${afssrvbindir=/usr/afs/bin}
-    afssrvsbindir=${afssrvsbindir=/usr/afs/bin}
-    afssrvlibexecdir=${afssrvlibexecdir=/usr/afs/bin}
-    afsdbdir=${afsdbdir=/usr/afs/db}
-    afslogsdir=${afslogsdir=/usr/afs/logs}
-    afslocaldir=${afslocaldir=/usr/afs/local}
-    afsbackupdir=${afsbackupdir=/usr/afs/backup}
-    afsbosconfigdir=${afsbosconfigdir=/usr/afs/local}
-    else 
-    afsconfdir=${afsconfdir=$sysconfdir/openafs/server}
-    viceetcdir=${viceetcdir=$sysconfdir/openafs}
-    afskerneldir=${afskerneldir=$libdir/openafs}
-    afssrvbindir=${afssrvbindir=$bindir}
-    afssrvsbindir=${afssrvsbindir=$sbindir}
-    afssrvlibexecdir=${afssrvlibexecdir=$libexecdir/openafs}
-    afsdbdir=${afsdbdir=$localstatedir/openafs/db}
-    afslogsdir=${afslogsdir=$localstatedir/openafs/logs}
-    afslocaldir=${afslocaldir=$localstatedir/openafs}
-    afsbackupdir=${afsbackupdir=$localstatedir/openafs/backup}
-    afsbosconfigdir=${afsbosconfigdir=$sysconfdir/openafs}
-
+if test "${DEST}x" = "x"; then
+       DEST="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest"
 fi
-AC_SUBST(afsconfdir)
-AC_SUBST(viceetcdir)
-AC_SUBST(afskerneldir)
-AC_SUBST(afssrvbindir)
-AC_SUBST(afssrvsbindir)
-AC_SUBST(afssrvlibexecdir)
-AC_SUBST(afsdbdir)
-AC_SUBST(afslogsdir)
-AC_SUBST(afslocaldir)
-AC_SUBST(afsbackupdir)
-AC_SUBST(afsbosconfigdir)
 
-if test "x$enable_kernel_module" = "xyes"; then
-ENABLE_KERNEL_MODULE=libafs
+# Check for files involved in porting.  Report errors, don't make the
+# user hunt through the configure log after the build fails!
+if test ! -r config/Makefile.${AFS_SYSNAME}.in ; then
+  AC_MSG_ERROR(no source file config/Makefile.${AFS_SYSNAME}.in)
 fi
 
-AC_SUBST(AFS_SYSNAME)
-AC_SUBST(ENABLE_KERNEL_MODULE)
-AC_SUBST(LIB_AFSDB)
-AC_SUBST(LINUX_KERNEL_PATH)
-AC_SUBST(LINUX_VERSION)
-AC_SUBST(MKAFS_OSTYPE)
-AC_SUBST(TOP_SRCDIR)
-AC_SUBST(TOP_INCDIR)
-AC_SUBST(TOP_LIBDIR)
-AC_SUBST(DEST)
-AC_SUBST(WITH_OBSOLETE)
-AC_SUBST(WITH_INSECURE)
-AC_SUBST(DARWIN_INFOFILE)
-
 AC_OUTPUT(             \
 Makefile               \
 config/Makefile.${AFS_SYSNAME} \
index e0316f8d4841f77be61987447a9ca394ec7f9078..23f2dceb1bbe216d02c4cdbda72329ca6d4d6274 100644 (file)
@@ -4,7 +4,10 @@
 
 OBJ = $(SYS_NAME)/obj
 DEST = $(SYS_NAME)/dest
+DESTDIR = DEST/
+SRCDIR = ${DESTDIR}
 #LINUX_SYS = i386_linux22
+TOP_SRCDIR = `pwd`/src
 
 all: afsd
 
index 2e766745d5e146dbbf7d0bb0811c91fcae9f275e..8fb98427d89c5f1c75f0054669669bf39789f122 100644 (file)
@@ -179,7 +179,13 @@ sys: cm_headers
        $(NTMAKE)
        $(CD) ..\..
 
-auth: sys
+afsdobjs: sys
+     echo ***** $@
+     $(CD) $(OBJ)\WINNT\afsd
+     $(NTMAKE_OBJS)
+     $(CD) ..\..\..
+
+auth: afsdobjs
      echo ***** $@
        $(CD) $(OBJ)\$@
        $(NTMAKE)
index 268119af63623f2753fa379c31ed657d216649ea..07cc29a8fceedd15a7cc3b035b64f03de84a1a78 100644 (file)
@@ -21,6 +21,7 @@ CD = cd
 NTMAKE = nmake /nologo /f ntmakefile install
 NTMAKELANG = nmake /nologo /f ntmakefile en_US
 NTMAKE_HEADERS = nmake /nologo /f ntmakefile install_headers
+NTMAKE_OBJS = nmake /nologo /f ntmakefile install_objs
 MKDIR = mkdir
 OBJ = src
 
@@ -178,7 +179,13 @@ sys: cm_headers
        $(NTMAKE)
        $(CD) ..\..
 
-auth: sys
+afsdobjs: sys
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\afsd
+       $(NTMAKE_OBJS)
+       $(CD) ..\..\..
+
+auth: afsdobjs
      echo ***** $@
        $(CD) $(OBJ)\$@
        $(NTMAKE)
index 678857356660f8e9205947a21e149f7a268d49d5..88488749b03209bd9ae89e34b5fb7bd9ab1c0742 100644 (file)
@@ -9,7 +9,8 @@ SOURCES    = afsd95.c afsd_init95.c cm_access.c cm_aclent.c cm_buf.c \
                cm_dcache.c cm_dir.c cm_dnlc.c cm_ioctl.c cm_scache.c \
                cm_server.c cm_user.c cm_utils.c cm_vnodeops.c cm_volume.c \
                dosutils95.c largeint95.c netbios95.c smb.c smb_ioctl.c \
-               cm_diskcache95.c queue95.c afsmsg95.c smb3.c
+               cm_diskcache95.c queue95.c afsmsg95.c smb3.c cm_dns.c \
+               cm_freelance.c
 
 include ../../config/Makefile.djgpp.common
 
@@ -24,7 +25,7 @@ all : $(TARGETS)
 install : $(DESTBIN)/afsd.exe #$(DESTBIN)/klog.exe
 #CFLAGS += -I../vxd_lib
 #CFLAGS += -DAFS_VXD
-CFLAGS += -DDOS_PKT_WHOLE
+CFLAGS += -DDOS_PKT_WHOLE -DAFS_AFSDB_ENV -DAFS_FREELANCE_CLIENT
 
 INCFILES = \
         $(DESTINC)/netbios95.h \
index e8e33daaa360e19b1d173ad62eac083b2631a1d1..4e5af5afc7f36da16e0bebd6fa003ea141c39e95 100644 (file)
@@ -36,12 +36,15 @@ INCFILES =\
        $(INCFILEDIR)\smb_iocons.h \
        $(INCFILEDIR)\smb_ioctl.h \
        $(INCFILEDIR)\afsmsg95.h \
-       $(INCFILEDIR)\afsrpc.h
+       $(INCFILEDIR)\afsrpc.h \
+       $(INCFILEDIR)\cm_dns.h \
+       $(INCFILEDIR)\cm_dns_private.h
 
 IDLFILES =\
        afsrpc.h afsrpc_c.obj
 
-CONFOBJS=cm_config.obj
+CONFOBJS=cm_config.obj \
+         cm_dns.obj
 
 AFSDOBJS=\
        afsd_init.obj \
@@ -66,7 +69,8 @@ AFSDOBJS=\
        cm_aclent.obj \
        cm_dnlc.obj \
        cm_rpc.obj \
-       afsrpc_s.obj
+       afsrpc_s.obj \
+     cm_freelance.obj
 
 cm_conn.obj: cm_conn.c
        $(C2OBJ) -DAFS_PTHREAD_ENV $**
@@ -153,6 +157,10 @@ $(LOG95_DLLFILE): $(LOG95_DLLOBJS)
 ############################################################################
 # Install target; primary makefile target
 
+install_objs: cm_dns.obj cm_config.obj
+     $(COPY) cm_dns.obj $(DESTDIR)\lib
+     $(COPY) cm_config.obj $(DESTDIR)\lib
+
 install_headers: $(IDLFILES) $(INCFILES)
 
 install: install_headers $(CONF_DLLFILE) \
index 0c6f59fde3684bc55c50f5e3f753d620fd649497..6456c713999e23c47b1ca36f9a075445a3d5f6df 100644 (file)
@@ -35,7 +35,7 @@ BOOL APIENTRY About(HWND, unsigned int, unsigned int, long);
 
 #include "krb.h"
 #include "krb_prot.h"
-#include <crypt.h>
+/*#include <crypt.h>*/
 #include <afs/prs_fs.h>
 
 #include <osi.h>
@@ -60,6 +60,7 @@ BOOL APIENTRY About(HWND, unsigned int, unsigned int, long);
 #include "cm_ioctl.h"
 #include "cm_dnlc.h"
 #include "cm_buf.h"
+#include "cm_freelance.h"
 #ifdef DJGPP
 #include "afs/afsmsg95.h"
 #endif
@@ -96,4 +97,30 @@ extern BOOL isGateway;
 
 extern BOOL reportSessionStartups;
 
+#ifdef AFS_FREELANCE_CLIENT
+
+// yj: Variables used by Freelance Client
+extern char *cm_FakeRootDir;                                           // the fake root.afs directory
+
+extern int cm_noLocalMountPoints;                                      // no. of fake mountpoints
+
+extern cm_localMountPoint_t* cm_localMountPoints;      // array of fake mountpoints
+
+extern int cm_fakeDirSize;                                                     // size (in bytes) of fake root.afs directory
+
+extern int cm_fakeDirCallback;                                         // state of the fake root.afs directory. indicates
+                                                                                                       // if it needs to be refreshed
+
+extern int cm_fakeGettingCallback;                                     // 1 if currently updating the fake root.afs directory,
+                                                                                                       // 0 otherwise
+
+extern int cm_fakeDirVersion;                                          // the version number of the root.afs directory. used 
+                                                                                                       // invalidate all the buffers containing root.afs data
+                                                                                                       // after reinitialization
+// ------------------------------------------
+#endif /* AFS_FREELANCE_CLIENT */
+
+extern int cm_dnsEnabled;
+extern int cm_freelanceEnabled;
+
 #endif /* AFSD_H_ENV */
index 3aa6bc7d0c0a9563cd6dbe374568ac246ffe577a..75cd53ae1f414f27d6f41d2dbdc426b5851f9a4f 100644 (file)
@@ -95,6 +95,8 @@ int main(int argc, char *argv[])
     cmd_AddParm(ts, "-tracebuf", CMD_SINGLE, CMD_OPTIONAL, "trace buffer size");
     cmd_AddParm(ts, "-startup", CMD_FLAG, CMD_OPTIONAL, "start AFS client");
     cmd_AddParm(ts, "-diskcache", CMD_SINGLE, CMD_OPTIONAL, "diskcache size");
+    cmd_AddParm(ts, "-afsdb", CMD_FLAG, CMD_OPTIONAL, "use DNS for cell server resolution");
+    cmd_AddParm(ts, "-freelance", CMD_FLAG, CMD_OPTIONAL, "virtual AFS root");
 
     return (cmd_Dispatch(argc, argv));
 }
index 48cecb4afee62df8d93ded48d2f12e5c1f62ba51..a09e4c14476ceea011bf13b0780b58aadd0b6d71 100644 (file)
@@ -48,6 +48,9 @@ char cm_mountRoot[1024];
 DWORD cm_mountRootLen;
 int cm_logChunkSize;
 int cm_chunkSize;
+#ifdef AFS_FREELANCE_CLIENT
+char *cm_FakeRootDir;
+#endif /* freelance */
 
 int smb_UseV3;
 
@@ -82,6 +85,16 @@ cm_initparams_v1 cm_initParams;
 
 HANDLE afsi_file;
 
+#ifdef AFS_AFSDB_ENV
+int cm_dnsEnabled = 1;
+#endif
+
+/*#ifdef AFS_FREELANCE_CLIENT
+extern int cm_freelanceEnabled;
+#endif*/
+
+void cm_InitFakeRootDir();
+
 void
 afsi_start()
 {
@@ -167,6 +180,7 @@ int afsd_InitCM(char **reasonP)
        HKEY parmKey;
        DWORD dummyLen;
        long code;
+       /*int freelanceEnabled;*/
        WSADATA WSAjunk;
 
        WSAStartup(0x0101, &WSAjunk);
@@ -392,6 +406,32 @@ int afsd_InitCM(char **reasonP)
                afsi_log("Default SecurityLevel is clear");
        }
 
+#ifdef AFS_AFSDB_ENV
+       dummyLen = sizeof(cm_dnsEnabled);
+       code = RegQueryValueEx(parmKey, "UseDNS", NULL, NULL,
+                               (BYTE *) &cm_dnsEnabled, &dummyLen);
+       if (code == ERROR_SUCCESS) {
+               afsi_log("DNS %s be used to find AFS cell servers",
+                        cm_dnsEnabled ? "will" : "will not");
+       }
+       else {
+         cm_dnsEnabled = 1;   /* default on */
+       }
+#endif /* AFS_AFSDB_ENV */
+
+#ifdef AFS_FREELANCE_CLIENT
+       dummyLen = sizeof(cm_freelanceEnabled);
+       code = RegQueryValueEx(parmKey, "FreelanceClient", NULL, NULL,
+                               (BYTE *) &cm_freelanceEnabled, &dummyLen);
+       if (code == ERROR_SUCCESS) {
+               afsi_log("Freelance client feature %s activated",
+                        cm_freelanceEnabled ? "is" : "is not");
+       }
+       else {
+         cm_freelanceEnabled = 0;  /* default off */
+       }
+#endif /* AFS_FREELANCE_CLIENT */
+
        RegCloseKey (parmKey);
 
        /* setup early variables */
@@ -497,20 +537,35 @@ int afsd_InitCM(char **reasonP)
                return -1;
        }
 
+#ifdef AFS_AFSDB_ENV
+       if (cm_InitDNS(cm_dnsEnabled) == -1)
+         cm_dnsEnabled = 0;  /* init failed, so deactivate */
+       afsi_log("cm_InitDNS %d", cm_dnsEnabled);
+#endif
+
        code = cm_GetRootCellName(rootCellName);
        afsi_log("cm_GetRootCellName code %d rcn %s", code,
                 (code ? "<none>" : rootCellName));
-       if (code != 0) {
-               *reasonP = "can't find root cell name in afsd.ini";
-               return -1;
+       if (code != 0 && !cm_freelanceEnabled) {
+           *reasonP = "can't find root cell name in afsd.ini";
+           return -1;
+        }
+        else if (cm_freelanceEnabled)
+          cm_rootCellp = NULL;
+
+        if (code == 0 && !cm_freelanceEnabled) {
+         cm_rootCellp = cm_GetCell(rootCellName, CM_FLAG_CREATE);
+          afsi_log("cm_GetCell addr %x", cm_rootCellp);
+         if (cm_rootCellp == NULL) {
+           *reasonP = "can't find root cell in afsdcell.ini";
+           return -1;
+         }
        }
 
-       cm_rootCellp = cm_GetCell(rootCellName, CM_FLAG_CREATE);
-       afsi_log("cm_GetCell addr %x", cm_rootCellp);
-       if (cm_rootCellp == NULL) {
-               *reasonP = "can't find root cell in afsdcell.ini";
-               return -1;
-       }
+#ifdef AFS_FREELANCE_CLIENT
+       if (cm_freelanceEnabled)
+         cm_InitFreelance();
+#endif
 
        return 0;
 }
@@ -524,19 +579,26 @@ int afsd_InitDaemons(char **reasonP)
 
        /* this should really be in an init daemon from here on down */
 
-       code = cm_GetVolumeByName(cm_rootCellp, cm_rootVolumeName, cm_rootUserp,                &req, CM_FLAG_CREATE, &cm_rootVolumep);
-       afsi_log("cm_GetVolumeByName code %x root vol %x", code,
-                (code ? 0xffffffff : cm_rootVolumep));
-       if (code != 0) {
-               *reasonP = "can't find root volume in root cell";
-               return -1;
+        if (!cm_freelanceEnabled) {
+          code = cm_GetVolumeByName(cm_rootCellp, cm_rootVolumeName, cm_rootUserp,
+                                    &req, CM_FLAG_CREATE, &cm_rootVolumep);
+          afsi_log("cm_GetVolumeByName code %x root vol %x", code,
+                   (code ? 0xffffffff : cm_rootVolumep));
+          if (code != 0) {
+            *reasonP = "can't find root volume in root cell";
+            return -1;
+          }
         }
 
-        /* compute the root fid */
-       cm_rootFid.cell = cm_rootCellp->cellID;
-        cm_rootFid.volume = cm_GetROVolumeID(cm_rootVolumep);
-        cm_rootFid.vnode = 1;
-        cm_rootFid.unique = 1;
+       /* compute the root fid */
+       if (!cm_freelanceEnabled) {
+         cm_rootFid.cell = cm_rootCellp->cellID;
+         cm_rootFid.volume = cm_GetROVolumeID(cm_rootVolumep);
+         cm_rootFid.vnode = 1;
+         cm_rootFid.unique = 1;
+       }
+       else
+         cm_FakeRootFid(&cm_rootFid);
         
         code = cm_GetSCache(&cm_rootFid, &cm_rootSCachep, cm_rootUserp, &req);
        afsi_log("cm_GetSCache code %x scache %x", code,
@@ -575,3 +637,4 @@ int afsd_InitSMB(char **reasonP, void *aMBfunc)
 
        return 0;
 }
+
index 602255fa6e497cb3d89fa07cc23171da7e354c69..cdd9ffeb51b98fa41f2a3d6d361cd066586cd617 100644 (file)
@@ -47,6 +47,14 @@ int cm_chunkSize;
 int afs_diskCacheChunks;
 char cm_cachePath[128];
 int cm_diskCacheEnabled = 0;
+#ifdef AFS_AFSDB_ENV
+extern int cm_dnsEnabled;
+#endif
+
+#ifdef AFS_FREELANCE_CLIENT
+extern int cm_freelanceEnabled;
+char *cm_FakeRootDir;
+#endif /* freelance */
 
 int smb_UseV3;
 
@@ -84,6 +92,7 @@ BOOL reportSessionStartups = FALSE;
 int afsd_debug;
 cm_initparams_v1 cm_initParams;
 
+
 /*
  * AFSD Initialization Log
  *
@@ -555,6 +564,16 @@ int afsd_InitCM(char **reasonP, struct cmd_syndesc *as, char *arock)
           afsi_log("Default disk cache size %d", diskCacheSize);
         }
 
+        if (as->parms[22].items) {
+           /* -noafsdb */
+           cm_dnsEnabled = 0;
+        }
+
+        if (as->parms[23].items) {
+           /* -freelance */
+           cm_freelanceEnabled = 1;
+        }
+
         if (ParseCacheInfoFile()) {
           exit(1);
         }
@@ -638,6 +657,13 @@ int afsd_InitCM(char **reasonP, struct cmd_syndesc *as, char *arock)
         rx_StartServer(0);
        afsi_log("rx_StartServer");
 
+#ifdef AFS_AFSDB_ENV
+       /* initialize dns lookup */
+       if (cm_InitDNS(cm_dnsEnabled) == -1)
+         cm_dnsEnabled = 0;  /* init failed, so deactivate */
+       afsi_log("cm_InitDNS %d", cm_dnsEnabled);
+#endif
+
        /* init user daemon, and other packages */
        cm_InitUser();
 
@@ -670,18 +696,27 @@ int afsd_InitCM(char **reasonP, struct cmd_syndesc *as, char *arock)
        code = cm_GetRootCellName(rootCellName);
        afsi_log("cm_GetRootCellName code %d rcn %s", code,
                 (code ? "<none>" : rootCellName));
-       if (code != 0) {
+       if (code != 0 && !cm_freelanceEnabled) {
                *reasonP = "can't find root cell name in ThisCell";
                return -1;
        }
-
-       cm_rootCellp = cm_GetCell(rootCellName, CM_FLAG_CREATE);
-       afsi_log("cm_GetCell addr %x", cm_rootCellp);
-       if (cm_rootCellp == NULL) {
-               *reasonP = "can't find root cell in CellServDB";
-               return -1;
+       else if (cm_freelanceEnabled)
+         cm_rootCellp = NULL;
+       
+       if (code == 0 && !cm_freelanceEnabled) {
+         cm_rootCellp = cm_GetCell(rootCellName, CM_FLAG_CREATE);
+         afsi_log("cm_GetCell addr %x", cm_rootCellp);
+         if (cm_rootCellp == NULL) {
+           *reasonP = "can't find root cell in CellServDB";
+           return -1;
+         }
        }
 
+#ifdef AFS_FREELANCE_CLIENT
+       if (cm_freelanceEnabled)
+         cm_InitFreelance();
+#endif
+
        return 0;
 }
 
@@ -694,19 +729,25 @@ int afsd_InitDaemons(char **reasonP)
 
        /* this should really be in an init daemon from here on down */
 
-       code = cm_GetVolumeByName(cm_rootCellp, cm_rootVolumeName, cm_rootUserp,                &req, CM_FLAG_CREATE, &cm_rootVolumep);
-       afsi_log("cm_GetVolumeByName code %x root vol %x", code,
-                (code ? 0xffffffff : cm_rootVolumep));
-       if (code != 0) {
-               *reasonP = "can't find root volume in root cell";
-               return -1;
-        }
+       if (!cm_freelanceEnabled) { 
+         code = cm_GetVolumeByName(cm_rootCellp, cm_rootVolumeName, cm_rootUserp,              &req, CM_FLAG_CREATE, &cm_rootVolumep);
+         afsi_log("cm_GetVolumeByName code %x root vol %x", code,
+                  (code ? 0xffffffff : cm_rootVolumep));
+         if (code != 0) {
+           *reasonP = "can't find root volume in root cell";
+           return -1;
+         }
+       }
 
         /* compute the root fid */
-       cm_rootFid.cell = cm_rootCellp->cellID;
-        cm_rootFid.volume = cm_GetROVolumeID(cm_rootVolumep);
-        cm_rootFid.vnode = 1;
-        cm_rootFid.unique = 1;
+       if (!cm_freelanceEnabled) {
+         cm_rootFid.cell = cm_rootCellp->cellID;
+         cm_rootFid.volume = cm_GetROVolumeID(cm_rootVolumep);
+         cm_rootFid.vnode = 1;
+         cm_rootFid.unique = 1;
+       }
+       else
+         cm_FakeRootFid(&cm_rootFid);
         
         code = cm_GetSCache(&cm_rootFid, &cm_rootSCachep, cm_rootUserp, &req);
        afsi_log("cm_GetSCache code %x scache %x", code,
@@ -744,3 +785,4 @@ int afsd_InitSMB(char **reasonP)
 
        return 0;
 }
+
index f00938a4b19e112d275e40e4ce828e0b524fdec2..959b35ade5530ed68679c1367073e4ed6b4322a7 100644 (file)
 /* read/write lock for all global storage in this module */
 osi_rwlock_t cm_callbackLock;
 
+/*
+#ifdef AFS_FREELANCE_CLIENT
+extern int cm_fakeDirCallback;
+extern int cm_fakeGettingCallback;
+#endif
+*/
+#ifdef AFS_FREELANCE_CLIENT
+extern osi_mutex_t cm_Freelance_Lock;
+#endif
+
 /* count of # of callback breaking messages received by this CM so far.  We use
  * this count in determining whether there have been any callback breaks that
  * apply to a call that returned a new callback.  If the counter doesn't
@@ -568,9 +578,50 @@ void cm_InitCallback(void)
  */
 int cm_HaveCallback(cm_scache_t *scp)
 {
-       if (scp->cbServerp != NULL)
-               return 1;
-       else return 0;
+#ifdef AFS_FREELANCE_CLIENT
+    // yj: we handle callbacks specially for callbacks on the root directory
+    // Since it's local, we almost always say that we have callback on it
+    // The only time we send back a 0 is if we're need to initialize or
+    // reinitialize the fake directory
+
+    // There are 2 state variables cm_fakeGettingCallback and cm_fakeDirCallback
+    // cm_fakeGettingCallback is 1 if we're in the process of initialization and
+    // hence should return false. it's 0 otherwise
+    // cm_fakeDirCallback is 0 if we haven't loaded the fake directory, it's 1
+    // if the fake directory is loaded and this is the first time cm_HaveCallback
+    // is called since then. We return false in this case to allow cm_GetCallback
+    // to be called because cm_GetCallback has some initialization work to do.
+    // If cm_fakeDirCallback is 2, then it means that the fake directory is in
+    // good shape and we simply return true, provided no change is detected.
+  int fdc, fgc;
+
+    if (cm_freelanceEnabled && scp->fid.cell==0x1 && scp->fid.volume==0x20000001) {    // if it's something on /afs
+       if (!(scp->fid.vnode==0x1 && scp->fid.unique==0x1))     // if it's not root.afs
+           return 1;
+       else {
+           lock_ObtainMutex(&cm_Freelance_Lock);
+           fdc = cm_fakeDirCallback;
+           fgc = cm_fakeGettingCallback;
+           lock_ReleaseMutex(&cm_Freelance_Lock);
+           
+           if (fdc==1) {       // first call since init
+               return 0;
+           } else if (fdc==2 && !fgc) {        // we're in good shape
+               if (cm_getLocalMountPointChange()) {    // check for changes
+                   cm_clearLocalMountPointChange(); // clear the changefile
+                   cm_reInitLocalMountPoints();        // start reinit
+                   return 0;
+               }
+               return 1;                       // no change
+           }
+           return 0;
+       }
+    }
+#endif
+
+    if (scp->cbServerp != NULL)
+       return 1;
+    else return 0;
 }
 
 /* need to detect a broken callback that races with our obtaining a callback.
@@ -694,6 +745,43 @@ long cm_GetCallback(cm_scache_t *scp, struct cm_user *userp,
         int mustCall;
         long sflags;
 
+#ifdef AFS_FREELANCE_CLIENT
+       // yj
+       // The case where a callback is needed on /afs is handled
+       // specially. We need to fetch the status by calling
+       // cm_MergeStatus and mark that cm_fakeDirCallback is 2
+       if (cm_freelanceEnabled &&
+          scp->fid.cell==0x1 &&
+               scp->fid.volume==0x20000001 &&
+               scp->fid.unique==0x1 &&
+               scp->fid.vnode==0x1) {
+               // Start by indicating that we're in the process
+               // of fetching the callback
+
+               lock_ObtainMutex(&cm_Freelance_Lock);
+               cm_fakeGettingCallback = 1;
+               lock_ReleaseMutex(&cm_Freelance_Lock);
+
+               // Fetch the status info 
+               cm_MergeStatus(scp, &afsStatus, &volSync, userp, 0);
+
+               // Indicate that the callback is not done
+               lock_ObtainMutex(&cm_Freelance_Lock);
+               cm_fakeDirCallback = 2;
+               // Indicate that we're no longer fetching the callback
+               cm_fakeGettingCallback = 0;
+               lock_ReleaseMutex(&cm_Freelance_Lock);
+
+               return 0;
+       }
+
+       /*if (scp->fid.cell==0x1 && scp->fid.volume==0x20000001) {
+               afsi_log("cm_getcallback should NEVER EVER get here... ");
+       }*/
+       // yj: end of getcallback modifications  ---------------
+               
+#endif /* AFS_FREELANCE_CLIENT */
+       
        mustCall = (flags & 1);
        cm_AFSFidFromFid(&tfid, &scp->fid);
        while (1) {
index b8317ebed9b5ad3914f4236e5a993cb5adedbf93..5ef16bc9a6328dd896884a59ff696892e2fce3f4 100644 (file)
@@ -60,20 +60,38 @@ cm_cell_t *cm_GetCell(char *namep, long flags)
        cm_cell_t *cp;
         long code;
         static cellCounter = 1;                /* locked by cm_cellLock */
+       int ttl;
 
        lock_ObtainWrite(&cm_cellLock);
        for(cp = cm_allCellsp; cp; cp=cp->nextp) {
                if (strcmp(namep, cp->namep) == 0) break;
         }
-       if (!cp && (flags & CM_FLAG_CREATE)) {
-               cp = malloc(sizeof(*cp));
+
+       if ((!cp && (flags & CM_FLAG_CREATE))
+#ifdef AFS_AFSDB_ENV
+           /* if it's from DNS, see if it has expired */
+           || (cp && (cp->flags & CM_CELLFLAG_DNS) && (time(0) > cp->timeout))
+#endif
+         ) {
+               if (!cp) cp = malloc(sizeof(*cp));
                 memset(cp, 0, sizeof(*cp));
                 code = cm_SearchCellFile(namep, NULL, cm_AddCellProc, cp);
-                if (code) {
-                       free(cp);
-                        cp = NULL;
-                        goto done;
-                }
+#ifdef AFS_AFSDB_ENV
+                if (code && cm_dnsEnabled) {
+                  code = cm_SearchCellByDNS(namep, NULL, &ttl, cm_AddCellProc, cp);
+#endif
+                 if (code) {
+                   free(cp);
+                   cp = NULL;
+                   goto done;
+                 }
+#ifdef AFS_AFSDB_ENV
+                 else {   /* got cell from DNS */
+                   cp->flags |= CM_CELLFLAG_DNS;
+                   cp->timeout = time(0) + ttl;
+                 }
+               }
+#endif
 
                /* randomise among those vlservers having the same rank*/ 
                cm_RandomizeServer(&cp->vlServersp);
@@ -100,11 +118,30 @@ done:
 cm_cell_t *cm_FindCellByID(long cellID)
 {
        cm_cell_t *cp;
+       int ttl;
+     int code;
 
        lock_ObtainWrite(&cm_cellLock);
        for(cp = cm_allCellsp; cp; cp=cp->nextp) {
                if (cellID == cp->cellID) break;
         }
+
+#ifdef AFS_AFSDB_ENV
+       /* if it's from DNS, see if it has expired */
+       if (cp && cm_dnsEnabled && (cp->flags & CM_CELLFLAG_DNS) && (time(0) > cp->timeout)) {
+         code = cm_SearchCellByDNS(cp->namep, NULL, &ttl, cm_AddCellProc, cp);
+         if (code == 0) {   /* got cell from DNS */
+           cp->flags |= CM_CELLFLAG_DNS;
+#ifdef DEBUG
+           fprintf(stderr, "cell %s: ttl=%d\n", cp->namep, ttl);
+#endif
+           cp->timeout = time(0) + ttl;
+         }
+         /* if we fail to find it this time, we'll just do nothing and leave the
+            current entry alone */
+       }
+#endif /* AFS_AFSDB_ENV */
+
        lock_ReleaseWrite(&cm_cellLock);        
        
         return cp;
index ca0ae38f4403b5adf178507eaf75392e6a1dd060..a642d04d2a179332a757722e5d10050a23651990 100644 (file)
@@ -20,9 +20,11 @@ typedef struct cm_cell {
         struct cm_serverRef *vlServersp;       /* locked by cm_serverLock */
         osi_mutex_t mx;                        /* mutex locking fields (flags) */
         long flags;                    /* locked by mx */
+        long timeout;                   /* if dns, time at which the server addrs expire */
 } cm_cell_t;
 
 #define CM_CELLFLAG_SUID       1       /* setuid flag; not yet used */
+#define CM_CELLFLAG_DNS         2       /* cell servers are from DNS */
 
 extern void cm_InitCell(void);
 
index a3ef82f3fef74d865bbbd5c10458cd36b9d80f14..10a0d44f6213e43f4fc3a4c4482a11f53cf46698 100644 (file)
 #include <string.h>
 
 #include "cm_config.h"
+#ifdef AFS_AFSDB_ENV
+#include "cm_dns.h"
+#include <afs/afsint.h>
+#endif
 
 char AFSConfigKeyName[] =
        "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters";
@@ -276,6 +280,35 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep,
         }              /* while loop processing all lines */
 }
 
+long cm_SearchCellByDNS(char *cellNamep, char *newCellNamep, int *ttl,
+               cm_configProc_t *procp, void *rockp)
+{
+#ifdef AFS_AFSDB_ENV
+     int rc;
+     int cellHosts[AFSMAXCELLHOSTS];
+     int numServers;
+     int i;
+     struct sockaddr_in vlSockAddr;
+
+     rc = getAFSServer(cellNamep, cellHosts, &numServers, ttl);
+     if (rc == 0 && numServers > 0) {     /* found the cell */
+       for (i = 0; i < numServers; i++) {
+           memcpy(&vlSockAddr.sin_addr.s_addr, &cellHosts[i],
+               sizeof(long));
+           vlSockAddr.sin_family = AF_INET;
+           /* sin_port supplied by connection code */
+           if (procp)
+          (*procp)(rockp, &vlSockAddr, NULL);
+           if(newCellNamep)
+          strcpy(newCellNamep,cellNamep);
+       }
+       return 0;   /* found cell */
+     }
+     else
+#endif /* AFS_AFSDB_ENV */
+       return -1;  /* not found */
+}
+
 #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
 /* look up the root cell's name in the Registry */
 long cm_GetRootCellName(char *cellNamep)
@@ -553,3 +586,32 @@ extern long cm_CloseCellFile(cm_configFile_t *filep)
         
         return code;
 }
+
+void cm_GetConfigDir(char *dir)
+{
+       char wdir[256];
+     char *afsconf_path;
+     int code;
+     int tlen;
+
+#if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
+       code = GetWindowsDirectory(wdir, sizeof(wdir));
+      if (code == 0 || code > sizeof(wdir)) wdir[0] = 0;
+        
+       /* add trailing backslash, if required */
+        tlen = strlen(wdir);
+        if (wdir[tlen-1] != '\\') strcat(wdir, "\\");
+#else
+#ifdef DJGPP
+        strcpy(wdir,cm_confDir);
+#else
+        afsconf_path = getenv("AFSCONF");
+        if (!afsconf_path)
+          strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
+        else
+          strcpy(wdir, afsconf_path);
+#endif /* !DJGPP */
+        strcat(wdir,"\\");
+#endif /* DJGPP || WIN95 */
+        strcpy(dir, wdir);
+}
index 19ab23660b241fe1d4ad71a48e2233a718b99061..11996e55c676b4b891663a44ae39c303688a876d 100644 (file)
@@ -36,6 +36,9 @@ extern long cm_GetRootCellName(char *namep);
 extern long cm_SearchCellFile(char *cellNamep, char *newCellNamep,
        cm_configProc_t *procp, void *rockp);
 
+extern long cm_SearchCellByDNS(char *cellNamep, char *newCellNamep, int *ttl,
+               cm_configProc_t *procp, void *rockp);
+
 extern long cm_WriteConfigString(char *labelp, char *valuep);
 
 extern long cm_WriteConfigInt(char *labelp, long value);
index 69a08cdf77a06ab8121fd18d246f99706b2e855b..6a7a3ac96901c5c462c231f5a82a2e58050c894c 100644 (file)
@@ -23,6 +23,9 @@
 #include "afsd.h"
 
 osi_mutex_t cm_bufGetMutex;
+#ifdef AFS_FREELANCE_CLIENT
+extern osi_mutex_t cm_Freelance_Lock;
+#endif
 
 /* functions called back from the buffer package when reading or writing data,
  * or when holding or releasing a vnode pointer.
@@ -1075,11 +1078,23 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *up,
         struct rx_call *callp;
         cm_bulkIO_t biod;              /* bulk IO descriptor */
         cm_conn_t *connp;
+       int getroot;
+       long t1, t2;
 
         /* now, the buffer may or may not be filled with good data (buf_GetNew
          * drops lots of locks, and may indeed return a properly initialized
          * buffer, although more likely it will just return a new, empty, buffer.
          */
+
+#ifdef AFS_FREELANCE_CLIENT
+
+       // yj: if they're trying to get the /afs directory, we need to
+       // handle it differently, since it's local rather than on any
+       // server
+
+       getroot = (scp==cm_rootSCachep) ;
+#endif
+
        cm_AFSFidFromFid(&tfid, &scp->fid);
 
        code = cm_SetupFetchBIOD(scp, &bufp->offset, &biod, up, reqp);
@@ -1120,6 +1135,73 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *up,
                 scp->dataVersion, bufp->dataVersion, scp, bufp, bufp->dcp);
 #endif /* DISKCACHE95 */
 
+#ifdef AFS_FREELANCE_CLIENT
+
+       // yj code
+       // if getroot then we don't need to make any calls
+       // just return fake data
+       
+        if (cm_freelanceEnabled && getroot) {
+               // setup the fake status                        
+               afsStatus.InterfaceVersion = 0x1;
+               afsStatus.FileType = 0x2;
+               afsStatus.LinkCount = scp->linkCount;
+               afsStatus.Length = cm_fakeDirSize;
+               afsStatus.DataVersion = cm_fakeDirVersion;
+               afsStatus.Author = 0x1;
+               afsStatus.Owner = 0x0;
+               afsStatus.CallerAccess = 0x9;
+               afsStatus.AnonymousAccess = 0x9;
+               afsStatus.UnixModeBits = 0x1ff;
+               afsStatus.ParentVnode = 0x1;
+               afsStatus.ParentUnique = 0x1;
+               afsStatus.SegSize = 0;
+               afsStatus.ClientModTime = 0x3b49f6e2;
+               afsStatus.ServerModTime = 0x3b49f6e2;
+               afsStatus.Group = 0;
+               afsStatus.SyncCounter = 0;
+               afsStatus.dataVersionHigh = 0;
+       
+               // once we're done setting up the status info,
+               // we just fill the buffer pages with fakedata
+               // from cm_FakeRootDir. Extra pages are set to
+               // 0. 
+               
+               lock_ObtainMutex(&cm_Freelance_Lock);
+#ifdef DEBUG
+               afsi_log("bufp->offset is %d", bufp->offset);
+#endif
+               t1 = bufp->offset.LowPart;
+               qdp = biod.bufListEndp;
+               while (qdp) {
+                       tbufp = osi_GetQData(qdp);
+                       bufferp=tbufp->datap;
+                       memset(bufferp, 0, buf_bufferSize);
+                       t2 = cm_fakeDirSize - t1;
+                       if (t2>buf_bufferSize) t2=buf_bufferSize;
+#ifdef DEBUG
+                       afsi_log("t1:%d, t2:%d", t1, t2);
+#endif
+                       if (t2 > 0) {
+                               memcpy(bufferp, cm_FakeRootDir+t1, t2);
+                       } else {
+                               t2 = 0;
+                       }
+                       t1+=t2;
+                       qdp = (osi_queueData_t *) osi_QPrev(&qdp->q);
+                       
+               }
+               lock_ReleaseMutex(&cm_Freelance_Lock);
+       
+               // once we're done, we skip over the part of the
+               // code that does the ACTUAL fetching of data for
+               // real files
+
+               goto fetchingcompleted;
+       }
+
+#endif /* AFS_FREELANCE_CLIENT */
+
        /* now make the call */
         do {
                code = cm_Conn(&scp->fid, up, reqp, &connp);
@@ -1230,6 +1312,8 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *up,
                 osi_Log0(afsd_logp, "CALL FetchData DONE");
                 
        } while (cm_Analyze(connp, up, reqp, &scp->fid, &volSync, NULL, code));
+
+  fetchingcompleted:
         code = cm_MapRPCError(code, reqp);
 
         lock_ObtainMutex(&scp->mx);
index 58d8873b78685df8f0d06d0aa3f35aa2f683d7b9..eb5a6715ced8ab867d0fc7205412a07cd629146c 100644 (file)
@@ -44,6 +44,9 @@
 #define MAX_PATH 260
 
 osi_mutex_t cm_Afsdsbmt_Lock;
+#ifdef AFS_FREELANCE_CLIENT
+extern osi_mutex_t cm_Freelance_Lock;
+#endif
 
 extern afs_int32 cryptall;
 
@@ -1130,6 +1133,7 @@ long cm_IoctlCreateMountPoint(struct smb_ioctl *ioctlp, struct cm_user *userp)
         char fullCell[256];
        char volume[256];
        char cell[256];
+       int ttl;
 
        cm_InitReq(&req);
         
@@ -1155,7 +1159,11 @@ long cm_IoctlCreateMountPoint(struct smb_ioctl *ioctlp, struct cm_user *userp)
        
                /* Get the full name for this cell */
                code = cm_SearchCellFile(cell, fullCell, 0, 0);
-               if (code)
+#ifdef AFS_AFSDB_ENV
+               if (code && cm_dnsEnabled)
+                  code = cm_SearchCellByDNS(cell, fullCell, &ttl, 0, 0);
+#endif
+                 if (code)
                        return CM_ERROR_NOSUCHCELL;
        
                sprintf(mpInfo, "%c%s:%s", *ioctlp->inDatap, fullCell, volume);
@@ -1164,6 +1172,14 @@ long cm_IoctlCreateMountPoint(struct smb_ioctl *ioctlp, struct cm_user *userp)
                strcpy(mpInfo, ioctlp->inDatap);
         }
 
+#ifdef AFS_FREELANCE_CLIENT
+       if (cm_freelanceEnabled && dscp == cm_rootSCachep) {
+         /* we are adding the mount point to the root dir., so call
+            the freelance code to do the add. */
+         code = cm_FreelanceAddMount(leaf, fullCell, volume);
+         return code;
+       }
+#endif
        /* create the symlink with mode 644.  The lack of X bits tells
          * us that it is a mount point.
          */
@@ -1854,9 +1870,9 @@ long cm_IoctlSetRxkcrypt(smb_ioctl_t *ioctlp, cm_user_t *userp)
 extern int afsd_shutdown(int);
 extern int afs_shutdown;
 
-long cm_IoctlShutdown(smb_ioctl_t *ioctlp, cm_user_t *userp)
-{
+long cm_IoctlShutdown(smb_ioctl_t *ioctlp, cm_user_t *userp) {
   afs_shutdown = 1;   /* flag to shut down */
   return 0;
 }
 #endif /* DJGPP */
+
index ee5b338ac54e29a89e883a00d01bc86b19b325c3..04ba13bfa7633aaf6587d041f17227f5ea0dadf3 100644 (file)
@@ -125,6 +125,9 @@ extern long cm_IoctlSetRxkcrypt(smb_ioctl_t *ioctlp, cm_user_t *userp);
 
 extern long cm_IoctlShutdown(smb_ioctl_t *ioctlp, cm_user_t *userp);
 
+extern long cm_IoctlFreemountAddCell(smb_ioctl_t *ioctlp, cm_user_t *userp);
+
+extern long cm_IoctlFreemountRemoveCell(smb_ioctl_t *ioctlp, cm_user_t *userp);
 
 #endif /* __CM_IOCTL_INTERFACES_ONLY__ */
 
index 759a31f342a0a84beafcf2894ec0b7eb5b462da2..d3add600903837ee4ac09c6a08026df7084ccf17 100644 (file)
@@ -43,6 +43,10 @@ osi_rwlock_t cm_scacheLock;
 /* Dummy scache entry for use with pioctl fids */
 cm_scache_t cm_fakeSCache;
 
+#ifdef AFS_FREELANCE_CLIENT
+extern osi_mutex_t cm_Freelance_Lock;
+#endif
+
 /* must be called with cm_scacheLock write-locked! */
 void cm_AdjustLRU(cm_scache_t *scp)
 {
@@ -236,11 +240,16 @@ long cm_GetSCache(cm_fid_t *fidp, cm_scache_t **outScpp, cm_user_t *userp,
         long code;
         cm_volume_t *volp;
         cm_cell_t *cellp;
+       char* mp;
+       int special; // yj: boolean variable to test if file is on root.afs
+       int isRoot;
         
         hash = CM_SCACHE_HASH(fidp);
         
        osi_assert(fidp->cell != 0);
 
+       // yj: check if we have the scp, if so, we don't need
+       // to do anything else
         lock_ObtainWrite(&cm_scacheLock);
        for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) {
                if (cm_FidCmp(fidp, &scp->fid) == 0) {
@@ -252,18 +261,85 @@ long cm_GetSCache(cm_fid_t *fidp, cm_scache_t **outScpp, cm_user_t *userp,
                 }
         }
         
-        /* otherwise, we need to find the volume */
-        lock_ReleaseWrite(&cm_scacheLock);     /* for perf. reasons */
-        cellp = cm_FindCellByID(fidp->cell);
-        if (!cellp) return CM_ERROR_NOSUCHCELL;
+       // yj: when we get here, it means we don't have an scp
+       // so we need to either load it or fake it, depending
+       // on whether the file is "special", see below.
+
+       // yj: if we're trying to get an scp for a file that's
+       // on root.afs of homecell, we want to handle it specially
+       // because we have to fill in the status stuff 'coz we
+       // don't want trybulkstat to fill it in for us
+#ifdef AFS_FREELANCE_CLIENT
+       special = (fidp->cell==0x1 && fidp->volume==0x20000001 && 
+                          !(fidp->vnode==0x1 && fidp->unique==0x1));
+       isRoot = (fidp->cell==0x1 && fidp->volume==0x20000001 && 
+                          fidp->vnode==0x1 && fidp->unique==0x1);
+       if (cm_freelanceEnabled && isRoot) {
+          /* freelance: if we are trying to get the root scp for the first
+             time, we will just put in a place holder entry. */
+         volp = NULL;
+       }
+         
+       if (cm_freelanceEnabled && special) {
+         /*afsi_log("cm_getscache: special"); */
+               lock_ObtainMutex(&cm_Freelance_Lock);
+               mp =(cm_localMountPoints+fidp->vnode-2)->mountPointStringp;
+               lock_ReleaseMutex(&cm_Freelance_Lock);
+               
+               scp = cm_GetNewSCache();
+               
+               scp->fid = *fidp;
+               scp->volp = cm_rootSCachep->volp;
+               if (scp->dotdotFidp == (cm_fid_t *) NULL)
+                       scp->dotdotFidp = (cm_fid_t *) malloc (sizeof(cm_fid_t));
+               scp->dotdotFidp->cell=0x1;
+               scp->dotdotFidp->volume=0x20000001;
+               scp->dotdotFidp->unique=1;
+               scp->dotdotFidp->vnode=1;
+               scp->flags |= (CM_SCACHEFLAG_PURERO | CM_SCACHEFLAG_RO);
+               scp->nextp=cm_hashTablep[hash];
+               cm_hashTablep[hash]=scp;
+               scp->flags |= CM_SCACHEFLAG_INHASH;
+               scp->refCount = 1;
+               scp->fileType = CM_SCACHETYPE_MOUNTPOINT;
+
+               lock_ObtainMutex(&cm_Freelance_Lock);
+               scp->length.LowPart = strlen(mp)+4;
+               scp->mountPointStringp=malloc(strlen(mp));
+               strcpy(scp->mountPointStringp,mp);
+               lock_ReleaseMutex(&cm_Freelance_Lock);
+
+               scp->owner=0x0;
+               scp->unixModeBits=0x1ff;
+               scp->clientModTime=0x3b49f6e2;
+               scp->serverModTime=0x3b49f6e2;
+               scp->parentUnique = 0x1;
+               scp->parentVnode=0x1;
+               scp->group=0;
+               scp->dataVersion=0x8;
+               *outScpp = scp;
+               lock_ReleaseWrite(&cm_scacheLock);
+               /*afsi_log("   getscache done");*/
+               return 0;
 
-        code = cm_GetVolumeByID(cellp, fidp->volume, userp, reqp, &volp);
-        if (code) return code;
+       }
+       // end of yj code
+#endif /* AFS_FREELANCE_CLIENT */
+
+        /* otherwise, we need to find the volume */
+       if (!cm_freelanceEnabled || !isRoot) {
+         lock_ReleaseWrite(&cm_scacheLock);    /* for perf. reasons */
+         cellp = cm_FindCellByID(fidp->cell);
+         if (!cellp) return CM_ERROR_NOSUCHCELL;
+
+         code = cm_GetVolumeByID(cellp, fidp->volume, userp, reqp, &volp);
+         if (code) return code;
+          lock_ObtainWrite(&cm_scacheLock);
+       }
         
         /* otherwise, we have the volume, now reverify that the scp doesn't
          * exist, and proceed.
          */
-        lock_ObtainWrite(&cm_scacheLock);
        for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) {
                if (cm_FidCmp(fidp, &scp->fid) == 0) {
                        scp->refCount++;
@@ -281,20 +357,22 @@ long cm_GetSCache(cm_fid_t *fidp, cm_scache_t **outScpp, cm_user_t *userp,
        scp->fid = *fidp;
        scp->volp = volp;       /* a held reference */
 
-       /* if this scache entry represents a volume root then we need 
-        * to copy the dotdotFipd from the volume structure where the 
-        * "master" copy is stored (defect 11489)
-        */
-       if(scp->fid.vnode == 1 && scp->fid.unique == 1 && volp->dotdotFidp) {
-               if (scp->dotdotFidp == (cm_fid_t *) NULL)
-                       scp->dotdotFidp = (cm_fid_t *) malloc(sizeof(cm_fid_t));
-               *(scp->dotdotFidp) = *volp->dotdotFidp;
+       if (!cm_freelanceEnabled || !isRoot) {
+         /* if this scache entry represents a volume root then we need 
+          * to copy the dotdotFipd from the volume structure where the 
+          * "master" copy is stored (defect 11489)
+          */
+         if(scp->fid.vnode == 1 && scp->fid.unique == 1 && volp->dotdotFidp) {
+           if (scp->dotdotFidp == (cm_fid_t *) NULL)
+             scp->dotdotFidp = (cm_fid_t *) malloc(sizeof(cm_fid_t));
+           *(scp->dotdotFidp) = *volp->dotdotFidp;
+         }
+         
+         if (volp->roID == fidp->volume)
+           scp->flags |= (CM_SCACHEFLAG_PURERO | CM_SCACHEFLAG_RO);
+         else if (volp->bkID == fidp->volume)
+           scp->flags |= CM_SCACHEFLAG_RO;
        }
-
-       if (volp->roID == fidp->volume)
-               scp->flags |= (CM_SCACHEFLAG_PURERO | CM_SCACHEFLAG_RO);
-       else if (volp->bkID == fidp->volume)
-                       scp->flags |= CM_SCACHEFLAG_RO;
        scp->nextp = cm_hashTablep[hash];
        cm_hashTablep[hash] = scp;
         scp->flags |= CM_SCACHEFLAG_INHASH;
@@ -504,7 +582,16 @@ long cm_SyncOp(cm_scache_t *scp, cm_buf_t *bufp, cm_user_t *up, cm_req_t *reqp,
                                goto sleep;
                 }
 
-                if (flags & CM_SCACHESYNC_NEEDCALLBACK) {
+               // yj: modified this so that callback only checked if we're
+               // not checking something on /afs
+               if (  (flags & CM_SCACHESYNC_NEEDCALLBACK)
+#ifdef AFS_FREELANCE_CLIENT
+                       && (!cm_freelanceEnabled || !(!(scp->fid.vnode==0x1 &&
+                                                        scp->fid.unique==0x1) &&
+                                                        scp->fid.cell==0x1 &&
+                                                        scp->fid.volume==0x20000001))
+#endif /* AFS_FREELANCE_CLIENT */
+                   ) {
                        if (!cm_HaveCallback(scp)) {
                                osi_Log1(afsd_logp, "CM SyncOp getting callback on scp %x",
                                        (long) scp);
@@ -703,6 +790,31 @@ void cm_SyncOpDone(cm_scache_t *scp, cm_buf_t *bufp, long flags)
 void cm_MergeStatus(cm_scache_t *scp, AFSFetchStatus *statusp, AFSVolSync *volp,
        cm_user_t *userp, int flags)
 {
+       // yj: i want to create some fake status for the /afs directory and the
+       // entries under that directory
+#ifdef AFS_FREELANCE_CLIENT
+       if (cm_freelanceEnabled && scp == cm_rootSCachep) {
+               statusp->InterfaceVersion = 0x1;
+               statusp->FileType = 0x2;
+               statusp->LinkCount = scp->linkCount;
+               statusp->Length = cm_fakeDirSize;
+               statusp->DataVersion = cm_fakeDirVersion;
+               statusp->Author = 0x1;
+               statusp->Owner = 0x0;
+               statusp->CallerAccess = 0x9;
+               statusp->AnonymousAccess = 0x9;
+               statusp->UnixModeBits = 0x1ff;
+               statusp->ParentVnode = 0x1;
+               statusp->ParentUnique = 0x1;
+               statusp->SegSize = 0;
+               statusp->ClientModTime = 0x3b49f6e2;
+               statusp->ServerModTime = 0x3b49f6e2;
+               statusp->Group = 0;
+               statusp->SyncCounter = 0;
+               statusp->dataVersionHigh = 0;
+       }
+#endif /* AFS_FREELANCE_CLIENT */
+
        if (!(flags & CM_MERGEFLAG_FORCE)
                        && statusp->DataVersion < (unsigned long) scp->dataVersion) {
                struct cm_cell *cellp;
index b3149484c9bad0c4d85f6c79e53417559a64289e..1d0eb87e231c6442c5d9860c31b186f9ceeae9df 100644 (file)
@@ -1059,6 +1059,14 @@ long cm_Unlink(cm_scache_t *dscp, char *namep, cm_user_t *userp, cm_req_t *reqp)
         AFSFetchStatus newDirStatus;
         AFSVolSync volSync;
 
+#ifdef AFS_FREELANCE_CLIENT
+       if (cm_freelanceEnabled && dscp == cm_rootSCachep) {
+         /* deleting a mount point from the root dir. */
+         code = cm_FreelanceRemoveMount(namep);
+         return code;
+       }
+#endif
+
        /* make sure we don't screw up the dir status during the merge */
         lock_ObtainMutex(&dscp->mx);
        sflags = CM_SCACHESYNC_STOREDATA;
@@ -1499,6 +1507,21 @@ long cm_TryBulkProc(cm_scache_t *scp, cm_dirEntry_t *dep, void *rockp,
                 cm_ReleaseSCache(tscp);
         }      /* found entry */
 
+#ifdef AFS_FREELANCE_CLIENT
+       // yj: if this is a mountpoint under root.afs then we don't want it
+       // to be bulkstat-ed, instead, we call getSCache directly and under
+       // getSCache, it is handled specially.
+       if      (cm_freelanceEnabled &&
+           tfid.cell==0x1 && tfid.volume==0x20000001 &&
+                          !(tfid.vnode==0x1 && tfid.unique==0x1) )
+       {
+#ifdef DEBUG
+               afsi_log("   cm_trybulkproc going to call getscache");
+#endif
+               return cm_GetSCache(&tfid, &tscp, NULL, NULL);
+       }
+#endif /* AFS_FREELANCE_CLIENT */
+
        i = bsp->counter++;
         bsp->fids[i].Volume = scp->fid.volume;
         bsp->fids[i].Vnode = tfid.vnode;
index b0b7bc91c6412de811e4eca573e82d4773f712c8..08c2d1e65a09f5bfb63639a304af2a4f7f018dfb 100644 (file)
@@ -17,3 +17,7 @@ EXPORTS
        cm_AppendNewCell                @10
        cm_AppendNewCellLine            @11
        cm_CloseCellFile                @12
+     cm_SearchCellByDNS       @13
+     getAFSServer             @14
+     cm_InitDNS               @15
+     cm_GetConfigDir          @16
index aaf0c8f96bf5e01e1c5648ad1d2a255530acb5e3..efeb5ebee012025c3917497803ec1d8c4ca192f1 100644 (file)
@@ -82,8 +82,10 @@ extern void osi_SleepSpin(long value, Crit_Sec *counterp);
 /* spin lock version of wakeup, used internally only */
 extern void osi_WakeupSpin(long value);
 
+#ifndef DJGPP
 /* exported function to sleep on a value */
 extern void osi_Sleep (long);
+#endif
 
 extern void osi_FreeSleepInfo(osi_sleepInfo_t *);
 
index 91b7704f620dc72f93952cbbb191061700d2455a..5b17db9da6ab0798ae9f891221dc2d16009bc509 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.9 2001/09/11 14:25:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vfsops.c,v 1.1.1.10 2001/10/14 17:59:08 hartmans Exp $");
 
 #include "../afs/sysincludes.h"
 #include "../afs/afsincludes.h"
@@ -335,8 +335,8 @@ 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_shuttingdown=1;
     afs_was_mounted=0;
 }
 
@@ -347,7 +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,
+    umount_begin:      NULL /* afs_umount_begin */
 };
 #else
 struct super_operations afs_sops = {
@@ -361,7 +361,7 @@ struct super_operations afs_sops = {
     afs_statfs,
     NULL,              /* afs_remount_fs - see doc above */
     NULL,              /* afs_clear_inode */
-    afs_umount_begin,
+    NULL                /* afs_umount_begin */
 };
 #endif
 
index 0102051ed38cb07cddddb540c218b5cb5ce8f687..c3aa5d55f0323a04d4f1fd42a33d6524fc31ac31 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vm.c,v 1.1.1.5 2001/07/14 22:19:48 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vm.c,v 1.1.1.6 2001/10/14 17:59:08 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -43,7 +43,7 @@ int osi_VM_FlushVCache(struct vcache *avc, int *slept)
 {
     struct inode *ip = (struct inode*)avc;
 
-    if (avc->vrefCount != 0)
+    if (VREFCOUNT(avc) != 0)
        return EBUSY;
 
     if (avc->opens != 0)
index 5f43233456a7c9be4a07f2b303effbbdc90a3f89..7d7a3bd5b2016a9ed932edbe97a6643ecebd3b8d 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.6 2001/09/11 14:25:08 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_file.c,v 1.1.1.7 2001/10/14 17:59:09 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -339,8 +339,13 @@ afs_osi_Write(afile, offset, aptr, asize)
         osi_Panic("afs_osi_Write called with null param");
     if (offset != -1) afile->offset = offset;
     AFS_GUNLOCK();
+#ifdef AFS_SUN59_ENV
+    code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, afile->offset,
+                 AFS_UIOSYS, 0, curproc->p_fsz_ctl.rlim_cur, &afs_osi_cred, &resid);
+#else
     code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, afile->offset,
                  AFS_UIOSYS, 0,  (u.u_rlimit[RLIMIT_FSIZE].rlim_cur), &afs_osi_cred, &resid);
+#endif
     AFS_GLOCK();
     if (code == 0) {
        code = asize - resid;
index 32d892d28abe512efab049ae009ad8ab62d67b6a..c370c8f1ce32e2583703bf6c88efbf4839fcc439 100644 (file)
@@ -13,7 +13,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_vfsops.c,v 1.1.1.8 2001/07/14 22:19:51 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_vfsops.c,v 1.1.1.9 2001/10/14 17:59:10 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -308,7 +308,7 @@ afsinit(struct vfssw *vfsswp, int fstype)
     if ( !nfs_checkauth ) afs_warn("nfs_checkauth not initialised");
 #endif
     ufs_iallocp = (int (*)()) modlookup("ufs", "ufs_ialloc");    
-    ufs_iupdatp = (int (*)()) modlookup("ufs", "ufs_iupdat");
+    ufs_iupdatp = (void (*)()) modlookup("ufs", "ufs_iupdat");
     ufs_igetp = (int (*)()) modlookup("ufs", "ufs_iget");    
     ufs_itimes_nolockp = (void (*)()) modlookup("ufs", "ufs_itimes_nolock");
     udp_infop = (struct streamtab *) modlookup("udp", "udpinfo");    
index 485a4e0c2a7edd616f346abf5c64d7e4e521cc4f..74a2e151633cd80a2efb9b98146665a74355d0fc 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.7 2001/09/11 14:25:09 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.1.1.8 2001/10/14 17:59:10 hartmans Exp $");
 
 #if    defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
 /*
@@ -1419,7 +1419,11 @@ afs_seek(vnp, ooff, noffp)
     return code;
 }
 
-int afs_frlock(vnp, cmd, ap, flag, off, credp)
+int afs_frlock(vnp, cmd, ap, flag, off,
+#ifdef AFS_SUN59_ENV
+              flkcb,
+#endif
+              credp)
     struct vnode *vnp;
     int cmd;
 #if    defined(AFS_SUN56_ENV)
@@ -1429,6 +1433,9 @@ int afs_frlock(vnp, cmd, ap, flag, off, credp)
 #endif
     int flag;
     offset_t off;
+#ifdef AFS_SUN59_ENV
+    struct flk_callback *flkcb;
+#endif
     struct AFS_UCRED *credp;
 {
     register afs_int32 code = 0;
@@ -1436,6 +1443,10 @@ int afs_frlock(vnp, cmd, ap, flag, off, credp)
      * Implement based on afs_lockctl
      */
     AFS_GLOCK();
+#ifdef AFS_SUN59_ENV
+    if (flkcb)
+       afs_warn("Don't know how to deal with flk_callback's!\n");
+#endif
     if ((cmd == F_GETLK) || (cmd == F_O_GETLK) || (cmd == F_SETLK) || (cmd ==  F_SETLKW)) {
 #ifdef AFS_SUN53_ENV
        ap->l_pid = ttoproc(curthread)->p_pid;
@@ -1533,9 +1544,16 @@ struct cred *credp;
     return EINVAL;
 }
 
-int  afs_dumpctl(vp, i)
+int  afs_dumpctl(vp, i
+#ifdef AFS_SUN59_ENV
+                , blkp
+#endif
+                )
 struct vnode *vp;
 int i;
+#ifdef AFS_SUN59_ENV
+int *blkp;
+#endif
 {
     afs_warn("afs_dumpctl: Not implemented\n");
     return EINVAL;
index a49675932cf8cac79ceb2c5a45bbf70a7f114e5f..377036e26585604590c1ed56352fd2839770a27a 100644 (file)
@@ -15,7 +15,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.1.1.7 2001/07/14 22:19:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.1.1.8 2001/10/14 17:59:12 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -831,7 +831,7 @@ static int GetFlockCount(struct vcache *avc, struct vrequest *areq)
     if (code) {
        return(0);              /* failed, say it is 'unlocked' */
     } else {
-       return((int)OutStatus.spare2);
+       return((int)OutStatus.lockCount);
     }
 }
 #endif
index c9bc614c552bd48d07296b6fe87f0343ac9643bb..9026135987e149e54d56b7b6c35496c599e70dc1 100644 (file)
@@ -22,7 +22,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.1.1.4 2001/07/14 22:19:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.1.1.5 2001/10/14 17:59:13 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -317,12 +317,12 @@ tagain:
     osi_dnlc_remove ( adp, aname, tvc);
     if (tvc) afs_symhint_inval(tvc);
 
-    Tadp1 = adp; Tadpr = adp->vrefCount; Ttvc = tvc; Tnam = aname; Tnam1 = 0;
-    if (tvc) Ttvcr = tvc->vrefCount;
+    Tadp1 = adp; Tadpr = VREFCOUNT(adp); Ttvc = tvc; Tnam = aname; Tnam1 = 0;
+    if (tvc) Ttvcr = VREFCOUNT(tvc);
 #ifdef AFS_AIX_ENV
-    if (tvc && (tvc->vrefCount > 2) && tvc->opens > 0 && !(tvc->states & CUnlinked)) {
+    if (tvc && (VREFCOUNT(tvc) > 2) && tvc->opens > 0 && !(tvc->states & CUnlinked)) {
 #else
-    if (tvc && (tvc->vrefCount > 1) && tvc->opens > 0 && !(tvc->states & CUnlinked)) {
+    if (tvc && (VREFCOUNT(tvc) > 1) && tvc->opens > 0 && !(tvc->states & CUnlinked)) {
 #endif
        char *unlname = newname();
 
index 9b609f76a3142354f422de7e76d27af1d4b0685a..b0f60a85eca6168224d79b656aad79a130bf655b 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.6 2001/09/11 14:25:13 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_strategy.c,v 1.1.1.7 2001/10/14 17:59:13 hartmans Exp $");
 
 #if !defined(AFS_HPUX_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV)
 
@@ -132,8 +132,12 @@ afs_ustrategy(abp)
        tuio.afsio_offset = (u_int) dbtob(abp->b_blkno);
 #ifdef AFS_SUN5_ENV
        tuio._uio_offset._p._u = 0;
+#ifdef AFS_SUN59_ENV
+       tuio.uio_limit = curproc->p_fsz_ctl.rlim_cur;
+#else
        tuio.uio_limit = u.u_rlimit[RLIMIT_FSIZE].rlim_cur;
 #endif
+#endif
 #else
        tuio.afsio_offset = DEV_BSIZE * abp->b_blkno;
 #endif
index 204243d52a95e3852e5e41ec240401c9abc7b274..37fa7e7b97d2526f804df8350c06ca5fe13d92b2 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.8 2001/09/20 06:07:36 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.1.1.9 2001/10/14 17:59:14 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -909,7 +909,7 @@ afs_close(OSI_VC_ARG(avc), aflags, acred)
        ReleaseWriteLock(&avc->lock);
     }
 #ifdef AFS_OSF_ENV
-    if ((avc->vrefCount <= 2) && (avc->states & CUnlinked)) {
+    if ((VREFCOUNT(avc) <= 2) && (avc->states & CUnlinked)) {
        afs_remunlink(avc, 1);  /* ignore any return code */
     }
 #endif
index 3c3af3e5bf48ac189fb1b1a6b8d85a5d617417b3..01a40e76546e1fd32a90c3ae35245e1ff27f637e 100644 (file)
@@ -13,7 +13,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_analyze.c,v 1.1.1.7 2001/09/20 06:07:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_analyze.c,v 1.1.1.8 2001/10/14 17:58:52 hartmans Exp $");
 
 #include "../afs/stds.h"
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
index 5f668b5564c71859d541e0faeeb58f73ee597901..a09225c42527bb0b1642759b30913e420ffd72d7 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.5 2001/09/11 14:24:36 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_buffer.c,v 1.1.1.6 2001/10/14 17:58:52 hartmans Exp $");
 
 #include "../afs/sysincludes.h"
 #if !defined(UKERNEL)
@@ -232,17 +232,18 @@ char *DRead(fid,page)
       MReleaseWriteLock(&afs_bufferLock);
       return 0;
     }
+    MObtainWriteLock(&tb->lock,260);
+    MReleaseWriteLock(&afs_bufferLock);
+    tb->lockers++;
     tfile = afs_CFileOpen(fid[0]);
     sizep = (afs_int32 *)tfile;
     if (page * AFS_BUFFER_PAGESIZE >= *sizep) {
        dirp_Zap(tb->fid);
+       tb->lockers--;
+       MReleaseWriteLock(&tb->lock);
        afs_CFileClose(tfile);
-       MReleaseWriteLock(&afs_bufferLock);
        return 0;
     }
-    MObtainWriteLock(&tb->lock,260);
-    MReleaseWriteLock(&afs_bufferLock);
-    tb->lockers++;
     code = afs_CFileRead(tfile, tb->page * AFS_BUFFER_PAGESIZE,
                         tb->data, AFS_BUFFER_PAGESIZE);
     afs_CFileClose(tfile);
index 100949b67420cd104f59c7b2eebcd014a1a68ff4..74e4a9f56e89153c48d525b7b6c3506113d9850e 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.6 2001/09/20 06:07:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_callback.c,v 1.1.1.7 2001/10/14 17:58:53 hartmans Exp $");
 
 #include "../afs/sysincludes.h" /*Standard vendor system headers*/
 #include "../afs/afsincludes.h" /*AFS-based standard headers*/
@@ -157,7 +157,7 @@ int SRXAFSCB_GetCE(a_call, a_index, a_result)
     a_result->DataVersion = hgetlo(tvc->m.DataVersion);
     a_result->callback = afs_data_pointer_to_int32(tvc->callback);             /* XXXX Now a pointer; change it XXXX */
     a_result->cbExpires = tvc->cbExpires;
-    a_result->refCount = tvc->vrefCount;
+    a_result->refCount = VREFCOUNT(tvc);
     a_result->opens = tvc->opens;
     a_result->writers = tvc->execsOrWriters;
     a_result->mvstat = tvc->mvstat;
index 75cb5cf8deea77fcdcc91509f7ae80a0341d0c8c..f2cce3069486bdbb0581bc5d3b87fbc25acb3271 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.7 2001/09/11 14:24:38 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cell.c,v 1.1.1.8 2001/10/14 17:58:54 hartmans Exp $");
 
 #include "../afs/stds.h"
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
@@ -52,21 +52,33 @@ afs_uint32 afs_nextCellNum = 0x100;
 /* Local variables. */
 struct cell *afs_rootcell = 0;
 
+/* Handler waiting for request from client */
 static char afs_AfsdbHandlerWait;
+/* Client waiting for handler to become available or finish request */
 static char afs_AfsdbLookupWait;
 
+/* Set to 1 when we've seen the userspace AFSDB process at least once */
 char afs_AfsdbHandlerPresent = 0;
+/* Set to 1 when there is a client interacting with the AFSDB handler.
+ * Protects the in and out variables below.  Protected by GLOCK. */
 char afs_AfsdbHandlerInuse = 0;
+/* Set to 1 when AFSDB has been shut down */
+char afs_AfsdbHandlerShutdown = 0;
 
+/* Input to handler from the client: cell name to look up */
 char *afs_AfsdbHandler_CellName;
+/* Outputs from handler to client: cell hosts, TTL, and real cell name */
 afs_int32 *afs_AfsdbHandler_CellHosts;
 int *afs_AfsdbHandler_Timeout;
+char **afs_AfsdbHandler_RealName;
 
-char afs_AfsdbHandler_ReqPending;
-char afs_AfsdbHandler_Completed;
+/* Client sets ReqPending to 1 whenever it queues a request for it */
+char afs_AfsdbHandler_ReqPending = 0;
+/* Handler sets Completed to 1 when it completes the client request */
+char afs_AfsdbHandler_Completed = 0;
 
 
-struct cell *afs_GetCellByName_int();
+static struct cell *afs_GetCellByName_int();
 
 int afs_strcasecmp(s1, s2)
     register char *s1, *s2;
@@ -87,6 +99,16 @@ int afs_strcasecmp(s1, s2)
 
 
 #ifdef AFS_AFSDB_ENV
+void afs_StopAfsdb()
+{
+    if (afs_AfsdbHandlerPresent) {
+       afs_osi_Wakeup(&afs_AfsdbHandlerWait);
+    } else {
+       afs_AfsdbHandlerShutdown = 1;
+       afs_termState = AFSOP_STOP_RXEVENT;
+    }
+}
+
 int afs_AfsdbHandler(acellName, acellNameLen, kernelMsg)
     char *acellName;
     int acellNameLen;
@@ -94,6 +116,7 @@ int afs_AfsdbHandler(acellName, acellNameLen, kernelMsg)
 {
     /* afs_syscall_call() has already grabbed the global lock */
 
+    if (afs_AfsdbHandlerShutdown) return -2;
     afs_AfsdbHandlerPresent = 1;
 
     if (afs_AfsdbHandler_ReqPending) {
@@ -103,6 +126,9 @@ int afs_AfsdbHandler(acellName, acellNameLen, kernelMsg)
        *afs_AfsdbHandler_Timeout = kernelMsg[1];
        if (*afs_AfsdbHandler_Timeout) *afs_AfsdbHandler_Timeout += osi_Time();
 
+       *afs_AfsdbHandler_RealName = afs_osi_Alloc(strlen(acellName) + 1);
+       strcpy(*afs_AfsdbHandler_RealName, acellName);
+
        for (i=0; i<MAXCELLHOSTS; i++) {
            if (i >= hostCount)
                afs_AfsdbHandler_CellHosts[i] = 0;
@@ -117,9 +143,21 @@ int afs_AfsdbHandler(acellName, acellNameLen, kernelMsg)
     }
 
     /* Wait for a request */
-    while (afs_AfsdbHandler_ReqPending == 0)
+    while (afs_AfsdbHandler_ReqPending == 0 && afs_termState != AFSOP_STOP_AFSDB)
        afs_osi_Sleep(&afs_AfsdbHandlerWait);
 
+    /* Check if we're shutting down */
+    if (afs_termState == AFSOP_STOP_AFSDB) {
+       /* Inform anyone waiting for us that we're going away */
+       afs_AfsdbHandlerShutdown = 1;
+       afs_AfsdbHandlerPresent = 0;
+       afs_osi_Wakeup(&afs_AfsdbLookupWait);
+
+       afs_termState = AFSOP_STOP_RXEVENT;
+       afs_osi_Wakeup(&afs_termState);
+       return -2;
+    }
+
     /* Copy the requested cell name into the request buffer */
     strncpy(acellName, afs_AfsdbHandler_CellName, acellNameLen);
 
@@ -129,16 +167,20 @@ int afs_AfsdbHandler(acellName, acellNameLen, kernelMsg)
 #endif
 
 
-int afs_GetCellHostsFromDns(acellName, acellHosts, timeout)
+int afs_GetCellHostsFromDns(acellName, acellHosts, timeout, realName)
     char *acellName;
     afs_int32 *acellHosts;
     int *timeout;
+    char **realName;
 {
 #ifdef AFS_AFSDB_ENV
     char grab_glock = 0;
 
     if (!afs_AfsdbHandlerPresent) return ENOENT;
 
+    /* Initialize host list to empty in case the handler is gone */
+    *acellHosts = 0;
+
     if (!ISAFS_GLOCK()) {
        grab_glock = 1;
        AFS_GLOCK();
@@ -153,6 +195,7 @@ int afs_GetCellHostsFromDns(acellName, acellHosts, timeout)
     afs_AfsdbHandler_CellName = acellName;
     afs_AfsdbHandler_CellHosts = acellHosts;
     afs_AfsdbHandler_Timeout = timeout;
+    afs_AfsdbHandler_RealName = realName;
 
     /* Wake up the AFSDB handler */
     afs_AfsdbHandler_Completed = 0;
@@ -160,7 +203,7 @@ int afs_GetCellHostsFromDns(acellName, acellHosts, timeout)
     afs_osi_Wakeup(&afs_AfsdbHandlerWait);
 
     /* Wait for the handler to get back to us with the reply */
-    while (!afs_AfsdbHandler_Completed)
+    while (afs_AfsdbHandlerPresent && !afs_AfsdbHandler_Completed)
        afs_osi_Sleep(&afs_AfsdbLookupWait);
 
     /* Release the AFSDB handler and wake up others waiting for it */
@@ -180,20 +223,28 @@ int afs_GetCellHostsFromDns(acellName, acellHosts, timeout)
 void afs_RefreshCell(tc)
     register struct cell *tc;
 {
-    afs_int32 acellHosts[MAXCELLHOSTS];
+    afs_int32 cellHosts[MAXCELLHOSTS];
+    char *realName = NULL;
     int timeout;
 
     /* Don't need to do anything if no timeout or it's not expired */
     if (!tc->timeout || tc->timeout > osi_Time()) return;
 
-    if (!afs_GetCellHostsFromDns(tc->cellName, acellHosts, &timeout)) {
-       afs_NewCell(tc->cellName, acellHosts, tc->states,
-                   tc->lcellp ? tc->lcellp->cellName : (char *) 0,
-                   tc->fsport, tc->vlport, timeout);
-    }
+    if (afs_GetCellHostsFromDns(tc->cellName, cellHosts, &timeout, &realName))
+       /* In case of lookup failure, keep old data */
+       goto done;
+
+    /* Refresh the DB servers for the real cell; other values stay the same. */
+    afs_NewCell(realName, cellHosts, 0, (char *) 0, 0, 0, timeout, (char *) 0);
+
+    /* If this is an alias, update the alias entry too */
+    if (afs_strcasecmp(tc->cellName, realName))
+       afs_NewCell(tc->cellName, 0, CAlias, (char *) 0, 0, 0,
+                   timeout, realName);
 
-    /* In case of a DNS failure, keep old cell data.. */
-    return;
+done:
+    if (realName)
+       afs_osi_Free(realName, strlen(realName) + 1);
 }
 
 
@@ -201,19 +252,35 @@ struct cell *afs_GetCellByName_Dns(acellName, locktype)
     register char *acellName;
     afs_int32 locktype;
 {
-    afs_int32 acellHosts[MAXCELLHOSTS];
+    afs_int32 cellHosts[MAXCELLHOSTS];
+    char *realName = NULL;
     int timeout;
 
-    if (afs_GetCellHostsFromDns(acellName, acellHosts, &timeout))
-       return (struct cell *) 0;
-    if (afs_NewCell(acellName, acellHosts, CNoSUID, (char *) 0, 0, 0, timeout))
-       return (struct cell *) 0;
+    if (afs_GetCellHostsFromDns(acellName, cellHosts, &timeout, &realName))
+       goto bad;
+    if (afs_NewCell(realName, cellHosts, CNoSUID, (char *) 0, 0, 0,
+                   timeout, (char *) 0))
+       goto bad;
 
+    /* If this is an alias, create an entry for it too */
+    if (afs_strcasecmp(acellName, realName)) {
+       if (afs_NewCell(acellName, 0, CAlias, (char *) 0, 0, 0,
+                       timeout, realName))
+           goto bad;
+    }
+
+    if (realName)
+       afs_osi_Free(realName, strlen(realName) + 1);
     return afs_GetCellByName_int(acellName, locktype, 0);
+
+bad:
+    if (realName)
+       afs_osi_Free(realName, strlen(realName) + 1);
+    return (struct cell *) 0;
 }
 
 
-struct cell *afs_GetCellByName_int(acellName, locktype, trydns)
+static struct cell *afs_GetCellByName_int(acellName, locktype, trydns)
     register char *acellName;
     afs_int32 locktype;
     char trydns;
@@ -230,6 +297,10 @@ struct cell *afs_GetCellByName_int(acellName, locktype, trydns)
            QAdd(&CellLRU, &tc->lruq);
            ReleaseWriteLock(&afs_xcell);
            afs_RefreshCell(tc);
+           if (tc->states & CAlias) {
+               tc = tc->alias;
+               afs_RefreshCell(tc);
+           }
            return tc;
        }
     }
@@ -300,20 +371,21 @@ struct cell *afs_GetCellByIndex(cellindex, locktype)
 } /*afs_GetCellByIndex*/
 
 
-afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport, timeout)
+afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport, timeout, aliasFor)
     int aflags;
     char *acellName;
     register afs_int32 *acellHosts;
     char *linkedcname;
     u_short fsport, vlport;
     int timeout;
+    char *aliasFor;
 {
     register struct cell *tc, *tcl=0;
     register afs_int32 i, newc=0, code=0;
     register struct afs_q *cq, *tq;
 
     AFS_STATCNT(afs_NewCell);
-    if (*acellHosts == 0)
+    if (!(aflags & CAlias) && *acellHosts == 0)
        /* need >= one host to gen cell # */
        return EINVAL;
 
@@ -323,6 +395,13 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport
     for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
        tc = QTOC(cq); tq = QNext(cq);
        if (afs_strcasecmp(tc->cellName, acellName) == 0) {
+           /* if the cell we've found has the correct name but no timeout,
+            * and we're called with a non-zero timeout, bail out:  never
+            * override static configuration entries with AFSDB ones. */
+           if (timeout && !tc->timeout) {
+               ReleaseWriteLock(&afs_xcell);
+               return 0;
+           }
            /* we don't want to keep pinging old vlservers which were down,
             * since they don't matter any more.  It's easier to do this than
             * to remove the server from its various hash tables. */
@@ -387,6 +466,26 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport
     tc->timeout = timeout;
  
     memset((char *)tc->cellHosts, 0, sizeof(tc->cellHosts));
+    if (aflags & CAlias) {
+       struct cell *tca = NULL;
+
+       if (!aliasFor) {
+           code = EINVAL;
+           goto bad;
+       }
+       for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
+           tca = QTOC(cq); tq = QNext(cq);
+           if (!afs_strcasecmp(tca->cellName, aliasFor))
+               break;
+       }
+       if (!tca) {
+           code = ENOENT;
+           goto bad;
+       }
+       tc->alias = tca;
+       goto done;
+    }
+
     for (i=0; i<MAXCELLHOSTS; i++) {
         struct server *ts;
        afs_uint32 temp = acellHosts[i];
@@ -398,6 +497,7 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport
        afs_PutServer(ts, WRITE_LOCK);
     }
     afs_SortServers(tc->cellHosts, MAXCELLHOSTS);      /* randomize servers */
+done:
     ReleaseWriteLock(&afs_xcell);
     return 0;
 bad:
index 79fb2635bc661d1ccf63384bce861ca20583d60b..b251a7f3345ebfe97e7e484ccfa87deab618d03c 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.6 2001/09/11 14:24:39 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_dcache.c,v 1.1.1.7 2001/10/14 17:58:55 hartmans Exp $");
 
 #include "../afs/sysincludes.h" /*Standard vendor system headers*/
 #include "../afs/afsincludes.h" /*AFS-based standard headers*/
@@ -218,6 +218,17 @@ struct CTD_stats {
     int CTD_nSleeps;
 } CTD_stats;
 
+void afs_MaybeWakeupTruncateDaemon() {
+    if (!afs_CacheTooFull && afs_CacheIsTooFull()) {
+       afs_CacheTooFull = 1;
+       if (!afs_TruncateDaemonRunning)
+           afs_osi_Wakeup((char *)afs_CacheTruncateDaemon);
+    } else if (!afs_TruncateDaemonRunning &&
+              afs_blocksDiscarded > CM_MAXDISCARDEDCHUNKS) {
+       afs_osi_Wakeup((char *)afs_CacheTruncateDaemon);
+    }
+}
+
 u_int afs_min_cache = 0;
 void afs_CacheTruncateDaemon() {
     osi_timeval_t CTD_tmpTime;
@@ -294,7 +305,11 @@ void afs_CacheTruncateDaemon() {
            afs_stats_AddTo(CTD_stats.CTD_sleepTime, CTD_tmpTime);
        }
        if (afs_termState == AFSOP_STOP_TRUNCDAEMON) {
+#ifdef AFS_AFSDB_ENV
+           afs_termState = AFSOP_STOP_AFSDB;
+#else
            afs_termState = AFSOP_STOP_RXEVENT;
+#endif
            afs_osi_Wakeup(&afs_termState);
            break;
        }
@@ -1432,18 +1447,19 @@ 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 || 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));                             \
-    } }
+void updateV2DC(int l, struct vcache *v, struct dcache *d, int 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*/
@@ -1769,7 +1785,7 @@ struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags)
 
        /* Watch for standard race condition */
        if (hsame(avc->m.DataVersion, tdc->f.versionNo)) {
-         updateV2DC(0,avc,tdc,569);          /* set hint */
+           updateV2DC(0,avc,tdc,569);          /* set hint */
            if (setLocks) ReleaseWriteLock(&avc->lock);
            afs_stats_cmperf.dcacheHits++;
            goto done;
@@ -1864,6 +1880,35 @@ struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags)
         afs_stats_cmperf.dcacheMisses++; 
        afs_Trace3(afs_iclSetp, CM_TRACE_FETCHPROC, ICL_TYPE_POINTER, avc,
                   ICL_TYPE_INT32, Position, ICL_TYPE_INT32, size);
+
+       /*
+        * Dynamic root support:  fetch data from local memory.
+        */
+       if (afs_IsDynroot(avc)) {
+           char *dynrootDir;
+           int dynrootLen;
+
+           afs_GetDynroot(&dynrootDir, &dynrootLen, &tsmall->OutStatus);
+
+           dynrootDir += Position;
+           dynrootLen -= Position;
+           if (size > dynrootLen)
+               size = dynrootLen;
+           if (size < 0) size = 0;
+           code = afs_osi_Write(file, -1, dynrootDir, size);
+           afs_PutDynroot();
+
+           if (code == size)
+               code = 0;
+           else
+               code = -1;
+
+           tdc->validPos = Position + size;
+           afs_CFileTruncate(file, size); /* prune it */
+       } else
+       /*
+        * Not a dynamic vnode:  do the real fetch.
+        */
        do {
            tc = afs_Conn(&avc->fid, areq, SHARED_LOCK);
            if (tc) {
index e596e613ee2c07ce640e939c9cd060b80989ce2b..0399a2c8c6a9bb43bbc9a5f3d8c54a08c80eec1c 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.9 2001/09/11 14:24:45 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_server.c,v 1.1.1.10 2001/10/14 17:58:58 hartmans Exp $");
 
 #include "../afs/stds.h"
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
@@ -801,10 +801,13 @@ void afs_SortServers(struct server *aservers[], int count)
     for (i=0; i<count; i++) {
        if (!aservers[i]) break;
        for (low=i,j=i+1; j<=count; j++) {
-         if (!aservers[j]) break;
-         if (aservers[j]->addr->sa_iprank < aservers[low]->addr->sa_iprank) {
-            low = j;
-         }
+          if ((!aservers[j]) || (!aservers[j]->addr)) 
+              break;
+          if ((!aservers[low]) || (!aservers[low]->addr))
+              break;
+          if (aservers[j]->addr->sa_iprank < aservers[low]->addr->sa_iprank) {
+              low = j;
+          }
        }
        if (low != i) {
          ts = aservers[i]; 
@@ -1084,6 +1087,10 @@ static afs_SetServerPrefs(sa)
 
     if (sa) sa->sa_iprank= 0;
     for (ill = (struct ill_s *)*addr /*ill_g_headp*/; ill; ill = ill->ill_next ) {
+#ifdef AFS_SUN58_ENV
+       /* Make sure this is an IPv4 ILL */
+       if (ill->ill_isv6) continue;
+#endif
        for (ipif = ill->ill_ipif; ipif; ipif = ipif->ipif_next ) {
            subnet = ipif->ipif_local_addr & ipif->ipif_net_mask;
            subnetmask = ipif->ipif_net_mask;
index 19ad194d3dc087452995875dd6d274154dfe1d33..769f19c03956bc08b895fc32efa0492c3cb3c22b 100644 (file)
@@ -15,7 +15,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_util.c,v 1.1.1.5 2001/07/14 22:19:28 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_util.c,v 1.1.1.6 2001/10/14 17:58:58 hartmans Exp $");
 
 #include "../afs/stds.h"
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
@@ -180,9 +180,9 @@ void afs_CheckLocks()
        for(i=0;i<VCSIZE;i++) {
            for(tvc = afs_vhashT[i]; tvc; tvc=tvc->hnext) {
 #ifdef AFS_OSF_ENV
-               if (tvc->vrefCount > 1)
+               if (VREFCOUNT(tvc) > 1)
 #else  /* AFS_OSF_ENV */
-               if (tvc->vrefCount)
+               if (VREFCOUNT(tvc))
 #endif
                    afs_warn("Stat cache entry at %x is held\n", tvc);
                if (CheckLock(&tvc->lock))
index b43be2bb9654158321cb8b975736a9fb1a5a5201..6e0a3da831be8f7c8e14ee559c7f7336d3e229f7 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.8 2001/09/11 14:24:48 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_vcache.c,v 1.1.1.9 2001/10/14 17:58:59 hartmans Exp $");
 
 #include "../afs/sysincludes.h" /*Standard vendor system headers*/
 #include "../afs/afsincludes.h" /*AFS-based standard headers*/
@@ -213,7 +213,7 @@ int afs_FlushVCache(struct vcache *avc, int *slept)
     /* This should put it back on the vnode free list since usecount is 1 */
     afs_vcount--;
     vSetType(avc, VREG);
-    if (avc->vrefCount > 0) {
+    if (VREFCOUNT(avc) > 0) {
         VN_UNLOCK((struct vnode *)avc);
         AFS_RELE((struct vnode *)avc);
     } else {
@@ -568,6 +568,10 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
         int vmax = 2 * afs_cacheStats;
         int vn = VCACHE_FREE;
 
+         AFS_GUNLOCK();
+        shrink_dcache_sb(afs_globalVFS);
+        AFS_GLOCK();
+
         i = 0;
         for(tq = VLRU.prev; tq != &VLRU && vn > 0; tq = uq) {
            tvc = QTOV(tq);
@@ -582,7 +586,7 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
            if (tvc == afs_globalVp)
                continue;
 
-           if ( tvc->vrefCount && tvc->opens == 0 ) {
+           if ( VREFCOUNT(tvc) && tvc->opens == 0 ) {
                struct inode *ip = (struct inode*)tvc;
                if (list_empty(&ip->i_dentry)) {
                    vn --;
@@ -656,10 +660,10 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
                 refpanic ("Exceeded pool of AFS vnodes(VLRU cycle?)");
            else if (QNext(uq) != tq)
                 refpanic ("VLRU inconsistent");
-           else if (tvc->vrefCount < 1) 
+           else if (VREFCOUNT(tvc) < 1) 
                 refpanic ("refcnt 0 on VLRU");
 
-           if ( tvc->vrefCount == 1   &&   tvc->opens == 0 
+           if ( VREFCOUNT(tvc) == 1   &&   tvc->opens == 0 
                && (tvc->states & CUnlinkedDel) == 0) {
                code = afs_FlushVCache(tvc, &fv_slept);
                if (code == 0) {
@@ -711,7 +715,7 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
 
 #ifdef AFS_DARWIN_ENV
           if (tvc->opens == 0 && ((tvc->states & CUnlinkedDel) == 0) &&
-                tvc->vrefCount == 1 && UBCINFOEXISTS(&tvc->v)) {
+                VREFCOUNT(tvc) == 1 && UBCINFOEXISTS(&tvc->v)) {
                osi_VM_TryReclaim(tvc, &fv_slept);
                if (fv_slept) {
                   uq = VLRU.prev;
@@ -720,7 +724,7 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
                }
             }
 #endif
-          if (tvc->vrefCount == 0 && tvc->opens == 0
+          if (VREFCOUNT(tvc) == 0 && tvc->opens == 0
               && (tvc->states & CUnlinkedDel) == 0) {
                code = afs_FlushVCache(tvc, &fv_slept);
                if (code == 0) {
@@ -815,7 +819,7 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
     /* Hold it for the LRU (should make count 2) */
     VN_HOLD((struct vnode *)tvc);
 #else  /* AFS_OSF_ENV */
-    tvc->vrefCount = 1;        /* us */
+    VREFCOUNT_SET(tvc, 1);     /* us */
 #endif /* AFS_OSF_ENV */
 #ifdef AFS_AIX32_ENV
     LOCK_INIT(&tvc->pvmlock, "vcache pvmlock");
@@ -1081,7 +1085,7 @@ afs_FlushActiveVcaches(doflocks)
                /*
                 * That's because if we come in via the CUnlinkedDel bit state path we'll be have 0 refcnt
                 */
-               osi_Assert(tvc->vrefCount > 0);
+               osi_Assert(VREFCOUNT(tvc) > 0);
                AFS_RWLOCK((vnode_t *)tvc, VRWLOCK_WRITE);
 #endif
                ObtainWriteLock(&tvc->lock,52);
@@ -1136,7 +1140,7 @@ afs_FlushActiveVcaches(doflocks)
                AFS_FAST_RELE(tvc);
                if (didCore) {
 #ifdef AFS_GFS_ENV
-                   tvc->vrefCount--;
+                   VREFCOUNT_DEC(tvc);
 #else
                    AFS_RELE((struct vnode *)tvc);
 #endif
@@ -1145,7 +1149,7 @@ afs_FlushActiveVcaches(doflocks)
                }
            }          
 #ifdef AFS_DARWIN_ENV
-            if (tvc->vrefCount == 1 && UBCINFOEXISTS(&tvc->v)) {
+            if (VREFCOUNT(tvc) == 1 && UBCINFOEXISTS(&tvc->v)) {
                if (tvc->opens) panic("flushactive open, hasubc, but refcnt 1");
                osi_VM_TryReclaim(tvc,0);
            }
@@ -1683,8 +1687,15 @@ loop:
     /* stat the file */
     afs_RemoveVCB(afid);
     {
-    struct AFSFetchStatus OutStatus;
-    code = afs_FetchStatus(tvc, afid, areq, &OutStatus);
+       struct AFSFetchStatus OutStatus;
+
+       if (afs_DynrootNewVnode(tvc, &OutStatus)) {
+           afs_ProcessFS(tvc, &OutStatus, areq);
+           tvc->states |= CStatd | CUnique;
+           code = 0;
+       } else {
+           code = afs_FetchStatus(tvc, afid, areq, &OutStatus);
+       }
     }
 
     if (code) {
@@ -2694,7 +2705,7 @@ void shutdown_vcache(void)
                    vms_delete(tvc->segid);
                    AFS_GLOCK();
                    tvc->segid = tvc->vmh = NULL;
-                   if (tvc->vrefCount) osi_Panic("flushVcache: vm race");
+                   if (VREFCOUNT(tvc)) osi_Panic("flushVcache: vm race");
                }
                if (tvc->credp) {
                    crfree(tvc->credp);
index 81f9caf707e34f2e1f60f2d29818805394816efc..832a5ab0ad8e1b51c4d384bb22504bfff54ac1ff 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.7 2001/09/20 06:07:16 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_volume.c,v 1.1.1.8 2001/10/14 17:59:00 hartmans Exp $");
 
 #include "../afs/stds.h"
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
@@ -72,6 +72,7 @@ afs_int32 fvTable[NFENTRIES];
 /* Forward declarations */
 static struct volume *afs_NewVolumeByName(char *aname, afs_int32 acell, int agood,
                                   struct vrequest *areq, afs_int32 locktype);
+static struct volume *afs_NewDynrootVolume(struct VenusFid *fid);
 static inVolList();
 
 
@@ -402,8 +403,12 @@ struct volume *afs_GetVolume(afid, areq, locktype)
 
     tv = afs_FindVolume(afid, locktype);
     if (!tv) {
-       bp = afs_cv2string(&tbuf[CVBS], afid->Fid.Volume);
-       tv = afs_NewVolumeByName(bp, afid->Cell, 0, areq, locktype);
+       if (afs_IsDynrootFid(afid)) {
+          tv = afs_NewDynrootVolume(afid);
+       } else {
+          bp = afs_cv2string(&tbuf[CVBS], afid->Fid.Volume);
+          tv = afs_NewVolumeByName(bp, afid->Cell, 0, areq, locktype);
+       }
     }
     return tv;
 } /*afs_GetVolume*/
@@ -549,6 +554,29 @@ struct volume *afs_GetVolumeByName(aname, acell, agood, areq, locktype)
   return(tv);
 }
 
+static struct volume *afs_NewDynrootVolume(struct VenusFid *fid) {
+    struct cell *tcell;
+    struct volume *tv;
+    struct vldbentry tve;
+    char *bp, tbuf[CVBS];
+
+    tcell = afs_GetCell(fid->Cell, READ_LOCK);
+    if (!tcell)
+       return (struct volume *) 0;
+    if (!(tcell->states & CHasVolRef))
+       tcell->states |= CHasVolRef;
+
+    bp = afs_cv2string(&tbuf[CVBS], fid->Fid.Volume);
+    memset(&tve, 0, sizeof(tve));
+    strcpy(tve.name, "local-dynroot");
+    tve.volumeId[ROVOL] = fid->Fid.Volume;
+    tve.flags = VLF_ROEXISTS;
+
+    tv = afs_SetupVolume(0, bp, &tve, tcell, 0, 0, 0);
+    afs_PutCell(tcell, READ_LOCK);
+    return tv;
+}
+
 int lastnvcode;
 static struct volume *afs_NewVolumeByName(char *aname, afs_int32 acell, int agood,
                                   struct vrequest *areq, afs_int32 locktype)
index fb5c2e95cc9d2d7009200f1f09773c1248f8b3b8..343776412740c2c0d5645487487c397982a60fad 100644 (file)
@@ -86,7 +86,7 @@ typedef struct afs_bozoLock afs_bozoLock_t;
 #define BEGINMAC do {
 #define ENDMAC   } while (0)
 
-#if defined(AFS_SUN5_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_OBSD_ENV)
 #define MyPidxx (curproc->p_pid)
 #else
 #if defined(AFS_AIX41_ENV)
index cc5b65b9871dfb80aee9644676c80400119033c1..67bf2fee0a65b349a89e0332ad7af87f380b9113 100644 (file)
@@ -103,6 +103,8 @@ dest: ${DEST}/root.client/usr/vice/etc/afsd ${DEST}/etc/vsys
                        ${INSTALL} -f afs.rc.solaris.2.7 ${DEST}/root.client/usr/vice/etc/modload/afs.rc ;;\
                sun4x_58 ) \
                        ${INSTALL} -f afs.rc.solaris.2.8 ${DEST}/root.client/usr/vice/etc/modload/afs.rc ;;\
+               sun4x_59 ) \
+                       ${INSTALL} -f afs.rc.solaris.2.9 ${DEST}/root.client/usr/vice/etc/modload/afs.rc ;;\
                 sun4x_5? ) \
                         ${INSTALL} -f afs.rc.solaris.2_5 ${DEST}/root.client/usr/vice/etc/modload/afs.rc ;;\
                alpha_osf* ) \
index 25830a36c5bbc60adedf4a61d41e95dd909fe7f6..e9bf6ef9ba67056973b2acc60d3ad951371c3b0a 100644 (file)
@@ -55,7 +55,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/afsd.c,v 1.1.1.10 2001/09/20 06:12:14 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/afsd.c,v 1.1.1.11 2001/10/14 18:03:37 hartmans Exp $");
 
 #define VFS 1
 
@@ -113,6 +113,14 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/afsd.c,v 1.1.1.10 2001/09/20 06:12
 #include <sys/vfs.h>
 #endif
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
 #include <netinet/in.h>
 #include <afs/afs_args.h>
 #include <afs/cellconfig.h>
@@ -231,6 +239,7 @@ static int enable_process_stats = 0;        /* enable rx stats */
 #ifdef AFS_AFSDB_ENV
 static int enable_afsdb = 0;           /* enable AFSDB support */
 #endif
+static int enable_dynroot = 0;         /* enable dynroot support */
 #ifdef notdef
 static int inodes = 60;                        /* VERY conservative, but has to be */
 #endif
@@ -1058,6 +1067,10 @@ static AfsdbLookupHandler()
     struct afsconf_cell acellInfo;
     int i;
 
+    kernelMsg[0] = 0;
+    kernelMsg[1] = 0;
+    acellName[0] = '\0';
+
     while (1) {
        /* On some platforms you only get 4 args to an AFS call */
        int sizeArg = ((sizeof acellName) << 16) | (sizeof kernelMsg);
@@ -1067,6 +1080,9 @@ static AfsdbLookupHandler()
            continue;
        }
 
+       if (*acellName == 1)    /* Shutting down */
+           break;
+
        code = afsconf_GetAfsdbInfo(acellName, 0, &acellInfo);
        if (code) {
            kernelMsg[0] = 0;
@@ -1079,8 +1095,12 @@ static AfsdbLookupHandler()
                kernelMsg[1] = 0;
            for (i=0; i<acellInfo.numServers; i++)
                kernelMsg[i+2] = acellInfo.hostAddr[i].sin_addr.s_addr;
+           strncpy(acellName, acellInfo.name, sizeof(acellName));
+           acellName[sizeof(acellName) - 1] = '\0';
        }    
     }
+
+    exit(1);
 }
 #endif
 
@@ -1288,6 +1308,10 @@ mainproc(as, arock)
            nFilesPerDir = res;
        }
     }
+    if (as->parms[26].items) {
+       /* -dynroot */
+       enable_dynroot = 1;
+    }
 
     /*
      * Pull out all the configuration info for the workstation's AFS cache and
@@ -1519,6 +1543,14 @@ mainproc(as, arock)
     }
 #endif
 
+    if (enable_dynroot) {
+       if (afsd_verbose)
+           printf("%s: Enabling dynroot support in kernel.\n", rn);
+       code = call_syscall(AFSOP_SET_DYNROOT, 1);
+       if (code)
+           printf("%s: Error enabling dynroot support.\n", rn);
+    }
+
     /* Initialize AFS daemon threads. */
     if (afsd_verbose)
        printf("%s: Forking AFS daemon.\n", rn);
@@ -1870,6 +1902,7 @@ char **argv; {
 #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");
+    cmd_AddParm(ts, "-dynroot", CMD_FLAG, CMD_OPTIONAL, "Enable dynroot support");
     return (cmd_Dispatch(argc, argv));
 }
 
@@ -1951,6 +1984,16 @@ call_syscall(param1, param2, param3, param4, param5, param6, param7)
 long param1, param2, param3, param4, param5, param6, param7;
 {
     int error;
+#ifdef AFS_LINUX20_ENV
+    long eparm[4];
+
+    eparm[0] = param4;
+    eparm[1] = param5;
+    eparm[2] = param6;
+    eparm[3] = param7;
+
+    param4 = eparm;
+#endif
 
     error = syscall(AFS_SYSCALL, AFSCALL_CALL, param1, param2, param3, param4, param5, param6, param7);
     if (afsd_verbose) printf("SScall(%d, %d)=%d ", AFS_SYSCALL, AFSCALL_CALL, error);
index 2d0c8cfd1eacc530330193e69850046746b52756..999f484f678b38a0ae0ad146da717e5dce00093d 100644 (file)
@@ -9,8 +9,21 @@
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/vsys.c,v 1.1.1.4 2001/07/14 22:20:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/vsys.c,v 1.1.1.5 2001/10/14 18:03:38 hartmans Exp $");
 
 #include <afs/afs_args.h>
 
@@ -46,4 +59,5 @@ main (argc, argv)
     }
     code = syscall(AFS_SYSCALL, parms[0], parms[1], parms[2], parms[3], parms[4], parms[5]);
     printf("code %d\n", code);
+    return 0;
 }
index 2e6a1654cb7efeddeed4935bd322aceb36850a9f..fe6bb2f249d2efa17dd01735248ce7e12153e7df 100644 (file)
 #define ReleaseLockEvent       "AFS_SRX_RelLock"
 #define SetVolumeStatusEvent    "AFS_SRX_SetVolS"
 #define FlushCPSEvent           "AFS_SRX_FlusCPS"
+#define InlineBulkFetchStatusEvent     "AFS_SRX_BIFchSt"
 #define PrivilegeEvent         "AFS_Priv"
 #define PrivSetID              "AFS_PrivSet"
 /* Next 5 lines on behalf of MR-AFS */
index 5d9cb48d879a5ca8ea9a67131ea624a863a980b5..5ff836ac2d29cb27bf3191b4b7ce82741e33c18e 100644 (file)
@@ -74,7 +74,8 @@ EXELIBS =\
        $(EXELIBDIR)\afslwp.lib \
        $(EXELIBDIR)\afs\afsutil.lib \
        $(DESTDIR)\lib\afs\afseventlog.lib \
-       $(EXELIBDIR)\afs\afsreg.lib
+       $(EXELIBDIR)\afs\afsreg.lib \
+       $(DESTDIR)\lib\cm_dns.obj
 
 
 $(SETKEY_EXEFILE): $(SETKEY_EXEOBJS) $(EXELIBS)
index be3b2951cd35ae7a6519eb48b53b51fbdb3ea336..8ac1bb506051db4fd66395d849ef715347426bad 100644 (file)
@@ -14,7 +14,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/auth/authcon.c,v 1.1.1.6 2001/09/20 06:12:37 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/auth/authcon.c,v 1.1.1.7 2001/10/14 18:04:00 hartmans Exp $");
 
 #if defined(UKERNEL)
 #include "../afs/sysincludes.h"
index 99227e4c9a0adf46b7bb9d65386442b04befcc0a..9ea48559c7bc3a3af28e895b113ebd252ccc47a1 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.10 2001/09/20 06:12:38 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/auth/cellconfig.c,v 1.1.1.11 2001/10/14 18:04:01 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <afs/pthread_glock.h>
@@ -24,12 +24,16 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/cellconfig.c,v 1.1.1.10 2001/09/20
 #include <sys/utime.h>
 #include <io.h>
 #include <WINNT/afssw.h>
+#ifdef AFS_AFSDB_ENV
+#include <cm_dns.h>
+#endif /* AFS_AFSDB_ENV */
 #else
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netdb.h>
 #include <sys/file.h>
 #include <sys/time.h>
+#include <afs/afsint.h>
 #ifdef AFS_AFSDB_ENV
 #include <arpa/nameser.h>
 #include <resolv.h>
@@ -39,8 +43,19 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/cellconfig.c,v 1.1.1.10 2001/09/20
 #include <ctype.h>
 #include <time.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #endif /* UKERNEL */
 #include <afs/afsutil.h>
 #include "cellconfig.h"
@@ -53,19 +68,19 @@ static afsconf_CloseInternal();
 static afsconf_Reopen();
 
 static struct afsconf_servPair serviceTable [] = {
-    "afs",     7000,
-    "afscb",   7001,
-    "afsprot", 7002,
-    "afsvldb", 7003,
-    "afskauth",        7004,
-    "afsvol",  7005,
-    "afserror",        7006,
-    "afsnanny",        7007,
-    "afsupdate",7008,
-    "afsrmtsys",7009,
-    "afsres",   7010,   /* residency database for MR-AFS */
-    "afsremio", 7011,   /* remote I/O interface for MR-AFS */
-    0, 0               /* insert new services before this spot */
+    { "afs",       7000, },
+    { "afscb",     7001, },
+    { "afsprot",   7002, },
+    { "afsvldb",   7003, },
+    { "afskauth",  7004, },
+    { "afsvol",    7005, },
+    { "afserror",  7006, },
+    { "afsnanny",  7007, },
+    { "afsupdate", 7008, },
+    { "afsrmtsys", 7009, },
+    { "afsres",    7010, },  /* residency database for MR-AFS */
+    { "afsremio",  7011, },  /* remote I/O interface for MR-AFS */
+    { 0, 0 }                /* insert new services before this spot */
 };
 
 /*
@@ -106,7 +121,7 @@ char *abuffer; {
     register int tc;
 
     tp = abuffer;
-    while (tc = *tp) {
+    while ((tc = *tp)) {
        if (!isspace(tc)) break;
        tp++;
     }
@@ -353,9 +368,12 @@ char clones[];
 #else
     i = GetCellUnix(adir);
 #endif
+
+#ifndef AFS_FREELANCE_CLIENT  /* no local cell not fatal in freelance */
     if (i) {
        return i;
     }
+#endif
 
     /* now parse the individual lines */
     curEntry = 0;
@@ -553,6 +571,7 @@ afsconf_GetExtendedCellInfo(adir, acellName, aservice, acellInfo, clones)
 }
 
 #ifdef AFS_AFSDB_ENV
+#if !defined(AFS_NT40_ENV)
 afsconf_GetAfsdbInfo(acellName, aservice, acellInfo)
     char *acellName;
     char *aservice;
@@ -563,6 +582,7 @@ afsconf_GetAfsdbInfo(acellName, aservice, acellInfo)
     size_t len;
     unsigned char answer[1024];
     unsigned char *p;
+    char realCellName[256];
     char host[256];
     int server_num = 0;
     int minttl = 0;
@@ -582,7 +602,6 @@ afsconf_GetAfsdbInfo(acellName, aservice, acellInfo)
     code = dn_expand(answer, answer + len, p, host, sizeof(host));
     if (code < 0)
        return AFSCONF_NOTFOUND;
-    strncpy(acellInfo->name, host, sizeof(acellInfo->name));
 
     p += code + QFIXEDSZ;      /* Skip name */
 
@@ -606,6 +625,15 @@ afsconf_GetAfsdbInfo(acellName, aservice, acellInfo)
            short afsdb_type;
 
            afsdb_type = (p[0] << 8) | p[1];
+           if (afsdb_type == 1) {
+               /*
+                * We know this is an AFSDB record for our cell, of the
+                * right AFSDB type.  Write down the true cell name that
+                * the resolver gave us above.
+                */
+               strcpy(realCellName, host);
+           }
+
            code = dn_expand(answer, answer+len, p+2, host, sizeof(host));
            if (code < 0)
                return AFSCONF_NOTFOUND;
@@ -630,6 +658,7 @@ afsconf_GetAfsdbInfo(acellName, aservice, acellInfo)
 
     if (server_num == 0)               /* No AFSDB records */
        return AFSCONF_NOTFOUND;
+    strncpy(acellInfo->name, realCellName, sizeof(acellInfo->name));
     acellInfo->numServers = server_num;
 
     if (aservice) {
@@ -645,6 +674,58 @@ afsconf_GetAfsdbInfo(acellName, aservice, acellInfo)
 
     return 0;
 }
+#else  /* windows */
+int afsconf_GetAfsdbInfo(acellName, aservice, acellInfo)
+  char *aservice;
+  char *acellName;
+  struct afsconf_cell *acellInfo;
+{
+    register afs_int32 i;
+    int tservice;
+    struct afsconf_entry DNSce;
+    char *DNStmpStrp; /* a temp string pointer */
+    struct hostent *thp;
+    afs_int32 cellHosts[AFSMAXCELLHOSTS];
+    int numServers;
+    int rc;
+    int *ttl;
+
+    DNSce.cellInfo.numServers=0;
+    DNSce.next = NULL;
+    rc = getAFSServer(acellName, cellHosts, &numServers, &ttl);
+    /* ignore the ttl here since this code is only called by transitory programs
+       like klog, etc. */
+    if (rc < 0)
+      return -1;
+    if (numServers == 0)
+      return -1;
+
+    for (i = 0; i < numServers; i++)
+    {
+        memcpy(&acellInfo->hostAddr[i].sin_addr.s_addr, &cellHosts[i], sizeof(long));
+        acellInfo->hostAddr[i].sin_family = AF_INET;
+
+        /* sin_port supplied by connection code */
+    }
+
+    acellInfo->numServers = numServers;
+    strcpy(acellInfo->name, acellName);
+    if (aservice) {
+        LOCK_GLOBAL_MUTEX
+        tservice = afsconf_FindService(aservice);
+     UNLOCK_GLOBAL_MUTEX
+        if (tservice < 0) {
+            return AFSCONF_NOTFOUND;  /* service not found */
+     }
+     for(i=0; i< acellInfo->numServers; i++) {
+            acellInfo->hostAddr[i].sin_port = tservice;
+     }
+    }
+    acellInfo->linkedCell = NULL;    /* no linked cell */
+    acellInfo->flags = 0;
+    return 0;
+}
+#endif /* windows */
 #endif /* AFS_AFSDB_ENV */
 
 afsconf_GetCellInfo(adir, acellName, aservice, acellInfo)
index 595337508feb4d1f31fbfa01c03f43550786486a..b6c406cbfcd4d1838610bb89a6bc769d290f9810 100644 (file)
@@ -16,7 +16,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/auth/ktc.c,v 1.1.1.6 2001/09/11 14:31:22 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/auth/ktc.c,v 1.1.1.7 2001/10/14 18:04:01 hartmans Exp $");
 
 #if defined(UKERNEL)
 #include "../afs/sysincludes.h"
@@ -48,10 +48,20 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/ktc.c,v 1.1.1.6 2001/09/11 14:31:2
 #include <errno.h>
 #include <sys/ioctl.h>
 #include <netinet/in.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <afs/vice.h>
 #ifdef AFS_AIX_ENV
 #include <sys/lockf.h>
 #endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #include "auth.h"
 #include <afs/venus.h>
 #include <afs/afsutil.h>
index acf454b40e29b1e9cdb0d175a919b18f86c3c20c..f510dc779c7963d4ef12de4a666730f5554dfe9b 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/auth/userok.c,v 1.1.1.6 2001/09/20 06:12:39 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/auth/userok.c,v 1.1.1.7 2001/10/14 18:04:02 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <afs/pthread_glock.h>
index f83de614027d90276af8701bf323ffdf4a7a2337..a08e861577c64420d2d4494d67e14a8409cc4e82 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/auth/writeconfig.c,v 1.1.1.6 2001/09/11 14:31:23 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/auth/writeconfig.c,v 1.1.1.7 2001/10/14 18:04:02 hartmans Exp $");
 
 #include <afs/pthread_glock.h>
 #include <afs/afsutil.h>
 #include <sys/types.h>
-#ifdef AFS_SUN5_ENV 
-#include <fcntl.h>
-#endif
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
 #include <fcntl.h>
@@ -30,6 +27,19 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/writeconfig.c,v 1.1.1.6 2001/09/11
 #endif
 #include <stdio.h>
 #include <errno.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #include "cellconfig.h"
 #include "keys.h"
 
index d9ba4c0307754ebb7f695bc046917a257994e904..28af78f5f256d981afb22c96b36f46492bdafa03 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.6 2001/09/11 14:31:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bnode.c,v 1.1.1.7 2001/10/14 18:04:03 hartmans Exp $");
 
 #include <stddef.h>
 #include <stdlib.h>
@@ -34,6 +34,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bnode.c,v 1.1.1.6 2001/09/11 14:31
 #include <afs/fileutil.h>
 #include "bnode.h"
 
+#ifdef AFS_AIX_ENV
+/* All known versions of AIX lack WCOREDUMP but this works */
+#define WCOREDUMP(x) ((x) & 0x80)
+#endif
+
 #define BNODE_LWP_STACKSIZE    (16 * 1024)
 
 int bnode_waiting = 0;
@@ -528,6 +533,12 @@ static int bproc() {
                            RememberProcName(tp);
                            tb->errorSignal = 0;
                        }
+                       if (tp->coreName)
+                           bozo_Log("%s:%s exited with code %d",
+                               tb->name, tp->coreName, tp->lastExit);
+                       else
+                           bozo_Log("%s exited with code %d",
+                               tb->name, tp->lastExit);
                    }
                    else {
                        /* Signal occurred, perhaps spurious due to shutdown request.
@@ -542,6 +553,14 @@ static int bproc() {
                            tb->lastErrorExit = FT_ApproxTime();
                            RememberProcName(tp);
                        }
+                       if (tp->coreName)
+                           bozo_Log("%s:%s exited on signal %d%s",
+                               tb->name, tp->coreName, tp->lastSignal,
+                               WCOREDUMP(status) ? " (core dumped)" : "");
+                       else
+                           bozo_Log("%s exited on signal %d%s",
+                               tb->name, tp->lastSignal,
+                               WCOREDUMP(status) ? " (core dumped)" : "");
                        SaveCore(tb, tp);
                    }
                    tb->lastAnyExit = FT_ApproxTime();
index 3f9603b63833c30a294961ec25ed50883721c8ec..26f92e2894a648918c40481ca50501fedad29a95 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.8 2001/09/20 06:12:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bos.c,v 1.1.1.9 2001/10/14 18:04:04 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <stdlib.h>
@@ -1259,7 +1259,10 @@ char *orphans;
     parms[1] = "now";      /* when to do it */
     code = BOZO_CreateBnode(aconn, "cron", "salvage-tmp", parms[0], parms[1],
                            parms[2], parms[3], parms[4], notifier);
-    if (code) goto done;
+    if (code) {
+       printf("bos: failed to start 'salvager' (%s)\n", em(code));
+       goto done;
+    }
     /* now wait for bnode to disappear */
     while (1) {
        IOMGR_Sleep(5);
@@ -1485,7 +1488,6 @@ struct cmd_syndesc *as; {
        /* now do the salvage operation */
        printf("Starting salvage.\n");
        rc = DoSalvage(tconn, (char *) 0, (char *) 0, outName, showlog,parallel,tmpDir,orphans);
-       if (rc) printf("bos: failed to start 'salvager' (%s)\n", em(rc));
        if (curGoal == BSTAT_NORMAL) {
            printf("bos: restarting fs.\n");
            code = BOZO_SetTStatus(tconn, "fs", BSTAT_NORMAL);
@@ -1526,7 +1528,6 @@ struct cmd_syndesc *as; {
        printf("Starting salvage.\n");
        rc = DoSalvage(tconn, as->parms[1].items->data, (char *) 0,
                       outName, showlog,parallel,tmpDir,orphans);
-       if (rc) printf("bos: failed to start 'salvager' (%s)\n", em(rc));
        if (curGoal == BSTAT_NORMAL) {
            printf("bos: restarting fs.\n");
            code = BOZO_SetTStatus(tconn, "fs", BSTAT_NORMAL);
@@ -1578,10 +1579,8 @@ struct cmd_syndesc *as; {
        printf("Starting salvage.\n");
        rc = DoSalvage(tconn, as->parms[1].items->data, tname, outName,
                       showlog,parallel,tmpDir,orphans);
-       if (rc) {
-          printf("bos: failed to start 'salvager' (%s)\n", em(rc));
+       if (rc) 
           return rc;
-       }
     }
     return 0;
 }
index 23d69e8d6b01565499892df6926f1f12fb77f7a8..5c23a3b88d4f371e7be6a3f44b2c9d7ac01847ec 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.7 2001/09/20 06:12:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosoprocs.c,v 1.1.1.8 2001/10/14 18:04:05 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
index 5e418ff06524178d9a589bc8f75d6ffb002083c6..b240762f1af1977835e9debff057f8793b4910dc 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.9 2001/09/20 06:12:44 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosserver.c,v 1.1.1.10 2001/10/14 18:04:05 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
index 42394173b402c41775399f4706ab8fe5c0300cd4..7f2e7fcb61f78a6616a24ed25399dd87315f8721 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.6 2001/09/20 06:12:45 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/cronbnodeops.c,v 1.1.1.7 2001/10/14 18:04:06 hartmans Exp $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
index 189b2bf4b56b5cf008a3cc4df74a1675b9f3c977..7146ed42a745b2bc5c36ea5363d71e66030f67f4 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.7 2001/09/20 06:12:45 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/fsbnodeops.c,v 1.1.1.8 2001/10/14 18:04:06 hartmans Exp $");
 
 #include <sys/types.h>
 #include <lwp.h>
index d6a95a070a82871f6db95bc11c8253a001995dd9..6bf23f0b55b1eff138d870fdc200857e41ca56d2 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.7 2001/09/20 06:12:50 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/main.c,v 1.1.1.8 2001/10/14 18:04:11 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
index e422d45a3004a9f73eaa00752eb9fdbdac468263..2c4501d67edbd2fcf6dad2546b72fecac4fb99f1 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.6 2001/09/20 06:12:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/budb/server.c,v 1.1.1.7 2001/10/14 18:04:15 hartmans Exp $");
 
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
index ea35f8966a310f819c9f41926a85c5911e3a457b..f1d648e0bd0f33886fa3f2cb27048a991e88008b 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.6 2001/09/20 06:12:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butc/tcmain.c,v 1.1.1.7 2001/10/14 18:04:17 hartmans Exp $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
index 95574ab840e3643f8d8a1f9f72bd34a00879d57c..309cbda2072af4f07b42b65bef538c32416661b9 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.6 2001/09/20 06:12:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butm/butm_test.c,v 1.1.1.7 2001/10/14 18:04:19 hartmans Exp $");
 
 #include <sys/types.h>
 #include <sys/file.h>
index 5a1b34da31b3022399762aa1c3eb300f26ae2fce..2586494536d764a7a29d0bae3bb499dcef6af165 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.6 2001/09/20 06:13:00 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butm/test_ftm.c,v 1.1.1.7 2001/10/14 18:04:21 hartmans Exp $");
 
 #include <sys/types.h>
 #include <fcntl.h>
index beefbae3f6583c99a6edaaef83c13069fe2124a1..8e0753b1115a1bef93ba55375bb0c5dbd72e5b59 100644 (file)
@@ -28,3 +28,14 @@ ac_cv_linux_fs_struct_address_space_has_page_lock=no)])
 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_page_lock)
 CPPFLAGS="$save_CPPFLAGS"])
 
+
+dnl LINUX_BUILD_VNODE_FROM_INODE (configdir, outputdir)
+dnl            defaults: (src/config, src/afs/LINUX)
+
+AC_DEFUN(LINUX_BUILD_VNODE_FROM_INODE, [
+AC_MSG_CHECKING(whether to build osi_vfs.h)
+configdir=ifelse([$1], ,src/config,$1)
+outputdir=ifelse([$2], ,src/afs/LINUX,$2)
+chmod +x $configdir/make_vnode.pl
+$configdir/make_vnode.pl -i $LINUX_KERNEL_PATH -o $outputdir
+])
index ae22e138ee63c0842ce412aacde2f964beea58f9..98ad569998ce52743eca41a1809833ea62af9354 100644 (file)
@@ -72,3 +72,19 @@ ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes,
 ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)])
 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem)
 CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DEVICES, [
+AC_MSG_CHECKING(for i_devices in struct inode)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, 
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>],
+[struct inode _inode;
+printf("%d\n", _inode.i_devices);], 
+ac_cv_linux_fs_struct_inode_has_i_devices=yes,
+ac_cv_linux_fs_struct_inode_has_i_devices=no)])
+AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices)
+CPPFLAGS="$save_CPPFLAGS"])
+
index cf9823232b4c9777cf11e4b23e70fcffbb2255cc..bb40f4afbeb519dbdc2f612ee9f154629534ee47 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/cmd/cmd.c,v 1.1.1.7 2001/09/20 06:13:01 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/cmd/cmd.c,v 1.1.1.8 2001/10/14 18:04:23 hartmans Exp $");
 
 #include <sys/types.h>
 #include <ctype.h>
index 73a1485db21ef146a72194aeb49092599a3f2b84..00ac085d2197dd9d0e2eb680dbe70cd14983d59b 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/cmd/test/itest.c,v 1.1.1.5 2001/09/20 06:13:02 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/cmd/test/itest.c,v 1.1.1.6 2001/10/14 18:04:24 hartmans Exp $");
 
 #include "cmd.h"
 #include <stdio.h>
index 66c4d74919fdc8a5114845aba4d9745f76171e14..fc2e8d03ccdd94a7a070963d96caaec614103989 100644 (file)
@@ -11,7 +11,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/comerr/compile_et.c,v 1.1.1.5 2001/09/20 06:13:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/comerr/compile_et.c,v 1.1.1.6 2001/10/14 18:04:25 hartmans Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -370,7 +370,9 @@ int main (argc, argv) int argc; char **argv; {
     fprintf (hfile, "#define ERROR_TABLE_BASE_%s (%ldL)\n",
             lcname, (long int) table_number);
     fprintf (hfile, "#define init_%s_err_tbl initialize_%s_error_table\n",
-            lcname, lcname);
+            lcname, table_name);
+    fprintf (hfile, "#define initialize_%s_error_table initialize_%s_error_table\n",
+            lcname, table_name);
     fprintf (hfile, "#define %s_err_base ERROR_TABLE_BASE_%s\n", lcname,
             lcname);
     fclose(hfile);             /* bye bye include file */
index 7554269908058f533ba05eedc4863120219c0758..fb597691102e2cedafe444cbca665af699ec4ef1 100644 (file)
@@ -2,7 +2,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/comerr/error_table.y,v 1.1.1.5 2001/09/20 06:13:04 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/comerr/error_table.y,v 1.1.1.6 2001/10/14 18:04:26 hartmans Exp $");
 
 /*
  *
index 8c218caca55afe700e179f3515575be713e7e7c4..ba6fbb0530cef21e617172f9705c800c2e72a2b0 100755 (executable)
@@ -15,7 +15,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/comerr/error_table_nt.c,v 1.1.1.4 2001/09/20 06:13:05 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/comerr/error_table_nt.c,v 1.1.1.5 2001/10/14 18:04:26 hartmans Exp $");
 
 
 /*
index 4a347e3bce9488159a590b6b964cb6f0a1c7e3c9..06e0e13ac484736060095856d7f1c70f7b9fd70e 100644 (file)
@@ -1,7 +1,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/comerr/test/test.c,v 1.1.1.4 2001/09/20 06:13:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/comerr/test/test.c,v 1.1.1.5 2001/10/14 18:04:27 hartmans Exp $");
 
 #include <stdio.h>
 #include <errno.h>
index 7aa3fd84360c0988ef742801e036a49da1a0569c..57fc9707d2864c7b18ff9b1d1f09872638589ef2 100644 (file)
@@ -1,9 +1,15 @@
 AFS_component_version_number.c
 Makefile
-Makefile.i386_linux24
+Makefile.*_*[0123456789]
 Makefile.version
 Makefile.version-NOCML
 afsconfig.h
 afsconfig.h.in
 config
 mkvers
+Makefile.hp_ux102
+Makefile.hp_ux110
+Makefile.i386_linux22
+Makefile.i386_linux24
+Makefile.sun4x_56
+Makefile.sun4x_57
index 7206ea95f554383bda9267935db3fc61413b134b..ddbacc3083f82033ce5b819470d47c6c735dd01e 100644 (file)
@@ -15,7 +15,7 @@ AFS_OSTYPE = DJGPP
 OPTMZ=-O2
 #PAM_CFLAGS = -O2 -Dlinux -DLINUX_PAM -fPIC
 # Put -O2 here to _ensure_ all Makefiles pick it up.
-XCFLAGS= ${DBG} -Dfds_bits=fd_bits
+XCFLAGS= ${DBG} -Dfds_bits=fd_bits -DAFS_AFSDB_ENV -DAFS_FREELANCE_CLIENT
 MT_CFLAGS=${XCFLAGS}
 XLDFLAGS=
 SHARE_LDFLAGS = -shared -Xlinker -x
index be76178b7271317fbe67e641b980da4e8b69af53..2559ee45c1ed78713e5dba000f278b53c97ddeb3 100644 (file)
@@ -5,14 +5,14 @@ AFS_OSTYPE = DARWIN
 #
 #
 # compilation and link editor flags
-XCFLAGS=-traditional-cpp
+XCFLAGS=-no-precomp
 #MT_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV ${XCFLAGS}
 #MT_CC=cc
 KROOT=
 KINCLUDES=-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers
 #SHARE_LDFLAGS =
-LWP_OPTMZ=-g
-OPTMZ=-g
+LWP_OPTMZ=-O2
+OPTMZ=-O2
 DBG=-g
 REGEX_OBJ=regex.o
 
index 797477171129270a88630a8fbf0885fcba129c7d..7ad11f211b8a6b139046307c729a6a7bc27b45cf 100644 (file)
@@ -35,7 +35,3 @@ MV=mv
 RANLIB=ranlib
 RM=rm
 INSTALL=${TOP_SRCDIR}/pinstall/pinstall
-#
-# This is the XBSA make flag and pathname to XBSA header files (xbsa.h)
-XBSA_FLAGS=-Dxbsa
-XBSADIR=/usr/tivoli/tsm/client/api/bin/xopen
index add17886574361e2503e2c3167fec2cac0b35b54..8055c01a46ca35807e171236f20c0986392c59d1 100644 (file)
@@ -49,7 +49,3 @@ INSTALL=${TOP_SRCDIR}/pinstall/pinstall
 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
-XBSADIR=/opt/tivoli/tsm/client/api/bin/xopen
index 3f5e0c07b50d1271fbd4656f9d7349d5fe32d882..5b8a3ea4218dd4ece8fb9ac9f78a9543e1a4b64d 100644 (file)
@@ -53,7 +53,3 @@ INSTALL=${TOP_SRCDIR}/pinstall/pinstall
 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
-XBSADIR=/opt/tivoli/tsm/client/api/bin/xopen
index 945a14282e9ad6cddb56a5787dd07290e71dc0b5..e1fb1301ac2b3917a7a306bfcaff8a3509edb25e 100644 (file)
@@ -46,7 +46,3 @@ INSTALL=${TOP_SRCDIR}/pinstall/pinstall
 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
-XBSADIR=/opt/tivoli/tsm/client/api/bin/xopen
index 83cce8977154cdf0734d0dd95f1d75426ba2d168..2d48de1d5eed9e6d6c5822fe0eeeffa1373fb625 100644 (file)
@@ -152,7 +152,9 @@ afscdefs =\
        -I$(DESTDIR)\include\rx \
        -DWIN32_LEAN_AND_MEAN \
        -DSTRICT \
-       -D_WIN32_IE=0x0400
+       -D_WIN32_IE=0x0400 \
+     -DAFS_AFSDB_ENV \
+     -DAFS_FREELANCE_CLIENT
 
 afscdefs = $(afscdefs) $(AFSDEV_AUXCDEFINES)
 
index 2c314157afe57958be1ed5071176ab64e1758276..176015c36d8a31703dacabefe3275e0277a04255 100644 (file)
@@ -164,7 +164,9 @@ afscdefs =\
        -I$(DESTDIR)\include\rx \
        -DWIN32_LEAN_AND_MEAN \
        -DSTRICT \
-       -D_WIN32_IE=0x0400
+       -D_WIN32_IE=0x0400 \
+     -DAFS_AFSDB_ENV \
+     -DAFS_FREELANCE_CLIENT
 
 !      IF ((EXIST($(MSSDK)\include)) && (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" )))
 afscdefs=$(afscdefs) -I$(MSSDK)\include $(afscppdefs) \
index 51427adee7698c78447a3cf65339b60f563c0109..93a50a9079be14d3b1a0b2d09c6937e5c77dc8d7 100644 (file)
@@ -39,6 +39,7 @@
 
 #define        AFSOP_ADDCELL2           29     /* 2nd add cell protocol interface */
 #define        AFSOP_AFSDB_HANDLER      30     /* userspace AFSDB lookup handler */
+#define        AFSOP_SET_DYNROOT        31     /* enable/disable dynroot support */
 
 /* The range 20-30 is reserved for AFS system offsets in the afs_syscall */
 #define        AFSCALL_PIOCTL          20
 /* #define AFSOP_STOP_RXEVENT   214     defined in osi.h             */
 /* #define AFSOP_STOP_COMPLETE     215  defined in osi.h             */
 /* #define AFSOP_STOP_RXK_LISTENER   217     defined in osi.h        */
+#define AFSOP_STOP_AFSDB       218     /* Stop AFSDB handler */
 
 /* Main afs syscall entry; this number may vary per system (i.e. defined in afs/param.h) */
 #ifndef        AFS_SYSCALL
index 0323ea6ed7a490c530d9a7c8fb3177fc59dbc79f..8fdc667fbec06a97c922b4285c69d1d5ff103e23 100644 (file)
@@ -80,6 +80,7 @@
 #define SYS_NAME_ID_sunx86_55                   937
 #define SYS_NAME_ID_sun4x_57            938
 #define SYS_NAME_ID_sun4x_58            939
+#define SYS_NAME_ID_sun4x_59            940
 
 /* 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_ia64_linux22       2201
 #define SYS_NAME_ID_ia64_linux24       2202
 
+#define SYS_NAME_ID_m68k_linux22        2301
+#define SYS_NAME_ID_m68k_linux24        2302
+
+#define SYS_NAME_ID_parisc_linux22      2401
+#define SYS_NAME_ID_parisc_linux24      2402
+
 /*
  * Placeholder to keep system-wide standard flags since this file is included by all 
  * files (i.e in afs/param.h)
index 9237e564356f0f5c0aa47c8ba0f9df60f1a9f8a1..6168147e690f4cdd2acf159887f2158e654084f2 100644 (file)
@@ -194,7 +194,7 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 #undef HAVE_RES_SEARCH
 //#undef HAVE_SOCKET
 
-#if ENDIANESS_IN_SYS_PARAM_H
+#ifdef ENDIANESS_IN_SYS_PARAM_H
 # ifndef KERNEL
 #  include <sys/types.h>
 #  include <sys/param.h>
@@ -204,7 +204,8 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 # endif
 #endif
 
-#undef AFS_AFSDB_ENV
+/*#undef AFS_AFSDB_ENV*/
+#define AFS_AFSDB_ENV 1
 #undef AFS_NAMEI_ENV
 #undef BOS_RESTRICTED_MODE
 
index 0eb60b0434b9ea1c805c90b557885a01f2e6c8b6..f6cac44b91efa77431918679ec166d51012372dd 100644 (file)
@@ -85,18 +85,16 @@ void Usage(void)
 
 main(int argc, char **argv)
 {
-    int n = 0;
     char stampsFile[1024];
     char stateFile[1024];
     char s[1024];
-    char *p;
     int i;
     char *baseDir;
     int argDir = 0;
     char *outputFile = NULL;
     char outputFileBuf[sizeof(VERS_FILE) + 2];
     struct stat sbuf;
-    time_t versTime, stampsTime, stateTime;
+    time_t versTime;
     int reBuild = 0;
     int code;
     char *cml_prefix = NULL;
index 405bfb300e942623107dfa3ef860965168447eb3..e8e04c63741ad9684460ca1bb45266e80fe0172c 100644 (file)
@@ -81,8 +81,8 @@
 #define vfs_fsid       mnt_stat.f_fsid
 #define va_nodeid      va_fileid
 #define vfs_vnodecovered mnt_vnodecovered
-#define direct         dirent
 #define vnode_t                struct vnode
+#define setgroups      sys_setgroups
 
 #ifndef MUTEX_DEFAULT
 #define MUTEX_DEFAULT   0
index 88749e23c590d046d1f4715262cee2a4a74ee991..30557129a01bb9069eebc821c2972675cab2fbaa 100644 (file)
 #define        DEBUG           1
 
 #define AFS_SGI_DUAL_FS_CACHE 1 /* implies supports EFS or XFS cache */
+
+#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 */
 
 #ifndef CMSERVERPREF
index 1163011ec458302d7e2cfa32f471b2f42dc0e5ad..0cecc287c4932043e236b604b58cf3325f122fee 100644 (file)
 #define AFS_EVENT_LOCK  1 /* osi_Sleep/osi_Wakeup use spinlock. */
 #define AFS_SGI_DUAL_FS_CACHE 1 /* implies supports EFS or XFS cache */
 
+#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 */
 
 #ifndef CMSERVERPREF
index 2650bfa6fbb4c84ca102f8bed664dc7929f1d8ca..9e2b2d8aaf13af6d514aa86633a612f999cd4155 100644 (file)
 #define AFS_EVENT_LOCK  1 /* osi_Sleep/osi_Wakeup use spinlock. */
 #define AFS_SGI_DUAL_FS_CACHE 1 /* implies supports EFS or XFS cache */
 
+#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 */
 
 #ifndef CMSERVERPREF
index de7e674184d5fad1e54decae3ed5d7a639e42699..63afdd23e440f3eb5d95876c5f4249c09b7de7ab 100644 (file)
 #define AFS_EVENT_LOCK  1 /* osi_Sleep/osi_Wakeup use spinlock. */
 #define AFS_SGI_DUAL_FS_CACHE 1 /* implies supports EFS or XFS cache */
 
+#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 */
 
 #ifndef CMSERVERPREF
index 9191bdfe002d5e3299a594b27eb71e6806eb0093..136087e90f7350625e347b8035f8d9dafbaeaedd 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.7 2001/09/20 06:13:21 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/dauth/dlog.c,v 1.1.1.8 2001/10/14 18:04:42 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
index edf8d0e1e3cd7d0bad7a1b392332905afa2edc18..f1be8c1a5c8e6cac91d8a466edec5b444cdd991d 100644 (file)
@@ -43,6 +43,9 @@
 #include "conf-i386-obsd.h"
 #else
 #if defined(AFS_LINUX20_ENV) || defined(AFS_DJGPP_ENV)
+#ifdef AFS_PARISC_LINUX20_ENV
+#include "conf-parisc-linux.h"
+#else
 #ifdef AFS_PPC_LINUX20_ENV
 #include "conf-ppc-linux.h"
 #else
@@ -67,7 +70,8 @@
 #endif /* AFS_S390_LINUX20_ENV */
 #endif /* AFS_SPARC64_LINUX20_ENV */
 #endif /* AFS_SPARC_LINUX20_ENV */
-#endif
+#endif /* AFS_PPC_LINUX20_ENV */
+#endif /* AFS_PARISC_LINUX24_ENV */
 #else
 #if defined(AFS_DARWIN_ENV) && defined(AFS_PPC_ENV)
 #include "conf-ppc-darwin.h"
index c3b99edb168d68b35cc50939d9a537aef1c926ad..a51a7cb9f4958305738f6ca8b2d5c8de76bbce35 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/des/main.c,v 1.1 2001/09/11 14:32:31 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/des/main.c,v 1.1.1.2 2001/10/14 18:04:47 hartmans Exp $");
 
 #include <mit-cpyright.h>
 #include <stdio.h>
+#include <stdlib.h>
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+
 #include "des_internal.h"
 
 extern void gen PROTOTYPE((FILE * stream));
index e6e0ea286dd4b27ecdbfb1fb5e97ba3617073979..d1597f80f3010af3c330429201bd4680f39aef04 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/des/make_ip.c,v 1.1.1.4 2001/07/14 22:21:33 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/des/make_ip.c,v 1.1.1.5 2001/10/14 18:04:47 hartmans Exp $");
 
 #include <mit-cpyright.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include "des_internal.h"
 
 #define WANT_IP_TABLE
index 0de08feac24e2826917ac01c99becaffab865ed7..5dca29a0fc5a09baf7fce00daf8069b670e3e78a 100644 (file)
@@ -14,7 +14,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/des/read_pssword.c,v 1.1.1.7 2001/09/20 06:13:27 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/des/read_pssword.c,v 1.1.1.8 2001/10/14 18:04:48 hartmans Exp $");
 
 #include <mit-cpyright.h>
 #include <des.h>
index acd09aa5d6af11e5905fab68bd651a7f3aa03c37..80e187856f08e5b41d3d3bda6b1b4ed728833a2d 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/dir/buffer.c,v 1.1.1.6 2001/09/20 06:13:28 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/dir/buffer.c,v 1.1.1.7 2001/10/14 18:04:51 hartmans Exp $");
 
 #include <stdlib.h>
 #include <lock.h>
index 369b250693ba56653a12606beaf5b87c70d2c0fa..97aaede321b17e742f913bfdd496ab406fa5bbab 100644 (file)
@@ -39,8 +39,8 @@ struct PageHeader
     };
 
 struct DirHeader
-    {/* A directory header object.
-     */struct PageHeader header;
+    {/* A directory header object. */
+    struct PageHeader header;
     char alloMap[MAXPAGES];    /* one byte per 2K page */
     unsigned short hashTable[NHASHENT];
     };
index b4163906957eba7087280478a3d07efdab9cf27b..6df495dad371711a0f030beac5528fefb9c3172a 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.6 2001/09/20 06:14:44 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/dir/salvage.c,v 1.1.1.7 2001/10/14 18:04:52 hartmans Exp $");
 
 #include <sys/types.h>
 #include <errno.h>
index b23dd7d2e1ca721a28829878279a755ad36f44f5..d0b3b36b392f6829823332aaa90d4d8a9ee3fc04 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/finale/translate_et.c,v 1.1.1.6 2001/09/20 06:14:46 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/finale/translate_et.c,v 1.1.1.7 2001/10/14 18:04:54 hartmans Exp $");
 
 #include <afs/com_err.h>
 #include <rx/rxkad.h>
index bb3e5166e9cc19dbe63aabb7f29c1647ff8ae869..aa210a8b12ca8c4c33fd3552ebc525b180fcab44 100644 (file)
@@ -101,9 +101,9 @@ struct AFSFetchStatus {
     afs_uint32 Group;
     afs_uint32 SyncCounter;
     afs_uint32 dataVersionHigh; /* For AFS/DFS translator, hi bits of dvn */
-    afs_uint32 spare2;
+    afs_uint32 lockCount;
     afs_uint32 spare3;
-    afs_uint32 spare4;
+    afs_uint32 errorCode;
 };
 
 struct AFSStoreStatus {
@@ -570,3 +570,10 @@ ResidencyCmd(
   IN struct ResidencyCmdInputs *Inputs,
   OUT struct ResidencyCmdOutputs *Outputs
 ) = 220; 
+
+InlineBulkStatus(
+  IN  AFSCBFids *FidsArray,
+  OUT AFSBulkStats *StatArray,
+  AFSCBs *CBArray,
+  AFSVolSync *Sync
+) = 65536;
index def0154fe5b83ce5d85b61ab63f2208bf0ddada7..02577f9a8686997fd51948424a3c92ddcd48697c 100644 (file)
@@ -94,7 +94,8 @@ AFSLIBS =  \
        $(DESTDIR)\lib\afsrx.lib \
        $(DESTDIR)\lib\afsubik.lib \
        $(DESTDIR)\lib\afs\afseventlog.lib \
-       $(DESTDIR)\lib\afsrxkad.lib
+       $(DESTDIR)\lib\afsrxkad.lib \
+       $(DESTDIR)\lib\cm_dns.obj
        
 TOKENLIB = $(DESTDIR)\lib\afs\afspioctl.lib
 
index 2f018803ef002c54c1ac7cc3ce6419f1e5dfcede..bd5a63d221f9e66c50f7d0472822f8fee16b042d 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.9 2001/09/20 06:14:54 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/admin_tools.c,v 1.1.1.10 2001/10/14 18:05:03 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <afs/debug.h>
@@ -715,7 +715,7 @@ int StringToKey (
       
     printf ("Converting %s with the DES string to key yields key='",
            as->parms[0].items->data);
-    ka_PrintBytes (&key, sizeof(key));
+    ka_PrintBytes ((char *)&key, sizeof(key));
     printf ("'.\n");
 
     return 0;
index 93e71f2a1e3a98f05af9d4de993b7f5d3b99ff10..359896c1906bb762500267f118e040cffab62fda 100644 (file)
@@ -16,7 +16,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/authclient.c,v 1.1.1.8 2001/09/20 06:14:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/authclient.c,v 1.1.1.9 2001/10/14 18:05:03 hartmans Exp $");
 
 #if defined(UKERNEL)
 #include "../afs/sysincludes.h"
@@ -45,6 +45,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/authclient.c,v 1.1.1.8 2001/09/20
 #include <sys/socket.h>
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/rxkad.h>
 #include <afs/cellconfig.h>
 #include <ubik.h>
index 1c61bb92524910242ca15a57e06597d19851feb9..6bc68eb232ad59d7f19badb2d10b5dc0480442aa 100644 (file)
@@ -14,7 +14,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/client.c,v 1.1.1.7 2001/09/20 06:14:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/client.c,v 1.1.1.8 2001/10/14 18:05:03 hartmans Exp $");
 
 #if defined(UKERNEL)
 #include "../afs/sysincludes.h"
@@ -37,6 +37,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/client.c,v 1.1.1.7 2001/09/20 06:
 #include <winsock2.h>
 #include <crypt.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <afs/cellconfig.h>
 #include <afs/auth.h>
 #include <afs/afsutil.h>
index e556e9c8950544f03fb864db25f79de493eca6e0..69402c0b5a98e393cf362a25a4a38f87a2c7e580 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/decode_ticket.c,v 1.1.1.5 2001/09/20 06:14:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/decode_ticket.c,v 1.1.1.6 2001/10/14 18:05:04 hartmans Exp $");
 
 #include <des.h>
 #include <afs/com_err.h>
index 3749ae79debf4db90d7f49104ed066817d6dc662..882327e2911c5e443676405ba1a7de33f4482113 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kaauxdb.c,v 1.1.1.5 2001/09/20 06:14:56 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kaauxdb.c,v 1.1.1.6 2001/10/14 18:05:05 hartmans Exp $");
 
-#include <fcntl.h>
 #ifdef AFS_NT40_ENV
-#include <fcntl.h>
 #include <io.h>
 #else
 #include <sys/file.h>
 #endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/rxkad.h>
 #include "ubik_int.h"
 #include "kauth.h"
index 5ac1ccca84de7c8b071fb8fe7bf15f03f1412644..b9eb44b820d1039d31a2c708fa3f1ac4488281c8 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.5 2001/09/11 14:32:54 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kadatabase.c,v 1.1.1.6 2001/10/14 18:05:05 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -18,6 +18,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kadatabase.c,v 1.1.1.5 2001/09/11
 #else
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <lock.h>
 #include <ubik.h>
 #include <rx/xdr.h>
index eae106727c9dd0034c25e789bb362df1a4d92d04..f0174bc1d2ebaa5f8d17882b8854bc223c37aae3 100644 (file)
@@ -14,7 +14,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kalocalcell.c,v 1.1.1.5 2001/07/14 22:22:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kalocalcell.c,v 1.1.1.6 2001/10/14 18:05:05 hartmans Exp $");
 
 #if defined(UKERNEL)
 #include "../afs/pthread_glock.h"
@@ -36,6 +36,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kalocalcell.c,v 1.1.1.5 2001/07/1
 #else
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <afs/cellconfig.h>
 #include <rx/xdr.h>
 #include <rx/rx.h>
index a96da2d9f0ca249f06719b06f6d53f8db7af729d..2d89e616f2cc6339d994a1981026ffbecc31fe65 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kalog.c,v 1.1.1.4 2001/07/14 22:22:10 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kalog.c,v 1.1.1.5 2001/10/14 18:05:06 hartmans Exp $");
 
 #include <stdio.h>
 #include <afs/afsutil.h>
-#ifndef AFS_NT40_ENV
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
 #include <strings.h>
 #endif
+#endif
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif
 #include <sys/types.h>
 #include <time.h>
 #include <signal.h>
index 7c9cd31e55dc810b4d1c93abcfbbbfcdb9d96435..1434f5614b18e6f250ad5e2bbbeaa4d06b6a4a0b 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.8 2001/09/20 06:14:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kaprocs.c,v 1.1.1.9 2001/10/14 18:05:06 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <errno.h>
index 4e3c40cae886fd15218e72637cacfca230eb8bf6..e802d22b0e58d0023aa5ad8c7a8063c4071a57b6 100644 (file)
@@ -11,7 +11,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kas.c,v 1.1.1.5 2001/09/20 06:14:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kas.c,v 1.1.1.6 2001/10/14 18:05:06 hartmans Exp $");
 
 #include <afs/stds.h>
 #ifdef AFS_AIX32_ENV
@@ -28,6 +28,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kas.c,v 1.1.1.5 2001/09/20 06:14:
 #else
 #include <WINNT/afsevent.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <afs/cellconfig.h>
 #include <afs/com_err.h>
 
index be036dfaa4cadbe4dd98b856cfce7a246847c93b..d5416cc0f5d062b6e2c293506f1b3601483115a5 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kaserver.c,v 1.1.1.8 2001/09/20 06:14:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kaserver.c,v 1.1.1.9 2001/10/14 18:05:07 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
-#include <fcntl.h>
 #include <winsock2.h>
 #include <WINNT/afsevent.h>
 #else
@@ -26,6 +25,16 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kaserver.c,v 1.1.1.8 2001/09/20 0
 #include "kalog.h"           /* for OpenLog() */
 #include <time.h>
 #include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
 #ifdef AFS_AIX32_ENV
 #include <signal.h>
 #endif
index 199f389e7d24c2e027a85dcf1fb7feba836979b8..35c6bea6878ecfdcef482cac7ffa6046acffd3a2 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.6 2001/09/11 14:32:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kautils.c,v 1.1.1.7 2001/10/14 18:05:07 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
@@ -21,6 +21,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kautils.c,v 1.1.1.6 2001/09/11 14
 #include <netinet/in.h>
 #include <sys/file.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <time.h>
 #include <stdio.h>
 #include <ctype.h>
index d225d105efc5a0cc7d1d2bd88fac8aa35ab99a36..e685b64d7a1bb9a9dfc4191b925e1455251959e7 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.5 2001/09/11 14:32:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/klog.c,v 1.1.1.6 2001/10/14 18:05:08 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
@@ -18,6 +18,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/klog.c,v 1.1.1.5 2001/09/11 14:32
 #ifdef AFS_AIX32_ENV
 #include <signal.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 
 #include <lock.h>
 #include <ubik.h>
index f96c02530193976dbe411572afd450f12cfc42fb..47282bd076bd56af0acd01c30a4c2d78079e3cf2 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.7 2001/09/20 06:15:00 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/klogin.c,v 1.1.1.8 2001/10/14 18:05:08 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_XBSD_ENV)
 #include <sys/param.h>
index 1fe1e3c390e65e4b5aa397be535ba6618f622ce5..28070e6f466d17a034949a70dfe0e45637087a83 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.6 2001/09/11 14:33:00 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kpasswd.c,v 1.1.1.7 2001/10/14 18:05:09 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
@@ -28,6 +28,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kpasswd.c,v 1.1.1.6 2001/09/11 14
 #ifndef AFS_NT40_ENV
 #include <pwd.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <signal.h>
 #include <afs/com_err.h>
 #include <afs/auth.h>
@@ -240,8 +247,10 @@ CommandProc (as, arock)
     code = ka_Init(0);
     if (code ||
        !(lcell = ka_LocalCell())) {
+#ifndef AFS_FREELANCE_CLIENT
        if (!Pipe) com_err (rn, code , "Can't get local cell name!");
        exit (1);
+#endif
     }
 
     code = rx_Init(0);
@@ -346,7 +355,15 @@ CommandProc (as, arock)
        memset(as->parms[aNEWPASSWORD].items->data, 0, strlen(as->parms[aNEWPASSWORD].items->data));
     }
 
+#ifdef AFS_FREELANCE_CLIENT
+    if (!foundExplicitCell && !lcell) {
+       if (!Pipe) com_err (rn, code, "no cell name provided");
+        exit(1);
+    }
+#else
     if (!foundExplicitCell) strcpy (realm, lcell);
+#endif /* freelance */
+    
     if (code = ka_CellToRealm (realm, realm, &local)) {
        if (!Pipe) com_err (rn, code, "Can't convert cell to realm");
        exit (1);
index 110c55a9af07ebcfb8e18113927ebeaed1fb1a15..0c080f239b4bf0615f07bf197a5ed872b2b8e0d7 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kpwvalid.c,v 1.1.1.4 2001/07/14 22:22:15 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kpwvalid.c,v 1.1.1.5 2001/10/14 18:05:10 hartmans Exp $");
 
 #include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #ifdef AFS_NT40_ENV
 #include <WINNT/afsevent.h>
 #endif
index ae8d0e392fcb784b3aee83cbf4233573140613a5..7ed601194729f5e6e24d5bcfc7dd7aa1b3a6b8c2 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/krb_tf.c,v 1.1.1.4 2001/07/14 22:22:16 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/krb_tf.c,v 1.1.1.5 2001/10/14 18:05:10 hartmans Exp $");
 
-#ifdef AFS_NT40_ENV
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif
+#ifdef AFS_NT40_ENV
 #include <io.h>
 #else
 #include <sys/file.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <sys/types.h>
 #include <rx/xdr.h>
 #include <errno.h>
index bf9093cc793ed411056f01edbbda16ba60937744..1c08816573c280dfadc55ca649a001a45e664a44 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.10 2001/09/20 06:15:00 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/krb_udp.c,v 1.1.1.11 2001/10/14 18:05:10 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
@@ -27,6 +27,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/krb_udp.c,v 1.1.1.10 2001/09/20 0
 #include <netdb.h>
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <afs/afsutil.h>
 #include <time.h>
 #include <afs/com_err.h>
index f33baa1c06b0f10b7cc70064ea8330771e649e4a..fba15773da047f61f04a33dd5565ee0140f8e858 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.8 2001/09/20 06:15:01 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/rebuild.c,v 1.1.1.9 2001/10/14 18:05:11 hartmans Exp $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -22,6 +22,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/rebuild.c,v 1.1.1.8 2001/09/20 06
 #include <sys/file.h>
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <stdio.h>
 #include <errno.h>
 #include <time.h>
index 114aea84b9e1c86424edb8c507ee8190e8e39a20..847820a1809fade00c29440f319937455422d9b6 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.6 2001/09/20 06:15:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/test/test_getticket.c,v 1.1.1.7 2001/10/14 18:05:13 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
index f2c0c22e1a098435930fdcb8d6283a0a71216c03..28de2fa1c31508cda9a6ea2e024926ee9f523811 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.6 2001/09/20 06:15:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/test/test_interim_ktc.c,v 1.1.1.7 2001/10/14 18:05:13 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <afs/com_err.h>
index 7387e002e614d5696443e9cc1ea8eca8bbdfa8a4..b88116787f3b54f553e2a6ee6b3c476c6c731693 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.6 2001/09/20 06:15:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/test/test_rxkad_free.c,v 1.1.1.7 2001/10/14 18:05:13 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
index 14598411eeee10636aaa28d5372fd83dfa684b80..ec3562e079aaf1908481bf0aaca709838586c9e9 100644 (file)
@@ -18,7 +18,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/token.c,v 1.1.1.5 2001/09/20 06:15:01 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/token.c,v 1.1.1.6 2001/10/14 18:05:11 hartmans Exp $");
 
 #if defined(UKERNEL)
 #include "../afs/sysincludes.h"
@@ -43,6 +43,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/token.c,v 1.1.1.5 2001/09/20 06:1
 #include <sys/socket.h>
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 /* netinet/in.h and cellconfig.h  are needed together */
 #include <afs/cellconfig.h>
     /* these are needed together */
index 668bfd578ee6a02e4b479059fed1a09321110df2..4f27a35f39fb659f71fff59dc3e5d88f24c949af 100644 (file)
@@ -17,7 +17,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/user.c,v 1.1.1.8 2001/09/20 06:15:02 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/user.c,v 1.1.1.9 2001/10/14 18:05:11 hartmans Exp $");
 
 #if defined(UKERNEL)
 #include "../afs/sysincludes.h"
@@ -44,6 +44,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/user.c,v 1.1.1.8 2001/09/20 06:15
 #else
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <afs/cellconfig.h>
 #include <afs/auth.h>
 #include <afs/ptint.h>
index 1efc0e72d082a09144c5d0d5dbc168b8ee82ff1b..6fc0ab1f915d273a795cda3df2c4a74594afee43 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.6 2001/09/11 14:33:02 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/user_nt.c,v 1.1.1.7 2001/10/14 18:05:12 hartmans Exp $");
 
 #include <afs/stds.h>
 
@@ -96,6 +96,7 @@ afs_int32 ka_UserAuthenticateGeneral(
        char fullRealm[256];
        char upperRealm[256];
        struct servent *sp;
+       int ttl;
 
        struct ktc_principal server;
        struct ktc_principal client;
@@ -106,6 +107,11 @@ afs_int32 ka_UserAuthenticateGeneral(
 
        code = cm_SearchCellFile(realm, fullRealm, ka_AddHostProc, NULL);
 
+#ifdef AFS_AFSDB_ENV
+       if (code) {
+         code = cm_SearchCellByDNS(realm, fullRealm, &ttl, ka_AddHostProc, NULL);
+        }
+#endif
        if (code) {
                *reasonP = "specified realm is unknown";
                return (code);
@@ -310,24 +316,27 @@ static check_response
     ptr = (char *) cip->dat + 8;
 
     /* Check and extract server's name */
-    if ((strlen(ptr) + (ptr - (char *) cip->dat)) > cip->length)
+    if ((strlen(ptr) + (ptr - (char *) cip->dat)) > cip->length) {
        return(INTK_BADPW);
+    }
 
     (void) strncpy(s_service, ptr, sizeof(s_service)-1);
     s_service[sizeof(s_service)-1] = '\0';
     ptr += strlen(s_service) + 1;
 
     /* Check and extract server's instance */
-    if ((strlen(ptr) + (ptr - (char *) cip->dat)) > cip->length)
+    if ((strlen(ptr) + (ptr - (char *) cip->dat)) > cip->length) {
        return(INTK_BADPW);
+    }
 
     (void) strncpy(s_instance,ptr, sizeof(s_instance)-1);
     s_instance[sizeof(s_instance)-1] = '\0';
     ptr += strlen(s_instance) + 1;
 
     /* Check and extract server's realm */
-    if ((strlen(ptr) + (ptr - (char *) cip->dat)) > cip->length)
+    if ((strlen(ptr) + (ptr - (char *) cip->dat)) > cip->length) {
        return(INTK_BADPW);
+    }
 
     (void) strncpy(s_realm,ptr, sizeof(s_realm));
     s_realm[sizeof(s_realm)-1] = '\0';
@@ -340,8 +349,9 @@ static check_response
     ticket_len = (unsigned char) *ptr++;
     
     if ((ticket_len < 0) ||
-       ((ticket_len + (ptr - (char *) cip->dat)) > (int) cip->length))
+       ((ticket_len + (ptr - (char *) cip->dat)) > (int) cip->length)) {
        return(INTK_BADPW);
+    }
 
     /* Check returned server name, instance, and realm fields */
     /*
index 37eba242409bcac8a88b06a79f90b08c6863928d..a84c4c7ddf2a6d95d9fb3abdd95d8f667dbac292 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.7 2001/09/20 06:15:05 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/libacl/aclprocs.c,v 1.1.1.8 2001/10/14 18:05:15 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
index d792c2e258bf9631a94050e197be0b7a44572f77..469e8935965ce62ffa2a9c7774bfee2f8cdc78fc 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/adminutil/afs_utilAdmin.c,v 1.1.1.6 2001/09/20 06:15:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/adminutil/afs_utilAdmin.c,v 1.1.1.7 2001/10/14 18:05:28 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <afs/afs_Admin.h>
index f63a8840cd9984f4d202b343612353679b4f3810..282329d4a0b7c702c16e768933a811bcb5760c6f 100644 (file)
@@ -1,7 +1,16 @@
-MODLOAD-2.4.7-ac3-MP
-MODLOAD-2.4.7-ac3-SP
+MODLOAD-*
+MODLOAD32
+MODLOAD64
 Makefile
+MakefileProto.AIX
+MakefileProto.DARWIN
+MakefileProto.DUX
+MakefileProto.FBSD
+MakefileProto.HPUX
+MakefileProto.IRIX
 MakefileProto.LINUX
+MakefileProto.OBSD
+MakefileProto.SOLARIS
 afs
 afsint
 config
index f4d95f5a1e870325590bfc619acd9f45e0bb8695..9b4080876b35553d6374764f9dd203cb28d8ab48 100644 (file)
@@ -1,5 +1,5 @@
 #/* Copyright (C) 1995, 1989 Transarc Corporation - All rights reserved */
-# $Header: /tmp/cvstemp/openafs/src/libafs/MakefileProto.DARWIN.in,v 1.1.1.3 2001/09/20 06:15:23 hartmans Exp $
+# $Header: /tmp/cvstemp/openafs/src/libafs/MakefileProto.DARWIN.in,v 1.1.1.4 2001/10/14 18:05:40 hartmans Exp $
 # 
 # MakefileProto for Digital Unix systems
 #
@@ -47,14 +47,12 @@ AFS_OS_NONFSOBJS = osi_vfsops.o
 
 # System specific build commands and flags
 KDEFS=
-DBUG = -g
+DBUG = 
 DEFINES= -D_KERNEL -DKERNEL -DKERNEL_PRIVATE -DDIAGNOSTIC -DUSE_SELECT -DMACH_USER_API -DMACH_KERNEL
-OPTF=${OPT} 
-OPTF2=${OPT2} 
-KOPTS=-traditional-cpp -static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch 
+KOPTS=-no-precomp -static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch 
 #CFLAGS=-Werror-implicit-function-declaration -I. -I.. ${KINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
 #CFLAGS=-framework Kernel -I. -I.. ${KINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
-CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${KINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
+CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${KINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG} ${OPTMZ}
 
 
 # Name of directory to hold object files and libraries.
index 67e3c39088225584536f4da0ff958066f75ec413..ef84b2263657274b421cd949d747d98dba1e8649 100644 (file)
@@ -87,7 +87,7 @@ setup:
 LIBAFS = libafs.o
 LIBAFSNONFS = libafs.nonfs.o
 
-INST_LIBAFS ${DESTDIR}${afskerneldir}/${LIBAFS}
+INST_LIBAFS ${DESTDIR}${afskerneldir}/${LIBAFS}
 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
 
 DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
index 33864289d496081d35972f5396653b2f9ebdea88..afc4dbb5951bb5a1c3ba2ef4acc682c601439134 100644 (file)
@@ -52,7 +52,7 @@ DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
 KDEFS= -Dsun4c -DSUN4C_60 -DNFSCLIENT -DSYSACCT -DOLDSCSI -DVDDRV -D_KERNEL \
        -DSYSV -dn ${ARCH_DEFS}
 
-<sun4x_57 sun4x_58>
+<sun4x_57 sun4x_58 sun4x_59>
 KDEFS_32 = 
 KDEFS_64 = -xarch=v9
 
@@ -60,19 +60,19 @@ KDEFS_64 = -xarch=v9
 CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
 
 # Name of directory to hold object files and libraries.
-<all -sun4x_57 -sun4x_58>
+<all -sun4x_57 -sun4x_58 -sun4x_59>
 KOBJ = MODLOAD
-<sun4x_57 sun4x_58>
+<sun4x_57 sun4x_58 sun4x_59>
 KOBJ = MODLOAD32 MODLOAD64
 
 
 # This tells Makefile.common to use it's single directory build target.
-<all -sun4x_57 -sun4x_58>
+<all -sun4x_57 -sun4x_58 -sun4x_59>
 COMPDIRS = single_compdir
 INSTDIRS = single_instdir
 DESTDIRS = single_destdir
 
-<sun4x_57 sun4x_58>
+<sun4x_57 sun4x_58 sun4x_59>
 COMPDIRS = solaris_compdirs
 INSTDIRS = solaris_instdirs
 DESTDIRS = solaris_destdirs
@@ -104,7 +104,7 @@ setup:
 ## This is the target for a Solaris 7. Here we build both the 32 bit and
 ## the 64 bit libafs in MODLOAD32 and MODLOAD64 directories respectively
 
-<sun4x_57 sun4x_58>
+<sun4x_57 sun4x_58 sun4x_59>
 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
        for t in ${KOBJ} ; do \
                echo Building directory: $$t ; \
@@ -133,7 +133,7 @@ solaris_destdirs_libafs: dest_libafs
 LIBAFS = libafs.o
 LIBAFSNONFS = libafs.nonfs.o
 
-<all -sun4x_57 -sun4x_58>
+<all -sun4x_57 -sun4x_58 -sun4x_59>
 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
 
@@ -169,7 +169,7 @@ ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
        $(RM) -f $@
        $(LD) -r -o $@  $(AFSAOBJS) ${AFSNONFSOBJS}
 
-<sun4x_57 sun4x_58>
+<sun4x_57 sun4x_58 sun4x_59>
 
 libafs: ${LIBAFSNONFS}
 
index 4182a212b0458d2bbf8ba4e820abc8760adb7410..c739b875408bba4353d3cdb784cafc8e50b8e681 100644 (file)
@@ -90,6 +90,7 @@ DLLOBJS =\
        $(SYSOBJS) \
        $(WINNTAFSDOBJS) \
        $(AUDITOBJS) \
+       $(DESTDIR)\lib\cm_dns.obj \
        afsauthent.res
 
 audit.obj: $(AUDIT)\audit.c
@@ -231,4 +232,4 @@ install: $(LIBFILE)
 install9x: install
 
 clean ::
-       $(DEL) $(LIBFILE)
\ No newline at end of file
+       $(DEL) $(LIBFILE)
index bb8fe04cc9566a9293d528d3dd116a53f16dbfd9..00a930380c55718465f327e614ecdec6f6b23448 100644 (file)
@@ -63,6 +63,7 @@ UAFSOBJ = \
        $(UOBJ)/afs_daemons.o   \
        $(UOBJ)/afs_dcache.o \
        $(UOBJ)/afs_dir.o               \
+       $(UOBJ)/afs_dynroot.o \
        $(UOBJ)/afs_init.o \
        $(UOBJ)/afs_lock.o      \
        $(UOBJ)/afs_mariner.o \
@@ -179,6 +180,7 @@ AFSWEBOBJ = \
        $(WEBOBJ)/afs_daemons.o \
        $(WEBOBJ)/afs_dcache.o \
        $(WEBOBJ)/afs_dir.o \
+       $(WEBOBJ)/afs_dynroot.o \
        $(WEBOBJ)/afs_init.o \
        $(WEBOBJ)/afs_lock.o \
        $(WEBOBJ)/afs_mariner.o \
@@ -297,6 +299,7 @@ AFSWEBOBJKRB = \
        $(WEBOBJ)/afs_daemons.o \
        $(WEBOBJ)/afs_dcache.o \
        $(WEBOBJ)/afs_dir.o \
+       $(WEBOBJ)/afs_dynroot.o \
        $(WEBOBJ)/afs_init.o \
        $(WEBOBJ)/afs_lock.o \
        $(WEBOBJ)/afs_mariner.o \
@@ -417,6 +420,8 @@ $(UOBJ)/afs_conn.o: $(AFS)/afs_conn.c
        $(CRULE1);
 $(UOBJ)/afs_dcache.o: $(AFS)/afs_dcache.c
        $(CRULE1);
+$(UOBJ)/afs_dynroot.o: $(AFS)/afs_dynroot.c
+       $(CRULE1);
 $(UOBJ)/afs_init.o: $(AFS)/afs_init.c
        $(CRULE1);
 $(UOBJ)/afs_mariner.o: $(AFS)/afs_mariner.c
@@ -660,6 +665,8 @@ $(WEBOBJ)/afs_conn.o: $(AFS)/afs_conn.c
        $(CRULE2);
 $(WEBOBJ)/afs_dcache.o: $(AFS)/afs_dcache.c
        $(CRULE2);
+$(WEBOBJ)/afs_dynroot.o: $(AFS)/afs_dynroot.c
+       $(CRULE2);
 $(WEBOBJ)/afs_init.o: $(AFS)/afs_init.c
        $(CRULE2);
 $(WEBOBJ)/afs_mariner.o: $(AFS)/afs_mariner.c
index 967267fe5307932ef22b41e3d69806cc980961e0..be2903a9eaf9959243a3c4038fc89fc93237d8ab 100644 (file)
@@ -44,7 +44,7 @@ AFSLIBS =  ${TOP_LIBDIR}/libkauth.a ${TOP_LIBDIR}/libprot.a \
           ${TOP_LIBDIR}/librxkad.a ${TOP_LIBDIR}/libsys.a \
           ${TOP_LIBDIR}/libdes.a ${TOP_LIBDIR}/librx.a \
           ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/libcmd.a \
-          ${TOP_LIBDIR}/afs/libcom_err.a ${TOP_LIBDIR}/afs/util.a
+          ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/util.a
 
 KAFSLIBS = ${TOP_LIBDIR}/libkauth.krb.a ${TOP_LIBDIR}/libprot.a \
           ${TOP_LIBDIR}/libubik.a ${TOP_LIBDIR}/libauth.krb.a \
index 17e4e4562adec31d81814de2ac230a5134556a81..2a529c2e40c0071272d67db7228680198577c75a 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.9 2001/09/20 06:15:32 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/waitkey.c,v 1.1.1.10 2001/10/14 18:05:48 hartmans Exp $");
 
 #include <stdio.h>
 #include <sys/types.h>
index f3c7a7c5da68804a1bdf391127ba34aed33c3cca..c6c769e386f589604d0ca4286782cfd572dea0ae 100644 (file)
@@ -1 +1,2 @@
+AFS_component_version_number.c
 Makefile
index be05fada2cb1e2eeddb99a69322cd79cab9073bb..044b6ea063b73e9bf385310d72e7147a2e95e0d8 100644 (file)
@@ -17,7 +17,7 @@
 #include <afs/param.h>
 #include <sys/wait.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_util.c,v 1.1.1.5 2001/09/11 14:34:02 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/pam/afs_util.c,v 1.1.1.6 2001/10/14 18:06:06 hartmans Exp $");
 
 #include "afs_util.h"
 
@@ -61,11 +61,12 @@ sigvec(int sig, const struct sigvec* vec, struct sigvec* ovec)
 {
        assert(0);
 }
-#endif  /* AFS_HPUX110_ENV */
+
 sigsetmask(int mask)
 {
        assert(0);
 }
+#endif  /* AFS_HPUX110_ENV */
 
 /* converts string to integer */
 
index 9d06ea8baa3ba4d958edfd35d9ac5fc64900a9a0..6099b3a59406a0cbfdbfaf7bc07b5cf997dfc565 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.7 2001/09/20 06:15:51 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/pinstall/install.c,v 1.1.1.8 2001/10/14 18:06:07 hartmans Exp $");
 
 #include <stdio.h>
 #include <pwd.h>
@@ -81,6 +81,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/pinstall/install.c,v 1.1.1.7 2001/09/20
 #include <unistd.h>
 #include <string.h>
 #include <sys/wait.h>
+#include <stdlib.h>
 
 struct stat istat, ostat;
 
index f476a0aae818c6d934d2c642ae5a932992d00c97..6ae1e7874c12b75af17c05e33b7226f00c9608c7 100644 (file)
@@ -16,3 +16,4 @@ ptserver
 readgroup
 readpwd
 testpt
+ptclient
index 02ea65629cda6b966b897408dd8d535ff4a9e893..1e277f057a04f757d6584d3b52bdc5ab359b84ae 100644 (file)
@@ -65,7 +65,8 @@ PTSERVER_EXELIBS =\
        $(DESTDIR)\lib\afs\afsutil.lib \
        $(DESTDIR)\lib\afs\afsaudit.lib \
        $(DESTDIR)\lib\afs\afseventlog.lib \
-       $(DESTDIR)\lib\afs\afsreg.lib
+       $(DESTDIR)\lib\afs\afsreg.lib \
+       $(DESTDIR)\lib\cm_dns.obj
 
 !IF (("$(SYS_NAME)"!="i386_win95" ) && ("$(SYS_NAME)"!="I386_WIN95" ))
 PTSERVER_EXELIBS =$(PTSERVER_EXELIBS) $(DESTDIR)\lib\afs\afsprocmgmt.lib
@@ -100,7 +101,8 @@ PTS_EXELIBS =\
        $(DESTDIR)\lib\afs\afscmd.lib \
        $(DESTDIR)\lib\afs\afsreg.lib \
        $(DESTDIR)\lib\afs\afseventlog.lib \
-       $(DESTDIR)\lib\afs\afspioctl.lib
+       $(DESTDIR)\lib\afs\afspioctl.lib \
+       $(DESTDIR)\lib\cm_dns.obj
 
 $(PTS): $(PTS_EXEOBJS) $(PTS_EXELIBS) 
        $(EXECONLINK)
index d40f9426fd4562d36020075dbe6d825905e2ad70..004354ec1bbedf2534b9f57491ac95a805f8e1fc 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.7 2001/09/20 06:15:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/db_verify.c,v 1.1.1.8 2001/10/14 18:06:10 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
@@ -26,6 +26,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/db_verify.c,v 1.1.1.7 2001/09/
 #include <sys/file.h>
 #endif
 #include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <errno.h>
 #include <fcntl.h>
 #include <afs/cellconfig.h>
index 1e3fe5f23acc0f4a5d2bb45408d0b868207fffc6..13c4030a4b635478137330c08f712ed6c358b509 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/display.c,v 1.1.1.5 2001/09/20 06:15:55 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/display.c,v 1.1.1.6 2001/10/14 18:06:10 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
index cc9dda4c55c8fc3cfa3b2092f81b7a70ca1f7d6c..8d4de394fbdbe7a196e90b87ff4bf0bd3a43f076 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.6 2001/09/20 06:15:56 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptclient.c,v 1.1.1.7 2001/10/14 18:06:11 hartmans Exp $");
 
 #ifdef AFS_AIX32_ENV
 #include <signal.h>
@@ -22,6 +22,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptclient.c,v 1.1.1.6 2001/09/2
 #else
 #include <netinet/in.h>
 #endif
+#include <netdb.h>
 #include <stdio.h>
 #include <rx/xdr.h>
 #include <rx/rx.h>
@@ -163,6 +164,8 @@ char **argv;
     prlist alist;
     idlist lid;
     namelist lnames;
+    struct hostent *hostinfo;
+    struct in_addr *hostaddr;
     afs_int32 *ptr;
     char *foo;
     afs_int32 over;
@@ -404,6 +407,31 @@ char **argv;
                alist.prlist_val = 0;
            }
        }
+       else if (!strcmp(op,"lh")) {
+           alist.prlist_len = 0;
+           alist.prlist_val = 0;
+           /* scanf("%d",&id); */
+           if (GetString(name, sizeof(name))) code = PRBADARG;
+           else if (!(hostinfo = gethostbyname(name))) code = PRBADARG;
+           else {
+               hostaddr = hostinfo->h_addr_list[0];
+               id = ntohl(hostaddr->s_addr);
+               code = ubik_Call(PR_GetHostCPS,pruclient,0,id, &alist, &over);
+           }
+           if (CodeOk(code)) printf("%s\n",pr_ErrorMsg(code));
+           if (code == PRSUCCESS) {
+               ptr = alist.prlist_val;
+               if (over) {
+                   printf("Number of groups greater than PR_MAXGROUPS!\n");
+                   printf("Excess of %d.\n",over);
+               }
+               for (i=0;i<alist.prlist_len;i++,ptr++)
+                   printf("%d\n",*ptr);
+               free(alist.prlist_val);
+               alist.prlist_len = 0;
+               alist.prlist_val = 0;
+           }
+       }
        else if (!strcmp(op,"nu")) {
            /* scanf("%s",name); */
            if (GetString (name, sizeof(name))) code = PRBADARG;
@@ -527,6 +555,7 @@ PrintHelp()
     printf("dg gid - delete the entry for group gid.\n");
     printf("rm id gid - remove user id from group gid.\n");
     printf("l id - get the CPS for id.\n");
+    printf("lh host - get the host CPS for host.\n");
     printf("nu name - create new user with name - returns an id.\n");
     printf("ng name - create new group with name - returns an id.\n");
     printf("lm  - list max user id and max (really min) group id.\n");
index 964731e3a557d6df082a89fbf79f6a8970fce316..398f5d5c73d21eddb1fd534c2572c82780e168fc 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.7 2001/09/20 06:15:56 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptprocs.c,v 1.1.1.8 2001/10/14 18:06:11 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <ctype.h>
@@ -25,9 +25,15 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptprocs.c,v 1.1.1.7 2001/09/20
 #ifdef AFS_NT40_ENV 
 #include <winsock2.h>
 #else
-#include <strings.h>
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include "ptserver.h"
 #include "pterror.h"
 #include "afs/audit.h"
@@ -107,9 +113,9 @@ afs_int32 WhoIsThis (acall, at, aid)
        goto done;                      /* no longer supported */
     }
     else if (code == 2) {              /* kad class */
-       if (code = rxkad_GetServerInfo
+       if ((code = rxkad_GetServerInfo
            (acall->conn, (afs_int32 *) 0, 0/*was &exp*/,
-            name, inst, tcell, (afs_int32 *) 0))
+            name, inst, tcell, (afs_int32 *) 0)))
            goto done;
 #if 0
        /* This test is unnecessary, since rxkad_GetServerInfo already check.
@@ -1153,10 +1159,11 @@ struct prcheckentry *aentry;
         ABORT_WITH(tt,PRPERM);
 
     aentry->flags = tentry.flags >> PRIVATE_SHIFT;
-    if (aentry->flags == 0)
+    if (aentry->flags == 0) {
        if (tentry.flags & PRGRP)
            aentry->flags = PRP_GROUP_DEFAULT >> PRIVATE_SHIFT;
        else aentry->flags = PRP_USER_DEFAULT >> PRIVATE_SHIFT;
+    }
     aentry->owner = tentry.owner;
     aentry->id = tentry.id;
     strncpy(aentry->name,tentry.name,PR_MAXNAMELEN);
@@ -1635,7 +1642,7 @@ static stolower(s)
 register char *s;
 {
     register int tc;
-    while (tc = *s) {
+    while ((tc = *s)) {
        if (isupper(tc)) *s = tolower(tc);
        s++;
     }
@@ -1656,7 +1663,7 @@ afs_int32 addWildCards(tt,alist,host)
     int size = 0, i, code;
     int added = 0;
  
-    while (host = (host & wild)) {
+    while ((host = (host & wild))) {
        wild = htonl ( ntohl(wild) << 8) ;
        iaddr.s_addr = host;
        code = NameToID(tt, inet_ntoa(iaddr),&hostid);
@@ -1678,7 +1685,7 @@ afs_int32 addWildCards(tt,alist,host)
        added +=  wlist.prlist_len;
        for (i=0; i< wlist.prlist_len; i++) {
            if (!inCPS(*alist,wlist.prlist_val[i]))
-               if (code = AddToPRList (alist, &size, wlist.prlist_val[i] )) {
+               if ((code = AddToPRList (alist, &size, wlist.prlist_val[i] ))) {
                    free(wlist.prlist_val);
                    return(code);
                }
@@ -1720,17 +1727,17 @@ afs_int32 WhoIsThisWithName(acall, at, aid, aname)
        int clen;
        extern char *pr_realmName;
 
-       if (code = rxkad_GetServerInfo
+       if ((code = rxkad_GetServerInfo
            (acall->conn, (afs_int32 *) 0, 0/*was &exp*/,
-            name, inst, tcell, (afs_int32 *) 0))
+            name, inst, tcell, (afs_int32 *) 0)))
            goto done;
        strncpy (vname, name, sizeof(vname));
-       if (ilen = strlen (inst)) {
+       if ((ilen = strlen(inst))) {
            if (strlen(vname) + 1 + ilen >= sizeof(vname)) goto done;
            strcat (vname, ".");
            strcat (vname, inst);
        }
-       if (clen = strlen (tcell)){
+       if ( (clen = strlen(tcell))) {
 
 #if    defined(AFS_ATHENA_STDENV) || defined(AFS_KERBREALM_ENV)
            static char local_realm[AFS_REALM_SZ] = "";
index dfb012f77cb0492dd384b281f51b97b939f3b846..6cf408cb65e7bc1ab1727f9650357797a2cfbdd0 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/pts.c,v 1.1.1.6 2001/07/14 22:23:18 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/pts.c,v 1.1.1.7 2001/10/14 18:06:12 hartmans Exp $");
 
 #include <stdio.h>
 #include <string.h>
@@ -833,7 +833,14 @@ int main (argc, argv)
 {
     register afs_int32 code;
     register struct cmd_syndesc *ts;
+#ifdef WIN32
+    WSADATA WSAjunk;
+#endif
 
+#ifdef WIN32
+    WSAStartup(0x0101, &WSAjunk);
+#endif
+    
 #ifdef AFS_AIX32_ENV
     /*
      * The following signal action for AIX is necessary so that in case of a 
index 3029ccf45a5a5e144f56bd188979a7bf90a0080d..e739808bd9e11c6b978e9122e70a6baecf5617a9 100644 (file)
@@ -14,7 +14,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptuser.c,v 1.1.1.7 2001/09/20 06:15:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptuser.c,v 1.1.1.8 2001/10/14 18:06:13 hartmans Exp $");
 
 #if defined(UKERNEL)
 #include "../afs/sysincludes.h"
@@ -39,6 +39,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptuser.c,v 1.1.1.7 2001/09/20
 #include <netinet/in.h>
 #endif
 #include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/rx.h>
 #include <rx/xdr.h>
 #include <rx/rxkad.h>
index 2d584910f4b892a6cfc7d38498d8021e12d1d61c..401c471daf5c295ffb5414017dd9b9c9ecbeccd8 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.8 2001/09/11 14:34:08 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptutils.c,v 1.1.1.9 2001/10/14 18:06:13 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
@@ -19,8 +19,14 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptutils.c,v 1.1.1.8 2001/09/11
 #include <winsock2.h>
 #else
 #include <netinet/in.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
 #include <strings.h>
 #endif
+#endif
 #include <lock.h>
 #include <ubik.h>
 #include <rx/xdr.h>
@@ -104,7 +110,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 = strchr(tentry.name, ':')) *prefix = 0;
+           if ((prefix = strchr(tentry.name, ':'))) *prefix = 0;
        }
        prefix = tentry.name;
     }
@@ -126,7 +132,7 @@ static afs_int32 CorrectGroupName (ut, aname, cid, oid, cname)
     }
   done:
     /* check for legal name with either group rules or user rules */
-    if (suffix = strchr(cname, ':')) {
+    if ((suffix = strchr(cname, ':'))) {
        /* check for confusing characters */
        if (strchr(cname, '\n') ||      /* restrict so recreate can work */
            strchr(suffix+1, ':'))      /* avoid multiple colons */
@@ -156,11 +162,12 @@ int AccessOK (ut, cid, tentry, mem, any)
     } else {
        flags = oid = aid = 0;
     }
-    if (!(flags & PRACCESS))           /* provide default access */
+    if (!(flags & PRACCESS)) {         /* provide default access */
        if (flags & PRGRP)
            flags |= PRP_GROUP_DEFAULT;
        else
            flags |= PRP_USER_DEFAULT;
+    }
 
     if (flags & any) return 1;
     if (oid) {
@@ -622,7 +629,7 @@ afs_int32 AddToEntry (tt, entry, loc, aid)
     afs_int32 nptr;
     afs_int32 last;                            /* addr of last cont. block */
     afs_int32 first = 0;
-    afs_int32 cloc;
+    afs_int32 cloc = 0;
     afs_int32 slot = -1;
 
     if (entry->id == aid) return PRINCONSISTENT;
@@ -796,7 +803,7 @@ afs_int32 GetList2 (at, tentry, tentry2 , alist, add)
   prlist *alist;
   afs_int32 add;
 {
-    afs_int32 code;
+    afs_int32 code = 0;
     afs_int32 i;
     struct contentry centry;
     afs_int32 nptr;
index 54b8e1920b247bd815a162bb44641db3026764f2..0cf8bc2207cecdd9e3d7cdd8452e3c4bcaa4ab2d 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/readgroup.c,v 1.1.1.6 2001/09/20 06:15:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/readgroup.c,v 1.1.1.7 2001/10/14 18:06:13 hartmans Exp $");
 
 #include <stdio.h>
-#ifndef AFS_NT40_ENV
-#include <strings.h>
-#else
+#ifdef AFS_NT40_ENV
 #include <WINNT/afsevent.h>
 #endif
 #include <ctype.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/rx.h>
 #include <rx/xdr.h>
 #include <afs/cellconfig.h>
index 0fc6336159c1c5eaa72f4666b7838e8799b5adc4..5b69846d73599f732fca6ebc06f3b449be676b73 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/readpwd.c,v 1.1.1.5 2001/09/11 14:34:09 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/readpwd.c,v 1.1.1.6 2001/10/14 18:06:13 hartmans Exp $");
 
 #include <stdio.h>
-#ifndef AFS_NT40_ENV
-#include <strings.h>
-#else
+#ifdef AFS_NT40_ENV
 #include <WINNT/afsevent.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/rx.h>
 #include <rx/xdr.h>
 #include <afs/cellconfig.h>
index 7b9cdef0356f1bc6eef1009e022c25546f7e4c68..4957bace138d4d3d47b987b78b066d2935d28c24 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.7 2001/09/20 06:15:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/testpt.c,v 1.1.1.8 2001/10/14 18:06:14 hartmans Exp $");
 
 #include <ctype.h>
 #include <errno.h>
@@ -23,6 +23,22 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/testpt.c,v 1.1.1.7 2001/09/20
 #include <netdb.h>
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
 #include <rx/rx.h>
 #include <rx/xdr.h>
 #include <afs/rxgen_consts.h>
index a9b441e61911fadfbeddd5a5b2ac3148b788f677..bb469ab24c51160023a142037beb1010a5937a4f 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.7 2001/09/20 06:15:59 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/utils.c,v 1.1.1.8 2001/10/14 18:06:15 hartmans Exp $");
 
 #include <sys/types.h>
 #include <lock.h>
@@ -22,6 +22,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/utils.c,v 1.1.1.7 2001/09/20 0
 #include <netinet/in.h>
 #include <netdb.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include "ptserver.h"
 #include "pterror.h"
 
index 44493d2b33931822430bffa9a7a55ea54341fd5d..045415b1d6b3bc63a88e9c92ef11753767659ab7 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.5 2001/09/11 14:34:31 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/IRIX/rx_knet.c,v 1.1.1.6 2001/10/14 18:06:27 hartmans Exp $");
 
 #include "../rx/rx_kcommon.h"
 #include "../h/tcp-param.h"
@@ -324,7 +324,6 @@ struct ifnet * rxi_FindIfnet(addr, pifad)
 {
   afs_uint32 ppaddr;
   int match_value = 0;
-  struct hashbucket *slop;
 
   if (numMyNetAddrs == 0)
     (void) rxi_GetIFInfo();
@@ -332,15 +331,13 @@ struct ifnet * rxi_FindIfnet(addr, pifad)
   ppaddr = ntohl(addr);
   *pifad = (struct in_ifaddr*)&hashinfo_inaddr;
 
-  slop = hash_enum(&hashinfo_inaddr, rxi_MatchIfnet, HTF_INET,
+  (void) hash_enum(&hashinfo_inaddr, rxi_MatchIfnet, HTF_INET,
                   (caddr_t)&ppaddr, (caddr_t)&match_value, (caddr_t)pifad);
-
-  if (slop)
-      return ((struct in_ifaddr*)slop)->ia_ifp;
+   
+  if (match_value)
+      return (*pifad)->ia_ifp;
   else
       return NULL;
-
-      
 }
 
 static int rxi_EnumGetIfInfo(struct hashbucket *h, caddr_t key, caddr_t arg1,
index c567ba49aed3957ff595a9d1a5b2e143eea73d08..13a46ec9a20a5b62e8d13e796312255b6dd9859f 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.6 2001/09/11 14:34:32 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/SOLARIS/rx_knet.c,v 1.1.1.7 2001/10/14 18:06:27 hartmans Exp $");
 
 #ifdef AFS_SUN5_ENV
 #include "../rx/rx_kcommon.h"
@@ -27,8 +27,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rx/SOLARIS/rx_knet.c,v 1.1.1.6 2001/09/
 #include "../sys/fcntl.h"
 #ifdef AFS_SUN58_ENV
 #include "../netinet/ip6.h"
+#define ipif_local_addr ipif_lcl_addr
+#ifndef V4_PART_OF_V6
+#define V4_PART_OF_V6(v6)       v6.s6_addr32[3]
+#endif
 #endif
 #include "../inet/ip.h"
+#include "../inet/ip_if.h"
 #include "../netinet/udp.h"
 
 /*
@@ -47,9 +52,137 @@ int (*sockfs_sosendmsg)
 int (*sockfs_sosetsockopt)
     (struct sonode *, int, int, void *, int) = NULL;
 
-int rxi_GetIFInfo()
+static afs_uint32 myNetAddrs[ADDRSPERSITE];
+static int myNetMTUs[ADDRSPERSITE];
+static int numMyNetAddrs = 0;
+
+int
+rxi_GetIFInfo()
 {
-    return 0;
+    int i = 0;
+    int different = 0;
+
+    ill_t *ill;
+    ipif_t *ipif;
+    int rxmtu, maxmtu;
+
+    int mtus[ADDRSPERSITE];
+    afs_uint32 addrs[ADDRSPERSITE];
+    afs_uint32 ifinaddr;
+
+    memset(mtus, 0, sizeof(mtus));
+    memset(addrs, 0, sizeof(addrs));
+
+    for (ill = ill_g_head; ill; ill = ill->ill_next) {
+#ifdef AFS_SUN58_ENV
+       /* Make sure this is an IPv4 ILL */
+       if (ill->ill_isv6) continue;
+#endif
+
+       /* Iterate over all the addresses on this ILL */
+       for (ipif = ill->ill_ipif; ipif; ipif = ipif->ipif_next) {
+           if (i >= ADDRSPERSITE) break;
+
+           /* Ignore addresses which are down.. */
+           if (!(ipif->ipif_flags & IFF_UP)) continue;
+
+           /* Compute the Rx interface MTU */
+           rxmtu = (ipif->ipif_mtu - RX_IPUDP_SIZE);
+
+           ifinaddr = ntohl(ipif->ipif_local_addr);
+           if (myNetAddrs[i] != ifinaddr)
+               different++;
+
+           /* Copy interface MTU and address; adjust maxmtu */
+           mtus[i] = rxmtu;
+           rxmtu = rxi_AdjustIfMTU(rxmtu);
+           maxmtu = rxmtu * rxi_nRecvFrags + ((rxi_nRecvFrags-1) *
+                                              UDP_HDR_SIZE);
+           maxmtu = rxi_AdjustMaxMTU(rxmtu, maxmtu);
+           addrs[i] = ifinaddr;
+           i++;
+
+           if (ifinaddr != 0x7f000001 && maxmtu > rx_maxReceiveSize) {
+               rx_maxReceiveSize = MIN( RX_MAX_PACKET_SIZE, maxmtu);
+               rx_maxReceiveSize = MIN( rx_maxReceiveSize,
+                                        rx_maxReceiveSizeUser);
+           }
+       }
+    }
+
+    rx_maxJumboRecvSize = RX_HEADER_SIZE +
+                         rxi_nDgramPackets * RX_JUMBOBUFFERSIZE +
+                         (rxi_nDgramPackets-1) * RX_JUMBOHEADERSIZE;
+    rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize);
+
+    if (different) {
+       int j;
+
+       for (j = 0; j < i; j++) {
+           myNetMTUs[j] = mtus[j];
+           myNetAddrs[j] = addrs[j];
+       }
+    }
+
+    return different;
+}
+
+int
+rxi_FindIfMTU(addr)
+    afs_uint32 addr;
+{
+    ill_t *ill;
+    ipif_t *ipif;
+    afs_uint32 myAddr, netMask;
+    int match_value = 0;
+    int mtu = -1;
+
+    if (numMyNetAddrs == 0)
+       rxi_GetIFInfo();
+    myAddr = ntohl(addr);
+
+    if      (IN_CLASSA(myAddr)) netMask = IN_CLASSA_NET;
+    else if (IN_CLASSB(myAddr)) netMask = IN_CLASSB_NET;
+    else if (IN_CLASSC(myAddr)) netMask = IN_CLASSC_NET;
+    else                       netMask = 0;
+
+    for (ill = ill_g_head; ill; ill = ill->ill_next) {
+#ifdef AFS_SUN58_ENV
+       /* Make sure this is an IPv4 ILL */
+       if (ill->ill_isv6) continue;
+#endif
+
+       /* Iterate over all the addresses on this ILL */
+       for (ipif = ill->ill_ipif; ipif; ipif = ipif->ipif_next) {
+           afs_uint32 thisAddr, subnetMask;
+           int thisMtu;
+
+           thisAddr   = ipif->ipif_local_addr;
+           subnetMask = ipif->ipif_net_mask;
+           thisMtu    = ipif->ipif_mtu;
+
+           if ((myAddr & netMask) == (thisAddr & netMask)) {
+               if ((myAddr & subnetMask) == (thisAddr & subnetMask)) {
+                   if (myAddr == thisAddr) {
+                       match_value = 4;
+                       mtu = thisMtu;
+                   }
+
+                   if (match_value < 3) {
+                       match_value = 3;
+                       mtu = thisMtu;
+                   }
+               }
+
+               if (match_value < 2) {
+                   match_value = 2;
+                   mtu = thisMtu;
+               }
+           }
+       }
+    }
+
+    return mtu;
 }
 
 /* rxi_NewSocket, rxi_FreeSocket and osi_NetSend are from the now defunct
index 79ab60835246fb2872ab8cbba86e207342c49671..d05cae904f600df081c34e4180de61816d5a5b51 100644 (file)
@@ -224,6 +224,9 @@ returned with an error code of RX_CALL_DEAD ( transient error ) */
 #define rx_SetConnAbortThreshold(A) (rxi_connAbortThreshhold = (A))
 #define rx_SetConnAbortDelay(A) (rxi_connAbortDelay = (A))
 
+#define rx_GetCallAbortCode(call) ((call)->abortCode)
+#define rx_SetCallAbortCode(call, code) ((call)->abortCode = (code))
+
 #define cpspace(call) ((call)->curlen)
 #define cppos(call) ((call)->curpos)
 
@@ -291,7 +294,7 @@ struct rx_securityClass {
     int refCount;
 };
 
-#define RXS_OP(obj,op,args) ((obj->ops->op_ ## op) ? (*(obj)->ops->op_ ## op)args : 0)
+#define RXS_OP(obj,op,args) ((obj && (obj->ops->op_ ## op)) ? (*(obj)->ops->op_ ## op)args : 0)
 
 #define RXS_Close(obj) RXS_OP(obj,Close,(obj))
 #define RXS_NewConnection(obj,conn) RXS_OP(obj,NewConnection,(obj,conn))
index 4c4385588ac415c5247818123bd8d059a5491c06..e800790512a3311830dab5d6f5d41ce3129aa845 100644 (file)
@@ -17,7 +17,7 @@
 #endif
 #include <afsconfig.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_clock.c,v 1.1.1.5 2001/07/11 03:10:48 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_clock.c,v 1.1.1.6 2001/10/14 18:06:18 hartmans Exp $");
 
 #ifdef KERNEL
 #ifndef UKERNEL
@@ -33,6 +33,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_clock.c,v 1.1.1.5 2001/07/11 03:1
 #include <sys/time.h>
 #include <stdio.h>
 #include <errno.h>
+#include <stdlib.h>
 #include "rx_clock.h"
 #endif
 
index e50becd1776cb3c4fa1b161fbd857311d555c5e8..81cc8412723896ac90d229f62d14b1406a564003 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_getaddr.c,v 1.1.1.7 2001/09/20 06:16:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_getaddr.c,v 1.1.1.8 2001/10/14 18:06:19 hartmans Exp $");
 
 #ifndef AFS_DJGPP_ENV
 #ifndef KERNEL
@@ -303,9 +303,9 @@ int rxi_getAllAddrMaskMtu (addrBuffer, maskBuffer, mtuBuffer, maxSize)
                     ifr.ifr_addr.sa_family=AF_INET;
                     strncpy(ifr.ifr_name, sdl->sdl_data, sdl->sdl_nlen);
                     if (ioctl(s, SIOCGIFMTU, (caddr_t)&ifr) < 0)
-                         mtuBuffer[count]=1500;
+                         mtuBuffer[count]=htonl(1500);
                     else
-                         mtuBuffer[count]=ifr.ifr_mtu;
+                         mtuBuffer[count]=htonl(ifr.ifr_mtu);
                     count++;
                }
                addrcount--;
@@ -464,14 +464,14 @@ int rxi_getAllAddrMaskMtu (addrBuffer, maskBuffer, mtuBuffer, maxSize)
         if ( ioctl(s, SIOCGIFMTU, (caddr_t)ifr) < 0) {
            perror("SIOCGIFMTU");
         } else {
-           mtuBuffer[count] = ifr->ifr_metric;
+           mtuBuffer[count] = htonl(ifr->ifr_metric);
         }
 #endif /* SIOCGIFMTU */
 #ifdef SIOCRIPMTU
         if ( ioctl(s, SIOCRIPMTU, (caddr_t)ifr) < 0) {
            perror("SIOCRIPMTU");
         } else {
-           mtuBuffer[count] = ifr->ifr_metric;
+           mtuBuffer[count] = htonl(ifr->ifr_metric);
         }
 #endif /* SIOCRIPMTU */
 
index 9b0330ea323311ce76441e69a09035aa7de8c0bd..4ac766780f6578ba788d65ecd2f1b051cd89a750 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.8 2001/09/20 06:16:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_kcommon.c,v 1.1.1.9 2001/10/14 18:06:21 hartmans Exp $");
 
 #include "../rx/rx_kcommon.h"
 
@@ -343,6 +343,7 @@ register struct rx_peer *pp;
     u_short rxmtu;
     afs_int32 i, mtu;
 
+#ifndef AFS_SUN5_ENV
 #ifdef AFS_USERSPACE_IP_ADDR   
     i = rxi_Findcbi(pp->host);
     if (i == -1) {
@@ -402,6 +403,30 @@ register struct rx_peer *pp;
       pp->ifMTU = RX_REMOTE_PACKET_SIZE;
     }
 #endif/* else AFS_USERSPACE_IP_ADDR */
+#else /* AFS_SUN5_ENV */
+    mtu = rxi_FindIfMTU(pp->host);
+
+    if (mtu <= 0) {
+       pp->timeout.sec = 3;
+       /* pp->timeout.usec = 0; */
+       pp->ifMTU = RX_REMOTE_PACKET_SIZE;
+    } else {
+       pp->timeout.sec = 2;
+       /* pp->timeout.usec = 0; */
+       pp->ifMTU = MIN(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize);
+    }
+
+    if (mtu > 0) {
+       /* Diminish the packet size to one based on the MTU given by
+        * the interface. */
+       if (mtu > (RX_IPUDP_SIZE + RX_HEADER_SIZE)) {
+           rxmtu = mtu - RX_IPUDP_SIZE;
+           if (rxmtu < pp->ifMTU) pp->ifMTU = rxmtu;
+       }
+    } else {   /* couldn't find the interface, so assume the worst */
+       pp->ifMTU = RX_REMOTE_PACKET_SIZE;
+    }
+#endif /* AFS_SUN5_ENV */
 #else /* ADAPT_MTU */
     pp->rateFlag = 2;   /* start timing after two full packets */
     pp->timeout.sec = 2;
index a11c14537c0dba1dcaca4e4cc89b2b3b1ae98284..92b2bc33265d8ba97a6f6d84b6d7b075b6992a64 100644 (file)
@@ -111,6 +111,7 @@ extern rxk_portRocks_t rxk_portRocks;
 
 extern struct osi_socket *rxk_NewSocket(short aport);
 extern struct ifnet *rxi_FindIfnet();
+extern int rxi_FindIfMTU();
 
 extern int rxk_initDone;
 
index 743a44a22139b947fbd5a7511973f5f95fdae075..1f66c25c8d020f3b3a9e7f11b92b25e3b9999c5b 100644 (file)
 #ifndef _RX_MISC_H_
 #define _RX_MISC_H_
 
-#ifndef        AFS_SUN5_ENV
 #define MISCMTU
 #define ADAPT_MTU
-#endif
 
-#if defined(AFS_SUN5_ENV) && !defined(KERNEL)
-#define MISCMTU
-#define ADAPT_MTU
+#if defined(AFS_SUN5_ENV)
 #include <sys/sockio.h>
 #include <sys/fcntl.h>
 #endif
index e264ff18d8c1df57579bc3b96bc2774741e4a0ba..7545c48b7da97fa5faece7a573b7972786f6b29b 100644 (file)
@@ -18,7 +18,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_pthread.c,v 1.1.1.7 2001/09/20 06:16:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_pthread.c,v 1.1.1.8 2001/10/14 18:06:23 hartmans Exp $");
 
 #include <sys/types.h>
 #include <errno.h>
index eda33b2d97af2cfa73f3e73b6fdfedf537a7be20..9fc416aede679e662625c67bbef4c02b9c4af0f6 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.9 2001/09/20 06:16:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_rdwr.c,v 1.1.1.10 2001/10/14 18:06:23 hartmans Exp $");
 
 #ifdef KERNEL
 #ifndef UKERNEL
index 6b0998de2a3923dead6e79a4e8595e429a7055f8..7444a60cb0462d257790e796d506221af37ece49 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_trace.c,v 1.1.1.6 2001/09/11 14:34:23 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_trace.c,v 1.1.1.7 2001/10/14 18:06:24 hartmans Exp $");
 
 #ifdef RXDEBUG
 #ifdef HAVE_STRING_H
@@ -36,7 +36,7 @@ char rxi_tracename[80]="/tmp/rxcalltrace";
 #else
 char rxi_tracename[80]="\0Change This pathname (and preceding NUL) to initiate tracing";
 #endif
-int rxi_logfd = 0;
+int rxi_logfd = -1;
 char rxi_tracebuf[4096];
 afs_uint32 rxi_tracepos = 0;
 
@@ -52,7 +52,7 @@ struct rx_trace {
 
 void rxi_flushtrace()
 {
-    if (rxi_logfd)
+    if (rxi_logfd >= 0)
        write(rxi_logfd, rxi_tracebuf, rxi_tracepos);
     rxi_tracepos = 0;
 }
@@ -67,9 +67,9 @@ void rxi_calltrace(event, call)
   if (!rxi_tracename[0])
     return;
 
-  if (!rxi_logfd) {
+  if (rxi_logfd < 0) {
     rxi_logfd = open(rxi_tracename, O_WRONLY | O_CREAT | O_TRUNC, 0777);
-    if (!rxi_logfd)
+    if (rxi_logfd < 0)
       rxi_tracename[0] = '\0';
   }
   clock_GetTime(&now);
@@ -153,7 +153,7 @@ char **argv;
   }
 
   rxi_logfd = open(rxi_tracename, O_RDONLY);
-  if (!rxi_logfd) {
+  if (rxi_logfd < 0) {
     perror("");
     exit(errno);
   }
index 500c64dd0c6c39cf0ebbb8ebe6ab7349fe9b6bfd..0c98843ced76f1f57dfd941fc6eaa1b3e03bd76b 100644 (file)
@@ -52,7 +52,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/test/generator.c,v 1.1.1.6 2001/09/20 06:16:15 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/test/generator.c,v 1.1.1.7 2001/10/14 18:06:31 hartmans Exp $");
 
 #include <stdio.h>
 #include <string.h>
index 68487a2469e2e836da8846bab38c6870bb7ab270..97108ccc6ee5861f11d67ddf4f00450f7cebc5d3 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxdebug/rxdebug.c,v 1.1 2001/09/11 14:34:38 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxdebug/rxdebug.c,v 1.1.1.2 2001/10/14 18:06:32 hartmans Exp $");
 
 #include <sys/types.h>
 #include <errno.h>
@@ -111,6 +111,7 @@ struct cmd_syndesc *as;
     struct rx_debugConn tconn;
     short noConns;
     short showPeers;
+    short showLong;
     int version_flag;
     char version[64];
     afs_int32 length=64;
@@ -130,6 +131,7 @@ struct cmd_syndesc *as;
     version_flag=(as->parms[10].items ? 1 : 0);
     noConns = (as->parms[11].items ? 1 : 0);
     showPeers = (as->parms[12].items ? 1 : 0);
+    showLong = (as->parms[13].items ? 1 : 0);
 
     if (as->parms[0].items)
        hostName = as->parms[0].items->data;
@@ -500,6 +502,15 @@ struct cmd_syndesc *as;
                   tpeer.rtt >> 3, tpeer.rtt_dev >> 2);
            printf("\ttimeout %d.%03d sec\n",
                   tpeer.timeout.sec, tpeer.timeout.usec / 1000);
+           if (!showLong) continue;
+
+           printf("\tin/out packet skew: %d/%d\n",
+                  tpeer.inPacketSkew, tpeer.outPacketSkew);
+           printf("\tcongestion window %d, MTU %d\n",
+                  tpeer.cwind, tpeer.MTU);
+           printf("\tcurrent/if/max jumbogram size: %d/%d/%d\n",
+                  tpeer.nDgramPackets, tpeer.ifDgramPackets,
+                  tpeer.maxDgramPackets);
        }
     }
     exit(0);
@@ -542,6 +553,7 @@ char **argv;
     cmd_AddParm(ts,"-version",CMD_FLAG,CMD_OPTIONAL,"show AFS version id");
     cmd_AddParm(ts,"-noconns",CMD_FLAG,CMD_OPTIONAL,"show no connections");
     cmd_AddParm(ts,"-peers",CMD_FLAG,CMD_OPTIONAL,"show peers");
+    cmd_AddParm(ts,"-long",CMD_FLAG,CMD_OPTIONAL,"detailed output");
 
     cmd_Dispatch(argc, argv);
     exit(0);
index 960a97005f4edc383c9337ad6b26a7e193bb114c..04ffaf4ed43d36e12fd1423f9a98d60af8f44940 100644 (file)
@@ -36,7 +36,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_main.c,v 1.1.1.8 2001/09/20 06:16:17 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_main.c,v 1.1.1.9 2001/10/14 18:06:33 hartmans Exp $");
 
 #include <limits.h>
 #include <stdio.h>
index 9756885cc99df11d54124328f4a2ae1c39b3df0d..975873a4f363299a625cd50bb6df9a4b3c28129b 100644 (file)
@@ -35,7 +35,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_parse.c,v 1.1.1.7 2001/09/20 06:16:17 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_parse.c,v 1.1.1.8 2001/10/14 18:06:33 hartmans Exp $");
 
 #include <stdlib.h>
 #include <stdio.h>
index 211889fd1c3dcfbe1d6449d8b642ae69c49963ca..6cb76f7fae79aec1a72b2fd54a13d7d724584838 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.6 2001/09/11 14:34:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_client.c,v 1.1.1.7 2001/10/14 18:06:35 hartmans Exp $");
 
 #ifdef KERNEL
 #include "../afs/stds.h"
@@ -41,6 +41,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_client.c,v 1.1.1.6 2001/09/
 #include <afs/stds.h>
 #include <sys/types.h>
 #include <time.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
 #else
@@ -119,7 +126,8 @@ rxkad_AllocCID(aobj, aconn)
        clock_GetTime(&tgen.time);      /* changes time1 and time2 */
        tgen.time.sec = htonl(tgen.time.sec);
        tgen.time.usec = htonl(tgen.time.usec);
-       tgen.counter = htonl(counter++);
+       tgen.counter = htonl(counter);
+       counter++;
 #ifdef KERNEL
        tgen.random1 = afs_random() & 0x7fffffff;       /* was "80000" */
        tgen.random2 = afs_random() & 0x7fffffff;       /* was "htonl(100)" */
index d3b0196fe9dfbf80fbaf2de941cc5df1ceda5770..4f1eb12fed9fc845964cfa1f8434bf22a0168f4b 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.6 2001/09/11 14:34:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_common.c,v 1.1.1.7 2001/10/14 18:06:36 hartmans Exp $");
 
 #ifdef KERNEL
 #ifndef UKERNEL
@@ -51,6 +51,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_common.c,v 1.1.1.6 2001/09/
 #endif
 #include <rx/rx.h>
 #include <rx/xdr.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 
 #endif /* KERNEL */
 
index ecb020009b604d10e598af8ffd4a32b210a44e9a..1377b1cc3cd4e5e2b7655821931975a341ee6c62 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.8 2001/09/20 06:16:20 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_server.c,v 1.1.1.9 2001/10/14 18:06:36 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
@@ -24,6 +24,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_server.c,v 1.1.1.8 2001/09/
 #else
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/rx.h>
 #include <rx/xdr.h>
 #include <des.h>
index ec2d73b12063c7242b67ad6622b1f930782df4ff..8d2e9411d71873b1aca5f13a0ca7666365ec6fa8 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.6 2001/09/20 06:16:20 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/test/stress.c,v 1.1.1.7 2001/10/14 18:06:37 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
index 5b200ca336d92e8ca98620de1fe718e08aa14678..7988b948d7f4e1c37cb50b285ead9f116717bbf3 100644 (file)
@@ -14,7 +14,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/ticket.c,v 1.1.1.6 2001/09/11 14:34:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/ticket.c,v 1.1.1.7 2001/10/14 18:06:36 hartmans Exp $");
 
 #if defined(UKERNEL)
 #include "../afs/sysincludes.h"
@@ -33,6 +33,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/ticket.c,v 1.1.1.6 2001/09/11 14:
 #else
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <des.h>
index 10670c0f2f91d598ded192593e8553396b4d64f3..5be276795ac8c54e6c0b52648aae08c1408613b4 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/sys/pioctl_nt.c,v 1.1.1.6 2001/09/20 06:16:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/sys/pioctl_nt.c,v 1.1.1.7 2001/10/14 18:06:42 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <windows.h>
index 7b2f12762f1fe05d9e52b7b2f86f255a239168e4..56c227d975b0b7b9c2d7ff05269b6da3f4b45316 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/sys/rmtsysnet.c,v 1.1.1.4 2001/07/14 22:24:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/sys/rmtsysnet.c,v 1.1.1.5 2001/10/14 18:06:42 hartmans Exp $");
 
 #include <errno.h>
 #include <sys/param.h>
@@ -25,6 +25,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/sys/rmtsysnet.c,v 1.1.1.4 2001/07/14 22
 #endif
 #include <sys/stat.h>
 #include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <afs/afsint.h>
 #include <afs/venus.h>
 #include <rx/xdr.h>
index d52a873a8c4fb599ae27731270a98dd7ff9af064..338ce9c901fa724ec10114f326e4a70dd9a556eb 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
 
-# */
-
 DEST=@DEST@
 TOP_INCDIR=@TOP_INCDIR@
 TOP_LIBDIR=@TOP_LIBDIR@
@@ -30,49 +28,36 @@ SHELL    =/bin/sh
 
 include ../config/Makefile.${SYS_NAME}
 
-CC      =${MT_CC}
-CFLAGS  = ${DBG} -w -I${TOP_SRCDIR}/config ${MT_CFLAGS}
+BUTMOBJS    =file_tm.o
+BUTMLIBS    =libbutm.a
+BUTMINCLS   =${TOP_INCDIR}/afs/com_err.h ${TOP_INCDIR}/afs/butm.h
+BUTMINCLUDE =-I${TOP_INCDIR}
+
+CC      = ${MT_CC}
+CFLAGS  = ${DBG} -w -I${TOP_SRCDIR}/config ${MT_CFLAGS} @XBSA_CFLAGS@ ${BUTMINCLUDE}
 
 LDFLAGS = ${DBG} ${XLDFLAGS}
 
-VICED   =../viced
-VLSERVER=../vlserver
 LWP     =../lwp
-LIBACL  =../libacl
-UTIL    =../util
-DIR     =../dir
-VOL     =../vol
-FSINT   =../fsint
 BUTM    =../butm
 BUTC    =../butc
 BUCOORD = ../bucoord
 VOLSER  = ../volser
 
-# ----------------------------------------------------------------
-# The default is to build butc without using the TSM API libraries. 
-# To build with TSM support, set XBSA_NOBUILD="". Be sure you have
-#  the TSM API version 3.7.1 installed.
-# ----------------------------------------------------------------
-XBSA_NOBUILD="true"
-
 BUCOORDOBJS=ubik_db_if.o ${BUCOORD}/volstub.o ${BUCOORD}/dlq.o \
            ${BUCOORD}/status.o ${BUCOORD}/bucoord_errs.o
 
 VOLSERLIBOBJ=${VOLSER}/volint.cs.o  vsprocs.o              ${VOLSER}/vsutils.o \
             ${VOLSER}/lockprocs.o  ${VOLSER}/volint.xdr.o ${VOLSER}/volerr.o \
             ${VOLSER}/volint.ss.o  AFS_component_version_number.o 
-VOLSERLIBS=libvolser.a
+VOLSERLIBS  =libvolser.a
 
-LWPOBJS    =lock.o
-
-BUTMOBJS   =file_tm.o
-BUTMLIBS   =libbutm.a
-BUTMINCLS=${TOP_INCDIR}/afs/com_err.h ${TOP_INCDIR}/afs/butm.h
-BUTMINCLUDE=-I${TOP_INCDIR}
+LWPOBJS     =lock.o
 
 BUTCOBJS   =dbentries.o tcprocs.o lwps.o tcmain.o list.o recoverDb.o \
            tcudbprocs.o dump.o tcstatus.o butc_xbsa.o \
             ${LWPOBJS} ${BUCOORDOBJS}
+
 BUTCINCLS=${TOP_INCDIR}/afs/partition.h \
            ${TOP_INCDIR}/afs/volume.h \
            ${TOP_INCDIR}/afs/vlserver.h \
@@ -86,6 +71,7 @@ BUTCINCLS=${TOP_INCDIR}/afs/partition.h \
            ${TOP_INCDIR}/afs/tcdata.h \
            ${TOP_INCDIR}/afs/bubasics.h \
            ${TOP_INCDIR}/afs/butm.h
+
 BUTCINCLUDE=-I. -I${TOP_INCDIR}
 BUTCLIBS=${TOP_LIBDIR}/libbudb.a \
            ${TOP_LIBDIR}/libbubasics.a \
@@ -100,220 +86,84 @@ BUTCLIBS=${TOP_LIBDIR}/libbudb.a \
            ${TOP_LIBDIR}/libprocmgmt.a \
            ${TOP_LIBDIR}/librx.a
 
-include ../config/Makefile.version
+#
+# Build targets
+#
+
+all: butc
+
+butc: ${BUTCOBJS} ${BUTCLIBS}
+       ${CC} ${CFLAGS} ${BUTCOBJS} ${BUTCLIBS} ${MTLIBS} ${XLIBS} -o butc
 
-#----------------------------------------------- BUTC
+libvolser.a: vsprocs.o ${VOLSERLIBOBJ}
+       -$(RM) -f $@
+       $(AR) crv $@ vsprocs.o ${VOLSERLIBOBJ}
+       $(RANLIB) $@
 
-butc: pre ${BUTCOBJS} ${BUTCLIBS}
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir=-I"${XBSADIR}" ; \
-       else                               hdrdir=-I"${XBSA_HDRDIR}" ; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then hdrdir="" ; fi; \
-       ${CC} ${CFLAGS} $$xbsaflags ${BUTCOBJS} ${BUTCLIBS} $$hdrdir ${MTLIBS} ${XLIBS} -o butc
+libbutm.a: ${BUTMOBJS} AFS_component_version_number.o
+       -$(RM) -f libbutm.a
+       $(AR) crv libbutm.a $(BUTMOBJS) AFS_component_version_number.o
+       ${RANLIB} libbutm.a
 
 dbentries.o: ${BUTC}/dbentries.c ${BUTCINCLS}
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir=-I"${XBSADIR}" ; \
-       else                               hdrdir=-I"${XBSA_HDRDIR}" ; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then hdrdir="" ; fi; \
-       ${CC} ${CFLAGS} $$xbsaflags ${BUTCINCLUDE} $$hdrdir -c ${BUTC}/dbentries.c
+       ${CC} ${CFLAGS} -c ${BUTC}/dbentries.c
 
 tcprocs.o: ${BUTC}/tcprocs.c ${BUTCINCLS}
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir=-I"${XBSADIR}" ; \
-       else                               hdrdir=-I"${XBSA_HDRDIR}" ; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then hdrdir="" ; fi; \
-       ${CC} ${CFLAGS} $$xbsaflags ${BUTCINCLUDE} $$hdrdir -c ${BUTC}/tcprocs.c
+       ${CC} ${CFLAGS} -c ${BUTC}/tcprocs.c
 
 lwps.o: ${BUTC}/lwps.c ${BUTCINCLS}
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir=-I"${XBSADIR}" ; \
-       else                               hdrdir=-I"${XBSA_HDRDIR}" ; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then hdrdir="" ; fi; \
-       ${CC} ${CFLAGS} $$xbsaflags ${BUTCINCLUDE} $$hdrdir -c ${BUTC}/lwps.c
+       ${CC} ${CFLAGS} -c ${BUTC}/lwps.c
 
 tcmain.o: ${BUTC}/tcmain.c ${BUTCINCLS} AFS_component_version_number.c
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir=-I"${XBSADIR}" ; \
-       else                               hdrdir=-I"${XBSA_HDRDIR}" ; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then hdrdir="" ; fi; \
-       ${CC} ${CFLAGS} $$xbsaflags ${BUTCINCLUDE} $$hdrdir -c ${BUTC}/tcmain.c
+       ${CC} ${CFLAGS} -c ${BUTC}/tcmain.c
 
 list.o: ${BUTC}/list.c ${BUTCINCLS}
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir=-I"${XBSADIR}" ; \
-       else                               hdrdir=-I"${XBSA_HDRDIR}" ; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then hdrdir="" ; fi; \
-       ${CC} ${CFLAGS} $$xbsaflags ${BUTCINCLUDE} $$hdrdir -c ${BUTC}/list.c
+       ${CC} ${CFLAGS} -c ${BUTC}/list.c
 
 recoverDb.o: ${BUTC}/recoverDb.c ${BUTCINCLS}
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir=-I"${XBSADIR}" ; \
-       else                               hdrdir=-I"${XBSA_HDRDIR}" ; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then hdrdir="" ; fi; \
-       ${CC} ${CFLAGS} $$xbsaflags ${BUTCINCLUDE} $$hdrdir -c ${BUTC}/recoverDb.c
+       ${CC} ${CFLAGS} -c ${BUTC}/recoverDb.c
 
 tcudbprocs.o: ${BUTC}/tcudbprocs.c ${BUTCINCLS}
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir=-I"${XBSADIR}" ; \
-       else                               hdrdir=-I"${XBSA_HDRDIR}" ; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then hdrdir="" ; fi; \
-       ${CC} ${CFLAGS} $$xbsaflags ${BUTCINCLUDE} $$hdrdir -c ${BUTC}/tcudbprocs.c
+       ${CC} ${CFLAGS} -c ${BUTC}/tcudbprocs.c
 
 dump.o: ${BUTC}/dump.c ${BUTCINCLS}
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir=-I"${XBSADIR}" ; \
-       else                               hdrdir=-I"${XBSA_HDRDIR}" ; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then hdrdir="" ; fi; \
-       ${CC} ${CFLAGS} $$xbsaflags ${BUTCINCLUDE} $$hdrdir -c ${BUTC}/dump.c
+       ${CC} ${CFLAGS} -c ${BUTC}/dump.c
 
 tcstatus.o: ${BUTC}/tcstatus.c ${BUTCINCLS}
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir=-I"${XBSADIR}" ; \
-       else                               hdrdir=-I"${XBSA_HDRDIR}" ; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then hdrdir="" ; fi; \
-       ${CC} ${CFLAGS} $$xbsaflags ${BUTCINCLUDE} $$hdrdir -c ${BUTC}/tcstatus.c
+       ${CC} ${CFLAGS} -c ${BUTC}/tcstatus.c
 
 butc_xbsa.o: ${BUTC}/butc_xbsa.c ${BUTC}/butc_xbsa.h ${BUTCINCLS}
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir=-I"${XBSADIR}" ; \
-       else                               hdrdir=-I"${XBSA_HDRDIR}" ; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then hdrdir="" ; fi; \
-       ${CC} ${CFLAGS} $$xbsaflags ${BUTCINCLUDE} $$hdrdir -c ${BUTC}/butc_xbsa.c
-
-#----------------------------------------------- BUCOORD
+       ${CC} ${CFLAGS} -c ${BUTC}/butc_xbsa.c
 
 ubik_db_if.o: ${BUCOORD}/ubik_db_if.c
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir=-I"${XBSADIR}" ; \
-       else                               hdrdir=-I"${XBSA_HDRDIR}" ; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then hdrdir="" ; fi; \
-       ${CC} ${CFLAGS} $$xbsaflags ${BUTCINCLUDE} $$hdrdir -c ${BUCOORD}/ubik_db_if.c
-
-#----------------------------------------------- VOLSER
-# Build the libvolser.a library here. The file compiled
-# for is is vsprocs.c. The rest are from the VOLSER dir.
-
-libvolser.a: vsprocs.o ${VOLSERLIBOBJ}
-       -$(RM) -f $@
-       $(AR) crv $@ vsprocs.o ${VOLSERLIBOBJ}
-       $(RANLIB) $@
+       ${CC} ${CFLAGS} -c ${BUCOORD}/ubik_db_if.c
 
 vsprocs.o: ${VOLSER}/vsprocs.c
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir=-I"${XBSADIR}" ; \
-       else                               hdrdir=-I"${XBSA_HDRDIR}" ; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then hdrdir="" ; fi; \
-       ${CC} ${CFLAGS} $$xbsaflags ${BUTCINCLUDE} $$hdrdir -c ${VOLSER}/vsprocs.c
-
-#----------------------------------------------- LWP
+       ${CC} ${CFLAGS} -c ${VOLSER}/vsprocs.c
 
 lock.o: ${LWP}/lock.c
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir=-I"${XBSADIR}" ; \
-       else                               hdrdir=-I"${XBSA_HDRDIR}" ; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then hdrdir="" ; fi; \
-       ${CC} ${CFLAGS} $$xbsaflags ${BUTCINCLUDE} $$hdrdir -c ${LWP}/lock.c
-
-#----------------------------------------------- BUTC
+       ${CC} ${CFLAGS} -c ${LWP}/lock.c
 
 file_tm.o: ${BUTM}/file_tm.c ${BUTMINCLS}
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir=-I"${XBSADIR}" ; \
-       else                               hdrdir=-I"${XBSA_HDRDIR}" ; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then hdrdir="" ; fi; \
-       ${CC} ${CFLAGS} $$xbsaflags ${BUTMINCLUDE} $$hdrdir -c ${BUTM}/file_tm.c
-
-libbutm.a: ${BUTMOBJS} AFS_component_version_number.o
-       -$(RM) -f libbutm.a
-       $(AR) crv libbutm.a $(BUTMOBJS) AFS_component_version_number.o
-       ${RANLIB} libbutm.a
-
-#-----------------------------------------------
-clean:
-       $(RM) -f *.o *.a core AFS_component_version_number.c butc
-
-pre:
-       if [ "${XBSA_NOBUILD}" = "" ]; then xbsaflags="${XBSA_FLAGS}" ; \
-       else                                xbsaflags=""; \
-       fi; \
-       if [ "$$xbsaflags" = "" ]; then \
-               echo 'Will not build with XBSA'; \
-       else \
-               if [ "${XBSA_HDRDIR}" = "" ]; then hdrdir="${XBSADIR}" ; \
-               else                               hdrdir="${XBSA_HDRDIR}" ; \
-               fi; \
-               if test "$$hdrdir" != "" -a ! -f "$$hdrdir/xbsa.h"; then \
-                       echo '*** This build of butc cannot support XBSA because'; \
-                       echo '*** the required header file "'$$hdrdir'/xbsa.h"'; \
-                       echo '*** does not exist. If you know the pathname to the'; \
-                       echo '*** header file, then use XBSA_HDRDIR="<path>" as a make'; \
-                       echo '*** argument.'; \
-                       echo '*** If you do not want to build an XBSA version of butc,'; \
-                       echo '*** then use XBSA_NOBUILD="true" as a make argument.'; \
-                       exit 2; \
-               else \
-                       echo 'Will use XBSA header files from "'$$hdrdir'" (XBSA_HDRDIR)'; \
-               fi; \
-       fi
+       ${CC} ${CFLAGS} -c ${BUTM}/file_tm.c
 
-all: butc
-
-install install.noversion:  ${DESTDIR}${sbindir}/butc
+#
+# Install targets
+#
+install: ${DESTDIR}${sbindir}/butc
+dest: ${DEST}/etc/butc
 
-noversion: install
-system: install
 ${DEST}/etc/butc: butc
        ${INSTALL} $? $@
 
 ${DESTDIR}${sbindir}/butc: butc
        ${INSTALL} $? $@
 
+#
+# Misc targets
+#
+include ../config/Makefile.version
 
-dest:  ${DEST}/etc/butc
+clean:
+       $(RM) -f *.o *.a core AFS_component_version_number.c butc
 
index 40949c45271dfeaaf6c1041e9cd9f3b230fc493a..740befa2fc11fbd3fa80cb1f38a2588267f4a99d 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.9 2001/09/20 06:16:28 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/beacon.c,v 1.1.1.10 2001/10/14 18:06:44 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -25,6 +25,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/beacon.c,v 1.1.1.9 2001/09/20 06:1
 #endif
 #include <errno.h>
 #include <lock.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <rx/rx_multi.h>
@@ -50,6 +57,7 @@ int (*ubik_CRXSecurityProc)();
 char *ubik_CRXSecurityRock;
 afs_int32 ubikSecIndex;
 struct rx_securityClass     *ubikSecClass;
+static verifyInterfaceAddress();
 
 
 /* Module responsible for both deciding if we're currently the sync site,
@@ -170,7 +178,7 @@ ubeacon_InitServerListCommon(ame, info, clones, aservers)
     struct ubik_server *magicServer;
 
     /* verify that the addresses passed in are correct */
-    if (code = verifyInterfaceAddress(&ame, info, aservers))
+    if ((code = verifyInterfaceAddress(&ame, info, aservers)))
        return code;
 
     /* get the security index to use, if we can */
@@ -229,7 +237,7 @@ ubeacon_InitServerListCommon(ame, info, clones, aservers)
        }
     } else {
         i = 0;
-        while (servAddr = *aservers++) {
+        while ((servAddr = *aservers++)) {
            if (i >= MAXSERVERS) return UNHOSTS;            /* too many hosts */
            ts = (struct ubik_server *) malloc(sizeof(struct ubik_server));
            memset(ts, 0, sizeof(struct ubik_server));
index 6d3653c876a3db967e7e379d709dff69f94bb69b..3d9bcd4fb18cedc922077e41f4c7dfe0c00049aa 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.6 2001/09/20 06:16:28 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/disk.c,v 1.1.1.7 2001/10/14 18:06:45 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -20,6 +20,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/disk.c,v 1.1.1.6 2001/09/20 06:16:
 #include <netinet/in.h>
 #endif
 #include <errno.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <lock.h>
 #include <rx/xdr.h>
 
index 4351e97c14d1c0dad86b7488ba46f2101a296900..b2929da93fd57cbc4ce0259026c59335958a7ff9 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/lock.c,v 1.1.1.6 2001/09/20 06:16:28 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/lock.c,v 1.1.1.7 2001/10/14 18:06:45 hartmans Exp $");
 
 #include <sys/types.h>
 #ifndef AFS_NT40_ENV
index 0f661632b3a71a016cd37160001bdcfcef9bd1e5..bca87df7c71965e602a2fae136cf074ff9869f6e 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/phys.c,v 1.1.1.4 2001/07/14 22:24:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/phys.c,v 1.1.1.5 2001/10/14 18:06:45 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -25,6 +25,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/phys.c,v 1.1.1.4 2001/07/14 22:24:
 #include <lwp.h>
 #include <lock.h>
 #include <errno.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 
 #define        UBIK_INTERNALS 1
 #include "ubik.h"
index a3b1bc1bf652e75f5082b1672ecf472747e9bc7c..b8956593c544f6326359152ccc86c358bfc812b3 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.6 2001/09/11 14:34:56 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/recovery.c,v 1.1.1.7 2001/10/14 18:06:46 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -23,6 +23,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/recovery.c,v 1.1.1.6 2001/09/11 14
 #endif
 #include <assert.h>
 #include <lock.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <errno.h>
@@ -365,7 +372,7 @@ urecovery_Initialize(adbase)
  */
 urecovery_Interact() {
     afs_int32 code, tcode;
-    struct ubik_server *bestServer;
+    struct ubik_server *bestServer = NULL;
     struct ubik_server *ts;
     int dbok, doingRPC, now;
     afs_int32 lastProbeTime, lastDBVCheck;
index 1979fdab7df141e9d6bfa125bccf2257de692ee7..6457c3e2c49d47b592714e2453da29ce380de770 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.7 2001/09/20 06:16:29 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/remote.c,v 1.1.1.8 2001/10/14 18:06:46 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -19,6 +19,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/remote.c,v 1.1.1.7 2001/09/20 06:1
 #include <sys/file.h>
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <lock.h>
 #include <rx/xdr.h>
 #include <rx/rx.h>
@@ -58,7 +65,7 @@ SDISK_Begin(rxcall, atid)
 {
     register afs_int32 code;
 
-    if (code = ubik_CheckAuth(rxcall)) {
+    if ((code = ubik_CheckAuth(rxcall))) {
       return code;
     }
     DBHOLD(ubik_dbase);
@@ -87,7 +94,7 @@ SDISK_Commit(rxcall, atid)
     register afs_int32 code;
     register struct ubik_dbase *dbase;
     
-    if (code = ubik_CheckAuth(rxcall)) {
+    if ((code = ubik_CheckAuth(rxcall))) {
       return code;
     }
 
@@ -125,7 +132,7 @@ SDISK_ReleaseLocks(rxcall, atid)
     register struct ubik_dbase *dbase;
     register afs_int32 code;
 
-    if (code = ubik_CheckAuth(rxcall)) {
+    if ((code = ubik_CheckAuth(rxcall))) {
       return code;
     }
 
@@ -161,7 +168,7 @@ SDISK_Abort(rxcall, atid)
     register afs_int32 code;
     register struct ubik_dbase *dbase;
     
-    if (code = ubik_CheckAuth(rxcall)) {
+    if ((code = ubik_CheckAuth(rxcall))) {
       return code;
     }
 
@@ -200,7 +207,7 @@ SDISK_Lock(rxcall, atid, afile, apos, alen, atype)
     register struct ubik_dbase *dbase;
     struct ubik_trans *ubik_thisTrans;
 
-    if (code = ubik_CheckAuth(rxcall)) {
+    if ((code = ubik_CheckAuth(rxcall))) {
       return code;
     }
     if (!ubik_currentTrans) {
@@ -249,7 +256,7 @@ SDISK_WriteV(rxcall, atid, io_vector, io_buffer)
     struct ubik_iovec *iovec;
     char              *iobuf;
 
-    if (code = ubik_CheckAuth(rxcall)) {
+    if ((code = ubik_CheckAuth(rxcall))) {
       return code;
     }
     if (!ubik_currentTrans) {
@@ -296,7 +303,7 @@ SDISK_Write(rxcall, atid, afile, apos, adata)
     register afs_int32 code;
     register struct ubik_dbase *dbase;
 
-    if (code = ubik_CheckAuth(rxcall)) {
+    if ((code = ubik_CheckAuth(rxcall))) {
       return code;
     }
     if (!ubik_currentTrans) {
@@ -328,7 +335,7 @@ SDISK_Truncate(rxcall, atid, afile, alen)
     register afs_int32 code;
     register struct ubik_dbase *dbase;
 
-    if (code = ubik_CheckAuth(rxcall)) {
+    if ((code = ubik_CheckAuth(rxcall))) {
       return code;
     }
     if (!ubik_currentTrans) { 
@@ -357,7 +364,7 @@ SDISK_GetVersion(rxcall, aversion)
 {
     register afs_int32 code;
 
-    if (code = ubik_CheckAuth(rxcall)) {
+    if ((code = ubik_CheckAuth(rxcall))) {
       return code;
     }
 
@@ -401,7 +408,7 @@ SDISK_GetFile(rxcall, file, version)
     afs_int32 tlen;
     afs_int32 length;
     
-    if (code = ubik_CheckAuth(rxcall)) {
+    if ((code = ubik_CheckAuth(rxcall))) {
       return code;
     }
 /* temporarily disabled because it causes problems for migration tool.  Hey, it's just
@@ -463,7 +470,7 @@ SDISK_SendFile(rxcall, file, length, avers)
 
     /* send the file back to the requester */
     
-    if (code = ubik_CheckAuth(rxcall)) {
+    if ((code = ubik_CheckAuth(rxcall))) {
       goto failed;
     }
 
@@ -640,7 +647,7 @@ SDISK_SetVersion(rxcall, atid, oldversionp, newversionp)
   afs_int32               code=0;
   struct ubik_dbase   *dbase;
 
-  if (code = ubik_CheckAuth(rxcall)) {
+  if ((code = ubik_CheckAuth(rxcall))) {
      return(code);
   }
 
index 41adba6221887d5637c744b168309df5b6d0fb47..d8981d39cb2c01297d5e03705988f3d6ec8f53cd 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.8 2001/09/20 06:16:30 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/ubik.c,v 1.1.1.9 2001/10/14 18:06:46 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -22,6 +22,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/ubik.c,v 1.1.1.8 2001/09/20 06:16:
 #endif
 #include <time.h>
 #include <lock.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <afs/cellconfig.h>
index d3df01d6342417c1abc99b6ce98bd90bbd1f825a..e5acb2a738c72b3ecd5475c62db5c27b11dc48d8 100644 (file)
@@ -14,7 +14,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/ubikclient.c,v 1.1.1.6 2001/09/20 06:16:30 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/ubikclient.c,v 1.1.1.7 2001/10/14 18:06:47 hartmans Exp $");
 
 #if defined(UKERNEL)
 #include "../afs/sysincludes.h"
index a016e8b62a71d7622f23b130f85ad7b74ca45f31..90f02403fe02800a541c4766c546c20570fcd63d 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.5 2001/09/11 14:34:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/ubikcmd.c,v 1.1.1.6 2001/10/14 18:06:47 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -23,6 +23,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/ubikcmd.c,v 1.1.1.5 2001/09/11 14:
 #endif
 #include <time.h>
 #include <lock.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/xdr.h>
 #include <rx/rx.h>
 
index 8434db9f5f09139edbf948c5b7976ea0afc12a64..17fa4cfe73578f211272182f575138a95017ec6a 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/utst_client.c,v 1.1.1.4 2001/07/14 22:24:08 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/utst_client.c,v 1.1.1.5 2001/10/14 18:06:47 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -23,6 +23,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/utst_client.c,v 1.1.1.4 2001/07/14
 #endif
 #include <time.h>
 #include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <lock.h>
index 20b55efe2292271de59f0ec3db16e640fbae0be3..af075a634adb7ae94e4cf18ad14fccb451bf72d0 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/utst_server.c,v 1.1.1.4 2001/07/14 22:24:10 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/utst_server.c,v 1.1.1.5 2001/10/14 18:06:48 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
@@ -24,6 +24,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/utst_server.c,v 1.1.1.4 2001/07/14
 #endif
 #include <time.h>
 #include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <lock.h>
index 50b8b9bb189bb9281a0558d6548318e69c140ce4..778d8f4056b2fc7af9274788862baa8b1b6333ff 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.8 2001/09/20 06:16:31 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/vote.c,v 1.1.1.9 2001/10/14 18:06:48 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -21,6 +21,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/vote.c,v 1.1.1.8 2001/09/20 06:16:
 #endif
 #include <afs/afsutil.h>
 #include <lock.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <afs/afsutil.h>
index 444e8383e94db98376c5e7dad2f7fc15e7fcc0a5..358772ba9f9de8f22f574c596eb872b7ad51e534 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.6 2001/09/11 14:35:00 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/update/client.c,v 1.1.1.7 2001/10/14 18:06:49 hartmans Exp $");
 
 #include <afs/stds.h>
 #ifdef AFS_AIX32_ENV
@@ -314,8 +314,11 @@ again:
                                                  mode, atime, time);
                    if (errcode == 1) /* this file failed, but keep trying */
                      goto fail_dirbuf;  
-                   if (errcode == -1) /* time to quit */
+                   if (errcode == -1) /* time to quit */ {
+                     fclose(stream);
+                     unlink(dirbuf);
                      return -1;
+                   }
                }
 
            }
index 15d1eb6a1dc4279514ad93117181434216b69397..495ef8d155c3a3835c9bb6e14ff116aa6dbe633a 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.8 2001/09/20 06:16:33 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/usd/usd_file.c,v 1.1.1.9 2001/10/14 18:06:52 hartmans Exp $");
 
 #include <errno.h>
 #include <fcntl.h>
index d97202f957b09b5dc4d7498c13084f676a4d44da..b31c6e977fcd856ce576fef65d70ff1d168dbec2 100644 (file)
@@ -18,7 +18,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss.c,v 1.1.1.5 2001/09/20 06:16:34 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss.c,v 1.1.1.6 2001/10/14 18:06:53 hartmans Exp $");
 
 #ifdef AFS_AIX32_ENV
 #include <signal.h>
index 8604d2aa26d86847f0debda79b2bc25daa2228e9..6d4474f6d7357663d50e2b43f784f076555d2c2b 100644 (file)
@@ -14,6 +14,8 @@ libexecdir=@libexecdir@
 libdir=@libdir@
 includedir=@includedir@
 mandir=@mandir@
+sysconfdir=@sysconfdir@
+localstatedir=@localstatedir@
 COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et
 RXGEN=${TOP_SRCDIR}/rxgen/rxgen
 TOP_SRCDIR=@TOP_SRCDIR@
@@ -438,8 +440,6 @@ test:
        cd test; $(MAKE)
 
 include ../config/Makefile.version
-${DESTDIR}${bindir}/sys: sys
-       ${INSTALL} $? $@
 
 dest: \
        ${DEST}/include/afs/dirpath.h \
index 53124d78be31985dd5f51aaec1950dc2dea8daa7..2404f7f248027b809393efea512378e59e37bcb5 100644 (file)
 /* ReallyAbort:  called from assert. May/85 */
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <stdlib.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/assert.c,v 1.1.1.4 2001/07/14 22:24:18 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/assert.c,v 1.1.1.5 2001/10/14 18:07:00 hartmans Exp $");
 
 #include <stdio.h>
 
@@ -25,7 +29,14 @@ void afs_NTAbort(void)
 
 void AssertionFailed(char *file, int line)
 {
-    fprintf(stderr, "Assertion failed! file %s, line %d.\n", file, line);
+    char tdate[26];
+    time_t when;
+
+    time(&when);
+    strcpy(tdate, ctime(&when));
+    tdate[24] = '0';
+    fprintf(stderr, "%s: Assertion failed! file %s, line %d.\n",
+       tdate, file, line);
     fflush(stderr);
 #ifdef AFS_NT40_ENV
     afs_NTAbort();
index a20be2373457d3a307ad13ced0f667fe290d0e63..6ce29b66bb113aee9f7ba358bc9ab41808f59cc4 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/casestrcpy.c,v 1.1.1.4 2001/07/14 22:24:17 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/casestrcpy.c,v 1.1.1.5 2001/10/14 18:07:00 hartmans Exp $");
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <ctype.h>
 #include <stddef.h>
 #include <stdarg.h>
index 3f3e67aaa2b9aad3b59e9c88cc316abfb438547f..a4efdb43d2d545c27238659510cb4cc9dbb74328 100644 (file)
@@ -173,6 +173,7 @@ ConstructLocalLogPath(const char *cpath,
 #define AFSDIR_CANONICAL_CLIENT_VICE_DIRPATH    "/usr/vice"
 #ifdef AFS_DARWIN_ENV
 #define AFSDIR_ALTERNATE_CLIENT_VICE_DIRPATH    "/var/db/openafs"
+#define AFSDIR_ALTERNATE_CLIENT_ETC_DIR         "/var/db/openafs/etc"
 #endif
 
 #define AFSDIR_CANONICAL_SERVER_BIN_DIRPATH \
index 4b3fcb0d704be5e6c2314fa1222f057aad214457..575b57e800513e4230a9c7bd8ffc783e932b5d8e 100644 (file)
@@ -12,7 +12,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/fileutil.c,v 1.1.1.5 2001/07/14 22:24:21 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/fileutil.c,v 1.1.1.6 2001/10/14 18:07:02 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <stddef.h>
@@ -24,13 +24,24 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/util/fileutil.c,v 1.1.1.5 2001/07/14 22
 #include <windows.h>
 #include <io.h>
 #include "errmap_nt.h"
-#else
+#endif
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <sys/types.h>
 #include <dirent.h>
 #include <sys/stat.h>
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
 #include "fileutil.h"
 
 
index 5794a4924892b6934757e3a5054de8f7637cd3a9..72bf2d21bc50f2bebba8fa1896001831a20b9d8c 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.5 2001/09/11 14:35:13 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/kreltime.c,v 1.1.1.6 2001/10/14 18:07:02 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
@@ -18,11 +18,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/util/kreltime.c,v 1.1.1.5 2001/09/11 14
 #include "ktime.h"
 #include <time.h>
 #include <ctype.h>
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
+#ifdef HAVE_STRING_H
 #include <string.h>
 #else
+#ifdef HAVE_STRINGS_H
 #include <strings.h>
 #endif
+#endif
 #include "afsutil.h"
 
 
@@ -39,10 +41,10 @@ static struct parseseqS
     char ps_keychar;
     afs_int32 ps_maxValue;
 } parseseq[] = {
-    KTIMEDATE_YEAR, 'y', MAX_YEAR_VALUE,       /* no max. value */
-    KTIMEDATE_MONTH, 'm', MAX_MONTH_VALUE,     /* months max. 12 */
-    KTIMEDATE_DAY, 'd',        MAX_DAY_VALUE,          /* days max. 31 */
-    0, 0, 0,
+    { KTIMEDATE_YEAR, 'y', MAX_YEAR_VALUE, },          /* no max. value */
+    { KTIMEDATE_MONTH, 'm', MAX_MONTH_VALUE, },                /* months max. 12 */
+    { KTIMEDATE_DAY, 'd',      MAX_DAY_VALUE, },       /* days max. 31 */
+    { 0, 0, 0, }
 };
 
 /* Encodings to and from relative dates. The caller is responsible for
index 468a4e47e66b537a40636ef23821ac8814caee59..6701e9049fe4c4615575c27b1eeaa0e95aa78aa8 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.5 2001/09/11 14:35:14 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/ktime.c,v 1.1.1.6 2001/10/14 18:07:03 hartmans Exp $");
 
 #include <sys/types.h>
 #include <stdio.h>
@@ -19,11 +19,14 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/util/ktime.c,v 1.1.1.5 2001/09/11 14:35
 #ifdef AFS_NT40_ENV
 #include <malloc.h>
 #endif
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
+#ifdef HAVE_STRING_H
 #include <string.h>
 #else
+#ifdef HAVE_STRINGS_H
 #include <strings.h>
 #endif
+#endif
+#include <stdlib.h>
 #include "afsutil.h"
 
 #include "ktime.h"
@@ -50,6 +53,7 @@ static char *day[] = {
 };
 
 /* free token list returned by parseLine */
+#ifdef undef
 static LocalFreeTokens(alist)
     register struct token *alist; {
     register struct token *nlist;
@@ -60,6 +64,7 @@ static LocalFreeTokens(alist)
     }
     return 0;
 }
+#endif
 
 static space(x)
 int x; {
@@ -71,7 +76,7 @@ static LocalParseLine(aline, alist)
     char *aline;
     struct token **alist; {
     char tbuffer[256];
-    register char *tptr;
+    register char *tptr = NULL;
     int inToken;
     struct token *first, *last;
     register struct token *ttok;
@@ -121,26 +126,26 @@ static struct ptemp {
     char *key;
     afs_int32 value;
 } ptkeys [] = {
-    "sun", 0x10000,
-    "mon", 0x10001,
-    "tue", 0x10002,
-    "wed", 0x10003,
-    "thu", 0x10004,
-    "fri", 0x10005,
-    "sat", 0x10006,
-    "sunday", 0x10000,
-    "monday", 0x10001,
-    "tuesday", 0x10002,
-    "wednesday", 0x10003,
-    "thursday", 0x10004,
-    "thur", 0x10004,
-    "friday", 0x10005,
-    "saturday", 0x10006,
-    "am", 0x20000,
-    "pm", 0x20001,
-    "a.m.", 0x20000,
-    "p.m.", 0x20001,
-    0, 0,
+    { "sun", 0x10000, },
+    { "mon", 0x10001, },
+    { "tue", 0x10002, },
+    { "wed", 0x10003, },
+    { "thu", 0x10004, },
+    { "fri", 0x10005, },
+    { "sat", 0x10006, },
+    { "sunday", 0x10000, },
+    { "monday", 0x10001, },
+    { "tuesday", 0x10002, },
+    { "wednesday", 0x10003, },
+    { "thursday", 0x10004, },
+    { "thur", 0x10004, },
+    { "friday", 0x10005, },
+    { "saturday", 0x10006, },
+    { "am", 0x20000, },
+    { "pm", 0x20001, },
+    { "a.m.", 0x20000, },
+    { "p.m.", 0x20001, },
+    { 0, 0, }
 };
 
 /* ktime_DateOf
@@ -395,6 +400,7 @@ struct ktime *aktime; {
 
 
 /* compare date in both formats, and return as in strcmp */
+#ifdef undef
 static KTimeCmp(aktime, atm)
 register struct ktime *aktime;
 register struct tm *atm; {
@@ -418,6 +424,7 @@ register struct tm *atm; {
     }
     return 0;
 }
+#endif
 
 /* compare date in both formats, and return as in strcmp */
 static KDateCmp(akdate, atm)
index 90b9dea78fd5c9164e54ae64571ef0a0c3aa5c34..460e8299fffce17616d4767369139a7431548b00 100644 (file)
@@ -14,7 +14,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/uuid.c,v 1.1.1.6 2001/09/11 14:35:18 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/uuid.c,v 1.1.1.7 2001/10/14 18:07:05 hartmans Exp $");
 
 #ifdef KERNEL
 #include "../afs/sysincludes.h"
@@ -37,6 +37,17 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/util/uuid.c,v 1.1.1.6 2001/09/11 14:35:
 #include <sys/time.h>
 #endif /* ITIMER_REAL */
 #include <net/if.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <stdlib.h>
 #endif
 #include <sys/stat.h>
 #include <fcntl.h>
index 8d28180c7c886bc2ac5d40d8efbcbfbd20e193ea..41aaea35b74407d67c84554e55c5e5f3e5936117 100644 (file)
@@ -3,5 +3,7 @@ Makefile
 cmdebug
 fs
 fstrace
-kdump-2.4.7-ac3
+kdump-*
 up
+kdump
+kdump64
index 8075bfafff19f87272984e1ee98527c11b6fc60b..1d6cdf2680d4120718f0f2702df1d9181d38b9d4 100644 (file)
@@ -69,7 +69,7 @@ CMLIBS=${TOP_LIBDIR}/libsys.a \
 
 LIBS = ${FSLIBS} 
 
-all: fs up fstrace cmdebug kdump kdump64
+all: fs up fstrace cmdebug livesys kdump kdump64
 
 #
 # Build targets
@@ -82,6 +82,9 @@ cacheout.o: cacheout.c
 ${DEST}/bin/fs ${DEST}/root.server/usr/afs/bin/fs: fs
        ${INSTALL} -s $? $@
 
+${DEST}/bin/livesys: livesys
+       ${INSTALL} -s $? $@
+
 ${DEST}/bin/up: up
        ${INSTALL} -s $? $@
 
@@ -106,6 +109,7 @@ ${DEST}/etc/kdump: kdump
                ${INSTALLex} -f kdump.sh.solaris7 $@; \
                ${INSTALL} -s -f $? ${DEST}/etc/kdump32;; \
        *linux* ) \
+               ${INSTALLex} -f kdump.sh.linux $@; \
                ${INSTALL} -s kdump-${LINUX_VERSION} ${DEST}/etc/kdump-${LINUX_VERSION} ;; \
        hp_ux11* ) \
                ${INSTALLex} -f kdump.sh.hp_ux11 $@; \
@@ -134,6 +138,11 @@ fs.o: fs.c ${INCLS} AFS_component_version_number.c
 fs: fs.o $(LIBS)
        ${CC} ${CFLAGS} -g -o fs fs.o ${TOP_LIBDIR}/libprot.a $(LIBS) ${XLIBS}
 
+livesys.o: livesys.c ${INCLS} AFS_component_version_number.c
+
+livesys: livesys.c $(LIBS)
+       ${CC} -g -o livesys $(CFLAGS) livesys.c $(LIBS) ${XLIBS}
+
 twiddle: twiddle.c $(LIBS)
        ${CC} -g -o twiddle $(CFLAGS) twiddle.c $(LIBS) ${XLIBS}
 
@@ -262,6 +271,7 @@ kdump64 : kdump64.o
 #
 install: \
        ${DESTDIR}${bindir}/fs \
+       ${DESTDIR}${bindir}/livesys \
        ${DESTDIR}${afssrvbindir}/fs \
        ${DESTDIR}${bindir}/up \
        ${DESTDIR}${sbindir}/fstrace \
@@ -284,6 +294,9 @@ include ../config/Makefile.version
 ${DESTDIR}${bindir}/fs: fs
        ${INSTALL} -s $? $@
 
+${DESTDIR}${bindir}/livesys: livesys
+       ${INSTALL} -s $? $@
+
 ${DESTDIR}${afssrvbindir}/fs: fs
        ${INSTALL} -s $? $@
 
@@ -330,6 +343,7 @@ ${DESTDIR}${sbindir}/kdump64: kdump64
 
 dest: \
        ${DEST}/bin/fs \
+       ${DEST}/bin/livesys \
        ${DEST}/root.server/usr/afs/bin/fs \
        ${DEST}/bin/up \
        ${DEST}/etc/fstrace \
index f3c7a7c5da68804a1bdf391127ba34aed33c3cca..932b9cc9daf72f1ccb8f198588dbef0d47f86bbe 100644 (file)
@@ -1 +1,3 @@
+AFS_component_version_number.c
 Makefile
+vfsck
index d0237c93525b63fcd8fe3621ff200aab7e288b7c..890ab890fafc540dce5e6f949188fb1dd3153a27 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.5 2001/09/20 06:16:47 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/setup.c,v 1.1.1.6 2001/10/14 18:07:11 hartmans Exp $");
 
 #include <stdio.h>
 #define VICE
@@ -261,7 +261,6 @@ restat:
                 }
             }
         }
-#endif
        if (rootdev == statb.st_rdev)
                hotroot++;
        if ((fsreadfd = open(dev, O_RDONLY)) < 0) {
index 18ab3d4c843fec71d00f6ec343b6b4d1ba6d63aa..528c93343ad17146743809011a109b10135ba19d 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.6 2001/09/11 14:35:33 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/callback.c,v 1.1.1.7 2001/10/14 18:07:13 hartmans Exp $");
 
 #include <stdio.h> 
 #include <stdlib.h>      /* for malloc() */
@@ -358,7 +358,12 @@ static TAdd(cb, thead)
 
        cb->tprev = thp->tprev;
        cb->tnext = *thead;
-       thp->tprev = (itocb(thp->tprev)->tnext = cbtoi(cb));
+       if (thp) {
+         if (thp->tprev) 
+           thp->tprev = (itocb(thp->tprev)->tnext = cbtoi(cb));
+         else 
+           thp->tprev = cbtoi(cb);
+       }
     }
     cb->thead = ttoi(thead);
 
@@ -374,8 +379,10 @@ static TDel(cb)
 
     if (*thead == cbtoi(cb))
        *thead = (*thead == cb->tnext? 0: cb->tnext);
-    itocb(cb->tprev)->tnext = cb->tnext;
-    itocb(cb->tnext)->tprev = cb->tprev;
+    if (itocb(cb->tprev)) 
+      itocb(cb->tprev)->tnext = cb->tnext;
+    if (itocb(cb->tnext)) 
+      itocb(cb->tnext)->tprev = cb->tprev;
 
 } /*TDel*/
 
index a320d72e904e2e59951bd3e33db0ac6915e3d6b3..aa2e0984820ca71c0f026cfe166ff9093faa941f 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.6 2001/09/11 14:35:35 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/host.c,v 1.1.1.7 2001/10/14 18:07:13 hartmans Exp $");
 
 #include <stdio.h>
 #include <errno.h>
@@ -114,8 +114,10 @@ static void GetCEBlock()
     register int i;
 
     block = (struct CEBlock *)malloc(sizeof(struct CEBlock));
-    if (!block)
+    if (!block) {
+       ViceLog(0, ("Failed malloc in GetCEBlock\n"));
        ShutDownAndCore(PANIC);
+    }
 
     for(i = 0; i < (CESPERBLOCK -1); i++) {
        Lock_Init(&block->entry[i].lock);
@@ -137,8 +139,10 @@ static struct client *GetCE()
 
     if (CEFree == 0)
        GetCEBlock();
-    if (CEFree == 0)
+    if (CEFree == 0) {
+       ViceLog(0, ("CEFree NULL in GetCE\n"));
        ShutDownAndCore(PANIC);
+    }
 
     entry = CEFree;
     CEFree = entry->next;
@@ -193,8 +197,10 @@ static void GetHTBlock()
     static int index = 0;
 
     block = (struct HTBlock *)malloc(sizeof(struct HTBlock));
-    if (!block)
+    if (!block) {
+       ViceLog(0, ("Failed malloc in GetHTBlock\n"));
        ShutDownAndCore(PANIC);
+    }
 
 #ifdef AFS_PTHREAD_ENV
     for(i=0; i < (h_HTSPERBLOCK); i++)
@@ -264,14 +270,20 @@ int h_Release_r(host)
     register struct host *host;
 {      
     
-    if (!((host)->holds[h_holdSlot()] &= ~h_holdbit()) ) {
+    if (!((host)->holds[h_holdSlot()] & ~h_holdbit()) ) {
        if (! h_OtherHolds_r(host) ) {
+           /* must avoid masking this until after h_OtherHolds_r runs
+              but it should be run before h_TossStuff_r */
+           (host)->holds[h_holdSlot()] &= ~h_holdbit();
            if ( (host->hostFlags & HOSTDELETED) || 
                (host->hostFlags & CLIENTDELETED) ) {
                h_TossStuff_r(host);
            }           
-       }
-    }
+       } else 
+           (host)->holds[h_holdSlot()] &= ~h_holdbit();
+    } else 
+      (host)->holds[h_holdSlot()] &= ~h_holdbit();
+
     return 0;
 }
 
@@ -1590,8 +1602,8 @@ static int h_DumpHost(host, held, file)
     char tmpStr[256];
 
     H_LOCK
-    sprintf(tmpStr, "ip:%x holds:%d port:%d hidx:%d cbid:%d lock:%x last:%u active:%u down:%d del:%d cons:%d cldel:%d\n\t hpfailed:%d hcpsCall:%u hcps [",
-           host->host, host->holds, host->port, host->index, host->cblist,
+    sprintf(tmpStr, "ip:%x port:%d hidx:%d cbid:%d lock:%x last:%u active:%u down:%d del:%d cons:%d cldel:%d\n\t hpfailed:%d hcpsCall:%u hcps [",
+           host->host, host->port, host->index, host->cblist,
            CheckLock(&host->lock), host->LastCall, host->ActiveCall, 
            (host->hostFlags & VENUSDOWN), host->hostFlags&HOSTDELETED, 
            host->Console, host->hostFlags & CLIENTDELETED, 
@@ -1609,8 +1621,16 @@ static int h_DumpHost(host, held, file)
            sprintf(tmpStr, " %x", host->interface->addr[i]);
            STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
        }
-    sprintf(tmpStr, "]\n");
+    sprintf(tmpStr, "] holds: ");
+    STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
+
+    for (i = 0 ; i < h_maxSlots ; i++) {
+      sprintf(tmpStr, "%04x", host->holds[i]);
+      STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
+    }
+    sprintf(tmpStr, " slot/bit: %d/%d\n", h_holdSlot(), h_holdbit());
     STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
+
     H_UNLOCK
     return held;
 
index e0d58e4d43ad366bd4128cb1cc3dec93369d812d..020b1e294f5deaea38ca074c5dc31fb8639327a8 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.7 2001/09/11 14:35:36 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/viced.c,v 1.1.1.8 2001/10/14 18:07:15 hartmans Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -349,6 +349,11 @@ main(argc, argv)
     }
 #endif
     confDir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH);
+    if (!confDir) {
+       fprintf(stderr, "Unable to open config directory %s\n",
+               AFSDIR_SERVER_ETC_DIRPATH);
+       exit(-1);
+    }
 
     NewParms(1);
 
index e34166c132815d56f51f97839f927fa2ebfaf2c9..9ab1b52f48bf50c4f64c965034f77256a8a3ff43 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.6 2001/09/20 06:16:56 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vlclient.c,v 1.1.1.7 2001/10/14 18:07:16 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
index 3bf86196324c18e93b820ffa76f808aa6aeb5df8..3e11b2eeeb297595a0f9881c8002c632a62f12dc 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.6 2001/09/20 06:16:56 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vldb_check.c,v 1.1.1.7 2001/10/14 18:07:16 hartmans Exp $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
index 589e84555c273ebf27e9847d4c3f3e7daec03110..faa568c382606f9d6b37ea4ea34d00a052453b9f 100644 (file)
@@ -175,6 +175,14 @@ struct vldstats {
     afs_int32 reserved[5];                             /* for future usage */
 };
 
+/* Volser information/status */
+const VLOP_MOVE        = 0x10;
+const VLOP_RELEASE     = 0x20;
+const VLOP_BACKUP      = 0x40;
+const VLOP_DELETE      = 0x80;
+const VLOP_DUMP        = 0x100;
+
+%#define VLOP_ALLOPERS ( VLOP_MOVE | VLOP_RELEASE | VLOP_BACKUP | VLOP_DELETE | VLOP_DUMP)
 
 /* defines for convenience of vl users */
 %#define       VLF_RWEXISTS        0x1000  /* flags for whole vldb entry */
index 29adadd985d6cc3b9363bd24bb81a68f0ca1d632..edda9fdf0376afae86ff8a2848c3546d4b16112c 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.6 2001/09/20 06:16:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vlprocs.c,v 1.1.1.7 2001/10/14 18:07:17 hartmans Exp $");
 
 #include <sys/types.h>
 #include <stdio.h>
index ccd81d6cc5a198261893d8a04335a52522719b4d..0a8beb59e0ff4df4c7b4b4adba5b6f503601b259 100644 (file)
@@ -49,14 +49,6 @@ struct vlheader {
 #define        VLLOCKED        4               /* Advisory lock on entry */
 #define        VLCONTBLOCK     8               /* Special continuation block entry */
 
-/* Vlentry's flags also used to stamp type of ongoing operation */
-#define        VLOP_MOVE       0x10
-#define        VLOP_RELEASE    0x20
-#define        VLOP_BACKUP     0x40
-#define        VLOP_DELETE     0x80
-#define        VLOP_DUMP       0x100
-#define        VLOP_ALLOPERS   (VLOP_MOVE | VLOP_RELEASE | VLOP_BACKUP | VLOP_DELETE | VLOP_DUMP)
-
 /* Valid RelaseLock types */
 #define        LOCKREL_TIMESTAMP   1
 #define        LOCKREL_OPCODE      2
index 0f0b4face7ba6ec6dca43097098cb8645c0f323c..88becd573c5fb297b77cde8dc99877365f2bbc71 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.6 2001/09/20 06:16:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vlutils.c,v 1.1.1.7 2001/10/14 18:07:18 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
index 648147fe1b40059bde0744668104649e52600c24..154e50f13887f949e6080e6c055e171db645b85b 100644 (file)
@@ -2,3 +2,5 @@ AFS_component_version_number.c
 Makefile
 salvager
 volinfo
+gi
+fs_conv_sol26
index be65cf90bdb6c5e4138414c84536682b3f1e328d..c93d917949d7bafa771e1cc57be3f7914f9fe779 100644 (file)
@@ -97,13 +97,13 @@ ${DEST}/lib/afs/vlib.a: vlib.a
 ${DEST}/lib/afs/libvlib.a: vlib.a
        ${INSTALL} $? $@
 
-${DESTDIR}/${afssrvsbindir}/fs_conv_dux40D:  fs_conv_dux40D
+${DESTDIR}${afssrvsbindir}/fs_conv_dux40D:  fs_conv_dux40D
        ${INSTALL} -s $? $@
 
-${DESTDIR}/${afssrvsbindir}/xfs_size_check:  xfs_size_check
+${DESTDIR}${afssrvsbindir}/xfs_size_check:  xfs_size_check
        ${INSTALL} -s $? $@
 
-${DESTDIR}/${afssrvsbindir}/fs_conv_sol26:  fs_conv_sol26
+${DESTDIR}${afssrvsbindir}/fs_conv_sol26:  fs_conv_sol26
        ${INSTALL} -s $? $@
 
 $(DEST)/root.server/usr/afs/bin/fs_conv_dux40D:  fs_conv_dux40D
index 77131dd8d0bdfff64600dae49592755af1a6093f..68155fd722109b34e8a185ca5593df632fab1892 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.6 2001/09/20 06:16:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/clone.c,v 1.1.1.7 2001/10/14 18:07:21 hartmans Exp $");
 
 #include <sys/types.h>
 #include <stdio.h>
index f4062731846eb516ed4b36c75553c4b501020797..6f3656978d59d37751c7e477e5836fd7e169afe0 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.7 2001/09/20 06:16:59 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/devname.c,v 1.1.1.8 2001/10/14 18:07:21 hartmans Exp $");
 
 #include <afs/param.h>
 #include <rx/xdr.h>
index e6f32c1a63487c45202fa5a4c464dd7f910acecd..a76f35c6cf2cd03fc99cd6571f05914f57310780 100644 (file)
@@ -14,7 +14,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/ihandle.c,v 1.1.1.4 2001/07/14 22:24:56 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/ihandle.c,v 1.1.1.5 2001/10/14 18:07:22 hartmans Exp $");
 
 #include <stdio.h>
 #include <sys/types.h>
@@ -448,7 +448,7 @@ StreamHandle_t *stream_fdopen(FD_t fd)
 }
 
 /* Open a file for buffered I/O */
-StreamHandle_t *stream_open(char *filename, char *mode)
+StreamHandle_t *stream_open(const char *filename, const char *mode)
 {
     FD_t fd;
 
index 93fa5b65cba93b8b5d92a742296fe18496d81f0a..a14f2f7f1518190b1dd5e5cc587b47fc35094f7e 100644 (file)
@@ -258,7 +258,7 @@ extern FdHandle_t *ih_open(IHandle_t *ihP);
 extern int fd_close(FdHandle_t *fdP);
 extern int fd_reallyclose(FdHandle_t *fdP);
 extern StreamHandle_t *stream_fdopen(FD_t fd);
-extern StreamHandle_t *stream_open(char *file, char *mode);
+extern StreamHandle_t *stream_open(const char *file, const char *mode);
 extern int stream_read(void *ptr, int size, int nitems,
                       StreamHandle_t *streamP);
 extern int stream_write(void *ptr, int size, int nitems,
index 0142b975c87de08727793258e13b98b253accd90..c3f3a2fad69e53fe246238b2a72251fa8e36e1db 100644 (file)
@@ -20,7 +20,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/listinodes.c,v 1.1.1.8 2001/09/20 06:17:00 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/listinodes.c,v 1.1.1.9 2001/10/14 18:07:22 hartmans Exp $");
 
 #ifndef AFS_NAMEI_ENV
 #ifdef AFS_LINUX20_ENV
index d9d87267214b9ef792dd8209a97cdbc54a6893e0..1f08490c5cc2e9c73911c2e23657ee21a926c969 100644 (file)
@@ -12,7 +12,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/namei_ops.c,v 1.1.1.6 2001/07/14 22:24:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/namei_ops.c,v 1.1.1.7 2001/10/14 18:07:22 hartmans Exp $");
 
 #ifdef AFS_NAMEI_ENV
 #include <stdio.h>
@@ -204,6 +204,10 @@ int namei_ViceREADME(char *partition)
    char filename[32];
    int fd;
 
+   /* Create the inode directory if we're starting for the first time */
+   sprintf(filename, "%s/%s", partition, INODEDIR);
+   mkdir(filename, 0700);
+
    sprintf(filename, "%s/%s/README", partition, INODEDIR);
    fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0444);
    if (fd >= 0) {
index c6414034512a080d3f92824a8198c7ee9d109178..c583bd0af61fc8c901b306d29e916ece93735232 100644 (file)
 #define VICE_PARTITION_PREFIX  "/vicep"
 #define VICE_PREFIX_SIZE       (sizeof(VICE_PARTITION_PREFIX)-1)
 
+/* If a file by this name exists in a /vicepX directory, it means that
+ * this directory should be used as an AFS partition even if it's not
+ * on a separate partition (for instance if it's part of a large /).
+ * This feature only works with the NAMEI fileserver.
+ */
+#ifdef AFS_NAMEI_ENV
+#define VICE_ALWAYSATTACH_FILE "AlwaysAttach"
+#endif
+
 /* For NT, the roles of "name" and "devName" are reversed. That is, "name"
  * refers to the drive letter name and "devName" refers to the /vicep style
  * or name. The reason for this is that a lot of places assume that "name"
index 31492395caddd020b3cdc3142d80b191b806216e..bc1913bbaaf192e072df2e328d02703372731ea3 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.6 2001/09/20 06:17:02 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vnode.c,v 1.1.1.7 2001/10/14 18:07:24 hartmans Exp $");
 
 #include <errno.h>
 #include <stdio.h>
index 4388c8008745ebf2ba553fda264ca31967ed5ed6..0ffb4b908136ccbd19cb8f0a57f8a1ef90d23b70 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.8 2001/09/20 06:17:02 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vol-salvage.c,v 1.1.1.9 2001/10/14 18:07:25 hartmans Exp $");
 
 #include <stdlib.h>
 #include <stdio.h>
index 5d55a4aeb0c3d678400c6654abe8e3cf91a884f2..521fc6a5afe4638e06a76b6c8359f7342cc214be 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.10 2001/09/20 06:17:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/volume.c,v 1.1.1.11 2001/10/14 18:07:26 hartmans Exp $");
 
 #include <rx/xdr.h>
 #include <afs/afsint.h>
index e5d69e037a35c9adf458224b84a7759891ea65bb..d3e758f901838032c46266c196dc3d1df9da6b8c 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.7 2001/09/20 06:17:04 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vutil.c,v 1.1.1.8 2001/10/14 18:07:26 hartmans Exp $");
 
 #include <stdio.h>
 #include <sys/types.h>
index 7a93d9264e8de5969d9a73c1234b799f26273fca..b1d6fe0e05285356b770c5f944a281b8a3d3dc21 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/common.c,v 1.1.1.5 2001/09/20 06:17:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/common.c,v 1.1.1.6 2001/10/14 18:07:28 hartmans Exp $");
 
 #include <stdio.h>
 #include <afs/afsutil.h>
index 0d0f94c56a0d92cc11dd2aa82c0fc3d67b74f89c..3cbab60262bd026b1db9cf60dced31f14d6ac0cd 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.7 2001/09/20 06:17:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/dumpstuff.c,v 1.1.1.8 2001/10/14 18:07:28 hartmans Exp $");
 
 #include <sys/types.h>
 #include <ctype.h>
index cc09baafc6e87289df66261df2a60dd76f3ea4d8..f2397c86ad4ad01a8051ca0e1f8b56d3124daee3 100644 (file)
@@ -17,7 +17,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/lockprocs.c,v 1.1.1.5 2001/09/20 06:17:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/lockprocs.c,v 1.1.1.6 2001/10/14 18:07:29 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
index e6531b5cd14280b0f541fd4aa99d7498ca064c68..ff66f112841214532c78ba8821e36fba98445bb1 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.7 2001/09/20 06:17:08 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/volprocs.c,v 1.1.1.8 2001/10/14 18:07:30 hartmans Exp $");
 
 #include <stdio.h>
 #include <sys/types.h>
@@ -626,6 +626,10 @@ char *newName;
     ClearVolumeStats(&V_disk(newvp));
     V_destroyMe(newvp) = DESTROY_ME;
     V_inService(newvp) = 0;
+    if (newType == backupVolume) {
+       V_backupDate(originalvp) = V_copyDate(newvp);
+       V_backupDate(newvp) = V_copyDate(newvp);
+    }
     V_inUse(newvp) = 0;
     VUpdateVolume(&error, newvp);
     if (error) {
@@ -779,6 +783,10 @@ afs_int32 cloneId;
     ClearVolumeStats(&V_disk(clonevp));
     V_destroyMe(clonevp) = 0;
     V_inService(clonevp) = 0;
+    if (newType == backupVolume) {
+       V_backupDate(originalvp) = V_copyDate(clonevp);
+       V_backupDate(clonevp) = V_copyDate(clonevp);
+    }
     V_inUse(clonevp) = 0;
     VUpdateVolume(&error, clonevp);
     if (error) {
@@ -1585,13 +1593,11 @@ struct rx_call *acid;
 struct pIDs *partIds;
 {   
     char namehead[9];
-    struct stat rbuf, pbuf;
     int code;
     char i;
 
     strcpy(namehead, "/vicep");        /*7 including null terminator*/
 
-#ifdef AFS_NT40_ENV
     /* Just return attached partitions. */
     namehead[7] = '\0';
     for (i=0; i<26; i++) {
@@ -1599,23 +1605,7 @@ struct pIDs *partIds;
        if (VGetPartition(namehead, 0))
            partIds->partIds[i] = VGetPartition(namehead, 0) ? i : -1;
     }
-#else
-    
-    (void) stat("/",&rbuf);    /*interested in buf->st_dev*/
-   
-    for(i = 0 ; i < 26 ; i++){
-       
-       namehead[6] = i + 'a';
-       namehead[7] = '\0';
-       code = stat(namehead,&pbuf);
-       if(!code){
-           if(rbuf.st_dev != pbuf.st_dev) /*the partition is mounted */
-               partIds->partIds[i] = i ;
-           else  partIds->partIds[i ] = -1;
-       }
-       else partIds->partIds[i ] = -1;
-    }
-#endif   
+
     return 0;
 }
 
@@ -1639,10 +1629,12 @@ struct partEntries *pEntries;
     struct stat rbuf, pbuf;
     char namehead[9];
     struct partList partList;
-    int code, i, j=0, k;
+    struct DiskPartition *dp;
+    int i, j=0, k;
 
     strcpy(namehead, "/vicep");        /*7 including null terminator*/
-#ifdef AFS_NT40_ENV
+
+    /* Only report attached partitions */
     for(i = 0 ; i < VOLMAXPARTS; i++){
        if (i < 26) {
            namehead[6] = i + 'a';
@@ -1653,35 +1645,13 @@ struct partEntries *pEntries;
            namehead[7] = 'a' + (k%26);
            namehead[8] = '\0';
        }
-       code = VGetPartition(namehead, 0);
-       if (code)
+       dp = VGetPartition(namehead, 0);
+       if (dp)
            partList.partId[j++] = i;
     }
     pEntries->partEntries_val = (afs_int32 *) malloc(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*/
-    for(i = 0 ; i < VOLMAXPARTS; i++){
-       if (i < 26) {
-           namehead[6] = i + 'a';
-           namehead[7] = '\0';
-       } else {
-           k = i - 26;
-           namehead[6] = 'a' + (k/26);
-           namehead[7] = 'a' + (k%26);
-           namehead[8] = '\0';
-       }
-       code = stat(namehead,&pbuf);
-       if(!code){
-           if(rbuf.st_dev != pbuf.st_dev) /*the partition is mounted */
-               partList.partId[j++] = i;
-       }
-    } 
-    pEntries->partEntries_val = (afs_int32 *) malloc(j * sizeof(int));
-    memcpy((char *)pEntries->partEntries_val, (char *)&partList, j * sizeof(int));
-    pEntries->partEntries_len = j;
-#endif
     return 0;
 
 }
index 4bb13638b11a15de8dca8db1b9361559b70373d1..74f580decb13088ff6a76a7d02719a28c92af1a8 100644 (file)
@@ -152,6 +152,7 @@ struct partList {   /*used by the backup system */
 /* Values for the UV_RestoreVolume flags parameter */
 #define RV_FULLRST 0x1
 #define RV_OFFLINE 0x2
+#define RV_RDONLY  0x10000
 
 #endif /* _VOLSER_ */
 
index cb181bcc1cdd520cbe821da1913e93fbb82757aa..e7a4aee79e0bcf70eab4f2c66a7e30810300c70f 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.7 2001/09/20 06:17:10 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vos.c,v 1.1.1.8 2001/10/14 18:07:31 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -67,6 +67,7 @@ cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");\
 cmd_AddParm(ts, "-noauth", CMD_FLAG, CMD_OPTIONAL, "don't authenticate");\
 cmd_AddParm(ts, "-localauth",CMD_FLAG,CMD_OPTIONAL,"use server tickets");\
 cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, "verbose");\
+cmd_AddParm(ts, "-crypt", CMD_FLAG, CMD_OPTIONAL, "encrypt commands");\
 
 #define ERROR_EXIT(code) {error=(code); goto error_exit;}
 
@@ -79,6 +80,8 @@ const char *confdir;
 extern struct rx_connection *UV_Bind();
 extern  struct rx_securityClass *rxnull_NewClientSecurityObject();
 extern int UV_SetSecurity();
+extern int UV_SetVolumeInfo();
+extern int vsu_SetCrypt();
 extern VL_SetLock();
 extern VL_ReleaseLock();
 extern VL_DeleteEntry();
@@ -1274,6 +1277,86 @@ register struct cmd_syndesc *as;
     return (error);
 }
 
+/*------------------------------------------------------------------------
+ * PRIVATE SetFields
+ *
+ * Description:
+ *     Routine used to change the status of a single volume.
+ *
+ * Arguments:
+ *     as : Ptr to parsed command line arguments.
+ *
+ * Returns:
+ *     0 for a successful operation,
+ *     Otherwise, one of the ubik or VolServer error values.
+ *
+ * Environment:
+ *     Nothing interesting.
+ *
+ * Side Effects:
+ *     As advertised.
+ *------------------------------------------------------------------------
+ */
+static SetFields(as)
+register struct cmd_syndesc *as;
+{
+    struct nvldbentry entry;
+    afs_int32 vcode = 0;
+    volintInfo info;
+    afs_int32 volid;
+    afs_int32 code, err;
+    afs_int32 aserver, apart;
+    int previdx = -1;
+
+    volid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);    /* -id */
+    if (volid == 0) {
+       if (err) PrintError("", err);
+       else fprintf(STDERR, "Unknown volume ID or name '%s'\n", as->parms[0].items->data);
+       return -1;
+    }
+
+    code = VLDB_GetEntryByID (volid, RWVOL, &entry);
+    if (code) {
+       fprintf(STDERR, "Could not fetch the entry for volume number %u from VLDB \n",volid);
+       return (code);
+    }
+    MapHostToNetwork(&entry);
+
+    GetServerAndPart(&entry, RWVOL, &aserver, &apart, &previdx);
+    if (previdx == -1) {
+       fprintf(STDERR,"Volume %s does not exist in VLDB\n\n", as->parms[0].items->data);
+       return (ENOENT);
+    }
+
+    memset(&info, 0, sizeof(info));
+    info.volid    = volid;
+    info.type     = RWVOL;
+    info.dayUse   = -1;
+    info.maxquota = -1;
+    info.flags    = -1;
+    info.spare0   = -1;
+    info.spare1   = -1;
+    info.spare2   = -1;
+    info.spare3   = -1;
+
+    if (as->parms[1].items) {
+       /* -max <quota> */
+       code = util_GetInt32(as->parms[1].items->data, &info.maxquota);
+       if (code) {
+           fprintf(STDERR,"invalid quota value\n");
+           return code;
+       }
+    }
+    if (as->parms[2].items) {
+       /* -clearuse */
+       info.dayUse = 0;
+    }
+    code = UV_SetVolumeInfo(aserver, apart, volid, &info);
+    if (code)
+       fprintf(STDERR,"Could not update volume info fields for volume number %u\n",volid);
+    return (code);
+}
+
 /*------------------------------------------------------------------------
  * PRIVATE volOnline
  *
@@ -1882,7 +1965,7 @@ register struct cmd_syndesc *as;
 {    
         afs_int32 avolid, aserver, apart, code,vcode, err;
        afs_int32 aoverwrite = ASK;
-       int restoreflags;
+       int restoreflags, readonly = 0, offline = 0, voltype = RWVOL;
        char prompt;
        char afilename[NameLen], avolname[VOLSER_MAXVOLNAME +1],apartName[10];
        char volname[VOLSER_MAXVOLNAME +1];
@@ -1922,6 +2005,11 @@ register struct cmd_syndesc *as;
                exit(1);
            }
        }
+       if (as->parms[6].items) offline = 1;
+       if (as->parms[7].items) {
+           readonly = 1;
+           voltype = ROVOL;
+       }
 
        aserver = GetServer(as->parms[0].items->data);
        if (aserver == 0) {
@@ -1968,17 +2056,19 @@ register struct cmd_syndesc *as;
                fprintf(STDERR,"Volume does not exist; Will perform a full restore\n");
        }
 
-       else if (Lp_GetRwIndex(&entry) == -1) {    /* RW volume does not exist - do a full */
-          restoreflags = RV_FULLRST;
-          if ( (aoverwrite == INC) || (aoverwrite == ABORT) )
-             fprintf(STDERR,"RW Volume does not exist; Will perform a full restore\n");
+       else if ((!readonly && Lp_GetRwIndex(&entry) == -1)        /* RW volume does not exist - do a full */
+            ||  (readonly && !Lp_ROMatch(0, 0, &entry))) {        /* RO volume does not exist - do a full */
+           restoreflags = RV_FULLRST;
+           if ( (aoverwrite == INC) || (aoverwrite == ABORT) )
+               fprintf(STDERR,"%s Volume does not exist; Will perform a full restore\n",
+                       readonly ? "RO" : "RW");
 
-          if (avolid == 0) {
-             avolid = entry.volumeId[RWVOL];
-          }
-          else if (entry.volumeId[RWVOL] != 0  && entry.volumeId[RWVOL] != avolid) {
-             avolid = entry.volumeId[RWVOL];
-          }
+           if (avolid == 0) {
+               avolid = entry.volumeId[voltype];
+           }
+           else if (entry.volumeId[voltype] != 0  && entry.volumeId[voltype] != avolid) {
+               avolid = entry.volumeId[voltype];
+           }
        }
 
        else {                    /* volume exists - do we do a full incremental or abort */
@@ -1987,10 +2077,10 @@ register struct cmd_syndesc *as;
            char   c, dc;
 
            if(avolid == 0) {
-               avolid = entry.volumeId[RWVOL];
+               avolid = entry.volumeId[voltype];
            }
-           else if(entry.volumeId[RWVOL] != 0  && entry.volumeId[RWVOL] != avolid) {
-               avolid = entry.volumeId[RWVOL];
+           else if(entry.volumeId[voltype] != 0  && entry.volumeId[voltype] != avolid) {
+               avolid = entry.volumeId[voltype];
            }
            
            /* A file name was specified  - check if volume is on another partition */
@@ -2014,14 +2104,14 @@ register struct cmd_syndesc *as;
                /* Ask what to do */
                if (vol_elsewhere) {
                    fprintf(STDERR,"The volume %s %u already exists on a different server/part\n",
-                           volname, entry.volumeId[RWVOL]);
+                           volname, entry.volumeId[voltype]);
                    fprintf(STDERR, 
                            "Do you want to do a full restore or abort? [fa](a): ");
                }
                else
                {
                    fprintf(STDERR,"The volume %s %u already exists in the VLDB\n",
-                           volname, entry.volumeId[RWVOL]);
+                           volname, entry.volumeId[voltype]);
                    fprintf(STDERR, 
                            "Do you want to do a full/incremental restore or abort? [fia](a): ");
                }
@@ -2044,12 +2134,14 @@ register struct cmd_syndesc *as;
                restoreflags = 0;
                if (vol_elsewhere) {
                    fprintf(STDERR,
-                           "RW volume %u already exists on a different server/part; not allowed\n",
-                           avolid);
+                           "%s volume %u already exists on a different server/part; not allowed\n",
+                           readonly ? "RO" : "RW", avolid);
                    exit(1);
                }
            }
        }
+       if (offline)  restoreflags |= RV_OFFLINE;
+       if (readonly) restoreflags |= RV_RDONLY;
        code = UV_RestoreVolume(aserver, apart, avolid, avolname,
                                restoreflags, WriteData, afilename);
        if (code) {
@@ -2167,6 +2259,42 @@ register struct cmd_syndesc *as;
        fprintf(STDOUT,"Removed replication site %s %s for volume %s\n",as->parms[0].items->data,apartName,as->parms[2].items->data);
     return 0;
 }
+static ChangeLocation(as)
+register struct cmd_syndesc *as;
+{
+   afs_int32 avolid, aserver, apart,code, err;
+   char apartName[10];
+
+       avolid = vsu_GetVolumeID(as->parms[2].items->data, cstruct, &err);
+       if (avolid == 0) {
+           if (err) PrintError("", err);
+           else fprintf(STDERR, "vos: can't find volume '%s'\n", as->parms[2].items->data);
+           exit(1);
+       }
+       aserver = GetServer(as->parms[0].items->data);
+       if (aserver == 0) {
+           fprintf(STDERR,"vos: server '%s' not found in host table\n", as->parms[0].items->data);
+           exit(1);
+       }
+       apart = volutil_GetPartitionID(as->parms[1].items->data);
+       if (apart < 0) {
+           fprintf(STDERR,"vos: could not interpret partition name '%s'\n",as->parms[1].items->data );
+           exit(1);
+       }
+       if (!IsPartValid(apart,aserver,&code)){/*check for validity of the partition */
+           if(code) PrintError("",code);
+           else fprintf(STDERR,"vos : partition %s does not exist on the server\n",as->parms[1].items->data);
+           exit(1);
+       }
+       code = UV_ChangeLocation(aserver, apart, avolid);
+       if (code) {
+           PrintDiagnostics("addsite", code);
+           exit(1);
+       }
+       MapPartIdIntoName(apart,apartName);
+       fprintf(STDOUT,"Changed location to %s %s for volume %s\n",as->parms[0].items->data, apartName,as->parms[2].items->data);
+   return 0;
+}
 
 static ListPartitions(as)
 register struct cmd_syndesc *as;
@@ -3799,6 +3927,8 @@ char *arock; {
        tcell = as->parms[12].items->data;
     if(as->parms[14].items)    /* -serverauth specified */
        sauth = 1;
+    if(as->parms[16].items)    /* -crypt specified */
+       vsu_SetCrypt(1);
     if (code = vsu_ClientInit((as->parms[13].items != 0), confdir, tcell, sauth,
                              &cstruct, UV_SetSecurity)) {
        fprintf(STDERR,"could not initialize VLDB library (code=%u) \n",code);
@@ -3896,12 +4026,22 @@ char **argv; {
     cmd_AddParm(ts, "-file", CMD_SINGLE,CMD_OPTIONAL, "dump file");
     cmd_AddParm(ts, "-id", CMD_SINGLE,CMD_OPTIONAL,  "volume ID");
     cmd_AddParm(ts, "-overwrite", CMD_SINGLE,CMD_OPTIONAL,  "abort | full | incremental");
+    cmd_AddParm(ts, "-offline", CMD_FLAG, CMD_OPTIONAL,
+               "leave restored volume offline");
+    cmd_AddParm(ts, "-readonly", CMD_FLAG, CMD_OPTIONAL,
+               "make restored volume read-only");
     COMMONPARMS;
 
     ts = cmd_CreateSyntax("unlock", LockReleaseCmd, 0, "release lock on VLDB entry for a volume");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
     COMMONPARMS;
 
+    ts = cmd_CreateSyntax("changeloc", ChangeLocation, 0, "change an RW volume's location in the VLDB");
+    cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name for new location");
+    cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name for new location");
+    cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
+    COMMONPARMS;
+
     ts = cmd_CreateSyntax("addsite", AddSite, 0, "add a replication site");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name for new site");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name for new site");
@@ -3955,6 +4095,12 @@ char **argv; {
     COMMONPARMS;
     cmd_CreateAlias (ts, "volinfo");
 
+    ts = cmd_CreateSyntax("setfields", SetFields, 0, "change volume info fields");
+    cmd_AddParm(ts, "-id",        CMD_SINGLE, 0, "volume name or ID");
+    cmd_AddParm(ts, "-maxquota", CMD_SINGLE, CMD_OPTIONAL, "quota (KB)");
+    cmd_AddParm(ts, "-clearuse",  CMD_FLAG,   CMD_OPTIONAL, "clear dayUse");
+    COMMONPARMS;
+
     ts = cmd_CreateSyntax("offline", volOffline, 0, (char *) CMD_HIDDEN);
     cmd_AddParm(ts, "-server",    CMD_SINGLE, 0, "server name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
index 349d86c8b51919f2988c545c8fa44ac76c6f510c..29d5779e7d8b75f81f6c745a3e4ae48ba9b01c72 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.7 2001/09/20 06:17:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vsprocs.c,v 1.1.1.8 2001/10/14 18:07:32 hartmans Exp $");
 
 #include <stdio.h>
 #include <sys/types.h>
@@ -2561,7 +2561,7 @@ UV_RestoreVolume(toserver, topart, tovolid, tovolname, flags, WriteData, rock)
     int islocked;
     struct restoreCookie cookie;
     int reuseID;
-    afs_int32 newDate, volflag;
+    afs_int32 newDate, volflag, voltype, volsertype;
     int index, same, errcode;
     char apartName[10];
 
@@ -2577,6 +2577,14 @@ UV_RestoreVolume(toserver, topart, tovolid, tovolname, flags, WriteData, rock)
     totid = 0;
     temptid = 0;
 
+    if (flags & RV_RDONLY) {
+       voltype    = ROVOL;
+       volsertype = volser_RO;
+    } else {
+       voltype    = RWVOL;
+       volsertype = volser_RW;
+    }
+
     pvolid = tovolid;
     toconn = UV_Bind(toserver, AFSCONF_VOLUMEPORT);
     if(pvolid == 0) {/*alot a new id if needed */
@@ -2589,8 +2597,19 @@ UV_RestoreVolume(toserver, topart, tovolid, tovolname, flags, WriteData, rock)
                goto refail;
            }
            reuseID = 0;
-        }
-       else{
+        } else if (flags & RV_RDONLY) {
+           if (entry.flags & RW_EXISTS) {
+               fprintf(STDERR,"Entry for ReadWrite volume %s already exists!\n",entry.name);
+               error = VOLSERBADOP;
+               goto refail;
+           }
+           if (!entry.volumeId[ROVOL]) {
+               fprintf(STDERR,"Existing entry for volume %s has no ReadOnly ID\n",tovolname);
+               error = VOLSERBADOP;
+               goto refail;
+           }
+           pvolid = entry.volumeId[ROVOL];
+       } else {
            pvolid = entry.volumeId[RWVOL];
        }
     }/* at this point we have a volume id to use/reuse for the volume to be restored */
@@ -2604,9 +2623,7 @@ UV_RestoreVolume(toserver, topart, tovolid, tovolname, flags, WriteData, rock)
     fprintf(STDOUT,"Restoring volume %s Id %u on server %s partition %s ..", tovolname,
            pvolid, hostutil_GetNameByINet(toserver), partName);
     fflush(STDOUT);
-    /*what should the volume be restored as ? rw or ro or bk ?
-      right now the default is rw always */
-    code = AFSVolCreateVolume(toconn, topart, tovolname, volser_RW, 0,&pvolid, &totid);
+    code = AFSVolCreateVolume(toconn, topart, tovolname, volsertype, 0,&pvolid, &totid);
     if (code){
        if (flags & RV_FULLRST) { /* full restore: delete then create anew */
            if(verbose) {
@@ -2640,7 +2657,7 @@ UV_RestoreVolume(toserver, topart, tovolid, tovolname, flags, WriteData, rock)
                goto refail;
            }
            if (verbose) fprintf(STDOUT," done\n");
-           code = AFSVolCreateVolume(toconn, topart, tovolname, volser_RW, 0,&pvolid, &totid);
+           code = AFSVolCreateVolume(toconn, topart, tovolname, volsertype, 0,&pvolid, &totid);
            if (code){
                fprintf(STDERR,"Could not create new volume %u\n",pvolid);
                error = code;
@@ -2657,7 +2674,7 @@ UV_RestoreVolume(toserver, topart, tovolid, tovolname, flags, WriteData, rock)
        }
     }
     cookie.parent = pvolid;
-    cookie.type = RWVOL;
+    cookie.type = voltype;
     cookie.clone = 0;
     strncpy(cookie.name,tovolname,VOLSER_OLDMAXVOLNAME);
 
@@ -2683,11 +2700,11 @@ UV_RestoreVolume(toserver, topart, tovolid, tovolname, flags, WriteData, rock)
     }
     code = AFSVolGetStatus(toconn,totid, &tstatus);
     if(code) {
-       fprintf(STDERR,"Could not get status information about the volume %u\n",tovolid);
+       fprintf(STDERR,"Could not get status information about the volume %u\n",pvolid);
        error = code;
        goto refail;
     }
-    code = AFSVolSetIdsTypes(toconn,totid, tovolname, RWVOL, pvolid,0,0);
+    code = AFSVolSetIdsTypes(toconn,totid, tovolname, voltype, pvolid,0,0);
     if(code) {
        fprintf(STDERR,"Could not set the right type and ID on %u\n",pvolid); 
        error = code;
@@ -2726,7 +2743,7 @@ UV_RestoreVolume(toserver, topart, tovolid, tovolname, flags, WriteData, rock)
         /* Volume was restored on the file server, update the 
         * VLDB to reflect the change.
         */
-       vcode = VLDB_GetEntryByID(pvolid,RWVOL, &entry);
+       vcode = VLDB_GetEntryByID(pvolid,voltype, &entry);
        if(vcode && vcode != VL_NOENT && vcode != VL_ENTDELETED) {
            fprintf(STDERR,"Could not fetch the entry for volume number %u from VLDB \n",pvolid);
            error = vcode;
@@ -2740,9 +2757,11 @@ UV_RestoreVolume(toserver, topart, tovolid, tovolname, flags, WriteData, rock)
            entry.nServers = 1;
            entry.serverNumber[0] = toserver;/*should be indirect */
            entry.serverPartition[0] = topart;
-           entry.serverFlags[0] = ITSRWVOL;
-           entry.flags = RW_EXISTS;
-           if(tstatus.cloneID != 0){
+           entry.serverFlags[0] = (flags & RV_RDONLY) ? ITSROVOL : ITSRWVOL;
+           entry.flags = (flags & RV_RDONLY) ? RO_EXISTS : RW_EXISTS;
+           if (flags & RV_RDONLY)
+               entry.volumeId[ROVOL] = pvolid;
+           else if(tstatus.cloneID != 0){
                entry.volumeId[ROVOL] = tstatus.cloneID;/*this should come from status info on the volume if non zero */
            }
            else
@@ -2772,7 +2791,7 @@ UV_RestoreVolume(toserver, topart, tovolid, tovolname, flags, WriteData, rock)
                EnumerateEntry(&entry);
                fprintf(STDOUT,"------- New entry -------\n");
            }
-           vcode = ubik_Call(VL_SetLock,cstruct, 0, pvolid, RWVOL, VLOP_RESTORE);
+           vcode = ubik_Call(VL_SetLock,cstruct, 0, pvolid, voltype, VLOP_RESTORE);
            if(vcode) {
                fprintf(STDERR,"Could not lock the entry for volume number %u \n",pvolid);
                error = vcode;
@@ -2782,12 +2801,16 @@ UV_RestoreVolume(toserver, topart, tovolid, tovolname, flags, WriteData, rock)
            strcpy(entry.name, tovolname);
 
            /* Update the vlentry with the new information */
-           index = Lp_GetRwIndex(&entry);
+           if (flags & RV_RDONLY)
+               index = Lp_ROMatch(toserver, topart, &entry) - 1;
+           else
+               index = Lp_GetRwIndex(&entry);
            if (index == -1) {
-              /* Add the rw site for the volume being restored */
+              /* Add the new site for the volume being restored */
               entry.serverNumber[entry.nServers]    = toserver;
               entry.serverPartition[entry.nServers] = topart;
-              entry.serverFlags[entry.nServers]     = ITSRWVOL;
+              entry.serverFlags[entry.nServers]     =
+                       (flags & RV_RDONLY) ? ITSROVOL : ITSRWVOL;
               entry.nServers++;
            } else {
               /* This volume should be deleted on the old site
@@ -2837,9 +2860,9 @@ UV_RestoreVolume(toserver, topart, tovolid, tovolname, flags, WriteData, rock)
               entry.serverPartition[index] = topart;
            }
 
-           entry.flags |= RW_EXISTS;
+           entry.flags |= (flags & RV_RDONLY) ? RO_EXISTS : RW_EXISTS;
            MapNetworkToHost(&entry,&storeEntry);
-           vcode = VLDB_ReplaceEntry(pvolid,RWVOL, &storeEntry,LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP );
+           vcode = VLDB_ReplaceEntry(pvolid,voltype, &storeEntry,LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP );
            if(vcode) {
                fprintf(STDERR,"Could not update the entry for volume number %u  \n",pvolid);
                error = vcode;
@@ -2857,7 +2880,7 @@ UV_RestoreVolume(toserver, topart, tovolid, tovolname, flags, WriteData, rock)
          if (!error) error = code;
       }
       if(islocked) {
-         vcode = ubik_Call(VL_ReleaseLock,cstruct, 0, pvolid, RWVOL, LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
+         vcode = ubik_Call(VL_ReleaseLock,cstruct, 0, pvolid, voltype, LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
          if(vcode) {
              fprintf(STDERR,"Could not release lock on the VLDB entry for the volume %u\n",pvolid);
              if(!error) error = vcode;
@@ -3062,6 +3085,55 @@ afs_int32 server, part, volid;
     return 0;
 }
 
+/*sets <server> <part> as read/write site for <volid> in the vldb */
+UV_ChangeLocation(server, part, volid)
+afs_int32 server, part, volid;
+{
+    afs_int32 vcode;
+    struct nvldbentry entry,storeEntry;
+    int index;
+
+    vcode = ubik_Call(VL_SetLock,cstruct, 0,volid,RWVOL, VLOP_ADDSITE);
+    if(vcode) {
+       fprintf(STDERR," Could not lock the VLDB entry for volume %u \n", volid);
+       PrintError("",vcode);
+       return(vcode);
+    }
+    vcode = VLDB_GetEntryByID(volid,RWVOL, &entry);
+    if(vcode) {
+       fprintf(STDERR,"Could not fetch the entry for volume number %u from VLDB \n",volid);
+       PrintError("",vcode);
+       return (vcode);
+    }
+    MapHostToNetwork(&entry);
+    index = Lp_GetRwIndex(&entry);
+    if (index < 0) {
+       /* no RW site exists  */
+       fprintf(STDERR,"No existing RW site for volume %u", volid);
+       vcode = ubik_Call(VL_ReleaseLock,cstruct, 0, volid, RWVOL, LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
+       if(vcode) {
+           fprintf(STDERR,"Could not release lock on entry for volume %u \n",volid);
+           PrintError("",vcode);
+           return(vcode);
+       }
+       return VOLSERBADOP;
+    }
+    else { /* change the RW site */
+       entry.serverNumber[index] = server;
+       entry.serverPartition[index] = part;
+       MapNetworkToHost(&entry,&storeEntry);
+       vcode = VLDB_ReplaceEntry(volid,RWVOL,&storeEntry,LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
+       if(vcode){ 
+           fprintf(STDERR,"Could not update entry for volume %u \n",volid);
+           PrintError("",vcode);
+           ubik_Call(VL_ReleaseLock,cstruct, 0, volid, RWVOL, LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
+           return(vcode);
+       }
+       if(verbose) fprintf(STDOUT," done\n");
+    }
+    return 0;
+}
+
 /*list all the partitions on <aserver> */
 UV_ListPartitions(aserver, ptrPartList, cntp)
     afs_int32 aserver;
@@ -4911,7 +4983,7 @@ UV_SetVolume(server, partition, volid, transflag, setflag, sleeptime)
  error_exit:
   if (tid) {
      rcode = 0;
-     code = AFSVolEndTrans(conn, tid, &code);
+     code = AFSVolEndTrans(conn, tid, &rcode);
      if (code || rcode) {
         fprintf(STDERR, "SetVolumeStatus: EndTrans Failed\n");
        if (!error) error = (code ? code : rcode);
@@ -4922,6 +4994,46 @@ UV_SetVolume(server, partition, volid, transflag, setflag, sleeptime)
   return(error);
 }
 
+UV_SetVolumeInfo(server, partition, volid, infop)
+  afs_int32 server, partition, volid;
+  volintInfo *infop;
+{
+  struct rx_connection *conn = 0;
+  afs_int32 tid=0;
+  afs_int32 code, error=0, rcode;
+
+  conn = UV_Bind(server, AFSCONF_VOLUMEPORT);
+  if (!conn) {
+     fprintf(STDERR, "SetVolumeInfo: Bind Failed");
+     ERROR_EXIT(-1);
+  }
+
+  code = AFSVolTransCreate(conn, volid, partition, ITOffline, &tid);
+  if (code) {
+     fprintf(STDERR, "SetVolumeInfo: TransCreate Failed\n");
+     ERROR_EXIT(code);
+  }
+  
+  code = AFSVolSetInfo(conn, tid, infop);
+  if (code) {
+     fprintf(STDERR, "SetVolumeInfo: SetInfo Failed\n");
+     ERROR_EXIT(code);
+  }
+  
+ error_exit:
+  if (tid) {
+     rcode = 0;
+     code = AFSVolEndTrans(conn, tid, &rcode);
+     if (code || rcode) {
+        fprintf(STDERR, "SetVolumeInfo: EndTrans Failed\n");
+       if (!error) error = (code ? code : rcode);
+     }
+  }
+
+  if (conn) rx_DestroyConnection(conn);
+  return(error);
+}
+
 /*maps the host addresses in <old > (present in network byte order) to
  that in< new> (present in host byte order )*/
 void
index 757ae8074b2bdf229dc7c3c20e17d9a7bc1e4e8c..8e53fb21c75a5f1663d866023857e6dce66c6f8d 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.8 2001/09/20 06:17:12 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vsutils.c,v 1.1.1.9 2001/10/14 18:07:32 hartmans Exp $");
 
 #include <afs/stds.h>
 #ifdef AFS_NT40_ENV
@@ -45,6 +45,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vsutils.c,v 1.1.1.8 2001/09/20 0
 #include "lockdata.h"
 
 struct ubik_client *cstruct;
+static rxkad_level vsu_rxkad_level = rxkad_clear;
 extern int VL_CreateEntry(), VL_CreateEntryN();
 extern int VL_GetEntryByID(), VL_GetEntryByIDN();
 extern int VL_GetEntryByNameO(), VL_GetEntryByNameN();
@@ -365,6 +366,23 @@ afs_int32 subik_Call(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p9,
 #endif /* notdef */
 
 
+/*
+  Set encryption.  If 'cryptflag' is nonzero, encrpytion is turned on
+  for authenticated connections; if zero, encryption is turned off.
+  Calling this function always results in a level of at least rxkad_auth;
+  to get a rxkad_clear connection, simply don't call this.
+*/
+void vsu_SetCrypt(cryptflag)
+    int cryptflag;
+{
+  if (cryptflag) {
+    vsu_rxkad_level = rxkad_crypt;
+  } else {
+    vsu_rxkad_level = rxkad_auth;
+  }
+}
+
+
 /*
   Get the appropriate type of ubik client structure out from the system.
 */
@@ -463,7 +481,7 @@ afs_int32 vsu_ClientInit(noAuthFlag, confDir, cellName, sauth, uclientp, secproc
             break;
           case 2:
             sc = (struct rx_securityClass *)rxkad_NewClientSecurityObject(
-                 rxkad_clear, &ttoken.sessionKey, ttoken.kvno,
+                 vsu_rxkad_level, &ttoken.sessionKey, ttoken.kvno,
                  ttoken.ticketLen, ttoken.ticket);
             break;
           default: