openafs.git
9 years agoRewrap some long lines in the toplevel Makefile
Benjamin Kaduk [Wed, 28 May 2014 14:47:32 +0000]
Rewrap some long lines in the toplevel Makefile

Only rewrap long lines in make scope; long lines in shell scope
are untouched.

We are inconsistent about whether continuation lines for listing
the dependencies of a target are indented by one or two tabs,
which this commit does not fix.

Change-Id: I2e438a0f42faa2ef7922d2c3b143e14bc82de826
Reviewed-on: http://gerrit.openafs.org/11178
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoRemove FOREIGN
Ben Kaduk [Wed, 15 May 2013 22:16:00 +0000]
Remove FOREIGN

It has been unused since the original import of IBM's code.

Change-Id: Ieec597c76e53453d012f1cd86f6860ae60dade5c
Reviewed-on: http://gerrit.openafs.org/9918
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

9 years agosalvager: Don't lie about locked-ness to namei_SLC
Andrew Deason [Thu, 29 Aug 2013 21:14:23 +0000]
salvager: Don't lie about locked-ness to namei_SLC

We have not locked the linktable with a prior call to
namei_GetLinkCount. So don't claim that we did.

Change-Id: I43adf92b60a0e46b90ae624e4713747585d12c67
Reviewed-on: http://gerrit.openafs.org/10198
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agonamei: Remove namei_SetNonZLC
Andrew Deason [Thu, 29 Aug 2013 21:00:37 +0000]
namei: Remove namei_SetNonZLC

This function is unused. Remove it.

Change-Id: Ie48d5370187c851afdd7cd359115d9e74d001aae
Reviewed-on: http://gerrit.openafs.org/10197
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agonamei: IH_REALLYCLOSE special inode on delete
Andrew Deason [Thu, 29 Aug 2013 20:33:49 +0000]
namei: IH_REALLYCLOSE special inode on delete

When we delete a special inode, we should IH_REALLYCLOSE it, to ensure
no other cached file handles are open for that special inode. However,
currently PurgeHeader_r does this, and then IH_DECs the special
inodes. On namei, calling IH_DEC on a special inode causes the inode
to be opened, so we create a cached file handle right after we closed
all cached file handles for that inode with IH_REALLYCLOSE.

Making namei IH_DEC not open an FdHandle_t for the given file is
non-trivial, at least when dec'ing the linktable. So instead, just
make namei IH_DEC itself issue the IH_REALLYCLOSE right before the
actual unlink() call.

With this, we can keep the cached file handle open for special inodes
until right before they are actually deleted, so we don't issue extra
unnecessary open()s and close()s.

Change-Id: I35b234ab429bc7cd0f29654cc8f854c82c961071
Reviewed-on: http://gerrit.openafs.org/10196
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agonamei: Remove redundant linktable SetLinkCount
Andrew Deason [Thu, 29 Aug 2013 20:16:00 +0000]
namei: Remove redundant linktable SetLinkCount

If we're setting the linktable linkcount to 0, we're about to delete
the whole linktable. So, don't bother setting the link count. Still
make sure we unlock the linktable, as we still have it locked at this
point, from the previous GetLinkCount call.

Change-Id: Ia00c1e14de6b8fcd69d594f0dbdbafa32b066dc5
Reviewed-on: http://gerrit.openafs.org/10195
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoFix unchecked calls to asprintf
Jeffrey Hutzelman [Sat, 15 Jun 2013 22:58:13 +0000]
Fix unchecked calls to asprintf

The return value of asprintf() is the number of bytes printed, or -1 if there
was an error allocating a large enough buffer.  In the latter case, the value
of the result string is undefined, and so it cannot be counted on to be NULL.

This change fixes numerous places where the result of asprintf is checked
incorrectly (by examining the output pointer and not the return value) or not
at all.

Change-Id: I9fef14d60c096795d59c42798f3906041fb18c86
Reviewed-on: http://gerrit.openafs.org/9978
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agovolser: make splitvol use VolumeId
Derrick Brashear [Mon, 7 Jan 2013 18:33:12 +0000]
volser: make splitvol use VolumeId

convert split volume rpc to also use volumeid type

Change-Id: I6b1ed670a0abdc1487daa65b7e136a1370afd5fd
Reviewed-on: http://gerrit.openafs.org/8888
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

9 years agoClean up our cleaning
Benjamin Kaduk [Wed, 8 Oct 2014 20:51:33 +0000]
Clean up our cleaning

'make clean' and 'make maintainer-clean' still leave around a fair
number of droppings, prior to this commit.

We were not descending into the 'tests' top-level directory while
cleaning.  Furthermore, tests/opr/Makefile needed $(LT_CLEAN), and
tests/rx/Makefile needed to spell it correctly.

The libtoolization places a lot of files to be removed in the
'pristine' target.

The processing used to implement the =include directive in the pod
sources for the man pages leaves around the non-.in versions of
files; we should clean that up in the 'pristine' target as well.

The 'pristine' target should likewise remove the man pages which
are generated from the pod files.

Additionally, the documentation build uses a Doxyfile which is
output by configure; that should be removed (if present) by the
'distclean' target.

When hcrypto was converted to libtool, the use of ${OBJECTS} in
the clean target was missed, so we were leaving around most of the
actual object files -- $(LT_CLEAN) does not handle this for us.
Change the rule to remove *.o as is done elsewhere.

The conversion of libafsrpc to libtool added a convenience library
libafsrpc_sys.la, and changed how syscall.o was generated on
most architectures, to be the result of compiling an empty .c file
(instead of just an empty .o file).  This introduced a new
intermediate file, syscall.c, which must be cleaned up.

tvolser was only listing volserver and not vos in its list of
executables to remove while cleaning.

The conversion of venus/test to libtool was not done quite right.
Makefile.libtool and the .lo suffix are only needed when libtool
is being used to link *libraries*; just Makefile.pthread suffices
when libtool is being used to link executables.  As such, remove
the inclusion of Makefile.libtool, and change the .lo targets back
to regular .o ones, and add back *.o to the list of files to remove
in the 'clean' target (it was needed there even without the
other changes to that Makefile).

Change-Id: Ifbc3eee4ad2dce54df991301bc5edd11eb29a24a
Reviewed-on: http://gerrit.openafs.org/11532
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agoafs: Consolidate fheader initialization
Andrew Deason [Wed, 24 Sep 2014 22:50:02 +0000]
afs: Consolidate fheader initialization

We were initializing an afs_fheader structure in two different places,
with the same values. Consolidate these into a single function, so
updating the structure is easier. Also zero the whole structure, just
to make sure everything is initialized, even if the structure changes.

This commit should have no behavior impact; it is just code
reorganization.

Change-Id: If90757166d8490eaa053aa086c7b95349a62332e
Reviewed-on: http://gerrit.openafs.org/11510
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agovos: fix crash when getting a non-loopback host address
Michael Meffie [Thu, 20 Nov 2014 21:54:25 +0000]
vos: fix crash when getting a non-loopback host address

Fix a crash in vos when trying to find a non loopback server address.

The struct hostent h_addr_list field is a null terminated array of
pointers to addresses, in network byte order.  The struct hostent length
field is not the length of the h_addr_list array (as one would expect),
but rather the length of an address in bytes, which is always 4 for IP
version 4 addresses.

Verify the returned addresses are IPv4 and take care to not iterate
beyond the end of the address pointer array.

The non-loopback address check was introduced
commit dc2a4fe4e949c250ca25708aa5a6dd575878fd7e.

Change-Id: I75dff5ed2a7dd3c4bd6605b375a7a2ffa91eff01
Reviewed-on: http://gerrit.openafs.org/11609
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agolibafs: fix some nits around the symlink VOP
Ben Kaduk [Wed, 4 Dec 2013 23:43:51 +0000]
libafs: fix some nits around the symlink VOP

Commit 3f4c1099b7b (gerrit 10474) introduced a few issues, addressed here.

vpp is idiomatically of type 'struct vnode *', not 'struct vcache *';
use pvc as the name of the parent vcache pointer instead.

Fix whitespace.

Change-Id: Ic5d98a43446861bb571fe5a260e7ae1eea1051fd
Reviewed-on: http://gerrit.openafs.org/10531
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agoWindows: Fix cm_AppendServerList
Jeffrey Altman [Mon, 6 Oct 2014 23:20:27 +0000]
Windows: Fix cm_AppendServerList

Should use || and not | as the operator when testing for
NULL pointers.

Change-Id: I00afe64aec4f965d6a831028b546ed01d8e9672a
Reviewed-on: http://gerrit.openafs.org/11523
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agocmd: avoid piggy-backing flags in the help string
Michael Meffie [Fri, 4 Apr 2014 14:14:15 +0000]
cmd: avoid piggy-backing flags in the help string

Remove the hack to piggy-back the hidden command option
in the help string argument.

Change-Id: Iedcb6b96e98b766e3ef2c87cd6e5d41874f2c0b7
Reviewed-on: http://gerrit.openafs.org/10982
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agocmd: add flags argument to create syntax function
Michael Meffie [Thu, 21 Aug 2014 04:25:45 +0000]
cmd: add flags argument to create syntax function

Add the flags argument to cmd_CreateSyntax() and update all callers.
The flags argument will be used to set command options, such as
CMD_HIDDEN.

Change-Id: Ia51be9635f262516cb084d236a9e0756f608bf16
Reviewed-on: http://gerrit.openafs.org/11430
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

9 years agoFBSD: osi_vcache: remove support for unsupported FreeBSD releases
Garrett Wollman [Wed, 13 Aug 2014 01:56:22 +0000]
FBSD: osi_vcache: remove support for unsupported FreeBSD releases

Support for FreeBSD 7.x terminated in early 2013, and it's highly
unlikely that anyone was successfully using OpenAFS in that
environment.  OpenAFS has not been tested on 7.x since at least that
time, probably longer.  This removes the #ifdefs that support pre-8.0
releases.

Change-Id: I01cbce2d98f02755b170df34d948a94525df3853
Reviewed-on: http://gerrit.openafs.org/11382
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

9 years agoExport xdr_nbulkentries from liboafs_vldb
Nathaniel Wesley Filardo [Mon, 8 Sep 2014 00:41:06 +0000]
Export xdr_nbulkentries from liboafs_vldb

Change-Id: I117b875189f4f9de971a99ff68eca470515a11ad
Reviewed-on: http://gerrit.openafs.org/11449
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agoMove vos COMMONPARMS to a larger offset
Nathaniel Wesley Filardo [Mon, 28 Jul 2014 00:16:35 +0000]
Move vos COMMONPARMS to a larger offset

Currently, vos.c leaves a gap of 12 in the argument handling array
before its common operations (-verbose, -noauth, etc.); 'vos each'
will take more, so move that to 25.

While here, switch to named constants for these arguments, which
should make it easier to do this again, if ever necessary.

Change-Id: Idc4424e5fe4efd78389ea8421db000a361b461ec
Reviewed-on: http://gerrit.openafs.org/11332
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

9 years agorx: Named values for securityObjectStats types
Ben Kaduk [Wed, 27 Nov 2013 22:31:16 +0000]
rx: Named values for securityObjectStats types

Stop using hardcoded constants and use defined symbols for these
values.

Change-Id: I3edcf809572cb8c8360af19dcab7a12c4d1be4a9
Reviewed-on: http://gerrit.openafs.org/10528
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoDisallow creating users with ANONYMOUSID
Benjamin Kaduk [Wed, 26 Mar 2014 11:35:29 +0000]
Disallow creating users with ANONYMOUSID

It can result only in sadness.

Document this restriction alongside UID 0 as a reserved number.

Change-Id: Ibea2d98bc15a730bc85e84477791ca45a40f2d92
Reviewed-on: http://gerrit.openafs.org/10950
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

9 years agosystemd: RemainAfterExit in openafs-client.service
Andrew Deason [Tue, 2 Sep 2014 22:51:46 +0000]
systemd: RemainAfterExit in openafs-client.service

Currently, if the client is started without any options that require
an extra thread (like -afsdb), all processes spawned by afsd will
exit. There may be some kernel threads still active, but those are
spawned by the kernel module, and are not child processes of the
parent afsd process, or anything like that.

Since we are a Type=forking service in systemd, systemd interprets
this situation to mean that the service has stopped successfully, and
then runs the ExecStop commands. So, for example, if our AFSD_ARGS in
our sysconfig is "-fakestat -afsdb", the service starts as normal. But
if it is changed to "-fakestat", then when openafs-client.service is
started, it immediately stops again.

To avoid this, turn on the systemd option RemainAfterExit, which tells
systemd that the service has not stopped if all of our processes have
exited. The client service will thus remain running until it is
stopped.

Issue reported by Rich Sudlow.

Change-Id: If760d3617d4afbcfac923df726eb58b03ce25771
Reviewed-on: http://gerrit.openafs.org/11440
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

9 years agoNetBSD osi_crypto: use cprng(9) for random source on NetBSD 6.99/7.x
Jonathan A. Kollasch [Thu, 17 Apr 2014 16:03:11 +0000]
NetBSD osi_crypto: use cprng(9) for random source on NetBSD 6.99/7.x

Change-Id: Id8ee7f149cdc921989a5de7dda35739147de0014
Reviewed-on: http://gerrit.openafs.org/11086
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agoUpdate CellServDB to 20141117 snapshot
Benjamin Kaduk [Wed, 19 Nov 2014 19:14:07 +0000]
Update CellServDB to 20141117 snapshot

This should be all the locations we keep it in-tree.

Change-Id: I6819bf0658766aaad21ad38417295616418d41c5
Reviewed-on: http://gerrit.openafs.org/11607
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agoNetBSD: catch up to <sys/simplelock.h> removal in NetBSD 6.99.x
Jonathan A. Kollasch [Thu, 17 Apr 2014 17:32:17 +0000]
NetBSD: catch up to <sys/simplelock.h> removal in NetBSD 6.99.x

Change-Id: I2c663fc426914e978e98c6003419503b57a020d3
Reviewed-on: http://gerrit.openafs.org/11087
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agofix whitespace errors in acinclude.m4
Michael Meffie [Sat, 1 Nov 2014 03:45:13 +0000]
fix whitespace errors in acinclude.m4

Use tabs instead of spaces in the sysname lookup case
statement for the macos cases.

Change-Id: Iee03d1b593aee4f6c4bc2488b069b21e116c9f1d
Reviewed-on: http://gerrit.openafs.org/11566
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agoLINUX: Avoid check for key_type.match existence
Andrew Deason [Wed, 5 Nov 2014 16:22:00 +0000]
LINUX: Avoid check for key_type.match existence

Commit b5de4a9f removed our key_type 'match' function for kernels that
do not have such a 'match' function pointer. However, this added a
configure test where we are supposed to fail for the "new" behavior,
which is discouraged.

This causes an actual problem, because this test will fail on at least
RHEL5, due to arguably unrelated reasons (the header file for the
relevant struct is in key.h instead of key-type.h). And so, in that
situation we avoid defining a 'match' function callback, meaning our
'match' function callback is NULL, which causes a panic when we try to
actually look up keys for a PAG.

To fix this, transform the 'match' config test into one where we
succeed for the "new" behavior. We do this by testing for the
existence of the new functionality that replaced the old 'match'
function, which is the match_preparse function (specifically, the
'cmp' field in the structure accepted by match_preparse). This should
cause unrelated compilation errors to cause us to revert to the "old"
behavior instead of the "new" behavior. At worst, this should cause
build issues if we get the config test wrong (since we will try to use
the 'match' function definition that does not exist), instead of
panicing at runtime.

Note that while we test for key_type.match_preparse, we don't actually
use that function, since our 'match' functionality is the same as the
default behavior (according to b5de4a9f). So, we can avoid defining
any such function for newer kernels.

Thanks to Stephan Wiesand for bisecting this issue.

Change-Id: If6f93d6b5340fa738a55adeb7778d26ff5dbacc1
Reviewed-on: http://gerrit.openafs.org/11589
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agorx: initialize memory before use
Arne Wiebalck [Fri, 7 Feb 2014 10:23:32 +0000]
rx: initialize memory before use

initialize sockaddr_in.sin_zero before using. cosmetic, might fix some
compiler warnings.

Change-Id: Ib9c4707373ca98742f6a5e28e60006499527fa38
Reviewed-on: http://gerrit.openafs.org/10816
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoAllow compiling with KERNEL and AFS_PTHREAD_ENV
Benjamin Kaduk [Wed, 15 Oct 2014 19:03:36 +0000]
Allow compiling with KERNEL and AFS_PTHREAD_ENV

Add the necessary preprocessor conditionals to allow building
libuafs with AFS_PTHREAD_ENV defined.

A follow-up commit will switch to building libuafs using libtool,
which will set the pthread compiler/linker flags.  UKERNEL is already
using the pthread primitives for its internal kernel synchronization,
so there should not be any harm from additionally specifying the
pthread build arguments.

This change was produced mostly in a mechanical fashion, attempting
to perform such a build, and eliminating compiler and linker errors
in an iterative process.  No concerted effort has been made to audit
the whole kernel codebase for correctness of conditionals, but the
linktest executable does link (that is, the overall build succeeds).

Change-Id: I14a3ab5fce72812d92ba5657c734783dbd086ee3
Reviewed-on: http://gerrit.openafs.org/11546
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoklog: make krb5_524 non-fatal for native K5 tokens
Jeffrey Altman [Wed, 15 Oct 2014 16:19:44 +0000]
klog: make krb5_524 non-fatal for native K5 tokens

The krb5_524_conv_principal() function should fail whenever the Kerberos
v5 principal cannot safely be mapped onto a Kerberos v4 principal, and
does fail on some Kerberos v5 principals used in real-world AFS
deployments.

Prior to this patchset a failure was treated as a fatal error that
in turn prevents an AFS token from being generated or set into the
cache manager.

Prior to b1f9b4cb5dd295162ae51704310e9d6058008f0a the
krb5_524_conv_principal() function wasn't used and a local client
mapping was created.  b1f9b4cb5dd295162ae51704310e9d6058008f0a
replaced the local mapping with the krb5 function because the local
mapping could be wrong and confusing.

The krb5_524_conv_principal() function as applied to AFS tokens is
just a local guess.  How the username in the token is interpreted by
the AFS server is up to the server.

krb5_524_conv_principal() is only used for Krb5 native tokens. For Krb4
tokens the krb5_524_convert_creds() function is used to obtain both the
Kerberos v4 ticket and the converted names from the KDC. Many
organizations used the krb524d service to perform name translation. When
the krb524d service is used, the name translation is performed by the KDC,
so there is no local call to krb5_524_conf_principal() which might fail.
As a result, disallowing the use of a native Krb5 token due to a failed
local name translation is a needless loss of functionality; the local name
translation is not an essential part of obtaining a token.

This patchset modifies the behavior such that krb5_524_conv_principal()
errors are non-fatal.

 1. If -noprdb is not specified the error message is generated
    and a NULL username is used.

 2. If the username is NULL the prdb lookup is disabled.

 3. If the username is NULL the informational messages do not
    include a username.

 4. If the username is NULL the username info provided to the
    cache manager in the token description is the nul string.

Credit to Ben Kaduk for assistance with the wording of this
commit message.

Change-Id: Ib07131fc0ff4bf5319815213198c3f0adac17b10
Reviewed-on: http://gerrit.openafs.org/11542
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoStylistic tweak lwp/process.o machinery
Nathaniel Wesley Filardo [Mon, 13 Oct 2014 05:02:41 +0000]
Stylistic tweak lwp/process.o machinery

Rename process.s to process.default.s so that the name "process.s" is free
for use, and switch to using that as the ephemeral file name.  This enables
the use of gcc for ${AS}, despite gcc's ignoring files with extensions that
it does not recognize.

Change-Id: Idc0716547770fe4fc94bc3fa2c223966f3f76c3b
Reviewed-on: http://gerrit.openafs.org/11535
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agotests: Fix fmt-t.c warning
Andrew Deason [Mon, 6 Oct 2014 17:47:13 +0000]
tests: Fix fmt-t.c warning

'main' in fmt-t.c was declared as a prototype-less function, which
triggers a warning, which is an error with --enable-checking. Fix it
by declaring 'main' properly.

Change-Id: I45cfec591acd0ef8d7836c79e997e8ffe29b9e38
Reviewed-on: http://gerrit.openafs.org/11539
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Nathaniel Filardo <nwfilardo@gmail.com>

9 years agovldb_check: fix false mh block error message
Michael Meffie [Fri, 24 Oct 2014 21:17:07 +0000]
vldb_check: fix false mh block error message

Fix a false error message about invalid mh blocks when the vldb has more
than one mh block.  To add insult to injury, vldb_check complains about
the wrong address and block number.

The flags field in the mh block header is in network byte order, in all
of the blocks, not just the first one.  Be sure to convert all of them
to host byte order so the VLCONTBLOCK flag check works.  Fix the error
message on the secondary blocks to show the correct address and block
number.

Example bogus error messages:

vldb_check ./vldb.DB0
address 132120 (offset 0x20458): Multihomed Block 0: Not a multihomed block
address 132120 (offset 0x20458): Multihomed Block 0: Not a multihomed block
address 132120 (offset 0x20458): Multihomed Block 0: Not a multihomed block

Change-Id: I31d96ad43f01fbf2774815184942be45e2d7820b
Reviewed-on: http://gerrit.openafs.org/11555
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoFinish deorbiting libjuafs.a
Benjamin Kaduk [Mon, 6 Oct 2014 21:19:44 +0000]
Finish deorbiting libjuafs.a

Change I2074d5bc26e326db36b16e055431818ef1c69210 removed the separate
compilation/link of a libjuafs.a (since it was functionally identical
to the libuafs.a already being built), but retained a libjuafs.a in
TOP_LIBDIR for use by src/JAVA/libjafs/.

This commit adjusts src/JAVA/libjafs to refer to libuafs.a directly,
and removes references to libjuafs.a which are no longer relevant.

Change-Id: I0d02ea9e4be773ac50a04925c45e5f243650e21a
Reviewed-on: http://gerrit.openafs.org/11526
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoMake afs_usrops.h more closely resemble reality
Benjamin Kaduk [Thu, 16 Oct 2014 04:04:14 +0000]
Make afs_usrops.h more closely resemble reality

Remove prototypes for many routines which are not implemented.
(I thought some toolchains would complain about this sort of thing?
Maybe we disable it.)

Change-Id: Id09f494f1c64c2feb05ae82ead9898c08888a5de
Reviewed-on: http://gerrit.openafs.org/11547
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoBuild libuafs with libtool
Benjamin Kaduk [Sat, 20 Sep 2014 03:04:10 +0000]
Build libuafs with libtool

Use the standard program for building PIC and non-PIC object files,
instead of rolling our own.  This allows us to pull the build rules
into the Makefile.common, leaving just compiler flags and similar
in the MakefileProtos.

This does change the build flags being used to compile these files
somewhat -- the old CRULE1 and CRULEPIC used CC instead of CCOBJ
or MT_CC, and did not pass MT_CFLAGS, but it should be safe to
move to the standard compiler invocations.  We can also eliminate
the libuafs-specific 'OPTF' variable which expands to OPTMZ almost
everywhere.

Rename our COMMON_INCLUDE to MODULE_INCLUDE so it's picked up properly
by the standard build rules; this will let us remove
${TOP_OBJDIR}/src/config and ${TOP_INCDIR} once the rest of the
build rules in this Makefile are converted to use libtool, as those
include directories are already added by COMMON_INCL in Makefile.config.

As a side effect, we get rid of the LIBUAFS make variable -- all sites
were defining it to libuafs.a anyway, so we can just hardcode it.

We can also build a shared libuafs.la "for free".  Don't install
it anywhere just yet, though.

Change-Id: I2bda2f40bbd0aa808c24e074d2d7bcd329f6b77e
Reviewed-on: http://gerrit.openafs.org/11472
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoAttempt to make hcrypto parallel-safe
Benjamin Kaduk [Thu, 16 Oct 2014 16:46:11 +0000]
Attempt to make hcrypto parallel-safe

make -j4 on a Fedora buildbot machine failed to compile engine.lo
because hcrypto/rand.h was missing.

Change-Id: I2750db9ed932144fbc66ede41d24c4930172a446
Reviewed-on: http://gerrit.openafs.org/11548
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years ago(Partially) unify XDR for libuafs and libafs
Benjamin Kaduk [Wed, 15 Oct 2014 23:49:12 +0000]
(Partially) unify XDR for libuafs and libafs

The libuafs build was getting xdr_vector() from both afsaux.c and
xdr_update.c, but because of the rules for creating static libraries,
this did not cause build errors.

The libafs build is sensitive to duplicate symbols, and was only
getting xdr_vector() from afsaux.c; libafs was not building xdr_update.c
or xdr_refernce.c (that is not a typo).

Remove duplicate xdr_vector() from afsaux.c, and build xdr_update.c
and xdr_refernce.c into libafs.

Remove the unused #define of AUTH_DES.

Change-Id: I58ea595d424801697acb07406664ede33aeaf026
Reviewed-on: http://gerrit.openafs.org/11545
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoAvoid AFS_version conflicts in uafs
Benjamin Kaduk [Wed, 15 Oct 2014 21:52:22 +0000]
Avoid AFS_version conflicts in uafs

libuafs links in both afsd.o and AFS_component_version_number.o;
afsd.c #includes AFS_component_Version_number.c, which causes
symbol conflicts when linking shared.

Don't include the version file when compiling for UKERNEL, to
avoid the conflict.

Change-Id: I9474faf10e029d0022b12431aad51e27412b19fc
Reviewed-on: http://gerrit.openafs.org/11544
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoDo not install kauth manpages when kauth is disabled
Benjamin Kaduk [Tue, 8 Apr 2014 01:54:46 +0000]
Do not install kauth manpages when kauth is disabled

Commit 5afe7a882b0bb90a515e505d9ffce4f644633f06 added a configure
option to disable the installation of the kauth suite, but did not
add any logic to disable the installation of the corresponding man
pages, so those man pages were always installed regardless of the
options to configure.

Add logic to doc/man-pages/Makefile.in to create .noinstall files
for man pages which should not be installed in the current configuration.
Depend on the Makefile (which will be regenerated by configure) in
this target so as to attempt to behave properly if configure is re-run
with different arguments in the same working tree.

Change-Id: I19b77a9f20fe27c49db14f3e800d8c77cda1bb3a
Reviewed-on: http://gerrit.openafs.org/10993
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoauth: Fix GetNthIdentityOrUser EOF return code
Andrew Deason [Tue, 14 Oct 2014 22:02:55 +0000]
auth: Fix GetNthIdentityOrUser EOF return code

Before commit 0af17e7e, afsconf_GetNthUser always returned 1 on
failure, to indicate to the caller that they should stop traversing
over the list. After commit 0af17e7e, when reaching the end of the
list, we return EIO or -1. This causes 'bos listusers' invocations to
always fail, since 'bos' clients expect to get the code 1 when
reaching the end of the SUsers list.

To fix this, make GetNthIdentityOrUser always return -1 when searching
beyond the end of the list. For the newer interface
afsconf_GetNthIdentity, we return this as-is, to have a separate
return code specifically for EOF, but still allowing us to return any
positive error code in case of an error.

For the older interface afsconf_GetNthUser, return 1 in this
situation, to retain compatibility with the old interface (both at the
libauth level and on the wire).

Change-Id: I2db4760440d7846dc290a05fa24e24ec97a02f12
Reviewed-on: http://gerrit.openafs.org/7377
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoRemove dead code
Benjamin Kaduk [Wed, 15 Oct 2014 19:04:16 +0000]
Remove dead code

RX_ENABLE_TSFPQ is never defined for KERNEL builds.

In any case, there's a syntax error in the removed code, with a
missing '&' before rx_stats.receivePktAllocFailures.

Change-Id: I3aaf3d80f7dfee6836016b65b057e1312d716368
Reviewed-on: http://gerrit.openafs.org/11543
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoBuild fix for recent FreeBSD -current
Benjamin Kaduk [Thu, 30 Oct 2014 23:51:29 +0000]
Build fix for recent FreeBSD -current

r273707 added a flags argument to syscall_register(), so
add the appropriate version check in param.generic_fbsd.h
and ues that in the main code.

Change-Id: I7ddf6e1295d7ed94625f19fdeee4e38ef5fd511e
Reviewed-on: http://gerrit.openafs.org/11565
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoremove cmd-suite-option-for-hiding-admin-commands
Michael Meffie [Thu, 21 Aug 2014 04:06:26 +0000]
remove cmd-suite-option-for-hiding-admin-commands

Remove the incomplete and non-functional cmd option for hiding admin
commands, introduced in commit 36d02757fd6863a845163daf0d730bdcc0a28343.

This patch removes the CMD_ADMIN flag, the non-functional help -admin
parameter, and the non-functional cmd_IsAdministratorCommand() function.

Thanks to Jeffrey Altman for pointing out this old commit and for
suggestions on cleanup.

Change-Id: I72c7d2ed7109b1238713fe0d6d177c5af6fc6b7d
Reviewed-on: http://gerrit.openafs.org/11429
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoAdd sparc_linux26 sysname and params
Nathaniel Wesley Filardo [Sun, 2 Nov 2014 06:22:52 +0000]
Add sparc_linux26 sysname and params

A copy of sparc_linux24 without #undef USE_UCONTEXT.  Userland
tested on a Debian unstable-release machine.

Change-Id: I69a4226622748b18f5835d6517297b2d3750586a
Reviewed-on: http://gerrit.openafs.org/11567
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoAttempt to make the server install bits current
Benjamin Kaduk [Thu, 30 Oct 2014 23:38:50 +0000]
Attempt to make the server install bits current

Avoid using -noauth, and mention both the rxkad.keytab (1.6)
and the KeyFileExt (as 1.8, though it's only master at present).
To support these, move forward the use of kadmin to extract
the afs/cell principal's keytab.

Move the buserver's creation to the end of the list and mark it
as optional (many sites do not run the AFS backup suite).

Deindent some programlisting blocks so they don't flow off the
page as much in the PDF version.

Drop vos syncserv and vos syncvldb from the tasks for setting
up a new server; they should not be needed, as the new db server
should pick up the existing database when it joins the quorum.

General edits for clarity, whitespace and such.

Change-Id: I951ec3ee237e4c83a17c82802328f0a454b61097
Reviewed-on: http://gerrit.openafs.org/11581
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoSwitch other-linux to built-from-source
Benjamin Kaduk [Mon, 3 Nov 2014 18:33:56 +0000]
Switch other-linux to built-from-source

Don't talk about tarball distributions; we shouldn't be
doing those anymore.  Also switch away from 'make dest'.

Change-Id: If0badacab4b3c2492e90867328153f83da82bfc1
Reviewed-on: http://gerrit.openafs.org/11580
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoAdd a Debian/Ubuntu subsection
Benjamin Kaduk [Mon, 3 Nov 2014 18:13:44 +0000]
Add a Debian/Ubuntu subsection

As an alternative to rpm-based systems or "systems packaged as
tar files".  Luckily, the instructions are pretty simple.

Change-Id: I8045763b518465c3ffd7fe3f177fff98146033fb
Reviewed-on: http://gerrit.openafs.org/11579
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoDeorbit upserver from the quickstart guide
Benjamin Kaduk [Mon, 3 Nov 2014 21:47:16 +0000]
Deorbit upserver from the quickstart guide

It's not the recommended way to push updates anymore,
and clutters up the guide.

Change-Id: I248380f12609a2ca03f47602773dc08f230b6fbe
Reviewed-on: http://gerrit.openafs.org/11578
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoDrop the non-DA fileserver
Benjamin Kaduk [Mon, 3 Nov 2014 21:46:20 +0000]
Drop the non-DA fileserver

The instructions are clearer when we just tell people what
to do, and we think that dafs should be right for almost
everyone.  Mention that the traditional fileserver is an
option and where to read about it, but nothing more.

Change-Id: I1fccceb8ee2bf2ec1e5afb0f5b034f029ee96c61
Reviewed-on: http://gerrit.openafs.org/11577
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoReorder "Getting Started" sections
Benjamin Kaduk [Mon, 3 Nov 2014 17:59:14 +0000]
Reorder "Getting Started" sections

Put the ones most likely to be relevant at the top, instead
of sorting alphabetically.

Change-Id: I6ad80ee2a30b7192d8c8e4668234fa1789e1a213
Reviewed-on: http://gerrit.openafs.org/11576
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoDeorbit "Getting started on IRIX systems"
Benjamin Kaduk [Mon, 3 Nov 2014 17:57:08 +0000]
Deorbit "Getting started on IRIX systems"

IRIX is mostly gone as an upstream.  The case for removing this
is less clear than the case for removing the HP-UX docs, but
it still feels like clutter in this document.

Change-Id: Ib7e9bfc8f7ae8e08e9f12b70d5df615496f57bb6
Reviewed-on: http://gerrit.openafs.org/11575
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoDeorbit "Getting started on HP-UX systems"
Benjamin Kaduk [Mon, 3 Nov 2014 17:55:55 +0000]
Deorbit "Getting started on HP-UX systems"

We don't really support HP-UX anymore; no need to clutter up
the documentation with it.

Change-Id: Ib75f4f137c3cfcb5ab2aece3746964f1cfbab051
Reviewed-on: http://gerrit.openafs.org/11574
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoUpdate QuickStartGuide front matter
Benjamin Kaduk [Wed, 29 Oct 2014 13:10:21 +0000]
Update QuickStartGuide front matter

Bump copyright and, uh, major version for the "in progress" note...

Change-Id: I5edd235864138b82c84dc1c1218f849217efad1e
Reviewed-on: http://gerrit.openafs.org/11573
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoroken: configure checks for inet_ntop and inet_pton
Michael Meffie [Fri, 1 Aug 2014 13:13:43 +0000]
roken: configure checks for inet_ntop and inet_pton

Change-Id: Idf2eee040235bbf1f34ed993c74dd5936ae063c6
Reviewed-on: http://gerrit.openafs.org/11584
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoImport of code from heimdal
Heimdal Developers [Fri, 1 Aug 2014 12:56:02 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
5dfaa0d10b8320293e85387778adcdd043dfc1fe (git2svn-syncpoint-master-311-g5dfaa0d)

New files are:
roken/inet_ntop.c
roken/inet_pton.c

Change-Id: Ice2f687c67550409b366fbea3e52ae42284f4cbd
Reviewed-on: http://gerrit.openafs.org/11583
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoroken: add inet_ntop and inet_pton to the imported file list
Michael Meffie [Fri, 1 Aug 2014 12:38:45 +0000]
roken: add inet_ntop and inet_pton to the imported file list

Change-Id: If785d18e3fd5f333c62bff9ddee2c5835ee871db
Reviewed-on: http://gerrit.openafs.org/11582
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoavoid writing loopback addresses into CellServDB
Michael Meffie [Tue, 4 Nov 2014 00:06:15 +0000]
avoid writing loopback addresses into CellServDB

Do not use loopback addresses for the server side CellServDB file.  Use
getaddrinfo() instead of gethostbyname() to look up a list of IPv4
addresses for a given hostname, and take the first non-loopback address.

This avoids writing a loopback address into the CellServDB on systems
such as Debian, which map the address 127.0.1.1 to the hostname in the
/etc/hosts file.

Change-Id: I11521df50262ca80c7db21b7b44671d94bef3587
Reviewed-on: http://gerrit.openafs.org/11585
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoDocument the vldb (ubik) file format
Michael Meffie [Wed, 29 Oct 2014 21:25:29 +0000]
Document the vldb (ubik) file format

Briefly document the vldb version 4 file format.  Describe the vl
header, the vl entry, and mh extensions.

Thanks to Marcio Barbosa for an initial draft, comments, and review.

Thanks to Ben Kaduk the prdb.txt, and for an initial review and comments.

Change-Id: If3ca85419027a218b7bb1585f5d5cd4763ad5b26
Reviewed-on: http://gerrit.openafs.org/11564
Reviewed-by: Nathaniel Filardo <nwfilardo@gmail.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoLINUX: Avoid d_revalidate failure on mtpt mismatch
Andrew Deason [Tue, 28 Oct 2014 05:10:56 +0000]
LINUX: Avoid d_revalidate failure on mtpt mismatch

Currently, if afs_linux_dentry_revalidate is given an inode that
corresponds to a mtpt vcache ('vcp'), it resolves the mtpt to its root
dir if it's easy to do so (mvid and CMValid are set). Later on, we run
afs_lookup to see if looking up our dentry's name returns the same
vcache that we got; afs_lookup presumably will also resolve the mtpt
if it's easy to do so.

However, it is possible that afs_linux_dentry_revalidate and
afs_lookup will make different decisions as to whether or not they
resolve a mtpt to a dir. Specifically, if CMValid is cleared after
afs_linux_dentry_revalidate checks for it, but before afs_lookup does,
then afs_lookup will return a different vcache than
afs_linux_dentry_revalidate is expecting, even though the relevant
directory entry has not changed. That is, tvc is not equal to vcp, but
tvc could be a mtpt that resolves to vcp, or vice versa. CMValid can
be cleared by another thread at virtually any time, since this is
cleared in some situations when we're not sure if the mtpt resolution
is still valid (callbacks are broken, vldb cache entries expire, etc).

afs_linux_dentry_revalidate interprets this situation to mean that the
directory entry has changed, and so it eventually d_drop's the
associated dentry. The way that this manifests to users is that a
"fakestatted" mtpt can appear to be deleted effectively randomly, even
when nothing has changed. This can be a problem because this causes
the getcwd() syscall to return ENOENT when the working directory
involves such an affected directory.

To fix this situation, we just detect if afs_lookup returned either
'vcp' (our possibly-resolved vcache), or the original inode associated
with the dentry we are revalidating. If the returned vcache matches
either of these, then the entry is okay and we don't need to
invalidate or drop anything.

FIXES 131780

Change-Id: Ide1dd224d1ea1e29a82eb7130a010877cf4e9fc7
Reviewed-on: http://gerrit.openafs.org/11559
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoLinux 3.18: key_type no longer has a match op
Marc Dionne [Thu, 23 Oct 2014 15:27:55 +0000]
Linux 3.18: key_type no longer has a match op

Structure key_type no longer has a match op, and
overriding the default matching has to be done
differently.

Our current match op doesn't do anything special so there's
no need to try to override the defaults; just remove the
assignment of .match and the associated function.

Change-Id: I0ee195e47f40688d9a71ea62a0b87a4265363f05
Reviewed-on: http://gerrit.openafs.org/11563
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoLinux 3.18: d_invalidate can no longer return an error
Marc Dionne [Thu, 23 Oct 2014 15:12:57 +0000]
Linux 3.18: d_invalidate can no longer return an error

d_invalidate is now defined as void and does not have
a return value to check.

Change-Id: Ief1b562db63877dde9f4a8ac4918b727a05b23bb
Reviewed-on: http://gerrit.openafs.org/11562
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoviced: kill CLIENT_TO_ZERO macro
Jeffrey Altman [Thu, 12 Jun 2014 00:53:09 +0000]
viced: kill CLIENT_TO_ZERO macro

Move all struct client fields that are to be zeroed upon structure
reuse to a new struct client_to_zero.  Include the new structure
within struct client and call memset() on that structure.

Change-Id: I0f83f5f18b41bc0d4f8e1f7f8e04cd5508cbe4e1
Reviewed-on: http://gerrit.openafs.org/11288
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoviced: kill HOST_TO_ZERO macro
Jeffrey Altman [Thu, 12 Jun 2014 00:40:47 +0000]
viced: kill HOST_TO_ZERO macro

Move all struct host fields that are zeroed into a new structure
host_to_zero which is then included in struct host as 'z'.

Remove the HOST_TO_ZERO macro entirely as its presence can lead
to the introduction of dangerous errors.

Change-Id: I44afd37413afae4e4357e68cdadf5c28784611c5
Reviewed-on: http://gerrit.openafs.org/11287
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoviced: move host tmay fields before index
Jeffrey Altman [Wed, 11 Jun 2014 23:37:34 +0000]
viced: move host tmay fields before index

The index field and those after it in struct host do not get zeroed
when a host is reused.  The placement of the tmay fields after index
in commit 9a0a8ca4d186cf953b87d9fae1a35f66090b060c results in the
use of uninitialized memory.

This change moves the tmay fields before index which permits
the HOST_TO_ZERO() macro to compute the correct size to be memset()
to zero.

Change-Id: I1f93bebb23c99eaa7826dafa8cd7497d1b49bb53
Reviewed-on: http://gerrit.openafs.org/11286
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoviced: remove obsolete comment about alignment
Mark Vitale [Thu, 12 Jun 2014 18:20:24 +0000]
viced: remove obsolete comment about alignment

Alignment may have been historically relevant, but is no longer.
Remove the comment.

Also remove the unneeded 'dummy' field which does not provide
padding for a useful alignment.

Change-Id: I447fb73c379e6f86facd955a29ffd80e8929ceff
Reviewed-on: http://gerrit.openafs.org/11289
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agolibafs: avoid contaminating the return of lookup vnop
D Brashear [Tue, 14 Oct 2014 18:03:40 +0000]
libafs: avoid contaminating the return of lookup vnop

when we resort to checking the inlinebulk errors to see if a retry
is needed, do not overwrite the lookup return code; only decide if
a retry is needed.

problem case was where the first vnode returned EACCES and so
all vnodes were assumed to have failed, when just one did.

Change-Id: Ifd7361ce5af50a72817afa81d31d9cfbda906efd
Reviewed-on: http://gerrit.openafs.org/11537
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agoPackaging support for MacOS X 10.10 "Yosemite"
Christer Grafström [Wed, 29 Oct 2014 07:05:06 +0000]
Packaging support for MacOS X 10.10 "Yosemite"

This is just the packaging part of the patch submitted in the
RT ticket. The configuration part is in the preceding change.

FIXES 131946

Change-Id: Ic5b200b1f54d7f9f9552b0f9e2b881c3f0af9bc2
Reviewed-on: http://gerrit.openafs.org/11561
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoAdd support for configuration of MacOS 10.10 "Yosemite"
Christer Grafström [Wed, 29 Oct 2014 06:56:35 +0000]
Add support for configuration of MacOS 10.10 "Yosemite"

This is just the configuration part of the patch submitted
in the RT ticket. The packaging part will will follow in the
next change.

FIXES 131946

Change-Id: Ic8835b1ddf317600483505a2d94d9f3568720804
Reviewed-on: http://gerrit.openafs.org/11560
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agorx: Reset lastSendData when resetting call
Andrew Deason [Mon, 27 Oct 2014 21:39:34 +0000]
rx: Reset lastSendData when resetting call

Currently we use call->lastSendData to attempt to detect a stalled
call, if it's been too long since the last time the call sent any
data. However, we never initialize lastSendData to anything when
creating a new call.

This means that when rx_NewCall (or rxi_NewCall) returns, lastSendData
can be nonzero. This can happen if we reuse a DALLY call, or if we
pull a call off of rx_freeCallQueue. This can be a time very far in
the past, since the lastSendData time has not changed since the last
time the call was used; it will remain unchanged until a user of the
new call writes something to the call stream.

This can be a problem between the time when a caller creates a new
call with rx_NewCall and when the caller actually writes something to
the stream. Between those two times, if lastSendData happens to be set
to a time in the past, we may call rxi_CheckCall on that call, and
abort the call for being idle. The call will thus be aborted before it
even sent any data on the wire.

This is of particular concern for multi_Rx calls, since those can
create a large number of call structures, possibly introducing a delay
between calling rx_NewCall and writing anything to the stream (if one
of the later rx_NewCall invocations blocks waiting for an open call
channel, for instance, all of the previous allocated calls will stick
around unused for potentially a long time).

One such multi_Rx call is done by the cache manager, where it
periodically uses multi_Rx to call RXAFS_GetCapabilities to probe
fileservers for reachability. If this issue occurs during that
operation you can see a large number of servers get marked down for
code -9 (RX_CALL_IDLE), and then get marked as coming back up.

To fix this, set lastSendData to 0 when resetting a call, along with
most of the other fields in a call, to indicate that the call has
never sent any data. As long as lastSendData is 0, the call will never
get aborted with RX_CALL_IDLE, and this situation will be avoided.
This ensures that this issue cannot happen, since rxi_ResetCall is
guaranteed to be called at some point whenever we reuse a call
structure for any reason.

Change-Id: Ie96d1c640616fd5a234c635f60dfef4ad7c19d28
Reviewed-on: http://gerrit.openafs.org/11557
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agoRemove duplicate CREATE_SGUID_ADMIN_ONLY define
Nathaniel Wesley Filardo [Sat, 25 Oct 2014 23:48:36 +0000]
Remove duplicate CREATE_SGUID_ADMIN_ONLY define

A trivial omission from 30433f36a953187f27b5db9fb432f3b7dce91e6b

Change-Id: If85ebd73a68c6226077b690243a94c2e40f88149
Reviewed-on: http://gerrit.openafs.org/11556
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agoRemove documentation of 'program'
Benjamin Kaduk [Wed, 22 Oct 2014 16:07:37 +0000]
Remove documentation of 'program'

This tool was removed in 2006 in commit
b405868ca02880207bda1ec6eb4e21c7b0ac250c. Also remove mention of
wsadmin, removed at the same time.

Change-Id: I8475b951f576f10ddd2f4b72565354b9fba41d94
Reviewed-on: http://gerrit.openafs.org/11554
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoRemove unused -k argument to fileserver
Benjamin Kaduk [Tue, 7 Oct 2014 02:54:09 +0000]
Remove unused -k argument to fileserver

It has been unused since the LWP fileserver was removed.
It was used to set the LWP stack size.

Change-Id: I2ffd3a2f02049a307b668a46b62b31dc9bc128a8
Reviewed-on: http://gerrit.openafs.org/11527
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoWarn at configure time about bitmap-later
Benjamin Kaduk [Mon, 6 Oct 2014 21:06:53 +0000]
Warn at configure time about bitmap-later

It's superseded by DAFS and is slated for removal post-1.8.

Change-Id: Id2c870fb76eeb470bbf393e99654df434b1a1a86
Reviewed-on: http://gerrit.openafs.org/11525
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoMerge pam into the kauth configure option
Benjamin Kaduk [Mon, 6 Oct 2014 17:31:23 +0000]
Merge pam into the kauth configure option

Realistically, you shouldn't be using either kauth or pam.  The
pam functionality provided by the module in our tree is only
useful in a kaserver-style environment, so it makes sense to merge
the two knobs.

Retain a separate enable_pam variable so that it can be overridden
on a per-architecture basis where it is known to not work.  Consolidate
the two places where we did such checks, as well.

Change-Id: I6bf39ee5002f943548c51d089fe612f7e2f0501b
Reviewed-on: http://gerrit.openafs.org/11524
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoRetire Makefile.shared
Benjamin Kaduk [Wed, 24 Sep 2014 04:31:16 +0000]
Retire Makefile.shared

It has served its purpose, and been replaced by libtool.

Change-Id: Ifb4e2f585fb4239e9138daef82dcc7f41d7f2a99
Reviewed-on: http://gerrit.openafs.org/11485
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoBuild kopenafs with libtool
Benjamin Kaduk [Wed, 24 Sep 2014 04:11:07 +0000]
Build kopenafs with libtool

Prior to this commit, we were installing libkopenafs.so.1.1.  As
for the other libtoolizations, bump SONAME to 2.0 as a general
precaution.

Change-Id: I6edef89737cf057eb8aab8dfe2eacfb4f417dd6e
Reviewed-on: http://gerrit.openafs.org/11484
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoLinux 3.17: Deal with d_splice_alias errors
Marc Dionne [Thu, 25 Sep 2014 10:52:12 +0000]
Linux 3.17: Deal with d_splice_alias errors

In 3.17 the logic in d_splice_alias has changed.  Of interest to
us is the fact that it will now return an EIO error if it finds
an existing connected directory for the dentry, where it would
previously have added a new alias for it.  As a result the end
user can get EIO errors when accessing any file in a volume
if the volume was first accessed through a different path (ex:
RO path vs RW path).

This commit just restores the old behaviour, adding the directory
alias manually in the error case, which is what older versions
of d_splice_alias used to do.

Change-Id: I5558c64760e4cad2bd3dc648067d81020afc69b6
Reviewed-on: http://gerrit.openafs.org/11492
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoLinux 3.17: No more typedef for ctl_table
Marc Dionne [Tue, 9 Sep 2014 13:39:55 +0000]
Linux 3.17: No more typedef for ctl_table

The typedef has been removed so we need to use the structure
directly.

Note that the API for register_sysctl_table has also changed
with 3.17, but it reverted back to a form that existed
before and the configure tests handle it correctly.

Change-Id: If1fd9d27f795dee4b5aa2152dd09e0540d643a69
Reviewed-on: http://gerrit.openafs.org/11455
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>

9 years agoLinux: Refine openafs-client.service dependencies
Anders Kaseorg [Wed, 3 Sep 2014 22:26:36 +0000]
Linux: Refine openafs-client.service dependencies

Make sure that openafs-client is started after the network is online,
and before services that need remote-fs at startup.

Change-Id: Ib69e0c07f9079f47bbe5057626652c44039c433a
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/11441
Reviewed-by: Chaskiel Grundman <cg2v@andrew.cmu.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agoFix disk name initialization in scout
Benjamin Kaduk [Wed, 17 Sep 2014 16:07:02 +0000]
Fix disk name initialization in scout

Scout needs to initialize names in scout_disk structures to prevent
the use of uninitialized data.  However, '\0' is a NUL character
constant, i.e., the integer value 0, which is interpreted as NULL
(the pointer constant) in a pointer context, such as when assigned to
a variable of type char*.  Since the name field in these structs is
passed to printing routines, the safe initialization value is the
empty string constant "", not a zero value.

Change-Id: Ie0530fc4fc090b226c0e54201b4a74158efddebd
Reviewed-on: http://gerrit.openafs.org/11469
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agoBuild fixes for recent FreeBSD -current
Benjamin Kaduk [Wed, 17 Sep 2014 02:57:53 +0000]
Build fixes for recent FreeBSD -current

Let's try a new paradigm of using flag checks in the main code,
which are based off of precise version checks in the FreeBSD-specific
param.h file.  It's not quite configure checks, but is much more
granular.

Change-Id: I8274a8ad3747d3847cdec3ce8d521837fd5b2a92
Reviewed-on: http://gerrit.openafs.org/11467
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

9 years agoTweak AFSDIR_PATH_MAX definition
Benjamin Kaduk [Mon, 8 Sep 2014 17:47:33 +0000]
Tweak AFSDIR_PATH_MAX definition

On recent Debian, we run into runtime errors in the test suite
because _POSIX_PATH_MAX is only 256, and that buffer is too small
for a call to realpath().  Use PATH_MAX if it's available and larger
than _POSIX_PATH_MAX, in a way that should be safe even when PATH_MAX
is not defined.

Change-Id: I39127e88d92b358245ece21131219380ca4be98a
Reviewed-on: http://gerrit.openafs.org/11453
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoLet mancheck_utils ignore version subcommands
Benjamin Kaduk [Mon, 8 Sep 2014 17:42:27 +0000]
Let mancheck_utils ignore version subcommands

We don't have a man page for the 'version' subcommand, which has
"always" been present but only recently was exposed to the usage.
It's okay to not have a man page for it, so tell the test infrastructure
to not complain about its absence.

Change-Id: Ife834d41797d1d1efe403b204736ac85d62724e9
Reviewed-on: http://gerrit.openafs.org/11452
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoAdjust configure defaults for 1.8
Benjamin Kaduk [Wed, 24 Sep 2014 03:42:50 +0000]
Adjust configure defaults for 1.8

Disable pam; enable pthreaded ubik.
(Pam is actually not installed by default anyway, since it is
functionally part of kauth.)

pthreaded ubik is believed to be stable, and we want to move away
from LWP moving forward.

Change-Id: I14d20e3157df625a9e04059534bbb59268384213
Reviewed-on: http://gerrit.openafs.org/11483
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoBuild hcrypto with libtool
Benjamin Kaduk [Fri, 19 Sep 2014 18:39:04 +0000]
Build hcrypto with libtool

Or rather, with lwptool, since we need a LWP version as well as
the various pthreaded versions.

The previous version was the initial version, 1.1, but since we're
switching to libtool, bump the version to 2.0 just to be safe.

Libtool abstracts away the extra logic that had previously been needed
to build different copies of rand-fortuna for the pthreaded and LWP
libraries.

As for roken, we must install both shared and static libraries
to $(TOP_LIBDIR) for unity of consumption, but remove the libtool
archive after instllation.

Change-Id: Ibc530a1fa4baa7a38b44eb3e0719e1905a6fe269
Reviewed-on: http://gerrit.openafs.org/11482
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoAllow external hcrypto
Benjamin Kaduk [Tue, 23 Sep 2014 22:19:09 +0000]
Allow external hcrypto

Put the configure checks into a separate file in src/cf, following
the same general structure as the roken checks.

Allow explicitly requesting the internal version, or checking
what's in the default paths, or providing a specific hcrypto root
or lib/include dirs for Debian compatibility.

We must still always compile libafshcrypto_lwp.a for use by LWP
binaries, from the bundled sources, but other binaries will use
the system version.

The hcrypto headers have an unfortunately large number of dependencies,
including depending on being able to find each other by including
<hcrypto/foo.h> paths.  As such we must pass both the user-supplied
directory and $dir/hcrypto to the preprocessor in order for things
to work, and we also may need to revisit the includes used in the
configure check for use on non-linux systems due to the dependencies
on system headers.

Change-Id: Idcba1418a19a7b562335524c911d69dc84268177
Reviewed-on: http://gerrit.openafs.org/11481
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoLink aklog against LIB_hcrypto
Benjamin Kaduk [Tue, 23 Sep 2014 20:58:08 +0000]
Link aklog against LIB_hcrypto

This was the last place where libafshcrypto.a was explicitly referenced,
preventing the use of an out-of-tree hcrypto library.

We will continue to need to build the in-tree code to produce a
libafshcrypto_lwp.a library for use in LWP applications, until we
do not have any more LWP applications, but some systems (such as
Debian) have a desire to avoid bundled libraries, so we should
facilitate the use of an external libhcrypto where possible.

Many consumers of libafshcrypto_lwp.a will be removed when the
LWP versions of various modules are removed after 1.8 is branched.

Change-Id: I23049866caae9c16ffb2ec32c5e7b058465a26ba
Reviewed-on: http://gerrit.openafs.org/11480
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoBuild venus tests with libtool
Benjamin Kaduk [Fri, 19 Sep 2014 19:01:29 +0000]
Build venus tests with libtool

This was the only place doing -lafshcrypto_lwp on the command line.
(There are other consumers, which list libafshcrypto_lwp.a explicitly;
we can use the presence of libafshcrypto_lwp.a to track progress towards
not needing a LWP hcrypto build, which must come from the in-tree version.)

Convert the tests to build with libtool (as pthreaded), where we can
just throw in $(LIB_hcrypto) and deal with what we get.

Change-Id: Ibc99615d2ff03b8aebf956502a2a6b1cb26f0a65
Reviewed-on: http://gerrit.openafs.org/11479
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoBuild roken using libtool
Benjamin Kaduk [Thu, 18 Sep 2014 17:55:15 +0000]
Build roken using libtool

Previously it was version 1.1; just in case I did something terrible,
bump it to 2.0, as was done for the other libtool conversions.

Install both the libtool archive and the static archive to $(TOP_LIBDIR),
so that all our internal consumers can just use -L$(TOP_LIBDIR) -lrokenafs
(well, via the LDFLAGS_roken and LIB_roken aliases) whether linking
statically or shared.  Installing the libtool archive gets us the shared
library there, but we have to then remove the libtool archive, since
this is not the location we told libtool we would install to (the prefix
we configured with), and libtool would get confused trying to use this
installed, but installed-at-the-wrong-place libtool archive.

Add rk_vsyslog to the export list, for AIX.

It is tempting to eschew this installation and instead point LIB_roken
at the libtool archive file librokenafs.la directly (with empty
LDFLAGS_roken), but this is not possible until all consumers of roken
are converted to build using libtool.  In practice, this will probably
not happen until LWP is evicted from the tree.

Change-Id: If6ab6c2d57c0a1b1511f9631b9aeb522d7e7392b
Reviewed-on: http://gerrit.openafs.org/11477
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoBuild auth tests with libtool
Benjamin Kaduk [Tue, 23 Sep 2014 19:33:08 +0000]
Build auth tests with libtool

(And pthreaded.)

This was the only place consuming librokenafs directly, which is
forbidden if we are to properly support using an external roken.
Convert to libtool and throw $(LIB_roken) on at the end.

Change-Id: I0cdea690800be1022888244b613929ce3154db1d
Reviewed-on: http://gerrit.openafs.org/11476
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoFix LT_LDLIB_shlib_missing
Benjamin Kaduk [Fri, 19 Sep 2014 01:35:30 +0000]
Fix LT_LDLIB_shlib_missing

Libtool's -symbols-file argument is taken as an exact match of symbols
that this library claims to export.  It does not filter based on what
symbols are actually present in the objects comprising the library.
Instead, if there are symbols in the file which are not implemented
by the library, there is an implicit assumption that some other library
will provide those symbols, which must be linked into a consumer of
this library alongside this library.

These are not the semantics we want (at present, only for roken), wherein
a library will implement some (but probably not all) of a given list
of symbols, and we want the export list to reflect only those symbols
which are implemented.  Instead, use the symbols file to build a regex that
will only match symbols listed in the file (and no other symbols), and
only export the subset which is present.

Change-Id: Id81f7a35089ae7f760fe643680f9bfb9c81521aa
Reviewed-on: http://gerrit.openafs.org/11475
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoAllow building with MIT krb5 and external roken
Benjamin Kaduk [Mon, 22 Sep 2014 21:02:27 +0000]
Allow building with MIT krb5 and external roken

That is, an external roken which is part of a heimdal distribution,
with full headers and libraries, most notably krb5.h and libkrb5.

This adjusts the ordering of file- and module-specific compiler and
linker arguments so that the more specific arguments are able to
take precedence.  For general flags arguments, such as enabling
or disabling warnings or features, the more-specific settings should
come last, so as to override the flags set by default.  However,
for arguments that affect a global search list (e.g., for headers
or libraries),  the more-specific arguments must come first, so
as to be at the beginning of the search list.

We presently use per-file CFLAGS for both warning-type flags and
preprocessor (i.e., include path) type flags, so add an additional
file-specific setting for CPPFLAGS, which comes at the beginning of
the compiler invocation.

At present, MODULE_CFLAGS are essentially only used for preprocessor
functionality, so treat them as CPPFLAGS and put them right after
the per-file CPPFLAGS.  (It might be cleaner to rename them to
MODULE_CPPFLAGS, but that would be more churn than is needed.  If
such a distinction turns out to be necessary, it can be done at a
later date.)  Likewise the MODULE_LDFLAGS are generally being used
to affect the library search path, so put them early as well.

Make the necessary Makefile changes to use these new features to
allow building with MIT krb5 and external roken: put KRB5_CPPFLAGS
in per-file CPPFLAGS, and put LDFLAGS_KRB5 in MODULE_LDFLAGS for
aklog.

Change-Id: I1091223b3b75c782b39b9e189bdd47e52ebefae2
Reviewed-on: http://gerrit.openafs.org/11474
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoAdjust roken.m4 to allow separate lib and include
Benjamin Kaduk [Mon, 22 Sep 2014 19:27:44 +0000]
Adjust roken.m4 to allow separate lib and include

In some installations (e.g., Debian), the roken libraries and headers
will not be installed in a common root directory to which /lib and
/include may be appended to find the appropriate library and header
directories, respectively.

Take inspiration from rra-c-util's GSSAPI macros and allow the
specification of separate include and lib directories.  Since there
are now three values to pass to the guts of the checking routine,
pass them in global variables instead of as parameters.

The expected usage would be to set either --with-roken, or both of
--with-roken-libdir and --with-roken-includedir, as in
configure --with-roken-include=/usr/include/heimdal
--with-roken-lib=/usr/lib/x86_64-linux-gnu/heimdal

This also fixes a typo that prevented --with-roken=internal from
functioning as intended.

Change-Id: I6f651ef3f3abf37c92ea81ea1801294ca3dc00b2
Reviewed-on: http://gerrit.openafs.org/11473
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoDeorbit separate JUAFS build
Benjamin Kaduk [Sat, 20 Sep 2014 01:18:38 +0000]
Deorbit separate JUAFS build

Since 80943970b8cfcdf3fc630b25804aebaea228bd73, when the web enhancements
were enabled universally, there has no longer been a functional difference
between the UAFS and JUAFS builds.  Their object files are compiled
using the same compilation rule, and the list of object files differed
only by rx_kmutex.o (which is devoid of content) and xdr_int32.o
(which is preumably an oversight).

Save the extra build time by just reinstalling libuafs.a as libjuafs.a
to preserve the existing interfaces.

Additionally, drop the LIBJUAFS make variable -- all definitions set
it to libjuafs.a.  Similarly, the LIBJUAFS_FLAGS variable was unused
and can be removed.

Change-Id: I2074d5bc26e326db36b16e055431818ef1c69210
Reviewed-on: http://gerrit.openafs.org/11471
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoDeorbit the netscape plugin
Benjamin Kaduk [Sat, 20 Sep 2014 01:45:31 +0000]
Deorbit the netscape plugin

Netscape hasn't been a thing since 2008.

We would only try to build it if someone manually ran 'webinstall'
in src/libuafs, and there is no documentation telling anyone to do so.

It's dead, Jim.

Change-Id: I7486ca33da7ff19f23f0d9f54f5fb4e7e3232540
Reviewed-on: http://gerrit.openafs.org/11470
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoMake pam conditional on INSTALL_KAUTH
Benjamin Kaduk [Mon, 15 Sep 2014 01:16:56 +0000]
Make pam conditional on INSTALL_KAUTH

The pam module we provide is only useful in kaserver-like environments,
and as such should not be installed when the user has requested to
not have kauth.

Change-Id: I9b336593e34cedfd6e8c2210f3798575d115d2d6
Reviewed-on: http://gerrit.openafs.org/11466
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoBuild a usable pam_afs.so
Benjamin Kaduk [Fri, 12 Sep 2014 22:07:51 +0000]
Build a usable pam_afs.so

Our use of libtool for building the pam modules resulted in shared
objects which had dependencies on liboafs_auth.so and liboafs_kauth.so,
neither of which are installed.

We still need some way to resolve those dependencies at link time, and
a dependency on libafsauthent.so seems ill-advised to insert into the
pam stack, so we are left with only the option of directly linking in
the requisite functionality.  Fortunately, almost all of the requisite
convenience libraries of PIC objects already exist to meet the
requirements of libafsrpc and libafsauthent; the only exception is
from the auth module.  Here, we require a new convenience library,
because the pam_afs.krb.so module includes its own version of ktc.o,
compiled with AFS_KERBEROS_ENV defined, yet the pam_afs.so module
requiers a ktc.o compiled without AFS_KERBEROS_ENV defined.  The
convenience library from the auth module can only include one version,
and would therefore be wrong for the other.  As such, create the new
libpam_auth.la archive from the BASE_objs in src/auth, and manually
compile ktc.lo and ktc_krb.lo as needed for the pam modules.

As for libafsrpc and libafsauthent, the convenience libraries included
from other parts of the tree belong in LT_objs, not LT_deps, because
they are contributing actual content to be included in the resulting
library; they are not library dependencies of the output of this module.

Change-Id: I5292718a5494710d166043fd08ad07269ff9fdf2
Reviewed-on: http://gerrit.openafs.org/11463
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoBuild and install libafsauthent.so.2
Benjamin Kaduk [Mon, 8 Sep 2014 22:06:25 +0000]
Build and install libafsauthent.so.2

During the libtool interim, we had been building a .0 but not
installing it.  Prior to the libtoolization of shlibafsauthent, we
had installed a libafsauthent.so.1.1, which is the same version currently
installed by the 1.6 branch.  Since there have been backwards-incompatible
ABI changes (e.g., afsconf_BuildServerSecurityObjects) since the .1.1
version, we must bump the SONAME to .2.0.

At time of this writing, the libtool rules for updating the
version information is found at:
http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
and
http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html

This lets us consolidate the building of the shared and static libafsrpc
and their installation), as libtool will happily do both for us
at once.

We explicitly do not install the .la files, as our libtool use is
to be kept entirely internal.

Change-Id: I283f9bb74eb9853c268e8642ac1f01741deeae2b
Reviewed-on: http://gerrit.openafs.org/11462
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoBuild and install libafsrpc.so.2
Benjamin Kaduk [Mon, 8 Sep 2014 22:06:25 +0000]
Build and install libafsrpc.so.2

During the libtool interim, we had been building a .0 but not
installing it.  Prior to the libtoolization of shlibafsrpc, we
had installed a libafsrpc.so.1.4 (though the 1.6 branch was
installing libafsrpc.so.1.5, "so we don't collide with the shlibafsrpc
versions on the master branch", which seems misguided).  Since there
have been backwards-incompatible ABI changes (e.g., rx_SetMaxMTU) since
the .1.4 version, we must bump the SONAME to .2.0.

At time of this writing, the libtool rules for updating the
version information is found at:
http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
and
http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html

This lets us consolidate the building of the shared and static libafsrpc
and their installation), as libtool will happily do both for us
at once.

We explicitly do not install the .la files, as our libtool use is
to be kept entirely internal.

Change-Id: I11bc3cbc80048d0192aadeb80b89d2772bcd01cd
Reviewed-on: http://gerrit.openafs.org/11461
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>

9 years agoNormalize LT_deps/LT_objs split
Benjamin Kaduk [Fri, 12 Sep 2014 21:21:42 +0000]
Normalize LT_deps/LT_objs split

As described in the commit message of
69f26ece3c4545ecc9099641f7a507796fe9dc77, LT_objs should contain
the .lo files for the given module, and LT_deps should contain the
libtool dependencies, i.e., the .la files from other parts of the
tree.  However, this simple split by file suffix is not correct
when we are using convenience libraries.  Really, LT_objs represents
the "new" objects being provided by the module, and LT_deps is
libraries from other modules that provide functionality on which
we depend.  Since convenience libraries are just thin aggregates
of object files, they behave more like object files than libraries
upon which we depend.  In particular, libafsrpc and libafsauthent
are wrapper libraries that gather together the functionality of
several modules and export them as a single library interface;
they do not have any objects of their own.

However, libafsauthent has a dependency on libafsrpc, which does
belong in LT_deps (or possibly in LT_libs).

Simon's description of LT_libs leaves a little ambiguity, as it
does not describe what should be done with non-libtool libraries
from within OpenAFS.  (At present, these include libafshcrypto
and librokenafs, both of which are regularly put in LT_libs.)
I prefer to recast LT_libs as containing externally visible libraries,
not just external libraries, which rationalizes the inclusion of
roken and hcrypto there, since we currently install those libraries,
and build libraries that have shared library dependencies on them.

In the future, as we begin committing to stable shared library
interfaces for libraries produced by libtool, I would like to
have those .la files be moved to LT_libs, since they would then
be external library dependencies of the given module.

Change-Id: Ie50010da84df99cec048c3e39ffeb9d5897fc08c
Reviewed-on: http://gerrit.openafs.org/11460
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>