Re: [LEDE-DEV] Busybox weirdness

2017-11-02 Thread Philip Prindeville

> On Nov 2, 2017, at 4:24 AM, edgar.sol...@web.de wrote:
> 
> hey Phillip,
> 
> On 02.11.2017 03:36, Philip Prindeville wrote:
>> Can someone else please try to reproduce this?
> 
> yes, not exactly but wrong resulting file name nonetheless. it's obviously a 
> bug. looks like a variable reuse went awry as it always hit's the second 
> file, having fragments of the first file's name. i switched the files you 
> downloaded, just to test if there might be a server side influence.
> 
> :/tmp# wget 
> http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip 
> http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz
> Downloading 
> 'http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip'
> Connecting to 2400:cb00:2048:1::6810:262f:80
> Writing to 'GeoIPCountryCSV.zip'
> GeoIPCountryCSV.zip  100% |***|  2338k  0:00:00 
> ETA
> Download completed (2394696 bytes)
> Connecting to 2400:cb00:2048:1::6810:252f:80
> Writing to 'w;o▒w;o▒ntryCSV.zip'
> w;o▒w;o▒ntryCSV.zip  100% |***|  1496k  0:00:00 
> ETA
> Download completed (1532219 bytes)
> 
> vs.
> 
> :/tmp# wget http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz 
> http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
> Downloading 
> 'http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz'
> Connecting to 2400:cb00:2048:1::6810:262f:80
> Writing to 'GeoIPv6.csv.gz'
> GeoIPv6.csv.gz   100% |***|  1496k  0:00:00 
> ETA
> Download completed (1532219 bytes)
> Connecting to 2400:cb00:2048:1::6810:252f:80
> Writing to 'w▒o▒w▒o▒csv.gz'
> w▒o▒w▒o▒csv.gz   100% |***|  2338k  0:00:00 
> ETA
> Download completed (2394696 bytes)
> 
> this is on a Lede 17.01-SNAPSHOT, r3535+35-ee32de4 with '/bin/wget -> 
> uclient-fetch' on an Ubiquiti Loco M2.
> 
> ..ede


Thank you both for looking into this.

I poked around the code last night after sending out that email, and found that 
“output_file” was being overloaded and this was causing some side-effects.

I have a tentative fix which I’ll send out.

-Philip


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] Busybox weirdness

2017-11-02 Thread edgar . soldin
hey Phillip,

On 02.11.2017 03:36, Philip Prindeville wrote:
> Can someone else please try to reproduce this?
 
yes, not exactly but wrong resulting file name nonetheless. it's obviously a 
bug. looks like a variable reuse went awry as it always hit's the second file, 
having fragments of the first file's name. i switched the files you downloaded, 
just to test if there might be a server side influence.

:/tmp# wget 
http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip 
http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz
Downloading 
'http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip'
Connecting to 2400:cb00:2048:1::6810:262f:80
Writing to 'GeoIPCountryCSV.zip'
GeoIPCountryCSV.zip  100% |***|  2338k  0:00:00 ETA
Download completed (2394696 bytes)
Connecting to 2400:cb00:2048:1::6810:252f:80
Writing to 'w;o▒w;o▒ntryCSV.zip'
w;o▒w;o▒ntryCSV.zip  100% |***|  1496k  0:00:00 ETA
Download completed (1532219 bytes)

vs.

:/tmp# wget http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz 
http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
Downloading 'http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz'
Connecting to 2400:cb00:2048:1::6810:262f:80
Writing to 'GeoIPv6.csv.gz'
GeoIPv6.csv.gz   100% |***|  1496k  0:00:00 ETA
Download completed (1532219 bytes)
Connecting to 2400:cb00:2048:1::6810:252f:80
Writing to 'w▒o▒w▒o▒csv.gz'
w▒o▒w▒o▒csv.gz   100% |***|  2338k  0:00:00 ETA
Download completed (2394696 bytes)

this is on a Lede 17.01-SNAPSHOT, r3535+35-ee32de4 with '/bin/wget -> 
uclient-fetch' on an Ubiquiti Loco M2.

..ede



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] Busybox weirdness

2017-11-02 Thread tv.debian--- via Lede-dev
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---

On 02/11/2017 09:42, Philip Prindeville wrote:



On Nov 1, 2017, at 8:36 PM, Philip Prindeville 
 wrote:

Can someone else please try to reproduce this?

I’m using busybox’s wget on x86_64 hardware, and when I do a “wget” of 2 http: 
URI’s, it mangles the second URI’s derived filename:


root@lede:/tmp/x# c
Downloading 'http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz'
Connecting to 104.16.37.47:80
Writing to 'GeoIPv6.csv.gz'
GeoIPv6.csv.gz   100% |***|  1496k  0:00:00 ETA
Download completed (1532219 bytes)
Connecting to 104.16.37.47:80
Writing to ' z;'
z;   100% |***|  2338k  0:00:00 ETA
Download completed (2394696 bytes)
root@lede:/tmp/x# ls
z;??  GeoIPv6.csv.gz
root@lede:/tmp/x#


What the heck?

-Philip



Well, I was selecting busybox’s wget, but it was silently being overwritten by 
something else:

root@lede:/tmp/x# ls -l /bin/wget
lrwxrwxrwx1 root root13 Nov  1 19:17 /bin/wget -> 
uclient-fetch
root@lede:/tmp/x#

so that’s the real culprit.


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev



I can reproduce partially (17.01.4), here I get garbled filename that 
seems due to charset mismatch:


wget http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz 
http://geolite.maxmind.com/download/geoip/da

tabase/GeoIPCountryCSV.zip
Downloading 
'http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz'

Connecting to 2400:cb00:2048:1::6810:262f:80
Writing to 'GeoIPv6.csv.gz'
GeoIPv6.csv.gz   100% |***|  1496k 
0:00:00 ETA

Download completed (1532219 bytes)
Connecting to 2400:cb00:2048:1::6810:252f:80
Writing to '��csv.gz'
��csv.gz   100% |***|  2338k 
0:00:00 ETA

Download completed (2394696 bytes)

It also misbehaves if the download is somehow redirected over https, for 
example while downloading wrtbwmon i get:


wget 
https://github.com/Kiougar/luci-wrtbwmon/releases/download/v0.6.0/luci-wrtbwmon_0.6.0_all.ipk
Downloading 
'https://github.com/Kiougar/luci-wrtbwmon/releases/download/v0.6.0/luci-wrtbwmon_0.6.0_all.ipk'

Connecting to 192.30.253.112:443
Redirected to 
/77686685/247a31e2-494d-11e7-818a-29601f00a0dc?X-Amz-Algorithm=AWS4-HMAC-SHA256=AKIAIWNJYAX4CSVEH53A%2F20171102%2Fus-east-1%2Fs3%2Faws4_request=20171102T073145Z=300=fc898a693aeb4664ba1bc51de9ae2d2f791707e50829d7fb9b4ceaae4d99bd53=host_id=0=attachment%3B%20filename%3Dluci-wrtbwmon_0.6.0_all.ipk=application%2Foctet-stream 
on github-production-release-asset-2e65be.s3.amazonaws.com
Writing to 
'247a31e2-494d-11e7-818a-29601f00a0dc?X-Amz-Algorithm=AWS4-HMAC-SHA256'
247a31e2-494d-11e7-8 100% |***|  5245 
0:00:00 ETA

Download completed (5245 bytes)

None of this happens with plain wget (and ca-certificates) installed.

--- End Message ---
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] Busybox weirdness

2017-11-01 Thread Philip Prindeville

> On Nov 1, 2017, at 8:36 PM, Philip Prindeville 
>  wrote:
> 
> Can someone else please try to reproduce this?
> 
> I’m using busybox’s wget on x86_64 hardware, and when I do a “wget” of 2 
> http: URI’s, it mangles the second URI’s derived filename:
> 
> 
> root@lede:/tmp/x# wget 
> http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz 
> http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
> Downloading 
> 'http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz'
> Connecting to 104.16.37.47:80
> Writing to 'GeoIPv6.csv.gz'
> GeoIPv6.csv.gz   100% |***|  1496k  0:00:00 
> ETA
> Download completed (1532219 bytes)
> Connecting to 104.16.37.47:80
> Writing to ' z;'
> z;   100% |***|  2338k  0:00:00 ETA
> Download completed (2394696 bytes)
> root@lede:/tmp/x# ls
> z;??  GeoIPv6.csv.gz
> root@lede:/tmp/x# 
> 
> 
> What the heck?
> 
> -Philip


Well, I was selecting busybox’s wget, but it was silently being overwritten by 
something else:

root@lede:/tmp/x# ls -l /bin/wget
lrwxrwxrwx1 root root13 Nov  1 19:17 /bin/wget -> 
uclient-fetch
root@lede:/tmp/x#

so that’s the real culprit.


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] Busybox weirdness

2017-11-01 Thread Philip Prindeville
Can someone else please try to reproduce this?

I’m using busybox’s wget on x86_64 hardware, and when I do a “wget” of 2 http: 
URI’s, it mangles the second URI’s derived filename:


root@lede:/tmp/x# wget 
http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz 
http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
Downloading 'http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz'
Connecting to 104.16.37.47:80
Writing to 'GeoIPv6.csv.gz'
GeoIPv6.csv.gz   100% |***|  1496k  0:00:00 ETA
Download completed (1532219 bytes)
Connecting to 104.16.37.47:80
Writing to ' z;'
 z;   100% |***|  2338k  0:00:00 ETA
Download completed (2394696 bytes)
root@lede:/tmp/x# ls
 z;??  GeoIPv6.csv.gz
root@lede:/tmp/x# 


What the heck?

-Philip


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev