Skip to content

Paths with intermediate subdirectories are not invalid #193

@vt-alt

Description

@vt-alt

The link validity check is too strict:

    /* The linkname must not contain '/' in the middle. */
    char *slash = strchr(linkname, '/');
    if (slash) {
        int linkname_len = strnlen(linkname, MAX_FILENAME_LEN) - 1;
        if (slash - linkname != linkname_len) {
            return LINK_INVALID;
        }
    }

    /* '/' must be at the end to be a valid directory name */
    if (linkname[strnlen(linkname, MAX_FILENAME_LEN) - 1] == '/') {
        return LINK_UNINITIALISED_DIR;
    }

For example, we have page https://git.altlinux.org/tasks/archive/done/_395/404560/ but the index page links to deeper directories than just the next level. Such as href="build/100/i586/". This is not an invalid link, but we can derive there is at least the next level dir build/.

Having this dir listed would be a great addition! Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions