isSafeLocalBaseName

fnbool isSafeLocalBaseName(scope const(ubyte)[] name) pure nothrow @safe @nogc

Reports whether a protocol-supplied name is safe to use as a local destination base name and as a C-header name.

A safe name is a single non-empty path component of at most ScpLimits.nameMax bytes that is not . or .. and contains no NUL byte, directory separator, or backslash. Header names are framed by newlines and otherwise passed through verbatim (spaces and other ordinary bytes are legal, matching OpenSSH's rest-of-line parsing). Callers creating local files from remote names must join such a name under their chosen directory without normalizing away the check.

Parameters

nameBase name bytes from a control header.

Returns

true when the name may be used as a local base name.