提交 adde0e2c 编写于 作者: M Matthias Bolte

virt-aa-helper: Fix return value of add_file_path

Commit a8853344 added this
function and wrapped vah_add_file in it. vah_add_file may
return -1, 0, 1. It returns 1 in case the call to valid_path
detects a restricted file. The original code treated a return
value != 0 as error. The refactored code treats a return
value < 0 as error. This triggers segfault in virt-aa-helper
and breaks virt-aa-helper-test for the restricted file tests.

Make sure that add_file_path returns -1 on error.
上级 05c9a413
......@@ -818,6 +818,9 @@ add_file_path(virDomainDiskDefPtr disk,
ret = vah_add_file(buf, path, "r");
}
if (ret != 0)
ret = -1;
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册