Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Keep relative symbolic links relative #85

Closed
dennda opened this Issue Nov 8, 2013 · 0 comments

Comments

Projects
None yet
1 participant
Contributor

dennda commented Nov 8, 2013

Currently, the library will resolve symbolic links that are relative into absolute paths, using the current working directory of the process that's doing the unzipping, which to me seems pretty wrong.

dennda added a commit to dennda/ssziparchive that referenced this issue Nov 8, 2013

Issue #85: Keep relative symbolic links relative.
Before, the library resolved symbolic links that are relative
into absolute paths, using the current working directory of the process
that's doing the unzipping, which to me seems pretty wrong.
This was due to using -[NSURL fileURLWithPath:], which transforms
relative URLs to absolute URLs automatically.

I don't see much of a reason to use NSFileManager here, so I made that
use symlink() directly. Alternatively, one could also use -[NSURL
URLWithString:].

This keeps relative symlinks relative after unzipping.

dennda added a commit to dennda/ssziparchive that referenced this issue Nov 8, 2013

Issue #85: Add test for relative symlink preservation patch.
This test adds a fixture RelativeSymlinks.zip with the following
structure:

    RelativeSymbolicLink
    ├── symlinkedFile
    ├── symlinkedFolder
    └── symlinks
       ├── fileSymlink -> ../symlinkedFile
       └── folderSymlink -> ../symlinkedFolder

The test checks if both `fileSymlink` and `folderSymlink` still point to
the respective files in the parent directory after the fixture has been
unzipped.

soffes added a commit that referenced this issue Nov 8, 2013

Merge pull request #86 from dennda/master
Issue #85: Keep relative symbolic links relative.

@dennda dennda closed this Jan 16, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment