openafs.git
9 years agotests: Add tests for afsconf_'s key functions
Simon Wilkinson [Mon, 27 Dec 2010 20:29:48 +0000]
tests: Add tests for afsconf_'s key functions

Add tests for all of the public functions that afsconf exports
to manipulate KeyFiles. Include a sample Keyfile to start with, to
ensure that we can continue to read KeyFiles produced by current
versions of the code.

These tests are here to catch regressions with a forthcoming rewrite
of KeyFile handling.

Change-Id: I02aaff82aa7e1b7a73981c7cf26a81164e0dd932
Reviewed-on: http://gerrit.openafs.org/3598
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoDon't trust # of entries from ListAttributes
Simon Wilkinson [Sun, 26 Dec 2010 14:54:43 +0000]
Don't trust # of entries from ListAttributes

ListAttributes returns the number of entries in its array as an RPC
argument. But, we can't trust this, as it could be manipulated and
end up pointing past the end of the returned array (which is counted,
so the entries argument is actually pointless).

Add bounds checking to the functions which use this value to prevent
this problem.

Change-Id: I62398d8f6b5c54318c1a42f1bad67a21c90ef944
Reviewed-on: http://gerrit.openafs.org/3597
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoRemove extra trailing \s in Makefiles
Andrew Deason [Wed, 22 Dec 2010 02:40:19 +0000]
Remove extra trailing \s in Makefiles

Remove a few extra trailing \s in Makefiles in viced and bozo. Some
'make's (such as the make on HP-UX) interpret this to e.g. include the
following "headers=" stuff to be included in LIBS, which obviously
causes problems.

Change-Id: I7a49ce5b8d40636bb3b4fe7978aa25b5411c7eed
Reviewed-on: http://gerrit.openafs.org/3575
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agovolser: Fix broken bulk conversion
Simon Wilkinson [Sun, 26 Dec 2010 14:14:38 +0000]
volser: Fix broken bulk conversion

The converstions between the original, N and U bulk list return
values were all broken in various ways:

1/ Shifting from malloc to xdr_alloc() (in 4f1efdc8b73ed)
   subtly changed the behaviour when handling an empty list. The
   correct XDR representation of an empty list is {0, NULL}, not
   {0, &memZero}. Fix the code so that if the source list is empty,
   an empty destination list is returned.
2/ The destination list length was never being filled in. This means
   that xdr_free() could not be safely used on this list, as the wrong
   length would be passed to the allocator. Fill in the destination
   list length as part of the conversion.
3/ xdr_free(...) is a no-op when called with an empty list - there's
   no need to check before calling it. Remove these checks to improve
   the code's readability.
4/ xdr_free(...) should only be called when the RPC returned
   sucessfully. The stub is responsible for freeing data should the call
   fail mid way through unmarshalling.
5/ Where an RPC returns the number of entries independently of the
   length of a counted array, it is unsafe to use that length to
   iterate the array without checking that it is within the array
   bounds. Instead, just use the array length when performing
   conversions.

Change-Id: Ied9a77849062e5a1e506f13d4d90d116cefe41e4
Reviewed-on: http://gerrit.openafs.org/3596
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agovos: Abstract out bulk list conversion
Simon Wilkinson [Sun, 26 Dec 2010 14:00:42 +0000]
vos: Abstract out bulk list conversion

Pull the various segments of code that do bulk list conversion into
their own functions. This is purely code reorganisation at this point,
fixes for these functions will follow in subsequent patches.

Change-Id: I941e94aaf776ece85f041d02f5bdbaad5cf5b129
Reviewed-on: http://gerrit.openafs.org/3595
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoLink hcrypto before roken
Andrew Deason [Wed, 22 Dec 2010 15:46:11 +0000]
Link hcrypto before roken

We must e.g. -lafshcrypto before we -lrokenafs, since stuff in hcrypto
can use functions provided by roken (such as ct_memcmp or
rk_cloexec_file). Fix any users of LIB_hcrypto that do not do this to
put LIB_roken after LIB_hcrypto.

Change-Id: I55f5589a521ed7da7a6692d817e94f18076ff4bc
Reviewed-on: http://gerrit.openafs.org/3584
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoUpdate NEWS for 1.5.78 and 1.6.0pre1
Russ Allbery [Fri, 24 Dec 2010 18:53:22 +0000]
Update NEWS for 1.5.78 and 1.6.0pre1

Based on the release notes.  Add an entry for 1.6.0 with in progress
instead of a date to hold the release notes for 1.6.0pre1 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: I8d14dd0ec030e3d047f1d2e85c888c1d86e7f3c0
Reviewed-on: http://gerrit.openafs.org/3592
Tested-by: Russ Allbery <rra@stanford.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoauth: Add more tests and resulting fixes to userok
Simon Wilkinson [Fri, 24 Dec 2010 18:32:30 +0000]
auth: Add more tests and resulting fixes to userok

Add tests for the functions afsconf_SuperUser() and
afsconf_SuperIdentity(). These had been missing tests because testing
them requires starting a client and a server, so amend the superuser-t
tests so that they can start up a simple server.

Fix a number of problems that the tests expose, with setting (and
freeing) identities in corner cases.

Change-Id: I29f5f9eda7f532c98183d588e488d704f8efad88
Reviewed-on: http://gerrit.openafs.org/3593
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoDAFS: listvol + unsalvagable volumes = intolerable delay
Derrick Brashear [Thu, 23 Dec 2010 18:20:42 +0000]
DAFS: listvol + unsalvagable volumes = intolerable delay

a non- inService volume (or more) plus vos listvol equals pain.
return Salvaging instead of waiting for it in the listvol case.

Change-Id: I02bdbb6448bcf56e97db9324aa723cc753a37632
Reviewed-on: http://gerrit.openafs.org/3588
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoPrefer libHcurses over libcurses
Andrew Deason [Wed, 22 Dec 2010 14:46:48 +0000]
Prefer libHcurses over libcurses

Use the HP-UX-specific libHcurses instead of libcurses, like we used
to. Otherwise we fail to link some gtx programs.

Change-Id: I7b8a012d5d263c611a144e05466c5435b5ff310a
Reviewed-on: http://gerrit.openafs.org/3583
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoHPUX: Put __HP_CURSES back in
Andrew Deason [Wed, 22 Dec 2010 05:02:45 +0000]
HPUX: Put __HP_CURSES back in

We need __HP_CURSES to be defined in order to get the _maxx WINDOW*
field among other things. Define it on HPUX again (it was taken out as
part of 4a6a00d6f45bd0ac94e2eb05adee41552073643a).

Change-Id: I3a17f270a034d97eea04580b8eae98a1784b5640
Reviewed-on: http://gerrit.openafs.org/3582
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agorx: Make rx_atomic.h a shared header
Simon Wilkinson [Thu, 16 Dec 2010 10:46:43 +0000]
rx: Make rx_atomic.h a shared header

Copy rx_atomic.h into the shared header directory so that it can be
used by other modules within the AFS build. Note that we can't actually
install this header onto the system (and it cannot be included by
headers which are installed) because it uses autoconf defines to control
its behaviour.

Change-Id: If543f998faa0608b4f7efab90db31f072f9e9981
Reviewed-on: http://gerrit.openafs.org/3579
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoLWP: kill dead code
Derrick Brashear [Tue, 21 Dec 2010 14:08:03 +0000]
LWP: kill dead code

the pthreads-wrapper LWP doesn't currently compile. it will need
to be revisited if we ever care. remove it (as well as a bit of other
unused code)

Change-Id: I61e7bc493127ec49347ca02b24db8fa79e4cbb28
Reviewed-on: http://gerrit.openafs.org/3564
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoLWP: don't copy pid to a null pointer
Derrick Brashear [Mon, 20 Dec 2010 21:36:42 +0000]
LWP: don't copy pid to a null pointer

In LWP_CreateProcess we take a pid. if it's null, don't crash.

Change-Id: I2a491788f5ce23a094e65192164838d5bbfc4b31
Reviewed-on: http://gerrit.openafs.org/3556
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoLINUX: Avoid unnecessary afs_ShakeLooseVCaches
Andrew Deason [Tue, 21 Dec 2010 15:31:39 +0000]
LINUX: Avoid unnecessary afs_ShakeLooseVCaches

Before some of the NewVCache refactoring, we only called
afs_ShakeLooseVCaches when afs_vcount was over (or equal to)
afs_maxvcount. Do this again, so we only try to shake loose vcaches
when we need more vcaches. Otherwise, we will call
afs_ShakeLooseVCaches every single time we want a new vcache when
dynamic vcaches are disabled (such as 2.4 Linux), and we log a warning
when we can't free any (which is likely when there are only 1 or 2
vcaches in use).

FIXES 128756

Change-Id: Ia06f76a6f719e69881b91fb2d975cfc33c85c370
Reviewed-on: http://gerrit.openafs.org/3569
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoLINUX: Reduce stack depth on recursive symlink res
Andrew Deason [Fri, 3 Dec 2010 23:20:54 +0000]
LINUX: Reduce stack depth on recursive symlink res

Instead of calling vfs_follow_link inside afs_linux_follow_link
ourselves, we can just resolve the next step of the symlink resolution
and set the result in nd_set_link(), freeing the string in
.put_link().

For kernels without a usable symlink text cache, this reduces call
depth when resolving a path containing many symlinks by two frames per
layer of indirection, allowing for more deeply-nested symlink paths to
be usable.

Change-Id: I6886c3b67089c8028fd6ad93ab10eb9173bd6fbe
Reviewed-on: http://gerrit.openafs.org/3433
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoCache bypass: remove ifdefs under src/afs/LINUX24
Andrew Deason [Mon, 20 Dec 2010 22:29:37 +0000]
Cache bypass: remove ifdefs under src/afs/LINUX24

Same as commit 9657695d34badaac654227be8c731a1512f2106b, but for
LINUX24. Remove the AFS_CACHE_BYPASS references in LINUX24, since it
is always enabled. Also remove messages about a "cache bypass patched
module".

Change-Id: I79526ed78752a4c3da7123e5af1c5eb6afc19fe3
Reviewed-on: http://gerrit.openafs.org/3568
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoDARWIN: replace resource merge script ref with binary
Derrick Brashear [Tue, 21 Dec 2010 14:17:38 +0000]
DARWIN: replace resource merge script ref with binary

Ro is a helper tool; use Rez directly

Change-Id: I7b3f8105344960a149d7fa0ee1fbb3a332486a04
Reviewed-on: http://gerrit.openafs.org/3565
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoDARWIN: make growlagent build not run afoul of ._ fun
Derrick Brashear [Tue, 21 Dec 2010 13:58:31 +0000]
DARWIN: make growlagent build not run afoul of ._ fun

in some cases a git checkout would promptly merge the ._ file away,
meaning a subsequent build would fail. just use the developer tools
to set an icon instead of clever tricks.

Change-Id: I34290f0f32cb7ae72a298a7af1ed4bd6a8ef9224
Reviewed-on: http://gerrit.openafs.org/3563
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoDARWIN: make ARCHFLAGS propagate to shlibs
Derrick Brashear [Tue, 21 Dec 2010 13:57:05 +0000]
DARWIN: make ARCHFLAGS propagate to shlibs

in order that configure not expand ARCHFLAGS (so we can override from
shell) escape the variable.

Change-Id: I9d5c3f4cc58c66be7ffefbd134ba476673be6ea8
Reviewed-on: http://gerrit.openafs.org/3562
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoFBSD7: Don't sleep with the glock
Ben Kaduk [Mon, 20 Dec 2010 00:33:28 +0000]
FBSD7: Don't sleep with the glock

On FreeBSD 7.X, vinvalbuf() can (will) sleep; this results in a panic
when the kernel is configured with WITNESS and we hold the glock around
it.
Drop the glock in this case.

Change-Id: I0036aad3059805d77afe9aa9bf7f5d421d6810f8
Reviewed-on: http://gerrit.openafs.org/3551
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoBring FBSD 7.X client back to life
Ben Kaduk [Sun, 19 Dec 2010 04:52:44 +0000]
Bring FBSD 7.X client back to life

Having been untested for quite some time, we had several
places that needed more conditionals to compile on FreeBSD 7.

Now we compile and start on 7.3-RELEASE, but have locking issues
under actual use.

It seems that we are also incompatible with the Heimdal 0.6.3 in
the base system -- aklog is unable to actually obtain the needed
credential when compiled against that kerberos implementation;
using MIT krb5 1.6.3 from ports works without incident.

FIXES 128612

Change-Id: I831cea711067d04dc276deb171faf3369c55b775
Reviewed-on: http://gerrit.openafs.org/3548
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoFBSD: StopListener glocking fixup
Ben Kaduk [Sun, 19 Dec 2010 05:06:13 +0000]
FBSD: StopListener glocking fixup

afs_osi_Sleep requires the glock (so that it can sleep on it); we
dropped the glock earlier in osi_StopListener because soshutdown and
soclose can sleep, but we must (unconditionally!) acquire it for our
loop waiting on rxk_ListenerPid.

Change-Id: I38c3ab6689a6af7f1693bd3c8348068ee280e530
Reviewed-on: http://gerrit.openafs.org/3549
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoLINUX24: Define afs_linux_can_bypass
Andrew Deason [Mon, 20 Dec 2010 16:05:46 +0000]
LINUX24: Define afs_linux_can_bypass

We call afs_linux_can_bypass, so make sure it exists.

Change-Id: Ie4393cc57af1a52748b76d3403370fbd788d9f8a
Reviewed-on: http://gerrit.openafs.org/3554
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoLINUX24: Include linux/pagemap.h
Andrew Deason [Mon, 20 Dec 2010 15:07:11 +0000]
LINUX24: Include linux/pagemap.h

For 2.4 Linux we need to include linux/pagemap.h, otherwise we get
undeclared references to KM_USER0 and PAGE_CACHE_SIZE.

Change-Id: I1bd6c6484a9b46f923fa31d1d45fbfedc243abbd
Reviewed-on: http://gerrit.openafs.org/3553
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agobackup: pass in valid dummy pid for LWP
Derrick Brashear [Mon, 20 Dec 2010 21:24:26 +0000]
backup: pass in valid dummy pid for LWP

LWP_CreateProcess needs memory passed in; instead of a null pointer,
pass in a pointer to a PROCESS.

Change-Id: I451d803461252e3afb5d89b840a1ee047228d204
Reviewed-on: http://gerrit.openafs.org/3555
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoZero rx_multi_lock before initializing it
Ben Kaduk [Mon, 20 Dec 2010 00:29:17 +0000]
Zero rx_multi_lock before initializing it

FreeBSD's kernel debugging facilities will panic if it detects
an attempt to re-initialize an already-initialized lock, as detected
through some particular bits being nonzero.  Zero everything out
before starting, to prevent this panic.

Change-Id: I7f3abae978d1cbe7eb4908d90c52a0dc46b81e08
Reviewed-on: http://gerrit.openafs.org/3550
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoWindows: fs chmod and display mode in fs examine
Jeffrey Altman [Sat, 18 Dec 2010 23:39:07 +0000]
Windows: fs chmod and display mode in fs examine

Make use of the new pioctl VIOC_GETUNIXMODE and VIOC_SETUNIXMODE
operations to display the current mode in fs examine and permit
setting the mode with "fs chmod".   The mode string parsing makes
use of Vincent Archer's code from Minix.  The required copyright
statement and license is attached to parsemode().

afsconfig-windows.h gains definitions for various mode symbols
that are not defined by Visual Studio runtime headers.

Change-Id: I624f73154b7f177f93289e2641da5d9478ea931c
Reviewed-on: http://gerrit.openafs.org/3546
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoWindows: clear mountPointStringp on status change
Jeffrey Altman [Mon, 20 Dec 2010 14:59:43 +0000]
Windows: clear mountPointStringp on status change

If the data version of the cm_scache_t changes, we must clear
the mountPointString.  Otherwise, if the object is a mountpoint
or symlink, cm_HandleLink() will not attempt to build the new
target string.   The Windows CM never updates the contents of
a mountpoint or symlink.  It always destroys the old and creates
a new one.  However, the Unix CM simply updates the link data.
Apparently, the Windows clients have never noticed.

Change-Id: If2297ed0a323411df13b7828d11dbb653669d351
Reviewed-on: http://gerrit.openafs.org/3552
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoWindows: Add VIOC_GETUNIXMODE and VIOC_SETUNIXMODE
Jeffrey Altman [Sat, 18 Dec 2010 23:36:18 +0000]
Windows: Add VIOC_GETUNIXMODE and VIOC_SETUNIXMODE

Add pioctls to get and set the UNIX mode bits for an
object in AFS.

Change-Id: I220047d8be50b5db511e41004b8248859f479c0c
Reviewed-on: http://gerrit.openafs.org/3545
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoFix fallback processing for ktc_GetTokenEx()
Jeffrey Altman [Sat, 18 Dec 2010 23:27:49 +0000]
Fix fallback processing for ktc_GetTokenEx()

The fallback processing after ktc_GetToken() generates
a token set or fails.  Immediately return 'code' to the
caller after freeing ktcToken.

Change-Id: If82c5c94b75152eaa4d077b428238e8f77478d05
Reviewed-on: http://gerrit.openafs.org/3544
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agodarwin: fix fixed setpag error handling
Derrick Brashear [Sat, 18 Dec 2010 02:16:52 +0000]
darwin: fix fixed setpag error handling

looks like testing 9da7f3cc73bf990427a9dd80ba2bbbb618383ea3
failed to have the right dependencies. fixing the fix!

Change-Id: Ib295e819667c895bfe52c4d5b217ebbeaf1e4c52
Reviewed-on: http://gerrit.openafs.org/3542
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agomacos nfs translator vnode ref fix
Derrick Brashear [Wed, 15 Dec 2010 10:22:26 +0000]
macos nfs translator vnode ref fix

code won't trigger today but we might as well get it right.
we already ref the vnode. don't leak refs.

Change-Id: Ib2aa87ffbb8c6bbd38d8858328d26f1a37cf04b9
Reviewed-on: http://gerrit.openafs.org/3532
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoLinux: Fix AFS_NORETURN violation with osi_AssertFailK
Anders Kaseorg [Sat, 6 Nov 2010 07:03:19 +0000]
Linux: Fix AFS_NORETURN violation with osi_AssertFailK

Commit d86f0c44d3c5910a6b54895484dc0286eac9bc73 changed the
AFS_LINUX26_ENV implementation of osi_AssertFailK so that it returns,
contradicting its AFS_NORETURN prototype, in an effort to make the
following BUG() display the right line number.  To fix this, move the
returning implementation into its only caller, the osi_Assert macro.

This fixes possible compiler misoptimizations due to

rx_kcommon.c:255:1: warning: ‘noreturn’ function does return

Change-Id: Ibbcc630037002ce4659e2e6a36b39d271f9bdc58
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3276
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoopr: Add new queue implementation
Simon Wilkinson [Mon, 25 Oct 2010 10:26:51 +0000]
opr: Add new queue implementation

Add a new queue implementation for OpenAFS. This has a similar calling
form as the current RX queue implementation, but is implementated using
type safe functions, and supports structures with multiple queue
headers. This permits threading a structure onto multiple queues at the
same time.

The eventual intention is that this queue implementation will replace
both rx_queue and the Unix cache manager afs_q.

Change-Id: I8f815872b017a85eb52a6e6451cdcee3eb869519
Reviewed-on: http://gerrit.openafs.org/3139
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agorefactor afs_CheckServers
Derrick Brashear [Wed, 1 Dec 2010 20:22:30 +0000]
refactor afs_CheckServers

basically, we need the ability to reuse this function, so, let's make it work
differently so we can.

Change-Id: I41a7e1dc62feeb137f1a7f5c939f54cb59cc6c13
Reviewed-on: http://gerrit.openafs.org/3403
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoAdd ioctl-based AFS calls for Solaris 11
Andrew Deason [Thu, 9 Dec 2010 00:16:14 +0000]
Add ioctl-based AFS calls for Solaris 11

Switch from using syscall-based AFS calls to ioctl-based AFS calls,
since syscall 65 was repurposed in some kernels in Solaris 11 and
OpenSolaris. Update the provided afs init script to accomodate the
additional steps needing for starting the AFS client.

Partially based off of some work by Derrick Brashear.

Change-Id: If694af8ac576856fed113851f1be4154b4d970d3
Reviewed-on: http://gerrit.openafs.org/3498
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoCellServDB update 13 Dec 2010
GCO Public CellServDB [Mon, 13 Dec 2010 15:53:05 +0000]
CellServDB update 13 Dec 2010

Change-Id: Ic3c96d99656f50da82243385cb7f9bcdf78f12e4
Reviewed-on: http://gerrit.openafs.org/3503
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoWindows: log error code for smb lan thread fail
Jeffrey Altman [Sun, 12 Dec 2010 04:28:02 +0000]
Windows: log error code for smb lan thread fail

When creation of the smb_LanAdapterChangeThread fails
log the error code as part of the panic message.

Change-Id: Iac034bdf2f04aed08cf77702c701882c31a10b36
Reviewed-on: http://gerrit.openafs.org/3502
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoWindows: PerformanceTuningInterval Merge error
Jeffrey Altman [Sat, 11 Dec 2010 12:19:54 +0000]
Windows: PerformanceTuningInterval Merge error

Due to a merge error, if RankServerInterval was set via the
registry, its value would also be used for the
PerformanceTuningInterval.  Fix it.

Change-Id: I6605146db0c25ecbf0d20f9d7198934f5bf411ad
Reviewed-on: http://gerrit.openafs.org/3500
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoAdd afs init script for Solaris 11
Andrew Deason [Fri, 10 Dec 2010 20:43:24 +0000]
Add afs init script for Solaris 11

Change-Id: I978454a5d34aee412ec3e3d57a38859b1405e5fb
Reviewed-on: http://gerrit.openafs.org/3499
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoDAFS: Avoid logging harmless LEAVE_OFF failures
Andrew Deason [Wed, 8 Dec 2010 20:57:13 +0000]
DAFS: Avoid logging harmless LEAVE_OFF failures

The DAFS volserver can create temporary destroyMe volumes, which it
then tells the fileserver to keep offline with an FSYNC_VOL_LEAVE_OFF
message. When the fileserver doesn't know that the volume exists,
currently it responds with SYNC_DENIED, which causes the volserver to
log the error with a "negative response on circuit FSSYNC" message.

These are harmless, though, since leaving a volume offline that the
fileserver does not know about is a no-op. So return the SYNC_FAILED
code instead, which does not get logged, and is more consistent with
some other FSYNC handlers like FSYNC_VOL_DONE.

Change-Id: I315d091fb419767ae33c1846d90e5ef83372477d
Reviewed-on: http://gerrit.openafs.org/3494
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoDAFS: Fix VOL_QUERY_VOP error codes
Andrew Deason [Wed, 8 Dec 2010 18:41:44 +0000]
DAFS: Fix VOL_QUERY_VOP error codes

Volumes in the VOL_STATE_DELETED state effectively do not exist. So,
when receiving an FSYNC_VOL_QUERY_VOP request for a volume, report
FSYNC_UNKNOWN_VOLID for a volume in the VOL_STATE_DELETED state.
Similarly, if the volume exists but on a different partition, we
should return the FSYNC_WRONG_PART reason code.

This allows volumes to be usable by the volume server in some corner
cases. For example, when a volume X exists on partitions A and B, and
the volserver deletes X on B. The fileserver then puts volume X in the
DELETED state, allowing checkouts over fsync, but FSYNC_VOL_QUERY_VOP
reports that no vop exists.

With this change, FSYNC_VOL_QUERY_VOP will instead report that the
volume does not exist, and so FSYNC_VerifyCheckout can succeed for
such volumes.

Change-Id: I6c4f7deead745ddba44963a9f66a9f2ef25686a5
Reviewed-on: http://gerrit.openafs.org/3493
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoDARWIN: Fix setpag syscall error detection
Andrew Deason [Thu, 9 Dec 2010 19:02:16 +0000]
DARWIN: Fix setpag syscall error detection

Darwin uses the same variable as the return value for
ioctl_afs_syscall, and as the last 'out' parmater, so the return value
for ioctl_afs_syscall will always overwrite whatever is written to the
last 'out' parameter. Instead, record two different variables, and
allow the returned error to overridte the error set as the last
parameter.

Change-Id: I7db1b226612c55c892810ce446b486b7e503529c
Reviewed-on: http://gerrit.openafs.org/3497
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoFix mech of building export on AIX
Christof Hanke [Sat, 4 Dec 2010 08:09:59 +0000]
Fix mech of building export on AIX

Presently, the distinction between 32Bit and 64Bit AIX is done by
inserting a "#" (comment-sign) into the Makefile.
This fails on some AIX-installations. Thus, just use normal
conditionals for distinguishing betwenn 32 and 64 bit.

Change-Id: Ie83bbdcd3c7c4b7b0858c9691bf6e1bf6c4ba32a
Reviewed-on: http://gerrit.openafs.org/3434
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoFix AUD_HOST callers
Andrew Deason [Wed, 8 Dec 2010 17:40:24 +0000]
Fix AUD_HOST callers

Servers using the AUD_HOST audit message should give the host IP in
network-byte order, as that is how the auditing code interprets it.
Fix the users of AUD_HOST that do not do so.

Change-Id: Iaf6abec850e691febfa3e07bff368eab6fb71409
Reviewed-on: http://gerrit.openafs.org/3492
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agotvolser: Link libafsrpc after libusd
Andrew Deason [Tue, 7 Dec 2010 19:49:47 +0000]
tvolser: Link libafsrpc after libusd

libusd can contain a reference to AssertionFailed, which is in
libafsrpc. So link libafsrpc after libusd, so it gets resolved when
building e.g. vos.

Change-Id: I30140b5ede5afa2495f4c2b7b7edbbd878bf6dca
Reviewed-on: http://gerrit.openafs.org/3477
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoauth: Return SuperUser identity for localauth
Andrew Deason [Tue, 7 Dec 2010 19:31:36 +0000]
auth: Return SuperUser identity for localauth

The caller expects identity to be populated when we return 1. So for
localauth, give it an identity. Don't set uname, and in fact, move the
uname declaration so that it is clear that it's not used for most of
this function.

Change-Id: I4dcd466b25f578362290ed2fc65b5bd6e23a91e4
Reviewed-on: http://gerrit.openafs.org/3475
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoauth: Move <NoAuth> to a named constant
Andrew Deason [Tue, 7 Dec 2010 22:04:11 +0000]
auth: Move <NoAuth> to a named constant

Add a #define for "<NoAuth>" and related values. Use them.

Change-Id: I0e1d374403a0ad20be6a2839e37a5894b15446cd
Reviewed-on: http://gerrit.openafs.org/3482
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agorxi_NatKeepAliveEvent: Shrink excessive stack buffer
Anders Kaseorg [Wed, 8 Dec 2010 06:21:16 +0000]
rxi_NatKeepAliveEvent: Shrink excessive stack buffer

Fixes
rx.c:6138:1: warning: the frame size of 1600 bytes is larger than 1024 bytes

Change-Id: I2f5b4961a7d929454a99ea99c637d1a0b2468a14
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3491
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoDAFS: make FSYNC_VOL_QUERY_VOP DAFS-only
Derrick Brashear [Wed, 8 Dec 2010 02:08:51 +0000]
DAFS: make FSYNC_VOL_QUERY_VOP DAFS-only

all the support code handles this only for DAFS. the
case statement should treat as unknown if it is.

Change-Id: I14816875b7a0b172d6f6fc9893cb0add90503111
Reviewed-on: http://gerrit.openafs.org/3485
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoDAFS: fix ifdef
Derrick Brashear [Wed, 8 Dec 2010 01:43:55 +0000]
DAFS: fix ifdef

there's no DEMAND_ATTACH_ENV ifdef. don't use it.

Change-Id: I2f6f9c57b187fcb514f318d977a15de1889f9055
Reviewed-on: http://gerrit.openafs.org/3484
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoSOLARIS: Free vcache mappings on shutdown
Andrew Deason [Tue, 7 Dec 2010 16:50:31 +0000]
SOLARIS: Free vcache mappings on shutdown

Right before shutdown, go through all of our vcaches and flush them,
freeing any pages associated with the vcaches. If we don't do this,
pages associated with our vcaches may still be around after we
shutdown and the module is unloaded, causing a panic when the kernel
tries to deference the page's vnode.

Abstract out afs_freevfs() following the gafs_foo/afs_foo convention
from the vnode ops, since we're calling this in two different places.

Change-Id: I64b88799acce3a55648ec94b53ed63319cd04698
Reviewed-on: http://gerrit.openafs.org/3472
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agomodify FindIndex to compare uuids
Jeffrey Altman [Tue, 7 Dec 2010 04:24:18 +0000]
modify FindIndex to compare uuids

If FindIndex is provided a server address and entry has a valid
uuid, obtain the uuid for 'server' and use that search for a
matching entry.

This modification is necessary in order to permit operations
against multi-homed servers in split horizon DNS configurations.

Change-Id: I8929c500eb4f71c8cf0aa8328bc3b3a0345368aa
Reviewed-on: http://gerrit.openafs.org/3468
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoafsconf_SuperUser verify identity before use
Derrick Brashear [Tue, 7 Dec 2010 06:13:09 +0000]
afsconf_SuperUser verify identity before use

if we didn't get an identity back, don't try to use it.

Change-Id: Iff6069b9231c3adc3f74cbf7fff4dffcfc289cd3
Reviewed-on: http://gerrit.openafs.org/3471
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoWindows: partial impl of TokenEx functions
Jeffrey Altman [Tue, 7 Dec 2010 04:23:01 +0000]
Windows: partial impl of TokenEx functions

No pioctl yet but implement enough so that GetTokenEx and
ListTokensEx can provide results.

Change-Id: I261f21db6e10502602aa0cb453b24632fdefd25c
Reviewed-on: http://gerrit.openafs.org/3469
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoWindows: test for path in afs before symlink test
Jeffrey Altman [Tue, 7 Dec 2010 05:02:33 +0000]
Windows: test for path in afs before symlink test

Check that the path is in afs before testing to see
if it is a symlink

Change-Id: If22331595b675bf9347d832eca70edfc6d1d0365
Reviewed-on: http://gerrit.openafs.org/3467
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoRX: Always define kernel XDR symbols to be AFS XDR
Andrew Deason [Mon, 6 Dec 2010 20:27:22 +0000]
RX: Always define kernel XDR symbols to be AFS XDR

Always define xdr_foo to afs_xdr_foo when we're in the kernel.
Otherwise, we can get warnings that our xdr_foo symbols are colliding
with the xdr_foo symbols from the kernel.

Change-Id: I74b2cdd24f01734c2c36506bb5bab0b386d46094
Reviewed-on: http://gerrit.openafs.org/3465
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoRemove unreached lines
Andrew Deason [Mon, 22 Nov 2010 02:29:11 +0000]
Remove unreached lines

Fix some macros to eliminate unreached trailing empty statements (such
as: "{code = foo; goto error;};"), and other oddities causing
"statement not reached" warnings. Also eliminate a couple of code
blocks that were never reached.

Change-Id: Iac626976268e13f5ef05f379ad1c9b5437c57f86
Reviewed-on: http://gerrit.openafs.org/3368
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agovol_split: Recover from stream open failure
Andrew Deason [Mon, 6 Dec 2010 22:11:24 +0000]
vol_split: Recover from stream open failure

Make sure we go through the error recovery code when we can't create a
stream, instead of just returning without cleaning up.

Change-Id: Ie3a5be9a81b36624a7d49958233c42e82a0e4bfa
Reviewed-on: http://gerrit.openafs.org/3466
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>

9 years agotubik: Link with libafsauthent
Andrew Deason [Mon, 6 Dec 2010 21:41:33 +0000]
tubik: Link with libafsauthent

libubik_pthread.a requires libafsauthent.a, since we make use of
afsconf_* functions. Add libafsauthent to LIBS and make tubik depend
on it.

Remove linking to liblwp while we're here, as we should not be using
any LWP code.

Change-Id: Ie028fedfbc3e7a8a78dc69a2c38be99eb72602da
Reviewed-on: http://gerrit.openafs.org/3464
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoroken: Export rk_daemon, not daemon
Andrew Deason [Mon, 6 Dec 2010 19:29:31 +0000]
roken: Export rk_daemon, not daemon

We never export a function called 'daemon'. We only export a function
called rk_daemon, and the define daemon to rk_daemon. So, only include
rk_daemon in the map file, since that is the only symbol that will
appear.

Change-Id: Ib0f5ba88ba6d8bdefe3191050bc9e9e36f1b9134
Reviewed-on: http://gerrit.openafs.org/3463
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoSOLARIS: Fix some rx_atomic.h warnings
Andrew Deason [Mon, 6 Dec 2010 18:46:06 +0000]
SOLARIS: Fix some rx_atomic.h warnings

Include atomic.h so we get atomic_* prototypes, pass atomic->var in
rx_atomic_sub, and pass unsigned int*s to  the atomic_* functions.

Change-Id: Ic8d745bc1726c850bd15d38702163e92587bb0a5
Reviewed-on: http://gerrit.openafs.org/3462
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agolibafs: Set tvcp->callback before BulkStatus
Andrew Deason [Thu, 12 Aug 2010 19:38:55 +0000]
libafs: Set tvcp->callback before BulkStatus

When we call InlineBulkStatus or BulkStatus, we currently do not touch
tvcp->callback for any of the vcaches before making the call. This can
cause us to not notice an InitCallBackState issued by the fileserver
before the BulkStatus call returns, since the InitCallBackState
handler looks at tvcp->callback to determine what vcaches to clear
callbacks for. In turn, this can cause us to think we have a callback
agreement with the fileserver on one of the BulkStatus'd files, when
the fileserver does not actually have such a callback agreement.

So, set tvcp->callback to the server we are contacting, so if we get
an InitCallBackState call from that fileserver, the CBulkFetching
state will be cleared, and we will correctly discard the callback
information for that vcache.

Change-Id: Ib8790c8f9621d7a9da12588ea6115f9cb3ff9022
Reviewed-on: http://gerrit.openafs.org/2548
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agolinux: avoid leaking parent when revalidating and it is /afs
Chaskiel Grundman [Mon, 6 Dec 2010 17:43:12 +0000]
linux: avoid leaking parent when revalidating and it is /afs

we happily go to the "good dentry" path and exit, leaking the
result of dget_parent, if parent is globalVp. Let's not

Change-Id: I3848a1aa2611d17ba08e04b3f33f22623645d233
Reviewed-on: http://gerrit.openafs.org/3448
Reviewed-by: Chaskiel Grundman <cg2v@andrew.cmu.edu>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoWindows: fix checked UNICODE build of talocale
Stefan Kueng [Sun, 5 Dec 2010 17:48:56 +0000]
Windows: fix checked UNICODE build of talocale

src/WINNT/talocale failed to build/link for checked builds. Fix it.

Change-Id: I39eb1605f67afdbd0f4ad04bb7ec560501410fbe
Reviewed-on: http://gerrit.openafs.org/3446
Tested-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoWindows: Build afs_shl_ext.dll with talocaleU.lib
Jeffrey Altman [Sat, 4 Dec 2010 23:03:21 +0000]
Windows: Build afs_shl_ext.dll with talocaleU.lib

Use the Unicode version of talocale to properly read
resource strings.

Change-Id: Ifb373a3b405922ecbdce4edb2ec86c31551d4dfa
Reviewed-on: http://gerrit.openafs.org/3442
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoWindows: install afs_shl_ext icon files
Jeffrey Altman [Sat, 4 Dec 2010 23:02:38 +0000]
Windows: install afs_shl_ext icon files

mount.ico and link.ico to dest\root.client\usr\vice\etc

Change-Id: Ic66f3cef73170d9101b12695a12ec41cdca6c89a
Reviewed-on: http://gerrit.openafs.org/3441
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoWindows: build a UNICODE version of talocale.lib
Jeffrey Altman [Sat, 4 Dec 2010 22:59:36 +0000]
Windows: build a UNICODE version of talocale.lib

Add src/WINNT/talocale_unicode that builds a UNICODE version
of talocale, talocaleU.lib

Change-Id: Iec343adbbab23fefa2dd9f474d23e593810552e9
Reviewed-on: http://gerrit.openafs.org/3440
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoWindows: fix UNICODE build for talocale
Jeffrey Altman [Sat, 4 Dec 2010 22:56:44 +0000]
Windows: fix UNICODE build for talocale

src/WINNT/talocale has not been built for UNICODE in a long time.
Fix it.

Change-Id: Ia8b182b711838e2d6592f9040d2173f5977f9cfd
Reviewed-on: http://gerrit.openafs.org/3439
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoWindows: afs_shl_ext improve overlay handlers
Stefan Kueng [Sat, 4 Dec 2010 09:56:01 +0000]
Windows: afs_shl_ext improve overlay handlers

Add link.ico and mount.ico Windows icon files.
Use these images as overlays instead of extracting an image
from shell32.dll which is a bad idea.  See

Change-Id: I624f959229a91329507aec5ff61045c49d296401
http://blogs.msdn.com/b/oldnewthing/archive/2005/10/26/485133.aspx
Reviewed-on: http://gerrit.openafs.org/3445
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoWindows: afs_shl_ext Show icon mount point overlay
Stefan Kueng [Fri, 3 Dec 2010 21:58:54 +0000]
Windows: afs_shl_ext Show icon mount point overlay

Change-Id: I8feb71e41e423c5e7484998bdac8a913595db9c4
Reviewed-on: http://gerrit.openafs.org/3444
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoWindows: afs_shl_ext folder bkgrnd context menu
Stefan Kueng [Fri, 3 Dec 2010 20:24:33 +0000]
Windows: afs_shl_ext folder bkgrnd context menu

Make the context menu handler also work for folder backgrounds
and on Win7 for library folder backgrounds

For folder backgrounds, the shell passes the PIDL of the folder
instead of a data object.  Extract the path from that PIDL. Also
extended the register function of the dll to add the required
registry keys.

Change-Id: I8928efd25058dced3820478a2858ce20336b4301
Reviewed-on: http://gerrit.openafs.org/3443
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoWindows: Remove fallback from GetCaps to GetTime
Jeffrey Altman [Wed, 1 Dec 2010 23:47:29 +0000]
Windows: Remove fallback from GetCaps to GetTime

If the file server responds to RXAFS_GetCapabilities with
RXGEN_OPCODE the server is up and there is no need to fallback to
RXAFS_GetTime.  Remove the code that performs the extra work.

Change-Id: Ieb0d1cce6f356a8988f2464227dec9b6cd9e6fcf
Reviewed-on: http://gerrit.openafs.org/3419
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoAdd .gitignore for tsm41
Christof Hanke [Sat, 4 Dec 2010 10:03:13 +0000]
Add .gitignore for tsm41

Just ignore some files created during the build.

Change-Id: Ifb276b2a71fe8e58517605584e918d990b8f2f5d
Reviewed-on: http://gerrit.openafs.org/3435
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoLINUX: Define zero_user_segment
Andrew Deason [Fri, 3 Dec 2010 22:39:57 +0000]
LINUX: Define zero_user_segment

When the kernel does not have the zero_user_segments function, we
define it ourselves. Also define the zero_user_segment function, since
we use it, and a kernel lacking zero_user_segments will also lack
zero_user_segment.

Change-Id: I5c786d2af27227793a7a2768d1af76ccd2d6a415
Reviewed-on: http://gerrit.openafs.org/3432
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoOpenBSD: Remove duplicate assignment of COMMON_INCLUDE in libafs
Antoine Verheijen [Fri, 3 Dec 2010 07:30:20 +0000]
OpenBSD: Remove duplicate assignment of COMMON_INCLUDE in libafs

When building libafs, the make file variable COMMON_INCLUDE is
assigned a value in two places: Makefile.common.in and
MakefileProto.OBSD.in. The assignment in the latter place is both
wrong and unnecessary. Remove it.

Change-Id: Ie322f01b023898d4f246243ee3d196aa714147df
Reviewed-on: http://gerrit.openafs.org/3430
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoMove include of sys/types.h in kopenafs.c
Antoine Verheijen [Fri, 3 Dec 2010 07:26:24 +0000]
Move include of sys/types.h in kopenafs.c

The netinet/in.h header file requires the inclusion of sys/types.h
(or some portion thereof). Most systems include it implicitly
within netinet/in.h. Some, such as OpenBSD, do not. In kopenafs.c,
sys/types.h is included after netinet/in.h which is fine in most
cases but means that, as a result, it will not compile on OpenBSD.
Moving sys/types.h before netinet/in.h solves this problem (and
should cause no problems on any other system).

Change-Id: Ifc3295f3eb4f0b2b4718d0b2aa6dcbb2b06da8df
Reviewed-on: http://gerrit.openafs.org/3429
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoproperly mark servers down for rx errors except OPCODE
Derrick Brashear [Thu, 2 Dec 2010 18:11:33 +0000]
properly mark servers down for rx errors except OPCODE

if we get a negative (rx) error, it means the server is down,
*except* for RXGEN_OPCODE. make this handling consistent

Change-Id: I8459ec49ca311dc336aed8da7b106fe0f647fc32
Reviewed-on: http://gerrit.openafs.org/3407
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agounix cm rx-oblivious connection pooling
Matt Benjamin [Wed, 3 Nov 2010 21:02:19 +0000]
unix cm  rx-oblivious connection pooling

Implements a connection pool for Rx client connections with the
same credentials.  The code trivially avoids the limit on Rx
call channels, without touching Rx directly.  The conn call limit
is known to be hit in cache-bypass, and probably other use cases,
so there is an incentive to address it potentially sooner than
larger Rx changes are ready to merge.

Upgrade to exclusive lock before calling find_preferred_connection.
Unset trace option.  Fix a warning around modular increment of
select_index, we'll go with the change suggested by Marc, I don't
see a real need to save the value mod CVEC_LEN.

Change-Id: I956aa22cd52b1c43187c7e03230e36820ba11c4d
Change-Id: Ie5f936ba912bcfe0544dbc1d035bb74e5ddc50f8
Reviewed-on: http://gerrit.openafs.org/2216
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agobalance afs_vcount in non-linux CM
Derrick Brashear [Thu, 2 Dec 2010 06:48:53 +0000]
balance afs_vcount in non-linux CM

when we dole out a vcache, count it.

Change-Id: Id0f9e20b4b8a9de6ee83dcb383c3a152f6b733e6
Reviewed-on: http://gerrit.openafs.org/3423
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agofreebsd: properly track vcache references
Derrick Brashear [Thu, 2 Dec 2010 06:55:34 +0000]
freebsd: properly track vcache references

previously both root and reclaim could end up leaking refs. fix it.

Change-Id: Ib3c9dab2f31b988a2887821f5192ff1fad0e732c
Reviewed-on: http://gerrit.openafs.org/3424
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoosconf quoting for macros
Derrick Brashear [Thu, 2 Dec 2010 06:02:04 +0000]
osconf quoting for macros

fix quoting to avoid substing during configure, instead let it happen in make

Change-Id: I31ec2e7f15ca14f337b4f3f43dd1ef5c0b423756
Reviewed-on: http://gerrit.openafs.org/3420
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoconfigure: add lresolv to MT_LIBS
Derrick Brashear [Wed, 1 Dec 2010 21:18:25 +0000]
configure: add lresolv to MT_LIBS

because of how we configure afsdb, we can end up needing libresolv
but not configuring it for threaded code. link it in. at the same time,
make sure the link can succeed on e.g. macos

Change-Id: Ibf2445638f36d543a0df8be1eaccfc0c31b72ae1
Reviewed-on: http://gerrit.openafs.org/3408
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoOpenBSD: Fix variable name typo in osi_vcache.c
Antoine Verheijen [Wed, 1 Dec 2010 22:40:04 +0000]
OpenBSD: Fix variable name typo in osi_vcache.c

The osi_PostPopulateVCache() routine in the OpenBSD version of
osi_vcache.c tries to use the non-existent variable "vc" instead
of "avc". This fixes it.

Change-Id: Idac09739d36e253518fbdbd600ab43c9ea87da3a
Reviewed-on: http://gerrit.openafs.org/3418
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoImport of code from heimdal
Heimdal Developers [Thu, 2 Dec 2010 05:27:55 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
42f9c644cf00be752f09d85a9664bf2e3502101c (switch-from-svn-to-git-1962-g42f9c64)

New files are:
roken/write_pid.c

Change-Id: I7b48eae393b26c6afe9e9b7dd9f26d8db2d1c6fc
Reviewed-on: http://gerrit.openafs.org/3421
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoOpenBSD: Fix use of mstat Length field in osi_vm.c
Antoine Verheijen [Wed, 1 Dec 2010 21:24:26 +0000]
OpenBSD: Fix use of mstat Length field in osi_vm.c

The code for osi_VM_FlushPages() in osi_vm.c for OpenBSD incorrectly
tries to access field "m.Length" in the vcache structure "avc"
instead of "f.m.Length".

Change-Id: I44ac0bbbd0e6279c54be185fbf9514b23c65017b
Reviewed-on: http://gerrit.openafs.org/3417
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoFBSD: clean up rx_socket teardown
Ben Kaduk [Sun, 28 Nov 2010 04:25:03 +0000]
FBSD: clean up rx_socket teardown

We had previously been waiting for the SO_ISDISCONNECTED flag
to show up in the so_state field, but the flags are not really
used for stateless protocols such as UDP, and that flag never
shows up.  Even with a full three-second wait, the rxk_Listener
sometimes still failed to fully terminate, preventing the reuse
of the rx port for a restarted afsd.
Copy from Solaris and loop until rxk_ListenerPid is zero, doing
bogus one-byte NetSends in the body of the loop.

Change-Id: I6a5ad4509549fa64c551af642ef5867602b182c0
Reviewed-on: http://gerrit.openafs.org/3391
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoImport of code from heimdal
Heimdal Developers [Wed, 1 Dec 2010 18:02:30 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
42f9c644cf00be752f09d85a9664bf2e3502101c (switch-from-svn-to-git-1962-g42f9c64)

Upstream changes are:

Asanka C. Herath (9):
      Windows: Registry based configuration
      Rename get_entry() -> _krb5_config_get_entry()
      Deal with quoted strings when reading lists of config strings
      Add missing export and calling convention annotations
      Windows: Build and export localtime_r
      Windows: Older Windows SDKs need <winsock2.h>
      More compatibility macros
      Increase KBR5_BUFSIZ to 2048 and use it in config_file.c
      Deal with backslash escaped quotes

Love Hornquist Astrand (3):
      provide symbol renameing for sha512 and sha384
      less exit with failures
      add random abstraction

Change-Id: I495fa8e9c1c037d6dee191279c1155a4ec6be945
Reviewed-on: http://gerrit.openafs.org/3400
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoutil: Add definition of KRB5_BUFSIZ
Simon Wilkinson [Wed, 1 Dec 2010 18:07:24 +0000]
util: Add definition of KRB5_BUFSIZ

A forthcoming Heimdal update will require that KRB5_BUFSIZ be
defined in order to use its config parsing code. Define it in
our hacky krb5_locl.h

Change-Id: Ieda8df8f31a759927fade44f9196e7411f4a0a59
Reviewed-on: http://gerrit.openafs.org/3399
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoBuild and use roken's mkstemp
Simon Wilkinson [Wed, 1 Dec 2010 17:42:23 +0000]
Build and use roken's mkstemp

Add roken's mkstemp to the build on all platforms, either through
configure (Unix) or explicitly (Windows). Change all callers so
that mkstemp is used unconditionally, rather than falling back
to more risky alternatives.

This is based on original change from Russ Allbery submitted as
http://gerrit.openafs.org/2146

Change-Id: Ia1def41e438e6517b3e7cd5790df3c99eddb8ef6
Reviewed-on: http://gerrit.openafs.org/3398
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoImport of code from heimdal
Heimdal Developers [Wed, 1 Dec 2010 17:35:50 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
5b91f58f350c92fb9eacd1ebac558381b0b8deac (switch-from-svn-to-git-1705-g5b91f58)

New files are:
roken/mkstemp.c

Change-Id: I42cf73fd2943e2d5cfa629d3ce05f20a065428a1
Reviewed-on: http://gerrit.openafs.org/3397
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoImport mkstemp.c from libroken
Simon Wilkinson [Wed, 1 Dec 2010 17:27:46 +0000]
Import mkstemp.c from libroken

Change-Id: Idd8688cc731436ff1fe5708e273045b96085e986
Reviewed-on: http://gerrit.openafs.org/3396
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoOpenBSD: Use Darwin version of afsi_SetServerIPRank() for OpenBSD 4.7 and above.
Antoine Verheijen [Wed, 1 Dec 2010 20:22:45 +0000]
OpenBSD: Use Darwin version of afsi_SetServerIPRank() for OpenBSD 4.7 and above.

With OpenBSD 4.7, the ia_subnet and ia_subnetmask fields have been removed
from the in_ifaddr structure as part of a cleanup that considers them
unnecessary. Thus, the version of afsi_SetServerIPRank() that OpenBSD was
using no longer compiles. On the other hand, the Darwin version of this
routine seems suited to OpenBSD's needs since it doesn't use those fields
so we'll use that version for OpenBSD 4.7 and above instead.

Change-Id: I27333056378a023e175bddeb637288fc6d1b6e88
Reviewed-on: http://gerrit.openafs.org/3405
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoDarwin: Assign correct value to myDstaddr in afsi_SetServerIPRank()
Antoine Verheijen [Wed, 1 Dec 2010 18:54:23 +0000]
Darwin: Assign correct value to myDstaddr in afsi_SetServerIPRank()

The value in sin->sin_addr.s_addr that's assigned to myDstaddr in the
Darwin version of afsi_SetServerIPRank() is in network byte order but
really needs to be in host byte order.

Note: This patch assumes that change I66f5c790d8c55b359e3550b6d71f3abe040a2820
      has been previously installed. The patch fails otherwise.
Change-Id: I3078da1efb94f87f84dbe357f3272d908818256b
Reviewed-on: http://gerrit.openafs.org/3402
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoDARWIN: Fix processing using rx_ifaddr_* macros in afsi_SetServerIPRank()
Antoine Verheijen [Wed, 1 Dec 2010 18:37:02 +0000]
DARWIN: Fix processing using rx_ifaddr_* macros in afsi_SetServerIPRank()

The macros rx_ifaddr_address, rx_ifaddr_netmask, and rx_ifaddr_dstaddress
all expand to a call to memcpy() which returns the destination address as
its return value. The test in the DARWIN version of afsi_SetServerIPRank()
for completion when using this macro, however, seems to assume that success
returns zero, which is wrong and results in myAddr, subnetmask, and
myDstaddr always being set to zero. This patch corrects this behaviour.

Change-Id: I66f5c790d8c55b359e3550b6d71f3abe040a2820
Reviewed-on: http://gerrit.openafs.org/3401
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoWindows: permit code signing without timestamps
Jeffrey Altman [Mon, 29 Nov 2010 22:47:10 +0000]
Windows: permit code signing without timestamps

If CODESIGN_TIMESTAMP is not defined, permit code signing
to occur but do not ask signtool to contact a timestamp
server.

Change-Id: I801264192caaf871225b001c6f96c0317e115578
Reviewed-on: http://gerrit.openafs.org/3393
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

10 years agoUnix afsd: Check for mountpoint /afs first
Christof Hanke [Sun, 28 Nov 2010 12:01:12 +0000]
Unix afsd: Check for mountpoint /afs first

Check for the existance of the mountpoint before trying to
start.

Change-Id: I56c7a69b2b24c465f987e33c3f88c6ac37e40dd0
Reviewed-on: http://gerrit.openafs.org/3392
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoCache bypass: switch to rx_Readv
Marc Dionne [Wed, 24 Nov 2010 00:08:24 +0000]
Cache bypass: switch to rx_Readv

Tests show that cache bypass doesn't scale very well past a few
concurrent processes, with a lot of lock contention in the RX
layer.  Switching the implementation to the iovec based rx_Readv
alleviates much of this.

Also take advantage of the fact that the upper layer readpages
only sends down contiguous lists of pages, and issue larger read
requests and populate the pagecache pages from the iovecs we
get back.  The loop logic is changed significantly to accomodate
the new pattern.

Read throughput is improved by about 30-40% for some parallel read
benchmarks I use.  Along with some other tweaks, it can allow the
throughput to be more than doubled.

Change-Id: I56877ec15eba035429bd4ea32731687c862f151f
Reviewed-on: http://gerrit.openafs.org/3375
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

10 years agoMore deprecations noted.
Steve Simmons [Tue, 31 Aug 2010 17:16:15 +0000]
More deprecations noted.

Change-Id: Id0d15f0f065dbbd82287258175530527e7cde36f
Reviewed-on: http://gerrit.openafs.org/2633
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>