Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 634632

Summary: app-text/wgetpaste-2.28-r1 gets confused by string "Location:" in its input
Product: Gentoo Linux Reporter: Ulrich Müller <ulm>
Component: Current packagesAssignee: Maxim Koltsov (RETIRED) <maksbotan>
Status: RESOLVED FIXED    
Severity: normal CC: jstein, zlogene
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Ulrich Müller gentoo-dev 2017-10-18 12:28:30 UTC
If the string "Location:" occurs in the input, wgetpaste gets confused and outputs garbage as the pastebin's location:

   $ echo "abc def Location: http://example.com/" | wgetpaste
   Your paste can be seen here: http://example.com/</textarea>
Comment 1 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2019-02-23 20:21:37 UTC
because the `get_url()` function has a greedy regexp like:

sed -n -e 's|^.*Location: \(https\{0,1\}://[^ ]*\).*$|\1|p' <<< "$*"

I do not know will this help or not if we are getting rid of ^.* (I mean, surely this will help, but I think we gonna face some tricky cases, maybe)
Comment 2 Louis Sautier (sbraz) gentoo-dev 2019-08-27 06:59:46 UTC
Looks like this works with 2.29