diff options
author | dmcmahill <dmcmahill> | 2002-11-13 01:05:03 +0000 |
---|---|---|
committer | dmcmahill <dmcmahill> | 2002-11-13 01:05:03 +0000 |
commit | 0edb9c846bd9f41f071b5626f0169effa3083e3b (patch) | |
tree | 36c60a3834ab5f9fe0e29919123d6b76f445e4d1 | |
parent | e75c17997d607c0cc80b65cad3d800adaf883bd9 (diff) | |
download | pkgsrc-0edb9c846bd9f41f071b5626f0169effa3083e3b.tar.gz |
- replace & with & _before_ replacing < with < and > with > when
escaping html output.
- properly escape the URL in the link and the displayed URL in the vulnerability
list to handle the '&' character in URL's.
-rwxr-xr-x | mk/bulk/genreadme.awk | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/mk/bulk/genreadme.awk b/mk/bulk/genreadme.awk index 90719f36bac..2d8843f6fb2 100755 --- a/mk/bulk/genreadme.awk +++ b/mk/bulk/genreadme.awk @@ -1,5 +1,5 @@ #!/usr/bin/awk -f -# $NetBSD: genreadme.awk,v 1.1 2002/11/11 21:51:05 dmcmahill Exp $ +# $NetBSD: genreadme.awk,v 1.2 2002/11/13 01:05:03 dmcmahill Exp $ # # Copyright (c) 2002 The NetBSD Foundation, Inc. # All rights reserved. @@ -273,6 +273,7 @@ END { nm=dpkgs[i]; # we need a zillion escapes here because we need to end up with \\< in 'htmldeps' so that when # we gsub htmldeps into the output file, we end up with < + gsub(/&/,"\\\\\\&",nm); gsub(/</,"\\\\\\<",nm); gsub(/>/,"\\\\\\>",nm); htmldeps=htmldeps " <a href=\"../../" pat2dir[dpkgs[i]] "/"readme_name"\">" nm "</a>"; @@ -287,11 +288,18 @@ END { if(debug) printf("Checking for %s (%s) vulnerabilities\n",toppkg,pkgbase); while(i in vulpkg) { nm=vulpkg[i]; + gsub(/&/,"\\\\\\&",nm); gsub(/</,"\\\\\\<",nm); gsub(/>/,"\\\\\\>",nm); + url=vulref[i]; + gsub(/&/,"\\\\\\&",url); + printurl=vulref[i]; + gsub(/&/,"\\\\\\&",printurl); + gsub(/</,"\\\\\\<",printurl); + gsub(/>/,"\\\\\\>",printurl); if(vulpkg[i] ~ "^"pkgbase"[-<>=]+[0-9]") { vul=sprintf("%s<STRONG><LI> %s has a %s exploit (see <a href=\"%s\">%s</a> for more details)</STRONG>\n", - vul,nm,vultype[i],vulref[i],vulref[i]); + vul,nm,vultype[i],url,printurl); } i=i+1; } |