Closed Bug 557047 Opened 15 years ago Closed 13 years ago

Replace mailnews specific ifdef (MOZ_MAIL_NEWS) in cookie code with tests for a protocol flag

Categories

(Core :: Networking: Cookies, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla11

People

(Reporter: sgautherie, Assigned: standard8)

References

()

Details

Attachments

(2 files, 4 obsolete files)

And update comm-central in sync, of course. /configure.in { 6319 if test -n "$MOZ_PLACES"; then 6321 if test -z "$MOZ_MAIL_NEWS"; then 6322 MOZ_MORK= 6323 fi 6325 fi } The current m-c defaults are MOZ_PLACES=1 and MOZ_MORK=1: this seems a little odd wrt this code. The values and the code should be reworked to be more explicit. /extensions/cookie/nsCookiePermission.cpp { 93 #ifdef MOZ_MAIL_NEWS 94 // returns PR_TRUE if URI appears to be the URI of a mailnews protocol 95 // XXXbz this should be a protocol flag, not a scheme list, dammit! 96 static PRBool 97 IsFromMailNews(nsIURI *aURI) 98 { 107 } 108 #endif 197 nsCookiePermission::CanAccess(nsIURI *aURI, 200 { 201 #ifdef MOZ_MAIL_NEWS 204 if (IsFromMailNews(aURI)) { 208 #endif // MOZ_MAIL_NEWS } At least, rename it to "DENY_MAILNEWS_COOKIES" or the like. Ideally, bz seems to suggest that each protocol should have a flag to allow/deny cookies ... which should let us get rid of these #ifdef :-)
(In reply to comment #0) > /configure.in Dupe of bug 556253 which I just haven't checked in yet. > /extensions/cookie/nsCookiePermission.cpp ... > At least, rename it to "DENY_MAILNEWS_COOKIES" or the like. > Ideally, bz seems to suggest that each protocol should have a flag to > allow/deny cookies ... which should let us get rid of these #ifdef :-) IMHO renaming is a waste of time and effort and it would be better to consider a long term solution for cookies (for which there are various bugs filed that would cover it iirc).
Depends on: 556253
Component: Build Config → Networking: Cookies
QA Contact: build-config → networking.cookies
Assignee: nobody → mbanner
Summary: "Replace" MOZ_MAIL_NEWS in mozilla-central → Replace mailnews specific ifdef (MOZ_MAIL_NEWS) in cookie code with tests for a protocol flag
Attached patch WIP mozilla-central patch (obsolete) — Splinter Review
The basic idea here is to provide an opt-out flag for the URI to not allow it to access cookies. I'll attach the comm-central patch in a moment. The patches work together for Thunderbird and pass tests, but I still need to fix (separate out) the unit test for TestCookie.cpp so that it keeps passing for Firefox, as Firefox doesn't have the mailnews protocols defined.
Attached patch WIP comm-central patch (obsolete) — Splinter Review
Attached patch Proposed fix (mozilla-central) (obsolete) — Splinter Review
So the mailnews cookie tests will be covered by the comm-central patch, hence we shouldn't really need them in the mozilla-central one. I'm going to push this to try and see if it comes back green.
Attachment #556001 - Attachment is obsolete: true
Attachment #567849 - Attachment description: Proposed fix → Proposed fix (mozilla-central)
Try run for 019ee71450ce is complete. Detailed breakdown of the results available here: https://tbpl.mozilla.org/?tree=Try&rev=019ee71450ce Results (out of 4 total builds): exception: 3 failure: 1 Builds available at http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/bugzilla@standard8.plus.com-019ee71450ce
The previous patch had forgotten to take account of the PRBool rename.
Attachment #567849 - Attachment is obsolete: true
Try run for d8022c1e9bf7 is complete. Detailed breakdown of the results available here: https://tbpl.mozilla.org/?tree=Try&rev=d8022c1e9bf7 Results (out of 65 total builds): success: 54 warnings: 4 failure: 7 Builds available at http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/bugzilla@standard8.plus.com-d8022c1e9bf7
Attached patch Proposed fix (comm-central) (obsolete) — Splinter Review
This is the comm-central part of the fix, with unit test.
Attachment #556002 - Attachment is obsolete: true
Attachment #568406 - Flags: review?(dbienvenu)
Comment on attachment 567880 [details] [diff] [review] Proposed fix v2 (mozilla-central) Try server passed, the only failures where random orange. This gets the mailnews specific cookie stuff out of gecko and allows protocols to forbid cookies individually.
Attachment #567880 - Flags: superreview?(bzbarsky)
Attachment #567880 - Flags: review?(dwitte)
Attachment #567880 - Flags: superreview?(bzbarsky) → superreview+
Depends on: 686278
Note for the build to work for Thunderbird in comm-central, the patch from bug 686278 must be applied first.
Comment on attachment 568406 [details] [diff] [review] Proposed fix (comm-central) for some reason, my build failed in ldap with these two patches applied. I'll try a clobber build next.
Comment on attachment 568406 [details] [diff] [review] Proposed fix (comm-central) ugh, apologies, but I've tried this several times, and my Windows build fails here: nsLDAPService.cpp c:/builds/tbirdhq/objdir-tb/ldap/xpcom/src/../../../../ldap/xpcom/src/nsLDAPURL. cpp(48) : fatal error C1083: Cannot open include file: 'nsMsgUtils.h': No such f ile or directory c:\builds\tbirdhq\config\rules.mk:1308:0: command 'c:/mozilla-build/python/pytho n2.6.exe -O c:/builds/tbirdhq/mozilla/build/cl.py cl -FonsLDAPURL.obj -c -D_HAS_ If I back out the patches, the build is fine. Clobbering didn't help.
Attachment #568406 - Flags: review?(dbienvenu) → review-
oh, I should say, I'm doing a pymake; not sure if that matters or not.
Comment on attachment 568406 [details] [diff] [review] Proposed fix (comm-central) Did you apply the patch from the blocking bug?
Attachment #568406 - Flags: review- → review?(dbienvenu)
ah, sorry, I read that as having to apply the moz-central patch. With the other patch applied, this does build. The protocol tests (imap, mailbox, nntp) are failing, however. Perhaps I need to do a clobber build.
clobber build didn't help - still seeing the protocol tests failing: TEST-UNEXPECTED-FAIL | c:/builds/tbirdhq/objdir-tb/mozilla/_tests/xpcshell/mailn ews/local/test/unit/test_mailboxProtocol.js | 32928 == 160 - See following stack : JS frame :: c:\builds\tbirdhq\mozilla\testing\xpcshell\head.js :: do_throw :: li ne 453 JS frame :: c:\builds\tbirdhq\mozilla\testing\xpcshell\head.js :: _do_check_eq : : line 547 JS frame :: c:\builds\tbirdhq\mozilla\testing\xpcshell\head.js :: do_check_eq :: line 568 JS frame :: c:/builds/tbirdhq/objdir-tb/mozilla/_tests/xpcshell/mailnews/local/t est/unit/test_mailboxProtocol.js :: run_test :: line 30 JS frame :: c:\builds\tbirdhq\mozilla\testing\xpcshell\head.js :: _execute_test I'll try without the patches, I guess.
Oh, they are because we're testing the default protocol flags for those protocols and I've now changed the default flags. I'll fix in a bit once my compile's finished.
Fixed the unit tests.
Attachment #568406 - Attachment is obsolete: true
Attachment #568900 - Flags: review?(dbienvenu)
Attachment #568406 - Flags: review?(dbienvenu)
Comment on attachment 568900 [details] [diff] [review] Proposed fix v2 (comm-central) thx, that works. Since this is just test code that's being moved, I won't complain about the egregious code duplication :-)
Attachment #568900 - Flags: review?(dbienvenu) → review+
Comment on attachment 567880 [details] [diff] [review] Proposed fix v2 (mozilla-central) Not heard anything from dwitte :-( So trying some other cookie peers...
Attachment #567880 - Flags: review?(sdwilsh)
Attachment #567880 - Flags: review?(mconnor)
Attachment #567880 - Flags: review?(dwitte)
Comment on attachment 567880 [details] [diff] [review] Proposed fix v2 (mozilla-central) Review of attachment 567880 [details] [diff] [review]: ----------------------------------------------------------------- r=sdwilsh
Attachment #567880 - Flags: review?(sdwilsh) → review+
Attachment #567880 - Flags: review?(mconnor)
Status: NEW → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
This changeset has been pointed out by the email regression detector in dev.tree-management. Could you please have a look at it? Talos Regression :( Dromaeo (SunSpider) decrease 4.03% on Win7 Firefox-Non-PGO Talos Regression :( Dromaeo (DOM) decrease 3.61% on Linux x64 Firefox-Non-PGO This could have been blamed incorrectly. If so, if you mention it on the thread we can work on narrowing this down to other changes.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: