Add an API for acquiring and releasing file-level locks. This abstracts
away the platform-specific aspects of file locking, and also makes the
locking work when several threads attempt to acquire a lock within the
same process.
This commit just adds the functions and datatypes; nothing actually uses
them. The users will be added in (hopefully nearby) future commits.
Change-Id: I6bffb6a7dd47ffb5c8a9942b16cd5ef6bc7eb62e
Reviewed-on: http://gerrit.openafs.org/1237
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Pull the token management operations (get, set and compare tokens) out
into their own functions. Again, this is purely a refactoring exercise -
no behaviour changes are anticipated as a result of this change.
Change-Id: I9c64a319fcaa2edeb492c7822f9bae64c91cc20c
Reviewed-on: http://gerrit.openafs.org/1326
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This change refactors all of the rxkad specific token acquisition code
out of the common auth_cell loop, and into a number of functions of its
own. There should be no functional changes.
Change-Id: I61314588ba4db6b85db03314d4524322f74c9230
Reviewed-on: http://gerrit.openafs.org/1325
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
aklog was scattered with things like
if (dflag) {
printf("Oh no, the world is ending\n");
}
Simplify these by adding a dprintf() function, which only prints its
arguments if dflag is defined. Use this throughout the code.
Change-Id: I673942e9ea6a8b96ea9d11a608cfaeaf00098b88
Reviewed-on: http://gerrit.openafs.org/1324
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
An earlier patch added the new get_realm_from_cred function,
but failed to update the callsite to use it. Fix that.
Change-Id: I9e9d7545b20df041400d140e80c7f018b033043e
Reviewed-on: http://gerrit.openafs.org/1334
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Assorted small changes to the way realms are handled by aklog:
* Remove static buffers when realms are passed between functions
* Add cleanup for all dynamically allocated strings to auth_to_cell
* Create an extract_realm helper function to handle extracting realm
information from principals.
* Add a function to handle extracting realm information from decoded
tickets
Change-Id: I320389033f4862d30774b40103e536fd5bac841b
Reviewed-on: http://gerrit.openafs.org/1323
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
confname makes a static copy of the AFSDIR_CLIENT_ETC_DIRPATH string. As
pr_Initialize takes it as const, there's no need to maintain our own
copy, and so this is superfluous. Remove it.
Change-Id: I64b13aae80b15f6b7511a040f39467bca76186b8
Reviewed-on: http://gerrit.openafs.org/1322
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Clean up the aklog get_cellconfig routine, so that it is no longer
reliant upon global variables.
* Tidy the handling of local_cell, and use dynamically allocated,
rather than fixed length buffers.
* Use the cell name contained within the afsconf_cell structure,
rather than a local copy
* Access linked cell information from afsconf_cell, rather than
explicitly returning it
* Don't use globals for linkedcell
Change-Id: I6ad42c70dcac7f285997be7c95a77dc67bf63679
Reviewed-on: http://gerrit.openafs.org/1321
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Fix indentation so that code lines up correctly,
Fix function declarations so they match the house style.
Remove some dead code and comments
Move comment blocks so they're above the code that they're describing.
Remove unused 'lastcell' string
Change-Id: Ief924675384e28885e4b7b88c4d5932279c9b26e
Reviewed-on: http://gerrit.openafs.org/1320
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Sort out the function call statistics interface. Whilst it's still
wretched, this makes it a little less so.
*) Add some warnings at the start of the afs_CMStats structure about
what needs to be done when adding things there
*) Remove the conditionals around the CacheBypass counters, so that stats
clients don't need to be built with the same options as servers
*) Add all of the stats entries added after IBM to the xstat_cm_test
routine
*) Add a warning to xstat_cm_test if the data returned from the server
differs in size to the local stats structure.
Change-Id: If1ffb68c84bca972f685ae619febba8c6f8b5e17
Reviewed-on: http://gerrit.openafs.org/1319
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This change eliminates the redundant iteration over the
supergroup[] array in DumpRecreate. By iterating over both
this array and entries[], duplicate au lines are created
and the count variable becomes incorrect. Furthermore,
the au lines created in the supergroups[] section were
incorrectly in the form of au <group> <member> instead
of au <member> <group>.
FIXES 126500
Change-Id: I087772b63934406273f153f4b8a581d965f1e4d5
Reviewed-on: http://gerrit.openafs.org/1316
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
fix up the build for ukernel when warnings are enabled
Change-Id: I2520f77e043f2e75297ef66a4c44b6e456d30892
Reviewed-on: http://gerrit.openafs.org/1329
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add the new xdrmem and xdrlen XDR sources to kernel space. Make some
changes to the xdrmem header file to permit it to build in kernel space.
Change-Id: I2ab32f67287df28d4ffded651d3d49d1211dd40e
Reviewed-on: http://gerrit.openafs.org/1328
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add xdrlen and xdrmem to libafsrpc, so they're available to pthreaded
binaries.
Change-Id: I55ed54a3fb87865d286bf2019858afb037c967ea
Reviewed-on: http://gerrit.openafs.org/1327
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
ktc.c has had for a long, long time a 'new' token interface, which
was only enabled if KERNEL_KTC_COMPAT is set. However, this is never
defined in our tree, relies on a syscall that just won't work on
platforms such as Linux, and won't support any of the new token
formats we're planning. So, just remove this interface from our
code - it's in version control should we want to revisit it in the
future.
Change-Id: Iab3dd04498799f061449a50bdac39c6407a9fdd7
Reviewed-on: http://gerrit.openafs.org/1318
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Many modern process supervision systems (runsv, daemontools, sysvinit)
expect to be able to terminate a process gracefully by sending it a
SIGTERM; although SIGQUIT is nominally used for this purpose it seems
to have fallen into disuse as a matter of practice. Therefore, to
integrate as smoothly as possible with the outside world, bosserver
should catch SIGTERM and interpret it as a request to shut down
gracefully.
When used with process supervision (runsv or daemontools), the
previous behavior would cause bosserver to die but leave its children
running, and then bosserver would get restarted by the supervisor.
The result is a situation where there would be two copies of every
bnode process. Mayhem ensues.
Change-Id: I8690fba0af6c2b9f9613527254af915be9e76dfc
Reviewed-on: http://gerrit.openafs.org/1310
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Added some text that the CellAlias file is only used on Unix.
LICENSE BSD
Change-Id: I913d6a0774240ffc16cf92cfa92c4b2d06f41fd6
Reviewed-on: http://gerrit.openafs.org/1307
Tested-by: Jason Edgecombe <jason@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
let NewVCache return a vcache which is already configured for bulkfetching
takes the bulkstatus "sequence number" and sets the flags and length
Change-Id: Ife67c3deccda2ceefb4a0f1c98a837a3b6401cd2
Reviewed-on: http://gerrit.openafs.org/1302
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Some compiler versions complain that "code" might be used uninitialized
here. If opening the configuration files fails, conf would be null
and the condition would indeed test an uninitialized variable.
Change-Id: I1d4da49a5afc94ac6617201110be84a0e5548f38
Reviewed-on: http://gerrit.openafs.org/1306
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
pull out the unused code which tries to cope with a failed vnode hold.
if we become able to do so, we can do so later
Change-Id: Ib53f469feaba4c6ec6b15730315e87e75f8f9eb8
Reviewed-on: http://gerrit.openafs.org/1301
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
use icmn_err facility to print error (and panic for osi_Panic)
note that solaris vcmn_err is basically the same, but there
may be issues per some commenters.
Change-Id: I56e825e16d69a232a2cdc5108071a00858ecf45c
Reviewed-on: http://gerrit.openafs.org/1287
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Provide some explanation for the various FSSYNC commands, and what they
are there for.
Change-Id: I572300b66cc8b6a1b0f2aa185edd198c237f7225
Reviewed-on: http://gerrit.openafs.org/1236
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The explorer shell extension was passing the wrong parameters to
the MessageBox API when a symbolic link add failed. The end result
was stack corruption.
FIXES 126406
Change-Id: I59b8b71d947525adccbd817cd5b6d4de5bf082b7
Reviewed-on: http://gerrit.openafs.org/1298
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
the hook added to force reschedule to be noticed was disabled in the
course of testing. re-enable it.
Change-Id: Id9018b66c9adfc39709b3739510987402dc1fb18
Reviewed-on: http://gerrit.openafs.org/1294
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
never be willing to sleep less than 500ms. additional tweaks to the
rx scheduler may be needed however before we always slept for 500; now
we'll sleep longer if no events are pending (but not forever)
Change-Id: I7fdb02dd7a383131fffcfae532d71c8fbeb97545
Reviewed-on: http://gerrit.openafs.org/1290
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If we can't use our stashed credentials (because SELinux hates us,
most likely), then fall back to trying the processes current credentials
instead of just oopsing.
Change-Id: Ib3676ff66f8400e86cccb97fb207a5f094ceb4ad
Reviewed-on: http://gerrit.openafs.org/1283
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
for now, just move it to the end of the file
Change-Id: I7bab901be76fabb75f688096e9637caada883816
Reviewed-on: http://gerrit.openafs.org/1286
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
use an interruptible sleep (and wakeups on shutdown or schedule) instead of
polling, on macos
Change-Id: I25934efac63ccaf9015f79c6711d09c693f0ad51
Reviewed-on: http://gerrit.openafs.org/1066
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
and the one place it was used it seems to have been used wrong anyway
it's a relic from osf1
Change-Id: Iae72030dcbb812422431d3d23737f6c8fb5f0ca3
Reviewed-on: http://gerrit.openafs.org/1284
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Recent changes added a new dependency of afspioctl.lib to all
server binaries.
Export new afsconf_ functions from libafsauthent.dll
Fix afsconf_* usage in afsio.c
Change-Id: I03e377a3d28b4efbea4a799e6ca63606eab699c9
Reviewed-on: http://gerrit.openafs.org/1273
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The code for reading in and overwriting/replacing volume headers is
duplicated many times throughout the volume package. Consolidate the
code into the functions VReadVolumeHeader, VWriteVolumeHeader,
VCreateVolumeHeader, and VDestroyVolumeHeader. This makes it easy to
change the semantics of how headers are read/written, though this commit
should not change them.
Change-Id: Id395ee25fc2db92de9301b9cdbe18f30830e18d3
Reviewed-on: http://gerrit.openafs.org/1238
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
used when selecting dcache entries for truncation
Insure that afs_TruncateAllSegments() uses the correct [64-bit]
comparison when deciding whether to truncate chunks:
alen - AFS_CHUNKTOBASE(tdc->f.chunk) for a file > 2GB would fail
to be recognised negative with an "afs_int32 newSize", even with
alen = 0 and big tdc->f.chunk.
Change-Id: Id77109fb8238234dae725bd876f70ea0fbd403fc
Change-Id: If0120e21a52316e536d03241c83e8f0d36614c13
Reviewed-on: http://gerrit.openafs.org/1252
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
NULL it so we don't compare against garbage
Change-Id: Id80ab21a9a227ec8fd09dbc9a822fd1ce873b333
Reviewed-on: http://gerrit.openafs.org/1281
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
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>