Russ Allbery [Mon, 17 Jun 2013 20:16:54 +0000 (13:16 -0700)]
Cleanup of openafs-client postinst script
* Cleanup of the openafs-client postinst script.
- Perform all work unconditionally to handle various rare error
recovery cases properly.
- Only force creation of CellServDB on initial installation or if
AFSDB/SRV records are not being used.
Russ Allbery [Mon, 17 Jun 2013 19:53:22 +0000 (12:53 -0700)]
Make shell scripts executable
May as well ship all of the shell scripts in the debian directory
executable, now that the source package format supports preserving
the executable bit.
Russ Allbery [Mon, 17 Jun 2013 19:51:44 +0000 (12:51 -0700)]
Give openafs-dbserver its own doc directory
* Give openafs-dbserver its own documentation directory rather than
linking it to openafs-client, allowing relaxation of the versioned
dependency on openafs-client to Recommends. (However, openafs-client
will still have to be installed for the openafs-fileserver init
script, which uses the bos binary, so will still be pulled in by
dependencies.)
OpenBSD 5.3: Replace use of copyinstr for setting mount point name.
As a result of a realignment of kernel memory in OpenBSD 5.3,
the copyinstr() routine no longer works for copying the mount
point name into the internal mount table structure. It also
fails silently, so it's not noticed until someone looks at
the mount table and discovers that the mount point name for
AFS is missing.
This patch replaces the use of copyinstr() with strlcpy() for
copying the mount point name in OpenBSD 5.3.
Note that this is consistent with how other similar device
support has addressed the same issue in OpenBSD 5.3.
Anders Kaseorg [Tue, 7 May 2013 04:27:33 +0000 (00:27 -0400)]
Linux: osi_TryEvictVCache: Don’t skip the first dentry if D_ALIAS_IS_HLIST
An hlist doesn’t begin with a sentinel like a list does, so the old
code would skip the first dentry or crash with a NULL dereference if
there wasn’t one. Use the kernel’s list_for_each_entry or
hlist_for_each_entry macros instead of trying to do it manually.
Should fix a crash observed by Alex Chernyakhovsky on kernel 3.6 and
newer.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/9857 Reviewed-by: Alex Chernyakhovsky <achernya@mit.edu> Tested-by: Alex Chernyakhovsky <achernya@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit ad6e31d5fea221bf5eefcd35a416667bc7c1f9be)
Change-Id: Id8b31246067b5a718af91c8c206d5abd5210c558
Reviewed-on: http://gerrit.openafs.org/9898 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Thu, 28 Mar 2013 18:03:40 +0000 (13:03 -0500)]
afsio: Pass KRB5_LDFLAGS along with KRB5_LIBS
We need this in case e.g. the krb5 library we're using is in an
alternate location, so we can pass -L. aklog already does this, so do
it for afsio, too.
This is a 1.6-only change. On master, this problem went away when the
krb5 ldflags/cflags/etc were standardized in commit 6f9443e702745d1e371eb72ad7fcba5cac47f3db.
Thanks to Måns Nilsson for reporting this.
Change-Id: I79aeb1f4de123b7550b64c1890a2773a44ff8d1e
Reviewed-on: http://gerrit.openafs.org/9692 Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ken Dreyer [Wed, 1 May 2013 03:59:32 +0000 (21:59 -0600)]
doc: quote list items in POD
Recent versions of Pod::Simple complain if we use integers or other
special characters in an =item list. We have a couple bulleted lists
that happen to have integers or other special characters as the list
values. Quote the items with C<> so that Pod::Simple can correctly parse
them again.
Andrew Deason [Tue, 30 Apr 2013 19:37:54 +0000 (14:37 -0500)]
afs: Do not invalidate all dcaches on startup
Commit 20b0c65a289e2b55fb6922c8f60e873f1f4c6f97 changed
afs_UFSGetDSlot to always treat a dslot entry as invalid if
'datavalid' was 0. This was to force the invalidation of the given
dslot if we were reading in a dslot from the free or discard list,
since the data in that dslot is not valid.
However, 'datavalid' is also 0 when we read in dcache entries from
disk on startup. So, this means that we invalidated all cache entries
when the client started up, effectively making our persistent cache
worthless.
Fix this by only forcing this invalidation when we are reading from a
free or discarded dcache, and not during the initial cache scan. That
is, when 'indexvalid' is 1, and 'datavalid' is 0.
The parameters for these Get*DSlot variants should maybe be changed to
be a little more clear, but for now, this is a targeted fix for this
specific issue.
FIXES 131655
Reviewed-on: http://gerrit.openafs.org/9833 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 479c34614f33859131258e330e7a3f8494e0bc80)
Change-Id: I72b7ad41658c51b81aa9844327372724a0f3151e
Reviewed-on: http://gerrit.openafs.org/9837 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Tested-by: Stephan Wiesand <stephan.wiesand@desy.de> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Fri, 29 Mar 2013 18:40:41 +0000 (13:40 -0500)]
Make ihandle sync behavior runtime-configurable
The actual behavior of FDH_SYNC has changed a bit over the years, and
some people want one behavior, and some want another. Make it possible
to make this choice at runtime with the new -sync option, instead of
making this decision by running with different patches.
Note that FDH_SYNC is not a macro anymore, nor is it an inline
function. While it could be a macro, it would look a bit complex, and
there are some oddities with trying to use vol_io_params inside the
FDH_SYNC expansion (vol_io_params is not declared for LWP, for
example). And having it be an inline function causes problems with
some odd linking dependencies. For example, vlib.a contains volume.o,
but does not contain a definition for DFlushVolume (dir/buffer.c),
which is referenced in volume.o. 'vos' uses vlib.a, but does not
bring in anything that defines DFlushVolume. Currently this appears to
not cause a problem because 'vos' uses nothing from volume.o, so the
dependencies of volume.o don't matter. Adding an inline FDH_SYNC for
platforms that don't support 'static inline' would add a dependency to
volume.o (via vol_io_params), which causes an error for the lack of a
DFlushVolume.
Those are possibly just some problems, and may not be all. So instead,
make it so we don't have to deal with that and just have a normal
function. While FDH_SYNC may be called in a performance-critical
section, the overhead of a real function call is nowhere near the
delay of an actual fsync(), so presumably any overhead doesn't matter.
Reviewed-on: http://gerrit.openafs.org/9694 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit eb5190eb4a7cd95166866a89e0a8f3a69bbc6e8f)
Change-Id: I7a6c99d00eff3400423440db91a350053ed099ea
Reviewed-on: http://gerrit.openafs.org/9695 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Wed, 17 Apr 2013 23:04:58 +0000 (18:04 -0500)]
LINUX: Sometimes let dentry_open handle refcounts
When Linux changed dentry_open to use a 'path' argument, they also
changed it so dentry_open handles incrementing the relevant ref
counts. So now, sometimes we need to inc the dentry and vfsmount
refcounts ourselves, and sometimes we need to leave them alone.
To accommodate this, change afs_dentry_open to also handle refcounting
itself, and 'get' the given dentry and vfsmount if necessary.
Also note that currently, afs_linux_raw_open can call afs_dentry_open
twice in the case of an error, but it does not dget(dp). This means
that dp could be undercounted, since dentry_open on older kernels will
dec the refcount on the given dentry in the case of an error. This
change should also fix this so dp is not undercounted in that case.
FIXES 131613
Reviewed-on: http://gerrit.openafs.org/9801 Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net>
(cherry picked from commit e31240732cbe449fedea5095037ac08d1d513fa9)
Change-Id: I082063d324d99c3d02ed372a1c20462f13bb4a26
Reviewed-on: http://gerrit.openafs.org/9803 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
OpenBSD: Add config headers for new(er) OS versions.
The OS-specific config header files have not kept up with the
newer releases of OpenBSD. This patch corrects that by adding
header files for OpenBSD versions from 4.9 to 5.3 (the newest
version currently under development).
Reviewed-on: http://gerrit.openafs.org/8927 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 20a54b02521b40b07e4ec87df55a1e9a2549c881)
Change-Id: I9ee66dbba300d5a68bc294a14dd9463441143371
Reviewed-on: http://gerrit.openafs.org/9661 Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> Tested-by: BuildBot <buildbot@rampaginggeek.com>
Andrew Deason [Tue, 20 Nov 2012 21:00:15 +0000 (15:00 -0600)]
ubik: Do not count votes from error'd connections
If the given connection has a connection-wide error on it, the vote we
got from that site is probably not valid, and we could easily be
interpreting an error code as a vote time. So instead, treat the host
as if we got a network error from it.
Andrew Deason [Tue, 20 Nov 2012 20:18:47 +0000 (14:18 -0600)]
ubik: Try to detect VOTE_Beacon errors
Currently the way ubik dbsites vote for each other is via the "return
value" of the Beacon VOTE RPC. Since this is really an Rx abort, this
can easily collide with actual errors on the wire, such as rxkad
errors.
Try to detect these by detecting vote times that are very different
than the current timestamp (more than an hour in the future or past),
and treat it like a network error.
If we do not do this, a single site reporting an error can cause us to
never reach quorum, since we calculate our sync site expiration based
on the oldest 'yes' vote, which for most known Rx aborts will be far
in the past.
Jeffrey Altman [Fri, 15 Mar 2013 03:27:25 +0000 (23:27 -0400)]
vol: remove duplicate stmp declaration
Patchset 38cf31463e3f3c675de727c1e793e117a90e6d20 added a definition of
afs_ino_str_t stmp which should have replaced the b64_string_t stmp
declaration that was already present.
Andrew Deason [Wed, 3 Apr 2013 21:39:07 +0000 (16:39 -0500)]
vos: Restore some VNOVOL error messages
Many places in vos/vsprocs have code to delete a volume. Commit f4e73067cdef990262c69c38ac98761620a63f25 tried to refactor them by
consolidating the common "delete" code into DoVolDelete. However, not
all of the removed code had exactly the same behavior, and some of
these variants were not handled by DoVolDelete.
One such variation is that DoVolDelete always printed an error message
if the target volume did not exist. But for some call sites this
condition is not an error, and prior to the refactoring they did not
print such an error message. Commit 1092cbe34fc8519826b3fa0565505b7bd81bc922 tried to correct this by
suppressing the error message if the target volume does not exist.
However, this means that all DoVolDelete calls do not print such an
error, where some should and some should not print an error. This
means that in some edge cases when we encounter an unexpected VNOVOL
error, we now skip printing the specific error we got and instead go
right to cleanup/recovery/exit. For a few other cases, we used to
print an error and continue (because it is a non-fatal error or a
warning), but now we print nothing when we encounter a VNOVOL error.
Fix this by specifically printing an error for the VNOVOL error for
DoVolDelete call sites that used to print such an error. Do this for
all such sites except ones where we obviously print an error
immediately afterwards anyway.
This is just a quick targeted fix. A future more robust fix should
involve altering DoVolDelete to handle all of the different behaviors
expected by its various callers.
Reviewed-on: http://gerrit.openafs.org/9704 Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 0a063815cc27ed065bcc9e4a91fb3a7b280818bb)
Change-Id: Ia333b2257b9fdc39f7bcc9ba8ed3c98254d2e76a
Reviewed-on: http://gerrit.openafs.org/9770 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Mark Vitale [Thu, 7 Mar 2013 14:34:55 +0000 (09:34 -0500)]
vos: noise messages when attempting to delete non-existent volume
With vos refactor commit f4e73067cdef990262c69c38ac98761620a63f25,
some formerly conditional volume deletes are now unconditional.
This regresses 'vos move' output with harmless "error" messages
when AFSVolTransCreate() returns VNOVOL:
"Failed to start transaction on <volume>"
"Volume not attached, does not exist, or not online"
Modify DoVolDelete() to return early (and silently) with VNOVOL
in this case, allowing the caller to handle this appropriately.
Marc Dionne [Sat, 22 Dec 2012 12:54:54 +0000 (07:54 -0500)]
Rework set_header_word macros
Rework the set_header_word macros so that all compilers are
happy:
- the use of offsetof() is avoided, as it has an issue on IRIX
when the result is not constant
- the assignment within the macro is explicitely sequenced before
the function call to avoid a gcc sequence-point warning
Reviewed-on: http://gerrit.openafs.org/8816 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 7f96084969d3082842a9575ee8ff7da8c52a0796)
Change-Id: Iefdf7f6dbb60ffc569b67b3c89893fb43527eb02
Reviewed-on: http://gerrit.openafs.org/8818 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Russ Allbery [Wed, 6 Mar 2013 08:49:40 +0000 (00:49 -0800)]
Support debconf configuration of -dynroot-sparse
* Support configuring -dynroot-sparse via debconf. The AFS_DYNROOT
option in /etc/openafs/afs.conf.client is now tri-valued instead of a
boolean, and the boolean values will be mapped to the corresponding
options on upgrade. Based on work by Jakob Haufe. (Closes: #644564)
Andrew Deason [Fri, 29 Jun 2012 17:36:36 +0000 (12:36 -0500)]
Remove empty Makefile continuation lines
HP-UX make gets confused by constructs like:
FOO = bar \
BAZ = quux
Where a line continuation is followed by an empty line. So, get rid of
all of these in the tree. Not all of them matter, but removing all of
them makes it easier to find these, and catch them in the future.
Reviewed-on: http://gerrit.openafs.org/7611 Tested-by: BuildBot <buildbot@rampaginggeek.com> Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 79f68de80e56179cfc5158fdcb51c34cfa864802)
Change-Id: Icf379b9d7557746c2c47134b1314a38ec13134cc
Reviewed-on: http://gerrit.openafs.org/8991 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Ken Dreyer [Wed, 12 Dec 2012 17:37:47 +0000 (10:37 -0700)]
NEWS updates for 1.6.2
Add an entry for 1.6.2 with "in progress" instead of a date to hold the
release notes for 1.6.2pre4 rather than creating separate entries for
each release candidate. Users who track the release candidates can refer
to the public announcements, and this will be cleaner when reading
history later on.
Reviewed-on: http://gerrit.openafs.org/8750 Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com> Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>
(cherry picked from commit 265a4b542b717c14e810202078c3ce83e4d851f5)
Change-Id: I68d4e6983097a97caac660f740ea8a01f1a95caa
Reviewed-on: http://gerrit.openafs.org/8988 Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Andrew Deason [Fri, 18 Jan 2013 20:27:16 +0000 (14:27 -0600)]
SOLARIS: Use vn_renamepath as early as possible
Commit 6c509601 uses the vn_renamepath when we are building on Solaris
11. However, some recent patch level of Solaris 10 (more recent than
stock 10u10) has the same problem fixed by that commit, where
vn_setpath takes an additional argument. So instead, just test for the
existence of vn_renamepath itself, so we also use it on Solaris 10
when we can.
Derrick Brashear [Tue, 22 Jan 2013 20:00:29 +0000 (15:00 -0500)]
darwin: don't process incoming packets during rx shutdown
we have a chicken and egg problem because the kpi doesn't
let us kill the upcall before we close a socket. a more correct
fix (on master) uses atomics, but for 1.6 this is a minimally-invasive
fix, macos only and strictly better than before.
FIXES 131577
Change-Id: I6003679f709284ae28f51bf5de8deff873346819
Reviewed-on: http://gerrit.openafs.org/8937 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Andrew Deason [Wed, 19 Dec 2012 00:49:49 +0000 (18:49 -0600)]
viced: Sanity check file link count during CoW
A few ihandle bugs in the past have caused the CopyOnWrite code to
open cached file handles for files which have been deleted. When we
CoW, both of the files we're dealing with had better actually be on
disk, so bail out and flag an error if either of them appear unlinked.
Andrew Deason [Fri, 21 Dec 2012 18:30:24 +0000 (12:30 -0600)]
ihandle: Add FDH_ISUNLINKED
Add the FDH_ISUNLINKED functionality to ihandle. This lets the caller
know if the file for the underlying file descriptor has been deleted
out from under us. This is useful for sanity checks in some callers.
Reviewed-on: http://gerrit.openafs.org/8838 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 9cf9a0e978ece2b0afb8ba5947455f307a424cab)
Change-Id: If5cde825a2e7413c47409c69f15507d6df1934c3
Reviewed-on: http://gerrit.openafs.org/9507 Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> Tested-by: BuildBot <buildbot@rampaginggeek.com>
Andrew Deason [Fri, 14 Dec 2012 21:05:53 +0000 (15:05 -0600)]
volser: Check vnode length on dump
Commit aadf69eabb1962496fa93745ab560a5b48cacd61 adds length checks on
vnodes during fileserver read/write operations. Do the same thing when
we dump volume data from the volserver, to ensure that we don't
transmit incorrect data e.g. to other RO sites when releasing.
Andrew Deason [Wed, 28 Nov 2012 21:12:12 +0000 (15:12 -0600)]
afs: Apply VLRU safety check for Linux too
This invariant should apply to all platforms, not just those with
dynamic vcaches. Since this prevents an infinite loop if the list os
corrupt or something, having this around everywhere seems useful. So,
drop the check for afsd_dynamic_vcaches.
Simon Wilkinson [Mon, 3 Jan 2011 10:40:56 +0000 (10:40 +0000)]
autoconf: Tidy up header includes
Tidy up our list of header includes so it's easier to see what
we're testing for. The list is now one-per-line, in alphabetically
sorted order.
Note that this won't affect our use of the default include set, as
autoconf will already have tested for all of those before it starts
this CHECK_HEADERS run.
Simon Wilkinson [Wed, 3 Apr 2013 11:09:03 +0000 (07:09 -0400)]
fix garbage counters in supergroup prdb_check
This is a backport of one hunk of commit 9efc255ab8de7ad90c7d599fea7bd1956bfd48c2, where a calloc fixes an
incorrectly sized memset. The original memset clears the size of the
pointer, not the sizeof the structure.
Change-Id: I40250e0346345fe9b4b43d14e76ea5fb23c8c04b
Reviewed-on: http://gerrit.openafs.org/9701 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Tue, 26 Mar 2013 18:27:33 +0000 (13:27 -0500)]
aklog: Only try to use krb5-weak.conf if it exists
The logic we use for using krb5-weak.conf to allow 'weak crypto'
requires us to know where the default krb5.conf is. The default
krb5.conf local can vary significantly depending on the platform, and
we don't have a good way of figuring out what it is, so we guess. We
may guess wrong.
To limit the cases where we guess wrong, only try to do this
workaround if the krb5-weak.conf file actually exists.
Andrew Deason [Tue, 26 Mar 2013 18:14:30 +0000 (13:14 -0500)]
aklog: Search for /etc/krb5/krb5.conf
aklog tweaks the KRB5_CONFIG environment var when performing one of
our 'weak crypto' workarounds. We assume that the default krb5.conf is
/etc/krb5.conf, but for Solaris 11 libkrb5, krb5.conf is in
/etc/krb5/krb5.conf. Although this file could be anywhere, try
/etc/krb5/krb5.conf too, so we at least work on stock Solaris.
Andrew Deason [Thu, 22 Dec 2011 03:00:12 +0000 (22:00 -0500)]
afsd: Parse cacheinfo during argument parsing
Currently we parse cacheinfo in afsd_run, when the client is
initialized and started. Parsing cacheinfo can change
afsd_cacheMountDir, however, which may be of interest to afsd.o users;
in particular, libuafs exposes this via uafs_MountDir(). This means
that if a mount dir is not explicitly specified in the libcmd
arguments to afsd, a libuafs-using program will see the mountpoint as
the empty string if it is queried after afsd_parse but before
afsd_run. For afsd.fuse, this causes the cryptic error message:
fuse: bad mount point `': No such file or directory
since the mountpoint is the empty string if it is not specified
explicitly on the command line.
To fix this, move cacheinfo parsing to effectively near the end of
afsd_parse, so the mountpoint is calculated in afsd_parse().
Simon Wilkinson [Wed, 27 Feb 2013 10:34:59 +0000 (10:34 +0000)]
ubik: Avoid unlinking garbage
If SDISK_SendFail fails before the pathname to the temporary file
has been constructed, then the failure handler will unlink stack
garbage, with variable results.
Initialise the string, and check to see if it has contents before
calling unlink
Marc Dionne [Sat, 29 Jan 2011 17:48:02 +0000 (12:48 -0500)]
ubik: cleanup DB lock usage in SDISK_SendFile
Some failure paths can return from SDISK_SendFile with the
database lock still held. Other failure paths will cause
setlabel to be called without holding the lock.
Rework the failure paths so we always release the DB lock before
returning, and always hold it when calling setlabel.
Andrew Deason [Fri, 18 May 2012 21:55:09 +0000 (17:55 -0400)]
afs: Do not avoid DNLC if fakestat is set
Currently in afs_lookup we avoid putting an entry in the DNLC if
'force_eval' is unset, in order to avoid populating the DNLC with
mountpoint symlinks (we want the target of the mountpoint to be in
there instead, the root dir). However, if -fakestat or -fakestat-all
are enabled, 'force_eval' is always false, since we only set it to
true under certain circumstances when evaluating mountpoints.
To fix this, populate the dnlc for non-mountpoints, even if force_eval
is unset.
Andrew Deason [Mon, 18 Jun 2012 22:01:24 +0000 (17:01 -0500)]
cacheout: Perform authenticated RXAFS_FlushCPS
Fileservers may now require RXAFS_FlushCPS calls to be made with
administrator tokens. So, try to make the call with admin tokens, and
provide the usual -noauth and -localauth options.
Andrew Deason [Fri, 28 Dec 2012 18:16:49 +0000 (13:16 -0500)]
viced: initInterfaceAddr_r regardless of ICBS code
Currently we only call initInterfaceAddr_r for a host if a call to
RXAFS_InitCallBackState3 succeeds. However, this leaves the host
without a host->interface structure, which indicates that the host
does not support UUIDs, and is represented by just a single host,port
pair.
But this is not correct; the host probably does have the relevant UUID
associated with it, but it is just not responding. So, with the
current code, we create a uuid-less host structure for a host that
probably has a uuid; that host structure will probably never be used,
and will just get deleted later.
So instead, always call initInterfaceAdd_r. Do it before the ICBS
call, so the host will be findable via UUID as early as possible. If
the ICBS call fails, the host will be marked as 'down' later on.
Andrew Deason [Wed, 29 Aug 2012 19:14:39 +0000 (14:14 -0500)]
LINUX: Detect non-vectorized aio functions
In kernels before 027445c3, the functions generic_file_aio_read and
generic_file_aio_write, as well as the fs operations aio_read and
aio_write, do not deal with iovecs but rather just use a single
buffer. Detect this, so our aio_read and aio_write implementations
have the correct signatures.
This removes several warnings on such kernels.
Reviewed-on: http://gerrit.openafs.org/8020 Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit e5ba359f64b5d8d874a31a50694398c17f27cfa1)
Change-Id: I8d8ee81c2bcff2dc85c2ff3e70452a0af5639921
Reviewed-on: http://gerrit.openafs.org/9493 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Marc Dionne [Fri, 22 Apr 2011 19:23:27 +0000 (15:23 -0400)]
Linux: cleanup aio support
Code that called directly into the aio operations (ex: readv/writev)
would bypass the AFS specific operations found in afs_linux_read
and afs_linux_write.
Rework the handlers:
- For newer kernels with aio, let the kernel use its default read
and write operations, and define the aio_read and aio_write operations,
with the AFS specific bits, calling into generic_file_aio_read/write.
The kernels default read/write operations are just wrappers around the
aio versions.
- For older kernels, leave things as is, pointing read and write to
afs_linux_read/write
After lots of intermediate steps a call to ubik_print(), ubik_vprint()
and ubik_dprint*() ends in vFSLog() which adds a timestamp to the output.
So any call to ubik_print(), that does not contain a \n at the end,
makes a mess of the logfile.
The least invasive change will simply add this newline at the end
of any ubik_print() call.
This also prevents long lines in the log, which might appear on
multi-homed hosts with lots of interfaces.
FIXES 1446
Reviewed-on: http://gerrit.openafs.org/9059 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit dc32caae7768c486e610c4e56c6a78e9c918d975)
Change-Id: I05892d6d9c47517208e21a3ab00bad2f30d58ba9
Reviewed-on: http://gerrit.openafs.org/9522 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> Tested-by: BuildBot <buildbot@rampaginggeek.com>
Michael Meffie [Mon, 13 Dec 2010 19:53:50 +0000 (14:53 -0500)]
xstat: print collection values in debug mode
Print the values of the integers returned in the collection data
when the -debug option is given to xstat_fs_test and xstat_cm_test
test programs. This allows us to at least see what the unformatted
values are when there is a mismatch in timeval sizes between the
host and client (aka the 32/64 bit xstat bug). This change could
break scripts which call the xstat test programs with the debug
option. New debug output are prepended with 'debug:' to be
easily ignored.
Andrew Deason [Tue, 3 Apr 2012 23:13:17 +0000 (18:13 -0500)]
xstat_cm_test: Print all call info stats
For CM xstat collecton 0 (function call statistics), there are many
more stats given to us on the wire than we currently print. Change
this so we print out everything in the afs_CMCallStats struct.
Andrew Deason [Fri, 28 Dec 2012 17:58:33 +0000 (12:58 -0500)]
viced: Avoid dangling uuid hash table entry
Currently we add a given host to the uuid hash table, then call
RXAFS_InitCallBackState3, and then only initialize the host->interface
structure if the ICBS3 call succeeded.
If the ICBS3 call fails, we have added a host to the uuid hash table,
but the host structure does not contain that uuid. If the host is then
deleted, we will not remove the host from the uuid hash table (since
host->interface is NULL), and so the uuid hash table entry will still
point to the freed host. If that host is then later looked up via that
uuid, we can reference a freed host, which can cause all kinds of
undefined behavior.
So instead, add the host to the uuid hash table at the same time that
we initialize the host->interface structure, inside
initInterfaceAddr_r.
Andrew Deason [Fri, 4 May 2012 22:23:42 +0000 (17:23 -0500)]
Call rx_SetNoJumbo earlier
For ubik server processes, rx_SetNoJumbo needs to be called before
ubik initialization for it to effect the communication between
dbservers; otherwise, full database transfers may result in Rx
jumbograms on the wire regardless of the jumbo/nojumbo setting. Move
the call to rx_SetNoJumbo to before ubik initialization to avoid this.
Also move the call to rx_SetNoJumbo to immediately after rx_Init* for
all server processes, for consistency. Move similar calls to
rx_SetMaxMTU for the same reason.
Reviewed-on: http://gerrit.openafs.org/7350 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 0debf2d2274db1ea862bfdc2ef767372f1fa77e3)
Change-Id: Iacb1afa853281e856bbb70f39c6ac9a81f210d0d
Reviewed-on: http://gerrit.openafs.org/9121 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com> Tested-by: BuildBot <buildbot@rampaginggeek.com>