diff --git a/nfs-utils-2.5.4-rpcpipefs-warn.patch b/nfs-utils-2.5.4-rpcpipefs-warn.patch new file mode 100644 index 0000000..13bcb3f --- /dev/null +++ b/nfs-utils-2.5.4-rpcpipefs-warn.patch @@ -0,0 +1,31 @@ +commit 7f8463fe702174bd613df9d308cc899af25ae02e +Author: Steve Dickson +Date: Wed Feb 23 15:19:51 2022 -0500 + + systemd: Fix format-overflow warning + + rpc-pipefs-generator.c:35:23: error: '%s' directive output between 0 and 2147483653 bytes may exceed minimum required size of 4095 [-Werror=format-overflow=] + 35 | sprintf(path, "%s/%s", dirname, pipefs_unit); + | ^ + + Signed-off-by: Steve Dickson + +diff --git a/systemd/rpc-pipefs-generator.c b/systemd/rpc-pipefs-generator.c +index c24db567..7b2bb4f7 100644 +--- a/systemd/rpc-pipefs-generator.c ++++ b/systemd/rpc-pipefs-generator.c +@@ -28,11 +28,12 @@ static int generate_mount_unit(const char *pipefs_path, const char *pipefs_unit, + { + char *path; + FILE *f; ++ size_t size = (strlen(dirname) + 1 + strlen(pipefs_unit)); + +- path = malloc(strlen(dirname) + 1 + strlen(pipefs_unit)); ++ path = malloc(size); + if (!path) + return 1; +- sprintf(path, "%s/%s", dirname, pipefs_unit); ++ snprintf(path, size, "%s/%s", dirname, pipefs_unit); + f = fopen(path, "w"); + if (!f) + { diff --git a/nfs-utils.spec b/nfs-utils.spec index 0e0763b..3dca725 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -28,6 +28,7 @@ Patch006: nfs-utils-2.5.4-rpcctl.patch # RHEL9.1 # Patch007: nfs-utils-2.5.4-nfsman-maxconnect.patch +Patch008: nfs-utils-2.5.4-rpcpipefs-warn.patch Patch100: nfs-utils-1.2.1-statdpath-man.patch Patch101: nfs-utils-1.2.1-exp-subtree-warn-off.patch @@ -459,8 +460,9 @@ fi %{_mandir}/*/nfsiostat.8.gz %changelog -* Wed Jul 13 2022 Steve Dickson 2.5.4-11 +* Sat Jul 16 2022 Steve Dickson 2.5.4-11 - nfs.man: adding new mount option max_connect (bz 2106848) +- systemd: Fix format-overflow warning (bz 2106896) * Mon Feb 28 2022 Steve Dickson 2.5.4-10 - Added the rpcctl command (bz 2059245)