Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Thaodan:tools
osc
0012-Fix-resolving-config-symlink-to-the-actual...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0012-Fix-resolving-config-symlink-to-the-actual-config-fi.patch of Package osc
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Mach <daniel.mach@suse.com> Date: Thu, 22 Feb 2024 08:19:22 +0100 Subject: [PATCH] Fix resolving config symlink to the actual config file (cherry picked from commit eab83d361274b5474d30f34dab02b1b4c26a064e) --- osc/conf.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osc/conf.py b/osc/conf.py index a581b1aa158e28cfb6e6c0392d0d0e20ae49b610..f77d183d387a5343e3c2bbb8d04d624d1a2bfacf 100644 --- a/osc/conf.py +++ b/osc/conf.py @@ -1606,14 +1606,14 @@ def get_configParser(conffile=None, force_read=False): def write_config(fname, cp): """write new configfile in a safe way""" - if os.path.exists(fname) and not os.path.isfile(fname): - # only write to a regular file - return - # config file is behind a symlink # resolve the symlink and continue writing the config as usual if os.path.islink(fname): - fname = os.readlink(fname) + fname = os.path.realpath(fname) + + if os.path.exists(fname) and not os.path.isfile(fname): + # only write to a regular file + return # create directories to the config file (if they don't exist already) fdir = os.path.dirname(fname)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor