[Bug 225434] [patch] Treat set but empty environment variables as unset in /usr/libexec/phttpget

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Jan 26 18:01:21 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225434

--- Comment #4 from Vasil Dimov <vd at FreeBSD.org> ---
Well, to remove any confusion:

130         env_HTTP_PROXY = getenv("HTTP_PROXY");
131         if (env_HTTP_PROXY == NULL)
132                 env_HTTP_PROXY = getenv("http_proxy");
133         if (env_HTTP_PROXY != NULL) {
134                 if (strncmp(env_HTTP_PROXY, "http://", 7) == 0)
135                         env_HTTP_PROXY += 7;
136                 p = strchr(env_HTTP_PROXY, '/');
137                 if (p != NULL)
138                         *p = 0;
139                 p = strchr(env_HTTP_PROXY, ':');
140                 if (p != NULL) {
141                         *p = 0;
142                         proxyport = p + 1;
143                 } else
144                         proxyport = "3128";
145         }

The bug surfaces if:

1. HTTP_PROXY is set to an empty string (in this case the value of http_proxy
is not looked up / is ignored)
OR
2. HTTP_PROXY is unset and http_proxy is set to an empty string

> By the way, I don't think the user agent portion of the proposed change makes > sense.  An empty string user agent may be desirable, even if non-conformant.
Agreed.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list