Skip to main content

owner_of_longname

Function owner_of_longname 

Source
pub fn owner_of_longname(longname: &str) -> Option<&str>
Expand description

The owner’s account name out of an SFTP v3 longname, if one can be read with confidence.

Version 3 says only that the field looks like ls -l output, so this parses a convention rather than a grammar, and it is written to decline rather than to guess. That direction is the whole point. The one thing this feeds is the check that an annotation log belongs to the account its filename names, and a wrongly parsed owner would accuse a real person of writing somebody else’s log — strictly worse than having no check at all. So the leading fields are all validated, and anything unfamiliar yields None, which the caller reports as “not checked” rather than as agreement.

Nothing past the size is looked at. The name at the end may contain spaces, and the date is the ls -l mixture of Mon DD HH:MM and Mon DD YYYY depending on the file’s age — neither is needed here, so neither is interpreted.