Move the definitions of the INSTALL_* variables out to
Makefile.config rather than replicating them in each file.
Change-Id: I5f74dcbf544a93716994418bee3be2c51a2a82d0
Reviewed-on: http://gerrit.openafs.org/4781
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
When commit 3f54c934b9c933d5f34644a096c821375db17d97 removed all of
the Windows code from aklog, it missed the stuff in aklog.h. Get
rid of this too, for clarity.
Change-Id: I6d408ffc313d18fd512fa03494a15ec628f1e292
Reviewed-on: http://gerrit.openafs.org/4782
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Commit e4ac552ab79be21d90397079eaf6be7050497752 introduced a global
version lock to ubik, but doesn't initialise this lock before make use
of it. On platforms which require that pthread mutexes are initialsed,
this causes an assertion failure.
Initialise this lock at the same time as we MUTEX_INIT all of our other
locks.
Change-Id: Ib5ef75d443101a823738fba55c0760cb1848dbcf
Reviewed-on: http://gerrit.openafs.org/4780
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reorder the arguments of this recently introduced function to
make client code more readable.
Change-Id: I37f662f849bd96176230f75783e2a1c62d94b8c9
Reviewed-on: http://gerrit.openafs.org/4755
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Print the values of the integers returned in the collection data
when the -debug option is given to xstat_fs_test and xstat_cm_test
test programs. This allows us to at least see what the unformatted
values are when there is a mismatch in timeval sizes between the
host and client (aka the 32/64 bit xstat bug). This change could
break scripts which call the xstat test programs with the debug
option. New debug output are prepended with 'debug:' to be
easily ignored.
Change-Id: I12d8d27306c50fb9f35ade2a080b3bc20542b63f
Reviewed-on: http://gerrit.openafs.org/2878
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
This change permits "fs setacl" to change ACLs in a relative
manner, rather than just setting rights absolutely as it is
done now.
If a single plus (+) or minus (-) character is appended to
the rights' letters argument, the new rights are computed
relatively to the existing ones.
A few examples should make clear that behaviour:
old rights: rights set: new rights:
-----------------------------------------------
rl a+ rla
rlid idwa- rl
rla write- a
rl write- [none] (ie. entry deleted)
[any] read= rl
As shown in the last example, a '=' character got implemented
also (and for free) as an alternative writing of the current
and default behaviour of just setting an ACL.
FIXES 123962
Change-Id: If15a4ab3c69ec44a42c8746a0b93f5e8b785d61e
Reviewed-on: http://gerrit.openafs.org/4496
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tidy up typing in the dir package, so that we have a specific type
for a directory file handle.
Also rename all of the functions to afs_dir_* globablly, rather than
just renaming for kernel code.
Change-Id: I6750a8eb9f0606d5debf9d677a92b9c8a63dbcf3
Reviewed-on: http://gerrit.openafs.org/4745
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
DNew and DRead always returned directory page aligned pointers,
however the directory code further manipulates those pointers,
requiring the DRelease be able to fill a page when passed a pointer
to any address within that page. This is relatively straightforward
in the userspace implementation, but much more complex in the kernel,
where all of the directory pages are not necessarily contiguous.
Resolve this issue by making DNew, DRead and DRelease all return a
new structure, struct DirBuffer. This structure contains both a
pointer to the data, and an implementation specific private
pointer to data describing the page containing the address. The
directory code is free to play with the data pointer as it wishes,
as long as the private pointer to the page is passed through intact.
DRelease (and DVOffset) can then simply use the private pointer for
their operations, without having to walk page lists.
This new behaviour also requires changes to the directory functions
GetBlob, FindItem and FindFid which all return pointers to directory
data.
Change-Id: I8b8b003b789976b593a7c752969f47d55f4ee707
Reviewed-on: http://gerrit.openafs.org/4744
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
As it says on the tin
Change-Id: I2c03f51303d01ccc772c1fc0b2ed1dd0b176892d
Reviewed-on: http://gerrit.openafs.org/4764
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The vos listaddrs command repeatedly reuses a bulkaddrs array. It
zeros it once (without freeing the allocated memory), and then
repeatedly uses it without zeroing in a loop. This means that the XDR
library assumes that a sufficiently large block is already allocated,
doesn't reallocate for the incoming data, or check limits.
This means that if the first call to VL_GetAddrsU returns a set of
addresses smaller than subsequent calls, we'll write past the end
of the array, causing memory corruption.
Fix this by freeing the arrays correctly with each pass of the call.
Change-Id: I540d369c1529ec3574548f42cbd48b6c2b38cebd
Reviewed-on: http://gerrit.openafs.org/4756
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
When compiling libafscp in separate objdir,
make dest and make install fail, because of wrong
pathes. Fix it.
Change-Id: Id2b672bce308609d99b343322babe890ec8d6a38
Reviewed-on: http://gerrit.openafs.org/4761
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Bozo needs to call rxInitHost() rather than rxInit() when -rxbind is
present. This patch causes it to read NetInfo/NetRestrict earlier in
the startup process so it can make that decision.
FIXES 57286
Change-Id: I17058f4e8e5c23fdfcfe56178d5edc5dcceafb7a
Reviewed-on: http://gerrit.openafs.org/4729
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
if bulkstat is called and fakes up vnodes for non-dir cases, it can
guess wrong, and we end up needing to fix up the type by swapping
in a new vnode under the vcache. however, references are tracked on
the vnode, and more importantly, callers can know about the vnode;
unlinking a vcache from a vnode leaves null pointers to blow up on.
thing is, we shouldn't end up with a un-fixed-up vcache in use:
any caller of ProcessFS will notice if the vnode is the wrong type,
and fix it. so in order to reach CStatd, we have to fix it.
the only places where we can get a vcache in use not CStatd are:
FindVCache, LookupVCache, GetVCache where InReadDir. The last happens
only on Linux. LookupVCache doesn't happen anywhere that matters
(CForeign, or we immediately dispose...). FindVCache is only called
somewhere which won't lead to us fixing up during create, but that
vnode isn't returned to callers; we finalize in the result of create
and return the vnode that's linked to the vcache, which will be correct.
so, the only other place we can have a reference which won't immediately
get fixed up is in lookup, across the bulkstat call. if that's true,
and we return from bulkstat a non-CStatd vcache, lookup will fill in the
entry manually. so, if there are references remaining after we do a fixup,
unmark CStatd so the caller (presumably lookup, given the above) will give
back the vcache and retry, getting a corrected vnode as a result, with
the reference on the vnode we want it on.
Change-Id: I3b225c8d48067624f3cbac7b1f897e52193a8d55
Reviewed-on: http://gerrit.openafs.org/4722
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
With linux 2.6.8 the struct read_descriptor_t changed.
Add a configure-test and respective ifdef to deal with that.
Change-Id: Iff1a6252707cd2119bdc0382c641934119ea0422
Reviewed-on: http://gerrit.openafs.org/4719
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
AC_CHECK_LINUX_STRUCT does not work for structs which are typedef'd.
The gcc will complain with "error: storage size of ‘_test’ isn’t known"
and fail the test.
Thus the new test-macro AC_CHECK_LINUX_TYPED_STRUCT.
Change-Id: Ib3e933c4e09a3e950ca8d8e7a66909d86f10cfdf
Reviewed-on: http://gerrit.openafs.org/4718
Reviewed-by: Christof Hanke <christof.hanke@rzg.mpg.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Starting in FreeBSD 8.0, there is support for multiple virtual
network stacks (generally to be exposed to separate jail(8) environments).
It is enabled as a kernel configuration option, so our builds against
GENERIC have not failed, but we fail to build when options VIMAGE
is present. Fix our variable references accordingly.
Change-Id: I679361b8ea62b0eae90c0aa61287dfc2dd189481
Submitted-by: Hiroki Sato of freebsd.org
Reviewed-on: http://gerrit.openafs.org/4721
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Move the -flag parameter to be the first parameter, to test more of
the positional argument handling.
Change-Id: I637c58e8c76bfc23919f29a1c598084275426773
Reviewed-on: http://gerrit.openafs.org/4710
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
We need to give a NULL pointer for string OUT arguments, so XDR knows
to allocate a new string. Also free the string each time so it gets
set back to NULL.
Change-Id: I1eb0c63dc4019b855a2cbecd9e35393f2fbb0fd7
Reviewed-on: http://gerrit.openafs.org/4708
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Add an accessor function which can return a unsigned int for an
option value.
Change-Id: I33bc9a2618191ca60b95086624100b54efb05ab2
Reviewed-on: http://gerrit.openafs.org/4652
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
If the first parameter of a libcmd syntax is a flag, cmd_Parse was
skipping over positional arguments, since j will be 0 at this point
(the j variable is only used if we're processing an explicit switch).
Effectively revert this area to what it was before
a2f1ca5fd52ac2fb7e68b101bbe3da9878c10474 so such positional parameters
work again.
Also move the j variable to inside the only block in which it is used,
to try and avoid such mistakes in the future.
Change-Id: Ifa52cecf50a3f561c70de351a9ebd026e90eeeab
Reviewed-on: http://gerrit.openafs.org/4711
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
A recent change (commit 80fe111f0044aa7a67215ad92210dc72cb7eb2c0)
to afs_vcache.c contains a call to afs_warn() whose second parameter
contains a "(uintptr_t)" type cast as part of a double type cast.
This presents an issue on some systems, such as OpenBSD, where this
object type is defined in a header that is not presently included.
This change modifies that type cast to instead use the AFS-internal
"(uintptrsz)" type which should provide the same effect.
Note that an earlier version of this patch ateempted to remove the
"offending" type cast as redundant but it was pointed out that some
systems require this kind of cascading type cast when casting pointers
to integers to deal with possible size issues.
Change-Id: Iea81b2be1050a1c929978a99c518d86c6d1f2118
Reviewed-on: http://gerrit.openafs.org/4671
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Include any command aliases in the output from the -help option
Change-Id: Ifb2ac96d9ba6fc64bffff69bac9480a6b7e8568e
Reviewed-on: http://gerrit.openafs.org/4651
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
On namei fileservers, also print the namei filenames of the volume special
files when the -header flag is given.
Change-Id: I90112f13d0f39348ee3862fdbdb55074e8877108
Reviewed-on: http://gerrit.openafs.org/4696
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Do not print the volumes aux totals prematurely when running
volinfo with the -headers flag on an namei fileserver. Instead
print the aux totals only once after the link table size is found.
Change-Id: I4538e2fc8978530fd2e8593e0b343a2497c7a764
Reviewed-on: http://gerrit.openafs.org/4694
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Print volinfo errors messages to stderr instead of a mix of stdout
and stderr. Print a consistent program name.
Change-Id: Ifadae52d56a75ff7d73d639ff1dd893b1a926a28
Reviewed-on: http://gerrit.openafs.org/4693
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Fix the volume size calculation when volinfo is invoked with
both -sizeOnly and -saveinodes at the same time.
Change-Id: Ifafe6a128918500ac6fd5f9a1e39de2d4aff785d
Reviewed-on: http://gerrit.openafs.org/4691
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Add the namei -filenames option to the volinfo man page.
Note this option as implemented implies the -vnode flag, but for
consistency with the other fields that modify the default mode
output, it is documented to be accompany the -vnode flag.
Change-Id: I7cc5cdf5e74e65ca25ecc086e550a468b803b971
Reviewed-on: http://gerrit.openafs.org/4690
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Fix the logic for checking the presense of the volinfo -filenames
option. The original patch inadvertently added the -filenames
check as an if-else cause to the -orphaned flag check, which
prevents filenames from being printed when listing orphaned
vnodes.
Change-Id: I070d796e7ea9c0f5df9cf92a17eaa4004444d423
Reviewed-on: http://gerrit.openafs.org/4689
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
simplify the logic which can require sleeps in various vcache
resolution paths. instead of the two-pass system we had before,
just guess using the even/odd hack what type a vnode will be.
if a vnode turns out to be a link and thus we are wrong, we
do a fixup later. other callers who "race" with bulkstat
(which is a supported feature, otherwise you'd have to block
callbacks) will also call through a fixup to get the correct
backing vnode type. this is necessary as the KPI doesn't
let us change the type of a vnode after it's been created.
side effect: eliminate many of the ugly cases where we had been
sleeping waiting for a vnode to be finalized even before bulkstat.
Change-Id: Ib888fa5577d48354725ea72305765e4341bc2366
Reviewed-on: http://gerrit.openafs.org/4677
Tested-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
when we create a vnode using a dynroot fid, we weren't bothering
to update the type from the default (typically VREG); most
dynroot vnodes are actually VDIR...
Change-Id: I1c54e8c2a3c7ffd234f3247d38730062484fec87
Reviewed-on: http://gerrit.openafs.org/4686
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
If our call to mod_install fails for any reason (for example, if the
afs entry is missing from /etc/name_to_sysnum), we may still have set
the sysent structures for setgroups and ioctl to point at libafs code.
So calls to those syscalls will cause a panic, since the code they
point to is no longer loaded.
To avoid this, just reset the sysent entries back to what they were if
we fail to load, just like we do when unloading the module.
Change-Id: Ia0d6691780c749a0f550e640783c093ae45604ac
Reviewed-on: http://gerrit.openafs.org/4685
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Currently code dealing with changing unixuser structs does not obtain
any locks protecting the contents of the unixuser struct, though some
functions like afs_GetUser have a parameter indicating what type of
lock should be obtained. This can result in the token data for a user
being changed at the same time another thread tries to use the token
data.
To ensure mutual exclusion of such operations, add a lock field to the
unixuser struct, and actually lock it according to the intentions of
the relevant code.
Change-Id: Idd66d72f716b7e7dc08faa31ae43e9a23639bae3
Reviewed-on: http://gerrit.openafs.org/4636
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
afs_NewVolumeByName was using the areq given by the caller for
afs_SetupVolume, which may represent authenticated credentials. Give
afs_SetupVolume &treq instead, which will be anonymous, so we don't
have to deal with rxkad for VL lookups.
Change-Id: Ie990028133173c312d2e5d9de4baa82b99cfdf7d
Reviewed-on: http://gerrit.openafs.org/4666
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Makes all previous -noexecute arguments hidden (still callable)
and replaces them with -dryrun whose help text has been made
common where appropriate instead of the 3 previous ways the
argument was explained.
Change-Id: I0ef3daa88dc771d972131358dc6e8a23ecd5a33b
Reviewed-on: http://gerrit.openafs.org/4678
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
If the DNS SRV lookup is for afs3-prserver or afs3-kaserver,
fallback to a lookup for afs3-vlserver since those services
are traditionally hosted on the same machine as the vlserver.
FIXES 129887
Change-Id: Iec553415cd4f491ea5c32923c4023619bf6320e8
Reviewed-on: http://gerrit.openafs.org/4676
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
It is not safe to protect two 16-bit fields in a structure
with different locks. Switch to using 32-bit fields.
Increment the cm-memmap version number since the data structure
sizes changed and the cache file must be invalidated.
Change-Id: I867b4b85b4fd9fe0083ad9d0559311f1c287513f
Reviewed-on: http://gerrit.openafs.org/4660
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
If krb5_cc_start_get fails when using Heimdal, the cursor
is invalid and it is not safe to pass it into subsequent
functions.
Change-Id: I65193fb63c33ddcbf741c21b40128785404ea920
Reviewed-on: http://gerrit.openafs.org/4658
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Commit 2578555d7e08131bf2fe4cdd0aa4b32567a76eb2 added vnode length
checks when we create or remove vnodes, but not during Rename and Link
operations (when vnodes are neither created nor destroyed). Add the
check in Rename and Link.
Change-Id: I8008380a2b9e286d2dcdabaed5ceba97909dbb37
Reviewed-on: http://gerrit.openafs.org/4668
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Turn on NAT ping on the Rx connection for the callback channel for
hosts. This should help improve behavior for clients behind NATs and
stateful firewalls, even for clients that predate NAT ping
functionality.
Change-Id: I0f8e801c2225560192de9c09bfa06d0387e29af3
Reviewed-on: http://gerrit.openafs.org/4646
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
removeAddress_r has some code that is identical to the
h_SetupCallbackConn_r function. Call the function instead.
Change-Id: I3416dd1b5c94f0e836c2461771389045994e7152
Reviewed-on: http://gerrit.openafs.org/4645
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>