git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] remote-mediawiki: limit filenames to legal

From
Antoine Beaupré <anarcat@debian.org>
Date
Oct 30, 2017, 12:31 UTC
Message-ID
<87h8ug7r75.fsf@curie.anarc.at>
In-Reply-To
<q7h9fua0zzz0.fsf@orange.lip.ens-lyon.fr>
On 2017-10-30 11:34:11, Matthieu Moy wrote:
Show 14 quoted lines
> Antoine Beaupré <anarcat@debian.org> writes:
>
>> @@ -52,7 +53,7 @@ sub smudge_filename {
>>  	$filename =~ s/ /_/g;
>>  	# Decode forbidden characters encoded in clean_filename
>>  	$filename =~ s/_%_([0-9a-fA-F][0-9a-fA-F])/sprintf('%c', hex($1))/ge;
>> -	return $filename;
>> +	return substr($filename, 0, NAME_MAX-3);
>
> There's a request to allow a configurable extension (.mediawiki would
> help importing in some wikis, see
> https://github.com/Git-Mediawiki/Git-Mediawiki/issues/42). You should at
> least make this stg like length(".mw") so that the next search&replace
> for ".mw" finds this.
I believe I did that in v3.
> Also, note that your solution works for using Git-Mediawiki in a
> read-only way, but if you start modifying and pushing such files, you'll
> get into trouble. It probably makes sense to issue a warnign in such
> case.

True. I didn't consider that, but then again the patch is not a regression: you couldn't have pushed those repos in the first place anyways...

A.
-- 
The history of any one part of the earth, like the life of a soldier,
consists of long periods of boredom and short periods of terror.
                       - British geologist Derek V. Ager
Previous: Matthieu MoyNext: Antoine Beaupré
Message 4 of 6 in “remote-mediawiki: limit filenames to legal”
  1. remote-mediawiki: limit filenames to legalAntoine Beaupré, Oct 29, 2017
  2. remote-mediawiki: limit filenames to legalAntoine Beaupré, Oct 29, 2017
  3. Matthieu MoyOct 30, 2017
  4. Antoine BeaupréOct 30, 2017
  5. Antoine Beaupré, Oct 29, 2017
  6. remote-mediawiki: limit filenames to legalAntoine Beaupré, Oct 29, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.