A subweb named
RCS
is problematic. Let's say the
Main
web has the subweb
Main/RCS
.
TWiki::Store::RcsWrap::initText()
called for a topic in the Main web ends up creating an RCS file in the
data/Main/RCS/
directory. Let's say
Main/RCS.FooBar
topic already exists but
Main.FooBar
does not. Then, if
Main.FooBar
is created,
data/Main/RCS/FooBar.txt,v
is tried to be created but it already exists for
Main/RCS.FooBar
, so it fails.
The top level web
RCS
doesn't cause problems because there are no files to be handled with RCS in the
data
directory.
A topic named
RCS
doesn't cause problems even with attachments. Attachment files of a topic named
RCS
are put under the directory
pub/WEB_NAME/RCS/
, but there is no files in the
pub/WEB_NAME/
directory -- only directories are there. So there is no chance of an RCS file to be created for a file directly under the
pub/WEB_NAME/
directory.
I'd propose to introduce
$TWiki::cfg{InvalidWebNameRegex}
and use it in
TWiki::isValidWeb()
in the following manner.
my $sys = shift;
+return 0 if ( $name =~ /$TWiki::cfg{InvalidWebNameRegex}/o );
return 1 if ( $sys && $name =~ m/^$regex{defaultWebNameRegex}$/o );
In
lib/TWiki.spec
:
$TWiki::cfg{InvalidWebNameRegex} = '[./]RCS\\b';
This doesn't prevent the top level web
RCS
while forbidding a subweb named RCS to be created. At the same time, it prevents a subweb named
TOP_LEVEL/RCS/THIRD_LEVEL
from being created, which would cause problems.
--
TWiki:Main/HideyoImazu
- 2018-04-19
Based on a discussion at
TWiki:Codev/KampalaReleaseMeeting2018x04x19
, $TWiki::cfg{InvalidWebName} value is made a string.
--
TWiki:Main.HideyoImazu
- 2018-04-20