macos: update decode-panic

fix a couple brain-os from the last round of updates, so it can
actually decode panics.

Change-Id: If39f1fb273a834d0618264d944387bd8b6751284
Reviewed-on: http://gerrit.openafs.org/8929
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>
Windows: Police the DEBUG TRACE ioctls

When we get a IOCTL_AFS_GET_TRACE_BUFFER, a IOCTL_AFS_CONFIGURE_DEBUG_TRACE
or a IOCTL_AFS_FORCE_CRASH, we check to see whether the caller is in the
Administrators group and if it isn't we fail the request with ACCESS_DENIED.

NOTE that this does not check whether the user has done the "run as admin"
thing.  We actually need to determine which priviledges are appropriate to
this action and use that rather than group membership to police these actions
and this will be added in a later patch.  Meanwhile this represents a
significant increment in security from previously.

Change-Id: I0997e59a82735735674d8edee7a7a68d241e6ef8
Reviewed-on: http://gerrit.openafs.org/8843
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Windows: Police Library IOCTLs

Ensure that the callers of the various library ioctls have
the correct identity or privs.  All this policing is done in
the fs (non unloadable) layer, and to ensure that the library
layer cannot receive these calls directly we forbid non
create Opens of the library control device.

Change-Id: I2342fe10047642082adfbd1cc6aaee09cc91b520
Reviewed-on: http://gerrit.openafs.org/8893
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
FreeBSD 9.1: Warning fixes

Fix warnings caused by some changes in FreeBSD 9.1:

 - afs_cmount takes a uint64_t for flags instead of an int
 - vn_rdwr takes a ssize_t* for resid instead of an int*

[kaduk@mit.edu: rebase onto master and use fine-grained version checks]

Change-Id: I03ab805a625790004a910df96b96aeda1121e2a7
Reviewed-on: http://gerrit.openafs.org/8922
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
rx: Remove warning inhibition on rx.c

The CFLAGS_NOERROR rule for rx.c seems to have crept back in as
part of the libtool changes. The LWP build of rx.c has never had
warning inhibition on rx.c, and the inhibition in the pthread
builds was removed by 327762071be3806c5d08be0218982c7027754756

Change-Id: Icde3f0b6ee2f8ae0818a3dc722c6171284d6a9e6
Reviewed-on: http://gerrit.openafs.org/8921
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
aklog: Fix allow_weak_crypto warning

It's _crypto, not _enctypes. The user will just be more confused than
before if we tell them to do the wrong thing.

Change-Id: Ib94b14efbd3c89d9f58fb8985326ee8691fd993b
Reviewed-on: http://gerrit.openafs.org/8938
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
SOLARIS: Use vn_renamepath as early as possible

Commit 6c509601 uses the vn_renamepath when we are building on Solaris
11. However, some recent patch level of Solaris 10 (more recent than
stock 10u10) has the same problem fixed by that commit, where
vn_setpath takes an additional argument. So instead, just test for the
existence of vn_renamepath itself, so we also use it on Solaris 10
when we can.

Thanks to Rich Sudlow for reporting this.

Change-Id: Ic1c0437d2438c6e19b8fff8278ecda9b96bd020b
Reviewed-on: http://gerrit.openafs.org/8920
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Windows: Use %p for ptrs in redirector trace messages

Pointers were being logged with %08lX which results in partial
pointer values being logged on 64-bit systems.

Change-Id: Ic11e5b607b3df41f145536dfcb02dfa22537ee77
Reviewed-on: http://gerrit.openafs.org/8943
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
libafs: fs flushall for unix cm

Implement the fs flushall command on the unix cache manager to flush
all volume data.  Uses a new common pioctl code point VIOC_FLUSHALL (14),
registered with the grand.central.org assigned numbers.

Change-Id: I214d8c762573b308d79fa7122a91d48ddd403eb9
Reviewed-on: http://gerrit.openafs.org/7540
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
CellServDB update 28 Jan 2013

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

Add an entry for 1.6.2 with "in progress" instead of a date to hold the
release notes for 1.6.2pre4 rather than creating separate entries for
each release candidate. Users who track the release candidates can refer
to the public announcements, and this will be cleaner when reading
history later on.

Change-Id: I625044e20836e072b62ffa738eca23f1d11813a5
Reviewed-on: http://gerrit.openafs.org/8750
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Rework set_header_word macros

Rework the set_header_word macros so that all compilers are
happy:
- the use of offsetof() is avoided, as it has an issue on IRIX
when the result is not constant
- the assignment within the macro is explicitely sequenced before
the function call to avoid a gcc sequence-point warning

Change-Id: I2355233e865b155f958379bfa2736fee19ef2680
Reviewed-on: http://gerrit.openafs.org/8816
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Windows: AFSRemoveCcb cannot fail

Since AFSRemoveCcb cannot fail, change the signature from returning
NTSTATUS to void.

Remove all error handling code.

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

The new AFSInitCcb() allocates its own DirOpenReferenceCount to
associate with the AFSCcb.DirectoryCB.

It also accepts the GrantedAccess mask and the FileAccess values
which are stored in the AFSCcb.

These changes simplify the callers and remove responsibility of
tracking whether or not the DirOpenReferenceCount was successfully
associated with the AFSCcb.

The allocated DirOpenReferenceCount is always released by
AFSRemoveCcb().

Change-Id: Ib475310d934830974c553e0eeff96b114a56541b
Reviewed-on: http://gerrit.openafs.org/8852
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Windows: Fix AFSLocateNameEntry prototype

The VolumeCB parameter is an IN/OUT parameter.

Change-Id: I3eb4231e0d095cc98cc5847905d61d924d12e6f3
Reviewed-on: http://gerrit.openafs.org/8853
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Windows: AFSClose() DirOpenReferenceCount handling

Unless the caller of AFSRemoveCcb() steals the DirectoryCB object
from the AFSCcb before calling AFSRemoveCcb(), AFSRemoveCcb() will
release the reference count.

In all but one case where the DirectoryCB must be accessed after
the AFSCcb is destroyed AFSClose() can now let AFSRemoveCcb() do the
work.

Change-Id: I8d631d79b2465cd6f2e31444fd052270b078915c
Reviewed-on: http://gerrit.openafs.org/8854
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Windows: AFSNotifyFileCreate() DirOpenReferenceCount handling

This patchset consolidates the releasing of the DirOpenReferenceCount
within AFSNotifyFileCreate() into the try_exit block.  This clarifies
the logic and avoids duplicate code blocks.

Change-Id: I82e964f579f9e8b6e095291ace0bbe2cdac5af60
Reviewed-on: http://gerrit.openafs.org/8855
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Windows: AFSNotifyHardLink() DirOpenReferenceCount handling

This patchset consolidates the releasing of the DirOpenReferenceCount
within AFSNotifyHardLink() into the try_exit block.  This clarifies
the logic and avoids duplicate code blocks.

Change-Id: I7bf7e5af55646ea570c76e36a673900521a3582c
Reviewed-on: http://gerrit.openafs.org/8856
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Windows: AFSSetFileLinkInfo() DirOpenReferenceCount handling

AFSSetFileLinkInfo() would leak a DirOpenReferenceCount when
pNewTargetDirEntry is not NULL upon exit.  It also did not
properly handle a STATUS_REPARSE response from AFSNotifyHardLink().
The AFSInsertDirectoryNode() call should not be performed when
the result is STATUS_REPARSE since that means the entry already
exists.

Change-Id: Ibbf497cb4c3c412e4f95cdffc6025f03f0e2ed8b
Reviewed-on: http://gerrit.openafs.org/8857
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Windows: AFSSetRenameInfo DIRENTRY_REF_COUNTING

When logging the result of the DirOpenReferenceCount increment,
use lCount instead of referencing the DirOpenReferenceCount field
which could have been changed.

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