Re: text to html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 07/05/2010 03:20 AM, John Doe wrote:
> From: Jozsi Avadkan<jozsi.avadkan@xxxxxxxxx>
>    
>> input: http://pastebin.com/raw.php?i=MqPXZwc3
>> output: http://pastebin.com/raw.php?i=8QCkp4yv
>> i have to make a "one liner" that get's the input,
>> and gives the mentioned output.--
>>      
> Here's my one line:
> awk -F/ ' { if (p != $1) { p=$1; print "<br>\n<br><font size=4>"$1"</font><br>"; } split($2, a, /\./); t=a[1]; print"<a href=\""$0"\">"t"</a>"; } '<MYFILE>
>
> JD
>
>
>
>    

Both your solution and Jozsi's can produce severe security problems if 
<>& or " are present in the data. For example:

bash/get-ssl-certificate-from-a-domain.html
debian/turn-off-all-logging.html?<!--#include file="/etc/password" -->
debian/hosts/hosts.html

will do *bad things* if loaded from an Apache server with server side 
includes turned on.

-- 
Benjamin Franz
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux