# HG changeset patch # User Paul Boddie # Date 1704997484 -3600 # Node ID 30ec30848a3909f8f4148fc402bd48f62b80d42f # Parent 2e2ac42bdf28ec07150373177742609b9348c6d5 Allow stat operations on objects without needing access. Otherwise, no metadata is available for things like directory listings. diff -r 2e2ac42bdf28 -r 30ec30848a39 libfsserver/lib/files/ext2_file_opener.cc --- a/libfsserver/lib/files/ext2_file_opener.cc Tue Dec 12 22:02:07 2023 +0100 +++ b/libfsserver/lib/files/ext2_file_opener.cc Thu Jan 11 19:24:44 2024 +0100 @@ -200,10 +200,18 @@ { struct stat st; fileid_t fileid; - long err = get_fileid(path, 0, &fileid); + + /* Find the object without access restrictions since the metadata is not + sensitive. */ + + ext2_ino_t ino; + const char *remaining; + long err = _ops->find_file(path, &ino, &remaining); if (err) - return err; + return -L4_ENOENT; + + fileid = (fileid_t) ino; if (sizeof(struct stat) > size) return -L4_ENOMEM;