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: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
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)))
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)))