|
Zbigniew Jędrzejewski-Szmek |
642812 |
From 4e14900fe25c53275c7d7d0c094ddf1fd477e5ed Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
Date: Fri, 11 Mar 2016 17:06:17 -0500
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
Subject: [PATCH 1/2] resolved: create /etc/resolv.conf symlink at runtime
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
If the symlink doesn't exists, and we are being started, let's
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
create it to provie name resolution.
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
If it exists, do nothing. In particular, if it is a broken symlink,
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
we cannot really know if the administator configured it to point to
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
a location used by some service that hasn't started yet, so we
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
don't touch it in that case either.
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
https://bugzilla.redhat.com/show_bug.cgi?id=1313085
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
src/resolve/resolved.c | 4 ++++
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
tmpfiles.d/etc.conf.m4 | 3 ---
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
2 files changed, 4 insertions(+), 3 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
diff --git a/src/resolve/resolved.c b/src/resolve/resolved.c
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
index 161ea03412..ea6750e949 100644
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
--- a/src/resolve/resolved.c
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
+++ b/src/resolve/resolved.c
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
@@ -67,6 +67,10 @@ int main(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
goto finish;
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
+ r = symlink("../run/systemd/resolve/resolv.conf", "/etc/resolv.conf");
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
+ if (r < 0 && errno != EEXIST)
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
+ log_warning_errno(errno, "Could not create /etc/resolv.conf symlink: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
r = drop_privileges(uid, gid, 0);
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
goto finish;
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
diff --git a/tmpfiles.d/etc.conf.m4 b/tmpfiles.d/etc.conf.m4
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
index ef7b9b9541..928105ea8d 100644
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
--- a/tmpfiles.d/etc.conf.m4
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
+++ b/tmpfiles.d/etc.conf.m4
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
@@ -13,9 +13,6 @@ L+ /etc/mtab - - - - ../proc/self/mounts
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
m4_ifdef(`HAVE_SMACK_RUN_LABEL',
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
t /etc/mtab - - - - security.SMACK64=_
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
)m4_dnl
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
-m4_ifdef(`ENABLE_RESOLVED',
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
-L! /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
-)m4_dnl
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
C /etc/nsswitch.conf - - - -
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
m4_ifdef(`HAVE_PAM',
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
C /etc/pam.d - - - -
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
--
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
2.7.2
|
|
Zbigniew Jędrzejewski-Szmek |
642812 |
|