diff -Nru xombrero-1.4.0/Makefile xombrero-1.5.0/Makefile --- xombrero-1.4.0/Makefile 2012-12-21 09:18:21.000000000 +0000 +++ xombrero-1.5.0/Makefile 2013-05-16 16:12:42.000000000 +0000 @@ -23,7 +23,6 @@ .endif LIBS+= libsoup-2.4 LIBS+= gnutls -LIBS+= gthread-2.0 GTK_CFLAGS!= pkg-config --cflags $(LIBS) GTK_LDFLAGS!= pkg-config --libs $(LIBS) CFLAGS+= $(GTK_CFLAGS) diff -Nru xombrero-1.4.0/debian/NEWS xombrero-1.5.0/debian/NEWS --- xombrero-1.4.0/debian/NEWS 2012-12-21 09:14:13.000000000 +0000 +++ xombrero-1.5.0/debian/NEWS 2013-05-16 19:02:19.000000000 +0000 @@ -1,11 +1,11 @@ -xombrero (2:1.3.1-1) unstable; urgency=low +xombrero (2:1.5.0-1) unstable; urgency=low xxxterm has been renamed to xombrero. - The new xombrero package replaces the old xxxterm package after upstreams - renamed it. The migration from xxxterm package user configurations is pretty - simple: just rename .xxxterm and .xxxterm.conf to .xombrero and .xombrero.conf - respectively. Also, change the config file if you have any xxxterm references - in there. + The new xombrero package replaces the old xxxterm package after + upstreams renamed it. The migration from xxxterm package user + configurations is pretty simple: just rename .xxxterm and .xxxterm.conf + to .xombrero and .xombrero.conf respectively. Also, change the config + file if you have any xxxterm references in there. - -- Luis Henriques Fri, 16 Nov 2012 14:46:36 +0000 + -- Luis Henriques Mon, 18 Mar 2013 22:48:06 +0000 diff -Nru xombrero-1.4.0/debian/changelog xombrero-1.5.0/debian/changelog --- xombrero-1.4.0/debian/changelog 2013-03-10 13:32:47.000000000 +0000 +++ xombrero-1.5.0/debian/changelog 2013-05-26 09:28:08.000000000 +0000 @@ -1,14 +1,20 @@ -xombrero (1.4.0-1~ppa2) quantal; urgency=low +xombrero (1.5.0-1~ppa1) quantal; urgency=low * Backport with good version number. - -- Julien Lavergne Sun, 10 Mar 2013 14:32:40 +0100 + -- Julien Lavergne Sun, 26 May 2013 11:27:15 +0200 -xombrero (2:1.4.0-2) quantal; urgency=low +xombrero (2:1.5.0-1~saucy1) saucy; urgency=low - Patch 0006-Fix-Downloads-dir.patch + * No-change backport to saucy + + -- Unit 193 Thu, 16 May 2013 16:32:49 -0400 + +xombrero (2:1.5.0-1) raring; urgency=low + + * New upstream release - -- Unit 193 Sat, 22 Dec 2012 23:48:24 -0500 + -- Unit 193 Thu, 16 May 2013 15:00:41 -0400 xombrero (2:1.4.0-1) quantal; urgency=low @@ -31,7 +37,7 @@ xombrero (2:1.3.1-2) quantal; urgency=low - Add rule to build for GTK2, fixes flash. + Add rule to build for GTK2, fixes plugins. -- Unit 193 Wed, 28 Nov 2012 01:00:47 -0500 diff -Nru xombrero-1.4.0/debian/copyright xombrero-1.5.0/debian/copyright --- xombrero-1.4.0/debian/copyright 2012-12-21 09:14:13.000000000 +0000 +++ xombrero-1.5.0/debian/copyright 2013-05-16 19:34:31.000000000 +0000 @@ -9,7 +9,16 @@ 2011 Todd T. Fries 2011 Raphael Graf 2011 Michal Mazurek - 2012 Josh Rickmar +License: ISC + +Files: about.c whitelist.c xombrero.c +Copyright: 2010, 2011 Marco Peereboom + 2011 Stevan Andjelkovic + 2010, 2011, 2012 Edd Barrett + 2011 Todd T. Fries + 2011 Raphael Graf + 2011 Michal Mazurek + 2012 Josh Rickmar License: ISC Files: ascii2txt.pl @@ -79,6 +88,16 @@ Copyright: 2011 Todd T. Fries License: ISC +Files: settings.c +Copyright: 2010, 2011 Marco Peereboom + 2011 Stevan Andjelkovic + 2010, 2011 Edd Barrett + 2011 Todd T. Fries + 2011 Raphael Graf + 2011 Michal Mazurek + 2012 Josh Rickmar +License: ISC + Files: tld-rules Copyright: 2007 Jo Hermans Ruben Arakelyan @@ -120,7 +139,7 @@ Copyright: 2009 vetinari License: CC-BY-SA -Files: freebsd/freebsd.c dragonfly/dragonfly.c netbsd/netbsd.c +Files: freebsd/freebsd.c dragonfly/dragonfly.c Copyright: 2001, 2002, 2003 Ian F. Darwin License: BSD-3-clause @@ -128,6 +147,12 @@ Copyright: 2010 Marco Peereboom License: ISC +Files: netbsd/netbsd.c +Copyright: 2001, 2002, 2003 Ian F. Darwin + 2004 Ted Unangst + 2004 Todd Miller +License: BSD-3-clause and ISC + Files: *.png *.xpm Copyright: 2010, 2011 Marco Peereboom 2011 Stevan Andjelkovic @@ -137,8 +162,12 @@ 2011 Michal Mazurek License: CC-BY +Files: tordisabled.ico torenabled.ico +Copyright: The Tor Project, Inc. +License: CC-BY + Files: debian/* -Copyright: 2011, 2012 Luis Henriques +Copyright: 2011 Luis Henriques License: ISC License: MIT @@ -435,7 +464,80 @@ from You. This License may not be modified without the mutual written agreement of the Licensor and You. +License: MPL-1.1 + The contents of this file are subject to the Mozilla Public License Version 1.1 + (the "License"); you may not use this file except in compliance with the + License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ + . + Software distributed under the License is distributed on an "AS IS" basis, + WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for + the specific language governing rights and limitations under the License. + . + The Original Code is the Public Suffix List. + . + The Initial Developer of the Original Code is + Jo Hermans . + Portions created by the Initial Developer are Copyright (C) 2007 + the Initial Developer. All Rights Reserved. + . + Contributor(s): + Ruben Arakelyan + Gervase Markham + Pamela Greene + David Triendl + Jothan Frakes + The kind representatives of many TLD registries + . + Alternatively, the contents of this file may be used under the terms of either + the GNU General Public License Version 2 or later (the "GPL"), or the GNU + Lesser General Public License Version 2.1 or later (the "LGPL"), in which case + the provisions of the GPL or the LGPL are applicable instead of those above. If + you wish to allow use of your version of this file only under the terms of + either the GPL or the LGPL, and not to allow others to use your version of this + file under the terms of the MPL, indicate your decision by deleting the + provisions above and replace them with the notice and other provisions required + by the GPL or the LGPL. If you do not delete the provisions above, a recipient + may use your version of this file under the terms of any one of the MPL, the + GPL or the LGPL. + +License: GPL-2+ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + . + This program is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + PARTICULAR PURPOSE. See the GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License along with + this package; if not, write to the Free Software Foundation, Inc., 51 Franklin + St, Fifth Floor, Boston, MA 02110-1301 USA + . + On Debian systems, the full text of the GNU General Public License version 2 + can be found in the file `/usr/share/common-licenses/GPL-2'. + +License: LGPL-2.1+ + This library is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free + Software Foundation; either version 2.1 of the License, or (at your option) any + later version. + . + This library is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + details. + . + You should have received a copy of the GNU Lesser General Public License along + with this library; if not, write to the Free Software Foundation, Inc., 51 + Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + . + On Debian systems, the complete text of the GNU Lesser General Public License + (LGPL) may be found in `/usr/share/common-licenses/LGPL-2.1'. + License: CC-BY-SA + Creative Commons Attribution-ShareAlike 3.0 Unported + . CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION @@ -808,75 +910,4 @@ time to time. For the avoidance of doubt, this trademark restriction does not form part of the License. . - Creative Commons may be contacted at http://creativecommons.org/. - -License: MPL-1.1 - The contents of this file are subject to the Mozilla Public License Version 1.1 - (the "License"); you may not use this file except in compliance with the - License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ - . - Software distributed under the License is distributed on an "AS IS" basis, - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for - the specific language governing rights and limitations under the License. - . - The Original Code is the Public Suffix List. - . - The Initial Developer of the Original Code is - Jo Hermans . - Portions created by the Initial Developer are Copyright (C) 2007 - the Initial Developer. All Rights Reserved. - . - Contributor(s): - Ruben Arakelyan - Gervase Markham - Pamela Greene - David Triendl - Jothan Frakes - The kind representatives of many TLD registries - . - Alternatively, the contents of this file may be used under the terms of either - the GNU General Public License Version 2 or later (the "GPL"), or the GNU - Lesser General Public License Version 2.1 or later (the "LGPL"), in which case - the provisions of the GPL or the LGPL are applicable instead of those above. If - you wish to allow use of your version of this file only under the terms of - either the GPL or the LGPL, and not to allow others to use your version of this - file under the terms of the MPL, indicate your decision by deleting the - provisions above and replace them with the notice and other provisions required - by the GPL or the LGPL. If you do not delete the provisions above, a recipient - may use your version of this file under the terms of any one of the MPL, the - GPL or the LGPL. - -License: GPL-2+ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - . - This program is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - PARTICULAR PURPOSE. See the GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License along with - this package; if not, write to the Free Software Foundation, Inc., 51 Franklin - St, Fifth Floor, Boston, MA 02110-1301 USA - . - On Debian systems, the full text of the GNU General Public License version 2 - can be found in the file `/usr/share/common-licenses/GPL-2'. - -License: LGPL-2.1+ - This library is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free - Software Foundation; either version 2.1 of the License, or (at your option) any - later version. - . - This library is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - details. - . - You should have received a copy of the GNU Lesser General Public License along - with this library; if not, write to the Free Software Foundation, Inc., 51 - Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - . - On Debian systems, the complete text of the GNU Lesser General Public License - (LGPL) may be found in `/usr/share/common-licenses/LGPL-2.1'. + Creative Commons may be contacted at http://creativecommons.org/. diff -Nru xombrero-1.4.0/debian/patches/0001-Change-default-homepage.patch xombrero-1.5.0/debian/patches/0001-Change-default-homepage.patch --- xombrero-1.4.0/debian/patches/0001-Change-default-homepage.patch 2012-12-21 09:58:30.000000000 +0000 +++ xombrero-1.5.0/debian/patches/0001-Change-default-homepage.patch 2013-05-16 18:41:40.000000000 +0000 @@ -10,13 +10,15 @@ privately as xombrero does not have any public mailing list). Forwarded: yes + +Signed-off-by: Luis Henriques --- xombrero.conf | 8 ++++---- xombrero.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xombrero.conf b/xombrero.conf -index 14bce15..1ea627c 100644 +index b4b3f37..d7d64b4 100644 --- a/xombrero.conf +++ b/xombrero.conf @@ -27,7 +27,7 @@ @@ -46,10 +48,10 @@ diff --git a/xombrero.h b/xombrero.h -index 7e97d88..805b750 100644 +index ce3b77c..5bdeae6 100644 --- a/xombrero.h +++ b/xombrero.h -@@ -661,7 +661,7 @@ int command_mode(struct tab *, struct karg *); +@@ -657,7 +657,7 @@ int command_mode(struct tab *, struct karg *); #define XT_DS_SSL_CA_FILE ("") #define XT_DS_ENABLE_STRICT_TRANSPORT TRUE #define XT_DS_APPEND_NEXT (1) diff -Nru xombrero-1.4.0/debian/patches/0002-Fix-resources-dir.patch xombrero-1.5.0/debian/patches/0002-Fix-resources-dir.patch --- xombrero-1.4.0/debian/patches/0002-Fix-resources-dir.patch 2012-12-21 10:00:36.000000000 +0000 +++ xombrero-1.5.0/debian/patches/0002-Fix-resources-dir.patch 2013-05-16 18:42:20.000000000 +0000 @@ -1,22 +1,24 @@ -From: Luis Henriques -Date: Fri, 16 Nov 2012 13:39:39 +0000 +From: Luis Henriques +Date: Fri, 1 Mar 2013 15:24:31 +0000 Subject: Fix resources dir Resources path is hard-coded both on the source code and on the configuration -file. This patch updates these references as Debian does not use /usr/local for -packages installation. +file. This patch updates these references as Debian does not use +/usr/local for packages installation. -Upstream is not interested in changing this as its main target OS (OpenBSD) uses -this location for its packages. +Upstream is not interested in changing this as its main target OS (OpenBSD) +uses this location for its packages. Forwarded: yes + +Signed-off-by: Luis Henriques --- xombrero.conf | 4 ++-- xombrero.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xombrero.conf b/xombrero.conf -index 1ea627c..41e8e33 100644 +index d7d64b4..fd5564a 100644 --- a/xombrero.conf +++ b/xombrero.conf @@ -55,7 +55,7 @@ @@ -38,10 +40,10 @@ # url_regex = ^[[:blank:]]*[^[:blank:]]*([[:alnum:]-]+\.)+[[:alnum:]-][^[:blank:]]*[[:blank:]]*$ # gnutls_priority_string = NORMAL:%COMPAT diff --git a/xombrero.h b/xombrero.h -index 805b750..99189e6 100644 +index 5bdeae6..4238465 100644 --- a/xombrero.h +++ b/xombrero.h -@@ -688,7 +688,7 @@ int command_mode(struct tab *, struct karg *); +@@ -684,7 +684,7 @@ int command_mode(struct tab *, struct karg *); #define XT_DS_ALLOW_INSECURE_CONTENT (TRUE) #define XT_DS_ALLOW_INSECURE_SCRIPTS (TRUE) #define XT_DS_WARN_CERT_CHANGES (0) diff -Nru xombrero-1.4.0/debian/patches/0003-Unnecessary-lib-directory-installation.patch xombrero-1.5.0/debian/patches/0003-Unnecessary-lib-directory-installation.patch --- xombrero-1.4.0/debian/patches/0003-Unnecessary-lib-directory-installation.patch 2012-12-21 09:33:52.000000000 +0000 +++ xombrero-1.5.0/debian/patches/0003-Unnecessary-lib-directory-installation.patch 2013-05-16 18:46:30.000000000 +0000 @@ -6,15 +6,17 @@ the makefile. Forwarded: yes + +Signed-off-by: Luis Henriques --- linux/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/linux/Makefile b/linux/Makefile -index 389daff..a5f9a69 100644 +index 3c9bcf5..095e34f 100644 --- a/linux/Makefile +++ b/linux/Makefile -@@ -20,7 +20,6 @@ +@@ -22,7 +22,6 @@ LDADD+= $(shell pkg-config --libs $(LIBS)) $(JS_LD) -ldl -lgcrypt -lX11 PREFIX?= /usr/local BINDIR?= $(PREFIX)/bin @@ -22,7 +24,8 @@ APPDIR?= $(PREFIX)/share/applications MANDIR?= $(PREFIX)/share/man RESDIR?= $(PREFIX)/share/xombrero -@@ -59,7 +58,6 @@ + +@@ -61,7 +60,6 @@ xombrero: $(OBJS) install: all install -m 755 -d $(DESTDIR)$(BINDIR) @@ -30,4 +33,3 @@ install -m 755 -d $(DESTDIR)$(MANDIR)/man1 install -m 755 -d $(DESTDIR)$(RESDIR) install -m 755 -d $(DESTDIR)$(APPDIR) - diff -Nru xombrero-1.4.0/debian/patches/0004-Fix-lintian-error-hyphen-used-as-minus-sign.patch xombrero-1.5.0/debian/patches/0004-Fix-lintian-error-hyphen-used-as-minus-sign.patch --- xombrero-1.4.0/debian/patches/0004-Fix-lintian-error-hyphen-used-as-minus-sign.patch 2012-12-21 10:02:35.000000000 +0000 +++ xombrero-1.5.0/debian/patches/0004-Fix-lintian-error-hyphen-used-as-minus-sign.patch 2013-05-16 18:47:11.000000000 +0000 @@ -3,12 +3,14 @@ Subject: Fix lintian error "hyphen-used-as-minus-sign" "-" characters have been escaped with "\-" to fix the lintian error. + +Signed-off-by: Luis Henriques --- xombrero.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xombrero.1 b/xombrero.1 -index 73021bf..651f16a 100644 +index 1b57c3b..8473095 100644 --- a/xombrero.1 +++ b/xombrero.1 @@ -66,8 +66,8 @@ section below) in a running @@ -17,12 +19,12 @@ .Cm enable_socket -to be enabled. Example run: xombrero -e "tabnew openbsd.org"; xombrero -e -tabclose; xombrero -e wq. -+to be enabled. Example run: xombrero \-e "tabnew openbsd.org"; xombrero -e ++to be enabled. Example run: xombrero \-e "tabnew openbsd.org"; xombrero -\e +tabclose; xombrero \-e wq. .It Fl S Disable the toolbar. .It Fl s Ar session_name -@@ -1268,7 +1268,7 @@ When enabled the first instance of +@@ -1271,7 +1271,7 @@ When enabled the first instance of will create a socket in the .Pa ~/.xombrero directory. diff -Nru xombrero-1.4.0/debian/patches/0005-Fix-Icon-path-in-desktop-file.patch xombrero-1.5.0/debian/patches/0005-Fix-Icon-path-in-desktop-file.patch --- xombrero-1.4.0/debian/patches/0005-Fix-Icon-path-in-desktop-file.patch 2012-12-21 09:14:13.000000000 +0000 +++ xombrero-1.5.0/debian/patches/0005-Fix-Icon-path-in-desktop-file.patch 2013-04-12 00:17:28.000000000 +0000 @@ -2,8 +2,10 @@ Date: Wed, 18 Jul 2012 21:19:50 -0700 Subject: Fix Icon path in desktop file -desktop file requires the complete path for an Icon if it is not on the standard -paths. +desktop file requires the complete path for an Icon if it is not on the +standard paths. + +Signed-off-by: Luis Henriques --- xombrero.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -Nru xombrero-1.4.0/debian/patches/0006-Fix-Downloads-dir.patch xombrero-1.5.0/debian/patches/0006-Fix-Downloads-dir.patch --- xombrero-1.4.0/debian/patches/0006-Fix-Downloads-dir.patch 2012-12-23 04:45:04.000000000 +0000 +++ xombrero-1.5.0/debian/patches/0006-Fix-Downloads-dir.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -From: Unit 193 -Date: Sat, 22 Dec 2012 23:14:08 -0500 -Subject: Change the downloads dir to ~/Downloads/ - -Forwarded: no ---- ---- xombrero-1.4.0.orig/xombrero.c -+++ xombrero-1.4.0/xombrero.c -@@ -8879,7 +8879,7 @@ main(int argc, char **argv) - - /* download dir */ - if (!strcmp(download_dir, pwd->pw_dir)) -- strlcat(download_dir, PS "downloads", sizeof download_dir); -+ strlcat(download_dir, PS "Downloads", sizeof download_dir); - xxx_dir(download_dir); - - /* first start file */ diff -Nru xombrero-1.4.0/debian/patches/0007-Don-t-install-xombrero.desktop-file.patch xombrero-1.5.0/debian/patches/0007-Don-t-install-xombrero.desktop-file.patch --- xombrero-1.4.0/debian/patches/0007-Don-t-install-xombrero.desktop-file.patch 1970-01-01 00:00:00.000000000 +0000 +++ xombrero-1.5.0/debian/patches/0007-Don-t-install-xombrero.desktop-file.patch 2013-05-16 18:53:13.000000000 +0000 @@ -0,0 +1,29 @@ +From: Luis Henriques +Date: Mon, 18 Mar 2013 22:58:22 +0000 +Subject: Don't install xombrero.desktop file + +lintian complains about intalling xombrero.desktop file into +/usr/share/applications directory. This was a recent change in the +linux/Makefile -- the package used to install the .desktop file from the +debian/install file. + +Forwarded: no + +Signed-off-by: Luis Henriques +--- + linux/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/linux/Makefile b/linux/Makefile +index 095e34f..48020a8 100644 +--- a/linux/Makefile ++++ b/linux/Makefile +@@ -68,7 +68,7 @@ install: all + install -m 755 xombrero $(DESTDIR)$(BINDIR) + install -m 644 ../xombrero.1 $(DESTDIR)$(MANDIR)/man1/xombrero.1 + install -m 644 ../xombrero.css $(DESTDIR)$(RESDIR) +- install -m 644 ../xombrero.desktop $(DESTDIR)$(APPDIR) ++ #install -m 644 ../xombrero.desktop $(DESTDIR)$(APPDIR) + install -m 644 ../xombreroicon16.png $(DESTDIR)$(RESDIR) + install -m 644 ../xombreroicon32.png $(DESTDIR)$(RESDIR) + install -m 644 ../xombreroicon48.png $(DESTDIR)$(RESDIR) diff -Nru xombrero-1.4.0/debian/patches/0008-Fix-Downloads-dir.patch xombrero-1.5.0/debian/patches/0008-Fix-Downloads-dir.patch --- xombrero-1.4.0/debian/patches/0008-Fix-Downloads-dir.patch 1970-01-01 00:00:00.000000000 +0000 +++ xombrero-1.5.0/debian/patches/0008-Fix-Downloads-dir.patch 2013-05-16 18:50:59.000000000 +0000 @@ -0,0 +1,17 @@ +From: Unit 193 +Date: Sat, 22 Dec 2012 23:14:08 -0500 +Subject: Change the downloads dir to ~/Downloads/ + +Forwarded: no +--- +--- xombrero-1.4.0.orig/xombrero.c ++++ xombrero-1.4.0/xombrero.c +@@ -8537,7 +8537,7 @@ main(int argc, char **argv) + + /* download dir */ + if (!strcmp(download_dir, pwd->pw_dir)) +- strlcat(download_dir, PS "downloads", sizeof download_dir); ++ strlcat(download_dir, PS "Downloads", sizeof download_dir); + xxx_dir(download_dir); + + /* first start file */ diff -Nru xombrero-1.4.0/debian/patches/series xombrero-1.5.0/debian/patches/series --- xombrero-1.4.0/debian/patches/series 2012-12-23 04:12:49.000000000 +0000 +++ xombrero-1.5.0/debian/patches/series 2013-05-16 19:36:52.000000000 +0000 @@ -3,4 +3,5 @@ 0003-Unnecessary-lib-directory-installation.patch 0004-Fix-lintian-error-hyphen-used-as-minus-sign.patch 0005-Fix-Icon-path-in-desktop-file.patch -0006-Fix-Downloads-dir.patch +0007-Don-t-install-xombrero.desktop-file.patch +0008-Fix-Downloads-dir.patch diff -Nru xombrero-1.4.0/debian/xombrero.upstream-changelog xombrero-1.5.0/debian/xombrero.upstream-changelog --- xombrero-1.4.0/debian/xombrero.upstream-changelog 2012-12-21 09:22:03.000000000 +0000 +++ xombrero-1.5.0/debian/xombrero.upstream-changelog 2013-05-16 18:58:45.000000000 +0000 @@ -1,3 +1,19 @@ +xombrero version 1.5.0 + + * Fixed a privacy leak caused by using a separate gnutls tls +   connection to grab remote HTTPS certificates which ignored +   http_proxy + * Disabled/removed threading since gnutls sideband thread is no longer +   necessary + * Added command to increment/decrement page numbers in URLs + * Added enable_cache setting to enable/disable cache (disabled by +   default) + * Pluged some memory leaks + * Fixed some warnings and bugs caused by GTK 3.8 + * Added initial OS X build support + * Various Makefile fixes for all platforms + * Fixed typo in manpage + xombrero version 1.4.0 * Add regex support to whitelists diff -Nru xombrero-1.4.0/dragonfly/Makefile xombrero-1.5.0/dragonfly/Makefile --- xombrero-1.4.0/dragonfly/Makefile 2012-11-28 18:23:15.000000000 +0000 +++ xombrero-1.5.0/dragonfly/Makefile 2013-05-16 16:12:42.000000000 +0000 @@ -4,13 +4,13 @@ .else LIBS= gtk+-3.0 webkitgtk-3.0 .endif -LIBS+= libsoup-2.4 gnutls gthread-2.0 +LIBS+= libsoup-2.4 gnutls LDADD= -lutil -lgcrypt -lX11 GTK_CFLAGS!= pkg-config --cflags $(LIBS) GTK_LDFLAGS!= pkg-config --libs $(LIBS) -CFLAGS+= $(GTK_CFLAGS) -O2 -Wall -pthread -I. -I.. -LDFLAGS+= $(GTK_LDFLAGS) -pthread +CFLAGS+= $(GTK_CFLAGS) -O2 -Wall -I. -I.. +LDFLAGS+= $(GTK_LDFLAGS) PREFIX?= /usr/local BINDIR?= $(PREFIX)/bin diff -Nru xombrero-1.4.0/freebsd/Makefile xombrero-1.5.0/freebsd/Makefile --- xombrero-1.4.0/freebsd/Makefile 2012-11-28 18:23:15.000000000 +0000 +++ xombrero-1.5.0/freebsd/Makefile 2013-05-16 16:12:42.000000000 +0000 @@ -4,18 +4,19 @@ .else LIBS= gtk+-3.0 webkitgtk-3.0 .endif -LIBS+= libsoup-2.4 gnutls gthread-2.0 +LIBS+= libsoup-2.4 gnutls LDADD= -lutil -lgcrypt GTK_CFLAGS!= pkg-config --cflags $(LIBS) GTK_LDFLAGS!= pkg-config --libs $(LIBS) -CFLAGS+= $(GTK_CFLAGS) -O2 -Wall -pthread -I. -I.. -LDFLAGS+= $(GTK_LDFLAGS) -pthread +CFLAGS+= $(GTK_CFLAGS) -O2 -Wall -I. -I.. +LDFLAGS+= $(GTK_LDFLAGS) PREFIX?= /usr/local BINDIR?= $(PREFIX)/bin LIBDIR?= $(PREFIX)/lib MANDIR?= $(PREFIX)/man +RESDIR?= $(PREFIX)/share/xombrero CC?= cc diff -Nru xombrero-1.4.0/linux/Makefile xombrero-1.5.0/linux/Makefile --- xombrero-1.4.0/linux/Makefile 2012-12-21 10:01:29.000000000 +0000 +++ xombrero-1.5.0/linux/Makefile 2013-05-16 16:12:42.000000000 +0000 @@ -10,10 +10,12 @@ LIBS= glib-2.0 ifeq ("${GTK_VERSION}", "gtk2") LIBS+= gtk+-2.0 webkit-1.0 +CFLAGS+=-I/usr/include/gtk-2.0 else LIBS+= gtk+-3.0 webkitgtk-3.0 +CFLAGS+=-I/usr/include/gtk-3.0 endif -LIBS+= libsoup-2.4 gthread-2.0 gnutls libbsd +LIBS+= libsoup-2.4 gnutls libbsd CFLAGS+= -O2 -Wall -ggdb3 -D_GNU_SOURCE -I. -I.. $(shell pkg-config --cflags $(LIBS)) $(JS_CF) LDADD+= $(shell pkg-config --libs $(LIBS)) $(JS_LD) -ldl -lgcrypt -lX11 diff -Nru xombrero-1.4.0/netbsd/Makefile xombrero-1.5.0/netbsd/Makefile --- xombrero-1.4.0/netbsd/Makefile 2012-11-28 18:23:15.000000000 +0000 +++ xombrero-1.5.0/netbsd/Makefile 2013-05-16 16:12:42.000000000 +0000 @@ -4,13 +4,13 @@ .else LIBS= gtk+-3.0 webkitgtk-3.0 .endif -LIBS+= libsoup-2.4 gnutls gthread-2.0 +LIBS+= libsoup-2.4 gnutls LDADD= -lutil -lgcrypt -lX11 GTK_CFLAGS!= pkg-config --cflags $(LIBS) GTK_LDFLAGS!= pkg-config --libs $(LIBS) -CFLAGS+= $(GTK_CFLAGS) -O2 -Wall -pthread -I. -I.. -LDFLAGS+= $(GTK_LDFLAGS) -pthread +CFLAGS+= $(GTK_CFLAGS) -O2 -Wall -I. -I.. +LDFLAGS+= $(GTK_LDFLAGS) PREFIX?= /usr/local BINDIR?= $(PREFIX)/bin @@ -115,7 +115,6 @@ .endif LIBS+= libsoup-2.4 LIBS+= gnutls -LIBS+= gthread-2.0 GTK_CFLAGS!= pkg-config --cflags $(LIBS) GTK_LDFLAGS!= pkg-config --libs $(LIBS) CFLAGS+= $(GTK_CFLAGS) diff -Nru xombrero-1.4.0/osx/Makefile xombrero-1.5.0/osx/Makefile --- xombrero-1.4.0/osx/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ xombrero-1.5.0/osx/Makefile 2013-05-16 16:12:42.000000000 +0000 @@ -0,0 +1,96 @@ +LIBS= glib-2.0 +LIBS+= gtk+-2.0 webkit-1.0 +LIBS+= libsoup-2.4 gnutls + +CFLAGS+= -O2 -Wall -D_GNU_SOURCE -I. -I.. $(shell pkg-config --cflags $(LIBS)) $(JS_CF) +LDADD+= $(shell pkg-config --libs $(LIBS)) $(JS_LD) -ldl -lgcrypt -lX11 + +PREFIX?= /usr/local +BINDIR?= $(PREFIX)/bin +LIBDIR?= $(PREFIX)/lib +APPDIR?= $(PREFIX)/share/applications +MANDIR?= $(PREFIX)/share/man +RESDIR?= $(PREFIX)/share/xombrero + +SRCS= $(shell ls ../*.c) +SRCS+= osx.c +OBJS= $(SRCS:.c=.o) +DEPS= $(addsuffix .depend, $(OBJS)) + +CC?= gcc + +BUILDVERSION= $(shell sh $(CURDIR)/../buildver.sh) +ifneq ("${BUILDVERSION}", "") +CFLAGS+= -DXOMBRERO_BUILDSTR=\"$(BUILDVERSION)\" +endif + +all: javascript.h tooltip.h xombrero + +javascript.h: ../js-merge-helper.pl ../hinting.js ../autoscroll.js + perl ../js-merge-helper.pl ../hinting.js ../input-focus.js \ + ../autoscroll.js > javascript.h + +tooltip.h: ../ascii2txt.pl ../txt2tooltip.pl ../xombrero.1 + ln -sf ../linux/tree.h + ln -sf ../linux/util.h + nroff -c -Tascii -mandoc ../xombrero.1 | \ + perl ../ascii2txt.pl | \ + perl ../txt2tooltip.pl > tooltip.h + +xombrero: $(OBJS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ $(LDADD) + +%.o: %.c + @echo "Generating $@.depend" + @$(CC) -MM $(CPPFLAGS) $(CFLAGS) $< | \ + sed 's,^.*\.o[ :]*,$@ $@.depend : ,g' > $@.depend + $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $< + +install: all + install -m 755 -d $(DESTDIR)$(BINDIR) + install -m 755 -d $(DESTDIR)$(LIBDIR) + install -m 755 -d $(DESTDIR)$(MANDIR)/man1 + install -m 755 -d $(DESTDIR)$(RESDIR) + install -m 755 -d $(DESTDIR)$(APPDIR) + install -m 755 xombrero $(DESTDIR)$(BINDIR) + install -m 644 ../xombrero.1 $(DESTDIR)$(MANDIR)/man1/xombrero.1 + install -m 644 ../xombrero.css $(DESTDIR)$(RESDIR) + install -m 644 ../xombrero.desktop $(DESTDIR)$(APPDIR) + install -m 644 ../xombreroicon16.png $(DESTDIR)$(RESDIR) + install -m 644 ../xombreroicon32.png $(DESTDIR)$(RESDIR) + install -m 644 ../xombreroicon48.png $(DESTDIR)$(RESDIR) + install -m 644 ../xombreroicon64.png $(DESTDIR)$(RESDIR) + install -m 644 ../xombreroicon128.png $(DESTDIR)$(RESDIR) + install -m 644 ../tld-rules $(DESTDIR)$(RESDIR) + install -m 644 ../style.css $(DESTDIR)$(RESDIR) + install -m 644 ../hsts-preload $(DESTDIR)$(RESDIR) + install -m 644 ../torenabled.ico $(DESTDIR)$(RESDIR) + install -m 644 ../tordisabled.ico $(DESTDIR)$(RESDIR) + +uninstall: + rm -f $(DESTDIR)$(BINDIR)/xombrero + rm -f $(DESTDIR)$(MANDIR)/man1/xombrero.1 + rm -f $(DESTDIR)$(PREFIX)/share/applications/xombrero.desktop + rm -f $(DESTDIR)$(RESDIR)/xombreroicon.png + rm -f $(DESTDIR)$(RESDIR)/xombreroicon16.png + rm -f $(DESTDIR)$(RESDIR)/xombreroicon32.png + rm -f $(DESTDIR)$(RESDIR)/xombreroicon48.png + rm -f $(DESTDIR)$(RESDIR)/xombreroicon64.png + rm -f $(DESTDIR)$(RESDIR)/xombreroicon128.png + rm -f $(DESTDIR)$(RESDIR)/xombrero.css + rm -f $(DESTDIR)$(RESDIR)/tordisabled.ico + rm -f $(DESTDIR)$(RESDIR)/torenabled.ico + rm -f $(DESTDIR)$(RESDIR)/tld-rules + rm -f $(DESTDIR)$(RESDIR)/style.css + rm -f $(DESTDIR)$(RESDIR)/hsts-preload + if [ -d $(DESTDIR)$(RESDIR) ]; then rmdir $(DESTDIR)$(RESDIR); fi +clean: + rm -f xombrero $(OBJS) $(DEPS) + rm -f javascript.h + rm -f tooltip.h + rm -f tree.h + rm -f util.h + +-include $(DEPS) + +.PHONY: all install clean diff -Nru xombrero-1.4.0/osx/osx.c xombrero-1.5.0/osx/osx.c --- xombrero-1.4.0/osx/osx.c 1970-01-01 00:00:00.000000000 +0000 +++ xombrero-1.5.0/osx/osx.c 2013-05-16 16:12:42.000000000 +0000 @@ -0,0 +1,308 @@ +/* $OpenBSD: fmt_scaled.c,v 1.10 2009/06/20 15:00:04 martynas Exp $ */ + +/* + * Copyright (c) 2001, 2002, 2003 Ian F. Darwin. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * fmt_scaled: Format numbers scaled for human comprehension + * scan_scaled: Scan numbers in this format. + * + * "Human-readable" output uses 4 digits max, and puts a unit suffix at + * the end. Makes output compact and easy-to-read esp. on huge disks. + * Formatting code was originally in OpenBSD "df", converted to library routine. + * Scanning code written for OpenBSD libutil. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "util.h" + +typedef enum { + NONE = 0, KILO = 1, MEGA = 2, GIGA = 3, TERA = 4, PETA = 5, EXA = 6 +} unit_type; + +/* These three arrays MUST be in sync! XXX make a struct */ +static unit_type units[] = { NONE, KILO, MEGA, GIGA, TERA, PETA, EXA }; +static char scale_chars[] = "BKMGTPE"; +static long long scale_factors[] = { + 1LL, + 1024LL, + 1024LL*1024, + 1024LL*1024*1024, + 1024LL*1024*1024*1024, + 1024LL*1024*1024*1024*1024, + 1024LL*1024*1024*1024*1024*1024, +}; +#define SCALE_LENGTH (sizeof(units)/sizeof(units[0])) + +#define MAX_DIGITS (SCALE_LENGTH * 3) /* XXX strlen(sprintf("%lld", -1)? */ + +/* Convert the given input string "scaled" into numeric in "result". + * Return 0 on success, -1 and errno set on error. + */ +int +scan_scaled(char *scaled, long long *result) +{ + char *p = scaled; + int sign = 0; + unsigned int i, ndigits = 0, fract_digits = 0; + long long scale_fact = 1, whole = 0, fpart = 0; + + /* Skip leading whitespace */ + while (isascii(*p) && isspace(*p)) + ++p; + + /* Then at most one leading + or - */ + while (*p == '-' || *p == '+') { + if (*p == '-') { + if (sign) { + errno = EINVAL; + return -1; + } + sign = -1; + ++p; + } else if (*p == '+') { + if (sign) { + errno = EINVAL; + return -1; + } + sign = +1; + ++p; + } + } + + /* Main loop: Scan digits, find decimal point, if present. + * We don't allow exponentials, so no scientific notation + * (but note that E for Exa might look like e to some!). + * Advance 'p' to end, to get scale factor. + */ + for (; isascii(*p) && (isdigit(*p) || *p=='.'); ++p) { + if (*p == '.') { + if (fract_digits > 0) { /* oops, more than one '.' */ + errno = EINVAL; + return -1; + } + fract_digits = 1; + continue; + } + + i = (*p) - '0'; /* whew! finally a digit we can use */ + if (fract_digits > 0) { + if (fract_digits >= MAX_DIGITS-1) + /* ignore extra fractional digits */ + continue; + fract_digits++; /* for later scaling */ + fpart *= 10; + fpart += i; + } else { /* normal digit */ + if (++ndigits >= MAX_DIGITS) { + errno = ERANGE; + return -1; + } + whole *= 10; + whole += i; + } + } + + if (sign) { + whole *= sign; + fpart *= sign; + } + + /* If no scale factor given, we're done. fraction is discarded. */ + if (!*p) { + *result = whole; + return 0; + } + + /* Validate scale factor, and scale whole and fraction by it. */ + for (i = 0; i < SCALE_LENGTH; i++) { + + /* Are we there yet? */ + if (*p == scale_chars[i] || + *p == tolower(scale_chars[i])) { + + /* If it ends with alphanumerics after the scale char, bad. */ + if (isalnum(*(p+1))) { + errno = EINVAL; + return -1; + } + scale_fact = scale_factors[i]; + + /* scale whole part */ + whole *= scale_fact; + + /* truncate fpart so it does't overflow. + * then scale fractional part. + */ + while (fpart >= LLONG_MAX / scale_fact) { + fpart /= 10; + fract_digits--; + } + fpart *= scale_fact; + if (fract_digits > 0) { + for (i = 0; i < fract_digits -1; i++) + fpart /= 10; + } + whole += fpart; + *result = whole; + return 0; + } + } + errno = ERANGE; + return -1; +} + +/* Format the given "number" into human-readable form in "result". + * Result must point to an allocated buffer of length FMT_SCALED_STRSIZE. + * Return 0 on success, -1 and errno set if error. + */ +int +fmt_scaled(long long number, char *result) +{ + long long abval, fract = 0; + unsigned int i; + unit_type unit = NONE; + + abval = llabs(number); + + /* Not every negative long long has a positive representation. + * Also check for numbers that are just too darned big to format + */ + if (abval < 0 || abval / 1024 >= scale_factors[SCALE_LENGTH-1]) { + errno = ERANGE; + return -1; + } + + /* scale whole part; get unscaled fraction */ + for (i = 0; i < SCALE_LENGTH; i++) { + if (abval/1024 < scale_factors[i]) { + unit = units[i]; + fract = (i == 0) ? 0 : abval % scale_factors[i]; + number /= scale_factors[i]; + if (i > 0) + fract /= scale_factors[i - 1]; + break; + } + } + + fract = (10 * fract + 512) / 1024; + /* if the result would be >= 10, round main number */ + if (fract == 10) { + if (number >= 0) + number++; + else + number--; + fract = 0; + } + + if (number == 0) + strlcpy(result, "0B", FMT_SCALED_STRSIZE); + else if (unit == NONE || number >= 100 || number <= -100) { + if (fract >= 5) { + if (number >= 0) + number++; + else + number--; + } + (void)snprintf(result, FMT_SCALED_STRSIZE, "%lld%c", + number, scale_chars[unit]); + } else + (void)snprintf(result, FMT_SCALED_STRSIZE, "%lld.%1lld%c", + number, fract, scale_chars[unit]); + + return 0; +} + + +/* --------------------------------------------------------------------------- */ +/* $OpenBSD: strtonum.c,v 1.6 2004/08/03 19:38:01 millert Exp $ */ + +/* + * Copyright (c) 2004 Ted Unangst and Todd Miller + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#define INVALID 1 +#define TOOSMALL 2 +#define TOOLARGE 3 + +long long +strtonum(const char *numstr, long long minval, long long maxval, + const char **errstrp) +{ + long long ll = 0; + char *ep; + int error = 0; + struct errval { + const char *errstr; + int err; + } ev[4] = { + { NULL, 0 }, + { "invalid", EINVAL }, + { "too small", ERANGE }, + { "too large", ERANGE }, + }; + + ev[0].err = errno; + errno = 0; + if (minval > maxval) + error = INVALID; + else { + ll = strtoll(numstr, &ep, 10); + if (numstr == ep || *ep != '\0') + error = INVALID; + else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval) + error = TOOSMALL; + else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval) + error = TOOLARGE; + } + if (errstrp != NULL) + *errstrp = ev[error].errstr; + errno = ev[error].err; + if (error) + ll = 0; + + return (ll); +} diff -Nru xombrero-1.4.0/release.sh xombrero-1.5.0/release.sh --- xombrero-1.4.0/release.sh 2012-11-28 18:23:15.000000000 +0000 +++ xombrero-1.5.0/release.sh 2013-05-16 16:12:42.000000000 +0000 @@ -93,7 +93,7 @@ TAG="${PROJECT_UC}_${MAJOR}_${MINOR}_${PATCH}" git commit -am "Prepare for release ${PROJ_VER}." || report_err "unable to commit changes" -git tag -a "$TAG" -m "Release ${PROJ_VER}" || report_err "unable to create tag" +git tag -s -u release@conformal.com "$TAG" -m "Release ${PROJ_VER}" || report_err "unable to create tag" # create temp working space and copy repo over TD=$(mktemp -d /tmp/release.XXXXXXXXXX) diff -Nru xombrero-1.4.0/settings.c xombrero-1.5.0/settings.c --- xombrero-1.4.0/settings.c 2012-11-28 18:23:15.000000000 +0000 +++ xombrero-1.5.0/settings.c 2013-05-16 16:12:42.000000000 +0000 @@ -102,6 +102,7 @@ int userstyle_global = XT_DS_USERSTYLE_GLOBAL; int auto_load_images = XT_DS_AUTO_LOAD_IMAGES; int enable_autoscroll = XT_DS_ENABLE_AUTOSCROLL; +int enable_cache = 0; int enable_favicon_entry = XT_DS_ENABLE_FAVICON_ENTRY; int enable_favicon_tabs = XT_DS_ENABLE_FAVICON_TABS; char *external_editor = NULL; @@ -179,6 +180,7 @@ int set_work_dir(struct settings *, char *); int set_auto_load_images(char *); int set_enable_autoscroll(char *); +int set_enable_cache(char *); int set_enable_favicon_entry(char *); int set_enable_favicon_tabs(char *); int set_guess_search(char *); @@ -232,6 +234,7 @@ int check_download_notifications(char **); int check_edit_mode(char **); int check_enable_autoscroll(char **); +int check_enable_cache(char **); int check_enable_cookie_whitelist(char **); int check_enable_favicon_entry(char **); int check_enable_favicon_tabs(char **); @@ -511,6 +514,7 @@ { "download_notifications", XT_S_BOOL, 0, &download_notifications, NULL, NULL, NULL, set_download_notifications, check_download_notifications, TT_DOWNLOAD_NOTIFICATIONS }, { "edit_mode", XT_S_STR, 0, NULL, NULL,&s_edit_mode, NULL, NULL, check_edit_mode, NULL }, { "enable_autoscroll", XT_S_BOOL, 0, &enable_autoscroll, NULL, NULL, NULL, set_enable_autoscroll, check_enable_autoscroll, TT_ENABLE_AUTOSCROLL }, + { "enable_cache", XT_S_BOOL, 0, &enable_cache, NULL, NULL, NULL, set_enable_cache, check_enable_cache, TT_ENABLE_CACHE }, { "enable_cookie_whitelist", XT_S_BOOL, 0, &enable_cookie_whitelist, NULL, NULL, NULL, set_enable_cookie_whitelist, check_enable_cookie_whitelist, TT_ENABLE_COOKIE_WHITELIST }, { "enable_favicon_entry", XT_S_BOOL, 0, &enable_favicon_entry, NULL, NULL, NULL, set_enable_favicon_entry, check_enable_favicon_entry, TT_ENABLE_FAVICON_ENTRY }, { "enable_favicon_tabs", XT_S_BOOL, 0, &enable_favicon_tabs, NULL, NULL, NULL, set_enable_favicon_tabs, check_enable_favicon_tabs, TT_ENABLE_FAVICON_TABS }, @@ -597,8 +601,12 @@ } uri = soup_uri_new(proxy); - if (uri == NULL || !SOUP_URI_VALID_FOR_HTTP(uri)) + if (uri == NULL) + return (1); + if (!SOUP_URI_VALID_FOR_HTTP(uri)) { + soup_uri_free(uri); return (1); + } setup_proxy(proxy); @@ -730,7 +738,7 @@ cmd_font_name = g_strdup(value); cmd_font = pango_font_description_from_string(cmd_font_name); TAILQ_FOREACH(t, &tabs, entry) - gtk_widget_modify_font(GTK_WIDGET(t->cmd), cmd_font); + modify_font(GTK_WIDGET(t->cmd), cmd_font); return (0); } @@ -756,7 +764,7 @@ oops_font_name = g_strdup(value); oops_font = pango_font_description_from_string(oops_font_name); TAILQ_FOREACH(t, &tabs, entry) - gtk_widget_modify_font(GTK_WIDGET(t->oops), oops_font); + modify_font(GTK_WIDGET(t->oops), oops_font); return (0); } @@ -791,15 +799,15 @@ statusbar_font = pango_font_description_from_string( statusbar_font_name); TAILQ_FOREACH(t, &tabs, entry) { - gtk_widget_modify_font(GTK_WIDGET(t->sbe.uri), + modify_font(GTK_WIDGET(t->sbe.uri), statusbar_font); - gtk_widget_modify_font(GTK_WIDGET(t->sbe.buffercmd), + modify_font(GTK_WIDGET(t->sbe.buffercmd), statusbar_font); - gtk_widget_modify_font(GTK_WIDGET(t->sbe.zoom), + modify_font(GTK_WIDGET(t->sbe.zoom), statusbar_font); - gtk_widget_modify_font(GTK_WIDGET(t->sbe.position), + modify_font(GTK_WIDGET(t->sbe.position), statusbar_font); - gtk_widget_modify_font(GTK_WIDGET(t->sbe.proxy), + modify_font(GTK_WIDGET(t->sbe.proxy), statusbar_font); } return (0); @@ -827,7 +835,7 @@ tabbar_font_name = g_strdup(value); tabbar_font = pango_font_description_from_string(tabbar_font_name); TAILQ_FOREACH(t, &tabs, entry) - gtk_widget_modify_font(GTK_WIDGET(t->tab_elems.label), + modify_font(GTK_WIDGET(t->tab_elems.label), tabbar_font); return (0); } @@ -1445,6 +1453,8 @@ { "editelement", CTRL, 1, GDK_i }, { "passthrough", CTRL, 1, GDK_z }, { "modurl", CTRL, 1, GDK_Return }, + { "urlmod plus", MOD1, 1, GDK_a }, + { "urlmod min", MOD1, 1, GDK_A }, /* search */ { "searchnext", 0, 0, GDK_n }, @@ -2112,6 +2122,36 @@ } int +set_enable_cache(char *value) +{ + int tmp; + const char *errstr; + + if (value == NULL || strlen(value) == 0) + enable_cache = 1; + else { + tmp = (int)strtonum(value, 0, 1, &errstr); + if (errstr) + return (-1); + enable_cache = tmp; + } + if (enable_cache) + webkit_set_cache_model(WEBKIT_CACHE_MODEL_WEB_BROWSER); + else + webkit_set_cache_model(WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER); + + return (0); +} + +int +check_enable_cache(char **tt) +{ + *tt = g_strdup_printf("Default: Disabled"); + + return (enable_cache); +} + +int set_enable_cookie_whitelist(char *value) { int tmp; diff -Nru xombrero-1.4.0/version.h xombrero-1.5.0/version.h --- xombrero-1.4.0/version.h 2012-11-28 18:23:15.000000000 +0000 +++ xombrero-1.5.0/version.h 2013-05-16 16:12:42.000000000 +0000 @@ -22,7 +22,7 @@ #define XOMBRERO_STRINGIZE(x) XOMBRERO_STR(x) #define XOMBRERO_MAJOR 1 -#define XOMBRERO_MINOR 4 +#define XOMBRERO_MINOR 5 #define XOMBRERO_PATCH 0 #define XOMBRERO_VERSION XOMBRERO_STRINGIZE(XOMBRERO_MAJOR) "." \ XOMBRERO_STRINGIZE(XOMBRERO_MINOR) "." \ diff -Nru xombrero-1.4.0/whitelist.c xombrero-1.5.0/whitelist.c --- xombrero-1.4.0/whitelist.c 2012-11-28 18:23:15.000000000 +0000 +++ xombrero-1.5.0/whitelist.c 2013-05-16 16:12:42.000000000 +0000 @@ -33,8 +33,12 @@ uri = soup_uri_new(s); - if (uri == NULL || !SOUP_URI_VALID_FOR_HTTP(uri)) + if (uri == NULL) return (NULL); + if (!SOUP_URI_VALID_FOR_HTTP(uri)) { + soup_uri_free(uri); + return (NULL); + } if (flags & XT_WL_TOPLEVEL && !isdigit(uri->host[strlen(uri->host) - 1])) diff -Nru xombrero-1.4.0/xombrero.1 xombrero-1.5.0/xombrero.1 --- xombrero-1.4.0/xombrero.1 2012-12-21 10:04:10.000000000 +0000 +++ xombrero-1.5.0/xombrero.1 2013-05-16 16:12:42.000000000 +0000 @@ -534,7 +534,7 @@ Used by itself it expands to .Cm https show all . .It Cm https save, save fqdn -Saves the FQDN to the persistant force HTTPS list. +Saves the FQDN to the persistent force HTTPS list. For example, the www.peereboom.us domain would result in saving www.peereboom.us. .It Cm https save domain @@ -1204,6 +1204,9 @@ When enabled all cookies must be in the whitelist or they are rejected. Additionally whitelisted cookies also enable HTML5 local storage for the domain. +.It Cm enable_cache +When enabled (disabled by default), web content will be cached into +memory. .It Cm enable_favicon_entry When enabled (the default) .Nm diff -Nru xombrero-1.4.0/xombrero.c xombrero-1.5.0/xombrero.c --- xombrero-1.4.0/xombrero.c 2012-11-28 18:23:15.000000000 +0000 +++ xombrero-1.5.0/xombrero.c 2013-05-16 16:12:42.000000000 +0000 @@ -5,7 +5,7 @@ * Copyright (c) 2011 Todd T. Fries * Copyright (c) 2011 Raphael Graf * Copyright (c) 2011 Michal Mazurek - * Copyright (c) 2012 Josh Rickmar + * Copyright (c) 2012, 2013 Josh Rickmar * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -48,10 +48,6 @@ ; #endif -#ifdef USE_THREADS -GCRY_THREAD_OPTION_PTHREAD_IMPL; -#endif - char *icons[] = { "xombreroicon16.png", "xombreroicon32.png", @@ -905,6 +901,12 @@ goto done; } + /* remove old HTTPS cert chain (if any) */ + if (t->cert_chain) { + g_free(t->cert_chain); + t->cert_chain = NULL; + } + set_status(t, "Loading: %s", (char *)uri); marks_clear(t); webkit_web_view_load_uri(t->wv, uri); @@ -1103,21 +1105,6 @@ return (0); } -int -run_script_locked(struct tab *t, char *s) -{ - int rv; -#ifdef USE_THREADS - gdk_threads_enter(); -#endif - rv = run_script(t, s); -#ifdef USE_THREADS - GDK_FLUSH(); - gdk_threads_leave(); -#endif - return (rv); -} - void enable_hints(struct tab *t) { @@ -1311,23 +1298,23 @@ goto done; for (;;) { - if ((uri = fparseln(f, NULL, NULL, "\0\0\0", 0)) == NULL) + if ((uri = fparseln(f, NULL, NULL, "\0\0\0", 0)) == NULL) { if (feof(f) || ferror(f)) break; + } else { + /* retrieve session name */ + if (g_str_has_prefix(uri, XT_SAVE_SESSION_ID)) { + strlcpy(named_session, + &uri[strlen(XT_SAVE_SESSION_ID)], + sizeof named_session); + continue; + } - /* retrieve session name */ - if (uri && g_str_has_prefix(uri, XT_SAVE_SESSION_ID)) { - strlcpy(named_session, - &uri[strlen(XT_SAVE_SESSION_ID)], - sizeof named_session); - continue; - } - - if (uri && strlen(uri)) - create_new_tab(uri, NULL, 1, -1); + if (strlen(uri)) + create_new_tab(uri, NULL, 1, -1); - free(uri); - uri = NULL; + free(uri); + } } /* close open tabs */ @@ -1652,203 +1639,6 @@ return (0); } -int -connect_socket_from_uri(const gchar *uri, const gchar **error_str, char *domain, - size_t domain_sz) -{ - SoupURI *su = NULL; - struct addrinfo hints, *res = NULL, *ai; - int rv = -1, s = -1, on, error; - char port[8]; - static gchar myerror[256]; /* this is not thread safe */ - - myerror[0] = '\0'; - *error_str = myerror; - if (uri && !g_str_has_prefix(uri, "https://")) { - *error_str = "invalid URI"; - goto done; - } - - su = soup_uri_new(uri); - if (su == NULL) { - *error_str = "invalid soup URI"; - goto done; - } - if (!SOUP_URI_VALID_FOR_HTTP(su)) { - *error_str = "invalid HTTPS URI"; - goto done; - } - - snprintf(port, sizeof port, "%d", su->port); - bzero(&hints, sizeof(struct addrinfo)); - hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - - if ((error = getaddrinfo(su->host, port, &hints, &res))) { - snprintf(myerror, sizeof myerror, "getaddrinfo failed: %s", - gai_strerror(errno)); - goto done; - } - - for (ai = res; ai; ai = ai->ai_next) { - if (s != -1) { - close(s); - s = -1; - } - - if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) - continue; - s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); - if (s == -1) - continue; - if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, - sizeof(on)) == -1) - continue; - if (connect(s, ai->ai_addr, ai->ai_addrlen) == 0) - break; - } - if (s == -1) { - snprintf(myerror, sizeof myerror, - "could not obtain certificates from: %s", - su->host); - goto done; - } - - if (domain) - strlcpy(domain, su->host, domain_sz); - rv = s; -done: - if (su) - soup_uri_free(su); - if (res) - freeaddrinfo(res); - if (rv == -1 && s != -1) - close(s); - - return (rv); -} - -#ifdef __MINGW32__ -static ssize_t -custom_gnutls_push(void *s, const void *buf, size_t len) -{ - return send((size_t)s, buf, len, 0); -} - -static ssize_t -custom_gnutls_pull(void *s, void *buf, size_t len) -{ - return recv((size_t)s, buf, len, 0); -} -#endif - -int -stop_tls(gnutls_session_t gsession, gnutls_certificate_credentials_t xcred) -{ - if (gsession) - gnutls_deinit(gsession); - if (xcred) - gnutls_certificate_free_credentials(xcred); - - return (0); -} - -int -start_tls(const gchar **error_str, int s, gnutls_session_t *gs, - gnutls_certificate_credentials_t *xc) -{ - gnutls_certificate_credentials_t xcred; - gnutls_session_t gsession; - int rv = 1; - static gchar myerror[1024]; /* this is not thread safe */ - - if (gs == NULL || xc == NULL) - goto done; - - myerror[0] = '\0'; - *gs = NULL; - *xc = NULL; - - gnutls_certificate_allocate_credentials(&xcred); - gnutls_certificate_set_x509_trust_file(xcred, ssl_ca_file, - GNUTLS_X509_FMT_PEM); - - gnutls_init(&gsession, GNUTLS_CLIENT); - gnutls_priority_set_direct(gsession, "PERFORMANCE", NULL); - gnutls_credentials_set(gsession, GNUTLS_CRD_CERTIFICATE, xcred); - gnutls_transport_set_ptr(gsession, (gnutls_transport_ptr_t)(long)s); -#ifdef __MINGW32__ - /* sockets on windows don't use file descriptors */ - gnutls_transport_set_push_function(gsession, custom_gnutls_push); - gnutls_transport_set_pull_function(gsession, custom_gnutls_pull); -#endif - if ((rv = gnutls_handshake(gsession)) < 0) { - snprintf(myerror, sizeof myerror, - "gnutls_handshake failed %d fatal %d %s", - rv, - gnutls_error_is_fatal(rv), -#if LIBGNUTLS_VERSION_MAJOR >= 2 && LIBGNUTLS_VERSION_MINOR >= 6 - gnutls_strerror_name(rv)); -#else - "GNUTLS version is too old to provide human readable error"); -#endif - stop_tls(gsession, xcred); - goto done; - } - - gnutls_credentials_type_t cred; - cred = gnutls_auth_get_type(gsession); - if (cred != GNUTLS_CRD_CERTIFICATE) { - snprintf(myerror, sizeof myerror, - "gnutls_auth_get_type failed %d", - (int)cred); - stop_tls(gsession, xcred); - goto done; - } - - *gs = gsession; - *xc = xcred; - rv = 0; -done: - *error_str = myerror; - return (rv); -} - -int -get_connection_certs(gnutls_session_t gsession, gnutls_x509_crt_t **certs, - size_t *cert_count) -{ - unsigned int len; - const gnutls_datum_t *cl; - gnutls_x509_crt_t *all_certs; - int i, rv = 1; - - if (certs == NULL || cert_count == NULL) - goto done; - if (gnutls_certificate_type_get(gsession) != GNUTLS_CRT_X509) - goto done; - cl = gnutls_certificate_get_peers(gsession, &len); - if (len == 0) - goto done; - - all_certs = g_malloc(sizeof(gnutls_x509_crt_t) * len); - for (i = 0; i < len; i++) { - gnutls_x509_crt_init(&all_certs[i]); - if (gnutls_x509_crt_import(all_certs[i], &cl[i], - GNUTLS_X509_FMT_PEM < 0)) { - g_free(all_certs); - goto done; - } - } - - *certs = all_certs; - *cert_count = len; - rv = 0; -done: - return (rv); -} - void free_connection_certs(gnutls_x509_crt_t *certs, size_t cert_count) { @@ -1923,114 +1713,6 @@ CERT_BAD }; -enum cert_trust -load_compare_cert(const gchar *uri, const gchar **error_str, const char *dir) -{ - char domain[8182], file[PATH_MAX]; - char cert_buf[64 * 1024], r_cert_buf[64 * 1024]; - int s = -1, i; - unsigned int error = 0; - FILE *f = NULL; - size_t cert_buf_sz, cert_count; - enum cert_trust rv = CERT_UNTRUSTED; - static gchar serr[80]; /* this isn't thread safe */ - gnutls_session_t gsession; - gnutls_x509_crt_t *certs; - gnutls_certificate_credentials_t xcred; - - DNPRINTF(XT_D_URL, "%s: %s\n", __func__, uri); - - serr[0] = '\0'; - *error_str = serr; - if ((s = connect_socket_from_uri(uri, error_str, domain, - sizeof domain)) == -1) - return (rv); - - DNPRINTF(XT_D_URL, "%s: fd %d\n", __func__, s); - - /* go ssl/tls */ - if (start_tls(error_str, s, &gsession, &xcred)) - goto done; - DNPRINTF(XT_D_URL, "%s: got tls\n", __func__); - - /* verify certs in case cert file doesn't exist */ - if (gnutls_certificate_verify_peers2(gsession, &error) != - GNUTLS_E_SUCCESS) { - *error_str = "Invalid certificates"; - goto done; - } - - /* get certs */ - if (get_connection_certs(gsession, &certs, &cert_count)) { - *error_str = "Can't get connection certificates"; - goto done; - } - - snprintf(file, sizeof file, "%s" PS "%s", dir, domain); - if ((f = fopen(file, "r")) == NULL) { - if (!error) - rv = CERT_TRUSTED; - goto freeit; - } - - for (i = 0; i < cert_count; i++) { - cert_buf_sz = sizeof cert_buf; - if (gnutls_x509_crt_export(certs[i], GNUTLS_X509_FMT_PEM, - cert_buf, &cert_buf_sz)) { - goto freeit; - } - if (fread(r_cert_buf, cert_buf_sz, 1, f) != 1 && !feof(f)) { - rv = CERT_BAD; /* critical */ - goto freeit; - } - if (bcmp(r_cert_buf, cert_buf, cert_buf_sz)) { - rv = CERT_BAD; /* critical */ - goto freeit; - } - rv = CERT_LOCAL; - } - -freeit: - if (f) - fclose(f); - free_connection_certs(certs, cert_count); -done: - /* we close the socket first for speed */ - if (s != -1) - close(s); - - /* only complain if we didn't save it locally */ - if (strlen(ssl_ca_file) != 0 && error && rv != CERT_LOCAL) { - strlcpy(serr, "Certificate exception(s): ", sizeof serr); - if (error & GNUTLS_CERT_INVALID) - strlcat(serr, "invalid, ", sizeof serr); - if (error & GNUTLS_CERT_REVOKED) - strlcat(serr, "revoked, ", sizeof serr); - if (error & GNUTLS_CERT_SIGNER_NOT_FOUND) - strlcat(serr, "signer not found, ", sizeof serr); - if (error & GNUTLS_CERT_SIGNER_NOT_CA) - strlcat(serr, "not signed by CA, ", sizeof serr); - if (error & GNUTLS_CERT_INSECURE_ALGORITHM) - strlcat(serr, "insecure algorithm, ", sizeof serr); -#if LIBGNUTLS_VERSION_MAJOR >= 2 && LIBGNUTLS_VERSION_MINOR >= 6 - if (error & GNUTLS_CERT_NOT_ACTIVATED) - strlcat(serr, "not activated, ", sizeof serr); - if (error & GNUTLS_CERT_EXPIRED) - strlcat(serr, "expired, ", sizeof serr); -#endif - for (i = strlen(serr) - 1; i > 0; i--) - if (serr[i] == ',') { - serr[i] = '\0'; - break; - } - *error_str = serr; - } - - stop_tls(gsession, xcred); - - return (rv); -} - gnutls_x509_crt_t * get_local_cert_chain(const char *uri, size_t *ncerts, const char **error_str, const char *dir) @@ -2050,6 +1732,7 @@ } snprintf(file, sizeof file, "%s" PS "%s", dir, su->host); + soup_uri_free(su); if ((f = fopen(file, "r")) == NULL) { *error_str = "Could not read local cert"; return (NULL); @@ -2067,6 +1750,7 @@ *ncerts = INT_MAX; if (gnutls_x509_crt_list_import(certs, &len, &data, GNUTLS_X509_FMT_PEM, 0) < 0) { + g_free(certs); *error_str = "Error reading local cert chain"; return (NULL); } @@ -2075,17 +1759,47 @@ return (certs); } +/* + * This uses the pem-encoded cert chain saved in t->cert_chain instead + * of grabbing the remote cert. We save it beforehand and read it + * here so as to not open a side channel that ignores proxy settings. + */ +gnutls_x509_crt_t * +get_remote_cert_chain(const char *uri, size_t *ncerts, const char **error_str, + char *chain) +{ + gnutls_datum_t data; + unsigned int len = UINT_MAX; + gnutls_x509_crt_t *certs; + + if (chain == NULL) { + *error_str = "Error reading remote cert chain"; + return (NULL); + } + + data.data = (unsigned char *)chain; + data.size = strlen(chain); + certs = g_malloc(sizeof *certs); + *ncerts = INT_MAX; + if (gnutls_x509_crt_list_import(certs, &len, &data, + GNUTLS_X509_FMT_PEM, 0) < 0) { + g_free(certs); + *error_str = "Error reading remote cert chain"; + return (NULL); + } + + *ncerts = len; + return (certs); +} + int cert_cmd(struct tab *t, struct karg *args) { const gchar *uri, *error_str = NULL; - char domain[8182]; - int s = -1; size_t cert_count; - gnutls_session_t gsession; gnutls_x509_crt_t *certs; - gnutls_certificate_credentials_t xcred; + SoupURI *su; #if !GTK_CHECK_VERSION(3, 0, 0) GdkColor color; #endif @@ -2093,9 +1807,13 @@ if (t == NULL) return (1); - if (args->s != NULL) + if (args->s != NULL) { uri = args->s; - else if ((uri = get_uri(t)) == NULL) { + } else if ((uri = get_uri(t)) == NULL) { + show_oops(t, "Invalid URI"); + return (1); + } + if ((su = soup_uri_new(uri)) == NULL) { show_oops(t, "Invalid URI"); return (1); } @@ -2117,26 +1835,15 @@ return (0); } - if ((s = connect_socket_from_uri(uri, &error_str, domain, - sizeof domain)) == -1) { - show_oops(t, "%s", error_str); - return (1); - } - - /* go ssl/tls */ - if (start_tls(&error_str, s, &gsession, &xcred)) - goto done; - - /* get certs */ - if (get_connection_certs(gsession, &certs, &cert_count)) { - show_oops(t, "get_connection_certs failed"); + certs = get_remote_cert_chain(uri, &cert_count, &error_str, + t->cert_chain); + if (error_str) goto done; - } if (args->i & XT_SHOW) show_certs(t, certs, cert_count, "Certificate Chain"); else if (args->i & XT_SAVE) { - save_certs(t, certs, cert_count, domain, certs_dir); + save_certs(t, certs, cert_count, su->host, certs_dir); #if GTK_CHECK_VERSION(3, 0, 0) gtk_widget_set_name(t->uri_entry, XT_CSS_BLUE); statusbar_modify_attr(t, XT_CSS_BLUE); @@ -2146,49 +1853,89 @@ statusbar_modify_attr(t, XT_COLOR_BLACK, XT_COLOR_BLUE); #endif } else if (args->i & XT_CACHE) - save_certs(t, certs, cert_count, domain, certs_cache_dir); + save_certs(t, certs, cert_count, su->host, certs_cache_dir); free_connection_certs(certs, cert_count); + done: - /* we close the socket first for speed */ - if (s != -1) - close(s); - stop_tls(gsession, xcred); + soup_uri_free(su); + if (error_str && strlen(error_str)) show_oops(t, "%s", error_str); return (0); } /* - * args must be allocated dynamically as the thread that added this function - * to the idle loop no longer exists + * Checks whether the remote cert is identical to the local saved + * cert. Returns CERT_LOCAL if unchanged, CERT_UNTRUSTED if local + * cert does not exist, and CERT_BAD if different. + * + * Saves entire cert chain in pem encoding to chain for it to be + * cached later, if needed. */ -gboolean -warn_cert_cache_differs_idle(struct karg *args) +enum cert_trust +check_local_certs(const char *file, GTlsCertificate *cert, char **chain) { - if (args == NULL) { - show_oops(NULL, "%s: invalid parameters", __func__); - /* return 0 to not re-add function to the idle loop */ - return (0); + char r_cert_buf[64 * 1024]; + FILE *f; + GTlsCertificate *tmpcert = NULL; + GTlsCertificate *issuer; + char *pem; + char *tmp; + enum cert_trust rv = CERT_LOCAL; + int i; + + if ((f = fopen(file, "r")) == NULL) { + /* no local cert to check */ + rv = CERT_UNTRUSTED; } - xtp_page_sv((struct tab *)args->ptr, args); - g_free(args); - return (0); + + for (i = 0;;) { + if (i == 0) { + g_object_get(G_OBJECT(cert), "certificate-pem", &pem, + NULL); + g_object_get(G_OBJECT(cert), "issuer", &issuer,NULL); + } else { + if (issuer == NULL) + break; + g_object_get(G_OBJECT(tmpcert), "issuer", &issuer, + NULL); + if (issuer == NULL) + break; + + g_object_get(G_OBJECT(tmpcert), "certificate-pem", &pem, + NULL); + } + i++; + + tmpcert = issuer; + if (f) { + if (fread(r_cert_buf, strlen(pem), 1, f) != 1 && !feof(f)) + rv = CERT_BAD; + if (bcmp(r_cert_buf, pem, strlen(pem))) + rv = CERT_BAD; + } + tmp = g_strdup_printf("%s%s", *chain, pem); + g_free(*chain); + *chain = tmp; + } + + if (f != NULL) + fclose(f); + return (rv); } int -check_cert_changes(struct tab *t, const char *uri) +check_cert_changes(struct tab *t, GTlsCertificate *cert, const char *file, const char *uri) { SoupURI *soupuri = NULL; struct karg args = {0}; struct wl_entry *w = NULL; - const char *errstr = NULL; - struct karg *argsp; - - if (!(warn_cert_changes && g_str_has_prefix(uri, "https://"))) - return (0); + char *chain = NULL; + int ret = 0; - switch (load_compare_cert(uri, &errstr, certs_cache_dir)) { + chain = g_strdup(""); + switch(check_local_certs(file, cert, &chain)) { case CERT_LOCAL: /* The cached certificate is identical */ break; @@ -2197,6 +1944,7 @@ /* cache new certificate */ args.i = XT_CACHE; cert_cmd(t, &args); + ret = 1; break; case CERT_BAD: if ((soupuri = soup_uri_new(uri)) == NULL || @@ -2205,15 +1953,15 @@ if ((w = wl_find(soupuri->host, &svil)) != NULL) break; t->xtp_meaning = XT_XTP_TAB_MEANING_SV; - argsp = g_malloc0(sizeof(struct karg)); - argsp->s = g_strdup((char *)uri); - argsp->ptr = (void *)t; - g_idle_add((GSourceFunc)warn_cert_cache_differs_idle, argsp); + args.s = g_strdup((char *)uri); + xtp_page_sv(t, &args); break; } if (soupuri) soup_uri_free(soupuri); + if (chain) + g_free(chain); return (0); } @@ -3336,6 +3084,91 @@ done: return (XT_CB_PASSTHROUGH); } + +/* + * If you can read this functionthen you are a sick and twisted individual. + * I hope we never meet, it'll be violent. + */ +gboolean +eval_cb(const GMatchInfo *info, GString *res, gpointer data) +{ + gchar *match, *num; + gint start = -1, end = -1, i; + struct karg *args = data; + + /* + * match contains the string UP TO the match. + * + * res is what is returned, note that whatever remains in the sent in + * string is appended on the way out. + * + * for example /123/456/789/moo came in + * match contains /123/456/789/ + * we assign that to res and replace /789/ with the replacement text + * then g_regex_replace_eval on the way out has /123/456/replacement/moo + * + */ + match = g_match_info_fetch(info, 0); + if (match == NULL) + goto done; + + if (g_match_info_fetch_pos(info, 1, &start, &end) == FALSE) + goto freeit; + + g_string_assign(res, match); + + i = atoi(&match[start + 1]); + if (args->i == XT_URL_PLUS) + i++; + else + i--; + + /* preserve whitespace when likely */ + num = g_strdup_printf("%0*d", end - start - 2, i); + g_string_overwrite_len(res, start + 1, num, end - start - 2); + g_free(num); + +freeit: + g_free(match); +done: + return (FALSE); /* doesn't matter */ +} + +int +urlmod_cmd(struct tab *t, struct karg *args) +{ + const gchar *uri; + GRegex *reg; + gchar *res; + + if (t == NULL) + goto done; + if ((uri = gtk_entry_get_text(GTK_ENTRY(t->uri_entry))) == NULL) + goto done; + if (strlen(uri) == 0) + goto done; + + reg = g_regex_new(".*(/[0-9]+/)", 0, 0, NULL); + if (reg == NULL) + goto done; + res = g_regex_replace_eval(reg, uri, -1, 0, 0, eval_cb, args, NULL); + if (res == NULL) + goto free_reg; + + if (!strcmp(res, uri)) + goto free_res; + + gtk_entry_set_text(GTK_ENTRY(t->uri_entry), res); + activate_uri_entry_cb(t->uri_entry, t); + +free_res: + g_free(res); +free_reg: + g_regex_unref(reg); +done: + return (XT_CB_PASSTHROUGH); +} + struct cmd { char *cmd; int level; @@ -3544,6 +3377,11 @@ { "proxy", 0, proxy_cmd, XT_PRXY_SHOW, 0 }, { "show", 1, proxy_cmd, XT_PRXY_SHOW, 0 }, { "toggle", 1, proxy_cmd, XT_PRXY_TOGGLE, 0 }, + + /* url mod */ + { "urlmod", 0, urlmod_cmd, XT_URL, 0 }, + { "plus", 1, urlmod_cmd, XT_URL_PLUS, 0 }, + { "min", 1, urlmod_cmd, XT_URL_MIN, 0 }, }; struct { @@ -3789,86 +3627,82 @@ #endif void -check_certs(gpointer p) +show_ca_status(struct tab *t, const char *uri) { - struct tab *tt, *t = p; - gchar *col_str = XT_COLOR_WHITE; - const gchar *uri, *u = NULL, *error_str = NULL; + char domain[8182], file[PATH_MAX]; + SoupMessage *msg = NULL; + GTlsCertificate *cert = NULL; + GTlsCertificateFlags flags = 0; + gchar *col_str = XT_COLOR_RED; + char *chain; #if GTK_CHECK_VERSION(3, 0, 0) char *name; #else GdkColor color; gchar *text, *base; #endif + enum cert_trust trust; + int nocolor = 0; + int i; -#ifdef USE_THREADS - gdk_threads_enter(); -#endif - DNPRINTF(XT_D_URL, "%s:\n", __func__); + DNPRINTF(XT_D_URL, "show_ca_status: %d %s %s\n", + ssl_strict_certs, ssl_ca_file, uri); - /* make sure t still exists */ if (t == NULL) - goto done; - TAILQ_FOREACH(tt, &tabs, entry) - if (t == tt) - break; - if (t != tt) - goto done; - - if ((uri = get_uri(t)) == NULL) - goto white; - u = g_strdup(uri); - -#ifdef USE_THREADS - GDK_FLUSH(); - gdk_threads_leave(); -#endif - - col_str = XT_COLOR_YELLOW; - switch (load_compare_cert(u, &error_str, certs_dir)) { - case CERT_LOCAL: - col_str = XT_COLOR_BLUE; - break; - case CERT_TRUSTED: - col_str = (strlen(ssl_ca_file) == 0) ? XT_COLOR_RED - : XT_COLOR_GREEN; - break; - case CERT_UNTRUSTED: - col_str = (strlen(ssl_ca_file) == 0) ? XT_COLOR_RED - : XT_COLOR_YELLOW; - break; - case CERT_BAD: - col_str = XT_COLOR_RED; - break; - } + return; -#ifdef USE_THREADS - gdk_threads_enter(); -#endif - /* make sure t isn't deleted */ - TAILQ_FOREACH(tt, &tabs, entry) - if (t == tt) - break; - if (t != tt) - goto done; + if (uri == NULL || g_str_has_prefix(uri, "http://") || + !g_str_has_prefix(uri, "https://")) + return; -#ifdef USE_THREADS - /* test to see if the user navigated away and canceled the thread */ - if (t->thread != g_thread_self()) + msg = soup_message_new("GET", uri); + if (msg == NULL) + return; + soup_session_send_message(session, msg); + if (msg->status_code == SOUP_STATUS_SSL_FAILED || + msg->status_code == SOUP_STATUS_TLS_FAILED) { + DNPRINTF(XT_D_URL, "%s: status not ok: %d\n", uri, + msg->status_code); goto done; - if ((uri = get_uri(t)) == NULL) { - t->thread = NULL; + } + if (!soup_message_get_https_status(msg, &cert, &flags)) { + DNPRINTF(XT_D_URL, "%s: invalid response\n", uri); goto done; } - if (strcmp(uri, u)) { - /* make sure we are still the same url */ - t->thread = NULL; + if (!G_IS_TLS_CERTIFICATE(cert)) { + DNPRINTF(XT_D_URL, "%s: no cert\n", uri); goto done; } -#endif -white: - if (!strcmp(col_str, XT_COLOR_WHITE)) { + if (flags == 0) + col_str = XT_COLOR_GREEN; + else + col_str = XT_COLOR_YELLOW; + + strlcpy(domain, uri + strlen("https://"), sizeof domain); + for (i = 0; i < strlen(domain); i++) + if (domain[i] == '/') { + domain[i] = '\0'; + break; + } + + snprintf(file, sizeof file, "%s" PS "%s", certs_cache_dir, domain); + if (warn_cert_changes) { + if (check_cert_changes(t, cert, file, uri)) + nocolor = 1; + } + + snprintf(file, sizeof file, "%s" PS "%s", certs_dir, domain); + chain = g_strdup(""); + if ((trust = check_local_certs(file, cert, &chain)) == CERT_LOCAL) + col_str = XT_COLOR_BLUE; + if (t->cert_chain) + g_free(t->cert_chain); + t->cert_chain = chain; + +done: + g_object_unref(msg); + if (!strcmp(col_str, XT_COLOR_WHITE) || nocolor) { #if GTK_CHECK_VERSION(3, 0, 0) gtk_widget_set_name(t->uri_entry, XT_CSS_NORMAL); statusbar_modify_attr(t, XT_CSS_NORMAL); @@ -3895,90 +3729,6 @@ statusbar_modify_attr(t, XT_COLOR_BLACK, col_str); #endif } - - if (error_str && error_str[0] != '\0') - show_oops(t, "%s", error_str); - - check_cert_changes(t, u); - -#ifdef USE_THREADS - t->thread = NULL; -#endif -done: - /* t is invalid at this point */ - if (u) - g_free((gpointer)u); -#ifdef USE_THREADS - GDK_FLUSH(); - gdk_threads_leave(); -#endif -} - -void -show_ca_status(struct tab *t, const char *uri) -{ - gchar *col_str = XT_COLOR_WHITE; -#if GTK_CHECK_VERSION(3, 0, 0) - char *name; -#else - GdkColor color; - gchar *text, *base; -#endif - - DNPRINTF(XT_D_URL, "show_ca_status: %d %s %s\n", - ssl_strict_certs, ssl_ca_file, uri); - - if (t == NULL) - return; - - if (uri == NULL || g_str_has_prefix(uri, "http://") || - !g_str_has_prefix(uri, "https://")) - goto done; - -#ifdef USE_THREADS - /* - * It is not necessary to see if the thread is already running. - * If the thread is in progress setting it to something else aborts it - * on the way out. - */ - - /* thread the coloring of the address bar */ - t->thread = g_thread_create((GThreadFunc)check_certs, t, TRUE, NULL); -#else - check_certs(t); -#endif - return; - -done: - if (col_str) { - if (!strcmp(col_str, XT_COLOR_WHITE)) { -#if GTK_CHECK_VERSION(3, 0, 0) - gtk_widget_set_name(t->uri_entry, XT_CSS_NORMAL); - statusbar_modify_attr(t, XT_CSS_NORMAL); -#else - text = gdk_color_to_string( - &t->default_style->text[GTK_STATE_NORMAL]); - base = gdk_color_to_string( - &t->default_style->base[GTK_STATE_NORMAL]); - gtk_widget_modify_base(t->uri_entry, GTK_STATE_NORMAL, - &t->default_style->base[GTK_STATE_NORMAL]); - statusbar_modify_attr(t, text, base); - g_free(text); - g_free(base); -#endif - } else { -#if GTK_CHECK_VERSION(3, 0, 0) - name = get_css_name(col_str); - gtk_widget_set_name(t->uri_entry, name); - statusbar_modify_attr(t, name); - g_free(name); -#else - gdk_color_parse(col_str, &color); - gtk_widget_modify_base(t->uri_entry, GTK_STATE_NORMAL, &color); - statusbar_modify_attr(t, XT_COLOR_BLACK, col_str); -#endif - } - } } void @@ -4360,10 +4110,6 @@ t->focus_wv = 1; marks_clear(t); -#ifdef USE_THREAD - /* kill color thread */ - t->thread = NULL; -#endif break; case WEBKIT_LOAD_COMMITTED: @@ -4625,7 +4371,7 @@ } DNPRINTF(XT_D_JS, "%s: about to run script\n", __func__); - run_script_locked(t, js); + run_script(t, js); done: if (su) @@ -7172,10 +6918,10 @@ GtkWidget *toolbar = NULL, *b; #if GTK_CHECK_VERSION(3, 0, 0) - b = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + b = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1); gtk_widget_set_name(GTK_WIDGET(b), "toolbar"); #else - b = gtk_hbox_new(FALSE, 0); + b = gtk_hbox_new(FALSE, 1); #endif toolbar = b; gtk_container_set_border_width(GTK_CONTAINER(toolbar), 0); @@ -7221,10 +6967,10 @@ GtkWidget *toolbar = NULL, *b; #if GTK_CHECK_VERSION(3, 0, 0) - b = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + b = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1); gtk_widget_set_name(GTK_WIDGET(b), "toolbar"); #else - b = gtk_hbox_new(FALSE, 0); + b = gtk_hbox_new(FALSE, 1); #endif toolbar = b; gtk_container_set_border_width(GTK_CONTAINER(toolbar), 0); @@ -7490,10 +7236,6 @@ if (t == NULL) return; - /* - * no need to join thread here because it won't access t on completion - */ - TAILQ_REMOVE(&tabs, t, entry); buffercmd_abort(t); @@ -7632,7 +7374,7 @@ sbe = gtk_label_new(NULL); gtk_widget_set_can_focus(GTK_WIDGET(sbe), FALSE); - gtk_widget_modify_font(GTK_WIDGET(sbe), statusbar_font); + modify_font(GTK_WIDGET(sbe), statusbar_font); return (sbe); } @@ -7694,7 +7436,7 @@ /* create these widgets only if specified in statusbar_elems */ t->sbe.uri = gtk_entry_new(); gtk_widget_set_can_focus(GTK_WIDGET(t->sbe.uri), FALSE); - gtk_widget_modify_font(GTK_WIDGET(t->sbe.uri), statusbar_font); + modify_font(GTK_WIDGET(t->sbe.uri), statusbar_font); #if !GTK_CHECK_VERSION(3, 0, 0) gtk_entry_set_inner_border(GTK_ENTRY(t->sbe.uri), NULL); gtk_entry_set_has_frame(GTK_ENTRY(t->sbe.uri), FALSE); @@ -7825,7 +7567,7 @@ gtk_label_set_max_width_chars(GTK_LABEL(t->label), 20); gtk_label_set_ellipsize(GTK_LABEL(t->label), PANGO_ELLIPSIZE_END); gtk_label_set_line_wrap(GTK_LABEL(t->label), FALSE); - gtk_widget_set_size_request(b, 130, 0); + gtk_widget_set_size_request(t->tab_content, 130, 0); /* * this is a total hack and most likely breaks with other styles but @@ -7838,8 +7580,8 @@ gtk_widget_set_size_request(t->label, 100, 0); #endif - gtk_box_pack_start(GTK_BOX(b), bb, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(b), t->label, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(t->tab_content), bb, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(t->tab_content), t->label, FALSE, FALSE, 0); #if GTK_CHECK_VERSION(2, 20, 0) gtk_box_pack_end(GTK_BOX(b), t->spinner, FALSE, FALSE, 0); #endif @@ -7875,7 +7617,7 @@ gtk_widget_modify_base(t->oops, GTK_STATE_NORMAL, &color); #endif gtk_box_pack_end(GTK_BOX(t->vbox), t->oops, FALSE, FALSE, 0); - gtk_widget_modify_font(GTK_WIDGET(t->oops), oops_font); + modify_font(GTK_WIDGET(t->oops), oops_font); /* command entry */ t->cmd = gtk_entry_new(); @@ -7884,7 +7626,7 @@ gtk_entry_set_inner_border(GTK_ENTRY(t->cmd), NULL); gtk_entry_set_has_frame(GTK_ENTRY(t->cmd), FALSE); gtk_box_pack_end(GTK_BOX(t->vbox), t->cmd, FALSE, FALSE, 0); - gtk_widget_modify_font(GTK_WIDGET(t->cmd), cmd_font); + modify_font(GTK_WIDGET(t->cmd), cmd_font); /* status bar */ statusbar_create(t); @@ -7934,7 +7676,7 @@ gtk_label_set_width_chars(GTK_LABEL(t->tab_elems.label), 1); gtk_misc_set_alignment(GTK_MISC(t->tab_elems.label), 0.0, 0.0); gtk_misc_set_padding(GTK_MISC(t->tab_elems.label), 4.0, 4.0); - gtk_widget_modify_font(GTK_WIDGET(t->tab_elems.label), tabbar_font); + modify_font(GTK_WIDGET(t->tab_elems.label), tabbar_font); gdk_color_parse(XT_COLOR_CT_BACKGROUND, &color); gtk_widget_modify_bg(t->tab_elems.eventbox, GTK_STATE_NORMAL, &color); @@ -7962,7 +7704,8 @@ append_tab(t); else { TAILQ_INSERT_TAIL(&tabs, t, entry); - gtk_notebook_insert_page(notebook, t->vbox, b, id); + gtk_notebook_insert_page(notebook, t->vbox, t->tab_content, + id); gtk_box_reorder_child(GTK_BOX(tab_bar_box), t->tab_elems.eventbox, id); recalc_tabs(); @@ -8235,7 +7978,7 @@ gtk_icon_size = icon_size_map(size ? size : icon_size); image = gtk_image_new_from_stock(stockid, gtk_icon_size); - gtk_container_set_border_width(GTK_CONTAINER(button), 1); + gtk_container_set_border_width(GTK_CONTAINER(button), 0); gtk_container_add(GTK_CONTAINER(button), GTK_WIDGET(image)); gtk_widget_set_name(button, name); gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); @@ -8524,81 +8267,6 @@ exit(0); } -GStaticRecMutex my_gdk_mtx = G_STATIC_REC_MUTEX_INIT; -volatile int mtx_depth; -int mtx_complain; - -/* - * The linux flash plugin violates the gdk locking mechanism. - * Work around the issue by using a recursive mutex with some match applied - * to see if we hit a buggy condition. - * - * The following code is painful so just don't read it. It really doesn't - * make much sense but seems to work. - */ -void -mtx_lock(void) -{ -#ifdef XT_DEBUG - char *s = NULL; -#endif - - g_static_rec_mutex_lock(&my_gdk_mtx); - if (my_gdk_mtx.depth <= 0) { -#ifdef XT_DEBUG - s = "lock <= 0"; -#endif - g_static_rec_mutex_lock(&my_gdk_mtx); - goto complain; - } else if (my_gdk_mtx.depth != 1) { -#ifdef XT_DEBUG - s = "lock != 1"; -#endif - do { - g_static_rec_mutex_unlock(&my_gdk_mtx); - } while (my_gdk_mtx.depth > 1); - goto complain; - } - return; - -complain: - if (mtx_complain == 0) { - DNPRINTF(XT_D_MTX, "buggy mutex implementation detected(%s), " - "work around implemented", s); - mtx_complain = 1; - } -} - -void -mtx_unlock(void) -{ -#ifdef XT_DEBUG - char *s = NULL; -#endif - - if (my_gdk_mtx.depth <= 0) { -#ifdef XT_DEBUG - s = "unlock <= 0"; -#endif - goto complain; - } else if (my_gdk_mtx.depth != 1) { -#ifdef XT_DEBUG - s = "unlock != 1"; -#endif - g_static_rec_mutex_unlock_full(&my_gdk_mtx); - goto complain; - } - g_static_rec_mutex_unlock(&my_gdk_mtx); - return; - -complain: - if (mtx_complain == 0) { - DNPRINTF(XT_D_MTX, "buggy mutex implementation detected(%s), " - "work around implemented", s); - mtx_complain = 1; - } -} - #if GTK_CHECK_VERSION(3, 0, 0) void setup_css(void) @@ -8663,20 +8331,6 @@ os_init(); /* prepare gtk */ -#ifdef USE_THREADS -#if !defined __MINGW32__ - /* http://web.archiveorange.com/archive/v/UsPjxkX5PsaXBIoOjqxf */ - XInitThreads(); -#endif - /* http://developer.gnome.org/gdk/stable/gdk-Threads.html */ - g_thread_init(NULL); - gdk_threads_set_lock_functions(mtx_lock, mtx_unlock); - gdk_threads_init(); - gdk_threads_enter(); - - /* http://www.gnupg.org/documentation/manuals/gcrypt/Multi_002dThreading.html */ - gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); -#endif gtk_init(&argc, &argv); gnutls_global_init(); @@ -8719,7 +8373,11 @@ warn("getrlimit"); else { /* just use them all */ +#ifdef __APPLE__ + rlp.rlim_cur = OPEN_MAX; +#else rlp.rlim_cur = rlp.rlim_max; +#endif if (setrlimit(RLIMIT_NOFILE, &rlp) == -1) warn("setrlimit"); if (getrlimit(RLIMIT_NOFILE, &rlp) == -1) @@ -9027,6 +8685,12 @@ /* tld list */ tld_tree_init(); + /* cache mode */ + if (enable_cache) + webkit_set_cache_model(WEBKIT_CACHE_MODEL_WEB_BROWSER); + else + webkit_set_cache_model(WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER); + if (enable_strict_transport) strict_transport_init(); @@ -9087,12 +8751,6 @@ gtk_main(); -#ifdef USE_THREADS - GDK_FLUSH(); - gdk_threads_leave(); - g_static_rec_mutex_unlock_full(&my_gdk_mtx); /* just in case */ -#endif - gnutls_global_deinit(); if (url_regex) diff -Nru xombrero-1.4.0/xombrero.h xombrero-1.5.0/xombrero.h --- xombrero-1.4.0/xombrero.h 2012-12-21 10:03:47.000000000 +0000 +++ xombrero-1.5.0/xombrero.h 2013-05-16 16:12:42.000000000 +0000 @@ -2,6 +2,7 @@ * Copyright (c) 2011 Conformal Systems LLC * Copyright (c) 2011 Marco Peereboom * Copyright (c) 2010, 2011, 2012 Edd Barrett + * Copyright (c) 2012, 2013 Josh Rickmar * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -42,6 +43,15 @@ void arc4random_buf(void *, size_t); u_int32_t arc4random_uniform(u_int32_t); # endif +#elif defined(__APPLE__) +#include "osx/util.h" +#include "osx/tree.h" +#include +#include +#include +#include +#include +#define LOGIN_NAME_MAX MAXLOGNAME #elif defined(__FreeBSD__) #include #include "freebsd/util.h" @@ -96,24 +106,6 @@ #include #include -/* comment if you don't want to use threads */ -#define USE_THREADS - -#ifdef USE_THREADS -/* http://seclists.org/wireshark/2011/Jul/209 */ -#define _GCRYPT_IN_LIBGCRYPT 1 -#include -#include - -/* #define USE_FLUSH */ -#ifdef USE_FLUSH -#define GDK_FLUSH() do { gdk_flush(); } while (0) -#else -#define GDK_FLUSH() -#endif /* USE_FLUSH */ - -#endif - /* set if you don't want to use resource limits */ #ifndef XT_RESOURCE_LIMITS_DISABLE #include @@ -176,7 +168,6 @@ #define XT_D_CUSTOM_URI 0x80000 #define XT_D_CMD_ALIAS 0x100000 #define XT_D_SEARCH 0x200000 -#define XT_D_MTX 0x400000 extern uint32_t swm_debug; #else #define DPRINTF(x...) @@ -273,10 +264,7 @@ gchar *tmp_uri; int popup; /* 1 if cmd_entry has popup visible */ int download_requested; -#ifdef USE_THREADS - /* https thread stuff */ - GThread *thread; -#endif + /* hints */ int script_init; int new_tab; @@ -312,6 +300,9 @@ /* signal handles */ gulong progress_handle; + + /* cert chain (pem) */ + char *cert_chain; }; TAILQ_HEAD(tab_list, tab); @@ -448,6 +439,11 @@ #define XT_PRXY_SHOW (1<<0) #define XT_PRXY_TOGGLE (1<<1) +/* url modify */ +#define XT_URL (1<<0) +#define XT_URL_PLUS (1<<1) +#define XT_URL_MIN (1<<2) + /* inspector */ #define XT_INS_SHOW (1<<0) #define XT_INS_HIDE (1<<1) @@ -833,6 +829,7 @@ size_t get_settings_size(void); int settings_add(char *, char *); void setup_proxy(char *); +int proxy_cmd(struct tab *, struct karg *); int set_browser_mode(struct settings *, char *); int set_encoding(struct tab *, struct karg *); int set_gui_mode(struct settings *, char *); @@ -858,6 +855,12 @@ int save_runtime_setting(const char *, const char *); void wl_add(const char *, struct wl_list *, int); +#if GTK_CHECK_VERSION(3,0,0) +#define modify_font gtk_widget_override_font +#else +#define modify_font gtk_widget_modify_font +#endif + #define XT_DL_START (0) #define XT_DL_RESTART (1) int download_start(struct tab *, struct download *, int flag); @@ -880,6 +883,7 @@ extern int ctrl_click_focus; extern int cookies_enabled; extern int read_only_cookies; +extern int enable_cache; extern int enable_scripts; extern int enable_plugins; extern gfloat default_zoom_level;