Current versions of both MIT Kerberos and Heimdal disable DES enctypes
by default, but DES enctypes are still required for AFS service tickets.
Probe for either krb5_allow_weak_crypto() (MIT Kerberos 1.8) or
krb5_enctype_enable() (Heimdal) and, if found, call them to enable DES
enctypes. If neither is found, assume that the Kerberos libraries are
old enough that DES is enabled by default.
Russ Allbery [Fri, 22 Jan 2010 19:04:10 +0000 (11:04 -0800)]
Enable weak enctypes for aklog if supported by Kerberos
Current versions of both MIT Kerberos and Heimdal disable DES enctypes
by default, but DES enctypes are still required for AFS service tickets.
Probe for either krb5_allow_weak_crypto() (MIT Kerberos 1.8) or
krb5_enctype_enable() (Heimdal) and, if found, call them to enable DES
enctypes. If neither is found, assume that the Kerberos libraries are
old enough that DES is enabled by default.
Simon Wilkinson [Sat, 16 Jan 2010 15:52:58 +0000 (15:52 +0000)]
Don't double free call structure
If the rx_Read() of the number of bytes in the FetchData64 response
fails, then it sets code, and disposes of the call structure. However,
the length safety check that was added in c7b92a3018044f7aca4d9a77644e5c06ef64d1e9 executes regardless of whether
code is set, and the call has already been freed. So we end up calling
rx_Error with a NULL call structure, and panic.
Simon Wilkinson [Thu, 14 Jan 2010 16:57:15 +0000 (16:57 +0000)]
Don't install compile_et into its own directory
When pinstall sees that the basenames of its two arguments differ,
it assumes that its installing into a path, and creates the missing
directory. This meant that we got /usr/bin/afs_compile_et/compile_et
which wasn't the desired result.
Marc Dionne [Fri, 9 Oct 2009 01:53:03 +0000 (21:53 -0400)]
Linux: kmem_cache_create fix and cleanup
Fix the kmem_cache constructor function to match the current
expected prototype, and cleanup related code. This has been wrong
for a while, but since we were just passing extra parameters the
only effect was to generate a warning.
- Add a new configure test to detect the new constructor function
signature
- Define the older versions of the constructor in osi_compat.h,
making them call the current version
- Move a few compatibility #defines to osi_compat.h
Derrick Brashear [Thu, 31 Dec 2009 12:50:56 +0000 (07:50 -0500)]
viced host always hash on add
currently the openafs 1.4 code doesn't always add a host/port pair to the
hash when an interface address is being added. make the code match what exists
on the head
Change-Id: Ibf56a397b936abd1b0646c63c5dda88a59819538
Reviewed-on: http://gerrit.openafs.org/1053 Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com> Tested-by: Alistair Ferguson <alistair.ferguson@mac.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Tested-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Michael Meffie [Wed, 23 Dec 2009 21:38:57 +0000 (16:38 -0500)]
viced: add then remove when changing addresses
When changing a host address, be sure to add the new interface
before removing the old to avoid having the host marked as
deleted if we removed the only valid address. This change was
pulled out of commit ca613599a2537756462a420ae1a632747a433226
viced-host-uuid-and-addr-hashing-corrections-20090530 by
Jeffrey Altman.
Simon Wilkinson [Wed, 23 Dec 2009 13:29:54 +0000 (13:29 +0000)]
Shout less about system call hooks when using keyrings
When keyrings are in use, the user doesn't really care whether or
not we manage to hook the system call table, and the current message
has proved confusing, as it seems to indicate something has gone wrong.
Tone down the warning that's produced when keyrings are in use. This is
1.4.x only, as we're going to completely disable system call probes when
keyrings are in use in 1.5.x
Marc Dionne [Thu, 10 Dec 2009 00:06:18 +0000 (19:06 -0500)]
Linux: deal with ctl_name removal
The binary sysctl interface will be removed in kernel 2.6.33 and
ctl_name will be dropped from the ctl_table structure.
Make the code that uses ctl_name conditional on a configure test.
Marc Dionne [Sun, 20 Dec 2009 03:22:05 +0000 (22:22 -0500)]
Linux: utsrelease.h is moving
In kernel 2.6.33, utsrelease.h has moved to include/generated.
Adapt the configure code to consider that location, and clean
up that section's indentation.
Simon Wilkinson [Sat, 19 Dec 2009 14:48:32 +0000 (14:48 +0000)]
Linux: Flush vcaches when a mount fails
GetVCache (well, really NewVCache) creates a new vcache, with an attached
inode, and links it into the VLRU queue, regardless of whether it is
successful in populating that vcache or not. The attached inode, on Linux,
contains a reference to the super block of the filesystem. If the created
vcache is for the root, however, and populating that vcache failes, then mount
fails, and the super block is disposed of. This leaves us with a vcache in
the VLRU queue which contains a reference to a non-existent inode.
When ShakeLooseVCaches comes along a few minutes later, it attempts to discard
this inode. However, doing so fails because the inode no longer has a valid
super block.
Avoid this trauma by ensuring all vcaches are disposed of before the super
block goes away, in the event of a mount failure.
Change-Id: I68864f1ea401d24adba76164905a17de6ab3e6ce
Reviewed-on: http://gerrit.openafs.org/1003 Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Tested-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from 994ef0e7cab95e2fc6f47fc8838490112e432ffd)
Reviewed-on: http://gerrit.openafs.org/1008 Tested-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Thu, 17 Dec 2009 20:59:44 +0000 (14:59 -0600)]
Do not trust FetchData length from fileservers
Currently the Unix CM implicitly trusts that the length from a FetchData
request from a fileserver will always be less than the requested length.
If the fileserver sends more data than requested, we can use up more
cache space than we intended, possibly exceeding the cacheinfo cache
limits.
Add a check for this, and return EIO to the caller if the fileserver
responds with too much data.
Reviewed-on: http://gerrit.openafs.org/996 Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c7b92a3018044f7aca4d9a77644e5c06ef64d1e9)
Implementation of new dump tag and length standard
The implementation follows the specification from October 2007.
All old tags are accecpted as before.
New tags 0x06-0x60 (capital letters) are followed by a 1 byte length
field which may contain directly the length (up to 127) or the length
of the then following length field (max 8) ored with 0x80.
New tags 0x61-0x77a are directly followed by 4 bytes building a 32bit
integer.
0x7b-0xf are single-byte tags, 0x7e meaning next tag is critical.
On this basis unknown tags can be skipped unless they were marked
critical. In this case the restore is aborted.
in dump.h tags following the new standard are marked by an asterisk
Last update: added parameter types for HandleUnknownTag.
Andrew Deason [Fri, 20 Nov 2009 20:15:28 +0000 (14:15 -0600)]
Add safety checks on all hostList traversals
Currently, h_Enumerate checks that it doesn't enumerate over more than
hostCount hosts, in case the hostList has a cycle or is otherwise
corrupt. Add similar checks to all places in the code that loop over
hostList, to prevent the code from getting in an infinite loop under
H_LOCK in the case of a hostList cycle.
Also, ShutDownAndCore instead of assert'ing, so we try and detach
volumes first, possibly reducing salvaging time when we restart after
core'ing.
(cherry picked from 58258ba3b89732ea825e1aff2decab54347ab92e)
Change-Id: Ide1e5aca7c2c4a4af3f62bc07821db694f2f9999
Reviewed-on: http://gerrit.openafs.org/863 Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-on: http://gerrit.openafs.org/990 Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Simon Wilkinson [Wed, 22 Jul 2009 00:11:15 +0000 (01:11 +0100)]
Rename installed version of compile_et
Rename the installed version of compile_et to afs_compile_et to avoid
conflicts with other, more standard, users of com_err. Also rename the
man page to match
Simon Wilkinson [Wed, 4 Nov 2009 23:40:39 +0000 (23:40 +0000)]
Prevent VLRUQ race in ShakeLooseVCaches
When ShakeLooseVCaches is called from afs_Daemon, the xvcache lock
is not held. This means that if the GLOCK is dropped for any reason
(for example, whilst purging the dentry cache), then
ShakeLooseVCaches can be raced, end we can end up attempting to
flush the same vcache twice.
The symptoms of this in Linux are that we oops in clear_inode.
Get the xvcache lock in afs_Daemon(), before calling
ShakeLooseVCaches. Also, remove the conditional GLOCK code from
that function. If we don't have the GLOCK on entry, then we're really
in trouble (and both code paths - afs_Daemon and afs_NewVCache should
get the GLOCK for us, anyway)
Simon Wilkinson [Mon, 26 Oct 2009 18:52:52 +0000 (18:52 +0000)]
Remove hardcoded maximum time
When iterating across the buffer list, afs_newslot used a hardcoded
maximum time to find the oldest. Instead of using this, just use the
accesstime of the first unused buffer that we find as the oldest, and
continue as normal.
Sadly, similar changes were never made to afs/afs_buffer.c, so the
same problems remain in the cache manager.
The issue here is with two processes racing in afs_newslot. Calls to
afs_newslot protect buffers with a zero reference count using
afs_bufferLock. If we release afs_bufferLock, before we increase the
reference count of the vcache, then we can end up with newslot
picking the same buffer for two different purposes.
The GLOCK actually protects us from the worst of this, but this fix
is necessary both for correctness, and for symmetry with the file
server buffer code.
Rainer Toebbicke [Fri, 30 Oct 2009 11:10:21 +0000 (12:10 +0100)]
Correct diskused and files when cloning a volume
Recalculates a volume's disk space used and number of files upon
every clone where it is effortless. Even though tracked mostly
correctly, bugs and accidents leave their traces which only a
salvage would correct.
Jeffrey Altman [Tue, 20 Oct 2009 20:16:47 +0000 (16:16 -0400)]
prevent rx peer timeout from reaching 0.0 seconds
The rx peer timeout is computed from the round trip time
calculation. It traditionally has had a lowerbound of 350ms.
The computation in rxi_ComputeRoundTripTime() was incorrect
and instead used 350ms as an upperbound.
rxi_ComputeRoundTripTime() had a second problem wherein if
the actually RTT is shorter than the resolution of the clock
then the RTT would quickly approach 0.0 seconds. Enforce
a lowerbound of 1ms if the RTT for a given packet appears
to be 0.0 seconds.
Andrew Deason [Thu, 15 Oct 2009 18:15:44 +0000 (13:15 -0500)]
Fix a couple more unlink()s in vol-salvage.c
There are a couple more unlink() calls in vol-salvage.c that were using
relative paths. Fix them to use absolute paths and to log a warning if
the unlink() fails.
Claudio Bisegni [Sun, 18 Oct 2009 18:39:21 +0000 (20:39 +0200)]
OpenAFS Preference Pane 64bit and Symbolic Link features implemented.
Now the OpenAFS preference pane is compiled with 32 and 64 bit snowleopard support, so the preference
windows is no more restarted in 32 bit mode.
The tab for symbolic link creation has been implemented. Now the user can create and delete link.
For create a link both name and destination path must be set. AFSBackgrounder has been updated to
manager in a separate thread the link creation and destroy operation, according to the vaule of
checkbox "Enable Symbolic Link" in "Mounts" tab.
Jeffrey Altman [Mon, 5 Oct 2009 18:34:59 +0000 (14:34 -0400)]
Improve accuracy of Rx RTT calculation by skipping retransmitted packets
Rx RTT calculations are based on Van Jacobson's work using
constants that make computations fast but are not necessarily
the best for modeling Rx protocol exchanges. This patch does
not alter the constants but does improve the comments to show
that the math is correct.
Phil Karn in 1987 demonstrated that Van Jacobson's algorithms
produced inaccurate results when the RTT computed from an
acknowledgement of a retransmitted packet were included. The
resulting RTT would either be too small causing the system to
retransmit too many packets or too long resulting in too few
being sent.
This patch follows Phil Karn's advice which was also adopted
as mandatory for TCP in RFC2988. Retransmitted packets and
delayed acks are skipped and the retransmit time is backed off
(up to a maximum of 3 seconds) until a successful acknowlegement
is received for an initially transmitted packet.
Claudio Bisegni [Mon, 5 Oct 2009 11:42:27 +0000 (13:42 +0200)]
OSX Launchd Startup Manage with Preference Pane
OpenAFS preference pane has been updated to manage the new launchd startup mode. Has been delete the custom startup and shutdown file now is user the /Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.rc
OpenAFS.postinstall has been modified to remove the old existing /Library/StartupItems/OpenAFS directory
OpenAFS.pre_upgrade has been modified to shutdown daemon, if it is runnig, and remove the old preference pane to permit the one to be installed
make fileserver avoid salvage loop on init failure
if the vlserver or prserver setup can't succeed, it doesn't indicate
a condition which salvaging is required to fix; instead, come up
and retry in the background.
Andrew Deason [Mon, 21 Sep 2009 17:48:30 +0000 (12:48 -0500)]
Unlink correct files in salvager
Fallout from 0ac956b3384842b3c60e72bde78a4baf58a5877f; a couple of
unlink() calls were not updated to use the absolute path. Update them,
and log errors from unlink(), since otherwise it is difficult to tell
that anything is going wrong.
Andrew Deason [Thu, 27 Aug 2009 17:43:03 +0000 (12:43 -0500)]
Fix cache tracking for small fragsizes
The tracked amount of disk cache used by a client can be incorrect when
afs_fsfragsize is tuned to below 1023. Since we round up to the next
nearest afs_fsfragsize+1 then round down to the kb, if afs_fsfragsize+1
< 1kb, we can undershoot the cache usage.
This enforces afs_fsfragsize to always be at least 1023.
theoretically a user thread can race us during shutdown and end up
panicing us if the soclose happens at the wrong time. if we're shutting down
just return. using afs_shuttingdown would have the side effect that we'd lose
the ability to add any graceful behavior.
Claudio Bisegni [Fri, 28 Aug 2009 19:16:52 +0000 (21:16 +0200)]
Fixed the tokens update and update .gitignore for MacOSX packaging file
Fixed the tokens update on preference pane if operation is made with NSStatusItem.
Has been updated the src/packaging/MacOS/.gitingore for CellServDB file and src/libafs/.gitignore has been added afs.x86_darwin_100.plist.
Claudio Bisegni [Wed, 26 Aug 2009 15:18:37 +0000 (17:18 +0200)]
10.6 update(Workaround for kerberos bug) and cleaning of deprecated function form code
For aklog has been added the workaround for kerberos function KLAcquireInitialTickets that in 10.6 return always error.
First is called KLCacheHasValidTickets for check user ticket presence, if there are no ticket KLAcquireNewInitialTickets will be called for get user credential.
Has been removed also many deprecated api.
Simon Wilkinson [Tue, 18 Aug 2009 21:31:38 +0000 (22:31 +0100)]
Make MacOS installer pane permit dashes
The MacOS installer only permits characters in [0-9A-Za-z] in cellnames.
However, OpenAFS itself will also allow dashes, and they're in use by some
sites.
This trivially amends the installer pane to permit dashes.
Claudio Bisegni [Mon, 3 Aug 2009 17:05:46 +0000 (19:05 +0200)]
Removed user perspectivev3 file in xcode project and update the gitconfig
gitconfig in src/platform/DARWIN/AFSPreference has been modified to ignore the perspectivev3 that is created by xcode for window layout.Has been also delete the file created for the user
Claudio Bisegni [Mon, 3 Aug 2009 14:40:05 +0000 (16:40 +0200)]
Cleaned most warning OSX OpenAFS preference and completed the AFSBackgrounder implementation
At startup the preference pane check for the presence in ~/Library/LaunchAgents of the file it.infn.lnf.network.AFSBackgrounder.plist that. The agent could be started in OpenAFS preference pane view.
AFSBackgrounder has replaced the NSMenuExtra, when it doesn't quit well launchd restart it. AFSBackgrounder can be used also for other work, for now, at login it check the user preference for get token.
Has been made some refactoring in code for remove most warning.
The unused think are been delete from project.
Start coding OSX Backgrounder Application, for OpenAFS Preference Pane, that user NSStatusItem
To prevent future compatibility with osx we must use NSStatusItem instead NSMenuExtra that is not documented api.
For this has been created a background only application that will manage all function managed by current NSMenuExtra
Adam Megacz [Mon, 27 Jul 2009 03:32:07 +0000 (20:32 -0700)]
In rxi_SendPacket[List], down hosts if ENETUNREACH or equivalent
This patch causes rxi_SendPacket[List] to "down" a host if
rxi_Sendmsg() returns -ENETUNREACH (or equivalent). Previous behavior
only did this check if defined(KERNEL) becauase non-defined(KERNEL)
implementations did not return meaningful error codes from
rxi_Sendmsg().
Jeff Altman <jaltman@openafs.org> supplied the logic for the
AFS_NT40_ENV case; I was not able to test this (I do not own a
Windows license) and took him on his word.
Reviewed-on: http://gerrit.openafs.org/59 Reviewed-by: Adam Megacz <megacz@gmail.com> Tested-by: Adam Megacz <megacz@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 1ddc7fa920213f9b5455e632bbddf05b866af647)
Change-Id: I1c5bdf8f3216f82f32fcf22f1c47a3a43130e071
Reviewed-on: http://gerrit.openafs.org/945
Adam Megacz [Sun, 19 Jul 2009 18:00:41 +0000 (11:00 -0700)]
Use -errno or WSAGetLastError() as return value from rxi_Sendmsg()
This patch causes the pthread and lwp implementations of rxi_Sendmsg()
to use -errno or WSAGetLastError() as the return value if it is
positive. This is required in order to communicate more meaningful
error conditions to rxi_SendPacket[List], which should "down" a host
immediately when it observes ENETUNREACH.
Jeff Altman <jaltman@openafs.org> supplied the logic for the
AFS_NT40_ENV case; I was not able to test this (I do not own a
Windows license) and took him on his word.
Reviewed-on: http://gerrit.openafs.org/58 Tested-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Adam Megacz <megacz@gmail.com> Tested-by: Adam Megacz <megacz@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 119c756d96c4a7f9e01e4ff6bb20156f1abf761b)
Change-Id: I31f97e4cef4b32abb69c783d19b1adfd897889fa
Reviewed-on: http://gerrit.openafs.org/943
Running bos -noauth should not require client CellServDB configuration
When setting up a new cell, the admin is instructed to use "bos -noauth"
to configure the servers and only afterwards create the client configuration.
This leads to a catch-22 since currently bos -noauth fails if there is no
client configuration even though it is not required.
This change avoids the call to afsconf_Open() which is only required
if tokens are being acquired.
This patch completes the implementation of an install time prompeter
for information about the local AFS cell, which is then used to populate
the ThisCell file. It removes the need for manual editing of
configuration files as part of the installation.
(Build system modified by Simon Wilkinson from Toby's original patch)
the function rx_ReadProc32 (src/rx/rx_rdwr.c) checks the pointer
call->currentPacket before the function rxi_FreePacket is called. This
test was missing in the function rx_ReadProc.
Michael Meffie [Wed, 15 Jul 2009 16:46:56 +0000 (12:46 -0400)]
Fix assert message to avoid printing garbage
Fix an off by one error in assert() to avoid printing garbage
characters to the log. Remove the newline character generated by
ctime() to match the format generated by the other logging functions.
Search for the Linux version in the correct header
src/config/linux-version already had support for handling either versioned
or unversioned kernel source directories, but the grep for UTS_RELEASE
was unconditionally done against the versioned source tree, ignoring the
previous determination of where the header file was.
Instead, check instead the header file location that we'd previously
determined.
This patch has been tested in the Debian OpenAFS 1.4.11~pre3+dfsg-1
package.
if the socket buffer size specified by the configuration is too large
to be applied, do not drop down immediately to 32766 bytes. Instead
try increasingly smaller values trying to find the largest one that
works. use the same value for the send buf size as well.
(cherry picked from commit 5b0e23567e1ed64f448bb3253ad90d39cad31271)
not ready for release, but, add a tool which installer can run to ask for a cell
name
AUTHOR
LICENSE IPL10
====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
LICENSE IPL10
Jeffrey Altman [Thu, 19 Nov 2009 23:11:06 +0000 (18:11 -0500)]
viced: set volume sync data in bulk status rpcs
The bulkstatus and inlinebulkstatus rpcs have a bug
that prevents the volume sync data from being set.
Currently the data is being set within the for loop
only when i == nfiles. The conditional of the loop
is i < nfiles so the SetVolumeSync call is never
performed. This patch changes the test for performing
SetVolumeSync to i == 0.
lightly modified from what Bren Mills submitted; the second unlock call after mfail may be entirely useless.
(cherry picked from commit b87935a4c5f26357e29f1db46eff8b1cf9185f3b)