For some reason, the ReplayLog code was printing encountered errors in
the replay log as debug messages. Print them out as regular log
messages instead, since these are errors that at least warrant
visibility, if not more action.
Change-Id: Ifba22278e2f5f33010b87eebfc484ccd3745f916
Reviewed-on: http://gerrit.openafs.org/2225
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
When attempting to read the replay log, ubik was not ntohl'ing all
integers that were read in from the log, causing the log to appear
invalid on little-endian systems. Fix it.
This problem manifests as apparent corruption in the database on top
of ubik when a commit is occurring when we are shut down, or a disk
error is encountered during a commit.
Change-Id: I82e04c59d0f55aa2105b02feb6ee332ea85eb4f3
Reviewed-on: http://gerrit.openafs.org/2224
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
no more APSL source is used. also, reboots are not required.
Change-Id: I61217b557c6193c922bc1b72b41e076e81db49e5
Reviewed-on: http://gerrit.openafs.org/2218
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
In auth_to_cell(), we only strdup() into the linkedcell argument
if there is a linkedCell in the current cellconf. However, in
main(), we free linkedcell if it is non-NULL, but it is allocated
on the stack and could contain garbage. free() chokes on such
garbage, causing aklog to abort().
If we copy nothing into linkedcell, set it to NULL so that we
do not attempt to free the bogus pointer.
Change-Id: I92905a5f17021ce1bc41909f5ceb1b0344456d93
Reviewed-on: http://gerrit.openafs.org/2213
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Recent investigations suggest that we no long require the BKL on
Linux. As an experiment, remove it.
Change-Id: I764fe1f6e9761ada5a0a86ba59450c0615bb1e78
Reviewed-on: http://gerrit.openafs.org/1823
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Remove the configure flag to specify the location of the Digital
UNIX kernel headers and some setup for the kernel module build.
Note in README that Digital UNIX / Tru64 is supported for servers
only.
Change-Id: I983f74068b1a1ae76d9a2b2549a8a141dba4e075
Reviewed-on: http://gerrit.openafs.org/2207
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
makesname() make a semaphore name for use in <sys/sema.h>-type routines on
IRIX. It takes as input a pointer to an allocated string buffer (sname) of
size METER_NAMSZ, a string prefix (prefix), and a vnode number (v_number).
When complete, sname is returned, pointing to the beginning of a
NULL-terminated string containing the new name, with a maximum of
(METER_NAMSZ-1) characters plus the NULL. The name is a concatenation of
the string at 'prefix' and the ASCII representation of the number in
'v_number'.
Note: Due to IRIX's use of uint64 to represent vnumber_t and a maximum
semaphore name length of 15 (METER_NAMSZ-1), this function cannot be
guaranteed to produce a name which uniquely describes a vnode.
makesname() is already called from afs_vcache.c but not (or no longer)
available / implemented elsewhere.
Change-Id: I4331c161b68b39a4c067691c97363b637d13ff15
Change-Id: Ia0a615426dc05e01a98e53e89ec3bae3726cac34
Reviewed-on: http://gerrit.openafs.org/2155
Reviewed-by: Chaz Chandler <clc31@inbox.com>
Tested-by: Chaz Chandler <clc31@inbox.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
As part of host state verification, we were calling
h_stateVerifyAddrHash to verify that all addresses for a host were in
the address hash table. The problem with this is that interface
addresses that are not marked as 'valid' are intentionally not in the
addr hash table. So, any time there was a non-'valid' interface
address in the host state, we stood a very good chance to fail to
verify the state.
Instead, if we have a non-'valid' address, try to verify that it is
_not_ in the addr hash table (or at least, is not pointing at the host
with the non-'valid' interface addr), since they're not supposed to be
in there.
Change-Id: I02fb0f516fa3ef384471d19bb1b970cfd8aff874
Reviewed-on: http://gerrit.openafs.org/2205
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
When h_stateVerifyAddrHash logs that an error in state verification
occurs, it was only logging the address of the host causing the
problem. Log the port, too, since there could be multiple hosts with
the same address.
Change-Id: Ideee34f075948a0cb7cc1014920be5e120bdc6ef
Reviewed-on: http://gerrit.openafs.org/2204
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Fix various warnings in the aklog and klog code when building with
Heimdal. Use krb5_get_init_creds_opt_alloc if it's available rather
than allocating the struct off the stack, since the _opt_init
function is deprecated.
Change-Id: Ieff986121de9078e9402b0a51a8855655330caba
Reviewed-on: http://gerrit.openafs.org/2082
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Previously, building with Kerberos support required either passing a
flag to configure giving the location of a krb5-config script, or
manually setting variables specifying the Kerberos libraries and
header path. Replace that code with code that checks for Kerberos
libraries automatically and builds the Kerberos code if any were
found, with support for doing direct library probing if there is no
krb5-config script.
Add several platform-specific overrides directly into the configure
support, so we should be able to build out of the box on Mac OS X 10.3,
HP-UX, and AIX Kerberos with the new probes.
The Kerberos Autoconf macros are now the versions that come with
rra-c-util and are tested with multiple other packages, so both
OpenAFS and those packages will be able to benefit from further
portability improvements.
Update README for the new building instructions, documenting how to
configure the Kerberos probes if they can't automatically figure out
the location and flags for Kerberos on your system.
Change-Id: Ia35bb0dbc6b94c6b4dfe8165388447dbfcb31a29
Reviewed-on: http://gerrit.openafs.org/2026
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
In non-DAFS GetVolume, previously we waited for a volume with
vp->goingOffline set to go offline before we return. However, the
fileserver afsfileprocs.c case can treat the "going offline" case and
the "is offline" case identically, so there is no reason to wait. So
make the fileserver call a new GetVolume variant that does not wait.
Without this, all of the threads in the fileserver can potentially be
tied up by waiting for a volume to go offline, if the volume is taking
a long time to go offline due to an offline request following a client
slowly accessing the volume.
Change-Id: I58ae11e585852130154389d8df0567432cd0c2df
Reviewed-on: http://gerrit.openafs.org/2124
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
afscp was reporting its local address list in net-byte order, and then
giving that list as a response to RXAFSCB_WhoAreYou. Instead, convert
the addresses to host-byte order, since XDR takes care of endianness
foo.
Change-Id: I5d7d57f811ccaeada235e694ec5f343c1ac535b7
Reviewed-on: http://gerrit.openafs.org/2206
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
assert() is not used within mkvers.c.
afsconfig.h and afs/param.h have dependency problems in
src/config/
Change-Id: I2012a01c87cbd993a70df76ee3384b43ff037b29
Reviewed-on: http://gerrit.openafs.org/2203
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Commit 00c37e8634 introduced a few
usages of 'ifeq' in cross-platform Makefiles, breaking the build when
not using GNU make. Fix this by making the tptserver and tvlserver
'install' and 'dest' targets behave more like the 'ptserver' and
'vlserver' ones, and correct the ptserver 'install' target while we
are here.
Change-Id: Ia3fd9149c0f18a96a9899a5dfde41e53a45102b7
Reviewed-on: http://gerrit.openafs.org/2160
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If one runs make check without previously running make at the top
level first, it didn't build the util test programs properly.
Recurse into subdirectories for make check as well, and add the
check, test, and tests targets to tests/util/Makefile.in
Change-Id: Idc2caf4cf83a48da350e724aba2ac1228795085d
Reviewed-on: http://gerrit.openafs.org/2162
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The recent addition of AFS_NORETURN broke the Windows build
because afsconfig.h and afs/param.h were not included everywhere.
Make sure that they are.
Change-Id: I5962fe1178f73273f5b3c1d269b1a125fba2d2c6
Reviewed-on: http://gerrit.openafs.org/2159
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
The lstat() macro definition has to take into account
the version of the compiler and the size of time_t.
Change-Id: Id7ad8c3956bba9832cc028db628cfabe58a1d8d9
Reviewed-on: http://gerrit.openafs.org/2158
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Visual Studio older than 1400 (VS8) does not define errno_t.
LICENSE MIT
Change-Id: I27c0892d8ba4a371417f635b0d6e5677fa655422
Reviewed-on: http://gerrit.openafs.org/2157
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Add ubik_BeginTransReadAnyWrite, which allows for reading from the
database, even while there is a conflicting ubik write lock. Reads are
still blocked while the local database is updating due to a write
transaction commit.
Change-Id: I5604fa3cc8a334606f5e3535aed6f6cedcb5f167
Reviewed-on: http://gerrit.openafs.org/2103
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
make things buildable on arm darwin
Change-Id: I88af2b82e9ed356fd57aa8f05dfee71d7fa6cd8a
Reviewed-on: http://gerrit.openafs.org/2153
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
on macos systems where we can't get the environment,
just return from ktc_newpag
Change-Id: I9a169d0bf035c40d727a386bb3d2070eea225ed4
Reviewed-on: http://gerrit.openafs.org/2150
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The names of some configure defines changed with the recent autoconf
cleanups. This one was missed and was left with the old value.
Change-Id: Ibce5e36b8ae6becdfa61bf6e9c440b3d9a6fa272
Reviewed-on: http://gerrit.openafs.org/2130
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
in order to cross compile, allow a way to generate generated files on the host
Change-Id: I9639f350b179dbeb3d45802e8685da88a3b06c83
Reviewed-on: http://gerrit.openafs.org/2147
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
if you wish to cross compile, you want these things. arrange to
be able to build just them
Change-Id: I6bee40b61a16722c402832bba39d2e88dcabec25
Reviewed-on: http://gerrit.openafs.org/2145
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
set an error code so idle dead time is enforced on sending. needed
in order that MTU pings be activated.
Change-Id: I8cf1ca81e6519b440fc679e85f327f338400c29a
Reviewed-on: http://gerrit.openafs.org/2116
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
engage mtu pings. only occur while a call is active but results are
cached per-peer. requires idle dead time to be in use, or does not
activate. (needed to time out the call, otherwise, keepalives will
succeed and the call will thus not hit regular "down server" timeout)
Change-Id: Ic29b1b5713fb6debde14f4adfd5019ee80cc9e3c
Reviewed-on: http://gerrit.openafs.org/2115
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
for the purpose of mtu discovery, we need a sequence number to
correlate if a large packet is acked. don't track sequence number
0 packets. a later change adds the mechanics needed for MTU pings
Change-Id: I83d4466115bbd45acdc2777bfbef0ff393dd5a3f
Reviewed-on: http://gerrit.openafs.org/2114
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
we already set a local variable, conn, to call->conn. use it instead
of dereferencing call->conn repeatedly
Change-Id: I5d38edc1d3507a717598140393094b1ba22ced46
Reviewed-on: http://gerrit.openafs.org/2113
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
if RX_MSGSIZE is analyzed and we'd retry, so indicate to our users
Change-Id: I77aba5dffd4280e0ee43383cadb34aca4042cbd6
Reviewed-on: http://gerrit.openafs.org/2117
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
fix type of intermediate value used in CAS operations, and reformat slightly.
LICENSE BSD
Change-Id: If49be8e020e0f735d67290440b1a74caccf90bf0
Reviewed-on: http://gerrit.openafs.org/2152
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If DoBosHostList ends up being called without the -server argument
in its command structure, then a printf will attempt to dereference
a NULL pointer to the -server field.
Caught by clang-analyzer
Change-Id: I1114406d03b265f4d780efd8e84fea53013cb51c
Reviewed-on: http://gerrit.openafs.org/2143
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If the call to a pioctl returns an error, it's possible to reach
the end of the storebehind function and try and print an old, or
bogus, value from the pioctl data block.
Caught by clang-analyzer
Change-Id: I1209c0c24730273510fbad98a75a429917836605
Reviewed-on: http://gerrit.openafs.org/2142
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Unless CopyOnWrite2 encounters the condition where
(rdlen != length) || (wrlen !=length) it will never set a value
for the 'rc' return code, and so return with an undefined value.
Looking at the code, it looks like rc should be 0 in all other
situations, so this patch provides a default value.
Caught by clang-analyzer
Change-Id: If3e528f3d66abb3dde6da2304084f7698c05b863
Reviewed-on: http://gerrit.openafs.org/2141
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If open() is called with a the O_CREAT flag, then it requires a
3rd argument, containing the mode with which to create the file.
On DARWIN (when we always use O_CREAT), and on other platforms
where the first call to open returned E_NOENT, we weren't doing this,
and so were presumably getting a random mode of whatever garbage was
on the stack.
Caught by clang-analyzer
Change-Id: Ic173e582e0d46f6d4cf8801dc7a6b4b393db5063
Reviewed-on: http://gerrit.openafs.org/2139
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The 'result' variable is only used on AIX - only bother assigning
it when we're building there.
Caught by clang-analyzer
Change-Id: I06848837282ff3f318474f55f2ee013255ad37c8
Reviewed-on: http://gerrit.openafs.org/2138
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
When klog saved the password entered by the user to allow attempts
at multiple AFS principals without reprompting, it copied the whole
buffer according to the declared reply length into local storage.
This was done without regard to the local allocated storage size,
and was then nul-terminated without regard to the allocated storage
size. Both klog and Heimdal use a size of BUFSIZ for the reply
buffer by default, which meant that klog on Heimdal was writing past
the end of the allocated structure when nul-terminating the password.
Store our allocated buffer size in the struct and only copy at most
one fewer than that many characters, and then nul-terminate
accordingly.
(The assumption that BUFSIZ is always long enough is still bogus,
but that's larger surgery.)
Change-Id: Ic8d4357aad2f8dfa0fffe9849d2546a88ecd246a
Reviewed-on: http://gerrit.openafs.org/2129
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The s390x param.h file defines AFS_64BIT_KERNEL, but this looks to
be AIX specific, and some Linux headers expect AFS_LINUX_64BIT_KERNEL.
This causes many errors because we end up trying to use struct flock64
instead of struct flock.
Change-Id: I39a4a94fa895143172c1ee75ff71c2015232156f
Reviewed-on: http://gerrit.openafs.org/2131
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Use mkstemp wherever we have it available, to silence warnings
about mktemp's safety.
When we do use mkstemp, use it properly. It doesn't return void,
it returns an open filehandle. Convert this filehandle into a FILE *,
rather than throwing it away, and leaking an open file descriptor.
Caught by clang-analyzer
Change-Id: Ib5864f684c6d5a8686e0a872364a645c90a29390
Reviewed-on: http://gerrit.openafs.org/2144
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If str is NULL on entry to _intlize, than it will leak the
CFStringRef that it constructed a few lines earlier. Fix this.
Caught with clang-analyzer
Change-Id: I6d62e7792918da95e4fed1c676d14ad9124d93fa
Reviewed-on: http://gerrit.openafs.org/2137
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If IsValidCellHandle returns false, then we can jump to
fail_pts_GroupMemberRemove, and end up using a value for
ids.idlist_val which hasn't been defined. Fix this.
Caught by clang-analyzer.
Change-Id: I030d155f9ad2481250e84c31d4d7d26cb39a9c61
Reviewed-on: http://gerrit.openafs.org/2136
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Rearrange the way that we define compiler attributes so that we
can define them for clang, too. Don't assume that clang will support
all of the attributes that gcc does, so split them up into separate
sections.
Change-Id: Ic6233f5c63a07b3ef99a85ae3be9e45e28387127
Reviewed-on: http://gerrit.openafs.org/2135
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>