EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SolFS paths containing ".."

Posted: 03/03/2014 21:26:24
by Jeremy Spiegel (Standard support level)
Joined: 01/29/2014
Posts: 30

I'm not seeing SolFS handle path traversal with ".." components referring to the parent directory. For example, when trying to use it in a destination path in a call to DeleteAndRenameFile, I'm seeing the function fail. Is this expected? Thanks.
Posted: 03/04/2014 00:32:06
by Eugene Mayevski (Team)

Please provide the details about the problem - how it looks like and how it can be reproduced. Also please specify the edition (App, OS) and environment (OS, platform etc).

Sincerely yours
Eugene Mayevski
Posted: 03/04/2014 00:57:01
by Alexander Plas (Team)


SolFS handles ".." and "." in the paths. However, since SolFS doesn't have current directory as dedicated property, path which starts with dot is invalid. In other words you can use pats "/1/../2/../3" as valid path to "/3" but path "../3" is invalid.

Only one place where relative paths are valid is symlink. In this case part is relative to symlink directory. For example, if the link "/1/link" contains path "../2/file", this path is valid and the link resolves to "/2/file".
Posted: 03/04/2014 01:17:42
by Jeremy Spiegel (Standard support level)
Joined: 01/29/2014
Posts: 30

Hi, I'm using SolFS Application edition on the mac. The following code sets up a file in a directory:
        SolFSStorage storage;
        SolFSStream(&storage, "/dir1/dir2/file", "w").Write("abcd", 4);

The following code successfully moves the file:
        storage.DeleteAndRenameFile("/dir1/dir2/file", "/dir1/file");

However, the following fails with error -9 "Path not found":
        storage.DeleteAndRenameFile("/dir1/dir2/file", "/dir1/dir2/../file");

If SolFS was handling the ".." in the new file path, I would expect both to work. Thanks for your help!



Topic viewed 4038 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!