Commit Graph

8280 Commits

Author SHA1 Message Date
Jeffrey Altman
3ab948769c Windows: netidmgr_plugin move roken.h to afscred.h
Due to historical issues with the MIT KFW headers
the netidmgr plugin must define _USE_32BIT_TIME_T
which alters the size of time_t in all C RTL data
structures that include it.   roken.h must be included
after this definition in order for it to do the right
thing in conjunction with the MIT KFW headers.  This
means that an exception to the rule that roken.h must
be one of the first three files included in every
source file in the tree must exist for this directory.
In the netidmgr_plugin directory, afscred.h includes
roken.h and afscred.h is the first header included
in all other files.

Change-Id: I11214e5eaac0144aaf04c3a21bb92d521d75c6e1
Reviewed-on: http://gerrit.openafs.org/3616
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-01-04 08:41:16 -08:00
Jeffrey Altman
605b7c3baa Windows: permit clean when switching platforms
When switching between i386 and amd64 in the same build tree
the "clean" make directive would fail due to NTLang.bat not
having been built in the new platform's destination directory.
Force NTLang.bat to be built as a dependency of cleanup and
delete it at the end along with the version files.

Change-Id: I49a44204c636ab9ad89be44d4fad20ed6050fdda
Reviewed-on: http://gerrit.openafs.org/3615
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-01-03 18:24:15 -08:00
Simon Wilkinson
bf163cbebf roken: Check for bswap16 and bswap32 defines
Our imported roken.h provides definitions for bswap16 and bswap32,
but configure doesn't check to see if those functions already exist.
On operating systems where they do, and where the header containing
them is included in our build, this results in compilation errors.

Add a configure test for bswap16 and bswap32, which is complicated
by the fact that they may be macros, or static inline functions, so
a simple CHECK_FUNCS won't work.

Change-Id: Iae3411bf4bb22af8cfd770e01026a28e1863e078
Reviewed-on: http://gerrit.openafs.org/3613
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-01-03 06:38:42 -08:00
Simon Wilkinson
735f5b0515 Unix CM: Don't blow up if we have non-rxkad tokens
The legacy GetToken compatibility code assumed that we would always
have at least one rxkad token for a cell, and segfaulted if we didn't.

Just return as if we have no tokens if a cell doesn't have an rxkad
token.

Change-Id: Ica64882c1a64cf140ad6c277c70fbfb747ea6235
Reviewed-on: http://gerrit.openafs.org/3614
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-01-03 06:38:18 -08:00
Simon Wilkinson
c8fc94fb86 autoconf: Tidy up header includes
Tidy up our list of header includes so it's easier to see what
we're testing for. The list is now one-per-line, in alphabetically
sorted order.

Note that this won't affect our use of the default include set, as
autoconf will already have tested for all of those before it starts
this CHECK_HEADERS run.

Change-Id: Iffc8c3bc7cbd56d87508ebdde38e61f8747d0501
Reviewed-on: http://gerrit.openafs.org/3612
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-01-03 06:37:45 -08:00
Simon Wilkinson
a0adc8cd6e auth: Move key related code to its own file
Move all of the libauth code which does KeyFile management out
into its own file, in preparation for a major rewrite.

Change-Id: Id880136307cba726c04a003700ba70f3d74b297f
Reviewed-on: http://gerrit.openafs.org/3611
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-01-02 06:20:43 -08:00
Simon Wilkinson
cfee25cdc8 libadmin: Don't use internal struct for key data
The afsconf_dir structure should be regarded as private to the libauth
library, which provides accessors for the commonly used parameters
within it. Rework libadmin so that it uses those accessors when looking
up key data.

Change-Id: I9a623ccadba95622894931ee25319d3bcb019136
Reviewed-on: http://gerrit.openafs.org/3608
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-01-02 06:20:24 -08:00
Simon Wilkinson
e0efb936ff tests: Add more tests for auth KeyFile handling
Add tests to make sure that we serialise updated KeyFiles to and
from disk correctly, and that the restriction on 8 keys in a KeyFile
is enforced by AddKey

Change-Id: Iac5bf7157534879824da92ea58f1515672d59298
Reviewed-on: http://gerrit.openafs.org/3610
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-01-01 21:21:53 -08:00
Simon Wilkinson
4d7a0615d8 roken: Export more snprintf symbols
Export more of the snprintf symbols from librokenafs, so that we
can actually make use of them.

Change-Id: Ida347c516bec6444d26d0e148ffd781999f0b364
Reviewed-on: http://gerrit.openafs.org/3609
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2011-01-01 21:21:23 -08:00
Simon Wilkinson
13ae3de3f6 Add "brief" option to rxgen
Add a new -b option to rxgen that turns on "brief" output. This makes a
number of changes to the data definitions produced by rxgen so they can
be more easily used by the calling code.

The changes are:
   *) Use the new struct rx_opaque structure for all opaque data
      definitions, rather than defining each as a unique structure.
      This permits moving opaque data between rxgen structures to be
      performed by simple assignment.
   *) Use anonymous structures for internal definitions. Currently
      rxgen also uses the field name as the structure name, which
      prevents the use of a field name more than once within a
      source file.
   *) Don't embed the structure name within the names of the elements
      within the structure. This significantly reduces the length of
      assignment code, and makes for more readable callers.

Change-Id: I8cad7e6051f12238a77cf006b0854fb38b54f61a
Reviewed-on: http://gerrit.openafs.org/2585
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-01-01 21:19:51 -08:00
Simon Wilkinson
b114faf52f rx: Implement rx_atomic_dec_and_read
Add a function which decrements an atomic counter, and returns the
result. This is essential for implementing reference counting.

Change-Id: Ib173f078bcf117369a82f981d58124018648a71c
Reviewed-on: http://gerrit.openafs.org/3581
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-01-01 19:22:03 -08:00
Simon Wilkinson
50b1c161e8 rx: Protect rx_atomic.h against multiple inclusion
Add #ifdef guards so that rx_atomic.h can't be included in the same
C file multiple times.

Change-Id: Ic62287ce4a21b9efbfd9530e2517029a69217a56
Reviewed-on: http://gerrit.openafs.org/3580
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-01-01 19:20:28 -08:00
Simon Wilkinson
1879e1bce2 auth: Don't crash if UserList contains bogus line
If the first line of the UserList was bogus (caused ParseLine to
return an error), then we would attempt to free the contents of
an uninitialised identity structure, and crash. Initialise the
structure so this no longer happens.

Change-Id: I55074a5eb616ac48d8a278db2d8389d3b0e112a6
Reviewed-on: http://gerrit.openafs.org/3607
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-01-01 19:18:43 -08:00
Simon Wilkinson
a7fb426259 rx: Don't crash when emptying an empty identity
In common with our other freeContents functions, freeing the contents
of a structure which is already empty shouldn't crash.

Change-Id: I93b54c0e450d2184c10575b50dadfd1471d43289
Reviewed-on: http://gerrit.openafs.org/3606
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2011-01-01 19:18:28 -08:00
Vincent Archer
616763cd07 Windows: MIT license applies to parsemode()
Vincent Archer grants permission to OpenAFS to re-license
his MINIX contributions under the MIT license.  A copy of the
e-mail granting permission is located in OpenAFS RT issue 128805.

FIXES 128805

Change-Id: I59774d14a0099f5a48dbc9dbf13157136b8c681f
Reviewed-on: http://gerrit.openafs.org/3605
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-12-30 08:46:41 -08:00
Jeffrey Altman
b6576d8cb5 Windows: buf_CleanAsync scp->fid == bp->fid
If buf_CleanAsync or buf_CleanAsyncLocked are called
with a non-NULL cm_scache_t parameter, that status object's
fid must be the same as the associated cm_buf_t object.
If not, the wrong locks will be held.

If the cm_scache_t parameter is NULL and cm_FindSCache()
returns NULL, it means that the cm_scache_t object associated
with the bp->fid has been flushed from the cache.  cm_GetSCache()
must therefore be called to allocate a new status object for the
FID.  If the status object cannot be allocated, then any dirty
data stored in the buffer will be discarded.

Change-Id: Ie5d4eb8a1090d4b3c0753b7ddee2de0799485a2e
Reviewed-on: http://gerrit.openafs.org/3604
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-12-29 11:50:22 -08:00
Jeffrey Altman
4e32073357 Windows: fs checkserver skip multi-homed up server
Multi-homed file servers can be detected by comparing the
uuid for the cm_server_t entries.  If a server has at least
one up interface, do not list it as being down in the "fs checkserver"
response list.

Change-Id: I718eeee3316d05a33a4af97ca6c7fd947db41f44
Reviewed-on: http://gerrit.openafs.org/3603
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-12-28 13:12:06 -08:00
Jeffrey Altman
e4b59c6339 Windows: fs checkservers should list vldb as well
The Windows fs checkservers has only listed offline
file servers.  Include vldb as well to match the Unix
cache manager.

Change-Id: I81b8e4a1a813fcd8f19e3dc58c75ef161795518c
Reviewed-on: http://gerrit.openafs.org/3602
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-12-28 13:11:52 -08:00
Jeffrey Altman
463b045b9f vos: do not mix memory allocation methods
ListVLDB mixed memory allocated with xdr_alloc() and memory
allocated with malloc().  This is not safe to do since it is
possible on some platforms for xdr_alloc() to allocated memory
using a method other than the malloc() linked to the vos
executable.

Instead of stealing the xdr_alloc()'d buffer, allocate a new
buffer and copy the contents.

Change-Id: Icdda3d4d0b7c15464fe7f48123f3e0ebed4c2cc5
Reviewed-on: http://gerrit.openafs.org/3600
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-12-28 07:03:17 -08:00
Jeffrey Altman
8e9fff9ed8 Windows: cleanup preprocessor definition namespace
Do not use reserved preprocessor symbol names.  Instead
use OPENAFS_<PATH>_<HEADER>_H formatted names where <PATH>
is the subdirectory path from src/ in which the header
file originates in the repository.

Change-Id: I998d7feeddeb9660f3fc514e2ba752c54e402a24
Reviewed-on: http://gerrit.openafs.org/3599
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>
2010-12-28 06:57:37 -08:00
Jeffrey Altman
683747b9c4 Windows: separate parsemode from fs into own file
Separate parsemode() from fs.c into parsemode.c.

Restructure the function prototypes and the fs.h header
to permit building fs.exe from multiple source files.

Change-Id: I80840899706fd585addd165edc13a9e79928427a
Reviewed-on: http://gerrit.openafs.org/3591
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-12-28 06:57:14 -08:00
Jeffrey Altman
a7836dda8c vos: free ubulkentries with xdr_free
Instead of using free() to free the ubulkentries data structure
use xdr_free().

Change-Id: I367e984d1777fcc8a3ec81b501174fae2fd0c8ff
Reviewed-on: http://gerrit.openafs.org/3590
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2010-12-27 16:45:20 -08:00
Simon Wilkinson
9f17cef3d3 tests: Add tests for afsconf_'s key functions
Add tests for all of the public functions that afsconf exports
to manipulate KeyFiles. Include a sample Keyfile to start with, to
ensure that we can continue to read KeyFiles produced by current
versions of the code.

These tests are here to catch regressions with a forthcoming rewrite
of KeyFile handling.

Change-Id: I02aaff82aa7e1b7a73981c7cf26a81164e0dd932
Reviewed-on: http://gerrit.openafs.org/3598
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-12-27 14:39:37 -08:00
Simon Wilkinson
8992210f27 Don't trust # of entries from ListAttributes
ListAttributes returns the number of entries in its array as an RPC
argument. But, we can't trust this, as it could be manipulated and
end up pointing past the end of the returned array (which is counted,
so the entries argument is actually pointless).

Add bounds checking to the functions which use this value to prevent
this problem.

Change-Id: I62398d8f6b5c54318c1a42f1bad67a21c90ef944
Reviewed-on: http://gerrit.openafs.org/3597
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2010-12-27 12:21:54 -08:00
Andrew Deason
95ef4cfd39 Remove extra trailing \s in Makefiles
Remove a few extra trailing \s in Makefiles in viced and bozo. Some
'make's (such as the make on HP-UX) interpret this to e.g. include the
following "headers=" stuff to be included in LIBS, which obviously
causes problems.

Change-Id: I7a49ce5b8d40636bb3b4fe7978aa25b5411c7eed
Reviewed-on: http://gerrit.openafs.org/3575
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-12-27 12:02:45 -08:00
Simon Wilkinson
02a2f60050 volser: Fix broken bulk conversion
The converstions between the original, N and U bulk list return
values were all broken in various ways:

1/ Shifting from malloc to xdr_alloc() (in 4f1efdc8b7)
   subtly changed the behaviour when handling an empty list. The
   correct XDR representation of an empty list is {0, NULL}, not
   {0, &memZero}. Fix the code so that if the source list is empty,
   an empty destination list is returned.
2/ The destination list length was never being filled in. This means
   that xdr_free() could not be safely used on this list, as the wrong
   length would be passed to the allocator. Fill in the destination
   list length as part of the conversion.
3/ xdr_free(...) is a no-op when called with an empty list - there's
   no need to check before calling it. Remove these checks to improve
   the code's readability.
4/ xdr_free(...) should only be called when the RPC returned
   sucessfully. The stub is responsible for freeing data should the call
   fail mid way through unmarshalling.
5/ Where an RPC returns the number of entries independently of the
   length of a counted array, it is unsafe to use that length to
   iterate the array without checking that it is within the array
   bounds. Instead, just use the array length when performing
   conversions.

Change-Id: Ied9a77849062e5a1e506f13d4d90d116cefe41e4
Reviewed-on: http://gerrit.openafs.org/3596
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2010-12-27 11:56:23 -08:00
Simon Wilkinson
3503f32848 vos: Abstract out bulk list conversion
Pull the various segments of code that do bulk list conversion into
their own functions. This is purely code reorganisation at this point,
fixes for these functions will follow in subsequent patches.

Change-Id: I941e94aaf776ece85f041d02f5bdbaad5cf5b129
Reviewed-on: http://gerrit.openafs.org/3595
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2010-12-27 11:19:36 -08:00
Andrew Deason
b3c3fe137e Link hcrypto before roken
We must e.g. -lafshcrypto before we -lrokenafs, since stuff in hcrypto
can use functions provided by roken (such as ct_memcmp or
rk_cloexec_file). Fix any users of LIB_hcrypto that do not do this to
put LIB_roken after LIB_hcrypto.

Change-Id: I55f5589a521ed7da7a6692d817e94f18076ff4bc
Reviewed-on: http://gerrit.openafs.org/3584
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-12-27 09:56:09 -08:00
Russ Allbery
676a4efc23 Update NEWS for 1.5.78 and 1.6.0pre1
Based on the release notes.  Add an entry for 1.6.0 with in progress
instead of a date to hold the release notes for 1.6.0pre1 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: I8d14dd0ec030e3d047f1d2e85c888c1d86e7f3c0
Reviewed-on: http://gerrit.openafs.org/3592
Tested-by: Russ Allbery <rra@stanford.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-12-26 10:59:02 -08:00
Simon Wilkinson
83ac1558b6 auth: Add more tests and resulting fixes to userok
Add tests for the functions afsconf_SuperUser() and
afsconf_SuperIdentity(). These had been missing tests because testing
them requires starting a client and a server, so amend the superuser-t
tests so that they can start up a simple server.

Fix a number of problems that the tests expose, with setting (and
freeing) identities in corner cases.

Change-Id: I29f5f9eda7f532c98183d588e488d704f8efad88
Reviewed-on: http://gerrit.openafs.org/3593
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-12-26 10:58:49 -08:00
Derrick Brashear
affc978be7 DAFS: listvol + unsalvagable volumes = intolerable delay
a non- inService volume (or more) plus vos listvol equals pain.
return Salvaging instead of waiting for it in the listvol case.

Change-Id: I02bdbb6448bcf56e97db9324aa723cc753a37632
Reviewed-on: http://gerrit.openafs.org/3588
Reviewed-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>
2010-12-23 11:09:05 -08:00
Andrew Deason
651f66b0ff Prefer libHcurses over libcurses
Use the HP-UX-specific libHcurses instead of libcurses, like we used
to. Otherwise we fail to link some gtx programs.

Change-Id: I7b8a012d5d263c611a144e05466c5435b5ff310a
Reviewed-on: http://gerrit.openafs.org/3583
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-12-22 20:32:29 -08:00
Andrew Deason
1bc2329972 HPUX: Put __HP_CURSES back in
We need __HP_CURSES to be defined in order to get the _maxx WINDOW*
field among other things. Define it on HPUX again (it was taken out as
part of 4a6a00d6f4).

Change-Id: I3a17f270a034d97eea04580b8eae98a1784b5640
Reviewed-on: http://gerrit.openafs.org/3582
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-12-22 20:32:10 -08:00
Simon Wilkinson
e9e52ebc46 rx: Make rx_atomic.h a shared header
Copy rx_atomic.h into the shared header directory so that it can be
used by other modules within the AFS build. Note that we can't actually
install this header onto the system (and it cannot be included by
headers which are installed) because it uses autoconf defines to control
its behaviour.

Change-Id: If543f998faa0608b4f7efab90db31f072f9e9981
Reviewed-on: http://gerrit.openafs.org/3579
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-12-22 11:42:25 -08:00
Derrick Brashear
c845670469 LWP: kill dead code
the pthreads-wrapper LWP doesn't currently compile. it will need
to be revisited if we ever care. remove it (as well as a bit of other
unused code)

Change-Id: I61e7bc493127ec49347ca02b24db8fa79e4cbb28
Reviewed-on: http://gerrit.openafs.org/3564
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-12-21 21:09:24 -08:00
Derrick Brashear
5d218831f3 LWP: don't copy pid to a null pointer
In LWP_CreateProcess we take a pid. if it's null, don't crash.

Change-Id: I2a491788f5ce23a094e65192164838d5bbfc4b31
Reviewed-on: http://gerrit.openafs.org/3556
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-12-21 21:08:24 -08:00
Andrew Deason
fa4b1f3aeb LINUX: Avoid unnecessary afs_ShakeLooseVCaches
Before some of the NewVCache refactoring, we only called
afs_ShakeLooseVCaches when afs_vcount was over (or equal to)
afs_maxvcount. Do this again, so we only try to shake loose vcaches
when we need more vcaches. Otherwise, we will call
afs_ShakeLooseVCaches every single time we want a new vcache when
dynamic vcaches are disabled (such as 2.4 Linux), and we log a warning
when we can't free any (which is likely when there are only 1 or 2
vcaches in use).

FIXES 128756

Change-Id: Ia06f76a6f719e69881b91fb2d975cfc33c85c370
Reviewed-on: http://gerrit.openafs.org/3569
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-12-21 21:07:57 -08:00
Andrew Deason
2ce159fbf4 LINUX: Reduce stack depth on recursive symlink res
Instead of calling vfs_follow_link inside afs_linux_follow_link
ourselves, we can just resolve the next step of the symlink resolution
and set the result in nd_set_link(), freeing the string in
.put_link().

For kernels without a usable symlink text cache, this reduces call
depth when resolving a path containing many symlinks by two frames per
layer of indirection, allowing for more deeply-nested symlink paths to
be usable.

Change-Id: I6886c3b67089c8028fd6ad93ab10eb9173bd6fbe
Reviewed-on: http://gerrit.openafs.org/3433
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-12-21 21:02:15 -08:00
Andrew Deason
64e564b29e Cache bypass: remove ifdefs under src/afs/LINUX24
Same as commit 9657695d34, but for
LINUX24. Remove the AFS_CACHE_BYPASS references in LINUX24, since it
is always enabled. Also remove messages about a "cache bypass patched
module".

Change-Id: I79526ed78752a4c3da7123e5af1c5eb6afc19fe3
Reviewed-on: http://gerrit.openafs.org/3568
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-12-21 08:44:15 -08:00
Derrick Brashear
468ff8e4d2 DARWIN: replace resource merge script ref with binary
Ro is a helper tool; use Rez directly

Change-Id: I7b3f8105344960a149d7fa0ee1fbb3a332486a04
Reviewed-on: http://gerrit.openafs.org/3565
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-12-21 06:19:17 -08:00
Derrick Brashear
0ef3ce2006 DARWIN: make growlagent build not run afoul of ._ fun
in some cases a git checkout would promptly merge the ._ file away,
meaning a subsequent build would fail. just use the developer tools
to set an icon instead of clever tricks.

Change-Id: I34290f0f32cb7ae72a298a7af1ed4bd6a8ef9224
Reviewed-on: http://gerrit.openafs.org/3563
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-12-21 06:11:19 -08:00
Derrick Brashear
9de81541aa DARWIN: make ARCHFLAGS propagate to shlibs
in order that configure not expand ARCHFLAGS (so we can override from
shell) escape the variable.

Change-Id: I9d5c3f4cc58c66be7ffefbd134ba476673be6ea8
Reviewed-on: http://gerrit.openafs.org/3562
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-12-21 06:02:55 -08:00
Ben Kaduk
b1cb3607ff FBSD7: Don't sleep with the glock
On FreeBSD 7.X, vinvalbuf() can (will) sleep; this results in a panic
when the kernel is configured with WITNESS and we hold the glock around
it.
Drop the glock in this case.

Change-Id: I0036aad3059805d77afe9aa9bf7f5d421d6810f8
Reviewed-on: http://gerrit.openafs.org/3551
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-12-20 13:44:11 -08:00
Ben Kaduk
6040a4daa0 Bring FBSD 7.X client back to life
Having been untested for quite some time, we had several
places that needed more conditionals to compile on FreeBSD 7.

Now we compile and start on 7.3-RELEASE, but have locking issues
under actual use.

It seems that we are also incompatible with the Heimdal 0.6.3 in
the base system -- aklog is unable to actually obtain the needed
credential when compiled against that kerberos implementation;
using MIT krb5 1.6.3 from ports works without incident.

FIXES 128612

Change-Id: I831cea711067d04dc276deb171faf3369c55b775
Reviewed-on: http://gerrit.openafs.org/3548
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-12-20 13:43:22 -08:00
Ben Kaduk
28032bc1c1 FBSD: StopListener glocking fixup
afs_osi_Sleep requires the glock (so that it can sleep on it); we
dropped the glock earlier in osi_StopListener because soshutdown and
soclose can sleep, but we must (unconditionally!) acquire it for our
loop waiting on rxk_ListenerPid.

Change-Id: I38c3ab6689a6af7f1693bd3c8348068ee280e530
Reviewed-on: http://gerrit.openafs.org/3549
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2010-12-20 13:43:09 -08:00
Andrew Deason
ad0b390ec5 LINUX24: Define afs_linux_can_bypass
We call afs_linux_can_bypass, so make sure it exists.

Change-Id: Ie4393cc57af1a52748b76d3403370fbd788d9f8a
Reviewed-on: http://gerrit.openafs.org/3554
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-12-20 13:41:27 -08:00
Andrew Deason
6f65ace58d LINUX24: Include linux/pagemap.h
For 2.4 Linux we need to include linux/pagemap.h, otherwise we get
undeclared references to KM_USER0 and PAGE_CACHE_SIZE.

Change-Id: I1bd6c6484a9b46f923fa31d1d45fbfedc243abbd
Reviewed-on: http://gerrit.openafs.org/3553
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-12-20 13:40:27 -08:00
Derrick Brashear
4f89d4ad34 backup: pass in valid dummy pid for LWP
LWP_CreateProcess needs memory passed in; instead of a null pointer,
pass in a pointer to a PROCESS.

Change-Id: I451d803461252e3afb5d89b840a1ee047228d204
Reviewed-on: http://gerrit.openafs.org/3555
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-12-20 13:39:59 -08:00
Ben Kaduk
37c20528df Zero rx_multi_lock before initializing it
FreeBSD's kernel debugging facilities will panic if it detects
an attempt to re-initialize an already-initialized lock, as detected
through some particular bits being nonzero.  Zero everything out
before starting, to prevent this panic.

Change-Id: I7f3abae978d1cbe7eb4908d90c52a0dc46b81e08
Reviewed-on: http://gerrit.openafs.org/3550
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-12-20 08:56:23 -08:00
Jeffrey Altman
afef1712f2 Windows: fs chmod and display mode in fs examine
Make use of the new pioctl VIOC_GETUNIXMODE and VIOC_SETUNIXMODE
operations to display the current mode in fs examine and permit
setting the mode with "fs chmod".   The mode string parsing makes
use of Vincent Archer's code from Minix.  The required copyright
statement and license is attached to parsemode().

afsconfig-windows.h gains definitions for various mode symbols
that are not defined by Visual Studio runtime headers.

Change-Id: I624f73154b7f177f93289e2641da5d9478ea931c
Reviewed-on: http://gerrit.openafs.org/3546
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2010-12-20 08:06:39 -08:00