Compare commits
No commits in common. "c8" and "c8-beta" have entirely different histories.
@ -1,36 +0,0 @@
|
|||||||
From a1feaf8c26433325dd939a4bb0c47b50b44cfe2d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Evan Goode <mail@evangoo.de>
|
|
||||||
Date: Mon, 13 Mar 2023 14:50:41 -0400
|
|
||||||
Subject: [PATCH 48/49] smtplib: catch OSError, not SMTPException
|
|
||||||
|
|
||||||
Upstream commit: aab7defca4fd827ede02336e5a0cf95e8691fb74
|
|
||||||
|
|
||||||
Some, but not all, types of connection error are caught by smtplib and
|
|
||||||
reraised as an smtplib.SMTPException. Notably, TimeoutError,
|
|
||||||
socket.gaierror (name resolution failure), and ConnectionRefusedError
|
|
||||||
and are not caught.
|
|
||||||
|
|
||||||
The more generic OSError should be caught here instead.
|
|
||||||
|
|
||||||
Resolves #1905
|
|
||||||
Resolves: https://issues.redhat.com/browse/RHEL-46030
|
|
||||||
---
|
|
||||||
dnf/automatic/emitter.py | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/dnf/automatic/emitter.py b/dnf/automatic/emitter.py
|
|
||||||
index 4aea4b02..648f1a1d 100644
|
|
||||||
--- a/dnf/automatic/emitter.py
|
|
||||||
+++ b/dnf/automatic/emitter.py
|
|
||||||
@@ -106,7 +106,7 @@ class EmailEmitter(Emitter):
|
|
||||||
smtp = smtplib.SMTP(self._conf.email_host, timeout=300)
|
|
||||||
smtp.sendmail(email_from, email_to, message.as_string())
|
|
||||||
smtp.close()
|
|
||||||
- except smtplib.SMTPException as exc:
|
|
||||||
+ except OSError as exc:
|
|
||||||
msg = _("Failed to send an email via '%s': %s") % (
|
|
||||||
self._conf.email_host, exc)
|
|
||||||
logger.error(msg)
|
|
||||||
--
|
|
||||||
2.48.1
|
|
||||||
|
|
@ -1,87 +0,0 @@
|
|||||||
From 201675a56b89d6f3543ce5d734deebe6c4d9049f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Marek Blaha <mblaha@redhat.com>
|
|
||||||
Date: Thu, 17 Oct 2024 13:30:21 +0200
|
|
||||||
Subject: [PATCH 49/49] automatic: Check availability of config file
|
|
||||||
|
|
||||||
If a configuration file is explicitly specified on the command line,
|
|
||||||
ensure that it exists and is readable. If the file is not found, notify
|
|
||||||
the user immediately and terminate the process.
|
|
||||||
|
|
||||||
This resolves issues where users may run dnf-automatic with unrecognized
|
|
||||||
positional arguments, such as `dnf-automatic install`.
|
|
||||||
|
|
||||||
The most natural approach to handle a non-existing config file would be
|
|
||||||
by catching the exception thrown by the `read()` method of the
|
|
||||||
`libdnf.conf.ConfigParser` class. Unfortunately, the Python bindings
|
|
||||||
override the `read()` method at the SWIG level, causing it to suppress any
|
|
||||||
potentially raised IOError.
|
|
||||||
For details see this section of the commit
|
|
||||||
https://github.com/rpm-software-management/libdnf/commit/8f1fedf8551b72d6bc24018f5980714b3a103aeb
|
|
||||||
|
|
||||||
def ConfigParser__newRead(self, filenames):
|
|
||||||
parsedFNames = []
|
|
||||||
try:
|
|
||||||
if isinstance(filenames, str) or isinstance(filenames, unicode):
|
|
||||||
filenames = [filenames]
|
|
||||||
except NameError:
|
|
||||||
pass
|
|
||||||
for fname in filenames:
|
|
||||||
try:
|
|
||||||
self.readFileName(fname)
|
|
||||||
parsedFNames.append(fname)
|
|
||||||
except IOError:
|
|
||||||
pass
|
|
||||||
except Exception as e:
|
|
||||||
raise RuntimeError("Parsing file '%s' failed: %s" % (fname, str(e)))
|
|
||||||
return parsedFNames
|
|
||||||
ConfigParser.read = ConfigParser__newRead
|
|
||||||
|
|
||||||
Resolves: https://issues.redhat.com/browse/RHEL-46030
|
|
||||||
---
|
|
||||||
dnf/automatic/main.py | 16 ++++++++++++++--
|
|
||||||
1 file changed, 14 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/dnf/automatic/main.py b/dnf/automatic/main.py
|
|
||||||
index ccd9ab64..3d73ffce 100644
|
|
||||||
--- a/dnf/automatic/main.py
|
|
||||||
+++ b/dnf/automatic/main.py
|
|
||||||
@@ -73,7 +73,7 @@ def build_emitters(conf):
|
|
||||||
|
|
||||||
def parse_arguments(args):
|
|
||||||
parser = argparse.ArgumentParser()
|
|
||||||
- parser.add_argument('conf_path', nargs='?', default=dnf.const.CONF_AUTOMATIC_FILENAME)
|
|
||||||
+ parser.add_argument('conf_path', nargs='?')
|
|
||||||
parser.add_argument('--timer', action='store_true')
|
|
||||||
parser.add_argument('--installupdates', dest='installupdates', action='store_true')
|
|
||||||
parser.add_argument('--downloadupdates', dest='downloadupdates', action='store_true')
|
|
||||||
@@ -88,7 +88,17 @@ def parse_arguments(args):
|
|
||||||
class AutomaticConfig(object):
|
|
||||||
def __init__(self, filename=None, downloadupdates=None,
|
|
||||||
installupdates=None):
|
|
||||||
- if not filename:
|
|
||||||
+ if filename:
|
|
||||||
+ # Specific config file was explicitely requested. Check that it exists
|
|
||||||
+ # and is readable.
|
|
||||||
+ if os.access(filename, os.F_OK):
|
|
||||||
+ if not os.access(filename, os.R_OK):
|
|
||||||
+ raise dnf.exceptions.Error(
|
|
||||||
+ "Configuration file \"{}\" is not readable.".format(filename))
|
|
||||||
+ else:
|
|
||||||
+ raise dnf.exceptions.Error(
|
|
||||||
+ "Configuration file \"{}\" not found.".format(filename))
|
|
||||||
+ else:
|
|
||||||
filename = dnf.const.CONF_AUTOMATIC_FILENAME
|
|
||||||
self.commands = CommandsConfig()
|
|
||||||
self.email = EmailConfig()
|
|
||||||
@@ -295,6 +305,8 @@ def wait_for_network(repos, timeout):
|
|
||||||
|
|
||||||
def main(args):
|
|
||||||
(opts, parser) = parse_arguments(args)
|
|
||||||
+ conf = None
|
|
||||||
+ emitters = None
|
|
||||||
|
|
||||||
try:
|
|
||||||
conf = AutomaticConfig(opts.conf_path, opts.downloadupdates,
|
|
||||||
--
|
|
||||||
2.48.1
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
From 75c59dcb38d5672ffcfea9bb4cc999ab30294fe9 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Marek Blaha <mblaha@redhat.com>
|
|
||||||
Date: Wed, 29 Jan 2025 13:29:34 +0100
|
|
||||||
Subject: [PATCH] Fix missing import in automatic
|
|
||||||
|
|
||||||
Fixes omitted `import os` in previous commit.
|
|
||||||
---
|
|
||||||
dnf/automatic/main.py | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
diff --git a/dnf/automatic/main.py b/dnf/automatic/main.py
|
|
||||||
index 3d73ffce..9d680e9e 100644
|
|
||||||
--- a/dnf/automatic/main.py
|
|
||||||
+++ b/dnf/automatic/main.py
|
|
||||||
@@ -24,6 +24,7 @@ from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
import logging
|
|
||||||
+import os
|
|
||||||
import random
|
|
||||||
import socket
|
|
||||||
import time
|
|
||||||
--
|
|
||||||
2.48.1
|
|
||||||
|
|
@ -66,7 +66,7 @@ It supports RPMs, modules and comps groups & environments.
|
|||||||
|
|
||||||
Name: dnf
|
Name: dnf
|
||||||
Version: 4.7.0
|
Version: 4.7.0
|
||||||
Release: 21%{?dist}
|
Release: 20%{?dist}
|
||||||
Summary: %{pkg_summary}
|
Summary: %{pkg_summary}
|
||||||
# For a breakdown of the licensing, see PACKAGE-LICENSING
|
# For a breakdown of the licensing, see PACKAGE-LICENSING
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
@ -123,9 +123,6 @@ Patch0044: 0044-Document-symbols-in-dnf-history-list-output.patch
|
|||||||
Patch0045: 0045-RHEL-1245-Remove-usrbin-from-syspath-noimpor-garbage.patch
|
Patch0045: 0045-RHEL-1245-Remove-usrbin-from-syspath-noimpor-garbage.patch
|
||||||
Patch0046: 0046-RHEL-6393-Fix-japanese-translations.patch
|
Patch0046: 0046-RHEL-6393-Fix-japanese-translations.patch
|
||||||
Patch0047: 0047-RHEL-11786-Fix-substitution-in-kvp-in-add_new_repo.patch
|
Patch0047: 0047-RHEL-11786-Fix-substitution-in-kvp-in-add_new_repo.patch
|
||||||
Patch0048: 0048-smtplib-catch-OSError-not-SMTPException.patch
|
|
||||||
Patch0049: 0049-automatic-Check-availability-of-config-file.patch
|
|
||||||
Patch0050: 0050-Fix-missing-import-in-automatic.patch
|
|
||||||
|
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
@ -426,10 +423,6 @@ popd
|
|||||||
%{python3_sitelib}/%{name}/automatic/
|
%{python3_sitelib}/%{name}/automatic/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Wed Jan 29 2025 Marek Blaha <mblaha@redhat.com> - 4.7.0-21
|
|
||||||
- automatic: catch OSError, not SMTPException on smtp errors (RHEL-71545)
|
|
||||||
- automatic: Check availability of config file (RHEL-71545)
|
|
||||||
|
|
||||||
* Mon Oct 16 2023 Jaroslav Rohel <jrohel@redhat.com> - 4.7.0-20
|
* Mon Oct 16 2023 Jaroslav Rohel <jrohel@redhat.com> - 4.7.0-20
|
||||||
- Remove /usr/bin from sys.path to avoid accidentally importing garbage (RHEL-1245)
|
- Remove /usr/bin from sys.path to avoid accidentally importing garbage (RHEL-1245)
|
||||||
- Fix japanese translations (RHEL-6393)
|
- Fix japanese translations (RHEL-6393)
|
||||||
|
Loading…
Reference in New Issue
Block a user