Commit Graph

13565 Commits

Author SHA1 Message Date
Andrew Deason
15d033d0df tests: Introduce is_command()
Add a new function (is_command), to help implementing tests that
involve running a command. This works like is_string(), except the
string value we compare against is the output of the provided command,
and we also check the exit code of the command.

Convert the existing execl() call in volser/vos-t to use this new
function.

Change-Id: I4a75b1a0333e608da6a6cd69838350116a2503a9
Reviewed-on: https://gerrit.openafs.org/14040
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-08-13 15:08:03 -04:00
Andrew Deason
40d6644264 tests: Introduce afstest_*_path()
Currently, several of our tests contain logic to locate files (via
srcdir or objdir), based on the C_TAP_SOURCE/BUILD environment
variables. This logic is duplicated in several places, so consolidate
the code into a couple of new functions: afstest_src_path and
afstest_obj_path. Update all callers to use these new functions.

Change-Id: I67a5e5d7f8fd7a1edb55a45e52d877ac41f9a2ea
Reviewed-on: https://gerrit.openafs.org/14319
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2021-08-12 10:34:03 -04:00
Andrew Deason
d16a0f8d16 tests: Introduce afstest_asprintf
Add a thin wrapper around asprintf, called afstest_asprintf (and
afstest_vasprintf), which does its own error checking. This just helps
makes tests a little less cluttered when needing to construct strings.

Adapt all asprintf callers in 'tests' to use the wrapper.

Change-Id: I6c4ae5b72af827e2c4c66ecfc57f152855b1d401
Reviewed-on: https://gerrit.openafs.org/14620
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2021-08-07 20:41:08 -04:00
Andrew Deason
405001be72 tests: Introduce libafstest_common
Currently, a few tests use the code in tests/common/ by linking
individual object files in there in addition to the test code (e.g.
linking ../common/config.o along with superuser-t.o).

This convention makes it very obnoxious to move code around in
tests/common/, since any users need to update their link lines. It
also makes it difficult for code in tests/common/ to make use of
functions in other tests/common/ files.

To fix this, just build all of the objects in tests/common/ into a
convenience library, called libafstest_common, and link the relevant
tests against that. Link a few requisite libraries (roken, rfc3961) in
libafstest_common, so each individual test doesn't need to link
against them.

Also link the TAP library itself in libafstest_common, so tests don't
have to explicitly link against it separately. To do this, convert it
into a libtool library, libafstest_tap.la.

Change-Id: I9c031c164efee20201336edcbfaff429e1d231b7
Reviewed-on: https://gerrit.openafs.org/14318
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-08-07 20:38:05 -04:00
Mark Vitale
3ccf8eaeb0 viced: Fix minor log message mistakes
Fix a few minor mistakes/typos that have crept up in viced over time:

- In PrintCallBackStats, struct FEs and struct CBs are 64 bytes, not
  16 bytes. Show the actual size of the structs.

- A log message in cb_stateDiskEntryToFE is missing the trailing
  newline.

- In cb_stateVerifyHCBList, a log message mentions the non-existent
  cb_stateVerifyFCBList (instead of cb_stateVerifyHCBList)

Change-Id: I1146acae84d11980b6005cede9bb8bb53c54c70f
Reviewed-on: https://gerrit.openafs.org/14724
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-08-05 22:29:41 -04:00
Jeffrey Altman
7739d1e967 rx: compare RX_ACK_TYPE_ACK as a bit-field
The rx_ackPacket.acks array (the SACK table) consists of up to 255
octets.  Each octet stores either the value zero (RX_ACK_TYPE_NACK)
or one (RX_ACK_TYPE_ACK).  Effectively only bit-zero of each octet
is used.

The rx_ackPacket.acks array cannot be enlarged but one possible
method of encoding the ACK/NACK state for packets when the
window size is greater than 255 is to use bits 1-7 of each
octet.

This change alters the test for ACK vs NACK to be a bit comparison
instead of a equality comparison.  This change permits RX to be
compatible with any future use of bits 1-7.

No peer that treats the SACK table as bytes can ever send more
than 255 packets regardless of the advertised receive window.
Therefore, existing peers will never receive a SACK table with
more than 255 packets worth of bits.

Change-Id: I4dfcdc9ea18e060eeb257832297f557b7109e93a
Reviewed-on: https://gerrit.openafs.org/14465
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-08-05 11:33:47 -04:00
Yadavendra Yadav
9e043e1a0c LINUX: defer afs_remunlink when current->fs==NULL
afs_remunlink is called to delete a file on the fileserver after it
has been silly-renamed (due to being unlinked while the file is open).
Sometimes current->fs is NULL when this happens, typically when the
process is shutting down, after current->fs has been freed and file
handles are getting released. During afs_remunlink, we need to
interact with our cache files, and so we call dentry_open, which calls
security_file_open, which calls into the configured LSM for security
checks. Certain LSMs (e.g. Crowdstrike Falcon) will panic the kernel
in this situation if current->fs is NULL.

There's no way to skip the LSM hooks, or to flag to the LSM that we're
making an in-kernel VFS call, so the only way to avoid these panics is
to do our I/O in another thread. Fortunately, we already have a way to
defer afs_remunlink calls to a background daemon (CUnlinkedDel), since
we already do this in some cases (when someone else is holding
afs_xvcache or afs_xdcache).

So, to avoid the panic in the above scenario, defer calls to
afs_remunlink to a background daemon using CUnlinkedDel when
current->fs is NULL, and we're using a disk cache.

More details on this issue is discussed at following thread:
https://lists.openafs.org/pipermail/openafs-info/2021-March/043073.html

Change-Id: I1ee83d088a9b661d2974ce24b36bfd9f6ea4e7e9
Reviewed-on: https://gerrit.openafs.org/14691
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jonathan Billings <jsbillings@jsbillings.org>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
2021-07-29 11:55:09 -04:00
Andrew Deason
9656a6b92b AIX: Fix undefined symbols
Various pieces of our code try to use symbols in our internal
libraries that are not exported in the respective .sym file. On AIX,
this causes the following build failures:

ld: 0711-317 ERROR: Undefined symbol: .ubik_CallRock
ld: 0711-317 ERROR: Undefined symbol: DISK_function_names
ld: 0711-317 ERROR: Undefined symbol: VOTE_function_names
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[4]: *** [Makefile:45: afscp] Error 8
make[4]: Leaving directory '/.../src/libadmin/test'

ld: 0711-317 ERROR: Undefined symbol: PR_function_names
ld: 0711-317 ERROR: Undefined symbol: KAA_function_names
ld: 0711-317 ERROR: Undefined symbol: KAT_function_names
ld: 0711-317 ERROR: Undefined symbol: KAM_function_names
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[4]: *** [Makefile:117: rxstat_get_peer] Error 8
make[4]: Leaving directory '/.../src/libadmin/samples'

ld: 0711-317 ERROR: Undefined symbol: .osi_audit_cmd_Options
ld: 0711-317 ERROR: Undefined symbol: .osi_audit_open
ld: 0711-317 ERROR: Undefined symbol: .afsconf_SuperIdentity
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:71: butc] Error 8
make[3]: Leaving directory '/.../src/tbutc'

ld: 0711-317 ERROR: Undefined symbol: .pr_Initialize2
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:111: pts] Error 8
make[3]: Leaving directory '/.../src/tptserver'

ld: 0711-317 ERROR: Undefined symbol: .AFSVolListPartitions
ld: 0711-317 ERROR: Undefined symbol: .AFSVolXListPartitions
ld: 0711-317 ERROR: Undefined symbol: .RXAFS_GetStatistics64
ld: 0711-317 ERROR: Undefined symbol: .AFSVolPartitionInfo64
ld: 0711-317 ERROR: Undefined symbol: .AFSVolPartitionInfo
ld: 0711-317 ERROR: Undefined symbol: .RXAFS_GetStatistics
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:65: fsprobe_test] Error 8
make[3]: Leaving directory '/.../src/fsprobe'

ld: 0711-317 ERROR: Undefined symbol: fsprobe_Results
ld: 0711-317 ERROR: Undefined symbol: gtxframe_exitValue
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:45: scout] Error 8
make[3]: Leaving directory '/.../src/scout'

ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_toString
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_freeString
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:50: check_sysid] Error 8
make[3]: Leaving directory '/.../src/viced'

ld: 0711-317 ERROR: Undefined symbol: .GetLogLevel
make[3]: *** [Makefile:130: fileserver] Error 8
make[3]: Leaving directory '/.../src/viced'

ld: 0711-317 ERROR: Undefined symbol: .GetLogDest
ld: 0711-317 ERROR: Undefined symbol: .GetLogFilename
ld: 0711-317 ERROR: Undefined symbol: .CloseLog
make[3]: *** [Makefile:166: salvageserver] Error 8
make[3]: Leaving directory '/.../src/tsalvaged'

ld: 0711-317 ERROR: Undefined symbol: .rxkad_StringToLevel
ld: 0711-317 ERROR: Undefined symbol: .FilepathNormalize
ld: 0711-317 ERROR: Undefined symbol: .ConstructLocalPath
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:32: upserver] Error 8
make[3]: Leaving directory '/.../src/update'

ld: 0711-317 ERROR: Undefined symbol: xstat_fs_Results
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:77: xstat_fs_test] Error 8
make[3]: Leaving directory '/.../src/xstat'

ld: 0711-317 ERROR: Undefined symbol: .afsconf_DeleteKeyBySubType
ld: 0711-317 ERROR: Undefined symbol: .afsconf_DeleteKeyByType
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:35: asetkey] Error 8
make[3]: Leaving directory '/.../src/aklog'

ld: 0711-317 ERROR: Undefined symbol: .afsconf_FindService
ld: 0711-317 ERROR: Undefined symbol: .afsconf_AddKey
ld: 0711-317 ERROR: Undefined symbol: .afsconf_GetLatestKeyByTypes
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[4]: *** [Makefile:19: authcon-t] Error 8
make[4]: Leaving directory '/.../tests/auth'

ld: 0711-317 ERROR: Undefined symbol: .afsconf_AddUser
ld: 0711-317 ERROR: Undefined symbol: .afsconf_IsSuperIdentity
ld: 0711-317 ERROR: Undefined symbol: .afsconf_AddIdentity
ld: 0711-317 ERROR: Undefined symbol: .afsconf_GetNthUser
ld: 0711-317 ERROR: Undefined symbol: .afsconf_GetNthIdentity
ld: 0711-317 ERROR: Undefined symbol: .afsconf_DeleteUser
ld: 0711-317 ERROR: Undefined symbol: .afsconf_DeleteIdentity
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[4]: *** [Makefile:25: superuser-t] Error 8
make[4]: Leaving directory '/.../tests/auth'

ld: 0711-317 ERROR: Undefined symbol: .afsconf_GetKeys
ld: 0711-317 ERROR: Undefined symbol: .rx_opaque_new
ld: 0711-317 ERROR: Undefined symbol: .rx_opaque_free
ld: 0711-317 ERROR: Undefined symbol: .afsconf_GetKeyByTypes
ld: 0711-317 ERROR: Undefined symbol: .afsconf_GetKeysByType
ld: 0711-317 ERROR: Undefined symbol: .afsconf_PutTypedKeyList
ld: 0711-317 ERROR: Undefined symbol: .afsconf_GetLatestKeysByType
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[4]: *** [Makefile:31: keys-t] Error 8
make[4]: Leaving directory '/.../tests/auth'

ld: 0711-317 ERROR: Undefined symbol: ._afsconf_Touch
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[1]: *** [Makefile:34: realms-t] Error 8
make[1]: Leaving directory '/.../tests/auth'

ld: 0711-317 ERROR: Undefined symbol: .opr_cache_get
ld: 0711-317 ERROR: Undefined symbol: .opr_cache_put
ld: 0711-317 ERROR: Undefined symbol: .opr_cache_init
ld: 0711-317 ERROR: Undefined symbol: .opr_cache_free
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[1]: *** [Makefile:16: cache-t] Error 8
make[1]: Leaving directory '/.../tests/opr'

ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_isNil
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_equal
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_hash
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_fromString
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_create
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_unpack
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_pack
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[1]: *** [Makefile:37: uuid-t] Error 8
make[1]: Leaving directory '/.../tests/opr'

ld: 0711-317 ERROR: Undefined symbol: .rxevent_Init
ld: 0711-317 ERROR: Undefined symbol: .rxevent_Post
ld: 0711-317 ERROR: Undefined symbol: .rxevent_Cancel
ld: 0711-317 ERROR: Undefined symbol: .rxevent_RaiseEvents
ld: 0711-317 ERROR: Undefined symbol: .rxevent_Put
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[1]: *** [Makefile:18: event-t] Error 8
make[1]: Leaving directory '/.../tests/rx'

To fix these, export the relevant symbols from the library's .sym
file.

Change-Id: I969e7c99610d5c29c81f6d73c52dd5499a1152fd
Reviewed-on: https://gerrit.openafs.org/14707
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-07-22 01:19:48 -04:00
Andrew Deason
2c2a9512e5 rxgen: rename list -> rxgen_list
Our 'struct list' collides with a 'struct list' defined in
/usr/include/grp.h on AIX (at least on AIX 7.2). This is a very
generic structure name, so rename it to rxgen_list to avoid issues
like this.

Change-Id: Ic6d3a1fcde5e7f8a1ae57b974f711fb844f29f3f
Reviewed-on: https://gerrit.openafs.org/14702
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-07-21 22:41:31 -04:00
Andrew Deason
939787565d vol: Introduce and use FDH_BLOCKSIZE
A couple of places in src/volser currently have some logic to get the
size and blocksize of a file. The existing logic is nontrivial due to
platform-specific quirks, and ignores afs_fstat errors.

To fix these issue and consolidate the code into one place, introduce
a new function, FDH_BLOCKSIZE, which gets the file size and blksize.
Update the places in src/volser to use the new function.

Change-Id: I4daeec84c8fdb5756a8d6a7f477d0045a19a8fe9
Reviewed-on: https://gerrit.openafs.org/14662
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2021-07-21 22:40:21 -04:00
Andrew Deason
a912db315b tsm41: Fix libs for AIX 7.2
AIX 7.2 doesn't seem to have libcsys, netinet.exp, sockets.exp, or
statcmd.exp available. To allow for our IMPORTS and LDFLAGS to change
depending on the AIX version, introduce the autoconf vars TSM_IMPORTS
and TSM_LIBS, which do not contain the missing libs on AIX 7.2, so we
can build on AIX 7.2.

Change-Id: I95feb22f8e2b35948d2024d5c29b917d064f30f3
Reviewed-on: https://gerrit.openafs.org/14703
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2021-07-21 20:44:33 -04:00
Andrew Deason
7acd66ae39 AIX: Add buildsystem support for AIX 7.2
Change-Id: Iae2523c333e5180c029ca205cf3f0b83a6839dd5
Reviewed-on: https://gerrit.openafs.org/14701
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2021-07-21 13:53:41 -04:00
Andrew Deason
60c44d0d02 tests: Avoid WTERMSIG($?) in rx/perf-t
Currently, tests/rx/perf-t calls functions like WIFSIGNALED and
WTERMSIG on $?. However, functions like WTERMSIG expect the native
exit status code (that is, ${^CHILD_ERROR_NATIVE}). The $? var (aka
$CHILD_ERROR), is a synthetic value calculated by perl that stores the
term sig in the lowest 7 bits, and the exit code in the second-lowest
8 bits.

For most modern platforms, these two values tend to be the same. But
on modern AIX (and some other weird platforms, like VMS and BeOS), the
exit status integer is encoded differently. On AIX specifically, the
term sig is in the third-lowest 8 bits, so a process exiting on signal
15 would result in an exit status (${^CHILD_ERROR_NATIVE}) of 0xf000f,
but $? would be just 0xf. Calling WTERMSIG on 0xf000f returns 0xf, but
calling WTERMSIG on 0xf returns 0x0.

All of this means that running rx/perf-t causes the final test to fail
with "Server died with signal 0" (even when the process was killed by
signal 15), which is rather confusing.

To fix this, call WTERMSIG et al with ${^CHILD_ERROR_NATIVE} instead
of $?. Create a local var so we don't need to spell out
${^CHILD_ERROR_NATIVE} so many times.

Change-Id: I3c27642fcaf17c320a94caf57d3665d4b6a4a76e
Reviewed-on: https://gerrit.openafs.org/14706
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-07-19 21:39:57 -04:00
Andrew Deason
c2db412583 opr: Avoid sigwait on SIGWAITING
On AIX, calling sigwait() on a sigset containing SIGWAITING (or
SIGKILL or SIGSTOP), causes sigwait to return with an EINVAL error.
Currently, signalHandler() calls sigwait() with SIGWAITING, because
SIGWAITING is in the sigset returned by softsigSignalSet(). And so,
sigwait() returns EINVAL, and our opr_Verify in signalHandler() fails,
causing a crash.

To avoid this, remove SIGWAITING from the sigset in
softsigSignalSet(). This is AIX-specific, since the SIGWAITING signal
is AIX-specific.

Change-Id: I42539d859212605e6b1aaeb6a5eecb0ad034cea5
Reviewed-on: https://gerrit.openafs.org/14705
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-07-19 21:37:32 -04:00
Andrew Deason
ee8be26e58 tests: Add missing va_end in cmd/command-t
Every va_start call is supposed to be paired with a matching va_end
call, but 'checkList' is missing any call to va_end. This doesn't
currently seem to cause any visible problems, but add the matching
va_end to avoid potential future issues.

Change-Id: I569618823f39f4da5b1787cc49c5509d8ea37528
Reviewed-on: https://gerrit.openafs.org/14704
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-07-19 21:29:33 -04:00
Cheyenne Wills
91a576142e Cleanup usage of LINUX_VERSION_CODE for older kernels
2.6.18 is the minimum supported linux kernel level. There are
preprocessor checks for specific kernel versions that predate 2.6.18.

Refactor the use of the LINUX_VERSION_CODE that checks for kernel
versions older than 2.6.18.

In addition, there are a couple of locations where the kernel version
is checked with an additional test to see if module_param or
module_param_array are defined.  These checks are used to determine
whether to use the macros module_param/module_param_array or to use
the macro MODULE_PARM. The macros module_param and module_param_array
were present in Linux prior to 2.6.12.  The macro MODULE_PARM was marked
as deprecated prior to 2.6.12 and removed in Linux 2.6.17 (8d3b33f67fd
'[PATCH] Remove MODULE_PARM').

Remove the preprocessor checks for module_param/module_param_array and
remove the use of MODULE_PARM.

The updates should have no functional changes.

Change-Id: I1dc5dca1252abfc865917757989df235c75059a6
Reviewed-on: https://gerrit.openafs.org/14389
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-07-18 20:33:24 -04:00
Cheyenne Wills
cbc18e4b31 Cleanup AFS_*LINUX_ENV usage
Commit 6329a523f6 changed all
occurrences of AFS_*LINUXnn_ENV to AFS_*LINUX_ENV, but did not perform
any refactoring of the use of these variables.

This commit completes the task by refactoring the preprocessor
conditionals that involved removing dead code or collapsing statements.

The updates should have no functional changes.

Change-Id: I10fbefb7c862de2ec35ab77cafa2391e6e59f388
Reviewed-on: https://gerrit.openafs.org/14388
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2021-07-17 23:18:36 -04:00
Cheyenne Wills
6329a523f6 Change AFS*_LINUXnn_ENV to AFS*_LINUX_ENV
The minimum Linux kernel that is now supported is linux-2.6.18.  The
Linux versioned preprocessor macros AFS_*LINUXnn_ENV are no longer
needed to distinguish the different levels of Linux and can be merged
into just a single set of macros.

Perform a global change of _LINUX\d+_ENV to _LINUX_ENV. e.g.
   AFS_LINUX24_ENV       -> AFS_LINUX_ENV
   AFS_USR_LINUX24_ENV   -> AFS_USR_LINUX_ENV
   AFS_AMD64_LINUX20_ENV -> AFS_AMD64_LINUX_ENV

Replace the multiple definitions for the versioned 'AFS*_LINUXnn_ENV'
with just single non-version definitions 'AFS*_LINUX_ENV'.

Apart from replacing the now-redundant #define directives and tidying up
a few comments at the close of a preprocessor block to match their
current form, this commit was done using a mechanical change of the
variable names and did not reduce preprocessor statements that could now
be combined or eliminated.  Nor does this commit remove dead code.  A
follow-up commit (Cleanup AFS_*LINUX_ENV usage) will handle these
changes.

The updates should have no functional changes.

Change-Id: I71e32ca9818d28f82b4f23679868d1b9a62c44bd
Reviewed-on: https://gerrit.openafs.org/14387
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-07-17 22:26:30 -04:00
Andrew Deason
4a150387e3 fs: Avoid unnecessary cell DNS lookups
Currently, many routines in 'fs' cause afsconf_GetCellInfo to be
called for the given cell, which causes an AFSDB/SRV lookup for the
given cell if the cell has no dbservers specified in the local
CellServDB. Sites often define such CellServDB records to indicate
that the given cell exists, but the dbserver IPs should only be looked
up via DNS.

However, 'fs' is only calling afsconf_GetCellInfo in order to
canonicalize the cell name (we're allowed to give an abbreviated name
for a cell on the command line if the abbreviation is unambiguous, but
we want to give the full name to the kernel). We don't care about the
other cell info at all, so triggering a DNS lookup is completely
unnecessary.

If our DNS server is not responding, e.g. because we've lost network
access entirely, this causes the relevant 'fs' commands to fail,
possibly after a long delay. Some fs commands such as 'fs setcell' are
often run during client startup, and can still otherwise run fine
without network access, and so such failures are unnecessary.

To fix this, we introduce a new function, called afsconf_GetCellName,
which only returns the full name for a cell, and does not require a
DNS lookup for such "empty" cells in the local CellServDB. For all
code paths in 'fs' that just need the cell name (which is all of them
besides 'fs mkmount'), use this new function.

Change-Id: I45eb1bdc6ba3e3b4653be2306dcbf79c1015724c
Reviewed-on: https://gerrit.openafs.org/13540
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-07-15 12:29:15 -04:00
Michael Meffie
a5c146116f libadmin: Be sure to free the server list in ListCellsRPC
Commit 0d6b9defb3 added a check to avoid
overrunning a buffer when the cell name returned by RXAFSCB_GetCellServDB
is too large for the libadmin buffer, but in that case missed freeing
the server list returned in the same rpc.

Move the xdr_free() of the server list under the cleanup label so the
server list returned by the RPC will always be freed.

Thanks to Mark Vitale for finding this bug.

Change-Id: I4c7228f8c8d48e267f6fbb01cb89fdf5232de97e
Reviewed-on: https://gerrit.openafs.org/14690
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-07-03 11:34:58 -04:00
Mark Vitale
adf08b464e DARWIN: correct size of fstrace ICL_TYPE_LONG and ICL_TYPE_POINTER
Commit 248da50aa5 'icl 64 bit platform
rationalization' introduced support for 64-bit ICL_TYPE_POINTER and
ICL_TYPE_LONG for fstrace running on DARWIN kernels.  However, it
neglected to make the matching change in the fstrace utility itself,
which reads and reports these trace entries.  The result is that all
fstrace records which contain 64-bit pointers or longs are misreported
as 32-bit values.  Furthermore, any subsequent values in the same
fstrace record are also misreported because the offsets are now
incorrect.

Move the definition of ICL_LONG from afs_icl.c to icl.h so fstrace.c may
share the ICL_LONG logic and value.

Modify fstrace to use logic similar to the recording logic in afs_icl.c
so that the correct size and offsets are maintained while decoding the
contents of each fstrace record.

We can use the build-time value of ICL_LONG (rather than the runtime
value of afs_sizeofLong) because the difference only matters for SGI62
32-bit kernels.  It is unknown whether the existing code works correctly
for SGI62 32-bit mode, but this commit should not affect that support
either way.

Change-Id: I240f76fed4618822b774451c5184b1160f17221d
Reviewed-on: https://gerrit.openafs.org/14558
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2021-07-01 16:03:13 -04:00
Andrew Deason
503db6ee83 opr: Allow softsig handlers for SIGFPE
SIGFPE is normally a synchronous signal, which would not be handled by
opr softsig. However, bosserver uses SIGFPE as an asynchronous signal
to modify the local restricted mode. So allow SIGFPE in softsig
handlers, so bosserver can use softsig.

Change-Id: I413edbed967babb3e60c6fa97f89b40b8d7b3ad7
Reviewed-on: https://gerrit.openafs.org/14080
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2021-07-01 12:56:08 -04:00
Andrew Deason
e358807347 opr: Assert opr_cv_timedwait return codes
Almost all of our opr locking primitives assert that they did not
receive an error from pthreads. opr_cv_timedwait is the exception to
this, since it needs to return two possible codes that aren't
internal failures: 0 and ETIMEDOUT. As a result, most callers assert
that our returned code is one of these two values.

To make opr_cv_timedwait act more like our other locking primitives,
removing the need to add opr_Assert()s everywhere, change
opr_cv_timedwait to check that the returned code is 0 or ETIMEDOUT,
and remove the relevant asserts from its callers.

Change-Id: Ie9a62f2edb23969d66e4ed821af37077bc6400c4
Reviewed-on: https://gerrit.openafs.org/14079
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2021-07-01 12:54:36 -04:00
Andrew Deason
cde2449a94 vol: Use FDH_SIZE more consistently
Several callers use OS_SIZE(fdP->fd_fd) instead of just calling
FDH_SIZE(fdP). Right now these calls are equivalent, but change all of
these callers to use FDH_SIZE, to make it easier to possibly change
the behavior of FDH_SIZE in the future.

Change-Id: If846c160c71f11935de8c0e4634afa2c7f7ee53f
Reviewed-on: https://gerrit.openafs.org/14657
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-07-01 12:39:35 -04:00
Andrew Deason
108ed067e0 vol: Blank fake linkHandles
A couple of places in namei_ops.c use "fake" linkHandle FdHandle_t's.
Make sure these are initialized, so we don't accidentally use
uninitialized fields in the FdHandle_t.

Currently, the code never uses any fields that are not explicitly set
in this same code path, but this seems rather fragile, and future
commits may change the fields in an FdHandle_t.

Change-Id: I9372f03a4d3b68afd3ab24a27ae669cba92e0abe
Reviewed-on: https://gerrit.openafs.org/14656
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-07-01 12:37:16 -04:00
Mark Vitale
afcb051f16 fstrace: add dump -debug option
As a debugging aid, add a -debug option to the dump subcommand to
display each trace record in raw hex format as well as the normal
decoded format.

Change-Id: I80dd675a07e048e25749a9afb584515effcbc08a
Reviewed-on: https://gerrit.openafs.org/14557
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-07-01 11:27:48 -04:00
Andrew Deason
966d5eb58f afs: Free pioctlToken in extractPioctlToken
Ever since it was introduced in commit 5ec5ad5 (New GetToken pioctl),
extractPioctlToken has incorrectly freed pioctlToken by passing
'&pioctlToken' to xdr_free (instead of 'pioctlToken').

This causes xdr_ktc_tokenUnion to interpret &pioctlToken (which is a
struct ktc_tokenUnion **) as a struct ktc_tokenUnion *. This doesn't
cause any corruption or panics, since ktc_tokenUnion doesn't contain
any freeable fields unless its at_type is 2 (AFSTOKEN_UNION_KAD). So
as long as the bogus 'at_type' from the misinterpreted pointer is not 2,
the xdr_free call will just not free anything (and return an error,
which we ignore).

If the bogus at_type is 2, this would probably cause some memory
corruption or other nastiness. For this to happen on 32-bit systems,
the value of the 'pioctlToken' pointer itself would need to be 0x2.
On 64-bit systems, the top or bottom 32-bits of the pointer would need
to be 0x2 (depending on endianness). Those situations seem impossible
or very unlikely on most systems, and have never been seen in the
wild.

FIXES 135238

Change-Id: Id14571d090570cfacfa920048f41c3b1e434f31c
Reviewed-on: https://gerrit.openafs.org/14651
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
2021-06-29 17:31:07 -04:00
Mark Vitale
6240ae64e6 cmd: version command should not call before or after procs
Since the original IBM code import, the cmd_Dispatch processor has
avoided calling beforeProc and afterProc for the built-in 'help' and
'apropos' commands.  This is important, because these procs may rely on
application-defined common arguments (e.g., -cell <cell> or -noauth) for
proper operation.  However, application common arguments are not defined
for built-in commands 'help' and 'apropos'.

Unfortunately, when a new built-in 'version' command was added
(350c140d89 libcmd-support-version-switch-20060630), it was not
exempted from the before and after procs.

In order to avoid a segmentation fault in 'libadmin/test/afscp
version', modify cmd to also avoid calling beforeProc and afterProc for
the 'version' command.

Change-Id: Ic899397de808fd6c4a5f66a0f5add102340064e6
Reviewed-on: https://gerrit.openafs.org/14645
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2021-06-26 00:15:22 -04:00
Michael Meffie
9ae5b599c7 bos: Let xdr allocate rpc output strings
The bos client provides fixed sized buffers on the stack for RPC output
strings instead of letting xdr allocate output strings.  Unfortunately,
the fixed sized buffers do not account for the terminating nul char when
the output string is the maximum size defined for the bozo RPCs.

To avoid potential buffer overflows, and to allow for larger xdr string
sizes in the future, convert these to xdr allocated strings. Be sure to
always free the xdr allocated strings.

The following bozo RPCs have xdr output strings, and are addressed in
this commit:

BOZO_EnumerateInstance
BOZO_GetCellHost
BOZO_GetCellName
BOZO_GetInstanceInfo
BOZO_GetInstanceParm
BOZO_GetInstanceStrings
BOZO_GetStatus
BOZO_ListSUsers

Thanks to Cheyenne Wills for pointing out this issue.

Change-Id: I7fb48ff6766420a2d84723e1663ff24e86313ccf
Reviewed-on: https://gerrit.openafs.org/14650
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-25 23:54:32 -04:00
Andrew Deason
69973755bd ihandle: Remove FDH_READV/WRITEV references
FDH_READV and FDH_WRITEV have been unused since commit
335ccb40 (ihandle positional read and write). Remove a couple of
lingering references to them.

Change-Id: I640d411782440958a823ef0e2aa810bddd8ceee2
Reviewed-on: https://gerrit.openafs.org/14655
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2021-06-25 21:55:27 -04:00
Andrew Deason
b9d8b69590 namei: Calculate offset before use in GetFreeTag
We pass 'offset' to FDH_LOCKFILE here, but 'offset' is calculated a
few lines below. The compiler doesn't catch this, since FDH_LOCKFILE
is a macro that ignores the second argument (except on WINNT).

Just move the calculation a few lines above, to ensure 'offset' is set
before it's actually used, to avoid issues if and when FDH_LOCKFILE is
changed to use the second argument.

Change-Id: If858005cb83370ca905f93f9d3d7eed2941ddf99
Reviewed-on: https://gerrit.openafs.org/14654
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2021-06-25 21:55:14 -04:00
Mark Vitale
78008c38b4 viced: remove dead code from h_Alloc_r
These two lines have been ifdef'd out since commit 8f2df21ffe
pull-prototypes-to-head-20020821.  Remove them.

No functional change is incurred by this commit.

Change-Id: I5d1d97d285ad50777bc5a26a53d6e0357140941d
Reviewed-on: https://gerrit.openafs.org/14335
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-24 22:05:32 -04:00
Michael Meffie
0d6b9defb3 libadmin: Let xdr allocate rpc output strings
In most functions, the libadmin library provides fixed sized buffers for
RPC output strings instead of letting xdr allocate the output string.
Unfortunately the fixed sized buffers do not account for the terminating
nul char when the output string is the maximum length possible for the
xdr output strings.

To avoid potential buffer overflows, and to allow for larger xdr string
sizes in the future, convert these to xdr allocated strings and use safe
string functions to copy the results to the application buffers. Fail
with an error if the application buffer is too small, instead of
overflowing the buffer or truncating results.

Thanks to Cheyenne Wills for pointing out this issue.

Change-Id: I963e1b790417863c036e897811c86a634d1d4e7f
Reviewed-on: https://gerrit.openafs.org/14626
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2021-06-24 22:02:43 -04:00
Mark Vitale
a49788237a util: remove dead code KTimeCmp
This routine has been dead code since the original IBM code import.  It
was ifdef'd out in commit 45376df63f util-warning-cleanup-20011005.

Remove the dead code from the tree.

No functional change is incurred by this commit.

Change-Id: I33689db8e016e1dd5abb88910af8da6208a75ce6
Reviewed-on: https://gerrit.openafs.org/14334
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2021-06-24 19:48:04 -04:00
Mark Vitale
5fcd55f543 rxgen: remove dead code deverbatim
This routine has been dead code since the original IBM import.  It was
ifdef'd out in commit 8f2df21ffe pull-prototypes-to-head-20020821.

Remove it from the tree.

No functional change is incurred by this commit.

Change-Id: Ie81bd8ed1764026e872dcf07e0b12e3c8a31c64d
Reviewed-on: https://gerrit.openafs.org/14333
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-24 00:51:58 -04:00
Mark Vitale
775afb16fc rx: remove dead code xdrrx_getpos, xdrrx_setpos
These routines have been dead code since the original IBM code import.
They were ifdef'd out in commit 1d93f2da22
'rx-warnings-and-prototyping-20010623'

Remove them from the tree.

No functional change is incurred by this commit.

Change-Id: I958c07487e2453690535acd01b92c59fcecd1189
Reviewed-on: https://gerrit.openafs.org/14332
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-24 00:47:30 -04:00
Benjamin Kaduk
83c763ab01 libafsauthent: export pr_IsAMemberOf
Reported by Alexander Chernyakhovsky <achernya@mit.edu>

Change-Id: I0e0282d89a62ab577ceba3d10aa2ee2819c3f882
Reviewed-on: https://gerrit.openafs.org/14377
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-24 00:45:22 -04:00
Marcio Barbosa
a10f99dbe0 klog.krb5: remove "save and reuse password" logic
In order to avoid repeated requests for the user's password, klog.krb5
caches and reuses it whenever necessary. However, with the introduction
of commit 3a9a5783cd, klog.krb5 always
requests a TGT regardless of the state of writeTicketFile, eliminating
the need for possible extra requests for the user's password.

Moreover, krb5_get_init_creds_password() does not accept a custom
prompter on macOS (returns EINVAL). Consequently, if the -password
argument is omitted, klog.krb5 fails with the following error:

klog: Invalid argument Unable to authenticate in realm <REALM>

Given that the user won't be prompted for a password multiple times,
remove the "save and reuse password" logic and use krb5_prompter_posix()
as the prompter function (instead of klog_prompter).

Relevant issue identified by gangovind@in.ibm.com.

Change-Id: Ia994a18d1d166893f12ee78d3e6f25192ff327ee
Reviewed-on: https://gerrit.openafs.org/14643
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ganesh G. Chaudhari <gangovind@in.ibm.com>
Tested-by: Ganesh G. Chaudhari <gangovind@in.ibm.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-22 23:52:32 -04:00
Andrew Deason
5a96197b4e tests: Avoid verbose output for 'make check V=0'
For "pretty" V=0 builds, change 'make check' to run 'runtests' in
non-verbose mode, so we just get a summary of test results, instead of
the raw test output. Without V=0, the default is unchanged, so we
still print out all test output by default.

Change-Id: I554f9d32ed5a9cd27e83fef6245af589d91e801f
Reviewed-on: https://gerrit.openafs.org/14619
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-11 15:16:31 -04:00
Andrew Deason
004c797daa tests: Introduce 'make check TESTS=test/name'
Currently 'make check' always runs all tests. We can run individual
tests manually, but doing so is a bit cumbersome to do under the same
environment as 'make check', since doing so means running something
like this:

    $ MAKECHECK=1 $(abs_top_srcdir)/tests/libwrap @TOP_OBJDIR@/lib \
        ./runtests opr/fmt util/ktime

To make it easier to run single tests introduce a way of calling 'make
check' like this:

    $ make check TESTS='opr/fmt util/ktime'

Which will run the same commands as 'make check', but will run
runtests with only the specified tests, instead of running the default
list.

Some makefiles currently use a "TESTS" or "tests" variable to list
their test binaries; rename them all to "BINS" to avoid conflicting
with this new use for "TESTS" and to make our makefiles a little more
consistent.

Change-Id: I427f83be0d4571794644a97123bcd1f32427bd05
Reviewed-on: https://gerrit.openafs.org/14317
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-11 05:18:49 -04:00
Benjamin Kaduk
2f435309c7 Remove NoAuth procedures from Admin Guide
Retain the factual description of what the file/flag does, but remove
the suggestion that it is useful in favor of a disclaimer that it is
not needed, and replace the emergency-recovery procedure with a short
description using -localauth.

Change-Id: I18b0dad9740f01515717d572a0374cd2f77fc02d
Reviewed-on: https://gerrit.openafs.org/14638
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-11 03:14:58 -04:00
Benjamin Kaduk
32229ab595 Remove recommendation to use NoAuth from NoAuth.5
Do not document that there are cases when this file should exist;
there are not.

Installation no longer needs this file, and key emergencies can
be handled using asetkey or, on 1.8.x, the kerberos tooling to modify
rxkad.keytab.

Change-Id: I0c3ba15f3ffca8660be2d8b092f10053258742e6
Reviewed-on: https://gerrit.openafs.org/12142
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-11 03:12:49 -04:00
Andrew Deason
0e411a0b36 Remove rpctestlib
There is some code in tests/rpctestlib that appears to be for testing
fileserver RPCs and callback processing, added in commit 262a678d (An
RPC test dispatch library for vice). However, it has never been used,
it seems unlikely that it will be used anytime soon, and it's not
clear if it even works (it contains many hard-coded references to
interfaces and IP addresses).

Just remove the unused code, and some references to rpctestlib. It can
always be added back if needed (or more likely, reimplemented to be
more in line with our current test framework in tests/ ).

Change-Id: Ied3be7474581d8ee75ae000815bb7364d143fd31
Reviewed-on: https://gerrit.openafs.org/14617
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-10 12:59:53 -04:00
Andrew Deason
926c026db8 Remove a few unused opr/util components
A few pieces of opr and util have no callers, have never been used
since they were added, and are not expected to be used in the near
future. Remove the unused code; if we ever want to use any of this
again, it can be re-added when we actually need it.

Specifically, this removes:

- 'stoupper' in src/opr/casestrcpy.c, added in e117599f
  (fileserver-hates-pruclient-20060626)

- 'opr_ffsll' and 'opr_flsll' in src/opr/ffs.h, added in d4369917
  (opr: implement the BSD ffs() functions)

- src/util/thread_pool.c and related headers, added in 4ca57f3f
  (Provide an abstract thread pool object)

Change-Id: Id098cb86318ac9e2412937f4b63b5d99e35be568
Reviewed-on: https://gerrit.openafs.org/14547
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-10 12:49:51 -04:00
Cheyenne Wills
fd5aa52ef8 cf: Resolve implicit function definition for memset
The autoconf function OPENAFS_HAVE_STRUCT_FIELD can produce a compiler
warning for an implicit function definition for memset, however with
macOS 11 (Big Sur) the default compiler flags have been changed
(-Werror=implicit-function-declaration) so that this is now flagged as an
error. As an error this can lead to an incorrect result returned by
OPENAFS_HAVE_STRUCT_FIELD.

Add an include for <string.h> to provide the necessary definition for
memset.

Note, both gcc and clang can produce the implicit function definition
warning.

Change-Id: I05ea43e1712c0450b7d1a78d4e953bfad9be28b9
Reviewed-on: https://gerrit.openafs.org/14631
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-10 12:29:09 -04:00
Andrew Deason
b60754ed1c afs: Avoid creating unused conns
In afs_LoopServers and PCallBackAddr, we loop over our known servers
to issue an RPC, but we skip over servers on various conditions. For
most of those, we skip over the server before creating the relevant
conn (via afs_ConnBySA), but not for the
SRVADDR_ISDOWN/afs_HaveCallBacksFrom check. If we skip over the server
for that reason, we'll create an afs_conn and rx_connection, and then
release our refs without using them.

This doesn't cause any big problems, but it does create extra
connections and peers that linger around for at least a couple of
hours (until they get cleaned up by afs_GCUserData).

It's very easy to avoid these extra useless conns; just perform the
SRVADDR_ISDOWN/afs_HaveCallBacksFrom check before we call
afs_ConnBYSA. This also makes the check a bit more consistent with the
other checks we do.

Change-Id: Ie49b87e5dd755f77364502528a02c14944e8c23d
Reviewed-on: https://gerrit.openafs.org/14637
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-10 12:17:56 -04:00
Cheyenne Wills
a73d337a55 cf: Fix typo in test for enable-shared/with-swig
The commit cf: Disable swig if shared libraries are disabled (0e84b7405)
contains a typo in a test: "x$enable_shared" != "yes".  This causes
configure to exit due to incorrectly testing --enable-shared.

Update swig.m4 to correct the typo.

Change-Id: I0d769ec41e2e7896f2232965b5eaa19734033c83
Reviewed-on: https://gerrit.openafs.org/14628
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
2021-06-01 17:19:19 -04:00
Mark Vitale
ed15b0d5b3 deorbit afsinstall
This is a very old perl script (with accompanying documentation) to
install AFS.  It has not been maintained at all since the license was
updated in 2000.

Remove it from the tree.

Change-Id: I8fb4ce9d969b8bd246f7f640b8fd63921556a529
Reviewed-on: https://gerrit.openafs.org/14624
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-05-29 20:10:43 -04:00
Cheyenne Wills
0e84b740c7 cf: Disable swig if shared libraries are disabled
When building with the option --disable-shared and swig is also enabled
(either explicitly, or autodetected) a build failure occurs when trying
to link libuafs/PERLUAFS/ukernel.so

Update the configure test for swig to disable the swig autodetection
when --disable-shared was specified, as well as emitting a notice
message stating that the swig autodetection has been disabled.

If --with-swig=yes was specified along with --disable-shared, generate a
configure error stating --with-swig is incompatible with
--disable-shared.

Change-Id: I766cf13b41c1d160e98eb160e0f907d5de2472c9
Reviewed-on: https://gerrit.openafs.org/14606
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-05-27 11:24:25 -04:00
Andrew Deason
e1f4291341 rx: Remove multi_End_Ignore
Since commit "rx: Remove delays in multi_End_Ignore", multi_End_Ignore
and multi_Finalize_Ignore are unused in the tree, and should not be
used by callers. Remove the dead functions.

This commit bumps LT_current in libafsrpc to 3, because we are
removing the exported symbol multi_Finalize_Ignore.

Change-Id: I4d298f5118a69cfd04de44c3f268691a87a6d9a7
Reviewed-on: https://gerrit.openafs.org/14425
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2021-05-27 10:08:12 -04:00