mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-04 02:41:54 +00:00
lxc-user-nic: be more paranoid
Just setting path isn't enough. Clear the whole environment, and only set $PATH. It's all we need - ovs-vsctl is running fine this way. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
parent
8fefbee406
commit
361b4fe7e2
@ -590,7 +590,11 @@ int main(int argc, char *argv[])
|
||||
char *vethname = NULL;
|
||||
int pid;
|
||||
|
||||
/* set a sane path, because we are setuid-root */
|
||||
/* set a sane env, because we are setuid-root */
|
||||
if (clearenv() < 0) {
|
||||
fprintf(stderr, "Failed to clear environment");
|
||||
exit(1);
|
||||
}
|
||||
if (setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", 1) < 0) {
|
||||
fprintf(stderr, "Failed to set PATH, exiting\n");
|
||||
exit(1);
|
||||
|
Loading…
Reference in New Issue
Block a user