8775 Commits

Author SHA1 Message Date
Andrew Deason
22149d82d4 namei: Log ListViceInodes write failures
If we fail to write to the inodeFile given by ListViceInodes, we
should log the failure. Otherwise, no indication is given as to what
failed, when a salvage gathers the inode list.

Change-Id: Ia54105e1043969781711b9168c6787d07d1d319f
Reviewed-on: http://gerrit.openafs.org/4294
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-24 09:21:05 -07:00
Andrew Deason
d6557a9cf7 salvager: Fix conversion from stdio calls
Commit 5247fa38a4faebfdffba178ca01e5b419f034d5d converted some I/O
calls in the salvager from stdio to OS_OPEN/OS_WRITE/etc. Fix some of
the conversions, including:

 - We need to pass O_CREAT to OS_OPEN calls, since we are creating
   these files

 - OS_WRITE returns the number of bytes written on success, not the
   number of "elements" like in stdio

Change-Id: I789b7549c1eabeb821591bf9f42d810252fb11e1
Reviewed-on: http://gerrit.openafs.org/4293
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-24 09:20:53 -07:00
Andrew Deason
a50f4c8d80 ihandle: Ensure FDH_REALLYCLOSE really closes
If FDH_REALLYCLOSE is given an FdHandle_t that has more than one user,
currently it does effectively nothing. Ensure that the file descriptor
actually gets closed on a subsequent FDH_CLOSE, but setting the new
fd_needs_rclose field.

Change-Id: I04794662ca64e6be718da82e10994a4a7bc0b39a
Reviewed-on: http://gerrit.openafs.org/4274
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-24 09:20:33 -07:00
Derrick Brashear
f41ee7d172 macos next support
first brush at supporting next macos. totally not lion about it.

Change-Id: I4d2e05f68266ea82de710717c5340f16425f897e
Reviewed-on: http://gerrit.openafs.org/4290
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-24 09:19:47 -07:00
Derrick Brashear
cfab7a166a osconf: reduplicate systype stuff
in some cases there is more to do, and in some cases we probably
already didn't build anymore, but, let's simplify.

Change-Id: I779c3ba8f3f02e6202700d96ee92cd473de66af2
Reviewed-on: http://gerrit.openafs.org/4288
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-03-24 09:19:33 -07:00
Andrew Deason
d4ebebd0c3 DAFS: Do not VDeregisterVolOp_r while exclusive
We should wait for a volume to transition out of an exclusive state
before calling VDeregisterVolOp_r on a volume, since some code may be
examining the vol op outside of VOL_LOCK in an exclusive state. We
should be doing this anyway before performing volume state checks,
since we may be trying to e.g. attach the volume at the same time.

Change-Id: I3a5b78b7c0033887a973ce941ced592df8c4bf3d
Reviewed-on: http://gerrit.openafs.org/4287
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-24 09:18:33 -07:00
Simon Wilkinson
b0921071dd rpm: Build srpms without %dist in their name
On RHEL6, %dist is set for all RPMS and SRPMS built on the system. This
leads to makesrpm.pl building SRPMS with .el6 in their release. As we
endeavour to use the same SRPM on all of our Fedora platforms, this is
less than ideal, so change makesrpm.pl to squash the setting of %dist
before building the RPM.

Change-Id: I5b5b9db7654ce21a269233e8950d4f4d1df81ad7
Reviewed-on: http://gerrit.openafs.org/4285
Reviewed-by: Alexander Ivan Redinger <aredinger@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-03-23 12:39:46 -07:00
Andrew Deason
9ac85bb2fd Fix ihandle.c indents
ihandle.c had some blocks that were not indented. Indent them.

Change-Id: I05442c6fabc19fab314f515fa950159de05b8c48
Reviewed-on: http://gerrit.openafs.org/4273
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-03-22 15:59:46 -07:00
Jeffrey Altman
ef9fc4fada vclosevnodefiles-ihandle-leak-20090216
LICENSE IPL10
FIXES 124359

don't leak ihandles on close. this isn't a complete fix for the issue
(cherry picked from commit b9816e12f7ed8213c9c4eaea09e992e69ce4ee05)

This reverts the part of 12e85227c5dbfdb1258718ee3360bffacc4f96ac that
reverted b9816e12f7ed8213c9c4eaea09e992e69ce4ee05.

Change-Id: If4ac661a3a0f8abf7f6a79fa9d72d715861bcf51
Reviewed-on: http://gerrit.openafs.org/4272
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-22 15:55:37 -07:00
Derrick Brashear
81e7a5adf9 DAFS: fix forceDAFS support in salvager
we need to get the shared partition lock for the per-volume
forceDAFS case

Change-Id: I7be91420bb0df5963e789c932e5c469fe02ec108
Reviewed-on: http://gerrit.openafs.org/3487
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-22 04:53:06 -07:00
Derrick Brashear
b9ecf28c6c DAFS: allow salvager to detect whether FSYNC server is DAFS
in order to enable the right commands and print the right errors,
query for DAFS-only FSYNC op.
doesn't use bozo InstanceInfo as it's possible you can run fileserver
outside of bos.

Change-Id: Ib94f7b3a2960cd493f110af4d5dee7e97a6493c9
Reviewed-on: http://gerrit.openafs.org/3486
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-22 04:52:50 -07:00
Russ Allbery
d4e8b729d8 Update NEWS for 1.6.0pre3 release
Add additional NEWS entries from the 1.6.0pre3 release notes.

Change-Id: I46b306a7fc85f95be87c2b9eeaefae6b9816be8f
Reviewed-on: http://gerrit.openafs.org/4270
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-22 04:52:37 -07:00
Andrew Deason
2578555d7e viced: Check vnode length on dir ops
The commit aadf69eabb1962496fa93745ab560a5b48cacd61 added checks on
vnode length whenever we read or write from a vnode. Add the same
check on directory vnodes when we modify the directory (whenever
entries are added or deleted).

Change-Id: I8aa438941f840019bc541d5a978610c4f78330c8
Reviewed-on: http://gerrit.openafs.org/4233
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-21 10:28:09 -07:00
Andrew Deason
0f1c921fa1 vol: Correct VolumeNumber for large volume IDs
VolumeNumber was using atoi to convert a volume header name to a
volume ID. This can return just -1 for volume IDs larger than 2^31-1,
though, so use strtoul instead.

Change-Id: Ibae2d29f196646154fcc4f6ff174246e37b3d735
Reviewed-on: http://gerrit.openafs.org/4199
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-21 10:27:45 -07:00
Andrew Deason
85edec7105 vol: Handle large volume IDs in VLockFile
VLockVolumeByIdNB currently cannot handle volume IDs larger than
2^31-1. Fix this by using struct flock64, F_SETLKW64, and F_SETLK64 in
the VLockFile functions where possible.

Thanks to Simon Wilkinson for pointing out F_SETLK64.

Change-Id: I422c685aec035716e2f42d13bd97541425ead6a2
Reviewed-on: http://gerrit.openafs.org/4198
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-21 10:27:24 -07:00
Andrew Deason
b146d62718 vol: Make VLockFile arguments consistent
The Windows implementation of the VLockFile functions had the handle
incorrectly declared in a few places (they accepted a struct VLockFile
instead of an FD_t). Correct them, and make all VLockFile
implementation functions declare 'FD_t's instead of 'HANDLE's or
'int's.

Change-Id: I2bc414712599cb8f2a2f0a5034b583a15b2c3ad8
Reviewed-on: http://gerrit.openafs.org/4197
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-21 10:27:01 -07:00
Andrew Deason
a6f18413ed libafs: Do not osi_FlushPages for dirs
Directory contents are never mapped or stored in pages, so dealing
with page invalidation on directories is just overhead. So make
osi_FlushPages a no-op when we're given a directory, which can avoid a
lot of locks and other processing (particularly when we are called in
afs_getattr in BOZONLOCK_ENV).

Change-Id: I56fbd08c74d01a5fcb45a57e08bb31afcec9331d
Reviewed-on: http://gerrit.openafs.org/4259
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-21 10:24:33 -07:00
Andrew Deason
a18175f479 DAFS: DFlushVolume outside of vol glock
DFlushVolume may traverse a long list of directory objects, and can
even hit the disk, so we should drop the glock for it. This should be
safe in DAFS, since we already transition the volume to an exclusive
state before doing this, and DFlushVolume only deals with structures
internal to the directory package and maintains its own locking.

Change-Id: I6493042c8f36614b55d4dc40d97639e56b34fabd
Reviewed-on: http://gerrit.openafs.org/4242
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-21 10:24:20 -07:00
Simon Wilkinson
8c41840801 util: Fix exec_alt
exec_alt was failing its tests on Mac OS X (but passing them on Linux).

It turns out that this is because it was failing to NULL terminate the
string that it creates in construct_alt(), which copies in the
characters from argv0, prefix and suffix, but never copies in a trailing
NULL.

Amend the code so that the trailing NULL from suffix is used to
terminate the string.

Change-Id: I286604fb09193367c4e7b2d80051832080362f79
Reviewed-on: http://gerrit.openafs.org/4267
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-21 10:20:51 -07:00
Simon Wilkinson
1c1051ae19 lwp: override dbg and optmz settings
we were wiping out fun things like archflags. shouldn't be needed.
let's just do this instead.

Change-Id: I80b3453bb237b4995d642b947d03c17d82cda5e7
Reviewed-on: http://gerrit.openafs.org/4266
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-20 19:30:36 -07:00
Simon Wilkinson
693a749595 osx: restore atomic stats to knet
pulled wrong version of change into master. put back atomic
versions of stats.

Change-Id: I3b8413e2606a8bc4bf55aa674860685b2ca2ced6
Reviewed-on: http://gerrit.openafs.org/4265
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-03-20 19:29:38 -07:00
Andrew Deason
ce5e263b48 salvager: Fix volume parsing on 64-bit
When an unsigned long is wider than an afs_uint32, comparing the
afs_uint32 vid to ULONG_MAX is always going to be false (which the
compiler can warn us about). Fix this by storing to an unsigned long,
and converting to a volume id after ensuring that the result is not
too large.

Change-Id: Ifbd724dabd988bc4b1ba6ee8f3dc7fa1a0afb226
Reviewed-on: http://gerrit.openafs.org/4244
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-19 19:15:58 -07:00
Derrick Brashear
d73d9a1011 MacOS: allow cdead vcaches to be found in FindVCache if requested
if we are trying to find a dead vcache, let it be found, don't immediately
attempt to recycle

FIXES 128511

Change-Id: I7f86f7d4a88e1b89887b64617246e750654b0334
Reviewed-on: http://gerrit.openafs.org/3691
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-03-17 21:32:38 -07:00
Simon Wilkinson
1da95520fa util: Remove unnecessary uuid_mem* macros
Once upon a time, in a galaxy far far away, uuid used bcmp and bcpy
operations in kernel space. However, we changed that back in 2001, and
since then the uuid_memcpy and uuid_memcmp macros have been redundant.
Tidy up the code a little by removing them.

Change-Id: I3abcff79b36a330f1619c3d7e0a791eac1cf69a1
Reviewed-on: http://gerrit.openafs.org/4253
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-17 20:34:27 -07:00
Simon Wilkinson
0a98548832 dir: Make test utility build again
Make the 'dtest' test utility, which can be used to test the functioning
of the dir package, as well as to manipulate the directories that it
creates, build again.

Change-Id: I3b87c691cc9cb7ffce9297243d4a709d2e94fd40
Reviewed-on: http://gerrit.openafs.org/4251
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-03-17 20:34:12 -07:00
Simon Wilkinson
b88cf2f1aa util: Remove remote.h
remote.h is no longer used anywhere within the tree, and defines an
interface that has never been provided by OpenAFS. Remove it.

Change-Id: Id1007364f073c3bc2751491df371f51a37059381
Reviewed-on: http://gerrit.openafs.org/4249
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-03-17 20:34:00 -07:00
Simon Wilkinson
af854b4e2f rpms: Make makesrpm.pl cater for new rpm names
Starting from 1.6.0, our specfile no longer adds a stray '1.' to the
start of the release field. makesrpm.pl was failing to deal with
these new-style names and therefore not actually making an rpm.

Fix this by conditionalising on the OpenAFS version when selecting
which rpm to copy.

Change-Id: I36b32ccc20baa167f46e5095eacb38a8e7d65e27
Cc: Alexander Redinger <aredinger@sinenomine.net>
Reviewed-on: http://gerrit.openafs.org/4258
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-17 15:17:20 -07:00
Derrick Brashear
c10f5296d2 macos: kernel socket upcall
support kernel socket upcall instead of listener env

Change-Id: I1b66ce0877053700cd894f47017596fbe07e7384
Reviewed-on: http://gerrit.openafs.org/4239
Tested-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-17 13:56:38 -07:00
Simon Wilkinson
6ca42fe191 util: Remove packages.h
packages.h is unused within our tree, and contains nothing of any
use to out of tree callers (it attempts to define bases for error
codes, which has been superceded by our use of comerr)

So, remove it.

Change-Id: I22f2d3fba6ff960f00757c69f6beb5e7f25f9bba
Reviewed-on: http://gerrit.openafs.org/4248
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-03-17 13:08:24 -07:00
Simon Wilkinson
71380ee4f3 rpms: Use new CellServDB
Update the CellservDB referenced by the spec file to the latest one
from grand.central.org

Change-Id: I315419b45c124908a262420cd9bd3876fe0ba308
Reviewed-on: http://gerrit.openafs.org/4257
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-03-17 12:37:53 -07:00
Simon Wilkinson
79ec006874 util: Remove itc.h
The itc.h header is never installed, or used in the OpenAFS tree.
Remove it.

Change-Id: Ia01f0f5353bc019c3fd0c311b2c7cfc157dca2dd
Reviewed-on: http://gerrit.openafs.org/4247
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-17 10:45:41 -07:00
Andrew Deason
5df51a8294 viced: Actually print client CPS
Client CPS was not getting output on SIGXCPU like the rest of the
client information, since the conditional in the CPS loop was never
true. Fix this so we traverse the CPS entries correctly.

Change-Id: Ic3434000fbf90e96665779f21811bffcc3a19b45
Reviewed-on: http://gerrit.openafs.org/4256
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-17 10:43:04 -07:00
Simon Wilkinson
b9bf4e02bb util: Remove isathing
isathing.c only provided one function - util_isint, whose behaviour
can be far better provided by careful application of strtol.
Simplify our world a little by removing the file.

Change-Id: I6a8460daaec092d4916d4a46e04df01d0dfc7ccc
Reviewed-on: http://gerrit.openafs.org/4246
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-03-17 06:37:03 -07:00
Simon Wilkinson
d9f11cd85b kauth: Use strtol for integer argument handling
Use strtol, rather than a combination of util_isint and atoi to
handle integer arguments. This is much cleaner, far more portable,
and removes a dependency on an internal library function that this
file is the only user of.

Change-Id: I3140a396ae3ec32e4498f62769f27c76f03001d9
Reviewed-on: http://gerrit.openafs.org/4245
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-17 06:36:57 -07:00
Derrick Brashear
c4744cc699 osx: decode-panic should work in add-kext only land
in 64 bit 10.6, you need add-kext (not add-symbol-file)
to decode a panic. deal accordingly

Change-Id: I40f3c40150b98be2d80881ee56f8f8e33c92bc0f
Reviewed-on: http://gerrit.openafs.org/4255
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-17 06:36:08 -07:00
Derrick Brashear
0016e013aa osx: prefs pane should properly detect version
we use "new" afs conf after 1.4.6 or 1.5.36. detect correctly

Change-Id: I7ae0005f7f1ca3a3164d12fab38e6d4da5c85168
Reviewed-on: http://gerrit.openafs.org/4254
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-03-17 06:35:31 -07:00
Simon Wilkinson
ffdc040d56 Throw the compiler a bone ...
... failing that, a semi colon.

Change-Id: I39cf03f16f5faaf32e8335ea6453e76b0d1c67ef
Reviewed-on: http://gerrit.openafs.org/4234
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-03-15 15:22:35 -07:00
Derrick Brashear
4a72ebfe32 macos: dont want bind 8 compat on leopard
we removed it for i386, kill it for ppc also.

Change-Id: I1c91a138ecbec9c25a9734f5a5bcdc1d08469404
Reviewed-on: http://gerrit.openafs.org/4229
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-15 06:32:26 -07:00
Jeffrey Altman
4e2074b7bf Windows: 1.6pre3 changes
Change-Id: I87b1e29f26e1785fe7ab09c3641d7ad4281f9be8
Reviewed-on: http://gerrit.openafs.org/4227
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-03-14 20:53:47 -07:00
Simon Wilkinson
3d92852ba9 Linux: Fix return codes from setpag
Linux is a real stickler when it comes to error codes. Functions
which return positive error codes into the kernel tend to have
unfortunate effects. Because all AFS errors tend to be positive,
most of our kernel entry points negate errors before passing them
back to their caller.

This causes problems when internal functions themselves return
negative error codes. This was the case with the keyring functions,
which ended up returning a negative code to setpag(), this handed
that code ultimately up to the ioctl handler, which negated it (so
turning it positive) before throwing it up to the kernel.

The kernel sees this positive value as being a successful return,
and so passes it direct to userland, rather than assigning it to
errno. This led to the setpag() userspace function never being
aware of keyring errors that had occurred in the kernel.

Fix all this by making sure that all errors from the keyring code
are made positive before being passed upwards in the kernel module.

Change-Id: I31eeaf9a4819dc47052ea0ff3070bdaaf22f1f66
Reviewed-on: http://gerrit.openafs.org/4223
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-03-14 19:28:15 -07:00
Simon Wilkinson
ff2933a122 Revert "Linux: normalize error return for emulated syscalls"
This reverts commit 0bc837f68a72ba1f75d940cc5dd057774d9f36bb.

Sadly, this change fixed setpag(), but broke all of the pioctls. The
problem is actually a little more nuanced than we at first thought.
What's happening is yet another case of Linux's special handling of
negative return values. When an ioctl handler returns a negative
return code to the kernel, it does errno = -code, and sets the
return code to -1. If you pass it a postive return code, however,
it just returns that straight to the application.

The pioctl code gets this right. However, the setpag code doesn't,
and so tries to return postive values, which is why ioctl appears
to be returning the error code in the return value, not in the
errno.

Change-Id: I192ff45ad15b72a493a3c9c98546b026761dd95f
Reviewed-on: http://gerrit.openafs.org/4222
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-14 19:27:09 -07:00
Simon Wilkinson
c78694fdb7 auth: Use the UserListFileName function more
The function UserListFileName exists to abstract the process of
producing a full pathname for the userlist. Modify the rest of
userok.c so that it uses it.

Change-Id: Iac90e159dd8dc8344943e424615bf2aba1b31db3
Reviewed-on: http://gerrit.openafs.org/4215
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-14 11:27:06 -07:00
Simon Wilkinson
a1a3ac4024 auth: Refactor CellServDB path creation
Move all of the duplicated code that does CellServDB path creation
into a common function. Use asprintf(), rather than strcompose in
this function so we're using fewer fixed length buffers.

Change-Id: I47ce92b97674bb09b5804ff5631fa47a21800902
Reviewed-on: http://gerrit.openafs.org/4214
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-14 11:26:52 -07:00
Simon Wilkinson
13e622c939 roken: Export rk_asprintf on Windows
Add rk_asprintf to the Windows roken export lists

Change-Id: Ie12c245aa2bf45fcbcfa5474e1dfaf3c32036bb4
Reviewed-on: http://gerrit.openafs.org/4216
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-14 11:26:02 -07:00
Michael Meffie
ba67ef96bb readme typos
Fix two typos in README.

Change-Id: Icd03d015d5d08a26640e12eceb8185fa36087753
Reviewed-on: http://gerrit.openafs.org/4218
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-03-14 10:09:29 -07:00
Simon Wilkinson
1eb5709964 auth: Rework afsconf_UpToDate to use CellServDB
Rework the afsconf_UpToDate check so that it uses the modifcation of
the CellServDB, and not the KeyFile to determine whether the
configuration information has been changed under us or not. afsconf
defines the CellServDB as being the single sentinel for a config
directory being changed, and our tools are careful to always touch
the CellServDB when updating anything else there.

Also, rework the _afsconf_Check() code so that it uses afsconf_UpToDate,
rather than including this logic twice.

Change-Id: I8ef5f67afbb5982bb25e12407ea5dc5dc1512840
Reviewed-on: http://gerrit.openafs.org/4203
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-13 13:40:48 -07:00
Simon Wilkinson
926755bf22 tests: Fix KeyFile test so it works from harness
The auth/keys test tries to find a file that's distributed as part
of the test suite. However, it currently only looks in the CWD to
find it. Modify the test so that if it's run from the test harness,
it will use the harnesses SOURCE environment variable to locate the
KeyFile

Change-Id: I93e16a01eae79b38ab01c81a57d2a47c28479b27
Reviewed-on: http://gerrit.openafs.org/4213
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-13 13:40:20 -07:00
Simon Wilkinson
bc16fe0a43 tests: Fix the authcon test to avoid pthread errors
Fix the authcon test so that it avoids pthread errors by
initialising rx before calling into any of the rxkad routines.

Change-Id: I175203fd91660e27a8b468e6f1c6189f32b22259
Reviewed-on: http://gerrit.openafs.org/4212
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-13 13:39:38 -07:00
Simon Wilkinson
4953ce8070 pt_util: Initialise empty database correctly
Commit dc8f18d6f5003712bc9ef989363137a84953df07 broke pt_util's
initialisation of empty databases. This is because Initdb was changed
to call Initdb_check through the ubik_CheckCache wrapper. However, that
wrapper was defined as a no-op in pt_util's ubik-shim.

Modify pt_util's ubik_CheckCache so that it always calls into the
wrapper routine - this mimics the old behaviour.

Add a trival test for pt_util - check that we can build the database,
using the example from the manpage, and then that the built database
matches what we expect.

Change-Id: I41aa9f6a531662230ed625cc3b1307016ef4107f
Reviewed-on: http://gerrit.openafs.org/4211
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-13 13:38:50 -07:00
Simon Wilkinson
83f0baef29 DOC: pt_util now outputs ntohl'd epoch and version
Commit 87e959e87df52e026ffcb2de8ecfcbf4889f7bd8 fixed pt_util so
that the epoch and version is correctly byte-swapped on little
endian systems.

Remove the warning about this from the manpage as it is no longer
relevant.

Change-Id: Ic54223b0a8812825a1b7a8d2b8ee1b0c51ecea05
Reviewed-on: http://gerrit.openafs.org/4210
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-03-13 13:38:27 -07:00