# HG changeset patch # User HackBot # Date 1487211824 0 # Node ID bae4827d5de82034ca73196e888e3dd37840ac81 # Parent 429f3ab1a9418ff27b895998d87d2f386e5503b0 ` sed -i -e \'s/|tmp//;10i\\\' -e \' elif re.match(r"tmp/(?:|$)",f):\' -e \'10i\\\' -e \' print ("http://www2.codu.org/projects/hackbot/" + urllib.quote(f))\' bin/url diff -r 429f3ab1a941 -r bae4827d5de8 bin/url --- a/bin/url Thu Feb 16 01:06:03 2017 +0000 +++ b/bin/url Thu Feb 16 02:23:44 2017 +0000 @@ -5,8 +5,10 @@ else: f = os.path.abspath(sys.argv[1]) f = re.sub(r"^/+hackenv/", "", f) - if re.match(r"/|(?:\.hg|tmp)(?:/|$)",f): + if re.match(r"/|(?:\.hg)(?:/|$)",f): sys.exit("File is outside web-viewable filesystem repository.") + elif re.match(r"tmp/(?:|$)",f): + print ("http://www2.codu.org/projects/hackbot/" + urllib.quote(f)) else: print ("http://codu.org/projects/hackbot/fshg/index.cgi/file/tip/" + urllib.quote(f))