openafs.git
9 years agovenus depends on libafsauthent
Marc Dionne [Mon, 8 Aug 2011 20:08:25 +0000]
venus depends on libafsauthent

Add an explicit dependency on libafsauthent for src/venus, since it
is needed to build afsio.  This can cause parallel builds to fail.

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

9 years agopam: fix unused but set warnings
Marc Dionne [Mon, 8 Aug 2011 21:08:34 +0000]
pam: fix unused but set warnings

Fix a few cases of set but unused variables.

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

9 years agovolser: flag unused variable
Marc Dionne [Mon, 8 Aug 2011 20:51:53 +0000]
volser: flag unused variable

nearInode can be unused, flag it as such to prevent warnings and
keep enable_checking happy.

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

9 years agobos: don't dereference a null pointer when printing an error message
Garrett Wollman [Tue, 9 Aug 2011 03:26:38 +0000]
bos: don't dereference a null pointer when printing an error message

The parameter we are interested in is at MRAFS_OFFSET + 17, not
MRAFS_OFFSET + 13.

Change-Id: Ib856ff40c5949cde95a2b277cd44253b87c3c2a4
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5178
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agodir/vol: Die() really does
Garrett Wollman [Tue, 9 Aug 2011 03:19:22 +0000]
dir/vol: Die() really does

Die() is an abort routine shared by the dir and vol modules.  Move its
prototype into dir.h to ensure that its declaration matches its three
different definitions, and add an AFS_NORETURN annotation so that the
static analyzer knows that it aborts.

Change-Id: If01f35fe796708f6187b9767497a32458888ec1c
Reviewed-on: http://gerrit.openafs.org/5177
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agovos: eliminate unnecessary global variables
Garrett Wollman [Tue, 9 Aug 2011 02:49:24 +0000]
vos: eliminate unnecessary global variables

tserver is used by three different functions but not shared by them;
make it private to each one to improve static analysis.  tconn is
not used by anything, so just delete it.

Change-Id: Ic9fc4add66dbbb02170846154e44d261dcc6b061
Reviewed-on: http://gerrit.openafs.org/5176
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agovolser: let it be known that Abort() really aborts
Garrett Wollman [Tue, 9 Aug 2011 01:41:57 +0000]
volser: let it be known that Abort() really aborts

The compiler and static checkers can do a better job if they know that
certain functions never return.  Tell it that common.c:Abort() is such
a function.  While we're at it, let volser_internal.h provide the
declarations for this function (Log() was already there).  This makes
volser parallel to the way the same functions are declared in vol.

Change-Id: I8b684bf96866edfc9edaae126d789d245a8d2356
Reviewed-on: http://gerrit.openafs.org/5175
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agokdb: don't dereference a null pointer on corrupt database
Garrett Wollman [Tue, 9 Aug 2011 01:18:15 +0000]
kdb: don't dereference a null pointer on corrupt database

When iterating through the database, kdb would dereference a
null pointer if it encountered an error retrieving the value
or if the value was not the right length, in code that was clearly
cut-and-pasted from the other branch of an "if" statement where a
specific entry was requested on the command line.  Print the name
of the entry with the problem as was apparently intended.

Change-Id: Idc2d3c9b6049e5d3b0eb302353a68bcfdad6a90d
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5174
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoafsd: look in the right place for -splitcache argument
Garrett Wollman [Sun, 7 Aug 2011 04:35:36 +0000]
afsd: look in the right place for -splitcache argument

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>

9 years agoafs_pioctl: don't use cell uninitialized in PGetTokens2
Garrett Wollman [Sun, 7 Aug 2011 04:09:33 +0000]
afs_pioctl: don't use cell uninitialized in PGetTokens2

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>

9 years agobutc: avoid freeing uninitialized pointer in writeDbDump()
Garrett Wollman [Sun, 7 Aug 2011 03:55:50 +0000]
butc: avoid freeing uninitialized pointer in writeDbDump()

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>

9 years agopam: stop building it wrong
Derrick Brashear [Wed, 3 Aug 2011 17:05:27 +0000]
pam: stop building it wrong

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>

9 years agopam: clean up unused variables and prototyping
Derrick Brashear [Wed, 3 Aug 2011 17:56:08 +0000]
pam: clean up unused variables and prototyping

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>

9 years agorx: avoid nat ping until connection is attached
Derrick Brashear [Mon, 1 Aug 2011 20:38:46 +0000]
rx: avoid nat ping until connection is attached

drop nat pings on connections we haven't talked on yet

Change-Id: Ie333d50a090f1f086c958440cc37849413442dea
Reviewed-on: http://gerrit.openafs.org/5130
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agobutc: avoid testing stack garbage; remove dead initializer
Garrett Wollman [Sun, 7 Aug 2011 03:49:10 +0000]
butc: avoid testing stack garbage; remove dead initializer

"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>

9 years agobutc: initialize startTime before it is used
Garrett Wollman [Sun, 7 Aug 2011 03:36:14 +0000]
butc: initialize startTime before it is used

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>

9 years agovos: don't free stack garbage on error
Garrett Wollman [Sun, 7 Aug 2011 03:15:14 +0000]
vos: don't free stack garbage on error

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>

9 years agolibafsauthent: Add volser and vldb
Simon Wilkinson [Wed, 3 Aug 2011 18:08:20 +0000]
libafsauthent: Add volser and vldb

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>

9 years agovolser doesn't depend on tviced, but on vlserver
Simon Wilkinson [Wed, 3 Aug 2011 17:45:01 +0000]
volser doesn't depend on tviced, but on vlserver

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>

9 years agoWindows: symlink make should translate \\afs target
Jeffrey Altman [Fri, 5 Aug 2011 02:50:03 +0000]
Windows: symlink make should translate \\afs target

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>

9 years agoWindows: adjust scache LRU postion upon deletion
Jeffrey Altman [Thu, 4 Aug 2011 21:25:01 +0000]
Windows: adjust scache LRU postion upon deletion

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>

9 years agoWindows: fix condition calls to osi_Log
Jeffrey Altman [Thu, 4 Aug 2011 21:21:59 +0000]
Windows: fix condition calls to osi_Log

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>

9 years agoWindows: LockOrderValidation memory usage optimization
Jeffrey Altman [Thu, 4 Aug 2011 21:15:16 +0000]
Windows: LockOrderValidation memory usage optimization

Instead of using malloc() and free() to allocation lock reference
structures, cache allocated objects in a free list.  This reduces
memory fragmentation.

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

9 years agoWindows: after dir enum adjust dir scache LRU
Jeffrey Altman [Thu, 4 Aug 2011 21:08:45 +0000]
Windows: after dir enum adjust dir scache LRU

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>

9 years agoWindows: use %p to print cm_scache_t pointers
Jeffrey Altman [Tue, 2 Aug 2011 22:24:56 +0000]
Windows: use %p to print cm_scache_t pointers

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

9 years agotbudb depends on tubik ...
Simon Wilkinson [Wed, 3 Aug 2011 18:07:14 +0000]
tbudb depends on tubik ...

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

9 years agoWindows: add missing dafs man pages to wix installer
Jeffrey Altman [Tue, 2 Aug 2011 01:40:25 +0000]
Windows: add missing dafs man pages to wix installer

dafileserver.html
dasalvager.html
davolserver.html

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

9 years agoWindows: conditionalize mappings of error values
Jeffrey Altman [Mon, 1 Aug 2011 15:05:51 +0000]
Windows: conditionalize mappings of error values

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>

9 years agoWindows: unified afs errors must use nt mapping
Jeffrey Altman [Mon, 1 Aug 2011 15:00:55 +0000]
Windows: unified afs errors must use nt mapping

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>

9 years agovos: spell "vldb" correctly
Derrick Brashear [Mon, 1 Aug 2011 14:58:28 +0000]
vos: spell "vldb" correctly

i'm not even going to ask.

Change-Id: I5f59177ef58d9728a516176a14e0504130f7c584
Reviewed-on: http://gerrit.openafs.org/5125
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agomacos: fix vnode finalization
Derrick Brashear [Mon, 1 Aug 2011 13:58:27 +0000]
macos: fix vnode finalization

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>

9 years agoSOLARIS: Do not release NULL root vp on unmount
Andrew Deason [Fri, 29 Jul 2011 21:44:11 +0000]
SOLARIS: Do not release NULL root vp on unmount

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>

9 years agoRedHat: Return status values from client init
Will Maier [Sun, 31 Jul 2011 13:24:12 +0000]
RedHat: Return status values from client init

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>

9 years agoWindows: Do not execute tasks on deleted files
Jeffrey Altman [Fri, 29 Jul 2011 22:09:53 +0000]
Windows: Do not execute tasks on deleted files

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>

9 years agoWindows: cm_BkgDaemon should not do cm_SyncOp's job
Jeffrey Altman [Thu, 7 Jul 2011 21:51:58 +0000]
Windows: cm_BkgDaemon should not do cm_SyncOp's job

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>

9 years agoWindows: Do not release locks on deleted files
Jeffrey Altman [Fri, 29 Jul 2011 22:07:42 +0000]
Windows: Do not release locks on deleted files

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>

9 years agoman: more changes for man.3 pod files
Jeffrey Altman [Thu, 28 Jul 2011 19:07:32 +0000]
man: more changes for man.3 pod files

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>

9 years agoWindows: permit perl command to be explicitly set
Jeffrey Altman [Thu, 28 Jul 2011 19:05:28 +0000]
Windows: permit perl command to be explicitly set

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>

9 years agoman: add missing pod files to Windows makefile
Jeffrey Altman [Thu, 28 Jul 2011 19:02:14 +0000]
man: add missing pod files to Windows makefile

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>

9 years agomerge-pod changes for cygwin and MSWin32 perl
Jeffrey Altman [Thu, 28 Jul 2011 18:59:05 +0000]
merge-pod changes for cygwin and MSWin32 perl

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>

9 years agoWindows: add debugging to afskfw
Jeffrey Altman [Tue, 26 Jul 2011 21:37:37 +0000]
Windows: add debugging to afskfw

More debugging output added when a debugger is present.

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

9 years agoWindows: afskfw remove TRUE conditional
Jeffrey Altman [Tue, 26 Jul 2011 21:36:25 +0000]
Windows: afskfw remove TRUE conditional

Simply the code by removing an if(1) conditional.

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

9 years agoWindows: KFW_AFS_get_cred userrealm
Jeffrey Altman [Tue, 26 Jul 2011 21:34:52 +0000]
Windows: KFW_AFS_get_cred userrealm

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>

9 years agoWindows: afslogon start service if not started
Jeffrey Altman [Tue, 26 Jul 2011 21:32:28 +0000]
Windows: afslogon start service if not started

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>

9 years agoWindows: improve afskfw error message output
Jeffrey Altman [Tue, 26 Jul 2011 21:03:56 +0000]
Windows: improve afskfw error message output

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>

9 years agovolinfo: clean up headers
Michael Meffie [Sat, 23 Jul 2011 03:38:36 +0000]
volinfo: clean up headers

Remove unneeded includes.

Change-Id: I68514d47b1ddd4ea1d79c919635f87f6670e767f
Reviewed-on: http://gerrit.openafs.org/5098
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agolibafs: Rate-limit hard-mount waiting messages
Andrew Deason [Wed, 20 Jul 2011 21:50:52 +0000]
libafs: Rate-limit hard-mount waiting messages

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>

9 years agoutil: Don't use FT_GetTimeOfDay for MRAFS logs
Simon Wilkinson [Sun, 10 Jul 2011 12:56:21 +0000]
util: Don't use FT_GetTimeOfDay for MRAFS logs

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>

9 years agopthreaded servers: set thread names
Garrett Wollman [Mon, 18 Jul 2011 01:57:20 +0000]
pthreaded servers: set thread names

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>

9 years agolibafs: Add afs_conn refCount imbalance safeguard
Andrew Deason [Mon, 25 Jul 2011 16:12:37 +0000]
libafs: Add afs_conn refCount imbalance safeguard

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>

9 years agoFBSD: complete the build fix for 8.1 libafs
Garrett Wollman [Thu, 28 Jul 2011 04:39:52 +0000]
FBSD: complete the build fix for 8.1 libafs

Strangely enough, nosys() also needs a cast to sy_call_t *.

Change-Id: I7fee2278c228da3ddb2c3ccc9758681cd0abc01d
Reviewed-on: http://gerrit.openafs.org/5105
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoconfigure: provide some necessary prerequisites in header checks
Garrett Wollman [Thu, 28 Jul 2011 05:44:25 +0000]
configure: provide some necessary prerequisites in header checks

<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>

9 years agoconfigure: spell the "=" operator to test(1) correctly
Garrett Wollman [Thu, 28 Jul 2011 05:04:59 +0000]
configure: spell the "=" operator to test(1) correctly

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>

9 years agolibuafs: don't use a GNU-only feature in a common makefile
Garrett Wollman [Mon, 25 Jul 2011 04:50:54 +0000]
libuafs: don't use a GNU-only feature in a common makefile

$(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>

9 years agomacos: don't attempt finalize fixup on root vnode
Derrick Brashear [Tue, 26 Jul 2011 04:52:18 +0000]
macos: don't attempt finalize fixup on root vnode

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>

9 years agolibafs: Avoid duplicate afs_Analyze in bulk stat
Andrew Deason [Fri, 22 Jul 2011 21:09:52 +0000]
libafs: Avoid duplicate afs_Analyze in bulk stat

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>

9 years agovlserver: Use libcmd for command line parsing
Simon Wilkinson [Wed, 27 Apr 2011 01:37:42 +0000]
vlserver: Use libcmd for command line parsing

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>

9 years agoptserver: Use libcmd for command line parsing
Simon Wilkinson [Wed, 27 Apr 2011 01:36:15 +0000]
ptserver: Use libcmd for command line parsing

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>

9 years agoUpdate README for newly added configure switches
Russ Allbery [Sun, 24 Jul 2011 23:35:42 +0000]
Update README for newly added configure switches

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>

9 years agoClean and ignore additional build files for DocBook documentation
Russ Allbery [Sun, 24 Jul 2011 23:00:35 +0000]
Clean and ignore additional build files for DocBook documentation

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>

9 years agoFBSD: cast lkmnosys appropriately
Ben Kaduk [Sat, 23 Jul 2011 18:58:54 +0000]
FBSD: cast lkmnosys appropriately

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>

9 years agoutil: Cleanup generation of dirpath.h
Simon Wilkinson [Sun, 10 Jul 2011 12:54:20 +0000]
util: Cleanup generation of dirpath.h

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>

9 years agorx: Provide Get/SetThreadNum functions
Simon Wilkinson [Tue, 5 Jul 2011 08:17:53 +0000]
rx: Provide Get/SetThreadNum functions

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>

9 years agoklog.krb5: Don't use ubik_PR_NameToID internal func
Simon Wilkinson [Mon, 4 Jul 2011 09:03:50 +0000]
klog.krb5: Don't use ubik_PR_NameToID internal func

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>

9 years agoubik: ServerInitCommon is an internal function...
Simon Wilkinson [Sun, 10 Jul 2011 12:53:15 +0000]
ubik: ServerInitCommon is an internal function...

... so make it static

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

9 years agobozo: Don't initialise variables unecessarily
Simon Wilkinson [Tue, 15 Jun 2010 17:18:30 +0000]
bozo: Don't initialise variables unecessarily

Don't initialise variables to NULL 3 lines before we assign malloc
results to them.

Caught by clang-analyzer

Change-Id: Ic0f2fc56fe6ce39411c4cd48ea0a0b955b3e0f19
Reviewed-on: http://gerrit.openafs.org/5080
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoviced.c: Don't store results of reads unecessarily
Simon Wilkinson [Tue, 15 Jun 2010 17:15:34 +0000]
viced.c: Don't store results of reads unecessarily

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>

9 years agolibcmd: Don't increment array then discard result
Simon Wilkinson [Tue, 15 Jun 2010 17:09:53 +0000]
libcmd: Don't increment array then discard result

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>

9 years agolibcmd: Don't store values that we don't need
Simon Wilkinson [Tue, 15 Jun 2010 17:08:50 +0000]
libcmd: Don't store values that we don't need

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>

9 years agoptserver: Don't print undefined value
Simon Wilkinson [Tue, 15 Jun 2010 15:51:42 +0000]
ptserver: Don't print undefined value

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>

9 years agolibafs: Remove unused volume "states" flags
Andrew Deason [Wed, 20 Jul 2011 20:33:41 +0000]
libafs: Remove unused volume "states" flags

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>

9 years agoaklog: check ccache errors in get_user_realm
Derrick Brashear [Fri, 22 Jul 2011 19:39:49 +0000]
aklog: check ccache errors in get_user_realm

if there's an error finding the specified ccache, don't
bother continuing.

Change-Id: I344a06c66c426c5d14dbe08ce9da0431f095349d
Reviewed-on: http://gerrit.openafs.org/5069
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agomacos: avoid KLRenewInitialTickets crash in Lion
Derrick Brashear [Fri, 22 Jul 2011 18:24:08 +0000]
macos: avoid KLRenewInitialTickets crash in Lion

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>

9 years agorpm: remove postinstall message from openafs-client
Andy Cobaugh [Fri, 15 Jul 2011 16:06:12 +0000]
rpm: remove postinstall message from openafs-client

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>

9 years agoWindows: do not leak space allocation
Jeffrey Altman [Wed, 20 Jul 2011 22:31:17 +0000]
Windows: do not leak space allocation

smb_ReceiveNTTranCreate leaks a cm_GetSpace allocation on
error.  Don't do that.

Change-Id: I40349826f2ab229961e3c3552f66808775f0a239
Reviewed-on: http://gerrit.openafs.org/5062
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoWindows: smb_ReceiveNTTranCreate path not found
Jeffrey Altman [Wed, 20 Jul 2011 22:32:35 +0000]
Windows: smb_ReceiveNTTranCreate path not found

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>

9 years agoWindows: improve shutdown time
Jeffrey Altman [Wed, 20 Jul 2011 18:21:09 +0000]
Windows: improve shutdown time

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>

9 years agoWindows: cm_daemonCheckOfflineVol fix
Jeffrey Altman [Wed, 20 Jul 2011 18:18:25 +0000]
Windows: cm_daemonCheckOfflineVol fix

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>

9 years agoWindows: Add shutdown event log message
Jeffrey Altman [Wed, 20 Jul 2011 18:12:42 +0000]
Windows: Add shutdown event log message

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>

9 years agoWindow: breakout CM error codes into separate header
Jeffrey Altman [Wed, 20 Jul 2011 18:04:57 +0000]
Window: breakout CM error codes into separate header

Change-Id: I67be608c6cb153904fa2ca8c5ad6cbc7943064e5
Reviewed-on: http://gerrit.openafs.org/5052
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

9 years agoafsd: Add the -rxmaxfrags option
Andrew Deason [Thu, 21 Jul 2011 18:20:54 +0000]
afsd: Add the -rxmaxfrags option

Add an option to afsd to limit the number of fragments Rx will
send/receive, called -rxmaxfrags.

Change-Id: I9f0b3edd95db17f82ef8f7d1e300df4eff355172
Reviewed-on: http://gerrit.openafs.org/4899
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoFBSD: in libafs, define LIBAFSNONFS
Ben Kaduk [Wed, 20 Jul 2011 22:11:47 +0000]
FBSD: in libafs, define LIBAFSNONFS

Running 'make dest' will fail without this variable defined.

Change-Id: I7f82cb3aeae8585c68ee60b005f4ba32d44e2104
Reviewed-on: http://gerrit.openafs.org/5058
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agomacos: krb5_524 is uselessly stubbed
Derrick Brashear [Fri, 22 Jul 2011 00:30:00 +0000]
macos: krb5_524 is uselessly stubbed

from MITKerberosShim-44:
dummy(krb5_524_conv_principal, 0);
dummy(krb5_524_convert_creds, 0);

this basically logs and returns success. not helpful.
so let's just not call them.

Change-Id: I91e7113e6934c67129e61dfc84b7f0c4d110cea0
Reviewed-on: http://gerrit.openafs.org/5066
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoredhat: support epel yum configs in mockbuild
Derrick Brashear [Wed, 20 Jul 2011 18:55:32 +0000]
redhat: support epel yum configs in mockbuild

epel's mock is useful in terms of config, but we need to allow
use of it. do so here. add centos6 at the same time.

Change-Id: I781fc475389c5be56aa89041b8d22b166517a3f5
Reviewed-on: http://gerrit.openafs.org/5056
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoRevert "afs: Use 64-bit inode numbers"
Andrew Deason [Tue, 19 Jul 2011 21:44:21 +0000]
Revert "afs: Use 64-bit inode numbers"

This reverts commit e1e008338639d6cc0d836ff8079e6fb42021ab9e. Using
64-bit inode numbers can make AFS largely inaccessible to 32-bit
programs that are not compiled with large file support, since the
inode number we provide is not representable in a 32-bit struct stat.
Using 64-bit inode numbers thus can break quite a few programs, and
has little benefit, so don't do it.

Change-Id: Ia482ac2864601b5c56a4259432529d14981f4a1a
Reviewed-on: http://gerrit.openafs.org/5048
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoAdd additional NEWS entries for 1.6.0pre5 through 1.6.0pre7
Russ Allbery [Tue, 19 Jul 2011 00:13:15 +0000]
Add additional NEWS entries for 1.6.0pre5 through 1.6.0pre7

Taken from the release notes.  Do a bit of minor combining of related
issues since NEWS presents these all as changes in 1.6.0.

Change-Id: I45af362948dde40772c347c9f432e59cfd86b64d
Reviewed-on: http://gerrit.openafs.org/5044
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoFBSD: update to using bsd.kmod.mk
Ben Kaduk [Tue, 21 Jun 2011 02:46:01 +0000]
FBSD: update to using bsd.kmod.mk

We have for a long time had a cobbled-together kernel module build
system that essentially copied build arguments from a kernel build
in an ad hoc fashion, with lots of conditionals on architecture
and OS version.  (We got it wrong, several times, too.)
Instead, use the supported mechanism for building kernel modules,
which allows us to remove a lot of code from the Makefile and gives
us some measure of future-proofing.

FIXES 127578

Change-Id: Ibccea4507f57660becb4fb39a57b50c15ea4cb07
Reviewed-on: http://gerrit.openafs.org/5042
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agolibafs: switch to hardcoded source names with CRULE
Ben Kaduk [Sun, 17 Jul 2011 20:24:12 +0000]
libafs: switch to hardcoded source names with CRULE

Most of the userspace tree uses AFS_CCRULE for how to compile
things.  We cannot use this directly for libafs, since in the
general case kernel and userland code may need to be treated
with an entirely different compiler and compiler options.
Switching libafs fully to a (e.g.) LIBAFS_CCRULE would be a substantial
amount of work, and require a lot of testing.  However, we can
stop passing -c $? (the out-of-date sources) in CRULE_{NO,}OPT
and add the source file after each invocation of the CRULEs,
an incremental step towards LIBAFS_CCRULE.
This has the extra advantage of not causing issues when integrating
with kernel module build systems that automatically add dependencies
to all object file targets. (In such cases, $? expands to multiple files
and 'gcc -o foo.o -c' bails out.)

Most of this change was automatically generated from the following
awk script:
==========
/[a-zA-Z_0-9].o:/ {path=$2;}
/^      \$\(CRULE_/ {print $0,path;}
!/^     \$\(CRULE_/ {print;}
==========

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

9 years agovlserver: Handle logging of non-rxkad classes
Simon Wilkinson [Mon, 23 May 2011 06:40:14 +0000]
vlserver: Handle logging of non-rxkad classes

Expand the 'rxinfo' function so that it is not rxkad specific, and
add the framework to allow other security classes to be added to it.

Change-Id: Idb514be6aafbc69154a7aba4b0ece3330b8b3aed
Reviewed-on: http://gerrit.openafs.org/5031
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agotests: Fix error in man check specification
Simon Wilkinson [Fri, 15 Jul 2011 10:50:09 +0000]
tests: Fix error in man check specification

The kas manual test is kauth/kas-man, not kauth/kas

Change-Id: I714cbbf78af7f8e99ec52d9c0f173df3f6ae18c5
Reviewed-on: http://gerrit.openafs.org/5030
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agotests: Add tests for the vlserver
Simon Wilkinson [Tue, 31 May 2011 08:30:41 +0000]
tests: Add tests for the vlserver

Add some very simple vlserver tests

Change-Id: I862d3a86857dc70f0421f4887d1fc4d047c57909
Reviewed-on: http://gerrit.openafs.org/5029
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoFBSD: use better casts in vop_advlock
Ben Kaduk [Tue, 21 Jun 2011 02:35:08 +0000]
FBSD: use better casts in vop_advlock

In the bsd.kmod.mk world, the compiler bails when we cast a pointer
directly to int.  Cast through intptr_t as the supported mechanism.
On amd64, this loses bits, but since this instance is just attempting
to use the value as a unique handle, it is probably okay for now.
However, it should be addressed more properly eventually, when
this locking implementation sees wider use.

Change-Id: I4fe8084c14a97dc4efc8d74e9971b1540c028e40
Reviewed-on: http://gerrit.openafs.org/5034
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoFBSD: Use correct path for ufsmount.h include
Ben Kaduk [Sat, 25 Jun 2011 04:33:41 +0000]
FBSD: Use correct path for ufsmount.h include

The two lines above it already used </ufs/ufs/...> correctly.
In the bsd.kmod.mk world, this will let us get rid of some
more symlink hackery in libafs, since the system's '@' symlink
will point to the system headers directly.

Change-Id: I97dd779c2c7a119f51972b02e185a17264911151
Reviewed-on: http://gerrit.openafs.org/5036
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoFBSD: cast pointers appropriately
Ben Kaduk [Tue, 21 Jun 2011 02:36:39 +0000]
FBSD: cast pointers appropriately

Since the bsd.kmod.mk build uses -Werror.

Change-Id: I4bc34477a36ae8946272c1830080ddd9add5cd00
Reviewed-on: http://gerrit.openafs.org/5035
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoFBSD: Remove include directive for nonexistent file
Ben Kaduk [Tue, 21 Jun 2011 02:34:41 +0000]
FBSD: Remove include directive for nonexistent file

In the bsd.kmod.mk world, this becomes a fatal error.

Change-Id: I14315982fac48bf392d9f3a06422f5c4707bc3b9
Reviewed-on: http://gerrit.openafs.org/5033
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoFix broken make dest rules
Simon Wilkinson [Sat, 16 Jul 2011 08:07:57 +0000]
Fix broken make dest rules

Commit ffb6864f0f60113d125527feacbd6d20a8121e2d is missing some
semi-colons in assorted dest rules, which breaks the make dest target.

Change-Id: Ie6f88878604f1043256f1683e1d228e16d568f50
Reviewed-on: http://gerrit.openafs.org/5037
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoaudit: remove uneeded strncpy
Michael Meffie [Thu, 14 Jul 2011 16:02:21 +0000]
audit: remove uneeded strncpy

In this caller to krb_realms, when no realms names are returned the
number of local realms is correctly set to zero, however the first
local realm buffer is filled with a placeholder string which is
not used.  Remove the uneeded strncpy, which also makes this
section of code consistent with afs_is_foreign_ticket().

This section of code is duplicated by afs_is_foreign_ticket() and
should be consolidated in a subsequent patch.

Change-Id: I48f84934e7321769eebaf80c83b2c100fd026a6a
Reviewed-on: http://gerrit.openafs.org/5020
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoUKERNEL: Avoid using parameters named "new"
Andrew Deason [Tue, 12 Jul 2011 05:11:17 +0000]
UKERNEL: Avoid using parameters named "new"

Alter the prototypes in afs_usrops.h to avoid using the name "new", in
order to make the header usable by C++ code.

Change-Id: I21165b5c1e33e9229172d9f8e797d65fc954bb77
Reviewed-on: http://gerrit.openafs.org/5038
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

9 years agoutil: clean up two #ifs
Garrett Wollman [Wed, 13 Jul 2011 18:20:17 +0000]
util: clean up two #ifs

Use defined(...) in two instances to avoid warnings.

Change-Id: I0a574283e2384c7cfb2f58884570e78e3fed3bc6
Requested-by: Simon Wilkinson
Reviewed-on: http://gerrit.openafs.org/5005
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

9 years agoutil: try again to satisfy the gatekeepers
Garrett Wollman [Fri, 15 Jul 2011 05:00:28 +0000]
util: try again to satisfy the gatekeepers

Apply a two-clause BSD license to src/util/pthread_threadname.c. Note
that the claim of copyright in this file refers to the derivative work
consisting of the original code combined with the text of the license.

Change-Id: Id75badee03cb85a23778088aa9cb49d8c92eb5d0
Reviewed-on: http://gerrit.openafs.org/5025
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>