openafs.git
11 years agolibafs: use afs_ResetVCache in flush volume data
Michael Meffie [Thu, 7 Jun 2012 16:58:54 +0000]
libafs: use afs_ResetVCache in flush volume data

Remove some code duplication by using afs_ResetVCache
in the flush volume data pioctl. Adds a flag to
ResetVCache to avoid unneeded calls to purge dnlc
when reseting all the vcaches in a volume.

Adds freeing of vcache link data in the flush volume
data pioctl.

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

11 years agoutil: eliminate dead store in hostutil_GetHostByName
Garrett Wollman [Mon, 16 Jul 2012 01:53:17 +0000]
util: eliminate dead store in hostutil_GetHostByName

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

11 years agorx: dead initialization in rxi_RestoreDataBufs
Garrett Wollman [Sun, 15 Jul 2012 19:41:25 +0000]
rx: dead initialization in rxi_RestoreDataBufs

Don't initialize iov only to overwrite it immediately below.

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

11 years agovol: dead initialization in VWalkVolumeHeaders()
Garrett Wollman [Sun, 15 Jul 2012 19:44:42 +0000]
vol: dead initialization in VWalkVolumeHeaders()

Actually, all of the initializers in this small function are dead.

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

11 years agorx: eliminate dead variable sdl in rx_getAllAddr_internal()
Garrett Wollman [Mon, 16 Jul 2012 02:00:04 +0000]
rx: eliminate dead variable sdl in rx_getAllAddr_internal()

Near as I can tell, sdl is only assigned once, and is never read.

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

11 years agoutil: LogCommandLine: argc is an int, so assert that it's positive
Garrett Wollman [Sun, 15 Jul 2012 18:09:11 +0000]
util: LogCommandLine: argc is an int, so assert that it's positive

In practice, argc should never be negative, but by convention it's
a signed int, so change the assertion to require it to be positive
rather than merely nonzero to get some help to the static analyzer.

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

11 years agobudb: don't malloc(0) on error condition in GetText()
Garrett Wollman [Sun, 15 Jul 2012 18:18:12 +0000]
budb: don't malloc(0) on error condition in GetText()

malloc(0) is non-portable (may return a pointer to no space, or it
may return NULL.  Just set the result to NULL without bothering to
call malloc(), as is done earlier in this function.

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

11 years agoutil: in util_newTable, don't leak Table on error
Garrett Wollman [Sun, 15 Jul 2012 18:54:47 +0000]
util: in util_newTable, don't leak Table on error

It is unlikely that this memory leak actually matters as the caller
will normally just exit.

This whole source file could stand to be reformatted.

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

11 years agorx: don't leak a connection hash table in unlikely error condition
Garrett Wollman [Sun, 15 Jul 2012 19:01:29 +0000]
rx: don't leak a connection hash table in unlikely error condition

If getsockname() returns an error (which shouldn't be possible),
rx_InitHost would leak a connection hash table (which probably
doesn't matter because the caller will just exit anyway).  Make
the analyzer happy by freeing the memory anyway.

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

11 years agovolser: don't derefernce null pointer in copyVnodes()
Garrett Wollman [Sun, 15 Jul 2012 19:13:55 +0000]
volser: don't derefernce null pointer in copyVnodes()

split_volume() can call copyVnodes() with parVnode == NULL, so guard
the one reference to parVnode (a memcpy()) to avoid a fault.

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

11 years agoviced: RXAFS_GetVolumeStatus remove access check
Jeffrey Altman [Tue, 3 Jul 2012 19:58:01 +0000]
viced: RXAFS_GetVolumeStatus remove access check

The AFS file server had always performed a PRSFS_READ permission
check on the volume's root directory (1.1) vnode before responding
succesfully to the client.  A successful response contains the
following volume state information:

  Message of the day (if any)
  Offline message (if any)
  Online flag
  InService flag
  Blessed flag
  NeedsSalvage flag
  Type
  MinQuota
  MaxQuota
  BlocksInUse
  PartBlocksAvail
  PartMaxBlocks

All of this information is publicly available to anonymous users
via other services so it is odd that it is hidden from anonymous
cache managers.

As sites begin to tighten the ACLs on volumes due to privacy
and security concerns this READ permission check is begin to
cause problems for Windows clients that rely upon the quota and
block counts to determine whether or not it is likely to be safe
to perform an extending write.  In many environments volumes are
being configured such that the root directory is 'l' for all and
only the subdirectories provide for 'ridw'.  Under these situations
the user is able to read/write the data but cannot determine how
much free space is available.  Since all of the data returned by
RXAFS_GetVolumeStatus is publicly available, the patchset removes
the access check entirely.

Change-Id: Ic8a8d755b0ed61789a49243827083ae97c137560
Reviewed-on: http://gerrit.openafs.org/7705
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agobozo: small-notifier: don't ignore return from system()
Garrett Wollman [Mon, 16 Jul 2012 02:34:42 +0000]
bozo: small-notifier: don't ignore return from system()

Nobody can possibly be using this program, but even so, don't ignore
return values.  Unfortunately, the return value of system() is a bit
complicated to interpret.

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

11 years agobudb: remove dead assignment in verifyFreeLists()
Garrett Wollman [Mon, 16 Jul 2012 02:42:10 +0000]
budb: remove dead assignment in verifyFreeLists()

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

11 years agoafs_server: spell IFF_POINTOPOINT consistently
Garrett Wollman [Mon, 16 Jul 2012 01:35:21 +0000]
afs_server: spell IFF_POINTOPOINT consistently

The interface flag has one fewer T than normal English usage would
suggest, so this code was never compiled on systems that don't have
the normally-spelled version as an alias.

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

11 years agovolser: dead store in UV_MoveVolume2
Garrett Wollman [Mon, 16 Jul 2012 01:47:35 +0000]
volser: dead store in UV_MoveVolume2

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

11 years agoFBSD: don't reference libc_r; no release OpenAFS works on still uses it
Garrett Wollman [Sun, 15 Jul 2012 15:56:15 +0000]
FBSD: don't reference libc_r; no release OpenAFS works on still uses it

libc_r is the old user-mode threading library.  Modern versions of
FreeBSD don't include it, and the conditionals here that (nearly
always) override it with the correct library, libpthread, are true
on every version of FreeBSD for which OpenAFS might plausibly be
compiled.  So just use the correct library all the time.

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

11 years agoWindows: add cm_ServerListSize()
Jeffrey Altman [Fri, 6 Jul 2012 20:04:28 +0000]
Windows: add cm_ServerListSize()

cm_ServerListSize returns the length of a cm_serverRef_t list.

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

11 years agoWindows: add cm_IsVolumeReplicated()
Jeffrey Altman [Fri, 6 Jul 2012 20:02:38 +0000]
Windows: add cm_IsVolumeReplicated()

Given a file id indicates whether the volume it is located on
is replicated or not.

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

11 years agoWindows: Redesign of server preferences
Jeffrey Altman [Mon, 9 Jul 2012 13:34:22 +0000]
Windows: Redesign of server preferences

Server rankings should be composed from three values:

 1. administrative preferences

 2. network address locality

 3. peer performance (rtt and congestion window)

This ensures that local subnet servers are always
preferred.

Add a new rank for down servers so they are always
sorted las in cm_serverRef lists.

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

11 years agovlserver: fix logging of ip addresses
Michael Meffie [Wed, 4 Jul 2012 21:54:02 +0000]
vlserver: fix logging of ip addresses

Remove the spurious dates surrounding IP addresess in the VLLog.
Instead of multiple calls to the logging function for a given log
line, format a string containing the addresses and call the log
function once.

Changes the log output from,

  ...  The following fileserver is being registered in the VLDB:
  ...         [Tue Jul  4 14:11:43 2012 192.168.10.128Tue Jul  4 14:11:43 2012 ]
  ...  It will create a new entry in the VLDB.

to,

  ...  The following fileserver is being registered in the VLDB:
  ...         [192.168.10.128]
  ...  It will create a new entry in the VLDB.

Change-Id: I6c4ac2dcc60fe4c5ced79017b91049f0c327e935
Reviewed-on: http://gerrit.openafs.org/7750
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: cm_SyncOp waiting logic
Jeffrey Altman [Tue, 10 Jul 2012 04:13:04 +0000]
Windows: cm_SyncOp waiting logic

Use interlocked increment and decrement to track the waiters
and use the wait queue itself to determine if there are waiters
instead of the CM_SCACHEFLAG_WAITING flag.

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

11 years agoWindows: remove unused CM_SCACHEFLAGs
Jeffrey Altman [Tue, 10 Jul 2012 04:09:14 +0000]
Windows: remove unused CM_SCACHEFLAGs

CM_SCACHEFLAG_CALLBACK and CM_SCACHEFLAG_STATD were cleared at
various points and tested at various points but never set.
Remove them.

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

11 years agoWindows: not all short rx_Read[v] reads are fatal
Jeffrey Altman [Sat, 7 Jul 2012 18:11:23 +0000]
Windows: not all short rx_Read[v] reads are fatal

When performing a RXAFS_FetchData[64] RPC, a short read from
rx_Read[v] is not a reason to stop processing the call unless
it is the first read and the file server FetchData offset bug
has been detected.  If not, only stop processing if the
rx_Read[v] return value is <= 0.

Change-Id: I5b10ce7903686fa3d9c251e6c92c4bcec376ed40
Reviewed-on: http://gerrit.openafs.org/7749
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: record mount point string data version
Jeffrey Altman [Mon, 9 Jul 2012 04:49:13 +0000]
Windows: record mount point string data version

The Windows cache manager stores the mount point or symlink target
string in the cm_scache_t object.  If the string is the empty string
then the target needs to be resolved.  Otherwise it is considered
up to date.  With this approach, care must be taken to ensure that
the string is erased whenever the data version changes.

This patchset records the data version of the mount point target
string in the cm_scache_t object.  Being up to date is determined
by comparing the current data version of the object to the mount
point string version.  A match and the string is up to date.

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

11 years agoWindows: initialize afsStatus and callback structs
Jeffrey Altman [Sun, 8 Jul 2012 06:00:17 +0000]
Windows: initialize afsStatus and callback structs

In cm_GetBuffer, cm_GetData, cm_VerifyStoreData

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

11 years agoWindows: cm_MergeStatus unknown interface numbers
Jeffrey Altman [Fri, 6 Jul 2012 19:07:13 +0000]
Windows: cm_MergeStatus unknown interface numbers

Ignore status information if the interface number is unknown.
Currently only version 1 is recognized.

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

11 years agovos: Avoid creating volume with the same RO/BK ids
Andrew Deason [Wed, 20 Jun 2012 21:28:51 +0000]
vos: Avoid creating volume with the same RO/BK ids

If we specified an RW id of 5, an RO id of 6, and no BK id, this code
would assign the BK id to RW+1, or 6. This gives the RO and BK volumes
the same volume id, which is a mistake. Choose a different id instead.

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

11 years agoviced: fsprobe needs MT_LIBS
Andrew Deason [Fri, 29 Jun 2012 04:16:33 +0000]
viced: fsprobe needs MT_LIBS

fsprobe is built pthreaded, so it needs MT_LIBS; otherwise HP-UX and
possibly other platforms complain about missing pthread symbols. Just
copy the libs from the fileserver link line.

Change-Id: I78e69c9ea45e983e997b1bc1bb59f97ee07c3e2f
Reviewed-on: http://gerrit.openafs.org/7609
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoptserver: unused by set variable 'eid_s'
Jeffrey Altman [Fri, 6 Jul 2012 04:29:59 +0000]
ptserver: unused by set variable 'eid_s'

Third declaration of 'eid_s' in WalkNextChain() set but unused.
[-Werror=unused-but-set-variable]

Change-Id: I7a4e2ea3dea3d58379e31d3c6cb4b3169a882bce
Reviewed-on: http://gerrit.openafs.org/7737
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: interlocked ops for osi lock flags
Jeffrey Altman [Thu, 5 Jul 2012 20:55:03 +0000]
Windows: interlocked ops for osi lock flags

Use interlocked operations to set and clear the flags in the osi
mutex and readwrite lock objects.

Change-Id: I92089650d3474efb76c45293b5209b3e2350d983
Reviewed-on: http://gerrit.openafs.org/7720
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>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: use spin counts for osi base locks
Jeffrey Altman [Thu, 5 Jul 2012 20:52:51 +0000]
Windows: use spin counts for osi base locks

On multiprocessor systems, spin counts are faster than entering
a processor wait state when there is critical section contention.
Microsoft recommends a count of 4000.  This feature is only available
on XP and above which is fine since OpenAFS master and 1.7 no longer
support Windows 2000.

Change-Id: I1b40d00b2a91e60e1676a53e1c38eb5f9bfadc69
Reviewed-on: http://gerrit.openafs.org/7719
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>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: X86 DEBUG Interlocked Or and And
Jeffrey Altman [Fri, 6 Jul 2012 01:13:21 +0000]
Windows: X86 DEBUG Interlocked Or and And

X86 DEBUG builds do not have a native InterlockedOr or
InterlockedAnd.  Therefore, we must provide our own.

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

11 years agovldb_check: remove unused functions
Michael Meffie [Thu, 28 Jun 2012 21:24:49 +0000]
vldb_check: remove unused functions

Remove the readSIT function, which has been unused
since the IBM days.  Remove the commented out and
unimplemented writeUbikHeader stub.

Change-Id: Ic2cebba6ddf803a537a6b1e5f24db51560209436
Reviewed-on: http://gerrit.openafs.org/7613
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agodoc: Add fs bypassthreshold man page
Andrew Deason [Thu, 28 Jun 2012 23:56:47 +0000]
doc: Add fs bypassthreshold man page

FIXES 130050

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

11 years agoWindows: remove used 'deltas' from cm_CheckServersMulti()
Jeffrey Altman [Thu, 5 Jul 2012 22:25:09 +0000]
Windows: remove used 'deltas' from cm_CheckServersMulti()

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

11 years agoWindows: Apply cm_GetVolServerList() to cm_ConnFromVolume()
Jeffrey Altman [Thu, 5 Jul 2012 22:22:24 +0000]
Windows: Apply cm_GetVolServerList() to cm_ConnFromVolume()

Use cm_GetVolServerList() in cm_ConnFromVolume() to ensure an
error is returned instead of dereferencing a NULL pointer if
the serverRef list for the requested volume cannot be obtained.

Change-Id: I265b7e8b64fcf6b4444c7d504e5109d67fa48089
Reviewed-on: http://gerrit.openafs.org/7724
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>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Apply cm_GetVolServerList() to cm_Analyze()
Jeffrey Altman [Thu, 5 Jul 2012 22:21:51 +0000]
Windows: Apply cm_GetVolServerList() to cm_Analyze()

Using cm_GetVolServerList() it is possible to simplify
the logic in cm_Analyze().  It is no longer necessary
for cm_Analyze() to call cm_GetServerList() which must
obtain its own reference the the cm_volume_t object via
a fileId lookup.  This reduces lock contention and makes
the code a bit more readable.

Change-Id: I3a39458676af06fd473489d639bf9d2fe80c0b9d
Reviewed-on: http://gerrit.openafs.org/7723
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>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Add cm_GetVolServerList
Jeffrey Altman [Thu, 5 Jul 2012 22:16:09 +0000]
Windows: Add cm_GetVolServerList

cm_GetVolServerList() is a wrapper for cm_GetVolServers() that
returns CM_ERROR_NOSUCHVOLUME if the server list cannot be
obtained for the requested volume.

Change-Id: I1ab21b3f6ca71507cc382738cb50f87e92ee2ce2
Reviewed-on: http://gerrit.openafs.org/7722
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>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Modify cm_GetVolServers and cm_GetServerList
Jeffrey Altman [Thu, 5 Jul 2012 22:06:13 +0000]
Windows: Modify cm_GetVolServers and cm_GetServerList

Move the determination of the 'replicated' state into
cm_GetVolServers() so that cm_GetServerList() and
cm_ConnFromVolume() can be implemented without duplicating
the resolution of the cm_vol_state_t object.

Change-Id: I355cb2cdf7e327742df7936171ad3dc604f135df
Reviewed-on: http://gerrit.openafs.org/7721
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>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: cm_ConnByServer hold userp->mx only while necessary
Jeffrey Altman [Thu, 5 Jul 2012 18:54:04 +0000]
Windows: cm_ConnByServer hold userp->mx only while necessary

The cm_userp_t does not need to be locked while the cm_conn_t
force new connection processing is taking place.

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

11 years agoWindows: cm_ConnByServer add conn to list after init
Jeffrey Altman [Thu, 5 Jul 2012 18:33:50 +0000]
Windows: cm_ConnByServer add conn to list after init

Do not add a newly created cm_conn_t to the cm_server_t connsp
list until after the object is fully initialized.

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

11 years agoWindows: cm_HaveCallback optimize .readonly
Jeffrey Altman [Thu, 5 Jul 2012 15:03:35 +0000]
Windows: cm_HaveCallback optimize .readonly

If the cm_scache_t has a registered callback, there is no reason
to obtain a volume reference for a .readonly.  Just use the
callback.

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

11 years agoWindows: RDR RXAFS_GetVolumeStatus vs 1.1 'l' only
Jeffrey Altman [Tue, 3 Jul 2012 19:38:33 +0000]
Windows: RDR RXAFS_GetVolumeStatus vs 1.1 'l' only

The Windows redirector relies upon the ability to obtain volume
status information to decide whether a file system volume object
can be created and whether or not an extending write can be
permitted.  As of this writing, the file server always performs
a PRFS_READ access check on the volume's root directory (1.1)
vnode as a condition for releasing the volume state information
which includes:

  Message of the day (if any)
  Offline message (if any)
  Online flag
  InService flag
  Blessed flag
  NeedsSalvage flag
  Type
  MinQuota
  MaxQuota
  BlocksInUse
  PartBlocksAvail
  PartMaxBlocks

All of this information is publicly available to anonymous users
via "vos examine" so it is odd that it is hidden from anonymous
cache managers.  When RXAFS_GetVolumeStatus fails, the AFS redirector
was failing to create a file system object for the AFS volume.  That
in turn prevented the volume from being accessed even if the user
had 'l' in the root directory and full access everywhere else.

This patchset will make up fake data for the AFS volume if the
RPC fails.  However, doing so does have consequences.  The client
will be unable to make an accurate determination regarding free space
on the file server.  As a result, an extending write may be permitted
which writes data into the system page cache which in turn cannot
be written to the file server.   Such data will be lost and unrecoverable.

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

11 years agoWindows: HaveCallback vs readonlyVolumeVersioning
Jeffrey Altman [Tue, 3 Jul 2012 16:51:27 +0000]
Windows: HaveCallback vs readonlyVolumeVersioning

If the cm_scache_t volumeCreationDate is 0, the field is not
valid for comparison.  Add a check during the have callback test.

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

11 years agoWindows: HaveCallback vs OfflineRO Is Valid
Jeffrey Altman [Tue, 3 Jul 2012 16:49:53 +0000]
Windows: HaveCallback vs OfflineRO Is Valid

commit f716962ab41847af4450d0a361f5de9195b32ed0
inadvertently broke the offline .readonly is valid functionality
when readonly volume versioning is disabled.  Restore it.

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

11 years agoWindows: cm_DiscardSCache volumeCreationDate
Jeffrey Altman [Tue, 3 Jul 2012 16:42:52 +0000]
Windows: cm_DiscardSCache volumeCreationDate

commit f716962ab41847af4450d0a361f5de9195b32ed0
clears the cm_scache_t volumeCreationDate field.
It shouldn't because the volumeCreationDate is not a property of
the callback.  It is a property of the status information which
does not change simply because the callback expires.

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

11 years agoWindows: add missing items to 'clean' rules
Jeffrey Altman [Fri, 29 Jun 2012 04:35:49 +0000]
Windows: add missing items to 'clean' rules

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

11 years agoWindows: afslogon expand short domain names
Jeffrey Altman [Tue, 26 Jun 2012 03:06:30 +0000]
Windows: afslogon expand short domain names

Depending on how the user specifies the domain name during login,
NPLogonNotify may be given a short or a full domain or kerberos
realm name.  If the name is the short name, attempt to expand it
automatically if there is no 'realm' configured for the short
domain name.

This patchset relies upon data in the local registry instead of
using an API such as NameTranslate in order to avoid network
queries to the domain controller that might not be reachable.

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

11 years agoWindows: afscreds import lsa before renew expiring
Jeffrey Altman [Mon, 25 Jun 2012 05:38:41 +0000]
Windows: afscreds import lsa before renew expiring

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

11 years agoWindows: Remove HELP from afscreds
Jeffrey Altman [Mon, 25 Jun 2012 05:33:02 +0000]
Windows: Remove HELP from afscreds

The old .hlp format is no longer supported and the text of the
help files is long out of date.  Remove the HELP buttons from
the dialogs and all references to WM_HELP message processing
from the application.

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

11 years agoWindows: afslogon major refactoring NPLogonNotify()
Jeffrey Altman [Tue, 19 Jun 2012 02:03:21 +0000]
Windows: afslogon major refactoring NPLogonNotify()

This is a major refactoring of NPLogonNotify() that is meant
to reduce redundancy and add functionality.  Key highlights
include:

 * New Domain\user hierarchy that permits configuration
   settings to be applied on a per user basis instead of a
   domain basis.  As part of the extension the username itself
   can be mapped.

 * Attempt to import the MSLSA credentials prior to performing
   KFW_AFS_get_cred().

 * Do not perform redundant KFW_AFS_get_cred() calls.

 * Add a flag to indicate if the authentication name is the
   LSA principal name.

 * Add more debugging messages.

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

11 years agoWindows: afslogon cast away warnings
Jeffrey Altman [Tue, 19 Jun 2012 01:58:26 +0000]
Windows: afslogon cast away warnings

cast away size_t to int warnings in 64-bit builds.

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

11 years agoRemove empty Makefile continuation lines
Andrew Deason [Fri, 29 Jun 2012 17:36:36 +0000]
Remove empty Makefile continuation lines

HP-UX make gets confused by constructs like:

   FOO = bar \

   BAZ = quux

Where a line continuation is followed by an empty line. So, get rid of
all of these in the tree. Not all of them matter, but removing all of
them makes it easier to find these, and catch them in the future.

Change-Id: I7d5ef000b5b55de4b71c183589fbfe36e3880ba1
Reviewed-on: http://gerrit.openafs.org/7611
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: cm_UpdateVolumeLocation misplaced lock
Jeffrey Altman [Mon, 2 Jul 2012 02:19:08 +0000]
Windows: cm_UpdateVolumeLocation misplaced lock

The volume->mx was obtained in the wrong place which resulted
in the potential of a panic caused by obtaining the mutex when
it was already held.

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

11 years agoWindows: WiX backup additional registry keys
Jeffrey Altman [Fri, 29 Jun 2012 02:29:19 +0000]
Windows: WiX backup additional registry keys

Move backup storage to HKLM\Software\OpenAFS\BackupSettings

Backup HKLM\SYSTEM\...\Services\AFSRedirector

Add ..\TransarcAFSDaemon\NetworkProvider "Debug" value

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

11 years agoWindows: ensure TreeLock obtain and release same pointer
Jeffrey Altman [Wed, 27 Jun 2012 05:00:20 +0000]
Windows: ensure TreeLock obtain and release same pointer

The indirection ObjectInformation->ParentObjectInformation does
not appear to be stable.  When acquiring and releasing a parent
TreeLock, use a local variable to store the ParentObjectInformation
pointer and use that to access the TreeLock.  This will ensure that
the resource obtained is the one that is released.

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

11 years agoWindows: Media Protected if create on RO volume
Jeffrey Altman [Sun, 24 Jun 2012 14:16:42 +0000]
Windows: Media Protected if create on RO volume

If there is an attempt to create a file/directory on a readonly
volume as indicated by the Volume Characteristics, return
STATUS_MEDIA_WRITE_PROTECTED immediately.  Do not bother contacting
the afsd_service.

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

11 years agoWindows: Remove incorrect assert AFSVolumeInfo
Jeffrey Altman [Sun, 24 Jun 2012 14:12:51 +0000]
Windows: Remove incorrect assert AFSVolumeInfo

When querying the volume information, the input FileId does not
have to be a volume root.  Remove this extraneous assertion.

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

11 years agoWindows: NPGetConnectionPerformance
Jeffrey Altman [Sat, 23 Jun 2012 19:04:29 +0000]
Windows: NPGetConnectionPerformance

Restore the implementation of NPGetConnectionPerformance
in AFSRDFSProvider.dll.  This time just return 0 for all fields
except for the preferred read/write size which is set to 64K.

When this function is not implemented at all, a query for
performance of a \\AFS path will be processed by the SMB
redirector.  This can result in a 20 second timeout while waiting
for the SMB Browser query for "AFS <20>" to complete.

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

11 years agoWindows: ShellExt Add Prop Page only if AFS
Jeffrey Altman [Sat, 23 Jun 2012 15:11:47 +0000]
Windows: ShellExt Add Prop Page only if AFS

If the file is not in AFS, do not add any of the AFS specific
property sheets.

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

11 years agoWindows: ShellExt display error if symlink not AFS
Jeffrey Altman [Fri, 22 Jun 2012 20:51:00 +0000]
Windows: ShellExt display error if symlink not AFS

If the path in which a Symlink is to be created is not located
within AFS, display an error dialog.

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

11 years agoWindows: Dir Invalidation Notify Current Object
Jeffrey Altman [Fri, 22 Jun 2012 20:46:23 +0000]
Windows: Dir Invalidation Notify Current Object

When an invalidation is processed for a directory object,
send the notification on the directory object that was invalidated
not its parent.

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

11 years agoWindows: check perms before RXAFS_GetVolumeStatus
Jeffrey Altman [Fri, 22 Jun 2012 04:25:26 +0000]
Windows: check perms before RXAFS_GetVolumeStatus

Instead of calling RXAFS_GetVolumeStatus naked, perform a read
permission check using RXAFS_FetchStatus first.  This permits EACCES
caching to prevent unnecessary requests.

Regardless of which FileId is queried, always use the root vnode
FileId for the permission check.  The file server performs its
permission check using the root vnode.

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

11 years agoWindows: cm_GetROVolumeID empty server list check
Jeffrey Altman [Thu, 21 Jun 2012 23:37:25 +0000]
Windows: cm_GetROVolumeID empty server list check

Instead of testing for a non-NULL server list, check to see
that the list itself is non-empty.

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

11 years agoWindows: Replicated requires more than one site
Jeffrey Altman [Thu, 21 Jun 2012 23:34:58 +0000]
Windows: Replicated requires more than one site

The VLDB response may include a list of servers some of which
are not valid replicas because the DONOTUSE flag is set or
because the replica site may be out of date.  Instead of setting
the replication state based upon the server count in the VLDB
response, use the number of RO sites that were deemed valid
at the end of processing.

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

11 years agoWindows: [Inline]BulkStat VolSync not accurate?
Jeffrey Altman [Thu, 21 Jun 2012 23:29:26 +0000]
Windows: [Inline]BulkStat VolSync not accurate?

Instead of only recording the volume creation date when
cm_readonlyVolumeVersioning is true, record the date whenever
the RPC in use is not a RXAFS_[Inline]BulkStatus.  This is
tracked by the addition of flags for cm_MergeStatus and
cm_EndCallBackGrantingCall which identify when the RPC was
in fact a BulkStat variant.

As a reminder, pre- 1.4.11 and 1.6.0 file servers do not
properly set the VolSync structure when responding to BulkStat
RPCs.  At present, there is no method of identifying when it
is safe to use them.  When cm_readonlyVolumeVersioning is TRUE,
it is assumed that the file servers are new enough to do the
right thing.

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

11 years agoWindows: force vldb lookup if server list is empty
Jeffrey Altman [Wed, 20 Jun 2012 04:05:44 +0000]
Windows: force vldb lookup if server list is empty

The Windows cache manager can mark server references as "deleted"
which can give the impression that a server reference list is not
empty when it is.  If the volume list is empty any attempt to
issue an RPC would fail with a CM_ERROR_ALLDOWN error.  Since the
VLDB data is current, this condition will remain for two hours.

This patchset adds a new error, CM_ERROR_EMPTY, which is returned
when the server reference list is empty.  cm_Analyze() is modified
to process the CM_ERROR_EMPTY error by attempting to update the
server reference list.  If the update succeeds and the list is no
longer empty, the RPC is retried.  Otherwise, the RPC fails as
before.

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

11 years agoWindows: Freelance Short circuit all vol updates
Jeffrey Altman [Tue, 19 Jun 2012 22:48:31 +0000]
Windows: Freelance Short circuit all vol updates

As long as the cell is the Freelance Cell ID the volume updates
should be short circuited.  There is no benefit to performing
the extra work.

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

11 years agoWindows: AFS_Startup_Event must query Debug value
Jeffrey Altman [Tue, 19 Jun 2012 01:55:49 +0000]
Windows: AFS_Startup_Event must query Debug value

For proper debugging to be performed within the AFS_Startup_Event
processing, the "Debug" value must be queried from the registry.

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

11 years agoWindows: NPLogonNotify secure erase password
Jeffrey Altman [Tue, 19 Jun 2012 01:49:18 +0000]
Windows: NPLogonNotify secure erase password

The user's password is copied during the NPLogonNotify
processing, be sure to erase it from the stack before the
function completes.

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

11 years agoWindows: afslogon impersonate when deleting tickets
Jeffrey Altman [Tue, 19 Jun 2012 01:48:05 +0000]
Windows: afslogon impersonate when deleting tickets

When tickets are obtained via the KFW_AFS interface the user
context is being impersonated.  Do the same when cleaning up.

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

11 years agoWindows: afslogon make error dialog system modal
Jeffrey Altman [Tue, 19 Jun 2012 01:45:39 +0000]
Windows: afslogon make error dialog system modal

Prevent error dialogs from getting lost behind the desktop
during logon.  Make them system modal.  Add a warning icon
as well.

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

11 years agoWindows: afslogon MapAuthError
Jeffrey Altman [Tue, 19 Jun 2012 01:39:51 +0000]
Windows: afslogon MapAuthError

return WN_NET_ERROR (ERROR_UNEXP_NET_ERR) to indicate a problem
with this network provider when an error occurs instead of
returning WN_NET_SUCCESS.

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

11 years agoWindows: afslogon OutputDebugString
Jeffrey Altman [Tue, 19 Jun 2012 01:37:49 +0000]
Windows: afslogon OutputDebugString

If the NetworkProvider "Debug" value has the 1th bit set (2),
generate all debug values to the debugger via OutputDebugString().

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

11 years agoWindows: Do not permit RDR worker threads to quit
Jeffrey Altman [Mon, 18 Jun 2012 14:10:32 +0000]
Windows: Do not permit RDR worker threads to quit

If the DeviceIoControl from the service's redirector worker threads
fails the thread will terminate.  This is a problem because if all
of the threads quit the afs redirector will end up deadlocking
all requests since there will be no method of delivering them to
the service.  If there is an error log it (if possible), and retry.
Hopefully it will be transient.

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

11 years agoWindows: misplaced brace in KFW_AFS_get_cred
Jeffrey Altman [Thu, 7 Jun 2012 13:23:26 +0000]
Windows: misplaced brace in KFW_AFS_get_cred

A misplaced brace in KFW_AFS_get_cred() results in KFW_AFS_klog()
being executed twice in a row if successful.  The second attempt
could fail due to a KRB5KRB_AP_ERR_REPEAT error issued by the KDC.

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

11 years agoAdded build of cscope index to Makefile
Steve Simmons [Wed, 27 Jun 2012 21:28:36 +0000]
Added build of cscope index to Makefile

Add ability to do 'make cscope' at the top of
the distribution tree and get 'cscope.out' built
in ./src. Index file is removed in 'make clean'.
cscope.out is now ignored in src/.gitignore

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

11 years agodoc: Correct volume size CAUTIONS notes
Andrew Deason [Thu, 28 Jun 2012 20:43:27 +0000]
doc: Correct volume size CAUTIONS notes

2 terabytes is 2^41 bytes, not 2^31 bytes. Also clarify that volumes
can be much larger than this.

FIXES 130188

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

11 years agodoc: Fix whitespace errors
Andrew Deason [Thu, 28 Jun 2012 22:47:32 +0000]
doc: Fix whitespace errors

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

11 years agodoc: Consolidate CAUTIONS notes about volume size
Andrew Deason [Thu, 28 Jun 2012 20:30:40 +0000]
doc: Consolidate CAUTIONS notes about volume size

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

11 years agoWindows: export roken allocators
Jeffrey Altman [Mon, 2 Jul 2012 05:56:35 +0000]
Windows: export roken allocators

Use rk_alloc, rk_calloc, rk_free, rk_realloc instead of Windows
C RTL allocators.  The OpenAFS source tree has a bad habit of
allocating memory in one module and freeing it in another.  This
is not a problem for POSIX but is disaster on Windows.  This change
ensures that all OpenAFS modules share the same allocator.

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

11 years agoImport of code from heimdal
Heimdal Developers [Mon, 2 Jul 2012 14:00:30 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
3fe55728404c602884f16126e9cc60fc5a3d8f20 (switch-from-svn-to-git-2993-g3fe5572)

Upstream changes are:

Andrew Bartlett (1):
      Revert "make paranoia check less paranoid" - check that key types strictly match

Jeffrey Altman (3):
      do not include stdint.h unprotected
      Windows EAFNOSUPPORT defined by VS2010
      roken: Use a common allocator for all windows

Love Hornquist Astrand (2):
      add rk_getpwnam_r
      move windows compat errno constants to after <errno.h> is included

Nicolas Williams (7):
      Fixes to make Heimdal -Wall -Werror clean
      Make krb5_kuserok() pluggable and add features (including MIT config compat)
      Generalize token expansion to allow for context-specific tokens
      Address code review comments (use krb5_enomem())
      Make master build on Windows
      Fix a compiler warning in lib/roken/snprintf.c on 32-bit Ubuntu
      Move base into lib

Roland C. Dowdeswell (3):
      Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
      Provide support for enctype aliases for ease of use.
      Additional changes to make -Wshadow build on Ubuntu 10.04.

Simon Wilkinson (1):
      hcrypto: Use correct size for memset in md2

New files are:
roken/realloc.c
roken/win32_alloc.c

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

11 years agoroken: Import Windows allocator changes
Simon Wilkinson [Mon, 2 Jul 2012 13:50:10 +0000]
roken: Import Windows allocator changes

Roken now supports using a single allocator across all of the objects
which include that roken library. Two additional objects are required
to support this, so add them to the list of symbols that we import.

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

11 years agocmd: add krb5_enomem() definition
Jeffrey Altman [Mon, 2 Jul 2012 15:52:34 +0000]
cmd: add krb5_enomem() definition

Heimdal's expand_path.c now makes use of a new function krb5_enomem()
which is a wrapper around krb5_set_error_message().  Add a dummy
implementation to src/cmd/krb5_locl.h so that expand_path.c can
build within the OpenAFS tree.

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

11 years agoWindows: HAVE_UINTPTR_T
Jeffrey Altman [Mon, 2 Jul 2012 15:49:54 +0000]
Windows: HAVE_UINTPTR_T

The Windows build has a definition of uintptr_t.  Add
HAVE_UINTPTR_T to the Windows config.h file.  The sources imported
from Heimdal make use of it.

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

11 years agoAdd HAVE_INT64TOINT32 test in stds.h
Jeffrey Altman [Mon, 2 Jul 2012 05:42:35 +0000]
Add HAVE_INT64TOINT32 test in stds.h

Windows SDK v6.0 and above include a platform specific
definition of Int64ToInt32.  Use the platform definition when
available.

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

11 years agoWindows: remove unused defines from param.h
Jeffrey Altman [Mon, 2 Jul 2012 14:36:22 +0000]
Windows: remove unused defines from param.h

Remove #if 0 disabled definitions and those for strtoll and
strtoull as they are not used anywhere in the tree.  strtoll
and strtoull will conflict with the next roken.h update.

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

11 years agoWindows: link to afsroken.dll
Jeffrey Altman [Mon, 2 Jul 2012 05:35:43 +0000]
Windows: link to afsroken.dll

All binaries must be linked against afsroken.dll.

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

11 years agoWindows: roken.h ordering
Jeffrey Altman [Mon, 2 Jul 2012 05:32:25 +0000]
Windows: roken.h ordering

The order of include files must be

  afsconfig.h
  afs/param.h
  afs/stds.h
  roken.h

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

11 years agoWindows: afslogon is only an authentication provider
Jeffrey Altman [Mon, 11 Jun 2012 18:45:15 +0000]
Windows: afslogon is only an authentication provider

afslogon.dll is just a Authentication Provider DLL.  It does not
provide network file system browse and mapping functions.  Therefore,
do not include the "ProviderPath" registry value when the
AuthentProviderPath variable is sufficient.

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

11 years agoviced: null-terminate server list for ubik
Derrick Brashear [Fri, 29 Jun 2012 14:04:10 +0000]
viced: null-terminate server list for ubik

when we set up the vlserver connection, we could potentially use
uninitialized memory as ubik connections. don't.

Change-Id: Idefa71874c7402c927fbf148f994f9422183208a
Reviewed-on: http://gerrit.openafs.org/7610
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoPatch up FreeBSD-10 support
Ben Kaduk [Thu, 28 Jun 2012 02:04:24 +0000]
Patch up FreeBSD-10 support

The auto-guessing code for sysnames produces *_fbsd_100, so we can't
just claim that we'll be *_fbsd_1000 for kicks.
Revert back to the old behavior so as to be less disruptive.

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

11 years agoviced: Remove localcellname
Simon Wilkinson [Tue, 26 Jun 2012 16:42:39 +0000]
viced: Remove localcellname

Commit 8a040cfd848410b75b4e5ac5498f00f073932598 removed all of the
code which relies on the localcellname variable being set, but didn't
remove the variable itself. So do so.

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

11 years agoviced: Make private host stuff static
Simon Wilkinson [Tue, 26 Jun 2012 16:43:29 +0000]
viced: Make private host stuff static

The function initInterfaceAddr_r is internal to the host.c file,
so make it static to make this clear.

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

11 years agoviced: Make the config directory path global
Simon Wilkinson [Wed, 27 Jun 2012 09:51:37 +0000]
viced: Make the config directory path global

Store the location of the configuration directory in a global
variable, rather than hardcoding it in multiple locations in the file.
This makes it easier to write unit tests for portions of the fileserver,
and is a step towards producing a fileserver that can be run from
within the test suite.

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

11 years agovol: Make some functions static
Simon Wilkinson [Sun, 17 Jun 2012 21:20:40 +0000]
vol: Make some functions static

Make all of the functions in partition.c that are only used in that
file static.

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

11 years agotests: Abstract out code for a test RPC service
Simon Wilkinson [Tue, 26 Jun 2012 20:04:41 +0000]
tests: Abstract out code for a test RPC service

Lots of our tests want to start a test RPC server, and then run
commands against it. Start to abstract out the code to do this
by pulling the code to start a test RPC server into its own
function in the common test directory.

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

11 years agoUnix builds: Reference krb5 libs in standard way
Simon Wilkinson [Tue, 26 Jun 2012 20:16:28 +0000]
Unix builds: Reference krb5 libs in standard way

Use $(LIB_krb5) and $(LDFLAGS_krb5) to reference the Kerberos
library and linker flags, rather than directly using an autoconf
substitution. This brings us in line with the way other libraries
are handled.

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

11 years agoviced: Clear all client CPS on FlushCPS
Andrew Deason [Tue, 19 Jun 2012 19:42:23 +0000]
viced: Clear all client CPS on FlushCPS

Currently the fileserver only finds the first applicable 'client'
structure (via h_ID2Client) for a FlushCPS operation, and invalidates
the CPS for it. However, there may be many 'client' structures in
memory for the given viceid, since we may have many connections for
the same user (possibly from different hosts).

So, modify FlushCPS to find all relevant client structures, and
invalidate the CPS calculation on them.

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

11 years agocacheout: Perform authenticated RXAFS_FlushCPS
Andrew Deason [Mon, 18 Jun 2012 22:01:24 +0000]
cacheout: Perform authenticated RXAFS_FlushCPS

Fileservers may now require RXAFS_FlushCPS calls to be made with
administrator tokens. So, try to make the call with admin tokens, and
provide the usual -noauth and -localauth options.

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