-
Notifications
You must be signed in to change notification settings - Fork 78
/
0001-resolv.conf.auto-Use-run-instead-of-tmp.patch
51 lines (41 loc) · 1.82 KB
/
0001-resolv.conf.auto-Use-run-instead-of-tmp.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 587e3af4084e477c244750028937cbfa54bf6c71 Mon Sep 17 00:00:00 2001
From: Parthiban Nallathambi <pn@denx.de>
Date: Fri, 8 Jun 2018 18:41:43 +0200
Subject: [PATCH] [resolv.conf.auto]: Use /run instead of /tmp
Using netifd as network manager along with systemd provokes the bad usage
of path, in this case /tmp/. All the runtime configuration needs to be
sotored as part of /run
Problem:
========
assuming: ln -fs /tmp/resolv.conf.auto /etc/resolv.conf
If any application tend to use Filesystem namespace to have separate /tmp and
try to use DNS resolution from netifd, it will not be able to resolve the path/symlink.
Usage of PrivateTmp=yes:
------------------------
For example, systemd-timesyncd.service in systemd uses the option "PrivateTmp=yes"
in the service file to have separate /tmp filesystem namespace and uses glibc
getaddrinfo for name resolution, which in turm follows the symlink to /tmp which
doesn't exit in new namespace
So moving the runtime configuration to /run here
Signed-off-by: Parthiban Nallathambi <pn@denx.de>
Signed-off-by: Alejandro Hernandez <aehs29@gmail.com>
---
netifd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/netifd.h
+++ b/netifd.h
@@ -38,13 +38,13 @@
#define DEFAULT_MAIN_PATH "./examples"
#define DEFAULT_CONFIG_PATH "./config"
#define DEFAULT_HOTPLUG_PATH "./examples/hotplug-cmd"
-#define DEFAULT_RESOLV_CONF "./tmp/resolv.conf"
+#define DEFAULT_RESOLV_CONF "./run/resolv.conf"
#define DEFAULT_BOARD_JSON "./config/board.json"
#else
#define DEFAULT_MAIN_PATH "/lib/netifd"
#define DEFAULT_CONFIG_PATH NULL /* use the default set in libuci */
#define DEFAULT_HOTPLUG_PATH "/sbin/hotplug-call"
-#define DEFAULT_RESOLV_CONF "/tmp/resolv.conf.d/resolv.conf.auto"
+#define DEFAULT_RESOLV_CONF "/run/resolv.conf.d/resolv.conf.auto"
#define DEFAULT_BOARD_JSON "/etc/board.json"
#endif