Lines 1181-1186
struct sb_envp_ctx sb_new_envp(char **envp, bool insert)
Link Here
|
1181 |
found_var_cnt = 0; |
1181 |
found_var_cnt = 0; |
1182 |
memset(found_vars, 0, sizeof(found_vars)); |
1182 |
memset(found_vars, 0, sizeof(found_vars)); |
1183 |
|
1183 |
|
|
|
1184 |
/* Iterate through user's environment and check against expected. */ |
1184 |
str_list_for_each_item(envp, entry, count) { |
1185 |
str_list_for_each_item(envp, entry, count) { |
1185 |
for (i = 0; i < num_vars; ++i) { |
1186 |
for (i = 0; i < num_vars; ++i) { |
1186 |
if (found_vars[i]) |
1187 |
if (found_vars[i]) |
Lines 1192-1197
struct sb_envp_ctx sb_new_envp(char **envp, bool insert)
Link Here
|
1192 |
} |
1193 |
} |
1193 |
} |
1194 |
} |
1194 |
|
1195 |
|
|
|
1196 |
/* Treat unset and expected-unset variables as found. This will allow us |
1197 |
* to keep existing environment. */ |
1198 |
for (i = 0; i < num_vars; ++i) { |
1199 |
if (vars[i].value == NULL && found_vars[i] == NULL) { |
1200 |
++found_var_cnt; |
1201 |
} |
1202 |
} |
1203 |
|
1195 |
/* Now specially handle merging of LD_PRELOAD */ |
1204 |
/* Now specially handle merging of LD_PRELOAD */ |
1196 |
char *ld_preload; |
1205 |
char *ld_preload; |
1197 |
bool merge_ld_preload = found_vars[0] && !strstr(found_vars[0], sandbox_lib); |
1206 |
bool merge_ld_preload = found_vars[0] && !strstr(found_vars[0], sandbox_lib); |
1198 |
- |
|
|