aboutsummaryrefslogtreecommitdiffstats
path: root/main/openrc/fix-rc_env_allow.patch
blob: f3b89c5aecbff011bd467358091643d461033375 (plain)
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
From 7eaf71176b87ae69bfa622aa621341a19a9d32b0 Mon Sep 17 00:00:00 2001
From: William Hubbs <w.d.hubbs@gmail.com>
Date: Fri, 12 Feb 2016 12:40:55 -0600
Subject: [PATCH] Fix rc_env_allow wildcard usage

Before this commit, using * in rc_env_allow did not work.

This fixes #60.
---
 src/rc/rc-misc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/rc/rc-misc.c b/src/rc/rc-misc.c
index f2967dd..82f1b78 100644
--- a/src/rc/rc-misc.c
+++ b/src/rc/rc-misc.c
@@ -68,6 +68,12 @@ env_filter(void)
 
 	/* Add the user defined list of vars */
 	env_allow = rc_stringlist_split(rc_conf_value("rc_env_allow"), " ");
+	/*
+	 * If '*' is an entry in rc_env_allow, do nothing as we are to pass
+	 * through all environment variables.
+	 */
+	if (rc_stringlist_find(env_allow, "*"))
+		return;
 	profile = rc_config_load(RC_PROFILE_ENV);
 
 	/* Copy the env and work from this so we can manipulate it safely */