-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
importer: Error importing RPMs which install to /opt (outside of /usr) #624
Conversation
See #233 - for RPMs which place files in e.g. `/opt`, we have different behavior in the treecompose case (silently drop it) versus package layering (does the wrong thing). Since the unpacker right now is only used in the layering case, this just ensures we'll get a consistent error there. Closes: #624 Approved by: jlebon
💔 Test failed - status-atomicjenkins |
Confused...tests pass here. @rh-atomic-bot retry |
See #233 - for RPMs which place files in e.g. `/opt`, we have different behavior in the treecompose case (silently drop it) versus package layering (does the wrong thing). Since the unpacker right now is only used in the layering case, this just ensures we'll get a consistent error there. Closes: #624 Approved by: jlebon
I was looking into this failure before backporting #622 it case it was wrong in some subtle way... It turned out to be a rather tricky issue. When we go the second time around to commit the generated This solved it for me: diff --git a/src/libpriv/rpmostree-unpacker.c b/src/libpriv/rpmostree-unpacker.c
index 8d91c7c..4c3ff74 100644
--- a/src/libpriv/rpmostree-unpacker.c
+++ b/src/libpriv/rpmostree-unpacker.c
@@ -612,9 +612,12 @@ compose_filter_cb (OstreeRepo *repo,
return OSTREE_REPO_COMMIT_FILTER_SKIP;
}
/* And ensure the RPM installs into supported paths */
- else if (!(g_str_has_prefix (path, "/usr/") || g_str_has_prefix (path, "/bin/") ||
- g_str_has_prefix (path, "/sbin/") || g_str_has_prefix (path, "/lib/") ||
- g_str_has_prefix (path, "/lib64/")))
+ else if (!(g_str_equal (path, "/") ||
+ g_str_equal (path, "/usr") || g_str_has_prefix (path, "/usr/") ||
+ g_str_equal (path, "/bin") || g_str_has_prefix (path, "/bin/") ||
+ g_str_equal (path, "/sbin") || g_str_has_prefix (path, "/sbin/") ||
+ g_str_equal (path, "/lib") || g_str_has_prefix (path, "/lib/") ||
+ g_str_equal (path, "/lib64") || g_str_has_prefix (path, "/lib64/")))
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Unsupported path: %s; See %s", (Or maybe a hashtable might be more appropriate at this point). We could just not use a modifier on the second pass and lose selabeling (which is fine since those dirs will already exist). Though we'll probably want the above anyway when we switch over tree composes to use the unpacker. |
💔 Test failed - status-atomicjenkins |
This masked an issue in a change I was working on in the filter.
See coreos#233 - for RPMs which place files in e.g. `/opt`, we have different behavior in the treecompose case (silently drop it) versus package layering (does the wrong thing). Since the unpacker right now is only used in the layering case, this just ensures we'll get a consistent error there.
Oooh, masking the errors was insidious 👺 🔪 🤕. I added a patch to fix that first. |
See #233 - for RPMs which place files in e.g. `/opt`, we have different behavior in the treecompose case (silently drop it) versus package layering (does the wrong thing). Since the unpacker right now is only used in the layering case, this just ensures we'll get a consistent error there. Closes: #624 Approved by: jlebon
☀️ Test successful - status-atomicjenkins |
FWIW, according to FHS 3.0, directories of the form |
See #233 - for RPMs which
place files in e.g.
/opt
, we have different behavior in the treecompose case(silently drop it) versus package layering (does the wrong thing).
Since the unpacker right now is only used in the layering case, this just
ensures we'll get a consistent error there.