openafs.git
7 years agoMake KeyFileExt comment match reality
Ben Kaduk [Tue, 25 Jun 2013 00:51:53 +0000]
Make KeyFileExt comment match reality

There is no file format version field as implemented.
Remove it from the format laid out in the comment, and change the
associated text to make more sense.

Change-Id: I3a7e4ca22bb4d556a091abc0e6e22d3409e419cd
Reviewed-on: http://gerrit.openafs.org/10020
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoDocument the prdb (ubik) file format
Ben Kaduk [Wed, 15 May 2013 15:38:53 +0000]
Document the prdb (ubik) file format

Briefly cover the ubik header and mention that it is not part of the
logical database (since it is just used for the consistency procedure).

Describe the fields of the prheader and how they are used.  Mention that
all subsequent entries are blocks of the same size, whose type can be
distinguished by a shared flags field.  User and group entries are similar,
and supergroup entries are described as a diff from regular group entries,
as only a handful of fields change.  Continuation entries can be used
for user, regular group, or supergroup entries.

Call out what fields are invariant within which classes of entry, so that
these properties can be preserved (or knowingly eliminated) for future
extensions to the format.

Change-Id: Id5ca7d8d346c09c2eec50691e5c5fefbe735ac60
Reviewed-on: http://gerrit.openafs.org/10022
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agobuild-sys: mark block begin and ends
Sami Kerola [Sat, 22 Jun 2013 18:34:13 +0000]
build-sys: mark block begin and ends

Done with Egyptian brackets, or K&R style as they are also known.

Change-Id: Ifeaf3ca29be5d4846738ec937ce07728771c5f16
Reviewed-on: http://gerrit.openafs.org/10010
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agobuild-sys: use AS_IF instead of shell if clause
Sami Kerola [Sat, 22 Jun 2013 17:01:44 +0000]
build-sys: use AS_IF instead of shell if clause

Shell if clauses can cause problems.

Change-Id: Ia5fddc78ff43517c37d5abd79f07b35fd18a9058
Reference: http://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Limitations-of-Builtins.html#if
Reviewed-on: http://gerrit.openafs.org/10009
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agobuild-sys: use m4 quoting consistantly
Sami Kerola [Sat, 22 Jun 2013 16:28:01 +0000]
build-sys: use m4 quoting consistantly

Change-Id: Ie8c5e15fd9ddf521ac74b07ee0e1252b35e7a816
Reviewed-on: http://gerrit.openafs.org/10008
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agobuild-sys: do not check readme and news when automake runs
Sami Kerola [Sat, 22 Jun 2013 16:20:22 +0000]
build-sys: do not check readme and news when automake runs

Change-Id: Idb5bb57efecf0a9776db78466787987ba7680533
Reviewed-on: http://gerrit.openafs.org/10007
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agobuild-sys: add bug reporting address and home page to configure
Sami Kerola [Sat, 22 Jun 2013 16:17:04 +0000]
build-sys: add bug reporting address and home page to configure

$ ./configure --help | tail -2
Report bugs to <openafs-bugs@openafs.org>.
OpenAFS home page: <http://www.openafs.org/>.

Change-Id: I862b7501f3c964eea800e1aad5f2fc0c551b9fb8
Reviewed-on: http://gerrit.openafs.org/10006
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoFix restorevol sanity check on afs_int32
Russ Allbery [Sat, 29 Jun 2013 21:29:06 +0000]
Fix restorevol sanity check on afs_int32

restorevol reads various values of different lengths into an
afs_int32 and does a sanity check to ensure that there is enough
room to store the desired value length.  However, the check was
done against the wrong variable, making it ineffective.

This check is unlikely to ever trigger, but fix it just in case.

Change-Id: Ia81bd9ff9a2ce8e2d93af384c8e8c664f5434d5e
Reviewed-on: http://gerrit.openafs.org/10026
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoFix restorevol crash on corrupt nDumpTimes value
Russ Allbery [Sat, 29 Jun 2013 21:27:55 +0000]
Fix restorevol crash on corrupt nDumpTimes value

If the number of dump times claimed in the volume header was greater
than MAXDUMPTIMES, restorevol would happily write over random stack
memory and crash.  Sanity-check the loaded value and cap it to
MAXDUMPTIMES with a warning.

Bug found by Mayhem and reported by Alexandre Rebert.

Change-Id: Ib0edd9b1b6f540d8b0128151333d3bb0a8ef37fa
Reviewed-on: http://gerrit.openafs.org/10025
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agobosserver dir creation for non-transarc paths
Michael Meffie [Thu, 16 Jul 2009 21:50:53 +0000]
bosserver dir creation for non-transarc paths

The bosserver attempts to create the server directories with the correct
permissions when bosserver starts. Make the parent directories if needed
as well, using the umask permissions for the parent directories, instead
of failing.

FIXES 125114

Change-Id: I5ee16a8210154e51cda4ace0617393c7797a6622
Reviewed-on: http://gerrit.openafs.org/147
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoAdd a tool to find lock ID numbers
Jeffrey Hutzelman [Sun, 16 Jun 2013 23:16:05 +0000]
Add a tool to find lock ID numbers

This adds a Perl program, src/afs/findlocks, which grovels through the
kernel module source tree, finds every location where a lock is obtained,
and produces an index of lock site ID numbers.  This can be used to find
a lock when debugging, or when picking a new number.

Run it as ./src/afs/findlocks src/afs

Change-Id: I7fdcfb807a92dbb1938a0c37637e9122b52addd7
Reviewed-on: http://gerrit.openafs.org/9982
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agolibafs: initialize hard mount last errors
Michael Meffie [Tue, 9 Apr 2013 08:00:16 +0000]
libafs: initialize hard mount last errors

Initialize the values of the server last errors
introduced in commit 94a8ce970d57498583e249ea61725fce1ee53a50
to avoid logging garbage for the last error codes.

Change-Id: I0df262bad5d02231407d0dd65e1f1d32d791912f
Reviewed-on: http://gerrit.openafs.org/10082
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoLinux 3.11: Convert from readdir to iterate file operation
Marc Dionne [Mon, 8 Jul 2013 14:53:00 +0000]
Linux 3.11: Convert from readdir to iterate file operation

Convert the readdir function so that it can be used as the new
"iterate" file operation.  This new operation is passed a context
that contains a pointer to the filldir function and the offset.
The context is passed into the new dir_emit function that will
call the function specified by the context.

The new dir_emit function returns true on success, so we must be
careful about how we check for failure since this is different
behaviour from what filldir currently does.

Change-Id: I6b01b4c78a501bdf4f8d583b0d3b94d677c5d541
Reviewed-on: http://gerrit.openafs.org/10051
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoRedHat: support building on ELRepo kernels
Arne Wiebalck [Fri, 12 Jul 2013 09:39:53 +0000]
RedHat: support building on ELRepo kernels

Amend the pattern matching in openafs-kmodtool to support
building for kernels from ELRepo.

Change-Id: I1264490bee90fadfd24d5cd04ea87df4f9c8924d
Reviewed-on: http://gerrit.openafs.org/10083
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoAlias "vos e" to "vos examine"
Ben Kaduk [Wed, 10 Jul 2013 03:12:43 +0000]
Alias "vos e" to "vos examine"

This shortcut broke when endtrans was added, and some people have
strong finger memory.

Change-Id: Ic00fd33a28c35985464b68becfc25082eee92d0e
Reviewed-on: http://gerrit.openafs.org/10081
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoMake UKERNEL's panic() a real function, not a macro
Ben Kaduk [Wed, 8 May 2013 16:50:27 +0000]
Make UKERNEL's panic() a real function, not a macro

In particular, a varargs function, so that osi_Panic() can always
call panic() as varargs.

Change-Id: I2ceee737c0025c146a8cd17b16d6c159e2bbf9d0
Reviewed-on: http://gerrit.openafs.org/9877
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoWindows: build UNIX asetkey
Jeffrey Altman [Tue, 9 Jul 2013 13:55:51 +0000]
Windows: build UNIX asetkey

With roken and friends it is now possible to build the UNIX
asetkey on Windows.  Do so to reduce duplicate code.

Change-Id: Ic7e050b04e6bed7fe2106de1a163d9ae1fde9efc
Reviewed-on: http://gerrit.openafs.org/10070
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: define HAVE_KRB5_CREDS_SESSION
Jeffrey Altman [Tue, 9 Jul 2013 15:42:06 +0000]
Windows: define HAVE_KRB5_CREDS_SESSION

Windows builds against the Kerberos Compatibility SDK which uses
the Heimdal API.  Define HAVE_KRB5_CREDS_SESSION.

Change-Id: I389cb3e8d79846c94884ea9a786e2ae0f52fa293
Reviewed-on: http://gerrit.openafs.org/10071
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agowindows: afsauthent.dll export afsconf_ functions
Jeffrey Altman [Tue, 9 Jul 2013 13:54:42 +0000]
windows: afsauthent.dll export afsconf_ functions

Export additional afsconf_ functions required for asetkey

Change-Id: Id8d63f7d18563bd8963750aed6b7baaf873716a8
Reviewed-on: http://gerrit.openafs.org/10069
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: afsrpc.dll export afs_set_com_err_hook
Jeffrey Altman [Tue, 9 Jul 2013 13:54:09 +0000]
Windows: afsrpc.dll export afs_set_com_err_hook

Change-Id: Icbd33c9ca087e663d2755a7a6c8380de266ee717
Reviewed-on: http://gerrit.openafs.org/10068
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: HAVE_TIMEGM provided by roken
Jeffrey Altman [Tue, 9 Jul 2013 13:53:25 +0000]
Windows: HAVE_TIMEGM provided by roken

Change-Id: I110e0667cdc68ab0877fe8c1d0a4f9e48e60621d
Reviewed-on: http://gerrit.openafs.org/10067
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agobos: Fix Windows import of afsconf_SawCell
Jeffrey Altman [Tue, 9 Jul 2013 00:29:24 +0000]
bos: Fix Windows import of afsconf_SawCell

IBM created a global variable 'afsconf_SawCell' in the kauth package
and manipulated its value from within bos.c as part of the calling
of ka_Init().  Patchset d52398940d58ccdba4114a9975762f48cc24ad15
exported afsconf_SawCell from afsauthent.dll since bos.exe is built
pthreaded.  It was previously mixing pthread and not-pthread libraries
to access the variable.

Unfortunately, the export was declared as a function pointer instead
of DATA.  Importing a DATA element from a library also requires that
the variable be __declspec(dllimport).   The use of afsconf_SawCell
needs to be replaced but in the meantime fix the import so that bos.exe
can start without crashing.

Change-Id: Ic780971b55d64e41e1ba9627cdeadd6c27c451fb
Reviewed-on: http://gerrit.openafs.org/10054
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoBuild 3961 library in userspace, and add enctypes
Chaskiel Grundman [Sat, 6 Apr 2013 00:12:12 +0000]
Build 3961 library in userspace, and add enctypes

Build the 3961 library in userspace, with support for the common
kerberos enctypes des3-hmac-sha1, arcfour-hmac-md5, and aesXXX-cts-hmac-sha1-96.
Export new symbols as well, and suppress deprecated warnings.

Rename all symbols, both exported and not, with an oafs_h_ prefix
so as to reduce the chance of conflicts.

Rename heim_octet_string to avoid confusion about where things are coming
from.

Change-Id: If5155661deb5adf73329eb8b90021512c01a290f
Reviewed-on: http://gerrit.openafs.org/10050
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agohcrypto: export weak key routine
Ben Kaduk [Mon, 8 Jul 2013 15:56:26 +0000]
hcrypto: export weak key routine

We only export it on Windows, but the DES3 routines in the rfc3961
library need it everywhere.

Change-Id: Ide0328e40b7753d8ebca79db9eb8b6211bfd7f14
Reviewed-on: http://gerrit.openafs.org/10053
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoExport RAND_bytes from hcrypto on Windows
Ben Kaduk [Mon, 8 Jul 2013 15:39:52 +0000]
Export RAND_bytes from hcrypto on Windows

Unix already did so, and we need it for the rfc3961 library.

Change-Id: I75401b49a5a2078056360be8f1963d789581c8ed
Reviewed-on: http://gerrit.openafs.org/10052
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoDisable some heimdal bits
Ben Kaduk [Tue, 2 Jul 2013 15:13:25 +0000]
Disable some heimdal bits

For the rfc3961 library, we don't want linker exposure to an
entropy-gathering daemon, and we don't want to be leaving entropy
seed files around in user homedirs.

Change-Id: I54546ad44fcdfac8227e72b68a33fa4f61df50b0
Reviewed-on: http://gerrit.openafs.org/10049
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoAdd krb5_free_context stub to rfc3961
Chaskiel Grundman [Sun, 28 Apr 2013 13:31:12 +0000]
Add krb5_free_context stub to rfc3961

Change-Id: I5df22e74ea9a5a057994b6684a09eb0f03da98d2
Reviewed-on: http://gerrit.openafs.org/10048
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agohcrypto: Add exports for more crypto algorithms
Simon Wilkinson [Fri, 12 Apr 2013 13:57:44 +0000]
hcrypto: Add exports for more crypto algorithms

Export some additional algorithms so we can make use
of them elsewhere in the code.

Change-Id: I676318a872a1e7b537112a3d60dac2edff478ae6
Reviewed-on: http://gerrit.openafs.org/10047
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoUse rk_mkdir from libafsroken
Ben Kaduk [Fri, 5 Jul 2013 18:06:33 +0000]
Use rk_mkdir from libafsroken

The latest import added it; add it to the build and export list.

Change-Id: I588de000868d063c61753a1a4a2e73931e84005f
Reviewed-on: http://gerrit.openafs.org/10046
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoImport of code from heimdal
Heimdal Developers [Fri, 5 Jul 2013 20:39:34 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
5dfaa0d10b8320293e85387778adcdd043dfc1fe (git2svn-syncpoint-master-311-g5dfaa0d)

Upstream changes are:

Ben Kaduk (1):
      Be friendly to krb5_generate_random_block consumers

Jeffrey Altman (6):
      roken: include limits.h unconditionally
      Avoid unused variable warning on Windows
      roken: include direct.h if HAVE_DIRECT_H
      roken: Define S_IRWXU and friends on Windows
      roken: Add rk_mkdir()
      libkrb5: Add missing KRB5_LIB_FUNCTION/KRB5_LIB_CALL

New files are:
krb5/crypto-algs.c
krb5/crypto-arcfour.c
krb5/crypto-des-common.c
krb5/crypto-des.c
krb5/crypto-des3.c
krb5/crypto-null.c
krb5/crypto-rand.c
roken/mkdir.c

Change-Id: I77d67afc2b060574a5834fc5c266553c5ff49a25
Reviewed-on: http://gerrit.openafs.org/10045
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoAdd additional files to import from Heimdal
Simon Wilkinson [Fri, 12 Apr 2013 12:02:40 +0000]
Add additional files to import from Heimdal

Import more RFC3961 crypto definitions from Heimdal, so we can
support a wider variety of encryption algorithms

Also pick up the new mkdir, otherwise we get linker errors.

Change-Id: I5dfe705d3957b646ae05a0e06da1f0f2cfb60e75
Reviewed-on: http://gerrit.openafs.org/10044
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agobos: Do encryption if requested
Marc Dionne [Fri, 5 Jul 2013 16:50:36 +0000]
bos: Do encryption if requested

Commit d008089a79 didn't replace the processing of the aencrypt
flag passed to the GetConn() function, causing all bos connections
to be un-encrypted.  This causes "addkey" to fail with an error
from the server, and "listkeys" to silently ignore the -showkey
option to display keys.

Set the AFSCONF_SECOPTS_ALWAYSENCRYPT flag, and don't set
AFSCONF_SECOPTS_FALLBACK_NULL since fallback is not acceptable if
the caller requested enrcyption.

Change-Id: I6a15fa20c172ab2ddfc6494fbcd62ec6bc7fc442
Reviewed-on: http://gerrit.openafs.org/10043
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: validate pointer consistency
Jeffrey Altman [Sat, 29 Jun 2013 04:26:52 +0000]
Windows: validate pointer consistency

When cm_ValidateCache() is executed validate pointers to ensure
that they are in the valid range for the class of pointer.

Change-Id: I151489010430919999af85843079f81143359739
Reviewed-on: http://gerrit.openafs.org/10040
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: Protect all Mm and Cc calls with try..except
Jeffrey Altman [Wed, 26 Jun 2013 15:00:00 +0000]
Windows: Protect all Mm and Cc calls with try..except

Wrap all Memory Manager and Cache Manager operations in a try..except
block to protect against leaking the SectionObjectResource if an exception
is thrown.  Failure to release the SectionObjectResource will result in
subsequent deadlocks.

Change-Id: I92096c1d4bfd5a23069bcc364b68b07327d662ae
Reviewed-on: http://gerrit.openafs.org/10039
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoDiagnose calling compile_et -v without another argument
Russ Allbery [Sat, 29 Jun 2013 20:52:46 +0000]
Diagnose calling compile_et -v without another argument

Output an error message instead of crashing with a segmentation
fault due to a NULL pointer dereference.

Bug found by Mayhem and reported by Alexandre Rebert.

Change-Id: I484f76411ed6899ea9af81256c1d392a84830d16
Reviewed-on: http://gerrit.openafs.org/10024
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoUpdate windows build documentation
Ben Kaduk [Wed, 26 Jun 2013 22:57:01 +0000]
Update windows build documentation

Mention Win7 in a few more places, and talk about VS 2010/2012.
I've had the best results with VS 2005, though.

Update dead URLs.

The old version of WiX 2.0 no longer seems available (at least not from
the listed URL); replace it with

Remove coverage of NSIS installers.

Update example OpenAFS version to 1.7.25.

De-emphasize VS 2003.

Update some ntbuild.bat settings and comments to be more useful and valid.

Change-Id: Iee305833e6d2b01dd7995a78863327682fe5a8eb
Reviewed-on: http://gerrit.openafs.org/10029
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoFix spelling error in fs_getverify man page
Russ Allbery [Sat, 29 Jun 2013 20:33:28 +0000]
Fix spelling error in fs_getverify man page

priviledges -> privileges

Change-Id: I56d233feb7a05d184b26d24d80fbdd4c1e0d0896
Reviewed-on: http://gerrit.openafs.org/10023
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>

7 years agoMake opr_uuid_toString return a status
Jeffrey Hutzelman [Wed, 19 Jun 2013 03:34:45 +0000]
Make opr_uuid_toString return a status

Don't assume that converting a UUID to a string will always succeed.
Instead, opr_uuid_toString should return a status result to indicate
whether the operation was successful or not.

Change-Id: I49e6bf53b2a878342d3137510d2eca522e58604d
Reviewed-on: http://gerrit.openafs.org/9990
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: Wake waiters on failed cm_SyncOp exit
Jeffrey Altman [Wed, 19 Jun 2013 17:53:51 +0000]
Windows: Wake waiters on failed cm_SyncOp exit

If cm_SyncOp exits due to failure and there are threads waiting
to use the cm_scache object, wake them before exiting because there
will be no cm_SyncOpDone() operation to wake them later.

Change-Id: Ibf54ebd575cf22b8e9d3577eeb039ff69cc728b6
Reviewed-on: http://gerrit.openafs.org/9994
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: cm_scache flags missing interlocked ops
Jeffrey Altman [Wed, 19 Jun 2013 17:52:51 +0000]
Windows: cm_scache flags missing interlocked ops

A small number of |= operations on the cm_scache.flags field were
not converted to _InterlockedOr.  Do so now.

Change-Id: Iebd361d53e46527bf3ffa0d20d006a5e90ab4967
Reviewed-on: http://gerrit.openafs.org/9993
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agolibafs: track dynroot locks for cmdebug
Derrick Brashear [Fri, 21 Jun 2013 14:50:16 +0000]
libafs: track dynroot locks for cmdebug

the dynroot dir and symlink locks are not currently tracked;
it would be helpful to know when these locks are in play for tracking
contention

Change-Id: Ibe18586fa5d0ef0e3ea9e7153d79ab64df46ebf3
Reviewed-on: http://gerrit.openafs.org/9997
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agonamei: Create the IH_CREATE_INIT function
Andrew Deason [Thu, 30 May 2013 22:53:56 +0000]
namei: Create the IH_CREATE_INIT function

Create a new function that combines calls to IH_CREATE and IH_INIT
into one operation; the new function is called IH_CREATE_INIT. This
allows a caller to create a file and then use it, without needing to
open() the file twice.

This is currently only implemented for the Unix namei backend; other
backends result in effectively the same functionality (but can use the
same API).

Change-Id: I93d531a9892beeb0c1ceac18458cbe0f1e3a0ded
Reviewed-on: http://gerrit.openafs.org/9969
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoihandle: Refactor ih_open to split out ih_attachfd
Andrew Deason [Thu, 30 May 2013 22:52:32 +0000]
ihandle: Refactor ih_open to split out ih_attachfd

Refactor the function ih_open, so part of its logic gets split out
into the new ih_attachfd_r (and ih_attachfd) function. This allows
other code to splice in an existing fd, without going through the
normal "open" path.

This patch should incur no functional change; it is just code
reorganization.

Change-Id: I89fd32377c123f2c55b77b01e1db4e14a199bf8e
Reviewed-on: http://gerrit.openafs.org/9968
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoihandle: Fix fdInUseCount leak on EMFILE
Andrew Deason [Thu, 30 May 2013 22:40:58 +0000]
ihandle: Fix fdInUseCount leak on EMFILE

Here, we close closeFd, but currently we don't decrement fdInUseCount.
Since we retry the open immediately afterwards, this means we can leak
fdInUseCount references. For example, if we retry this 5 times and get
EMFILE on each attempt, we will close 5 FDs, but not decrement
fdInUseCount at all.

To fix this, decrement fdInUseCounter when we close a file for EMFILE.

Change-Id: I347e37a8d670a6dde7e1d24eeb893c145d9e34e5
Reviewed-on: http://gerrit.openafs.org/9967
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoMake the inode fileserver backend build again
Andrew Deason [Tue, 11 Jun 2013 19:40:30 +0000]
Make the inode fileserver backend build again

 - Unconditionally build int64_to_flipbase64 and flipbase64_to_int64.
   These are only used by namei, but are referenced by the
   liboafs_util export list

 - Include rx_queue.h in listinodes.c, so the queue elements in
   various structures are defined.

 - Rename vfsck's getline, so we don't conflict with stdio's getline

 - Fix the includes in vfsck/dirutils.c so we get a definition for
   VolumeId

 - salvageserver needs libsys for various ihandle operations

Change-Id: Ibed3439c1eca499e2ada785e1e8186f4480117a4
Reviewed-on: http://gerrit.openafs.org/9966
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agouserok.c: Fix fixed-size on-stack path buffers
Jeffrey Hutzelman [Tue, 18 Jun 2013 16:35:36 +0000]
userok.c: Fix fixed-size on-stack path buffers

Several functions in src/auth/userok.c construct pathnames in fixed
size buffers on their stacks.  Those buffers are simultaneously too
small for the purpose for which they are used and too large to be
placed on the stack.  This change replaces these fixed-size buffers
with dynamically-allocated buffers which are either exactly the right
size (due to asprintf) or have size AFSDIR_PATH_MAX.

FIXES 130719

Change-Id: I49b1c03d4d3525b87e155eb2d6eedf4b199a33c5
Reviewed-on: http://gerrit.openafs.org/9986
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agodb_dump.o depends on budb_errs.h
Ben Kaduk [Wed, 19 Jun 2013 20:48:23 +0000]
db_dump.o depends on budb_errs.h

Add INCLS and budb_errs.h accordingly.

budb had this already, in 6fda61ba2e2290dac818b42440fac1346d05b73d.

Change-Id: I5ef372e8f8b9ad270b83e158d0ce14109e0f9ef1
Reviewed-on: http://gerrit.openafs.org/9996
Reviewed-by: Jeffrey Hutzelman <jhutz@cmu.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoWindows: fixup cellular make mount
Jeffrey Altman [Fri, 14 Jun 2013 02:29:39 +0000]
Windows: fixup cellular make mount

Ensure that all input strings contain a trailing dot.

'fsvolume' contains the trailing dot so do not add an extra one.

Change-Id: I183581d3b06a586da872edc4af54c5e34798cdf4
Reviewed-on: http://gerrit.openafs.org/9974
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoImport of code from heimdal
Heimdal Developers [Wed, 19 Jun 2013 04:56:29 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
dc87425f93bdd3d9c88be1a380ed5372980235bf (git2svn-syncpoint-master-290-gdc87425)

Upstream changes are:

Ben Kaduk (1):
      Always provide a usable PATH_MAX

Jeffrey Hutzelman (1):
      hcrypto/rand-unix.c: Ignore write(2) result harder

Nicolas Williams (1):
      Winsock connect returns WSAEWOULDBLOCK...

Change-Id: I10a001a3a606c799f7b9ab7db42ecef4ad5a5c21
Reviewed-on: http://gerrit.openafs.org/9992
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoviced/callback.c: Ignore dump write errors harder
Jeffrey Hutzelman [Wed, 19 Jun 2013 03:12:46 +0000]
viced/callback.c: Ignore dump write errors harder

When writing a callback state dump, test the return values from
write(2), but don't do anything based on the test.  This avoids
compiler warnings when building on Ubuntu 12.10, with gcc 4.7.2 and
eglibc 2.15-0ubuntu20.1.  This adds a new macro, WriteBytes(), which
handles writing a requested number of bytes to a file and ignoring
errors.

Change-Id: Icead6b25a290cea09a91184dc12b7449cfaaf6f7
Reviewed-on: http://gerrit.openafs.org/9991
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoFix spelling error in fs_getcrypt man page
Russ Allbery [Tue, 18 Jun 2013 18:30:28 +0000]
Fix spelling error in fs_getcrypt man page

priviledges -> privileges

Change-Id: I2026b8df83f3620565d8d8c522209fe354498418
Reviewed-on: http://gerrit.openafs.org/9984
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoFix scanf buffer overflows
Nickolai Zeldovich [Tue, 12 Feb 2013 20:08:38 +0000]
Fix scanf buffer overflows

Fix potential buffer overflows caused by misuse of the scanf function
in the fileserver and ptserver.

Also fix similar issues in the client side fs command and libadmin
library.

Change-Id: Ia6a46981c50537da1673507c2bc777f96e43f95a
(This change was applied to the 1.6 branch as a security fix for 1.6.2 as
commit d1855f8e04; this commit brings the fix into master.)
Reviewed-on: http://gerrit.openafs.org/9962
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agorx: test for active calls in rxi_ChallengeEvent
Jeffrey Altman [Sat, 25 May 2013 21:05:10 +0000]
rx: test for active calls in rxi_ChallengeEvent

The challenge event fires when an outstanding challenge request
has not been responded to.  If there are no calls in the ACTIVE or PRECALL
state on the connection when the challenge event fires do not re-issue the
challenge.  Clients do not respond to challenges when there are no active
calls.

Change-Id: If71b49e953ca94b8bcce767b8c2a63a054d750fe
Reviewed-on: http://gerrit.openafs.org/9943
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agosalvager: report actual uniqs for a too low error
Derrick Brashear [Wed, 17 Apr 2013 17:42:49 +0000]
salvager: report actual uniqs for a too low error

when salvager fixes a "uniquifier too low" error, report
what it is fixing and what it was looking for.

Change-Id: I021bd7f69225ff02f4981aec1f6e64a4b1f3fc00
Reviewed-on: http://gerrit.openafs.org/9795
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoInclude user and build host in version string
Jeffrey Hutzelman [Tue, 29 Jun 2010 16:56:29 +0000]
Include user and build host in version string

Make the version string used in AFSVersion and cml_version_number
include the names of the user doing the build and the host on which
it is done.  Also, remove extraneous whitespace and the content-free
word 'built' from cml_version_string, since Rx debug packages provide
space for only 64 characters of version string.

Change-Id: I128f6c175bb93b1fb5a4d531f64aa81bd2841ce7
Reviewed-on: http://gerrit.openafs.org/2279
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agosalvageserver: Add -logfile option
Marc Dionne [Thu, 25 Apr 2013 15:13:09 +0000]
salvageserver: Add -logfile option

Allow an alternate location to be specified for the logfile.

Change-Id: I55a05576746e115478a8e48df22f4fdb26634f05
Reviewed-on: http://gerrit.openafs.org/9831
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoviced: Add support for -config and -logfile options
Marc Dionne [Thu, 25 Apr 2013 13:26:46 +0000]
viced: Add support for -config and -logfile options

Add options to the fileserver to specify alternate locations for
the log file and the config.  This will be useful for testing
purposes.

Change-Id: I3550bd993fe5fd2cd9b90425962c95cb1c7d98ea
Reviewed-on: http://gerrit.openafs.org/9830
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agosalvaged: Clean up command line parsing
Marc Dionne [Thu, 25 Apr 2013 14:50:11 +0000]
salvaged: Clean up command line parsing

Clean up the command line parsing in the salvage daemon by making
better use of the cmd library and avoiding hard coded offsets.

Change-Id: Ia300840cfdbb5e03173936148c183ac391e11454
Reviewed-on: http://gerrit.openafs.org/9829
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agovolser: Add -config and -logfile options
Marc Dionne [Thu, 25 Apr 2013 12:57:27 +0000]
volser: Add -config and -logfile options

Add options to specify alternate locations for the configuration
files and the log file.  This will be helpful for testing.

Change-Id: I4169bc1944719773155931860c6a6dd2fd672f53
Reviewed-on: http://gerrit.openafs.org/9828
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agovolser: Convert command line parsing to cmd
Marc Dionne [Wed, 24 Apr 2013 17:25:36 +0000]
volser: Convert command line parsing to cmd

Convert argument parsing to use the cmd library.

Change-Id: I2bf9d7ce482d49f50cec59a1660a431bae17017a
Reviewed-on: http://gerrit.openafs.org/9827
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: Protect against cm_GetVolServerList failures
Jeffrey Altman [Sat, 1 Jun 2013 04:48:51 +0000]
Windows: Protect against cm_GetVolServerList failures

In cm_Analyze, if cm_GetVolServerList() fails volServerpp will be
NULL which will trigger an exception if passed to either
cm_SetServerBusyStatus or cm_ResetServerBusyStatus.

Change-Id: I75b4b855b8c3ccfc014532b0c2eb3135807647ef
Reviewed-on: http://gerrit.openafs.org/9960
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agotests: Improve afstest_UnlinkTestConfig cleanup
Marc Dionne [Wed, 3 Apr 2013 20:09:53 +0000]
tests: Improve afstest_UnlinkTestConfig cleanup

Make afstest_UnlinkTestConfig clean up and remove the specified
directory regardless of which files are present.  This means
the function no longer has to track the current state of which
files may be present as tests are added and modified.

A sanity check is added to prevent damage in case the function is
called for an inappropriate directory.

As before, no cleaning is done if the test is run outside of a
"make check".

Change-Id: Idd092040496aaa2566c8693496fefd7d6f247565
Reviewed-on: http://gerrit.openafs.org/9703
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoApply cast from cfc9b348 to the else clause
Ben Kaduk [Tue, 7 May 2013 03:03:42 +0000]
Apply cast from cfc9b348 to the else clause

Clang on FreeBSD complains about format string mismatch as well.

Change-Id: I8bf17571807acdcac460efb94d0388b5cac4fa6c
Reviewed-on: http://gerrit.openafs.org/9855
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoLinux: Fix tmpfs cache support
Marc Dionne [Wed, 22 May 2013 13:26:57 +0000]
Linux: Fix tmpfs cache support

As of kernel 3.1, tmpfs no longer has a readpage() operation in its
address space operations.  Some of the cache manager code relies on
this, causing an oops if tmpfs is used as backing store for the
cache.

As a minimal fix, detect that there is no readpage() and disable
the optimizations that depend on it.

Change-Id: I6e2236cd53f893d77a8d6568eae7e200ad8d1ac0
Reviewed-on: http://gerrit.openafs.org/9949
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agocacheout: Add -encrypt option
Andrew Deason [Fri, 24 May 2013 19:02:11 +0000]
cacheout: Add -encrypt option

Add the -encrypt option to cacheout, for forcing communication with
servers over encrypted channels.

Change-Id: I1a2a9faf2fb72238102b018b7692a6691a7c0054
Reviewed-on: http://gerrit.openafs.org/9941
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoWindows: cm_DumpServers "down" is string not enum
Jeffrey Altman [Tue, 28 May 2013 15:40:12 +0000]
Windows: cm_DumpServers "down" is string not enum

When dumping the state of the servers, "down" is a string not an
enum value.

Change-Id: I603755cf0db28515d01bc03253a4d3e6528b13aa
Reviewed-on: http://gerrit.openafs.org/9946
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoLinux 3.10: Include linux/aio.h directly
Marc Dionne [Wed, 15 May 2013 19:19:22 +0000]
Linux 3.10: Include linux/aio.h directly

This file needs bits from linux/aio.h, but gets them indirectly
from the inclusion of aio.h by sched.h.  That gets removed for
Linux 3.10.

Since this header is not of general interest elsewhere, just include
it directly here.

Change-Id: I432bde282a1c5425ba6780bca28e308bf70a79e7
Reviewed-on: http://gerrit.openafs.org/9912
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agovol: return VNOVNODE if vnode is not allocated
Jeffrey Altman [Mon, 13 May 2013 10:45:34 +0000]
vol: return VNOVNODE if vnode is not allocated

If a request for a vnode fails because the vnode is not allocated
within the volume, the error returned to the client should be VNOVNODE to
indicate that the requested FID does not exist and not VIO indicating a
transient disk i/o error or other transient internal inconsistency.

Change-Id: I2f875593d4a49b7ca8ed26a2f147a1c3c9109a6d
Reviewed-on: http://gerrit.openafs.org/9902
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoSort all libtool symbol lists
Simon Wilkinson [Sat, 11 May 2013 19:20:38 +0000]
Sort all libtool symbol lists

The original plan for the libtool symbol lists was that they be in
alphabetical order. This should make them easier to maintain, as it
becomes harder to accidentaly introduce duplicates, and makes merge
conflicts when adding new symbols less likely.

However, not all of them are properly sorted. Update the ones that
aren't. This was done with

    for A in `find . -name *.la.sym`; do sort $A -o $A; done

Change-Id: I6a3fd621098466e8275b2e42c0fe54cfb38b5128
Reviewed-on: http://gerrit.openafs.org/9900
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agolibafs: fix Afs_syscall definition for UKERNEL
Marc Dionne [Wed, 6 Mar 2013 00:38:34 +0000]
libafs: fix Afs_syscall definition for UKERNEL

For the UKERNEL case, Afs_syscall is prototyped and used as (void).
Make the function definition use the void keyword to avoid a warning
about an old style definition.

Change-Id: Ic22f58a6c646d6f557e5891ce2ed51fba50fba35
Reviewed-on: http://gerrit.openafs.org/9402
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agovolser: -log restore operations
Michael Meffie [Mon, 20 May 2013 15:32:04 +0000]
volser: -log restore operations

Add vos restore to the list of operations which are logged
when the volserver is running with the -log option. Example
log line:

    admin on 172.16.50.141 is executing Restore 536870969

Change-Id: Ia6eb07258831865dfe2c85d1b9df078f33c4b640
Reviewed-on: http://gerrit.openafs.org/9926
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoRemove kauth from libuafs
Chaskiel Grundman [Thu, 9 May 2013 14:43:36 +0000]
Remove kauth from libuafs

Remove the uafs_klog() apis from afs_usrops. Nothing uses it except
the obsolete afsweb stuff that isn't built anymore.

Stop linking in all kauth and pts components. Also remove some other
objects from libauth, rxkad, and com_err, that were only present as
dependencies of kauth and pts components

Change-Id: Idf83b3dd1098e874d90244fe72609666b13216a4
Reviewed-on: http://gerrit.openafs.org/9887
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoman-pages: build bos getrestricted / setrestricted
Jeffrey Altman [Mon, 27 May 2013 20:15:19 +0000]
man-pages: build bos getrestricted / setrestricted

build missing bos man pages on windows.

Change-Id: I37ccc402487bae04a7344a4276d246bd535bf1a6
Reviewed-on: http://gerrit.openafs.org/9944
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoLinux 3.10: Replace create_proc_entry() with proc_create()
Marc Dionne [Tue, 7 May 2013 00:20:07 +0000]
Linux 3.10: Replace create_proc_entry() with proc_create()

Add an afs_proc_create() compat function that uses the
appropriate kernel function based on a configure test.

Change-Id: I4f3929849af032f2a483bc06bc5769f64085f1c4
Reviewed-on: http://gerrit.openafs.org/9854
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agovolser: Adjust TLV tag range
Marc Dionne [Sat, 25 May 2013 14:43:45 +0000]
volser: Adjust TLV tag range

Tag values up to D_MAX cannot be used as TLV tags, as the parsing
logic assumes anything up to D_MAX is a control tag.  Adjust
MIN_TLV_TAG to 21 so that the TLV range sits just above D_MAX.

Change-Id: I8d55f536b82e209847400b5ac6689364abe44090
Reviewed-on: http://gerrit.openafs.org/9942
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agolinux: remove linux osi_alloc hash stats
Dan van der Ster [Fri, 24 May 2013 08:12:14 +0000]
linux: remove linux osi_alloc hash stats

The bucket stat vector is maintained but never read. And it is
occasionally annoying since it can flood messages with
"afs_get_hash_stats: Warning! exceeded max bucket len ..."
Remove it.

Change-Id: Ibc2101c038e40c9ff6ab0401c89fd41af75ed831
Reviewed-on: http://gerrit.openafs.org/9937
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: Return bytes_read count from cm_GetData
Jeffrey Altman [Thu, 23 May 2013 20:57:21 +0000]
Windows: Return bytes_read count from cm_GetData

The existing interface for cm_GetData takes an input buffer and
a buffer size and no method by which the number of bytes read into
the buffer can be returned.  Add an output parameter to permit it.

Change-Id: I777d2fba850fb39d4323b006e3c79afa5ff4c2ff
Reviewed-on: http://gerrit.openafs.org/9930
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoDAFS: Avoid useless attach2 error message
Andrew Deason [Mon, 13 May 2013 20:33:42 +0000]
DAFS: Avoid useless attach2 error message

Since commit 53230846a202a50f6c3a61b38d62ccba8876f89d, attach2 logs an
error when we force a volume to an error state due to attachment
errors. This is to ensure that we never end up with a volume in an
error state without logging a message about it.

However, while this is useful for the fileserver, for non-fileserver
programs this situation is very common for VNOVOL errors and does not
represent an actual problem. For the fileserver, nonexistent volumes
should be caught before we hit attach2 (in e.g. GetVolume when we
can't find a volume structure), so errors here can be significant and
should be rare. But for e.g. the volserver, when we try to use a given
volume id, we just try to attach it directly, so if the volume doesn't
exist, we will hit this code path.

This can happen pretty often for the volserver, since many volume
operations try to determine if a volume already exists by trying to
attach it. In those cases, this error message is pretty much useless
noise. So, get rid of it if we are non-fileserver, and the error we
got is VNOVOL. It is not as important for non-fileserver that we put a
volume in an error state, since volume states are much more transient
for non-fileserver programs, since the volume structs don't stay
around very long.

Change-Id: Ie2c221af2b55af70d725f0f52dacbb7fd8788349
Reviewed-on: http://gerrit.openafs.org/9907
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agovldb_check: print vlentry file offsets
Michael Meffie [Mon, 13 May 2013 17:59:50 +0000]
vldb_check: print vlentry file offsets

To aid in debugging, consistently print the vlentry database "address"
and the file offset when displaying errors for vlentries.  Print the
vlentry file offsets when printing all the entries with the -entries
option.

Change-Id: I3ef37e6654280f0cff9b2449da29aebe7c5e3aad
Reviewed-on: http://gerrit.openafs.org/9906
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agovldb_check: cope with broken names and volids
Michael Meffie [Mon, 13 May 2013 17:47:06 +0000]
vldb_check: cope with broken names and volids

Fix-up broken vlentry names and rw volid so entries can be looked
up in the vlserver and can be deleted with vos delentry if needed.

Change-Id: Ide4855b0ef149977b04e3f0b5c966b13dd1cf417
Reviewed-on: http://gerrit.openafs.org/9905
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agolinux: Fix leaked dentry reference in the revalidate op
Marc Dionne [Wed, 24 Apr 2013 13:11:09 +0000]
linux: Fix leaked dentry reference in the revalidate op

In one error case, we exit the function without release the
reference on the parent dentry.  This dangling reference can cause
an oops when the client is shut down.

Change-Id: I1632b581f6e7a557bb54a999dc1837c31b8381bf
Reviewed-on: http://gerrit.openafs.org/9802
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoroken: export rk_vasprintf
Jeffrey Altman [Wed, 15 May 2013 19:37:39 +0000]
roken: export rk_vasprintf

missing on windows

Change-Id: I59778e0af6ba407efcdfbcbddec5f8be6e740951
Reviewed-on: http://gerrit.openafs.org/9913
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: Protect against infinite VIO retries
Jeffrey Altman [Fri, 17 May 2013 16:06:00 +0000]
Windows: Protect against infinite VIO retries

Keep track of the number of VIO errors reported by the file servers.
If the count exceeds 100, abandon the request.

Change-Id: I4d18ccca732802752c94c9ca1b36ca9a827c72de
Reviewed-on: http://gerrit.openafs.org/9923
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: AFSNameArrayClone leak in AFSCommonCreate
Jeffrey Altman [Thu, 16 May 2013 19:47:11 +0000]
Windows: AFSNameArrayClone leak in AFSCommonCreate

Do not leak the AFSNameArrayClone if AFSLocateName fails.

Change-Id: I01ea5ac7261de2cd2e715e7d110cb5e09173938c
Reviewed-on: http://gerrit.openafs.org/9922
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: remove unused and leaked uniRootFileNameClone
Jeffrey Altman [Thu, 16 May 2013 10:47:13 +0000]
Windows: remove unused and leaked uniRootFileNameClone

In AFSCommonCreate remove the allocated but never used but leaked
'uniRootFileNameClone' Unicode string.

Change-Id: I02a4a1a2383c5a85f2a939b4d18e38def4cf2687
Reviewed-on: http://gerrit.openafs.org/9920
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: NotifyHardLink avoid null ptr reference
Jeffrey Altman [Mon, 13 May 2013 14:09:11 +0000]
Windows: NotifyHardLink avoid null ptr reference

In AFSNotifyHardLink, if the TargetDirectoryCB out parameter is non-NULL
but pDirNode is NULL, do not attempt to increment the
DirOpenReferenceCount because doing so will trigger an exception.

Change-Id: I9d50e05aff9a4922113f814dd3d50e115725ecca
Reviewed-on: http://gerrit.openafs.org/9903
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: Fix trace msg typo in AFSDeleteDirEntry
Jeffrey Altman [Tue, 9 Apr 2013 16:26:31 +0000]
Windows: Fix trace msg typo in AFSDeleteDirEntry

The name of the function in the trace messages is wrong.

Change-Id: I7a1b86765ca8fde828615069c66e51f5e5dce4ca
Reviewed-on: http://gerrit.openafs.org/9899
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoLinux: osi_TryEvictVCache: Don’t skip the first dentry if D_ALIAS_IS_HLIST
Anders Kaseorg [Tue, 7 May 2013 04:27:33 +0000]
Linux: osi_TryEvictVCache: Don’t skip the first dentry if D_ALIAS_IS_HLIST

An hlist doesn’t begin with a sentinel like a list does, so the old
code would skip the first dentry or crash with a NULL dereference if
there wasn’t one.  Use the kernel’s list_for_each_entry or
hlist_for_each_entry macros instead of trying to do it manually.

Should fix a crash observed by Alex Chernyakhovsky on kernel 3.6 and
newer.

Change-Id: I6d7bd190013a0250ca896af8d5182df55a3376b0
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/9857
Reviewed-by: Alex Chernyakhovsky <achernya@mit.edu>
Tested-by: Alex Chernyakhovsky <achernya@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agopt_util: gcc warning fix
Derrick Brashear [Wed, 1 May 2013 19:59:41 +0000]
pt_util: gcc warning fix

it's claimed these are not initialized before use.
squelch compiler errors. has to be in parent as otherwise
we will zero them in our loop where we potentially want the
parent group id, which is not on "this" line as we add members.

Change-Id: I3014765ad1935cbe20421560329b5bdf465db8af
Reviewed-on: http://gerrit.openafs.org/9840
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agopt_util: be admin
Derrick Brashear [Wed, 1 May 2013 19:58:50 +0000]
pt_util: be admin

cheat and use the noauth flag so we pass the admin checks

Change-Id: Ie064db4fb930529fe474317d096238c915d1ef5b
Reviewed-on: http://gerrit.openafs.org/9839
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: AFSCleanup move CCb access inside try block
Jeffrey Altman [Fri, 10 May 2013 01:48:16 +0000]
Windows: AFSCleanup move CCb access inside try block

A crash dump was examined which showed a deadlock due to the leak
of a SectionObjectResource in a code path in which the holding thread
could not have obtained it.  The FileObject->FsContext2 (Ccb) pointer
referred to invalid memory which may have been due to pool corruption.
The only code path in which the SectionObjectResource is held exclusive
and then the Ccb pointer is used outside of a try-except block is in
AFSCleanup().  Move this reference inside the try-except block just in
case.  If the Ccb is invalid, at least this way AFSRedirLib will catch
the exception and free the SectionObjectResource before continuing.

Change-Id: I08c9baacfc8897ae8d8b551a74976daf7effbcef
Reviewed-on: http://gerrit.openafs.org/9892
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: AFSClose Set FsContext* to NULL
Jeffrey Altman [Thu, 9 May 2013 22:31:19 +0000]
Windows: AFSClose Set FsContext* to NULL

After the Fcb OpenReferenceCount is decremented it is no longer
safe for the Fcb pointer to be referenced.  Set FsContext to NULL.

After the AFSRemoveCcb() call, it is no longer safe to reference
the Ccb pointer.  Set FsContext2 to NULL.

Change-Id: I5be1367c599222df02269bf1ed85ec89ac5d279c
Reviewed-on: http://gerrit.openafs.org/9890
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: AFSClose remove dead code
Jeffrey Altman [Thu, 9 May 2013 22:30:42 +0000]
Windows: AFSClose remove dead code

Change-Id: Ia844d7e01bcf7a04a7115416e83d45bf5319d739
Reviewed-on: http://gerrit.openafs.org/9889
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: AFSCommonWrite do not leak SectionObjectResource
Jeffrey Altman [Thu, 9 May 2013 22:28:09 +0000]
Windows: AFSCommonWrite do not leak SectionObjectResource

If the write request is neither an extending write nor a non-cached
write and (liStartingByte.QuadPart + ulByteCount) >=
pFcb->Header.FileSize.QuadPart, then the SectionObjectResource pointer
will be leaked.  Instead release it before retrying.

Change-Id: Id1ea7a3829a6e2be19280f366e665a11e14fba62
Reviewed-on: http://gerrit.openafs.org/9888
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoubik: Avoid use of freed string
Marc Dionne [Thu, 9 May 2013 16:30:39 +0000]
ubik: Avoid use of freed string

If cellName was just set to dir->cellName, afsconf_Close() will
free the string before fprintf uses it.  Just change the order
so we don't access freed memory and print garbage.

Change-Id: I66792dc50addf2d8242f71923db09fcc178cc450
Reviewed-on: http://gerrit.openafs.org/9886
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: RDR_GetVolumeInfo do not always return success
Jeffrey Altman [Wed, 8 May 2013 18:10:01 +0000]
Windows: RDR_GetVolumeInfo do not always return success

If the call failed because all servers are down or all instances
of the volume are offline or busy, tell the caller.  Do not return
fake data.

Change-Id: I4e89cefba19161c7d75cfdfd04a1cf7dfc2398f4
Reviewed-on: http://gerrit.openafs.org/9882
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: cm_Analyze if no retry don't sleep
Jeffrey Altman [Wed, 8 May 2013 18:08:59 +0000]
Windows: cm_Analyze if no retry don't sleep

If error handling response is not going to result in a retry of the
call, do not sleep.

Change-Id: I12435612f94a2e6afb77b5a2975f90f66e02823a
Reviewed-on: http://gerrit.openafs.org/9881
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoWindows: only retry ALLBUSY for five minutes
Jeffrey Altman [Wed, 8 May 2013 17:08:30 +0000]
Windows: only retry ALLBUSY for five minutes

Add a volbusyCount field to cm_req_t.  Increment the count each time
CM_ERROR_ALLBUSY is processed by cm_Analyze for a given request.
Wait 15 seconds between retries and retry up to 20 times and then
fail.  This prevents requests from blocking for a volume that isn't
going to come back online for hours.

Change-Id: I25e68565700dddceebecedf552d1e04cbe39b22a
Reviewed-on: http://gerrit.openafs.org/9876
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

7 years agoFreeBSD: VOP_MMAP has been dead since 1996
Ben Kaduk [Thu, 28 Mar 2013 21:10:29 +0000]
FreeBSD: VOP_MMAP has been dead since 1996

Clang complains that our (K&R!) declaration of struct vop_mmap_args
will only be visible within the (empty) function.
With the kernel's CFLAGS, though, this is fatal.
Remove the dead code.

Change-Id: I8fd768b36b73f9e2f727dae4e748931f307444c8
Reviewed-on: http://gerrit.openafs.org/9856
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

7 years agoWindows: Release Notes updates
Jeffrey Altman [Wed, 8 May 2013 01:50:40 +0000]
Windows: Release Notes updates

Document ReparsePointPolicy registry value.

Document known Explorer Shell Paste bug.

Update ShortNames registry value.

Document Cygwin 1.7.18-1 support for AFS Symbolic Links.

Change-Id: Ifdcea9c71fb23d4e9cf9ad50907dd6f50c5c619e
Reviewed-on: http://gerrit.openafs.org/9869
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>