Projects
openEuler:Mainline
libproxy
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
_service:tar_scm:libproxy.spec
Changed
@@ -1,6 +1,6 @@ Name: libproxy -Version: 0.4.17 -Release: 2 +Version: 0.4.18 +Release: 1 Summary: Libproxy is a library that provides automatic proxy configuration management License: LGPLv2+ @@ -9,11 +9,9 @@ # Source1 comes from the Debian package. Source1: proxy.1 -Patch6000: backport-libproxy-0.4.17-fix-python-version-check.patch - BuildRequires: cmake >= 2.6.0 gcc-c++ BuildRequires: pkgconfig(gio-2.0) >= 2.26 pkgconfig(libnm) python3-devel -BuildRequires: pkgconfig(dbus-1) pkgconfig(javascriptcoregtk-4.0) +BuildRequires: pkgconfig(dbus-1) pkgconfig(duktape) Provides: %{name}-bin %{name}-gnome %{name}-kde %{name}-networkmanager %{name}-pacrunner Obsoletes: %{name}-bin %{name}-gnome %{name}-kde %{name}-mozjs %{name}-networkmanager %{name}-pacrunner @@ -36,13 +34,13 @@ %description -n python3-%{name} The python3 binding for libproxy. -%package webkitgtk4 -Summary: plugin for webkit2gtk3 +%package duktape +Summary: plugin for duktape Requires: %{name} = %{version}-%{release} Provides: %{name}-pac = %{version}-%{release} -%description webkitgtk4 -plugin for webkit2gtk3. +%description duktape +plugin for duktape. %package devel Summary: Libproxy provides consistent proxy configuration to applications - Development Files @@ -61,7 +59,7 @@ -DMODULE_INSTALL_DIR=%{_libdir}/%{name}/%{version}/modules \ -DBIPR=OFF \ -DWITH_PERL=OFF -DWITH_GNOME3=ON \ - -DWITH_PYTHON3=ON -DWITH_WEBKIT3=ON -DWITH_MOZJS=OFF . + -DWITH_PYTHON3=ON -DWITH_WEBKIT3=OFF -DWITH_DUKTAPE=ON -DWITH_MOZJS=OFF . %make_build %install @@ -83,16 +81,16 @@ %{_bindir}/proxy %{_libdir}/%{name}/%{version}/modules/* %{_libexecdir}/pxgsettings -%exclude %{_libdir}/%{name}/%{version}/modules/pacrunner_webkit.so +%exclude %{_libdir}/%{name}/%{version}/modules/pacrunner_duktape.so %files -n python3-%{name} %defattr(-,root,root) %{python3_sitelib}/__pycache__/* %{python3_sitelib}/%{name}.* -%files webkitgtk4 +%files duktape %defattr(-,root,root) -%{_libdir}/%{name}/%{version}/modules/pacrunner_webkit.so +%{_libdir}/%{name}/%{version}/modules/pacrunner_duktape.so %files devel %defattr(-,root,root) @@ -106,6 +104,12 @@ %{_mandir}/man1/proxy.1* %changelog +* Tue Nov 08 2022 zhouyihang <zhouyihang3@h-partners.com> - 0.4.18-1 +- Type:requirements +- Id:NA +- SUG:NA +- DESC:update libproxy to 0.4.18 + * Sat Apr 16 2022 yanglu <yanglu72@h-partners.com> - 0.4.17-2 - Type:bugfix - Id:NA
View file
_service:tar_scm:backport-libproxy-0.4.17-fix-python-version-check.patch
Deleted
@@ -1,58 +0,0 @@ -From 04eeeabb42436cb58e9bac2f6c31c0fb87905a72 Mon Sep 17 00:00:00 2001 -From: David King <amigadave@amigadave.com> -Date: Mon, 21 Jun 2021 17:10:43 +0100 -Subject: PATCH python: Support Python 3.10 and above -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -As suggested by Miro Hrončok, change the way that the Python interpreter -version is found. Additionally, update the static list of accepted -Python 3 versions. - -https://bugzilla.redhat.com/show_bug.cgi?id=1898060 ---- - bindings/python/python2/CMakeLists.txt | 2 +- - bindings/python/python3/CMakeLists.txt | 2 +- - cmake/FindPython3Interp.cmake | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/bindings/python/python2/CMakeLists.txt b/bindings/python/python2/CMakeLists.txt -index 00df551..f4d2b91 100644 ---- a/bindings/python/python2/CMakeLists.txt -+++ b/bindings/python/python2/CMakeLists.txt -@@ -6,7 +6,7 @@ if(PYTHON2INTERP_FOUND) - if(NOT PYTHON2_SITEPKG_DIR) - execute_process(COMMAND - ${PYTHON2_EXECUTABLE} -- -c "import sys; print (sys.version0:3)" -+ -c "import sys; print('{}.{}'.format(*sys.version_info0:2))" - OUTPUT_VARIABLE PYTHON2_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE) - -diff --git a/bindings/python/python3/CMakeLists.txt b/bindings/python/python3/CMakeLists.txt -index bf87dfc..fc3b24b 100644 ---- a/bindings/python/python3/CMakeLists.txt -+++ b/bindings/python/python3/CMakeLists.txt -@@ -6,7 +6,7 @@ if(PYTHON3INTERP_FOUND) - if(NOT PYTHON3_SITEPKG_DIR) - execute_process(COMMAND - ${PYTHON3_EXECUTABLE} -- -c "import sys; print (sys.version0:3)" -+ -c "import sys; print('{}.{}'.format(*sys.version_info0:2))" - OUTPUT_VARIABLE PYTHON3_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE) - -diff --git a/cmake/FindPython3Interp.cmake b/cmake/FindPython3Interp.cmake -index 74398b2..5b25e5a 100644 ---- a/cmake/FindPython3Interp.cmake -+++ b/cmake/FindPython3Interp.cmake -@@ -39,7 +39,7 @@ - - unset(_Python3_NAMES) - --set(_Python3_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0) -+set(_Python3_VERSIONS 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0) - - if(Python3Interp_FIND_VERSION) - if(Python3Interp_FIND_VERSION_COUNT GREATER 1)
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="scm">git</param> <param name="url">git@gitee.com:src-openeuler/libproxy.git</param> - <param name="revision">4b0baafae5225b996f01e19d8921dc36b67ea1f5</param> + <param name="revision">master</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/INSTALL -> _service:tar_scm:libproxy-0.4.18.tar.gz/INSTALL
Changed
@@ -120,6 +120,7 @@ WITH_WEBKIT3: Default to OFF: Enable Webkit GTK3 support. +WITH_DUKTAPE: Defaults to ON. Enable Duktape JavaScript engine. Bindings Path: ==============
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/NEWS -> _service:tar_scm:libproxy-0.4.18.tar.gz/NEWS
Changed
@@ -1,3 +1,13 @@ +New in version 0.4.18: +============================== +* build: Allow configuration of sysconfig module +* config_envvar: Add environment variable for pacrunner debugging +* build: disable mozjs by default +* python: Support Python 3.10 and above +* Add Duktape pacrunner module +* config_kde: Compute list of config file locations ourselves +* cpmfog_gnome3: Add gnome-wayland to permitted DESKTOP_SESSION + New in version 0.4.17: ============================== * python bindings: fix "TypeError: _argtypes_ must be a sequence of types" (#125)
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/bindings/perl/lib/CMakeLists.txt -> _service:tar_scm:libproxy-0.4.18.tar.gz/bindings/perl/lib/CMakeLists.txt
Changed
@@ -1,2 +1,2 @@ -add_custom_target(PMlibproxy ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Libproxy.pm ${CMAKE_BINARY_DIR}/perl/blib/lib/Libproxy.pm) +add_custom_target(PMlibproxy ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Libproxy.pm ${CMAKE_BINARY_DIR}/perl/Net/Libproxy.pm) install( FILES Libproxy.pm DESTINATION ${PX_PERL_ARCH}/Net )
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/bindings/perl/src/CMakeLists.txt -> _service:tar_scm:libproxy-0.4.18.tar.gz/bindings/perl/src/CMakeLists.txt
Changed
@@ -9,7 +9,7 @@ set(Libproxy_LIB_SRCS Libproxy.c) -set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/perl/blib/arch/auto/Net) +set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/perl/auto/Net/Libproxy) add_library(PLlibproxy SHARED ${Libproxy_LIB_SRCS}) set(PLlibproxy_LIB_DEPENDENCIES libproxy pthread)
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/bindings/perl/src/Libproxy.xs -> _service:tar_scm:libproxy-0.4.18.tar.gz/bindings/perl/src/Libproxy.xs
Changed
@@ -15,6 +15,37 @@ SvSetSV( arg, newRV((SV*)avref)); } +/* http://www.perlmonks.org/?node_id=680842 */ +static char ** +XS_unpack_charPtrPtr (SV *arg) { + char **ret; + AV *av; + I32 i; + + if (!arg || !SvOK (arg) || !SvROK (arg) || SvTYPE (SvRV (arg)) != SVt_PVAV) + croak ("array reference expected"); + + av = (AV *)SvRV (arg); + ret = malloc ((av_len (av) + 1 + 1) * sizeof (char *)); + if (!ret) + croak ("malloc failed"); + + for (i = 0; i <= av_len (av); i++) { + SV **elem = av_fetch (av, i, 0); + + if (!elem || !*elem) { + free (ret); + croak ("missing element in list"); + } + + reti = SvPV_nolen (*elem); + } + + reti = NULL; + + return ret; +} + MODULE = Net::Libproxy PACKAGE = Net::Libproxy
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/bindings/perl/t/CMakeLists.txt -> _service:tar_scm:libproxy-0.4.18.tar.gz/bindings/perl/t/CMakeLists.txt
Changed
@@ -1,1 +1,2 @@ -add_custom_target(test prove -b ${CMAKE_CURRENT_SOURCE_DIR}) +add_test(NAME perl COMMAND prove -b ${CMAKE_CURRENT_SOURCE_DIR}) +set_property(TEST perl APPEND PROPERTY ENVIRONMENT "PERL5LIB=${CMAKE_BINARY_DIR}/perl")
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/bindings/python/python2/CMakeLists.txt -> _service:tar_scm:libproxy-0.4.18.tar.gz/bindings/python/python2/CMakeLists.txt
Changed
@@ -6,7 +6,7 @@ if(NOT PYTHON2_SITEPKG_DIR) execute_process(COMMAND ${PYTHON2_EXECUTABLE} - -c "import sys; print (sys.version0:3)" + -c "import sys; print('{}.{}'.format(*sys.version_info0:2))" OUTPUT_VARIABLE PYTHON2_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/bindings/python/python3/CMakeLists.txt -> _service:tar_scm:libproxy-0.4.18.tar.gz/bindings/python/python3/CMakeLists.txt
Changed
@@ -6,7 +6,7 @@ if(NOT PYTHON3_SITEPKG_DIR) execute_process(COMMAND ${PYTHON3_EXECUTABLE} - -c "import sys; print (sys.version0:3)" + -c "import sys; print('{}.{}'.format(*sys.version_info0:2))" OUTPUT_VARIABLE PYTHON3_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/cmake/FindPython2Interp.cmake -> _service:tar_scm:libproxy-0.4.18.tar.gz/cmake/FindPython2Interp.cmake
Changed
@@ -27,15 +27,32 @@ # Copyright 2012 Rolf Eike Beer <eike@sf-mail.de> # Copyright 2016 Dominique Leuenberger <dimstar@opensuse.org> # -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: # -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * 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. +# +# * Neither the name of Kitware, Inc. nor the names of Contributors +# may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "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 COPYRIGHT +# HOLDER OR CONTRIBUTORS 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. unset(_Python2_NAMES)
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/cmake/FindPython3Interp.cmake -> _service:tar_scm:libproxy-0.4.18.tar.gz/cmake/FindPython3Interp.cmake
Changed
@@ -27,19 +27,36 @@ # Copyright 2012 Rolf Eike Beer <eike@sf-mail.de> # Copyright 2016 Dominique Leuenberger <dimstar@opensuse.org> # -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: # -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * 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. +# +# * Neither the name of Kitware, Inc. nor the names of Contributors +# may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "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 COPYRIGHT +# HOLDER OR CONTRIBUTORS 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. unset(_Python3_NAMES) -set(_Python3_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0) +set(_Python3_VERSIONS 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0) if(Python3Interp_FIND_VERSION) if(Python3Interp_FIND_VERSION_COUNT GREATER 1)
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/libproxy/CMakeLists.txt -> _service:tar_scm:libproxy-0.4.18.tar.gz/libproxy/CMakeLists.txt
Changed
@@ -1,6 +1,6 @@ ### Project info project(libproxy) -set_project_version(0 4 17) +set_project_version(0 4 18) ### Add a global compilation stuff if (WIN32)
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/libproxy/cmake/modules.cmk -> _service:tar_scm:libproxy-0.4.18.tar.gz/libproxy/cmake/modules.cmk
Changed
@@ -18,10 +18,13 @@ include(cmake/modules/pacrunner_mozjs.cmk) include(cmake/modules/pacrunner_natus.cmk) include(cmake/modules/pacrunner_webkit.cmk) +include(cmake/modules/pacrunner_duktape.cmk) # Build the pacrunner into libproxy unless we are building for multiple engines set(BIPR 1 CACHE BOOL "Build internal pacrunner? (Always false when building more than one PR") -if((MOZJS_FOUND AND WEBKIT_FOUND) OR (MOZJS_FOUND AND NATUS_FOUND) OR (WEBKIT_FOUND AND NATUS_FOUND)) + +math(EXPR NUM_PACRUNNER "${MOZJS_FOUND}+${NATUS_FOUND}+${WEBKIT_FOUND}+${DUKTAPE_FOUND}") +if(NUM_PACRUNNER GREATER 1) set(BIPR 0) endif() @@ -44,8 +47,10 @@ set(NM_BUILD 1) endif(NM_FOUND OR NMold_FOUND) px_module(network_networkmanager "${NM_BUILD}" 0 ${NM_LIBRARIES}${NMold_LIBRARIES}) -px_module(pacrunner_mozjs 0 ${BIPR} ${MOZJS_LIBRARIES}) +px_module(pacrunner_mozjs "${MOZJS_FOUND}" ${BIPR} ${MOZJS_LIBRARIES}) px_module(pacrunner_natus "${NATUS_FOUND}" ${BIPR} ${NATUS_LIBRARIES}) px_module(pacrunner_webkit "${WEBKIT_FOUND}" ${BIPR} ${WEBKIT_LIBRARIES}) +px_module(pacrunner_duktape "${DUKTAPE_FOUND}" ${BIPR} ${DUKTAPE_LIBRARIES}) px_module(wpad_dns_alias 1 1) +message("${NUM_PACRUNNER} pacrunner(s) are enabled") message("")
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/libproxy/cmake/modules/config_sysconfig.cmk -> _service:tar_scm:libproxy-0.4.18.tar.gz/libproxy/cmake/modules/config_sysconfig.cmk
Changed
@@ -1,5 +1,8 @@ if (NOT WIN32 AND NOT APPLE) - if (EXISTS "/etc/sysconfig" AND IS_DIRECTORY "/etc/sysconfig") - set(SYSCONFIG_FOUND 1) + option(WITH_SYSCONFIG "Build sysconfig module for /etc/sysconfig" ON) + if(WITH_SYSCONFIG) + if (EXISTS "/etc/sysconfig" AND IS_DIRECTORY "/etc/sysconfig") + set(SYSCONFIG_FOUND 1) + endif() endif() endif() \ No newline at end of file
View file
_service:tar_scm:libproxy-0.4.18.tar.gz/libproxy/cmake/modules/pacrunner_duktape.cmk
Added
@@ -0,0 +1,21 @@ +if(WIN32) + set(DUKTAPE_FOUND 0) +else() + set(DUKTAPE_INCLUDE_DIR "DUKTAPE_INCLUDE_DIR-NOTFOUND" CACHE PATH "Path to Duktape headers") + set(DUKTAPE_LIBRARIES "DUKTAPE_LIBRARIES-NOTFOUND" CACHE FILEPATH "Path to Duktape libraries") + + option(WITH_DUKTAPE "Search for Duktape package" ON) + + if(WITH_DUKTAPE) + px_check_modules(DUKTAPE "duktape") + + if(NOT DUKTAPE_FOUND AND DUKTAPE_INCLUDE_DIR AND DUKTAPE_LIBRARIES) + message("Duktape headers: " ${DUKTAPE_INCLUDE_DIR}) + message("Duktape libraries: " ${DUKTAPE_LIBRARIES}) + set(DUKTAPE_FOUND 1) + include_directories(${DUKTAPE_INCLUDE_DIR}) + link_directories(${DUKTAPE_LIBRARIES}) + link_libraries(duktape) + endif() + endif() +endif()
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/libproxy/cmake/modules/pacrunner_mozjs.cmk -> _service:tar_scm:libproxy-0.4.18.tar.gz/libproxy/cmake/modules/pacrunner_mozjs.cmk
Changed
@@ -7,7 +7,7 @@ include_directories("${MOZJS_INCLUDE_DIR}") endif() elseif(NOT APPLE) - option(WITH_MOZJS "Search for MOZJS package" ON) + option(WITH_MOZJS "Search for MOZJS package" OFF) if (WITH_MOZJS) pkg_search_module(MOZJS mozjs-68) if(MOZJS_FOUND)
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/libproxy/cmake/modules/pacrunner_webkit.cmk -> _service:tar_scm:libproxy-0.4.18.tar.gz/libproxy/cmake/modules/pacrunner_webkit.cmk
Changed
@@ -20,7 +20,7 @@ px_check_modules(WEBKIT "webkitgtk-3.0 < 1.5.0") endif(NOT WEBKIT_LIBRARIES) endif(NOT WEBKIT_LIBRARIES) - else(WITH_WEBKIT3) + else(WITH_WEBKIT) px_check_modules(WEBKIT webkit-1.0) endif() endif()
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/libproxy/modules/config_envvar.cpp -> _service:tar_scm:libproxy-0.4.18.tar.gz/libproxy/modules/config_envvar.cpp
Changed
@@ -28,6 +28,12 @@ const char *proxy = NULL; vector<url> response; + // If _PX_DEBUG_PACURL is set, use it as the PAC URL. + if (proxy = getenv("_PX_DEBUG_PACURL")) { + response.push_back(url(string("pac+") + proxy)); + return response; + } + // If the URL is an ftp url, try to read the ftp proxy if (dst.get_scheme() == "ftp") { if (!(proxy = getenv("ftp_proxy")))
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/libproxy/modules/config_gnome3.cpp -> _service:tar_scm:libproxy-0.4.18.tar.gz/libproxy/modules/config_gnome3.cpp
Changed
@@ -299,6 +299,8 @@ || (getenv("DESKTOP_SESSION") && string(getenv("DESKTOP_SESSION")) == "gnome") || (getenv("DESKTOP_SESSION") + && string(getenv("DESKTOP_SESSION")) == "gnome-wayland") + || (getenv("DESKTOP_SESSION") && string(getenv("DESKTOP_SESSION")) == "mate")); }
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/libproxy/modules/config_kde.cpp -> _service:tar_scm:libproxy-0.4.18.tar.gz/libproxy/modules/config_kde.cpp
Changed
@@ -1,7 +1,7 @@ /******************************************************************************* * libproxy - A library for proxy configuration * Copyright (C) 2006 Nathaniel McCallum <nathaniel@natemccallum.com> - * Copyright (C) 2016 Fabian Vogt <fvogt@suse.com> + * Copyright (C) 2021 Fabian Vogt <fvogt@suse.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,6 +19,7 @@ ******************************************************************************/ #include <sys/stat.h> +#include <pwd.h> #include <algorithm> #include <cstdlib> @@ -46,7 +47,7 @@ command_output("kreadconfig5 --key nonexistant"); try { - parse_dir_list(command_output("qtpaths --paths GenericConfigLocation")); + use_xdg_config_dirs(); } catch(...) {} @@ -190,7 +191,7 @@ time_t mtime; // 0 means either not refreshed or doesn't exist }; - // Parses output of qtpaths/kde4-config to fill config_locs + // Parses colon-delimited lists of paths to fill config_locs void parse_dir_list(const string &dirs) { string config_path; stringstream config_paths_stream(dirs); @@ -204,6 +205,34 @@ } } + // Add XDG configuration locations to the configuration paths + void use_xdg_config_dirs() { + // Return environment value as std::string if set, otherwise def + auto getenv_default = (const char *name, const std::string &def) { + const char *ret = getenv(name); + return std::string(ret ? ret : def); + }; + + std::string homedir = getenv_default("HOME", ""); + if (homedir.empty()) { + size_t bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); + if (bufsize == -1) + bufsize = 16384; + + std::vector<char> buf(bufsize); + struct passwd pwd, *result; + getpwuid_r(getuid(), &pwd, buf.data(), buf.size(), &result); + if (result) + homedir = pwd.pw_dir; + } + + if (homedir.empty()) + throw std::runtime_error("Failed to get home directory"); + + parse_dir_list(getenv_default("XDG_CONFIG_HOME", homedir + "/.config")); + parse_dir_list(getenv_default("XDG_CONFIG_DIRS", "/etc/xdg")); + } + // If any of the locations in config_locs changed (different mtime), // update config_locs and return true. bool cache_needs_refresh() {
View file
_service:tar_scm:libproxy-0.4.18.tar.gz/libproxy/modules/pacrunner_duktape.cpp
Added
@@ -0,0 +1,138 @@ +/******************************************************************************* + * libproxy - A library for proxy configuration + * Copyright (C) 2006 Nathaniel McCallum <nathaniel@natemccallum.com> + * Copyright (C) 2021 Zhaofeng Li <hello@zhaofeng.li> + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA + ******************************************************************************/ + +#include "../extension_pacrunner.hpp" +#include <unistd.h> // gethostname +using namespace libproxy; + +#include <duktape.h> +#include "pacutils.h" + +static duk_ret_t dnsResolve(duk_context *ctx) { + if (duk_get_top(ctx) != 1) { + // Invalid number of arguments + return 0; + } + + // We do not need to free the string - It's managed by Duktape. + const char *hostname = duk_get_string(ctx, 0); + if (!hostname) { + return 0; + } + + // Look it up + struct addrinfo *info; + if (getaddrinfo(hostname, NULL, NULL, &info)) { + return 0; + } + + // Try for IPv4 + char tmpINET6_ADDRSTRLEN+1; + if (getnameinfo(info->ai_addr, info->ai_addrlen, + tmp, INET6_ADDRSTRLEN+1, + NULL, 0, + NI_NUMERICHOST)) { + freeaddrinfo(info); + duk_push_null(ctx); + return 1; + } + freeaddrinfo(info); + + // Create the return value + duk_push_string(ctx, tmp); + return 1; +} + +static duk_ret_t myIpAddress(duk_context *ctx) { + char hostname1024; + hostnamesizeof(hostname) - 1 = '\0'; + + if (!gethostname(hostname, sizeof(hostname) - 1)) { + duk_push_string(ctx, hostname); + return dnsResolve(ctx); + } + + return duk_error(ctx, DUK_ERR_ERROR, "Unable to find hostname!"); +} + +class duktape_pacrunner : public pacrunner { +public: + duktape_pacrunner(string pac, const url& pacurl) : pacrunner(pac, pacurl) { + this->ctx = duk_create_heap_default(); + if (!this->ctx) goto error; + duk_push_c_function(this->ctx, dnsResolve, 1); + duk_put_global_string(this->ctx, "dnsResolve"); + + duk_push_c_function(this->ctx, myIpAddress, 1); + duk_put_global_string(this->ctx, "myIpAddress"); + + // Add other routines + duk_push_string(this->ctx, JAVASCRIPT_ROUTINES); + if (duk_peval_noresult(this->ctx)) { + goto error; + } + + // Add the PAC into the context + duk_push_string(this->ctx, pac.c_str()); + if (duk_peval_noresult(this->ctx)) { + goto error; + } + + return; + error: + duk_destroy_heap(this->ctx); + throw bad_alloc(); + } + + ~duktape_pacrunner() { + duk_destroy_heap(this->ctx); + } + + string run(const url& url_) override { + string url = url_.to_string(); + string host = url_.get_host(); + + duk_get_global_string(this->ctx, "FindProxyForURL"); + duk_push_string(this->ctx, url.c_str()); + duk_push_string(this->ctx, host.c_str()); + duk_int_t result = duk_pcall(this->ctx, 2); + + if (result == 0) { + // Success + const char *proxy = duk_get_string(this->ctx, 0); + if (!proxy) { + duk_pop(this->ctx); + return ""; + } + string proxyString = string(proxy); + duk_pop(this->ctx); + return proxyString; + } else { + // Something happened. The top of the stack is an error. + duk_pop(this->ctx); + return ""; + } + } + +private: + duk_context *ctx; +}; + +PX_PACRUNNER_MODULE_EZ(duktape, "duk_create_heap_default", "duktape");
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/libproxy/modules/pacrunner_mozjs.cpp -> _service:tar_scm:libproxy-0.4.18.tar.gz/libproxy/modules/pacrunner_mozjs.cpp
Changed
@@ -93,6 +93,7 @@ static bool myIpAddress(JSContext *cx, unsigned argc, JS::Value *vp) { JS::CallArgs argv=JS::CallArgsFromVp(argc,vp); char *hostname = (char *) JS_malloc(cx, 1024); + hostname1023 = '\0'; if (!gethostname(hostname, 1023)) { JSString *myhost = JS_NewStringCopyN(cx, hostname, strlen(hostname));
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/libproxy/modules/pacrunner_natus.cpp -> _service:tar_scm:libproxy-0.4.18.tar.gz/libproxy/modules/pacrunner_natus.cpp
Changed
@@ -56,7 +56,9 @@ static Value myIpAddress(Value& ths, Value& fnc, vector<Value>& arg) { char hostname1024; - if (!gethostname(hostname, 1023)) { + hostnamesizeof(hostname) - 1 = '\0'; + + if (!gethostname(hostname, sizeof(hostname) - 1)) { vector<Value> dnsargs; dnsargs.push_back(ths.newString(hostname)); return dnsResolve(ths, fnc, dnsargs);
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/libproxy/modules/pacrunner_webkit.cpp -> _service:tar_scm:libproxy-0.4.18.tar.gz/libproxy/modules/pacrunner_webkit.cpp
Changed
@@ -86,7 +86,9 @@ static JSValueRef myIpAddress(JSContextRef ctx, JSObjectRef func, JSObjectRef self, size_t /*argc*/, const JSValueRef /*argv*/, JSValueRef* /*exception*/) { char hostname1024; - if (!gethostname(hostname, 1023)) { + hostnamesizeof(hostname) - 1 = '\0'; + + if (!gethostname(hostname, sizeof(hostname) - 1)) { JSStringRef str = JSStringCreateWithUTF8CString(hostname); JSValueRef val = JSValueMakeString(ctx, str); JSStringRelease(str);
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/libproxy/proxy.h -> _service:tar_scm:libproxy-0.4.18.tar.gz/libproxy/proxy.h
Changed
@@ -74,7 +74,7 @@ * and should be use to authenticate the connection if present. * * For SOCKS proxies, when the protocol version is specified (socks4:// or - * sock5://), it is expected that only this version is used. When only + * socks5://), it is expected that only this version is used. When only * socks:// is set, the client MUST try SOCKS version 5 protocol and, on * connection failure, fallback to SOCKS version 4. *
View file
_service:tar_scm:libproxy-0.4.17.tar.gz/libproxy/url.cpp -> _service:tar_scm:libproxy-0.4.18.tar.gz/libproxy/url.cpp
Changed
@@ -457,7 +457,7 @@ // Build the request string request = "GET " + (m_path.size() > 0 ? m_path : "/") + m_query + " HTTP/1.1\r\n"; - request += "Host: " + m_host + "\r\n"; + request += "Host: " + m_host + (m_port != 80 ? ":" + std::to_string(m_port) : "") + "\r\n"; request += "Accept: " + string(PAC_MIME_TYPE) + "\r\n"; request += "Connection: close\r\n"; request += "\r\n";
View file
_service:tar_scm:libproxy.yaml
Changed
@@ -1,4 +1,4 @@ version_control: github src_repo: libproxy/libproxy -tag_prefix: ^ -seperator: . +tag_prefix: "^v" +separator: "." \ No newline at end of file
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2