openafs.git
12 years agotools: Add roken.h to afsdump
Simon Wilkinson [Sat, 7 Apr 2012 12:26:25 +0000]
tools: Add roken.h to afsdump

On AIX, building afsdump currently produces the following warnings:

"afsdump_scan.c", line 34.10: 1506-296 (S) #include file <sys/fcntl.h> not found.
"afsdump_scan.c", line 275.32: 1506-045 (S) Undeclared identifier O_RDWR.
"afsdump_scan.c", line 275.41: 1506-045 (S) Undeclared identifier O_CREAT.
"afsdump_scan.c", line 275.51: 1506-045 (S) Undeclared identifier O_TRUNC.
"afsdump_scan.c", line 305.29: 1506-045 (S) Undeclared identifier O_RDONLY.

Rather than including more platform specific goo, just add a roken.h
include to the various files to pull in the necessary headers.

Change-Id: I46db92511c804cfc9b5d67b97cd3596480d306d6
Reviewed-on: http://gerrit.openafs.org/7117
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agotools: Rename u_int64 to solve AIX problem
Simon Wilkinson [Sat, 7 Apr 2012 11:36:54 +0000]
tools: Rename u_int64 to solve AIX problem

AIX's system headers define u_int64. Rename our local 64 bit integer
representation as dt_uint64 to avoid this collision.

Change-Id: I997e3ff89df369a5f0643921a846a759bf8fa90b
Reviewed-on: http://gerrit.openafs.org/7115
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agolibafscp: Use strdup, rather than rolling our own
Simon Wilkinson [Fri, 30 Mar 2012 18:18:47 +0000]
libafscp: Use strdup, rather than rolling our own

   A = malloc(strlen(B)+ 1);
   memset(A, 0, strlen(B) + 1);
   strlcpy(A, B, strlen(B) + 1);
can be more simply written as
   A = strdup(B);

Doing so also avoids a warning from clang that strlcpy isn't checking
for A overflowing.

Change-Id: I0e21f86eda7bdc0ce869e651c5ceb23d7494e1e2
Reviewed-on: http://gerrit.openafs.org/7077
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agolibadmin: Clear structures according to their size.
Simon Wilkinson [Fri, 30 Mar 2012 18:16:50 +0000]
libadmin: Clear structures according to their size.

memset(a, 0, sizeof(a)) is rarely correct, unless a is an error. Use the
size of the destination structure, rather than the size of a pointer to it
when deciding how much memory to clear.

Caught by clang's new error messages

Change-Id: Ia6c566534efae2f67f1b9bd22198d352238a987c
Reviewed-on: http://gerrit.openafs.org/7076
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agolibadmin: read returns an ssize_t, not a size_t
Simon Wilkinson [Fri, 30 Mar 2012 18:14:38 +0000]
libadmin: read returns an ssize_t, not a size_t

size_t is unsigned, and therefore can never be less than 0. Using it as
a return code from read() means that we never catch read errors. read()
is defined as returning ssize_t, so just use this to capture its return
code.

Caught by clang's new error messages

Change-Id: Ibf61119dec2c64fd4b1e16e6ef02178e427116f0
Reviewed-on: http://gerrit.openafs.org/7075
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agoUnix CM: Purge needless brackets
Simon Wilkinson [Fri, 30 Mar 2012 18:12:37 +0000]
Unix CM: Purge needless brackets

Doing if ((a==b)) is unecessary. It's also potentially dangerous, as
that's the syntax required to do assignment within an if statement.
clang now issues warnings (errors in -Werror mode) when it encounters
these.

Remove pointless braces from the Unix CM to make clang happy.

Change-Id: I0f1558b42a487e1de722b77f8423500365a20eee
Reviewed-on: http://gerrit.openafs.org/7074
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agoDARWIN: Make crfree() an inline function
Simon Wilkinson [Fri, 30 Mar 2012 18:09:36 +0000]
DARWIN: Make crfree() an inline function

On Darwin 100, we have
   #define crfree(X) kauth_cred_unref(&X)
which expands in one place to
   kauth_cred_unref(&(afs_ucred_t *)avc->linkData)

clang warns about this in -Werror mode, because arguments to the
address-of operator must be lvalues.

To fix this make crfree an inline function, which will then let us do
the indirection required.

Change-Id: Ic5adb63dcdc11e04c1e428c32e85f33a987fcf42
Reviewed-on: http://gerrit.openafs.org/7073
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agoutil: LogCommandLine has to have a command line
Simon Wilkinson [Sun, 7 Aug 2011 18:41:51 +0000]
util: LogCommandLine has to have a command line

Add an assert() to LogCommandLine to catch the case where it is
called without a command line to log.

Change-Id: Ia1be28b3a1d1d4e144626976f0f82b9675809c0a
Reviewed-on: http://gerrit.openafs.org/7072
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agoSalvager: Don't use garbage vnodes when Testing
Simon Wilkinson [Tue, 15 Jun 2010 18:20:50 +0000]
Salvager: Don't use garbage vnodes when Testing

If Testing is true, and the salvage wants to repair the '.' file,
then it will end up using a garbage value as the location of the
repaired file (vnodeNumber gets set to fid.Vnode, but fid.Vnode is
uninitialised)

Fix this by making it behave as if no repair is necessary when running
in Testing mode. It's unclear that this is entirely the correct answer,
but it's definitely better than the current behaviour.

Caught by clang-analyzer

Change-Id: I1bddd889b3350cf31fe6384573e49e82159c7095
Reviewed-on: http://gerrit.openafs.org/7071
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agoWindows: Disk Full errors instead of Quota Exceeded
Jeffrey Altman [Sat, 7 Apr 2012 02:30:41 +0000]
Windows: Disk Full errors instead of Quota Exceeded

The AFS Redirector does not support the Windows quota interface
therefore return STATUS_DISK_FULL for all over quota conditions.

Change-Id: Idd8755b26ab65e423330eeb6cb0e1806dd6306c9
Reviewed-on: http://gerrit.openafs.org/7111
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: AFSCheckCellName one level of indirection
Jeffrey Altman [Sat, 7 Apr 2012 02:18:59 +0000]
Windows: AFSCheckCellName one level of indirection

The parameter 'CellName' is a UNICODE_STRING *.  No need to
take the pointer of it to pass to AFSDbgLogMsg().

Change-Id: Id49f95058541a1a0ddaa0db9cb2c5ef0e5a32c64
Reviewed-on: http://gerrit.openafs.org/7109
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: CleanACLEnt requires cm_scache write locked
Jeffrey Altman [Thu, 5 Apr 2012 11:38:47 +0000]
Windows: CleanACLEnt requires cm_scache write locked

Therefore, cm_FindACLCache() must be called with the cm_scache_t
write-locked and therefore cm_HaveAccessRights() must obtain a
write-lock and not a read-lock on 'aclScp'.

Change-Id: I884cd5a70a793d893999bf750264e76d436f40a2
Reviewed-on: http://gerrit.openafs.org/7049
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Name Array store mount point and volume root
Jeffrey Altman [Mon, 2 Apr 2012 22:10:07 +0000]
Windows: Name Array store mount point and volume root

Modify the Name Array processing to store both the mount point
object and the volume root directory object in the array.  This
is necessary for proper operation of
AFSPopulateNameArrayFromRelatedArray when the DirectoryCB parameter
is a mount point object.

Modify AFSBackupEntry to remove two entries if a volume root
directory entry is being removed.

Remove AFSReplaceCurrentElement() as it is no longer used.

Change-Id: Iaa0a4effc3448351d04bcdd72be9ee726ffe4e9a
Reviewed-on: http://gerrit.openafs.org/7021
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: do not call time() in a loop
Jeffrey Altman [Mon, 2 Apr 2012 11:10:17 +0000]
Windows: do not call time() in a loop

When checking for ACL Entry expiration, obtain the current time
once per call to cm_FindACLCache() instead of once per ACL entry.

Change-Id: I4da9e290a43315bd226f6c1b5dc12abe45ed19f5
Reviewed-on: http://gerrit.openafs.org/7016
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Add per object per user EACCES caching
Jeffrey Altman [Sun, 1 Apr 2012 05:17:21 +0000]
Windows: Add per object per user EACCES caching

If a cache manager is told by a file server that the user does
not have permission to fetch status for an object, the cache
manager must avoid requesting a fetch status a second time for
that object for the same user.  Doing so risks triggering the
rx call abort throttling which can have a significant impact on
end user usability of the Explorer Shell and other applications.

The cache manager cannot make a decision on whether or not to
issue an RXAFS_FetchStatus RPC based upon the type of the object
because the type is unknown to the cache manager.  A file server
will succeed a FetchStatus request when the parent directory ACL
grants lookup permission if the object in question is the directory
or is a symlink/mountpoint.  Only file objects require read/write
permissions to obtain status information.

The rx call abort throttling is broken is many ways and must be
avoided.  Call aborts are tracked by call channel and occur whenever
ten call aborts are issued on the same call channel in a row
regardless of the amount of time that has elapsed.

The EACCES cache works by storing EACCES events by the FID and User
for which the event occurred, when it occurred and the FID of the
parent directory.  By definition, the parent FID of a volume root
directory is itself.

Entries are removed from the cache under the following circumstances:

 1. When the parent FID's callback expires or is replaced.

 2. When the parent FID's cm_scache object is recycled.

 3. When the user's tokens expire or are replaced.

Entries are not removed when the FID's cm_scache object is recycled.

This patchset also implements correct behavior if the VLF_DFSFILESET
flag is set on a volume.

Change-Id: I69507601f9872c9544e52a1d5e01064fa42efb81
Reviewed-on: http://gerrit.openafs.org/6996
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Fail recursive path evaluation with access denied
Jeffrey Altman [Mon, 2 Apr 2012 17:41:27 +0000]
Windows: Fail recursive path evaluation with access denied

Matching the behavior of the AFS SMB server, the afs redirector
should return STATUS_ACCESS_DENIED if File ID recursion is detected
in the Name Array for any given path.

Change-Id: Ie846b42a228c634f1c38a8103332c7bb72803d1f
Reviewed-on: http://gerrit.openafs.org/7018
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Check Avail Space on extending SetEndOfFile
Jeffrey Altman [Fri, 6 Apr 2012 03:14:18 +0000]
Windows: Check Avail Space on extending SetEndOfFile

When cm_SetLength() is called with an extending file length,
check the available free space in the volume to see if the
new length will fit.  If not, return CM_ERROR_SPACE.

This permits applications to discover that there is insufficient
space prior to writing all of the data into the windows page
cache at which point it will be too late.

There is still the possibility of a race that can result in
data loss if two applications are writing into the same volume
at the same time and there is insufficient room.

Change-Id: Ieef2c48f5b6edc8d101b6527af3a3f87fe55f6ca
Reviewed-on: http://gerrit.openafs.org/7057
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoviced: Do not offline volume on successful IH_DEC
Andrew Deason [Thu, 5 Apr 2012 22:55:17 +0000]
viced: Do not offline volume on successful IH_DEC

If we fail to CoW a file due to ENOSPC, we try to IH_DEC the new file
copy, and if IH_DEC fails, we take the volume offline for salvaging.
But IH_DEC returns 0 on success, not on error. So take the salvaging
path when we get non-zero.

Change-Id: I4f0276fd4f077ca42087e92af8ba77b4e5347422
Reviewed-on: http://gerrit.openafs.org/7054
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Redirector must query volume size when asked
Jeffrey Altman [Thu, 5 Apr 2012 18:40:18 +0000]
Windows: Redirector must query volume size when asked

The volume size and free space cannot be obtained at volume
initialization and then re-used for all FileFsSizeInformation
and FileFsFullSizeInformation queries.  Doing so prevents Windows
from being able to see changes in the available free space.

The maximum size of the volume is not the size of the partition
and the available space on the partition unless there is no quota
applied to the volume.  If there is a quota, then the free space
is the smaller of the available quota and the available partition
space.

Add a new ioctl request to permit the redirector to query the
current Volume Size Information details.

Change-Id: I3414f314d7780fd12489e0d278b71bcadc1a72e6
Reviewed-on: http://gerrit.openafs.org/7052
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: cm_AddACLCache lock ordering
Jeffrey Altman [Thu, 5 Apr 2012 21:00:28 +0000]
Windows: cm_AddACLCache lock ordering

cm_aclLock must be obtained after cm_user_t mx and cm_cellLock.

cm_user_t mx must be obtained before cm_cellLock.

Change-Id: Iaf9fcf17c7ea50f2f5a83aefa759b7077ef28be6
Reviewed-on: http://gerrit.openafs.org/7051
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agorx: fix bad merge 95c38dff3740d7e24971ceb5875c06e7abfce102
Jeffrey Altman [Thu, 5 Apr 2012 21:16:15 +0000]
rx: fix bad merge 95c38dff3740d7e24971ceb5875c06e7abfce102

An extra

  CALL_HOLD(call, RX_CALL_REFCOUNT_BEGIN)

was added in rx_NewCall().  Revert it.

Change-Id: Ief1493ae9ec69ace5afd534a97fbf43f55872153
Reviewed-on: http://gerrit.openafs.org/7050
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: AFSVerifyEntry purge file data on DV change
Jeffrey Altman [Thu, 5 Apr 2012 04:11:11 +0000]
Windows: AFSVerifyEntry purge file data on DV change

If the data version change is detected during AFSVerifyEntry(),
treat it the same as if the AFS_OBJECT_FLAGS_VERIFY_DATA flag
had been previous set.  Purge the old data from the Windows
file cache.  Be sure to set the new metadata after the purge
so that if the file length was truncated the old data beyond
the truncation point will still be purged.

Change-Id: I80c33f303c6499f22955e9874b2f4c50d666a3cb
Reviewed-on: http://gerrit.openafs.org/7048
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoxstat_cm_test: Print all call info stats
Andrew Deason [Tue, 3 Apr 2012 23:13:17 +0000]
xstat_cm_test: Print all call info stats

For CM xstat collecton 0 (function call statistics), there are many
more stats given to us on the wire than we currently print. Change
this so we print out everything in the afs_CMCallStats struct.

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

12 years agorx: Get rid of some uneccessary temporary vars
Simon Wilkinson [Sun, 8 Jan 2012 11:49:53 +0000]
rx: Get rid of some uneccessary temporary vars

rx_ReadProc and rx_ReadProc32 originally used temporary variables
(which were, at one time, declared as "register") to hand optimise
a couple of routines. With the removal of register throughout our
code, this is no longer helpful.

Change-Id: Id21a931408489b985b726af620a687b838303a86
Reviewed-on: http://gerrit.openafs.org/6997
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoWindows: Redirector Dir Enumeration Bug
Jeffrey Altman [Mon, 2 Apr 2012 03:09:32 +0000]
Windows: Redirector Dir Enumeration Bug

An enumerated directory was not validated properly if
AFSValidateEntry() was called with PurgeData == FALSE even
when a data version change was detected.  Now it does.

FIXES 130636

Change-Id: Ic5d2fd62b40fb16652fc09d459caf43905566d37
Reviewed-on: http://gerrit.openafs.org/7012
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agotools: move useful tools from test dir to tools dir
Derrick Brashear [Tue, 3 Apr 2012 17:51:38 +0000]
tools: move useful tools from test dir to tools dir

move the dump utilities out of tests

Change-Id: I21d0550e09fde3b1feb078bde4e9b4dc7ca3614e
Reviewed-on: http://gerrit.openafs.org/7043
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agolinux: update spec requirements
Derrick Brashear [Thu, 29 Mar 2012 14:44:53 +0000]
linux: update spec requirements

don't require things which don't exist on el5. do require them
in el6. require kernel-devel if building modules
don't do anything involving the kernel if not building modules
if we can figure out that we don't have 2.4 based on the version,
avoiding the need to depend on kernel-devel just to build an srpm.

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

12 years agolinux: make mockbuild more reliable
Derrick Brashear [Fri, 30 Mar 2012 20:15:52 +0000]
linux: make mockbuild more reliable

previously, a "cached" repo which was assumed to be of the same
releasever and arch of the host was created in /var/tmp,
which would screw up repoquery across a multiple-OS-build.

well, you can tell repoquery what you really mean. so now we do.

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

12 years agoSOLARIS: Correct misplaced osi_machdep.h #endif
Andrew Deason [Mon, 2 Apr 2012 21:16:37 +0000]
SOLARIS: Correct misplaced osi_machdep.h #endif

Commit 64778fd7bece52360482f9a51f19b34dac1d2678 removed some '#ifdef
KERNEL' blocks, but for one block in SOLARIS/osi_machdep.h, the wrong
trailing #endif was removed. This effectively makes the last part of
the file Solaris 10+ only, and bypasses the header guard. On systems
before Solaris 10, this causes us to lose the osi_procname definition,
which eventually shows up as an undefined symbol.

So, reinstate the original #endif, and remove the correct #endif
instead.

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

12 years agoWindows: cm_GetNewSCache must return NULL on failure
Jeffrey Altman [Tue, 3 Apr 2012 13:09:42 +0000]
Windows: cm_GetNewSCache must return NULL on failure

cm_GetNewSCache was leaking a valid cm_scache_t pointer in some
failure cases.  On failure, explicitly set the return value to
NULL.

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

12 years agoRx: give grow mtu its own call ref count type
Jeffrey Altman [Thu, 12 Jan 2012 14:31:43 +0000]
Rx: give grow mtu its own call ref count type

Change-Id: Ibf62408203d615ff87454a9ecb50c38b6db6d45a
Reviewed-on: http://gerrit.openafs.org/6543
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agorx: conn->callNumber protected by conn_call_lock
Jeffrey Altman [Sun, 29 Jan 2012 18:52:17 +0000]
rx: conn->callNumber protected by conn_call_lock

The conn->callNumber array should be protected by the conn_call_lock
since the conn_call_lock is what protects the binding of calls to
connection channels.

Change-Id: I9f9b4e8f90d1e4ebbc4429af286358807784d84f
Reviewed-on: http://gerrit.openafs.org/6629
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoRx: rxi_FreeCall conn_call_lock vs call->lock deadlock
Jeffrey Altman [Fri, 20 Jan 2012 06:50:01 +0000]
Rx: rxi_FreeCall conn_call_lock vs call->lock deadlock

The conn->conn_call_lock is held before call->lock in the lock
hierarchy which is violated within rxi_FreeCall(). While the
deadlock is rare, it is possible and has been experienced on
both Windows and Linux.

Change the signature of rxi_FreeCall to return 1 if it frees
the call and 0 if it does not.

Due to the lock hierarchy violation use MUTEX_TRYENTER()
to attempt to obtain the conn->conn_call_lock.  If the lock
cannot be obtained set the call state to dally and
return.  If the conn_call_lock can be obtained, behave as
we did before this patchset.

Only increment the callNumber if the original call->state
was dally or hold and the conn_call_lock could be obtained.
We must not increment the callNumber otherwise.  Doing so can
result in call numbers being skipped when the conn->call slot
is reused.

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

12 years agoWindows: Pass name array to AFSRetrieveFileInformation
Jeffrey Altman [Mon, 2 Apr 2012 21:32:39 +0000]
Windows: Pass name array to AFSRetrieveFileInformation

AFSRetrieveFileInformation does not parse the complete path.
That information is available in the Ccb->NameArray.  If the
object on which AFSRetrieveFileInformation is called is a
relative symlink containing ".." references, the full contents
of the evaluated path is required for context.  Pass the
Ccb->NameArray so that it is available.

Change-Id: Id02d3fb47df74c0a0de849eb10550be76150ce8b
Reviewed-on: http://gerrit.openafs.org/7020
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Use hash when comparing File IDs in redirector
Jeffrey Altman [Mon, 2 Apr 2012 17:39:17 +0000]
Windows: Use hash when comparing File IDs in redirector

AFSIsEqualFid() should use the hash value included in the FileId
as part of the comparison algorithm.

Change-Id: I2723e2e9795ce16869c6a0dc33611078b04a6a28
Reviewed-on: http://gerrit.openafs.org/7017
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows FindACLCache must hold scp write locked
Jeffrey Altman [Mon, 2 Apr 2012 10:57:53 +0000]
Windows FindACLCache must hold scp write locked

In the SMB modules, calls to cm_FindACLCache() were not
holding the cm_scache_t rwlock writed locked as required.

Change-Id: I213912eb8dd570ea918d92602c647e6aed8cfccb
Reviewed-on: http://gerrit.openafs.org/7015
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: fix indentation
Jeffrey Altman [Mon, 2 Apr 2012 10:57:02 +0000]
Windows: fix indentation

Change-Id: Id3cd061badd1c8c4e22843e84999954e5424511d
Reviewed-on: http://gerrit.openafs.org/7014
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Freelance HaveAccessRights
Jeffrey Altman [Sun, 1 Apr 2012 16:40:36 +0000]
Windows: Freelance HaveAccessRights

Change the test in cm_HaveAccessRights related to Freelance
mode.  All objects in the freelance cell and root volume
by definition have access rights.

Change-Id: Ibb96b12c15728bc6b711b3d7f2ad892c55109cbf
Reviewed-on: http://gerrit.openafs.org/7008
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: optimize InitCallback3 processing
Jeffrey Altman [Sun, 1 Apr 2012 16:11:40 +0000]
Windows: optimize InitCallback3 processing

Do not drop and acquire locks if the cm_scache_t does not
have a callback.

Change-Id: I6f84729838e7e4c2d84c0a40f0811ed837b79287
Reviewed-on: http://gerrit.openafs.org/7007
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Record callback issued time
Jeffrey Altman [Fri, 30 Mar 2012 19:13:55 +0000]
Windows: Record callback issued time

Save the time at which a callback was issued.  This can be
used in a later patchset to determine if a callback was issued
after a negative access entry for a {fid,user} pair.

Change-Id: Iab54eb729fd5f2a2daf4855b7e7e75245dc28051
Reviewed-on: http://gerrit.openafs.org/6995
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Implement cm_TGTLifeTime()
Jeffrey Altman [Fri, 30 Mar 2012 18:58:11 +0000]
Windows: Implement cm_TGTLifeTime()

cm_aclent.h defined cm_TGTLifeTime() as a macro that always
returned 0x7fffffff.  Implement cm_TGTLifeTime() as a function
that returns the actual token lifetime.

Change-Id: I8b19626395f536db248ae8324b13e49eda9a1a87
Reviewed-on: http://gerrit.openafs.org/6994
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: add parent FID to cm_GetSCache
Jeffrey Altman [Fri, 30 Mar 2012 16:24:43 +0000]
Windows: add parent FID to cm_GetSCache

When a cm_scache_t object is created in 98% of the time, the
parent FID is known to the cache manager.  Normally the cache
manager will obtain the parent info from the AFSFetchStatus
structure but if the user credentials do not permit status info
to be obtained from the file server the parent info will be unavailable.

Having the parent directory FID is useful for debugging but can
also be used to check the user's access rights on the parent directory.

Change-Id: I262345bc686392a4edef4c627182a8a67a392aa2
Reviewed-on: http://gerrit.openafs.org/6993
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoviced: AFSDisk, AFSFetchVolumeStatus Int31 PartSize
Jeffrey Altman [Tue, 3 Apr 2012 02:35:41 +0000]
viced: AFSDisk, AFSFetchVolumeStatus Int31 PartSize

The AFSDisk and AFSFetchVolumeStatus structures use signed
32-bit integers for representation partition size and
available blocks.  RoundInt64ToInt31() should be used instead
of RoundInt64ToInt32() when assigning their values.

Change-Id: I3834141fce2d54ce8bdfac3dc566074583bb305e
Reviewed-on: http://gerrit.openafs.org/7022
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agorx: handle clock reversals for call timeouts
Jeffrey Altman [Fri, 23 Mar 2012 17:41:10 +0000]
rx: handle clock reversals for call timeouts

If the clock is set backwards, call timeouts will not trigger
until the clock regains its original value plus the timeout period.
In rxi_CheckCall(), look for a backward clock shift and if one is
noticed, fail the call with RX_CALL_TIMEOUT.

Change-Id: I7ca5abee165fc21d72d3881670f9522d315b4982
Reviewed-on: http://gerrit.openafs.org/6943
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoviced: Do error translation for InlineBulkStatus
Simon Wilkinson [Sat, 31 Mar 2012 23:21:04 +0000]
viced: Do error translation for InlineBulkStatus

When a host has requested universal errors, error code conversion
is performed in the CallPostamble. However, the InlineBulkStatus
errorcodes are passed as part of the data set, not as RX errors,
so this translation is not performed.

Fix this so that we also translate error codes that are part of
the InlineBulkStatus response.

Change-Id: Ia23232d948990bdf9b7c4e5e0bcd8be087289a03
Reviewed-on: http://gerrit.openafs.org/6992
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: avoid deadlock with Trend Micro
Jeffrey Altman [Fri, 30 Mar 2012 03:49:43 +0000]
Windows: avoid deadlock with Trend Micro

Trend Micro's anti-virus driver attempts to open the file in
response to CcPurgeCacheSection().  While processing
AFSSetDispositionInfo() the Fcb->NPFcb->Resource is held which is
also required if a status verification is required during the
CreateFile operation.  That results in a deadlock.

Avoid the deadlock by setting the PENDING_DELETE flag prior to
calling CcPurgeCacheSection().

Change-Id: I40d93d70e120525343afb917d473ad79a1f36e29
Reviewed-on: http://gerrit.openafs.org/6988
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Use ulFilter in AFSInvalidateObject
Jeffrey Altman [Fri, 30 Mar 2012 03:39:17 +0000]
Windows: Use ulFilter in AFSInvalidateObject

ulFilter was assigned appropriate values but it was not passed
to AFSFsRtlNotifyFullReportChange as a parameter.

Change-Id: Ie362b2b762e599a7cb040640539a098fdf80a259
Reviewed-on: http://gerrit.openafs.org/6987
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: ObjectInformation.ObjectReferenceCount comparison
Jeffrey Altman [Tue, 27 Mar 2012 04:16:30 +0000]
Windows: ObjectInformation.ObjectReferenceCount comparison

If there is an undercount of the ObjectReferenceCount, consider it
the same as if the object count is zero for comparison purposes.

Change-Id: Ia4ec2d1194f00cb530e7a50ed9db9c71cc4c5313
Reviewed-on: http://gerrit.openafs.org/6970
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Add Name Array Processing Trace Subsystem
Jeffrey Altman [Tue, 27 Mar 2012 18:18:14 +0000]
Windows: Add Name Array Processing Trace Subsystem

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

12 years agoWindows: AFSInvalidateObject can overwrite input param
Jeffrey Altman [Mon, 26 Mar 2012 15:10:36 +0000]
Windows: AFSInvalidateObject can overwrite input param

AFSInvalidateObject() must not be called with an AFSObjectInformationCB
pointer variable that it is not safe to overwrite as the function sets
the input value to NULL if the invalidation is going to be performed
asynchronously in a worker thread.

In AFSEnumerateDirectory(), the following call took place:

  AFSInvalidateObject( &pDirNode->ObjectInformation,
                       AFS_INVALIDATE_DATA_VERSION);

which requires a worker thread to process.  As a result, the
ObjectInformation pointer was being set to NULL which detached the
AFSObjectInformationCB from the AFSDirectoryCB.  That in turn produced
an execption in AFSLocateName() which resulted in a resource not being
freed that in turn produced a deadlock.

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

12 years agowindows: ObjectInformationCB.ObjectReferenceCount
Jeffrey Altman [Mon, 26 Mar 2012 01:29:40 +0000]
windows: ObjectInformationCB.ObjectReferenceCount

The ObjectInformationCB.ObjectReferenceCount is protected by
the VolumeCB->ObjectInfoTree.TreeLock.   When the TreeLock is
dropped the reference count can change.  Hold the TreeLock across
both ObjectReferenceCount == 0 tests and the associated tear down
or repeat the ObjectReferenceCount == 0 test after the TreeLock
is reacquired.

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

12 years agoremove athena env conditionals
Michael Meffie [Mon, 26 Mar 2012 18:22:09 +0000]
remove athena env conditionals

Remove the conditionals AFS_ATHENA_STDENV, AFS_ATHENA_ENV
and AFS_KERBREALM_ENV.

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

12 years agoWindows: Fix VNOSERVICE EventLog parameters
Jeffrey Altman [Tue, 27 Mar 2012 04:00:30 +0000]
Windows: Fix VNOSERVICE EventLog parameters

Add missing volume and cell.

Change-Id: If1efeb0defb3812e3f41572fb7d46f5e867be70c
Reviewed-on: http://gerrit.openafs.org/6969
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: CreateProcessNotify verify changes
Jeffrey Altman [Tue, 27 Mar 2012 00:49:03 +0000]
Windows: CreateProcessNotify verify changes

PsSetCreateProcessNotifyRoutineEx will fail with STATUS_ACCESS_DENIED
if the driver does not have the IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY
bit set in the image header.

Do not include the ParentProcessId in the AFSProceSSDestroy
parameter list.  It isn't available to use and isn't used for
anything in any case.

Assign AFSProcessCB blocks to processes that were created before
AFSRedirector registered the CreateProcessNotify callback and
access the file system.

Change-Id: I4b78cd94949cfdea6b36f601a851c0e2f53a7dbf
Reviewed-on: http://gerrit.openafs.org/6967
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agomacos: iterate mdfound packagemakers when spaces are present
Derrick Brashear [Tue, 27 Mar 2012 16:09:38 +0000]
macos: iterate mdfound packagemakers when spaces are present

even if we get more than one match, and even if there's a space,
work anyway

Change-Id: I8e71af0cb02fda7ea0fcf1c2f7a0404eca4bc073
Reviewed-on: http://gerrit.openafs.org/6971
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agomacos: find packagemaker instead of assuming path
Derrick Brashear [Tue, 27 Mar 2012 00:33:26 +0000]
macos: find packagemaker instead of assuming path

in xcode 4.3, packagemaker is unbundled. make no assumptions
about where it can be found; instead, let spotlight tell us

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

12 years agoafs: Slight adjustments in afs_GetDCache
Andrew Deason [Thu, 22 Mar 2012 15:52:47 +0000]
afs: Slight adjustments in afs_GetDCache

maxGoodSize is only used in one block, so move the decl to that block.
Adjust some of the comments to more accurately reflect what's going
on.

Change-Id: Ifee3a6f98158a314cef6d241c53a0f881f4f2d2b
Reviewed-on: http://gerrit.openafs.org/6936
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoafs: Do not limit fetches based on vcache length
Andrew Deason [Fri, 2 Mar 2012 23:22:12 +0000]
afs: Do not limit fetches based on vcache length

Currently, when we go to the fileserver to fetch some data, we try to
make sure that we do not ask for data beyond the end of the file. For
example, if our chunk size is 1M, and we need to get the first chunk
for a file that is 4 bytes long, we will only ask the fileserver for 4
bytes.

This can cause issues when the file is being extended at the same time
as when we are trying to read the file. Consider the following
example. There is a file named X that has contents "abcd" at dv 1, and
we issue a FetchData64 request for X, only requesting 4 bytes. Right
before the fileserver gets the FetchData64 request, another client
writes the contents "12345" to file X.

The client will then fetch the contents "1234" for that file, at dv 2,
and store that as the contents of the first chunk for file X. On
subsequent reads for file X, applications will now get "1234<NUL>" as
the contents, since the size of the file will be updated to 5, but the
cache manager thinks that "1234" is the correct contents for the first
chunk of X at dv 2. The cache manager will continue to think so until
the cache entry is evicted or invalidated for whatever reason.

To avoid this scenario, always request a full chunk of data if we have
any data to fetch and the file has not been locally truncated. We can
still avoid the fetch at all if it looks like we're fetching beyond
end-of-file, since we know that at least at some point that was
correct information about the file. If this results in us trying to
fetch beyond end-of-file, the fileserver will respond with the correct
length anyway.

We still need to restrict the fetch request length based on
avc->f.truncPos, since the dcache data after avc->f.truncPos needs to
stay empty, since we don't track truncated data any other way. If we
also avoided this restriction, extending a file via truncation after
reducing a file's length via truncation could cause the old file data
to appear again, instead of filling the new file range with NULs.

Note that on at least Linux, with this fix an application can still
read the contents "1234" on the first read in the above example, and
"12345" on subsequent reads. This is just due to when we give the VFS
updates about file metadata, and could be remedied by updating file
metadata immediately from the FetchStatus information from the
FetchData64 call. However, just reading the contents "1234" in the
above example seems like a somewhat plausible outcome; at the very
least, it is an improvement.

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

12 years agoafs: Set DWriting when truncating a dcache entry
Andrew Deason [Thu, 22 Mar 2012 15:42:38 +0000]
afs: Set DWriting when truncating a dcache entry

When we truncate a file, we truncate the contents of the relevant
dcache entry chunks, and prevent future FetchData operations from
fetching data beyond the truncation offset. If we never write anything
to that chunk, we never set DWriting, and so on disk it looks like
that dcache entry has valid data for the specified DV. However, since
the data is truncated, this is not true.

If a process holds a file open, truncates it without writing to it,
and then the client crashes (or we have trouble contacting the
fileserver when we close the file), the dcache entry will appear valid
on disk. So the next time we read the dcache entry, we will use the
incorrect cache contents as if they were accurate for the specified
DV.

To avoid this, set DWriting when we truncate a chunk. Normally we only
clear DWriting when we actually send data to the fileserver, so to
clear DWriting in this case, add an additional line to clear it in
afs_StoreAllSegments, after the StoreMini has completed.

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

12 years agoafs: Log a message on invalid FetchStatus receipt
Andrew Deason [Fri, 2 Mar 2012 23:18:25 +0000]
afs: Log a message on invalid FetchStatus receipt

If we get an invalid AFSFetchStatus structure from a server, log a
message to indicate as such. This serves as a warning to urge people
to fix their fileservers, and to explain what is doing.

Change-Id: I33845f6228f96f693dcbfddcee38dae583f1b092
Reviewed-on: http://gerrit.openafs.org/6881
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoafs: Sanity-check some AFSFetchStatus structures
Andrew Deason [Fri, 2 Mar 2012 23:06:48 +0000]
afs: Sanity-check some AFSFetchStatus structures

We currently do not do any sanity checking on the AFSFetchStatus
structures returned from fileservers. Add some sanity checking for
BulkStatus and FetchStatus calls, so we do not screw up our cache if a
fileserver gives us bogus data.

If we do get an invalid AFSFetchStatus structure, act as if the server
gave us a VBUSY error code, so we will retry the request. For OpenAFS
fileservers prior to 1.6.1 that yield this situation, VBUSY is likely
the error code the fileserver should have responded anyway.

Change-Id: Ie16a5210149b21dd5945380f5d7b6a4d9ee01a72
Reviewed-on: http://gerrit.openafs.org/6880
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoFinish removing sunos 4.x references and build cruft
Chas Williams (CONTRACTOR) [Mon, 19 Mar 2012 17:07:41 +0000]
Finish removing sunos 4.x references and build cruft

Also, fix afsxbsa.h to always include <time.h> since this should get
struct tm on any fairly modern operating system.

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

12 years agoviced: Do not ignore all InlineBulkStatus errors
Andrew Deason [Fri, 2 Mar 2012 20:55:04 +0000]
viced: Do not ignore all InlineBulkStatus errors

InlineBulkStatus currently returns 0 unconditionally, no matter what
errors are encountered. If we encounter an error early enough, from
CallPreamble for example, we do not fill in the OutStats nor CallBacks
structures at all. Since we return success anyway, this results in the
client getting AFSFetchStatus structures full of zeroes (or garbage,
before commit 726e1e13ff93e2cc1ac21964dc8d906869e64406).

Since current OpenAFS clients do not perform any sanity checks on the
information received, this can result in cache corruption of files
being seen incorrectly as empty, and, before commit 726e1e, more
arbitrary corruption.

So instead, return an error if we encounter an error before we iterate
over the given FIDs. We still of course do not return an error for any
errors encountered during the actual metadata retrieval, as those are
reflected in the individual per-fid status structures.

Change-Id: Icfab4516e510be5f0063ddf9c69f11ab3d511b35
Reviewed-on: http://gerrit.openafs.org/6871
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agoWindows: Assign AuthGroup during Process Create
Jeffrey Altman [Tue, 20 Mar 2012 02:38:06 +0000]
Windows: Assign AuthGroup during Process Create

As the process is being created, assign the AuthGroup so that
the must up to date information is used to assign AuthGroup
inheritance from Impersonation states and to prevent the parent
process from being destroyed before the AuthGroup is determined.

Change-Id: I176360a589d7f2bcf4b1ededad069424e3ce5393
Reviewed-on: http://gerrit.openafs.org/6927
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Refactor AFSProcessSupport
Jeffrey Altman [Tue, 20 Mar 2012 01:10:31 +0000]
Windows: Refactor AFSProcessSupport

Breakup AFSProcessNotify() into AFSProcessCreate() and
AFSProcessDestroy().

Correct inconsistencies with ETHREAD vs ThreadId HANDLE.

Add AFSProcessNotifyEx() and use PsSetCreateProcessNotifyRoutineEx()
to register it on Vista SP1 and above.

Change-Id: I2be85c3e8229883b4e239e1fdba9a65fc704daaa
Reviewed-on: http://gerrit.openafs.org/6926
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agodoc: correct implicit ACL permissions volume owner
Jeffrey Altman [Sun, 25 Mar 2012 13:56:48 +0000]
doc: correct implicit ACL permissions volume owner

OpenAFS changed the behavior of implicit administrator permission
for directory ownership.  In OpenAFS only the volume root directory
owner has implicit administrator permissions and they apply to all
directories in the volume not just those with matching ownership.

Change-Id: I8ca0a8874fe17cf7fc575107bd76efb5dc472b10
Reviewed-on: http://gerrit.openafs.org/6951
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agosoftsig: not used on windows
Jeffrey Altman [Sat, 24 Mar 2012 13:23:50 +0000]
softsig: not used on windows

Do not install afs/softsig.h on Windows from src/util

Do not include it in src/viced/viced.c

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

12 years agotests: Add opr to the command test libraries
Simon Wilkinson [Thu, 22 Mar 2012 14:48:16 +0000]
tests: Add opr to the command test libraries

The cmd/command-t test needs libopr, so give it to it

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

12 years agolibafsrpc: Export connection accessor fuctions
Simon Wilkinson [Thu, 22 Mar 2012 14:39:27 +0000]
libafsrpc: Export connection accessor fuctions

Add various connection accessor functions to the export map file for
libafsrpc so they can be used from within RX security layers.

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

12 years agoopr: should be built as shared
Chas Williams (CONTRACTOR) [Mon, 19 Mar 2012 20:47:28 +0000]
opr: should be built as shared

Since this library could be use anywhere (including a shared library)
it should be built as position independent code.

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

12 years agoWindows: Client handling of VNOSERVICE
Jeffrey Altman [Thu, 22 Mar 2012 19:55:47 +0000]
Windows: Client handling of VNOSERVICE

VNOSERVICE should not be grouped together with the volume status
error codes.  It is used to indicate that the RPC was not serviced.
The file server issues it when its idle dead timeout period is reached
while receiving rx call data.  The client's existing status information
is still valid and the client can retry the call.

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

12 years agoWindows: AFSRedir Debug for STATUS_NOT_A_DIRECTORY
Jeffrey Altman [Wed, 21 Mar 2012 14:11:31 +0000]
Windows: AFSRedir Debug for STATUS_NOT_A_DIRECTORY

Add additional logging to handle the case where the afsd_service
returns STATUS_NOT_A_DIRECTORY for eval by id/name.

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

12 years agoLinux 3.4: Switch to d_make_root
Marc Dionne [Thu, 22 Mar 2012 02:19:04 +0000]
Linux 3.4: Switch to d_make_root

If d_make_root is available, use it instead of d_alloc_root.
The helper was introduced in 3.3, and d_alloc_root gets removed
in 3.4.

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

12 years agodoc: remove references to AFS's NTP daemon
Ken Dreyer [Wed, 14 Mar 2012 02:06:43 +0000]
doc: remove references to AFS's NTP daemon

AFS's own ntpd and runntp are obsolete. Remove them from the
documentation, and recommend the OS vendor-supplied NTP instead.

Change-Id: If0cd837aa407eb49049881790e618ccd75ca6e5b
Reviewed-on: http://gerrit.openafs.org/6903
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agobuild on solaris 10 again
Michael Meffie [Mon, 19 Mar 2012 23:27:33 +0000]
build on solaris 10 again

Use min and max instead of the non-standard MIN and MAX macros.

Commit 64b00c3a1a87739621f58c777fc3cc54fb15a0af removed inclusion of
rx_packet.h, which included definitions of MIN and MAX on various platforms.

Change-Id: I3d3c75af375704b8baddd72aec3aecf3c4fd43d7
Reviewed-on: http://gerrit.openafs.org/6924
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoWindows: invalidate correct objects during dir verification
Jeffrey Altman [Fri, 16 Mar 2012 05:09:42 +0000]
Windows: invalidate correct objects during dir verification

When processing a directory verification, if a change of data
version is detected or if the FileID of a FileName changes,
be sure to invalidate and verify the directory entry.  Setting
the verify flag on the parent after updating the directory
entry's metadata does not result in the correct behavior.

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

12 years agoosx: deal with more kerberos damage
Derrick Brashear [Thu, 15 Mar 2012 15:51:39 +0000]
osx: deal with more kerberos damage

the number of things which can return success without succeeding is
truly sad.

Change-Id: Iab3a6ef72afc8075462dfd98548ad7aa3051d40f
Reviewed-on: http://gerrit.openafs.org/6911
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agoafs: Never #define away afsd_dynamic_vcaches
Andrew Deason [Wed, 7 Mar 2012 22:36:57 +0000]
afs: Never #define away afsd_dynamic_vcaches

Some versions of the Solaris Studio compiler on SPARC (at least 12.2
and possibly others, but not 12.3) get a little confused by code like
this:

    extern int foo;
    int
    somefunc(void) {
        if (0) return foo;
        return 0;
    }

When optimization is turned off, this results in an undefined symbol
reference to 'foo' (which is normal), but the resulting object file
lacks a relocation entry for the symbol 'foo', so the symbol remains
undefined after linking. In the OpenAFS tree, this occurs in
afs_daemons.c which references afs_vcount and afs_cacheStats in this
manner due to afsd_dynamic_vcaches being defined as '0' on Solaris.
The end result is that the libafs kernel module is not loadable, since
it complains about afs_vcount and afs_cacheStats being undefined, even
though the symbol definitions are also in the module.

While this is a bug in Solaris Studio and has since been fixed, it is
simple to work around this so we are usable with more compilers. If we
just always declare afsd_dynamic_vcaches as a regular variable, it
works around this issue and keeps the code a tiny bit simpler. So, do
that.

Change-Id: I3f8fc6aafd52487d729289e393fc59dac84d36ea
Reviewed-on: http://gerrit.openafs.org/6888
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agorx: hold call->lock across RXS_PreparePacket
Simon Wilkinson [Wed, 14 Mar 2012 14:56:06 +0000]
rx: hold call->lock across RXS_PreparePacket

RX Security Classes have a right to assume that when RXS_PreparePacket
is called that they have exclusive access to the rx_call structure.
Commit e445faa68c5ec6e47d3fd9d7318ade71d98703a9 unintentionally
failed to acquire the call->lock prior to RXS_PreparePacket being
called.

Change-Id: I5a9dfb2818fa17ba6fc1ab6f76ec5cde602c6f16
Reviewed-on: http://gerrit.openafs.org/6904
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Drop resource across AFSCleanupFcb
Jeffrey Altman [Mon, 12 Mar 2012 19:53:47 +0000]
Windows: Drop resource across AFSCleanupFcb

Avoid additional deadlocks involving
VolumeCB->ObjectInfoTree.TreeLock.

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

12 years agoWindows: Wait for memory allocation if necessary
Jeffrey Altman [Wed, 7 Mar 2012 14:54:54 +0000]
Windows: Wait for memory allocation if necessary

The kernel has a limited pool of memory.  If there is no memory
available to satisfy a request, that request will fail initially
with a STATUS_OUT_OF_RESOURCES error which in most cases is exposed
to the user-mode application as STATUS_ACCESS_DENIED.  This can
produce inconsistent results.

This patchset introduces an Event object, MemoryAvailableEvent,
which is signalled when the redirector deallocates memory.  This
should in many cases permit requests to succeed where they otherwise
would have failed immediately.

The WaitingForMemoryCount field tracks the number of threads that
are waiting for memory to become available.  A subsequent patch
could use this value to accelerate the tear down of cached data.

To avoid deadlocks, blocking threads will only wait for a maximum
of 30 seconds at a time.  As long as the redirector continues to
free memory, the thread can re-queue itself.  However, if a timeout
occurs, the allocation request will fail.

Change-Id: I0aa549be3852b31b68d7b42ecab4ca982c75f6ba
Reviewed-on: http://gerrit.openafs.org/6886
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Correct Data Version change synchronization
Jeffrey Altman [Tue, 6 Mar 2012 05:14:28 +0000]
Windows: Correct Data Version change synchronization

The data version must be checked and set while the ObjectInformation
DirectoryNodeHdr.TreeLock is held exclusive.  Otherwise, it is
possible for a race to occur.

Change-Id: Ia4d94cca1d161062e9d98675976ba8fad5731032
Reviewed-on: http://gerrit.openafs.org/6883
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoMake volscan's column delimiter option work
Paul Smeddle [Mon, 12 Mar 2012 19:56:11 +0000]
Make volscan's column delimiter option work

Currently, volscan ignores the -delim command-line option,
using the hardcoded default. This patch adds processing
for this option, allowing alternative characters.

Corrects an error in a08c3207255756c825ab69a19e04f79dd879c646

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

12 years agoviced: fix inverted lockCount assignment
Jens Wegener [Tue, 6 Mar 2012 13:28:32 +0000]
viced: fix inverted lockCount assignment

FIXES 130605

Change-Id: Ibfdbc03100094ca33630dc9e1ddbcacf770a1a02
Reviewed-on: http://gerrit.openafs.org/6884
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoredhat: Don't replace modified configuration files during rpm update
Jonathan Billings [Thu, 8 Mar 2012 14:23:40 +0000]
redhat: Don't replace modified configuration files during rpm update

The previous setting for three %config files mentioned in the spec file:

%config /etc/sysconfig/openafs
%config %{_prefix}/vice/etc/ThisCell
%config %{_prefix}/vice/etc/cacheinfo

When using an unadorned %config, it's possible that these files will
be replaced by the packaged version during a package update.  Changing
%config to %config(noreplace) means that the packaged file will be
installed with the extension .rpmnew if there is already a modified
(from the existing package's version) file with the same name on the
installed machine.

The concern here is that updating an existing system could potentially
change the configuration if the person installing doesn't pay close
attention.  The Rule of Least Surprise indicates that we should
try to preserve existing configuration changes whenever possible.

Change-Id: Ie132c12a3c5defe9bf6fec9ec0f8bd08f3d98646
Reviewed-on: http://gerrit.openafs.org/6887
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agorxgen: fix to use rx accessor routines
chas williams - CONTRACTOR [Mon, 5 Mar 2012 16:41:08 +0000]
rxgen: fix to use rx accessor routines

apparently some uses didnt get converted during the previous work.

Change-Id: Iaa4dcf73fd2e29e3f95feede5217eac4eaded4e2
Reviewed-on: http://gerrit.openafs.org/6874
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoviced: fix -realm option arg parse
Michael Meffie [Sat, 3 Mar 2012 14:42:12 +0000]
viced: fix -realm option arg parse

Advance only once per realm argument when processing the
realm command line option.

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

12 years agoviced: fix log message in hpr initialize
Michael Meffie [Wed, 29 Feb 2012 16:08:10 +0000]
viced: fix log message in hpr initialize

The wrong dir object is used to log an error in hpr
initialize.

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

12 years agomacos: don't crash on krb5 damage
Derrick Brashear [Sun, 4 Mar 2012 14:48:07 +0000]
macos: don't crash on krb5 damage

if we get success but still no client, don't crash

Change-Id: I6be28ac6ecece3448123a84cf442a791eebc93cc
Reviewed-on: http://gerrit.openafs.org/6868
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agoWindows: add __try..__except
Jeffrey Altman [Fri, 2 Mar 2012 15:54:38 +0000]
Windows: add __try..__except

Wrap potential exception locations in __try ... __except so
that the exceptions can be caught by us instead of Cc/Mm which
use exceptions to signal status.

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

12 years agoWindows: fix indentation
Jeffrey Altman [Fri, 2 Mar 2012 15:54:23 +0000]
Windows: fix indentation

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

12 years agoWindows: Avoid deadlock in invalidation path
Jeffrey Altman [Fri, 2 Mar 2012 15:52:35 +0000]
Windows: Avoid deadlock in invalidation path

During data version invalidation the AFS redirector must CcPurge
any non-dirty extents on a file. This operation can be intercepted
by a filter driver which in turn might open the file and close it
again before the CcPurge completes.

The AFSPerformObjectInvalidate call holds the ExtentsResource
shared which can deadlock if AFSClose attempts an extent tear down
which requires exclusive access to the ExtentsResource.

Change-Id: I7cb0289d8036aabf56bb11fd12a79308be45faa8
Reviewed-on: http://gerrit.openafs.org/6856
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoFixes dkms.conf for Redhat Enterprise
Dave Botsch [Thu, 1 Mar 2012 17:43:36 +0000]
Fixes dkms.conf for Redhat Enterprise

commit 8e0aaae076f4cccfd2d6ed81ede4e355235b578e , while fixing dkms.conf for
Fedora, broke dkms.conf for RHEL. In RHEL, you get a dkms.conf with too
many backslashes in the "mv" line. The dkms.conf should have the mv line
reading:

mv src/libafs/MODLOAD-*/\$KMODNAME \$DSTKMOD"

for Fedora.

This change checks if we are building on Fedora, and if so, maintains
the extra backslashes. Otherwise, not.

modified:   src/packaging/RedHat/openafs.spec.in

Uses the dist tags as specified at
http://fedoraproject.org/wiki/Packaging:DistTag

Change-Id: I7fd7531758a63b2634424c2fcba23ae1b0fc8f2f
Reviewed-on: http://gerrit.openafs.org/6851
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agounix: always retry RX_CALL_BUSY
Jeffrey Altman [Thu, 1 Mar 2012 20:49:12 +0000]
unix: always retry RX_CALL_BUSY

RX_CALL_BUSY is an indication that the call channel is busy not
that the server is down or otherwise cannot respond.  Unconditionally
retry the RPC and do not alter state.  We just want to force the use
of a different call channel.

Change-Id: Ic4ef9bac800087f1b287d3da08fcd5eec84374ef
Reviewed-on: http://gerrit.openafs.org/6852
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Hartmut Reuter <reuter@rzg.mpg.de>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Workaround Win7 SMB Reconnect Bug
Jeffrey Altman [Wed, 29 Feb 2012 18:07:47 +0000]
Windows: Workaround Win7 SMB Reconnect Bug

The SMB specification permits the server to save a round trip
in the GSS negotiation by sending an initial security blob.
Unfortunately, doing so trips a bug in Windows 7 and Server 2008 R2
whereby the SMB 1.x redirector drops the blob on the floor after
the first connection to the server and simply attempts to reuse
the previous authentication context.  This bug can be avoided by
the server sending no security blob in the SMB_COM_NEGOTIATE
response.  This forces the client to send an initial GSS init_sec_context
blob under all circumstances which works around the bug in Microsoft's
code.

Do not call smb_NegotiateExtendedSecurity(&secBlob, &secBlobLength);

As a result of the SMB 1.x bug, all attempts to reconnect fail due to
SMB connection resets.  The SMB 1.x redirector will retry indefinitely
but all processes with outstanding requests to \\AFS will block until
the machine is rebooted.

Change-Id: Iedd58fccbf85495d48871935f6e61ede1e1240ff
Reviewed-on: http://gerrit.openafs.org/6846
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoviced: Ignore client loopback alternate addresses
Andrew Deason [Thu, 8 Jul 2010 16:25:19 +0000]
viced: Ignore client loopback alternate addresses

When we receive interface information from a client to determine its
alternate IP addresses, ignore any addresses that look like loopback.

Change-Id: I245ebfc74ad1e8bd2fcd235a00f000d29229668d
Reviewed-on: http://gerrit.openafs.org/2368
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Fix an ExtentResource trace message
Jeffrey Altman [Fri, 24 Feb 2012 17:23:28 +0000]
Windows: Fix an ExtentResource trace message

This instance is logging a SHARED acquisition not an EXCL one.

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

12 years agoWindows: cm_UpdateCell never applies to Freelance mode
Jeffrey Altman [Fri, 24 Feb 2012 17:21:46 +0000]
Windows: cm_UpdateCell never applies to Freelance mode

The Freelance.Local.Cell is updated by the registry monitor
thread and cm_UpdateCell should be a no-op.  Make it so.

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

12 years agoWindows: Redirector opens must set a valid FsContext
Vaibhav Kamra [Thu, 23 Feb 2012 17:58:07 +0000]
Windows: Redirector opens must set a valid FsContext

A successful open must have FileObject->FsContext set to a structure
with a valid/initialized FSRTL_ADVANCED_FCB_HEADER object.

Not having this breaks assumptions in the kernel.

Patchset edited by Jeffrey Altman <jaltman@your-file-system.com>

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

12 years agoWindows: remove AFSOpenRedirector from AFSRedirLib
Jeffrey Altman [Thu, 23 Feb 2012 19:13:08 +0000]
Windows: remove AFSOpenRedirector from AFSRedirLib

The AFSOpenRedirector functionality must exist in the framework,
AFSRedir.sys, not the library, AFSRedirLib.sys.

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