mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 06:50:12 +00:00
rxk5-1557-20090510
LICENSE IPL10 FIXES n/a Update rxk5 branch to 1.5.59.
This commit is contained in:
parent
c31c836935
commit
eea5959d74
@ -7,5 +7,10 @@
|
||||
|
||||
all:
|
||||
cd src/libafs && $(MAKE)
|
||||
|
||||
clean:
|
||||
cd src/libafs && $(MAKE) clean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile src/config/Makefile.config src/config/Makefile.version \
|
||||
src/libafs/Makefile.common src/libafs/Makefile
|
||||
|
@ -235,7 +235,7 @@ tptserver: cmd comerr ptserver tubik libafsrpc libafsauthent
|
||||
echo Not building MT ptserver for ${SYS_NAME} ;; \
|
||||
esac
|
||||
|
||||
kauth: cmd comerr ubik cmd auth comerr ptserver audit libacl kauth_depinstall
|
||||
kauth: cmd comerr ubik cmd auth comerr ptserver audit libacl kauth_depinstall sys_depinstall
|
||||
${COMPILE_PART1} kauth ${COMPILE_PART2}
|
||||
|
||||
dauth: cmd comerr ubik cmd auth $(KAUTH) comerr
|
||||
|
163
README.RXK5
Normal file
163
README.RXK5
Normal file
@ -0,0 +1,163 @@
|
||||
RXK5
|
||||
|
||||
"rxk5" is a kerberos 5 based replacement for rxkad.
|
||||
See src/rxk5/README for more detailed information on rxk5 design.
|
||||
|
||||
To use rxk5 with openafs,
|
||||
/1/ build (see notes below)
|
||||
/2/ install on servers.
|
||||
/3/ create a service principal:
|
||||
|
||||
afs-k5/<cell-name>@<realm-name>
|
||||
|
||||
make sure you only select encryption types supported by your
|
||||
servers.
|
||||
|
||||
/4/ extract and install this service principal's key in:
|
||||
${afsconfdir}/afs.keytab
|
||||
(where ${afsconfdir} might be something like
|
||||
/etc/openaf/server or /usr/afs/etc)
|
||||
on each db server and file server in your cell.
|
||||
You must do this by hand: there are no provisions (yet?)
|
||||
in bosserver to maintain keytabs or k5 principals or
|
||||
k5 configuration.
|
||||
|
||||
If you don't want to support rxkad, remove your
|
||||
KeyFile. You can run both rxkad & rxk5 in parallel,
|
||||
in which case, you should not remove this file.
|
||||
You can remove it later after you have finished migrating
|
||||
all of your clients.
|
||||
|
||||
/5/ if you are supporting multiple "local" kerberos realms,
|
||||
create ${afsconfdir}/krb.conf
|
||||
and list all your local kerberos realm realms on the first
|
||||
line. Your preferred realm should probably be listed first.
|
||||
If you do not have this file, your local realm is
|
||||
your cell name upper-cased. When mapping names into
|
||||
pt names, this file controls which ones are not considered
|
||||
to be "foreign" principals, so you want to get this right.
|
||||
|
||||
/6/ UserList file: ${afsconfdir}/UserList .
|
||||
For now for rxk5: if you have names with instances: you
|
||||
must list them as user/foo or user/foo@realm .
|
||||
There are a number of issues with this; this logic
|
||||
may change in the future.
|
||||
|
||||
/7/ for openafs + rxk5, it's more important to make sure that
|
||||
afs host to realm mapping work right for all your cell db servers.
|
||||
This is particularly an issue on the clients, but
|
||||
many of the choices are global.
|
||||
|
||||
* If possible: your realm-name should be the uppercase of your cell name.
|
||||
|
||||
* If possible: your kerberos realm should at least be upper-case.
|
||||
|
||||
* If possible: your db servers should have dns names exactly like:
|
||||
<hostname>.<realm-name>
|
||||
|
||||
Especially if the above aren't true then:
|
||||
|
||||
* dns configuration:
|
||||
|
||||
In DNS, you should have host realm mapping txt records,
|
||||
something like:
|
||||
_kerberos.<xxx> TXT REALM-NAME
|
||||
where <xxx> matches the last N elements of your host name.
|
||||
(the krb5 library will start with the fqdn of your "first
|
||||
db server, then strip leading elements off one by one
|
||||
until a _kerberos record is found.
|
||||
The realm-name should NOT be . terminated, and case matters.
|
||||
|
||||
you may also want:
|
||||
afsdb records for your cell pointing to your db servers.
|
||||
_kerberos._udp.<realm> srv records for your kerberos kdcs.
|
||||
|
||||
* krb5.conf configuration:
|
||||
|
||||
[domain_realm] stanza:
|
||||
For your local environment, you should use this to map
|
||||
your local domains into your local kerberos realms,
|
||||
perhaps also favoured foreign domains & realms.
|
||||
Listing this can speed performance and improve security.
|
||||
|
||||
[libdefaults] stanza:
|
||||
Do NOT have this line: default_etypes = des-cbc-crc
|
||||
|
||||
With dns_lookup_realm = 0,
|
||||
you will disable DNS host_realm mappings. This is
|
||||
the default with MIT.If you set this to 1, you enable
|
||||
this, which is the default with Heimdal. Enabling this
|
||||
might slow down host realm mapping logic, but give better
|
||||
data for cells outside your local environment.
|
||||
|
||||
Client side, run-time.
|
||||
Tools generally support the following:
|
||||
|
||||
-localauth -k5 use local keytab, be "god", rxk5
|
||||
-localauth -k4 use local keyfile, be "god", rxkad
|
||||
-localauth keytab if possible, else keyfile, else noauth
|
||||
-k5 use k5 credentials cache, rxk5
|
||||
-ktc (?) use ktc, rxk5 or rxkad. XXX not yet implemented.
|
||||
-noauth none of the above
|
||||
|
||||
Tools default to either -k5 or -ktc.
|
||||
XXX may be compile time option?
|
||||
To alter the default, set
|
||||
AFS_RXK5_DEFAULT
|
||||
if set to 1 or yes, forces use of k5 credentials cache,
|
||||
otherwise, forces use of ktc.
|
||||
See notes above on host to realm mapping before defaulting
|
||||
to -k5. If you need to use "-k" on aklog, -k5 on other
|
||||
commands will not work.
|
||||
XXX why can't other tools look for afs-k5/<cell-name>@arbitrary-realm?
|
||||
|
||||
Build configuration.
|
||||
|
||||
OS & hardware choices:
|
||||
rxk5 + openafs has been developed and should work best on i386 linux 2.4, 2.6.
|
||||
Building and testing for other unix-like architectures is in progress;
|
||||
solaris or aix may be possibilities for you. A Windows port of rxk5
|
||||
is provided, be advised it has received less testing. To build on
|
||||
Windows a recent MIT KFW development environment is required
|
||||
(3.2+). These versions include and export ticket-decoding
|
||||
routines required by rxk5.
|
||||
|
||||
possible kerberos libraries:
|
||||
heimdal
|
||||
I've used 0.6.4 in the past. I currently use "CVS head"
|
||||
as of 20060410, which I recommend in preference to 0.6.4
|
||||
or 0.7.2.
|
||||
configure openafs with:
|
||||
--enable-rxk5
|
||||
--with-krb5-conf=.../krb5-conf
|
||||
|
||||
MIT k5
|
||||
not recommended for now. The MIT folks have indicated
|
||||
they may be willing to support a suitable interface
|
||||
in some future version of MIT k5. For now, do not use
|
||||
unless you are willing to patch, build, and support kerberos.
|
||||
See note in src/rxk5/README for more information.
|
||||
|
||||
shishi
|
||||
"alpha" quality. Shishi is GPL not LGPL; so there
|
||||
are probably severe licensing problems if you share
|
||||
code built with this. You'll have to patch openafs to
|
||||
make this work; run-time configuration will be special as well.
|
||||
If you succeed and find it useful: please submit BSD or IPL
|
||||
compatible patches and documentation to the openafs community.
|
||||
|
||||
k5ssl (standalone)
|
||||
k5ssl is a partial kerberos implementation inside of openafs.
|
||||
It's always used inside the cache manager with its own private
|
||||
crypto library. If you supply real openssl libraries, this
|
||||
can also be used with the rest of openafs. Since openssl
|
||||
supports hardware accelleration, this may be particularly useful
|
||||
and attractive for the afs server. Note that the 524 functionality
|
||||
of aklog is not available with k5ssl.
|
||||
configure openafs with:
|
||||
--with-ssl [=path...]
|
||||
--with-krb5
|
||||
|
||||
-Marcus Watts
|
||||
University of Michigan ITCS UMCE
|
||||
Mon Sep 4 03:34:05 EDT 2006
|
19
acinclude.m4
19
acinclude.m4
@ -313,6 +313,17 @@ dnl Various compiler setup.
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_SIGNAL
|
||||
AC_TYPE_SOCKLEN_T
|
||||
AC_CHECK_TYPES(sig_t, , ,
|
||||
[#include <sys/types.h>
|
||||
#include <signal.h> ])
|
||||
AH_BOTTOM(
|
||||
[#ifndef HAVE_SIG_T
|
||||
#ifndef SIG_T_DEFINED
|
||||
#define SIG_T_DEFINED
|
||||
typedef RETSIGTYPE (*sig_t) ();
|
||||
#endif
|
||||
#endif])
|
||||
COMPILER_HAS_FUNCTION_MACRO
|
||||
|
||||
dnl Checks for programs.
|
||||
@ -828,6 +839,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
|
||||
LINUX_KMEM_CACHE_INIT
|
||||
LINUX_HAVE_GRAB_CACHE_PAGE_WRITE_BEGIN
|
||||
LINUX_STRUCT_TASK_HAS_CRED
|
||||
LINUX_STRUCT_PROC_DIR_ENTRY_HAS_OWNER
|
||||
LINUX_HAVE_KMEM_CACHE_T
|
||||
LINUX_KMEM_CACHE_CREATE_TAKES_DTOR
|
||||
dnl XXX ask about LINUX_KERNEL_HAS_NFSSRV
|
||||
@ -899,6 +911,7 @@ dnl XXX ask about LINUX_KERNEL_HAS_NFSSRV
|
||||
LINUX_REFRIGERATOR
|
||||
LINUX_LINUX_KEYRING_SUPPORT
|
||||
LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK
|
||||
LINUX_KEY_ALLOC_NEEDS_CRED
|
||||
LINUX_DO_SYNC_READ
|
||||
LINUX_GENERIC_FILE_AIO_READ
|
||||
LINUX_INIT_WORK_HAS_DATA
|
||||
@ -906,6 +919,10 @@ dnl XXX ask about LINUX_KERNEL_HAS_NFSSRV
|
||||
LINUX_SYSCTL_TABLE_CHECKING
|
||||
LINUX_HAVE_IGET
|
||||
LINUX_HAVE_I_SIZE_READ
|
||||
LINUX_HAVE_D_ALLOC_ANON
|
||||
if test "x$ac_cv_linux_d_alloc_anon" = "xno"; then
|
||||
AC_DEFINE([AFS_NONFSTRANS], 1, [define to disable the nfs translator])
|
||||
fi
|
||||
LINUX_FS_STRUCT_NAMEIDATA_HAS_PATH
|
||||
LINUX_EXPORTS_INIT_MM
|
||||
LINUX_EXPORTS_SYS_CHDIR
|
||||
@ -1552,7 +1569,7 @@ AC_HEADER_DIRENT
|
||||
AC_CHECK_HEADERS(stdlib.h string.h unistd.h poll.h fcntl.h sys/time.h sys/file.h)
|
||||
AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h)
|
||||
AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h sys/fstyp.h)
|
||||
AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h poll.h)
|
||||
AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h poll.h sys/pag.h)
|
||||
AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h sys/user.h)
|
||||
AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h regex.h values.h)
|
||||
AC_CHECK_HEADERS(linux/errqueue.h,,,[#include <linux/types.h>])
|
||||
|
67
config.guess
vendored
67
config.guess
vendored
@ -1,10 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
|
||||
# Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2006-03-13'
|
||||
timestamp='2008-01-23'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@ -56,8 +56,8 @@ version="\
|
||||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@ -161,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
arm*) machine=arm-unknown ;;
|
||||
sh3el) machine=shl-unknown ;;
|
||||
sh3eb) machine=sh-unknown ;;
|
||||
sh5el) machine=sh5le-unknown ;;
|
||||
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
|
||||
esac
|
||||
# The Operating System including object format, if it has switched
|
||||
@ -211,7 +212,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
macppc:MirBSD:*:*)
|
||||
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
|
||||
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:MirBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
|
||||
@ -329,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
i86pc:SunOS:5.*:*)
|
||||
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
|
||||
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
@ -531,7 +532,7 @@ EOF
|
||||
echo rs6000-ibm-aix3.2
|
||||
fi
|
||||
exit ;;
|
||||
*:AIX:*:[45])
|
||||
*:AIX:*:[456])
|
||||
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
|
||||
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
@ -771,6 +772,8 @@ EOF
|
||||
case ${UNAME_MACHINE} in
|
||||
pc98)
|
||||
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
amd64)
|
||||
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
esac
|
||||
@ -778,7 +781,7 @@ EOF
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
exit ;;
|
||||
i*:MINGW*:*)
|
||||
*:MINGW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
exit ;;
|
||||
i*:windows32*:*)
|
||||
@ -788,12 +791,18 @@ EOF
|
||||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit ;;
|
||||
x86:Interix*:[345]*)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
EM64T:Interix*:[345]*)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:Interix*:[3456]*)
|
||||
case ${UNAME_MACHINE} in
|
||||
x86)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
EM64T | authenticamd)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
IA64)
|
||||
echo ia64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
esac ;;
|
||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||
echo i${UNAME_MACHINE}-pc-mks
|
||||
exit ;;
|
||||
@ -827,6 +836,16 @@ EOF
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit ;;
|
||||
arm*:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_EABI__
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
|
||||
fi
|
||||
exit ;;
|
||||
avr32*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
cris:Linux:*:*)
|
||||
@ -945,6 +964,9 @@ EOF
|
||||
x86_64:Linux:*:*)
|
||||
echo x86_64-unknown-linux-gnu
|
||||
exit ;;
|
||||
xtensa*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us. cd to the root directory to prevent
|
||||
@ -987,7 +1009,7 @@ EOF
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
#else
|
||||
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__sun)
|
||||
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
LIBC=gnu
|
||||
#else
|
||||
LIBC=gnuaout
|
||||
@ -1203,6 +1225,15 @@ EOF
|
||||
SX-6:SUPER-UX:*:*)
|
||||
echo sx6-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-7:SUPER-UX:*:*)
|
||||
echo sx7-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-8:SUPER-UX:*:*)
|
||||
echo sx8-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-8R:SUPER-UX:*:*)
|
||||
echo sx8r-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
Power*:Rhapsody:*:*)
|
||||
echo powerpc-apple-rhapsody${UNAME_RELEASE}
|
||||
exit ;;
|
||||
@ -1453,9 +1484,9 @@ This script, last modified $timestamp, has failed to recognize
|
||||
the operating system you are using. It is advised that you
|
||||
download the most up to date version of the config scripts from
|
||||
|
||||
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
|
||||
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
|
||||
and
|
||||
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
|
||||
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
|
||||
|
||||
If the version you run ($0) is already up to date, please
|
||||
send the following data and any information you think might be
|
||||
|
@ -1,5 +1,5 @@
|
||||
AC_INIT(src/libafs/Makefile.common.in)
|
||||
AM_INIT_AUTOMAKE(openafs-libafs,1.5.57)
|
||||
AM_INIT_AUTOMAKE(openafs-libafs,1.5.59)
|
||||
AC_CONFIG_HEADER(src/config/afsconfig.h)
|
||||
MACOS_VERSION="$VERSION"
|
||||
LINUX_PKGVER="$VERSION"
|
||||
|
@ -1,4 +1,4 @@
|
||||
AC_INIT(openafs,1.5.57)
|
||||
AC_INIT(openafs,1.5.59)
|
||||
AC_CONFIG_SRCDIR(src/config/stds.h)
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_CONFIG_HEADER(src/config/afsconfig.h)
|
||||
@ -12,7 +12,7 @@ AC_SUBST(LINUX_PKGVER)
|
||||
AC_SUBST(LINUX_PKGREL)
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PATH_PROGS([PATH_CPP], [cpp], , [$PATH:/lib:/usr/ccs/lib])
|
||||
AC_PATH_PROGS([PATH_CPP], [cpp], [${CC-cc} -E], [$PATH:/lib:/usr/ccs/lib])
|
||||
AC_SUBST([PATH_CPP])
|
||||
OPENAFS_CONFIGURE_COMMON
|
||||
|
||||
|
@ -247,7 +247,6 @@ Known Problems
|
||||
restorevol
|
||||
rmtsysd
|
||||
tokens.krb
|
||||
vos setfields
|
||||
vsys
|
||||
|
||||
* Add -noresolve to the documentation of all the vos commands.
|
||||
|
@ -90,6 +90,10 @@ A command to report Volume Server status: B<vos status>.
|
||||
|
||||
=item *
|
||||
|
||||
A command to change volume fields: B<vos setfields>.
|
||||
|
||||
=item *
|
||||
|
||||
Commands to obtain help: B<vos apropos> and B<vos help>.
|
||||
|
||||
=back
|
||||
@ -211,6 +215,13 @@ command is issued.
|
||||
The B<-fromserver> and B<-toserver> arguments to the B<vos move> command
|
||||
also accept these name formats.
|
||||
|
||||
=item B<-noresolve>
|
||||
|
||||
Shows all servers as IP addresses instead of the DNS name. This is very
|
||||
useful when the server address is registered as 127.0.0.1 or when dealing
|
||||
with multi-homed servers. The B<-noresolve> option is available in OpenAFS
|
||||
versions 1.4.8 or later and 1.5.35 or later.
|
||||
|
||||
=item B<-verbose>
|
||||
|
||||
Produces on the standard output stream a detailed trace of the command's
|
||||
@ -261,6 +272,7 @@ L<vos_remove(1)>,
|
||||
L<vos_remsite(1)>,
|
||||
L<vos_rename(1)>,
|
||||
L<vos_restore(1)>,
|
||||
L<vos_setfields(1)>,
|
||||
L<vos_shadow(1)>,
|
||||
L<vos_size(1)>,
|
||||
L<vos_status(1)>,
|
||||
|
@ -170,7 +170,15 @@ expressed in kilobyte blocks in the C<MaxQuota> field.
|
||||
|
||||
The date and time the volume was created, in the C<Creation> field. If the
|
||||
volume has been restored with the B<backup diskrestore>, B<backup
|
||||
volrestore>, or B<vos restore> command, this is the restore time.
|
||||
volrestore>, or B<vos restore> command, this is the restore time. For a
|
||||
read-only volume, this is the last release time.
|
||||
|
||||
=item *
|
||||
|
||||
The date and time this copy of this volume was created, in the C<Copy>
|
||||
field. This is the time when the volume was created on this server and
|
||||
partition. For read-only volumes, it is not updated by a release (unlike
|
||||
the Creation date). The copy date is not stored in volume dumps.
|
||||
|
||||
=item *
|
||||
|
||||
@ -305,6 +313,7 @@ shows the volume as locked.
|
||||
RWrite 5360870981 ROnly 536870982 Backup 536870983
|
||||
MaxQuota 40000 K
|
||||
Creation Mon Jun 12 15:22:06 1989
|
||||
Copy Mon Jun 12 15:22:06 1989
|
||||
Last Update Fri Jun 16 09:34:35 1989
|
||||
5719 accesses in the past day (i.e., vnode references)
|
||||
RWrite: 5360870981 ROnly: 536870982 Backup: 536870983
|
||||
@ -323,6 +332,7 @@ the B<-extended> flag. The volume has no read-only replication sites.
|
||||
RWrite 354287190 ROnly 0 Backup 354287192
|
||||
MaxQuota 5000 K
|
||||
Creation Wed Nov 25 17:38:57 1992
|
||||
Copy Wed Nov 25 17:38:57 1992
|
||||
Last Update Tue Dec 15 10:46:20 1992
|
||||
598 accesses in the past day (i.e., vnode references)
|
||||
Raw Read/Write Stats
|
||||
|
142
doc/man-pages/pod1/vos_setfields.pod
Normal file
142
doc/man-pages/pod1/vos_setfields.pod
Normal file
@ -0,0 +1,142 @@
|
||||
=head1 NAME
|
||||
|
||||
vos_setfields - Sets the quota or clear the access counter on a volume.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
=for html
|
||||
<div class="synopsis">
|
||||
|
||||
B<vos setfields> S<<< B<-id> <I<volume name or ID>> >>>
|
||||
S<<< B<-maxquota> <I<quota (KB)>> >>> [B<-clearuse>]
|
||||
S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-localauth>]
|
||||
[B<-verbose>] [B<-encrypt>] [b<-noresolve>] [B<-help>]
|
||||
|
||||
B<vos se> S<<< B<-id> <I<volume name or ID>> >>>
|
||||
S<<< B<-maxquota> <I<quota (KB)>> >>> [B<-clearuse>]
|
||||
S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-localauth>]
|
||||
[B<-verbose>] [B<-encrypt>] [b<-noresolve>] [B<-help>]
|
||||
|
||||
=for html
|
||||
</div>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The B<vos setfields> command can set the quota on a volume, and it can
|
||||
clear the access counter on a volume. This command differs from
|
||||
B<fs setquota> because only the volume name is needed to set the quota,
|
||||
whereas the path to the volume is needed with B<fs setquota>.
|
||||
|
||||
If the B<-maxquota> and B<-clearuse> flags are missing, then no action is
|
||||
taken.
|
||||
|
||||
=head1 CAUTIONS
|
||||
|
||||
This command is not effective on read-only or backup volumes.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<-id> <I<volume name or id>>
|
||||
|
||||
Identifies the volume on which to operate, either by its complete name or
|
||||
volume ID number.
|
||||
|
||||
=item B<-maxquota> <I<cell name>>
|
||||
|
||||
Sets the maximum amount of file server disk space the volume can
|
||||
occupy. Specify the number of one-kilobyte blocks as a positive integer
|
||||
(C<1024> is one megabyte). A value of C<0> sets an unlimited quota, but
|
||||
the size of the disk partition that houses the volume places an absolute
|
||||
limit on the volume's size.
|
||||
|
||||
=item B<-clearuse>
|
||||
|
||||
Clears the access counter on a volumes, which is shown as C<X accesses in
|
||||
the past day (i.e., vnode references)> in the B<vos examine> output.
|
||||
|
||||
=item B<-cell> <I<cell name>>
|
||||
|
||||
Names the cell in which to run the command. Do not combine this argument
|
||||
with the B<-localauth> flag. For more details, see L<vos(1)>.
|
||||
|
||||
=item B<-noauth>
|
||||
|
||||
Assigns the unprivileged identity C<anonymous> to the issuer. Do not
|
||||
combine this flag with the B<-localauth> flag. For more details, see
|
||||
L<vos(1)>.
|
||||
|
||||
=item B<-localauth>
|
||||
|
||||
Constructs a server ticket using a key from the local
|
||||
F</usr/afs/etc/KeyFile> file. The B<vos> command interpreter presents it
|
||||
to the Volume Server and Volume Location Server during mutual
|
||||
authentication. Do not combine this flag with the B<-cell> argument or
|
||||
B<-noauth> flag. For more details, see L<vos(1)>.
|
||||
|
||||
=item B<-encrypt>
|
||||
|
||||
Encrypts the command so that the operation's results are not transmitted
|
||||
across the network in clear text.
|
||||
|
||||
=item B<-noresolve>
|
||||
|
||||
Shows all servers as IP addresses instead of the DNS name. This is very
|
||||
useful when the server address is registered as 127.0.0.1 or when dealing
|
||||
with multi-homed servers. The B<-noresolve> option is available in OpenAFS
|
||||
versions 1.4.8 or later and 1.5.35 or later.
|
||||
|
||||
=item B<-verbose>
|
||||
|
||||
Produces on the standard output stream a detailed trace of the command's
|
||||
execution. If this argument is omitted, only warnings and error messages
|
||||
appear.
|
||||
|
||||
=item B<-help>
|
||||
|
||||
Prints the online help for this command. All other valid options are
|
||||
ignored.
|
||||
|
||||
=back
|
||||
|
||||
=head1 OUTPUT
|
||||
|
||||
This command produces no output other than error messages.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
To set a 123KB quota on the root.cell volume, the following command may be
|
||||
used:
|
||||
|
||||
% vos setfields -id root.cell -maxquota 123
|
||||
|
||||
To clear the access counter on the root.cell volume, use the following
|
||||
command:
|
||||
|
||||
% vos setfields -id root.cell -clearuse
|
||||
|
||||
The above commands may be combined as follows:
|
||||
|
||||
% vos setfields -id root.cell -maxquota 123 -clearuse
|
||||
|
||||
=head1 PRIVILEGE REQUIRED
|
||||
|
||||
The issuer must be listed in the F</usr/afs/etc/UserList> file on the
|
||||
machine specified with the B<-server> argument and on each database server
|
||||
machine. If the B<-localauth> flag is included, the issuer must instead be
|
||||
logged on to a server machine as the local superuser C<root>.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<fs_setquota(1)>,
|
||||
L<vos(1)>,
|
||||
L<vos_examine(1)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2009 Jason Edgecombe <jason@rampaginggeek.com>
|
||||
|
||||
This documentation is covered by the BSD License as written in the
|
||||
doc/LICENSE file. This man page was written by Jason Edgecombe for
|
||||
OpenAFS.
|
73
doc/man-pages/pod5/afs.keytab.pod
Normal file
73
doc/man-pages/pod5/afs.keytab.pod
Normal file
@ -0,0 +1,73 @@
|
||||
=head1 NAME
|
||||
|
||||
afs.keytab - Contains AFS server encryption keys
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The F<afs.keytab> file defines the server encryption keys that the AFS server
|
||||
processes running on the machine use to decrypt the tickets presented by
|
||||
clients using rxk5. AFS server processes
|
||||
perform privileged actions only for clients that possess a ticket
|
||||
encrypted with one of the entries from the file.
|
||||
The file must reside in the
|
||||
F</usr/afs/etc> directory on every server machine.
|
||||
If the keytab does not exist when a server process starts up,
|
||||
that process will decide not to accept any authentication, at least via rxk5.
|
||||
This is almost never desirable.
|
||||
For more detailed
|
||||
information on mutual authentication and server encryption keys, see the
|
||||
I<OpenAFS Administration Guide>.
|
||||
|
||||
Each key has a corresponding a key version number that distinguishes it
|
||||
from the other keys. The tickets that clients present are also marked with
|
||||
a service principal and key version number to tell the server process which
|
||||
key to use to decrypt it. The F<afs.keytab> file must always include the
|
||||
same principals, keys, and key versions as the corresponding entries in
|
||||
the realm's kerberos 5 database.
|
||||
|
||||
The F<afs.keytab> file is in binary format, so always use the appropriate
|
||||
commands from kerberos to administer it:
|
||||
|
||||
=over 4
|
||||
|
||||
=item *
|
||||
|
||||
The B<kadmin> command to define a new key.
|
||||
|
||||
=item *
|
||||
|
||||
The B<klist> command to display the keys.
|
||||
|
||||
=item *
|
||||
|
||||
The B<ktutil> command to remove a key from the file.
|
||||
|
||||
=back
|
||||
|
||||
This file should contain service principals that are named
|
||||
afs-k5/I<cell-name>@I<realm-name> .
|
||||
cell-name should be in lower-case; realm-name should be your kerberos
|
||||
5 realm, normally the upper-case version of the cell name.
|
||||
|
||||
You can update the keytab at any time, even while server processes are running.
|
||||
You may need to restart server processes if the keytab did not exist
|
||||
when they were started.
|
||||
|
||||
In cells that use the Update Server to distribute the contents of the
|
||||
F</usr/afs/etc> directory, it is customary to edit only the copy of the
|
||||
file stored on the system control machine. Otherwise, edit the file on
|
||||
each server machine individually.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<klist(1)>,
|
||||
L<kadmin(8)>,
|
||||
L<ktutil(8)>,
|
||||
L<upclient(8)>,
|
||||
L<upserver(8)>
|
||||
|
||||
I<OpenAFS Administration Guide>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
See L<umich.copyright(8)>.
|
@ -29,6 +29,7 @@ B<afsd> [B<-afsdb>] [B<-backuptree>]
|
||||
[B<-settime>] [B<-shutdown>]
|
||||
S<<< [B<-splitcache> <I<RW/RO ratio>>] >>>
|
||||
S<<< [B<-stat> <I<number of stat entries>>] >>> [B<-verbose>]
|
||||
[B<-disable-dynamic-vcaches>]
|
||||
S<<< [B<-volumes> <I<number of volume entries>>] >>>
|
||||
[B<-waitclose>]
|
||||
|
||||
@ -669,6 +670,13 @@ standard output stream.
|
||||
Specifies the number of memory structures to allocate for storing volume
|
||||
location information. The default value is C<50>.
|
||||
|
||||
=item B<-disable-dynamic-vcaches>
|
||||
|
||||
By default, dynamic vcache overrides the B<-stat> option by using the value of
|
||||
B<-stat> (or the default) as the initial size of the stat (or vcache) pool and
|
||||
increases the pool dynamically as needed on supported platforms. This flag will
|
||||
disable this new functionality and honor the '-stat' setting.
|
||||
|
||||
=item B<-waitclose>
|
||||
|
||||
Has no effect on the operation of the Cache Manager. The behavior it
|
||||
|
@ -102,11 +102,13 @@ Salvager by default salvages them serially to avoid the inefficiency of
|
||||
constantly moving the disk head from one partition to another. However,
|
||||
this strategy is often not ideal if the partitions are configured as
|
||||
logical volumes that span multiple disks. To force the Salvager to salvage
|
||||
logical volumes in parallel, provide the string C<all> as the value for
|
||||
the B<-parallel> argument. Provide a positive integer to specify the
|
||||
number of subprocesses to run in parallel (for example, C<-parallel 5all>
|
||||
for five subprocesses), or omit the integer to run up to four
|
||||
subprocesses, depending on the number of logical volumes being salvaged.
|
||||
logical volumes in parallel as if they were on separate disks, provide the
|
||||
string C<all> as the value for the B<-parallel> argument.
|
||||
|
||||
To set both parameters at the same time, append the number of Salvager
|
||||
processes to the string C<all>. For example, C<-parallel all5> treats
|
||||
each partition as a separate disk and runs five Salvager processes, thus
|
||||
salvaging five partitions at a time.
|
||||
|
||||
The Salvager creates temporary files as it runs, by default writing them
|
||||
to the partition it is salvaging. The number of files can be quite large,
|
||||
@ -230,7 +232,7 @@ volumes. Use this value only with such logical volumes.
|
||||
The BOS Server never starts more Salvager subprocesses than there are
|
||||
partitions, and always starts only one process to salvage a single
|
||||
volume. If this argument is omitted, up to four Salvager subprocesses run
|
||||
in parallel.
|
||||
in parallel but partitions on the same device are salvaged serially.
|
||||
|
||||
=item B<-tmpdir> <I<name of dir to place tmp files>>
|
||||
|
||||
|
38
doc/man-pages/pod8/umich.copyright.pod
Normal file
38
doc/man-pages/pod8/umich.copyright.pod
Normal file
@ -0,0 +1,38 @@
|
||||
=head1 NAME
|
||||
|
||||
umich.copyright - omnibus copyright.
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
All-purpose copyright statement, because online help
|
||||
should not be an excuse to spew out a long legal manifesto.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright (c) 2005
|
||||
The Regents of the University of Michigan
|
||||
ALL RIGHTS RESERVED
|
||||
|
||||
Permission is granted to use, copy, create derivative works
|
||||
and redistribute this software and such derivative works
|
||||
for any purpose, so long as the name of the University of
|
||||
Michigan is not used in any advertising or publicity
|
||||
pertaining to the use or distribution of this software
|
||||
without specific, written prior authorization. If the
|
||||
above copyright notice or any other identification of the
|
||||
University of Michigan is included in any copy of any
|
||||
portion of this software, then the disclaimer below must
|
||||
also be included.
|
||||
|
||||
This software is provided as is, without representation
|
||||
from the University of Michigan as to its fitness for any
|
||||
purpose, and without warranty by the University of
|
||||
Michigan of any kind, either express or implied, including
|
||||
without limitation the implied warranties of
|
||||
merchantability and fitness for a particular purpose. The
|
||||
regents of the University of Michigan shall not be liable
|
||||
for any damages, including special, indirect, incidental, or
|
||||
consequential damages, with respect to any claim arising
|
||||
out of or in connection with the use of the software, even
|
||||
if it has been or is hereafter advised of the possibility of
|
||||
such damages.
|
@ -8,7 +8,7 @@ vldb_check - Checks the integrity of the VLDB
|
||||
<div class="synopsis">
|
||||
|
||||
B<vldb_check> S<<< B<-database> <I<vldb file>> >>> [B<-uheader>] [B<-vheader>]
|
||||
[B<-servers>] [B<-entries>] [B<-verbose>] [B<-help>]
|
||||
[B<-servers>] [B<-entries>] [B<-quiet> | B<-verbose>] [B<-help>]
|
||||
|
||||
B<vldb_check> S<<< B<-d> <I<vldb file>> >>> [B<-u>] [B<-vh>] [B<-s>] [B<-e>]
|
||||
[B<-ve>] [B<-h>]
|
||||
@ -60,10 +60,15 @@ registered for each file server machine in the cell.
|
||||
Outputs every volume entry in the database. The information includes the
|
||||
volume's name and the volume ID number for each of its versions.
|
||||
|
||||
=item B<-quiet>
|
||||
|
||||
Blocks output from going to stdout. Output to stderr is not blocked. Cannot
|
||||
be used with -verbose, -uheader, -servers or -entries.
|
||||
|
||||
=item B<-verbose>
|
||||
|
||||
Reports additional information about the database, including the number of
|
||||
entries for each type of volume.
|
||||
entries for each type of volume. Cannot be used with -quiet.
|
||||
|
||||
=item B<-help>
|
||||
|
||||
@ -81,6 +86,16 @@ additional information as described for each option in L<OPTIONS>. The
|
||||
output is intended for debugging purposes and is meaningful to someone
|
||||
familiar with the internal structure of the VLDB.
|
||||
|
||||
The B<-quiet> option can be used to supress the standard output stream
|
||||
so that the command can be used more easily inside scripts.
|
||||
|
||||
The command exits with one of the following completion codes:
|
||||
|
||||
0: No errors or warnings have been encountered.
|
||||
1: One or more warnings encountered.
|
||||
2: One or more warnings and/or errors encountered.
|
||||
4: A fatal or internal error has occurred and the program cannot proceed.
|
||||
|
||||
=head1 PRIVILEGE REQUIRED
|
||||
|
||||
The issuer must be logged in as the local superuser C<root>.
|
||||
|
@ -1,3 +1,120 @@
|
||||
Since 1.5.58
|
||||
* PriorityClass of afsd_service.exe process raised to
|
||||
"High" to match the priority of the system services
|
||||
that are waiting for afsd_service.exe to respond.
|
||||
Configurable using [TransarcAFSDaemon\Parameters]
|
||||
DWORD "PriorityClass" value. (use values from Win32
|
||||
API)
|
||||
|
||||
* Change error reporting of CM_ERROR_BADSHARENAME to
|
||||
use the correct error (NTSTATUS_BAD_NETWORK_PATH).
|
||||
The error we were sending would cause the smb
|
||||
redirector to drop the connection.
|
||||
|
||||
* Change the error reporting of CM_ERROR_ALLOFFLINE
|
||||
and CM_ERROR_ALLDOWN to return NTSTATUS_PATH_NOT_FOUND.
|
||||
Previous we would return Bad Network Path which
|
||||
would cause the smb redirector to cancel all file
|
||||
handles on the same "share".
|
||||
|
||||
* A debug version of afsd_service.exe can now be used
|
||||
with a release version of afsrpc.dll (or vice versa).
|
||||
afsrpc.dll now implements and exports xdr_free().
|
||||
|
||||
* Removed all unprotected OutputDebugString() calls as
|
||||
those calls can block for up to 10 seconds if there
|
||||
is contention for the globally shared memory or if
|
||||
the debugger fails to read data in a timely manner.
|
||||
|
||||
* Visual Studio 2008, WDK 6.1 and DDK 6.1 are now
|
||||
supported for builds. The production releases still
|
||||
use VS 2005.
|
||||
|
||||
Since 1.5.57
|
||||
* Discovered that XP/2003 supports a variant on recvmsg
|
||||
called WSARecvMsg. The input parameters are mostly
|
||||
compatible with the Posix recvmsg. This will save
|
||||
multiple memcpy() calls per received packet.
|
||||
|
||||
* Discovered that Vista/2008 supports a variant on
|
||||
sendmsg called WSASendMsg. The input parameters
|
||||
are mostly compatible with the Posix sendmsg. This
|
||||
will save multiple memcpy() calls per sent packet.
|
||||
|
||||
* Exporting rx_ReadProc32, rx_WriteProc32 from afsrpc.dll
|
||||
and utilizing rx_ReadProc32 from within the cache manager
|
||||
as part of the FetchData operations. rx_ReadProc32 and
|
||||
rx_WriteProc32 are optimized versions of rx_ReadProc and
|
||||
rx_WriteProc for use when reading 32-bit integer values.
|
||||
|
||||
* The Network Identity Manager AFS provider now reports
|
||||
progress events. These provide a better user experience
|
||||
with Network Identity Manager 2.0.
|
||||
|
||||
* [RT 124293] A race condition exists which permits the
|
||||
scp field of the an smb_fid_t object to become invalid
|
||||
after a request on the smb_fid_t has begun. Remove the
|
||||
race by protecting all access to the scp field with the
|
||||
smb_fid_t mx mutex and obtaining a local reference on
|
||||
the cm_scache_t object for the length of the request.
|
||||
|
||||
* [RT 124276] If the vldb is out of sync with the contents
|
||||
of the file servers, afsd_service will retry too many
|
||||
times when a file server reports a volume as not being
|
||||
present. Now if the list reported by the vldb is the
|
||||
same as the previously seen list, then the retry is
|
||||
aborted.
|
||||
|
||||
* [RT 124276] Read-only volume failover was broken in
|
||||
1.5.53 whenever accessing a volume results in VNOVOL or
|
||||
VMOVED.
|
||||
|
||||
* [RT 124276] Prior to 1.3.70 the volume server reference
|
||||
list was not reference counted and would be prematurely
|
||||
freed while in use. When reference counting was added
|
||||
in 1.3.70 a bug was introduced that could result in
|
||||
service reference list corruption.
|
||||
|
||||
* Add Windows Application Event Log warning messages for
|
||||
"Client SMB MPX value too large" and
|
||||
"Client SMB Buffer Size too small".
|
||||
|
||||
* Renaming of files across directory boundaries would result
|
||||
in an invalid handle error when attempting to access the
|
||||
files after the move.
|
||||
|
||||
* Fix the handling of Tran2 Set Path Info RPCs. Do not fail
|
||||
when a smb file descriptor cannot be found. The whole point
|
||||
of using a Path Info function is because an smb file
|
||||
descriptor wasn't allocated.
|
||||
|
||||
* More edge cases in which dynamic addition of Freelance
|
||||
root.afs entries would get the wrong FID or where the
|
||||
root.afs directory would not be refreshed.
|
||||
|
||||
* Buffer overflow could occur if the workstation cell name was
|
||||
longer than 64 characters. Crashes could occur in
|
||||
afscreds.exe, afslogon.dll, and afsd_service.exe.
|
||||
|
||||
* VNOSERVICE and VOFFLINE errors were leaking and were exposed
|
||||
to the smb client.
|
||||
|
||||
* Improve consistency of the bad data version value used for
|
||||
cm_scache fields.
|
||||
|
||||
* Log file server uuid values as part of the cm_server object
|
||||
when available. Dump the cm_server object list in response
|
||||
to "fs memdump".
|
||||
|
||||
* Optimize the performance of resetting access control lists
|
||||
when tokens are set or removed.
|
||||
|
||||
* Fix vos.exe so that it can work with very large volume
|
||||
identifiers
|
||||
|
||||
* Remove symlink recursion tests and increase max symlink count
|
||||
to 64 from 16.
|
||||
|
||||
Since 1.5.56
|
||||
* Undo the "UAC manifest fix" applied to afs_config.exe.
|
||||
|
||||
|
1
src/JAVA/classes/.cvsignore
Normal file
1
src/JAVA/classes/.cvsignore
Normal file
@ -0,0 +1 @@
|
||||
*.class
|
1
src/JAVA/classes/org/openafs/jafs/.cvsignore
Normal file
1
src/JAVA/classes/org/openafs/jafs/.cvsignore
Normal file
@ -0,0 +1 @@
|
||||
*.class
|
204
src/NTMakefile
204
src/NTMakefile
@ -48,91 +48,91 @@ RXK5_HEADERS = rxk5_headers
|
||||
DOCD=call $(SRC)\DOLASTCMP.BAT
|
||||
|
||||
config:
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\config
|
||||
$(CD) $(SRC)\config
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
procmgmt_headers: config
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\procmgmt
|
||||
$(CD) $(SRC)\procmgmt
|
||||
$(NTMAKE_HEADERS)
|
||||
$(CD) ..\..
|
||||
|
||||
afsreg_headers:
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\afsreg
|
||||
$(CD) $(SRC)\WINNT\afsreg
|
||||
$(NTMAKE_HEADERS)
|
||||
$(CD) ..\..\..
|
||||
|
||||
lwp_headers:
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\lwp
|
||||
$(CD) $(SRC)\lwp
|
||||
$(NTMAKE_HEADERS)
|
||||
$(CD) ..\..
|
||||
|
||||
util: procmgmt_headers afsreg_headers lwp_headers
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
comerr: util
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
afs: comerr
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\afs
|
||||
$(CD) $(SRC)\afs
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
cmd: afs
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
afsreg: cmd
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
eventlog: afsreg
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
lwp: eventlog
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
rxgen: lwp
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
des: rxgen
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
! IF (EXIST($(SRC)\des\NTMakefile))
|
||||
$(DOCD) $(SRC)\des
|
||||
$(CD) $(SRC)\des
|
||||
@ -146,503 +146,503 @@ des: rxgen
|
||||
! ENDIF
|
||||
|
||||
rx: des
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
rxdebug: rx
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
ubik_headers: rxdebug
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\ubik
|
||||
$(CD) $(SRC)\ubik
|
||||
$(NTMAKE_HEADERS)
|
||||
$(CD) ..\..
|
||||
|
||||
rxstat: ubik_headers
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
rxkad: rxstat
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
pthread: rxkad
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
afskfw_headers: pthread
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\afskfw
|
||||
$(CD) $(SRC)\WINNT\afskfw
|
||||
$(NTMAKE_HEADERS)
|
||||
$(CD) ..\..\..
|
||||
|
||||
cm_headers: afskfw_headers
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\afsd
|
||||
$(CD) $(SRC)\WINNT\afsd
|
||||
$(NTMAKE_HEADERS)
|
||||
$(CD) ..\..\..
|
||||
|
||||
ptserver_headers: cm_headers
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\ptserver
|
||||
$(CD) $(SRC)\ptserver
|
||||
$(NTMAKE_HEADERS)
|
||||
$(CD) ..\..
|
||||
|
||||
auth_headers: ptserver_headers
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\auth
|
||||
$(CD) $(SRC)\auth
|
||||
$(NTMAKE_HEADERS)
|
||||
$(CD) ..\..
|
||||
|
||||
rxk5_headers: auth_headers
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\rxk5
|
||||
$(CD) $(SRC)\rxk5
|
||||
$(NTMAKE_HEADERS)
|
||||
$(CD) ..\..
|
||||
|
||||
osi_headers: auth_headers
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\client_osi
|
||||
$(CD) $(SRC)\WINNT\client_osi
|
||||
$(NTMAKE_HEADERS)
|
||||
$(CD) ..\..\..
|
||||
|
||||
client_osi: osi_headers
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
afskfw: client_osi $(RXK5_HEADERS)
|
||||
echo ***** $@
|
||||
afskfw: client_osi $(RXK5_HEADERS)
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\afskfw
|
||||
$(CD) $(SRC)\WINNT\afskfw
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
rxk5: afskfw $(RXK5_HEADERS)
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
trxk5: rxk5
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
procmgmt: pthread $(TRXK5)
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
libacl_headers: procmgmt
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\libacl
|
||||
$(CD) $(SRC)\libacl
|
||||
$(NTMAKE_HEADERS)
|
||||
$(CD) ..\..
|
||||
|
||||
vlserver_headers: libacl_headers
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\vlserver
|
||||
$(CD) $(SRC)\vlserver
|
||||
$(NTMAKE_HEADERS)
|
||||
$(CD) ..\..
|
||||
|
||||
fsint: vlserver_headers
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
audit: fsint
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
afsdobjs: audit afskfw
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\afsd
|
||||
$(CD) $(SRC)\WINNT\afsd
|
||||
$(NTMAKE_OBJS)
|
||||
$(CD) ..\..\..
|
||||
|
||||
sys: afsdobjs
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
auth: sys
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
ubik: auth
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
ptserver: ubik
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
libacl: ptserver
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
kauth: libacl
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
vlserver: kauth
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
usd: vlserver
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
bubasics: usd
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
budb: bubasics
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
butm: budb
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
dir: butm
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
vol: dir
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
volser: vol
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
viced: volser
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
update: viced
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
bucoord: update
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
butc: bucoord
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
bozo: butc
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
bosctlsvc: bozo
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
bu_utils: bosctlsvc
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
libafsrpc: bu_utils
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
libafsauthent: libafsrpc
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
tviced: libafsauthent
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
tbutc: tviced
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
talocale: tbutc
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
license: talocale
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
afsd: client_osi license
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
libadmin: afsd
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
adminutil: libadmin
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\libadmin\$@
|
||||
$(CD) $(SRC)\libadmin\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
vos: adminutil
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\libadmin\$@
|
||||
$(CD) $(SRC)\libadmin\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
client: vos
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\libadmin\$@
|
||||
$(CD) $(SRC)\libadmin\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
kas: client
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\libadmin\$@
|
||||
$(CD) $(SRC)\libadmin\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
pts: kas
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\libadmin\$@
|
||||
$(CD) $(SRC)\libadmin\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
bos: pts
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\libadmin\$@
|
||||
$(CD) $(SRC)\libadmin\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
cfg: bos
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\libadmin\$@
|
||||
$(CD) $(SRC)\libadmin\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
admintest: cfg
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\libadmin\test
|
||||
$(CD) $(SRC)\libadmin\test
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
afsadmsvr: admintest
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
afsusrmgr: afsadmsvr
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
afssvrmgr: afsusrmgr
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
afssvrcfg: afssvrmgr
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
afssvrcpa: afssvrcfg
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
client_talocale: afssvrcpa
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\talocale
|
||||
$(CD) $(SRC)\WINNT\talocale
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
client_cpa: client_talocale
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
client_config: client_cpa
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
client_exp: client_config
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
client_creds: client_exp
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
aklog: client_creds
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
|
||||
xstat: aklog
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
netidmgr_plugin: xstat
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
@ -650,25 +650,24 @@ netidmgr_plugin: xstat
|
||||
|
||||
extra: netidmgr_plugin
|
||||
! IF EXIST($(SRC)\WINNT\extra) && EXIST($(SRC)\WINNT\extra\NTMakefile)
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\WINNT\$@
|
||||
$(CD) $(SRC)\WINNT\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..
|
||||
! ELSE
|
||||
echo ***** Skipping $@ ***** Not found.
|
||||
@echo ***** Skipping $@ ***** Not found.
|
||||
! ENDIF
|
||||
|
||||
|
||||
finale: extra
|
||||
echo ***** $@
|
||||
@echo ***** $@
|
||||
$(DOCD) $(SRC)\$@
|
||||
$(CD) $(SRC)\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
install: finale
|
||||
echo Build Finished Successfully
|
||||
|
||||
@echo Build Finished Successfully
|
||||
|
||||
# Clean target for obj tree
|
||||
clean:
|
||||
@ -696,28 +695,33 @@ mkdir:
|
||||
-@copy $(SRC)\config\NTLANG.BAT .
|
||||
|
||||
loopback:
|
||||
echo ***** Making Loopback Adapter Utility DLL
|
||||
@echo ***** Making Loopback Adapter Utility DLL
|
||||
$(DOCD) $(SRC)\WINNT\install\$@
|
||||
$(CD) $(SRC)\WINNT\install\$@
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..\..
|
||||
|
||||
man-pages:
|
||||
echo ***** $@
|
||||
man-pages:
|
||||
@echo ***** $@
|
||||
$(DOCD) $(DOC)\man-pages
|
||||
$(CD) $(DOC)\man-pages
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..
|
||||
|
||||
NSIS: loopback man-pages
|
||||
echo ***** Making NSIS Installer
|
||||
$(DOCD) $(SRC)\WINNT\install\$@
|
||||
$(CD) $(SRC)\WINNT\install\$@
|
||||
NSIS.i386: loopback man-pages
|
||||
@echo ***** Making NSIS Installer
|
||||
$(DOCD) $(SRC)\WINNT\install\NSIS
|
||||
$(CD) $(SRC)\WINNT\install\NSIS
|
||||
$(NTMAKE)
|
||||
$(CD) ..\..\..\..
|
||||
|
||||
NSIS.AMD64:
|
||||
@echo Skipping NSIS Installer on non-x86 platforms; not implemented
|
||||
|
||||
NSIS: NSIS.$(CPU)
|
||||
|
||||
wix: loopback man-pages
|
||||
echo ***** Making Wix MSI Installer
|
||||
@echo ***** Making Wix MSI Installer
|
||||
$(DOCD) $(SRC)\WINNT\install\$@
|
||||
$(CD) $(SRC)\WINNT\install\$@
|
||||
$(NTMAKE)
|
||||
|
@ -38,9 +38,9 @@ BOOL APIENTRY About(HWND, unsigned int, unsigned int, long);
|
||||
#include "cm_diskcache95.h"
|
||||
#endif /* DISKCACHE95 */
|
||||
#include "cm_conn.h"
|
||||
#include "cm_cell.h"
|
||||
#include "cm_aclent.h"
|
||||
#include "cm_server.h"
|
||||
#include "cm_cell.h"
|
||||
#include "cm_volstat.h"
|
||||
#include "cm_volume.h"
|
||||
#include "cm_dcache.h"
|
||||
|
@ -167,7 +167,7 @@ LogEvent(WORD wEventType, DWORD dwEventID, ...)
|
||||
CHAR lpStrings[MAXARGS][STRLEN];
|
||||
WORD wNumArgs = 0;
|
||||
WORD wNumStrings = 0;
|
||||
DWORD code;
|
||||
DWORD code;
|
||||
|
||||
// Ensure that our event source is properly initialized.
|
||||
if (!AddEventSource())
|
||||
@ -209,6 +209,8 @@ LogEvent(WORD wEventType, DWORD dwEventID, ...)
|
||||
break;
|
||||
case MSG_TIME_FLUSH_PER_VOLUME:
|
||||
case MSG_TIME_FLUSH_TOTAL:
|
||||
case MSG_SMB_MAX_MPX_COUNT:
|
||||
case MSG_SMB_MAX_BUFFER_SIZE:
|
||||
wNumArgs = 2;
|
||||
lpArgs[0] = va_arg(listArgs, LPTSTR);
|
||||
lpArgs[1] = va_arg(listArgs, LPTSTR);
|
||||
@ -296,14 +298,14 @@ LogEvent(WORD wEventType, DWORD dwEventID, ...)
|
||||
|
||||
// Log the event.
|
||||
code = ReportEvent(hEventSource, // handle of event source
|
||||
wEventType, // event type
|
||||
0, // event category
|
||||
dwEventID, // event ID
|
||||
NULL, // current user's SID
|
||||
wNumArgs, // strings in lpszArgs
|
||||
0, // no bytes of raw data
|
||||
wNumArgs ? lpArgs : NULL, // array of error strings
|
||||
NULL); // no raw data
|
||||
wEventType, // event type
|
||||
0, // event category
|
||||
dwEventID, // event ID
|
||||
NULL, // current user's SID
|
||||
wNumArgs, // strings in lpszArgs
|
||||
0, // no bytes of raw data
|
||||
wNumArgs ? lpArgs : NULL,// array of error strings
|
||||
NULL); // no raw data
|
||||
|
||||
|
||||
DeregisterEventSource(hEventSource);
|
||||
|
@ -7,7 +7,7 @@
|
||||
;// Do not edit the header file. It is autogenerated from
|
||||
;// afsd_eventmessages.mc. If you edit afsd_eventmessages.mc
|
||||
;// be sure to ensure the consistency of the data types in LogEvent()
|
||||
;//
|
||||
;// located in afsd_eventlog.c
|
||||
;
|
||||
;#ifndef __AFSD_EVENTMESSAGES_H_
|
||||
;#define __AFSD_EVENTMESSAGES_H_ 1
|
||||
@ -358,5 +358,20 @@ Language=English
|
||||
Unexpected SMB Session Close: %1.
|
||||
.
|
||||
|
||||
MessageId=
|
||||
Severity=Warning
|
||||
Facility=System
|
||||
SymbolicName=MSG_SMB_MAX_MPX_COUNT
|
||||
Language=English
|
||||
MaxMpxCount for client is too large (Client=%1, Server=%2).
|
||||
.
|
||||
|
||||
MessageId=
|
||||
Severity=Warning
|
||||
Facility=System
|
||||
SymbolicName=MSG_SMB_MAX_BUFFER_SIZE
|
||||
Language=English
|
||||
MaxBufferSize for client is too small (Client=%1, Server=%2).
|
||||
.
|
||||
|
||||
;#endif /* __AFSD_EVENTMESSAGES_H_ 1 */
|
||||
|
@ -464,7 +464,7 @@ static void afsd_InitServerPreferences(void)
|
||||
}
|
||||
else /* add a new server without a cell */
|
||||
{
|
||||
tsp = cm_NewServer(&saddr, CM_SERVER_VLDB, NULL, CM_FLAG_NOPROBE); /* refcount = 1 */
|
||||
tsp = cm_NewServer(&saddr, CM_SERVER_VLDB, NULL, NULL, CM_FLAG_NOPROBE); /* refcount = 1 */
|
||||
tsp->ipRank = (USHORT)dwRank;
|
||||
}
|
||||
}
|
||||
@ -534,7 +534,7 @@ static void afsd_InitServerPreferences(void)
|
||||
}
|
||||
else /* add a new server without a cell */
|
||||
{
|
||||
tsp = cm_NewServer(&saddr, CM_SERVER_FILE, NULL, CM_FLAG_NOPROBE); /* refcount = 1 */
|
||||
tsp = cm_NewServer(&saddr, CM_SERVER_FILE, NULL, NULL, CM_FLAG_NOPROBE); /* refcount = 1 */
|
||||
tsp->ipRank = (USHORT)dwRank;
|
||||
}
|
||||
}
|
||||
@ -617,6 +617,7 @@ int afsd_InitCM(char **reasonP)
|
||||
int cm_SubnetMask[CM_MAXINTERFACE_ADDR];/* client's subnet mask in host order*/
|
||||
int cm_NetMtu[CM_MAXINTERFACE_ADDR]; /* client's MTU sizes */
|
||||
int cm_NetFlags[CM_MAXINTERFACE_ADDR]; /* network flags */
|
||||
DWORD dwPriority;
|
||||
|
||||
WSAStartup(0x0101, &WSAjunk);
|
||||
|
||||
@ -666,6 +667,16 @@ int afsd_InitCM(char **reasonP)
|
||||
osi_panic(buf, __FILE__, __LINE__);
|
||||
}
|
||||
|
||||
dummyLen = sizeof(dwPriority);
|
||||
code = RegQueryValueEx(parmKey, "PriorityClass", NULL, NULL,
|
||||
(BYTE *) &dwPriority, &dummyLen);
|
||||
if (code != ERROR_SUCCESS || dwPriority == 0) {
|
||||
dwPriority = HIGH_PRIORITY_CLASS;
|
||||
}
|
||||
if (dwPriority != GetPriorityClass(GetCurrentProcess()))
|
||||
SetPriorityClass(GetCurrentProcess(), dwPriority);
|
||||
afsi_log("PriorityClass 0x%x", GetPriorityClass(GetCurrentProcess()));
|
||||
|
||||
dummyLen = sizeof(lockOrderValidation);
|
||||
code = RegQueryValueEx(parmKey, "LockOrderValidation", NULL, NULL,
|
||||
(BYTE *) &lockOrderValidation, &dummyLen);
|
||||
|
@ -90,6 +90,7 @@ static void afsd_notifier(char *msgp, char *filep, long line)
|
||||
cm_DumpVolumes(afsi_file, "a", 0);
|
||||
cm_DumpSCache(afsi_file, "a", 0);
|
||||
cm_DumpBufHashTable(afsi_file, "a", 0);
|
||||
cm_DumpServers(afsi_file, "a", 0);
|
||||
smb_DumpVCP(afsi_file, "a", 0);
|
||||
rx_DumpPackets(afsi_file, "a");
|
||||
rx_DumpCalls(afsi_file, "a");
|
||||
|
@ -342,7 +342,7 @@ void cm_InvalidateACLUser(cm_scache_t *scp, cm_user_t *userp)
|
||||
* Invalidate ACL info for a user that has just obtained or lost tokens.
|
||||
*/
|
||||
void
|
||||
cm_ResetACLCache(cm_user_t *userp)
|
||||
cm_ResetACLCache(cm_cell_t *cellp, cm_user_t *userp)
|
||||
{
|
||||
cm_scache_t *scp;
|
||||
int hash;
|
||||
@ -350,13 +350,16 @@ cm_ResetACLCache(cm_user_t *userp)
|
||||
lock_ObtainWrite(&cm_scacheLock);
|
||||
for (hash=0; hash < cm_data.scacheHashTableSize; hash++) {
|
||||
for (scp=cm_data.scacheHashTablep[hash]; scp; scp=scp->nextp) {
|
||||
cm_HoldSCacheNoLock(scp);
|
||||
lock_ReleaseWrite(&cm_scacheLock);
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
cm_InvalidateACLUser(scp, userp);
|
||||
lock_ReleaseWrite(&scp->rw);
|
||||
lock_ObtainWrite(&cm_scacheLock);
|
||||
cm_ReleaseSCacheNoLock(scp);
|
||||
if (cellp == NULL ||
|
||||
scp->fid.cell == cellp->cellID) {
|
||||
cm_HoldSCacheNoLock(scp);
|
||||
lock_ReleaseWrite(&cm_scacheLock);
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
cm_InvalidateACLUser(scp, userp);
|
||||
lock_ReleaseWrite(&scp->rw);
|
||||
lock_ObtainWrite(&cm_scacheLock);
|
||||
cm_ReleaseSCacheNoLock(scp);
|
||||
}
|
||||
}
|
||||
}
|
||||
lock_ReleaseWrite(&cm_scacheLock);
|
||||
|
@ -47,6 +47,6 @@ extern long cm_ValidateACLCache(void);
|
||||
|
||||
extern long cm_ShutdownACLCache(void);
|
||||
|
||||
extern void cm_ResetACLCache(cm_user_t *userp);
|
||||
extern void cm_ResetACLCache(cm_cell_t *cellp, cm_user_t *userp);
|
||||
|
||||
#endif /* _CM_ACLENT_H_ */
|
||||
|
@ -1613,7 +1613,7 @@ cm_BPlusDirLookupOriginalName(cm_dirOp_t * op, clientchar_t *centry,
|
||||
*/
|
||||
slot = getSlot(op->scp->dirBplus, leafNode);
|
||||
if (slot <= BTERROR) {
|
||||
op->scp->dirDataVersion = 0;
|
||||
op->scp->dirDataVersion = CM_SCACHE_VERSION_BAD;
|
||||
rc = (slot == BTERROR ? EINVAL : ENOENT);
|
||||
goto done;
|
||||
}
|
||||
@ -2170,8 +2170,9 @@ cm_BPlusEnumAlloc(afs_uint32 entries)
|
||||
}
|
||||
|
||||
long
|
||||
cm_BPlusDirEnumerate(cm_scache_t *scp, afs_uint32 locked,
|
||||
clientchar_t * maskp, cm_direnum_t **enumpp)
|
||||
cm_BPlusDirEnumerate(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp,
|
||||
afs_uint32 locked, clientchar_t * maskp,
|
||||
afs_uint32 fetchStatus, cm_direnum_t **enumpp)
|
||||
{
|
||||
afs_uint32 count = 0, slot, numentries;
|
||||
Nptr leafNode = NONODE, nextLeafNode;
|
||||
@ -2186,6 +2187,13 @@ cm_BPlusDirEnumerate(cm_scache_t *scp, afs_uint32 locked,
|
||||
if (!locked)
|
||||
lock_ObtainRead(&scp->dirlock);
|
||||
|
||||
/*
|
||||
* Hold a reference to the directory so that it wont' be
|
||||
* recycled while the enumeration is active.
|
||||
*/
|
||||
cm_HoldSCache(scp);
|
||||
cm_HoldUser(userp);
|
||||
|
||||
if (scp->dirBplus == NULL) {
|
||||
osi_Log0(afsd_logp, "cm_BPlusDirEnumerate No BPlus Tree");
|
||||
rc = CM_ERROR_WOULDBLOCK;
|
||||
@ -2285,6 +2293,11 @@ cm_BPlusDirEnumerate(cm_scache_t *scp, afs_uint32 locked,
|
||||
nextLeafNode = getnextnode(leafNode);
|
||||
}
|
||||
|
||||
enump->dscp = scp;
|
||||
enump->userp = userp;
|
||||
enump->reqFlags = reqp->flags;
|
||||
enump->fetchStatus = fetchStatus;
|
||||
|
||||
done:
|
||||
if (!locked)
|
||||
lock_ReleaseRead(&scp->dirlock);
|
||||
@ -2292,7 +2305,11 @@ cm_BPlusDirEnumerate(cm_scache_t *scp, afs_uint32 locked,
|
||||
/* if we failed, cleanup any mess */
|
||||
if (rc != 0) {
|
||||
osi_Log0(afsd_logp, "cm_BPlusDirEnumerate rc != 0");
|
||||
if (enump) {
|
||||
|
||||
/* release the directory because we failed to generate an enumeration object */
|
||||
cm_ReleaseSCache(scp);
|
||||
cm_ReleaseUser(userp);
|
||||
if (enump) {
|
||||
for ( count = 0; count < enump->count && enump->entry[count].name; count++ ) {
|
||||
free(enump->entry[count].name);
|
||||
}
|
||||
@ -2307,11 +2324,17 @@ cm_BPlusDirEnumerate(cm_scache_t *scp, afs_uint32 locked,
|
||||
}
|
||||
|
||||
long
|
||||
cm_BPlusDirEnumBulkStat(cm_scache_t *dscp, cm_direnum_t *enump, cm_user_t *userp, cm_req_t *reqp)
|
||||
cm_BPlusDirEnumBulkStat(cm_direnum_t *enump)
|
||||
{
|
||||
cm_scache_t *dscp = enump->dscp;
|
||||
cm_user_t *userp = enump->userp;
|
||||
cm_bulkStat_t *bsp;
|
||||
afs_uint32 count;
|
||||
afs_uint32 code;
|
||||
afs_uint32 code = 0;
|
||||
cm_req_t req;
|
||||
|
||||
cm_InitReq(&req);
|
||||
req.flags = enump->reqFlags;
|
||||
|
||||
if ( dscp->fid.cell == AFS_FAKE_ROOT_CELL_ID )
|
||||
return 0;
|
||||
@ -2333,6 +2356,7 @@ cm_BPlusDirEnumBulkStat(cm_scache_t *dscp, cm_direnum_t *enump, cm_user_t *userp
|
||||
*/
|
||||
lock_ReleaseWrite(&tscp->rw);
|
||||
cm_ReleaseSCache(tscp);
|
||||
enump->entry[count].flags |= CM_DIRENUM_FLAG_GOT_STATUS;
|
||||
continue;
|
||||
}
|
||||
lock_ReleaseWrite(&tscp->rw);
|
||||
@ -2344,21 +2368,82 @@ cm_BPlusDirEnumBulkStat(cm_scache_t *dscp, cm_direnum_t *enump, cm_user_t *userp
|
||||
bsp->fids[i].Volume = enump->entry[count].fid.volume;
|
||||
bsp->fids[i].Vnode = enump->entry[count].fid.vnode;
|
||||
bsp->fids[i].Unique = enump->entry[count].fid.unique;
|
||||
enump->entry[count].flags |= CM_DIRENUM_FLAG_GOT_STATUS;
|
||||
|
||||
if (bsp->counter == AFSCBMAX) {
|
||||
code = cm_TryBulkStatRPC(dscp, bsp, userp, reqp);
|
||||
code = cm_TryBulkStatRPC(dscp, bsp, userp, &req);
|
||||
memset(bsp, 0, sizeof(cm_bulkStat_t));
|
||||
}
|
||||
}
|
||||
|
||||
if (bsp->counter > 0)
|
||||
code = cm_TryBulkStatRPC(dscp, bsp, userp, reqp);
|
||||
code = cm_TryBulkStatRPC(dscp, bsp, userp, &req);
|
||||
|
||||
free(bsp);
|
||||
return 0;
|
||||
return code;
|
||||
}
|
||||
|
||||
long
|
||||
static long
|
||||
cm_BPlusDirEnumBulkStatNext(cm_direnum_t *enump)
|
||||
{
|
||||
cm_scache_t *dscp = enump->dscp;
|
||||
cm_user_t *userp = enump->userp;
|
||||
cm_bulkStat_t *bsp;
|
||||
afs_uint32 count;
|
||||
afs_uint32 code = 0;
|
||||
cm_req_t req;
|
||||
|
||||
cm_InitReq(&req);
|
||||
req.flags = enump->reqFlags;
|
||||
|
||||
if ( dscp->fid.cell == AFS_FAKE_ROOT_CELL_ID )
|
||||
return 0;
|
||||
|
||||
bsp = malloc(sizeof(cm_bulkStat_t));
|
||||
memset(bsp, 0, sizeof(cm_bulkStat_t));
|
||||
|
||||
for ( count = enump->next; count < enump->count; count++ ) {
|
||||
cm_scache_t *tscp = cm_FindSCache(&enump->entry[count].fid);
|
||||
int i;
|
||||
|
||||
if (tscp) {
|
||||
if (lock_TryWrite(&tscp->rw)) {
|
||||
/* we have an entry that we can look at */
|
||||
if (!(tscp->flags & CM_SCACHEFLAG_EACCESS) && cm_HaveCallback(tscp)) {
|
||||
/* we have a callback on it. Don't bother
|
||||
* fetching this stat entry, since we're happy
|
||||
* with the info we have.
|
||||
*/
|
||||
lock_ReleaseWrite(&tscp->rw);
|
||||
cm_ReleaseSCache(tscp);
|
||||
enump->entry[count].flags |= CM_DIRENUM_FLAG_GOT_STATUS;
|
||||
continue;
|
||||
}
|
||||
lock_ReleaseWrite(&tscp->rw);
|
||||
} /* got lock */
|
||||
cm_ReleaseSCache(tscp);
|
||||
} /* found entry */
|
||||
|
||||
i = bsp->counter++;
|
||||
bsp->fids[i].Volume = enump->entry[count].fid.volume;
|
||||
bsp->fids[i].Vnode = enump->entry[count].fid.vnode;
|
||||
bsp->fids[i].Unique = enump->entry[count].fid.unique;
|
||||
enump->entry[count].flags |= CM_DIRENUM_FLAG_GOT_STATUS;
|
||||
|
||||
if (bsp->counter == AFSCBMAX) {
|
||||
code = cm_TryBulkStatRPC(dscp, bsp, userp, &req);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bsp->counter > 0 && bsp->counter < AFSCBMAX)
|
||||
code = cm_TryBulkStatRPC(dscp, bsp, userp, &req);
|
||||
|
||||
free(bsp);
|
||||
return code;
|
||||
}
|
||||
|
||||
long
|
||||
cm_BPlusDirNextEnumEntry(cm_direnum_t *enump, cm_direnum_entry_t **entrypp)
|
||||
{
|
||||
if (enump == NULL || entrypp == NULL || enump->next >= enump->count) {
|
||||
@ -2368,6 +2453,10 @@ cm_BPlusDirNextEnumEntry(cm_direnum_t *enump, cm_direnum_entry_t **entrypp)
|
||||
return CM_ERROR_INVAL;
|
||||
}
|
||||
|
||||
if (enump->fetchStatus &&
|
||||
!(enump->entry[enump->next].flags & CM_DIRENUM_FLAG_GOT_STATUS))
|
||||
cm_BPlusDirEnumBulkStatNext(enump);
|
||||
|
||||
*entrypp = &enump->entry[enump->next++];
|
||||
if ( enump->next == enump->count ) {
|
||||
osi_Log0(afsd_logp, "cm_BPlusDirNextEnumEntry STOPNOW");
|
||||
@ -2387,6 +2476,10 @@ cm_BPlusDirFreeEnumeration(cm_direnum_t *enump)
|
||||
osi_Log0(afsd_logp, "cm_BPlusDirFreeEnumeration");
|
||||
|
||||
if (enump) {
|
||||
/* Release the directory object */
|
||||
cm_ReleaseSCache(enump->dscp);
|
||||
cm_ReleaseUser(enump->userp);
|
||||
|
||||
for ( count = 0; count < enump->count && enump->entry[count].name; count++ ) {
|
||||
free(enump->entry[count].name);
|
||||
}
|
||||
@ -2396,15 +2489,16 @@ cm_BPlusDirFreeEnumeration(cm_direnum_t *enump)
|
||||
}
|
||||
|
||||
long
|
||||
cm_BPlusDirEnumTest(cm_scache_t * dscp, afs_uint32 locked)
|
||||
cm_BPlusDirEnumTest(cm_scache_t * dscp, cm_user_t *userp, cm_req_t *reqp, afs_uint32 locked)
|
||||
{
|
||||
cm_direnum_t * enump = NULL;
|
||||
cm_direnum_entry_t * entryp;
|
||||
long code;
|
||||
|
||||
|
||||
osi_Log0(afsd_logp, "cm_BPlusDirEnumTest start");
|
||||
|
||||
for (code = cm_BPlusDirEnumerate(dscp, locked, NULL, &enump); code == 0; ) {
|
||||
for (code = cm_BPlusDirEnumerate(dscp, userp, reqp, locked, NULL, 1, &enump); code == 0; ) {
|
||||
code = cm_BPlusDirNextEnumEntry(enump, &entryp);
|
||||
if (code == 0 || code == CM_ERROR_STOPNOW) {
|
||||
char buffer[1024];
|
||||
|
@ -156,19 +156,27 @@ typedef struct cm_direnum_entry {
|
||||
clientchar_t *name;
|
||||
cm_fid_t fid;
|
||||
normchar_t shortName[13];
|
||||
afs_uint32 flags;
|
||||
} cm_direnum_entry_t;
|
||||
|
||||
#define CM_DIRENUM_FLAG_GOT_STATUS 1
|
||||
|
||||
typedef struct cm_direnum {
|
||||
cm_scache_t *dscp;
|
||||
cm_user_t *userp;
|
||||
afs_uint32 reqFlags;
|
||||
afs_uint32 count;
|
||||
afs_uint32 next;
|
||||
afs_uint32 fetchStatus;
|
||||
cm_direnum_entry_t entry[1];
|
||||
} cm_direnum_t;
|
||||
|
||||
long cm_BPlusDirEnumerate(cm_scache_t *scp, afs_uint32 locked, clientchar_t *maskp, cm_direnum_t **enumpp);
|
||||
long cm_BPlusDirEnumerate(cm_scache_t *dscp, cm_user_t *userp, cm_req_t *reqp,
|
||||
afs_uint32 locked, clientchar_t *maskp, afs_uint32 fetchStatus, cm_direnum_t **enumpp);
|
||||
long cm_BPlusDirNextEnumEntry(cm_direnum_t *enump, cm_direnum_entry_t **entrypp);
|
||||
long cm_BPlusDirFreeEnumeration(cm_direnum_t *enump);
|
||||
long cm_BPlusDirEnumTest(cm_scache_t * dscp, afs_uint32 locked);
|
||||
long cm_BPlusDirEnumBulkStat(cm_scache_t *dscp, cm_direnum_t *enump, cm_user_t *userp, cm_req_t *reqp);
|
||||
long cm_BPlusDirEnumTest(cm_scache_t * dscp, cm_user_t *userp, cm_req_t *reqp, afs_uint32 locked);
|
||||
long cm_BPlusDirEnumBulkStat(cm_direnum_t *enump);
|
||||
|
||||
long cm_InitBPlusDir(void);
|
||||
|
||||
|
@ -190,8 +190,7 @@ void cm_RevokeCallback(struct rx_call *callp, cm_cell_t * cellp, AFSFid *fidp)
|
||||
scp->fid.vnode == tfid.vnode &&
|
||||
scp->fid.unique == tfid.unique &&
|
||||
(cellp == NULL || scp->fid.cell == cellp->cellID) &&
|
||||
scp->cbExpires > 0 &&
|
||||
scp->cbServerp != NULL)
|
||||
cm_HaveCallback(scp))
|
||||
{
|
||||
cm_HoldSCacheNoLock(scp);
|
||||
lock_ReleaseWrite(&cm_scacheLock);
|
||||
@ -1537,7 +1536,7 @@ int cm_HaveCallback(cm_scache_t *scp)
|
||||
lock_ObtainWrite(&scp->rw); // now get the lock back
|
||||
return 0;
|
||||
}
|
||||
return 1; // no change
|
||||
return (cm_data.fakeDirVersion == scp->dataVersion);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ long cm_AddCellProc(void *rockp, struct sockaddr_in *addrp, char *hostnamep)
|
||||
}
|
||||
}
|
||||
else
|
||||
tsp = cm_NewServer(addrp, CM_SERVER_VLDB, cellp, probe ? 0 : CM_FLAG_NOPROBE);
|
||||
tsp = cm_NewServer(addrp, CM_SERVER_VLDB, cellp, NULL, probe ? 0 : CM_FLAG_NOPROBE);
|
||||
|
||||
/* Insert the vlserver into a sorted list, sorted by server rank */
|
||||
tsrp = cm_NewServerRef(tsp, 0);
|
||||
|
@ -394,7 +394,10 @@ long cm_GetCellServDB(char *cellNamep, afs_uint32 len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* look up the root cell's name in the Registry */
|
||||
/* look up the root cell's name in the Registry
|
||||
* Input buffer must be at least CELL_MAXNAMELEN
|
||||
* in size. (Defined in cm_cell.h)
|
||||
*/
|
||||
long cm_GetRootCellName(char *cellNamep)
|
||||
{
|
||||
DWORD code, dummyLen;
|
||||
@ -405,7 +408,7 @@ long cm_GetRootCellName(char *cellNamep)
|
||||
if (code != ERROR_SUCCESS)
|
||||
return -1;
|
||||
|
||||
dummyLen = 256;
|
||||
dummyLen = CELL_MAXNAMELEN;
|
||||
code = RegQueryValueEx(parmKey, "Cell", NULL, NULL,
|
||||
cellNamep, &dummyLen);
|
||||
RegCloseKey (parmKey);
|
||||
|
@ -353,8 +353,9 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
|
||||
}
|
||||
lock_ReleaseWrite(&cm_serverLock);
|
||||
if (free_svr_list) {
|
||||
cm_FreeServerList(&serversp, 0);
|
||||
*serverspp = serversp = NULL;
|
||||
cm_FreeServerList(serverspp, 0);
|
||||
serverspp = NULL;
|
||||
serversp = NULL;
|
||||
free_svr_list = 0;
|
||||
}
|
||||
|
||||
@ -428,8 +429,9 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
|
||||
}
|
||||
|
||||
if (free_svr_list) {
|
||||
cm_FreeServerList(&serversp, 0);
|
||||
*serverspp = serversp = NULL;
|
||||
cm_FreeServerList(serverspp, 0);
|
||||
serverspp = NULL;
|
||||
serversp = NULL;
|
||||
free_svr_list = 0;
|
||||
}
|
||||
retry = 1;
|
||||
@ -442,6 +444,10 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
|
||||
char addr[16];
|
||||
char *format;
|
||||
DWORD msgID;
|
||||
|
||||
/* In case of timeout */
|
||||
reqp->volumeError = errorCode;
|
||||
|
||||
switch ( errorCode ) {
|
||||
case VNOVOL:
|
||||
msgID = MSG_SERVER_REPORTS_VNOVOL;
|
||||
@ -481,11 +487,14 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
|
||||
LogEvent(EVENTLOG_WARNING_TYPE, msgID, addr, fidp->volume);
|
||||
}
|
||||
|
||||
/* Mark server offline for this volume */
|
||||
/*
|
||||
* Mark server offline for this volume or delete the volume
|
||||
* from the server list if it was moved or is not present.
|
||||
*/
|
||||
if (!serversp && fidp) {
|
||||
code = cm_GetServerList(fidp, userp, reqp, &serverspp);
|
||||
if (code == 0) {
|
||||
serversp = *serverspp = NULL;
|
||||
serversp = *serverspp;
|
||||
free_svr_list = 1;
|
||||
}
|
||||
}
|
||||
@ -494,23 +503,39 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
|
||||
for (tsrp = serversp; tsrp; tsrp=tsrp->next) {
|
||||
if (tsrp->status == srv_deleted)
|
||||
continue;
|
||||
|
||||
sprintf(addr, "%d.%d.%d.%d",
|
||||
((tsrp->server->addr.sin_addr.s_addr & 0xff)),
|
||||
((tsrp->server->addr.sin_addr.s_addr & 0xff00)>> 8),
|
||||
((tsrp->server->addr.sin_addr.s_addr & 0xff0000)>> 16),
|
||||
((tsrp->server->addr.sin_addr.s_addr & 0xff000000)>> 24));
|
||||
|
||||
if (tsrp->server == serverp) {
|
||||
/* REDIRECT */
|
||||
if (errorCode == VMOVED || errorCode == VNOVOL) {
|
||||
osi_Log2(afsd_logp, "volume %d not present on server %s",
|
||||
fidp->volume, osi_LogSaveString(afsd_logp,addr));
|
||||
tsrp->status = srv_deleted;
|
||||
if (fidp)
|
||||
cm_RemoveVolumeFromServer(serverp, fidp->volume);
|
||||
} else {
|
||||
osi_Log2(afsd_logp, "volume %d instance on server %s marked offline",
|
||||
fidp->volume, osi_LogSaveString(afsd_logp,addr));
|
||||
tsrp->status = srv_offline;
|
||||
}
|
||||
/* break; */
|
||||
} else {
|
||||
osi_Log3(afsd_logp, "volume %d exists on server %s with status %u",
|
||||
fidp->volume, osi_LogSaveString(afsd_logp,addr), tsrp->status);
|
||||
}
|
||||
}
|
||||
lock_ReleaseWrite(&cm_serverLock);
|
||||
|
||||
/* Free the server list before cm_ForceUpdateVolume is called */
|
||||
if (free_svr_list) {
|
||||
cm_FreeServerList(&serversp, 0);
|
||||
*serverspp = serversp = NULL;
|
||||
cm_FreeServerList(serverspp, 0);
|
||||
serverspp = NULL;
|
||||
serversp = NULL;
|
||||
free_svr_list = 0;
|
||||
}
|
||||
|
||||
@ -521,10 +546,14 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
|
||||
if (code == 0)
|
||||
statep = cm_VolumeStateByID(volp, fidp->volume);
|
||||
|
||||
if (errorCode == VMOVED || errorCode == VNOVOL) {
|
||||
if ((errorCode == VMOVED || errorCode == VNOVOL) &&
|
||||
!(reqp->flags & CM_REQ_VOLUME_UPDATED))
|
||||
{
|
||||
code = cm_ForceUpdateVolume(fidp, userp, reqp);
|
||||
if (code)
|
||||
timeLeft = 0; /* prevent a retry on failure */
|
||||
else
|
||||
reqp->flags |= CM_REQ_VOLUME_UPDATED;
|
||||
osi_Log3(afsd_logp, "cm_Analyze called cm_ForceUpdateVolume cell %u vol %u code 0x%x",
|
||||
fidp->cell, fidp->volume, code);
|
||||
}
|
||||
@ -813,6 +842,16 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
|
||||
if (connp)
|
||||
cm_PutConn(connp);
|
||||
|
||||
/*
|
||||
* clear the volume updated flag if we succeed.
|
||||
* this way the flag will not prevent a subsequent volume
|
||||
* from being updated if necessary.
|
||||
*/
|
||||
if (errorCode == 0)
|
||||
{
|
||||
reqp->flags &= ~CM_REQ_VOLUME_UPDATED;
|
||||
}
|
||||
|
||||
/* retry until we fail to find a connection */
|
||||
return retry;
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ typedef struct cm_req {
|
||||
#define CM_REQ_NORETRY 0x1
|
||||
#define CM_REQ_NEW_CONN_FORCED 0x2
|
||||
#define CM_REQ_SOURCE_SMB 0x4
|
||||
#define CM_REQ_VOLUME_UPDATED 0x8
|
||||
|
||||
/*
|
||||
* Vice2 error codes
|
||||
|
@ -1506,7 +1506,7 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *userp
|
||||
code = StartRXAFS_FetchData64(rxcallp, &tfid, biod.offset.QuadPart, biod.length);
|
||||
|
||||
if (code == 0) {
|
||||
temp = rx_Read(rxcallp, (char *) &nbytes_hi, sizeof(afs_int32));
|
||||
temp = rx_Read32(rxcallp, &nbytes_hi);
|
||||
if (temp == sizeof(afs_int32)) {
|
||||
nbytes_hi = ntohl(nbytes_hi);
|
||||
} else {
|
||||
@ -1540,7 +1540,7 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *userp
|
||||
}
|
||||
|
||||
if (code == 0) {
|
||||
temp = rx_Read(rxcallp, (char *)&nbytes, sizeof(afs_int32));
|
||||
temp = rx_Read32(rxcallp, &nbytes);
|
||||
if (temp == sizeof(afs_int32)) {
|
||||
nbytes = ntohl(nbytes);
|
||||
FillInt64(length_found, nbytes_hi, nbytes);
|
||||
@ -1561,7 +1561,7 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *userp
|
||||
|
||||
/* now copy the data out of the pipe and put it in the buffer */
|
||||
if (code == 0) {
|
||||
temp = rx_Read(rxcallp, (char *)&nbytes, sizeof(afs_int32));
|
||||
temp = rx_Read32(rxcallp, &nbytes);
|
||||
if (temp == sizeof(afs_int32)) {
|
||||
nbytes = ntohl(nbytes);
|
||||
if (nbytes > biod.length)
|
||||
|
@ -1060,7 +1060,7 @@ cm_BeginDirOp(cm_scache_t * scp, cm_user_t * userp, cm_req_t * reqp,
|
||||
bplus_free_tree++;
|
||||
freeBtree(scp->dirBplus);
|
||||
scp->dirBplus = NULL;
|
||||
scp->dirDataVersion = -1;
|
||||
scp->dirDataVersion = CM_SCACHE_VERSION_BAD;
|
||||
}
|
||||
|
||||
if (!scp->dirBplus) {
|
||||
|
@ -385,11 +385,13 @@ int cm_reInitLocalMountPoints() {
|
||||
|
||||
osi_Log0(afsd_logp,"Invalidating local mount point scp... ");
|
||||
|
||||
|
||||
lock_ObtainWrite(&cm_scacheLock);
|
||||
lock_ObtainMutex(&cm_Freelance_Lock); /* always scache then freelance lock */
|
||||
for (i=1; i<=cm_noLocalMountPoints; i++) {
|
||||
cm_SetFid(&aFid, AFS_FAKE_ROOT_CELL_ID, AFS_FAKE_ROOT_VOL_ID, i, 1);
|
||||
for (i=0; i<=cm_noLocalMountPoints; i++) {
|
||||
if (i == 0)
|
||||
cm_SetFid(&aFid, AFS_FAKE_ROOT_CELL_ID, AFS_FAKE_ROOT_VOL_ID, 1, 1);
|
||||
else
|
||||
cm_SetFid(&aFid, AFS_FAKE_ROOT_CELL_ID, AFS_FAKE_ROOT_VOL_ID, i*2, i);
|
||||
hash = CM_SCACHE_HASH(&aFid);
|
||||
for (scp=cm_data.scacheHashTablep[hash]; scp; scp=scp->nextp) {
|
||||
if (scp != cm_data.rootSCachep && cm_FidCmp(&scp->fid, &aFid) == 0) {
|
||||
@ -1064,12 +1066,33 @@ long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw,
|
||||
fprintf(fp, "%s#%s:%s\n", filename, fullname, volume);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
/* Do this while we are holding the lock */
|
||||
cm_data.fakeDirVersion++;
|
||||
cm_localMountPointChangeFlag = 1;
|
||||
lock_ReleaseMutex(&cm_Freelance_Lock);
|
||||
|
||||
/* cm_reInitLocalMountPoints(); */
|
||||
if (fidp)
|
||||
cm_SetFid(fidp, fidp->cell, fidp->volume, ++cm_noLocalMountPoints, 1);
|
||||
cm_noteLocalMountPointChange();
|
||||
if (fidp) {
|
||||
cm_req_t req;
|
||||
afs_uint32 code;
|
||||
cm_scache_t *scp;
|
||||
clientchar_t *cpath;
|
||||
|
||||
cm_InitReq(&req);
|
||||
|
||||
cpath = cm_FsStringToClientStringAlloc(filename, -1, NULL);
|
||||
if (!cpath)
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
code = cm_NameI(cm_data.rootSCachep, cpath,
|
||||
CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD | CM_FLAG_DFS_REFERRAL,
|
||||
cm_rootUserp, NULL, &req, &scp);
|
||||
free(cpath);
|
||||
if (code)
|
||||
return code;
|
||||
*fidp = scp->fid;
|
||||
cm_ReleaseSCache(scp);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1171,13 +1194,14 @@ long cm_FreelanceRemoveMount(char *toremove)
|
||||
rename(hfile2, hfile);
|
||||
}
|
||||
}
|
||||
|
||||
lock_ReleaseMutex(&cm_Freelance_Lock);
|
||||
|
||||
if (found) {
|
||||
cm_noteLocalMountPointChange();
|
||||
return 0;
|
||||
} else
|
||||
return CM_ERROR_NOSUCHFILE;
|
||||
/* Do this while we are holding the lock */
|
||||
cm_data.fakeDirVersion++;
|
||||
cm_localMountPointChangeFlag = 1;
|
||||
}
|
||||
lock_ReleaseMutex(&cm_Freelance_Lock);
|
||||
return (found ? 0 : CM_ERROR_NOSUCHFILE);
|
||||
}
|
||||
|
||||
long cm_FreelanceAddSymlink(char *filename, char *destination, cm_fid_t *fidp)
|
||||
@ -1271,12 +1295,33 @@ long cm_FreelanceAddSymlink(char *filename, char *destination, cm_fid_t *fidp)
|
||||
}
|
||||
RegCloseKey(hkFreelanceSymlinks);
|
||||
}
|
||||
|
||||
/* Do this while we are holding the lock */
|
||||
cm_data.fakeDirVersion++;
|
||||
cm_localMountPointChangeFlag = 1;
|
||||
lock_ReleaseMutex(&cm_Freelance_Lock);
|
||||
|
||||
/* cm_reInitLocalMountPoints(); */
|
||||
if (fidp)
|
||||
cm_SetFid(fidp, fidp->cell, fidp->volume, ++cm_noLocalMountPoints, 1);
|
||||
cm_noteLocalMountPointChange();
|
||||
if (fidp) {
|
||||
cm_req_t req;
|
||||
afs_uint32 code;
|
||||
cm_scache_t *scp;
|
||||
clientchar_t *cpath;
|
||||
|
||||
cm_InitReq(&req);
|
||||
|
||||
cpath = cm_FsStringToClientStringAlloc(filename, -1, NULL);
|
||||
if (!cpath)
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
code = cm_NameI(cm_data.rootSCachep, cpath,
|
||||
CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD | CM_FLAG_DFS_REFERRAL,
|
||||
cm_rootUserp, NULL, &req, &scp);
|
||||
free(cpath);
|
||||
if (code)
|
||||
return code;
|
||||
*fidp = scp->fid;
|
||||
cm_ReleaseSCache(scp);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1333,12 +1378,13 @@ long cm_FreelanceRemoveSymlink(char *toremove)
|
||||
RegCloseKey(hkFreelanceSymlinks);
|
||||
}
|
||||
|
||||
lock_ReleaseMutex(&cm_Freelance_Lock);
|
||||
if (found) {
|
||||
cm_noteLocalMountPointChange();
|
||||
return 0;
|
||||
} else
|
||||
return CM_ERROR_NOSUCHFILE;
|
||||
/* Do this while we are holding the lock */
|
||||
cm_data.fakeDirVersion++;
|
||||
cm_localMountPointChangeFlag = 1;
|
||||
}
|
||||
lock_ReleaseMutex(&cm_Freelance_Lock);
|
||||
return (found ? 0 : CM_ERROR_NOSUCHFILE);
|
||||
}
|
||||
|
||||
long
|
||||
|
@ -1698,7 +1698,7 @@ cm_IoctlSetSPrefs(struct cm_ioctl *ioctlp, struct cm_user *userp)
|
||||
}
|
||||
else /* add a new server without a cell */
|
||||
{
|
||||
tsp = cm_NewServer(&tmp, type, NULL, CM_FLAG_NOPROBE); /* refcount = 1 */
|
||||
tsp = cm_NewServer(&tmp, type, NULL, NULL, CM_FLAG_NOPROBE); /* refcount = 1 */
|
||||
tsp->ipRank = rank;
|
||||
}
|
||||
lock_ObtainMutex(&tsp->mx);
|
||||
@ -2395,7 +2395,7 @@ cm_IoctlSetToken(struct cm_ioctl *ioctlp, struct cm_user *userp)
|
||||
ioctlp->flags |= CM_IOCTLFLAG_LOGON;
|
||||
}
|
||||
|
||||
cm_ResetACLCache(userp);
|
||||
cm_ResetACLCache(cellp, userp);
|
||||
|
||||
if (release_userp)
|
||||
cm_ReleaseUser(userp);
|
||||
@ -3003,7 +3003,7 @@ cm_IoctlDelToken(struct cm_ioctl *ioctlp, struct cm_user *userp)
|
||||
|
||||
lock_ReleaseMutex(&userp->mx);
|
||||
|
||||
cm_ResetACLCache(userp);
|
||||
cm_ResetACLCache(cellp, userp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -3046,7 +3046,7 @@ cm_IoctlDelAllToken(struct cm_ioctl *ioctlp, struct cm_user *userp)
|
||||
|
||||
lock_ReleaseMutex(&userp->mx);
|
||||
|
||||
cm_ResetACLCache(userp);
|
||||
cm_ResetACLCache(NULL, userp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -3450,6 +3450,7 @@ cm_IoctlMemoryDump(struct cm_ioctl *ioctlp, struct cm_user *userp)
|
||||
cm_DumpVolumes(hLogFile, cookie, 1);
|
||||
cm_DumpSCache(hLogFile, cookie, 1);
|
||||
cm_DumpBufHashTable(hLogFile, cookie, 1);
|
||||
cm_DumpServers(hLogFile, cookie, 1);
|
||||
smb_DumpVCP(hLogFile, cookie, 1);
|
||||
rx_DumpCalls(hLogFile, cookie);
|
||||
rx_DumpPackets(hLogFile, cookie);
|
||||
|
@ -127,7 +127,7 @@ long cm_RecycleSCache(cm_scache_t *scp, afs_int32 flags)
|
||||
bufp->dirty_length = 0;
|
||||
bufp->flags |= CM_BUF_ERROR;
|
||||
bufp->error = VNOVNODE;
|
||||
bufp->dataVersion = -1; /* bad */
|
||||
bufp->dataVersion = CM_BUF_VERSION_BAD; /* bad */
|
||||
bufp->dirtyCounter++;
|
||||
if (bufp->flags & CM_BUF_WAITING) {
|
||||
osi_Log2(afsd_logp, "CM RecycleSCache Waking [scp 0x%x] bufp 0x%x", scp, bufp);
|
||||
@ -149,7 +149,7 @@ long cm_RecycleSCache(cm_scache_t *scp, afs_int32 flags)
|
||||
bufp->dirty_length = 0;
|
||||
bufp->flags |= CM_BUF_ERROR;
|
||||
bufp->error = VNOVNODE;
|
||||
bufp->dataVersion = -1; /* bad */
|
||||
bufp->dataVersion = CM_BUF_VERSION_BAD; /* bad */
|
||||
bufp->dirtyCounter++;
|
||||
if (bufp->flags & CM_BUF_WAITING) {
|
||||
osi_Log2(afsd_logp, "CM RecycleSCache Waking [scp 0x%x] bufp 0x%x", scp, bufp);
|
||||
@ -178,8 +178,8 @@ long cm_RecycleSCache(cm_scache_t *scp, afs_int32 flags)
|
||||
| CM_SCACHEFLAG_OUTOFSPACE
|
||||
| CM_SCACHEFLAG_EACCESS);
|
||||
scp->serverModTime = 0;
|
||||
scp->dataVersion = 0;
|
||||
scp->bufDataVersionLow = 0;
|
||||
scp->dataVersion = CM_SCACHE_VERSION_BAD;
|
||||
scp->bufDataVersionLow = CM_SCACHE_VERSION_BAD;
|
||||
scp->bulkStatProgress = hzero;
|
||||
scp->waitCount = 0;
|
||||
scp->waitQueueT = NULL;
|
||||
@ -215,7 +215,7 @@ long cm_RecycleSCache(cm_scache_t *scp, afs_int32 flags)
|
||||
scp->serverLock = (-1);
|
||||
scp->exclusiveLocks = 0;
|
||||
scp->sharedLocks = 0;
|
||||
scp->lockDataVersion = -1;
|
||||
scp->lockDataVersion = CM_SCACHE_VERSION_BAD;
|
||||
|
||||
/* not locked, but there can be no references to this guy
|
||||
* while we hold the global refcount lock.
|
||||
@ -556,7 +556,7 @@ cm_ShutdownSCache(void)
|
||||
if (scp->dirBplus)
|
||||
freeBtree(scp->dirBplus);
|
||||
scp->dirBplus = NULL;
|
||||
scp->dirDataVersion = -1;
|
||||
scp->dirDataVersion = CM_SCACHE_VERSION_BAD;
|
||||
lock_FinalizeRWLock(&scp->dirlock);
|
||||
#endif
|
||||
lock_FinalizeRWLock(&scp->rw);
|
||||
@ -606,7 +606,7 @@ void cm_InitSCache(int newFile, long maxSCaches)
|
||||
scp->waitCount = 0;
|
||||
#ifdef USE_BPLUS
|
||||
scp->dirBplus = NULL;
|
||||
scp->dirDataVersion = -1;
|
||||
scp->dirDataVersion = CM_SCACHE_VERSION_BAD;
|
||||
#endif
|
||||
scp->waitQueueT = NULL;
|
||||
scp->flags &= ~CM_SCACHEFLAG_WAITING;
|
||||
@ -1530,8 +1530,8 @@ void cm_MergeStatus(cm_scache_t *dscp,
|
||||
scp->group = 0;
|
||||
scp->unixModeBits = 0;
|
||||
scp->anyAccess = 0;
|
||||
scp->dataVersion = 0;
|
||||
scp->bufDataVersionLow = 0;
|
||||
scp->dataVersion = CM_SCACHE_VERSION_BAD;
|
||||
scp->bufDataVersionLow = CM_SCACHE_VERSION_BAD;
|
||||
|
||||
if (dscp) {
|
||||
scp->parentVnode = dscp->fid.vnode;
|
||||
@ -1549,7 +1549,9 @@ void cm_MergeStatus(cm_scache_t *dscp,
|
||||
dataVersion <<= 32;
|
||||
dataVersion |= statusp->DataVersion;
|
||||
|
||||
if (!(flags & CM_MERGEFLAG_FORCE) && dataVersion < scp->dataVersion) {
|
||||
if (!(flags & CM_MERGEFLAG_FORCE) &&
|
||||
dataVersion < scp->dataVersion &&
|
||||
scp->dataVersion != CM_SCACHE_VERSION_BAD) {
|
||||
struct cm_cell *cellp;
|
||||
|
||||
cellp = cm_FindCellByID(scp->fid.cell, 0);
|
||||
|
@ -217,12 +217,16 @@ typedef struct cm_scache {
|
||||
osi_queue_t * waitQueueT; /* locked by cm_scacheLock */
|
||||
} cm_scache_t;
|
||||
|
||||
/* dataVersion */
|
||||
#define CM_SCACHE_VERSION_BAD 0xFFFFFFFFFFFFFFFF
|
||||
|
||||
/* mask field - tell what has been modified */
|
||||
#define CM_SCACHEMASK_CLIENTMODTIME 1 /* client mod time */
|
||||
#define CM_SCACHEMASK_LENGTH 2 /* length */
|
||||
#define CM_SCACHEMASK_TRUNCPOS 4 /* truncation position */
|
||||
|
||||
/* fileType values */
|
||||
#define CM_SCACHETYPE_UNKNOWN 0 /* unknown */
|
||||
#define CM_SCACHETYPE_FILE 1 /* a file */
|
||||
#define CM_SCACHETYPE_DIRECTORY 2 /* a dir */
|
||||
#define CM_SCACHETYPE_SYMLINK 3 /* a symbolic link */
|
||||
|
@ -870,13 +870,14 @@ void cm_SetServerPrefs(cm_server_t * serverp)
|
||||
else serverp->ipRank = min(serverp->ipRank,CM_IPRANK_MED);
|
||||
/* same net */
|
||||
}
|
||||
/* random between 0..15*/
|
||||
serverp->ipRank += min(serverp->ipRank, rand() % 0x000f);
|
||||
} /* and of for loop */
|
||||
|
||||
/* random between 0..15*/
|
||||
serverp->ipRank += (rand() % 0x000f);
|
||||
lock_ReleaseRead(&cm_syscfgLock);
|
||||
}
|
||||
|
||||
cm_server_t *cm_NewServer(struct sockaddr_in *socketp, int type, cm_cell_t *cellp, afs_uint32 flags) {
|
||||
cm_server_t *cm_NewServer(struct sockaddr_in *socketp, int type, cm_cell_t *cellp, afsUUID *uuidp, afs_uint32 flags) {
|
||||
cm_server_t *tsp;
|
||||
|
||||
osi_assertx(socketp->sin_family == AF_INET, "unexpected socket family");
|
||||
@ -886,6 +887,10 @@ cm_server_t *cm_NewServer(struct sockaddr_in *socketp, int type, cm_cell_t *cell
|
||||
memset(tsp, 0, sizeof(*tsp));
|
||||
tsp->type = type;
|
||||
tsp->cellp = cellp;
|
||||
if (uuidp && !afs_uuid_is_nil(uuidp)) {
|
||||
tsp->uuid = *uuidp;
|
||||
tsp->flags |= CM_SERVERFLAG_UUID;
|
||||
}
|
||||
tsp->refCount = 1;
|
||||
lock_InitializeMutex(&tsp->mx, "cm_server_t mutex", LOCK_HIERARCHY_SERVER);
|
||||
tsp->addr = *socketp;
|
||||
@ -908,7 +913,7 @@ cm_server_t *cm_NewServer(struct sockaddr_in *socketp, int type, cm_cell_t *cell
|
||||
lock_ReleaseWrite(&cm_serverLock); /* release server lock */
|
||||
|
||||
if ( !(flags & CM_FLAG_NOPROBE) ) {
|
||||
tsp->flags = CM_SERVERFLAG_DOWN; /* assume down; ping will mark up if available */
|
||||
tsp->flags |= CM_SERVERFLAG_DOWN; /* assume down; ping will mark up if available */
|
||||
cm_PingServer(tsp); /* Obtain Capabilities and check up/down state */
|
||||
}
|
||||
}
|
||||
@ -1294,3 +1299,62 @@ void cm_FreeServerList(cm_serverRef_t** list, afs_uint32 flags)
|
||||
|
||||
lock_ReleaseWrite(&cm_serverLock);
|
||||
}
|
||||
|
||||
/* dump all servers to a file.
|
||||
* cookie is used to identify this batch for easy parsing,
|
||||
* and it a string provided by a caller
|
||||
*/
|
||||
int cm_DumpServers(FILE *outputFile, char *cookie, int lock)
|
||||
{
|
||||
int zilch;
|
||||
cm_server_t *tsp;
|
||||
char output[1024];
|
||||
char uuidstr[128];
|
||||
char hoststr[16];
|
||||
|
||||
if (lock)
|
||||
lock_ObtainRead(&cm_serverLock);
|
||||
|
||||
sprintf(output, "%s - dumping servers - cm_numFileServers=%d, cm_numVldbServers=%d\r\n",
|
||||
cookie, cm_numFileServers, cm_numVldbServers);
|
||||
WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL);
|
||||
|
||||
for (tsp = cm_allServersp; tsp; tsp=tsp->allNextp)
|
||||
{
|
||||
char * type;
|
||||
char * down;
|
||||
|
||||
switch (tsp->type) {
|
||||
case CM_SERVER_VLDB:
|
||||
type = "vldb";
|
||||
break;
|
||||
case CM_SERVER_FILE:
|
||||
type = "file";
|
||||
break;
|
||||
default:
|
||||
type = "unknown";
|
||||
}
|
||||
|
||||
afsUUID_to_string(&tsp->uuid, uuidstr, sizeof(uuidstr));
|
||||
afs_inet_ntoa_r(tsp->addr.sin_addr.s_addr, hoststr);
|
||||
down = ctime(&tsp->downTime);
|
||||
down[strlen(down)-1] = '\0';
|
||||
|
||||
sprintf(output, "%s - tsp=0x%p cell=%s addr=%-15s uuid=%s type=%s caps=0x%x flags=0x%x waitCount=%u rank=%u downTime=\"%s\" refCount=%u\r\n",
|
||||
cookie, tsp, tsp->cellp ? tsp->cellp->name : "", hoststr, uuidstr, type,
|
||||
tsp->capabilities, tsp->flags, tsp->waitCount, tsp->ipRank,
|
||||
(tsp->flags & CM_SERVERFLAG_DOWN) ? down : "up",
|
||||
tsp->refCount);
|
||||
WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL);
|
||||
}
|
||||
sprintf(output, "%s - Done dumping servers.\r\n", cookie);
|
||||
WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL);
|
||||
|
||||
if (lock)
|
||||
lock_ReleaseRead(&cm_serverLock);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -37,6 +37,7 @@ typedef struct cm_server {
|
||||
unsigned short ipRank; /* server priority */
|
||||
cm_server_vols_t * vols; /* by mx */
|
||||
time_t downTime; /* by mx */
|
||||
afsUUID uuid; /* by mx */
|
||||
} cm_server_t;
|
||||
|
||||
enum repstate {srv_not_busy, srv_busy, srv_offline, srv_deleted};
|
||||
@ -60,6 +61,7 @@ typedef struct cm_serverRef {
|
||||
#define CM_SERVERFLAG_NO64BIT 0x8 /* server has no support for
|
||||
64-bit operations. */
|
||||
#define CM_SERVERFLAG_NOINLINEBULK 0x10 /* server has no support for inline bulk */
|
||||
#define CM_SERVERFLAG_UUID 0x20 /* server uuid is known */
|
||||
|
||||
/* flags for procedures */
|
||||
#define CM_FLAG_CHECKUPSERVERS 1 /* check working servers */
|
||||
@ -78,7 +80,7 @@ typedef struct cm_serverRef {
|
||||
#define CM_MAXINTERFACE_ADDR 16
|
||||
|
||||
extern cm_server_t *cm_NewServer(struct sockaddr_in *addrp, int type,
|
||||
struct cm_cell *cellp, afs_uint32 flags);
|
||||
struct cm_cell *cellp, afsUUID *uuidp, afs_uint32 flags);
|
||||
|
||||
extern cm_serverRef_t *cm_NewServerRef(struct cm_server *serverp, afs_uint32 volID);
|
||||
|
||||
@ -130,6 +132,8 @@ extern void cm_SetLanAdapterChangeDetected(void);
|
||||
|
||||
extern void cm_RemoveVolumeFromServer(cm_server_t * serverp, afs_uint32 volID);
|
||||
|
||||
extern int cm_DumpServers(FILE *outputFile, char *cookie, int lock);
|
||||
|
||||
/* Protected by cm_syscfgLock (rw) */
|
||||
extern int cm_noIPAddr; /* number of client network interfaces */
|
||||
extern int cm_IPAddr[CM_MAXINTERFACE_ADDR]; /* client's IP address in host order */
|
||||
|
@ -215,7 +215,7 @@ void cm_CheckTokenCache(time_t now)
|
||||
lock_ReleaseMutex(&userp->mx);
|
||||
if (bExpired) {
|
||||
bExpired=FALSE;
|
||||
cm_ResetACLCache(userp);
|
||||
cm_ResetACLCache(NULL, userp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -270,6 +270,8 @@ long cm_MapRPCError(long error, cm_req_t *reqp)
|
||||
error = CM_ERROR_QUOTA;
|
||||
else if (error == VNOVNODE)
|
||||
error = CM_ERROR_BADFD;
|
||||
else if (error == VNOSERVICE || error == VSALVAGE || error == VOFFLINE)
|
||||
error = CM_ERROR_ALLOFFLINE;
|
||||
else if (error == EISDIR)
|
||||
return CM_ERROR_ISDIR;
|
||||
return error;
|
||||
|
@ -147,7 +147,7 @@ long cm_CheckOpen(cm_scache_t *scp, int openMode, int trunc, cm_user_t *userp,
|
||||
code = cm_Lock(scp, sLockType, LOffset, LLength, key, 0, userp, reqp, NULL);
|
||||
|
||||
if (code == 0) {
|
||||
cm_Unlock(scp, sLockType, LOffset, LLength, key, userp, reqp);
|
||||
cm_Unlock(scp, sLockType, LOffset, LLength, key, 0, userp, reqp);
|
||||
} else {
|
||||
/* In this case, we allow the file open to go through even
|
||||
though we can't enforce mandatory locking on the
|
||||
@ -302,7 +302,7 @@ extern long cm_CheckNTOpenDone(cm_scache_t *scp, cm_user_t *userp, cm_req_t *req
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
if (*ldpp) {
|
||||
cm_Unlock(scp, (*ldpp)->sLockType, (*ldpp)->LOffset, (*ldpp)->LLength,
|
||||
(*ldpp)->key, userp, reqp);
|
||||
(*ldpp)->key, 0, userp, reqp);
|
||||
free(*ldpp);
|
||||
*ldpp = NULL;
|
||||
}
|
||||
@ -1188,7 +1188,7 @@ long cm_LookupInternal(cm_scache_t *dscp, clientchar_t *cnamep, long flags, cm_u
|
||||
code = cm_FreelanceAddSymlink(fnamep, fullname, &rock.fid);
|
||||
}
|
||||
}
|
||||
if (!found || code < 0) { /* add mount point failed, so give up */
|
||||
if (!found || code) { /* add mount point failed, so give up */
|
||||
if (flags & CM_FLAG_CHECKPATH)
|
||||
code = CM_ERROR_NOSUCHPATH;
|
||||
else
|
||||
@ -1932,17 +1932,13 @@ long cm_NameI(cm_scache_t *rootSCachep, clientchar_t *pathp, long flags,
|
||||
fid_count = i+1;
|
||||
} else {
|
||||
/* add the new fid to the list */
|
||||
for ( i=0; i<fid_count; i++) {
|
||||
if ( !cm_FidCmp(&nscp->fid, &fids[i]) ) {
|
||||
code = CM_ERROR_TOO_MANY_SYMLINKS;
|
||||
cm_ReleaseSCache(nscp);
|
||||
nscp = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == fid_count && fid_count < MAX_FID_COUNT) {
|
||||
fids[fid_count++] = nscp->fid;
|
||||
}
|
||||
if (fid_count == MAX_FID_COUNT) {
|
||||
code = CM_ERROR_TOO_MANY_SYMLINKS;
|
||||
cm_ReleaseSCache(nscp);
|
||||
nscp = NULL;
|
||||
break;
|
||||
}
|
||||
fids[fid_count++] = nscp->fid;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3366,9 +3362,6 @@ long cm_Rename(cm_scache_t *oldDscp, fschar_t *oldNamep, clientchar_t *cOldNamep
|
||||
} else {
|
||||
code = 0;
|
||||
}
|
||||
cm_ReleaseSCache(oldScp);
|
||||
oldScp = NULL;
|
||||
|
||||
if (code)
|
||||
goto done;
|
||||
|
||||
@ -3549,31 +3542,28 @@ long cm_Rename(cm_scache_t *oldDscp, fschar_t *oldNamep, clientchar_t *cOldNamep
|
||||
userp, CM_MERGEFLAG_DIROP);
|
||||
lock_ReleaseWrite(&oldDscp->rw);
|
||||
|
||||
if (code == 0) {
|
||||
if (cm_CheckDirOpForSingleChange(&oldDirOp)) {
|
||||
|
||||
if (code == 0 && cm_CheckDirOpForSingleChange(&oldDirOp)) {
|
||||
#ifdef USE_BPLUS
|
||||
diropCode = cm_BPlusDirLookup(&oldDirOp, cOldNamep, &fileFid);
|
||||
if (diropCode == CM_ERROR_INEXACT_MATCH)
|
||||
diropCode = 0;
|
||||
else if (diropCode == EINVAL)
|
||||
diropCode = cm_BPlusDirLookup(&oldDirOp, cOldNamep, &fileFid);
|
||||
if (diropCode == CM_ERROR_INEXACT_MATCH)
|
||||
diropCode = 0;
|
||||
else if (diropCode == EINVAL)
|
||||
#endif
|
||||
diropCode = cm_DirLookup(&oldDirOp, oldNamep, &fileFid);
|
||||
diropCode = cm_DirLookup(&oldDirOp, oldNamep, &fileFid);
|
||||
|
||||
if (diropCode == 0) {
|
||||
if (oneDir) {
|
||||
diropCode = cm_DirCreateEntry(&oldDirOp, newNamep, &fileFid);
|
||||
#ifdef USE_BPLUS
|
||||
cm_BPlusDirCreateEntry(&oldDirOp, cNewNamep, &fileFid);
|
||||
if (diropCode == 0) {
|
||||
if (oneDir) {
|
||||
diropCode = cm_DirCreateEntry(&oldDirOp, newNamep, &fileFid);
|
||||
#ifdef USE_BPLUS
|
||||
cm_BPlusDirCreateEntry(&oldDirOp, cNewNamep, &fileFid);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (diropCode == 0) {
|
||||
diropCode = cm_DirDeleteEntry(&oldDirOp, oldNamep);
|
||||
if (diropCode == 0) {
|
||||
diropCode = cm_DirDeleteEntry(&oldDirOp, oldNamep);
|
||||
#ifdef USE_BPLUS
|
||||
cm_BPlusDirDeleteEntry(&oldDirOp, cOldNamep);
|
||||
#endif
|
||||
}
|
||||
cm_BPlusDirDeleteEntry(&oldDirOp, cOldNamep);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3592,6 +3582,17 @@ long cm_Rename(cm_scache_t *oldDscp, fschar_t *oldNamep, clientchar_t *cOldNamep
|
||||
userp, CM_MERGEFLAG_DIROP);
|
||||
lock_ReleaseWrite(&newDscp->rw);
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* The following optimization does not work.
|
||||
* When the file server processed a RXAFS_Rename() request the
|
||||
* FID of the object being moved between directories is not
|
||||
* preserved. The client does not know the new FID nor the
|
||||
* version number of the target. Not only can we not create
|
||||
* the directory entry in the new directory, but we can't
|
||||
* preserve the cached data for the file. It must be re-read
|
||||
* from the file server. - jaltman, 2009/02/20
|
||||
*/
|
||||
if (code == 0) {
|
||||
/* we only make the local change if we successfully made
|
||||
the change in the old directory AND there was only one
|
||||
@ -3603,10 +3604,23 @@ long cm_Rename(cm_scache_t *oldDscp, fschar_t *oldNamep, clientchar_t *cOldNamep
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif /* 0 */
|
||||
cm_EndDirOp(&newDirOp);
|
||||
}
|
||||
|
||||
/*
|
||||
* After the rename the file server has invalidated the callbacks
|
||||
* on the file that was moved nor do we have a directory reference
|
||||
* to it anymore.
|
||||
*/
|
||||
lock_ObtainWrite(&oldScp->rw);
|
||||
cm_DiscardSCache(oldScp);
|
||||
lock_ReleaseWrite(&oldScp->rw);
|
||||
|
||||
done:
|
||||
if (oldScp)
|
||||
cm_ReleaseSCache(oldScp);
|
||||
|
||||
if (free_oldNamep)
|
||||
free(oldNamep);
|
||||
|
||||
@ -4854,6 +4868,7 @@ long cm_Unlock(cm_scache_t *scp,
|
||||
unsigned char sLockType,
|
||||
LARGE_INTEGER LOffset, LARGE_INTEGER LLength,
|
||||
cm_key_t key,
|
||||
afs_uint32 flags,
|
||||
cm_user_t *userp,
|
||||
cm_req_t *reqp)
|
||||
{
|
||||
@ -4862,12 +4877,19 @@ long cm_Unlock(cm_scache_t *scp,
|
||||
cm_file_lock_t *fileLock;
|
||||
osi_queue_t *q;
|
||||
int release_userp = FALSE;
|
||||
int exact_match = !(flags & CM_UNLOCK_FLAG_MATCH_RANGE);
|
||||
int lock_found = 0;
|
||||
LARGE_INTEGER RangeEnd;
|
||||
|
||||
osi_Log4(afsd_logp, "cm_Unlock scp 0x%p type 0x%x offset %d length %d",
|
||||
scp, sLockType, (unsigned long)LOffset.QuadPart, (unsigned long)LLength.QuadPart);
|
||||
osi_Log3(afsd_logp, "... key <0x%x,0x%x,0x%x>",
|
||||
key.process_id, key.session_id, key.file_id);
|
||||
osi_Log4(afsd_logp, "... key <0x%x,0x%x,0x%x> flags 0x%x",
|
||||
key.process_id, key.session_id, key.file_id, flags);
|
||||
|
||||
if (!exact_match)
|
||||
RangeEnd.QuadPart = LOffset.QuadPart + LLength.QuadPart;
|
||||
|
||||
try_again:
|
||||
lock_ObtainRead(&cm_scacheLock);
|
||||
|
||||
for (q = scp->fileLocksH; q; q = osi_QNext(q)) {
|
||||
@ -4890,21 +4912,39 @@ long cm_Unlock(cm_scache_t *scp,
|
||||
osi_assertx(FALSE, "invalid fid value");
|
||||
}
|
||||
#endif
|
||||
if (!IS_LOCK_DELETED(fileLock) &&
|
||||
cm_KeyEquals(&fileLock->key, &key, 0) &&
|
||||
fileLock->range.offset == LOffset.QuadPart &&
|
||||
fileLock->range.length == LLength.QuadPart) {
|
||||
break;
|
||||
if (exact_match) {
|
||||
if (!IS_LOCK_DELETED(fileLock) &&
|
||||
cm_KeyEquals(&fileLock->key, &key, 0) &&
|
||||
fileLock->range.offset == LOffset.QuadPart &&
|
||||
fileLock->range.length == LLength.QuadPart) {
|
||||
lock_found = 1;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (!IS_LOCK_DELETED(fileLock) &&
|
||||
cm_KeyEquals(&fileLock->key, &key, 0) &&
|
||||
fileLock->range.offset >= LOffset.QuadPart &&
|
||||
fileLock->range.offset < RangeEnd.QuadPart &&
|
||||
(fileLock->range.offset + fileLock->range.length) <= RangeEnd.QuadPart) {
|
||||
lock_found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!q) {
|
||||
osi_Log0(afsd_logp, "cm_Unlock lock not found; failure");
|
||||
|
||||
lock_ReleaseRead(&cm_scacheLock);
|
||||
|
||||
/* The lock didn't exist anyway. *shrug* */
|
||||
return CM_ERROR_RANGE_NOT_LOCKED;
|
||||
if (lock_found && !exact_match) {
|
||||
code = 0;
|
||||
goto done;
|
||||
} else {
|
||||
osi_Log0(afsd_logp, "cm_Unlock lock not found; failure");
|
||||
|
||||
/* The lock didn't exist anyway. *shrug* */
|
||||
return CM_ERROR_RANGE_NOT_LOCKED;
|
||||
}
|
||||
}
|
||||
|
||||
/* discard lock record */
|
||||
@ -5029,8 +5069,13 @@ long cm_Unlock(cm_scache_t *scp,
|
||||
}
|
||||
}
|
||||
|
||||
if (release_userp)
|
||||
if (release_userp) {
|
||||
cm_ReleaseUser(userp);
|
||||
release_userp = FALSE;
|
||||
}
|
||||
|
||||
if (!exact_match)
|
||||
goto try_again; /* might be more than one lock in the range */
|
||||
|
||||
done:
|
||||
|
||||
@ -5069,7 +5114,7 @@ void cm_LockMarkSCacheLost(cm_scache_t * scp)
|
||||
}
|
||||
|
||||
scp->serverLock = -1;
|
||||
scp->lockDataVersion = -1;
|
||||
scp->lockDataVersion = CM_SCACHE_VERSION_BAD;
|
||||
lock_ReleaseWrite(&cm_scacheLock);
|
||||
}
|
||||
|
||||
|
@ -204,9 +204,11 @@ extern long cm_UnlockByKey(cm_scache_t * scp,
|
||||
cm_user_t * userp,
|
||||
cm_req_t * reqp);
|
||||
|
||||
#define CM_UNLOCK_FLAG_MATCH_RANGE 0x01
|
||||
|
||||
extern long cm_Unlock(cm_scache_t *scp, unsigned char sLockType,
|
||||
LARGE_INTEGER LOffset, LARGE_INTEGER LLength, cm_key_t key,
|
||||
cm_user_t *userp, cm_req_t *reqp);
|
||||
afs_uint32 flags, cm_user_t *userp, cm_req_t *reqp);
|
||||
|
||||
extern long cm_LockCheckRead(cm_scache_t *scp,
|
||||
LARGE_INTEGER LOffset,
|
||||
@ -235,7 +237,7 @@ extern cm_key_t cm_GenerateKey(afs_uint16 session_id, afs_offs_t process_id, afs
|
||||
|
||||
extern int cm_KeyEquals(cm_key_t * k1, cm_key_t * k2, int flags);
|
||||
|
||||
#define MAX_SYMLINK_COUNT 16
|
||||
#define MAX_SYMLINK_COUNT 64
|
||||
|
||||
/* make this big enough so that one buffer of dir pages won't overflow. We'll
|
||||
* check anyway, but we want to minimize the chance that we have to leave stuff
|
||||
|
@ -163,7 +163,8 @@ long cm_UpdateVolumeLocation(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *
|
||||
cm_volume_t *volp)
|
||||
{
|
||||
cm_conn_t *connp;
|
||||
int i, j, k;
|
||||
int i;
|
||||
afs_uint32 j, k;
|
||||
cm_serverRef_t *tsrp;
|
||||
cm_server_t *tsp;
|
||||
struct sockaddr_in tsockAddr;
|
||||
@ -321,6 +322,7 @@ long cm_UpdateVolumeLocation(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *
|
||||
afs_int32 bkID;
|
||||
afs_int32 serverNumber[NMAXNSERVERS];
|
||||
afs_int32 serverFlags[NMAXNSERVERS];
|
||||
afsUUID serverUUID[NMAXNSERVERS];
|
||||
afs_int32 rwServers_alldown = 1;
|
||||
afs_int32 roServers_alldown = 1;
|
||||
afs_int32 bkServers_alldown = 1;
|
||||
@ -331,6 +333,8 @@ long cm_UpdateVolumeLocation(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *
|
||||
rwServers_alldown = 0;
|
||||
#endif
|
||||
|
||||
memset(serverUUID, 0, sizeof(serverUUID));
|
||||
|
||||
switch ( method ) {
|
||||
case 0:
|
||||
flags = vldbEntry.flags;
|
||||
@ -406,9 +410,10 @@ long cm_UpdateVolumeLocation(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *
|
||||
for (k = 0; k < nentries && j < NMAXNSERVERS; j++, k++) {
|
||||
serverFlags[j] = uvldbEntry.serverFlags[i];
|
||||
serverNumber[j] = addrp[k];
|
||||
serverUUID[j] = uuid;
|
||||
}
|
||||
|
||||
free(addrs.bulkaddrs_val); /* This is wrong */
|
||||
xdr_free(addrs.bulkaddrs_val, addrs.bulkaddrs_len * sizeof(*addrs.bulkaddrs_val));
|
||||
|
||||
if (nentries == 0)
|
||||
code = CM_ERROR_INVAL;
|
||||
@ -491,19 +496,48 @@ long cm_UpdateVolumeLocation(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *
|
||||
tempAddr = htonl(serverNumber[i]);
|
||||
tsockAddr.sin_addr.s_addr = tempAddr;
|
||||
tsp = cm_FindServer(&tsockAddr, CM_SERVER_FILE);
|
||||
if (tsp && (method == 2) && (tsp->flags & CM_SERVERFLAG_UUID)) {
|
||||
/*
|
||||
* Check to see if the uuid of the server we know at this address
|
||||
* matches the uuid of the server we are being told about by the
|
||||
* vlserver. If not, ...?
|
||||
*/
|
||||
if (!afs_uuid_equal(&serverUUID[i], &tsp->uuid)) {
|
||||
char uuid1[128], uuid2[128];
|
||||
char hoststr[16];
|
||||
|
||||
afsUUID_to_string(&serverUUID[i], uuid1, sizeof(uuid1));
|
||||
afsUUID_to_string(&tsp->uuid, uuid2, sizeof(uuid2));
|
||||
afs_inet_ntoa_r(serverNumber[i], hoststr);
|
||||
|
||||
osi_Log3(afsd_logp, "cm_UpdateVolumeLocation UUIDs do not match! %s != %s (%s)",
|
||||
osi_LogSaveString(afsd_logp, uuid1),
|
||||
osi_LogSaveString(afsd_logp, uuid2),
|
||||
osi_LogSaveString(afsd_logp, hoststr));
|
||||
}
|
||||
}
|
||||
if (!tsp) {
|
||||
/* cm_NewServer will probe the server which in turn will
|
||||
* update the state on the volume group object */
|
||||
lock_ReleaseWrite(&volp->rw);
|
||||
tsp = cm_NewServer(&tsockAddr, CM_SERVER_FILE, cellp, 0);
|
||||
tsp = cm_NewServer(&tsockAddr, CM_SERVER_FILE, cellp, &serverUUID[i], 0);
|
||||
lock_ObtainWrite(&volp->rw);
|
||||
}
|
||||
/* if this server was created by fs setserverprefs */
|
||||
if ( !tsp->cellp )
|
||||
tsp->cellp = cellp;
|
||||
|
||||
osi_assertx(tsp != NULL, "null cm_server_t");
|
||||
|
||||
/*
|
||||
* if this server was created by fs setserverprefs
|
||||
* then it won't have either a cell assignment or
|
||||
* a server uuid.
|
||||
*/
|
||||
if ( !tsp->cellp )
|
||||
tsp->cellp = cellp;
|
||||
if ( (method == 2) && !(tsp->flags & CM_SERVERFLAG_UUID) &&
|
||||
!afs_uuid_is_nil(&serverUUID[i])) {
|
||||
tsp->uuid = serverUUID[i];
|
||||
tsp->flags |= CM_SERVERFLAG_UUID;
|
||||
}
|
||||
|
||||
/* and add it to the list(s). */
|
||||
/*
|
||||
* Each call to cm_NewServerRef() increments the
|
||||
@ -1283,6 +1317,7 @@ cm_UpdateVolumeStatusInt(cm_volume_t *volp, struct cm_vol_state *statep)
|
||||
cm_serverRef_t *tsrp;
|
||||
cm_server_t *tsp;
|
||||
int someBusy = 0, someOffline = 0, allOffline = 1, allBusy = 1, allDown = 1;
|
||||
char addr[16];
|
||||
|
||||
if (!volp || !statep) {
|
||||
#ifdef DEBUG
|
||||
@ -1293,29 +1328,50 @@ cm_UpdateVolumeStatusInt(cm_volume_t *volp, struct cm_vol_state *statep)
|
||||
|
||||
lock_ObtainWrite(&cm_serverLock);
|
||||
for (tsrp = statep->serversp; tsrp; tsrp=tsrp->next) {
|
||||
if (tsrp->status == srv_deleted)
|
||||
continue;
|
||||
tsp = tsrp->server;
|
||||
sprintf(addr, "%d.%d.%d.%d",
|
||||
((tsp->addr.sin_addr.s_addr & 0xff)),
|
||||
((tsp->addr.sin_addr.s_addr & 0xff00)>> 8),
|
||||
((tsp->addr.sin_addr.s_addr & 0xff0000)>> 16),
|
||||
((tsp->addr.sin_addr.s_addr & 0xff000000)>> 24));
|
||||
|
||||
if (tsrp->status == srv_deleted) {
|
||||
osi_Log2(afsd_logp, "cm_UpdateVolumeStatusInt volume %d server reference %s deleted",
|
||||
statep->ID, osi_LogSaveString(afsd_logp,addr));
|
||||
continue;
|
||||
}
|
||||
if (tsp) {
|
||||
cm_GetServerNoLock(tsp);
|
||||
if (!(tsp->flags & CM_SERVERFLAG_DOWN)) {
|
||||
allDown = 0;
|
||||
if (tsrp->status == srv_busy) {
|
||||
osi_Log2(afsd_logp, "cm_UpdateVolumeStatusInt volume %d server reference %s busy",
|
||||
statep->ID, osi_LogSaveString(afsd_logp,addr));
|
||||
allOffline = 0;
|
||||
someBusy = 1;
|
||||
} else if (tsrp->status == srv_offline) {
|
||||
osi_Log2(afsd_logp, "cm_UpdateVolumeStatusInt volume %d server reference %s offline",
|
||||
statep->ID, osi_LogSaveString(afsd_logp,addr));
|
||||
allBusy = 0;
|
||||
someOffline = 1;
|
||||
} else {
|
||||
osi_Log2(afsd_logp, "cm_UpdateVolumeStatusInt volume %d server reference %s online",
|
||||
statep->ID, osi_LogSaveString(afsd_logp,addr));
|
||||
allOffline = 0;
|
||||
allBusy = 0;
|
||||
}
|
||||
} else {
|
||||
osi_Log2(afsd_logp, "cm_UpdateVolumeStatusInt volume %d server reference %s online",
|
||||
statep->ID, osi_LogSaveString(afsd_logp,addr));
|
||||
}
|
||||
cm_PutServerNoLock(tsp);
|
||||
}
|
||||
}
|
||||
lock_ReleaseWrite(&cm_serverLock);
|
||||
|
||||
osi_Log5(afsd_logp, "cm_UpdateVolumeStatusInt allDown %d allBusy %d someBusy %d someOffline %d allOffline %d",
|
||||
allDown, allBusy, someBusy, someOffline, allOffline);
|
||||
|
||||
if (allDown)
|
||||
newStatus = vl_alldown;
|
||||
else if (allBusy || (someBusy && someOffline))
|
||||
|
@ -284,7 +284,7 @@ long WriteData(cm_scache_t *scp, osi_hyper_t offset, long count, char *op,
|
||||
(count >= buf_bufferSize ||
|
||||
LargeIntegerGreaterThanOrEqualTo(LargeIntegerAdd(offset, ConvertLongToLargeInteger(count)), minLength))) {
|
||||
if (count < buf_bufferSize
|
||||
&& bufferp->dataVersion == -1)
|
||||
&& bufferp->dataVersion == CM_BUF_VERSION_BAD)
|
||||
memset(bufferp->datap, 0,
|
||||
buf_bufferSize);
|
||||
bufferp->dataVersion = scp->dataVersion;
|
||||
|
@ -819,6 +819,61 @@ void smb_UnixTimeFromDosUTime(time_t *unixTimep, afs_uint32 dosTime)
|
||||
*unixTimep = dosTime + smb_localZero;
|
||||
}
|
||||
|
||||
void smb_MarkAllVCsDead(smb_vc_t * exclude)
|
||||
{
|
||||
smb_vc_t *vcp;
|
||||
smb_vc_t **vcp_to_cleanup = NULL;
|
||||
int n_to_cleanup = 0;
|
||||
int i;
|
||||
|
||||
osi_Log1(smb_logp, "Marking all VCs as dead excluding %p", exclude);
|
||||
|
||||
lock_ObtainWrite(&smb_globalLock); /* for dead_sessions[] */
|
||||
lock_ObtainWrite(&smb_rctLock);
|
||||
for (vcp = smb_allVCsp; vcp; vcp = vcp->nextp) {
|
||||
|
||||
if (vcp->magic != SMB_VC_MAGIC)
|
||||
osi_panic("afsd: invalid smb_vc_t detected in smb_allVCsp",
|
||||
__FILE__, __LINE__);
|
||||
|
||||
if (vcp == exclude)
|
||||
continue;
|
||||
|
||||
lock_ObtainMutex(&vcp->mx);
|
||||
if (!(vcp->flags & SMB_VCFLAG_ALREADYDEAD)) {
|
||||
vcp->flags |= SMB_VCFLAG_ALREADYDEAD;
|
||||
lock_ReleaseMutex(&vcp->mx);
|
||||
dead_sessions[vcp->session] = TRUE;
|
||||
} else {
|
||||
lock_ReleaseMutex(&vcp->mx);
|
||||
}
|
||||
n_to_cleanup ++;
|
||||
}
|
||||
|
||||
vcp_to_cleanup = malloc(sizeof(vcp_to_cleanup[0]) * n_to_cleanup);
|
||||
i = 0;
|
||||
for (vcp = smb_allVCsp; vcp; vcp = vcp->nextp) {
|
||||
if (vcp == exclude)
|
||||
continue;
|
||||
|
||||
vcp_to_cleanup[i++] = vcp;
|
||||
smb_HoldVCNoLock(vcp);
|
||||
}
|
||||
|
||||
osi_assert(i == n_to_cleanup);
|
||||
|
||||
lock_ReleaseWrite(&smb_rctLock);
|
||||
lock_ReleaseWrite(&smb_globalLock);
|
||||
|
||||
for (i=0; i < n_to_cleanup; i++) {
|
||||
smb_CleanupDeadVC(vcp_to_cleanup[i]);
|
||||
smb_ReleaseVC(vcp_to_cleanup[i]);
|
||||
vcp_to_cleanup[i] = 0;
|
||||
}
|
||||
|
||||
free(vcp_to_cleanup);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SMB_REFCOUNT
|
||||
smb_vc_t *smb_FindVCDbg(unsigned short lsn, int flags, int lana, char *file, long line)
|
||||
#else
|
||||
@ -834,11 +889,14 @@ smb_vc_t *smb_FindVC(unsigned short lsn, int flags, int lana)
|
||||
osi_panic("afsd: invalid smb_vc_t detected in smb_allVCsp",
|
||||
__FILE__, __LINE__);
|
||||
|
||||
lock_ObtainMutex(&vcp->mx);
|
||||
if (lsn == vcp->lsn && lana == vcp->lana &&
|
||||
!(vcp->flags & SMB_VCFLAG_ALREADYDEAD)) {
|
||||
lock_ReleaseMutex(&vcp->mx);
|
||||
smb_HoldVCNoLock(vcp);
|
||||
break;
|
||||
}
|
||||
lock_ReleaseMutex(&vcp->mx);
|
||||
}
|
||||
if (!vcp && (flags & SMB_FLAG_CREATE)) {
|
||||
vcp = malloc(sizeof(*vcp));
|
||||
@ -929,7 +987,6 @@ static int smb_Is8Dot3StarMask(clientchar_t *maskp)
|
||||
|
||||
static int smb_IsStarMask(clientchar_t *maskp)
|
||||
{
|
||||
int i;
|
||||
clientchar_t tc;
|
||||
|
||||
while (*maskp) {
|
||||
@ -1609,25 +1666,61 @@ smb_fid_t *smb_FindFID(smb_vc_t *vcp, unsigned short fid, int flags)
|
||||
return fidp;
|
||||
}
|
||||
|
||||
|
||||
/* Must not be called with scp->rw held because smb_ReleaseFID might be called */
|
||||
#ifdef DEBUG_SMB_REFCOUNT
|
||||
smb_fid_t *smb_FindFIDByScacheDbg(smb_vc_t *vcp, cm_scache_t * scp, char *file, long line)
|
||||
#else
|
||||
smb_fid_t *smb_FindFIDByScache(smb_vc_t *vcp, cm_scache_t * scp)
|
||||
#endif
|
||||
{
|
||||
smb_fid_t *fidp = NULL;
|
||||
int newFid = 0;
|
||||
smb_fid_t *fidp = NULL, *nextp = NULL;
|
||||
|
||||
if (!scp)
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
* If the fidp->scp changes out from under us then
|
||||
* we must not grab a refCount. It means the *fidp
|
||||
* was processed by smb_CloseFID() and the *fidp is
|
||||
* no longer valid for use.
|
||||
*/
|
||||
lock_ObtainWrite(&smb_rctLock);
|
||||
for(fidp = vcp->fidsp; fidp; fidp = (smb_fid_t *) osi_QNext(&fidp->q)) {
|
||||
for(fidp = vcp->fidsp, (fidp ? fidp->refCount++ : 0); fidp; fidp = nextp, nextp = NULL) {
|
||||
nextp = (smb_fid_t *) osi_QNext(&fidp->q);
|
||||
if (nextp)
|
||||
nextp->refCount++;
|
||||
|
||||
if (scp == fidp->scp) {
|
||||
fidp->refCount++;
|
||||
break;
|
||||
lock_ReleaseWrite(&smb_rctLock);
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
lock_ObtainWrite(&smb_rctLock);
|
||||
if (scp == fidp->scp) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
break;
|
||||
}
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
}
|
||||
|
||||
if (fidp->refCount > 1) {
|
||||
fidp->refCount--;
|
||||
} else {
|
||||
lock_ReleaseWrite(&smb_rctLock);
|
||||
smb_ReleaseFID(fidp);
|
||||
lock_ObtainWrite(&smb_rctLock);
|
||||
}
|
||||
}
|
||||
|
||||
if (nextp) {
|
||||
if (nextp->refCount > 1) {
|
||||
nextp->refCount--;
|
||||
} else {
|
||||
lock_ReleaseWrite(&smb_rctLock);
|
||||
smb_ReleaseFID(nextp);
|
||||
lock_ObtainWrite(&smb_rctLock);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SMB_REFCOUNT
|
||||
if (fidp) {
|
||||
afsi_log("%s:%d smb_FindFIDByScache fidp 0x%p ref %d", file, line, fidp, fidp->refCount);
|
||||
@ -1635,7 +1728,7 @@ smb_fid_t *smb_FindFIDByScache(smb_vc_t *vcp, cm_scache_t * scp)
|
||||
}
|
||||
#endif
|
||||
lock_ReleaseWrite(&smb_rctLock);
|
||||
return fidp;
|
||||
return (fidp);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SMB_REFCOUNT
|
||||
@ -1653,8 +1746,8 @@ void smb_HoldFIDNoLock(smb_fid_t *fidp)
|
||||
}
|
||||
|
||||
|
||||
/* smb_ReleaseFID cannot be called while an cm_scache_t mutex lock is held */
|
||||
/* the sm_fid_t->mx and smb_rctLock must not be held */
|
||||
/* smb_ReleaseFID cannot be called while a cm_scache_t rwlock is held */
|
||||
/* the smb_fid_t->mx and smb_rctLock must not be held */
|
||||
#ifdef DEBUG_SMB_REFCOUNT
|
||||
void smb_ReleaseFIDDbg(smb_fid_t *fidp, char *file, long line)
|
||||
#else
|
||||
@ -3090,7 +3183,7 @@ void smb_MapNTError(long code, unsigned long *NTStatusp)
|
||||
#endif /* COMMENT */
|
||||
}
|
||||
else if (code == CM_ERROR_BADSHARENAME) {
|
||||
NTStatus = 0xC00000CCL; /* Bad network name */
|
||||
NTStatus = 0xC00000BEL; /* Bad network path (server valid, share bad) */
|
||||
}
|
||||
else if (code == CM_ERROR_NOIPC) {
|
||||
#ifdef COMMENT
|
||||
@ -3161,7 +3254,7 @@ void smb_MapNTError(long code, unsigned long *NTStatusp)
|
||||
NTStatus = 0xC000022DL; /* Retry */
|
||||
}
|
||||
else if (code == CM_ERROR_ALLOFFLINE || code == CM_ERROR_ALLDOWN) {
|
||||
NTStatus = 0xC00000BEL; /* Bad Network Path */
|
||||
NTStatus = 0xC000003AL; /* Path not found */
|
||||
}
|
||||
else if (code >= ERROR_TABLE_BASE_RXK && code < ERROR_TABLE_BASE_RXK + 256) {
|
||||
NTStatus = 0xC0000322L; /* No Kerberos key */
|
||||
@ -3437,13 +3530,20 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp
|
||||
if (!fidp)
|
||||
goto send1;
|
||||
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (!fidp->scp) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_BADFD;
|
||||
}
|
||||
|
||||
if (fidp->scp->flags & CM_SCACHEFLAG_DELETED) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
code = CM_ERROR_NOSUCHFILE;
|
||||
goto send1a;
|
||||
}
|
||||
|
||||
|
||||
pid = smbp->pid;
|
||||
{
|
||||
LARGE_INTEGER LOffset, LLength;
|
||||
@ -3461,6 +3561,7 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp
|
||||
lock_ReleaseWrite(&fidp->scp->rw);
|
||||
}
|
||||
if (code) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
goto send1a;
|
||||
}
|
||||
|
||||
@ -3471,13 +3572,13 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp
|
||||
smb_RawBufs = *(char **)smb_RawBufs;
|
||||
}
|
||||
lock_ReleaseMutex(&smb_RawBufLock);
|
||||
if (!rawBuf)
|
||||
if (!rawBuf) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
goto send1a;
|
||||
}
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->flags & SMB_FID_IOCTL)
|
||||
{
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
rc = smb_IoctlReadRaw(fidp, vcp, inp, outp);
|
||||
if (rawBuf) {
|
||||
/* Give back raw buffer */
|
||||
@ -4008,7 +4109,7 @@ void smb_WaitingLocksDaemon()
|
||||
|
||||
if (wl->state == SMB_WAITINGLOCKSTATE_DONE)
|
||||
cm_Unlock(scp, wlRequest->lockType, wl->LOffset,
|
||||
wl->LLength, wl->key, NULL, &req);
|
||||
wl->LLength, wl->key, 0, NULL, &req);
|
||||
|
||||
osi_QRemove((osi_queue_t **) &wlRequest->locks, &wl->q);
|
||||
|
||||
@ -4677,7 +4778,7 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -5112,7 +5213,7 @@ long smb_ReceiveCoreCheckPath(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -5200,7 +5301,7 @@ long smb_ReceiveCoreSetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_pack
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -5333,7 +5434,7 @@ long smb_ReceiveCoreGetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_pack
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
} else
|
||||
#endif /* DFS_SUPPORT */
|
||||
if (dscp->fileType == CM_SCACHETYPE_MOUNTPOINT && !dscp->mountRootFid.volume)
|
||||
@ -5370,7 +5471,7 @@ long smb_ReceiveCoreGetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_pack
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -5530,7 +5631,7 @@ long smb_ReceiveCoreOpen(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -5554,17 +5655,6 @@ long smb_ReceiveCoreOpen(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE);
|
||||
osi_assertx(fidp, "null smb_fid_t");
|
||||
|
||||
/* save a pointer to the vnode */
|
||||
fidp->scp = scp;
|
||||
osi_Log2(smb_logp,"smb_ReceiveCoreOpen fidp 0x%p scp 0x%p", fidp, scp);
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
scp->flags |= CM_SCACHEFLAG_SMB_FID;
|
||||
lock_ReleaseWrite(&scp->rw);
|
||||
|
||||
/* and the user */
|
||||
cm_HoldUser(userp);
|
||||
fidp->userp = userp;
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if ((share & 0xf) == 0)
|
||||
fidp->flags |= SMB_FID_OPENREAD_LISTDIR;
|
||||
@ -5572,9 +5662,17 @@ long smb_ReceiveCoreOpen(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
fidp->flags |= SMB_FID_OPENWRITE;
|
||||
else
|
||||
fidp->flags |= (SMB_FID_OPENREAD_LISTDIR | SMB_FID_OPENWRITE);
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
lock_ObtainRead(&scp->rw);
|
||||
/* save the user */
|
||||
cm_HoldUser(userp);
|
||||
fidp->userp = userp;
|
||||
|
||||
/* and a pointer to the vnode */
|
||||
fidp->scp = scp;
|
||||
osi_Log2(smb_logp,"smb_ReceiveCoreOpen fidp 0x%p scp 0x%p", fidp, scp);
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
scp->flags |= CM_SCACHEFLAG_SMB_FID;
|
||||
|
||||
smb_SetSMBParm(outp, 0, fidp->fid);
|
||||
smb_SetSMBParm(outp, 1, smb_Attributes(scp));
|
||||
smb_DosUTimeFromUnixTime(&dosTime, scp->clientModTime);
|
||||
@ -5585,6 +5683,7 @@ long smb_ReceiveCoreOpen(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
/* pass the open mode back; XXXX add access checks */
|
||||
smb_SetSMBParm(outp, 6, (share & 0xf));
|
||||
smb_SetSMBDataLength(outp, 0);
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
lock_ReleaseRead(&scp->rw);
|
||||
|
||||
/* notify open */
|
||||
@ -5713,7 +5812,7 @@ long smb_ReceiveCoreUnlink(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -5905,7 +6004,7 @@ smb_Rename(smb_vc_t *vcp, smb_packet_t *inp, clientchar_t * oldPathp, clientchar
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -5928,7 +6027,7 @@ smb_Rename(smb_vc_t *vcp, smb_packet_t *inp, clientchar_t * oldPathp, clientchar
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -6115,7 +6214,7 @@ smb_Link(smb_vc_t *vcp, smb_packet_t *inp, clientchar_t * oldPathp, clientchar_t
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -6137,7 +6236,7 @@ smb_Link(smb_vc_t *vcp, smb_packet_t *inp, clientchar_t * oldPathp, clientchar_t
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -6363,7 +6462,7 @@ long smb_ReceiveCoreRemoveDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -6456,40 +6555,39 @@ long smb_ReceiveCoreFlush(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
fid = smb_ChainFID(fid, inp);
|
||||
fidp = smb_FindFID(vcp, fid, 0);
|
||||
if (!fidp)
|
||||
return CM_ERROR_BADFD;
|
||||
return CM_ERROR_BADFD;
|
||||
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
userp = smb_GetUserFromVCP(vcp, inp);
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (!fidp->scp || (fidp->flags & SMB_FID_IOCTL)) {
|
||||
cm_ReleaseUser(userp);
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_BADFD;
|
||||
}
|
||||
|
||||
if (fidp->scp->flags & CM_SCACHEFLAG_DELETED) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
cm_ReleaseUser(userp);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_NOSUCHFILE;
|
||||
}
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->flags & SMB_FID_IOCTL) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_BADFD;
|
||||
}
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
userp = smb_GetUserFromVCP(vcp, inp);
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if ((fidp->flags & SMB_FID_OPENWRITE) && smb_AsyncStore != 2) {
|
||||
cm_scache_t * scp = fidp->scp;
|
||||
cm_HoldSCache(scp);
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
cm_scache_t * scp = fidp->scp;
|
||||
cm_HoldSCache(scp);
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
code = cm_FSync(scp, userp, &req);
|
||||
cm_ReleaseSCache(scp);
|
||||
cm_ReleaseSCache(scp);
|
||||
} else {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
code = 0;
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
}
|
||||
|
||||
smb_ReleaseFID(fidp);
|
||||
|
||||
cm_ReleaseUser(userp);
|
||||
|
||||
smb_ReleaseFID(fidp);
|
||||
return code;
|
||||
}
|
||||
|
||||
@ -6586,26 +6684,25 @@ long smb_CloseFID(smb_vc_t *vcp, smb_fid_t *fidp, cm_user_t *userp,
|
||||
|
||||
lock_ObtainWrite(&smb_rctLock);
|
||||
if (fidp->deleteOk) {
|
||||
osi_Log0(smb_logp, " Fid already closed.");
|
||||
lock_ReleaseWrite(&smb_rctLock);
|
||||
return CM_ERROR_BADFD;
|
||||
osi_Log0(smb_logp, " Fid already closed.");
|
||||
lock_ReleaseWrite(&smb_rctLock);
|
||||
return CM_ERROR_BADFD;
|
||||
}
|
||||
fidp->deleteOk = 1;
|
||||
lock_ReleaseWrite(&smb_rctLock);
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->NTopen_dscp) {
|
||||
dscp = fidp->NTopen_dscp;
|
||||
cm_HoldSCache(dscp);
|
||||
dscp = fidp->NTopen_dscp;
|
||||
cm_HoldSCache(dscp);
|
||||
}
|
||||
|
||||
if (fidp->NTopen_pathp) {
|
||||
pathp = cm_ClientStrDup(fidp->NTopen_pathp);
|
||||
}
|
||||
if (fidp->NTopen_pathp)
|
||||
pathp = cm_ClientStrDup(fidp->NTopen_pathp);
|
||||
|
||||
if (fidp->scp) {
|
||||
scp = fidp->scp;
|
||||
cm_HoldSCache(scp);
|
||||
scp = fidp->scp;
|
||||
cm_HoldSCache(scp);
|
||||
}
|
||||
|
||||
/* Don't jump the gun on an async raw write */
|
||||
@ -6623,7 +6720,7 @@ long smb_CloseFID(smb_vc_t *vcp, smb_fid_t *fidp, cm_user_t *userp,
|
||||
scp->mask |= CM_SCACHEMASK_CLIENTMODTIME;
|
||||
/* This fixes defect 10958 */
|
||||
CompensateForSmbClientLastWriteTimeBugs(&dosTime);
|
||||
smb_UnixTimeFromDosUTime(&fidp->scp->clientModTime, dosTime);
|
||||
smb_UnixTimeFromDosUTime(&scp->clientModTime, dosTime);
|
||||
}
|
||||
if (smb_AsyncStore != 2) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
@ -6640,10 +6737,10 @@ long smb_CloseFID(smb_vc_t *vcp, smb_fid_t *fidp, cm_user_t *userp,
|
||||
cm_key_t key;
|
||||
long tcode;
|
||||
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
/* CM_UNLOCK_BY_FID doesn't look at the process ID. We pass
|
||||
in zero. */
|
||||
/* CM_UNLOCK_BY_FID doesn't look at the process ID. We pass
|
||||
* in zero. */
|
||||
key = cm_GenerateKey(vcp->vcID, 0, fidp->fid);
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
|
||||
@ -6744,16 +6841,16 @@ long smb_CloseFID(smb_vc_t *vcp, smb_fid_t *fidp, cm_user_t *userp,
|
||||
}
|
||||
|
||||
if (scp) {
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
if (nullcreator && scp->creator == userp)
|
||||
scp->creator = NULL;
|
||||
scp->flags &= ~CM_SCACHEFLAG_SMB_FID;
|
||||
lock_ReleaseWrite(&scp->rw);
|
||||
cm_ReleaseSCache(scp);
|
||||
scp->flags &= ~CM_SCACHEFLAG_SMB_FID;
|
||||
lock_ReleaseWrite(&scp->rw);
|
||||
cm_ReleaseSCache(scp);
|
||||
}
|
||||
|
||||
if (pathp)
|
||||
free(pathp);
|
||||
free(pathp);
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -6821,7 +6918,13 @@ long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, afs_uint32 count, char
|
||||
code = CM_ERROR_BADFDOP;
|
||||
goto done2;
|
||||
}
|
||||
|
||||
|
||||
if (!fidp->scp) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
code = CM_ERROR_BADFD;
|
||||
goto done2;
|
||||
}
|
||||
|
||||
smb_InitReq(&req);
|
||||
|
||||
bufferp = NULL;
|
||||
@ -7229,6 +7332,7 @@ long smb_ReceiveCoreWrite(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
smb_t* smbp = (smb_t*) inp;
|
||||
long code = 0;
|
||||
cm_user_t *userp;
|
||||
cm_scache_t *scp;
|
||||
cm_attr_t truncAttr; /* attribute struct used for truncating file */
|
||||
char *op;
|
||||
int inDataBlockCount;
|
||||
@ -7252,12 +7356,6 @@ long smb_ReceiveCoreWrite(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
return CM_ERROR_BADFD;
|
||||
}
|
||||
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_NOSUCHFILE;
|
||||
}
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->flags & SMB_FID_IOCTL) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
@ -7266,6 +7364,22 @@ long smb_ReceiveCoreWrite(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
osi_Log1(smb_logp, "smb_ReceiveCoreWrite ioctl code 0x%x", code);
|
||||
return code;
|
||||
}
|
||||
|
||||
if (!fidp->scp) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_BADFD;
|
||||
}
|
||||
|
||||
if (fidp->scp->flags & CM_SCACHEFLAG_DELETED) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_NOSUCHFILE;
|
||||
}
|
||||
|
||||
scp = fidp->scp;
|
||||
cm_HoldSCache(scp);
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
userp = smb_GetUserFromVCP(vcp, inp);
|
||||
|
||||
@ -7282,9 +7396,9 @@ long smb_ReceiveCoreWrite(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
LLength.HighPart = 0;
|
||||
LLength.LowPart = count;
|
||||
|
||||
lock_ObtainWrite(&fidp->scp->rw);
|
||||
code = cm_LockCheckWrite(fidp->scp, LOffset, LLength, key);
|
||||
lock_ReleaseWrite(&fidp->scp->rw);
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
code = cm_LockCheckWrite(scp, LOffset, LLength, key);
|
||||
lock_ReleaseWrite(&scp->rw);
|
||||
|
||||
if (code) {
|
||||
osi_Log1(smb_logp, "smb_ReceiveCoreWrite lock check failure 0x%x", code);
|
||||
@ -7356,6 +7470,7 @@ long smb_ReceiveCoreWrite(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
done:
|
||||
smb_ReleaseFID(fidp);
|
||||
cm_ReleaseUser(userp);
|
||||
cm_ReleaseSCache(scp);
|
||||
|
||||
return code;
|
||||
}
|
||||
@ -7373,12 +7488,21 @@ void smb_CompleteWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
|
||||
fd = smb_GetSMBParm(inp, 0);
|
||||
fidp = smb_FindFID(vcp, fd, 0);
|
||||
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (!fidp->scp) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_ReleaseFID(fidp);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fidp->scp->flags & CM_SCACHEFLAG_DELETED) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return;
|
||||
}
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
osi_Log3(smb_logp, "Completing Raw Write offset 0x%x:%08x count %x",
|
||||
rwcp->offset.HighPart, rwcp->offset.LowPart, rwcp->count);
|
||||
|
||||
@ -7386,7 +7510,7 @@ void smb_CompleteWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
|
||||
|
||||
rawBuf = rwcp->buf;
|
||||
code = smb_WriteData(fidp, &rwcp->offset, rwcp->count, rawBuf, userp,
|
||||
&written);
|
||||
&written);
|
||||
|
||||
if (rwcp->writeMode & 0x1) { /* synchronous */
|
||||
smb_t *op;
|
||||
@ -7433,6 +7557,7 @@ long smb_ReceiveCoreWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
|
||||
smb_t *smbp = (smb_t*) inp;
|
||||
long code = 0;
|
||||
cm_user_t *userp;
|
||||
cm_scache_t *scp;
|
||||
char *op;
|
||||
unsigned short writeMode;
|
||||
char *rawBuf;
|
||||
@ -7481,16 +7606,27 @@ long smb_ReceiveCoreWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
|
||||
|
||||
fd = smb_ChainFID(fd, inp);
|
||||
fidp = smb_FindFID(vcp, fd, 0);
|
||||
if (!fidp) {
|
||||
if (!fidp)
|
||||
return CM_ERROR_BADFD;
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (!fidp->scp) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_BADFD;
|
||||
}
|
||||
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
if (fidp->scp->flags & CM_SCACHEFLAG_DELETED) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_NOSUCHFILE;
|
||||
}
|
||||
|
||||
scp = fidp->scp;
|
||||
cm_HoldSCache(scp);
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
{
|
||||
unsigned pid;
|
||||
cm_key_t key;
|
||||
@ -7505,11 +7641,12 @@ long smb_ReceiveCoreWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
|
||||
LLength.HighPart = 0;
|
||||
LLength.LowPart = count;
|
||||
|
||||
lock_ObtainWrite(&fidp->scp->rw);
|
||||
code = cm_LockCheckWrite(fidp->scp, LOffset, LLength, key);
|
||||
lock_ReleaseWrite(&fidp->scp->rw);
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
code = cm_LockCheckWrite(scp, LOffset, LLength, key);
|
||||
lock_ReleaseWrite(&scp->rw);
|
||||
|
||||
if (code) {
|
||||
cm_ReleaseSCache(scp);
|
||||
smb_ReleaseFID(fidp);
|
||||
return code;
|
||||
}
|
||||
@ -7573,6 +7710,7 @@ long smb_ReceiveCoreWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
|
||||
|
||||
smb_ReleaseFID(fidp);
|
||||
cm_ReleaseUser(userp);
|
||||
cm_ReleaseSCache(scp);
|
||||
|
||||
if (code) {
|
||||
smb_SetSMBParm(outp, 0, total_written);
|
||||
@ -7613,6 +7751,7 @@ long smb_ReceiveCoreRead(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
smb_t *smbp = (smb_t*) inp;
|
||||
long code = 0;
|
||||
cm_user_t *userp;
|
||||
cm_scache_t *scp;
|
||||
char *op;
|
||||
|
||||
fd = smb_GetSMBParm(inp, 0);
|
||||
@ -7627,12 +7766,6 @@ long smb_ReceiveCoreRead(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
fidp = smb_FindFID(vcp, fd, 0);
|
||||
if (!fidp)
|
||||
return CM_ERROR_BADFD;
|
||||
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_NOSUCHFILE;
|
||||
}
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->flags & SMB_FID_IOCTL) {
|
||||
@ -7641,6 +7774,22 @@ long smb_ReceiveCoreRead(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
smb_ReleaseFID(fidp);
|
||||
return code;
|
||||
}
|
||||
|
||||
if (!fidp->scp) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_BADFD;
|
||||
}
|
||||
|
||||
if (fidp->scp->flags & CM_SCACHEFLAG_DELETED) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_NOSUCHFILE;
|
||||
}
|
||||
|
||||
scp = fidp->scp;
|
||||
cm_HoldSCache(scp);
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
{
|
||||
@ -7655,11 +7804,12 @@ long smb_ReceiveCoreRead(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
LLength.HighPart = 0;
|
||||
LLength.LowPart = count;
|
||||
|
||||
lock_ObtainWrite(&fidp->scp->rw);
|
||||
code = cm_LockCheckRead(fidp->scp, LOffset, LLength, key);
|
||||
lock_ReleaseWrite(&fidp->scp->rw);
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
code = cm_LockCheckRead(scp, LOffset, LLength, key);
|
||||
lock_ReleaseWrite(&scp->rw);
|
||||
}
|
||||
if (code) {
|
||||
cm_ReleaseSCache(scp);
|
||||
smb_ReleaseFID(fidp);
|
||||
return code;
|
||||
}
|
||||
@ -7697,6 +7847,7 @@ long smb_ReceiveCoreRead(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
smb_ReleaseFID(fidp);
|
||||
|
||||
cm_ReleaseUser(userp);
|
||||
cm_ReleaseSCache(scp);
|
||||
return code;
|
||||
}
|
||||
|
||||
@ -7762,7 +7913,7 @@ long smb_ReceiveCoreMakeDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -7903,7 +8054,7 @@ long smb_ReceiveCoreCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -8059,21 +8210,23 @@ long smb_ReceiveCoreSeek(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
fidp = smb_FindFID(vcp, fd, 0);
|
||||
if (!fidp)
|
||||
return CM_ERROR_BADFD;
|
||||
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (!fidp->scp || (fidp->flags & SMB_FID_IOCTL)) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_BADFD;
|
||||
}
|
||||
|
||||
if (fidp->scp->flags & CM_SCACHEFLAG_DELETED) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_NOSUCHFILE;
|
||||
}
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->flags & SMB_FID_IOCTL) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_BADFD;
|
||||
}
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
|
||||
userp = smb_GetUserFromVCP(vcp, inp);
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
@ -8205,25 +8358,30 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
|
||||
if (dp->procp) {
|
||||
/* we have a recognized operation */
|
||||
char * opName = myCrt_Dispatch(inp->inCom);
|
||||
smb_t *smbp;
|
||||
|
||||
if (inp->inCom == 0x1d)
|
||||
smbp = (smb_t *) inp;
|
||||
|
||||
osi_Log5(smb_logp,"Dispatch %s mid 0x%x vcp 0x%p lana %d lsn %d",
|
||||
opName, smbp->mid, vcp,vcp->lana,vcp->lsn);
|
||||
if (inp->inCom == 0x1d) {
|
||||
/* Raw Write */
|
||||
code = smb_ReceiveCoreWriteRaw (vcp, inp, outp, rwcp);
|
||||
else {
|
||||
osi_Log4(smb_logp,"Dispatch %s vcp 0x%p lana %d lsn %d",
|
||||
opName,vcp,vcp->lana,vcp->lsn);
|
||||
} else {
|
||||
code = (*(dp->procp)) (vcp, inp, outp);
|
||||
osi_Log4(smb_logp,"Dispatch return code 0x%x vcp 0x%p lana %d lsn %d",
|
||||
code,vcp,vcp->lana,vcp->lsn);
|
||||
#ifdef LOG_PACKET
|
||||
if ( code == CM_ERROR_BADSMB ||
|
||||
code == CM_ERROR_BADOP )
|
||||
smb_LogPacket(inp);
|
||||
#endif /* LOG_PACKET */
|
||||
}
|
||||
osi_Log5(smb_logp,"Dispatch return code 0x%x mid 0x%x vcp 0x%p lana %d lsn %d",
|
||||
code, smbp->mid, vcp,vcp->lana,vcp->lsn);
|
||||
|
||||
newTime = GetTickCount();
|
||||
osi_Log2(smb_logp, "Dispatch %s duration %d ms", opName, newTime - oldTime);
|
||||
osi_Log3(smb_logp, "Dispatch %s mid 0x%x duration %d ms",
|
||||
opName, smbp->mid, newTime - oldTime);
|
||||
|
||||
#ifdef LOG_PACKET
|
||||
if ( code == CM_ERROR_BADSMB ||
|
||||
code == CM_ERROR_BADOP )
|
||||
smb_LogPacket(inp);
|
||||
#endif /* LOG_PACKET */
|
||||
|
||||
/* ReceiveV3Tran2A handles its own logging */
|
||||
if (inp->inCom != 0x32 && newTime - oldTime > 45000) {
|
||||
@ -8234,24 +8392,31 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
|
||||
cm_fid_t afid = {0,0,0,0,0};
|
||||
|
||||
uidp = smb_FindUID(vcp, smbp->uid, 0);
|
||||
smb_LookupTIDPath(vcp,((smb_t *)inp)->tid, &treepath);
|
||||
smb_LookupTIDPath(vcp, smbp->tid, &treepath);
|
||||
fidp = smb_FindFID(vcp, inp->fid, 0);
|
||||
|
||||
if (fidp && fidp->NTopen_pathp)
|
||||
pathname = fidp->NTopen_pathp;
|
||||
else if (inp->stringsp->wdata)
|
||||
pathname = inp->stringsp->wdata;
|
||||
if (fidp) {
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->NTopen_pathp)
|
||||
pathname = fidp->NTopen_pathp;
|
||||
if (fidp->scp)
|
||||
afid = fidp->scp->fid;
|
||||
} else {
|
||||
if (inp->stringsp->wdata)
|
||||
pathname = inp->stringsp->wdata;
|
||||
}
|
||||
|
||||
if (fidp && fidp->scp)
|
||||
afid = fidp->scp->fid;
|
||||
|
||||
afsi_log("Request %s duration %d ms user %S tid \"%S\" path? \"%S\" afid (%d.%d.%d.%d)",
|
||||
opName, newTime - oldTime,
|
||||
uidp ? uidp->unp->name : NULL,
|
||||
afsi_log("Request %s duration %d ms user 0x%x \"%S\" pid 0x%x mid 0x%x tid 0x%x \"%S\" path? \"%S\" afid (%d.%d.%d.%d)",
|
||||
opName, newTime - oldTime,
|
||||
smbp->uid, uidp ? uidp->unp->name : NULL,
|
||||
smbp->pid, smbp->mid, smbp->tid,
|
||||
treepath,
|
||||
pathname,
|
||||
afid.cell, afid.volume, afid.vnode, afid.unique);
|
||||
|
||||
if (fidp)
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
if (uidp)
|
||||
smb_ReleaseUID(uidp);
|
||||
if (fidp)
|
||||
@ -9918,13 +10083,12 @@ void smb_Init(osi_log_t *logp, int useV3, int nThreads, void *aMBfunc)
|
||||
);
|
||||
|
||||
if (nts != STATUS_SUCCESS && ntsEx != STATUS_SUCCESS) {
|
||||
char message[AFSPATHMAX];
|
||||
sprintf(message,"MsV1_0SetProcessOption failure: nts 0x%x ntsEx 0x%x",
|
||||
nts, ntsEx);
|
||||
OutputDebugString(message);
|
||||
afsi_log(message);
|
||||
osi_Log2(smb_logp, "MsV1_0SetProcessOption failure: nts 0x%x ntsEx 0x%x",
|
||||
nts, ntsEx);
|
||||
|
||||
afsi_log("MsV1_0SetProcessOption failure: nts 0x%x ntsEx 0x%x", nts, ntsEx);
|
||||
} else {
|
||||
OutputDebugString("MsV1_0SetProcessOption success");
|
||||
osi_Log0(smb_logp, "MsV1_0SetProcessOption success");
|
||||
afsi_log("MsV1_0SetProcessOption success");
|
||||
}
|
||||
/* END - code from Larry */
|
||||
|
@ -543,6 +543,8 @@ extern void smb_ReleaseVCNoLock(smb_vc_t *vcp);
|
||||
|
||||
extern void smb_CleanupDeadVC(smb_vc_t *vcp);
|
||||
|
||||
extern void smb_MarkAllVCsDead(smb_vc_t *exclude_vcp);
|
||||
|
||||
#ifdef DEBUG_SMB_REFCOUNT
|
||||
extern smb_tid_t *smb_FindTIDDbg(smb_vc_t *vcp, unsigned short tid, int flags, char *, long);
|
||||
#define smb_FindTID(a,b,c) smb_FindTIDDbg(a,b,c,__FILE__,__LINE__);
|
||||
|
@ -144,8 +144,6 @@ void OutputDebugF(clientchar_t * format, ...) {
|
||||
va_start( args, format );
|
||||
cm_ClientStrPrintfV(vbuffer, lengthof(vbuffer), format, args);
|
||||
osi_Log1(smb_logp, "%S", osi_LogSaveClientString(smb_logp, vbuffer));
|
||||
cm_ClientStrCat(vbuffer, lengthof(vbuffer), _C("\n"));
|
||||
OutputDebugStringW(vbuffer);
|
||||
}
|
||||
|
||||
void OutputDebugHexDump(unsigned char * buffer, int len) {
|
||||
@ -159,8 +157,6 @@ void OutputDebugHexDump(unsigned char * buffer, int len) {
|
||||
if(!(i%16)) {
|
||||
if(i) {
|
||||
osi_Log1(smb_logp, "%s", osi_LogSaveString(smb_logp, buf));
|
||||
StringCchCatA(buf, lengthof(buf), "\r\n");
|
||||
OutputDebugString(buf);
|
||||
}
|
||||
StringCchPrintfA(buf, lengthof(buf), "%5x", i);
|
||||
memset(buf+5,' ',80);
|
||||
@ -180,8 +176,6 @@ void OutputDebugHexDump(unsigned char * buffer, int len) {
|
||||
}
|
||||
if(i) {
|
||||
osi_Log1(smb_logp, "%s", osi_LogSaveString(smb_logp, buf));
|
||||
StringCchCatA(buf, lengthof(buf), "\r\n");
|
||||
OutputDebugString(buf);
|
||||
}
|
||||
}
|
||||
|
||||
@ -686,11 +680,39 @@ long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *
|
||||
clientchar_t usern[SMB_MAX_USERNAME_LENGTH];
|
||||
char *secBlobOut = NULL;
|
||||
int secBlobOutLength = 0;
|
||||
int maxBufferSize = 0;
|
||||
int maxMpxCount = 0;
|
||||
int vcNumber = 0;
|
||||
|
||||
/* Check for bad conns */
|
||||
if (vcp->flags & SMB_VCFLAG_REMOTECONN)
|
||||
return CM_ERROR_REMOTECONN;
|
||||
|
||||
/* maxBufferSize */
|
||||
maxBufferSize = smb_GetSMBParm(inp, 2);
|
||||
maxMpxCount = smb_GetSMBParm(inp, 3);
|
||||
vcNumber = smb_GetSMBParm(inp, 4);
|
||||
|
||||
osi_Log3(smb_logp, "SESSION_SETUP_ANDX with MaxBufferSize=%d, MaxMpxCount=%d, VCNumber=%d",
|
||||
maxBufferSize, maxMpxCount, vcNumber);
|
||||
|
||||
if (maxMpxCount > smb_maxMpxRequests) {
|
||||
LogEvent(EVENTLOG_INFORMATION_TYPE, MSG_SMB_MAX_MPX_COUNT, maxMpxCount, smb_maxMpxRequests);
|
||||
osi_Log2(smb_logp, "MaxMpxCount for client is too large (Client=%d, Server=%d)",
|
||||
maxMpxCount, smb_maxMpxRequests);
|
||||
}
|
||||
|
||||
if (maxBufferSize < SMB_PACKETSIZE) {
|
||||
LogEvent(EVENTLOG_INFORMATION_TYPE, MSG_SMB_MAX_BUFFER_SIZE, maxBufferSize, SMB_PACKETSIZE);
|
||||
osi_Log2(smb_logp, "MaxBufferSize for client is too small (Client=%d, Server=%d)",
|
||||
maxBufferSize, SMB_PACKETSIZE);
|
||||
}
|
||||
|
||||
if (vcNumber == 0) {
|
||||
osi_Log0(smb_logp, "Resetting all VCs");
|
||||
smb_MarkAllVCsDead(vcp);
|
||||
}
|
||||
|
||||
if (vcp->flags & SMB_VCFLAG_USENT) {
|
||||
if (smb_authType == SMB_AUTH_EXTENDED) {
|
||||
/* extended authentication */
|
||||
@ -1827,7 +1849,7 @@ long smb_ReceiveRAPNetShareGetInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_pack
|
||||
} else {
|
||||
userp = smb_GetTran2User(vcp, p);
|
||||
if (!userp) {
|
||||
osi_Log1(smb_logp,"ReceiveTran2GetDfsReferral unable to resolve user [%d]", p->uid);
|
||||
osi_Log1(smb_logp,"ReceiveRAPNetShareGetInfo unable to resolve user [%d]", p->uid);
|
||||
return CM_ERROR_BADSMB;
|
||||
}
|
||||
code = cm_NameI(cm_data.rootSCachep, shareName,
|
||||
@ -2222,21 +2244,28 @@ long smb_ReceiveV3Tran2A(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
smb_LookupTIDPath(vcp, asp->tid, &treepath);
|
||||
fidp = smb_FindFID(vcp, inp->fid, 0);
|
||||
|
||||
if (fidp && fidp->NTopen_pathp)
|
||||
pathname = fidp->NTopen_pathp;
|
||||
else if (inp->stringsp->wdata)
|
||||
pathname = inp->stringsp->wdata;
|
||||
if (fidp) {
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->NTopen_pathp)
|
||||
pathname = fidp->NTopen_pathp;
|
||||
if (fidp->scp)
|
||||
afid = fidp->scp->fid;
|
||||
} else {
|
||||
if (inp->stringsp->wdata)
|
||||
pathname = inp->stringsp->wdata;
|
||||
}
|
||||
|
||||
if (fidp && fidp->scp)
|
||||
afid = fidp->scp->fid;
|
||||
|
||||
afsi_log("Request %s duration %d ms user %S tid \"%S\" path? \"%S\" afid (%d.%d.%d.%d)",
|
||||
afsi_log("Request %s duration %d ms user 0x%x \"%S\" pid 0x%x mid 0x%x tid 0x%x \"%S\" path? \"%S\" afid (%d.%d.%d.%d)",
|
||||
myCrt_2Dispatch(asp->opcode), newTime - oldTime,
|
||||
uidp ? uidp->unp->name : NULL,
|
||||
asp->uid, uidp ? uidp->unp->name : NULL,
|
||||
asp->pid, asp->mid, asp->tid,
|
||||
treepath,
|
||||
pathname,
|
||||
afid.cell, afid.volume, afid.vnode, afid.unique);
|
||||
|
||||
if (fidp)
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
if (uidp)
|
||||
smb_ReleaseUID(uidp);
|
||||
if (fidp)
|
||||
@ -2436,7 +2465,7 @@ long smb_ReceiveTran2Open(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *op)
|
||||
if ( WANTS_DFS_PATHNAMES(p) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -2466,7 +2495,7 @@ long smb_ReceiveTran2Open(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *op)
|
||||
if ( WANTS_DFS_PATHNAMES(p) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -3008,7 +3037,7 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
|
||||
if ( WANTS_DFS_PATHNAMES(p) || pnc )
|
||||
code = CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
code = CM_ERROR_BADSHARENAME;
|
||||
code = CM_ERROR_NOSUCHPATH;
|
||||
} else
|
||||
#endif /* DFS_SUPPORT */
|
||||
if (dscp->fileType == CM_SCACHETYPE_MOUNTPOINT && !dscp->mountRootFid.volume)
|
||||
@ -3057,7 +3086,7 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
|
||||
if ( WANTS_DFS_PATHNAMES(p) || pnc )
|
||||
code = CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
code = CM_ERROR_BADSHARENAME;
|
||||
code = CM_ERROR_NOSUCHPATH;
|
||||
smb_SendTran2Error(vcp, p, opx, code);
|
||||
smb_FreeTran2Packet(outp);
|
||||
return 0;
|
||||
@ -3212,7 +3241,6 @@ long smb_ReceiveTran2SetPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet
|
||||
return CM_ERROR_BADOP;
|
||||
#else
|
||||
long code = 0;
|
||||
smb_fid_t *fidp;
|
||||
unsigned short infoLevel;
|
||||
clientchar_t * pathp;
|
||||
smb_tran2Packet_t *outp;
|
||||
@ -3296,7 +3324,7 @@ long smb_ReceiveTran2SetPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet
|
||||
if ( WANTS_DFS_PATHNAMES(p) || pnc )
|
||||
code = CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
code = CM_ERROR_BADSHARENAME;
|
||||
code = CM_ERROR_NOSUCHPATH;
|
||||
} else
|
||||
#endif /* DFS_SUPPORT */
|
||||
if (dscp->fileType == CM_SCACHETYPE_MOUNTPOINT && !dscp->mountRootFid.volume)
|
||||
@ -3334,25 +3362,6 @@ long smb_ReceiveTran2SetPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet
|
||||
return 0;
|
||||
}
|
||||
|
||||
fidp = smb_FindFIDByScache(vcp, scp);
|
||||
if (!fidp) {
|
||||
cm_ReleaseSCache(scp);
|
||||
cm_ReleaseUser(userp);
|
||||
smb_SendTran2Error(vcp, p, opx, code);
|
||||
return 0;
|
||||
}
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (!(fidp->flags & SMB_FID_OPENWRITE)) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
cm_ReleaseSCache(scp);
|
||||
smb_ReleaseFID(fidp);
|
||||
cm_ReleaseUser(userp);
|
||||
smb_SendTran2Error(vcp, p, opx, CM_ERROR_NOACCESS);
|
||||
return 0;
|
||||
}
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
outp = smb_GetTran2ResponsePacket(vcp, p, opx, 2, 0);
|
||||
|
||||
outp->totalParms = 2;
|
||||
@ -3375,10 +3384,6 @@ long smb_ReceiveTran2SetPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet
|
||||
}
|
||||
cm_SyncOpDone(scp, NULL, CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
|
||||
|
||||
lock_ReleaseWrite(&scp->rw);
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
lock_ObtainRead(&scp->rw);
|
||||
|
||||
/* prepare for setattr call */
|
||||
attr.mask = CM_ATTRMASK_LENGTH;
|
||||
attr.length.LowPart = spi->u.QPstandardInfo.dataSize;
|
||||
@ -3387,7 +3392,6 @@ long smb_ReceiveTran2SetPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet
|
||||
if (spi->u.QPstandardInfo.lastWriteDateTime != 0) {
|
||||
smb_UnixTimeFromSearchTime(&attr.clientModTime, spi->u.QPstandardInfo.lastWriteDateTime);
|
||||
attr.mask |= CM_ATTRMASK_CLIENTMODTIME;
|
||||
fidp->flags |= SMB_FID_MTIMESETDONE;
|
||||
}
|
||||
|
||||
if (spi->u.QPstandardInfo.attributes != 0) {
|
||||
@ -3405,7 +3409,6 @@ long smb_ReceiveTran2SetPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet
|
||||
}
|
||||
}
|
||||
lock_ReleaseRead(&scp->rw);
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
/* call setattr */
|
||||
if (attr.mask)
|
||||
@ -3421,7 +3424,6 @@ long smb_ReceiveTran2SetPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet
|
||||
done:
|
||||
cm_ReleaseSCache(scp);
|
||||
cm_ReleaseUser(userp);
|
||||
smb_ReleaseFID(fidp);
|
||||
if (code == 0)
|
||||
smb_SendTran2Packet(vcp, outp, opx);
|
||||
else
|
||||
@ -3460,12 +3462,15 @@ long smb_ReceiveTran2QFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
|
||||
return 0;
|
||||
}
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_SendTran2Error(vcp, p, opx, CM_ERROR_NOSUCHFILE);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return 0;
|
||||
}
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
infoLevel = p->parmsp[1];
|
||||
if (infoLevel == SMB_QUERY_FILE_BASIC_INFO)
|
||||
@ -3603,13 +3608,6 @@ long smb_ReceiveTran2SetFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
smb_SendTran2Error(vcp, p, opx, CM_ERROR_NOSUCHFILE);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
infoLevel = p->parmsp[1];
|
||||
osi_Log2(smb_logp,"ReceiveTran2SetFileInfo type 0x%x fid %d", infoLevel, fid);
|
||||
if (infoLevel > SMB_SET_FILE_END_OF_FILE_INFO || infoLevel < SMB_SET_FILE_BASIC_INFO) {
|
||||
@ -3621,6 +3619,14 @@ long smb_ReceiveTran2SetFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet
|
||||
}
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_SendTran2Error(vcp, p, opx, CM_ERROR_NOSUCHFILE);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (infoLevel == SMB_SET_FILE_DISPOSITION_INFO &&
|
||||
!(fidp->flags & SMB_FID_OPENDELETE)) {
|
||||
osi_Log3(smb_logp,"smb_ReceiveTran2SetFileInfo !SMB_FID_OPENDELETE fidp 0x%p scp 0x%p fidp->flags 0x%x",
|
||||
@ -3890,10 +3896,10 @@ smb_ReceiveTran2GetDFSReferral(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
|
||||
/*
|
||||
* We have a requested path. Check to see if it is something
|
||||
* we know about.
|
||||
*
|
||||
* But be careful because the name that we might be searching
|
||||
* for might be a known name with the final character stripped
|
||||
* off. If we
|
||||
*
|
||||
* But be careful because the name that we might be searching
|
||||
* for might be a known name with the final character stripped
|
||||
* off.
|
||||
*/
|
||||
code = cm_NameI(cm_data.rootSCachep, &requestFileName[nbnLen+2],
|
||||
CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD | CM_FLAG_DFS_REFERRAL,
|
||||
@ -4556,7 +4562,7 @@ long smb_T2SearchDirSingle(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *op
|
||||
if ( WANTS_DFS_PATHNAMES(p) || pnc )
|
||||
code = CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
code = CM_ERROR_BADSHARENAME;
|
||||
code = CM_ERROR_NOSUCHPATH;
|
||||
smb_SendTran2Error(vcp, p, opx, code);
|
||||
smb_FreeTran2Packet(outp);
|
||||
return 0;
|
||||
@ -5076,7 +5082,7 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
|
||||
if ( WANTS_DFS_PATHNAMES(p) || pnc )
|
||||
code = CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
code = CM_ERROR_BADSHARENAME;
|
||||
code = CM_ERROR_NOSUCHPATH;
|
||||
smb_SendTran2Error(vcp, p, opx, code);
|
||||
smb_FreeTran2Packet(outp);
|
||||
lock_ReleaseMutex(&dsp->mx);
|
||||
@ -5767,7 +5773,7 @@ long smb_ReceiveV3OpenX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -5789,7 +5795,7 @@ long smb_ReceiveV3OpenX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
/* otherwise, scp points to the parent directory. Do a lookup,
|
||||
@ -6021,13 +6027,14 @@ long smb_ReceiveV3LockingX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
if (!fidp)
|
||||
return CM_ERROR_BADFD;
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_NOSUCHFILE;
|
||||
}
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->flags & SMB_FID_IOCTL) {
|
||||
osi_Log0(smb_logp, "smb_ReceiveV3Locking BadFD");
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
@ -6044,7 +6051,6 @@ long smb_ReceiveV3LockingX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
|
||||
userp = smb_GetUserFromVCP(vcp, inp);
|
||||
|
||||
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
code = cm_SyncOp(scp, NULL, userp, &req, 0,
|
||||
CM_SCACHESYNC_NEEDCALLBACK
|
||||
@ -6112,7 +6118,7 @@ long smb_ReceiveV3LockingX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
|
||||
key = cm_GenerateKey(vcp->vcID, pid, fidp->fid);
|
||||
|
||||
code = cm_Unlock(scp, LockType, LOffset, LLength, key, userp, &req);
|
||||
code = cm_Unlock(scp, LockType, LOffset, LLength, key, 0, userp, &req);
|
||||
|
||||
if (code)
|
||||
goto done;
|
||||
@ -6234,7 +6240,7 @@ long smb_ReceiveV3LockingX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
|
||||
wlNext = (smb_waitingLock_t *) osi_QNext(&wl->q);
|
||||
|
||||
ul_code = cm_Unlock(scp, LockType, wl->LOffset, wl->LLength, wl->key, userp, &req);
|
||||
ul_code = cm_Unlock(scp, LockType, wl->LOffset, wl->LLength, wl->key, 0, userp, &req);
|
||||
|
||||
if(ul_code != 0) {
|
||||
osi_Log1(smb_logp, "smb_ReceiveV3Locking cm_Unlock returns code %d", ul_code);
|
||||
@ -6307,13 +6313,14 @@ long smb_ReceiveV3GetAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *
|
||||
if (!fidp)
|
||||
return CM_ERROR_BADFD;
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_NOSUCHFILE;
|
||||
}
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->flags & SMB_FID_IOCTL) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_ReleaseFID(fidp);
|
||||
@ -6397,13 +6404,14 @@ long smb_ReceiveV3SetAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *
|
||||
if (!fidp)
|
||||
return CM_ERROR_BADFD;
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_NOSUCHFILE;
|
||||
}
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->flags & SMB_FID_IOCTL) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_ReleaseFID(fidp);
|
||||
@ -6416,7 +6424,6 @@ long smb_ReceiveV3SetAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *
|
||||
|
||||
userp = smb_GetUserFromVCP(vcp, inp);
|
||||
|
||||
|
||||
/* now prepare to call cm_setattr. This message only sets various times,
|
||||
* and AFS only implements mtime, and we'll set the mtime if that's
|
||||
* requested. The others we'll ignore.
|
||||
@ -6455,6 +6462,7 @@ long smb_ReceiveV3WriteX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
smb_fid_t *fidp;
|
||||
smb_t *smbp = (smb_t*) inp;
|
||||
long code = 0;
|
||||
cm_scache_t *scp;
|
||||
cm_user_t *userp;
|
||||
char *op;
|
||||
int inDataBlockCount;
|
||||
@ -6491,20 +6499,31 @@ long smb_ReceiveV3WriteX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
if (!fidp)
|
||||
return CM_ERROR_BADFD;
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_NOSUCHFILE;
|
||||
}
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->flags & SMB_FID_IOCTL) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
code = smb_IoctlV3Write(fidp, vcp, inp, outp);
|
||||
smb_ReleaseFID(fidp);
|
||||
return code;
|
||||
}
|
||||
|
||||
if (!fidp->scp) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_BADFDOP;
|
||||
}
|
||||
|
||||
scp = fidp->scp;
|
||||
cm_HoldSCache(scp);
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
userp = smb_GetUserFromVCP(vcp, inp);
|
||||
|
||||
/* special case: 0 bytes transferred means there is no data
|
||||
@ -6516,7 +6535,6 @@ long smb_ReceiveV3WriteX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
cm_key_t key;
|
||||
LARGE_INTEGER LOffset;
|
||||
LARGE_INTEGER LLength;
|
||||
cm_scache_t * scp;
|
||||
|
||||
pid = smbp->pid;
|
||||
key = cm_GenerateKey(vcp->vcID, pid, fd);
|
||||
@ -6526,7 +6544,6 @@ long smb_ReceiveV3WriteX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
LLength.HighPart = 0;
|
||||
LLength.LowPart = count;
|
||||
|
||||
scp = fidp->scp;
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
code = cm_LockCheckWrite(scp, LOffset, LLength, key);
|
||||
lock_ReleaseWrite(&scp->rw);
|
||||
@ -6547,8 +6564,8 @@ long smb_ReceiveV3WriteX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
*/
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if ((fidp->flags & SMB_FID_MTIMESETDONE) != SMB_FID_MTIMESETDONE) {
|
||||
fidp->scp->mask |= CM_SCACHEMASK_CLIENTMODTIME;
|
||||
fidp->scp->clientModTime = time(NULL);
|
||||
scp->mask |= CM_SCACHEMASK_CLIENTMODTIME;
|
||||
scp->clientModTime = time(NULL);
|
||||
}
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
@ -6574,6 +6591,8 @@ long smb_ReceiveV3WriteX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
smb_SetSMBDataLength(outp, 0);
|
||||
|
||||
done:
|
||||
|
||||
cm_ReleaseSCache(scp);
|
||||
cm_ReleaseUser(userp);
|
||||
smb_ReleaseFID(fidp);
|
||||
|
||||
@ -6591,6 +6610,7 @@ long smb_ReceiveV3ReadX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
smb_fid_t *fidp;
|
||||
smb_t *smbp = (smb_t*) inp;
|
||||
long code = 0;
|
||||
cm_scache_t *scp;
|
||||
cm_user_t *userp;
|
||||
cm_key_t key;
|
||||
char *op;
|
||||
@ -6630,28 +6650,39 @@ long smb_ReceiveV3ReadX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
return CM_ERROR_BADFD;
|
||||
}
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_NOSUCHFILE;
|
||||
}
|
||||
|
||||
if (!fidp->scp) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_BADFDOP;
|
||||
}
|
||||
|
||||
scp = fidp->scp;
|
||||
cm_HoldSCache(scp);
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
pid = smbp->pid;
|
||||
key = cm_GenerateKey(vcp->vcID, pid, fd);
|
||||
{
|
||||
LARGE_INTEGER LOffset, LLength;
|
||||
cm_scache_t *scp;
|
||||
|
||||
LOffset.HighPart = offset.HighPart;
|
||||
LOffset.LowPart = offset.LowPart;
|
||||
LLength.HighPart = 0;
|
||||
LLength.LowPart = count;
|
||||
|
||||
scp = fidp->scp;
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
code = cm_LockCheckRead(scp, LOffset, LLength, key);
|
||||
lock_ReleaseWrite(&scp->rw);
|
||||
}
|
||||
cm_ReleaseSCache(scp);
|
||||
|
||||
if (code) {
|
||||
smb_ReleaseFID(fidp);
|
||||
@ -7006,7 +7037,7 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
code = cm_Lookup(dscp, (lastNamep)?(lastNamep+1):realPathp, CM_FLAG_FOLLOW,
|
||||
@ -7040,7 +7071,7 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
/* we might have scp but not dscp */
|
||||
@ -7080,7 +7111,7 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
|
||||
@ -7571,15 +7602,15 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
smb_SetSMBDataLength(outp, 0);
|
||||
|
||||
if ((fidp->flags & SMB_FID_EXECUTABLE) &&
|
||||
LargeIntegerGreaterThanZero(fidp->scp->length) &&
|
||||
LargeIntegerGreaterThanZero(scp->length) &&
|
||||
!(scp->flags & CM_SCACHEFLAG_PREFETCHING)) {
|
||||
prefetch = 1;
|
||||
}
|
||||
lock_ReleaseRead(&scp->rw);
|
||||
|
||||
if (prefetch)
|
||||
cm_QueueBKGRequest(fidp->scp, cm_BkgPrefetch, 0, 0,
|
||||
fidp->scp->length.LowPart, fidp->scp->length.HighPart,
|
||||
cm_QueueBKGRequest(scp, cm_BkgPrefetch, 0, 0,
|
||||
scp->length.LowPart, scp->length.HighPart,
|
||||
userp);
|
||||
|
||||
|
||||
@ -7828,7 +7859,7 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
code = cm_Lookup(dscp, (lastNamep)?(lastNamep+1):realPathp, CM_FLAG_FOLLOW,
|
||||
@ -7862,7 +7893,7 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
}
|
||||
@ -7887,7 +7918,7 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
|
||||
if ( WANTS_DFS_PATHNAMES(inp) || pnc )
|
||||
return CM_ERROR_PATH_NOT_COVERED;
|
||||
else
|
||||
return CM_ERROR_BADSHARENAME;
|
||||
return CM_ERROR_NOSUCHPATH;
|
||||
}
|
||||
#endif /* DFS_SUPPORT */
|
||||
} else
|
||||
@ -8334,15 +8365,15 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
|
||||
}
|
||||
|
||||
if ((fidp->flags & SMB_FID_EXECUTABLE) &&
|
||||
LargeIntegerGreaterThanZero(fidp->scp->length) &&
|
||||
LargeIntegerGreaterThanZero(scp->length) &&
|
||||
!(scp->flags & CM_SCACHEFLAG_PREFETCHING)) {
|
||||
prefetch = 1;
|
||||
}
|
||||
lock_ReleaseRead(&scp->rw);
|
||||
|
||||
if (prefetch)
|
||||
cm_QueueBKGRequest(fidp->scp, cm_BkgPrefetch, 0, 0,
|
||||
fidp->scp->length.LowPart, fidp->scp->length.HighPart,
|
||||
cm_QueueBKGRequest(scp, cm_BkgPrefetch, 0, 0,
|
||||
scp->length.LowPart, scp->length.HighPart,
|
||||
userp);
|
||||
|
||||
osi_Log1(smb_logp, "SMB NTTranCreate opening fid %d", fidp->fid);
|
||||
@ -8376,11 +8407,16 @@ long smb_ReceiveNTTranNotifyChange(smb_vc_t *vcp, smb_packet_t *inp,
|
||||
return CM_ERROR_BADFD;
|
||||
}
|
||||
|
||||
lock_ObtainMutex(&fidp->mx);
|
||||
if (fidp->scp && (fidp->scp->flags & CM_SCACHEFLAG_DELETED)) {
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
smb_CloseFID(vcp, fidp, NULL, 0);
|
||||
smb_ReleaseFID(fidp);
|
||||
return CM_ERROR_NOSUCHFILE;
|
||||
}
|
||||
scp = fidp->scp;
|
||||
cm_HoldSCache(scp);
|
||||
lock_ReleaseMutex(&fidp->mx);
|
||||
|
||||
/* Create a copy of the Directory Watch Packet to use when sending the
|
||||
* notification if in the future a matching change is detected.
|
||||
@ -8399,7 +8435,6 @@ long smb_ReceiveNTTranNotifyChange(smb_vc_t *vcp, smb_packet_t *inp,
|
||||
smb_Directory_Watches = savedPacketp;
|
||||
lock_ReleaseMutex(&smb_Dir_Watch_Lock);
|
||||
|
||||
scp = fidp->scp;
|
||||
osi_Log3(smb_logp,"smb_ReceiveNTTranNotifyChange fidp 0x%p scp 0x%p file \"%S\"",
|
||||
fidp, scp, osi_LogSaveClientString(smb_logp, fidp->NTopen_wholepathp));
|
||||
osi_Log3(smb_logp, "Request for NotifyChange filter 0x%x fid %d wtree %d",
|
||||
@ -8435,6 +8470,7 @@ long smb_ReceiveNTTranNotifyChange(smb_vc_t *vcp, smb_packet_t *inp,
|
||||
else
|
||||
scp->flags |= CM_SCACHEFLAG_WATCHED;
|
||||
lock_ReleaseWrite(&scp->rw);
|
||||
cm_ReleaseSCache(scp);
|
||||
smb_ReleaseFID(fidp);
|
||||
|
||||
outp->flags |= SMB_PACKETFLAG_NOSEND;
|
||||
@ -8832,12 +8868,14 @@ long smb_ReceiveNTCancel(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
||||
|
||||
scp = fidp->scp;
|
||||
osi_Log2(smb_logp,"smb_ReceiveNTCancel fidp 0x%p scp 0x%p", fidp, scp);
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
if (watchtree)
|
||||
scp->flags &= ~CM_SCACHEFLAG_WATCHEDSUBTREE;
|
||||
else
|
||||
scp->flags &= ~CM_SCACHEFLAG_WATCHED;
|
||||
lock_ReleaseWrite(&scp->rw);
|
||||
if (scp) {
|
||||
lock_ObtainWrite(&scp->rw);
|
||||
if (watchtree)
|
||||
scp->flags &= ~CM_SCACHEFLAG_WATCHEDSUBTREE;
|
||||
else
|
||||
scp->flags &= ~CM_SCACHEFLAG_WATCHED;
|
||||
lock_ReleaseWrite(&scp->rw);
|
||||
}
|
||||
smb_ReleaseFID(fidp);
|
||||
} else {
|
||||
osi_Log2(smb_logp,"NTCancel unable to resolve fid [%d] in vcp[%x]", fid,vcp);
|
||||
|
@ -1055,7 +1055,7 @@ smb_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
|
||||
ioctlp->ioctl.flags |= CM_IOCTLFLAG_LOGON;
|
||||
}
|
||||
|
||||
cm_ResetACLCache(userp);
|
||||
cm_ResetACLCache(cellp, userp);
|
||||
|
||||
done:
|
||||
if (release_userp)
|
||||
|
@ -138,7 +138,7 @@ KFW_initialize(void)
|
||||
KFW_initialize_funcs();
|
||||
|
||||
if ( KFW_is_available() ) {
|
||||
char rootcell[MAXCELLCHARS+1];
|
||||
char rootcell[CELL_MAXNAMELEN+1];
|
||||
#ifdef USE_MS2MIT
|
||||
KFW_import_windows_lsa();
|
||||
#endif /* USE_MS2MIT */
|
||||
@ -1140,7 +1140,7 @@ KFW_AFS_get_cred( char * username,
|
||||
free(cellconfig.linkedCell);
|
||||
|
||||
if ( code && reasonP ) {
|
||||
*reasonP = (char *) afs_error_message(code);
|
||||
*reasonP = afs_error_message(code);
|
||||
}
|
||||
return(code);
|
||||
}
|
||||
|
@ -641,7 +641,7 @@ static void lock_FinalizeRWLockStat(osi_rwlock_t *lockp)
|
||||
LeaveCriticalSection(&osi_statFDCS);
|
||||
}
|
||||
|
||||
void lock_InitializeRWLockStat(osi_rwlock_t *lockp, char *namep)
|
||||
void lock_InitializeRWLockStat(osi_rwlock_t *lockp, char *namep, unsigned short level)
|
||||
{
|
||||
osi_rwlockStat_t *realp;
|
||||
|
||||
@ -660,7 +660,7 @@ void lock_InitializeRWLockStat(osi_rwlock_t *lockp, char *namep)
|
||||
LeaveCriticalSection(&osi_statFDCS);
|
||||
}
|
||||
|
||||
void lock_InitializeMutexStat(osi_mutex_t *lockp, char *namep)
|
||||
void lock_InitializeMutexStat(osi_mutex_t *lockp, char *namep, unsigned short level)
|
||||
{
|
||||
osi_mutexStat_t *realp;
|
||||
|
||||
|
@ -99,9 +99,9 @@ typedef struct osi_rwlockStat {
|
||||
|
||||
typedef void (osi_watchProc_t)(void *rockp, long actualMs, void *lockp);
|
||||
|
||||
extern void lock_InitializeRWLockStat(osi_rwlock_t *, char *);
|
||||
extern void lock_InitializeRWLockStat(osi_rwlock_t *, char *, unsigned short level);
|
||||
|
||||
extern void lock_InitializeMutexStat(osi_mutex_t *, char *);
|
||||
extern void lock_InitializeMutexStat(osi_mutex_t *, char *, unsigned short level);
|
||||
|
||||
extern osi_activeInfo_t *osi_QueueActiveInfo(osi_qiStat_t *, int);
|
||||
|
||||
|
@ -18,7 +18,7 @@ w\:* {behavior:url(#default#VML);}
|
||||
.shape {behavior:url(#default#VML);}
|
||||
</style>
|
||||
<![endif]-->
|
||||
<title>OpenAFS for Windows 1.5.57 Release Notes</title>
|
||||
<title>OpenAFS for Windows 1.5.59 Release Notes</title>
|
||||
<!--[if gte mso 9]><xml>
|
||||
<o:DocumentProperties>
|
||||
<o:Revision>1</o:Revision>
|
||||
|
@ -10,7 +10,7 @@ xmlns="http://www.w3.org/TR/REC-html40">
|
||||
<meta name=Originator content="Microsoft Word 12">
|
||||
<link rel=File-List href="relnotes-frames_files/filelist.xml">
|
||||
<link rel=Preview href="relnotes-frames_files/preview.wmf">
|
||||
<title>OpenAFS for Windows 1.5.57 Release Notes</title>
|
||||
<title>OpenAFS for Windows 1.5.59 Release Notes</title>
|
||||
<!--[if gte mso 9]><xml>
|
||||
<o:DocumentProperties>
|
||||
<o:LastAuthor>Jeffrey Eric Altman</o:LastAuthor>
|
||||
|
@ -22,7 +22,7 @@ w\:* {behavior:url(#default#VML);}
|
||||
.shape {behavior:url(#default#VML);}
|
||||
</style>
|
||||
<![endif]-->
|
||||
<title>OpenAFS for Windows 1.5.57 Release Notes</title>
|
||||
<title>OpenAFS for Windows 1.5.59 Release Notes</title>
|
||||
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
|
||||
name="PostalCode"/>
|
||||
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
|
||||
@ -1226,7 +1226,7 @@ strict'>
|
||||
|
||||
<div class=Section1>
|
||||
|
||||
<p class=MsoTitle>OpenAFS for Windows 1.5.57 (with Unicode Support)<br>
|
||||
<p class=MsoTitle>OpenAFS for Windows 1.5.59 (with Unicode Support)<br>
|
||||
Release Notes</p>
|
||||
|
||||
<p class=MsoBodyText>The Andrew File System (AFS) is a location-independent
|
||||
|
@ -1,10 +1,15 @@
|
||||
<xml xmlns:o="urn:schemas-microsoft-com:office:office">
|
||||
<o:MainFile HRef="../relnotes.htm"/>
|
||||
<o:File HRef="preview.wmf"/>
|
||||
<o:File HRef="item0013.xml"/>
|
||||
<o:File HRef="props0014.xml"/>
|
||||
<o:File HRef="themedata.thmx"/>
|
||||
<o:File HRef="colorschememapping.xml"/>
|
||||
<o:File HRef="image001.png"/>
|
||||
<o:File HRef="image007.jpg"/>
|
||||
<o:File HRef="image003.png"/>
|
||||
<o:File HRef="image002.jpg"/>
|
||||
<o:File HRef="image005.png"/>
|
||||
<o:File HRef="image003.png"/>
|
||||
<o:File HRef="image004.jpg"/>
|
||||
<o:File HRef="image005.png"/>
|
||||
<o:File HRef="image006.jpg"/>
|
||||
<o:File HRef="filelist.xml"/>
|
||||
</xml>
|
@ -12,7 +12,7 @@ xmlns="http://www.w3.org/TR/REC-html40">
|
||||
<base target=body>
|
||||
<link rel=File-List href="toc_files/filelist.xml">
|
||||
<link rel=Preview href="toc_files/preview.wmf">
|
||||
<title>OpenAFS for Windows 1.5.57 Table of Contents</title>
|
||||
<title>OpenAFS for Windows 1.5.59 Table of Contents</title>
|
||||
<!--[if gte mso 9]><xml>
|
||||
<o:DocumentProperties>
|
||||
<o:Author>Jeffrey Altman</o:Author>
|
||||
|
@ -57,7 +57,7 @@ p
|
||||
|
||||
<h1>OpenAFS for Windows</h1>
|
||||
|
||||
<h2>Version 1.5.57</h2>
|
||||
<h2>Version 1.5.59</h2>
|
||||
|
||||
<p class=MsoNormal> </p>
|
||||
|
||||
@ -78,7 +78,7 @@ revised documentation to replace it at the current time.</p>
|
||||
<span
|
||||
style='font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>
|
||||
</span></span><a
|
||||
href="ReleaseNotes/relnotes-frames.htm">OpenAFS for Windows 1.5.57
|
||||
href="ReleaseNotes/relnotes-frames.htm">OpenAFS for Windows 1.5.59
|
||||
Release Notes</a></p>
|
||||
|
||||
<p style='margin-left:36.0pt;text-indent:-18.0pt;'>
|
||||
|
@ -39,10 +39,19 @@ DDK_INCL = $(NTDDKDIR)\INC\API
|
||||
!ERROR netcfgx.h header file cannot be found. DDK improperly configured.
|
||||
!ENDIF
|
||||
|
||||
# DDK version 6001 and above contain SDK header files and come with
|
||||
# its own set of runtime header files. We want to use the Platform
|
||||
# SDK header files.
|
||||
INCLUDE=$(INCLUDE);$(DDK_INCL)
|
||||
|
||||
# afsloopback.dll
|
||||
|
||||
DLLSOURCEFILES = loopbackutils.cpp renameconnection.cpp wmi.cpp
|
||||
DLLOBJFILES = $(OUT)\loopbackutils.obj $(OUT)\renameconnection.obj $(OUT)\wmi.obj
|
||||
DLLSOURCEFILES = loopbackutils.cpp wmi.cpp renameconnection.cpp
|
||||
|
||||
# The order of these files is significant. The first in the list
|
||||
# should be an .obj that includes <afx.h> at the top of the source
|
||||
# file. See Q148652
|
||||
DLLOBJFILES = $(OUT)\renameconnection.obj $(OUT)\loopbackutils.obj $(OUT)\wmi.obj
|
||||
|
||||
$(EXERES) : instloop.rc AFS_component_version_number.h
|
||||
|
||||
@ -57,7 +66,7 @@ $(OUT)\renameconnection.obj: renameconnection.cpp
|
||||
$(STATICC2OBJ) -c -DUNICODE -D_UNICODE /Fo$@ $**
|
||||
|
||||
$(OUT)\wmi.obj: wmi.cpp
|
||||
$(STATICC2OBJ) -I$(DDK_INCL) -c -DUNICODE -D_UNICODE /Fo$@ $**
|
||||
$(STATICC2OBJ) -c -DUNICODE -D_UNICODE /Fo$@ $**
|
||||
|
||||
$(DLLFILE): $(DLLOBJFILES) $(DLLRES)
|
||||
$(LINK) -DLL $(DLLEXPORTS) -OUT:$@ $** $(DLLLIBFILES)
|
||||
@ -66,7 +75,7 @@ $(DLLFILE): $(DLLOBJFILES) $(DLLRES)
|
||||
|
||||
# instloop.exe
|
||||
|
||||
EXEOBJFILES = $(OUT)\instloop.obj $(DLLOBJFILES)
|
||||
EXEOBJFILES = $(DLLOBJFILES) $(OUT)\instloop.obj
|
||||
#EXELIBFILES = $(MEDIABINDIR)\afsloopback.lib
|
||||
|
||||
$(OUT)\instloop.obj: instloop.c
|
||||
|
@ -2669,6 +2669,8 @@ afs_msg_newcred(khm_int32 msg_subtype,
|
||||
khm_handle csp_cell = NULL;
|
||||
BOOL bgetLinked = 0;
|
||||
|
||||
_progress(i, l->n_rows);
|
||||
|
||||
if (l->rows[i].flags &
|
||||
(DLGROW_FLAG_DONE | DLGROW_FLAG_DELETED))
|
||||
|
||||
@ -2787,6 +2789,8 @@ afs_msg_newcred(khm_int32 msg_subtype,
|
||||
}
|
||||
}
|
||||
|
||||
_progress(1,1);
|
||||
|
||||
_skip_tokens:
|
||||
|
||||
if(failed) {
|
||||
|
@ -1020,7 +1020,7 @@ BOOL CALLBACK MemMgr_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
|
||||
MemMgr_StoreSettings();
|
||||
l.hManager = NULL;
|
||||
KillTimer (hDlg, l.idTimer);
|
||||
l.idTimer = -1;
|
||||
l.idTimer = (UINT_PTR)-1;
|
||||
break;
|
||||
|
||||
case WM_SIZE:
|
||||
|
31
src/WINNT/tests/NTMakefile
Normal file
31
src/WINNT/tests/NTMakefile
Normal file
@ -0,0 +1,31 @@
|
||||
#
|
||||
# Copyright (c) 2009 Secure Endpoints Inc.
|
||||
#
|
||||
|
||||
RELDIR=WINNT\tests
|
||||
!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
|
||||
!INCLUDE ..\..\config\NTMakefile.version
|
||||
|
||||
install:
|
||||
cd largefiles
|
||||
$(MAKECMD) /nologo /f NTMakefile install
|
||||
cd ..\nmtest
|
||||
$(MAKECMD) /nologo /f NTMakefile install
|
||||
cd ..\torture
|
||||
$(MAKECMD) /nologo /f NTMakefile install
|
||||
cd ..\winflock
|
||||
$(MAKECMD) /nologo /f NTMakefile install
|
||||
cd ..
|
||||
|
||||
clean::
|
||||
cd largefiles
|
||||
$(MAKECMD) /nologo /f NTMakefile clean
|
||||
cd ..\nmtest
|
||||
$(MAKECMD) /nologo /f NTMakefile clean
|
||||
cd ..\torture
|
||||
$(MAKECMD) /nologo /f NTMakefile clean
|
||||
cd ..\winflock
|
||||
$(MAKECMD) /nologo /f NTMakefile clean
|
||||
cd ..
|
||||
|
||||
|
31
src/WINNT/tests/largefiles/NTMakefile
Normal file
31
src/WINNT/tests/largefiles/NTMakefile
Normal file
@ -0,0 +1,31 @@
|
||||
#
|
||||
# Copyright (c) 2009 Secure Endpoints Inc.
|
||||
#
|
||||
|
||||
RELDIR=WINNT\tests\lftest
|
||||
!INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME)
|
||||
!INCLUDE ..\..\..\config\NTMakefile.version
|
||||
|
||||
idirs:
|
||||
! if !(exist($(OJT)\WINNT\tests))
|
||||
md $(OJT)\WINNT\tests
|
||||
! endif
|
||||
! if !(exist($(OJT)\WINNT\tests\lftest))
|
||||
md $(OJT)\WINNT\tests\lftest
|
||||
! endif
|
||||
|
||||
EXEDIR = $(DESTDIR)\bin
|
||||
|
||||
OBJS = $(OUT)\lftest.obj
|
||||
|
||||
$(EXEDIR)\lftest.exe: $(OBJS)
|
||||
$(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib userenv.lib
|
||||
$(_VC_MANIFEST_EMBED_EXE)
|
||||
$(EXEPREP)
|
||||
$(CODESIGN_USERLAND)
|
||||
|
||||
install: idirs $(EXEDIR)\lftest.exe
|
||||
|
||||
clean::
|
||||
|
||||
|
169
src/WINNT/tests/largefiles/lftest.c
Normal file
169
src/WINNT/tests/largefiles/lftest.c
Normal file
@ -0,0 +1,169 @@
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <process.h>
|
||||
|
||||
char * teststr = "This is a test string.";
|
||||
|
||||
|
||||
|
||||
void usage(void) {
|
||||
fprintf(stderr, "lftest <path>\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int test_write(HANDLE hf, LARGE_INTEGER offset) {
|
||||
DWORD dwWritten;
|
||||
int ret = 0;
|
||||
|
||||
if (!LockFile(hf, offset.u.LowPart, offset.u.HighPart,
|
||||
4096, 0)) {
|
||||
fprintf(stderr, "Unable to lock offset 0x%08x:%08x gle = 0x%08x\n",
|
||||
offset.u.HighPart, offset.u.LowPart, GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!SetFilePointerEx(hf, offset, NULL, FILE_BEGIN)) {
|
||||
fprintf(stderr, "Unable to set file pointer to offset 0x%08x:%08x gle = 0x%08x\n",
|
||||
offset.u.HighPart, offset.u.LowPart, GetLastError());
|
||||
ret = -1;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (!WriteFile(hf, teststr, strlen(teststr)+1, &dwWritten, NULL)) {
|
||||
fprintf(stderr, "Unable to write test string at offset 0x%08x:%08x gle = 0x%08x\n",
|
||||
offset.u.HighPart, offset.u.LowPart, GetLastError());
|
||||
ret = -1;
|
||||
goto unlock;
|
||||
} else {
|
||||
printf("wrote '%s' at offset 0x%08x:%08x\n", teststr, offset.u.HighPart, offset.u.LowPart);
|
||||
}
|
||||
|
||||
unlock:
|
||||
if (!UnlockFile(hf, offset.u.LowPart, offset.u.HighPart,
|
||||
4096, 0)) {
|
||||
fprintf(stderr, "Unable to unlock offset 0x%08x:%08x gle = 0x%08x\n",
|
||||
offset.u.HighPart, offset.u.LowPart, GetLastError());
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (!FlushFileBuffers(hf)) {
|
||||
fprintf(stderr, "Flush buffers fails at offset 0x%08x:%08x gle = 0x%08x\n",
|
||||
offset.u.HighPart, offset.u.LowPart, GetLastError());
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
int test_read(HANDLE hf, LARGE_INTEGER offset) {
|
||||
char buffer[256];
|
||||
DWORD dwRead;
|
||||
int ret = 0;
|
||||
|
||||
if (!LockFile(hf, offset.u.LowPart, offset.u.HighPart,
|
||||
4096, 0)) {
|
||||
fprintf(stderr, "Unable to lock offset 0x%08x:%08x gle = 0x%08x\n",
|
||||
offset.u.HighPart, offset.u.LowPart, GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!SetFilePointerEx(hf, offset, NULL, FILE_BEGIN)) {
|
||||
fprintf(stderr, "Unable to set file pointer to offset 0x%08x:%08x gle = 0x%08x\n",
|
||||
offset.u.HighPart, offset.u.LowPart, GetLastError());
|
||||
ret = -1;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (!ReadFile(hf, buffer, strlen(teststr)+1, &dwRead, NULL)) {
|
||||
fprintf(stderr, "Unable to read test string at offset 0x%08x:%08x gle = 0x%08x\n",
|
||||
offset.u.HighPart, offset.u.LowPart, GetLastError());
|
||||
ret = -1;
|
||||
goto unlock;
|
||||
} else {
|
||||
printf("read '%s' (%d bytes) at offset 0x%08x:%08x\n", buffer, dwRead, offset.u.HighPart, offset.u.LowPart);
|
||||
}
|
||||
|
||||
if (strcmp(buffer, teststr)) {
|
||||
fprintf(stderr, "Test string comparison failure at offset 0x%08x:%08x\n",
|
||||
offset.u.HighPart, offset.u.LowPart);
|
||||
ret = -1;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
unlock:
|
||||
if (!UnlockFile(hf, offset.u.LowPart, offset.u.HighPart,
|
||||
4096, 0)) {
|
||||
fprintf(stderr, "Unable to unlock offset 0x%08x:%08x gle = 0x%08x\n",
|
||||
offset.u.HighPart, offset.u.LowPart, GetLastError());
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[]) {
|
||||
HANDLE fh;
|
||||
__int64 i;
|
||||
char cmdline[512];
|
||||
LARGE_INTEGER large;
|
||||
|
||||
if (argc == 1)
|
||||
usage();
|
||||
|
||||
if (!SetCurrentDirectory(argv[1])) {
|
||||
fprintf(stderr, "unable to set directory to %s\n", argv[1]);
|
||||
return 2;
|
||||
}
|
||||
|
||||
fh = CreateFile("largefile.test",
|
||||
GENERIC_READ | GENERIC_WRITE | STANDARD_RIGHTS_READ | STANDARD_RIGHTS_WRITE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
NULL /* default security */,
|
||||
OPEN_ALWAYS,
|
||||
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS | FILE_FLAG_WRITE_THROUGH,
|
||||
NULL );
|
||||
|
||||
if (fh == INVALID_HANDLE_VALUE) {
|
||||
fprintf(stderr, "unable to create/open the test file\n");
|
||||
return 3;
|
||||
}
|
||||
|
||||
for ( i=0; i<7; i++ ) {
|
||||
|
||||
large.QuadPart = i * (0x40000000-4);
|
||||
test_write(fh, large);
|
||||
|
||||
}
|
||||
|
||||
CloseHandle(fh);
|
||||
|
||||
sprintf(cmdline, "fs.exe flushvolume %s", argv[1]);
|
||||
system(cmdline);
|
||||
|
||||
fh = CreateFile("largefile.test",
|
||||
GENERIC_READ | GENERIC_WRITE | STANDARD_RIGHTS_READ | STANDARD_RIGHTS_WRITE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
NULL /* default security */,
|
||||
OPEN_ALWAYS,
|
||||
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS | FILE_FLAG_WRITE_THROUGH,
|
||||
NULL );
|
||||
|
||||
if (fh == INVALID_HANDLE_VALUE) {
|
||||
fprintf(stderr, "unable to create/open the test file\n");
|
||||
return 3;
|
||||
}
|
||||
|
||||
for ( i=0; i<7; i++ ) {
|
||||
|
||||
large.QuadPart = i * (0x40000000-4);
|
||||
test_read(fh, large);
|
||||
|
||||
}
|
||||
|
||||
CloseHandle(fh);
|
||||
|
||||
return 0;
|
||||
}
|
31
src/WINNT/tests/nmtest/NTMakefile
Normal file
31
src/WINNT/tests/nmtest/NTMakefile
Normal file
@ -0,0 +1,31 @@
|
||||
#
|
||||
# Copyright (c) 2009 Secure Endpoints Inc.
|
||||
#
|
||||
|
||||
RELDIR=WINNT\tests\nmtest
|
||||
!INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME)
|
||||
!INCLUDE ..\..\..\config\NTMakefile.version
|
||||
|
||||
idirs:
|
||||
! if !(exist($(OJT)\WINNT\tests))
|
||||
md $(OJT)\WINNT\tests
|
||||
! endif
|
||||
! if !(exist($(OJT)\WINNT\tests\nmtest))
|
||||
md $(OJT)\WINNT\tests\nmtest
|
||||
! endif
|
||||
|
||||
EXEDIR = $(DESTDIR)\bin
|
||||
|
||||
OBJS = $(OUT)\nmtest.obj
|
||||
|
||||
$(EXEDIR)\nmtest.exe: $(OBJS)
|
||||
$(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib userenv.lib
|
||||
$(_VC_MANIFEST_EMBED_EXE)
|
||||
$(EXEPREP)
|
||||
$(CODESIGN_USERLAND)
|
||||
|
||||
install: idirs $(EXEDIR)\nmtest.exe
|
||||
|
||||
clean::
|
||||
|
||||
|
670
src/WINNT/tests/nmtest/nmtest.c
Normal file
670
src/WINNT/tests/nmtest/nmtest.c
Normal file
@ -0,0 +1,670 @@
|
||||
/*
|
||||
* Copyright (c) 2009 - Secure Endpoints Inc.
|
||||
*
|
||||
* Author: Asanka Herath <asanka@secure-endpoints.com>
|
||||
*/
|
||||
|
||||
#include<windows.h>
|
||||
#include<wincrypt.h>
|
||||
#include<stdlib.h>
|
||||
#include<stdio.h>
|
||||
|
||||
#define BLOCKSIZE 1024
|
||||
#define MAX_PARAM 1
|
||||
|
||||
typedef __int64 offset_t;
|
||||
|
||||
HCRYPTPROV h_prov = 0;
|
||||
|
||||
offset_t N = 0;
|
||||
offset_t M = 0;
|
||||
const char * filename = "";
|
||||
BOOL verify = FALSE;
|
||||
BOOL show_offsets = FALSE;
|
||||
|
||||
typedef struct hash_data {
|
||||
offset_t offset;
|
||||
DWORD param;
|
||||
} hash_data;
|
||||
|
||||
#define ROUNDUP(x, align) (((((x) - 1) / (align)) + 1) * (align))
|
||||
|
||||
void dump_hex(BYTE * buffer, int cb)
|
||||
{
|
||||
static const char *htable[] = {
|
||||
"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"
|
||||
};
|
||||
int i;
|
||||
|
||||
for (i=0; i < cb; i++) {
|
||||
if ((i % 16) == 0) {
|
||||
fprintf(stderr, "\n%08X : ", i);
|
||||
}
|
||||
|
||||
fprintf(stderr, "%s%s",
|
||||
htable[(buffer[i] >> 4) & 0xf],
|
||||
htable[(buffer[i] & 0xf)]);
|
||||
|
||||
if ((i % 16) == 8)
|
||||
fprintf(stderr, "-");
|
||||
else
|
||||
fprintf(stderr, " ");
|
||||
}
|
||||
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
#define CCall(f) if (!f) goto done;
|
||||
|
||||
BOOL init_test_data(void)
|
||||
{
|
||||
return CryptAcquireContext(&h_prov, NULL, MS_DEF_PROV, PROV_RSA_FULL,
|
||||
CRYPT_VERIFYCONTEXT | CRYPT_SILENT);
|
||||
}
|
||||
|
||||
void exit_test_data(void)
|
||||
{
|
||||
if (h_prov)
|
||||
CryptReleaseContext(h_prov, 0);
|
||||
h_prov = 0;
|
||||
}
|
||||
|
||||
BOOL generate_test_data_block(offset_t offset, DWORD param, BYTE buffer[BLOCKSIZE])
|
||||
{
|
||||
HCRYPTHASH h_hash = 0;
|
||||
HCRYPTKEY h_key = 0;
|
||||
hash_data d;
|
||||
DWORD cb_data;
|
||||
BOOL rv = FALSE;
|
||||
|
||||
ZeroMemory(&d, sizeof(d));
|
||||
|
||||
d.offset = offset;
|
||||
d.param = param;
|
||||
|
||||
CCall(CryptCreateHash(h_prov, CALG_SHA1, 0, 0, &h_hash));
|
||||
CCall(CryptHashData(h_hash, (BYTE *) &d, sizeof(d), 0));
|
||||
CCall(CryptDeriveKey(h_prov, CALG_RC4, h_hash, CRYPT_NO_SALT, &h_key));
|
||||
|
||||
ZeroMemory(buffer, BLOCKSIZE);
|
||||
cb_data = BLOCKSIZE;
|
||||
CCall(CryptEncrypt(h_key, 0, TRUE, 0, buffer, &cb_data, cb_data));
|
||||
|
||||
//dump_hex(buffer, 32);
|
||||
|
||||
rv = TRUE;
|
||||
done:
|
||||
|
||||
if (h_hash)
|
||||
CryptDestroyHash(h_hash);
|
||||
if (h_key)
|
||||
CryptDestroyKey(h_key);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
BOOL verify_test_data_block(offset_t offset, DWORD param, BYTE buffer[BLOCKSIZE])
|
||||
{
|
||||
BYTE expected[BLOCKSIZE];
|
||||
|
||||
if (!generate_test_data_block(offset, param, expected)) {
|
||||
return FALSE;
|
||||
}
|
||||
if (!memcmp(expected, buffer, BLOCKSIZE)) {
|
||||
if (param > 0 && show_offsets)
|
||||
printf("... [%I64d]\n", offset, param);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
typedef struct bitmap {
|
||||
DWORD magic;
|
||||
offset_t length;
|
||||
offset_t o_data;
|
||||
BYTE bits[1];
|
||||
} bitmap;
|
||||
|
||||
#define BMAGIC 0xbeefface
|
||||
|
||||
#define NBITMAPBYTES(n) (ROUNDUP((n)/BLOCKSIZE, 8)/8)
|
||||
#define BITMAPSIZE(n) (sizeof(bitmap) + NBITMAPBYTES(n) - 1)
|
||||
#define FILESIZE(n) (DATAOFFSET(n) + (n))
|
||||
#define DATAOFFSET(n) ROUNDUP(BITMAPSIZE(n), BLOCKSIZE)
|
||||
|
||||
bitmap * allocbits(offset_t N)
|
||||
{
|
||||
bitmap * b;
|
||||
|
||||
b = malloc(BITMAPSIZE(N));
|
||||
if (b == NULL)
|
||||
return NULL;
|
||||
|
||||
memset(b, 0, BITMAPSIZE(N));
|
||||
|
||||
b->magic = BMAGIC;
|
||||
b->length = N;
|
||||
b->o_data = DATAOFFSET(N);
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
void freebits(bitmap * b)
|
||||
{
|
||||
if (b)
|
||||
free(b);
|
||||
}
|
||||
|
||||
void setbit(bitmap * b, offset_t o)
|
||||
{
|
||||
if (o < b->o_data || o >= b->o_data + b->length || (o % BLOCKSIZE) != 0) {
|
||||
fprintf(stderr, "Internal error. Invalid offset\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
o = (o - b->o_data) / BLOCKSIZE;
|
||||
|
||||
b->bits[o / 8] |= (1 << (o & 7));
|
||||
}
|
||||
|
||||
BOOL getbit(bitmap * b, offset_t o)
|
||||
{
|
||||
if (o < b->o_data || o >= b->o_data + b->length || (o % BLOCKSIZE) != 0) {
|
||||
fprintf(stderr, "Internal error. Invalid offset\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
o = (o - b->o_data) / BLOCKSIZE;
|
||||
|
||||
return !!(b->bits[o / 8] & (1 << (o & 7)));
|
||||
}
|
||||
|
||||
BOOL write_bitmap(HANDLE h, bitmap * b)
|
||||
{
|
||||
LARGE_INTEGER li;
|
||||
OVERLAPPED ov;
|
||||
offset_t b_size, o;
|
||||
BOOL success = FALSE;
|
||||
|
||||
ZeroMemory(&ov, sizeof(ov));
|
||||
|
||||
b_size = BITMAPSIZE(b->length);
|
||||
|
||||
li.QuadPart = 0;
|
||||
|
||||
if (!SetFilePointerEx(h, li, &li, FILE_BEGIN)) {
|
||||
fprintf(stderr, "Can't set file pointer. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
for (o = 0; o < b_size; o += BLOCKSIZE) {
|
||||
BYTE buffer[BLOCKSIZE];
|
||||
DWORD n_written = 0;
|
||||
|
||||
if (o + BLOCKSIZE <= b_size) {
|
||||
memcpy(buffer, ((BYTE *) b) + o, BLOCKSIZE);
|
||||
} else {
|
||||
memcpy(buffer, ((BYTE *) b) + o, (b_size - o));
|
||||
memset(buffer + (b_size - o), 0, BLOCKSIZE - (b_size - o));
|
||||
}
|
||||
|
||||
li.QuadPart = o;
|
||||
ov.Offset = li.LowPart;
|
||||
ov.OffsetHigh = li.HighPart;
|
||||
|
||||
if (!LockFileEx(h, LOCKFILE_EXCLUSIVE_LOCK, 0, BLOCKSIZE, 0, &ov)) {
|
||||
fprintf(stderr, "Can't lock file. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!WriteFile(h, buffer, BLOCKSIZE, &n_written, NULL) || n_written != BLOCKSIZE) {
|
||||
fprintf(stderr, "Can't write data. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!UnlockFileEx(h, 0, BLOCKSIZE, 0, &ov)) {
|
||||
fprintf(stderr, "Can't unlock file. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
li.QuadPart = 0;
|
||||
if (!SetFilePointerEx(h, li, &li, FILE_CURRENT)) {
|
||||
fprintf(stderr, "Can't set file pointer. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (li.QuadPart != b->o_data) {
|
||||
fprintf(stderr, "Current file pointer is not at start of data.\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
success = TRUE;
|
||||
|
||||
done:
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bitmap* read_bitmap(HANDLE h)
|
||||
{
|
||||
LARGE_INTEGER li;
|
||||
OVERLAPPED ov;
|
||||
bitmap * bfile = NULL;
|
||||
bitmap * bprep = NULL;
|
||||
bitmap * brv = NULL;
|
||||
BYTE buffer[BLOCKSIZE];
|
||||
DWORD n_read = 0;
|
||||
offset_t o;
|
||||
|
||||
ZeroMemory(&ov, sizeof(ov));
|
||||
|
||||
li.QuadPart = 0;
|
||||
|
||||
if (!SetFilePointerEx(h, li, &li, FILE_BEGIN)) {
|
||||
fprintf(stderr, "Can't set file pointer. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
ov.Offset = 0;
|
||||
ov.OffsetHigh = 0;
|
||||
|
||||
if (!LockFileEx(h, 0, 0, BLOCKSIZE, 0, &ov)) {
|
||||
fprintf(stderr, "Can't lock file. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!ReadFile(h, buffer, BLOCKSIZE, &n_read, NULL) || n_read != BLOCKSIZE) {
|
||||
fprintf(stderr, "Can't read data. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!UnlockFileEx(h, 0, BLOCKSIZE, 0, &ov)) {
|
||||
fprintf(stderr, "Can't unlock file. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
bfile = (bitmap *)buffer;
|
||||
|
||||
if (bfile->magic != BMAGIC) {
|
||||
fprintf(stderr, "Corrupt data. Magic number is invalid\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!GetFileSizeEx(h, &li)) {
|
||||
fprintf(stderr, "Can't get file size. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (li.QuadPart != FILESIZE(bfile->length)) {
|
||||
fprintf(stderr, "Corrupt data. Invalid file size.\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (bfile->o_data != DATAOFFSET(bfile->length)) {
|
||||
fprintf(stderr, "Corrupt data. Invalid data offset.\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
bprep = allocbits(bfile->length);
|
||||
|
||||
if (bprep == NULL) {
|
||||
fprintf(stderr, "Can't allocate memory for bitmap\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
memcpy(bprep, bfile, __min(BITMAPSIZE(bfile->length), BLOCKSIZE));
|
||||
|
||||
for (o = BLOCKSIZE; o < BITMAPSIZE(bprep->length); o += BLOCKSIZE) {
|
||||
li.QuadPart = o;
|
||||
ov.Offset = li.LowPart;
|
||||
ov.OffsetHigh = li.HighPart;
|
||||
|
||||
if (!LockFileEx(h, 0, 0, BLOCKSIZE, 0, &ov)) {
|
||||
fprintf(stderr, "Can't lock file. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!ReadFile(h, buffer, BLOCKSIZE, &n_read, NULL) || n_read != BLOCKSIZE) {
|
||||
fprintf(stderr, "Can't read data. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!UnlockFileEx(h, 0, BLOCKSIZE, 0, &ov)) {
|
||||
fprintf(stderr, "Can't unlock file. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
memcpy(((BYTE *) bprep) + o, buffer, __min(BITMAPSIZE(bprep->length) - o, BLOCKSIZE));
|
||||
}
|
||||
|
||||
li.QuadPart = 0;
|
||||
if (!SetFilePointerEx(h, li, &li, FILE_CURRENT)) {
|
||||
fprintf(stderr, "Can't set file pointer. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (li.QuadPart != bprep->o_data) {
|
||||
fprintf(stderr, "Current file pointer not at start of data.\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
brv = bprep;
|
||||
|
||||
done:
|
||||
if (brv == NULL && bprep != NULL) {
|
||||
freebits(bprep);
|
||||
}
|
||||
return brv;
|
||||
}
|
||||
|
||||
int do_verify_test(void)
|
||||
{
|
||||
HANDLE h_file = NULL;
|
||||
int rv = 1;
|
||||
offset_t offset;
|
||||
LARGE_INTEGER li;
|
||||
OVERLAPPED ov;
|
||||
bitmap * b = NULL;
|
||||
|
||||
printf("Verifying test data file [%s]\n", filename);
|
||||
|
||||
h_file = CreateFile(filename, GENERIC_READ, FILE_SHARE_WRITE, NULL,
|
||||
OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
|
||||
if (h_file == INVALID_HANDLE_VALUE) {
|
||||
fprintf(stderr, "Can't open file [%s] GLE=%d\n", filename, GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
b = read_bitmap(h_file);
|
||||
|
||||
if (b == NULL) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
N = b->length;
|
||||
|
||||
printf("File size N = %I64d\n", N);
|
||||
|
||||
if (!init_test_data()) {
|
||||
fprintf(stderr, "Initialize crypto. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
printf("Verifying data ... \n");
|
||||
|
||||
ZeroMemory(&ov, sizeof(ov));
|
||||
|
||||
for (offset = b->o_data; offset < b->o_data+N; offset += BLOCKSIZE) {
|
||||
BYTE buffer[BLOCKSIZE];
|
||||
DWORD n_read = 0;
|
||||
|
||||
li.QuadPart = offset;
|
||||
ov.Offset = li.LowPart;
|
||||
ov.OffsetHigh = li.HighPart;
|
||||
|
||||
if (!LockFileEx(h_file, 0, 0, BLOCKSIZE, 0, &ov)) {
|
||||
printf("ERROR\n");
|
||||
fprintf(stderr, "Can't lock file. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!ReadFile(h_file, buffer, BLOCKSIZE, &n_read, NULL) || n_read != BLOCKSIZE) {
|
||||
printf("ERROR\n");
|
||||
fprintf(stderr, "Can't read data. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!verify_test_data_block(offset, ((getbit(b, offset))? 1 : 0), buffer)) {
|
||||
printf("VERIFY FAILED\n");
|
||||
fprintf(stderr, "Verification failed at offset %I64d\n", offset);
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!UnlockFileEx(h_file, 0, BLOCKSIZE, 0, &ov)) {
|
||||
printf("ERROR\n");
|
||||
fprintf(stderr, "Can't unlock file. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
printf("Verify succeeded!\n");
|
||||
|
||||
rv = 0;
|
||||
|
||||
done:
|
||||
if (b)
|
||||
freebits(b);
|
||||
|
||||
if (h_file)
|
||||
CloseHandle(h_file);
|
||||
|
||||
exit_test_data();
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
int do_write_test(void)
|
||||
{
|
||||
HANDLE h_file = NULL;
|
||||
int rv = 1;
|
||||
offset_t offset;
|
||||
OVERLAPPED ov;
|
||||
bitmap * b = NULL;
|
||||
|
||||
printf("Generating test data file [%s]\n", filename);
|
||||
|
||||
N = (((N - 1)/BLOCKSIZE) + 1) * BLOCKSIZE;
|
||||
M = (((M - 1)/BLOCKSIZE) + 1) * BLOCKSIZE;
|
||||
|
||||
printf("Using N = %I64d and M = %I64d\n", N, M);
|
||||
|
||||
h_file = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE, NULL,
|
||||
CREATE_ALWAYS, FILE_FLAG_RANDOM_ACCESS, NULL);
|
||||
if (h_file == INVALID_HANDLE_VALUE) {
|
||||
fprintf(stderr, "Can't create file [%s] GLE=%d\n", filename, GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
b = allocbits(N);
|
||||
if (b == NULL) {
|
||||
fprintf(stderr, "Can't allocate bitmap.\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!init_test_data()) {
|
||||
fprintf(stderr, "Initialize crypto. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
printf("Phase 1: Generating test data ... ");
|
||||
|
||||
if (!write_bitmap(h_file, b)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
ZeroMemory(&ov, sizeof(ov));
|
||||
|
||||
for (offset = b->o_data; offset < b->o_data + N; offset += BLOCKSIZE) {
|
||||
BYTE buffer[BLOCKSIZE];
|
||||
DWORD n_written = 0;
|
||||
LARGE_INTEGER li;
|
||||
|
||||
if (!generate_test_data_block(offset, 0, buffer)) {
|
||||
printf("ERROR\n");
|
||||
fprintf(stderr, "Can't generate test data. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
li.QuadPart = offset;
|
||||
ov.Offset = li.LowPart;
|
||||
ov.OffsetHigh = li.HighPart;
|
||||
|
||||
if (!LockFileEx(h_file, LOCKFILE_EXCLUSIVE_LOCK, 0, BLOCKSIZE, 0, &ov)) {
|
||||
printf("ERROR\n");
|
||||
fprintf(stderr, "Can't lock file. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!WriteFile(h_file, buffer, BLOCKSIZE, &n_written, NULL) || n_written != BLOCKSIZE) {
|
||||
printf("ERROR\n");
|
||||
fprintf(stderr, "Can't write data. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!UnlockFileEx(h_file, 0, BLOCKSIZE, 0, &ov)) {
|
||||
printf("ERROR\n");
|
||||
fprintf(stderr, "Can't unlock file. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
printf("Done\n");
|
||||
|
||||
if (!FlushFileBuffers(h_file)) {
|
||||
fprintf(stderr, "Can't flush file. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
printf("Phase 2: Overwriting test data ... \n");
|
||||
|
||||
for (offset = 0; offset < M; offset += BLOCKSIZE) {
|
||||
offset_t orandom;
|
||||
BYTE buffer[BLOCKSIZE];
|
||||
LARGE_INTEGER li;
|
||||
DWORD n_written = 0;
|
||||
|
||||
if (!CryptGenRandom(h_prov, sizeof(orandom), (BYTE *) &orandom)) {
|
||||
printf("ERROR\n");
|
||||
fprintf(stderr, "Can't generate random number. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (orandom < 0)
|
||||
orandom = -orandom;
|
||||
orandom = ((orandom % N) / BLOCKSIZE) * BLOCKSIZE;
|
||||
orandom += b->o_data;
|
||||
|
||||
if (show_offsets)
|
||||
printf("... [%I64d]\n", orandom);
|
||||
|
||||
if (!generate_test_data_block(orandom, 1, buffer)) {
|
||||
printf("ERROR\n");
|
||||
fprintf(stderr, "Can't generate test data. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
li.QuadPart = orandom;
|
||||
ov.Offset = li.LowPart;
|
||||
ov.OffsetHigh = li.HighPart;
|
||||
|
||||
if (!LockFileEx(h_file, LOCKFILE_EXCLUSIVE_LOCK, 0, BLOCKSIZE, 0, &ov)) {
|
||||
printf("ERROR\n");
|
||||
fprintf(stderr, "Can't lock file. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!SetFilePointerEx(h_file, li, NULL, FILE_BEGIN)) {
|
||||
printf("ERROR\n");
|
||||
fprintf(stderr, "Can't set file pointer. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!WriteFile(h_file, buffer, BLOCKSIZE, &n_written, NULL) || n_written != BLOCKSIZE) {
|
||||
printf("ERROR\n");
|
||||
fprintf(stderr, "Can't write data. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!UnlockFileEx(h_file, 0, BLOCKSIZE, 0, &ov)) {
|
||||
printf("ERROR\n");
|
||||
fprintf(stderr, "Can't unlock file. GLE=%d\n", GetLastError());
|
||||
goto done;
|
||||
}
|
||||
|
||||
setbit(b, orandom);
|
||||
}
|
||||
|
||||
if (!write_bitmap(h_file, b)) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
printf("Done.\n");
|
||||
|
||||
rv = 0;
|
||||
|
||||
done:
|
||||
if (b)
|
||||
freebits(b);
|
||||
|
||||
if (h_file)
|
||||
CloseHandle(h_file);
|
||||
|
||||
exit_test_data();
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
BOOL show_usage(const char * fn)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"%s : Generate or verify test data file.\n"
|
||||
"\n"
|
||||
"Usage: %s [-r <filename> | -w <N> <M> <filename>]\n"
|
||||
"\n"
|
||||
" -w <N> <M> <filename> :\n"
|
||||
" First writes N bytes of random data into <filename> and then\n"
|
||||
" overwrites M bytes with different random data.\n"
|
||||
"\n"
|
||||
" -r <filename> : \n"
|
||||
" Verify the contents of <filename>. Verification succeeds if\n"
|
||||
" the contents of <filename> was generated using the -w option\n",
|
||||
fn, fn);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL parse_cmdline(int argc, char ** argv)
|
||||
{
|
||||
if (argc == 3) {
|
||||
if (strcmp(argv[1], "-r"))
|
||||
return show_usage(argv[0]);
|
||||
verify = TRUE;
|
||||
N = 0;
|
||||
M = 0;
|
||||
filename = argv[2];
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (argc == 5) {
|
||||
if (strcmp(argv[1], "-w"))
|
||||
return show_usage(argv[0]);
|
||||
verify = FALSE;
|
||||
N = atol(argv[2]);
|
||||
if (N == 0)
|
||||
return show_usage(argv[0]);
|
||||
M = atol(argv[3]);
|
||||
if (M == 0)
|
||||
return show_usage(argv[0]);
|
||||
filename = argv[4];
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return show_usage(argv[0]);
|
||||
}
|
||||
|
||||
int do_tests(void)
|
||||
{
|
||||
if (verify)
|
||||
return do_verify_test();
|
||||
else
|
||||
return do_write_test();
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
if (!parse_cmdline(argc, argv))
|
||||
return 1;
|
||||
|
||||
return do_tests();
|
||||
}
|
258
src/WINNT/tests/torture/DumpAfsLog/DumpAfsLog.c
Normal file
258
src/WINNT/tests/torture/DumpAfsLog/DumpAfsLog.c
Normal file
@ -0,0 +1,258 @@
|
||||
// Stress.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <io.h>
|
||||
|
||||
void usage(void);
|
||||
int GetConsoleInput(HANDLE hStdin);
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int i;
|
||||
int Count;
|
||||
int SecondsDelay;
|
||||
time_t SecondsToRun;
|
||||
int NewSessionDeadlock;
|
||||
int NewSessionDeadlockCount;
|
||||
time_t SecondsToDelay;
|
||||
int MiniDump;
|
||||
int rc;
|
||||
char HostName[512];
|
||||
char LogName[512];
|
||||
char command[512];
|
||||
char WorkingDirectory[512];
|
||||
char LoggingDrive[512];
|
||||
char EnvVariable[512];
|
||||
// char Buffer[512];
|
||||
// char FileName[32];
|
||||
// char *pPtr;
|
||||
time_t StartTime;
|
||||
// FILE *fp;
|
||||
HANDLE hStdin;
|
||||
|
||||
|
||||
Count = 0;
|
||||
SecondsDelay = 15;
|
||||
NewSessionDeadlock = 0;
|
||||
SecondsToRun = 30 * 60;
|
||||
memset(HostName, '\0', sizeof(HostName));
|
||||
memset(command, '\0', sizeof(command));
|
||||
strcpy(LoggingDrive, "C");
|
||||
MiniDump = 0;
|
||||
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
if (!stricmp(argv[i], "-e"))
|
||||
{
|
||||
MiniDump = 1;
|
||||
}
|
||||
if (!stricmp(argv[i], "-s"))
|
||||
{
|
||||
SecondsDelay = atoi(argv[i+1]);
|
||||
}
|
||||
if (!stricmp(argv[i], "-h"))
|
||||
{
|
||||
strcpy(HostName, argv[i+1]);
|
||||
}
|
||||
if (!stricmp(argv[i], "-d"))
|
||||
{
|
||||
strcpy(LoggingDrive, argv[i+1]);
|
||||
if (strlen(LoggingDrive) == 1)
|
||||
strcat(LoggingDrive,":");
|
||||
}
|
||||
if (!stricmp(argv[i], "-m"))
|
||||
{
|
||||
SecondsToRun = atoi(argv[i+1]) * 60;
|
||||
}
|
||||
if (!stricmp(argv[i], "-n"))
|
||||
{
|
||||
NewSessionDeadlock = 1;
|
||||
NewSessionDeadlockCount = atoi(argv[i+1]);
|
||||
if (NewSessionDeadlockCount == 0)
|
||||
NewSessionDeadlockCount = 20;
|
||||
}
|
||||
if (!stricmp(argv[i], "-?") || !stricmp(argv[i], "/?") ||
|
||||
!stricmp(argv[i], "?") || !stricmp(argv[i], "help"))
|
||||
{
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
hStdin = GetStdHandle(STD_INPUT_HANDLE);
|
||||
|
||||
sprintf(command, "fs trace -on");
|
||||
rc = system(command);
|
||||
sprintf(command, "fs trace -reset");
|
||||
rc = system(command);
|
||||
|
||||
GetCurrentDirectory(sizeof(WorkingDirectory), WorkingDirectory);
|
||||
if (WorkingDirectory[0] != LoggingDrive[0])
|
||||
WorkingDirectory[0] = LoggingDrive[0];
|
||||
sprintf(command, "rmdir /Q /S %s\\DumpAfsLogDir", WorkingDirectory);
|
||||
rc = system(command);
|
||||
sprintf(LogName, "%s\\DumpAfsLogDir", WorkingDirectory);
|
||||
sprintf(command, "mkdir %s\\DumpAfsLogDir", WorkingDirectory);
|
||||
rc = system(command);
|
||||
|
||||
time(&StartTime);
|
||||
SecondsToRun += StartTime;
|
||||
while (1)
|
||||
{
|
||||
if (MiniDump)
|
||||
{
|
||||
printf("\n");
|
||||
sprintf(command, "fs minidump");
|
||||
rc = system(command);
|
||||
ExpandEnvironmentStrings("%windir%", EnvVariable, sizeof(EnvVariable));
|
||||
strcat(EnvVariable, "\\TEMP\\afsd.dmp");
|
||||
sprintf(command, "copy /Y %s %s\\DumpAfsLogDir", EnvVariable, WorkingDirectory);
|
||||
printf("%s\n", command);
|
||||
rc = system(command);
|
||||
sprintf(command, "rename %s\\DumpAfsLogDir\\afsd.dmp afsd_%05d.dmp", WorkingDirectory, Count);
|
||||
printf("%s\n", command);
|
||||
rc = system(command);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
sprintf(command, "fs trace -dump");
|
||||
rc = system(command);
|
||||
ExpandEnvironmentStrings("%windir%", EnvVariable, sizeof(EnvVariable));
|
||||
strcat(EnvVariable, "\\TEMP\\afsd.log");
|
||||
sprintf(command, "copy /Y %s %s\\DumpAfsLogDir", EnvVariable, WorkingDirectory);
|
||||
printf("%s\n", command);
|
||||
rc = system(command);
|
||||
// sprintf(command, "crlf.pl -d %s\\DumpAfsLogDir\\afsd.log", WorkingDirectory);
|
||||
// printf("%s\n", command);
|
||||
// rc = system(command);
|
||||
sprintf(command, "rename %s\\DumpAfsLogDir\\afsd.log afsd_%05d.log", WorkingDirectory, Count);
|
||||
printf("%s\n\n", command);
|
||||
rc = system(command);
|
||||
/*
|
||||
if (strlen(HostName) != 0)
|
||||
{
|
||||
sprintf(command, "cmdebug %s -long | grep refcnt > %s\\DumpAfsLogDir\\refcnt_%05d.log",
|
||||
HostName, WorkingDirectory, Count);
|
||||
printf("%s\n", command);
|
||||
rc = system(command);
|
||||
}
|
||||
sprintf(FileName, "%s\\DumpAfsLogDir\\afsd_%05d.log", WorkingDirectory, Count);
|
||||
|
||||
if (NewSessionDeadlock)
|
||||
{
|
||||
fp = fopen(FileName, "r");
|
||||
if (fp != NULL)
|
||||
{
|
||||
while (fgets(Buffer, 512, fp))
|
||||
{
|
||||
// if (pPtr = strstr(Buffer, "RecordRacingRevoke"))
|
||||
// {
|
||||
// if (pPtr = strstr(Buffer, "activeCalls "))
|
||||
// {
|
||||
// pPtr += strlen("activeCalls ");
|
||||
// if (atoi(pPtr) > 0)
|
||||
// {
|
||||
// SetEvent(ShutDownEventHandle);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if (pPtr = strstr(Buffer, "New Session lsn "))
|
||||
{
|
||||
printf("%s", Buffer);
|
||||
pPtr += strlen("New Session lsn " );
|
||||
if (atoi(pPtr) > NewSessionDeadlockCount)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if (pPtr = strstr(Buffer, "Racing revoke scp"))
|
||||
// {
|
||||
// SetEvent(ShutDownEventHandle);
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
*/
|
||||
++Count;
|
||||
time(&StartTime);
|
||||
if (StartTime > SecondsToRun)
|
||||
break;
|
||||
printf("Type Q to stop DumpAfsLog\n");
|
||||
SecondsToDelay = StartTime + SecondsDelay;
|
||||
while (1)
|
||||
{
|
||||
time(&StartTime);
|
||||
if (StartTime > SecondsToDelay)
|
||||
break;
|
||||
rc = GetConsoleInput(hStdin);
|
||||
Sleep(500);
|
||||
}
|
||||
rc = GetConsoleInput(hStdin);
|
||||
}
|
||||
|
||||
sprintf(command, "fs trace -off");
|
||||
rc = system(command);
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
void usage(void)
|
||||
{
|
||||
|
||||
printf("usage: wintorture [options]\n");
|
||||
printf("where options can be:\n");
|
||||
printf("\t-d <drive> Local drive letter where to place log files\n");
|
||||
printf("\t-e Enable fs minidump\n");
|
||||
printf("\t-h <host> Local host name. Used to run cmdebug\n");
|
||||
printf("\t-m <min> Number of minutes to run this program\n");
|
||||
// printf("\t-n <num> Stop processing on \"New Session lsn XX\" deadlock\n");
|
||||
printf("\t-s <sec> Seconds delay between dumping AFS logs\n");
|
||||
printf("\t 15 seconds delay is the default\n");
|
||||
}
|
||||
|
||||
int GetConsoleInput(HANDLE hStdin)
|
||||
{
|
||||
INPUT_RECORD InputRecord[128];
|
||||
DWORD InputRecordCount;
|
||||
BOOL rc;
|
||||
int i;
|
||||
int RetCode;
|
||||
char ReadChar;
|
||||
|
||||
InputRecordCount = 0;
|
||||
RetCode = 0;
|
||||
if (!(rc = PeekConsoleInput(hStdin, InputRecord, 128, &InputRecordCount)))
|
||||
return(0);
|
||||
if (InputRecordCount == 0)
|
||||
return(0);
|
||||
rc = ReadConsoleInput(hStdin, InputRecord, 128, &InputRecordCount);
|
||||
for (i = 0; i < (int)InputRecordCount; i++)
|
||||
{
|
||||
switch(InputRecord[i].EventType)
|
||||
{
|
||||
case KEY_EVENT:
|
||||
if (InputRecord[i].Event.KeyEvent.bKeyDown)
|
||||
{
|
||||
ReadChar = InputRecord[i].Event.KeyEvent.uChar.AsciiChar;
|
||||
if ((ReadChar == 'q') || (ReadChar == 'Q'))
|
||||
{
|
||||
printf("Stop request received\n");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return(RetCode);
|
||||
}
|
||||
|
88
src/WINNT/tests/torture/DumpAfsLog/DumpAfsLog.dsp
Normal file
88
src/WINNT/tests/torture/DumpAfsLog/DumpAfsLog.dsp
Normal file
@ -0,0 +1,88 @@
|
||||
# Microsoft Developer Studio Project File - Name="DumpAfsLog" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=DumpAfsLog - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "DumpAfsLog.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "DumpAfsLog.mak" CFG="DumpAfsLog - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "DumpAfsLog - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "DumpAfsLog - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "DumpAfsLog - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "DumpAfsLog - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "DumpAfsLog - Win32 Release"
|
||||
# Name "DumpAfsLog - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DumpAfsLog.c
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
29
src/WINNT/tests/torture/DumpAfsLog/DumpAfsLog.dsw
Normal file
29
src/WINNT/tests/torture/DumpAfsLog/DumpAfsLog.dsw
Normal file
@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "DumpAfsLog"=".\DumpAfsLog.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
35
src/WINNT/tests/torture/DumpAfsLog/NTMakefile
Normal file
35
src/WINNT/tests/torture/DumpAfsLog/NTMakefile
Normal file
@ -0,0 +1,35 @@
|
||||
#
|
||||
# Copyright (c) 2009 Secure Endpoints Inc.
|
||||
#
|
||||
|
||||
AFSDEV_AUXCDEFINES=-I..\include
|
||||
RELDIR=WINNT\tests\torture\dumpafslog
|
||||
!INCLUDE ..\..\..\..\config\NTMakefile.$(SYS_NAME)
|
||||
!INCLUDE ..\..\..\..\config\NTMakefile.version
|
||||
|
||||
idirs:
|
||||
! if !(exist($(OJT)\WINNT\tests))
|
||||
md $(OJT)\WINNT\tests
|
||||
! endif
|
||||
! if !(exist($(OJT)\WINNT\tests\torture))
|
||||
md $(OJT)\WINNT\tests\torture
|
||||
! endif
|
||||
! if !(exist($(OJT)\WINNT\tests\torture\dumpafslog))
|
||||
md $(OJT)\WINNT\tests\torture\dumpafslog
|
||||
! endif
|
||||
|
||||
EXEDIR = $(DESTDIR)\bin
|
||||
|
||||
OBJS = $(OUT)\DumpAfsLog.obj
|
||||
|
||||
$(EXEDIR)\DumpAfsLog.exe: $(OBJS)
|
||||
$(EXECONLINK)
|
||||
$(_VC_MANIFEST_EMBED_EXE)
|
||||
$(EXEPREP)
|
||||
$(CODESIGN_USERLAND)
|
||||
|
||||
install: idirs $(EXEDIR)\DumpAfsLog.exe
|
||||
|
||||
clean::
|
||||
|
||||
|
31
src/WINNT/tests/torture/NTMakefile
Normal file
31
src/WINNT/tests/torture/NTMakefile
Normal file
@ -0,0 +1,31 @@
|
||||
#
|
||||
# Copyright (c) 2009 Secure Endpoints Inc.
|
||||
#
|
||||
|
||||
RELDIR=WINNT\tests\torture
|
||||
!INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME)
|
||||
!INCLUDE ..\..\..\config\NTMakefile.version
|
||||
|
||||
install:
|
||||
cd Source
|
||||
$(MAKECMD) /nologo /f NTMakefile install
|
||||
cd ..\DumpAfsLog
|
||||
$(MAKECMD) /nologo /f NTMakefile install
|
||||
cd ..\Stress
|
||||
$(MAKECMD) /nologo /f NTMakefile install
|
||||
cd ..\StopStressTest
|
||||
$(MAKECMD) /nologo /f NTMakefile install
|
||||
cd ..
|
||||
|
||||
clean::
|
||||
cd Source
|
||||
$(MAKECMD) /nologo /f NTMakefile clean
|
||||
cd ..\DumpAfsLog
|
||||
$(MAKECMD) /nologo /f NTMakefile clean
|
||||
cd ..\Stress
|
||||
$(MAKECMD) /nologo /f NTMakefile clean
|
||||
cd ..\StopStressTest
|
||||
$(MAKECMD) /nologo /f NTMakefile clean
|
||||
cd ..
|
||||
|
||||
|
39
src/WINNT/tests/torture/Source/NTMakefile
Normal file
39
src/WINNT/tests/torture/Source/NTMakefile
Normal file
@ -0,0 +1,39 @@
|
||||
#
|
||||
# Copyright (c) 2009 Secure Endpoints Inc.
|
||||
#
|
||||
|
||||
AFSDEV_AUXCDEFINES=-I..\include
|
||||
RELDIR=WINNT\tests\torture\source
|
||||
!INCLUDE ..\..\..\..\config\NTMakefile.$(SYS_NAME)
|
||||
!INCLUDE ..\..\..\..\config\NTMakefile.version
|
||||
|
||||
idirs:
|
||||
! if !(exist($(OJT)\WINNT\tests))
|
||||
md $(OJT)\WINNT\tests
|
||||
! endif
|
||||
! if !(exist($(OJT)\WINNT\tests\torture))
|
||||
md $(OJT)\WINNT\tests\torture
|
||||
! endif
|
||||
! if !(exist($(OJT)\WINNT\tests\torture\source))
|
||||
md $(OJT)\WINNT\tests\torture\source
|
||||
! endif
|
||||
|
||||
EXEDIR = $(DESTDIR)\bin
|
||||
|
||||
OBJS = $(OUT)\nbio.obj \
|
||||
$(OUT)\output.obj \
|
||||
$(OUT)\ResolveLocker.obj \
|
||||
$(OUT)\WinThreads.obj \
|
||||
$(OUT)\WinTorture.obj \
|
||||
|
||||
$(EXEDIR)\wintorture.exe: $(OBJS)
|
||||
$(EXECONLINK) psapi.lib
|
||||
$(_VC_MANIFEST_EMBED_EXE)
|
||||
$(EXEPREP)
|
||||
$(CODESIGN_USERLAND)
|
||||
|
||||
install: idirs $(EXEDIR)\wintorture.exe
|
||||
|
||||
clean::
|
||||
|
||||
|
154
src/WINNT/tests/torture/Source/ResolveLocker.c
Normal file
154
src/WINNT/tests/torture/Source/ResolveLocker.c
Normal file
@ -0,0 +1,154 @@
|
||||
/*
|
||||
* MODULE: locker.c.
|
||||
*
|
||||
* Copyright (C) 1988-1998 by the Massachusetts Institute of Technology.
|
||||
* For copying and distribution information, please see the file
|
||||
* <mit-copyright.h>.
|
||||
*
|
||||
* Description: functions used by add, attach, detach, and shell extensions
|
||||
*/
|
||||
#ifdef HAVE_HESOID
|
||||
|
||||
#ifdef _WIN32_WINNT
|
||||
#undef _WIN32_WINNT
|
||||
#endif
|
||||
|
||||
#define _WIN32_WINNT 0x0500
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <hesiod.h>
|
||||
#include <locker.h>
|
||||
|
||||
|
||||
char **ResolveHesName(char *locker);
|
||||
void GetLockerInfo(char *Locker, char *Path);
|
||||
|
||||
int ResolveLocker(USER_OPTIONS *attachOption)
|
||||
{
|
||||
char HostName[128];
|
||||
char path[2048];
|
||||
char MountDir[2048];
|
||||
char ReparseDir[MAX_PATH];
|
||||
char AccessMode[16];
|
||||
char temp[4096];
|
||||
char FileSystem[16];
|
||||
int i;
|
||||
|
||||
memset(path, '\0', sizeof(path));
|
||||
if (!stricmp(attachOption->type, "locker"))
|
||||
{
|
||||
GetLockerInfo(attachOption->Locker, path);
|
||||
if (strlen(path) == 0)
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
memset(MountDir, 0, sizeof(MountDir));
|
||||
memset(AccessMode, 0, sizeof(AccessMode));
|
||||
memset(ReparseDir, 0, sizeof(ReparseDir));
|
||||
memset(temp, 0, sizeof(temp));
|
||||
sscanf(path, "%s %s", FileSystem, temp);
|
||||
|
||||
if (!strcmp(FileSystem, "AFS"))
|
||||
{
|
||||
sprintf(attachOption->SubMount, "\\\\afs\\%s", attachOption->Locker);
|
||||
for (i = 0; i < (int)strlen(attachOption->SubMount); i++)
|
||||
{
|
||||
if (attachOption->SubMount[i] == '/')
|
||||
attachOption->SubMount[i] = '\\';
|
||||
}
|
||||
strcpy(attachOption->type, "AFS");
|
||||
return(TRUE);
|
||||
}
|
||||
else if (!strcmp(FileSystem, "NFS"))
|
||||
{
|
||||
if (strlen(attachOption->SubMount) != 0)
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
if (sscanf(path, "%s %s %s %s %s", FileSystem, temp, HostName,
|
||||
AccessMode, ReparseDir) != 5)
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
sprintf(attachOption->SubMount, "\\\\%s%s", HostName, temp);
|
||||
for (i = 0; i < (int)strlen(attachOption->SubMount); i++)
|
||||
{
|
||||
if (attachOption->SubMount[i] == '/')
|
||||
attachOption->SubMount[i] = '\\';
|
||||
}
|
||||
strcpy(attachOption->FileType, "NFS");
|
||||
return(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
// rc = resource_mount(attachOption, addtoPath, addtoFront, appName,
|
||||
// MountDir, HostName, FileSystem);
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
void GetLockerInfo(char *Locker, char *Path)
|
||||
{
|
||||
char** cpp;
|
||||
char cWeight[3];
|
||||
char cPath[256];
|
||||
int i;
|
||||
int last_weight;
|
||||
|
||||
cpp = NULL;
|
||||
cpp = ResolveHesName(Locker);
|
||||
|
||||
if (cpp != NULL)
|
||||
{
|
||||
memset(cWeight, 0, sizeof(cWeight));
|
||||
memset(cPath, 0, sizeof(cPath));
|
||||
last_weight = 1000;
|
||||
i = 0;
|
||||
while (cpp[i] != NULL)
|
||||
{
|
||||
memset(cPath, '\0', sizeof(cPath));
|
||||
if (sscanf(cpp[i], "%*s %s", cPath))
|
||||
{
|
||||
if (strnicmp(cpp[i], "AFS", strlen("AFS")) == 0)
|
||||
{
|
||||
memset(cWeight, '\0', sizeof(cWeight));
|
||||
if (sscanf(cpp[i], "%*s %*s %*s %*s %s", cWeight))
|
||||
{
|
||||
if (atoi(cWeight) < last_weight)
|
||||
{
|
||||
strcpy(Path, cpp[i]);
|
||||
last_weight = (int)atoi(cWeight);
|
||||
}
|
||||
}
|
||||
else
|
||||
strcpy(Path, cpp[i]);
|
||||
}
|
||||
if (strnicmp(cpp[i], "NFS", strlen("NFS")) == 0)
|
||||
strcpy(Path, cpp[i]);
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
char **ResolveHesName(char *locker)
|
||||
{
|
||||
char type[16];
|
||||
char** cpp;
|
||||
strcpy(type, "filsys");
|
||||
|
||||
cpp = NULL;
|
||||
cpp = hes_resolve(locker, type);
|
||||
|
||||
return cpp;
|
||||
}
|
||||
#endif /*HAVE_HESOID */
|
622
src/WINNT/tests/torture/Source/WinThreads.c
Normal file
622
src/WINNT/tests/torture/Source/WinThreads.c
Normal file
@ -0,0 +1,622 @@
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include "includes.h"
|
||||
#include "common.h"
|
||||
#ifdef HAVE_HESOID
|
||||
#include "ResolveLocker.h"
|
||||
int ResolveLocker(USER_OPTIONS *attachOption);
|
||||
#endif
|
||||
#ifndef NO_AFS_SOURCE
|
||||
#include <afs\stds.h>
|
||||
#include <afs\smb_iocons.h>
|
||||
#include <afs\afsint.h>
|
||||
#include <afs\pioctl_nt.h>
|
||||
#else
|
||||
#define VIOCGETVOLSTAT 0x7
|
||||
#define afs_int32 int
|
||||
|
||||
struct VolumeStatus {
|
||||
afs_int32 Vid;
|
||||
afs_int32 ParentId;
|
||||
char Online;
|
||||
char InService;
|
||||
char Blessed;
|
||||
char NeedsSalvage;
|
||||
afs_int32 Type;
|
||||
afs_int32 MinQuota;
|
||||
afs_int32 MaxQuota;
|
||||
afs_int32 BlocksInUse;
|
||||
afs_int32 PartBlocksAvail;
|
||||
afs_int32 PartMaxBlocks;
|
||||
};
|
||||
|
||||
typedef struct VolumeStatus VolumeStatus;
|
||||
|
||||
typedef struct ViceIoctl {
|
||||
long in_size;
|
||||
long out_size;
|
||||
void *in;
|
||||
void *out;
|
||||
} viceIoctl_t;
|
||||
extern long pioctl(char *pathp, long opcode, struct ViceIoctl *blob, int follow);
|
||||
#endif
|
||||
|
||||
#define MAX_PARAMS 20
|
||||
#define ival(s) strtol(s, NULL, 0)
|
||||
#define AFSDLL "afsauthent.dll"
|
||||
|
||||
#define WINTORTURE_ASFDLL_ONLINE 1
|
||||
#define WINTORTURE_ASFDLL_OFFLINE 2
|
||||
#define WINTORTURE_ASFDLL_NOTFOUND 3
|
||||
#define WINTORTURE_ASFPIOCTL_NOTFOUND 4
|
||||
|
||||
extern int verbose;
|
||||
|
||||
extern void EndSecondTime(int cmd);
|
||||
extern void StartSecondTime(int cmd);
|
||||
extern void LogMessage(int ProcessNumber, char *HostName, char *FileName, char *message, int LogID);
|
||||
extern void LogStats(char *FileName, int ToLog, int Iteration, int NumberOfProcesses, int NumberOfThreads,
|
||||
char *HostName, int ProcessNumber, struct cmd_struct ThreadCommandInfo[],
|
||||
char *CommandLine, char *TargetDirectory);
|
||||
extern void SubstituteString(char *s,const char *pattern,const char *insert, size_t len);
|
||||
|
||||
int IsOnline(char *strPath);
|
||||
BOOL run_netbench(int client, char *ClientTxt, char *PathToSecondDir);
|
||||
|
||||
HANDLE MutexHandle;
|
||||
HANDLE FileMutexHandle;
|
||||
HANDLE ShutDownEventHandle;
|
||||
HANDLE PauseEventHandle;
|
||||
HANDLE ContinueEventHandle;
|
||||
HANDLE OSMutexHandle;
|
||||
|
||||
__declspec( thread ) int AfsTrace;
|
||||
__declspec( thread ) int CurrentLoop;
|
||||
__declspec( thread ) int ProcessNumber = 0;
|
||||
__declspec( thread ) int LogID = 0;
|
||||
__declspec( thread ) int LineCount = 0;
|
||||
__declspec( thread ) int *pThreadStatus;
|
||||
__declspec( thread ) DWORD TickCount1,TickCount2, MilliTickStart;
|
||||
__declspec( thread ) int BufferSize = 4096;
|
||||
__declspec( thread ) char *IoBuffer = NULL;
|
||||
__declspec( thread ) char AfsLocker[256];
|
||||
__declspec( thread ) char OriginalAfsLocker[256];
|
||||
__declspec( thread ) char HostName[256];
|
||||
__declspec( thread ) struct cmd_struct ThreadCommandInfo[CMD_MAX_CMD + 1];
|
||||
__declspec( thread ) FTABLE ftable[MAX_FILES];
|
||||
__declspec( thread ) HANDLE hWinEventHandle;
|
||||
__declspec( thread ) EXIT_STATUS *pExitStatus;
|
||||
__declspec( thread ) DWORD LastKnownError;
|
||||
|
||||
|
||||
DWORD WINAPI StressTestThread(LPVOID lpThreadParameter)
|
||||
{
|
||||
int j;
|
||||
int rc;
|
||||
size_t count;
|
||||
int ProcessID;
|
||||
char EventName[64];
|
||||
char FileName[256];
|
||||
char CommandLine[512];
|
||||
char TargetDirectory[512];
|
||||
char WorkingDirectory[512];
|
||||
char ClientText[128];
|
||||
char PathToSecondDir[256];
|
||||
char temp[512];
|
||||
BOOL PrintStats;
|
||||
PARAMETERLIST *pParameterList;
|
||||
struct cmd_struct *WinCommandInfo;
|
||||
|
||||
pParameterList = (PARAMETERLIST *)lpThreadParameter;
|
||||
pThreadStatus = pParameterList->pThreadStatus;
|
||||
BufferSize = pParameterList->BufferSize;
|
||||
ProcessNumber = pParameterList->ProcessNumber;
|
||||
PrintStats = pParameterList->PrintStats;
|
||||
CurrentLoop = pParameterList->CurrentLoop;
|
||||
ProcessID = pParameterList->ProcessID;
|
||||
LogID = pParameterList->LogID;
|
||||
AfsTrace = pParameterList->AfsTrace;
|
||||
pExitStatus = pParameterList->pExitStatus;
|
||||
strcpy(TargetDirectory, pParameterList->TargetDirectory);
|
||||
strcpy(CommandLine, pParameterList->CommandLine);
|
||||
strcpy(ClientText, pParameterList->ClientText);
|
||||
strcpy(PathToSecondDir, pParameterList->PathToSecondDir);
|
||||
strcpy(AfsLocker, pParameterList->AfsLocker);
|
||||
strcpy(HostName, pParameterList->HostName);
|
||||
WinCommandInfo = ( struct cmd_struct *)pParameterList->CommandInfo;
|
||||
|
||||
sprintf(EventName, "%d%sEvent%05d", ProcessID, HostName, ProcessNumber);
|
||||
hWinEventHandle = OpenEvent(EVENT_ALL_ACCESS, TRUE, EventName);
|
||||
|
||||
sprintf(FileName, "Thread_%05d.log", ProcessNumber);
|
||||
GetCurrentDirectory(sizeof(WorkingDirectory), WorkingDirectory);
|
||||
sprintf(temp, "%s\\log%05d\\%s", WorkingDirectory, LogID, HostName);
|
||||
CreateDirectory(temp, NULL);
|
||||
|
||||
|
||||
memset(ftable, '\0', sizeof(ftable[0]) * MAX_FILES);
|
||||
IoBuffer = malloc(BufferSize);
|
||||
if (!IoBuffer)
|
||||
{
|
||||
strcpy(pExitStatus->Reason, "Unable to allocate buffer");
|
||||
pExitStatus->ExitStatus = 1;
|
||||
SetEvent(hWinEventHandle);
|
||||
ExitThread(1);
|
||||
}
|
||||
memset(IoBuffer, (unsigned char)getpid(), BufferSize);
|
||||
|
||||
ShutDownEventHandle = CreateEvent(NULL, TRUE, FALSE, "AfsShutdownEvent");
|
||||
PauseEventHandle = CreateEvent(NULL, TRUE, FALSE, "AfsPauseEvent");
|
||||
ContinueEventHandle = CreateEvent(NULL, TRUE, FALSE, "AfsContinueEvent");
|
||||
OSMutexHandle = CreateMutex(NULL, FALSE, "WinTortureOSMutex");
|
||||
MutexHandle = CreateMutex(NULL, FALSE, "WinTortureMutex");
|
||||
|
||||
strcpy(OriginalAfsLocker, AfsLocker);
|
||||
|
||||
while (1)
|
||||
{
|
||||
LastKnownError = 0;
|
||||
for (j = 0; j <= CMD_MAX_CMD; j++)
|
||||
{
|
||||
WinCommandInfo[j].count = 0;
|
||||
WinCommandInfo[j].min_sec = 0;
|
||||
WinCommandInfo[j].max_sec = 0;
|
||||
WinCommandInfo[j].MilliSeconds = 0;
|
||||
WinCommandInfo[j].total_sec = 0;
|
||||
WinCommandInfo[j].total_sum_of_squares = 0;
|
||||
WinCommandInfo[j].ErrorCount = 0;
|
||||
WinCommandInfo[j].ErrorTime = 0;
|
||||
ThreadCommandInfo[j].count = 0;
|
||||
ThreadCommandInfo[j].min_sec = 1000;
|
||||
ThreadCommandInfo[j].max_sec = 0;
|
||||
ThreadCommandInfo[j].MilliSeconds = 0;
|
||||
ThreadCommandInfo[j].total_sec = 0;
|
||||
ThreadCommandInfo[j].total_sum_of_squares = 0;
|
||||
ThreadCommandInfo[j].ErrorCount = 0;
|
||||
ThreadCommandInfo[j].ErrorTime = 0;
|
||||
}
|
||||
|
||||
run_netbench(ProcessNumber, ClientText, PathToSecondDir);
|
||||
if (LastKnownError != ERROR_NETNAME_DELETED)
|
||||
break;
|
||||
sprintf(temp, "entered error %d processing\n", LastKnownError);
|
||||
LogMessage(ProcessNumber, HostName, FileName, temp, LogID);
|
||||
|
||||
count = strlen(pExitStatus->Reason);
|
||||
if (count != 0)
|
||||
memset(pExitStatus->Reason, '\0', count);
|
||||
pExitStatus->ExitStatus = 0;
|
||||
(*pThreadStatus) = 1;
|
||||
count = 0;
|
||||
|
||||
while ((rc = IsOnline(OriginalAfsLocker)) != WINTORTURE_ASFDLL_ONLINE)
|
||||
{
|
||||
if ((count > 3) || (rc == WINTORTURE_ASFDLL_NOTFOUND) || (rc == WINTORTURE_ASFPIOCTL_NOTFOUND))
|
||||
{
|
||||
LastKnownError = 0;
|
||||
sprintf(temp, "AFS path \"%s\" appears to be off-line\n", OriginalAfsLocker);
|
||||
strcpy(pExitStatus->Reason, temp);
|
||||
pExitStatus->ExitStatus = 1;
|
||||
(*pThreadStatus) = 0;
|
||||
printf("%s", temp);
|
||||
LogMessage(ProcessNumber, HostName, FileName, temp, LogID);
|
||||
strcpy(temp, "Stress test is terminating\n");
|
||||
printf(temp);
|
||||
LogMessage(ProcessNumber, HostName, FileName, temp, LogID);
|
||||
break;
|
||||
}
|
||||
sprintf(temp, "AFS path \"%s\" is online, sleeping 10 seconds before continuing\n", OriginalAfsLocker);
|
||||
LogMessage(ProcessNumber, HostName, FileName, temp, LogID);
|
||||
++count;
|
||||
Sleep(10 * 1000);
|
||||
}
|
||||
sprintf(temp, "leaving error 0x%x processing\n", LastKnownError);
|
||||
LogMessage(ProcessNumber, HostName, FileName, temp, LogID);
|
||||
if (count > 3)
|
||||
break;
|
||||
}
|
||||
free(IoBuffer);
|
||||
|
||||
for (j = 0; j <= CMD_MAX_CMD; j++)
|
||||
{
|
||||
WinCommandInfo[j].count += ThreadCommandInfo[j].count;
|
||||
WinCommandInfo[j].min_sec += ThreadCommandInfo[j].min_sec;
|
||||
WinCommandInfo[j].max_sec += ThreadCommandInfo[j].max_sec;
|
||||
WinCommandInfo[j].total_sec += ThreadCommandInfo[j].total_sec;
|
||||
WinCommandInfo[j].total_sum_of_squares += ThreadCommandInfo[j].total_sum_of_squares;
|
||||
WinCommandInfo[j].ErrorCount += ThreadCommandInfo[j].ErrorCount;
|
||||
WinCommandInfo[j].ErrorTime += ThreadCommandInfo[j].ErrorTime;
|
||||
}
|
||||
|
||||
memset(WorkingDirectory, '\0', sizeof(WorkingDirectory));
|
||||
GetCurrentDirectory(sizeof(WorkingDirectory), WorkingDirectory);
|
||||
sprintf(FileName, "%s\\log%05d\\%s\\Thread_%05d_Stats.log", WorkingDirectory, LogID, HostName, ProcessNumber);
|
||||
|
||||
if (PrintStats)
|
||||
{
|
||||
WaitForSingleObject(MutexHandle, 4 * 1000);
|
||||
LogStats(FileName, 0, CurrentLoop, 0, 0, HostName, ProcessNumber, ThreadCommandInfo, CommandLine, TargetDirectory);
|
||||
ReleaseMutex(MutexHandle);
|
||||
}
|
||||
|
||||
LogStats(FileName, 1, CurrentLoop, 0, 0, HostName, ProcessNumber, ThreadCommandInfo,CommandLine, TargetDirectory);
|
||||
|
||||
SetEvent(hWinEventHandle);
|
||||
CloseHandle(hWinEventHandle);
|
||||
// CloseHandle(OSMutexHandle);
|
||||
// CloseHandle(MutexHandle);
|
||||
|
||||
ExitThread(0);
|
||||
return(0);
|
||||
}
|
||||
|
||||
BOOL run_netbench(int client, char *ClientText, char *PathToSecondDir)
|
||||
{
|
||||
pstring line;
|
||||
pstring line1;
|
||||
char cname[20];
|
||||
char *params[MAX_PARAMS];
|
||||
char temp[256];
|
||||
char FileName[256];
|
||||
char *pPtr;
|
||||
int rc;
|
||||
int i;
|
||||
int IncreaseBy;
|
||||
BOOL correct = TRUE;
|
||||
DWORD dwFlags = 0;
|
||||
DWORD NumberOfBytes;
|
||||
DWORD TotalBytesRead;
|
||||
HANDLE hFile;
|
||||
enum states bm_state;
|
||||
CRITICAL_SECTION CriticalSection;
|
||||
|
||||
|
||||
InitializeCriticalSection(&CriticalSection);
|
||||
|
||||
sprintf(cname, "client%d", client);
|
||||
|
||||
sprintf(temp, "Started Iteration %d\n", CurrentLoop);
|
||||
sprintf(FileName, "Thread_%05d.log", ProcessNumber);
|
||||
LogMessage(ProcessNumber, HostName, FileName, temp, LogID);
|
||||
sprintf(temp, "Thread %d started\n", ProcessNumber);
|
||||
sprintf(FileName, "Thread_%05d.log", ProcessNumber);
|
||||
LogMessage(ProcessNumber, HostName, FileName, temp, LogID);
|
||||
|
||||
hFile = CreateFile(ClientText, GENERIC_READ | STANDARD_RIGHTS_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
perror(ClientText);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
StartSecondTime(CMD_NONAFS);
|
||||
TotalBytesRead = 0;
|
||||
while (1)
|
||||
{
|
||||
memset(line, '\0', sizeof(line));
|
||||
NumberOfBytes = 0;
|
||||
rc = ReadFile(hFile, line, 128, &NumberOfBytes, NULL);
|
||||
if (rc && NumberOfBytes == 0)
|
||||
break;
|
||||
pPtr = strchr(line, '\n');
|
||||
IncreaseBy = 0;
|
||||
if (pPtr != NULL)
|
||||
{
|
||||
IncreaseBy += 1;
|
||||
(*pPtr) = '\0';
|
||||
if ((*(pPtr - 1)) == '\r')
|
||||
{
|
||||
IncreaseBy += 1;
|
||||
(*(pPtr - 1)) = '\0';
|
||||
}
|
||||
}
|
||||
TotalBytesRead += (DWORD)(strlen(line) + IncreaseBy);
|
||||
SetFilePointer(hFile, TotalBytesRead, 0, FILE_BEGIN);
|
||||
strcpy(line1, line);
|
||||
if (rc = WaitForSingleObject(PauseEventHandle, 0) == WAIT_OBJECT_0)
|
||||
{
|
||||
strcpy(temp, "AFS suspend request received\n");
|
||||
sprintf(FileName, "Thread_%05d.log", ProcessNumber);
|
||||
LogMessage(ProcessNumber, HostName, FileName, temp, LogID);
|
||||
while (WaitForSingleObject(ContinueEventHandle, 5000) == WAIT_TIMEOUT);
|
||||
strcpy(temp, "AFS continue request received\n");
|
||||
sprintf(FileName, "Thread_%05d.log", ProcessNumber);
|
||||
LogMessage(ProcessNumber, HostName, FileName, temp, LogID);
|
||||
}
|
||||
if (rc = WaitForSingleObject(ShutDownEventHandle, 0) == WAIT_OBJECT_0)
|
||||
{
|
||||
strcpy(temp, "AFS shutdown request received\n");
|
||||
sprintf(FileName, "Thread_%05d.log", ProcessNumber);
|
||||
LogMessage(ProcessNumber, HostName, FileName, temp, LogID);
|
||||
break;
|
||||
}
|
||||
LineCount++;
|
||||
if (strlen(line) == 0)
|
||||
continue;
|
||||
if (line[0] == '#')
|
||||
continue;
|
||||
/*printf("[%d] %s\n", LineCount, line);*/
|
||||
|
||||
for (i = 0; i < MAX_PARAMS; i++)
|
||||
params[i] = NULL;
|
||||
|
||||
SubstituteString(line,"client1", cname, sizeof(line));
|
||||
sprintf(temp, "%s%05d", HostName, LogID);
|
||||
SubstituteString(line,"clients", temp, sizeof(line));
|
||||
SubstituteString(line,"\\\\afs\\locker", AfsLocker, sizeof(line));
|
||||
if (strlen(PathToSecondDir) != 0)
|
||||
SubstituteString(line,"\\\\afs\\lcolby", PathToSecondDir, sizeof(line));
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
EnterCriticalSection(&CriticalSection);
|
||||
printf("Thread%05d - %-6d - %s\n", ProcessNumber, LineCount, line);
|
||||
LeaveCriticalSection(&CriticalSection);
|
||||
}
|
||||
|
||||
pPtr = line;
|
||||
i = 0;
|
||||
while (pPtr != NULL)
|
||||
{
|
||||
if ((*pPtr) == ' ')
|
||||
{
|
||||
(*pPtr) = '\0';
|
||||
++pPtr;
|
||||
continue;
|
||||
}
|
||||
params[i] = pPtr;
|
||||
++i;
|
||||
pPtr = strstr(pPtr, " ");
|
||||
if (pPtr != NULL)
|
||||
{
|
||||
(*pPtr) = '\0';
|
||||
++pPtr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
params[i] = "";
|
||||
|
||||
if (i < 1)
|
||||
continue;
|
||||
|
||||
if (!strncmp(params[0],"SMB", 3))
|
||||
{
|
||||
printf("ERROR: You are using a dbench 1 load file\n");
|
||||
if (GetHandleInformation((HANDLE)hWinEventHandle, &dwFlags))
|
||||
break;
|
||||
}
|
||||
if (!strcmp(params[0], "BM_SETUP"))
|
||||
{
|
||||
bm_state = BM_SETUP;
|
||||
}
|
||||
else if (!strcmp(params[0], "BM_WARMUP"))
|
||||
{
|
||||
bm_state = BM_WARMUP;
|
||||
}
|
||||
else if (!strcmp(params[0], "BM_MEASURE"))
|
||||
{
|
||||
bm_state = BM_MEASURE;
|
||||
if (verbose)
|
||||
fprintf(stderr, "setting state to BM_MEASURE\n");
|
||||
}
|
||||
else if (!strcmp(params[0],"RECONNECT"))
|
||||
{
|
||||
if (verbose)
|
||||
fprintf(stderr, "Reconnecting ...\n");
|
||||
}
|
||||
else if (!strcmp(params[0], "SYNC"))
|
||||
{
|
||||
int length = atoi(params[1]), st = 0;
|
||||
if (verbose)
|
||||
fprintf(stderr, "Syncing for %d seconds\n", length);
|
||||
}
|
||||
else if (!strcmp(params[0],"NTCreateX"))
|
||||
{
|
||||
if (nb_createx(params[1], ival(params[2]), ival(params[3]), ival(params[4])) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!stricmp(params[0],"SetLocker"))
|
||||
{
|
||||
if (nb_SetLocker(params[1]) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!stricmp(params[0],"Xrmdir"))
|
||||
{
|
||||
if (nb_Xrmdir(params[1], params[2]) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!stricmp(params[0],"Mkdir"))
|
||||
{
|
||||
if (nb_Mkdir(params[1]) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!stricmp(params[0],"Attach"))
|
||||
{
|
||||
if (nb_Attach(params[1], params[2]) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!stricmp(params[0],"Detach"))
|
||||
{
|
||||
if (nb_Detach(params[1], params[2]) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!stricmp(params[0],"CreateFile"))
|
||||
{
|
||||
if (nb_CreateFile(params[1], atol(params[2])) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!stricmp(params[0],"CopyFiles"))
|
||||
{
|
||||
if (nb_CopyFile(params[1], params[2]) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!stricmp(params[0],"DeleteFiles"))
|
||||
{
|
||||
if (nb_DeleteFile(params[1]) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!stricmp(params[0],"Move"))
|
||||
{
|
||||
if (nb_Move(params[1], params[2]) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!stricmp(params[0],"Xcopy"))
|
||||
{
|
||||
if (nb_xcopy(params[1], params[2]) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!strcmp(params[0],"Close"))
|
||||
{
|
||||
if (nb_close(ival(params[1])) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!strcmp(params[0],"Rename"))
|
||||
{
|
||||
if (nb_rename(params[1], params[2]) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!strcmp(params[0],"Unlink"))
|
||||
{
|
||||
if (nb_unlink(params[1]) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!strcmp(params[0],"Deltree"))
|
||||
{
|
||||
if (nb_deltree(params[1]) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!strcmp(params[0],"Rmdir"))
|
||||
{
|
||||
if (nb_rmdir(params[1]) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!strcmp(params[0],"QUERY_PATH_INFORMATION"))
|
||||
{
|
||||
if (nb_qpathinfo(params[1], ival(params[2])) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!strcmp(params[0],"QUERY_FILE_INFORMATION"))
|
||||
{
|
||||
if (nb_qfileinfo(ival(params[1])) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!strcmp(params[0],"QUERY_FS_INFORMATION"))
|
||||
{
|
||||
if (nb_qfsinfo(ival(params[1])) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!strcmp(params[0],"FIND_FIRST"))
|
||||
{
|
||||
if (nb_findfirst(params[1]) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!strcmp(params[0],"WriteX"))
|
||||
{
|
||||
if (nb_writex(ival(params[1]), ival(params[2]), ival(params[3]), ival(params[4])) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!strcmp(params[0],"ReadX"))
|
||||
{
|
||||
if (nb_readx(ival(params[1]), ival(params[2]), ival(params[3]), ival(params[4])) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!strcmp(params[0],"Flush"))
|
||||
{
|
||||
if (nb_flush(ival(params[1])) == -1)
|
||||
break;
|
||||
}
|
||||
else if (!strcmp(params[0],"LockingX"))
|
||||
{
|
||||
if (nb_lock(ival(params[1]), ival(params[2]), ival(params[3]), ival(params[4]),
|
||||
(unsigned char)ival(params[5]), ival(params[6])) == -1)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Unknown operation %s\n", params[0]);
|
||||
printf("Line read = %s\n", line1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
CloseHandle(hFile);
|
||||
|
||||
// nb_cleanup(cname);
|
||||
|
||||
EndSecondTime(CMD_NONAFS);
|
||||
|
||||
for (i = 0; i < MAX_FILES; i++)
|
||||
{
|
||||
if (ftable[i].handle > 0)
|
||||
nb_close(ftable[i].handle);
|
||||
}
|
||||
|
||||
DeleteCriticalSection(&CriticalSection);
|
||||
|
||||
return(correct);
|
||||
}
|
||||
|
||||
typedef long ( __cdecl *PPIOCTL)(char *pathp, long opcode, struct ViceIoctl *blobp, int follow);
|
||||
|
||||
int IsOnline(char *strPath)
|
||||
{
|
||||
int bret;
|
||||
char space[2048];
|
||||
int code;
|
||||
int rc;
|
||||
struct ViceIoctl blob;
|
||||
struct VolumeStatus *status;
|
||||
static PPIOCTL ppioctl = NULL;
|
||||
static HINSTANCE hAfsDll = NULL;
|
||||
|
||||
rc = WaitForSingleObject(OSMutexHandle, 5 * 1000);
|
||||
bret = FALSE;
|
||||
if (hAfsDll == NULL)
|
||||
hAfsDll = LoadLibrary(AFSDLL);
|
||||
if (hAfsDll)
|
||||
{
|
||||
if (ppioctl == NULL)
|
||||
ppioctl = (PPIOCTL)GetProcAddress(hAfsDll, "pioctl");
|
||||
if (ppioctl != NULL)
|
||||
{
|
||||
blob.in_size = 0;
|
||||
blob.out_size = sizeof(space);
|
||||
blob.out = space;
|
||||
#if 0
|
||||
if (!(code = ppioctl(strPath, VIOCGETVOLSTAT, &blob, 1)))
|
||||
{
|
||||
bret = WINTORTURE_ASFDLL_ONLINE;
|
||||
status = (VolumeStatus *)space;
|
||||
if (!status->Online || !status->InService || !status->Blessed || status->NeedsSalvage)
|
||||
bret = WINTORTURE_ASFDLL_OFFLINE;
|
||||
}
|
||||
#else
|
||||
errno = 0;
|
||||
code = ppioctl(strPath, VIOC_PATH_AVAILABILITY, &blob, 1);
|
||||
if (!code) {
|
||||
switch (errno) {
|
||||
case ENXIO:
|
||||
case ENOSYS:
|
||||
case EBUSY:
|
||||
bret = WINTORTURE_ASFDLL_OFFLINE;
|
||||
break;
|
||||
default:
|
||||
bret = WINTORTURE_ASFDLL_ONLINE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
bret = WINTORTURE_ASFPIOCTL_NOTFOUND;
|
||||
}
|
||||
else
|
||||
bret = WINTORTURE_ASFDLL_NOTFOUND;
|
||||
|
||||
if (rc == WAIT_OBJECT_0)
|
||||
ReleaseMutex(OSMutexHandle);
|
||||
|
||||
return(bret);
|
||||
}
|
||||
|
925
src/WINNT/tests/torture/Source/WinTorture.c
Normal file
925
src/WINNT/tests/torture/Source/WinTorture.c
Normal file
@ -0,0 +1,925 @@
|
||||
//#define _WIN32_WINNT 0x0500
|
||||
//#include <windows.h>
|
||||
|
||||
#include "includes.h"
|
||||
#include <Psapi.h>
|
||||
#include "common.h"
|
||||
#ifdef HAVE_HESOID
|
||||
#include "ResolveLocker.h"
|
||||
extern int ResolveLocker(USER_OPTIONS *attachOption);
|
||||
extern void GetLockerInfo(char *Locker, char *Path);
|
||||
#endif /* HAVE_HESOID */
|
||||
|
||||
#define MAX_THREADS 100
|
||||
|
||||
int opterr = 1;
|
||||
int optind = 1;
|
||||
int optopt;
|
||||
int optreset;
|
||||
char *optarg;
|
||||
|
||||
extern void LogStats(char *FileName, int ToLog, int Iteration, int NumberOfProcesses, int NumberOfThreads,
|
||||
char *HostName, int ProcessNumber, struct cmd_struct CommandInfo[],
|
||||
char *CommandLine, char *TargetDirectory);
|
||||
extern int UpdateMasterLog(char *FileName, struct cmd_struct CommandInfo[]);
|
||||
extern int BuildMasterStatLog(char *FileName, char *MoveFileName, int NumberOfProcesses,
|
||||
int NumberOfThreads, char *CommandLine, int LoopCount,
|
||||
char *TargetDirectory, int ProcessNumber);
|
||||
extern void LogMessage(int ProcessNumber, char *HostName, char *FileName, char *message, int LogID);
|
||||
|
||||
DWORD WINAPI StressTestThread(LPVOID lpThreadParameter);
|
||||
int getopt(int, char**, char*);
|
||||
DWORD FindProcessCount(char *ProcessName, HANDLE JobHandle);
|
||||
void show_results(char *CommandLine, char *TargetDirectory, struct cmd_struct CommandInfo[],
|
||||
char *HostName, int NumberOfThreads, int CurrentLoop, int LogID);
|
||||
|
||||
char *ClientText = "streamfiles.txt";
|
||||
char PathToSecondDir[256];
|
||||
int ThreadStatus[MAX_HANDLES];
|
||||
int verbose;
|
||||
static int BufferSize = 256*1024;
|
||||
int UseLocker = 0;
|
||||
int EndOnError;
|
||||
int AfsTrace;
|
||||
int ChronLog;
|
||||
BOOL PrintStats;
|
||||
HANDLE MutexHandle;
|
||||
HANDLE FileMutexHandle;
|
||||
HANDLE ChronMutexHandle;
|
||||
HANDLE OSMutexHandle;
|
||||
HANDLE ShutDownEventHandle;
|
||||
HANDLE PauseEventHandle;
|
||||
HANDLE ContinueEventHandle;
|
||||
EXIT_STATUS ExitStatus[MAX_HANDLES];
|
||||
|
||||
double create_procs(char *Hostname, char *CommandLine, char *TargetDirectory,
|
||||
char *AfsLocker, char *Locker, char *HostName,
|
||||
int NumberOfThreads, int CurrentLoop, int LogID)
|
||||
{
|
||||
int i;
|
||||
int status;
|
||||
int count;
|
||||
int ProcessID;
|
||||
char EventName[512];
|
||||
HANDLE hEventHandle[MAX_HANDLES];
|
||||
HANDLE hThreadHandle[MAX_HANDLES];
|
||||
DWORD dwThreadID[MAX_HANDLES];
|
||||
struct cmd_struct *CommandInfo;
|
||||
CRITICAL_SECTION CriticalSection;
|
||||
PARAMETERLIST *pParameterList[MAX_HANDLES];
|
||||
#ifdef HAVE_HESOID
|
||||
USER_OPTIONS attachOption;
|
||||
#endif
|
||||
|
||||
InitializeCriticalSection(&CriticalSection);
|
||||
for (i = 0; i < MAX_HANDLES; i++)
|
||||
{
|
||||
hEventHandle[i] = NULL;
|
||||
hThreadHandle[i] = NULL;
|
||||
pParameterList[i] = NULL;
|
||||
dwThreadID[i] = 0;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
CommandInfo = calloc(1, sizeof(struct cmd_struct) * (CMD_MAX_CMD + 1) * NumberOfThreads);
|
||||
ProcessID = getpid();
|
||||
|
||||
for (i = 0; i < NumberOfThreads; i++)
|
||||
{
|
||||
if (EndOnError)
|
||||
{
|
||||
if (ThreadStatus[count] == 0)
|
||||
continue;
|
||||
}
|
||||
sprintf(EventName, "%d%sEvent%05d", ProcessID, HostName, count);
|
||||
hEventHandle[count] = CreateEvent(NULL, FALSE, FALSE, EventName);
|
||||
if (hEventHandle[count] == NULL)
|
||||
continue;
|
||||
ResetEvent(hEventHandle[count]);
|
||||
|
||||
pParameterList[count] = calloc(1, sizeof(PARAMETERLIST));
|
||||
pParameterList[count]->ProcessNumber = count;
|
||||
pParameterList[count]->CommandInfo = (struct cmd_struct *)(CommandInfo + (i * (CMD_MAX_CMD + 1)));
|
||||
pParameterList[count]->BufferSize = BufferSize;
|
||||
pParameterList[count]->PrintStats = PrintStats;
|
||||
pParameterList[count]->CurrentLoop = CurrentLoop;
|
||||
pParameterList[count]->AfsTrace = AfsTrace;
|
||||
pParameterList[count]->TargetDirectory = TargetDirectory;
|
||||
pParameterList[count]->pExitStatus = &ExitStatus[i];
|
||||
pParameterList[count]->pThreadStatus = &ThreadStatus[i];
|
||||
pParameterList[count]->CommandLine = CommandLine;
|
||||
pParameterList[count]->ClientText = ClientText;
|
||||
pParameterList[count]->PathToSecondDir = PathToSecondDir;
|
||||
pParameterList[count]->AfsLocker = AfsLocker;
|
||||
pParameterList[count]->HostName = HostName;
|
||||
pParameterList[count]->ProcessID = ProcessID;;
|
||||
pParameterList[count]->LogID = LogID;;
|
||||
|
||||
ThreadStatus[count] = 0;
|
||||
hThreadHandle[count] = CreateThread(NULL, 0, &StressTestThread, (LPVOID)pParameterList[count], CREATE_SUSPENDED, &dwThreadID[count]);
|
||||
if (hThreadHandle[count] != NULL)
|
||||
{
|
||||
ResumeThread(hThreadHandle[count]);
|
||||
ThreadStatus[count] = 1;
|
||||
++count;
|
||||
}
|
||||
else
|
||||
{
|
||||
CloseHandle(hEventHandle[count]);
|
||||
if (pParameterList[count] != NULL)
|
||||
free(pParameterList[count]);
|
||||
pParameterList[count] = NULL;
|
||||
hThreadHandle[count] = NULL;
|
||||
hEventHandle[count] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
count = 0;
|
||||
for (i = 0; i < MAX_HANDLES; i++)
|
||||
{
|
||||
if (hEventHandle[i] != NULL)
|
||||
++count;
|
||||
}
|
||||
#ifdef HAVE_HESOID
|
||||
if (UseLocker)
|
||||
{
|
||||
int rc;
|
||||
|
||||
memset(&attachOption, '\0', sizeof(attachOption));
|
||||
strcpy(attachOption.Locker, Locker);
|
||||
strcpy(attachOption.type, "locker");
|
||||
if (rc = ResolveLocker(&attachOption))
|
||||
{
|
||||
if (!stricmp(attachOption.type, "AFS"))
|
||||
{
|
||||
printf("Unable to attach locker %s - AFS is not supported\n", Locker);
|
||||
exit(1);
|
||||
}
|
||||
strcpy(AfsLocker, attachOption.SubMount);
|
||||
memset(&attachOption, '\0', sizeof(attachOption));
|
||||
strcpy(attachOption.Locker, Locker);
|
||||
strcpy(attachOption.type, "locker");
|
||||
if (rc = attach(attachOption, 0, 0, Locker))
|
||||
{
|
||||
printf("Unable to attach locker %s\n", Locker);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_HESOID */
|
||||
|
||||
status = WaitForMultipleObjects(count, hEventHandle, TRUE, INFINITE);
|
||||
for (i = 0; i < MAX_HANDLES; i++)
|
||||
{
|
||||
if (hEventHandle[i] != NULL)
|
||||
CloseHandle(hEventHandle[i]);
|
||||
if (pParameterList[i] != NULL)
|
||||
free(pParameterList[i]);
|
||||
pParameterList[i] = NULL;
|
||||
hEventHandle[i] = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < NumberOfThreads; i++)
|
||||
{
|
||||
char FileName[128];
|
||||
char temp[512];
|
||||
|
||||
if (strlen(ExitStatus[i].Reason))
|
||||
{
|
||||
sprintf(temp, "Thread %0d exited with reason: %s", i, ExitStatus[i].Reason);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(temp, "Thread %0d completed\n", i);
|
||||
}
|
||||
if (verbose)
|
||||
printf("%s", temp);
|
||||
sprintf(FileName, "Thread_%05d.log", i);
|
||||
LogMessage(i, HostName, FileName, temp, LogID);
|
||||
sprintf(temp, "Ended Iteration %0d\n\n", CurrentLoop);
|
||||
LogMessage(i, HostName, FileName, temp, LogID);
|
||||
CloseHandle(hEventHandle[i]);
|
||||
}
|
||||
show_results(CommandLine, TargetDirectory, CommandInfo, HostName, NumberOfThreads, CurrentLoop, LogID);
|
||||
free(CommandInfo);
|
||||
DeleteCriticalSection(&CriticalSection);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
static void usage(void)
|
||||
{
|
||||
|
||||
fprintf(stderr, "usage: wintorture [options]\n");
|
||||
fprintf(stderr, "where options can be:\n");
|
||||
fprintf(stderr, "\t-b Create a chronological log.\n");
|
||||
fprintf(stderr, "\t-c <txt> Specifies the script txt file to use.\n");
|
||||
fprintf(stderr, "\t-e End thread processing on an error.\n");
|
||||
fprintf(stderr, "\t-f <name> Target directory name.\n");
|
||||
fprintf(stderr, "\t-i <num> Number of iterations of the stress test to run.\n");
|
||||
fprintf(stderr, "\t This option will override the -m option.\n");
|
||||
#ifdef HAVE_HESOID
|
||||
fprintf(stderr, "\t-l <path> AFS locker or AFS submount in which to create the target directory.\n");
|
||||
#endif /* HAVE_HESOID */
|
||||
fprintf(stderr, "\t-m <num> The number of minutes to run the stress test.\n");
|
||||
fprintf(stderr, "\t This option will override the -i option.\n");
|
||||
fprintf(stderr, "\t-n <num> The number of threads to run.\n");
|
||||
fprintf(stderr, "\t-p <path> UNC path to second directory.\n");
|
||||
fprintf(stderr, "\t-s Output stats.\n");
|
||||
fprintf(stderr, "\t-t Do AFS trace logging.\n");
|
||||
fprintf(stderr, "\t-u <UNC> UNC path to target directory.\n");
|
||||
fprintf(stderr, "\t-v Turn on verbose mode.\n");
|
||||
fprintf(stderr, "\nNOTE: The switches are not case sensitive. You\n");
|
||||
fprintf(stderr, "\n may use either upper or lower case letters.\n\n");
|
||||
}
|
||||
|
||||
void show_results(char *CommandLine, char *TargetDirectory, struct cmd_struct *CommandInfo,
|
||||
char *HostName, int NumberOfThreads, int CurrentLoop, int LogID)
|
||||
{
|
||||
struct cmd_struct TotalCommandInfo[CMD_MAX_CMD + 1];
|
||||
int i;
|
||||
int j;
|
||||
unsigned grand_total = 0;
|
||||
char FileName[256];
|
||||
char WorkingDirectory[512];
|
||||
struct cmd_struct *FinalCmdInfo;
|
||||
|
||||
for (j = 0; j <= CMD_MAX_CMD; j++) {
|
||||
TotalCommandInfo[j].count = 0;
|
||||
TotalCommandInfo[j].min_sec = 0;
|
||||
TotalCommandInfo[j].max_sec = 0;
|
||||
TotalCommandInfo[j].MilliSeconds = 0;
|
||||
TotalCommandInfo[j].total_sec = 0;
|
||||
TotalCommandInfo[j].total_sum_of_squares = 0;
|
||||
TotalCommandInfo[j].ErrorCount = 0;
|
||||
TotalCommandInfo[j].ErrorTime = 0;
|
||||
}
|
||||
|
||||
memset(ExitStatus, '\0', sizeof(ExitStatus[0]) * MAX_HANDLES);
|
||||
|
||||
for (j = 0; j < NumberOfThreads; j++)
|
||||
{
|
||||
FinalCmdInfo = CommandInfo + (j * (CMD_MAX_CMD + 1));
|
||||
|
||||
for (i = 0; i <= CMD_MAX_CMD; i++)
|
||||
{
|
||||
TotalCommandInfo[i].count += FinalCmdInfo[i].count;
|
||||
TotalCommandInfo[i].total_sec += FinalCmdInfo[i].total_sec;
|
||||
TotalCommandInfo[i].total_sum_of_squares += FinalCmdInfo[i].total_sum_of_squares;
|
||||
TotalCommandInfo[i].ErrorCount += FinalCmdInfo[i].ErrorCount;
|
||||
TotalCommandInfo[i].ErrorTime += FinalCmdInfo[i].ErrorTime;
|
||||
grand_total += FinalCmdInfo[j].total_sec;
|
||||
if (!TotalCommandInfo[i].min_sec || (TotalCommandInfo[i].min_sec > FinalCmdInfo[i].min_sec))
|
||||
TotalCommandInfo[i].min_sec = FinalCmdInfo[i].min_sec;
|
||||
if (TotalCommandInfo[i].max_sec < FinalCmdInfo[i].max_sec)
|
||||
TotalCommandInfo[i].max_sec = FinalCmdInfo[i].max_sec;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
memset(WorkingDirectory, '\0', sizeof(WorkingDirectory));
|
||||
GetCurrentDirectory(sizeof(WorkingDirectory), WorkingDirectory);
|
||||
sprintf(FileName, "%s\\log%05d\\%s\\ProcessStats.log", WorkingDirectory, LogID, HostName);
|
||||
|
||||
if (PrintStats)
|
||||
LogStats(FileName, 0, CurrentLoop, 1, NumberOfThreads, HostName, -1, TotalCommandInfo,
|
||||
CommandLine, TargetDirectory);
|
||||
LogStats(FileName, 1, CurrentLoop, 1, NumberOfThreads, HostName, -1, TotalCommandInfo,
|
||||
CommandLine, TargetDirectory);
|
||||
|
||||
sprintf(FileName, "%s\\log%05d\\%s", WorkingDirectory, LogID, "MasterStatLog.log");
|
||||
UpdateMasterLog(FileName, TotalCommandInfo);
|
||||
sprintf(FileName, "%s\\log%05d\\%s\\%s", WorkingDirectory, LogID, HostName, "MasterProcessStatLog.log");
|
||||
UpdateMasterLog(FileName, TotalCommandInfo);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
int LoopCount;
|
||||
time_t SecondsToRun;
|
||||
int NumberOfIterations;
|
||||
int StressTestUsed = 0;
|
||||
int rc;
|
||||
int opt;
|
||||
int ErrorState;
|
||||
int NumberOfProcesses;
|
||||
int NumberOfThreads;
|
||||
int IterationCount;
|
||||
int CurrentLoop = 0;
|
||||
int LogID;
|
||||
time_t TotalTime;
|
||||
time_t StartTime;
|
||||
time_t EndTime;
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
FILE *Mfp;
|
||||
FILE *fp;
|
||||
char *p;
|
||||
char tbuffer[10];
|
||||
char buffer[512];
|
||||
char FileName[256];
|
||||
char MoveFileName[256];
|
||||
char Locker[256];
|
||||
char command[512];
|
||||
char DateTime[512];
|
||||
char WorkingDirectory[512];
|
||||
char CommandLine[512];
|
||||
char TargetDirectory[512];
|
||||
char AfsLocker[256];
|
||||
char HostName[128];
|
||||
char JobName[128];
|
||||
SYSTEMTIME SystemTime;
|
||||
SYSTEMTIME LocalTime;
|
||||
TIME_ZONE_INFORMATION TimeZoneInformation;
|
||||
HANDLE ExitMutexHandle;
|
||||
HANDLE JobHandle;
|
||||
|
||||
|
||||
memset(HostName, '\0', sizeof(HostName));
|
||||
memset(PathToSecondDir, '\0', sizeof(PathToSecondDir));
|
||||
memset(Locker, '\0', sizeof(Locker));
|
||||
SecondsToRun = 0;
|
||||
NumberOfIterations = 0;
|
||||
EndOnError = 0;
|
||||
UseLocker = 0;
|
||||
ChronLog = 0;
|
||||
AfsTrace = 0;
|
||||
verbose = 0;
|
||||
NumberOfThreads = 1;
|
||||
NumberOfProcesses = 1;
|
||||
NumberOfThreads = 1;
|
||||
LogID = 0;
|
||||
PrintStats = FALSE;
|
||||
|
||||
while ((opt = getopt(argc, argv, "A:a:BbC:c:D:d:EeF:f:G:g:I:i:L:l:M:m:N:n:P:p:SsTtU:u:Vv")) != EOF)
|
||||
{
|
||||
|
||||
switch (opt)
|
||||
{
|
||||
case 'a':
|
||||
case 'A':
|
||||
break;
|
||||
case 'b':
|
||||
case 'B':
|
||||
ChronLog = 1;
|
||||
break;
|
||||
case 'c':
|
||||
case 'C':
|
||||
ClientText = optarg;
|
||||
break;
|
||||
case 'd':
|
||||
case 'D':
|
||||
StressTestUsed = 1;
|
||||
NumberOfProcesses = atoi(optarg);
|
||||
break;
|
||||
case 'e':
|
||||
case 'E':
|
||||
EndOnError = 1;
|
||||
break;
|
||||
case 'f':
|
||||
case 'F':
|
||||
strcpy(HostName, optarg);
|
||||
for (i = 0; i < (int)strlen(HostName); i++)
|
||||
{
|
||||
if ((HostName[i] == '\\') || (HostName[i] == '/'))
|
||||
{
|
||||
printf("\nInvalid -F usage...Subdirectories not allowed\n\n");
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'g':
|
||||
case 'G':
|
||||
StressTestUsed = 1;
|
||||
LogID = atoi(optarg);
|
||||
break;
|
||||
case 'i':
|
||||
case 'I':
|
||||
SecondsToRun = 0;
|
||||
NumberOfIterations = atoi(optarg);
|
||||
if (NumberOfIterations < 0)
|
||||
NumberOfIterations = 0;
|
||||
break;
|
||||
#ifdef HAVE_HESOID
|
||||
case 'l':
|
||||
case 'L':
|
||||
strcpy(Locker, optarg);
|
||||
UseLocker = 1;
|
||||
break;
|
||||
#endif /* HAVE_HESOID */
|
||||
case 'm':
|
||||
case 'M':
|
||||
NumberOfIterations = 0;
|
||||
SecondsToRun = atoi(optarg) * 60;
|
||||
if (SecondsToRun < 0)
|
||||
SecondsToRun = 0;
|
||||
break;
|
||||
case 'n':
|
||||
case 'N':
|
||||
NumberOfThreads = atoi(optarg);
|
||||
break;
|
||||
case 'p':
|
||||
case 'P':
|
||||
strcpy(PathToSecondDir, optarg);
|
||||
for(p = PathToSecondDir; *p; p++)
|
||||
{
|
||||
if(*p == '/')
|
||||
*p = '\\';
|
||||
}
|
||||
break;
|
||||
case 's':
|
||||
case 'S':
|
||||
PrintStats = TRUE;
|
||||
break;
|
||||
case 't':
|
||||
case 'T':
|
||||
AfsTrace = 1;
|
||||
break;
|
||||
case 'u':
|
||||
case 'U':
|
||||
UseLocker = 0;
|
||||
strcpy(Locker, optarg);
|
||||
break;
|
||||
case 'v':
|
||||
case 'V':
|
||||
verbose = 1;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
exit(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen(HostName) == 0)
|
||||
{
|
||||
printf("You must use the -f option to specify a target directory\n\n");
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
if (strlen(Locker) == 0)
|
||||
{
|
||||
printf("You must use either the -u or the -l option\n\n");
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
memset(CommandLine, '\0', sizeof(CommandLine));
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
if (StressTestUsed)
|
||||
{
|
||||
if (!stricmp(argv[i], "-f"))
|
||||
{
|
||||
char temp[64];
|
||||
|
||||
strcpy(temp, argv[i + 1]);
|
||||
temp[strlen(temp) - 5] = '\0';
|
||||
strcat(CommandLine, argv[i]);
|
||||
strcat(CommandLine, " ");
|
||||
strcat(CommandLine, temp);
|
||||
strcat(CommandLine, " ");
|
||||
++i;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
strcat(CommandLine, argv[i]);
|
||||
strcat(CommandLine, " ");
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (strlen(Locker) == 0)
|
||||
{
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
for(p = Locker; *p; p++)
|
||||
{
|
||||
if(*p == '/')
|
||||
*p = '\\';
|
||||
}
|
||||
|
||||
#ifdef HAVE_HESOID
|
||||
if (UseLocker)
|
||||
{
|
||||
char *sPtr;
|
||||
|
||||
sprintf(AfsLocker, "\\\\afs\\%s", Locker);
|
||||
memset(buffer, '\0', sizeof(buffer));
|
||||
GetLockerInfo(Locker, buffer);
|
||||
if (strlen(buffer) != 0)
|
||||
{
|
||||
sPtr = strstr(buffer, "/afs/");
|
||||
sPtr += strlen("/afs/");
|
||||
strcpy(TargetDirectory, sPtr);
|
||||
sPtr = strchr(TargetDirectory, ' ');
|
||||
if (sPtr != NULL)
|
||||
(*sPtr) = '\0';
|
||||
while ((sPtr = strchr(TargetDirectory, '/')) != NULL)
|
||||
(*sPtr) = '\\';
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(TargetDirectory, Locker);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif /* HAVE_HESOID */
|
||||
strcpy(AfsLocker, Locker);
|
||||
#if 0
|
||||
/* jaltman - this makes no sense. why strip off the server name and leave
|
||||
* an absolute path on the local disk?
|
||||
*/
|
||||
if (!strnicmp(Locker, "\\\\afs\\", strlen("\\\\afs\\")))
|
||||
strcpy(TargetDirectory, &Locker[strlen("\\\\afs\\")]);
|
||||
else
|
||||
#endif
|
||||
strcpy(TargetDirectory, Locker);
|
||||
#ifdef HAVE_HESOID
|
||||
}
|
||||
#endif /* HAVE_HESOID */
|
||||
|
||||
|
||||
TotalTime = 0;
|
||||
LoopCount = 0;
|
||||
CurrentLoop = 0;
|
||||
|
||||
ExitMutexHandle = CreateMutex(NULL, FALSE, "AfsExitEvent");
|
||||
ChronMutexHandle = CreateMutex(NULL, FALSE, "WinTortureChronMutex");
|
||||
MutexHandle = CreateMutex(NULL, FALSE, "WinTortureMutex");
|
||||
FileMutexHandle = CreateMutex(NULL, FALSE, "WinTortureFileMutex");
|
||||
OSMutexHandle = CreateMutex(NULL, FALSE, "WinTortureOSMutex");
|
||||
|
||||
for (i = 0; i < MAX_THREADS; i++)
|
||||
{
|
||||
ThreadStatus[i] = 2;
|
||||
}
|
||||
|
||||
sprintf(JobName, "%s%05d", "JOB", LogID);
|
||||
JobHandle = CreateJobObject(NULL, JobName);
|
||||
rc = AssignProcessToJobObject(JobHandle, GetCurrentProcess());
|
||||
|
||||
GetCurrentDirectory(sizeof(WorkingDirectory), WorkingDirectory);
|
||||
sprintf(FileName, "%s\\log%05d", WorkingDirectory, LogID);
|
||||
CreateDirectory(FileName, NULL);
|
||||
sprintf(FileName, "%s\\test", WorkingDirectory);
|
||||
CreateDirectory(FileName, NULL);
|
||||
if (!StressTestUsed)
|
||||
{
|
||||
sprintf(FileName, "%s\\log%05d\\Chron.log", WorkingDirectory, LogID);
|
||||
DeleteFile(FileName);
|
||||
}
|
||||
|
||||
sprintf(FileName, "%s\\log%05d\\%s", WorkingDirectory, LogID, HostName);
|
||||
sprintf(command, "rmdir /S /Q %s > %s\\test\\test", FileName, WorkingDirectory);
|
||||
system(command);
|
||||
|
||||
ShutDownEventHandle = CreateEvent(NULL, TRUE, FALSE, "AfsShutdownEvent");
|
||||
PauseEventHandle = CreateEvent(NULL, TRUE, FALSE, "AfsPauseEvent");
|
||||
ContinueEventHandle = CreateEvent(NULL, TRUE, FALSE, "AfsContinueEvent");
|
||||
|
||||
IterationCount = 0;
|
||||
time(&StartTime);
|
||||
if ((NumberOfIterations == 0) && (SecondsToRun == 0))
|
||||
NumberOfIterations = 1;
|
||||
else if (SecondsToRun != 0)
|
||||
{
|
||||
SecondsToRun += StartTime;
|
||||
}
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (SecondsToRun != 0)
|
||||
{
|
||||
time(&StartTime);
|
||||
if (StartTime > SecondsToRun)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (NumberOfIterations != 0)
|
||||
{
|
||||
if (LoopCount >= NumberOfIterations)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (rc = WaitForSingleObject(ShutDownEventHandle, 0) == WAIT_OBJECT_0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
++LoopCount;
|
||||
CurrentLoop = LoopCount;
|
||||
|
||||
_strtime(tbuffer);
|
||||
printf("\nIteration %d started at: %s\n", LoopCount, tbuffer);
|
||||
create_procs(HostName, CommandLine, TargetDirectory, AfsLocker, Locker,
|
||||
HostName, NumberOfThreads, CurrentLoop, LogID);
|
||||
_strtime(tbuffer);
|
||||
printf("Iteration %d ended at: %s\n", LoopCount, tbuffer);
|
||||
time(&EndTime);
|
||||
printf("Iteration %d lapse time: %ld seconds\n", LoopCount, EndTime - StartTime);
|
||||
TotalTime += EndTime - StartTime;
|
||||
sprintf(FileName, "%s\\log%05d\\IterationCount", WorkingDirectory, LogID);
|
||||
WaitForSingleObject(MutexHandle, 20 * 1000);
|
||||
if ((fp = fopen(FileName, "r")) != NULL)
|
||||
{
|
||||
fgets(buffer, sizeof(buffer), fp);
|
||||
IterationCount = atoi(buffer);
|
||||
fclose(fp);
|
||||
}
|
||||
++IterationCount;
|
||||
fp = fopen(FileName, "w");
|
||||
fprintf(fp, "%d\n", IterationCount);
|
||||
fclose(fp);
|
||||
ReleaseMutex(MutexHandle);
|
||||
if (EndOnError)
|
||||
{
|
||||
for (i = 0; i < MAX_THREADS; i++)
|
||||
{
|
||||
if (ThreadStatus[i] == 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i >= MAX_THREADS)
|
||||
break;
|
||||
}
|
||||
ErrorState = 0;
|
||||
for (i = 0; i < MAX_THREADS; i++)
|
||||
{
|
||||
if (ThreadStatus[i] == 0)
|
||||
{
|
||||
ErrorState = 1;
|
||||
ThreadStatus[i] = 1;
|
||||
}
|
||||
}
|
||||
if (ErrorState)
|
||||
{
|
||||
printf("\nSleeping for 3 minutes for error recovery\n\n");
|
||||
Sleep(3 * 60 * 1000);
|
||||
}
|
||||
}
|
||||
if (LoopCount == 0)
|
||||
return(0);
|
||||
|
||||
sprintf(FileName, ".\\log%05d\\%s\\Master.log", LogID, HostName);
|
||||
Mfp = fopen(FileName, "w+");
|
||||
fprintf(Mfp, "Average Iteration Time = %.02f minutes\n\n", ((float)TotalTime/(float)(LoopCount))/60.0);
|
||||
for (i = 0; i < NumberOfThreads; i++)
|
||||
{
|
||||
sprintf(FileName, ".\\log%05d\\%s\\Thread_%05d.log", LogID, HostName, i);
|
||||
fp = fopen(FileName, "r");
|
||||
if (fp != NULL)
|
||||
{
|
||||
fprintf(Mfp, "START OF THREAD %d\n\n", i);
|
||||
while (fgets(buffer, 512, fp) != NULL)
|
||||
{
|
||||
fprintf(Mfp, "%s", buffer);
|
||||
}
|
||||
fclose(fp);
|
||||
fprintf(Mfp, "END OF THREAD %d\n\n", i);
|
||||
}
|
||||
}
|
||||
fclose(Mfp);
|
||||
|
||||
memset(WorkingDirectory, '\0', sizeof(WorkingDirectory));
|
||||
GetCurrentDirectory(sizeof(WorkingDirectory), WorkingDirectory);
|
||||
|
||||
sprintf(FileName, "%s\\log%05d\\%s\\%s", WorkingDirectory, LogID, HostName, "MasterProcessStatLog.log");
|
||||
sprintf(MoveFileName, "%s\\log%05d\\%s\\%s", WorkingDirectory, LogID, HostName, "MasterProcessStatLogRaw.log");
|
||||
BuildMasterStatLog(FileName, MoveFileName, NumberOfProcesses, NumberOfThreads, CommandLine, LoopCount,
|
||||
TargetDirectory, -1);
|
||||
|
||||
// sprintf(DateTime, "%s-%04d%02d%02d-%02d%02d%02d", HostName,
|
||||
// LocalTime.wYear,
|
||||
// LocalTime.wMonth,
|
||||
// LocalTime.wDay,
|
||||
// LocalTime.wHour,
|
||||
// LocalTime.wMinute,
|
||||
// LocalTime.wSecond);
|
||||
// sprintf(command, "rename %s\\log%05d\\%s %s", WorkingDirectory, LogID, HostName, DateTime);
|
||||
// rc = system(command);
|
||||
|
||||
WaitForSingleObject(ExitMutexHandle, 20 * 1000);
|
||||
Sleep(3 * 1000);
|
||||
|
||||
GetSystemTime(&SystemTime);
|
||||
GetTimeZoneInformation(&TimeZoneInformation);
|
||||
SystemTimeToTzSpecificLocalTime(&TimeZoneInformation, &SystemTime, &LocalTime);
|
||||
|
||||
NumberOfProcesses = 0;
|
||||
sprintf(FileName, "%s\\log%05d\\ProcessCount", WorkingDirectory, LogID);
|
||||
if ((fp = fopen(FileName, "r")) != NULL)
|
||||
{
|
||||
fgets(buffer, sizeof(buffer), fp);
|
||||
NumberOfProcesses = atoi(buffer);
|
||||
fclose(fp);
|
||||
}
|
||||
++NumberOfProcesses;
|
||||
fp = fopen(FileName, "w");
|
||||
fprintf(fp, "%d\n", NumberOfProcesses);
|
||||
fclose(fp);
|
||||
|
||||
if (FindProcessCount("wintorture.exe", JobHandle) == 1)
|
||||
{
|
||||
NumberOfProcesses = 0;
|
||||
sprintf(FileName, "%s\\log%05d\\ProcessCount", WorkingDirectory, LogID);
|
||||
sprintf(MoveFileName, "%s\\log%05d\\ProcessCountRaw", WorkingDirectory, LogID);
|
||||
if ((fp = fopen(FileName, "r")) != NULL)
|
||||
{
|
||||
fgets(buffer, sizeof(buffer), fp);
|
||||
NumberOfProcesses = atoi(buffer);
|
||||
fclose(fp);
|
||||
MoveFile(FileName, MoveFileName);
|
||||
}
|
||||
|
||||
IterationCount = 0;
|
||||
sprintf(FileName, "%s\\log%05d\\IterationCount", WorkingDirectory, LogID);
|
||||
sprintf(MoveFileName, "%s\\log%05d\\IterationCountRaw", WorkingDirectory, LogID);
|
||||
if ((fp = fopen(FileName, "r")) != NULL)
|
||||
{
|
||||
fgets(buffer, sizeof(buffer), fp);
|
||||
IterationCount = atoi(buffer);
|
||||
fclose(fp);
|
||||
MoveFile(FileName, MoveFileName);
|
||||
}
|
||||
|
||||
sprintf(FileName, "%s\\log%05d\\%s", WorkingDirectory, LogID, "MasterStatLog.log");
|
||||
sprintf(MoveFileName, "%s\\log%05d\\%s", WorkingDirectory, LogID, "MasterStatLogRaw.log");
|
||||
BuildMasterStatLog(FileName, MoveFileName, NumberOfProcesses, NumberOfThreads,
|
||||
CommandLine, IterationCount, TargetDirectory, -2);
|
||||
sprintf(DateTime, "%s%05d-%04d%02d%02d-%02d%02d%02d", "log",
|
||||
LogID,
|
||||
LocalTime.wYear,
|
||||
LocalTime.wMonth,
|
||||
LocalTime.wDay,
|
||||
LocalTime.wHour,
|
||||
LocalTime.wMinute,
|
||||
LocalTime.wSecond);
|
||||
sprintf(command, "rename %s\\log%05d %s", WorkingDirectory, LogID, DateTime);
|
||||
rc = system(command);
|
||||
ResetEvent(ShutDownEventHandle);
|
||||
ResetEvent(PauseEventHandle);
|
||||
ResetEvent(ContinueEventHandle);
|
||||
CloseHandle(ShutDownEventHandle);
|
||||
CloseHandle(PauseEventHandle);
|
||||
CloseHandle(ContinueEventHandle);
|
||||
|
||||
}
|
||||
|
||||
ReleaseMutex(ExitMutexHandle);
|
||||
CloseHandle(JobHandle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ProcessNameAndID(DWORD processID, char *ProcessName, HANDLE JobHandle)
|
||||
{
|
||||
char szProcessName[1024] = "unknown";
|
||||
char FileName[1024];
|
||||
char WorkingDirectory[512];
|
||||
HANDLE hProcess;
|
||||
int Count;
|
||||
|
||||
memset(WorkingDirectory, '\0', sizeof(WorkingDirectory));
|
||||
GetCurrentDirectory(sizeof(WorkingDirectory), WorkingDirectory);
|
||||
strcat(WorkingDirectory, "\\");
|
||||
Count = 0;
|
||||
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processID);
|
||||
if (hProcess)
|
||||
{
|
||||
HMODULE hMod;
|
||||
DWORD cbNeeded;
|
||||
|
||||
if (EnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbNeeded))
|
||||
{
|
||||
memset(szProcessName, '\0', sizeof(szProcessName));
|
||||
GetModuleBaseName(hProcess, hMod, szProcessName, sizeof(szProcessName));
|
||||
if (!stricmp(szProcessName, ProcessName))
|
||||
{
|
||||
memset(FileName, '\0', sizeof(FileName));
|
||||
if (GetModuleFileNameEx(hProcess, hMod, FileName, sizeof(FileName) - 1))
|
||||
{
|
||||
if (!strnicmp(WorkingDirectory, FileName, strlen(WorkingDirectory)))
|
||||
{
|
||||
++Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
CloseHandle(hProcess);
|
||||
return(Count);
|
||||
}
|
||||
|
||||
DWORD FindProcessCount(char *ProcessName, HANDLE JobHandle)
|
||||
{
|
||||
DWORD aProcesses[8092];
|
||||
DWORD cbNeeded;
|
||||
DWORD cProcesses;
|
||||
int Count;
|
||||
int rc;
|
||||
unsigned int i;
|
||||
JOBOBJECT_BASIC_PROCESS_ID_LIST IdList;
|
||||
|
||||
rc = QueryInformationJobObject(JobHandle, JobObjectBasicProcessIdList, &IdList, sizeof(IdList), NULL);
|
||||
return(IdList.NumberOfAssignedProcesses);
|
||||
|
||||
if (!EnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded))
|
||||
return(1);
|
||||
|
||||
Count = 0;
|
||||
cProcesses = cbNeeded / sizeof(DWORD);
|
||||
|
||||
for (i = 0; i < cProcesses; i++)
|
||||
{
|
||||
|
||||
// Count += ProcessNameAndID(aProcesses[i], ProcessName, JobHandle);
|
||||
}
|
||||
|
||||
return(Count);
|
||||
}
|
||||
|
||||
char *_progname(char *nargv0)
|
||||
{
|
||||
char *tmp;
|
||||
|
||||
tmp = strrchr(nargv0, '/');
|
||||
if (tmp)
|
||||
tmp++;
|
||||
else
|
||||
tmp = nargv0;
|
||||
return(tmp);
|
||||
}
|
||||
|
||||
#define BADCH (int)'?'
|
||||
#define BADARG (int)':'
|
||||
#define EMSG ""
|
||||
|
||||
int getopt(int nargc, char *nargv[], char *ostr)
|
||||
{
|
||||
static char *__progname = 0;
|
||||
static char *place = EMSG; /* option letter processing */
|
||||
char *oli; /* option letter list index */
|
||||
|
||||
__progname = __progname?__progname:_progname(*nargv);
|
||||
|
||||
if (optreset || !*place)
|
||||
{
|
||||
optreset = 0;
|
||||
if (optind >= nargc || *(place = nargv[optind]) != '-')
|
||||
{
|
||||
place = EMSG;
|
||||
return (-1);
|
||||
}
|
||||
if (place[1] && *++place == '-' && place[1] == '\0')
|
||||
{
|
||||
++optind;
|
||||
place = EMSG;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
if ((optopt = (int)*place++) == (int)':' || !(oli = strchr(ostr, optopt)))
|
||||
{
|
||||
if (optopt == (int)'-')
|
||||
return (-1);
|
||||
if (!*place)
|
||||
++optind;
|
||||
if (opterr && *ostr != ':')
|
||||
(void)fprintf(stderr, "%s: illegal option -- %c\n", __progname, optopt);
|
||||
return (BADCH);
|
||||
}
|
||||
if (*++oli != ':')
|
||||
{
|
||||
optarg = NULL;
|
||||
if (!*place)
|
||||
++optind;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*place)
|
||||
optarg = place;
|
||||
else if (nargc <= ++optind)
|
||||
{
|
||||
place = EMSG;
|
||||
if (*ostr == ':')
|
||||
return (BADARG);
|
||||
if (opterr)
|
||||
(void)fprintf(stderr, "%s: option requires an argument -- %c\n", __progname, optopt);
|
||||
return (BADCH);
|
||||
}
|
||||
else
|
||||
optarg = nargv[optind];
|
||||
place = EMSG;
|
||||
++optind;
|
||||
}
|
||||
return (optopt);
|
||||
}
|
1516
src/WINNT/tests/torture/Source/nbio.c
Normal file
1516
src/WINNT/tests/torture/Source/nbio.c
Normal file
File diff suppressed because it is too large
Load Diff
316
src/WINNT/tests/torture/Source/output.c
Normal file
316
src/WINNT/tests/torture/Source/output.c
Normal file
@ -0,0 +1,316 @@
|
||||
#include <windows.h>
|
||||
#include "includes.h"
|
||||
#include "common.h"
|
||||
|
||||
extern int ChronLog;
|
||||
extern int CurrentLoop;
|
||||
extern HANDLE ChronMutexHandle;
|
||||
extern HANDLE MutexHandle;
|
||||
extern HANDLE FileMutexHandle;
|
||||
|
||||
void LogStats(char *FileName, int ToLog, int Iteration, int NumberOfProcesses, int NumberOfThreads,
|
||||
char *HostName, int ProcessNumber, struct cmd_struct CommandInfo[],
|
||||
char *CommandLine, char *TargetDirectory)
|
||||
{
|
||||
struct cmd_struct TotalCommandInfo[CMD_MAX_CMD + 1];
|
||||
int i;
|
||||
int j;
|
||||
int LineCount;
|
||||
unsigned grand_total = 0;
|
||||
char AsciiTime[32];
|
||||
FILE *fp;
|
||||
struct tm *newtime;
|
||||
time_t aclock;
|
||||
|
||||
LineCount = 1;
|
||||
time(&aclock);
|
||||
newtime = localtime(&aclock);
|
||||
strcpy(AsciiTime, asctime(newtime));
|
||||
AsciiTime[strlen(AsciiTime) - 1] = '\0';
|
||||
|
||||
fp = stdout;
|
||||
if (ToLog)
|
||||
fp = fopen(FileName, "a+");
|
||||
|
||||
for (j = 0; j <= CMD_MAX_CMD; j++)
|
||||
{
|
||||
TotalCommandInfo[j].count = 0;
|
||||
TotalCommandInfo[j].min_sec = 0;
|
||||
TotalCommandInfo[j].ErrorTime = 0;
|
||||
TotalCommandInfo[j].max_sec = 0;
|
||||
TotalCommandInfo[j].MilliSeconds = 0;
|
||||
TotalCommandInfo[j].total_sec = 0;
|
||||
TotalCommandInfo[j].total_sum_of_squares = 0;
|
||||
TotalCommandInfo[j].ErrorCount = 0;
|
||||
TotalCommandInfo[j].ErrorTime = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i <= CMD_MAX_CMD; i++)
|
||||
{
|
||||
TotalCommandInfo[i].count += CommandInfo[i].count;
|
||||
TotalCommandInfo[i].total_sec += CommandInfo[i].total_sec;
|
||||
TotalCommandInfo[i].ErrorCount += CommandInfo[i].ErrorCount;
|
||||
TotalCommandInfo[i].ErrorTime += CommandInfo[i].ErrorTime;
|
||||
grand_total += CommandInfo[i].total_sec;
|
||||
if (!TotalCommandInfo[i].min_sec || (TotalCommandInfo[i].min_sec > CommandInfo[i].min_sec))
|
||||
TotalCommandInfo[i].min_sec = CommandInfo[i].min_sec;
|
||||
if (TotalCommandInfo[i].min_sec == 1000)
|
||||
TotalCommandInfo[i].min_sec = 0;
|
||||
if (TotalCommandInfo[i].max_sec < CommandInfo[i].max_sec)
|
||||
TotalCommandInfo[i].max_sec = CommandInfo[i].max_sec;
|
||||
}
|
||||
if (ProcessNumber > -1)
|
||||
{
|
||||
fprintf(fp, "Iteration %d Statistics\n", Iteration);
|
||||
++LineCount;
|
||||
}
|
||||
else if (ProcessNumber == -1)
|
||||
{
|
||||
fprintf(fp, "Process Statistics for Iteration %d\n", Iteration);
|
||||
++LineCount;
|
||||
}
|
||||
else if (ProcessNumber == -2)
|
||||
{
|
||||
fprintf(fp, "Test Statistics for all processes - %d Iterations \n", Iteration);
|
||||
++LineCount;
|
||||
}
|
||||
fprintf(fp, "Date: %s\n", AsciiTime);
|
||||
++LineCount;
|
||||
fprintf(fp, "Total Time: %d seconds (%4.1f minutes)\n", grand_total, grand_total/60.0);
|
||||
++LineCount;
|
||||
if ((ProcessNumber == -2) || (ProcessNumber == -1))
|
||||
{
|
||||
fprintf(fp, "Number of Processes: %d\n", NumberOfProcesses);
|
||||
fprintf(fp, "Number of Threads/Process: %d\n", NumberOfThreads);
|
||||
++LineCount;
|
||||
++LineCount;
|
||||
}
|
||||
|
||||
if (strlen(TargetDirectory) != 0)
|
||||
{
|
||||
fprintf(fp, "Target directory: %s\n", TargetDirectory);
|
||||
++LineCount;
|
||||
}
|
||||
if (strlen(CommandLine) != 0)
|
||||
{
|
||||
fprintf(fp, "Command Line: %s\n", CommandLine);
|
||||
++LineCount;
|
||||
}
|
||||
fprintf(fp, "\n Command: Count Min Latency Max Latency Ave Latency Cost Seconds Error Error \n");
|
||||
fprintf(fp, " (seconds) (seconds) (seconds) Count seconds\n");
|
||||
++LineCount;
|
||||
++LineCount;
|
||||
|
||||
for (i = LineCount; i < 12; i++)
|
||||
fprintf(fp, "\n");
|
||||
|
||||
for (i = 0; i <= CMD_MAX_CMD; i++)
|
||||
{
|
||||
fprintf(fp, "%-30s %8d %8d %10d %10.2f %5.1f%% %10d %8d %8d %s\n",
|
||||
cmd_names[i].name,
|
||||
TotalCommandInfo[i].count,
|
||||
TotalCommandInfo[i].min_sec,
|
||||
TotalCommandInfo[i].max_sec,
|
||||
(TotalCommandInfo[i].count ? (float)TotalCommandInfo[i].total_sec/(float)TotalCommandInfo[i].count : 0),
|
||||
(grand_total ? 100.0*TotalCommandInfo[i].total_sec/grand_total : 0),
|
||||
TotalCommandInfo[i].total_sec,
|
||||
TotalCommandInfo[i].ErrorCount,
|
||||
TotalCommandInfo[i].ErrorTime,
|
||||
cmd_names[i].ms_api);
|
||||
}
|
||||
fprintf(fp, "\n");
|
||||
if (ToLog)
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
void LogMessage(int ProcessNumber, char *HostName, char *FileName, char *message, int LogID)
|
||||
{
|
||||
char NewMessage[1024];
|
||||
char AsciiTime[32];
|
||||
char NewFileName[256];
|
||||
char WorkingDirectory[512];
|
||||
FILE *fp;
|
||||
struct tm *newtime;
|
||||
time_t aclock;
|
||||
DWORD rc;
|
||||
|
||||
if (ChronLog)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
rc = WaitForSingleObject(ChronMutexHandle, 4 * 1000);
|
||||
if ((rc == WAIT_OBJECT_0) || (rc == WAIT_TIMEOUT))
|
||||
break;
|
||||
}
|
||||
}
|
||||
time(&aclock);
|
||||
newtime = localtime(&aclock);
|
||||
strcpy(AsciiTime, asctime(newtime));
|
||||
AsciiTime[strlen(AsciiTime) - 1] = '\0';
|
||||
GetCurrentDirectory(sizeof(WorkingDirectory), WorkingDirectory);
|
||||
sprintf(NewMessage, "%s - %s", AsciiTime, message);
|
||||
sprintf(NewFileName, "%s\\log%05d\\%s\\%s", WorkingDirectory, LogID, HostName, FileName);
|
||||
fp = fopen(NewFileName, "a+");
|
||||
if (fp != NULL)
|
||||
{
|
||||
fprintf(fp, "%s", NewMessage);
|
||||
fclose(fp);
|
||||
}
|
||||
if (ChronLog)
|
||||
{
|
||||
sprintf(NewMessage, "%s %s:%d- %s", AsciiTime, HostName, ProcessNumber, message);
|
||||
sprintf(NewFileName, "%s\\log%05d\\Chron.log", WorkingDirectory, LogID);
|
||||
fp = fopen(NewFileName, "a+");
|
||||
fprintf(fp, "%s", NewMessage);
|
||||
fclose(fp);
|
||||
ReleaseMutex(ChronMutexHandle);
|
||||
}
|
||||
}
|
||||
|
||||
void DumpAFSLog(char *HostName, int LogID)
|
||||
{
|
||||
char EnvVariable[512];
|
||||
char WorkingDirectory[512];
|
||||
char command[512];
|
||||
int rc;
|
||||
|
||||
WaitForSingleObject(FileMutexHandle, 4 * 1000);
|
||||
memset(WorkingDirectory, '\0', sizeof(WorkingDirectory));
|
||||
GetCurrentDirectory(sizeof(WorkingDirectory), WorkingDirectory);
|
||||
sprintf(command, "fs trace -dump > .\\test\\%s", HostName);
|
||||
rc = system(command);
|
||||
rc = GetWindowsDirectory(EnvVariable, sizeof(EnvVariable));
|
||||
strcat(EnvVariable, "\\TEMP\\afsd.log");
|
||||
sprintf(command, "move %s %s\\log%05d\\%s > .\\test\\%s", EnvVariable, WorkingDirectory, LogID, HostName, HostName);
|
||||
rc = system(command);
|
||||
sprintf(command, "rename %s\\log%05d\\%s\\afsd.log afsd_%s_iteration%d.log",
|
||||
WorkingDirectory, LogID, HostName, HostName, CurrentLoop);
|
||||
rc = system(command);
|
||||
ReleaseMutex(FileMutexHandle);
|
||||
}
|
||||
|
||||
int UpdateMasterLog(char *FileName, struct cmd_struct CommandInfo[])
|
||||
{
|
||||
FILE *fp;
|
||||
char Buffer[32];
|
||||
int i;
|
||||
struct cmd_struct TotalCommandInfo[CMD_MAX_CMD + 1];
|
||||
|
||||
WaitForSingleObject(FileMutexHandle, 4 * 1000);
|
||||
|
||||
for (i = 0; i <= CMD_MAX_CMD; i++)
|
||||
{
|
||||
TotalCommandInfo[i].count = 0;
|
||||
TotalCommandInfo[i].min_sec = 0;
|
||||
TotalCommandInfo[i].max_sec = 0;
|
||||
TotalCommandInfo[i].MilliSeconds = 0;
|
||||
TotalCommandInfo[i].total_sec = 0;
|
||||
TotalCommandInfo[i].ErrorCount = 0;
|
||||
TotalCommandInfo[i].ErrorTime = 0;
|
||||
TotalCommandInfo[i].total_sum_of_squares = 0;
|
||||
}
|
||||
|
||||
fp = fopen(FileName, "r");
|
||||
if (fp != NULL)
|
||||
{
|
||||
for (i = 0; i <= CMD_MAX_CMD; i++)
|
||||
{
|
||||
fgets(Buffer, 16, fp);
|
||||
TotalCommandInfo[i].count = atoi(Buffer);
|
||||
fgets(Buffer, 16, fp);
|
||||
TotalCommandInfo[i].min_sec = atoi(Buffer);
|
||||
fgets(Buffer, 16, fp);
|
||||
TotalCommandInfo[i].max_sec = atoi(Buffer);
|
||||
fgets(Buffer, 16, fp);
|
||||
TotalCommandInfo[i].total_sec = atoi(Buffer);
|
||||
fgets(Buffer, 16, fp);
|
||||
TotalCommandInfo[i].total_sum_of_squares = atoi(Buffer);
|
||||
fgets(Buffer, 16, fp);
|
||||
TotalCommandInfo[i].ErrorCount = atoi(Buffer);
|
||||
fgets(Buffer, 16, fp);
|
||||
TotalCommandInfo[i].ErrorTime = atoi(Buffer);
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
for (i = 0; i <= CMD_MAX_CMD; i++)
|
||||
{
|
||||
TotalCommandInfo[i].count += CommandInfo[i].count;
|
||||
if (!TotalCommandInfo[i].min_sec || (TotalCommandInfo[i].min_sec > CommandInfo[i].min_sec))
|
||||
TotalCommandInfo[i].min_sec = CommandInfo[i].min_sec;
|
||||
if (TotalCommandInfo[i].max_sec < CommandInfo[i].max_sec)
|
||||
TotalCommandInfo[i].max_sec = CommandInfo[i].max_sec;
|
||||
TotalCommandInfo[i].total_sec += CommandInfo[i].total_sec;
|
||||
TotalCommandInfo[i].total_sum_of_squares += CommandInfo[i].total_sum_of_squares;
|
||||
TotalCommandInfo[i].ErrorCount += CommandInfo[i].ErrorCount;
|
||||
TotalCommandInfo[i].ErrorTime += CommandInfo[i].ErrorTime;
|
||||
}
|
||||
|
||||
|
||||
fp = fopen(FileName, "w");
|
||||
for (i = 0; i <= CMD_MAX_CMD; i++)
|
||||
{
|
||||
fprintf(fp, "%ld\n", TotalCommandInfo[i].count);
|
||||
fprintf(fp, "%ld\n", TotalCommandInfo[i].min_sec);
|
||||
fprintf(fp, "%ld\n", TotalCommandInfo[i].max_sec);
|
||||
fprintf(fp, "%ld\n", TotalCommandInfo[i].total_sec);
|
||||
fprintf(fp, "%ld\n", TotalCommandInfo[i].total_sum_of_squares);
|
||||
fprintf(fp, "%ld\n", TotalCommandInfo[i].ErrorCount);
|
||||
fprintf(fp, "%ld\n", TotalCommandInfo[i].ErrorTime);
|
||||
}
|
||||
fclose(fp);
|
||||
ReleaseMutex(FileMutexHandle);
|
||||
return(0);
|
||||
}
|
||||
|
||||
int BuildMasterStatLog(char *FileName, char*MoveFileName, int NumberOfProcesses,
|
||||
int NumberOfThreads, char *CommandLine, int Iterations,
|
||||
char *TargetDirectory, int ProcessNumber)
|
||||
{
|
||||
FILE *fp;
|
||||
char Buffer[32];
|
||||
int i;
|
||||
struct cmd_struct TotalCommandInfo[CMD_MAX_CMD + 1];
|
||||
|
||||
for (i = 0; i <= CMD_MAX_CMD; i++)
|
||||
{
|
||||
TotalCommandInfo[i].count = 0;
|
||||
TotalCommandInfo[i].min_sec = 0;
|
||||
TotalCommandInfo[i].MilliSeconds = 0;
|
||||
TotalCommandInfo[i].max_sec = 0;
|
||||
TotalCommandInfo[i].total_sec = 0;
|
||||
TotalCommandInfo[i].total_sum_of_squares = 0;
|
||||
TotalCommandInfo[i].ErrorCount = 0;
|
||||
TotalCommandInfo[i].ErrorTime = 0;
|
||||
}
|
||||
|
||||
fp = fopen(FileName, "r");
|
||||
if (fp != NULL)
|
||||
{
|
||||
for (i = 0; i <= CMD_MAX_CMD; i++)
|
||||
{
|
||||
if (fgets(Buffer, 16, fp) != NULL)
|
||||
TotalCommandInfo[i].count = atoi(Buffer);
|
||||
if (fgets(Buffer, 16, fp) != NULL)
|
||||
TotalCommandInfo[i].min_sec = atoi(Buffer);
|
||||
if (fgets(Buffer, 16, fp) != NULL)
|
||||
TotalCommandInfo[i].max_sec = atoi(Buffer);
|
||||
if (fgets(Buffer, 16, fp) != NULL)
|
||||
TotalCommandInfo[i].total_sec = atoi(Buffer);
|
||||
if (fgets(Buffer, 16, fp) != NULL)
|
||||
TotalCommandInfo[i].total_sum_of_squares = atoi(Buffer);
|
||||
if (fgets(Buffer, 16, fp) != NULL)
|
||||
TotalCommandInfo[i].ErrorCount = atoi(Buffer);
|
||||
if (fgets(Buffer, 16, fp) != NULL)
|
||||
TotalCommandInfo[i].ErrorTime = atoi(Buffer);
|
||||
}
|
||||
fclose(fp);
|
||||
MoveFile(FileName, MoveFileName);
|
||||
}
|
||||
|
||||
fp = fopen(FileName, "w");
|
||||
fclose(fp);
|
||||
LogStats(FileName, 1, Iterations, NumberOfProcesses, NumberOfThreads, "", ProcessNumber, TotalCommandInfo,
|
||||
CommandLine, TargetDirectory);
|
||||
return(0);
|
||||
}
|
35
src/WINNT/tests/torture/StopStressTest/NTMakefile
Normal file
35
src/WINNT/tests/torture/StopStressTest/NTMakefile
Normal file
@ -0,0 +1,35 @@
|
||||
#
|
||||
# Copyright (c) 2009 Secure Endpoints Inc.
|
||||
#
|
||||
|
||||
AFSDEV_AUXCDEFINES=-I..\include
|
||||
RELDIR=WINNT\tests\torture\stopstresstest
|
||||
!INCLUDE ..\..\..\..\config\NTMakefile.$(SYS_NAME)
|
||||
!INCLUDE ..\..\..\..\config\NTMakefile.version
|
||||
|
||||
idirs:
|
||||
! if !(exist($(OJT)\WINNT\tests))
|
||||
md $(OJT)\WINNT\tests
|
||||
! endif
|
||||
! if !(exist($(OJT)\WINNT\tests\torture))
|
||||
md $(OJT)\WINNT\tests\torture
|
||||
! endif
|
||||
! if !(exist($(OJT)\WINNT\tests\torture\stopstresstest))
|
||||
md $(OJT)\WINNT\tests\torture\stopstresstest
|
||||
! endif
|
||||
|
||||
EXEDIR = $(DESTDIR)\bin
|
||||
|
||||
OBJS = $(OUT)\StopStressTest.obj
|
||||
|
||||
$(EXEDIR)\StopStressTest.exe: $(OBJS)
|
||||
$(EXECONLINK)
|
||||
$(_VC_MANIFEST_EMBED_EXE)
|
||||
$(EXEPREP)
|
||||
$(CODESIGN_USERLAND)
|
||||
|
||||
install: idirs $(EXEDIR)\StopStressTest.exe
|
||||
|
||||
clean::
|
||||
|
||||
|
150
src/WINNT/tests/torture/StopStressTest/StopStressTest.c
Normal file
150
src/WINNT/tests/torture/StopStressTest/StopStressTest.c
Normal file
@ -0,0 +1,150 @@
|
||||
// Stress.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <io.h>
|
||||
|
||||
#define SUSPEND_PROCESSING 'p'
|
||||
#define CONTINUE_PROCESSING 'c'
|
||||
#define END_PROCESSING 'e'
|
||||
|
||||
void usage(void);
|
||||
int GetConsoleInput(HANDLE hStdin);
|
||||
void ProcessRequest(char RequestType, HANDLE ShutDownEventHandle, HANDLE PauseEventHandle, HANDLE ContinueEventHandle);
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
char Character;
|
||||
HANDLE ShutDownEventHandle;
|
||||
HANDLE PauseEventHandle;
|
||||
HANDLE ContinueEventHandle;
|
||||
HANDLE hStdin;
|
||||
|
||||
hStdin = GetStdHandle(STD_INPUT_HANDLE);
|
||||
|
||||
|
||||
ShutDownEventHandle = CreateEvent(NULL, TRUE, FALSE, "AfsShutdownEvent");
|
||||
PauseEventHandle = CreateEvent(NULL, TRUE, FALSE, "AfsPauseEvent");
|
||||
ContinueEventHandle = CreateEvent(NULL, TRUE, FALSE, "AfsContinueEvent");
|
||||
|
||||
while (1)
|
||||
{
|
||||
printf("\nType p to pause the stress test\n");
|
||||
printf("Type c to continue the stress test\n");
|
||||
printf("Type e to end the stress test\n");
|
||||
printf("Type q to quit StopStressTest\n");
|
||||
Character = (char)GetConsoleInput(hStdin);
|
||||
|
||||
if (Character == 'q')
|
||||
break;
|
||||
if ((Character == SUSPEND_PROCESSING) || (Character == END_PROCESSING) || (Character == CONTINUE_PROCESSING))
|
||||
ProcessRequest(Character, ShutDownEventHandle, PauseEventHandle, ContinueEventHandle);
|
||||
else
|
||||
printf("\nInvalid selection....\n");
|
||||
|
||||
}
|
||||
|
||||
CloseHandle(ShutDownEventHandle);
|
||||
CloseHandle(PauseEventHandle);
|
||||
CloseHandle(ContinueEventHandle);
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
int GetConsoleInput(HANDLE hStdin)
|
||||
{
|
||||
INPUT_RECORD InputRecord[128];
|
||||
DWORD InputRecordCount;
|
||||
BOOL rc;
|
||||
int i;
|
||||
int RetCode;
|
||||
char ReadChar;
|
||||
|
||||
InputRecordCount = 0;
|
||||
RetCode = 0;
|
||||
while (1)
|
||||
{
|
||||
rc = ReadConsoleInput(hStdin, InputRecord, 1, &InputRecordCount);
|
||||
if (InputRecord[0].EventType == KEY_EVENT)
|
||||
{
|
||||
if (InputRecord[0].Event.KeyEvent.bKeyDown)
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < (int)InputRecordCount; i++)
|
||||
{
|
||||
switch(InputRecord[i].EventType)
|
||||
{
|
||||
case KEY_EVENT:
|
||||
if (InputRecord[i].Event.KeyEvent.bKeyDown)
|
||||
{
|
||||
ReadChar = InputRecord[i].Event.KeyEvent.uChar.AsciiChar;
|
||||
if ((ReadChar == 'q') || (ReadChar == 'Q'))
|
||||
{
|
||||
printf("\nQuit request received\n");
|
||||
exit(0);
|
||||
}
|
||||
else if ((ReadChar == 'c') || (ReadChar == 'C'))
|
||||
{
|
||||
printf("\nContinue stress test request received\n");
|
||||
RetCode = CONTINUE_PROCESSING;
|
||||
}
|
||||
else if ((ReadChar == 'p') || (ReadChar == 'P'))
|
||||
{
|
||||
printf("\nPause stress test request received\n");
|
||||
RetCode = SUSPEND_PROCESSING;
|
||||
}
|
||||
else if ((ReadChar == 'e') || (ReadChar == 'E'))
|
||||
{
|
||||
RetCode = END_PROCESSING;
|
||||
printf("\nEnd stress test request received\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return(RetCode);
|
||||
}
|
||||
|
||||
void ProcessRequest(char RequestType, HANDLE ShutDownEventHandle, HANDLE PauseEventHandle, HANDLE ContinueEventHandle)
|
||||
{
|
||||
static int LastRequest = 0;
|
||||
|
||||
if (RequestType == CONTINUE_PROCESSING)
|
||||
{
|
||||
if (LastRequest == END_PROCESSING)
|
||||
{
|
||||
printf("Invalid request, all process are currently ending\n");
|
||||
return;
|
||||
}
|
||||
ResetEvent(PauseEventHandle);
|
||||
SetEvent(ContinueEventHandle);
|
||||
printf("Continue processing event has been set\n");
|
||||
LastRequest = RequestType;
|
||||
}
|
||||
if (RequestType == SUSPEND_PROCESSING)
|
||||
{
|
||||
if (LastRequest == END_PROCESSING)
|
||||
{
|
||||
printf("Invalid request, all processes are currently ending\n");
|
||||
return;
|
||||
}
|
||||
ResetEvent(ContinueEventHandle);
|
||||
SetEvent(PauseEventHandle);
|
||||
printf("Suspend processing event has been set\n");
|
||||
LastRequest = RequestType;
|
||||
}
|
||||
else if (RequestType == END_PROCESSING)
|
||||
{
|
||||
SetEvent(ShutDownEventHandle);
|
||||
ResetEvent(PauseEventHandle);
|
||||
SetEvent(ContinueEventHandle);
|
||||
printf("End processing event has been set\n");
|
||||
LastRequest = RequestType;
|
||||
}
|
||||
}
|
101
src/WINNT/tests/torture/StopStressTest/StopStressTest.dsp
Normal file
101
src/WINNT/tests/torture/StopStressTest/StopStressTest.dsp
Normal file
@ -0,0 +1,101 @@
|
||||
# Microsoft Developer Studio Project File - Name="StopStressTest" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=StopStressTest - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "StopStressTest.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "StopStressTest.mak" CFG="StopStressTest - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "StopStressTest - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "StopStressTest - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "StopStressTest - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "StopStressTest - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "StopStressTest - Win32 Release"
|
||||
# Name "StopStressTest - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StopStressTest.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
29
src/WINNT/tests/torture/StopStressTest/StopStressTest.dsw
Normal file
29
src/WINNT/tests/torture/StopStressTest/StopStressTest.dsw
Normal file
@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "StopStressTest"=".\StopStressTest.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
35
src/WINNT/tests/torture/Stress/NTMakefile
Normal file
35
src/WINNT/tests/torture/Stress/NTMakefile
Normal file
@ -0,0 +1,35 @@
|
||||
#
|
||||
# Copyright (c) 2009 Secure Endpoints Inc.
|
||||
#
|
||||
|
||||
AFSDEV_AUXCDEFINES=-I..\include
|
||||
RELDIR=WINNT\tests\torture\stress
|
||||
!INCLUDE ..\..\..\..\config\NTMakefile.$(SYS_NAME)
|
||||
!INCLUDE ..\..\..\..\config\NTMakefile.version
|
||||
|
||||
idirs:
|
||||
! if !(exist($(OJT)\WINNT\tests))
|
||||
md $(OJT)\WINNT\tests
|
||||
! endif
|
||||
! if !(exist($(OJT)\WINNT\tests\torture))
|
||||
md $(OJT)\WINNT\tests\torture
|
||||
! endif
|
||||
! if !(exist($(OJT)\WINNT\tests\torture\stress))
|
||||
md $(OJT)\WINNT\tests\torture\stress
|
||||
! endif
|
||||
|
||||
EXEDIR = $(DESTDIR)\bin
|
||||
|
||||
OBJS = $(OUT)\Stress.obj
|
||||
|
||||
$(EXEDIR)\Stress.exe: $(OBJS)
|
||||
$(EXECONLINK)
|
||||
$(_VC_MANIFEST_EMBED_EXE)
|
||||
$(EXEPREP)
|
||||
$(CODESIGN_USERLAND)
|
||||
|
||||
install: idirs $(EXEDIR)\Stress.exe
|
||||
|
||||
clean::
|
||||
|
||||
|
19
src/WINNT/tests/torture/Stress/StdAfx.h
Normal file
19
src/WINNT/tests/torture/Stress/StdAfx.h
Normal file
@ -0,0 +1,19 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__5D9D9966_7D99_435B_82F4_6465EFF7E7E2__INCLUDED_)
|
||||
#define AFX_STDAFX_H__5D9D9966_7D99_435B_82F4_6465EFF7E7E2__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
|
||||
// TODO: reference additional headers your program requires here
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__5D9D9966_7D99_435B_82F4_6465EFF7E7E2__INCLUDED_)
|
268
src/WINNT/tests/torture/Stress/Stress.c
Normal file
268
src/WINNT/tests/torture/Stress/Stress.c
Normal file
@ -0,0 +1,268 @@
|
||||
// Stress.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int opterr = 1;
|
||||
int optind = 1;
|
||||
int optopt;
|
||||
int optreset;
|
||||
char *optarg;
|
||||
|
||||
int getopt(int, char**, char*);
|
||||
void usage(void);
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int i;
|
||||
int k;
|
||||
int opt;
|
||||
int LogID;
|
||||
int ProcessCount;
|
||||
int SecondsDelay;
|
||||
int DirCount;
|
||||
int DirFound;
|
||||
char command[512];
|
||||
char temp[512];
|
||||
char TopDirectory[512];
|
||||
char CurrentDirectory[256];
|
||||
PROCESS_INFORMATION ProcInfo;
|
||||
STARTUPINFO StartupInfo;
|
||||
HANDLE hArray[500];
|
||||
WIN32_FIND_DATA FindFileData;
|
||||
HANDLE fHandle;
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
for (i = 0; i < 500; i++)
|
||||
hArray[i] = NULL;
|
||||
|
||||
LogID = 0;
|
||||
ProcessCount = 0;
|
||||
DirFound = 0;
|
||||
DirCount = 0;
|
||||
SecondsDelay = 0;
|
||||
memset(command, '\0', sizeof(command));
|
||||
memset(TopDirectory, '\0', sizeof(TopDirectory));
|
||||
|
||||
while ((opt = getopt(argc, argv, "A:a:BbC:c:D:d:EeF:f:I:i:L:l:M:m:N:n:P:p:SsTtU:u:Vv")) != EOF)
|
||||
{
|
||||
|
||||
switch (opt)
|
||||
{
|
||||
case 'f':
|
||||
case 'F':
|
||||
DirFound = 1;
|
||||
strcpy(TopDirectory, optarg);
|
||||
break;
|
||||
case 'a':
|
||||
case 'A':
|
||||
SecondsDelay = atoi(optarg);
|
||||
break;
|
||||
case 'd':
|
||||
case 'D':
|
||||
ProcessCount = atoi(optarg);
|
||||
case 'b':
|
||||
case 'B':
|
||||
case 'c':
|
||||
case 'C':
|
||||
case 'e':
|
||||
case 'E':
|
||||
case 'i':
|
||||
case 'I':
|
||||
case 'l':
|
||||
case 'L':
|
||||
case 'm':
|
||||
case 'M':
|
||||
case 'n':
|
||||
case 'N':
|
||||
case 'p':
|
||||
case 'P':
|
||||
case 's':
|
||||
case 'S':
|
||||
case 't':
|
||||
case 'T':
|
||||
case 'u':
|
||||
case 'U':
|
||||
case 'v':
|
||||
case 'V':
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
exit(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (LogID = 0; LogID < 100; LogID++)
|
||||
{
|
||||
sprintf(CurrentDirectory, ".\\Log%05d", LogID);
|
||||
fHandle = FindFirstFile(CurrentDirectory, &FindFileData);
|
||||
if (fHandle == INVALID_HANDLE_VALUE)
|
||||
break;
|
||||
FindClose(fHandle);
|
||||
}
|
||||
if (LogID == 100)
|
||||
{
|
||||
printf("\nUnable to get a LogID.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!DirFound)
|
||||
{
|
||||
printf("\nYou must use the -f switch\n\n");
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
if (!ProcessCount)
|
||||
{
|
||||
printf("\nYou must use the -d switch\n\n");
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
if (ProcessCount > 500)
|
||||
{
|
||||
printf("\nA max of 500 processes allowed\n\n");
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
GetStartupInfo(&StartupInfo);
|
||||
memset(&StartupInfo, '\0', sizeof(StartupInfo));
|
||||
for (i = 0; i < ProcessCount; i++)
|
||||
{
|
||||
memset(command, '\0', sizeof(command));
|
||||
for (k = 0; k < argc; k++)
|
||||
{
|
||||
strcat(command, argv[k]);
|
||||
strcat(command, " ");
|
||||
if (!stricmp(argv[k], "-f"))
|
||||
{
|
||||
++k;
|
||||
memset(temp, '\0', sizeof(temp));
|
||||
sprintf(temp, "%s%05d", argv[k], DirCount);
|
||||
strcat(command, temp);
|
||||
strcat(command, " ");
|
||||
++DirCount;
|
||||
}
|
||||
}
|
||||
sprintf(temp, " -g %d", LogID);
|
||||
strcat(command, temp);
|
||||
StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
|
||||
StartupInfo.wShowWindow = SW_SHOWMINIMIZED;
|
||||
if (CreateProcess(".\\wintorture.exe", command, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &StartupInfo, &ProcInfo))
|
||||
hArray[i] = ProcInfo.hProcess;
|
||||
Sleep(SecondsDelay * 1000);
|
||||
}
|
||||
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
void usage(void)
|
||||
{
|
||||
|
||||
printf("usage: stress [options]\n");
|
||||
printf("where options can be:\n");
|
||||
printf("\t-a <sec> Seconds delay between starting detached processes\n");
|
||||
printf("\t-b Create a chronological log\n");
|
||||
printf("\t-c <txt> Specifies the script txt file to use\n");
|
||||
printf("\t-d <num> Number of detached processes to run\n");
|
||||
printf("\t-e End thread processing on an error.\n");
|
||||
printf("\t-f <name> Target directory name\n");
|
||||
#ifdef HAVE_HESOID
|
||||
printf("\t-l <path> Interpert as an AFS locker or AFS submount\n");
|
||||
#endif /* HAVE_HESOID */
|
||||
printf("\t-i <num> Number of iterations of the stress test to run.\n");
|
||||
printf("\t This option will override the -m option.\n");
|
||||
printf("\t-m <num> The number of minutes to run\n");
|
||||
printf("\t-n <num> The number of threads to run\n");
|
||||
printf("\t-p <path> UNC path to second directory\n");
|
||||
printf("\t-s Output stats\n");
|
||||
printf("\t-t Do AFS trace logging\n");
|
||||
printf("\t-u <UNC> UNC path to target directory\n");
|
||||
printf("\t-v Turn on verbose mode\n");
|
||||
printf("\nNOTE: The switches are not case sensitive. You\n");
|
||||
printf("\n may use either upper or lower case letters.\n\n");
|
||||
}
|
||||
|
||||
char *_progname(char *nargv0)
|
||||
{
|
||||
char *tmp;
|
||||
|
||||
tmp = strrchr(nargv0, '/');
|
||||
if (tmp)
|
||||
tmp++;
|
||||
else
|
||||
tmp = nargv0;
|
||||
return(tmp);
|
||||
}
|
||||
|
||||
#define BADCH (int)'?'
|
||||
#define BADARG (int)':'
|
||||
#define EMSG ""
|
||||
|
||||
int getopt(int nargc, char *nargv[], char *ostr)
|
||||
{
|
||||
static char *__progname = 0;
|
||||
static char *place = EMSG; /* option letter processing */
|
||||
char *oli; /* option letter list index */
|
||||
|
||||
__progname = __progname?__progname:_progname(*nargv);
|
||||
|
||||
if (optreset || !*place)
|
||||
{
|
||||
optreset = 0;
|
||||
if (optind >= nargc || *(place = nargv[optind]) != '-')
|
||||
{
|
||||
place = EMSG;
|
||||
return (-1);
|
||||
}
|
||||
if (place[1] && *++place == '-' && place[1] == '\0')
|
||||
{
|
||||
++optind;
|
||||
place = EMSG;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
if ((optopt = (int)*place++) == (int)':' || !(oli = strchr(ostr, optopt)))
|
||||
{
|
||||
if (optopt == (int)'-')
|
||||
return (-1);
|
||||
if (!*place)
|
||||
++optind;
|
||||
if (opterr && *ostr != ':')
|
||||
(void)fprintf(stderr, "%s: illegal option -- %c\n", __progname, optopt);
|
||||
return (BADCH);
|
||||
}
|
||||
if (*++oli != ':')
|
||||
{
|
||||
optarg = NULL;
|
||||
if (!*place)
|
||||
++optind;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*place)
|
||||
optarg = place;
|
||||
else if (nargc <= ++optind)
|
||||
{
|
||||
place = EMSG;
|
||||
if (*ostr == ':')
|
||||
return (BADARG);
|
||||
if (opterr)
|
||||
(void)fprintf(stderr, "%s: option requires an argument -- %c\n", __progname, optopt);
|
||||
return (BADCH);
|
||||
}
|
||||
else
|
||||
optarg = nargv[optind];
|
||||
place = EMSG;
|
||||
++optind;
|
||||
}
|
||||
return (optopt);
|
||||
}
|
113
src/WINNT/tests/torture/Stress/Stress.dsp
Normal file
113
src/WINNT/tests/torture/Stress/Stress.dsp
Normal file
@ -0,0 +1,113 @@
|
||||
# Microsoft Developer Studio Project File - Name="Stress" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=Stress - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Stress.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Stress.mak" CFG="Stress - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Stress - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "Stress - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "Stress - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "Stress - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "Stress - Win32 Release"
|
||||
# Name "Stress - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Stress.c
|
||||
|
||||
!IF "$(CFG)" == "Stress - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "Stress - Win32 Debug"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
29
src/WINNT/tests/torture/Stress/Stress.dsw
Normal file
29
src/WINNT/tests/torture/Stress/Stress.dsw
Normal file
@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "Stress"=".\Stress.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
138
src/WINNT/tests/torture/WinTorture_VC6/wintorture.dsp
Normal file
138
src/WINNT/tests/torture/WinTorture_VC6/wintorture.dsp
Normal file
@ -0,0 +1,138 @@
|
||||
# Microsoft Developer Studio Project File - Name="wintorture" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=wintorture - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "wintorture.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "wintorture.mak" CFG="wintorture - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "wintorture - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "wintorture - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "wintorture - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /Od /I "..\include" /I "$(PISMERE)\athena\util\locker\lib" /I "$(PISMERE)\athena\wshelper\include" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_HESOID" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 Ws2_32.lib Mpr.lib Psapi.lib getopt.lib locker.lib oncrpc.lib athdir.lib krbv4w32.lib wshelp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"$(PISMERE)\target\lib\i386\rel"
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "wintorture - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /vmg /GX /ZI /Od /I "..\include" /I "$(PISMERE)\athena\util\locker\lib" /I "$(PISMERE)\athena\wshelper\include" /I "$(PISMERE)\target\lib\i386\rel" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "HAVE_HESOID" /FR /FD /GZ /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 krbv4w32.lib oncrpc.lib Kernel32.lib Psapi.lib wshelp32.lib locker.lib athdir.lib Ws2_32.lib Mpr.lib oleaut32.lib Advapi32.lib ole32.lib User32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"$(PISMERE)\target\lib\i386\dbg"
|
||||
# SUBTRACT LINK32 /verbose /nodefaultlib
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "wintorture - Win32 Release"
|
||||
# Name "wintorture - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Source\nbio.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Source\output.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Source\ResolveLocker.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Source\WinThreads.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Source\WinTorture.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\include\common.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\include\includes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\include\proto.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\include\ResolveLocker.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
29
src/WINNT/tests/torture/WinTorture_VC6/wintorture.dsw
Normal file
29
src/WINNT/tests/torture/WinTorture_VC6/wintorture.dsw
Normal file
@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "wintorture"=".\wintorture.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
@ -0,0 +1,138 @@
|
||||
# Microsoft Developer Studio Project File - Name="wintorture" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=wintorture - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "wintorture.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "wintorture.mak" CFG="wintorture - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "wintorture - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "wintorture - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "wintorture - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /Od /I "..\include" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 Ws2_32.lib Mpr.lib Psapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "wintorture - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /vmg /GX /ZI /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 Kernel32.lib Psapi.lib Ws2_32.lib Mpr.lib oleaut32.lib Advapi32.lib ole32.lib User32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# SUBTRACT LINK32 /verbose /nodefaultlib
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "wintorture - Win32 Release"
|
||||
# Name "wintorture - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Source\nbio.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Source\output.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Source\ResolveLocker.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Source\WinThreads.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Source\WinTorture.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\include\common.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\include\includes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\include\proto.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\include\ResolveLocker.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "wintorture"=".\wintorture.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
@ -0,0 +1,346 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="wintorture"
|
||||
ProjectGUID="{AA8BB120-E8EC-4609-8FBA-F36124AA363E}"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/wintorture.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\include"
|
||||
PreprocessorDefinitions="WIN32;_CONSOLE"
|
||||
RuntimeLibrary="2"
|
||||
PrecompiledHeaderFile=".\Release/wintorture.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Ws2_32.lib Mpr.lib Psapi.lib odbc32.lib odbccp32.lib"
|
||||
OutputFile=".\Release/wintorture.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile=".\Release/wintorture.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/wintorture.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/wintorture.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/vmg"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
PrecompiledHeaderFile=".\Debug/wintorture.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Kernel32.lib Psapi.lib Ws2_32.lib Mpr.lib Advapi32.lib User32.lib"
|
||||
OutputFile=".\Debug/wintorture.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/wintorture.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Debug/wintorture.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\Source\nbio.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Source\output.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Source\ResolveLocker.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Source\WinThreads.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Source\WinTorture.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\include\common.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\include\includes.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\include\proto.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\include\ResolveLocker.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
1782
src/WINNT/tests/torture/clients/CopySmallFilesLong.txt
Normal file
1782
src/WINNT/tests/torture/clients/CopySmallFilesLong.txt
Normal file
File diff suppressed because it is too large
Load Diff
227
src/WINNT/tests/torture/clients/CopySmallFilesShort.txt
Normal file
227
src/WINNT/tests/torture/clients/CopySmallFilesShort.txt
Normal file
@ -0,0 +1,227 @@
|
||||
#BM_MEASURE ; Start measuring
|
||||
SetLocker
|
||||
#Xrmdir c:\clients all
|
||||
#Xrmdir \\afs\locker\clients all
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xrmdir c:\clients\client1 all
|
||||
Mkdir c:\clients\client1\mixfile
|
||||
Mkdir c:\clients\client1\~dmtmp
|
||||
CreateFile c:\clients\client1\filler.000 256891
|
||||
CreateFile c:\clients\client1\filler.001 99243
|
||||
CreateFile c:\clients\client1\filler.002 9000
|
||||
CreateFile c:\clients\client1\filler.003 234567
|
||||
CreateFile c:\clients\client1\filler.004 159679
|
||||
Mkdir c:\clients\client1\~dmtmp\WORD
|
||||
CreateFile c:\clients\client1\~dmtmp\WORD\CHAP10.DOC 109634
|
||||
CreateFile c:\clients\client1\~dmtmp\WORD\BASEMACH.DOC 2301
|
||||
CreateFile c:\clients\client1\~dmtmp\WORD\FACTS.DOC 74932
|
||||
Mkdir c:\clients\client1\~dmtmp\EXCEL
|
||||
CreateFile c:\clients\client1\~dmtmp\EXCEL\PCMAGCD.XLS 32649
|
||||
CreateFile c:\clients\client1\~dmtmp\EXCEL\SALES.XLS 64000
|
||||
Mkdir c:\clients\client1\~dmtmp\PWRPNT
|
||||
CreateFile c:\clients\client1\~dmtmp\PWRPNT\PCBENCHM.PPT 8345
|
||||
CreateFile c:\clients\client1\~dmtmp\PWRPNT\ZD16.BMP 174533
|
||||
CreateFile c:\clients\client1\~dmtmp\PWRPNT\PPTOOLS1.PPA 273561
|
||||
CreateFile c:\clients\client1\~dmtmp\PWRPNT\TIPS.PPT 43596
|
||||
CreateFile c:\clients\client1\~dmtmp\PWRPNT\TRIDOTS.POT 33811
|
||||
Mkdir c:\clients\client1\~dmtmp\COREL
|
||||
CreateFile c:\clients\client1\~dmtmp\COREL\CDRROLS.CFG 213857
|
||||
CreateFile c:\clients\client1\~dmtmp\COREL\CDRBARS.CFG 172699
|
||||
CreateFile c:\clients\client1\~dmtmp\COREL\ARTISTIC.ACL 23982
|
||||
CreateFile c:\clients\client1\~dmtmp\COREL\GRAPHIC1.CDR 72543
|
||||
CreateFile c:\clients\client1\~dmtmp\COREL\MAILBOX2.CPT 28
|
||||
CreateFile c:\clients\client1\~dmtmp\COREL\TEAPOT2.CPT 6243
|
||||
CreateFile c:\clients\client1\~dmtmp\COREL\SIGN2.CPT 112435
|
||||
CreateFile c:\clients\client1\~dmtmp\COREL\TRAIN.CDR 157245
|
||||
CreateFile c:\clients\client1\~dmtmp\COREL\GRAPHIC2.CDR 32000
|
||||
CreateFile c:\clients\client1\~dmtmp\COREL\ROSE.CPT 1254
|
||||
CreateFile c:\clients\client1\~dmtmp\COREL\CORELDRW.CDT 512
|
||||
Mkdir c:\clients\client1\~dmtmp\WORDPRO
|
||||
CreateFile c:\clients\client1\~dmtmp\WORDPRO\BENCHS.LWP 214237
|
||||
CreateFile c:\clients\client1\~dmtmp\WORDPRO\RESULTS.XLS 45398
|
||||
CreateFile c:\clients\client1\~dmtmp\WORDPRO\NEWS1_1.LWP 1024
|
||||
Mkdir c:\clients\client1\~dmtmp\PM
|
||||
CreateFile c:\clients\client1\~dmtmp\PM\T1.XLS 23
|
||||
CreateFile c:\clients\client1\~dmtmp\PM\EVENTS.DOC 234546
|
||||
CreateFile c:\clients\client1\~dmtmp\PM\MOVED.DOC 159000
|
||||
Mkdir c:\clients\client1\~dmtmp\PARADOX
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\COURSES.DB 1549
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\COURSES.PX 8732
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\COURSES.X04 15129
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\COURSES.Y04 65012
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\STUDENTS.DB 67234
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\STUDENTS.PX 25341
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\STUDENTS.XG0 2345
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\STUDENTS.YG0 61872
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\STUDENTS.XG1 7
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\STUDENTS.YG1 49
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\STUDENTS.VAL 42311
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\STUDENTS.MB 34576
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\ENROLL.DB 3329
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\ENROLL.PX 43127
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\ENROLL.X03 189234
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\ENROLL.Y03 62511
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\ENROLL.VAL 71234
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\STUDENTS.TV 1239
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\STUDENTS.FSL 34
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\COURSES.FSL 2491
|
||||
Mkdir c:\clients\client1\~dmtmp\ACCESS
|
||||
CreateFile c:\clients\client1\~dmtmp\ACCESS\FASTENER.MDB 9999
|
||||
Mkdir c:\clients\client1\~dmtmp\SEED
|
||||
CreateFile c:\clients\client1\~dmtmp\SEED\SMALL.FIL 12345
|
||||
CreateFile c:\clients\client1\~dmtmp\SEED\MEDIUM.FIL 54321
|
||||
CreateFile c:\clients\client1\~dmtmp\SEED\LARGE.FIL 22451
|
||||
#Mkdir c:\clients\client1\~dmtmp\WORDPRO
|
||||
CreateFile c:\clients\client1\~dmtmp\WORDPRO\BENCHS1A.PRN 8645
|
||||
CreateFile c:\clients\client1\~dmtmp\WORDPRO\BENCHS1.PRN 1024
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\S31.VAL 145251
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\COURSES.VAL 21762
|
||||
CreateFile c:\clients\client1\~dmtmp\PARADOX\ANSWER.DB 834712
|
||||
CreateFile c:\clients\client1\~dmtmp\PWRPNT\NEWTIPS.PPT 3245
|
||||
CreateFile c:\clients\client1\~dmtmp\COREL\CDRBARS.CFG 2042
|
||||
Xcopy c:\clients\client1 \\afs\locker\clients\client1
|
||||
DeleteFiles \\afs\locker\clients\client1\~dmtmp\SEED\*.*
|
||||
CopyFiles c:\clients\client1\~dmtmp\SEED\*.* \\afs\locker\clients\client1\~dmtmp\SEED\
|
||||
DeleteFiles \\afs\locker\clients\client1\fi*.*
|
||||
CopyFiles c:\clients\client1\fi*.* \\afs\locker\clients\client1\
|
||||
Xrmdir c:\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 c:\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy c:\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir c:\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 c:\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy c:\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir c:\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 c:\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy c:\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir c:\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 c:\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy c:\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir c:\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 c:\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy c:\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir c:\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 c:\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy c:\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir c:\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 c:\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy c:\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir c:\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 c:\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy c:\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir c:\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 c:\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy c:\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir c:\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 c:\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy c:\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir c:\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 c:\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy c:\clients\client1 \\afs\locker\clients\client1
|
||||
DeleteFiles \\afs\locker\clients\client1\fi*.*
|
||||
Move c:\clients\client1\filler.000 \\afs\locker\clients\client1
|
||||
Move c:\clients\client1\filler.001 \\afs\locker\clients\client1
|
||||
Move c:\clients\client1\filler.002 \\afs\locker\clients\client1
|
||||
Move c:\clients\client1\filler.003 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.000 c:\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.001 c:\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.002 c:\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.003 c:\clients\client1
|
||||
Move c:\clients\client1\filler.000 \\afs\locker\clients\client1
|
||||
Move c:\clients\client1\filler.001 \\afs\locker\clients\client1
|
||||
Move c:\clients\client1\filler.002 \\afs\locker\clients\client1
|
||||
Move c:\clients\client1\filler.003 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.000 c:\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.001 c:\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.002 c:\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.003 c:\clients\client1
|
||||
Move c:\clients\client1\filler.000 \\afs\locker\clients\client1
|
||||
Move c:\clients\client1\filler.001 \\afs\locker\clients\client1
|
||||
Move c:\clients\client1\filler.002 \\afs\locker\clients\client1
|
||||
Move c:\clients\client1\filler.003 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.000 c:\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.001 c:\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.002 c:\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.003 c:\clients\client1
|
||||
Move c:\clients\client1\filler.000 \\afs\locker\clients\client1
|
||||
Move c:\clients\client1\filler.001 \\afs\locker\clients\client1
|
||||
Move c:\clients\client1\filler.002 \\afs\locker\clients\client1
|
||||
Move c:\clients\client1\filler.003 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.000 c:\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.001 c:\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.002 c:\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.003 c:\clients\client1
|
||||
Move c:\clients\client1\filler.000 \\afs\locker\clients\client1
|
||||
Move c:\clients\client1\filler.001 \\afs\locker\clients\client1
|
||||
Move c:\clients\client1\filler.002 \\afs\locker\clients\client1
|
||||
Move c:\clients\client1\filler.003 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.000 c:\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.001 c:\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.002 c:\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.003 c:\clients\client1
|
||||
CopyFiles c:\clients\client1\filler.000 \\afs\locker\clients\client1
|
||||
CopyFiles c:\clients\client1\filler.001 \\afs\locker\clients\client1
|
||||
CopyFiles c:\clients\client1\filler.002 \\afs\locker\clients\client1
|
||||
CopyFiles c:\clients\client1\filler.003 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.000 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.001 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.002 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.003 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.000 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.001 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.002 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.003 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.000 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.001 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.002 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.003 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.000 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.001 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.002 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.003 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.000 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.001 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.002 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.003 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.000 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.001 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.002 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.003 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.000 \\afs\locker\clients\client1\~dmtmp\EXCEL
|
||||
Move \\afs\locker\clients\client1\filler.001 \\afs\locker\clients\client1\~dmtmp\EXCEL
|
||||
Move \\afs\locker\clients\client1\filler.002 \\afs\locker\clients\client1\~dmtmp\EXCEL
|
||||
Move \\afs\locker\clients\client1\filler.003 \\afs\locker\clients\client1\~dmtmp\EXCEL
|
||||
Move \\afs\locker\clients\client1\~dmtmp\EXCEL\filler.000 \\afs\locker\clients\client1\~dmtmp\COREL
|
||||
Move \\afs\locker\clients\client1\~dmtmp\EXCEL\filler.001 \\afs\locker\clients\client1\~dmtmp\COREL
|
||||
Move \\afs\locker\clients\client1\~dmtmp\EXCEL\filler.002 \\afs\locker\clients\client1\~dmtmp\COREL
|
||||
Move \\afs\locker\clients\client1\~dmtmp\EXCEL\filler.003 \\afs\locker\clients\client1\~dmtmp\COREL
|
||||
Move \\afs\locker\clients\client1\~dmtmp\COREL\filler.000 \\afs\locker\clients\client1\~dmtmp\ACCESS
|
||||
Move \\afs\locker\clients\client1\~dmtmp\COREL\filler.001 \\afs\locker\clients\client1\~dmtmp\ACCESS
|
||||
Move \\afs\locker\clients\client1\~dmtmp\COREL\filler.002 \\afs\locker\clients\client1\~dmtmp\ACCESS
|
||||
Move \\afs\locker\clients\client1\~dmtmp\COREL\filler.003 \\afs\locker\clients\client1\~dmtmp\ACCESS
|
||||
Move \\afs\locker\clients\client1\~dmtmp\ACCESS\filler.000 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\~dmtmp\ACCESS\filler.001 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\~dmtmp\ACCESS\filler.002 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\~dmtmp\ACCESS\filler.003 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.000 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.001 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.002 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.003 \\afs\locker\clients\client1
|
||||
#attach lcolby
|
||||
#setlocker \\afs\lcolby
|
||||
#xcopy c:\clients\client1 \\afs\locker\Public\client1
|
||||
#xrmdir \\afs\locker\Public\client1 all
|
||||
#detach lcolby locker
|
||||
#setlocker
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xrmdir c:\clients\client1 all
|
@ -0,0 +1,254 @@
|
||||
#BM_MEASURE ; Start measuring
|
||||
SETLOCKER
|
||||
#attach lcolby
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xrmdir \\afs\lcolby\Public\clients\client1 all
|
||||
#detach lcolby locker
|
||||
Mkdir \\afs\locker\clients\client1\mixfile
|
||||
Mkdir \\afs\locker\clients\client1\~dmtmp
|
||||
CreateFile \\afs\locker\clients\client1\filler.000 256891
|
||||
CreateFile \\afs\locker\clients\client1\filler.001 99243
|
||||
CreateFile \\afs\locker\clients\client1\filler.002 9000
|
||||
CreateFile \\afs\locker\clients\client1\filler.003 234567
|
||||
CreateFile \\afs\locker\clients\client1\filler.004 159679
|
||||
#CreateFile \\afs\locker\clients\client1\filler.000 3645912
|
||||
#CreateFile \\afs\locker\clients\client1\filler.001 1475698
|
||||
#CreateFile \\afs\locker\clients\client1\filler.002 8234512
|
||||
#CreateFile \\afs\locker\clients\client1\filler.003 2234512
|
||||
#CreateFile \\afs\locker\clients\client1\filler.004 6438912
|
||||
Mkdir \\afs\locker\clients\client1\~dmtmp\WORD
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\WORD\CHAP10.DOC 109634
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\WORD\BASEMACH.DOC 2301
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\WORD\FACTS.DOC 74932
|
||||
Mkdir \\afs\locker\clients\client1\~dmtmp\EXCEL
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\EXCEL\PCMAGCD.XLS 32649
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\EXCEL\SALES.XLS 64000
|
||||
Mkdir \\afs\locker\clients\client1\~dmtmp\PWRPNT
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PWRPNT\PCBENCHM.PPT 8345
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PWRPNT\ZD16.BMP 174533
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PWRPNT\PPTOOLS1.PPA 273561
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PWRPNT\TIPS.PPT 43596
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PWRPNT\TRIDOTS.POT 33811
|
||||
Mkdir \\afs\locker\clients\client1\~dmtmp\COREL
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\COREL\CDRROLS.CFG 213857
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\COREL\CDRBARS.CFG 172699
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\COREL\ARTISTIC.ACL 23982
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\COREL\GRAPHIC1.CDR 72543
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\COREL\MAILBOX2.CPT 28
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\COREL\TEAPOT2.CPT 6243
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\COREL\SIGN2.CPT 112435
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\COREL\TRAIN.CDR 157245
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\COREL\GRAPHIC2.CDR 32000
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\COREL\ROSE.CPT 1254
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\COREL\CORELDRW.CDT 512
|
||||
Mkdir \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\WORDPRO\BENCHS.LWP 214237
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\WORDPRO\RESULTS.XLS 45398
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\WORDPRO\NEWS1_1.LWP 1024
|
||||
Mkdir \\afs\locker\clients\client1\~dmtmp\PM
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PM\T1.XLS 23
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PM\EVENTS.DOC 234546
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PM\MOVED.DOC 159000
|
||||
Mkdir \\afs\locker\clients\client1\~dmtmp\PARADOX
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\COURSES.DB 1549
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\COURSES.PX 8732
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\COURSES.X04 15129
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\COURSES.Y04 65012
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\STUDENTS.DB 67234
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\STUDENTS.PX 25341
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\STUDENTS.XG0 2345
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\STUDENTS.YG0 61872
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\STUDENTS.XG1 7
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\STUDENTS.YG1 49
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\STUDENTS.VAL 42311
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\STUDENTS.MB 34576
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\ENROLL.DB 3329
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\ENROLL.PX 43127
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\ENROLL.X03 189234
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\ENROLL.Y03 62511
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\ENROLL.VAL 71234
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\STUDENTS.TV 1239
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\STUDENTS.FSL 34
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\COURSES.FSL 2491
|
||||
Mkdir \\afs\locker\clients\client1\~dmtmp\ACCESS
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\ACCESS\FASTENER.MDB 9999
|
||||
Mkdir \\afs\locker\clients\client1\~dmtmp\SEED
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\SEED\SMALL.FIL 12345
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\SEED\MEDIUM.FIL 54321
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\SEED\LARGE.FIL 22451
|
||||
#Mkdir \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\WORDPRO\BENCHS1A.PRN 8645
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\WORDPRO\BENCHS1.PRN 1024
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\S31.VAL 145251
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\COURSES.VAL 21762
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PARADOX\ANSWER.DB 834712
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\PWRPNT\NEWTIPS.PPT 3245
|
||||
CreateFile \\afs\locker\clients\client1\~dmtmp\COREL\CDRBARS.CFG 2042
|
||||
|
||||
Xcopy \\afs\locker\clients\client1 \\afs\lcolby\Public\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy \\afs\lcolby\Public\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir \\afs\lcolby\Public\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 \\afs\lcolby\Public\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy \\afs\lcolby\Public\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir \\afs\lcolby\Public\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 \\afs\lcolby\Public\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy \\afs\lcolby\Public\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir \\afs\lcolby\Public\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 \\afs\lcolby\Public\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy \\afs\lcolby\Public\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir \\afs\lcolby\Public\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 \\afs\lcolby\Public\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy \\afs\lcolby\Public\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir \\afs\lcolby\Public\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 \\afs\lcolby\Public\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy \\afs\lcolby\Public\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir \\afs\lcolby\Public\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 \\afs\lcolby\Public\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy \\afs\lcolby\Public\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir \\afs\lcolby\Public\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 \\afs\lcolby\Public\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy \\afs\lcolby\Public\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir \\afs\lcolby\Public\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 \\afs\lcolby\Public\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy \\afs\lcolby\Public\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir \\afs\lcolby\Public\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 \\afs\lcolby\Public\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy \\afs\lcolby\Public\clients\client1 \\afs\locker\clients\client1
|
||||
Xrmdir \\afs\lcolby\Public\clients\client1 all
|
||||
Xcopy \\afs\locker\clients\client1 \\afs\lcolby\Public\clients\client1
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xcopy \\afs\lcolby\Public\clients\client1 \\afs\locker\clients\client1
|
||||
DeleteFiles \\afs\lcolby\Public\clients\client1\~dmtmp\SEED\*.*
|
||||
CopyFiles \\afs\locker\clients\client1\~dmtmp\SEED\*.* \\afs\lcolby\Public\clients\client1\~dmtmp\SEED\
|
||||
DeleteFiles \\afs\lcolby\Public\clients\client1\fi*.*
|
||||
CopyFiles \\afs\locker\clients\client1\fi*.* \\afs\lcolby\Public\clients\client1\
|
||||
DeleteFiles \\afs\locker\clients\client1\fi*.*
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.000 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.001 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.002 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.003 \\afs\locker\clients\client1
|
||||
|
||||
Move \\afs\locker\clients\client1\filler.000 \\afs\lcolby\Public\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.001 \\afs\lcolby\Public\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.002 \\afs\lcolby\Public\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.003 \\afs\lcolby\Public\clients\client1
|
||||
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.000 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.001 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.002 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.003 \\afs\locker\clients\client1
|
||||
|
||||
Move \\afs\locker\clients\client1\filler.000 \\afs\lcolby\Public\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.001 \\afs\lcolby\Public\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.002 \\afs\lcolby\Public\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.003 \\afs\lcolby\Public\clients\client1
|
||||
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.000 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.001 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.002 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.003 \\afs\locker\clients\client1
|
||||
|
||||
Move \\afs\locker\clients\client1\filler.000 \\afs\lcolby\Public\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.001 \\afs\lcolby\Public\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.002 \\afs\lcolby\Public\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.003 \\afs\lcolby\Public\clients\client1
|
||||
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.000 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.001 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.002 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.003 \\afs\locker\clients\client1
|
||||
|
||||
Move \\afs\locker\clients\client1\filler.000 \\afs\lcolby\Public\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.001 \\afs\lcolby\Public\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.002 \\afs\lcolby\Public\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.003 \\afs\lcolby\Public\clients\client1
|
||||
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.000 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.001 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.002 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\filler.003 \\afs\locker\clients\client1
|
||||
|
||||
Move \\afs\locker\clients\client1\filler.000 \\afs\lcolby\Public\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.001 \\afs\lcolby\Public\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.002 \\afs\lcolby\Public\clients\client1
|
||||
Move \\afs\locker\clients\client1\filler.003 \\afs\lcolby\Public\clients\client1
|
||||
|
||||
CopyFiles \\afs\lcolby\Public\clients\client1\filler.000 \\afs\locker\clients\client1
|
||||
CopyFiles \\afs\lcolby\Public\clients\client1\filler.001 \\afs\locker\clients\client1
|
||||
CopyFiles \\afs\lcolby\Public\clients\client1\filler.002 \\afs\locker\clients\client1
|
||||
CopyFiles \\afs\lcolby\Public\clients\client1\filler.003 \\afs\locker\clients\client1
|
||||
|
||||
Move \\afs\locker\clients\client1\filler.000 \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.001 \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.002 \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.003 \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO
|
||||
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO\filler.000 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO\filler.001 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO\filler.002 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO\filler.003 \\afs\locker\clients\client1
|
||||
|
||||
Move \\afs\locker\clients\client1\filler.000 \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.001 \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.002 \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.003 \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO
|
||||
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO\filler.000 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO\filler.001 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO\filler.002 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO\filler.003 \\afs\locker\clients\client1
|
||||
|
||||
Move \\afs\locker\clients\client1\filler.000 \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.001 \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.002 \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\locker\clients\client1\filler.003 \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO
|
||||
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO\filler.000 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO\filler.001 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO\filler.002 \\afs\locker\clients\client1
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\WORDPRO\filler.003 \\afs\locker\clients\client1
|
||||
|
||||
Move \\afs\locker\clients\client1\filler.000 \\afs\lcolby\Public\clients\client1\~dmtmp\EXCEL
|
||||
Move \\afs\locker\clients\client1\filler.001 \\afs\lcolby\Public\clients\client1\~dmtmp\EXCEL
|
||||
Move \\afs\locker\clients\client1\filler.002 \\afs\lcolby\Public\clients\client1\~dmtmp\EXCEL
|
||||
Move \\afs\locker\clients\client1\filler.003 \\afs\lcolby\Public\clients\client1\~dmtmp\EXCEL
|
||||
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\EXCEL\filler.000 \\afs\locker\clients\client1\~dmtmp\COREL
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\EXCEL\filler.001 \\afs\locker\clients\client1\~dmtmp\COREL
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\EXCEL\filler.002 \\afs\locker\clients\client1\~dmtmp\COREL
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\EXCEL\filler.003 \\afs\locker\clients\client1\~dmtmp\COREL
|
||||
|
||||
Move \\afs\locker\clients\client1\~dmtmp\COREL\filler.000 \\afs\lcolby\Public\clients\client1\~dmtmp\ACCESS
|
||||
Move \\afs\locker\clients\client1\~dmtmp\COREL\filler.001 \\afs\lcolby\Public\clients\client1\~dmtmp\ACCESS
|
||||
Move \\afs\locker\clients\client1\~dmtmp\COREL\filler.002 \\afs\lcolby\Public\clients\client1\~dmtmp\ACCESS
|
||||
Move \\afs\locker\clients\client1\~dmtmp\COREL\filler.003 \\afs\lcolby\Public\clients\client1\~dmtmp\ACCESS
|
||||
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\ACCESS\filler.000 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\ACCESS\filler.001 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\ACCESS\filler.002 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
Move \\afs\lcolby\Public\clients\client1\~dmtmp\ACCESS\filler.003 \\afs\locker\clients\client1\~dmtmp\WORDPRO
|
||||
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.000 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.001 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.002 \\afs\locker\clients\client1
|
||||
Move \\afs\locker\clients\client1\~dmtmp\WORDPRO\filler.003 \\afs\locker\clients\client1
|
||||
|
||||
#attach lcolby
|
||||
#setlocker \\afs\lcolby
|
||||
#xcopy c:\clients\client1 \\afs\locker\Public\client1
|
||||
#xrmdir \\afs\locker\Public\client1 all
|
||||
#detach lcolby locker
|
||||
#setlocker
|
||||
Xrmdir \\afs\locker\clients\client1 all
|
||||
Xrmdir \\afs\lcolby\Public\clients\client1 all
|
||||
#detach lcolby locker
|
122857
src/WINNT/tests/torture/clients/StreamFiles.txt
Normal file
122857
src/WINNT/tests/torture/clients/StreamFiles.txt
Normal file
File diff suppressed because it is too large
Load Diff
81
src/WINNT/tests/torture/clients/files.txt
Normal file
81
src/WINNT/tests/torture/clients/files.txt
Normal file
@ -0,0 +1,81 @@
|
||||
ACCESS\INV.PRN
|
||||
ACCESS\LABELS.PRN
|
||||
ACCESS\SALES.PRN
|
||||
COREL\GRAPH1.CDR
|
||||
COREL\GRAPH2.CDR
|
||||
Designs
|
||||
EXCEL\RESULTS1.PRN
|
||||
EXCEL\RESULTS2.PRN
|
||||
EXCEL\RESULTS3.PRN
|
||||
EXCEL\SALES1.PRN
|
||||
P
|
||||
PARADOX\__3F2C4.DB
|
||||
PARADOX\__3F2C4.FAM
|
||||
PARADOX\__40D6B.DB
|
||||
PARADOX\__40D6B.FAM
|
||||
PARADOX\__414F2.DB
|
||||
PARADOX\__414F2.FAM
|
||||
PARADOX\__42B96.DB
|
||||
PARADOX\__42B96.FAM
|
||||
PARADOX\__43212.DB
|
||||
PARADOX\__43212.FAM
|
||||
PARADOX\__43904.DB
|
||||
PARADOX\__43904.FAM
|
||||
PARADOX\__50172.DB
|
||||
PARADOX\__50172.FAM
|
||||
PARADOX\__52E2B.DB
|
||||
PARADOX\__52E2B.FAM
|
||||
PARADOX\__52EF7.DB
|
||||
PARADOX\__52EF7.FAM
|
||||
PARADOX\__QB4.FAM
|
||||
PARADOX\CHANGED.DB
|
||||
PARADOX\CHANGED.FAM
|
||||
PARADOX\COURSES.FAM
|
||||
PARADOX\ERRORCHG.DB
|
||||
PARADOX\ERRORCHG.FAM
|
||||
PM\B
|
||||
PM\BDES1.PRN
|
||||
PM\BE
|
||||
PM\BEN
|
||||
PM\BENC
|
||||
PM\BENCH
|
||||
PM\BENCHD
|
||||
PM\BENCHDE
|
||||
PM\BENCHDES
|
||||
PM\C
|
||||
PM\CS
|
||||
PM\CSN
|
||||
PM\CSN1
|
||||
PM\CSN1_
|
||||
PM\CSN1_2
|
||||
PM\CSN1_2.P
|
||||
PM\CSN1_2.PM
|
||||
PM\E
|
||||
PM\EV
|
||||
PM\EVE
|
||||
PM\EVEN
|
||||
PM\EVENT
|
||||
PM\EVENTS
|
||||
PM\EVENTS.D
|
||||
PM\EVENTS.DO
|
||||
PM\M
|
||||
PM\MO
|
||||
PM\MOV
|
||||
PM\MOVE
|
||||
PM\MOVED
|
||||
PM\MOVED.D
|
||||
PM\MOVED.DO
|
||||
PM\T
|
||||
PM\T1
|
||||
PM\T1.X
|
||||
PM\T1.XL
|
||||
PWRPNT\NEWPCB.PPT
|
||||
PWRPNT\NEWTIPS.PPT
|
||||
WORDPRO\BENCHS1.LWP
|
||||
WORDPRO\BENCHS1.PRN
|
||||
WORDPRO\BENCHS1A.PRN
|
||||
WORDPRO\LWPSAV0.TMP
|
||||
WORDPRO\NEWS1_1A.LWP
|
||||
WORDPRO\NEWS1_1A.PRN
|
||||
WORDPRO\NEWS1_1B.PRN
|
||||
\clients\client1\mixfile
|
122857
src/WINNT/tests/torture/clients/streamfiles.txt
Normal file
122857
src/WINNT/tests/torture/clients/streamfiles.txt
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user