Skip to content

Commit 23a05d2

Browse files
committed
scripts: Bind /usr/share/empty over /usr/share/rpm
Now that we inject the `%_dbpath /usr/share/rpm` macro, `rpm -q` will start using it. But in RPM script invocation, we don't want them to see any RPM database at all - trying to query it should be a clean failure.
1 parent e7f180b commit 23a05d2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libpriv/rpmostree-scripts.cxx

+3
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,9 @@ rpmostree_run_script_in_bwrap_container (int rootfs_fd,
378378
if (glnx_fstatat (rootfs_fd, "usr/lib/opt", &stbuf, AT_SYMLINK_NOFOLLOW, NULL) && S_ISDIR(stbuf.st_mode))
379379
rpmostree_bwrap_append_bwrap_argv (bwrap, "--symlink", "usr/lib/opt", "/opt", NULL);
380380

381+
/* Don't let scripts see the base rpm database by default */
382+
rpmostree_bwrap_bind_read (bwrap, "usr/share/empty", "usr/share/rpm");
383+
381384
/* Add ostree-booted API; some scriptlets may work differently on OSTree systems; e.g.
382385
* akmods. Just create it manually; /run is usually tmpfs, but scriptlets shouldn't be
383386
* adding stuff there anyway. */

0 commit comments

Comments
 (0)