-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When relocating the root directory, make sure we insert the new path's dirname to dirNames[] even if the root itself is owned by the package. This appears to have been the intention from the first version (largely untouched since) of this code as we allow the root to pass through the first checks (by setting len to 0 in that case) as well as the second for loop where we do the relocations. This allows fsm to properly create and remove the relocated directory since we're now using fd-based calls (#1919) and the parent directory needs to be opened first. No need to do string comparison here, the empty basename signals that we're processing the root directory, so just use that. Building a relocatable package that owns the root directory seems to be a handy way to create user-installable packages (see RHEL-28967) and it happened to work before with the path-based calls so this technically was a regression. Add a test that emulates this use case. Fixes: #3173
- Loading branch information
Showing
3 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Name: rootfs | ||
Version: 1.0 | ||
Release: 1 | ||
Summary: Package owning top-level root directory | ||
License: GPL | ||
BuildArch: noarch | ||
Prefix: / | ||
|
||
%description | ||
%{summary}. | ||
|
||
%install | ||
mkdir -p $RPM_BUILD_ROOT/foo | ||
touch $RPM_BUILD_ROOT/foo/bar | ||
|
||
%files | ||
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters