13742 Commits

Author SHA1 Message Date
Andrew Deason
c0ece254ca tests: Add unit tests for rx_atomic.h
Add tests for our rx_atomic macros to make sure they do what they say
they do (e.g. rx_atomic_inc() adds 1). Also add a simple test running
a bunch of atomic ops in multiple threads, to try to check that the
operations are actually atomic.

Change-Id: I6e776f280eaf547e9862ceed9798d0d43773fa2c
Reviewed-on: https://gerrit.openafs.org/15279
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2023-03-01 23:04:04 -05:00
Mark Vitale
d24d134d28 vol: Remove vestigial DVINC code
Since the original IBM code import, DoCloneIndex has contained
conditional code for DVINC.  But DVINC has never been defined, so this
has been dead code for a very long time.

Remove the vestigial code.

No functional change is incurred by this commit.

Change-Id: I1d5c067cbd901f0510139bf8b7750d1575bd2adc
Reviewed-on: https://gerrit.openafs.org/15332
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2023-02-26 16:00:15 -05:00
Stephan Wiesand
1b92c766f1 CellServDB update 09 May 2022
Update all three copies in the tree, and the rpm specfile.

Change-Id: Ia7ac852fb9ae13e141eec34e8c0fcbb09d7c9f04
Reviewed-on: https://gerrit.openafs.org/15305
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2023-02-02 09:16:49 -05:00
Stephan Wiesand
e2890626bc afs: check for non-NULL before memset in afs_LookupName
Commit 981bc005f8161ca9ee52ea281c7d73e0e4e2461a refactored PNewStatMount
and PFlushMount by moving their common logic to a new function
afs_LookupName(). In this function, the output parameters are zeroed.
However, this is done before checking that their pointers are valid.
Add additional checks before memset().

Change-Id: I134550d5f9b6d5a9aa5c360e260335d2efce884a
Reviewed-on: https://gerrit.openafs.org/15283
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2023-01-19 18:58:34 -05:00
Jeffrey Hutzelman
68851b782c LINUX 5.13: set .proc_lseek in proc_ops
When using the proc_ops structure, set .proc_lseek explicitly rather
than leaving it unset. This field has always been present in proc_ops,
but prior to Linux 5.13, it could be unset, causing default_llseek to be
used. Starting with commit d4455faccd6 (proc: mandate ->proc_lseek in
"struct proc_ops"), this field is now mandatory.

This fixes a problem which would cause an oops if llseek(2) is called
on /proc/fs/openafs/afs_ioctl.

Change-Id: I56a598cb06bbf1083d64e0f4145479908b470f99
Reviewed-on: https://gerrit.openafs.org/14918
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2023-01-19 12:49:32 -05:00
Andrew Deason
d051e9c62f rx: Use add_and_fetch for rx_atomic_add_and_read
Our implementation for rx_atomic_add_and_read that uses the __sync
builtins currently uses __sync_fetch_and_add. But __sync_fetch_and_add
returns the original value, where rx_atomic_add_and_read is supposed
to return the new (added) value. Fix it to use __sync_add_and_fetch,
which rx_atomic_inc_and_read already uses.

This function has been broken in this way since it was introduced, in
commit 2758aa7171 (rx: Add the add_and_read function to our atomics),
but has never been used.

Change-Id: If4f5c0addeb3e827aadb24a47cd8512590df1e6a
Reviewed-on: https://gerrit.openafs.org/15278
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2023-01-05 11:12:15 -05:00
Kailas Zadbuke
39beef42ab afs: Remove dead assignments
Clang scan-build reported variables being assigned value but not used.

In afs_NoCacheFetchProc() in file afs_bypasscache.c, delete the early
unused assignment of 'pp' and move the declaration of 'pp' closer to
where it's used. Also, 'ciov' is now unused and should be deleted.

In afs_GetDCache() in file src/afs/afs_dcache.c, value stored at line
2562 in 'code' is never read. Hence we can remove it. Also
value stored in variable 'i' is not used, so we can delete the
following line.
        i = osi_Time();

Also in afs_dcacheInit(), in file src/afs/afs_dcache.c, value stored in
variable 'ablocks' is not used, hence we can delete the following line.
        ablocks = afiles * (AFS_FIRSTCSIZE / 1024);

Thanks Indira Sawant(indira.sawant@ibm.com) for working with me on this
patch.

Change-Id: Ic6f72e3f8b0f0a69c9bf3dfa064db76423620796
Signed-off-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-on: https://gerrit.openafs.org/15222
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2023-01-05 11:00:41 -05:00
Cheyenne Wills
cfac0df9cd Linux: Replace lru_cache_add with folio_add_lru
The Linux 6.2 commit:
    "folio-compat: remove lru_cache_add()" (6e1ca48d0)
removed the lru_cache_add() function (which was introduced in Linux 5.8)

The replacement function is folio_add_lru(), which was introduced with
the Linux 5.16 commit:
    "mm/lru: Add folio_add_lru()" (0d31125d2d)

Change-Id: I4615e6bde0253618c13ec1eb067e23b2c3e3ff42
Reviewed-on: https://gerrit.openafs.org/15227
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
2022-12-22 13:27:28 -05:00
Cheyenne Wills
cc0ffc56e8 UKERNEL: avoid double include of roken.h
Commit 'afs: Replace strcpy &co by safer alternatives' (419f0cd7aa75719)
added an include for roken.h into UKERNEL/afsincludes.h.  Neither
UKERNEL/afsincludes.h or roken.h has a guard against a double include,
which can result in a build failure on older kernels (discovered on a
2.6.18 build):

 In file included from ~/openafs/src/afs/UKERNEL/afsincludes.h:30,
          from ~/openafs/src/afs/UKERNEL/afs_usrops.h:15,
          from ~/openafs/src/afs/UKERNEL/afs_usrops.c:24:
 include/roken.h:89: error: redefinition of typedef 'rk_socket_t'
 include/roken.h:89: error: previous declaration of 'rk_socket_t' was here
 In file included from ~/openafs/src/afs/UKERNEL/afsincludes.h:30,
          from ../afs/afsincludes.h:16,
          from ../afs/afs_bypasscache.h:68,
          from ~/openafs/src/afs/UKERNEL/afs_usrops.c:30:

Since roken.h is from an external source, we cannot update it to add
the necessary check.

Update UKERNEL/afsincludes.h to add a check to see if it has already
been included.

auth/ktc.c has a required include for roken.h, but it also can pull in
UKERNEL/afsincludes.h as well.  This can result in a double include for
roken.h.

Update auth/ktc.c to only include roken.h if not building UKERNEL.

Change-Id: I192443006f6c2257de57b35a6580b1df358c011c
Reviewed-on: https://gerrit.openafs.org/15130
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-12-16 10:20:27 -05:00
Benjamin Kaduk
1fbbcbee01 viced: cope with signed length/position in FetchData
For legacy reasons, the "Pos" (initial position) and "Len" (length)
inputs to the RXAFS_FetchData and RXAFS_FetchData64 RPCs are represented
as signed integers (the corresponding StoreData RPCs use unsigned values).

The use of signed values allows for the possibility of negative inputs,
and of signed integer overflow (undefined behavior in C), though the latter
is unlikely to arise naturally given that the implementation uses a
common backend with 64-bit values.

In particular, if a negative "Pos" value is supplied, we end up in
FetchData_RXStyle() that performs either FDH_PREAD() or FDH_PREADV()
with the negative value as the position from which to read, which is
an error.  The error handling for those calls treats any error as
indicative of a problem with the volume or its underlying storage,
and takes the volume offline for salvage.  Furthermore, after the
maximum number of automatic salvages the volume is left offline for
administrator action.  This presents a simple route for
(unauthenticated) denial of service, as root.cell.readonly must be
available to all users of the cell, and can be brought offline in this
way; rendering root.cell.readonly unavailable would bring essentially
all access to the cell to a halt.  (Other volumes could be targeted as
well, subject to their corresponding ACLs.)

Since there is no valid use for a negative position or length input,
reject them outright from the common_FetchData64() implementation.
Also check for whether the combination requests a read that would
overflow a signed integer and reject that as well.

Thanks to Jeffrey Altman and Chaskiel Grundman for collaborating on
this change.

FIXES 135263

Change-Id: I99c4c264c846b01fbbf4fecc60b1f34504bcc977
Reviewed-on: https://gerrit.openafs.org/15223
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@auristor.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-12-15 13:41:58 -05:00
Cheyenne Wills
e7737edb93 Linux: Check for block_dirty_folio
The build for the openafs Linux kernel module fails on RHEL9.1 with an
undefined function reference for block_dirty_folio().

RedHat 9.1 includes the Linux commit:
  fs: Add aops->dirty_folio (6f31a5a261db)
which added the dirty_folio member to the address_space_operations
structure.

However RedHat 9.1 does not include the following 2 Linux commits:
  fs: Convert __set_page_dirty_buffers to block_dirty_folio (e621900ad2)
which introduced block_dirty_folio() as a function that could be used to
handle the address_space_operations's dirty_folio operation.

And
  fs: Remove aops ->set_page_dirty (3a3bae50af)
which removed the set_page_dirty member in the address_space_operations
structure.

The openafs commit:
  Linux-5.18 replace set_page_dirty with dirty_folio (6aa129e743e88)
introduced an autoconf test that checks for the presence of aops'
dirty_folio member and assumed that the Linux function
block_dirty_folio() was also provided (since all three of the above
Linux commits were added in Linux-5.18-rc1).

Without the (e621900ad2) commit, the openafs Linux kernel module fails
to build since block_dirty_folio() is not defined by Linux.

Introduce new autoconf tests that checks for the presence of the
block_dirty_folio() function.

Change the preprocessor conditional within LINUX/osi_vnodeops.c to only
use dirty_folio if aops has dirty_folio and block_dirty_folio() is
available.  When block_dirty_folio() is not available, we continue to
use the older set_page_dirty method, which remains a valid method until
its removal by the (3a3bae50af) Linux commit.

Note: Reviewing the Linux source for RedHat 9.1 shows that there is only
one location that is defining the dirty_folio member and it is providing
its own function instead of relying on block_dirty_folio.

Change-Id: If8f7bba3fa779e344ba1d51f7a837197586142bd
Reviewed-on: https://gerrit.openafs.org/15199
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-12-08 16:33:18 -05:00
Indira Sawant
9ba35b6a30 viced: Remove dead assignments
Clang scan-build reported variables being assigned value but not used.

src/viced/host.c:
    >> Dead assignment: Value stored to 'code' is never read

Remove the assigned values that are never used.

Myself(indira.sawant@ibm.com) and Kailas Zadbuke(kailashsz@in.ibm.com)
worked on this together and submitting this patch.

Change-Id: Ia74aa6df1e918d7f07755c606571eb01d518b482
Signed-off-by: Indira Sawant <indira.sawant@ibm.com>
Reviewed-on: https://gerrit.openafs.org/15188
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2022-12-08 13:22:41 -05:00
Cheyenne Wills
63db2de22e Linux: Fix functions without prototypes
The Linux kernel build has -Wstrict-prototypes enabled and flags
functions without a proper prototype.  With clang-16 these warnings are
reported as errors when the kernel is configured with CONFIG_WERROR or
when openafs is configured with --enable-checking.

    src/libafs/MODLOAD-6.1.0-rc3-SP/osi_alloc.c:339:32: error: a
       function declaration without a prototype is deprecated in all
       versions of C [-Werror,-Wstrict-prototypes]
   osi_linux_verify_alloced_memory()
                                  ^
                                   void

Update function prototypes to comply with -Wstrict-prototypes.

There are no functional changes with this commit.

Change-Id: I31aeb6e40bd3c6d9bf519d80bbed9b031b99df84
Reviewed-on: https://gerrit.openafs.org/15194
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-12-08 12:31:48 -05:00
Cheyenne Wills
e2ad1ca5f7 cf: Handle autoconf linux checks with -Werror
When the linux kernel has been configured with CONFIG_WERROR=y, several
autoconf configure checks used to detect linux features fail due to the
compiler performing additional coding checks (e.g. unused variables,
uninitialized variables, etc.).  Typically these additional coding
checks produce compiler warnings, but with CONFIG_WERROR=y these
warnings are reported as compiler errors, resulting in a misconfigured
build environment.

When testing for kernel features, turn off -Werror in the autoconf
functions AC_CHECK_LINUX_BUILD and AC_CHECK_LINUX_FUNC by explicitly
setting the compiler '-Wno-error' flag.

In addition, fix the commented description for AC_CHECK_LINUX_BUILD to
match the actual parameters

Change-Id: I2bc4f6accdc82d12484654ef1185e3970bd9a04f
Reviewed-on: https://gerrit.openafs.org/15191
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2022-12-08 12:31:41 -05:00
Andrew Deason
799209396b cf: Skip RRA_LIB_GSSAPI if krb5/gss is disabled
Currently, we always run RRA_LIB_GSSAPI during configure, even if we
already detected that there is no libkrb5 available or
--without-gssapi was given. This means that no matter what options the
user passes, 'configure' throws an error if we can't find a usable
gssapi library.

Our logic in gss.m4 is structured similarly to krb5.m4, which assumes
that the probing macro (RRA_LIB_KRB5_OPTIONAL / RRA_LIB_GSSAPI) does
effectively nothing if the relevant library is not available. But
RRA_LIB_GSSAPI behaves like RRA_LIB_KRB5, not RRA_LIB_KRB5_OPTIONAL,
in that it throws an error and stops 'configure' if it cannot find a
usable gssapi library. (Currently, there is no RRA_LIB_GSSAPI_OPTIONAL
macro like there is for krb5.)

To fix this, just skip RRA_LIB_GSSAPI if we've already detected that
there is no krb5 library available, or if gss has been explicitly
disabled with --without-gssapi.

Based on a commit by cwills@sinenomine.net.

Change-Id: I08951a9b78f5edb88018cd3991b0213561ff94b2
Reviewed-on: https://gerrit.openafs.org/15138
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-12-08 12:18:22 -05:00
Cheyenne Wills
f81b01de1a cf: Detect how to pass CFLAGS to linux kbuild
The autoconf test LINUX_KBUILD_USES_EXTRA_CFLAGS fails on modern kernels
when detecting how to pass CFLAGS to the compiler when building a Linux
kernel module.  The result of this test is used by configure when
testing for Linux kernel features.

In addition the EXTRA_CFLAGS method of passing compiler parameters has
been deprecated since Linux 2.6.24 commit:
    "kbuild: introduce ccflags-y, asflags-y and ldflags-y" (f77bf01425b)

The currently preferred method is to use the make variable 'ccflags-y'
to set compiler flags.

Replace the autoconf function LINUX_KBUILD_USES_EXTRA_CFLAGS with a new
test, LINUX_KBUILD_FIND_CFLAGS_METHOD, that checks the various ways to
pass compiler flags when building the kernel module.

Set the build variable "LINUX_KBUILD_CFLAGS_VAR" with the determined
method for setting kbuild compiler flags.

Update the AC_TRY_KBUILD26 autoconf function and the
make_kbuild_makefile.pl script to use the determined method for setting
the compiler flags for the kbuild process.

Background:

The autoconf test, LINUX_KBUILD_USES_EXTRA_CFLAGS, is used to determine
when to use either CFLAGS for EXTRA_CFLAGS when performing other
autoconf tests for Linux kernel features. The test was added with the
openafs commit:
 "linux-2624-20071123" (af7cf697ef8)

LINUX_KBUILD_USES_EXTRA_CFLAGS relied on the Linux 2.6.24 commit:
 "kbuild: check for wrong use of CFLAGS" (0c53c8e6eb4)
which caused a build failure if CFLAGS where used instead of
EXTRA_CFLAGS.

Later with the Linux 4.20 commit:
 "kbuild: remove old check for CFLAGS use" (0d91bf584fe)
which removed the build failure when CFLAGS were set and this resulted
in LINUX_KBUILD_USES_EXTRA_CFLAGS failing to properly determining how to
set compiler flags in the kbuild process.

As mentioned above, the EXTRA_CFLAGS method itself has been deprecated
in Linux 2.6.24, but support for using it has still present in the
kbuild processes.

Change-Id: I8ce3a8c9af4785ae85d0bbd5962c573a35d8748e
Reviewed-on: https://gerrit.openafs.org/15196
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-12-08 11:48:39 -05:00
Cheyenne Wills
97f0a20e50 libadmin: Fix RPCStatsStateGet 'rpc' prototype
clang-16 is flagging a incompatible-function-pointer-types warning which
results in build errors when --enable-warning is turned on.

   client.c:498:13: error: incompatible function pointer types passing
      'int (struct rx_connection *, afs_int32 *)'
      (aka 'int (struct rx_connection *, int *)') to parameter of type
      'int (*)(struct rx_connection *, afs_RPCStatsState_p)'
      (aka 'int (*)(struct rx_connection *, afs_RPCStatsState_t *)')
      [-Wincompatible-function-pointer-types]

    (conn, RXSTATS_QueryPeerRPCStats, &state, &st)) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~

Update the 'util_RPCStatsStateGet()' function's parameter to match the
function type for the RPC functions actually being called.

Change-Id: I4354dff2733ce2319b27a2f047cfe4a21ef3bcc8
Reviewed-on: https://gerrit.openafs.org/15180
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-12-01 21:35:43 -05:00
Cheyenne Wills
afafde158f clang-16: Fix simple unused-but-set variables
Clang-16 is flagging variables as unused-but-set-variables resulting in
build errors when --enable-warning is used.

   db_verify.c:996:9: error: variable 'builtinUsers' set but not used
      [-Werror,-Wunused-but-set-variable]
       int builtinUsers = 0;
           ^
Remove the variables that are set but never actually used.

This commit fixes the simpler cases where variables are only set but
not used elsewhere.

Change-Id: I45674871cfc70a7e57c7c3e2d74ec81a4433a7c4
Reviewed-on: https://gerrit.openafs.org/15178
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-12-01 21:31:58 -05:00
Cheyenne Wills
97018ace99 clang-16: Fix conditionally unused-but-set variables
clang-16 is flagging unused-but-set variables which result in build
errors when --enable-warning is turned on.

   remote.c:485:15: error: variable 'pass' set but not used
       [-Werror,-Wunused-but-set-variable]
     afs_int32 pass;
              ^
These variables are actually used in specific cases depending on
build configuration (e.g. AFS_PTHREAD_ENV, etc.).

Relocate these variables so they are fully defined or referenced within
preprocessor '#if' blocks.

Change-Id: I900a192ec781be4ab4453769e1d8f0cc48fe5757
Reviewed-on: https://gerrit.openafs.org/15177
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2022-12-01 21:29:25 -05:00
Cheyenne Wills
05eb420829 clang-16: Fix unused-but-set 'for' control vars
clang-16 is flagging unused-but-set variables which result in build
errors when --enable-warning is turned on.  Several of these variables
are used within 'for(..)' loops but are not actually referenced anywhere
else.

  fcrypt.c:181:16: error: variable 'i' set but not used
     [-Werror,-Wunused-but-set-variable]
    afs_uint32 i, j;
               ^
Refactor the for statements to eliminate the unused variables.

Note, this commit is a little more complex than simply removing unused
variables.

Change-Id: I4d2de60dffc3e717d784e820f2d91470c5e7926b
Reviewed-on: https://gerrit.openafs.org/15176
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-12-01 21:25:18 -05:00
Cheyenne Wills
c9ac7cdfb6 crypto: Define krb5_keytype as krb5_enctype
When building with clang-16 and configured with --enable-checking, the
external source heimdal/krb5/crypto.c used in src/crypto/rfc3961 fails
with the following error:

  src/external/heimdal/krb5/crypto.c:702:28
   error: implicit conversion from enumeration type 'krb5_enctype' (aka
   'enum ENCTYPE') to different enumeration type 'krb5_keytype' (aka
   'enum krb5_keytype') [-Werror,-Wenum-conversion]
       *keytype = e->keytype->type; /* XXX */
                ~ ~~~~~~~~~~~~^~~~

Replace the enum definition of krb5_keytype with a typedef to
krb5_enctype and create an anonymous enum mapping of KEYTYPE_ARCFOUR to
ETYPE_ARCFOUR_HMAC_MD5.

It should be noted that krb5_keytype and KEYTYPE_ARCFOUR are only used
by the external file src/external/heimdal/krb5/crypto.c

Changing the type for krb5_keytype was suggested by Andrew Deason
(adeason@sinenomine.net).

Change-Id: I6b4e94cabe98f9b33df0c91cb75bc84b9f9e3dee
Reviewed-on: https://gerrit.openafs.org/15189
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-12-01 21:22:43 -05:00
Cheyenne Wills
3e9d41c98e dumptool: Remove unused 'sflag' variable
clang-16 is flagging unused-but-set variables which result in build
errors when --enable-warning is turned on.

   ./dumptool.c:1285:54: error: variable 'sflag' set but not used
      [-Werror,-Wunused-but-set-variable]
       int errflg = 0, lflag = 0, iflag = 0, Fflag = 0, sflag = 0, Rflag = 0;

Within dumptool the '-s' option of the 'ls' subcommand sets the 'sflag'
variable, but the variable itself is never used anywhere else.

Remove the variable 'sflag', and ignore the '-s' option.

The sflag variable was unused in the commit that introduced the code:
"test-suite-pull-tools-directly-in-20020114" (fcb32c07ed6d)

Change-Id: I0769b9d3f76b4a802109628496bf332618162f89
Reviewed-on: https://gerrit.openafs.org/15181
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-12-01 11:36:50 -05:00
Cheyenne Wills
4be3e5d31f libuafs: include com_err.h in ukernel_swig.i
clang-16 is flagging an implicit-function-definition which results in a
build error when --enable-warning is turned on.

    PERLUAFS/ukernel_swig_perl.c:1585:9: error: call to undeclared
        function 'afs_com_err'; ISO C99 and later do not support
        implicit function declarations [-Wimplicit-function-declaration]
      afs_com_err("AFS::ukernel", code, "parsing line: '%s'", line);
      ^

Add an include for afs/com_err.h to resolve the warning.

Change-Id: Id02d8a3f0ec6d7d3a9f5ffe7fcacf1a6972700a0
Reviewed-on: https://gerrit.openafs.org/15179
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-11-30 23:04:23 -05:00
Cheyenne Wills
f7cb492c7e rx: Remove event_handler rx_pthread_* counters
The event_handler() function contains several counters that are
set and incremented but are not actually used.  Clang-16 is flagging
these with a 'unused-but-set-variable' warning resulting in build errors
when --enable-warnings is used.

rx_pthread.c:136:19: error: variable 'rx_pthread_n_event_expired' set
       but not used [-Werror,-Wunused-but-set-variable]
      unsigned long rx_pthread_n_event_expired = 0;

Several 'if' statements are used to conditionally set these variables,
but serve no other purpose. These 'if' statements can also be
eliminated.

Remove the unused rx_pthread_* counter variables as well as the
associated 'if' statements.  In addition the only purpose of the
'error' variable was to conditionally increment one of the removed
variables, remove the 'error' variable.

These variables have been 'unused but set' since the original commit
from IBM.

Change-Id: Ibad026cef2030c89a9421b1eea64049ef38fe37e
Reviewed-on: https://gerrit.openafs.org/15175
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
2022-11-12 22:28:15 -05:00
Ganesh Chaudhari
d38b068627 macOS: Add support for aarch64-*-darwin* sysname
As of libtool 2.4.7, the supplied config.guess file modifies
the sysname returned on macOS arm64 from arm-*-darwin* to
aarch64-*-darwin*. As a result, trying to build OpenAFS on
macOS arm64 fails with the following message:

  configure: error: An AFS sysname is required

To avoid this problem, added support for aarch64-*-darwin*.

Change-Id: Id00d5a749ffb9ef49f0ebba6d8b9a47c5c3a9d6a
Signed-off-by: Ganesh Chaudhari <gangovind@in.ibm.com>
Reviewed-on: https://gerrit.openafs.org/15149
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2022-10-27 02:20:05 -04:00
Ben Huntsman
4580f213b3 INSTALL: Update INSTALL to reflect AIX platforms
Update the INSTALL file to reflect the current rs_aix platforms
that we can build for.

Change-Id: I6d8a0376df5507c9ecfdffbd32e86610130af28d
Reviewed-on: https://gerrit.openafs.org/15142
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-10-24 17:13:55 -04:00
Ben Huntsman
f4fc18b80e AIX: Fix issue with make install on AIX 7.1 and higher
Added rules to src/export/Makefile.in for the install target
under AIX 7.1 and higher.

Change-Id: I5472c491f1eb93b468aa5dad36baf7cac8c43a6a
Reviewed-on: https://gerrit.openafs.org/15146
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-10-24 17:13:37 -04:00
Ganesh Chaudhari
c620c91416 macos: Update postinstall instructions for MacOS 13
System preferences is getting replaced by System settings in MacOS 13.
So, this commit will address the required changes in the dialog box
which gets popped after installing OpenAFS.

Change-Id: I56ddb1d43ef5994ac30d5383bf8a376b43419724
Signed-off-by: Ganesh Chaudhari <gangovind@in.ibm.com>
Reviewed-on: https://gerrit.openafs.org/15150
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-10-24 17:12:24 -04:00
Andrew Deason
f2831d109d rxkad: Consolidate refCount decrement
To make code changes easier, all rxkad code that deals with
incrementing/decrementing the rx_securityClass refCount should be done
in the same place. Right now, there's only one incrementing code path,
but there are two decrement code paths that are duplicated. Change the
rxkad_DestroyConnection refCount-handling logic to just call
rxkad_Close(), since the behavior is identical.

Change-Id: Ibee79435dc62d79f0094ead818566c7f62c91898
Reviewed-on: https://gerrit.openafs.org/15153
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-10-24 17:10:47 -04:00
Andrew Deason
475594cfcc rxgk: Use 'dir' as rock in afsconf_BSSO_int
Commit 2630e70550 (Move key-related warnings to common server code)
changed afsconf_BuildServerSecurityObjects into
afsconf_BuildServerSecurityObjects_int, and changed some arguments,
including removing the 'rock' arg. Specify 'dir' instead of 'rock'
here (they're the same thing), so we can build with rxgk again.

Change-Id: I7e8f979ec42b3b0f2af249da79f1ad30040a1a00
Reviewed-on: https://gerrit.openafs.org/15152
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-10-24 17:07:58 -04:00
Ben Huntsman
1aeac36571 configure: Add platform rs_aix71
Enable the configure script to detect and configure AIX 7.1.

Change-Id: I746cc00ff43b061c1950785279549a3512ff7303
Reviewed-on: https://gerrit.openafs.org/15143
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-10-08 18:21:49 -04:00
Ben Huntsman
0c43fe64dd libafs: Add support for AIX 7.1, 7.2
src/libafs/MakefileProto.AIX.in contains rules for various versions of
AIX, but did not have any case for AIX 7.1 or 7.2  This causes build
failures on those platforms.  Added in the missing entries for rs_aix71
and rs_aix72.

Change-Id: I92625223b7b467e328e9eeeff2feef4e253345e2
Reviewed-on: https://gerrit.openafs.org/15145
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-10-06 11:28:11 -04:00
Ben Huntsman
ba3e1410d5 AIX: Correctly create export64.exp on AIX 7.1+
Create the export64.exp file on AIX 7 and higher.

Change-Id: I46a631586819354870a4b23cbde44942daf5a09b
Reviewed-on: https://gerrit.openafs.org/15144
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-10-06 11:27:30 -04:00
Mark Vitale
95d3cbe707 viced: Use calloc for fsstate data
Internal struct fs_dump_state contains a number of pointer members to
other internal headers that are allocated via malloc, and later zeroed
or read in from disk. Use calloc instead (and remove some of the
now-redundant memsets) to make sure we never accidentally use the
uninitialized memory.

While here, also use sizeof the member names rather than the member
types.

[adeason@sinenomine.net: Removed some memsets.]

Change-Id: Ia78bd3956a6367b8f16b01c1b3181875df47ba87
Reviewed-on: https://gerrit.openafs.org/14725
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-10-06 07:16:42 -04:00
Ganesh Chaudhari
e5a97ef2b4 macos: Add support for MacOS 13.0 (Ventura)
This commit introduces the new set of changes / files required to
successfully build the OpenAFS source code on OS X 13.0 “Ventura”.

Thank you Kailas Zadbuke (IBM) and Harish Sharma (IBM) for your help.

Change-Id: Ice01b93fb6bbdee433fe1b3260e5e7f74a31930a
Reviewed-on: https://gerrit.openafs.org/15139
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-10-06 07:06:44 -04:00
Cheyenne Wills
0ce315f0ce Linux-6.0: Replace add_to_page_cache
Linux 6.0 removed the add_to_page_cache function in the Linux commit:
    'filemap: Remove add_to_page_cache() and add_to_page_cache_locked()'
    (2bb876b58d593d7f2522ec0f41f20a74fde76822)

The replacement function, filemap_add_folio function is exported as GPL,
but a non-GPL wrapper was provided in the Linux 5.15 commit:
    'mm/filemap: Add filemap_add_folio()'
    (9dd3d069406cea073fc633e77bc59abbfde8c6c4)
which changed the GPL exported function add_to_page_cache_lru to a
non-GPL exported function.

The function add_to_page_cache_lru functionally combines the
add_to_page_cache with lru_cache_add.  Within afs, all the calls to
add_to_page_cache follow the pattern of calling the lru_cache_add
via the wrapper afs_lru_cache_add immediately after (except in one case
noted below).

Add an autoconf check to see if add_to_page_cache_lru is available.

Introduce a new wrapper function afs_add_to_page_cache_lru that handles
calling either add_to_page_cache/afs_lru_cache_add or
add_to_page_cache_lru.

As noted above there is one function, afs_linux_bypass_readpages, that
calls add_to_page_cache but does not immediately call afs_lru_cache_add.
This function is only used in Linux kernels prior to 5.18, see the
commit:
    'Linux-5.18: replace readpages with readahead' (7a181415db)
Since this code path is only built for a Linux kernel level where
add_to_page_cache should also exists, we do not replace this call.

NOTE:
The add_to_page_cache_lru was moved into mm/folio-compat.c which has a
comment indicating that callers of these functions should migrate to
folio calls.  However the replacement folio call that is needed by afs,
filemap_add_folio, is exported as GPL.

Change-Id: I10087ebeb8b08309e6c1bab4fc43f7e9f50bd105
Reviewed-on: https://gerrit.openafs.org/15132
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>
2022-10-05 05:49:27 -04:00
Ben Huntsman
54dbd474a5 afs: Use strlcat instead of snprintf to enable AIX build
The original code used strcpy(), etc.  Some compilers have begun
to raise warnings that the use of these functions is unsafe, and
in the case of newer Linux kernels in particular, have caused the
build to fail outright.  To adapt to these compilers/kernels, the
code was changed to leverage strlcpy(), snprintf(), etc. as they
are safer.  AIX does not provide these functions within the
kernel.  For some of the functions such as strlcpy(), etc. we
can use replacement functions from libroken within the AIX kernel
extension.  However, libroken does not offer a suitable
replacement for snprintf(), and instead the same purpose can be
accomplished by using strlcpy() and multiple calls to strlcat().

Change-Id: Iae4b9d945b12dea88727a3453d06b8ff1eb285ae
Reviewed-on: https://gerrit.openafs.org/15122
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-09-28 12:56:56 -04:00
Ben Huntsman
8b1beaffb4 rx: Only use printf in the AIX kernel
An earlier version of the OpenAFS code used an unusual preprocessor
macro for the function osi_Msg and osi_VMsg.  This causes problems
on newer Linux kernels.  The macro was replaced with a function
leveraging vprintf, etc.  These functions are not available in the
AIX kernel, where our only option is printf.  However, AIX does
provide these functions in libc.  This change ensures we only use
printf when building the AIX kernel module.

Change-Id: Ib46c4712516846a489cc66fda0833907612b3316
Reviewed-on: https://gerrit.openafs.org/15118
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-09-21 23:49:36 -04:00
Ben Huntsman
ad2b880c37 BUILD: Ensure that make clean actually cleans all products
After a build, running make clean leaves the following objects:

src/dir/test/dtest.o
src/libuafs/libuafs.a
src/libuafs/*.o
src/roken/*.o

Add a few rules to the various Makefiles to ensure that we clean
up those files as well.

Change-Id: I4fb3346b68aa9e20164952d9461c39664020ef7f
Reviewed-on: https://gerrit.openafs.org/15119
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-09-21 23:38:30 -04:00
Ben Huntsman
615681710a afs: Fix missing def for pinned_heap on AIX
Include sys/malloc.h in AIX's osi_sleep.c.  This resolves a build
failure in which pinned_heap is not defined.

The commit below introduced code to resolve an issue on AIX 5.3:

  5e5bfa6b9401ebc1fa5446e208cf46c15943c411
  Author: Tom Keiser <tkeiser@sinenomine.net>
  Date:   Mon Jun 25 21:22:49 2007 +0000

    aix53-avoid-wait-crash-20070625

newp = (afs_event_t *) xmalloc(sizeof(afs_event_t), 5, pinned_heap);

pinned_heap has always been defined in sys/malloc.h since at least
AIX 4.1.  It is likely that the aix53-avoid-wait-crash-20070625
commit did not compile, or that sys/malloc.h was included
elsewhere at the time.

Change-Id: If4c026ae06f8a6bba1cc78af991d1adef5102f3f
Reviewed-on: https://gerrit.openafs.org/15108
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@auristor.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-09-14 16:36:22 -04:00
Ben Huntsman
319d361499 AIX: Fix install of 64-bit kernel module
Remove make step in error.  This was preventing the install of the
built kernel module on AIX when not using Transarc-style paths via
the make install step.

Change-Id: I870de97124a320f6d996aece803ecd4b36bf787f
Reviewed-on: https://gerrit.openafs.org/15114
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-09-10 01:56:48 -04:00
Ben Huntsman
c0968b6c69 util: Add missing symbol for AIX build
Added symbol afs_exec_alt to liboafs_util.la.sym.  This resolves a
build failure on AIX.

Change-Id: I98c3478bfe041db38b929bd6e2036e9d3038e9e1
Reviewed-on: https://gerrit.openafs.org/15113
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>
2022-09-10 01:55:36 -04:00
Ben Huntsman
91532e3142 fsint: export symbol needed by fileserver
The symbol RXAFS_OpCodeIndex is consumed by the fileserver via the various
"opcode_<RPC Name>" macros produced by rxgen.  The functionality is provided
by liboafs_fsint but RXAFS_OpCodeIndex was omitted from the export symbol list.
This went undetected because we use static linking for the fileserver, and
libtool does not enforce export symbol lists while static linking, on platforms
other than AIX.  Recent efforts to revive the AIX build illuminated the error,
which we resolve by adding RXAFS_OpCodeIndex to the export list.

Change-Id: Ie5b3e5a7a714cfe4b1657b9bbac248c47abbe194
Reviewed-on: https://gerrit.openafs.org/15112
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>
2022-09-10 01:53:28 -04:00
Ben Huntsman
448d2b1184 export: Ignore additional build products generated on AIX
Update .gitignore to ignore additional build products generated on AIX.

Change-Id: I91cd1c3d9019e6de89db7f957807b3cbab09e874
Reviewed-on: https://gerrit.openafs.org/15110
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-09-10 01:52:23 -04:00
Michael Meffie
89b563da16 doc: Remove stray sect2 end tag
Commit 2f435309c75dfd8ffe0cfb3e1a54749437cba3be (Remove NoAuth
procedures from Admin Guide) introduced a syntax error in the Admin
Reference guide xml source.

The </sect2> end tag which matched the <sect2 id="Header_427"> start tag
should have been removed in the last hunk of that commit.

This change removes the stray end tag to fix the xsltproc error:

    Build the book set list...
    openafs/doc/xml/AdminGuide/auagd014.xml:1119: parser error : Opening and ending tag mismatch: sect1 line 1037 and sect2
        </sect2>
                ^
    ...
    Error: xsltproc failed
    make: *** [Makefile:42: auagd000.pdf] Error 1

Change-Id: I91b9b5335c2ddd6ab60d3bc061703c8396003a43
Reviewed-on: https://gerrit.openafs.org/15120
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-08-23 01:06:37 -04:00
Cheyenne Wills
8d95450082 LINUX: Use bitwise & for f_flags test
This code is clearly supposed to be masking f_flags with O_ACCMODE, and
so should be using a bitwise &, not the boolean &&.  Clang complains
about this, causing a warning (which breaks the build with
--enable-checking):

error: use of logical '&&' with constant operand [-Werror,
        -Wconstant-logical-operand]
        } else if ((file->f_flags && O_ACCMODE) != O_WRONLY) {
                                  ^  ~~~~~~~~~
.../osi_vnodeops.c:3192:28: note: use '&' for a
        bitwise operation

For the current code without this commit the behavior of this
check is as follows:

   When f_flags is:         The check is:
   ====================     =============
   O_RDONLY                 True  (as expected)
   O_WRONLY                 False (as expected)
   O_RDWR                   False (incorrect)
   has some non-O_ACCMODE   False (incorrect)
    bit is set

The incorrect check doesn't cause any problems for overall correctness,
but it does mean that in those cases afs_linux_fillpage will not be
called and that partially-written pages will be left out of date and any
reader will need to fill the page again.

Fix this by using the bitwise &.

There is also an out of date link to the Linux documentation.  Update
the comment to point to the current documentation that is in the Linux
source tree.

Change-Id: I193b30e837075ef18d0559c6b28ac8ce222c1a5a
Reviewed-on: https://gerrit.openafs.org/14903
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>
2022-08-18 11:52:27 -04:00
Cheyenne Wills
c98994dd11 autoconf: Additional library test for ncurses
Depending on how the ncurses libraries were built the external symbol
'LINES' may be replaced with the '_nc_LINES' external symbol.  Because
the symbol 'LINES' may or may not be present, the autoconf test can fail
to detect the correct libraries needed for curses support.

Add an additional AC_CHECK_LIBs for the symbol _nc_LINES (within the
ncurses or tinfo libraries) when setting the $LIB_curses.

This commit was adapted from the openSuSE source packaging for openafs.

Background: when ncurses is built with --enable-reentrant, LINES is
defined as a C preprocessor macro that expands to a call to _nc_LINES

Change-Id: If5e93078ff8cd0af5a50a25a8be7b462261a4f6f
Reviewed-on: https://gerrit.openafs.org/14889
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ralf Brunckhorst <rbrunckhorst@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-08-18 11:44:05 -04:00
Cheyenne Wills
d9232fedec afs: Cleanup AFS_S390X_ENV statement
The commit 'Change AFS*_LINUXnn_ENV to AFS*_LINUX_ENV' (6329a523f6)
mechanically replaced the multiple versions of the AFS*_LINUXnn_ENV
definitions with non-versioned definitions.  A follow-on commit 'Cleanup
AFS_*LINUX_ENV usage' (cbc18e4b3) refactored code to handle cleaning up
redundant statements or removing dead code.

The clean up in cbc18e4b3 missed a block of preprocessor statements in
osi_probe.c which defined the macros _SS(x) and _SX(x).

Prior to the commit 6329a523f6, these macros performed bit shifting or
masking for the S390X LINUX20 environment.  For S390X LINUX24 or other
platforms the macros just emitted their parameter.

With commit 6329a523f6 the statement:
   #if defined(AFS_S390X_LINUX20_ENV) && !defined(AFS_S390X_LINUX24_ENV)
was replaced with (which dropped support for S390X LINUX20):
   #if defined(AFS_S390X_LINUX_ENV) && !defined(AFS_S390X_LINUX_ENV)

After cleaning up the conditional, the result leaves the definitions for
_SS and _SX as:
   #define _SS(x) (x)
   #define _SX(x) (x)

Which allows further cleanup by removing these macros and just using
their arguments directly.

Change-Id: I7b56c01ffd59e5f0220bf2a29e92a5cd41977b04
Reviewed-on: https://gerrit.openafs.org/14993
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-08-18 11:32:27 -04:00
Ben Huntsman
1a4da8868f export: Install kernel utilities with execute permissions on AIX
Make sure that cfgexport and cfgafs are installed with execute
permissions.  These executables load the AIX kernel modules into
the running kernel and are called by the rc.afs script.

Change-Id: I9434a25dc03033cfcc268e763bf9122349eef3a4
Reviewed-on: https://gerrit.openafs.org/15116
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-08-18 11:04:09 -04:00
Ben Huntsman
b5b34278b2 afs: Fix missing def for timestruc_t on AIX
Include sys/time.h in AIX's osi_machdep.h.  This resolves a build
issue where the struct timestruc_t was not defined.

Change-Id: I2acf770f8bfa226915d6257ff6a376ea11e515b9
Reviewed-on: https://gerrit.openafs.org/15107
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2022-08-17 23:17:30 -04:00