diff --git a/utils/vim/Makefile b/utils/vim/Makefile index 9ffc301e0..7d107dd0d 100644 --- a/utils/vim/Makefile +++ b/utils/vim/Makefile @@ -9,7 +9,7 @@ VIM_INSTALL_PATH=${DESTDIR}/usr/share/apparmor all: apparmor.vim manpages htmlmanpages apparmor.vim: apparmor.vim.in Makefile create-apparmor.vim.py - ${PYTHON} create-apparmor.vim.py > apparmor.vim + ${PYTHON} create-apparmor.vim.py > apparmor.vim || { rm -f apparmor.vim ; exit 1; } manpages: $(MANPAGES) diff --git a/utils/vim/create-apparmor.vim.py b/utils/vim/create-apparmor.vim.py index b5df957af..8a17bb43e 100644 --- a/utils/vim/create-apparmor.vim.py +++ b/utils/vim/create-apparmor.vim.py @@ -42,12 +42,12 @@ def cmd(command, input=None, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, s # Handle redirection of stderr if outerr is None: outerr = '' - return [sp.returncode, out + outerr] + return [sp.returncode, out, outerr] # get capabilities list -(rc, output) = cmd(['../../common/list_capabilities.sh']) +(rc, output, outerr) = cmd(['../../common/list_capabilities.sh']) if rc != 0: - sys.stderr.write("make list_capabilities failed: " + output) + sys.stderr.write("make list_capabilities failed: " + output + outerr) exit(rc) capabilities = re.sub('CAP_', '', output.strip()).lower().split('\n') @@ -57,9 +57,9 @@ for cap in capabilities: benign_caps.append(cap) # get network protos list -(rc, output) = cmd(['../../common/list_af_names.sh']) +(rc, output, outerr) = cmd(['../../common/list_af_names.sh']) if rc != 0: - sys.stderr.write("make list_af_names failed: " + output) + sys.stderr.write("make list_af_names failed: " + output + outerr) exit(rc) af_names = []