Thursday, 27 January 2022

fixes bug #0002045 on alpine linux

--- a/netsurf/frontends/gtk/gettext.c
+++ b/netsurf/frontends/gtk/gettext.c
@@ -27,14 +27,29 @@
#include "utils/messages.h"
#include "gtk/gettext.h"

+char *libintl_gettext(const char *msgid)
+{
+ return dcgettext(NULL, msgid, 0);
+}
+
char *gettext(const char *msgid)
{
return dcgettext(NULL, msgid, 0);
}

+char *libintl_dgettext(const char *domainname, const char *msgid)
+{
+ return dcgettext(domainname, msgid, 0);
+}
+
char *dgettext(const char *domainname, const char *msgid)
{
return dcgettext(domainname, msgid, 0);
+}
+
+char *libintl_dcgettext(const char *domainname, const char *msgid, int category)
+{
+ return dcgettext(domainname, msgid, category);
}

char *dcgettext(const char *domainname, const char *msgid, int category)
--- a/netsurf/frontends/gtk/gettext.h
+++ b/netsurf/frontends/gtk/gettext.h
@@ -25,6 +25,10 @@
#ifndef _NETSURF_GTK_GETTEXT_MESSAGES_H_
#define _NETSURF_GTK_GETTEXT_MESSAGES_H_

+char *libintl_gettext(const char *msgid);
+char *libintl_dgettext(const char *domainname, const char *msgid);
+char *libintl_dcgettext(const char *domainname, const char *msgid, int category);
+
char *gettext(const char *msgid);
char *dgettext(const char *domainname, const char *msgid);
char *dcgettext(const char *domainname, const char *msgid, int category);
hello there,

it looks like gtk3 on alpine linux uses libintl_*gettext functions
instead of plain *gettext, so we need to override those functions too
to get the preferences window to display correct messages.

i have attached a patch to fix it.

Friday, 21 January 2022

Re: Using Netsurf cookies with wget

On 2022-01-21 13:17, Harriet Bazley wrote:
> On 21 Jan 2022 as I do recall,
> Jeremy Nicoll - ml netsurf wrote:

>> Also, the form when used on a webpage, sets variable
>> "user_remember_me"
>> and (I'm not completely sure) maybe also the submit button part sets
>> something - I don't know why it defines a name and a value - the
>> latter
>> is the text on the button but what's "name" for?
>
> That's just a 'Remember Me' (and don't ask for log-in again but
> redirect
> to the stats page) button.

It's not just that. The form code has

<input name="user[remember_me]" type="hidden" value="0"/>
<input type="checkbox" value="1" name="user[remember_me]"
id="user_remember_me"/>

(odd that there's two such definitions, but maybe JS on the page hides
one
of them completely). Nevertheless one would expect the POST request
sent
to the server to contain "&user_remember_me=0" (or =1) and maybe the
server ignore requests that arrive without all the required parameters.




> I'm afraid I don't know enough about HTML forms to understand exactly
> what the Submit button is doing, but the page only prompts for two user
> inputs in this form.

Yes, but type=hidden means there's entries in the form that do do things
even if you don't see them. You should maybe read this, and the pages
around it that discuss various aspects of forms

https://www.w3schools.com/tags/att_input_type_hidden.asp


I see from one of your other posts that you've found that pages have
unique content. I'd guess that the server is using (eg) php session ids
& it's sending the id of the session it's established for you to the
page
so the page can send that back on successive requests. The id (and
maybe
other values) would likely be used as a key in a database on the server
that's storing a whole set of user- & session- specific information.


--
Jeremy Nicoll - my opinions are my own
_______________________________________________
netsurf-users mailing list -- netsurf-users@netsurf-browser.org
To unsubscribe send an email to netsurf-users-leave@netsurf-browser.org

Re: Using Netsurf cookies with wget

>> there might be hidden input fields, [...]
> Ah - I think I may have spotted something. The actual <form> tag at
> the start contains an 'authenticity token':

[reformatted for readability]
> <form class="new_user" id="new_user" action="/users/login"
> accept-charset="UTF-8" method="post">
> <input name="utf8" type="hidden" value="&#x2713;"/>
> <input type="hidden" name="authenticity_token" value="VfGGu3jwjsf6xNQmlmuu3Qkgc1BsZzgu0ikhluwqmVHU9RFVQQUUANuaza9HFgXr_c71SiKwBLz8XA8bQ4hSOA"/>
> [...]
> </form>

There's also that "utf8" field. Amusingly, U+2713, from the Dingbats
range, is CHECK MARK. Of course, who knows what the server would do if
that field weren't there or had a different value, such as maybe U+2718
(an X mark, called HEAVY BALLOT X) or U+00AC (NOT SIGN)....

> And this value is different for every copy of the page served, which
> presumably means that it is, by design, impossible for anyone to log
> in 'blind' with user name and password alone....

Likely. Quite possibly done as a defense against automated
password-guessing bots. Unfortunately, with the current state of
Internet governance, such defenses are close to essential.

The token looks like URL-safe base64. Decoding it under that
assumption produces random-looking binary data, so I suspect it is (as
should be) being done with proper crypto.

/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents-montreal.org
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
_______________________________________________
netsurf-users mailing list -- netsurf-users@netsurf-browser.org
To unsubscribe send an email to netsurf-users-leave@netsurf-browser.org

Re: Using Netsurf cookies with wget

On 21 Jan 2022 as I do recall,
Michael Drake wrote:

>
> On 21/01/2022 13:17, Harriet Bazley wrote:
>
> > Then the browser history getting updated with the new page and a
> > FETCH_REDIRECT from the login page to the user home page. No record of
> > what data was sent to the server, that I can see.
>
> In your Choices file, try setting:
>
> suppress_curl_debug:0
>
That doesn't seem to make any difference, despite quitting and
restarting (so far as I can tell by eye, the two log files are identical
around that area in terms of what gets logged following the 'keydown'
events).

I tried it using the search box form, in order to simplify the amount of
logging-in, quitting, and logging-out I had to do, and you just get a
fetch_curl_setup with the URL of the page being fetched - which in the
case of the search form, contains the 'work_search?query=' data encoded
as part of the URL itself. Unfortunately in the case of the login form
the variables submitted are not present in the URL of the resulting
page!


--
Harriet Bazley == Loyaulte me lie ==

Radioactive cats have 18 half-lives.
_______________________________________________
netsurf-users mailing list -- netsurf-users@netsurf-browser.org
To unsubscribe send an email to netsurf-users-leave@netsurf-browser.org

Re: Using Netsurf cookies with wget

On 21 Jan 2022 as I do recall,
Mouse wrote:

> > I'm afraid I don't know enough about HTML forms to understand exactly
> > what the Submit button is doing,
>
> HTML forms, I think, just generate a POST when submitting. But just
> prompting for two visible inputs doesn't mean there are only two
> input fields in the POST; there might be hidden input fields, fields
> which aren't displayed, being there just to pass values through from
> page generation to form submission. Read the HTML source for the form
> if you want to check that possibility.
>

Ah - I think I may have spotted something. The actual <form> tag at the
start contains an 'authenticity token':


<div id="loginform">
<form class="new_user" id="new_user" action="/users/login" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="&#x2713;"/><input type="hidden" name="authenticity_token" value="VfGGu3jwjsf6xNQmlmuu3Qkgc1BsZzgu0ikhluwqmVHU9RFVQQUUANuaza9HFgXr_c71SiKwBLz8XA8bQ4hSOA"/>
<dl>
<dt><label for="user_login">User name or email:</label></dt>
<dd><input type="text" name="user[login]" id="user_login"/></dd>
<dt><label for="user_password">Password:</label></dt>
<dd><input type="password" name="user[password]" id="user_password"/></dd>
<dt><label for="user_remember_me">Remember me</label></dt>
<dd><input name="user[remember_me]" type="hidden" value="0"/><input type="checkbox" value="1" name="user[remember_me]" id="user_remember_me"/></dd>
<dt class="landmark">Submit</dt>
<dd class="submit actions">
<input type="submit" name="commit" value="Log in" class="submit"/>
</dd>
</dl>
</form>
</div>

And this value is different for every copy of the page served, which
presumably means that it is, by design, impossible for anyone to log in
'blind' with user name and password alone....

--
Harriet Bazley == Loyaulte me lie ==

The best laid schemes o' mice and men gang oft a-gley.
_______________________________________________
netsurf-users mailing list -- netsurf-users@netsurf-browser.org
To unsubscribe send an email to netsurf-users-leave@netsurf-browser.org

Re: Using Netsurf cookies with wget

> I'm afraid I don't know enough about HTML forms to understand exactly
> what the Submit button is doing,

HTML forms, I think, just generate a POST when submitting. But just
prompting for two visible inputs doesn't mean there are only two
input fields in the POST; there might be hidden input fields, fields
which aren't displayed, being there just to pass values through from
page generation to form submission. Read the HTML source for the form
if you want to check that possibility.

Mouse
_______________________________________________
netsurf-users mailing list -- netsurf-users@netsurf-browser.org
To unsubscribe send an email to netsurf-users-leave@netsurf-browser.org

Re: Using Netsurf cookies with wget

On 21/01/2022 13:17, Harriet Bazley wrote:

> Then the browser history getting updated with the new page and a
> FETCH_REDIRECT from the login page to the user home page. No record of
> what data was sent to the server, that I can see.

In your Choices file, try setting:

suppress_curl_debug:0

--
Michael Drake https://www.codethink.co.uk/
_______________________________________________
netsurf-users mailing list -- netsurf-users@netsurf-browser.org
To unsubscribe send an email to netsurf-users-leave@netsurf-browser.org