openafs.git
14 years agoLinux: Handle llseek failure
Simon Wilkinson [Mon, 25 Jan 2010 00:02:11 +0000]
Linux: Handle llseek failure

If llseek fails, then we return immediately, potentially leaving the
wrong address space configured for this process, and without resetting
the processes saved limits.

Fix this by creating a common exit point for osi_rdwr, and using it.

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

14 years agounix 1.5.70 openafs-devel-1_5_70
Derrick Brashear [Sun, 24 Jan 2010 15:09:41 +0000]
unix 1.5.70

make 1.5.70 for unix

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

14 years agoWindows: 1.5.70
Jeffrey Altman [Fri, 22 Jan 2010 19:24:17 +0000]
Windows: 1.5.70

ChangeLog updates

Version number updates

Change-Id: I16fd2d2ef507cc862417eef8d221ea5ba58567a1
Reviewed-on: http://gerrit.openafs.org/1146
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoLinux Keyrings: don't ignore error code from session keyring creation
Marc Dionne [Sat, 23 Jan 2010 01:03:58 +0000]
Linux Keyrings: don't ignore error code from session keyring creation

Creating a session keyring can fail, for instance if the user's
keyring quotas are reached (number of keys/keyrings or data size).

Instead of ignoring errors, return them so they can be passed back
to the caller.

FIXES 126230

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

14 years agoAdd missing dependencies for pagsh in Makefile
Marc Dionne [Sat, 23 Jan 2010 01:05:34 +0000]
Add missing dependencies for pagsh in Makefile

Make pagsh and pagsh.krb depend on the libraries that are used to
link them, and on the source file pagsh.c
Without this dependency, modifying pagsh.c would not trigger a
rebuild of the executable.

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

14 years agoDon't throw data away in afs_StoreMini
Simon Wilkinson [Fri, 22 Jan 2010 20:11:21 +0000]
Don't throw data away in afs_StoreMini

afs_StoreMini had some interesting error handling. Instead of returning
the error code from StoreData, it would return the error from EndCall,
potentially masking the StoreData error. When it encountered an error
it would discard all of the cached data.

StoreMini's only caller is afs_StoreAllSegments. If StoreAllSegments is
called from DoPartialWrite, then it squashes the error code. This
combination could lead to the user's data being disposed of, without an
error being reported.

Fix all of this by not invalidating segments in StoreMini. Make
StoreMini static to make it clear its only used by StoreAllSegments, and
fix the error handling in StoreMini so that StoreData errors always take
priority.

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

14 years agoRevert "Fix afs_AccessOK for dropbox case"
Simon Wilkinson [Fri, 22 Jan 2010 21:50:44 +0000]
Revert "Fix afs_AccessOK for dropbox case"

This reverts commit 3f89c0feae89e9a255afb8a7f08995412a3f1b79.

That change broke the expected semantics of a drop box, by
opening up read() access to users to whom it would usually be
denied. The expected dropbox behaviour is that whilst anyone
can write a file there, only those who are specifically given
r permissions may read it.

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

14 years agoabstract rx if structure access
Derrick Brashear [Thu, 14 Jan 2010 20:41:23 +0000]
abstract rx if structure access

change things to use accessor macros styled after the mac KPI
where feasible, and make access consistent.

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

14 years agoEnable weak enctypes for klog.krb5 if supported by Kerberos
Russ Allbery [Fri, 22 Jan 2010 18:59:14 +0000]
Enable weak enctypes for klog.krb5 if supported by Kerberos

The same as cb4b62a40352ccebae3a299f4327fa70fc7a0c5c, but for klog.krb5.

Current versions of both MIT Kerberos and Heimdal disable DES enctypes
by default, but DES enctypes are still required for AFS service tickets.
Probe for either krb5_allow_weak_crypto() (MIT Kerberos 1.8) or
krb5_enctype_enable() (Heimdal) and, if found, call them to enable DES
enctypes.  If neither is found, assume that the Kerberos libraries are
old enough that DES is enabled by default.

Change-Id: I99c93621c847f6edcc485207f5b6b99b2370b347
Reviewed-on: http://gerrit.openafs.org/1144
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoFix afs_AccessOK for dropbox case
Andrew Deason [Fri, 22 Jan 2010 01:42:33 +0000]
Fix afs_AccessOK for dropbox case

afs_AccessOK did not check for if we have 'i' rights on a directory, nor
if we were the owner of a file, if we were only checking PRSFS_READ or
PRSFS_WRITE. Thus, it does not correctly address the 'dropbox'
permissions case (if you are the owner of a file and have insert
permissions, you get implicit 'r' and 'w').

Fix this to check for 'i' and ownership when we need to, so the dropbox
special-case check works as intended.

FIXES 126216

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

14 years agoEnable weak enctypes for aklog if supported by Kerberos
Russ Allbery [Thu, 21 Jan 2010 23:41:49 +0000]
Enable weak enctypes for aklog if supported by Kerberos

Current versions of both MIT Kerberos and Heimdal disable DES enctypes
by default, but DES enctypes are still required for AFS service tickets.
Probe for either krb5_allow_weak_crypto() (MIT Kerberos 1.8) or
krb5_enctype_enable() (Heimdal) and, if found, call them to enable DES
enctypes.  If neither is found, assume that the Kerberos libraries are
old enough that DES is enabled by default.

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

14 years agoafs_vnop_attrs: syntax error in conditional expression
Marc Dionne [Thu, 21 Jan 2010 22:53:42 +0000]
afs_vnop_attrs: syntax error in conditional expression

Add a missing && in a 2-line condition.
Not sure how this could have compiled successfully on the affected
platforms.

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

14 years agoWindows: AFS_AFSDB_ENV preprocessor symbol no longer exists
Jeffrey Altman [Fri, 22 Jan 2010 01:05:25 +0000]
Windows: AFS_AFSDB_ENV preprocessor symbol no longer exists

The decision to add AFS_AFSDB_ENV to make code consistent was
a mistake.  The preprocessor symbol no longer exists.  AFSDB
is broken in 1.5.69.

Change-Id: I7ea147b824f3a67e2039abee8b2513af175fcc5d
Reviewed-on: http://gerrit.openafs.org/1142
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoWindows: add build and clean rule for bc.h
Jeffrey Altman [Thu, 21 Jan 2010 22:38:43 +0000]
Windows: add build and clean rule for bc.h

Add a dependency rule to build bc.h before it is installed

Add cleanup rules to delete bc.h and other installed files.

Change-Id: I9a40fd64aff048bfc87b9fd823ae7499816cb3e5
Reviewed-on: http://gerrit.openafs.org/1139
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoWindows: Windows v6.0 SDK does not define __RPC__out
Jeffrey Altman [Thu, 21 Jan 2010 21:43:18 +0000]
Windows: Windows v6.0 SDK does not define __RPC__out

The Windows v6.0 SDK does not define __RPC__out in the rpcsal.h
header file.  The preprocessor symbol was added in the v6.0A SDK
update.  In case the v6.0 SDK is used with the 6000 WDK, add a
symbol declaration.

Change-Id: Iecce566e906977f41be00efb458753acd09f7949
Reviewed-on: http://gerrit.openafs.org/1138
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoUndo labeling of elements of rx structures for Windows
Jeffrey Altman [Thu, 21 Jan 2010 20:34:49 +0000]
Undo labeling of elements of rx structures for Windows

Change I006bbbdb8923dbb72a97fde931a1b23e303375c2 broke
the Windows build.  Restore the unlabled assignments for
Windows since Windows always uses the AFS xdr implementation.

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

14 years agoInstall bucoord/bc.h to permit Windows to build
Jeffrey Altman [Thu, 21 Jan 2010 20:30:23 +0000]
Install bucoord/bc.h to permit Windows to build

Change  I0a0ae92d3c7ba75e4a331bf59ea9c031763cc704
broke the Windows build.   Fix it.

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

14 years agoWarning cleanup: implicit function declarations in butc and bucoord
Marc Dionne [Thu, 21 Jan 2010 02:03:08 +0000]
Warning cleanup: implicit function declarations in butc and bucoord

Cleanup some prototype related warnings under bucoord and butc:
- Copy a few prototypes from bucoord_internal.h to bucoord_prototypes.h,
since they are used in other source directories
- Install bc.h under include/afs, and include it in tcmain.c
- Include bucoord_prototypes.h in tcmain.c
- Add a prototype for GetResponseKey
- Remove warning inhibition for tcmain.c, and entry in README.WARNINGS
- Remove warning inhibition for bucoord/dump.c (no entry in README)

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

14 years agosimplify ufs cache mechanisms available
Derrick Brashear [Wed, 20 Jan 2010 16:15:29 +0000]
simplify ufs cache mechanisms available

instead of having use_fh for linux, vnode_path for solaris and darwin,
use the same mechanism for both. for darwin/solaris we cache the path
(tested via gop_lookupname) instead of an fh, freeing the path at
shutdown.

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

14 years agobatch panic decoding for MacOS
Derrick Brashear [Tue, 19 Jan 2010 06:29:11 +0000]
batch panic decoding for MacOS

add support for decoding (nominally) any panic for MacOS. Limited testing.
Requires hdutil from http://www.dementia.org/~shadow/dmgutil-0.1.tar.gz
to extract files from DMGs.

now with support for cross-version debugging, when run on 10.6 (e.g. with kextutil)
Change-Id: I5d9db005e3014e22f916070f8af25271a28615ea
Reviewed-on: http://gerrit.openafs.org/1125
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agomacos set don't backup attribute on cache files
Derrick Brashear [Tue, 19 Jan 2010 00:25:02 +0000]
macos set don't backup attribute on cache files

hint to time machine that cache files should not be backed up

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

14 years agoFix so that UKERNEL can keep using system xdr
Simon Wilkinson [Wed, 20 Jan 2010 13:13:58 +0000]
Fix so that UKERNEL can keep using system xdr

This fix modifies the way that the RX XDR operations are declared
so that UKERNEL can continue using the system provided XDR glue,
rather than using our own (as is the case in userspace, and in
normal kernel modules)

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

14 years agoLabel elements of rx structures
Simon Wilkinson [Sun, 17 Jan 2010 18:34:03 +0000]
Label elements of rx structures

Label all of the assignments to the xdr_ops structure. This allows
the rec, stdio and mem variants to continue to function, even when
the ordering of the elements has changed in the header.

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

14 years agoAvoid executable headers in local include tree
Russ Allbery [Wed, 20 Jan 2010 01:43:35 +0000]
Avoid executable headers in local include tree

sys_prototypes.h, afs_AdminErrors.h, and afs_Admin.h were being installed
into include/ in the build tree via ${INSTALL} instead of ${INSTALL_DATA}.
rx_prototypes.h was executable in the repository.  Install header files
non-executable and make rx_prototypes.h non-executable for cleanliness.

Discovered by Lintian because the executable permissions were duplicated
by make libafs_tree.

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

14 years agoWindows: Help text update for Network Identity Manager Provider openafs-devel-1_5_69
Jeffrey Altman [Tue, 19 Jan 2010 03:23:54 +0000]
Windows: Help text update for Network Identity Manager Provider

Update the NetIdMgr provider help text to better describe its
functionality.  (Or at least not be incorrect.)

Change-Id: I5d6b18f15cab7c48751666e754223ee68fb18d11
Reviewed-on: http://gerrit.openafs.org/1124
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoWindows: Add a context menu for the AFS icon
Asanka Herath [Mon, 18 Jan 2010 21:47:31 +0000]
Windows: Add a context menu for the AFS icon

The OpenAFS plug-in for Network Identity Manager displays an icon
in the notification area that displays status information about
the AFS service and tokens.  Add a context menu to the icon so
that users can open the NIM application and get help for the
plug-in from the notification icon.

Change-Id: I704934b4f4eab72a18c54ef2a7a7dc3ca248ba78
Reviewed-on: http://gerrit.openafs.org/1121
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoWindows: Version number update for 1.5.69
Jeffrey Altman [Sat, 16 Jan 2010 16:07:23 +0000]
Windows: Version number update for 1.5.69

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

14 years agoWindows: ChangeLog for 1.5.69
Jeffrey Altman [Sat, 16 Jan 2010 16:05:57 +0000]
Windows: ChangeLog for 1.5.69

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

14 years agomake 1.5.69 for unix
Derrick Brashear [Tue, 19 Jan 2010 00:59:28 +0000]
make 1.5.69 for unix

set version number for unix

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

14 years agocreate debugging kext package for MacOS
Derrick Brashear [Sun, 17 Jan 2010 06:10:28 +0000]
create debugging kext package for MacOS

this creates and installs a debugging kext package for macos. it also
always installs the decode-panic script (which can be used even without
the debug kext)

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

14 years agoMore pam warning cleanups - test_pam.c
Marc Dionne [Sat, 16 Jan 2010 22:40:52 +0000]
More pam warning cleanups - test_pam.c

Clear up a few more warnings in the pam code.  The changes here
are very similar to the ones in the previous patch and use
the same configure test:
- use PAM_CONST to conditionally declare pam_message as const
- cast a few arguments to putenv, which expects a non-const pointer

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

14 years agoup.c: remove unused variable pageSize
Marc Dionne [Sat, 16 Jan 2010 21:29:10 +0000]
up.c: remove unused variable pageSize

Variable pageSize is declared and set to the system page size
using getpagesize(), but the value is not used anywhere.

getpagesize() doesn't necessarily have a prototype declared in
unistd.h with recent glibc, which can generate a new warning and
trip up an enabled-checking build.

Instead of trying to put in a workaround, just remove the unused variable.

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

14 years agouss: Fix IP address parsing and cleanup warnings
Marc Dionne [Sat, 16 Jan 2010 23:57:24 +0000]
uss: Fix IP address parsing and cleanup warnings

In uss_vol_GetServer(), the IP address octets are scanned into "char"
variables, and later cast to afs_int32 to build the address.
sscanf gives warnings because it's expecting an int pointer, and
testing shows that this code doesn't work as expected - the first
3 octets are always parsed as 0.

Use afs_int32 variables instead, which works, eliminates warnings and
simplifies the code.

Note that this code does not seem to be reachable currently.
It was probably meant to be used by planned additional uss commands.

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

14 years agoWindows: Query the MTU value from the registry
Asanka Herath [Fri, 15 Jan 2010 20:39:12 +0000]
Windows: Query the MTU value from the registry

The syscfg_GetIFInfo() call uses the interface info returned by
GetAdaptersAddresses().  Also manually query the MTU value in the
registry for any interfaces bound to the same adapter and use the
smallest such MTU as the value returned by syscfg_GetIFInfo().

Change-Id: I8a1d487b51f6674ff6ebbf6b1f20d37b1e278279
Reviewed-on: http://gerrit.openafs.org/1105
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoDon't double free call structure
Simon Wilkinson [Sat, 16 Jan 2010 15:35:34 +0000]
Don't double free call structure

If the rx_Read() of the number of bytes in the FetchData64 response
fails, then it sets code, and disposes of the call structure. However,
the length safety check that was added in
c7b92a3018044f7aca4d9a77644e5c06ef64d1e9 executes regardless of whether
code is set, and the call has already been freed. So we end up calling
rx_Error with a NULL call structure, and panic.

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

14 years agoLinux: Add missing prototype
Simon Wilkinson [Sat, 16 Jan 2010 02:15:36 +0000]
Linux: Add missing prototype

6e65ffbb6c520bf1c28356206410363d8eb36d78 added osi_get_group_pag.
On most platforms this is static, but on Linux it's provided by
the OSI layer. Add a prototype so the compiler doesn't go boom.

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

14 years agoUnix CM: Fix negative file length case, again
Simon Wilkinson [Sat, 16 Jan 2010 02:09:34 +0000]
Unix CM: Fix negative file length case, again

As originally noted in f6f9ee5402f1718f330a00ec89fb34b05c3cd360
some fileservers return a negative length, typically when a client
is attempting to fetch data that is past the extents of the file,
the CM needs to retain this negative length, and handle it correctly.

c7b92a3018044f7aca4d9a77644e5c06ef64d1e9 added safety checks for
the fileserver returning a length larger than that asked for by
the client. Sadly, this check does a comparison between a
signed, and an unsigned, variable. This leads to it incorrectly
classifying negative responses as being too large.

Add a cast, and a comment, to fix this.

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

14 years agoRx: Correct AFS_NT40_ENV rx_GetIFInfo max MTU assignments
Jeffrey Altman [Fri, 15 Jan 2010 14:06:05 +0000]
Rx: Correct AFS_NT40_ENV rx_GetIFInfo max MTU assignments

On UNIX, the rx library values for rx_maxReceiveSize and
rx_MyMaxSendSize are sent by the cache manager directly.
In Windows, they are set by rx_GetIFInfo() which had two
errors.

(1) The comparison of rx_maxReceiveSize and maxsize were
    reversed which prevented rx_maxReceiveSize from ever
    being set to the interface MTU.

(2) rx_MyMaxSendSize was never assigned a value.

As a result, two problems occurred.

(1) The remote peer was never told about the local MTU.

(2) The local peer ignores the MTU.

From 1.3.60 to 1.5.33, OpenAFS for Windows installers
provided a registry default RxMaxMTU of 1260.  This caused
the cache manager to call rx_SetMaxMTU() which in turn set
both rx_maxReceiveSize and rx_MyMaxSendSize in effect
masking these errors.

Change-Id: Ib05927d7985052e233ff6f4bd170a939eb05c320
Reviewed-on: http://gerrit.openafs.org/1107
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoRx: Do not drop call lock in rx_WriteProc* and rx_ReadProc*
Jeffrey Altman [Fri, 15 Jan 2010 14:18:50 +0000]
Rx: Do not drop call lock in rx_WriteProc* and rx_ReadProc*

rx_WriteProc and rx_ReadProc has special fast logic that
handles the most frequent case.  This code was called
without obtaining the call lock. However, each of these functions
must obtain the call lock for the queue_IsNotEmpty() test and
must re-obtain the call lock if the rxi_XXX variant is required.
Dropping the lock and re-obtaining it is more expensive than
holding it across the memcpy.  Therefore, we shouldn't drop the
lock until we are done.

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

14 years agoRx: Remove last remnants of DJGPP support
Jeffrey Altman [Fri, 15 Jan 2010 14:00:41 +0000]
Rx: Remove last remnants of DJGPP support

DJGPP code just clutters the AFS_NT40_ENV specific code
but is never built.

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

14 years agosrc/pam warning fixes
Marc Dionne [Thu, 14 Jan 2010 23:56:49 +0000]
src/pam warning fixes

The second parameter to pam_conv() should be a const pointer on
recent systems.  Make it so to eliminate a couple of warnings.
A configure test is added to deal with some systems where pam_conv()
might not be const.

Cast a few assignments to cell_ptr in afs_auth.c and afs_setcred.c
since the argv parameter is const.

Change-Id: I5757310c94a6f26ca7dab656edaa416d16e32e2a
Reviewed-on: http://gerrit.openafs.org/847
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agoFix typo in AdminGuide
Asanka Herath [Fri, 15 Jan 2010 00:15:03 +0000]
Fix typo in AdminGuide

</pare> -> </para>

Change-Id: If0f8183f59f038b1b5e033d5ebd2607b5091f6da
Reviewed-on: http://gerrit.openafs.org/1103
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>

14 years agovolmonitor keep vtrans lock
Dan Hyde [Wed, 13 Jan 2010 19:38:47 +0000]
volmonitor keep vtrans lock

VolMonitor must maintain the VTRANS lock the whole time it is walking
the allTrans list.  Failure to do so can cause core dumps trying to
access memory that has already been free'd.

Two versions of this change were coded and tested.  The other version
used the VTRANS lock only around a THOLD, but needed a TRELE, too.
Timing tests were run counting the number of vos status, vos listvol,
and vos backupsys operations that could be performed during a fixed
number of vos status operations.  The THOLD/TRELE version caused other
vos operations to run about 5% slower.

FIXES 126110

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

14 years agoKernel is always defined
Simon Wilkinson [Tue, 17 Nov 2009 20:46:17 +0000]
Kernel is always defined

When we build the kernel module, either in the real or the ukernel
case, KERNEL is defined. So, remove the #ifdefs around our locking
primitives, so that things are a little bit clearer.

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

14 years agoMove GLOCK initialisation to platform directories
Simon Wilkinson [Tue, 17 Nov 2009 19:52:15 +0000]
Move GLOCK initialisation to platform directories

Rework the GLOCK initialisation code so that it's moved out into
platform directories, rather than all being done in osi_Init.

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

14 years agorewrite afs_MemWriteBlk() using afs_MemWritevBlk()
Chas Williams [Tue, 5 Jan 2010 00:22:19 +0000]
rewrite afs_MemWriteBlk() using afs_MemWritevBlk()

this avoids the code duplication of extending/shrinking cache entries

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

14 years agoQuick fix for readpages when using memcache
Chas Williams [Tue, 5 Jan 2010 00:18:36 +0000]
Quick fix for readpages when using memcache

Just don't do readpages if we're using memcache

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

14 years agoafsd: decprecate -mem_alloc_sleep flag (and related code)
Chas Williams - CONTRACTOR [Thu, 7 Jan 2010 23:07:43 +0000]
afsd: decprecate -mem_alloc_sleep flag (and related code)

On most platforms, afs_osi_Alloc_NoSleep() is already afs_osi_Alloc().
I have tested this on Solaris (the major exception) and haven't seen
any problems.

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

14 years agoAlways check VInitVolumePackage2 return code
Andrew Deason [Mon, 11 Jan 2010 19:36:32 +0000]
Always check VInitVolumePackage2 return code

Some programs were not checking the return code of VInitVolumePackage2.
Although some programs do not care so much if we fail to properly init
the volume package (SYNC debug tools), at the very least log/print an
error, so it doesn't silently fail.

Other programs are changed to exit when VInitVolumePackage2 fail, so
e.g. salvages don't accidentally cause corruption on 'logging'-mounted
UFS partitions.

In any case, ensure the return code is always checked anywhere it is
called.

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

14 years agoRemove weekly bosserver restarts
Simon Wilkinson [Wed, 13 Jan 2010 17:28:24 +0000]
Remove weekly bosserver restarts

Change the default so new installations of the bosserver have
no weekly restarts. Update the manpage and XML documentation to
reflect this change.

FIXES 126138

Change-Id: Ic22b750a602f6d2a22be881f5e1b04cd4fa132ae
Reviewed-on: http://gerrit.openafs.org/1097
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agoLinux: Rework PAG to group conversions
Simon Wilkinson [Sat, 19 Dec 2009 23:58:54 +0000]
Linux: Rework PAG to group conversions

The change to using a single group for PAGs on Linux led to a load
of special cases throughout the code. This patch moves the OS
dependent parts of this into the LINUX/ platform directory, and
rearranges that file so that there is a clear distinction between
the one and two group sections of the code.

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

14 years agoWindows: remove signed vs unsigned error in smb_Init
Jeffrey Altman [Mon, 11 Jan 2010 19:35:12 +0000]
Windows: remove signed vs unsigned error in smb_Init

Use UINT_PTR instead of INT_PTR.

LICENSE MIT

Change-Id: Id10cd7b7a18688c9eee68e3eac9c20348519fd37
Reviewed-on: http://gerrit.openafs.org/1089
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoWindows: Protect buffers in smb_WriteData from simultaneous writes
Jeffrey Altman [Mon, 11 Jan 2010 19:21:11 +0000]
Windows: Protect buffers in smb_WriteData from simultaneous writes

smb_WriteData does not properly use CM_SCACHESYNC_WRITE to
protect buffers from simultaneous writes.  Instead of simply
testing CM_SCACHESYNC_WRITE at the top of the while loop,
the flag must remain set until the entire write completes.
cm_SyncOp is now called once and cm_SyncOpDone is only called
upon final success or error.

In addition, as 'count' is unsigned, the test for count < 0
is replaced with count != 0.

LICENSE MIT

Change-Id: I82c8dc20e62079b13bf305e906f4744756aa0ac2
Reviewed-on: http://gerrit.openafs.org/1087
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoWindows: fs examine owner and group are signed
Jeffrey Altman [Mon, 21 Dec 2009 17:35:12 +0000]
Windows: fs examine owner and group are signed

Change the owner array to be signed for displaying owner
and group within fs examine output.

LICENSE MIT

Change-Id: I807e3f1b3c07eb26c1782d6b76cd49977467ce33
Reviewed-on: http://gerrit.openafs.org/1017
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoWindows: do not call cm_SearchCellByDNS if AFS_AFSDB_ENV is not defined
Jeffrey Altman [Mon, 11 Jan 2010 18:59:12 +0000]
Windows: do not call cm_SearchCellByDNS if AFS_AFSDB_ENV is not defined

cm_SearchCellByDNS is only available when AFS_AFSDB_ENV is
defined.  Do not call it when it isn't.

LICENSE MIT

Change-Id: I203ab775513bd75ff6a547c557579c0bc095d555
Reviewed-on: http://gerrit.openafs.org/1086
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoWindows: buf_Recycle should clean up flags and reset version
Jeffrey Altman [Mon, 11 Jan 2010 18:51:42 +0000]
Windows: buf_Recycle should clean up flags and reset version

The CM_BUF_EOF and CM_BUF_ERROR buffer flags and the
buffer dataVersion should be reset within buf_Recycle()
instead of by the caller of buf_Recycle().

LICENSE MIT

Change-Id: I643da102553200b20f5ecc23ec43974581663a8e
Reviewed-on: http://gerrit.openafs.org/1085
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoWindows: do not leak scp->dirlock if cm_BPlusDirBuildTree fails
Jeffrey Altman [Sat, 9 Jan 2010 05:26:37 +0000]
Windows: do not leak scp->dirlock if cm_BPlusDirBuildTree fails

In cm_BeginDirOp, the scp->dirlock would be leaked if
cm_BPlusDirBuildTree() failed.   This would either result in
a panic later on if lock order validation is active; or as
an inability to process subsequent requests on the directory.

LICENSE MIT

Change-Id: I03afd0c9e6296c0f43ae39e5a7b1ff29a1619a43
Reviewed-on: http://gerrit.openafs.org/1083
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoWindows: alter nmtest CreateFile modes
Jeffrey Altman [Mon, 21 Dec 2009 17:29:10 +0000]
Windows: alter nmtest CreateFile modes

Change -r to open the file for FILE_SHARE_READ

Change -w to open the file for FILE_SHARE_WRITE

Change -w to open the file twice.  Once for sequential access
and once for random access.

LICENSE MIT

Change-Id: I295a7e7408e7e7eac06901108a726fe9e94bf18f
Reviewed-on: http://gerrit.openafs.org/1016
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoWindows: return ENOMEM from cm_BPlus functions on malloc failure
Jeffrey Altman [Tue, 8 Dec 2009 14:38:53 +0000]
Windows: return ENOMEM from cm_BPlus functions on malloc failure

There are several cm_BPlus functions that do not return
an error code on malloc failure.

LICENSE MIT

Change-Id: I3a3d78cc6d6844c78e51fa81ebf330f5af88a7a5
Reviewed-on: http://gerrit.openafs.org/900
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoUse dget_parent to handle getting inode of parent
Simon Wilkinson [Sun, 22 Nov 2009 23:31:00 +0000]
Use dget_parent to handle getting inode of parent

We can't safely do dp->d_parent->d_inode to access the parent inode
of a given dentry. Instead, use dget_parent() to get safely get a
reference on the parent dcache, and access the inode using that
reference. Dispose of this reference with dput() as appropriate.

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

14 years agofreebsd: CM changes targeting RELENG_8
Matt Benjamin [Tue, 5 Jan 2010 02:31:27 +0000]
freebsd:  CM changes targeting RELENG_8

Force all vnodes onto the fs mount queue when allocated.  This fixes
a long-standing vnode recycling problem.  Don't call vgone() on a vnode
whose refcount is 0.  Always destroy vnodes in VOP_RECLAIM.  This is work
in progress towards fixing old reclaim bug mentioned in Rees comment.
Hold vnode returned from gop_lookupname_user in afs_pioctl_syscall,
to avoid it going inactive before we're finished.  Also unlock it if
necessary.  Don't use custom vop_lock impl when AFS_FBSD80_ENV.  Remove
duplicate conditional code in vnode pretty-print (old cruft).  Also don't
format fid members as hex. Revert vn_lock exclusve in osi_VM_StoreAllSegments
(fixes deadlock introduced by me in a 2009 changeset).  Remove unused
variables in osi_VM_StoreAllSegments.

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

14 years agoDAFS: avoid saving fileserver state when panicing
Andrew Deason [Thu, 17 Dec 2009 19:59:57 +0000]
DAFS: avoid saving fileserver state when panicing

When ShutDownAndCore is called with dopanic=1, avoid trying to save
fileserver state. When we are panic'ing it is very possible that the
thread that called ShutDownAndCore is one of the background threads we
are waiting for, or that the calling thread is holding H_LOCK. Since we
are panicing, the fileserver state is probably not consistent anyway, so
just avoid trying to save state altogether, and avoid a possible
deadlock.

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

14 years agoDAFS: Allow non-fileserver to schedule salvages
Andrew Deason [Fri, 6 Nov 2009 20:05:16 +0000]
DAFS: Allow non-fileserver to schedule salvages

Allow non-fileserver programs to schedule salvages through the fileserver
via FSSYNC (VOL_FORCE_ERROR with the FSYNC_SALVAGE reason code). Also
make the volserver schedule salvages this way when it encounters the
appropriate errors.

FIXES 124484

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

14 years agoRevert "Linux: Replace invalidate_inode_pages"
Simon Wilkinson [Fri, 8 Jan 2010 17:29:16 +0000]
Revert "Linux: Replace invalidate_inode_pages"

This reverts commit 40719534d5d906f97a6ae7d28a00289270daf2a6.

RHEL5 kernels publish the invalidate_mapping_pages symbol as
EXPORT_SYMBOL_GPL, so we can't use it with them.

For now, revert this change - we can live with the deprecated
warning at present...

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

14 years agolinux kernel lacks uintptr
Derrick Brashear [Mon, 4 Jan 2010 22:57:30 +0000]
linux kernel lacks uintptr

sadly only recent kernels include uintptr_t. change the cast to use unsigned
long

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

14 years agoUNIX CM: remove the last remaining reference to afs_rxglobal_lock
Chas Williams - CONTRACTOR [Thu, 7 Jan 2010 22:48:15 +0000]
UNIX CM: remove the last remaining reference to afs_rxglobal_lock

Somehow this was missed earlier.

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

14 years agoLINUX/: ifdef for GFP_NOFS conditionals
Chas Williams - CONTRACTOR [Thu, 7 Jan 2010 22:35:20 +0000]
LINUX/: ifdef for GFP_NOFS conditionals

Remove the conditionals in the linux 2.6 tree for GFP_NOFS.  This feature
has existed since the beginning of the 2.6 tree.  This makes the code
easier to read.

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

14 years agodarwin module prototype and cleanup
Derrick Brashear [Mon, 4 Jan 2010 00:01:47 +0000]
darwin module prototype and cleanup

tidy up the osi_module and osi_misc prototyping, and the error checking
and returns at module load time. side effect: also use the afs3_syscall
prototype for the BSDs.

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

14 years agovolmonitor copy link before calling free
Dan Hyde [Wed, 6 Jan 2010 15:49:39 +0000]
volmonitor copy link before calling free

Copy tt->next before TRELE(tt) calls free(tt).

We have a core file from a VTRANS_OBJ_LOCK(tt) assert failure, with tt
pointing into glibc's malloc data structures.

Change-Id: Id52b774520c59c224b58f5d507cc490dafea5ca1
Reviewed-on: http://gerrit.openafs.org/1069
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Thomas L. Kula <tkula@umich.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoLinux: Mark our super block as not updating access time
Simon Wilkinson [Wed, 6 Jan 2010 15:43:18 +0000]
Linux: Mark our super block as not updating access time

We don't update access times, so mark our mount options as such.

FIXES 126084

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

14 years agoLinux: Use the correct ATIME flag
Simon Wilkinson [Wed, 6 Jan 2010 15:12:32 +0000]
Linux: Use the correct ATIME flag

Since Linux kernel 2.4.0, MS_NOATIME has been a super block flag,
and S_NOATIME has been the corresponding inode flag. Use the
correct flag when we're opening cache files.

FIXES 126084

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

14 years agocachemanager additional cleanup
Derrick Brashear [Tue, 5 Jan 2010 05:14:26 +0000]
cachemanager additional cleanup

integrate support for additional cachemanager cleanup. free
volume, server, unixuser objects. cleanup messages printed at shutdown.
zero/null/init additional locks and structures.

FIXES 126069

Change-Id: Id00219b679a0b4ad15ca06fc16335b0e4282e0eb
Reviewed-on: http://gerrit.openafs.org/1065
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agomacos code signature for afsd
Derrick Brashear [Mon, 4 Jan 2010 18:44:48 +0000]
macos code signature for afsd

this is a dodge; we should sign with a real certificate and distribute
signed binaries. until we more formally exist, this allows application
firewall to at least cope better with us.

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

14 years agoRefuse to attach inode partitions with UFS logging
Andrew Deason [Fri, 18 Dec 2009 18:17:41 +0000]
Refuse to attach inode partitions with UFS logging

Partitions with the 'logging' UFS mount option are known to cause
corruption when using the inode fileserver backend. So, if we detect
that we are attempting to attach a 'logging' partition, refuse to attach
it.

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

14 years agoLinux: don't oops on writeback if vcache has no stashed credentials
Marc Dionne [Tue, 5 Jan 2010 00:37:40 +0000]
Linux: don't oops on writeback if vcache has no stashed credentials

When doing writeback, use current credentials if we can't find
stashed credentials in the vcache entry.
This is normally stashed in afs_open, so it's not clear how we
get to that point, but that's not a reason to trigger an oops.

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

14 years agoviced: allow alternate addresses on the same hash chain again
Michael Meffie [Tue, 29 Dec 2009 18:40:15 +0000]
viced: allow alternate addresses on the same hash chain again

Revert the logic meant to prevent duplicate entries in the
host address hash table so hosts with multiple addresses can
be stored in the same hash bucket again.

Add a new log message to show when the host cannot be stored
in the hash table because of an address-port pair collision
with a host already in the hash table.

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

14 years agoFixes for supergroups on Darwin 64bit
Simon Wilkinson [Tue, 5 Jan 2010 00:14:06 +0000]
Fixes for supergroups on Darwin 64bit

Some fixes needed to make supergroups build on 64bit Mac OS 10.5

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

14 years agoUnix CM: Use xdr_free to free memory allocated by XDR
Jeffrey Altman [Wed, 30 Dec 2009 11:32:58 +0000]
Unix CM: Use xdr_free to free memory allocated by XDR

In src/afs/afs_volume.c VL_GetAddrsU() returns memory allocated by the
xdr package. In 1.4 there was no method of freeing this safely. On the
head there is using the xdr_free() function.

FIXES 124937

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

14 years agofreebsd: fix afs_root signature (RELENG_8)
Matt Benjamin [Thu, 31 Dec 2009 00:19:09 +0000]
freebsd: fix afs_root signature (RELENG_8)

Track removal of thread id param, which had become redundant.

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

14 years agoBuild fix: restore centry in ptutils.c
Marc Dionne [Thu, 31 Dec 2009 16:08:32 +0000]
Build fix: restore centry in ptutils.c

The declaration of centry is needed when supergroups are not
enabled.  Restore it within the ifdef so that we don't get
an unused variable warning if supergroups are enabled.

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

14 years agoRemove warnings from supergroups code on x86
Russ Allbery [Thu, 31 Dec 2009 00:22:37 +0000]
Remove warnings from supergroups code on x86

Prototype functions where necessary, remove unused variables, fix
mismatches of data types (char * != void *), initialize variables the
compiler can't tell are initialized, compare integers against 0 and
not NULL, and wrap assignments used as conditions in an explicit
comparison.

This removes all warnings that fail --enable-checking on x86 with
--enable-supergroups.  64-bit will still have warnings.

Change-Id: I5ab6e317a280bea29cb44b97f2805a00e387577f
Reviewed-on: http://gerrit.openafs.org/1050
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoCorrect spelling errors in man pages
Russ Allbery [Thu, 31 Dec 2009 04:30:27 +0000]
Correct spelling errors in man pages

Correct several spelling errors in the man pages detected by Debian's
Lintian package checking tool.

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

14 years agofreebsd: track RELENG_8
Matt Benjamin [Wed, 23 Dec 2009 00:48:02 +0000]
freebsd: track RELENG_8

Fixes to re-enable build and load of kernel module on FreeBSD's
RELENG_8.  Includes the following changes:

Remove cred pointer argument to vop_getattr and vop_setattr.
Restore VSUID and VGUID defines, but move to osi_machdep.h.
Fixup calls to vinvalbuf, create a macro to avoid too many ifdefs.
Revert incorrect definition of gop_lookupname_user.  Avoid
uninitialized use of 'code' variable in vop_access, and track
new a_accmode member name.  Remove cred pointer in VFS_STATFS.
Avoid including sys/ioctl.h in kernel mode (formerly had no
effect, it's now an error).  Avoid using an empty file as an
object file in shlibafsrpc link.  Replace suser() calls with calls
to priv_check, using defined OpenAFS privileges (thanks due to
Ben Kaduk).

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

14 years agoLinux: Check for multiple silly renames
Simon Wilkinson [Sun, 27 Dec 2009 11:28:43 +0000]
Linux: Check for multiple silly renames

We don't want to do multiple silly renames of the same dcache entry,
so add a check for that occuring, and just return EBUSY if we're
trying to do so.

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

14 years agoAbstract out Linux sillyrename function
Simon Wilkinson [Sun, 27 Dec 2009 11:06:01 +0000]
Abstract out Linux sillyrename function

In order to keep the dcache happy, the Linux client has its own
sillyrename function. Abstract this out from afs_linux_unlink into a
function of its own (afs_linux_sillyrename) so we can make use of it
from other vnodeops.

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

14 years agoRemove unused configuration tests
Simon Wilkinson [Sat, 26 Dec 2009 18:22:32 +0000]
Remove unused configuration tests

Remove configure tests that are no longer used by the build. Testing
for unused features just slows down the configuration process.

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

14 years agoRemove HAVE_STRUCT_BUF test
Simon Wilkinson [Thu, 24 Dec 2009 18:19:01 +0000]
Remove HAVE_STRUCT_BUF test

Ever since b1edf891d717ee8e08c0d93738a204cff09cf68f was committed,
we've not needed to test to see if the OS provides struct buf - we
can just declare it as a structure without providing a definition
in all circumstances.

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

14 years agoRemove --disable-full-vos-listvol-switch option
Simon Wilkinson [Thu, 24 Dec 2009 15:35:47 +0000]
Remove --disable-full-vos-listvol-switch option

Remove the --disable-full-vos-listvol-switch configuration option,
and the corresponding #ifdefs. Full output from vos listvol is now
always enabled.

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

14 years agoRemove --disable-afsdb
Simon Wilkinson [Thu, 24 Dec 2009 15:14:46 +0000]
Remove --disable-afsdb

Remove the --disable-afsdb option from configure, and the
corresponding AFS_AFSDB_ENV #ifdefs from the code. This means that
the AFSDB code will always be built, but whether it used or not
can still be controlled by runtime options in the cache manager.

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

14 years agoclean up axscache at shutdown
Derrick Brashear [Tue, 29 Dec 2009 16:29:09 +0000]
clean up axscache at shutdown

modify allocations in axscache code to be able to be tracked. at shutdown,
clean up allocations.

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

14 years agoMake DAFS 'bos salvage' work in restricted mode
Andrew Deason [Wed, 30 Dec 2009 16:44:39 +0000]
Make DAFS 'bos salvage' work in restricted mode

bosserver currently has code to specifically allow 'bos
salvage'-initiated salvages to run when in restricted mode. This only
specifically tests for running salvager, though, and so fails when 'bos
salvage' is run against a DAFS fileserver and tries to run
'salvageserver -client' instead.

Test for 'salvageserver -client' as well, so we can run 'bos salvage'
for DAFS fileservers in restricted mode.

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

14 years agoRemove --disable-largefile-fileserver
Simon Wilkinson [Thu, 24 Dec 2009 14:34:42 +0000]
Remove --disable-largefile-fileserver

Make largefile fileservers the only option. Remove all of the
AFS_LARGEFILE_ENV ifdefs, and tidy up some code as a result of
this change.

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

14 years agoTurn on bos restricted code
Simon Wilkinson [Thu, 24 Dec 2009 13:00:53 +0000]
Turn on bos restricted code

Remove the #ifdef's around the bos restricted mode code. This makes
restricted mode available as part of the standard build, but a server
will not go into restricted mode unless the relevant command line
options are specified, or bos setrestricted is run.

Document bos_setrestricted and bos_getrestricted, and the new
'-restricted' command line option. Add a note to the man pages of
all of the commands whose behaviour is affected by restricted mode.

Add 'setr' and 'getr' aliases for setrestart and getrestart so that
these documented shortcuts continue to work (otherwise they'd be
ambiguous against setrestricted and getrestricted). Note that
setre, setres, and setrest will not work once this patch is applied.

Change-Id: Ie69d21493ea5f78757f0a3d478de43fdaabd3c31
Reviewed-on: http://gerrit.openafs.org/1028
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agoUpdate .gitignore for copied rxkad files
Russ Allbery [Thu, 31 Dec 2009 04:33:14 +0000]
Update .gitignore for copied rxkad files

src/rxkad/Makefile copies fcrypt.h and sboxes.h from the domestic
subdirectory, so ignore the copies in the src/rxkad directory.

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

14 years agoLinux: #if BLAH should be #if defined(BLAH)
Simon Wilkinson [Tue, 29 Dec 2009 22:48:39 +0000]
Linux: #if BLAH should be #if defined(BLAH)

As the subject says, using #if BLAH gives warnings. Fix them
in osi_ioctl.c

Change-Id: Iee3da68cd29e84bd201a1ee657d3f80ca9b2f5d5
Reviewed-on: http://gerrit.openafs.org/1041
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>

14 years agomissing brace in afs_get_sb
Michael Meffie [Wed, 30 Dec 2009 18:02:31 +0000]
missing brace in afs_get_sb

Fix a syntax error when GET_SB_HAS_STRUCT_VFSMOUNT is
not true so we can build on older versions of linux.

Change-Id: I85aac803f68c3f3729abd32dfcecbc20ccac8ab9
Reviewed-on: http://gerrit.openafs.org/1049
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>

14 years agoUnix: Rename aklog_main.c as aklog.c
Simon Wilkinson [Tue, 29 Dec 2009 17:06:42 +0000]
Unix: Rename aklog_main.c as aklog.c

Now the reasons for having aklog_main.c separate from aklog.c have gone,
rename the file so we've just got aklog.c

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

14 years agoUnix: Merge aklog with aklog_main
Simon Wilkinson [Tue, 29 Dec 2009 17:03:50 +0000]
Unix: Merge aklog with aklog_main

Historically, aklog was split into aklog.c (which just contained a
wrapper) and aklog_main.c, which did all of the hard work. Now
that we've purged all of the Windows code from aklog_main.c, we
can merge them both into the same file, so do so.

FIXES 20884

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

14 years agoavoid leaking stat info
Derrick Brashear [Thu, 17 Dec 2009 20:33:42 +0000]
avoid leaking stat info

if a file is already CStatd we just copy out the information without doing
access checks. add an access check.

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

14 years agoReturn a cell name from afsconf_LookupServer
Andrew Deason [Tue, 29 Dec 2009 20:45:51 +0000]
Return a cell name from afsconf_LookupServer

Previously, afsconf_LookupServer could not meaningfully return a cell
name, since a char* was passed in for realCellName, and
afsconf_GetAfsdbInfo was expecting the value of the pointer to change.
Change afsconf_LookupServer to take a char**, and pass realCellName by
reference, so we can get a cell name back.

Change-Id: Ib945fcb4be482ee155cdd1dcd62fe577c002082d
Reviewed-on: http://gerrit.openafs.org/1039
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>