8823 Commits

Author SHA1 Message Date
Jeffrey Altman
6c825ddd80 Windows: change log for 1.5.9905
Change-Id: If230ae5f0dcb811954130e118fc0ae81dc396111
Reviewed-on: http://gerrit.openafs.org/4627
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-05-05 17:37:48 -07:00
Andrew Deason
1f48bc7a30 libafs: Correct afs_LoopServers flags
AFS_LS_DOWN was actually checking up servers, and AFS_LS_UP was
checking down servers. Fix the handling of the 'adown' flag so we do
the right thing. Also make afs_FlushVCBs use the symbolic name for
adown.

Change-Id: I601faf1bb712a2f76f0bb2447530af38111a71fd
Reviewed-on: http://gerrit.openafs.org/4624
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-05-05 11:02:25 -07:00
Jeffrey Altman
a8e7cf15d1 vol: switch to rk_closesocket
Use roken's rk_closesocket instead of #ifdef AFS_NT40_ENV
conditional tests.

Change-Id: I3602705cea61f07b0e05c633ab57125e43cde506
Reviewed-on: http://gerrit.openafs.org/4623
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-05 08:25:35 -07:00
Jeffrey Altman
cb6cd6484e afscp: use closesocket when closing sockets
close() is not portable to platforms where a socket is
not a file descriptor.

Change-Id: I7077643f45b969f8aa274f4fbb0dfbf375d6542f
Reviewed-on: http://gerrit.openafs.org/4620
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-05 08:22:40 -07:00
Russ Allbery
a9c4772b71 Further fix gssapi.m4 for Heimdal without libroken
The gssapi.m4 fix for Heimdal without libroken was incomplete.  It now
doesn't attempt to link with libroken when probing for GSS-API
symbols.  Thanks, Antoine Verheijen.

Change-Id: Ie994c321f68d7ffba96d2cf31dcf287be8546121
Reviewed-on: http://gerrit.openafs.org/4607
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-05-02 20:53:39 -07:00
Jonathan A. Kollasch
48633351c5 NetBSD: DEBUG can not typically be defined
Like IRIX 6.5, some NetBSD kernel structures change size in the presence
of the DEBUG preprocessor symbol.

Change-Id: I3c5acba7afd22be9b179f628dfa0c1c402c08e2a
Reviewed-on: http://gerrit.openafs.org/4605
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-05-02 19:07:51 -07:00
Jonathan A. Kollasch
350786b3e0 NetBSD: translate timeval structure format in clock_GetTime()
Change-Id: I4fb81a5b809437786064402b3ced0b1659d4476b
Reviewed-on: http://gerrit.openafs.org/4604
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-02 19:07:07 -07:00
Andrew Deason
047cc47303 viced: Improve deleted client log messages
Change the information logged related to deleted clients to be a
little more useful. In particular this includes adding the client and
host refcounts, to help see if the cause is a reference count leak.

Change-Id: Iba156fb32a4838cdbd567ca4e55072337c63ba67
Reviewed-on: http://gerrit.openafs.org/4583
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-02 12:43:37 -07:00
Andrew Deason
b2c6a85073 viced: Do not try to reuse deleted client
When h_FindClient_r encounters a deleted client structure, it does not
try to find a different client structure to use. Force it to use a new
client structure by setting client to NULL when it detects a deleted
client.

This arguably reverts part of
4e55e30f5b2c149b350b6d6875793adf722fdc21, but the code paths in
h_FindClient_r are very different now, so that commit is probably not
too relevant.

Change-Id: I8e5004c8a9a3d99919da8df4436e5aa97e338825
Reviewed-on: http://gerrit.openafs.org/4582
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-05-02 12:43:29 -07:00
Jonathan A. Kollasch
230869eba8 Remove unused variable
Change-Id: Ib91cf666f3b66b9d8aae7bfcab290e6fede61280
Reviewed-on: http://gerrit.openafs.org/4599
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-05-02 12:42:13 -07:00
Jeffrey Altman
66db3f38da Windows: Fix caching of non-existing vols
In cm_UpdateVolumeLocation() the conditional that would
trigger the immediate return of CM_ERROR_NOSUCHVOLUME
was backwards which prevented the caching from working.

cm_CheckOfflineVolumes() is called by the daemon thread
to reset the status of offline volumes.  Non-existing
volumes are by definition offline and cannot be brought
online.  Therefore, the cm_CheckOfflineVolumes() function
should skip volumes with the CM_VOLUMEFLAG_NOEXIST flag
set.

Change-Id: If4093132322e7dd02d71c0f18d6492abbea53e01
Reviewed-on: http://gerrit.openafs.org/4597
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-05-01 20:41:34 -07:00
Andrew Deason
1096c2db63 Add missing LIB_roken references
With the usage of asprintf in libcmd, some more binaries require
libroken to link. Add LIB_roken to their link lines. In src/venus for
the fstrace rule, this causes the HP-UX case to be identical to the
default case, so just remove the HP-UX special case.

Change-Id: Ib4677b17a194cf79742bd5767d3f5cf2442973d3
Reviewed-on: http://gerrit.openafs.org/4590
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-29 22:34:30 -07:00
Derrick Brashear
fd545c51fe avoid downward vcache pressure when entries are free
we try to keep VCACHE_FREE entries free. if there's already that many free,
do nothing.

Change-Id: I7e92430329a17250f94d0435de7641fa331dd461
Reviewed-on: http://gerrit.openafs.org/4595
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-29 08:26:08 -07:00
Andrew Deason
76158df491 libafs: Drop xvcache for AllocCBR
Normally when we AllocCBR, we are holding xvcache write-locked, since
it is called from FlushVCache. Before
a309e274632993c5aeec04c6e090f5ac95837a40, when AllocCBR needs to flush
CBRs due to a lack of space, we hit the net, giving up callbacks on
fileservers.

This can cause a problem if one of those fileservers needs to contact
us in order to complete that request, since the callback service
thread may be waiting for xvcache, causing a deadlock (that is
eventually broken by network timeouts).

To avoid this, drop xvcache if AllocCBR looks like it does not have
sufficient space. Fix all callers of afs_FlushVCache to handle the
case where we sleep, since with this change, afs_FlushVCache can sleep
on all platforms.

This partially reverts a309e274632993c5aeec04c6e090f5ac95837a40, as it
contains an alternative method of avoiding the xvcache lock in this
situation. This commit restores much of the code path to be much more
similar to how it used to be, except that it allows for dropping
xvcache for AllocCBR. This should make any change to our prior
behavior smaller/simpler, and thus safer and more consistent with
existing clients. This reintroduces the hard limit to how much space
we allocate for CBRs, although the part of
a309e274632993c5aeec04c6e090f5ac95837a40 that raised this limit is
retained.

Change-Id: Id4aaa941b3908f59390873e83e23429041c0828f
Reviewed-on: http://gerrit.openafs.org/3958
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-04-28 21:36:03 -07:00
Andrew Deason
2a2206bfe1 libafs: Use vcount, not maxvcount to trim vcaches
Every five minutes we afs_ShakeLooseVCaches to try and return the
number of vcaches in use down to the originally configured -stat level
(when we are using dynamic vcaches). We should calculate how many
vcaches to flush based on the number of currently active vcaches
(afs_vcount), not the peak number (afs_maxvcount). Otherwise, once we
exceed the configured -stat level, we will always keep trying to flush
numerous vcaches, even if we barely have any vcaches in use.

Change-Id: I875fc1d33c817dde2230946b852bb74f8ffd84c2
Reviewed-on: http://gerrit.openafs.org/4584
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-28 20:27:58 -07:00
Russ Allbery
92825d6d65 Resync test harness with C TAP Harness 1.7
Includes the following upstream changes:

Add a more complete usage message to runtests and add support for a -h
command-line flag to display the usage message.

is_double() now takes a third argument, an epsilon.  Two numbers are
considered equal if their absolute difference is less than epsilon.
is_double() also now treats wanted and seen values of NaN (not a
number) as equal.  Thanks to PICCA Frédéric-Emmanuel for the proposed
changes.

The ok_program function in the shell libtap.sh library no longer
strips text after a colon and a space from the program output if the
expected status is non-zero.  Instead, if program output may contain
system-specific error messages after a colon and a space, put the new
function strip_colon_error before the program to do this stripping.
Thanks to Carsten Hey for the idea.

strip_colon_error is now smarter about preserving an initial word
ending in a colon (which is generally the program name) while still
stripping error messages later in the line.

The test_file_path function in the shell libtap.sh library now always
returns the empty string, rather than possible absolute paths starting
at /, if $BUILD and $SOURCE are not set.

Flush standard error in the C TAP library before printing results for
more deterministic output.  Thanks to Carsten Hey for the idea.

All of C TAP Harness now compiles with gcc -ansi -pedantic and should
be fully C89-compatible.  Note that either C99 or SUSv3 is required to
build C TAP Harness.  (This should not be a problem on any modern
platform.)  Based on work by Carsten Hey.

Simplify and improve output formatting in the summary of failing tests
in some edge cases.

Add explicit license statements to the files meant to be copied into
other packages rather than referring to LICENSE.

Add a test_file_path() function to the basic C and shell TAP
libraries, which searches the build and source directories for a
particular file and returns the full path.  This is a utility function
that can be used to find test data files.

Change-Id: I3ef84218f0e3a8b75f550c8b629b058330659b31
Reviewed-on: http://gerrit.openafs.org/4589
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-04-28 20:24:34 -07:00
Russ Allbery
e88e369c92 Fix various build problems with the test suite
The cmd/command-t test requires libroken and was misspelled in the
TESTS file.  Multiple tests require LD_LIBRARY_PATH to be set to find
libafsroken if it hasn't been installed, so set it when running
runtests via make check.  (Note that this means runtests -o will not
work properly unless the user also sets LD_LIBRARY_PATH.)

Change-Id: Ib64f0505b3b75db33adb6c7b6452dcaac0b05dbc
Reviewed-on: http://gerrit.openafs.org/4594
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-04-28 20:24:18 -07:00
Russ Allbery
dc3da06772 Resync Autoconf macros from rra-c-util 3.3
This includes the following fixes:

* Include krb5.h before probing for the IBM-specific header file for
  obtaining error strings to avoid Autoconf warnings on AIX.

* Use [] to mark empty arguments to Autoconf macros.

* Add an explicit license statement to these Autoconf macros, matching
  the normal Autoconf macro license.

* Ensure rra_use_kerberos is always set so that other parts of configure
  can rely on it.

Change-Id: I521d38ad6834808cf09c798aeba0efc0dd741fd6
Reviewed-on: http://gerrit.openafs.org/4588
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-28 16:36:33 -07:00
Russ Allbery
4d6d5dfb60 Resync src/cf/gssapi.m4 with rra-c-util 3.3 (fixes OpenBSD)
Resynchronize src/cf/gssapi.m4 with rra-c-util 3.3.  This includes
the following fixes:

* Handle the Heimdal GSS-API library on OpenBSD, which does not have
  a separate libroken.  Thanks to Antoine Verheijen for the analysis.

* Search /usr/kerberos/bin for krb5-config even if that isn't on the
  user's PATH to find krb5-config on some Red Hat versions.

* Use [] to mark empty arguments to Autoconf macros.

* Add an explicit license (matching the normal Autoconf macro license).

Change-Id: I6934ebcb3bfb0d763713aef159484b08849d4985
Reviewed-on: http://gerrit.openafs.org/4587
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-04-28 16:34:54 -07:00
Andrew Deason
c7212aaaf1 doc: Fix 'vos endtrans' copyright
SNA owns this, not me.

Change-Id: I0ca601504467b825fffeca5a0529a2a529e37383
Reviewed-on: http://gerrit.openafs.org/4586
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-04-28 12:16:28 -07:00
Andrew Deason
af175ce2c7 viced: Avoid ref leak on origin callback break
When breaking a callback, sometimes we send a callback to the host
that performed the callback-inducing operation. When we do this,
currently BreakCallBack gives the origin host structure to
MultiBreakCallBack_r, which avoids releasing that host after the
callback is broken.

However, BreakCallBack obtains a reference to every host to which it
delivers a callback, even if it is the origin host, so a reference is
leaked. Fix this by not ever passing a host to MultiBreakCallBack_r,
and just have MultiBreakCallBack_r release a reference for every host
to which it delivers a callback break.

FIXES 129376

Change-Id: I88503f29f80d4233c062ff448fc4d912e401e8e4
Reviewed-on: http://gerrit.openafs.org/4581
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-28 10:14:32 -07:00
Andrew Deason
9a4e3ade39 viced: Transfer host ref in h_FindClient_r
In h_FindClient_r, we can change which client structure we're dealing
with if we find a different client struct in the Rx conn-specific
data. We adjust the refcounts for the client structures themselves,
but not the associated hosts. While the host structures should be the
same most of the time, we are not guaranteed that, so adjust their
refcounts as well.

Change-Id: I01f447da3dd2dd4306525b99049c4cd7e27f5181
Reviewed-on: http://gerrit.openafs.org/4580
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-28 10:12:57 -07:00
Derrick Brashear
7d72a8c5c4 IRIX: set vfs pointer when creating new vcaches
add missing call to set our vfsp on irix.

Change-Id: Id3b1c3d088e59ed535c20ef7516ce93004e78bff
Reviewed-on: http://gerrit.openafs.org/4561
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-04-27 12:23:05 -07:00
Simon Wilkinson
a2f1ca5fd5 cmd: Support splitting switches and values with '='
Some of our code uses arguments of the form -name=value. Add support
to libcmd for dealing with this type of argument, where name is
declared as CMD_SINGLE (or CMD_SINGLE_OR_FLAG)

Change-Id: Ifb7486abc4f6bf26594936ef11749c4fe29a2e9b
Reviewed-on: http://gerrit.openafs.org/4547
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-27 12:09:37 -07:00
Simon Wilkinson
931a5696cb cmd: Tidy up -help output
Tidy up the output that comes from cmd's -help option by wrapping
at 78 characters, and picking the breaks sensibly. This changes:

Usage: ./vos move -id <volume name or ID> -fromserver <machine name on source> -
frompartition <partition name on source> -toserver <machine name on destination>
 -topartition <partition name on destination> [-live] [-cell <cell name>] [-noau
th] [-localauth] [-verbose] [-encrypt] [-noresolve] [-help]

to...

Usage: ./vos move -id <volume name or ID>
         -fromserver <machine name on source>
         -frompartition <partition name on source>
         -toserver <machine name on destination>
         -topartition <partition name on destination> [-live]
         [-cell <cell name>] [-noauth] [-localauth] [-verbose]
         [-encrypt] [-noresolve] [-help]

Change-Id: I494c287a9370d052763b464df33e69a936edef71
Reviewed-on: http://gerrit.openafs.org/4546
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-27 12:08:53 -07:00
Simon Wilkinson
d0d8b391b0 cmd: Add support for params with optional values
Add the CMD_SINGLE_OR_FLAG option which permits a parameter to
either have a single value, or no value at all. If it has no value,
then it behaves in the same way as the current 'flag' implementation.

Change-Id: I49cf313f1d3b9c369f87b1ff66bfcc038b8aa08a
Reviewed-on: http://gerrit.openafs.org/4545
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-27 12:08:03 -07:00
Simon Wilkinson
f8570d2b64 cmd: Add parameter aliasing
Add support for adding aliases for parameters, in the same way as we
can for syntaxes. This allows multiple different names for a single
option, as well as providing a way around problems with abbreviations.

Aliases may not be abbreviated.

Change-Id: I5c440cf006cd5fd0065ecf1e54213745428063f7
Reviewed-on: http://gerrit.openafs.org/4544
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-27 12:07:45 -07:00
Simon Wilkinson
da68fb9d1c cmd: Add accessor functions for options
Add a load of accessor functions to help with pulling values out
from the the cmd_syndesc structure. The idea here is to make it
simpler to manipulate command line values, as well as starting to
hide the structure of the cmd_syndesc structure from callers, with
a view to eventually making it private to the cmd library.

Change-Id: I38757d776364ceacd43e98fda16e995da35da65c
Reviewed-on: http://gerrit.openafs.org/4543
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-04-27 12:06:26 -07:00
Simon Wilkinson
fae24dabd0 cmd: Add option to add a param at a specific pos
Rather than having to use cmd_Seek, followed by cmd_AddParam,
followed by another cmd_Seek, add a function which permits parameters
to be added at specific reference points. This allows programs to
declare a list (either as an enum or specific #defines) of parameter
code points, rather than using raw numbers.

Change-Id: I25c0d501e678aa2818d296c776d8c5d03b8cdabe
Reviewed-on: http://gerrit.openafs.org/4542
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-27 12:06:00 -07:00
Thomas L. Kula
4aff5a87c2 Add -usetokens option to libadmin test 'afscp'
This adds a -usetokens option to poorly named libadmin test 'afscp' program.
If called with this flag, 'afscp' will assume you have already acquired
tokens, and will fetch and use them. If ran with the -authcell option,
it will look for tokens for that cell, otherwise it will look for tokens
in the local cell. Since the function used to fetch local tokens is
incompatable with the kas functions, all of the kas commands have been
modified to complain and exit if any of them all called with -usetokens.

Fixed whitespace, again.

Change-Id: I4f9bcbae42f6eb179168bb5d152ed36df3db8dd5
Reviewed-on: http://gerrit.openafs.org/3899
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Steve Simmons <scs@umich.edu>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-04-27 11:06:23 -07:00
Simon Wilkinson
79d5b5cce6 Linux: Don't read pages beyond the cache eof
If we attempt to read past the end of the current cache file (for
example, when we're extending the file with ftruncate), don't force
the backend filesystem to populate that page with non-existent data.

This will hopefully fix a bus error when using tmpfs as a backing
cache.

FIXES 128452

Change-Id: I087aa1587885e97493130e5d05db6a1ed961181a
Reviewed-on: http://gerrit.openafs.org/4562
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-04-27 10:39:25 -07:00
Andrew Deason
64c92b2444 Build libafscp when we lack kerberos
Currently, venus fails to build without kerberos, since the
dependencies for afsio always include afscp.h, which does not exist
when we do not build libafscp. To fix this the easy way, and since
libafscp is still very useful without kerberos, allow libafscp to
build without kerberos support (which limits it to anonymous
connections only).

Change-Id: Ief620ca99223f195795dcbe746b47fcbfa2e7450
Reviewed-on: http://gerrit.openafs.org/4577
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-04-27 10:38:18 -07:00
Simon Wilkinson
f314dae7fd Irix: Add a simple osi_ReadRandom implementation
Add an implementation of osi_ReadRandom for Irix, which just panics
(Irix has no source of cryptographically safe entropy in the kernel).
Whilst hcrypto requires an implementation of osi_ReadRandom, nothing
in the current kernel module will cause it to be called, so this
panic should never be reached.

Change-Id: I7aa52f445182f8e660586241304a7379770afcaa
Reviewed-on: http://gerrit.openafs.org/4575
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chaz Chandler <clc31@inbox.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-27 10:33:56 -07:00
Marc Dionne
9d547f2485 src/afs: Set but unused variables warning fixes
Fix a few simple cases of set but unused variables under src/afs.

Change-Id: I78964b7128590d5db1f2c01dd7157c23966c26a0
Reviewed-on: http://gerrit.openafs.org/4491
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-04-27 04:56:19 -07:00
Andrew Deason
9b405a7b08 Fix --without-krb5
Currently, specifying --without-krb5 causes the AM_CONDITIONAL
KRB5_USES_COM_ERR to not be defined, which makes configure refuse to
run successfully. Fix this by forcing KRB5_USES_COM_ERR to always be
false if we are running explicitly without krb5.

Change-Id: I96274847a3dbbb8436ef04f24476606cb15c6618
Reviewed-on: http://gerrit.openafs.org/4576
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-04-27 04:55:53 -07:00
Simon Wilkinson
5562fbd304 Rewrite asetkey to support extended key types
Rewrite the asetkey binary so that it can support managing extended
key files.

Change-Id: Iad53e8cd4c193d8410d5f85d46d72629399b3189
Reviewed-on: http://gerrit.openafs.org/4574
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-27 04:55:01 -07:00
Chaz Chandler
675bd1007d afsio: remove unnecessary reference to malloc.h
Fixes breakage on freebsd for missing malloc.h, reported by GAWollman,
and, since roken.h already includes stdlib.h to pull in malloc, is no
longer necessary

Change-Id: Ie7785198124fe0dee394d7c15f032f0dadb6db8c
Change-Id: I1d5947155ba33de61d8fd23197e11c51e4791935
Reviewed-on: http://gerrit.openafs.org/4578
Reviewed-by: Chaz Chandler <clc31@inbox.com>
Tested-by: Chaz Chandler <clc31@inbox.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-26 19:14:26 -07:00
Marc Dionne
e9ac2cdf01 ubik: add uvote_HaveSyncAndVersion
Add a new function uvote_HaveSyncAndVersion() that combines the
logic from uvote_GetSyncSite and uvote_eq_dbVersion, without
releasing the vote lock in between.  Make use of it in
urecovery_AllBetter.

Change-Id: Ia44337da0f4335bd312cd686904f633ac19f1b63
Reviewed-on: http://gerrit.openafs.org/4526
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-26 17:37:02 -07:00
Marc Dionne
9020e6e2f0 ubik: Defer updateUbikNetworkAddress until after RX startup
The beacon package initialization has been moved to precede starting
RX services, but the broadcast of addresses to other servers should
be deferred until after RX is started.

Make updateUbikNetworkAddress an exported function and call it
from the general initilization sequence.

Change-Id: I903398ed275f460cc8373340eed9dac6a560e1da
Reviewed-on: http://gerrit.openafs.org/4525
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-26 17:36:47 -07:00
Marc Dionne
89cdb34920 ubik: locking in recovery.c
Locking changes in recovery.c:
- In urecovery_Initialize, hold the DB lock over ReplayLog
and InitializeDB
- Hold the DB lock over larger portions of urecovery_interact.
Some values which should be protected were examined and modified
without holding any locks.
- In the early part of urecovery_interact, only take the DB lock
when it's really needed, now that some values are protected by other
locks.
- DoProbe is now called without the DB lock, so it doesn't need to
drop and re-aquire it.

Change-Id: I1899b672687f0ab0eb59c74ff802750cdc377ae6
Reviewed-on: http://gerrit.openafs.org/4524
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-26 17:36:33 -07:00
Marc Dionne
44801d157e ubik: always hold DB lock for urecovery_ResetState()
ubik_ResetState requires callers to hold the DB lock, since it modifies
urecovery_state.  All callers of ubeacon_AmSyncSite outside of the beacon
package hold the DB lock, but calls from the beacon thread do not, and
can't block on getting the DB lock if we're sync site.

Add a beacon internal version of ubeacon_AmSyncSite that skips the
call to ResetState, and have the callers take the DB lock and call
ResetState themselves if needed.  They can take the lock in this case
because we know we're not the sync site.  Refactor the exported
ubeacon_AmSyncSite in terms of this new function.

Change-Id: I88b231010dd52adf6e43a17802e83d12568afc6b
Reviewed-on: http://gerrit.openafs.org/4490
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-26 17:36:18 -07:00
Marc Dionne
b2e6b426e6 ubik: set UBIK_RECLABELDB before propagating version
Quoting Jeffrey Hutzelman:

In udisk_commit(), when committing the first write transaction
after becoming sync site, the database is relabelled.  In this
case, the UBIK_RECLABELDB recovery state bit should be set before
propagating the label change to other servers, rather than after.

This is because ContactQuorum_DISK_Setversion() will
release the database lock, at which point the recovery state may
be cleared by urecovery_ResetState() running in another thread.
It is important that a relabelling which occurs before recovery
state is cleared not result in the UBIK_RECLABELDB recovery state
bit being set after; otherwise, the server may fail to correctly
relabel the database the next time it becomes sync site.

Change-Id: I9753a24c84cf45cdbb11a1d8b7ab262fbe487204
Reviewed-on: http://gerrit.openafs.org/4489
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-26 17:30:38 -07:00
Marc Dionne
a6091cacd8 ubik: remote: fix DB lock usage
Many of the RPC functions in the remote package have a similar
prologue that makes use of ubik_currentTrans before taking the
DB lock.  Take the lock earlier, and rely on the ubik_dbase global
instead of the dbase pointer in ubik_currentTrans.

In GetVersion, take the lock earlier to cover the call to
ubeacon_AmSyncSite.

Change-Id: Ib8480163f2cab2a6ff6a6462cb67fce02f3e8094
Reviewed-on: http://gerrit.openafs.org/4488
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-26 17:30:14 -07:00
Derrick Brashear
a33f77b6e1 macos: further next version support
try to optimize out things which will be missing

Change-Id: Ibee45ae75fa0a5cbdad9eb7a83b12cfaba85b201
Reviewed-on: http://gerrit.openafs.org/4569
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-04-26 10:46:30 -07:00
Ben Kaduk
352c3e366c Rename libcom_err to libafscom_err
We no longer provide a compatible libcom_err, and in fact
we renamed the symbols in our libcom_err several years ago
to reflect this fact.
When we build on a system where KRB5_LIBS includes
-lkrb5 -lcom_err , the new Unix build system will pick up
our libcom_err (as $(AFS_LDFLAGS) is the first argument in
AFS_LDRULE and pulls in a linker search path for our libcom_err)
which does not provide all the needed symbols for libkrb5.

Fully rename our libcom_err away to avoid these conflicts.

FIXES 128640

Change-Id: Ifdd677609f432d42252b1716fc5e8755f3a44640
Reviewed-on: http://gerrit.openafs.org/3547
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-04-26 07:50:11 -07:00
Marc Dionne
a8c46e5010 Linux: cleanup aio support
Code that called directly into the aio operations (ex: readv/writev)
would bypass the AFS specific operations found in afs_linux_read
and afs_linux_write.

Rework the handlers:
- For newer kernels with aio, let the kernel use its default read
and write operations, and define the aio_read and aio_write operations,
with the AFS specific bits, calling into generic_file_aio_read/write.
The kernels default read/write operations are just wrappers around the
aio versions.
- For older kernels, leave things as is, pointing read and write to
afs_linux_read/write

Change-Id: I2a12c6716dc1974683c2582eb9ada5f841067dd9
Reviewed-on: http://gerrit.openafs.org/4563
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-04-26 07:33:11 -07:00
Simon Wilkinson
e1414be76b cmd: Split up dispatch function
Split up the command line parsing behaviour out of the cmd_Dispatch
function, and into a function of its own - cmd_Parse. This lets servers
which only have a single "syntax" installed just parse, without needing
to go through a dispatch function, and all of the control flow
complexity that requires.

Change-Id: Ic4325bf933ee5b28cb80db36ef9b2b5fb6763f41
Reviewed-on: http://gerrit.openafs.org/4541
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-25 21:52:51 -07:00
Simon Wilkinson
898d84cefe cmd: Add an option to disable abbreviations
Add an option to completely disable the matching of abbreviations
when parsing command line options.

Change-Id: Ic3babf584c21f389503c9c69670d400d54a6f4a6
Reviewed-on: http://gerrit.openafs.org/4540
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-25 21:52:10 -07:00
Simon Wilkinson
616a835ad2 cmd: Add function to disable positional commands
Add a new cmd_DisablePositionalCommands function which can be used
to completely disable positional commands, for functions which have
no desire to make use of them.

Change-Id: I5646e9976e544f06902ea6f85043a6330b1ac2fe
Reviewed-on: http://gerrit.openafs.org/4539
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-25 21:51:36 -07:00
Simon Wilkinson
376e24b2ee cmd: Add some tests to the test suite
Add some tests for the command library to the integrated test
suite in tests. These are far from complete, and are mainly there
to ensure that we don't break any of this functionality when modifying
the library.

Change-Id: Ib6fbdca114c005c32c5ba8c41f9e350ca67e1fb8
Reviewed-on: http://gerrit.openafs.org/4538
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-25 21:51:09 -07:00