Commit Graph

12188 Commits

Author SHA1 Message Date
Andrew Deason
05217c2917 rx: Ignore responses to nonexistent challenges
Consider the following situation:

 - A client sends a data packet to a server, using a security class
   that requires a challenge
 - The server responds with a challenge
 - The server is restarted
 - The client responds to the challenge with a response

In that situation, the server will process the response, but since the
server was restarted, it has no knowledge of the challenge that was
sent. This generally means that we error the connection, since the
given response is not valid. For rxkad with modern endpoints, this
results in an RXKADPACKETSHORT error, since we interpret the response
as an 'old' response, but it's actually a 'v2' response, so we
interpret the fields in the response as garbage.

This means that the client gets a connection error when the client did
nothing wrong, and there's no way for the client to distinguish this
from a real connection error.

One way to solve this would be to send a Challenge packet to the
client immediately when we detect that this situation has occurred.
However, if we do that, then we never see a data packet with a
checksum, so we fall back to using "old" challenges and responses. And
in general, that would cause the server side to never see a data
packet during the connection negotiation, which is unusual and I am
concerned there may be other niggles of odd behavior that may occur in
that scenario.

So instead, to fix this, make the server ignore responses in this
situation (that is, if we haven't sent out any challenges yet).
Clients will eventually resend the data packet, and we will go through
negotiating the connection security like normal. This should never
cause any new problems, since dropping a challenge packet must be
handled anyway (sometimes packets just get dropped). And a client will
never hang on sending the same response over and over again; clients
only ever send a Response in response to a Challenge packet.

Change-Id: Id3fae425addb2ac8ab60965213b3ebca2e64ba5d
Reviewed-on: http://gerrit.openafs.org/10315
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2015-01-04 21:39:18 -05:00
Michael Meffie
3b9d52b2e8 vldb_check: rebuild free list with -fix
Rebuild the vldb free chain in addition to the hash chains when
vldb_check is run with the -fix option.  Print a FIX: message for
entries added to the free chain.

Example vldb with a broken free chain.

    $ vldb_check vldb.broken
    address 199364 (offset 0x30b04): Free vlentry not on free chain
    address 223192 (offset 0x36818): Free vlentry not on free chain
    address 235180 (offset 0x396ec): Free vlentry not on free chain
    Scanning 1707 entries for possible repairs

    $ vldb_check -fix vldb.broken
    Rebuilding 1707 entries
    FIX: Putting free entry on the free chain: addr=199364 (offset 0x30b04)
    FIX: Putting free entry on the free chain: addr=223192 (offset 0x36818)
    FIX: Putting free entry on the free chain: addr=235180 (offset 0x396ec)

Thanks to Kostas Liakakis for reporting this bug.

Change-Id: I57d6b17263ffe5f8818f70f8260a0dce8d85ab1f
Reviewed-on: http://gerrit.openafs.org/11598
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2015-01-04 21:30:03 -05:00
Andrew Deason
9de36a0398 RedHat: Update configure options, again
Commit 83f85c9ad6 updated the arguments
we give to configure, since --enable-disconnected and --with-krb5-conf
no longer exist. But, it only updated the configure options for the
userspace configure, and did not update the configure invocation for
building kmod kernel modules.

Update the other configure invocation, so they match and both of them
avoid using outdated configure options.

Change-Id: Ia7fe16a373b5feabd4060bd85fbf9220407082f5
Reviewed-on: http://gerrit.openafs.org/10623
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2015-01-04 21:26:25 -05:00
Chas Williams (CONTRACTOR)
24f0fdcce4 uss: Make the uss parser private
Attempt to make the parser in uss private so that it doesn't
conflict with other libraries that might leak their parser symbols.

Change-Id: I15b52f55b419b3bbc788ced9660bc41163e2be36
Reviewed-on: http://gerrit.openafs.org/11533
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2015-01-04 21:24:48 -05:00
Nathaniel Wesley Filardo
c11c58646f Linux: get sysname even if kernel module disabled
Fall back to `uname -r` if we aren't probing for kernel sources,
as we still need to know for the rest of the build.  While this
could be worked around by explicitly passing the sysname as an
argument, this seems friendlier.

Change-Id: I0db75ba5fc7d1f5ec08d27dfce6858b968b6ce28
Reviewed-on: http://gerrit.openafs.org/11552
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-01-04 21:24:13 -05:00
Marc Dionne
b22c586bcd Unix CM: Avoid using stale DV in afs_StoreAllSegments
It was reported in RT 131976 that on Linux some file
corruption was observed when doing mmap writes to
a file substantially larger than the cache size.

osi_VM_StoreAllSegments drops locks and asks the OS to flush
any dirty pages in the file 's mapping.  This will trigger
calls into our writepage op, and if the number of dirty
cache chunks is too high (as will happen for a file larger
than the cache size), afs_DoPartialWrite will recursively
call afs_StoreAllSegments and some chunks will be written
back to the server.  After potentially doing this several
times, control will return to the original afs_StoreAllSegments.

At that point the data version that was stored before
osi_VM_StoreAllSegments is no longer correct, leading to
possible data corruption.

Triggering this bug requires writing a file larger than the
cache so that partial stores are done, and writing enough
data to exceed the system's maximum dirty ratio and cause
it to initiate writeback.

To fix, just wait until after osi_VM_StoreAllSegments to
look at and store the data version.

FIXES 131976

Change-Id: I959f06b5a7a51171e7ed70189620e9d11d52efa2
Reviewed-on: http://gerrit.openafs.org/11644
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-12-26 12:00:31 -05:00
Michael Meffie
4f03d6e07b doc: document the vldb free list
Document vldb free list in the vldb format (vldb.txt). The nextIdHash[0]
is on the free chain when the vl entry is free.

Also fix two typos in vldb.txt.

Change-Id: I5d79f55214295e029e7174ef46838afd7dc44bf1
Reviewed-on: http://gerrit.openafs.org/11597
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-12-17 10:55:48 -05:00
Andrew Deason
54c0ee608f afs: Fix some afs_conn overcounts
The usual pattern of using afs_Conn looks like this:

  do {
      tc = afs_Conn(...);
      if (tc) {
          code = /* ... */
      } else {
          code = -1;
      }
  } while (afs_Analyze(...));

The afs_Analyze call, amongst other things, puts back the reference to
the connection obtained from afs_Conn. If anything inside the do/while
block exits that block without calling afs_Analyze or afs_PutConn, we
will leak a reference to the conn.

A few places currently do this, by jumping out of the loop with
'goto's. Specifically, in afs_dcache.c and afs_bypasscache.c. These
locations currently leak references to our connection object (and to
the underlying Rx connection object), which can cause problems over
time. Specifically, this can cause a panic when the refcount overflows
and becomes negative, causing a panic message that looks like:

  afs_PutConn: refcount imbalance 0xd34db33f -32768

To avoid this, make sure we afs_PutConn in these cases where we 'goto'
out of the afs_Conn/afs_Analyze loop. Perhaps ideally we should cause
afs_Analyze itself to be called in these situations, but for now just
fix the problem with the least amount of impact possible.

FIXES 131885

Change-Id: I3a52f8ccef24f01d04c02db0a4b711405360e323
Reviewed-on: http://gerrit.openafs.org/11464
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-12-17 10:55:04 -05:00
Chas Williams (CONTRACTOR)
604f1eece6 doc: fix unbalanced <listitem> in AdminGuide/auagd018.xml
This was introduced by c04c57c6c5

Change-Id: I2dbc558bf97673074c774b457b53b4a4436b43c1
Reviewed-on: http://gerrit.openafs.org/11624
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-17 10:54:30 -05:00
Chas Williams (CONTRACTOR)
5cc3920ce4 doc: fix duplicate tag usage in QuickStartUnix
The duplicate LIWQ54 tag appears to break newer versions of fop.  Since it
isn't referenced by anything, just remove in both instances.

Change-Id: Ie996f0110a9114399a1873ebda1eba4c7696f716
Reviewed-on: http://gerrit.openafs.org/11623
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-17 10:54:22 -05:00
Chaskiel Grundman
5e3df1d99d rxgen: Only cast array/pointer/vector types
Assuming the correct values are passed to the xdr functions, no casts
are required. Don't cast simple/struct/union/typedef values. Do cast
array/pointer/vectors, since the relevant xdr wrapper functions expect
char *.

Change-Id: I375c03899576735668c1a0df0af47377223ae97a
Reviewed-on: http://gerrit.openafs.org/10260
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-17 10:51:53 -05:00
Chaskiel Grundman
b7bfd3aa27 rxgen: Always pass aliases (typedefs) as pointers
Since prototypes were introduced, xdr functions for typedef foo
expect a foo *, never a foo, even if the underlying type is an array.
print_param (for stubs) got this right, but print_stat (for inter-xdr
calls) did not.

Change-Id: I2b12aaf919fd39e6195d85072fdfd915a1c509f0
Reviewed-on: http://gerrit.openafs.org/10259
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-17 10:51:44 -05:00
Chaskiel Grundman
1c445cc7e5 Remove sunrpc compatibility
Remove sunrpc compatibility from rxgen. It's not tested, and
rpcgen is available from other sources. This will allow changes to be
made to rxgen without worrying about their impact on rpcgen compatibility.

Removals consist of the -l, -m, and -s switches, the source files
rpc_clntout.c and rpc_svcout.c, and the scan tokens 'program' and
'version'. The -R switch ('R compatibility') is also removed, as it's
a noop.

Change-Id: I960fac14faf072d221b8cb166e9388ab4accfa26
Reviewed-on: http://gerrit.openafs.org/10258
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-17 10:51:33 -05:00
Chas Williams (CONTRACTOR)
4d72af9fbd vlserver: Refactor auditing
Refactor auduting to be more like other uses in the code base.
Auditing is now done in a wrapper.

Change-Id: I491aeda31c223e594e3870573871ae10a541d010
Reviewed-on: http://gerrit.openafs.org/11315
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-17 10:50:01 -05:00
Michael Meffie
75d67780b4 redhat: do not overwite the server CellServDB
The bosserver creates a pair of symlinks in the client's configuration
directory (/usr/vice/etc) during startup, if the configuration files are
not present:

  /usr/vice/etc/CellServDB -> /usr/afs/etc/CellServDB
  /usr/vice/etc/ThisCell -> /usr/afs/etc/ThisCell

Due to a bug in the bosserver (which is not fixed on 1.6.x), the
symlinks are only created when the /usr/vice/etc directory already
exists when the bosserver is started.

If the bosserver is started before the client is installed (and the
/usr/vice/etc directory is present), then the packaging script will
write to the symlink CellServDB, overwriting the server's CellServDB with
the contents of the client's CellServDB.local and CellServDB.dist files.
Also, if the client is started after the bosserver creates the symlinks,
the client init script will overwrite the server's CellServDB with the
contents of the client's CellServDB.local and CellServDB.dist files.

Update the packaging and the client init script to delete this symlink
if present, since it is only intended to provide stub configuration
for the client utilities while setting up an initial server.  Then,
the updating of the CellServDB will create a local file, instead of
following the symlink and overwriting the server CellServDB.

While here, adjust the indentation whitespace to match the tabs below.

Change-Id: I802fd8d85f73946ca8d8d57e115abb8ae6958196
Reviewed-on: http://gerrit.openafs.org/11601
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-14 22:40:07 -05:00
Andrew Deason
de1ac7daff afs: Add xvcache-related afs_FlushVCache comments
Add a couple of comments to help make it explicit when it is okay to
drop afs_xvcache here.

Change-Id: I451ffe80755ea471322e32017f71c0619e6a8e63
Reviewed-on: http://gerrit.openafs.org/7436
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-12 16:58:16 -05:00
Andrew Deason
73bfe94802 afs: Remove 'slept' from osi_VM_FlushVCache
No implementation of osi_VM_FlushVCache drops and reacquires
afs_xvcache. Doing so would cause problems when afs_FlushVCache calls
osi_VM_FlushVCache, since someone could grab a reference to the vcache
while xvcache is dropped. So, prohibit dropping and reacquiring
afs_xvcache in osi_VM_FlushVCache, and remove the 'slept' argument to
it.

Change-Id: I50b4ee35f54a5277749f44e93b1094e4fb5c93e9
Reviewed-on: http://gerrit.openafs.org/7435
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-12 16:58:05 -05:00
Perry Ruiter
2b10d96762 afs: Correct routine name on error message
While studying some code I noticed one of the error messages in
afs_UFSGetVolSlot was prefixed with a different routine name.
More shocking was that git blame fingered me as the last person
to update that line!  Indeed I had but I hadn't noticed, nor had
my reviewers, the mis-matched routine name.

Update afs/afs_volume.c to correct routine name.

Change-Id: Id7ee275c9f8991bb71082b9dfcd52c14ead83955
Reviewed-on: http://gerrit.openafs.org/11625
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>
2014-12-08 22:13:13 -05:00
Chas Williams (CONTRACTOR)
dc4d9d6434 afs: Remove AFS_BOZONLOCK_ENV
The only user of AFS_BOZONLOCK_ENV is ppc_darwin_80.  This was added
to the param file by commit:

    commit 379e3be319
    Author: Derrick Brashear <shadow@dementia.org>
    Date:   Sun Jun 19 00:20:01 2005 +0000

        ppc-darwin80-20050618

        this is actually a throwaway

It isn't clear to me what the intent was.  Darwin clearly isn't
using the Bozon lock around every osi_FlushPages() despite comments
in DARWIN/osi_vnodeops.c about said lock.   The possibility of the
Bozon lock being required only ppc_darwin_80 and not ppc_darwin_70 and
ppc_darwin_90 is unlikely.

The comments about the Bozon lock in FBSD/osi_vnodeops.c appears to be
a copy/paste from DARWIN's.  Curiously, FBSD doesn't drop the GLOCK()
when osi_FlushPages() calls osi_VM_FlushPages() despite a comment to
the contrary in osi_VM_FlushPages().

Also, instead of editing the alpha_dux param files, just remove them.
Nothing is using them.

Change-Id: Ic1f6aabd82b9bd3686c95fd501a9d72163595421
Reviewed-on: http://gerrit.openafs.org/11108
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-07 12:26:13 -05:00
Chas Williams (CONTRACTOR)
2725a4ca14 budb: Avoid use of anonymous structures to determine size
Change-Id: Ife337e4e020a0450020f9ae641b1711435b936c4
Reviewed-on: http://gerrit.openafs.org/8153
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-12-06 19:55:40 -05:00
Marc Dionne
49088ad21a volser: Break callbacks to the target of VolClone
With the "-stayup" release mechanism, clients may have callbacks
to the target of VolClone rather than the target of VolRestore,
so also break callbacks there.

This could cause clients to not be notified of a volume release
done with -stayup and have stale contents.

Change-Id: I94009f4b9382471a3615d2a729e4ee3955a14d44
Reviewed-on: http://gerrit.openafs.org/11619
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-12-06 19:54:09 -05:00
Benjamin Kaduk
c47d619f6c Remove FreeBSD packaging
The packaging used by official FreeBSD package builds is taken from
the FreeBSD Ports Collection's version control, which is currently
available at https://svnweb.freebsd.org/ports/head/net/openafs/ .

The version of the FreeBSD packaging in the openafs repository
will almost always be out-of-date and is not needed by FreeBSD
(although a small portion of it is currently used by the upstream
FreeBSD packaging), and the actual packaging used by FreeBSD is
easily available, so there is no purpose in maintaining FreeBSD
packaging in the OpenAFS source code repository.

Change-Id: I969cd6933ecd56d6940b8d48da67f50260101571
Reviewed-on: http://gerrit.openafs.org/11622
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-12-05 21:57:50 -05:00
Benjamin Kaduk
e34e0d149f Remove Debian packaging
The packaging used for uploads to Debian is maintained on Debian
infrastructure, presently at
http://anonscm.debian.org/cgit/pkg-k5-afs/openafs.git .

The packaging repository for any given Debian openafs source
package will be listed in the Vcs-* fields in the package's
control file.

The version of the Debian packaging in the openafs repository
will almost always be out-of-date and is not used by Debian,
and the actual packaging used by Debian is easily available, so
there is no purpose in maintaining Debian packaging in the OpenAFS
source code repository.

Change-Id: I23011315ece011e32cdddd992c4f8a176e348c67
Reviewed-on: http://gerrit.openafs.org/11621
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-12-05 21:57:32 -05:00
Sami Kerola
a4dc1d8fc0 build-sys: make docbook path find easier to read
Additional gain, when horizontal lists are converted to vertical, is that
each item will be individually version controlled.

Change-Id: I4f12efac9c3d828fafdc7ab8a15740cfb0276538
Reviewed-on: http://gerrit.openafs.org/10014
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-04 18:54:36 -05:00
Nathaniel Wesley Filardo
72ca1e876f Make all VLDB interactions use VLF/VLSF names
src/volser/volser.p.h defined the values used in VLDB entries.  These values
appear (by exhaustive walk of source and by inspection of the volser's rxrpc
api) to be unused by any aspect of the volser and were solely used in
communication with the VLDB.

This patch deletes the misplaced definitions and moves the entire tree to
use the VLF_{RW,RO,BACK}EXISTS and VLSF_* macros from vlserver/vldbint.xg .
No include wrangling was needed; these definitions have always been in scope
but relatively unused.

It also serves to head off a potential problem, which actually motivated the
whole thing: ITSRWREPL was 0x10, which was claimed as VLSF_UUID;
VLSF_RWREPLICA is 0x40, which did not have an ITS equivalent.  As ITSRWREPL
was not used, this had never shown itself in operation.  There was no ITS
semantic equivalent of VLSF_UUID.

Change-Id: I60426c2635976b9ac34bf820a8aec7a0c8575e20
Reviewed-on: http://gerrit.openafs.org/11331
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-12-04 18:43:08 -05:00
Nathaniel Wesley Filardo
e331ee87a3 DeleteVolume should check ITSROVOL as a bit
Other bits may be asserted even if this is a RO vol.

Change-Id: Iff5256db25502b61b161ec068bd9d2a389f796c7
Reviewed-on: http://gerrit.openafs.org/11617
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-04 18:41:24 -05:00
Nathaniel Wesley Filardo
a36aab0dd6 Revert "vos-sync-flag-voltype-properly-20080521"
The convention appears to be that ITSRWVOL is the correct flag for
the backup volume.

This reverts commit dcafea769a.

Change-Id: I0f88107d56817515f41a68062053b263683afc94
Reviewed-on: http://gerrit.openafs.org/11341
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-04 18:37:59 -05:00
Sami Kerola
654f9e4ad4 build-sys: reindent AC_ARG_WITH section in acinclude.m4
Change-Id: I80b68eeecf9f72ac7f2ce133d9a5642a67dde22c
Reviewed-on: http://gerrit.openafs.org/10013
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-04 17:33:02 -05:00
Andrew Deason
2f2e6effa7 namei: Remove icreate tfd hack
Currently, the namei icreate routine creates a fake FdHandle_t for a
SetLinkCount call if we're creating a linktable. In the past this was
probably done because we did not want to open a "real" fdP ,since that
would mean opening another file descriptor, when we already had a file
descriptor (from the creating afs_open call).

This is a problem in the salvager, since it means that we can reach
ihandle code before the ihandle package has been initialized.
Specifically, we can reach icreate -> namei_SetLinkCount -> ih_fdsync.
If we reach ih_fdsync without the ihandle package being initialized,
we assert and dump core.

The ihandle package assumes that we've already initialized it if we
reach any ihandle code, since creating any IHandle_t causes the
package to initialize. But since namei_icreate fakes its own IHandle_t
and FdHandle_t structures, that doesn't happen.

So, to avoid this, stop faking our FdHandle_t and create a real one.
Since we have ih_attachfd, we can create a real FdHandle_t with our
existing file descriptor.

Change-Id: I7a8c1e0ed1ee8e5c8ce2e165b9493811d5d2435d
Reviewed-on: http://gerrit.openafs.org/10213
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-03 01:13:17 -05:00
Mark Vitale
47a1a78678 kauth: fix klog principal name parsing
If a principal name is specified to the klog command, it is not
correctly passed in the pw structure.  This in turn causes
uninitialized storage to be passed to ka_UserAuthenticateGeneral.
This may either lead to a segmentation fault in klog, or cause
garbage to be passed to the kaserver, leading to garbage in some
log and audit messages.  In all cases it is impossible to authenticate
to kaserver with a specified principal name.  However, klog
still works correctly when no principal name is specified.

This was introduced by commit 68ce3aa814
which removed lclpw to eliminate a clang warning.  However, the clang
warning was misleading in this case, as lclpw was actually used
(confusingly) to indirectly update the pw structure.

Instead of reverting this commit, just update pw->pwname directly.

Change-Id: I565360c6e2f970637422e8b01998d3fc29874ec4
Reviewed-on: http://gerrit.openafs.org/11145
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-12-03 01:10:33 -05:00
Chas Williams (CONTRACTOR)
01917b4497 auth: Clean up and document functions in netrestrict.c
Clean up and document parseNetRestrictFile_int and ParseNetInfoFile_int
in preparation for some future changes.

Change-Id: I3c8f1823ba1e042fb6ae68c6f0aba58128ef5b81
Reviewed-on: http://gerrit.openafs.org/11312
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-03 01:06:11 -05:00
Nathaniel Wesley Filardo
185966b471 Export xdr_nbulkentries in liboafs_vldb
Change-Id: Id6ba0e4fdb802cc10aa98b32d7e7c9b605c90606
Reviewed-on: http://gerrit.openafs.org/11334
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-03 01:05:27 -05:00
Christof Hanke
35247b0adb liboafs_util: export symbols for tabular_output
Otherwise compilation fails on AIX.

Change-Id: Id22b7726d9aa56f9a2e0665257b3099baf774896
Reviewed-on: http://gerrit.openafs.org/10326
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-03 01:02:47 -05:00
Andrew Deason
cd8f24d9a1 doc: Document fs listquota 2TB partition limit
We have previously documented that volumes over 2TB can result in
inaccuracies, but this documentation does not say how the 'partition'
field in "fs listquota" can be inaccurate. It is confusing to see a
usage of 0% for a partition that you know is being used, so try to
briefly explain in what way this field is inaccurate.

The reason we _under_-report the partition usage is that the
fileserver actually gives back PartBlocksAvail and PartMaxBlocks (not
"blocks used" and "blocks total"). So 1TB used and 4TB total is
truncated to 2TB and given back as 2TB free and 2TB total. One we hit
3TB used we'll report it as 1TB free 2TB total (50%) when the actual
usage is 75%.

Change-Id: I0b3de04ef2bd6cd32fdcb1a82cbac58d5d621e5b
Reviewed-on: http://gerrit.openafs.org/11245
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-03 01:02:20 -05:00
Andrew Deason
f889469e27 vol: Make FindLinkHandle static and namei-only
FindLinkHandle is only referenced inside vol-salvage.c. Also, the
concept of a link table only exists on namei, so the function is only
used for the namei server (and it's only called by other namei-only
code).

So, make the function static, and put it inside the AFS_NAMEI_ENV
ifdef, to be a little more clear about where it can be used. Moving it
inside the AFS_NAMEI_ENV ifdef also avoids a warning if FindLinkHandle
is made static, since otherwise the function would be defined but
unused on non-namei.

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

Change-Id: Ia8cdadafaf15c724462f600514aa59910619a090
Reviewed-on: http://gerrit.openafs.org/10848
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-02 20:14:45 -05:00
Andrew Deason
4103aee514 ubik: Unlock version lock before udisk_end
Currently, BeginTrans calls udisk_end with UBIK_VERSION_LOCK held when
it gets an error from DISK_Begin. However, udisk_end itself acquires
UBIK_VERSION_LOCK to update the database flags, so this causes a
deadlock.

So, unlock UBIK_VERSION_LOCK before calling udisk_end. Also unlock it
before calling DISK_Abort, udisk_abort, and DISK_Begin, as well, since
none of those modify fields protected by UBIK_VERSION_LOCK. (Any read
access is allowed because we DBHOLD the database.) This commit unlocks
the lock immediately after we are done modifying versioning
information, which is right after we change writeTidCounter for write
transactions.

Change-Id: I31343d67c82734ff88b76bec740ef16767bb9667
Reviewed-on: http://gerrit.openafs.org/11541
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-12-02 17:57:00 -05:00
Andrew Deason
b19bb7db41 ubik: Convert DoProbe 'i' to 'nconns'
DoProbe was using the variable 'i' to keep track of how many
connections we have in the conns array. Keep track of this separately
using a variable called 'nconns' instead, to make this function a bit
less confusing.

Change-Id: Ica2b4901c083b315e901366820042fad64030b3c
Reviewed-on: http://gerrit.openafs.org/11540
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-12-02 17:51:12 -05:00
Michael Meffie
8ce37d0d4a libafs: remove "Please install afsd with check server daemon" warning
Apparently, ancient versions of afsd did not start the check server
daemon (AFSOP_START_CS). The afs_Daemon tries to detect when the check
server daemon is not running and issues a warning to upgrade afsd.  The
afs_Daemon waits for the cache initialization to complete (AFSOP_GO)
before detecting if the cache server daemon is started.

Unfortunately, when running with memcache, the cache initialization is
fast enough to race with the start of the check server daemon, and the
"Please install afsd with check server daemon" message is sometimes
printed to the syslog.

Since all modern versions of afsd do start the check server daemon, this
error message is no longer needed, so just remove the message and the
flag used to print it on only once.

Change-Id: If6a57ca0e6fb7e20a1e104c46416139cf5fe785a
Reviewed-on: http://gerrit.openafs.org/11602
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-12-02 17:49:10 -05:00
Chaskiel Grundman
1e1f6e4e8f Free security objects used in VolForward
VolForward and VolForwardMulti create rx security objects, but
never free them. The RXS_Close's are positioned where they are
to limit the need for conditionals

Change-Id: Iec6879270ad54c30c1fea571cea583afaca9364b
Reviewed-on: http://gerrit.openafs.org/9527
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-01 20:21:35 -05:00
Sami Kerola
aea3c2a327 build-sys: fix indentation in test code
Change-Id: If2c0c2a0b0b01bb425f8c1658cef9df232844b1c
Reviewed-on: http://gerrit.openafs.org/10012
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-01 18:43:48 -05:00
Sami Kerola
7d689390a8 build-sys: fix m4 quotation to make upstream autotools to work
Macro arguments for AC_ARG_WITH, such as AC_CHECK_PROGS, need to be
quoted.  Unless they are the latest version of autoconf will expand
macros slightly wrong way making the configure to fail at line where
there are only two ticks.

$ ./regen.sh
[...]
$ automake -a -f
[...]
automake: error: no 'Makefile.am' found for any configure output
$ ./configure
[...]
checking pkg-config is at least version 0.9.0... yes
./configure: line 13348: syntax error near unexpected token `newline'
./configure: line 13348: `    '''

Notice that the 'automake' run is needed in order to avoid later
configure error, which would look something like.

configure: error: cannot find install-sh, install.sh, or shtool in build-tools "."/build-tools

Change-Id: I39476270f351d2f5b332c5c945d6ac67fe16dd82
Reviewed-on: http://gerrit.openafs.org/9995
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-01 18:42:41 -05:00
Chaskiel Grundman
23d8175739 Remove UKERNEL code from files that don't need it
Remove #ifdef UKERNEL sections from auth, kauth, ptserver, and ubik sources
that are no longer part of libuafs

Change-Id: I515f65c7e634d9562680c60666a15758261aaae0
Reviewed-on: http://gerrit.openafs.org/9955
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-01 18:23:51 -05:00
Chaskiel Grundman
8b0a296bef Remove kauth headers from afs_usrops.c
Since ka_* functions are no longer called from here, we don't need
the headers

Change-Id: I538c27cf4fe2f16811d1d3056b25054c80ba5b2a
Reviewed-on: http://gerrit.openafs.org/9956
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-01 18:22:37 -05:00
Chaskiel Grundman
1df1a68535 rxgen: skip ubik for KERNEL
Declare ubik rxgen stubs only for !KERNEL, UKERNEL doesn't need them anymore.
Don't declare ubik_client or #include ubik.h on KERNEL or UKERNEL.

Change-Id: I0b1587eb46e9efbf627f04c74e0d76f9858bffd0
Reviewed-on: http://gerrit.openafs.org/9954
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-01 16:54:35 -05:00
Andrew Deason
c09785aa03 FBSD: Drop afs_xvcache for vgone()
For FreeBSD, osi_TryEvictVCache was calling vgone() without dropping
afs_xvcache. Prior to aad83a30a8, this
is what osi_TryEvictVCache did, and since the 'slept' pointer
represents whether we dropped xvcache (not whether we dropped glock),
it seems like this is the intention of the code.

Change-Id: Icb8cc86d972d7ca717bd91e250771d90931e1ba7
Reviewed-on: http://gerrit.openafs.org/7434
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-01 16:06:54 -05:00
Andrew Deason
b656710d30 FBSD: Do not vgone() in osi_VM_FlushVCache
osi_VM_FlushVCache just needs to remove VM references to the given
vcache; calling vgone() entirely should be unnecessary. Remove the
call to vgone() and other osi_TryEvictVCache-ish stuff, and just try
to cache_purge the vnode, like the other BSD implementations do.

Change-Id: I71d71f137c04d9ef3625f6a8ae22f0ffb90b9637
Reviewed-on: http://gerrit.openafs.org/7433
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-01 16:06:38 -05:00
Benjamin Kaduk
0315bb393f Rewrap some long lines in the toplevel Makefile
Only rewrap long lines in make scope; long lines in shell scope
are untouched.

We are inconsistent about whether continuation lines for listing
the dependencies of a target are indented by one or two tabs,
which this commit does not fix.

Change-Id: I2e438a0f42faa2ef7922d2c3b143e14bc82de826
Reviewed-on: http://gerrit.openafs.org/11178
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-01 15:46:07 -05:00
Ben Kaduk
138017efd8 Remove FOREIGN
It has been unused since the original import of IBM's code.

Change-Id: Ieec597c76e53453d012f1cd86f6860ae60dade5c
Reviewed-on: http://gerrit.openafs.org/9918
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-01 11:54:22 -05:00
Andrew Deason
bd6859861d salvager: Don't lie about locked-ness to namei_SLC
We have not locked the linktable with a prior call to
namei_GetLinkCount. So don't claim that we did.

Change-Id: I43adf92b60a0e46b90ae624e4713747585d12c67
Reviewed-on: http://gerrit.openafs.org/10198
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-12-01 11:54:05 -05:00
Andrew Deason
bdd8c60e79 namei: Remove namei_SetNonZLC
This function is unused. Remove it.

Change-Id: Ie48d5370187c851afdd7cd359115d9e74d001aae
Reviewed-on: http://gerrit.openafs.org/10197
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-01 11:53:43 -05:00