Re: fetch extension - use local filename from content-dispositionheader (new diff)
- From: Martin Cracauer <cracauer@xxxxxxxx>
- Date: Fri, 30 Dec 2005 12:52:27 -0500
Allright.
Polishing:
- disallow "/" anywhere in the filename
- disallow "." at the beginning
- replace all chars less than ' ' or > 127 with "_"
- use a static buffer of size [MAX_PATH] instead of allocated memory,
to be fail-safe against memory leaks from other applications using
libfetch
- typo corrected, style fixes, manual entries
I also added a "-Q" flag which will print the resulting filename to
stdout. This is useful in scripting.
Diff on
http:/www.cons.org/tmp/freebsd-fetch-O2.diff
When discussing, keep in mind that the user has to explicity give the
-O option (there is no environment variable to permanently turn this
on) and that the implications of the -O options are very clear and
simple. And that the main use of this is for folks who have to go
through a gazillion of Bugzilla attachments all name
"customer-errlog.20051220" etc, and there is no other way to download
them in a name-preserving manner than interactively opening them in
Mozilla and saving them.
Before we randomize the list even more I would say I'd like to hear
from the security officer if there is concern left. Myself I have no
way to form conflicting user opinions into a decision. For the
reasons above I plan to go forward if not vetoed.
Martin
--
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@xxxxxxxx> http://www.cons.org/cracauer/
FreeBSD - where you want to go, today. http://www.freebsd.org/
_______________________________________________
freebsd-current@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: fetch extension - use local filename from content-dispositionheader (new diff)
- From: Colin Percival
- Re: fetch extension - use local filename from content-dispositionheader (new diff)
- From: Dag-Erling Smørgrav
- Re: fetch extension - use local filename from content-dispositionheader (new diff)
- References:
- Re: fetch extension - use local filename from content-disposition header
- From: Martin Cracauer
- Re: fetch extension - use local filename from content-dispositionheader
- From: Matt Emmerton
- Re: fetch extension - use local filename from content-dispositionheader
- From: Andrey Chernov
- Re: fetch extension - use local filename from content-disposition header
- Prev by Date: Re: Updated doxygen docs of parts of the kernel
- Next by Date: Re: fetch extension - use local filename from content-dispositionheader (new diff)
- Previous by thread: Re: fetch extension - use local filename from content-dispositionheader
- Next by thread: Re: fetch extension - use local filename from content-dispositionheader (new diff)
- Index(es):