From e03abffeecba2d691e5e7dd80ee7abb7d9a6d01f Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Thu, 5 Jul 2001 01:05:06 +0000 Subject: [PATCH] This commit was generated by cvs2svn to compensate for changes in r240, which included commits to RCS files with non-trunk default branches. --- src/BUILDNOTES | 20 +- src/NTMakefile | 225 ++- src/README | 127 +- src/README.OBSOLETE | 3 + src/README.SECURITY | 3 + src/WINNT/afsd/NTMakefile | 28 +- src/WINNT/afsd/afsd.h | 32 +- src/WINNT/afsd/afsd_init.c | 4 +- src/WINNT/afsd/afsd_init.h | 7 +- src/WINNT/afsd/afsd_service.c | 17 + src/WINNT/afsd/cm.h | 53 +- src/WINNT/afsd/cm_access.c | 4 + src/WINNT/afsd/cm_access.h | 2 + src/WINNT/afsd/cm_aclent.c | 2 + src/WINNT/afsd/cm_buf.c | 77 +- src/WINNT/afsd/cm_buf.h | 10 + src/WINNT/afsd/cm_callback.c | 4 + src/WINNT/afsd/cm_callback.h | 3 +- src/WINNT/afsd/cm_cell.c | 2 + src/WINNT/afsd/cm_config.c | 155 +- src/WINNT/afsd/cm_config.h | 3 + src/WINNT/afsd/cm_conn.c | 26 +- src/WINNT/afsd/cm_conn.h | 2 + src/WINNT/afsd/cm_daemon.c | 28 +- src/WINNT/afsd/cm_dcache.c | 15 +- src/WINNT/afsd/cm_dir.c | 2 + src/WINNT/afsd/cm_dnlc.c | 6 + src/WINNT/afsd/cm_ioctl.c | 56 +- src/WINNT/afsd/cm_ioctl.h | 3 + src/WINNT/afsd/cm_rpc.c | 4 + src/WINNT/afsd/cm_rpc.h | 4 + src/WINNT/afsd/cm_scache.c | 28 +- src/WINNT/afsd/cm_scache.h | 7 + src/WINNT/afsd/cm_server.c | 6 +- src/WINNT/afsd/cm_server.h | 4 + src/WINNT/afsd/cm_user.c | 13 +- src/WINNT/afsd/cm_utils.c | 4 +- src/WINNT/afsd/cm_vnodeops.c | 8 +- src/WINNT/afsd/cm_vnodeops.h | 2 + src/WINNT/afsd/cm_volume.c | 8 +- src/WINNT/afsd/fs_utils.h | 2 + src/WINNT/afsd/smb.c | 1363 +++++++++++++++-- src/WINNT/afsd/smb.h | 52 +- src/WINNT/afsd/smb3.c | 330 ++-- src/WINNT/afsd/smb3.h | 10 + src/WINNT/afsd/smb_iocons.h | 1 + src/WINNT/afsd/smb_ioctl.c | 73 +- src/WINNT/afsd/smb_ioctl.h | 5 + src/WINNT/afsreg/NTMakefile | 3 + src/WINNT/client_config/NTMakefile | 61 +- src/WINNT/client_config/lang/NTMakefile | 4 +- src/WINNT/client_cpa/NTMakefile | 62 +- src/WINNT/client_cpa/lang/NTMakefile | 6 +- src/WINNT/client_creds/lang/NTMakefile | 4 +- src/WINNT/client_exp/NTMakefile | 56 +- src/WINNT/client_exp/lang/NTMakefile | 4 +- src/WINNT/client_osi/NTMakefile | 7 +- src/WINNT/client_osi/osi.h | 28 +- src/WINNT/client_osi/osifd.c | 40 +- src/WINNT/client_osi/osifd.h | 9 + src/WINNT/client_osi/osilog.c | 48 +- src/WINNT/client_osi/osilog.h | 9 +- src/WINNT/client_osi/osiqueue.c | 14 +- src/WINNT/client_osi/osisleep.h | 23 +- src/WINNT/eventlog/NTMakefile | 58 +- src/WINNT/eventlog/lang/NTMakefile | 3 + .../InstallShield5/CreateISDirTree.bat | 47 +- src/WINNT/install/InstallShield5/Default.rge | 97 +- .../install/InstallShield5/GenFileGroups.bat | 59 +- src/WINNT/install/InstallShield5/NTMakefile | 15 +- src/WINNT/install/InstallShield5/afsdcell.ini | 2 - .../InstallShield5/lang/en_US/value.shl | 22 +- src/WINNT/install/InstallShield5/setup.bmp | Bin 60214 -> 399222 bytes src/WINNT/install/InstallShield5/setup.rul | 19 +- src/WINNT/license/lang/en_US.ide | Bin 4802 -> 604 bytes src/WINNT/pthread/NTMakefile | 8 +- src/WINNT/talocale/NTMakefile | 5 + src/afs/IRIX/osi_vnodeops.c | 2 +- src/afs/LINUX/osi_groups.c | 20 +- src/afs/Makefile | 2 +- src/afs/SOLARIS/osi_vfsops.c | 1 + src/afs/UKERNEL/afs_usrops.c | 231 ++- src/afs/UKERNEL/afs_usrops.h | 3 +- src/afs/VNOPS/afs_vnop_access.c | 25 + src/afs/VNOPS/afs_vnop_attrs.c | 4 +- src/afs/VNOPS/afs_vnop_create.c | 3 + src/afs/VNOPS/afs_vnop_flock.c | 7 +- src/afs/afs_cell.c | 192 ++- src/afs/afs_init.c | 13 +- src/afs/afs_osi_pag.c | 148 +- src/afs/afs_server.c | 2 +- src/afsd/afsd.c | 103 +- src/afsmonitor/Makefile | 1 + src/afsmonitor/afsmon-output.c | 1 - src/afsmonitor/afsmon-win.c | 14 +- src/afsmonitor/afsmonitor.c | 42 +- src/afsmonitor/afsmonitor.h | 2 +- src/audit/Makefile | 2 +- src/audit/NTMakefile | 3 + src/audit/audit.c | 4 +- src/auth/Makefile | 7 +- src/auth/NTMakefile | 3 + src/auth/cellconfig.c | 121 +- src/auth/cellconfig.p.h | 1 + src/auth/ktc_nt.c | 13 +- src/auth/userok.c | 172 ++- src/bozo/Makefile | 2 +- src/bozo/bosserver.c | 10 +- src/bucoord/Makefile | 2 +- src/bucoord/commands.c | 2 +- src/cmd/Makefile | 4 +- src/cmd/NTMakefile | 2 + src/comerr/NTMakefile | 17 +- src/comerr/compile_et.c | 14 +- src/comerr/error_table.y | 4 +- src/comerr/et_lex.lex.l | 2 +- src/comerr/et_lex.lex_nt.c | 4 +- src/config/Makefile | 5 +- src/config/Makefile.version-NOCML | 4 +- src/config/NTMakefile | 82 +- src/config/NTMakefile.i386_nt40 | 7 +- src/config/afs_args.h | 1 + src/config/afs_sysnames.h | 2 + src/config/param.alpha_dux40_usr.h | 2 +- src/config/param.i386_fbsd_42.h | 35 +- src/config/param.i386_fbsd_42_usr.h | 9 +- src/config/param.i386_linux24_usr.h | 1 - src/config/param.i386_nt40.h | 2 + src/config/param.ppc_darwin_12.h | 2 +- src/config/param.ppc_darwin_12_usr.h | 2 +- src/config/param.ppc_darwin_13.h | 2 +- src/config/param.ppc_darwin_13_usr.h | 2 +- src/config/param.s390_linux22.h | 35 +- src/config/param.sun4x_55.h | 4 +- src/config/param.sun4x_55_usr.h | 2 +- src/config/param.sun4x_56.h | 4 +- src/config/param.sun4x_56_usr.h | 2 +- src/config/param.sun4x_57.h | 4 +- src/config/param.sun4x_57_usr.h | 2 +- src/config/param.sun4x_58.h | 4 +- src/config/param.sun4x_58_usr.h | 2 +- src/config/param.sunx86_54.h | 4 +- src/dauth/Makefile | 2 +- src/des/Makefile | 23 +- src/des/NTMakefile | 5 + src/des/andrew-conf.h | 3 +- src/des/cksum.c | 7 +- src/des/crypt.c | 41 +- src/des/make_p_table.c | 2 +- src/des/make_s_table.c | 2 +- src/des/new_rnd_key.c | 13 +- src/des/quad_cksum.c | 2 +- src/des/read_pssword.c | 29 +- src/des/strng_to_key.c | 9 +- src/des/test/key_test.c | 4 - src/des/test/testit.c | 4 - src/des/test/verify.c | 4 - src/des/weak_key.c | 7 +- src/des_stub/NTMakefile | 1 + src/dir/Makefile | 2 +- src/finale/translate_et.c | 4 +- src/fsint/Makefile | 4 +- src/fsint/NTMakefile | 4 + src/kauth/Makefile | 2 +- src/kauth/NTMakefile | 7 +- src/kauth/admin_tools.c | 4 + src/kauth/authclient.c | 5 + src/kauth/kalocalcell.c | 2 +- src/kauth/kautils.p.h | 8 +- src/kauth/krb_udp.c | 1 + src/kauth/rebuild.c | 2 +- src/libacl/NTMakefile | 4 +- src/libadmin/Makefile | 2 + src/libadmin/NTMakefile | 5 +- src/libadmin/adminutil/afs_utilAdmin.c | 11 +- src/libadmin/bos/afs_bosAdmin.c | 19 +- src/libadmin/client/afs_clientAdmin.c | 18 +- src/libadmin/kas/afs_kasAdmin.c | 3 - src/libadmin/kas/afs_kasAdmin.h | 2 + src/libadmin/samples/rxstat_get_version.c | 2 +- src/libadmin/vos/Makefile | 2 +- src/libadmin/vos/afs_vosAdmin.c | 15 +- src/libadmin/vos/afs_vosAdmin.h | 2 + src/libadmin/vos/lockprocs.c | 8 +- src/libadmin/vos/lockprocs.h | 1 + src/libadmin/vos/vosutils.c | 7 + src/libadmin/vos/vosutils.h | 1 + src/libadmin/vos/vsprocs.c | 45 +- src/libadmin/vos/vsprocs.h | 1 + src/libafsauthent/Makefile | 2 +- src/libafsauthent/NTMakefile | 15 +- src/libafsrpc/Makefile | 4 +- src/libafsrpc/NTMakefile | 10 +- src/libuafs/Makefile.common | 8 +- src/libuafs/MakefileProto.AIX | 4 +- src/libuafs/MakefileProto.DARWIN | 2 +- src/libuafs/MakefileProto.DUX | 5 +- src/libuafs/MakefileProto.FBSD | 2 +- src/libuafs/MakefileProto.HPUX | 6 +- src/libuafs/MakefileProto.IRIX | 4 +- src/libuafs/MakefileProto.LINUX | 2 +- src/libuafs/MakefileProto.SOLARIS | 6 +- src/log/Makefile | 2 +- src/lwp/Makefile | 10 +- src/lwp/NTMakefile | 5 + src/lwp/iomgr.c | 231 ++- src/lwp/lwp_nt.c | 23 + src/lwp/process.s | 33 +- src/lwp/threadname.c | 14 +- src/lwp/timer.c | 4 + src/lwp/waitkey.c | 6 +- src/ntbuild.bat | 30 +- src/pam/Makefile | 2 +- src/pinstall/Makefile | 2 +- src/procmgmt/Makefile | 3 + src/procmgmt/NTMakefile | 5 +- src/ptserver/Makefile | 13 +- src/ptserver/NTMakefile | 16 +- src/ptserver/ptserver.c | 12 +- src/ptserver/ptutils.c | 1 + src/ptserver/ubik.c | 2 +- src/rx/LINUX/rx_kmutex.h | 4 +- src/rx/Makefile | 35 +- src/rx/NTMakefile | 4 +- src/rx/rx.h | 33 + src/rx/rx_clock.c | 2 + src/rx/rx_conncache.c | 3 +- src/rx/rx_event.c | 15 +- src/rx/rx_getaddr.c | 11 +- src/rx/rx_lwp.c | 16 +- src/rx/rx_misc.c | 22 +- src/rx/rx_packet.c | 51 +- src/rx/rx_packet.h | 9 +- src/rx/rx_pthread.c | 2 +- src/rx/rx_rdwr.c | 24 +- src/rx/rx_trace.c | 11 +- src/rx/rx_user.c | 39 +- src/rx/rx_xmit_nt.c | 19 +- src/rx/rx_xmit_nt.h | 8 +- src/rx/rxdebug.c | 19 +- src/rx/xdr.h | 12 +- src/rx/xdr_rx.c | 2 + src/rxgen/Makefile | 2 +- src/rxgen/NTMakefile | 3 +- src/rxgen/rpc_clntout.c | 10 +- src/rxgen/rpc_cout.c | 12 +- src/rxgen/rpc_hout.c | 4 + src/rxgen/rpc_main.c | 37 +- src/rxgen/rpc_parse.c | 39 +- src/rxgen/rpc_scan.c | 12 +- src/rxgen/rpc_svcout.c | 14 +- src/rxgen/rpc_util.c | 10 + src/rxgen/rpc_util.h | 7 - src/rxkad/Makefile | 4 +- src/rxkad/NTMakefile | 1 + src/rxstat/Makefile | 4 +- src/rxstat/NTMakefile | 4 + src/sgistuff/Makefile | 3 + src/sia/Makefile | 3 + src/sys/Makefile | 4 +- src/sys/NTMakefile | 2 + src/sys/pagsh.c | 24 +- src/sys/pioctl_nt.c | 18 +- src/sys/rmtsysc.c | 4 + src/sys/rmtsyss.c | 4 + src/tbutc/NTMakefile | 12 +- src/tviced/Makefile | 5 +- src/ubik/Makefile | 4 +- src/ubik/NTMakefile | 2 + src/ubik/beacon.c | 2 +- src/ubik/udebug.c | 15 +- src/update/Makefile | 2 +- src/update/client.c | 34 +- src/update/server.c | 44 +- src/update/utils.c | 15 + src/usd/Makefile | 2 +- src/usd/NTMakefile | 7 +- src/util/Makefile | 8 +- src/util/NTMakefile | 5 + src/util/afsutil.h | 4 +- src/util/flipbase64.c | 2 +- src/util/hostparse.c | 14 + src/util/serverLog.c | 10 + src/util/snprintf.c | 4 +- src/util/volparse.c | 19 +- src/venus/fs.c | 33 +- src/venus/up.c | 133 +- src/vfsck/main.c | 2 +- src/viced/Makefile | 7 +- src/viced/host.c | 46 +- src/viced/viced.c | 31 +- src/vlserver/Makefile | 6 +- src/vlserver/NTMakefile | 6 +- src/vlserver/vlserver.c | 12 +- src/vol/Makefile | 7 +- src/vol/listinodes.c | 2 +- src/vol/namei_ops.c | 31 +- src/vol/volume.c | 27 +- src/volser/Makefile | 6 +- src/volser/volprocs.c | 10 +- src/volser/vos.c | 2 +- src/volser/vsprocs.c | 2 +- src/volser/vsutils.c | 2 +- 303 files changed, 5451 insertions(+), 1507 deletions(-) diff --git a/src/BUILDNOTES b/src/BUILDNOTES index 52d9beea4..d1e19f21e 100644 --- a/src/BUILDNOTES +++ b/src/BUILDNOTES @@ -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, diff --git a/src/NTMakefile b/src/NTMakefile index 02af8afa7..b6ebfa5e8 100644 --- a/src/NTMakefile +++ b/src/NTMakefile @@ -19,8 +19,10 @@ 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) ..\.. diff --git a/src/README b/src/README index c3a40097f..ca463b17b 100644 --- a/src/README +++ b/src/README @@ -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="" + 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 diff --git a/src/README.OBSOLETE b/src/README.OBSOLETE index 5dc6de188..b7ccaaddb 100644 --- a/src/README.OBSOLETE +++ b/src/README.OBSOLETE @@ -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 diff --git a/src/README.SECURITY b/src/README.SECURITY index d23e76416..e8f2fe2c5 100644 --- a/src/README.SECURITY +++ b/src/README.SECURITY @@ -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. + diff --git a/src/WINNT/afsd/NTMakefile b/src/WINNT/afsd/NTMakefile index 149b67f6e..e8e33daaa 100644 --- a/src/WINNT/afsd/NTMakefile +++ b/src/WINNT/afsd/NTMakefile @@ -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) diff --git a/src/WINNT/afsd/afsd.h b/src/WINNT/afsd/afsd.h index 51b6dc286..0c6f59fde 100644 --- a/src/WINNT/afsd/afsd.h +++ b/src/WINNT/afsd/afsd.h @@ -10,13 +10,25 @@ #ifndef __AFSD_H_ENV__ #define __AFSD_H_ENV__ 1 +#include + +#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 +#else /* DJGPP */ +#include +#include +#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 #include -#include "cm_access.h" +#include +#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 #include @@ -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; diff --git a/src/WINNT/afsd/afsd_init.c b/src/WINNT/afsd/afsd_init.c index f7c7feca5..48cecb4af 100644 --- a/src/WINNT/afsd/afsd_init.c +++ b/src/WINNT/afsd/afsd_init.c @@ -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); diff --git a/src/WINNT/afsd/afsd_init.h b/src/WINNT/afsd/afsd_init.h index 98ed19586..803facc3a 100644 --- a/src/WINNT/afsd/afsd_init.h +++ b/src/WINNT/afsd/afsd_init.h @@ -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); diff --git a/src/WINNT/afsd/afsd_service.c b/src/WINNT/afsd/afsd_service.c index b8f9b5de9..3df9c7f51 100644 --- a/src/WINNT/afsd/afsd_service.c +++ b/src/WINNT/afsd/afsd_service.c @@ -20,6 +20,10 @@ #include #include + +#ifdef DEBUG +//#define NOTSERVICE +#endif extern void afsi_log(char *pattern, ...); @@ -186,6 +190,7 @@ void afsd_Main() WaitToTerminate = CreateEvent(NULL, TRUE, FALSE, NULL); +#ifndef NOTSERVICE 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 diff --git a/src/WINNT/afsd/cm.h b/src/WINNT/afsd/cm.h index 8d2043b70..fbf6af631 100644 --- a/src/WINNT/afsd/cm.h +++ b/src/WINNT/afsd/cm.h @@ -11,6 +11,10 @@ #define __CM_H_ENV__ 1 #include +#ifdef DJGPP /* we need these for vldbentry decl., etc. */ +#include +#include +#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__ */ diff --git a/src/WINNT/afsd/cm_access.c b/src/WINNT/afsd/cm_access.c index 5d69e7092..9b6e1e358 100644 --- a/src/WINNT/afsd/cm_access.c +++ b/src/WINNT/afsd/cm_access.c @@ -10,12 +10,16 @@ #include #include +#ifndef DJGPP #include #include +#endif #include #include #include +#ifndef DJGPP #include +#endif #include #include "afsd.h" diff --git a/src/WINNT/afsd/cm_access.h b/src/WINNT/afsd/cm_access.h index f7d1c7f96..7e5933ec7 100644 --- a/src/WINNT/afsd/cm_access.h +++ b/src/WINNT/afsd/cm_access.h @@ -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); diff --git a/src/WINNT/afsd/cm_aclent.c b/src/WINNT/afsd/cm_aclent.c index 54096b676..c0433753a 100644 --- a/src/WINNT/afsd/cm_aclent.c +++ b/src/WINNT/afsd/cm_aclent.c @@ -10,7 +10,9 @@ #include #include +#ifndef DJGPP #include +#endif #include #include #include diff --git a/src/WINNT/afsd/cm_buf.c b/src/WINNT/afsd/cm_buf.c index 22ad75d1b..b4790d9d1 100644 --- a/src/WINNT/afsd/cm_buf.c +++ b/src/WINNT/afsd/cm_buf.c @@ -12,7 +12,9 @@ #include #include +#ifndef DJGPP #include +#endif #include #include #include @@ -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; ilpSecurityDescriptor); 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 diff --git a/src/WINNT/afsd/cm_buf.h b/src/WINNT/afsd/cm_buf.h index b19950bb5..f37094f6a 100644 --- a/src/WINNT/afsd/cm_buf.h +++ b/src/WINNT/afsd/cm_buf.h @@ -13,6 +13,9 @@ #define _BUF_H__ENV_ 1 #include +#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 *); diff --git a/src/WINNT/afsd/cm_callback.c b/src/WINNT/afsd/cm_callback.c index c1a0a9d1e..2801464e1 100644 --- a/src/WINNT/afsd/cm_callback.c +++ b/src/WINNT/afsd/cm_callback.c @@ -11,8 +11,12 @@ #include #include +#ifndef DJGPP #include #include +#else +#include +#endif /* !DJGPP */ #include #include #include diff --git a/src/WINNT/afsd/cm_callback.h b/src/WINNT/afsd/cm_callback.h index eb88d8a88..d556c9ea8 100644 --- a/src/WINNT/afsd/cm_callback.h +++ b/src/WINNT/afsd/cm_callback.h @@ -11,7 +11,6 @@ #define _CM_CALLBACK_H_ENV__ 1 #include -#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 */ diff --git a/src/WINNT/afsd/cm_cell.c b/src/WINNT/afsd/cm_cell.c index fc2f6632c..b8317ebed 100644 --- a/src/WINNT/afsd/cm_cell.c +++ b/src/WINNT/afsd/cm_cell.c @@ -10,9 +10,11 @@ #include #include +#ifndef DJGPP #include #include #include +#endif /* !DJGPP */ #include #include #include diff --git a/src/WINNT/afsd/cm_config.c b/src/WINNT/afsd/cm_config.c index 4d0274dba..2e1261b20 100644 --- a/src/WINNT/afsd/cm_config.c +++ b/src/WINNT/afsd/cm_config.c @@ -10,8 +10,13 @@ #include #include +#ifndef DJGPP #include #include +#else +#include +#include +#endif /* !DJGPP */ #include #include #include @@ -21,6 +26,21 @@ 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 */ diff --git a/src/WINNT/afsd/cm_config.h b/src/WINNT/afsd/cm_config.h index 2963ff227..19ab23660 100644 --- a/src/WINNT/afsd/cm_config.h +++ b/src/WINNT/afsd/cm_config.h @@ -21,6 +21,9 @@ #ifndef __CM_CONFIG_INTERFACES_ONLY__ #include +#ifdef DJGPP +#include +#endif /* DJGPP */ extern char AFSConfigKeyName[]; diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index c78bc66d0..0f7406032 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -10,12 +10,18 @@ #include #include +#ifndef DJGPP #include +#endif /* !DJGPP */ #include #include #include #include +#ifndef DJGPP #include +#else +#include +#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; diff --git a/src/WINNT/afsd/cm_conn.h b/src/WINNT/afsd/cm_conn.h index e03bfe601..4c9a42fe1 100644 --- a/src/WINNT/afsd/cm_conn.h +++ b/src/WINNT/afsd/cm_conn.h @@ -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); diff --git a/src/WINNT/afsd/cm_daemon.c b/src/WINNT/afsd/cm_daemon.c index 45177d796..33b3dc5e1 100644 --- a/src/WINNT/afsd/cm_daemon.c +++ b/src/WINNT/afsd/cm_daemon.c @@ -10,8 +10,12 @@ #include #include +#ifndef DJGPP #include #include +#else +#include +#endif /* !DJGPP */ #include #include #include @@ -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); } } } diff --git a/src/WINNT/afsd/cm_dcache.c b/src/WINNT/afsd/cm_dcache.c index f5a649689..69a08cdf7 100644 --- a/src/WINNT/afsd/cm_dcache.c +++ b/src/WINNT/afsd/cm_dcache.c @@ -10,12 +10,14 @@ #include #include +#ifndef DJGPP #include #include +#include +#endif /* !DJGPP */ #include #include #include -#include #include #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 */ } } diff --git a/src/WINNT/afsd/cm_dir.c b/src/WINNT/afsd/cm_dir.c index 01d71e59b..c32de292e 100644 --- a/src/WINNT/afsd/cm_dir.c +++ b/src/WINNT/afsd/cm_dir.c @@ -10,7 +10,9 @@ #include #include +#ifndef DJGPP #include +#endif /* !DJGPP */ #include #include #include diff --git a/src/WINNT/afsd/cm_dnlc.c b/src/WINNT/afsd/cm_dnlc.c index 76052d615..ec53fbb5d 100644 --- a/src/WINNT/afsd/cm_dnlc.c +++ b/src/WINNT/afsd/cm_dnlc.c @@ -18,8 +18,10 @@ #include #include +#ifndef DJGPP #include #include +#endif /* !DJGPP */ #include #include #include @@ -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 * diff --git a/src/WINNT/afsd/cm_ioctl.c b/src/WINNT/afsd/cm_ioctl.c index db9346df5..58d8873b7 100644 --- a/src/WINNT/afsd/cm_ioctl.c +++ b/src/WINNT/afsd/cm_ioctl.c @@ -10,7 +10,11 @@ #include #include +#ifndef DJGPP #include +#else +#include +#endif /* !DJGPP */ #include #include #include @@ -25,13 +29,19 @@ #include "smb.h" +#ifndef DJGPP #include - #include "afsrpc.h" +#else +#include +#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 */ diff --git a/src/WINNT/afsd/cm_ioctl.h b/src/WINNT/afsd/cm_ioctl.h index 0346d29c7..ee5b338ac 100644 --- a/src/WINNT/afsd/cm_ioctl.h +++ b/src/WINNT/afsd/cm_ioctl.h @@ -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__ */ diff --git a/src/WINNT/afsd/cm_rpc.c b/src/WINNT/afsd/cm_rpc.c index ca297f61a..33f4c8ee4 100644 --- a/src/WINNT/afsd/cm_rpc.c +++ b/src/WINNT/afsd/cm_rpc.c @@ -15,7 +15,11 @@ #include #include +#ifndef DJGPP #include "afsrpc.h" +#else +#include "afsrpc95.h" +#endif #include "afsd.h" #include "afsd_init.h" diff --git a/src/WINNT/afsd/cm_rpc.h b/src/WINNT/afsd/cm_rpc.h index 3245cc68a..beba2e3d7 100644 --- a/src/WINNT/afsd/cm_rpc.h +++ b/src/WINNT/afsd/cm_rpc.h @@ -10,7 +10,11 @@ #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]); diff --git a/src/WINNT/afsd/cm_scache.c b/src/WINNT/afsd/cm_scache.c index 16bd46c73..759a31f34 100644 --- a/src/WINNT/afsd/cm_scache.c +++ b/src/WINNT/afsd/cm_scache.c @@ -10,12 +10,14 @@ #include #include +#ifndef DJGPP #include #include +#include +#endif /* !DJGPP */ #include #include #include -#include #include #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; +} diff --git a/src/WINNT/afsd/cm_scache.h b/src/WINNT/afsd/cm_scache.h index 4d74dbdfd..aec2f970e 100644 --- a/src/WINNT/afsd/cm_scache.h +++ b/src/WINNT/afsd/cm_scache.h @@ -10,6 +10,10 @@ #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); diff --git a/src/WINNT/afsd/cm_server.c b/src/WINNT/afsd/cm_server.c index ffb2b7a94..16672eb8b 100644 --- a/src/WINNT/afsd/cm_server.c +++ b/src/WINNT/afsd/cm_server.c @@ -10,15 +10,19 @@ #include #include +#ifndef DJGPP #include #include +#include +#else +#include +#endif /* !DJGPP */ #include #include #include #include #include -#include #include "afsd.h" osi_rwlock_t cm_serverLock; diff --git a/src/WINNT/afsd/cm_server.h b/src/WINNT/afsd/cm_server.h index 7fce862fa..c0b357fb6 100644 --- a/src/WINNT/afsd/cm_server.h +++ b/src/WINNT/afsd/cm_server.h @@ -10,7 +10,11 @@ #ifndef __CM_SERVER_H_ENV__ #define __CM_SERVER_H_ENV__ 1 +#ifndef DJGPP #include +#else /* DJGPP */ +#include +#endif /* !DJGPP */ #include /* pointed to by volumes and cells without holds; cm_serverLock is obtained diff --git a/src/WINNT/afsd/cm_user.c b/src/WINNT/afsd/cm_user.c index 9a20e1804..471f47c67 100644 --- a/src/WINNT/afsd/cm_user.c +++ b/src/WINNT/afsd/cm_user.c @@ -10,7 +10,9 @@ #include #include +#ifndef DJGPP #include +#endif /* !DJGPP */ #include #include @@ -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) { + if (usersp->unp) { + if ((userp=usersp->unp->userp)==0) + continue; + } else + continue; lock_ObtainMutex(&userp->mx); for(ucellp=userp->cellInfop; ucellp; ucellp=ucellp->nextp) { if(ucellp->flags & CM_UCELLFLAG_RXKAD) { diff --git a/src/WINNT/afsd/cm_utils.c b/src/WINNT/afsd/cm_utils.c index 2fd367f87..e18654adf 100644 --- a/src/WINNT/afsd/cm_utils.c +++ b/src/WINNT/afsd/cm_utils.c @@ -10,10 +10,12 @@ #include #include +#ifndef DJGPP #include +#include +#endif /* !DJGPP */ #include #include -#include #include #include diff --git a/src/WINNT/afsd/cm_vnodeops.c b/src/WINNT/afsd/cm_vnodeops.c index 269a560b9..b3149484c 100644 --- a/src/WINNT/afsd/cm_vnodeops.c +++ b/src/WINNT/afsd/cm_vnodeops.c @@ -10,9 +10,11 @@ #include #include +#ifndef DJGPP #include -#include #include +#endif /* !DJGPP */ +#include #include #include #include @@ -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); diff --git a/src/WINNT/afsd/cm_vnodeops.h b/src/WINNT/afsd/cm_vnodeops.h index f71b30b02..d4667b192 100644 --- a/src/WINNT/afsd/cm_vnodeops.h +++ b/src/WINNT/afsd/cm_vnodeops.h @@ -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); diff --git a/src/WINNT/afsd/cm_volume.c b/src/WINNT/afsd/cm_volume.c index 948746684..994e526c5 100644 --- a/src/WINNT/afsd/cm_volume.c +++ b/src/WINNT/afsd/cm_volume.c @@ -10,11 +10,15 @@ #include #include +#ifndef DJGPP #include -#include -#include #include #include +#else +#include +#endif /* !DJGPP */ +#include +#include #include #include diff --git a/src/WINNT/afsd/fs_utils.h b/src/WINNT/afsd/fs_utils.h index 2bdcabcfc..6e09e1d63 100644 --- a/src/WINNT/afsd/fs_utils.h +++ b/src/WINNT/afsd/fs_utils.h @@ -18,7 +18,9 @@ #include #include +#ifndef _MFC_VER #include +#endif /* Fake error code since NT errno.h doesn't define it */ #include diff --git a/src/WINNT/afsd/smb.c b/src/WINNT/afsd/smb.c index 62495352d..5a03d90e2 100644 --- a/src/WINNT/afsd/smb.c +++ b/src/WINNT/afsd/smb.c @@ -7,10 +7,17 @@ * directory or online at http://www.openafs.org/dl/license10.html */ +//#define NOSERVICE 1 + #include #include +#ifndef DJGPP #include +#else +#include +#include +#endif /* !DJGPP */ #include #include #include @@ -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(<); _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; idos_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; incb_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; incb_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> 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; incb_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; idos_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 */ diff --git a/src/WINNT/afsd/smb.h b/src/WINNT/afsd/smb.h index 201bafdd9..e3a9c2076 100644 --- a/src/WINNT/afsd/smb.h +++ b/src/WINNT/afsd/smb.h @@ -10,6 +10,10 @@ #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); 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" + +cm_user_t *smb_FindOrCreateUser(smb_vc_t *vcp, char *usern); #endif /* whole file */ diff --git a/src/WINNT/afsd/smb3.c b/src/WINNT/afsd/smb3.c index 8f3c5cb5c..207f9f8fb 100644 --- a/src/WINNT/afsd/smb3.c +++ b/src/WINNT/afsd/smb3.c @@ -7,10 +7,14 @@ * directory or online at http://www.openafs.org/dl/license10.html */ +//#define NOSERVICE 1 + #include #include +#ifndef DJGPP #include +#endif /* !DJGPP */ #include #include #include @@ -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; +} + diff --git a/src/WINNT/afsd/smb3.h b/src/WINNT/afsd/smb3.h index 0bb445f27..937ed42ba 100644 --- a/src/WINNT/afsd/smb3.h +++ b/src/WINNT/afsd/smb3.h @@ -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__ */ diff --git a/src/WINNT/afsd/smb_iocons.h b/src/WINNT/afsd/smb_iocons.h index 4986e1f59..a122e04c2 100644 --- a/src/WINNT/afsd/smb_iocons.h +++ b/src/WINNT/afsd/smb_iocons.h @@ -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 diff --git a/src/WINNT/afsd/smb_ioctl.c b/src/WINNT/afsd/smb_ioctl.c index 0e0f742f3..9e06d8822 100644 --- a/src/WINNT/afsd/smb_ioctl.c +++ b/src/WINNT/afsd/smb_ioctl.c @@ -10,7 +10,9 @@ #include #include +#ifndef DJGPP #include +#endif /* !DJGPP */ #include #include #include @@ -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); diff --git a/src/WINNT/afsd/smb_ioctl.h b/src/WINNT/afsd/smb_ioctl.h index 9e997972f..db157b95b 100644 --- a/src/WINNT/afsd/smb_ioctl.h +++ b/src/WINNT/afsd/smb_ioctl.h @@ -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__ */ diff --git a/src/WINNT/afsreg/NTMakefile b/src/WINNT/afsreg/NTMakefile index c6998a814..d02d02b62 100644 --- a/src/WINNT/afsreg/NTMakefile +++ b/src/WINNT/afsreg/NTMakefile @@ -28,4 +28,7 @@ install_headers: $(INCFILES) install: install_headers $(LIBFILE) +install9x: install + clean:: + $(DEL) $(LIBFILE) \ No newline at end of file diff --git a/src/WINNT/client_config/NTMakefile b/src/WINNT/client_config/NTMakefile index 3604afd15..fc20442dd 100644 --- a/src/WINNT/client_config/NTMakefile +++ b/src/WINNT/client_config/NTMakefile @@ -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) .. diff --git a/src/WINNT/client_config/lang/NTMakefile b/src/WINNT/client_config/lang/NTMakefile index c1d8ee767..8e2909336 100644 --- a/src/WINNT/client_config/lang/NTMakefile +++ b/src/WINNT/client_config/lang/NTMakefile @@ -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) ############################################################################ # diff --git a/src/WINNT/client_cpa/NTMakefile b/src/WINNT/client_cpa/NTMakefile index 8f1667830..e71501c6f 100644 --- a/src/WINNT/client_cpa/NTMakefile +++ b/src/WINNT/client_cpa/NTMakefile @@ -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) .. + diff --git a/src/WINNT/client_cpa/lang/NTMakefile b/src/WINNT/client_cpa/lang/NTMakefile index 351bdbcf5..5dd165dbc 100644 --- a/src/WINNT/client_cpa/lang/NTMakefile +++ b/src/WINNT/client_cpa/lang/NTMakefile @@ -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) ############################################################################ # diff --git a/src/WINNT/client_creds/lang/NTMakefile b/src/WINNT/client_creds/lang/NTMakefile index 0d62da0b2..3ca6cbe18 100644 --- a/src/WINNT/client_creds/lang/NTMakefile +++ b/src/WINNT/client_creds/lang/NTMakefile @@ -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) ############################################################################ # diff --git a/src/WINNT/client_exp/NTMakefile b/src/WINNT/client_exp/NTMakefile index 2f13fe975..31bf42b00 100644 --- a/src/WINNT/client_exp/NTMakefile +++ b/src/WINNT/client_exp/NTMakefile @@ -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) .. diff --git a/src/WINNT/client_exp/lang/NTMakefile b/src/WINNT/client_exp/lang/NTMakefile index 258f21e85..132df5ed1 100644 --- a/src/WINNT/client_exp/lang/NTMakefile +++ b/src/WINNT/client_exp/lang/NTMakefile @@ -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) ############################################################################ # diff --git a/src/WINNT/client_osi/NTMakefile b/src/WINNT/client_osi/NTMakefile index 0874cb3b6..6e503ff9b 100644 --- a/src/WINNT/client_osi/NTMakefile +++ b/src/WINNT/client_osi/NTMakefile @@ -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) diff --git a/src/WINNT/client_osi/osi.h b/src/WINNT/client_osi/osi.h index 35561cde3..43b9aca34 100644 --- a/src/WINNT/client_osi/osi.h +++ b/src/WINNT/client_osi/osi.h @@ -11,11 +11,29 @@ #ifndef _OSI_H_ENV_ #define _OSI_H_ENV_ 1 -#include +#include + /* misc definitions */ + +/* large int */ +#ifndef DJGPP +#include +#include +#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 - #endif /*_OSI_H_ENV_ */ diff --git a/src/WINNT/client_osi/osifd.c b/src/WINNT/client_osi/osifd.c index 3a9ad8bed..6f6e37c54 100644 --- a/src/WINNT/client_osi/osifd.c +++ b/src/WINNT/client_osi/osifd.c @@ -12,21 +12,25 @@ #include #include +#ifndef DJGPP #include #include +#include "dbrpc.h" +#endif /* !DJGPP */ #include #include "osi.h" -#include "dbrpc.h" #include -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) { diff --git a/src/WINNT/client_osi/osifd.h b/src/WINNT/client_osi/osifd.h index cdac59f26..12d50c907 100644 --- a/src/WINNT/client_osi/osifd.h +++ b/src/WINNT/client_osi/osifd.h @@ -11,9 +11,14 @@ #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 *); diff --git a/src/WINNT/client_osi/osilog.c b/src/WINNT/client_osi/osilog.c index 531f88b18..5f44377b8 100644 --- a/src/WINNT/client_osi/osilog.c +++ b/src/WINNT/client_osi/osilog.c @@ -11,11 +11,15 @@ #include #include +#ifndef DJGPP #include #include +#endif /* !DJGPP */ #include #include "osi.h" +#ifndef DJGPP #include "dbrpc.h" +#endif /* !DJGPP */ #include #include @@ -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) { diff --git a/src/WINNT/client_osi/osilog.h b/src/WINNT/client_osi/osilog.h index 729661dc1..569f429d4 100644 --- a/src/WINNT/client_osi/osilog.h +++ b/src/WINNT/client_osi/osilog.h @@ -11,9 +11,12 @@ #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); diff --git a/src/WINNT/client_osi/osiqueue.c b/src/WINNT/client_osi/osiqueue.c index a0ea8d58f..4e840d84a 100644 --- a/src/WINNT/client_osi/osiqueue.c +++ b/src/WINNT/client_osi/osiqueue.c @@ -11,12 +11,14 @@ #include #include +#ifndef DJGPP #include +#endif /* !DJGPP */ #include "osi.h" #include /* 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); } diff --git a/src/WINNT/client_osi/osisleep.h b/src/WINNT/client_osi/osisleep.h index 308fcf33c..aaf0c8f96 100644 --- a/src/WINNT/client_osi/osisleep.h +++ b/src/WINNT/client_osi/osisleep.h @@ -11,8 +11,12 @@ #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) diff --git a/src/WINNT/eventlog/NTMakefile b/src/WINNT/eventlog/NTMakefile index d713b9ed3..2d2b450a4 100644 --- a/src/WINNT/eventlog/NTMakefile +++ b/src/WINNT/eventlog/NTMakefile @@ -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) .. + diff --git a/src/WINNT/eventlog/lang/NTMakefile b/src/WINNT/eventlog/lang/NTMakefile index d03e9a4b1..7c8894c3f 100644 --- a/src/WINNT/eventlog/lang/NTMakefile +++ b/src/WINNT/eventlog/lang/NTMakefile @@ -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 diff --git a/src/WINNT/install/InstallShield5/CreateISDirTree.bat b/src/WINNT/install/InstallShield5/CreateISDirTree.bat index ed046ae4c..b7f8138e7 100644 --- a/src/WINNT/install/InstallShield5/CreateISDirTree.bat +++ b/src/WINNT/install/InstallShield5/CreateISDirTree.bat @@ -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" - + +set sub1=Uncompressed Files +call :gencomp +set sub1=Compressed Files +call :gencomp +goto shell + +:gencomp +if not exist "Setup Files\%sub1%" mkdir "Setup Files\%sub1%" +set sub2=Language Independent +call :gencomp2 +set sub2=0009-English +call :gencomp2 +set sub2=0007-German +call :gencomp2 +set sub2=0011-Japanese +call :gencomp2 +set sub2=0012-Korean +call :gencomp2 +set sub2=0416-Portuguese (Brazilian) +call :gencomp2 +set sub2=0404-Chinese (Taiwan) +call :gencomp2 +set sub2=000a-Spanish +call :gencomp2 +set sub2=0804-Chinese (PRC) +call :gencomp2 +goto :eof + +:gencomp2 +rem echo ]%sub1%] ]%sub2%] +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 + +:shell 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 diff --git a/src/WINNT/install/InstallShield5/Default.rge b/src/WINNT/install/InstallShield5/Default.rge index 8b31e9c9d..79495238d 100644 --- a/src/WINNT/install/InstallShield5/Default.rge +++ b/src/WINNT/install/InstallShield5/Default.rge @@ -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 [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,\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, InstallDateString=S, PathName=S,\Client Software Type=S,File System -MinorVersion=N,6 +MinorVersion=N,0 ReleaseType=S, -VersionString=S,3.6 +VersionString=S,1.0 4.01 Description=S, [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, PathName=S,\Control Center Software Type=S,File System -MinorVersion=N,6 +MinorVersion=N,0 ReleaseType=S, -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, PathName=S,\Control Center Software Type=S,File System -MinorVersion=N,6 +MinorVersion=N,0 ReleaseType=S, -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, InstallDateString=S, PathName=S,\Client Software Type=S,File System -MinorVersion=N,6 +MinorVersion=N,0 ReleaseType=S, -VersionString=S,3.6 +VersionString=S,1.0 4.01 Description=S, [Full_Client] @@ -177,33 +178,33 @@ Description=S, 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, PathName=S,\Documentation Software Type=S,File System -MinorVersion=N,6 +MinorVersion=N,0 ReleaseType=S, -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, PathName=S,\Server Software Type=S,File System -MinorVersion=N,6 +MinorVersion=N,0 ReleaseType=S, -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,\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, PathName=S,\Documentation Software Type=S,File System -MinorVersion=N,6 +MinorVersion=N,0 ReleaseType=S, -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, PathName=S,\Server Software Type=S,File System -MinorVersion=N,6 +MinorVersion=N,0 ReleaseType=S, -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}] diff --git a/src/WINNT/install/InstallShield5/GenFileGroups.bat b/src/WINNT/install/InstallShield5/GenFileGroups.bat index ab12b9e4c..06b4fe2b1 100644 --- a/src/WINNT/install/InstallShield5/GenFileGroups.bat +++ b/src/WINNT/install/InstallShield5/GenFileGroups.bat @@ -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 + +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 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 +call :Generate_Install_Guide_File_Group 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 call :Generate_Install_Guide_File_Group - + 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 - + goto Sys_Admin_Guide_Files -:Generate_Install_Guide_File_Group +:Generate_Install_Guide_File_Group 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 - + 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 + 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 - + 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 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 diff --git a/src/WINNT/install/InstallShield5/NTMakefile b/src/WINNT/install/InstallShield5/NTMakefile index db7f8f3ab..c679e5ad7 100644 --- a/src/WINNT/install/InstallShield5/NTMakefile +++ b/src/WINNT/install/InstallShield5/NTMakefile @@ -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 + xcopy/s/e/y "Media\Transarc AFS\Disk Images\disk1\*.*" $(DESTDIR)\WinInstall + copy AFS_component_version_number.txt $(DESTDIR)\WinInstall\Version.txt + $(DEL) /q "Media\Transarc AFS\Disk Images\disk1\*.*" +!IF ((EXIST("$(ISWEB)")) &&("$(ISWEB)"!="")) +! IF (!EXIST($(DESTDIR)\Wininstall\PackageWeb)) + $(MKDIR) $(DESTDIR)\Wininstall\PackageWeb +! ENDIF + $(DEL) /q $(DESTDIR)\Wininstall\PackageWeb\*.* + $(ISWEB)\Pftwwiz.exe $(AFSROOT)\src\winnt\install\InstallShield5\PackageWeb.pfw -s -a +!ENDIF install: prep build diff --git a/src/WINNT/install/InstallShield5/afsdcell.ini b/src/WINNT/install/InstallShield5/afsdcell.ini index a088d556c..65364751d 100644 --- a/src/WINNT/install/InstallShield5/afsdcell.ini +++ b/src/WINNT/install/InstallShield5/afsdcell.ini @@ -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 diff --git a/src/WINNT/install/InstallShield5/lang/en_US/value.shl b/src/WINNT/install/InstallShield5/lang/en_US/value.shl index 1fbc3fd40..aab0f0f60 100644 --- a/src/WINNT/install/InstallShield5/lang/en_US/value.shl +++ b/src/WINNT/install/InstallShield5/lang/en_US/value.shl @@ -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. diff --git a/src/WINNT/install/InstallShield5/setup.bmp b/src/WINNT/install/InstallShield5/setup.bmp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NBd#S;X$scPg{R-AM`-6kL_O;p{b$>(kYxCb`2nFOu60jeX zYzim@gA_bT(wi~cuP}N%xm#YQ7ko3lPx_@3K289Q&;R>4{?~^LepoE=C3TNQe_-b` YUtoIHK1cy7d%_z32P*9U-}jRJ-ykFo2LJ#7 diff --git a/src/WINNT/install/InstallShield5/setup.rul b/src/WINNT/install/InstallShield5/setup.rul index a9a6b45af..6c4472191 100644 --- a/src/WINNT/install/InstallShield5/setup.rul +++ b/src/WINNT/install/InstallShield5/setup.rul @@ -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; + + diff --git a/src/WINNT/license/lang/en_US.ide b/src/WINNT/license/lang/en_US.ide index 6473cae0e7eab2d850d354319689591a8de25342..2efcf2de2968ece50837c37aca19b59b24e9667c 100644 GIT binary patch literal 604 zcmYL`-Acny5QOJi@Es1lmedxnq*hcA3RVkxFNvlZsI8@9GmJRmyqIwB??G9Py5ZdQh#ke$>F6X|4_ReO<=6ARfWoz-hR1 zq6PJiDzJMLTQV!~mXkCF`9S5EOQGM;p+@1vPsFR3w?=aw`mHjZ>r4Zxhk6SYYqoHw zRPEq2R3?x-x)r>CnNq-^<`y^Ms7pWz2iRMg_Yq*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D(^_1x=#sSQe{3D zN|e+faS}aO;`OS)+*yf=J`)<&h$^j%1@(Y~cS~;h^w?BK_f-XI!5N5OQA1`XztJD+ zW1e${=VUGFqnxsI9CQdo=G;2ZJfW|}I=y1_`0VPKhkD9c7+s{#PVecHb|DUN-kX>1 z3u~>W7O~UTx>BKFy`4Sx=^Q6^%xGr^zc|GsF6I!s*@|v2G)6VI)!NU9i)?~#SyRU7 zyx=yS2U>z3tf9*>3;Hqi^%`}#)Jn%W(n>TLm3`Fkq>{~d@)s4O%fTW%Bx|m8KO;lu zTHAgWQQF7Ja*Qs?ib^H}nRXWv{noMeDesWsCw!kbnZrBIG4|rkHFyOEp#+=qVV*^& z)K`P@`~F_Rox+Lm>8s6;`I-F)ZakNt=pAugE!kVt;y!Kd+K1V}cb|#oQ+JlL{ctaQ zGOxbd_xlWHL_caiqgCsxG4kPakSvw6&YHA(j?|fl<~-3Am4B)AaNWEu7;HE1l2iio zdAo6ca$jbxLtMKjM*Wq3U5J-dQ_1ds zYqwJUhcDD6^-GoFN5O^>zqjyiT5F8|x_~hn7;iCs|4*|nMuuJpjU&xH(!27pzE5NY kU1!JghK}~Yc2MZoH9JLBKg<5i^0oN6nyCY+Z1n1X0^0^MLI3~& diff --git a/src/WINNT/pthread/NTMakefile b/src/WINNT/pthread/NTMakefile index 6ae0b8ea0..fc2aa88f0 100644 --- a/src/WINNT/pthread/NTMakefile +++ b/src/WINNT/pthread/NTMakefile @@ -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) + +install9x: install 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\*.* diff --git a/src/WINNT/talocale/NTMakefile b/src/WINNT/talocale/NTMakefile index f0e178b00..155629d6d 100644 --- a/src/WINNT/talocale/NTMakefile +++ b/src/WINNT/talocale/NTMakefile @@ -35,6 +35,11 @@ LIBFILE = $(DESTDIR)\lib\afs\talocale.lib install: $(LIBINCLUDES) $(LIBFILE) +install9x: install + $(LIBFILE): $(LIBOBJS) $(LIBARCH) + +clean:: + $(DEL) $(LIBINCLUDES) diff --git a/src/afs/IRIX/osi_vnodeops.c b/src/afs/IRIX/osi_vnodeops.c index 18e0a5aa7..73d20fc57 100644 --- a/src/afs/IRIX/osi_vnodeops.c +++ b/src/afs/IRIX/osi_vnodeops.c @@ -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 diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index 760e8a533..3cc273af9 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -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) diff --git a/src/afs/Makefile b/src/afs/Makefile index efc6126af..063159a0f 100644 --- a/src/afs/Makefile +++ b/src/afs/Makefile @@ -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 diff --git a/src/afs/SOLARIS/osi_vfsops.c b/src/afs/SOLARIS/osi_vfsops.c index a16dea180..032d50ecb 100644 --- a/src/afs/SOLARIS/osi_vfsops.c +++ b/src/afs/SOLARIS/osi_vfsops.c @@ -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; diff --git a/src/afs/UKERNEL/afs_usrops.c b/src/afs/UKERNEL/afs_usrops.c index 2d93e7c88..cea99e629 100644 --- a/src/afs/UKERNEL/afs_usrops.c +++ b/src/afs/UKERNEL/afs_usrops.c @@ -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 */ diff --git a/src/afs/UKERNEL/afs_usrops.h b/src/afs/UKERNEL/afs_usrops.h index 97923964c..0ef5fe6e4 100644 --- a/src/afs/UKERNEL/afs_usrops.h +++ b/src/afs/UKERNEL/afs_usrops.h @@ -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); diff --git a/src/afs/VNOPS/afs_vnop_access.c b/src/afs/VNOPS/afs_vnop_access.c index 2b4de1a27..2c3f6af9c 100644 --- a/src/afs/VNOPS/afs_vnop_access.c +++ b/src/afs/VNOPS/afs_vnop_access.c @@ -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) */ diff --git a/src/afs/VNOPS/afs_vnop_attrs.c b/src/afs/VNOPS/afs_vnop_attrs.c index 311f2161f..eb9c218fb 100644 --- a/src/afs/VNOPS/afs_vnop_attrs.c +++ b/src/afs/VNOPS/afs_vnop_attrs.c @@ -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) diff --git a/src/afs/VNOPS/afs_vnop_create.c b/src/afs/VNOPS/afs_vnop_create.c index b8deaf201..0d42f5779 100644 --- a/src/afs/VNOPS/afs_vnop_create.c +++ b/src/afs/VNOPS/afs_vnop_create.c @@ -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); diff --git a/src/afs/VNOPS/afs_vnop_flock.c b/src/afs/VNOPS/afs_vnop_flock.c index 35375b511..43869f77d 100644 --- a/src/afs/VNOPS/afs_vnop_flock.c +++ b/src/afs/VNOPS/afs_vnop_flock.c @@ -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 */ diff --git a/src/afs/afs_cell.c b/src/afs/afs_cell.c index 2b271e1b5..f1a0f0cf8 100644 --- a/src/afs/afs_cell.c +++ b/src/afs/afs_cell.c @@ -42,14 +42,177 @@ 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= 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; ip_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; diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c index e8dfc7fa8..561e4c9d3 100644 --- a/src/afs/afs_server.c +++ b/src/afs/afs_server.c @@ -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 */ diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index bf4b9aa15..6962f3397 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -54,6 +54,7 @@ #define VFS 1 #include +#include "afsconfig.h" #include #include @@ -72,30 +73,41 @@ #include #include #include -#ifdef AFS_DEC_ENV +#include + +#ifdef HAVE_SYS_PARAM_H #include -#include #endif -#if defined(AFS_SUN_ENV) -#include + +#ifdef HAVE_SYS_FS_TYPES_H +#include #endif -#ifndef AFS_AIX41_ENV + +#ifdef HAVE_SYS_MOUNT_H #include #endif -#include -#ifdef AFS_SUN5_ENV + +#ifdef HAVE_SYS_FCNTL_H #include +#endif + +#ifdef HAVE_SYS_MNTTAB_H #include +#endif + +#ifdef HAVE_SYS_MNTENT_H #include -#else -#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) -#include #endif + +#ifdef HAVE_MNTENT_H +#include #endif -#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#ifdef HAVE_SYS_MOUNT_H #include -#else +#endif + +#ifdef HAVE_SYS_VFS_H #include #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 #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)); } diff --git a/src/afsmonitor/Makefile b/src/afsmonitor/Makefile index c535dc120..a02e155bd 100644 --- a/src/afsmonitor/Makefile +++ b/src/afsmonitor/Makefile @@ -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} diff --git a/src/afsmonitor/afsmon-output.c b/src/afsmonitor/afsmon-output.c index 7f244106a..535c0a4df 100644 --- a/src/afsmonitor/afsmon-output.c +++ b/src/afsmonitor/afsmon-output.c @@ -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*/ diff --git a/src/afsmonitor/afsmon-win.c b/src/afsmonitor/afsmon-win.c index 5f592e755..87c989c71 100644 --- a/src/afsmonitor/afsmon-win.c +++ b/src/afsmonitor/afsmon-win.c @@ -17,6 +17,10 @@ #include #include #include +#include +#ifdef HAVE_STRING_H +#include +#endif #undef IN #include @@ -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); } diff --git a/src/afsmonitor/afsmonitor.c b/src/afsmonitor/afsmonitor.c index 89d9c2cc0..4d4cf4435 100644 --- a/src/afsmonitor/afsmonitor.c +++ b/src/afsmonitor/afsmonitor.c @@ -20,6 +20,7 @@ #include #include #include +#include #undef IN @@ -29,6 +30,7 @@ #include #include #endif +#include #include /*Generic window package*/ #include /*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*/ diff --git a/src/afsmonitor/afsmonitor.h b/src/afsmonitor/afsmonitor.h index dfb1354f0..2a78c68e5 100644 --- a/src/afsmonitor/afsmonitor.h +++ b/src/afsmonitor/afsmonitor.h @@ -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 */ diff --git a/src/audit/Makefile b/src/audit/Makefile index 618af14cf..10843bb58 100644 --- a/src/audit/Makefile +++ b/src/audit/Makefile @@ -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 diff --git a/src/audit/NTMakefile b/src/audit/NTMakefile index 9b31b231d..b6502e623 100644 --- a/src/audit/NTMakefile +++ b/src/audit/NTMakefile @@ -26,4 +26,7 @@ $(LIBFILE): $(LIBOBJS) install: $(INCFILES) $(LIBFILE) +install9x: install + clean:: + $(DEL) $(INCFILES) \ No newline at end of file diff --git a/src/audit/audit.c b/src/audit/audit.c index 973781121..028ab9e05 100644 --- a/src/audit/audit.c +++ b/src/audit/audit.c @@ -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 diff --git a/src/auth/Makefile b/src/auth/Makefile index 17ef83774..7621e8c74 100644 --- a/src/auth/Makefile +++ b/src/auth/Makefile @@ -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 diff --git a/src/auth/NTMakefile b/src/auth/NTMakefile index dced27eed..c9aa3af70 100644 --- a/src/auth/NTMakefile +++ b/src/auth/NTMakefile @@ -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 diff --git a/src/auth/cellconfig.c b/src/auth/cellconfig.c index 81f78dd8f..87a4820ac 100644 --- a/src/auth/cellconfig.c +++ b/src/auth/cellconfig.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #ifdef UKERNEL @@ -26,7 +27,11 @@ #include #include #include -#endif +#ifdef AFS_AFSDB_ENV +#include +#include +#endif /* AFS_AFSDB_ENV */ +#endif /* AFS_NT40_ENV */ #include #include #include @@ -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; inumServers; 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;isessionKey, 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); diff --git a/src/auth/userok.c b/src/auth/userok.c index 33a5a8a1a..86ba5049c 100644 --- a/src/auth/userok.c +++ b/src/auth/userok.c @@ -35,6 +35,8 @@ #include #include /* for realpath() */ #include +#include +#include #include #include @@ -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, ""); + if (namep) strcpy(namep, ""); 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, ""); + 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 */ } diff --git a/src/bozo/Makefile b/src/bozo/Makefile index adc108054..d9fea507f 100644 --- a/src/bozo/Makefile +++ b/src/bozo/Makefile @@ -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: diff --git a/src/bozo/bosserver.c b/src/bozo/bosserver.c index 347a93090..3fdf45fab 100644 --- a/src/bozo/bosserver.c +++ b/src/bozo/bosserver.c @@ -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); diff --git a/src/bucoord/Makefile b/src/bucoord/Makefile index 517708a9f..b9d16c272 100644 --- a/src/bucoord/Makefile +++ b/src/bucoord/Makefile @@ -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 diff --git a/src/bucoord/commands.c b/src/bucoord/commands.c index d8598bcb5..6757a4a9e 100644 --- a/src/bucoord/commands.c +++ b/src/bucoord/commands.c @@ -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, diff --git a/src/cmd/Makefile b/src/cmd/Makefile index 61dcd3458..2402dab35 100644 --- a/src/cmd/Makefile +++ b/src/cmd/Makefile @@ -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: diff --git a/src/cmd/NTMakefile b/src/cmd/NTMakefile index b167b1751..2661949cc 100644 --- a/src/cmd/NTMakefile +++ b/src/cmd/NTMakefile @@ -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: diff --git a/src/comerr/NTMakefile b/src/comerr/NTMakefile index a56b16483..4a495e4e5 100644 --- a/src/comerr/NTMakefile +++ b/src/comerr/NTMakefile @@ -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 diff --git a/src/comerr/compile_et.c b/src/comerr/compile_et.c index ad8aa8332..8f7ae1263 100644 --- a/src/comerr/compile_et.c +++ b/src/comerr/compile_et.c @@ -7,8 +7,10 @@ * */ +#undef MEMORYLEAK #include #include +#include #ifndef AFS_NT40_ENV #include @@ -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", diff --git a/src/comerr/error_table.y b/src/comerr/error_table.y index 77d1aa006..7ade42859 100644 --- a/src/comerr/error_table.y +++ b/src/comerr/error_table.y @@ -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); } } diff --git a/src/comerr/et_lex.lex.l b/src/comerr/et_lex.lex.l index 7671731a8..7db068b20 100644 --- a/src/comerr/et_lex.lex.l +++ b/src/comerr/et_lex.lex.l @@ -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; } diff --git a/src/comerr/et_lex.lex_nt.c b/src/comerr/et_lex.lex_nt.c index dc53cac59..5ead1347f 100644 --- a/src/comerr/et_lex.lex_nt.c +++ b/src/comerr/et_lex.lex_nt.c @@ -1,7 +1,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /tmp/cvstemp/openafs/src/comerr/et_lex.lex_nt.c,v 1.1.1.2 2001/01/19 20:54:19 hartmans Exp $ + * $Header: /tmp/cvstemp/openafs/src/comerr/et_lex.lex_nt.c,v 1.1.1.3 2001/07/05 01:02:02 hartmans Exp $ */ #define FLEX_SCANNER @@ -312,7 +312,7 @@ static yyconst short int yy_accept[36] = static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 6, 6, diff --git a/src/config/Makefile b/src/config/Makefile index 125069c1d..b83c73a64 100644 --- a/src/config/Makefile +++ b/src/config/Makefile @@ -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 diff --git a/src/config/Makefile.version-NOCML b/src/config/Makefile.version-NOCML index 81e6ac5c4..9edc0ddf0 100644 --- a/src/config/Makefile.version-NOCML +++ b/src/config/Makefile.version-NOCML @@ -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 diff --git a/src/config/NTMakefile b/src/config/NTMakefile index 917e8cbfe..9d27966e7 100644 --- a/src/config/NTMakefile +++ b/src/config/NTMakefile @@ -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 - + $(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 = \ + $(DESTDIR)\bin\rmbat.bat \ + $(DESTDIR)\bin\rmbat.rsp \ + $(DESTDIR)\bin\NTBUILD.bat + +$(DESTDIR)\bin\rmbat.bat:..\rmbat.bat + $(COPY) $? $@ + util_cr + $@ + +$(DESTDIR)\bin\rmbat.rsp:..\rmbat.rsp + $(COPY) $? $@ + +$(DESTDIR)\bin\NTBUILD.bat:..\NTBUILD.bat + $(COPY) $? $@ + util_cr + $@ + +$(DESTDIR)\bin\NTLang.bat: NTLang.bat util_cr.exe + $(COPY) NTLang.bat $(DESTDIR)\bin + util_cr + $(DESTDIR)\bin\NTLang.bat + +$(DESTDIR)\NTDllmap.txt:NTDllmap.txt + $(COPY) $? $@ + # 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 = \ + $(DESTDIR)\bin\mkvers.exe \ + $(DESTDIR)\bin\util_cr.exe \ + $(DESTDIR)\bin\touch.exe + +#mkvers.exe : mkvers.obj +# $(EXECONLINK) + +$(DESTDIR)\bin\mkvers.exe:mkvers.exe + $(COPY) mkvers.exe $(DESTDIR)\bin\. + +$(DESTDIR)\bin\util_cr.exe:util_cr.exe + $(COPY) util_cr.exe $(DESTDIR)\bin\. + +util_cr.exe : util_cr.obj + $(EXECONLINK) + +$(DESTDIR)\bin\touch.exe:touch.exe + $(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 + $(DEL) $(DESTDIR)\bin\touch.exe + $(DEL) $(DESTDIR)\bin\util_cr.exe + $(DEL) mkver.exe + $(DEL) touch.exe + $(DEL) util_cr.exe \ No newline at end of file diff --git a/src/config/NTMakefile.i386_nt40 b/src/config/NTMakefile.i386_nt40 index c7707a50b..54b095fe7 100644 --- a/src/config/NTMakefile.i386_nt40 +++ b/src/config/NTMakefile.i386_nt40 @@ -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. diff --git a/src/config/afs_args.h b/src/config/afs_args.h index 43c2d8978..51427adee 100644 --- a/src/config/afs_args.h +++ b/src/config/afs_args.h @@ -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 diff --git a/src/config/afs_sysnames.h b/src/config/afs_sysnames.h index 0b4ebec6e..84e3ef7fd 100644 --- a/src/config/afs_sysnames.h +++ b/src/config/afs_sysnames.h @@ -108,6 +108,7 @@ #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 @@ -122,6 +123,7 @@ #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 diff --git a/src/config/param.alpha_dux40_usr.h b/src/config/param.alpha_dux40_usr.h index 82f3e36db..192b33930 100644 --- a/src/config/param.alpha_dux40_usr.h +++ b/src/config/param.alpha_dux40_usr.h @@ -64,4 +64,4 @@ #endif #define ROOTINO UFSROOTINO -#endif _PARAM_SUN4C_51_H_ +#endif /* _PARAM_SUN4C_51_H_ */ diff --git a/src/config/param.i386_fbsd_42.h b/src/config/param.i386_fbsd_42.h index 217c58afb..8053a8b99 100644 --- a/src/config/param.i386_fbsd_42.h +++ b/src/config/param.i386_fbsd_42.h @@ -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 @@ -35,14 +37,12 @@ #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 @@ -54,31 +54,10 @@ #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 -#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 diff --git a/src/config/param.i386_fbsd_42_usr.h b/src/config/param.i386_fbsd_42_usr.h index 184418b0b..2ef5ec2d1 100644 --- a/src/config/param.i386_fbsd_42_usr.h +++ b/src/config/param.i386_fbsd_42_usr.h @@ -15,14 +15,13 @@ #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 #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" diff --git a/src/config/param.i386_linux24_usr.h b/src/config/param.i386_linux24_usr.h index 394d1a988..01c1ab1cc 100644 --- a/src/config/param.i386_linux24_usr.h +++ b/src/config/param.i386_linux24_usr.h @@ -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 diff --git a/src/config/param.i386_nt40.h b/src/config/param.i386_nt40.h index 9b11a9d6b..5ca03c875 100644 --- a/src/config/param.i386_nt40.h +++ b/src/config/param.i386_nt40.h @@ -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_ */ diff --git a/src/config/param.ppc_darwin_12.h b/src/config/param.ppc_darwin_12.h index 1640e9ba0..39b662109 100644 --- a/src/config/param.ppc_darwin_12.h +++ b/src/config/param.ppc_darwin_12.h @@ -55,4 +55,4 @@ #define VN_HOLD(vp) VREF(((struct vnode *)(vp))) #endif -#endif _PARAM_PPC_DARWIN_H_ +#endif /* _PARAM_PPC_DARWIN_H_ */ diff --git a/src/config/param.ppc_darwin_12_usr.h b/src/config/param.ppc_darwin_12_usr.h index 6402debc3..328b77eae 100644 --- a/src/config/param.ppc_darwin_12_usr.h +++ b/src/config/param.ppc_darwin_12_usr.h @@ -43,4 +43,4 @@ #define CMSERVERPREF #endif -#endif _PARAM_PPC_DARWIN_H_ +#endif /* _PARAM_PPC_DARWIN_H_ */ diff --git a/src/config/param.ppc_darwin_13.h b/src/config/param.ppc_darwin_13.h index 1afb00bd5..e04c6051e 100644 --- a/src/config/param.ppc_darwin_13.h +++ b/src/config/param.ppc_darwin_13.h @@ -57,4 +57,4 @@ #define VN_HOLD(vp) VREF(((struct vnode *)(vp))) #endif -#endif _PARAM_PPC_DARWIN_H_ +#endif /* _PARAM_PPC_DARWIN_H_ */ diff --git a/src/config/param.ppc_darwin_13_usr.h b/src/config/param.ppc_darwin_13_usr.h index ec6f03dfd..80664b277 100644 --- a/src/config/param.ppc_darwin_13_usr.h +++ b/src/config/param.ppc_darwin_13_usr.h @@ -45,4 +45,4 @@ #define CMSERVERPREF #endif -#endif _PARAM_PPC_DARWIN_H_ +#endif /* _PARAM_PPC_DARWIN_H_ */ diff --git a/src/config/param.s390_linux22.h b/src/config/param.s390_linux22.h index f9fbb048d..d3546712e 100644 --- a/src/config/param.s390_linux22.h +++ b/src/config/param.s390_linux22.h @@ -21,20 +21,6 @@ #define AFS_SYSCALL 137 #define AFS_64BIT_IOPS_ENV 1 #define AFS_NAMEI_ENV 1 /* User space interface to file system */ -#include - -#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 @@ -49,12 +35,33 @@ #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 +#endif + #endif /* __KERNEL__ && !DUMP_KERNEL*/ +#include + +#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)) diff --git a/src/config/param.sun4x_55.h b/src/config/param.sun4x_55.h index d1a0f33e5..bfad800cb 100644 --- a/src/config/param.sun4x_55.h +++ b/src/config/param.sun4x_55.h @@ -77,11 +77,11 @@ #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_ */ diff --git a/src/config/param.sun4x_55_usr.h b/src/config/param.sun4x_55_usr.h index 4d91b0c0a..c874d2431 100644 --- a/src/config/param.sun4x_55_usr.h +++ b/src/config/param.sun4x_55_usr.h @@ -62,4 +62,4 @@ #endif #define ROOTINO UFSROOTINO -#endif _PARAM_SUN4C_51_H_ +#endif /* _PARAM_SUN4C_51_H_ */ diff --git a/src/config/param.sun4x_56.h b/src/config/param.sun4x_56.h index 3d75ebf8a..195e6e5a7 100644 --- a/src/config/param.sun4x_56.h +++ b/src/config/param.sun4x_56.h @@ -76,11 +76,11 @@ #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_ */ diff --git a/src/config/param.sun4x_56_usr.h b/src/config/param.sun4x_56_usr.h index c60427dfe..39f43d5e6 100644 --- a/src/config/param.sun4x_56_usr.h +++ b/src/config/param.sun4x_56_usr.h @@ -63,4 +63,4 @@ #endif #define ROOTINO UFSROOTINO -#endif _PARAM_SUN4C_51_H_ +#endif /* _PARAM_SUN4C_51_H_ */ diff --git a/src/config/param.sun4x_57.h b/src/config/param.sun4x_57.h index 92406bef8..0c679a760 100644 --- a/src/config/param.sun4x_57.h +++ b/src/config/param.sun4x_57.h @@ -102,11 +102,11 @@ #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_ */ diff --git a/src/config/param.sun4x_57_usr.h b/src/config/param.sun4x_57_usr.h index 12828995e..c2a33d69e 100644 --- a/src/config/param.sun4x_57_usr.h +++ b/src/config/param.sun4x_57_usr.h @@ -63,4 +63,4 @@ #endif #define ROOTINO UFSROOTINO -#endif _PARAM_SUN4C_51_H_ +#endif /* _PARAM_SUN4C_51_H_ */ diff --git a/src/config/param.sun4x_58.h b/src/config/param.sun4x_58.h index fbee6f77a..5e48cf7dc 100644 --- a/src/config/param.sun4x_58.h +++ b/src/config/param.sun4x_58.h @@ -99,11 +99,11 @@ #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_ */ diff --git a/src/config/param.sun4x_58_usr.h b/src/config/param.sun4x_58_usr.h index 9de7672d4..1147ef340 100644 --- a/src/config/param.sun4x_58_usr.h +++ b/src/config/param.sun4x_58_usr.h @@ -56,4 +56,4 @@ #endif #define ROOTINO UFSROOTINO -#endif _PARAM_SUN4X_58_H_ +#endif /* _PARAM_SUN4X_58_H_ */ diff --git a/src/config/param.sunx86_54.h b/src/config/param.sunx86_54.h index bee1c1dc9..e3e2ce053 100644 --- a/src/config/param.sunx86_54.h +++ b/src/config/param.sunx86_54.h @@ -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_ */ diff --git a/src/dauth/Makefile b/src/dauth/Makefile index 9fd72fc92..2e428afaa 100644 --- a/src/dauth/Makefile +++ b/src/dauth/Makefile @@ -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 diff --git a/src/des/Makefile b/src/des/Makefile index a3c6b06a7..f643bebf5 100644 --- a/src/des/Makefile +++ b/src/des/Makefile @@ -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) diff --git a/src/des/NTMakefile b/src/des/NTMakefile index 78e4e1d72..ee9e41e70 100644 --- a/src/des/NTMakefile +++ b/src/des/NTMakefile @@ -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 diff --git a/src/des/andrew-conf.h b/src/des/andrew-conf.h index 0f9d238e4..ed4cc4ab8 100644 --- a/src/des/andrew-conf.h +++ b/src/des/andrew-conf.h @@ -3,6 +3,7 @@ */ #include +#include #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 diff --git a/src/des/cksum.c b/src/des/cksum.c index e85add710..224435666 100644 --- a/src/des/cksum.c +++ b/src/des/cksum.c @@ -20,11 +20,12 @@ #include #include #include -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) -#include -#else +#if defined(HAVE_STRINGS_H) #include #endif +#if defined(HAVE_STRING_H) +#include +#endif #include #include "des_internal.h" diff --git a/src/des/crypt.c b/src/des/crypt.c index e96725218..d60375c50 100644 --- a/src/des/crypt.c +++ b/src/des/crypt.c @@ -42,7 +42,12 @@ static char sccsid[] = "@(#)crypt.c 5.11 (Berkeley) 6/25/91"; #include #endif #include +#if defined(HAVE_STRINGS_H) +#include +#endif +#if defined(HAVE_STRING_H) #include +#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; { diff --git a/src/des/make_p_table.c b/src/des/make_p_table.c index d2248ffd3..a86fe445c 100644 --- a/src/des/make_p_table.c +++ b/src/des/make_p_table.c @@ -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)) diff --git a/src/des/make_s_table.c b/src/des/make_s_table.c index 3dfe74b49..e53779f6c 100644 --- a/src/des/make_s_table.c +++ b/src/des/make_s_table.c @@ -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; } diff --git a/src/des/new_rnd_key.c b/src/des/new_rnd_key.c index b4206267b..557a8fec9 100644 --- a/src/des/new_rnd_key.c +++ b/src/des/new_rnd_key.c @@ -16,12 +16,17 @@ #include #include +#include +#include "des_internal.h" #ifdef AFS_PTHREAD_ENV #include #endif +#if defined(HAVE_STRINGS_H) +#include +#endif +#if defined(HAVE_STRING_H) #include -#include -#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(); diff --git a/src/des/quad_cksum.c b/src/des/quad_cksum.c index da2859699..7eab559e9 100644 --- a/src/des/quad_cksum.c +++ b/src/des/quad_cksum.c @@ -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) { diff --git a/src/des/read_pssword.c b/src/des/read_pssword.c index 4fd9e8175..9cbe55868 100644 --- a/src/des/read_pssword.c +++ b/src/des/read_pssword.c @@ -17,27 +17,27 @@ #include "conf.h" #include - -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) -#include -#else +#if defined(HAVE_STRINGS_H) #include #endif +#if defined(HAVE_STRING_H) +#include +#endif #ifdef BSDUNIX #ifdef AFS_SUN5_ENV #define BSD_COMP #endif -#if defined(AFS_FBSD_ENV) -#define USE_OLD_TTY -#endif #include #include #include #endif -#if defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#ifdef HAVE_SIGNAL_H #include +#endif + +#ifdef HAVE_UNISTD_H #include #endif @@ -48,19 +48,16 @@ static int intrupt; #endif -#if defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV) +#ifdef HAVE_TERMIOS_H #include #endif -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) -#include -#endif -#ifdef AFS_NT40_ENV +#ifdef HAVE_WINDOWS_H #include #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. diff --git a/src/des/strng_to_key.c b/src/des/strng_to_key.c index d821e1696..43ee72bc4 100644 --- a/src/des/strng_to_key.c +++ b/src/des/strng_to_key.c @@ -22,10 +22,15 @@ #include #include -#include #include #include #include "des_internal.h" +#if defined(HAVE_STRINGS_H) +#include +#endif +#if defined(HAVE_STRING_H) +#include +#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)); } diff --git a/src/des/test/key_test.c b/src/des/test/key_test.c index c6c82bd31..92e162352 100644 --- a/src/des/test/key_test.c +++ b/src/des/test/key_test.c @@ -8,10 +8,6 @@ * -1 ==> error */ -#ifndef lint -static char rcsid_key_test_c[] = -#endif lint - #include #include #include diff --git a/src/des/test/testit.c b/src/des/test/testit.c index b7d2610b2..ee0925929 100644 --- a/src/des/test/testit.c +++ b/src/des/test/testit.c @@ -8,10 +8,6 @@ * -1 ==> error */ -#ifndef lint -static char rcsid_testit_c[] = -#endif lint - #include #include #include diff --git a/src/des/test/verify.c b/src/des/test/verify.c index dd485823d..e115dfa58 100644 --- a/src/des/test/verify.c +++ b/src/des/test/verify.c @@ -11,10 +11,6 @@ * -1 ==> error */ -#ifndef lint -static char rcsid_verify_c[] = -#endif lint - #include #include #include diff --git a/src/des/weak_key.c b/src/des/weak_key.c index 0ebe45aaa..0b6b4d7e3 100644 --- a/src/des/weak_key.c +++ b/src/des/weak_key.c @@ -12,9 +12,14 @@ * Originally written 8/85 by Steve Miller, MIT Project Athena. */ -#include #include #include "des_internal.h" +#if defined(HAVE_STRINGS_H) +#include +#endif +#if defined(HAVE_STRING_H) +#include +#endif /* * The following are the weak DES keys: diff --git a/src/des_stub/NTMakefile b/src/des_stub/NTMakefile index 7205f8095..2231c7bf6 100644 --- a/src/des_stub/NTMakefile +++ b/src/des_stub/NTMakefile @@ -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 diff --git a/src/dir/Makefile b/src/dir/Makefile index 69e9aa33f..e28dad71b 100644 --- a/src/dir/Makefile +++ b/src/dir/Makefile @@ -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 diff --git a/src/finale/translate_et.c b/src/finale/translate_et.c index b6c7a4980..d7f809aed 100644 --- a/src/finale/translate_et.c +++ b/src/finale/translate_et.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #ifdef AFS_AIX32_ENV #include @@ -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<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; diff --git a/src/kauth/authclient.c b/src/kauth/authclient.c index c48868f2c..04d46669c 100644 --- a/src/kauth/authclient.c +++ b/src/kauth/authclient.c @@ -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; } diff --git a/src/kauth/kalocalcell.c b/src/kauth/kalocalcell.c index 69adf45a6..c0df2e578 100644 --- a/src/kauth/kalocalcell.c +++ b/src/kauth/kalocalcell.c @@ -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 diff --git a/src/kauth/kautils.p.h b/src/kauth/kautils.p.h index 85915e55f..da3756c97 100644 --- a/src/kauth/kautils.p.h +++ b/src/kauth/kautils.p.h @@ -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 ( diff --git a/src/kauth/krb_udp.c b/src/kauth/krb_udp.c index d5e5ad7b0..eec4a84a5 100644 --- a/src/kauth/krb_udp.c +++ b/src/kauth/krb_udp.c @@ -17,6 +17,7 @@ #include #ifdef AFS_NT40_ENV #include +#define snprintf _snprintf #else #include #include diff --git a/src/kauth/rebuild.c b/src/kauth/rebuild.c index bc7438324..f2857628e 100644 --- a/src/kauth/rebuild.c +++ b/src/kauth/rebuild.c @@ -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"); diff --git a/src/libacl/NTMakefile b/src/libacl/NTMakefile index 89538eaf6..f2633fa94 100644 --- a/src/libacl/NTMakefile +++ b/src/libacl/NTMakefile @@ -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 diff --git a/src/libadmin/Makefile b/src/libadmin/Makefile index 09b540f7e..84fed2802 100644 --- a/src/libadmin/Makefile +++ b/src/libadmin/Makefile @@ -10,3 +10,5 @@ include ../config/Makefile.${SYS_NAME} system install: ${INSTALL} afs_Admin.h ${DESTDIR}include/afs +clean: + diff --git a/src/libadmin/NTMakefile b/src/libadmin/NTMakefile index cff52a424..3e4c5a749 100644 --- a/src/libadmin/NTMakefile +++ b/src/libadmin/NTMakefile @@ -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) diff --git a/src/libadmin/adminutil/afs_utilAdmin.c b/src/libadmin/adminutil/afs_utilAdmin.c index e57ffed97..73635d995 100644 --- a/src/libadmin/adminutil/afs_utilAdmin.c +++ b/src/libadmin/adminutil/afs_utilAdmin.c @@ -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; diff --git a/src/libadmin/bos/afs_bosAdmin.c b/src/libadmin/bos/afs_bosAdmin.c index ea6ead431..daac36edc 100644 --- a/src/libadmin/bos/afs_bosAdmin.c +++ b/src/libadmin/bos/afs_bosAdmin.c @@ -20,8 +20,11 @@ #include #include #include +#include #ifdef AFS_NT40_ENV #include +#else +#include #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); } diff --git a/src/libadmin/client/afs_clientAdmin.c b/src/libadmin/client/afs_clientAdmin.c index c415298d8..fe19db40a 100644 --- a/src/libadmin/client/afs_clientAdmin.c +++ b/src/libadmin/client/afs_clientAdmin.c @@ -26,6 +26,7 @@ #include #include #include +#include #endif #include #include @@ -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; } diff --git a/src/libadmin/kas/afs_kasAdmin.c b/src/libadmin/kas/afs_kasAdmin.c index 9b7722512..81061b132 100644 --- a/src/libadmin/kas/afs_kasAdmin.c +++ b/src/libadmin/kas/afs_kasAdmin.c @@ -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. diff --git a/src/libadmin/kas/afs_kasAdmin.h b/src/libadmin/kas/afs_kasAdmin.h index ee2bf9653..c6395a273 100644 --- a/src/libadmin/kas/afs_kasAdmin.h +++ b/src/libadmin/kas/afs_kasAdmin.h @@ -14,7 +14,9 @@ #include #include #ifdef AFS_NT40_ENV +#ifndef _MFC_VER #include +#endif /* _MFC_VER */ #endif #define KAS_MAX_NAME_LEN 64 diff --git a/src/libadmin/samples/rxstat_get_version.c b/src/libadmin/samples/rxstat_get_version.c index f58195d41..9a5380536 100644 --- a/src/libadmin/samples/rxstat_get_version.c +++ b/src/libadmin/samples/rxstat_get_version.c @@ -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); diff --git a/src/libadmin/vos/Makefile b/src/libadmin/vos/Makefile index be743dffd..797ec28d7 100644 --- a/src/libadmin/vos/Makefile +++ b/src/libadmin/vos/Makefile @@ -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/ diff --git a/src/libadmin/vos/afs_vosAdmin.c b/src/libadmin/vos/afs_vosAdmin.c index c67180cb6..3256a951f 100644 --- a/src/libadmin/vos/afs_vosAdmin.c +++ b/src/libadmin/vos/afs_vosAdmin.c @@ -8,14 +8,24 @@ */ #include +#include #include #include +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#endif +#endif +#include #ifdef AFS_NT40_ENV #include #include #else #include #include +#include #include #include #include @@ -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 diff --git a/src/libadmin/vos/afs_vosAdmin.h b/src/libadmin/vos/afs_vosAdmin.h index 580ccc081..25320a913 100644 --- a/src/libadmin/vos/afs_vosAdmin.h +++ b/src/libadmin/vos/afs_vosAdmin.h @@ -14,7 +14,9 @@ #include #include #ifdef AFS_NT40_ENV +#ifndef _MFC_VER #include +#endif /* _MFC_VER */ #else #include #endif diff --git a/src/libadmin/vos/lockprocs.c b/src/libadmin/vos/lockprocs.c index 452b3dff5..1473c6ab8 100644 --- a/src/libadmin/vos/lockprocs.c +++ b/src/libadmin/vos/lockprocs.c @@ -8,6 +8,13 @@ */ #include "lockprocs.h" +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#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) diff --git a/src/libadmin/vos/lockprocs.h b/src/libadmin/vos/lockprocs.h index 62d972568..e60137db7 100644 --- a/src/libadmin/vos/lockprocs.h +++ b/src/libadmin/vos/lockprocs.h @@ -8,6 +8,7 @@ */ #include +#include #include #ifdef AFS_NT40_ENV #include diff --git a/src/libadmin/vos/vosutils.c b/src/libadmin/vos/vosutils.c index 6ac500abd..de907518c 100644 --- a/src/libadmin/vos/vosutils.c +++ b/src/libadmin/vos/vosutils.c @@ -11,6 +11,13 @@ #include "vsprocs.h" #include "lockprocs.h" #include +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#endif +#endif /* * Functions that aren't prototyped, but that we use diff --git a/src/libadmin/vos/vosutils.h b/src/libadmin/vos/vosutils.h index 13882da1b..7700a5fc3 100644 --- a/src/libadmin/vos/vosutils.h +++ b/src/libadmin/vos/vosutils.h @@ -8,6 +8,7 @@ */ #include +#include #include #include #include diff --git a/src/libadmin/vos/vsprocs.c b/src/libadmin/vos/vsprocs.c index 2453296b8..fccdf8681 100644 --- a/src/libadmin/vos/vsprocs.c +++ b/src/libadmin/vos/vsprocs.c @@ -24,11 +24,21 @@ #include "../adminutil/afs_AdminInternal.h" #include #include "afs_vosAdmin.h" +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#endif +#endif +#ifdef HAVE_UNISTD_H +#include +#endif #ifdef AFS_NT40_ENV #include #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. is the number of entries to be processesd. * 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, diff --git a/src/libadmin/vos/vsprocs.h b/src/libadmin/vos/vsprocs.h index 0629f922b..8553f3fd9 100644 --- a/src/libadmin/vos/vsprocs.h +++ b/src/libadmin/vos/vsprocs.h @@ -8,6 +8,7 @@ */ #include +#include #include #include #include diff --git a/src/libafsauthent/Makefile b/src/libafsauthent/Makefile index 33be0bcd9..2fe9f046c 100644 --- a/src/libafsauthent/Makefile +++ b/src/libafsauthent/Makefile @@ -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 diff --git a/src/libafsauthent/NTMakefile b/src/libafsauthent/NTMakefile index 110f4e303..4182a212b 100644 --- a/src/libafsauthent/NTMakefile +++ b/src/libafsauthent/NTMakefile @@ -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 diff --git a/src/libafsrpc/Makefile b/src/libafsrpc/Makefile index e411bd773..48c4036b5 100644 --- a/src/libafsrpc/Makefile +++ b/src/libafsrpc/Makefile @@ -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. diff --git a/src/libafsrpc/NTMakefile b/src/libafsrpc/NTMakefile index 80b9d2a40..d87af3126 100644 --- a/src/libafsrpc/NTMakefile +++ b/src/libafsrpc/NTMakefile @@ -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 diff --git a/src/libuafs/Makefile.common b/src/libuafs/Makefile.common index c57974a28..d2e6608a3 100644 --- a/src/libuafs/Makefile.common +++ b/src/libuafs/Makefile.common @@ -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 diff --git a/src/libuafs/MakefileProto.AIX b/src/libuafs/MakefileProto.AIX index df8d0a109..0ee221932 100644 --- a/src/libuafs/MakefileProto.AIX +++ b/src/libuafs/MakefileProto.AIX @@ -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 diff --git a/src/libuafs/MakefileProto.DARWIN b/src/libuafs/MakefileProto.DARWIN index e11103f0f..f5072413d 100644 --- a/src/libuafs/MakefileProto.DARWIN +++ b/src/libuafs/MakefileProto.DARWIN @@ -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 diff --git a/src/libuafs/MakefileProto.DUX b/src/libuafs/MakefileProto.DUX index fcac0571d..525700cc2 100644 --- a/src/libuafs/MakefileProto.DUX +++ b/src/libuafs/MakefileProto.DUX @@ -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 diff --git a/src/libuafs/MakefileProto.FBSD b/src/libuafs/MakefileProto.FBSD index d493755b2..5086f2dcc 100644 --- a/src/libuafs/MakefileProto.FBSD +++ b/src/libuafs/MakefileProto.FBSD @@ -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 diff --git a/src/libuafs/MakefileProto.HPUX b/src/libuafs/MakefileProto.HPUX index 22738350f..61aea37a8 100644 --- a/src/libuafs/MakefileProto.HPUX +++ b/src/libuafs/MakefileProto.HPUX @@ -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 diff --git a/src/libuafs/MakefileProto.IRIX b/src/libuafs/MakefileProto.IRIX index 66b06d07d..039fee9e6 100644 --- a/src/libuafs/MakefileProto.IRIX +++ b/src/libuafs/MakefileProto.IRIX @@ -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 diff --git a/src/libuafs/MakefileProto.LINUX b/src/libuafs/MakefileProto.LINUX index b2523c0ee..02ac4d753 100644 --- a/src/libuafs/MakefileProto.LINUX +++ b/src/libuafs/MakefileProto.LINUX @@ -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 diff --git a/src/libuafs/MakefileProto.SOLARIS b/src/libuafs/MakefileProto.SOLARIS index 43875f359..0b59c2b85 100644 --- a/src/libuafs/MakefileProto.SOLARIS +++ b/src/libuafs/MakefileProto.SOLARIS @@ -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 diff --git a/src/log/Makefile b/src/log/Makefile index f053437d3..7db954abf 100644 --- a/src/log/Makefile +++ b/src/log/Makefile @@ -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 diff --git a/src/lwp/Makefile b/src/lwp/Makefile index 9e44ef5c4..f3a2ed1e0 100644 --- a/src/lwp/Makefile +++ b/src/lwp/Makefile @@ -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 diff --git a/src/lwp/NTMakefile b/src/lwp/NTMakefile index 5fcb9e5e2..2fb0362d2 100644 --- a/src/lwp/NTMakefile +++ b/src/lwp/NTMakefile @@ -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) diff --git a/src/lwp/iomgr.c b/src/lwp/iomgr.c index f6dbc495c..8f5beba46 100644 --- a/src/lwp/iomgr.c +++ b/src/lwp/iomgr.c @@ -25,6 +25,8 @@ #include #include +#include +#include #ifdef AFS_NT40_ENV #include #include @@ -45,6 +47,17 @@ extern void lwp_abort(void); #ifdef AFS_SUN5_ENV #include #endif +#ifdef AFS_DJGPP_ENV +#include "dosdefs95.h" +#include "netbios95.h" +#include +#include +#include +#include +#include +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(); /********************************\ @@ -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 */ + }; /********************************\ @@ -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 */ diff --git a/src/lwp/lwp_nt.c b/src/lwp/lwp_nt.c index b9282ef1a..531d5f9b8 100644 --- a/src/lwp/lwp_nt.c +++ b/src/lwp/lwp_nt.c @@ -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")) diff --git a/src/lwp/process.s b/src/lwp/process.s index 6412af693..d24af7c89 100644 --- a/src/lwp/process.s +++ b/src/lwp/process.s @@ -8,7 +8,9 @@ */ #define IGNORE_STDS_H 1 +/*#ifndef AFS_DJGPP_ENV*/ #include +/*#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 @@ -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 */ diff --git a/src/lwp/threadname.c b/src/lwp/threadname.c index 0b31bd785..c9df424f4 100644 --- a/src/lwp/threadname.c +++ b/src/lwp/threadname.c @@ -20,6 +20,14 @@ /* ********************************************************************** */ #include +#include +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#endif +#endif #if defined(AFS_PTHREAD_ENV) #include #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) diff --git a/src/lwp/timer.c b/src/lwp/timer.c index 09de7e6ea..59b448ee1 100644 --- a/src/lwp/timer.c +++ b/src/lwp/timer.c @@ -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)) { diff --git a/src/lwp/waitkey.c b/src/lwp/waitkey.c index fc7be400a..e599d963e 100644 --- a/src/lwp/waitkey.c +++ b/src/lwp/waitkey.c @@ -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); diff --git a/src/ntbuild.bat b/src/ntbuild.bat index 9d519b67b..7ade68e64 100755 --- a/src/ntbuild.bat +++ b/src/ntbuild.bat @@ -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 = - -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 = -REM AFSDEV_LIB = -REM AFSDEV_BIN = +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 = -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 diff --git a/src/pam/Makefile b/src/pam/Makefile index 9b218cb9d..941025a09 100644 --- a/src/pam/Makefile +++ b/src/pam/Makefile @@ -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 diff --git a/src/pinstall/Makefile b/src/pinstall/Makefile index d5d3b5723..b08e48483 100644 --- a/src/pinstall/Makefile +++ b/src/pinstall/Makefile @@ -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 diff --git a/src/procmgmt/Makefile b/src/procmgmt/Makefile index 82c35dbdd..ebfba3ce4 100644 --- a/src/procmgmt/Makefile +++ b/src/procmgmt/Makefile @@ -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 diff --git a/src/procmgmt/NTMakefile b/src/procmgmt/NTMakefile index 92dfe7046..71dfb0284 100644 --- a/src/procmgmt/NTMakefile +++ b/src/procmgmt/NTMakefile @@ -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 diff --git a/src/ptserver/Makefile b/src/ptserver/Makefile index 3a0308fa4..ed79932b1 100644 --- a/src/ptserver/Makefile +++ b/src/ptserver/Makefile @@ -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 + diff --git a/src/ptserver/NTMakefile b/src/ptserver/NTMakefile index 656a7c2b4..7c9d2bfc9 100644 --- a/src/ptserver/NTMakefile +++ b/src/ptserver/NTMakefile @@ -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? diff --git a/src/ptserver/ptserver.c b/src/ptserver/ptserver.c index 56371f6be..15fc53112 100644 --- a/src/ptserver/ptserver.c +++ b/src/ptserver/ptserver.c @@ -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 ] " #ifndef AFS_NT40_ENV + printf ("Usage: ptserver [-database ] " "[-syslog[=FACILITY]] " -#endif "[-p ] [-rebuild] " - /* "[-enable_peer_stats] [-enable_process_stats] " */ + "[-enable_peer_stats] [-enable_process_stats] " + "[-help]\n"); +#else + printf ("Usage: ptserver [-database ] " + "[-p ] [-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); } diff --git a/src/ptserver/ptutils.c b/src/ptserver/ptutils.c index e4596d48a..ccc4c46a2 100644 --- a/src/ptserver/ptutils.c +++ b/src/ptserver/ptutils.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "ptserver.h" #include "pterror.h" #include diff --git a/src/ptserver/ubik.c b/src/ptserver/ubik.c index a9733fff5..29e7900fb 100644 --- a/src/ptserver/ubik.c +++ b/src/ptserver/ubik.c @@ -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 #include diff --git a/src/rx/LINUX/rx_kmutex.h b/src/rx/LINUX/rx_kmutex.h index 6a53dd110..fa5e15ae2 100644 --- a/src/rx/LINUX/rx_kmutex.h +++ b/src/rx/LINUX/rx_kmutex.h @@ -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; diff --git a/src/rx/Makefile b/src/rx/Makefile index 1056e225c..1d75a840e 100644 --- a/src/rx/Makefile +++ b/src/rx/Makefile @@ -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 diff --git a/src/rx/NTMakefile b/src/rx/NTMakefile index 004ad2946..4de8de035 100644 --- a/src/rx/NTMakefile +++ b/src/rx/NTMakefile @@ -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) diff --git a/src/rx/rx.h b/src/rx/rx.h index 7820cb068..addb64cff 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -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 diff --git a/src/rx/rx_clock.c b/src/rx/rx_clock.c index 546ae0f66..5972e20ca 100644 --- a/src/rx/rx_clock.c +++ b/src/rx/rx_clock.c @@ -72,9 +72,11 @@ void clock_Init(void) { #ifndef KERNEL /* Make clock uninitialized. */ +int clock_UnInit() { clockInitialized = 0; + return 0; } #endif diff --git a/src/rx/rx_conncache.c b/src/rx/rx_conncache.c index 2fc2784ef..09d2e8adb 100644 --- a/src/rx/rx_conncache.c +++ b/src/rx/rx_conncache.c @@ -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; diff --git a/src/rx/rx_event.c b/src/rx/rx_event.c index b527a7aef..ce580dcbf 100644 --- a/src/rx/rx_event.c +++ b/src/rx/rx_event.c @@ -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); diff --git a/src/rx/rx_getaddr.c b/src/rx/rx_getaddr.c index 1432d6e68..5e02a0af3 100644 --- a/src/rx/rx_getaddr.c +++ b/src/rx/rx_getaddr.c @@ -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 +#ifndef AFS_DJGPP_ENV #ifndef KERNEL #ifndef AFS_NT40_ENV #include @@ -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 */ diff --git a/src/rx/rx_lwp.c b/src/rx/rx_lwp.c index 63ad212fe..f018c10f9 100644 --- a/src/rx/rx_lwp.c +++ b/src/rx/rx_lwp.c @@ -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; } diff --git a/src/rx/rx_misc.c b/src/rx/rx_misc.c index c0299d46a..555c549bb 100644 --- a/src/rx/rx_misc.c +++ b/src/rx/rx_misc.c @@ -8,6 +8,7 @@ */ #include +#include #ifdef KERNEL #include #include @@ -24,6 +25,17 @@ #ifdef AFS_PTHREAD_ENV #include "rx.h" #endif /* AFS_PTHREAD_ENV */ +#include +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#endif +#endif +#ifdef HAVE_UNISTD_H +#include +#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 */ diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c index 362e6fad1..30323847a 100644 --- a/src/rx/rx_packet.c +++ b/src/rx/rx_packet.c @@ -9,6 +9,7 @@ #ifdef KERNEL #include "../afs/param.h" +#include #if defined(UKERNEL) #include "../afs/sysincludes.h" #include "../afs/afsincludes.h" @@ -44,11 +45,17 @@ #include "../rx/rx_globals.h" #else /* KERNEL */ #include +#include #include "sys/types.h" #include #include +#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV) #ifdef AFS_NT40_ENV #include +#else +#include +#include +#endif /* AFS_NT40_ENV */ #include "rx_xmit_nt.h" #include #else @@ -65,9 +72,18 @@ #include "rx_globals.h" #include #include "rx_internal.h" +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#endif +#endif +#ifdef HAVE_UNISTD_H +#include +#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 && iwirevec[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;jcallNumber[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; diff --git a/src/rx/rx_packet.h b/src/rx/rx_packet.h index cb49d1e47..8941e26a3 100644 --- a/src/rx/rx_packet.h +++ b/src/rx/rx_packet.h @@ -10,11 +10,12 @@ #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 #endif +#ifndef AFS_NT40_ENV +#include +#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 diff --git a/src/rx/rx_pthread.c b/src/rx/rx_pthread.c index c81f86b05..da567a841 100644 --- a/src/rx/rx_pthread.c +++ b/src/rx/rx_pthread.c @@ -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); diff --git a/src/rx/rx_rdwr.c b/src/rx/rx_rdwr.c index 0b409905c..e3d68e4e8 100644 --- a/src/rx/rx_rdwr.c +++ b/src/rx/rx_rdwr.c @@ -9,6 +9,7 @@ #ifdef KERNEL #include "../afs/param.h" +#include #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 +# include # include #ifndef AFS_NT40_ENV # include @@ -65,6 +67,16 @@ # include # include #endif +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#endif +#endif +#ifdef HAVE_UNISTD_H +#include +#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: diff --git a/src/rx/rx_trace.c b/src/rx/rx_trace.c index 182fe5084..888bb5098 100644 --- a/src/rx/rx_trace.c +++ b/src/rx/rx_trace.c @@ -10,11 +10,20 @@ #ifdef RXDEBUG #include +#include +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#endif +#endif #ifdef AFS_NT40_ENV #include #include #else #include +#include #endif #include "rx.h" #include "rx_globals.h" @@ -120,7 +129,7 @@ void rxi_calltrace(event, call) #include #endif -main(argc, argv) +int main(argc, argv) char **argv; { struct rx_trace ip; diff --git a/src/rx/rx_user.c b/src/rx/rx_user.c index 826389474..490568d8e 100644 --- a/src/rx/rx_user.c +++ b/src/rx/rx_user.c @@ -10,6 +10,7 @@ /* rx_user.c contains routines specific to the user space UNIX implementation of rx */ # include +# include # include # include # include @@ -26,11 +27,18 @@ # include #endif # include -#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) +#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV) # include #endif #include #include +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#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 @@ -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 */ diff --git a/src/rx/rx_xmit_nt.c b/src/rx/rx_xmit_nt.c index 42ab7957d..957477b7c 100644 --- a/src/rx/rx_xmit_nt.c +++ b/src/rx/rx_xmit_nt.c @@ -15,15 +15,28 @@ */ #include -#ifdef AFS_NT40_ENV +#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV) +#ifdef AFS_NT40_ENV #include +#else +#include +#include +#include +#include +#include +#include +#include +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 +#endif #include 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 */ diff --git a/src/rx/rx_xmit_nt.h b/src/rx/rx_xmit_nt.h index 5ed6565e1..491cca4e5 100644 --- a/src/rx/rx_xmit_nt.h +++ b/src/rx/rx_xmit_nt.h @@ -11,10 +11,14 @@ #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; diff --git a/src/rx/rxdebug.c b/src/rx/rxdebug.c index 1cd7ffddd..6db38b725 100644 --- a/src/rx/rxdebug.c +++ b/src/rx/rxdebug.c @@ -9,6 +9,7 @@ #include #include +#include #include #ifdef AFS_NT40_ENV #include @@ -16,9 +17,23 @@ #include #include #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_SYS_TIME_H #include #endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#endif +#endif #include #include #include @@ -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; { diff --git a/src/rx/xdr.h b/src/rx/xdr.h index 095335089..c74a8f0f7 100644 --- a/src/rx/xdr.h +++ b/src/rx/xdr.h @@ -39,7 +39,9 @@ #define __XDR_INCLUDE__ #include #ifdef AFS_NT40_ENV +#ifndef _MFC_VER #include +#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__ */ diff --git a/src/rx/xdr_rx.c b/src/rx/xdr_rx.c index 5755b96a5..0975c9b54 100644 --- a/src/rx/xdr_rx.c +++ b/src/rx/xdr_rx.c @@ -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) diff --git a/src/rxgen/Makefile b/src/rxgen/Makefile index 830f527ef..bf186b869 100644 --- a/src/rxgen/Makefile +++ b/src/rxgen/Makefile @@ -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 diff --git a/src/rxgen/NTMakefile b/src/rxgen/NTMakefile index 1c4281c61..37fb77a19 100644 --- a/src/rxgen/NTMakefile +++ b/src/rxgen/NTMakefile @@ -36,6 +36,7 @@ $(EXEFILE): $(EXEOBJS) $(EXELIBS) install: AFS_component_version_number.c $(EXEFILE) $(INCFILES) +install9x: install clean:: - + $(DEL) $(EXEFILE) diff --git a/src/rxgen/rpc_clntout.c b/src/rxgen/rpc_clntout.c index 40f52dcc4..34cd02794 100644 --- a/src/rxgen/rpc_clntout.c +++ b/src/rxgen/rpc_clntout.c @@ -27,24 +27,20 @@ * 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 +#include #include -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) #include -#else -#include -#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(); diff --git a/src/rxgen/rpc_cout.c b/src/rxgen/rpc_cout.c index 0b2820eb4..89e521202 100644 --- a/src/rxgen/rpc_cout.c +++ b/src/rxgen/rpc_cout.c @@ -33,15 +33,21 @@ * Copyright (C) 1987, Sun Microsystems, Inc. */ #include +#include #include -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) -#include -#else +#include +#ifdef HAVE_STRINGS_H #include +#else +#ifdef HAVE_STRING_H +#include +#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(); diff --git a/src/rxgen/rpc_hout.c b/src/rxgen/rpc_hout.c index 5c7853bc5..1ddb11941 100644 --- a/src/rxgen/rpc_hout.c +++ b/src/rxgen/rpc_hout.c @@ -32,11 +32,15 @@ * rpc_hout.c, Header file outputter for the RPC protocol compiler * Copyright (C) 1987, Sun Microsystems, Inc. */ +#include +#include #include #include #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(); diff --git a/src/rxgen/rpc_main.c b/src/rxgen/rpc_main.c index e96aba488..081a2a56f 100644 --- a/src/rxgen/rpc_main.c +++ b/src/rxgen/rpc_main.c @@ -34,24 +34,30 @@ */ #include +#include #include #include -#ifdef AFS_AIX32_ENV -#include -#endif +#include #include -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) -#include -#else +#ifdef HAVE_STRINGS_H #include +#else +#ifdef HAVE_STRING_H +#include +#endif +#endif +#ifdef HAVE_SIGNAL_H +#include #endif -#ifndef AFS_NT40_ENV +#ifdef HAVE_SYS_FILE_H #include #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"); diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c index a774acd66..34ab13eb4 100644 --- a/src/rxgen/rpc_parse.c +++ b/src/rxgen/rpc_parse.c @@ -33,20 +33,22 @@ * Copyright (C) 1987 Sun Microsystems, Inc. */ #include +#include +#include #include #include -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) -#include -#if defined(AFS_SUN5_ENV) +#ifdef HAVE_STRINGS_H #include -#endif #else -#include +#ifdef HAVE_STRING_H +#include +#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"); diff --git a/src/rxgen/rpc_scan.c b/src/rxgen/rpc_scan.c index 385c79a27..05e786e5e 100644 --- a/src/rxgen/rpc_scan.c +++ b/src/rxgen/rpc_scan.c @@ -33,16 +33,22 @@ * Copyright (C) 1987, Sun Microsystems, Inc. */ #include +#include #include +#include #include -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) -#include -#else +#ifdef HAVE_STRINGS_H #include +#else +#ifdef HAVE_STRING_H +#include +#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) == '{') diff --git a/src/rxgen/rpc_svcout.c b/src/rxgen/rpc_svcout.c index 839522771..99b016cce 100644 --- a/src/rxgen/rpc_svcout.c +++ b/src/rxgen/rpc_svcout.c @@ -27,24 +27,26 @@ * 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 +#include #include -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) -#include -#else +#ifdef HAVE_STRINGS_H #include +#else +#ifdef HAVE_STRING_H +#include +#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"; diff --git a/src/rxgen/rpc_util.c b/src/rxgen/rpc_util.c index 971c2ec90..5ab99415b 100644 --- a/src/rxgen/rpc_util.c +++ b/src/rxgen/rpc_util.c @@ -33,11 +33,21 @@ * Copyright (C) 1987, Sun Microsystems, Inc. */ #include +#include #include +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#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 */ diff --git a/src/rxgen/rpc_util.h b/src/rxgen/rpc_util.h index 3df9ca36d..501e9bd57 100644 --- a/src/rxgen/rpc_util.h +++ b/src/rxgen/rpc_util.h @@ -34,13 +34,6 @@ */ #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)) diff --git a/src/rxkad/Makefile b/src/rxkad/Makefile index be08e3dc2..622ce584a 100644 --- a/src/rxkad/Makefile +++ b/src/rxkad/Makefile @@ -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 diff --git a/src/rxkad/NTMakefile b/src/rxkad/NTMakefile index 0703c920a..fc71d72eb 100644 --- a/src/rxkad/NTMakefile +++ b/src/rxkad/NTMakefile @@ -61,6 +61,7 @@ sboxes.h : domestic\sboxes.h install: $(DOMESTIC) $(INCFILES) $(LIBFILE) +install9x: install clean:: $(DEL) $(RXKAD_INCFILE) rxkad_errs.c diff --git a/src/rxstat/Makefile b/src/rxstat/Makefile index 8f81ed8a2..5acf36db4 100644 --- a/src/rxstat/Makefile +++ b/src/rxstat/Makefile @@ -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} diff --git a/src/rxstat/NTMakefile b/src/rxstat/NTMakefile index 3dccb3a2e..b1359e90d 100644 --- a/src/rxstat/NTMakefile +++ b/src/rxstat/NTMakefile @@ -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 diff --git a/src/sgistuff/Makefile b/src/sgistuff/Makefile index 5a42979ac..24b71711d 100644 --- a/src/sgistuff/Makefile +++ b/src/sgistuff/Makefile @@ -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 ) diff --git a/src/sia/Makefile b/src/sia/Makefile index 74403e866..d5eae51a0 100644 --- a/src/sia/Makefile +++ b/src/sia/Makefile @@ -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 diff --git a/src/sys/Makefile b/src/sys/Makefile index 72267e6e0..d7b5c690e 100644 --- a/src/sys/Makefile +++ b/src/sys/Makefile @@ -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 diff --git a/src/sys/NTMakefile b/src/sys/NTMakefile index f98916e9f..b4b027e19 100644 --- a/src/sys/NTMakefile +++ b/src/sys/NTMakefile @@ -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 diff --git a/src/sys/pagsh.c b/src/sys/pagsh.c index 3a10691e0..75a774233 100644 --- a/src/sys/pagsh.c +++ b/src/sys/pagsh.c @@ -8,20 +8,29 @@ */ #include +#include #ifdef AFS_AIX32_ENV #include #endif #include +#include +#ifndef AFS_NT40_ENV +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif #include - -#ifdef notdef -/* AFS_KERBEROS_ENV is now conditionally defined in the Makefile */ -#define AFS_KERBEROS_ENV +#ifdef AFS_KERBEROS_ENV +#include +#include #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 -#include - -extern char *malloc(); - static afs_uint32 curpag() { afs_uint32 groups[30]; diff --git a/src/sys/pioctl_nt.c b/src/sys/pioctl_nt.c index bf58ca716..8be9093b9 100644 --- a/src/sys/pioctl_nt.c +++ b/src/sys/pioctl_nt.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -28,9 +29,8 @@ #include #include #include - + #include -#include #include 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; diff --git a/src/sys/rmtsysc.c b/src/sys/rmtsysc.c index 9b8fe1548..341624293 100644 --- a/src/sys/rmtsysc.c +++ b/src/sys/rmtsysc.c @@ -13,6 +13,7 @@ * calls of setpag, and pioctl are supported. */ #include +#include #include #include #include @@ -26,6 +27,9 @@ #endif #include #include +#ifdef HAVE_STRING_H +#include +#endif #include #include "rmtsys.h" diff --git a/src/sys/rmtsyss.c b/src/sys/rmtsyss.c index e076acf77..2d47b054c 100644 --- a/src/sys/rmtsyss.c +++ b/src/sys/rmtsyss.c @@ -13,6 +13,7 @@ * This module resides in the lib/afs/librmtsys.a library. */ #include +#include #include #include #include @@ -23,6 +24,9 @@ #include #include #include +#ifdef HAVE_STRING_H +#include +#endif /*#include */ #include "rmtsys.h" diff --git a/src/tbutc/NTMakefile b/src/tbutc/NTMakefile index 52bbe47e6..6848183f0 100644 --- a/src/tbutc/NTMakefile +++ b/src/tbutc/NTMakefile @@ -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) $(EXECONLINK) $(EXEPREP) diff --git a/src/tviced/Makefile b/src/tviced/Makefile index a7bab2ad1..83bab934b 100644 --- a/src/tviced/Makefile +++ b/src/tviced/Makefile @@ -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 diff --git a/src/ubik/Makefile b/src/ubik/Makefile index 7a89360c7..60100afdc 100644 --- a/src/ubik/Makefile +++ b/src/ubik/Makefile @@ -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 diff --git a/src/ubik/NTMakefile b/src/ubik/NTMakefile index 7c6bb89a5..3f373f3e4 100644 --- a/src/ubik/NTMakefile +++ b/src/ubik/NTMakefile @@ -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) diff --git a/src/ubik/beacon.c b/src/ubik/beacon.c index fe8ac9ec3..c43ab330d 100644 --- a/src/ubik/beacon.c +++ b/src/ubik/beacon.c @@ -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; diff --git a/src/ubik/udebug.c b/src/ubik/udebug.c index 7145036b8..b33a36289 100644 --- a/src/ubik/udebug.c +++ b/src/ubik/udebug.c @@ -8,8 +8,16 @@ */ #include +#include #include #include +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#endif +#endif #ifdef AFS_NT40_ENV #include #else @@ -18,6 +26,9 @@ #include #include #endif +#ifdef HAVE_UNISTD_H +#include +#endif #include #include @@ -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; { diff --git a/src/update/Makefile b/src/update/Makefile index 19d6b921d..b4b45ec3c 100644 --- a/src/update/Makefile +++ b/src/update/Makefile @@ -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 diff --git a/src/update/client.c b/src/update/client.c index 3bf09f55d..03460ec07 100644 --- a/src/update/client.c +++ b/src/update/client.c @@ -8,6 +8,7 @@ */ #include +#include #include #ifdef AFS_AIX32_ENV #include @@ -31,6 +32,16 @@ #include #include #endif +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#endif +#endif +#ifdef HAVE_UNISTD_H +#include +#endif #include #include #include @@ -41,6 +52,8 @@ #include #include +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; diff --git a/src/update/server.c b/src/update/server.c index 88b140979..49b2b4e34 100644 --- a/src/update/server.c +++ b/src/update/server.c @@ -8,6 +8,7 @@ */ #include +#include #include #ifdef AFS_AIX32_ENV #include @@ -26,6 +27,16 @@ #include #include #endif +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#endif +#endif +#ifdef HAVE_UNISTD_H +#include +#endif #include #include #include @@ -36,11 +47,13 @@ #include #include +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 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; } diff --git a/src/update/utils.c b/src/update/utils.c index 443cbe770..ba18659d3 100644 --- a/src/update/utils.c +++ b/src/update/utils.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include "global.h" @@ -17,8 +18,21 @@ #include #endif #include +#ifdef HAVE_STRINGS_H +#include +#else +#ifdef HAVE_STRING_H +#include +#endif +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#include +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; diff --git a/src/usd/Makefile b/src/usd/Makefile index fa048526b..a6cdad63f 100644 --- a/src/usd/Makefile +++ b/src/usd/Makefile @@ -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 diff --git a/src/usd/NTMakefile b/src/usd/NTMakefile index 749487383..2fad477ec 100644 --- a/src/usd/NTMakefile +++ b/src/usd/NTMakefile @@ -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 diff --git a/src/util/Makefile b/src/util/Makefile index cb021f421..95acedf5e 100644 --- a/src/util/Makefile +++ b/src/util/Makefile @@ -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 diff --git a/src/util/NTMakefile b/src/util/NTMakefile index 0d25e0cc5..04fde9ecd 100644 --- a/src/util/NTMakefile +++ b/src/util/NTMakefile @@ -57,3 +57,8 @@ $(LIBFILE): $(LIBOBJS) install: $(INCFILES) $(LIBFILE) + +install9x: install + +clean:: + $(DEL) $(LIBFILE) \ No newline at end of file diff --git a/src/util/afsutil.h b/src/util/afsutil.h index faf824649..2363ecf8f 100644 --- a/src/util/afsutil.h +++ b/src/util/afsutil.h @@ -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 +#endif /* _MFC_VER */ /* Initialize the windows sockets before calling networking routines. */ extern int afs_winsockInit(void); diff --git a/src/util/flipbase64.c b/src/util/flipbase64.c index 20c3c0963..e2977f9f4 100644 --- a/src/util/flipbase64.c +++ b/src/util/flipbase64.c @@ -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 diff --git a/src/util/hostparse.c b/src/util/hostparse.c index f0ba15769..b9b8e2fc4 100644 --- a/src/util/hostparse.c +++ b/src/util/hostparse.c @@ -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. diff --git a/src/util/serverLog.c b/src/util/serverLog.c index 079c7d200..d7375aa7b 100644 --- a/src/util/serverLog.c +++ b/src/util/serverLog.c @@ -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, ...) { diff --git a/src/util/snprintf.c b/src/util/snprintf.c index 0b716f2b8..ef6c5110c 100644 --- a/src/util/snprintf.c +++ b/src/util/snprintf.c @@ -1,14 +1,14 @@ /* snprintf.c - Formatted, length-limited print to a string */ #include -#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 #include #include #include #include #include -#if defined(AFS_AIX32_ENV) +#if defined(AFS_AIX32_ENV) || defined(AFS_SUN55_ENV) #include #endif diff --git a/src/util/volparse.c b/src/util/volparse.c index 33cbb69c5..bad8961bb 100644 --- a/src/util/volparse.c +++ b/src/util/volparse.c @@ -12,12 +12,15 @@ */ #include -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) -#include -#else +#include +#ifdef HAVE_STRINGS_H #include +#else +#ifdef HAVE_STRING_H +#include +#endif #endif -#ifdef AFS_NT40_ENV +#ifdef HAVE_STDLIB_H #include #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); diff --git a/src/venus/fs.c b/src/venus/fs.c index 9de42c6d0..5658da479 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -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"); diff --git a/src/venus/up.c b/src/venus/up.c index de2491826..009203c07 100644 --- a/src/venus/up.c +++ b/src/venus/up.c @@ -15,12 +15,14 @@ /* ************************************************************* */ #include +#include #include #ifdef AFS_AIX32_ENV #include #undef _NONSTD_TYPES #endif #include +#include #include #ifdef AFS_SUN5_ENV #include @@ -35,6 +37,12 @@ #include #undef VIRTUE #undef VICE +#include +#include +#ifdef HAVE_NETINET_IN_H +#include +#endif +#include /* ************************************************************* */ @@ -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; +} diff --git a/src/vfsck/main.c b/src/vfsck/main.c index 7f480e729..ad7e8f7de 100644 --- a/src/vfsck/main.c +++ b/src/vfsck/main.c @@ -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 == '-') { diff --git a/src/viced/Makefile b/src/viced/Makefile index d9f42f7e0..2c5ac08d9 100644 --- a/src/viced/Makefile +++ b/src/viced/Makefile @@ -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 diff --git a/src/viced/host.c b/src/viced/host.c index 19e3bd38c..2d2233b3e 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -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; } } } diff --git a/src/viced/viced.c b/src/viced/viced.c index 06bfa9f2c..b24d1a871 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -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); diff --git a/src/vlserver/Makefile b/src/vlserver/Makefile index aefc0a786..62dba44ac 100644 --- a/src/vlserver/Makefile +++ b/src/vlserver/Makefile @@ -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 diff --git a/src/vlserver/NTMakefile b/src/vlserver/NTMakefile index db4527db6..9f0a5e4b5 100644 --- a/src/vlserver/NTMakefile +++ b/src/vlserver/NTMakefile @@ -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 diff --git a/src/vlserver/vlserver.c b/src/vlserver/vlserver.c index 2ca67961c..d92645a47 100644 --- a/src/vlserver/vlserver.c +++ b/src/vlserver/vlserver.c @@ -174,12 +174,16 @@ char **argv; #endif } else { /* support help flag */ - printf("Usage: vlserver [-p ] [-nojumbo] " #ifndef AFS_NT40_ENV + printf("Usage: vlserver [-p ] [-nojumbo] " "[-syslog[=FACILITY]] " -#endif - /*" [-enable_peer_stats] [-enable_process_stats] " */ + "[-enable_peer_stats] [-enable_process_stats] " "[-help]\n"); +#else + printf("Usage: vlserver [-p ] [-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 */ diff --git a/src/vol/Makefile b/src/vol/Makefile index 72592096e..e3b264b40 100644 --- a/src/vol/Makefile +++ b/src/vol/Makefile @@ -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 diff --git a/src/vol/listinodes.c b/src/vol/listinodes.c index 5222b8c1b..de163cf87 100644 --- a/src/vol/listinodes.c +++ b/src/vol/listinodes.c @@ -72,7 +72,7 @@ int *forcep, forceR; #ifdef AFS_SUN5_ENV #include #else -#if defined(AFS_DARWIN_ENV) +#if !defined(AFS_DARWIN_ENV) #include #endif #endif diff --git a/src/vol/namei_ops.c b/src/vol/namei_ops.c index 4694ed363..e878c4473 100644 --- a/src/vol/namei_ops.c +++ b/src/vol/namei_ops.c @@ -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) diff --git a/src/vol/volume.c b/src/vol/volume.c index 2032ff2ff..dbb620a5a 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -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; } } diff --git a/src/volser/Makefile b/src/volser/Makefile index fb63eb63a..629f42775 100644 --- a/src/volser/Makefile +++ b/src/volser/Makefile @@ -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 diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 9dee487f1..554b40fa3 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -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; } diff --git a/src/volser/vos.c b/src/volser/vos.c index 880171530..a27f4b744 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -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"); diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index 45e37864a..526dac114 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -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); diff --git a/src/volser/vsutils.c b/src/volser/vsutils.c index 0c0a33a50..f4ebab26d 100644 --- a/src/volser/vsutils.c +++ b/src/volser/vsutils.c @@ -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, -- 2.39.5