From 095b1744378a0cb5e4f57fd2630298e88fbed368 Mon Sep 17 00:00:00 2001 From: AlmaLinux RelEng Bot Date: Mon, 30 Mar 2026 11:17:39 -0400 Subject: [PATCH] import CS cifs-utils-7.5-1.el9 --- .cifs-utils.metadata | 2 +- .gitignore | 2 +- SOURCES/cifs.upcall-Adjust-log-level.patch | 41 +++++++++++ ...call-add-option-to-enable-debug-logs.patch | 68 +++++++++++++++++++ SOURCES/docs-Enable-debug-logs.patch | 41 +++++++++++ SPECS/cifs-utils.spec | 12 +++- 6 files changed, 163 insertions(+), 3 deletions(-) create mode 100644 SOURCES/cifs.upcall-Adjust-log-level.patch create mode 100644 SOURCES/cifs.upcall-add-option-to-enable-debug-logs.patch create mode 100644 SOURCES/docs-Enable-debug-logs.patch diff --git a/.cifs-utils.metadata b/.cifs-utils.metadata index 14f2e5a..d05d745 100644 --- a/.cifs-utils.metadata +++ b/.cifs-utils.metadata @@ -1 +1 @@ -146b99b40e7fb58b7e65fa6b8649548517f30329 SOURCES/cifs-utils-7.2.tar.bz2 +75c4eadf2b789ba0e504b4991f3284e15bf9266a SOURCES/cifs-utils-7.5.tar.bz2 diff --git a/.gitignore b/.gitignore index c066f10..e849fb2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/cifs-utils-7.2.tar.bz2 +SOURCES/cifs-utils-7.5.tar.bz2 diff --git a/SOURCES/cifs.upcall-Adjust-log-level.patch b/SOURCES/cifs.upcall-Adjust-log-level.patch new file mode 100644 index 0000000..8732668 --- /dev/null +++ b/SOURCES/cifs.upcall-Adjust-log-level.patch @@ -0,0 +1,41 @@ +From 927123ede36fab4a68aea6f6a3495ad909430ed1 Mon Sep 17 00:00:00 2001 +From: Pierguido Lambri +Date: Fri, 30 Jan 2026 14:11:28 +0000 +Subject: [PATCH 3/3] cifs.upcall: Adjust log level + +Because now only error message are logged, let's switch some messages +from DEBUG to ERROR level. +This will help see when an error occurred with cifs.upcall and +eventually turn on the debug mode. + +Signed-off-by: Pierguido Lambri +Reviewed-by: Paulo Alcantara (Red Hat) +--- + cifs.upcall.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/cifs.upcall.c b/cifs.upcall.c +index b57a48c743e4..9d0eecf3aa11 100644 +--- a/cifs.upcall.c ++++ b/cifs.upcall.c +@@ -1618,7 +1618,7 @@ int main(const int argc, char *const argv[]) + __func__); + } else { + if (!get_tgt_time(ccache)) { +- syslog(LOG_DEBUG, "%s: valid TGT is not present in credential cache", ++ syslog(LOG_ERR, "%s: valid TGT is not present in credential cache", + __func__); + krb5_cc_close(context, ccache); + ccache = NULL; +@@ -1721,7 +1721,7 @@ retry_new_hostname: + } + + if (rc) { +- syslog(LOG_DEBUG, "Unable to obtain service ticket"); ++ syslog(LOG_ERR, "Unable to obtain service ticket"); + goto out; + } + +-- +2.52.0 + diff --git a/SOURCES/cifs.upcall-add-option-to-enable-debug-logs.patch b/SOURCES/cifs.upcall-add-option-to-enable-debug-logs.patch new file mode 100644 index 0000000..8b8f7af --- /dev/null +++ b/SOURCES/cifs.upcall-add-option-to-enable-debug-logs.patch @@ -0,0 +1,68 @@ +From 3047b9ccefdcf6327bf060ebf0d40864c5b1a11e Mon Sep 17 00:00:00 2001 +From: Pierguido Lambri +Date: Fri, 30 Jan 2026 14:11:26 +0000 +Subject: [PATCH 1/3] cifs.upcall: add option to enable debug logs + +cifs.upcall uses two levels of logs, DEBUG and ERR. +However, when using systemd, these logs will always be recorded. +When the system does a lot of upcalls, the journal could be filled +with debug logs, which may not be useful at that time. +Added then a new option '-d' to enable debug logs only when needed. +This will set a logmask up to LOG_DEBUG instead of the default +of LOG_ERR, thus reducing the amount of logs when no debug is needed. + +Signed-off-by: Pierguido Lambri +Reviewed-by: Paulo Alcantara (Red Hat) +--- + cifs.upcall.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/cifs.upcall.c b/cifs.upcall.c +index 69e27a34f637..b57a48c743e4 100644 +--- a/cifs.upcall.c ++++ b/cifs.upcall.c +@@ -1356,10 +1356,11 @@ lowercase_string(char *c) + + static void usage(void) + { +- fprintf(stderr, "Usage: %s [ -K /path/to/keytab] [-k /path/to/krb5.conf] [-E] [-t] [-v] [-l] [-e nsecs] key_serial\n", prog); ++ fprintf(stderr, "Usage: %s [ -K /path/to/keytab] [-k /path/to/krb5.conf] [-d] [-E] [-t] [-v] [-l] [-e nsecs] key_serial\n", prog); + } + + static const struct option long_options[] = { ++ {"debug", 0, NULL, 'd'}, + {"no-env-probe", 0, NULL, 'E'}, + {"krb5conf", 1, NULL, 'k'}, + {"legacy-uid", 0, NULL, 'l'}, +@@ -1379,6 +1380,7 @@ int main(const int argc, char *const argv[]) + size_t datalen; + long rc = 1; + int c; ++ int mask; + bool try_dns = false, legacy_uid = false , env_probe = true; + char *buf; + char hostbuf[NI_MAXHOST], *host; +@@ -1395,12 +1397,19 @@ int main(const int argc, char *const argv[]) + hostbuf[0] = '\0'; + + openlog(prog, 0, LOG_DAEMON); ++ mask = LOG_UPTO(LOG_ERR); ++ setlogmask(mask); + +- while ((c = getopt_long(argc, argv, "cEk:K:ltve:", long_options, NULL)) != -1) { ++ while ((c = getopt_long(argc, argv, "cdEk:K:ltve:", long_options, NULL)) != -1) { + switch (c) { + case 'c': + /* legacy option -- skip it */ + break; ++ case 'd': ++ /* enable debug logs */ ++ mask = LOG_UPTO(LOG_DEBUG); ++ setlogmask(mask); ++ break; + case 'E': + /* skip probing initiating process env */ + env_probe = false; +-- +2.52.0 + diff --git a/SOURCES/docs-Enable-debug-logs.patch b/SOURCES/docs-Enable-debug-logs.patch new file mode 100644 index 0000000..08c829b --- /dev/null +++ b/SOURCES/docs-Enable-debug-logs.patch @@ -0,0 +1,41 @@ +From 224512b9e62c886fd8d9802bc50a7702c4fe4517 Mon Sep 17 00:00:00 2001 +From: Pierguido Lambri +Date: Fri, 30 Jan 2026 14:11:27 +0000 +Subject: [PATCH 2/3] docs: Enable debug logs + +Documented a new option '-d' to enable debug logs. +By default only error logs are enabled, with this new option +debug logs can be enabled when needed. + +Signed-off-by: Pierguido Lambri +Reviewed-by: Paulo Alcantara (Red Hat) +--- + cifs.upcall.rst.in | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/cifs.upcall.rst.in b/cifs.upcall.rst.in +index 09d0503591d6..895efc53ef50 100644 +--- a/cifs.upcall.rst.in ++++ b/cifs.upcall.rst.in +@@ -11,7 +11,7 @@ Userspace upcall helper for Common Internet File System (CIFS) + SYNOPSIS + ******** + +- cifs.upcall [--trust-dns|-t] [--version|-v] [--legacy-uid|-l] ++ cifs.upcall [--trust-dns|-t] [--version|-v] [--legacy-uid|-l] [--debug|-d] + [--krb5conf=/path/to/krb5.conf|-k /path/to/krb5.conf] + [--keytab=/path/to/keytab|-K /path/to/keytab] [--expire|-e nsecs] {keyid} + +@@ -38,6 +38,9 @@ OPTIONS + -c + This option is deprecated and is currently ignored. + ++--debug|-d ++ Enable debug logs. By default no debug messages are logged, only errors. ++ + --no-env-probe|-E + Normally, ``cifs.upcall`` will probe the environment variable space of + the process that initiated the upcall in order to fetch the value of +-- +2.52.0 + diff --git a/SPECS/cifs-utils.spec b/SPECS/cifs-utils.spec index bba8740..6d4e2cd 100644 --- a/SPECS/cifs-utils.spec +++ b/SPECS/cifs-utils.spec @@ -14,7 +14,7 @@ %global bash_completion_dir %(pkg-config --variable=completionsdir bash-completion || echo /etc/bash_completion.d) Name: cifs-utils -Version: 7.2 +Version: 7.5 Release: %autorelease Summary: Utilities for mounting and managing CIFS mounts @@ -34,6 +34,10 @@ Recommends: %{name}-info%{?_isa} = %{version}-%{release} Source0: https://download.samba.org/pub/linux-cifs/cifs-utils/%{name}-%{version}.tar.bz2 +Patch0: cifs.upcall-add-option-to-enable-debug-logs.patch +Patch1: docs-Enable-debug-logs.patch +Patch2: cifs.upcall-Adjust-log-level.patch + %description The SMB/CIFS protocol is a standard file sharing protocol widely deployed on Microsoft Windows machines. This package contains tools for mounting @@ -140,6 +144,12 @@ about CIFS mount. %changelog ## START: Generated by rpmautospec +* Tue Feb 03 2026 Paulo Alcantara - 7.5-1 +- resolves: RHEL-127499 - Enable debug logs in cifs.upcall + +* Wed Nov 26 2025 Paulo Alcantara - 7.4-1 +- resolves: RHEL-110765 - fix regression with cifscreds(1) + * Fri Mar 07 2025 Paulo Alcantara - 7.2-1 - resolves: RHEL-82680 - Update to version 7.2