erroneously pushed a bad version of this. fix it now.
Change-Id: Ic5db50473a97bd7ffb3ba34ac052da2ae8f2875b
Reviewed-on: http://gerrit.openafs.org/5124
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
When we unmount, and afs_globalVp is NULL (e.g. because root.afs was
unavailable when the client was started), we will panic the machine if
we try to release it. So, if afs_globalVp is NULL when we hit our
unmount handler, don't touch it.
Reported by Andy Cobaugh.
Change-Id: I4e5869237e24da320afc2b7edaf8edca0ab3e4e9
Reviewed-on: http://gerrit.openafs.org/5117
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The init script provided with OpenAFS always returns 0 when the status
subcommand is called, even if the service is not running.
For example:
$ sudo service afs status; echo $?
afsd is stopped
0
This change makes sure the init script exits with the value returned
by the status function from /etc/init.d/functions. With this patch,
the afs init script behaves as expected when used, for example, in a
Chef service resource:
$ sudo service afs status; echo $?
afsd is stopped
3
Change-Id: If3d317fc406746f357e29e0d8d82c7ccf3c192d7
Reviewed-on: http://gerrit.openafs.org/5123
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If a cm_BkgDaemon thread finds a queued request whose cm_scache_t
has the CM_SCACHEFLAG_DELETED flag set, do not execute the request
and fail it immediately with CM_ERROR_BADFD. Any attempt to execute
the request will fail with VNOVNODE from the file server.
Change-Id: Ib74300568ac083e39506b0d106a5984e8fe5e464
Reviewed-on: http://gerrit.openafs.org/5120
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
cm_SyncOp is designed to synchronize operations among multiple
threads. The background daemon threads should not filter requests
based upon cm_SyncOp states. Doing so is racy and does not produce
better performance.
Change-Id: Ifeafd55da6e02807ed4cc3c3f2b6f1de4df2a87f
Reviewed-on: http://gerrit.openafs.org/5119
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
If the cm_scache_t flags include CM_SCACHEFLAG_DELETED, do not
bother releasing an outstanding file lock to the file server.
The lock went away when the file was deleted. Any attempt to
release will fail with VNOVNODE which is translated locally into
CM_ERROR_BADFD.
If a RXAFS_ReleaseLock RPC fails with VNOVNODE, treat it as
success.
Change-Id: I15860920a224bd032256e08c9983fa31f7f1c9ee
Reviewed-on: http://gerrit.openafs.org/5118
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
generate-html requires a HEADER description for pod3
The Windows makefile needs to process pod.in files.
Change-Id: I5ac964cc8c1af73510d17b3a31bf1a9a5df3a58f
Reviewed-on: http://gerrit.openafs.org/5116
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Add PERL variable to the build system. If not specified
externally the variable will be set to 'perl'. However,
ActiveState Perl should be used and not Cygwin Perl. The build
environment should indicate that by specifying a PERL setting.
SET PERL=c:\perl64\bin\perl.exe
or similar.
Change-Id: Iaf14a82134cc2dcf3c23b1e5a0ed65606e2487bb
Reviewed-on: http://gerrit.openafs.org/5115
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Several of the demand attach pod files were not being processed
on Windows.
Change-Id: If211f80564115bdc184181226aa0750ba1989a55
Reviewed-on: http://gerrit.openafs.org/5114
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
On Windows, the git repository is checked out as CR-LF.
Tell perl to open the pod file with cr-lf as the end of line.
On Windows, the input file names are of the form podX\foo.pod.in.
Cygwin perl cannot parse the directory for the file name unless
the path separator is converted from \ to /.
Change-Id: I7139bd2138573e938ea3e8386685f3b69e131c4d
Reviewed-on: http://gerrit.openafs.org/5113
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
The userrealm string in KFW_AFS_get_cred() should not include
the '@' symbol from the user principal. Including the '@' produces
an invalid realm name.
Change-Id: I5887ffabce93666bdbe231eaac0821573162a6ba
Reviewed-on: http://gerrit.openafs.org/5110
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
If the service is configured for auto start but has yet
to start, kick it off just in case.
Change-Id: I668961b17472a78ebac6744bf131dcb850d4e4a2
Reviewed-on: http://gerrit.openafs.org/5109
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Add KTC and PT error messages to those that can be
translated within afskfw.lib. This improves the error
logging for afslogon.dll, afscreds.exe, and afssrvadm.exe
Change-Id: I62aa5f1249d4d1f2d64ed068be47a5832d97f85c
Reviewed-on: http://gerrit.openafs.org/5108
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Limit how often we log "hard-mount waiting for XXX" messages. Without
this, it is possible for a client with hard-mounts enabled to spam the
kernel log rather excessively (in extreme cases this can even panic
the machine on at least some Linux).
To keep things simple, just log approximately one message per volume
per hard-mount interval.
Change-Id: Ie82f68c5eae76519fcf1491164133c1955ed9c08
Reviewed-on: http://gerrit.openafs.org/5060
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
FT_GetTimeOfDay creates an LWP dependency. For the purpose that we're
using it in serverLog.c, gettimeofday performs identically. So, just
use gettimeofday and reduce our dependencies.
Change-Id: I36887d725c7e93386c80c61b3b33a7cda2bfe738
Reviewed-on: http://gerrit.openafs.org/5085
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
In the startup function for each thread, set a thread name. This
can safely be done unconditionally as LWP builds turn the call into
a no-op. In general, the thread name parallels the name passed to
LWP_CreateProcess, but for Rx server threads, it additionally includes
the thread ID so that these threads can easily be distinguished. (I'm
not sure yet whether doing so will prove to be useful or counterproductive.)
Change-Id: I30e012eebef4c7856084fa8b8eb1d88d9fcdf2c4
Reviewed-on: http://gerrit.openafs.org/5041
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
If someone is putting back too many refs, we can detect so very
easily. If we see that such a thing is happening, give a warning and
bail out, instead of risking a panic or memory corruption.
Change-Id: I36c968f9cd7cab3f569d3f6860f41678f026fba8
Reviewed-on: http://gerrit.openafs.org/5094
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
<netinet/in.h> is a prerequisite for <resolv.h> and <netinet/if_ether.h>.
<sys/socket.h> is a prerequisite for <net/if.h>.
Change-Id: I2c974ad863c6ff7eedb3702159399118af8de074
Reviewed-on: http://gerrit.openafs.org/5107
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Equality in the test(1) utility is represented by "=", not "==".
Some, but not all, versions of test accept the latter as an extension.
Change-Id: I25380f77e1c621965e0610318c9793874154cf15
Reviewed-on: http://gerrit.openafs.org/5106
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
$(shell ...) is a GNU Make proprietary feature and shouldn't be used
OS-independent makefiles. There is no need to use it here; command
substitution in the shell is good enough.
Change-Id: I511108dab0770e772005b3f4a851713d1ee5a83e
Reviewed-on: http://gerrit.openafs.org/5093
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
because of how the root fid is created we can end up being dumb.
turns out we never want to bypass doing the full pass for root anyway
so just force fixup to not happen.
Change-Id: I2b6d8d5cc4824f0f2a9473a2e810410579e3ad48
Reviewed-on: http://gerrit.openafs.org/5095
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
In afs_DoBulkStat, we can call afs_Analyze multiple times for the same
set of connection objects. Since afs_Analyze puts its reference to the
given afs_conn and rx_connection structures, calling it more than once
can cause the reference counts on those objects to be lower than they
should be.
Instead of making another afs_Analyze call, just alter the error code
inside the normal do/while afs_Analyze loop, so the 'loop' afs_Analyze
call gets the appropriate error code from the first bulk stat'd entry.
Change-Id: Id6396f8e9d4757d54825d4915458bf8b5153984f
Reviewed-on: http://gerrit.openafs.org/5086
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Modify the vlserver so that it uses the libcmd library to parse its
command line, rather than rolling its own command line parsing.
Change-Id: I7705219894de2d2268729ddc66a8af9ad9758ce7
Reviewed-on: http://gerrit.openafs.org/5074
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Modify the ptserver so that it uses the libcmd library to parse its
command line, rather than rolling its own command line parsing.
Change-Id: I84bac2cd70bbaf85004fce2f23d9237215544edd
Reviewed-on: http://gerrit.openafs.org/5073
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Add --with-gssapi*, --with-libintl*, and --with-roken for the new
library location flags. Add --with-docbook2pdf and
--with-docbook-stylesheets for the automatic discovery of tools for
building the documentation. Expand and correct the descriptions of
--with-html-xml and --with-xslt-processor.
Change-Id: Ibe0a94ce3e9c6393bde009bf08f8b9dfac6b84a6
Reviewed-on: http://gerrit.openafs.org/5092
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Depending on what generation method is used for the DocBook
documentation, additional build files may be created. One of those
(*.aux) will cause the build to break if one switches from
docbook2pdf to dblatex without deleting it. Update make clean
and .gitignore to remove and ignore these additional files.
Change-Id: I13cc8a3526bd7bc7c4c65cd7d2cd78b094398faa
Reviewed-on: http://gerrit.openafs.org/5089
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
lkmnosys is a function, and as such has its own prototype which
includes a named struct specific to it (struct nosys_args). When
comparing its address to an entry in the syscall table, we must
cast it to a sy_call_t to correctly do the comparison, lest gcc
warn us about comparing distinct pointer types without a cast.
This warning recently became an error due to bsd.kmod.mk, so it
causes the build to fail on 8.1 and earlier, which do not use
syscall_register() due to a conflicting entry for our syscall
in syscalls.master.
Change-Id: I606aaf73e433a50ea41adaab842d61ee69653bd5
Reported-by: Garrett Wollman
Reviewed-on: http://gerrit.openafs.org/5087
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
dirpath.h is only copied into place if it has changed. However, this
means that the timestamp of dirpath.h is never updated, causing make to
always trigger the buildrule, even if the rule eventually does nothing.
Instead, always copy in the new dirpath.h, which simplifies the make
rules, and stops make from always building.
Change-Id: I43ba9152473591c5afd9064ad6e58adda6823f11
Reviewed-on: http://gerrit.openafs.org/5084
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Provide functions to let an application manipulate the rx thread
specific key, rather than letting them root around in the internals
of RX themselves.
Change-Id: Ic42430de7e0c0a60217a509d9b7ef9d3523463ce
Reviewed-on: http://gerrit.openafs.org/5083
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
ubik_PR_NameToID is a low level function which requires a large amount
of setup from the caller. Instead, use pr_Initialize() and pr_SNameToId()
which do all of the work in a library.
Change-Id: I6b8d50c3d16eb258a4a81335790be2654c4fb191
Reviewed-on: http://gerrit.openafs.org/5082
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
When we don't need to store the amount of data read from a file,
don't complicate the if() statement by adding a pointless assignment.
Caught by clang-analyzer
Change-Id: I326d894c9b5f7a89f31534c7864e05ea059a03aa
Reviewed-on: http://gerrit.openafs.org/5079
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
We don't need to increment argv here, as we're about to return
to the caller.
Change-Id: I442fe741e4bda91e12375a6fe72657dc215c4e78
Reviewed-on: http://gerrit.openafs.org/5078
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Don't store the results from cmd_CreateSyntax unless we actually
need to use them for something.
Caught by clang-analyzer
Change-Id: I581dcc00a886245a8d117f78c74590111c75e3b0
Reviewed-on: http://gerrit.openafs.org/5077
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
The readgroup utility printed the wrong variable when listing the
source group - instead of printing the group name, it tried to
print an arbitrary element from the list of group members. Fix it
to print the right thing.
Caught by clang-analyzer.
Change-Id: Ie7ada8a1e881871ae5db14714ee10325ac052d40
Reviewed-on: http://gerrit.openafs.org/5076
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
VResort and VMoreReps are not referenced anywhere in the tree, so
remove their definitions. Keep VPartVisible for VICEP-ACCESS, but
lower it to the next unused bit.
Change-Id: I04c9d1c75774a55d01105acb2b5df9d2bcafa5d8
Reviewed-on: http://gerrit.openafs.org/5059
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
the shimmed heimdal in Lion crashes on this call now.
the shim also exports diddly squat. fine, we pick over what
IS exported and use only calls available to us.
should be exactly as functional as before.
Change-Id: I6a55209b94694e8eb462bc0a4607a891b9f8b570
Reviewed-on: http://gerrit.openafs.org/5065
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Printing out information on how to configure cacheinfo and ThisCell
is a bit noisy, and pam_afs.so is probably not what most people
want to use nowadays.
Change-Id: I103ccb39bc7bb075cffab1d980b542ea8156f0c6
Reviewed-on: http://gerrit.openafs.org/5026
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
if the directory object cannot be found in the tree, return
CM_ERROR_PATHNOTFOUND instead of crashing.
Change-Id: I51458e24b5b9f16fc0378073e002d8ee160b8f15
Reviewed-on: http://gerrit.openafs.org/5061
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
During Windows OS shutdown the service may be given as little
as six seconds to shut itself down before it will be terminated.
Forced termination will leave the cache file in a dirty state.
This patchset makes several minor changes to reduce the overall
time required for shutdown:
1. do not wait for the IP address change notification thread.
by the time it terminates the ip address has been lost.
2. send give up all callbacks earlier.
3. reorder the daemon thread waits.
4. change the daemon thread loop sleep time to 500ms in order
to prevent the service from waiting up to 10 seconds for
the thread to notice a shutdown is in progress.
Change-Id: Ib1ff3eaf2e5116d9b3d7561670b8266e1bc5d1cf
Reviewed-on: http://gerrit.openafs.org/5055
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
When computing whether or not to perform an offline volume
check it is critical that the 'lastBusyVolCheck' variable
be assigned the current time instead of 'lastVolCheck'.
By setting the wrong variable a new offline volume check is
performed every 10 seconds which is undesireable.
Change-Id: I509cde64a8b51ce1846f37047a574409ff248978
Reviewed-on: http://gerrit.openafs.org/5054
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Add an explicit message that the shutdown sequence is complete.
This is necessary because during a Windows OS shutdown, the service
is frequently killed prior to the memory mapped file is fully released.
Change-Id: I1ad2471e1e1442d836d6abac09fc5cdd08edae0b
Reviewed-on: http://gerrit.openafs.org/5053
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>