Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does undmg handle symlinks #3

Closed
bwolf opened this issue Apr 16, 2019 · 5 comments
Closed

Does undmg handle symlinks #3

bwolf opened this issue Apr 16, 2019 · 5 comments

Comments

@bwolf
Copy link

bwolf commented Apr 16, 2019

I tried it with a dmg containing relative symlinks like https://github.com/qutebrowser/qutebrowser/releases/download/v1.6.1/qutebrowser-1.6.1.dmg and all symlinks aren't present. Instead it seems the links are followed and copied, which does not work in the case of directory links. Is this correct and is there a easy way to fix it?

@matthewbauer
Copy link
Owner

Yeah, it doesn't look like that's supported. I think it should be pretty easy to fix. The code that handles this logic is right here:

undmg/hfslib.c

Lines 724 to 735 in 2b62ecf

if (type == 0) {
void *buffer = malloc(size);
tarFile->seek(tarFile, curRecord + 512);
tarFile->read(tarFile, buffer, size);
AbstractFile *inFile = createAbstractFileFromMemory(&buffer, size);
add_hfs(volume, inFile, fileName);
free(buffer);
} else if (type == 5) {
newFolder(fileName, volume);
} else if (type == 2) {
makeSymlink(fileName, target, volume);
}

I'm not sure what "type" value is coming up here

@bwolf
Copy link
Author

bwolf commented Apr 17, 2019

I'm currently looking at extractAllInFolder (hfslib.c), adding debug information. The function hfs_untar is unused.

@lilyball
Copy link

I just ran into this issue. I tried to use this to unpack a .app and none of the symlinks were preserved.

@sikmir
Copy link

sikmir commented Jul 28, 2020

@matthewbauer Could you please make a release (1.0.4) to get this fix available in nixpkgs? I ran into this issue with many *.dmg.

@matthewbauer
Copy link
Owner

done in NixOS/nixpkgs#94106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants