clearlinux / mixer-tools

Software update mixer and related tools
Apache License 2.0
28 stars 37 forks source link

Install special case files last #742

Closed jwakre closed 4 years ago

jwakre commented 4 years ago

When adding special case files to the full chroot, they will create missing directories in their path with permissions that may conflict with content that will be added at a later point. By adding special case files last, they will not create directories with potentially conflicting permissions.

Fixes #738

Signed-off-by: John Akre john.w.akre@intel.com

reaganlo commented 4 years ago

So if I understand correctly, the special directories are:

And with this change, the owners/perms of these directories will be created in this order:

  1. packages
  2. contents
  3. mixer (root)

@jwakre correct?

jwakre commented 4 years ago

So if I understand correctly, the special directories are:

* /usr/share/clear/bundles/

* /usr/share/clear/

* /usr/lib/

* /usr/share/defaults/swupd/

* /usr/share/clear/update-ca/

And with this change, the owners/perms of these directories will be created in this order:

1. packages

2. contents

3. mixer (root)

@jwakre correct?

Yes. So with this change, content chroots would be able to alter ownership and permissions for the above listed directories.

Alternatively, if we do not want users to have this level of control, we can leave this code the same. In this case, it would make sense to avoid checking permissions and ownership for these files merging content chroot files into the full chroot.

bryteise commented 4 years ago

The ordering makes sense to me. Is there a failure when a conflict happens between packages and chroots? Then the special case directories/files are created if they don't exist (so conflict is okay, just don't do anything).

jwakre commented 4 years ago

The ordering makes sense to me. Is there a failure when a conflict happens between packages and chroots?

Yes, Mixer will fail whenever there is a conflict between packages and content chroots.

Then the special case directories/files are created if they don't exist (so conflict is okay, just don't do anything).

Yes, special case directories will be created with Mixer's default ownership/permissions only when they do not already exist. When packages or content chroots previously create these directories, Mixer special case files will re-use the existing directories without checking for conflicting ownership/permissions.

bryteise commented 4 years ago

Sounds great to me.

reaganlo commented 4 years ago

@bryteise @jwakre Cool. So sounds like this PR is the desired behavior. I will test it and merge it in today's release.