Andrew Deason [Mon, 22 Nov 2010 02:29:11 +0000 (21:29 -0500)]
Remove unreached lines
Fix some macros to eliminate unreached trailing empty statements (such
as: "{code = foo; goto error;};"), and other oddities causing
"statement not reached" warnings. Also eliminate a couple of code
blocks that were never reached.
Andrew Deason [Mon, 6 Dec 2010 19:29:31 +0000 (13:29 -0600)]
roken: Export rk_daemon, not daemon
We never export a function called 'daemon'. We only export a function
called rk_daemon, and the define daemon to rk_daemon. So, only include
rk_daemon in the map file, since that is the only symbol that will
appear.
Andrew Deason [Thu, 12 Aug 2010 19:38:55 +0000 (14:38 -0500)]
libafs: Set tvcp->callback before BulkStatus
When we call InlineBulkStatus or BulkStatus, we currently do not touch
tvcp->callback for any of the vcaches before making the call. This can
cause us to not notice an InitCallBackState issued by the fileserver
before the BulkStatus call returns, since the InitCallBackState
handler looks at tvcp->callback to determine what vcaches to clear
callbacks for. In turn, this can cause us to think we have a callback
agreement with the fileserver on one of the BulkStatus'd files, when
the fileserver does not actually have such a callback agreement.
So, set tvcp->callback to the server we are contacting, so if we get
an InitCallBackState call from that fileserver, the CBulkFetching
state will be cleared, and we will correctly discard the callback
information for that vcache.
Stefan Kueng [Fri, 3 Dec 2010 20:24:33 +0000 (21:24 +0100)]
Windows: afs_shl_ext folder bkgrnd context menu
Make the context menu handler also work for folder backgrounds
and on Win7 for library folder backgrounds
For folder backgrounds, the shell passes the PIDL of the folder
instead of a data object. Extract the path from that PIDL. Also
extended the register function of the dll to add the required
registry keys.
Jeffrey Altman [Wed, 1 Dec 2010 23:47:29 +0000 (18:47 -0500)]
Windows: Remove fallback from GetCaps to GetTime
If the file server responds to RXAFS_GetCapabilities with
RXGEN_OPCODE the server is up and there is no need to fallback to
RXAFS_GetTime. Remove the code that performs the extra work.
Andrew Deason [Fri, 3 Dec 2010 22:39:57 +0000 (16:39 -0600)]
LINUX: Define zero_user_segment
When the kernel does not have the zero_user_segments function, we
define it ourselves. Also define the zero_user_segment function, since
we use it, and a kernel lacking zero_user_segments will also lack
zero_user_segment.
Change-Id: I5c786d2af27227793a7a2768d1af76ccd2d6a415
Reviewed-on: http://gerrit.openafs.org/3432 Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Matt Benjamin <matt@linuxbox.com> Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
OpenBSD: Remove duplicate assignment of COMMON_INCLUDE in libafs
When building libafs, the make file variable COMMON_INCLUDE is
assigned a value in two places: Makefile.common.in and
MakefileProto.OBSD.in. The assignment in the latter place is both
wrong and unnecessary. Remove it.
The netinet/in.h header file requires the inclusion of sys/types.h
(or some portion thereof). Most systems include it implicitly
within netinet/in.h. Some, such as OpenBSD, do not. In kopenafs.c,
sys/types.h is included after netinet/in.h which is fine in most
cases but means that, as a result, it will not compile on OpenBSD.
Moving sys/types.h before netinet/in.h solves this problem (and
should cause no problems on any other system).
Matt Benjamin [Wed, 3 Nov 2010 21:02:19 +0000 (17:02 -0400)]
unix cm rx-oblivious connection pooling
Implements a connection pool for Rx client connections with the
same credentials. The code trivially avoids the limit on Rx
call channels, without touching Rx directly. The conn call limit
is known to be hit in cache-bypass, and probably other use cases,
so there is an incentive to address it potentially sooner than
larger Rx changes are ready to merge.
Upgrade to exclusive lock before calling find_preferred_connection.
Unset trace option. Fix a warning around modular increment of
select_index, we'll go with the change suggested by Marc, I don't
see a real need to save the value mod CVEC_LEN.
because of how we configure afsdb, we can end up needing libresolv
but not configuring it for threaded code. link it in. at the same time,
make sure the link can succeed on e.g. macos
The osi_PostPopulateVCache() routine in the OpenBSD version of
osi_vcache.c tries to use the non-existent variable "vc" instead
of "avc". This fixes it.
OpenBSD: Fix use of mstat Length field in osi_vm.c
The code for osi_VM_FlushPages() in osi_vm.c for OpenBSD incorrectly
tries to access field "m.Length" in the vcache structure "avc"
instead of "f.m.Length".
Ben Kaduk [Sun, 28 Nov 2010 04:25:03 +0000 (23:25 -0500)]
FBSD: clean up rx_socket teardown
We had previously been waiting for the SO_ISDISCONNECTED flag
to show up in the so_state field, but the flags are not really
used for stateless protocols such as UDP, and that flag never
shows up. Even with a full three-second wait, the rxk_Listener
sometimes still failed to fully terminate, preventing the reuse
of the rx port for a restarted afsd.
Copy from Solaris and loop until rxk_ListenerPid is zero, doing
bogus one-byte NetSends in the body of the loop.
Change-Id: I6a5ad4509549fa64c551af642ef5867602b182c0
Reviewed-on: http://gerrit.openafs.org/3391 Reviewed-by: Matt Benjamin <matt@linuxbox.com> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Asanka C. Herath (9):
Windows: Registry based configuration
Rename get_entry() -> _krb5_config_get_entry()
Deal with quoted strings when reading lists of config strings
Add missing export and calling convention annotations
Windows: Build and export localtime_r
Windows: Older Windows SDKs need <winsock2.h>
More compatibility macros
Increase KBR5_BUFSIZ to 2048 and use it in config_file.c
Deal with backslash escaped quotes
Love Hornquist Astrand (3):
provide symbol renameing for sha512 and sha384
less exit with failures
add random abstraction
Simon Wilkinson [Wed, 1 Dec 2010 17:42:23 +0000 (17:42 +0000)]
Build and use roken's mkstemp
Add roken's mkstemp to the build on all platforms, either through
configure (Unix) or explicitly (Windows). Change all callers so
that mkstemp is used unconditionally, rather than falling back
to more risky alternatives.
This is based on original change from Russ Allbery submitted as
http://gerrit.openafs.org/2146
OpenBSD: Use Darwin version of afsi_SetServerIPRank() for OpenBSD 4.7 and above.
With OpenBSD 4.7, the ia_subnet and ia_subnetmask fields have been removed
from the in_ifaddr structure as part of a cleanup that considers them
unnecessary. Thus, the version of afsi_SetServerIPRank() that OpenBSD was
using no longer compiles. On the other hand, the Darwin version of this
routine seems suited to OpenBSD's needs since it doesn't use those fields
so we'll use that version for OpenBSD 4.7 and above instead.
Darwin: Assign correct value to myDstaddr in afsi_SetServerIPRank()
The value in sin->sin_addr.s_addr that's assigned to myDstaddr in the
Darwin version of afsi_SetServerIPRank() is in network byte order but
really needs to be in host byte order.
Note: This patch assumes that change I66f5c790d8c55b359e3550b6d71f3abe040a2820
has been previously installed. The patch fails otherwise.
Change-Id: I3078da1efb94f87f84dbe357f3272d908818256b
Reviewed-on: http://gerrit.openafs.org/3402 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
DARWIN: Fix processing using rx_ifaddr_* macros in afsi_SetServerIPRank()
The macros rx_ifaddr_address, rx_ifaddr_netmask, and rx_ifaddr_dstaddress
all expand to a call to memcpy() which returns the destination address as
its return value. The test in the DARWIN version of afsi_SetServerIPRank()
for completion when using this macro, however, seems to assume that success
returns zero, which is wrong and results in myAddr, subnetmask, and
myDstaddr always being set to zero. This patch corrects this behaviour.
Marc Dionne [Wed, 24 Nov 2010 00:08:24 +0000 (19:08 -0500)]
Cache bypass: switch to rx_Readv
Tests show that cache bypass doesn't scale very well past a few
concurrent processes, with a lot of lock contention in the RX
layer. Switching the implementation to the iovec based rx_Readv
alleviates much of this.
Also take advantage of the fact that the upper layer readpages
only sends down contiguous lists of pages, and issue larger read
requests and populate the pagecache pages from the iovecs we
get back. The loop logic is changed significantly to accomodate
the new pattern.
Read throughput is improved by about 30-40% for some parallel read
benchmarks I use. Along with some other tweaks, it can allow the
throughput to be more than doubled.
Andrew Deason [Thu, 9 Sep 2010 14:41:40 +0000 (09:41 -0500)]
vos: Improve release recovery on timed-out trans
When a portion of 'vos release' takes long enough that a transaction
on one or more RO sites times out, it retries to release to those
sites. However, it does not take into account the situation where the
transaction on the original RO clone has also timed out, which it
usually will have if we took a long time to get to the ForwardMulti
stage for any reason.
Add a check to see if the clone RO transaction has timed out, and if
so, recreate the transaction on it. Check if the volume appears to
have changed at all, and if it has, bail out.
Jeffrey Altman [Fri, 26 Nov 2010 07:55:03 +0000 (02:55 -0500)]
Windows: NSIS installer requires the architecture for CL=1400
The NSIS installer at present is 32-bit only. Production releases
of OpenAFS have always been performed using the CL=1310 compiler
so it wasn't noticed that src/WINNT/install/NSIS/NTMakefile did
not define the ARCH (architecture) for the purpose of identifying
which redistributable runtime library installer should be
integrated into the build. For the CL=1310 compiler there are
not prebuilt installers for OpenAFS to integrate.
Jeffrey Altman [Fri, 26 Nov 2010 07:51:16 +0000 (02:51 -0500)]
Windows: make use of AFSDEV_BIN and set the PATH
ntbuild.bat defines AFSDEV_BIN which is set to the list of
directories from which executables required for the build
process will be executed. However, this value was never used
to modify the PATH environment variable. Make it do so.
Christof Hanke [Sun, 21 Nov 2010 22:01:53 +0000 (23:01 +0100)]
check curses-libs by configure
Presently, the used curses-library are determined by OS.
The leads to a build error when no curses-headers are installed.
Use configure to test if curses.h or ncurses.h is present.
ncurses takes precedence over curses.h.
If neither the curses- nor ncurses-libs are available, do not build
afsmonitor and scout.
A summary at the end of the configure should make this clear to
everyone.
The variable TXLIBS has been renamed to LIB_curses.
Christof Hanke [Sun, 17 Oct 2010 06:54:06 +0000 (08:54 +0200)]
Add output-table to libafsutil
This adds the complex structure Table to libafsutil.
All binaries linking to libafsutil can use this to store their output
in the table. This table can be sorted by a predefined column.
The available output formats are ASCII, CSV and HTML.
Ben Kaduk [Sat, 27 Nov 2010 04:28:50 +0000 (23:28 -0500)]
Catch up on FBSD releases
Add param.foo.h and sysname entries for the past and forthcoming
FreeBSD 7.2, 7.3, 7.4, and 8.2 releases. Also update the
MakefileProto.FBSD.ins that need touching, simplifying the libuafs
one in the process.
Andrew Deason [Tue, 23 Nov 2010 03:54:32 +0000 (22:54 -0500)]
Only specify CFLAGS_NO* with --enable-checking
Currently we are always specifying e.g. CFLAGS_NOUNUSED as -Wno-unused
when we think we are compiling with gcc. Since autoconf always tries
to use gcc when possible, this breaks the build if we have a gcc
available but we use another cc for building.
This should be fixed otherwise, but in the meantime at least make this
only happen if warnings are actually turned on, so the build is less
likely to break with a default ./configure invocation.
Andrew Deason [Sun, 21 Nov 2010 23:57:22 +0000 (18:57 -0500)]
Solaris: Support -i in shlib-build
Our librokenafs.map file contains symbols that we may not actually
define, since the list of exported symbols varies depending on the
platform's capabilities. This causes errors during linking, which can
be suppressed by marking all symbols as "= EXTERN". Do so by having
shlib-build modify the mapfile at link-time, when -i is specified to
indicate ignoring undefined symbols.
Andrew Deason [Tue, 23 Nov 2010 03:23:02 +0000 (22:23 -0500)]
vol: Move VOL_CV_TIMEDWAIT to volume_inline.h
Some platforms will give errors for the vol package glock not being
defined in VOL_CV_TIMEDWAIT, since some utilities include volume.h
(with pthreaded ubik enabled) but do not have the vol glock. This
isn't a problem for the other CV_WAIT (et al) macros, since, being
macros, they are not expanded if never referenced. Since
VOL_CV_TIMEDWAIT is a static inline function, however, and at least
some platforms try to compile/link it even if it's not referenced.
So, move it to volume_inline.h, which is only used by the volume
package itself, where we will have the vol glock.
Andrew Deason [Wed, 24 Nov 2010 15:03:19 +0000 (10:03 -0500)]
ubik: Log a message when we replay the trans log
It can be helpful to know that an interrupted transaction was replayed
on startup, and this should be rare. So log a message when that
happens, indicating what db version we replayed to.
Andrew Deason [Wed, 24 Nov 2010 14:36:05 +0000 (09:36 -0500)]
ubik: Replay the transaction log label correctly
Commit eec0d94f519b3e27f255b9b7a637df043951424e fixed the transaction
replay log code to correctly identify valid transaction logs on
little-endian systems, but missed ntohl'ing the database label read in
a LOGEND opcode. Fix that, so the database is labelled correctly when
replayed from a transaction log.
And while we're here, actually pass a struct ubik_version* to
adbase->setlabel, to make it a little more clear what's happening.
Simon Wilkinson [Wed, 15 Sep 2010 10:17:14 +0000 (11:17 +0100)]
auth: Allow identities in the UserList
Extend the userok interface provided by the auth library to permit the
addition, deletion and inspection of identities within the UserList.
A number of additional functions are added, as direct replacements for
their Kerberos v4 only counterparts - these are:
*) afsconf_DeleteIdentity
*) afsconf_GetNthIdentity
*) afsconf_AddIdentity
*) afsconf_SuperIdentity
In addition, a new function is added to allow the status of any given
identity to be queried
*) afsconf_IsSuperIdentity
New form identities are stored within the same UserList file as
Kerberos v4 identities. We take advantage of the fact that the current
code skips any entry with a leading whitespace. Identities are stored as
a single line, with a leading space, followed by the integer
representation of their type (0 for Kerberos 4, 1 for GSSAPI), followed
by the base64 encoded representation of their exported name, followed by
the display name of the identity. Each field is whitespace separated.
For example:
1 BAEACwYJKoZIhvcSAQICAAAAEHN4d0BJTkYuRUQuQUMuVUs= sxw@INF.ED.AC.UK
is the representation of the GSSAPI identity "sxw@INF.ED.AC.UK"
An addition to the test suite is also provided which will test all of
the existing, and new super user manipulation functions.
Marc Dionne [Tue, 23 Nov 2010 23:39:33 +0000 (18:39 -0500)]
Cache bypass: Only compile bypass code for the Linux kernel
Only compile the afs_bypasscache.c code if AFS_LINUX24_ENV is set,
since it's currently the only case where the code is actually used.
Only sections that caused problems for UKERNEL were previously
ifdef'ed.
Besides making the code cleaner, the main effect of this change
is to prevent compiling most of the bypass code for UKERNEL where
it isn't currently used.
If support for bypass is added for other platforms eventually, the
code here would need to be reworked anyway, ideally abstracting out
and moving any OS specific bits into the platform subdirectories.
Marc Dionne [Tue, 23 Nov 2010 23:21:16 +0000 (18:21 -0500)]
Cache bypass: remove ifdefs under src/afs/LINUX
Compile cache bypass code unconditionally under src/afs/LINUX
since it is now always enabled. Also remove syslog messages
about a "cache bypass patched module" when loading and unloading
the module.
Marc Dionne [Tue, 23 Nov 2010 22:50:25 +0000 (17:50 -0500)]
Cache bypass: Remove AFS_KMAP_ATOMIC
Since AFS_KMAP_ATOMIC is defined unconditionally, remove the ifdefs
and the code for the !AFS_KMAP_ATOMIC case. We probably don't want
to support this feature on a kernel old enough not to have kmap_atomic.
This should exist on all 2.6 and even 2.4 linux kernels.
This simplifies the code for maintenance and later changes.
Steve Simmons [Tue, 31 Aug 2010 23:21:50 +0000 (19:21 -0400)]
Update the man pages pod source adding text to discourage use of
uss. Usually the text added was a copy of a CAUTION section that
had already been added in a few places. This change applies it
consistently across all uss-related man pages. In pod1/afs.pod that
text would be excessively wordy; a briefer note is used there to
direct the reader to the full text.
This is a partial fix for RT bug #128018. It does not fully close
the bug; the AFS Administrators Guide needs to be updated as well.
Jeffrey Altman [Wed, 24 Nov 2010 10:24:43 +0000 (05:24 -0500)]
Windows: indicate that roken is a dynamic library for roken.h
Since the windows build of roken is a dynamic library we must
define ROKEN_LIB_DYNAMIC so that roken.h will specific the
correct values of ROKEN_LIB_VARIABLE, ROKEN_LIB_CALL, and
ROKEN_LIB_FUNCTION.
Jeffrey Altman [Wed, 24 Nov 2010 05:44:02 +0000 (00:44 -0500)]
roken: modify build configuration to permit Windows to work
When building roken the library must be built with different
ROKEN_LIB_xxx macro values than when the library is being
linked against. In particular, ROKEN_LIB_VARIABLE needs to
be exported when building and imported when linking.
Jeffrey Altman [Tue, 23 Nov 2010 17:11:46 +0000 (12:11 -0500)]
rxkad: fix bg-fcrypt to work with roken
On Windows, roken.h defines iov_len as len and iov_base as buf
so that it can use _WSABUF as the iovec structure. This has negative
consequences when there are local variables iov_len and iov_base
as the same time as there are variables len and buf. This was the
case in bg-fcrypt rxkad_EncryptPacket and rxkad_DecryptPacket.
As a result, rxkad compiled cleanly but did the wrong thing.
This patchset renames iov_len to ilen and iov_base to ibase in order
to avoid this issue.
Simon Wilkinson [Sun, 21 Nov 2010 10:16:26 +0000 (10:16 +0000)]
rx: Rework identity copying
Change the behaviour of the rx_identity_copy function so that it
copies the whole identity, not just the contents. Add a new function
rx_identity_copyContents which just copies the contents of an identity
into an existing identity structure.
This restores symmetry with the free and freeContents functions.
Ben Kaduk [Sat, 6 Nov 2010 04:02:31 +0000 (00:02 -0400)]
FBSD: close race in afs_root
Previously, we called afs_PutVCache(afs_globalVp) directly. This
is unsafe because PutVCache acquires locks which can sleep, losing
the serialization of the GLOCK. In rare circumstances, this can
result in two threads simultaneously making that call, and the
second one would panic in vputx() with a negative refcount.
Close the race by using a local variable for the afs_PutVCache()
calls, applying the change to afs_globalVp before dropping the GLOCK.
While here, fix up other race conditions.
Simon Wilkinson [Sat, 20 Nov 2010 10:25:06 +0000 (10:25 +0000)]
Imports: Add reporting of new and removed files
Make the commit message produced by import-external-git.pl also report
which files the script added and removed. Whilst this information is
available from the patch itself, having it in the commit message makes
it much easier to tell what happened when reviewing history through
git log.
Christof Hanke [Fri, 19 Nov 2010 20:30:21 +0000 (21:30 +0100)]
use proper 64bit casting for pointer-math
building with "./configure --enable-checking --enable-supergroups"
fails, because on 64bit, the casting in map.c gives a warning.
Just add another ifdef and cast according to the size of a pointer.