_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>
If we VRequestSalvage_r a volume successfully, and we are not the
fileserver, we will tell the fileserver to salvage a volume. So, we do
not need to give back the volume afterwards, since telling the
fileserver that a volume needs a salvage effectively gives it back (so
the salvager can take it).
So, clear needsPutBack so we don't try to also give back the volume,
and avoid the fileserver yelling at us for trying to give back a
volume that is checked out by someone else (or is not checked out at
all).
Change-Id: I168bcf7fe6dbc186064cdf38de1ddb287a26eff3
Reviewed-on: http://gerrit.openafs.org/4445
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
roken now has tsearch for windows. add it.
Change-Id: I73f609d6285f52bb2b52f580b95ca4510204efa1
Reviewed-on: http://gerrit.openafs.org/4451
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit updates the code imported from heimdal to
988355d9d0d1953e8c17c4b5c935938573efe4ba (switch-from-svn-to-git-2070-g988355d)
Upstream changes are:
Derrick Brashear (1):
roken: Make tsearch build on windows
Change-Id: Ic0292c8cc7283c07ae56040c8e80b9b2cc99801f
Reviewed-on: http://gerrit.openafs.org/4454
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Since commit 7293ddf325 we have stopped
trying to use the system-provided XDR implementation, but the xdr_ops
structure was still structured to accomodate for the old limitations
of the system XDR. Change xdr_ops so it is just always one consistent
structure.
This removes:
- The AFS_XDR_64BITOPS define and all related code, since we never
call the 64-bit versions of getint and putint ourselves
- The rearrangement of getint32/putint32 depending if we are in
Solaris kernel-land or not
- The .x_control field
Change-Id: I59b7579da1ea728eaba6b426011adbe4f7a331b6
Reviewed-on: http://gerrit.openafs.org/2503
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Make it possible to set the location of the ptserver's configuration
directory, and the file that it logs to, from the command line. This
makes it possible to bring up a ptserver without requiring an
installation on the system for testing purposes.
Change-Id: I914eb842256eb74506490fcf5532b4138e6f3875
Reviewed-on: http://gerrit.openafs.org/4447
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit updates the code imported from heimdal to
2a32bf67f0a7c77b6adf6e7c23ec8abe7937a9ea (switch-from-svn-to-git-2067-g2a32bf6)
Upstream changes are:
Derrick Brashear (1):
Add tsearch and friends, and a test program
New files are:
roken/search.hin
roken/tsearch.c
Change-Id: Ie7ddb2da595797ca354e36776ce813a03b3d462c
Reviewed-on: http://gerrit.openafs.org/4453
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add tsearch.c (and search.hin) to the files we import from heimdal
Change-Id: I6a7062b35177c6ecd4f78ae15d56d73600866d50
Reviewed-on: http://gerrit.openafs.org/4449
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
A reference to the rxgk library crept into auth Makefile ahead of
time. Remove it so that tests can continue to work in trees without
rxgk.
Change-Id: Ic1392aebf657d458a55f2dcf685d0616f0573622
Reviewed-on: http://gerrit.openafs.org/4446
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
When we write a mount entry on Linux when mounting /afs, trim trailing
slashes on the mount path. Otherwise, the umount utility can get
slightly confused, and leave the /afs mount entry in /etc/mtab after
it's been unmounted.
For full correctness we should probably completely canonicalize the
path like the mount utility does, but it's unlikely that anyone will
provide significantly weird paths for cacheMountDir, so don't bother.
Change-Id: Ie8330f08918d52eee319dff5f6ad275c30164c67
Reviewed-on: http://gerrit.openafs.org/4442
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Use the gettimeofday implementation from roken, rather than brewing
our own on Windows.
Change-Id: I02fc1a7f0f6aded2e16e2ed53e04054546fc0535
Reviewed-on: http://gerrit.openafs.org/4433
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Make it possible to set the location of the vlserver's configuration
directory, database file, and the file that it logs to, from the
command line. This makes it possible to bring up a vlserver without
requiring an installation on the system for testing purposes.
Change-Id: I0a3fcc4fd10274588c1530f8b4f3e9782084c58c
Reviewed-on: http://gerrit.openafs.org/4440
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
GetInodeSummary can fail due to a number of different reasons, not
just because the VG doesn't exist. If, for example, we just fail to
write the temporary inode file, we will return with an error, but we
should not AskDelete the volume in that instance.
GetInodeSummary already has code to delete the volumes in question
when no inodes are found, so remove the extra AskDelete after
GetInodeSummary returns.
Change-Id: I5df7a3ffed962b62409adbedfa1c1a0445dad2f8
Reviewed-on: http://gerrit.openafs.org/4438
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
When GetInodeSummary fails due to an internal failure (not from just
failing to find applicable inodes), currently it just returns an
error, and does not return the checked-out singleVolumeNumber back to
the fileserver.
When we fail to gather inodes, we should force the volume to an error
state, since we haven't salvaged the volume. But if we fail to find
any applicable inodes, we just want to VOL_DONE the volume, since the
header has possibly been destroyed, and the volume doesn't exist.
So, issue an FSYNC_VOL_FORCE_ERROR command when we encounter errors in
GetInodeSummary, except when we fail to find applicable inodes.
Change-Id: I4aed126ec09c4b93cfd8572abeba3d22bff0e6a5
Reviewed-on: http://gerrit.openafs.org/4439
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The value of timeout after a select() call should be considered
undefined; relying on its value is not portable.
Since IOMGR_Select doesn't modify the timeout it is given, the
intention of the code seems to be to wait for gradually increasing
timeout values, starting at 50ms. At least under Linux, the
timeout gets set to 0 by select() if it waited for the full specified
time, resulting in a much shorter maximum possible wait period.
Initialize the timeout value for each loop according to the existing
logic, to get consistent behaviour between the lwp and pthreaded code.
Change-Id: I8d3e90fe4e94a378401dd0a6fb7d77266ec09e5a
Reviewed-on: http://gerrit.openafs.org/4441
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Collect callbacks to be broken in one go, otherwise a file server may
lock out a client while new callbacks tickle in.
With revised multi_Rx, responses get handled early, taking away an argument for
issuing callbacks in small chunks -> crank up chunk size.
Change-Id: I6822256715d1388aa1a44049315813ea08009105
Reviewed-on: http://gerrit.openafs.org/3909
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Some strftime callers were not using the resultant string
appropriately. Correct them to have the same behavior as when we were
using afs_ctime (which included a trailing newline).
Change-Id: I1d23a6a06460cae3d2a253c9f084c22324fc7542
Reviewed-on: http://gerrit.openafs.org/4437
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The lock is needed to copy the database version.
Note that this function is currently unused in OpenAFS.
Change-Id: I7938db18a6739d2a15ab27331dbf5945839127fc
Reviewed-on: http://gerrit.openafs.org/4264
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
ubik_Flush and ubik_Write need to hold the DB lock to use iovec_info
or iovec_data
Change-Id: Iadc1ff0badc744aa5fdee433bb4b591217e4b453
Reviewed-on: http://gerrit.openafs.org/4263
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Document the required lock ordering for the new locks.
The text is adapated from Jeffrey Hutzelman's notes.
Change-Id: I72d0578f456eab133f36e00a3e99051b9a733020
Reviewed-on: http://gerrit.openafs.org/4174
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The "version" lock is a new lock that protects the database version
information. The goal is to allow the beacon thread to use the
protected values without blocking for an extended period of time,
which could occur if it was using the database lock.
Reading requires holding either lock, while writing requires holding
both locks.
The following values are protected:
ubik_epochTime
db->version
db->flags
db->tidCounter
db->writeTidCounter
Based on analysis and design work from Jeffrey Hutzelman.
Change-Id: Ib6e67360807eed8c36e35ec27d1eb938ac899e22
Reviewed-on: http://gerrit.openafs.org/4158
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Introduce a new lock to protect:
ubik_server->addr[]
ubik_server->disk_rxcid
ubik_server->vote_rxcid
ubikSecClass
ubikSecIndex
Globals are put into a new addr_data structure along with the lock.
Based on analysis and design work from Jeffrey Hutzelman.
Change-Id: I33ef58a36e87a3925b310052f83bb3c6dd60d785
Reviewed-on: http://gerrit.openafs.org/4157
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Introduce a new lock to protect ubik data related to voting.
Specifically, it protects the following globals:
ubik_lastYesTime
lastYesHost
lastYesClaim
lastYesState
lowestHost
lowestTime
syncHost
syncTime
ubik_dbVersion
ubik_dbTid
Variables are grouped along with the lock in a new structure.
Also introduce a few helper functions to safely deal with ubik_dbVersion:
uvote_eq_dbVersion: Return true if the passed version is equal to the
current ubik_dbVersion
uvote_set_dbVersion: Set ubik_dbVersion to a specified value
Change-Id: I9bb248d0dfedc363181661ea723cac0af4928644
Reviewed-on: http://gerrit.openafs.org/4156
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
A new lock is introduced to protect beacon related data when
compiled with pthreads. A global structure is added containing
the lock itself and the global variables that it protects.
The lock also protects some values in the ubik_server structures:
lastVoteTime
lastBeaconSent
lastVote
up
beaconSinceDown
Based on some analysis and design work by Jeffrey Hutzelman
Change-Id: I13f72d32dce71d0686406efcd07b7ea7528722f1
Reviewed-on: http://gerrit.openafs.org/4155
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Import the roken gettimeofday implementation, so we can use it on
Windows.
Change-Id: I198233c4e96708b56b6e7be3bbfc98bb14d37f84
Reviewed-on: http://gerrit.openafs.org/4431
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The roken gettimeofday implementation doesn't return timezone
information. Audit the whole code to make sure that we don't rely on
this, and tidy up those places where we were passing an unused
timezone structure to the gettimeofday call.
Change-Id: Ia83f86483a9c7262fc0904236c0d039a912e3731
Reviewed-on: http://gerrit.openafs.org/4430
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Whatever behaviour was controlled by the -DNINTERFACE define is long
gone from our code base (git log -SNINTERFACE can't find any references,
which suggests that its removal predates OpenAFS).
Simplify our Makefiles by removing the definition
Change-Id: Ic84261eb40aa7de9b7c0ec7b8372517b09e242d2
Reviewed-on: http://gerrit.openafs.org/4427
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Replace our local afs_ctime() hack with strftime and localtime_r,
which roken can provide for us if necessary. This avoids the
compatibility problems inherent with ctime_r, and removes another bit
of platform compatibility goo from libutil.
Change-Id: I18ed36cc4dce9aa354ad1398710ab7db83c814a2
Reviewed-on: http://gerrit.openafs.org/4426
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Fix our check for localtime_r so that it actually picks up if it's
missing on Unix platforms, and gets libroken to build it.
Change-Id: Ibf6e3a0272b08aa55e0ee9493f68b3c53a5b6938
Reviewed-on: http://gerrit.openafs.org/4425
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
util/magic.h is unused, so get rid of it
Change-Id: Ic01a7ad73203d25b25f7b7c4af0668ab6131f6c3
Reviewed-on: http://gerrit.openafs.org/4423
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: I750ac319feb38e416abb0b8e3575613309c6ab8e
Reviewed-on: http://gerrit.openafs.org/4422
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: Ie83e6ed3e6e5eaca063b9c6af836bcdc7decdf84
Reviewed-on: http://gerrit.openafs.org/4421
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>