diff --git a/0003-mount-cifs-fix-compiler-warnings-in-mount.cifs.patch b/0003-mount-cifs-fix-compiler-warnings-in-mount.cifs.patch new file mode 100644 index 0000000000000000000000000000000000000000..acacd8fb8fa559453fa21ebd32414dcd75f15330 --- /dev/null +++ b/0003-mount-cifs-fix-compiler-warnings-in-mount.cifs.patch @@ -0,0 +1,106 @@ +From 3b398432ced678dac232b27a59ea90b172933b9b Mon Sep 17 00:00:00 2001 +From: Meetakshi Setiya +Date: Fri, 6 Dec 2024 01:58:50 -0500 +Subject: [PATCH] Fix compiler warnings in mount.cifs + +Signed-off-by: Meetakshi Setiya +Signed-off-by: Steve French + +--- + mount.cifs.c | 38 +++++++++++++++++++++++++++++++------- + 1 file changed, 31 insertions(+), 7 deletions(-) + +diff --git a/mount.cifs.c b/mount.cifs.c +index 2278995..41059ed 100644 +--- a/mount.cifs.c ++++ b/mount.cifs.c +@@ -830,7 +830,7 @@ parse_options(const char *data, struct parsed_mount_info *parsed_info) + * wide +1 for NULL, and +1 for good measure + */ + char txtbuf[22]; +- unsigned long long snapshot; ++ unsigned long long snapshot = 0; + struct tm tm; + + /* make sure we're starting from beginning */ +@@ -1218,7 +1218,11 @@ nocopy: + strlcat(out, ",", MAX_OPTIONS_LEN); + out_len++; + } +- snprintf(out + out_len, word_len + 5, "uid=%s", txtbuf); ++ rc = snprintf(out + out_len, word_len + 5, "uid=%s", txtbuf); ++ if (rc < 0) { ++ fprintf(stderr, "Error in creating mount string\n"); ++ return EX_SYSERR; ++ } + out_len = strlen(out); + } + if (parsed_info->is_krb5 && parsed_info->sudo_uid) { +@@ -1238,7 +1242,11 @@ nocopy: + strlcat(out, ",", MAX_OPTIONS_LEN); + out_len++; + } +- snprintf(out + out_len, word_len + 7, "cruid=%s", txtbuf); ++ rc = snprintf(out + out_len, word_len + 7, "cruid=%s", txtbuf); ++ if (rc < 0) { ++ fprintf(stderr, "Error in creating mount string\n"); ++ return EX_SYSERR; ++ } + out_len = strlen(out); + } + if (got_gid) { +@@ -1254,7 +1262,11 @@ nocopy: + strlcat(out, ",", MAX_OPTIONS_LEN); + out_len++; + } +- snprintf(out + out_len, word_len + 5, "gid=%s", txtbuf); ++ rc = snprintf(out + out_len, word_len + 5, "gid=%s", txtbuf); ++ if (rc < 0) { ++ fprintf(stderr, "Error in creating mount string\n"); ++ return EX_SYSERR; ++ } + out_len = strlen(out); + } + if (got_bkupuid) { +@@ -1270,7 +1282,11 @@ nocopy: + strlcat(out, ",", MAX_OPTIONS_LEN); + out_len++; + } +- snprintf(out + out_len, word_len + 11, "backupuid=%s", txtbuf); ++ rc = snprintf(out + out_len, word_len + 11, "backupuid=%s", txtbuf); ++ if (rc < 0) { ++ fprintf(stderr, "Error in creating mount string\n"); ++ return EX_SYSERR; ++ } + out_len = strlen(out); + } + if (got_bkupgid) { +@@ -1286,7 +1302,11 @@ nocopy: + strlcat(out, ",", MAX_OPTIONS_LEN); + out_len++; + } +- snprintf(out + out_len, word_len + 11, "backupgid=%s", txtbuf); ++ rc = snprintf(out + out_len, word_len + 11, "backupgid=%s", txtbuf); ++ if (rc < 0) { ++ fprintf(stderr, "Error in creating mount string\n"); ++ return EX_SYSERR; ++ } + out_len = strlen(out); + } + if (got_snapshot) { +@@ -1302,7 +1322,11 @@ nocopy: + strlcat(out, ",", MAX_OPTIONS_LEN); + out_len++; + } +- snprintf(out + out_len, word_len + 10, "snapshot=%s", txtbuf); ++ rc = snprintf(out + out_len, word_len + 10, "snapshot=%s", txtbuf); ++ if (rc < 0) { ++ fprintf(stderr, "Error in creating mount string\n"); ++ return EX_SYSERR; ++ } + out_len = strlen(out); + } + +-- +2.43.0 + diff --git a/cifs-utils.spec b/cifs-utils.spec index 037138cf1047c62cdd78296181386df5c926fb50..fe728a9a9f1de242853a48379f7cfcdd02f81bd3 100644 --- a/cifs-utils.spec +++ b/cifs-utils.spec @@ -1,6 +1,6 @@ Name: cifs-utils Version: 7.0 -Release: 3 +Release: 4 Summary: Utilities for doing and managing mounts of the Linux CIFS filesystem License: GPLv3+ URL: http://linux-cifs.samba.org/cifs-utils/ @@ -14,6 +14,7 @@ Requires: keyutils Patch0: 0001-cifs.upcall-fix-UAF-in-get_cachename_from_process_en.patch Patch1: 0002-cifs-utils-Make-automake-treat-sbin-as-exec-not-data.patch +Patch2: 0003-mount-cifs-fix-compiler-warnings-in-mount.cifs.patch %description The in-kernel CIFS filesystem is generally the preferred method for mounting @@ -78,6 +79,9 @@ install -m 644 contrib/request-key.d/cifs.spnego.conf %{buildroot}%{_sysconfdir} %{_mandir}/man8/* %changelog +* Mon Oct 13 2025 zhangyaqi - 7.0-4 +- Fix compiler warnings in mount.cifs + * Fri Jun 21 2024 liuh - 7.0-3 - sync patch from community