chantra / rpms / dnf

Forked from rpms/dnf 2 years ago
Clone

Blame SOURCES/0009-Fix-alias-processing-with-backslash-escaping-RhBug1680482.patch

878112
From 32f331724cc8b473073fa0f29ad93044b1dde824 Mon Sep 17 00:00:00 2001
878112
From: Brandon Bennett <bennetb@gmail.com>
878112
Date: Mon, 16 Dec 2019 09:37:24 -0700
878112
Subject: [PATCH] Strip '\' from aliases when processing (RhBug:1680482)
878112
878112
de40e3f7e910d5533dfbcc377807caaae115ed3e reworked the alias resolution
878112
to detect infinate recursion, however it broke how the '\' works during
878112
resolution.  Before the '\\' was stripped but now it is no longer.
878112
878112
This just adds a check to see if '\\' is in the first part of the
878112
arguments and strips it.
878112
---
878112
 dnf/cli/aliases.py | 5 +++++
878112
 1 file changed, 5 insertions(+)
878112
878112
diff --git a/dnf/cli/aliases.py b/dnf/cli/aliases.py
878112
index b5283d0f33..364aab6d21 100644
878112
--- a/dnf/cli/aliases.py
878112
+++ b/dnf/cli/aliases.py
878112
@@ -176,8 +176,13 @@ def subresolve(args):
878112
                     suffix[0].startswith('\\')):  # End resolving
878112
                 try:
878112
                     stack.pop()
878112
+
878112
+                    # strip the '\' if it exists
878112
+                    if suffix[0].startswith('\\'):
878112
+                        suffix[0] = suffix[0][1:]
878112
                 except IndexError:
878112
                     pass
878112
+
878112
                 return suffix
878112
 
878112
             if suffix[0] in stack:  # Infinite recursion detected