diff --git a/0003-fix-compiler-warnings-in-mount.cifs.patch b/0003-fix-compiler-warnings-in-mount.cifs.patch new file mode 100644 index 0000000000000000000000000000000000000000..ab7af6319eced9b8fc52b991d1134be64ffac7bf --- /dev/null +++ b/0003-fix-compiler-warnings-in-mount.cifs.patch @@ -0,0 +1,105 @@ +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..88bc5a6 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, "Options string too long\n"); ++ return EX_USAGE; ++ } + out_len = strlen(out); + } + +-- +2.43.0 + diff --git a/cifs-utils.spec b/cifs-utils.spec index 2150dc3b52851dd68587333970647a4c20734832..20a4a58fdad15e8921590bed4cc5a95c6e6e43dc 100644 --- a/cifs-utils.spec +++ b/cifs-utils.spec @@ -1,6 +1,6 @@ Name: cifs-utils Version: 7.0 -Release: 4 +Release: 5 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-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 +* Wed Oct 15 2025 zhangyaqi - 7.0-5 +- Fix compiler warnings in mount.cifs + * Thu Jul 3 2025 lvyy - 7.0-4 - Remove the percent sign in the changelog