openafs.git
12 years agoAdd missing LIB_roken references
Andrew Deason [Thu, 28 Apr 2011 21:13:20 +0000]
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>

12 years agoavoid downward vcache pressure when entries are free
Derrick Brashear [Fri, 29 Apr 2011 07:59:19 +0000]
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>

12 years agolibafs: Drop xvcache for AllocCBR
Andrew Deason [Tue, 15 Feb 2011 18:04:32 +0000]
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>

12 years agolibafs: Use vcount, not maxvcount to trim vcaches
Andrew Deason [Thu, 28 Apr 2011 16:48:18 +0000]
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>

12 years agoResync test harness with C TAP Harness 1.7
Russ Allbery [Thu, 28 Apr 2011 20:00:43 +0000]
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>

12 years agoFix various build problems with the test suite
Russ Allbery [Thu, 28 Apr 2011 23:10:23 +0000]
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>

12 years agoResync Autoconf macros from rra-c-util 3.3
Russ Allbery [Thu, 28 Apr 2011 19:56:11 +0000]
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>

12 years agoResync src/cf/gssapi.m4 with rra-c-util 3.3 (fixes OpenBSD)
Russ Allbery [Thu, 28 Apr 2011 19:50:35 +0000]
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>

12 years agodoc: Fix 'vos endtrans' copyright
Andrew Deason [Thu, 28 Apr 2011 18:55:09 +0000]
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>

12 years agoviced: Avoid ref leak on origin callback break
Andrew Deason [Wed, 27 Apr 2011 19:23:43 +0000]
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>

12 years agoviced: Transfer host ref in h_FindClient_r
Andrew Deason [Wed, 27 Apr 2011 18:51:23 +0000]
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>

12 years agoIRIX: set vfs pointer when creating new vcaches
Derrick Brashear [Tue, 26 Apr 2011 02:23:40 +0000]
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>

12 years agocmd: Support splitting switches and values with '='
Simon Wilkinson [Wed, 20 Apr 2011 21:26:14 +0000]
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>

12 years agocmd: Tidy up -help output
Simon Wilkinson [Tue, 19 Apr 2011 18:59:13 +0000]
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>

12 years agocmd: Add support for params with optional values
Simon Wilkinson [Tue, 19 Apr 2011 18:37:37 +0000]
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>

12 years agocmd: Add parameter aliasing
Simon Wilkinson [Tue, 19 Apr 2011 11:20:14 +0000]
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>

12 years agocmd: Add accessor functions for options
Simon Wilkinson [Tue, 19 Apr 2011 10:41:54 +0000]
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>

12 years agocmd: Add option to add a param at a specific pos
Simon Wilkinson [Tue, 19 Apr 2011 08:01:25 +0000]
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>

12 years agoAdd -usetokens option to libadmin test 'afscp'
Thomas L. Kula [Sun, 6 Feb 2011 01:11:56 +0000]
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>

12 years agoLinux: Don't read pages beyond the cache eof
Simon Wilkinson [Mon, 25 Apr 2011 18:18:39 +0000]
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>

12 years agoBuild libafscp when we lack kerberos
Andrew Deason [Tue, 26 Apr 2011 19:44:46 +0000]
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>

12 years agoIrix: Add a simple osi_ReadRandom implementation
Simon Wilkinson [Tue, 26 Apr 2011 19:48:32 +0000]
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>

12 years agosrc/afs: Set but unused variables warning fixes
Marc Dionne [Sat, 16 Apr 2011 20:38:45 +0000]
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>

12 years agoFix --without-krb5
Andrew Deason [Tue, 26 Apr 2011 19:32:25 +0000]
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>

12 years agoRewrite asetkey to support extended key types
Simon Wilkinson [Tue, 1 Mar 2011 14:59:55 +0000]
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>

12 years agoafsio: remove unnecessary reference to malloc.h
Chaz Chandler [Tue, 26 Apr 2011 20:49:39 +0000]
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>

12 years agoubik: add uvote_HaveSyncAndVersion
Marc Dionne [Sat, 23 Apr 2011 02:23:21 +0000]
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>

12 years agoubik: Defer updateUbikNetworkAddress until after RX startup
Marc Dionne [Sat, 23 Apr 2011 01:24:34 +0000]
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>

12 years agoubik: locking in recovery.c
Marc Dionne [Sat, 29 Jan 2011 19:37:23 +0000]
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>

12 years agoubik: always hold DB lock for urecovery_ResetState()
Marc Dionne [Sat, 16 Apr 2011 18:19:57 +0000]
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>

12 years agoubik: set UBIK_RECLABELDB before propagating version
Marc Dionne [Sat, 16 Apr 2011 16:56:05 +0000]
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>

12 years agoubik: remote: fix DB lock usage
Marc Dionne [Sat, 16 Apr 2011 15:52:57 +0000]
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>

12 years agomacos: further next version support
Derrick Brashear [Tue, 26 Apr 2011 14:46:41 +0000]
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>

12 years agoRename libcom_err to libafscom_err
Ben Kaduk [Sun, 19 Dec 2010 04:52:43 +0000]
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>

12 years agoLinux: cleanup aio support
Marc Dionne [Fri, 22 Apr 2011 19:23:27 +0000]
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>

12 years agocmd: Split up dispatch function
Simon Wilkinson [Tue, 19 Apr 2011 10:47:08 +0000]
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>

12 years agocmd: Add an option to disable abbreviations
Simon Wilkinson [Mon, 18 Apr 2011 07:31:42 +0000]
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>

12 years agocmd: Add function to disable positional commands
Simon Wilkinson [Mon, 18 Apr 2011 07:25:55 +0000]
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>

12 years agocmd: Add some tests to the test suite
Simon Wilkinson [Sat, 23 Apr 2011 15:42:54 +0000]
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>

12 years agocmd: Make the original test suite build
Simon Wilkinson [Sat, 23 Apr 2011 14:44:53 +0000]
cmd: Make the original test suite build

Make the original, command line driven, test suite build again

Change-Id: I57f0ebb5b1d13acf0809c7fa005e3556e3edb798
Reviewed-on: http://gerrit.openafs.org/4537
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

12 years agopam: Fix password torching const-ness
Andrew Deason [Mon, 25 Apr 2011 18:58:34 +0000]
pam: Fix password torching const-ness

In some code branches, the PAM code "torches" a password by zeroing
it. However, it does this through a const pointer which we otherwise
know is not actually const. Make sure we get better type checking by
doing this through a non-const pointer.

Change-Id: Ibdb4c7b98baf964a8efdf0e8a9882f8ab29e22af
Reviewed-on: http://gerrit.openafs.org/4554
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

12 years agopam: Password is const in setcred
Andrew Deason [Mon, 25 Apr 2011 18:53:52 +0000]
pam: Password is const in setcred

afs_setcred.c gets the "password" pointer from pam_get_data, which
always gives a const pointer (unlike pam_get_item used in afs_auth.c
&c, which sometimes gives a const or not-const pointer, depending on
the PAM implementation).

So, declare password const, to get better type checking.

Change-Id: Ic34ffa54bf0bcc19c8ed3cddc9ee1384ee2dd8f0
Reviewed-on: http://gerrit.openafs.org/4553
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

12 years agoWindows: afskfw return error if krb5 not loaded
Jeffrey Altman [Tue, 26 Apr 2011 01:41:17 +0000]
Windows: afskfw return error if krb5 not loaded

If the Kerberos v5 library cannot be loaded (pkrb5_init_context
equal to NULL) return a reasonable error code instead of
returning success and doing nothing.

Change-Id: I8f77b51089d8c2a147fc9edc575dc92cd254a876
Reviewed-on: http://gerrit.openafs.org/4560
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agoWindows: build afskfw.c without leashw32.dll
Jeffrey Altman [Tue, 26 Apr 2011 01:40:28 +0000]
Windows: build afskfw.c without leashw32.dll

remove our dependency on mit kfw leashw32.dll

Change-Id: Ifd66d77d527de27258b041e128165f234fd79ee6
Reviewed-on: http://gerrit.openafs.org/4559
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agoWindows: avoid preprocessor symbols redefinitions
Jeffrey Altman [Tue, 26 Apr 2011 01:29:46 +0000]
Windows: avoid preprocessor symbols redefinitions

In afskfw.h avoid preprocessor symbol redefinitions when
RD_AP_TIME or INTK_BADPW are already defined.

Change-Id: Iccc02abf1cfd7a7941494085c1c935e89f415801
Reviewed-on: http://gerrit.openafs.org/4558
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agoWindows: NPLogonNotify provide password in all cases
Jeffrey Altman [Tue, 26 Apr 2011 01:24:32 +0000]
Windows: NPLogonNotify provide password in all cases

When calling KFW_AFS_get_cred() from NPLogonNotify()
always provide the user password.  Do not count on a
credential cache existing from a previous call.

Change-Id: Ie94229a5b708ced2c3965f7bb333a67ee4d629d5
Reviewed-on: http://gerrit.openafs.org/4557
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agowindows: improved logging from NPLogonNotify
Jeffrey Altman [Tue, 26 Apr 2011 01:23:34 +0000]
windows: improved logging from NPLogonNotify

Improve the detail and formatting of the windows event log
entries.

Change-Id: I088f6d35afb91e146e8e6030f29dec39301b020b
Reviewed-on: http://gerrit.openafs.org/4556
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

12 years agocmd: Cleanup
Simon Wilkinson [Mon, 18 Apr 2011 07:19:09 +0000]
cmd: Cleanup

Some assorted cleanup on cmd.c - don't cast NULL or malloc, and
wrap some comment lines better.

Change-Id: I43a757ec5a9c9b29a99b5a6490cf5e2f44489c90
Reviewed-on: http://gerrit.openafs.org/4536
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

12 years agopam: Clear up PAM_CONST related warnings on Linux
Marc Dionne [Sat, 16 Apr 2011 15:22:54 +0000]
pam: Clear up PAM_CONST related warnings on Linux

Commit 78d1f8d8 expanded the use of PAM_CONST and introduced many
new warnings on Linux where pam expects "const" arguments.

This clears up the warnings by doing the following:
- Cast "user" to char * when kalling ka* functions
- Change the signature of pam_afs_prompt and pam_afs_printf to use
PAM_CONST
- Use a separate non-const password pointer for pam_afs_prompt

Change-Id: I460e1d1ca763f0aea5edcdaa208b9d4b8299ded0
Reviewed-on: http://gerrit.openafs.org/4487
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

12 years agoLinux: Restrict # of cbrs we allocate at once
Simon Wilkinson [Thu, 21 Apr 2011 15:07:05 +0000]
Linux: Restrict # of cbrs we allocate at once

With commit a309e274632993c5aeec04c6e090f5ac95837a40, we changed the
number of CBRs that we allocate in a chunk from 300 to 1024. However,
this change takes the amount of memory requried to allocate a chunk
of CBRs above PAGE_SIZE on Linux. This changes the allocator that we
use from kmalloc to vmalloc. Whilst we can, and do, prevent kmalloc
from flushing filesystem pages when we invoke it, we don't have a
similar level of control over vmalloc.

In one reported case, clients deadlock whilst attempting to allocate
this memory, in a call stack that looks something like:

  afs_Daemon -> afs_ShakeLooseVCaches -> osi_TryEvictVCache
      -> afs_FlushVCache -> afs_QueueVCB -> afs_AllocCBR
      -> osi_linux_alloc -> ... -> __vmalloc_node -> ...
      -> try_to_free_pages

This is probably because we end up deadlocking in the writeback
invoked by try_to_free_pages, likely due to locks which are held
by ShakeLooseVCaches.

As a quick fix for the problem, make sure that the memory we
allocate always fits within a page, so we always use kmalloc for
it.

FIXES 129751

Change-Id: I8b5be06ed62764b67f99792df66e9cb0f8941fd6
Reviewed-on: http://gerrit.openafs.org/4510
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

12 years agoviced: Release all hosts in h_Enumerate*
Andrew Deason [Sat, 23 Apr 2011 21:52:30 +0000]
viced: Release all hosts in h_Enumerate*

h_Enumerate and h_Enumerate_r were not releasing all of the holds they
obtained when the callback function caused the enumeration to bail
early. Correct them so all host holds are released.

Change-Id: I6f405fad3d2767c9e0b3567c40cbbd1de8ac26aa
Reviewed-on: http://gerrit.openafs.org/4530
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

12 years agoviced: Print a warning when using a deleted client
Andrew Deason [Sat, 23 Apr 2011 21:44:41 +0000]
viced: Print a warning when using a deleted client

We should never get a deleted client back from GetClient. Log a
message if we do, to explain why access may suddenly appear to fail,
and assist in determining why.

Note that we still try to service the request, since the accessing
user may still have enough access to do whatever was requested.

Change-Id: Ie1d0c2d8a33a68a760704bfff9f268c6c507118f
Reviewed-on: http://gerrit.openafs.org/4529
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

12 years agoviced: Force valid host enumeration flags
Andrew Deason [Sat, 23 Apr 2011 21:32:10 +0000]
viced: Force valid host enumeration flags

Make sure that the callback functions for h_Enumerate and
h_Enumerate_r give us back valid flags values by aborting if they
return an invalid value.

Change-Id: Id34b461d5452ac318a1714b6c3ffdaf41015995c
Reviewed-on: http://gerrit.openafs.org/4528
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

12 years agoviced: Fix host enumeration flags
Andrew Deason [Sat, 23 Apr 2011 21:25:00 +0000]
viced: Fix host enumeration flags

Do not give uninitialized flags values to h_Enumerate callback
functions. In fact, do not give a flags value to h_Enumerate or
h_Enumerate_r callback functions at all, since they are not actually
used.

Fix host enumeration callback functions to just return 0 or the
relevant flags, instead of basing the return value off of the given
flags value. Update MultiBreakVolumeCallBack_r to use the correct
return values, since it currently tries to use the old meanings of the
host enumeration return values.

FIXES 129376

Change-Id: Ibb01ce62411602a9f83f437125fb87a7a84160b4
Reviewed-on: http://gerrit.openafs.org/4527
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

12 years agoWindows: remove trailing whitespace
Jeffrey Altman [Mon, 25 Apr 2011 11:58:49 +0000]
Windows: remove trailing whitespace

remove trailing whitespace from

  NTMakefile
  *.h
  *.c
  *.cpp
  *.idl
  *.def
  *.txt
  *.htm

Change-Id: I948a7511a20d0ad522b647b788536f9b6f5dda16
Reviewed-on: http://gerrit.openafs.org/4548
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

12 years agoautoconf: Add required headers to net/if.h test
Simon Wilkinson [Sat, 23 Apr 2011 15:28:49 +0000]
autoconf: Add required headers to net/if.h test

On Darwin, net/if.h is only usable if sys/socket.h is included first.
Do so, to stop autoconf from warning about this test.

Change-Id: I9e7a2642cce86c5ad6ebb3ae3cb60401dd9c26cf
Reviewed-on: http://gerrit.openafs.org/4535
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

12 years agoWindows: Remove duplicate file
Simon Wilkinson [Mon, 25 Apr 2011 12:56:38 +0000]
Windows: Remove duplicate file

The 'Streamfiles.txt' file had been committed with both that name,
and an all lower case name. This makes git very sad on systems with
case insensitive filenames.

Change-Id: I0284415649d7568f9834ccd4d2c6a1627d309fed
Reviewed-on: http://gerrit.openafs.org/4550
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

12 years agoFix build of user-space on nbsd50 and greater
Jonathan A. Kollasch [Thu, 21 Apr 2011 15:20:55 +0000]
Fix build of user-space on nbsd50 and greater

Change-Id: I7b2fef051da7c5ff820e9ecb1fe77b8d8d9e011a
Reviewed-on: http://gerrit.openafs.org/4509
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoAdd nbsd60 param files and autoconf logic
Jonathan A. Kollasch [Thu, 21 Apr 2011 08:24:15 +0000]
Add nbsd60 param files and autoconf logic

Change-Id: I7fa40455315325f75d0fb754fc23620f12fd634a
Reviewed-on: http://gerrit.openafs.org/4512
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoRevert "aklog: Return token when performing 524 conversion"
Andrew Deason [Thu, 21 Apr 2011 21:19:58 +0000]
Revert "aklog: Return token when performing 524 conversion"

This reverts commit 65186d8390a06fb0b7331b2472db07b6fb306446, which
was mistakenly merged to the wrong branch.

Change-Id: I3b2bf874cca15b4248978575213eae21ece2207f
Reviewed-on: http://gerrit.openafs.org/4519
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agolibafs: Initialize _settok_tokenCell primary flag
Andrew Deason [Thu, 21 Apr 2011 22:10:13 +0000]
libafs: Initialize _settok_tokenCell primary flag

Always set the *primary flag to something in _settok_tokenCell.
Otherwise, the lag may be unset, as it is not required to be
initialized by all callers.

Change-Id: I78c775f8cd70f74f6a344094a6a677cbc74f3281
Reviewed-on: http://gerrit.openafs.org/4521
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoWindows: change thyper to offset and fix error
Jeffrey Altman [Tue, 19 Apr 2011 17:17:56 +0000]
Windows: change thyper to offset and fix error

In cm_ReadMountPoint and cm_HandleLink the variable 'thyper'
represets the 'offset' at which cm_GetData should fetch data.
Rename 'thyper' to 'offset' and fix a coding error caused by
misinterpreting the variable purpose.

Change-Id: If60669d850f4bfba2aae6e4aaf642f7ec6f920b2
Reviewed-on: http://gerrit.openafs.org/4501
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoDarwin CM: afs_IsDynrootFid takes a fid ...
Simon Wilkinson [Thu, 21 Apr 2011 17:18:54 +0000]
Darwin CM: afs_IsDynrootFid takes a fid ...

... not a vcache.

Change-Id: Iff1f33f32ec0d208ff80a4c7bcc1ce1b3dccd9a3
Reviewed-on: http://gerrit.openafs.org/4511
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoaklog: Return token when performing 524 conversion
Andrew Deason [Thu, 21 Apr 2011 19:24:45 +0000]
aklog: Return token when performing 524 conversion

We weren't actually returning a token and username from
rxkad_get_converted_token. Do so.

This is a 1.6-specific change. This issue was fixed on master when
aklog was changed to use the new SetTokenEx family of pioctls in
commit 53837416cbed3ba4d11f63015e1f13800519f2ed.

Change-Id: I4c85c03be00c45fdae5657554dcd85b3a6301b23
Reviewed-on: http://gerrit.openafs.org/4513
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoafsio: fix objdir build
Derrick Brashear [Thu, 21 Apr 2011 14:26:42 +0000]
afsio: fix objdir build

use the relative path for afsio.c
use objdir path for generated files

Change-Id: I3b16108eacd949bcb1ddc2224961e87bce9999bb
Reviewed-on: http://gerrit.openafs.org/4508
Reviewed-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Tested-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoUnused variable warning fixes
Marc Dionne [Wed, 20 Apr 2011 02:42:12 +0000]
Unused variable warning fixes

Fix several simple cases of unused variables.

Change-Id: I6e61ea625c6bcef7b0bc70c61909f22d1f8dd9a7
Reviewed-on: http://gerrit.openafs.org/4504
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoAllocate system type ID numbers for i386_nbsd60 and amd64_nbsd60
Jonathan A. Kollasch [Wed, 20 Apr 2011 10:00:34 +0000]
Allocate system type ID numbers for i386_nbsd60 and amd64_nbsd60

Change-Id: I1860fbacb0d41a3d13b73b4248b920e17b731184
Reviewed-on: http://gerrit.openafs.org/4506
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoMake whitespace consistent in NetBSD system type ID number section
Jonathan A. Kollasch [Wed, 20 Apr 2011 09:53:52 +0000]
Make whitespace consistent in NetBSD system type ID number section

Change-Id: If3835225bb85fd7469cd817dc48bc52f841081b7
Reviewed-on: http://gerrit.openafs.org/4505
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoadminutil: parallel build fixes
Marc Dionne [Sun, 17 Apr 2011 18:06:57 +0000]
adminutil: parallel build fixes

Rearrange the Makefile to make it more parallel build proof.
Add some dependencies on the header files, and avoid rules
with 2 targets.

Change-Id: I267f25504137d58dd1a335eccb7c9b138a7c66ab
Reviewed-on: http://gerrit.openafs.org/4497
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoFreeBSD: Don't ignore Makefile
Simon Wilkinson [Sat, 16 Apr 2011 13:50:11 +0000]
FreeBSD: Don't ignore Makefile

The file src/packaging/FreeBSD/Makefile is part of the repository,
and so shouldn't be excluded by .gitignore (the exclusion is inherited
from the top level). So, restore it with .gitignore in this directory.

Change-Id: I841e67aba707fd7193ba0d15a11f969ffd55829c
Reviewed-on: http://gerrit.openafs.org/4495
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agolibafscp: add lock support
Derrick Brashear [Fri, 15 Apr 2011 17:45:57 +0000]
libafscp: add lock support

add support for locking as well as for tracking callbacks so a
lock break can be detected

Change-Id: Iff36c6528fc55cf250bc27d49af80123d7ecece3
Reviewed-on: http://gerrit.openafs.org/4476
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoWindows: avoid race when writing mountPointString
Jeffrey Altman [Tue, 19 Apr 2011 04:12:49 +0000]
Windows: avoid race when writing mountPointString

cm_GetData() drops the cm_scache_t rw lock which permits other
threads to access the data while it is in an inconsistent state.
Avoid the race by using a stack allocated temporary buffer to
receive the data from cm_GetData().  Only copy the data into
the mountPointStringp buffer under the rwlock.

Change-Id: Ica853976b1094be1087e49c22d878f8ae7fca03a
Reviewed-on: http://gerrit.openafs.org/4498
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agomake afsdump_scan get ACLs right
Stephan Wiesand [Sun, 17 Apr 2011 22:37:36 +0000]
make afsdump_scan get ACLs right

This makes afsdump_scan get the ACLs right on little endian systems.
It also corrects and slightly beautifies some output (indentation,
cut&paste error for negative ACL label).

Change-Id: I5a120630158e56fe8b55500ff9db70dded5fe0d9
Reviewed-on: http://gerrit.openafs.org/4494
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoroken header dependencies mean we need roken
Derrick Brashear [Sat, 16 Apr 2011 21:44:28 +0000]
roken header dependencies mean we need roken

and probably more than just these but let's start here.

Change-Id: Id0f174a84ecb8ffd1fbdcade6f139fc78c4b99e2
Reviewed-on: http://gerrit.openafs.org/4492
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoauth: Set correct flags in token_extractRxkad
Andrew Deason [Thu, 14 Apr 2011 19:36:36 +0000]
auth: Set correct flags in token_extractRxkad

The flags that token_extractRxkad returns are flags that are passed to
ktc_SetToken, not the flags that are passed directly to the PSetTokens
pioctl. So, we should be setting AFS_SETTOK_SETPAG, which is
interpreted by ktc_SetToken.

Change-Id: Id63ba4d5874e43c8d1f02817bf33975516a974be
Reviewed-on: http://gerrit.openafs.org/4480
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

13 years agolibafscp: fix kerberos bits
Derrick Brashear [Fri, 15 Apr 2011 17:36:04 +0000]
libafscp: fix kerberos bits

get the correct afs principal. this entire blob will go away
and be replaced by rxgk token getting, but deal for now.

Change-Id: I8e63a5de74efa6c2eeec4c67b4d14d1f69396e41
Reviewed-on: http://gerrit.openafs.org/4475
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agolibafs: Remove afs_write duplication
Simon Wilkinson [Wed, 13 Apr 2011 14:21:46 +0000]
libafs: Remove afs_write duplication

The afs_write() code for memory and disk cache suffered from exactly
the same duplication problems as the afs_read() code.

Apply a similar fix - unify afs_UFSWrite and afs_MemWrite into a single
afs_write function, place the UFS specific code into afs_UFSWriteUIO,
and make use of the existing afs_MemWriteUIO for the memcache case.

Change-Id: I074e1f56597e5cf04d13a45bcda5ad5fedb6377f
Reviewed-on: http://gerrit.openafs.org/4465
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agolibafscp fixes
Derrick Brashear [Fri, 15 Apr 2011 17:34:14 +0000]
libafscp fixes

fix callback package in libafscp to track addresses correctly (use
correct byte order)

Change-Id: I58207492389869591e38e582f332c910cd53f169
Reviewed-on: http://gerrit.openafs.org/4474
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoafsio: rewrite using libafscp
Chaz Chandler [Tue, 20 Jul 2010 14:25:20 +0000]
afsio: rewrite using libafscp

afsio is a utility for file transfer to and from AFS file space
without the help of the AFS client/cache manager.  Using libafscp,
this (partially rewritten) version of afsio is able to accomplish
(1) authenticated access to an AFS path or FID (an existing
KerberosV ticket is required), (2) fall back on unauthenticated
("anonymous") access if authentication (token acquisition) fails,
and (3) work independtly of the AFS cache manager (afsd need not
be running, though CellServDB and ThisCell are currently required).

issues:
1) libvldbint and libafsint are not compiled pthreaded. we link in
what we need. this should be changed when we are all-pthreaded.
2) venus is not a pthreaded-directory otherwise. same deal:
in an all-pthreaded universe, undo the bodge that we do here.
3) venus is not an all-krb5 directory either. slight ick.

Change-Id: I946e6eef58ac77c6fb97be256c4c564188201262
Reviewed-on: http://gerrit.openafs.org/4381
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoRX: Remove allocation counters
Andrew Deason [Thu, 14 Apr 2011 19:11:22 +0000]
RX: Remove allocation counters

Remove the osi_alloccnt and osi_allocsize counters, and the associated
osi_alloc_mutex. These counters are pretty useless since nothing looks
at them, and their use of a mutex requires Rx to be initialized before
XDR can be used. Removing them lifts this restriction.

Change-Id: I22fa1335b6d34675d37cca41a2c393b9c20d3d24
Reviewed-on: http://gerrit.openafs.org/4478
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoSuppress cmp component version error messages
Andrew Deason [Wed, 13 Apr 2011 17:39:19 +0000]
Suppress cmp component version error messages

When we use cmp to determine whether to replace
AFS_component_version_number.c, suppress stderr in addition to stdout,
to slightly reduce output during the build.

Change-Id: I4f687ce5ffff316d8f9806181bccf1c28d218932
Reviewed-on: http://gerrit.openafs.org/4471
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

13 years agoAIX51: Fix PAGs
Andrew Deason [Fri, 15 Apr 2011 16:18:37 +0000]
AIX51: Fix PAGs

On AIX 5.1 and later, we set a process' PAG by using the AIX PAG
mechanism (and not by group ids), but we were determining what PAG a
process was in by the group list. Instead use the PAG identifier.

This effectively reverts 277c37f48c8126ba9cb986ffc7361fcb98e2bbf2, but
it puts the kcred_getpag call in a different place that makes more
sense in the current PAG code organization.

Change-Id: If9fe621060a06664718a00acff91dea66760d5c2
Reviewed-on: http://gerrit.openafs.org/4479
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agotsm41: Reformat function definitions
Andrew Deason [Fri, 15 Apr 2011 17:38:37 +0000]
tsm41: Reformat function definitions

Make function definitions consistent with the formatting in the rest
of the tree.

Change-Id: Ifbccc02739f6fbc111e061397538a903b6f2289a
Reviewed-on: http://gerrit.openafs.org/4477
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agopam: Use PAM_CONST more often
Andrew Deason [Wed, 13 Apr 2011 15:52:50 +0000]
pam: Use PAM_CONST more often

Some callers of pam_get_item et al were just casting their argument to
a const void **. Some PAM implementations (Linux) want a const void**,
but others (Solaris) do not. Use the PAM_CONST symbol already defined
by autoconf to declare or cast the relevant variable const or not as
appropriate.

Change-Id: I81c7863797396eb146b78ffbb2586e4f3a1e854e
Reviewed-on: http://gerrit.openafs.org/4470
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agopam: Check for null upwd from getpwnam_r
Andrew Deason [Wed, 13 Apr 2011 16:10:52 +0000]
pam: Check for null upwd from getpwnam_r

The POSIX getpwnam_r can yield a NULL struct passwd pointer even when
the returned error code is 0 (in particular, when the requested entry
is not found). Just add a check for a null upwd to make sure we don't
dereference a NULL pointer.

Change-Id: I00e8d6c53e8228f468c984010695b798f5dcf999
Reviewed-on: http://gerrit.openafs.org/4469
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agopam: Use POSIX getpwnam_r on Solaris
Andrew Deason [Wed, 13 Apr 2011 16:08:09 +0000]
pam: Use POSIX getpwnam_r on Solaris

_POSIX_PTHREAD_SEMANTICS is now always defined for Solaris, which
means we get a POSIX-conforming getpwnam_r, which takes 5 arguments.
So, add Solaris to the list of platforms that use a POSIX getpwnam_r.

Change-Id: I1ad12420f56cf39816d94a8e9c9740436100134b
Reviewed-on: http://gerrit.openafs.org/4468
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agovfsck: Fix roken fallout
Andrew Deason [Wed, 13 Apr 2011 17:15:12 +0000]
vfsck: Fix roken fallout

Including roken.h in vfsck sources pulls in some more modern headers
that vfsck code isn't used to. Accommodate:

 - Prevent roken.h from pulling in dirent.h so we don't conflict with
   the old-style directory defines for HP-UX. Also move the inclusion
   of the old-style directory defines to before roken.h, so we have
   the directory types defined in roken.h.

 - Remove some prototypes so the don't conflict with the prototypes in
   system headers.

 - Remove a couple of bizarre vprintf invocations, as they conflict
   with the actual vprintf definitions.

Change-Id: Ifd7cd2544e75ed49b93ab491c4acadcb18528315
Reviewed-on: http://gerrit.openafs.org/4472
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agokernel upcall rx env should shut down event daemon
Derrick Brashear [Fri, 15 Apr 2011 12:02:22 +0000]
kernel upcall rx env should shut down event daemon

also shut down event daemon in upcall environment

Change-Id: Ifd40754fc34bc8ea6f844867d1775a8b8b7a5044
Reviewed-on: http://gerrit.openafs.org/4473
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoFix some configure header prereqs
Andrew Deason [Wed, 13 Apr 2011 15:34:37 +0000]
Fix some configure header prereqs

On at least Solaris, the configure tests for netinet/if_ether.h and
security/pam_modules.h issued warnings because they existed but were
not compilable. Perform the tests with the prerequisite headers of
net/if.h and security/pam_appl.h, respectively, so autoconf will stop
yelling at us.

Change-Id: I05d637784954c10af468b6065acd78139fc45245
Reviewed-on: http://gerrit.openafs.org/4467
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoRX: Include sys/file.h for rx_lwp.c
Andrew Deason [Wed, 13 Apr 2011 15:11:59 +0000]
RX: Include sys/file.h for rx_lwp.c

rx_lwp.c uses FNDELAY, which requires sys/file.h on at least Solaris.
So, include it.

Change-Id: Ida652a3c9bfccb120a67f0c5d4f71537a11fa00f
Reviewed-on: http://gerrit.openafs.org/4466
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoasetkey: permit des-cbc-md5 and des-cbc-md4 keys
Jeffrey Altman [Tue, 12 Apr 2011 15:48:27 +0000]
asetkey: permit des-cbc-md5 and des-cbc-md4 keys

A DES key is a DES key.  Permit importing CRC, MD5 and MD4
when using non-MIT keytab support.

Add a special error message that specifies what principal
name, kvno, and enctype were being searched for when the
error is KRB5_KT_NOTFOUND.

Change-Id: I7d3b5fbc41db5e5e91278854ce52842720e6b5d3
Reviewed-on: http://gerrit.openafs.org/4458
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agolibafs: Remove unecessary parameters to afs_read
Simon Wilkinson [Tue, 12 Apr 2011 18:49:38 +0000]
libafs: Remove unecessary parameters to afs_read

We were providing additional buffer and length parameters to
afs_read which are now unused, as the necessary information is
contained within the iovec. Just remove these parameters to tidy the
code up a bit.

Change-Id: I2ca80b20e253e0d54be759e6d504961958b40e6e
Reviewed-on: http://gerrit.openafs.org/4464
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agolibafs: Remove afs_read duplication
Simon Wilkinson [Tue, 12 Apr 2011 18:41:30 +0000]
libafs: Remove afs_read duplication

The disk cache and memcache afs_read functions are effectively
duplicates of each other. Abstract out the common code into a generic
afs_read() function, and put the cache type specific code into
UFSReadUIO (there is already a MemReadUIO which contains the code
necessary for the memcache).

Change-Id: Ic66242fa4695a146ac874a82bd48a7c1f1f412a6
Reviewed-on: http://gerrit.openafs.org/4463
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agofs: Abstract out code to get the last component
Simon Wilkinson [Tue, 12 Apr 2011 18:28:15 +0000]
fs: Abstract out code to get the last component

fs.c contained two identical copies of code to parse a path, resolve
any symbolic links in that path, and return the directory and basename.

Abstract this code out into a single function, rather than maintaining
two separate copies of it.

Change-Id: Id9fc835506f90bae2fc1f0db18c640bf28f0d39d
Reviewed-on: http://gerrit.openafs.org/4462
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

13 years agolibuafs: Add afsd symlink to the clean rules
Simon Wilkinson [Tue, 12 Apr 2011 18:48:02 +0000]
libuafs: Add afsd symlink to the clean rules

The libuafs Makefile creates a link to afsd in the libuafs build
directory. So, have the clean rule tidy it up after us.

Change-Id: I24a3be34bc04dfa7c9db9be2ace4ab32f3f5d5f7
Reviewed-on: http://gerrit.openafs.org/4461
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoviced: Remove logging duplication
Simon Wilkinson [Fri, 8 Apr 2011 15:18:13 +0000]
viced: Remove logging duplication

In lots of places in the fileserver we were doing
    ViceLog(0, (x))
    osi_Panic(x)

Remove this duplication by creating a new macro, ViceLogThenPanic,
which does both of these in one fell swoop.

Change-Id: Icea349d60298eba1cca4a45db790f21ba3e7b3c7
Reviewed-on: http://gerrit.openafs.org/4455
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agofix manpage for udebug -servers
Ken Dreyer [Mon, 11 Apr 2011 21:24:41 +0000]
fix manpage for udebug -servers

The proper option to udebug is "-server", not "-servers". Fix the manpage to line up with the binary.

Change-Id: I3ec83c028dcefb827bd05666401e4a667e29fb6a
Reviewed-on: http://gerrit.openafs.org/4457
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoroken: export tsearch, tdelete, tfind on windows
Jeffrey Altman [Mon, 11 Apr 2011 14:29:28 +0000]
roken: export tsearch, tdelete, tfind on windows

Change-Id: Ic862b65a8c1b37bc3ca3da8db77ba76fe8879296
Reviewed-on: http://gerrit.openafs.org/4456
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoafscp: build for windows
Derrick Brashear [Mon, 4 Apr 2011 17:43:44 +0000]
afscp: build for windows

attempt windows support for afscp

Change-Id: I61cb1349466f24558b320bc40e3fae42ce654810
Reviewed-on: http://gerrit.openafs.org/4424
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoDAFS: Request salvage on detach for volser
Andrew Deason [Fri, 8 Apr 2011 18:00:15 +0000]
DAFS: Request salvage on detach for volser

When the volserver notices that a volume needs salvaging, mark
V_needsSalvaged. So when we VDetachVolume the volume, we can then just
request the salvage in the volume package.

Fix the VolClone salvaging code to do this as well, instead of using
the vol-private VRequestSalvage_r interface.

Change-Id: I9d48e4ea18fe4e3e2e1dc38593db4beb5ad79a84
Reviewed-on: http://gerrit.openafs.org/4452
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>