7358 Commits

Author SHA1 Message Date
Russ Allbery
a62de61855 Build util tests properly with make check
If one runs make check without previously running make at the top
level first, it didn't build the util test programs properly.
Recurse into subdirectories for make check as well, and add the
check, test, and tests targets to tests/util/Makefile.in

Change-Id: Idc2caf4cf83a48da350e724aba2ac1228795085d
Reviewed-on: http://gerrit.openafs.org/2162
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-14 18:06:42 -07:00
Jeffrey Altman
9316f209ed Windows: ensure that afsconfig.h and afs/param.h are included
The recent addition of AFS_NORETURN broke the Windows build
because afsconfig.h and afs/param.h were not included everywhere.
Make sure that they are.

Change-Id: I5962fe1178f73273f5b3c1d269b1a125fba2d2c6
Reviewed-on: http://gerrit.openafs.org/2159
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-14 11:55:00 -07:00
Jeffrey Altman
9579d09533 Windows: fix definition of lstat() macro
The lstat() macro definition has to take into account
the version of the compiler and the size of time_t.

Change-Id: Id7ad8c3956bba9832cc028db628cfabe58a1d8d9
Reviewed-on: http://gerrit.openafs.org/2158
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-14 11:54:23 -07:00
Jeffrey Altman
9b1f0e90bf Windows: define errno_t on compilers older than 1400
Visual Studio older than 1400 (VS8) does not define errno_t.

LICENSE MIT

Change-Id: I27c0892d8ba4a371417f635b0d6e5677fa655422
Reviewed-on: http://gerrit.openafs.org/2157
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-14 11:53:58 -07:00
Andrew Deason
eaeff661c2 ubik: add interface for reading during write locks
Add ubik_BeginTransReadAnyWrite, which allows for reading from the
database, even while there is a conflicting ubik write lock. Reads are
still blocked while the local database is updating due to a write
transaction commit.

Change-Id: I5604fa3cc8a334606f5e3535aed6f6cedcb5f167
Reviewed-on: http://gerrit.openafs.org/2103
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 20:39:14 -07:00
Derrick Brashear
b8177960d4 arm darwin port
make things buildable on arm darwin

Change-Id: I88af2b82e9ed356fd57aa8f05dfee71d7fa6cd8a
Reviewed-on: http://gerrit.openafs.org/2153
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 20:27:48 -07:00
Derrick Brashear
f790747143 ktc newpag stub when environ is not supported
on macos systems where we can't get the environment,
just return from ktc_newpag

Change-Id: I9a169d0bf035c40d727a386bb3d2070eea225ed4
Reviewed-on: http://gerrit.openafs.org/2150
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 20:22:01 -07:00
Derrick Brashear
8af23688c0 darwin afsd include cleanup
remove mach port stuff from non-kernel version (it's for DiskArb)

remove sysconf, iokit, corefoundation, dns_sd from kernel version.

Change-Id: Ibdf9d8a71f5f0fee659d0c05eea4811617c2b34f
Reviewed-on: http://gerrit.openafs.org/2149
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 20:21:49 -07:00
Marc Dionne
cc9d358cd8 Linux: Fix RCU_READ_LOCK test
The names of some configure defines changed with the recent autoconf
cleanups.  This one was missed and was left with the old value.

Change-Id: Ibce5e36b8ae6becdfa61bf6e9c440b3d9a6fa272
Reviewed-on: http://gerrit.openafs.org/2130
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 20:21:34 -07:00
Derrick Brashear
1486563b2b afsd mill dup sys/mount.h include
we include sys/mount.h twice. don't.

Change-Id: Ifc872488086a00d32b564d60a5f9a8b374e8f752
Reviewed-on: http://gerrit.openafs.org/2148
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 20:21:10 -07:00
Derrick Brashear
3514c22d06 generated file target
in order to cross compile, allow a way to generate generated files on the host

Change-Id: I9639f350b179dbeb3d45802e8685da88a3b06c83
Reviewed-on: http://gerrit.openafs.org/2147
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 20:20:49 -07:00
Derrick Brashear
de75d9d8aa buildtools target
if you wish to cross compile, you want these things. arrange to
be able to build just them

Change-Id: I6bee40b61a16722c402832bba39d2e88dcabec25
Reviewed-on: http://gerrit.openafs.org/2145
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 20:18:48 -07:00
Derrick Brashear
d26f5e158c unix cm activate mtu pings
set an error code so idle dead time is enforced on sending. needed
in order that MTU pings be activated.

Change-Id: I8cf1ca81e6519b440fc679e85f327f338400c29a
Reviewed-on: http://gerrit.openafs.org/2116
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 20:16:55 -07:00
Derrick Brashear
c7f9307c35 rx mtu ping handling
engage mtu pings. only occur while a call is active but results are
cached per-peer. requires idle dead time to be in use, or does not
activate. (needed to time out the call, otherwise, keepalives will
succeed and the call will thus not hit regular "down server" timeout)

Change-Id: Ic29b1b5713fb6debde14f4adfd5019ee80cc9e3c
Reviewed-on: http://gerrit.openafs.org/2115
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 20:13:07 -07:00
Derrick Brashear
c62cb89abb path mtu don't track nonsequenced packets
for the purpose of mtu discovery, we need a sequence number to
correlate if a large packet is acked. don't track sequence number
0 packets. a later change adds the mechanics needed for MTU pings

Change-Id: I83d4466115bbd45acdc2777bfbef0ff393dd5a3f
Reviewed-on: http://gerrit.openafs.org/2114
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 20:09:50 -07:00
Derrick Brashear
be035b0824 rx checkcall kill extra indirection on call for conn
we already set a local variable, conn, to call->conn. use it instead
of dereferencing call->conn repeatedly

Change-Id: I5d38edc1d3507a717598140393094b1ba22ced46
Reviewed-on: http://gerrit.openafs.org/2113
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 20:09:24 -07:00
Derrick Brashear
658d2f4728 idle dead time track less
retransmits don't count as sends for idle "send time" purposes.
neither do ping acks. disallow both in computations.

Change-Id: I599bb1111189efd21580d357c31c043f2315f910
Reviewed-on: http://gerrit.openafs.org/2112
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 20:07:47 -07:00
Derrick Brashear
ab45d1adc1 unix cm log path mtu warning when retrying
if RX_MSGSIZE is analyzed and we'd retry, so indicate to our users

Change-Id: I77aba5dffd4280e0ee43383cadb34aca4042cbd6
Reviewed-on: http://gerrit.openafs.org/2117
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 19:49:44 -07:00
Matt Benjamin
f2f3c24b2c mcas fix gc_get_tag return type
The return type from gc_get_tag is char *

LICENSE BSD

Change-Id: If15259858b84f71d969f1e7713371f3de4e0c3a5
Reviewed-on: http://gerrit.openafs.org/2151
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 19:08:23 -07:00
Matt Benjamin
77684b64db mcas cleanup inc/dec macros
fix type of intermediate value used in CAS operations, and reformat slightly.

LICENSE BSD

Change-Id: If49be8e020e0f735d67290440b1a74caccf90bf0
Reviewed-on: http://gerrit.openafs.org/2152
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-13 19:07:53 -07:00
Simon Wilkinson
9baec50e7b libadmin: Don't dereference NULL pointer in cmd
If DoBosHostList ends up being called without the -server argument
in its command structure, then a printf will attempt to dereference
a NULL pointer to the -server field.

Caught by clang-analyzer

Change-Id: I1114406d03b265f4d780efd8e84fea53013cb51c
Reviewed-on: http://gerrit.openafs.org/2143
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:41:29 -07:00
Simon Wilkinson
904c9fbeba fs: Can't use store behind data if pioctl errored
If the call to a pioctl returns an error, it's possible to reach
the end of the storebehind function and try and print an old, or
bogus, value from the pioctl data block.

Caught by clang-analyzer

Change-Id: I1209c0c24730273510fbad98a75a429917836605
Reviewed-on: http://gerrit.openafs.org/2142
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:41:17 -07:00
Simon Wilkinson
6dd07af215 viced: CopyOnWrite2 shouldn't return undefined val
Unless CopyOnWrite2 encounters the condition where
(rdlen != length) || (wrlen !=length) it will never set a value
for the 'rc' return code, and so return with an undefined value.

Looking at the code, it looks like rc should be 0 in all other
situations, so this patch provides a default value.

Caught by clang-analyzer

Change-Id: If3e528f3d66abb3dde6da2304084f7698c05b863
Reviewed-on: http://gerrit.openafs.org/2141
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:40:56 -07:00
Simon Wilkinson
0deaa4d58c Formatting fixes
Reformat the CopyOnWrite2 function to match our current coding style

Change-Id: I9483c2d391932d675c6c76d6edbb2b8f519b2568
Reviewed-on: http://gerrit.openafs.org/2140
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:40:37 -07:00
Simon Wilkinson
e35e0b732d vol: open() needs mode if called with O_CREAT
If open() is called with a the O_CREAT flag, then it requires a
3rd argument, containing the mode with which to create the file.
On DARWIN (when we always use O_CREAT), and on other platforms
where the first call to open returned E_NOENT, we weren't doing this,
and so were presumably getting a random mode of whatever garbage was
on the stack.

Caught by clang-analyzer

Change-Id: Ic173e582e0d46f6d4cf8801dc7a6b4b393db5063
Reviewed-on: http://gerrit.openafs.org/2139
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:40:13 -07:00
Simon Wilkinson
c880fe7740 audit: result is only used on AIX
The 'result' variable is only used on AIX - only bother assigning
it when we're building there.

Caught by clang-analyzer

Change-Id: I06848837282ff3f318474f55f2ee013255ad37c8
Reviewed-on: http://gerrit.openafs.org/2138
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:38:20 -07:00
Russ Allbery
713b65adaa Avoid off-by-one error when saving the password in klog
When klog saved the password entered by the user to allow attempts
at multiple AFS principals without reprompting, it copied the whole
buffer according to the declared reply length into local storage.
This was done without regard to the local allocated storage size,
and was then nul-terminated without regard to the allocated storage
size.  Both klog and Heimdal use a size of BUFSIZ for the reply
buffer by default, which meant that klog on Heimdal was writing past
the end of the allocated structure when nul-terminating the password.

Store our allocated buffer size in the struct and only copy at most
one fewer than that many characters, and then nul-terminate
accordingly.

(The assumption that BUFSIZ is always long enough is still bogus,
but that's larger surgery.)

Change-Id: Ic8d4357aad2f8dfa0fffe9849d2546a88ecd246a
Reviewed-on: http://gerrit.openafs.org/2129
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:37:41 -07:00
Marc Dionne
bc8f2bfb1c Linux s390x: replace AFS_64BIT_KERNEL with AFS_LINUX_64BIT_KERNEL
The s390x param.h file defines AFS_64BIT_KERNEL, but this looks to
be AIX specific, and some Linux headers expect AFS_LINUX_64BIT_KERNEL.
This causes many errors because we end up trying to use struct flock64
instead of struct flock.

Change-Id: I39a4a94fa895143172c1ee75ff71c2015232156f
Reviewed-on: http://gerrit.openafs.org/2131
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:36:55 -07:00
Simon Wilkinson
0efea8e2b1 bucoord: Use mkstemp properly
Use mkstemp wherever we have it available, to silence warnings
about mktemp's safety.

When we do use mkstemp, use it properly. It doesn't return void,
it returns an open filehandle. Convert this filehandle into a FILE *,
rather than throwing it away, and leaking an open file descriptor.

Caught by clang-analyzer

Change-Id: Ib5864f684c6d5a8686e0a872364a645c90a29390
Reviewed-on: http://gerrit.openafs.org/2144
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:36:33 -07:00
Simon Wilkinson
ad3aa5205b comerr: Don't leak CFStringRef
If str is NULL on entry to _intlize, than it will leak the
CFStringRef that it constructed a few lines earlier. Fix this.

Caught with clang-analyzer

Change-Id: I6d62e7792918da95e4fed1c676d14ad9124d93fa
Reviewed-on: http://gerrit.openafs.org/2137
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:35:51 -07:00
Simon Wilkinson
5388e1425d libadmin: Don't use undefined value
If IsValidCellHandle returns false, then we can jump to
fail_pts_GroupMemberRemove, and end up using a value for
ids.idlist_val which hasn't been defined. Fix this.

Caught by clang-analyzer.

Change-Id: I030d155f9ad2481250e84c31d4d7d26cb39a9c61
Reviewed-on: http://gerrit.openafs.org/2136
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:34:31 -07:00
Simon Wilkinson
6c645092ee Add support for clang compiler attributes
Rearrange the way that we define compiler attributes so that we
can define them for clang, too. Don't assume that clang will support
all of the attributes that gcc does, so split them up into separate
sections.

Change-Id: Ic6233f5c63a07b3ef99a85ae3be9e45e28387127
Reviewed-on: http://gerrit.openafs.org/2135
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:34:14 -07:00
Simon Wilkinson
8faceb4ba4 Add AFS_NORETURN macro and use it
Add the AFS_NORETURN macro which can be used with gcc compatible
compilers to indicate that a particular funciton prototype will
not return control to the caller. This both improves code quality,
and helps with static analysis.

Use this to flag afsmon_Exit, db_panic, osi_Panic, Abort, Exit
and the error handlers for osi_Assert and our local assert fn
all as being noreturn.

Change-Id: Ic6c4ae319af3d6f7665c9ee5072b556c01850982
Reviewed-on: http://gerrit.openafs.org/2134
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:33:34 -07:00
Simon Wilkinson
07bd99c9d5 rxgen: Remove inlist from autogenerated code
The 'inlist' variable is only used by code that is #if 0, and never
emitted by the rxgen source. Remove the definition, and assignment,
to this variable.

Caught by clang-analyzer

Change-Id: Ife162d392a47c48e1eebd75fe2c0af9524cd758a
Reviewed-on: http://gerrit.openafs.org/2133
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:33:02 -07:00
Simon Wilkinson
09e17c2452 Changes to build with clang on Mac OS 10.5
clang defines __x86_64__ and doesn't define __i386__ when building
on a 64bit Leopard machine. Change the defines in param.h so we
can build on this platform.

Change-Id: Icfc16ca83162e8148d4261207c05d90d12cbabc2
Reviewed-on: http://gerrit.openafs.org/2132
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 22:32:08 -07:00
Russ Allbery
084a7f1beb Document vos listaddrs -host and -uuid
Document the -host and -uuid flags to vos listaddrs.  They were mentioned
in the SYNOPSIS, but not in the OPTIONS section of the manual page.

Change-Id: I96e6b67b7239d9455060fd0c76b8d44f41a010a2
Reviewed-on: http://gerrit.openafs.org/2083
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
2010-06-12 18:03:42 -07:00
Simon Wilkinson
2af0cca23b Linux: Fix set_cr_group_info and cr_group_info
Commit dc85abca renamed set_cr_group_info to afs_set_cr_group_info
and cr_group_info to afs_cr_group_info, but didn't catch all call
sites. In particular, those in the NFS translator, in non-keyring
code paths, and in the 2.4 code, were missed.

Thanks to Adam Megacz for the bug report on openafs-info.

Change-Id: I71f8cc27d499c98d164d05e02f7d5b2c5d4c1933
Reviewed-on: http://gerrit.openafs.org/2127
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 17:19:26 -07:00
Andrew Deason
dcd3e1fa11 Do not set inUse for non-fileserver non-DAFS
Setting inUse in a volume header to anything besides 1 is a
DAFS-specific change. For non-DAFS, non-fileserver programs do not
touch inUse. Since inUse is not cleared for non-fileserver non-DAFS,
make sure not to set it for non-fileserver non-DAFS.

Change-Id: I4d50299d4dc4fd8757906ba493d182b386dd9b1b
Reviewed-on: http://gerrit.openafs.org/2122
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-12 12:16:39 -07:00
Andrew Deason
df18c9e895 vlclient: work with non-space whitespace
Make vlclient work with non-space whitespace separating arguments.
This also makes it cope with a trailing newline that fgets() gives us,
making this more intuitive to use.

Change-Id: Ida4da9f997ac073a5afa6c95e1b3cec180c18e1a
Reviewed-on: http://gerrit.openafs.org/2126
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-06-11 19:10:08 -07:00
Derrick Brashear
6bc2b1af64 dafs state analyzer shouldn't require trailing spaces in commands
the tokenizer didn't null out \n, but the strcmps for commands didn't deal,
so this basically works badly interactively. all commands not recognized.

Change-Id: Ifa7f8c0204a83d27f8876af8de94cb338499cdc0
Reviewed-on: http://gerrit.openafs.org/2125
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-11 12:16:20 -07:00
Andrew Deason
f4fb6cd4bf Remove afsio warnings and errors
Fix a few warnings and errors in afsio, so it can compile:

 - inlcude rx/rx_prototypes.h, not rx_prototypes.h

 - only declare 'code' in SRXAFSCB_TellMeAboutYourself, and the global
   rx_mtu in AFS_NT40_ENV, since they're only used on NT40

 - remove declarations of the unused variables 'host' in
   HandleLocalAuth, 'i' in readFile, and 'i' in writeFile

Change-Id: If39420cca791669200ccb4d3f46aa5ac7eb89c7d
Reviewed-on: http://gerrit.openafs.org/2121
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-11 12:10:08 -07:00
Matt Benjamin
48d3fd9eed windows cm_BeginDirOp add flags (nobuildtree)
Add a flags argument to cm_BeginDirOp, and define a flag
CM_DIROP_FLAG_NOBUILDTREE which asserts that the operation
being synchronized does not require scp->dirPlus to be
constructed.

Change-Id: Ibc4345574da3c1e7717c83b64a83260f70a3b06c
Reviewed-on: http://gerrit.openafs.org/2053
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-11 09:05:18 -07:00
Simon Wilkinson
60e5d85fd0 RX: Can't assert a void result
We can't assert(MUTEX_DESTROY(blah) == 0) when the MUTEX_DESTROY
macro already returns void (and asserts), as it does in the
pthread case. This fixes the build failure introduced by
53c9258cd7300c03be3f3e50003cad3dfc59baf3

Change-Id: I0b7a30e785de3437f0c1e264b4a63c87f63b6783
Reviewed-on: http://gerrit.openafs.org/2120
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-11 04:59:21 -07:00
Matt Benjamin
53c9258cd7 rx service specific data
Adds rx_GetServiceSpecific and rx_SetServiceSpecific to the rx_service interface,
conforming to the equivalent calls in the rx_connection interface.
For consistency, the implementation strategy is the same.  The intended
use is to more cleanly support server multiplexing within an RPC-based
test dispatch library.

Change-Id: I6a8968484efe2c858857008321996e67328bb75c
Reviewed-on: http://gerrit.openafs.org/2097
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-10 15:13:46 -07:00
Andrew Deason
157a274b8b Break origin's callback for RXAFS_Rename target
When we RXAFS_Rename something, the status of the renamed FID can
sometimes change, and thus we break callbacks on it. Currently, however,
we do not break the callback for the originating client, even though the
status of the target changes and we do not return an AFSFetchStatus to
the caller.

Since the callback is not always broken for the target, it may not be
immediately obvious to client implementations to implicitly break the
target's callback. Since we do not have an explicit protocol
specification saying that the callback is implicitly broken, break the
callback for the origin client as well, to be safe.

Change-Id: I97d90518a240f852013d1d63fccef663c8b0e998
Reviewed-on: http://gerrit.openafs.org/709
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-10 12:14:28 -07:00
Andrew Deason
92d67bee7a Avoid unnecessarily updating .. in SAFSS_Rename
Currently the .. entry for a directory is always recreated on a Rename
operation, even if the parent directory does not change. Now, avoid
altering the directory at all (including no COW nor DV bump nor vnode
modify time update) when we don't need to.

Change-Id: I53478ec05e2fc6362836043476ff67e2c41b7feb
Reviewed-on: http://gerrit.openafs.org/436
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-10 12:13:42 -07:00
Jeffrey Altman
b9ef2051c5 Windows: Revise SMB QuerySecurityInfo for MS10-020
MS10-020 (http://support.microsoft.com/kb/980232) has caused
many problems for implementors of SMB 1.0 servers and applications
that call GetFileSecurity() without checking the return code to
determine if the call succeeded.  The gist of the vulnerability
was that the SMB redirector would pass any buffer it received
to the application regardless of whether or not it was valid.
MS10-020 protects the applications by strictly validating the
SMB response data structure and the data in the security descriptor
that is returned.

The problem for SMB 1.0 server implementors is that there have
been at least three different protocol descriptions for
NT_TRANSACT_QUERY_SECURITY_DESC published over the last decade
and all of them are incomplete.  Therefore, just about no one but
Microsoft has an SMB 1.0 server implementation that produces the
exact out that they are expecting to validate.

The end result is that in an attempt to protect applications from
crashing due to invalid input being passed in directly caused
dozens of applications to crash by not returning any security
descriptor data at all.  Even when the applications didn't crash
they might not have been able to save their data.  Cisco WAAS
and NetApp DataOnTap systems were most adversely affected and
they have had CIFS protocol licenses for many many years.

To fix OpenAFS here is what needed to be done:

1. Instead of returning a security descriptor that gives ownership
   to the NUL SID, give it to the Everyone SID and set the flag
   that states that everyone has full access.

2. Validate the input parameters.  In particular, check to ensure
   that the SMB file descriptor is valid and the file has not
   been deleted.

3. Enforce the maximum output data and parameter counts.

4. Handle buffer overflow and buffertoosmall conditions
   in the manner that Microsoft expects them to be handled.
   In particular, note that the parameter data which is returned
   in the SMB Data Region is not counted in the Data Count.
   Even if MaxData is 0, we can still return parameters values
   as long as MaxParm is large enough.

LICENSE MIT

Change-Id: I95034bc6f24a282decc507edcffb93bc58b986be
Reviewed-on: http://gerrit.openafs.org/2110
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-10 09:51:48 -07:00
Derrick Brashear
368ba0478c further constrict nat pings
one more constrainment of nat pings on unix

Change-Id: I8b3db989b0e16a79cd63795147145c5e0ab55e6e
Reviewed-on: http://gerrit.openafs.org/2091
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-10 08:30:41 -07:00
Russ Allbery
52ffc6a152 Add additional documentation for the new test suite
Add a copy of docs/writing-tests from C TAP Harness as HOWTO and add
a README with some additional explanations more specific to OpenAFS.

Change-Id: Ic5b04805db6b00bcb82862ad8d2ebe466f2c266b
Reviewed-on: http://gerrit.openafs.org/2109
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
2010-06-09 23:18:09 -07:00
Andrew Deason
00c37e8634 Install pthreaded ptserver and vlserver
When --enable-pthreaded-ubik is specified, install the pthreaded
versions of ptserver and vlserver instead of the non-pthreaded
versions. Previously, the pthreaded versions were getting built but
not installed with 'make dest' or 'make install'.

Change-Id: If2f08342df4c94c1cce3001614d9e050222bf0f6
Reviewed-on: http://gerrit.openafs.org/2102
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-09 12:35:13 -07:00