Michael Meffie [Thu, 22 Sep 2011 13:13:18 +0000 (09:13 -0400)]
bozo: report bosserver -rxbind address
Create a file on bosserver startup called bosserver.rxbind in the
server local directory which contains an address local scripts may
use to contact the bosserver.
When bosserver is started with the -rxbind option, write the address
selected from the intersection of the interfaces, NetInfo, and
NetRestrict configuration to the bosserver.rxbind file, otherwise
write the loopback address 127.0.0.1.
Update the RedHat init script to use the new bosserver.rxbind file.
Simon Wilkinson [Sun, 10 Jul 2011 12:46:11 +0000 (13:46 +0100)]
Clean up assertion
The AFS code has multiple different assertion implementations in
userspace. This patchset is the start of bringing some sanity to them.
In rx, we have osi_Assert, a user/kernel assertion macro. This is only
available to libraries which have RX dependencies
In util, we redefine the standard 'assert()' macro to provide a
cross-platform assertion solution.
Because util has an RX dependency, neither of these provide an
assertion solution for libraries which should be independent of rx.
So, pull the assertion code out of util, and put it into opr, as a new
opr_Assert() macro. Implement the userspace osi_Assert in terms of this
macro, leaving the kernel variant untouched.
Update callers to the new macro and header file names.
Simon Wilkinson [Sun, 11 Sep 2011 20:44:23 +0000 (21:44 +0100)]
Move abort() into opr
We need our own abort function, because the behaviour of the Windows
abort() implementation isn't sufficiently flexible for us.
Because we're replacing an operating system function, reather than
implementing a missing function, this doesn't belong in roken.
So, provide an alternative opr_abort() implementation in our portable
runtime layer, which is a synonym for abort() on Unix, and implements
the required DebugBreak() functionality on Windows.
Remove lwp_abort() which was just creating another, unnecessary, layer
of abstraction.
Michael Meffie [Wed, 24 Nov 2010 01:21:50 +0000 (20:21 -0500)]
bozo: bosserver -pidfiles option
Add an option to bosserver to create pidfiles for long running
processes for simple, fs, and dafs bnode types, as well as the
bosserver process. The pidfiles are located in the server local
directory by default, or in the path specifed by the -pidfiles
command-line option.
Ben Kaduk [Sat, 24 Sep 2011 22:05:09 +0000 (18:05 -0400)]
FBSD: bsd.kmod.mk fallout for debug symbols
Now that we no longer control the installation of libafs.ko,
debug symbols are always getting stripped.
If the user requested kernel debug symbols, define DEBUG_FLAGS
for the libafs build and install, so that bsd.kmod.mk will
install the .symbols file alongside the kernel module.
Rod Widdowson [Fri, 23 Sep 2011 15:37:43 +0000 (16:37 +0100)]
Fix buffer leak in dir/buffers.c
Checkin 0284e65f97861e888d95576f22a93cd681813c39 accidently
threw in a trailing semicolon after an if statement.
Since the next line was a break this had several unfortunate
side effects, the most obvious being that we leaked a buffer
in certain cases.
Marc Dionne [Thu, 22 Sep 2011 23:09:52 +0000 (19:09 -0400)]
viced: fix incorrect error message
The error message was obviously copied from another location in the
code (after the pr_Initialize call) and is misleading. Adapt it for
vl_Initialize failure.
Marc Dionne [Thu, 22 Sep 2011 00:31:33 +0000 (20:31 -0400)]
fs: fix setserverprefs where long is larger than afs_int32
Make the fscanf and scanf format specifiers match the type of the
target variable. This prevents trying to store a long int into an
afs_int32 variable which may be smaller, and overwriting neighbouring
data on the stack.
The effect on a 64-bit Linux system was that the high bits of "rank"
would overwrite the first 4 bytes of the scanned host name, causing
setserverprefs to fail with:
: couldn't resolve name.
When building the AFS redirector with WDK7600 the Microsoft Auto
Code Review process is started by default. This is a problem for
buildbot. Disable OACR by default if the _RunOacr environment
variable is not set to TRUE.
Terry Long [Wed, 21 Sep 2011 01:21:12 +0000 (21:21 -0400)]
Fix AFSPreference compile error on Mac OS 10.7
Lion llvm/clang complains about main returning void instead of int.
Fixed main to return int in DARWIN/AFSPreference/afshlp.m.
Resubmitted patch to origin/master.
Michael Meffie [Tue, 20 Sep 2011 20:21:50 +0000 (16:21 -0400)]
salvager: fix filesystem path truncation
Fix filesystem path truncation for vice partitions beyond /vicepz.
Commit 3d7388b7 moved the filesystem path to a fixed size buffer,
however the path of the filesystem to be salvaged is truncated for
partitions with two character ids (e.g. /vicepaa), in which case
the salvager will salvager the wrong partition, or abort if the
truncated path is not present.
Michael Meffie [Fri, 16 Sep 2011 15:23:18 +0000 (11:23 -0400)]
solaris: libafs depends on fs/ufs
The solaris afs module depends on symbols exported by fs/ufs.
Set this dependency in the afs module so the kernel loader
will automatically load the fs/ufs driver if is not already
loaded, such on zfs only systems.
Andrew Deason [Mon, 19 Sep 2011 15:05:59 +0000 (11:05 -0400)]
ntohs ubik header size
The 'size' field in the ubik header is only 16-bits wide, so we should
be using ntohs to read it, not ntohl. The database checking utilities
for the prdb and kadb were still using ntohl (vldb was fixed by 591f9b6de9ab3dc5c17ad41af0241527f7f04b31).
Patchset 718f85a8b69a78ac77beb5c8471af20657be2a53 contained
a small typo that prevents the SetSPrefs pioctl processing from
functioning in all cases. fs setserverprefs continues to work
for non-DB preference lists because fs.c pokeServers() attempts
to try the old SetSPrefs33 pioctl in the non-DB server case.
rx: arrange for Finalize to really stop running calls
previously rxi_ServerProc would happily error a call once
rx_tranquil was set, but keep calling ExecuteRequest.
Reorder code so kernel shutdown attempts are processed first;
then arrange if we are tranquil to not process the call further.
windows: Set ReparsePoint Attribute in FileAttributes
The ReparsePoint Attribute is a primary attribute that is used
internally within the redirector to determine when the object
is a reparse point. It must be set in all code paths that
obtain the FileAttributes from the service. Do not fold it in
during the QueryBasicInformation response processing.
Change-Id: Iba819dd94ec03133f78a4d18559dbd1b5352788e
Reviewed-on: http://gerrit.openafs.org/5448 Reviewed-by: Peter Scott <pscott.kd@gmail.com> Reviewed-by: Jeffrey Altman <jaltman@openafs.org> Tested-by: Jeffrey Altman <jaltman@openafs.org>
These changes provide basic support for installing
the AFS Redirector and the AFSRDFSProvider.dll.
However, since NSIS is not useful for 64-bit installations
the NSIS installers will be removed from the source tree
in the near future.
1.7.x series will not be distributed with NSIS installers.
Peter Scott [Thu, 15 Sep 2011 05:52:08 +0000 (01:52 -0400)]
Windows: AFS Redirector Network Provider
In Windows a network file system must have a matching network
provider dll that interfaces with the Multiple Provider Router
(MPR) to support the WNet APIs called by the Windows Explorer
Shell and other applications. The WNet APIs are primarily
used to support driver letter mapping but they also have a
number of other functions including universal name mapping,
path formatting, and path parsing.
Jeffrey Altman <jaltman@your-file-system.com> contributed to
the development of the AFSRDFSProvider.dll interface.
Peter Scott [Thu, 15 Sep 2011 05:48:59 +0000 (01:48 -0400)]
Windows: AFSRedirLib.sys file system library driver
This patchset implements the AFS Redirector Library driver.
This driver contains all of the AFS specific implementation
details for service communication, network provider support,
directory management, extent management, metadata management,
callback invaldation, volume management, file locking, etc.
Rod Widdowson <rdw@steadingsoftware.com> and Jeffrey Altman
<jaltman@your-file-system.com> contributed to the development
of this driver.
Peter Scott [Thu, 15 Sep 2011 05:33:20 +0000 (01:33 -0400)]
Windows: RDR File System Framework driver
This is the first of two kernel drivers used to implement
the AFS Redirector: AFSRedir.sys.
This driver is registered at boot time and provides the binding
to the Windows kernel infrastructure. However, it only provides
a framework of a file system driver. All of the AFS specific
interfaces are actually implemented in a secondary library
driver, AFSRedirLib.sys. The rationale for this model is that
file system drivers cannot be unloaded on a running system.
By using this approach the library driver can be unloaded which
permits systems to be live updated.
To permit this model to work, all memory allocation is performed
by AFSRedir.sys. This confuses the driver verifier tool. When
the library is unloaded all objects are still valid. Operation
is simply paused until a new library is brought up. Under the
current configuration the library is loaded as part of afsd_service
initialization of AFSRedir.sys and is automatically unloaded when
afsd_service.exe shuts down.
The framework driver also implements all of the process and
thread tracking logic necessary to support Authentication Groups.
Communication between AFSRedir.sys and afsd_service.exe is
performed via a reverse ioctl model whereby the service contributes
threads to the driver to convey requests for processing.
The original file system was derived from the Kernel Drivers
File System under license from Kernel Drivers, LLC.
Rod Widdowson <rdw@steadingsoftware.com> and Jeffrey Altman
<jaltman@your-file-system.com> contributed to the development
of this driver.
Permit the Windows smb user parameter used when setting
tokens as the LOCAL_SYSTEM account to be set via an environment
variable. This is useful for debugging.
Windows: Redirector interface for afsd_service.exe
Over the last three years the afsd_service sources have been
gradually separated into distinct layers for the SMB server
and the AFS cache. The eventual goal of this work was to
permit the addition of alternative interfaces to the cache
manager in parallel.
This patchset implements the first alternative interface,
a reverse ioctl model that communicates with a native IFS
redirector driver. The driver will be submitted in a
subsequent patchset.
Although it is possible to run afsd_service with both the
SMB and RDR interfaces active at the same time. In practice
it is somewhat impractical because it destroys the uniformity
of the \\AFS name space. The RDR loads at boot time and claims
all of \\AFS. The SMB interface if active at the same time
must use the old \\%HOSTNAME%-AFS. As implemented, if the RDR
interface is functional the SMB interface is not started. Only
if the RDR interface fails will the SMB interface be activated.
The afsd_service.exe maintains all of its primary responsibilities
for communicating with the AFS servers, processing callbacks,
enforcing permissions, handling afs path ioctls, Windows RPC
service simulation, and object management. The biggest change
is in the cm_buf_t management. Data is exchanged with the
RDR by passing control over cm_buf_t->data buffers in the form
of Windows File Extents. This avoids data copies across a
communication channel which significantly improves performance
at a substantial complexity cost.
Credential management is switched from a Windows username binding
to a GUID binding where the GUIDs represent authentication groups
that are managed by the RDR.
This patchset includes additional changes to support integrated
logon in conjunction with the RDR. In particular, adding support
for authentication groups.
Stefan Kueng [Thu, 15 Sep 2011 04:57:23 +0000 (00:57 -0400)]
Windows: Explorer Shell extensions
This patchset implements a broad range of improvements to
the explorer shell. There is still a significant amount of
work to be done.
* Remove the 'cut' and 'delete' options from the
context menu if the selected object is a symlink
or mount point. This is performed in a language
neutral manner.
* Add AFS Property page to the property sheet
* Add AFS Volume Property page
* Add AFS ACL Property page
* force the linker to add the common-controls V6 manifest and
define ISOLATION_AWARE_ENABLED to make property sheets
work for the shell extension dll
* Fix the InfoTip handler. Display symlink and mount point
target strings
Marc Dionne [Wed, 14 Sep 2011 21:16:52 +0000 (17:16 -0400)]
Linux: Remove use of undefined AFS_LINUX_ENV
AFS_LINUX_ENV is used in a few places, mostly from commit dc077b83,
but it is not defined anywhere. As a result the logic was not as
intended.
In the definition of osi_ThreadUnique, this means that on all
Linux we use getpid(), which is OK as it gets defined appropriately
under LINUX and LINUX24 as current->pid or current->tgid.
Ben Kaduk [Tue, 13 Sep 2011 01:54:09 +0000 (21:54 -0400)]
Tidy up event hash table definitions a bit more
The change in http://gerrit.openafs.org/5314 consolidated the
definitions of struct afs_event and some related objects, but
the definitions were not quite in the right place. In
http://gerrit.openafs.org/5392 this content was moved to more
standard headers, but a comment and #define were missed.
This change moves the comment to be in the same place as the content.
Simon Wilkinson [Tue, 13 Sep 2011 08:54:12 +0000 (09:54 +0100)]
Use rra-c-util m4 from src/external
This commit switches us over from using manually maintained copies
of Russ's rra-c-util m4 macros, to using ones that are automatically
imported from his upstream git tree.
The macro versioning in the OpenAFS tree was slightly confused. This
(approximately) updates us from using version 3.3 of the macros to
version 3.8. The signifcant changes are:
*) Use PATH_KRB5_CONFIG rather than KRB5_CONFIG to set the location
of the krb5-config file
*) Use --with-gssapi-{include, lib} if given, rather than krb5-config
*) Use --with-krb5-{include, lib} if given, rather than krb5-config
*) Define HAVE_KERBEROS if we find a Kerberos library
The first, in particular, is likely to cause some confusion.
Simon Wilkinson [Tue, 13 Sep 2011 08:37:04 +0000 (09:37 +0100)]
Add rra-c-util to the src/external regime
We're already using a number of m4 configure tests which are taken
from rra-c-util. Instead of importing these piecemeal, add rra-c-util
to the src/external git import system, so that we can simply keep our
selves in sync
Jeffrey Altman [Tue, 2 Aug 2011 22:33:06 +0000 (18:33 -0400)]
Windows: osi_Debug macros
The osi_Debug macros are like osi_Log macros except when used
the logged values are always printed using OutputDebugString().
This interface is meant only for temporary debugging. No code
that uses osi_Debug should ever be committed to the upstream
repository.
shutdown_rx, unlike rx_Finalize, kills the socket before the conns.
since we call osi_NetSend directly, we lose. just do a simple
check for rxinit_status, and exit immediately before sending if rx
is not up.
ignore KRB5_DEPRECATED_FUNCTIONS for now since it doesnt give any
advice. Some keytypes (but not all) have been renamed. So for
now we need to keep both apparently.
Harald Barth (1):
Move common code to krb5_unsupported_enctype() and make error message contain string instead of error number
Jeffrey Altman (1):
roken: declare IN_LOOPBACKNET if necessary
Love Hornquist Astrand (5):
Warning fixes from Christos Zoulas
Fixes from NetBSD via Thomas Klausner and Roland C. Dowdeswell
Rename subsystem_DEPRECATED to subsystem_DEPRECATED_FUNCTION(X)
remove trailing whitespace
remove warning, remove forward declaration by moving the function up, ident
Love Hörnquist Åstrand (4):
don't set i = 0, its never read
sprinkle doxygen and kode more like the rest of the code base
partly unify enctype/keytype since there is only enctypes
switch to KRB5_ENCTYPE
Roland C. Dowdeswell (1):
Fix a couple of bugs in krb5_c_valid_enctype():
chas williams - CONTRACTOR (1):
hcrypto: var name current conflicts with linux kernel
Change-Id: Id9a7a9ee8258b979b54f4ed2b4175815ab35ea21
Reviewed-on: http://gerrit.openafs.org/5399 Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Todd Lewis [Sun, 11 Sep 2011 11:42:47 +0000 (12:42 +0100)]
RPM: Fix dkms support on Fedora 15
Newer dkms no longer uses or supplies a $kernelver_array variable;
instead it uses $kernelver. The attached patch uses both, one of
which will be empty, so the test will do the Right Thing regardless
of your dkms version.
Further, the "mv" command at the end of the MAKE[0]= line needs
lots of back-slashes on each of its parms. We need three to make it
all the way to the final dkms.conf file -- so that's six -- plus one
more to escape the '$'; that's seven in all.
In case there's any question (and with all the back-slashes involved,
there should be) about the intent here, the whole point of this
patch is to make the final dkms.conf MAKE[0]= line look like this
(module line breaks:
Simon Wilkinson [Sun, 11 Sep 2011 11:31:55 +0000 (12:31 +0100)]
Unix CM: Fix afs_event fallout on Mac OS X
Commit dc077b83c9b1f107efbc3483743f44117748f23c moved the afs_event
structure definition into afs_osi.h. However, afs_osi.h is included from
lots of places which don't include a complete set of platform headers.
This means that the use of lck_mtx_t in this file breaks the build on
Darwin.
Instead, define the structure in afs.h, along with all of the rest of
the cache manager structures. Also take the opportunity to move the
definition of shutdown_osisleep it afs_prototypes.h, with the rest of
the prototypes.
Simon Wilkinson [Sun, 11 Sep 2011 11:35:18 +0000 (12:35 +0100)]
Darwin: Actually stop the kernel build
At the moment, all of the kernel build lines end with "; true", which
means that the build will always continue, regardless of whether
creating an individual object file succeeds or not. The 'true' is there
to gobble up the name of the source file which the common build
infrastructure adds to the end of the command line.
Instead of using '; true', use '&& true', so that if one of the C
compiler commands, or the lipo, fails, we get told about it, before
we try to link the missing objects.
Simon Wilkinson [Sun, 10 Jul 2011 09:24:26 +0000 (10:24 +0100)]
Move string manipulation functions out of util
Some functions in libafsutil depend upon the RX libraries, which means
that pulling in other functions in this library can create a dependency
upon RX. This is less than ideal for low-level libraries such as cmd and
comerr.
So, create a new low-level library (currently named 'opr') which can
contain low-level functions from util, and elsewhere. This library
should have no dependencies other than on system libraries and libroken.
autoconf: use $XCFLAGS from OPENAFS_OSCONF when making tests
Certain platforms (like ppc64_linux26) compiler options might
affect some autoconf tests. In particular, the ones related to
the size of certain primitive types.
Simon Wilkinson [Wed, 7 Sep 2011 17:20:24 +0000 (18:20 +0100)]
IRIX: Pull NFS translator hooks
We've never had working NFS translator for IRIX, and the system call
codes which are required to install the symbols used by the IBM
translator have long been used for other things by OpenAFS.
Simplify this mess by just removing the translator stubs from the kernel
module, and all of the code in afsd which used to handle pulling
addresses out of the kernel module so that we can hook ourselves in.
Simon Wilkinson [Sun, 10 Jul 2011 12:57:36 +0000 (13:57 +0100)]
volser: Don't initialise all error tables
Initialising the KA and cmd error tables in vsprocs.c makes the
libvolser library dependent upon rxkad and cmd. As we may want to
use that library in programs which use neither rxkad, nor our command
processor, this is less than ideal. So, just drop the initialisations.
Simon Wilkinson [Tue, 6 Sep 2011 13:18:12 +0000 (14:18 +0100)]
afsd: Fix res_init warning
afsd requires res_init to be declared - get a definition for this by
including roken.h (which has the necessary magic to figure out which
set of headers are required to get resolver functions)
Ben Kaduk [Tue, 26 Jul 2011 03:39:27 +0000 (23:39 -0400)]
Free memory from afs_events
DARWIN and LINUX were already doing this, but everybody else had
a memory leak. Consolidate most of the common code to do so,
including afs_event_t definitions.
Simon Wilkinson [Tue, 5 Jul 2011 08:20:15 +0000 (09:20 +0100)]
rx/rxkad: Move rxkad initialisation into rxkad
When the RX pthread conversion was done, the initialisation of rxkad
mutexes was incorporated into the rx library itself. This is a layering
violation (it breaks the relatively clean security object abstraction),
and means that you can't actually use RX without the rxkad library.
So, remove all of this initialisation from RX. As security libraries
don't have an explicit initialisation function, we setup our various
mutexes using a pthread_once function called from the NewSecurityObject
functions.
This has the added bonus that it removes the final error in rx.c for
pthread builds, and so another bit of warning suppression can be
removed.
Simon Wilkinson [Tue, 5 Jul 2011 08:27:05 +0000 (09:27 +0100)]
volser: Don't declare cstruct twice
Both vsprocs.c and vsutils.c declare the global variable 'cstruct'
(which is initialised by vos.c in order to pass a ubik client structure
through to many of the libvolser functions). This double declaration
prevents libvolser from being linked as a shared library on some
platforms. We only need one of these, so just make vsprocs.c declare it,
and vsutils.c refer to it as an extern.
Of course, using a global variable to pass state around is really quite
nasty, but let's fix that in another change.
Rod Widdowson [Tue, 6 Sep 2011 14:23:33 +0000 (15:23 +0100)]
Windows: Replace "%T" as format string to strftime
Checkin I18ed36cc4dce9aa354ad1398710ab7db83c814a2 made strftime
much more widespread. However the %T format is not available on
all platforms and causes (at least) Windows servers to fail on
first attempt to log. %T is just shorthand to %H:%M:%S so this
checkin just replaces the one with the other.
The redirector maintains file object state after the afs
service has shutdown in case it is restarted. It is critical that
Freelance FIDs not be reused. Add cm_data.fakeDirVersion into
the mix when generating unique values.
Instead of dropping the lock for read and reacquiring for write
use lock_ConvertRToW() which will make the change atomicly if
it is possible or place the thread into the wait list if not.
Windows: tailor smb_MapNTError output for redirector
Separate mappings apply for the afs redirector. Add a boolean
parameter to the function signature that is set true when the
call requires the redirector mapping.
The buffer free list least recently used queue has both
head and tail points. Use the proper versions of the queue
mgmt functions and do not handle edge cases as special cases.