Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Pygopherd bug (files with ".." in them)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dankoozy  
View profile  
 More options Jan 16 2011, 10:53 am
Newsgroups: comp.infosystems.gopher
From: Dankoozy <w...@pineapple.vg>
Date: Sun, 16 Jan 2011 15:53:04 +0000
Local: Sun, Jan 16 2011 10:53 am
Subject: Pygopherd bug (files with ".." in them)
I was trying to host some files on my pygopherd server and found that if
the directory contained a file with two dots in a row wouldnt load.

I found the function below in handlers/base.py was causing the problem.
before it was searching for ".." in the selector, instead i have it
searching for ../ and /.. now. below is the new function i made, just
wondering if i'm after introducing more bugs now?

     def isrequestsecure(self):
         """An auxiliary to canhandlerequest.  In order for this handler
         to be selected for handling a given request, both the securitycheck
         and the canhandlerequest should be invoked.  The securitycheck is
         intended to be a short, small, quick check -- usually not even
         looking at the filesystem.  Here is a default.  Returns true
         if the request is secure, false if not.  By default, we eliminate
         ./, ../, and //  This is split out from canhandlerequest becase
         it could be too easy to forget about it there."""
         return (self.selector.find("./") == -1) and \
                (self.selector.find("../") == -1) and \
                (self.selector.find("//") == -1) and \
                (self.selector.find(".\\") == -1) and \
                (self.selector.find("\\\\") == -1) and \
                (self.selector.find("\0") == -1) and \
                 (self.selector.find("/..") == -1)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »