|
DistroBaker |
8dd0a3 |
From 2fda26c1ec30da3b5fb8bdc4bbe6720d7870b2ec Mon Sep 17 00:00:00 2001
|
|
DistroBaker |
8dd0a3 |
From: Radek Vykydal <rvykydal@redhat.com>
|
|
DistroBaker |
8dd0a3 |
Date: Tue, 9 Mar 2021 17:51:00 +0100
|
|
DistroBaker |
8dd0a3 |
Subject: [PATCH] Do not follow symlinks when copying /etc/resolv.conf
|
|
DistroBaker |
8dd0a3 |
(#1933454)
|
|
DistroBaker |
8dd0a3 |
|
|
DistroBaker |
8dd0a3 |
---
|
|
DistroBaker |
8dd0a3 |
pyanaconda/modules/network/installation.py | 6 +++---
|
|
DistroBaker |
8dd0a3 |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
DistroBaker |
8dd0a3 |
|
|
DistroBaker |
8dd0a3 |
diff --git a/pyanaconda/modules/network/installation.py b/pyanaconda/modules/network/installation.py
|
|
DistroBaker |
8dd0a3 |
index ed61ae961b..0d87101b93 100644
|
|
DistroBaker |
8dd0a3 |
--- a/pyanaconda/modules/network/installation.py
|
|
DistroBaker |
8dd0a3 |
+++ b/pyanaconda/modules/network/installation.py
|
|
DistroBaker |
8dd0a3 |
@@ -225,9 +225,9 @@ def _copy_resolv_conf(self, root, overwrite):
|
|
DistroBaker |
8dd0a3 |
:param overwrite: overwrite existing configuration file
|
|
DistroBaker |
8dd0a3 |
:type overwrite: bool
|
|
DistroBaker |
8dd0a3 |
"""
|
|
DistroBaker |
8dd0a3 |
- self._copy_file_to_root(root, self.RESOLV_CONF_FILE_PATH)
|
|
DistroBaker |
8dd0a3 |
+ self._copy_file_to_root(root, self.RESOLV_CONF_FILE_PATH, follow_symlinks=False)
|
|
DistroBaker |
8dd0a3 |
|
|
DistroBaker |
8dd0a3 |
- def _copy_file_to_root(self, root, config_file, overwrite=False):
|
|
DistroBaker |
8dd0a3 |
+ def _copy_file_to_root(self, root, config_file, overwrite=False, follow_symlinks=True):
|
|
DistroBaker |
8dd0a3 |
"""Copy the file to target system.
|
|
DistroBaker |
8dd0a3 |
|
|
DistroBaker |
8dd0a3 |
:param root: path to the root of the target system
|
|
DistroBaker |
8dd0a3 |
@@ -244,7 +244,7 @@ def _copy_file_to_root(self, root, config_file, overwrite=False):
|
|
DistroBaker |
8dd0a3 |
return
|
|
DistroBaker |
8dd0a3 |
if not os.path.isdir(os.path.dirname(fpath)):
|
|
DistroBaker |
8dd0a3 |
util.mkdirChain(os.path.dirname(fpath))
|
|
DistroBaker |
8dd0a3 |
- shutil.copy(config_file, fpath)
|
|
DistroBaker |
8dd0a3 |
+ shutil.copy(config_file, fpath, follow_symlinks=follow_symlinks)
|
|
DistroBaker |
8dd0a3 |
|
|
DistroBaker |
8dd0a3 |
def _copy_device_config_files(self, root):
|
|
DistroBaker |
8dd0a3 |
"""Copy network device config files to target system.
|