After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 679230 - shouldn't refuse cookies for non suffixed domains
shouldn't refuse cookies for non suffixed domains
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
2.39.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2012-07-01 18:42 UTC by Frederic Peters
Modified: 2012-07-17 12:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (3.31 KB, patch)
2012-07-02 14:09 UTC, Sergio Villar
reviewed Details | Review
Handle SOUP_TLD_ERROR_NO_BASE_DOMAIN in soup_tld_domain_is_public_suffix() (1.06 KB, patch)
2012-07-17 10:56 UTC, Carlos Garcia Campos
committed Details | Review

Description Frederic Peters 2012-07-01 18:42:49 UTC
The recent addition of TLD support (5a304922), and the refusal to accept cookies for well known public domains (587464fd) broke access to some intranet applications, as they were called as http://server/ (note the absence of TLD), and this is now treated as a well known public domain.

Valid TLD are listed in effective_tld_names.dat, so it's hopefully possible to handle the situation.

$ grep ^com$ ../data/effective_tld_names.dat 
com
$ grep ^server$ ../data/effective_tld_names.dat 
$
Comment 1 Sergio Villar 2012-07-02 14:09:39 UTC
Created attachment 217837 [details] [review]
Patch

Fixed use case and added a couple of test cases.
Comment 2 Dan Winship 2012-07-04 15:10:48 UTC
Comment on attachment 217837 [details] [review]
Patch

>+  /* Unlisted TLD.*/
>+  { "example", NULL },
>+  /* Do not check these 3 because we do not want to force every URL to have a public suffix. */
>   /* { "example.example", NULL }, */
>   /* { "b.example.example", NULL }, */
>   /* { "a.b.example.example", NULL }, */

Why shouldn't those be uncommented as well? If, as the comment says, we don't want to force every URL to have a public suffix, then doesn't that mean we should return NULL for those domains?

Looking at soup_tld_get_base_domain_internal():

	/* We hit the top domain, use it if it's listed as valid. */
	if (!next_dot) {
		tld = cur_domain;
		break;
	}

but the code doesn't do what the comment says; if the domain was listed, we would have dealt with it above. Shouldn't this return an error and NULL? (Making that change makes the commented-out tests pass as well.)
Comment 3 Dan Winship 2012-07-16 22:04:41 UTC
I committed the patch with my suggested change, to get this in for the
release today. Reopen if this turns out to be wrong...
Comment 4 Carlos Garcia Campos 2012-07-17 10:53:49 UTC
Reopening, because soup_tld_domain_is_public_suffix() still returns TRUE for non suffixed domains. I think we need to handle SOUP_TLD_ERROR_NO_BASE_DOMAIN error and return FALSE in that case.
Comment 5 Carlos Garcia Campos 2012-07-17 10:56:53 UTC
Created attachment 219004 [details] [review]
Handle SOUP_TLD_ERROR_NO_BASE_DOMAIN in soup_tld_domain_is_public_suffix()
Comment 6 Carlos Garcia Campos 2012-07-17 12:34:20 UTC
Pushed.