Skip to content

Fix expand tilde and invalid path chars on windows

mjptree requested to merge mjptree/arti:fix-expand-tilde-on-windows into main

The crate shellexpand contained an error for windows platforms, where tilde characters where only expanded correctly, if preceeded by a forward slash. Although, a patch is currently in the pipeline, the crate owner has not merged it for almost a year and the repo generally appears inactive.

Further, the colon ':' character is disallowed in filepaths on windows, as it is used on the NTFS filesystem to delimit alternative data streams (e.g. %HOMEPATH%\Downloads\readme.txt:Zone.Identifier). The violation occurs in tor_dirmgr::src::storage::sqlite::SqliteStore::save_blob_internal in the filename generation.

This patch therefore breaks backwards compatibility, but the given issues would prohibit windows portability as well.

The following unit tests that failed on windows are addressed by this patch:

Merge request reports

Loading