openafs.git
13 years agoubik: Abstract buffer matching and pass trans ptrs
Andrew Deason [Tue, 22 Jun 2010 18:24:27 +0000]
ubik: Abstract buffer matching and pass trans ptrs

Abstract the code for matching buffers in DRead, and pass around
ubik_trans pointers instead of ubik_dbase pointers. This changes no
behavior, but makes changing ubik buffer code a bit easier.

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

13 years agoDon't include afsconfig.h in rxgen headers
Simon Wilkinson [Sat, 21 Aug 2010 11:05:37 +0000]
Don't include afsconfig.h in rxgen headers

Some headers generated by rxgen are installed. We can't use
afsconfig.h in installed headers, as it isn't installed (and it
shouldn't be, as it contains autoconf defines which will almost
certainly have namespace conflicts with other packages)

Revert the portion of 972a407 that added afsconfig.h to the
h_output function. This should now be safe as stds.h no longer
relies on the result of autoconf tests.

FIXES 127931

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

13 years agos390x: only declare afs_sys_setgroups32_page where needed
Marc Dionne [Fri, 20 Aug 2010 20:11:59 +0000]
s390x: only declare afs_sys_setgroups32_page where needed

Variable afs_sys_setgroups32_page is only used when __NR_setgroups32
is not defined.  Make the declaration depend on it as well to clear
up an unused variable warning.

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

13 years agoFixes for signed char architectures
Marc Dionne [Fri, 20 Aug 2010 20:37:56 +0000]
Fixes for signed char architectures

"char" is unsigned on s390x, which causes a few warnings where we
test for negative values.

Add a signed modifier in a few cases, and in vos.c replace with an
int to match a similar section of code in the same file.

Mostly a warning fix, but in one case the variable could be used
to return a -1 error value, so it may have caused an actual bug.

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

13 years agoIgnore old style definition warnings in generated code
Marc Dionne [Fri, 20 Aug 2010 21:42:47 +0000]
Ignore old style definition warnings in generated code

Older flex can generate functions that trigger the
"old-style-definition" warning.
Since it's generated code, just ignore it.

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

13 years agoPrototype warning cleanup - big endian
Marc Dionne [Fri, 20 Aug 2010 20:27:44 +0000]
Prototype warning cleanup - big endian

Move function definitions above their use in quad_cksum.c and
remove the (incomplete) prototypes.

Clears up a few warnings on big endian systems.

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

13 years agoConfigure: Tidy up AC_CHECK_FUNCS
Simon Wilkinson [Fri, 20 Aug 2010 12:17:53 +0000]
Configure: Tidy up AC_CHECK_FUNCS

Move all of our AC_CHECK_FUNCS calls into a single, ordered, list
so that it's easier to see what's being checked for and what's not.

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

13 years agohcrypto: Check for arc4random
Simon Wilkinson [Fri, 20 Aug 2010 12:07:04 +0000]
hcrypto: Check for arc4random

Add a configure test for the arc4random function which hcrypto can
use as an entropy source

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

13 years agoAdd a few missing entries to our .gitignores
Simon Wilkinson [Fri, 20 Aug 2010 12:19:30 +0000]
Add a few missing entries to our .gitignores

Add a couple of build products to the relevant .gitignore files

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

13 years agohcrypto: Fix for IRIX
Simon Wilkinson [Thu, 19 Aug 2010 23:18:17 +0000]
hcrypto: Fix for IRIX

Fix the hcrypto build for IRIX, by including param.h in the
configuration header so that the platform specific redefinitions of
"inline" work correctly.

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

13 years agoAvoid thread-unsafe PrintInode in threaded code
Andrew Deason [Mon, 12 Jul 2010 20:47:15 +0000]
Avoid thread-unsafe PrintInode in threaded code

Some potentially-threaded callers were calling PrintInode with a NULL
first argument, which is not threadsafe. Alter them to use local
storage.

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

13 years agoWindows: vol-salvage SalvInfo fixes
Andrew Deason [Thu, 19 Aug 2010 16:35:40 +0000]
Windows: vol-salvage SalvInfo fixes

Commit 3d7388b790ef21de552ec60d379764df067ae421 broke the windows
build. Fix it:

 - SVGParms_t has no salvinfo member, but an svgp_salvinfo member

 - Correct the SalvageVolumeGroup prototype to match the actual
   implementation

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

13 years agoAdd OpenAFS build machinery for libhcrypto
Simon Wilkinson [Wed, 7 Apr 2010 20:45:39 +0000]
Add OpenAFS build machinery for libhcrypto

Add an OpenAFS build environment for the symmetric algorithms in
libhcrypto.

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

13 years agoRemove the global tempHeader/stuff structures
Andrew Deason [Thu, 22 Apr 2010 22:09:18 +0000]
Remove the global tempHeader/stuff structures

Currently, volinodes.h defines an array ('stuff') for easily accessing
information about different inode types. Part of the array points to
parts of a global 'tempHeader' structure, making this not threadsafe.
Change this into an interface which utilizes local storage to make
this threadsafe and remove those horridly-named global variables.

This adds the init_inode_info static inline function, for initializing
a local inode information table.

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

13 years agovol-salvage: Move global vars into SalvInfo struct
Andrew Deason [Thu, 24 Jun 2010 20:45:05 +0000]
vol-salvage: Move global vars into SalvInfo struct

Reduce the number of globals used in the salvager code, by making
functions pass around a 'salvinfo' structure that contains the
information regarding a particular salvage.

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

13 years agolibafsrpc: Add new XDR symbols to exports
Simon Wilkinson [Thu, 22 Jul 2010 14:22:09 +0000]
libafsrpc: Add new XDR symbols to exports

Add the new XDR symbols which we've recently introduced to the
exports list so they can be used from the shared libraries

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

13 years agoWindows: fix Freelance trailing dot enforcement
Jeffrey Altman [Tue, 17 Aug 2010 05:24:39 +0000]
Windows: fix Freelance trailing dot enforcement

The cm_enforceTrailingDot() function failed if there was a
trailing dot followed by white space.

LICENSE MIT

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

13 years agoImport of code from heimdal
Heimdal Developers [Sun, 9 May 2010 18:33:54 +0000]
Import of code from heimdal

This commit updates the code imported from the external
heimdal git repository to their revision
40ef7759b917648938416e15521d383e2eade5cf
which is described as switch-from-svn-to-git-1333-g40ef775

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

13 years agoHeimdal import: Add hcrypto files
Simon Wilkinson [Sat, 15 May 2010 21:48:37 +0000]
Heimdal import: Add hcrypto files

Add the files which we intend to use from Heimdal's hcrypto library
to the list of files which we import from the Heimdal git repo.

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

13 years agoHandle whitespace better in import script
Simon Wilkinson [Sun, 16 May 2010 12:04:47 +0000]
Handle whitespace better in import script

Make the import script handle multiple, rather than just single,
whitespace separators between source and destination files.

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

13 years agoWindows: Fix remove 'register' patch
Jeffrey Altman [Tue, 17 Aug 2010 06:13:31 +0000]
Windows: Fix remove 'register' patch

The register removal patch broke the Windows build.
Fix it.

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

13 years agodeath to trailing whitespace
Marcus Watts [Tue, 17 Aug 2010 03:52:36 +0000]
death to trailing whitespace

if we're gonna clean up...

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

13 years agodeath to register
Marcus Watts [Thu, 15 Jul 2010 03:13:20 +0000]
death to register

in soviet compilers, compiler optimizes you.
stop providing dated (and annoying for debugging) register keywords.

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

13 years agoopenafs 1.5.76 openafs-devel-1_5_76
Derrick Brashear [Thu, 12 Aug 2010 04:33:58 +0000]
openafs 1.5.76

make openafs 1.5.76

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

13 years agoWindows Change Log for 1.5.76
Jeffrey Altman [Thu, 12 Aug 2010 05:47:41 +0000]
Windows Change Log for 1.5.76

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

13 years agoWindows: Return error for SetToken PIOCTL_LOGON if not LocalSystem
Jeffrey Altman [Mon, 16 Aug 2010 18:27:44 +0000]
Windows: Return error for SetToken PIOCTL_LOGON if not LocalSystem

If the PIOCTL_LOGON flag is set and the user is not LocalSystem,
return Access Denied.

LICENSE MIT

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

13 years agoWindows: prevent buffer overrun in cklog
Jeffrey Altman [Mon, 16 Aug 2010 14:09:22 +0000]
Windows: prevent buffer overrun in cklog

The Windows version of klog.exe will overwrite the realm and
password buffers if the command line input is too long.  Generate
an error and terminate the program instead.

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

13 years agoWindows: Only Local System Account may set tokens for alternate ids
Jeffrey Altman [Thu, 12 Aug 2010 05:48:16 +0000]
Windows: Only Local System Account may set tokens for alternate ids

Only permit tokens to be set for alternate ids from the system
account.

LICENSE MIT

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

13 years agoWindows: Parse Freelance entries and enforce trailing dot but no trailing ws
Jeffrey Altman [Sat, 14 Aug 2010 00:58:43 +0000]
Windows: Parse Freelance entries and enforce trailing dot but no trailing ws

Make sure that there is a trailing dot and no trailing whitespace
for both Mount Point and Symlink entries read from the Freelance
registry key.

LICENSE MIT

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

13 years agoautoconf detection of label support
Chaz Chandler [Wed, 4 Aug 2010 18:17:03 +0000]
autoconf detection of label support

acinclude.m4 now has struct label support detection and sets
HAVE_STRUCT_LABEL_SUPPORT in afsconfig.h.  Obviates complicated
ifdefs in various src/afs/ and src/rx/ files.  Must run regen.sh
to generate new configure and afsconfig.h.in, then configure will
detect label support and set afsconfig.h appropriately.  Not sure
what to do for Windows, but should be a step in the right
direction.

Fixes issue with compilation of libuafs on IRIX and sunpro by accurately
detecting label support.

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

13 years agoLinux: avoid oops in memcpy_toiovec
Marc Dionne [Thu, 12 Aug 2010 20:33:04 +0000]
Linux: avoid oops in memcpy_toiovec

With ADAPT_PMTU enabled, kernel_recvmsg can be called to receive
errors.  The call is made with no iovec supplied (we pass a NULL
pointer), but with a size of 256.  In the kernel, the memcpy_toiovec
function tests for size > 0, and proceeds to check iovec->iov_len,
which causes an oops.  Fix by setting the size to 0.

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

13 years agoLinux: Rework statfs super block operations configure test
Marc Dionne [Wed, 11 Aug 2010 23:28:53 +0000]
Linux: Rework statfs super block operations configure test

The configure test to detect if the statfs super block operation
needs a dentry argument is based on vfs_statfs, and assumes that
its signature matches the one of the operation.  In 2.6.36 this is
no longer true and the test fails.

Rework the test to actually test the operation we're interested in.

This change is required for 2.6.36.

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

13 years agoLinux: switch to evict_inode
Marc Dionne [Wed, 11 Aug 2010 22:55:29 +0000]
Linux: switch to evict_inode

In 2.6.36, the delete_inode and clear_inode inode operations
are replaced by evict_inode.
Rename our current clear_inode to evict_inode, and add a few
things that were previously handled by the generic delete_inode.

This is required for 2.6.36.

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

13 years agoLinux: adapt to truncate sequence changes
Marc Dionne [Wed, 11 Aug 2010 22:20:59 +0000]
Linux: adapt to truncate sequence changes

As part of changes to the truncate sequence, inode_setattr() no
longer exists, and all filesystems have to define the setattr op
so we can assume that it is not NULL.

Introduce a compat inline function afs_inode_setattr that hides
the tests and the different versions from the main code.

Note that the existing test for the inode_setattr() return type
will fail, but the value is no longer used in that case.

This is required for 2.6.36

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

13 years agoLinux: use %pI4 if NIPQUAD is not available
Marc Dionne [Wed, 11 Aug 2010 21:18:32 +0000]
Linux: use %pI4 if NIPQUAD is not available

The definition of NIPQUAD has been removed from the kernel headers
in the mainline kernel.  Replace it by using the %pI4 format
specifier which takes the IP address as a single argument.

There should be no change in the output.

This fix is required for 2.6.36.

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

13 years agodisable pmtu error gathering
Derrick Brashear [Thu, 12 Aug 2010 04:48:45 +0000]
disable pmtu error gathering

don't enable kernel pmtu, don't collect errors.

a report from Marc Dionne suggests there are still issues here

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

13 years agoWindows: comparisons of nul strings should match
Jeffrey Altman [Thu, 12 Aug 2010 04:48:44 +0000]
Windows: comparisons of nul strings should match

When comparing nul strings in cm_strnicmp_utf8 and cm_strnicmp_utf16
the functions should return 0.

LICENSE MIT

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

13 years agoviced: VNOVOL on deleted volumes
Andrew Deason [Tue, 10 Aug 2010 19:16:39 +0000]
viced: VNOVOL on deleted volumes

When the volserver deletes a volume, the fileserver should respond to
future access to that volume with VNOVOL and not VOFFLINE, since the
volume doesn't exist anymore. Do this in DAFS via a new state,
VOL_STATE_DELETED, and in non-DAFS by just setting specialStatus to
VNOVOL.

In the future we should also make sure the vp's for deleted volumes
get freed after a couple of hours, but not yet.

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

13 years agovolser: Ignore duplicate file tags when restoring
Andrew Deason [Fri, 6 Aug 2010 19:32:16 +0000]
volser: Ignore duplicate file tags when restoring

Currently, if the volserver encounters multiple file tags for a vnode
when restoring a volume dump, it will create extra vnodes which are
not recorded anywhere, and are leaked when the volume is removed.
Instead of doing that, ignore any duplicate file tags that are
encountered (which is what happens with other tags), and log a
warning.

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

13 years agoLINUX: More flock fixes
Simon Wilkinson [Wed, 11 Aug 2010 22:14:31 +0000]
LINUX: More flock fixes

Turns out the we have two almost identical lock routines on Linux,
one for POSIX locks, and one for flocks. Fix them both. Also,
while we're at it, make the same fixes in the LINUX24 tree.

Thanks to Andrew Deason for pointing out the oversight in the
original patch (5abe706a7e237d3872db3638d947a14c935370d5)

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

13 years agofs discon support alternate uid
Derrick Brashear [Wed, 4 Aug 2010 13:38:10 +0000]
fs discon support alternate uid

this is a short-term hack. macos lacks pags, and anywhere without
pags won't have tokens when fs discon online is run as root unless
the tokens are explicitly set for root... which can be bad mojo.

instead, allow a uid to be passed in.

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

13 years agomacos disconnected vnode holding fix
Derrick Brashear [Mon, 2 Aug 2010 18:02:37 +0000]
macos disconnected vnode holding fix

tweak how we hold vcaches to avoid issues with the underlying
vnode having an iocount underrun due to races.

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

13 years agoLINUX: Use correct type of error in flock code
Simon Wilkinson [Wed, 11 Aug 2010 16:25:36 +0000]
LINUX: Use correct type of error in flock code

The flock code gets a kernel error code from afs_posix_lock_file()
but then passes this error code through afs_convert_code (which sees
that it is already negative, and returns EIO). Instead, we should just
return afs_posix_lock_file()'s code direct to our caller.

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

13 years agoWindows: cm_Analyze should treat VOFFLINE like VMOVED or VNOVOL
Jeffrey Altman [Wed, 11 Aug 2010 05:10:38 +0000]
Windows: cm_Analyze should treat VOFFLINE like VMOVED or VNOVOL

Volume package bugs in the file server can result in VOFFLINE
being returned to the client instead of VNOVOL or VMOVED.  As
a result the Unix CM treats VOFFLINE the same as VMOVED and VNOVOL.
The Windows client has not.  As a result, bugs in the file server
can cause the Windows client to lose if the volume has in fact
been moved to another server.

As part of this change, the volume location list is updated prior
to the volume status being applied to the server from which the
error was received.

LICENSE MIT

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

13 years agosalvage: update inodes array after CopyAndSalvage
Andrew Deason [Tue, 27 Jul 2010 21:22:47 +0000]
salvage: update inodes array after CopyAndSalvage

CopyAndSalvage makes a copy of the directory to salvage it. So, the
new directory will have a new inode. Update the array of directory
inodes to reflect this. Without this, we can fail to alter the
copied/salvaged directory later on, since we will try to read/write to
the wrong inode.

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

13 years agosalvage: Remove redundant 'code' declaration
Andrew Deason [Tue, 27 Jul 2010 22:22:49 +0000]
salvage: Remove redundant 'code' declaration

'code' is declared at the top of SalvageVolume; no need to declare it
again in a lower block.

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

13 years agosalvage: Do not look at not-found root dir
Andrew Deason [Wed, 28 Jul 2010 17:01:01 +0000]
salvage: Do not look at not-found root dir

If we have not found any root directory, don't even look at
'oldrootdir' or 'rootdir', since they will be uninitialized at this
point.

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

13 years agosalvage: Zero corrupted header
Andrew Deason [Wed, 28 Jul 2010 17:00:37 +0000]
salvage: Zero corrupted header

In the salvager, if we read in a corrupt header (either we get a short
read or the magic is mismatched), make sure we zero out the contents,
so we don't read garbage further on.

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

13 years agotviced: Fix serialize_state.o objdir
Andrew Deason [Thu, 5 Aug 2010 02:33:05 +0000]
tviced: Fix serialize_state.o objdir

At least some makes treat ./serialize_state.c as only in the current
dir, ignoring VPATH. So just specify serialize_state.c.

Change-Id: I250886cb4bbfb955984b39c5a7d1a1acd5d9e0c4
Reviewed-on: http://gerrit.openafs.org/2524
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoEliminate $< outside of pattern rules
Andrew Deason [Wed, 4 Aug 2010 22:08:37 +0000]
Eliminate $< outside of pattern rules

The $< variable in makefiles is not portable when used outside of
pattern rules. Replace each usage with the actual name of the file we
want.

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

13 years agoFix objdir install/dest targets
Andrew Deason [Wed, 4 Aug 2010 19:49:28 +0000]
Fix objdir install/dest targets

Many 'install' and 'dest' targets were referring to source files
without a srcdir prefix. Fix them so we can 'make install' / 'make
dest' with objdir.

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

13 years agotubik: Fix objdir builds
Andrew Deason [Wed, 4 Aug 2010 19:01:51 +0000]
tubik: Fix objdir builds

 - Make netutils.c include afs/dirpath.h, so we don't have to find the
   correct include dir for "dirpath.h"

 - Fix dependencies in tvlserver, tbudb, and tptserver, and refer to
   sources in srcdir where appropriate

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

13 years agoFix afsd.fuse for objdir builds
Andrew Deason [Wed, 4 Aug 2010 18:59:35 +0000]
Fix afsd.fuse for objdir builds

afsd_fuse.o could not find afsd_fuse.c for objdir builds. While we're
here, make the afsd_fuse.o rule more closely match the rules close by.

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

13 years agorxgen: Error out if cpp exits with error
Andrew Deason [Wed, 4 Aug 2010 16:19:35 +0000]
rxgen: Error out if cpp exits with error

If we call 'cpp' and it returns with an erroneous exit code, exit with
an error ourselves. Otherwise we will return success and generate
empty results even if the input file is unreadable, for instance,
which causes confusing errors later in the build.

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

13 years agonamei decodevolume allow low volume ids
Derrick Brashear [Fri, 23 Jul 2010 15:27:46 +0000]
namei decodevolume allow low volume ids

the smallest thing which can be encoded is a single character;
also allow it to be decoded, such that low numbered volumes
are treated as valid.

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

13 years agoWindows: add flags field to smb_ioctlProc_t function signature
Jeffrey Altman [Thu, 5 Aug 2010 19:07:47 +0000]
Windows: add flags field to smb_ioctlProc_t function signature

Add a general framework to permit flags to be passed into the
smb ioctl interface functions.  This patchset does not define
any such flags.

LICENSE MIT

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

13 years agoUnix CM: Remove erroneous comment
Simon Wilkinson [Sat, 24 Jul 2010 13:21:52 +0000]
Unix CM: Remove erroneous comment

Despite what the comment says, shutdown_axscache does have a caller,
so just remove the comment lest it confuse people.

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

13 years agoWindows: optimize buf_FlushCleanPages
Jeffrey Altman [Thu, 5 Aug 2010 05:43:24 +0000]
Windows: optimize buf_FlushCleanPages

If the pages to be flushed are from a readonly or backup volume
they can't be dirty.  In this case there is no need to stabilize
the pages before they are locked and recycled.

Stablilization is performed on the cm_scache_t object so do not
stabilize and unstablize for each cm_buf_t object.

LICENSE MIT

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

13 years agoUnix: docbook revision tag requires a date
Andrew Deason [Thu, 5 Aug 2010 03:49:29 +0000]
Unix: docbook revision tag requires a date

The docbook DTD requires a <revision> element to contain a <date>
element. So make a blank <date> one even though we don't keep track of
a date, so we can pass xmllint.

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

13 years agoAdd DAFS docs to the Unix Quick Start guide
Andrew Deason [Tue, 3 Aug 2010 22:32:11 +0000]
Add DAFS docs to the Unix Quick Start guide

Modify the sections dealing with creating the 'fs' bnode to also
mention how to create the 'dafs' bnode, and add an appendix explaining
DAFS and the differences between DAFS and non-DAFS.

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

13 years agoHPUX: Add limits.h to sysincludes
Andrew Deason [Tue, 3 Aug 2010 17:01:07 +0000]
HPUX: Add limits.h to sysincludes

xdr_mem uses INT_MAX, so we need limits.h in the kernel for HP-UX.

Change-Id: I5c75f9d3cb9cfd5da78cf625f042c1dee862dcd7
Reviewed-on: http://gerrit.openafs.org/2506
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agofix unlabelled xdr field order on sun457 kernel for now
Derrick Brashear [Wed, 4 Aug 2010 13:22:20 +0000]
fix unlabelled xdr field order on sun457 kernel for now

alternate to 2503 (which we will push after branching)

Thanks to Andrew Deason for discovering this issue.

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

13 years agodiscon remove dirty vcaches from queue when discarding
Derrick Brashear [Wed, 4 Aug 2010 13:04:34 +0000]
discon remove dirty vcaches from queue when discarding

the discardall loop was not dequeueing vcaches, meaning we would loop.
caught by Simon Wilkinson

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

13 years agoreorder vcache references in discondiscardallshadows
Derrick Brashear [Wed, 4 Aug 2010 13:02:54 +0000]
reorder vcache references in discondiscardallshadows

reset the vcache before we (nominally, it's still under a lock)
discard it. remove superfluous shadow clearing.

Caught by Simon Wilkinson

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

13 years agodiscon getparentvcache leak fix
Derrick Brashear [Wed, 4 Aug 2010 13:00:58 +0000]
discon getparentvcache leak fix

don't leak an unref'd vcache pointer if we are returning an error
(EAGAIN). thanks to Simon Wilkinson for catching this.

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

13 years agodiscon needs static_inline macro
Derrick Brashear [Wed, 4 Aug 2010 12:42:16 +0000]
discon needs static_inline macro

don't use static inline keywords in common code.

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

13 years agodarwin unused prototype
Derrick Brashear [Wed, 4 Aug 2010 12:41:00 +0000]
darwin unused prototype

we don't gave our own vn_rele. don't prototype it.

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

13 years agoutil: add afs_exec_alt
Andrew Deason [Thu, 29 Jul 2010 19:47:03 +0000]
util: add afs_exec_alt

Add the function afs_exec_alt to help programs easily execute an
"alternate" version of themselves. For example, for programs that are
built with/without DAFS support, or are built for 32-bit/64-bit
structures, etc.

Change-Id: Ibb2b7105d58476f84bd9f15987f8b7df37314b6b
Reviewed-on: http://gerrit.openafs.org/2483
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agotbudb: Use INSTALL_PROGRAM, not INSTALL -f
Andrew Deason [Tue, 3 Aug 2010 20:44:52 +0000]
tbudb: Use INSTALL_PROGRAM, not INSTALL -f

"$INSTALL -f" is not portable. Use $INSTALL_PROGRAM instead.

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

13 years agoWindows: Reduce complexity of Freelance Callback Logic
Jeffrey Altman [Tue, 3 Aug 2010 03:28:39 +0000]
Windows: Reduce complexity of Freelance Callback Logic

Over the years the processing of the Freelance callbacks have
added functionality that behaves much more like FetchStatus checks
to a file server.  If the data version of the object has changed,
get the new data.  Given that is the case, we can remove much of
the original refresh logic that is rather race prone.   Say goodbye
to cm_fakeGettingCallback and cm_fakeDirCallback.

LICENSE MIT

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

13 years agoWindows: When processing pioctl paths ensure callbacks are obtained
Jeffrey Altman [Mon, 2 Aug 2010 20:06:39 +0000]
Windows: When processing pioctl paths ensure callbacks are obtained

When processing a pioctl path with either smb_ParseIoctlPath or
smb_ParseIoctlParent, cm_SyncOp(CM_SCACHESYNC_NEEDCALLBACK|GETSTATUS)
must be called on the cm_scache_t object to ensure that it is up
to date before we permit cm_Lookup or other operations to be performed
on it.  Add the cm_SyncOp() call to smb_ParseIoctlPath and
smb_ParseIoctlParent to ensure it is done for all pioctl operations.

LICENSE MIT

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

13 years agofs disconnected remove ifdefs
Derrick Brashear [Mon, 2 Aug 2010 18:51:39 +0000]
fs disconnected remove ifdefs

disconnected is always on; remove the ifdefs around it

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

13 years agoWindows: docbook revision tag requires a date
Jeffrey Altman [Mon, 2 Aug 2010 17:30:30 +0000]
Windows: docbook revision tag requires a date

Even if we can't generate a date, we must include the date tag
within the revision tag in order for the docbook dtd to be applied
and pass xmllint.

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

13 years agoWindows: Don't configure client when not installing client
Asanka Herath [Sat, 31 Jul 2010 08:30:10 +0000]
Windows: Don't configure client when not installing client

The 32-bit tools installer was displaying client configuration wizard
pages.  Since, the 32-bit tools share configuration with the AFS
service, the 32-bit tools installer should not be attempting to change
client configuration.  Remove said wizard pages from the 32-bit tools
installer.

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

13 years agoWindows: Fix MC options
Asanka Herath [Sat, 31 Jul 2010 17:07:44 +0000]
Windows: Fix MC options

Newer versions of the Message Compiler included with Windows SDKs
break when using the -s option.  Remove it.

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

13 years agoptserver: Do not use cell for entry name len check
Andrew Deason [Fri, 30 Jul 2010 20:32:53 +0000]
ptserver: Do not use cell for entry name len check

Do not use the local cell name when determining if a new entry name is
too long. This check assumes that foreign cells will use our local
cell name (assumed to be our local Kerberos realm) in a certain way,
and prevents creating users that will make those names too long.

This is undesirable for several reasons. One is that the local realm
name may not be the same as the local cell name (and we may have many
local realms). Another is that we cannot reliably predict how foreign
cells will construct foreign pt entry names, so preventing entry
creation based on that may prevent names that will never cause any
problems. This check also assumes that our names will be used as
foreign entries in other cells, which may not be the case.

So, remove the check based on the local cell name, and remove the
pr_realmNameLen variable while we are at it, since this is all it is
used for.

Thanks to Jeffrey Altman for discussion, and for bringing this up in
the first place.

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

13 years agoWindows: Do not reference cm_data.rootSCachep directly
Jeffrey Altman [Sat, 31 Jul 2010 04:21:06 +0000]
Windows: Do not reference cm_data.rootSCachep directly

cm_data.rootSCachep is a global pointer to the cm_scache_t that
represents the root.afs volume root directory.  Throughout the
code this cm_scache_t was being used without ensuring that a
callback to the volume is in fact valid.

Under most circumstances this would not be a problem.  However,
it is possible for a request to fail due to the lack of a callback
at a critical moment.  Add a new function cm_rootScachep() that
attempts to ensure that a callback is present (if possible) prior
to use the cm_scache_t object.

LICENSE MIT

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

13 years agoWindows: Update root.afs scache dv when Freelance dir bufs are regenerated
Jeffrey Altman [Sat, 31 Jul 2010 04:05:24 +0000]
Windows: Update root.afs scache dv when Freelance dir bufs are regenerated

When the contents of the Freelance root directory changes the fake
directory buffers are updated and a fakeDirVersion is incremented.
The dataVersion of the cm_scache_t object is supposed to be updated
on the next access by performing a fake get callback request.
Unfortunately, this did not always occur because of a race.  If another
Freelance object is updated first, the root directory object would
never successfully get a fake callback.

This patchset ensures that the generation of the fake directory
buffer content and the callback are obtained under the same set
of locks thereby removing the race.

LICENSE MIT

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

13 years agoFactor out the common text in vos_addsite, vos_copy, and vos_zap
Jason Edgecombe [Mon, 2 Aug 2010 01:39:56 +0000]
Factor out the common text in vos_addsite, vos_copy, and vos_zap

Factor out some common options out of the man pages.

LICENSE IPL

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

13 years agoWindows: Build preprocessed POD documentation
Asanka Herath [Sat, 31 Jul 2010 16:43:47 +0000]
Windows: Build preprocessed POD documentation

Change-Id: I0b849bf52094a1b6ca0e45db5e2f92ff58b8efba
Reviewed-on: http://gerrit.openafs.org/2493
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoSOLARIS: let xlator load if amd64/nfssrv is loaded
Andrew Deason [Mon, 2 Aug 2010 05:44:37 +0000]
SOLARIS: let xlator load if amd64/nfssrv is loaded

The NFS translator-enabled kernel module refuses to load if
misc/nfssrv is not also loaded. We were only checking misc/nfssrv and
misc/sparcv9/nfssrv, though, not misc/amd64/nfssrv. Check that, too,
as it may be loaded on amd64 machines.

Reported by Robert Milkowski.

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

13 years agoWindows aklog: remove lstat preprocessor definition
Jeffrey Altman [Mon, 2 Aug 2010 13:49:26 +0000]
Windows aklog: remove lstat preprocessor definition

lstat is now defined globally in the build system.
remove redundant definition.

LICENSE MIT

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

13 years agoWindows aklog: include afs/pterror.h
Jeffrey Altman [Mon, 2 Aug 2010 13:48:07 +0000]
Windows aklog: include afs/pterror.h

pterror.h is required for initialize_PT_error_message

LICENSE MIT

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

13 years agoSkip over 'fragments' directory when scanning for PODs
Asanka Herath [Sat, 31 Jul 2010 08:00:41 +0000]
Skip over 'fragments' directory when scanning for PODs

The generate-html script scans the directories to compile a list of
POD files.  The list of candidates include the 'fragments' directory,
which causes an error when the script attempts to open it as a file.

Change-Id: If1208561f58f869ccba60f4a263bee5200dad1ed
Reviewed-on: http://gerrit.openafs.org/2494
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>

13 years agoptserver: Allow longer foreign user names
Andrew Deason [Fri, 30 Jul 2010 17:03:06 +0000]
ptserver: Allow longer foreign user names

The ptserver was restricting all names to be less than PR_MAXNAMELEN -
pr_realmNameLen - 1, so that the local realm and a '@' can be safely
appended for foreign user registration. This check is overly
restrictive for foreign users, since the local realm will never be
appended to the user name (it already has the foreign realm name
appended). So, just check for PR_MAXNAMELEN for foreign users.

Original issue reported by Gunnar Krull.

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

13 years agoDocument krb.excl
Andrew Deason [Fri, 30 Jul 2010 19:45:29 +0000]
Document krb.excl

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

13 years agoFBSD: update ifa_ifwithnet usage
Ben Kaduk [Sat, 31 Jul 2010 01:20:06 +0000]
FBSD: update ifa_ifwithnet usage

FreeBSD 8.1 (and 9.0) now require a second parameter to
ifa_ifwithnet.  Fix the build by using the same macro
as OBSD46.

Change-Id: I22eac8722bef79b6349b9d879eb42d63450b362e
Reported-by: Jan Henrik Sylvester
Reviewed-on: http://gerrit.openafs.org/2489
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoDocument the 'vos offline' -busy and -sleep opts
Andrew Deason [Thu, 29 Jul 2010 18:02:47 +0000]
Document the 'vos offline' -busy and -sleep opts

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

13 years agoRemove bless-related options from vos manpages
Andrew Deason [Thu, 29 Jul 2010 17:43:25 +0000]
Remove bless-related options from vos manpages

'vos online' and 'vos offline' were documented as taking -bless and
-unbless options, respectively. They do not actually take these
options, and since adding that functionality, while useful, will
require protocol changes, they are likely to take some time to appear.

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

13 years agoInstall DAFS and non-DAFS fssync-debug
Andrew Deason [Thu, 29 Jul 2010 15:36:56 +0000]
Install DAFS and non-DAFS fssync-debug

Install the non-DAFS fssync-debug along with the DAFS dafssync-debug,
since fssync-debug uses some structures that are specific to DAFS or
non-DAFS.

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

13 years agomacos prefs pane improved error handling
Derrick Brashear [Thu, 29 Jul 2010 14:59:35 +0000]
macos prefs pane improved error handling

NSScanner: nil string argument
is a lame thing to see. so let's not.

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

13 years agoviced: Correct unblessed attach2 errors
Andrew Deason [Wed, 28 Jul 2010 22:10:10 +0000]
viced: Correct unblessed attach2 errors

Don't set the vp to NULL; instead just go to the general error
handling code. When a volume is not blessed, we just want it to go
offline, not go into an error state. Furthermore, we must free the
volume header when nUsers is set to 0, so manually do so when we do
not call VRequestSalvage_r.

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

13 years agovol-bless: Detach, not put, volumes on completion
Andrew Deason [Wed, 28 Jul 2010 22:47:21 +0000]
vol-bless: Detach, not put, volumes on completion

vol-bless was just calling VPutVolume when it was done blessing or
unblessing a volume. Instead call VDetachVolume, so we actually give
the volume back to the fileserver when we are done if !nofssync.

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

13 years agogcc 4.5: Sequence point warning fixes
Marc Dionne [Mon, 12 Jul 2010 23:28:24 +0000]
gcc 4.5: Sequence point warning fixes

With gcc 4.5 the -sequence_point warning triggers some new
warnings.
Fix some of them by simplifying the arguments to some
problematic macros.

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

13 years agounix blacklistonce should default to fail if no fid
Derrick Brashear [Mon, 26 Jul 2010 20:15:46 +0000]
unix blacklistonce should default to fail if no fid

return fail, rather than success, if no fid and thus
no list of servers to resort, in BlackListOnce.

will need a later change for vlservers

reported by jhutz@cmu.edu

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

13 years agosalvage: Zero root/readme vnodes before writing
Andrew Deason [Thu, 22 Jul 2010 18:43:17 +0000]
salvage: Zero root/readme vnodes before writing

Previously we were writing out the root and readme vnodes with
uninitialized 'lock' structures, when we create a new root dir for
attaching orphans. Just use calloc so we ensure that everything is
zeroed before writing it out.

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

13 years agoautoconf: Force absolute INSTALL
Andrew Deason [Thu, 22 Jul 2010 17:21:14 +0000]
autoconf: Force absolute INSTALL

Force using an absolute path for install-sh. Autoconf normally prefers
using a relative path, which confuses (at least) part of the libafs
build system.

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

13 years agoRemove tsalvaged warning inhibition
Andrew Deason [Thu, 22 Jul 2010 16:24:10 +0000]
Remove tsalvaged warning inhibition

tsalvaged has no documented necessary warning inhibitions, and it
appears to cause no warnings. So, remove the warning inhibition.

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

13 years agoAFS_INT64_FMT takes a afs_int64, not int64_t
Andrew Deason [Thu, 22 Jul 2010 16:34:24 +0000]
AFS_INT64_FMT takes a afs_int64, not int64_t

Cast to afs_int64, as int64_t can reduce to a different type than
AFS_INT64_FMT's.

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

13 years agoLog lex/flex detection errors in the config log
Andrew Deason [Wed, 21 Jul 2010 22:30:39 +0000]
Log lex/flex detection errors in the config log

When we detect if lex is flex, we run 'lex --version', which may
complain to stderr if lex is not flex. Instead of printing such errors
to the person running 'configure', redirect stderr to config.log along
with stdout.

Change-Id: I812805245a2638eda5885a41a6d70ffeff608c58
Reviewed-on: http://gerrit.openafs.org/2462
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Russ Allbery <rra@stanford.edu>