Currently, GetVolume treats a volume in the VOL_STATE_GOING_OFFLINE
state the same as VOL_STATE_SHUTTING_DOWN, and so returns VNOVOL for a
GOING_OFFLINE volume, but these states are very different.
GOING_OFFLINE indicates that a volume should soon be in the UNATTACHED
state, so we should treat GOING_OFFLINE the same as UNATTACHED for
returning errors to the user. For UNATTACHED, we return specialStatus
if it's set, or VOFFLINE otherwise; so, just do the same for
GOING_OFFLINE.
Change-Id: Ia9500d2cfd90b8c15782a06025f39298810d0a99
Reviewed-on: http://gerrit.openafs.org/7290
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
we try to avoid a crash on a missing serverHost; do the same
on missing addrs in that host
FIXES 130714
Change-Id: Ic6bab8654cf7bf85351a9482b9ba5d51e5a768d5
Reviewed-on: http://gerrit.openafs.org/7287
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
The variable bPurgeExtents was not being set when a DV change
was detected in AFSValidateEntry(). This resulted in the purge
being skipped and old data being left in the cache.
Change-Id: I6f5a35e5c7a51d28267e0ff25318782a766771ac
Reviewed-on: http://gerrit.openafs.org/7280
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
During AFSEnumerateDirectory() and AFSVerifyDirectoryContent() calls
use AFSPerformObjectInvalidate() instead of AFSInvalidateObject()
to trigger the data purge. This is necessary to avoid a race as
AFSInvalidateObject() will queue a work request that will be performed
after the metadata is updated.
Change-Id: Iaf09c6448927a037175cb4a83502fd4a1d210ef2
Reviewed-on: http://gerrit.openafs.org/7279
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
CcPurgeCacheSection can fail. If it does, remember that the
purge still needs to be performed by setting the
AFS_FCB_FLAG_PURGE_ON_CLOSE flag on the File Control Block.
Change-Id: I83fab09ed5c506879e219606f8b10fdd7c021204
Reviewed-on: http://gerrit.openafs.org/7278
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
The vos test wasn't running correctly from runtests, as it contained
a relative path which assumed that the CWD was tests/volser, rather
than tests/
Modify this to use the BUILD environment variable when invoked from
runtests, and also add an exit after the exec(), so that if we do
fail to launch the binary we don't have two processes both running
the same code.
Change-Id: I7b2d7e6a517e9e9f74f15803da7507037671226a
Reviewed-on: http://gerrit.openafs.org/7265
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
because background daemons can have dependence on other subsystems, but
are not needed for other operations, stop them first.
Change-Id: If65cf922b84cfca7b8c5d7b7a2d571bfe1e5ff12
Reviewed-on: http://gerrit.openafs.org/7246
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
during shutdown, once umount finished, it was possible to
unload the module before shutdown completed. fix that.
Change-Id: I7eae5210ec9553fa862d96148f963dcdfee79c4b
Reviewed-on: http://gerrit.openafs.org/7245
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
If the share name was resolved by querying the service instead
of finding the entry in the root.afs root directory, construct
a name array in AFSParseName() that includes the AFSGlobalRoot
above the resolved share root directory.
In AFSBackupEntry, check for the case where two volume root entries
appear in sequence without an intervening mount point.
Change-Id: Ied0e0dc8226b0460d85a1f3a8b389294cfdef34b
Reviewed-on: http://gerrit.openafs.org/7252
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
It is valid for the cellp parameter to be NULL. When invalidating
all ACLs for a user pass 0 to cm_EAccesClearUserEntries().
FIXES 130704
Change-Id: Ic6b6e5f1c2e10aa633390ee3d7c709dc202bbd29
Reviewed-on: http://gerrit.openafs.org/7251
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
The user lock is obtain while holding the eaccess lock.
Reflect it in the hierarchy.
Change-Id: I3aac945287415cd3babbe52f9fdeb93ab4d729bd
Reviewed-on: http://gerrit.openafs.org/7247
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Commit 9ddf9eca56 changed the mechanism
by which the local realm is determined such that pr_realmName is
no longer required.
Tidy things up by removing the unecessary variable.
Change-Id: I9b21340a8ecd38fbb8326dbed276882c9f0e9a62
Reviewed-on: http://gerrit.openafs.org/7266
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Add checks for recent versions of sunstudio for solaris. The
installation paths are documented in the release notes of versions
12.1, 12.2, and 12.3.
Change-Id: Ic28f40a061f288a1c39acb6a5d11e81876631d7f
Reviewed-on: http://gerrit.openafs.org/7253
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Add an RX identity type that can be used to represent the super user
who is granted access using printed tickets.
Change-Id: I3d6e657a04136746b502efa7698901225410f3c0
Reviewed-on: http://gerrit.openafs.org/7261
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Make it possible to have NULL values for elements of the rx_identity
and rx_opaque structures.
Change-Id: I3624d490d92da3cf75da5edb91c7d4e5ce1fa937
Reviewed-on: http://gerrit.openafs.org/7260
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Move the token faking code out of superuser-t.c into its own file in
tests/common, so it can be used by other tests.
Change-Id: I7b420250ef974b4b80a8dde692d2666657bb82ca
Reviewed-on: http://gerrit.openafs.org/7259
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
The StopVLServer function can be used to stop any server for which
we know the pid. So, rename it as afstest_StopServer to make this
apparent.
Change-Id: Ia5973342e81dc15a698e84e69b314cd6157831f7
Reviewed-on: http://gerrit.openafs.org/7258
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Abstract out the code which the volser test uses to produce a
ubik client so that it can be used to test other ubik services
Change-Id: I800fda9e53ad45c91f3de8eceea387cc011dda3c
Reviewed-on: http://gerrit.openafs.org/7257
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
The way in which the ubik database is initialised is identical for
all read transactions, and for all write transactions. Rather than
duplicating this code in each call handler, pull it out into two
helper functions - ReadPreamble and WritePreamble.
Change-Id: I40f2d8d609bc4e6e8e3e0fc8851da86978c77818
Reviewed-on: http://gerrit.openafs.org/7256
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Add the missing volser/vos test, and fix it so that the plan is correct
Change-Id: I017679176f5df8fb18002175a75ac0dcd108aded
Reviewed-on: http://gerrit.openafs.org/7255
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
The #define PR_REMEMBER_TIMES is always true, so remove the #define,
and all of the #ifdefs that it triggers
Change-Id: I445a2cd8f5e5b2570e6ef1311cc6bb3d66592fdc
Reviewed-on: http://gerrit.openafs.org/7264
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Commit d85ece0977 added a new
mechanism for determining whether a realm is local or not, and
susequent commits removed all in-tree calls to the now-legacy
functions in get_krbrlm.c
To avoid confusion, just remove all of these legacy functions, as
we don't want to end up supporting two ways of doing this
operation.
This change is not suitable for pullup to a stable release.
Change-Id: Ie2f5c447f751d12a0d85a4a438efd7e210133e97
Reviewed-on: http://gerrit.openafs.org/7263
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Use the rxperf performance testing tools to add a couple of simple
RX tests. The first moves 1Mbyte of data backwards and forwards 30
times. The second starts 30 threads, which each move 1MByte of data
once.
This is by no means an exhaustive test of RX, but the single and
multi-threaded invocations should provide a useful smoke test if
things get very broken.
Change-Id: I11267be067cf6c05a20aeb90a18ed4031502a1b1
Reviewed-on: http://gerrit.openafs.org/7244
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Move the 'rxperf' RX performance testing utility out of the
src/rx/test directory, and into the slightly more visible top level
src/tools/ directory
As this is the first time that rxperf has been built as part of the
default build, make a number of changes so that it will build on all
of our supported platforms.
Change-Id: Ice37e7db694dbfed34009bf76d24f1e0bf272e47
Reviewed-on: http://gerrit.openafs.org/7240
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Add setprogname to the list of functions that we test for, and replace
with a libroken alternative if it is missing.
Remove setprogname and getprogname from the AC_CHECK_FUNCS list, as
AC_REPLACE_FUNCS is a superset of this test.
Change-Id: If81dc8ba6d9245329f3abae6a6f062e3827dcfab
Reviewed-on: http://gerrit.openafs.org/7250
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
When the hcrypto/des header was removed from our installed headers, it
wasn't added back in to the superuser test. Add it now, so that the test
can build.
Change-Id: I38023ee94abe801f6f2313b492e4f80855001c41
Reviewed-on: http://gerrit.openafs.org/7243
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Some of our shared libraries (in particular, roken) build with different
symbols in them depending on the exact configuration options for a
particular platform. This means that not all of the symbols in the map
file may be present within the library. On Mac OS X we have been working
around this by using the "-flat_namespace,-undefined,suppress" linker
options.
However, with Lion this no longer works, as the linker still expects to
find the symbol in the library whose mapfile indicated that it was
present. So, for example, we end up with errors like:
dyld: Symbol not found: _errx
Referenced from: openafs.git/tests/rx/../../src/tools/rxperf/rxperf
Expected in: openafs.git/lib/librokenafs.dylib.1.1
... despite errx actually being provided by the system libraries.
The fix to this is to use the default two level namespace, and change
our behaviour for undefined symbols to 'dynamic_lookup', rather than
'suppress'
Change-Id: Ide37856198a8db3d42ee0a5261d097176bcc9301
Reviewed-on: http://gerrit.openafs.org/7242
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Move dumpscan into its own directory, so that it's Makefile rules can
be better contained, and not pollute the whole 'tools/' namespace
Change-Id: Ic58d007824ab802eae469dd2996300f80671a3b8
Reviewed-on: http://gerrit.openafs.org/7239
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Remove the static list of local realms and use the
auth interace to do the local realm check. A callback
function is registered by the servers to avoid a circular
dependency between audit and auth.
Change-Id: Ic0f25cd79da7987704de68bade14054490b26c80
Reviewed-on: http://gerrit.openafs.org/6879
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Use the new auth function to do the local realm match
check instead of static local realms lists.
Override the krb.conf file with the -realms command line
option.
Change-Id: Ic364e61b03385fbc9496ac4af3877a1fdee3a3a5
Reviewed-on: http://gerrit.openafs.org/6878
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Use the new auth function to do the local realm match
check instead of static local realms lists.
Change-Id: I8b509188103916bdd2e575e5e9a14e3671b81e65
Reviewed-on: http://gerrit.openafs.org/6877
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Remove the static list of local realms and use the auth
interface to perform the local realm match check.
Change-Id: I0f56e7974e59035eb9bf9fb343b550ab6b7ef314
Reviewed-on: http://gerrit.openafs.org/6876
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Modify the peer, call and rpc_stats structures to use native 64 bit
types for the bytesSent and bytesRcvd data counters. All of our
platforms support native 64bit quantities now, so there's absolutely
no value in rolling our own.
Change-Id: I7c51de73be17821c6472eea535c8476fe0d7a23e
Reviewed-on: http://gerrit.openafs.org/7205
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
If the file size or allocation is being altered, we must hold
the PagingResource and drop the Fcb Resource. Dropping the
Fcb resource is necessary to avoid a deadlock with TrendMicro's
filter if the size is set to zero and acquiring the PagingResource
is necessary to prevent races now that the Fcb Resource is no
longer held.
Change-Id: Ie72a018adc52c479a4bb2469b2b1abe317644e8b
Reviewed-on: http://gerrit.openafs.org/7224
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
When the file allocation size changes the PagingResource must
be held exclusively to prevent races.
Change-Id: I6ff3a2061563dbb858bb284b463913f6d3b33e7a
Reviewed-on: http://gerrit.openafs.org/7223
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Instead of calling CcPurgeCacheSection() in AFSProcessOverwriteSupersede()
as part of the file length truncation to zero, call CcSetFileSizes().
Wait to call CcSetFileSizes() until after the Fcb->Resource has been
dropped but while the Fcb->Header.PagingIoResource is still held.
Make sure that file sizes are restored in the Fcb->Header if the
afsd_service rejects the file update.
Change-Id: I7574e80781ac1dbbe69814c69644bb3825de9b6a
Reviewed-on: http://gerrit.openafs.org/7220
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Add krb.conf and krb.excl support to the auth cell configuration
library. Provide a function to determine if the user is local to the
cell. Provide a function to set the local realms during application
initialization. These changes are intended to replace the functions
afs_krb_get_lrealm and afs_is_foreign_ticket_name.
Change-Id: Iba57e9ffc2c958f3a4565a9352ce172189276ce9
Reviewed-on: http://gerrit.openafs.org/5744
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
When stats are enabled, rxi_ReadPacket calls FindPeer immediately
the packet is received from the wire. The peer structure that it
gets is used solely to increment a counter, and then thrown away.
Given that FindPeer requires a lock, and a hash lookup, this is
really inefficent.
Instead, delay the compilation of statistics until rxi_ReceivePacket.
Call FindPeer for version and debug packets which have no associated
connection otherwise wait until we have found the packet's connection,
and use the peer which is linked from there.
Change-Id: Ic2eb08e52b97d6b033b9d3de59da9346e012d70d
Reviewed-on: http://gerrit.openafs.org/7206
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Currently, a couple of callers (rxi_ResetCall, and
rxi_AttachServerProc) will decrement rx_nWaiting only if
RX_CALL_WAIT_PROC is set for a call, and the call is on a queue
(presumably rx_incomingCallQueue). This can cause an imbalance in
rx_nWaiting if these code paths are reached when, in another thread,
rx_GetCall has removed the call from its queue, but it has not yet
cleared RX_CALL_WAIT_PROC (this can happen while it is waiting for
call->lock). In this situation, rx_GetCall will remove the call from
its queue, wait, and e.g. rxi_ResetCall will clear RX_CALL_WAIT_PROC;
neither will decrement rx_nWaiting.
This is possible if a new call is started on a call channel with an
extant call that is waiting for a thread; we will rxi_ResetCall in
rxi_ReceivePacket, but rx_GetCall may be running at the same time.
This race may also be possible via rxi_AttachServerProc via
rxi_UpdatePeerReach -> TryAttach -> rxi_AttachServerProc while
rx_GetCall is running, but I'm not sure.
To avoid this, decrement rx_nWaiting based on RX_CALL_WAIT_PROC alone,
regardless of whether or not the call is on a queue. This mirrors the
incrementing rx_nWaiting behavior, where rx_nWaiting is only
incremented if RX_CALL_WAIT_PROC is unset for a call, so this should
guarantee that rx_nWaiting does not become unbalanced.
Change-Id: I7dba4ba5f7cc33270c2d0f486b850fc0391927d1
Reviewed-on: http://gerrit.openafs.org/6986
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
In rxi_ReceivePacket, if the packet is for a client connection
and there is no call allocated, the conn->conn_call_lock was
leaked. Introduced by 95c38dff37.
Change-Id: Icfc10849c1da08d7c96d139b0a10d9ffe7ee57df
Reviewed-on: http://gerrit.openafs.org/7218
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Add an internal function to retrieve the local cell
name when the auth mutex is already held. Implement
afsconf_GetLocalCell in terms of the new internal
function.
Change-Id: I2f021a9966129e8e256b61d5219e7315b904ac0e
Reviewed-on: http://gerrit.openafs.org/6875
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Instead of attempting to CreateFile(OPEN_EXISTING) the _._AFS_IOCTL_._
file, try using GetFileAttributes() to obtain the attributes of the
file. The file doesn't exist in the directory listing but the
afs redirector and the afs smb server will respond to the request.
Perhaps the SMB servers in the broken printers will fail it.
Change-Id: I792bcc89c63871043ce6835a971de284fd754d54
Reviewed-on: http://gerrit.openafs.org/7210
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Query file attributes returned only the system attribute
and not the hidden attribute. Must return both.
Change-Id: Id29465adf3e3524b59c63b2e6f8ef482f536a0e1
Reviewed-on: http://gerrit.openafs.org/7209
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>