Documents App is indexing files that cannot actually read (Firejail permissions)

REPRODUCIBILITY (% or how often): Always
BUILD ID = OS VERSION (Settings > About product): 4.1.0.24
HARDWARE (XA2, X10, X10 II, …): Sony Xperia XA2 single SIM
UI LANGUAGE: English
REGRESSION: (compared to previous public release: Yes, No, ?): I guess not.

DESCRIPTION:

Every file that can’t be read by Documents App, due to being placed into a folder not allowed by its Firejail permissions (e.g. the Home directory), shouldn’t be indexed and shown. But it is.

PRECONDITIONS:

None.

STEPS TO REPRODUCE:

  1. Take a random PDF file and made copies it to three folders: a) ~/Documents; b) ~ and c) /tmp. Rename them for easy identifying (e.g. fooDOC.pdf, fooHOME.pdf and fooTMP.pdf).
  2. Open Documents app. Wait until it has finished indexing new files.
  3. Try to open those three files:
    3.1) /tmp is not indexed and therefore, /tmp/.pdf are not shown on Documents. On top of that, /tmp is not included among the folders allowed by Firejail to this app, so it wouldn’t open. This is the expected behavior.
    3.2) All PDFs located into ~/Documents are indexed, shown and can be read. Expected behavior, too.
    3.3) But ~/
    .pdf files are also indexed and are shown in Documents. Since its Firejail permissions don’t allow any file placed in the Home directory to be read, Documents returns an odd error (“Broken file. Cannot read the PDF document”).

EXPECTED RESULT:

~/foo.pdf or any other file which can’t be opened due to Firejail permissions shouldn’t be indexed and shown in Documents app.

And a minor issue: “Broken file” is a very confusing error message. It can lead to actually think the file is corrupt, which probably is not. It would be better something like “Can’t read the PDF document due to lack of permissions. Please move it into the recommended folder” (and a “Do you want me to do that? [Move] [Cancel]” would be absolutely great).

ACTUAL RESULT:

Already described.

ADDITIONAL INFORMATION:

None.

2 Likes

As per my link in your other post, this appears fixed.
Seems a bit redundant to report a bug, no?

Pet peeve:
It is however definitely a regression, compared to before sailjail.

1 Like

You mean this, right?

I was thinking about moving it to bug reports category (which is now obsolete :wink: ).

Actually, it’s a different issue. This one is about lack of synchronism between the folders indexed by Documents and the folders actually allowed by Firejail permissions (from now on, “FJP”).

The patch/fix @attah is talking about just adds some folders to FJP, but we don’t know if that scope covers all folders indexed. Rough example:

Now, Docs indexes Folder1, Folder2, Folder3 and Folder4. But its FJP allow only Folder1 to be read. So, returns an error when opening 2, 3 or 4.

After the fix, FJP allow Folder 2 and Folder3. But Documents keeps indexing Folder4. No changes here: files there are still unreadable.

So, this bug is about allowing $USERDIRS to be read, but also making sure all indexed files are inside $USERDIRS and the other folders allowed by FJP.