Closed Bug 346184 Opened 18 years ago Closed 18 years ago

If urlclassifier.sqlite is removed, db is not repopulated

Categories

(Toolkit :: Safe Browsing, defect)

2.0 Branch
x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 2 beta2

People

(Reporter: vlad, Assigned: tony)

Details

(Keywords: fixed1.8.1, Whiteboard: [has patch])

Attachments

(2 files, 1 obsolete file)

After fixing bug 334174 and purposely corrupting the urlclassifier.sqlite db, the database is deleted and a new one is opened.  However, the new database stays at 0-size, never getting populated.  My guess is that safe browsing records that it downloaded the data once and then doesn't do so again, maybe?
Flags: blocking-firefox2?
Version: Trunk → 2.0 Branch
Assignee: nobody → tony
(some notes to myself)

Anti-phishing keeps track of table version numbers in user prefs.  So if the DB is corrupt and we remove it, we should delete those prefs.

Look around NS_ERROR_FILE_CORRUPTED in nsUrlClassifierDBService.cpp.
I'd suggest using TableExists() to check for the presence of one of the url classifier's data tables, and nuking the prefs if they're not present.  That way you cover the case of urclassifier.sqlite being removed by the user as well
Flags: blocking-firefox2? → blocking-firefox2+
This has to be done async because the db is on one thread but we can only clear prefs from the main thread.

I also removed the callback wrapper since we don't need it anymore.  Also removed checkMac_ from listmanager.js since we don't use it either.
Attachment #231168 - Flags: review?(darin)
Tony, some virus scanners appear to be picking up urlclassifier.sqlite-journal due to the phishing urls
http://forums.mozillazine.org/viewtopic.php?t=445171
But they don't pick up urlclassifier.sqlite? curious, I guess they're just watching for file creation or something?

This could be pretty painful for the release, though. =/
(In reply to comment #4)
> Tony, some virus scanners appear to be picking up urlclassifier.sqlite-journal
> due to the phishing urls
> http://forums.mozillazine.org/viewtopic.php?t=445171

This is bug 329715.  I tried reproducing using AntiVir, but can't seem to get it to trigger.  I'll try again on windows.
Whiteboard: [has patch][needs review darin]
Comment on attachment 231168 [details] [diff] [review]
v1: check db tables before sending an update request

>Index: toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp

>+    const nsDependentCSubstring &tableName = Substring(tableNames, cur,
>+                                                       next - cur);

For things like this, if you want to type slightly less, I think you
can just do:

      const nsCSubstring &tableName = Substring(...)

That also nicely hides the "nsDependentCSubstring" type, which I believe
is  somewhat of an implementation detail.

r=darin
Attachment #231168 - Flags: review?(darin) → review+
Attachment #231168 - Attachment is obsolete: true
on trunk
Attached patch bonecho patchSplinter Review
Patch for bonecho.  Still keeps the callback wrapper since bug 337492 is targetted at moz 1.9.
Target Milestone: --- → Firefox 2 beta2
Attachment #231641 - Flags: approval1.8.1?
Whiteboard: [has patch][needs review darin] → [has patch]
Comment on attachment 231641 [details] [diff] [review]
bonecho patch

a=mconnor on behalf of drivers for checkin to 1.8 branch for 1.8.1
Attachment #231641 - Flags: approval1.8.1? → approval1.8.1+
on branch
Status: NEW → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: