openafs.git
4 years agoWindows: 1.7.33 (1.7.3300) openafs-devel-1_7_x openafs-devel-1_7_33
Jeffrey Altman [Tue, 27 Oct 2015 03:39:25 +0000]
Windows: 1.7.33 (1.7.3300)

Change-Id: Iadc1b36c204b2054c54799759a3ef99b7babc68e

4 years agoWindows: ChangeLog for 1.7.3300
Jeffrey Altman [Tue, 27 Oct 2015 03:37:11 +0000]
Windows: ChangeLog for 1.7.3300

Change-Id: Ie83d853674c15febb5f272f5d25b7714bb4fea80

4 years agorx: OPENAFS-SA-2015-007 "Tattletale"
Jeffrey Altman [Fri, 9 Oct 2015 02:22:12 +0000]
rx: OPENAFS-SA-2015-007 "Tattletale"

CVE-2015-7762:

The CMU/Transarc/IBM definition of rx_AckDataSize(nAcks) was mistakenly
computed from sizeof(struct rx_ackPacket) and inadvertently added three
octets to the computed ack data size due to C language alignment rules.
When constructing ack packets these three octets are not assigned a
value before writing them to the network.

Beginning with AFS 3.3, IBM extended the ACK packet with the "maxMTU" ack
trailer value which was appended to the packet according to the
rx_AckDataSize() computation.  As a result the three unassigned octets
were unintentionally cemented into the ACK packet format.

In OpenAFS commit 4916d4b4221213bb6950e76dbe464a09d7a51cc3 Nickolai
Zeldovich <kolya@mit.edu> noticed that the size produced by the
rx_AckDataSize(nAcks) macro was dependent upon the compiler and processor
architecture.  The rx_AckDataSize() macro was altered to explicitly
expose the three octets that are included in the computation.
Unfortunately, the failure to initialize the three octets went unnoticed.

The Rx implementation maintains a pool of packet buffers that are reused
during the lifetime of the process.  When an ACK packet is constructed
three octets from a previously received or transmitted packets will be
leaked onto the network.  These octets can include data from a
received packet that was encrypted on the wire and then decrypted.

If the received encrypted packet is a duplicate or if it is outside the
valid window, the decrypted packet will be used immediately to construct
an ACK packet.

CVE-2015-7763:

In OpenAFS commit c7f9307c35c0c89f7ec8ada315c81ebc47517f86 the ACK packet
was further extended in an attempt to detect the path MTU between two
peers.  When the ACK reason is RX_ACK_PING a variable number of octets is
appended to the ACK following the ACK trailers.

The implementation failed to initialize all of the padding region.
A variable amount of data from previous packets can be leaked onto the
network.  The padding region can include data from a received packet
that was encrypted on the wire and then decrypted.

OpenAFS 1.5.75 through 1.5.78 and all 1.6.x releases (including release
candidates) are vulnerable.

Credits:

  Thanks to John Stumpo for identifying both vulnerabilities.

  Thanks to Simon Wilkinson for patch development.

  Thanks to Ben Kaduk for managing the security release cycle.

Change-Id: I29e47610e497c0ea94033450f434da11c367027c

4 years agoWindows: CM_ERROR_INEXACT_MATCH is not a fatal error
Jeffrey Altman [Mon, 12 Oct 2015 13:56:07 +0000]
Windows: CM_ERROR_INEXACT_MATCH is not a fatal error

cm_BPlusDirLookup() and cm_Lookup() can return CM_ERROR_INEXACT_MATCH
which is not a fatal error.  Instead it is an indication that the returned
cm_scache object was not a case sensitive match.  Do not fail the request
and do not leak the cm_scache reference.

Reviewed-on: http://gerrit.openafs.org/12057
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit c372bc92a3f78ac00aa69b2fb7a2050993b4fed8)

Change-Id: I0d533b828d8e42d88163987772672c300277e10d
Reviewed-on: http://gerrit.openafs.org/12067
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: cm_Lookup return ambiguous filename to caller
Jeffrey Altman [Wed, 8 Jul 2015 23:47:26 +0000]
Windows: cm_Lookup return ambiguous filename to caller

cm_Lookup() must not mask a CM_ERROR_AMBIGUOUS_FILENAME error by
converting it to CM_ERROR_BPLUS_NOMATCH.  Doing so results in the
redirector believing that the object does not exist instead of
there being a STATUS_OBJECT_NAME_COLLISION.

Reviewed-on: http://gerrit.openafs.org/11930
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 7e3289891d9032288f32b550ba6376f59f7e9a08)

Change-Id: Icb8e1f77feec94bc5013c7c6ba10df3b1e368e9e
Reviewed-on: http://gerrit.openafs.org/12066
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: fix RDR detection of ambiguous directory entries
Jeffrey Altman [Wed, 8 Jul 2015 20:49:38 +0000]
Windows: fix RDR detection of ambiguous directory entries

The redirector is supposed to reject access to file objects if there
is no case exact match and multiple entries match in a case insensitive
comparison.  The check was only present in the AFSLocateNameEntry()
function and not elsewhere.

Fix the AFSLocateNameEntry() call and addd the missing checks.

Reviewed-on: http://gerrit.openafs.org/11929
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit dffaab441d09a3b955d358292c550116b76a6410)

Change-Id: Ie84a4026bb73bfdf72a3849f9d607d158ea7ac53
Reviewed-on: http://gerrit.openafs.org/12065
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: rdr pioctl operations are opaque
Jeffrey Altman [Mon, 19 Oct 2015 00:32:06 +0000]
Windows: rdr pioctl operations are opaque

Although pioctl operations are delivered through the redirector the
contents of the operations are opaque to the redirector.  Therefore,
the cm_req must not be initialized as a redirector operation.  If they
are the necessary invalidation notifications for symlink and mount point
operations will not be delivered.

Reviewed-on: http://gerrit.openafs.org/12062
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit be603388ef3ec8918dba47ede9dc3e4196492100)

Change-Id: If5bcc7423554a8c8f9ab344547ce0fada62bacac
Reviewed-on: http://gerrit.openafs.org/12064
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: clientServiceProviderKeyExists use subkey
Jeffrey Altman [Thu, 15 Oct 2015 17:22:05 +0000]
Windows: clientServiceProviderKeyExists use subkey

clientServiceProviderKeyExists() must use AFSREG_CLT_SVC_PROVIDER_SUBKEY
since it is a relative path from HKEY_LOCAL_MACHINE.

Reviewed-on: http://gerrit.openafs.org/12059
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 8b530d52a5f482145c71682b407e9c8f258dac70)

Change-Id: Icb0b899fbea0b35a5869872814a3ac1a13bfd119
Reviewed-on: http://gerrit.openafs.org/12061
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: if no known IP addrs, query the addr list
Jeffrey Altman [Fri, 9 Oct 2015 14:20:41 +0000]
Windows: if no known IP addrs, query the addr list

If cm_noIPAddrs == 0, then no servers will be probed.   If
syscfg_GetIFInfo() fails then cm_noIPAddrs is set to 0.  Therefore,
also set cm_LanAdapterChangeDetected to non-zero if syscfg_GetIFInfo()
fails so that the interface info can be queried again prior to a server
probe attempt.

Reviewed-on: http://gerrit.openafs.org/12055
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 4f20b7305efcea9d930f64c348fc58555a736c6b)

Change-Id: Iba740de83e360e2184262d98ae11bf2ae19948fe
Reviewed-on: http://gerrit.openafs.org/12060
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: Only install Service NP if one exists
Jeffrey Altman [Wed, 7 Oct 2015 22:09:50 +0000]
Windows: Only install Service NP if one exists

Do not blindly install a network provider for the service since at
least one end user organization does not install the service's network
provider.

Reviewed-on: http://gerrit.openafs.org/12051
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit c615a712bf9eae3c88252c4a37bd91a0e9db89da)

Change-Id: Ie8a2da0bf6541f7e4e974f887af6735907f0d626
Reviewed-on: http://gerrit.openafs.org/12054
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: InstNetProvider do not leak key handle
Jeffrey Altman [Wed, 7 Oct 2015 22:09:17 +0000]
Windows: InstNetProvider do not leak key handle

If we open a handle, close it.

Reviewed-on: http://gerrit.openafs.org/12050
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit cda7556b854a07220326a617a56edcf55769567a)

Change-Id: I0aa34f5bb52bec97accb0665c98b54bc4b54c7df
Reviewed-on: http://gerrit.openafs.org/12053
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: multi ping do not leak ping count
Jeffrey Altman [Wed, 30 Sep 2015 17:23:36 +0000]
Windows: multi ping do not leak ping count

In cm_CheckServersMulti() if cm_ConnByServer() fails or if cm_noIPAddr is
zero then a cm_server.pingCount will be leaked.  This can result in
servers being marked down and never restored to an up state.

This change adds the necessary pingCount decrement and moves the
assignment of the cm_server_t pointer to serversp[] to make it clear
that the cm_server_t will not be in the array if a failure occurs.
Only objects in the array will have the pingCount decremented after
the RPCs are issued.

Reviewed-on: http://gerrit.openafs.org/12048
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 3957abea2abcd791e97e66be3f3ef211672ce713)

Change-Id: I4904d280b3a36ad3793fc0aa9728731fc9ac258b
Reviewed-on: http://gerrit.openafs.org/12052
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: remove extraneous "pingCount" format param
Jeffrey Altman [Fri, 25 Sep 2015 22:12:24 +0000]
Windows: remove extraneous "pingCount" format param

In 0a0927497c8165aec11e718df01632da75fa4cdc an extra "pingCount"
format parameter was added in cm_DumpServers().  Remove it.

Reviewed-on: http://gerrit.openafs.org/12046
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 518807cae868b6547685a3b5aaf41c6f012665ac)

Change-Id: I67652c729aa431172d28c087183a32e023086a77
Reviewed-on: http://gerrit.openafs.org/12047
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: Replace CM_SERVERFLAG_PINGING with pingCount
Jeffrey Altman [Tue, 16 Jul 2013 13:10:04 +0000]
Windows: Replace CM_SERVERFLAG_PINGING with pingCount

Instead of replying upon a server flag use a pingCount interlocked
variable to track whether active ping operations are being performed
and whether or not to wait sleeping threads.

Reviewed-on: http://gerrit.openafs.org/12022
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 0a0927497c8165aec11e718df01632da75fa4cdc)

Change-Id: I73726fd707b5a7fd3ebbe5b4e2b1e57ec889bbbf
Reviewed-on: http://gerrit.openafs.org/12045
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoUpdate CellServDB to 20150119 snapshot
Stephan Wiesand [Thu, 26 Feb 2015 09:13:50 +0000]
Update CellServDB to 20150119 snapshot

Update all remaining copies of CellServDB in the tree, and make the
Red Hat packaging use it by default too.

Reviewed-on: http://gerrit.openafs.org/11764
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 8cb4a42496f71c3d47ebe30a96ec33478e203c82)

Change-Id: Iff44108fc1335a47d93e97d08f3582bcb2922dfe
Reviewed-on: http://gerrit.openafs.org/12044
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoUpdate CellServDB to 20141117 snapshot
Benjamin Kaduk [Wed, 19 Nov 2014 19:14:07 +0000]
Update CellServDB to 20141117 snapshot

This should be all the locations we keep it in-tree.

Reviewed-on: http://gerrit.openafs.org/11607
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit ce0cad182cddd21ccdebbf05a3e2379c7fcbe8fe)

Change-Id: Icb851e46933a54f6ccd76b5a2e4869986fa536ce
Reviewed-on: http://gerrit.openafs.org/12043
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: cm_GetCell_Gen rework cell prefix matching
Jeffrey Altman [Thu, 14 May 2015 22:29:45 +0000]
Windows: cm_GetCell_Gen rework cell prefix matching

The cm_GetCell_Gen() function permits cells to be searched for by
prefix.  The idea is to permit "cs.cmu.edu" to be abbreviated "cs"
when at CMU.  There are two problems with the current behavior:

1. the existing match rules will accept "cs.c" and "cs.cmu.ed" as
   valid prefix matches.  By not restricting the prefix matching
   to full components the Freelance symlink list can become
   cluttered.

2. the existing match rules will accept the first cell that
   matches even if there are more than one cells that would match.
   this can result in unpredictable behavior since the ordering
   of the cells is not guaranteed.

Instead, fail requests for cell prefixes that are not full component
matches or that would be ambiguous.

Reviewed-on: http://gerrit.openafs.org/11886
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit e314167f11f289248704426fe65fea13a734a937)

Change-Id: I8de6f9972f15cf12ae13b157e26ee181eeec220b
Reviewed-on: http://gerrit.openafs.org/12042
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: Network Provider registration at service start
Jeffrey Altman [Mon, 4 May 2015 17:25:04 +0000]
Windows: Network Provider registration at service start

Windows 8, 8.1 and pre-releases of 10 have a horrible bug as part
of the upgrade process.  All non-Microsoft network provider services
are removed from the NetworkProvider "Order" registry value.  For
OpenAFS this has the side effect of breaking integrated logon and
all drive letter mappings to \\AFS.

During service start add code to:

 1. Add "AFSRedirector" before "LanmanWorkstation" if not present
 2. Add "TransarcAFSDaemon" to the end of the list if not present

If the service is running in SMB mode

 3. Remove "AFSRedirector" if present

Reviewed-on: http://gerrit.openafs.org/12024
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 946d2c1699be7ec8d31251d54d603d321b1f7936)

Change-Id: I39fcc8b604deaf6779167c775b11ac0b4ad0ed26
Reviewed-on: http://gerrit.openafs.org/12041
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: cm_Analyze mark server down for misc rx errors
Jeffrey Altman [Sun, 28 Jun 2015 19:06:34 +0000]
Windows: cm_Analyze mark server down for misc rx errors

In cm_Analyze() replace the token error retry logic for miscellaneous
rx errors and simply mark the server down.  The most common error
that will be seen in this category is RX_INVALID_OPERATION which would
be received if the Rx service id or security class is not recognized
by the peer.  This could happen if an AuriStor server is replaced by
an AFS3 server or if a packet is reflected.

A side effect of this change is that V* and CM_ERROR_* errors will
once again be retried.  This will permit proper failover to occur.

Reviewed-on: http://gerrit.openafs.org/11920
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 6baaa39333fba8afda84ccdb68ba106ce7ae3705)

Change-Id: I0445a0532842f73c01e33171679f0e7225d8d9ca
Reviewed-on: http://gerrit.openafs.org/12040
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: avoid vldb lookup race with network stack
Jeffrey Altman [Sun, 28 Jun 2015 18:56:47 +0000]
Windows: avoid vldb lookup race with network stack

If a VLDB query attempt occurs when there is no current cell db server
list then the VLDB query won't actually occur but the last query time
would be set.  This prevents a query from taking place again on the volume
for 60 seconds.  If the volume in question is the root.cell volume then
the redirector will be forced to return device not ready for the share
(aka \\afs\cell).

Check for a failure of cm_UpdateCell() and only set the last update time
for the volume if there was success or if the VLDB responded with volume
unknown.

Reviewed-on: http://gerrit.openafs.org/11919
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 653647e8617d4fc3e7721832ebdd1f1e9057e9ac)

Change-Id: I082d2c86a93274906d2048f6cd2fe640392ae514
Reviewed-on: http://gerrit.openafs.org/12039
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: cm_ApplyDir calls cm_SyncOpDone too soon
Jeffrey Altman [Sun, 28 Jun 2015 18:00:24 +0000]
Windows: cm_ApplyDir calls cm_SyncOpDone too soon

cm_ApplyDir() failed to maintain the synchronization state while the
GetBuffer() operation proceeded.

Reviewed-on: http://gerrit.openafs.org/11918
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit af957c35e940aa80fda4dd42ebf92f7e7ed18f3b)

Change-Id: I77805657bcabbc6d9bb6352829fb3ca50faf48ea
Reviewed-on: http://gerrit.openafs.org/12038
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: cm_CheckNTDelete missing SyncDone call
Jeffrey Altman [Sun, 28 Jun 2015 17:59:28 +0000]
Windows: cm_CheckNTDelete missing SyncDone call

cm_CheckNTDelete() forgot to call cm_SyncDone() in one of the error
paths.  Fixup the call pattern and do not forget to call cm_SyncDone().

Reviewed-on: http://gerrit.openafs.org/11917
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 1409bf8e007ac1060dfaf8ec09bdc27e95db3ba9)

Change-Id: I03de1593122b1762967043f9f749521a983cb758
Reviewed-on: http://gerrit.openafs.org/12037
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: NPSupport Remote Name verification
Jeffrey Altman [Sun, 28 Jun 2015 17:51:40 +0000]
Windows: NPSupport Remote Name verification

When adding a connection verify that the server name and the share name
are valid.  If not return ERROR_BAD_NETWORK_NAME.

When getting connection information, if a pre-existing connection does
not exist and either the server name or the share name do not verify
return ERROR_BAD_NETWORK_NAME and not ERROR_INVALID_PARAMETER.

Reviewed-on: http://gerrit.openafs.org/11916
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit dfc8db6e3d21208c43f07bc90835cdd37f6f6812)

Change-Id: Ibf6069ab7b7a3d496710bb15304ba9dd5790166a
Reviewed-on: http://gerrit.openafs.org/12036
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: NPGetResourceInformation return redir error
Jeffrey Altman [Sun, 28 Jun 2015 17:43:03 +0000]
Windows: NPGetResourceInformation return redir error

When the redirector ioctl fails in NPGetResourceInformation() return the
actual error to the caller.   Do not hide all errors as WN_BAD_NETNAME.

Reviewed-on: http://gerrit.openafs.org/11915
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 2f072b2fe6e7d5927bd4e597614af7f62240ccb1)

Change-Id: If69250198d31b4ebd4a854c07e87bed96ef99aa2
Reviewed-on: http://gerrit.openafs.org/12035
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: NP RemoteName Length checks
Jeffrey Altman [Sun, 28 Jun 2015 17:39:32 +0000]
Windows: NP RemoteName Length checks

Ensure that RemoteName paths have at least two characters before
attempting to access character [1].

Reviewed-on: http://gerrit.openafs.org/11914
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit d977906371ef9cef4e62d9b86daf673b0d9b599b)

Change-Id: Id5bef3820a67b15a05074aebc379da51f37d9d9f
Reviewed-on: http://gerrit.openafs.org/12034
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: AFSParseName() uniFullName.MaximumLength
Jeffrey Altman [Sun, 28 Jun 2015 17:27:03 +0000]
Windows: AFSParseName() uniFullName.MaximumLength

The uniFullName.MaximumLength in AFSParseName() is not properly
modified and can end up being extended beyond the actual memory
allocation due to a missing decrement.

Reviewed-on: http://gerrit.openafs.org/11913
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 69bc77c538a181315f532ce4ee9e49698e589083)

Change-Id: Iaef47fb7607aa889c08d23b66890c449eeff0b47
Reviewed-on: http://gerrit.openafs.org/12033
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: npdll do not retrieve auth id
Jeffrey Altman [Sun, 28 Jun 2015 17:21:35 +0000]
Windows: npdll do not retrieve auth id

The authentication id for the process will always be obtained in kernel
so no longer try to fetch it in userland.

Reviewed-on: http://gerrit.openafs.org/11911
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 6405e0584a16711d09cf0e0c80b5916a050be7d2)

Change-Id: Iafac2e88c7d46901df975bab3fbad0082c7b81fa
Reviewed-on: http://gerrit.openafs.org/12032
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: Always fetch auth id in kernel
Jeffrey Altman [Sun, 28 Jun 2015 17:18:01 +0000]
Windows: Always fetch auth id in kernel

When processing network provider requests in afsredirlib.sys always
obtain the auth id using the SYSTEM worker thread.   Do not trust
the values provided by userland.

Reviewed-on: http://gerrit.openafs.org/11910
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 967c5dbef3340ee0c870b1fb1f91c24fb6443358)

Change-Id: I8af1a396ac60f2782b5b5d49923c0685b93feac5
Reviewed-on: http://gerrit.openafs.org/12031
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: Move GetAuthenticationId to Worker Thread
Jeffrey Altman [Sun, 28 Jun 2015 17:12:13 +0000]
Windows: Move GetAuthenticationId to Worker Thread

When PsReferenceImpersonationToken(), PsReferencePrimaryToken(), and
SeQueryInformationToken() are called in the kernel from a user process
thread the restrictions on the userland process still apply.  Since we do
not want to be restricted we must obtain the token and query the token
information from a SYSTEM thread.

This change restructures the AFSGetAuthenticationId() process to queue a
synchronous task to the worker thread.

This should address the problem that has been seen during system boot when
the Group Policy Service attempts to query, remove or create a drive
letter mapping.

Reviewed-on: http://gerrit.openafs.org/11909
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit d35164370a8e799ed35f7f23670ddee02dc87f50)

Change-Id: I327f68570631f7bb435c2651f1567b071f3de802
Reviewed-on: http://gerrit.openafs.org/12030
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: AFSRetrieveFileAttributes no parent path
Jeffrey Altman [Tue, 9 Jun 2015 12:55:44 +0000]
Windows: AFSRetrieveFileAttributes no parent path

Modify AFSRetrieveFileAttributes() to handle the case of a ParentPathName
with a Length == 0.   In such a case the introduction of a path separator
would result in the construction of an absolute path when a relative path
is required.

Reviewed-on: http://gerrit.openafs.org/11889
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 4233e4d661e3beb8e4ecb59e4a4c0ed3d9df69b7)

Change-Id: I24685f3d93b4b15b0a2bf1c8d4cb58331eef94e8
Reviewed-on: http://gerrit.openafs.org/12029
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: AFSRetrieveParentPath handle no parent
Jeffrey Altman [Tue, 9 Jun 2015 12:44:43 +0000]
Windows: AFSRetrieveParentPath handle no parent

AFSRetrieveParentPath() when presented with a relative path that has no
parent will walk off the front of the FullFileName buffer.  Add checks to
ensure that Length never becomes less than zero.

Reviewed-on: http://gerrit.openafs.org/11888
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 456b68ccb6d8ad31b735d2c08d0313963ff66c22)

Change-Id: Ifa28a7986455f0aa5b11db10280a9584617cc83d
Reviewed-on: http://gerrit.openafs.org/12028
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: AFSGetConnectionInfo partial match validation
Jeffrey Altman [Wed, 13 May 2015 03:15:50 +0000]
Windows: AFSGetConnectionInfo partial match validation

AFSGetConnectionInfo() is called to respond to NPGetResourceInformation
and NPGetConnectionPerformance WNet API requests.  The former permits
the requestor to provide a path containing components that are not
processed by the file system represented by the called network provider.
As such partial matches are permitted BUT they must consist of full
components.  In other words, \\afs\sh is not a valid partial match for
\\afs\share but \\afs\share is a valid partial match for \\afs\share\dir.

This change adds validation checks to enforce full component comparisons.
It also cleans up some of the associated comparisons and trace output.

Reviewed-on: http://gerrit.openafs.org/11887
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit af7f7da0aad29ff9bf5adad288b512d31954b36e)

Change-Id: Ifcf5e652f0b882f40ada996f0894dcf3235864e8
Reviewed-on: http://gerrit.openafs.org/12027
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: NetrShareGetInfo do not return registry errors
Jeffrey Altman [Mon, 6 Jul 2015 05:39:41 +0000]
Windows: NetrShareGetInfo do not return registry errors

In NetrShareGetInfo() when registry api calls fail do not leak the
error codes to the caller.  Instead, set the error to CM_ERROR_NOSUCHPATH
so that NERR_NetNameNotFound can be returned.

Reviewed-on: http://gerrit.openafs.org/11924
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 99894f0a7070caca7c8e96af3d82cf2bfdfe2bb9)

Change-Id: If18090738c4412a58c9e9d0c5d5cde9117bb4619
Reviewed-on: http://gerrit.openafs.org/12026
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

4 years agoWindows: NetrShareGetInfo no return buffer on error
Jeffrey Altman [Mon, 6 Jul 2015 05:38:01 +0000]
Windows: NetrShareGetInfo no return buffer on error

When processing the NetrShareGetInfo() pipe service rpc do not
allocate memory for the return buffer is the path cannot be found.

Reviewed-on: http://gerrit.openafs.org/11923
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit a640e76d0f84c647abfe4968c842c0cb33f670e5)

Change-Id: If9636d5341e9bf7371ff4107af392c2876563f1e
Reviewed-on: http://gerrit.openafs.org/12025
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: Fake status info on EACCES
Jeffrey Altman [Tue, 10 Feb 2015 07:36:03 +0000]
Windows: Fake status info on EACCES

When enumerating a directory if status info for an entry cannot be
obtained, fake it.  Do not return STATUS_ACCESS_DENIED to the redirector
as that will be interpreted as the directory not being listable.

Reviewed-on: http://gerrit.openafs.org/11736
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 1f2818192fef9bd2707068414e8800dfc56b681e)

Change-Id: I19cecacac9a8dc39bdcf377f2a1831fa1c62330b
Reviewed-on: http://gerrit.openafs.org/11737
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: foo.backup -> foo.backup too many symlinks
Jeffrey Altman [Fri, 23 Jan 2015 00:48:32 +0000]
Windows: foo.backup -> foo.backup too many symlinks

In the case where an explicit mount point to a .backup volume is
resolved from a .backup volume the cache manager refuses to evaluate
the mount point target.  This is meant to address unwanted recursion
in the directory tree searches.

Change the error code to ERROR_TOO_MANY_SYMLINKS and propagate that
error to the AFS redirector.  That will result in the application
receiving STATUS_ACCESS_DENIED instead of
STATUS_REPARSE_POINT_NOT_RESOLVED.

The STATUS_REPARSE_POINT_NOT_RESOLVED error causes cmd.exe and
powershell.exe to terminate recursive directory searches.

Reviewed-on: http://gerrit.openafs.org/11693
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 0008ca80a873975e042993b30cbdc47d8f8f116b)

Change-Id: Idb2046e7e1fa4d327e6af794f7803981f56f3763
Reviewed-on: http://gerrit.openafs.org/11735
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: Fix cm_AppendServerList
Jeffrey Altman [Mon, 6 Oct 2014 23:20:27 +0000]
Windows: Fix cm_AppendServerList

Should use || and not | as the operator when testing for
NULL pointers.

Reviewed-on: http://gerrit.openafs.org/11523
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit ba0b0986ecd6407fc07d5733ca741c1e5fa7bf52)

Change-Id: I02134a4bded6a38a14548b8117230d161093f2c9
Reviewed-on: http://gerrit.openafs.org/11614
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: Version 1.7.3200 (1.7.32) openafs-devel-1_7_32
Jeffrey Altman [Fri, 3 Oct 2014 21:08:05 +0000]
Windows: Version 1.7.3200 (1.7.32)

Change-Id: Ib65503ed43863086ab9ccf6cca8c7f2e41f1db0a
Reviewed-on: http://gerrit.openafs.org/11522
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: ChangeLog 1.7.3200 (1.7.32)
Jeffrey Altman [Fri, 3 Oct 2014 21:06:49 +0000]
Windows: ChangeLog 1.7.3200 (1.7.32)

Change-Id: I36c1e32a70edfa8719b23c230c181ab4feb28982
Reviewed-on: http://gerrit.openafs.org/11521
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: SetDispositionInfo vs Link Count
Jeffrey Altman [Thu, 25 Sep 2014 17:23:16 +0000]
Windows: SetDispositionInfo vs Link Count

When SetDispositionInfo is called to mark a file for pending
delete the link count should not be decrememented.  The count is
decremented only when the file is actually deleted.

Reviewed-on: http://gerrit.openafs.org/11508
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit c90c5e97c6361e06ff06aab02d0768a0bd43354d)

Change-Id: I365d0e0388f6cac23aca64b06e9c6e6a61e97d04
Reviewed-on: http://gerrit.openafs.org/11520
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: FileStandardInfo Link count
Jeffrey Altman [Thu, 25 Sep 2014 17:21:48 +0000]
Windows: FileStandardInfo Link count

Instead of returning 1 in all cases the ObjectInformation.Links
value should be returned to the caller.

Reviewed-on: http://gerrit.openafs.org/11507
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 8da84729c8f1e849882aea7b1268c6ac49936f21)

Change-Id: Ic0714aaa119a9e930f84c606487b173306b1a3a9
Reviewed-on: http://gerrit.openafs.org/11519
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: Check for RO and Open Target in rename
pete scott [Thu, 25 Sep 2014 15:01:27 +0000]
Windows: Check for RO and Open Target in rename

During a file rename operation, check to see if the target file
has the DOS readonly attribute set or has a non-zero reference
count.  If yes, the request must be failed.  The error status
depends upon the state of the pending delete flag.  Either
STATUS_PENDING_DELETE or STATUS_ACCESS_DENIED.

Reviewed-on: http://gerrit.openafs.org/11506
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 243537f7071a108950d5442a4f9f7ab0747ca080)

Change-Id: Idc2b64bf82f35a75ebd6d91eece9f213338f1c58
Reviewed-on: http://gerrit.openafs.org/11518
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: Use the allocation size from the service
pete scott [Wed, 24 Sep 2014 17:49:38 +0000]
Windows: Use the allocation size from the service

The prior patchset modified the service AllocationSize return value
to count the number of 1KB units.  Use the value from the service
without modification.  This corrects an inconsistency in the
FileStandardInformation response.

Reviewed-on: http://gerrit.openafs.org/11491
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit cdfa21ad5e86184f822496c1a9aa769fa98a8bb1)

Change-Id: I86153deb2dcaea3433b9048b8fc0c458c7ddee30
Reviewed-on: http://gerrit.openafs.org/11505
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: report AllocationSize in 1KB increments
Jeffrey Altman [Wed, 24 Sep 2014 22:12:31 +0000]
Windows: report AllocationSize in 1KB increments

Windows expects storage to be allocated in increments of some
block size.  The AFS servers allocate in 1K units so lets report
that to Windows.

Reviewed-on: http://gerrit.openafs.org/11490
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit d9ca3050c697a9d6b623be874ea46aaf2312ad87)

Change-Id: I0e2ad4680b94224e05a598372cdeac3e65fe148e
Reviewed-on: http://gerrit.openafs.org/11504
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: Remove trailing slash on non-root directories
pete scott [Wed, 24 Sep 2014 17:00:36 +0000]
Windows: Remove trailing slash on non-root directories

For the FileNameInformation and FilePhysicalNameInformation queries
a trailing slash is required for the \\server\share\ path but is
not required for directories below the root.

Reviewed-on: http://gerrit.openafs.org/11489
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 3f1465f8da47dc589cf27b1c4168ec0bce0fa5d6)

Change-Id: I4855614464c5f81a8ab98c22fa4ced519b01eb06
Reviewed-on: http://gerrit.openafs.org/11503
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: FilePhysicalNameInfo query AFS prefix
pete scott [Wed, 24 Sep 2014 16:49:06 +0000]
Windows: FilePhysicalNameInfo query AFS prefix

In response to the FilePhysicalNameInformation query the AFS redirector
failed to include the server name in the response.  Since the constructed
name is the same as the FileNameInformation query create a helper function
AFSGetFullFileName() to populate the file name into the provided buffer
and use it to satisfy both queries.

Reviewed-on: http://gerrit.openafs.org/11488
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 70f67371e7fb6262d43874950107864f31f903c9)

Change-Id: I326eccff9d7329657238698f946becdd17f40499
Reviewed-on: http://gerrit.openafs.org/11502
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: FileInfo too small INFO_LENGTH_MISMATCH
pete scott [Wed, 24 Sep 2014 16:06:38 +0000]
Windows: FileInfo too small INFO_LENGTH_MISMATCH

The FileAllInformation query is initially processed by the IO Manager
and when the IO Manager is passed a buffer that is too small to hold
the File Information structure it returns STATUS_INFO_LENGTH_MISMATCH.
Previously the afs redirector returned STATUS_BUFFER_TOO_SMALL in this
case.  Instead follow IO Manager's lead.

Reviewed-on: http://gerrit.openafs.org/11487
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit af72e83832e0849f04e28a355b5a55166cfc0982)

Change-Id: Ic41e8c3844f59dce499d5fedff0d03da031ba6d1
Reviewed-on: http://gerrit.openafs.org/11501
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: !overwrite IOMgr populated FileInfo data
pete scott [Tue, 23 Sep 2014 19:20:45 +0000]
Windows: !overwrite IOMgr populated FileInfo data

I/O Manager will populate the FILE_ACCESS_INFORMATION,
FILE_MODE_INFORMATION, and FILE_ALIGNMENT_INFORMATION portions of
a FILE_ALL_INFORMATION structure prior to forwarding a FileAllInformation
FileInfo query to the file system.  There is no need for the file system
to duplicate the effort.

Reviewed-on: http://gerrit.openafs.org/11478
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 06995ceb4d664c3f14f6626da447cf9891470719)

Change-Id: Icf21e76f564a3df8c3808a36834f04b92dc30c46
Reviewed-on: http://gerrit.openafs.org/11500
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: preserve prior vlserver list on dns failure
Jeffrey Altman [Wed, 10 Sep 2014 14:23:17 +0000]
Windows: preserve prior vlserver list on dns failure

Do not destroy the existing vlserver list if the DNS resolver query
fails.  Continue using the prior vlserver values until a DNS response
is obtained.  This will result in repeated DNS queries and a delay
if there is continued failure, but it will permit VL RPCs to continue
to be issued in the face of a DNS failure or misconfiguration.

Reviewed-on: http://gerrit.openafs.org/11457
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 5ebe2437efa7a64f0b0cc61e2123f9ae766b84cf)

Change-Id: If2194871e97eb213ce2fc5da12aa7c759492564d
Reviewed-on: http://gerrit.openafs.org/11499
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: power management suspend/resume changes
Jeffrey Altman [Thu, 4 Sep 2014 13:16:47 +0000]
Windows: power management suspend/resume changes

1. Call cm_UpdateIFInfo() for all power management events to force
   an update of the valid network interface count.

2. Ensure that regardless of which Suspend and Resume events are
   generated that the service only suspends once and resumes once.

Reviewed-on: http://gerrit.openafs.org/11447
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit f999113d33adadf9b276e2a30c36d2b3a5e74f7d)

Change-Id: Ia2f39d01c053c4120e87ee70df6a9bf2b35bfad9
Reviewed-on: http://gerrit.openafs.org/11498
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: No network, no probe
Jeffrey Altman [Thu, 4 Sep 2014 13:14:07 +0000]
Windows: No network, no probe

Modify cm_PingServer and cm_CheckServersMulti to avoid probing servers
when there are no network interfaces with which to do so.  Just mark
the servers down.

Reviewed-on: http://gerrit.openafs.org/11446
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit ac601314706043f623ace379e3da597a7d5c5e9a)

Change-Id: I41ec7269af762abcdc54ea6c59320f1f6c05e89c
Reviewed-on: http://gerrit.openafs.org/11497
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: introduce cm_MarkServerDown
Jeffrey Altman [Thu, 4 Sep 2014 13:11:25 +0000]
Windows: introduce cm_MarkServerDown

Consolidate the operations necessary to mark a server down into a
new routine cm_MarkServerDown()

Reviewed-on: http://gerrit.openafs.org/11445
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 15c62a9dd014dc56192c8e880fa6855f5377154e)

Change-Id: Ied2fbb0b7d5c80a928bac6d8c648280b82941a00
Reviewed-on: http://gerrit.openafs.org/11496
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: replace lana_OnlyLoopback() calls
Jeffrey Altman [Thu, 4 Sep 2014 13:08:32 +0000]
Windows: replace lana_OnlyLoopback() calls

lana_OnlyLoopback() relies upon Netbios over TCP being enabled but
Netbios over TCP is not officially supported on Vista and above.
Replace all lana_OnlyLoopback() calls with a test on the number of
network interfaces as computed by syscfg_GetIFInfo().   That list
excludes loopback interfaces.

Reviewed-on: http://gerrit.openafs.org/11444
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit ec1dcfbe29961fad23dec087c2d214be785a7816)

Change-Id: I6106fe5a0b080110966018138beff2b7f82f87ae
Reviewed-on: http://gerrit.openafs.org/11495
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: cm_UpdateIFInfo consolidate syscfg_GetIFInfo calls
Jeffrey Altman [Thu, 4 Sep 2014 13:04:42 +0000]
Windows: cm_UpdateIFInfo consolidate syscfg_GetIFInfo calls

Add a new function cm_UpdateIFInfo() that consolidates all of the
syscfg_GetIFInfo() call functionality into a single rountine.  Replace
all of the existing call sites.

It is safe to call cm_UpdateIFInfo() without holding cm_syscfgLock
during afsd initialization because no other threads have been created.

Reviewed-on: http://gerrit.openafs.org/11443
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 95c3db9c7ccb86c7ad384c06094c066107de262c)

Change-Id: I69bb6721902deff326442e422c3375618b4d6ca3
Reviewed-on: http://gerrit.openafs.org/11494
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: Prevent MDL leak on Cc*Mdl* failure
Jeffrey Altman [Thu, 4 Sep 2014 05:11:01 +0000]
Windows: Prevent MDL leak on Cc*Mdl* failure

If CcMdlRead or CcPrepareMdlWrite fail, check the IoStatus.Information
field to see if any MDL pages have been locked.  If the Information
value is greater than zero, complete the Mdl operation to unlock the
pages.

Reviewed-on: http://gerrit.openafs.org/11442
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 092684e2bd31424c958ca3a9e88b7987b4c5555c)

Change-Id: Ib48838e04a9601966c59923deabfc5bf5b77a152
Reviewed-on: http://gerrit.openafs.org/11493
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: Avoid deadlock during pending delete cleanup
Jeffrey Altman [Tue, 8 Apr 2014 07:27:26 +0000]
Windows: Avoid deadlock during pending delete cleanup

Release the Fcb resource and clear the AFS_DIR_ENTRY_PENDING_DELETE
flag prior to the AFSProcessRequest(AFS_REQUEST_TYPE_CLEANUP_PROCESSING)
if a delete is pending during cleanup of the last FCB open handle.

Failure to do so results in an out of order lock acquisition when
the parent object info tree lock is acquired after the AFSProcessRequest()
call to the service completes.

Reviewed-on: http://gerrit.openafs.org/11425
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 58e4e4802d4208604a6aa05362454e6174fe3277)

Change-Id: Ic4565afc6e356f33ddb6290c5399656d35a102d5
Reviewed-on: http://gerrit.openafs.org/11428
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: AFSEvaluateTargetByName NULL ptr assignment
Jeffrey Altman [Tue, 21 Jan 2014 09:19:28 +0000]
Windows: AFSEvaluateTargetByName NULL ptr assignment

If DirEnumEntry is NULL, then on failure of AFSEvaluateTargetByName()
a NULL pointer will be dereferenced prior to function return.

Reviewed-on: http://gerrit.openafs.org/11422
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit d93b89ddb61d44b47f039ae96af6304f2d87b5e2)

Change-Id: Ia0c500b88dd805a3f97c2e195254f9321e986531
Reviewed-on: http://gerrit.openafs.org/11423
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agosys: pioctl_nt translate WinErr to Unix
Jeffrey Altman [Thu, 8 May 2014 20:34:25 +0000]
sys: pioctl_nt translate WinErr to Unix

When reading the result of a pioctl fails with ERROR_NOT_SUPPORTED
this must be translated to an EINVAL errno.

Reviewed-on: http://gerrit.openafs.org/11417
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 1ce48e9e93c686aef24bb066ce76c2fcf08f96b6)

Change-Id: I4ffc910b4b0053bf7895b0b6aa48826ee7a8d2ea
Reviewed-on: http://gerrit.openafs.org/11421
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: registry enum do not request write perm
Jeffrey Altman [Sun, 15 Jun 2014 02:58:52 +0000]
Windows: registry enum do not request write perm

Only Read and Query privileges are required to enumerate the registry
keys, do not request write privileges for an enumeration.

Reviewed-on: http://gerrit.openafs.org/11416
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit fc70e0ddebb8521a69aaeb6e1d249b9ca577db52)

Change-Id: I4c2eba1401a4b3029d40ddc3b18e7ebec73bf943
Reviewed-on: http://gerrit.openafs.org/11420
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: Do not sync callbacks when only need locks
Jeffrey Altman [Sun, 29 Jun 2014 03:03:45 +0000]
Windows: Do not sync callbacks when only need locks

Syncing lock operations with callback fetching is unnecessary because
local lock state is not tracked via callbacks.  More importantly it
risks blocking the cm_LockDaemon thread which needs to be able to
renew locks without obstruction.

Reviewed-on: http://gerrit.openafs.org/11415
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 47ef2e4e514234bb947cdf325634ad0b8ae5d7da)

Change-Id: I15cf2bfa26cbdaaafc616b353e73ab2f48a235f8
Reviewed-on: http://gerrit.openafs.org/11419
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: do not forget cm_SyncOpDone
Jeffrey Altman [Tue, 5 Aug 2014 05:40:22 +0000]
Windows: do not forget cm_SyncOpDone

If cm_SyncOp was called, then cm_SyncOpDone must be called.
By goto out of the loop, the cm_SyncOpDone call was skipped.

Reviewed-on: http://gerrit.openafs.org/11414
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit bcaaf4640d06c761b798c1eb2c82f81f21ec78d8)

Change-Id: Iafa0e3f5b552f7219a1be047d26fc40e238dc5d2
Reviewed-on: http://gerrit.openafs.org/11418
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: set hard dead timeout not conn timeout for probes
Jeffrey Altman [Mon, 18 Aug 2014 19:28:14 +0000]
Windows: set hard dead timeout not conn timeout for probes

For the Rx connections used for probing VL and FILE servers set a
hard dead timeout and not a connection timeout.   A connection timeout
will not terminate the call as long as the lastReceiveTime continues
to be updated by ping packets.  The hard dead timeout will cause the
connection to fail when the 10 second limit expires.

Reviewed-on: http://gerrit.openafs.org/11401
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit bf687348e0269deb0d76475ba9b7219a6e1b40e8)

Change-Id: Iec8fe647c8497d28c29130189c7e44aa832061cb
Reviewed-on: http://gerrit.openafs.org/11413
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: Freelance whole volume rdr invalidate
Jeffrey Altman [Mon, 18 Aug 2014 19:25:50 +0000]
Windows: Freelance whole volume rdr invalidate

When updating the Freelance directory do not notify the redirector
of individual objects to invalidate since that can leaad to race
conditions.  Send whole volume invalidations since that is what is
required in any case.

Reviewed-on: http://gerrit.openafs.org/11400
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 8e23809542556937a0845246960a0f5484b6cf1e)

Change-Id: I7803c44740b5f2283d4bd872f81ac164b03559fc
Reviewed-on: http://gerrit.openafs.org/11412
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: Obtain File Attribs for DFS Link target
pete scott [Wed, 13 Aug 2014 19:28:49 +0000]
Windows: Obtain File Attribs for DFS Link target

The AFSRetrieveFileAttributes() function is used to acquire the
attributes for an AFS symlink.  The result is either returned directly
to the application or used internally to determine the attributes
to be exposed by reparse points.

If the evaluated symlink crosses a DFS Link the redirector cannot
return the request to IO Manager to evaluate the target.  Instead
the redirector must handle the request internally and attempt to
read the attributes of the target object.

Reviewed-on: http://gerrit.openafs.org/11399
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit d5b6a545ed1e9f01c295280495b806981d9877d3)

Change-Id: Ic5a6861dfb09f473ca679a6ce2a69c7a32f42a86
Reviewed-on: http://gerrit.openafs.org/11411
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: LocateName skip DFS Link only last component
pete scott [Mon, 11 Aug 2014 17:18:16 +0000]
Windows: LocateName skip DFS Link only last component

As with Mount Points and Symlinks, when AFSLocateName() is called to
process a CreateFile with Open_Reparse_Point enabled, DFS Link processing
must be disabled only for the last component in the path.  Failure to
do so results in the AFS Redirector succeeding IRP_MJ_CREATE calls that
should be given back to the IO Manager so the path can be evaluated by
another file system.

Reviewed-on: http://gerrit.openafs.org/11398
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit dceb8d6336e574a735b9887cf670c229bc6ee446)

Change-Id: Id64fce7250226a89fbf2c532e602836335e151ca
Reviewed-on: http://gerrit.openafs.org/11410
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: Reparse Policy vs DFSLinks
Jeffrey Altman [Mon, 11 Aug 2014 05:07:27 +0000]
Windows: Reparse Policy vs DFSLinks

When a reparse policy is specified and AFSLocateNameEntry() returns
with STATUS_REPARSE, do not re-evaluate the path with the reparse
policy disabled.  STATUS_REPARSE was returned because the FileObject's
FileName was modified and the IO Manager needs to reparse the request.

Reviewed-on: http://gerrit.openafs.org/11397
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit d36b8ff8db63ee893941d57422e54ca05e4a1564)

Change-Id: I740989489a4e0c268a033c4558c6a71b7b4ee3b9
Reviewed-on: http://gerrit.openafs.org/11409
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: AFSParseRelatedName always use related name
Jeffrey Altman [Mon, 11 Aug 2014 05:41:52 +0000]
Windows: AFSParseRelatedName always use related name

When parsing a RelatedFileObject always refer to the RelatedFileObject
FileName and not the IrpSp->FileObject.

Set the output FileName to pRelatedCcb->FullFileName

Test pRelatedCcb->FullFileName for wild cards

Reviewed-on: http://gerrit.openafs.org/11396
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 68d5e229e9bca83b90cd3e4c8c17719ea9864b00)

Change-Id: I591c025b089ef7421d566f935b9d847e99cb5adc
Reviewed-on: http://gerrit.openafs.org/11408
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: AFSParseName always set FileName output
Jeffrey Altman [Mon, 11 Aug 2014 05:38:54 +0000]
Windows: AFSParseName always set FileName output

The FileName output parameter is used by the caller even when an
error occurs.  In case of error it indicates that path that failed
to parse. Not all of the error paths set FileName.

Start AFSParseName() with FileName referring to
IrpSp->FileObject->FileName.  It can be updated as required later.

Reviewed-on: http://gerrit.openafs.org/11395
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 2f4f1e3f8619b1531838a62031e969cbf64be7dd)

Change-Id: I247a3f33b76230071586f09a335bab80b7fdb10f
Reviewed-on: http://gerrit.openafs.org/11407
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agoWindows: Refactor AFSParseName related name parsing
Jeffrey Altman [Mon, 11 Aug 2014 05:28:12 +0000]
Windows: Refactor AFSParseName related name parsing

AFSParseName() is a very long complex function.  Extract the parsing
of RelatedFileObject name parsing to a new function AFSParseRelatedName().
This removed ~160 lines of source code out of AFSParseName().

This changeset is not intended to introduce any functional changes.

Reviewed-on: http://gerrit.openafs.org/11394
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit d57d87a87a6041b1596532c7fe08795ae9d91b95)

Change-Id: Ife845887bad302937b2bfc4242911332c59292b5
Reviewed-on: http://gerrit.openafs.org/11406
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

5 years agovos: cross-device link error message
Michael Meffie [Tue, 18 Feb 2014 20:23:54 +0000]
vos: cross-device link error message

Print a better diagnostic message for cross-device link errors, which
happens when a clone volume is not in the same partition as the
parent read-write volume.

Reviewed-on: http://gerrit.openafs.org/10850
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit da1597d74a0f56e35a156ec27df231f965934910)

Change-Id: If45badf953b61a8758b96ca87f5ccab0c0b63f19
Reviewed-on: http://gerrit.openafs.org/11405
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: Restrict redir trace buffer to 10240KB
Jeffrey Altman [Wed, 14 May 2014 10:42:40 +0000]
Windows: Restrict redir trace buffer to 10240KB

Define macro AFS_DBG_LOG_MAXLENGTH to 10240 and then use it to
enforce the 10MB trace buffer limit.

Reviewed-on: http://gerrit.openafs.org/11146
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 72bc3848536cc71b8950e5619f5769f60a73f3ab)

Change-Id: If5edd718650328b493ab2f386b3a39b459320190
Reviewed-on: http://gerrit.openafs.org/11147
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: version 1.7.3100 (1.7.31) openafs-devel-1_7_31
Jeffrey Altman [Mon, 5 May 2014 14:06:47 +0000]
Windows: version 1.7.3100 (1.7.31)

Change-Id: Iab29933c064dc38312e998c2c9b3bfcc3a6c4cff
Reviewed-on: http://gerrit.openafs.org/11121
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: Change Log for 1.7.3100 (1.7.31)
Jeffrey Altman [Mon, 5 May 2014 13:59:36 +0000]
Windows: Change Log for 1.7.3100 (1.7.31)

Change-Id: I56c3a8ef901ba1410a652892dd4a034ac6009c54
Reviewed-on: http://gerrit.openafs.org/11120
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: Fix uninitialized variables
Rod Widdowson [Tue, 13 May 2014 01:50:48 +0000]
Windows: Fix uninitialized variables

VS2013 spotted two cases where we do not set up the
Iosb.Status when we catch an exception from Cc.
Fix them.

Reviewed-on: http://gerrit.openafs.org/11140
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit ccb092c37802d300b6ec12d45f10bed42d2a5a59)

Change-Id: I55470a647aa886c7df06c146e247be802aebf7b5
Reviewed-on: http://gerrit.openafs.org/11141
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: cm_Analyze retries vs CM_REQ_NORETRY (2)
Jeffrey Altman [Thu, 8 May 2014 13:06:07 +0000]
Windows: cm_Analyze retries vs CM_REQ_NORETRY (2)

Commit a1b5a1d42280753de13094006dcc130fede978a1 left out a critical
part of the patch.  The check for "retry < 2" when determining whether
retries should be skipped due to CM_REQ_NORETRY.

Reviewed-on: http://gerrit.openafs.org/11131
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit aad509a7e11432bbe8cf0a3a0adaa78d7f9c9da5)

Change-Id: I78e0f10cbd61817d0006a7212712d5fa14165b1a
Reviewed-on: http://gerrit.openafs.org/11135
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: Adjust Last Write time handling for -1
Rod Widdowson [Sun, 4 May 2014 18:33:11 +0000]
Windows: Adjust Last Write time handling for -1

The "what date/time gets changed when and by whom" in Windows is badly
defined, but all filesystems support the semantic that if a date is set
using a specific file object (or the timestamp is set to the magic number
-1)
then other changes provoked by that file object will be ignored.

AFS redirector timestamp handling does not support this behavior.
For the LastWrite timestamp (other timestamps are pretty much advisory and
maintained on a best effort basis) the timestamp would be updated by a
write operation even after -1 is set via the file handle.

This patchset implements the -1 behavior for LastWrite.  It also follows
the standard Windows practice of setting the LastWrite timestamp to be the
time of close of the handle that performed the write, not the time of the
write itself.

Finally, it should be noted that since RX*FS_StoreXXX operations update
the last write time on the server the client must restore the LastWrite
timestamp at handle close if -1 was specified.

Reviewed-on: http://gerrit.openafs.org/11110
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit d9e14a08129cc70a3baca67c2c1adb8aba5945a2)

Change-Id: Ib4aaa747c11507173116229a5c6d3981b37596db
Reviewed-on: http://gerrit.openafs.org/11117
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: RDR AFSSubtituteName invalid UNICODE_STRING
Jeffrey Altman [Tue, 21 Jan 2014 10:44:41 +0000]
Windows: RDR AFSSubtituteName invalid UNICODE_STRING

The 'ComponentName' parameter to AFSSubstituteName() is a UNICODE_STRING
pointer.  Its address should not be passed to AFSDbgTrace when used
in conjunction with a %wZ format.

Reviewed-on: http://gerrit.openafs.org/11090
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit a1f5a9d72f795023813c116329cd40dec3bd43af)

Change-Id: If3d89eacf8e71a094fcf34a8399d148f12b389c2
Reviewed-on: http://gerrit.openafs.org/11116
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agorx: Avoid rxi_Delay on RXS_CheckResponse failure
Andrew Deason [Fri, 21 Feb 2014 21:30:49 +0000]
rx: Avoid rxi_Delay on RXS_CheckResponse failure

Currently we rxi_Delay whenever RXS_CheckResponse fails for any
reason. This can result in disastrous performance degradations if a
client keeps sending "bad" responses, since rxi_Delay'ing here will
delay the Rx listener thread. This means we cannot receive any packets
for about a second, which can easily cause us to drop a lot of
incoming packets.

Instead, send the abort after 1 second by scheduling an event. This
will retain existing behavior from the point of view of the client
(it will get the abort after 1 second), but avoids hanging the Rx
listener thread.

FIXES 131802

(cherry picked from commit 0ec67b0a9a175af14e360da75d1f5429c6c97b24)

Change-Id: Idd893563d64e8335aa8fe908992665f353c14caa
Reviewed-on: http://gerrit.openafs.org/11115
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agorx: Split out rxi_SendConnectionAbortLater
Andrew Deason [Fri, 21 Feb 2014 21:26:35 +0000]
rx: Split out rxi_SendConnectionAbortLater

Take the functionality in rxi_SendConnectionAbort that schedules a
delayed abort, and split it out into a new function,
rxi_SendConnectionAbortLater. This allows callers an easy interface to
send such a delayed abort with their own delay.

This commit should incur no change in behavior; it is just code
reorganization.

(cherry picked from commit 61d80537cae95d125c4b9fed31e2454a281b8b02)

Change-Id: Ia043f9ac111ff50daa0a2df4faff2d71787722ca
Reviewed-on: http://gerrit.openafs.org/11114
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agorx: Clarify error checks for busy channel check
Andrew Deason [Tue, 11 Dec 2012 19:19:02 +0000]
rx: Clarify error checks for busy channel check

Commit a84c6b0ece1fdee4f462c6ce27fa78c2e0d419f4 changed this so we
don't just discard an incoming request if the call already had an
error. But if the call already has an error, rxi_WaitforTQBusy is a
no-op, so checking if the error has "changed" is unnecessary and can
be confusing. Just bypass this whole block if the call already has an
error.

Discussed during the 5 Dec 2012 release-team meeting.

Reviewed-on: http://gerrit.openafs.org/8748
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit cef726558d9ae24a5d3dd00d92550a527f3226df)

Change-Id: Id3dc6c6ba9b82936de1053af1df0001c264e21a0
Reviewed-on: http://gerrit.openafs.org/11113
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: Deny writes/truncation to files w RO attr
Jeffrey Altman [Fri, 4 Apr 2014 20:42:36 +0000]
Windows: Deny writes/truncation to files w RO attr

If the readonly file attribute is set on a file, refuse to process
writes, truncations or overwrites.   The afsd_service will do so
and this can lead to data corruption.

At the same time, writes from the redirector to afsd_service must
not be denied because of the readonly attribute.  That check was
performed during the CreateFile.   Otherwise, a new file can be
created with the readonly attribute and then not be writable.

Reviewed-on: http://gerrit.openafs.org/10985
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit dd8d2aa871fc5841c281d1292c39ffb8edf1ebd1)

Change-Id: I6c941c9a8323a9b699135005ef901d5f56f5288d
Reviewed-on: http://gerrit.openafs.org/11083
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: NP Fail requests if AFSGetAuthenticationId fails
Jeffrey Altman [Wed, 12 Mar 2014 16:49:40 +0000]
Windows: NP Fail requests if AFSGetAuthenticationId fails

If during the processing of a network provider request the Logon
Session AuthenticationId is zero and the AFSGetAuthenticationId()
function is unable to obtain the current thread's AuthenticationId,
then fail the request.

Reviewed-on: http://gerrit.openafs.org/10900
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit e24ed842eba54f62105b08d2b9fb281cc19519f1)

Change-Id: I4a3b80062fc7efc9fa018f1bfe09910629fad14e
Reviewed-on: http://gerrit.openafs.org/11082
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: Fix AFSSetBasicInfo attribute processing
Jeffrey Altman [Tue, 15 Apr 2014 16:19:21 +0000]
Windows: Fix AFSSetBasicInfo attribute processing

The prior behavior of AFSSetBasicInfo() was to let the caller
set whatever it wanted as the new file attributes regardless of
the attributes that are supported by AFS.  In doing so, reparse
point and directory attributes could be cleared, and other values
could be set even though they would be lost as soon as the
DirectoryCB object was garbage collected.

New behavior:

1. return STATUS_INVALID_PARAMETER if reparse point attribute
   would be altered

2. return STATUS_INVALID_PARAMETER if directory attribute would
   be altered.

3. successfully modify readonly attribute

4. ignore all other attribute values

Reviewed-on: http://gerrit.openafs.org/11073
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 70299e6c3def0b84520232c02b9071c9cbf8a851)

Change-Id: Icfc1cc60984c099d712875dafecf8e0065c56644
Reviewed-on: http://gerrit.openafs.org/11081
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: Pin write position prior to defer
Rod Widdowson [Mon, 14 Apr 2014 20:50:36 +0000]
Windows: Pin write position prior to defer

If we extend the file prior to defrring the write *and* the write
is set up FILE_WRITE_TO_END_OF_FILE then we have to convert the
FILE_WRITE_TO_END_OF_FILE to an absolute position since we have
already moved the FCB->Header.FileSize.

Reviewed-on: http://gerrit.openafs.org/11069
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit a4bcc4b1dccf6ab2745be83288c380f5454a2db9)

Change-Id: I80bcb6caf7be7edd760b879cc567602346138d1a
Reviewed-on: http://gerrit.openafs.org/11080
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: AFSCommonWrite add bWriteToEndOfFile var
Jeffrey Altman [Mon, 14 Apr 2014 20:48:32 +0000]
Windows: AFSCommonWrite add bWriteToEndOfFile var

To improve readability add a bWriteToEndOfFile variable which
stores the value of

  liStartingByte.LowPart == FILE_WRITE_TO_END_OF_FILE &&
  liStartingByte.HighPart == -1

Reviewed-on: http://gerrit.openafs.org/11068
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 564f9fd06777882abd29a0da6274150f5b1e7d7f)

Change-Id: Id156545870759b77eccc0ca27e7c9a013611db8d
Reviewed-on: http://gerrit.openafs.org/11079
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: Do not defer Synchronous operations
Rod Widdowson [Mon, 14 Apr 2014 20:45:37 +0000]
Windows: Do not defer Synchronous operations

There is nothing to be gained by posting a synchronous write.
Let it hang out in CcCopyWrite until there is enough memory
unless the write became synchronous after a deferral in which
case it can be deferred again.

Introduce bWait variable which is set to the result of
IoIsSynchronousWrite( Irp).

This change is being introduced after further analysis of the
FastFat example.

Reviewed-on: http://gerrit.openafs.org/11067
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 41b865212b7576c0840bfc0f7c34c900e46f41c8)

Change-Id: Ia10dd1647a5baec39d396dfda1b8dd0c3f161ef3
Reviewed-on: http://gerrit.openafs.org/11078
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: No RO volume test SetFilePosInfo
Jeffrey Altman [Fri, 11 Apr 2014 14:22:45 +0000]
Windows: No RO volume test SetFilePosInfo

Setting the file position information on a file is not a data
changing operation.  Do not perform a readonly volume check.

Reviewed-on: http://gerrit.openafs.org/11066
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit fe706913190acf176292e8c68d0a0adfc015f487)

Change-Id: Ifd615239ad5650c3ae72b20b5fae1fbc0564e069
Reviewed-on: http://gerrit.openafs.org/11077
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: 1.7.30 Release
Jeffrey Altman [Sat, 22 Mar 2014 04:21:42 +0000]
Windows: 1.7.30 Release

Change-Id: I4c415304a2c58fde7c7227e79baef59482304147
Reviewed-on: http://gerrit.openafs.org/10941
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: ChangeLog for 1.7.30
Jeffrey Altman [Sat, 22 Mar 2014 04:20:02 +0000]
Windows: ChangeLog for 1.7.30

Change-Id: I115c85dafedaa64c813e6d414a47e1663b2cea19
Reviewed-on: http://gerrit.openafs.org/10940
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: AFSShareWrite do not assign pFcb too soon
Jeffrey Altman [Mon, 10 Feb 2014 10:13:37 +0000]
Windows: AFSShareWrite do not assign pFcb too soon

In AFSShareWrite the value of pFcb is used to determine whether
or not the pfcb->NPFcb->Resource must be released upon exit.
Therefore, it must not be assigned a value until just before the
resource is acquired.

Reviewed-on: http://gerrit.openafs.org/10828
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 939784c017f065a2f4fce19b48cdde56ac4be83c)

Change-Id: I59d2757db9a63a3569445549b2527b5885348508
Reviewed-on: http://gerrit.openafs.org/10918
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: Platform specific MIDL output
Jeffrey Altman [Sun, 16 Mar 2014 19:41:45 +0000]
Windows: Platform specific MIDL output

Add $(CPU) to the MIDL generated _c.c and _s.c output files
to prevent conflicts.

Reviewed-on: http://gerrit.openafs.org/10907
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 62f922445d3501fff4320cc7c8d93b6cd1a6361e)

Change-Id: I3b4d214f9d7aae6de526450720f461e35b2351e2
Reviewed-on: http://gerrit.openafs.org/10922
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: XP do not mark rdr devices as secure
Jeffrey Altman [Sat, 15 Mar 2014 16:44:09 +0000]
Windows: XP do not mark rdr devices as secure

Commit 9174531dca75f1f2d235ed806f784422792c3ab2 introduced the use
of device characteristics (secure and remote) to the IoCreateDevice()
and IoCreateDeviceSecure() calls for the AFSRedirector device objects.

After this change end users began to report problems on 32-bit Windows
XP SP3 when the initial access to the AFS redirector was performed by
a Limited Access Account.

This patchset conditionalizes the specification of the secure device
characteristic when registering the redirector with MUP on 32-bit
Windows XP.

Reviewed-on: http://gerrit.openafs.org/10906
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit faa5195fcfe1e202665462d273c00b900bf5ac17)

Change-Id: Id26822594d6b8681afa4c44ddf526d5fee5b8adb
Reviewed-on: http://gerrit.openafs.org/10921
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: NP AFSGetConnectionInfo AuthId == 0
Jeffrey Altman [Wed, 12 Mar 2014 16:41:45 +0000]
Windows: NP AFSGetConnectionInfo AuthId == 0

During the processing of a network provider GetConnectionInfo request
if the provided Authentication Logon Session Id is zero, the redirector
should attempt to obtain the Logon Session Id in kernel.  This was
not performed within AFSGetConnectionInfo().

Reviewed-on: http://gerrit.openafs.org/10899
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 85b747fc549a46b2170c99ab4fb86326894210ef)

Change-Id: Idcd0097b118b630dbd01f91ac0b12a6a38c9aa39
Reviewed-on: http://gerrit.openafs.org/10920
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: NP AFSGetConnection retrieve AuthId sooner
Jeffrey Altman [Wed, 12 Mar 2014 16:39:59 +0000]
Windows: NP AFSGetConnection retrieve AuthId sooner

When processing a network provider GetConnection requestion obtain
the Authentication Logon Session Id earlier in the function so that
it can be logged as part of subsequent trace messages.

Reviewed-on: http://gerrit.openafs.org/10898
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 8a6732f9f6d876fc20f5612a4b325533d157d091)

Change-Id: Ib8e24bcbfc3e70be51c6257d1ae7a510844174ab
Reviewed-on: http://gerrit.openafs.org/10919
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: cm_ForceNewConnections serverp == NULL
Jeffrey Altman [Mon, 17 Feb 2014 06:12:37 +0000]
Windows: cm_ForceNewConnections serverp == NULL

If serverp == NULL, return immediately.  Do not dereference a NULL
pointer.

Reviewed-on: http://gerrit.openafs.org/10845
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 8803c35994eb48605e26831296bd1c57f0adf50a)

Change-Id: I0700b5e55d07f316b79308fae13ca4aa1aba6801
Reviewed-on: http://gerrit.openafs.org/10856
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: cm_GetCell_gen Fixup cm_server cellp on race
Jeffrey Altman [Thu, 23 Jan 2014 03:17:56 +0000]
Windows: cm_GetCell_gen Fixup cm_server cellp on race

If a race occurs during the instantiation of a new cm_cell_t object,
the created servers will point at the wrong cm_cell_t object after
the race is detected.  Before cm_GetCell_gen completes the cm_server_t
objects must be fixed to point to the correct cm_cell_t.

Reviewed-on: http://gerrit.openafs.org/10777
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 3e4af71581fa8d174a0127bb225e7fba2450aaae)

Change-Id: I78a0eef187b8b1b0a5ef0ab396e728214bf87c50
Reviewed-on: http://gerrit.openafs.org/10827
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: Support arbitrary callback ports
Jeffrey Altman [Fri, 31 Jan 2014 05:56:49 +0000]
Windows: Support arbitrary callback ports

Reconfigure the advanced firewall to support callback ports
other than port 7001.

This changes the semantics of the afsicf api.  AFS_PORTSET_SERVER is now
zero.  Any other value is treated as a callback port.

Reviewed-on: http://gerrit.openafs.org/10776
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 7760acc4570a306390f0b7e5acf4b21e8a8cc90d)

Change-Id: I86cf09a6a9136f0acf53a2449e47898c5ff435d4
Reviewed-on: http://gerrit.openafs.org/10826
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: cm_AddCellProc always call cm_NewServer
Jeffrey Altman [Fri, 31 Jan 2014 05:49:44 +0000]
Windows: cm_AddCellProc always call cm_NewServer

The current implementation of cm_NewServer handles races and
collisions.  There is no need to perform a cm_FindServer() check
first.  Just call cm_NewServer() for all server entries.

Move the logging of server creation and cell assignment to
cm_NewServer().

Reviewed-on: http://gerrit.openafs.org/10775
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit dd9e59805b37a93f0f64c67cfa3ba4d80f1f358c)

Change-Id: Icc1ad30026100fd33da488282f03b999fc259183
Reviewed-on: http://gerrit.openafs.org/10825
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: Add caching to cm_GetAddrsU
Jeffrey Altman [Mon, 27 Jan 2014 05:33:18 +0000]
Windows: Add caching to cm_GetAddrsU

Cache the results of VL_GetAddrsU queries and reuse the results
for subsequent calls when possible.

Reviewed-on: http://gerrit.openafs.org/10764
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 3b5c636480cda73938a532ffd079ba040907f78f)

Change-Id: Id81e3dae43ca514098c9bf677c79dc3e88e6a224
Reviewed-on: http://gerrit.openafs.org/10780
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

6 years agoWindows: cm_GetAddrsU wrapper for VL_GetAddrsU
Jeffrey Altman [Mon, 27 Jan 2014 05:30:20 +0000]
Windows: cm_GetAddrsU wrapper for VL_GetAddrsU

cm_GetAddrsU() is a wrapper for the VL_GetAddrsU() RPC.  The initial
version is a bare bones replacement for the VL_GetAddrsU() call from
cm_UpdateVolumeLocation().  Future changes will add caching.

Reviewed-on: http://gerrit.openafs.org/10763
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 74982e6ae1919f81184d221b56aba7f153d188ed)

Change-Id: I825e4abb42ebcce2d1ab149b5e633977817713c1
Reviewed-on: http://gerrit.openafs.org/10779
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>