Open Bug 1264371 Opened 8 years ago Updated 2 years ago

FileReader should throw an exception if the underlying file changes

Categories

(Core :: DOM: Core & HTML, defect, P2)

47 Branch
defect

Tracking

()

People

(Reporter: baku, Assigned: baku)

References

(Depends on 3 open bugs, Blocks 1 open bug)

Details

(Whiteboard: btpp-fixlater)

Attachments

(1 file)

We do something but it's only based on the changing of the size.
We should use File::LastModified and have a version (not exposed) of this method that returns always the up-to-date value.
Whiteboard: btpp-fixlater
Assignee: nobody → amarchesini
Attached patch aaa.patchSplinter Review
Attachment #8741811 - Flags: review?(khuey)
Depends on: 1264977
Depends on: 1264978
Depends on: 1264979
See Also: → 1265602
See Also: → 1265603
Comment on attachment 8741811 [details] [diff] [review]
aaa.patch

Review of attachment 8741811 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/base/File.cpp
@@ +714,5 @@
>  
> +  if (WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate()) {
> +    if (workerPrivate->UsesSystemPrincipal()) {
> +      GetMozFullPathInternal(aFileName, aRv);
> +    }

if (!UsesSystemPrincipal())
  return;

And then only one call to GetMozFullPathInternal.

What's the logic behind this anyways?

::: dom/base/FileWatcher.cpp
@@ +27,5 @@
> +    nsCOMPtr<nsIRunnable> runnable =
> +      NS_NewRunnableMethod(this, &FileWatcherCallback::InitializeInternal);
> +    if (NS_WARN_IF(NS_FAILED(NS_DispatchToMainThread(runnable)))) {
> +      return false;
> +    }

Just MOZ_ALWAYS_SUCCEEDS this. NS_DispatchToMainThread can't really fail.

::: dom/ipc/DOMTypes.ipdlh
@@ +74,5 @@
>    uint64_t length;
>    int64_t modDate;
>  
> +  // The full path of this file, if it points to a real file.
> +  nsString filePath;

Does this only ever go from the chrome process to the content process?  Because we can't trust what the content process gives us, right? (It could give us /etc/passwd/ or something if it's been compromised).
Attachment #8741811 - Flags: review?(khuey)
Blocks: 660148
Priority: -- → P2
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: