Commit Graph

7518 Commits

Author SHA1 Message Date
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
53c9258cd7

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
Andrew Deason
d159cd955f Move FreeBlock prototype to vlserver_internal.h
FreeBlock is only used in internal vlserver code and should not be
called by anything else; it should not be prototyped in a public
header. Move its prototype to go along with the other vlserver
internal prototypes.

Change-Id: Id66f046c76a9d4c454bbd6fd6e65c75dbeccf68e
Reviewed-on: http://gerrit.openafs.org/2101
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-09 12:34:34 -07:00
Andrew Deason
7912910fd8 Define updateUbikNetworkAddress static
updateUbikNetworkAddress is static, and its prototype says so. The
actual implementation of the function lacks 'static', though. Add it.

Change-Id: Ida8e54cecabfffb2adbeb5f12d233668897893f8
Reviewed-on: http://gerrit.openafs.org/2100
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-09 12:32:57 -07:00
Russ Allbery
6ee6125f71 Fix the trailing #endif comment in tests/tap/basic.h
Change-Id: I3a7dbda8d2792229365df4266ca43cbb4bc815bf
Reviewed-on: http://gerrit.openafs.org/2099
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-09 10:40:29 -07:00
Russ Allbery
74a332e7ee Add okv function to the TAP test library
Add an okv() varient of the ok() function that takes the arguments as
a va_list instead of as a variable argument list.  This makes it easier
to reuse ok() when writing other tests.

Change-Id: Icaeaaf9d6bd9d54bfd886a75961d98367ee0fb9a
Reviewed-on: http://gerrit.openafs.org/2098
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-09 10:39:29 -07:00
Jeffrey Altman
53304359a7 Windows: Detect if AFSCache is memory mapped to a new address
The Windows AFSCache paging file contains pointer addresses
that are only valid if the file is memory mapped at a specific
memory address.  If the file is mapped at a new address, the
pointer values will be invalid and the service will crash with
an invalid memory access.

Check for address consistency and force the cache to be rebuilt
if the consistency is lost.

LICENSE MIT

Change-Id: Ie7fb64659f808f09279445f47c2f1385be0a53f0
Reviewed-on: http://gerrit.openafs.org/2095
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-09 07:36:21 -07:00
Andrew Deason
8d18d4773a Solaris: lookup "" like "."
At least on some versions of solaris, we can get passed an empty
string to afs_lookup, if the root directory is in AFS (e.g. after a
chroot). Interpret this as the same as looking up the "." entry;
otherwise we return ENOENT, implying that the "/" directory does not
exist, even if its subdirectories do.

FIXES 127356

Change-Id: I84283e78fbf33b946afaf3c80ef4a1a679e8fc93
Reviewed-on: http://gerrit.openafs.org/2096
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-08 10:47:11 -07:00
Andrew Deason
b89a9e4fa0 libafs: consistently hold vnode refs
Make all common libafs code call AFS_FAST_HOLD to hold an afs vnode
reference, instead of sometimes calling VN_HOLD(AFSTOV(tvc)) directly.
Make AFS_FAST_HOLD always call osi_vnhold, and have each platform
define osi_vnhold for their platform-specific quirks (as it was doing
before).

This way, if a platform has an osi_vnhold that is special somehow (on
solaris, we bump a VFS refcount if the vnode refcount goes from 0->1),
it will always be called on vnode references.

Change-Id: I7bb2b5ac116c8e86f6c6c0d40f414523870275a3
Reviewed-on: http://gerrit.openafs.org/1987
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-07 11:55:56 -07:00
Andrew Deason
eee8bc9cf9 AIX: make osi_procname a stub
'curproc', 'curthread', or other such conveniences do not exist on
AIX, so the current osi_procname implementation breaks the build.

Determining the current process name on AIX is, while possible,
difficult and error-prone. Since we only need the process name for
informational messages to users, don't bother trying to determine it,
and just return the empty string so we can build.

Change-Id: I452a9786d809c3dee3da519cd3d6ca053f8d7ab8
Reviewed-on: http://gerrit.openafs.org/2094
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-07 11:55:08 -07:00
Andrew Deason
54fbf60cdd Make lib/afs.exp in sys_depinstall
The AIX libafs uses lib/afs.exp to build, and libafs depends on
sys_depinstall. So, make lib/afs.exp in addition to
include/afs/afs.exp in sys_depinstall.

Change-Id: I8788a49cd4a5e7545f0f1f45572cdfb0f014c3db
Reviewed-on: http://gerrit.openafs.org/2093
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-07 11:54:03 -07:00
Andrew Deason
a4bca77376 AIX: declare code in osi_TryEvictVCache
osi_TryEvictVCache was missing 'code's declaration. Declare 'code'.

Change-Id: Ife5b9bfaea4d6a88bcbd82b862e26afcee1c149f
Reviewed-on: http://gerrit.openafs.org/2092
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-07 11:53:28 -07:00
Jeffrey Altman
85997ac89f Windows: remove src/NTMakefile
NTMakefile was moved from src to the top level.
A second copy in src just gets out of sync.

Change-Id: I9474fab56cee46c3acb1758aee62729c1cfadd7b
Reviewed-on: http://gerrit.openafs.org/2088
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-05 16:36:41 -07:00
Jeffrey Altman
24ff8eb0dd Windows: Cleanup .exp .res .manifest and others
Fix the cleanup procedure to work when the tree has not previously
been built.

Delete .exp, .res, and .manifest files from the $(OBJ) tree.

Perform cleanup on all language directories.

Change-Id: I2a24c69293066f012cb869fe67dbacb5ffdc2d43
Reviewed-on: http://gerrit.openafs.org/2087
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-05 16:34:01 -07:00
Jeffrey Altman
380f9a46a3 Windows: Update fs newcell and add VIOCNEWCELL2
The Windows version of "fs newcell" did not accept any parameters
and behaved quite differently from the Unix version.  Instead of
permitting new cell information to be added, the Windows version
simply forced the existing cell information to be reacquired.

This update adds a new pioctl, VIOCNEWCELL2, to support the
implementation of a Unix-style "fs newcell".  The functionality
added here differs from the Unix version in the following ways:

 1. "fs newcell" with no arguments is still accepted
    in order to maintain compatibility with prior Windows
    behavior.

 2. "fs newcell -cell <cell> -dns" instructs the cache manager
    to add the new cell but obtain the vldb server info from
    DNS.

 3. "fs newcell -cell <cell> ... -registry" instructs the cache
    manager to add the new cell and also save the cell configuration
    data in the registry for use the next time the service restarts.

 4. The -vlport and -fsport options are accepted although the
    -fsport value is currently unsupported by the cache manager.

LICENSE MIT

Change-Id: If62cc8e1c6cc8ba2defb4cd72dae8a87b4d915e0
Reviewed-on: http://gerrit.openafs.org/2080
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-05 11:33:21 -07:00
Jeffrey Altman
82e999bf84 Windows: Freelance Import CellServDB
Add a new registry option that permits automatic generation of
Freelance mountpoints for every cell listed in the CellServDB info
(file and registry).  "FreelanceImportCellServDB".  This functionality
is only triggered when the afsd_service is started.   The operation
is performed in the background by the daemon thread after the firewall
configuration is set.

LICENSE MIT

Change-Id: Ic6cc0738f8c185d77f9cf69d4997b8044522e50e
Reviewed-on: http://gerrit.openafs.org/2079
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-05 11:31:08 -07:00
Jeffrey Altman
1faf08ccc7 Windows: engage path mtu discovery for rx
Change-Id: Ice32ca652dfcf1c14577c696eaca074f61a62675
Reviewed-on: http://gerrit.openafs.org/2085
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-05 11:22:50 -07:00
Jeffrey Altman
ab5b2d2274 Windows: enable circular buffer management for rx socket input
LICENSE BSD

Change-Id: Ibbcb6171738b4f6adfb267b5782b53ae7170b0e9
Reviewed-on: http://gerrit.openafs.org/2084
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-05 11:22:35 -07:00
Russ Allbery
7c167febd5 Comprehensive edit of Admin Guide chapter two (first 20%)
Update and revise chapter two (Issues in Cell Configuration and
Administration) of the Administration Guide for current AFS and current
computing concepts.

Remove references to an AFS-provided login utility and discuss local login
configuration for Kerberos more generically.  Further clarify the role of
ssh in ensuring the user has access to files in AFS during remote login.
Improve the inode and namei discussion slightly.  Update the setuid
discussion for the new default of disabling setuid for cells and for the
known security flaws in enabling setuid.  Modernize terminology for DNS
around cell naming and remove the descriptions of TLDs.  We can now assume
our target audience knows this stuff.

Move index terms into the appropriate section for what's being indexed in
a few more cases.

Lots of other, more minor wording changes and updates.

Change-Id: Id8b1ace5afca6b8b7b2082a9a0779a4b91c89dcd
Reviewed-on: http://gerrit.openafs.org/2065
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-04 01:33:50 -07:00
Derrick Brashear
67e8373746 rx mtu discovery constrainment code
this code makes us work in the face of a sub1500 mtu network.
a subsequent commit is needed to make it more effective: attempts
to grow the mtu must be scheduled so we aren't forced to heavily
brute-force on failure to discover the exact mtu immediately;
for performance, we do want to grow to the real mtu.

Change-Id: If876c134efd4b0952035193ef00a6e780f7adc64
Reviewed-on: http://gerrit.openafs.org/2069
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-04 00:46:20 -07:00
Simona Poilinca
8be3eee95e Windows: convert cm_config.c to use strsafe library
Replaced the unsafe string functions with the safe versions
available in microsoft's strsafe library.

Change-Id: Id9e9acf7eaa1b045d91b972b37a411c7a94ed3ac
Change-Id: I377fe4e2e5bac904f5dd28916f1244262e1933c2
Reviewed-on: http://gerrit.openafs.org/1778
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-03 22:22:01 -07:00
Asanka Herath
dbef3c8b0b Windows: Support building a lite-client installer
If LITECLIENT is defined when invoking the WiX based MSI installer
build, we will build a light-weight client installer MSI.  This
minimizes the size of the installer for users who only need client
functionality from OpenAFS.

The light-weight client excludes:

  - Server components
  - Control center components
  - Administration utilities
  - Debug symbols

Lite-client installer can also be built by invoking target wix-lite
from the root NTMakefile.

Change-Id: I544cdb7170d17358eb235f3c476c468dbae62776
Reviewed-on: http://gerrit.openafs.org/2034
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-03 22:09:22 -07:00
Rainer Toebbicke
1e0c6d22d7 "fs checkservers" during cache creation can crash client
Many pioctl calls pass as soon as the afs_resourceinit_flag is set,
which happens relatively early, alas before the cell name is set.
PCheckServers and others need the latter and dereference NULL.

Easiest: set the cell name as soon as it is known and the dynroot initialisation
piggy-backed to it can be done.

Change-Id: I9985f2c4a0afddfed04b85338108b3d6e97b64e6
Reviewed-on: http://gerrit.openafs.org/2072
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-03 20:25:17 -07:00
Russ Allbery
a069b18dfb Document in SalvageLog(5) the per-partition salvager logs
Document that salvager creates separate logs per partition when doing
a full server salvage and then appends them all to SalvageLog when it
completes.

Change-Id: I2ffa8c79ef83b590f90bb014fc318559deae7113
Reviewed-on: http://gerrit.openafs.org/2035
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
2010-06-03 19:58:27 -07:00
Jeffrey Altman
a546f1cd58 Windows: Fix usage of cm_FreeServerList
cm_FreeServerList will set the input variable to NULL if the
contents of the list could in fact be freed.  If they could not
be freed, the individual entries are marked for deletion and will
not be subsequently used.  Do not set the list variable to NULL
after calling cm_FreeServerList otherwise memory can be leaked.

LICENSE MIT

Change-Id: Ia3cacd760d7395a2dd6b063643a8aa86f9e468b9
Reviewed-on: http://gerrit.openafs.org/2078
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-03 15:59:01 -07:00
Jeffrey Altman
64e08dca0b Windows: Reduce number of Nat Ping Connections
Instruct rx library to only perform NAT pings on file server
connections that are actively in use and which are anonymous.

LICENSE MIT

Change-Id: I6b74e8070f2c522ed13e0c06ea7a304cce525ab9
Reviewed-on: http://gerrit.openafs.org/2077
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-06-03 15:58:09 -07:00
Jeffrey Altman
7e9c978b1c Windows: Fix cm_IoctlSkipQueryOptions buffer management
When cm_IoctlSkipQueryOptions advances the input buffer
pointer it must also reduce the available input length.

LICENSE MIT

Change-Id: I4e0d673e3ff5d8621e715d33d73616a22211a8a9
Reviewed-on: http://gerrit.openafs.org/2076
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-03 15:57:58 -07:00
Jeffrey Altman
51d954a75c Windows: do not request KEY_WRITE privilege if not required
When querying the registry cellservdb info the KEY_WRITE privilege
is not required, therefore do not request it.

LICENSE MIT

Change-Id: I050717be3afb5df979897ffbef65987160a65149
Reviewed-on: http://gerrit.openafs.org/2075
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-03 15:57:35 -07:00
Jeffrey Altman
019174fdda Windows: warning removal
cast away size_t larger than afs_uint32 warnings

use variables with the proper signed vs unsigned state in order
to avoid signed vs unsigned comparison warnings

disable deprecated string function warnings

LICENSE MIT

Change-Id: I78a3786a0766979c8d83cc5dbd06f91e70b0ee47
Reviewed-on: http://gerrit.openafs.org/2074
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-03 15:57:18 -07:00
Derrick Brashear
3ff8526490 darwin notify don't recurse on vcache lock
afs_vop_access->afs_VerifyVCache2->afs_GetVCache->afs_FetchStatus->
afs_Analyze->afs_NotifyUser can recurse and try to notify us. Don't
worry about it; we're best-effort.

we lack a lock primitive to see if we own this lock.

Change-Id: Ibc0c8a8164a95f0d268e5f1f42a62c3a28c4ab9d
Reviewed-on: http://gerrit.openafs.org/2081
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-03 12:57:01 -07:00
Andrew Deason
a2f3be5265 up: refuse multicharacter arguments
The 'up' command currently silently accepts and discards extra
characters when specifying arguments. This can produce rather
confusing behavior such as mistyping '-v -1' as '-v-1' resulting in
the '-v' switch being honored, but the '-1' being ignored. The same
thing occurs for specifying '-v1', even though the usage message
implies that you can combine arguments.

So instead, report an error message for any arguments specified that
are longer than 2 characters, since they are never valid.

Change-Id: I64846b53248ea1d06d03b6ac1fdb4317ba04b03b
Reviewed-on: http://gerrit.openafs.org/2073
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-06-03 10:58:11 -07:00
Asanka Herath
d263fb1507 Windows: Fix midl options for generating stub code
MIDL is used to generate server stub code for implementing SMB RPC.
Fix the invocation of MIDL so that MIDL can locate include files and
respect AFSDEV_AUXMIDLFLAGS.

Change-Id: I31e90897c8f0d8db6746dbc94a3fe4de53aab060
Reviewed-on: http://gerrit.openafs.org/2033
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-06-03 10:43:57 -07:00
Derrick Brashear
57d7b5ccf0 rx allow setpeermtu to take a peer
modify setpeermtu to work when a peer is passed in. modify existing
callers. note solaris caches a whole host's pmtu, so use that
on all peers at the host.

Change-Id: Iba05fffd47a7c7b63742d6c539be4fe248336fb7
Reviewed-on: http://gerrit.openafs.org/2068
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-02 10:12:23 -07:00
Derrick Brashear
ca2bce169e rx setpeermtu should handle a host correctly
right now, when no port is passed, we don't correctly tweak
the mtu for all peers on a host. do that here.

Change-Id: Ia07f592bf001415d8a76bd3326f2dc6aa0641809
Reviewed-on: http://gerrit.openafs.org/2067
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-02 10:12:04 -07:00
Derrick Brashear
24b7d39c5f aklog no krb524 kill warnings
if you're disabling krb524, these variables are unused. make them
not be part of such a compile

Change-Id: Ib10e8fc82614b7a821daa7c77540ce246551cb0a
Reviewed-on: http://gerrit.openafs.org/2066
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-02 10:11:41 -07:00
Russ Allbery
af1dbcf0c9 Add warnings for Authentication Server commands
For each command only useful with the Authentication Server, add
warnings that the Authentication Server is obsolete and will be
removed in a future version of OpenAFS.  Encourage people who care
to update uss to work with a modern Kerberos KDC, recommend kinit
and aklog or klog.krb5 over klog, and warn that klog will be of
limited use without an Authentication Server.

Change-Id: Idc78ba548134b83ac1eea0fb81a5bc38a431bb38
Reviewed-on: http://gerrit.openafs.org/2052
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-31 20:40:58 -07:00
Derrick Brashear
f05d22c1b9 prune further list of connections we natping on
if it had tokens before, again, still not worth a nat ping.
nor for the vlserver.

Change-Id: I30281801b604b67b418b8a54a1889c54c8f6e4db
Reviewed-on: http://gerrit.openafs.org/2058
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-31 20:40:25 -07:00
Rod Widdowson
67f1a94234 Rewrite vldb_check -fix
vldb_check -fix was very 'topical' in nature.  It showed signs that
each sucessive corruption had been treated as a one off needing a
specific fix.  This made the code difficult to understand and
incomplete: for instance a single volume on the wrong hash only was
not corrected.  Further there was some rather unfortunately code which
would under certain circumstances stamp the last volume at various
places across the file.

This checkin removes all the old code and replaces it with a
'systematic' fix.  During the last scan across all the volumes, all
four of the hash chains are rebuild from the ground up.  We can then
get rid of the outer 'Mung Until Now Good' iteration and further we
benefit from a linear run time.

Tested by building several different forms of broken-ness in all three
chains and then fixing it.

Now with improved logging and correct non insertion of nonexistant elements
and clean compiled with extra warning.

Change-Id: Id39d806c9c90f67c6967bd99460ba9842a043158
Reviewed-on: http://gerrit.openafs.org/1991
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
2010-05-30 13:11:12 -07:00
Rod Widdowson
16c4b6e6c0 Add bounds checking prior to IOs in vldb_check
vldb_check would just read where it was sent.  This means that if a
hash entry was beyond the end of file the read would fail and halt the
program dead.

This change adds checks for that so we can go limping on.

There is no code to fix this sort of corruption.  I have another
(preexisting) checkin to do that which will happen once I can get a
clean test run.

This checkin also removes a some pointless debugging printfs.

Change-Id: Ib285e113c8db024de41ffaf6c11ceb2979d07041
Reviewed-on: http://gerrit.openafs.org/1990
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
2010-05-30 13:10:57 -07:00
Russ Allbery
20c2acfb2b Reformat chapter two of the OpenAFS Administration Guide
Purely reformatting to make the document more maintainable.  There are
no content changes.

Change-Id: I349c8e86de925cbed6e09be529a22e0a08b227f6
Reviewed-on: http://gerrit.openafs.org/2059
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
2010-05-29 22:26:39 -07:00
Russ Allbery
2e2494d6db Add a sample test program to the new test suite
Add a modified version of src/util/test_ktime to the new test suite
as an example of how to write a test program with the new harness.

Change-Id: Ifbceff1905f9f0dd686c2a2d2edc2f8796e7918f
Reviewed-on: http://gerrit.openafs.org/2063
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-29 21:48:40 -07:00
Russ Allbery
194c3f10d4 Import C TAP Harness 1.2 as a testing harness
Creates a new top-level tests directory that will be used for all
future automated test code eventually.  Import runtests and the
basic TAP library from C TAP Harness 1.2.  Add top-level check and
test targets that build the full source tree and then the new tests
directory, and then runs runtests on the test list.

Change-Id: I896f8ae488cd1dfa8529a10b4b479e45e7c67afe
Reviewed-on: http://gerrit.openafs.org/2062
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-05-29 21:48:19 -07:00