openafs.git
9 years agoFix buffer length validation in ktc_GetToken and knfs
Anders Kaseorg [Sun, 4 May 2014 09:30:25 +0000]
Fix buffer length validation in ktc_GetToken and knfs

The signed int tktLen is checked against a maximum size, then passed
as the unsigned size_t argument to memcpy.  So we need to make sure it
isn’t negative.

This doesn’t appear to be exploitable: tktLen comes from the kernel,
which should have previously validated the length within the SETTOK
pioctl.

This bug was found with STACK <http://css.csail.mit.edu/stack/>.

Change-Id: I781bd300cad3d725d3517e7f6ac9e6423c417087
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/11109
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agodoc: recommend cleanup steps in "vos convertROtoRW" man page
Ken Dreyer [Wed, 6 Mar 2013 20:53:29 +0000]
doc: recommend cleanup steps in "vos convertROtoRW" man page

vos convertROtoRW leaves the older RW copy on the original fileserver,
although it is no longer in the VLDB. Provide the user with some hints
regarding clean up.

Change-Id: I5f6fcf7d5a516b59438d84e60f163a567d3a64fd
Reviewed-on: http://gerrit.openafs.org/9408
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>

9 years agoFix typo in rfc3961 namespace-cleaning
Ben Kaduk [Mon, 9 Dec 2013 19:54:18 +0000]
Fix typo in rfc3961 namespace-cleaning

Change-Id: If93119ce4345ab8d1eccb9df7196b1681d2762cb
Reviewed-on: http://gerrit.openafs.org/10550
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agovol: Fix build with separate objdir
Benjamin Kaduk [Mon, 7 Apr 2014 21:55:09 +0000]
vol: Fix build with separate objdir

The volscan-main and volinfo-main source files are in the source
tree, not the object tree; refer to the objects in the Makefile
as dependencies, so that they will be picked up properly.  The
objects will be made just fine by the implicit .c.o rule.

Change-Id: Ieec4b32cfbe5d260e1560a08d4ed8162720f9222
Reviewed-on: http://gerrit.openafs.org/10988
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agolinux: make reading unixusers from proc actually work
D Brashear [Tue, 22 Apr 2014 15:38:44 +0000]
linux: make reading unixusers from proc actually work

our indentation did not match our braces so we would never read all the
objects in each unixuser hash chain. add the missing braces

Change-Id: I001b55f0d43639124b06758095664a31e8230db6
Reviewed-on: http://gerrit.openafs.org/11094
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agoNetBSD: fix rx_kmutex's CV_WAIT_SIG macro
Jonathan A. Kollasch [Thu, 17 Apr 2014 17:48:30 +0000]
NetBSD: fix rx_kmutex's CV_WAIT_SIG macro

Change-Id: I6550f5c71bafe03290c1dbda545ff3feea01a805
Reviewed-on: http://gerrit.openafs.org/11088
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

10 years agoWindows: Deny writes/truncation to files w RO attr
Jeffrey Altman [Fri, 4 Apr 2014 20:42:36 +0000]
Windows: Deny writes/truncation to files w RO attr

If the readonly file attribute is set on a file, refuse to process
writes, truncations or overwrites.   The afsd_service will do so
and this can lead to data corruption.

At the same time, writes from the redirector to afsd_service must
not be denied because of the readonly attribute.  That check was
performed during the CreateFile.   Otherwise, a new file can be
created with the readonly attribute and then not be writable.

Change-Id: I921a11eb8c1a3e642d60c23fc905b3febc0f0761
Reviewed-on: http://gerrit.openafs.org/10985
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: NP Fail requests if AFSGetAuthenticationId fails
Jeffrey Altman [Wed, 12 Mar 2014 16:49:40 +0000]
Windows: NP Fail requests if AFSGetAuthenticationId fails

If during the processing of a network provider request the Logon
Session AuthenticationId is zero and the AFSGetAuthenticationId()
function is unable to obtain the current thread's AuthenticationId,
then fail the request.

Change-Id: If2aeba836d762f4f1b982d954fac720863a05c1f
Reviewed-on: http://gerrit.openafs.org/10900
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: Fix AFSSetBasicInfo attribute processing
Jeffrey Altman [Tue, 15 Apr 2014 16:19:21 +0000]
Windows: Fix AFSSetBasicInfo attribute processing

The prior behavior of AFSSetBasicInfo() was to let the caller
set whatever it wanted as the new file attributes regardless of
the attributes that are supported by AFS.  In doing so, reparse
point and directory attributes could be cleared, and other values
could be set even though they would be lost as soon as the
DirectoryCB object was garbage collected.

New behavior:

1. return STATUS_INVALID_PARAMETER if reparse point attribute
   would be altered

2. return STATUS_INVALID_PARAMETER if directory attribute would
   be altered.

3. successfully modify readonly attribute

4. ignore all other attribute values

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

10 years agoWindows: Pin write position prior to defer
Rod Widdowson [Mon, 14 Apr 2014 20:50:36 +0000]
Windows: Pin write position prior to defer

If we extend the file prior to defrring the write *and* the write
is set up FILE_WRITE_TO_END_OF_FILE then we have to convert the
FILE_WRITE_TO_END_OF_FILE to an absolute position since we have
already moved the FCB->Header.FileSize.

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

10 years agoWindows: AFSCommonWrite add bWriteToEndOfFile var
Jeffrey Altman [Mon, 14 Apr 2014 20:48:32 +0000]
Windows: AFSCommonWrite add bWriteToEndOfFile var

To improve readability add a bWriteToEndOfFile variable which
stores the value of

  liStartingByte.LowPart == FILE_WRITE_TO_END_OF_FILE &&
  liStartingByte.HighPart == -1

Change-Id: I6594196a6c8c3ab41561ffdbd3eddf3d34b410de
Reviewed-on: http://gerrit.openafs.org/11068
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: Do not defer Synchronous operations
Rod Widdowson [Mon, 14 Apr 2014 20:45:37 +0000]
Windows: Do not defer Synchronous operations

There is nothing to be gained by posting a synchronous write.
Let it hang out in CcCopyWrite until there is enough memory
unless the write became synchronous after a deferral in which
case it can be deferred again.

Introduce bWait variable which is set to the result of
IoIsSynchronousWrite( Irp).

This change is being introduced after further analysis of the
FastFat example.

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

10 years agoWindows: No RO volume test SetFilePosInfo
Jeffrey Altman [Fri, 11 Apr 2014 14:22:45 +0000]
Windows: No RO volume test SetFilePosInfo

Setting the file position information on a file is not a data
changing operation.  Do not perform a readonly volume check.

Change-Id: I5dccff569b39187c2891d4339f18db8c54c029a7
Reviewed-on: http://gerrit.openafs.org/11066
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoFix rx_EndCall error precedence
Andrew Deason [Thu, 30 Jan 2014 19:50:11 +0000]
Fix rx_EndCall error precedence

Callers of rx_EndCall in various parts of the code handle errors a bit
differently from each other. The correct way to use rx_EndCall is
almost always some form of:

    code = rx_EndCall(call, code);

This will cause the call to abort with 'code' if the call is not
already aborted, and will return the abort code for the call (or 0 if
the call ended successfully). It is thus impossible for 'code' to
start out with a non-zero value in the code snippet above, and end up
with a value of 0 after the code snippet.

Most code follows this pattern, because this is how the
rxgen-generated client RPC wrappers are written. So for any non-split
Rx call, this is how the error precedence works.

However, some code (mostly for Rx split calls), needs to handle
calling rx_EndCall itself, and some code appears to think it is
possible for rx_EndCall to return 0 when we already had a non-zero
error. Such code tries to ensure that we don't ignore an error we
already got by doing something like this:

    code2 = rx_EndCall(call, code);
    if (code2 && !code) {
        code = code2;
    }

However, this is not correct. If a call gets killed with an abort code
partway through executing an RPC, and the client tries to end the RPC
with e.g. EndRXAFS_FetchData, the client will get an error code of
-451 (RXGEN_CC_UNMARSHAL). The actual error code is in the abort code
for the call, but with the above 'code2' snippet, we can easily return
an error of -451 instead, which will usually get interpreted as some
unknown network-related error.

This can manifest as a problem in the unix client, where if a
FetchData call fails due to, for example, an "idle dead" timeout, we
should result with an error code of RX_CALL_TIMEOUT. But because of
the above issue, we'll instead yield an error of -451, causing the
server to be marked down with the following message:

    afs: Lost contact with file server ... (code -451) ...

So, fix most rx_EndCall callers to follow the 'code = rx_EndCall(call,
code);' pattern. Not all of the changes here are to "wrong" code, but
try to make all of the rx_EndCall call sites look more consistent.
There are a few exceptions to this pattern, which warrant some
variations:

 - A few instances in src/WINNT/afsd/cm_dcache.c do seem to want to
   record the original error before we ran rx_EndCall, instead of
   seeing the rx abort code. We still return the rx_EndCall-returned
   value to the caller, though.

 - Any caller of RXAFS_FetchData* needs to read a 'length' raw from
   the rx split stream. If this fails, we need to abort the call, but
   we don't really have an error code to give to rx_EndCall. Failure
   to read a length indicates that the server is not following
   protocol properly, so give rx_EndCall RX_PROTOCOL_ERROR in these
   instances. The call should already be aborted by this point, so
   most of the time this code will be ignored; it will only make a
   difference if the server tries to end the call successfully without
   sending a length, which is indeed a protocol error.

 - Some Rx clients can encounter a local error they don't want to send
   to the server via an abort, so they just end the call successfully,
   and only use the rx abort code if they don't already have a local
   error. This is in a few places like src/butc/dump.c and
   src/volser/vsprocs.c.

 - Several places don't care what the error from rx_EndCall is, such
   as various call sites in server-side code.

The behavior of the Windows client w.r.t rx_EndCall was changed a bit
into its current behavior in commit
a50fa631cad6919d15721ac2c234ebbdda2b4031 (ticket 125018), which just
appears to be wrong. This was partially reverted by commit
ae7ef5f5b963a5c8ce4110a7352e0010cb6cdbc1 (ticket 125351), but some of
the other call sites were unchanged. The Unix client appears to have
been doing this incorrectly for at least FetchData calls since OpenAFS
1.0.

To make it hopefully more clear that rx_EndCall cannot return 0 if
given a non-zero error code, add an assert to rx_EndCall that asserts
that fact.

FIXES 127001

Change-Id: I10bbfe82b55b509e1930abb6c568edb1efd9fd2f
Reviewed-on: http://gerrit.openafs.org/10788
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agoMerge branch 'security-master' into HEAD 99/10999/1
Simon Wilkinson [Wed, 9 Apr 2014 13:10:09 +0000]
Merge branch 'security-master' into HEAD

Merge fix for OpenAFS-SA-2014-001 into master, along with the fix
for the RX denial of service issue.

Change-Id: I499e7202c9278d21f2d8628d497755e6c593abb2

10 years agoreadme: remove ancient build notes
Michael Meffie [Mon, 31 Mar 2014 16:59:59 +0000]
readme: remove ancient build notes

Remove the ancient and unmantained src/BUILDNOTES readme file.

Change-Id: I652fded2526dbe97f6f87ef7263a2b39038486d5
Reviewed-on: http://gerrit.openafs.org/10971
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agoafs: Raise fake free space reporting
Andrew Deason [Wed, 27 Mar 2013 23:12:41 +0000]
afs: Raise fake free space reporting

We report 'fake' values for free space, free file nodes, etc for the
'AFS' filesystem, since these values are not meaningful for AFS
itself. Currently we report about 9G of free space for most platforms,
and a few different values for a few others. Raise all of these to
2^32-1, so that trying to copy over 9G of data into AFS does not fail
for those applications that check the destination free space with
statfs(2). Note that one such application is KDE 4.8.x.

Consolidate all places that do this, and put the 'fake' value in one
place, AFS_VFS_FAKEFREE, along with the relevant comments.

Related issues reported by Lars Schimmer, Richard Brittain, and
others.

Change-Id: Ia15175da32744e11f62489c29bedfe1f5560d2b4
Reviewed-on: http://gerrit.openafs.org/9688
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Markus Koeberl <markus.koeberl@tugraz.at>
Tested-by: Markus Koeberl <markus.koeberl@tugraz.at>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agorx: Remove rx_waitingForPacket
Chas Williams (CONTRACTOR) [Thu, 3 Apr 2014 18:12:38 +0000]
rx: Remove rx_waitingForPacket

Commit f43c2f4412d670ce1131dc429cb43302352df3e4 introduced
rx_waitingForPacket.  Given its current usage, I can't see any
functionality.

It looks like this might have been the result of merging a renamed
rx_waitForPacket from another development branch?

Change-Id: I47fc7a2b25cbfcd59ea4ad1606b734bb9d4ceecc
Reviewed-on: http://gerrit.openafs.org/10981
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agopts: Don't assume that pr_IdToName() was successful
Chas Williams (CONTRACTOR) [Wed, 26 Mar 2014 14:25:13 +0000]
pts: Don't assume that pr_IdToName() was successful

If pr_IdToName fails for some reason, tnames won't be available.

Change-Id: I5270ba0ecf3cfad9bfb909c97b27473d96ca1307
Reviewed-on: http://gerrit.openafs.org/10952
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agoptserver: Optionally restrict anonymous access to the ptserver
Chas Williams (CONTRACTOR) [Wed, 26 Mar 2014 14:15:10 +0000]
ptserver: Optionally restrict anonymous access to the ptserver

Currently, one could simply query from 0 to 'pts listmax' to determine
all the usernames in a cell.  The -restrict_anonymous option will block
access to almost all of the unauthenticated RPC's.   PR_NameToID is still
open since aklog still needs access to this RPC.  An "attack" against
this RPC would have to scan a much larger key space to determine valid
usernames in a cell.

Change-Id: I7e475bc004f08d28d195c199804befa89f0ceb0c
Reviewed-on: http://gerrit.openafs.org/10951
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Gergely Risko <gergely@risko.hu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agoafs/VNOPS: reduce stack usage
Chas Williams (CONTRACTOR) [Fri, 28 Mar 2014 20:46:32 +0000]
afs/VNOPS: reduce stack usage

AFSFetchStatus is rather large and is in the stack twice.  Allocating with
osi_AllocSmallSpace will save about 160 bytes of stack.

Change-Id: I13ac31814d9d5975f245ba8c66a7befac471503e
Reviewed-on: http://gerrit.openafs.org/10964
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agoviced: fix get-statistics64 buffer overflow 98/10998/1
Michael Meffie [Sat, 15 Feb 2014 17:03:43 +0000]
viced: fix get-statistics64 buffer overflow

Range check the statsVersion argument of the GetStatisitics64 RPC to
avoid a buffer overflow in the fileserver, or a huge memory allocation,
by a rogue client.

FIXES 131803

Change-Id: Ib084ca28cbe350d846fa5978d489e523aaae299b

10 years agorx: Avoid rxi_Delay on RXS_CheckResponse failure 97/10997/1
Andrew Deason [Fri, 21 Feb 2014 21:30:49 +0000]
rx: Avoid rxi_Delay on RXS_CheckResponse failure

Currently we rxi_Delay whenever RXS_CheckResponse fails for any
reason. This can result in disastrous performance degradations if a
client keeps sending "bad" responses, since rxi_Delay'ing here will
delay the Rx listener thread. This means we cannot receive any packets
for about a second, which can easily cause us to drop a lot of
incoming packets.

Instead, send the abort after 1 second by scheduling an event. This
will retain existing behavior from the point of view of the client
(it will get the abort after 1 second), but avoids hanging the Rx
listener thread.

FIXES 131802

Change-Id: Id8f9fc46902ae3cf019dd0ece0a96133b9b9d07c

10 years agorx: Split out rxi_SendConnectionAbortLater 96/10996/1
Andrew Deason [Fri, 21 Feb 2014 21:26:35 +0000]
rx: Split out rxi_SendConnectionAbortLater

Take the functionality in rxi_SendConnectionAbort that schedules a
delayed abort, and split it out into a new function,
rxi_SendConnectionAbortLater. This allows callers an easy interface to
send such a delayed abort with their own delay.

This commit should incur no change in behavior; it is just code
reorganization.

Change-Id: I6503cf6ebb3e664d95b8792f2311ea14ee63c11d

10 years agoDisable kauth by default
Benjamin Kaduk [Fri, 28 Mar 2014 13:19:30 +0000]
Disable kauth by default

We should actively be discouraging the use of the kaserver and related
utilities.

The src/kauth/ directory will still be compiled, just not installed.
(If we stopped compiling it, it would likely bitrot very quickly so
as to become unbuildable, and having it still build seems a reasonable
goal given our obligations with respect to compatibility with IBM
AFS for the use of the AFS name.)

Change-Id: Ib710af3e177223d85cd9c6099ce75e700b6a2958
Reviewed-on: http://gerrit.openafs.org/10962
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agovolser: fix spurious strcat of volume extension.
Michael Meffie [Fri, 28 Mar 2014 16:08:46 +0000]
volser: fix spurious strcat of volume extension.

Fix malformed merge error left over from
commit 4f9ec8396d1c7f12f8fa264cea7c255ce62b7b8d
where we converted strcat to strlcat.

Change-Id: Ibae3e09c8a659f4b084256b18ee5774f11fe9f8f
Reviewed-on: http://gerrit.openafs.org/10963
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agoviced: disable hot threads
Michael Meffie [Thu, 27 Mar 2014 08:24:16 +0000]
viced: disable hot threads

Turn off the rx hot threads feature in the file server.  This feature
was an old optimization intended to reduce context switching, however
generally makes performance worse on modern hardware.

Performance improvements from disabling hot threads was identified by
Simon Wilkinson (YFS) at the European AFS and Kerberos Conference (EAKC)
2014 at CERN.

Change-Id: Id3053a61ebdb2d49d2bf36ebe07a35cc07b5d65c
Reviewed-on: http://gerrit.openafs.org/10957
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agodoc: bos setrestricted -mode 0 does make sense
Stephan Wiesand [Wed, 12 Mar 2014 09:47:17 +0000]
doc: bos setrestricted -mode 0 does make sense

Commit 070230ab76e1df338db3f2a7971111ca976a0c1a added documentation of
the mode parameter to bos setrestricted, claiming that the value 0 is
useless, and commit eee0bf5871944d919951cc8b7b4908ee909c3b62 added
documentation of the restrictmode entry in BosConfig, claiming that it
can only be set back to 0 with an editor. Both claims are wrong, since
bos setrestricted -mode 0 will do exactly that (if it succeeds, which
it only can if the server is running in unrestricted mode, which can
be achieved by sending it the FPE signal). Fix the man pages
accordingly.

Change-Id: I07b75f7d0cea2e247fa4f346121de258e35119f5
Reviewed-on: http://gerrit.openafs.org/10885
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agoviced: Restore some previous log message language
Andrew Deason [Wed, 26 Feb 2014 17:42:16 +0000]
viced: Restore some previous log message language

Before commit 6c41b1f740e16b5b9adfe9026630595be6f0699e, we logged
these three messages in the fileserver in different situations:

  CallPreamble: Couldn't get client.
  CallPreamble: Couldn't get CPS. Fail
  CallPreamble: couldn't reconnect to ptserver

After commits 6c41b1f740e16b5b9adfe9026630595be6f0699e and
0a5e878aa0a71c4dfaef1806744ed78bcc13b9f4, these messages were changed
to contain more useful information, but the language was also changed.
The messages now look like:

  Client host too busy while handling request from host %s:%d viceid %d fid %lu.%lu.%lu, failing request
  Cannot get CPS for client while handling request [...], failing request
  Cannot reconnect to ptserver while handling request [...], failing request

While the new messages are more informative, and (in my opinion)
better describe what is happening in those situations, they do look
very different from the old messages. This can break scripts that try
to parse these logs, but in general it is also not clear to
administrators that these messages still refer to the same events.

So instead, put these messages back the way they were. Still include
the extra information, of course, but revert the language to look more
like the old messages. Now we log:

  CallPreamble: Couldn't get client while handling request from host %s:%d viceid %d fid %lu.%lu.%lu, failing request
  CallPreamble: Couldn't get CPS while handling request [...], failing request
  CallPreamble: couldn't reconnect to ptserver while handling request [...], failing request

Thanks to Ben Kaduk for bringing this up.

Change-Id: Ie2389fb598640d79f0f0725c3161c7af7924ffb4
Reviewed-on: http://gerrit.openafs.org/10857
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agodoc: volscan man page
Michael Meffie [Thu, 13 Mar 2014 16:40:17 +0000]
doc: volscan man page

Provide a man page for the volscan utility

Change-Id: Ibaecb2b9030ee71d81f13b897694c4cf3b4b9516
Reviewed-on: http://gerrit.openafs.org/10905
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

10 years agovolinfo: separate volscan binary
Michael Meffie [Wed, 12 Mar 2014 19:15:32 +0000]
volinfo: separate volscan binary

Refactor vol-info.c into several files and change the makefile to
build a separate volscan binary, instead of using the program name
to determine if the user is running volinfo or volscan.

This commit adds new source files for the volinfo and volscan main()
function and a common header file.

Change-Id: I53a2a503812237a850170c39c81ee3fb56c8282e
Reviewed-on: http://gerrit.openafs.org/10903
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

10 years agovolinfo: refactor global options
Michael Meffie [Wed, 12 Mar 2014 13:37:59 +0000]
volinfo: refactor global options

Move the global options to a structure and pass it to the vol-info
functions. This is a precursor for creating separate volinfo and
volscan programs.

Change-Id: I86ea9e875f73831e6c7ea4b50591e31df3e0c39f
Reviewed-on: http://gerrit.openafs.org/10902
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

10 years agovolscan: hide -mask option
Michael Meffie [Sat, 15 Mar 2014 15:04:31 +0000]
volscan: hide -mask option

The -mask option is unneccessary and sets a bad precedent, so
deprecate and hide this option. The vnodes of interest can be found
can be found easily and much more flexibly with a simple command
pipeline.

Change-Id: Ibe75928c6b041d135c0cb5867228947cd7f4e889
Reviewed-on: http://gerrit.openafs.org/10901
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

10 years agovolscan: avoid printing null mount-point cellname
Michael Meffie [Wed, 4 Sep 2013 19:10:16 +0000]
volscan: avoid printing null mount-point cellname

The 'mcell' field is null when there is no cell set in the mount point,
so do not try to print it.

Change-Id: I363310665313f7bbcca783a4d9be87aaa7b0a8fe
Reviewed-on: http://gerrit.openafs.org/10226
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

10 years agoaklog: those pesky assignments in conditionals
Benjamin Kaduk [Thu, 6 Feb 2014 22:34:21 +0000]
aklog: those pesky assignments in conditionals

This one should actually be an assignment, and the compiler warning
for having two sets of parentheses is helpful.

Found by clang on FreeBSD 10.0.

Change-Id: Ic906cbdc50a20bcd0b91555581b60c518da2bc81
Reviewed-on: http://gerrit.openafs.org/10823
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agopioctl.c: removed unused variable
Benjamin Kaduk [Thu, 6 Feb 2014 21:11:49 +0000]
pioctl.c: removed unused variable

The 'rval' variable is only actually used in the LINUX20 case;
adding another conditional block is making the LINUX20 case
different enough that it should get split out entirely.
Doing so lets the 'else' clause be simpler.

Found by clang on FreeBSD 10.0.

Change-Id: I60c56af355fdb68752d9596ff2cd7a4259b43fe9
Reviewed-on: http://gerrit.openafs.org/10819
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agofs: display cell not available on ESRCH
Michael Meffie [Fri, 7 Feb 2014 14:55:31 +0000]
fs: display cell not available on ESRCH

The cache manager pioctls abuse ESRCH to represent errors due to
unavailable cell information.  Give a more sensible error message to
the user when a pioctl returns an ESRCH error, instead of "no such
process", which is the conventional meaning of ESRCH.

The new error message is consistent with the Windows implementation
of fs.

For example, on a host with a misconfigured ThisCell and/or CellServDB.

    $ fs wscell
    fs: No such process

becomes:

    $ fs wscell
    fs: Cell name not recognized.

Change-Id: Ibdcb0957118205b9540cae07b3cafa65c51ff497
Reviewed-on: http://gerrit.openafs.org/10824
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agolibafs: allow bkg daemon requests without creds
Michael Meffie [Thu, 6 Mar 2014 15:50:56 +0000]
libafs: allow bkg daemon requests without creds

Make the creds argument optional for background daemon
requests which do not need to pass a cred.

Change-Id: Ic4ac69d746e8a84993069e37bdd0440622febd70
Reviewed-on: http://gerrit.openafs.org/10880
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agolibafs: afs_SetupVolSlot function
Michael Meffie [Sat, 8 Mar 2014 19:30:27 +0000]
libafs: afs_SetupVolSlot function

Move the code block to get and setup volume slots out of
afs_SetupVolume to a new local function called afs_SetupVolSlot.
This new function acquires the afs_xvolume lock and releases it
before returning.

Change-Id: I1bd33f13e0525f9ff050d7e161cf29a511e5c4b8
Reviewed-on: http://gerrit.openafs.org/10879
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agolibafs: put volume disk cache i/o in afs_UFSGetVolSlot
Michael Meffie [Sat, 8 Mar 2014 17:35:23 +0000]
libafs: put volume disk cache i/o in afs_UFSGetVolSlot

Move the reading of the volume items file to the afs_UFSGetVolSlot()
to make it more clear the volume items file is not accessed when
memcache is in effect.

This changes the afs_GetVolSlot to return an intialized volume slot,
if one can be gotten.

Change-Id: I0c76ca8c8e1cc19677ce950bfb454755bbbee86a
Reviewed-on: http://gerrit.openafs.org/10878
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agolibafs: afs_InitVolSlot function
Michael Meffie [Sat, 8 Mar 2014 16:41:26 +0000]
libafs: afs_InitVolSlot function

Add a new local function to initialize newly gotten volume slots and
move that code out of afs_SetupVolume().  Initialize the slot before
putting the volume in the volume hash table list.

Make it more clear to avoid using record 0. The volume items record 0 is
not used, so avoid setting the tf pointer to the static fvolume buffer
when reading record 0.

Change-Id: Iffba52fbf8d72459c9a36015964e61d485f22ad4
Reviewed-on: http://gerrit.openafs.org/10877
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agocompile_et macros to generate source and headers separately
Michael Meffie [Sat, 1 Mar 2014 19:52:48 +0000]
compile_et macros to generate source and headers separately

Common makefile macros to generate headers and source files
separately using the new compile_et -emit option.

Change-Id: I5848922fbe1d94f9d3cec829a3ed657e7f63d191
Reviewed-on: http://gerrit.openafs.org/10869
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

10 years agoLinux: Do drop dentry if lookup returns ENOENT
Marc Dionne [Wed, 19 Mar 2014 15:15:13 +0000]
Linux: Do drop dentry if lookup returns ENOENT

Commit 997f7fce437787a45ae0584beaae43affbd37cce switched to using
d_invalidate instead of d_drop to prevent unhashing dentries
which are only temporarily invalid and may still be referenced
by someone having a current working directory pointing to it.
This could result in getting ENOENT from getcwd() after some
transient problems, even when the directory is there and
accessible.

The change had the side effect of potentially leaving something
visible when it has actually been removed, for instance a mountpoint
removed by "fs rm".

If afs_lookup returns ENOENT, we want to forcibly drop (unhash)
the dentry, even if it has current users.

Change-Id: I0e7b6e09b2c4ae551fa6c84235ed31f7df476b45
Reviewed-on: http://gerrit.openafs.org/10928
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agobcrypt keys are in the rxkad list, not the rxgk list
Benjamin Kaduk [Sat, 22 Mar 2014 19:28:46 +0000]
bcrypt keys are in the rxkad list, not the rxgk list

Fix the presumed typo in the loop intended to skip them.

Change-Id: I863fb12792b82d528938ad0598aa626880f11a41
Reviewed-on: http://gerrit.openafs.org/10947
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agovlserver: Add auditing to some more RPC's
Chas Williams (CONTRACTOR) [Fri, 21 Mar 2014 20:33:36 +0000]
vlserver: Add auditing to some more RPC's

A future commit will conditionally restrict access to these RPC's.
Auditing will allow debugging and monitoring of this feature.

Change-Id: Id8a8a1831c82ef967eb6cced1609915d1d6b774f
Reviewed-on: http://gerrit.openafs.org/10939
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agovolser: remove commented code
Chas Williams (CONTRACTOR) [Fri, 21 Mar 2014 18:35:46 +0000]
volser: remove commented code

Apparently this predates AFS 3.0 so it should be safe to remove.

Change-Id: Ifec145c71da4668066bf428fb594943dfce20e88
Reviewed-on: http://gerrit.openafs.org/10935
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agovos: GetServer search for non-loopback address
Jeffrey Altman [Sun, 15 Dec 2013 00:38:50 +0000]
vos: GetServer search for non-loopback address

GetServer() is used to obtain an IP address for the 'aname' parameter.
'aname' can be either a dotted address or a host name.   If it is a dotted
address, it is returned immediately.  If it is a host name, then
gethostbyname() is used to obtain an IP address.

The prior version of this function had two failings:

1. It assumed that a struct hostent only contained a single address.
   It used the former h_addr field.  For all platforms supported by
   OpenAFS h_addr is a macro referencing the first address in the
   h_addr_list array.  If h_addr was a loopback address, it would
   ignore any additional addresses that might be in the list.

2. It assumed that if gethostbyname(aname) returned a loopback
   address as h_addr that 'aname' must be referring to the machine
   that the vos command is being executed on.  It therefore used
   gethostname() to obtain an alternate name to use for a gethostbyname()
   query.  The results of this query were not checked to be a loopback.
   As a result, a loopback address could be returned to the caller which
   in turn could be set into the VLDB.

Change-Id: Ib8d513be9daf650045e9c40718b0187f6b9770a2
Reviewed-on: http://gerrit.openafs.org/10585
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Harald Barth <haba+gerrit@kth.se>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agolibadmin: add missing bubasics dependency
Michael Meffie [Sun, 19 Jan 2014 04:03:44 +0000]
libadmin: add missing bubasics dependency

bubasics is a dependency of libadmin. Add it to the top level
makefile.

This missing dependency was found by analyzing the libadmin header
file includes.

Change-Id: I300669387cea95a0fe800cffb4024356641591e6
Reviewed-on: http://gerrit.openafs.org/10727
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

10 years agolibafs: reset global icl set pointers on shutdown
Michael Meffie [Tue, 11 Mar 2014 16:40:33 +0000]
libafs: reset global icl set pointers on shutdown

Avoid panicking when an icl tracing function is called after
shutdown_icl.

There is a window during shutdown in which pioctls can be requested
after the shutdown_icl is issued. Reset the global icl set pointers
so tracing is disabled after the shutdown_icl, instead of using
pointers to freed memory.

Removed the unneeded afs_icl_FindSet calls and use the global
pointers which were set during the initialization.

Change-Id: I3310868a28850236a2870b8dab858ecb7a815c11
Reviewed-on: http://gerrit.openafs.org/10884
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agoMake struct CallBack indentation uniform again
Benjamin Kaduk [Wed, 19 Mar 2014 16:16:48 +0000]
Make struct CallBack indentation uniform again

Align the per-field comments.

Change-Id: Ic9da32851c518b29e110fb80428a1f261bbd9cbf
Reviewed-on: http://gerrit.openafs.org/10929
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agovolser: use also vn_length_hi in dump size calculation
Hartmut Reuter [Mon, 10 Mar 2014 16:21:21 +0000]
volser: use also vn_length_hi in dump size calculation

Only the low order 32 bits of the file length were used.
Now using macro VNDISK_GET_LEN instead of direct FillInt64.

FIXES 131819

Change-Id: Iaecd68764f4b071d6b8c838362e7e657578d9b2f
Reviewed-on: http://gerrit.openafs.org/10876
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agodoc: fix typo in volinfo man page
Michael Meffie [Sat, 15 Mar 2014 15:31:27 +0000]
doc: fix typo in volinfo man page

Change-Id: I46e13bb879206fb561fe0f0d99a6ed412ab64629
Reviewed-on: http://gerrit.openafs.org/10904
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>

10 years agolibafs: DARWIN: update for Xcode 5.1
Benjamin Kaduk [Fri, 14 Mar 2014 15:13:15 +0000]
libafs: DARWIN: update for Xcode 5.1

(1) remove -mlong-branch from amd64 build

Random internet postings suggest that it has triggered a warning
since at least Xcode 3.2, and the gcc manual page suggests that
it is only applicable on ppc, anyway.

(2) remove -mpreferred-stack-boundary=4 from the amd64 build

The evidence here shows up less readily in an internet search,
but it seems that Apple's compilers will force the stack alignment
to 16 bytes regardless of what is passed here.  One poster had
trouble with -mpreferred-stack-boundary being unused in Xcode 4.4.1

This change only fixes warnings reported as errors by buildbot; it
does not attempt to fully synchronize with the flags that Xcode 5.1
uses for kernel module builds.

Change-Id: Iac1fcf3cdb5ab847a04278d1c05761bd371828e2
Reviewed-on: http://gerrit.openafs.org/10896
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agoDo not use garbage-collection for DARWIN ObjC apps
Benjamin Kaduk [Thu, 13 Mar 2014 20:37:10 +0000]
Do not use garbage-collection for DARWIN ObjC apps

Xcode 5.1 does not support this feature.

Change-Id: I30457ae73f867637ab154b94d4a6c57089d9b48d
Reviewed-on: http://gerrit.openafs.org/10890
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

10 years agoUse correct include guard for vol_prototypes.h
Benjamin Kaduk [Thu, 13 Mar 2014 19:33:44 +0000]
Use correct include guard for vol_prototypes.h

Correct the case of the 'h'.

Change-Id: Ib78cbff02ac881aa54c46832db94094f7a74ff5f
Reviewed-on: http://gerrit.openafs.org/10889
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoRemove static const char copyright[]
Benjamin Kaduk [Thu, 13 Mar 2014 19:30:42 +0000]
Remove static const char copyright[]

We do not have copyright strings in our other executables for the other
copyright statements applicable to them, so these are rather exceptional.
They also cause build failures with OS X Xcode 5.1 and --enable-checking .

Change-Id: I0ead56387f77459a49093ff66fdea9c033f02f5a
Reviewed-on: http://gerrit.openafs.org/10888
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoopr: removed the unused static_inline initnode
Benjamin Kaduk [Thu, 13 Mar 2014 19:27:16 +0000]
opr: removed the unused static_inline initnode

This was included in the initial rbtree import, but is not used.

clang from OS X's Xcode 5.1 now warns about this unused function,
which is an error with --enable-checking .

Change-Id: I896504e83be317394418a7cc1b3f518e675fbb5b
Reviewed-on: http://gerrit.openafs.org/10887
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: Platform specific MIDL output
Jeffrey Altman [Sun, 16 Mar 2014 19:41:45 +0000]
Windows: Platform specific MIDL output

Add $(CPU) to the MIDL generated _c.c and _s.c output files
to prevent conflicts.

Change-Id: Ie10c85fa0b9cab19b107b44c2cf452925b8ee521
Reviewed-on: http://gerrit.openafs.org/10907
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: XP do not mark rdr devices as secure
Jeffrey Altman [Sat, 15 Mar 2014 16:44:09 +0000]
Windows: XP do not mark rdr devices as secure

Commit 9174531dca75f1f2d235ed806f784422792c3ab2 introduced the use
of device characteristics (secure and remote) to the IoCreateDevice()
and IoCreateDeviceSecure() calls for the AFSRedirector device objects.

After this change end users began to report problems on 32-bit Windows
XP SP3 when the initial access to the AFS redirector was performed by
a Limited Access Account.

This patchset conditionalizes the specification of the secure device
characteristic when registering the redirector with MUP on 32-bit
Windows XP.

Change-Id: I0fb9671b8a05a841f2356d100e7031c961a7c482
Reviewed-on: http://gerrit.openafs.org/10906
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: NP AFSGetConnectionInfo AuthId == 0
Jeffrey Altman [Wed, 12 Mar 2014 16:41:45 +0000]
Windows: NP AFSGetConnectionInfo AuthId == 0

During the processing of a network provider GetConnectionInfo request
if the provided Authentication Logon Session Id is zero, the redirector
should attempt to obtain the Logon Session Id in kernel.  This was
not performed within AFSGetConnectionInfo().

Change-Id: Ia060abfdebc17e52eefac24ac9dc19a7d6434314
Reviewed-on: http://gerrit.openafs.org/10899
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: NP AFSGetConnection retrieve AuthId sooner
Jeffrey Altman [Wed, 12 Mar 2014 16:39:59 +0000]
Windows: NP AFSGetConnection retrieve AuthId sooner

When processing a network provider GetConnection requestion obtain
the Authentication Logon Session Id earlier in the function so that
it can be logged as part of subsequent trace messages.

Change-Id: Ifef7d2da44e0266683b93bc76f25ee825294062c
Reviewed-on: http://gerrit.openafs.org/10898
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: AFSShareWrite do not assign pFcb too soon
Jeffrey Altman [Mon, 10 Feb 2014 10:13:37 +0000]
Windows: AFSShareWrite do not assign pFcb too soon

In AFSShareWrite the value of pFcb is used to determine whether
or not the pfcb->NPFcb->Resource must be released upon exit.
Therefore, it must not be assigned a value until just before the
resource is acquired.

Change-Id: I6951d91fcf672c8d236d19e075fff0be3552c9b8
Reviewed-on: http://gerrit.openafs.org/10828
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agobozo: remove obsolete bnode_Deactivate() prototype
Stephan Wiesand [Fri, 28 Feb 2014 17:47:12 +0000]
bozo: remove obsolete bnode_Deactivate() prototype

Commit 54eb2485b59550ba42569ed3a8d76211a3a35019 removed the
implementation of bnode_Deactivate(), which had been #ifdef'd out
for a long time, but left the prototype in place. Remove the
obsolete declaration in bosprototypes.h as well.

Change-Id: I323a3f945fcab97d7c4db191192d3ef11482d64e
Reviewed-on: http://gerrit.openafs.org/10868
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agodoc: improve man pages related to bos restricted mode
Stephan Wiesand [Fri, 7 Mar 2014 10:03:36 +0000]
doc: improve man pages related to bos restricted mode

Mention the restrictmode entry and the commands for setting and
querying it in the BosConfig man page, and add/fix cross references
between the BosConfig, bos, bos_getrestricted and bos_setrestricted
ones.

Change-Id: I938ef4c43c1a248335f09975c454b36f7570782c
Reviewed-on: http://gerrit.openafs.org/10874
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agocellconfig: move memcpy outside loop
Perry Ruiter [Thu, 6 Mar 2014 05:53:16 +0000]
cellconfig: move memcpy outside loop

memcpy only needs to be done once prior to each entry into loop,
so move it outside the loop.

Change-Id: I68c09b240756f830b1a4dc9b8a338916f91cd7b2
Reviewed-on: http://gerrit.openafs.org/10872
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agodoc: fix typo on ka-forwarder man page
Michael Meffie [Thu, 6 Mar 2014 16:42:52 +0000]
doc: fix typo on ka-forwarder man page

Change-Id: I9cedc1ee2c3fac249ad5b2c66c5e0eef6d5d570c
Reviewed-on: http://gerrit.openafs.org/10873
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: cm_ForceNewConnections serverp == NULL
Jeffrey Altman [Mon, 17 Feb 2014 06:12:37 +0000]
Windows: cm_ForceNewConnections serverp == NULL

If serverp == NULL, return immediately.  Do not dereference a NULL
pointer.

Change-Id: I47781a03f22a83289a23b30ff375249fec18ff51
Reviewed-on: http://gerrit.openafs.org/10845
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoredhat: don't package kpasswd
Stephan Wiesand [Thu, 21 Nov 2013 09:44:05 +0000]
redhat: don't package kpasswd

While kpasswd was in the separate openafs-kpasswd package to avoid
clashing with the krb5 executable, openafs-debuginfo still conflicted
with krb5-debuginfo.

Don't package kpasswd at all. Package the renamed executable, kapasswd,
in openafs-kpasswd instead of openafs, together with the renamed man
page. Once we're here, provide the man page for the other executable in
there too.

FIXES 131771

Change-Id: I0d7af82072847a19f0e1ce34dbeeb34623d2ef38
Reviewed-on: http://gerrit.openafs.org/10481
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agodoc: Document dependencies required for building everything
Garrett Wollman [Fri, 14 Feb 2014 04:03:59 +0000]
doc: Document dependencies required for building everything

Add a new section to README.DEVEL that describes the packages required
to build everything (including all optional code like the FUSE-based
user-mode client).  Start with what I figured out for FreeBSD (tested
on a clean 10.0 install) and what Russ Allbery described on the
openafs-devel list in
<https://lists.openafs.org/pipermail/openafs-devel/2014-February/019759.html>.

Change-Id: Ib90cd653a822f8699df613aabdd3442edc10c98a
Reviewed-on: http://gerrit.openafs.org/10844
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoafs_fetchstore: re-avoid uninitialized variable
Benjamin Kaduk [Wed, 5 Feb 2014 23:32:16 +0000]
afs_fetchstore: re-avoid uninitialized variable

As noted in the gerrit comments for change 10742, commit
baf6af8a8f2207ce39b746d59ca4bc661c002883 does not handle the case
where the second rx_Read() call fails, and the 'length' variable
can still be used uninitialized.

Instead of using an err label and jumping to it on the case of
errors, initialize length to zero and take care to neither
set nor access *alength if an error has occurred.  This is
more consistent with the style of the surrounding code while still
avoiding the use of an uninitialized variable.

Change-Id: I6abfa4a5f051368ca12ada1494fc7687f378d319
Reviewed-on: http://gerrit.openafs.org/10806
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agofstrace: only declare 'rval' when it is used
Benjamin Kaduk [Thu, 6 Feb 2014 22:27:28 +0000]
fstrace: only declare 'rval' when it is used

... to avoid compiler warnings about unused variables.

Found by clang on FreeBSD 10.0.

Change-Id: I30c9fbc0e2fb0f9af273f0f17861009b6d0577df
Reviewed-on: http://gerrit.openafs.org/10822
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoFBSD: Switch the dummy 'data' for mount(2)
Benjamin Kaduk [Thu, 6 Feb 2014 22:01:19 +0000]
FBSD: Switch the dummy 'data' for mount(2)

The mount(2) API takes a void*, but 'rn' is const char*, which
is const-incorrect.  Our vfs_cmount implementation ignores the 'data'
parameter, but upstream's kernel mount(2) implementation did
have a NULL check until r158611 (in the 6.1 or 7.0 timeframe),
so leave that comment for now.

Arguably we should be using nmount(2) instead of mount(2) anyway,
but leave that for a separate patch.

Change-Id: I22fd85c2f1a32aa849e182d263de119a953690d2
Reviewed-on: http://gerrit.openafs.org/10821
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agopointers are not castable to unsigned int
Benjamin Kaduk [Thu, 6 Feb 2014 21:22:49 +0000]
pointers are not castable to unsigned int

When printing a pointer's value for debugging purposes, use the
dedicated printf format specifier for pointers instead of assuming
that unsigned int ('x') is good enough.

Found by clang on FreeBSD 10.0.

Change-Id: I18c42df0bf03c2d0e9e7c757445b8ff0f616c671
Reviewed-on: http://gerrit.openafs.org/10820
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoSatisfy clang's aggressive strlcpy warnings
Benjamin Kaduk [Thu, 6 Feb 2014 20:52:49 +0000]
Satisfy clang's aggressive strlcpy warnings

Passing something related to the length of the source as the
length argument to strlcpy triggers a warning, which is converted
to an error with --enable-checking (on FreeBSD 10.0).  The current
code is safe, since it is using the same expression that was used
to allocate the destination buffer, but switch to using a separate
variable to hold the length and use that variable for both allocation
and copying, to appease the compiler.

Change-Id: I580083d142fd19a4e7828c915b4846868fa8f917
Reviewed-on: http://gerrit.openafs.org/10818
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoRemove unneeded inclusion of <sys/timeb.h>
Benjamin Kaduk [Thu, 6 Feb 2014 20:52:42 +0000]
Remove unneeded inclusion of <sys/timeb.h>

This file is deprecated on FreeBSD, and is not used anywhere.

Change-Id: If10816f26da91855d10826d53501e5b9974cd292
Reviewed-on: http://gerrit.openafs.org/10817
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: cm_GetCell_gen Fixup cm_server cellp on race
Jeffrey Altman [Thu, 23 Jan 2014 03:17:56 +0000]
Windows: cm_GetCell_gen Fixup cm_server cellp on race

If a race occurs during the instantiation of a new cm_cell_t object,
the created servers will point at the wrong cm_cell_t object after
the race is detected.  Before cm_GetCell_gen completes the cm_server_t
objects must be fixed to point to the correct cm_cell_t.

Change-Id: I8341c2cfd2a8ac7be31699d11f78b4b9ced257af
Reviewed-on: http://gerrit.openafs.org/10777
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: Support arbitrary callback ports
Jeffrey Altman [Fri, 31 Jan 2014 05:56:49 +0000]
Windows: Support arbitrary callback ports

Reconfigure the advanced firewall to support callback ports
other than port 7001.

This changes the semantics of the afsicf api.  AFS_PORTSET_SERVER is now
zero.  Any other value is treated as a callback port.

Change-Id: I4df421cc0ceb4dca94a6b5e81990115a4ce0334e
Reviewed-on: http://gerrit.openafs.org/10776
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: cm_AddCellProc always call cm_NewServer
Jeffrey Altman [Fri, 31 Jan 2014 05:49:44 +0000]
Windows: cm_AddCellProc always call cm_NewServer

The current implementation of cm_NewServer handles races and
collisions.  There is no need to perform a cm_FindServer() check
first.  Just call cm_NewServer() for all server entries.

Move the logging of server creation and cell assignment to
cm_NewServer().

Change-Id: If0cdb2eda9bcb6234eeaef7c2a35edf751a9c0ca
Reviewed-on: http://gerrit.openafs.org/10775
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agobos: Remove last of MRAFS references
Chas Williams (CONTRACTOR) [Thu, 6 Feb 2014 17:47:16 +0000]
bos: Remove last of MRAFS references

A few MRAFS tidbits were left behind during the cleanup in commit
a9301cd2dc1a875337f04751e38bba6f1da7ed32.

Change-Id: I7dcd30797ff87c61d57781c66cb9f7369638fa36
Reviewed-on: http://gerrit.openafs.org/10808
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agolibacl: use initialized memory
Arne Wiebalck [Fri, 7 Feb 2014 11:37:57 +0000]
libacl: use initialized memory

Replace malloc with calloc to use zeroed memory when converting access
lists.

Change-Id: I17558d1737fee020772919e423c9fba37180beca
Reviewed-on: http://gerrit.openafs.org/10815
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoafs: Throttle byte-range locks warnings per-file
Andrew Deason [Fri, 31 Jan 2014 22:46:12 +0000]
afs: Throttle byte-range locks warnings per-file

Currently, the warning messages about byte-range locks are throttled
only according to what the last PID of the locking process was. So, if
that same process performs a bunch of byte-range locks a bunch of
times, we log this warning message at most once every 2 minutes.

However, if we have even just one other process also performing
byte-range locks, the throttling can become pretty useless as
lastWarnPid ping-pongs back and forth between the two different PIDs.
This can happen if multiple unrelated byte-range-lock-using pieces of
software just happen to be running on the same machine, or if a piece
of software uses byte-range locks after forking into separate
processes.

To avoid flooding the log in situations like this, keep track of the
last warn time in the relevant vcache, so we don't get frequent
warnings for byte-range lock requests on the same file.

Change-Id: I446cf6a438a75aa741c5543b93f74f4184ee6508
Reviewed-on: http://gerrit.openafs.org/10796
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agonamei: Ignore misplaced files
Andrew Deason [Fri, 30 Aug 2013 19:21:16 +0000]
namei: Ignore misplaced files

The namei salvaging/ListViceInodes code currently ignores files where
we cannot derive an inode number from a given filename. However, if a
file is a valid inode filename, but is in the wrong directory, we
still record it. This can cause the salvager to abort, since it
assumes inode e.g. 12345 is present, but when it tries to open 12345,
namei translates the inode to a nonexistant path, and we bail out.

It is unknown how a namei directory structure can reach this state,
but try to handle it. To be on the safe side, just ignore the files,
and log a message about them. That way, if the files are required for
reconstructing the volume or contain important data, they are still
available if needed. And if they contain incorrect or old data, we
don't screw up the volume by trying to use them.

Thanks to Sabah S. Salih for reporting a related issue.

Change-Id: I529e0c51f48b5b7a62d6aab0470fad71788a5b69
Reviewed-on: http://gerrit.openafs.org/10214
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agosalvager: Handle multiple/inconsistent linktables
Andrew Deason [Thu, 3 Oct 2013 17:51:41 +0000]
salvager: Handle multiple/inconsistent linktables

The ListAFSSubDirs code in namei_ops.c currently detects
incorrectly-named linktable files, and whines about them and says the
salvager will handle them. However, the salvager doesn't really handle
them, since we just use the first linktable we find (FindLinkHandle)
without checking any of the information about it.

So, check for these. Fix FindLinkHandle to only consider a linktable
the "real" linktable to use if it actually matches the volume group id
we're salvaging. Also delete any inconsistent linktables via the new
function CheckDupLinktable later on.

Note that inconsistently-named linktables have been known to have been
created in the past due to a bug in the salvager (fixed by ae227049),
and possibly due to other unknown issues.

Change-Id: Iac461e1254e1f73406a2bc74eaa5a5f53d697304
Reviewed-on: http://gerrit.openafs.org/10322
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agovos: move convertROtoRW core logic to vsprocs
Mark Vitale [Fri, 15 Feb 2013 21:58:16 +0000]
vos: move convertROtoRW core logic to vsprocs

Create new vsprocs routine UV_ConvertRO in preparation for adding
new function to vos convertROtoRW.

Change-Id: Ic66ecbf7cacb277891bec9f8783040995ce6ce17
Reviewed-on: http://gerrit.openafs.org/9277
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agoRedHat: don't package manpages for binaries not included
Stephan Wiesand [Fri, 31 Jan 2014 16:01:06 +0000]
RedHat: don't package manpages for binaries not included

We don't package copyauth, aklog_dynamic_auth and rmtsysd.
Omit their manpages too.

Change-Id: I653e24be9ac258bcb1539bc773eebae728d6261b
Reviewed-on: http://gerrit.openafs.org/10781
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agoafs: Include FID in DoLockWarning
Andrew Deason [Fri, 31 Jan 2014 22:40:35 +0000]
afs: Include FID in DoLockWarning

Provide the FID that is being locked when we warn about byte-range
locks, so the user can find what file the process is trying to lock.

Change-Id: I56a185c200ac73045ee29b79410e27222c2637f2
Reviewed-on: http://gerrit.openafs.org/10795
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

10 years agoafs: Refactor DoLockWarning
Andrew Deason [Fri, 31 Jan 2014 22:36:44 +0000]
afs: Refactor DoLockWarning

Change DoLockWarning around a little bit, so subsequent changes are
easier to follow. Move lastWarnTime/lastWarnPid so they are only
usable within this function.

This commit should incur no functional change.

Change-Id: I5d25f64e9c088aecee0f0c46b6c401b2caa71ccb
Reviewed-on: http://gerrit.openafs.org/10794
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

10 years agoLinux: When revalidating, don't drop in-use dentries
Marc Dionne [Thu, 30 Jan 2014 18:50:37 +0000]
Linux: When revalidating, don't drop in-use dentries

The Linux client can get into a state where the current working
directory is seen as "deleted" by some tools, while it is still
there and accessible to "ls" and other tools.  This has been
reported by several users and sites.

One scenario that has been observed while debugging:
- A process does a chdir() into a directory
- This stores a pointer to the dir's dentry in the task structure
- The server hosting the volume goes offline temporarily
- The dentry for the directory is passed to afs_linux_dentry_revalidate
- afs_linux_dentry_revalidate calls afs_lookup which returns an
error (110 - ETIMEDOUT)
- It then considers the dentry not valid, and calls d_drop()
- d_drop unhashes the dentry unconditionally
- Server comes back up, but dentry is still unhashed
- getcwd() fetches the task structure pointer to the current dir
dentry.  If unhashed, it returns ENOENT, and the vfs layer is
not involved at all.

At that point, many things won't work and there is no obvious way
for the user to get the directory rehashed.

Instead of calling d_drop directly, call d_invalidate instead, as
it will only drop (unhash) the dentry if we're the only one holding
a reference.  Since d_invalidate will also call shrink_dcache_parent,
also remove that call from our code so it doesn't get called twice.

Change-Id: I03e9872f6f9aebd28cdf6b833e14955edaa2527c
Reviewed-on: http://gerrit.openafs.org/10774
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoLog shutdown progress
Arne Wiebalck [Fri, 10 Jan 2014 16:29:11 +0000]
Log shutdown progress

Shutting down fileservers with thousands of volumes can take a while and
it is helpful for operations to actually see that there is progress when
detaching volumes. This patch adds a log message to the fileserver log
every time 100 volumes have been detached.

Change-Id: I1685aa62335b223cf7cd3286188781318084c22f
Reviewed-on: http://gerrit.openafs.org/10797
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoafs: Pay attention to fetchOps->destroy error code
Andrew Deason [Thu, 30 Jan 2014 20:43:57 +0000]
afs: Pay attention to fetchOps->destroy error code

The ->destroy function in our fetchops could change our error code, or
even raise a new error. Don't ignore it. This currently doesn't do
much, since fetchDestroy currently won't change the error code if it's
given an error, but this can change in the future.

Change-Id: I6fa98cc709cb0fbd4c1e868ba4b9be53313573ff
Reviewed-on: http://gerrit.openafs.org/10787
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoWindows: Add caching to cm_GetAddrsU
Jeffrey Altman [Mon, 27 Jan 2014 05:33:18 +0000]
Windows: Add caching to cm_GetAddrsU

Cache the results of VL_GetAddrsU queries and reuse the results
for subsequent calls when possible.

Change-Id: I7e2b086ec311208a46439588bc820a1929d2b2b9
Reviewed-on: http://gerrit.openafs.org/10764
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: cm_GetAddrsU wrapper for VL_GetAddrsU
Jeffrey Altman [Mon, 27 Jan 2014 05:30:20 +0000]
Windows: cm_GetAddrsU wrapper for VL_GetAddrsU

cm_GetAddrsU() is a wrapper for the VL_GetAddrsU() RPC.  The initial
version is a bare bones replacement for the VL_GetAddrsU() call from
cm_UpdateVolumeLocation().  Future changes will add caching.

Change-Id: I7d51d98d8fd21b91f25424bdb795576ea44deab4
Reviewed-on: http://gerrit.openafs.org/10763
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: replace cm_allServersp list with osi_queue
Jeffrey Altman [Mon, 27 Jan 2014 05:14:36 +0000]
Windows: replace cm_allServersp list with osi_queue

Replace the cm_allServersp list with an osi_queue.  This simplifies
the Add/Remove functionality which will be required in case of VLDB
server uniquifier changes.

Change-Id: I6b118f2a27ee4bd2eb24011aae868865615eb09f
Reviewed-on: http://gerrit.openafs.org/10762
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoafs: Translate VNOSERVICE to ETIMEDOUT
Andrew Deason [Tue, 28 Jan 2014 00:03:59 +0000]
afs: Translate VNOSERVICE to ETIMEDOUT

Some fileservers will kill calls that are taking too long with the
VNOSERVICE abort code. Our logic for retrying calls is already aware
of this usage, but if we cannot retry the call, we still just return
VNOSERVICE as an error code to our caller.

Don't return this raw, since has the same value as ENOBUFS, which can
cause a confusing error message from logs or applications ("No buffer
space available"). Return ETIMEDOUT instead.

Change-Id: Ic16422585a10cda7f21646a27c92f690b131ce9b
Reviewed-on: http://gerrit.openafs.org/10766
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>

10 years agoafs: Fix afs_CheckCode identifier collision
Andrew Deason [Thu, 26 Dec 2013 22:17:44 +0000]
afs: Fix afs_CheckCode identifier collision

The last argument to afs_CheckCode should be unique so the call site
can be identified if fstrace is turned on. BStore and BPartialStore
were both using 43, so change BPartialStore to 430 to avoid the
collision.

Change-Id: I81a43ee41623fad10d0e70a7d9c8e6029aba30eb
Reviewed-on: http://gerrit.openafs.org/10635
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agoafs: Treat vc_error as a CheckCode-translated code
Andrew Deason [Thu, 26 Dec 2013 21:42:46 +0000]
afs: Treat vc_error as a CheckCode-translated code

The vcache field vc_error is generally treated as an error code that
has been translated through afs_CheckCode, but this is inconsistent in
a few places. Fix this in a few ways:

 - Adjust afs_nfsrdwr so we do not call afs_CheckCode on vc_error,
   translating the error code twice.

 - Change afs_close to store vc_error in code_checkcode, and have the
   logging code check for specific values in code_checkcode as well.
   Log unknown values of code and code_checkcode, so we can
   distinguish between e.g. a 'code' value of VBUSY, and a
   'code_checkcode' value of ETIMEDOUT.

Change-Id: Iab4928efd183fb6c5b0b0f30375b9952ba13b45a
Reviewed-on: http://gerrit.openafs.org/10634
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

10 years agolibadmin: add header file deps
Michael Meffie [Sun, 19 Jan 2014 03:40:12 +0000]
libadmin: add header file deps

Add the missing header file dependencies to the library targets.
This is needed for parallel make.

Change-Id: I60d60e68ef808a62b4063a6106672f5178c1b605
Reviewed-on: http://gerrit.openafs.org/10726
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agolibadmin: use INSTALL_DATA to export headers
Michael Meffie [Fri, 22 Nov 2013 18:36:54 +0000]
libadmin: use INSTALL_DATA to export headers

Use the INSTALL_DATA macro instead of cp to export
header files.

Change-Id: Ia460d8227f2fb2f594793a01c27f64ff7ce45273
Reviewed-on: http://gerrit.openafs.org/10515
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agolibadmin: makefile rule for afs_AdminError.h
Michael Meffie [Sun, 19 Jan 2014 03:01:59 +0000]
libadmin: makefile rule for afs_AdminError.h

Add a makefile rule to export the libadmin afs_AdminErrors.h header
file, instead of exporting afs_AdminErrors.h as a side effect of
generating the afs_AdminBosErrors error table.

Add the missing afs_AdminErrors.h dependency to the afs_utilAdmin.o
dependency list.

Change-Id: Ib8c7d22d705061615fb20a6a521dc20f0f1d6da0
Reviewed-on: http://gerrit.openafs.org/10369
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agolibadmin: remove duplicate dependency
Michael Meffie [Sun, 19 Jan 2014 02:56:36 +0000]
libadmin: remove duplicate dependency

afs_AdminPtsErrors.h was listed twice in the dependency
afs_utilAdmin.o dependency list.

Change-Id: I4bf37d0502e26e05f912a136045814e32de73c4a
Reviewed-on: http://gerrit.openafs.org/10725
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>