diff --git a/0011-fix-compiler-warnings-in-mount.cifs.patch b/0011-fix-compiler-warnings-in-mount.cifs.patch new file mode 100644 index 0000000000000000000000000000000000000000..4a0bb74abc468b34c2a4c9f44e3e15bee120788c --- /dev/null +++ b/0011-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 +Reference:https://git.samba.org/?p=cifs-utils.git;a=patch;h=3b398432ced678dac232b27a59ea90b172933b9b +--- + mount.cifs.c | 38 +++++++++++++++++++++++++++++++------- + 1 file changed, 31 insertions(+), 7 deletions(-) + +diff --git a/mount.cifs.c b/mount.cifs.c +index 7f2bd47..73b7a6e 100644 +--- a/mount.cifs.c ++++ b/mount.cifs.c +@@ -813,7 +813,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 */ +@@ -1198,7 +1198,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 (got_cruid) { +@@ -1214,7 +1218,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) { +@@ -1230,7 +1238,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) { +@@ -1246,7 +1258,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) { +@@ -1262,7 +1278,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) { +@@ -1278,7 +1298,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 ae1488a6978476ed8a1c46518ab445fec3af0574..7644968a6e24ab28937f77fca5b1d995708ef2c6 100644 --- a/cifs-utils.spec +++ b/cifs-utils.spec @@ -1,6 +1,6 @@ Name: cifs-utils Version: 6.10 -Release: 6 +Release: 7 Summary: Utilities for doing and managing mounts of the Linux CIFS filesystem License: GPLv3+ URL: http://linux-cifs.samba.org/cifs-utils/ @@ -17,6 +17,7 @@ Patch7: 0007-CVE-2022-27239.patch Patch8: 0008-CVE-2022-29869.patch Patch9: 0009-mount.cifs-fix-crash-when-mount-point-does-not-exist.patch Patch10: 0010-cifs.upcall-fix-regression-in-kerberos-mount.patch +Patch11: 0011-fix-compiler-warnings-in-mount.cifs.patch BuildRequires: python3-docutils libcap-ng-devel libtalloc-devel krb5-devel keyutils-libs-devel autoconf BuildRequires: automake libwbclient-devel pam-devel python3-samba pkg-config fdupes gcc @@ -89,6 +90,9 @@ install -m 644 contrib/request-key.d/cifs.spnego.conf %{buildroot}%{_sysconfdir} %{_mandir}/man8/* %changelog +* Mon Oct 13 2025 zhangyaqi - 6.10-7 +- backport patch fix compiler warnings in mount.cifs + * Thu Mar 30 2023 Zhiqiang Liu - 6.10-6 - backport some patches