Skip to content

Commit

Permalink
[EROFS] fix the loss of uid and gid
Browse files Browse the repository at this point in the history
Currently, the uid and gid in the tar file are
lost because the `c_uid` and `c_gid` of `erofs_cfg`
are not set to -1.

This patch fixes it.

Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
  • Loading branch information
salvete committed Dec 3, 2024
1 parent 8acf53f commit 42f0b0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/overlaybd/tar/erofs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include(FetchContent)
FetchContent_Declare(
erofs-utils
GIT_REPOSITORY https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git
GIT_TAG 80156068eb4980342c0ad3ee47ac7261acce5caf
GIT_TAG eec6f7a2755dfccc8f655aa37cf6f26db9164e60
)

FetchContent_MakeAvailable(erofs-utils)
Expand Down
3 changes: 3 additions & 0 deletions src/overlaybd/tar/erofs/liberofs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ struct erofs_mkfs_cfg {

static int rebuild_src_count;

extern void erofs_init_configure(void);

int erofs_mkfs(struct erofs_mkfs_cfg *mkfs_cfg)
{
int err;
Expand Down Expand Up @@ -280,6 +282,7 @@ int LibErofs::extract_tar(photon::fs::IFile *source, bool meta_only, bool first_
mkfs_cfg.sbi = &sbi;
mkfs_cfg.erofstar = &erofstar;
mkfs_cfg.incremental = !first_layer;
erofs_init_configure();
erofs_cfg = erofs_get_configure();
erofs_cfg->c_ovlfs_strip = true;
if (first_layer)
Expand Down

0 comments on commit 42f0b0c

Please sign in to comment.