We should never get a deleted client back from GetClient. Log a
message if we do, to explain why access may suddenly appear to fail,
and assist in determining why.
Note that we still try to service the request, since the accessing
user may still have enough access to do whatever was requested.
Change-Id: Ie1d0c2d8a33a68a760704bfff9f268c6c507118f
Reviewed-on: http://gerrit.openafs.org/4529
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Make sure that the callback functions for h_Enumerate and
h_Enumerate_r give us back valid flags values by aborting if they
return an invalid value.
Change-Id: Id34b461d5452ac318a1714b6c3ffdaf41015995c
Reviewed-on: http://gerrit.openafs.org/4528
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Do not give uninitialized flags values to h_Enumerate callback
functions. In fact, do not give a flags value to h_Enumerate or
h_Enumerate_r callback functions at all, since they are not actually
used.
Fix host enumeration callback functions to just return 0 or the
relevant flags, instead of basing the return value off of the given
flags value. Update MultiBreakVolumeCallBack_r to use the correct
return values, since it currently tries to use the old meanings of the
host enumeration return values.
FIXES 129376
Change-Id: Ibb01ce62411602a9f83f437125fb87a7a84160b4
Reviewed-on: http://gerrit.openafs.org/4527
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
On Darwin, net/if.h is only usable if sys/socket.h is included first.
Do so, to stop autoconf from warning about this test.
Change-Id: I9e7a2642cce86c5ad6ebb3ae3cb60401dd9c26cf
Reviewed-on: http://gerrit.openafs.org/4535
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The 'Streamfiles.txt' file had been committed with both that name,
and an all lower case name. This makes git very sad on systems with
case insensitive filenames.
Change-Id: I0284415649d7568f9834ccd4d2c6a1627d309fed
Reviewed-on: http://gerrit.openafs.org/4550
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
This reverts commit 65186d8390, which
was mistakenly merged to the wrong branch.
Change-Id: I3b2bf874cca15b4248978575213eae21ece2207f
Reviewed-on: http://gerrit.openafs.org/4519
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Always set the *primary flag to something in _settok_tokenCell.
Otherwise, the lag may be unset, as it is not required to be
initialized by all callers.
Change-Id: I78c775f8cd70f74f6a344094a6a677cbc74f3281
Reviewed-on: http://gerrit.openafs.org/4521
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
In cm_ReadMountPoint and cm_HandleLink the variable 'thyper'
represets the 'offset' at which cm_GetData should fetch data.
Rename 'thyper' to 'offset' and fix a coding error caused by
misinterpreting the variable purpose.
Change-Id: If60669d850f4bfba2aae6e4aaf642f7ec6f920b2
Reviewed-on: http://gerrit.openafs.org/4501
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>
We weren't actually returning a token and username from
rxkad_get_converted_token. Do so.
This is a 1.6-specific change. This issue was fixed on master when
aklog was changed to use the new SetTokenEx family of pioctls in
commit 53837416cb.
Change-Id: I4c85c03be00c45fdae5657554dcd85b3a6301b23
Reviewed-on: http://gerrit.openafs.org/4513
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
use the relative path for afsio.c
use objdir path for generated files
Change-Id: I3b16108eacd949bcb1ddc2224961e87bce9999bb
Reviewed-on: http://gerrit.openafs.org/4508
Reviewed-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Tested-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Rearrange the Makefile to make it more parallel build proof.
Add some dependencies on the header files, and avoid rules
with 2 targets.
Change-Id: I267f25504137d58dd1a335eccb7c9b138a7c66ab
Reviewed-on: http://gerrit.openafs.org/4497
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The file src/packaging/FreeBSD/Makefile is part of the repository,
and so shouldn't be excluded by .gitignore (the exclusion is inherited
from the top level). So, restore it with .gitignore in this directory.
Change-Id: I841e67aba707fd7193ba0d15a11f969ffd55829c
Reviewed-on: http://gerrit.openafs.org/4495
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
add support for locking as well as for tracking callbacks so a
lock break can be detected
Change-Id: Iff36c6528fc55cf250bc27d49af80123d7ecece3
Reviewed-on: http://gerrit.openafs.org/4476
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
cm_GetData() drops the cm_scache_t rw lock which permits other
threads to access the data while it is in an inconsistent state.
Avoid the race by using a stack allocated temporary buffer to
receive the data from cm_GetData(). Only copy the data into
the mountPointStringp buffer under the rwlock.
Change-Id: Ica853976b1094be1087e49c22d878f8ae7fca03a
Reviewed-on: http://gerrit.openafs.org/4498
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
This makes afsdump_scan get the ACLs right on little endian systems.
It also corrects and slightly beautifies some output (indentation,
cut&paste error for negative ACL label).
Change-Id: I5a120630158e56fe8b55500ff9db70dded5fe0d9
Reviewed-on: http://gerrit.openafs.org/4494
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
and probably more than just these but let's start here.
Change-Id: Id0f174a84ecb8ffd1fbdcade6f139fc78c4b99e2
Reviewed-on: http://gerrit.openafs.org/4492
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The flags that token_extractRxkad returns are flags that are passed to
ktc_SetToken, not the flags that are passed directly to the PSetTokens
pioctl. So, we should be setting AFS_SETTOK_SETPAG, which is
interpreted by ktc_SetToken.
Change-Id: Id63ba4d5874e43c8d1f02817bf33975516a974be
Reviewed-on: http://gerrit.openafs.org/4480
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
get the correct afs principal. this entire blob will go away
and be replaced by rxgk token getting, but deal for now.
Change-Id: I8e63a5de74efa6c2eeec4c67b4d14d1f69396e41
Reviewed-on: http://gerrit.openafs.org/4475
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The afs_write() code for memory and disk cache suffered from exactly
the same duplication problems as the afs_read() code.
Apply a similar fix - unify afs_UFSWrite and afs_MemWrite into a single
afs_write function, place the UFS specific code into afs_UFSWriteUIO,
and make use of the existing afs_MemWriteUIO for the memcache case.
Change-Id: I074e1f56597e5cf04d13a45bcda5ad5fedb6377f
Reviewed-on: http://gerrit.openafs.org/4465
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
afsio is a utility for file transfer to and from AFS file space
without the help of the AFS client/cache manager. Using libafscp,
this (partially rewritten) version of afsio is able to accomplish
(1) authenticated access to an AFS path or FID (an existing
KerberosV ticket is required), (2) fall back on unauthenticated
("anonymous") access if authentication (token acquisition) fails,
and (3) work independtly of the AFS cache manager (afsd need not
be running, though CellServDB and ThisCell are currently required).
issues:
1) libvldbint and libafsint are not compiled pthreaded. we link in
what we need. this should be changed when we are all-pthreaded.
2) venus is not a pthreaded-directory otherwise. same deal:
in an all-pthreaded universe, undo the bodge that we do here.
3) venus is not an all-krb5 directory either. slight ick.
Change-Id: I946e6eef58ac77c6fb97be256c4c564188201262
Reviewed-on: http://gerrit.openafs.org/4381
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Remove the osi_alloccnt and osi_allocsize counters, and the associated
osi_alloc_mutex. These counters are pretty useless since nothing looks
at them, and their use of a mutex requires Rx to be initialized before
XDR can be used. Removing them lifts this restriction.
Change-Id: I22fa1335b6d34675d37cca41a2c393b9c20d3d24
Reviewed-on: http://gerrit.openafs.org/4478
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
When we use cmp to determine whether to replace
AFS_component_version_number.c, suppress stderr in addition to stdout,
to slightly reduce output during the build.
Change-Id: I4f687ce5ffff316d8f9806181bccf1c28d218932
Reviewed-on: http://gerrit.openafs.org/4471
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
On AIX 5.1 and later, we set a process' PAG by using the AIX PAG
mechanism (and not by group ids), but we were determining what PAG a
process was in by the group list. Instead use the PAG identifier.
This effectively reverts 277c37f48c, but
it puts the kcred_getpag call in a different place that makes more
sense in the current PAG code organization.
Change-Id: If9fe621060a06664718a00acff91dea66760d5c2
Reviewed-on: http://gerrit.openafs.org/4479
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Make function definitions consistent with the formatting in the rest
of the tree.
Change-Id: Ifbccc02739f6fbc111e061397538a903b6f2289a
Reviewed-on: http://gerrit.openafs.org/4477
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Some callers of pam_get_item et al were just casting their argument to
a const void **. Some PAM implementations (Linux) want a const void**,
but others (Solaris) do not. Use the PAM_CONST symbol already defined
by autoconf to declare or cast the relevant variable const or not as
appropriate.
Change-Id: I81c7863797396eb146b78ffbb2586e4f3a1e854e
Reviewed-on: http://gerrit.openafs.org/4470
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The POSIX getpwnam_r can yield a NULL struct passwd pointer even when
the returned error code is 0 (in particular, when the requested entry
is not found). Just add a check for a null upwd to make sure we don't
dereference a NULL pointer.
Change-Id: I00e8d6c53e8228f468c984010695b798f5dcf999
Reviewed-on: http://gerrit.openafs.org/4469
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
_POSIX_PTHREAD_SEMANTICS is now always defined for Solaris, which
means we get a POSIX-conforming getpwnam_r, which takes 5 arguments.
So, add Solaris to the list of platforms that use a POSIX getpwnam_r.
Change-Id: I1ad12420f56cf39816d94a8e9c9740436100134b
Reviewed-on: http://gerrit.openafs.org/4468
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Including roken.h in vfsck sources pulls in some more modern headers
that vfsck code isn't used to. Accommodate:
- Prevent roken.h from pulling in dirent.h so we don't conflict with
the old-style directory defines for HP-UX. Also move the inclusion
of the old-style directory defines to before roken.h, so we have
the directory types defined in roken.h.
- Remove some prototypes so the don't conflict with the prototypes in
system headers.
- Remove a couple of bizarre vprintf invocations, as they conflict
with the actual vprintf definitions.
Change-Id: Ifd7cd2544e75ed49b93ab491c4acadcb18528315
Reviewed-on: http://gerrit.openafs.org/4472
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
On at least Solaris, the configure tests for netinet/if_ether.h and
security/pam_modules.h issued warnings because they existed but were
not compilable. Perform the tests with the prerequisite headers of
net/if.h and security/pam_appl.h, respectively, so autoconf will stop
yelling at us.
Change-Id: I05d637784954c10af468b6065acd78139fc45245
Reviewed-on: http://gerrit.openafs.org/4467
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
rx_lwp.c uses FNDELAY, which requires sys/file.h on at least Solaris.
So, include it.
Change-Id: Ida652a3c9bfccb120a67f0c5d4f71537a11fa00f
Reviewed-on: http://gerrit.openafs.org/4466
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
A DES key is a DES key. Permit importing CRC, MD5 and MD4
when using non-MIT keytab support.
Add a special error message that specifies what principal
name, kvno, and enctype were being searched for when the
error is KRB5_KT_NOTFOUND.
Change-Id: I7d3b5fbc41db5e5e91278854ce52842720e6b5d3
Reviewed-on: http://gerrit.openafs.org/4458
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
We were providing additional buffer and length parameters to
afs_read which are now unused, as the necessary information is
contained within the iovec. Just remove these parameters to tidy the
code up a bit.
Change-Id: I2ca80b20e253e0d54be759e6d504961958b40e6e
Reviewed-on: http://gerrit.openafs.org/4464
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The disk cache and memcache afs_read functions are effectively
duplicates of each other. Abstract out the common code into a generic
afs_read() function, and put the cache type specific code into
UFSReadUIO (there is already a MemReadUIO which contains the code
necessary for the memcache).
Change-Id: Ic66242fa4695a146ac874a82bd48a7c1f1f412a6
Reviewed-on: http://gerrit.openafs.org/4463
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
fs.c contained two identical copies of code to parse a path, resolve
any symbolic links in that path, and return the directory and basename.
Abstract this code out into a single function, rather than maintaining
two separate copies of it.
Change-Id: Id9fc835506f90bae2fc1f0db18c640bf28f0d39d
Reviewed-on: http://gerrit.openafs.org/4462
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The libuafs Makefile creates a link to afsd in the libuafs build
directory. So, have the clean rule tidy it up after us.
Change-Id: I24a3be34bc04dfa7c9db9be2ace4ab32f3f5d5f7
Reviewed-on: http://gerrit.openafs.org/4461
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
In lots of places in the fileserver we were doing
ViceLog(0, (x))
osi_Panic(x)
Remove this duplication by creating a new macro, ViceLogThenPanic,
which does both of these in one fell swoop.
Change-Id: Icea349d60298eba1cca4a45db790f21ba3e7b3c7
Reviewed-on: http://gerrit.openafs.org/4455
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The proper option to udebug is "-server", not "-servers". Fix the manpage to line up with the binary.
Change-Id: I3ec83c028dcefb827bd05666401e4a667e29fb6a
Reviewed-on: http://gerrit.openafs.org/4457
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
When the volserver notices that a volume needs salvaging, mark
V_needsSalvaged. So when we VDetachVolume the volume, we can then just
request the salvage in the volume package.
Fix the VolClone salvaging code to do this as well, instead of using
the vol-private VRequestSalvage_r interface.
Change-Id: I9d48e4ea18fe4e3e2e1dc38593db4beb5ad79a84
Reviewed-on: http://gerrit.openafs.org/4452
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
If IH_CREATE fails in ViceCreateRoot, it may just be due to an on-disk
inconsistency. So, don't assert, but just return an error and detach
the volume.
Change-Id: I8acacff8c858b0d27234265fee5d7b49ebab5101
Reviewed-on: http://gerrit.openafs.org/4444
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>