Commit Graph

73 Commits

Author SHA1 Message Date
Simon Wilkinson
043c31bf8d rx: Use a red black tree for the event stack
Instead of the current event stack, which uses a sorted linked
list, use a red/black tree to maintain the timer stack. This
dramatically improves event insertion times, at the expense of
some additional implementation complexity.

This change also adds reference counting to the rxevent
structure. We've always had a race between an event being
fired, and that event being simultaneously cancelled by
the user thread. Reference counting avoids that race resulting
in the structure appearing twice in the free list.

Change-Id: Icbef6e04e01f3eef5b888bc3cb77b7a3d1be26ae
Reviewed-on: http://gerrit.openafs.org/5841
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2011-11-29 12:29:41 -08:00
Simon Wilkinson
55efff93fe opr: Move queue header out of util
Move the header which is installed as opr/queues.h out of util/ and
into the new, top level, opr/ directory. Similarly move the tests out
of the util/ test suite, and into the opr/ tests

Change-Id: I81af487f09e1f0f4b25654a1f64c5ac75fd5a95b
Reviewed-on: http://gerrit.openafs.org/5656
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
2011-10-23 16:11:05 -07:00
Simon Wilkinson
9c9b906c8a 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.

Change-Id: I703db3da4d8faf79ee82bf572af09d07152d9b25
Reviewed-on: http://gerrit.openafs.org/5363
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2011-09-11 05:38:55 -07:00
chas williams - CONTRACTOR
85bb872e3d doc: generate admin ref from the pod documentation
a bit convoluted but this generates docbook from the pod documentation and
from that pdf, epub and mobi versions.  we are using variablelist.as.block
since that looks prettier on smaller devices/screen.

Change-Id: I5cd51ef10448373960a0aeed15212bbcf6f44039
Change-Id: Ib222dbfa30e3af644b1dbc6738df1d39cc33c92f
Reviewed-on: http://gerrit.openafs.org/5255
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-08-23 09:37:33 -07:00
Simon Wilkinson
f02c3d40cb tests: Add tests for the vlserver
Add some very simple vlserver tests

Change-Id: I862d3a86857dc70f0421f4887d1fc4d047c57909
Reviewed-on: http://gerrit.openafs.org/5029
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-17 22:26:15 -07:00
Simon Wilkinson
6a27e228ba rpms: Use git version information
Use the git version information when building RPMS, rather than hard
coding it into configure.ac.

Change-Id: I477629b4102f48a9669ff67aae429c08862a5afc
Reviewed-on: http://gerrit.openafs.org/4983
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 06:27:35 -07:00
chas williams - CONTRACTOR
9929d1c6fc doc: epub and mobi support
.epub is generated using dbtoepub which is still considered alpha
software apparently and installed in a non-standard place.  for now,
use the docbook stylesheet location to find it.  .mobi is generated
using kindlegen from the .epub in order to have a real toc.

there is some preprocessing with a custom stylesheet to make
things "look right".  see mobi-fixup.xsl.in

Change-Id: Ice92e701e2f921e70c0f98683b5e9ab44a347e3b
Reviewed-on: http://gerrit.openafs.org/4887
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-01 06:46:30 -07:00
Simon Wilkinson
799b3373ec tests: Move common code to its own directory
Move code for faking up an OpenAFS configuration directory into its
own "common" directory, as it's going to be of use to more tests than
just those in auth.

Change-Id: I9c80dd66763e222deca98bc7744ff317111c6ed8
Reviewed-on: http://gerrit.openafs.org/4806
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-06-07 07:50:20 -07:00
Simon Wilkinson
376e24b2ee cmd: Add some tests to the test suite
Add some tests for the command library to the integrated test
suite in tests. These are far from complete, and are mainly there
to ensure that we don't break any of this functionality when modifying
the library.

Change-Id: Ib6fbdca114c005c32c5ba8c41f9e350ca67e1fb8
Reviewed-on: http://gerrit.openafs.org/4538
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-25 21:51:09 -07:00
Chaz Chandler
53377153ec libafscp: code cleanup
This patch is intended to bring libafscp into accordance with the
current OpenAFS coding standards while also fixing a few small
issues.  Apologies in advance for the numerous whitespace changes.

Change-Id: I606ed5024395319e12e8759f31494ebd27ff6112
Reviewed-on: http://gerrit.openafs.org/4380
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-04-01 09:16:45 -07:00
Simon Wilkinson
687fe37614 rfc3961: Add a kernel rfc3961 implementation
Add the necessary mechanisms to build Heimdal's libkrb5/crypto_*.c in
the kernel. This provides the kernel module with a RFC3961
implementation.

In theory this could also be used to provide a RFC3961 implementation
on top of an EVP-based crypto library in userspace, but at the moment
we're just using Heimdal directly for this.

Change-Id: Ie57391da0dabd2dca8b305e23f0c0faa056a4675
Reviewed-on: http://gerrit.openafs.org/3948
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-02-16 08:47:35 -08:00
Simon Wilkinson
d06a4a5576 Autoconf: Add GSSAPI autoconf rules
Add rules to autodetect the location of a system's GSSAPI libraries,
using the gssapi.m4 script from rra-c-util 2.6

Change-Id: Idabb8fdb138a2dac6983aa4d5fd8a2f558ee08be
Reviewed-on: http://gerrit.openafs.org/3943
Tested-by: Christof Hanke <christof.hanke@rzg.mpg.de>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-02-15 11:38:17 -08:00
Antoine Verheijen
8b932375ec Move check for unspecified CFLAGS in configure.ac
configure.ac provides a check to see if the user has
specified CFLAGS and if not, it sets CFLAGS to a blank
(not NULL) string so that the resultant configure script
does not set '-g' and/or '-O2' by default. This check
occurs after AC_USE_SYSTEM_EXTENSIONS in the configure.ac
file. However, on at least some systems, such as OpenBSD,
AC_USE_SYSTEM_EXTENSIONS expands to include the code that
configure uses to set '-g -O2' so the check has no effect
and '-g' or '-O2' can not be turned off. This patch moves
the "CFLAGS specified" check so that it precedes the
AC_USE_SYSTEM_EXTENSIONS directive, in which case
everything works.

Change-Id: I68ed5a3c5129a55f7dcd7413c93f35cc7cb14b9c
Reviewed-on: http://gerrit.openafs.org/3688
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-01-19 17:55:23 -08:00
Christof Hanke
4a6a00d6f4 check curses-libs by configure
Presently, the used curses-library are determined by OS.
The leads to a build error when no curses-headers are installed.
Use configure to test if curses.h or ncurses.h is present.
ncurses takes precedence over curses.h.
If neither the curses- nor ncurses-libs are available, do not build
afsmonitor and scout.
A summary at the end of the configure should make this clear to
everyone.
The variable TXLIBS has been renamed to LIB_curses.

Change-Id: I3f661e0b6199be41818dc22149b061e3d599b77f
Reviewed-on: http://gerrit.openafs.org/3345
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-11-27 07:45:30 -08:00
Simon Wilkinson
0af17e7ecc auth: Allow identities in the UserList
Extend the userok interface provided by the auth library to permit the
addition, deletion and inspection of identities within the UserList.

A number of additional functions are added, as direct replacements for
their Kerberos v4 only counterparts - these are:
 *) afsconf_DeleteIdentity
 *) afsconf_GetNthIdentity
 *) afsconf_AddIdentity
 *) afsconf_SuperIdentity

In addition, a new function is added to allow the status of any given
identity to be queried
 *) afsconf_IsSuperIdentity

New form identities are stored within the same UserList file as
Kerberos v4 identities. We take advantage of the fact that the current
code skips any entry with a leading whitespace. Identities are stored as
a single line, with a leading space, followed by the integer
representation of their type (0 for Kerberos 4, 1 for GSSAPI), followed
by the base64 encoded representation of their exported name, followed by
the display name of the identity. Each field is whitespace separated.

For example:
 1 BAEACwYJKoZIhvcSAQICAAAAEHN4d0BJTkYuRUQuQUMuVUs= sxw@INF.ED.AC.UK
is the representation of the GSSAPI identity "sxw@INF.ED.AC.UK"

An addition to the test suite is also provided which will test all of
the existing, and new super user manipulation functions.

Change-Id: I50648bb1ecc3037a90d623c87a60193be4f122ff
Reviewed-on: http://gerrit.openafs.org/3355
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-11-24 19:16:12 -08:00
Simon Wilkinson
a9b8fd81bf Remove local crypto
This change removes all of the local crypto use in userspace, in
favour of using our shiny new afshcrypto library.

Change-Id: Iac21b42e49bac424cc28c449a31f2da44121b7e5
Reviewed-on: http://gerrit.openafs.org/2577
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-11-19 05:07:57 -08:00
Simon Wilkinson
5e47d03ed3 Add libroken as its own library
Include libroken as a library in its own right, so that the whole
of the code can benefit from it. This change purely adds libroken
for the Unix build system. It doesn't replace those pieces of
libroken in hcrypto or util, or enable it for Windows.

There is also the option of using a system-install libroken, if one is
found at configure time.
  *) If --with-libroken=yes, or is not supplied than a system library
     will be used if suitable. Otherwise, we'll use the internal
     libroken
  *) If --with-libroken=/path/to/installation then the libroken at
     that path will be used. If there is no libroken there, or it
     is not suitable, an error will be returned
  *) If --with-libroken=internal then the internal libroken is used,
     regardless of what is present on the system.

We deliberately do not provide installed headers for the internal
libroken. If other applications wish to make use of libroken, then
they should use the Heimdal one, rather than piggybacking on ours.

Change-Id: Iff01e1e17090404cc8e4783108ae8a8784170918
Reviewed-on: http://gerrit.openafs.org/3191
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-10-31 19:00:23 -07:00
Hartmut Reuter
80ede16475 What the cache manager needs to know about rxosd
this patch contains only the RPC interface to rxosd which already
contains the definition of all RPCs not just those few used in the
cache manager.

The code which calls these RPCs will follow in subesquent patches.

Change-Id: Ia90934b06e809d0a34ed5d4a0d77eed78b74780c
Reviewed-on: http://gerrit.openafs.org/3192
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-10-29 11:22:00 -07:00
Simon Wilkinson
f22ae5f7d8 Unix: Rework build system
Rework the unix build system so that we support taking CFLAGS and
LDFLAGS from the command line, and don't replace them with our own
settings. Also, take the opportunity to bring some sanity and
consistency into our Makefiles.

The standard Makefile.config  now defines rules for LWP, pthreaded
and shared library builds. The CFLAGS settings for these are
called LWP_CFLAGS, PTH_CFLAGS and SHD_CFLAGS, respectively.
Similarly named variables are provided for LDFLAGS.

A module may select to use a particular build type for its suffix
rule by including either Makefile.lwp, Makefile.pthread or
Makefile.shared from src/config. This creates an appropriate .c.o
suffix rule, defines AFS_CFLAGS and AFS_LDFLAGS as appropriate, and
creates two rules AFS_CCRULE and AFS_LDRULE, which can be used to
build, and link objects. For example:

foo.o: foo.c
	$(AFS_CCRULE) foo.c

foo: foo.o
	$(AFS_LDRULE) foo.o

If a you wish to override the CFLAGS or LDFLAGS for an object build
using these rules (or through the .c.o suffix rule) you can do so,
by defining CFLAGS_<object> or LDFLAGS_<object>. For example:

CFLAGS_foo.o= -DDEBUG
LDFLAGS_foo = -ldebugging

A module may also alter the behaviour of the compile and link steps
module wide by defining MODULE_CFLAGS or MODULE_LDFLAGS.

This functionality is now used throughout the tree:
    *) Suffix rules are used wherever possible, removing a number of
       unecessary build rules.
    *) All link steps are replaced with AFS_LDRULE
    *) All standard compile steps are replaced with AFS_CCRULE
    *) Unusal compile steps are defined, as far as possible, int
       terms of the LWP_ PTH_ and SHD_ variables.
    *) The use of $? has been removed entirely, as it makes it
       impossible to provide build rules with dependency information

Change-Id: If76207e45da402a0ed9d7c1bdbe83c58c911a4f2
Reviewed-on: http://gerrit.openafs.org/2896
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-10-11 08:00:29 -07:00
Simon Wilkinson
b1f747c1f1 configure: Don't let autoconf pick our CFLAGS
If the user hasn't specified CFLAGS on the command line to
./configure, then autoconf will set them to -g -O2 if the compiler
supports those options.

For compatibility with what OpenAFS has always done, and to let us
manually set optimisation and debugging flags later, disable this
behaviour.

Change-Id: Ic78d5f824433d94d76f16c107af3488132d57155
Reviewed-on: http://gerrit.openafs.org/2895
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-10-04 09:07:32 -07:00
Simon Wilkinson
f6d1f17f48 Add OpenAFS build machinery for libhcrypto
Add an OpenAFS build environment for the symmetric algorithms in
libhcrypto.

Change-Id: I0d971433fe0130854a7c50cd9107af02893b1d58
Reviewed-on: http://gerrit.openafs.org/2575
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-19 09:23:26 -07:00
Derrick Brashear
b44562f5dc openafs 1.5.76
make openafs 1.5.76

Change-Id: I56ef6618ae6ff8d0ee2e06a145aed7d61f98d682
Reviewed-on: http://gerrit.openafs.org/2537
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-08-16 12:46:05 -07:00
Russ Allbery
ce109a8538 Rename configure.in to configure.ac
Rename configure.in and configure-libafs.in to use the *.ac extension
instead, which is preferred by current Autoconf versions for input
files to Autoconf.  *.in can then be more consistently used for files
that are input into config.status.

Change-Id: I4d352560200e4dbb1a2dda3d5ab7c7c9a38b565f
Reviewed-on: http://gerrit.openafs.org/2437
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Russ Allbery <rra@stanford.edu>
2010-07-16 09:24:52 -07:00