Skip to content

Restrict directory names #354

Closed
Closed
@thorehusfeldt

Description

@thorehusfeldt

In 2023-07-draft, we have

All file names for files included in the package must match the regexp
^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,253}[a-zA-Z0-9]$
i.e., they must be of length at least 2, at most 255, consist solely of lower- or uppercase letters a–z, A–Z, digits 0–9, period, dash, or underscore, but must not begin or end with a period, dash, or underscore.

This allows 1.in, aa and foo.bar.baz_baz-baz but disallows 1_. Fine so far.

For directories, there is no restriction, as far as I can tell. Thus the following are all valid:

  • the testgroup secret/1/,
  • the testcase input file secret/1/1.in
  • the input validator input_validators/v (containing input_validators/v/validate.cpp and input_validators/v/validate.

and so on. I think all of these are fine.

What is also currently allowed, as far as I can tell are

  • the testgroup secret/_/,
  • the testgroup secret/huge.connected,
  • the testcase input file secret/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/1.in,
  • the input validator input_validators/[﷽,
  • the submission directory submissions/😊/th.py,

as well as several other references to validators, testgroups, testcases, visualisers or submissions that use “whatever the operating system supports”.

I propose to tighten the specification as follows:

All names for directories included in the package must match the regexp
^([a-zA-Z0-9][a-zA-Z0-9_-]{0,253}[a-zA-Z0-9]|[a-zA-Z0-9])$
i.e., they must be of length at least 1, at most 255, consist solely of lower- or uppercase letters a–z, A–Z, digits 0–9, dash, or underscore (no period), but must not begin or end with a period, dash, or underscore.

Moreover, I would like to clarify that

Paths that appear in yaml files (including the names of test cases, test groups, or submissions) use the forward slash / to separate names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions