Accepting request 984720 from home:hauky:branches:filesystems

- apply patches adressing:
  * Linux-5.17 and 5.18, gcc-11 and 12: fix_gcc_12_linux_5.18.diff
- remove patches from previous commit:
  * a714e86.diff and 449d1fa.diff
  * gcc-11.diff

OBS-URL: https://build.opensuse.org/request/show/984720
OBS-URL: https://build.opensuse.org/package/show/filesystems/openafs?expand=0&rev=90
This commit is contained in:
Christof Hanke 2022-06-23 13:39:36 +00:00 committed by Git OBS Bridge
parent 7cc4103382
commit 758d3807f5
21 changed files with 21030 additions and 6481 deletions

View File

@ -1,118 +0,0 @@
From 449d1faf87e2841e80be38cf2b4a5cf5ff4df2d8 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Fri, 28 Jan 2022 14:10:46 -0700
Subject: [PATCH] Linux-5.17: Kernel build uses -Wcast-function-type
The linux 5.17 commit:
"Makefile: Enable -Wcast-function-type" (552a23a0)
added the -Wcast-function-type compiler flag for kernel module builds.
This change catches a type mismatch in the external files obtained from
heimdal: hcrypto/evp.c and hcrypto/evp-algs.c and produces the following
type of compile time error messages.
src/libafs/MODLOAD-.../evp.c: In function hc_EVP_md_null:
src/libafs/MODLOAD-.../evp.c:501:2: error: cast between incompatible
function types from void (*)(void *) to int (*)(EVP_MD_CTX *)
{aka int (*)(struct hc_EVP_MD_CTX *)}
[-Werror=cast-function-type]
501 | (hc_evp_md_init)null_Init,
| ^
Use AX_APPEND_COMPILE_FLAGS to create a CFLAGS_NOCAST_FUNCTION_TYPE
macro to disable this warning and update the CFLAGS for these 2 files
for the Linux libafs build.
Update the CODING documentation to add the new exceptions. In addition
add a brief description on how to set up autoconf to add a new build
macro to suppress compiler warnings.
Note: upstream heimdal has committed a fix for this in:
hcrypto: Fix return type for null_Init, null_Update and null_Final
(fc4b3ce49b)
Reviewed-on: https://gerrit.openafs.org/14881
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
(cherry picked from commit 6bdfa976731ce07f3236893ecf12abb9e169b882)
Change-Id: Ibd354f663d5876c421a8b4e89b8943c9e3d59ebc
---
diff --git a/CODING b/CODING
index 5d62dbb..c266979 100644
--- a/CODING
+++ b/CODING
@@ -265,7 +265,13 @@
# endif
#endif
-If a pragma isn't available for your particular warning, you will need to
+If the source cannot be changed to add a pragma, you might be abe to use the
+autoconf function AX_APPEND_COMPILE_FLAGS to create a new macro that disables
+the warning and then use macro for the build options for that file. For an
+example, see how the autoconf macro CFLAGS_NOIMPLICIT_FALLTHROUGH is defined and
+used.
+
+Finally if there isn't a way to disable the specific warning, you will need to
disable all warnings for the file in question. You can do this by supplying
the autoconf macro @CFLAGS_NOERROR@ in the build options for the file. For
example:
@@ -288,6 +294,10 @@
: signed vs unsigned for dates
butc/tcudbprocs.c : all : ubik_Call
external/heimdal/hcrypto/validate.c: all: statement with empty body
+external/heimdal/hcrypto/evp.c: cast-function-type
+ : Linux kernel build uses -Wcast-function-type
+external/heimdal/hcrypto/evp-algs.c: cast-function-type
+ : Linux kernel build uses -Wcast-function-type
kauth/admin_tools.c : strict-proto : ubik_Call
kauth/authclient.c : strict-proto : ubik_Call nonsense
libadmin/kas/afs_kasAdmin.c: strict-proto : ubik_Call nonsense
diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4
index 1e1b080..11f3eea 100644
--- a/src/cf/osconf.m4
+++ b/src/cf/osconf.m4
@@ -665,6 +665,7 @@
CFLAGS_NOSTRICT=-fno-strict-aliasing
CFLAGS_NOUNUSED=
CFLAGS_NOOLDSTYLE=
+CFLAGS_NOCAST_FUNCTION_TYPE=
XCFLAGS_NOCHECKING="$XCFLAGS"
if test "x$GCC" = "xyes"; then
@@ -677,6 +678,8 @@
CFLAGS_NOERROR="-Wno-error"
CFLAGS_NOUNUSED="-Wno-unused"
CFLAGS_NOOLDSTYLE="-Wno-old-style-definition"
+ AX_APPEND_COMPILE_FLAGS([-Wno-cast-function-type],
+ [CFLAGS_NOCAST_FUNCTION_TYPE])
AC_DEFINE(IGNORE_SOME_GCC_WARNINGS, 1, [define to disable some gcc warnings in warnings-as-errors mode])
else
CFLAGS_NOSTRICT=
@@ -753,6 +756,7 @@
AC_SUBST(CFLAGS_NOSTRICT)
AC_SUBST(CFLAGS_NOUNUSED)
AC_SUBST(CFLAGS_NOOLDSTYLE)
+AC_SUBST(CFLAGS_NOCAST_FUNCTION_TYPE)
AC_SUBST(XCFLAGS64)
AC_SUBST(XLDFLAGS)
AC_SUBST(XLDFLAGS64)
diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in
index d98fa05..8e98afd 100644
--- a/src/libafs/MakefileProto.LINUX.in
+++ b/src/libafs/MakefileProto.LINUX.in
@@ -79,8 +79,9 @@
CFLAGS_opr_rbtree.o = -I${TOP_SRCDIR}/opr
CFLAGS_evp.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto \
- -DHAVE_CONFIG_H
-CFLAGS_evp-algs.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
+ -DHAVE_CONFIG_H @CFLAGS_NOCAST_FUNCTION_TYPE@
+CFLAGS_evp-algs.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto \
+ @CFLAGS_NOCAST_FUNCTION_TYPE@
CFLAGS_evp-kernel.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
CFLAGS_rand-timer-kernel.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
CFLAGS_rand-kernel.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto

6309
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +0,0 @@
User-Visible OpenAFS Changes
OpenAFS 1.8.8.1
Linux clients
* Support mainline kernels 5.14, 5.15 and likely 5.16 (currently
at rc6) (14830 14831 14851)
FreeBSD
* Add support for building on FreeBSD 12, and running at least in
readonly mode on this platform. Note this release removes support
for the obsolete FreeBSD 8 and 9. (14773 14780..88 14792..95)
Solaris
* Support building with Studio 12.6 (14841)

15
RELNOTES-stable-1_8_x Normal file
View File

@ -0,0 +1,15 @@
User-Visible OpenAFS Changes
OpenAFS 1.8.8.2~rc1
Linux clients
* Support mainline kernels 5.17 and likely 5.18
* Support for gcc-12, clang-14
Maybe others
This is an intermediate package based on the git-branch
stable-1_8_x with additional patches
to fill the need of supporting Linux-5.18

View File

@ -1,134 +0,0 @@
From a714e865efe41aa1112f6f9c8479112660dacd6f Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Thu, 27 Jan 2022 20:19:17 -0700
Subject: [PATCH] Linux-5.17: kernel func complete_and_exit renamed
Handle the Linux kernel function rename made in commit
"exit: Rename complete_and_exit to kthread_complete_and_exit"
(cead1855)
Add a new autoconf test for the linux function kthread_complete_and_exit
and if not found use a define to map kthread_complete_and_exit to
complete_and_exit.
Replace calls to complete_and_exit with kthread_complete_and_exit.
Reviewed-on: https://gerrit.openafs.org/14882
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit a651d4db7f86a24ea6784f6f27d5c8482667267b)
Change-Id: Ibe96b92a84a8f876dda4019c221c37dabde93244
---
diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h
index 726b655..53a079b 100644
--- a/src/afs/LINUX/osi_compat.h
+++ b/src/afs/LINUX/osi_compat.h
@@ -27,6 +27,10 @@
# endif
#endif
+#if !defined(HAVE_LINUX_KTHREAD_COMPLETE_AND_EXIT)
+# define kthread_complete_and_exit complete_and_exit
+#endif
+
#if defined(STRUCT_DENTRY_OPERATIONS_HAS_D_AUTOMOUNT) && !defined(DCACHE_NEED_AUTOMOUNT)
# define DCACHE_NEED_AUTOMOUNT DMANAGED_AUTOMOUNT
#endif
diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c
index 32ad210..fab4c01 100644
--- a/src/afs/afs_call.c
+++ b/src/afs/afs_call.c
@@ -19,7 +19,9 @@
#include "afs/afs_stats.h"
#include "rx/rx_globals.h"
#if !defined(UKERNEL)
-# if !defined(AFS_LINUX20_ENV)
+# if defined(AFS_LINUX20_ENV)
+# include "osi_compat.h"
+# else
# include "net/if.h"
# ifdef AFS_SGI62_ENV
# include "h/hashing.h"
@@ -328,7 +330,7 @@
sprintf(current->comm, "afs_callback");
afs_RXCallBackServer();
AFS_GUNLOCK();
- complete_and_exit(0, 0);
+ kthread_complete_and_exit(0, 0);
break;
case AFSOP_START_AFS:
sprintf(current->comm, "afs_afsstart");
@@ -342,7 +344,7 @@
sprintf(current->comm, "afsd");
afs_Daemon();
AFS_GUNLOCK();
- complete_and_exit(0, 0);
+ kthread_complete_and_exit(0, 0);
break;
case AFSOP_START_BKG:
#ifdef AFS_NEW_BKG
@@ -361,7 +363,7 @@
afs_BackgroundDaemon();
AFS_GUNLOCK();
#endif
- complete_and_exit(0, 0);
+ kthread_complete_and_exit(0, 0);
break;
case AFSOP_START_TRUNCDAEMON:
sprintf(current->comm, "afs_trimstart");
@@ -372,7 +374,7 @@
sprintf(current->comm, "afs_cachetrim");
afs_CacheTruncateDaemon();
AFS_GUNLOCK();
- complete_and_exit(0, 0);
+ kthread_complete_and_exit(0, 0);
break;
case AFSOP_START_CS:
sprintf(current->comm, "afs_checkserver");
@@ -380,7 +382,7 @@
complete(arg->complete);
afs_CheckServerDaemon();
AFS_GUNLOCK();
- complete_and_exit(0, 0);
+ kthread_complete_and_exit(0, 0);
break;
case AFSOP_RXEVENT_DAEMON:
sprintf(current->comm, "afs_evtstart");
@@ -398,7 +400,7 @@
sprintf(current->comm, "afs_rxevent");
afs_rxevent_daemon();
AFS_GUNLOCK();
- complete_and_exit(0, 0);
+ kthread_complete_and_exit(0, 0);
break;
#ifdef RXK_LISTENER_ENV
case AFSOP_RXLISTENER_DAEMON:
@@ -420,7 +422,7 @@
sprintf(current->comm, "afs_rxlistener");
rxk_Listener();
AFS_GUNLOCK();
- complete_and_exit(0, 0);
+ kthread_complete_and_exit(0, 0);
break;
#endif
default:
diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4
index 0ca3e44..cd4afe9 100644
--- a/src/cf/linux-kernel-func.m4
+++ b/src/cf/linux-kernel-func.m4
@@ -178,6 +178,12 @@
[#include <net/ip.h>],
[ip_sock_set_mtu_discover(NULL, 0);])
+dnl Linux 5.17 renamed complete_and_exit to kthread_complete_and_exit
+AC_CHECK_LINUX_FUNC([kthread_complete_and_exit],
+ [#include <linux/kernel.h>
+ #include <linux/kthread.h>],
+ [kthread_complete_and_exit(0, 0);])
+
dnl Consequences - things which get set as a result of the
dnl above tests
AS_IF([test "x$ac_cv_linux_func_d_alloc_anon" = "xno"],

20316
fix_gcc_12_linux_5.18.diff Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,591 +0,0 @@
From 36796bbb83af2650a872234fdb5cf7124bf6cfa8 Mon Sep 17 00:00:00 2001
From: Michael Meffie <mmeffie@sinenomine.net>
Date: Mon, 23 Aug 2021 14:23:01 -0400
Subject: [PATCH] ubik: Fix ubeacon_updateUbikNetworkAddress() mismatched array parameter warning
The ubeacon_updateUbikNetworkAddress() prototype does not match the
function definition. The ubik_host parameter is declared as an unbounded
array in the prototype but is defined as a bounded array. As of GCC 12,
a warning is issued for the mismatch:
error: argument 1 of type afs_uint32[256] {aka unsigned int[256]}
with mismatched bound [-Werror=array-parameter=]
ubeacon_updateUbikNetworkAddress(
afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR])
note: previously declared as afs_uint32[] {aka unsigned int[]}
extern int ubeacon_updateUbikNetworkAddress(afs_uint32 ubik_host[]);
Restore the ubik_host array length in the function prototype, which was
dropped in commit 9020e6e2f0357b1082705dcaa6626573433969ec (ubik: Defer
updateUbikNetworkAddress until after RX startup).
Change-Id: I8189effc5b68ef8c1b45b4107f5e22e44ecf59fd
Reviewed-on: https://gerrit.openafs.org/14767
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
---
diff --git a/src/ubik/ubik.p.h b/src/ubik/ubik.p.h
index cfd12f7..52869ad 100644
--- a/src/ubik/ubik.p.h
+++ b/src/ubik/ubik.p.h
@@ -492,7 +492,7 @@
char clones[]);
extern int ubeacon_InitServerList(afs_uint32 ame, afs_uint32 aservers[]);
extern void *ubeacon_Interact(void *);
-extern int ubeacon_updateUbikNetworkAddress(afs_uint32 ubik_host[]);
+extern int ubeacon_updateUbikNetworkAddress(afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR]);
extern struct beacon_data beacon_globals;
extern struct addr_data addr_globals;
From 4a8d0c4089078fb3df9cc06b595c80c9b4c2ca7f Mon Sep 17 00:00:00 2001
From: Michael Meffie <mmeffie@sinenomine.net>
Date: Mon, 23 Aug 2021 15:42:52 -0400
Subject: [PATCH] libadmin: Fix isAlias may be uninitialized warning
The cfgutil_HostNameIsAlias() function has an output parameter called
isAlias, which is used when cfgutil_HostIsAlias() returns non-zero.
However, it possible for isAlias to not be set before returning. GCC 12
issues a warning about the possible use of the uninitialized isAlias
variable:
cfginternal.c:366:32: error: isAlias may be used uninitialized
[-Werror=maybe-uninitialized]
Initialize the cfgutil_HostNameIsAlias() isAlias output flag to false.
Also, fix the misleading code indentation around the
cfgutil_HostNameIsAlias() call.
Change-Id: I68e66ae5f9019a613187321bb792d0505959ed30
Reviewed-on: https://gerrit.openafs.org/14772
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
---
diff --git a/src/libadmin/cfg/cfginternal.c b/src/libadmin/cfg/cfginternal.c
index 1f581b8..f1abacb 100644
--- a/src/libadmin/cfg/cfginternal.c
+++ b/src/libadmin/cfg/cfginternal.c
@@ -348,7 +348,7 @@
short dbhostFound = 0;
while (!dbhostDone) {
- short isAlias;
+ short isAlias = 0;
if (!bos_HostGetNext(dbIter, hostNameAlias, &tst2)) {
/* no more entries (or failure) */
@@ -357,15 +357,15 @@
}
dbhostDone = 1;
- } else
- if (!cfgutil_HostNameIsAlias
- (hostName, hostNameAlias, &isAlias, &tst2)) {
- tst = tst2;
- dbhostDone = 1;
-
- } else if (isAlias) {
- dbhostFound = 1;
- dbhostDone = 1;
+ } else {
+ if (!cfgutil_HostNameIsAlias(hostName, hostNameAlias,
+ &isAlias, &tst2)) {
+ tst = tst2;
+ dbhostDone = 1;
+ } else if (isAlias) {
+ dbhostFound = 1;
+ dbhostDone = 1;
+ }
}
}
From 7924aecf95bf4918a485a041f2426bd1fa407ac8 Mon Sep 17 00:00:00 2001
From: Michael Meffie <mmeffie@sinenomine.net>
Date: Fri, 03 Sep 2021 07:05:36 -0400
Subject: [PATCH] ptserver: Fix CreateEntry() stringop-overflow warnings
The CreateEntry() prototype has been fixed to match the function
definition, so callers are expected to provide bounded arrays for the
user or group name. Fix the InitialGroup() macro which is used to set
the built-in names using string literal to avoid stringop-overflow
warnings.
error: CreateEntry accessing 64 bytes in a region of size 22 [-Werror=stringop-overflow=]
code = CreateEntry(tt, (name), &temp, /*idflag*/1, flag, SYSADMINID, SYSADMINID); \
note: in expansion of macro InitialGroup
InitialGroup(SYSADMINID, "system:administrators");
note: referencing argument 2 of type char *
note: in a call to function CreateEntry
CreateEntry(struct ubik_trans *at, char aname[PR_MAXNAMELEN], ...
(Repeated for "system:backup", "system:anyuser", "system:authuser",
"system:ptsviewers", and "anonymous".)
Change-Id: I7a37d4c8e191ffff52c2fdc1ed3783f4c3592b11
Reviewed-on: https://gerrit.openafs.org/14789
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
---
diff --git a/src/ptserver/ptutils.c b/src/ptserver/ptutils.c
index dfa54ee..07fd220 100644
--- a/src/ptserver/ptutils.c
+++ b/src/ptserver/ptutils.c
@@ -1847,8 +1847,15 @@
#define InitialGroup(id,name) do { \
afs_int32 temp = (id); \
afs_int32 flag = (id) < 0 ? PRGRP : 0; \
+ char tname[PR_MAXNAMELEN]; \
+ if (strlcpy(tname, (name), sizeof(tname)) >= sizeof(tname)) { \
+ code = PRBADNAM; \
+ afs_com_err (whoami, code, "name too long %s", (name)); \
+ ubik_AbortTrans(tt); \
+ return code; \
+ } \
code = CreateEntry \
- (tt, (name), &temp, /*idflag*/1, flag, SYSADMINID, SYSADMINID); \
+ (tt, tname, &temp, /*idflag*/1, flag, SYSADMINID, SYSADMINID); \
if (code) { \
afs_com_err (whoami, code, "couldn't create %s with id %di.", \
(name), (id)); \
From 92a6242de2d8ea280debc283a7c089f97c1670bc Mon Sep 17 00:00:00 2001
From: Michael Meffie <mmeffie@sinenomine.net>
Date: Mon, 23 Aug 2021 15:37:13 -0400
Subject: [PATCH] bucoord: Fix doDispatch() array-parameter gcc warning
The doDispatch() prototype does not match the function definition. The
targv parameter is declared as an unbounded array in the prototype, but
is defined as a bounded array. As of GCC 12, a warning is issued for the
mismatch.
main.c:346:18: error: argument 2 of type char *[100] with
mismatched bound [-Werror=array-parameter=]
bucoord_internal.h:123:40: note: previously declared as char *[]
Within doDispatch(), the targv argument is just passed to cmd_Dispatch()
(this is the only use of targv). Since cmd_Displatch() expects an
unbounded array, update the doDispatch() definition to match the
prototype.
Change-Id: I50a170b3490d0d4e5d971b9ccb483cccb6833686
Reviewed-on: https://gerrit.openafs.org/14771
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>
---
diff --git a/src/bucoord/main.c b/src/bucoord/main.c
index a453cc9..972ac2d 100644
--- a/src/bucoord/main.c
+++ b/src/bucoord/main.c
@@ -343,7 +343,7 @@
afs_int32
doDispatch(afs_int32 targc,
- char *targv[MAXV],
+ char *targv[],
afs_int32 dispatchCount) /* to prevent infinite recursion */
{
char *sargv[MAXV];
From a1e57d2e42b6d01e5ece93d5d49a4b9f3ecd3edc Mon Sep 17 00:00:00 2001
From: Michael Meffie <mmeffie@sinenomine.net>
Date: Mon, 23 Aug 2021 15:33:19 -0400
Subject: [PATCH] Fix PrintInode() mismatched array parameter warnings
The PrintInode() prototypes do not match the function definitions.
When AFS_64BIT_IOPS_ENV is defined (which is the common case and is
required for namei), the buffer parameter is declared as a bounded
character array (afs_ino_str_t) in the prototype, but is defined as an
unbounded character pointer. When AFS_64BIT_IOPS_ENV is not defined
(for legacy 32-bit inode vice partitions), PrintInode() is declared with
no specified parameters.
A static buffer is used to hold the formatted string when a NULL is
passed as the first argument to PrintInode(). However, this method is
only used by the volinfo and iopen utility programs.
Fix the mismatch function prototypes and definitions to use the bounded
char array (afs_ino_str_t) in all cases. Remove the deprecated function
declaration with no specified parameters. Update vol-info and iopen to
pass an afs_ino_str_t buffer and remove the now unused static buffer.
Update the duplicated PrintInode() function definition in namei_ops.c.
(This duplicated code could be removed in a future commit.)
Change-Id: I5c0128bb0d572dab0df637289daad0e648ad8a8f
Reviewed-on: https://gerrit.openafs.org/14770
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
---
diff --git a/src/sys/afssyscalls.c b/src/sys/afssyscalls.c
index 8291a46..b248e69 100644
--- a/src/sys/afssyscalls.c
+++ b/src/sys/afssyscalls.c
@@ -281,23 +281,16 @@
}
-/* PrintInode
+/**
+ * Format a string to print either 32 or 64 bit inode numbers.
*
- * returns a static string used to print either 32 or 64 bit inode numbers.
+ * @param[out] s string buffer
+ * @param[in] ino inode number
+ * @returns pointer to formatted inode number string
*/
-#ifdef AFS_64BIT_IOPS_ENV
-char *
-PrintInode(char *s, Inode ino)
-#else
char *
PrintInode(afs_ino_str_t s, Inode ino)
-#endif
{
- static afs_ino_str_t result;
-
- if (!s)
- s = result;
-
#ifdef AFS_64BIT_IOPS_ENV
(void)sprintf((char *)s, "%llu", ino);
#else
diff --git a/src/sys/afssyscalls.h b/src/sys/afssyscalls.h
index df37c42..ea74bcd 100644
--- a/src/sys/afssyscalls.h
+++ b/src/sys/afssyscalls.h
@@ -88,14 +88,9 @@
#define AFS_INO_STR_LENGTH 32
typedef char afs_ino_str_t[AFS_INO_STR_LENGTH];
-/* Print either 32 or 64 bit inode numbers. char * may be NULL. In which case
- * a local statis is returned.
+/* Format either 32 or 64 bit inode numbers.
*/
-#ifdef AFS_64BIT_IOPS_ENV
-extern char *PrintInode(afs_ino_str_t, Inode);
-#else
-extern char *PrintInode();
-#endif
+extern char *PrintInode(afs_ino_str_t s, Inode ino) AFS_NONNULL((1));
/* Some places in the code assume icreate can return 0 when there's
* an error.
diff --git a/src/sys/iopen.c b/src/sys/iopen.c
index 7c1a961..b9cd3d6 100644
--- a/src/sys/iopen.c
+++ b/src/sys/iopen.c
@@ -37,6 +37,7 @@
int fd, n;
struct stat status;
Inode ino;
+ afs_ino_str_t inode_str;
if (argc != 3)
Usage();
@@ -54,7 +55,7 @@
}
printf("ino=%" AFS_INT64_FMT "\n", ino);
printf("About to iopen(dev=(%d,%d), inode=%s, mode=%d\n",
- major(status.st_dev), minor(status.st_dev), PrintInode(NULL, ino),
+ major(status.st_dev), minor(status.st_dev), PrintInode(inode_str, ino),
O_RDONLY);
fflush(stdout);
fd = IOPEN(status.st_dev, ino, O_RDONLY);
diff --git a/src/vol/namei_ops.c b/src/vol/namei_ops.c
index 463b66b..d2f94bb 100644
--- a/src/vol/namei_ops.c
+++ b/src/vol/namei_ops.c
@@ -3275,19 +3275,17 @@
return code;
}
-/* PrintInode
+/**
+ * Format a string to print inode numbers.
*
- * returns a static string used to print either 32 or 64 bit inode numbers.
+ * @param[out] s string buffer
+ * @param[in] ino inode number
+ * @returns pointer to formatted inode number string
*/
char *
-PrintInode(char *s, Inode ino)
+PrintInode(afs_ino_str_t s, Inode ino)
{
- static afs_ino_str_t result;
- if (!s)
- s = result;
-
snprintf(s, sizeof(afs_ino_str_t), "%llu", (afs_uintmax_t) ino);
-
return s;
}
diff --git a/src/vol/vol-info.c b/src/vol/vol-info.c
index 22ac94a..6423fa8 100644
--- a/src/vol/vol-info.c
+++ b/src/vol/vol-info.c
@@ -331,6 +331,7 @@
struct versionStamp *vsn;
int bad = 0;
int code;
+ afs_ino_str_t inode_str;
vsn = (struct versionStamp *)to;
@@ -341,7 +342,7 @@
if (vsn->magic != magic) {
bad++;
fprintf(stderr, "%s: Inode %s: Bad magic %x (%x): IGNORED\n",
- progname, PrintInode(NULL, ih->ih_ino), vsn->magic, magic);
+ progname, PrintInode(inode_str, ih->ih_ino), vsn->magic, magic);
}
/* Check is conditional, in case caller wants to inspect version himself */
@@ -349,23 +350,23 @@
bad++;
fprintf(stderr, "%s: Inode %s: Bad version %x (%x): IGNORED\n",
progname,
- PrintInode(NULL, ih->ih_ino), vsn->version, version);
+ PrintInode(inode_str, ih->ih_ino), vsn->version, version);
}
if (bad && opt->fixHeader) {
vsn->magic = magic;
vsn->version = version;
printf("Special index inode %s has a bad header. Reconstructing...\n",
- PrintInode(NULL, ih->ih_ino));
+ PrintInode(inode_str, ih->ih_ino));
code = IH_IWRITE(ih, 0, to, size);
if (code != size) {
fprintf(stderr,
"%s: Write failed for inode %s; header left in damaged state\n",
- progname, PrintInode(NULL, ih->ih_ino));
+ progname, PrintInode(inode_str, ih->ih_ino));
}
}
if (!bad && opt->dumpInfo) {
printf("Inode %s: Good magic %x and version %x\n",
- PrintInode(NULL, ih->ih_ino), magic, version);
+ PrintInode(inode_str, ih->ih_ino), magic, version);
}
return 0;
}
@@ -887,6 +888,7 @@
afs_sfsize_t size = -1;
IHandle_t *ih = NULL;
FdHandle_t *fdP = NULL;
+ afs_ino_str_t inode_str;
#ifdef AFS_NAMEI_ENV
namei_t filename;
#endif /* AFS_NAMEI_ENV */
@@ -912,7 +914,7 @@
error:
if (opt->dumpInfo) {
- printf("\t%s inode\t= %s (size = ", name, PrintInode(NULL, inode));
+ printf("\t%s inode\t= %s (size = ", name, PrintInode(inode_str, inode));
if (size != -1) {
printf("%lld)\n", size);
} else {
@@ -1241,6 +1243,7 @@
afs_foff_t total;
ssize_t len;
Inode ino = VNDISK_GET_INO(vdp->vnode);
+ afs_ino_str_t inode_str;
if (!VALID_INO(ino)) {
return;
@@ -1251,10 +1254,10 @@
if (fdP == NULL) {
fprintf(stderr,
"%s: Can't open inode %s error %d (ignored)\n",
- progname, PrintInode(NULL, ino), errno);
+ progname, PrintInode(inode_str, ino), errno);
return;
}
- snprintf(nfile, sizeof nfile, "TmpInode.%s", PrintInode(NULL, ino));
+ snprintf(nfile, sizeof nfile, "TmpInode.%s", PrintInode(inode_str, ino));
ofd = afs_open(nfile, O_CREAT | O_RDWR | O_TRUNC, 0600);
if (ofd < 0) {
fprintf(stderr,
@@ -1276,7 +1279,7 @@
unlink(nfile);
fprintf(stderr,
"%s: Error while reading from inode %s (%d)\n",
- progname, PrintInode(NULL, ino), errno);
+ progname, PrintInode(inode_str, ino), errno);
return;
}
if (len == 0)
@@ -1299,7 +1302,7 @@
IH_RELEASE(ih);
close(ofd);
printf("... Copied inode %s to file %s (%lu bytes)\n",
- PrintInode(NULL, ino), nfile, (unsigned long)total);
+ PrintInode(inode_str, ino), nfile, (unsigned long)total);
}
/**
@@ -1812,6 +1815,7 @@
VnodeDiskObject *vnode = vdp->vnode;
afs_fsize_t fileLength;
Inode ino;
+ afs_ino_str_t inode_str;
ino = VNDISK_GET_INO(vnode);
VNDISK_GET_LEN(fileLength, vnode);
@@ -1828,7 +1832,7 @@
vnode->dataVersion, vnode->cloned, (afs_uintmax_t) fileLength,
vnode->linkCount, vnode->parent);
if (opt->dumpInodeNumber)
- printf(" inode: %s", PrintInode(NULL, ino));
+ printf(" inode: %s", PrintInode(inode_str, ino));
if (opt->dumpDate)
printf(" ServerModTime: %s", date(vnode->serverModifyTime));
#if defined(AFS_NAMEI_ENV)
From a3aac5106beddc5a6f7a09c2d21c2524342aca01 Mon Sep 17 00:00:00 2001
From: Michael Meffie <mmeffie@sinenomine.net>
Date: Mon, 23 Aug 2021 19:43:45 -0400
Subject: [PATCH] pts: Fix stringop-overflow warnings
The ptutil functions are defined to accept bounded character arrays for
user and group names. As of GCC 11, callers which provide the names as
string literals now trigger the stringop-overflow warning, since the
regions provided by the string literals are smaller than the bounded
areas.
error: pr_ChangeEntry accessing 64 bytes in a region of size 1
[-Werror=stringop-overflow=]
note: referencing argument 4 of type char *
error: pr_IsAMemberOf accessing 64 bytes in a region of size 22
[-Werror=stringop-overflow=]
note: referencing argument 2 of type char *
error: pr_CreateUser accessing 64 bytes in a region of size 16
[-Werror=stringop-overflow=]
note: referencing argument 1 of type char *
error: pr_Delete accessing 64 bytes in a region of size 16
[-Werror=stringop-overflow=]
note: referencing argument 1 of type char *
Update the callers in pts and testpt which pass literal strings. Instead
of passing char pointers to literal strings, assign the strings to
prname buffers and pass the prname buffers to the pr utility functions.
Change-Id: I7d8c67aa28d21bb6889ef92a2193a77b54c83cb1
Reviewed-on: https://gerrit.openafs.org/14769
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
---
diff --git a/src/ptserver/pts.c b/src/ptserver/pts.c
index e749714..90d6f16 100644
--- a/src/ptserver/pts.c
+++ b/src/ptserver/pts.c
@@ -663,6 +663,7 @@
idlist ids;
idlist lids;
struct prcheckentry aentry;
+ prname admins = "system:administrators";
if (GetNameOrId(as, &ids, &names))
return PRBADARG;
@@ -728,7 +729,7 @@
}
if (aentry.id == SYSADMINID)
admin = 1;
- else if (!pr_IsAMemberOf(aentry.name, "system:administrators", &flag)) {
+ else if (!pr_IsAMemberOf(aentry.name, admins, &flag)) {
if (flag)
admin = 1;
}
@@ -791,11 +792,12 @@
{
afs_int32 code;
char *name;
+ prname newname = "";
char *owner;
name = as->parms[0].items->data;
owner = as->parms[1].items->data;
- code = pr_ChangeEntry(name, "", 0, owner);
+ code = pr_ChangeEntry(name, newname, 0, owner);
if (code)
afs_com_err(whoami, code, "; unable to change owner of %s to %s", name,
owner);
@@ -808,10 +810,11 @@
afs_int32 code;
char *oldname;
char *newname;
+ prname owner = "";
oldname = as->parms[0].items->data;
newname = as->parms[1].items->data;
- code = pr_ChangeEntry(oldname, newname, 0, "");
+ code = pr_ChangeEntry(oldname, newname, 0, owner);
if (code)
afs_com_err(whoami, code, "; unable to change name of %s to %s", oldname,
newname);
diff --git a/src/ptserver/testpt.c b/src/ptserver/testpt.c
index eaaee48..c359f8f 100644
--- a/src/ptserver/testpt.c
+++ b/src/ptserver/testpt.c
@@ -217,7 +217,7 @@
CreateUser(int u)
{
afs_int32 code;
- char name[16];
+ prname name;
afs_int32 id;
sprintf(name, "%s%d", createPrefix, u);
From fe64ddd3b49bf15222d32d443ff226dd4c2b899e Mon Sep 17 00:00:00 2001
From: Michael Meffie <mmeffie@sinenomine.net>
Date: Tue, 24 Aug 2021 16:40:22 -0400
Subject: [PATCH] ptserver: Fix CreateEntry() mismatched array parameter warning
The CreateEntry() prototype does not match the function definition. The
aname parameter is declared as an unbounded array in the prototype but
is defined as a bounded array. As of GCC 12, a warning is issued for the
mismatch.
error: argument 2 of type char[64] with mismatched bound
[-Werror=array-parameter=]
CreateEntry(struct ubik_trans *at, char aname[PR_MAXNAMELEN], ...
note: previously declared as char[]
extern afs_int32 CreateEntry(struct ubik_trans *at, char aname[], ...
Fix the prototype to declare the 'aname' parameter as a bounded array as
expected for this function.
Change-Id: I6d4dadcdd3f80c2b6f1b17670bbbc1e9e6076559
Reviewed-on: https://gerrit.openafs.org/14768
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
---
diff --git a/src/ptserver/ptprototypes.h b/src/ptserver/ptprototypes.h
index c6a9dab..bb21b6b 100644
--- a/src/ptserver/ptprototypes.h
+++ b/src/ptserver/ptprototypes.h
@@ -72,7 +72,7 @@
afs_int32 loc, afs_int32 aid);
extern int AccessOK(struct ubik_trans *ut, afs_int32 cid,
struct prentry *tentry, int mem, int any);
-extern afs_int32 CreateEntry(struct ubik_trans *at, char aname[],
+extern afs_int32 CreateEntry(struct ubik_trans *at, char aname[PR_MAXNAMELEN],
afs_int32 *aid, afs_int32 idflag,
afs_int32 flag, afs_int32 oid, afs_int32 creator);
extern afs_int32 RemoveFromEntry(struct ubik_trans *at, afs_int32 aid,

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cb5ecedc2e164bea3b48c6b2c9d6f1c36bfde91d068a4c62a9c885df48fe8e6b
size 3770278

View File

@ -1 +0,0 @@
41f99cd6d358a94dc20c1f11fd802c48 openafs-1.8.8.1-doc.tar.bz2

View File

@ -1 +0,0 @@
cb5ecedc2e164bea3b48c6b2c9d6f1c36bfde91d068a4c62a9c885df48fe8e6b openafs-1.8.8.1-doc.tar.bz2

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e7c4bed7075bcd6402e3f0c2d5b9dbe76ad2ee3c5fd5ddc3973a3356ca23ef44
size 14866119

View File

@ -1 +0,0 @@
3be3884e3bf0796c263a2a1aea4f90b5 openafs-1.8.8.1-src.tar.bz2

View File

@ -1 +0,0 @@
e7c4bed7075bcd6402e3f0c2d5b9dbe76ad2ee3c5fd5ddc3973a3356ca23ef44 openafs-1.8.8.1-src.tar.bz2

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cadd1ae737ccead61f2353a791dfd2d319c397b3552aef7fbf57b9ce6dafa879
size 3835423

View File

@ -0,0 +1 @@
3206e88b7921851f627f0ec26103ab89 openafs-stable-1_8_x-doc.tar.bz2

View File

@ -0,0 +1 @@
cadd1ae737ccead61f2353a791dfd2d319c397b3552aef7fbf57b9ce6dafa879 openafs-stable-1_8_x-doc.tar.bz2

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:47b9ac236f5589ed48a6eee194b42ea4254aa6d4e122aceae5b9fd802a2adaf6
size 113262625

View File

@ -0,0 +1 @@
cce4f045f9c7ee1af8f101d25325c52a openafs-stable-1_8_x-src.tar.bz2

View File

@ -0,0 +1 @@
47b9ac236f5589ed48a6eee194b42ea4254aa6d4e122aceae5b9fd802a2adaf6 openafs-stable-1_8_x-src.tar.bz2

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Jun 22 16:13:18 UTC 2022 - Christof Hanke <christof.hanke@mpcdf.mpg.de>
- apply patches adressing:
* Linux-5.17 and 5.18, gcc-11 and 12: fix_gcc_12_linux_5.18.diff
- remove patches from previous commit:
* a714e86.diff and 449d1fa.diff
* gcc-11.diff
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Apr 20 06:24:41 UTC 2022 - Christof Hanke <christof.hanke@mpcdf.mpg.de> Wed Apr 20 06:24:41 UTC 2022 - Christof Hanke <christof.hanke@mpcdf.mpg.de>

View File

@ -57,23 +57,23 @@
# used for %setup only # used for %setup only
# leave upstream tar-balls untouched for integrity checks. # leave upstream tar-balls untouched for integrity checks.
%define upstream_version 1.8.8.1 %define upstream_version stable-1_8_x
Name: openafs Name: openafs
Version: 1.8.8.1 Version: 1.8.8.2~rc1
Release: 0 Release: 0
Summary: OpenAFS Distributed File System Summary: OpenAFS Distributed File System
License: IPL-1.0 License: IPL-1.0
Group: System/Filesystems Group: System/Filesystems
URL: http://www.openafs.org/ URL: http://www.openafs.org/
Source0: http://www.openafs.org/dl/openafs/%{upstream_version}/openafs-%{upstream_version}-src.tar.bz2 Source0: openafs-%{upstream_version}-src.tar.bz2
Source1: http://www.openafs.org/dl/openafs/%{upstream_version}/openafs-%{upstream_version}-doc.tar.bz2 Source1: openafs-%{upstream_version}-doc.tar.bz2
Source2: http://www.openafs.org/dl/openafs/%{upstream_version}/openafs-%{upstream_version}-src.tar.bz2.md5 Source2: openafs-%{upstream_version}-src.tar.bz2.md5
Source3: http://www.openafs.org/dl/openafs/%{upstream_version}/openafs-%{upstream_version}-doc.tar.bz2.md5 Source3: openafs-%{upstream_version}-doc.tar.bz2.md5
Source4: http://www.openafs.org/dl/openafs/%{upstream_version}/openafs-%{upstream_version}-src.tar.bz2.sha256 Source4: openafs-%{upstream_version}-src.tar.bz2.sha256
Source5: http://www.openafs.org/dl/openafs/%{upstream_version}/openafs-%{upstream_version}-doc.tar.bz2.sha256 Source5: openafs-%{upstream_version}-doc.tar.bz2.sha256
Source10: README.SUSE.openafs Source10: README.SUSE.openafs
Source15: logrotate.openafs-server Source15: logrotate.openafs-server
@ -102,15 +102,14 @@ Source57: openafs.ThisCell
Source58: openafs.cacheinfo Source58: openafs.cacheinfo
Source98: kmp_only.files Source98: kmp_only.files
Source99: openafs.changes Source99: openafs.changes
# PATCH-FIX-UPSTREAM KMP build
Patch1: a714e86.diff # PATCH-FIX-UPSTREAM KMP build and gcc
Patch2: 449d1fa.diff # required patches for Linux-5.18 as mentionend on
# PATCH-FIX-UPSTREAM use gcc-11 # https://wiki.openafs.org/devel/Whiteboard/ (June 2022)
Patch3: gcc-11.diff Patch1: fix_gcc_12_linux_5.18.diff
# PATCH-FIX-UPSTREAM make configure detect ncurses 6 correctly # PATCH-FIX-UPSTREAM make configure detect ncurses 6 correctly
Patch4: 4cf7a9a.diff Patch4: 4cf7a9a.diff
#
# GENERAL BuildRequires and Requires # GENERAL BuildRequires and Requires
# #
@ -320,8 +319,6 @@ done
%setup -q -n openafs-%{upstream_version} -T -b 0 -b 1 %setup -q -n openafs-%{upstream_version} -T -b 0 -b 1
%patch1 -p1 %patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1 %patch4 -p1
./regen.sh ./regen.sh