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

303 files changed:
src/BUILDNOTES
src/NTMakefile
src/README
src/README.OBSOLETE
src/README.SECURITY
src/WINNT/afsd/NTMakefile
src/WINNT/afsd/afsd.h
src/WINNT/afsd/afsd_init.c
src/WINNT/afsd/afsd_init.h
src/WINNT/afsd/afsd_service.c
src/WINNT/afsd/cm.h
src/WINNT/afsd/cm_access.c
src/WINNT/afsd/cm_access.h
src/WINNT/afsd/cm_aclent.c
src/WINNT/afsd/cm_buf.c
src/WINNT/afsd/cm_buf.h
src/WINNT/afsd/cm_callback.c
src/WINNT/afsd/cm_callback.h
src/WINNT/afsd/cm_cell.c
src/WINNT/afsd/cm_config.c
src/WINNT/afsd/cm_config.h
src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/cm_conn.h
src/WINNT/afsd/cm_daemon.c
src/WINNT/afsd/cm_dcache.c
src/WINNT/afsd/cm_dir.c
src/WINNT/afsd/cm_dnlc.c
src/WINNT/afsd/cm_ioctl.c
src/WINNT/afsd/cm_ioctl.h
src/WINNT/afsd/cm_rpc.c
src/WINNT/afsd/cm_rpc.h
src/WINNT/afsd/cm_scache.c
src/WINNT/afsd/cm_scache.h
src/WINNT/afsd/cm_server.c
src/WINNT/afsd/cm_server.h
src/WINNT/afsd/cm_user.c
src/WINNT/afsd/cm_utils.c
src/WINNT/afsd/cm_vnodeops.c
src/WINNT/afsd/cm_vnodeops.h
src/WINNT/afsd/cm_volume.c
src/WINNT/afsd/fs_utils.h
src/WINNT/afsd/smb.c
src/WINNT/afsd/smb.h
src/WINNT/afsd/smb3.c
src/WINNT/afsd/smb3.h
src/WINNT/afsd/smb_iocons.h
src/WINNT/afsd/smb_ioctl.c
src/WINNT/afsd/smb_ioctl.h
src/WINNT/afsreg/NTMakefile
src/WINNT/client_config/NTMakefile
src/WINNT/client_config/lang/NTMakefile
src/WINNT/client_cpa/NTMakefile
src/WINNT/client_cpa/lang/NTMakefile
src/WINNT/client_creds/lang/NTMakefile
src/WINNT/client_exp/NTMakefile
src/WINNT/client_exp/lang/NTMakefile
src/WINNT/client_osi/NTMakefile
src/WINNT/client_osi/osi.h
src/WINNT/client_osi/osifd.c
src/WINNT/client_osi/osifd.h
src/WINNT/client_osi/osilog.c
src/WINNT/client_osi/osilog.h
src/WINNT/client_osi/osiqueue.c
src/WINNT/client_osi/osisleep.h
src/WINNT/eventlog/NTMakefile
src/WINNT/eventlog/lang/NTMakefile
src/WINNT/install/InstallShield5/CreateISDirTree.bat
src/WINNT/install/InstallShield5/Default.rge
src/WINNT/install/InstallShield5/GenFileGroups.bat
src/WINNT/install/InstallShield5/NTMakefile
src/WINNT/install/InstallShield5/afsdcell.ini
src/WINNT/install/InstallShield5/lang/en_US/value.shl
src/WINNT/install/InstallShield5/setup.bmp
src/WINNT/install/InstallShield5/setup.rul
src/WINNT/license/lang/en_US.ide
src/WINNT/pthread/NTMakefile
src/WINNT/talocale/NTMakefile
src/afs/IRIX/osi_vnodeops.c
src/afs/LINUX/osi_groups.c
src/afs/Makefile
src/afs/SOLARIS/osi_vfsops.c
src/afs/UKERNEL/afs_usrops.c
src/afs/UKERNEL/afs_usrops.h
src/afs/VNOPS/afs_vnop_access.c
src/afs/VNOPS/afs_vnop_attrs.c
src/afs/VNOPS/afs_vnop_create.c
src/afs/VNOPS/afs_vnop_flock.c
src/afs/afs_cell.c
src/afs/afs_init.c
src/afs/afs_osi_pag.c
src/afs/afs_server.c
src/afsd/afsd.c
src/afsmonitor/Makefile
src/afsmonitor/afsmon-output.c
src/afsmonitor/afsmon-win.c
src/afsmonitor/afsmonitor.c
src/afsmonitor/afsmonitor.h
src/audit/Makefile
src/audit/NTMakefile
src/audit/audit.c
src/auth/Makefile
src/auth/NTMakefile
src/auth/cellconfig.c
src/auth/cellconfig.p.h
src/auth/ktc_nt.c
src/auth/userok.c
src/bozo/Makefile
src/bozo/bosserver.c
src/bucoord/Makefile
src/bucoord/commands.c
src/cmd/Makefile
src/cmd/NTMakefile
src/comerr/NTMakefile
src/comerr/compile_et.c
src/comerr/error_table.y
src/comerr/et_lex.lex.l
src/comerr/et_lex.lex_nt.c
src/config/Makefile
src/config/Makefile.version-NOCML
src/config/NTMakefile
src/config/NTMakefile.i386_nt40
src/config/afs_args.h
src/config/afs_sysnames.h
src/config/param.alpha_dux40_usr.h
src/config/param.i386_fbsd_42.h
src/config/param.i386_fbsd_42_usr.h
src/config/param.i386_linux24_usr.h
src/config/param.i386_nt40.h
src/config/param.ppc_darwin_12.h
src/config/param.ppc_darwin_12_usr.h
src/config/param.ppc_darwin_13.h
src/config/param.ppc_darwin_13_usr.h
src/config/param.s390_linux22.h
src/config/param.sun4x_55.h
src/config/param.sun4x_55_usr.h
src/config/param.sun4x_56.h
src/config/param.sun4x_56_usr.h
src/config/param.sun4x_57.h
src/config/param.sun4x_57_usr.h
src/config/param.sun4x_58.h
src/config/param.sun4x_58_usr.h
src/config/param.sunx86_54.h
src/dauth/Makefile
src/des/Makefile
src/des/NTMakefile
src/des/andrew-conf.h
src/des/cksum.c
src/des/crypt.c
src/des/make_p_table.c
src/des/make_s_table.c
src/des/new_rnd_key.c
src/des/quad_cksum.c
src/des/read_pssword.c
src/des/strng_to_key.c
src/des/test/key_test.c
src/des/test/testit.c
src/des/test/verify.c
src/des/weak_key.c
src/des_stub/NTMakefile
src/dir/Makefile
src/finale/translate_et.c
src/fsint/Makefile
src/fsint/NTMakefile
src/kauth/Makefile
src/kauth/NTMakefile
src/kauth/admin_tools.c
src/kauth/authclient.c
src/kauth/kalocalcell.c
src/kauth/kautils.p.h
src/kauth/krb_udp.c
src/kauth/rebuild.c
src/libacl/NTMakefile
src/libadmin/Makefile
src/libadmin/NTMakefile
src/libadmin/adminutil/afs_utilAdmin.c
src/libadmin/bos/afs_bosAdmin.c
src/libadmin/client/afs_clientAdmin.c
src/libadmin/kas/afs_kasAdmin.c
src/libadmin/kas/afs_kasAdmin.h
src/libadmin/samples/rxstat_get_version.c
src/libadmin/vos/Makefile
src/libadmin/vos/afs_vosAdmin.c
src/libadmin/vos/afs_vosAdmin.h
src/libadmin/vos/lockprocs.c
src/libadmin/vos/lockprocs.h
src/libadmin/vos/vosutils.c
src/libadmin/vos/vosutils.h
src/libadmin/vos/vsprocs.c
src/libadmin/vos/vsprocs.h
src/libafsauthent/Makefile
src/libafsauthent/NTMakefile
src/libafsrpc/Makefile
src/libafsrpc/NTMakefile
src/libuafs/Makefile.common
src/libuafs/MakefileProto.AIX
src/libuafs/MakefileProto.DARWIN
src/libuafs/MakefileProto.DUX
src/libuafs/MakefileProto.FBSD
src/libuafs/MakefileProto.HPUX
src/libuafs/MakefileProto.IRIX
src/libuafs/MakefileProto.LINUX
src/libuafs/MakefileProto.SOLARIS
src/log/Makefile
src/lwp/Makefile
src/lwp/NTMakefile
src/lwp/iomgr.c
src/lwp/lwp_nt.c
src/lwp/process.s
src/lwp/threadname.c
src/lwp/timer.c
src/lwp/waitkey.c
src/ntbuild.bat
src/pam/Makefile
src/pinstall/Makefile
src/procmgmt/Makefile
src/procmgmt/NTMakefile
src/ptserver/Makefile
src/ptserver/NTMakefile
src/ptserver/ptserver.c
src/ptserver/ptutils.c
src/ptserver/ubik.c
src/rx/LINUX/rx_kmutex.h
src/rx/Makefile
src/rx/NTMakefile
src/rx/rx.h
src/rx/rx_clock.c
src/rx/rx_conncache.c
src/rx/rx_event.c
src/rx/rx_getaddr.c
src/rx/rx_lwp.c
src/rx/rx_misc.c
src/rx/rx_packet.c
src/rx/rx_packet.h
src/rx/rx_pthread.c
src/rx/rx_rdwr.c
src/rx/rx_trace.c
src/rx/rx_user.c
src/rx/rx_xmit_nt.c
src/rx/rx_xmit_nt.h
src/rx/rxdebug.c
src/rx/xdr.h
src/rx/xdr_rx.c
src/rxgen/Makefile
src/rxgen/NTMakefile
src/rxgen/rpc_clntout.c
src/rxgen/rpc_cout.c
src/rxgen/rpc_hout.c
src/rxgen/rpc_main.c
src/rxgen/rpc_parse.c
src/rxgen/rpc_scan.c
src/rxgen/rpc_svcout.c
src/rxgen/rpc_util.c
src/rxgen/rpc_util.h
src/rxkad/Makefile
src/rxkad/NTMakefile
src/rxstat/Makefile
src/rxstat/NTMakefile
src/sgistuff/Makefile
src/sia/Makefile
src/sys/Makefile
src/sys/NTMakefile
src/sys/pagsh.c
src/sys/pioctl_nt.c
src/sys/rmtsysc.c
src/sys/rmtsyss.c
src/tbutc/NTMakefile
src/tviced/Makefile
src/ubik/Makefile
src/ubik/NTMakefile
src/ubik/beacon.c
src/ubik/udebug.c
src/update/Makefile
src/update/client.c
src/update/server.c
src/update/utils.c
src/usd/Makefile
src/usd/NTMakefile
src/util/Makefile
src/util/NTMakefile
src/util/afsutil.h
src/util/flipbase64.c
src/util/hostparse.c
src/util/serverLog.c
src/util/snprintf.c
src/util/volparse.c
src/venus/fs.c
src/venus/up.c
src/vfsck/main.c
src/viced/Makefile
src/viced/host.c
src/viced/viced.c
src/vlserver/Makefile
src/vlserver/NTMakefile
src/vlserver/vlserver.c
src/vol/Makefile
src/vol/listinodes.c
src/vol/namei_ops.c
src/vol/volume.c
src/volser/Makefile
src/volser/volprocs.c
src/volser/vos.c
src/volser/vsprocs.c
src/volser/vsutils.c

index 52d9beea47737af2953cf09f3a8f50671ed7570e..d1e19f21e1eb439122aee0f06ec7cb15e3e93fe5 100644 (file)
@@ -6,11 +6,21 @@ Redhat 7.0 (i386_linux22):
        be able to use kgcc to compile all of AFS. Just add CC=kgcc 
        to your make arguments.
 
-       When building for kernels other than the stock kernel you
-       may need to create symlinks in /usr/src named for your 
-       configuration, e.g. linux-2.2.16-22smp pointing to your
-       source tree (linux-2.2.16-22); Redhat provides a unified 
-       source tree with a switch in include/linux/version.h.
+       When building for multiple kernels in one dest tree,
+       if the kernel version string which UTS_RELEASE is defined to in 
+       include/linux/version.h matches the last kernel you built for, 
+        the previous kernel module will be overwritten.
+
+Redhat 7.1 (i386_linux24): 
+       src/venus/kdump.c may fail to compile.
+
+       You will need pam-devel installed to compile the included
+       PAM module.
+
+       When building for multiple kernels in one dest tree,
+       if the kernel version string which UTS_RELEASE is defined to in 
+       include/linux/version.h matches the last kernel you built for, 
+        the previous kernel module will be overwritten.
 
 HPUX 11.0 (hp_ux110):
        Does not currently build libafs, which means no afs client support,
index 02af8afa7cf6cbc91e66b16196aa7ca562e3bac9..b6ebfa5e8a010b581d7280b165dbdb52202beafb 100644 (file)
 
 CD = cd
 NTMAKE = nmake /nologo /f ntmakefile install
+NTMAKELANG = nmake /nologo /f ntmakefile en_US
 NTMAKE_HEADERS = nmake /nologo /f ntmakefile install_headers
 MKDIR = mkdir
+OBJ = obj
 
 # Standard install directory.
 !IFDEF AFSDEV_DESTDIR
@@ -39,362 +41,433 @@ start:
 !      ENDIF
 
 config:
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 procmgmt_headers: config
-       $(CD) src\procmgmt
+     echo ***** $@
+       $(CD) $(OBJ)\procmgmt
        $(NTMAKE_HEADERS)
        $(CD) ..\..
 
 afsreg_headers: config
-       $(CD) src\WINNT\afsreg
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\afsreg
        $(NTMAKE_HEADERS)
        $(CD) ..\..\..
 
 util: procmgmt_headers afsreg_headers
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 comerr: util
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 cmd: comerr
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 afsreg: cmd
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 eventlog: afsreg
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 lwp: eventlog
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 rxgen: lwp
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 des: rxgen
-!      IF (EXIST(src\des\NTMakefile))
-               $(CD) src\des
+     echo ***** $@
+!      IF (EXIST($(OBJ)\des\NTMakefile))
+               $(CD) $(OBJ)\des
                $(NTMAKE)
                $(CD) ..\..
 !      ELSE
-               $(CD) src\des_stub
+               $(CD) $(OBJ)\des_stub
                $(NTMAKE)
                $(CD) ..\..
 !      ENDIF
 
 rx: des
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 rxstat: rx
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 rxkad: rxstat
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 pthread: rxkad
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 procmgmt: pthread
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 fsint: procmgmt
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 audit: fsint
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 osi_headers: audit
-       $(CD) src\WINNT\client_osi
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\client_osi
        $(NTMAKE_HEADERS)
        $(CD) ..\..\..
 
 libacl_headers: osi_headers
-       $(CD) src\libacl
+     echo ***** $@
+       $(CD) $(OBJ)\libacl
        $(NTMAKE_HEADERS)
        $(CD) ..\..
 
 cm_headers: libacl_headers
-       $(CD) src\WINNT\afsd
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\afsd
        $(NTMAKE_HEADERS)
        $(CD) ..\..\..
 
 sys: cm_headers
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 auth: sys
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 ubik: auth
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..     
 
 ptserver: ubik
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..     
 
 libacl: ptserver
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 kauth: libacl
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 vlserver: kauth
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 usd: vlserver
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 bubasics: usd
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 budb:  bubasics
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 butm:  budb
-        $(CD) src\$@
+     echo ***** $@
+        $(CD) $(OBJ)\$@
         $(NTMAKE)
         $(CD) ..\..
 
 dir: butm
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 vol: dir
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 volser: vol
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 viced: volser
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 update: viced
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 bucoord: update
-        $(CD) src\$@
+     echo ***** $@
+        $(CD) $(OBJ)\$@
         $(NTMAKE)
         $(CD) ..\..
 
 butc:   bucoord
-        $(CD) src\$@
+     echo ***** $@
+        $(CD) $(OBJ)\$@
         $(NTMAKE)
         $(CD) ..\..
 
 bozo: butc
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 bosctlsvc: bozo
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 bu_utils: bosctlsvc
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 libafsrpc: bu_utils
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 libafsauthent: libafsrpc
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 tviced: libafsauthent
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
 
 tbutc:  tviced
-        $(CD) src\$@
+     echo ***** $@
+        $(CD) $(OBJ)\$@
         $(NTMAKE)
         $(CD) ..\..
 
 libadmin: tbutc
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..
        
 adminutil: libadmin
-       $(CD) src\libadmin\$@
+     echo ***** $@
+       $(CD) $(OBJ)\libadmin\$@
        $(NTMAKE)
        $(CD) ..\..\..
        
 vos: adminutil
-       $(CD) src\libadmin\$@
+     echo ***** $@
+       $(CD) $(OBJ)\libadmin\$@
        $(NTMAKE)
        $(CD) ..\..\..
        
 client: vos
-       $(CD) src\libadmin\$@
+     echo ***** $@
+       $(CD) $(OBJ)\libadmin\$@
        $(NTMAKE)
        $(CD) ..\..\..
        
 kas: client
-       $(CD) src\libadmin\$@
+     echo ***** $@
+       $(CD) $(OBJ)\libadmin\$@
        $(NTMAKE)
        $(CD) ..\..\..
        
 pts: kas
-       $(CD) src\libadmin\$@
+     echo ***** $@
+       $(CD) $(OBJ)\libadmin\$@
        $(NTMAKE)
        $(CD) ..\..\..
        
 bos: pts
-       $(CD) src\libadmin\$@
+     echo ***** $@
+       $(CD) $(OBJ)\libadmin\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 cfg: bos
-       $(CD) src\libadmin\$@
+     echo ***** $@
+       $(CD) $(OBJ)\libadmin\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 admintest: cfg
-       $(CD) src\libadmin\test
+     echo ***** $@
+       $(CD) $(OBJ)\libadmin\test
        $(NTMAKE)
        $(CD) ..\..\..
 
 talocale: admintest
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 license: talocale
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 afsadmsvr: license
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 afsusrmgr: afsadmsvr
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 afssvrmgr: afsusrmgr
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 afssvrcfg: afssvrmgr
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 afssvrcpa: afssvrcfg
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 afs_setup_utils: afssvrcpa
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 client_talocale: afs_setup_utils
-       $(CD) src\WINNT\talocale
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\talocale
        $(NTMAKE)
        $(CD) ..\..\..
 
 client_osi: client_talocale
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 afsd: client_osi
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 client_cpa: afsd
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 client_config: client_cpa
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 client_exp: client_config
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 client_creds: client_exp
-       $(CD) src\WINNT\$@
+     echo ***** $@
+       $(CD) $(OBJ)\WINNT\$@
        $(NTMAKE)
        $(CD) ..\..\..
 
 finale: client_creds
-       $(CD) src\$@
+     echo ***** $@
+       $(CD) $(OBJ)\$@
        $(NTMAKE)
        $(CD) ..\..     
 
@@ -403,7 +476,7 @@ install: start finale
 # InstallShield dependencies
 
 InstallShield5: install
-       $(CD) src\WINNT\install\$@
+       $(CD) $(OBJ)\WINNT\install\$@
        $(NTMAKE)
        $(CD) ..\..\..\..
 
@@ -411,10 +484,10 @@ media: InstallShield5
 
 
 
-# Clean target for src tree
+# Clean target for obj tree
 clean: start
         nmake /nologo /f ntmakefile "NTMAKE = nmake /nologo /f ntmakefile clean" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile clean" install
-       $(CD) src\config
+       $(CD) $(OBJ)\config
        nmake /nologo /f ntmakefile clean_version
        $(CD) ..\..
 
index c3a40097f3bf3bcd5fcb8898fdcdfa5fc57353ce..ca463b17b1aea9cf9ed1b64f2b68297358792638 100644 (file)
@@ -14,85 +14,70 @@ A. Creating the proper directory structure.
    in afs space is also valid. In the directory that you uncompressed the
    source in, you will only have an src/ directory.
 
-   1. Make a directory for each system type that you plan on
-      building. Current tested system types include the following
-     (this step is skipped for the i386_nt40 system type):
-
-      alpha_dux40/
-      alpha_dux50/ (only tested on 5.0A)
-      i386_linux22/
-      i386_linux24/ (only tested with 2.4.0 kernel)
-      rs_aix42/
-      sgi_65/ (file server not tested)
-      sun4x_56/
-      sun4x_57/
-      sun4x_58/
-      ppc_darwin_13/
-      alpha_linux_2216_22/ (DES does not work, will require one more change to
+   1. Pick a system to build for, and note its default AFS sys_name.
+      A directory will be automatically created for binaries to be written 
+      into with this name when you build.
+
+      alpha_dux40
+      alpha_dux50 (only tested on 5.0A)
+      i386_linux22
+      i386_linux24 (only tested with 2.4.0 kernel)
+      rs_aix42
+      sgi_65 (file server not tested)
+      sun4x_56
+      sun4x_57
+      sun4x_58
+      ppc_darwin_13
+      alpha_linux_22 (DES does not work, will require one more change to
                                compile)
-      hp_ux110/ (No client support, but db servers and utilities work)
-      hp_ux102/ (No client support, but db servers and utilities work)
-
-      Example:
-      % mkdir i386_linux22
-      % ls -CF
-      i386_linux22/     src/
-
-   2. Within each of those directories, create a dest/ and obj/ directory.
-
-      Example:
-      % mkdir i386_linux22/dest
-      % mkdir i386_linux22/obj
-
-   3. Create symbolic links to the system type you are about to build
-      a. If the source is in AFS space
-
-         Example:
-         % ln -s @sys/dest dest
-         % ln -s @sys/obj  obj
-         % ls -CF
-         dest@     i386_linux22/     obj@     src/
-
-         Within AFS space, the AFS Cache Manager automatically
-         substitutes the local machine's AFS system name (CPU/operating
-         system type [ie: alpha_dux40, i386_linux22, ...]) for the @sys
-         variable.
-
-      b. If this source is NOT in AFS space, You must make a link from
-         @sys to your current system type. 
-
-         Example:
-         % ln -s i386_linux22 @sys
-         % ln -s @sys/dest dest
-         % ln -s @sys/obj  obj
-         % ls -CF
-         dest@     i386_linux22/     obj@     src/     sys@
-   5. Create the top level Makefile:
-
-         Example:
-         % ln -s src/Makefile Makefile
-         % ls -CF
-         Makefile@     dest@     i386_linux22/     obj@     src/
+      hp_ux110 (No client support, but db servers and utilities work)
+      hp_ux102 (No client support, but db servers and utilities work)
+
+   2. Using configure in the top level directory, configure for your
+      AFS system type, providing the necessary flags:
+      % ./configure --with-afs-sysname=sun4x_58
+
+      For Linux systems you need also provide the patch in which your
+      kernel headers for your configured kernel can be found. This should
+      be the path of the directory containing a child directory named
+      "include". So if your version file was 
+      /usr/src/linux/include/linux/version.h you would invoke:
+      % ./configure --with-afs-sysname=i386_linux24 --with-linux-kernel-headers=/usr/src/linux
+
+      Currently you can build for only one Linux kernel at a time,
+      and the version is extracted from the kernel headers in the root
+      you specify.
+
+      Be prepared to provide the switches --enable-obsolete and
+      --enable-insecure if you require the use of any bundled but obsolete
+      or insecure software included with OpenAFS. See README.obsolete and
+      README.insecure for more details.
 
 B  Building
 
-   1. Make the obj links. This creates links from the @sys/obj/ tree
-      back to the source tree. The source tree remains unchanged and
-      builds are done in the platform specific object tree.
+   1. Now, you can build OpenAFS. 
 
-      % make links
+      % make
 
-   2. Begin building
-      a. For Linux
-         % make SYS_NAME="i386_linux22" LINUX_VERS="2.2.14"
+      When the build completes, you will have a complete binary tree
+      in the dest directory under the directory named for the sys_name you
+      built for, e.g. sun4x_57/dest or i386_linux22/dest 
 
-      b. For UNIX versions, specify the system name as given by
-         the system type defined in step A1.
-         % make SYS_NAME="<system_name>"
+   2. As appropriate you can clean up or, if you're using Linux, build for
+      another kernel version:
+      a. To clean up:
+         % make clean
 
-         Example for the rs_aix42 operating system:
-        % make SYS_NAME="rs_aix42" 
+      b. To build for another Linux kernel version:
+         the system type defined in step A1.
+         % ./configure --with-afs-sysname=i386_linux22 --with-linux-kernel-headers=/usr/src/linux-2.2.19-i686
+         % make 
+
+         Your dest tree will now include an additional kernel module for your
+         additional kernel headers. Be aware that if the kernel version string
+         which UTS_RELEASE is defined to in include/linux/version.h matches
+         the last kernel you built for, the previous kernel module will be 
+         overwritten.
 
 C  Problems
    If you have a problem building this source, you may want to visit
index 5dc6de1886ed9d23b8135fb8b3df29066d9c8eac..b7ccaaddbe86f60f635b0b36b2b2a680619f0f50 100644 (file)
@@ -13,3 +13,6 @@ with it, mpp) are not strictly part of a distributed filesystem package.
 However, Carnegie Mellon Computing Services has continued to use
 and occasionally develop them, and current versions can be found at:
 ftp://ftp.andrew.cmu.edu/pub/AFS-Tools
+
+To enable building of the obsolete code included with OpenAFS,
+run configure with the --enable-obsolete switch
index d23e764169addacfd675858bfc4c75a1dd51706c..e8f2fe2c5f24af08365ee1c6e0f0a6c69039beb3 100644 (file)
@@ -20,3 +20,6 @@ has RFC2228 security extensions.
 In any case, carefully consider the security implications before deploying 
 these utilities.
 
+To enable building of the insecure code included with OpenAFS, run
+configure with the --enable-insecure switch.
+
index 149b67f6ef62fe23675d35a0b4f60000fdb6e2f4..e8e33daaa360e19b1d173ad62eac083b2631a1d1 100644 (file)
@@ -30,10 +30,12 @@ INCFILES =\
        $(INCFILEDIR)\fs_utils.h \
        $(INCFILEDIR)\krb.h \
        $(INCFILEDIR)\krb_prot.h \
+       $(INCFILEDIR)\cm_dir.h \
        $(INCFILEDIR)\smb.h \
        $(INCFILEDIR)\smb3.h \
        $(INCFILEDIR)\smb_iocons.h \
        $(INCFILEDIR)\smb_ioctl.h \
+       $(INCFILEDIR)\afsmsg95.h \
        $(INCFILEDIR)\afsrpc.h
 
 IDLFILES =\
@@ -162,12 +164,26 @@ install: install_headers $(CONF_DLLFILE) \
        $(EXEDIR)\afsshare.exe \
        $(DESTDIR)\bin\kpasswd.exe
 
+install9X: install_headers $(CONF_DLLFILE) \
+       $(EXEDIR)\klog.exe \
+       $(EXEDIR)\tokens.exe \
+       $(EXEDIR)\unlog.exe $(EXEDIR)\afsd_service.exe \
+       $(EXEDIR)\fs.exe $(EXEDIR)\symlink.exe \
+       $(LOGON_DLLFILE) $(LOG95_DLLFILE) \
+       $(EXEDIR)\afsshare.exe \
+       $(DESTDIR)\bin\kpasswd.exe
+
+install_libutils: install_headers $(CONF_DLLFILE) \
+       $(EXEDIR)\klog.exe \
+       $(EXEDIR)\tokens.exe \
+       $(EXEDIR)\unlog.exe \
+       $(EXEDIR)\fs.exe $(EXEDIR)\symlink.exe \
+       $(EXEDIR)\afsshare.exe \
+       $(DESTDIR)\bin\kpasswd.exe
+
 ############################################################################
 # Local clean target; augments predefined clean target
 
-clean::
-       $(DEL) *.res
-
 ############################################################################
 # assorted exe's
 
@@ -305,3 +321,9 @@ afslogon.res: afslogon.rc AFS_component_version_number.h
 afslog95.res: afslog95.rc AFS_component_version_number.h
 
 libafsconf.res: libafsconf.rc AFS_component_version_number.h
+
+clean::
+       $(DEL) *.res
+       $(DEL) afsrpc.h
+       $(DEL) afsrpc_?.*
+       $(DEL) $(EXELIBS)
index 51b6dc286db0f2bc764c673237dbfae52bf79365..0c6f59fde3684bc55c50f5e3f753d620fd649497 100644 (file)
 #ifndef __AFSD_H_ENV__
 #define __AFSD_H_ENV__ 1
 
+#include <afs/param.h>
+
+#ifndef DJGPP
 BOOL InitClass(HANDLE);
 BOOL InitInstance(HANDLE, int);
 
 LONG APIENTRY MainWndProc(HWND, unsigned int, unsigned int, long);
 BOOL APIENTRY About(HWND, unsigned int, unsigned int, long);
+#endif /* !DJGPP */
 
+#ifndef DJGPP
 #include <nb30.h>
+#else /* DJGPP */
+#include <sys/farptr.h>
+#include <go32.h>
+#include "dosdefs95.h"
+#include "largeint95.h"
+#endif /* !DJGPP */
+
 #include "afsdicon.h"
 
 #include "cm.h"
@@ -26,25 +38,31 @@ BOOL APIENTRY About(HWND, unsigned int, unsigned int, long);
 #include <crypt.h>
 #include <afs/prs_fs.h>
 
-#include "cm_access.h"
+#include <osi.h>
+#include "cm_user.h"
+#include "cm_callback.h"
+#ifdef DISKCACHE95
+#include "cm_diskcache95.h"
+#endif /* DISKCACHE95 */
+#include "cm_conn.h"
 #include "cm_aclent.h"
 #include "cm_cell.h"
 #include "cm_config.h"
 #include "cm_server.h"
-#include "cm_user.h"
-#include "cm_conn.h"
 #include "cm_volume.h"
-#include "cm_access.h"
 #include "cm_scache.h"
 #include "cm_dcache.h"
-#include "cm_buf.h"
-#include "cm_callback.h"
+#include "cm_access.h"
 #include "cm_vnodeops.h"
 #include "cm_dir.h"
 #include "cm_utils.h"
 #include "cm_daemon.h"
 #include "cm_ioctl.h"
 #include "cm_dnlc.h"
+#include "cm_buf.h"
+#ifdef DJGPP
+#include "afs/afsmsg95.h"
+#endif
 
 #include <afs/vldbint.h>
 #include <afs/afsint.h>
@@ -52,6 +70,8 @@ BOOL APIENTRY About(HWND, unsigned int, unsigned int, long);
 #define AFS_DAEMON_SERVICE_NAME "TransarcAFSDaemon"
 #define AFS_DAEMON_EVENT_NAME "AFS Client"
 
+void afs_exit();
+
 /* globals from the base afsd */
 
 extern int cm_logChunkSize;
index f7c7feca5281058bf26f72c65dfeb606ddd98ad5..48cecb4afee62df8d93ded48d2f12e5c1f62ba51 100644 (file)
@@ -210,8 +210,8 @@ int afsd_InitCM(char **reasonP)
        if (code == ERROR_SUCCESS)
                afsi_log("LAN adapter number %d", LANadapter);
        else {
-               LANadapter = 0;
-               afsi_log("Default LAN adapter number 0");
+               LANadapter = -1;
+               afsi_log("Default LAN adapter number");
        }
 
        dummyLen = sizeof(cacheSize);
index 98ed19586a7f9b691122ee59d465d639630d0512..803facc3af5d2a27b2050185745915591006500c 100644 (file)
@@ -9,9 +9,14 @@
 
 void afsi_start();
 
+#ifndef DJGPP
 int afsd_InitCM(char **reasonP);
-int afsd_InitDaemons(char **reasonP);
 int afsd_InitSMB(char **reasonP, void *aMBfunc);
+#else /* DJGPP */
+int afsd_InitCM(char **reasonP, struct cmd_syndesc *as, char *arock);
+int afsd_InitSMB(char **reasonP);
+#endif /* !DJGPP */
+int afsd_InitDaemons(char **reasonP);
 
 void afsd_ForceTrace(BOOL flush);
 
index b8f9b5de9614e714173160eba190986301f1c8f6..3df9c7f51e71c31a6eaad2d20ac3227d2ad7985e 100644 (file)
 #include <winsock2.h>
 
 #include <osi.h>
+\r
+#ifdef DEBUG\r
+//#define NOTSERVICE\r
+#endif\r
 
 extern void afsi_log(char *pattern, ...);
 
@@ -186,6 +190,7 @@ void afsd_Main()
 
        WaitToTerminate = CreateEvent(NULL, TRUE, FALSE, NULL);
 
+#ifndef NOTSERVICE\r
        StatusHandle = RegisterServiceCtrlHandler(AFS_DAEMON_SERVICE_NAME,
                        (LPHANDLER_FUNCTION) afsd_ServiceControlHandler);
 
@@ -197,6 +202,7 @@ void afsd_Main()
        ServiceStatus.dwWaitHint = 15000;
        ServiceStatus.dwControlsAccepted = 0;
        SetServiceStatus(StatusHandle, &ServiceStatus);
+#endif
 {       
         HANDLE h; char *ptbuf[1];
        h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME);
@@ -223,12 +229,14 @@ void afsd_Main()
                if (code != 0)
                        osi_panic(reason, __FILE__, __LINE__);
 
+#ifndef NOTSERVICE
                ServiceStatus.dwCurrentState = SERVICE_RUNNING;
                ServiceStatus.dwWin32ExitCode = NO_ERROR;
                ServiceStatus.dwCheckPoint = 0;
                ServiceStatus.dwWaitHint = 0;
                ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
                SetServiceStatus(StatusHandle, &ServiceStatus);
+#endif
        {
                HANDLE h; char *ptbuf[1];
                h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME);
@@ -261,6 +269,14 @@ void afsd_Main()
        SetServiceStatus(StatusHandle, &ServiceStatus);
 }
 
+#ifdef NOTSERVICE
+void main()
+{
+       afsd_Main();
+       Sleep(1000);
+       return ;
+}
+#else
 void _CRTAPI1 main()
 {
        LONG status = ERROR_SUCCESS;
@@ -272,3 +288,4 @@ void _CRTAPI1 main()
        if (!StartServiceCtrlDispatcher(dispatchTable))
                status = GetLastError();
 }
+#endif
index 8d2043b703d19bff4eea58d7f3412980b15993cf..fbf6af631f1c9ccd2b6a0e2c396bf79e6aff3a60 100644 (file)
 #define __CM_H_ENV__ 1
 
 #include <rx/rx.h>
+#ifdef DJGPP      /* we need these for vldbentry decl., etc. */
+#include <afs/vldbint.h>
+#include <afs/afsint.h>
+#endif /* DJGPP */
 
 /* from .xg file */
 long VL_GetEntryByID(struct rx_connection *, long, long, struct vldbentry *);
@@ -41,36 +45,36 @@ extern RXAFS_FetchStatus (struct rx_connection *,
        struct AFSCallBack *CallBack, 
        struct AFSVolSync *Sync);
 
-StartRXAFS_StoreData (struct rx_call *,
+int StartRXAFS_StoreData (struct rx_call *,
        struct AFSFid *Fid, 
        struct AFSStoreStatus *InStatus, 
        afs_int32 Pos, 
        afs_int32 Length, 
        afs_int32 FileLength);
 
-EndRXAFS_StoreData(struct rx_call *,
+int EndRXAFS_StoreData(struct rx_call *,
        struct AFSFetchStatus *OutStatus, 
        struct AFSVolSync *Sync);
 
-RXAFS_StoreACL (struct rx_connection *,
+int RXAFS_StoreACL (struct rx_connection *,
        struct AFSFid *Fid, 
        struct AFSOpaque *AccessList,  
        struct AFSFetchStatus *OutStatus, 
        struct AFSVolSync *Sync);
 
-RXAFS_StoreStatus(struct rx_connection *,
+int RXAFS_StoreStatus(struct rx_connection *,
        struct AFSFid *Fid, 
        struct AFSStoreStatus *InStatus, 
        struct AFSFetchStatus *OutStatus, 
        struct AFSVolSync *Sync);
 
-RXAFS_RemoveFile (struct rx_connection *,
+int RXAFS_RemoveFile (struct rx_connection *,
        struct AFSFid *DirFid, 
        char *namep,
        struct AFSFetchStatus *OutStatus, 
        struct AFSVolSync *Sync);
 
-RXAFS_CreateFile (struct rx_connection *,
+int RXAFS_CreateFile (struct rx_connection *,
        struct AFSFid *DirFid, 
        char *Name,
        struct AFSStoreStatus *InStatus, 
@@ -80,7 +84,7 @@ RXAFS_CreateFile (struct rx_connection *,
        struct AFSCallBack *CallBack, 
        struct AFSVolSync *Sync);
 
-RXAFS_Rename (struct rx_connection *,
+int RXAFS_Rename (struct rx_connection *,
        struct AFSFid *OldDirFid, 
        char *OldName,
        struct AFSFid *NewDirFid, 
@@ -89,7 +93,7 @@ RXAFS_Rename (struct rx_connection *,
        struct AFSFetchStatus *OutNewDirStatus, 
        struct AFSVolSync *Sync);
 
-RXAFS_Symlink (struct rx_connection *,
+int RXAFS_Symlink (struct rx_connection *,
        struct AFSFid *DirFid, 
        char *name,
        char *LinkContents,
@@ -99,7 +103,7 @@ RXAFS_Symlink (struct rx_connection *,
        struct AFSFetchStatus *OutDirStatus, 
        struct AFSVolSync *Sync);
 
-RXAFS_Link (struct rx_connection *,
+int RXAFS_Link (struct rx_connection *,
        struct AFSFid *DirFid, 
        char *Name,
        struct AFSFid *ExistingFid, 
@@ -107,7 +111,7 @@ RXAFS_Link (struct rx_connection *,
        struct AFSFetchStatus *OutDirStatus, 
        struct AFSVolSync *Sync);
 
-RXAFS_MakeDir (struct rx_connection *,
+int RXAFS_MakeDir (struct rx_connection *,
        struct AFSFid *DirFid, 
        char *name,
        struct AFSStoreStatus *InStatus, 
@@ -117,69 +121,69 @@ RXAFS_MakeDir (struct rx_connection *,
        struct AFSCallBack *CallBack, 
        struct AFSVolSync *Sync);
 
-RXAFS_RemoveDir (struct rx_connection *,
+int RXAFS_RemoveDir (struct rx_connection *,
        struct AFSFid *DirFid, 
        char *Name,
        struct AFSFetchStatus *OutDirStatus, 
        struct AFSVolSync *Sync);
 
-RXAFS_GetStatistics (struct rx_connection *,
+int RXAFS_GetStatistics (struct rx_connection *,
        struct ViceStatistics *Statistics);
 
-RXAFS_GiveUpCallBacks (struct rx_connection *,
+int RXAFS_GiveUpCallBacks (struct rx_connection *,
        struct AFSCBFids *Fids_Array,
        struct AFSCBs *CallBacks_Array);
 
-RXAFS_GetVolumeInfo (struct rx_connection *,
+int RXAFS_GetVolumeInfo (struct rx_connection *,
        char *VolumeName,
        struct VolumeInfo *Volumeinfo);
 
-RXAFS_GetVolumeStatus (struct rx_connection *,
+int RXAFS_GetVolumeStatus (struct rx_connection *,
        afs_int32 Volumeid, 
        struct AFSFetchVolumeStatus *Volumestatus, 
        char **name,
         char **offlineMsg,
         char **motd);
 
-RXAFS_SetVolumeStatus (struct rx_connection *,
+int RXAFS_SetVolumeStatus (struct rx_connection *,
        afs_int32 Volumeid, 
        struct AFSStoreVolumeStatus *Volumestatus,
        char *name,
        char *olm,
        char *motd);
 
-RXAFS_GetRootVolume (struct rx_connection *,
+int RXAFS_GetRootVolume (struct rx_connection *,
        char **VolumeName);
 
-RXAFS_CheckToken (struct rx_connection *,
+int RXAFS_CheckToken (struct rx_connection *,
        afs_int32 ViceId,
        struct AFSOpaque *token);
 
-RXAFS_GetTime (struct rx_connection *,
+int RXAFS_GetTime (struct rx_connection *,
        afs_uint32 *Seconds, 
        afs_uint32 *USeconds);
 
-RXAFS_BulkStatus (struct rx_connection *,
+int RXAFS_BulkStatus (struct rx_connection *,
        struct AFSCBFids *FidsArray,
        struct AFSBulkStats *StatArray,
        struct AFSCBs *CBArray,
        struct AFSVolSync *Sync);
 
-RXAFS_SetLock (struct rx_connection *,
+int RXAFS_SetLock (struct rx_connection *,
        struct AFSFid *Fid, 
        int Type, 
        struct AFSVolSync *Sync);
 
-RXAFS_ExtendLock (struct rx_connection *,
+int RXAFS_ExtendLock (struct rx_connection *,
        struct AFSFid *Fid, 
        struct AFSVolSync *Sync);
 
-RXAFS_ReleaseLock (struct rx_connection *,
+int RXAFS_ReleaseLock (struct rx_connection *,
        struct AFSFid *Fid, 
        struct AFSVolSync *Sync);
 
 /* This interface is to supported the AFS/DFS Protocol Translator */
-RXAFS_Lookup (struct rx_connection *,
+int RXAFS_Lookup (struct rx_connection *,
        struct AFSFid *DirFid,
        char *Name,
        struct AFSFid *OutFid,
@@ -240,5 +244,6 @@ RXAFS_Lookup (struct rx_connection *,
 #define CM_ERROR_NOIPC                 (CM_ERROR_BASE+36)
 #define CM_ERROR_BADNTFILENAME         (CM_ERROR_BASE+37)
 #define CM_ERROR_BUFFERTOOSMALL                (CM_ERROR_BASE+38)
+#define CM_ERROR_RENAME_IDENTICAL      (CM_ERROR_BASE+39)
 
 #endif /*  __CM_H_ENV__ */
index 5d69e70924f1920b3c3c47bed9e6049f28c3e7ac..9b6e1e3580d4c35cb2918c912e150c510c95857f 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
 #include <winsock2.h>
+#endif
 #include <malloc.h>
 #include <string.h>
 #include <stdlib.h>
+#ifndef DJGPP
 #include <nb30.h>
+#endif
 #include <osi.h>
 
 #include "afsd.h"
index f7d1c7f9680f4f4107ff441e09b5707d8c0a2ce7..7e5933ec7bfc577ba2a96cb79a1d6236333411ed 100644 (file)
@@ -10,6 +10,8 @@
 #ifndef _CM_ACCESS_H_ENV__
 #define _CM_ACCESS_H_ENV__ 1
 
+#include "cm_user.h"
+
 extern int cm_HaveAccessRights(struct cm_scache *scp, struct cm_user *up,
        long rights, long *outRights);
 
index 54096b676f169df92597a5fcafc431da91e79468..c0433753af4ec1f11696577458799e5b57e6da65 100644 (file)
@@ -10,7 +10,9 @@
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
+#endif
 #include <stdlib.h>
 #include <string.h>
 #include <malloc.h>
index 22ad75d1b0661001363f2c10d6b2bebe298ddc4c..b4790d9d109acf61501f1be7144d4b0cd7b39330 100644 (file)
@@ -12,7 +12,9 @@
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
+#endif
 #include <osi.h>
 #include <malloc.h>
 #include <stdio.h>
@@ -74,11 +76,13 @@ long buf_nOrigBuffers;
 long buf_bufferSize = CM_BUF_SIZE;
 long buf_hashSize = CM_BUF_HASHSIZE;
 
+#ifndef DJGPP
 static
 HANDLE CacheHandle;
 
 static
 SYSTEM_INFO sysInfo;
+#endif /* !DJGPP */
 
 /* buffer reservation variables */
 long buf_reservedBufs;
@@ -94,6 +98,14 @@ cm_buf_t **buf_hashTablepp;
 /* another hash table */
 cm_buf_t **buf_fileHashTablepp;
 
+#ifdef DISKCACHE95
+/* for experimental disk caching support in Win95 client */
+cm_buf_t *buf_diskFreeListp;
+cm_buf_t *buf_diskFreeListEndp;
+cm_buf_t *buf_diskAllp;
+extern int cm_diskCacheEnabled;
+#endif /* DISKCACHE95 */
+
 /* hold a reference to an already held buffer */
 void buf_Hold(cm_buf_t *bp)
 {
@@ -116,8 +128,12 @@ void buf_IncrSyncer(long parm)
         lock_ReleaseWrite(&buf_globalLock);
         nAtOnce = buf_nbuffers / 10;
        while (1) {
-               i = SleepEx(5000, 1);
+#ifndef DJGPP
+                i = SleepEx(5000, 1);
                 if (i != 0) continue;
+#else
+               thrd_Sleep(5000);
+#endif /* DJGPP */
                 
                 /* now go through our percentage of the buffers */
                 for(i=0; i<nAtOnce; i++) {
@@ -147,6 +163,7 @@ void buf_IncrSyncer(long parm)
         }              /* whole daemon's while loop */
 }
 
+#ifndef DJGPP
 /* Create a security attribute structure suitable for use when the cache file
  * is created.  What we mainly want is that only the administrator should be
  * able to do anything with the file.  We create an ACL with only one entry,
@@ -192,7 +209,9 @@ PSECURITY_ATTRIBUTES CreateCacheFileSA()
 
        return psa;
 }
+#endif /* !DJGPP */
 
+#ifndef DJGPP
 /* Free a security attribute structure created by CreateCacheFileSA() */
 VOID FreeCacheFileSA(PSECURITY_ATTRIBUTES psa)
 {
@@ -204,6 +223,7 @@ VOID FreeCacheFileSA(PSECURITY_ATTRIBUTES psa)
        GlobalFree(psa->lpSecurityDescriptor);
        GlobalFree(psa);
 }
+#endif /* !DJGPP */
        
 /* initialize the buffer package; called with no locks
  * held during the initialization phase.
@@ -213,16 +233,20 @@ long buf_Init(cm_buf_ops_t *opsp)
        static osi_once_t once;
         cm_buf_t *bp;
         long sectorSize;
-        HANDLE phandle;
+        thread_t phandle;
+#ifndef DJGPP
+       HANDLE hf, hm;
+       PSECURITY_ATTRIBUTES psa;
+#endif /* !DJGPP */
        long i;
         unsigned long pid;
-       HANDLE hf, hm;
        char *data;
-       PSECURITY_ATTRIBUTES psa;
        long cs;
 
+#ifndef DJGPP
        /* Get system info; all we really want is the allocation granularity */ 
        GetSystemInfo(&sysInfo);
+#endif /* !DJGPP */
 
        /* Have to be able to reserve a whole chunk */
        if (((buf_nbuffers - 3) * buf_bufferSize) < cm_chunkSize)
@@ -235,6 +259,7 @@ long buf_Init(cm_buf_ops_t *opsp)
                /* initialize global locks */
                lock_InitializeRWLock(&buf_globalLock, "Global buffer lock");
 
+#ifndef DJGPP
                /*
                 * Cache file mapping constrained by
                 * system allocation granularity;
@@ -248,6 +273,7 @@ long buf_Init(cm_buf_ops_t *opsp)
                        afsi_log("Cache size rounded up to %d buffers",
                                 buf_nbuffers);
                }
+#endif /* !DJGPP */
 
                /* remember this for those who want to reset it */
                buf_nOrigBuffers = buf_nbuffers;
@@ -268,6 +294,7 @@ long buf_Init(cm_buf_ops_t *opsp)
                /* min value for which this works */
                sectorSize = 1;
 
+#ifndef DJGPP
                /* Reserve buffer space by mapping cache file */
                psa = CreateCacheFileSA();
                hf = CreateFile(cm_CachePath,
@@ -305,6 +332,10 @@ long buf_Init(cm_buf_ops_t *opsp)
                        return CM_ERROR_INVAL;
                }
                CloseHandle(hm);
+#else
+                /* djgpp doesn't support memory mapped files */
+                data = malloc(buf_nbuffers * buf_bufferSize);
+#endif /* !DJGPP */
 
                 /* create buffer headers and put in free list */
                bp = malloc(buf_nbuffers * sizeof(cm_buf_t));
@@ -345,10 +376,14 @@ long buf_Init(cm_buf_ops_t *opsp)
                osi_EndOnce(&once);
                 
                 /* and create the incr-syncer */
-                phandle = CreateThread((SECURITY_ATTRIBUTES *) 0, 0,
-                       (LPTHREAD_START_ROUTINE) buf_IncrSyncer, 0, 0, &pid);
+                phandle = thrd_Create(0, 0,
+                                      (ThreadFunc) buf_IncrSyncer, 0, 0, &pid,
+                                      "buf_IncrSyncer");
+
                osi_assertx(phandle != NULL, "buf: can't create incremental sync proc");
+#ifndef DJGPP
                CloseHandle(phandle);
+#endif /* !DJGPP */
         }
 
        return 0;
@@ -362,6 +397,7 @@ long buf_AddBuffers(long nbuffers)
        cm_buf_t *bp;
         int i;
        char *data;
+#ifndef DJGPP
        HANDLE hm;
        long cs;
 
@@ -399,6 +435,9 @@ long buf_AddBuffers(long nbuffers)
                return CM_ERROR_INVAL;
        }
        CloseHandle(hm);
+#else
+        data = malloc(buf_nbuffers * buf_bufferSize);
+#endif /* DJGPP */
 
        /* Create buffer headers and put in free list */
         bp = malloc(nbuffers * sizeof(*bp));
@@ -554,6 +593,12 @@ void buf_LockedCleanAsync(cm_buf_t *bp, cm_req_t *reqp)
                 
                 lock_ObtainMutex(&bp->mx);
                 if (code) break;
+
+#ifdef DISKCACHE95
+                /* Disk cache support */
+                /* write buffer to disk cache (synchronous for now) */
+                diskcache_Update(bp->dcp, bp->datap, buf_bufferSize, bp->dataVersion);
+#endif /* DISKCACHE95 */
        };
 
         /* do logging after call to GetLastError, or else */
@@ -857,6 +902,9 @@ long buf_Get(struct cm_scache *scp, osi_hyper_t *offsetp, cm_buf_t **bufpp)
         osi_hyper_t pageOffset;
         unsigned long tcount;
         int created;
+#ifdef DISKCACHE95
+        cm_diskcache_t *dcp;
+#endif /* DISKCACHE95 */
 
        created = 0;
         pageOffset.HighPart = offsetp->HighPart;
@@ -869,6 +917,11 @@ long buf_Get(struct cm_scache *scp, osi_hyper_t *offsetp, cm_buf_t **bufpp)
                        /* lock it and break out */
                        lock_ObtainMutex(&bp->mx);
                         break;
+
+#ifdef DISKCACHE95
+                        /* touch disk chunk to update LRU info */
+                        diskcache_Touch(bp->dcp);
+#endif /* DISKCACHE95 */
                 }
                 
                 /* otherwise, we have to create a page */
@@ -895,15 +948,25 @@ long buf_Get(struct cm_scache *scp, osi_hyper_t *offsetp, cm_buf_t **bufpp)
                osi_assert(!(bp->flags & (CM_BUF_READING | CM_BUF_WRITING)));
 
                /* setup offset, event */
+#ifndef DJGPP  /* doesn't seem to be used */
                bp->over.Offset = bp->offset.LowPart;
                bp->over.OffsetHigh = bp->offset.HighPart;
+#endif /* !DJGPP */
 
                /* start the I/O; may drop lock */
                 bp->flags |= CM_BUF_READING;
                        code = (*cm_buf_opsp->Readp)(bp, buf_bufferSize, &tcount, NULL);
+
+#ifdef DISKCACHE95
+                code = diskcache_Get(&bp->fid, &bp->offset, bp->datap, buf_bufferSize, &bp->dataVersion, &tcount, &dcp);
+                bp->dcp = dcp;    /* pointer to disk cache struct. */
+#endif /* DISKCACHE95 */
+
                if (code != 0) {
                        /* failure or queued */
+#ifndef DJGPP   /* cm_bufRead always returns 0 */
                         if (code != ERROR_IO_PENDING) {
+#endif
                                bp->error = code;
                                 bp->flags |= CM_BUF_ERROR;
                                 bp->flags &= ~CM_BUF_READING;
@@ -914,7 +977,9 @@ long buf_Get(struct cm_scache *scp, osi_hyper_t *offsetp, cm_buf_t **bufpp)
                                lock_ReleaseMutex(&bp->mx);
                                 buf_Release(bp);
                                 return code;
+#ifndef DJGPP
                         }
+#endif
                 } else {
                        /* otherwise, I/O completed instantly and we're done, except
                          * for padding the xfr out with 0s and checking for EOF
index b19950bb50b7532b3484fd3d47696daf9504d5a9..f37094f6ae5bc18ad6a2b53ea0a2d85edd85c6f9 100644 (file)
@@ -13,6 +13,9 @@
 #define _BUF_H__ENV_ 1
 
 #include <osi.h>
+#ifdef DISKCACHE95
+#include "cm_diskcache.h"
+#endif /* DISKCACHE95 */
 
 /* default # of buffers if not changed */
 #define CM_BUF_BUFFERS 100
@@ -78,11 +81,16 @@ typedef struct cm_buf {
         char *datap;           /* data in this buffer */
        unsigned long error;    /* last error code, if CM_BUF_ERROR is set */
         struct cm_user *userp; /* user who wrote to the buffer last */
+#ifndef DJGPP
         OVERLAPPED over;       /* overlapped structure for I/O */
+#endif
         
         /* fields added for the CM; locked by scp->mx */
         long dataVersion;      /* data version of this page */
         long cmFlags;          /* flags for cm */
+#ifdef DISKCACHE95
+        cm_diskcache_t *dcp;    /* diskcache structure */
+#endif /* DISKCACHE95 */
 } cm_buf_t;
 
 /* values for cmFlags */
@@ -143,7 +151,9 @@ extern cm_buf_t *buf_LockedFind(struct cm_scache *, osi_hyper_t *);
 
 extern cm_buf_t *buf_Find(struct cm_scache *, osi_hyper_t *);
 
+#ifndef DJGPP
 extern HANDLE buf_GetFileHandle(long);
+#endif /* !DJGPP */
 
 extern void buf_LockedCleanAsync(cm_buf_t *, cm_req_t *);
 
index c1a0a9d1edbc76b9dfa8b1df69e0b2703826cffe..2801464e1061995ebe569e023f250f05fafd627c 100644 (file)
 #include <afs/afs_args.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
 #include <winsock2.h>
+#else
+#include <sys/socket.h>
+#endif /* !DJGPP */
 #include <malloc.h>
 #include <string.h>
 #include <stdlib.h>
index eb88d8a88c8ac629569bffbe64aadc5d35f4add1..d556c9ea88382b24a3858112394e9c29f8d8db56 100644 (file)
@@ -11,7 +11,6 @@
 #define _CM_CALLBACK_H_ENV__ 1
 
 #include <osi.h>
-#include "cm_scache.h"
 
 typedef struct cm_callbackRequest {
        long callbackCount;             /* callback count at start of the request */
@@ -19,6 +18,8 @@ typedef struct cm_callbackRequest {
         struct cm_server *serverp;     /* server we really got the callback from */
 } cm_callbackRequest_t;
 
+#include "cm_scache.h"
+
 typedef struct cm_racingRevokes {
         osi_queue_t q;                 /* queue for forward/backward searches */
         cm_fid_t fid;                  /* fid revoked */
index fc2f6632c0a973cb28c7cf2ee9dbb3eb7ad8ea41..b8317ebed9b5ad3914f4236e5a993cb5adedbf93 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
 #include <nb30.h>
 #include <winsock2.h>
+#endif /* !DJGPP */
 #include <stdlib.h>
 #include <stdio.h>
 #include <malloc.h>
index 4d0274dba0dcfc153c0a382e099035d9eb968e03..2e1261b2040191e2f59662c7e6476f8d303b7c3d 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
 #include <winsock2.h>
+#else
+#include <sys/socket.h>
+#include <netdb.h>
+#endif /* !DJGPP */
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 char AFSConfigKeyName[] =
        "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters";
 
+#define AFS_THISCELL "ThisCell"
+#define AFS_CELLSERVDB_UNIX "CellServDB"
+#define AFS_CELLSERVDB_NT "afsdcell.ini"
+#define AFSDIR_CLIENT_ETC_DIRPATH "c:/afs"
+#if defined(DJGPP) || defined(AFS_WIN95_ENV)
+#define AFS_CELLSERVDB AFS_CELLSERVDB_UNIX
+#ifdef DJGPP
+extern char cm_confDir[];
+extern int errno;
+#endif /* DJGPP */
+#else
+#define AFS_CELLSERVDB AFS_CELLSERVDB_NT
+#endif /* DJGPP || WIN95 */
+
+
 static long cm_ParsePair(char *lineBufferp, char *leftp, char *rightp)
 {
        char *tp;
@@ -93,20 +113,48 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep,
         int foundCell;
         long code;
        int tracking = 1, partial = 0;
+        long ip_addr;
+#if defined(DJGPP) || defined(AFS_WIN95_ENV)
+        int c1, c2, c3, c4;
+        char aname[256];
+#endif
+        char *afsconf_path;
 
        foundCell = 0;
 
+#if !defined(DJGPP)
        code = GetWindowsDirectory(wdir, sizeof(wdir));
         if (code == 0 || code > sizeof(wdir)) return -1;
-        
+
        /* add trailing backslash, if required */
         tlen = strlen(wdir);
         if (wdir[tlen-1] != '\\') strcat(wdir, "\\");
-
-        strcat(wdir, "afsdcell.ini");
+#else
+        strcpy(wdir, cm_confDir);
+        strcat(wdir,"/");
+#endif /* !DJGPP */
         
+        strcat(wdir, AFS_CELLSERVDB);
+
         tfilep = fopen(wdir, "r");
-        if (!tfilep) return -2;
+
+        if (!tfilep) {
+          /* If we are using DJGPP client, cellservdb will be in afsconf dir. */
+          /* If we are in Win95 here, we are linking with klog etc. and are
+             using DJGPP client even though DJGPP is not defined.  So we still
+             need to check AFSCONF for location. */
+            afsconf_path = getenv("AFSCONF");
+            if (!afsconf_path)
+               strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
+            else
+               strcpy(wdir, afsconf_path);
+            strcat(wdir, "/");
+            strcat(wdir, AFS_CELLSERVDB_UNIX);
+            /*fprintf(stderr, "opening cellservdb file %s\n", wdir);*/
+            tfilep = fopen(wdir, "r");
+            if (!tfilep) return -2;
+        }
+
        bestp = fopen(wdir, "r");
         
        /* have we seen the cell line for the guy we're looking for? */
@@ -181,6 +229,7 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep,
                         else inRightCell = 0;
                 }
                 else {
+#if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
                        valuep = strchr(lineBuffer, '#');
                        if (valuep == NULL) {
                                fclose(tfilep);
@@ -188,8 +237,11 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep,
                                return -4;
                        }
                         valuep++;      /* skip the "#" */
+
                         valuep += strspn(valuep, "     "); /* skip SP & TAB */
+#endif /* !DJGPP */
                        if (inRightCell) {
+#if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
                                /* add the server to the VLDB list */
                                 thp = gethostbyname(valuep);
                                 if (thp) {
@@ -201,11 +253,30 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep,
                                                (*procp)(rockp, &vlSockAddr, valuep);
                                        foundCell = 1;
                                }
+#else
+                                /* For DJGPP, we will read IP address instead
+                                   of name/comment field */
+                                code = sscanf(lineBuffer, "%d.%d.%d.%d #%s",
+                                              &c1, &c2, &c3, &c4, aname);
+                                tp = (char *) &ip_addr;
+                                *tp++ = c1;
+                                *tp++ = c2;
+                                *tp++ = c3;
+                                *tp++ = c4;
+                                memcpy(&vlSockAddr.sin_addr.s_addr, &ip_addr,
+                                               sizeof(long));
+                                vlSockAddr.sin_family = AF_INET;
+                                /* sin_port supplied by connection code */
+                                if (procp)
+                                  (*procp)(rockp, &vlSockAddr, valuep);
+                                foundCell = 1;
+#endif /* !DJGPP */
                         }
                 }      /* a vldb line */
         }              /* while loop processing all lines */
 }
 
+#if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
 /* look up the root cell's name in the Registry */
 long cm_GetRootCellName(char *cellNamep)
 {
@@ -226,6 +297,43 @@ long cm_GetRootCellName(char *cellNamep)
 
        return 0;
 }
+#else
+/* look up the root cell's name in the THISCELL file */
+long cm_GetRootCellName(char *cellNamep)
+{
+        FILE *thisCell;
+        char thisCellPath[256];
+        char *afsconf_path;
+        char *newline;
+
+#ifdef DJGPP
+        strcpy(thisCellPath, cm_confDir);
+#else
+        /* Win 95 */
+        afsconf_path = getenv("AFSCONF");
+        if (!afsconf_path)
+          strcpy(thisCellPath, AFSDIR_CLIENT_ETC_DIRPATH);
+        else
+          strcpy(thisCellPath, afsconf_path);
+#endif
+        strcat(thisCellPath,"/");
+
+        strcat(thisCellPath, AFS_THISCELL);
+        thisCell = fopen(thisCellPath, "r");
+        if (thisCell == NULL)
+          return -1;
+
+        fgets(cellNamep, 256, thisCell);
+        fclose(thisCell);
+
+        newline = strrchr(cellNamep,'\n');
+        if (newline) *newline = '\0';
+        newline = strrchr(cellNamep,'\r');
+        if (newline) *newline = '\0';
+
+        return 0;
+}
+#endif /* !DJGPP */
 
 cm_configFile_t *cm_CommonOpen(char *namep, char *rwp)
 {
@@ -233,13 +341,27 @@ cm_configFile_t *cm_CommonOpen(char *namep, char *rwp)
         long code;
         long tlen;
         FILE *tfilep;
+        char *afsconf_path;
 
+#if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
        code = GetWindowsDirectory(wdir, sizeof(wdir));
         if (code == 0 || code > sizeof(wdir)) return NULL;
         
        /* 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 */
 
         strcat(wdir, namep);
         
@@ -248,6 +370,7 @@ cm_configFile_t *cm_CommonOpen(char *namep, char *rwp)
        return ((cm_configFile_t *) tfilep);        
 }
 
+#ifndef DJGPP
 long cm_WriteConfigString(char *labelp, char *valuep)
 {
        DWORD code, dummyDisp;
@@ -267,7 +390,9 @@ long cm_WriteConfigString(char *labelp, char *valuep)
 
         return 0;
 }
+#endif /* !DJGPP */
 
+#ifndef DJGPP
 long cm_WriteConfigInt(char *labelp, long value)
 {
        DWORD code, dummyDisp;
@@ -287,6 +412,7 @@ long cm_WriteConfigInt(char *labelp, long value)
 
        return 0;
 }
+#endif /* !DJGPP */
 
 cm_configFile_t *cm_OpenCellFile(void)
 {
@@ -305,7 +431,7 @@ long cm_AppendPrunedCellList(cm_configFile_t *ofp, char *cellNamep)
         int inRightCell;
         int foundCell;
 
-        tfilep = cm_CommonOpen("afsdcell.ini", "r");
+        tfilep = cm_CommonOpen(AFS_CELLSERVDB, "r");
         if (!tfilep) return -1;
 
        foundCell = 0;
@@ -383,15 +509,30 @@ extern long cm_CloseCellFile(cm_configFile_t *filep)
         long code;
         long closeCode;
         int tlen;
+        char *afsconf_path;
 
        closeCode = fclose((FILE *)filep);
 
+#if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
        code = GetWindowsDirectory(wdir, sizeof(wdir));
-        if (code == 0 || code > sizeof(wdir)) return -1;
+        if (code == 0 || code > sizeof(wdir)) return NULL;
         
        /* 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(sdir, wdir);
 
        if (closeCode != 0) {
@@ -401,7 +542,7 @@ extern long cm_CloseCellFile(cm_configFile_t *filep)
                 return closeCode;
         }
 
-        strcat(wdir, "afsdcell.ini");
+        strcat(wdir, AFS_CELLSERVDB);
         strcat(sdir, "afsdcel2.ini");  /* new file */
         
         unlink(wdir);                  /* delete old file */
index 2963ff227d04ca4350c8c0aa33761dba67c0cf3e..19ab23660b241fe1d4ad71a48e2233a718b99061 100644 (file)
@@ -21,6 +21,9 @@
 #ifndef __CM_CONFIG_INTERFACES_ONLY__
 
 #include <stdio.h>
+#ifdef DJGPP
+#include <netinet/in.h>
+#endif /* DJGPP */
 
 extern char AFSConfigKeyName[];
 
index c78bc66d090ec02b0e797612d718b5d8fc99470a..0f7406032f534673c12673e460b5407efcba3f3f 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
+#endif /* !DJGPP */
 #include <string.h>
 #include <malloc.h>
 #include <osi.h>
 #include <rx/rx.h>
+#ifndef DJGPP
 #include <rxkad.h>
+#else
+#include <rx/rxkad.h>
+#endif
 
 #include "afsd.h"
 
@@ -45,7 +51,12 @@ void cm_InitConn(void)
 void cm_InitReq(cm_req_t *reqp)
 {
        memset((char *)reqp, 0, sizeof(cm_req_t));
+#ifndef DJGPP
        reqp->startTime = GetCurrentTime();
+#else
+        gettimeofday(&reqp->startTime, NULL);
+#endif
 }
 
 long cm_GetServerList(struct cm_fid *fidp, struct cm_user *userp,
@@ -130,7 +141,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
                        if (tsrp->status == busy)
                                tsrp->status = not_busy;
                }
-               Sleep(5000);
+               thrd_Sleep(5000);
                retry = 1;
        }
 
@@ -154,7 +165,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
                int same;
 
                /* Back off to allow move to complete */
-               Sleep(2000);
+               thrd_Sleep(2000);
 
                /* Update the volume location and see if it changed */
                cm_GetServerList(fidp, userp, reqp, &serversp);
@@ -181,6 +192,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
                 * this is to prevent the SMB session from timing out
                 * In addition, we log an event to the event log 
                 */
+#ifndef DJGPP
                HANDLE h;
                 char *ptbuf[1];
                 char s[100];
@@ -190,6 +202,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
                 ReportEvent(h, EVENTLOG_WARNING_TYPE, 0, 1009, NULL,
                         1, 0, ptbuf, NULL);
                 DeregisterEventSource(h);
+#endif /* !DJGPP */
          
                retry = 0;
                osi_Log0(afsd_logp, "cm_Analyze: hardDeadTime exceeded");
@@ -236,10 +249,19 @@ long cm_ConnByMServers(cm_serverRef_t *serversp, cm_user_t *usersp,
         long firstError = 0;
        int someBusy = 0, someOffline = 0;
        long timeUsed, timeLeft, hardTimeLeft;
+#ifdef DJGPP
+        struct timeval now;
+#endif /* DJGPP */        
 
         *connpp = NULL;
 
+#ifndef DJGPP
        timeUsed = (GetCurrentTime() - reqp->startTime) / 1000;
+#else
+        gettimeofday(&now, NULL);
+        timeUsed = sub_time(now, reqp->startTime) / 1000;
+#endif
+        
        /* leave 5 seconds margin of safety */
        timeLeft = RDRtimeout - timeUsed - 5;
        hardTimeLeft = timeLeft;
index e03bfe60174e7edc3062a05c38aa9df962c2c0f2..4c9a42fe1e01b08e2be210c103459eef07b04e57 100644 (file)
@@ -79,6 +79,8 @@ typedef struct cm_req {
                                   VBUSY above.  This is negative so that old
                                   cache managers treat it as "server is down"*/
 
+#include "cm_server.h"
+
 extern void cm_InitConn(void);
 
 extern void cm_InitReq(cm_req_t *reqp);
index 45177d79692fde7adf5de5d3927f44a320754cc9..33b3dc5e10dabeaeea3681063fd877dab5cc2d19 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
 #include <winsock2.h>
+#else
+#include <netdb.h>
+#endif /* !DJGPP */
 #include <stdlib.h>
 #include <malloc.h>
 #include <string.h>
@@ -113,7 +117,12 @@ void cm_Daemon(long parm)
         */
        gethostname(thostName, sizeof(thostName));
        thp = gethostbyname(thostName);
-       memcpy(&code, thp->h_addr_list[0], 4);
+        if (thp == NULL)    /* In djgpp, gethostname returns the netbios
+                               name of the machine.  gethostbyname will fail
+                               looking this up if it differs from DNS name. */
+          code = 0;
+        else
+          memcpy(&code, thp->h_addr_list[0], 4);
        srand(ntohl(code));
 
        now = osi_Time();
@@ -125,7 +134,7 @@ void cm_Daemon(long parm)
        lastTokenCacheCheck = now - cm_daemonTokenCheckInterval/2 + (rand() % cm_daemonTokenCheckInterval);
        
         while (1) {
-               Sleep(30 * 1000);               /* sleep 30 seconds */
+               thrd_Sleep(30 * 1000);          /* sleep 30 seconds */
                 
                /* find out what time it is */
                now = osi_Time();
@@ -168,7 +177,7 @@ void cm_InitDaemon(int nDaemons)
 {
        static osi_once_t once;
         long pid;
-        HANDLE phandle;
+        thread_t phandle;
         int i;
         
         if (osi_Once(&once)) {
@@ -176,16 +185,17 @@ void cm_InitDaemon(int nDaemons)
                osi_EndOnce(&once);
                 
                 /* creating pinging daemon */
-               phandle = CreateThread((SECURITY_ATTRIBUTES *) 0, 0,
-                       (LPTHREAD_START_ROUTINE) cm_Daemon, 0, 0, &pid);
+               phandle = thrd_Create((SecurityAttrib) 0, 0,
+                       (ThreadFunc) cm_Daemon, 0, 0, &pid, "cm_Daemon");
                osi_assert(phandle != NULL);
 
-               CloseHandle(phandle);
+               thrd_CloseHandle(phandle);
                for(i=0; i < nDaemons; i++) {
-                       phandle = CreateThread((SECURITY_ATTRIBUTES *) 0, 0,
-                               (LPTHREAD_START_ROUTINE) cm_BkgDaemon, 0, 0, &pid);
+                       phandle = thrd_Create((SecurityAttrib) 0, 0,
+                               (ThreadFunc) cm_BkgDaemon, 0, 0, &pid,
+                                              "cm_BkgDaemon");
                        osi_assert(phandle != NULL);
-                       CloseHandle(phandle);
+                       thrd_CloseHandle(phandle);
                }
         }
 }
index f5a649689ce711d1355da8c3188f12adf8e53065..69a08cdf77a06ab8121fd18d246f99706b2e855b 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
 #include <winsock2.h>
+#include <nb30.h>
+#endif /* !DJGPP */
 #include <malloc.h>
 #include <string.h>
 #include <stdlib.h>
-#include <nb30.h>
 #include <osi.h>
 
 #include "afsd.h"
@@ -1113,6 +1115,11 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *up,
         
         lock_ReleaseMutex(&scp->mx);
 
+#ifdef DISKCACHE95
+        DPRINTF("cm_GetBuffer: fetching data scpDV=%d bufDV=%d scp=%x bp=%x dcp=%x\n",
+                scp->dataVersion, bufp->dataVersion, scp, bufp, bufp->dcp);
+#endif /* DISKCACHE95 */
+
        /* now make the call */
         do {
                code = cm_Conn(&scp->fid, up, reqp, &connp);
@@ -1237,6 +1244,12 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *up,
                    qdp = (osi_queueData_t *) osi_QNext(&qdp->q)) {
                        tbufp = osi_GetQData(qdp);
                         tbufp->dataVersion = afsStatus.DataVersion;
+
+#ifdef DISKCACHE95
+                        /* write buffer out to disk cache */
+                        diskcache_Update(tbufp->dcp, tbufp->datap, buf_bufferSize,
+                                         tbufp->dataVersion);
+#endif /* DISKCACHE95 */
                 }
         }
 
index 01d71e59b8e6a5335a44f39ea87612a228f6665d..c32de292e2ec1ebf73824eaa6bc57a54fd915912 100644 (file)
@@ -10,7 +10,9 @@
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
+#endif /* !DJGPP */
 #include <string.h>
 #include <malloc.h>
 #include <osi.h>
index 76052d615a94044b6bac2bad9910b453a77cc986..ec53fbb5d3894ca52818ef24803dbfc1336ae849 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
 #include <winsock2.h>
+#endif /* !DJGPP */
 #include <string.h>
 #include <stdlib.h>
 #include <osi.h>
@@ -41,6 +43,7 @@ static struct nc nameCache[NCSIZE];
 struct nc*     nameHash[NHSIZE];
 
 
+#ifndef DJGPP
 #define dnlcNotify(x,debug){                    \
                         HANDLE  hh;             \
                         char *ptbuf[1];         \
@@ -52,6 +55,9 @@ struct nc*    nameHash[NHSIZE];
                             DeregisterEventSource(hh);                 \
                        }                                               \
                      }  
+#else
+#define dnlcNotify(x,debug)
+#endif /* !DJGPP */
 
 
 static struct nc * 
index db9346df5e92640223e109a089f49730e4d3921e..58d8873b78685df8f0d06d0aa3f35aa2f683d7b9 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
+#else
+#include <sys/socket.h>
+#endif /* !DJGPP */
 #include <errno.h>
 #include <stdlib.h>
 #include <malloc.h>
 
 #include "smb.h"
 
+#ifndef DJGPP
 #include <rxkad.h>
-
 #include "afsrpc.h"
+#else
+#include <rx/rxkad.h>
+#include "afsrpc95.h"
+#endif
+
 #include "cm_rpc.h"
 
 /* Copied from afs_tokens.h */
 #define PIOCTL_LOGON   0x1
+#define MAX_PATH 260
 
 osi_mutex_t cm_Afsdsbmt_Lock;
 
@@ -99,10 +109,17 @@ void cm_ResetACLCache(cm_user_t *userp)
  */
 void TranslateExtendedChars(char *str)
 {
+  char *p;
+  
         if (!str || !*str)
                 return;
 
+#ifndef DJGPP
         CharToOem(str, str);
+#else
+        p = str;
+        while (*p) *p++ &= 0x7f;  /* turn off high bit; probably not right */
+#endif
 }
         
 /* parse the passed-in file name and do a namei on it.  If we fail,
@@ -1367,13 +1384,20 @@ long cm_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
                uname = tp;
                tp += strlen(tp) + 1;
 
+#ifndef DJGPP   /* for win95, session key is back in pioctl */
                /* uuid */
                memcpy(&uuid, tp, sizeof(uuid));
                if (!cm_FindTokenEvent(uuid, sessionKey))
                        return CM_ERROR_INVAL;
+#endif /* !DJGPP */
        } else
                cellp = cm_rootCellp;
 
+       if (flags & PIOCTL_LOGON) {
+          userp = smb_FindCMUserByName(/*ioctlp->fidp->vcp,*/ uname,
+                                                              ioctlp->fidp->vcp->rname);
+       }
+       
        /* store the token */
        lock_ObtainMutex(&userp->mx);
        ucellp = cm_GetUCell(userp, cellp);
@@ -1382,6 +1406,7 @@ long cm_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
                free(ucellp->ticketp);  /* Discard old token if any */
        ucellp->ticketp = malloc(ticketLen);
        memcpy(ucellp->ticketp, ticket, ticketLen);
+#ifndef DJGPP
        /*
         * Get the session key from the RPC, rather than from the pioctl.
         */
@@ -1389,6 +1414,10 @@ long cm_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
        memcpy(&ucellp->sessionKey, ct.HandShakeKey, sizeof(ct.HandShakeKey));
         */
        memcpy(ucellp->sessionKey.data, sessionKey, sizeof(sessionKey));
+#else
+        /* for win95, we are getting the session key from the pioctl */
+        memcpy(&ucellp->sessionKey, ct.HandShakeKey, sizeof(ct.HandShakeKey));
+#endif /* !DJGPP */
        ucellp->kvno = ct.AuthHandle;
        ucellp->expirationTime = ct.EndTimestamp;
        ucellp->gen++;
@@ -1455,6 +1484,7 @@ long cm_IoctlGetTokenIter(struct smb_ioctl *ioctlp, struct cm_user *userp)
 
        /* clear token */
        ct.AuthHandle = ucellp->kvno;
+#ifndef DJGPP
        /*
         * Don't give out a real session key here
         */
@@ -1462,6 +1492,9 @@ long cm_IoctlGetTokenIter(struct smb_ioctl *ioctlp, struct cm_user *userp)
        memcpy(ct.HandShakeKey, &ucellp->sessionKey, sizeof(ct.HandShakeKey));
         */
        memset(ct.HandShakeKey, 0, sizeof(ct.HandShakeKey));
+#else
+       memcpy(ct.HandShakeKey, &ucellp->sessionKey, sizeof(ct.HandShakeKey));
+#endif /* !DJGPP */
        ct.ViceId = 37;                 /* XXX */
        ct.BeginTimestamp = 0;          /* XXX */
        ct.EndTimestamp = ucellp->expirationTime;
@@ -1496,7 +1529,9 @@ long cm_IoctlGetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
        cm_ucell_t *ucellp;
        struct ClearToken ct;
        char *tp;
+#ifndef DJGPP
        afs_uuid_t uuid;
+#endif /* !DJGPP */
 
        cm_SkipIoctlPath(ioctlp);
 
@@ -1509,8 +1544,10 @@ long cm_IoctlGetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
        if (!cellp) return CM_ERROR_NOSUCHCELL;
        tp += strlen(tp) + 1;
 
+#ifndef DJGPP
        /* uuid */
        memcpy(&uuid, tp, sizeof(uuid));
+#endif /* !DJGPP */
 
        lock_ObtainMutex(&userp->mx);
 
@@ -1535,6 +1572,7 @@ long cm_IoctlGetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
 
        /* clear token */
        ct.AuthHandle = ucellp->kvno;
+#ifndef DJGPP
        /*
         * Don't give out a real session key here
         */
@@ -1542,6 +1580,9 @@ long cm_IoctlGetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
        memcpy(ct.HandShakeKey, &ucellp->sessionKey, sizeof(ct.HandShakeKey));
         */
        memset(ct.HandShakeKey, 0, sizeof(ct.HandShakeKey));
+#else
+        memcpy(ct.HandShakeKey, &ucellp->sessionKey, sizeof(ct.HandShakeKey));
+#endif /* !DJGPP */
        ct.ViceId = 37;                 /* XXX */
        ct.BeginTimestamp = 0;          /* XXX */
        ct.EndTimestamp = ucellp->expirationTime;
@@ -1565,7 +1606,9 @@ long cm_IoctlGetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
 
        lock_ReleaseMutex(&userp->mx);
 
+#ifndef DJGPP
        cm_RegisterNewTokenEvent(uuid, ucellp->sessionKey.data);
+#endif /* !DJGPP */
 
        return 0;
 }
@@ -1806,3 +1849,14 @@ long cm_IoctlSetRxkcrypt(smb_ioctl_t *ioctlp, cm_user_t *userp)
 
        return 0;
 }
+
+#ifdef DJGPP
+extern int afsd_shutdown(int);
+extern int afs_shutdown;
+
+long cm_IoctlShutdown(smb_ioctl_t *ioctlp, cm_user_t *userp)
+{
+  afs_shutdown = 1;   /* flag to shut down */
+  return 0;
+}
+#endif /* DJGPP */
index 0346d29c75e2b2d9b786c937c64f7ff2cff2f0bc..ee5b338ac54e29a89e883a00d01bc86b19b325c3 100644 (file)
@@ -123,6 +123,9 @@ extern long cm_IoctlGetRxkcrypt(smb_ioctl_t *ioctlp, cm_user_t *userp);
 
 extern long cm_IoctlSetRxkcrypt(smb_ioctl_t *ioctlp, cm_user_t *userp);
 
+extern long cm_IoctlShutdown(smb_ioctl_t *ioctlp, cm_user_t *userp);
+
+
 #endif /* __CM_IOCTL_INTERFACES_ONLY__ */
 
 #endif /*  __CM_IOCTL_H_ENV__ */
index ca297f61ab6339d3bd8a60ab7868d60f3bad3c2a..33f4c8ee4806b26e0673ad62ff498e4f6608ccb0 100644 (file)
 #include <malloc.h>
 
 #include <osi.h>
+#ifndef DJGPP
 #include "afsrpc.h"
+#else
+#include "afsrpc95.h"
+#endif
 
 #include "afsd.h"
 #include "afsd_init.h"
index 3245cc68a85418eecd8494d8a2e00cff69aae6ad..beba2e3d7f314fd7eb5a797130871e07a97afaf5 100644 (file)
 #ifndef        __CM_RPC_H__
 #define __CM_RPC_H__
 
+#ifndef DJGPP
 #include "afsrpc.h"
+#else
+#include "afsrpc95.h"
+#endif
 
 void cm_RegisterNewTokenEvent(afs_uuid_t uuid, char sessionKey[8]);
 BOOL cm_FindTokenEvent(afs_uuid_t uuid, char sessionKey[8]);
index 16bd46c7349ae16cb3a2e14aec6ebafdd63b398f..759a31f342a0a84beafcf2894ec0b7eb5b462da2 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
 #include <winsock2.h>
+#include <nb30.h>
+#endif /* !DJGPP */
 #include <malloc.h>
 #include <string.h>
 #include <stdlib.h>
-#include <nb30.h>
 #include <osi.h>
 
 #include "afsd.h"
@@ -828,3 +830,27 @@ void cm_ReleaseSCache(cm_scache_t *scp)
        osi_assert(scp->refCount-- > 0);
        lock_ReleaseWrite(&cm_scacheLock);
 }
+
+/* just look for the scp entry to get filetype */
+/* doesn't need to be perfectly accurate, so locking doesn't matter too much */
+int cm_FindFileType(cm_fid_t *fidp)
+{
+        long hash;
+        cm_scache_t *scp;
+        
+        hash = CM_SCACHE_HASH(fidp);
+        
+        osi_assert(fidp->cell != 0);
+
+        lock_ObtainWrite(&cm_scacheLock);
+        for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) {
+                if (cm_FidCmp(fidp, &scp->fid) == 0) {
+                  /*scp->refCount++;*/
+                  /*cm_AdjustLRU(scp);*/
+                  lock_ReleaseWrite(&cm_scacheLock);
+                  return scp->fileType;
+                }
+        }
+        lock_ReleaseWrite(&cm_scacheLock);
+        return NULL;
+}
index 4d74dbdfd831d67e56a8db0cab9b5156ad8c5832..aec2f970e1a8b31e68b628bab09a6cd185a69db1 100644 (file)
 #ifndef __CM_SCACHE_H_ENV__
 #define __CM_SCACHE_H_ENV__ 1
 
+#ifdef DJGPP
+#include "largeint95.h"
+#endif /* DJGPP */
+
 typedef struct cm_fid {
        unsigned long cell;
         unsigned long volume;
@@ -210,6 +214,9 @@ typedef struct cm_scache {
                                    (fidp)->unique))    \
                                        % cm_hashTableSize)
 
+#include "cm_conn.h"
+#include "cm_buf.h"
+
 extern cm_scache_t cm_fakeSCache;
 
 extern void cm_InitSCache(long);
index ffb2b7a94b2f39f2bf006bd521a458038e3f1439..16672eb8b762cf5c26f9dea2c8cb1d6518bd953a 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
 #include <winsock2.h>
+#include <nb30.h>
+#else
+#include <sys/socket.h>
+#endif /* !DJGPP */
 #include <stdlib.h>
 #include <malloc.h>
 #include <string.h>
 
 #include <osi.h>
 #include <rx/rx.h>
-#include <nb30.h>
 #include "afsd.h"
 
 osi_rwlock_t cm_serverLock;
index 7fce862fa0ff5ab41136c39ff00aff62fc0805ea..c0b357fb6e8426fbabbdfccb3ef608298988ed74 100644 (file)
 #ifndef __CM_SERVER_H_ENV__
 #define __CM_SERVER_H_ENV__ 1
 
+#ifndef DJGPP
 #include <winsock2.h>
+#else /* DJGPP */
+#include <netinet/in.h>
+#endif /* !DJGPP */
 #include <osi.h>
 
 /* pointed to by volumes and cells without holds; cm_serverLock is obtained
index 9a20e1804815576e40c07e5cd2b5a76ffd43c7eb..471f47c67aa20a39cc5d3c574b4b973ba71aa081 100644 (file)
@@ -10,7 +10,9 @@
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
+#endif /* !DJGPP */
 #include <malloc.h>
 #include <string.h>
 
@@ -143,7 +145,7 @@ void cm_CheckTokenCache(long now)
         extern smb_vc_t *smb_allVCsp; /* global vcp list */
        smb_vc_t   *vcp;
        smb_user_t *usersp;
-       cm_user_t  *userp;
+       cm_user_t  *userp = NULL;
        cm_ucell_t *ucellp;
        BOOL bExpired=FALSE;
   
@@ -152,9 +154,12 @@ void cm_CheckTokenCache(long now)
         */
        lock_ObtainWrite(&smb_rctLock);
        for(vcp=smb_allVCsp; vcp; vcp=vcp->nextp) {
-               for(usersp=vcp->usersp; usersp; usersp=usersp->nextp) {
-                       userp=usersp->userp;
-                       osi_assert(userp);
+               for(usersp=vcp->usersp; usersp; usersp=usersp->nextp) {\r
+                               if (usersp->unp) {
+                          if ((userp=usersp->unp->userp)==0)\r
+                                          continue;\r
+                               } else\r
+                                       continue;\r
                        lock_ObtainMutex(&userp->mx);
                        for(ucellp=userp->cellInfop; ucellp; ucellp=ucellp->nextp) {
                          if(ucellp->flags & CM_UCELLFLAG_RXKAD) {
index 2fd367f875ed18d7de2602ef6b255276e5118341..e18654adfc4b7504624076bc982f6671bfaaf752 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
+#include <winsock2.h>
+#endif /* !DJGPP */
 #include <string.h>
 #include <malloc.h>
-#include <winsock2.h>
 
 #include <osi.h>
 #include <rx/rx.h>
index 269a560b93c36bb51a4d57b437a3aeaa1cf1b9df..b3149484c9bad0c4d85f6c79e53417559a64289e 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
-#include <stddef.h>
 #include <winsock2.h>
+#endif /* !DJGPP */
+#include <stddef.h>
 #include <malloc.h>
 #include <string.h>
 #include <stdlib.h>
@@ -2178,6 +2180,10 @@ long cm_Rename(cm_scache_t *oldDscp, char *oldNamep, cm_scache_t *newDscp,
         * which makes the code a little verbose.
          */
        if (oldDscp == newDscp) {
+                /* check for identical names */
+                if (strcmp(oldNamep, newNamep) == 0)
+                        return CM_ERROR_RENAME_IDENTICAL;
+
                oneDir = 1;
                lock_ObtainMutex(&oldDscp->mx);
                cm_dnlcRemove(oldDscp, oldNamep);
index f71b30b02ee2e2f69c1b0cb2628ad850ca0928c3..d4667b19216da985dd0f2de56a77464d7e817f1d 100644 (file)
@@ -38,6 +38,8 @@ typedef struct cm_lookupSearch {
         int hasTilde;
 } cm_lookupSearch_t;
 
+#include "cm_dir.h"
+
 typedef int (*cm_DirFuncp_t)(struct cm_scache *, struct cm_dirEntry *, void *,
        osi_hyper_t *entryOffsetp);
 
index 94874668413d020d794fd17466c3968f3a0c45f9..994e526c500a2e2b0187816618a5355d0157dd06 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
-#include <string.h>
-#include <malloc.h>
 #include <winsock2.h>
 #include <nb30.h>
+#else
+#include <sys/socket.h>
+#endif /* !DJGPP */
+#include <string.h>
+#include <malloc.h>
 #include <osi.h>
 #include <rx/rx.h>
 
index 2bdcabcfca8faece794bc6c2364a418b0bf20e4a..6e09e1d6338cafd71613761864ea3b10c8a4e02a 100644 (file)
@@ -18,7 +18,9 @@
 #include <afs/prs_fs.h>
 #include <afs/pioctl_nt.h>
 
+#ifndef _MFC_VER
 #include <winsock2.h>
+#endif
 
 /* Fake error code since NT errno.h doesn't define it */
 #include <afs/errmap_nt.h>
index 62495352d38afdef30f988d8dd1901ba6dff49ba..5a03d90e2ac847a564f929eedb9254b6ec807ffc 100644 (file)
@@ -7,10 +7,17 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
+//#define NOSERVICE 1
+
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
+#else
+#include <sys/timeb.h>
+#include <tzfile.h>
+#endif /* !DJGPP */
 #include <stddef.h>
 #include <stdlib.h>
 #include <malloc.h>
@@ -35,6 +42,9 @@ char *loggedOutName = NULL;
 smb_user_t *loggedOutUserp = NULL;
 unsigned long loggedOutTime;
 int loggedOut = 0;
+#ifdef DJGPP
+int smbShutdownFlag = 0;
+#endif /* DJGPP */
 
 int smb_LogoffTokenTransfer;
 unsigned long smb_LogoffTransferTimeout;
@@ -53,8 +63,10 @@ osi_hyper_t hones = {0xFFFFFFFF, -1};
 osi_log_t *smb_logp;
 osi_rwlock_t smb_globalLock;
 osi_rwlock_t smb_rctLock;
-
-unsigned char smb_LANadapter;
+osi_rwlock_t smb_ListenerLock;
+char smb_LANadapter;
+unsigned char smb_sharename[NCBNAMSZ+1] = {0};
 
 /* for debugging */
 long smb_maxObsConcurrentCalls=0;
@@ -70,20 +82,28 @@ int smb_NumServerThreads;
 int numNCBs, numSessions;
 
 #define NCBmax 100
-HANDLE NCBavails[NCBmax], NCBevents[NCBmax];
-HANDLE **NCBreturns;
+EVENT_HANDLE NCBavails[NCBmax], NCBevents[NCBmax];
+EVENT_HANDLE **NCBreturns;
 DWORD NCBsessions[NCBmax];
 NCB *NCBs[NCBmax];
 struct smb_packet *bufs[NCBmax];
 
 #define Sessionmax 100
-HANDLE SessionEvents[Sessionmax];
+EVENT_HANDLE SessionEvents[Sessionmax];
 unsigned short LSNs[Sessionmax];
+int lanas[Sessionmax];
 BOOL dead_sessions[Sessionmax];
+LANA_ENUM lana_list;
 
 /* for raw I/O */
 osi_mutex_t smb_RawBufLock;
+#ifdef DJGPP
+#define SMB_RAW_BUFS 4
+dos_ptr smb_RawBufs;
+int smb_RawBufSel[SMB_RAW_BUFS];
+#else
 char *smb_RawBufs;
+#endif /* DJGPP */
 
 #define RAWTIMEOUT INFINITE
 
@@ -92,7 +112,11 @@ typedef struct raw_write_cont {
        long code;
        osi_hyper_t offset;
        long count;
+#ifndef DJGPP
        char *buf;
+#else
+        dos_ptr buf;
+#endif /* DJGPP */
        int writeMode;
        long alreadyWritten;
 } raw_write_cont_t;
@@ -105,8 +129,10 @@ smb_dirSearch_t *smb_lastDirSearchp;
 /* global state about V3 protocols */
 int smb_useV3;         /* try to negotiate V3 */
 
+#ifndef DJGPP
 /* MessageBox or something like it */
 int (WINAPI *smb_MBfunc)(HWND, LPCTSTR, LPCTSTR, UINT) = NULL;
+#endif /* DJGPP */
 
 /* GMT time info:
  * Time in Unix format of midnight, 1/1/1970 local time.
@@ -121,11 +147,25 @@ char *smb_localNamep;
 
 smb_vc_t *smb_allVCsp;
 
+smb_username_t *usernamesp = NULL;
+
 smb_waitingLock_t *smb_allWaitingLocks;
 
 /* forward decl */
 void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
        NCB *ncbp, raw_write_cont_t *rwcp);
+void smb_NetbiosInit();
+extern char cm_HostName[];
+#ifdef DJGPP
+extern char cm_confDir[];
+#endif
+
+#ifdef DJGPP
+#define LPTSTR char *
+#define GetComputerName(str, sizep) \
+       strcpy((str), cm_HostName); \
+       *(sizep) = strlen(cm_HostName)
+#endif /* DJGPP */
 
 /*
  * Demo expiration
@@ -137,7 +177,145 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
 #define EXPIREDATE 834000000           /* Wed Jun 5 1996 */
 
 
+char * myCrt_Dispatch(int i)
+{
+       switch (i)
+       {
+       default:
+               return "unknown SMB op";
+       case 0x00:
+               return "(00)ReceiveCoreMakeDir";
+       case 0x01:
+               return "(01)ReceiveCoreRemoveDir";
+       case 0x02:
+               return "(02)ReceiveCoreOpen";
+       case 0x03:
+               return "(03)ReceiveCoreCreate";
+       case 0x04:
+               return "(04)ReceiveCoreClose";
+       case 0x05:
+               return "(05)ReceiveCoreFlush";
+       case 0x06:
+               return "(06)ReceiveCoreUnlink";
+       case 0x07:
+               return "(07)ReceiveCoreRename";
+       case 0x08:
+               return "(08)ReceiveCoreGetFileAttributes";
+       case 0x09:
+               return "(09)ReceiveCoreSetFileAttributes";
+       case 0x0a:
+               return "(0a)ReceiveCoreRead";
+       case 0x0b:
+               return "(0b)ReceiveCoreWrite";
+       case 0x0c:
+               return "(0c)ReceiveCoreLockRecord";
+       case 0x0d:
+               return "(0d)ReceiveCoreUnlockRecord";
+       case 0x0e:
+               return "(0e)SendCoreBadOp";
+       case 0x0f:
+               return "(0f)ReceiveCoreCreate";
+       case 0x10:
+               return "(10)ReceiveCoreCheckPath";
+       case 0x11:
+               return "(11)SendCoreBadOp";
+       case 0x12:
+               return "(12)ReceiveCoreSeek";
+       case 0x1a:
+               return "(1a)ReceiveCoreReadRaw";
+       case 0x1d:
+               return "(1d)ReceiveCoreWriteRawDummy";
+       case 0x22:
+               return "(22)ReceiveV3SetAttributes";
+       case 0x23:
+               return "(23)ReceiveV3GetAttributes";
+       case 0x24:
+               return "(24)ReceiveV3LockingX";
+       case 0x29:
+               return "(29)SendCoreBadOp";
+       case 0x2b:
+               return "(2b)ReceiveCoreEcho";
+       case 0x2d:
+               return "(2d)ReceiveV3OpenX";
+       case 0x2e:
+               return "(2e)ReceiveV3ReadX";
+       case 0x32:
+               return "(32)ReceiveV3Tran2A";
+       case 0x33:
+               return "(33)ReceiveV3Tran2A";
+       case 0x34:
+               return "(34)ReceiveV3FindClose";
+       case 0x35:
+               return "(35)ReceiveV3FindNotifyClose";
+       case 0x70:
+               return "(70)ReceiveCoreTreeConnect";
+       case 0x71:
+               return "(71)ReceiveCoreTreeDisconnect";
+       case 0x72:
+               return "(72)ReceiveNegotiate";
+       case 0x73:
+               return "(73)ReceiveV3SessionSetupX";
+       case 0x74:
+               return "(74)ReceiveV3UserLogoffX";
+       case 0x75:
+               return "(75)ReceiveV3TreeConnectX";
+       case 0x80:
+               return "(80)ReceiveCoreGetDiskAttributes";
+       case 0x81:
+               return "(81)ReceiveCoreSearchDir";
+       case 0xA0:
+               return "(A0)ReceiveNTTransact";
+       case 0xA2:
+               return "(A2)ReceiveNTCreateX";
+       case 0xA4:
+               return "(A4)ReceiveNTCancel";
+       case 0xc0:
+               return "(c0)SendCoreBadOp";
+       case 0xc1:
+               return "(c1)SendCoreBadOp";
+       case 0xc2:
+               return "(c2)SendCoreBadOp";
+       case 0xc3:
+               return "(c3)SendCoreBadOp";
+       }
+}
 
+char * myCrt_2Dispatch(int i)
+{
+       switch (i)
+       {
+       default:
+               return "unknown SMB op-2";
+       case 0:
+               return "S(00)CreateFile";
+       case 1:
+               return "S(01)FindFirst";
+       case 2:
+               return "S(02)FindNext"; /* FindNext */
+       case 3:
+               return "S(03)QueryFileSystem_ReceiveTran2QFSInfo";
+       case 4:
+               return "S(04)??";
+       case 5:
+               return "S(05)QueryFileInfo_ReceiveTran2QPathInfo";
+       case 6:
+               return "S(06)SetFileInfo_ReceiveTran2SetPathInfo";
+       case 7:
+               return "S(07)SetInfoHandle_ReceiveTran2QFileInfo";
+       case 8:
+               return "S(08)??_ReceiveTran2SetFileInfo";
+       case 9:
+               return "S(09)??_ReceiveTran2FSCTL";
+       case 10:
+               return "S(0a)_ReceiveTran2IOCTL";
+       case 11:
+               return "S(0b)_ReceiveTran2FindNotifyFirst";
+       case 12:
+               return "S(0c)_ReceiveTran2FindNotifyNext";
+       case 13:
+               return "S(0d)CreateDirectory_ReceiveTran2MKDir";
+       }
+}
 
 /* scache must be locked */
 unsigned int smb_Attributes(cm_scache_t *scp)
@@ -176,6 +354,7 @@ static int ExtractBits(WORD bits, short start, short len)
         return (int)num;
 }
 
+#ifndef DJGPP
 void ShowUnixTime(char *FuncName, long unixTime)
 {
         FILETIME ft;
@@ -201,7 +380,9 @@ void ShowUnixTime(char *FuncName, long unixTime)
                 osi_Log1(afsd_logp, "%s", osi_LogSaveString(afsd_logp, msg));
         }
 }
+#endif /* DJGPP */
 
+#ifndef DJGPP
 /* Determine if we are observing daylight savings time */
 void GetTimeZoneInfo(BOOL *pDST, LONG *pDstBias, LONG *pBias)
 {
@@ -244,6 +425,19 @@ void GetTimeZoneInfo(BOOL *pDST, LONG *pDstBias, LONG *pBias)
        */
        *pDST = localDST.wHour != local.wHour;
 }
+#else
+/* Determine if we are observing daylight savings time */
+void GetTimeZoneInfo(BOOL *pDST, LONG *pDstBias, LONG *pBias)
+{
+  struct timeb t;
+
+  ftime(&t);
+  *pDST = t.dstflag;
+  *pDstBias = -60;    /* where can this be different? */
+  *pBias = t.timezone;
+}
+#endif /* DJGPP */
 
 void CompensateForSmbClientLastWriteTimeBugs(long *pLastWriteTime)
 {
@@ -303,6 +497,8 @@ smb_CalculateNowTZ()
 
        smb_NowTZ = seconds;
 }
+
+#ifndef DJGPP
 void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, long unixTime)
 {
        struct tm *ltp;
@@ -342,7 +538,29 @@ void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, long unixTime)
 
        SystemTimeToFileTime(&stm, largeTimep);
 }
+#else /* DJGPP */
+void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, long unixTime)
+{
+  /* unixTime: seconds since 1/1/1970 00:00:00 GMT */
+  /* FILETIME: 100ns intervals since 1/1/1601 00:00:00 ??? */
+  LARGE_INTEGER *ft = (LARGE_INTEGER *) largeTimep;
+  LARGE_INTEGER ut;
+  int leap_years = 89;   /* leap years betw 1/1/1601 and 1/1/1970 */
+
+  /* set ft to number of 100ns intervals betw 1/1/1601 and 1/1/1970 GMT */
+  *ft = ConvertLongToLargeInteger(((EPOCH_YEAR-1601) * 365 + leap_years)
+                                   * 24 * 60);
+  *ft = LargeIntegerMultiplyByLong(*ft, 60);
+  *ft = LargeIntegerMultiplyByLong(*ft, 10000000);
+
+  /* add unix time */
+  ut = ConvertLongToLargeInteger(unixTime);
+  ut = LargeIntegerMultiplyByLong(ut, 10000000);
+  *ft = LargeIntegerAdd(*ft, ut);
+}
+#endif /* !DJGPP */
 
+#ifndef DJGPP
 void smb_UnixTimeFromLargeSearchTime(long *unixTimep, FILETIME *largeTimep)
 {
        SYSTEMTIME stm;
@@ -365,6 +583,28 @@ void smb_UnixTimeFromLargeSearchTime(long *unixTimep, FILETIME *largeTimep)
        *unixTimep = mktime(&lt);
        _timezone = save_timezone;
 }
+#else /* DJGPP */
+void smb_UnixTimeFromLargeSearchTime(long *unixTimep, FILETIME *largeTimep)
+{
+  /* unixTime: seconds since 1/1/1970 00:00:00 GMT */
+  /* FILETIME: 100ns intervals since 1/1/1601 00:00:00 GMT? */
+  LARGE_INTEGER *ft = (LARGE_INTEGER *) largeTimep;
+  LARGE_INTEGER a;
+  int leap_years = 89;
+
+  /* set to number of 100ns intervals betw 1/1/1601 and 1/1/1970 */
+  a = ConvertLongToLargeInteger(((EPOCH_YEAR-1601) * 365 + leap_years) * 24 * 60
+);
+  a = LargeIntegerMultiplyByLong(a, 60);
+  a = LargeIntegerMultiplyByLong(a, 10000000);
+
+  /* subtract it from ft */
+  a = LargeIntegerSubtract(*ft, a);
+
+  /* divide down to seconds */
+  *unixTimep = LargeIntegerDivideByLong(a, 10000000);
+}
+#endif /* !DJGPP */
 
 void smb_SearchTimeFromUnixTime(long *dosTimep, long unixTime)
 {
@@ -373,7 +613,7 @@ void smb_SearchTimeFromUnixTime(long *dosTimep, long unixTime)
         int dosTime;
         struct tm localJunk;
 
-       ltp = localtime(&unixTime);
+       ltp = localtime((time_t*) &unixTime);
 
        /* if we fail, make up something */
         if (!ltp) {
@@ -418,16 +658,21 @@ void smb_DosUTimeFromUnixTime(long *dosUTimep, long unixTime)
 
 void smb_UnixTimeFromDosUTime(long *unixTimep, long dosTime)
 {
+#ifndef DJGPP
        *unixTimep = dosTime + smb_localZero;
+#else /* DJGPP */
+        /* dosTime seems to be already adjusted for GMT */
+       *unixTimep = dosTime;
+#endif /* !DJGPP */
 }
 
-smb_vc_t *smb_FindVC(unsigned short lsn, int flags)
+smb_vc_t *smb_FindVC(unsigned short lsn, int flags, int lana)
 {
        smb_vc_t *vcp;
 
        lock_ObtainWrite(&smb_rctLock);
        for(vcp = smb_allVCsp; vcp; vcp=vcp->nextp) {
-               if (lsn == vcp->lsn) {
+               if (lsn == vcp->lsn && lana == vcp->lana) {
                        vcp->refCount++;
                        break;
                }
@@ -438,10 +683,12 @@ smb_vc_t *smb_FindVC(unsigned short lsn, int flags)
                 vcp->refCount = 1;
                 vcp->tidCounter = 1;
                 vcp->fidCounter = 1;
+                vcp->uidCounter = 1;  /* UID 0 is reserved for blank user */
                 vcp->nextp = smb_allVCsp;
                 smb_allVCsp = vcp;
                 lock_InitializeMutex(&vcp->mx, "vc_t mutex");
                 vcp->lsn = lsn;
+                vcp->lana = lana;
         }
         lock_ReleaseWrite(&smb_rctLock);
         return vcp;
@@ -525,13 +772,23 @@ void smb_ReleaseTID(smb_tid_t *tidp)
 
 smb_user_t *smb_FindUID(smb_vc_t *vcp, unsigned short uid, int flags)
 {
-       smb_user_t *uidp;
+       smb_user_t *uidp = NULL;
 
        lock_ObtainWrite(&smb_rctLock);
        for(uidp = vcp->usersp; uidp; uidp = uidp->nextp) {
                if (uid == uidp->userID) {
                        uidp->refCount++;
-                       break;
+#ifdef DEBUG_VERBOSE 
+               {
+        HANDLE h; char *ptbuf[1],buf[132];
+        h = RegisterEventSource(NULL, "AFS Service - smb_FindUID (Find by UID)");
+        sprintf(buf, "VCP[%x] found-uid[%d] name[%s]",vcp,uidp->userID,(uidp->unp ? uidp->unp->name : ""));
+        ptbuf[0] = buf;
+        ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+        DeregisterEventSource(h);
+               }
+#endif
+               break;
                }
         }
         if (!uidp && (flags & SMB_FLAG_CREATE)) {
@@ -543,11 +800,73 @@ smb_user_t *smb_FindUID(smb_vc_t *vcp, unsigned short uid, int flags)
                 vcp->usersp = uidp;
                 lock_InitializeMutex(&uidp->mx, "uid_t mutex");
                 uidp->userID = uid;
+#ifdef DEBUG_VERBOSE 
+               {
+        HANDLE h; char *ptbuf[1],buf[132];
+        h = RegisterEventSource(NULL, "AFS Service - smb_FindUID (Find by UID)");
+        sprintf(buf, "VCP[%x] new-uid[%d] name[%s]",vcp,uidp->userID,(uidp->unp ? uidp->unp->name : ""));
+        ptbuf[0] = buf;
+        ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+        DeregisterEventSource(h);
+               }
+#endif
         }
         lock_ReleaseWrite(&smb_rctLock);
         return uidp;
 }
 
+smb_username_t *smb_FindUserByName(char *usern, char *machine, int flags)
+{
+       smb_username_t *unp= NULL;
+
+       lock_ObtainWrite(&smb_rctLock);
+       for(unp = usernamesp; unp; unp = unp->nextp) {
+               if (stricmp(unp->name, usern) == 0 &&
+                    stricmp(unp->machine, machine) == 0) {
+                       unp->refCount++;
+                       break;
+               }
+       }
+        if (!unp && (flags & SMB_FLAG_CREATE)) {
+          unp = malloc(sizeof(*unp));
+          memset(unp, 0, sizeof(*unp));
+          unp->nextp = usernamesp;
+          unp->name = strdup(usern);
+          unp->machine = strdup(machine);
+          usernamesp = unp;
+          lock_InitializeMutex(&unp->mx, "username_t mutex");
+        }
+       lock_ReleaseWrite(&smb_rctLock);
+       return unp;
+}
+
+smb_user_t *smb_FindUserByNameThisSession(smb_vc_t *vcp, char *usern)
+{
+       smb_user_t *uidp= NULL;
+
+       lock_ObtainWrite(&smb_rctLock);
+       for(uidp = vcp->usersp; uidp; uidp = uidp->nextp) {
+          if (!uidp->unp) 
+            continue;
+          if (stricmp(uidp->unp->name, usern) == 0) {
+            uidp->refCount++;
+#ifdef DEBUG_VERBOSE 
+            {
+              HANDLE h; char *ptbuf[1],buf[132];
+              h = RegisterEventSource(NULL, "AFS Service - smb_FindUserByNameThisSession");
+              sprintf(buf, "VCP[%x] uid[%d] match-name[%s]",vcp,uidp->userID,usern);
+              ptbuf[0] = buf;
+              ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+              DeregisterEventSource(h);
+            }
+#endif
+            break;
+          } else
+            continue;
+       }
+       lock_ReleaseWrite(&smb_rctLock);
+       return uidp;
+}
 void smb_ReleaseUID(smb_user_t *uidp)
 {
        smb_user_t *up;
@@ -565,7 +884,8 @@ void smb_ReleaseUID(smb_user_t *uidp)
                 osi_assert(up != NULL);
                 *lupp = up->nextp;
                 lock_FinalizeMutex(&uidp->mx);
-                userp = uidp->userp;   /* remember to drop ref later */
+                if (uidp->unp)
+                  userp = uidp->unp->userp;    /* remember to drop ref later */
         }
        lock_ReleaseWrite(&smb_rctLock);
         if (userp) {
@@ -586,10 +906,11 @@ cm_user_t *smb_GetUser(smb_vc_t *vcp, smb_packet_t *inp)
         
        smbp = (smb_t *) inp;
         uidp = smb_FindUID(vcp, smbp->uid, 0);
-        if (!uidp) return NULL;
+        if ((!uidp) ||  (!uidp->unp))
+                return NULL;
         
        lock_ObtainMutex(&uidp->mx);
-        up = uidp->userp;
+        up = uidp->unp->userp;
         cm_HoldUser(up);
        lock_ReleaseMutex(&uidp->mx);
 
@@ -665,7 +986,7 @@ retry:
                 lock_InitializeMutex(&fidp->mx, "fid_t mutex");
                 fidp->fid = fid;
                fidp->curr_chunk = fidp->prev_chunk = -2;
-               fidp->raw_write_event = CreateEvent(NULL, FALSE, TRUE, NULL);
+               fidp->raw_write_event = thrd_CreateEvent(NULL, FALSE, TRUE, NULL);
                 if (newFid) {
                        vcp->fidCounter = fid+1;
                         if (vcp->fidCounter == 0) vcp->fidCounter = 1;
@@ -689,7 +1010,7 @@ void smb_ReleaseFID(smb_fid_t *fidp)
                if (!(fidp->flags & SMB_FID_IOCTL))
                        scp = fidp->scp;
                osi_QRemove((osi_queue_t **) &vcp->fidsp, &fidp->q);
-               CloseHandle(fidp->raw_write_event);
+               thrd_CloseHandle(fidp->raw_write_event);
 
                /* and see if there is ioctl stuff to free */
                 ioctlp = fidp->ioctlp;
@@ -743,6 +1064,69 @@ char VNLCUserName[] = "%LCUSERNAME%";
 char VNComputerName[] = "%COMPUTERNAME%";
 char VNLCComputerName[] = "%LCCOMPUTERNAME%";
 
+/* List available shares */
+int smb_ListShares()
+{
+        char sbmtpath[256];
+        char pathName[256];
+        char shareBuf[4096];
+        int num_shares=0;
+        char *this_share;
+        int len;
+        char *p;
+        int print_afs = 0;
+        int code;
+
+        /*strcpy(shareNameList[num_shares], "all");
+          strcpy(pathNameList[num_shares++], "/afs");*/
+        fprintf(stderr, "The following shares are available:\n");
+        fprintf(stderr, "Share Name (AFS Path)\n");
+        fprintf(stderr, "---------------------\n");
+        fprintf(stderr, "\\\\%s\\%-16s (/afs)\n", smb_localNamep, "ALL");
+
+#ifndef DJGPP
+       code = GetWindowsDirectory(sbmtpath, sizeof(sbmtpath));
+        if (code == 0 || code > sizeof(sbmtpath)) return -1;
+#else
+        strcpy(sbmtpath, cm_confDir);
+#endif /* !DJGPP */
+        strcat(sbmtpath, "/afsdsbmt.ini");
+        len = GetPrivateProfileString("AFS Submounts", NULL, NULL,
+                                      shareBuf, sizeof(shareBuf),
+                                      sbmtpath);
+        if (len == 0) {
+          return num_shares;
+        }
+
+        this_share = shareBuf;
+        do
+        {
+          print_afs = 0;
+          /*strcpy(shareNameList[num_shares], this_share);*/
+          len = GetPrivateProfileString("AFS Submounts", this_share,
+                                        NULL,
+                                        pathName, 256,
+                                        sbmtpath);
+          if (!len) return num_shares;
+          p = pathName;
+          if (strncmp(p, "/afs", 4) != 0)
+            print_afs = 1;
+          while (*p) {
+            if (*p == '\\') *p = '/';    /* change to / */
+            p++;
+          }
+
+          fprintf(stderr, "\\\\%s\\%-16s (%s%s)\n",
+                  smb_localNamep, this_share, (print_afs ? "/afs" : "\0"),
+                  pathName);
+          num_shares++;
+          while (*this_share != NULL) this_share++;  /* find next NULL */
+          this_share++;   /* skip past the NULL */
+        } while (*this_share != NULL);  /* stop at final NULL */
+
+        return num_shares;
+}
+
 /* find a shareName in the table of submounts */
 int smb_FindShare(smb_vc_t *vcp, smb_packet_t *inp, char *shareName,
        char **pathNamep)
@@ -753,6 +1137,8 @@ int smb_FindShare(smb_vc_t *vcp, smb_packet_t *inp, char *shareName,
        smb_user_t *uidp;
        char temp[1024];
        DWORD sizeTemp;
+        char sbmtpath[256];
+        char *p, *q;
 
        if (strcmp(shareName, "IPC$") == 0) {
                *pathNamep = NULL;
@@ -764,45 +1150,68 @@ int smb_FindShare(smb_vc_t *vcp, smb_packet_t *inp, char *shareName,
                return 1;
        }
 
+#ifndef DJGPP
+        strcpy(sbmtpath, "afsdsbmt.ini");
+#else /* DJGPP */
+        strcpy(sbmtpath, cm_confDir);
+        strcat(sbmtpath, "/afsdsbmt.ini");
+#endif /* !DJGPP */
        len = GetPrivateProfileString("AFS Submounts", shareName, "",
-                                     pathName, sizeof(pathName), "afsdsbmt.ini");
+                                     pathName, sizeof(pathName), sbmtpath);
        if (len == 0 || len == sizeof(pathName) - 1) {
                *pathNamep = NULL;
                return 0;
        }
+        
+        /* We can accept either unix or PC style AFS pathnames.  Convert
+           Unix-style to PC style here for internal use. */
+        p = pathName;
+        if (strncmp(p, "/afs", 4) == 0)
+          p += 4;  /* skip /afs */
+        q = p;
+        while (*q) {
+          if (*q == '/') *q = '\\';    /* change to \ */
+          q++;
+        }
 
        while (1)
        {
-               if (var = smb_stristr(pathName, VNUserName)) {
+               if (var = smb_stristr(p, VNUserName)) {
                        uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
-                       smb_subst(pathName, var, sizeof(VNUserName),
-                                 uidp->name);
+                       if (uidp && uidp->unp)
+                         smb_subst(p, var, sizeof(VNUserName),
+                                      uidp->unp->name);
+                       else
+                         smb_subst(p, var, sizeof(VNUserName),
+                                      " ");
                        smb_ReleaseUID(uidp);
                }
-               else if (var = smb_stristr(pathName, VNLCUserName)) {
+               else if (var = smb_stristr(p, VNLCUserName)) {
                        uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
-                       strcpy(temp, uidp->name);
+                       if (uidp && uidp->unp)
+                         strcpy(temp, uidp->unp->name);
+                       else strcpy(temp, " ");
                        _strlwr(temp);
-                       smb_subst(pathName, var, sizeof(VNLCUserName), temp);
+                       smb_subst(p, var, sizeof(VNLCUserName), temp);
                        smb_ReleaseUID(uidp);
                }
-               else if (var = smb_stristr(pathName, VNComputerName)) {
+               else if (var = smb_stristr(p, VNComputerName)) {
                        sizeTemp = sizeof(temp);
                        GetComputerName((LPTSTR)temp, &sizeTemp);
-                       smb_subst(pathName, var, sizeof(VNComputerName),
+                       smb_subst(p, var, sizeof(VNComputerName),
                                  temp);
                }
-               else if (var = smb_stristr(pathName, VNLCComputerName)) {
+               else if (var = smb_stristr(p, VNLCComputerName)) {
                        sizeTemp = sizeof(temp);
                        GetComputerName((LPTSTR)temp, &sizeTemp);
                        _strlwr(temp);
-                       smb_subst(pathName, var, sizeof(VNLCComputerName),
+                       smb_subst(p, var, sizeof(VNLCComputerName),
                                  temp);
                }
                else break;
        }
 
-       *pathNamep = strdup(pathName);
+       *pathNamep = strdup(p);
        return 1;
 }
 
@@ -980,12 +1389,20 @@ smb_dirSearch_t *smb_NewDirSearch(int isV3)
 static smb_packet_t *GetPacket(void)
 {
        smb_packet_t *tbp;
+#ifdef DJGPP
+        unsigned int npar, seg, tb_sel;
+#endif
+
        lock_ObtainWrite(&smb_globalLock);
        tbp = smb_packetFreeListp;
         if (tbp) smb_packetFreeListp = tbp->nextp;
        lock_ReleaseWrite(&smb_globalLock);
         if (!tbp) {
+#ifndef DJGPP
                tbp = GlobalAlloc(GMEM_FIXED, 65540);
+#else /* DJGPP */
+                tbp = malloc(sizeof(smb_packet_t));
+#endif /* !DJGPP */
                 tbp->magic = SMB_PACKETMAGIC;
                tbp->ncbp = NULL;
                tbp->vcp = NULL;
@@ -997,8 +1414,27 @@ static smb_packet_t *GetPacket(void)
                tbp->oddByte = 0;
                tbp->ncb_length = 0;
                tbp->flags = 0;
-       }
         
+#ifdef DJGPP
+                npar = SMB_PACKETSIZE >> 4;  /* number of paragraphs */
+                {
+                  signed int retval =
+                    __dpmi_allocate_dos_memory(npar, &tb_sel); /* DOS segment */
+                  if (retval == -1) {
+                    afsi_log("Cannot allocate %d paragraphs of DOS memory",
+                             npar);
+                    osi_panic("",__FILE__,__LINE__);
+                  }
+                  else {
+                    afsi_log("Allocated %d paragraphs of DOS mem at 0x%X",
+                             npar, retval);
+                    seg = retval;
+                  }
+                }
+                tbp->dos_pkt = (seg * 16) + 0;  /* DOS physical address */
+                tbp->dos_pkt_sel = tb_sel;
+#endif /* DJGPP */
+       }
         osi_assert(tbp->magic == SMB_PACKETMAGIC);
 
         return tbp;
@@ -1009,26 +1445,56 @@ smb_packet_t *smb_CopyPacket(smb_packet_t *pkt)
        smb_packet_t *tbp;
        tbp = GetPacket();
        memcpy(tbp, pkt, sizeof(smb_packet_t));
-       tbp->wctp = tbp->data + (pkt->wctp - pkt->data);
+       tbp->wctp = tbp->data + ((unsigned int)pkt->wctp -
+                                 (unsigned int)pkt->data);
        return tbp;
 }
 
 static NCB *GetNCB(void)
 {
        smb_ncb_t *tbp;
+        NCB *ncbp;
+#ifdef DJGPP
+        unsigned int npar, seg, tb_sel;
+#endif /* DJGPP */
+
        lock_ObtainWrite(&smb_globalLock);
        tbp = smb_ncbFreeListp;
         if (tbp) smb_ncbFreeListp = tbp->nextp;
        lock_ReleaseWrite(&smb_globalLock);
         if (!tbp) {
+#ifndef DJGPP
                tbp = GlobalAlloc(GMEM_FIXED, sizeof(*tbp));
+#else /* DJGPP */
+                tbp = malloc(sizeof(*tbp));
+                npar = (sizeof(NCB)+15) >> 4;  /* number of paragraphs */
+                {
+                  signed int retval =
+                    __dpmi_allocate_dos_memory(npar, &tb_sel); /* DOS segment */
+                  if (retval == -1) {
+                    afsi_log("Cannot allocate %d paragraphs of DOS mem in GetNCB",
+                             npar);
+                    osi_panic("",__FILE__,__LINE__);
+                  } else {
+                    afsi_log("Allocated %d paragraphs of DOS mem at 0x%X in GetNCB",
+                             npar, retval);
+                    seg = retval;
+                  }
+                }
+                tbp->dos_ncb = (seg * 16) + 0;  /* DOS physical address */
+                tbp->dos_ncb_sel = tb_sel;
+#endif /* !DJGPP */
                 tbp->magic = SMB_NCBMAGIC;
        }
         
         osi_assert(tbp->magic == SMB_NCBMAGIC);
 
        memset(&tbp->ncb, 0, sizeof(NCB));
-        return &tbp->ncb;
+        ncbp = &tbp->ncb;
+#ifdef DJGPP
+        dos_memset(tbp->dos_ncb, 0, sizeof(NCB));
+#endif /* DJGPP */
+        return ncbp;
 }
 
 void smb_FreePacket(smb_packet_t *tbp)
@@ -1107,6 +1573,7 @@ unsigned int smb_GetSMBParm(smb_packet_t *smbp, int parm)
        parmCount = *smbp->wctp;
 
        if (parm >= parmCount) {
+#ifndef DJGPP
                HANDLE h;
                char *ptbuf[1];
                char s[100];
@@ -1117,6 +1584,13 @@ unsigned int smb_GetSMBParm(smb_packet_t *smbp, int parm)
                ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 1006, NULL,
                            1, smbp->ncb_length, ptbuf, smbp);
                DeregisterEventSource(h);
+#else /* DJGPP */
+                char s[100];
+
+                sprintf(s, "Bad SMB param %d out of %d, ncb len %d",
+                        parm, parmCount, smbp->ncb_length);
+                osi_Log0(afsd_logp, s);
+#endif /* !DJGPP */
                osi_panic(s, __FILE__, __LINE__);
        }
        parmDatap = smbp->wctp + (2*parm) + 1;
@@ -1133,6 +1607,7 @@ unsigned int smb_GetSMBOffsetParm(smb_packet_t *smbp, int parm, int offset)
        parmCount = *smbp->wctp;
 
        if (parm * 2 + offset >= parmCount * 2) {
+#ifndef DJGPP
                HANDLE h;
                char *ptbuf[1];
                char s[100];
@@ -1143,6 +1618,15 @@ unsigned int smb_GetSMBOffsetParm(smb_packet_t *smbp, int parm, int offset)
                ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 1006, NULL,
                            1, smbp->ncb_length, ptbuf, smbp);
                DeregisterEventSource(h);
+#else /* DJGPP */
+                char s[100];
+                
+                sprintf(s, "Bad SMB param %d offset %d out of %d, "
+                        "ncb len %d",
+                        parm, offset, parmCount, smbp->ncb_length);
+                osi_Log0(afsd_logp, s);
+#endif /* !DJGPP */
+
                osi_panic(s, __FILE__, __LINE__);
        }
        parmDatap = smbp->wctp + (2*parm) + 1 + offset;
@@ -1296,27 +1780,43 @@ void smb_SendPacket(smb_vc_t *vcp, smb_packet_t *inp)
         long code;
         unsigned char *tp;
        int localNCB = 0;
+#ifdef DJGPP
+        dos_ptr dos_ncb;
+#endif /* DJGPP */
         
         ncbp = inp->ncbp;
        if (ncbp == NULL) {
                ncbp = GetNCB();
                localNCB = 1;
        }
+#ifdef DJGPP
+        dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+#endif /* DJGPP */
        memset((char *)ncbp, 0, sizeof(NCB));
 
         extra = 2 * (*inp->wctp);      /* space used by parms, in bytes */
        tp = inp->wctp + 1+ extra;      /* points to count of data bytes */
         extra += tp[0] + (tp[1]<<8);
-        extra += (inp->wctp - inp->data);      /* distance to last wct field */
+        extra += ((unsigned int)inp->wctp - (unsigned int)inp->data);  /* distance to last wct field */
         extra += 3;                    /* wct and length fields */
         
         ncbp->ncb_length = extra;      /* bytes to send */
         ncbp->ncb_lsn = (unsigned char) vcp->lsn;      /* vc to use */
-       ncbp->ncb_lana_num = smb_LANadapter;
+       ncbp->ncb_lana_num = vcp->lana;
         ncbp->ncb_command = NCBSEND;   /* op means send data */
+#ifndef DJGPP
         ncbp->ncb_buffer = (char *) inp;/* packet */
-        
         code = Netbios(ncbp);
+#else /* DJGPP */
+        ncbp->ncb_buffer = inp->dos_pkt;/* packet */
+        ((smb_ncb_t*)ncbp)->orig_pkt = inp;
+
+        /* copy header information from virtual to DOS address space */
+        dosmemput((char*)inp, SMB_PACKETSIZE, inp->dos_pkt);
+        code = Netbios(ncbp, dos_ncb);
+#endif /* !DJGPP */
+        
        if (code != 0)
                osi_Log1(afsd_logp, "SendPacket failure code %d", code);
 
@@ -1566,6 +2066,10 @@ void smb_MapCoreError(long code, smb_vc_t *vcp, unsigned short *scodep,
                class = 1;
                error = 18;     /* no files in search */
        }
+        else if (code == CM_ERROR_RENAME_IDENTICAL) {
+                class = 1;
+                error = 183;     /* Samba uses this */
+        }
         else {
                class = 2;
                 error = 1;
@@ -1609,8 +2113,14 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp
        smb_fid_t *fidp;
        long code;
        cm_user_t *userp = NULL;
-       char *rawBuf;
-       NCB *ncbp;
+        NCB *ncbp;
+        int rc;
+#ifndef DJGPP
+        char *rawBuf = NULL;
+#else
+        dos_ptr rawBuf = NULL;
+        dos_ptr dos_ncb;
+#endif /* DJGPP */
 
        rawBuf = NULL;
        finalCount = 0;
@@ -1628,47 +2138,90 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp
        if (!fidp)
                goto send1;
 
-       if (fidp->flags & SMB_FID_IOCTL)
-               return smb_IoctlReadRaw(fidp, vcp, inp, outp);
-
-       userp = smb_GetUser(vcp, inp);
-
        lock_ObtainMutex(&smb_RawBufLock);
        if (smb_RawBufs) {
                /* Get a raw buf, from head of list */
                rawBuf = smb_RawBufs;
+#ifndef DJGPP
                smb_RawBufs = *(char **)smb_RawBufs;
+#else /* DJGPP */
+                smb_RawBufs = _farpeekl(_dos_ds, smb_RawBufs);
+#endif /* !DJGPP */
        }
        lock_ReleaseMutex(&smb_RawBufLock);
        if (!rawBuf)
-               goto send;
+               goto send1a;
 
+        if (fidp->flags & SMB_FID_IOCTL)
+        {
+#ifndef DJGPP
+          rc = smb_IoctlReadRaw(fidp, vcp, inp, outp);
+#else
+          rc = smb_IoctlReadRaw(fidp, vcp, inp, outp, rawBuf);
+#endif
+          if (rawBuf) {
+            /* Give back raw buffer */
+            lock_ObtainMutex(&smb_RawBufLock);
+#ifndef DJGPP
+            *((char **) rawBuf) = smb_RawBufs;
+#else /* DJGPP */
+            _farpokel(_dos_ds, rawBuf, smb_RawBufs);
+#endif /* !DJGPP */
+            
+            smb_RawBufs = rawBuf;
+            lock_ReleaseMutex(&smb_RawBufLock);
+          }
+          return rc;
+        }
+        
+        userp = smb_GetUser(vcp, inp);
+
+#ifndef DJGPP
        code = smb_ReadData(fidp, &offset, count, rawBuf, userp, &finalCount);
+#else /* DJGPP */
+        /* have to give ReadData flag so it will treat buffer as DOS mem. */
+        code = smb_ReadData(fidp, &offset, count, (unsigned char *)rawBuf,
+                            userp, &finalCount, TRUE /* rawFlag */);
+#endif /* !DJGPP */
+
        if (code != 0)
                goto send;
 
 send:
+        cm_ReleaseUser(userp);
+send1a:
        smb_ReleaseFID(fidp);
 
-       cm_ReleaseUser(userp);
 send1:
        ncbp = outp->ncbp;
+#ifdef DJGPP
+        dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+#endif /* DJGPP */
        memset((char *)ncbp, 0, sizeof(NCB));
 
        ncbp->ncb_length = (unsigned short) finalCount;
        ncbp->ncb_lsn = (unsigned char) vcp->lsn;
-       ncbp->ncb_lana_num = smb_LANadapter;
+       ncbp->ncb_lana_num = vcp->lana;
        ncbp->ncb_command = NCBSEND;
        ncbp->ncb_buffer = rawBuf;
 
+#ifndef DJGPP
        code = Netbios(ncbp);
+#else /* DJGPP */
+       code = Netbios(ncbp, dos_ncb);
+#endif /* !DJGPP */
        if (code != 0)
                osi_Log1(afsd_logp, "ReadRaw send failure code %d", code);
 
        if (rawBuf) {
                /* Give back raw buffer */
                lock_ObtainMutex(&smb_RawBufLock);
+#ifndef DJGPP
                *((char **) rawBuf) = smb_RawBufs;
+#else /* DJGPP */
+                _farpokel(_dos_ds, rawBuf, smb_RawBufs);
+#endif /* !DJGPP */
+
                smb_RawBufs = rawBuf;
                lock_ReleaseMutex(&smb_RawBufLock);
        }
@@ -1694,7 +2247,7 @@ long smb_ReceiveNegotiate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
        int NTProtoIndex;
         int protoIndex;                        /* index we're using */
         int namex;
-        long dbytes;
+        int dbytes;
        int entryLength;
         int tcounter;
        char protocol_array[10][1024]; /* protocol signature of the client */
@@ -1860,7 +2413,7 @@ void smb_Daemon(void *parmp)
 
        while(1) {
                count++;
-               Sleep(10000);
+               thrd_Sleep(10000);
                if ((count % 360) == 0)         /* every hour */
                        smb_CalculateNowTZ();
                /* XXX GC dir search entries */
@@ -1881,7 +2434,7 @@ void smb_WaitingLocksDaemon()
                nwL = smb_allWaitingLocks;
                if (nwL == NULL) {
                        osi_SleepW((long)&smb_allWaitingLocks, &smb_globalLock);
-                       Sleep(1000);
+                       thrd_Sleep(1000);
                        continue;
                }
                else first = 1;
@@ -1931,7 +2484,7 @@ endWait:
                        FreeNCB(ncbp);
                        free(wL);
                } while (nwL);
-               Sleep(1000);
+               thrd_Sleep(1000);
        }
 }
 
@@ -2124,9 +2677,9 @@ long smb_ReceiveCoreSearchVolume(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t
 
        /* pull pathname and stat block out of request */
        tp = smb_GetSMBData(inp, NULL);
-        pathp = smb_ParseASCIIBlock(tp, &tp);
+        pathp = smb_ParseASCIIBlock(tp, (char **) &tp);
         osi_assert(pathp != NULL);
-        statBlockp = smb_ParseVblBlock(tp, &tp, &statLen);
+        statBlockp = smb_ParseVblBlock(tp, (char **) &tp, &statLen);
         osi_assert(statBlockp != NULL);
        if (statLen == 0) {
                statBlockp = initStatBlock;
@@ -2251,7 +2804,7 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou
         int maxCount;
         smb_dirListPatch_t *dirListPatchesp;
         smb_dirListPatch_t *curPatchp;
-        long dataLength;
+        int dataLength;
         cm_buf_t *bufferp;
         long temp;
         osi_hyper_t dirLength;
@@ -2283,6 +2836,8 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou
         int caseFold;
        char *tidPathp;
         cm_req_t req;
+        cm_fid_t fid;
+        int fileType;
 
        cm_InitReq(&req);
 
@@ -2582,6 +3137,24 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou
                        /* this is one of the entries to use: it is not deleted
                         * and it matches the star pattern we're looking for.
                          */
+
+                        /* Eliminate entries that don't match requested
+                           attributes */
+                        if (!(dsp->attribute & 0x10))  /* no directories */
+                        {
+                           /* We have already done the cm_TryBulkStat above */
+                           fid.cell = scp->fid.cell;
+                           fid.volume = scp->fid.volume;
+                           fid.vnode = ntohl(dep->fid.vnode);
+                           fid.unique = ntohl(dep->fid.unique);
+                           fileType = cm_FindFileType(&fid);
+                           osi_Log2(afsd_logp, "smb_ReceiveCoreSearchDir: file %s "
+                                    "has filetype %d", dep->name,
+                                    fileType);
+                           if (fileType == CM_SCACHETYPE_DIRECTORY)
+                              goto nextEntry;
+                        }
+
                        *op++ = resByte;
                         memcpy(op, mask, 11); op += 11;
                         *op++ = (char) dsp->cookie;    /* they say it must be non-zero */
@@ -3114,7 +3687,7 @@ typedef struct smb_unlinkRock {
        int any;
 } smb_unlinkRock_t;
 
-long smb_UnlinkProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp)
+int smb_UnlinkProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp)
 {
        long code;
         smb_unlinkRock_t *rockp;
@@ -3234,7 +3807,7 @@ typedef struct smb_renameRock {
         char *newNamep;                /* ptr to the new file's name */
 } smb_renameRock_t;
 
-long smb_RenameProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp)
+int smb_RenameProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp)
 {
        long code;
         smb_renameRock_t *rockp;
@@ -3409,7 +3982,7 @@ typedef struct smb_rmdirRock {
        int any;
 } smb_rmdirRock_t;
 
-long smb_RmdirProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp)
+int smb_RmdirProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp)
 {
        long code;
         smb_rmdirRock_t *rockp;
@@ -3545,7 +4118,7 @@ struct smb_FullNameRock {
        char *fullName;
 };
 
-long smb_FullNameProc(cm_scache_t *scp, cm_dirEntry_t *dep, void *rockp,
+int smb_FullNameProc(cm_scache_t *scp, cm_dirEntry_t *dep, void *rockp,
        osi_hyper_t *offp)
 {
        char shortName[13];
@@ -3616,7 +4189,7 @@ long smb_ReceiveCoreClose(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
        /* Don't jump the gun on an async raw write */
        while (fidp->raw_writers) {
                lock_ReleaseMutex(&fidp->mx);
-               WaitForSingleObject(fidp->raw_write_event, RAWTIMEOUT);
+               thrd_WaitForSingleObject_Event(fidp->raw_write_event, RAWTIMEOUT);
                lock_ObtainMutex(&fidp->mx);
        }
 
@@ -3677,8 +4250,13 @@ long smb_ReceiveCoreClose(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
 /*
  * smb_ReadData -- common code for Read, Read And X, and Raw Read
  */
+#ifndef DJGPP
 long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op,
        cm_user_t *userp, long *readp)
+#else /* DJGPP */
+long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op,
+       cm_user_t *userp, long *readp, int dosflag)
+#endif /* !DJGPP */
 {
        osi_hyper_t offset;
        long code;
@@ -3796,6 +4374,11 @@ long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op,
                 if (nbytes > count) nbytes = count;    /* don't go past EOF */
                
                 /* now copy the data */
+#ifdef DJGPP
+                if (dosflag)
+                  dosmemput(bufferp->datap + bufIndex, nbytes, (dos_ptr)op);
+                else
+#endif /* DJGPP */
                 memcpy(op, bufferp->datap + bufIndex, nbytes);
                 
                /* adjust counters, pointers, etc. */
@@ -3820,8 +4403,13 @@ done:
 /*
  * smb_WriteData -- common code for Write and Raw Write
  */
+#ifndef DJGPP
 long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op,
        cm_user_t *userp, long *writtenp)
+#else /* DJGPP */
+long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op,
+       cm_user_t *userp, long *writtenp, int dosflag)
+#endif /* !DJGPP */
 {
        osi_hyper_t offset;
         long code;
@@ -3996,6 +4584,11 @@ long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op,
                 if (nbytes > count) nbytes = count;    /* don't go past end of request */
                
                 /* now copy the data */
+#ifdef DJGPP
+                if (dosflag)
+                  dosmemget((dos_ptr)op, nbytes, bufferp->datap + bufIndex);
+                else
+#endif /* DJGPP */
                 memcpy(bufferp->datap + bufIndex, op, nbytes);
                 buf_SetDirty(bufferp);
 
@@ -4051,7 +4644,7 @@ long smb_ReceiveCoreWrite(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
         cm_user_t *userp;
         cm_attr_t truncAttr;   /* attribute struct used for truncating file */
         char *op;
-        long inDataBlockCount;
+        int inDataBlockCount;
 
         fd = smb_GetSMBParm(inp, 0);
         count = smb_GetSMBParm(inp, 1);
@@ -4108,7 +4701,11 @@ long smb_ReceiveCoreWrite(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
                fidp->scp->clientModTime = time(NULL);
        }
 
+#ifndef DJGPP
        code = smb_WriteData(fidp, &offset, count, op, userp, &written);
+#else /* DJGPP */
+       code = smb_WriteData(fidp, &offset, count, op, userp, &written, FALSE);
+#endif /* !DJGPP */
        if (code == 0 && written < count)
                code = CM_ERROR_PARTIALWRITE;
 
@@ -4131,8 +4728,12 @@ void smb_CompleteWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
        unsigned short fd;
        smb_fid_t *fidp;
        cm_user_t *userp;
+#ifndef DJGPP
        char *rawBuf;
-       int written = 0;
+#else /* DJGPP */
+        dos_ptr rawBuf;
+#endif /* !DJGPP */
+       long written = 0;
        long code;
 
        fd = smb_GetSMBParm(inp, 0);
@@ -4143,10 +4744,16 @@ void smb_CompleteWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
 
        userp = smb_GetUser(vcp, inp);
 
+#ifndef DJGPP
        rawBuf = rwcp->buf;
-
        code = smb_WriteData(fidp, &rwcp->offset, rwcp->count, rawBuf, userp,
                             &written);
+#else /* DJGPP */
+       rawBuf = (dos_ptr) rwcp->buf;
+       code = smb_WriteData(fidp, &rwcp->offset, rwcp->count,
+                             (unsigned char *) rawBuf, userp,
+                            &written, TRUE);
+#endif /* !DJGPP */
 
        if (rwcp->writeMode & 0x1) {    /* synchronous */
                smb_t *op;
@@ -4163,13 +4770,17 @@ void smb_CompleteWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
                lock_ObtainMutex(&fidp->mx);
                fidp->raw_writers--;
                if (fidp->raw_writers == 0)
-                       SetEvent(fidp->raw_write_event);
+                       thrd_SetEvent(fidp->raw_write_event);
                lock_ReleaseMutex(&fidp->mx);
        }
 
        /* Give back raw buffer */
        lock_ObtainMutex(&smb_RawBufLock);
+#ifndef DJGPP
        *((char **)rawBuf) = smb_RawBufs;
+#else /* DJGPP */
+        _farpokel(_dos_ds, rawBuf, smb_RawBufs);
+#endif /* !DJGPP */
        smb_RawBufs = rawBuf;
        lock_ReleaseMutex(&smb_RawBufLock);
 
@@ -4193,7 +4804,11 @@ long smb_ReceiveCoreWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
         cm_user_t *userp;
         char *op;
        unsigned short writeMode;
+#ifndef DJGPP
        char *rawBuf;
+#else /* DJGPP */
+        dos_ptr rawBuf;
+#endif /* !DJGPP */
 
         fd = smb_GetSMBParm(inp, 0);
        totalCount = smb_GetSMBParm(inp, 1);
@@ -4232,7 +4847,11 @@ long smb_ReceiveCoreWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
                fidp->scp->clientModTime = time(NULL);
        }
 
+#ifndef DJGPP
        code = smb_WriteData(fidp, &offset, count, op, userp, &written);
+#else /* DJGPP */
+       code = smb_WriteData(fidp, &offset, count, op, userp, &written, FALSE);
+#endif /* !DJGPP */
        if (code == 0 && written < count)
                code = CM_ERROR_PARTIALWRITE;
 
@@ -4243,7 +4862,11 @@ long smb_ReceiveCoreWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
                if (smb_RawBufs) {
                        /* Get a raw buf, from head of list */
                        rawBuf = smb_RawBufs;
+#ifndef DJGPP
                        smb_RawBufs = *(char **)smb_RawBufs;
+#else /* DJGPP */
+                        smb_RawBufs = _farpeekl(_dos_ds, smb_RawBufs);
+#endif /* !DJGPP */
                }
                else
                        code = CM_ERROR_USESTD;
@@ -4254,7 +4877,7 @@ long smb_ReceiveCoreWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
        if (code == 0 && (writeMode & 1) == 0) {
                lock_ObtainMutex(&fidp->mx);
                fidp->raw_writers++;
-               ResetEvent(fidp->raw_write_event);
+               thrd_ResetEvent(fidp->raw_write_event);
                lock_ReleaseMutex(&fidp->mx);
        }
 
@@ -4338,7 +4961,11 @@ long smb_ReceiveCoreRead(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
         *op++ = (unsigned char) (count & 0xff);
         *op++ = (unsigned char) ((count >> 8) & 0xff);
                 
+#ifndef DJGPP
        code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount);
+#else /* DJGPP */
+        code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount, FALSE);
+#endif /* !DJGPP */
 
        /* fix some things up */
        smb_SetSMBParm(outp, 0, finalCount);
@@ -4689,6 +5316,7 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
        /* Sanity check */
        if (ncbp->ncb_length < offsetof(struct smb, vdata)) {
                /* log it and discard it */
+#ifndef DJGPP
                HANDLE h;
                char *ptbuf[1];
                char s[100];
@@ -4698,11 +5326,16 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
                ReportEvent(h, EVENTLOG_WARNING_TYPE, 0, 1007, NULL,
                        1, ncbp->ncb_length, ptbuf, inp);
                DeregisterEventSource(h);
+#else /* DJGPP */
+                osi_Log1(smb_logp, "SMB message too short, len %d",
+                         ncbp->ncb_length);
+#endif /* !DJGPP */
+
                return;
        }
 
        /* We are an ongoing op */
-       InterlockedIncrement(&ongoingOps);
+       thrd_Increment(&ongoingOps);
 
         /* set up response packet for receiving output */
        if (!(outp->flags & SMB_PACKETFLAG_SUSPENDED))
@@ -4757,10 +5390,32 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
                                /* Raw Write */
                                code = smb_ReceiveCoreWriteRaw (vcp, inp, outp,
                                                                rwcp);
-                       else
-                               code = (*(dp->procp)) (vcp, inp, outp);
+                       else {
+                               
+#ifdef DEBUG_VERBOSE
+                           HANDLE h; char *ptbuf[1],buf[132];DWORD err;
+                               h = RegisterEventSource(NULL, "AFS Server - Dispatch");
+                               sprintf(buf,"%s vcp[%x] lana[%d] lsn[%d]",myCrt_Dispatch(inp->inCom),vcp,vcp->lana,vcp->lsn);
+                               ptbuf[0] = buf;
+                               ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+                               DeregisterEventSource(h);
+#endif
+                                       code = (*(dp->procp)) (vcp, inp, outp);
+
+#ifdef DEBUG_VERBOSE
+                                       h = RegisterEventSource(NULL, "AFS Server - Dispatch return ");
+                                       sprintf(buf,"code[%d]",code-CM_ERROR_BASE);
+                                       if (code)
+                                               ptbuf[0] = buf;
+                                       else
+                                               ptbuf[0] = "code[0]";
+                                       ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+                                       DeregisterEventSource(h);
+#endif
+                               }
 
                        if (oldGen != sessionGen) {
+#ifndef DJGPP
                                HANDLE h;
                                char *ptbuf[1];
                                char s[100];
@@ -4772,21 +5427,28 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
                                ReportEvent(h, EVENTLOG_WARNING_TYPE, 0,
                                1005, NULL, 1, ncbp->ncb_length, ptbuf, smbp);
                                DeregisterEventSource(h);
+#else /* DJGPP */
+                               osi_Log1(afsd_logp, "Pkt straddled session startup, "
+                                       "ncb length %d", ncbp->ncb_length);
+#endif /* !DJGPP */
                        }
                 }
                 else {
                        /* bad opcode, fail the request, after displaying it */
+#ifndef DJGPP
                        if (showErrors) {
                                sprintf(tbuffer, "Received bad SMB req 0x%x", inp->inCom);
                                code = (*smb_MBfunc)(NULL, tbuffer, "Cancel: don't show again",
                                        MB_OKCANCEL);
                                if (code == IDCANCEL) showErrors = 0;
                        }
+#endif /* DJGPP */
                         code = CM_ERROR_BADOP;
                 }
 
                /* catastrophic failure:  log as much as possible */
                if (code == CM_ERROR_BADSMB) {
+#ifndef DJGPP
                        HANDLE h;
                        char *ptbuf[1];
                        char s[100];
@@ -4802,12 +5464,16 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
                        ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 1002, NULL,
                                    1, ncbp->ncb_length, ptbuf, smbp);
                        DeregisterEventSource(h);
+#else /* DJGPP */
+                        osi_Log1(afsd_logp, "Invalid SMB message, length %d",
+                                 ncbp->ncb_length);
+#endif /* !DJGPP */
 
                        code = CM_ERROR_INVAL;
                }
 
                if (outp->flags & SMB_PACKETFLAG_NOSEND) {
-                       InterlockedDecrement(&ongoingOps);
+                       thrd_Decrement(&ongoingOps);
                        return;
                }
 
@@ -4885,7 +5551,7 @@ resume:
                /* tp now points to the new output record; go back and patch the
                  * second parameter (off2) to point to the new record.
                  */
-               temp = tp - ((char *) outp->data);
+               temp = (unsigned int)tp - ((unsigned int) outp->data);
                 outWctp[3] = (unsigned char) (temp & 0xff);
                 outWctp[4] = (unsigned char) ((temp >> 8) & 0xff);
                 outWctp[2] = 0;        /* padding */
@@ -4911,7 +5577,7 @@ resume:
         /* now send the output packet, and return */
         if (!noSend)
                smb_SendPacket(vcp, outp);
-       InterlockedDecrement(&ongoingOps);
+       thrd_Decrement(&ongoingOps);
 
        if (!(vcp->flags & SMB_VCFLAG_ALREADYDEAD)) {
                active_vcp = vcp;
@@ -4923,6 +5589,7 @@ resume:
         return;
 }
 
+#ifndef DJGPP
 /* Wait for Netbios() calls to return, and make the results available to server
  * threads.  Note that server threads can't wait on the NCBevents array
  * themselves, because NCB events are manual-reset, and the servers would race
@@ -4933,16 +5600,17 @@ void smb_ClientWaiter(void *parmp)
        DWORD code, idx;
 
        while (1) {
-               code = WaitForMultipleObjects(numNCBs, NCBevents,
+               code = thrd_WaitForMultipleObjects_Event(numNCBs, NCBevents,
                                              FALSE, INFINITE);
                if (code == WAIT_OBJECT_0)
                        continue;
                idx = code - WAIT_OBJECT_0;
 
-               ResetEvent(NCBevents[idx]);
-               SetEvent(NCBreturns[0][idx]);
+               thrd_ResetEvent(NCBevents[idx]);
+               thrd_SetEvent(NCBreturns[0][idx]);
        }
 }
+#endif /* !DJGPP */
 
 /*
  * Try to have one NCBRECV request waiting for every live session.  Not more
@@ -4952,19 +5620,22 @@ void smb_ServerWaiter(void *parmp)
 {
        DWORD code, idx_session, idx_NCB;
        NCB *ncbp;
+#ifdef DJGPP
+        dos_ptr dos_ncb;
+#endif /* DJGPP */
 
        while (1) {
                /* Get a session */
-               code = WaitForMultipleObjects(numSessions, SessionEvents,
-                                             FALSE, INFINITE);
+               code = thrd_WaitForMultipleObjects_Event(numSessions, SessionEvents,
+                                                   FALSE, INFINITE);
                if (code == WAIT_OBJECT_0)
                        continue;
                idx_session = code - WAIT_OBJECT_0;
 
                /* Get an NCB */
 NCBretry:
-               code = WaitForMultipleObjects(numNCBs, NCBavails,
-                                             FALSE, INFINITE);
+               code = thrd_WaitForMultipleObjects_Event(numNCBs, NCBavails,
+                                                   FALSE, INFINITE);
                if (code == WAIT_OBJECT_0)
                        goto NCBretry;
                idx_NCB = code - WAIT_OBJECT_0;
@@ -4974,13 +5645,24 @@ NCBretry:
 
                /* Fire it up */
                ncbp = NCBs[idx_NCB];
+#ifdef DJGPP
+                dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+#endif /* DJGPP */
                ncbp->ncb_lsn = (unsigned char) LSNs[idx_session];
                ncbp->ncb_command = NCBRECV | ASYNCH;
-               ncbp->ncb_lana_num = smb_LANadapter;
+               ncbp->ncb_lana_num = lanas[idx_session];
+#ifndef DJGPP
                ncbp->ncb_buffer = (unsigned char *) bufs[idx_NCB];
-               ncbp->ncb_length = SMB_PACKETSIZE;
                ncbp->ncb_event = NCBevents[idx_NCB];
+               ncbp->ncb_length = SMB_PACKETSIZE;
                Netbios(ncbp);
+#else /* DJGPP */
+               ncbp->ncb_buffer = bufs[idx_NCB]->dos_pkt;
+                ((smb_ncb_t*)ncbp)->orig_pkt = bufs[idx_NCB];
+               ncbp->ncb_event = NCBreturns[0][idx_NCB];
+               ncbp->ncb_length = SMB_PACKETSIZE;
+               Netbios(ncbp, dos_ncb);
+#endif /* !DJGPP */
        }
 }
 
@@ -5005,6 +5687,9 @@ void smb_Server(VOID *parmp)
        UCHAR rc;
        smb_vc_t *vcp;
        smb_t *smbp;
+#ifdef DJGPP
+        dos_ptr dos_ncb;
+#endif /* DJGPP */
 
        outncbp = GetNCB();
        outbufp = GetPacket();
@@ -5019,18 +5704,21 @@ void smb_Server(VOID *parmp)
                                (*smb_MBfunc)(NULL, "AFS demo expiration",
                                           "afsd dispatcher",
                                           MB_OK|MB_ICONSTOP|MB_SETFOREGROUND);
-                               ExitThread(1);
+                               trhd_Exit(1);
                        }
                }
 #endif /* !NOEXPIRE */
 
-               code = WaitForMultipleObjects(numNCBs, NCBreturns[myIdx],
-                                             FALSE, INFINITE);
+               code = thrd_WaitForMultipleObjects_Event(numNCBs, NCBreturns[myIdx],
+                                                   FALSE, INFINITE);
                if (code == WAIT_OBJECT_0)
                        continue;
                idx_NCB = code - WAIT_OBJECT_0;
 
                ncbp = NCBs[idx_NCB];
+#ifdef DJGPP
+                dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+#endif /* DJGPP */
                idx_session = NCBsessions[idx_NCB];
                rc = ncbp->ncb_retcode;
 
@@ -5049,7 +5737,7 @@ void smb_Server(VOID *parmp)
                        case NRC_SNUMOUT:
                                /* Client closed session */
                                dead_sessions[idx_session] = TRUE;
-                               vcp = smb_FindVC(ncbp->ncb_lsn, 0);
+                               vcp = smb_FindVC(ncbp->ncb_lsn, 0, lanas[idx_session]);
                                /* Should also release vcp.  Also, would do
                                 * sanity check that all TID's are gone. */
                                if (dead_vcp)
@@ -5068,7 +5756,7 @@ void smb_Server(VOID *parmp)
                                        loggedOut = 1;
                                        loggedOutTime = vcp->logoffTime;
                                        loggedOutName =
-                                           strdup(vcp->justLoggedOut->name);
+                                           strdup(vcp->justLoggedOut->unp->name);
                                        loggedOutUserp = vcp->justLoggedOut;
                                        lock_ObtainWrite(&smb_rctLock);
                                        loggedOutUserp->refCount++;
@@ -5079,7 +5767,8 @@ void smb_Server(VOID *parmp)
                        case NRC_INCOMP:
                                /* Treat as transient error */
                                {
-                                       HANDLE h;
+#ifndef DJGPP
+                                       EVENT_HANDLE h;
                                        char *ptbuf[1];
                                        char s[100];
 
@@ -5096,6 +5785,15 @@ void smb_Server(VOID *parmp)
                                                    ncbp->ncb_length, ptbuf,
                                                    bufp);
                                        DeregisterEventSource(h);
+#else /* DJGPP */
+                                       osi_Log1(smb_logp,
+                                               "dispatch smb recv failed, message incomplete, ncb_length %d",
+                                               ncbp->ncb_length);
+                                        osi_Log1(smb_logp,
+                                                 "SMB message incomplete, "
+                                                 "length %d", ncbp->ncb_length);
+#endif /* !DJGPP */
+
                                        /*
                                         * We used to discard the packet.
                                         * Instead, try handling it normally.
@@ -5111,8 +5809,8 @@ void smb_Server(VOID *parmp)
                                if (vcp->errorCount++ > 3)
                                        dead_sessions[idx_session] = TRUE;
                                else {
-                                       Sleep(1000);
-                                       SetEvent(SessionEvents[idx_session]);
+                                       thrd_Sleep(1000);
+                                       thrd_SetEvent(SessionEvents[idx_session]);
                                }
                                continue;
                }
@@ -5123,31 +5821,44 @@ void smb_Server(VOID *parmp)
                if (smb_concurrentCalls > smb_maxObsConcurrentCalls)
                        smb_maxObsConcurrentCalls = smb_concurrentCalls;
 
-               vcp = smb_FindVC(ncbp->ncb_lsn, 0);
+               vcp = smb_FindVC(ncbp->ncb_lsn, 0, ncbp->ncb_lana_num);
                vcp->errorCount = 0;
                bufp = (struct smb_packet *) ncbp->ncb_buffer;
+#ifdef DJGPP
+               bufp = ((smb_ncb_t *) ncbp)->orig_pkt;
+                /* copy whole packet to virtual memory */
+                /*fprintf(stderr, "smb_Server: copying dos packet at 0x%x, "
+                        "bufp=0x%x\n",
+                        bufp->dos_pkt / 16, bufp);*/
+                fflush(stderr);
+                dosmemget(bufp->dos_pkt, ncbp->ncb_length, bufp->data);
+#endif /* DJGPP */
                smbp = (smb_t *)bufp->data;
                outbufp->flags = 0;
 
                if (smbp->com == 0x1d) {
                        /* Special handling for Write Raw */
                        raw_write_cont_t rwc;
-                       HANDLE rwevent;
+                       EVENT_HANDLE rwevent;
                        smb_DispatchPacket(vcp, bufp, outbufp, ncbp, &rwc);
                        if (rwc.code == 0) {
-                               rwevent = CreateEvent(NULL, FALSE, FALSE, NULL);
+                               rwevent = thrd_CreateEvent(NULL, FALSE, FALSE, NULL);
                                ncbp->ncb_command = NCBRECV | ASYNCH;
                                ncbp->ncb_lsn = (unsigned char) vcp->lsn;
-                               ncbp->ncb_lana_num = smb_LANadapter;
+                               ncbp->ncb_lana_num = vcp->lana;
                                ncbp->ncb_buffer = rwc.buf;
                                ncbp->ncb_length = 65535;
                                ncbp->ncb_event = rwevent;
+#ifndef DJGPP
                                Netbios(ncbp);
-                               rcode = WaitForSingleObject(rwevent,
-                                                           RAWTIMEOUT);
-                               CloseHandle(rwevent);
+#else
+                               Netbios(ncbp, dos_ncb);
+#endif /* !DJGPP */
+                               rcode = thrd_WaitForSingleObject_Event(rwevent,
+                                                                 RAWTIMEOUT);
+                               thrd_CloseHandle(rwevent);
                        }
-                       SetEvent(SessionEvents[idx_session]);
+                       thrd_SetEvent(SessionEvents[idx_session]);
                        if (rwc.code == 0)
                                smb_CompleteWriteRaw(vcp, bufp, outbufp, ncbp,
                                                     &rwc);
@@ -5157,16 +5868,16 @@ void smb_Server(VOID *parmp)
                         * (defect 11626)
                          */
                        smb_DispatchPacket(vcp, bufp, outbufp, ncbp, NULL);
-                       SetEvent(SessionEvents[idx_session]);
+                       thrd_SetEvent(SessionEvents[idx_session]);
                 } else {
-                       SetEvent(SessionEvents[idx_session]);
+                       thrd_SetEvent(SessionEvents[idx_session]);
                        smb_DispatchPacket(vcp, bufp, outbufp, ncbp, NULL);
                }
 
                smb_concurrentCalls--;
 
 doneWithNCB:
-               SetEvent(NCBavails[idx_NCB]);
+               thrd_SetEvent(NCBavails[idx_NCB]);
        }
 }
 
@@ -5179,13 +5890,15 @@ doneWithNCB:
 void InitNCBslot(int idx)
 {
        struct smb_packet *bufp;
-       HANDLE retHandle;
+       EVENT_HANDLE retHandle;
        int i;
 
        NCBs[idx] = GetNCB();
-       NCBavails[idx] = CreateEvent(NULL, FALSE, TRUE, NULL);
-       NCBevents[idx] = CreateEvent(NULL, TRUE, FALSE, NULL);
-       retHandle = CreateEvent(NULL, FALSE, FALSE, NULL);
+       NCBavails[idx] = thrd_CreateEvent(NULL, FALSE, TRUE, NULL);
+#ifndef DJGPP
+       NCBevents[idx] = thrd_CreateEvent(NULL, TRUE, FALSE, NULL);
+#endif /* !DJGPP */
+       retHandle = thrd_CreateEvent(NULL, FALSE, FALSE, NULL);
        for (i=0; i<smb_NumServerThreads; i++)
                NCBreturns[i][idx] = retHandle;
        bufp = GetPacket();
@@ -5205,10 +5918,25 @@ void smb_Listener(void *parmp)
        char rname[NCBNAMSZ+1];
        char cname[MAX_COMPUTERNAME_LENGTH+1];
        int cnamelen = MAX_COMPUTERNAME_LENGTH+1;
+#ifdef DJGPP
+        dos_ptr dos_ncb;
+        time_t now;
+#endif /* DJGPP */
+       int lana = (int) parmp;
 
        ncbp = GetNCB();
+#ifdef DJGPP
+        dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+#endif /* DJGPP */
 
        while (1) {
+               memset(ncbp, 0, sizeof(NCB));
+#ifdef DJGPP
+             /* terminate if shutdown flag is set */
+             if (smbShutdownFlag == 1)
+               thrd_Exit(1);
+#endif /* DJGPP */
+
 #ifndef NOEXPIRE
                /* check for demo expiration */
                {
@@ -5234,9 +5962,26 @@ void smb_Listener(void *parmp)
                strcpy(ncbp->ncb_callname, "*");
                for(i=1; i<NCBNAMSZ; i++) ncbp->ncb_callname[i] = ' ';
         
-               ncbp->ncb_lana_num = smb_LANadapter;
+               ncbp->ncb_lana_num = lana;
 
+#ifndef DJGPP
                code = Netbios(ncbp);
+#else /* DJGPP */
+               code = Netbios(ncbp, dos_ncb);
+
+                if (code != 0)
+                {
+                  fprintf(stderr, "NCBLISTEN lana=%d failed with code %d\n",
+                          ncbp->ncb_lana_num, code);
+                  osi_Log2(0, "NCBLISTEN lana=%d failed with code %d",
+                           ncbp->ncb_lana_num, code);
+                  fprintf(stderr, "\nClient exiting due to network failure "
+                          "(possibly due to power-saving mode)\n");
+                  fprintf(stderr, "Please restart client.\n");
+                  afs_exit(AFS_EXITCODE_NETWORK_FAILURE);
+                }
+#endif /* !DJGPP */
+
                osi_assert(code == 0);
 
                /* check for remote conns */
@@ -5256,12 +6001,20 @@ void smb_Listener(void *parmp)
                                flags |= SMB_VCFLAG_REMOTECONN;
 
                osi_Log1(afsd_logp, "New session lsn %d", ncbp->ncb_lsn);
+               /* lock */
+               lock_ObtainMutex(&smb_ListenerLock);
 
                /* New generation */
                sessionGen++;
 
                /* Log session startup */
+#ifdef NOSERVICE
+            fprintf(stderr, "New session(ncb_lsn,ncb_lana_num) %d,%d starting from host "
+                                "%s\n",
+                  ncbp->ncb_lsn,ncbp->ncb_lana_num, rname);
+#endif
                if (reportSessionStartups) {
+#ifndef DJGPP
                        HANDLE h;
                        char *ptbuf[1];
                        char s[100];
@@ -5273,11 +6026,22 @@ void smb_Listener(void *parmp)
                        ReportEvent(h, EVENTLOG_WARNING_TYPE, 0, 1004, NULL,
                                    1, 0, ptbuf, NULL);
                        DeregisterEventSource(h);
+#else /* DJGPP */
+            afsi_log("NCBLISTEN completed, call from %s",rname);
+            osi_Log1(afsd_logp, "SMB session startup, %d ongoing ops",
+                  ongoingOps);
+            time(&now);
+            fprintf(stderr, "%s: New session %d starting from host "
+                                "%s\n",
+                 asctime(localtime(&now)), ncbp->ncb_lsn, rname);
+            fflush(stderr);
+#endif /* !DJGPP */
                }
 
                 /* now ncbp->ncb_lsn is the connection ID */
-                vcp = smb_FindVC(ncbp->ncb_lsn, SMB_FLAG_CREATE);
+                vcp = smb_FindVC(ncbp->ncb_lsn, SMB_FLAG_CREATE, ncbp->ncb_lana_num);
                vcp->flags |= flags;
+                strcpy(vcp->rname, rname);
 
                /* Allocate slot in session arrays */
                /* Re-use dead session if possible, otherwise add one more */
@@ -5288,48 +6052,240 @@ void smb_Listener(void *parmp)
                        }
                }
                LSNs[i] = ncbp->ncb_lsn;
+               lanas[i] = ncbp->ncb_lana_num;
+               
                if (i == numSessions) {
                        /* Add new NCB for new session */
                        InitNCBslot(numNCBs);
                        numNCBs++;
-                       SetEvent(NCBavails[0]);
-                       SetEvent(NCBevents[0]);
+                       thrd_SetEvent(NCBavails[0]);
+                       thrd_SetEvent(NCBevents[0]);
                        for (j = 0; j < smb_NumServerThreads; j++)
-                               SetEvent(NCBreturns[j][0]);
+                               thrd_SetEvent(NCBreturns[j][0]);
                        /* Also add new session event */
-                       SessionEvents[i] = CreateEvent(NULL, FALSE, TRUE, NULL);
+                       SessionEvents[i] = thrd_CreateEvent(NULL, FALSE, TRUE, NULL);
                        numSessions++;
-                       SetEvent(SessionEvents[0]);
+                       thrd_SetEvent(SessionEvents[0]);
                } else {
-                       SetEvent(SessionEvents[i]);
+                       thrd_SetEvent(SessionEvents[i]);
                }
+               /* unlock */
+               lock_ReleaseMutex(&smb_ListenerLock);
 
         }      /* dispatch while loop */
 }
 
+/* initialize Netbios */
+void smb_NetbiosInit()
+{
+    NCB *ncbp;
+#ifdef DJGPP
+    dos_ptr dos_ncb;
+#endif /* DJGPP */
+    int i, lana, code, l;
+    char s[100];
+    int delname_tried=0;
+    int len;
+    int lana_found = 0;
+
+    /* setup the NCB system */
+    ncbp = GetNCB();
+#ifdef DJGPP
+    dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+#endif /* DJGPP */
+
+#ifndef DJGPP
+    if (smb_LANadapter == -1) {
+        ncbp->ncb_command = NCBENUM;
+        ncbp->ncb_buffer = &lana_list;
+        ncbp->ncb_length = sizeof(lana_list);
+        code = Netbios(ncbp);
+        if (code != 0) {
+            sprintf(s, "Netbios NCBENUM error code %d", code);
+            afsi_log(s);
+            osi_panic(s, __FILE__, __LINE__);
+        }
+    }
+    else {
+        lana_list.length = 1;
+        lana_list.lana[0] = smb_LANadapter;
+    }
+         
+    for (i = 0; i < lana_list.length; i++) {
+        /* reset the adaptor: in Win32, this is required for every process, and
+         * acts as an init call, not as a real hardware reset.
+         */
+        ncbp->ncb_command = NCBRESET;
+        ncbp->ncb_callname[0] = 100;
+        ncbp->ncb_callname[2] = 100;
+        ncbp->ncb_lana_num = lana_list.lana[i];
+        code = Netbios(ncbp);
+        if (code == 0) code = ncbp->ncb_retcode;
+        if (code != 0) {
+           sprintf(s, "Netbios NCBRESET lana %d error code %d", lana_list.lana[i], code);
+           afsi_log(s);
+           lana_list.lana[i] = 255;  /* invalid lana */
+        }
+        else {
+            sprintf(s, "Netbios NCBRESET lana %d succeeded", lana_list.lana[i]);
+            afsi_log(s);
+        }
+    }
+#else
+    /* for DJGPP, there is no NCBENUM and NCBRESET is a real reset.  so
+       we will just fake the LANA list */
+    if (smb_LANadapter == -1) {
+        for (i = 0; i < 8; i++)
+           lana_list.lana[i] = i;
+        lana_list.length = 8;
+    }
+    else {
+        lana_list.length = 1;
+        lana_list.lana[0] = smb_LANadapter;
+    }
+#endif /* !DJGPP */
+
+ try_addname:
+    /* and declare our name so we can receive connections */
+    memset(ncbp, 0, sizeof(*ncbp));
+    len=lstrlen(smb_localNamep);
+    memset(smb_sharename,' ',NCBNAMSZ);
+    memcpy(smb_sharename,smb_localNamep,len);
+#if 0
+    /*ncbp->ncb_lana_num = smb_LANadapter;*/
+    strcpy(ncbp->ncb_name, smb_localNamep);
+    len = strlen(smb_localNamep);
+    for(i=len; i<NCBNAMSZ; i++) ncbp->ncb_name[i] = ' ';
+#endif
+    /* Keep the name so we can unregister it later */
+    for (l = 0; l < lana_list.length; l++) {
+        lana = lana_list.lana[l];
+
+        ncbp->ncb_command = NCBADDNAME;
+        ncbp->ncb_lana_num = lana;
+        memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ);
+#ifndef DJGPP
+        code = Netbios(ncbp);
+#else /* DJGPP */
+        code = Netbios(ncbp, dos_ncb);
+#endif /* !DJGPP */
+          
+        afsi_log("Netbios NCBADDNAME lana=%d code=%d retcode=%d complete=%d",
+                 lana, code, ncbp->ncb_retcode,ncbp->ncb_cmd_cplt);
+        {
+            char name[NCBNAMSZ+1];
+            name[NCBNAMSZ]=0;
+            memcpy(name,ncbp->ncb_name,NCBNAMSZ);
+            afsi_log("Netbios NCBADDNAME added new name >%s<",name);
+        }
+
+        if (code == 0) code = ncbp->ncb_retcode;
+        if (code == 0) {
+            fprintf(stderr, "Netbios NCBADDNAME succeeded on lana %d\n", lana);
+#ifdef DJGPP
+            /* we only use one LANA with djgpp */
+            lana_list.lana[0] = lana;
+            lana_list.length = 1;
+#endif   
+        }
+        else {
+            sprintf(s, "Netbios NCBADDNAME lana %d error code %d", lana, code);
+            afsi_log(s);
+            fprintf(stderr, "Netbios NCBADDNAME lana %d error code %d\n", lana, code);
+            if (code == NRC_BRIDGE) {    /* invalid LANA num */
+                lana_list.lana[l] = 255;
+                continue;
+            }
+            else if (code == NRC_DUPNAME) {
+                /* Name already exists; try to delete it */
+                memset(ncbp, 0, sizeof(*ncbp));
+                ncbp->ncb_command = NCBDELNAME;
+                memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ);
+                ncbp->ncb_lana_num = lana;
+#ifndef DJGPP
+                code = Netbios(ncbp);
+#else
+                code = Netbios(ncbp, dos_ncb);
+#endif /* DJGPP */
+                if (code == 0) code = ncbp->ncb_retcode;
+                else
+                    fprintf(stderr, "Netbios NCBDELNAME lana %d error code %d\n", lana, code);
+                fflush(stderr);
+                if (code != 0 || delname_tried) {
+                    lana_list.lana[l] = 255;
+                }
+                else if (code == 0) {
+                    if (!delname_tried) {
+                        lana--;
+                        delname_tried = 1;
+                        continue;
+                    }
+                }
+            }
+            else {
+                sprintf(s, "Netbios NCBADDNAME lana %d error code %d", lana, code);
+                afsi_log(s);
+                lana_list.lana[l] = 255;  /* invalid lana */
+                osi_panic(s, __FILE__, __LINE__);
+            }
+        }
+        if (code == 0) {
+            lana_found = 1;   /* at least one worked */
+#ifdef DJGPP
+            break;
+#endif
+        }
+    }
+
+    osi_assert(lana_list.length >= 0);
+    if (!lana_found) {
+        sprintf(s, "No valid LANA numbers found!");
+        osi_panic(s, __FILE__, __LINE__);
+    }
+        
+    /* we're done with the NCB now */
+    FreeNCB(ncbp);
+}
+
 void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt,
-       int nThreads, void *aMBfunc)
+       int nThreads
+#ifndef DJGPP
+        , void *aMBfunc
+#endif
+  )
+
 {
-       HANDLE phandle;
-        long lpid;
+       thread_t phandle;
+        int lpid;
         int i;
         long code;
         int len;
         NCB *ncbp;
        struct tm myTime;
        char s[100];
+#ifdef DJGPP
+        int npar, seg, sel;
+        dos_ptr rawBuf;
+#endif /* DJGPP */
 
+#ifndef DJGPP
        smb_MBfunc = aMBfunc;
+#endif /* DJGPP */
 
 #ifndef NOEXPIRE
        /* check for demo expiration */
        {
                unsigned long tod = time((void *) 0);
                if (tod > EXPIREDATE) {
+#ifndef DJGPP
                        (*smb_MBfunc)(NULL, "AFS demo expiration",
                                   "afsd",
                                   MB_OK|MB_ICONSTOP|MB_SETFOREGROUND);
                        exit(1);
+#else /* DJGPP */
+                        fprintf(stderr, "AFS demo expiration\n");
+                        afs_exit(0);
+#endif /* !DJGPP */
                }
        }
 #endif /* !NOEXPIRE */
@@ -5365,7 +6321,10 @@ void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt,
        /* Raw I/O data structures */
        lock_InitializeMutex(&smb_RawBufLock, "smb raw buffer lock");
 
+       lock_InitializeMutex(&smb_ListenerLock, "smb listener lock");
+       
        /* 4 Raw I/O buffers */
+#ifndef DJGPP
        smb_RawBufs = GlobalAlloc(GMEM_FIXED, 65536);
        *((char **)smb_RawBufs) = NULL;
        for (i=0; i<3; i++) {
@@ -5373,57 +6332,57 @@ void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt,
                *((char **)rawBuf) = smb_RawBufs;
                smb_RawBufs = rawBuf;
        }
+#else /* DJGPP */
+        npar = 65536 >> 4;  /* number of paragraphs */
+        seg = __dpmi_allocate_dos_memory(npar, &smb_RawBufSel[0]);
+        if (seg == -1) {
+          afsi_log("Cannot allocate %d paragraphs of DOS memory",
+                   npar);
+          osi_panic("",__FILE__,__LINE__);
+        }
+        else {
+          afsi_log("Allocated %d paragraphs of DOS mem at 0x%X",
+                   npar, seg);
+        }
+        smb_RawBufs = (seg * 16) + 0;  /* DOS physical address */
+        
+        _farpokel(_dos_ds, smb_RawBufs, NULL);
+        for (i=0; i<SMB_RAW_BUFS-1; i++) {
+          npar = 65536 >> 4;  /* number of paragraphs */
+          seg = __dpmi_allocate_dos_memory(npar, &smb_RawBufSel[i+1]);
+          if (seg == -1) {
+            afsi_log("Cannot allocate %d paragraphs of DOS memory",
+                     npar);
+            osi_panic("",__FILE__,__LINE__);
+          }
+          else {
+            afsi_log("Allocated %d paragraphs of DOS mem at 0x%X",
+                     npar, seg);
+          }
+          rawBuf = (seg * 16) + 0;  /* DOS physical address */
+          /*_farpokel(_dos_ds, smb_RawBufs, smb_RawBufs);*/
+          _farpokel(_dos_ds, rawBuf, smb_RawBufs);
+          smb_RawBufs = rawBuf;
+        }
+#endif /* !DJGPP */
 
        /* global free lists */
        smb_ncbFreeListp = NULL;
         smb_packetFreeListp = NULL;
 
-       /* setup the NCB system */
-       ncbp = GetNCB();
-
-       /* reset the adaptor: in Win32, this is required for every process, and
-         * acts as an init call, not as a real hardware reset.
-         */
-        ncbp->ncb_command = NCBRESET;
-        ncbp->ncb_callname[0] = 100;
-        ncbp->ncb_callname[2] = 100;
-       ncbp->ncb_lana_num = smb_LANadapter;
-        code = Netbios(ncbp);
-        if (code == 0) code = ncbp->ncb_retcode;
-       if (code != 0) {
-               sprintf(s, "Netbios NCBRESET error code %d", code);
-               afsi_log(s);
-               osi_panic(s, __FILE__, __LINE__);
-       }
-
-       /* and declare our name so we can receive connections */
-       memset(ncbp, 0, sizeof(*ncbp));
-       ncbp->ncb_lana_num = smb_LANadapter;
-        ncbp->ncb_command = NCBADDNAME;
-       strncpy(ncbp->ncb_name, snamep, len);
-        for(i=len; i<NCBNAMSZ; i++) ncbp->ncb_name[i] = ' ';
-        code = Netbios(ncbp);
-       if (code == 0) {
-               code = ncbp->ncb_retcode;
-       }
-       if (code != 0) {
-               afsi_log("Netbios NCBADDNAME error code %d", code);
-       }
-        
-       /* we're done with the NCB now */
-        FreeNCB(ncbp);
+        smb_NetbiosInit();
 
        /* Initialize listener and server structures */
        memset(dead_sessions, 0, sizeof(dead_sessions));
-       SessionEvents[0] = CreateEvent(NULL, FALSE, FALSE, NULL);
+       SessionEvents[0] = thrd_CreateEvent(NULL, FALSE, FALSE, NULL);
        numSessions = 1;
        smb_NumServerThreads = nThreads;
-       NCBavails[0] = CreateEvent(NULL, FALSE, FALSE, NULL);
-       NCBevents[0] = CreateEvent(NULL, FALSE, FALSE, NULL);
-       NCBreturns = malloc(nThreads * sizeof(HANDLE *));
+       NCBavails[0] = thrd_CreateEvent(NULL, FALSE, FALSE, NULL);
+       NCBevents[0] = thrd_CreateEvent(NULL, FALSE, FALSE, NULL);
+       NCBreturns = malloc(nThreads * sizeof(EVENT_HANDLE *));
        for (i = 0; i < nThreads; i++) {
-               NCBreturns[i] = malloc(NCBmax * sizeof(HANDLE));
-               NCBreturns[i][0] = CreateEvent(NULL, FALSE, FALSE, NULL);
+               NCBreturns[i] = malloc(NCBmax * sizeof(EVENT_HANDLE));
+               NCBreturns[i][0] = thrd_CreateEvent(NULL, FALSE, FALSE, NULL);
        }
        for (i = 1; i <= nThreads; i++)
                InitNCBslot(i);
@@ -5516,39 +6475,103 @@ void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt,
 
        /* Start listeners, waiters, servers, and daemons */
 
-        phandle = CreateThread(NULL, 65536, (LPTHREAD_START_ROUTINE) smb_Listener,
-               NULL, 0, &lpid);
-       osi_assert(phandle != NULL);
-       CloseHandle(phandle);
+       for (i = 0; i < lana_list.length; i++) {
+               if (lana_list.lana[i] == 255) continue;
+               phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_Listener,
+                       (void*)lana_list.lana[i], 0, &lpid, "smb_Listener");
+               osi_assert(phandle != NULL);
+               thrd_CloseHandle(phandle);
+       }
 
-        phandle = CreateThread(NULL, 65536, (LPTHREAD_START_ROUTINE) smb_ClientWaiter,
-               NULL, 0, &lpid);
+#ifndef DJGPP
+        phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_ClientWaiter,
+               NULL, 0, &lpid, "smb_ClientWaiter");
        osi_assert(phandle != NULL);
-       CloseHandle(phandle);
+       thrd_CloseHandle(phandle);
+#endif /* !DJGPP */
 
-        phandle = CreateThread(NULL, 65536, (LPTHREAD_START_ROUTINE) smb_ServerWaiter,
-               NULL, 0, &lpid);
+        phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_ServerWaiter,
+               NULL, 0, &lpid, "smb_ServerWaiter");
        osi_assert(phandle != NULL);
-       CloseHandle(phandle);
+       thrd_CloseHandle(phandle);
 
        for (i=0; i<nThreads; i++) {
-               phandle = CreateThread(NULL, 65536,
-                                       (LPTHREAD_START_ROUTINE) smb_Server,
-                                       (void *) i, 0, &lpid);
+               phandle = thrd_Create(NULL, 65536,
+                                       (ThreadFunc) smb_Server,
+                                       (void *) i, 0, &lpid, "smb_Server");
                osi_assert(phandle != NULL);
-               CloseHandle(phandle);
+               thrd_CloseHandle(phandle);
        }
 
-        phandle = CreateThread(NULL, 65536, (LPTHREAD_START_ROUTINE) smb_Daemon,
-               NULL, 0, &lpid);
+        phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_Daemon,
+               NULL, 0, &lpid, "smb_Daemon");
        osi_assert(phandle != NULL);
-       CloseHandle(phandle);
+       thrd_CloseHandle(phandle);
 
-       phandle = CreateThread(NULL, 65536,
-               (LPTHREAD_START_ROUTINE) smb_WaitingLocksDaemon,
-               NULL, 0, &lpid);
+       phandle = thrd_Create(NULL, 65536,
+               (ThreadFunc) smb_WaitingLocksDaemon,
+               NULL, 0, &lpid, "smb_WaitingLocksDaemon");
        osi_assert(phandle != NULL);
-       CloseHandle(phandle);
+       thrd_CloseHandle(phandle);
+
+#ifdef DJGPP
+        smb_ListShares();
+#endif
 
        return;
 }
+
+#ifdef DJGPP
+void smb_Shutdown(void)
+{
+        NCB *ncbp;
+        dos_ptr dos_ncb;
+        long code;
+        int i;
+        
+        /*fprintf(stderr, "Entering smb_Shutdown\n");*/
+        
+        /* setup the NCB system */
+        ncbp = GetNCB();
+        dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+
+        /* Block new sessions by setting shutdown flag */
+        /*smbShutdownFlag = 1;*/
+
+        /* Hang up all sessions */
+        for (i = 1; i < numSessions; i++)
+        {
+          if (dead_sessions[i])
+            continue;
+          
+          /*fprintf(stderr, "NCBHANGUP session %d LSN %d\n", i, LSNs[i]);*/
+          ncbp->ncb_command = NCBHANGUP;
+          ncbp->ncb_lana_num = lanas[i];  /*smb_LANadapter;*/
+          ncbp->ncb_lsn = LSNs[i];
+          code = Netbios(ncbp, dos_ncb);
+          /*fprintf(stderr, "returned from NCBHANGUP session %d LSN %d\n", i, LS
+            Ns[i]);*/
+          if (code == 0) code = ncbp->ncb_retcode;
+          if (code != 0) {
+            fprintf(stderr, "Session %d Netbios NCBHANGUP error code %d", i, code);
+          }
+        }
+
+#if 1
+        /* Delete Netbios name */
+       for (i = 0; i < lana_list.length; i++) {
+               if (lana_list.lana[i] == 255) continue;
+               ncbp->ncb_command = NCBDELNAME;
+               ncbp->ncb_lana_num = lana_list.lana[i];
+               memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ);
+               code = Netbios(ncbp, dos_ncb);
+               if (code == 0) code = ncbp->ncb_retcode;
+               if (code != 0) {
+                       fprintf(stderr, "Netbios NCBDELNAME lana %d error code %d",
+                       ncbp->ncb_lana_num, code);
+               }
+               fflush(stderr);
+       }
+#endif
+}
+#endif /* DJGPP */
index 201bafdd99901484afd099eabbb5eb6b332d1b12..e3a9c2076d84bc5eb2d74f559b8fdf6b6c2d111a 100644 (file)
 #ifndef __SMB_H_ENV__
 #define __SMB_H_ENV__ 1
 
+#ifdef DJGPP
+#include "netbios95.h"
+#endif /* DJGPP */
+
 /* basic core protocol SMB structure */
 typedef struct smb {
        unsigned char id[4];
@@ -74,6 +78,10 @@ typedef struct smb_packet {
        unsigned char oddByte;
        unsigned short ncb_length;
        unsigned char flags;
+#ifdef DJGPP
+        dos_ptr dos_pkt;
+        unsigned int dos_pkt_sel;
+#endif /* DJGPP */
 } smb_packet_t;
 
 /* smb_packet flags */
@@ -87,6 +95,11 @@ typedef struct myncb {
        NCB ncb;                        /* ncb to use */
         struct myncb *nextp;           /* when on free list */
         long magic;
+#ifdef DJGPP
+        dos_ptr dos_ncb;
+        smb_packet_t *orig_pkt;
+        unsigned int dos_ncb_sel;
+#endif /* DJGPP */
 } smb_ncb_t;
 
 /* structures representing environments from kernel / SMB network.
@@ -111,8 +124,10 @@ typedef struct smb_vc {
         struct smb_fid *fidsp;         /* the first child in the open file list */
        struct smb_user *justLoggedOut; /* ready for profile upload? */
        unsigned long logoffTime;       /* tick count when logged off */
-       struct cm_user *logonDLLUser;   /* integrated logon user */
+       /*struct cm_user *logonDLLUser; /* integrated logon user */
        unsigned char errorCount;
+        char rname[17];
+       int lana;
 } smb_vc_t;
 
                                        /* have we negotiated ... */
@@ -131,10 +146,19 @@ typedef struct smb_user {
         osi_mutex_t mx;
         long userID;                   /* the session identifier */
         struct smb_vc *vcp;            /* back ptr to virtual circuit */
-       struct cm_user *userp;          /* CM user structure */
-       char *name;                     /* user name */
+  struct smb_username *unp;        /* user name struct */
 } smb_user_t;
 
+typedef struct smb_username {
+       struct smb_username *nextp;             /* next sibling */
+        long refCount;                 /* ref count */
+        long flags;                    /* flags; locked by mx */
+        osi_mutex_t mx;
+       struct cm_user *userp;          /* CM user structure */
+        char *name;                    /* user name */
+  char *machine;                  /* machine name */
+} smb_username_t;
+
 #define SMB_USERFLAG_DELETE    1       /* delete struct when ref count zero */
 
 /* one per tree-connect */
@@ -181,6 +205,9 @@ typedef struct smb_ioctl {
        
         /* flags */
         long flags;
+
+        /* fid pointer */
+        struct smb_fid *fidp;
 } smb_ioctl_t;
 
 /* flags for smb_ioctl_t */
@@ -209,7 +236,7 @@ typedef struct smb_fid {
        int curr_chunk;                 /* chunk being read */
        int prev_chunk;                 /* previous chunk read */
        int raw_writers;                /* pending async raw writes */
-       HANDLE raw_write_event;         /* signal this when raw_writers zero */
+       EVENT_HANDLE raw_write_event;   /* signal this when raw_writers zero */
 } smb_fid_t;
 
 #define SMB_FID_OPENREAD               1       /* open for reading */
@@ -252,6 +279,7 @@ typedef struct smb_dirListPatch {
        osi_queue_t q;
         char *dptr;            /* ptr to attr, time, data, sizel, sizeh */
        cm_fid_t fid;
+  cm_dirEntry_t *dep;   /* temp */
 } smb_dirListPatch_t;
 
 /* waiting lock list elements */
@@ -279,11 +307,16 @@ typedef struct smb_dispatch {
                                                 * the response was already
                                                 * sent.
                                                  */
+#define SMB_MAX_PATH                    256     /* max path length */
 
 /* prototypes */
 
 extern void smb_Init(osi_log_t *logp, char *smbNamep, int useV3, int LANadapt,
-       int nThreads, void *aMBfunc);
+       int nThreads
+#ifndef DJGPP
+        , void *aMBfunc
+#endif
+  );
 
 extern void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, long unixTime);
 
@@ -297,7 +330,7 @@ extern void smb_DosUTimeFromUnixTime(long *dosUTimep, long unixTime);
 
 extern void smb_UnixTimeFromDosUTime(long *unixTimep, long dosUTime);
 
-extern smb_vc_t *smb_FindVC(unsigned short lsn, int flags);
+extern smb_vc_t *smb_FindVC(unsigned short lsn, int flags, int lana);\r
 
 extern void smb_ReleaseVC(smb_vc_t *vcp);
 
@@ -402,8 +435,13 @@ extern unsigned char *smb_ParseVblBlock(unsigned char *inp, char **chainpp, int
 
 extern int smb_SUser(cm_user_t *userp);
 
+#ifndef DJGPP
 extern long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count,
        char *op, cm_user_t *userp, long *readp);
+#else /* DJGPP */
+extern long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count,
+       char *op, cm_user_t *userp, long *readp, int dosflag);
+#endif /* !DJGPP */
 
 extern BOOL smb_IsLegalFilename(char *filename);
 
@@ -411,5 +449,7 @@ extern BOOL smb_IsLegalFilename(char *filename);
 #include "smb3.h"
 #include "smb_ioctl.h"
 #include "smb_iocons.h"
+\r
+cm_user_t *smb_FindOrCreateUser(smb_vc_t *vcp, char *usern);\r
 
 #endif /* whole file */
index 8f3c5cb5c50b149fb1fe3c460f5b046ead2853ce..207f9f8fbe4a1a92b22885e00326afb895b08356 100644 (file)
@@ -7,10 +7,14 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
+//#define NOSERVICE 1 
+
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
+#endif /* !DJGPP */
 #include <stdlib.h>
 #include <malloc.h>
 #include <string.h>
@@ -40,14 +44,16 @@ smb_tran2Packet_t *smb_tran2AssemblyQueuep;
 cm_user_t *smb_GetTran2User(smb_vc_t *vcp, smb_tran2Packet_t *inp)
 {
        smb_user_t *uidp;
-        cm_user_t *up;
+        cm_user_t *up = NULL;
         
         uidp = smb_FindUID(vcp, inp->uid, 0);
         if (!uidp) return NULL;
         
        lock_ObtainMutex(&uidp->mx);
-        up = uidp->userp;
-        cm_HoldUser(up);
+        if (uidp->unp) {
+          up = uidp->unp->userp;
+          cm_HoldUser(up);
+        }
        lock_ReleaseMutex(&uidp->mx);
 
         smb_ReleaseUID(uidp);
@@ -105,119 +111,123 @@ unsigned char *smb_ParseString(unsigned char *inp, char **chainpp)
 
 long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
 {
-       char *tp;
-       char *usern, *pwd, *pwdx;
-       smb_user_t *uidp, *dead_uidp;
-       unsigned short newUid;
-       unsigned long caps;
-       cm_user_t *userp;
-       char *s1 = " ";
-
-       /* Check for bad conns */
-       if (vcp->flags & SMB_VCFLAG_REMOTECONN)
-               return CM_ERROR_REMOTECONN;
-
-       /* For NT LM 0.12 and up, get capabilities */
-       if (vcp->flags & SMB_VCFLAG_USENT) {
-               caps = smb_GetSMBParm(inp, 11);
-               if (caps & 0x40)
-                       vcp->flags |= SMB_VCFLAG_STATUS32;
-               /* for now, ignore other capability bits */
-       }
-
-       /* Parse the data */
-       tp = smb_GetSMBData(inp, NULL);
-       if (vcp->flags & SMB_VCFLAG_USENT)
-               pwdx = smb_ParseString(tp, &tp);
-       pwd = smb_ParseString(tp, &tp);
-       usern = smb_ParseString(tp, &tp);
-
-       /* Create a new UID and cm_user_t structure */
-       userp = cm_NewUser();
-       lock_ObtainMutex(&vcp->mx);
-       newUid = vcp->uidCounter++;
-       lock_ReleaseMutex(&vcp->mx);
-
-       /* Create a new smb_user_t structure and connect them up */
-       uidp = smb_FindUID(vcp, newUid, SMB_FLAG_CREATE);
-       lock_ObtainMutex(&uidp->mx);
-       uidp->userp = userp;
-       uidp->name = strdup(usern);
-       lock_ReleaseMutex(&uidp->mx);
-       smb_ReleaseUID(uidp);
-        
-       if (dead_vcp) {
-               dead_uidp = dead_vcp->usersp;
-               while (dead_uidp) {
-                       if (dead_uidp->userp
-                           && strcmp(dead_uidp->name, usern) == 0)
-                               break;
-                       dead_uidp = dead_uidp->nextp;
+    char *tp;
+    char *usern, *pwd, *pwdx;
+    smb_user_t *uidp, *dead_uidp;
+    unsigned short newUid;
+    unsigned long caps;
+    cm_user_t *userp;
+    smb_username_t *unp;
+    char *s1 = " ";
+
+    /* Check for bad conns */
+    if (vcp->flags & SMB_VCFLAG_REMOTECONN)
+        return CM_ERROR_REMOTECONN;
+
+    /* For NT LM 0.12 and up, get capabilities */
+    if (vcp->flags & SMB_VCFLAG_USENT) {
+        caps = smb_GetSMBParm(inp, 11);
+        if (caps & 0x40)
+            vcp->flags |= SMB_VCFLAG_STATUS32;
+        /* for now, ignore other capability bits */
+    }
+
+    /* Parse the data */
+    tp = smb_GetSMBData(inp, NULL);
+    if (vcp->flags & SMB_VCFLAG_USENT)
+        pwdx = smb_ParseString(tp, &tp);
+    pwd = smb_ParseString(tp, &tp);
+    usern = smb_ParseString(tp, &tp);
+
+    if (strlen(usern)==0) {
+        /*return CM_ERROR_NOACCESS;*/
+        newUid = 0;   /* always assign uid 0 for blank username */
+        uidp = smb_FindUID(vcp, newUid, SMB_FLAG_CREATE);
+#ifdef DEBUG_VERBOSE
+               {
+        HANDLE h; char *ptbuf[1],buf[132];
+        h = RegisterEventSource(NULL, "AFS Service - smb_ReceiveV3SessionSetupX");
+        sprintf(buf, "VCP[%x] lsn[%d] anonymous, uid[%d]",vcp,vcp->lsn,uidp->userID);
+        ptbuf[0] = buf;
+        ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+        DeregisterEventSource(h);
                }
-       }
-
-       /* transfer tokens from dead vcp */
-       if (dead_vcp && dead_uidp) {
-               cm_user_t *dead_userp;
-               s1 = ", tokens from terminated session";
-               dead_userp = dead_uidp->userp;
-               cm_ResetACLCache(dead_userp);
-               userp->cellInfop = dead_userp->cellInfop;
-               dead_userp->cellInfop = NULL;
-               dead_vcp = NULL;
-       }
-
-       /* transfer tokens from integrated logon */
-       if (vcp->logonDLLUser) {
-               s1 = ", tokens from integrated logon";
-               cm_ResetACLCache(vcp->logonDLLUser);
-               userp->cellInfop = vcp->logonDLLUser->cellInfop;
-               vcp->logonDLLUser->cellInfop = NULL;
-               vcp->logonDLLUser = NULL;
-       }
-
-       /* transfer tokens for logoff profile upload */
-       if (vcp->justLoggedOut) {
-               cm_user_t *logout_userp;
-               if (GetTickCount() - vcp->logoffTime <
-                       1000 * smb_LogoffTransferTimeout
-                   && strcmp(vcp->justLoggedOut->name, usern) == 0) {
-                       s1 = ", tokens from logoff";
-                       logout_userp = vcp->justLoggedOut->userp;
-                       cm_ResetACLCache(logout_userp);
-                       userp->cellInfop = logout_userp->cellInfop;
-                       logout_userp->cellInfop = NULL;
-               }
-               vcp->justLoggedOut = NULL;
-       }
-       else if (loggedOut) {
-               cm_user_t *logout_userp;
-               if (GetTickCount() - loggedOutTime <
-                       1000 * smb_LogoffTransferTimeout
-                   && strcmp(loggedOutName, usern) == 0) {
-                       s1 = ", tokens from logoff";
-                       logout_userp = loggedOutUserp->userp;
-                       cm_ResetACLCache(logout_userp);
-                       userp->cellInfop = logout_userp->cellInfop;
-                       logout_userp->cellInfop = NULL;
+#endif
+        smb_ReleaseUID(uidp);
+        goto done;
+    }
+
+    /* On Windows 2000, this function appears to be called more often than
+       it is expected to be called. This resulted in multiple smb_user_t
+       records existing all for the same user session which results in all
+       of the users tokens disappearing.
+
+       To avoid this problem, we look for an existing smb_user_t record
+       based on the users name, and use that one if we find it.
+    */
+
+    uidp = smb_FindUserByNameThisSession(vcp, usern);
+    if (uidp) {   /* already there, so don't create a new one */
+        unp = uidp->unp;
+        userp = unp->userp;
+        newUid = (unsigned short)uidp->userID;  /* For some reason these are different types!*/
+#ifdef DEBUG_VERBOSE
+        {
+                  HANDLE h; char *ptbuf[1],buf[132];
+                       h = RegisterEventSource(NULL, "AFS Service - smb_ReceiveV3SessionSetupX");
+                       sprintf(buf,"FindUserByName:VCP[%x],Lana[%d],lsn[%d],userid[%d],name[%s]",vcp,vcp->lana,vcp->lsn,newUid,usern);
+                       ptbuf[0] = buf;
+                       ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+                       DeregisterEventSource(h);
+        }
+#endif
+        smb_ReleaseUID(uidp);
+    }
+    else {
+      /* do a global search for the username/machine name pair */
+        unp = smb_FindUserByName(usern, vcp->rname, SMB_FLAG_CREATE);
+
+        /* Create a new UID and cm_user_t structure */
+        userp = unp->userp;
+        if (!userp)
+          userp = cm_NewUser();
+        lock_ObtainMutex(&vcp->mx);
+        newUid = vcp->uidCounter++;
+        lock_ReleaseMutex(&vcp->mx);
+
+        /* Create a new smb_user_t structure and connect them up */
+        lock_ObtainMutex(&unp->mx);
+        unp->userp = userp;
+        lock_ReleaseMutex(&unp->mx);
+
+        uidp = smb_FindUID(vcp, newUid, SMB_FLAG_CREATE);
+        lock_ObtainMutex(&uidp->mx);
+        uidp->unp = unp;
+#ifdef DEBUG_VERBOSE
+               {
+                  HANDLE h; char *ptbuf[1],buf[132];
+                       h = RegisterEventSource(NULL, "AFS Service - smb_ReceiveV3SessionSetupX");
+                       sprintf(buf,"NewUser:VCP[%x],Lana[%d],lsn[%d],userid[%d],name[%s]",vcp,vcp->lana,vcp->lsn,newUid,usern);
+                       ptbuf[0] = buf;
+                       ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+                       DeregisterEventSource(h);
                }
-               smb_ReleaseUID(loggedOutUserp);
-               loggedOutUserp = NULL;
-               free(loggedOutName);
-               loggedOutName = NULL;
-               loggedOut = 0;
-       }
-
-       /* Return UID to the client */
-       ((smb_t *)outp)->uid = newUid;
-       /* Also to the next chained message */
-       ((smb_t *)inp)->uid = newUid;
-
-       osi_Log3(afsd_logp, "SMB3 session setup name %s creating ID %d%s",
-                       osi_LogSaveString(afsd_logp, usern), newUid, osi_LogSaveString(afsd_logp, s1));
-       smb_SetSMBParm(outp, 2, 0);
-        smb_SetSMBDataLength(outp, 0);
-        return 0;
+#endif
+        lock_ReleaseMutex(&uidp->mx);
+        smb_ReleaseUID(uidp);
+    }
+
+ done:
+    /* Return UID to the client */
+    ((smb_t *)outp)->uid = newUid;
+    /* Also to the next chained message */
+    ((smb_t *)inp)->uid = newUid;
+
+    osi_Log3(afsd_logp, "SMB3 session setup name %s creating ID %d%s",
+             osi_LogSaveString(afsd_logp, usern), newUid, osi_LogSaveString(afsd_logp, s1));
+    smb_SetSMBParm(outp, 2, 0);
+    smb_SetSMBDataLength(outp, 0);
+    return 0;
 }
 
 long smb_ReceiveV3UserLogoffX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
@@ -234,27 +244,13 @@ long smb_ReceiveV3UserLogoffX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou
         if (uidp) {
                char *s1 = NULL, *s2 = NULL;
 
-               /* Also, this is not logon session any more */
-               if (uidp->userp == vcp->logonDLLUser) {
-                       s1 = ", was logon session";
-                       vcp->logonDLLUser = NULL;
-               }
-
-               /* But its tokens might be needed later */
-               if (uidp->userp && !(uidp->userp->flags & CM_USERFLAG_WASLOGON)
-                   && smb_LogoffTokenTransfer) {
-                       s2 = ", pre-logout effect";
-                       vcp->justLoggedOut = uidp;
-                       vcp->logoffTime = GetTickCount();
-               }
-
                if (s2 == NULL) s2 = " ";
                if (s1 == NULL) {s1 = s2; s2 = " ";}
 
                osi_Log4(afsd_logp, "SMB3 user logoffX uid %d name %s%s%s",
                         uidp->userID,
-                        osi_LogSaveString(afsd_logp, uidp->name),
-                        s1, s2);
+                        osi_LogSaveString(afsd_logp,
+                 (uidp->unp) ? uidp->unp->name: " "), s1, s2);
 
                lock_ObtainMutex(&uidp->mx);
                uidp->flags |= SMB_USERFLAG_DELETE;
@@ -549,6 +545,7 @@ long smb_ReceiveV3Tran2A(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
 
        /* We sometimes see 0 word count.  What to do? */
        if (*inp->wctp == 0) {
+#ifndef DJGPP
                HANDLE h;
                char *ptbuf[1];
 
@@ -559,6 +556,9 @@ long smb_ReceiveV3Tran2A(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
                ReportEvent(h, EVENTLOG_WARNING_TYPE, 0, 1003, NULL,
                            1, inp->ncb_length, ptbuf, inp);
                DeregisterEventSource(h);
+#else /* DJGPP */
+               osi_Log0(afsd_logp, "TRANSACTION2 word count = 0"); 
+#endif /* !DJGPP */
 
                 smb_SetSMBDataLength(outp, 0);
                 smb_SendPacket(vcp, outp);
@@ -1042,7 +1042,7 @@ struct smb_ShortNameRock {
        size_t shortNameLen;
 };
 
-long cm_GetShortNameProc(cm_scache_t *scp, cm_dirEntry_t *dep, void *vrockp,
+int cm_GetShortNameProc(cm_scache_t *scp, cm_dirEntry_t *dep, void *vrockp,
        osi_hyper_t *offp)
 {
        struct smb_ShortNameRock *rockp;
@@ -1221,7 +1221,7 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
                 smb_FreeTran2Packet(outp);
                 return 0;
         }
-        
+
         lock_ObtainMutex(&scp->mx);
         code = cm_SyncOp(scp, NULL, userp, &req, 0,
                CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
@@ -1235,7 +1235,7 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
        if (infoLevel == 0x108) {
                code = cm_GetShortName((char *)(&p->parmsp[3]), userp, &req,
                                        tidPathp, scp->fid.vnode, shortName,
-                                       &len);
+                                       (size_t *) &len);
                if (code) {
                        goto done;
                }
@@ -1888,6 +1888,8 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
        char shortName[13];             /* 8.3 name if needed */
        int NeedShortName;
        char *shortNameEnd;
+        int fileType;
+        cm_fid_t fid;
         
         cm_req_t req;
 
@@ -2199,6 +2201,24 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
                        || (NeedShortName
                            && smb_V3MatchMask(shortName, maskp,
                                                CM_FLAG_CASEFOLD)))) {
+
+                        /* Eliminate entries that don't match requested
+                           attributes */
+                        if (!(dsp->attribute & 0x10))  /* no directories */
+                        {
+                            /* We have already done the cm_TryBulkStat above */
+                            fid.cell = scp->fid.cell;
+                            fid.volume = scp->fid.volume;
+                            fid.vnode = ntohl(dep->fid.vnode);
+                            fid.unique = ntohl(dep->fid.unique);
+                            fileType = cm_FindFileType(&fid);
+                            /*osi_Log2(afsd_logp, "smb_ReceiveTran2SearchDir: file %s "
+                              "has filetype %d", dep->name,
+                              fileType);*/
+                            if (fileType == CM_SCACHETYPE_DIRECTORY)
+                              goto nextEntry;
+                        }
+
                        /* finally check if this name will fit */
 
                        /* standard dir entry stuff */
@@ -2294,6 +2314,9 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
                                curPatchp->fid.volume = scp->fid.volume;
                                curPatchp->fid.vnode = ntohl(dep->fid.vnode);
                                curPatchp->fid.unique = ntohl(dep->fid.unique);
+
+                                /* temp */
+                                curPatchp->dep = dep;
                        }
 
                        if (searchFlags & 4)
@@ -2960,7 +2983,11 @@ long smb_ReceiveV3ReadX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
        /* set the packet data length the count of the # of bytes */
         smb_SetSMBDataLength(outp, count);
 
+#ifndef DJGPP
        code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount);
+#else /* DJGPP */
+       code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount, FALSE);
+#endif /* !DJGPP */
 
        /* fix some things up */
        smb_SetSMBParm(outp, 5, finalCount);
@@ -4105,3 +4132,40 @@ void smb3_Init()
 {
        lock_InitializeMutex(&smb_Dir_Watch_Lock, "Directory Watch List Lock");
 }
+
+cm_user_t *smb_FindCMUserByName(/*smb_vc_t *vcp,*/ char *usern, char *machine)
+{
+    cm_user_t *userp;
+    /*int newUid;*/
+    smb_user_t *uidp;
+    smb_username_t *unp;
+
+    unp = smb_FindUserByName(usern, machine, SMB_FLAG_CREATE);
+    if (!unp->userp) {
+        lock_ObtainMutex(&unp->mx);
+        unp->userp = cm_NewUser();
+        lock_ReleaseMutex(&unp->mx);
+#ifdef DEBUG_VERBOSE
+               {       //jimpeter
+                  HANDLE h; char *ptbuf[1],buf[132];
+                       h = RegisterEventSource(NULL, "AFS Service - smb_FindCMUserByName");
+                       sprintf(buf,"New User name[%s] machine[%s]",usern,machine);
+                       ptbuf[0] = buf;
+                       ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+                       DeregisterEventSource(h);
+               }
+#endif
+    } 
+#ifdef DEBUG_VERBOSE
+         else  {       //jimpeter
+                  HANDLE h; char *ptbuf[1],buf[132];
+                       h = RegisterEventSource(NULL, "AFS Service - smb_FindCMUserByName");
+                       sprintf(buf,"Found-name[%s] machine[%s]",usern,machine);
+                       ptbuf[0] = buf;
+                       ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+                       DeregisterEventSource(h);
+               }
+#endif
+    return unp->userp;
+}
+
index 0bb445f2720f73c55934fa967051dbbbe6d772a8..937ed42ba516ad31e4942307e3d78b4ff017c029 100644 (file)
@@ -165,4 +165,14 @@ extern int smb_V3MatchMask(char *namep, char *maskp, int flags);
 
 extern void smb3_Init();
 
+#ifdef DJGPP
+#define DELETE (0x00010000)
+#define READ_CONTROL (0x00020000)
+#define SYNCHRONIZE (0x00100000)
+#define FILE_WRITE_ATTRIBUTES ( 0x0100 )
+#define FILE_GENERIC_READ (0x00120089)
+#define FILE_GENERIC_WRITE (0x00120116)
+#define FILE_GENERIC_EXECUTE (0x001200a0)
+#endif /* DJGPP */
+
 #endif /*  __SMB3_H_ENV__ */
index 4986e1f59673728b3b5bc112f9c7daba75c91ba8..a122e04c201ba0563c23d675560226f4acc914e5 100644 (file)
@@ -87,6 +87,7 @@ typedef struct cm_cacheParms {
 #define VIOC_LISTSYMLINK               0x24
 #define VIOC_DELSYMLINK                        0x25
 #define VIOC_MAKESUBMOUNT              0x26
+#define VIOC_SHUTDOWN                   0x27
 
 #define VIOC_GETRXKCRYPT               0x27
 #define VIOC_SETRXKCRYPT               0x28
index 0e0f742f3eb12e3880575d5ed311f43e1dda73ef..9e06d8822e229a7f7acfe00cd009cc3b61375e6a 100644 (file)
@@ -10,7 +10,9 @@
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
+#endif /* !DJGPP */
 #include <stdlib.h>
 #include <malloc.h>
 #include <string.h>
@@ -25,6 +27,9 @@
 
 smb_ioctlProc_t *smb_ioctlProcsp[SMB_IOCTL_MAXPROCS];
 
+/*extern unsigned char smb_LANadapter;*/
+extern LANA_ENUM lana_list;
+
 void smb_InitIoctl(void)
 {
        smb_ioctlProcsp[VIOCGETAL] = cm_IoctlGetACL;
@@ -64,6 +69,9 @@ void smb_InitIoctl(void)
        smb_ioctlProcsp[VIOC_MAKESUBMOUNT] = cm_IoctlMakeSubmount;
        smb_ioctlProcsp[VIOC_GETRXKCRYPT] = cm_IoctlGetRxkcrypt;
        smb_ioctlProcsp[VIOC_SETRXKCRYPT] = cm_IoctlSetRxkcrypt;
+#ifdef DJGPP
+       smb_ioctlProcsp[VIOC_SHUTDOWN] = cm_IoctlShutdown;
+#endif
 }
 
 /* called to make a fid structure into an IOCTL fid structure */
@@ -79,6 +87,7 @@ void smb_SetupIoctlFid(smb_fid_t *fidp, cm_space_t *prefix)
                iop = malloc(sizeof(*iop));
                 memset(iop, 0, sizeof(*iop));
                 fidp->ioctlp = iop;
+                               iop->fidp = fidp;
         }
        if (prefix) {
                copyPrefix = cm_GetSpace();
@@ -176,11 +185,6 @@ long smb_IoctlRead(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp,
                return code;
         }
 
-       if (iop->flags & SMB_IOCTLFLAG_LOGON) {
-               vcp->logonDLLUser = userp;
-               userp->flags |= CM_USERFLAG_WASLOGON;
-       }
-
        leftToCopy = (iop->outDatap - iop->outAllocp) - iop->outCopied;
         if (count > leftToCopy) count = leftToCopy;
         
@@ -219,7 +223,7 @@ long smb_IoctlWrite(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_packe
         long count;
         long code;
         char *op;
-        long inDataBlockCount;
+        int inDataBlockCount;
 
        code = 0;
        count = smb_GetSMBParm(inp, 1);
@@ -271,9 +275,13 @@ long smb_IoctlV3Read(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_pack
                smb_user_t *uidp;
 
                uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
-               osi_Log3(afsd_logp, "Ioctl uid %d user %x name %s",
-                        uidp->userID, userp,
-                        osi_LogSaveString(afsd_logp, uidp->name));
+               if (uidp && uidp->unp)
+                   osi_Log3(afsd_logp, "Ioctl uid %d user %x name %s",
+                            uidp->userID, userp,
+                            osi_LogSaveString(afsd_logp, uidp->unp->name));
+               else
+                   osi_Log2(afsd_logp, "Ioctl uid %d user %x no name",
+                            uidp->userID, userp);
                smb_ReleaseUID(uidp);
        }
 
@@ -286,11 +294,6 @@ long smb_IoctlV3Read(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_pack
                return code;
         }
 
-       if (iop->flags & SMB_IOCTLFLAG_LOGON) {
-               vcp->logonDLLUser = userp;
-               userp->flags |= CM_USERFLAG_WASLOGON;
-       }
-
        leftToCopy = (iop->outDatap - iop->outAllocp) - iop->outCopied;
         if (count > leftToCopy) count = leftToCopy;
         
@@ -334,13 +337,26 @@ long smb_IoctlV3Read(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_pack
 
 /* called from Read Raw to handle IOCTL descriptor reads */
 long smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp,
-       smb_packet_t *outp)
+       smb_packet_t *outp
+#ifdef DJGPP
+, dos_ptr rawBuf
+#endif /* DJGPP */
+)
 {
        smb_ioctl_t *iop;
        long leftToCopy;
        NCB *ncbp;
        long code;
        cm_user_t *userp;
+#ifdef DJGPP
+        dos_ptr dos_ncb;
+
+        if (rawBuf == 0)
+        {
+                osi_Log0(afsd_logp, "Failed to get raw buf for smb_IoctlReadRaw");
+                return -1;
+        }
+#endif /* DJGPP */
 
        iop = fidp->ioctlp;
 
@@ -350,9 +366,13 @@ long smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp,
                smb_user_t *uidp;
 
                uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
-               osi_Log3(afsd_logp, "Ioctl uid %d user %x name %s",
-                        uidp->userID, userp,
-                        osi_LogSaveString(afsd_logp, uidp->name));
+               if (uidp && uidp->unp)
+                   osi_Log3(afsd_logp, "Ioctl uid %d user %x name %s",
+                            uidp->userID, userp,
+                            osi_LogSaveString(afsd_logp, uidp->unp->name));
+               else
+                   osi_Log2(afsd_logp, "Ioctl uid %d user %x no name",
+                            uidp->userID, userp);
                smb_ReleaseUID(uidp);
        }
 
@@ -365,11 +385,6 @@ long smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp,
                return code;
        }
 
-       if (iop->flags & SMB_IOCTLFLAG_LOGON) {
-               vcp->logonDLLUser = userp;
-               userp->flags |= CM_USERFLAG_WASLOGON;
-       }
-
        leftToCopy = (iop->outDatap - iop->outAllocp) - iop->outCopied;
 
        ncbp = outp->ncbp;
@@ -378,9 +393,19 @@ long smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp,
        ncbp->ncb_length = (unsigned short) leftToCopy;
        ncbp->ncb_lsn = (unsigned char) vcp->lsn;
        ncbp->ncb_command = NCBSEND;
-       ncbp->ncb_buffer = iop->outCopied + iop->outAllocp;
+    /*ncbp->ncb_lana_num = smb_LANadapter;*/
+       ncbp->ncb_lana_num = vcp->lana;
 
+#ifndef DJGPP
+       ncbp->ncb_buffer = iop->outCopied + iop->outAllocp;
        code = Netbios(ncbp);
+#else /* DJGPP */
+        dosmemput(iop->outCopied + iop->outAllocp, ncbp->ncb_length, rawBuf);
+        ncbp->ncb_buffer = rawBuf;
+        dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+       code = Netbios(ncbp, dos_ncb);
+#endif /* !DJGPP */
+
        if (code != 0)
                osi_Log1(afsd_logp, "ReadRaw send failure code %d", code);
 
index 9e997972fa1fc7e3fd234d9679622c63bb450ea5..db157b95b21f7ff6855d4ef8ad852bdd1ac4fcbd 100644 (file)
@@ -31,7 +31,12 @@ extern long smb_IoctlWrite(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, sm
 
 extern long smb_IoctlV3Read(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp);
 
+#ifndef DJGPP
 extern long smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp,
        smb_packet_t *outp);
+#else /* DJGPP */
+extern long smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp,
+       smb_packet_t *outp, dos_ptr rawBuf);
+#endif /* !DJGPP */
 
 #endif /*  __SMB_IOCTL_H_ENV__ */
index c6998a81477d4abc8df9eacb6341d266dcc0af7a..d02d02b6236f98729560c6788de1f72078a5c3bc 100644 (file)
@@ -28,4 +28,7 @@ install_headers: $(INCFILES)
 
 install: install_headers $(LIBFILE)
 
+install9x: install
+
 clean::
+       $(DEL) $(LIBFILE)
\ No newline at end of file
index 3604afd15af897793cfdad19bf919cc443833d3a..fc20442dd7340ea67e8c5390e3e5e3c4bb3bab92 100644 (file)
@@ -16,7 +16,7 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I ..\afsd
 # include the primary makefile
 
 !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\..\config\NTMakefile.version
+!include ..\..\config\NTMakefile.version
 
 ############################################################################
 #
@@ -125,15 +125,66 @@ $(EXEFILE) : $(EXEOBJS) $(EXELIBS)
 
 install : $(COPYSOURCES) $(COPYHEADERS) $(EXEFILE) lang
 
-lang ::
-       $(CD) lang
-       for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile install
-       $(CD) ..
+install9x: install
+
+lang:: en_US ja_JP ko_KR zh_TW zh_CN pt_BR es_ES de_DE
+
 
 ############################################################################
 #
 # Dependencies
 #
 
+en_US:
+       $(CD) lang
+       $(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+ja_JP:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+ko_KR:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+zh_CN:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+zh_TW:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+pt_BR:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+es_ES:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+de_DE:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
 afs_config_stub.res : afs_config_stub.rc AFS_component_version_number.h
 
+clean::
+       $(CD) lang
+       if exist $(NTLANG) $(NTLANG) en_US $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) ja_JP $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) ko_KR $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) zh_CN $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) zh_TW $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) pt_BR $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) es_ES $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) de_DE $(MAKECMD) /nologo /f NTMakefile clean
+    $(CD) ..
index c1d8ee76762b7a9e64bbaf5554764d50a4261efd..8e2909336c6b18d2be944bf0f9234bb2b7a4a011 100644 (file)
@@ -48,9 +48,7 @@ $(DLLFILE) : $(DLLOBJS)
 install : $(DLLFILE)
 
 clean ::
-       @if exist *.res del *.res
-       @if exist RC*. del RC*.
-       @if exist RD*. del RD*.
+       $(DEL) *.res RC* RD* $(DLLFILE) $(DEL) $(DLLFILE)
 
 ############################################################################
 #
index 8f1667830086d5a14c557db33a6a368366182d7c..e71501c6fedf7cfd8eb4520615e78dc6c134b533 100644 (file)
@@ -5,8 +5,8 @@
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
 
-!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\..\config\NTMakefile.version
+!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)     
+!include ..\..\config\NTMakefile.version
 
 
 ############################################################################
@@ -35,23 +35,71 @@ $(DLLFILE): $(DLLOBJS)
 
 install: $(DLLFILE) lang
 
+install9x: install
+
 
 ############################################################################
 # Language target
 
-lang::
-       $(CD) lang
-       for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile install
-       $(CD) ..
-
+lang:: en_US ja_JP ko_KR zh_TW zh_CN pt_BR es_ES de_DE
 
 ############################################################################
 # Local clean target; augments predefined clean target
 
 clean::
+       $(CD) lang
+       if exist $(NTLANG) $(NTLANG) en_US $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) ja_JP $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) ko_KR $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) zh_CN $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) zh_TW $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) pt_BR $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) es_ES $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) de_DE $(MAKECMD) /nologo /f NTMakefile clean
+    $(CD) ..
 
 ############################################################################
 # Dependencies
 
 afs_cpa_stub.res : afs_cpa_stub.rc AFS_component_version_number.h
 
+en_US:
+       $(CD) lang
+       $(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+ja_JP:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+ko_KR:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+zh_CN:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+zh_TW:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+pt_BR:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+es_ES:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+de_DE:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
index 351bdbcf5a3828e14967cef0a8fa480a7c4c1050..5dd165dbc53ff72d417fef34e290a6f0b35ff425 100644 (file)
@@ -12,7 +12,7 @@ AFSDEV_AUXRCFLAGS = $(AFSDEV_AUXRCFLAGS) -I$(DESTDIR)\include -I..
 # include the primary makefile
 
 !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\..\..\config\NTMakefile.version
+!include ..\..\..\config\NTMakefile.version
 
 ############################################################################
 #
@@ -48,9 +48,7 @@ $(DLLFILE) : $(DLLOBJS)
 install : $(DLLFILE)
 
 clean ::
-       @if exist *.res del *.res
-       @if exist RC*. del RC*.
-       @if exist RD*. del RD*.
+       $(DEL) *.res RC* RD* $(DLLFILE) $(DEL) $(DLLFILE)
 
 ############################################################################
 #
index 0d62da0b2d53d6c1c3f971fd84075046c3644cc2..3ca6cbe18ae11753e4e67724197d07f7f18a371a 100644 (file)
@@ -48,9 +48,7 @@ $(DLLFILE) : $(DLLOBJS)
 install : $(DLLFILE)
 
 clean ::
-       @if exist *.res del *.res
-       @if exist RC*. del RC*.
-       @if exist RD*. del RD*.
+       $(DEL) *.res RC* RD* $(DLLFILE) $(DEL) $(DLLFILE)
 
 ############################################################################
 #
index 2f13fe9750ed55a90ef56315dd31c6474c8e88f5..31bf42b00e8679df56c9d43cc114e77a3319aa36 100644 (file)
@@ -8,7 +8,7 @@
 AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I..\afsd  /D"_WINDOWS" /D"_WINDLL" /D"_AFXDLL" /D"_USRDLL"
 
 !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\..\config\NTMakefile.version
+!include ..\..\config\NTMakefile.version
 
 
 ############################################################################
@@ -69,18 +69,66 @@ afs_shl_ext_stub.res: afs_shl_ext_stub.rc AFS_component_version_number.h
 # Install target; primary makefile target
 
 install: $(DLLFILE) lang
+install9x: install
 
 
 ############################################################################
 # Language target
 
-lang ::
+lang:: en_US ja_JP ko_KR zh_TW zh_CN pt_BR es_ES de_DE
+
+en_US:
+       $(CD) lang
+       $(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+ja_JP:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+ko_KR:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+zh_CN:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+zh_TW:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+pt_BR:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+es_ES:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+de_DE:
        $(CD) lang
-       for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile install
-       $(CD) ..
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
 
 
 ############################################################################
 # Local clean target; augments predefined clean target
 
 clean::
+       $(CD) lang
+       if exist $(NTLANG) $(NTLANG) en_US $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) ja_JP $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) ko_KR $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) zh_CN $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) zh_TW $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) pt_BR $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) es_ES $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) de_DE $(MAKECMD) /nologo /f NTMakefile clean
+    $(CD) ..
index 258f21e853828981b4ec92972dcc5db14efb3172..132df5ed14c9053c07804835b8a718dc2d012fed 100644 (file)
@@ -48,9 +48,7 @@ $(DLLFILE) : $(DLLOBJS)
 install : $(DLLFILE)
 
 clean ::
-       @if exist *.res del *.res
-       @if exist RC*. del RC*.
-       @if exist RD*. del RD*.
+       $(DEL) *.res RC* RD* $(DLLFILE) $(DEL) $(DLLFILE)
 
 ############################################################################
 #
index 0874cb3b6ed99540482a4f738e7d33d612f26103..6e503ff9b5e670e994f27db9927d35cc6d315cb5 100644 (file)
@@ -26,7 +26,8 @@ INCFILES =\
        $(INCFILEDIR)\osidb.h \
        $(INCFILEDIR)\osilog.h \
        $(INCFILEDIR)\osisleep.h \
-       $(INCFILEDIR)\perf.h
+       $(INCFILEDIR)\perf.h \
+     $(INCFILEDIR)\osithrdnt.h
 
 
 $(INCFILEDIR)\dbrpc.h: dbrpc.h
@@ -82,9 +83,11 @@ install_headers: $(INCFILES)
 
 install: install_headers $(DLLFILE)
 
+install9x: install
+
 ############################################################################
 # Local clean target; augments predefined clean target
 
 clean::
-       $(DEL) dbrpc_s.c dbrpc_c.c dbrpc.h 
+       $(DEL) dbrpc_s.c dbrpc_c.c dbrpc.h $(DLLFILE) $(INCFILES)
 
index 35561cde31268bf2f889034f76d6188904948b95..43b9aca345e1fcbf6a6c8cbb49a152d674ed9cd5 100644 (file)
 #ifndef _OSI_H_ENV_
 #define _OSI_H_ENV_ 1
 
-#include <rpc.h>
+#include <afs/param.h>
+
 /* misc definitions */
+
+/* large int */
+#ifndef DJGPP
+#include <rpc.h>
+#include <largeint.h>
+#include "osithrdnt.h"
+#else /* DJGPP */
+#include "largeint95.h"
+#endif /* !DJGPP */
+
 typedef LARGE_INTEGER osi_hyper_t;
+#ifndef DJGPP
 typedef GUID osi_uid_t;
+#else /* DJGPP */
+typedef int osi_uid_t;
+#endif /* !DJGPP */
+
+typedef int int32;
 
+#ifndef DJGPP
 /* basic util functions */
 #include "osiutils.h"
 
@@ -24,10 +42,12 @@ typedef GUID osi_uid_t;
 
 /* lock type definitions */
 #include "osiltype.h"
+#endif /* !DJGPP */
 
 /* basic sleep operations */
 #include "osisleep.h"
 
+#ifndef DJGPP
 /* base lock definitions */
 #include "osibasel.h"
 
@@ -36,11 +56,11 @@ typedef GUID osi_uid_t;
 
 /* RPC debug stuff */
 #include "osidb.h"
+#else /* DJGPP */
+#include "osithrd95.h"
+#endif /* !DJGPP */
 
 /* log stuff */
 #include "osilog.h"
 
-/* large int */
-#include <largeint.h>
-
 #endif /*_OSI_H_ENV_ */
index 3a9ad8bed6a7306106b05df3b4119fe6b2094822..6f6e37c54176adb361ce0914292c60830af920b5 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
 #include <rpc.h>
+#include "dbrpc.h"
+#endif /* !DJGPP */
 #include <malloc.h>
 #include "osi.h"
-#include "dbrpc.h"
 #include <assert.h>
 
-static CRITICAL_SECTION osi_fdCS;
+static Crit_Sec osi_fdCS;
 osi_fd_t *osi_allFDs;
 osi_fdType_t *osi_allFDTypes;
 long osi_nextFD = 0;
 
 osi_fdOps_t osi_TypeFDOps = {
        osi_FDTypeCreate,
+#ifndef DJGPP
        osi_FDTypeGetInfo,
+#endif
        osi_FDTypeClose
 };
 
@@ -49,7 +53,7 @@ long osi_UnregisterFDType(char *namep)
         osi_fdTypeFormat_t *nffp;
 
        /* check for dup name */
-       EnterCriticalSection(&osi_fdCS);
+       thrd_EnterCrit(&osi_fdCS);
        ftp = osi_FindFDType(namep);
         if (!ftp) return -1;
         
@@ -68,7 +72,7 @@ long osi_UnregisterFDType(char *namep)
         free(ftp);
 
        /* cleanup and go */
-       LeaveCriticalSection(&osi_fdCS);
+       thrd_LeaveCrit(&osi_fdCS);
        return 0;
 }
 
@@ -77,7 +81,7 @@ osi_fdType_t *osi_RegisterFDType(char *namep, osi_fdOps_t *opsp, void *datap)
        osi_fdType_t *ftp;
 
        /* check for dup name */
-       EnterCriticalSection(&osi_fdCS);
+       thrd_EnterCrit(&osi_fdCS);
        osi_assertx(osi_FindFDType(namep) == NULL, "registering duplicate iteration type");
 
        ftp = (osi_fdType_t *) malloc(sizeof(*ftp));
@@ -92,7 +96,7 @@ osi_fdType_t *osi_RegisterFDType(char *namep, osi_fdOps_t *opsp, void *datap)
        ftp->formatListp = NULL;
 
        osi_QAdd((osi_queue_t **) &osi_allFDTypes, &ftp->q);
-       LeaveCriticalSection(&osi_fdCS);
+       thrd_LeaveCrit(&osi_fdCS);
 
        return ftp;
 }
@@ -114,10 +118,10 @@ osi_AddFDFormatInfo(osi_fdType_t *typep, long region, long index,
        formatp->index = index;
 
        /* thread on the list when done */
-       EnterCriticalSection(&osi_fdCS);
+       thrd_EnterCrit(&osi_fdCS);
        formatp->nextp = typep->formatListp;
        typep->formatListp = formatp;
-       LeaveCriticalSection(&osi_fdCS);
+       thrd_LeaveCrit(&osi_fdCS);
 
        /* all done */
        return 0;
@@ -130,7 +134,7 @@ osi_InitFD(void) {
 
        osi_allFDs = NULL;
        osi_allFDTypes = NULL;
-       InitializeCriticalSection(&osi_fdCS);
+       thrd_InitCrit(&osi_fdCS);
 
        /* now, initialize the types system by adding a type
         * iteration operator
@@ -151,7 +155,7 @@ osi_fd_t *osi_AllocFD(char *namep)
        /* initialize for failure */
        fdp = NULL;
        
-       EnterCriticalSection(&osi_fdCS);
+       thrd_EnterCrit(&osi_fdCS);
        fdTypep = osi_FindFDType(namep);
        if (fdTypep) {
                code = (fdTypep->opsp->Create)(fdTypep, &fdp);
@@ -162,7 +166,7 @@ osi_fd_t *osi_AllocFD(char *namep)
                }
                else fdp = NULL;
        }
-       LeaveCriticalSection(&osi_fdCS);
+       thrd_LeaveCrit(&osi_fdCS);
 
        return fdp;
 }
@@ -171,11 +175,11 @@ osi_fd_t *osi_FindFD(long fd)
 {
        osi_fd_t *fdp;
 
-       EnterCriticalSection(&osi_fdCS);
+       thrd_EnterCrit(&osi_fdCS);
        for(fdp = osi_allFDs; fdp; fdp = (osi_fd_t *) osi_QNext(&fdp->q)) {
                if (fdp->fd == fd) break;
        }
-       LeaveCriticalSection(&osi_fdCS);
+       thrd_LeaveCrit(&osi_fdCS);
 
        return fdp;
 }
@@ -184,9 +188,9 @@ osi_CloseFD(osi_fd_t *fdp)
 {
        long code;
 
-       EnterCriticalSection(&osi_fdCS);
+       thrd_EnterCrit(&osi_fdCS);
        osi_QRemove((osi_queue_t **) &osi_allFDs, &fdp->q);
-       LeaveCriticalSection(&osi_fdCS);
+       thrd_LeaveCrit(&osi_fdCS);
 
        /* this call frees the FD's storage, so make sure everything is unthreaded
         * before here.
@@ -211,6 +215,7 @@ long osi_FDTypeCreate(osi_fdType_t *fdTypep, osi_fd_t **outpp)
 }
 
 
+#ifndef DJGPP
 long osi_FDTypeGetInfo(osi_fd_t *ifdp, osi_remGetInfoParms_t *outp)
 {
        osi_typeFD_t *fdp;
@@ -223,9 +228,9 @@ long osi_FDTypeGetInfo(osi_fd_t *ifdp, osi_remGetInfoParms_t *outp)
                outp->icount = 0;
                outp->scount = 1;
                strcpy(outp->sdata[0], typep->namep);
-               EnterCriticalSection(&osi_fdCS);
+               thrd_EnterCrit(&osi_fdCS);
                fdp->curp = (osi_fdType_t *) osi_QNext(&typep->q);
-               LeaveCriticalSection(&osi_fdCS);
+               thrd_LeaveCrit(&osi_fdCS);
                return 0;
        }
        else {
@@ -233,6 +238,7 @@ long osi_FDTypeGetInfo(osi_fd_t *ifdp, osi_remGetInfoParms_t *outp)
                return OSI_DBRPC_EOF;
        }
 }
+#endif /* !DJGPP */
 
 long osi_FDTypeClose(osi_fd_t *ifdp)
 {
index cdac59f264ef46cf88d6c62ee5741b2675aa1098..12d50c9078182b1ea6ee3536283549b1a344b6e3 100644 (file)
 #ifndef _OSIFD_H_ENV_
 #define _OSIFD_H_ENV_ 1
 
+#ifndef DJGPP
 #include "dbrpc.h"
+#endif /* !DJGPP */
 #include "osiqueue.h"
 
+struct osi_fd;
+struct osi_fdType;
+
 /* operations on a file descriptor */
 typedef struct osi_fdOps {
        /* create an object, passed in the type info and returns
@@ -22,10 +27,12 @@ typedef struct osi_fdOps {
         */
        long (*Create)(struct osi_fdType *, struct osi_fd **);
 
+#ifndef DJGPP
        /* gets info about the object; fields are type specific, and eventually
         * self-labelling
         */
        long (*GetInfo)(struct osi_fd *, osi_remGetInfoParms_t *);
+#endif
 
        /* close an object; frees the storage associated with it */
        long (*Close)(struct osi_fd *);
@@ -84,7 +91,9 @@ extern osi_CloseFD(osi_fd_t *);
 
 extern long osi_FDTypeCreate(osi_fdType_t *, osi_fd_t **);
 
+#ifndef DJGPP
 extern long osi_FDTypeGetInfo(osi_fd_t *, osi_remGetInfoParms_t *);
+#endif
 
 extern long osi_FDTypeClose(osi_fd_t *);
 
index 531f88b18a028f3a21e28e9817fa5b1f451c5c72..5f44377b8de2b4309dd58eb96a461180c96dbaf7 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
 #include <rpc.h>
+#endif /* !DJGPP */
 #include <malloc.h>
 #include "osi.h"
+#ifndef DJGPP
 #include "dbrpc.h"
+#endif /* !DJGPP */
 #include <stdio.h>
 #include <assert.h>
 
@@ -31,7 +35,9 @@ unsigned long osi_logTixToMicros;     /* mult. correction factor */
 
 osi_fdOps_t osi_logFDOps = {
        osi_LogFDCreate,
+#ifndef DJGPP
         osi_LogFDGetInfo,
+#endif
         osi_LogFDClose
 };
 
@@ -45,6 +51,7 @@ osi_log_t *osi_LogCreate(char *namep, long size)
         LARGE_INTEGER bigTemp;
         LARGE_INTEGER bigJunk;
        
+#ifndef DJGPP
        if (osi_Once(&osi_logOnce)) {
                QueryPerformanceFrequency(&bigFreq);
                 if (bigFreq.LowPart == 0 && bigFreq.HighPart == 0)
@@ -66,6 +73,7 @@ osi_log_t *osi_LogCreate(char *namep, long size)
                /* done with init */
                osi_EndOnce(&osi_logOnce);
         }
+#endif /* !DJGPP */
 
         logp = malloc(sizeof(osi_log_t));
         memset(logp, 0, sizeof(osi_log_t));
@@ -87,11 +95,12 @@ osi_log_t *osi_LogCreate(char *namep, long size)
        logp->stringsp = malloc((size/10) * OSI_LOG_STRINGSIZE);
  
         /* and sync */
-        InitializeCriticalSection(&logp->cs);
+        thrd_InitCrit(&logp->cs);
         
        strcpy(tbuffer, "log:");
         strcat(tbuffer, namep);
        typep = osi_RegisterFDType(tbuffer, &osi_logFDOps, logp);
+#ifndef DJGPP
        if (typep) {
                /* add formatting info */
                osi_AddFDFormatInfo(typep, OSI_DBRPC_REGIONINT, 0,
@@ -99,6 +108,7 @@ osi_log_t *osi_LogCreate(char *namep, long size)
                osi_AddFDFormatInfo(typep, OSI_DBRPC_REGIONSTRING, 1,
                        "Time (mics)", 0);
        }
+#endif
        
         return logp;
 }
@@ -130,9 +140,9 @@ void osi_LogPanic(char *filep, long lineNumber)
 void osi_LogReset(osi_log_t *logp)
 {
        if (logp) {
-               EnterCriticalSection(&logp->cs);
+               thrd_EnterCrit(&logp->cs);
                logp->nused = 0;
-               LeaveCriticalSection(&logp->cs);
+               thrd_LeaveCrit(&logp->cs);
        }
 }
 
@@ -145,7 +155,7 @@ void osi_LogFree(osi_log_t *logp)
 
        free(logp->namep);
         free(logp->datap);
-       DeleteCriticalSection(&logp->cs);
+       thrd_DeleteCrit(&logp->cs);
         free(logp);
 }
 
@@ -164,7 +174,7 @@ void osi_LogAdd(osi_log_t *logp, char *formatp, long p0, long p1, long p2, long
          */
        if (!logp->enabled) return;
         
-       EnterCriticalSection(&logp->cs);
+       thrd_EnterCrit(&logp->cs);
        if (logp->nused < logp->alloc) logp->nused++;
        else {
                logp->first++;
@@ -174,24 +184,28 @@ void osi_LogAdd(osi_log_t *logp, char *formatp, long p0, long p1, long p2, long
         if (ix >= logp->alloc) ix -= logp->alloc;
 
         lep = logp->datap + ix;        /* ptr arith */
-        lep->tid = GetCurrentThreadId();
+        lep->tid = thrd_Current();
 
        /* get the time, using the high res timer if available */
+#ifndef DJGPP
         if (osi_logFreq) {
                QueryPerformanceCounter(&bigTime);
                lep->micros = (bigTime.LowPart / osi_logFreq) * osi_logTixToMicros;
         }
         else lep->micros = GetCurrentTime() * 1000;
+#else
+        lep->micros = gettime_us();
+#endif /* !DJGPP */                
 
         lep->formatp = formatp;
         lep->parms[0] = p0;
         lep->parms[1] = p1;
         lep->parms[2] = p2;
         lep->parms[3] = p3;
-       LeaveCriticalSection(&logp->cs);
+       thrd_LeaveCrit(&logp->cs);
 }
 
-void osi_LogPrint(osi_log_t *logp, HANDLE handle)
+void osi_LogPrint(osi_log_t *logp, FILE_HANDLE handle)
 {
        char wholemsg[1000], msg[1000];
        int i, ix, ioCount;
@@ -199,7 +213,7 @@ void osi_LogPrint(osi_log_t *logp, HANDLE handle)
 
        if (!logp->enabled) return;
 
-       EnterCriticalSection(&logp->cs);
+       thrd_EnterCrit(&logp->cs);
 
        for (ix = logp->first, i = 0;
             i < logp->nused;
@@ -212,12 +226,16 @@ void osi_LogPrint(osi_log_t *logp, HANDLE handle)
                        lep->micros / 1000000,
                        lep->micros % 1000000,
                        lep->tid, msg);
+#ifndef DJGPP
                if (!WriteFile(handle, wholemsg, strlen(wholemsg),
                                &ioCount, NULL))
+#else /* DJGPP */
+                if ((ioCount = fwrite(wholemsg, 1, strlen(wholemsg), handle)) == 0)
+#endif /* !DJGPP */
                        break;
        }
 
-       LeaveCriticalSection(&logp->cs);
+       thrd_LeaveCrit(&logp->cs);
 }
 
 char *osi_LogSaveString(osi_log_t *logp, char *s)
@@ -245,16 +263,17 @@ long osi_LogFDCreate(osi_fdType_t *typep, osi_fd_t **outpp)
         
         lfdp = malloc(sizeof(*lfdp));
         logp = lfdp->logp = typep->rockp;      /* the log we were created for */
-        EnterCriticalSection(&logp->cs);
+        thrd_EnterCrit(&logp->cs);
        lfdp->nused = logp->nused;
         lfdp->first = logp->first;
         lfdp->current = 0;
-       LeaveCriticalSection(&logp->cs);
+       thrd_LeaveCrit(&logp->cs);
 
        *outpp = &lfdp->fd;
         return 0;
 }
 
+#ifndef DJGPP
 long osi_LogFDGetInfo(osi_fd_t *ifd, osi_remGetInfoParms_t *outp)
 {
        osi_logFD_t *lfdp;
@@ -270,7 +289,7 @@ long osi_LogFDGetInfo(osi_fd_t *ifd, osi_remGetInfoParms_t *outp)
        if (lfdp->current >= lfdp->nused) return OSI_DBRPC_EOF;
         
        /* grab lock */
-       EnterCriticalSection(&logp->cs);
+       thrd_EnterCrit(&logp->cs);
 
         /* compute which one we want */
         ix = lfdp->first + lfdp->current;
@@ -289,9 +308,10 @@ long osi_LogFDGetInfo(osi_fd_t *ifd, osi_remGetInfoParms_t *outp)
         outp->scount = 2;
         outp->icount = 1;
 
-       LeaveCriticalSection(&logp->cs);
+       thrd_LeaveCrit(&logp->cs);
         return 0;
 }
+#endif /* !DJGPP */
 
 long osi_LogFDClose(osi_fd_t *ifdp)
 {
index 729661dc12bd4798bcefcd9e1844fc1cd063ff96..569f429d48a7036b77a631eb5983f8b715575b3a 100644 (file)
 #ifndef _OSI_LOG_H__
 #define _OSI_LOG_H__ 1
 
+#include "osi.h"
+#ifndef DJGPP
 #include "osisleep.h"
 #include "osibasel.h"
 #include "osistatl.h"
+#endif /* !DJGPP */
 #include "osifd.h"
 #include "osiqueue.h"
 
@@ -34,7 +37,7 @@ typedef struct osi_log {
        long alloc;                     /* allocated size */
         long nused;                    /* number currently in use */
         long first;                    /* index of first entry */
-        CRITICAL_SECTION cs;           /* use this, rather than a higher-level
+        Crit_Sec cs;           /* use this, rather than a higher-level
                                         * lock, so we can log stuff from
                                         * osi lock pkg */
         osi_logEntry_t *datap;         /* data for the log */
@@ -64,7 +67,9 @@ extern void osi_LogReset(osi_log_t *);
 
 extern long osi_LogFDCreate(osi_fdType_t *, osi_fd_t **);
 
+#ifndef DJGPP
 extern long osi_LogFDGetInfo(osi_fd_t *, osi_remGetInfoParms_t *);
+#endif
 
 extern long osi_LogFDClose(osi_fd_t *);
 
@@ -74,7 +79,7 @@ extern void osi_LogDisable(osi_log_t *);
 
 extern void osi_LogPanic(char *filep, long line);
 
-extern void osi_LogPrint(osi_log_t *logp, HANDLE handle);
+extern void osi_LogPrint(osi_log_t *logp, FILE_HANDLE handle);
 
 extern char *osi_LogSaveString(osi_log_t *logp, char *s);
 
index a0ea8d58f5e06d9b5a5fd8fac4d9b3960d2ad51c..4e840d84a8d36e8e2988b935e027551df07eb94f 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifndef DJGPP
 #include <windows.h>
+#endif /* !DJGPP */
 #include "osi.h"
 #include <stdlib.h>
 
 /* critical section protecting allocation of osi_queueData_t elements */
-CRITICAL_SECTION osi_qdcrit;
+Crit_Sec osi_qdcrit;
 
 /* free list of queue elements */
 osi_queueData_t *osi_QDFreeListp = NULL;
@@ -112,7 +114,7 @@ void osi_InitQueue(void)
        if (initd) return;
 
        initd = 1;
-       InitializeCriticalSection(&osi_qdcrit);
+       thrd_InitCrit(&osi_qdcrit);
 }
 
 osi_queueData_t *osi_QDAlloc(void)
@@ -120,7 +122,7 @@ osi_queueData_t *osi_QDAlloc(void)
        osi_queueData_t *tp;
        int i;
 
-       EnterCriticalSection(&osi_qdcrit);
+       thrd_EnterCrit(&osi_qdcrit);
        if (tp = osi_QDFreeListp) {
                osi_QDFreeListp = (osi_queueData_t *) tp->q.nextp;
        }
@@ -142,7 +144,7 @@ osi_queueData_t *osi_QDAlloc(void)
                 */
                 tp->datap = NULL;
        }
-       LeaveCriticalSection(&osi_qdcrit);
+       thrd_LeaveCrit(&osi_qdcrit);
 
        osi_assertx(tp->datap == NULL, "queue freelist screwup");
 
@@ -151,9 +153,9 @@ osi_queueData_t *osi_QDAlloc(void)
 
 void osi_QDFree(osi_queueData_t *qp)
 {
-       EnterCriticalSection(&osi_qdcrit);
+       thrd_EnterCrit(&osi_qdcrit);
        qp->q.nextp = (osi_queue_t *) osi_QDFreeListp;
         qp->datap = NULL;
        osi_QDFreeListp = qp;
-        LeaveCriticalSection(&osi_qdcrit);
+        thrd_LeaveCrit(&osi_qdcrit);
 }
index 308fcf33c597af4e8f53c054df94d8b257fc21a0..aaf0c8f96bf5e01e1c5648ad1d2a255530acb5e3 100644 (file)
 #ifndef _OSISLEEP_H_ENV_
 #define _OSISLEEP_H_ENV_ 1
 
+/*#include "osi.h"*/
 #include "osifd.h"
 #include "osiqueue.h"
+#ifdef DJGPP
+#include "osithrd95.h"
+#endif /* DJGPP */
 
 /* states bits */
 #define OSI_SLEEPINFO_SIGNALLED        1       /* this sleep structure has been signalled */
@@ -26,7 +30,7 @@ typedef struct osi_sleepInfo {
        osi_queue_t q;
        long value;             /* sleep value when in a sleep queue, patch addr for turnstiles */
        unsigned long tid;      /* thread ID of sleeper */
-       HANDLE sema;            /* semaphore for this entry */
+       EVENT_HANDLE sema;              /* semaphore for this entry */
        unsigned short states;  /* states bits */
        unsigned short idx;     /* sleep hash table we're in, if in hash */
         unsigned short waitFor;        /* what are we waiting for; used for bulk wakeups */
@@ -47,7 +51,11 @@ typedef struct osi_sleepFD{
 
 /* struct for single-shot initialization support */
 typedef struct osi_once {
+#ifndef DJGPP
        long atomic;    /* used for atomicity */
+#else
+       osi_mutex_t atomic;     /* used for atomicity */
+#endif /* !DJGPP */
        int done;       /* tells if initialization is done */
 } osi_once_t;
 
@@ -66,10 +74,10 @@ typedef struct osi_once {
  * holding this lock, so that locks don't get released while we're copying
  * out this info.
  */
-extern CRITICAL_SECTION osi_sleepCookieCS;
+extern Crit_Sec osi_sleepCookieCS;
 
 /* spin lock version of atomic sleep, used internally only */
-extern void osi_SleepSpin(long value, CRITICAL_SECTION *counterp);
+extern void osi_SleepSpin(long value, Crit_Sec *counterp);
 
 /* spin lock version of wakeup, used internally only */
 extern void osi_WakeupSpin(long value);
@@ -99,10 +107,13 @@ extern int osi_TestOnce(osi_once_t *);
  */
 extern void osi_EndOnce(osi_once_t *);
 
+
+#ifndef DJGPP
 /* exported function to wakeup those sleeping on a value */
 extern void osi_Wakeup (long);
 
 extern void osi_Init (void);
+#endif /* !DJGPP */
 
 /* create a ptr to a cookie */
 osi_sleepFD_t *osi_CreateSleepCookie(void);
@@ -115,7 +126,9 @@ int osi_NextSleepCookie(osi_sleepFD_t *);
 
 /* functions for the sleep FD implementation */
 extern long osi_SleepFDCreate(osi_fdType_t *, osi_fd_t **);
+#ifndef DJGPP
 extern long osi_SleepFDGetInfo(osi_fd_t *, osi_remGetInfoParms_t *);
+#endif
 extern long osi_SleepFDClose(osi_fd_t *);
 
 /* functions for getting hash sizes */
@@ -142,13 +155,13 @@ void osi_panic(char *, char *, long);
 unsigned long osi_Time(void);
 
 extern void osi_TWait(osi_turnstile_t *turnp, int waitFor, void *patchp,
-       CRITICAL_SECTION *releasep);
+       Crit_Sec *releasep);
 
 extern void osi_TSignal(osi_turnstile_t *turnp);
 
 extern void osi_TBroadcast(osi_turnstile_t *turnp);
 
-extern void osi_TSignalForMLs(osi_turnstile_t *turnp, int stillHaveReaders, CRITICAL_SECTION *csp);
+extern void osi_TSignalForMLs(osi_turnstile_t *turnp, int stillHaveReaders, Crit_Sec *csp);
 
 #define osi_TInit(t)   ((t)->firstp = (t)->lastp = 0)
 
index d713b9ed3cff7850698ab0bfacc305d5e836aaf1..2d2b450a4a87d17e9b9bff488b6cac698fdcf86e 100644 (file)
@@ -18,12 +18,64 @@ $(LIBFILE): $(LIBOBJS)
        $(LIBARCH)
 
 ############################################################################
+
 install: $(LIBFILE) lang
 
-lang ::
+install9x: install
+
+lang:: en_US ja_JP ko_KR zh_TW zh_CN pt_BR es_ES de_DE
+
+en_US:
+       $(CD) lang
+       $(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+ja_JP:
        $(CD) lang
-       for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile install
-       $(CD) ..
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+ko_KR:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+zh_CN:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+zh_TW:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+pt_BR:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+es_ES:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
+
+de_DE:
+       $(CD) lang
+       @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+    $(CD) ..
 
 clean::
+       $(DEL) $(LIBFILE)
+       $(CD) lang
+       if exist $(NTLANG) $(NTLANG) en_US $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) ja_JP $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) ko_KR $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) zh_CN $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) zh_TW $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) pt_BR $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) es_ES $(MAKECMD) /nologo /f NTMakefile clean
+       if exist $(NTLANG) $(NTLANG) de_DE $(MAKECMD) /nologo /f NTMakefile clean
+    $(CD) ..
+
 
index d03e9a4b1a3746be3e0ab5faac327f3783f3655f..7c8894c3ff3bf66c14ac32a88c7d237489263418 100644 (file)
@@ -66,4 +66,7 @@ $(LANGNAME)\event.h $(LANGNAME)\event.rc: $(LANGNAME)\event.mc
 ############################################################################
 install: $(INCFILES) $(DLLFILE)
 
+install9x: install
+
 clean::
+       $(DEL) $(INCFILES) $(DLLFILE)
\ No newline at end of file
index ed046ae4c035736db23156495336cfd01d47c9d4..b7f8138e7ba9be734e9e6522faf18383dfcd8b87 100644 (file)
@@ -18,14 +18,43 @@ if not exist "Media\Transarc AFS" mkdir "Media\Transarc AFS"
 if not exist "Registry Entries" mkdir "Registry Entries"
 if not exist "Script Files" mkdir "Script Files"
 if not exist "Setup Files" mkdir "Setup Files"
-
-if not exist "Setup Files\Uncompressed Files" mkdir "Setup Files\Uncompressed Files"
-if not exist "Setup Files\Uncompressed Files\Language Independent" mkdir "Setup Files\Uncompressed Files\Language Independent"
-if not exist "Setup Files\Uncompressed Files\Language Independent\OS Independent" mkdir "Setup Files\Uncompressed Files\Language Independent\OS Independent"
-if not exist "Setup Files\Compressed Files" mkdir "Setup Files\Compressed Files"
-if not exist "Setup Files\Compressed Files\Language Independent" mkdir "Setup Files\Compressed Files\Language Independent"
-if not exist "Setup Files\Compressed Files\Language Independent\OS Independent" mkdir "Setup Files\Compressed Files\Language Independent\OS Independent"
-
+\r
+set sub1=Uncompressed Files\r
+call :gencomp\r
+set sub1=Compressed Files\r
+call :gencomp\r
+goto shell\r
+\r
+:gencomp\r
+if not exist "Setup Files\%sub1%" mkdir "Setup Files\%sub1%"\r
+set sub2=Language Independent\r
+call :gencomp2\r
+set sub2=0009-English\r
+call :gencomp2\r
+set sub2=0007-German\r
+call :gencomp2\r
+set sub2=0011-Japanese\r
+call :gencomp2\r
+set sub2=0012-Korean\r
+call :gencomp2\r
+set sub2=0416-Portuguese (Brazilian)\r
+call :gencomp2\r
+set sub2=0404-Chinese (Taiwan)\r
+call :gencomp2\r
+set sub2=000a-Spanish\r
+call :gencomp2\r
+set sub2=0804-Chinese (PRC)\r
+call :gencomp2\r
+goto :eof\r
+\r
+:gencomp2\r
+rem echo ]%sub1%] ]%sub2%]\r
+if not exist "Setup Files\%sub1%\%sub2%" mkdir "Setup Files\%sub1%\%sub2%"
+if not exist "Setup Files\%sub1%\%sub2%\OS Independent" mkdir "Setup Files\%sub1%\%sub2%\OS Independent"
+if not exist "Setup Files\%sub1%\%sub2%\Intel 32" mkdir "Setup Files\%sub1%\%sub2%\Intel 32"
+goto :eof\r
+\r
+:shell\r
 if not exist "Shell Objects" mkdir "Shell Objects"
 if not exist "String Tables" mkdir "String Tables"
 if not exist "String Tables\0009-English" mkdir "String Tables\0009-English"
@@ -38,4 +67,4 @@ if not exist "String Tables\0416-Portuguese (Brazilian)" mkdir "String Tables\04
 if not exist "String Tables\000a-Spanish" mkdir "String Tables\000a-Spanish"
 if not exist "Text Substitutions" mkdir "Text Substitutions"
 
-
+:eof
\ No newline at end of file
index 8b31e9c9de3f9573f5670359473d09223eaa2524..79495238dbe55ab6122c0e8abd938f9039815ed4 100644 (file)
@@ -3,7 +3,7 @@
 ---FileGroup---=
 HKLM0=Software\TransarcCorporation\AFS Client\CurrentVersion
 HKLM1=Software\TransarcCorporation\AFS Client
-HKLM2=Software\TransarcCorporation\AFS Client\3.6
+HKLM2=Software\TransarcCorporation\AFS Client\1.0 4.01
 HKLM3=SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon
 HKCR0=CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}
 HKLM4=SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters
@@ -11,6 +11,7 @@ HKCR1=CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32
 HKLM5=SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider
 HKCR2=*\shellex\ContextMenuHandlers\AFS Client Shell Extension
 HKCR3=FOLDER\shellex\ContextMenuHandlers\AFS Client Shell Extension
+HKLM6=SYSTEM\CurrentControlSet\Services\NetBT\Parameters\r
 
 [Client:HKCR:*\shellex\ContextMenuHandlers\AFS Client Shell Extension]
 ---Comment---=
@@ -41,7 +42,7 @@ TypesSupported=N,7
 HKLM0=Software\TransarcCorporation\AFS Server\CurrentVersion
 HKLM1=System\CurrentControlSet\Services\EventLog\Application\AFS Service
 HKLM2=Software\TransarcCorporation\AFS Server
-HKLM3=Software\TransarcCorporation\AFS Server\3.6
+HKLM3=Software\TransarcCorporation\AFS Server\1.0 4.01
 
 [WinNT_Client_NoUninstall:HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\File Manager\AddOns]
 ---Comment---=
@@ -53,22 +54,22 @@ AFS Client FME=S,<TARGETDIR>\Client\Program\afs_fme.dll
 ---FileGroup---=
 HKLM0=Software\TransarcCorporation\AFS Control Center\CurrentVersion
 HKLM1=Software\TransarcCorporation\AFS Control Center
-HKLM2=Software\TransarcCorporation\AFS Control Center\3.6
+HKLM2=Software\TransarcCorporation\AFS Control Center\1.0 4.01
 
-[Client:HKLM:Software\TransarcCorporation\AFS Client\3.6]
-PatchLevel=N,0
-BetaLevel=N,0
+[Client:HKLM:Software\TransarcCorporation\AFS Client\1.0 4.01]
+PatchLevel=N,401
+BetaLevel=N,1
 Revision=N,0
 ---Comment---=
 (Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
 Title=S,<CLIENT_TITLE>
 InstallDateString=S,<INSTALL_DATE>
 PathName=S,<TARGETDIR>\Client
 Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
 ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
 Description=S,<CLIENT_DESC>
 
 [Client_NoUninstall]
@@ -85,19 +86,19 @@ HKLM0=SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved
 (Default)=S,
 Gateway=S,
 
-[Control_Center:HKLM:Software\TransarcCorporation\AFS Control Center\3.6]
-PatchLevel=N,0
-BetaLevel=N,0
+[Control_Center:HKLM:Software\TransarcCorporation\AFS Control Center\1.0 4.01]
+PatchLevel=N,401
+BetaLevel=N,1
 Revision=N,0
 ---Comment---=
 (Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
 InstallDateString=S,<INSTALL_DATE>
 PathName=S,<TARGETDIR>\Control Center
 Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
 ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
 Description=S,AFS Control Center for Windows NT
 
 [Client_NoUninstall:HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved]
@@ -110,18 +111,18 @@ Description=S,AFS Control Center for Windows NT
 (Default)=S,
 
 [Control_Center:HKLM:Software\TransarcCorporation\AFS Control Center\CurrentVersion]
-PatchLevel=N,0
-BetaLevel=N,0
+PatchLevel=N,401
+BetaLevel=N,1
 Revision=N,0
 ---Comment---=
 (Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
 InstallDateString=S,<INSTALL_DATE>
 PathName=S,<TARGETDIR>\Control Center
 Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
 ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
 Description=S,AFS Control Center for Windows NT
 
 [Light_Client]
@@ -143,7 +144,7 @@ IsGateway=N,0
 ---FileGroup---=
 HKLM0=Software\TransarcCorporation\AFS Supplemental Documentation\CurrentVersion
 HKLM1=Software\TransarcCorporation\AFS Supplemental Documentation
-HKLM2=Software\TransarcCorporation\AFS Supplemental Documentation\3.6
+HKLM2=Software\TransarcCorporation\AFS Supplemental Documentation\1.0 4.01
 
 [Data]
 Set0=Server
@@ -156,19 +157,19 @@ Set6=Full_Client
 Set7=Docs
 
 [Client:HKLM:Software\TransarcCorporation\AFS Client\CurrentVersion]
-PatchLevel=N,0
-BetaLevel=N,0
+PatchLevel=N,401
+BetaLevel=N,1
 Revision=N,0
 ---Comment---=
 (Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
 Title=S,<CLIENT_TITLE>
 InstallDateString=S,<INSTALL_DATE>
 PathName=S,<TARGETDIR>\Client
 Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
 ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
 Description=S,<CLIENT_DESC>
 
 [Full_Client]
@@ -177,33 +178,33 @@ Description=S,<CLIENT_DESC>
 HKLM0=SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters
 
 [Docs:HKLM:Software\TransarcCorporation\AFS Supplemental Documentation\CurrentVersion]
-PatchLevel=N,0
-BetaLevel=N,0
+PatchLevel=N,401
+BetaLevel=N,1
 Revision=N,0
 ---Comment---=
 (Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
 InstallDateString=S,<INSTALL_DATE>
 PathName=S,<TARGETDIR>\Documentation
 Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
 ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
 Description=S,AFS System Administration Documentation
 
-[Server:HKLM:Software\TransarcCorporation\AFS Server\3.6]
-PatchLevel=N,0
-BetaLevel=N,0
+[Server:HKLM:Software\TransarcCorporation\AFS Server\1.0 4.01]
+PatchLevel=N,401
+BetaLevel=N,1
 Revision=N,0
 ---Comment---=
 (Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
 InstallDateString=S,<INSTALL_DATE>
 PathName=S,<TARGETDIR>\Server
 Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
 ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
 Description=S,AFS Server for Windows NT
 
 [Client:HKLM:SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider]
@@ -228,19 +229,19 @@ AFS Client FME=S,<TARGETDIR>\Client\Program\afs_fme.dll
 ---FileGroup---=
 HKLM0=SOFTWARE\Microsoft\Windows NT\CurrentVersion\File Manager\AddOns
 
-[Docs:HKLM:Software\TransarcCorporation\AFS Supplemental Documentation\3.6]
-PatchLevel=N,0
-BetaLevel=N,0
+[Docs:HKLM:Software\TransarcCorporation\AFS Supplemental Documentation\1.0 4.01]
+PatchLevel=N,401
+BetaLevel=N,1
 Revision=N,0
 ---Comment---=
 (Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
 InstallDateString=S,<INSTALL_DATE>
 PathName=S,<TARGETDIR>\Documentation
 Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
 ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
 Description=S,AFS System Administration Documentation
 
 [General]
@@ -252,18 +253,18 @@ Version=1.00.000
 (Default)=S,{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}
 
 [Server:HKLM:Software\TransarcCorporation\AFS Server\CurrentVersion]
-PatchLevel=N,0
-BetaLevel=N,0
+PatchLevel=N,401
+BetaLevel=N,1
 Revision=N,0
 ---Comment---=
 (Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
 InstallDateString=S,<INSTALL_DATE>
 PathName=S,<TARGETDIR>\Server
 Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
 ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
 Description=S,AFS Server for Windows NT
 
 [Client:HKCR:CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}]
index ab12b9e4cd8295eff91570f3c0bf7c967375cc51..06b4fe2b1c106869c77e86256d8f71ff32c71577 100644 (file)
@@ -81,10 +81,7 @@ rem -------------- Client_System32_Files.fgl ---------------------------
 echo [TopDir] > Client_System32_Files.fgl
 echo file0=%IS5_DEST%\root.client\usr\vice\etc\afs_cpa.cpl >> Client_System32_Files.fgl
 echo file1=%MSVCDIR%\REDIST\Msvcrt.dll >> Client_System32_Files.fgl
-echo file2=%SYSTEMROOT%\system32\Msvcrtd.dll >> Client_System32_Files.fgl
-echo file3=%MSVCDIR%\REDIST\Mfc42.dll >> Client_System32_Files.fgl
-echo file4=%SYSTEMROOT%\system32\mfc42d.dll >> Client_System32_Files.fgl
-echo file5=%SYSTEMROOT%\system32\mfco42d.dll >> Client_System32_Files.fgl
+echo file2=%MSVCDIR%\REDIST\Mfc42.dll >> Client_System32_Files.fgl
 echo.  >> Client_System32_Files.fgl
 echo [General] >> Client_System32_Files.fgl
 echo Type=FILELIST >> Client_System32_Files.fgl
@@ -159,11 +156,8 @@ rem -------------- Light_Client_System32_Files.fgl ---------------------
 
 echo [TopDir] > Light_Client_System32_Files.fgl
 echo file0=%MSVCDIR%\REDIST\Msvcrt.dll >> Light_Client_System32_Files.fgl
-echo file1=%SYSTEMROOT%\system32\Msvcrtd.dll >> Light_Client_System32_Files.fgl
-echo file2=%MSVCDIR%\REDIST\Mfc42.dll >> Light_Client_System32_Files.fgl
-echo file3=%SYSTEMROOT%\system32\mfc42d.dll >> Light_Client_System32_Files.fgl
-echo file4=%SYSTEMROOT%\system32\mfco42d.dll >> Light_Client_System32_Files.fgl
-echo file5=%IS5_DEST%\root.client\usr\vice\etc\afs_cpa.cpl >> Light_Client_System32_Files.fgl
+echo file1=%MSVCDIR%\REDIST\Mfc42.dll >> Light_Client_System32_Files.fgl
+echo file2=%IS5_DEST%\root.client\usr\vice\etc\afs_cpa.cpl >> Light_Client_System32_Files.fgl
 echo.  >> Light_Client_System32_Files.fgl
 echo [General] >> Light_Client_System32_Files.fgl
 echo Type=FILELIST >> Light_Client_System32_Files.fgl
@@ -218,11 +212,8 @@ rem -------------- Light95_Client_System32_Files.fgl ---------------------
 
 echo [TopDir] > Light95_Client_System32_Files.fgl
 echo file0=%MSVCDIR%\REDIST\Msvcrt.dll >> Light95_Client_System32_Files.fgl
-echo file1=%SYSTEMROOT%\system32\Msvcrtd.dll >> Light95_Client_System32_Files.fgl
-echo file2=%MSVCDIR%\REDIST\Mfc42.dll >> Light95_Client_System32_Files.fgl
-echo file3=%SYSTEMROOT%\system32\mfc42d.dll >> Light95_Client_System32_Files.fgl
-echo file4=%SYSTEMROOT%\system32\mfco42d.dll >> Light95_Client_System32_Files.fgl
-echo file5=%IS5_DEST%\root.client\usr\vice\etc\afs_cpa.cpl >> Light95_Client_System32_Files.fgl
+echo file1=%MSVCDIR%\REDIST\Mfc42.dll >> Light95_Client_System32_Files.fgl
+echo file2=%IS5_DEST%\root.client\usr\vice\etc\afs_cpa.cpl >> Light95_Client_System32_Files.fgl
 echo.  >> Light95_Client_System32_Files.fgl
 echo [General] >> Light95_Client_System32_Files.fgl
 echo Type=FILELIST >> Light95_Client_System32_Files.fgl
@@ -290,7 +281,6 @@ rem -------------- Server_System32_Files.fgl ---------------------------
 echo [TopDir] > Server_System32_Files.fgl
 echo file0=%IS5_DEST%\root.server\usr\afs\bin\afsserver.cpl >> Server_System32_Files.fgl
 echo file1=%MSVCDIR%\REDIST\Msvcrt.dll >> Server_System32_Files.fgl
-echo file2=%SYSTEMROOT%\system32\Msvcrtd.dll >> Server_System32_Files.fgl
 echo.  >> Server_System32_Files.fgl
 echo [General] >> Server_System32_Files.fgl
 echo Type=FILELIST >> Server_System32_Files.fgl
@@ -346,7 +336,6 @@ rem -------------- Control_Center_System32_Files.fgl--------------------
 echo [TopDir] > Control_Center_System32_Files.fgl
 echo file0=%IS5_DEST%\root.client\usr\vice\etc\afs_cpa.cpl >> Control_Center_System32_Files.fgl
 echo file1=%MSVCDIR%\REDIST\Msvcrt.dll >> Control_Center_System32_Files.fgl
-echo file2=%SYSTEMROOT%\system32\Msvcrtd.dll >> Control_Center_System32_Files.fgl
 echo.  >> Control_Center_System32_Files.fgl
 echo [General] >> Control_Center_System32_Files.fgl
 echo Type=FILELIST >> Control_Center_System32_Files.fgl
@@ -373,12 +362,12 @@ call :Generate_Release_Notes_File_Group
 rem Trad_Chinese
 set FILEGROUP=Release_Notes_Trad_Chinese_Files.fgl
 set IS5_DOC=%IS5_DOCROOT%\install\Documentation\zh_TW
-call :Generate_Release_Notes_File_Group
-
-rem Simp_Chinese
-set FILEGROUP=Release_Notes_Simp_Chinese_Files.fgl
-set IS5_DOC=%IS5_DOCROOT%\install\Documentation\zh_CN
-call :Generate_Release_Notes_File_Group
+call :Generate_Release_Notes_File_Group\r
+\r
+rem Simp_Chinese\r
+set FILEGROUP=Release_Notes_Simp_Chinese_Files.fgl\r
+set IS5_DOC=%IS5_DOCROOT%\install\Documentation\zh_CN\r
+call :Generate_Release_Notes_File_Group\r
 
 rem German
 set FILEGROUP=Release_Notes_German_Files.fgl
@@ -428,8 +417,8 @@ rem -------------- Generate the Install Guide file groups ---------------
 
 rem English
 set FILEGROUP=Install_Guide_English_Files.fgl
-set IS5_DOC=%IS5_DOCROOT%\install\Documentation\en_US\Html
-call :Generate_Install_Guide_File_Group
+set IS5_DOC=%IS5_DOCROOT%\install\Documentation\en_US\Html\r
+call :Generate_Install_Guide_File_Group\r
 
 rem Japanese
 set FILEGROUP=Install_Guide_Japanese_Files.fgl
@@ -448,9 +437,9 @@ call :Generate_Install_Guide_File_Group
 
 rem Simp_Chinese
 set FILEGROUP=Install_Guide_Simp_Chinese_Files.fgl
-set IS5_DOC=%IS5_DOCROOT%\install\Documentation\zh_CN\Html
+set IS5_DOC=%IS5_DOCROOT%\install\Documentation\zh_CN\Html\r
 call :Generate_Install_Guide_File_Group
-
+\r
 rem German
 set FILEGROUP=Install_Guide_German_Files.fgl
 set IS5_DOC=%IS5_DOCROOT%\install\Documentation\de_DE\Html
@@ -465,10 +454,10 @@ rem Portuguese
 set FILEGROUP=Install_Guide_Portuguese_Files.fgl
 set IS5_DOC=%IS5_DOCROOT%\install\Documentation\pt_BR\Html
 call :Generate_Install_Guide_File_Group
-
+\r
 goto Sys_Admin_Guide_Files
 
-:Generate_Install_Guide_File_Group
+:Generate_Install_Guide_File_Group\r
 echo [TopDir] > %FILEGROUP%
 echo file0=%IS5_DOC%\InstallGd\awqbg000.htm >> %FILEGROUP%
 echo file1=%IS5_DOC%\InstallGd\awqbg002.htm >> %FILEGROUP%
@@ -932,21 +921,21 @@ set IS5_LANG=ko_KR
 set IS5_DOC=%IS5_DOCROOT%\install\Documentation\ko_KR\Html
 call :Generate_Doc_Misc_File_Group
 copy %AFSROOT%\src\WINNT\license\lang\%IS5_LANG%.rtf %AFSROOT%\src\WINNT\install\InstallShield5\lang\%IS5_LANG%\license.rtf
-
+\r
 rem Trad_Chinese
 set FILEGROUP=Doc_Misc_Trad_Chinese_Files.fgl
 set IS5_LANG=zh_TW
 set IS5_DOC=%IS5_DOCROOT%\install\Documentation\zh_TW\Html
 call :Generate_Doc_Misc_File_Group
-copy %AFSROOT%\src\WINNT\license\lang\%IS5_LANG%.rtf %AFSROOT%\src\WINNT\install\InstallShield5\lang\%IS5_LANG%\license.rtf
-
+copy %AFSROOT%\src\WINNT\license\lang\%IS5_LANG%.rtf %AFSROOT%\src\WINNT\install\InstallShield5\lang\%IS5_LANG%\license.rtf\r
+\r
 rem Simp_Chinese
 set FILEGROUP=Doc_Misc_Simp_Chinese_Files.fgl
 set IS5_LANG=zh_CN
 set IS5_DOC=%IS5_DOCROOT%\install\Documentation\zh_CN\Html
 call :Generate_Doc_Misc_File_Group
 copy %AFSROOT%\src\WINNT\license\lang\%IS5_LANG%.rtf %AFSROOT%\src\WINNT\install\InstallShield5\lang\%IS5_LANG%\license.rtf
-
+\r
 rem German
 set FILEGROUP=Doc_Misc_German_Files.fgl
 set IS5_LANG=de_DE
@@ -970,7 +959,7 @@ copy %AFSROOT%\src\WINNT\license\lang\%IS5_LANG%.rtf %AFSROOT%\src\WINNT\install
 
 goto Doc_Files
 
-:Generate_Doc_Misc_File_Group
+:Generate_Doc_Misc_File_Group\r
 echo [TopDir] > %FILEGROUP%
 echo file0=%IS5_DOC%\banner.gif >> %FILEGROUP%
 echo file1=%IS5_DOC%\books.gif >> %FILEGROUP%
@@ -1262,7 +1251,7 @@ echo file0=%IS5_INCL%\afs\afs_args.h >> Client_Afs_Header_Files.fgl
 echo file1=%IS5_INCL%\afs\debug.h >> Client_Afs_Header_Files.fgl
 echo file2=%IS5_INCL%\afs\param.h >> Client_Afs_Header_Files.fgl
 echo file3=%IS5_INCL%\afs\afs_sysnames.h >> Client_Afs_Header_Files.fgl
-echo file4=%IS5_INCL%\afs\bnode.h >> Client_Afs_Header_Files.fgl
+echo file4=%IS5_INCL%\afs\permit_xprt.h >> Client_Afs_Header_Files.fgl
 echo file5=%IS5_INCL%\afs\stds.h >> Client_Afs_Header_Files.fgl
 echo file6=%IS5_INCL%\afs\icl.h >> Client_Afs_Header_Files.fgl
 echo file7=%IS5_INCL%\afs\procmgmt.h >> Client_Afs_Header_Files.fgl
@@ -1349,6 +1338,7 @@ echo file87=%IS5_INCL%\afs\volser.h >> Client_Afs_Header_Files.fgl
 echo file88=%IS5_INCL%\afs\volint.h >> Client_Afs_Header_Files.fgl
 echo file89=%IS5_INCL%\afs\fs_stats.h >> Client_Afs_Header_Files.fgl
 echo file90=%IS5_INCL%\afs\bosint.h >> Client_Afs_Header_Files.fgl
+echo file91=%IS5_INCL%\afs\bnode.h >> Client_Afs_Header_Files.fgl
 echo. >> Client_Afs_Header_Files.fgl
 echo [General] >> Client_Afs_Header_Files.fgl
 echo Type=FILELIST >> Client_Afs_Header_Files.fgl
@@ -1425,3 +1415,4 @@ echo [General] >> Client_Sample_Files.fgl
 echo Type=FILELIST >> Client_Sample_Files.fgl
 echo Version=1.00.000 >> Client_Sample_Files.fgl
 
+:EOF\r
index db7f8f3abd991f8b3ebebf248a7f0b7bfb2e2fc4..c679e5ad7776d45b92a279ea7895414c507e6845 100644 (file)
@@ -22,9 +22,16 @@ prep: $(CELLSERVDB) AFS_component_version_number.txt
     CompileScript.bat
 
 build:
-    BuildSetup.bat
-    xcopy/s/e "Media\Transarc AFS\Disk Images\disk1\*.*" $(DESTDIR)\WinInstall
-    copy AFS_component_version_number.txt $(DESTDIR)\WinInstall\Version.txt
-    del /q "Media\Transarc AFS\Disk Images\disk1\*.*"
+    BuildSetup.bat\r
+    xcopy/s/e/y "Media\Transarc AFS\Disk Images\disk1\*.*" $(DESTDIR)\WinInstall
+    copy AFS_component_version_number.txt $(DESTDIR)\WinInstall\Version.txt\r
+    $(DEL) /q "Media\Transarc AFS\Disk Images\disk1\*.*"
+!IF ((EXIST("$(ISWEB)")) &&("$(ISWEB)"!=""))\r
+!      IF (!EXIST($(DESTDIR)\Wininstall\PackageWeb))
+               $(MKDIR) $(DESTDIR)\Wininstall\PackageWeb
+!      ENDIF
+       $(DEL) /q $(DESTDIR)\Wininstall\PackageWeb\*.*\r
+       $(ISWEB)\Pftwwiz.exe $(AFSROOT)\src\winnt\install\InstallShield5\PackageWeb.pfw -s -a \r
+!ENDIF\r
 
 install: prep build
index a088d556ca352855fbc44aa46b65900b0651bb65..65364751dac87de46e7394f8f31b2361e486bbaa 100644 (file)
@@ -1,5 +1,3 @@
-# This file must change to specify a cell.
-# The "511.01.01.01" represents an IP address.
 >PutCellNameHere              # CellName Comment
 511.01.01.01                   #DBServerMachineName1
 511.02.02.02                   #DBServerMachineName2
index 1fbc3fd404d29d9d0e614d6c40d18e2f68e2e6cc..aab0f0f60beb0045c735605f6f6116724a7c8b4b 100644 (file)
@@ -3,34 +3,34 @@ DEFAULT_INSTALL_DIR=IBM\AFS
 NOTHING_SELECTED_MSG=You must select something to install before continuing.
 DOWNGRADE_LIGHT_CLIENT_MSG=Downgrade AFS Light Client
 SETUP_FINISHED_MSG=Setup has finished installing AFS® for Windows on your computer.
-TITLE_MAIN=AFS® for Windows 3.6
-SEVERE_DIALOG_TITLE=AFS® for Windows
+TITLE_MAIN=Open AFS for Windows 1.0 4.01
+SEVERE_DIALOG_TITLE=Open AFS for Windows
 UPGRADE_CLIENT_MSG=Upgrade AFS Client
-PRODUCT_VERSION_MINOR=6
+PRODUCT_VERSION_MINOR=0
 CONFIGURING_AFS_CLIENT_SERVICE=Configuring the AFS Client service
 PRODUCT_NAME_CC=AFS Control Center
 PRODUCT_NAME_SERVER=AFS Server
 UPGRADE_CC_MSG=Upgrade AFS Control Center
 DOWNGRADE_SERVER_MSG=Downgrade AFS Server
-UNINST_DISPLAY_NAME_LIGHT_CLIENT=AFS Light 3.6
+UNINST_DISPLAY_NAME_LIGHT_CLIENT=AFS Light 1.0 4.01
 PRODUCT_NAME_LIGHT_CLIENT=AFS Light
 ERROR_COMPONENT=Component:
 COMPANY_NAME=TransarcCorporation
 REINSTALL_CLIENT_MSG=Reinstall AFS Client
 DOWNGRADE_CC_MSG=Downgrade AFS Control Center
-UNINST_DISPLAY_NAME_DOCS=AFS Supplemental Documentation 3.6
+UNINST_DISPLAY_NAME_DOCS=AFS Supplemental Documentation 1.0 4.01
 UNINST_KEY_SERVER=AFS Server
 VIEW_README_PROMPT_MSG=View the readme file
 INSTALL_LIGHT_CLIENT_MSG=AFS Light Client
-PRODUCT_VERSION_TITLE=3.6
-UNINST_DISPLAY_NAME_CC=AFS Control Center 3.6
+PRODUCT_VERSION_TITLE=1.0 4.01
+UNINST_DISPLAY_NAME_CC=AFS Control Center 1.0 4.01
 ERROR_FILEGROUP=File Group:
 ERROR_MOVEDATA=An error occurred during the move data process: %d
 CONFIGURING_AFS_SERVER_SERVICE=Configuring the AFS Server service
 CLIENT_DESC=AFS Client
 SET_NETWORK_PROVIDER_ERROR=Unable to configure the AFS Client as a Network Provider.
-PRODUCT_VERSION_MAJOR=3
-UNINST_DISPLAY_NAME_SERVER=AFS Server 3.6
+PRODUCT_VERSION_MAJOR=1
+UNINST_DISPLAY_NAME_SERVER=AFS Server 1.0 4.01
 SETUPUTILS_NOT_FOUND=The file InstallUtils.dll could not be loaded.  Setup cannot continue.
 LIGHT_CLIENT_ALREADY_INSTALLED_MSG=AFS Light is already installed on this computer.
 SETUP_TYPE_MSG=Select the AFS® for Windows products that you wish to install:
@@ -68,13 +68,13 @@ UNINST_KEY_CC=AFS Control Center
 UNINST_KEY_CLIENT=AFS Client
 UPGRADE_DOCS_MSG=Upgrade AFS Supplemental Documentation
 DOWNGRADE_PREP_MSG=Preparing to downgrade the %s.  Please wait...this may be a lengthy process.
-PRODUCT_VERSION_PATCH_LEVEL=0
+PRODUCT_VERSION_PATCH_LEVEL=401
 NON_UPGRADABLE_SOFTWARE_INSTALLED_ERROR_MSG=Non-upgradable versions of this product are installed on your computer.  These \nversions must be uninstalled before the current versions can be installed.
 CANT_INSTALL_BOTH_CLIENTS_MSG=Please select only one of the AFS Clients to install.  You cannot install both.
 UNINST_KEY_LIGHT_CLIENT=AFS Light
 UPGRADE_LIGHT_CLIENT_MSG=Upgrade AFS Light Client
 UNINST_KEY_DOCS=AFS Supplemental Documentation
-UNINST_DISPLAY_NAME_CLIENT=AFS Client 3.6
+UNINST_DISPLAY_NAME_CLIENT=AFS Client 1.0 4.01
 REINSTALL_DOCS_MSG=Reinstall AFS Supplemental Documentation
 UPGRADE_PREP_MSG=Preparing to upgrade the %s.  Please wait...this may be a lengthy process.
 MUST_BE_AN_ADMIN_MSG=You must be a member of the local Administrators group on this Windows system in order to install this product.
index 6cefd61a1af7bf4041f9ae414b321c98d9657093..eba949add63a8d64effded3ebce87cddbea2ff38 100644 (file)
Binary files a/src/WINNT/install/InstallShield5/setup.bmp and b/src/WINNT/install/InstallShield5/setup.bmp differ
index a9a6b45af65238d633b616d110dd6678a9078ed2..6c4472191b16c3d2fbe17372e8503d779538b043 100644 (file)
@@ -1,6 +1,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-// Copyright (C) 1998  Transarc Corporation.
+// Copyright (C) 1998  OpenAFS
 // All rights reserved.
 //
 //
@@ -16,6 +16,7 @@
     #include "sdlang.h"
     #include "sddialog.h"
 
+
 ////////////////////// string defines ////////////////////////////
 
        // If the user places a file with this name in the same directory as
@@ -2056,12 +2057,16 @@ end;
 ///////////////////////////////////////////////////////////////////////////////
 function AddPath(szPath)
 begin
-    LongPathToShortPath(szPath);
-
-    if (AddToPath(szPath) < 0) then
-        ShowError(@ADD_PATH_ERROR, WARNING);
+   LongPathToShortPath(szPath);
+   if (bWin98 || bWin95) then
+          if (EzBatchAddPath ("Path", szPath, "", AFTER) < 0) then
+                ShowError(@ADD_PATH_ERROR, WARNING);
+           endif;
+    else
+          if (AddToPath(szPath) < 0) then
+                ShowError(@ADD_PATH_ERROR, WARNING);
+           endif;
     endif;
-
        return 0;
 end;
 
@@ -2736,3 +2741,5 @@ end;
 
 
 
+
+
index 6473cae0e7eab2d850d354319689591a8de25342..2efcf2de2968ece50837c37aca19b59b24e9667c 100644 (file)
Binary files a/src/WINNT/license/lang/en_US.ide and b/src/WINNT/license/lang/en_US.ide differ
index 6ae0b8ea0ab16847ef917151b42d9ec2e611af39..fc2aa88f0cf296c08475b404b3b26e958f45df68 100644 (file)
@@ -44,11 +44,15 @@ $(PTHR95_DLLFILE): $(PTHR95_DLLOBJS)
 pthread_95.obj: pthread.c
        $(C2OBJ) pthread.c -DAFS_WIN95_ENV /Fopthread_95.obj
 
-
-install: $(PTHR_DLLFILE) $(PTHR95_DLLFILE) $(LIBINCLUDES)
+install: $(PTHR95_DLLFILE) $(PTHR_DLLFILE) $(LIBINCLUDES)
+\r
+install9x: install\r
 
 pthread.res: pthread.rc AFS_component_version_number.h
        $(RC) $*.rc
 
 pthread95.res: pthread95.rc AFS_component_version_number.h
        $(RC) $*.rc
+
+clean::
+       $(DEL) /q $(DESTDIR)\lib\win95\*.*
index f0e178b00f1e29f8902fbf19e94ef7ca70113ad3..155629d6d7866a5f67b646f557d53de5ade636ce 100644 (file)
@@ -35,6 +35,11 @@ LIBFILE = $(DESTDIR)\lib\afs\talocale.lib
 
 install: $(LIBINCLUDES) $(LIBFILE)
 
+install9x: install
+
 $(LIBFILE): $(LIBOBJS)
        $(LIBARCH)
 
+
+clean::
+       $(DEL) $(LIBINCLUDES)
index 18e0a5aa71c1f0707b9a153ab028ce184ed07548..73d20fc57abe703504da13af305a23d7f1460ba3 100644 (file)
@@ -10,7 +10,7 @@
 /*
  * SGI specific vnodeops + other misc interface glue
  */
-#ident "$Revision: 1.1.1.3 $"
+#ident "$Revision: 1.1.1.4 $"
 
 #include "../afs/param.h"      /* Should be always first */
 #ifdef AFS_SGI62_ENV
index 760e8a5334d43322a810873fa292c73aeb80183d..3cc273af9d6cf41b602ca18a5b7ddaefc6389e99 100644 (file)
@@ -159,7 +159,7 @@ asmlinkage int afs_xsetgroups32(int gidsetsize, gid_t *grouplist)
 }
 #endif
 #if defined(AFS_SPARC64_LINUX20_ENV)
-asmlinkage int afs_xsetgroups32(int gidsetsize, __kernel_gid_t32 *grouplist)
+asmlinkage int afs32_xsetgroups(int gidsetsize, __kernel_gid_t32 *grouplist)
 {
     gid_t gl[NGROUPS];
     int ret, i;
@@ -175,6 +175,24 @@ asmlinkage int afs_xsetgroups32(int gidsetsize, __kernel_gid_t32 *grouplist)
     set_fs (old_fs);
     return ret;
 }
+#ifdef AFS_LINUX24_ENV
+asmlinkage int afs32_xsetgroups32(int gidsetsize, __kernel_gid_t32 *grouplist)
+{
+    gid_t gl[NGROUPS];
+    int ret, i;
+    mm_segment_t old_fs = get_fs ();
+
+    if ((unsigned) gidsetsize > NGROUPS)
+       return -EINVAL;
+    for (i = 0; i < gidsetsize; i++, grouplist++)
+       if (__get_user (gl[i], grouplist))
+           return -EFAULT;
+    set_fs (KERNEL_DS);
+    ret = afs_xsetgroups32(gidsetsize, gl);
+    set_fs (old_fs);
+    return ret;
+}
+#endif
 #endif
 
 static int afs_setgroups(cred_t **cr, int ngroups, gid_t *gidset, int change_parent)
index efc6126af6309acd57f38b7a743a2aa1fe3deafb..063159a0f24af2a8b19f157288c902ae4c97ddc4 100644 (file)
@@ -72,4 +72,4 @@ install install.noversion: kinstall ukinstall
        esac
 
 clean:
-       echo Nothing to delete.
+       rm -f *.o core AFS_component_version_number.c afs_trace.h afs_trace.msf afszcm.cat
index a16dea180449f4083fc8e4c333ac4eb8bc5fdbde..032d50ecb91751c3121676b367a365e16e1df82f 100644 (file)
@@ -49,6 +49,7 @@ int afs_mount(struct vfs *afsp, struct vnode *amvp, struct mounta *uap,
     afsp->vfs_bsize = 8192;
     afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */
     afsp->vfs_fsid.val[1] = AFS_VFSFSID; 
+    afsp->vfs_dev = AFS_VFSMAGIC;
 
     AFS_GUNLOCK();
     return 0;
index 2d93e7c88adab169115d6ebccaae94e72012519c..cea99e629c3df37d641a8c22f7790feee30b52d1 100644 (file)
@@ -637,7 +637,7 @@ struct usr_vnode **compvpp;
     struct usr_inode *ip;
     struct usr_vnode *vp;
 
-    usr_assert(followlink == 0);
+    /*usr_assert(followlink == 0);*/
     usr_assert(dirvpp == NULL);
 
     /*
@@ -645,7 +645,7 @@ struct usr_vnode **compvpp;
      */
     if (*fnamep != '/' || uafs_afsPathName(fnamep) != NULL) {
        AFS_GLOCK();
-       code = uafs_LookupName(fnamep, afs_CurrentDir, compvpp, 0);
+       code = uafs_LookupName(fnamep, afs_CurrentDir, compvpp, 0, 0);
        AFS_GUNLOCK();
        return code;
     }
@@ -2174,7 +2174,8 @@ int uafs_LookupName(
     char *path,
     struct usr_vnode *parentVp,
     struct usr_vnode **vpp,
-    int follow)
+    int follow,
+    int no_eval_mtpt)
 {
     int code;
     int linkCount;
@@ -2251,7 +2252,14 @@ int uafs_LookupName(
             * subdirectory since we hold the global lock
             */
            nextVp = NULL;
-           code = afs_lookup(vp, pathP, &nextVp, u.u_cred);
+#ifdef AFS_WEB_ENHANCEMENTS
+            if ((nextPathP != NULL && *nextPathP != '\0') || !no_eval_mtpt)
+              code = afs_lookup(vp, pathP, &nextVp, u.u_cred, 0);
+            else
+              code = afs_lookup(vp, pathP, &nextVp, u.u_cred, AFS_LOOKUP_NOEVAL);
+#else
+            code = afs_lookup(vp, pathP, &nextVp, u.u_cred, 0);
+#endif /* AFS_WEB_ENHANCEMENTS */
            if (code != 0) {
                VN_RELE(vp);
                afs_osi_Free(tmpPath, strlen(path)+1);
@@ -2353,7 +2361,7 @@ int uafs_LookupLink(
     /*
      * Find the target of the symbolic link
      */
-    code = uafs_LookupName(pathP, parentVp, &linkVp, 1);
+    code = uafs_LookupName(pathP, parentVp, &linkVp, 1, 0);
     if (code) {
        afs_osi_Free(pathP, MAX_OSI_PATH+1);
        return code;
@@ -2417,7 +2425,7 @@ int uafs_LookupParent(
     /*
      * look up the parent
      */
-    code = uafs_LookupName(pathP, afs_CurrentDir, &parentP, 1);
+    code = uafs_LookupName(pathP, afs_CurrentDir, &parentP, 1, 0);
     afs_osi_Free(pathP, len);
     if (code != 0) {
        return code;
@@ -2471,7 +2479,7 @@ int uafs_chdir_r(
     int code;
     struct vnode *dirP;
 
-    code = uafs_LookupName(path, afs_CurrentDir, &dirP, 1);
+    code = uafs_LookupName(path, afs_CurrentDir, &dirP, 1, 0);
     if (code != 0) {
        errno = code;
        return -1;
@@ -2661,7 +2669,7 @@ int uafs_open_r(
            }
        } else {
            fileP = NULL;
-           code = uafs_LookupName(nameP, dirP, &fileP, 1);
+           code = uafs_LookupName(nameP, dirP, &fileP, 1, 0);
            VN_RELE(dirP);
            if (code != 0) {
                errno = code;
@@ -2678,6 +2686,7 @@ int uafs_open_r(
            if (flags & (O_WRONLY|O_RDWR)) {
                fileMode |= VWRITE;
            }
+           if (!fileMode) fileMode = VREAD;  /* since O_RDONLY is 0 */
            code = afs_access(fileP, fileMode, u.u_cred);
            if (code != 0) {
                VN_RELE(fileP);
@@ -2973,7 +2982,7 @@ int uafs_stat_r(
     int code;
     struct vnode *vp;
 
-    code = uafs_LookupName(path, afs_CurrentDir, &vp, 1);
+    code = uafs_LookupName(path, afs_CurrentDir, &vp, 1, 0);
     if (code != 0) {
        errno = code;
        return -1;
@@ -3008,7 +3017,7 @@ int uafs_lstat_r(
     int code;
     struct vnode *vp;
 
-    code = uafs_LookupName(path, afs_CurrentDir, &vp, 0);
+    code = uafs_LookupName(path, afs_CurrentDir, &vp, 0, 0);
     if (code != 0) {
        errno = code;
        return -1;
@@ -3079,7 +3088,7 @@ int uafs_chmod_r(
     struct vnode *vp;
     struct usr_vattr attrs;
 
-    code = uafs_LookupName(path, afs_CurrentDir, &vp, 1);
+    code = uafs_LookupName(path, afs_CurrentDir, &vp, 1, 0);
     if (code != 0) {
        errno = code;
        return -1;
@@ -3154,7 +3163,7 @@ int uafs_truncate_r(
     struct vnode *vp;
     struct usr_vattr attrs;
 
-    code = uafs_LookupName(path, afs_CurrentDir, &vp, 1);
+    code = uafs_LookupName(path, afs_CurrentDir, &vp, 1, 0);
     if (code != 0) {
        errno = code;
        return -1;
@@ -3366,7 +3375,7 @@ int uafs_link_r(
     /*
      * Look up the existing node.
      */
-    code = uafs_LookupName(existing, afs_CurrentDir, &existP, 1);
+    code = uafs_LookupName(existing, afs_CurrentDir, &existP, 1, 0);
     if (code != 0) {
        errno = code;
        return -1;
@@ -3507,7 +3516,7 @@ int uafs_readlink_r(
     struct usr_uio uio;
     struct iovec iov[1];
 
-    code = uafs_LookupName(path, afs_CurrentDir, &vp, 0);
+    code = uafs_LookupName(path, afs_CurrentDir, &vp, 0, 0);
     if (code != 0) {
        errno = code;
        return -1;
@@ -3807,6 +3816,7 @@ usr_DIR *uafs_opendir_r(
     char *path)
 {
     usr_DIR *dirp;
+    struct usr_vnode *fileP;
     int fd;
 
     /*
@@ -3817,6 +3827,17 @@ usr_DIR *uafs_opendir_r(
        return NULL;
     }
 
+    fileP = afs_FileTable[fd];
+    if (fileP == NULL) {
+     return NULL;
+    }
+
+    if (fileP->v_type != VDIR) {
+      uafs_close_r(fd);
+      errno = ENOTDIR;
+      return NULL;
+    }
+
     /*
      * Set up the directory structures
      */
@@ -4107,4 +4128,186 @@ char *uafs_afsPathName(char *path)
     return NULL;
 }
 
+#ifdef AFS_WEB_ENHANCEMENTS
+/*
+ * uafs_klog_nopag
+ * klog but don't allocate a new pag
+ */
+int uafs_klog_nopag(
+    char *user,
+    char *cell,
+    char *passwd,
+    char **reason)
+{
+    int code;
+    afs_int32 password_expires = -1;
+
+    usr_mutex_lock(&osi_authenticate_lock);
+    code = ka_UserAuthenticateGeneral(
+      KA_USERAUTH_VERSION  /*+KA_USERAUTH_DOSETPAG2*/, user,
+          NULL, cell, passwd, 0, &password_expires,
+          0, reason);
+    usr_mutex_unlock(&osi_authenticate_lock);
+    return code;
+}
+
+/*
+ * uafs_getcellstatus
+ * get the cell status
+ */
+int uafs_getcellstatus(char *cell, afs_int32 *status)
+{
+  int rc;
+  struct afs_ioctl iob;
+
+  iob.in = cell;
+  iob.in_size = strlen(cell)+1;
+  iob.out = 0;
+  iob.out_size = 0;
+
+  rc = call_syscall(AFSCALL_PIOCTL, /*path*/0, _VICEIOCTL(35),
+                      (long)&iob, 0, 0);
+
+  if (rc < 0) {
+    errno = rc;
+    return -1;
+  }
+
+  *status = iob.out;
+  return 0;
+}
+
+/*
+ * uafs_getvolquota
+ * Get quota of volume associated with path
+ */
+int uafs_getvolquota(char *path, afs_int32 *BlocksInUse, afs_int32 *MaxQuota)
+{
+  int rc;
+  struct afs_ioctl iob;
+  VolumeStatus *status;
+  char buf[1024];
+
+  iob.in = 0;
+  iob.in_size = 0;
+  iob.out = buf;
+  iob.out_size = 1024;
+
+  rc = call_syscall(AFSCALL_PIOCTL, path, _VICEIOCTL(4),
+                      (long)&iob, 0, 0);
+
+  if (rc != 0) {
+    errno = rc;
+    return -1;
+  }
+
+  status = (VolumeStatus *) buf;
+  *BlocksInUse = status->BlocksInUse;
+  *MaxQuota = status->MaxQuota;
+  return 0;
+}
+
+/*
+ * uafs_setvolquota
+ * Set quota of volume associated with path
+ */
+int uafs_setvolquota(char *path, afs_int32 MaxQuota)
+{
+  int rc;
+  struct afs_ioctl iob;
+  VolumeStatus *status;
+  char buf[1024];
+
+  iob.in = buf;
+  iob.in_size = 1024;
+  iob.out = 0;
+  iob.out_size = 0;
+
+  memset(buf, 0, sizeof(VolumeStatus));
+  status = (VolumeStatus *) buf;
+  status->MaxQuota = MaxQuota;
+  status->MinQuota = -1;
+
+  rc = call_syscall(AFSCALL_PIOCTL, path, _VICEIOCTL(5),
+                      (long)&iob, 0, 0);
+
+  if (rc != 0) {
+    errno = rc;
+    return -1;
+  }
+
+  return 0;
+}
+
+/*
+ * uafs_statmountpoint
+ * Determine whether a dir. is a mount point or not
+ * return 1 if mount point, 0 if not
+ */
+int uafs_statmountpoint(char *path)
+{
+    int retval;
+    int code;
+    char buf[256];
+
+    AFS_GLOCK();
+    retval = uafs_statmountpoint_r(path);
+    AFS_GUNLOCK();
+    return retval;
+}
+
+int uafs_statmountpoint_r(char *path)
+{
+    int code;
+    struct vnode *vp;
+    struct vcache *avc;
+    struct vrequest treq;
+    int r;
+
+    code = uafs_LookupName(path, afs_CurrentDir, &vp, 0, 1);
+    if (code != 0) {
+     errno = code;
+     return -1;
+    }
+
+    avc = (struct vcache *) vp;
+
+    r = avc->mvstat;
+    VN_RELE(vp);
+    return r;
+}
+
+/*
+ * uafs_getRights
+ * Get a list of rights for the current user on path.
+ */
+int uafs_getRights(char *path)
+{
+    int code, rc;
+    struct vnode *vp;
+    int afs_rights;
+
+    AFS_GLOCK();
+    code = uafs_LookupName(path, afs_CurrentDir, &vp, 1, 0);
+    if (code != 0) {
+     errno = code;
+     AFS_GUNLOCK();
+     return -1;
+    }
+
+    afs_rights = PRSFS_READ |
+      PRSFS_WRITE |
+      PRSFS_INSERT |
+      PRSFS_LOOKUP |
+      PRSFS_DELETE |
+      PRSFS_LOCK |
+      PRSFS_ADMINISTER;
+
+    afs_rights = afs_getRights (vp, afs_rights, u.u_cred);
+
+    AFS_GUNLOCK();
+    return afs_rights;
+}
+#endif /* AFS_WEB_ENHANCEMENTS */
+
 #endif /* UKERNEL */
index 97923964c7205ee11664f5014ee761bf61e48d2f..0ef5fe6e420b57f4a3a77e9788b0c384b8c161e5 100644 (file)
@@ -74,7 +74,8 @@ extern void uafs_RxServerProc(void);
 extern int uafs_LookupLink(struct usr_vnode *vp, struct usr_vnode *parentP,
                           struct usr_vnode **vpp);
 extern int uafs_LookupName(char *path, struct usr_vnode *parentP,
-                          struct usr_vnode **vpp, int follow);
+                          struct usr_vnode **vpp, int follow,
+                           int no_eval_mtpt);
 extern int uafs_LookupParent(char *path, struct usr_vnode **vpp);
 extern int uafs_GetAttr(struct usr_vnode *vp, struct stat *stats);
 
index 2b4de1a2720e200e868a968a6d0bc6736377ac07..2c3f6af9ced14e38a714bbdec6ac860d153d1841 100644 (file)
@@ -273,3 +273,28 @@ afs_access(OSI_VC_ARG(avc), amode, acred)
     }
 }
 
+#if defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS)
+/*
+ * afs_getRights
+ * This function is just an interface to afs_GetAccessBits
+ */
+int afs_getRights(OSI_VC_ARG(avc), arights, acred)
+    OSI_VC_DECL(avc);
+    register afs_int32 arights;
+    struct AFS_UCRED *acred;
+{
+    register afs_int32 code;
+    struct vrequest treq;
+    OSI_VC_CONVERT(avc)
+
+    if (code = afs_InitReq(&treq, acred)) return code;
+
+    code = afs_VerifyVCache(avc, &treq);
+    if (code) {
+      code = afs_CheckCode(code, &treq, 16);
+      return code; 
+    }
+
+    return afs_GetAccessBits(avc, arights, &treq);
+}
+#endif /* defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS) */
index 311f2161f8d4969ada61f053fe258edabae7d7c7..eb9c218fb4a92ac555a06787d4627098f8df192a 100644 (file)
@@ -128,14 +128,14 @@ afs_CopyOutAttrs(avc, attrs)
      * Below return 0 (and not 1) blocks if the file is zero length. This conforms
      * better with the other filesystems that do return 0.     
      */
-#ifdef AFS_OSF_ENV
+#if   defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
 #ifdef va_size_rsv
     attrs->va_size_rsv = 0;
 #endif
 /* XXX do this */
 /*    attrs->va_gen = avc->m.DataVersion;*/
     attrs->va_flags = 0;
-#endif /* AFS_OSF_ENV */
+#endif /* AFS_OSF_ENV || AFS_DARWIN_ENV */
 
 #if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 #if !defined(AFS_HPUX_ENV)
index b8deaf20102ea2d116a9da13aad19e091f7acdca..0d42f5779fc77b5cd5216746ce01aa2cf3c5625f 100644 (file)
@@ -177,6 +177,9 @@ tagain:
                if ((amode & VWRITE) || len != 0xffffffff) 
 #endif
                  {
+                   /* needed for write access check */
+                   tvc->parentVnode = adp->fid.Fid.Vnode;
+                   tvc->parentUnique = adp->fid.Fid.Unique;
                    /* need write mode for these guys */
                    if (!afs_AccessOK(tvc, PRSFS_WRITE, &treq, CHECK_MODE_BITS)) {
                        afs_PutVCache(tvc, READ_LOCK);
index 35375b51162c7498d75ba0ffc82fd84efdcc1e7e..43869f77dda61800f9973d6082e9eaed0524fd82 100644 (file)
@@ -23,7 +23,7 @@
 #if    defined(AFS_HPUX102_ENV)
 #define AFS_FLOCK      k_flock
 #else
-#if    defined(AFS_SUN56_ENV)
+#if    defined(AFS_SUN56_ENV) || defined(AFS_LINUX24_ENV)
 #define AFS_FLOCK       flock64
 #else
 #define AFS_FLOCK      flock
@@ -534,11 +534,16 @@ struct AFS_UCRED *acred; {
           with it in.  However, they fail in race conditions.  The question is
           what to do for people who don't have source to their application;
           this way at least, they can get work done */
+#ifdef AFS_LINUX24_ENV
+       if (af->l_len == OFFSET_MAX)
+          af->l_len = 0;      /* since some systems indicate it as EOF */
+#else
        if (af->l_len == 0x7fffffff)
            af->l_len = 0;      /* since some systems indicate it as EOF */
 #ifdef AFS_LINUX_64BIT_KERNEL
        if (af->l_len == LONG_MAX)
            af->l_len = 0;      /* since some systems indicate it as EOF */
+#endif
 #endif
        /* next line makes byte range locks always succeed,
           even when they should block */
index 2b271e1b56643f16501e1a7b8a729ee169128828..f1a0f0cf8865b4453a6bba85f11e37bbfc2a3a28 100644 (file)
 afs_rwlock_t afs_xcell;                        /* allocation lock for cells */
 struct afs_q CellLRU;
 afs_int32 afs_cellindex=0;
+afs_uint32 afs_nextCellNum = 0x100;
 
 
 /* Local variables. */
 struct cell *afs_rootcell = 0;
 
-struct cell *afs_GetCellByName(acellName, locktype)
+static char afs_AfsdbHandlerWait;
+static char afs_AfsdbLookupWait;
+
+char afs_AfsdbHandlerPresent = 0;
+char afs_AfsdbHandlerInuse = 0;
+
+char *afs_AfsdbHandler_CellName;
+afs_int32 *afs_AfsdbHandler_CellHosts;
+int *afs_AfsdbHandler_Timeout;
+
+char afs_AfsdbHandler_ReqPending;
+char afs_AfsdbHandler_Completed;
+
+
+struct cell *afs_GetCellByName_int();
+
+int afs_strcasecmp(s1, s2)
+    register char *s1, *s2;
+{
+    while (*s1 && *s2) {
+       register char c1, c2;
+
+       c1 = *s1++;
+       c2 = *s2++;
+       if (c1 >= 'A' && c1 <= 'Z') c1 += 0x20;
+       if (c2 >= 'A' && c2 <= 'Z') c2 += 0x20;
+       if (c1 != c2)
+           return c1-c2;
+    }
+
+    return *s1 - *s2;
+}
+
+
+#ifdef AFS_AFSDB_ENV
+int afs_AfsdbHandler(acellName, acellNameLen, kernelMsg)
+    char *acellName;
+    int acellNameLen;
+    afs_int32 *kernelMsg;
+{
+    /* afs_syscall_call() has already grabbed the global lock */
+
+    afs_AfsdbHandlerPresent = 1;
+
+    if (afs_AfsdbHandler_ReqPending) {
+       int i, hostCount;
+
+       hostCount = kernelMsg[0];
+       *afs_AfsdbHandler_Timeout = kernelMsg[1];
+       if (*afs_AfsdbHandler_Timeout) *afs_AfsdbHandler_Timeout += osi_Time();
+
+       for (i=0; i<MAXCELLHOSTS; i++) {
+           if (i >= hostCount)
+               afs_AfsdbHandler_CellHosts[i] = 0;
+           else
+               afs_AfsdbHandler_CellHosts[i] = kernelMsg[2+i];
+       }
+
+       /* Request completed, wake up the relevant thread */
+       afs_AfsdbHandler_ReqPending = 0;
+       afs_AfsdbHandler_Completed = 1;
+       afs_osi_Wakeup(&afs_AfsdbLookupWait);
+    }
+
+    /* Wait for a request */
+    while (afs_AfsdbHandler_ReqPending == 0)
+       afs_osi_Sleep(&afs_AfsdbHandlerWait);
+
+    /* Copy the requested cell name into the request buffer */
+    strncpy(acellName, afs_AfsdbHandler_CellName, acellNameLen);
+
+    /* Return the lookup request to userspace */    
+    return 0;
+}
+#endif
+
+
+int afs_GetCellHostsFromDns(acellName, acellHosts, timeout)
+    char *acellName;
+    afs_int32 *acellHosts;
+    int *timeout;
+{
+#ifdef AFS_AFSDB_ENV
+    char grab_glock = 0;
+
+    if (!afs_AfsdbHandlerPresent) return ENOENT;
+
+    if (!ISAFS_GLOCK()) {
+       grab_glock = 1;
+       AFS_GLOCK();
+    }
+
+    /* Wait until the AFSDB handler is available, and grab it */
+    while (afs_AfsdbHandlerInuse)
+       afs_osi_Sleep(&afs_AfsdbLookupWait);
+    afs_AfsdbHandlerInuse = 1;
+
+    /* Set up parameters for the handler */
+    afs_AfsdbHandler_CellName = acellName;
+    afs_AfsdbHandler_CellHosts = acellHosts;
+    afs_AfsdbHandler_Timeout = timeout;
+
+    /* Wake up the AFSDB handler */
+    afs_AfsdbHandler_Completed = 0;
+    afs_AfsdbHandler_ReqPending = 1;
+    afs_osi_Wakeup(&afs_AfsdbHandlerWait);
+
+    /* Wait for the handler to get back to us with the reply */
+    while (!afs_AfsdbHandler_Completed)
+       afs_osi_Sleep(&afs_AfsdbLookupWait);
+
+    /* Release the AFSDB handler and wake up others waiting for it */
+    afs_AfsdbHandlerInuse = 0;
+    afs_osi_Wakeup(&afs_AfsdbLookupWait);
+
+    if (grab_glock) AFS_GUNLOCK();
+
+    if (*acellHosts) return 0;
+    return ENOENT;
+#else
+    return ENOENT;
+#endif
+}
+
+
+void afs_RefreshCell(tc)
+    register struct cell *tc;
+{
+    afs_int32 acellHosts[MAXCELLHOSTS];
+    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);
+    }
+
+    /* In case of a DNS failure, keep old cell data.. */
+    return;
+}
+
+
+struct cell *afs_GetCellByName_Dns(acellName, locktype)
+    register char *acellName;
+    afs_int32 locktype;
+{
+    afs_int32 acellHosts[MAXCELLHOSTS];
+    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;
+
+    return afs_GetCellByName_int(acellName, locktype, 0);
+}
+
+
+struct cell *afs_GetCellByName_int(acellName, locktype, trydns)
     register char *acellName;
     afs_int32 locktype;
+    char trydns;
 {
     register struct cell *tc;
     register struct afs_q *cq, *tq;
@@ -58,15 +221,26 @@ struct cell *afs_GetCellByName(acellName, locktype)
     ObtainWriteLock(&afs_xcell,100);
     for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
        tc = QTOC(cq); tq = QNext(cq);
-       if (!strcmp(tc->cellName, acellName)) {
+       if (!afs_strcasecmp(tc->cellName, acellName)) {
            QRemove(&tc->lruq);
            QAdd(&CellLRU, &tc->lruq);
            ReleaseWriteLock(&afs_xcell);
+           afs_RefreshCell(tc);
            return tc;
        }
     }
     ReleaseWriteLock(&afs_xcell);
-    return (struct cell *) 0;
+    return trydns ? afs_GetCellByName_Dns(acellName, locktype)
+                 : (struct cell *) 0;
+
+} /*afs_GetCellByName_int*/
+
+
+struct cell *afs_GetCellByName(acellName, locktype)
+    register char *acellName;
+    afs_int32 locktype;
+{
+    return afs_GetCellByName_int(acellName, locktype, 1);
 
 } /*afs_GetCellByName*/
 
@@ -87,6 +261,7 @@ struct cell *afs_GetCell(acell, locktype)
            QRemove(&tc->lruq);
            QAdd(&CellLRU, &tc->lruq);
            ReleaseWriteLock(&afs_xcell);
+           afs_RefreshCell(tc);
            return tc;
        }
     }
@@ -111,6 +286,7 @@ struct cell *afs_GetCellByIndex(cellindex, locktype)
            QRemove(&tc->lruq);
            QAdd(&CellLRU, &tc->lruq);
            ReleaseWriteLock(&afs_xcell);
+           afs_RefreshCell(tc);
            return tc;
        }
     }
@@ -120,12 +296,13 @@ struct cell *afs_GetCellByIndex(cellindex, locktype)
 } /*afs_GetCellByIndex*/
 
 
-afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport)
+afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport, timeout)
     int aflags;
     char *acellName;
     register afs_int32 *acellHosts;
     char *linkedcname;
     u_short fsport, vlport;
+    int timeout;
 {
     register struct cell *tc, *tcl=0;
     register afs_int32 i, newc=0, code=0;
@@ -141,7 +318,7 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport
     /* Find the cell and mark its servers as not down but gone */
     for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
        tc = QTOC(cq); tq = QNext(cq);
-       if (strcmp(tc->cellName, acellName) == 0) {
+       if (afs_strcasecmp(tc->cellName, acellName) == 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. */
@@ -169,7 +346,7 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport
            afs_rootcell = tc;
            afs_rootCellIndex = tc->cellIndex;
        } else {
-           tc->cell = *acellHosts; /* won't be reused by another cell */
+           tc->cell = afs_nextCellNum++;
        }
        tc->states = 0;
        tc->lcellp = (struct cell *)0;
@@ -186,7 +363,7 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport
        }
        for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
            tcl = QTOC(cq); tq = QNext(cq);
-           if (!strcmp(tcl->cellName, linkedcname)) {
+           if (!afs_strcasecmp(tcl->cellName, linkedcname)) {
                break;
            }
            tcl = 0;
@@ -203,6 +380,7 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport
        tcl->lcellp = tc;
     }
     tc->states |= aflags;
+    tc->timeout = timeout;
  
     bzero((char *)tc->cellHosts, sizeof(tc->cellHosts));
     for (i=0; i<MAXCELLHOSTS; i++) {
index 9cfb2614cb30cfe3f88932e9e3cfa6eac52d9276..482bf92016331dceaf8e9b511e9a5b1bdb2dab6f 100644 (file)
@@ -45,6 +45,7 @@ extern afs_int32 fvTable[NFENTRIES];
 extern afs_rwlock_t afs_xcell;
 extern struct afs_q CellLRU;
 extern afs_int32 afs_cellindex;
+extern afs_int32 afs_nextCellNum;
 
 /* afs_conn.c */
 extern afs_rwlock_t afs_xconn;
@@ -107,6 +108,8 @@ struct vfs *afs_cacheVfsp=0;
 afs_rwlock_t afs_puttofileLock; /* not used */
 char *afs_sysname = 0;                 /* So that superuser may change the
                                         * local value of @sys */
+char *afs_sysnamelist[MAXNUMSYSNAMES]; /* For support of a list of sysname */
+int afs_sysnamecount = 0;
 struct volume *Initialafs_freeVolList;
 int afs_memvolumes = 0;
 
@@ -524,8 +527,11 @@ afs_ResourceInit(preallocs)
        afs_resourceinit_flag = 1;
        for (i=0;i<NFENTRIES;i++)
            fvTable[i] = 0;
-       afs_sysname = afs_osi_Alloc(MAXSYSNAME);
+       for(i=0;i<MAXNUMSYSNAMES;i++)
+         afs_sysnamelist[i] = afs_osi_Alloc(MAXSYSNAME);
+       afs_sysname = afs_sysnamelist[0];
        strcpy(afs_sysname, SYS_NAME);
+       afs_sysnamecount = 1;
        QInit(&CellLRU);        
 #if    defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV)
     {  extern afs_int32 afs_preallocs;
@@ -836,14 +842,17 @@ void shutdown_AFS()
       for (i=0; i<NFENTRIES; i++)
        fvTable[i] = 0;
       /* Reinitialize local globals to defaults */
-      afs_osi_Free(afs_sysname, MAXSYSNAME);
+      for(i=0; i<MAXNUMSYSNAMES; i++)
+       afs_osi_Free(afs_sysnamelist[i], MAXSYSNAME);
       afs_sysname = 0;
+      afs_sysnamecount = 0;
       afs_marinerHost = 0;
       QInit(&CellLRU);      
       afs_setTimeHost = (struct server *)0;
       afs_volCounter = 1;
       afs_waitForever = afs_waitForeverCount = 0;
       afs_cellindex = 0;
+      afs_nextCellNum = 0x100;
       afs_FVIndex = -1;
       afs_server = (struct rx_service *)0;
       RWLOCK_INIT(&afs_xconn, "afs_xconn");
index a1b6cec7e38dd11dc5758bef38c2b5f675e901ed..8c833ea6e52db657c229a82e5516e2ff0ecf4917 100644 (file)
@@ -33,7 +33,11 @@ extern int afs_shuttingdown;
 
 /* Exported variables */
 afs_uint32 pag_epoch;
+#if defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS)
+afs_uint32 pagCounter = 1;
+#else
 afs_uint32 pagCounter = 0;
+#endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
 
 /* Local variables */
 
@@ -61,14 +65,15 @@ afs_uint32 pagCounter = 0;
  * anyway, so the pag is an alternative handle which is somewhat more
  * secure (although of course not absolutely secure).
 */
+#if !defined(UKERNEL) || !defined(AFS_WEB_ENHANCEMENTS)
 afs_uint32 genpag(void) {
     AFS_STATCNT(genpag);
 #ifdef AFS_LINUX20_ENV
     /* Ensure unique PAG's (mod 200 days) when reloading the client. */
     return (('A' << 24) + ((pag_epoch + pagCounter++) & 0xffffff));
-#else
+#else /* AFS_LINUX20_ENV */
     return (('A' << 24) + (pagCounter++ & 0xffffff));
-#endif
+#endif /* AFS_LINUX20_ENV */
 }
 
 afs_uint32 getpag(void) {
@@ -81,6 +86,30 @@ afs_uint32 getpag(void) {
 #endif
 }
 
+#else
+
+/* Web enhancement: we don't need to restrict pags to 41XXXXXX since
+ * we are not sharing the space with anyone.  So we use the full 32 bits. */
+
+afs_uint32 genpag(void) {
+    AFS_STATCNT(genpag);
+#ifdef AFS_LINUX20_ENV
+    return (pag_epoch + pagCounter++);
+#else
+    return (pagCounter++);
+#endif /* AFS_LINUX20_ENV */
+}
+
+afs_uint32 getpag(void) {
+    AFS_STATCNT(getpag);
+#ifdef AFS_LINUX20_ENV
+    /* Ensure unique PAG's (mod 200 days) when reloading the client. */
+    return (pag_epoch + pagCounter);
+#else
+    return (pagCounter);
+#endif
+}
+#endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
 
 /* used to require 10 seconds between each setpag to guarantee that
  * PAGs never wrap - which would be a security hole.  If we presume
@@ -182,6 +211,115 @@ afs_setpag (void)
 #endif
 }
 
+#if defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS)
+/*
+ * afs_setpag_val
+ * This function is like setpag but sets the current thread's pag id to a
+ * caller-provided value instead of calling genpag().  This implements a
+ * form of token caching since the caller can recall a particular pag value
+ * for the thread to restore tokens, rather than reauthenticating.
+ */
+int
+#if    defined(AFS_SUN5_ENV)
+afs_setpag_val (struct AFS_UCRED **credpp, int pagval)
+#elif  defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+afs_setpag_val (struct proc *p, void *args, int *retval, int pagval)
+#else
+afs_setpag_val (int pagval) 
+#endif
+{
+    int code = 0;
+
+#if defined(AFS_SGI53_ENV) && defined(MP)
+    /* This is our first chance to get the global lock. */
+    AFS_GLOCK();
+#endif /* defined(AFS_SGI53_ENV) && defined(MP) */    
+
+    AFS_STATCNT(afs_setpag);
+#ifdef AFS_SUN5_ENV
+    if (!afs_suser(*credpp))
+#else
+    if (!afs_suser())
+#endif
+    {
+       while (osi_Time() - pag_epoch < pagCounter ) {
+           afs_osi_Wait(1000, (struct afs_osi_WaitHandle *) 0, 0);
+       }       
+    }
+
+#if    defined(AFS_SUN5_ENV)
+    code = AddPag(pagval, credpp);
+#elif  defined(AFS_OSF_ENV) || defined(AFS_FBSD_ENV)
+    code = AddPag(p, pagval, &p->p_rcred);
+#elif  defined(AFS_AIX41_ENV)
+    {
+       struct ucred *credp;
+       struct ucred *credp0;
+       
+       credp = crref();
+       credp0 = credp;
+       code = AddPag(pagval, &credp);
+       /* If AddPag() didn't make a new cred, then free our cred ref */
+       if (credp == credp0) {
+           crfree(credp);
+       }
+    }
+#elif  defined(AFS_HPUX110_ENV)
+    {
+       struct ucred *credp = p_cred(u.u_procp);
+       code = AddPag(pagval, &credp);
+    }
+#elif  defined(AFS_SGI_ENV)
+    {
+       cred_t *credp;
+       credp = OSI_GET_CURRENT_CRED();
+       code = AddPag(pagval, &credp);
+    }
+#elif  defined(AFS_LINUX20_ENV)
+    {
+       struct AFS_UCRED *credp = crref();
+       code = AddPag(pagval, &credp);
+       crfree(credp);
+    }
+#elif defined(AFS_DARWIN_ENV)  || defined(AFS_FBSD_ENV)
+    {
+       struct ucred *credp=crdup(p->p_cred->pc_ucred);
+       code=AddPag(p, pagval, &credp);
+       crfree(credp);
+    }
+#else
+    code = AddPag(pagval, &u.u_cred);
+#endif
+
+    afs_Trace1(afs_iclSetp, CM_TRACE_SETPAG, ICL_TYPE_INT32, code);
+#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_SGI53_ENV) && defined(MP)
+    AFS_GUNLOCK();
+#endif /* defined(AFS_SGI53_ENV) && defined(MP) */    
+    return (code);
+#else
+    if (!getuerror())
+       setuerror(code);
+    return (code);
+#endif
+}
+#endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
+
+#if defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS)
+int afs_getpag_val()
+{
+  int pagvalue;
+  struct AFS_UCRED *credp = u.u_cred;
+  int gidset0, gidset1;
+
+  gidset0 = credp->cr_groups[0];
+  gidset1 = credp->cr_groups[1];
+  pagvalue=afs_get_pag_from_groups(gidset0, gidset1);
+  return pagvalue;
+}
+#endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
+
+
 #if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 int AddPag(struct proc *p, afs_int32 aval, struct AFS_UCRED **credpp)
 #else  /* AFS_OSF_ENV || AFS_FBSD_ENV */
@@ -244,11 +382,15 @@ afs_uint32 afs_get_pag_from_groups(gid_t g0a, gid_t g1a)
        h = (g0 >> 14);
        h = (g1 >> 14) + h + h + h;
        ret = ((h << 28) | l);
+#if defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS)
+       return ret;
+#else
        /* Additional testing */
        if (((ret >> 24) & 0xff) == 'A')
            return ret;
        else
            return NOPAG;
+#endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
     }
     return NOPAG;
 }
@@ -260,7 +402,9 @@ void afs_get_groups_from_pag(afs_uint32 pag, gid_t *g0p, gid_t *g1p)
 
 
     AFS_STATCNT(afs_get_groups_from_pag);
+#if !defined(UKERNEL) || !defined(AFS_WEB_ENHANCEMENTS)
     pag &= 0x7fffffff;
+#endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
     g0 = 0x3fff & (pag >> 14);
     g1 = 0x3fff & pag;
     g0 |= ((pag >> 28) / 3) << 14;
index e8dfc7fa820d86ecb07a181fa8be269e2998cd58..561e4c9d3fb1022cf5a4c86bad094e9974598493 100644 (file)
@@ -282,7 +282,7 @@ static void CheckVLServer(sa, areq)
 
     AFS_STATCNT(CheckVLServer);
     /* Ping dead servers to see if they're back */
-    if (!(aserver->flags & SRVR_ISDOWN) || (aserver->flags & SRVR_ISGONE))
+    if (!((aserver->flags & SRVR_ISDOWN) || (sa->sa_flags & SRVADDR_ISDOWN)) || (aserver->flags & SRVR_ISGONE))
        return;
     if (!aserver->cell)
        return; /* can't do much */
index bf4b9aa159970758bc1227d080b1c623af7a516a..6962f33971894114a4b7454e9afb7b929e4266a9 100644 (file)
@@ -54,6 +54,7 @@
 #define VFS 1
 
 #include <afs/param.h>
+#include "afsconfig.h"
 #include <afs/cmd.h>
 
 #include <assert.h>
 #include <sys/file.h>
 #include <errno.h>
 #include <sys/time.h>
-#ifdef AFS_DEC_ENV
+#include <dirent.h>
+
+#ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
-#include <sys/fs_types.h>
 #endif
-#if    defined(AFS_SUN_ENV)
-#include <sys/vfs.h>
+
+#ifdef HAVE_SYS_FS_TYPES_H
+#include <sys/fs_types.h>
 #endif
-#ifndef        AFS_AIX41_ENV
+
+#ifdef HAVE_SYS_MOUNT_H
 #include <sys/mount.h>
 #endif
-#include <dirent.h>
-#ifdef   AFS_SUN5_ENV
+
+#ifdef HAVE_SYS_FCNTL_H
 #include <sys/fcntl.h>
+#endif
+
+#ifdef HAVE_SYS_MNTTAB_H
 #include <sys/mnttab.h>
+#endif
+
+#ifdef HAVE_SYS_MNTENT_H
 #include <sys/mntent.h>
-#else
-#if    defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV)
-#include <mntent.h>
 #endif
+
+#ifdef HAVE_MNTENT_H
+#include <mntent.h>
 #endif
 
-#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#ifdef HAVE_SYS_MOUNT_H
 #include <sys/mount.h>
-#else
+#endif
+
+#ifdef HAVE_SYS_VFS_H
 #include <sys/vfs.h>
 #endif
 
@@ -213,6 +225,9 @@ static int nBiods = 5;                      /* AIX3.1 only */
 static int preallocs = 400;            /* Def # of allocated memory blocks */
 static int enable_peer_stats = 0;      /* enable rx stats */
 static int enable_process_stats = 0;   /* enable rx stats */
+#ifdef AFS_AFSDB_ENV
+static int enable_afsdb = 0;           /* enable AFSDB support */
+#endif
 #ifdef notdef
 static int inodes = 60;                        /* VERY conservative, but has to be */
 #endif
@@ -709,6 +724,41 @@ struct afsconf_dir *adir; {
     return 0;
 }
 
+#ifdef AFS_AFSDB_ENV
+static AfsdbLookupHandler()
+{
+    afs_int32 kernelMsg[64];
+    char acellName[128];
+    afs_int32 code;
+    struct afsconf_cell acellInfo;
+    int i;
+
+    while (1) {
+       /* On some platforms you only get 4 args to an AFS call */
+       int sizeArg = ((sizeof acellName) << 16) | (sizeof kernelMsg);
+       code = call_syscall(AFSOP_AFSDB_HANDLER, acellName, kernelMsg, sizeArg);
+       if (code) {             /* Something is wrong? */
+           sleep(1);
+           continue;
+       }
+
+       code = afsconf_GetAfsdbInfo(acellName, 0, &acellInfo);
+       if (code) {
+           kernelMsg[0] = 0;
+           kernelMsg[1] = 0;
+       } else {
+           kernelMsg[0] = acellInfo.numServers;
+           if (acellInfo.timeout)
+               kernelMsg[1] = acellInfo.timeout - time(0);
+           else
+               kernelMsg[1] = 0;
+           for (i=0; i<acellInfo.numServers; i++)
+               kernelMsg[i+2] = acellInfo.hostAddr[i].sin_addr.s_addr;
+       }    
+    }
+}
+#endif
+
 #ifdef mac2
 #include <sys/ioctl.h>
 #endif /* mac2 */
@@ -896,6 +946,14 @@ mainproc(as, arock)
        /* -mem_alloc_sleep */
        cacheFlags |= AFSCALL_INIT_MEMCACHE_SLEEP;
     }
+    if (as->parms[24].items) {
+       /* -afsdb */
+#ifdef AFS_AFSDB_ENV
+       enable_afsdb = 1;
+#else
+       printf("afsd: No AFSDB support; ignoring -afsdb");
+#endif
+    }
 
     /*
      * Pull out all the configuration info for the workstation's AFS cache and
@@ -1115,6 +1173,18 @@ mainproc(as, arock)
     }
 #endif
 
+#ifdef AFS_AFSDB_ENV
+    if (enable_afsdb) {
+       if (afsd_verbose)
+           printf("%s: Forking AFSDB lookup handler.\n", rn);
+       code = fork();
+       if (code == 0) {
+           AfsdbLookupHandler();
+           exit(1);
+       }
+    }
+#endif
+
     /* Initialize AFS daemon threads. */
     if (afsd_verbose)
        printf("%s: Forking AFS daemon.\n", rn);
@@ -1187,8 +1257,8 @@ mainproc(as, arock)
     }
 
     /*
-         * If the root volume has been explicitly set, tell the kernel.
-         */
+     * If the root volume has been explicitly set, tell the kernel.
+     */
     if (rootVolSet) {
        if (afsd_verbose)
            printf("%s: Calling AFSOP_ROOTVOLUME with '%s'\n",
@@ -1460,6 +1530,11 @@ char **argv; {
     cmd_AddParm(ts, "-enable_peer_stats", CMD_FLAG, CMD_OPTIONAL|CMD_HIDE, "Collect rpc statistics by peer");
     cmd_AddParm(ts, "-enable_process_stats", CMD_FLAG, CMD_OPTIONAL|CMD_HIDE, "Collect rpc statistics for this process");
     cmd_AddParm(ts, "-mem_alloc_sleep", CMD_FLAG, (CMD_OPTIONAL | CMD_HIDE), "Allow sleeps when allocating memory cache");
+    cmd_AddParm(ts, "-afsdb", CMD_FLAG, (CMD_OPTIONAL
+#ifndef AFS_AFSDB_ENV
+               | CMD_HIDE
+#endif
+               ), "Enable AFSDB support");
     return (cmd_Dispatch(argc, argv));
 }
 
index c535dc120b946e22fec42df9e00658f72229269d..a02e155bd535c560ad184205d424cee8b012b8f2 100644 (file)
@@ -14,6 +14,7 @@ COMPONENT=afsmonitor
 include ../config/Makefile.${SYS_NAME}
 
 CFLAGS=-g -I. \
+       -I${TOP_SRCDIR}/config \
        -I${SRCDIR}include \
        -I${SRCDIR}include/afs \
        -I${SRCDIR} ${XCFLAGS}
index 7f244106afa9ca5181d317f575ae109340f3f539..535c0a4df2b1951fb8021d8b55a55be93a5d6c69 100644 (file)
@@ -868,7 +868,6 @@ void Print_cm_FullPerfInfo()
     static char rn[] = "Print_cm_FullPerfInfo"; /* routine name */
     struct afs_stats_AuthentInfo *authentP;    /*Ptr to authentication stats*/
     struct afs_stats_AccessInfo *accessinfP;   /*Ptr to access stats*/
-    struct afs_stats_AuthorInfo *authorP;      /*Ptr to authorship stats*/
    static afs_int32 fullPerfLongs =
        (sizeof (struct afs_stats_CMFullPerf) >> 2); /*Correct #longs*/
     afs_int32 numLongs;                                /*# longs actually received*/
index 5f592e755e02ec670b84e3b67d7d38f040649e5e..87c989c714b95eeb2675b2542169521d099e50f6 100644 (file)
 #include <math.h>
 #include <cmd.h>
 #include <afs/param.h>
+#include <afsconfig.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #undef IN
 #include <time.h>
 
@@ -2189,7 +2193,7 @@ create_FSframe_objects()
    numBytes = fs_numHosts_perPage * sizeof(struct ServerInfo_line);
    fs_lines = (struct ServerInfo_line *) malloc(numBytes);
    if (fs_lines == (struct ServerInfo_line *)0) {
-       sprintf(errMsg,"[ %s ] Failed to allocate % bytes for FS data lines\n",
+       sprintf(errMsg,"[ %s ] Failed to allocate %d bytes for FS data lines\n",
                rn, numBytes);
        afsmon_Exit(365);
    }
@@ -2203,7 +2207,7 @@ create_FSframe_objects()
        numBytes = fs_cols_perPage * sizeof(struct onode *);
        fs_lines_Ptr->data_o[arrIdx] = (struct onode **) malloc(numBytes);
        if (fs_lines_Ptr->data_o[arrIdx] == (struct onode **)0) {
-       sprintf(errMsg,"[ %s ] Failed to allocate % bytes for FS data onodes\n",
+       sprintf(errMsg,"[ %s ] Failed to allocate %d bytes for FS data onodes\n",
                rn, numBytes);
        afsmon_Exit(370);
        }
@@ -2515,7 +2519,7 @@ int a_LcolNum;            /* starting (leftmost) column number */
    }
    
    if (cmIdx >= numCM) {       /* whoops! screwed up */
-       sprintf(errMsg,"[ %s ] Programming error 1\n");
+       sprintf(errMsg,"[ %s ] Programming error 1\n", rn);
        afsmon_Exit(405);
    }
 
@@ -2969,7 +2973,7 @@ create_CMframe_objects()
    numBytes = cm_numHosts_perPage * sizeof(struct ServerInfo_line);
    cm_lines = (struct ServerInfo_line *) malloc(numBytes);
    if (cm_lines == (struct ServerInfo_line *)0) {
-       sprintf(errMsg,"[ %s ] Failed to allocate % bytes for CM data lines\n",
+       sprintf(errMsg,"[ %s ] Failed to allocate %d bytes for CM data lines\n",
                rn, numBytes);
        afsmon_Exit(445);
    }
@@ -2983,7 +2987,7 @@ create_CMframe_objects()
        numBytes = cm_cols_perPage * sizeof(struct onode *);
        cm_lines_Ptr->data_o[arrIdx] = (struct onode **) malloc(numBytes);
        if (cm_lines_Ptr->data_o[arrIdx] == (struct onode **)0) {
-       sprintf(errMsg,"[ %s ] Failed to allocate % bytes for CM data onodes\n",
+       sprintf(errMsg,"[ %s ] Failed to allocate %d bytes for CM data onodes\n",
                rn, numBytes);
        afsmon_Exit(450);
        }
index 89d9c2cc05e84306a6ace2014c757a79ad3394ad..4d4cf4435fe496e31a0330e164af1df11a536f2d 100644 (file)
@@ -20,6 +20,7 @@
 #include <cmd.h>
 #include <signal.h>
 #include <afs/param.h>
+#include <afsconfig.h>
 
 #undef IN
 
@@ -29,6 +30,7 @@
 #include <sys/socket.h>
 #include <netdb.h>
 #endif
+#include <ctype.h>
 
 #include <gtxwindows.h>                /*Generic window package*/
 #include <gtxobjects.h>                /*Object definitions*/
@@ -308,7 +310,9 @@ struct hostent *GetHostByName(name)
 char *name;
 {
        struct hostent *he;
+#ifdef AFS_SUN5_ENV
        char ip_addr[32];
+#endif
        
        he = gethostbyname(name);
 #ifdef AFS_SUN5_ENV
@@ -356,7 +360,6 @@ int a_exitVal;              /* exit code */
    int i;
    int j;
    int bufslot;
-   int exitVal;
    int code;
  
    if (afsmon_debug) {
@@ -714,6 +717,7 @@ print_CM()
    }
    fprintf(debugFD,"\t\t-----End of List-----\n");
    }
+   return(0);
 }      /* print_CM() */
 
 
@@ -748,8 +752,6 @@ char *a_line;
    char arg3[CFG_STR_LEN];             /* threshold value */
    char arg4[CFG_STR_LEN];             /* user's handler  */
    struct hostent *he;                 /* host entry */
-   int code;
-   char ip_addr[32];
 
    if (afsmon_debug) {
        fprintf(debugFD,"[ %s ] Called, a_line = %s\n",rn, a_line);
@@ -824,8 +826,6 @@ char *a_line;
    char arg3[CFG_STR_LEN];             /* threshold value */
    char arg4[CFG_STR_LEN];             /* user's handler  */
    char arg5[CFG_STR_LEN];             /* junk characters */
-   struct hostent *he;                 /* host entry */
-   int code;
 
    if (afsmon_debug) {
        fprintf(debugFD,"[ %s ] Called, a_line = %s\n",rn, a_line);
@@ -842,7 +842,7 @@ char *a_line;
        return(-1);
    }
    if (strlen(arg3) > THRESH_VAR_LEN-2) {
-       fprintf(stderr,"[%s ] threshold value too long\n");
+       fprintf(stderr,"[%s ] threshold value too long\n", rn);
        return(-1);
    }
 
@@ -1096,7 +1096,7 @@ char *a_line;
    int fromIdx;
    int toIdx;
    int found;
-   int idx;                            /* index to fs_categories[] */
+   int idx = 0;                                /* index to fs_categories[] */
    int i;
    int j;
 
@@ -1384,7 +1384,7 @@ char *a_config_filename;
    struct afsmon_hostEntry *curr_host;
    struct hostent *he;                 /* hostentry to resolve host name*/
    char *handlerPtr;                   /* ptr to pass theresh handler string */
-   int code;                           /* error code */
+   int code = 0;                               /* error code */
    int linenum = 0;                    /* config file line number */
    int threshCount;            /* count of thresholds for each server */
    int error_in_config;         /* syntax errors in config file  ?? */
@@ -1579,7 +1579,7 @@ char *a_config_filename;
                                        arg2,arg3,handlerPtr); 
                                                
                else {
-                       fprintf(stderr,"[ %s ] Programming error 6\n");
+                       fprintf(stderr,"[ %s ] Programming error 6\n", rn);
                        afsmon_Exit(40);
                }
                if (code) {
@@ -1594,7 +1594,7 @@ char *a_config_filename;
 
 
    fclose(configFD);
-
+   return(0);
 }
 
 /*-----------------------------------------------------------------------
@@ -1667,7 +1667,6 @@ int a_newProbeCycle;      /* start of a new probe cycle ? */
 
 {      /* save_FS_results_inCB() */
    static char rn[] = "save_FS_results_inCB";  /* routine name */
-   int code;                                   /* return status */
    struct afsmon_fs_Results_list *tmp_fslist_item;  /* temp fs list item */
    struct xstat_fs_ProbeResults *tmp_fsPR;     /* temp ptr */
    int i;
@@ -2085,7 +2084,6 @@ struct xstat_fs_ProbeResults *a_fsResults;
    static char rn[] = "save_FS_data_forDisplay";       /* routine name */
    struct fs_Display_Data *curr_fsDataP;       /* tmp ptr to curr_fsData*/
    struct fs_Display_Data *prev_fsDataP;       /* tmp ptr to prev_fsData*/
-   struct afsmon_hostEntry *tmp_fsNames;
    struct afsmon_hostEntry *curr_host;
    static int probes_Received = 0;     /* number of probes reveived in
                the current cycle. If this is equal to numFS we got all
@@ -2399,14 +2397,13 @@ int a_newProbeCycle;    /* start of new probe cycle ? */
 
 {      /* save_CM_results_inCB() */
    static char rn[] = "save_CM_results_inCB";  /* routine name */
-   int code;                                   /* return status */
    struct afsmon_cm_Results_list *tmp_cmlist_item;  /* temp cm list item */
    struct xstat_cm_ProbeResults *tmp_cmPR;     /* temp ptr */
    int i;
 
 
    if (afsmon_debug) {
-       fprintf(debugFD,"[ %s ] Called, a_newProbeCycle= %d\n",a_newProbeCycle);
+       fprintf(debugFD,"[ %s ] Called, a_newProbeCycle= %d\n",rn, a_newProbeCycle);
        fflush(debugFD);
    }
 
@@ -2758,7 +2755,7 @@ struct cm_Display_Data *a_Data;           /* ptr to cm data to be displayed */
        if (pValue > tValue) {
 
                 if (afsmon_debug) {
-                fprintf(debugFD,"[ %s ] cm = %s, thresh ovf for %s, threshold= % s, probevalue= %s\n",
+                fprintf(debugFD,"[ %s ] cm = %s, thresh ovf for %s, threshold= %s, probevalue= %s\n",
                 rn, a_hostEntry->hostName, threshP->itemName, threshP->threshVal , a_Data->data[idx]);
                 fflush(debugFD);
                 }
@@ -2821,7 +2818,6 @@ struct xstat_cm_ProbeResults *a_cmResults;
    static char rn[] = "save_CM_data_forDisplay";       /* routine name */
    struct cm_Display_Data *curr_cmDataP;
    struct cm_Display_Data *prev_cmDataP;
-   struct afsmon_hostEntry *tmp_cmNames;
    struct afsmon_hostEntry *curr_host;
    static int probes_Received = 0;     /* number of probes reveived in
                the current cycle. If this is equal to numFS we got all
@@ -3030,7 +3026,6 @@ afsmon_CM_Handler()
    static char rn[] = "afsmon_CM_Handler";     /* routine name */
    int code;                                   /* return status */
    int newProbeCycle;                  /* start of new probe cycle ? */
-   int i;
 
   if (afsmon_debug) {
        fprintf(debugFD,
@@ -3481,7 +3476,6 @@ afsmon_execute()
    int CMinitFlags = 0;                                /* flags for xstat_cm_Init */
    int code;                                   /* function return code */
    struct timeval tv;                          /* time structure */
-   int i;
 
    if (afsmon_debug) {
        fprintf(debugFD,"[ %s ] Called\n",rn);
@@ -3511,7 +3505,7 @@ afsmon_execute()
        strncpy(fullhostname,curr_FS->hostName,sizeof(fullhostname));
        he = GetHostByName(fullhostname);
        if (he == (struct hostent *)0) {
-          fprintf(stderr,"[ %s ] Cannot get host info for %s\n",fullhostname);
+          fprintf(stderr,"[ %s ] Cannot get host info for %s\n",rn, fullhostname);
           return(-1);
        }
        strncpy(curr_FS->hostName,he->h_name,HOST_NAME_LEN); /* complete name*/
@@ -3530,7 +3524,7 @@ afsmon_execute()
    numCollIDs = 1;
    collIDP = (afs_int32 *) malloc (sizeof (afs_int32));
    if (collIDP == (afs_int32 *)0) {
-       fprintf(stderr,"[ %s ] failed to allocate a measely afs_int32 word.Argh!\n");
+       fprintf(stderr,"[ %s ] failed to allocate a measely afs_int32 word.Argh!\n", rn);
        return(-1);
    }
    *collIDP = 2;               /* USE A macro for this */
@@ -3582,7 +3576,7 @@ afsmon_execute()
        strncpy(fullhostname,curr_CM->hostName,sizeof(fullhostname));
        he = GetHostByName(fullhostname);
        if (he == (struct hostent *)0) {
-          fprintf(stderr,"[ %s ] Cannot get host info for %s\n",fullhostname);
+          fprintf(stderr,"[ %s ] Cannot get host info for %s\n",rn, fullhostname);
           return(-1);
        }
        strncpy(curr_CM->hostName,he->h_name,HOST_NAME_LEN); /* complete name*/
@@ -3601,7 +3595,7 @@ afsmon_execute()
    numCollIDs = 1;
    collIDP = (afs_int32 *) malloc (sizeof (afs_int32));
    if (collIDP == (afs_int32 *)0) {
-       fprintf(stderr,"[ %s ] failed to allocate a measely long word.Argh!\n");
+       fprintf(stderr,"[ %s ] failed to allocate a measely long word.Argh!\n", rn);
        return(-1);
    }
    *collIDP = 2;               /* USE A macro for this */
@@ -3698,7 +3692,6 @@ struct cmd_syndesc *as;
 
    static char rn[] = "afsmonInit";    /* Routine name */
    char *debug_filename;       /* pointer to debug filename */
-   char *config_filename;      /* pointer to config filename */
    FILE *outputFD;             /* output file descriptor */
    struct cmd_item *hostPtr;   /* ptr to parse command line args */
    char buf[256];              /* buffer for processing hostnames */
@@ -3960,7 +3953,7 @@ struct cmd_syndesc *as;
 
 #include "AFS_component_version_number.c"
 
-main(argc, argv)
+int main(argc, argv)
 int argc;
 char **argv;
 {      /* main() */
@@ -4021,5 +4014,6 @@ char **argv;
     else
       afsmon_Exit(2);
 
+    exit(0); /* redundant, but gets rid of warning */
 } /*main*/
 
index dfb1354f0e4f33e00ca142cdc198231ddc15f356..2a78c68e52ff7f5ab1e7d79f1e643620616ec4e1 100644 (file)
@@ -31,7 +31,7 @@ struct Threshold {
 
 
 /* structures to store info of hosts to be monitored */
-static struct afsmon_hostEntry {
+struct afsmon_hostEntry {
        char hostName[HOST_NAME_LEN];   /* fs or cm host name */
        int numThresh;                  /* number of thresholds for this host */
        struct Threshold *thresh;       /* ptr to threshold entries */
index 618af14cf7b55a34249c96ce5b1a0b2ac9a88590..10843bb5830747cced839299a804be3ae57bfe29 100644 (file)
@@ -68,7 +68,7 @@ audit.o: audit.c audit.h
        ${CC} ${CFLAGS} -c audit.c
 
 clean:
-       rm -f *.o core AFS_component_version_number.c
+       rm -f *.o core AFS_component_version_number.c *.a
 
 beancount:
        wc -l *.c *.h
index 9b31b231d78e025b2d2b35ff494eebcbdbf605b3..b6502e623caffef7091351f0240ab038ae90da65 100644 (file)
@@ -26,4 +26,7 @@ $(LIBFILE): $(LIBOBJS)
 
 install:  $(INCFILES)  $(LIBFILE)
 
+install9x: install
+
 clean::
+       $(DEL) $(INCFILES)
\ No newline at end of file
index 9737811213977994d0ec2ee415375692e8bf16bc..028ab9e05c96a71f841f32d41e4762b97b916301 100644 (file)
@@ -419,10 +419,10 @@ int osi_audit_check ()
 #else /* ! AFS_AIX_ENV */
 
 int osi_audit (char *audEvent, afs_int32 errCode, ...)
-{}
+{ return 0; }
 
 int osi_auditU (struct rx_call *call, char *audEvent, int errCode, ...)
-{}
+{ return 0; }
 
 #endif
 
index 17ef837746dcc496e71e84b84883aadb0aba3ad9..7621e8c7441c9cb0db962623a2142c0c7858f187 100644 (file)
@@ -18,7 +18,7 @@ OBJS= cellconfig.o ktc.o userok.o writeconfig.o authcon.o \
 KOBJS= cellconfig.o ktc.krb.o userok.o writeconfig.o authcon.o \
     acfg_errors.o ktc_errors.o # comktc.o comvice.o comauth.o 
 
-CFLAGS=-g -I${SRCDIR}include ${XCFLAGS} 
+CFLAGS=-g -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS} 
 LDIRS= 
 LIBS= libauth.a ${DESTDIR}lib/afs/libsys.a \
       ${DESTDIR}lib/librxkad.a ${DESTDIR}lib/libdes.a \
@@ -100,6 +100,11 @@ install.noversion: all kinstall ukinstall ${DESTDIR}etc/copyauth
        ${INSTALL} cellconfig.h ${DESTDIR}include/afs
        ${INSTALL} keys.h ${DESTDIR}include/afs
 
+includes: auth.h cellconfig.h keys.h
+       ${INSTALL} auth.h ${DESTDIR}include/afs
+       ${INSTALL} cellconfig.h ${DESTDIR}include/afs
+       ${INSTALL} keys.h ${DESTDIR}include/afs
+
 clean:
        rm -f *.o *.a copyauth testcellconf setkey auth.h cellconfig.h acfg_errors.c ktc_errors.c core\
        AFS_component_version_number.c
index dced27eed11f2faaaf01f35f51a8d93f1e9a1a00..c9aa3af70c9fd8a135158d9c364b4d0665ea1f35 100644 (file)
@@ -76,6 +76,7 @@ EXELIBS =\
        $(DESTDIR)\lib\afs\afseventlog.lib \
        $(EXELIBDIR)\afs\afsreg.lib
 
+
 $(SETKEY_EXEFILE): $(SETKEY_EXEOBJS) $(EXELIBS)
        $(EXECONLINK)
        $(EXEPREP) 
@@ -102,6 +103,8 @@ ktc_errors.c $(INCFILEDIR)\auth.h: ktc_errors.et auth.p.h
 
 install: $(INCFILES) $(AFSAUTH_LIBFILE) setkey.exe # $(COPYAUTH_EXEFILE) $(AFSAUTH_KRB_LIBFILE)
 
+install9x: install
+
 clean::
        $(DEL) acfg_errors.c ktc_errors.c
        $(DEL) $(INCFILEDIR)\auth.h  $(INCFILEDIR)\cellconfig.h
index 81f78dd8f159133240e310fff7da1aa1325283a0..87a4820ac90a71acfb2500cf5fd840451e4baf41 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <afs/stds.h>
 #include <afs/pthread_glock.h>
 #ifdef UKERNEL
 #include <netdb.h>
 #include <sys/file.h>
 #include <sys/time.h>
-#endif
+#ifdef AFS_AFSDB_ENV
+#include <arpa/nameser.h>
+#include <resolv.h>
+#endif /* AFS_AFSDB_ENV */
+#endif /* AFS_NT40_ENV */
 #include <errno.h>
 #include <ctype.h>
 #include <time.h>
@@ -73,6 +78,7 @@ register char *aname; {
     /* lookup a service name */
     struct servent *ts;
     register struct afsconf_servPair *tsp;
+
 #if     defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV)
     ts = getservbyname(aname, "");
 #else
@@ -82,6 +88,7 @@ register char *aname; {
        /* we found it in /etc/services, so we use this value */
        return ts->s_port;  /* already in network byte order */
     }
+
     /* not found in /etc/services, see if it is one of ours */
     for(tsp = serviceTable;; tsp++) {
        if (tsp->name == (char *) 0) return -1;
@@ -540,6 +547,97 @@ afsconf_GetExtendedCellInfo(adir, acellName, aservice, acellInfo, clones)
     return code;
 }
 
+#ifdef AFS_AFSDB_ENV
+afsconf_GetAfsdbInfo(acellName, aservice, acellInfo)
+    char *acellName;
+    char *aservice;
+    struct afsconf_cell *acellInfo;
+{
+    afs_int32 code;
+    int tservice, len, i;
+    unsigned char answer[1024];
+    unsigned char *p;
+    char host[256];
+    int server_num = 0;
+    int minttl = 0;
+
+    /* The resolver isn't always MT-safe.. Perhaps this ought to be
+     * replaced with a more fine-grained lock just for the resolver
+     * operations.
+     */
+    LOCK_GLOBAL_MUTEX
+    len = res_search(acellName, C_IN, T_AFSDB, answer, sizeof(answer));
+    UNLOCK_GLOBAL_MUTEX
+
+    if (len < 0)
+       return AFSCONF_NOTFOUND;
+
+    p = answer + sizeof(HEADER);       /* Skip header */
+    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 */
+
+    while (p < answer + len) {
+       int type, ttl, size;
+
+       code = dn_expand(answer, answer + len, p, host, sizeof(host));
+       if (code < 0)
+           return AFSCONF_NOTFOUND;
+
+       p += code;      /* Skip the name */
+       type = (p[0] << 8) | p[1];
+       p += 4;         /* Skip type and class */
+       ttl = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
+       p += 4;         /* Skip the TTL */
+       size = (p[0] << 8) | p[1];
+       p += 2;         /* Skip the size */
+
+       if (type == T_AFSDB) {
+           struct hostent *he;
+
+           code = dn_expand(answer, answer+len, p+2, host, sizeof(host));
+           if (code < 0)
+               return AFSCONF_NOTFOUND;
+
+           /* Do we want to get TTL data for the A record as well? */
+           he = gethostbyname(host);
+           if (he && server_num < MAXHOSTSPERCELL) {
+               afs_int32 ipaddr;
+               memcpy(&ipaddr, he->h_addr, he->h_length);
+               acellInfo->hostAddr[server_num].sin_addr.s_addr = ipaddr;
+               strncpy(acellInfo->hostName[server_num], host,
+                       sizeof(acellInfo->hostName[server_num]));
+               server_num++;
+
+               if (!minttl || ttl < minttl) minttl = ttl;
+           }
+       }
+
+       p += size;
+    }
+
+    if (server_num == 0)               /* No AFSDB records */
+       return AFSCONF_NOTFOUND;
+    acellInfo->numServers = server_num;
+
+    if (aservice) {
+       tservice = afsconf_FindService(aservice);
+       if (tservice < 0)
+           return AFSCONF_NOTFOUND;  /* service not found */
+       for (i=0; i<acellInfo->numServers; i++) {
+           acellInfo->hostAddr[i].sin_port = tservice;
+       }
+    }
+
+    acellInfo->timeout = minttl ? (time(0) + minttl) : 0;
+
+    return 0;
+}
+#endif /* AFS_AFSDB_ENV */
+
 afsconf_GetCellInfo(adir, acellName, aservice, acellInfo)
 struct afsconf_dir *adir;
 char *aservice;
@@ -601,12 +699,17 @@ struct afsconf_cell *acellInfo; {
                acellInfo->hostAddr[i].sin_port = tservice;
            }
        }
+       acellInfo->timeout = 0;
        UNLOCK_GLOBAL_MUTEX
        return 0;
     }
     else {
        UNLOCK_GLOBAL_MUTEX
+#ifdef AFS_AFSDB_ENV
+       return afsconf_GetAfsdbInfo(acellName, aservice, acellInfo);
+#else
        return AFSCONF_NOTFOUND;
+#endif /* AFS_AFSDB_ENV */
     }
 }
 
@@ -743,8 +846,12 @@ afsconf_GetKeys(adir, astr)
 struct afsconf_dir *adir;
 struct afsconf_keys *astr;
 {
+    register afs_int32 code;
+
     LOCK_GLOBAL_MUTEX
-    afsconf_Check(adir);
+    code = afsconf_Check(adir);
+    if (code)
+       return AFSCONF_FAILURE;
     bcopy(adir->keystr, astr, sizeof(struct afsconf_keys));
     UNLOCK_GLOBAL_MUTEX
     return 0;
@@ -761,9 +868,12 @@ afs_int32 afsconf_GetLatestKey(adir, avno, akey)
     register struct afsconf_key *tk;
     register afs_int32 best;
     struct afsconf_key *bestk;
+    register afs_int32 code;
     
     LOCK_GLOBAL_MUTEX
-    afsconf_Check(adir);
+    code = afsconf_Check(adir);
+    if (code)
+       return AFSCONF_FAILURE;
     maxa = adir->keystr->nkeys;
 
     best = -1;     /* highest kvno we've seen yet */
@@ -793,9 +903,12 @@ char *akey;
 {
     register int i, maxa;
     register struct afsconf_key *tk;
+    register afs_int32 code;
 
     LOCK_GLOBAL_MUTEX
-    afsconf_Check(adir);
+    code = afsconf_Check(adir);
+    if (code)
+       return AFSCONF_FAILURE;
     maxa = adir->keystr->nkeys;
 
     for(tk = adir->keystr->key,i=0;i<maxa;i++,tk++) {
index 3632973b15ee113c8ee5c548822a0cb6294c19fc..7e6091e443a3801d84fd0556379e3806e4b2b232 100644 (file)
@@ -66,6 +66,7 @@ struct afsconf_cell {
     struct sockaddr_in hostAddr[MAXHOSTSPERCELL];      /*IP addresses for cell's servers*/
     char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS];      /*Names for cell's servers*/
     char *linkedCell;                          /* Linked cell name, if any */
+    int timeout;                               /* Data timeout, if non-zero */
 };
 
 struct afsconf_entry {
index ba87d83bb7ee440d7ec693b264e713b4501b39db..e92b9b9a100969121e0452ce8541d1096feb9207 100644 (file)
@@ -283,10 +283,14 @@ int ktc_SetToken(
         * Instead of sending the session key in the clear, we zero it,
         * and send it later, via RPC, encrypted.
         */
+#ifndef AFS_WIN95_ENV
        /*
        memcpy(ct.HandShakeKey, &token->sessionKey, sizeof(token->sessionKey));
         */
        memset(ct.HandShakeKey, 0, sizeof(ct.HandShakeKey));
+#else
+       memcpy(ct.HandShakeKey, &token->sessionKey, sizeof(token->sessionKey));
+#endif
        ct.BeginTimestamp = token->startTime;
        ct.EndTimestamp = token->endTime;
        if (ct.BeginTimestamp == 0) ct.BeginTimestamp = 1;
@@ -330,6 +334,7 @@ int ktc_SetToken(
        memcpy(tp, &uuid, sizeof(uuid));
        tp += sizeof(uuid);
 
+#ifndef AFS_WIN95_ENV
        /* RPC to send session key */
        status = send_key(uuid, token->sessionKey.data);
        if (status != RPC_S_OK) {
@@ -343,6 +348,7 @@ int ktc_SetToken(
                else
                        return KTC_RPC;
        }
+#endif /* AFS_WIN95_ENV */
 
        /* set up for pioctl */
        iob.in = tbuffer;
@@ -429,6 +435,7 @@ int ktc_GetToken(
                        return KTC_PIOCTLFAIL;
        }
 
+#ifndef AFS_WIN95_ENV   /* get rid of RPC for win95 build */
        /* RPC to receive session key */
        status = receive_key(uuid, token->sessionKey.data);
        if (status != RPC_S_OK) {
@@ -442,6 +449,7 @@ int ktc_GetToken(
                else
                        return KTC_RPC;
        }
+#endif /* AFS_WIN95_ENV */
 
        cp = tbuffer;
 
@@ -484,12 +492,13 @@ int ktc_GetToken(
        token->endTime = ct.EndTimestamp;
        if (ct.AuthHandle == -1) ct.AuthHandle = 999;
        token->kvno = ct.AuthHandle;
+#ifndef AFS_WIN95_ENV
        /*
         * Session key has already been set via RPC
         */
-       /*
+#else
        memcpy(&token->sessionKey, ct.HandShakeKey, sizeof(ct.HandShakeKey));
-        */
+#endif /* AFS_WIN95_ENV */
        token->ticketLen = ticketLen;
        if (client) {
                strcpy(client->name, cp);
index 33a5a8a1ad2c0573c0d017e0cf5150121964ed13..86ba5049c7a70c0d1cef7e0d2e916cc8209cf01e 100644 (file)
@@ -35,6 +35,8 @@
 #include <sys/stat.h>
 #include <stdlib.h>    /* for realpath() */
 #include <errno.h>
+#include <string.h>
+#include <ctype.h>
 
 #include <rx/xdr.h>
 #include <rx/rx.h>
@@ -51,6 +53,7 @@
 #include "keys.h"
 #include "afs/audit.h"
 
+afs_int32 afsconf_SuperUser();
 
 #if !defined(UKERNEL)
 int afsconf_CheckAuth(adir, acall)
@@ -287,10 +290,52 @@ char *aname; {
     return code;
 }
 
+/* special CompFindUser routine that builds up a princ and then
+       calls finduser on it. If found, returns char * to user string, 
+       otherwise returns NULL. The resulting string should be immediately
+       copied to other storage prior to release of mutex. */
+static char *CompFindUser(adir, name, sep, inst, realm)
+    struct afsconf_dir *adir;
+    char *name;
+    char *sep;
+    char *inst;
+    char *realm;
+{
+    static char fullname[ MAXKTCNAMELEN + MAXKTCNAMELEN +
+       MAXKTCREALMLEN + 3 ];
+
+    /* always must have name */
+    if ( !name || !name[0] ) { return NULL; }
+    strcpy(fullname, name);
+
+    /* might have instance */
+    if ( inst && inst[0] ) {
+       if ( !sep || !sep[0] ) { return NULL; }
+
+       strcat(fullname, sep);
+       strcat(fullname, inst);
+    }
+
+    /* might have realm */
+    if ( realm && realm[0] )
+    {
+       strcat(fullname, "@");
+       strcat(fullname, realm);
+    }
+
+    if ( FindUser(adir, fullname) ) {
+       return fullname;
+    } else {
+       return NULL;
+    }
+}
+
+
 /* make sure user authenticated on rx call acall is in list of valid
-    users.
+    users. Copy the "real name" of the authenticated user into namep
+    if a pointer is passed.
 */
-afsconf_SuperUser(adir, acall, namep)
+afs_int32 afsconf_SuperUser(adir, acall, namep)
 struct afsconf_dir *adir;
 struct rx_call *acall;
 char *namep; {
@@ -303,11 +348,13 @@ char *namep; {
        UNLOCK_GLOBAL_MUTEX
        return 0;
     }
+
     if (afsconf_GetNoAuthFlag(adir)) {
-       if (namep) strcpy(namep, "<noauth>");
+       if (namep) strcpy(namep, "<NoAuth>");
        UNLOCK_GLOBAL_MUTEX
        return 1;
     }
+
     tconn = rx_ConnectionOf(acall);
     code = rx_SecurityClassOf(tconn);
     if (code ==        0) {
@@ -323,52 +370,26 @@ char *namep; {
        char tname[MAXKTCNAMELEN];      /* authentication from ticket */
        char tinst[MAXKTCNAMELEN];
        char tcell[MAXKTCREALMLEN];
-       char uname[MAXKTCNAMELEN];      /* name.instance */
-       int  ilen;                      /* length of instance */
+       char tcell_l[MAXKTCREALMLEN];
+       char *tmp;
+       
+       /* keep track of which one actually authorized request */
+       char uname[MAXKTCNAMELEN+MAXKTCNAMELEN+MAXKTCREALMLEN+3];
+
        afs_uint32 exp;
-       static char localcellname[MAXCELLCHARS] = "";
-#if    defined(AFS_ATHENA_STDENV) || defined(AFS_KERBREALM_ENV)
-       static char local_realm[AFS_REALM_SZ] = "";
-#endif
+       static char lcell[MAXCELLCHARS] = "";
+       static char lrealm[AFS_REALM_SZ] = "";
        
-       /* des tokens */
+       /* get auth details from server connection */
        code = rxkad_GetServerInfo
-           (acall->conn, (afs_int32 *) 0, &exp, tname, tinst, tcell, (afs_int32 *) 0);
+           (acall->conn, (afs_int32 *) 0, &exp, 
+               tname, tinst, tcell, (afs_int32 *) 0);
        if (code) {
            UNLOCK_GLOBAL_MUTEX
-           return 0; /* bogus */
-       }
-
-       if (strlen (tcell)) {
-           if (!localcellname[0])
-               afsconf_GetLocalCell
-                   (adir, localcellname, sizeof(localcellname));
-#if    defined(AFS_ATHENA_STDENV) || defined(AFS_KERBREALM_ENV)
-           if (!local_realm[0]) {
-               if (afs_krb_get_lrealm(local_realm, 0) != 0/*KSUCCESS*/)
-                   strncpy(local_realm, localcellname, AFS_REALM_SZ);
-           }
-           if (strcasecmp(local_realm, tcell) &&
-              (strcasecmp(localcellname, tcell)))
-#else
-           if (strcasecmp(localcellname, tcell))
-#endif
-               {
-                   UNLOCK_GLOBAL_MUTEX
-                   return 0;
-               }
-       }
-       ilen = strlen(tinst);
-       strncpy (uname, tname, sizeof(uname));
-       if (ilen) {
-           if (strlen(uname) + 1 + ilen >= sizeof(uname)) {
-               UNLOCK_GLOBAL_MUTEX
-               return 0;
-           }
-           strcat (uname, ".");
-           strcat (uname, tinst);
+           return 0; /* bogus connection/other error */
        }
 
+       /* don't bother checking anything else if tix have expired */
 #ifdef AFS_PTHREAD_ENV
        if (exp < clock_Sec()) {
 #else
@@ -377,14 +398,75 @@ char *namep; {
            UNLOCK_GLOBAL_MUTEX
            return 0;   /* expired tix */
        }
-       if (strcmp(AUTH_SUPERUSER, uname) == 0) flag = 1;
-       else flag = FindUser(adir, uname);      /* true iff in userlist file */
+
+       /* generate lowercased version of cell name */
+       strcpy(tcell_l, tcell);
+       tmp = tcell_l;
+       while ( *tmp ) { *tmp = tolower(*tmp); *tmp++; }
+
+       /* determine local cell name. It's static, so will only get
+          calculated the first time through */
+       if (!lcell[0])
+           afsconf_GetLocalCell(adir, lcell, sizeof(lcell));
+
+       /* if running a krb environment, also get the local realm */
+       /* note - this assumes AFS_REALM_SZ <= MAXCELLCHARS */
+       /* just set it to lcell if it fails */
+       if (!lrealm[0]) {
+           if (afs_krb_get_lrealm(lrealm, 0) != 0) /* KSUCCESS */
+               strncpy(lrealm, lcell, AFS_REALM_SZ);
+       }
+
+
+       /* start with no uname and no authorization */
+       strcpy(uname, "");
+       flag = 0;
+
+       /* localauth special case */
+       if ( strlen(tinst) == 0 && strlen(tcell) == 0 && 
+               !strcmp(tname, AUTH_SUPERUSER) ) {
+           strcpy(uname, "<LocalAuth>");
+           flag = 1;
+
+       /* cell of connection matches local cell or krb4 realm */
+       } else if ( !strcasecmp(tcell, lcell) || !strcasecmp(tcell,lrealm) ) {
+           if ( (tmp = CompFindUser(adir, tname, ".", tinst, NULL)) ) {
+               strcpy(uname, tmp);
+               flag = 1;
+#ifdef notyet
+           } else if ( (tmp = CompFindUser(adir, tname, "/", tinst, NULL)) ) {
+               strcpy(uname, tmp);
+               flag = 1;
+#endif
+           }
+
+       /* cell of conn doesn't match local cell or realm */
+       } else {
+           if ( (tmp = CompFindUser(adir, tname, ".", tinst, tcell)) ) {
+               strcpy(uname, tmp);
+               flag = 1;
+#ifdef notyet
+           } else if ( (tmp = CompFindUser(adir, tname, "/", tinst, tcell)) ) {
+               strcpy(uname, tmp);
+               flag = 1;
+#endif
+           } else if ( (tmp = CompFindUser(adir, tname, ".", tinst, tcell_l)) ) {
+               strcpy(uname, tmp);
+               flag = 1;
+#ifdef notyet
+           } else if ( (tmp = CompFindUser(adir, tname, "/", tinst, tcell_l)) ) {
+               strcpy(uname, tmp);
+               flag = 1;
+#endif
+           }
+       }
+
        if (namep)
            strcpy(namep, uname);
        UNLOCK_GLOBAL_MUTEX
        return flag;
     }
-    else {
+    else { /* some other auth type */
        UNLOCK_GLOBAL_MUTEX
        return  0;          /* mysterious, just say no */
     }
index adc108054473a6236f3a4f12a9ebd3ff3f079e9c..d9fea507fa88d898b3021f16ec00a61a5405f7a2 100644 (file)
@@ -92,7 +92,7 @@ install: all
        ${INSTALL} bnode.h ${DESTDIR}include/afs/bnode.h
 
 clean:
-       rm -f  *.a *.o bos bosserver testproc bosint.cs.c bosint.ss.c bosint.xdr.c bosint.h core\
+       rm -f  *.a *.o bos bosserver testproc bosint.cs.c bosint.ss.c bosint.xdr.c bosint.h core boserr.c bnode.h\
        AFS_component_version_number.c
 
 test: 
index 347a9309040daa2d7618eb334ee3212ddd98f942..3fdf45fabb5e40496b087712251935aa0866eb95 100644 (file)
@@ -758,12 +758,16 @@ char **envp;
 
            /* hack to support help flag */
 
-           printf("Usage: bosserver [-noauth] [-log] "
 #ifndef AFS_NT40_ENV
+           printf("Usage: bosserver [-noauth] [-log] "
                   "[-syslog[=FACILITY]] "
-#endif
-                  /* "[-enable_peer_stats] [-enable_process_stats] " */
+                  "[-enable_peer_stats] [-enable_process_stats] "
                   "[-help]\n");
+#else
+           printf("Usage: bosserver [-noauth] [-log] "
+                  "[-enable_peer_stats] [-enable_process_stats] "
+                  "[-help]\n");
+#endif
            fflush(stdout);
 
            exit(0);
index 517708a9feb4902806883c1163cde02dbcaf1bd6..b9d16c2724e857499a467898da8092158669f21a 100644 (file)
@@ -83,7 +83,7 @@ install: all
        ${INSTALL} backup ${DESTDIR}etc
 
 clean:
-       rm -f *.o backup convert *.ss.c *.cs.c *.xdr.c *.a core btest ttest AFS_component_version_number.c
+       rm -f *.o backup convert *.ss.c *.cs.c *.xdr.c *.a core btest ttest AFS_component_version_number.c bc.h bucoord_errs.c
 
 lint:
        lint -IDEST/include -IDEST/include/afs *.h *.c
index d8598bcb5804dc64fb8b5fcf676bd02346d1a03f..6757a4a9e4bcc34b172b90f1a317452747f4631e 100644 (file)
@@ -3040,7 +3040,7 @@ dumpInfo(dumpid, detailFlag)
            else
            {
                compactDateString(&volumeLinkPtr->volumeEntry.clone, ds, 50),
-               printf("%4d %s %9d %16s\n",
+               printf("%4d %s %10u %16s\n",
                       volumeLinkPtr->volumeEntry.position,
                       ds,
                       volumeLinkPtr->volumeEntry.nBytes,
index 61dcd34589b2b7c228c26e9d35da6067fcaa78d9..2402dab35fbb567a3da6ce891b55723cacb4ff73 100644 (file)
@@ -47,12 +47,12 @@ cmd64.o: cmd.c ${INCLS}
 
 libcmd64.a: ${LIB64OBJS} AFS_component_version_number64.o
        -rm -f libcmd64.a
-       ar r libcmd64.a ${LIB64OBJS} AFS_component_version_number64.o
+       $(AR) r libcmd64.a ${LIB64OBJS} AFS_component_version_number64.o
        $(RANLIB) libcmd64.a
 
 libcmd.a: ${LIBOBJS} AFS_component_version_number.o
        -rm -f libcmd.a
-       ar r libcmd.a ${LIBOBJS} AFS_component_version_number.o
+       $(AR) r libcmd.a ${LIBOBJS} AFS_component_version_number.o
        $(RANLIB) libcmd.a
 
 kinstall:
index b167b1751db75ee797fb78328a4fc0ec795005ae..2661949cc78d63fd40b46c33ec4c7f24ae2108ee 100644 (file)
@@ -35,9 +35,11 @@ cmd_errors.c cmd.h: cmd_errors.et cmd.p.h
 
 install: $(LIBFILE) $(INCFILES)
 
+install9x: install
 
 clean::
        $(DEL) cmd_errors.c
+       $(DEL) $(LIBFILE)
 
 test tests:
        
index a56b16483f89fa5462dc598f621beb4e07358e19..4a495e4e5f814a88a2d845f2d7569a83ef61e955 100644 (file)
@@ -33,9 +33,14 @@ $(COMERR_LIBFILE): $(COMERR_LIBOBJS)
 # build and install the compile_et executable
 COMPILE_ET_EXEFILE = $(DESTDIR)\bin\compile_et.exe
 
+prep:
+       $(DESTDIR)\bin\touch et_lex.lex_nt.c
+       $(DESTDIR)\bin\touch error_table_nt.c
+       @echo If you update et_lex.lex.l, to build correctly, you should delete error_table_nt.c 
+
 et_lex.lex_nt.c:   et_lex.lex.l
-    $(LEX) -t et_lex.lex.l > $@
-    
+    $(LEX) -t et_lex.lex.l > $@        
+
 error_table_nt.c:  et_lex.lex_nt.c error_table.y
     $(YACC) -d -o $@ error_table.y
 
@@ -51,10 +56,14 @@ $(COMPILE_ET_EXEFILE): $(COMPILE_ET_EXEOBJS) $(COMPILE_ET_EXELIBS)
        $(EXEPREP) 
 
 ####################################################################
-install: $(INCFILES) $(COMERR_LIBFILE) $(COMPILE_ET_EXEFILE) 
+install: prep $(INCFILES) $(COMERR_LIBFILE) $(COMPILE_ET_EXEFILE) 
+
+install9x: install
 
 clean::
-       $(DEL) *~ \#* *.bak \
+       $(DEL) $(COMERR_LIBFILE)
+       $(DEL) $(COMPILE_ET_EXEFILE)
+       $(DEL) *~ *.bak \
                  *.otl *.aux *.toc *.PS *.dvi *.x9700 *.ps \
                  *.cp *.fn *.ky *.log *.pg *.tp *.vr \
                  et.ar TAGS
index ad8aa8332191e7d1cfb56095654c9c0549e9dc86..8f7ae12630ad74d621dbebb064e9c7b3e9579204 100644 (file)
@@ -7,8 +7,10 @@
  *
  */
 
+#undef MEMORYLEAK
 #include <afs/param.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 #ifndef AFS_NT40_ENV
 #include <sys/file.h>
@@ -37,12 +39,6 @@ FILE *hfile, *cfile, *msfile;
 int version = 1;
 int use_msf = 0;
 
-/* C library */
-#ifndef AFS_NT40_ENV
-extern char *malloc();
-#endif
-
-
 /* lex stuff */
 extern FILE *yyin;
 extern FILE *yyout;
@@ -107,7 +103,7 @@ static const char warning[] =
     "/*\n * %s:\n * This file is automatically generated; please do not edit it.\n */\n";
 
 static const char msf_warning[] =
-    "$\n$ %s:\n$ This file is automatically generated; please do not edit it.\n$\n$set 1\n";
+    "$ \n$ %s:\n$ This file is automatically generated; please do not edit it.\n$ \n$set 1\n";
 
 /* pathnames */
 char c_file[MAXPATHLEN];       /* output file */
@@ -340,7 +336,7 @@ int main (argc, argv) int argc; char **argv; {
        fputs ("    0\n};\n\n", cfile);
        fprintf(cfile,
                "static const struct error_table et = { text, %ldL, %d };\n\n",
-               table_number, current);
+               (long int) table_number, current);
        fputs("static struct et_list etlink = { 0, &et};\n\n", cfile);
        fprintf(cfile, "void initialize_%s_error_table (%s) {\n",
                table_name, (language == lang_C) ? "void" : "NOARGS");
@@ -357,7 +353,7 @@ int main (argc, argv) int argc; char **argv; {
     }
 
     fprintf (hfile, "#define ERROR_TABLE_BASE_%s (%ldL)\n",
-            table_name, table_number);
+            table_name, (long int) table_number);
     /* compatibility... */
     fprintf (hfile, "\n/* for compatibility with older versions... */\n");
     fprintf (hfile, "#define init_%s_err_tbl initialize_%s_error_table\n",
index 77d1aa00650db9becf538613fb6270f77b3fd926..7ade4285907af14b7e2c71597673119a4ebad453 100644 (file)
@@ -146,7 +146,7 @@ char *gensym(const char *x)
        }
        symbol = (char *)malloc(32 * sizeof(char));
        gensym_n++;
-       sprintf(symbol, "et%ld", gensym_n);
+       sprintf(symbol, "et%ld", (long int) gensym_n);
        return(symbol);
 }
 
@@ -236,7 +236,7 @@ void put_ecs(void)
        for (i = 0; i < current; i++) {
             if (error_codes[i] != (char *)NULL)
                  fprintf(hfile, "#define %-40s (%ldL)\n",
-                         error_codes[i], table_number + i);
+                         error_codes[i], (long int) table_number + i);
        }
 }
 
index 7671731a89cdb842ce3716df42050d02e9433bcf..7db068b2010ca9b2d9a5aef1dfdc82a09d5da38a 100644 (file)
@@ -11,7 +11,7 @@ end           return END;
 [\t\n\r ]              ;
 
 \"{PC}*\"      { register char *p; yylval.dynstr = ds((char *)yytext+1);
-                 if (p=strrchr(yylval.dynstr, '"')) *p='\0';
+                 if ((p=strrchr(yylval.dynstr, '"'))) *p='\0';
                  return QUOTED_STRING;
                }
 
index dc53cac59726819f3586da4830e1218525e47a26..5ead1347f67e5b89e9c0abf360cbb4c5d2a3b4b2 100644 (file)
@@ -1,7 +1,7 @@
 /* A lexical scanner generated by flex */\r
 \r
 /* Scanner skeleton version:\r
- * $Header: /tmp/cvstemp/openafs/src/comerr/et_lex.lex_nt.c,v 1.1.1.2 2001/01/19 20:54:19 hartmans Exp $\r
+ * $Header: /tmp/cvstemp/openafs/src/comerr/et_lex.lex_nt.c,v 1.1.1.3 2001/07/05 01:02:02 hartmans Exp $\r
  */\r
 \r
 #define FLEX_SCANNER\r
@@ -312,7 +312,7 @@ static yyconst short int yy_accept[36] =
 static yyconst int yy_ec[256] =\r
     {   0,\r
         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,\r
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\r
+        1,    1,    2,    1,    1,    1,    1,    1,    1,    1,\r
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\r
         1,    2,    1,    4,    5,    1,    1,    1,    1,    1,\r
         1,    1,    1,    1,    1,    1,    1,    6,    6,    6,\r
index 125069c1d72cf4c8817d8bd2324dc3ff8d9083e9..b83c73a6451b8df70a7d4c681b2ee75efd047837 100644 (file)
@@ -139,7 +139,8 @@ install: version install.noversion kinstall ukinstall
 # kernel include environment.  param.h is, well, param.h.  The afs_sysnames.h
 # file is needed by param.h to create unique identifiers for each SYS_TYPE.
 
-kinstall: lkversion config $(KDIRS) ${KERNELDIR}/afs/param.h \
+# lkversion
+kinstall: config $(KDIRS) ${KERNELDIR}/afs/param.h \
        ${KERNELDIR}/afs/stds.h \
        ${KERNELDIR}/afs/afs_sysnames.h \
        ${KERNELDIR}/config/Makefile.${SYS_NAME} \
@@ -156,4 +157,4 @@ ukinstall webinstall: $(DESTINCLS) config $(UKDIRS) ${UKERNELDIR}/afs/param.h ${
        ${UKERNELDIR}/afs/AFS_component_version_number.c
 
 clean:
-       $(RM) -f *.o config core xprt 
+       $(RM) -f *.o config core xprt AFS_component_version_number.c
index 81e6ac5c41530263458fca17a882ed905d6f92b8..9edc0ddf0c64e31582c39b10dd2915c8b8a93a13 100644 (file)
@@ -8,8 +8,8 @@
 AFS_component_version_number.o: AFS_component_version_number.c
 
 AFS_component_version_number.c: 
-       echo 'char cml_version_number[]="@(#) OpenAFS stable 1.0.4 built ' `date +"%Y-%m-%d"` '";' >AFS_component_version_number.c;
-       echo 'char* AFSVersion = "openafs stable 1.0.4"; ' >>AFS_component_version_number.c;
+       echo 'char cml_version_number[]="@(#) OpenAFS devel built ' `date +"%Y-%m-%d"` '";' >AFS_component_version_number.c;
+       echo 'char* AFSVersion = "openafs devel"; ' >>AFS_component_version_number.c;
 
 noversion: install
 
index 917e8cbfee88cf2c75426775f544db540a8bf60d..9d27966e789aae27968ee376b75d617ed0c338d1 100644 (file)
@@ -17,8 +17,6 @@ SRCROOT = ..\..\..\src
 !ERROR Can not find src directory from current directory.
 !ENDIF
 
-
-
 INCFILEDIR = $(DESTDIR)\include\afs
 
 INCFILES =\
@@ -28,12 +26,15 @@ INCFILES =\
        $(INCFILEDIR)\afs_sysnames.h \
        $(INCFILEDIR)\stds.h \
        $(INCFILEDIR)\icl.h 
-
+\r
 
 $(INCFILEDIR)\param.h: param.$(SYS_NAME).h
        $(COPY) $? $@
 
 idirs: doclink
+!      IF (!EXIST($(DESTDIR)))
+               $(MKDIR) $(DESTDIR)
+!      ENDIF
 !      IF (!EXIST($(DESTDIR)\include))
                $(MKDIR) $(DESTDIR)\include
 !      ENDIF
@@ -76,11 +77,42 @@ idirs: doclink
 !      IF (!EXIST($(DESTDIR)\root.server\usr\afs\bin))
                $(MKDIR) $(DESTDIR)\root.server\usr\afs\bin
 !      ENDIF
+!      IF (!EXIST($(DESTDIR)\root.client))
+               $(MKDIR) $(DESTDIR)\root.client
+!      ENDIF
+!      IF (!EXIST($(DESTDIR)\root.client\usr))
+               $(MKDIR) $(DESTDIR)\root.client\usr
+!      ENDIF
+!      IF (!EXIST($(DESTDIR)\root.client\usr\vice))
+               $(MKDIR) $(DESTDIR)\root.client\usr\vice
+!      ENDIF
 !      IF (!EXIST($(DESTDIR)\root.client\usr\vice\etc))
                $(MKDIR) $(DESTDIR)\root.client\usr\vice\etc
 !      ENDIF
 
-
+INCCOPY = \\r
+       $(DESTDIR)\bin\rmbat.bat \\r
+       $(DESTDIR)\bin\rmbat.rsp \\r
+       $(DESTDIR)\bin\NTBUILD.bat\r
+\r
+$(DESTDIR)\bin\rmbat.bat:..\rmbat.bat\r
+       $(COPY) $? $@
+       util_cr + $@
+\r
+$(DESTDIR)\bin\rmbat.rsp:..\rmbat.rsp\r
+       $(COPY) $? $@
+\r
+$(DESTDIR)\bin\NTBUILD.bat:..\NTBUILD.bat\r
+       $(COPY) $? $@
+       util_cr + $@
+\r
+$(DESTDIR)\bin\NTLang.bat: NTLang.bat util_cr.exe
+       $(COPY) NTLang.bat $(DESTDIR)\bin
+       util_cr + $(DESTDIR)\bin\NTLang.bat
+\r
+$(DESTDIR)\NTDllmap.txt:NTDllmap.txt\r
+       $(COPY) $? $@
+\r
 # Create link to docs needed for media build; allow to fail in case
 # symlink not available, e.g. if using a 3.4a client, since most builds
 # aren't media builds.
@@ -101,24 +133,42 @@ NTMakefile.version: NTMakefile.version-CML NTMakefile.version-NOCML
                $(COPY) NTMakefile.version-NOCML NTMakefile.version
 !      ENDIF
 
-$(DESTDIR)\bin\mkvers.exe: mkvers.exe
-       $(COPY) mkvers.exe $(DESTDIR)\bin
-
-
-$(DESTDIR)\NTDllmap.txt: NTDllmap.txt
-       $(COPY) NTDllmap.txt $(DESTDIR)
-
-
-$(DESTDIR)\bin\NTLang.bat: NTLang.bat
-       $(COPY) NTLang.bat $(DESTDIR)\bin
+INCTOOLS = \\r
+       $(DESTDIR)\bin\mkvers.exe \\r
+       $(DESTDIR)\bin\util_cr.exe \\r
+       $(DESTDIR)\bin\touch.exe\r
+\r
+#mkvers.exe : mkvers.obj
+#      $(EXECONLINK)
+\r
+$(DESTDIR)\bin\mkvers.exe:mkvers.exe\r
+       $(COPY) mkvers.exe $(DESTDIR)\bin\.
+
+$(DESTDIR)\bin\util_cr.exe:util_cr.exe\r
+       $(COPY) util_cr.exe $(DESTDIR)\bin\.
+\r
+util_cr.exe : util_cr.obj
+       $(EXECONLINK)
+\r
+$(DESTDIR)\bin\touch.exe:touch.exe\r
+       $(COPY) touch.exe $(DESTDIR)\bin\.
 
 langsetup: $(DESTDIR)\bin\NTLang.bat
 
+install: idirs $(INCTOOLS) $(INCCOPY) version $(INCFILES) $(DESTDIR)\NTDllmap.txt langsetup 
 
-install: idirs version $(INCFILES) $(DESTDIR)\NTDllmap.txt langsetup
-
+install9x: install
 
 # This clean target must be named something different than the universal
 # 'clean' so that the version file can be removed last.
 clean_version:
        $(DEL) NTMakefile.version
+
+clean::
+       $(DEL) $(DESTDIR)\LIB\*.DLL
+       $(DEL) $(DESTDIR)\bin\mkver.exe\r
+       $(DEL) $(DESTDIR)\bin\touch.exe\r
+       $(DEL) $(DESTDIR)\bin\util_cr.exe\r
+       $(DEL) mkver.exe\r
+       $(DEL) touch.exe\r
+       $(DEL) util_cr.exe
\ No newline at end of file
index c7707a50bdfbc1e330933431f6d30b5565382e8c..54b095fe7937894b40d32ee48f0d5b19ba1408cd 100644 (file)
@@ -113,7 +113,8 @@ DESTDIR = $(AFSROOT)\DEST
 
 # Command macros.
 COPY = copy
-DEL = del
+DEL = -del
+#DEL = $(DESTDIR)\BIN\rmbat       # win 98 must use batch file
 MKDIR = mkdir
 REN = ren
 ECHO = echo
@@ -128,8 +129,8 @@ MIDL  = midl
 # Common clean target.
 # Double colon (::) syntax allows supplemental clean target to be specified.
 clean::
-       $(DEL) *.obj *.lib *.dll *.exe
-       $(DEL) *_component_version_number.*
+       $(DEL) /q *.obj *.lib *.dll *.exe
+       $(DEL) /q *_component_version_number.*
 
 # Common lang target.
 # Double colon (::) syntax allows supplemental lang target to be specified.
index 43c2d89788dc7dca1969f3ab65ed00e74cb44975..51427adee7698c78447a3cf65339b60f563c0109 100644 (file)
@@ -38,6 +38,7 @@
 #define        AFSOP_GETIFADDRS         21     /* get machine's ethernet interfaces */
 
 #define        AFSOP_ADDCELL2           29     /* 2nd add cell protocol interface */
+#define        AFSOP_AFSDB_HANDLER      30     /* userspace AFSDB lookup handler */
 
 /* The range 20-30 is reserved for AFS system offsets in the afs_syscall */
 #define        AFSCALL_PIOCTL          20
index 0b4ebec6e51ea0d2ce89bf16d20526d2e4d3c812..84e3ef7fd666c7e176d06e951ea9119ea723f075 100644 (file)
 #define SYS_NAME_ID_ncrx86_30          1301
 
 #define SYS_NAME_ID_i386_nt35          1400
+#define SYS_NAME_ID_i386_win95 1401
 
 #define SYS_NAME_ID_i386_linux2                1500
 #define SYS_NAME_ID_i386_linux22       1501
 
 #define SYS_NAME_ID_sparc64_linux2     1800
 #define SYS_NAME_ID_sparc64_linux22    1801
+#define SYS_NAME_ID_sparc64_linux24    1802
 
 #define SYS_NAME_ID_s390_linux2         1900
 #define SYS_NAME_ID_s390_linux22        1901
index 82f3e36db33590723bb17404c188ba7d84aca7ac..192b33930ec61890543486369a555c646d3dec5b 100644 (file)
@@ -64,4 +64,4 @@
 #endif
 #define        ROOTINO         UFSROOTINO
 
-#endif _PARAM_SUN4C_51_H_
+#endif /* _PARAM_SUN4C_51_H_ */
index 217c58afbefd4428003ef1d4d7ad3dc6adbafddd..8053a8b99834d792a7f89fdd3015e084f9a7c34f 100644 (file)
@@ -6,6 +6,8 @@
 #define AFS_XBSD_ENV 1             /* {Free,Open,Net}BSD */
 #define AFS_X86_XBSD_ENV 1
 
+#define AFS_NAMEI_ENV     1   /* User space interface to file system */
+#define AFS_64BIT_IOPS_ENV 1  /* Needed for NAMEI */
 #define AFS_FBSD_ENV 1
 #define AFS_FBSD40_ENV 1
 #define AFS_FBSD42_ENV 1
@@ -14,7 +16,7 @@
 #define AFS_X86_FBSD42_ENV 1
 #define AFS_X86_ENV 1
 #define AFS_NONFSTRANS 1
-#define AFS_KERBEROS_ENV
+#define AFS_KERBEROS_ENV 1
 #define O_SYNC O_FSYNC
 #define FTRUNC O_TRUNC
 
 #define AFS_VFSINCL_ENV 1
 #define AFS_GREEDY43_ENV       1
 #define AFS_ENV        1
-#define AFS_MINPHYS_ENV        1
-#define CMUSTD_ENV     1
 
 #define AFS_SYSCALL    210
 #define AFS_MOUNT_AFS  "afs"
 
 #ifndef MOUNT_UFS
-#define MOUNT_UFS 1
+#define MOUNT_UFS "ufs"
 #endif
 
 #ifndef        MOUNT_AFS
 #define AFS_HAVE_FFS            1       /* Use system's ffs. */
 #define AFS_HAVE_STATVFS       0       /* System doesn't supports statvfs */
 
-#define AFS_GCPAGS             1       /* if nonzero, garbage collect PAGs */
-#define AFS_3DISPARES   1       /* Utilize the 3 available disk inode spares */
-#define AFS_USE_GETTIMEOFDAY 1  /* use gettimeofday to implement rx clock */
+#define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
+#define AFS_USE_GETTIMEOFDAY    1       /* use gettimeofday to implement rx clock */
 
-#if    !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
-#include <machine/endian.h>
-#if    BYTE_ORDER == BIG_ENDIAN
-#define        AFSBIG_ENDIAN           1
-#else
-#if    BYTE_ORDER == LITTLE_ENDIAN
-#define        AFSLITTLE_ENDIAN        1
-#else
-#error machine/endian.h must define BYTE_ORDER!
-#endif
-#endif
-#endif /* ! ASSEMBLER && ! __LANGUAGE_ASSEMBLY__ */
-
-#define NEARINODE_HINT  1 /* hint to ufs module to scatter inodes on disk*/
-#define nearInodeHash(volid, hval) {                          \
-                unsigned char*  ts = (unsigned char*)&(volid);\
-                for ((hval)=0; ts<(unsigned char*)&(volid)+sizeof(volid);ts++){\
-                    (hval) *= 173;                      \
-                    (hval) += *ts;                      \
-                }                                       \
-                }
+#define AFSLITTLE_ENDIAN 1
 
 /* Extra kernel definitions (from kdefs file) */
 #ifdef _KERNEL
index 184418b0b77642a60cd70bba912d92777b3ce631..2ef5ec2d188d06dc429736c9b768030f68578516 100644 (file)
 
 #define AFS_MOUNT_AFS "afs"    /* The name of the filesystem type. */
 #define AFS_SYSCALL 210
-#define AFS_64BIT_IOPS_ENV  1
-#define AFS_NAMEI_ENV     1   /* User space interface to file system */
+#define AFS_NAMEI_ENV         1   /* User space interface to file system */
+#define AFS_64BIT_IOPS_ENV    1   /* Needed for NAMEI */
 #include <afs/afs_sysnames.h>
 
 #define AFS_USERSPACE_IP_ADDR 1
-#define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
-
+#define RXK_LISTENER_ENV      1
+#define AFS_GCPAGS           0       /* if nonzero, garbage collect PAGs */
 
 /* Machine / Operating system information */
 #define SYS_NAME       "i386_fbsd_42"
index 394d1a9884c10a6ff1f3eadc641f799104c1cc97..01c1ab1ccce6332b5738ce6e3416de01130f2105 100644 (file)
@@ -17,7 +17,6 @@
 
 #define AFS_MOUNT_AFS "afs"    /* The name of the filesystem type. */
 #define AFS_SYSCALL 137
-#define AFS_64BIT_ENV
 #define AFS_64BIT_IOPS_ENV  1
 #define AFS_NAMEI_ENV     1   /* User space interface to file system */
 #include <afs/afs_sysnames.h>
index 9b11a9d6b88978587106512bbe3e160f969c0a9d..5ca03c87567089f3ae67429b9bb9e265df20b1a0 100644 (file)
@@ -56,4 +56,6 @@ typedef int ssize_t;
 typedef char * caddr_t;
 
 #define pipe(fdp)               _pipe(fdp, 4096, _O_BINARY)
+
+#define snprintf                _snprintf
 #endif /* _PARAM_NT35_H_ */
index 1640e9ba0819b32101bc9e65ee91638b5171272d..39b6621090b8019c17e6ee0bd3dc2a2349330bc0 100644 (file)
@@ -55,4 +55,4 @@
 #define VN_HOLD(vp)     VREF(((struct vnode *)(vp)))
 
 #endif
-#endif  _PARAM_PPC_DARWIN_H_
+#endif /* _PARAM_PPC_DARWIN_H_ */
index 6402debc395cdbe69ca44815fde51317518575f3..328b77eaeeef63ccecfbf9a060b809b7038dcfff 100644 (file)
@@ -43,4 +43,4 @@
 #define CMSERVERPREF
 #endif
 
-#endif  _PARAM_PPC_DARWIN_H_
+#endif /* _PARAM_PPC_DARWIN_H_ */
index 1afb00bd558a56d659c10d9d1140952de8fd59f1..e04c6051e26b4451162854bcb44314e31f3046e7 100644 (file)
@@ -57,4 +57,4 @@
 #define VN_HOLD(vp)     VREF(((struct vnode *)(vp)))
 
 #endif
-#endif  _PARAM_PPC_DARWIN_H_
+#endif /* _PARAM_PPC_DARWIN_H_ */
index ec6f03dfdafc9b9f3e5be9f7f6da47c776c8ee57..80664b2778f7e5a7b545f0bdfd585447b61f3f25 100644 (file)
@@ -45,4 +45,4 @@
 #define CMSERVERPREF
 #endif
 
-#endif  _PARAM_PPC_DARWIN_H_
+#endif /* _PARAM_PPC_DARWIN_H_ */
index f9fbb048d363cbc92b732dda625c9e9935f388eb..d3546712ec2c050b5309c4e9e73f97918b83c0ff 100644 (file)
 #define AFS_SYSCALL 137
 #define AFS_64BIT_IOPS_ENV  1
 #define AFS_NAMEI_ENV     1   /* User space interface to file system */
-#include <afs/afs_sysnames.h>
-
-#define AFS_USERSPACE_IP_ADDR 1
-#define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
-
-
-/* Machine / Operating system information */
-#define SYS_NAME       "s390_linux22"
-#define SYS_NAME_ID    SYS_NAME_ID_s390_linux22
-#define AFSBIG_ENDIAN    1
-#define AFS_HAVE_FFS        1       /* Use system's ffs. */
-#define AFS_HAVE_STATVFS    0  /* System doesn't support statvfs */
-#define AFS_VM_RDWR_ENV            1   /* read/write implemented via VM */
 
 #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
 #include <linux/config.h>
 #ifndef CONFIG_S390_LOCAL_APIC
 #define CONFIG_S390_LOCAL_APIC
 #endif
+#ifndef __SMP__
 #define __SMP__
+#endif
 #define AFS_GLOBAL_SUNLOCK
 #endif
 
+#if defined(MODULE) && defined(CONFIG_MODVERSIONS)
+#define MODVERSIONS
+#include <linux/modversions.h>
+#endif
+
 #endif /* __KERNEL__  && !DUMP_KERNEL*/
 
+#include <afs/afs_sysnames.h>
+
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
+
+/* Machine / Operating system information */
+#define SYS_NAME       "s390_linux22"
+#define SYS_NAME_ID    SYS_NAME_ID_s390_linux22
+#define AFSBIG_ENDIAN    1
+#define AFS_HAVE_FFS        1       /* Use system's ffs. */
+#define AFS_HAVE_STATVFS    0  /* System doesn't support statvfs */
+#define AFS_VM_RDWR_ENV            1   /* read/write implemented via VM */
+
 #ifdef KERNEL
 #ifndef MIN
 #define MIN(A,B) ((A) < (B) ? (A) : (B))
index d1a0f33e5d8a948e4ec22916f90af73b80feb1a2..bfad800cba1556ea30d687b19ec1c2669413ff2f 100644 (file)
 #define        AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
 #define        AFS_KFREE       kmem_free
 #define        VATTR_NULL      vattr_null
-#endif KERNEL
+#endif /* KERNEL */
 #define        AFS_DIRENT      
 #ifndef CMSERVERPREF
 #define CMSERVERPREF
 #endif
 #define        ROOTINO         UFSROOTINO
 
-#endif _PARAM_SUN4C_51_H_
+#endif /* _PARAM_SUN4C_51_H_ */
index 4d91b0c0aee58239a8cf1bfaed03e48853828c3b..c874d2431abd94b891ec50387ff2e1e716f635c4 100644 (file)
@@ -62,4 +62,4 @@
 #endif
 #define        ROOTINO         UFSROOTINO
 
-#endif _PARAM_SUN4C_51_H_
+#endif /* _PARAM_SUN4C_51_H_ */
index 3d75ebf8ac91551918db9f747a963414673368c0..195e6e5a76185cce1339555127aa3ea591bfa343 100644 (file)
 #define AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
 #define        AFS_KFREE       kmem_free
 #define        VATTR_NULL      vattr_null
-#endif KERNEL
+#endif /* KERNEL */
 #define        AFS_DIRENT      
 #ifndef CMSERVERPREF
 #define CMSERVERPREF
 #endif
 #define        ROOTINO         UFSROOTINO
 
-#endif _PARAM_SUN4X_56_H_
+#endif /* _PARAM_SUN4X_56_H_ */
index c60427dfe7be343758efd995acdef8fc0da41545..39f43d5e6e7df01bb571835ae5bb144858493a83 100644 (file)
@@ -63,4 +63,4 @@
 #endif
 #define        ROOTINO         UFSROOTINO
 
-#endif _PARAM_SUN4C_51_H_
+#endif /* _PARAM_SUN4C_51_H_ */
index 92406bef87e0bd3715766ca9f734ce2db7924148..0c679a7602ea533b6ea2f98f28b7f74537c971d0 100644 (file)
 #define AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
 #define        AFS_KFREE       kmem_free
 #define        VATTR_NULL      vattr_null
-#endif KERNEL
+#endif /* KERNEL */
 #define        AFS_DIRENT      
 #ifndef CMSERVERPREF
 #define CMSERVERPREF
 #endif
 #define        ROOTINO         UFSROOTINO
 
-#endif _PARAM_SUN4X_57_H_
+#endif /* _PARAM_SUN4X_57_H_ */
index 12828995e0ddfcfc33d14302c4cae02f7cf0f3fe..c2a33d69ea588402d4459853cc0688bdc7b8d00f 100644 (file)
@@ -63,4 +63,4 @@
 #endif
 #define        ROOTINO         UFSROOTINO
 
-#endif _PARAM_SUN4C_51_H_
+#endif /* _PARAM_SUN4C_51_H_ */
index fbee6f77a14236ad4e8938cba3c8f2f298827ef4..5e48cf7dc89ad561919612fef667cc4192381a88 100644 (file)
 #define AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
 #define        AFS_KFREE       kmem_free
 #define        VATTR_NULL      vattr_null
-#endif KERNEL
+#endif /* KERNEL */
 #define        AFS_DIRENT      
 #ifndef CMSERVERPREF
 #define CMSERVERPREF
 #endif
 #define        ROOTINO         UFSROOTINO
 
-#endif _PARAM_SUN4X_58_H_
+#endif /* _PARAM_SUN4X_58_H_ */
index 9de7672d4fd523a690a4966487c1f1906ff467b2..1147ef3403b2df46906a314694e4909cc35a4372 100644 (file)
@@ -56,4 +56,4 @@
 #endif
 #define        ROOTINO         UFSROOTINO
 
-#endif _PARAM_SUN4X_58_H_
+#endif /* _PARAM_SUN4X_58_H_ */
index bee1c1dc9f1d69f7c1d0573561389ba585a4959e..e3e2ce05341851bfc660a15ee1fc674d9aecf7e5 100644 (file)
@@ -64,7 +64,7 @@
 #define        AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
 #define        AFS_KFREE       kmem_free
 #define        VATTR_NULL      vattr_null
-#endif KERNEL
+#endif /* KERNEL */
 #define        AFS_DIRENT      
 #ifndef CMSERVERPREF
 #define CMSERVERPREF
@@ -72,4 +72,4 @@
 #define        ROOTINO         UFSROOTINO
 
 
-#endif _PARAM_SUN4C_51_H_
+#endif /* _PARAM_SUN4C_51_H_ */
index 9fd72fc9236f6dffaf1d5e6f88b5102cb7f61f45..2e428afaa261195b0af28c38c67b5ab10c6971dd 100644 (file)
@@ -50,7 +50,7 @@ noversion:    install
 all:           dlog dpass
 
 clean:
-               rm -f adkint.h adkint.cs.c adkint.ss.c adkint.xdr.c *.o dlog
+               rm -f adkint.h adkint.cs.c adkint.ss.c adkint.xdr.c *.o dlog dpass AFS_component_version_number.c
 
 adkint.cs.o:   adkint.cs.c
 adkint.xdr.o:  adkint.xdr.c adkint.h
index a3c6b06a75557109b208246154fd4de7e6e28a7d..f643bebf531f6d11239bd846bc5342d76643fa27 100644 (file)
@@ -36,8 +36,8 @@ DBG   =
 GPROF  =
 # by default do not try to hide entry points
 F_CC   = -c ${GPROF} ${DBG} ${XCFLAGS}
-F_CPP  = -I${K_INC} -I.
-MK_STR = "     \$${CC} -I\$${SRC} \$${F_CPP} \$${F_CC}"
+F_CPP  = -I${K_INC} -I. -I${TOP_SRCDIR}/config 
+MK_STR = "     \$${CC} -I\$${SRC} \$${F_CPP} \$${F_CC}" -I${TOP_SRCDIR}/config 
 LDFLAGS = ${XLDFLAGS}
 
 # dont use optimizer, since it pessimizes on uvax2,
@@ -125,12 +125,14 @@ GPROGS    = \
        make_p_table \
        make_s_table \
        make_odd \
-       make_e \
        make_p \
        make_s \
        make_fp \
-       make_ip \
-       misc
+       make_ip
+
+XGPROGS = \
+       misc \
+       make_e
 
 # Library component lists.
 
@@ -162,6 +164,8 @@ noversion: install
 
 all:   ${GFILES} ${CFILES} ${DEP_LIBS}
 
+gprogs: ${GPROGS}
+
 test: 
        cd test; $(MAKE)
 
@@ -179,11 +183,11 @@ ${DESTDIR}lib/libdes.a: libdes.a
        ${INSTALL} $? $@
 
 install install.noversion: all ukinstall ${DESTDIR}lib/libdes.a
-       ${INSTALL} des.h des_conf.h mit-cpyright.h ${DESTDIR}include
+       ${INSTALL} des.h des_conf.h mit-cpyright.h crypt.h ${DESTDIR}include
        ${INSTALL} odd.h ${DESTDIR}include/des_odd.h
 
 clean:
-       rm -f ${OBJECTS} ${DEP_LIBS} ${PROGS} ${GPROGS} ${GFILES} AFS_component_version_number.c
+       rm -f ${OBJECTS} ${DEP_LIBS} ${PROGS} ${GPROGS} ${GFILES} AFS_component_version_number.c misco.c
        rm -f *.s *.o *.b core *~ *.com *.ld
        rm -f tags TAGS ${LLIB}
 
@@ -367,6 +371,7 @@ strng_to_key.o: des.h
 strng_to_key.o: mit-cpyright.h
 strng_to_key.o: des_conf.h ./odd.h
 debug_decl.o: debug_decl.c
+make_e.o: make_e.c
 make_keyperm.o:
        ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_keyperm.c
 make_ip.o:
@@ -395,6 +400,8 @@ key_test.o:
        ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/key_test.c
 testit.o:
        ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/testit.c
+crypt.o:
+       ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/crypt.c
 des.o:
        ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/des.c
 cbc_encrypt.o:
@@ -423,5 +430,7 @@ strng_to_key.o:
        ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/strng_to_key.c
 debug_decl.o:
        ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/debug_decl.c
+make_e.o:
+       ${CC} -I${SRC} ${F_CPP} ${F_CC} ${SRC}/make_e.c
 # DEPENDENCIES MUST END AT END OF FILE
 # IF YOU PUT STUFF HERE IT WILL GO AWAY (see make depend above)
index 78e4e1d7214a6b93233cf78f8b01f768c9ed3d9b..ee9e41e70506c6dd94692f38002c3c80b688c2b7 100644 (file)
@@ -138,3 +138,8 @@ make_ip.exe: make_ip.obj misc.obj
        $(EXECONLINK)
 
 install: $(GENERATED_FILES) $(LIBFILE) $(INCFILES)
+
+install9x: install
+
+clean::
+       $(DEL) $(LIBFILE)
\ No newline at end of file
index 0f9d238e47c238c24b9920fd41001c9152554158..ed4cc4ab8ae3f70d2496f5c70bc3df0501f49889 100644 (file)
@@ -3,6 +3,7 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #ifdef vax
 #include "conf-bsdvax.h"
 #else
@@ -40,7 +41,7 @@
 #ifdef AFS_NT40_ENV
 #include "conf-winnt.h"
 #else
-#ifdef AFS_LINUX20_ENV
+#if defined(AFS_LINUX20_ENV) || defined(AFS_DJGPP_ENV)
 #ifdef AFS_PPC_LINUX20_ENV
 #include "conf-ppc-linux.h"
 #else
index e85add71030da932fedc160a7f5306edfe0b5e28..224435666d7d5eb6f3b943a42126676e56252e15 100644 (file)
 #include <afs/param.h>
 #include <mit-cpyright.h>
 #include <stdio.h>
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
-#include <string.h>
-#else
+#if defined(HAVE_STRINGS_H)
 #include <strings.h>
 #endif
+#if defined(HAVE_STRING_H)
+#include <string.h>
+#endif
 
 #include <des.h>
 #include "des_internal.h"
index e967252186734eae40efabc05091d022984624d2..d60375c50be50621a4e8046a6cd83aa30d8a57eb 100644 (file)
@@ -42,7 +42,12 @@ static char sccsid[] = "@(#)crypt.c  5.11 (Berkeley) 6/25/91";
 #include <windows.h>
 #endif
 #include <stdlib.h>
+#if defined(HAVE_STRINGS_H)
+#include <strings.h>
+#endif
+#if defined(HAVE_STRING_H)
 #include <string.h>
+#endif
 
 /*
  * UNIX password, and DES, encryption.
@@ -383,45 +388,45 @@ static unsigned char PC2[] = {            /* permuted choice table 2 */
 
 static unsigned char S[8][64] = {      /* 48->32 bit substitution tables */
                                        /* S[1]                 */
-       14,  4, 13,  1,  2, 15, 11,  8,  3, 10,  6, 12,  5,  9,  0,  7,
+{      14,  4, 13,  1,  2, 15, 11,  8,  3, 10,  6, 12,  5,  9,  0,  7,
         0, 15,  7,  4, 14,  2, 13,  1, 10,  6, 12, 11,  9,  5,  3,  8,
         4,  1, 14,  8, 13,  6,  2, 11, 15, 12,  9,  7,  3, 10,  5,  0,
-       15, 12,  8,  2,  4,  9,  1,  7,  5, 11,  3, 14, 10,  0,  6, 13,
+       15, 12,  8,  2,  4,  9,  1,  7,  5, 11,  3, 14, 10,  0,  6, 13, },
                                        /* S[2]                 */
-       15,  1,  8, 14,  6, 11,  3,  4,  9,  7,  2, 13, 12,  0,  5, 10,
+{      15,  1,  8, 14,  6, 11,  3,  4,  9,  7,  2, 13, 12,  0,  5, 10,
         3, 13,  4,  7, 15,  2,  8, 14, 12,  0,  1, 10,  6,  9, 11,  5,
         0, 14,  7, 11, 10,  4, 13,  1,  5,  8, 12,  6,  9,  3,  2, 15,
-       13,  8, 10,  1,  3, 15,  4,  2, 11,  6,  7, 12,  0,  5, 14,  9,
+       13,  8, 10,  1,  3, 15,  4,  2, 11,  6,  7, 12,  0,  5, 14,  9, },
                                        /* S[3]                 */
-       10,  0,  9, 14,  6,  3, 15,  5,  1, 13, 12,  7, 11,  4,  2,  8,
+{      10,  0,  9, 14,  6,  3, 15,  5,  1, 13, 12,  7, 11,  4,  2,  8,
        13,  7,  0,  9,  3,  4,  6, 10,  2,  8,  5, 14, 12, 11, 15,  1,
        13,  6,  4,  9,  8, 15,  3,  0, 11,  1,  2, 12,  5, 10, 14,  7,
-        1, 10, 13,  0,  6,  9,  8,  7,  4, 15, 14,  3, 11,  5,  2, 12,
+        1, 10, 13,  0,  6,  9,  8,  7,  4, 15, 14,  3, 11,  5,  2, 12, },
                                        /* S[4]                 */
-        7, 13, 14,  3,  0,  6,  9, 10,  1,  2,  8,  5, 11, 12,  4, 15,
+{       7, 13, 14,  3,  0,  6,  9, 10,  1,  2,  8,  5, 11, 12,  4, 15,
        13,  8, 11,  5,  6, 15,  0,  3,  4,  7,  2, 12,  1, 10, 14,  9,
        10,  6,  9,  0, 12, 11,  7, 13, 15,  1,  3, 14,  5,  2,  8,  4,
-        3, 15,  0,  6, 10,  1, 13,  8,  9,  4,  5, 11, 12,  7,  2, 14,
+        3, 15,  0,  6, 10,  1, 13,  8,  9,  4,  5, 11, 12,  7,  2, 14, },
                                        /* S[5]                 */
-        2, 12,  4,  1,  7, 10, 11,  6,  8,  5,  3, 15, 13,  0, 14,  9,
+{       2, 12,  4,  1,  7, 10, 11,  6,  8,  5,  3, 15, 13,  0, 14,  9,
        14, 11,  2, 12,  4,  7, 13,  1,  5,  0, 15, 10,  3,  9,  8,  6,
         4,  2,  1, 11, 10, 13,  7,  8, 15,  9, 12,  5,  6,  3,  0, 14,
-       11,  8, 12,  7,  1, 14,  2, 13,  6, 15,  0,  9, 10,  4,  5,  3,
+       11,  8, 12,  7,  1, 14,  2, 13,  6, 15,  0,  9, 10,  4,  5,  3, },
                                        /* S[6]                 */
-       12,  1, 10, 15,  9,  2,  6,  8,  0, 13,  3,  4, 14,  7,  5, 11,
+{      12,  1, 10, 15,  9,  2,  6,  8,  0, 13,  3,  4, 14,  7,  5, 11,
        10, 15,  4,  2,  7, 12,  9,  5,  6,  1, 13, 14,  0, 11,  3,  8,
         9, 14, 15,  5,  2,  8, 12,  3,  7,  0,  4, 10,  1, 13, 11,  6,
-        4,  3,  2, 12,  9,  5, 15, 10, 11, 14,  1,  7,  6,  0,  8, 13,
+        4,  3,  2, 12,  9,  5, 15, 10, 11, 14,  1,  7,  6,  0,  8, 13, },
                                        /* S[7]                 */
-        4, 11,  2, 14, 15,  0,  8, 13,  3, 12,  9,  7,  5, 10,  6,  1,
+{       4, 11,  2, 14, 15,  0,  8, 13,  3, 12,  9,  7,  5, 10,  6,  1,
        13,  0, 11,  7,  4,  9,  1, 10, 14,  3,  5, 12,  2, 15,  8,  6,
         1,  4, 11, 13, 12,  3,  7, 14, 10, 15,  6,  8,  0,  5,  9,  2,
-        6, 11, 13,  8,  1,  4, 10,  7,  9,  5,  0, 15, 14,  2,  3, 12,
+        6, 11, 13,  8,  1,  4, 10,  7,  9,  5,  0, 15, 14,  2,  3, 12, },
                                        /* S[8]                 */
-       13,  2,  8,  4,  6, 15, 11,  1, 10,  9,  3, 14,  5,  0, 12,  7,
+{      13,  2,  8,  4,  6, 15, 11,  1, 10,  9,  3, 14,  5,  0, 12,  7,
         1, 15, 13,  8, 10,  3,  7,  4, 12,  5,  6, 11,  0, 14,  9,  2,
         7, 11,  4,  1,  9, 12, 14,  2,  0,  6, 10, 13, 15,  3,  5,  8,
-        2,  1, 14,  7,  4, 10,  8, 13, 15, 12,  9,  0,  3,  5,  6, 11,
+        2,  1, 14,  7,  4, 10,  8, 13, 15, 12,  9,  0,  3,  5,  6, 11, }
 };
 
 static unsigned char P32Tr[] = {       /* 32-bit permutation function */
@@ -909,6 +914,7 @@ void init_perm(perm, p, chars_in, chars_out)
 /*
  * "setkey" routine (for backwards compatibility)
  */
+#if 0 /* static and doesn't appear to be referenced */
 STATIC
 int setkey(key)
        register const char *key;
@@ -926,11 +932,12 @@ int setkey(key)
        }
        return (des_setkey((char *)keyblock.b));
 }
+#endif
 
 /*
  * "encrypt" routine (for backwards compatibility)
  */
-encrypt(block, flag)
+int encrypt(block, flag)
        register char *block;
        int flag;
 {
index d2248ffd3542e0809131989941aee9128b35b1e9..a86fe445c0cd0feacd3b64aa3208eb7a749522e7 100644 (file)
@@ -53,7 +53,7 @@ void gen(stream)
        for (j = 0; j < 64; j++) {
            fprintf(stream,"\n");
            for (k = 0; k < 4; k++) {
-               fprintf(stream,"0x%08X",P_prime[i][j*4+k]);
+               fprintf(stream,"0x%08lX",P_prime[i][j*4+k]);
                if ((j == 63) && (k == 3))
                    fprintf(stream, "}");
                if ((i == 3) && (j == 63) && (k == 3))
index 3dfe74b49496b8e928b80c81c3f848fdf96fd848..e53779f6cc47510a8a8bb656062e33a8b536c912 100644 (file)
@@ -46,7 +46,7 @@ void gen(stream)
             n = swap_four_bits_to_ansi(m);
             if (des_debug)
                 fprintf(stderr,
-                "i = %d, j = %d, k = %d, l = %d, m = %d, n = %d\n",
+                "i = %ld, j = %ld, k = %ld, l = %ld, m = %ld, n = %ld\n",
                         i,j,k,l,m,n);
             temp[i][j] = n;
         }
index b4206267b54380c9a0cbf4fc19e461f8063f9305..557a8fec9328f02e0eaa44a3481500fa90a2e44d 100644 (file)
 #include <mit-cpyright.h>
 
 #include <afs/param.h>
+#include <des.h>
+#include "des_internal.h"
 #ifdef AFS_PTHREAD_ENV
 #include <pthread.h>
 #endif
+#if defined(HAVE_STRINGS_H)
+#include <strings.h>
+#endif
+#if defined(HAVE_STRING_H)
 #include <string.h>
-#include <des.h>
-#include "des_internal.h"
+#endif
 #include "stats.h"
 
 extern void des_fixup_key_parity();
@@ -95,7 +100,7 @@ des_random_key(key)
  *
  * Note: this routine calls des_set_random_generator_seed.
  */
-#if !defined(BSDUNIX) && !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
+#if !defined(BSDUNIX) && !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_DJGPP_ENV)
   you lose...   (aka, you get to implement an analog of this for your
                 system...)
 #else
@@ -124,7 +129,7 @@ void des_init_random_number_generator(key)
      * use a host id and process id in generating the seed to ensure
      * that different servers have different streams:
      */
-#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV)
+#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
     seed.host_id = gethostid();
 #endif
     seed.process_id = getpid();
index da2859699405e19efa4303f2b3cea26f8f87905b..7eab559e9c0695866fabcffa0619298bcf5f545a 100644 (file)
@@ -139,7 +139,7 @@ des_quad_cksum(in,out,length,out_count,c_seed)
            z  = ((x * x) + (x2 * x2)) % 0x7fffffff;
            z2 = (x * (x2+83653421))   % 0x7fffffff; /* modulo */
            if (des_debug & 8)
-               printf("%d %d\n",z,z2);
+               printf("%ld %ld\n",z,z2);
        }
 
        if (out != NULL) {
index 4fd9e8175b67943f0062ff8c85ed4b21ee336d7d..9cbe55868d91494b0505f63a8c26b41fcd906004 100644 (file)
 #include "conf.h"
 
 #include <stdio.h>
-
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
-#include <string.h>
-#else
+#if defined(HAVE_STRINGS_H)
 #include <strings.h>
 #endif
+#if defined(HAVE_STRING_H)
+#include <string.h>
+#endif
 
 #ifdef BSDUNIX
 #ifdef AFS_SUN5_ENV
 #define BSD_COMP
 #endif
-#if defined(AFS_FBSD_ENV)
-#define USE_OLD_TTY
-#endif
 #include <sys/ioctl.h>
 #include <signal.h>
 #include <setjmp.h>
 #endif
 
-#if defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#ifdef HAVE_SIGNAL_H
 #include <signal.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
 static int intrupt;
 #endif
 
-#if defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
+#ifdef HAVE_TERMIOS_H
 #include <termios.h>
 #endif
 
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
-#include <termios.h>
-#endif
-#ifdef AFS_NT40_ENV
+#ifdef HAVE_WINDOWS_H
 #include <windows.h>
 #endif
 
 static int intrupt;
-#if defined(AFS_SGI_ENV) || defined (AFS_AIX_ENV) /*|| defined (AFS_HPUX_ENV) || defined(AFS_SUN5_ENV)*/
+#if defined(AFS_SGI_ENV) || defined (AFS_AIX_ENV) || defined(AFS_FBSD_ENV) /*|| defined (AFS_HPUX_ENV) || defined(AFS_SUN5_ENV)*/
 #undef BSDUNIX
 #endif
 
@@ -137,7 +134,7 @@ des_read_pw_string(s,maxa,prompt,verify)
     struct sigaction newsig, oldsig;
     struct termios save_ttyb, ttyb;
 #endif
-#if defined(AFS_DARWIN_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
     FILE *fi;
 #endif
 #if    defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
@@ -308,7 +305,7 @@ lose:
     if (!ok)
        bzero(s, maxa);
     printf("\n");
-#ifdef AFS_HPUX_ENV
+#if defined(AFS_HPUX_ENV) || defined(AFS_FBSD_ENV)
     /*
      * Restore the terminal to its previous characteristics.
      * Restore the old signal handler for SIGINT.
index d821e1696256e41d91429bc4555348628171fa14..43ee72bc4d1b3cbc19fd068f4e115d58f0c44909 100644 (file)
 
 #include <mit-cpyright.h>
 #include <stdio.h>
-#include <string.h>
 #include <afs/param.h>
 #include <des.h>
 #include "des_internal.h"
+#if defined(HAVE_STRINGS_H)
+#include <strings.h>
+#endif
+#if defined(HAVE_STRING_H)
+#include <string.h>
+#endif
 
 extern int des_debug;
 extern int des_debug_print();
@@ -114,7 +119,7 @@ des_string_to_key(str,key)
 
     if (des_debug)
        fprintf(stdout,
-               "\nResulting string_to_key = 0x%x 0x%x\n",
+               "\nResulting string_to_key = 0x%lx 0x%lx\n",
                *((afs_uint32 *) key),
                *((afs_uint32 *) key+1));
 }
index c6c82bd312b3191cc3485ec61bd06b60b2e94e17..92e162352da1a45c3b86d17a6db44a64fe41d460 100644 (file)
@@ -8,10 +8,6 @@
  *                     -1 ==> error
  */
 
-#ifndef        lint
-static char rcsid_key_test_c[] =
-#endif lint
-
 #include <mit-cpyright.h>
 #include <stdio.h>
 #include <errno.h>
index b7d2610b2339ce6dbb8b58368281c495d80df4c6..ee0925929d0a80819a3010288fa71cbd162eca70 100644 (file)
@@ -8,10 +8,6 @@
  *             -1 ==> error
  */
 
-#ifndef        lint
-static char rcsid_testit_c[] =
-#endif lint
-
 #include <mit-cpyright.h>
 #include <stdio.h>
 #include <errno.h>
index dd485823de9f47c4dc2e4751187db3c5ef78ea06..e115dfa582c7da334954d749579153f9d1a54619 100644 (file)
  *             -1 ==> error
  */
 
-#ifndef        lint
-static char rcsid_verify_c[] =
-#endif lint
-
 #include <mit-cpyright.h>
 #include <stdio.h>
 #include <errno.h>
index 0ebe45aaabee87665f717fba46283c896e8a1d15..0b6b4d7e3d9cef41afa2b6df420a5198bb2dc367 100644 (file)
  * Originally written 8/85 by Steve Miller, MIT Project Athena.
  */
 
-#include <string.h>
 #include <des.h>
 #include "des_internal.h"
+#if defined(HAVE_STRINGS_H)
+#include <strings.h>
+#endif
+#if defined(HAVE_STRING_H)
+#include <string.h>
+#endif
 
 /*
  * The following are the weak DES keys:
index 7205f809544458c4fde88c15d851ddf8fcb55fb2..2231c7bf6ddf83579c4eccd2bde417c58c388dfa 100644 (file)
@@ -54,3 +54,4 @@ $(DESTDIR)\lib\afsdes.lib: $(DESPAR)\lib\afsdes.lib
 install: $(LIBFILES) $(INCFILES)
 
 clean::
+        $(DEL) $(DESPAR)\lib\afsdes.lib
\ No newline at end of file
index 69e9aa33fb30013b73981973a8d05f75be90927a..e28dad71b511b7f189189200c651c1824d1fe903 100644 (file)
@@ -13,7 +13,7 @@ KERNELDIR = ../libafs/
 UKERNELDIR = ../libuafs/
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
-INCDIRS= -I${DESTDIR}include ${XINCLS}
+INCDIRS= -I${TOP_SRCDIR}/config -I${DESTDIR}include ${XINCLS}
 CFLAGS = ${OPTMZ} ${INCDIRS} ${XCFLAGS}
 
 OBJS=buffer.o dir.o salvage.o
index b6c7a4980dba7a6ba1cdb90c7d9dc85cc5b6bf7a..d7f809aed66f5b3e794845f1e98f2c06686974d4 100644 (file)
@@ -41,6 +41,7 @@
 #include <afs/vlserver.h>
 #include <afs/pterror.h>
 #include <afs/bnode.h>
+#include <afs/volser.h>
 #include <ubik.h>
 #ifdef AFS_AIX32_ENV
 #include <signal.h>
@@ -51,6 +52,7 @@
 
 #include "AFS_component_version_number.c"
 
+int
 main (argc, argv)
   int   argc;
   char *argv[];
@@ -93,7 +95,7 @@ main (argc, argv)
        code = atoi(argv[i]);
        offset = code & ((1<<ERRCODE_RANGE)-1);
 
-       printf ("%d (%s).%d = %s\n", code, error_table_name (code), offset,
+       printf ("%d (%s).%d = %s\n", (int) code, error_table_name (code), (int) offset,
                error_message (code));
     }
     return 0;
index ee8288e1fb727130880f7f86d7bb4500c0d9db4f..ae7665db8d8ad5a6666b724843440e21c1a59a73 100644 (file)
@@ -28,7 +28,7 @@ all: libafsint.a $(KSRCS)
 
 libafsint.a: ${OBJS} AFS_component_version_number.o
        -rm -f $@
-       ar rv $@ ${OBJS} AFS_component_version_number.o
+       $(AR) rv $@ ${OBJS} AFS_component_version_number.o
        $(RANLIB) $@
 
 afsaux.o: afsaux.c afsint.h
@@ -103,4 +103,4 @@ install:  all  kinstall ukinstall
        ${INSTALL} afscbint.h ${DESTDIR}include/afs
 
 clean:
-       rm -f *.o *.cs.c *.ss.c *.er.c afsint.h afsint.xdr.c libafsint.a $(KDSRCS) core AFS_component_version_number.c
+       rm -f *.o *.cs.c *.ss.c *.er.c afsint.h afsint.xdr.c libafsint.a $(KDSRCS) core AFS_component_version_number.c afscbint.xdr.c
index e07c8b174ce1379b84a2becbee82795cbfc2f83a..1bb8e99872dca34113c49cafeecc323cbeb5ef8e 100644 (file)
@@ -6,7 +6,9 @@
 # directory or online at http://www.openafs.org/dl/license10.html
 
 !INCLUDE ..\config\NTMakefile.$(SYS_NAME)
+!IF (EXIST(..\config\NTMakefile.version))
 !INCLUDE ..\config\NTMakefile.version
+!ENDIF
 
 # Definitions for installing header files
 
@@ -81,5 +83,7 @@ $(MT_LIBFILE): $(MT_LIBOBJS)
 
 install: $(LIBFILE) $(INCFILES) $(MT_LIBFILE)
 
+install9x: install
+
 clean::
        $(DEL) *.cs.c *.ss.c *.xdr.c afsint.h afscbint.h
index 5f2e4a7b7853fd37b650eecbb41765e54306468f..e839aab5c94e99d710a03b6ae0e7545b75a00ee3 100644 (file)
@@ -70,7 +70,7 @@ test tests: install
        cd test; $(MAKE)
 
 clean:
-       rm -f *.o kaserver kas klog multiklog kpasswd klogin rebuild kauth.cs.c kauth.ss.c kauth.xdr.c kauth.h kautils.h kaerrors.c *.a core kpwvalid AFS_component_version_number.c
+       rm -f *.o kaserver kas klog multiklog kpasswd klogin rebuild kauth.cs.c kauth.ss.c kauth.xdr.c kauth.h kautils.h kaerrors.c *.a core kpwvalid AFS_component_version_number.c klog.krb knfs klogin.krb kdb Kkauth.xdr.c Kkauth.h 
 
 kaserver: kautils.o kalocalcell.o kadatabase.o kaprocs.o kalog.o kauth.ss.o kauth.xdr.o kaserver.o kaaux.o krb_udp.o kaauxdb.o $(LIBS) ${auditlib}
        ${CC} ${LDFLAGS} -o kaserver kaserver.o kautils.o kalocalcell.o kadatabase.o krb_udp.o kaprocs.o kalog.o kauth.ss.o kauth.xdr.o kaaux.o kaauxdb.o $(LIBS) ${XLIBS} ${auditlib}
index d769406e8d03bd9fff07ec93db5deebb0e230d79..7a48d4c06d924842bfccadb015d27834443c104e 100644 (file)
@@ -8,7 +8,7 @@
 # Override default definitions in NTMakefile.$(SYS_NAME) before including.
 
 !INCLUDE ..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\config\NTMakefile.version
+!include ..\config\NTMakefile.version
 
 
 ############################################################################
@@ -205,6 +205,9 @@ install: $(INCFILES) $(KAUTH_LIBFILE) $(KAUTH_KRB_LIBFILE) $(KASERVER) $(KAS) \
        kpwvalid.exe rebuild.exe  \
        $(DESTDIR)\etc\kas.exe
 
+install9X: $(INCFILES) $(KAUTH_LIBFILE) $(KAUTH_KRB_LIBFILE) \
+       $(KPASSWD_EXEFILE) 
+
 # installation targets that depend on local targets
 $(DESTDIR)\etc\kas.exe:  $(DESTDIR)\root.server\usr\afs\bin\kas.exe
        $(COPY) $(DESTDIR)\root.server\usr\afs\bin\kas.exe \
@@ -215,7 +218,7 @@ $(DESTDIR)\etc\kas.exe:  $(DESTDIR)\root.server\usr\afs\bin\kas.exe
 # Local clean target; augments predefined clean target
 
 clean::
-
+       $(DEL) $(KPASSWD_EXEFILE)
 
 
 
index dc68cb09c62574e4396e53cb8ce7e5c5071ef6ba..3571962e166b3f92498bc1f067228ed4d5bb644e 100644 (file)
@@ -768,7 +768,11 @@ int SetPassword (
     if (as->parms[3].items) 
       sscanf (as->parms[3].items->data, "%d", &kvno);
 
+#ifdef AFS_S390_LINUX20_ENV
+    code = ubik_Call (KAM_SetPassword, conn, 0, name, instance, kvno, 0, key);
+#else
     code = ubik_Call (KAM_SetPassword, conn, 0, name, instance, kvno, key);
+#endif
     if (code) com_err (whoami, code,
                       "so can't set password for %s.%s", name, instance);
     return code;
index c48868f2c0d5a306e8f405d77f8486cd9ab59db0..04d46669c68c84ef0abf3092f8a3b6859f574f30 100644 (file)
@@ -788,8 +788,13 @@ afs_int32 ka_ChangePassword (
     afs_int32     code;
 
     LOCK_GLOBAL_MUTEX
+#ifdef AFS_S390_LINUX20_ENV
+    code = ubik_Call_New (KAM_SetPassword, conn, 0, name, 
+                         instance, 0, 0, *newkey);
+#else
     code = ubik_Call_New (KAM_SetPassword, conn, 0, name, 
                          instance, 0, *newkey);
+#endif
     UNLOCK_GLOBAL_MUTEX
     return code;
 }
index 69adf45a6e79c9ec1c82c3e22d08448a61267dda..c0df2e5788ed8900e3493c1affdae8c1ea9994ee 100644 (file)
@@ -62,7 +62,7 @@
 static struct afsconf_dir *conf = 0;
 static char cell_name[MAXCELLCHARS];
 
-int ka_CellConfig (char *dir)
+int ka_CellConfig (const char *dir)
 {
     int code;
 #ifdef UKERNEL
index 85915e55f967d4cff09fd9f402cb8e2953a389d0..da3756c97ddb3af15363089390e58251894f0131 100644 (file)
@@ -183,12 +183,18 @@ extern afs_int32 ka_ParseLoginName (
   char  cell[MAXKTCREALMLEN]
 );
 
+#ifdef _MFC_VER
+extern "C" {
+#endif /* _MFC_VER */
 extern afs_int32 ka_Init(
   int flags
 );
+#ifdef _MFC_VER
+}
+#endif /* _MFC_VER */
 
 extern int ka_CellConfig (
-  char *dir
+  const char *dir
 );
 
 extern char *ka_LocalCell (
index d5e5ad7b08b824668be4b856b599bd85e4aa6dd1..eec4a84a5f61358cb2c0f7f0c3b5833f21173f22 100644 (file)
@@ -17,6 +17,7 @@
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
+#define snprintf _snprintf
 #else
 #include <sys/socket.h>
 #include <netdb.h>
index bc743832416ffa206e6ef974491f7a9865312e99..f2857628e47a096e32f8038e3fec9f391a46fc53 100644 (file)
@@ -231,7 +231,7 @@ RebuildEntry(entryp)
 
   ka_ConvertBytes (key, sizeof(key), (char *)&entryp->key, 
                   sizeof(entryp->key));
-  fprintf(out, " -initial_password foo\n", key);
+  fprintf(out, " -initial_password foo\n");
 
   strcpy(flags,"");
   if (entryp->flags & KAFADMIN)  strcat(flags, "+ADMIN");
index 89538eaf6a225cfb86bcf97e9c9b04aa6bc42084..f2633fa94ed0ca4ba973b15f7396e358f07b82a8 100644 (file)
@@ -39,8 +39,10 @@ install_headers: $(INCFILES)
 
 install: $(LIBFILE)
 
-clean::
+install9x: install
 
+clean::
+       $(DEL) $(INCFILES)
 
 ############################################################################
 # Auxiliary build targets not built by default; e.g. test programs
index 09b540f7e7e06c7ed719de6502fdf100e6f411c2..84fed280251dfe1341a9a1382b778df992a41620 100644 (file)
@@ -10,3 +10,5 @@ include ../config/Makefile.${SYS_NAME}
 system install: 
        ${INSTALL} afs_Admin.h ${DESTDIR}include/afs
 
+clean:
+
index cff52a4244619c510011488dbcddcebcc2b338de..3e4c5a749a191055497496f6b1f8b83d82ed41c4 100644 (file)
@@ -6,7 +6,6 @@
 # directory or online at http://www.openafs.org/dl/license10.html
 
 !include ..\config\NTMakefile.$(SYS_NAME)
-
 !include ..\config\NTMakefile.version
 
 INCFILEDIR = $(DESTDIR)\include\afs
@@ -17,3 +16,7 @@ INCFILES = \
 
 install: $(INCFILES)
 
+install9x: install
+
+clean::
+       $(DEL) $(INCFILES)
index e57ffed973e85530ccfd02f98f080dcebe5afb5a..73635d995689b72a65e66b227501f788e0640a9f 100644 (file)
@@ -95,7 +95,8 @@ int ADMINAPI util_AdminErrorCodeTranslate(
      * Translate the error
      */
 
-    (error_init_done || pthread_once(&error_init_once, init_once));
+    if ( !error_init_done )
+               pthread_once(&error_init_once, init_once);
     code = (afs_int32) errorCode;
     *errorTextP = error_message(code);
     rc = 1;
@@ -145,8 +146,6 @@ static int GetDatabaseServerRPC(
     }
     rc = 1;
  
-fail_GetDatabaseServerRPC:
     if (st != NULL) {
         *st = tst;
     }
@@ -224,7 +223,6 @@ int ADMINAPI util_DatabaseServerGetBegin(
     afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
     database_server_get_p serv = (database_server_get_p) calloc(1, sizeof(database_server_get_t));
     char copyCell[MAXCELLCHARS];
-    int mutex_inited = 0;
  
     /*
      * Validate arguments
@@ -324,7 +322,6 @@ int ADMINAPI util_DatabaseServerGetNext(
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
-    int iter_locked = 0;
  
     if (iter == NULL) {
        tst = ADMITERATORNULL;
@@ -1037,7 +1034,6 @@ int IteratorInit(
     int rc = 0;
     afs_status_t tst = 0;
     int mutex_inited = 0;
-    int attr_inited = 0;
     int add_item_cond_inited = 0;
     int remove_item_cond_inited = 0;
 
@@ -1246,7 +1242,6 @@ static int GetRPCStatsRPC(
     int rc = 0;
     afs_status_t tst = 0;
     rpc_stat_get_p t = (rpc_stat_get_p) rpc_specific;
-    afs_uint32 index = t->index;
 
     t->stats[slot].clientVersion = t->clientVersion;
     t->stats[slot].serverVersion = t->serverVersion;
@@ -2411,7 +2406,6 @@ int ADMINAPI util_RXDebugVersion(
     int rc = 0;
     afs_status_t tst = 0;
     int code;
-    int len;
 
     if (handle == NULL) {
         tst = ADMRXDEBUGHANDLENULL;
@@ -2471,7 +2465,6 @@ int ADMINAPI util_RXDebugSupportedStats(
     int rc = 0;
     afs_status_t tst = 0;
     struct rx_debugStats tstats;
-    int code;
 
     if (handle == NULL) {
        tst = ADMRXDEBUGHANDLENULL;
index ea6ead4314c4b8cd2b8279b167f8640dd8dcd60b..daac36edce5c056b620f6bdb96d9a77edb291b7a 100644 (file)
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <stdlib.h>
 #ifdef AFS_NT40_ENV
 #include <io.h>
+#else
+#include <unistd.h>
 #endif
 
 
@@ -2087,7 +2090,6 @@ static int GetKeyRPC(
     int rc = 0;
     afs_status_t tst = 0;
     key_get_p key = (key_get_p) rpc_specific;
-    char *ptr = (char *) &key->key[slot];
     struct bozo_keyInfo keyInfo;
 
     tst = BOZO_ListKeys(key->server, key->next++,
@@ -3076,25 +3078,25 @@ int ADMINAPI bos_ExecutableRestartTimeSet(
     }
 
     if ((time.mask & BOS_RESTART_TIME_HOUR) &&
-        (time.hour < 0) || (time.hour > 23)) {
+        ((time.hour < 0) || (time.hour > 23))) {
        tst = ADMBOSHOURINVALID;
        goto fail_bos_ExecutableRestartTimeSet;
     }
 
     if ((time.mask & BOS_RESTART_TIME_MINUTE) &&
-       (time.min < 0) || (time.min > 60)) {
+       ((time.min < 0) || (time.min > 60))) {
        tst = ADMBOSMINUTEINVALID;
        goto fail_bos_ExecutableRestartTimeSet;
     }
 
     if ((time.mask & BOS_RESTART_TIME_SECOND) &&
-       (time.sec < 0) || (time.sec > 60)) {
+       ((time.sec < 0) || (time.sec > 60))) {
        tst = ADMBOSSECONDINVALID;
        goto fail_bos_ExecutableRestartTimeSet;
     }
 
     if ((time.mask & BOS_RESTART_TIME_DAY) &&
-       (time.day < 0) || (time.day > 6)) {
+       ((time.day < 0) || (time.day > 6))) {
        tst = ADMBOSDAYINVALID;
        goto fail_bos_ExecutableRestartTimeSet;
     }
@@ -3223,7 +3225,7 @@ int ADMINAPI bos_LogGet(
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
-    struct rx_call *tcall;
+    struct rx_call *tcall = NULL;
     afs_int32 error;
     char buffer;
     int have_call = 0;
@@ -3484,7 +3486,6 @@ int ADMINAPI bos_Salvage(
     int have_volume = 0;
     unsigned int part = 0;
     int try_to_stop_fileserver = 0;
-    int stopped_fileserver = 0;
     bos_ProcessType_t procType;
     bos_ProcessInfo_t procInfo;
     FILE *log = NULL;
@@ -3628,8 +3629,8 @@ int ADMINAPI bos_Salvage(
        goto fail_bos_Salvage;
     }
 
-    while (poll_rc = bos_ProcessInfoGet(serverHandle, "salvage-tmp", &procType,
-                                       &procInfo, &tst)) {
+    while ((poll_rc = bos_ProcessInfoGet(serverHandle, "salvage-tmp", &procType,
+                                       &procInfo, &tst))) {
        sleep(5);
     }
 
index c415298d88f7267ac520f467ab6a01b1cb4d8954..fe19db40a837dd89c6b15117d03c50a57aaa45a9 100644 (file)
@@ -26,6 +26,7 @@
 #include <afs/venus.h>
 #include <errno.h>
 #include <strings.h>
+#include <unistd.h>
 #endif
 #include <string.h>
 #include <afs/kautils.h>
@@ -1180,7 +1181,7 @@ int ADMINAPI afsclient_LocalCellGet(
         goto fail_afsclient_LocalCellGet;
     }
 
-    if (tst = afsconf_GetLocalCell(tdir, cellName, MAXCELLCHARS)) {
+    if ((tst = afsconf_GetLocalCell(tdir, cellName, MAXCELLCHARS))) {
         goto fail_afsclient_LocalCellGet;
     }
 
@@ -1395,7 +1396,7 @@ int ADMINAPI afsclient_MountPointCreate(
        goto fail_afsclient_MountPointCreate;
     }
 #else
-    if (tst = symlink(space, directory)) {
+    if ((tst = symlink(space, directory))) {
        goto fail_afsclient_MountPointCreate;
     }
 #endif
@@ -1432,7 +1433,7 @@ int ADMINAPI afsclient_ACLEntryAdd(
     char *ptr;
     Acl_t cur_acl;
     char cur_user[64];
-    int cur_user_acl;
+    int cur_user_acl = 0;
     int i;
     char tmp[64+35];
     int is_dfs;
@@ -1533,7 +1534,7 @@ int ADMINAPI afsclient_ACLEntryAdd(
      * file.
      */
 
-    is_dfs = sscanf(old_acl_string, "%d dfs:%d %s", &cur_acl.nplus, &cur_acl.dfs, &cur_acl.cell);
+    is_dfs = sscanf(old_acl_string, "%d dfs:%d %s", &cur_acl.nplus, &cur_acl.dfs, cur_acl.cell);
     ptr = strchr(old_acl_string, '\n');
     ptr++;
     sscanf(ptr, "%d", &cur_acl.nminus);
@@ -1557,7 +1558,7 @@ int ADMINAPI afsclient_ACLEntryAdd(
      */
 
     for(i=0;i<(cur_acl.nplus + cur_acl.nminus);i++) {
-       sscanf(ptr, "%s%d\n", &cur_user, &cur_user_acl);
+       sscanf(ptr, "%s%d\n", cur_user, &cur_user_acl);
        /*
         * Skip the entry for the user we are replacing/adding
         */
@@ -1618,7 +1619,8 @@ int ADMINAPI afsclient_Init(
     int rc = 0;
     afs_status_t tst = 0;
  
-    (client_init || pthread_once(&client_init_once, client_once));
+    if ( !client_init )
+       pthread_once(&client_init_once, client_once);
 
 #ifdef AFS_NT40_ENV
     if (afs_winsockInit() < 0) {
@@ -1637,7 +1639,7 @@ int ADMINAPI afsclient_Init(
        goto fail_afsclient_Init;
     }
 
-    if (tst = ka_CellConfig((char *)AFSDIR_CLIENT_ETC_DIRPATH)) {
+    if ((tst = ka_CellConfig((char *)AFSDIR_CLIENT_ETC_DIRPATH))) {
        goto fail_afsclient_Init;
     }
 
@@ -1773,8 +1775,6 @@ static int GetServerRPC(
     }
     rc = 1;
  
-fail_GetServerRPC:
     if (st != NULL) {
         *st = tst;
     }
index 9b7722512f60664f1fc654b7e95af9c3bd2cf985..81061b132153a1599a01cafefb7633d9d6f81a09 100644 (file)
@@ -877,7 +877,6 @@ static int GetPrincipalFromCache(
     int rc = 0;
     afs_status_t tst = 0;
     principal_get_p prin = (principal_get_p) rpc_specific;
-    kas_identity_p who = (kas_identity_p) dest;
 
     memcpy(dest, &prin->principal[slot], sizeof(kas_identity_t));
     rc = 1;
@@ -1007,7 +1006,6 @@ int ADMINAPI kas_PrincipalGetNext(
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
-    int locked_iter = 0;
  
     /*
      * Validate arguments
@@ -1407,7 +1405,6 @@ int ADMINAPI kas_PrincipalFieldsSet(
     int was_spare;
     char spare_bytes[4] = {0,0,0,0};
     int somethings_changing = 0;
-    int have_got_current_flag = 0;
 
     /*
      * Validate input arguments.
index ee2bf965362106490cf770dedd47f8ebd4a60ea3..c6395a2732497eff1d6992e683634f66de5f5159 100644 (file)
@@ -14,7 +14,9 @@
 #include <afs/afs_Admin.h>
 #include <time.h>
 #ifdef AFS_NT40_ENV
+#ifndef _MFC_VER
 #include <winsock2.h>
+#endif /* _MFC_VER */
 #endif
 
 #define KAS_MAX_NAME_LEN 64
index f58195d41b02b81d698bbcbbc7c65d918979f62f..9a538053685af9fe5bc1d4b271ae66c7d7259bee 100644 (file)
@@ -95,7 +95,7 @@ int main(int argc, char *argv[])
     }
 
     printf("\n");
-    printf("RPC stats are version %d\n", version);
+    printf("RPC stats are version %d\n", (int) version);
     printf("\n");
 
     exit(0);
index be743dffdc5a083f009984c9f129a9e745f75208..797ec28d70f9104c8503c9747a02e2a09bc5884e 100644 (file)
@@ -9,7 +9,7 @@ SHELL = /bin/sh
 include ../../config/Makefile.${SYS_NAME}
 
 CC = ${MT_CC}
-CFLAGS = ${OPTMZ} ${DBG} -I${SRCDIR}include ${MT_CFLAGS}
+CFLAGS = ${OPTMZ} ${DBG} -I${TOP_SRCDIR}/config -I${SRCDIR}include ${MT_CFLAGS}
 CCRULE = ${CC} ${CFLAGS} -c $?
 
 VLSERVER = ../../vlserver/
index c67180cb6c2099981f5e1ebf579fb73a5af6ebfb..3256a951f12ea8d7695d4dab4e374606379a10e3 100644 (file)
@@ -8,14 +8,24 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <afs/stds.h>
 #include <stdio.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
+#include <ctype.h>
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
 #include <io.h>
 #else
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <unistd.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <netdb.h>
@@ -2054,7 +2064,6 @@ static int GetVLDBEntryRPC(
     int rc = 0;
     afs_status_t tst = 0;
     vldb_entry_get_p entry = (vldb_entry_get_p) rpc_specific;
-    int index = entry->index;
 
     /*
      * Copy the next entry into the cache
@@ -2171,7 +2180,6 @@ int ADMINAPI vos_VLDBGetBegin(
     afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
     vldb_entry_get_p entry = (vldb_entry_get_p) calloc(1, sizeof(vldb_entry_get_t));
     struct VldbListByAttributes attr;
-    afs_int32 nentries = 0;
 
     attr.Mask = 0;
     memset(&attr, 0, sizeof(attr));
@@ -3665,8 +3673,6 @@ static int copyvolintXInfo(
 
     rc = 1;
 
-fail_copyvolintXInfo:
-
     if (st != NULL) {
        *st = tst;
     }
@@ -3785,7 +3791,6 @@ static int GetVolumeRPC(
     int rc = 0;
     afs_status_t tst = 0;
     volume_get_p entry = (volume_get_p) rpc_specific;
-    int index = entry->index;
 
     /*
      * Copy the next entry into the cache
index 580ccc08172adc722645aebd61ca087729be013b..25320a913751fd7eff21bd6fb5ab2e046b46760f 100644 (file)
@@ -14,7 +14,9 @@
 #include <afs/afs_Admin.h>
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
+#ifndef _MFC_VER
 #include <winsock2.h>
+#endif /* _MFC_VER */
 #else
 #include <sys/socket.h>
 #endif
index 452b3dff55c71227edb9d487cf7c3693e61d2662..1473c6ab8a3a5dd7aff5256ce21db61ec82b7b87 100644 (file)
@@ -8,6 +8,13 @@
  */
 
 #include "lockprocs.h"
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
 
 /* Finds an index in VLDB entry that matches the volume type, server, and partition.
  * If type is zero, will match first index of ANY type (RW, BK, or RO).
@@ -58,7 +65,6 @@ static void SetAValue (
   afs_int32 type)
 {
     int e;
-    afs_int32 error = 0;
 
     e = FindIndex(cellHandle, entry, oserver, opart, type);
     if (e == -1)
index 62d972568e40a842b544c0c63622e8c6c7724d48..e60137db75c2f20251d09907275f2f01a6102584 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
index 6ac500abd94b61394eb64fb7e175cff9394f4b6c..de907518c736ec89cdf92e6c647dba57c82165fb 100644 (file)
 #include "vsprocs.h"
 #include "lockprocs.h"
 #include <afs/afs_AdminErrors.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
 
 /*
  * Functions that aren't prototyped, but that we use
index 13882da1b9245934524d13e20e615ffd05d5ebf1..7700a5fc3759248b62fff0b46ba1603cbbf99b6f 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <afs/stds.h>
 #include <afs/afs_Admin.h>
 #include <afs/vlserver.h>
index 2453296b8b99d9ee434fdd6652df4807190071d2..fccdf8681b8015a05e8fde2e52f41f34767c56c6 100644 (file)
 #include "../adminutil/afs_AdminInternal.h"
 #include <afs/afs_AdminErrors.h>
 #include "afs_vosAdmin.h"
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #ifdef AFS_NT40_ENV
 #include <io.h>
 #endif
 
-static GroupEntries();
+static afs_int32 GroupEntries();
 
 struct release {
   afs_int32 time;
@@ -946,10 +956,9 @@ int UV_BackupVolume(
     afs_status_t tst = 0, temp = 0;
     afs_int32 ttid = 0, btid = 0;
     afs_int32 backupID;
-    afs_int32 code = 0, rcode = 0;
+    afs_int32 rcode = 0;
     char vname[VOLSER_MAXVOLNAME +1];
     struct nvldbentry entry;
-    afs_int32 error = 0;
     int vldblocked = 0, vldbmod = 0, backexists = 1;
     struct rx_connection *aconn = UV_Bind(cellHandle, aserver,
                                          AFSCONF_VOLUMEPORT);
@@ -1151,6 +1160,7 @@ static int DelVol (
 #define ONERROR(ec, ep, es) if (ec) { fprintf(STDERR, (es), (ep)); error = (ec); goto rfail; }
 #define ERROREXIT(ec) { error = (ec); goto rfail; }
 
+#if 0 /* doesn't appear to be used, why compile it */
 static int CloneVol (
   afs_cell_handle_p cellHandle,
   struct rx_connection *conn,
@@ -1255,6 +1265,7 @@ fail_CloneVol:
     }
     return rc;
 }
+#endif
 
 /* Get a "transaction" on this replica.  Create the volume 
  * if necessary.  Return the time from which a dump should
@@ -1371,13 +1382,6 @@ static int SimulateForwardMultiple(
 }
 
 
-static int rel_compar (
-  struct release *r1,
-  struct release *r2)
-{
-  return (r1->time - r2->time);
-}
-
 /* VolumeExists()
  *      Determine if a volume exists on a server and partition.
  *      Try creating a transaction on the volume. If we can,
@@ -1393,7 +1397,7 @@ static afs_int32 VolumeExists(
   afs_status_p st)
 {
    int rc = 0;
-   afs_status_t tst = -1;
+   afs_status_t tst = 0;
    struct rx_connection *conn=(struct rx_connection *)0;
    volEntries           volumeInfo;
  
@@ -1443,16 +1447,15 @@ int UV_ReleaseVolume(
   struct release *times=0;
   int nservers = 0;
   struct rx_connection *fromconn = (struct rx_connection *)0;
-  afs_int32 error = 0;
   int islocked = 0;
   afs_int32 clonetid=0, onlinetid;
   afs_int32 fromtid=0;
-  afs_uint32 fromdate, thisdate;
+  afs_uint32 fromdate=0, thisdate;
   int s;
   manyDests tr;
   manyResults results;
   int rwindex, roindex, roclone, roexists;
-  afs_int32 rwcrdate;
+  afs_int32 rwcrdate = 0;
   struct rtime {
     int     validtime;
     afs_uint32 time;
@@ -2062,7 +2065,7 @@ int UV_DumpVolume(
     if(tst) {
        goto fail_UV_DumpVolume;
     }
-    if (tst = DumpFunction(fromcall,filename)) {
+    if ((tst = DumpFunction(fromcall,filename))) {
        goto fail_UV_DumpVolume;
     }
     tst = rx_EndCall(fromcall,rxError);
@@ -2225,7 +2228,7 @@ int UV_RestoreVolume(
     afs_status_t etst = 0;
     struct rx_connection *toconn,*tempconn;
     struct rx_call *tocall;
-    afs_int32 totid, rcode, terror = 0;
+    afs_int32 totid, rcode;
     afs_int32 rxError = 0;
     struct volser_status tstatus;
     char partName[10];
@@ -2500,7 +2503,6 @@ int UV_AddSite(
     afs_status_t tst = 0;
     int j, nro=0, islocked=0;
     struct nvldbentry entry;
-    afs_int32 error=0;
     int same = 0;
 
     tst = ubik_Call(VL_SetLock, cellHandle->vos, 0,volid,RWVOL, VLOP_ADDSITE);
@@ -2580,7 +2582,7 @@ int UV_RemoveSite(
     int rc = 0;
     afs_status_t tst = 0;
     struct nvldbentry entry;
-    int islocked;
+    int islocked = 0;
 
     tst = ubik_Call(VL_SetLock, cellHandle->vos, 0,volid, RWVOL, VLOP_ADDSITE);
     if(tst) {
@@ -3204,7 +3206,6 @@ static afs_int32 CheckVldbRWBK(
    afs_status_t tst = 0;
    int modentry = 0;
    int idx;
-   afs_int32 error = 0;
  
    if (modified) *modified = 0;
    idx = Lp_GetRwIndex(cellHandle, entry, 0);
@@ -3312,7 +3313,6 @@ static int CheckVldbRO(
    afs_status_t tst = 0;
    int idx;
    int foundro = 0, modentry = 0;
-   afs_int32 error = 0;
  
    if (modified) *modified = 0;
  
@@ -3374,8 +3374,7 @@ int CheckVldb(
     int rc = 0;
     afs_status_t tst = 0;
     afs_int32 vcode;
-    int islocked;
-    struct rx_connection *server = NULL;
+    int islocked = 0;
     int pass = 0;
     afs_int32 modentry = 0;
     afs_int32 delentry = 0;
@@ -3707,7 +3706,7 @@ fail_UV_RenameVolume:
 *if the volume is rw. <count> is the number of entries to be processesd.
 *<pntr> points to the first entry.< myQueue> is the queue with entries 
 *grouped */
-static int GroupEntries(
+static afs_int32 GroupEntries(
   struct rx_connection *server,
   volintInfo *pntr,
   afs_int32 count,
index 0629f922b78ec63f4ebe22560d03943d5bab04f2..8553f3fd999823f1e96866db18ead9e281fe0da1 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
index 33be0bcd9b9defe3c9513d0e9e1ebbd746055f31..2fe9f046c45a2caa9920dc74a23f6113a4952ee4 100644 (file)
@@ -12,7 +12,7 @@ COMPONENT=libafsauthent
 include ../config/Makefile.${SYS_NAME}
 
 CC=${MT_CC}
-CFLAGS = ${OPTMZ} ${DBG} -I${SRCDIR}include ${MT_CFLAGS} 
+CFLAGS = ${OPTMZ} ${DBG} -I${TOP_SRCDIR}/config -I${SRCDIR}include ${MT_CFLAGS} 
 CCRULE = ${CC} ${CFLAGS} -c $?
 
 AUDIT= ../audit
index 110f4e303075f3f22d2a112f65e5e0dac164907b..4182a212b0458d2bbf8ba4e820abc8760adb7410 100644 (file)
@@ -206,20 +206,29 @@ afsrpc_c.obj: $(WINNTAFSD)\afsrpc_c.c
 cm_config.obj: $(WINNTAFSD)\cm_config.c
        $(C2OBJ) $(WINNTAFSD)\cm_config.c
 
-install: $(DESTDIR)\lib\afsauthent.dll
-
 DLLLIBS =\
+!IF (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" ))
+       $(DESTDIR)\lib\win95\pthread.lib \
+!ELSE
        $(DESTDIR)\lib\pthread.lib \
+!ENDIF
        $(DESTDIR)\lib\afsrpc.lib \
        $(DESTDIR)\lib\afsdes.lib \
        $(DESTDIR)\lib\afs\afsutil.lib \
        $(DESTDIR)\lib\afs\afsreg.lib \
        $(DESTDIR)\lib\afs\afseventlog.lib
 
-$(DESTDIR)\lib\afsauthent.dll: $(DLLOBJS) $(DLLLIBS)
+$(LIBFILE): $(DLLOBJS) $(DLLLIBS)
        $(DLLCONLINK) /DEF:afsauthent.def rpcrt4.lib
        $(DLLPREP)
 
 # Definitions for generating versioninfo resources
 afsauthent.res: afsauthent.rc AFS_component_version_number.h
        $(RC) $*.rc
+
+install: $(LIBFILE)
+
+install9x: install
+
+clean ::
+       $(DEL) $(LIBFILE)
\ No newline at end of file
index e411bd77378fa7c911bcd8d071009c30f7599b8d..48c4036b516ee87c35348f16844930eea6b299b4 100644 (file)
@@ -13,7 +13,7 @@ include ../config/Makefile.${SYS_NAME}
 
 CC=${MT_CC}
 INCLUDES = -I${SRCDIR}include -I.. -I../rx
-CFLAGS = ${OPTMZ} ${DBG} ${INCLUDES} -DRXDEBUG ${MT_CFLAGS}
+CFLAGS = ${OPTMZ} ${DBG} ${INCLUDES} -DRXDEBUG ${MT_CFLAGS} -I${TOP_SRCDIR}/config
 SFLAGS=-P -I${SRCDIR}include
 RX = ../rx
 CCRULE = ${CC} ${CFLAGS} -c $?
@@ -241,7 +241,7 @@ xdr_afsuuid.o: ${RX}/xdr_afsuuid.c
 #
 #   $ what /opt/langtools/bin/pxdb32
 #   /opt/langtools/bin/pxdb32:
-#           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.1.1.5 $
+#           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.1.1.6 $
 #
 # The problem occurs when -g and -O are both used when compiling des.c.
 # The simplest way to work around the problem is to leave out either -g or -O.
index 80b9d2a40563f254e33a9fa89bb09935b61cd69e..d87af312696741a5f69a15816aba985652fca151 100644 (file)
@@ -6,7 +6,6 @@
 # directory or online at http://www.openafs.org/dl/license10.html
 
 !include ..\config\NTMakefile.$(SYS_NAME)
-
 !include ..\config\NTMakefile.version
 
 RX = ..\rx
@@ -257,7 +256,11 @@ NTMAKE = nmake /nologo /f ntmakefile
 
 
 DLLLIBS =\
+!IF (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" ))
+       $(DESTDIR)\lib\win95\pthread.lib \
+!ELSE
        $(DESTDIR)\lib\pthread.lib \
+!ENDIF
        $(DESTDIR)\lib\afs\afsutil.lib \
        $(DESTDIR)\lib\afs\afsreg.lib
 
@@ -277,6 +280,8 @@ install:
                $(NTMAKE) libstub
 !      endif
 
+install9x: install
+
 !IF (EXIST(..\..\src\des\NTMakefile))
 !ELSE IF (EXIST(..\..\DESLIB))
 DESPAR = ..\..\DESLIB\dest
@@ -293,3 +298,6 @@ libstub:
                $(DESTDIR)\lib\afsrpc.lib
        $(COPY) $(DESPAR)\lib\afsrpc.exp \
                $(DESTDIR)\lib\afsrpc.exp
+
+clean::
+       $(DEL) $(DESTDIR)\lib\afsrpc.dll $(DESTDIR)\lib\afsrpc.lib $(DESTDIR)\lib\afsrpc.exp
\ No newline at end of file
index c57974a28ffb99796f566c72b16ca39d4d9304e2..d2e6608a3de820ef605d80cd0311c6e362288143 100644 (file)
@@ -9,7 +9,7 @@
 #
 
 SHELL=/bin/sh
-INCLUDE=  -I. -I/usr/include
+INCLUDE=  -I. -I/usr/include -I${TOP_SRCDIR}/config
 UOBJ   =../UAFS
 WEBOBJ =../AFSWEB
 AFS    =../afs
@@ -42,7 +42,7 @@ ukinstlibs:
 ukinstall: ukinsthdrs UAFS/$(LIBUAFS) linktest ukinstlibs
 
 linktest: UAFS/$(LIBUAFS) des/libdes.a
-       $(CC) $(TEST_CFLAGS) $(TEST_LDFLAGS) -o linktest linktest.c -I${DESTDIR}include -I${DESTDIR}include/rx -I${DESTDIR}root.perf/include UAFS/$(LIBUAFS) des/libdes.a $(TEST_LIBS)
+       $(CC) $(TEST_CFLAGS) $(TEST_LDFLAGS) -o linktest linktest.c -I${DESTDIR}include -I${DESTDIR}include/rx -I${DESTDIR}root.perf/include UAFS/$(LIBUAFS) des/libdes.a $(TEST_LIBS) $(XLIBS)
 
 CRULE1=        $(CC) $(OPTF) -DKERNEL $(CFLAGS) -c $?
 CRULE2=        $(CC) $(OPTF) $(WEBOPTS) -DKERNEL $(CFLAGS) -c $?
@@ -889,6 +889,6 @@ $(WEBOBJ)/Krxstat.xdr.o: $(AFSINT)/Krxstat.xdr.c
        $(CRULE2);
 
 clean:
-       -rm -rf UAFS* AFSWEB*
-       -rm -f  h net netinet rpc ufs machine inet nfs sys
+       -rm -rf UAFS* AFSWEB* nsapi des afs afsint config rx
+       -rm -f  h net netinet rpc ufs machine inet nfs sys des linktest
 
index df8d0a1095da3549659401c22538f02e346080d6..0ee221932e6b204544e17b48255bf0eeb6eda5c5 100644 (file)
@@ -8,13 +8,13 @@
 # MakefileProto for AIX systems
 #
 
-include $(DESTDIR)../obj/config/Makefile.${SYS_NAME}
+include ../config/Makefile.${SYS_NAME}
 
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 # System specific build commands and flags
 DEFINES= -DAFSDEBUG -DKERNEL -DUKERNEL -DAFS -DVICE
-CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
+CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
 AR = /usr/bin/ar
 ARFLAGS = -r
 RANLIB = /bin/ranlib
index e11103f0f7e077be7b58bf1427c2082685a8b577..f5072413d39136bd30ecb97060039ec7e5c962d6 100644 (file)
@@ -16,7 +16,7 @@ MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 CC = cc
 DEFINES= -D_REENTRANT -DAFSDEBUG -DKERNEL -DUKERNEL -DAFS -DVICE
 KOPTS=
-CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG} $(XCFLAGS)
+CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG} $(XCFLAGS)
 OPTF=-O
 # WEBOPTS = -I../nsapi -DNETSCAPE_NSAPI -DNET_SSL -DXP_UNIX -DMCC_HTTPD
 
index fcac0571d3b1dd45b1647b77531bd914b9d82c5e..525700cc215cc04dc56899f5798282d09810c0ae 100644 (file)
@@ -9,17 +9,16 @@
 #
 DBUG=-O
 
-include $(DESTDIR)/../obj/config/Makefile.${SYS_NAME}
+include ../config/Makefile.${SYS_NAME}
 
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 # System specific build commands and flags
-CC = cc
 DEFINES=-DAFSDEBUG -DKERNEL -DUKERNEL -DAFS -DVICE -D_NO_PROTO -DOSF
 KOPTS=
 DBUG=
 OPTF=-O
-CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG} -pthread
+CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG} -pthread
 WEBOPTS = -I../nsapi -DNETSCAPE_NSAPI -DNET_SSL -DXP_UNIX -DMCC_HTTPD
 
 TEST_CFLAGS=-pthread -D_NO_PROTO -D_REENTRANT -DAFS_PTHREAD_ENV -Dosf -DAFS_OSF_ENV -DOSF
index d493755b2e37ce573d8cc2e9534f935989b74b82..5086f2dcc5d181323f6e919bbfa431523cbd8a7c 100644 (file)
@@ -11,7 +11,7 @@ MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 CC = gcc
 DEFINES= -D_REENTRANT -DAFSDEBUG -DKERNEL -DUKERNEL -DAFS -DVICE
 KOPTS=
-CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
+CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
 OPTF=-O
 # WEBOPTS = -I../nsapi -DNETSCAPE_NSAPI -DNET_SSL -DXP_UNIX -DMCC_HTTPD
 
index 22738350fdfd597733dff76072a41c053aba8e9d..61aea37a804e06095d9c5161272b00336a442e9f 100644 (file)
@@ -5,10 +5,10 @@
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
 
-# MakefileProto for Solaris systems
+# MakefileProto for HP-UX systems
 #
 
-include $(DESTDIR)../obj/config/Makefile.${SYS_NAME}
+include ../config/Makefile.${SYS_NAME}
 
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
@@ -16,7 +16,7 @@ MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 CC = /opt/ansic/bin/cc
 DEFINES= -D_REENTRANT -DAFSDEBUG -DKERNEL -DUKERNEL -DAFS -DVICE
 KOPTS=-Wp,-H200000 -Wl,-a,archive +DA1.0 +z
-CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
+CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
 OPTF=-O
 WEBOPTS = -I../nsapi -DNETSCAPE_NSAPI -DNET_SSL -DXP_UNIX -DMCC_HTTPD
 
index 66b06d07d4098381f3fc6f69483b5c764f90d1bb..039fee9e66214ea24e277b9b38c8c1a93c93426d 100644 (file)
@@ -8,14 +8,14 @@
 # MakefileProto for Solaris systems
 #
 
-include $(DESTDIR)../obj/config/Makefile.${SYS_NAME}
+include ../config/Makefile.${SYS_NAME}
 
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 # System specific build commands and flags
 CC = cc
 DEFINES=-D_SGI_MP_SOURCE -DAFSDEBUG -DKERNEL -DUKERNEL -DAFS -DVICE
-CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
+CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
 OPTF=-O
 WEBOPTS = -I../nsapi -DNETSCAPE_NSAPI -DNET_SSL -DXP_UNIX -DMCC_HTTPD
 
index b2523c0ee2d10b542244a8bed609cd65967a1784..02ac4d75390b065849c7a7ca7fdccf3290f847ad 100644 (file)
@@ -16,7 +16,7 @@ MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 CC = gcc
 DEFINES= -D_REENTRANT -DAFSDEBUG -DKERNEL -DUKERNEL -DAFS -DVICE
 KOPTS=
-CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
+CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
 OPTF=-O
 # WEBOPTS = -I../nsapi -DNETSCAPE_NSAPI -DNET_SSL -DXP_UNIX -DMCC_HTTPD
 
index 43875f359fc864d47d5d0acf4d4fc29edc207b72..0b59c2b85bb240f56860773138d05aa71d698255 100644 (file)
@@ -8,15 +8,13 @@
 # MakefileProto for Solaris systems
 #
 
-include $(DESTDIR)../obj/config/Makefile.${SYS_NAME}
+include ../config/Makefile.${SYS_NAME}
 
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 # System specific build commands and flags
-# Redundant
-# CC = /opt/SUNWspro/bin/cc
 DEFINES= -D_REENTRANT -DAFSDEBUG -DKERNEL -DUKERNEL -DAFS -DVICE
-CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
+CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
 OPTF=-O
 WEBOPTS = -KPIC -I../nsapi -DNETSCAPE_NSAPI -DSOLARIS -DNET_SSL -DXP_UNIX -DMCC_HTTPD
 
index f053437d3cd1df99084d0c5af81c4e968b6f7592..7db954abf35f9f6bcd5cd2aaeb78cf978c8f0f77 100644 (file)
@@ -51,7 +51,7 @@ lint: log.c passwd.c unlog.c testlog.c
        lint  ${INCDIRS} passwd.c
 
 clean: 
-       rm -f *.o log passwd unlog tokens kseal core AFS_component_version_number.c
+       rm -f *.o log passwd unlog tokens kseal core AFS_component_version_number.c tokens.krb
 
 beancount:
        wc -l log.c passwd.c unlog.c 
index 9e44ef5c4e449663137316544dde69976ed4e377..f3a2ed1e027f45aa48450946d9cb3dcf83767cb8 100644 (file)
@@ -13,7 +13,7 @@ include ../config/Makefile.${SYS_NAME}
 # subtle bugs that may have been introduced in process.s, be warned!
 OPTIMIZE=${LWP_OPTMZ}
 
-CFLAGS=${OPTIMIZE} -I${SRCDIR}include ${XCFLAGS}
+CFLAGS=${OPTIMIZE} -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS}
 
 include ../config/Makefile.version
 
@@ -28,12 +28,12 @@ noversion: install
 #
 liblwp.a       : ${LIBOBJS}
                -rm -f liblwp.a
-               ar rv liblwp.a ${LIBOBJS}
+               $(AR) rv liblwp.a ${LIBOBJS}
                $(RANLIB) liblwp.a
 
 libtlwp.a      : ${LIBTOBJS}
                -rm -f libtlwp.a
-               ar rv libtlwp.a ${LIBTOBJS}
+               $(AR) rv libtlwp.a ${LIBTOBJS}
                $(RANLIB) libtlwp.a
 
 tlwp.o: lwp.c lwp.h
@@ -121,6 +121,7 @@ rw.o: rw.c
 #
 #      Installation
 #
+all: system
 system:        install
 
 kinstall ukinstall webinstall:
@@ -140,3 +141,6 @@ clean:
 
 beancount:
        wc -l *.[ch]
+
+includes:
+       ${INSTALL} *.h ${DESTDIR}include
index 5fcb9e5e262d95b3a03d0b9f2ee1f8c91fb546af..2fb0362d29950a0ce8017e9e5ebeb98e1731e5d6 100644 (file)
@@ -31,6 +31,8 @@ INCFILES = \
 
 install: $(LIBFILE) $(INCFILES)
 
+install9x: install
+
 $(LIBFILE): $(LIBOBJS)
        $(LIBARCH)
 
@@ -38,3 +40,6 @@ tests: rw.exe
 
 rw.exe: rw.obj $(LIBFILE) $(DESTDIR)\lib\afs\afsutil.lib
        $(EXECONLINK)
+
+clean::
+       $(DEL) $(LIBFILE)
index f6dbc495cb3136611bebcab32051adf4f798ebf7..8f5beba46f087509cdad40ec83329ffbed5b5fa0 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <afs/param.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
 #include <malloc.h>
@@ -45,6 +47,17 @@ extern void lwp_abort(void);
 #ifdef AFS_SUN5_ENV
 #include <fcntl.h>
 #endif
+#ifdef AFS_DJGPP_ENV
+#include "dosdefs95.h"
+#include "netbios95.h"
+#include <sys/socket.h>
+#include <sys/farptr.h>
+#include <dpmi.h>
+#include <go32.h>
+#include <crt0.h>
+int _crt0_startup_flags = _CRT0_FLAG_LOCK_MEMORY;
+#endif /* AFS_DJGPP_ENV */
+
 #if    defined(USE_PTHREADS) || defined(USE_SOLARIS_THREADS)
 
 void IOMGR_Initialize()        /* noop */
@@ -76,6 +89,10 @@ typedef unsigned char bool;
 #define MIN(a,b) ((a)>(b)) ? b : a
 #endif
 
+#ifndef NSIG
+#define NSIG 8*sizeof(sigset_t)
+#endif
+
 static int SignalSignals();
 \f
 /********************************\
@@ -100,6 +117,11 @@ struct IoRequest {
     /* Result of select call */
     long                       result;
 
+#ifdef AFS_DJGPP_ENV
+    NCB                  *ncbp;
+    dos_ptr              dos_ncb;
+#endif /* AFS_DJGPP_ENV */
+
 };
 \f
 /********************************\
@@ -140,6 +162,16 @@ static struct timeval iomgr_badtv;
 static PROCESS iomgr_badpid;
 static void SignalIO(int fds, fd_set *rfds, fd_set *wfds, fd_set *efs,
                    int code);
+static void SignalTimeout(int code, struct timeval *timeout);
+
+#ifdef AFS_DJGPP_ENV
+/* handle Netbios NCB completion */
+static int NCB_fd;
+int anyNCBComplete = FALSE;
+int handler_seg, handler_off;  /* seg:off of NCB completion handler */
+static __dpmi_regs        callback_regs;
+static _go32_dpmi_seginfo callback_info;
+#endif /* AFS_DJGPP_ENV */
 
 /* fd_set pool managment. 
  * Use the pool instead of creating fd_set's on the stack. fd_set's can be
@@ -188,7 +220,7 @@ static struct IoRequest *NewRequest()
 {
     struct IoRequest *request;
 
-    if (request=iorFreeList)
+    if ((request=iorFreeList))
        iorFreeList = (struct IoRequest *) (request->result);
     else request = (struct IoRequest *) malloc(sizeof(struct IoRequest));
 
@@ -372,9 +404,6 @@ static int IOMGR(void *dummy)
        struct TM_Elem *earliest;
        struct timeval timeout, junk;
        bool woke_someone;
-#ifndef AFS_NT40_ENV
-       int fds;
-#endif
 
        FD_ZERO(&IOMGR_readfds);
        FD_ZERO(&IOMGR_writefds);
@@ -390,7 +419,9 @@ static int IOMGR(void *dummy)
            /* Note: SignalSignals() may yield! */
            if (anySigsDelivered && SignalSignals ())
                woke_someone = TRUE;
+#ifndef AFS_DJGPP_ENV
            FT_GetTimeOfDay(&junk, 0);    /* force accurate time check */
+#endif
            TM_Rescan(Requests);
            for (;;) {
                register struct IoRequest *req;
@@ -416,6 +447,12 @@ static int IOMGR(void *dummy)
                LWP_QSignal(req->pid);
                req->pid->iomgrRequest = 0;
            }
+
+#ifdef AFS_DJGPP_ENV
+            if (IOMGR_CheckNCB())    /* check for completed netbios requests */
+              woke_someone = TRUE;
+#endif /* AFS_DJGPP_ENV */
+
            if (woke_someone) LWP_DispatchProcess();
        } while (woke_someone);
 
@@ -496,6 +533,14 @@ static int IOMGR(void *dummy)
            }
 #endif /* NT40 */
 
+#ifdef AFS_DJGPP_ENV
+            /* We do this also for the DOS-box Win95 client, since
+               NCB calls don't interrupt a select, but we want to catch them
+               in a reasonable amount of time (say, half a second). */
+            iomgr_timeout.tv_sec = 0;
+            iomgr_timeout.tv_usec = IOMGR_WIN95WAITTIME;
+#endif /* DJGPP */
+
            /* Check one last time for a signal delivery.  If one comes after
               this, the signal handler will set iomgr_timeout to zero, causing
               the select to return immediately.  The timer package won't return
@@ -506,6 +551,11 @@ static int IOMGR(void *dummy)
            if (anySigsDelivered)
                continue;       /* go to the top and handle them. */
 
+#ifdef AFS_DJGPP_ENV
+            if (IOMGR_CheckNCB())    /* check for completed netbios requests */
+              LWP_DispatchProcess();
+#endif /* AFS_DJGPP_ENV */
+
 #ifdef AFS_NT40_ENV
            if (IOMGR_readfds.fd_count == 0 && IOMGR_writefds.fd_count == 0
                && IOMGR_exceptfds.fd_count == 0) {
@@ -588,10 +638,14 @@ static int IOMGR(void *dummy)
                    continue;
                }
 #endif /* AFS_NT40_ENV */
-
+#ifndef AFS_DJGPP_ENV
                FT_GetTimeOfDay(&junk, 0);
+#endif
                SignalTimeout(code, &timeout);
            }
+#ifdef AFS_DJGPP_ENV
+            IOMGR_CheckNCB();
+#endif /* AFS_DJGPP_ENV */
        }
        LWP_DispatchProcess();
     }
@@ -747,6 +801,10 @@ int IOMGR_Initialize(void)
        IOMGR_Initialize:  so force a check for signals regardless */
     memset(allOnes, 0xff, sizeof(allOnes));
 
+#ifdef AFS_DJGPP_ENV
+    install_ncb_handler();
+#endif /* AFS_DJGPP_ENV */
+
     return LWP_CreateProcess(IOMGR, AFS_LWP_MINSTACKSIZE, 0, 0, "IO MANAGER",
                             &IOMGR_Id);
 }
@@ -998,11 +1056,174 @@ IOMGR_CancelSignal (signo)
 /* This routine calls select is a fashion that simulates the standard sleep routine */
 void IOMGR_Sleep (int seconds)
 {
+#ifndef AFS_DJGPP_ENV
     struct timeval timeout;
 
     timeout.tv_sec = seconds;
     timeout.tv_usec = 0;
     IOMGR_Select(0, 0, 0, 0, &timeout);
+#else
+    struct timeval timeout;
+    int s;
+    fd_set set, empty;
+    FD_ZERO(&empty);
+    FD_ZERO(&set);
+    s = socket(AF_INET,SOCK_STREAM,0);
+    FD_SET(s,&set);
+
+    timeout.tv_sec = seconds;
+    timeout.tv_usec = 0;
+    IOMGR_Select(1,&set,&empty,&empty,&timeout);
+    close(s);
+#endif            /* DJGPP  */
 }
 #endif /* USE_PTHREADS */
 
+
+#ifdef AFS_DJGPP_ENV
+
+/* Netbios code for djgpp port */
+
+int IOMGR_NCBSelect(ncbp, dos_ncb, timeout)
+  NCB *ncbp;
+  dos_ptr dos_ncb;
+  struct timeval *timeout;
+{
+  struct IoRequest *request;
+  int result;
+  
+  if (timeout != NULL && timeout->tv_sec == 0 && timeout->tv_usec == 0)
+  {
+    /* Poll */
+    if (ncbp->ncb_event != NULL)
+    {
+      /* error */
+      return -1;
+    }
+    
+    if (get_dos_member_b(NCB, dos_ncb, ncb_cmd_cplt) != 0xff)
+    {
+      return 1;
+    }
+    else {
+      return 0;
+    }
+  }
+
+  /* Construct request block & insert */
+  request = NewRequest();
+  request->ncbp = ncbp;
+  request->dos_ncb = dos_ncb;
+  
+  if (timeout == NULL)
+  {
+    request->timeout.TotalTime.tv_sec = -1;
+    request->timeout.TotalTime.tv_usec = -1;
+  }
+  else
+  {
+    request -> timeout.TotalTime = *timeout;
+    /* check for bad request */
+    if (timeout->tv_sec < 0 || timeout->tv_usec < 0 || timeout->tv_usec > 999999)
+    {
+      /* invalid arg */
+      iomgr_badtv = *timeout;
+      iomgr_badpid = LWP_ActiveProcess;
+      /* now fixup request */
+      if(request->timeout.TotalTime.tv_sec < 0)
+        request->timeout.TotalTime.tv_sec = 1;
+      request->timeout.TotalTime.tv_usec = 100000;
+    }
+  }
+
+  request->timeout.BackPointer = (char *)request;
+
+  /* Insert my PID in case of IOMGR_Cancel */
+  request -> pid = LWP_ActiveProcess;
+  LWP_ActiveProcess -> iomgrRequest = request;
+  
+#ifdef DEBUG
+  request -> timeout.Next = (struct TM_Elem *) 1;
+  request -> timeout.Prev = (struct TM_Elem *) 1;
+#endif /* DEBUG */
+  TM_Insert(Requests, &request->timeout);
+
+  if (ncbp->ncb_event != NULL)
+  {
+    /* since we were given an event, we can return immediately and just
+       signal the event once the request completes. */
+    return 0;
+  }
+  else
+  {
+    /* Wait for action */
+    
+    LWP_QWait();
+    
+    /* Update parameters & return */
+    result = request -> result;
+
+    FreeRequest(request);
+    return (result > 1 ? 1 : result);
+  }
+}
+      
+int IOMGR_CheckNCB()
+{
+  int woke_someone = FALSE;
+  EVENT_HANDLE ev;
+  PROCESS pid;
+  
+  anyNCBComplete = FALSE;
+  FOR_ALL_ELTS(r, Requests, {
+    register struct IoRequest *req;
+    req = (struct IoRequest *) r -> BackPointer;
+
+    if (req->dos_ncb && get_dos_member_b(NCB, req->dos_ncb, ncb_cmd_cplt) != 0xff)
+    {
+      /* this NCB has completed */
+      TM_Remove(Requests, &req->timeout);
+
+      /* copy out NCB from DOS to virtual space */
+      dosmemget(req->dos_ncb, sizeof(NCB), (char *) req->ncbp);
+
+      if (ev = req->ncbp->ncb_event)
+      {
+        thrd_SetEvent(ev);
+      }
+      else
+      {
+        woke_someone = TRUE;
+        LWP_QSignal(pid=req->pid);
+        pid->iomgrRequest = 0;
+      }
+    }
+  })
+  return woke_someone;
+}
+
+int ncb_handler(__dpmi_regs *r)
+{
+  anyNCBComplete = TRUE;  /* NCB completed */
+  /* Make sure that the IOMGR process doesn't pause on the select. */
+  iomgr_timeout.tv_sec = 0;
+  iomgr_timeout.tv_usec = 0;
+  return;
+}
+
+int install_ncb_handler()
+{
+  callback_info.pm_offset = (long) ncb_handler;
+  if (_go32_dpmi_allocate_real_mode_callback_retf(&callback_info,
+                                                  &callback_regs))
+ {
+      fprintf(stderr, "error, allocate_real_mode_callback_retf failed\n");
+      return -1;
+ }
+
+ handler_seg = callback_info.rm_segment;
+ handler_off = callback_info.rm_offset;
+ /*printf("NCB handler_seg=0x%x, off=0x%x\n", handler_seg, handler_off);*/
+}
+#endif /* AFS_DJGPP_ENV */
index b9282ef1aafc53eba4e6d734b622341e4893de00..531d5f9b841b70e006231cf14dbfece4db5b2f2a 100644 (file)
@@ -99,8 +99,29 @@ struct QUEUE {
            }\
        }
 
+#ifdef AFS_WIN95_ENV
+
+LPVOID ConvertThreadToFiber(PROCESS x)
+{
+       return NULL;
+}
+LPVOID CreateFiber(DWORD x ,LPVOID y,PROCESS z)
+{
+       return NULL;
+}
+
+VOID SwitchToFiber(LPVOID p)
+{
+}
+
+VOID DeleteFiber(LPVOID p)
+{
+}
+#endif
+
 
 int lwp_MinStackSize = 0;
+
 /* LWP_InitializeProcessSupport - setup base support for fibers.
  *
  * Arguments:
@@ -112,6 +133,7 @@ int lwp_MinStackSize = 0;
  *     LWP_SUCCESS (else aborts)
  *     
  */
+
 int LWP_InitializeProcessSupport(int priority, PROCESS *pid)
 {
     PROCESS pcb;
@@ -602,6 +624,7 @@ static void Delete_PCB(PROCESS pid)
     LWPANCHOR.processcnt--;
 }
 
+
 static void Free_PCB(PROCESS pid)
 {
     Debug(4, ("Entered Free_PCB"))
index 6412af6937803a9ff4c604163f1d851f5775ef61..d24af7c895a9e5111bdb5b93e55fe346bca9df43 100644 (file)
@@ -8,7 +8,9 @@
  */
 
 #define        IGNORE_STDS_H   1
+/*#ifndef AFS_DJGPP_ENV*/
 #include <afs/param.h>
+/*#endif /* AFS_DJGPP_ENV */
 
 #if defined(RIOS)
 
@@ -1151,7 +1153,7 @@ LEAF(returnto,1)
        END(returnto)
 #endif
 
-#if defined(AFS_NCR_ENV) || defined(AFS_X86_ENV)
+#if defined(AFS_NCR_ENV) || defined(AFS_X86_ENV) || defined(AFS_DJGPP_ENV)
 /* Sun 386i... I hope this does the right thing!!!
  * 
  * Written by Derek Atkins <warlord@MIT.EDU>
@@ -1185,14 +1187,23 @@ LEAF(returnto,1)
        .set    newsp,16
 
 
+#ifdef AFS_DJGPP_ENV
+.globl _PRE_Block
+.globl _savecontext
+_savecontext:
+#else
 .globl PRE_Block
 .globl savecontext
-
 savecontext:
+#endif /* AFS_DJGPP_ENV */
        pushl   %ebp                    /* New Frame! */
        movl    %esp,%ebp
        pusha                           /* Push all registers */
+#ifdef AFS_DJGPP_ENV
+       movl    $1,_PRE_Block           /* Pre-emption code */
+#else
        movl    $1,PRE_Block            /* Pre-emption code */
+#endif /* AFS_DJGPP_ENV */
        movl    area1(%ebp),%eax        /* eax = base of savearea */
        movl    %esp,(%eax)             /* area->topstack = esp */
        movl    newsp(%ebp),%eax        /* get new sp into eax */
@@ -1204,7 +1215,11 @@ L1:
 
 /* Shouldnt be here....*/
 
+#ifdef AFS_DJGPP_ENV
+       call    _abort
+#else
        call    abort
+#endif /* AFS_DJGPP_ENV */
 
 /*
  * returnto(area2)
@@ -1214,21 +1229,33 @@ L1:
 /* stack offset */
        .set    area2,8
 
+#ifdef AFS_DJGPP_ENV
+.globl _returnto
+_returnto:
+#else
 .globl returnto
-
 returnto:
+#endif /* AFS_DJGPP_ENV */
        pushl   %ebp
        movl    %esp, %ebp              /* New frame, to get correct pointer */
        movl    area2(%ebp),%eax        /* eax = area2 */
        movl    (%eax),%esp             /* restore esp */
        popa 
+#ifdef AFS_DJGPP_ENV
+       movl    $0,_PRE_Block           /* clear it up... */
+#else
        movl    $0,PRE_Block            /* clear it up... */
+#endif /* AFS_DJGPP_ENV */
        popl    %ebp
        ret
 
 /* I see, said the blind man, as he picked up his hammer and saw! */
        pushl   $1234
+#ifdef AFS_DJGPP_ENV
+       call    _abort
+#else
        call    abort
+#endif /* AFS_DJGPP_ENV */
 
 
 #endif /* AFS_NCR_ENV */
index 0b31bd78516e829c2d5b2ea070adce083d9161b1..c9df424f40986353b90e327c4a3dd7551ee6edb5 100644 (file)
 /* ********************************************************************** */
 
 #include <afs/param.h>
+#include <afsconfig.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
 #if defined(AFS_PTHREAD_ENV)
 #include <pthread.h>
 #else /* defined(AFS_PTHREAD_ENV) */
@@ -77,14 +85,16 @@ int registerthread(id, name)
     for (i = 0; i < nThreads; i++) {
        if (ThreadId[i] == id) {
            strncpy(&ThreadName[i][0], name, MAXTHREADNAMELENGTH);
-           return;
+           return 0;
        }
     }
-    if (nThreads == MAX_THREADS) return;
+    if (nThreads == MAX_THREADS) return 0;
     ThreadId[nThreads] = id;
     strncpy(&ThreadName[nThreads][0], name, MAXTHREADNAMELENGTH);
     ThreadName[nThreads][MAXTHREADNAMELENGTH -1] =0;
     nThreads++;
+
+    return 0;
 }
 
 int swapthreadname(id, new, old)
index 09de7e6ea71618038c500dcfd27b28ba94505f68..59b448ee142f57d6835c985ea4e9c4ea0772a85f 100644 (file)
@@ -213,7 +213,11 @@ int TM_Rescan(tlist)
     struct timeval time;
     register int expired;
 
+#ifndef AFS_DJGPP_ENV
     FT_AGetTimeOfDay(&time, 0);
+#else
+    FT_GetTimeOfDay(&time, 0);  /* we need a real time value */
+#endif
     expired = 0;
     FOR_ALL_ELTS(e, tlist, {
        if (!blocking(e)) {
index fc7be400a969fcf83fe6a8b175b9634c46b8390e..e599d963e313cf805b7c81fe8454248ae628a989 100644 (file)
@@ -150,6 +150,7 @@ int LWP_WaitForKeystroke(int seconds)
     struct timeval twait;
     struct timeval *tp = NULL;
 
+#ifndef AFS_DJGPP_ENV
 #ifdef AFS_LINUX20_ENV
     if (stdin->_IO_read_ptr < stdin->_IO_read_end)
        return 1;
@@ -162,7 +163,10 @@ int LWP_WaitForKeystroke(int seconds)
        return 1;
 #endif
 #endif
-
+#else /* DJGPP */
+    if (stdin->_cnt > 0)
+       return 1;
+#endif /* DJGPP */
 
     FD_ZERO(&rdfds);
     FD_SET(fileno(stdin), &rdfds);
index 9d519b67b78962affda0f52e31d3a186a457dcab..7ade68e642a495dbceec5c2e543e336cbda6de62 100755 (executable)
@@ -6,11 +6,11 @@ rem This software has been released under the terms of the IBM Public
 rem License.  For details, see the LICENSE file in the top-level source
 rem directory or online at http://www.openafs.org/dl/license10.html
 
+
 REM AFS build environment variables for Windows NT.
 REM Modify for local configuration; common defaults shown.
 REM ########################################################################
 
-
 REM ########################################################################
 REM
 REM NOTE: You should run NTLANG.REG before attempting to build localized
@@ -57,38 +57,40 @@ goto args_done
 :args_done
 REM ########################################################################
 REM General required definitions:
-REM     SYS_NAME = <AFS system name>
-
-set SYS_NAME=i386_nt40
+REM     SYS_NAME = AFS system name
 
+SET SYS_NAME=i386_win95
+SET _WIN32_IE=0x400
 
 REM ########################################################################
 REM NTMakefile required definitions:
-REM     AFSDEV_BUILDTYPE = [ CHECKED | FREE ]
-REM     AFSDEV_INCLUDE = <default include directories>
-REM     AFSDEV_LIB = <default library directories>
-REM     AFSDEV_BIN = <default build binary directories>
+REM     AFSDEV_BUILDTYPE = CHECKED / FREE 
+REM     AFSDEV_INCLUDE = default include directories
+REM     AFSDEV_LIB = default library directories
+REM     AFSDEV_BIN = default build binary directories
 
 set AFSDEV_BUILDTYPE=%AFSBLD_TYPE%
 
-set MSVCDIR=c:\dev\tools\DevStudio\vc
+rem Location of VC++ development folder
+set MSVCDIR=c:\progra~1\micros~2\vc98
 
 set AFSDEV_INCLUDE=%MSVCDIR%\include;%MSVCDIR%\mfc\include
 set AFSDEV_LIB=%MSVCDIR%\lib;%MSVCDIR%\mfc\lib
 set AFSDEV_BIN=%MSVCDIR%\bin
 
-set AFSROOT=d:\afs\openafs
+REM ########################################################################
+REM Location of base folder where source lies, build directory
+REM e.g. AFSROOT\SRC is source directory of the build tree
+
+set AFSROOT=D:\Dev\AfsSorce\OpenAF~2.2
 
 REM ########################################################################
 REM NTMakefile optional definitions:
 REM
 REM See NTMakefile.SYS_NAME; will normally use defaults.
 REM
-REM     IS5ROOT = <root directory of the InstallShield5 installation>
-REM     You should only define this if you have InstallShield installed on
-REM     your computer and want to create the setup as part of the build.
 
-set IS5ROOT=d:\progra~1\instal~1\instal~1.1pr
+IF [%HOMEDRIVE%]==[] SET HOMEDRIVE=C:
 
 REM ########################################################################
 REM Options necessary when using bison
index 9b218cb9dba091824afaac58c41b5af9bb86fb4d..941025a0917ad9fe015674715e1dbe88e208819a 100644 (file)
@@ -91,7 +91,7 @@ test_pam: test_pam.o
        esac
 
 clean:
-       /bin/rm -f $(TARGETS) $(OBJS) afs_setcred.o afs_setcred_krb.o core *~
+       /bin/rm -f $(TARGETS) $(OBJS) afs_setcred.o afs_setcred_krb.o core *~ AFS_component_version_number.c
 
 install:       all
        ${INSTALL} -s pam_afs.so.1 ${DESTDIR}lib/pam_afs.so.1
index d5d3b5723abaa7a423f9d4bd95addbf7219480af..b08e48483ba083d2587424bf0fc90edef672d37e 100644 (file)
@@ -41,7 +41,7 @@ pinstall: install.c  AFS_component_version_number.c
                 sgi_* ) \
                         $(CC) -g -I${DESTDIR}include ${CFLAGS} install.c -o pinstall ${LIBS} -lmld ;; \
                 *) \
-                        $(CC) -g -I${DESTDIR}include ${CFLAGS} install.c -o pinstall ${LIBS} ;; \
+                        $(CC) -g -I. -I${DESTDIR}include ${CFLAGS} install.c -o pinstall ${LIBS} ;; \
         esac
        - [ -d test ] && ( cd test; $(MAKE) )
        - [ -d test ] && ./test/test_install
index 82c35dbdd0816a27b8d0dcd7cd09596555f580fb..ebfba3ce4040df0c1bf4cea3e02cc0c05071b8f9 100644 (file)
@@ -34,6 +34,9 @@ ${DESTDIR}lib/afs/libprocmgmt.a: libprocmgmt.a
 install: ${DESTDIR}lib/afs/libprocmgmt.a 
        ${INSTALL} procmgmt.h ${DESTDIR}include/afs
 
+includes:
+       ${INSTALL} procmgmt.h ${DESTDIR}include/afs
+
 clean:
        $(RM) -f *.o libprocmgmt.a   \
         core  AFS_component_version_number.c
index 92dfe7046d760b81eac35baf35bd9982fb472981..71dfb0284babe4eda5e8b25da91b6ba045e23689 100644 (file)
@@ -49,7 +49,7 @@ KILL_EXEOBJS =\
 KILL_EXELIBS =\
        $(DESTDIR)\lib\afs\afsprocmgmt.lib
 
-$(RS_KILL_EXEFILE): $(KILL_EXEOBJS) $(KILL_EXELIBS)
+$(RS_KILL_EXEFILE): $(KILL_EXEOBJS)    $(KILL_EXELIBS)
        $(EXECONLINK)
        $(EXEPREP)
 
@@ -68,6 +68,9 @@ afskill.res: afskill.rc AFS_component_version_number.h
 
 install_headers: $(INCFILES)
 
+install9x: install_headers
+
 install: install_headers $(DLLFILE) $(CL_KILL_EXEFILE)
 
 clean::
+       $(DEL) $(INCFILES)
\ No newline at end of file
index 3a0308fa4c7f76f88de5769918fe098ae273b8ef..ed79932b11b689a7decde8b4cddd002c217305a9 100644 (file)
@@ -14,7 +14,7 @@ RXGEN=${SRCDIR}bin/rxgen
 COMPILE_ET = ${SRCDIR}bin/compile_et
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
-CFLAGS = $(DBUG) -I${SRCDIR}include ${XCFLAGS}
+CFLAGS = $(DBUG) -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS}
 INCLS=${SRCDIR}include/ubik.h \
        ${SRCDIR}include/lock.h  \
        ${SRCDIR}include/lwp.h \
@@ -56,7 +56,7 @@ include ../config/Makefile.version
 clean:
        $(RM) -f *.o ptserver ptint.cs.c ptint.ss.c ptclient ptint.xdr.c ptint.h \
        libprot.a  pts readgroup readpwd db_verify testpt pt_util pterror.h pterror.c \
-        core  AFS_component_version_number.c
+        core  AFS_component_version_number.c Kptint.cs.c Kptint.h Kptint.xdr.c
 
 ptserver: ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${auditlib}
        $(CC) ${CFLAGS} -o ptserver ptserver.o ptutils.o ptprocs.o  ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${XLIBS} ${auditlib}
@@ -173,3 +173,12 @@ install: all ukinstall ${DESTDIR}root.server/usr/afs/bin/ptserver ${DESTDIR}root
        ${INSTALL} ptclient.h ${DESTDIR}include/afs/prclient.h
        ${INSTALL} -f db_verify ${DESTDIR}etc/prdb_check
        echo '#define ERROR_TABLE_BASE_pr ERROR_TABLE_BASE_pt' >> ${DESTDIR}include/afs/prerror.h
+
+libinstall: ${DESTDIR}lib/afs/libprot.a
+       ${INSTALL} libprot.a ${DESTDIR}lib/afs/libprot.a
+       ${INSTALL} ptserver.h ptint.h pterror.h ptclient.h ${DESTDIR}include/afs
+       ${INSTALL} ptserver.h ${DESTDIR}include/afs/prserver.h
+       ${INSTALL} ptint.h ${DESTDIR}include/afs/print.h
+       ${INSTALL} pterror.h ${DESTDIR}include/afs/prerror.h
+       ${INSTALL} ptclient.h ${DESTDIR}include/afs/prclient.h
+
index 656a7c2b448d1d42e7097d3d0c2c0b647b86e819..7c9d2bfc91555ee4664c309dd66806616a3efe1a 100644 (file)
@@ -8,7 +8,7 @@
 # Override default definitions in NTMakefile.$(SYS_NAME) before including.
 
 !INCLUDE ..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\config\NTMakefile.version
+!include ..\config\NTMakefile.version
 
 
 ############################################################################
@@ -65,8 +65,11 @@ 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\afsprocmgmt.lib
+       $(DESTDIR)\lib\afs\afsreg.lib
+
+!IF (("$(SYS_NAME)"!="i386_win95" ) && ("$(SYS_NAME)"!="I386_WIN95" ))
+PTSERVER_EXELIBS =$(PTSERVER_EXELIBS) $(DESTDIR)\lib\afs\afsprocmgmt.lib
+!ENDIF
 
 
 $(PTSERVER): $(PTSERVER_EXEOBJS) $(PTSERVER_EXELIBS)
@@ -138,6 +141,12 @@ install: $(INCFILES) $(LIBFILE) $(PTSERVER) $(PTS) readgroup.exe \
        $(INCFILEDIR)\afs\prserver.h $(INCFILEDIR)\afs\print.h \
        $(INCFILEDIR)\afs\prerror.h $(INCFILEDIR)\afs\prclient.h
 
+install9X: $(INCFILES) $(LIBFILE) $(PTS) \
+       $(DESTDIR)\root.server\usr\afs\bin\pts.exe \
+       $(INCFILEDIR)\afs\prserver.h $(INCFILEDIR)\afs\print.h \
+       $(INCFILEDIR)\afs\prerror.h $(INCFILEDIR)\afs\prclient.h
+
+install_libutils: $(INCFILES) $(LIBFILE) $(PTS)
 
 # install various exe's and header files
 $(DESTDIR)\root.server\usr\afs\bin\pts.exe: $(PTS)
@@ -163,6 +172,7 @@ clean::
        $(DEL) ptint.cs.c ptint.ss.c ptclient ptint.xdr.c ptint.h
        $(DEL) readgroup.exe readpwd.exe db_verify.exe testpt.exe 
        $(DEL) pterror.h pterror.c
+       $(DEL) $(PTS)
 
 ############################################################################
 # tests?
index 56371f6be6a9ce7058b28176e6228aab0d4ce39b..15fc531128cc34e4af2ef54bddaf72004fee630f 100644 (file)
@@ -43,7 +43,6 @@ struct afsconf_dir *prdir;
 extern afs_int32 ubik_lastYesTime;
 extern afs_int32 ubik_nBuffers;
 
-extern int afsconf_ClientAuth();
 extern int afsconf_ServerAuth();
 extern int afsconf_CheckAuth();
 
@@ -158,13 +157,17 @@ void main (argc, argv)
 
                /* hack in help flag support */
 
-               printf ("Usage: ptserver [-database <db path>] "
 #ifndef AFS_NT40_ENV
+               printf ("Usage: ptserver [-database <db path>] "
                        "[-syslog[=FACILITY]] "
-#endif
                        "[-p <number of processes>] [-rebuild] "
-                       /* "[-enable_peer_stats] [-enable_process_stats] " */
+                       "[-enable_peer_stats] [-enable_process_stats] "
+                       "[-help]\n");
+#else
+               printf ("Usage: ptserver [-database <db path>] "
+                       "[-p <number of processes>] [-rebuild] "
                        "[-help]\n");
+#endif
                fflush(stdout);
 
            PT_EXIT(1);
@@ -252,7 +255,6 @@ void main (argc, argv)
     sc[0] = rxnull_NewServerSecurityObject();
     sc[1] = 0;
     if (kerberosKeys) {
-       extern int afsconf_GetKey();
        sc[2] = rxkad_NewServerSecurityObject
            (0, prdir, afsconf_GetKey, (char *)0);
     }
index e4596d48ab08ee1364a98fad09affa32d9f7bb05..ccc4c46a2938b5a2b3524bc3cda1661031d69892 100644 (file)
@@ -21,6 +21,7 @@
 #include <ubik.h>
 #include <rx/xdr.h>
 #include <afs/com_err.h>
+#include <afs/cellconfig.h>
 #include "ptserver.h"
 #include "pterror.h"
 #include <stdlib.h>
index a9733fff51a250efecc356c4498c04cf7a751973..29e7900fb05766f47f5979b3b6ffba7fe01abb3b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ubik.c,v 1.1 2001/01/19 20:55:46 hartmans Exp $ */
+/* $Id: ubik.c,v 1.1.1.2 2001/07/05 01:03:43 hartmans Exp $ */
 
 #include <sys/types.h>
 #include <netinet/in.h>
index 6a53dd110cb92ebc18e7c2672c4d3536ad1521ef..fa5e15ae244f5071e978b88503cafbd56bb46d13 100644 (file)
@@ -103,7 +103,7 @@ static inline void MUTEX_EXIT(afs_kmutex_t *l)
  * a global lock. Thus we can safely drop our locks before calling the
  * kernel sleep services.
  */
-static inline CV_WAIT(afs_kcondvar_t *cv, afs_kmutex_t *l)
+static inline int CV_WAIT(afs_kcondvar_t *cv, afs_kmutex_t *l)
 {
     int isAFSGlocked = ISAFS_GLOCK(); 
 
@@ -122,7 +122,7 @@ static inline CV_WAIT(afs_kcondvar_t *cv, afs_kmutex_t *l)
     return 0;
 }
 
-static inline CV_TIMEDWAIT(afs_kcondvar_t *cv, afs_kmutex_t *l, int waittime)
+static inline int CV_TIMEDWAIT(afs_kcondvar_t *cv, afs_kmutex_t *l, int waittime)
 {
     int isAFSGlocked = ISAFS_GLOCK();
     long t = waittime * HZ / 1000;
index 1056e225cae60f78742b84601bf808d99e9756d9..1d75a840e0b3ad14fe19274382f6eeaed5849162 100644 (file)
@@ -14,7 +14,7 @@ UKERNELDIR = ../libuafs/
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 #CC=pcc
-CFLAGS = ${OPTMZ} -I${SRCDIR}include -DRXDEBUG ${XCFLAGS}
+CFLAGS = ${OPTMZ} -I${TOP_SRCDIR}/config -I${SRCDIR}include -DRXDEBUG ${XCFLAGS}
 
 #
 # Generic xdr objects (or, at least, xdr stuff that's not newly defined for rx).
@@ -24,12 +24,25 @@ XDROBJS = xdr_arrayn.o xdr_rx.o xdr_afsuuid.o
 
 RXOBJS = rx_clock.o rx_event.o rx_user.o rx_lwp.o rx.o rx_null.o rx_globals.o \
        rx_getaddr.o rx_misc.o rx_packet.o rx_rdwr.o  rx_trace.o rx_conncache.o \
-       xdr_int64.o
+       xdr_int64.o 
 
 MULTIOBJS = rx_multi.o
 
 LIBOBJS = ${RXOBJS} ${MULTIOBJS} ${XDROBJS}
 
+LIBOBJS_djgpp = ${RXOBJS_djgpp} ${MULTIOBJS} ${XDROBJS_djgpp}
+
+XMIT = rx_xmit_nt.o
+XMIT_H = rx_xmit_nt.h
+
+XDROBJS_djgpp = xdr.o xdr_rec.o xdr_stdio.o \
+       xdr_float.o  xdr_refernce.o  xdr_update.o \
+       xdr_array.o xdr_mem.o xdr_rx.o xdr_afsuuid.o
+
+RXOBJS_djgpp = rx_clock.o rx_event.o rx_user.o rx_lwp.o rx.o rx_null.o rx_globals.o \
+               rx_getaddr.o rx_misc.o rx_packet.o rx_rdwr.o  rx_trace.o rx_conncache.o \
+               xdr_int64.o $(XMIT)
+
 BASICINCLS = ${SRCDIR}include/lwp.h ${SRCDIR}include/lock.h \
             rx_clock.h rx_queue.h rx_event.h
 
@@ -96,9 +109,14 @@ xdr_refernce.o: xdr_refernce.c xdr.h
 
 librx.a: ${LIBOBJS} RX_component_version_number.o
        -rm -f $@
-       ar rv $@ RX_component_version_number.o ${LIBOBJS}
+       $(AR) rv $@ RX_component_version_number.o ${LIBOBJS}
        $(RANLIB) $@
 
+librx-djgpp: ${LIBOBJS_djgpp} RX_component_version_number.o
+       -rm -f librx.a
+       $(AR) rv librx.a RX_component_version_number.o ${LIBOBJS_djgpp}
+       $(RANLIB) librx.a
+
 ${DESTDIR}etc/rxdebug: rxdebug
        ${INSTALL} rxdebug ${DESTDIR}etc/rxdebug
 
@@ -108,7 +126,14 @@ rxdebug: rxdebug.o ${DESTDIR}lib/afs/util.a ${DESTDIR}lib/afs/libsys.a
 install.noversion noversion install all system: librx.a includes kinstall ukinstall
        ${INSTALL} librx.a ${DESTDIR}lib
 
-includes: rx.h rx_user.h rx_event.h rx_queue.h rx_clock.h xdr.h rx_null.h rx_globals.h
+install-djgpp: librx-djgpp includes includes-djgpp kinstall ukinstall
+       ${INSTALL} librx.a ${DESTDIR}lib
+
+includes-djgpp: $(XMIT_H)
+       set ${DESTDIR}include/rx; $(MKDIR_IF_NEEDED)
+       ${INSTALL} $(XMIT_H) ${DESTDIR}include/rx
+
+includes: rx.h rx_user.h rx_event.h rx_queue.h rx_clock.h xdr.h rx_null.h rx_globals.h 
        set ${DESTDIR}include/rx; $(MKDIR_IF_NEEDED)
        ${INSTALL} rx_packet.h rx.h rx_user.h rx_event.h rx_queue.h \
        rx_globals.h \
@@ -144,4 +169,4 @@ ukinstall webinstall: includes
        -$(INSTALL) UKERNEL/*.[ch] $(UKERNELDIR)rx
 
 clean:
-       rm -f *.o *.a core *_component_version_number.c
+       rm -f *.o *.a core *_component_version_number.c rxdumptrace rxdebug
index 004ad2946f386a8e3093af1d5379c5fa6f41470e..4de8de03597edfae19c291df93bf8cd210b83ee4 100644 (file)
@@ -11,6 +11,7 @@
 # RX has different strings for it's version number.
 VERSFILE=RX_component_version_number
 CML_PREFIX=rx_
+
 !include ..\config\NTMakefile.version
 
 # Additional debugging flag for RX.
@@ -84,5 +85,6 @@ $(RXDEBUG): $(RXDOBJS) $(RXDLIBS)
        $(EXECONLINK)
        $(EXEPREP)
 
-
 install: $(LIBFILE) $(INCFILES) $(RXDEBUG)
+
+install9x: $(LIBFILE) $(INCFILES)
index 7820cb0687e757c0db2dbfe31013aac34498c047..addb64cff460d6bc5a7c1f5725492ed8e98b54a2 100644 (file)
@@ -90,6 +90,10 @@ int rx_ReadProc();
 int rx_ReadvProc();
 int rx_ReadProc32();
 void rx_FlushWrite();
+void rxi_DeleteCachedConnections();
+void rxi_DestroyConnection();
+void rxi_CleanupConnection();
+int rxi_Listen();
 int rxi_WriteProc();
 int rxi_WritevProc();
 int rxi_WritevAlloc();
@@ -97,16 +101,44 @@ int rxi_ReadProc();
 int rxi_ReadvProc();
 int rxi_FillReadVec();
 void rxi_FlushWrite();
+int rxi_getAllAddrMaskMtu();
+int rx_getAllAddr();
+void rxi_FreePacket();
+void rxi_FreePacketNoLock();
+int rxi_AllocDataBuf();
+void rxi_RestoreDataBufs();
+void rxi_Sleep();
+void rxi_InitializeThreadSupport();
+int rxi_Recvmsg();
+int rxi_Sendmsg();
+int rxi_IsConnInteresting();
+afs_int32 rx_SlowReadPacket();
+afs_int32 rx_SlowWritePacket();
+afs_int32 rx_SlowGetInt32();
+void rxi_StopListener();
+void rxi_InitPeerParams();
+void rxi_FreeAllPackets();
+void rxi_SendPacketList();
+void rxi_SendPacket();
+void rxi_MorePackets();
+void rxi_MorePacketsNoLock();
+void rxi_PacketsUnWait();
+void rx_CheckPackets();
+void rxi_Wakeup();
 void rx_PrintStats();
 void rx_PrintPeerStats();
 void rx_SetArrivalProc();
 void rx_Finalize();
 void rx_GetIFInfo();
+void shutdown_rxevent();
+int clock_UnInit();
+void rxi_Delay(int);
 #ifndef KERNEL
 typedef void (*rx_destructor_t)(void *);
 int rx_KeyCreate(rx_destructor_t);
 void *rx_GetSpecific(struct rx_connection *conn, int key);
 void rx_SetSpecific(struct rx_connection *conn, int key, void *ptr);
+osi_socket rxi_GetUDPSocket(u_short port);
 #endif /* KERNEL */
 int ntoh_syserr_conv(int error);
 
@@ -481,6 +513,7 @@ struct rx_connection {
 #define RX_CONN_USING_PACKET_CKSUM  4  /* non-zero header.spare field seen */
 #define RX_CONN_KNOW_WINDOW         8   /* window size negotiation works */
 #define RX_CONN_RESET             16   /* connection is reset, remove */
+#define RX_CONN_BUSY               32   /* connection is busy; don't delete */
 
 /* Type of connection, client or server */
 #define        RX_CLIENT_CONNECTION    0
index 546ae0f662c21ea45e9433cc2428846a5be25488..5972e20caaf35eb7dedc0f7aec64c6216568aa5a 100644 (file)
@@ -72,9 +72,11 @@ void clock_Init(void) {
 
 #ifndef KERNEL
 /* Make clock uninitialized. */
+int
 clock_UnInit()
 {
     clockInitialized = 0;
+    return 0;
 } 
 #endif 
 
index 2fc2784ef0461b8933ebe6e70916aff23bc5a5dc..09d2e8adbd645b4f8e74271194143b9f05bb0e8d 100644 (file)
@@ -24,7 +24,6 @@
 #include "rx.h"
 #endif /* UKERNEL */
 
-extern void rxi_DestroyConnection(struct rx_connection *);
 /*
  * We initialize rxi_connectionCache at compile time, so there is no
  * need to call queue_Init(&rxi_connectionCache).
@@ -133,7 +132,7 @@ static void rxi_AddCachedConnection(rx_connParts_p parts,
                                 struct rx_connection **conn) {
     cache_entry_p new_entry;
  
-    if(new_entry = (cache_entry_p) malloc(sizeof(cache_entry_t))) {
+    if((new_entry = (cache_entry_p) malloc(sizeof(cache_entry_t)))) {
         new_entry->conn = *conn;
         new_entry->parts = *parts;
         new_entry->inUse = 1;
index b527a7aefe5230e9a10e24409a42f3b980b03ced..ce580dcbf4e5b83516002c086e7e284749b1152c 100644 (file)
@@ -170,7 +170,6 @@ struct rxevent *rxevent_Post(struct clock *when, void (*func)(),
 {
     register struct rxevent *ev, *evqe, *evqpr;
     register struct rxepoch *ep, *epqe, *epqpr;
-    struct clock ept;
     int isEarliest = 0;
 
     MUTEX_ENTER(&rxevent_lock);
@@ -179,7 +178,9 @@ struct rxevent *rxevent_Post(struct clock *when, void (*func)(),
     if (rx_Log_event) {
        struct clock now;
        clock_GetTime(&now);
-       fprintf(rx_Log_event, "%d.%d: rxevent_Post(%d.%d, %x, %x)\n", now.sec, now.usec, when->sec, when->usec, func, arg);
+       fprintf(rx_Log_event, "%d.%d: rxevent_Post(%d.%d, %x, %x)\n", 
+           (int) now.sec, (int) now.usec, (int) when->sec, 
+           (int) when->usec, (unsigned int) func, (unsigned int) arg);
     }
 #endif
 
@@ -291,9 +292,10 @@ void rxevent_Cancel_1(ev)
     if (rx_Log_event) {
        struct clock now;
        clock_GetTime(&now);
-       fprintf(rx_Log_event, "%d.%d: rxevent_Cancel_1(%d.%d, %x, %x)\n", now.sec,
-               now.usec, ev->eventTime.sec, ev->eventTime.usec, ev->func,
-               ev->arg);
+       fprintf(rx_Log_event, "%d.%d: rxevent_Cancel_1(%d.%d, %x, %x)\n", 
+               (int) now.sec, (int) now.usec, (int) ev->eventTime.sec, 
+               (int) ev->eventTime.usec, (unsigned int) ev->func,
+               (unsigned int) ev->arg);
     }
 #endif
     /* Append it to the free list (rather than prepending) to keep the free
@@ -381,7 +383,8 @@ int rxevent_RaiseEvents(next)
        } while (queue_IsNotEmpty(&ep->events));
     }
 #ifdef RXDEBUG
-    if (rx_Log_event) fprintf(rx_Log_event, "rxevent_RaiseEvents(%d.%d)\n", now.sec, now.usec);
+    if (rx_Log_event) fprintf(rx_Log_event, "rxevent_RaiseEvents(%d.%d)\n", 
+       (int) now.sec, (int) now.usec);
 #endif
     rxevent_raiseScheduled = 0;
     MUTEX_EXIT(&rxevent_lock);
index 1432d6e68f48cd4a3c0596a4f4ff477469f48dd0..5e02a0af300047e5e98cd43e64d08f0a8b4f9f41 100644 (file)
@@ -7,11 +7,13 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
+
 #ifndef lint
 #endif
 /* getaddr -- get our internet address. July, 1986 */
 
 #include <afs/param.h>
+#ifndef AFS_DJGPP_ENV
 #ifndef KERNEL
 #ifndef AFS_NT40_ENV
 #include <sys/types.h>
@@ -63,6 +65,7 @@ afs_int32 rxi_getaddr() {
 #ifndef KERNEL
 
 /* to satisfy those who call setaddr */
+int
 rxi_setaddr(x)
 afs_int32 x; {
     return 0;
@@ -325,7 +328,9 @@ int    maxSize;        /* sizeof of buffer in afs_int32 units */
     struct ifconf   ifc;
     struct ifreq    ifs[NIFS], *ifr;
     struct sockaddr_in *a;
+#if     defined(AFS_AIX41_ENV) || defined(AFS_USR_AIX_ENV)
     char       *cp, *cplim;    /* used only for AIX 41 */
+#endif
 
     s = socket(AF_INET, SOCK_DGRAM, 0);
     if (s < 0)
@@ -390,9 +395,11 @@ int rxi_getAllAddrMaskMtu (addrBuffer, maskBuffer, mtuBuffer, maxSize)
    int     s;
    int     i, len, count=0;
    struct ifconf   ifc;
-   struct ifreq    ifs[NIFS], *ifr, tempIfr;
+   struct ifreq    ifs[NIFS], *ifr;
    struct sockaddr_in *a;
+#if     defined(AFS_AIX41_ENV) || defined(AFS_USR_AIX_ENV)
    char        *cp, *cplim;    /* used only for AIX 41 */
+#endif
 
 #if !defined(AFS_USERSPACE_IP_ADDR)
    count = rx_getAllAddr(addrBuffer, 1024);
@@ -480,3 +487,5 @@ int rxi_getAllAddrMaskMtu (addrBuffer, maskBuffer, mtuBuffer, maxSize)
 
 #endif /* ! AFS_NT40_ENV */
 #endif /* !KERNEL || UKERNEL */
+
+#endif /* !AFS_DJGPP_ENV */
index 63ad212fe4f606102159c9e3377e65dcb2e373ac..f018c10f90bf61b3957e46dd38de98b495cb0820 100644 (file)
@@ -58,7 +58,7 @@ void rxi_Wakeup(void *addr)
 }
 
 PROCESS rx_listenerPid = 0;    /* LWP process id of socket listener process */
-void rx_ListenerProc(void *dummy);
+static void rx_ListenerProc(void *dummy);
 
 /*
  * Delay the current thread the specified number of seconds.
@@ -149,7 +149,10 @@ void rxi_ListenerProc(rfds, tnop, newcallp)
     afs_int32 nextPollTime;            /* time to next poll FD before sleeping */
     int lastPollWorked, doingPoll;     /* true iff last poll was useful */
     struct timeval tv, *tvp;
-    int i, code;
+    int code;
+#ifdef AFS_NT40_ENV
+    int i;
+#endif
     PROCESS pid;
     char name[MAXTHREADNAMELENGTH] = "srv_0";
 
@@ -364,11 +367,19 @@ int rxi_Listen(sock)
      * Put the socket into non-blocking mode so that rx_Listener
      * can do a polling read before entering select
      */
+#ifndef AFS_DJGPP_ENV
     if (fcntl(sock, F_SETFL, FNDELAY) == -1) {
        perror("fcntl");
        (osi_Msg "rxi_Listen: unable to set non-blocking mode on socket\n");
        return -1;
     }
+#else
+    if ( __djgpp_set_socket_blocking_mode(sock, 1) < 0 ) {
+      perror("__djgpp_set_socket_blocking_mode");
+      (osi_Msg "rxi_Listen: unable to set non-blocking mode on socket\n");
+      return -1;
+    }
+#endif /* AFS_DJGPP_ENV */
 
     if (sock > FD_SETSIZE-1) {
        (osi_Msg "rxi_Listen: socket descriptor > (FD_SETSIZE-1) = %d\n",
@@ -432,4 +443,5 @@ int rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags)
     }
     if (sfds)
        IOMGR_FreeFDSet(sfds);
+    return 0;
 }
index c0299d46a38d657d15a28d227b003f2c4bee2a8c..555c549bb6346fb3f4d688183d18a8a735ae3850 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #ifdef KERNEL
 #include <afs/sysincludes.h>
 #include <afs/afsincludes.h>
 #ifdef AFS_PTHREAD_ENV
 #include "rx.h"
 #endif /* AFS_PTHREAD_ENV */
+#include <stdlib.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #endif
 
 /*
@@ -36,6 +48,7 @@
  * Convert from the local (host) to the standard 
  * (network) system error code.
  */
+int
 hton_syserr_conv(code)
     register afs_int32 code;
 {
@@ -43,7 +56,7 @@ hton_syserr_conv(code)
 
     if (code == ENOSPC)
        err = VDISKFULL;
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_NT40_ENV)
+#if !defined(AFS_SUN5_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
     /* EDQUOT doesn't exist on solaris */
     else if (code == EDQUOT)
        err = VOVERQUOTA;
@@ -58,6 +71,7 @@ hton_syserr_conv(code)
  * Convert from the standard (Network) format to the
  * local (host) system error code.
  */
+int
 ntoh_syserr_conv(int code)
 {
     register afs_int32 err;
@@ -65,7 +79,7 @@ ntoh_syserr_conv(int code)
     if (code == VDISKFULL)
        err = ENOSPC;
     else if (code == VOVERQUOTA)
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV)
        err = ENOSPC;
 #else
        err = EDQUOT;
@@ -114,15 +128,17 @@ char * osi_alloc(x)
     return (char *)(mem_alloc(x));
 }
 
+int
 osi_free(x, size)
     char *x;
     afs_int32 size; 
 {
-    if ((x == &memZero) || !x) return;
+    if ((x == &memZero) || !x) return 0;
     LOCK_MALLOC_STATS
     osi_alloccnt--; osi_allocsize -= size;
     UNLOCK_MALLOC_STATS
     mem_free(x, size);
+    return 0;
 }
 #endif
 #endif /* KERNEL */
index 362e6fad1a919255d4c4e4462d339d55bc48ab48..30323847a6ed791495aa7f9a8f50b79dae0ddd15 100644 (file)
@@ -9,6 +9,7 @@
 
 #ifdef KERNEL
 #include "../afs/param.h"
+#include <afsconfig.h>
 #if defined(UKERNEL)
 #include "../afs/sysincludes.h"
 #include "../afs/afsincludes.h"
 #include "../rx/rx_globals.h"
 #else /* KERNEL */
 #include <afs/param.h>
+#include <afsconfig.h>
 #include "sys/types.h"
 #include <sys/stat.h>
 #include <errno.h>
+#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV)
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+#endif /* AFS_NT40_ENV */
 #include "rx_xmit_nt.h"
 #include <stdlib.h>
 #else
 #include "rx_globals.h"
 #include <lwp.h>
 #include "rx_internal.h"
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #endif /* KERNEL */
 
-
 #ifdef RX_LOCKS_DB
 /* rxdb_fileID is used to identify the lock location, along with line#. */
 static int rxdb_fileID = RXDB_FILE_RX_PACKET;
@@ -77,12 +93,9 @@ struct rx_packet *rx_mallocedP = 0;
 extern char cml_version_number[];
 extern int (*rx_almostSent)();
 
-void rxi_FreePacketNoLock(struct rx_packet *p);
 static void rxi_SendDebugPacket(struct rx_packet *apacket, osi_socket asocket,
-                              afs_int32 ahost, short aport, afs_int32 istack);
+                               afs_int32 ahost, short aport, afs_int32 istack);
 
-extern char cml_version_number[];
-extern int (*rx_almostSent)();
 /* some rules about packets:
  * 1.  When a packet is allocated, the final iov_buf contains room for
  * a security trailer, but iov_len masks that fact.  If the security
@@ -207,9 +220,6 @@ afs_int32 rx_SlowWritePacket(struct rx_packet *packet, int offset, int resid,
 static struct rx_packet * allocCBuf(int class)
 {
   struct rx_packet *c;
-#ifndef KERNEL
-  extern void rxi_MorePacketsNoLock();
-#endif /* !KERNEL */
   SPLVAR;
   
   NETPRI;
@@ -259,7 +269,9 @@ static struct rx_packet * allocCBuf(int class)
     osi_Panic("rxi_AllocPacket: packet not free\n");
   c->header.flags = 0;
   
+#ifdef KERNEL
  done:
+#endif
   MUTEX_EXIT(&rx_freePktQ_lock);
   
   USERPRI;
@@ -271,7 +283,6 @@ static struct rx_packet * allocCBuf(int class)
  */
 void rxi_freeCBuf(struct rx_packet *c)
 {
-  extern void rxi_PacketsUnWait();
   SPLVAR;
   
   NETPRI;
@@ -325,7 +336,7 @@ int rxi_AllocDataBuf(struct rx_packet *p, int nb, int class)
   
   for (i=p->niovecs; nb>0 && i<RX_MAXWVECS; i++) {  
       register struct rx_packet *cb;
-      if (cb = allocCBuf(class)) {
+      if ((cb = allocCBuf(class))) {
          p->wirevec[i].iov_base = (caddr_t) cb->localdata;
          p->wirevec[i].iov_len = RX_CBUFFERSIZE;
          nb -= RX_CBUFFERSIZE;
@@ -341,7 +352,6 @@ int rxi_AllocDataBuf(struct rx_packet *p, int nb, int class)
 /* Add more packet buffers */
 void rxi_MorePackets(int apackets)
 {
-  extern void rxi_PacketsUnWait();
   struct rx_packet *p, *e;
   int getme;
   SPLVAR;
@@ -378,7 +388,6 @@ void rxi_MorePackets(int apackets)
 /* Add more packet buffers */
 void rxi_MorePacketsNoLock(int apackets)
 {
-  extern void rxi_PacketsUnWait();
   struct rx_packet *p, *e;
   int getme;
 
@@ -504,7 +513,6 @@ int rxi_TrimDataBufs(p, first)
      struct rx_packet * p;
      int first;
 {
-  extern void rxi_PacketsUnWait();
   int length;
   struct iovec *iov, *end;
   SPLVAR;
@@ -547,7 +555,6 @@ int rxi_TrimDataBufs(p, first)
  * remove it yourself first if you call this routine. */
 void rxi_FreePacket(struct rx_packet *p)
 {
-  extern void rxi_PacketsUnWait();
   SPLVAR;
   
   NETPRI;
@@ -665,7 +672,7 @@ int want;
     while (!(call->error)) {
       MUTEX_ENTER(&rx_freePktQ_lock);
       /* if an error occurred, or we get the packet we want, we're done */
-      if (p = rxi_AllocPacketNoLock(RX_PACKET_CLASS_SEND)) {
+      if ((p = rxi_AllocPacketNoLock(RX_PACKET_CLASS_SEND))) {
        MUTEX_EXIT(&rx_freePktQ_lock);
 
        want += delta;
@@ -1179,7 +1186,7 @@ struct rx_packet *rxi_ReceiveDebugPacket(ap, asocket, ahost, aport, istack)
                        tconn.serial = htonl(tc->serial);
                        for(j=0;j<RX_MAXCALLS;j++) {
                            tconn.callNumber[j] = htonl(tc->callNumber[j]);
-                           if (tcall=tc->call[j]) {
+                           if ((tcall=tc->call[j])) {
                                tconn.callState[j] = tcall->state;
                                tconn.callMode[j] = tcall->mode;
                                tconn.callFlags[j] = tcall->flags;
@@ -1243,7 +1250,7 @@ struct rx_packet *rxi_ReceiveDebugPacket(ap, asocket, ahost, aport, istack)
         */
 
        case RX_DEBUGI_GETPEER: {
-           int i, j;
+           int i;
            register struct rx_peer *tp;
            struct rx_debugPeer tpeer;
 
@@ -1390,7 +1397,7 @@ static void rxi_SendDebugPacket(struct rx_packet *apacket, osi_socket asocket,
     int i;
     int nbytes;
     int saven = 0;
-    size_t savelen;
+    size_t savelen = 0;
 #ifdef KERNEL
     int waslocked = ISAFS_GLOCK();
 #endif
@@ -1435,7 +1442,9 @@ static void rxi_SendDebugPacket(struct rx_packet *apacket, osi_socket asocket,
 void rxi_SendPacket(struct rx_connection * conn, struct rx_packet *p,
                    int istack)
 {
+#if defined(KERNEL)
     int waslocked;
+#endif
     struct sockaddr_in addr;
     register struct rx_peer *peer = conn->peer;
     osi_socket socket;
@@ -1544,11 +1553,13 @@ void rxi_SendPacketList(struct rx_connection * conn,
                        int len,
                        int istack)
 {
+#if     defined(AFS_SUN5_ENV) && defined(KERNEL)
     int waslocked;
+#endif
     struct sockaddr_in addr;
     register struct rx_peer *peer = conn->peer;
     osi_socket socket;
-    struct rx_packet *p;
+    struct rx_packet *p = NULL;
     struct iovec wirevec[RX_MAXIOVECS];
     int i, length;
     afs_uint32 serial;
@@ -1724,7 +1735,7 @@ rxi_SendSpecial(call, conn, optionalPacket, type, data, nbytes, istack)
      * packet sends (it's repeated elsewhere) */
     register struct rx_packet *p;
     unsigned int i = 0;
-    int savelen, saven = 0;
+    int savelen = 0, saven = 0;
     int channel, callNumber;
     if (call) {
        channel = call->channel;
index cb49d1e477ef04b1310a5545a3d734674e65dcb1..8941e26a304930101bb1ba850d4c94ea590d2b66 100644 (file)
 #ifndef _RX_PACKET_
 #define _RX_PACKET_
 #ifndef UKERNEL
-#ifdef AFS_NT40_ENV
+#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV)
 #include "rx_xmit_nt.h"
-#else
-#include <sys/uio.h>
 #endif
+#ifndef AFS_NT40_ENV
+#include <sys/uio.h>
+#endif /* !AFS_NT40_ENV */
 #endif /* !UKERNEL */
 /* this file includes the macros and decls which depend on packet
  * format, and related packet manipulation macros.  Note that code
@@ -32,7 +33,7 @@
  */
 
 
-#ifdef AFS_NT40_ENV
+#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV)
 #ifndef MIN
 #define MIN(a,b)  ((a)<(b)?(a):(b))
 #endif
index c81f86b05b5c2d2732a3a7805b0b145304e3f80e..da567a84104a44a8829cc6a761c5ff1141565a1e 100644 (file)
@@ -69,7 +69,7 @@ struct clock rxi_clockNow;
 /*
  * Delay the current thread the specified number of seconds.
  */
-rxi_Delay(sec)
+void rxi_Delay(sec)
     int sec;
 {
     sleep(sec);
index 0b409905cd027b728d78ccb4478335a981984769..e3d68e4e8c4b349344ba835cd994d6ac6a8810a9 100644 (file)
@@ -9,6 +9,7 @@
 
 #ifdef KERNEL
 #include "../afs/param.h"
+#include <afsconfig.h>
 #ifndef UKERNEL
 #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 #include "../afs/sysincludes.h"
@@ -56,6 +57,7 @@
 #endif  /* AFS_ALPHA_ENV */
 #else /* KERNEL */
 # include <afs/param.h>
+# include <afsconfig.h>
 # include <sys/types.h>
 #ifndef AFS_NT40_ENV
 # include <sys/socket.h>
 # include <sys/stat.h>
 # include <sys/time.h>
 #endif
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 # include "rx_user.h"
 # include "rx_clock.h"
 # include "rx_queue.h"
@@ -73,7 +85,6 @@
 # include "rx_internal.h"
 #endif /* KERNEL */
 
-
 #ifdef RX_LOCKS_DB
 /* rxdb_fileID is used to identify the lock location, along with line#. */
 static int rxdb_fileID = RXDB_FILE_RX_RDWR;
@@ -128,7 +139,7 @@ int rxi_ReadProc(call, buf, nbytes)
                * work.  It may reduce the length of the packet by up
                * to conn->maxTrailerSize, to reflect the length of the
                * data + the header. */
-             if (error = RXS_CheckPacket(conn->securityObject, call, rp)) {
+             if ((error = RXS_CheckPacket(conn->securityObject, call, rp))) {
                /* Used to merely shut down the call, but now we 
                 * shut down the whole connection since this may 
                 * indicate an attempt to hijack it */
@@ -401,7 +412,7 @@ int rxi_FillReadVec(call, seq, serial, flags)
     struct rx_packet *rp;
     struct rx_packet *curp;
     struct iovec *call_iov;
-    struct iovec *cur_iov;
+    struct iovec *cur_iov = NULL;
 
     curp = call->currentPacket;
     if (curp) {
@@ -424,7 +435,7 @@ int rxi_FillReadVec(call, seq, serial, flags)
              * work.  It may reduce the length of the packet by up
              * to conn->maxTrailerSize, to reflect the length of the
              * data + the header. */
-           if (error = RXS_CheckPacket(conn->securityObject, call, rp)) {
+           if ((error = RXS_CheckPacket(conn->securityObject, call, rp))) {
              /* Used to merely shut down the call, but now we 
               * shut down the whole connection since this may 
               * indicate an attempt to hijack it */
@@ -732,7 +743,7 @@ int rxi_WriteProc(call, buf, nbytes)
                }
 #endif /* RX_ENABLE_LOCKS */
            }
-           if (cp = rxi_AllocSendPacket(call, nbytes)) {
+           if ((cp = rxi_AllocSendPacket(call, nbytes))) {
                call->currentPacket = cp;
                call->nFree = cp->length;
                call->curvec = 1;   /* 0th vec is always header */
@@ -1106,7 +1117,6 @@ int rxi_WritevProc(call, iov, nio, nbytes)
     int nio;
     int nbytes;
 {
-    struct rx_connection *conn = call->conn;
     struct rx_packet *cp = call->currentPacket;
     register struct rx_packet *tp; /* Temporary packet pointer */
     register struct rx_packet *nxp; /* Next packet pointer, for queue_Scan */
@@ -1154,8 +1164,6 @@ int rxi_WritevProc(call, iov, nio, nbytes)
     nextio = 0;
     queue_Init(&tmpq);
     do {
-       unsigned int t;
-
        if (call->nFree == 0 && cp) {
            clock_NewTime(); /* Bogus:  need new time package */
            /* The 0, below, specifies that it is not the last packet: 
index 182fe508484f86be245e36a2a19cb08759d551eb..888bb50989d5055c913aa1d73bb8e1a14047bd39 100644 (file)
 #ifdef RXDEBUG
 
 #include <afs/param.h>
+#include <afsconfig.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
 #ifdef AFS_NT40_ENV
 #include <fcntl.h>
 #include <io.h>
 #else
 #include <sys/file.h>
+#include <unistd.h>
 #endif
 #include "rx.h"
 #include "rx_globals.h"
@@ -120,7 +129,7 @@ void rxi_calltrace(event, call)
 #include <afs/afsutil.h>
 #endif
 
-main(argc, argv)
+int main(argc, argv)
 char **argv;
 {
   struct rx_trace ip;
index 82638947493b428610345127f7b5e7f1a0ae58de..490568d8ecaf9eed9cccd12b3bc31edbe0fd5e01 100644 (file)
@@ -10,6 +10,7 @@
 /* rx_user.c contains routines specific to the user space UNIX implementation of rx */
 
 # include <afs/param.h>
+# include <afsconfig.h>
 # include <sys/types.h>
 # include <errno.h>
 # include <signal.h>
 # include <sys/ioctl.h>
 #endif
 # include <fcntl.h>
-#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV)
+#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
 # include <sys/syscall.h>
 #endif
 #include <afs/afs_args.h>
 #include <afs/afsutil.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
 
 #ifndef        IPPORT_USERRESERVED
 /* If in.h doesn't define this, define it anyway.  Unfortunately, defining
@@ -45,9 +53,6 @@
 # include "rx.h"
 # include "rx_globals.h"
 
-
-extern void rxi_Delay();
-
 #ifdef AFS_PTHREAD_ENV
 #include <assert.h>
 
@@ -86,14 +91,13 @@ pthread_mutex_t rx_if_mutex;
  */
 osi_socket rxi_GetUDPSocket(u_short port)
 {
-    int binds, code;
+    int binds, code=0;
     osi_socket socketFd = OSI_NULLSOCKET;
     struct sockaddr_in taddr;
     char *name = "rxi_GetUDPSocket: ";
-    extern int rxi_Listen(osi_socket sock);
-    int greedy;
+    int greedy=0;
 
-#ifndef AFS_NT40_ENV
+#if !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
     if (ntohs(port) >= IPPORT_RESERVED && ntohs(port) < IPPORT_USERRESERVED) {
 /*     (osi_Msg "%s*WARNING* port number %d is not a reserved port number.  Use port numbers above %d\n", name, port, IPPORT_USERRESERVED);
 */ ;
@@ -125,7 +129,7 @@ osi_socket rxi_GetUDPSocket(u_short port)
       goto error;
     }
 
-#ifndef AFS_NT40_ENV
+#if !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
     /*
      * Set close-on-exec on rx socket 
      */
@@ -140,6 +144,7 @@ osi_socket rxi_GetUDPSocket(u_short port)
 
        len1 = 32766;
        len2 = rx_UdpBufSize;
+#ifndef AFS_DJGPP_ENV
        greedy = 
          (setsockopt(socketFd, SOL_SOCKET, SO_RCVBUF, (char *)&len2,
                      sizeof(len2)) >= 0);
@@ -152,10 +157,13 @@ osi_socket rxi_GetUDPSocket(u_short port)
                      sizeof(len1)) >= 0) &&
          (setsockopt(socketFd, SOL_SOCKET, SO_RCVBUF, (char *)&len2,
                      sizeof(len2)) >= 0);
+#endif /* AFS_DJGPP_ENV */
     }
 
+#ifndef AFS_DJGPP_ENV
     if (!greedy)
        (osi_Msg "%s*WARNING* Unable to increase buffering on socket\n", name);
+#endif /* AFS_DJGPP_ENV */
     if (rxi_Listen(socketFd) < 0) {
        goto error;
     }
@@ -228,7 +236,7 @@ static int myNetFlags[ADDRSPERSITE];
 u_int rxi_numNetAddrs;
 static int Inited = 0;
 
-#if defined(AFS_NT40_ENV)
+#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV)
 int rxi_getaddr(void)
 {
     if (rxi_numNetAddrs > 0)
@@ -314,7 +322,7 @@ return msk;
 
 
 
-#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DJGPP_ENV)
 int rxi_syscall(a3, a4, a5)
 afs_uint32 a3, a4;
 void * a5;
@@ -341,13 +349,15 @@ void rx_GetIFInfo()
 {
     int     s;
     int     i, j, len, res;
+#ifndef AFS_DJGPP_ENV
     struct ifconf   ifc;
     struct ifreq    ifs[ADDRSPERSITE];
-    struct ifreq ifreq, *ifr;
+    struct ifreq *ifr;
 #ifdef AFS_AIX41_ENV
     char buf[BUFSIZ], *cp, *cplim;
 #endif
     struct sockaddr_in *a;
+#endif /* AFS_DJGPP_ENV */
 
     LOCK_IF_INIT
     if (Inited) {
@@ -368,6 +378,7 @@ void rx_GetIFInfo()
     s = socket(AF_INET, SOCK_DGRAM, 0);
     if (s < 0) return;
 
+#ifndef AFS_DJGPP_ENV
 #ifdef AFS_AIX41_ENV
     ifc.ifc_len = sizeof (buf);
     ifc.ifc_buf = buf;
@@ -534,6 +545,10 @@ void rx_GetIFInfo()
        rxi_MorePackets(npackets*(ncbufs+1));
       }
     }
+#else /* AFS_DJGPP_ENV */
+    close(s);
+    return;
+#endif /* AFS_DJGPP_ENV */
 }
 #endif /* AFS_NT40_ENV */
 
index 42ab7957dc996dedc76732cfe9482cc938ba4558..957477b7c2e954e654e866a9b17364f8427e6743 100644 (file)
  */
 
 #include <afs/param.h>
-#ifdef AFS_NT40_ENV
+#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV)
 
+#ifdef AFS_NT40_ENV
 #include <winsock2.h>
+#else
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+typedef int SOCKET;
+#endif
 
 #include "rx.h"
 #include "rx_packet.h"
 #include "rx_globals.h"
 #include "rx_xmit_nt.h"
+#ifdef AFS_NT40_ENV
 #include <malloc.h>
+#endif
 #include <errno.h>
 
 int recvmsg(int socket, struct msghdr *msgP, int flags)
@@ -101,6 +114,7 @@ int sendmsg(int socket, struct msghdr *msgP, int flags)
     code = sendto((SOCKET)socket, sbuf, size, flags,
                  (struct sockaddr*)(msgP->msg_name), msgP->msg_namelen);
 
+#ifdef AFS_NT40_ENV
     if (code == SOCKET_ERROR) {
        code = WSAGetLastError();
        switch (code) {
@@ -116,6 +130,7 @@ int sendmsg(int socket, struct msghdr *msgP, int flags)
        }
        code = -1;
     }
+#endif /* AFS_NT40_ENV */
 
     if (code < size) {
        errno = EIO;
@@ -129,4 +144,4 @@ int sendmsg(int socket, struct msghdr *msgP, int flags)
 
 
 
-#endif
+#endif /* AFS_NT40_ENV || AFS_DJGPP_ENV */
index 5ed6565e1b3b1b405e96b92ac09a9df2ce62beeb..491cca4e5f77260586b697fc632950926bbb6dfc 100644 (file)
 #define _RX_XMIT_NT_H_
 
 
-typedef struct iovec {
+typedef struct iovec
+#ifndef AFS_DJGPP_ENV
+{
        void *iov_base;
        int iov_len;
-} iovec_t;
+}
+#endif
+iovec_t;
 
 struct msghdr {
     char * msg_name;
index 1cd7ffddd99392f2f5ac5bde28a32e80cb6b4efa..6db38b7253606b861fa080227328d97da9954994 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <sys/types.h>
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <errno.h>
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
 #include <sys/socket.h>
 #include <sys/file.h>
 #include <netdb.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_STRINGS_H
+#include <string.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
 #include <sys/stat.h>
 #include <afs/stds.h>
 #include <afs/cmd.h>
@@ -60,7 +75,7 @@ register char *aname;
     return ts->s_port; /* returns it in network byte order */
 }
 
-MainCommand(as, arock)
+int MainCommand(as, arock)
 char *arock;
 struct cmd_syndesc *as;
 {
@@ -491,7 +506,7 @@ struct cmd_syndesc *as;
 #ifndef AFS_NT40_ENV
 #include "AFS_component_version_number.c"
 #endif
-main(argc, argv)
+int main(argc, argv)
 int argc;
 char **argv;
 {
index 095335089562f9626fdde682566e1ebb5b849358..c74a8f0f72fb92918d0145529595f0aec539332d 100644 (file)
@@ -39,7 +39,9 @@
 #define __XDR_INCLUDE__
 #include <afs/param.h>
 #ifdef AFS_NT40_ENV
+#ifndef _MFC_VER
 #include <winsock2.h>
+#endif /* _MFC_VER */
 #endif
 #define        bool_t  int
 #define        enum_t  int
@@ -326,14 +328,16 @@ extern bool_t xdrrec_eof();               /* true iff no more input */
  */
 
 #ifndef xdr_afs_int32
-#ifdef  AFS_64BIT_ENV
 #define xdr_afs_int32 xdr_int
-#else
-#define xdr_afs_int32 xdr_long
-#endif
 #endif
 #ifndef xdr_afs_uint32
 #define xdr_afs_uint32 xdr_u_int
 #endif
+#ifndef xdr_afs_int64
+#define xdr_afs_int64 xdr_int64
+#endif
+#ifndef xdr_afs_uint64
+#define xdr_afs_uint64 xdr_uint64
+#endif
 
 #endif /* __XDR_INCLUDE__ */
index 5755b96a5875b9f0e1bd96c1266f3dccfe5356d1..0975c9b54c11e3665fbb40dc54904c39cfb30720 100644 (file)
@@ -296,6 +296,7 @@ xdrrx_putbytes(xdrs, addr, len)
        return code;
 }
 
+#ifdef undef /* not used */
 static u_int
 xdrrx_getpos(xdrs)
        register XDR *xdrs;
@@ -312,6 +313,7 @@ xdrrx_setpos(xdrs, pos)
         /* Not supported */
         return FALSE;
 }
+#endif
 
 static AFS_RPC_INLINE_T *
 xdrrx_inline(xdrs, len)
index 830f527ef9eea62c50648b9ec64f0c286f4b5624..bf186b869423e4dfac77d2fb456096be4e1647bd 100644 (file)
@@ -18,7 +18,7 @@ OBJS= rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o rpc_scan.o rpc_util.o \
        rpc_svcout.o rpc_clntout.o
 
 GOAL=rxgen
-CFLAGS = ${DBUG} -I${DESTDIR}include ${XCFLAGS}
+CFLAGS = ${DBUG} -I. -I${DESTDIR}include -I${TOP_SRCDIR}/config ${XCFLAGS}
 
 USNS=cellname
 SD=../../../src/CML
index 1c4281c6159923bb79653204318c528c7cb7eae7..37fb77a1969ae532a98c7b39d15214b944b1155a 100644 (file)
@@ -36,6 +36,7 @@ $(EXEFILE): $(EXEOBJS) $(EXELIBS)
 
 install: AFS_component_version_number.c $(EXEFILE) $(INCFILES)
 
+install9x: install
 
 clean::
-       
+       $(DEL) $(EXEFILE)       
index 40f52dcc458b8cd54ebb821ca39c5de638f180c9..34cd0279494c0dfb0546a8e9fe8affe1c25d28f4 100644 (file)
  * 2550 Garcia Avenue
  * Mountain View, California  94043
  */
-#ifndef lint
-static char sccsid[] = "@(#)rpc_clntout.c 1.2 87/06/24 (C) 1987 SMI";
-#endif
 
 /*
  * rpc_clntout.c, Client-stub outputter for the RPC protocol compiler
  * Copyright (C) 1987, Sun Microsytsems, Inc.
  */
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <stdio.h>
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
 #include <string.h>
-#else
-#include <strings.h>
-#endif
 #include "rpc_parse.h"
 #include "rpc_util.h"
 
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_clntout.c,v 1.1.1.2 2001/07/05 01:04:05 hartmans Exp $");
+
 #define DEFAULT_TIMEOUT 25     /* in seconds */
 
 static write_program();
index 0b2820eb4970e22df58fa9f6f63fe1dc357de543..89e5212026d62c00ab313b5d996d2e31d1eddfca 100644 (file)
  * Copyright (C) 1987, Sun Microsystems, Inc. 
  */
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <stdio.h>
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
-#include <string.h>
-#else
+#include <stdlib.h>
+#ifdef HAVE_STRINGS_H
 #include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #endif
 #include "rpc_util.h"
 #include "rpc_parse.h"
 
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_cout.c,v 1.1.1.2 2001/07/05 01:04:06 hartmans Exp $");
+
 static print_header();
 static print_trailer();
 static space();
index 5c7853bc500f017c06adf6ccd766843fa66ff83e..1ddb11941c946a5acb75b4ef0c4f95bb55c448b6 100644 (file)
  * rpc_hout.c, Header file outputter for the RPC protocol compiler 
  * Copyright (C) 1987, Sun Microsystems, Inc. 
  */
+#include <afs/param.h>
+#include <afsconfig.h>
 #include <stdio.h>
 #include <ctype.h>
 #include "rpc_util.h"
 #include "rpc_parse.h"
 
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_hout.c,v 1.1.1.2 2001/07/05 01:04:06 hartmans Exp $");
+
 static pconstdef();
 static pstructdef();
 static puniondef();
index e96aba4881ba67183b7005c4ca8427b09d8a9190..081a2a56f71f4fb15ea5778a36c9491ec3faa92a 100644 (file)
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <limits.h>
 #include <stdio.h>
-#ifdef AFS_AIX32_ENV
-#include <signal.h>
-#endif
+#include <stdlib.h>
 #include <ctype.h>
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
-#include <string.h>
-#else
+#ifdef HAVE_STRINGS_H
 #include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
 #endif
-#ifndef AFS_NT40_ENV
+#ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>
 #endif
 #include "rpc_util.h"
 #include "rpc_parse.h"
 #include "rpc_scan.h"
 
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_main.c,v 1.1.1.4 2001/07/05 01:04:07 hartmans Exp $");
+
 #define EXTEND 1               /* alias for TRUE */
 
 struct commandline {
@@ -120,17 +126,18 @@ static char *XTRA_CPPFLAGS[] = {
 };
 #endif
 
-static c_output();
-static h_output();
-static s_output();
-static l_output();
-static do_registers();
-static parseargs();
+static int c_output();
+static int h_output();
+static int s_output();
+static int l_output();
+static int do_registers();
+static int parseargs();
 
 static int allc = sizeof(allv)/sizeof(allv[0]);
 
 #include "AFS_component_version_number.c"
 
+int
 main(argc, argv)
        int argc;
        char *argv[];
@@ -246,11 +253,7 @@ write_int32_macros(fout)
 
 #if (INT_MAX == 0x7FFFFFFF) && (UINT_MAX == 0xFFFFFFFFu)
        f_print(fout, "#ifndef xdr_afs_int32\n");
-       f_print(fout, "#ifdef AFS_64BIT_ENV\n");
        f_print(fout, "#define xdr_afs_int32 xdr_int\n");
-       f_print(fout, "#else\n");
-       f_print(fout, "#define xdr_afs_int32 xdr_long\n");
-       f_print(fout, "#endif\n");
        f_print(fout, "#endif\n");
        f_print(fout, "#ifndef xdr_afs_uint32\n");
        f_print(fout, "#define xdr_afs_uint32 xdr_u_int\n");
index a774acd66b226cfc89e8d86757d40106acae9c59..34ab13eb4f435bac999b5c988554521feccc4108 100644 (file)
  * Copyright (C) 1987 Sun Microsystems, Inc.
  */
 #include <afs/param.h>
+#include <afsconfig.h>
+#include <stdlib.h>
 #include <stdio.h>
 #include <ctype.h>
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
-#include <string.h>
-#if defined(AFS_SUN5_ENV)
+#ifdef HAVE_STRINGS_H
 #include <strings.h>
-#endif
 #else
-#include <strings.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #endif
 #include "rpc_util.h"
 #include "rpc_scan.h"
 #include "rpc_parse.h"
 
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_parse.c,v 1.1.1.3 2001/07/05 01:04:06 hartmans Exp $");
 
 list *proc_defined[MAX_PACKAGES], *special_defined, *typedef_defined, *uniondef_defined;
 char *SplitStart = NULL;
@@ -121,6 +123,7 @@ static cs_ProcTail_setup();
 static ss_Proc_CodeGeneration();
 static ss_ProcName_setup();
 static ss_ProcParams_setup();
+static ss_ProcProto_setup();
 static ss_ProcSpecial_setup();
 static ss_ProcUnmarshallInParams_setup();
 static ss_ProcCallRealProc_setup();
@@ -1166,7 +1169,7 @@ int split_flag;
            }
            plist->pl.param_flag |= PROCESSED_PARAM;
            for (plist1 = defp->pc.plists; plist1; plist1 = plist1->next) {
-               if (streq(plist->pl.param_type, plist1->pl.param_type) && !(plist1->pl.param_flag & PROCESSED_PARAM)) {
+               if ((plist1->component_kind == DEF_PARAM) && streq(plist->pl.param_type, plist1->pl.param_type) && !(plist1->pl.param_flag & PROCESSED_PARAM)) {
                    char *star="";
                    char *pntr = index(plist1->pl.param_type, '*');
                    if (pntr) star = "*";
@@ -1345,6 +1348,7 @@ definition *defp;
     ss_ProcName_setup(defp);
     if (!cflag) {
        ss_ProcParams_setup(defp, &somefrees);
+       ss_ProcProto_setup(defp, &somefrees);
        ss_ProcSpecial_setup(defp, &somefrees);
        ss_ProcUnmarshallInParams_setup(defp);
        ss_ProcCallRealProc_setup(defp);
@@ -1407,7 +1411,7 @@ int *somefrees;
            }
            plist->pl.param_flag |= PROCESSED_PARAM;
            for (plist1 = defp->pc.plists; plist1; plist1 = plist1->next) {
-               if (streq(plist->pl.param_type, plist1->pl.param_type) && !(plist1->pl.param_flag & PROCESSED_PARAM)) {
+               if ((plist1->component_kind == DEF_PARAM) && streq(plist->pl.param_type, plist1->pl.param_type) && !(plist1->pl.param_flag & PROCESSED_PARAM)) {
                    if (plist1->pl.param_flag & INDIRECT_PARAM) {
                            f_print(fout, ", %s", plist1->pl.param_name);
                    } else if (index(plist1->pl.param_type, '*') == 0) {
@@ -1441,6 +1445,23 @@ int *somefrees;
 }
 
 
+static
+ss_ProcProto_setup(defp, somefrees)
+definition *defp;
+int *somefrees;
+{
+    proc1_list *plist, *plist1;
+    list *listp;
+    definition *defp1;
+    int preserve_flag = 0;
+
+       f_print(fout, "#ifndef KERNEL\n");
+       f_print(fout, "\tafs_int32 %s%s%s%s();\n", prefix, ServerPrefix, 
+               PackagePrefix[PackageIndex], defp->pc.proc_name);
+       f_print(fout, "#endif\n");
+}
+
+
 static
 ss_ProcSpecial_setup(defp, somefrees)
 definition *defp;
@@ -1784,7 +1805,7 @@ er_ProcProcsArray_setup()
 static
 er_ProcMainBody_setup()
 {
-    f_print(fout, "%s%sExecuteRequest(z_call)\n", prefix,  PackagePrefix[PackageIndex]);
+    f_print(fout, "int %s%sExecuteRequest(z_call)\n", prefix,  PackagePrefix[PackageIndex]);
     f_print(fout, "\tregister struct rx_call *z_call;\n");
     f_print(fout, "{\n\tint op;\n");
     f_print(fout, "\tXDR z_xdrs;\n");
@@ -1800,7 +1821,7 @@ er_ProcMainBody_setup()
 static
 er_HeadofOldStyleProc_setup()
 {
-    f_print(fout, "\n%s%sExecuteRequest (z_call)\n", prefix, (combinepackages ? MasterPrefix : PackagePrefix[PackageIndex]));
+    f_print(fout, "\nint %s%sExecuteRequest (z_call)\n", prefix, (combinepackages ? MasterPrefix : PackagePrefix[PackageIndex]));
     f_print(fout, "\tregister struct rx_call *z_call;\n");
     f_print(fout, "{\n");
     f_print(fout, "\tint op;\n");
index 385c79a273ac87ededde5bd59d31ef910544702d..05e786e5e1afc337a7e847aa9af7ef669f62bed6 100644 (file)
  * Copyright (C) 1987, Sun Microsystems, Inc. 
  */
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <ctype.h>
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
-#include <string.h>
-#else
+#ifdef HAVE_STRINGS_H
 #include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #endif
 #include "rpc_scan.h"
 #include "rpc_util.h"
 
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_scan.c,v 1.1.1.2 2001/07/05 01:04:07 hartmans Exp $");
+
 #define startcomment(where) (where[0] == '/' && where[1] == '*')
 #define endcomment(where) (where[-1] == '*' && where[0] == '/')
 #define        verbatimstart(p) (*(p) == '@' && *((p) + 1) == '{')
index 8395227714d4f8448bccd188d12c38901c6df14a..99b016cce3a9767e9fb18773e4fa4370cccd2eb2 100644 (file)
  * 2550 Garcia Avenue
  * Mountain View, California  94043
  */
-#ifndef lint
-static char sccsid[] = "@(#)rpc_svcout.c 1.6 87/06/24 (C) 1987 SMI";
-#endif
 
 /*
  * rpc_svcout.c, Server-skeleton outputter for the RPC protocol compiler
  * Copyright (C) 1987, Sun Microsytsems, Inc. 
  */
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <stdio.h>
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
-#include <string.h>
-#else
+#ifdef HAVE_STRINGS_H
 #include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #endif
 #include "rpc_parse.h"
 #include "rpc_util.h"
 
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_svcout.c,v 1.1.1.2 2001/07/05 01:04:07 hartmans Exp $");
+
 static char RQSTP[] = "rqstp";
 static char TRANSP[] = "transp";
 static char ARG[] = "argument";
index 971c2ec9051556b3d3ce93f3db8569beb2c4f134..5ab99415b00470ccb18e69a268333e271b9d9ff2 100644 (file)
  * Copyright (C) 1987, Sun Microsystems, Inc. 
  */
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <stdio.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
 #include "rpc_scan.h"
 #include "rpc_parse.h"
 #include "rpc_util.h"
 
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_util.c,v 1.1.1.2 2001/07/05 01:04:08 hartmans Exp $");
+
 char curline[MAXLINESIZE];     /* current read line */
 char *where = curline; /* current point in line */
 int linenum = 0;       /* current line number */
index 3df9ca36d96668249dce4c8a9dea08f8250f14b5..501e9bd5714da3e30ec2695d3eb7b89be5a3a0bd 100644 (file)
  */
 
 #include "rxgen_consts.h"
-#ifndef AFS_NT40_ENV
-#ifdef AFS_OSF_ENV
-extern void *malloc();
-#else
-extern char *malloc();
-#endif /* osf */
-#endif /* nt40 */
 #define alloc(size)            malloc((unsigned)(size))
 #define ALLOC(object)   (object *) malloc(sizeof(object))
 
index be08e3dc257d28897a027660ee3a90228392e2c0..622ce584ac9fd340a50df312492f6c670c47dac5 100644 (file)
@@ -17,7 +17,7 @@ UKERNELDIR = ../libuafs/
 COMPILE_ET = ${SRCDIR}bin/compile_et
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
-CFLAGS = ${OPTMZ} -I${SRCDIR}include ${XCFLAGS}
+CFLAGS = ${OPTMZ} -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS}
 INCLS= ${SRCDIR}include/rx/rx.h \
        ${SRCDIR}include/rx/xdr.h \
        rxkad.h
@@ -39,7 +39,7 @@ all: librxkad.a
 system: install
 
 clean: 
-       rm -f *.o tcrypt core *.a rxkad_errs.c rxkad.h AFS_component_version_number.c
+       rm -f *.o tcrypt core *.a rxkad_errs.c rxkad.h AFS_component_version_number.c crypt_conn.c fcrypt.c fcrypt.h sboxes.h
 
 librxkad.a: $(OBJS) ${REGOBJS} AFS_component_version_number.o
        -rm -f librxkad.a
index 0703c920adbe26826a573a65e5cb219aa86eae9b..fc71d72ebd79d4f49de27f6fac96c6cd8f47fd6d 100644 (file)
@@ -61,6 +61,7 @@ sboxes.h : domestic\sboxes.h
 
 install: $(DOMESTIC) $(INCFILES) $(LIBFILE)
 
+install9x: install
 
 clean::
        $(DEL) $(RXKAD_INCFILE) rxkad_errs.c 
index 8f81ed8a293147e8b555c30ff4a5d365c7c1359c..5acf36db4b7e7349d54cf90ded0262c2e9aac396 100644 (file)
@@ -20,12 +20,14 @@ CFLAGS = $(DBUG) -I${SRCDIR}include ${XCFLAGS}
 
 LIBOBJS = rxstat.cs.o rxstat.ss.o rxstat.xdr.o rxstat.o
 
+all: librxstat.a includes
+
 rxstat.cs.c rxstat.ss.c rxstat.xdr.c rxstat.h: rxstat.xg
        ${RXGEN} -x rxstat.xg
 
 librxstat.a: ${LIBOBJS} AFS_component_version_number.o
        -rm -f $@
-       ar rv $@ AFS_component_version_number.o ${LIBOBJS}
+       $(AR) rv $@ AFS_component_version_number.o ${LIBOBJS}
        $(RANLIB) $@
 
 kinstall: ${KSRCS} 
index 3dccb3a2eb570e6fdc2293c934e415b415e411a2..b1359e90de94fc9882dc2e018ddb193ae7efa41e 100644 (file)
@@ -6,7 +6,9 @@
 # directory or online at http://www.openafs.org/dl/license10.html
 
 !INCLUDE ..\config\NTMakefile.$(SYS_NAME)
+!IF (EXIST(..\config\NTMakefile.version))
 !INCLUDE ..\config\NTMakefile.version
+!ENDIF
 
 
 INCFILEDIR = $(DESTDIR)\include
@@ -31,3 +33,5 @@ rxstat.cs.c rxstat.ss.c rxstat.xdr.c rxstat.h: rxstat.xg
        $(RXGEN) -x $**
 
 install: $(LIBFILE) $(INCFILES)
+
+install9x: install
index 5a42979ac29fba532ed227374df230885e4fb5a8..24b71711d770c94211f06cd83153e94061ce15a6 100644 (file)
@@ -46,6 +46,9 @@ afsauthlib.so: sgi_auth.o ${AFSLIBS} ${AUTHFILES}
 afskauthlib.so: sgi_auth.o ${KAFSLIBS} ${AUTHFILES}
        $(LD) ${LDFLAGS} -shared -all -o afskauthlib.so sgi_auth.o $(KAFSLIBS) ${AUTHFILES}
 
+../inetd/ta-rauth.o: ../inetd/ta-rauth.c
+       (cd ../inetd ; $(MAKE) ta-rauth.o )
+
 ../rsh/rcmd.o: ../rsh/rcmd.c
        (cd ../rsh ; $(MAKE) rcmd.o )
 
index 74403e866104444cd9cfd962ce4c3a7e89f45ed1..d5eae51a0d46301ada0b9120f31bf75cb3da0e9a 100644 (file)
@@ -27,6 +27,9 @@ KLIBS = ${DESTDIR}/lib/afs/libkauth.krb.a ${LIBS1} ${DESTDIR}/lib/afs/libauth.kr
 
 all: test-reauth ${DESTDIR}/lib/afs/libafssiad.so ${DESTDIR}/lib/afs/libafssiad.krb.so
 
+clean:
+       rm -f test-reauth libafssiad.so libafssiad.krb.so *.s *.o *.b core *~ *.com *.ld AFS_component_version_number.c
+
 CFLAGS = $(DEBUG) -I${SRCDIR}include ${XCFLAGS}
 
 ${DESTDIR}/lib/afs/libafssiad.so: libafssiad.so
index 72267e6e0518834a04a0e2bf47663fe0279dc0a9..d7b5c690ea23cc42ece0fe97f368693c071d9424 100644 (file)
@@ -14,7 +14,7 @@ include ../config/Makefile.${SYS_NAME}
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 UKERNELDIR=../libuafs/
-CFLAGS= ${DBUG}  -I${SRCDIR}include  ${XCFLAGS} ${DBG_DEFS}
+CFLAGS= ${DBUG}  -I${TOP_SRCDIR}/config -I${SRCDIR}include  ${XCFLAGS} ${DBG_DEFS}
 SFLAGS=-P -I${SRCDIR}include  
 LIBS= libsys.a ${SRCDIR}lib/librx.a libsys.a ${SRCDIR}lib/liblwp.a ${SRCDIR}lib/afs/util.a ${XLIBS}
 UKSRCS=afsl.exp
@@ -183,7 +183,7 @@ xfsinode: xfsinode.c  AFS_component_version_number.c
 clean:
        rm -f *.o libsys.a xfsinode iinc idec icreate iopen istat core \
        rmtsysc rmtsyss *.o rmtsys.ss.c rmtsys.cs.c rmtsys.xdr.c rmtsys.h \
-       rmtsysd AFS_component_version_number.c
+       rmtsysd AFS_component_version_number.c pagsh pagsh.krb
 
 beancount:
        wc -l *.c *.s
index f98916e9fed342b22658b3eef80eee546fb310be..b4b027e1982f4c0ccf2674b23751bd891b09060d 100644 (file)
@@ -29,8 +29,10 @@ $(LIBFILE): $(LIBOBJS)
 # Install target; primary makefile target
 
 install: $(INCFILES) $(LIBFILE)
+install9x: install
 
 ############################################################################
 # Local clean target; augments predefined clean target
 
 clean::
+   $(DEL) $(LIBFILE)
\ No newline at end of file
index 3a10691e027a34538d9f65a9a93c773510be6cb5..75a7742330250f1c0c6c6a2a6595eae464ed1337 100644 (file)
@@ -8,20 +8,29 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #ifdef AFS_AIX32_ENV
 #include <signal.h>
 #endif
 #include <stdio.h>
+#include <stdlib.h>
+#ifndef AFS_NT40_ENV
+#include <unistd.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #include <pwd.h>
-
-#ifdef notdef
-/* AFS_KERBEROS_ENV is now conditionally defined in the Makefile */
-#define AFS_KERBEROS_ENV
+#ifdef AFS_KERBEROS_ENV
+#include <sys/types.h>
+#include <sys/stat.h>
 #endif
 
 #include "AFS_component_version_number.c"
 
-main(argc, argv)
+extern afs_int32 setpag();
+
+int main(argc, argv)
 int argc;
 char **argv;
 {
@@ -70,11 +79,6 @@ char **argv;
 #ifdef AFS_KERBEROS_ENV
 /* stolen from auth/ktc.c */
 
-#include <sys/types.h>
-#include <sys/stat.h>
-
-extern char *malloc();
-
 static afs_uint32 curpag()
 {
     afs_uint32 groups[30];
index bf58ca716fffd6bc01bb9f01957749dfdc7addcb..8be9093b9eeb85f27960b15396a72219e4382f75 100644 (file)
@@ -21,6 +21,7 @@
 #include <osi.h>
 
 #include <cm.h>
+#include <cm_dir.h>
 #include <cm_cell.h>
 #include <cm_user.h>
 #include <cm_conn.h>
@@ -28,9 +29,8 @@
 #include <cm_buf.h>
 #include <cm_utils.h>
 #include <cm_ioctl.h>
-
+\r
 #include <smb.h>
-#include <cm.h>
 #include <pioctl_nt.h>
 
 static char AFSConfigKeyName[] =
@@ -82,6 +82,7 @@ static long GetIoctlHandle(char *fileNamep, HANDLE *handlep)
        HKEY parmKey;
        DWORD dummyLen;
        long code;
+        int hostsize;
 
         if (fileNamep) {
              drivep = strchr(fileNamep, ':');
@@ -107,7 +108,16 @@ static long GetIoctlHandle(char *fileNamep, HANDLE *handlep)
                        goto havehost;
 nogateway:
                /* No gateway name in registry; use ourself */
+#ifndef AFS_WIN95_ENV
                gethostname(hostName, sizeof(hostName));
+#else
+                /* DJGPP version of gethostname gets the NetBIOS
+                   name of the machine, so that is what we are using for
+                   the AFS server name instead of the DNS name. */
+                hostsize = sizeof(hostName);
+                GetComputerName(hostName, &hostsize);
+#endif /* AFS_WIN95_ENV */
+
 havehost:
                ctemp = strchr(hostName, '.');  /* turn ntafs.* into ntafs */
                if (ctemp) *ctemp = 0;
@@ -118,10 +128,12 @@ havehost:
                        hostName, SMB_IOCTL_FILENAME);
         }
 
+        fflush(stdout);
        /* now open the file */
         fh = CreateFile(tbuffer, GENERIC_READ | GENERIC_WRITE,
                FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
                OPEN_EXISTING, FILE_FLAG_WRITE_THROUGH, NULL);
+        fflush(stdout);
        if (fh == INVALID_HANDLE_VALUE)
                return -1;
         
@@ -165,7 +177,7 @@ static long MarshallLong(fs_ioctlRequest_t *reqp, long val)
 static long UnmarshallLong(fs_ioctlRequest_t *reqp, long *valp)
 {
        /* not enough data left */
-       if (reqp->nbytes < 4) return -1;
+  if (reqp->nbytes < 4) { return -1; }
 
        memcpy(valp, reqp->mp, 4);
         reqp->mp += 4;
index 9b8fe1548d150c46404f0608cf94212ab7ff6775..341624293bffcc81f09c10f5ed13e2e55b0341d6 100644 (file)
@@ -13,6 +13,7 @@
  * calls of setpag, and pioctl are supported.
  */
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <errno.h>
 #include <limits.h>
 #include <sys/types.h>
@@ -26,6 +27,9 @@
 #endif
 #include <sys/stat.h>
 #include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #include <rx/xdr.h>
 #include "rmtsys.h"
 
index e076acf774e1ba0744d636858aae260614ced9e6..2d47b054c008317c5b80762370f42d3d862c9a9a 100644 (file)
@@ -13,6 +13,7 @@
  * This module resides in the lib/afs/librmtsys.a library.
  */
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <sys/types.h>
 #include <sys/ioctl.h>
 #include <afs/vice.h>
@@ -23,6 +24,9 @@
 #include <stdio.h>
 #include <rx/xdr.h>
 #include <signal.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 /*#include <afs/cellconfig.h>*/
 #include "rmtsys.h"
 
index 52bbe47e656c1f44fe01245b8205fd5962cbcabd..6848183f0bb0b4a47bbbc1e3e87fbaf82c1db800 100644 (file)
@@ -47,8 +47,8 @@ BUTMINCLUDE = -I$(DESTDIR)\include
 BUTCOBJS   = dbentries.obj tcprocs.obj lwps.obj tcmain.obj list.obj recoverDb.obj \
             tcudbprocs.obj dump.obj tcstatus.obj butc_xbsa.obj \
              $(LWPOBJS) $(BUCOORDOBJS)
-BUTCINCLUDE= -I. -I$(DESTDIR)\include -I$(XBSADIR)\
-BUTCLIBS   = $(DESTDIR)\lib\afs\afsbudb.lib \
+BUTCINCLUDE= -I. -I$(DESTDIR)\include -I$(XBSADIR)
+BUTCLIBS=$(DESTDIR)\lib\afs\afsbudb.lib  \
             $(DESTDIR)\lib\afs\afsbubasics.lib \
             $(VOLSERLIBS) \
              $(BUTMLIBS) \
@@ -70,7 +70,11 @@ BUTCLIBS   = $(DESTDIR)\lib\afs\afsbudb.lib \
             $(DESTDIR)\lib\afs\afsreg.lib \
             $(DESTDIR)\lib\afs\afsprocmgmt.lib \
              $(DESTDIR)\lib\afs\afseventlog.lib \
-            $(DESTDIR)\lib\pthread.lib \
+!IF (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" ))
+       $(DESTDIR)\lib\win95\pthread.lib \
+!ELSE
+       $(DESTDIR)\lib\pthread.lib \
+!ENDIF
             $(DESTDIR)\lib\afsdes.lib
 
 #      $(DESTDIR)\lib\afsauthent.lib \
@@ -89,7 +93,7 @@ include ..\config\NTMakefile.version
 # nmake /nologo /f ntmakefile install
 #----------------------------------------------- BUTC
 
-$(BUTCEXE): $(BUTCOBJS) $(BUTCLIBS)
+$(BUTCEXE): $(BUTCOBJS) $(BUTCLIBS)\r
        $(EXECONLINK)
        $(EXEPREP)
 
index a7bab2ad15ddc3b54cdccdbfb3e3a7d34281f9db..83bab934b9a203f2dd6aaab7984523b29393f880 100644 (file)
@@ -10,7 +10,7 @@ COMPONENT=tviced
 include ../config/Makefile.${SYS_NAME}
 
 CC=${MT_CC}
-INCLUDES=-I. -I.. -I${SRCDIR}include -I${SRCDIR}include/afs
+INCLUDES=-I${TOP_SRCDIR}/config -I. -I.. -I${SRCDIR}include -I${SRCDIR}include/afs
 CFLAGS=${DBG} ${OPTMZ} -DNINTERFACE ${INCLUDES} ${MT_CFLAGS} -DRXDEBUG
 LDFLAGS=${DBG} ${XLDFLAGS}
 
@@ -45,7 +45,8 @@ objects= ${VICEDOBJS} ${VLSERVEROBJS} ${LWPOBJS} ${LIBACLOBJS} \
         ${UTILOBJS} ${DIROBJS} ${VOLOBJS} ${FSINTOBJS}
 
 LIBS=  ${SRCDIR}lib/libafsauthent.a    \
-       ${SRCDIR}lib/libafsrpc.a
+       ${SRCDIR}lib/libafsrpc.a \
+       ${SRCDIR}lib/afs/util.a
 
 include ../config/Makefile.version
 
index 7a89360c7e2d8b67b5a4e2bd46517bbef0a331da..60100afdc431705b8f14160d554f0710f5ba478c 100644 (file)
@@ -10,7 +10,7 @@ COMPONENT=ubik
 include ../config/Makefile.${SYS_NAME}
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
-CFLAGS=${OPTMZ} -I./ -I${SRCDIR}include ${XCFLAGS}
+CFLAGS=${OPTMZ} -I${TOP_SRCDIR}/config -I./ -I${SRCDIR}include ${XCFLAGS}
 UKERNELDIR=../libuafs/
 LIBOBJS=disk.o  remote.o beacon.o recovery.o ubik.o  vote.o lock.o phys.o \
        ubik_int.cs.o ubik_int.ss.o ubik_int.xdr.o ubikcmd.o \
@@ -36,7 +36,7 @@ test: utst_server utst_client udebug
 
 clean:
        rm -f *.o utst_server utst_client udebug *.a *.cs.c *.ss.c *.xdr.c
-       rm -f utst_int.h ubik_int.h uerrors.c ubik.h core AFS_component_version_number.c
+       rm -f utst_int.h ubik_int.h uerrors.c ubik.h core AFS_component_version_number.c Kubik_int.h
 
 system: install
 
index 7c6bb89a5c6986187f811bbf948cffe165579dc5..3f373f3e4c431860464e5bb6402f18e661c3fdc6 100644 (file)
@@ -97,6 +97,8 @@ uerrors.c $(INCFILEDIR)\ubik.h: uerrors.et ubik.p.h
 ############################################################################
 # Install target; primary makefile target
 
+install9X: $(INCFILES) $(LIBFILE)
+
 install: $(INCFILES) $(LIBFILE)  $(CL_UDBG_EXEFILE)
 
 
index fe8ac9ec34ed765ed14cd3b4ecebbf5aab5f8843..c43ab330dab40c76c3569716539ee085e1b29507 100644 (file)
@@ -438,9 +438,9 @@ ubeacon_Interact() {
 * Return Values : 0 on success, non-zero on failure
 */
 static verifyInterfaceAddress(ame, info, aservers)
+    afs_uint32 *ame;           /* one of my interface addr in net byte order */
     struct afsconf_cell *info;
     afs_uint32 aservers[];     /* list of all possible server addresses */
-    afs_uint32 *ame;           /* one of my interface addr in net byte order */
 {
     afs_uint32 myAddr[UBIK_MAX_INTERFACE_ADDR], *servList, tmpAddr;
     int        count, index, found, i, j, totalServers, start, end;
index 7145036b82cba3f030ece0c36f338803909525de..b33a36289a93768371c9b22e94afcdb3b2c15c17 100644 (file)
@@ -8,8 +8,16 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <sys/types.h>
 #include <stdlib.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
 #else
@@ -18,6 +26,9 @@
 #include <netinet/in.h>
 #include <netdb.h>
 #endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #include <signal.h>
 #include <time.h>
 
@@ -38,7 +49,7 @@ register char *aport; {
     register afs_int32 total;
 
     total = 0;
-    while (tc = *aport++) {
+    while ((tc = *aport++)) {
        if (tc < '0' || tc > '9') return -1;    /* bad port number */
        total *= 10;
        total += tc - (int) '0';
@@ -294,10 +305,12 @@ struct cmd_syndesc *as; {
                   usdebug.currentDB, usdebug.up, usdebug.beaconSinceDown);
        }
     }
+    return (0);
 }
 
 #include "AFS_component_version_number.c"
 
+int
 main(argc, argv)
     int argc;
     char **argv; {
index 19d6b921dcdf1ed3d9beb340906c6bc39f61cec3..b4b45ec3cb1cf911ab2ddcb588f9b42783afc47f 100644 (file)
@@ -14,7 +14,7 @@ LIBS = ${SRCDIR}lib/afs/libauth.a ${SRCDIR}lib/librxkad.a \
        ${SRCDIR}lib/libdes.a ${LIBRX} ${SRCDIR}lib/liblwp.a \
        ${SRCDIR}lib/afs/libcom_err.a ${SRCDIR}lib/afs/util.a \
        ${SRCDIR}lib/afs/libsys.a 
-CFLAGS= ${DBUG}  -I${SRCDIR}include ${XCFLAGS}
+CFLAGS= ${DBUG}  -I${SRCDIR}include -I${TOP_SRCDIR}/config ${XCFLAGS}
 
 PROGS=upclient upserver
 
index 3bf09f55d6f10d046e91d02ce1772ffa74bac466..03460ec071dbee16124c12e687dba75023d6ed01 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <afs/stds.h>
 #ifdef AFS_AIX32_ENV
 #include <signal.h>
 #include <sys/time.h>
 #include <dirent.h>
 #endif
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #include <stdio.h>
 #include <errno.h>
 #include <rx/xdr.h>
@@ -41,6 +52,8 @@
 #include <afs/afsutil.h>
 #include <afs/fileutil.h>
 
+RCSID("$Header: /tmp/cvstemp/openafs/src/update/client.c,v 1.1.1.3 2001/07/05 01:04:23 hartmans Exp $");
+
 #include "update.h"
 #include "global.h"
 
@@ -223,7 +236,6 @@ again:
     while(1){/*keep doing it */
        char c, c1;
        for(df = dirname; df; df=df->next) {   /*for each directory do */
-           afs_int32 isDir = 0;
            char *curDir;
 
            if (verbose) printf ("Checking dir %s\n", df->name);
@@ -232,7 +244,7 @@ again:
            ZapList(&okhostfiles);
 
            /* construct local path from canonical (wire-format) path */
-           if (errcode = ConstructLocalPath(df->name, "/", &curDir)) {
+           if ((errcode = ConstructLocalPath(df->name, "/", &curDir))) {
                com_err(whoami, errcode, "Unable to construct local path");
                return errcode;
            }
@@ -323,7 +335,7 @@ again:
                    goto fail;
                }
 
-               while(dp = readdir(dirp)) {
+               while((dp = readdir(dirp))) {
                    /* for all the files in the directory df->name do*/
                    strcpy(filename, curDir);
                    strcat(filename,"/");
@@ -377,7 +389,7 @@ afs_int32 time, length;
     char *localname;
 
     /* construct a local path from canonical (wire-format) path */
-    if (error = ConstructLocalPath(filename, "/", &localname) ) {
+    if ((error = ConstructLocalPath(filename, "/", &localname))) {
        com_err(whoami, error, "Unable to construct local path");
        return error;
     }
@@ -393,6 +405,7 @@ afs_int32 time, length;
        return 0;
 }
 
+int
 FetchFile(call, remoteFile, localFile, dirFlag)
   struct rx_call *call;
   char *localFile, *remoteFile;
@@ -436,7 +449,9 @@ int update_ReceiveFile(fd, call, status)
 {
     register char *buffer = (char*) 0;
     afs_int32 length;
+#ifdef notdef
     XDR xdr;
+#endif
     register int blockSize;
     afs_int32 error = 0, len;
 #ifdef AFS_AIX_ENV
@@ -467,7 +482,7 @@ int update_ReceiveFile(fd, call, status)
        return UPDATE_ERROR;
     }
     while (!error && length) {
-       register nbytes = (length>blockSize?blockSize:length);
+       register int nbytes = (length>blockSize?blockSize:length);
        nbytes = rx_Read(call, buffer, nbytes);
        if (!nbytes) error = UPDATE_ERROR;
        if (write(fd, buffer, nbytes) != nbytes) {
@@ -552,7 +567,7 @@ int NotOnHost(filename, okhostfiles)
     
     for(tf=okhostfiles; tf; tf=tf->next) {
        /* construct local path from canonical (wire-format) path */
-       if (rc = ConstructLocalPath(tf->name, "/", &hostfile)) {
+       if ((rc = ConstructLocalPath(tf->name, "/", &hostfile))) {
            com_err(whoami, rc, "Unable to construct local path");
            return -1;
        }
@@ -578,7 +593,7 @@ static int RenameNewFiles(struct filestr *modFiles)
 
   for(tf = modFiles; tf; tf=tf->next) {
       /* construct local path from canonical (wire-format) path */
-      if (errcode = ConstructLocalPath(tf->name, "/", &fname)) {
+      if ((errcode = ConstructLocalPath(tf->name, "/", &fname))) {
          com_err(whoami, errcode, "Unable to construct local path");
          return errcode;
       }
@@ -652,7 +667,8 @@ int GetFileFromUpServer(struct rx_connection *conn, /* handle for upserver */
   /* now set the rest of the file status */
   errcode = chmod(newfile, mode);
   if(errcode){
-    printf("could not change protection on %s to %u\n",newfile, mode);
+    printf("could not change protection on %s to %u\n",newfile, 
+       (unsigned int) mode);
     com_err (whoami, errno,
             "could not change protection on %s to %u",
             newfile, mode);
@@ -676,7 +692,7 @@ int GetFileFromUpServer(struct rx_connection *conn, /* handle for upserver */
   errcode = utimes(newfile, tvp);
 #endif /* NT40 */
   if (errcode) {
-    printf("could not change access and modify times on %s to %u %u\n",newfile, atime, mtime);
+    printf("could not change access and modify times on %s to %u %u\n",newfile, (unsigned int) atime, (unsigned int) mtime);
     com_err (whoami, errno,
             "could not change access and modify times on %s to %u %u",newfile, atime, mtime);
     return 1;
index 88b1409790d86c26bd4b5c1c871107b2f3fb46bb..49b2b4e34f74f3c015553da9cfaabd2b4048fef8 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <afs/stds.h>
 #ifdef AFS_AIX32_ENV
 #include <signal.h>
 #include <sys/file.h>
 #include <dirent.h>
 #endif
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #include <sys/stat.h>
 #include <errno.h>
 #include <stdio.h>
 #include <afs/afsutil.h>
 #include <afs/fileutil.h>
 
+RCSID("$Header: /tmp/cvstemp/openafs/src/update/server.c,v 1.1.1.3 2001/07/05 01:04:23 hartmans Exp $");
+
 #include "update.h"
 #include "global.h"
 
 
-extern UPDATE_ExecuteRequest();
+extern int UPDATE_ExecuteRequest();
 static int AddObject(char **expPath, char *dir);
 static int PathInDirectory(char *dir, char *path);
 
@@ -50,7 +63,7 @@ char *dirName[MAXENTRIES];
 int   dirLevel[MAXENTRIES];
 char *whoami;
 
-static Quit();
+static int Quit();
 
 /* check whether caller is authorized to manage RX statistics */
 int update_rxstat_userok(call)
@@ -166,7 +179,7 @@ int main (argc, argv)
     extern struct rx_securityClass *rxnull_NewServerSecurityObject();
     extern afs_int32 afsconf_GetKey();
 
-    int a;
+    int a = 0;
     rxkad_level level;
     rxkad_level newLevel;
 
@@ -215,10 +228,8 @@ int main (argc, argv)
 
     for (a=1; a<argc; a++) {
        if (argv[a][0] == '-') { /* parse options */
-           int arglen = strlen(argv[a]);
            char arg[256];
            lcstring (arg, argv[a], sizeof(arg));
-#define IsArg(a) (strncmp (arg,a, arglen) == 0)
            newLevel = StringToLevel (&argv[a][1]);
            if (newLevel != -1) {
                level = newLevel;       /* set new level */
@@ -286,6 +297,7 @@ int main (argc, argv)
 
     rx_StartServer(1); /* Donate this process to the server process pool */
     Quit("StartServer returned?");
+    return 0;
 }
 
 /* fetch the file name and send it to the remote requester specified by call */
@@ -300,7 +312,7 @@ int UPDATE_FetchFile(call, name)
     char *reqObject;
 
     /* construct a local path from a canonical (wire-format) path */
-    if ( error = ConstructLocalPath(name, "/", &reqObject) ) {
+    if ((error = ConstructLocalPath(name, "/", &reqObject))) {
        com_err(whoami, error, "Unable to construct local path");
        return UPDATE_ERROR;
     }
@@ -332,7 +344,7 @@ int UPDATE_FetchInfo(call, name)
     char *reqObject;
 
     /* construct a local path from a canonical (wire-format) path */
-    if ( error = ConstructLocalPath(name, "/", &reqObject) ) {
+    if ((error = ConstructLocalPath(name, "/", &reqObject))) {
        com_err(whoami, error, "Unable to construct local path");
        return UPDATE_ERROR;
     }
@@ -358,7 +370,7 @@ int UPDATE_FetchInfo(call, name)
     return error;
 } 
 
-static Quit(msg, a, b)
+static int Quit(msg, a, b)
     char *msg;
 {
     fprintf(stderr, msg, a, b);
@@ -373,7 +385,9 @@ register struct stat *status;
     char *buffer = (char*) 0;
     int blockSize;
     afs_int32 length, tlen;
+#ifdef notdef
     XDR xdr;
+#endif
 #ifdef AFS_AIX_ENV
 #include <sys/statfs.h>
     struct statfs tstatfs;
@@ -403,7 +417,7 @@ register struct stat *status;
     rx_Write(call, &tlen, sizeof(afs_int32));  /* send length on fetch */
 #endif
     while (!error && length) {
-       register nbytes = (length>blockSize?blockSize:length);
+       register int nbytes = (length>blockSize?blockSize:length);
        nbytes = read(fd, buffer, nbytes);
        if (nbytes <= 0) {
            fprintf(stderr, "File system read failed\n");
@@ -440,7 +454,7 @@ char *origDir;                   /* orig name of dir before being localized */
     if (!stream) {
        error = EIO;
     } else {
-       while(dp = readdir(dirp)){
+       while((dp = readdir(dirp))){
            strcpy(filename, name);
            strcat(filename,"/");
            strcat(filename,dp->d_name);
@@ -456,7 +470,13 @@ char *origDir;                   /* orig name of dir before being localized */
                
                strcpy(dirEntry, origDir); strcat(dirEntry, "/");
                strcat(dirEntry, dp->d_name);
-               err = fprintf(stream, "\"%s\" %u %u %u %u %u %u\n", dirEntry, tstatus.st_mtime,tstatus.st_size,tstatus.st_mode,tstatus.st_uid,tstatus.st_gid, tstatus.st_atime);
+               err = fprintf(stream, "\"%s\" %u %u %u %u %u %u\n", dirEntry, 
+                       (unsigned int) tstatus.st_mtime,
+                       (unsigned int) tstatus.st_size,
+                       tstatus.st_mode,
+                       tstatus.st_uid,
+                       tstatus.st_gid, 
+                       (unsigned int) tstatus.st_atime);
                if (err < 0) error = EIO;
            }   
            err = close(tfd);
@@ -502,7 +522,7 @@ static int AddObject(char **expPath, char *dir)
   struct stat statbuf;
 
   /* construct a local path from a canonical (wire-format) path */
-  if ( error = ConstructLocalPath(dir, "/", expPath) ) {
+  if ((error = ConstructLocalPath(dir, "/", expPath))) {
       com_err(whoami, error, "Unable to construct local path");
       return error;
   }
index 443cbe770541e1a3f6ba0a33a04fb3f920d8b55d..ba18659d3276dea235897b923ab3a3e0bf37b4f7 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <afs/stds.h>
 #include <rx/rxkad.h>
 #include "global.h"
 #include <WINNT/afssw.h>
 #endif
 #include <stdio.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <stdlib.h>
 
+RCSID("$Header: /tmp/cvstemp/openafs/src/update/utils.c,v 1.1.1.3 2001/07/05 01:04:23 hartmans Exp $");
 
+int
 AddToList(ah, aname)
 struct filestr **ah;
 char *aname; {
@@ -31,6 +45,7 @@ char *aname; {
     return 0;
 }
 
+int
 ZapList(ah)
 struct filestr **ah; {
     register struct filestr *tf, *nf;
index fa048526b12c47394c2ad71a4e965447d21fd925..a6cdad63f24595b1e2741836c42a8f75d412a3f4 100644 (file)
@@ -12,7 +12,7 @@ include ../config/Makefile.${SYS_NAME}
 RXGEN=${SRCDIR}bin/rxgen
 COMPILE_ET = ${SRCDIR}bin/compile_et
 
-CFLAGS = $(DBG) -I${SRCDIR}include ${XCFLAGS}
+CFLAGS = $(DBG) -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS}
 
 #####################################################################
 # include files
index 749487383f28196be81c37efcffaa26e9c46aae0..2fad477ec1574f26b23b4e68b121723965d1282d 100644 (file)
@@ -6,7 +6,9 @@
 # directory or online at http://www.openafs.org/dl/license10.html
 
 !INCLUDE ..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\config\NTMakefile.version
+!IF (EXIST(..\config\NTMakefile.version))
+!include ..\config\NTMakefile.version
+!ENDIF
 
 
 ############################################################################
@@ -35,9 +37,10 @@ $(LIBFILE): $(LIBOBJS)
 
 install: $(INCFILES) $(LIBFILE)
 
+install9x: install
 
 clean::
-
+       $(DEL) $(LIBFILE)
 
 test: 
        $(CD) test
index cb021f4215a83c0564b267c672c443407c80ac54..95acedf5e5325f4c3ce2d0a2bc8e80b93fcc620a 100644 (file)
@@ -9,7 +9,7 @@ SHELL = /bin/sh
 COMPONENT=util
 include ../config/Makefile.${SYS_NAME}
 
-CFLAGS = ${OPTMZ} -I$(SRCDIR)include ${XCFLAGS}
+CFLAGS = ${OPTMZ} -I${TOP_SRCDIR}/config -I. -I$(SRCDIR)include ${XCFLAGS}
 LDFLAGS = ${OPTMZ} ${XLDFLAGS}
 
 objects = assert.o base64.o casestrcpy.o ktime.o volparse.o hostparse.o \
@@ -42,6 +42,12 @@ install0: ${DESTDIR}include/afs/dirpath.h \
 
 install: install0 kinstall ukinstall
 
+install_headers:
+       ${INSTALL} assert.h errors.h vice.h remote.h ktime.h fileutil.h \
+               netutils.h packages.h afsutil.h pthread_glock.h \
+               afs_atomlist.h afs_lhash.h \
+               ${DESTDIR}include/afs
+
 kinstall:
        ${INSTALL} vice.h ../libafs/afs
        ${INSTALL} base64.c ../libafs/afs/afs_base64.c
index 0d25e0cc5dcc6ed257adda63d5a514f4e76a87bb..04fde9ecdfaacc8bb1aea6817ee090575e7f5620 100644 (file)
@@ -57,3 +57,8 @@ $(LIBFILE): $(LIBOBJS)
 
 
 install: $(INCFILES) $(LIBFILE)
+
+install9x: install
+
+clean::
+       $(DEL) $(LIBFILE)
\ No newline at end of file
index faf82464991d0fa84b18d7fb2dc6a023df2137b0..2363ecf8ffb31832ee5884755daef41bdaaf43cf 100644 (file)
@@ -58,7 +58,7 @@ extern char *vctime(const time_t *atime);
 
 /* Convert a 4 byte integer to a text string. */
 extern char*   afs_inet_ntoa(afs_uint32 addr);
-
+extern char*    afs_inet_ntoa_r(afs_uint32 addr, char *buf);
 
 /* copy strings, converting case along the way. */
 extern char *lcstring(char *d, char *s, int n);
@@ -74,7 +74,9 @@ extern char *strcompose(char *buf, size_t len, ...);
 
 
 #ifdef AFS_NT40_ENV
+#ifndef _MFC_VER
 #include <winsock2.h>
+#endif /* _MFC_VER */
 
 /* Initialize the windows sockets before calling networking routines. */
 extern int afs_winsockInit(void);
index 20c3c09638a83a54c6dfad5f1ffebc69a7276292..e2977f9f427b4524dc2809ccf46edc1792eef7fe 100644 (file)
@@ -33,7 +33,7 @@ char *int64_to_flipbase64(lb64_string_t s, afs_int64 a)
 char *int64_to_flipbase64(lb64_string_t s, u_int64_t a)
 #endif
 {
-    int i, j;
+    int i;
 #ifdef AFS_64BIT_ENV
     afs_int64 n;
 #else
index f0ba15769827d983672e77fd9a7a860308e707ea..b9b8e2fc4d12070369b1d6f9b37d3c157afd432e 100644 (file)
@@ -231,6 +231,20 @@ char* afs_inet_ntoa(afs_uint32 addr)
     return (char *) inet_ntoa(temp);
 }
 
+/* same as above, but to a non-static buffer, must be freed by called */
+char* afs_inet_ntoa_r(afs_uint32 addr, char *buf)
+{
+    int temp;
+
+    temp = ntohl(addr);
+    sprintf(buf, "%d.%d.%d.%d", 
+           (temp >> 24 ) & 0xff,
+           (temp >> 16 ) & 0xff, 
+           (temp >> 8  ) & 0xff,
+           (temp       ) & 0xff);
+    return buf;
+}
+
 /*
  * gettmpdir() -- Returns pointer to global temporary directory string.
  *     Always succeeds.  Never attempt to deallocate directory string.
index 079c7d2007d22b6a7707f2c4a542f25c18453ab5..d7375aa7ba8214b7055bf5d2d226a09669aafa06 100644 (file)
@@ -76,6 +76,16 @@ int mrafsStyleLogs = 0;
 int printLocks = 0;
 static char ourName[MAXPATHLEN];
 
+void WriteLogBuffer(buf,len)
+    char *buf;
+    afs_uint32 len;
+{
+    LOCK_SERVERLOG();
+    if (serverLogFD > 0)
+      write(serverLogFD, buf, len);
+    UNLOCK_SERVERLOG();
+}
+
 /* VARARGS1 */
 void FSLog (const char *format, ...)
 {
index 0b716f2b8a736d84eb951af8e0f9dc24c4dd96f1..ef6c5110c0acb74ae79e098679302518a35e5097 100644 (file)
@@ -1,14 +1,14 @@
 /* snprintf.c - Formatted, length-limited print to a string */
 
 #include <afs/param.h>
-#if defined(AFS_OSF20_ENV) && !defined(AFS_DUX50_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_NT40_ENV)
+#if defined(AFS_OSF20_ENV) && !defined(AFS_DUX50_ENV) || defined(AFS_AIX32_ENV) || (defined(AFS_SUN55_ENV) && !defined(AFS_SUN56_ENV))
 #include <sys/types.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <netinet/in.h>
 #include <netdb.h>
-#if defined(AFS_AIX32_ENV)
+#if defined(AFS_AIX32_ENV) || defined(AFS_SUN55_ENV)
 #include <sys/socket.h>
 #endif
 
index 33cbb69c5c4f93b882178dd90232065b7a553a96..bad8961bb44a4c936badd6054f5c6657a1334be1 100644 (file)
  */
 
 #include <afs/param.h>
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
-#include <string.h>
-#else
+#include <afsconfig.h>
+#ifdef HAVE_STRINGS_H
 #include <strings.h>
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #endif
-#ifdef AFS_NT40_ENV
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
 
@@ -146,7 +149,7 @@ afs_int32 *aval;
     negative = 0;
 
     /* skip over leading spaces */
-    while (tc = *as) {
+    while ((tc = *as)) {
        if (tc != ' ' && tc != '\t') break;
     }
 
@@ -168,7 +171,7 @@ afs_int32 *aval;
     else base = 10;
 
     /* compute the # itself */
-    while(tc = *as) {
+    while((tc = *as)) {
        if (!ismeta(tc, base)) return -1;
        total *= base;
        total += getmeta(tc);
@@ -192,7 +195,7 @@ afs_uint32 *aval;
     total = 0;  /* initialize things */
 
     /* skip over leading spaces */
-    while (tc = *as) {
+    while ((tc = *as)) {
         if (tc != ' ' && tc != '\t') break;
     }
 
@@ -208,7 +211,7 @@ afs_uint32 *aval;
     else base = 10;
 
     /* compute the # itself */
-    while(tc = *as) {
+    while((tc = *as)) {
         if (!ismeta(tc, base)) return -1;
         total *= base;
         total += getmeta(tc);
index 9de42c6d0c2bc794d4da8a4b20416cef5b1d88cc..5658da479b5670131b4a28d2db38205f323cd3cc 100644 (file)
@@ -817,7 +817,7 @@ static afs_int32 GetCell(fname, cellname)
   blob.out      = cellname;
 
   code = pioctl(fname, VIOC_FILE_CELL_NAME, &blob, 1);
-  return code;
+  return code ? errno : 0;
 }
 
 /* Check if a username is valid: If it contains only digits (or a
@@ -1975,7 +1975,7 @@ static WhichCellCmd(as)
         if (errno == ENOENT)
           fprintf(stderr,"%s: no such cell as '%s'\n", pn, ti->data);
        else
-          Die(code, ti->data);
+          Die(errno, ti->data);
        error = 1;
        continue;
      }
@@ -2085,29 +2085,33 @@ static SysNameCmd(as)
     struct ViceIoctl blob;
     struct cmd_item *ti;
     char *input = space;
-    afs_int32 setp = 1;
+    afs_int32 setp = 0;
 
     ti = as->parms[0].items;
-    if (!ti) setp = 0;
     blob.in = space;
     blob.out = space;
     blob.out_size = MAXSIZE;
     blob.in_size = sizeof(afs_int32);
-    bcopy(&setp, input, sizeof(afs_int32));
     input += sizeof(afs_int32);
-    if (ti) {
-       strcpy(input, ti->data);
+    for(; ti; ti=ti->next) {
+       setp++;
        blob.in_size += strlen(ti->data) + 1;
+       if (blob.in_size > MAXSIZE) {
+         fprintf(stderr, "%s: sysname%s too long.\n", pn, setp > 1 ? "s" : "");
+         return 1;
+       }
+       strcpy(input, ti->data);
        input += strlen(ti->data);
        *(input++) = '\0';
     }
+    bcopy(&setp, space, sizeof(afs_int32));
     code = pioctl(0, VIOC_AFS_SYSNAME, &blob, 1);
     if (code) {
        Die(errno, 0);
        return 1;
     }
     if (setp) {
-       printf("%s: new sysname set.\n", pn);
+       printf("%s: new sysname%s set.\n", pn, setp > 1 ? " list" : "");
        return 0;
     }
     input = space;
@@ -2117,7 +2121,12 @@ static SysNameCmd(as)
        fprintf(stderr, "No sysname name value was found\n");
        return 1;
     }
-    printf("Current sysname is '%s'\n", input);
+    printf("Current sysname%s is:", setp>1 ? " list" : "");
+    for(;setp>0;--setp) {
+      printf(" %s", input);
+      input += strlen(input) + 1;
+    }
+    printf("\n");
     return 0;
 }
 
@@ -2787,7 +2796,7 @@ static afs_int32 SetCryptCmd(as)
     blob.out_size = 0;
     code = pioctl(0, VIOC_SETRXKCRYPT, &blob, 1);
     if (code)
-      Die(code, (char *) 0);
+      Die(errno, (char *) 0);
     return 0;
 }
 
@@ -2806,7 +2815,7 @@ static afs_int32 GetCryptCmd(as)
 
     code = pioctl(0, VIOC_GETRXKCRYPT, &blob, 1);
 
-    if (code) Die(code, (char *) 0);
+    if (code) Die(errno, (char *) 0);
     else {
       tp = space;
       bcopy(tp, &flag, sizeof(afs_int32));
@@ -3024,7 +3033,7 @@ defect 3069
     cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
 
     ts = cmd_CreateSyntax("sysname", SysNameCmd, 0, "get/set sysname (i.e. @sys) value");
-    cmd_AddParm(ts, "-newsys", CMD_SINGLE, CMD_OPTIONAL, "new sysname");
+    cmd_AddParm(ts, "-newsys", CMD_LIST, CMD_OPTIONAL, "new sysname");
 
     ts = cmd_CreateSyntax("exportafs", ExportAfsCmd, 0, "enable/disable translators to AFS");
     cmd_AddParm(ts, "-type", CMD_SINGLE, 0, "exporter name");
index de24918264c5293d63ca79b091165d991749f0a5..009203c07c8c19f209202190bdf858fccb61f646 100644 (file)
 /* ************************************************************* */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <errno.h>
 #ifdef AFS_AIX32_ENV
 #include <signal.h>
 #undef _NONSTD_TYPES
 #endif
 #include <stdio.h>
+#include <afs/afs_args.h>
 #include <sys/param.h>
 #ifdef AFS_SUN5_ENV
 #include <fcntl.h>
 #include <afs/vice.h>
 #undef VIRTUE
 #undef VICE
+#include <sys/ioctl.h>
+#include <netdb.h>      
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <afs/venus.h>
 
 /* ************************************************************* */
 
@@ -51,6 +59,7 @@ Boolean   verbose = false;
 Boolean   renameTargets = false;
 Boolean   oneLevel = false;
 Boolean   preserveDate = true; 
+Boolean   preserveMountPoints = false;
 Boolean   forceOverwrite = false;
 
 int   pageSize;
@@ -58,6 +67,9 @@ Boolean setacl = true;
 Boolean oldAcl = false;
 char file1[MAXPATHLEN], file2[MAXPATHLEN];
 
+#define        MAXSIZE 2048
+static char space[MAXSIZE];
+
 struct OldAcl {
     int nplus;
     int nminus;
@@ -138,9 +150,13 @@ ScanArgs(argc, argv)
            preserveDate = false;
            break;
            
+         case 'm':
+           preserveMountPoints = true;
+           break;
+           
          default: 
            fprintf(stderr, "Unknown option: '%c'\n", *cp);
-           fprintf(stderr, "usage: up [-v1frx] from to\n");
+           fprintf(stderr, "usage: up [-v1frxm] from to\n");
            exit(1);
        }
        argc--, argv++;
@@ -151,8 +167,8 @@ ScanArgs(argc, argv)
         exit(1);
     }
 
-    strcpy(file1, argv[0]);
-    strcpy(file2, argv[1]);
+    strncpy(file1, argv[0], MAXPATHLEN);
+    strncpy(file2, argv[1], MAXPATHLEN);
 
 } /*ScanArgs*/
 
@@ -437,6 +453,45 @@ Copy(file1, file2, recursive, level)
          return 1;
        }
     } /*Dealing with symlink*/
+    
+    else if ( preserveMountPoints && (code=isMountPoint( file1, &blob )) ) {
+       /*
+       * --------------------- Copy mount point  --------------------
+       */
+
+       if ( code > 1 ) {
+          perror("checking for mount point ");
+          return 1;
+       }
+       if (verbose) {
+         printf("Level %d: Mount point %s to %s\n", level, file1, file2);
+         fflush(stdout);
+       }
+       
+       /* Don't ovewrite a write protected directory (unless force: -f) */
+       if (!forceOverwrite && goods2 && (s2.st_mode & 0200) == 0) {
+         fprintf(stderr,
+                 "Target %s is write protected against its owner; not changed\n",
+                 file2);
+         return 1;
+       }
+       
+       if (verbose) {
+         printf("  Copy mount point %s for vol %s to %s\n", file1, blob.out, file2);
+         fflush(stdout);
+       }
+       
+       unlink(file2);  /* Always make the new link (it was easier) */
+
+       strcat(blob.out, ".");          /* stupid convention; these end with a period */
+       code = symlink(blob.out, file2);
+       if (code == -1) {
+         fprintf(stderr, "Could not create mount point %s for vol %s\n", file2, blob.out);
+         perror("create mount point ");
+         return 1;
+       }
+       
+    } /*Dealing with mount point*/
 
     else if (((s1.st_mode & S_IFMT) == S_IFDIR) && (recursive || (level == 0))) {
        /*
@@ -610,3 +665,75 @@ Copy(file1, file2, recursive, level)
 
     return rcode;
 } /*Copy*/
+
+
+int isMountPoint( name, blob )
+    char *name;
+    struct ViceIoctl *blob;
+{
+    afs_int32  code;
+    char true_name[1024];              /*dirname*/
+    char parent_dir[1024];             /*Parent directory of true name*/
+    char *last_component;              /*Last component of true name*/
+
+    sprintf(true_name, "%s%s",
+            (name[0] == '/') ? "" : "./",
+            name);
+
+    /*
+     * Find rightmost slash, if any.
+     */
+    last_component = (char *) rindex(true_name, '/');
+    if (last_component) {
+        /*
+         * Found it.  Designate everything before it as the parent directory,
+         * everything after it as the final component.
+         */
+        strncpy(parent_dir, true_name, last_component - true_name);
+        parent_dir[last_component - true_name] = 0;
+        last_component++;   /*Skip the slash*/
+    }
+    else {
+        /*
+         * No slash appears in the given file name.  Set parent_dir to the current
+         * directory, and the last component as the given name.
+         */
+        strcpy(parent_dir, ".");
+        last_component = true_name;
+    }
+
+    if (strcmp(last_component, ".") == 0 || strcmp(last_component, "..") == 0) {
+        fprintf(stderr, "up: you may not use '.' or '..' as the last component\n");
+        fprintf(stderr, "up: of a name in the 'up' command.\n");
+        return 3;
+    }
+
+    blob->in = last_component;
+    blob->in_size = strlen(last_component)+1;
+    blob->out_size = MAXSIZE;
+    blob->out = space;
+    bzero(space, MAXSIZE);
+
+    code = pioctl(parent_dir, VIOC_AFS_STAT_MT_PT, blob, 0);
+
+    if (code == 0) {
+        printf("'%s' is a mount point for volume '%s'\n", name, space);
+        fflush(stdout);
+        return 1;
+    }
+    else {
+        if (errno == EINVAL) {
+            /* printf( "'%s' is not a mount point.\n", name);
+            * fflush(stdout);
+            */
+            return 0;
+        }
+        else {
+            fprintf( stderr, "problem examining '%s' in '%s'.\n", last_component, parent_dir );
+            return 2;
+            /* Die(errno, (ti->data ? ti->data : parent_dir));
+             */
+        }
+    }
+    return 4;
+}
index 7f480e7290e0a49f9f538f641356eba0a01de83f..ad7e8f7de572ef4da3a7567b83a3bdbd4dafca53 100644 (file)
@@ -197,7 +197,7 @@ main(argc, argv)
 #if    defined(AFS_HPUX100_ENV)
        mflag = 0;
 #endif
-       printf("----Transarc AFS (R) %s fsck----\n", AFSVersion); /* generated version */
+       printf("----Open AFS (R) %s fsck----\n", AFSVersion); /* generated version */
        if (access("/TRYFORCE", 0) == 0)
            tryForce = 1;
        while (--argc > 0 && **++argv == '-') {
index d9f42f7e06b43d933b1cf45d3dd062359dd567e9..2c5ac08d9201a2914a7b416fe87004971efcebf5 100644 (file)
@@ -10,7 +10,8 @@ COMPONENT=viced
 include ../config/Makefile.${SYS_NAME}
 
 DBUG = -g
-CFLAGS =  -DNINTERFACE ${DBUG} -I. -I${SRCDIR}include -I${SRCDIR}include/afs \
+CFLAGS =  -DNINTERFACE ${DBUG} \
+       -I${TOP_SRCDIR}/config -I. -I${SRCDIR}include -I${SRCDIR}include/afs \
         ${XCFLAGS} ${DBG_DEFS} -DRXDEBUG
 LDFLAGS = ${DBUG} ${XLDFLAGS}
 
@@ -72,7 +73,7 @@ check_sysid: check_sysid.c
 fileserver: viced.o ${objects} ${headers} ${LIBS}
        set -x; \
        case ${SYS_NAME} in \
-       *linux*) \
+       *linux* | *fbsd* ) \
            ${CC} ${LDFLAGS} -o fileserver ${objects} \
            ${auditlib} ${LIBS} ${XLIBS} ;; \
        rs_aix*) \
@@ -113,7 +114,7 @@ install: all  ${DESTDIR}root.server/usr/afs/bin/fileserver
 system: install
 
 clean:
-       rm -f *.o llib-lvice.ln fileserver core AFS_component_version_number.c
+       rm -f *.o llib-lvice.ln fileserver core AFS_component_version_number.c cbd check_sysid fsprobe
 
 beancount:
        wc -l *.c *.h
index 19e3bd38c63b1a47cb806fa64936e23cca7cc180..2d2233b3ecf153f6d13d3263375bdaed45ba0e26 100644 (file)
@@ -986,9 +986,11 @@ retry:
                    goto retry;
                }
        } else {
-               ViceLog(0,("CB: WhoAreYou failed for %x.%d, error %d\n", 
-                       host->host, host->port, code));
-               host->hostFlags |= VENUSDOWN;
+           char hoststr[16];
+           afs_inet_ntoa_r(host->host, hoststr);
+           ViceLog(0,("CB: WhoAreYou failed for %s:%d, error %d\n", 
+                      hoststr, ntohs(host->port), code));
+           host->hostFlags |= VENUSDOWN;
        }
        host->hostFlags |= ALTADDR;
        h_Unlock_r(host);
@@ -1085,9 +1087,11 @@ retry:
                }
           }
           if (code) {
-               ViceLog(0,("CB: RCallBackConnectBack failed for %x.%d\n", 
-                       host->host, host->port));
-               host->hostFlags |= VENUSDOWN;
+               char hoststr[16];
+               afs_inet_ntoa_r(host->host, hoststr);
+               ViceLog(0,("CB: RCallBackConnectBack failed for %s:%d\n", 
+                         hoststr, ntohs(host->port)));
+              host->hostFlags |= VENUSDOWN;
            }
            else
                host->hostFlags |= RESETDONE;
@@ -1905,11 +1909,13 @@ int CheckHost(host, held)
                    host->hostFlags |= ALTADDR; /* alternate addresses valid */
                    if ( code )
                    {
-                       ViceLog(0,
-                           ("CB: RCallBackConnectBack (host.c) failed for host %x.%d\n",
-                           host->host, host->port));
-                       host->hostFlags |= VENUSDOWN;
-                    }
+                       char hoststr[16];
+                       afs_inet_ntoa_r(host->host, hoststr);
+                        ViceLog(0,
+                               ("CB: RCallBackConnectBack (host.c) failed for host %s:%d\n",
+                                hoststr, ntohs(host->port)));
+                        host->hostFlags |= VENUSDOWN;
+                   }
                    /* Note:  it's safe to delete hosts even if they have call
                     * back state, because break delayed callbacks (called when a
                     * message is received from the workstation) will always send a 
@@ -1927,10 +1933,12 @@ int CheckHost(host, held)
                        H_LOCK
                        if(code) {
                            if ( MultiProbeAlternateAddress_r(host) ) {
-                               ViceLog(0,
-                                       ("ProbeUuid failed for host %x.%d\n",
-                                        host->host, host->port));
-                               host->hostFlags |= VENUSDOWN;
+                               char hoststr[16];
+                               afs_inet_ntoa_r(host->host, hoststr);
+                                ViceLog(0,
+                                       ("ProbeUuid failed for host %s:%d\n",
+                                        hoststr, ntohs(host->port)));
+                                host->hostFlags |= VENUSDOWN;
                            }
                        }
                    } else {
@@ -1938,9 +1946,11 @@ int CheckHost(host, held)
                        code = RXAFSCB_Probe(host->callback_rxcon);
                        H_LOCK
                        if (code) {
-                           ViceLog(0, ("ProbeUuid failed for host %x.%d\n",
-                                   host->host, host->port));
-                           host->hostFlags |= VENUSDOWN;
+                           char hoststr[16];
+                           afs_inet_ntoa_r(host->host, hoststr);
+                           ViceLog(0, ("ProbeUuid failed for host %s:%d\n",
+                                       hoststr, ntohs(host->port)));
+                           host->hostFlags |= VENUSDOWN;
                        }
                    }
                }
index 06bfa9f2c243801c92808b5322eab2fcbba74286..b24d1a87123bf58843bb3134720f72600b7ef86f 100644 (file)
@@ -599,10 +599,12 @@ main(argc, argv)
        ViceLog(0, ("Can't find address for FileServer '%s'\n", FS_HostName));
     }
     else {
-      bcopy(he->h_addr, &FS_HostAddr_NBO, 4);
-      FS_HostAddr_HBO = ntohl(FS_HostAddr_NBO);
-      ViceLog(0,("FileServer %s has address 0x%x (0x%x in host byte order)\n",
-                FS_HostName, FS_HostAddr_NBO, FS_HostAddr_HBO));
+       char hoststr[16];
+       bcopy(he->h_addr, &FS_HostAddr_NBO, 4);
+       afs_inet_ntoa_r(FS_HostAddr_NBO, hoststr);
+       FS_HostAddr_HBO = ntohl(FS_HostAddr_NBO);
+       ViceLog(0,("FileServer %s has address %s (0x%x or 0x%x in host byte order)\n",
+                  FS_HostName, hoststr, FS_HostAddr_NBO, FS_HostAddr_HBO));
     }
 
     /* Install handler to catch the shutdown signal */
@@ -646,15 +648,17 @@ static FiveMinuteCheckLWP()
        ViceLog(2, ("Set disk usage statistics\n"));
        VSetDiskUsage();
        if (FS_registered == 1) Do_VLRegisterRPC();
-#ifndef AFS_QUIETFS_ENV
        if(printBanner && (++msg&1)) { /* Every 10 minutes */
            time_t now = FT_ApproxTime();
            if (console != NULL) {
+#ifndef AFS_QUIETFS_ENV
                fprintf(console,"File server is running at %s\r",
                        afs_ctime(&now, tbuffer, sizeof(tbuffer)));
+#endif /* AFS_QUIETFS_ENV */
+               ViceLog(2, ("File server is running at %s\n",
+                       afs_ctime(&now, tbuffer, sizeof(tbuffer))));
            }
        }
-#endif /* AFS_QUIETFS_ENV */
     }
 } /*FiveMinuteCheckLWP*/
 
@@ -857,17 +861,24 @@ int dopanic;
        rx_PrintStats(debugFile);
        fflush(debugFile);
     }
-#ifndef AFS_QUIETFS_ENV
     if (console != NULL) {
        now = time(0);
-       if (dopanic)
+       if (dopanic) {
+#ifndef AFS_QUIETFS_ENV
            fprintf(console, "File server has terminated abnormally at %s\r",
                    afs_ctime(&now, tbuffer, sizeof(tbuffer)));
-       else 
+#endif
+           ViceLog(0, ("File server has terminated abnormally at %s\n",
+               afs_ctime(&now, tbuffer, sizeof(tbuffer))));
+       } else {
+#ifndef AFS_QUIETFS_ENV
            fprintf(console, "File server has terminated normally at %s\r",
                    afs_ctime(&now, tbuffer, sizeof(tbuffer)));
-    }
 #endif
+           ViceLog(0, ("File server has terminated normally at %s\n",
+               afs_ctime(&now, tbuffer, sizeof(tbuffer))));
+       }
+    }
 
     exit(0);
 
index aefc0a786d381c90d0d3ecceddfca6e7369a95e4..62dba44ac4c8efabd148261a678a44e1adbd548f 100644 (file)
@@ -14,7 +14,7 @@ KERNELDIR=../libafs/
 UKERNELDIR=../libuafs/
 COMPILE_ET = ${SRCDIR}bin/compile_et
 
-CFLAGS = ${DBUG} -I. -I.. -I${SRCDIR}include ${XCFLAGS}
+CFLAGS = ${DBUG} -I. -I.. -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS}
 INCLS=${SRCDIR}include/ubik.h \
              ${SRCDIR}include/lwp.h \
              ${SRCDIR}include/lock.h  \
@@ -125,3 +125,7 @@ install: kinstall ukinstall vlserver vlclient libvldb.a cnvldb ${DESTDIR}root.se
        ${INSTALL} cnvldb.h ${DESTDIR}include/afs
        ${INSTALL} vldb_check ${DESTDIR}/etc
 
+libinstall: libvldb.a
+       ${INSTALL} libvldb.a ${DESTDIR}lib/afs
+       ${INSTALL} vl_opcodes.h vlserver.h vldbint.h ${DESTDIR}include/afs
+       ${INSTALL} cnvldb.h ${DESTDIR}include/afs
index db4527db617230fbff1b1dfda62e58c7beef5ef2..9f0a5e4b5abc04ec72c546399d5f16193b7d7f94 100644 (file)
@@ -8,7 +8,7 @@
 # Override default definitions in NTMakefile.$(SYS_NAME) before including.
 
 !INCLUDE ..\config\NTMakefile.$(SYS_NAME)
-!INCLUDE ..\config\NTMakefile.version
+!include ..\config\NTMakefile.version
 
 
 ############################################################################
@@ -141,6 +141,10 @@ vlclient.exe: vlclient.obj  $(LIBFILE) $(VLSERVER_EXECLIBS) $(VLCLIENT_LIBS)
 install: $(INCFILES) $(LIBFILE) $(VLSERVER) vldb_check.exe vlclient.exe \
         $(MT_LIBFILE)
 
+install9x: install
+
+install_libutils: $(INCFILES) $(LIBFILE)
+
 ############################################################################
 # clean up
 
index 2ca67961c193f22ef5fd76a3298d172a203eafed..d92645a47d9df756beca7141a7fa34d14a54205c 100644 (file)
@@ -174,12 +174,16 @@ char      **argv;
 #endif
        } else {
            /* support help flag */
-           printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
 #ifndef AFS_NT40_ENV
+           printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
                   "[-syslog[=FACILITY]] "
-#endif
-                  /*" [-enable_peer_stats] [-enable_process_stats] " */
+                  "[-enable_peer_stats] [-enable_process_stats] "
                   "[-help]\n");
+#else
+           printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
+                  "[-enable_peer_stats] [-enable_process_stats] "
+                  "[-help]\n");
+#endif
            fflush(stdout);
            exit(0);
        }
@@ -221,7 +225,7 @@ char        **argv;
     }
     bcopy(th->h_addr,&myHost,sizeof(afs_int32));
 
-#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV)
+#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
     signal(SIGXCPU, CheckSignal_Signal);
 #endif
     /* get list of servers */
index 72592096eeb67da34d68b8068b22064712cd16fc..e3b264b40b8415c74fc680c96bdbe263e74ba857 100644 (file)
@@ -10,7 +10,7 @@ COMPONENT=vol
 include ../config/Makefile.${SYS_NAME}
 include ../config/Makefile.version
 
-INCDIRS= -I. -I${DESTDIR}include ${FSINCLUDES}
+INCDIRS= -I${TOP_SRCDIR}/config -I. -I${DESTDIR}include ${FSINCLUDES}
 LDFLAGS = ${OPTMZ} ${PROF} ${LDIRS} ${XLDFLAGS}
 
 LIBS= ${DESTDIR}lib/afs/libcmd.a vlib.a ${SRCDIR}lib/afs/util.a \
@@ -101,7 +101,7 @@ gi: ${DESTDIR}/lib/afs/libsys.a
 
 volinfo: vol-info.o physio.o ihandle.o
        case ${SYS_NAME} in \
-               *linux*) \
+               *linux* | *fbsd*) \
                        ${CC} ${CFLAGS} ${DBG} -o volinfo vol-info.o physio.o \
                                ihandle.o ${LIBS}  ;; \
                *) \
@@ -124,7 +124,8 @@ xfs_size_check: xfs_size_check.c
 
 clean:
        rm -f *.o *.a AFS_component_version_number.c
-       rm -f ${SCMPROGS} ${STAGEPROGS} core
+       rm -f ${SCMPROGS} ${STAGEPROGS} core salvager volinfo gi fs_conv_sol26 fs_conv_dux40D
+
 
 beancount:
        wc -l *.c *.h
index 5222b8c1b2c451d95c0b5d7117289238a96f16ef..de163cf879af556769b45701211e0278bd61c648 100644 (file)
@@ -72,7 +72,7 @@ int *forcep, forceR;
 #ifdef   AFS_SUN5_ENV
 #include <sys/fs/ufs_inode.h>
 #else
-#if defined(AFS_DARWIN_ENV)
+#if !defined(AFS_DARWIN_ENV)
 #include <ufs/inode.h>
 #endif
 #endif
index 4694ed363d58c06fadacdb494b5cdf5854ecf403..e878c447316cb7bb4438b2aac70d9e458b771e76 100644 (file)
@@ -169,7 +169,6 @@ void namei_HandleToName(namei_t *name, IHandle_t *ih)
 {
     lb64_string_t str;
     int vno = (int)(ih->ih_ino & NAMEI_VNODEMASK);
-    int tmp;
        
     namei_HandleToVolDir(name, ih);
 
@@ -235,8 +234,6 @@ do { \
 static int namei_CreateDataDirectories(namei_t *name, int *created)
 {
     char tmp[256];
-    char *s;
-    int i;
 
     *created = 0;
 
@@ -278,7 +275,6 @@ delTree(char *root, char *tree, int *errp)
   DIR *ds;
   struct dirent *dirp;
   struct stat st;
-  int er;
 
   if (*tree) {
     /* delete the children first */
@@ -293,7 +289,7 @@ delTree(char *root, char *tree, int *errp)
     /* now delete all entries in this dir */
     if ( (ds = opendir(root)) != (DIR *)NULL) {
       errno = 0;
-      while (dirp = readdir(ds)) {
+      while ((dirp = readdir(ds))) {
        /* ignore . and .. */
        if (!strcmp(dirp->d_name, ".") || !strcmp(dirp->d_name, ".."))
          continue;
@@ -422,8 +418,6 @@ static int SetOGM(int fd, int parm, int tag)
 /* GetOGM - get parm and tag from owner, group and mode bits. */
 static void GetOGMFromStat(struct stat *status, int *parm, int *tag)
 {
-    int tmp;
-
     *parm = status->st_uid | (status->st_gid << 15);
     *parm |= (status->st_mode & 0x18) << 27;
     *tag = status->st_mode & 0x7;
@@ -447,17 +441,12 @@ int big_vno = 0; /* Just in case we ever do 64 bit vnodes. */
 Inode namei_icreate(IHandle_t *lh, char *part, int p1, int p2, int p3, int p4)
 {
     namei_t name;
-    namei_ogm_t ogm;
-    b32_string_t str1;
-    char *p;
-    int i;
     int fd = -1;
     int code = 0;
     int created_dir = 0;
     IHandle_t tmp;
     FdHandle_t *fdP;
     FdHandle_t tfd;
-    int save_errno;
     int tag;
     int ogm_parm;
     
@@ -581,7 +570,6 @@ int namei_dec(IHandle_t *ih, Inode ino, int p1)
 
     if ((ino & NAMEI_INODESPECIAL) == NAMEI_INODESPECIAL) {
        IHandle_t *tmp;
-       int was_closed = 0;
        int inode_p1, tag;
        int type = (int)((ino>>NAMEI_TAGSHIFT) & NAMEI_TAGMASK);
 
@@ -805,7 +793,6 @@ static void namei_GetLCOffsetAndIndexFromIno(Inode ino, int *offset, int *index)
 int namei_GetLinkCount(FdHandle_t *h, Inode ino, int lockit)
 {
     unsigned short row = 0;
-    int junk;
     int offset, index;
 
     namei_GetLCOffsetAndIndexFromIno(ino, &offset, &index);
@@ -1145,14 +1132,14 @@ int namei_ListAFSFiles(char *dev,
        dirp1 = opendir(name.n_path);
        if (!dirp1)
            return 0;
-       while (dp1 = readdir(dirp1)) {
+       while ((dp1 = readdir(dirp1))) {
            if (*dp1->d_name == '.') continue;
            (void) strcpy(path2, name.n_path);
            (void) strcat(path2, "/");
            (void) strcat(path2, dp1->d_name);
            dirp2 = opendir(path2);
            if (dirp2) {
-               while (dp2 = readdir(dirp2)) {
+               while ((dp2 = readdir(dirp2))) {
                    if (*dp2->d_name == '.') continue;
                    if (!DecodeVolumeName(dp2->d_name, &ih.ih_vid)) {
                        ninodes += namei_ListAFSSubDirs(&ih, writeFun, fp,
@@ -1186,18 +1173,16 @@ static int namei_ListAFSSubDirs(IHandle_t *dirIH,
                             int (*judgeFun)(struct ViceInodeInfo *, int),
                             int singleVolumeNumber)
 {
-    int i;
     IHandle_t myIH = *dirIH;
     namei_t name;
     char path1[512], path2[512], path3[512];
     DIR *dirp1, *dirp2, *dirp3;
     struct dirent *dp1, *dp2, *dp3;
-    char *s;
     struct ViceInodeInfo info;
-    int tag, vno;
     FdHandle_t linkHandle;
     int ninodes = 0;
 #ifdef DELETE_ZLC
+    int i;
     static void AddToZLCDeleteList(char dir, char *name);
     static void DeleteZLCFiles(char *path);
 #endif
@@ -1214,7 +1199,7 @@ static int namei_ListAFSSubDirs(IHandle_t *dirIH,
     linkHandle.fd_fd = -1;
     dirp1 = opendir(path1);
     if (dirp1) {
-       while (dp1 = readdir(dirp1)) {
+       while ((dp1 = readdir(dirp1))) {
            if (*dp1->d_name == '.') continue;
            if (DecodeInode(path1, dp1->d_name, &info, myIH.ih_vid)<0)
                continue;
@@ -1247,7 +1232,7 @@ static int namei_ListAFSSubDirs(IHandle_t *dirIH,
     
     dirp1 = opendir(path1);
     if (dirp1) {
-       while (dp1 = readdir(dirp1)) {
+       while ((dp1 = readdir(dirp1))) {
            if (*dp1->d_name == '.') continue;
            if (!strcmp(dp1->d_name, NAMEI_SPECDIR))
                continue;
@@ -1258,7 +1243,7 @@ static int namei_ListAFSSubDirs(IHandle_t *dirIH,
            (void) strcat(path2, dp1->d_name);
            dirp2 = opendir(path2);
            if (dirp2) {
-               while (dp2 = readdir(dirp2)) {
+               while ((dp2 = readdir(dirp2))) {
                    if (*dp2->d_name == '.') continue;
                    
                    /* Now we've got to the actual data */
@@ -1267,7 +1252,7 @@ static int namei_ListAFSSubDirs(IHandle_t *dirIH,
                    (void) strcat(path3, dp2->d_name);
                    dirp3 = opendir(path3);
                    if (dirp3) {
-                       while (dp3 = readdir(dirp3)) {
+                       while ((dp3 = readdir(dirp3))) {
                            if (*dp3->d_name == '.') continue;
                            if (DecodeInode(path3, dp3->d_name, &info,
                                            myIH.ih_vid)<0)
index 2032ff2ff865600994deb0ce5ee83d650aa03306..dbb620a5a564233003c8d65290b55245434b2427 100644 (file)
@@ -551,11 +551,15 @@ VAttachVolumeByName_r(ec, partition, name, mode)
            if (vp->specialStatus == VBUSY)
                isbusy = 1;
            VDetachVolume_r(ec, vp);
+           if ( *ec ) {
+               Log("VAttachVolume: Error detaching volume (%s)\n", name);
+           }
        }
     }
 
     if (!(partp = VGetPartition_r(partition, 0))) {
        *ec = VNOVOL;
+       Log("VAttachVolume: Error getting partition (%s)\n", partition);
        goto done;
     }
 
@@ -630,6 +634,7 @@ VAttachVolumeByName_r(ec, partition, name, mode)
 #endif
        VUpdateVolume_r(ec,vp);
        if (*ec) {
+           Log("VAttachVolume: Error updating volume\n");
            if (vp)
                VPutVolume_r(vp);
            goto done;
@@ -646,6 +651,7 @@ VAttachVolumeByName_r(ec, partition, name, mode)
            V_dontSalvage(vp) = DONT_SALVAGE;
            VAddToVolumeUpdateList_r(ec,vp);
            if (*ec) {
+               Log("VAttachVolume: Error adding volume to update list\n");
                if (vp)
                    VPutVolume_r(vp);
                goto done;
@@ -699,6 +705,10 @@ private Volume *attach2(ec, path, header, partp, isbusy)
                      (char *)&V_disk(vp), sizeof(V_disk(vp)), 
                      VOLUMEINFOMAGIC, VOLUMEINFOVERSION);
     VOL_LOCK
+    if (*ec) {
+      Log("VAttachVolume: Error reading diskDataHandle vol header %s; error=%d\n",
+        path, *ec);
+    }
     if (!*ec) {
        struct IndexFileHeader iHead;
 
@@ -718,6 +728,10 @@ private Volume *attach2(ec, path, header, partp, isbusy)
                          (char *)&iHead, sizeof(iHead), 
                          SMALLINDEXMAGIC, SMALLINDEXVERSION);
        VOL_LOCK
+       if (*ec) {
+           Log("VAttachVolume: Error reading smallVnode vol header %s; error=%d\n",
+               path, *ec);
+       }
     }
     if (!*ec) {
        struct IndexFileHeader iHead;
@@ -726,6 +740,10 @@ private Volume *attach2(ec, path, header, partp, isbusy)
                          (char *)&iHead, sizeof(iHead),
                          LARGEINDEXMAGIC, LARGEINDEXVERSION);
        VOL_LOCK
+       if (*ec) {
+           Log("VAttachVolume: Error reading largeVnode vol header %s; error=%d\n",
+               path, *ec);
+       }
     }
 #ifdef AFS_NAMEI_ENV
     if (!*ec) {
@@ -735,11 +753,15 @@ private Volume *attach2(ec, path, header, partp, isbusy)
                          (char *)&stamp, sizeof(stamp),
                          LINKTABLEMAGIC, LINKTABLEVERSION);
        VOL_LOCK
+       if (*ec) {
+           Log("VAttachVolume: Error reading namei vol header %s; error=%d\n",
+               path, *ec);
+       }
     }
 #endif
     if (*ec) {
-       Log("VAttachVolume: Error attaching volume %s; volume needs salvage\n",
-           path);
+       Log("VAttachVolume: Error attaching volume %s; volume needs salvage; error=%d\n",
+           path, *ec);
        FreeVolume(vp);
        return NULL;
     }
@@ -782,6 +804,7 @@ private Volume *attach2(ec, path, header, partp, isbusy)
            VOL_LOCK
            if (*ec) {
                FreeVolume(vp);
+               Log("VAttachVolume: error getting bitmap for volume (%s)\n", path);
                return NULL;
            }
        }
index fb63eb63a8e75e6d34bfa47b7dbe238dc2f931c6..629f42775ff2d4437f4470d58a99cb480f470473 100644 (file)
@@ -13,7 +13,7 @@ COMPILE_ET=${SRCDIR}bin/compile_et
 CFLAGS=${DBG} ${OPTMZ} -I${SRCDIR}include ${XCFLAGS} ${DBG_DEFS}
 LDFLAGS=${DBG} ${OPTMZ} ${XLDFLAGS}
 
-INCDIRS= -I${SRCDIR}include/afs -I${SRCDIR}include
+INCDIRS= -I${TOP_SRCDIR}/config -I${SRCDIR}include/afs -I${SRCDIR}include
 INCLIBS=-L${SRCDIR}lib/afs -L${SRCDIR}lib
 
 VINCLS=${SRCDIR}include/afs/partition.h ${SRCDIR}include/afs/volume.h \
@@ -102,7 +102,7 @@ volint.xdr.o: volint.xdr.c ${INTINCLS}
 
 volserver: $(SOBJS) $(LIBS) $(HACKS)
        case ${SYS_NAME} in \
-                *linux*) \
+                *linux* | *fbsd* ) \
                         ${CC} ${DBUG} -o volserver $(SOBJS) $(HACKS) \
                                ${LDFLAGS} $(LIBS) ${XLIBS} ;; \
                 *) \
@@ -131,7 +131,7 @@ install: all $(TARGETS)
 
 clean:
        rm -f volserver *.o volint.ss.c volint.cs.c *.a  volint.h \
-       volint.xdr.c vos core volser.h volerr.c AFS_component_version_number.c
+       volint.xdr.c vos core volser.h volerr.c AFS_component_version_number.c restorevol
 
 lint:  vos.c vsprocs.c volmain.c volprocs.c lockprocs.c
        lint -hb ${INCDIRS} ${INCLIBS} vos.c
index 9dee487f16cdc98683ac1f781fe59652c556ac0e..554b40fa39a2aea3c746023d721129645047a2c3 100644 (file)
@@ -1782,7 +1782,7 @@ volEntries *volumeInfo;
                pntr->status = 0; /*things are messed up */
                strcpy(pntr->name,volname);
                pntr->volid = volid;
-               Log("1 Volser: ListVolumes: Could not attach volume %u\n",volid);
+               Log("1 Volser: ListVolumes: Could not attach volume %u (%s:%s), error=%d\n",volid,pname,volname,error);
                goto drop;
            }
            if(tv->header->diskstuff.destroyMe == DESTROY_ME) {
@@ -1790,7 +1790,7 @@ volEntries *volumeInfo;
                pntr->status = 0;
                strcpy(pntr->name,volname);
                pntr->volid = volid;
-               Log("1 Volser: ListVolumes: Volume %u will be destroyed on next salvage\n",volid);
+               Log("1 Volser: ListVolumes: Volume %u (%s) will be destroyed on next salvage\n",volid,volname);
                goto drop;
            }
 
@@ -1799,7 +1799,7 @@ volEntries *volumeInfo;
                pntr->status = 0;
                strcpy(pntr->name,volname);
                pntr->volid = volid;
-               Log("1 Volser: ListVolumes: Volume %u needs to be salvaged\n",volid);
+               Log("1 Volser: ListVolumes: Volume %u (%s) needs to be salvaged\n",volid,volname);
                goto drop;
            }
 
@@ -2153,7 +2153,7 @@ volEntries *volumeInfo;
                pntr->status = 0; /*things are messed up */
                strcpy(pntr->name,volname);
                pntr->volid = volid;
-               Log("1 Volser: ListVolumes: Could not attach volume %u\n",volid);
+               Log("1 Volser: ListVolumes: Could not attach volume %u (%s) error=%d\n",volid,volname,error);
                goto drop;
            }
            if(tv->header->diskstuff.needsSalvaged){
@@ -2161,7 +2161,7 @@ volEntries *volumeInfo;
                pntr->status = 0;
                strcpy(pntr->name,volname);
                pntr->volid = volid;
-               Log("1 Volser: ListVolumes: Volume %u needs to be salvaged\n",volid);
+               Log("1 Volser: ListVolumes: Volume %u (%s) needs to be salvaged\n",volid, volname);
                goto drop;
            }
 
index 8801715305f040ad87e71496aae21cc7425bee8b..a27f4b744b62b1319410e0d96fabdf3d34b75a47 100644 (file)
@@ -3772,7 +3772,7 @@ char **argv; {
 
     ts = cmd_CreateSyntax("release", ReleaseVolume, 0, "release a volume");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
-    cmd_AddParm(ts, "-f", CMD_FLAG, CMD_OPTIONAL, "force a complete release");
+    cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL, "force a complete release");
     COMMONPARMS;
 
     ts = cmd_CreateSyntax("dump", DumpVolume, 0, "dump a volume");
index 45e37864a82614174d0e099eb3fcba6734ee4724..526dac1147686761f1bf070cc76ba170d274224a 100644 (file)
@@ -1021,7 +1021,7 @@ UV_MoveVolume(afromvol, afromserver, afrompart, atoserver, atopart)
      * clone the read/write volume locally.
      * ***/
 
-    if (verbose) fprintf(STDOUT,"Starting transaction  on source volume %u ...",afromvol);
+    if (verbose) fprintf(STDOUT,"Starting transaction on source volume %u ...",afromvol);
     fflush(STDOUT);
     code = AFSVolTransCreate(fromconn, afromvol, afrompart, ITBusy, &fromtid);
     ONERR (code, "Failed to create transaction on the volume %u\n", afromvol);
index 0c0a33a50ce024ac4712091b7aa232378dd93d08..f4ebab26daf5b6e0608264f58b3fc877a6e5e82f 100644 (file)
@@ -399,7 +399,7 @@ afs_int32 vsu_ClientInit(noAuthFlag, confDir, cellName, sauth, uclientp, secproc
         }
         code = afsconf_ClientAuth(tdir, &sc, &scIndex); /* sets sc,scIndex */
         if (code) {
-            fprintf(STDERR, "vsu_ClientInit: Could not get security object for -localAuth %\n");
+            fprintf(STDERR, "vsu_ClientInit: Could not get security object for -localAuth\n");
             return -1;
         }
         code = afsconf_GetCellInfo(tdir, tdir->cellName, AFSCONF_VLDBSERVICE,