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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Add rxgk boilerplate

Error table, protocol description, and stubs for the security object
routines, with header to declare them.

The public header rxgk.h currently only contains the security level enum
and includes the RPC interface and com_err code headers.

Change-Id: I7893f78119bb4aef12112cc1e51e1ec69de326c2