vfs/tar: return inode numbers of null records

The tar vfs plugin returns an inode value of zero and a type directory
for null records, which wrongly triggers the file-system loop detection
of the find utility. This patch returns the node pointer as inode value
instead, which is a unique value.

Fixes #3695
This commit is contained in:
Norman Feske 2020-03-13 12:12:38 +01:00
parent 2275f0b399
commit 27c10e0d5a
1 changed files with 8 additions and 2 deletions

View File

@ -610,8 +610,14 @@ class Vfs::Tar_file_system : public File_system
return STAT_ERR_NO_ENTRY;
if (!node_ptr->record) {
out.type = Node_type::DIRECTORY;
out.rwx = Node_rwx::rx();
out = {
.size = 0,
.type = Node_type::DIRECTORY,
.rwx = Node_rwx::rx(),
.inode = (Genode::addr_t)node_ptr,
.device = (Genode::addr_t)this,
.modification_time = { }
};
return STAT_OK;
}