The argument to -splitcache is in as->parms[34], not [30].
Change-Id: I4d7be16a1ad99a03025c80f9782c4f678da868ae
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5169
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
An unlikely error condition could lead to the variable cell in
PGetTokens2 being passed uninitialized to afs_PutCell. Initialize
it to NULL beforehand to avoid this.
Change-Id: Ia8ded86df9d8af2f08c02d39749252d98a6c9ffe
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5168
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
In error conditions, charList could be freed before it is initialized.
Move the initialization up to before the error checks.
Change-Id: I678f40552590e238f494507f7410233cdbb949ac
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5167
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
in the new lwp/pthread/shared universe, well, we have the
opportunity to be correct. and we chose to do it entirely wrong.
we're building a shared object. use the right rules. we need
to add some CFLAGS for PAM. do that using MODULE_CFLAGS instead
of just building a whole new CCRULE
Change-Id: Ie3e3c5ba902e5364cfa99d4dbd1b5b7fd4451127
Reviewed-on: http://gerrit.openafs.org/5153
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
don't define variables on platforms we won't use them on
do prototype functions we call. basically, we compile with warnings
enabled now, so, fix everything so we *can*.
Change-Id: I749f27c227ac70c58ccc68f1548f8274f10e3587
Reviewed-on: http://gerrit.openafs.org/5154
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
"code" is unconditionally set early in saveDbToTape() so there's
no need to initialize it. On the other hand, dumpEntry.id is used
before dumpEntry is initialized, so set it to what appears to be
the expected value before any non-local exits could cause it to be
inspected.
Change-Id: I133f8e84e46d0faedf3c9683330d92158bcd8935
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5166
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
In some unusual error situations, startTime may be used uninitialized.
Move the initialization up above the first such error condition.
(None of the intervening code can take measurably long to execute
so this should not make any difference in the non-error case.)
Change-Id: I25bf7a5e149540593febec79f9f5111434807514
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5165
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
If wantExtendedInfo is true, then pntr is used uninitialized.
In the other case, UV_ListVolumes will have set it to NULL
before doing anything (even if it returns an error), so this
free() is dead anyway.
Change-Id: I6979a69d33ecbbdb906eb9a075bbf13180e36646
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5164
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Add the volser and vldb families of functions to libafsauthent. This
allows applications such as per-AFS which are building pthreaded clients
to use a single library, rather than trying to mix LWP and pthreaded
code within the same process.
Change-Id: I3682876e91ca03311a798ac71e3a7a28f3205d42
Reviewed-on: http://gerrit.openafs.org/5157
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Nothing within the volser/ directory depends on tviced, so remove the
unecessary dependency. Add an explicit dependency on vlserver, so that
libvldb is available to us.
This is required to get rid of some potential circular loops when we
start including volser objects in libafsauthent
Change-Id: Ibb6b8fb87dfe6e9eb4fa6d1dde195fd5261a8959
Reviewed-on: http://gerrit.openafs.org/5156
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
If the target is a UNC path beginning with the AFS netbios name,
convert the path to use Unix /afs mountpoint notation.
Change-Id: I01e01b70938f8eb383fd3e7458a140d9e89dd237
Reviewed-on: http://gerrit.openafs.org/5162
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
If the object represented by a scache object is deleted,
update the LRU position of the scache object to make it
the first object in the LRU queue to be recycled. This
preserves the cached objects for those that might prove
useful in the future.
Change-Id: I0e862b1270e10c31f20ecde06d208f4b8c405c3a
Reviewed-on: http://gerrit.openafs.org/5161
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
The osi_Log macro is if(foo) osi_AddLog()
If osi_Log macros will be conditionally called, the conditonal
needs to have bracing.
Change-Id: I59de78a5b7b35cc822a648a51cd63a14037c1ca5
Reviewed-on: http://gerrit.openafs.org/5160
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
During a directory enumeration the directory scache object
is reference counted so it can't be recycled. However, if
there are more directory entries than the maximum number
of cached scache objects the directory scache object will
end up being the next object to be recycled after the refcount
is dropped. Since the directory is clearly a hot object, before
dropping the reference, adjust the scache LRU position so that
it is the last object to be recycled.
Fix the variable name for the directory scache to be 'dscp'
for consistency.
Change-Id: Ia2089fb9b47dab77abc0911ab009e5aed75ed848
Reviewed-on: http://gerrit.openafs.org/5158
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
... so say so in the Makefile
Change-Id: I84f0ac3c06953eff98e0194ad375c32b3656af58
Reviewed-on: http://gerrit.openafs.org/5155
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Visual Studio 10 adds a large number of additional POSIX C99
error values to errno.h. Wrap each mapping with #ifndef to ensure
that we do not redefine the C runtime errno.h definition.
Change-Id: Ia6929d9ff84358059efcc4a53dcc91ee2612fc5a
Reviewed-on: http://gerrit.openafs.org/5129
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
On Windows, error.h does not provide a complete list of POSIX
C99 error values. OpenAFS fills in the gaps with a private
error mapping table afs/errmap_nt.h (src/util/errmap_nt.h).
If errmap_nt.h is not included prior to processing unified_afs.h,
values such as ELOOP will be mapped to EIO instead of the unique
value defined by errmap_nt.h.
Change-Id: I3d25fafb15f1b0060ad1047178cbadd5ce22edb2
Reviewed-on: http://gerrit.openafs.org/5128
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
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>