Launchpad has imported 5 comments from the remote bug at
https://bugzilla.mozilla.org/show_bug.cgi?id=1521041.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2019-01-18T10:51:47+00:00 lodart wrote:

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0)
Gecko/20100101 Firefox/64.0

Steps to reproduce:

I encrypted my homedir (on Ubuntu 18.04) with fscrypt following this tutorial : 
https://tlbdk.github.io/ubuntu/2018/10/22/fscrypt.html
Then, I try to download any file from internet with Firefox in my Download 
folder, in my homedir (or any encrypted folder).


Actual results:

The download instantly breaks. Only a 0kb file appears with the correct
name.


Expected results:

The file should be downloaded correctly.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1796661/comments/3

------------------------------------------------------------------------
On 2019-01-21T23:26:53+00:00 Troels Liebe Bentsen wrote:

It seems Firefox downloads the file to a folder under /tmp and then
tries to rename the file to the final location:

Rename operations to a fscrypt folder is not supported from an
unencrypted folder, files have to be copied, so this results in an EPERM
error code.


18290 rename("/tmp/mozilla_tlb0/FEekjG1c.xlsx.part", 
"/home/tlb/Downloads/test.xlsx" <unfinished ...>
18247 <... writev resumed> )            = 24
18256 <... futex resumed> )             = 0
18247 poll([{fd=4, events=POLLIN}], 1, -1 <unfinished ...>
18290 <... rename resumed> )            = -1 EPERM (Operation not permitted)


Bind mounting a non-encrypted folder to the same location gives an EXDEV error 
and Firefox seems to handle that case:


17870 rename("/tmp/mozilla_tlb0/IwoS6IQp.xlsx.part", 
"/home/tlb/Downloads/test.xlsx" <unfinished ...>
17973 write(38, "\372", 1 <unfinished ...>
17906 <... madvise resumed> )           = 0
17973 <... write resumed> )             = 1
17870 <... rename resumed> )            = -1 EXDEV (Invalid cross-device link)

Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1796661/comments/5

------------------------------------------------------------------------
On 2019-01-21T23:36:53+00:00 Troels Liebe Bentsen wrote:

Don't really know if this is the right location:

https://github.com/mozilla/gecko-
dev/blob/7ccc9d8b0bd9f879b6f24f15d8416493228697ac/xpcom/io/nsLocalFileUnix.cpp#L1002

Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1796661/comments/6

------------------------------------------------------------------------
On 2019-01-23T16:20:35+00:00 Gijskruitbosch+bugs wrote:

(In reply to Troels Liebe Bentsen from comment #2)

> Don't really know if this is the right location:
> 
> https://github.com/mozilla/gecko-dev/blob/7ccc9d8b0bd9f879b6f24f15d8416493228697ac/xpcom/io/nsLocalFileUnix.cpp#L1002

So I guess if there's a permission error we should also try copying? The
thing is, it seems like permission errors might not necessarily imply
that moves will fail but copies will work... OTOH maybe it's worth
trying and we could still give up after the copy fails...

Triage suspects the downloads code is probably using OS.File, so moving
there first, though it's possible that the XPCOM nsILocalFile unix
implementation also needs changing.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1796661/comments/9

------------------------------------------------------------------------
On 2019-01-27T20:20:19+00:00 Troels Liebe Bentsen wrote:

There is also a bit of discussion on changing the behaviour of fscrypt
to use EXDEV instead:

https://github.com/google/fscrypt/issues/124

But why is Firefox using the /tmp folder in the first place, would it
not be better to do a tmp file in the same folder to start with and then
maybe fall back to /tmp if that fails?

Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1796661/comments/10


** Changed in: firefox
       Status: Unknown => New

** Changed in: firefox
   Importance: Unknown => Medium

** Bug watch added: github.com/google/fscrypt/issues #124
   https://github.com/google/fscrypt/issues/124

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1796661

Title:
  Firefox can't download files to an fscrypt protected, unlocked folder

To manage notifications about this bug go to:
https://bugs.launchpad.net/firefox/+bug/1796661/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to