提交 1a84a1ce 编写于 作者: M Michal Privoznik

security: Try to lock only paths with remember == true

So far all items on the chown/setfilecon list have the same
.remember value.  But this will change shortly. Therefore, don't
try to lock paths which we won't manipulate XATTRs for.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NCole Robinson <crobinso@redhat.com>
上级 4dfc4d52
......@@ -232,9 +232,11 @@ virSecurityDACTransactionRun(pid_t pid ATTRIBUTE_UNUSED,
return -1;
for (i = 0; i < list->nItems; i++) {
const char *p = list->items[i]->path;
virSecurityDACChownItemPtr item = list->items[i];
const char *p = item->path;
VIR_APPEND_ELEMENT_COPY_INPLACE(paths, npaths, p);
if (item->remember)
VIR_APPEND_ELEMENT_COPY_INPLACE(paths, npaths, p);
}
if (!(state = virSecurityManagerMetadataLock(list->manager, paths, npaths)))
......
......@@ -266,9 +266,11 @@ virSecuritySELinuxTransactionRun(pid_t pid ATTRIBUTE_UNUSED,
return -1;
for (i = 0; i < list->nItems; i++) {
const char *p = list->items[i]->path;
virSecuritySELinuxContextItemPtr item = list->items[i];
const char *p = item->path;
VIR_APPEND_ELEMENT_COPY_INPLACE(paths, npaths, p);
if (item->remember)
VIR_APPEND_ELEMENT_COPY_INPLACE(paths, npaths, p);
}
if (!(state = virSecurityManagerMetadataLock(list->manager, paths, npaths)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册