this interface works how osi_Wait *should*, except on some platforms Wait
appears to wake up all waiters(!) by using a single wait channel in the
backend. rather than change that and risk problems, introduce an interface
using the same system of events we use for osi_Sleep
Change-Id: Ic91726b138bd2512282896ec48c542063ef000cf
Reviewed-on: http://gerrit.openafs.org/1233
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
reuse the Heimdal method for internationalizing comerr. as a side effect
provide heimdal-compatible com_right.
LICENSE BSD
Change-Id: I6e699125ad3af1d402f14f9462e434c30ad4d1fd
Reviewed-on: http://gerrit.openafs.org/1225
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The VenusLogging function no longer exists - instead of having a
stub the returns EINVAL, just use the existing Bogus stub (which
returns EINVAL) instead.
Change-Id: I9cc1746577c19ff2e4087e16e8e2b56c0070c75d
Reviewed-on: http://gerrit.openafs.org/1279
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Much of the documentation in afs_pioctl.c spanned many many lines.
Wrap it all at 80 columns for a more pleasant reading experience.
Change-Id: Iae15a792a4cd6fa54eda65d43157ca3f7910ca2b
Reviewed-on: http://gerrit.openafs.org/1278
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The ioctl code was a nightmare of #ifdefs. This patch reworks it
so that there is a single function for each operating system, which
makes it much easier to see what's going on. Eventually it should be
possible to move these reworked functions out into the osi directories
Change-Id: I61f70b23ad0c7ea137e6aa843be6f75c83c02843
Reviewed-on: http://gerrit.openafs.org/1244
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
UKERNEL redefines the character 'u' to do a function call. This
hurts other kernel developers in all sorts of interesting ways. Remove
the definition, and instead explicitly reference the get_user_struct()
function in those places that we need to.
Change-Id: I64be2eb527c779df0a3d4508444ed68f3634667d
Reviewed-on: http://gerrit.openafs.org/1243
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add a enumerated type for rx security indexes, initially containing
the values reserved for null, kad, gk, and k5. Start to use this type,
and related names, rather than hard values throughout the code.
Change-Id: Ic71e5da28b4270abf7b6688b2c6438f17268f1da
Reviewed-on: http://gerrit.openafs.org/1242
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
DAFS added the -forceDAFS flag, which made the '-f' flag ambiguous, when
it used to be short for '-force'. Restore the previous meaning of '-f'
to reduce backwards incompatibility.
FIXES 124916
Change-Id: Ieb864b35a91000960f9d9c503c28db56602df13e
Reviewed-on: http://gerrit.openafs.org/1254
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Hugely simplify the ifdef ladder in lock.h, by using #elif, rather than
multiple levels of nested ifdefs
Change-Id: I8fc730242decab0a0f864a9814c6c47c9974b496
Reviewed-on: http://gerrit.openafs.org/1241
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The ifdef ladder in lock.h was a pain to read. Indent it to make it
clearer.
Change-Id: I673a85785e1e6207dae55616845d5cb982694189
Reviewed-on: http://gerrit.openafs.org/1240
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reorganise the code which creates a client security object for the
Unix CM into its own function.
Change-Id: Ic92ca4022b000c5cd48bbe6318bf83379626e890
Reviewed-on: http://gerrit.openafs.org/1239
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Fix fallout from d008089a79 - sc wasn't
being initialised when it was declared, and some code paths would fail
to set it. This led to the == NULL check failing, and a new rx
connection being created with an invalid pointer as a security context.
Disaster ensued ...
Change-Id: Ibae3c72408d1145bc771bd07e573427d9f427679
Reviewed-on: http://gerrit.openafs.org/1277
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Put back the header directives that only turns on AFS_GLOBAL_SUNLOCK
when compiling for multiprocessors system. When enabled on a single
processor OpenBSD system, it is possible to put the entire system
into a lengthy (minutes) lock state when performing multiple AFS
activities. The system behaves MUCH better when AFS_GLOBAL_SUNLOCK
is not set (no problems encopuntered). This whole locking mechanism
needs a bit more examination on OpenBSD before this is useful in
single processor mode.
Change-Id: I19813b78ad8d705b4f043ccb3a38c83e278972e9
Reviewed-on: http://gerrit.openafs.org/1276
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
A shutdown or unmount of AFS on OpenBSD will invariably result in a kernel
panic. This is because the afs_unmount() routine does not (can not?) force
vnode releases if the vnode is still busy. However, it continues on
nonetheless and dies a horrible death a little later.
This update causes a return from afs_unmount() with EBUSY if all the vnodes
weren't released. This results in error messages on shutdown but the overall
process continues more reliably and reboots, for example, work.
There is likely a better solution to this but at least this is no worse than
a system crash and it doesn't require console (or power button) intervention
so it should do until I have the chance to explore further.
Change-Id: Ia70f83bda748ea3d0b81b341a292e83121446567
Reviewed-on: http://gerrit.openafs.org/1275
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Starting with OpenBSD 4.2, the interface list returned by sysctl using
NET_RT_IFLIST contains multiple versions of the data. This really
messes up the rx_getAllAddr_internal() routine that returns a list of
valid interfaces for the system (to the point where none are returned).
This change adds a routine that cleans up the data returned by sysctl
so it returns only a single (the most current) version of the data.
That stops afsd (among others) from being cranky when it starts up.
Change-Id: Ief1df0d2c3eb241c45b439a785ddb67d3afe992c
Reviewed-on: http://gerrit.openafs.org/1274
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The internal malloc memory types for IPv6 (M_IP6OPT, ...) conflict
with the type numbers used to designate AFS memory (M_AFSFID, etc.).
This change moves the AFS memory type to a new number that does not
conflict. This is not a serious issue but can create real confusion
when trying to debug or track memory issues, among other things.
Change-Id: Icccaa7c06443cab008013414cb3c2ab4ea08889e
Reviewed-on: http://gerrit.openafs.org/1271
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
When determining the volume type of a volume, vsu_GetVolumeID() checks
to see if the volume name ends in '.backup' or '.readonly' by backing
up the appropriate number of characters from the end of the name. It
does not, however, check to see if it skips past the beginning of the
volume name. This can result in a segmentation fault (which it has for
me on many occasions during a vos release) depending on where memory
is allocated or how/if memory is protected.
This patch corrects this behaviour by checking the volume name string
length prior to doing the string comparison.
Change-Id: Ia27fcac76b86ae2707663caa6bff365a4e8dd0da
Reviewed-on: http://gerrit.openafs.org/1269
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
irix and aix do not have a vararg version of osi_Panic, fixed
AFS_ASSERT_GLOCK macro definition in afs/afs_osi.h for those two
platforms
Change-Id: I0b541d2c1edad1364ef1c91dec84b9d4319c4e62
modified: src/afs/afs_osi.h
Reviewed-on: http://gerrit.openafs.org/1267
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add config param header and sysname number for OpenBSD 4.6.
As well, add an additional parameter to a call to ifa_ifwithnet()
when looking up the MTU for an interface to indicate that the call
should use the default routing table. With the advent of OpenBSD
4.6, the system has started to make provisions for multiple routing
tables which included a change to the calling sequence for this
routine.
Change-Id: Idb53efef0e229ca26bd587f2f8cd9df8a0248227
Reviewed-on: http://gerrit.openafs.org/1265
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
in order to go back versions, tell the install not to enforce
"no backrev"
Change-Id: Ifb4bee86344560d63c9b8ab3cd789f25ed8629b8
Reviewed-on: http://gerrit.openafs.org/1249
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
AFS_AFSDB_ENV was removed from the rest of the source tree.
Now remove it from kauth/user_nt.c so that DNS lookups can
be performed from the ka_ authentication routines.
FIXES 126366
Change-Id: I99cf6ada8b672398c0cfc6c8251cfc8dfdae9a31
Reviewed-on: http://gerrit.openafs.org/1245
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Commit 21cbf7fee0 activated some
previously unused cleanup code. Part of this clears afs_stats_cmperf,
but these stats are used later to check for leaks of chunks allocated
with afs_AllocSmallSpace and afs_AllocLargeSpace. The result is a
message about unfreed blocks in the syslog with negative counts.
Since the structure is already cleared later in the shutdown process,
just remove this instance.
Change-Id: I6bf2ab37752d2623d072469fb87fa6d06e85b9ec
Reviewed-on: http://gerrit.openafs.org/1229
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
macos tries to look up ._foo stuff. correctly identify those (mvstat 2, not
1) and also use tryEvalOnly to preclude AFSDB lookups
Change-Id: I490fe98d695c4d230210bc4e4645ea20cd4d8fa2
Reviewed-on: http://gerrit.openafs.org/1228
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
remove the other echoes from these scripts
Change-Id: I46b43aabc0f6080f776e2ec610d748920bc18d3b
Reviewed-on: http://gerrit.openafs.org/1227
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
this was missed somehow in my verification. fix it now.
Change-Id: I35b16ed8dcb35b153d7bfb2360673a0f1323f03e
Reviewed-on: http://gerrit.openafs.org/1226
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
fs storebehind didn't allocate a large enough buffer for its call
to VIOCWHERIS. This meant that when it was called on a file with
more than one server (one in a readonly volume), it would error
out with E2BIG, rather than a more appropriate message.
Fix this, by using the generic 'space' buffer for the VIOCWHERIS
call.
Change-Id: Ida0d40175f07ad528720ca700db5b5027b975095
Reviewed-on: http://gerrit.openafs.org/1224
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Pioctl input and output handling was being handled in an adhoc
manner, with little or no detection of input and output buffer
overflow. Whilst overflow is difficult to provoke on a real system,
due to the size of the buffers being allocated for output, the code
was difficult to read, and fragile to maintain.
This patch adds an XDR like abstraction for marshalling and
unmarshalling pioctl data. Whilst the real XDR can't be used and
maintain backwards compatibility, this gives a similar elegance.
Input and output pointers are replaced with instances of
struct afs_pdata, which store both a pointer to the current position
in the data stream, and a note of where the stream ends.
All access to a data stream is now performed through a set of helper
functions, which handle the reading and writing of integers, strings,
and arbitrary blocks of bytes. An 'inline' function is provided for
those cases where direct access to the stream is required.
Change-Id: I6ed2e8e80cebde2abc6a517f4dbef09042b47037
Reviewed-on: http://gerrit.openafs.org/1223
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Update the twiddle utility (for manipulating rx settings in the
Unix CM) so that it builds with error checking enabled.
Also, add the binary to the gitignore file in that directory.
Change-Id: I5c19832579db139e5c558b3488d7c49fdb7c08c4
Reviewed-on: http://gerrit.openafs.org/1222
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Currently, code which uses xdr_mem needs to take a guess at the
buffer size required, allocate that guess, and error out if the
data being encoded actually exceeds the guess.
This adds a new XDR mechanism - xdr_len, which can return
(using xdr_getpos) the length of the buffer required to XDR
encode a given structure.
Change-Id: I6e04c051118a26441caebdbcb2b5768d3c4389b6
Reviewed-on: http://gerrit.openafs.org/1221
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
A number of forthcoming attractions require xdrmem, which is
currently not part of the Unix build. Fix it so that it builds
without warnings, and add it to the standard RX build.
Change-Id: I5a21b2c7cd837c317f16dc35bf12cdac69d10167
Reviewed-on: http://gerrit.openafs.org/1220
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add printf format checks to the remaining va-arg printf-style
functions in the tree. There are no error fixes required from this
change.
Change-Id: If774532a3ac5d8b611ec9f47576e933a57907185
Reviewed-on: http://gerrit.openafs.org/796
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add gcc printf format checks to rxi_DebugPrint() and osi_Panic()
Deal with the small amount of fallout.
Change-Id: Ic356028613087bda02beb9907886421d80a227c3
Reviewed-on: http://gerrit.openafs.org/795
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add a pair of interfaces to support the selection of a security
object by the client. The idea of these interfaces is to abstract
out the job of selecting an interface from the client code itself,
and into a common library. This reduces duplicated code, and makes
it easier to add new security objects in the future.
Change-Id: I2bf411e6b56534070c827d009d36fa8a618c4511
Reviewed-on: http://gerrit.openafs.org/1219
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add printf format checking to the afs_warn and afs_warnuser functions
and fix the fallout.
Change-Id: I81ed776308a31706bf307246c470ee409797f044
Reviewed-on: http://gerrit.openafs.org/792
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add gcc printf format checks to the afs_com_err() functions
Deal with the fallout, in particular change callers which pass
an empty format string to pass NULL instead - the com_err functions
already permit this alternate use.
There's a couple of real bugs here - in one case, we attempt to
print a NULL pointer, rather than a security index, and in the other
we supply a NULL format string, rather than the string we meant to
print.
Change-Id: Icd48f92a4447d4af3dba9a4caa2ff73c1657ad47
Reviewed-on: http://gerrit.openafs.org/794
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add gcc printf format checks to all of the logging functions
defined in src/util/afsutil.h
Deal with the fallout, in particular create cast functions to go
from VolumeId and VnodeId to (unsigned int)
Change-Id: I28181b73cfeac22cf869d34e75a8335e65125e36
Reviewed-on: http://gerrit.openafs.org/793
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The backup system has a global ktc_token, which is used
to work out when its credentials are about to expire. This leads to
an unfortunate dependency throughout the code on the format of this
token.
Replace this with a global time_t which stores the expiry time, and
copy the required field from the token into this when we get the
token. This limits the exposure of the token, and simplifies the code.
Change-Id: Ia2929c2c0a4c1ba9ca5db881865f33af5a732d2f
Reviewed-on: http://gerrit.openafs.org/1218
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add an interface for creating arrays of server security objects.
This collects all of the various daemon code for initialising
security objects into one place, reducing duplication and making
it easier to add new objects in the future.
Change-Id: I9df20afccdbac4a610cb5bde32f01069272f27a2
Reviewed-on: http://gerrit.openafs.org/1177
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Write some documentation for the -files and -excessive options to
fs getcacheparms
Change-Id: I769f8c0cf6d9d100a1687ae73a337132befb2449
Reviewed-on: http://gerrit.openafs.org/1217
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
InstallationCheck needs a strings dictionary to turn its errors
into human readable content. Add such a dictionary, and use the
correct product name and version for each Mac OS X release.
FIXES 126322
Change-Id: I8401a1163ea078e690152215c20db6970969ee04
Reviewed-on: http://gerrit.openafs.org/1208
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Fix/ignore some warnings with --enable-pthreaded-ubik:
- ubik/ubik.c: move rx_stackSize decl to non-pthread code, since it's
only used there
- budb/db_dump.c: move 'code' decl to non-pthread code, since it's only
used there
- ubik/recovery.c: move return to outside the ifdef, so we still have a
return statement in the pthreaded case
- Add -Wno-error to beacon.c in tubik, to match the ubik case
Change-Id: I614f2425c36e77bb1a08838b45166d8edb080c73
Reviewed-on: http://gerrit.openafs.org/1211
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>