diff options
author | 2024-02-22 15:28:03 -0800 | |
---|---|---|
committer | 2024-02-29 18:23:54 -0800 | |
commit | be11b14a78cd109dba5e463faa2cd8624f416363 (patch) | |
tree | db265d6e4905746b3b9d87631fc4cf308f93b680 /jni | |
parent | b2063ec8b9afd53c7c631d02fd60336e25195234 (diff) |
Handle case of fully redacted readdir request
If a readdir comes in where each entry is redacted, we must signal that
there may be more to come by setting 'again'.
Test: Create many redacted folders, and a single unredacted
Observe output of ls
Bug: 325550828
Change-Id: Ie55c782a1dd95a625cf52f64786d8fdded5ceb70
Diffstat (limited to 'jni')
-rw-r--r-- | jni/FuseDaemon.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/jni/FuseDaemon.cpp b/jni/FuseDaemon.cpp index f9a4c4dfb..9ed5b93b0 100644 --- a/jni/FuseDaemon.cpp +++ b/jni/FuseDaemon.cpp @@ -1986,6 +1986,7 @@ static void pf_readdir_postfilter(fuse_req_t req, fuse_ino_t ino, uint32_t error char buf[READDIR_BUF]; struct fuse_read_out* fro = (struct fuse_read_out*)(buf); size_t used = 0; + bool redacted = false; char* dirents_out = (char*)(fro + 1); ATRACE_CALL(); @@ -2021,8 +2022,11 @@ static void pf_readdir_postfilter(fuse_req_t req, fuse_ino_t ino, uint32_t error *dirent_out = *dirent_in; strcpy(dirent_out->name, child_name.c_str()); used += sizeof(*dirent_out) + round_up(dirent_out->namelen, sizeof(uint64_t)); + } else { + redacted = true; } } + if (redacted && used == 0) fro->again = 1; fuse_reply_buf(req, buf, sizeof(*fro) + used); } |