11249 Commits

Author SHA1 Message Date
Marc Dionne
7f96084969 Rework set_header_word macros
Rework the set_header_word macros so that all compilers are
happy:
- the use of offsetof() is avoided, as it has an issue on IRIX
when the result is not constant
- the assignment within the macro is explicitely sequenced before
the function call to avoid a gcc sequence-point warning

Change-Id: I2355233e865b155f958379bfa2736fee19ef2680
Reviewed-on: http://gerrit.openafs.org/8816
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-31 02:57:29 -08:00
Ken Dreyer
265a4b542b NEWS updates for 1.6.2
Add an entry for 1.6.2 with "in progress" instead of a date to hold the
release notes for 1.6.2pre4 rather than creating separate entries for
each release candidate. Users who track the release candidates can refer
to the public announcements, and this will be cleaner when reading
history later on.

Change-Id: I625044e20836e072b62ffa738eca23f1d11813a5
Reviewed-on: http://gerrit.openafs.org/8750
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>
2013-01-30 09:10:16 -08:00
Stephan Wiesand
35ee4abecd CellServDB update 28 Jan 2013
Change-Id: Icb622cc5480aeba108b9a11f55cfb44ab7f7c262
Reviewed-on: http://gerrit.openafs.org/8982
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-29 10:12:12 -08:00
Michael Meffie
4197bbecd9 libafs: fs flushall for unix cm
Implement the fs flushall command on the unix cache manager to flush
all volume data.  Uses a new common pioctl code point VIOC_FLUSHALL (14),
registered with the grand.central.org assigned numbers.

Change-Id: I214d8c762573b308d79fa7122a91d48ddd403eb9
Reviewed-on: http://gerrit.openafs.org/7540
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2013-01-24 08:35:40 -08:00
Jeffrey Altman
9c07dd592a Windows: Use %p for ptrs in redirector trace messages
Pointers were being logged with %08lX which results in partial
pointer values being logged on 64-bit systems.

Change-Id: Ic11e5b607b3df41f145536dfcb02dfa22537ee77
Reviewed-on: http://gerrit.openafs.org/8943
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-01-23 20:35:04 -08:00
Andrew Deason
1b63689b99 SOLARIS: Use vn_renamepath as early as possible
Commit 6c509601 uses the vn_renamepath when we are building on Solaris
11. However, some recent patch level of Solaris 10 (more recent than
stock 10u10) has the same problem fixed by that commit, where
vn_setpath takes an additional argument. So instead, just test for the
existence of vn_renamepath itself, so we also use it on Solaris 10
when we can.

Thanks to Rich Sudlow for reporting this.

Change-Id: Ic1c0437d2438c6e19b8fff8278ecda9b96bd020b
Reviewed-on: http://gerrit.openafs.org/8920
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-23 11:33:22 -08:00
Andrew Deason
f6f145c90f aklog: Fix allow_weak_crypto warning
It's _crypto, not _enctypes. The user will just be more confused than
before if we tell them to do the wrong thing.

Change-Id: Ib94b14efbd3c89d9f58fb8985326ee8691fd993b
Reviewed-on: http://gerrit.openafs.org/8938
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2013-01-22 14:46:24 -08:00
Simon Wilkinson
cb9f25c448 rx: Remove warning inhibition on rx.c
The CFLAGS_NOERROR rule for rx.c seems to have crept back in as
part of the libtool changes. The LWP build of rx.c has never had
warning inhibition on rx.c, and the inhibition in the pthread
builds was removed by 327762071be3806c5d08be0218982c7027754756

Change-Id: Icde3f0b6ee2f8ae0818a3dc722c6171284d6a9e6
Reviewed-on: http://gerrit.openafs.org/8921
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-22 07:35:15 -08:00
Andrew Deason
c57542ac90 FreeBSD 9.1: Warning fixes
Fix warnings caused by some changes in FreeBSD 9.1:

 - afs_cmount takes a uint64_t for flags instead of an int
 - vn_rdwr takes a ssize_t* for resid instead of an int*

[kaduk@mit.edu: rebase onto master and use fine-grained version checks]

Change-Id: I03ab805a625790004a910df96b96aeda1121e2a7
Reviewed-on: http://gerrit.openafs.org/8922
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-22 07:34:46 -08:00
Rod Widdowson
4da5f0b498 Windows: Police Library IOCTLs
Ensure that the callers of the various library ioctls have
the correct identity or privs.  All this policing is done in
the fs (non unloadable) layer, and to ensure that the library
layer cannot receive these calls directly we forbid non
create Opens of the library control device.

Change-Id: I2342fe10047642082adfbd1cc6aaee09cc91b520
Reviewed-on: http://gerrit.openafs.org/8893
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-01-21 18:21:41 -08:00
Rod Widdowson
dd672fffe9 Windows: Police the DEBUG TRACE ioctls
When we get a IOCTL_AFS_GET_TRACE_BUFFER, a IOCTL_AFS_CONFIGURE_DEBUG_TRACE
or a IOCTL_AFS_FORCE_CRASH, we check to see whether the caller is in the
Administrators group and if it isn't we fail the request with ACCESS_DENIED.

NOTE that this does not check whether the user has done the "run as admin"
thing.  We actually need to determine which priviledges are appropriate to
this action and use that rather than group membership to police these actions
and this will be added in a later patch.  Meanwhile this represents a
significant increment in security from previously.

Change-Id: I0997e59a82735735674d8edee7a7a68d241e6ef8
Reviewed-on: http://gerrit.openafs.org/8843
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-01-21 18:21:15 -08:00
Derrick Brashear
cda1c006a7 macos: update decode-panic
fix a couple brain-os from the last round of updates, so it can
actually decode panics.

Change-Id: If39f1fb273a834d0618264d944387bd8b6751284
Reviewed-on: http://gerrit.openafs.org/8929
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-21 13:37:32 -08:00
Andrew Deason
d72d0f4a81 Improve libroken configure check
It is not sufficient to just check if libroken is available; we need
to check if the specific functionality we want is there. So, try to
compile and link while referencing specific functions.

As mentioned in the comments, testing every single function we use may
not be practical, and we should perhaps just add functions to test as
we find breakage. This commit tests rk_rename, which is missing in at
least the Debian package heimdal-dev, version
1.4.0~git20100726.dfsg.1-2+squeeze1.

Change-Id: I0ac6c9aea1f8598bb1b1315544683b2403de5f69
Reviewed-on: http://gerrit.openafs.org/8916
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-21 05:32:08 -08:00
Michael Meffie
09c0484fd8 xstat: length check cm call info
Define the cm xstat function call counters with an xmacro to avoid
duplicating the list of cm function names.  This obviates the need
to update xstat_cm_test.c when new function names are added to the
cm xstat collection id 0.

Check the number of returned records when printing the function call
counts to avoid over-running when a newer xstat_cm_test client
receives data from an older cm.

Change-Id: I3c5470afb7b04167173b41bb576a4a6ec14753f7
Reviewed-on: http://gerrit.openafs.org/8741
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-21 04:34:46 -08:00
Michael Meffie
dfe06c96c2 xstat: remove unused call info function
Remove the dead function PrintCallInfo(), which was replaced
by print_cmCallStats() long, long ago.

Change-Id: Id67323d66cc498f77e55f173218547ad5d4223c7
Reviewed-on: http://gerrit.openafs.org/8740
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-21 04:34:05 -08:00
Antoine Verheijen
e130b342eb OpenBSD: Add support for missing routine memmove() in kernel.
OpenBSD does not have the memmove() routine available to dynamically
loaded modules in its kernel. It exists but is not exported so it
winds up "mia" on dynamic load of the kernel module. It's needed for
the Heimdal code that's been added into OpenAFS. This patch deals
with this issue by creating an inline version in the OS-specific
param.h file.

Note that this issue does not seem to exist in the amd64 version of
OpenBSD so (at least for now) tis fix is only applied to the i386
version of the header files.

Change-Id: Ide8a5ff49cb662e145fd93aefd8e3a12d7cbead5
Reviewed-on: http://gerrit.openafs.org/8926
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-21 04:32:00 -08:00
Antoine Verheijen
9dc7285599 OpenBSD 4.6/4.7: Define curproc for rx_atomic.h.
For OpenBSD 4.6 and 4.7, the rx_atomic.h header ultimately resorts
to the use of the default atomic routines that rely on MUTEX
macros. Those macros require that 'curproc' be defined, which in
turn requires the presence of the 'sys/proc.h' header. This patch
inserts that header into the param.h file for those systems.

Note that subsequent versions of OpenBSD have __sync_fetch_and_add
and don't require 'curproc' as a result.

Change-Id: I5131aed60631ef285eda92180ef65845165526b1
Reviewed-on: http://gerrit.openafs.org/8925
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-21 04:31:06 -08:00
Marc Dionne
d0479bbaf4 Linux 3.8: vmtruncate removal
vmtruncate had been deprecated for a while and has now been
removed.  Do things the new way based on truncate_setsize.

Change-Id: If584329f7330f44be3909e4c8b935e4fe5e2b536
Reviewed-on: http://gerrit.openafs.org/8906
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-21 04:30:03 -08:00
Marc Dionne
c6d27e322a Linux 3.8: session_keyring changes
The session_keyring is now attached directly to the cred structure
and the thread_group_cred structure (cred->tgcred) no longer exists.

Adapt code that makes use of tgcred, and use the standard rcu based
mechanism to update session_keyring.

Change-Id: If4b88cbc7f9af6343353648837b28541a5088429
Reviewed-on: http://gerrit.openafs.org/8905
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-21 04:29:15 -08:00
Marc Dionne
b61eac783e Linux: setpag() may replace credentials
For recent Linux. setpag() may replace the current process' cred
structure with a new one.  This is not a problem for most callers,
but in the case of processing a SetTokens2 pioctl with the setpag
option, the new credentials should be used to determine the target
for the token.

Change-Id: I4441349b8a72eac7d56276abcdf243b2ffd21b98
Reviewed-on: http://gerrit.openafs.org/8924
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-21 04:21:03 -08:00
Dan van der Ster
07d83cd473 rxperf: print achieved transfer rate
Prints the client transfer rate in appropriate units (kbit/s, Mbit/s, or Gbit/s).

Change-Id: I5632185953c5d2bfc962af71152734d842cfb021
Reviewed-on: http://gerrit.openafs.org/8758
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-21 04:18:22 -08:00
Ben Kaduk
13111d2540 Catch up to FreeBSD KPI for vfs_cmount
Almost a year ago, mckusick changed the VFS KPI/KBI for the cmount
VFS operation, making the flags argument a 64-bit quantity.
Introduce appropriate conditionals for our prototype of afs_cmount
for the change on the 10.x and 9.x branches.

Change-Id: Ia0b8759f027e64f98f087daabbf1a51030171f21
Reviewed-on: http://gerrit.openafs.org/8907
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-18 04:26:16 -08:00
Chas Williams (CONTRACTOR)
04ddecc1f2 LINUX: fix array indexing issue in memory statistics
The comma is a sequence point and i gets incremented and then used.
This results in writing past the end of the array by one (and failing
to initialize the first element as well).

Potential fix for RT ticket 131566.

Change-Id: Iabe7e78961d1f5348bca75ca5b9e6e29d8554957
Reviewed-on: http://gerrit.openafs.org/8914
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-18 04:25:44 -08:00
Andrew Deason
a911185b31 ubik: Remove bare global ubik_epochTime
Commit e4ac552a moved ubik_epochTime into a global version_globals
struct. However, it missed a references to the existing
ubik_epochTime value it was moving, as well as its declaration. Remove
the declaration, and move the reference to use the version_globals
structure.

Change-Id: I2552ba850f286b2b93f3c1b696d993a7cfc074c8
Reviewed-on: http://gerrit.openafs.org/8918
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-18 04:25:26 -08:00
Andrew Deason
7858cfd4f5 ubik: Trivial formatting fix
Change-Id: Ie409dc5dc7fe63cc72c97666146e7019e5db086e
Reviewed-on: http://gerrit.openafs.org/8917
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-18 04:25:00 -08:00
Marc Dionne
684d1ec6ba gcc 4.8: fix warnings
Quiet new warnings introduced by gcc 4.8:

- Many unused typedefs under src/admin.
- A possibly uninitialzed variable under src/viced

Change-Id: I96858c2d12a9ee3270d89a64fcf772affe93e9eb
Reviewed-on: http://gerrit.openafs.org/8913
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-16 18:34:03 -08:00
Michael Meffie
7dbb35a89f doc: dynamic mount requires dynroot and fakestat
Document that dynamic mount (/afs/.:mount) requires
dynroot and fakestat on non-linux unix.

Change-Id: I947edd30d510c7cc6840bc2cc74d0ef07b692afb
Reviewed-on: http://gerrit.openafs.org/8739
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
2013-01-10 10:33:59 -08:00
Andrew Deason
08a4b05c27 SOLARIS: Avoid open count cleanup for Solaris 11
The comments in here no longer apply to Solaris, as of OpenSolaris
commit 11736:63a134e1f09c by Donghai Qiao (4492533 Filesystems may
need VOP_CLOSE() for executables following a VOP_OPEN()). This means
that this workaround should no longer be necessary for any Solaris 11
release, any illumos release, and anything else based off of
OpenSolaris. So, stop doing it.

Thanks to Frank Batschulat for pointing this out, and providing all of
the details.

Change-Id: I54ed545e3b9d858fbffc762246ae805cd9c63a64
Reviewed-on: http://gerrit.openafs.org/8895
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-09 07:07:54 -08:00
Andrew Deason
6c50960174 SOLARIS: Use vn_renamepath when available
In Solaris 11.1, the signature of vn_setpath changes; it gains an
extra boolean_t argument called 'force'. Instead of trying to adapt to
it, call vn_renamepath() instead, which will do the correct thing and
call vn_setpath &co for us. vn_renamepath has existed since Solaris 10
Update 8, and is in all releases of Solaris 11. Only call it in
Solaris 11, since it makes the ifdefs easier, and there are no
problems with calling vn_setpath on Solaris 10.

Thanks to Frank Batschulat for all of the relevant information.

Change-Id: Iad4ada70abbb5ec2289c30149ab4c571fa8a68ff
Reviewed-on: http://gerrit.openafs.org/8894
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-09 07:07:35 -08:00
Ben Kaduk
c981ef1761 Fix build for separate objdirs
In particular, setting UNTHREADED=${srcdir}/dir and then referring
to ${srcdir}/${UNTHREADED} is a recipe for sadness.

Fix the libtool invocation to correctly find .la.sym files in ${srcdir}.

Also add some missing header dependencies that are hidden when building
in the src tree.

Change-Id: I1b663141c549cc4b90e46327c3fb31dc80294eaa
Reviewed-on: http://gerrit.openafs.org/8891
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-07 20:28:58 -08:00
Rod Widdowson
3ee5e20170 Windows: Restrict the Service IOCTLS to the service process
When the service starts the system we save it's PID and when we see a
IOCTL_AFS_INITIALIZE_REDIRECTOR_DEVICE,
IOCTL_AFS_PROCESS_IRP_REQUEST, IOCTL_AFS_PROCESS_IRP_RESULT,
IOCTL_AFS_SYSNAME_NOTIFICATION or IOCTL_AFS_SYSNAME_NOTIFICATION
ioctl we check that the calling process has that PID.

Change-Id: Ie66676bba4b4e4d858979babe9c0af4c53ea0143
Reviewed-on: http://gerrit.openafs.org/8844
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-01-07 09:13:18 -08:00
Michael Meffie
8a17568fb4 correct whitespace errors in readme files
Fix the trailing whitespace and leading spaces
before tabs in the readme files.

Change-Id: If20e528ddb28f82e4d3d1b1f03dec8670f914afc
Reviewed-on: http://gerrit.openafs.org/8877
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-01-07 07:40:46 -08:00
Rod Widdowson
5138c07abd Windows: Only allow the local system account to speak to the redirector
When we get the IOCTL_AFS_INITIALIZE_CONTROL_DEVICE IOCTL we check to
see whether the calling process is the LOCAL_SYSTEM_SID (the one that
services run at if they are not running as a specified SID).  If we
are not then the initialize fails ACCESS_DENIED.

If the debug build ONLY, setting the AFS_DBG_DISABLE_SYSTEM_SID_CHECK
bit in OpenAFSDebugFlags circumvents this check, allowing interactive
debugging.

Existing code stops two processes (or even handles) from trying to
initialize the system.

Change-Id: I2ef8ca3a0df908acba38b435178d0509e96d6114
Reviewed-on: http://gerrit.openafs.org/8842
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-01-07 07:23:49 -08:00
Nickolai Zeldovich
8e8e3c26b8 libadmin/vos/vosutils.c: mask out sign-extension
Right-shifting a signed int by 24 bits can produce a value outside of
0..0xff due to sign-extension.  As a result, in AddressMatch(), the
first bPattern!=255 check can never succeed.  Fix by masking with 255
before comparison.

Change-Id: Idb0b4c176ff120c7cf0e03a935ebfdca51084bbd
Reviewed-on: http://gerrit.openafs.org/8884
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2013-01-06 08:35:09 -08:00
Nickolai Zeldovich
bd850e5b98 lwp/iomgr.c: avoid off-by-one out-of-bounds access
Avoid accessing sigDelivered[NSIG] and sigEvents[NSIG], which are
out-of-bounds by one.

Change-Id: Id6a1798cba901987b8103f287e0869b31040b45b
Reviewed-on: http://gerrit.openafs.org/8883
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2013-01-06 08:35:02 -08:00
Nickolai Zeldovich
4d6967e0b0 butm/file_tm.c: check for null pointer before dereferencing
Move the null pointer check to before the pointer is dereferenced.

Change-Id: I9983dae8802706c1efeff8a507a001b649572686
Reviewed-on: http://gerrit.openafs.org/8882
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2013-01-06 08:34:56 -08:00
Nickolai Zeldovich
1b37493351 auth/authcon.c: fix likely mistake
It seems likely the original developer intended to check
*scIndex==RX_SECIDX_NULL rather than scIndex==RX_SECIDX_NULL.

Change-Id: I8a33d3cb177a9212917613581957073392b08314
Reviewed-on: http://gerrit.openafs.org/8881
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
2013-01-06 08:34:49 -08:00
Nickolai Zeldovich
d9cc9c9dee tools/dumpscan/pathname.c: properly check strdup() return value
Fix the check for strdup() running out of memory.

Change-Id: I4e2d83036095c7b292ee4c386d8ed7b16ec75067
Reviewed-on: http://gerrit.openafs.org/8880
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2013-01-06 08:34:40 -08:00
Nickolai Zeldovich
0e83cde60e ubik/udebug.c, vol/vol-info.c: check array index before dereferencing
Avoid out-of-bounds array accesses by first checking that the index
is in-bounds, and then dereferencing; not the other way around.

Change-Id: Ib36a28ca6181a7a7fd602de45cb5a15fad099a44
Reviewed-on: http://gerrit.openafs.org/8879
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2013-01-06 08:34:33 -08:00
Nickolai Zeldovich
5c5515a5c3 volser/vol_split.c: do not dereference known-NULL pointer
Avoid dereferencing a pointer that we just checked is NULL when printing
an error message.

Change-Id: Ibc89883977e7044cab2a844d97b7f0f7d236f4ea
Reviewed-on: http://gerrit.openafs.org/8878
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-05 21:40:17 -08:00
Michael Meffie
4042667388 spelling corrections in readme files
Fix spelling errors in readme files.

Change-Id: I62348372d5e226f2b2a3a7732b4a5f8c7331b2ff
Reviewed-on: http://gerrit.openafs.org/8876
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
2013-01-05 09:07:23 -08:00
Andrew Deason
81dd4878e7 SOLARIS: Look for ncurses in ncurses/ncurses.h
Solaris 11+ has ncurses.h in ncurses/ncurses.h. Look for it there.

Without this, on Solaris 11.1 we will detect libncurses automatically
(because it lives in /usr/lib), but not ncurses.h (since it is in
ncurses/ncurses.h, not ncurses.h). So, we will fall back to curses.h,
but will try to link to libncurses, which, as you might guess, fails
with various undefined symbols.

Change-Id: Ia174e2a3c97318d6db2a48a6098569aede93522c
Reviewed-on: http://gerrit.openafs.org/8874
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-05 06:28:22 -08:00
Andrew Deason
936c2b02bf SOLARIS: Avoid areq and auid conflict
On new Solaris (11.1), nfs/auth.h #defines areq and auid to access
some elements inside the nfsauth_arg structure more easily. We have a
lot of functions that use those names as parameters, so the compiler
throws an error (since we have a decl like "struct vrequest
*areq_u.areq").

We cannot avoid including that header, since we need some NFS-related
headers for the NFS xlator, and they pull in nfs/auth.h
unconditionally. So, work around this by undefining areq and auid
afterwards.

Change-Id: Ifd139917dfe7a1221941351f7873fe183c617159
Reviewed-on: http://gerrit.openafs.org/8873
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-05 06:28:04 -08:00
Andrew Deason
004e9f2563 afs: Check dv against localhero aincr
For operations that modify directories, we call afs_LocalHero to
determine if we can perform the directory modification in our local
cache, and avoid fetching the dir blob from the fileserver. Currently,
afs_LocalHero assumes that the DV received from the fileserver is
correct, and will update the cache DV as long as we have a valid
callback on the file.

If for any reason the client cache falls out of sync with what's on
the fileserver, this can cause the client to incorrectly believe its
cache is up to date. Since, the cached data will be marked with the
newest DV, even if the DV on the server has jumped to be larger than
we expected.

While the client cache should never fall out of sync with the
fileserver, in the past this has been possible due to other bugs
(fileserver idle dead processing and client VNOSERVICE handling).
Assuming that the given DV is correct is also just unnecesarily
fragile, since we can always check if it is correct, so just check it,
and add some comments helping explain what's going on here. Note that
regular file writes effectively already check this.

Note that this change makes use of the 'aincr' argument to
afs_LocalHero, which was previously unused. aincr appears to have been
used for a purpose similar to this before OpenAFS 1.0, but was
removed, possibly accidentally.

It is possible this change negatively affects, or even breaks
(unlikely), functionality with the AFS<->DFS translator. Although
nothing of the sort has been seen, it is difficult to know one way or
the other, due to the lack of available DFS translators.

Change-Id: I0e5395bac695257f66ba0cd58695a59ebdf56431
Reviewed-on: http://gerrit.openafs.org/8864
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-04 11:30:59 -08:00
Mark Vitale
19f424ecc2 vol: correct old conditional for IH_CONDSYNC
Two places in the vol package performed IH_CONDSYNC(vp->linkHandle)
only if AFS_NT40_ENV.  This was correct when the namei implementation
was windows only; however, this ifdef was apparently overlooked
when namei was implemented for UNIX.

Change-Id: I0cbe2c5c0a65ece0485b8c2d5a5f92eeb53725fe
Reviewed-on: http://gerrit.openafs.org/8815
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2013-01-04 06:52:00 -08:00
Russ Allbery
0a98596cd3 Make MIN/MAX code in rx/rx_packet.h more readable
Eventually all MIN/MAX code in the tree should be handled uniformly,
but until that day, make this chunk of it more readable and
document the odd exception case for Linux kernel builds.

Change-Id: I4afe5d99b63010df831943e6b82ff89733b08066
Reviewed-on: http://gerrit.openafs.org/8871
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-04 06:12:14 -08:00
Russ Allbery
fe2bae1c83 Ensure MIN/MAX are defined in userspace builds of rx
The include of <sys/param.h> was removed from rx_packet.h on
Linux 2.6 and later to fix kernel builds with 3.7, which doesn't
have that header in kernel space.  However, while kernel space
always provides MIN/MAX defines, userspace relied on the header.
On at least powerpc, no other include chain includes sys/param.h,
so MIN/MAX were left undefined.

Fix this by only skipping the include of <sys/param.h> on Linux
if building in kernel mode.

Change-Id: Icd2edd645ef4d18d626de8ce8b81ac07f37b1f21
Reviewed-on: http://gerrit.openafs.org/8870
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-04 06:11:50 -08:00
Russ Allbery
2e5ef04e24 Fix spelling error (retreive for retrieve) in strings
Caught by Lintian analysis of the compiled binaries.

Change-Id: I5d53d596d30ad8fea5d3f8f0116122a8c1aa808c
Reviewed-on: http://gerrit.openafs.org/8865
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2013-01-03 13:06:18 -08:00
Andrew Deason
f2f7ba50ed viced: initInterfaceAddr_r regardless of ICBS code
Currently we only call initInterfaceAddr_r for a host if a call to
RXAFS_InitCallBackState3 succeeds. However, this leaves the host
without a host->interface structure, which indicates that the host
does not support UUIDs, and is represented by just a single host,port
pair.

But this is not correct; the host probably does have the relevant UUID
associated with it, but it is just not responding. So, with the
current code, we create a uuid-less host structure for a host that
probably has a uuid; that host structure will probably never be used,
and will just get deleted later.

So instead, always call initInterfaceAdd_r. Do it before the ICBS
call, so the host will be findable via UUID as early as possible. If
the ICBS call fails, the host will be marked as 'down' later on.

Change-Id: I3a000af90773acbdd66fc22718e5e742619839a1
Reviewed-on: http://gerrit.openafs.org/8847
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-02 12:05:32 -08:00
Andrew Deason
7b642173c7 viced: Avoid dangling uuid hash table entry
Currently we add a given host to the uuid hash table, then call
RXAFS_InitCallBackState3, and then only initialize the host->interface
structure if the ICBS3 call succeeded.

If the ICBS3 call fails, we have added a host to the uuid hash table,
but the host structure does not contain that uuid. If the host is then
deleted, we will not remove the host from the uuid hash table (since
host->interface is NULL), and so the uuid hash table entry will still
point to the freed host. If that host is then later looked up via that
uuid, we can reference a freed host, which can cause all kinds of
undefined behavior.

So instead, add the host to the uuid hash table at the same time that
we initialize the host->interface structure, inside
initInterfaceAddr_r.

FIXES 131277

Change-Id: Ib2ca82cc498877ec896ab1806cf675f1271ec214
Reviewed-on: http://gerrit.openafs.org/8846
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2013-01-02 12:05:21 -08:00