From aa9a2966bc921914781a1611540cf4797e6d3a3c Mon Sep 17 00:00:00 2001 From: dma Date: Sun, 19 Jul 2015 00:29:50 -0400 Subject: [PATCH] Blacklist support in oz-init. --- oz-init/init.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/oz-init/init.go b/oz-init/init.go index e533241..775b592 100644 --- a/oz-init/init.go +++ b/oz-init/init.go @@ -311,7 +311,11 @@ func (st *initState) launchApplication(cpath, pwd string, cmdArgs []string) (*ex if st.profile.Seccomp.Mode == oz.PROFILE_SECCOMP_WHITELIST { st.log.Notice("Enabling seccomp whitelist for: %s", cpath) - cmdArgs = append([]string{"-w",cpath}, cmdArgs...) + cmdArgs = append([]string{"-w", cpath}, cmdArgs...) + cpath = path.Join(st.config.PrefixPath, "bin", "oz-seccomp") + } else if st.profile.Seccomp.Mode == oz.PROFILE_SECCOMP_BLACKLIST { + st.log.Notice("Enabling seccomp blacklist for: %s", cpath) + cmdArgs = append([]string{"-b", cpath}, cmdArgs...) cpath = path.Join(st.config.PrefixPath, "bin", "oz-seccomp") } cmd := exec.Command(cpath) @@ -332,7 +336,8 @@ func (st *initState) launchApplication(cpath, pwd string, cmdArgs []string) (*ex } cmd.Env = append(cmd.Env, st.launchEnv...) - if st.profile.Seccomp.Mode == oz.PROFILE_SECCOMP_WHITELIST { + if st.profile.Seccomp.Mode == oz.PROFILE_SECCOMP_WHITELIST || + st.profile.Seccomp.Mode == oz.PROFILE_SECCOMP_BLACKLIST { cmd.Env = append(cmd.Env, "_OZ_PROFILE="+st.profile.Name) }