mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 05:47:59 +00:00
Merge Better error handling when creating apparmor.vim
See the individual commits for details and bug references. PR: https://gitlab.com/apparmor/apparmor/-/merge_requests/472 Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
e02a017014
commit
01841ade3a
@ -9,7 +9,7 @@ VIM_INSTALL_PATH=${DESTDIR}/usr/share/apparmor
|
|||||||
all: apparmor.vim manpages htmlmanpages
|
all: apparmor.vim manpages htmlmanpages
|
||||||
|
|
||||||
apparmor.vim: apparmor.vim.in Makefile create-apparmor.vim.py
|
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)
|
manpages: $(MANPAGES)
|
||||||
|
|
||||||
|
@ -42,12 +42,12 @@ def cmd(command, input=None, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, s
|
|||||||
# Handle redirection of stderr
|
# Handle redirection of stderr
|
||||||
if outerr is None:
|
if outerr is None:
|
||||||
outerr = ''
|
outerr = ''
|
||||||
return [sp.returncode, out + outerr]
|
return [sp.returncode, out, outerr]
|
||||||
|
|
||||||
# get capabilities list
|
# get capabilities list
|
||||||
(rc, output) = cmd(['../../common/list_capabilities.sh'])
|
(rc, output, outerr) = cmd(['../../common/list_capabilities.sh'])
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
sys.stderr.write("make list_capabilities failed: " + output)
|
sys.stderr.write("make list_capabilities failed: " + output + outerr)
|
||||||
exit(rc)
|
exit(rc)
|
||||||
|
|
||||||
capabilities = re.sub('CAP_', '', output.strip()).lower().split('\n')
|
capabilities = re.sub('CAP_', '', output.strip()).lower().split('\n')
|
||||||
@ -57,9 +57,9 @@ for cap in capabilities:
|
|||||||
benign_caps.append(cap)
|
benign_caps.append(cap)
|
||||||
|
|
||||||
# get network protos list
|
# get network protos list
|
||||||
(rc, output) = cmd(['../../common/list_af_names.sh'])
|
(rc, output, outerr) = cmd(['../../common/list_af_names.sh'])
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
sys.stderr.write("make list_af_names failed: " + output)
|
sys.stderr.write("make list_af_names failed: " + output + outerr)
|
||||||
exit(rc)
|
exit(rc)
|
||||||
|
|
||||||
af_names = []
|
af_names = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user