Your message dated Tue, 24 Apr 2018 00:37:20 +0200
with message-id
<CAKNHny9FVrkY0AQBnSZ367F8+0BH1dZn9J91qnW=cp11ogj...@mail.gmail.com>
and subject line Re: packagekit sets bogus http_proxy environment variable
has caused the Debian Bug report #777481,
regarding packagekit: proxy vars set to uninitialized memory content
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
777481: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=777481
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: packagekit
Version: 1.0.1-2
Tags: patch upstream
Hi,
Whenever the proxy configuration can not be found in the PackageKit.db
the proxy variables of PkBackendJob are left uninitialized. Moreover,
aptcc's AptIntf::init comes later down on the line and unconditionally
sets http_proxy and ftp_proxy, therefore setting them to whatever the
string processing functions get to read from memory.
The latter seems to have been fixed in 1.0.11, but from a quick look
it appears that the former bug is still present.
This environment is then available all the way to the maintainer
scripts and prevent them from working correctly due to the invalid
values.
Attached patches should fix both problems for 1.0.1-2, and the
pk-transaction-db.c patch applies as-is, with some fuzz, to 1.0.11.
Cheers,
--
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net
Index: packagekit-1.0.1/backends/aptcc/apt-intf.cpp
===================================================================
--- packagekit-1.0.1.orig/backends/aptcc/apt-intf.cpp 2015-12-02 11:51:16.950630140 +0100
+++ packagekit-1.0.1/backends/aptcc/apt-intf.cpp 2015-12-02 11:52:37.969169197 +0100
@@ -88,13 +88,17 @@ bool AptIntf::init()
// set http proxy
http_proxy = pk_backend_job_get_proxy_http(m_job);
- setenv("http_proxy", http_proxy, 1);
- g_free(http_proxy);
+ if (http_proxy != NULL) {
+ setenv("http_proxy", http_proxy, 1);
+ g_free(http_proxy);
+ }
// set ftp proxy
ftp_proxy = pk_backend_job_get_proxy_ftp(m_job);
- setenv("ftp_proxy", ftp_proxy, 1);
- g_free(ftp_proxy);
+ if (ftp_proxy != NULL) {
+ setenv("ftp_proxy", ftp_proxy, 1);
+ g_free(ftp_proxy);
+ }
// Prepare for the restart thing
if (g_file_test(REBOOT_REQUIRED, G_FILE_TEST_EXISTS)) {
Index: packagekit-1.0.1/src/pk-transaction-db.c
===================================================================
--- packagekit-1.0.1.orig/src/pk-transaction-db.c 2015-12-01 17:34:52.981602037 +0100
+++ packagekit-1.0.1/src/pk-transaction-db.c 2015-12-01 17:35:01.361448251 +0100
@@ -646,13 +646,13 @@ pk_transaction_db_get_proxy (PkTransacti
goto out;
}
+ /* success, even if we got no data */
+ ret = TRUE;
+
/* nothing matched */
if (!item->set)
goto out;
- /* success, even if we got no data */
- ret = TRUE;
-
/* copy data */
if (proxy_http != NULL)
*proxy_http = g_strdup (item->proxy_http);
--- End Message ---
--- Begin Message ---
2016-02-18 17:49 GMT+01:00 Matthias Klumpp <[email protected]>:
> Hi!
> This issue should be resolved with the latest update of PackageKit in
> testing/unstable
> [...]
This is fixed for a long time now, closing the issue.
Cheers,
Matthias
--- End Message ---