openafs.git
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>

11 years agoviced: Restrict RXAFS_FlushCPS to administrators
Andrew Deason [Fri, 15 Jun 2012 21:58:42 +0000]
viced: Restrict RXAFS_FlushCPS to administrators

RXAFS_FlushCPS currently can be run by anyone, including
unauthenticated users. Forcing CPS calculation can be a relatively
resource-intensive operation, though, if done frequently enough, and
only should need to be done by administrators. Thus, only let
administrators use it.

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

11 years agoviced: Rename fs_rxstat_userok
Andrew Deason [Fri, 15 Jun 2012 21:55:16 +0000]
viced: Rename fs_rxstat_userok

The fs_rxstat_userok function can be used for other purposes; give it
a more general name.

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

11 years agodoc: Consolidate NetRestrict format docmentation
Andrew Deason [Mon, 18 Jun 2012 20:06:49 +0000]
doc: Consolidate NetRestrict format docmentation

We were specifying exactly the same format in two different places;
consolidate them into one place. In addition, explicitly say there are
is no way to specify a range of addresses, in case some people are
confused by the previous versions of this man page that erroneously
said you could use 255 as a wildcard.

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

11 years agodoc: Remove reference to NetRestrict wildcards
Andrew Deason [Mon, 18 Jun 2012 20:02:09 +0000]
doc: Remove reference to NetRestrict wildcards

Commit 80fc888a9223050481de932233fe7121a48df194 got some of this, but
forgot the other reference. We don't support these anywhere, so remove
it here, too.

FIXES 125340

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

11 years agoCatch up on fbsd releases
Ben Kaduk [Sat, 23 Jun 2012 01:33:50 +0000]
Catch up on fbsd releases

Pull in the changes needed to even have a chance at supporting
FreeBSD 8.3, 8.4, 9-stable, and 10-current.
Conditionals for changed interfaces in a follow-up commit.

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

11 years agocmd: Avoid premature OptionAsString free
Andrew Deason [Thu, 24 May 2012 19:53:59 +0000]
cmd: Avoid premature OptionAsString free

Only free the previously-set string value if we're actually going to
change it. This avoids the scenario where a caller does something
like:

  char *str = strdup("defaultval");
  /* ... */
  cmd_OptionAsString(as, OPT_foo, &str);

resulting in 'str' pointing to freed memory when the relevant option
is not specified, or there is some other error.

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

11 years agorx: abort on missing service
Derrick Brashear [Fri, 1 Jun 2012 17:16:31 +0000]
rx: abort on missing service

currently rx does not send an abort if a service does not
exist; it quietly ignores the packet. provide a hint we have
done so.

Change-Id: Id3533afd46ed21765d4d2aab630a896b21c945de
Reviewed-on: http://gerrit.openafs.org/7563
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoFBSD: Add osi_fbsd_checkinuse
Andrew Deason [Sun, 20 May 2012 22:05:12 +0000]
FBSD: Add osi_fbsd_checkinuse

Add the osi_fbsd_checkinuse function, which contains code common to
the FreeBSD osi_TryEvictVCache and osi_VM_FlushVCache. Implement the
latter two in terms of osi_fbsd_checkinuse.

This commit should incur no behavior changes. This is just a
reorganization so future commits can change the implementations of
osi_TryEvictVCache and osi_VM_FlushVCache.

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

11 years agovol: avoid attach retry loops on SYNC_FAILED
Michael Meffie [Mon, 18 Jun 2012 21:16:02 +0000]
vol: avoid attach retry loops on SYNC_FAILED

Avoid unnecessary volume attach retry loops if a volume
salvage is unable to be scheduled due to a hard error.

Change-Id: If1962b83e03f634044a55b03787661b8a7695008
Reviewed-on: http://gerrit.openafs.org/7566
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agolibafs: put connection in analyze when conn srvr missing
Derrick Brashear [Tue, 19 Jun 2012 19:11:38 +0000]
libafs: put connection in analyze when conn srvr missing

we need to putconn in all cases we can in afs_Analyze, but at least
one case we didn't. fixed.

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

11 years agotests: Fix cmd config file path
Simon Wilkinson [Wed, 20 Jun 2012 20:55:25 +0000]
tests: Fix cmd config file path

Fix the configuration file path for the cmd test so that it works
when invoked from runtests

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

11 years agoAuth: increase size of DNS resolver answer buffer
Niklas Jonsson [Wed, 20 Jun 2012 14:03:54 +0000]
Auth: increase size of DNS resolver answer buffer

This patchset increases the size of the res_search() answer
buffer from 1024 octets to 4096 octets.   This is not a proper
long term solution but will permit sites with longer response
lists to make use of SRV and AFSDB records.

This patchset only impacts UNIX systems.  Windows uses the
Win32 DNS resolver which dynamically allocates memory based
upon the size of the response.

FIXES 130936

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

11 years agorx: provide mechanism to send a bare abort packet
Simon Wilkinson [Fri, 1 Jun 2012 17:20:57 +0000]
rx: provide mechanism to send a bare abort packet

simply put an abort on the wire

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

11 years agoopr: Add simple time type
Simon Wilkinson [Tue, 15 May 2012 15:45:57 +0000]
opr: Add simple time type

Add a simple time type to the opr library, which provides helper
routines to implement the 100ns time format selected for on-the-wire
use for AFS-3 (this also provides a handy single integer internal
time format)

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

11 years agoviced: Abstract out peer mapping code
Simon Wilkinson [Sun, 10 Jun 2012 10:43:56 +0000]
viced: Abstract out peer mapping code

Pull the code which gets the peer information for an incoming connection
into its own function.

Reformat this function a little to avoid if-ladders.

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

11 years agoviced: Tidy up VL initialization
Simon Wilkinson [Sat, 9 Jun 2012 21:29:44 +0000]
viced: Tidy up VL initialization

Tidy up the routines which initialize the VL server so that they
don't reopen an already open configuration directory, and so that
some global variables are less globally scoped.

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

11 years agorxgen: Make input strings const
Simon Wilkinson [Wed, 30 May 2012 17:25:51 +0000]
rxgen: Make input strings const

Modify the code generation routines so that string inputs to RPCs
are declared as (const char *) on the client side. This doesn't affect
callers as we can freely cast from (char *) to (const char *), but means
it is easier to write API wrappers that accept const arguments.

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

11 years agoaklog: Fix error message fallback for Heimdal
Simon Wilkinson [Thu, 7 Jun 2012 22:21:48 +0000]
aklog: Fix error message fallback for Heimdal

Since we reverted to using Russ's upstream version of rra-c-util's
krb5.m4, we no longer check for the existence of the pure com_err
error_message().

So, for error message fallback on Heimdal, use krb5_get_error_message()
instead. As we don't have access to the context in which the error
occurred, build one to get the raw com_err error translation - this
won't give us any additional context specific detail.

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

11 years agoviced: Abstract out hpr thread context code
Simon Wilkinson [Thu, 10 May 2012 23:34:24 +0000]
viced: Abstract out hpr thread context code

Every hpr lookup function had a copy of the same code to pull a thread
specific ubik context out of the pthread library, and to create one if
one wasn't already there.

Instead of endlessly repeating this code, create a small inline function
to do the job.

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

11 years agorx: Constify rx_opaque_populate
Simon Wilkinson [Thu, 7 Jun 2012 19:46:27 +0000]
rx: Constify rx_opaque_populate

rx_opaque_populate doesn't modify the data passed into it, so
make that argument const

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

11 years agoviced: Remove unused profiling code
Simon Wilkinson [Tue, 15 May 2012 16:01:50 +0000]
viced: Remove unused profiling code

src/viced/profile.c is never built, and contains unused code which
is now useless to us. Just remove it from the tree - it is in git if
we ever need it again.

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

11 years agouss: allow disabling by configure switch
Derrick Brashear [Tue, 12 Jun 2012 18:23:12 +0000]
uss: allow disabling by configure switch

provide an option to disable building uss. current heimdal
when built static can leak symbol names for its flex/bison parser
causing symbol conflicts. this is but a workaround, but
sites not needing uss can at least use it.

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

11 years agogtx: add configure switch to force not building
Derrick Brashear [Tue, 12 Jun 2012 18:10:04 +0000]
gtx: add configure switch to force not building

allow gtx and associated software to be turned off.

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

11 years agoaklog: can't assume krb5_524_conv_principal based on convert_creds
Derrick Brashear [Tue, 12 Jun 2012 17:46:46 +0000]
aklog: can't assume krb5_524_conv_principal based on convert_creds

add probing for krb5_524_conv_principal directly instead of
assuming finding a 524 library will find it. current heimdal
does not include it.

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

11 years agoviced: fix GetVolumePackage to not bomb always when GetClient called
Derrick Brashear [Mon, 11 Jun 2012 20:37:53 +0000]
viced: fix GetVolumePackage to not bomb always when GetClient called

master only. already correct in 1.6. the gotos for error exit should
be called only when we have an error, due to missing braces that was
not true

Change-Id: I396be7d34ad741e01634a702784a0892f47a2d5a
Reviewed-on: http://gerrit.openafs.org/7549
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoviced: fix merge error
Derrick Brashear [Mon, 11 Jun 2012 20:05:10 +0000]
viced: fix merge error

when 37fc2dfbb9e3a8a8ecb022febae7ccd04d7340a4 was merged, the close
bracket went in the wrong place, meaning for non-remote calls
we don't re-enable keepalives. fix it.

Change-Id: I163db9b3b2f42f629d8a5ff22a75902a61a3138b
Reviewed-on: http://gerrit.openafs.org/7548
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agovol: Avoid getting stuck in ATTACHING in attach2
Andrew Deason [Thu, 31 May 2012 22:45:56 +0000]
vol: Avoid getting stuck in ATTACHING in attach2

Since commit 5fc2365f, a VNOVOL error early in attach2 meant that we
skipped changing the volume state to anything, and just returned
instead. When we do this, the volume is in VOL_STATE_ATTACHING for
DAFS, and so if we return, the volume will forever be in
VOL_STATE_ATTACHING. The next thing that tries to access the volume
will wait forever for the volume to come out of that state.

So, revert half of 5fc2365f, and transition to ERROR state instead.
This code path should not be hit during normal usage, since a
nonexistant volume access for the fileserver will be detected earlier.
If the volume does not appear to exist at this stage of attachment,
something is wrong with the volume, so this warrants the ERROR state.

For the volserver and other volume utilities, we may hit this when a
request just plain references a nonexistant volume for whatever
reason, but in that case the vp should go away soon. For non-DAFS,
this commit does not change much, since the difference between
error_notbroken and unlocked_error is very small.

The other half of 5fc2365f is not changed, since it is correct. For
VOFFLINE errors at this point, the volume has already been
transitioned to VOL_STATE_UNATTACHED, so it is okay to return. Add a
comment to help make this more explicit.

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

11 years agoDAFS: Preattach, not attach, in FSYNC_Drop
Andrew Deason [Thu, 31 May 2012 21:41:15 +0000]
DAFS: Preattach, not attach, in FSYNC_Drop

FSYNC_Drop currently attaches volumes that were checked out by the
dropped fssync handler, but not checked back in, in order to make the
volume available again. For DAFS, however, a full attachment is
unnecessary; just preattach instead.

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

11 years agovol-salvage: Unlock volumes before exiting
Andrew Deason [Thu, 31 May 2012 21:15:33 +0000]
vol-salvage: Unlock volumes before exiting

Normally, volume locks acquired by an exiting salvaging process would
be automatically given up when the process exits, since our FDs are
closed. However, if we exit by calling Exit() or Abort(), we
gracefully shutdown our SYNC channels before exiting. For FSSYNC, this
can result in the fileserver trying to online the volumes we had
checked out but had not yet checked back in, so the fileserver may try
to online a volume we have locked, before the locks have been
released.

To avoid this, unlock all volume locks for all partitions before we
shutdown SYNC channels on exit.

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

11 years agovol-salvage: Indent some ifdefs
Andrew Deason [Thu, 31 May 2012 21:08:00 +0000]
vol-salvage: Indent some ifdefs

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

11 years agolibafs: initialize free dcache list for memcache
Derrick Brashear [Fri, 25 May 2012 13:40:54 +0000]
libafs: initialize free dcache list for memcache

reuse the disk cache dcache creation code for memcache, then
call it to prime the list

Change-Id: If63268aa1a89c9642236f944e1ac8328d68aeba5
Reviewed-on: http://gerrit.openafs.org/7446
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

11 years agoviced: clear optstring before parsing
Derrick Brashear [Fri, 8 Jun 2012 23:52:33 +0000]
viced: clear optstring before parsing

we try to free the string if there was a value, so
if there's none we should probably ensure we know it

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

11 years agocmd: avoid issues with static heimdal
Derrick Brashear [Fri, 8 Jun 2012 20:12:17 +0000]
cmd: avoid issues with static heimdal

stealing the krb5 parser and linking with static heimdal can cause problems.
remap things we have which duplicate heimdal's private namespace.

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

11 years agoLinux 3.5: encode_fh API change
Marc Dionne [Sun, 3 Jun 2012 01:35:53 +0000]
Linux 3.5: encode_fh API change

The encode_fh export operation now expects two inode arguments
instead of a dentry and a "connectable" flag.  Use the inode of
the dentry we're interested in, and NULL as the parent inode which
is the same as passing a 0 flag in the previous API.

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

11 years agoafsd: include sys/resource.h in afsd_kernel.c
Marc Dionne [Sun, 3 Jun 2012 00:45:08 +0000]
afsd: include sys/resource.h in afsd_kernel.c

With a recent glibc update, sys/wait.h no longer includes
sys/resource.h unless __USE_SVID, __USE_XOPEN or __USE_XOPEN2K8
are set.

Don't rely on the indirect inclusion to get the bits we need;
include it directly in afsd_kernel.c.  This include used to be
there but was dropped when afsd_kernel.c was split off.

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

11 years agowindows: AFSQueryVolumeInfo exception info
Jeffrey Altman [Wed, 6 Jun 2012 03:25:08 +0000]
windows: AFSQueryVolumeInfo exception info

Protect against NULL FileObject or ObjectInformation.

Log additional information when an exception is caught in
AFSQueryVolumeInfo.

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

11 years agoWindows: SMB GetFileAttributes support
Jeffrey Altman [Wed, 6 Jun 2012 03:07:40 +0000]
Windows: SMB GetFileAttributes support

commit 56a2cbb5fbdcab51bd5f4720e610796abbce5c41 added a
GetFileAttributes query to the pioctl interface to protect
against printing pages on printers with a broken smb protocol
implementation.   This patchset adds support for GetFileAttribute
on _._AFS_IOCTL_._ files to the SMB implementation.

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

11 years agoWindows: Introduce AFSFreeExtent()
Jeffrey Altman [Sat, 26 May 2012 23:16:47 +0000]
Windows: Introduce AFSFreeExtent()

Consolidate all operations necessary to free an extent in
a single function, AFSFreeExtent().

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

11 years agoWindows: Adjust extent release strategy
Jeffrey Altman [Sat, 26 May 2012 22:11:06 +0000]
Windows: Adjust extent release strategy

All extents were flushed whenever AFSReleaseExtentsWithFlush was
executed.  This included a call at the completion of each
NonCached Read operation which could result in heavy thrashing
as the data would be released prior to it being needed by the
application.

This patchset makes the following adjustments.  First,
AFSReleaseExtentsWithFlush() has been modified to release all
but 1024 extents belonging to the file.  Second, NonCached Reads
only execute AFSReleaseExtentsWithFlush() when there are more
than 4096 extents associated with the file.  Third,
AFSReleaseExtentsWithFlush() now has a 'bReleaseAll' parameter
which is used for calls from AFSCleanup() and AFSFlushExtents()
which need to be able to flush all extents attached to a FCB.

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

11 years agoWindows: AFSRedir code cleanup
Jeffrey Altman [Sat, 26 May 2012 22:09:30 +0000]
Windows: AFSRedir code cleanup

Remove unnecessary intermediate variables.

Do not drop lock only to reacquire.

Formatting.

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

11 years agoWindows: Remove extent from all skip lists
Jeffrey Altman [Sat, 26 May 2012 22:06:07 +0000]
Windows: Remove extent from all skip lists

Before freeing the memory for an Extent object, the extent must
be removed from all of the extent skip lists.  Otherwise, the
lists will be corrupted.

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

11 years agoWindows: consoldiate NextExtent() implementations
Jeffrey Altman [Sat, 26 May 2012 22:04:25 +0000]
Windows: consoldiate NextExtent() implementations

Both AFSExtentsSupport.cpp and AFSIoSupport.cpp provided
NextExtent() implementations.  The AFSExtentsSupport version was
more general.  Use that one for both modules.

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

11 years agoWindows: Protect against null volp dereference
Jeffrey Altman [Sun, 27 May 2012 15:20:11 +0000]
Windows: Protect against null volp dereference

In cm_RecycleSCache cm_GetVolumeByFID can fail leaving 'volp'
a NULL pointer.  Do not call cm_PutVolume() if cm_GetVolumeByFID
fails.

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

11 years agoWindows: Avoid deadlock on ProcessTree Lock
Jeffrey Altman [Sat, 26 May 2012 01:47:23 +0000]
Windows: Avoid deadlock on ProcessTree Lock

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

11 years agoWindows: Add CCB NonPaged Resource for synchronization
Jeffrey Altman [Fri, 25 May 2012 00:46:27 +0000]
Windows: Add CCB NonPaged Resource for synchronization

Add a NonPaged ERESOURCE object to the AFS_CCB structure for
use in synchronizing access to the Ccb->Flags field and the
construction of Directory Snapshots.

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

11 years agoWindows: Make CCB_FLAGS_DIRECTORY_QUERY_MAPPED consistent
Jeffrey Altman [Fri, 25 May 2012 00:45:07 +0000]
Windows: Make CCB_FLAGS_DIRECTORY_QUERY_MAPPED consistent

Use CCB_FLAG_DIRECTORY_QUERY_MAPPED instead of
CCB_FLAGS_DIRECTORY_QUERY_MAPPED.

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

11 years agoWindows: Remove unused async read/write operations
Jeffrey Altman [Thu, 24 May 2012 21:47:25 +0000]
Windows: Remove unused async read/write operations

Removing dead code.

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

11 years agoWindows: Avoid deadlock on VolumeCB->VolumeLock
Jeffrey Altman [Thu, 24 May 2012 08:57:19 +0000]
Windows: Avoid deadlock on VolumeCB->VolumeLock

AFSPrimaryVolumeWorkerThread() holds VolumeCB->VolumeLock SHARED
across the call to AFSCleanupFcb() -> CcPurgeCacheSection().
If a filter driver such as Sophos (savonaccessfilter.sys ->
savonaccesscontrol.sys) triggers an AFSCreate() in response to
the cache section being purged that will force the evaluation of
the file path by AFSLocateNameEntry().  If the path contains a
mount point that requires validation, AFSBuildMountPointTarget()
is called which in turn required the VolumeCB->VolumeLock EXCL.

AFSBuildMountPointTarget() only requires the VolumeCB->VolumeLock
if the VolumeCB->RootFcb == NULL.  That should only be true if
the VolumeCB was allocated by AFSInitVolume() or under very rare
race conditions.

This patchset refactors AFSInitVolume() to ensure that it holds
an extra VolumeCB->VolumeReferenceCount reference.  This reference
is used to assist in the refactoring of AFSBuildRootVolume() and
AFSBuildMountPointTarget() to avoid races with volume root object
invalidation as well as permitting the VolumeCB->VolumeLock to
be ignored in the common case.

Avoiding the acquisition of VolumeCB->VolumeLock during mount
point target evaluation has the additional benefit of reducing
lock contention during path evaluation.

FIXES 130812

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

11 years agogtx: remove unused variable numBuffBytes
Marc Dionne [Tue, 29 May 2012 01:49:46 +0000]
gtx: remove unused variable numBuffBytes

Commit 9efc255a makes the numBuffBytes variable unnecessary.
Remove it to clear up an "unused but set" warning.

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

11 years agoLinux 3.4: replace end_writeback with clear_inode
Marc Dionne [Tue, 29 May 2012 01:43:12 +0000]
Linux 3.4: replace end_writeback with clear_inode

end_writeback() is renamed to clear_inode().  Add a configure test
and cope.

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

11 years agoafsd (FUSE): Avoid a compilation error and spell it "asprintf" not "asprint".
Garrett Wollman [Fri, 25 May 2012 02:33:04 +0000]
afsd (FUSE): Avoid a compilation error and spell it "asprintf" not "asprint".

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

11 years agoafs: Do not QueueVCB before osi_dnlc_purge*
Andrew Deason [Fri, 18 May 2012 21:40:38 +0000]
afs: Do not QueueVCB before osi_dnlc_purge*

In afs_FlushVCache, when we QueueVCB, we might drop the afs_xvcache
lock (as of 76158df491f47de56d1febe1d1d2d17d316c9a74). The vcache may
still be on the DNLC, so a lookup while xvcache is dropped can cause
someone else to grab a reference to the vcache while it is being
flushed. This can cause panics and failed assertions, since someone
will have a reference to the flushed vcache, which is effectively
freed and many of the structure fields are no longer valid.

So instead, do not call QueueVCB until we have purged the vcache from
the DNLC.

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