[RFC] Netx: clean up path sanitization code

Deepak Bhole dbhole at redhat.com
Tue Jun 29 11:05:26 PDT 2010


* Andrew John Hughes <ahughes at redhat.com> [2010-06-29 12:58]:
> On 29 June 2010 00:47, Omair Majid <omajid at redhat.com> wrote:
> > On 06/24/2010 07:37 PM, Andrew John Hughes wrote:
> >>
> >> On 24 June 2010 17:04, Omair Majid<omajid at redhat.com>  wrote:
> >>>
> >>> Hi,
> >>>
> >>> The attached patch does a little bit of refactoring, moving path
> >>> manipulation functions to a common location.
> >>>
> >>> Any comments?
> >>>
> >>> Cheers,
> >>> Omair
> >>>
> >>
> >> Looks good.  It's more than just cleanup though, as the behaviour of
> >> sanitizeFileName has changed.  It now only replaces ILLEGAL_CHARS and
> >> not all characters that aren't in the legal set.
> >>
> >
> > Yes, it is more than cleanup. There were two conflicting file sanitization
> > schemes. One (which sanitized path names) used a blacklisting approach and
> > only disallowed certain characters. The other (which sanitized file names)
> > used a whitelisting approach and disallowed everything except alphanumeric
> > characters. I wrote this code. For the sake of consistency, we want both
> > sanitization schemes to return the same file name. There is a problem with
> > the whitelisting approach: it can not deal with international file names.
> > Hence I am making both the functions use the black listing approach. Please
> > let me know if there are any issues I may have missed.
> >
> 
> Yes, I understood the need for and agree with the change.  But you do
> need to make sure it's mentioned clearly in the ChangeLog... :-)
> 

Agreed here as well. Assuming it is tested, please commit.

Cheers,
Deepak

> >> I'd also make the two arrays private and final.
> >>
> >
> > Done
> >
> > Cheers,
> > Omair
> >
> 
> 
> 
> -- 
> Andrew :-)
> 
> Free Java Software Engineer
> Red Hat, Inc. (http://www.redhat.com)
> 
> Support Free Java!
> Contribute to GNU Classpath and the OpenJDK
> http://www.gnu.org/software/classpath
> http://openjdk.java.net
> 
> PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
> Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8



More information about the distro-pkg-dev mailing list