diff --git a/backport-cifs-utils-work-around-missing-krb5_free_string-in-H.patch b/backport-cifs-utils-work-around-missing-krb5_free_string-in-H.patch new file mode 100644 index 0000000000000000000000000000000000000000..9d398d10ae54dd08f556aa9119d1c2b411bdfb9f --- /dev/null +++ b/backport-cifs-utils-work-around-missing-krb5_free_string-in-H.patch @@ -0,0 +1,58 @@ +From 5e5aa507f4c4954ed537a7dfc75cf69915727757 Mon Sep 17 00:00:00 2001 +From: atheik +Date: Sat, 5 Mar 2022 00:24:49 +0200 +Subject: [PATCH] cifs-utils: work around missing krb5_free_string in Heimdal + +The krb5_free_string function is not present in Heimdal and instead +krb5_xfree should be used for freeing the string allocation done by +krb5_cc_get_full_name. Heimdal documentation does specify that +krb5_xfree should be used here and krb5_unparse_name is freed with +just free. + +Conflict:NA +Reference:https://git.samba.org/cifs-utils.git/?p=cifs-utils.git;a=commit;h=5e5aa507f4c4954ed537a7dfc75cf69915727757 + +Signed-off-by: atheik +--- + cifs.upcall.c | 8 ++++++++ + configure.ac | 5 +++++ + 2 files changed, 13 insertions(+) + +diff --git a/cifs.upcall.c b/cifs.upcall.c +index 7a8c374..bf4eb5d 100644 +--- a/cifs.upcall.c ++++ b/cifs.upcall.c +@@ -190,6 +190,14 @@ static void krb5_free_unparsed_name(krb5_context context, char *val) + } + #endif + ++#if !defined(HAVE_KRB5_FREE_STRING) /* Heimdal */ ++static void krb5_free_string(krb5_context context, char *val) ++{ ++ (void)context; ++ krb5_xfree(val); ++} ++#endif ++ + #if !defined(HAVE_KRB5_AUTH_CON_GETSENDSUBKEY) /* Heimdal */ + static krb5_error_code + krb5_auth_con_getsendsubkey(krb5_context context, +diff --git a/configure.ac b/configure.ac +index 19fb3d0..2b1aae6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -256,6 +256,11 @@ if test $enable_cifsupcall != "no"; then + AC_CHECK_FUNCS([krb5_auth_con_setaddrs krb5_auth_con_set_req_cksumtype]) + fi + ++# determine how to free a string allocated by a krb5 function ++if test $enable_cifsupcall != "no"; then ++ AC_CHECK_FUNCS([krb5_free_string]) ++fi ++ + if test $enable_systemd != "no"; then + AC_DEFINE(ENABLE_SYSTEMD, 1, [Enable systemd specific behavior for mount.cifs]) + fi +-- +2.27.0 + diff --git a/backport-setcifsacl-fix-comparison-of-actions-reported-by-cov.patch b/backport-setcifsacl-fix-comparison-of-actions-reported-by-cov.patch new file mode 100644 index 0000000000000000000000000000000000000000..f29cdc5562c3fe323c8b841e5f94d4a0271e3e86 --- /dev/null +++ b/backport-setcifsacl-fix-comparison-of-actions-reported-by-cov.patch @@ -0,0 +1,29 @@ +From 4ad2c50f8f22968abe84a84ef49d37806731b20e Mon Sep 17 00:00:00 2001 +From: Alexander Bokovoy +Date: Wed, 16 Feb 2022 13:58:24 +0200 +Subject: [PATCH] setcifsacl: fix comparison of actions reported by covscan + +Conflict:NA +Reference:https://git.samba.org/cifs-utils.git/?p=cifs-utils.git;a=commit;h=4ad2c50f8f22968abe84a84ef49d37806731b20e + +Signed-off-by: Alexander Bokovoy +--- + setcifsacl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setcifsacl.c b/setcifsacl.c +index 9840b14..c0ecd41 100644 +--- a/setcifsacl.c ++++ b/setcifsacl.c +@@ -1497,7 +1497,7 @@ cifsacl: + + numfaces = get_numfaces((struct cifs_ntsd *)attrval, attrlen, + &aclptr, ace_kind); +- if (!numfaces && (maction != ActAdd || maction != ActAddReorder)) { ++ if (!numfaces && (maction != ActAdd && maction != ActAddReorder)) { + /* if we are not adding aces */ + fprintf(stderr, "%s: Empty DACL\n", __func__); + goto setcifsacl_facenum_ret; +-- +2.27.0 + diff --git a/cifs-utils.spec b/cifs-utils.spec index db20fde21bd318b4afc84d97be97083fe0d127f6..6ccb87d905a278b6bbd014aedd8b11ef4b64323c 100644 --- a/cifs-utils.spec +++ b/cifs-utils.spec @@ -1,6 +1,6 @@ Name: cifs-utils Version: 7.0 -Release: 1 +Release: 2 Summary: Utilities for doing and managing mounts of the Linux CIFS filesystem License: GPLv3+ URL: http://linux-cifs.samba.org/cifs-utils/ @@ -12,6 +12,8 @@ Provides: pam_cifscreds Obsoletes: pam_cifscreds Requires: keyutils +Patch6001: backport-setcifsacl-fix-comparison-of-actions-reported-by-cov.patch +Patch6002: backport-cifs-utils-work-around-missing-krb5_free_string-in-H.patch %description The in-kernel CIFS filesystem is generally the preferred method for mounting @@ -76,6 +78,9 @@ install -m 644 contrib/request-key.d/cifs.spnego.conf %{buildroot}%{_sysconfdir} %{_mandir}/man8/* %changelog +* Tue Jun 06 2023 fangchuangchuang - 7.0-2 +- sync patches to fix problem. + * Sat Feb 11 2023 suweifeng - 7.0-1 - upgarde to version 7.0