openafs.git
13 years agotests: Fix KeyFile test so it works from harness
Simon Wilkinson [Sun, 13 Mar 2011 15:47:36 +0000]
tests: Fix KeyFile test so it works from harness

The auth/keys test tries to find a file that's distributed as part
of the test suite. However, it currently only looks in the CWD to
find it. Modify the test so that if it's run from the test harness,
it will use the harnesses SOURCE environment variable to locate the
KeyFile

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

13 years agotests: Fix the authcon test to avoid pthread errors
Simon Wilkinson [Sun, 13 Mar 2011 15:45:37 +0000]
tests: Fix the authcon test to avoid pthread errors

Fix the authcon test so that it avoids pthread errors by
initialising rx before calling into any of the rxkad routines.

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

13 years agopt_util: Initialise empty database correctly
Simon Wilkinson [Sun, 13 Mar 2011 14:45:04 +0000]
pt_util: Initialise empty database correctly

Commit dc8f18d6f5003712bc9ef989363137a84953df07 broke pt_util's
initialisation of empty databases. This is because Initdb was changed
to call Initdb_check through the ubik_CheckCache wrapper. However, that
wrapper was defined as a no-op in pt_util's ubik-shim.

Modify pt_util's ubik_CheckCache so that it always calls into the
wrapper routine - this mimics the old behaviour.

Add a trival test for pt_util - check that we can build the database,
using the example from the manpage, and then that the built database
matches what we expect.

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

13 years agoDOC: pt_util now outputs ntohl'd epoch and version
Simon Wilkinson [Sun, 13 Mar 2011 12:56:57 +0000]
DOC: pt_util now outputs ntohl'd epoch and version

Commit 87e959e87df52e026ffcb2de8ecfcbf4889f7bd8 fixed pt_util so
that the epoch and version is correctly byte-swapped on little
endian systems.

Remove the warning about this from the manpage as it is no longer
relevant.

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

13 years agocrypto: Add krb5_crypto_fx_cf2 to our prototypes
Simon Wilkinson [Mon, 7 Mar 2011 17:23:51 +0000]
crypto: Add krb5_crypto_fx_cf2 to our prototypes

Admit to having the krb5_crypto_fx_cf2 function in the kernel RFC3961
implementation - we're going to use it for for key combining

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

13 years agoubik: Allow servers to have more than 3 seclayers
Simon Wilkinson [Fri, 4 Mar 2011 22:57:15 +0000]
ubik: Allow servers to have more than 3 seclayers

ubik has traditionally used the afsconf_ServerAuth function to
fill in a single field in a pre-allocated list of security classes.
This meant that we could never have a class with an index higher
than 2 (rxkad). Setting the function to call, and the rock to that
function was also accomplished by playing with global variables.

Rework this so that a new function is used to set the security
classes, which can allocate an arbitrary sized array of classes.
Move the setting of this function, and of the authentication check
function into ubik_SetServerSecurityProcs()

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

13 years agoafsconf: Rework security flags
Simon Wilkinson [Fri, 4 Mar 2011 22:37:10 +0000]
afsconf: Rework security flags

BuildServerSecurityObjects takes a set of flags, which makes it
hard to use it as a callback function. Rework this so that the
security flags are part of the afsconf directory structure, and
so BuildServerSecurityObjects only takes a rock, and its return
parameters.

Update all of the callers for this new function, and add tests
for it to the test suite.

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

13 years agoubik: Remove dependency on auth
Simon Wilkinson [Fri, 4 Mar 2011 12:12:24 +0000]
ubik: Remove dependency on auth

When commit 8a09c220f4c5f881ea45be585b07b793038924d5 added support
for token error recovery to ubik, it introduced a dependency on
afsconf. This breaks the abstraction layer that had been in place, by
requiring that the SecurityRock be an afsconf_dir (if you use a
different rock, ubik will segfault)

This change reinstates the abstraction layer, by requiring Ubik
users who want token error checking to specify a procedure that can
be used to check whether tokens are up to date. Instead of yet
another global variable, we replace the existing CRXSecurity*
variables with a single function that can be used to set security proc,
token checking proc, and rock.

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

13 years agosolaris: fix typo in the solaris 11 startup script
Chas Williams (CONTRACTOR) [Fri, 11 Mar 2011 18:33:50 +0000]
solaris: fix typo in the solaris 11 startup script

/etc/devlink.tab not /dev/devlink.tab

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

13 years agosalvager: Do not abort on large volume IDs
Andrew Deason [Thu, 10 Mar 2011 20:55:50 +0000]
salvager: Do not abort on large volume IDs

The salvager was parsing volume IDs just using atoi() and checking if
the result was negative. Since the result is a signed int, this fails
on any volume ID larger than 2^31-1. Change the parser to use strtoul
instead of atoi, and change the check.

While we're here, make a similar change to the DAFS salvageserver,
too.

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

13 years agoDon't use KERN_OPTMZ or KERN_DBG on Linux 2.6
Simon Wilkinson [Sun, 6 Mar 2011 17:22:14 +0000]
Don't use KERN_OPTMZ or KERN_DBG on Linux 2.6

With 2.6 Linux kernels, we just use the standard Kernel build system.
As this system pays no attention to our settings of KERN_OPTMZ or
KERN_DBG, don't bother setting values for these for 2.6 kernels.

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

13 years agoRemove -D_LARGEFILE64_SOURCE on Linux
Simon Wilkinson [Sun, 6 Mar 2011 17:15:05 +0000]
Remove -D_LARGEFILE64_SOURCE on Linux

Since 129b6954a6f491c6f3c3e417055bdc68d4726408, we've defined
GNU_SOURCE on all Linux builds. This definition automatically sets
_LARGEFILE64_SOURCE for us, so we don't need to explicitly set it
in the platform specific configuration.

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

13 years agoRemove redundant entries from MT_CFLAGS
Simon Wilkinson [Thu, 10 Mar 2011 00:20:26 +0000]
Remove redundant entries from MT_CFLAGS

Don't include XCFLAGS in MT_CFLAGS, as this is now done elsewhere in
the build process. Don't multiply specify -DAFS_PTHREAD_ENV, as all
pthreaded build rules must defined this, and just doing so in one
place is much cleaner.

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

13 years agohcrypto: don't redefine key_type
Simon Wilkinson [Thu, 10 Mar 2011 10:41:57 +0000]
hcrypto: don't redefine key_type

Linux's keyring code uses "struct key_type", which is also used
internally by the hcrypto code. As, on some Linux variants,
afs/sysincludes.h ends up including the keyring definitions, we
need to rename our internal key_type definition to something
that doesn't clash.

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

13 years agoRevert "hcrypto: avoid key_type redefinition"
Simon Wilkinson [Thu, 10 Mar 2011 09:43:35 +0000]
Revert "hcrypto: avoid key_type redefinition"

This reverts commit 81487fcf3ae93d2efea6f0935a0493680b5d3d11.

This change didn't receive sufficient review before it was pushed.
It breaks builds on IRIX, and produces kernel modules that don't
load on a number of other Linux-based systems.

A correct fix for the underlying problem (that both Linux and
hcrypto want to use the "struct key_type" identifier) will follow
this patch.

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

13 years agolinux: defer vcache evictions when sleep would be needed
Derrick Brashear [Thu, 17 Feb 2011 05:04:06 +0000]
linux: defer vcache evictions when sleep would be needed

because we're only willing to loop 100 times worth of "sleeps",
on a machine with heavy vcache demands we can end up just growing
the list huge. in the first pass, just clean up as many entries which
do not require sleeping as needed. if we need more entries, make
a second pass.

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

13 years agoWindows: handle rx busy call channel
Jeffrey Altman [Wed, 9 Mar 2011 12:51:02 +0000]
Windows: handle rx busy call channel

Register an error code for rx busy call channel detection.
Force a retry whenever CM_RX_BUSY_CALL_CHANNEL is received
by cm_Analyze().  Log the event to both the internal trace
log and the Windows Event Log along with the server address.

Change-Id: I196fb99d38bb89f57f296fd1b60d2a7f17fec80c
Reviewed-on: http://gerrit.openafs.org/4183
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoRX: Avoid timing out non-kernel busy channels
Andrew Deason [Mon, 7 Mar 2011 17:08:26 +0000]
RX: Avoid timing out non-kernel busy channels

When we encounter a "busy" call channel (indicated by receiving
RX_PACKET_TYPE_BUSY packets), we can error out a call with
RX_CALL_TIMEOUT to try and get the application code to retry the call.
However, many RX applications are not aware of this, and will just
fail with an error upon receiving a single busy packet.

So instead, make this behavior optional, and only do it if the
application tells us what specific error it expects to receive when a
busy call channel is detected. Enable this behavior for the Unix cache
manager, as it can cope with receiving an RX_CALL_TIMEOUT error in
this scenario.

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

13 years agoaklog: Do not include XCFLAGS twice
Andrew Deason [Wed, 16 Feb 2011 03:23:06 +0000]
aklog: Do not include XCFLAGS twice

In aklog, we set MODULE_CFLAGS to XCFLAGS and some other things.
However, when using AFS_LDRULE or AFS_CCRULE, CFLAGS will contain
MT_CFLAGS, which contains XCFLAGS. The end result is that the contents
of XCFLAGS appear twice in the compilation invocation, breaking some
platforms like HP-UX where the order of XCFLAGS relative to other
things is a bit fragile.

Fix this by removing XCFLAGS from the MODULE_CFLAGS definition.

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

13 years agovol: FILE* to FD_t except logging and special ops
Jeffrey Altman [Sat, 5 Mar 2011 19:34:05 +0000]
vol: FILE* to FD_t except logging and special ops

Replace all use of FILE* with FD_t.  Switch from afs_open to OS_OPEN.
In the process:

 afs_flush and afs_fsync -> OS_SYNC
 afs_stat which is used to obtain the file size -> OS_SIZE
 afs_close or close -> OS_CLOSE

Etc.   While cleaning up, use afs_stat_st macro when declaring
a struct stat because the structure and function are not guaranteed
to be the same name on all platforms.

These changes permit Windows to build the vol package without
the use of the C runtime library.

Change-Id: I9e0a7fdbeffa76c3c87aefce87ca1af495657a2f
Reviewed-on: http://gerrit.openafs.org/4149
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agovol: consolide afs_xxxx macros in ihandle.h
Jeffrey Altman [Sat, 5 Mar 2011 19:25:34 +0000]
vol: consolide afs_xxxx macros in ihandle.h

Various definitions of afs_open, afs_stat, etc. were
scattered across the .c sources within the vol package.
Consolidate them all in ihandle.h which is included in
all of the files and contains the OS_xxxx macros which
will substitute for many afs_xxxx calls in future patchsets.

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

13 years agoClarify the role of XCFLAGS and simplify MT_CFLAGS
Simon Wilkinson [Fri, 11 Feb 2011 11:53:26 +0000]
Clarify the role of XCFLAGS and simplify MT_CFLAGS

Tidy up the build system by making it clear that XCFLAGS is included
for every build type. Also clean up MT_CFLAGS so that it doesn't
statically include XCFLAGS, and remove the common AFS_PTHREAD_ENV
define that's needed by every architecture.

This fixes the problem that we had where directories built with the
pthread or shared build rules weren't being compiled with checking
enabled, as well as hopefully making the tangle of defines easier to
understand.

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

13 years agolibadmin: minor warning fix
Marc Dionne [Mon, 7 Mar 2011 20:31:53 +0000]
libadmin: minor warning fix

have_quota is set but never used.  Remove it.

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

13 years agohcrypto: avoid key_type redefinition
Derrick Brashear [Tue, 8 Mar 2011 02:32:53 +0000]
hcrypto: avoid key_type redefinition

struct key_type is redefined in crypto.h; originally defined in
./linux/security.h from ../afs/sysincludes.h from hcrypto/kernel/config.h

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

13 years agovol: remove warning on use of DFlushVolume
Jeffrey Altman [Sat, 5 Mar 2011 19:29:38 +0000]
vol: remove warning on use of DFlushVolume

Include the afs/dir.h header on Windows to avoid
warnings caused by the missing prototype.

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

13 years agocrypto: Avoid variadic macros
Simon Wilkinson [Sun, 6 Mar 2011 18:18:07 +0000]
crypto: Avoid variadic macros

The IRIX compiler doesn't seem to like variadic macros, so avoid
using them within the RFC3961 kernel crypto implementation

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

13 years agoubik: cleanup DB lock usage in SDISK_SendFile
Marc Dionne [Sat, 29 Jan 2011 17:48:02 +0000]
ubik: cleanup DB lock usage in SDISK_SendFile

Some failure paths can return from SDISK_SendFile with the
database lock still held.  Other failure paths will cause
setlabel to be called without holding the lock.

Rework the failure paths so we always release the DB lock before
returning, and always hold it when calling setlabel.

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

13 years agoubik: refactor pthread creation code
Marc Dionne [Sat, 5 Mar 2011 16:40:41 +0000]
ubik: refactor pthread creation code

Refactor thread creation into a new ubik_thread_create function.
Eliminates some code duplication.

No functional changes.

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

13 years agoubik: remove unused code
Marc Dionne [Sat, 5 Mar 2011 16:19:10 +0000]
ubik: remove unused code

Remove some unused code and associated comment.  rx_Init does
belong earlier in the sequence.

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

13 years agoubik: Rearrange some initialization code
Marc Dionne [Thu, 20 Jan 2011 02:57:58 +0000]
ubik: Rearrange some initialization code

Some basic initialization should precede creating the RX
services.

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

13 years agoubik: make uphys_close static
Marc Dionne [Sat, 29 Jan 2011 16:14:50 +0000]
ubik: make uphys_close static

This function is not used outside of phys.c, so make it private.

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

13 years agoubik: remove successive Quorum_EndIO, Quorum_StartIO calls
Marc Dionne [Sat, 5 Mar 2011 15:27:36 +0000]
ubik: remove successive Quorum_EndIO, Quorum_StartIO calls

Refactoring brought these 2 calls together.
They can be optimized away.

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

13 years agoFix positional I/O support for largefiles
Ryan C. Underwood [Sun, 6 Mar 2011 10:40:53 +0000]
Fix positional I/O support for largefiles

Commit 335ccb40 introduced positional I/O support for the fileserver,
but didn't handle the largefile versions of preadv and pwritev. As a
result, the fileserver cannot handle files of more than 2Gb in size.

Fix this by using preadv64 and pwritev64 where O_LARGEFILE is defined,
in the same way as for all other I/O primitives.

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

13 years agoDisable vectored positional IO if no 64bit support
Simon Wilkinson [Sun, 6 Mar 2011 16:06:36 +0000]
Disable vectored positional IO if no 64bit support

In order to support vectored positional I/O, and large files, we
need there to be an implementation of preadv64 and pwritev64. If
this isn't present, then just disable HAVE_PIOV.

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

13 years agovolser: warning removal
Jeffrey Altman [Sat, 5 Mar 2011 14:58:17 +0000]
volser: warning removal

remove assigning size_t to int warnings when size_t is larger
by declaring appropriate variables as size_t.

remove signed vs unsigned warnings

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

13 years agoubik: add lock initialization function
Marc Dionne [Thu, 20 Jan 2011 02:52:04 +0000]
ubik: add lock initialization function

Add a new lock initialization function and call it from the
initialization sequence.  Users of the locks can assume that
they are already initialized.

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

13 years agoubik: rename DInit, call from initialization sequence
Marc Dionne [Thu, 20 Jan 2011 02:39:44 +0000]
ubik: rename DInit, call from initialization sequence

Rename DInit to udisk_Init, and call it from the general
initialization sequence.  udisk_begin can now assume that this
has been done.

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

13 years agoubik: build all files for pthread version
Jeffrey Altman [Sat, 5 Mar 2011 23:34:57 +0000]
ubik: build all files for pthread version

Build all files for pthreads from the ubik directory.
No longer require src/tubik/NTMakefile.
Add missing library to tbutc linkage requirements.

Change-Id: If517ce528e5dde9b600824897e1304949b2c2719
Reviewed-on: http://gerrit.openafs.org/4150
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agovolser: restore diskPartition[64] lock_fd comment
Jeffrey Altman [Sat, 5 Mar 2011 15:06:50 +0000]
volser: restore diskPartition[64] lock_fd comment

The diskPartition[64] wire structures contain an int to represent
the file descriptor.  This field is too small to represent the
Windows file descriptor which is a 64-bit HANDLE.  A comment had
been added by Rod Widdowson.  Restore it.

Change-Id: Icf513060802e7f057f6ca735afb26d22edbf6446
Reviewed-on: http://gerrit.openafs.org/4138
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agovolser: cleanup volser_internal.h
Jeffrey Altman [Sat, 5 Mar 2011 14:38:08 +0000]
volser: cleanup volser_internal.h

remove yesprompt() prototype for function that no longer exists

make dump_sig_handler(), sortVolumes(), VolumeExists(),
CheckVldbRWBK(), CheckVldbRO(), and CheckVldb() static within
vsprocs.c

Change-Id: I2130ac0d2f0dbfe6bf3315450ba342b6e9d51b6b
Reviewed-on: http://gerrit.openafs.org/4136
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoubik: remove unused UBIK_PAUSE code
Marc Dionne [Thu, 20 Jan 2011 02:25:21 +0000]
ubik: remove unused UBIK_PAUSE code

This code has never been enabled, and is apparently not needed,
so remove it to simplify maintenance and future changes.

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

13 years agovolser: make private lockproc routines private
Jeffrey Altman [Sat, 5 Mar 2011 14:21:15 +0000]
volser: make private lockproc routines private

FindIndex and SetAValue are only used within lockprocs.c.
Make them static and remove them from lockprocs_prototypes.h

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

13 years agoUnix CM: Remove redefinition of "inline"
Simon Wilkinson [Fri, 4 Mar 2011 10:29:45 +0000]
Unix CM: Remove redefinition of "inline"

discon.h contained a redefintion of "inline" for non-gcc compilers
that's a left over from when it used "static inline", rather than
"static_inline".

Remove the redefinition, as it's now both uneccessary, and confusing.

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

13 years agoRevert "Convert from using nvldbentry to uvldbentry"
Jeffrey Altman [Sat, 5 Mar 2011 05:40:13 +0000]
Revert "Convert from using nvldbentry to uvldbentry"

This reverts commit 4f1efdc8b73ed734197925766530d033c6f9794a.

The conversion to uvldbentry produced too many negative side
effects.  Revisit support for multi-homed servers when vos
is executed from a machine that can only see a random subset
of the addresses assigned to the server in the future.

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

13 years agoRevert "modify FindIndex to compare uuids"
Jeffrey Altman [Sat, 5 Mar 2011 04:40:31 +0000]
Revert "modify FindIndex to compare uuids"

This reverts commit 9aad0979e9ff0601c249eb66a6ecfb3e76264702.

This is being pulled as the entire nvldbentry to uvldbentry
conversion is being reverted.

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

13 years agoviced: Set HWHO_INPROGRESS in CheckHost_r
Andrew Deason [Fri, 4 Mar 2011 17:35:06 +0000]
viced: Set HWHO_INPROGRESS in CheckHost_r

When we are probing a host in CheckHost_r, set the HWHO_INPROGRESS
flag on the host, so other threads know that the host is locked while
we are waiting for a probe response, and the h_threadquota mechanism
can work correctly.

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

13 years agoWindows: mp target trailing dot not part vol name
Jeffrey Altman [Fri, 4 Mar 2011 16:04:40 +0000]
Windows: mp target trailing dot not part vol name

Instead of passing "root.cell." into cm_FreelanceAddMount
pass in "root.cell" and add the trailing dot within the function.

Change-Id: I5d27c6c34a3197a451491a0bbdf6c854394ce572
Reviewed-on: http://gerrit.openafs.org/4124
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoWindows: avoid use of cm_buf for MPs and Symlinks
Jeffrey Altman [Wed, 2 Mar 2011 19:06:48 +0000]
Windows: avoid use of cm_buf for MPs and Symlinks

In the Windows cache manager, the symlink and mount point
target strings are stored in the cm_scache_t mountPointString
and are not accessed out of the cm_buf_t for offset zero
except when populating the mountPointString.  As a result,
every mountpoint and symlink object that is read into the cache
wastes a cm_buf_t which could otherwise be used to store
additional file or directory data.

Add cm_GetData() function which is similar to cm_GetBuffer()
except that it reads data from the file server into an arbitray
memory location instead of a cm_buf_t object.  Use cm_GetData()
to read directly into the cm_scache_t object.

In addition, further optimize the communication with the
file server by using cm_GetData() to perform a RXAFS_FetchData
RPC to obtain both the target string and the status information
instead of RXAFS_FetchStatus which only returns the status
information in cases where there are no outstanding callback
registrations on the object.  RXAFS_FetchStatus is still used
when a callback is active in order to obtain access permissions
for new users.

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

13 years agovol: Check for blank vnode in VAllocVnode_r
Andrew Deason [Fri, 25 Feb 2011 22:58:30 +0000]
vol: Check for blank vnode in VAllocVnode_r

When we alloc a vnode in VAllocVnode_r, we look up that vnode in the
vnode cache, to see if a vnode struct already exists for it. If it
doesn't, we check the vnode index to ensure that the vnode actually is
not in use (among other things). However, we do not perform the same
check for a vnode already in the cache. Add this check, to make sure
that we don't allocate an already-used vnode number, even if the
bitmap is screwed up.

Change-Id: I63b3aa752d359a2ff8282b193e658d74d6b9719c
Reviewed-on: http://gerrit.openafs.org/4060
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoDAFS: VnLock after VnWaitQuiescent in VAllocVnode
Andrew Deason [Fri, 25 Feb 2011 22:01:32 +0000]
DAFS: VnLock after VnWaitQuiescent in VAllocVnode

In VAllocVnode, we write-lock the newly-allocated vnode. In DAFS,
however, we need to VnWaitQuiescent_r before VnLock'ing, since VnLock
in DAFS just sets the writer tid/pid. So, in VAllocVnode, move the
VnLock call to after we wait for quiescence, so we don't stomp over
the vnode when someone else has it write-locked.

Change-Id: Ib234634dba9d09eea877bc91660ea3a8a4e2b746
Reviewed-on: http://gerrit.openafs.org/4059
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoDAFS: Wait for exclusive ops in VFreeBitMapEntry_r
Andrew Deason [Fri, 25 Feb 2011 20:43:09 +0000]
DAFS: Wait for exclusive ops in VFreeBitMapEntry_r

VAllocBitmapEntry_r puts the volume in an exclusive state and drops
VOL_LOCK when traversing the volume bitmap and updating the bitmap.
So, VFreeBitMapEntry_r must ensure the volume is not in an exclusive
state, to make sure that VAllocBitmapEntry_r is not updating the
bitmap at the same time. Do so, by waiting for the volume to come out
of exclusive state at the beginning of VFreeBitMapEntry_r.

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

13 years agovol-salvage: VOL_DONE deleted volumes
Andrew Deason [Wed, 2 Mar 2011 20:11:43 +0000]
vol-salvage: VOL_DONE deleted volumes

When the salvager deletes a volume (because it is an invalid RO clone,
or because there is no data associated with the volume), we should
inform the fileserver that the volume is gone. Otherwise, the volume
in the fileserver can get put into an error state (in DAFS) when it
tries to attach the volume, preventing anything from creating or using
that volume.

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

13 years agoDAFS: Clear salvage stats on VOL_DONE
Andrew Deason [Wed, 2 Mar 2011 21:39:51 +0000]
DAFS: Clear salvage stats on VOL_DONE

When we VOL_DONE a volume, the volume has been deleted, so the salvage
stats/information are no longer relevant. Clear them out, so we don't
think the volume is still salvaging.

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

13 years agoDAFS: Allow LEAVE_OFF for DELETED volumes
Andrew Deason [Wed, 2 Mar 2011 21:02:40 +0000]
DAFS: Allow LEAVE_OFF for DELETED volumes

When a volume is VOL_STATE_DELETED, it effectively does not exist to
other programs over FSSYNC. So, do not prevent someone from issuing a
FSYNC_VOL_LEAVE_OFF for a VOL_STATE_DELETED volume.

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

13 years agovol-salvage: calloc volume summary structs
Andrew Deason [Wed, 2 Mar 2011 20:10:33 +0000]
vol-salvage: calloc volume summary structs

Calloc volume summary structs instead of malloc'ing them, in
vol-salvage.c. This way, new fields added to struct VolumeSummary will
be known to be zeroed by default, without needing to update all of the
allocating callers.

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

13 years agoviced: Check vnode length on read and write
Andrew Deason [Thu, 3 Mar 2011 22:02:47 +0000]
viced: Check vnode length on read and write

When reading or writing a file vnode, check that the length of the
vnode in the vnode index matches the size of the on-disk file
containing the data for the file. If it does not match, take the
volume offline (and for DAFS, demand-salvage it).

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

13 years agorpm: fix ChangeLog filename in doc rpm
Michael Meffie [Fri, 4 Mar 2011 01:22:54 +0000]
rpm: fix ChangeLog filename in doc rpm

Fix an rpmbuild error introduced in commit 8d157961.

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

13 years agovol-salvage: Fix AskOnline error message
Andrew Deason [Wed, 2 Mar 2011 20:13:25 +0000]
vol-salvage: Fix AskOnline error message

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

13 years agoGive a default reason in *sync-debug
Andrew Deason [Wed, 2 Mar 2011 19:12:25 +0000]
Give a default reason in *sync-debug

If no -reason is given for fssync-debug calls, we currently just
transmit garbage to the fileserver or salvageserver. Instead, give a
default (the *_WHATEVER constant), so we do something consistent.

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

13 years agoTidy up assorted clean targets
Simon Wilkinson [Tue, 1 Mar 2011 18:03:03 +0000]
Tidy up assorted clean targets

Improve assorted clean targets so that they properly clean up all of
the default build products.

Add rxosd to the list of directories to clean

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

13 years agotests: Remove errant rxgk build rule
Simon Wilkinson [Tue, 1 Mar 2011 16:37:32 +0000]
tests: Remove errant rxgk build rule

A reference to tests/rxgk slipped in to an earlier commit. Remove it
as OpenAFS doesn't have rxgk in its tree yet

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

13 years agoauth: Add GetAllKeys function
Simon Wilkinson [Tue, 1 Mar 2011 14:23:47 +0000]
auth: Add GetAllKeys function

Add support for a GetAllKeys function that can be used to list all
of the keys in a configuration directory.

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

13 years agokernel crypto: Tidy up includes
Simon Wilkinson [Tue, 1 Mar 2011 14:35:35 +0000]
kernel crypto: Tidy up includes

Don't include the whole of afsincludes.h when building our kernel
crypto interface, as it can lead to symbol collisions on Fedora 10 and
later.

Instead, just include rx/rx.h, which is sadly required to get an
osi_Assert prototype, and explicitly prototype our osi_readRandom()
function

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

13 years agotweak uvldb-making function
Derrick Brashear [Tue, 1 Mar 2011 21:43:10 +0000]
tweak uvldb-making function

in order to properly simulate a uvldb, swap in the right fields,
and mark it correctly.

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

13 years agorx: cancel growmtu event on resetcall
Derrick Brashear [Wed, 2 Mar 2011 13:12:38 +0000]
rx: cancel growmtu event on resetcall

attempt at fixing issue reported by Ryan Underwood.

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

13 years agoptuser/hpr: Don't check for a KeyFile
Simon Wilkinson [Tue, 1 Mar 2011 14:01:46 +0000]
ptuser/hpr: Don't check for a KeyFile

ptuser and viced's hpr were checking for a KeyFile before calling
ClientAuthSecure. If a KeyFile doesn't exist, then they would display
a warning message, and use an rxnull connection.

However, ClientAuthSecure will return a rxnull connection if it can't
find a KeyFile. So, simplify all of this to just use ClientAuthSecure,
which knows better than we do what keys are usable and which aren't.

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

13 years agoptserver: Always set up Ubik security
Simon Wilkinson [Tue, 1 Mar 2011 13:59:19 +0000]
ptserver: Always set up Ubik security

ptserver was checking for the existence of a suitable KeyFile before
setting up Ubik's security classes. This is uneccessary, because the
behaviour of the afsconf_* functions when a KeyFile doesn't exist
is the same as Ubik's default mechanisms.

So, simplify (and future proof) the code by removing the KeyFile check.

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

13 years agoauth: Add Ktoken.xdr.c to the clean rule
Simon Wilkinson [Tue, 1 Mar 2011 00:13:00 +0000]
auth: Add Ktoken.xdr.c to the clean rule

Ktoken.xdr.c was being built, but not cleaned. Fix this by adding it
to the clean rule.

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

13 years agolibafscp: a library for "clientless" operations
Chaskiel Grundman [Fri, 2 Jul 2010 18:08:23 +0000]
libafscp: a library for "clientless" operations

libafscp provides the ability to accomplish many of the functions of an AFS
client without a running afsd cache manager.  It is being introduced into
the OpenAFS source tree in order to improve the capabilities of several
utilities but may have additional benefits for testing clients and servers
and for use on platforms which do not have afsd support.

Change-Id: I24ee9416662c15b2d267317cea6fe0b7439ee022
Change-Id: I61037736e6edd01106b5b5ed982b211c16e1e7d9
Reviewed-on: http://gerrit.openafs.org/2371
Reviewed-by: Chaz Chandler <clc31@inbox.com>
Tested-by: Chaz Chandler <clc31@inbox.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agovolser: Rename putshort and putint32
Simon Wilkinson [Tue, 1 Mar 2011 00:11:01 +0000]
volser: Rename putshort and putint32

dumpstuff.c defines macros for putshort and putint32. However, the
name 'putshort' conflicts with a macro defined on Linux in resolv.h
(which is included by roken.h)

Just rename putshort to afs_putshort and putint32 to afs_putint32 to
solve this problem

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

13 years agoroken: Fix out-of-tree libroken builds
Simon Wilkinson [Tue, 1 Mar 2011 00:08:12 +0000]
roken: Fix out-of-tree libroken builds

The libroken configuration script is supposed to support using a
libroken which is installed out of the OpenAFS tree, but which isn't
in the standard search paths, by using --with-roken=/path/to/base

This didn't previously work. Fix this so that it works correctly,
and also fix a few problems with libafshcrypto, which assumed that
LDFLAGS_roken would always be -L$(TOP_LIBDIR)

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

13 years agoFix grammar in configure check description
Simon Wilkinson [Sun, 27 Feb 2011 11:43:11 +0000]
Fix grammar in configure check description

"checking for kernel module build works"
    -> "checking if kernel module build works"

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

13 years agoRevert "LWP: remove ucontext header from preempt module"
Andrew Deason [Mon, 28 Feb 2011 20:03:46 +0000]
Revert "LWP: remove ucontext header from preempt module"

This reverts commit fbac809a46376fcf60d3dcedc0be962c43d9c74e.

The ucontext header is only included in lwp.h for platforms that use
ucontext as a means for context-switching in LWP. The preempt module
needs the ucontext header for signal handling on some platforms (at
least Solaris). So, ucontext.h may not be included by lwp.h on these
platforms, if that platform does not use ucontext for LWP
context-switching. So we need to explicitly include ucontext.h in
preempt.c.

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

13 years agoRevert "Make osi_fetchstore.c protocol independent"
Simon Wilkinson [Mon, 28 Feb 2011 14:17:28 +0000]
Revert "Make osi_fetchstore.c protocol independent"

This reverts commit 951612f4508b0c2ace4676f263df8dd4b566dd44.

In testing, this change causes RXAFS_EndStoreData to intermittently
fail with an RX_CC_UNMARSHALL error code. The error is returned
when the first 32bit word is read from the RX stream from the server.
Before this happens, the call is not in an error state.

As this problem makes the cache manager unusable for other
development, back the changeset out for now.

Change-Id: If8268faa7bee2651273d7fbb0e235ddb02d6284b
Reviewed-on: http://gerrit.openafs.org/4093
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoarm darwin update
Derrick Brashear [Sun, 27 Feb 2011 02:55:19 +0000]
arm darwin update

some stuff that got lost from the last batch

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

13 years agoLWP: remove ucontext header from preempt module
Derrick Brashear [Sun, 27 Feb 2011 02:51:50 +0000]
LWP: remove ucontext header from preempt module

it's already included by header. don't include it again.

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

13 years agoavoid unneeded rebuilds due to component version
Derrick Brashear [Sun, 27 Feb 2011 02:44:37 +0000]
avoid unneeded rebuilds due to component version

if the component version file does not change, don't touch it
and force a rebuild

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

13 years agogenerated mode: fix result
Derrick Brashear [Sun, 27 Feb 2011 02:42:40 +0000]
generated mode: fix result

don't leave build results which will interfere with the next phase around

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

13 years agoDOC: Add a missing quote in the QuickStart Guide
Jason Edgecombe [Sat, 26 Feb 2011 22:18:25 +0000]
DOC: Add a missing quote in the QuickStart Guide

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

13 years agoLINUX: Include key-related headers in osi_compat.h
Andrew Deason [Thu, 17 Feb 2011 17:57:53 +0000]
LINUX: Include key-related headers in osi_compat.h

Include keyring-related headers in osi_compat.h, so we get the proper
types defined for keyring-related functions. Also only define
keyring-related functions if we have keyring support.

Change-Id: Ie7d748f1426ce883c61ae8f30dbce1f0a1bf6bab
Reviewed-on: http://gerrit.openafs.org/3895
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoLinux: Reduce key_alloc flags confusion
Anders Kaseorg [Tue, 22 Feb 2011 23:18:17 +0000]
Linux: Reduce key_alloc flags confusion

KEY_ALLOC_IN_QUOTA should be 0, not 1.  Fortunately this was
overridden by the earlier correct definition in osi_compat.h.

Change-Id: I91a3b16dca0af182ddc3441437be781e689645a7
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/4033
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoauth: Rework PickClientSecObj
Simon Wilkinson [Fri, 25 Feb 2011 01:30:02 +0000]
auth: Rework PickClientSecObj

When called in localauth mode, this function was using
afsconf_GetLatestKey to check that the machine has a key file. However,
the ClientAuth and ClientAuthSecure functions then go on to do exactly
the same thing.

Instead, pick up on ClientAuth returning a rxnull security layer, and
trigger the NOTFOUND error based on that, rather than on the absence of
an old-style key file.

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

13 years agoauth: Fix use of expires in PickClientSecObj
Simon Wilkinson [Fri, 25 Feb 2011 01:28:30 +0000]
auth: Fix use of expires in PickClientSecObj

The expires pointer was being zeroed in PickClientSecObject, rather
than zeroing the value pointed to. This meant that we would never
return any expiry time for the selected token.

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

13 years agoauth: Correctly write empty keyfiles
Simon Wilkinson [Fri, 25 Feb 2011 01:23:38 +0000]
auth: Correctly write empty keyfiles

The new key handling code was creating empty keyfiles that were 0
bytes in length. The correct format for an empty keyfile is a file
containing a single 0 word (the number of keys in the file). Update
the code to write this form of empty KeyFile.

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

13 years agoauth: GetLatestKey should allow NULL return values
Simon Wilkinson [Fri, 25 Feb 2011 01:21:38 +0000]
auth: GetLatestKey should allow NULL return values

Existing callers in the code use
afsconf_GetLatestKey(dir, NULL, NULL) to check for the existence of
a key file. We need to permit NULL values for the return pointers
to this function.

Also update the tests to check for this behaviour.

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

13 years agotests/auth: Refactor common code
Simon Wilkinson [Thu, 24 Feb 2011 13:52:40 +0000]
tests/auth: Refactor common code

Pull the common code for creating a configuration directory out of
the keys and superuser tests into a single file. This both cleans up
the existing tests, and makes it easier to add new ones.

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

13 years agoman-pages: add generated vos*.pod to clean rule
Jeffrey Altman [Fri, 25 Feb 2011 15:32:37 +0000]
man-pages: add generated vos*.pod to clean rule

9ec343cf4292e178fa1e4a9757232dc983ea9ba3 failed to add the
newly generated vos_addsite.pod, vos_copy.pod, and vos_zap.pod
to the clean rule.

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

13 years agoLinux: install_session_keyring: key_alloc flags are unsigned long
Anders Kaseorg [Wed, 23 Feb 2011 00:18:30 +0000]
Linux: install_session_keyring: key_alloc flags are unsigned long

Change-Id: I3bdecd77e06928fd22cf0cf6bd92af2dccf62896
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/4034
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoMacOS: aklog auth plugin
Derrick Brashear [Mon, 14 Feb 2011 05:20:40 +0000]
MacOS: aklog auth plugin

the AuthorizationPlugin subsystem replaced the old loginplugin
method. As it is now usable for us, provide a plugin which can take
advantage of it.

LICENSE BSD

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

13 years agolwp: test for working swapcontext() and friends
Chas Williams (CONTRACTOR) [Sat, 19 Feb 2011 15:19:24 +0000]
lwp: test for working swapcontext() and friends

The USE_UCONTEXT was a temporary fix until someone wrote a reasonable
test of the user context swapping functions.  While these are present
on many operating systems, they simply aren't complete.  This test
correctly fails on IRIX, MacOS and some versions of Linux (in particular,
ppc 32-bit binaries on a 64-bit processor).

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

13 years agovutil.c: use OS_XXX rather than afs_XXX
Rod Widdowson [Sat, 22 Jan 2011 16:25:42 +0000]
vutil.c: use OS_XXX rather than afs_XXX

This checkin replaced the use of afs_open/close with OS_OPEN/OS_CLOSE

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

13 years agonamei_ops.c use OS_XXX rather than afs_XXX
Rod Widdowson [Thu, 3 Feb 2011 11:44:12 +0000]
namei_ops.c use OS_XXX rather than afs_XXX

This checkin removes all uees of afs_open and replaces them with
OS_OPEN.  It converts direct call to read/write/close to OS_XXX

The exception is afs_stat which is left in place as this is unix
only and rerquires separate handling.

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

13 years agorx: Reset fd_set in LWP rxi_Sendmsg
Andrew Deason [Mon, 21 Feb 2011 18:39:48 +0000]
rx: Reset fd_set in LWP rxi_Sendmsg

When we select() on the socket fd in rxi_Sendmsg, we do not reset the
fd_set, and just use the same memory for any necessary subsequent
select()s. However, if the select returned on EINTR, the fd_set may be
cleared, and so we may try to select() on an empty fd_set forever. To
be sure that we don't do that, reset the fd_set to the socket fd every
time.

Change-Id: I5273351c70e593ad1b7849f4f56de1fcb12d1bbf
Reviewed-on: http://gerrit.openafs.org/4028
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoMacOS: don't install growlagent into prefpanes dir
Derrick Brashear [Wed, 16 Feb 2011 17:18:58 +0000]
MacOS: don't install growlagent into prefpanes dir

we have more than one tool now. don't misinstall into the
prefpanes directory

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

13 years agocmd: Fix objdir builds
Andrew Deason [Mon, 21 Feb 2011 20:13:22 +0000]
cmd: Fix objdir builds

Commit 8eca6a1153eb7768c2f29ea2d48f01f6988cbfe3 broke objdir builds by
not specifying ${srcdir} for cmd.c. Fix that.

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

13 years agobudb: Fix objdir builds
Andrew Deason [Mon, 21 Feb 2011 20:56:48 +0000]
budb: Fix objdir builds

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

13 years agoFix budb build rules for tbudb and WINNT
Andrew Deason [Mon, 21 Feb 2011 19:49:59 +0000]
Fix budb build rules for tbudb and WINNT

Commit 0d0b5048a5b68d4079b13609775f9234183d1947 only fixed the budb
Makefile.in. Make the analagous changes to tbudb/Makefile.in and
NTMakefile.

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

13 years agoHPUX: Fix osi_debug.c includes
Andrew Deason [Sun, 20 Feb 2011 03:14:11 +0000]
HPUX: Fix osi_debug.c includes

osi_debug.c was trying to include fcrypt.h and private_data.h. But the
former is in the rx subdirectory, and the latter is in src/rxkad. So,
specify a more complete path for fcrypt.h, and put src/rxkad in the
include list for osi_debug.c so we can build again.

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

13 years agobudb: Only have one build rule for budb_errs.c
Simon Wilkinson [Mon, 21 Feb 2011 00:29:33 +0000]
budb: Only have one build rule for budb_errs.c

budb had two build rules that could produce budb_errs.c, but only
one of them also produced budb_client.h. This led to problems with
parallel makes, as depending on which rule fired first, budb_client.h
might, or might not, exist.

Rework all of this so that it's cleaner. Instead of producing two
copies of the error table, just make budb_client.h a static file,
and include the dynamically generated budb_errs.h from it. This
reduces code duplication, and means that we have to run compile_et
one less time.

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

13 years agolibuafs: add UAFS.pic to .gitignore
Marc Dionne [Sun, 20 Feb 2011 14:40:15 +0000]
libuafs: add UAFS.pic to .gitignore

Add UAFS.pic to .gitignore, it's a generated directory.

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