if (!(state = virSecurityManagerMetadataLock(list->manager, paths, npaths)))
goto cleanup;
+
+ for (i = 0; i < list->nItems; i++) {
+ virSecurityDACChownItemPtr item = list->items[i];
+ size_t j;
+
+ for (j = 0; j < state->nfds; j++) {
+ if (STREQ_NULLABLE(item->path, state->paths[j]))
+ break;
+ }
+
+ /* If path wasn't locked, don't try to remember its label. */
+ if (j == state->nfds)
+ item->remember = false;
+ }
}
for (i = 0; i < list->nItems; i++) {
}
-struct _virSecurityManagerMetadataLockState {
- size_t nfds; /* Captures size of both @fds and @paths */
- int *fds;
- const char **paths;
-};
-
-
static int
cmpstringp(const void *p1, const void *p2)
{
typedef struct _virSecurityManagerMetadataLockState virSecurityManagerMetadataLockState;
typedef virSecurityManagerMetadataLockState *virSecurityManagerMetadataLockStatePtr;
+struct _virSecurityManagerMetadataLockState {
+ size_t nfds; /* Captures size of both @fds and @paths */
+ int *fds;
+ const char **paths;
+};
+
virSecurityManagerMetadataLockStatePtr
virSecurityManagerMetadataLock(virSecurityManagerPtr mgr,
if (!(state = virSecurityManagerMetadataLock(list->manager, paths, npaths)))
goto cleanup;
+
+ for (i = 0; i < list->nItems; i++) {
+ virSecuritySELinuxContextItemPtr item = list->items[i];
+ size_t j;
+
+ for (j = 0; j < state->nfds; j++) {
+ if (STREQ_NULLABLE(item->path, state->paths[j]))
+ break;
+ }
+
+ /* If path wasn't locked, don't try to remember its label. */
+ if (j == state->nfds)
+ item->remember = false;
+ }
}
rv = 0;