Skip to contentSkip to conversation

sysnetwork: put systemd_read_resolved_runtime in an ifdef

PATCH New Jason Zaman 2 participants 2 messages Apr 25, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sysnetwork: put systemd_read_resolved_runtime in an ifdef

commit f865919872a2d709d37f3df7032a6ea73bdd8080 (Interface to read /run/systemd/resolve/resolv.conf) Added an interface to sysnet_read_config which requires the systemd module loaded. Putting the interface in an optional_policy() is not possible since sysnet_read_config is called from several tunables so we use an ifdef.

---
 policy/modules/system/sysnetwork.if | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
policy/modules/system/sysnetwork.if +3 -1
index 1f7cf460..e6e4246d 100644
@@ -348,7 +348,9 @@ interface(`sysnet_read_config',`
 	files_search_etc($1)
 	allow $1 net_conf_t:file read_file_perms;
 
-	systemd_read_resolved_runtime($1)
+	ifdef(`init_systemd',`
+		systemd_read_resolved_runtime($1)
+	')
 
 	ifdef(`distro_debian',`
 		files_search_pids($1)
Signature · 1 line
2.16.1
#1 lore raw

PATCH 1/1 sysnetwork: put systemd_read_resolved_runtime in an ifdef

Quoted 15 lines · Jason Zaman

commit f865919872a2d709d37f3df7032a6ea73bdd8080 (Interface to read /run/systemd/resolve/resolv.conf) Added an interface to sysnet_read_config which requires the systemd module loaded. Putting the interface in an optional_policy() is not possible since sysnet_read_config is called from several tunables so we use an ifdef.

---
  policy/modules/system/sysnetwork.if | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
policy/modules/system/sysnetwork.if +0 -0
index 1f7cf460..e6e4246d 100644

policy/modules/system/sysnetwork.if interface(`sysnet_read_config',` · line 356

Quoted 10 lines
policy/modules/system/sysnetwork.if +3 -1
@@ -348,7 +348,9 @@ interface(`sysnet_read_config',`
  	files_search_etc($1)
  	allow $1 net_conf_t:file read_file_perms;
 
-	systemd_read_resolved_runtime($1)
+	ifdef(`init_systemd',`
+		systemd_read_resolved_runtime($1)
+	')
 
  	ifdef(`distro_debian',`
  		files_search_pids($1)

Merged.

Signature · 1 line
Chris PeBenito