Do not delete an old host entry because the UUID because the UUIDs
of the clients at the old addresses are wrong. Remove the addresses.
Do not allow the same host,addr,port combination to be added into
the hash table multiple times.
====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
Add some more logging
Do not allow 'code' to be re-used for probing the uuid of the old host
primary address because we are relying on the value of 'code' to indicate
whether or not RCallBackConnectBack failed. If it did, we mark the
client as VENUSDOWN, if not we marked it as RESETDONE.
====================
log the old addr, not the new one
When the client changes IP addresses, in order to obtain optimal
performance it must:
(1) force the replacement of all existing rx connections
(2) ping all up and down servers
Suppress warnings from prototype changes.
Trial code for OpenBSD support.
Fix missing piece from UKERNEL.
====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
IPv6 support for Windows requires the use of ws2tcpip.h and associated
restructing of include file order.
Large series of changes to replace the use of afs_uint32 for IP address
with struct sockaddr_storage in Rx. May even work with IPv6, but only
tested with IPv4. Significant change to internal APIs; existing external
APIs kept, new ones added that take struct sockaddr_storage arguments.
This patch fixes:
* race conditions around cm_Lock() calls that were not protected
by cm_SyncOp(LOCK) [asanka@secure-endpoints.com]
* deadlocks caused by obtaining smb_fid_t->mx after cm_scache_t->mx
* removes an extra Release smb_fid_t->mx that could result in
releasing a mutex that is not currently held
* changes the log representation of several return codes and fids to
be consistent with other output
According to src/libacl/prs_fs.h the PRSFS_LOCK privilege is only supposed
to control read-locks. The PRSFS_WRITE and PRSFS_INSERT privileges are
supposed to control write-locks.
A number of crash reports have been filed with Microsoft in afspthread.dll.
The crashes are occuring as the processes are terminating. In order to
attempt to address this problem this patch adds support for a DllMain()
entry point that is used to cleanup Thread Local Storage and the various
RX queues. One theory is that processes are loading and unloading DLLs
that are linked to afspthread.dll leaving the pthread data in a very
inconsistent state after each unload. By cleaning up the static data
during the unload, if afspthread is loading again it will be forced to
initialize the data once again.
This patch disables the lookup of the user's AFSID and instead solves
the problem by tracking which cm_user_t created the file. If the user
is unable to obtain a write lock and is the creator, then we check for
the Insert bit. Otherwise, we deny access.
Vista has a bug in the Netbios ADAPTER_STATUS output in which the
first four bytes of the MAC address with 127.0.0.1. We must check
for that when searching for the Loopback Adapter.
when the cache manager is being frequently restarted (especially during
debugging) the 7001/udp port is often not freed appropriately. This
prevents the cache manager from running. This patch allows the cache
manager to retry with a random port number.
In order to make the client side locking more usable, if the client
is denied a lock by the server and the user only has read privileges,
then we will allocate a local lock. Local locks are not allocated
for write locks.
There is a bug in the file server locking dating back to at least
AFS 3.1 in which the lock privilege is used for read, write and insert
locks. According to the docs, the lock privilege is only supposed to
control read locks. Write locks on new and existing files are supposed
to be controlled by the Write and Insert privileges. This will be fixed
in the file server by another commit.
In order to properly handle the local allocation of locks
the cache manager must enforce the locking rules associated
with PRSFS_WRITE and PRSFS_INSERT and PRSFS_LOCK. Insert
affects "new files" which in AFS are defined as any file that
is owned by the user. Therefore, we must know the afsid of the
user so that it can be compared to owner of the file.
This commit includes a query using PR_SNameToId where the name
is the name specified by the entity setting the token. There
does not currently exist a Protection Service RPC to return the
AFSID of the entity that the rx connection was authenticated as.
Such a function will have to be added in order to make this
functionality secure.
====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
Export functions missing from the UNIX version and the PR_ functions
required by the Windows Cache Manager.
This patch adds code to perform return code error checking for all calls
to the ReadXyz() routines. If the rx connection was lost or if the dump
format being parsed was incorrect there was an opportunity for data to
the processed after an error had already been detected. In the best case
this would have simply resulted in additional work being performed when
it was not necessary but there was also the potential for modifying return
values which would later be used as input to later operations. Better
to simply catch the error when it initially occurs and be done with it.
The ReadString() function had the potential to write into one byte prior
to the start of the input array.
ProcessIndex() would not properly close Fdhandle nor the StreamHandle
if an error was detected.
RestoreVolume() had a problem with the processing of incremental dumps.
Originally AFS supported a concept of incrementals dumps which when
restored would simply add their contents to the existing volume. One
of the distinctions between the incremental and full dumps is that full
dump processing is responsible for removing any vnode entries from the
volume that are not present in the dump file headers. When the incremental
dump support was removed, the RestoreVolume() function was broken. If
a dump file contains multiple Dump Headers, then only the vnode entries
in the first Dump Header would be marked as being restored. Any vnode
entries restored from subsequent Dump Headers would be deleted when the
RestoreVolume() function reached the end. By removing the assignment
of 'tdelo = -1' within the loop that processes the Dump Headers, this
bug is resolved. Although RestoreVolume is only called with the
'incremental' parameter == 0 at the current time, the check for non-zero
values is restored and the "remove unrestored vnodes" functionality is
disabled when a non-zero value is provided.
The ReadVnodes() function did not perform error checking.
The 'active_vcp' variable is no longer being used for any useful
purpose and is the center of a race condition that could lead to
an undercount of references to 'vcp' objects. Remove it.